@dynamic-framework/ui-react 1.36.2 → 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.
- package/dist/css/dynamic-ui-non-root.css +9 -4
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +1 -1
- package/dist/css/dynamic-ui-root.min.css +1 -1
- package/dist/css/dynamic-ui.css +9 -4
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +2 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/js/bootstrap.bundle.js +3 -6
- package/dist/js/bootstrap.bundle.min.js +2 -2
- package/dist/js/bootstrap.esm.js +3 -6
- package/dist/js/bootstrap.esm.min.js +2 -2
- package/dist/js/bootstrap.js +3 -6
- package/dist/js/bootstrap.min.js +2 -2
- package/dist/types/components/DBoxFile/useDBoxFile.d.ts +2 -2
- package/dist/types/components/DCarousel/components/DCarouselSlide.d.ts +3 -1
- package/dist/types/components/DCollapse/DCollapse.d.ts +1 -1
- package/dist/types/components/DInput/DInput.d.ts +1 -1
- package/dist/types/components/DInputCounter/DInputCounter.d.ts +1 -1
- package/dist/types/components/DInputCurrency/DInputCurrency.d.ts +1 -1
- package/dist/types/components/DInputCurrencyBase/DInputCurrencyBase.d.ts +1 -1
- package/dist/types/components/DInputMask/DInputMask.d.ts +1 -1
- package/dist/types/components/DInputPhone/DInputPhone.d.ts +1 -1
- package/dist/types/components/DInputSearch/DInputSearch.d.ts +1 -1
- package/dist/types/components/DPopover/DPopover.d.ts +1 -1
- package/dist/types/contexts/DContext.d.ts +0 -2
- package/dist/types/hooks/tests/useDisableBodyScrollEffect.spec.d.ts +1 -0
- package/dist/types/hooks/tests/useDisableInputWheel.spec.d.ts +1 -0
- package/dist/types/hooks/tests/useFormatCurrency.spec.d.ts +1 -0
- package/dist/types/hooks/tests/useInputCurrency.spec.d.ts +1 -0
- package/dist/types/hooks/tests/useItemSelection.spec.d.ts +1 -0
- package/dist/types/hooks/tests/useMediaBreakpointUp.spec.d.ts +1 -0
- package/dist/types/hooks/tests/useMediaQuery.spec.d.ts +1 -0
- package/dist/types/hooks/tests/usePortal.spec.d.ts +1 -0
- package/dist/types/hooks/tests/useProvidedRefOrCreate.spec.d.ts +1 -0
- package/dist/types/hooks/tests/useStackState.spec.d.ts +1 -0
- package/dist/types/hooks/useInputCurrency.d.ts +1 -1
- package/dist/types/hooks/useProvidedRefOrCreate.d.ts +1 -1
- package/dist/types/types/polymorphic.d.ts +3 -3
- package/dist/types/utils/tests/attr-accept.spec.d.ts +1 -0
- package/dist/types/utils/tests/changeQueryString.spec.d.ts +1 -0
- package/dist/types/utils/tests/configureI18n.spec.d.ts +1 -0
- package/dist/types/utils/tests/formatCurrency.spec.d.ts +1 -0
- package/dist/types/utils/tests/getCssVariable.spec.d.ts +1 -0
- package/dist/types/utils/tests/getKeyboardFocusableElements.spec.d.ts +1 -0
- package/dist/types/utils/tests/getQueryString.spec.d.ts +1 -0
- package/dist/types/utils/tests/mediaQuery.spec.d.ts +1 -0
- package/dist/types/utils/tests/validatePhoneNumber.spec.d.ts +1 -0
- package/jest/setup.js +94 -1
- package/package.json +26 -29
- package/dist/css/bootstrap-icons.css +0 -2106
- package/dist/css/bootstrap-icons.json +0 -2080
- package/dist/css/bootstrap-icons.min.css +0 -5
- package/dist/css/bootstrap-icons.scss +0 -2118
- package/dist/css/fonts/bootstrap-icons.woff +0 -0
- 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', () =>
|
|
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": "
|
|
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": {
|
|
@@ -67,12 +67,13 @@
|
|
|
67
67
|
"publish:cdn-version": "node scripts/publish-cdn.js",
|
|
68
68
|
"publish:cdn-latest": "aws s3 sync ./dist/ s3://dynamicframework-cdn/assets/latest/ui-react --delete --acl public-read",
|
|
69
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",
|
|
70
71
|
"lint-staged": "lint-staged",
|
|
71
|
-
"prepare": "husky
|
|
72
|
+
"prepare": "husky",
|
|
72
73
|
"commitlint": "commitlint --edit"
|
|
73
74
|
},
|
|
74
75
|
"engines": {
|
|
75
|
-
"node": ">=
|
|
76
|
+
"node": ">=22.0.0"
|
|
76
77
|
},
|
|
77
78
|
"main": "./dist/index.js",
|
|
78
79
|
"module": "./dist/index.esm.js",
|
|
@@ -110,27 +111,21 @@
|
|
|
110
111
|
"@mdx-js/react": "~2.3.0",
|
|
111
112
|
"@popperjs/core": "~2.11.8",
|
|
112
113
|
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
113
|
-
"@storybook/addon-a11y": "~
|
|
114
|
-
"@storybook/addon-
|
|
115
|
-
"@storybook/addon-
|
|
116
|
-
"@storybook/
|
|
117
|
-
"@
|
|
118
|
-
"@
|
|
119
|
-
"@storybook/blocks": "~8.2.9",
|
|
120
|
-
"@storybook/react": "~8.2.9",
|
|
121
|
-
"@storybook/react-vite": "~8.2.9",
|
|
122
|
-
"@storybook/test": "~8.2.9",
|
|
123
|
-
"@storybook/theming": "~8.2.9",
|
|
124
|
-
"@testing-library/jest-dom": "~6.1.4",
|
|
125
|
-
"@testing-library/react": "~14.0.0",
|
|
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",
|
|
126
120
|
"@testing-library/user-event": "^14.6.1",
|
|
127
|
-
"@types/google-libphonenumber": "
|
|
121
|
+
"@types/google-libphonenumber": "~7.4.30",
|
|
128
122
|
"@types/jest": "~29.5.12",
|
|
129
123
|
"@types/node": "~18.15.3",
|
|
130
|
-
"@types/react": "~
|
|
131
|
-
"@types/react-dom": "~
|
|
124
|
+
"@types/react": "~19.1.8",
|
|
125
|
+
"@types/react-dom": "~19.1.6",
|
|
132
126
|
"@typescript-eslint/eslint-plugin": "~6.9.0",
|
|
133
127
|
"@typescript-eslint/parser": "~6.9.0",
|
|
128
|
+
"@vitejs/plugin-react": "~4.7.0",
|
|
134
129
|
"autoprefixer": "~10.4.16",
|
|
135
130
|
"axe-playwright": "~1.2.3",
|
|
136
131
|
"babel-jest": "^29.7.0",
|
|
@@ -144,37 +139,39 @@
|
|
|
144
139
|
"eslint-plugin-jsx-a11y": "~6.7.1",
|
|
145
140
|
"eslint-plugin-react": "~7.33.2",
|
|
146
141
|
"eslint-plugin-react-hooks": "~4.6.0",
|
|
147
|
-
"formik": "
|
|
142
|
+
"formik": "~2.4.6",
|
|
148
143
|
"glob": "~10.3.10",
|
|
149
|
-
"husky": "~
|
|
144
|
+
"husky": "~9.1.7",
|
|
150
145
|
"jest": "~29.7.0",
|
|
151
146
|
"jest-axe": "~8.0.0",
|
|
152
147
|
"jest-cli": "~29.7.0",
|
|
153
148
|
"jest-environment-jsdom": "~29.7.0",
|
|
154
149
|
"lint-staged": "^15.2.10",
|
|
155
150
|
"postcss-cli": "~10.1.0",
|
|
156
|
-
"react": "~
|
|
157
|
-
"react-dom": "~
|
|
151
|
+
"react": "~19.1.0",
|
|
152
|
+
"react-dom": "~19.1.0",
|
|
158
153
|
"react-hot-toast": "~2.5.2",
|
|
159
154
|
"react-i18next": "~13.3.1",
|
|
160
|
-
"recharts": "~
|
|
161
|
-
"
|
|
155
|
+
"recharts": "~3.1.0",
|
|
156
|
+
"remark-gfm": "~4.0.1",
|
|
157
|
+
"rimraf": "~6.0.1",
|
|
162
158
|
"rollup": "^4.27.4",
|
|
163
159
|
"sass": "~1.69.4",
|
|
164
|
-
"storybook": "~
|
|
160
|
+
"storybook": "~9.0.17",
|
|
165
161
|
"stylelint": "^16.16.0",
|
|
166
162
|
"stylelint-config-twbs-bootstrap": "^16.0.0",
|
|
167
163
|
"ts-jest": "~29.2.3",
|
|
168
164
|
"tslib": "~2.6.2",
|
|
169
165
|
"typescript": "~5.2.2",
|
|
166
|
+
"vite": "~6.3.5",
|
|
170
167
|
"yup": "^1.6.1"
|
|
171
168
|
},
|
|
172
169
|
"peerDependencies": {
|
|
173
|
-
"react": "~
|
|
174
|
-
"react-dom": "~
|
|
170
|
+
"react": "~19.1.0",
|
|
171
|
+
"react-dom": "~19.1.0",
|
|
175
172
|
"react-hot-toast": "~2.5.2",
|
|
176
173
|
"react-i18next": "~13.3.1",
|
|
177
|
-
"recharts": "~
|
|
174
|
+
"recharts": "~3.1.0"
|
|
178
175
|
},
|
|
179
176
|
"peerDependenciesMeta": {
|
|
180
177
|
"recharts": {
|