@dynamic-framework/ui-react 1.36.1 → 2.0.0-dev.1

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.
Files changed (62) hide show
  1. package/dist/css/dynamic-ui-non-root.css +81 -12
  2. package/dist/css/dynamic-ui-non-root.min.css +2 -2
  3. package/dist/css/dynamic-ui-root.css +1 -1
  4. package/dist/css/dynamic-ui-root.min.css +1 -1
  5. package/dist/css/dynamic-ui.css +81 -12
  6. package/dist/css/dynamic-ui.min.css +2 -2
  7. package/dist/index.esm.js +17 -19
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/index.js +17 -19
  10. package/dist/index.js.map +1 -1
  11. package/dist/js/bootstrap.bundle.js +3 -6
  12. package/dist/js/bootstrap.bundle.min.js +2 -2
  13. package/dist/js/bootstrap.esm.js +3 -6
  14. package/dist/js/bootstrap.esm.min.js +2 -2
  15. package/dist/js/bootstrap.js +3 -6
  16. package/dist/js/bootstrap.min.js +2 -2
  17. package/dist/types/components/DBoxFile/useDBoxFile.d.ts +2 -2
  18. package/dist/types/components/DCarousel/components/DCarouselSlide.d.ts +3 -1
  19. package/dist/types/components/DCollapse/DCollapse.d.ts +1 -1
  20. package/dist/types/components/DInput/DInput.d.ts +1 -1
  21. package/dist/types/components/DInputCounter/DInputCounter.d.ts +1 -1
  22. package/dist/types/components/DInputCurrency/DInputCurrency.d.ts +1 -1
  23. package/dist/types/components/DInputCurrencyBase/DInputCurrencyBase.d.ts +1 -1
  24. package/dist/types/components/DInputMask/DInputMask.d.ts +1 -1
  25. package/dist/types/components/DInputPhone/DInputPhone.d.ts +1 -1
  26. package/dist/types/components/DInputSearch/DInputSearch.d.ts +1 -1
  27. package/dist/types/components/DPopover/DPopover.d.ts +1 -1
  28. package/dist/types/contexts/DContext.d.ts +0 -2
  29. package/dist/types/hooks/tests/useDisableBodyScrollEffect.spec.d.ts +1 -0
  30. package/dist/types/hooks/tests/useDisableInputWheel.spec.d.ts +1 -0
  31. package/dist/types/hooks/tests/useFormatCurrency.spec.d.ts +1 -0
  32. package/dist/types/hooks/tests/useInputCurrency.spec.d.ts +1 -0
  33. package/dist/types/hooks/tests/useItemSelection.spec.d.ts +1 -0
  34. package/dist/types/hooks/tests/useMediaBreakpointUp.spec.d.ts +1 -0
  35. package/dist/types/hooks/tests/useMediaQuery.spec.d.ts +1 -0
  36. package/dist/types/hooks/tests/usePortal.spec.d.ts +1 -0
  37. package/dist/types/hooks/tests/useProvidedRefOrCreate.spec.d.ts +1 -0
  38. package/dist/types/hooks/tests/useStackState.spec.d.ts +1 -0
  39. package/dist/types/hooks/useInputCurrency.d.ts +1 -1
  40. package/dist/types/hooks/useProvidedRefOrCreate.d.ts +1 -1
  41. package/dist/types/types/polymorphic.d.ts +3 -3
  42. package/dist/types/utils/tests/attr-accept.spec.d.ts +1 -0
  43. package/dist/types/utils/tests/changeQueryString.spec.d.ts +1 -0
  44. package/dist/types/utils/tests/configureI18n.spec.d.ts +1 -0
  45. package/dist/types/utils/tests/formatCurrency.spec.d.ts +1 -0
  46. package/dist/types/utils/tests/getCssVariable.spec.d.ts +1 -0
  47. package/dist/types/utils/tests/getKeyboardFocusableElements.spec.d.ts +1 -0
  48. package/dist/types/utils/tests/getQueryString.spec.d.ts +1 -0
  49. package/dist/types/utils/tests/mediaQuery.spec.d.ts +1 -0
  50. package/dist/types/utils/tests/validatePhoneNumber.spec.d.ts +1 -0
  51. package/jest/setup.js +94 -1
  52. package/package.json +28 -29
  53. package/src/style/abstracts/variables/_forms.scss +2 -2
  54. package/src/style/abstracts/variables/_z-index.scss +24 -0
  55. package/src/style/components/_d-icon.scss +1 -1
  56. package/src/style/components/_d-select.scss +3 -3
  57. package/dist/css/bootstrap-icons.css +0 -2106
  58. package/dist/css/bootstrap-icons.json +0 -2080
  59. package/dist/css/bootstrap-icons.min.css +0 -5
  60. package/dist/css/bootstrap-icons.scss +0 -2118
  61. package/dist/css/fonts/bootstrap-icons.woff +0 -0
  62. package/dist/css/fonts/bootstrap-icons.woff2 +0 -0
package/jest/setup.js CHANGED
@@ -1,6 +1,99 @@
1
+ /* eslint-disable react/prop-types */
2
+ const React = require('react');
3
+
1
4
  jest.mock('react-content-loader', () => jest.fn());
2
5
 
3
- jest.mock('react-responsive-pagination', () => jest.fn());
6
+ jest.mock('react-responsive-pagination', () => {
7
+ function MockPagination(props) {
8
+ const {
9
+ current,
10
+ total,
11
+ onPageChange,
12
+ className = '',
13
+ } = props;
14
+
15
+ const handleClick = React.useCallback(
16
+ (page) => {
17
+ if (page !== current && page >= 1 && page <= total) {
18
+ onPageChange(page);
19
+ }
20
+ },
21
+ [current, total, onPageChange],
22
+ );
23
+
24
+ return React.createElement('div', {
25
+ className,
26
+ 'data-testid': 'responsive-pagination',
27
+ }, [
28
+ React.createElement('button', {
29
+ type: 'button',
30
+ key: 'prev',
31
+ onClick: () => handleClick(current - 1),
32
+ disabled: current === 1,
33
+ 'data-testid': 'pagination-previous',
34
+ }, 'Previous'),
35
+
36
+ ...(function getPageButtons() {
37
+ const pageButtons = [];
38
+ const windowSize = 2; // Show current ±2
39
+ const startPage = Math.max(1, current - windowSize);
40
+ const endPage = Math.min(total, current + windowSize);
41
+ // Always show first page
42
+ if (startPage > 1) {
43
+ pageButtons.push(React.createElement('button', {
44
+ key: 1,
45
+ type: 'button',
46
+ onClick: () => handleClick(1),
47
+ 'data-testid': 'pagination-page-1',
48
+ 'aria-current': current === 1 ? 'page' : undefined,
49
+ style: { fontWeight: current === 1 ? 'bold' : 'normal' },
50
+ }, 1));
51
+ if (startPage > 2) {
52
+ pageButtons.push(React.createElement('span', { key: 'start-ellipsis', style: { margin: '0 4px' } }, '...'));
53
+ }
54
+ }
55
+ // Window of page buttons
56
+ for (let page = startPage; page <= endPage; page += 1) {
57
+ if (!(page === 1 && startPage > 1)) {
58
+ pageButtons.push(React.createElement('button', {
59
+ key: page,
60
+ type: 'button',
61
+ onClick: () => handleClick(page),
62
+ 'data-testid': `pagination-page-${page}`,
63
+ 'aria-current': page === current ? 'page' : undefined,
64
+ style: { fontWeight: page === current ? 'bold' : 'normal' },
65
+ }, page));
66
+ }
67
+ }
68
+ // Always show last page
69
+ if (endPage < total) {
70
+ if (endPage < total - 1) {
71
+ pageButtons.push(React.createElement('span', { key: 'end-ellipsis', style: { margin: '0 4px' } }, '...'));
72
+ }
73
+ pageButtons.push(React.createElement('button', {
74
+ key: total,
75
+ type: 'button',
76
+ onClick: () => handleClick(total),
77
+ 'data-testid': `pagination-page-${total}`,
78
+ 'aria-current': total === current ? 'page' : undefined,
79
+ style: { fontWeight: total === current ? 'bold' : 'normal' },
80
+ }, total));
81
+ }
82
+ return pageButtons;
83
+ }()),
84
+
85
+ React.createElement('button', {
86
+ key: 'next',
87
+ type: 'button',
88
+ onClick: () => handleClick(current + 1),
89
+ disabled: current === total,
90
+ 'data-testid': 'pagination-next',
91
+ }, 'Next'),
92
+ ]);
93
+ }
94
+
95
+ return MockPagination;
96
+ });
4
97
 
5
98
  jest.mock('@react-input/mask', () => ({
6
99
  InputMask: jest.fn(),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "sideEffects": [
4
4
  "*.css"
5
5
  ],
6
- "version": "1.36.1",
6
+ "version": "2.0.0-dev.1",
7
7
  "description": "React Dynamic Framework",
8
8
  "license": "https://github.com/dynamic-framework/dynamic-ui/blob/master/libraries/dynamic-ui-react/LICENSE.md",
9
9
  "repository": {
@@ -42,6 +42,7 @@
42
42
  "scripts": {
43
43
  "test": "jest",
44
44
  "test:watch": "jest --watch",
45
+ "test:coverage": "jest --coverage",
45
46
  "test:storybook": "test-storybook",
46
47
  "build": "npm run clean && npm run build:react && npm run build:scss && npm run cp",
47
48
  "build:react": "tsc -p ./tsconfig.build.json && rollup -c rollup.config.mjs",
@@ -66,12 +67,13 @@
66
67
  "publish:cdn-version": "node scripts/publish-cdn.js",
67
68
  "publish:cdn-latest": "aws s3 sync ./dist/ s3://dynamicframework-cdn/assets/latest/ui-react --delete --acl public-read",
68
69
  "publish:cdn-rc": "aws s3 sync ./dist/ s3://dynamicframework-cdn/assets/rc/ui-react --delete --acl public-read",
70
+ "publish:cdn-dev": "aws s3 sync ./dist/ s3://dynamicframework-cdn/assets/dev/ui-react --delete --acl public-read",
69
71
  "lint-staged": "lint-staged",
70
- "prepare": "husky install",
72
+ "prepare": "husky",
71
73
  "commitlint": "commitlint --edit"
72
74
  },
73
75
  "engines": {
74
- "node": ">=20.13.1"
76
+ "node": ">=22.0.0"
75
77
  },
76
78
  "main": "./dist/index.js",
77
79
  "module": "./dist/index.esm.js",
@@ -109,26 +111,21 @@
109
111
  "@mdx-js/react": "~2.3.0",
110
112
  "@popperjs/core": "~2.11.8",
111
113
  "@rollup/plugin-node-resolve": "^15.3.0",
112
- "@storybook/addon-a11y": "~8.2.9",
113
- "@storybook/addon-actions": "~8.2.9",
114
- "@storybook/addon-essentials": "~8.2.9",
115
- "@storybook/addon-interactions": "~8.2.9",
116
- "@storybook/addon-links": "~8.2.9",
117
- "@storybook/addon-viewport": "~8.2.9",
118
- "@storybook/blocks": "~8.2.9",
119
- "@storybook/react": "~8.2.9",
120
- "@storybook/react-vite": "~8.2.9",
121
- "@storybook/test": "~8.2.9",
122
- "@storybook/theming": "~8.2.9",
123
- "@testing-library/jest-dom": "~6.1.4",
124
- "@testing-library/react": "~14.0.0",
125
- "@types/google-libphonenumber": "^7.4.30",
114
+ "@storybook/addon-a11y": "~9.0.17",
115
+ "@storybook/addon-docs": "~9.0.17",
116
+ "@storybook/addon-links": "~9.0.17",
117
+ "@storybook/react-vite": "~9.0.17",
118
+ "@testing-library/jest-dom": "~6.6.3",
119
+ "@testing-library/react": "~16.3.0",
120
+ "@testing-library/user-event": "^14.6.1",
121
+ "@types/google-libphonenumber": "~7.4.30",
126
122
  "@types/jest": "~29.5.12",
127
123
  "@types/node": "~18.15.3",
128
- "@types/react": "~18.2.31",
129
- "@types/react-dom": "~18.2.14",
124
+ "@types/react": "~19.1.8",
125
+ "@types/react-dom": "~19.1.6",
130
126
  "@typescript-eslint/eslint-plugin": "~6.9.0",
131
127
  "@typescript-eslint/parser": "~6.9.0",
128
+ "@vitejs/plugin-react": "~4.7.0",
132
129
  "autoprefixer": "~10.4.16",
133
130
  "axe-playwright": "~1.2.3",
134
131
  "babel-jest": "^29.7.0",
@@ -142,37 +139,39 @@
142
139
  "eslint-plugin-jsx-a11y": "~6.7.1",
143
140
  "eslint-plugin-react": "~7.33.2",
144
141
  "eslint-plugin-react-hooks": "~4.6.0",
145
- "formik": "^2.4.6",
142
+ "formik": "~2.4.6",
146
143
  "glob": "~10.3.10",
147
- "husky": "~8.0.3",
144
+ "husky": "~9.1.7",
148
145
  "jest": "~29.7.0",
149
146
  "jest-axe": "~8.0.0",
150
147
  "jest-cli": "~29.7.0",
151
148
  "jest-environment-jsdom": "~29.7.0",
152
149
  "lint-staged": "^15.2.10",
153
150
  "postcss-cli": "~10.1.0",
154
- "react": "~18.3.1",
155
- "react-dom": "~18.2.0",
151
+ "react": "~19.1.0",
152
+ "react-dom": "~19.1.0",
156
153
  "react-hot-toast": "~2.5.2",
157
154
  "react-i18next": "~13.3.1",
158
- "recharts": "~2.12.7",
159
- "rimraf": "~5.0.5",
155
+ "recharts": "~3.1.0",
156
+ "remark-gfm": "~4.0.1",
157
+ "rimraf": "~6.0.1",
160
158
  "rollup": "^4.27.4",
161
159
  "sass": "~1.69.4",
162
- "storybook": "~8.2.9",
160
+ "storybook": "~9.0.17",
163
161
  "stylelint": "^16.16.0",
164
162
  "stylelint-config-twbs-bootstrap": "^16.0.0",
165
163
  "ts-jest": "~29.2.3",
166
164
  "tslib": "~2.6.2",
167
165
  "typescript": "~5.2.2",
166
+ "vite": "~6.3.5",
168
167
  "yup": "^1.6.1"
169
168
  },
170
169
  "peerDependencies": {
171
- "react": "~18.3.1",
172
- "react-dom": "~18.2.0",
170
+ "react": "~19.1.0",
171
+ "react-dom": "~19.1.0",
173
172
  "react-hot-toast": "~2.5.2",
174
173
  "react-i18next": "~13.3.1",
175
- "recharts": "~2.12.7"
174
+ "recharts": "~3.1.0"
176
175
  },
177
176
  "peerDependenciesMeta": {
178
177
  "recharts": {
@@ -80,14 +80,14 @@ $input-group-addon-border-color: transparent !default;
80
80
 
81
81
  // custom
82
82
  $input-group-sm-icon-size: $spacer-4 !default;
83
- $input-group-lg-icon-size: $spacer-7 !default;
83
+ $input-group-lg-icon-size: $spacer-6 !default;
84
84
  $form-text-padding-y: 0 !default;
85
85
  $form-text-padding-x: 0 !default;
86
86
  // end custom
87
87
 
88
88
  // scss-docs-start form-select-variables
89
89
  $form-select-disabled-color: $input-disabled-color !default;
90
- $form-select-bg-size: 16px !default; // In pixels because image dimensions
90
+ $form-select-bg-size: 20px !default; // In pixels because image dimensions
91
91
  $form-select-bg-opacity: 0 !default;
92
92
  $form-select-indicator-color: var(--#{$prefix}gray-500) !default;
93
93
  $form-select-indicator: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='#{$gray-500}' stroke-linecap='round' stroke-linejoin='round' stroke-width='1' d='m2 5 6 6 6-6'/></svg>") !default;
@@ -9,3 +9,27 @@ $zindex-offcanvas: 1055 !default;
9
9
  $zindex-modal-backdrop: 1050 !default;
10
10
  $zindex-modal: 1055 !default;
11
11
  // scss-docs-end zindex-stack
12
+
13
+ $zindex-levels: (
14
+ n1: -1,
15
+ 0: 0,
16
+ 1: 1,
17
+ 2: 2,
18
+ 3: 3,
19
+ 4: 4,
20
+ 5: 5,
21
+ 6: 6,
22
+ 7: 7,
23
+ 8: 8,
24
+ 9: 9,
25
+ 10: 10,
26
+ 20: 20,
27
+ 30: 30,
28
+ 40: 40,
29
+ 50: 50,
30
+ 60: 60,
31
+ 70: 70,
32
+ 80: 80,
33
+ 90: 90,
34
+ 100: 100
35
+ ) !default;
@@ -1,7 +1,7 @@
1
1
  .d-icon {
2
2
  --#{$prefix}icon-color: var(--#{$prefix}icon-component-color, inherit);
3
3
  --#{$prefix}icon-bg-color: var(--#{$prefix}icon-component-bg-color, inherit);
4
- --#{$prefix}icon-size: var(--#{$prefix}icon-component-size, var(--#{$prefix}ref-spacer-6));
4
+ --#{$prefix}icon-size: var(--#{$prefix}icon-component-size, var(--#{$prefix}ref-spacer-5));
5
5
  --#{$prefix}icon-padding: var(--#{$prefix}icon-component-padding, 0);
6
6
  --#{$prefix}icon-loading-duration: var(--#{$prefix}icon-component-loading-duration, 1.8);
7
7
 
@@ -13,7 +13,7 @@
13
13
  --#{$prefix}select-option-is-checkbox-font-size: var(--#{$prefix}body-font-size);
14
14
  --#{$prefix}select-option-is-checkbox-font-weight: var(--#{$prefix}fw-normal);
15
15
  --#{$prefix}select-option-is-checkbox-color: var(--#{$prefix}gray-900);
16
- --#{$prefix}select-option-has-icon-icon-size: var(--#{$prefix}ref-spacer-4);
16
+ --#{$prefix}select-option-has-icon-icon-size: var(--#{$prefix}ref-spacer-5);
17
17
  --#{$prefix}select-multi-value-padding: 0 var(--#{$prefix}ref-spacer-1) 0 var(--#{$prefix}select-gap);
18
18
  --#{$prefix}select-multi-value-margin-right: var(--#{$prefix}select-gap);
19
19
  --#{$prefix}select-multi-value-background: var(--#{$prefix}secondary-100);
@@ -26,8 +26,8 @@
26
26
  --#{$prefix}select-indicator-separator-margin: var(--#{$prefix}ref-spacer-0) var(--#{$prefix}ref-spacer-1);
27
27
  --#{$prefix}select-indicator-separator-color: var(--#{$prefix}transparent);
28
28
 
29
- --#{$prefix}select-indicator-width: var(--#{$prefix}ref-spacer-4);
30
- --#{$prefix}select-indicator-height: var(--#{$prefix}ref-spacer-4);
29
+ --#{$prefix}select-indicator-width: var(--#{$prefix}ref-spacer-5);
30
+ --#{$prefix}select-indicator-height: var(--#{$prefix}ref-spacer-5);
31
31
 
32
32
  // focus
33
33
  &:focus-within {