Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.x #2435

Closed
wants to merge 49 commits into from
Closed

v4.x #2435

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2a7feeb
chore: migrate to module css
anuradha9712 Nov 13, 2024
bdd52f6
chore: update usage of classname in dropdown list to module css
anuradha9712 Nov 21, 2024
d4978e2
chore: migrate normal css to module css in toast component
anuradha9712 Nov 21, 2024
3441793
chore: migrate css to module css in AI Components
anuradha9712 Nov 21, 2024
bc1ba60
chore: update folder path for examples app
anuradha9712 Nov 21, 2024
a49f646
chore: update rollup config to support css module in umd bundle with …
anuradha9712 Nov 22, 2024
a0e92eb
Merge pull request #2425 from anuradha9712/v4.x
anuradha9712 Nov 22, 2024
70a605e
chore: update brotli and gzip build config
anuradha9712 Nov 23, 2024
3dcee2e
chore: add package version in css module classes
anuradha9712 Nov 23, 2024
dfc1be4
chore: add pre-major release flow
anuradha9712 Nov 23, 2024
29f31d9
chore: remove lint check flow from workflow
anuradha9712 Nov 24, 2024
731d812
chore: update popover snapshots
anuradha9712 Nov 24, 2024
e63e0d2
chore: extract css from umd bundle
anuradha9712 Nov 24, 2024
9c0b9b6
Merge pull request #2437 from anuradha9712/v4.x
anuradha9712 Nov 25, 2024
b431523
docs(README): add guideline to use module css in contributing guideli…
anuradha9712 Nov 25, 2024
d7e116e
Merge pull request #2438 from anuradha9712/v4.x
anuradha9712 Nov 25, 2024
a5f30fc
feat: migrate molecules to module css
anuradha9712 Dec 7, 2024
31969fc
Merge pull request #2452 from anuradha9712/v4.x
anuradha9712 Dec 10, 2024
51c4fa0
feat(organisms): migrate organisms to css modules
anuradha9712 Dec 11, 2024
63c1816
feat(organisms): migrate organisms to css modules
anuradha9712 Dec 11, 2024
17b089e
chore: remove redundant table classes
anuradha9712 Dec 11, 2024
96b10cd
chore: update css modules usage across components
anuradha9712 Dec 11, 2024
025a923
chore: fix css issue in metric input and popper wrapper
anuradha9712 Dec 11, 2024
962e770
chore: fix test cases for popper wrapper
anuradha9712 Dec 11, 2024
3a79b46
Merge pull request #2454 from anuradha9712/v4.x
anuradha9712 Dec 11, 2024
6a21a1f
chore: replace rollup-plugin-typescript with rollup-plugin-esbuild fo…
anuradha9712 Dec 15, 2024
7e5860c
Merge pull request #2457 from anuradha9712/v4.x
anuradha9712 Dec 15, 2024
b2eaa98
chore: update rollup config for css module classname and examples
anuradha9712 Dec 16, 2024
3c275d9
chore: add storybook postcss addon
anuradha9712 Dec 17, 2024
55046a2
chore: add custom plugin to append css files in umd build
anuradha9712 Dec 17, 2024
ad05656
chore: extract css from cjs and esm bundle
anuradha9712 Dec 17, 2024
8ca0e16
Merge pull request #2458 from anuradha9712/v4.x
anuradha9712 Dec 17, 2024
e091ef9
chore: add autoprefixer and color-mod plugin in umd and esm build
anuradha9712 Dec 17, 2024
557c637
chore: update storybook config for color-mod plugin
anuradha9712 Dec 17, 2024
0e80041
Merge pull request #2459 from anuradha9712/v4.x
anuradha9712 Dec 17, 2024
1a6a3c5
chore: rebase with master branch
anuradha9712 Dec 18, 2024
a4e91cf
chore: update table stories
anuradha9712 Dec 18, 2024
d190781
chore: update table stories
anuradha9712 Dec 18, 2024
ad8183f
Merge pull request #2460 from anuradha9712/v4.x
anuradha9712 Dec 18, 2024
cde2e66
feat(avatar): add presence indicator support in avatar component
anuradha9712 Nov 27, 2024
428c2a0
chore: update package version v3.5.0 and changelog
anuradha9712 Dec 12, 2024
79f5a5e
v3.5.0
anuradha9712 Dec 12, 2024
ff2eb58
chore: migrate to module css
anuradha9712 Nov 13, 2024
dc97366
chore: update popover snapshots
anuradha9712 Nov 24, 2024
fefb558
chore: fix test cases for popper wrapper
anuradha9712 Dec 11, 2024
83ab776
chore: rebase with master branch
anuradha9712 Dec 18, 2024
234e342
chore: update rollup config to include css in esm build:
anuradha9712 Dec 18, 2024
ec9dc2e
chore: resolve rebase issues
anuradha9712 Dec 18, 2024
fb9d87d
Merge pull request #2461 from anuradha9712/v4.x
anuradha9712 Dec 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion . npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.npmrc
docs/
docs/
examples
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules/
public/
coverage/
docs/
rollup.*
rollup.*
examples
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- master
jobs:
release:
# uncomment next line as soon as visual tesing starts working
# uncomment next line as soon as visual testing starts working
# needs: visual_test
name: Release tag
runs-on: ubuntu-latest
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "Release next"
on:
push:
branches:
- v4.x
jobs:
release:
name: Release tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: '20.x'

- name: npm install
run: npm ci

- name: setup git
run: git checkout -b preparing-module-for-npm-publish && git config --global user.email "release-bot@innovaccer.com" && git config --global user.name "release-bot"

- name: bump module version
run: npm version --no-commit-hooks prerelease -m "Released %s [skip ci]"

- name: generate .npmrc
run: cp .npmrc.stub .npmrc

- name: Publish to npm js
run: npm publish --access public --tag=next
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}

- name: remove .npmrc
run: rm -rf .npmrc

- name: push tag to github
run: git push https://${{ secrets.GH_TOKEN }}@github.com/$GITHUB_REPOSITORY.git $(node ./getVersion.js)

- name: remove css/dist dist/ from commit
run: |
git reset HEAD~1
git add package.json
git commit -m "Released $(node ./getVersion.js) [skip ci]" --no-verify

- name: push version to github
run: git push https://${{ secrets.GH_TOKEN }}@github.com/$GITHUB_REPOSITORY.git HEAD:next

- name: deploy storybook
run: npm run deploy-storybook -- --bucket-path=webui-mds-sb-next --aws-profile=NONE --ci
env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_KEY_ID }}
AWS_REGION: ${{ secrets.DOCS_REGION }}

- name: notify release
uses: /innovaccer/design-system/actions/notify-release@next
env:
GCHAT_PATH: ${{ secrets.GCHAT_PATH }}
3 changes: 0 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ jobs:
- name: npm install
run: npm ci

- name: lint
run: npm run lint:check

- name: test
run: npm run test

Expand Down
33 changes: 33 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
const path = require('path');

const cssTokenFiles = [
path.resolve(__dirname, '../css/src/variables/index.css'),
path.resolve(__dirname, '../css/src/tokens/index.css')
];

module.exports = {
stories: ['../core/components/**/*.story.@(js|jsx|ts|tsx)', '../core/ai-components/**/*.story.@(js|jsx|ts|tsx)'],
addons: [
Expand All @@ -16,6 +21,33 @@ module.exports = {
'@storybook/addon-essentials',
'@storybook/addon-a11y',
'@storybook/addon-knobs',
{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss'),
postcssOptions: {
plugins: [
require('autoprefixer'),
require('postcss-color-mod-function')({
importFrom: cssTokenFiles,
}),
],
},
},
},
},
{
name: 'storybook-css-modules',
options: {
cssModulesLoaderOptions: {
importLoaders: 1,
modules: {
localIdentName: '[local]', // Use local class names directly
},
},
},
},
],
typescript: {
check: false,
Expand All @@ -33,6 +65,7 @@ module.exports = {
},
webpackFinal: async (config, { configType }) => {
config.resolve.alias['@'] = path.resolve(__dirname, '../core');
config.resolve.alias['@css'] = path.resolve(__dirname, '../css/src');
config.resolve.alias['@innovaccer/mds-images/ui-states'] = path.resolve(__dirname, '../mds-images/ui-states');
// Return the altered config
return config;
Expand Down
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
## 3.5.0 (2024-12-12)

### Highlights

- feat(avatar): add presence indicator support in avatar component (ce945f26)
- feat(avatar): add status indicator support in avatar (58857846)
- fix(input): update cursor position on input type change (8f45613f)
- fix(table): update table stories structure on storybook (9e3b4d53)
- feat(statusHint): update color for default appearance (a64c5128)

### Breaking changes

NA

### Migration guide

NA

### Deprecations

NA

### Features

- feat(avatar): add presence indicator support in avatar component (ce945f26)
- feat(avatar): add status indicator support in avatar (58857846)
- feat(statusHint): update color for default appearance (a64c5128)

### Fixes

- fix(input): update cursor position on input type change (8f45613f)

### Improvements

- chore: fix lint error in dropzone component & toast figma connect (9c8a41ec)
- fix(progressIndicators): update story of spinner and progress ring (506ca9b1)
- fix(table): update table stories structure on storybook (9e3b4d53)
- refactor(table): update table props description on storybook (f041f10f)

### Documentation

- docs(docs): add status and presence indicator documentation in avatar (dc14464c)
- docs(docs): update table preview link in documentation (1df056c2)

---

## 3.4.0 (2024-11-18)

### Highlights
Expand Down
30 changes: 15 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,28 +279,28 @@ const AvatarAppearance =
appearance || colors[(initials.charCodeAt(0) + (initials.charCodeAt(1) || 0)) % 8] || DefaultAppearance;
```

- [ClassNames](https://www.npmjs.com/package/classnames) is a utility for conditionally joining CSS classNames together.
- CSS is added according to [BEM Convention](http://getbem.com/naming/).
- CSS Module has been used to define the class names.

1. Create a CSS file inside `css` directory with the file extension `module.css` (e.g `avatar.module.css`)
2. Import the CSS file inside your component's `.tsx` file using:

```jsx
import styles from './avatar.module.css';
```

3. Use [ClassNames](https://www.npmjs.com/package/classnames), a utility for conditionally joining CSS classNames together.
4. Follow the [BEM Convention](http://getbem.com/naming/) and use CSS Modules for naming CSS classes.

```jsx
const classes = classNames(
{
Avatar: true,
[`Avatar--${size}`]: size,
[`Avatar--${AvatarAppearance}`]: AvatarAppearance,
['Avatar--disabled']: !initials || !withTooltip,
[styles.Avatar]: true,
[styles[`Avatar--${size}`]]: size,
[styles[`Avatar--${AvatarAppearance}`]]: AvatarAppearance,
[styles['Avatar--disabled']]: !initials || !withTooltip,
},
className
);

const ContentClass = classNames({
[`Avatar-content--${size}`]: size,
[`Avatar-content--${AvatarAppearance}`]: AvatarAppearance,
});

const IconClass = classNames({
[`Avatar-content--${AvatarAppearance}`]: AvatarAppearance,
});
```

- Add rendering logic and `data-test` attribute.
Expand Down
1 change: 1 addition & 0 deletions __mocks__/styleMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
9 changes: 5 additions & 4 deletions core/ai-components/AIButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { TButtonAppearance, TButtonType, TBaseHtmlProps } from '../common.type';
import BasicIcon from './icons/Basic.svg';
import BasicDisabledIcon from './icons/BasicDisabled.svg';
import PrimaryIcon from './icons/Primary.svg';
import styles from '@css/ai-components/button.module.css';

export interface AIButtonProps extends TBaseHtmlProps<HTMLButtonElement> {
/**
Expand Down Expand Up @@ -53,15 +54,15 @@ export const AIButton = (props: AIButtonProps) => {

const buttonClassNames = classNames(
{
AIButton: true,
'AIButton--primary': appearance === 'primary',
'AIButton--basic': appearance === 'basic',
[styles.AIButton]: true,
[styles['AIButton--primary']]: appearance === 'primary',
[styles['AIButton--basic']]: appearance === 'basic',
},
className
);

const IconClassNames = classNames({
'AIButton-Icon': true,
[styles['AIButton-Icon']]: true,
});

const buttonIcon = appearance === 'primary' ? PrimaryIcon : disabled ? BasicDisabledIcon : BasicIcon;
Expand Down
13 changes: 7 additions & 6 deletions core/ai-components/AIChip/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react';
import classNames from 'classnames';
import styles from '@css/ai-components/chip.module.css';

export interface AIChipProps extends React.ComponentProps<'button'> {
/**
Expand Down Expand Up @@ -29,22 +30,22 @@ export const AIChip = (props: AIChipProps) => {

const ChipClassNames = classNames(
{
AIChip: true,
'AIChip--disabled': disabled,
[styles.AIChip]: true,
[styles['AIChip--disabled']]: disabled,
},
className
);

const IconClassNames = classNames({
'AIChip-icon': true,
'AIChip-icon--disabled': disabled,
[styles['AIChip-icon']]: true,
[styles['AIChip-icon--disabled']]: disabled,
['material-symbols']: true,
['material-symbols-rounded']: true,
});

const TextClassNames = classNames({
'AIChip-text': true,
'AIChip-text--disabled': disabled,
[styles['AIChip-text']]: true,
[styles['AIChip-text--disabled']]: disabled,
});

return (
Expand Down
11 changes: 6 additions & 5 deletions core/ai-components/AIIconButton/SaraIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import SaraIconTop from './icons/SaraIconTop';
import SaraIconBottom from './icons/SaraIconBottom';
import SaraDisabledTop from './icons/SaraDisabledTop';
import SaraDisabledBottom from './icons/SaraDisabledBottom';
import styles from '@css/ai-components/iconButton.module.css';

interface SaraIconProp {
size: TSize2Hierarchy;
Expand All @@ -16,11 +17,11 @@ export const SaraIcon = (props: SaraIconProp) => {
const { size, position, disabled } = props;

const AIIconClassNames = classNames({
'AIIconButton-AIIcon': true,
'AIIconButton-AIIcon--largeTop': position === 'top' && size === 'large',
'AIIconButton-AIIcon--regularTop': position === 'top' && size === 'regular',
'AIIconButton-AIIcon--regularBottom': position === 'bottom' && size === 'regular',
'AIIconButton-AIIcon--largeBottom': position === 'bottom' && size === 'large',
[styles['AIIconButton-AIIcon']]: true,
[styles['AIIconButton-AIIcon--largeTop']]: position === 'top' && size === 'large',
[styles['AIIconButton-AIIcon--regularTop']]: position === 'top' && size === 'regular',
[styles['AIIconButton-AIIcon--regularBottom']]: position === 'bottom' && size === 'regular',
[styles['AIIconButton-AIIcon--largeBottom']]: position === 'bottom' && size === 'large',
});

if (disabled && position === 'bottom') {
Expand Down
5 changes: 3 additions & 2 deletions core/ai-components/AIIconButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import classNames from 'classnames';
import { TIconPosition, TButtonType, TSize2Hierarchy, TBaseHtmlProps } from '../common.type';
import { Tooltip } from '@/index';
import SaraIcon from './SaraIcon';
import styles from '@css/ai-components/iconButton.module.css';

export interface AIIconButtonProps extends Omit<TBaseHtmlProps<HTMLButtonElement>, 'size'> {
/**
Expand Down Expand Up @@ -64,13 +65,13 @@ export const AIIconButton = (props: AIIconButtonProps) => {

const buttonClassNames = classNames(
{
AIIconButton: true,
[styles.AIIconButton]: true,
},
className
);

const IconClassNames = classNames({
'AIIconButton-icon': true,
[styles['AIIconButton-icon']]: true,
['material-symbols']: true,
['material-symbols-rounded']: true,
});
Expand Down
3 changes: 2 additions & 1 deletion core/ai-components/AIResponse/ChatActionBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import classNames from 'classnames';
import { TBaseHtmlProps } from '../common.type';
import styles from '@css/ai-components/chat.module.css';

export interface ChatActionBarProps extends TBaseHtmlProps<HTMLDivElement> {
/**
Expand All @@ -22,7 +23,7 @@ export const ChatActionBar = (props: ChatActionBarProps) => {

const actionBarClassNames = classNames(
{
'AIResponse-actionBar': true,
[styles['AIResponse-actionBar']]: true,
},
className
);
Expand Down
3 changes: 2 additions & 1 deletion core/ai-components/AIResponse/ChatBox.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as React from 'react';
import classNames from 'classnames';
import { TBaseHtmlProps } from '../common.type';
import styles from '@css/ai-components/chat.module.css';

export interface ChatBoxProps extends TBaseHtmlProps<HTMLDivElement> {
/**
Expand All @@ -22,7 +23,7 @@ export const ChatBox = (props: ChatBoxProps) => {

const chatBoxClassNames = classNames(
{
'AIResponse-box': true,
[styles['AIResponse-box']]: true,
},
className
);
Expand Down
Loading
Loading