@moda/om 19.8.2 → 19.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moda/om",
3
- "version": "19.8.2",
3
+ "version": "19.9.0",
4
4
  "description": "Moda Operandi design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -27,7 +27,7 @@
27
27
  "commitlint": "commitlint",
28
28
  "compile": "rollup -c --bundleConfigAsCjs",
29
29
  "format": "prettier --write '**/*'",
30
- "lint": "eslint src --ext .tsx,.ts --fix",
30
+ "lint": "eslint src",
31
31
  "lint-staged": "lint-staged",
32
32
  "postpublish": "pinst --enable",
33
33
  "predeploy:documentation": "NODE_ENV=production npm run build && cd documentation && npm install && npm run build",
@@ -50,102 +50,104 @@
50
50
  "react-router-dom": "^5.1.2"
51
51
  },
52
52
  "dependencies": {
53
- "@moda/icons": "^5.24.0",
54
- "@moda/tokens": "^5.9.70",
53
+ "@moda/icons": "^5.29.9",
54
+ "@moda/tokens": "^5.10.101",
55
55
  "@storybook/addon-styling": "^1.3.7",
56
- "@types/classnames": "^2.3.0",
56
+ "@types/classnames": "^2.3.4",
57
57
  "classnames": "^2.5.1",
58
- "credit-card-type": "^10.0.0",
59
- "focus-visible": "^5.2.0",
58
+ "credit-card-type": "^10.0.1",
59
+ "focus-visible": "^5.2.1",
60
60
  "proportional-scale": "^4.0.0",
61
- "react-focus-on": "^3.9.2",
61
+ "react-focus-on": "^3.9.4",
62
62
  "react-input-mask": "^2.0.4",
63
63
  "scroll-into-view-if-needed": "^3.1.0",
64
- "storybook": "^8.0.1",
64
+ "storybook": "^8.3.6",
65
65
  "use-cursor": "^1.2.3"
66
66
  },
67
67
  "devDependencies": {
68
- "@babel/core": "^7.24.1",
69
- "@babel/preset-env": "^7.24.1",
70
- "@babel/preset-react": "^7.24.1",
71
- "@babel/preset-typescript": "^7.24.1",
72
- "@commitlint/cli": "^19.2.1",
73
- "@commitlint/config-conventional": "^19.1.0",
68
+ "@babel/core": "^7.25.9",
69
+ "@babel/preset-env": "^7.25.9",
70
+ "@babel/preset-react": "^7.25.9",
71
+ "@babel/preset-typescript": "^7.25.9",
72
+ "@commitlint/cli": "^19.5.0",
73
+ "@commitlint/config-conventional": "^19.5.0",
74
+ "@eslint/js": "^9.13.0",
74
75
  "@moda/rollup-plugin-postcss": "^4.0.1",
75
76
  "@rollup/plugin-babel": "^6.0.4",
76
- "@rollup/plugin-commonjs": "^28.0.0",
77
- "@rollup/plugin-node-resolve": "^15.2.3",
78
- "@storybook/addon-actions": "^8.0.1",
79
- "@storybook/addon-essentials": "^8.0.1",
80
- "@storybook/addon-links": "^8.0.1",
81
- "@storybook/addon-mdx-gfm": "^8.0.1",
77
+ "@rollup/plugin-commonjs": "^28.0.1",
78
+ "@rollup/plugin-node-resolve": "^15.3.0",
79
+ "@storybook/addon-actions": "^8.3.6",
80
+ "@storybook/addon-essentials": "^8.3.6",
81
+ "@storybook/addon-links": "^8.3.6",
82
+ "@storybook/addon-mdx-gfm": "^8.3.6",
82
83
  "@storybook/addon-postcss": "^2.0.0",
83
- "@storybook/addon-viewport": "^8.0.1",
84
+ "@storybook/addon-viewport": "^8.3.6",
84
85
  "@storybook/addon-webpack5-compiler-babel": "^3.0.3",
85
86
  "@storybook/addons": "^7.6.17",
86
- "@storybook/react": "^8.0.1",
87
- "@storybook/react-webpack5": "^8.0.1",
88
- "@testing-library/jest-dom": "^6.4.2",
89
- "@testing-library/react": "^16.0.0",
87
+ "@storybook/react": "^8.3.6",
88
+ "@storybook/react-webpack5": "^8.3.6",
89
+ "@testing-library/jest-dom": "^6.6.2",
90
+ "@testing-library/react": "^16.0.1",
90
91
  "@testing-library/user-event": "^14.5.2",
91
92
  "@types/cheerio": "^0.22.35",
92
- "@types/credit-card-type": "^9.0.0",
93
- "@types/jest": "^29.5.12",
94
- "@types/ramda": "^0.30.0",
95
- "@types/react": "^18.2.67",
96
- "@types/react-dom": "^18.2.22",
93
+ "@types/credit-card-type": "^9.0.3",
94
+ "@types/jest": "^29.5.14",
95
+ "@types/ramda": "^0.30.2",
96
+ "@types/react": "^18.3.12",
97
+ "@types/react-dom": "^18.3.1",
97
98
  "@types/react-input-mask": "^3.0.5",
98
99
  "@types/react-router-dom": "^5.3.3",
99
- "@typescript-eslint/eslint-plugin": "^7.3.1",
100
- "@typescript-eslint/parser": "^7.3.1",
101
- "autoprefixer": "^10.4.18",
102
- "babel-loader": "^9.1.3",
103
- "commitizen": "^4.3.0",
104
- "css-loader": "^7.0.0",
100
+ "@typescript-eslint/eslint-plugin": "^8.11.0",
101
+ "@typescript-eslint/parser": "^8.11.0",
102
+ "autoprefixer": "^10.4.20",
103
+ "babel-loader": "^9.2.1",
104
+ "commitizen": "^4.3.1",
105
+ "css-loader": "^7.1.2",
105
106
  "cz-conventional-changelog": "^3.3.0",
106
- "eslint": "^8.57.0",
107
+ "eslint": "^9.13.0",
107
108
  "eslint-config-prettier": "^9.1.0",
108
- "eslint-config-standard-jsx": "^11.0.0",
109
- "eslint-plugin-import": "^2.29.1",
110
- "eslint-plugin-jest-dom": "^5.1.0",
111
- "eslint-plugin-jsx-a11y": "^6.8.0",
112
- "eslint-plugin-no-loops": "^0.3.0",
109
+ "eslint-plugin-import": "^2.31.0",
110
+ "eslint-plugin-jest-dom": "^5.4.0",
111
+ "eslint-plugin-jsx-a11y": "^6.10.1",
112
+ "eslint-plugin-no-loops": "^0.4.0",
113
113
  "eslint-plugin-node": "^11.1.0",
114
- "eslint-plugin-prettier": "^5.1.3",
115
- "eslint-plugin-promise": "^7.0.0",
116
- "eslint-plugin-react": "^7.34.1",
114
+ "eslint-plugin-prettier": "^5.2.1",
115
+ "eslint-plugin-promise": "^7.1.0",
116
+ "eslint-plugin-react": "^7.37.2",
117
117
  "eslint-plugin-react-hooks": "^5.0.0",
118
118
  "eslint-plugin-standard": "^5.0.0",
119
- "eslint-plugin-testing-library": "^6.2.0",
120
- "husky": "^9.0.11",
119
+ "eslint-plugin-testing-library": "^6.4.0",
120
+ "globals": "^15.11.0",
121
+ "husky": "^9.1.6",
121
122
  "identity-obj-proxy": "^3.0.0",
122
123
  "ignore-not-found-export-webpack-plugin": "^1.0.2",
123
124
  "jest": "^29.7.0",
124
125
  "jest-environment-jsdom": "^29.7.0",
125
126
  "jest-matchmedia-mock": "^1.1.0",
126
- "lint-staged": "^15.2.2",
127
+ "lint-staged": "^15.2.10",
127
128
  "node-sass-package-importer": "^5.3.3",
128
129
  "pinst": "^3.0.0",
129
- "postcss": "^8.4.36",
130
+ "postcss": "^8.4.47",
130
131
  "postcss-loader": "^8.1.1",
131
- "prettier": "^3.2.5",
132
- "ramda": "^0.30.0",
133
- "react": "^18.2.0",
134
- "react-dom": "^18.2.0",
132
+ "prettier": "^3.3.3",
133
+ "ramda": "^0.30.1",
134
+ "react": "^18.3.1",
135
+ "react-dom": "^18.3.1",
135
136
  "react-router-dom": "^5.1.2",
136
- "rollup": "^4.13.0",
137
+ "rollup": "^4.24.0",
137
138
  "rollup-plugin-peer-deps-external": "^2.2.4",
138
139
  "rollup-plugin-scss": "^4.0.0",
139
- "sass": "^1.72.0",
140
- "sass-loader": "^16.0.0",
141
- "semantic-release": "^24.0.0",
140
+ "sass": "^1.80.4",
141
+ "sass-loader": "^16.0.2",
142
+ "semantic-release": "^24.1.3",
142
143
  "semantic-release-npm-github": "^5.0.0",
143
144
  "storybook-states": "^1.2.0",
144
145
  "style-loader": "^4.0.0",
145
- "ts-jest": "^29.1.2",
146
- "typescript": "^5.4.2",
146
+ "ts-jest": "^29.2.5",
147
+ "typescript": "^5.6.3",
148
+ "typescript-eslint": "^8.11.0",
147
149
  "waait": "^1.0.5",
148
- "webpack": "^5.90.3",
150
+ "webpack": "^5.95.0",
149
151
  "webpack-cli": "^5.1.4"
150
152
  },
151
153
  "config": {
@@ -41,7 +41,7 @@ export const Checkbox: React.FC<CheckboxProps> = ({
41
41
  const handleChange = useCallback(
42
42
  (event: React.ChangeEvent<HTMLInputElement>) => {
43
43
  if (typeof checked === 'undefined') setIsChecked(event.currentTarget.checked);
44
- onChange && onChange(event);
44
+ onChange?.(event);
45
45
  },
46
46
  [onChange, checked]
47
47
  );
@@ -40,14 +40,14 @@ export const ColorSwatch: React.FC<ColorSwatchProps> = ({
40
40
  }) => {
41
41
  const handleClick = useCallback(
42
42
  (_event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
43
- onClick && onClick(color, title);
43
+ onClick?.(color, title);
44
44
  },
45
45
  [color, title, onClick]
46
46
  );
47
47
 
48
48
  const handleMouseEnter = useCallback(
49
49
  (_event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
50
- onMouseEnter && onMouseEnter(color, title);
50
+ onMouseEnter?.(color, title);
51
51
  },
52
52
  [color, title, onMouseEnter]
53
53
  );
@@ -69,7 +69,7 @@ export const Popover: React.FC<PopoverProps> = ({
69
69
 
70
70
  const handleMouseEnter = useCallback(() => {
71
71
  if (!open) {
72
- timeout.current && clearTimeout(timeout.current);
72
+ if (timeout.current) clearTimeout(timeout.current);
73
73
  handleOpen();
74
74
  }
75
75
  }, [handleOpen, open]);
@@ -115,7 +115,11 @@ export const Popover: React.FC<PopoverProps> = ({
115
115
  useEffect(() => {
116
116
  if (open === undefined) return;
117
117
 
118
- open ? handleOpen() : handleClose();
118
+ if (open) {
119
+ handleOpen();
120
+ } else {
121
+ handleClose();
122
+ }
119
123
  }, [handleClose, handleOpen, open]);
120
124
 
121
125
  const isOpen =
@@ -71,7 +71,7 @@ export const MultiSelect: React.FC<Props> = ({
71
71
  );
72
72
 
73
73
  useEffect(() => {
74
- onChange && onChange(values);
74
+ onChange?.(values);
75
75
  }, [onChange, values]);
76
76
 
77
77
  return (
@@ -82,7 +82,7 @@ export const Select: React.FC<SelectProps> = ({
82
82
 
83
83
  const handleAutofill = useCallback(
84
84
  (value: string) => {
85
- value && dispatch({ type: 'SELECT', payload: { value } });
85
+ if (value) dispatch({ type: 'SELECT', payload: { value } });
86
86
  },
87
87
  [dispatch]
88
88
  );
@@ -25,7 +25,7 @@ export const SelectOption: React.FC<SelectOptionProps> = ({
25
25
  const handleClick = useCallback(
26
26
  (event: React.MouseEvent<HTMLLIElement>) => {
27
27
  event.preventDefault();
28
- !option.disabled && onClick(option);
28
+ if (!option.disabled) onClick(option);
29
29
  },
30
30
  [onClick, option]
31
31
  );
@@ -51,12 +51,12 @@ export const SelectOptions: React.FC<SelectOptionsProps> = ({
51
51
 
52
52
  useEffect(() => {
53
53
  if (autoFocus) {
54
- ref.current && ref.current.focus();
54
+ ref.current?.focus();
55
55
  }
56
56
  }, [autoFocus]);
57
57
 
58
58
  useUpdateEffect(() => {
59
- onFocus && activeOption && onFocus(activeOption);
59
+ if (activeOption) onFocus?.(activeOption);
60
60
  }, [activeOption, onFocus]);
61
61
 
62
62
  return (
@@ -78,7 +78,7 @@ export const useSelect = ({ value, defaultValue }: UseSelectProps) => {
78
78
  }, [handleKeyDown]);
79
79
 
80
80
  useUpdateEffect(() => {
81
- value && dispatch({ type: 'SELECT', payload: { value } });
81
+ if (value) dispatch({ type: 'SELECT', payload: { value } });
82
82
  }, [value]);
83
83
 
84
84
  return { state, dispatch, Mode, selectRef };