@carbon/react 1.32.0 → 1.33.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/README.md +22 -7
- package/es/components/ComboBox/ComboBox.js +43 -10
- package/es/components/ContentSwitcher/ContentSwitcher.js +5 -5
- package/es/components/DataTable/DataTable.js +110 -130
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTableSkeleton/DataTableSkeleton.d.ts +17 -16
- package/es/components/DatePicker/DatePicker.d.ts +14 -13
- package/es/components/DatePicker/DatePicker.js +3 -0
- package/es/components/DatePickerInput/DatePickerInput.d.ts +2 -2
- package/es/components/Dropdown/Dropdown.js +31 -6
- package/es/components/FileUploader/FileUploader.Skeleton.d.ts +29 -0
- package/es/components/FileUploader/FileUploader.d.ts +175 -0
- package/es/components/FileUploader/FileUploader.js +3 -3
- package/es/components/FileUploader/FileUploaderButton.d.ts +140 -0
- package/es/components/FileUploader/FileUploaderButton.js +11 -7
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +139 -0
- package/es/components/FileUploader/FileUploaderDropContainer.js +3 -3
- package/es/components/FileUploader/FileUploaderItem.d.ts +110 -0
- package/es/components/FileUploader/Filename.d.ts +71 -0
- package/es/components/FileUploader/Filename.js +6 -4
- package/es/components/InlineCheckbox/InlineCheckbox.js +3 -1
- package/es/components/Loading/Loading.d.ts +65 -0
- package/es/components/Notification/Notification.d.ts +4 -4
- package/es/components/Notification/Notification.js +3 -3
- package/es/components/OverflowMenu/OverflowMenu.js +36 -41
- package/es/components/Slider/Slider.js +59 -68
- package/es/components/Tag/Tag.js +9 -2
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/Toggle/Toggle.d.ts +129 -0
- package/es/components/Toggle/Toggle.js +2 -2
- package/es/components/Toggle/index.d.ts +11 -0
- package/es/components/UIShell/HeaderMenu.js +29 -36
- package/es/components/UIShell/HeaderMenuButton.d.ts +4 -0
- package/es/components/UIShell/HeaderMenuButton.js +4 -0
- package/es/components/UIShell/HeaderName.d.ts +39 -0
- package/es/components/UIShell/HeaderName.js +2 -7
- package/es/components/UIShell/HeaderPanel.js +2 -2
- package/es/components/UIShell/Link.js +2 -1
- package/es/components/UIShell/Switcher.js +17 -6
- package/es/index.js +1 -1
- package/es/internal/FloatingMenu.js +47 -51
- package/es/internal/useControllableState.js +1 -1
- package/es/internal/useId.js +10 -1
- package/lib/components/ComboBox/ComboBox.js +43 -10
- package/lib/components/ContentSwitcher/ContentSwitcher.js +5 -5
- package/lib/components/DataTable/DataTable.js +110 -130
- package/lib/components/DataTable/Table.js +1 -1
- package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +17 -16
- package/lib/components/DatePicker/DatePicker.d.ts +14 -13
- package/lib/components/DatePicker/DatePicker.js +3 -0
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +2 -2
- package/lib/components/Dropdown/Dropdown.js +30 -5
- package/lib/components/FileUploader/FileUploader.Skeleton.d.ts +29 -0
- package/lib/components/FileUploader/FileUploader.d.ts +175 -0
- package/lib/components/FileUploader/FileUploader.js +3 -3
- package/lib/components/FileUploader/FileUploaderButton.d.ts +140 -0
- package/lib/components/FileUploader/FileUploaderButton.js +11 -7
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +139 -0
- package/lib/components/FileUploader/FileUploaderDropContainer.js +3 -3
- package/lib/components/FileUploader/FileUploaderItem.d.ts +110 -0
- package/lib/components/FileUploader/Filename.d.ts +71 -0
- package/lib/components/FileUploader/Filename.js +6 -4
- package/lib/components/InlineCheckbox/InlineCheckbox.js +3 -1
- package/lib/components/Loading/Loading.d.ts +65 -0
- package/lib/components/Notification/Notification.d.ts +4 -4
- package/lib/components/Notification/Notification.js +3 -3
- package/lib/components/OverflowMenu/OverflowMenu.js +36 -41
- package/lib/components/Slider/Slider.js +59 -68
- package/lib/components/Tag/Tag.js +9 -2
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/Toggle/Toggle.d.ts +129 -0
- package/lib/components/Toggle/Toggle.js +2 -2
- package/lib/components/Toggle/index.d.ts +11 -0
- package/lib/components/UIShell/HeaderMenu.js +29 -36
- package/lib/components/UIShell/HeaderMenuButton.d.ts +4 -0
- package/lib/components/UIShell/HeaderMenuButton.js +4 -0
- package/lib/components/UIShell/HeaderName.d.ts +39 -0
- package/lib/components/UIShell/HeaderName.js +2 -7
- package/lib/components/UIShell/HeaderPanel.js +2 -2
- package/lib/components/UIShell/Link.js +2 -1
- package/lib/components/UIShell/Switcher.js +17 -6
- package/lib/index.js +2 -2
- package/lib/internal/FloatingMenu.js +47 -51
- package/lib/internal/useControllableState.js +1 -1
- package/lib/internal/useId.js +9 -0
- package/package.json +22 -19
|
@@ -26,7 +26,7 @@ var warning = require('./warning.js');
|
|
|
26
26
|
* @param {string} [config.name] - the name of the custom component
|
|
27
27
|
* @param {any} config.defaultValue - the default value used for the state. This will be
|
|
28
28
|
* the fallback value used if `value` is not defined.
|
|
29
|
-
* @param {Function} config.onChange - an optional function that is called when
|
|
29
|
+
* @param {Function|undefined} config.onChange - an optional function that is called when
|
|
30
30
|
* the value of the state changes. This is useful for communicating to parents of
|
|
31
31
|
* controlled components that the value is requesting to be changed.
|
|
32
32
|
* @param {any} config.value - a controlled value. Omitting this means that the state is
|
package/lib/internal/useId.js
CHANGED
|
@@ -43,6 +43,15 @@ function useId() {
|
|
|
43
43
|
serverHandoffCompleted = true;
|
|
44
44
|
}
|
|
45
45
|
}, []);
|
|
46
|
+
if (React.useId) {
|
|
47
|
+
const id = nativeReactUseId(_prefix, prefix);
|
|
48
|
+
return id;
|
|
49
|
+
}
|
|
50
|
+
return id;
|
|
51
|
+
}
|
|
52
|
+
function nativeReactUseId(_prefix, prefix) {
|
|
53
|
+
const getId = React.useId();
|
|
54
|
+
const id = `${_prefix ? `${_prefix}-` : ``}${prefix}-${getId}`;
|
|
46
55
|
return id;
|
|
47
56
|
}
|
|
48
57
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/react",
|
|
3
3
|
"description": "React components for the Carbon Design System",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.33.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"build": "yarn clean && node tasks/build-styles.js && node tasks/build.js",
|
|
35
35
|
"clean": "rimraf es lib icons/index.js icons/index.esm.js storybook-static",
|
|
36
36
|
"postinstall": "carbon-telemetry collect --install",
|
|
37
|
-
"storybook": "
|
|
37
|
+
"storybook": "storybook dev -p 3000",
|
|
38
|
+
"storybook:build": "storybook build"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
40
41
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
|
@@ -44,9 +45,9 @@
|
|
|
44
45
|
"dependencies": {
|
|
45
46
|
"@babel/runtime": "^7.18.3",
|
|
46
47
|
"@carbon/feature-flags": "^0.15.0",
|
|
47
|
-
"@carbon/icons-react": "^11.
|
|
48
|
-
"@carbon/layout": "^11.
|
|
49
|
-
"@carbon/styles": "^1.
|
|
48
|
+
"@carbon/icons-react": "^11.22.0",
|
|
49
|
+
"@carbon/layout": "^11.16.0",
|
|
50
|
+
"@carbon/styles": "^1.33.0",
|
|
50
51
|
"@carbon/telemetry": "0.1.0",
|
|
51
52
|
"classnames": "2.3.2",
|
|
52
53
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -70,25 +71,25 @@
|
|
|
70
71
|
"@babel/plugin-proposal-export-default-from": "^7.17.12",
|
|
71
72
|
"@babel/plugin-proposal-export-namespace-from": "^7.17.12",
|
|
72
73
|
"@babel/plugin-transform-react-constant-elements": "^7.17.12",
|
|
73
|
-
"@babel/preset-env": "^7.
|
|
74
|
-
"@babel/preset-react": "^7.
|
|
74
|
+
"@babel/preset-env": "^7.22.4",
|
|
75
|
+
"@babel/preset-react": "^7.22.3",
|
|
76
|
+
"@babel/preset-typescript": "^7.21.5",
|
|
75
77
|
"@carbon/test-utils": "^10.30.0",
|
|
76
|
-
"@carbon/themes": "^11.
|
|
78
|
+
"@carbon/themes": "^11.21.0",
|
|
77
79
|
"@rollup/plugin-babel": "^6.0.0",
|
|
78
80
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
79
81
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
80
82
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
81
|
-
"@storybook/addon-a11y": "^
|
|
82
|
-
"@storybook/addon-actions": "^
|
|
83
|
-
"@storybook/addon-docs": "^
|
|
84
|
-
"@storybook/addon-essentials": "^
|
|
85
|
-
"@storybook/addon-knobs": "^
|
|
83
|
+
"@storybook/addon-a11y": "^7.0.23",
|
|
84
|
+
"@storybook/addon-actions": "^7.0.23",
|
|
85
|
+
"@storybook/addon-docs": "^7.0.23",
|
|
86
|
+
"@storybook/addon-essentials": "^7.0.23",
|
|
87
|
+
"@storybook/addon-knobs": "^7.0.2",
|
|
86
88
|
"@storybook/addon-notes": "^5.3.21",
|
|
87
|
-
"@storybook/addon-storysource": "^
|
|
88
|
-
"@storybook/
|
|
89
|
-
"@storybook/
|
|
90
|
-
"@storybook/
|
|
91
|
-
"@storybook/theming": "^6.5.6",
|
|
89
|
+
"@storybook/addon-storysource": "^7.0.23",
|
|
90
|
+
"@storybook/react": "^7.0.23",
|
|
91
|
+
"@storybook/react-webpack5": "^7.0.23",
|
|
92
|
+
"@storybook/theming": "^7.0.23",
|
|
92
93
|
"@types/react-is": "~18.2.0",
|
|
93
94
|
"autoprefixer": "^10.4.0",
|
|
94
95
|
"babel-loader": "^9.0.0",
|
|
@@ -109,6 +110,7 @@
|
|
|
109
110
|
"prop-types": "^15.7.2",
|
|
110
111
|
"react": "^18.2.0",
|
|
111
112
|
"react-dom": "^18.2.0",
|
|
113
|
+
"remark-gfm": "^3.0.1",
|
|
112
114
|
"requestanimationframe": "^0.0.23",
|
|
113
115
|
"rimraf": "^5.0.0",
|
|
114
116
|
"rollup": "^2.79.1",
|
|
@@ -116,6 +118,7 @@
|
|
|
116
118
|
"rtlcss": "^4.0.0",
|
|
117
119
|
"sass": "^1.51.0",
|
|
118
120
|
"sass-loader": "^13.0.0",
|
|
121
|
+
"storybook": "^7.0.23",
|
|
119
122
|
"storybook-readme": "^5.0.9",
|
|
120
123
|
"stream-browserify": "^3.0.0",
|
|
121
124
|
"style-loader": "^3.3.1",
|
|
@@ -134,5 +137,5 @@
|
|
|
134
137
|
"**/*.scss",
|
|
135
138
|
"**/*.css"
|
|
136
139
|
],
|
|
137
|
-
"gitHead": "
|
|
140
|
+
"gitHead": "3a58934eed5588f5e8ee1facbb09584a41adc089"
|
|
138
141
|
}
|