@aws-amplify/ui-react 6.6.0 → 6.7.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 (28) hide show
  1. package/dist/{Field-CIQvkMkM.js → Field-DbA9eYRa.js} +108 -0
  2. package/dist/esm/PrimitiveCatalog.mjs +328 -0
  3. package/dist/esm/components/AccountSettings/ChangePassword/ChangePassword.mjs +2 -0
  4. package/dist/esm/components/AccountSettings/ChangePassword/defaults.mjs +1 -0
  5. package/dist/esm/components/AccountSettings/DeleteUser/DeleteUser.mjs +2 -0
  6. package/dist/esm/components/AccountSettings/DeleteUser/defaults.mjs +1 -0
  7. package/dist/esm/components/AccountSettings/shared/Defaults.mjs +1 -0
  8. package/dist/esm/components/FileSelect/FileSelect.mjs +70 -0
  9. package/dist/esm/index.mjs +1 -0
  10. package/dist/esm/internal.mjs +2 -0
  11. package/dist/esm/primitives/Icon/context/StorageBrowserIcons.mjs +68 -0
  12. package/dist/esm/primitives/index.mjs +1 -0
  13. package/dist/esm/version.mjs +1 -1
  14. package/dist/index.js +24 -62
  15. package/dist/internal.js +399 -1
  16. package/dist/styles/StorageBrowser.css +150 -0
  17. package/dist/styles/StorageBrowser.layer.css +152 -0
  18. package/dist/styles.css +151 -0
  19. package/dist/styles.layer.css +151 -0
  20. package/dist/types/components/FileSelect/FileSelect.d.ts +59 -0
  21. package/dist/types/components/FileSelect/index.d.ts +1 -0
  22. package/dist/types/internal.d.ts +2 -0
  23. package/dist/types/primitives/Icon/context/IconsContext.d.ts +2 -0
  24. package/dist/types/primitives/Icon/context/StorageBrowserIcons.d.ts +35 -0
  25. package/dist/types/primitives/components.d.ts +1 -0
  26. package/dist/types/primitives/types/field.d.ts +1 -1
  27. package/dist/types/version.d.ts +1 -1
  28. package/package.json +4 -4
@@ -0,0 +1,68 @@
1
+ const STORAGE_BROWSER_ICON_PATHS = {
2
+ // "Do Not Disturb On"
3
+ 'action-canceled': 'M280-440h400v-80H280v80ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z',
4
+ // "Error"
5
+ 'action-error': 'M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm-40-160h80v-240h-80v240Zm40 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z',
6
+ // "Info"
7
+ 'action-info': 'M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z',
8
+ // "Adjust"
9
+ 'action-initial': 'M480-360q50 0 85-35t35-85q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 50 35 85t85 35Zm0 280q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z',
10
+ // "Progress Activity"
11
+ 'action-progress': 'M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Z',
12
+ // "Pending"
13
+ 'action-queued': 'M280-420q25 0 42.5-17.5T340-480q0-25-17.5-42.5T280-540q-25 0-42.5 17.5T220-480q0 25 17.5 42.5T280-420Zm200 0q25 0 42.5-17.5T540-480q0-25-17.5-42.5T480-540q-25 0-42.5 17.5T420-480q0 25 17.5 42.5T480-420Zm200 0q25 0 42.5-17.5T740-480q0-25-17.5-42.5T680-540q-25 0-42.5 17.5T620-480q0 25 17.5 42.5T680-420ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z',
14
+ // "Check Circle" icon
15
+ 'action-success': 'm424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z',
16
+ // "Cancel"
17
+ cancel: 'm336-280 144-144 144 144 56-56-144-144 144-144-56-56-144 144-144-144-56 56 144 144-144 144 56 56ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z',
18
+ // "Create New Folder"
19
+ 'create-folder': 'M560-320h80v-80h80v-80h-80v-80h-80v80h-80v80h80v80ZM160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Zm0-80h640v-400H447l-80-80H160v480Zm0 0v-480 480Z',
20
+ // "Copy file"
21
+ 'copy-file': 'M760-200H320q-33 0-56.5-23.5T240-280v-560q0-33 23.5-56.5T320-920h280l240 240v400q0 33-23.5 56.5T760-200ZM560-640v-200H320v560h440v-360H560ZM160-40q-33 0-56.5-23.5T80-120v-560h80v560h440v80H160Zm160-800v200-200 560-560Z',
22
+ // "Delete file"
23
+ 'delete-file': 'M240-800v200-200 640-9.5 9.5-640Zm0 720q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v174q-19-7-39-10.5t-41-3.5v-120H520v-200H240v640h254q8 23 20 43t28 37H240Zm396-20-56-56 84-84-84-84 56-56 84 84 84-84 56 56-83 84 83 84-56 56-84-83-84 83Z',
24
+ // "Close"
25
+ dismiss: 'm256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z',
26
+ // "Download" icon
27
+ download: 'M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z',
28
+ // "Error"
29
+ error: 'M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm-40-160h80v-240h-80v240Zm40 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z',
30
+ // "Arrow Left Alt" icon
31
+ exit: 'M400-240 160-480l240-240 56 58-142 142h486v80H314l142 142-56 58Z',
32
+ // "Draft" icon
33
+ file: 'M240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520v-200H240v640h480v-440H520ZM240-800v200-200 640-640Z',
34
+ // "Folder" icon
35
+ folder: 'M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Zm0-80h640v-400H447l-80-80H160v480Zm0 0v-480 480Z',
36
+ // "Info" icon
37
+ info: 'M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z',
38
+ // "Progress Activity" icon
39
+ loading: 'M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Z',
40
+ // "More Vert" icon
41
+ menu: 'M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z',
42
+ // "Chevron Right" icon
43
+ 'paginate-next': 'M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z',
44
+ // "Chevron Left" icon
45
+ 'paginate-previous': 'M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z',
46
+ // "Refresh" icon
47
+ refresh: 'M480-160q-134 0-227-93t-93-227q0-134 93-227t227-93q69 0 132 28.5T720-690v-110h80v280H520v-80h168q-32-56-87.5-88T480-720q-100 0-170 70t-70 170q0 100 70 170t170 70q77 0 139-44t87-116h84q-28 106-114 173t-196 67Z',
48
+ // "Search" icon
49
+ search: 'M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z',
50
+ // "Arrow Drop Up" icon
51
+ 'sort-ascending': 'm280-400 200-200 200 200H280Z',
52
+ // "Arrow Drop Down" icon
53
+ 'sort-descending': 'M480-360 280-560h400L480-360Z',
54
+ // "Check Indeterminate Small" icon
55
+ 'sort-indeterminate': 'M240-440v-80h480v80H240Z',
56
+ // "Check Circle" icon
57
+ success: 'm424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z',
58
+ // "Upload File"
59
+ 'upload-file': 'M440-200h80v-167l64 64 56-57-160-160-160 160 57 56 63-63v167ZM240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520v-200H240v640h480v-440H520ZM240-800v200-200 640-640Z',
60
+ // "Upload Folder"
61
+ 'upload-folder': 'M440-280h80v-168l64 64 56-56-160-160-160 160 56 56 64-64v168ZM160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Zm0-80h640v-400H447l-80-80H160v480Zm0 0v-480 480Z',
62
+ // "More Vert" icon
63
+ 'vertical-kebab': 'M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z',
64
+ // "Warning" icon
65
+ warning: 'm40-120 440-760 440 760H40Zm138-80h604L480-720 178-200Zm302-40q17 0 28.5-11.5T520-280q0-17-11.5-28.5T480-320q-17 0-28.5 11.5T440-280q0 17 11.5 28.5T480-240Zm-40-120h80v-200h-80v200Zm40-100Z',
66
+ };
67
+
68
+ export { STORAGE_BROWSER_ICON_PATHS };
@@ -6,6 +6,7 @@ export { Breadcrumbs } from './Breadcrumbs/Breadcrumbs.mjs';
6
6
  export { Button } from './Button/Button.mjs';
7
7
  export { ButtonGroup } from './ButtonGroup/ButtonGroup.mjs';
8
8
  export { Card } from './Card/Card.mjs';
9
+ export { Checkbox } from './Checkbox/Checkbox.mjs';
9
10
  export { CheckboxField } from './CheckboxField/CheckboxField.mjs';
10
11
  export { Collection } from './Collection/Collection.mjs';
11
12
  export { Divider } from './Divider/Divider.mjs';
@@ -1,3 +1,3 @@
1
- const VERSION = '6.6.0';
1
+ const VERSION = '6.7.0';
2
2
 
3
3
  export { VERSION };
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ var React = require('react');
6
6
  var isEqual = require('lodash/isEqual.js');
7
7
  var uiReactCore = require('@aws-amplify/ui-react-core');
8
8
  var ui = require('@aws-amplify/ui');
9
- var Field = require('./Field-CIQvkMkM.js');
9
+ var Field = require('./Field-DbA9eYRa.js');
10
10
  require('aws-amplify/storage');
11
11
  var debounce = require('lodash/debounce.js');
12
12
  var Dropdown = require('@radix-ui/react-dropdown-menu');
@@ -169,46 +169,6 @@ const AutocompleteMenuPrimitive = ({ ariaLabel, children, Header = null, Footer
169
169
  const AutocompleteMenu = Field.primitiveWithForwardRef(AutocompleteMenuPrimitive);
170
170
  AutocompleteMenu.displayName = 'AutocompleteMenu';
171
171
 
172
- // Source: https://github.com/radix-ui/primitives/blob/7ae63b6cce6ea53ea5d65b6d411894c004b38f47/packages/react/use-layout-effect/src/useLayoutEffect.tsx
173
- /**
174
- * On the server, React emits a warning when calling `useLayoutEffect`.
175
- * This is because neither `useLayoutEffect` nor `useEffect` run on the server.
176
- * We use this safe version which suppresses the warning by replacing it with a noop on the server.
177
- *
178
- * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
179
- */
180
- const useLayoutEffect = globalThis?.document ? React__namespace.useLayoutEffect : () => { };
181
-
182
- // Adapted from https://github.com/radix-ui/primitives/blob/main/packages/react/id/src/id.tsx#L8
183
- // Prefixed autogenerated id created by useStableId
184
- const AUTO_GENERATED_ID_PREFIX = 'amplify-id';
185
- // Create a local version of React.useId which will reference React.useId for React 18
186
- // and fallback to noop for React 17 and below
187
- // Note: We use `toString()` to prevent bundlers from trying to `import { useId } from 'react';`
188
- // since it doesn't exist in React 17 and below (prevents https://github.com/aws-amplify/amplify-ui/issues/1154)
189
- const useReactId =
190
- // disable eslint below to allow usage of casting React to `any`, which ensures that TS
191
- // does not get confused about the existence of `useId` in React 17 and below
192
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
193
- React__namespace['useId'.toString()] || (() => undefined);
194
- let count = 0;
195
- /**
196
- * Create a uuid to use with amplify fields unless
197
- * an id is provided
198
- * @param id user specified id
199
- * @returns string
200
- */
201
- const useStableId = (id) => {
202
- const [stableId, setStableId] = React__namespace.useState(useReactId());
203
- // React versions older than 18 will have client-side ids only
204
- useLayoutEffect(() => {
205
- if (!id) {
206
- setStableId((reactId) => reactId ?? String(count++));
207
- }
208
- }, [id]);
209
- return id ?? (stableId ? `${AUTO_GENERATED_ID_PREFIX}-${stableId}` : '');
210
- };
211
-
212
172
  const DEFAULT_KEYS$1 = new Set([Field.ARROW_DOWN, Field.ARROW_UP, Field.ENTER_KEY, Field.ESCAPE_KEY]);
213
173
  const useAutocomplete = ({ defaultValue = '', value, options, optionFilter, onBlur, onChange, onClear, onClick, onSelect, onSubmit, }) => {
214
174
  const isControlled = value !== undefined;
@@ -229,10 +189,10 @@ const useAutocomplete = ({ defaultValue = '', value, options, optionFilter, onBl
229
189
  : defaultFilter;
230
190
  return options?.filter(filter) ?? [];
231
191
  }, [composedValue, optionFilter, isCustomFiltering, options]);
232
- const autocompleteId = useStableId();
233
- const listboxId = useStableId();
234
- const menuId = useStableId();
235
- const optionBaseId = useStableId();
192
+ const autocompleteId = Field.useStableId();
193
+ const listboxId = Field.useStableId();
194
+ const menuId = Field.useStableId();
195
+ const optionBaseId = Field.useStableId();
236
196
  const activeIndex = filteredOptions.findIndex((option) => option === activeOption);
237
197
  const activeOptionId = activeOption?.id ??
238
198
  (activeIndex !== -1 ? `${optionBaseId}-option-${activeIndex}` : undefined);
@@ -503,8 +463,8 @@ const DESCRIPTION_SUFFIX = 'description';
503
463
 
504
464
  const TextFieldPrimitive = (props, ref) => {
505
465
  const { className, descriptiveText, errorMessage, hasError = false, id, innerEndComponent, innerStartComponent, label, labelHidden = false, outerEndComponent, outerStartComponent, size, testId, variation, inputStyles, ..._rest } = props;
506
- const fieldId = useStableId(id);
507
- const stableId = useStableId();
466
+ const fieldId = Field.useStableId(id);
467
+ const stableId = Field.useStableId();
508
468
  const descriptionId = descriptiveText
509
469
  ? getUniqueComponentId(stableId, DESCRIPTION_SUFFIX)
510
470
  : undefined;
@@ -830,7 +790,7 @@ const CheckboxPrimitive = ({ checked: controlledChecked, className, defaultCheck
830
790
  }
831
791
  setFocused(false);
832
792
  };
833
- const dataId = useStableId();
793
+ const dataId = Field.useStableId();
834
794
  React__namespace.useEffect(() => {
835
795
  const input = document.querySelector(`[data-id="${dataId}"]`);
836
796
  if (input && typeof isIndeterminate === 'boolean') {
@@ -1575,8 +1535,8 @@ const selectFieldChildren = ({ children, options, }) => {
1575
1535
  };
1576
1536
  const SelectFieldPrimitive = (props, ref) => {
1577
1537
  const { children, className, descriptiveText, errorMessage, hasError = false, id, label, labelHidden = false, options, size, testId, inputStyles, ..._rest } = props;
1578
- const fieldId = useStableId(id);
1579
- const stableId = useStableId();
1538
+ const fieldId = Field.useStableId(id);
1539
+ const stableId = Field.useStableId();
1580
1540
  const descriptionId = descriptiveText
1581
1541
  ? getUniqueComponentId(stableId, DESCRIPTION_SUFFIX)
1582
1542
  : undefined;
@@ -1661,8 +1621,8 @@ const Radio = Field.primitiveWithForwardRef(RadioPrimitive);
1661
1621
  Radio.displayName = 'Radio';
1662
1622
 
1663
1623
  const RadioGroupFieldPrimitive = ({ children, className, defaultValue, descriptiveText, errorMessage, hasError = false, id, isDisabled, isRequired, isReadOnly, legend, legendHidden = false, labelPosition, onChange, name, size, testId, value, variation, ...rest }, ref) => {
1664
- const fieldId = useStableId(id);
1665
- const stableId = useStableId();
1624
+ const fieldId = Field.useStableId(id);
1625
+ const stableId = Field.useStableId();
1666
1626
  const descriptionId = descriptiveText
1667
1627
  ? getUniqueComponentId(stableId, DESCRIPTION_SUFFIX)
1668
1628
  : undefined;
@@ -1775,8 +1735,8 @@ const SLIDER_TRACK_TEST_ID = 'slider-track';
1775
1735
  const SLIDER_RANGE_TEST_ID = 'slider-range';
1776
1736
  const SliderFieldPrimitive = ({ ariaValuetext, className, defaultValue = 0, descriptiveText, emptyTrackColor, errorMessage, filledTrackColor, formatValue, hasError = false, id, isDisabled, isValueHidden = false, label, labelHidden = false, onChange, orientation = 'horizontal', outerEndComponent, outerStartComponent, testId, thumbColor, trackSize, value, size, ..._rest }, ref) => {
1777
1737
  const { isFieldsetDisabled } = Field.useFieldset();
1778
- const fieldId = useStableId(id);
1779
- const stableId = useStableId();
1738
+ const fieldId = Field.useStableId(id);
1739
+ const stableId = Field.useStableId();
1780
1740
  const descriptionId = descriptiveText
1781
1741
  ? getUniqueComponentId(stableId, DESCRIPTION_SUFFIX)
1782
1742
  : undefined;
@@ -1950,8 +1910,8 @@ const StepperFieldPrimitive = (props, ref) => {
1950
1910
  onStepChange, size, testId,
1951
1911
  // this is only required in useStepper hook but deconstruct here to remove its existence in rest
1952
1912
  value: controlledValue, variation, ..._rest } = props;
1953
- const fieldId = useStableId(id);
1954
- const stableId = useStableId();
1913
+ const fieldId = Field.useStableId(id);
1914
+ const stableId = Field.useStableId();
1955
1915
  const descriptionId = descriptiveText
1956
1916
  ? getUniqueComponentId(stableId, DESCRIPTION_SUFFIX)
1957
1917
  : undefined;
@@ -2016,7 +1976,7 @@ const SwitchFieldPrimitive = ({ className, defaultChecked, id, isChecked, isDisa
2016
1976
  });
2017
1977
  const { isFieldsetDisabled } = Field.useFieldset();
2018
1978
  const shouldBeDisabled = isFieldsetDisabled ? isFieldsetDisabled : isDisabled;
2019
- const fieldId = useStableId(id);
1979
+ const fieldId = Field.useStableId(id);
2020
1980
  const wrapperClasses = ui.classNames(ui.ComponentClassName.SwitchTrack, ui.classNameModifierByFlag(ui.ComponentClassName.SwitchTrack, 'checked', isOn), ui.classNameModifierByFlag(ui.ComponentClassName.SwitchTrack, 'disabled', shouldBeDisabled), ui.classNameModifierByFlag(ui.ComponentClassName.SwitchTrack, 'focused', isFocused), ui.classNameModifierByFlag(ui.ComponentClassName.SwitchTrack, 'error', hasError));
2021
1981
  const componentClasses = ui.classNames(ui.ComponentClassName.SwitchThumb, ui.classNameModifierByFlag(ui.ComponentClassName.SwitchThumb, 'checked', isOn), ui.classNameModifierByFlag(ui.ComponentClassName.SwitchThumb, 'disabled', shouldBeDisabled));
2022
1982
  return (React__namespace.createElement(Field.Flex, { className: ui.classNames(ui.ComponentClassName.SwitchField, ui.classNameModifier(ui.ComponentClassName.SwitchField, size), labelPosition ? `amplify-label-${labelPosition}` : null, className), ref: ref, ...rest },
@@ -2197,7 +2157,7 @@ const TabPanel = Field.primitiveWithForwardRef(TabPanelPrimitive);
2197
2157
  TabPanel.displayName = 'Tabs.Panel';
2198
2158
 
2199
2159
  const TabsContainerPrimitive = ({ children, defaultValue, className, value: controlledValue, onValueChange, isLazy, ...rest }, ref) => {
2200
- const groupId = useStableId(); // groupId is used to ensure uniqueness between Tab Groups in IDs
2160
+ const groupId = Field.useStableId(); // groupId is used to ensure uniqueness between Tab Groups in IDs
2201
2161
  const isControlled = controlledValue !== undefined;
2202
2162
  const [localValue, setLocalValue] = React__namespace.useState(() => isControlled ? controlledValue : defaultValue);
2203
2163
  const activeTab = isControlled ? controlledValue : localValue ?? '';
@@ -2293,8 +2253,8 @@ const TextAreaFieldPrimitive = (props, ref) => {
2293
2253
  // Destructuring the 'resize' style prop because while it is a style prop
2294
2254
  // it should go on the textarea element and not the wrapper div.
2295
2255
  resize, ..._rest } = props;
2296
- const fieldId = useStableId(id);
2297
- const stableId = useStableId();
2256
+ const fieldId = Field.useStableId(id);
2257
+ const stableId = Field.useStableId();
2298
2258
  const descriptionId = descriptiveText
2299
2259
  ? getUniqueComponentId(stableId, DESCRIPTION_SUFFIX)
2300
2260
  : undefined;
@@ -2422,6 +2382,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
2422
2382
  Button: Field.Button,
2423
2383
  ButtonGroup: ButtonGroup,
2424
2384
  Card: Card,
2385
+ Checkbox: Checkbox,
2425
2386
  CheckboxField: CheckboxField,
2426
2387
  Collection: Collection,
2427
2388
  ComponentPropsToStylePropsMap: Field.ComponentPropsToStylePropsMap,
@@ -2521,7 +2482,7 @@ const defaultDeleteUserDisplayText = {
2521
2482
  warningText: 'Deleting your account is not reversible. You will lose access to your account and all data associated with it.',
2522
2483
  };
2523
2484
 
2524
- const VERSION = '6.6.0';
2485
+ const VERSION = '6.7.0';
2525
2486
 
2526
2487
  const logger$2 = ui.getLogger('AccountSettings');
2527
2488
  const getIsDisabled = (formValues, validationError) => {
@@ -2832,7 +2793,7 @@ function FormField({ autocomplete: autoComplete, dialCode, name, type, ...props
2832
2793
  ]);
2833
2794
  const errors = React__namespace.useMemo(() => ui.getErrors(validationErrors[name]), [name, validationErrors]);
2834
2795
  const hasError = errors?.length > 0;
2835
- const errorId = useStableId();
2796
+ const errorId = Field.useStableId();
2836
2797
  const ariaDescribedBy = hasError ? errorId : undefined;
2837
2798
  if (type === 'tel') {
2838
2799
  return (React__namespace.createElement(React__namespace.Fragment, null,
@@ -3559,6 +3520,7 @@ exports.Badge = Badge;
3559
3520
  exports.Breadcrumbs = Breadcrumbs;
3560
3521
  exports.ButtonGroup = ButtonGroup;
3561
3522
  exports.Card = Card;
3523
+ exports.Checkbox = Checkbox;
3562
3524
  exports.CheckboxField = CheckboxField;
3563
3525
  exports.Collection = Collection;
3564
3526
  exports.Divider = Divider;