@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.
Files changed (86) hide show
  1. package/README.md +22 -7
  2. package/es/components/ComboBox/ComboBox.js +43 -10
  3. package/es/components/ContentSwitcher/ContentSwitcher.js +5 -5
  4. package/es/components/DataTable/DataTable.js +110 -130
  5. package/es/components/DataTable/Table.js +1 -1
  6. package/es/components/DataTableSkeleton/DataTableSkeleton.d.ts +17 -16
  7. package/es/components/DatePicker/DatePicker.d.ts +14 -13
  8. package/es/components/DatePicker/DatePicker.js +3 -0
  9. package/es/components/DatePickerInput/DatePickerInput.d.ts +2 -2
  10. package/es/components/Dropdown/Dropdown.js +31 -6
  11. package/es/components/FileUploader/FileUploader.Skeleton.d.ts +29 -0
  12. package/es/components/FileUploader/FileUploader.d.ts +175 -0
  13. package/es/components/FileUploader/FileUploader.js +3 -3
  14. package/es/components/FileUploader/FileUploaderButton.d.ts +140 -0
  15. package/es/components/FileUploader/FileUploaderButton.js +11 -7
  16. package/es/components/FileUploader/FileUploaderDropContainer.d.ts +139 -0
  17. package/es/components/FileUploader/FileUploaderDropContainer.js +3 -3
  18. package/es/components/FileUploader/FileUploaderItem.d.ts +110 -0
  19. package/es/components/FileUploader/Filename.d.ts +71 -0
  20. package/es/components/FileUploader/Filename.js +6 -4
  21. package/es/components/InlineCheckbox/InlineCheckbox.js +3 -1
  22. package/es/components/Loading/Loading.d.ts +65 -0
  23. package/es/components/Notification/Notification.d.ts +4 -4
  24. package/es/components/Notification/Notification.js +3 -3
  25. package/es/components/OverflowMenu/OverflowMenu.js +36 -41
  26. package/es/components/Slider/Slider.js +59 -68
  27. package/es/components/Tag/Tag.js +9 -2
  28. package/es/components/TextArea/TextArea.js +1 -1
  29. package/es/components/Toggle/Toggle.d.ts +129 -0
  30. package/es/components/Toggle/Toggle.js +2 -2
  31. package/es/components/Toggle/index.d.ts +11 -0
  32. package/es/components/UIShell/HeaderMenu.js +29 -36
  33. package/es/components/UIShell/HeaderMenuButton.d.ts +4 -0
  34. package/es/components/UIShell/HeaderMenuButton.js +4 -0
  35. package/es/components/UIShell/HeaderName.d.ts +39 -0
  36. package/es/components/UIShell/HeaderName.js +2 -7
  37. package/es/components/UIShell/HeaderPanel.js +2 -2
  38. package/es/components/UIShell/Link.js +2 -1
  39. package/es/components/UIShell/Switcher.js +17 -6
  40. package/es/index.js +1 -1
  41. package/es/internal/FloatingMenu.js +47 -51
  42. package/es/internal/useControllableState.js +1 -1
  43. package/es/internal/useId.js +10 -1
  44. package/lib/components/ComboBox/ComboBox.js +43 -10
  45. package/lib/components/ContentSwitcher/ContentSwitcher.js +5 -5
  46. package/lib/components/DataTable/DataTable.js +110 -130
  47. package/lib/components/DataTable/Table.js +1 -1
  48. package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +17 -16
  49. package/lib/components/DatePicker/DatePicker.d.ts +14 -13
  50. package/lib/components/DatePicker/DatePicker.js +3 -0
  51. package/lib/components/DatePickerInput/DatePickerInput.d.ts +2 -2
  52. package/lib/components/Dropdown/Dropdown.js +30 -5
  53. package/lib/components/FileUploader/FileUploader.Skeleton.d.ts +29 -0
  54. package/lib/components/FileUploader/FileUploader.d.ts +175 -0
  55. package/lib/components/FileUploader/FileUploader.js +3 -3
  56. package/lib/components/FileUploader/FileUploaderButton.d.ts +140 -0
  57. package/lib/components/FileUploader/FileUploaderButton.js +11 -7
  58. package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +139 -0
  59. package/lib/components/FileUploader/FileUploaderDropContainer.js +3 -3
  60. package/lib/components/FileUploader/FileUploaderItem.d.ts +110 -0
  61. package/lib/components/FileUploader/Filename.d.ts +71 -0
  62. package/lib/components/FileUploader/Filename.js +6 -4
  63. package/lib/components/InlineCheckbox/InlineCheckbox.js +3 -1
  64. package/lib/components/Loading/Loading.d.ts +65 -0
  65. package/lib/components/Notification/Notification.d.ts +4 -4
  66. package/lib/components/Notification/Notification.js +3 -3
  67. package/lib/components/OverflowMenu/OverflowMenu.js +36 -41
  68. package/lib/components/Slider/Slider.js +59 -68
  69. package/lib/components/Tag/Tag.js +9 -2
  70. package/lib/components/TextArea/TextArea.js +1 -1
  71. package/lib/components/Toggle/Toggle.d.ts +129 -0
  72. package/lib/components/Toggle/Toggle.js +2 -2
  73. package/lib/components/Toggle/index.d.ts +11 -0
  74. package/lib/components/UIShell/HeaderMenu.js +29 -36
  75. package/lib/components/UIShell/HeaderMenuButton.d.ts +4 -0
  76. package/lib/components/UIShell/HeaderMenuButton.js +4 -0
  77. package/lib/components/UIShell/HeaderName.d.ts +39 -0
  78. package/lib/components/UIShell/HeaderName.js +2 -7
  79. package/lib/components/UIShell/HeaderPanel.js +2 -2
  80. package/lib/components/UIShell/Link.js +2 -1
  81. package/lib/components/UIShell/Switcher.js +17 -6
  82. package/lib/index.js +2 -2
  83. package/lib/internal/FloatingMenu.js +47 -51
  84. package/lib/internal/useControllableState.js +1 -1
  85. package/lib/internal/useId.js +9 -0
  86. 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
@@ -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.32.0",
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": "start-storybook -p 3000"
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.21.0",
48
- "@carbon/layout": "^11.15.0",
49
- "@carbon/styles": "^1.32.0",
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.18.2",
74
- "@babel/preset-react": "^7.17.12",
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.20.0",
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": "^6.5.6",
82
- "@storybook/addon-actions": "^6.5.6",
83
- "@storybook/addon-docs": "^6.5.6",
84
- "@storybook/addon-essentials": "^6.5.6",
85
- "@storybook/addon-knobs": "^6.4.0",
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": "^6.5.6",
88
- "@storybook/builder-webpack5": "^6.5.6",
89
- "@storybook/manager-webpack5": "^6.5.6",
90
- "@storybook/react": "^6.5.6",
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": "507ddae3074272a3be1ff98b3940532d74788d3c"
140
+ "gitHead": "3a58934eed5588f5e8ee1facbb09584a41adc089"
138
141
  }