@cloudscape-design/components 3.0.1141 → 3.0.1143

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 (38) hide show
  1. package/autosuggest/index.js +1 -1
  2. package/autosuggest/interfaces.d.ts +47 -0
  3. package/autosuggest/interfaces.d.ts.map +1 -1
  4. package/autosuggest/interfaces.js.map +1 -1
  5. package/autosuggest/internal.d.ts.map +1 -1
  6. package/autosuggest/internal.js +2 -2
  7. package/autosuggest/internal.js.map +1 -1
  8. package/input/styles.css.js +13 -13
  9. package/input/styles.scoped.css +34 -34
  10. package/input/styles.selectors.js +13 -13
  11. package/internal/base-component/styles.scoped.css +1 -1
  12. package/internal/components/autosuggest-input/index.d.ts +2 -1
  13. package/internal/components/autosuggest-input/index.d.ts.map +1 -1
  14. package/internal/components/autosuggest-input/index.js +2 -2
  15. package/internal/components/autosuggest-input/index.js.map +1 -1
  16. package/internal/environment.js +2 -2
  17. package/internal/environment.json +2 -2
  18. package/internal/manifest.json +1 -1
  19. package/package.json +1 -1
  20. package/prompt-input/styles.d.ts +38 -1
  21. package/prompt-input/styles.d.ts.map +1 -1
  22. package/prompt-input/styles.js +1 -2
  23. package/prompt-input/styles.js.map +1 -1
  24. package/radio-group/internal.d.ts.map +1 -1
  25. package/radio-group/internal.js +1 -1
  26. package/radio-group/internal.js.map +1 -1
  27. package/radio-group/styles.css.js +6 -5
  28. package/radio-group/styles.scoped.css +10 -6
  29. package/radio-group/styles.selectors.js +6 -5
  30. package/test-utils/dom/radio-group/index.d.ts +1 -0
  31. package/test-utils/dom/radio-group/index.js +5 -3
  32. package/test-utils/dom/radio-group/index.js.map +1 -1
  33. package/test-utils/selectors/radio-group/index.d.ts +1 -0
  34. package/test-utils/selectors/radio-group/index.js +5 -3
  35. package/test-utils/selectors/radio-group/index.js.map +1 -1
  36. package/tree-view/vertical-connector/styles.css.js +3 -3
  37. package/tree-view/vertical-connector/styles.scoped.css +5 -5
  38. package/tree-view/vertical-connector/styles.selectors.js +3 -3
@@ -9,7 +9,7 @@ import { validateProps } from '@cloudscape-design/component-toolkit/internal';
9
9
 
10
10
 
11
11
  const Autosuggest = React.forwardRef((props, ref) => {
12
- validateProps('Autosuggest', props, ["nativeInputAttributes"], {}, 'console');
12
+ validateProps('Autosuggest', props, ["nativeInputAttributes","style"], {}, 'console');
13
13
  return React.createElement(CoreComponent, {ref,...props});
14
14
  });
15
15
 
@@ -103,6 +103,9 @@ export interface AutosuggestProps extends BaseComponentProps, BaseInputProps, In
103
103
  * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).
104
104
  */
105
105
  renderHighlightedAriaLive?: AutosuggestProps.ContainingOptionAndGroupString;
106
+ /**
107
+ * @awsuiSystem core
108
+ */
106
109
  }
107
110
  export declare namespace AutosuggestProps {
108
111
  type ChangeDetail = InputProps.ChangeDetail;
@@ -134,6 +137,50 @@ export declare namespace AutosuggestProps {
134
137
  */
135
138
  select(): void;
136
139
  }
140
+ interface Style {
141
+ root?: {
142
+ backgroundColor?: {
143
+ default?: string;
144
+ disabled?: string;
145
+ focus?: string;
146
+ hover?: string;
147
+ readonly?: string;
148
+ };
149
+ borderColor?: {
150
+ default?: string;
151
+ disabled?: string;
152
+ focus?: string;
153
+ hover?: string;
154
+ readonly?: string;
155
+ };
156
+ borderRadius?: string;
157
+ borderWidth?: string;
158
+ boxShadow?: {
159
+ default?: string;
160
+ disabled?: string;
161
+ focus?: string;
162
+ hover?: string;
163
+ readonly?: string;
164
+ };
165
+ color?: {
166
+ default?: string;
167
+ disabled?: string;
168
+ focus?: string;
169
+ hover?: string;
170
+ readonly?: string;
171
+ };
172
+ fontSize?: string;
173
+ fontWeight?: string;
174
+ paddingBlock?: string;
175
+ paddingInline?: string;
176
+ };
177
+ placeholder?: {
178
+ color?: string;
179
+ fontSize?: string;
180
+ fontStyle?: string;
181
+ fontWeight?: string;
182
+ };
183
+ }
137
184
  }
138
185
  export type AutosuggestItem = (AutosuggestProps.Option | AutosuggestProps.OptionGroup) & {
139
186
  type?: 'parent' | 'child' | 'use-entered';
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,gBACf,SAAQ,kBAAkB,EACxB,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,+BAA+B,EAC/B,mBAAmB;IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA+BI;IACJ,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC;IACnC;;;;;;;;;;;;;;;;QAgBI;IACJ,aAAa,CAAC,EAAE,oBAAoB,CAAC;IAErC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;IAErD;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,MAAM,CAAC;IAE5E;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,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AC,EAAE,MAAM,CAAC;SACrB,CAAC;KACH;CACF;AAGD,MAAM,MAAM,eAAe,GAAG,CAAC,gBAAgB,CAAC,MAAM,GAAG,gBAAgB,CAAC,WAAW,CAAC,GAAG;IACvF,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;IAC1C,MAAM,EAAE,gBAAgB,GAAG,WAAW,CAAC;CACxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/autosuggest/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseInputProps, InputAutoCorrect, InputClearLabel, InputKeyEvents, InputProps } from '../input/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport {\n BaseDropdownHostProps,\n OptionsFilteringType,\n OptionsLoadItemsDetail,\n} from '../internal/components/dropdown/interfaces';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface AutosuggestProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n BaseDropdownHostProps,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n DropdownStatusProps {\n /**\n * Specifies an array of options that are displayed to the user as a dropdown list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n * - `label` (string) - (Optional) Option text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option.\n * - `iconAriaLabel` (string) - (Optional) Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n * - `iconAlt` (string) - (Optional) **Deprecated**, replaced by \\`iconAriaLabel\\`. Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * #### OptionGroup\n * - `label` (string) - Option group text displayed to the user.\n * - `disabled` (boolean) - (Optional) Determines whether the option group is disabled.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n **/\n options?: AutosuggestProps.Options;\n /**\n * Determines how filtering is applied to the list of `options`:\n *\n * * `auto` - The component will automatically filter options based on user input.\n * * `manual` - You will set up `onChange` or `onLoadItems` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the dropdown list. In that case make sure that you use the `onChange` or `onLoadItems` events in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: OptionsFilteringType;\n\n /**\n * Specifies a function that generates the custom value indicator (for example, `Use \"${value}\"`).\n * @i18n\n */\n enteredTextLabel?: AutosuggestProps.EnteredTextLabel;\n\n /**\n * Defines whether entered text option is shown as the first option in the dropdown when value is non-empty.\n */\n hideEnteredTextOption?: boolean;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n *\n * Note that the `matchesCount` includes the `enteredTextLabel` (\"Use ${value}\") item, so in most cases you\n * should subtract 1 from `matchesCount`. If using manual filtering, you should provide your own value for `totalCount`.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n\n /**\n * Specifies the text that's displayed when there aren't any suggestions to display.\n * This is displayed when `statusType` is set to `finished` or it's not set at all.\n */\n empty?: React.ReactNode;\n\n /**\n * Called whenever a user selects an option in the dropdown. Don't use this event as the only way to handle user input.\n * Instead, use `onSelect` in combination with the `onChange` handler only as an optional convenience for the user.\n */\n onSelect?: NonCancelableEventHandler<AutosuggestProps.SelectDetail>;\n\n /**\n * Specifies the localized string that describes an option as being selected.\n * This is required to provide a good screen reader experience. For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n * @i18n\n */\n selectedAriaLabel?: string;\n /**\n * Overrides the element that is announced to screen readers\n * when the highlighted option changes. By default, this announces\n * the option's name and properties, and its selected state if\n * the `selectedLabel` property is defined.\n * The highlighted option is provided, and its group (if groups\n * are used and it differs from the group of the previously highlighted option).\n *\n * For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n */\n renderHighlightedAriaLive?: AutosuggestProps.ContainingOptionAndGroupString;\n}\n\nexport namespace AutosuggestProps {\n export type ChangeDetail = InputProps.ChangeDetail;\n export type KeyDetail = InputProps.KeyDetail;\n export type FilteringType = OptionsFilteringType;\n export type Option = OptionDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n export type EnteredTextLabel = (value: string) => string;\n export interface OptionGroup extends Option {\n label?: string;\n options: ReadonlyArray<Option>;\n }\n export type LoadItemsDetail = OptionsLoadItemsDetail;\n export type StatusType = DropdownStatusProps.StatusType;\n export interface SelectDetail {\n value: string;\n selectedOption?: Option;\n }\n\n export interface ContainingOptionAndGroupString {\n (option: Option, group?: OptionGroup): string;\n }\n\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n\n /**\n * Selects all text in the input control.\n */\n select(): void;\n }\n}\n\n// TODO: use DropdownOption type same as in select and multiselect\nexport type AutosuggestItem = (AutosuggestProps.Option | AutosuggestProps.OptionGroup) & {\n type?: 'parent' | 'child' | 'use-entered';\n option: OptionDefinition | OptionGroup;\n};\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/autosuggest/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseInputProps, InputAutoCorrect, InputClearLabel, InputKeyEvents, InputProps } from '../input/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport {\n BaseDropdownHostProps,\n OptionsFilteringType,\n OptionsLoadItemsDetail,\n} from '../internal/components/dropdown/interfaces';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface AutosuggestProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n BaseDropdownHostProps,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n DropdownStatusProps {\n /**\n * Specifies an array of options that are displayed to the user as a dropdown list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n * - `label` (string) - (Optional) Option text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option.\n * - `iconAriaLabel` (string) - (Optional) Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n * - `iconAlt` (string) - (Optional) **Deprecated**, replaced by \\`iconAriaLabel\\`. Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * #### OptionGroup\n * - `label` (string) - Option group text displayed to the user.\n * - `disabled` (boolean) - (Optional) Determines whether the option group is disabled.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n **/\n options?: AutosuggestProps.Options;\n /**\n * Determines how filtering is applied to the list of `options`:\n *\n * * `auto` - The component will automatically filter options based on user input.\n * * `manual` - You will set up `onChange` or `onLoadItems` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the dropdown list. In that case make sure that you use the `onChange` or `onLoadItems` events in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: OptionsFilteringType;\n\n /**\n * Specifies a function that generates the custom value indicator (for example, `Use \"${value}\"`).\n * @i18n\n */\n enteredTextLabel?: AutosuggestProps.EnteredTextLabel;\n\n /**\n * Defines whether entered text option is shown as the first option in the dropdown when value is non-empty.\n */\n hideEnteredTextOption?: boolean;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n *\n * Note that the `matchesCount` includes the `enteredTextLabel` (\"Use ${value}\") item, so in most cases you\n * should subtract 1 from `matchesCount`. If using manual filtering, you should provide your own value for `totalCount`.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n\n /**\n * Specifies the text that's displayed when there aren't any suggestions to display.\n * This is displayed when `statusType` is set to `finished` or it's not set at all.\n */\n empty?: React.ReactNode;\n\n /**\n * Called whenever a user selects an option in the dropdown. Don't use this event as the only way to handle user input.\n * Instead, use `onSelect` in combination with the `onChange` handler only as an optional convenience for the user.\n */\n onSelect?: NonCancelableEventHandler<AutosuggestProps.SelectDetail>;\n\n /**\n * Specifies the localized string that describes an option as being selected.\n * This is required to provide a good screen reader experience. For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n * @i18n\n */\n selectedAriaLabel?: string;\n /**\n * Overrides the element that is announced to screen readers\n * when the highlighted option changes. By default, this announces\n * the option's name and properties, and its selected state if\n * the `selectedLabel` property is defined.\n * The highlighted option is provided, and its group (if groups\n * are used and it differs from the group of the previously highlighted option).\n *\n * For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n */\n renderHighlightedAriaLive?: AutosuggestProps.ContainingOptionAndGroupString;\n\n /**\n * @awsuiSystem core\n */\n style?: AutosuggestProps.Style;\n}\n\nexport namespace AutosuggestProps {\n export type ChangeDetail = InputProps.ChangeDetail;\n export type KeyDetail = InputProps.KeyDetail;\n export type FilteringType = OptionsFilteringType;\n export type Option = OptionDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n export type EnteredTextLabel = (value: string) => string;\n export interface OptionGroup extends Option {\n label?: string;\n options: ReadonlyArray<Option>;\n }\n export type LoadItemsDetail = OptionsLoadItemsDetail;\n export type StatusType = DropdownStatusProps.StatusType;\n export interface SelectDetail {\n value: string;\n selectedOption?: Option;\n }\n\n export interface ContainingOptionAndGroupString {\n (option: Option, group?: OptionGroup): string;\n }\n\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n\n /**\n * Selects all text in the input control.\n */\n select(): void;\n }\n\n export interface Style {\n root?: {\n backgroundColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderColor?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n color?: {\n default?: string;\n disabled?: string;\n focus?: string;\n hover?: string;\n readonly?: string;\n };\n fontSize?: string;\n fontWeight?: string;\n paddingBlock?: string;\n paddingInline?: string;\n };\n placeholder?: {\n color?: string;\n fontSize?: string;\n fontStyle?: string;\n fontWeight?: string;\n };\n }\n}\n\n// TODO: use DropdownOption type same as in select and multiselect\nexport type AutosuggestItem = (AutosuggestProps.Option | AutosuggestProps.OptionGroup) & {\n type?: 'parent' | 'child' | 'use-entered';\n option: OptionDefinition | OptionGroup;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAmBhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAmB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOjE,UAAU,wBAAyB,SAAQ,gBAAgB,EAAE,0BAA0B;CAAG;AAE1F,QAAA,MAAM,mBAAmB,uGAuOvB,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAmBhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAmB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOjE,UAAU,wBAAyB,SAAQ,gBAAgB,EAAE,0BAA0B;CAAG;AAE1F,QAAA,MAAM,mBAAmB,uGAyOvB,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
@@ -17,7 +17,7 @@ import AutosuggestOptionsList from './options-list';
17
17
  import styles from './styles.css.js';
18
18
  const InternalAutosuggest = React.forwardRef((props, ref) => {
19
19
  var _a, _b;
20
- const { value, onChange, onBlur, onFocus, onKeyUp, onLoadItems, options, filteringType = 'auto', statusType = 'finished', placeholder, clearAriaLabel, name, disabled, disableBrowserAutocorrect = false, autoFocus, readOnly, ariaLabel, ariaRequired, enteredTextLabel, hideEnteredTextOption, filteringResultsText, onKeyDown, virtualScroll, expandToViewport, onSelect, renderHighlightedAriaLive, __internalRootRef, ...restProps } = props;
20
+ const { value, onChange, onBlur, onFocus, onKeyUp, onLoadItems, options, filteringType = 'auto', statusType = 'finished', placeholder, clearAriaLabel, name, disabled, disableBrowserAutocorrect = false, autoFocus, readOnly, ariaLabel, ariaRequired, enteredTextLabel, hideEnteredTextOption, filteringResultsText, onKeyDown, virtualScroll, expandToViewport, onSelect, renderHighlightedAriaLive, style, __internalRootRef, ...restProps } = props;
21
21
  checkControlled('Autosuggest', 'value', value, 'onChange', onChange);
22
22
  checkOptionValueField('Autosuggest', 'options', options);
23
23
  const autosuggestInputRef = useRef(null);
@@ -126,7 +126,7 @@ const InternalAutosuggest = React.forwardRef((props, ref) => {
126
126
  hasRecoveryCallback: !!onLoadItems,
127
127
  });
128
128
  const shouldRenderDropdownContent = autosuggestItemsState.items.length !== 0 || !!dropdownStatus.content || (!hideEnteredTextOption && !!value);
129
- return (React.createElement(AutosuggestInput, { ...restProps, className: clsx(styles.root, restProps.className), ref: autosuggestInputRef, __internalRootRef: __internalRootRef, value: value, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, name: name, controlId: controlId, placeholder: placeholder, disabled: disabled, readOnly: readOnly, autoFocus: autoFocus, ariaLabel: ariaLabel, ariaRequired: ariaRequired, clearAriaLabel: clearAriaLabel, disableBrowserAutocorrect: disableBrowserAutocorrect, expandToViewport: expandToViewport, ariaControls: listId, ariaActivedescendant: highlightedOptionId, dropdownExpanded: shouldRenderDropdownContent, dropdownContent: shouldRenderDropdownContent && (React.createElement(AutosuggestOptionsList, { statusType: statusType, autosuggestItemsState: autosuggestItemsState, autosuggestItemsHandlers: autosuggestItemsHandlers, highlightedOptionId: highlightedOptionId, highlightText: value, listId: listId, controlId: controlId, handleLoadMore: autosuggestLoadMoreHandlers.fireLoadMoreOnScroll, hasDropdownStatus: dropdownStatus.content !== null, virtualScroll: virtualScroll, selectedAriaLabel: selectedAriaLabel, renderHighlightedAriaLive: renderHighlightedAriaLive, listBottom: !dropdownStatus.isSticky ? React.createElement(DropdownFooter, { content: dropdownStatus.content, id: footerControlId }) : null, ariaDescribedby: dropdownStatus.content ? footerControlId : undefined })), dropdownFooter: dropdownStatus.isSticky && dropdownStatus.content ? (React.createElement(DropdownFooter, { id: footerControlId, content: dropdownStatus.content, hasItems: autosuggestItemsState.items.length >= 1 })) : null, loopFocus: dropdownStatus.hasRecoveryButton, onCloseDropdown: handleCloseDropdown, onDelayedInput: handleDelayedInput, onPressArrowDown: handlePressArrowDown, onPressArrowUp: handlePressArrowUp, onPressEnter: handlePressEnter }));
129
+ return (React.createElement(AutosuggestInput, { ...restProps, className: clsx(styles.root, restProps.className), ref: autosuggestInputRef, __internalRootRef: __internalRootRef, value: value, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, name: name, controlId: controlId, placeholder: placeholder, disabled: disabled, readOnly: readOnly, autoFocus: autoFocus, ariaLabel: ariaLabel, ariaRequired: ariaRequired, clearAriaLabel: clearAriaLabel, disableBrowserAutocorrect: disableBrowserAutocorrect, expandToViewport: expandToViewport, ariaControls: listId, ariaActivedescendant: highlightedOptionId, dropdownExpanded: shouldRenderDropdownContent, style: style, dropdownContent: shouldRenderDropdownContent && (React.createElement(AutosuggestOptionsList, { statusType: statusType, autosuggestItemsState: autosuggestItemsState, autosuggestItemsHandlers: autosuggestItemsHandlers, highlightedOptionId: highlightedOptionId, highlightText: value, listId: listId, controlId: controlId, handleLoadMore: autosuggestLoadMoreHandlers.fireLoadMoreOnScroll, hasDropdownStatus: dropdownStatus.content !== null, virtualScroll: virtualScroll, selectedAriaLabel: selectedAriaLabel, renderHighlightedAriaLive: renderHighlightedAriaLive, listBottom: !dropdownStatus.isSticky ? React.createElement(DropdownFooter, { content: dropdownStatus.content, id: footerControlId }) : null, ariaDescribedby: dropdownStatus.content ? footerControlId : undefined })), dropdownFooter: dropdownStatus.isSticky && dropdownStatus.content ? (React.createElement(DropdownFooter, { id: footerControlId, content: dropdownStatus.content, hasItems: autosuggestItemsState.items.length >= 1 })) : null, loopFocus: dropdownStatus.hasRecoveryButton, onCloseDropdown: handleCloseDropdown, onDelayedInput: handleDelayedInput, onPressArrowDown: handlePressArrowDown, onPressArrowUp: handlePressArrowUp, onPressEnter: handlePressEnter }));
130
130
  });
131
131
  export default InternalAutosuggest;
132
132
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/autosuggest/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAO,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,gBAAyC,MAAM,0CAA0C,CAAC;AAEjG,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,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B,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GACjD,CACH,CAAC,CAAC,CAAC,IAAI,EAEV,SAAS,EAAE,cAAc,CAAC,iBAAiB,EAC3C,eAAe,EAAE,mBAAmB,EACpC,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,oBAAoB,EACtC,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gBAAgB,GAC9B,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { useInternalI18n } from '../i18n/context';\nimport { BaseChangeDetail } from '../input/interfaces';\nimport AutosuggestInput, { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport { OptionsLoadItemsDetail } from '../internal/components/dropdown/interfaces';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport {\n BaseKeyDetail,\n fireCancelableEvent,\n fireNonCancelableEvent,\n NonCancelableCustomEvent,\n} from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field';\nimport { AutosuggestItem, AutosuggestProps } from './interfaces';\nimport { useAutosuggestLoadMore } from './load-more-controller';\nimport { useAutosuggestItems } from './options-controller';\nimport AutosuggestOptionsList from './options-list';\n\nimport styles from './styles.css.js';\n\ninterface InternalAutosuggestProps extends AutosuggestProps, InternalBaseComponentProps {}\n\nconst InternalAutosuggest = React.forwardRef((props: InternalAutosuggestProps, ref: Ref<AutosuggestProps.Ref>) => {\n const {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onLoadItems,\n options,\n filteringType = 'auto',\n statusType = 'finished',\n placeholder,\n clearAriaLabel,\n name,\n disabled,\n disableBrowserAutocorrect = false,\n autoFocus,\n readOnly,\n ariaLabel,\n ariaRequired,\n enteredTextLabel,\n hideEnteredTextOption,\n filteringResultsText,\n onKeyDown,\n virtualScroll,\n expandToViewport,\n onSelect,\n renderHighlightedAriaLive,\n __internalRootRef,\n ...restProps\n } = props;\n\n checkControlled('Autosuggest', 'value', value, 'onChange', onChange);\n checkOptionValueField('Autosuggest', 'options', options);\n\n const autosuggestInputRef = useRef<AutosuggestInputRef>(null);\n useImperativeHandle(\n ref,\n () => ({\n focus: () => autosuggestInputRef.current?.focus(),\n select: () => autosuggestInputRef.current?.select(),\n }),\n []\n );\n\n const i18n = useInternalI18n('autosuggest');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Autosuggest', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({\n options: options || [],\n filterValue: value,\n filterText: value,\n filteringType,\n enteredTextLabel,\n hideEnteredTextLabel: hideEnteredTextOption,\n onSelectItem: (option: AutosuggestItem) => {\n const value = option.value || '';\n fireNonCancelableEvent(onChange, { value });\n fireNonCancelableEvent(onSelect, {\n value,\n selectedOption: option.type !== 'use-entered' ? option.option : undefined,\n });\n autosuggestInputRef.current?.close();\n },\n });\n\n const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({\n options,\n statusType,\n onLoadItems: (detail: OptionsLoadItemsDetail) => fireNonCancelableEvent(onLoadItems, detail),\n });\n\n const handleChange = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestItemsHandlers.setShowAll(false);\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n fireNonCancelableEvent(onChange, event.detail);\n };\n\n const handleDelayedInput = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value);\n };\n\n const handleBlur = () => {\n fireNonCancelableEvent(onBlur, null);\n };\n\n const handleFocus = () => {\n autosuggestItemsHandlers.setShowAll(true);\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus();\n fireNonCancelableEvent(onFocus, null);\n };\n\n const handleKeyUp = (event: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyUp, event.detail, event);\n };\n\n const handleKeyDown = (event: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyDown, event.detail, event);\n };\n\n const handlePressArrowDown = () => {\n if (autosuggestItemsState.items.length - 1 === autosuggestItemsState.highlightedIndex) {\n autosuggestItemsHandlers.goHomeWithKeyboard();\n return;\n }\n\n autosuggestItemsHandlers.moveHighlightWithKeyboard(1);\n };\n\n const handlePressArrowUp = () => {\n if (\n (autosuggestItemsState.highlightedOption?.type === 'child' && autosuggestItemsState.highlightedIndex === 1) ||\n autosuggestItemsState.highlightedIndex === 0\n ) {\n autosuggestItemsHandlers.goEndWithKeyboard();\n return;\n }\n\n autosuggestItemsHandlers.moveHighlightWithKeyboard(-1);\n };\n\n const handlePressEnter = () => {\n return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard();\n };\n\n const handleCloseDropdown = () => {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n };\n\n const handleRecoveryClick = () => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick();\n autosuggestInputRef.current?.focus();\n };\n\n const formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('input');\n const footerControlId = useUniqueId('footer');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const listId = useUniqueId('list');\n const highlightedOptionIdSource = useUniqueId();\n const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : undefined;\n\n const isEmpty = !value && !autosuggestItemsState.items.length;\n const isFiltered = !!value && value.length !== 0 && !(filteringType === 'auto' && autosuggestItemsState.showAll);\n const filteredText = isFiltered\n ? filteringResultsText?.(autosuggestItemsState.items.length, options?.length ?? 0)\n : undefined;\n const dropdownStatus = useDropdownStatus({\n ...props,\n isEmpty,\n recoveryText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n filteringResultsText: filteredText,\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const shouldRenderDropdownContent =\n autosuggestItemsState.items.length !== 0 || !!dropdownStatus.content || (!hideEnteredTextOption && !!value);\n\n return (\n <AutosuggestInput\n {...restProps}\n className={clsx(styles.root, restProps.className)}\n ref={autosuggestInputRef}\n __internalRootRef={__internalRootRef}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onKeyUp={handleKeyUp}\n onKeyDown={handleKeyDown}\n name={name}\n controlId={controlId}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n autoFocus={autoFocus}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n expandToViewport={expandToViewport}\n ariaControls={listId}\n ariaActivedescendant={highlightedOptionId}\n dropdownExpanded={shouldRenderDropdownContent}\n dropdownContent={\n shouldRenderDropdownContent && (\n <AutosuggestOptionsList\n statusType={statusType}\n autosuggestItemsState={autosuggestItemsState}\n autosuggestItemsHandlers={autosuggestItemsHandlers}\n highlightedOptionId={highlightedOptionId}\n highlightText={value}\n listId={listId}\n controlId={controlId}\n handleLoadMore={autosuggestLoadMoreHandlers.fireLoadMoreOnScroll}\n hasDropdownStatus={dropdownStatus.content !== null}\n virtualScroll={virtualScroll}\n selectedAriaLabel={selectedAriaLabel}\n renderHighlightedAriaLive={renderHighlightedAriaLive}\n listBottom={\n !dropdownStatus.isSticky ? <DropdownFooter content={dropdownStatus.content} id={footerControlId} /> : null\n }\n ariaDescribedby={dropdownStatus.content ? footerControlId : undefined}\n />\n )\n }\n dropdownFooter={\n dropdownStatus.isSticky && dropdownStatus.content ? (\n <DropdownFooter\n id={footerControlId}\n content={dropdownStatus.content}\n hasItems={autosuggestItemsState.items.length >= 1}\n />\n ) : null\n }\n loopFocus={dropdownStatus.hasRecoveryButton}\n onCloseDropdown={handleCloseDropdown}\n onDelayedInput={handleDelayedInput}\n onPressArrowDown={handlePressArrowDown}\n onPressArrowUp={handlePressArrowUp}\n onPressEnter={handlePressEnter}\n />\n );\n});\n\nexport default InternalAutosuggest;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/autosuggest/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAO,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,gBAAyC,MAAM,0CAA0C,CAAC;AAEjG,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAEL,mBAAmB,EACnB,sBAAsB,GAEvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,eAAe,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,sBAAsB,MAAM,gBAAgB,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AAC;AAEH,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { useInternalI18n } from '../i18n/context';\nimport { BaseChangeDetail } from '../input/interfaces';\nimport AutosuggestInput, { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport { OptionsLoadItemsDetail } from '../internal/components/dropdown/interfaces';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport {\n BaseKeyDetail,\n fireCancelableEvent,\n fireNonCancelableEvent,\n NonCancelableCustomEvent,\n} from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field';\nimport { AutosuggestItem, AutosuggestProps } from './interfaces';\nimport { useAutosuggestLoadMore } from './load-more-controller';\nimport { useAutosuggestItems } from './options-controller';\nimport AutosuggestOptionsList from './options-list';\n\nimport styles from './styles.css.js';\n\ninterface InternalAutosuggestProps extends AutosuggestProps, InternalBaseComponentProps {}\n\nconst InternalAutosuggest = React.forwardRef((props: InternalAutosuggestProps, ref: Ref<AutosuggestProps.Ref>) => {\n const {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onLoadItems,\n options,\n filteringType = 'auto',\n statusType = 'finished',\n placeholder,\n clearAriaLabel,\n name,\n disabled,\n disableBrowserAutocorrect = false,\n autoFocus,\n readOnly,\n ariaLabel,\n ariaRequired,\n enteredTextLabel,\n hideEnteredTextOption,\n filteringResultsText,\n onKeyDown,\n virtualScroll,\n expandToViewport,\n onSelect,\n renderHighlightedAriaLive,\n style,\n __internalRootRef,\n ...restProps\n } = props;\n\n checkControlled('Autosuggest', 'value', value, 'onChange', onChange);\n checkOptionValueField('Autosuggest', 'options', options);\n\n const autosuggestInputRef = useRef<AutosuggestInputRef>(null);\n useImperativeHandle(\n ref,\n () => ({\n focus: () => autosuggestInputRef.current?.focus(),\n select: () => autosuggestInputRef.current?.select(),\n }),\n []\n );\n\n const i18n = useInternalI18n('autosuggest');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Autosuggest', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({\n options: options || [],\n filterValue: value,\n filterText: value,\n filteringType,\n enteredTextLabel,\n hideEnteredTextLabel: hideEnteredTextOption,\n onSelectItem: (option: AutosuggestItem) => {\n const value = option.value || '';\n fireNonCancelableEvent(onChange, { value });\n fireNonCancelableEvent(onSelect, {\n value,\n selectedOption: option.type !== 'use-entered' ? option.option : undefined,\n });\n autosuggestInputRef.current?.close();\n },\n });\n\n const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({\n options,\n statusType,\n onLoadItems: (detail: OptionsLoadItemsDetail) => fireNonCancelableEvent(onLoadItems, detail),\n });\n\n const handleChange = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestItemsHandlers.setShowAll(false);\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n fireNonCancelableEvent(onChange, event.detail);\n };\n\n const handleDelayedInput = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value);\n };\n\n const handleBlur = () => {\n fireNonCancelableEvent(onBlur, null);\n };\n\n const handleFocus = () => {\n autosuggestItemsHandlers.setShowAll(true);\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus();\n fireNonCancelableEvent(onFocus, null);\n };\n\n const handleKeyUp = (event: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyUp, event.detail, event);\n };\n\n const handleKeyDown = (event: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyDown, event.detail, event);\n };\n\n const handlePressArrowDown = () => {\n if (autosuggestItemsState.items.length - 1 === autosuggestItemsState.highlightedIndex) {\n autosuggestItemsHandlers.goHomeWithKeyboard();\n return;\n }\n\n autosuggestItemsHandlers.moveHighlightWithKeyboard(1);\n };\n\n const handlePressArrowUp = () => {\n if (\n (autosuggestItemsState.highlightedOption?.type === 'child' && autosuggestItemsState.highlightedIndex === 1) ||\n autosuggestItemsState.highlightedIndex === 0\n ) {\n autosuggestItemsHandlers.goEndWithKeyboard();\n return;\n }\n\n autosuggestItemsHandlers.moveHighlightWithKeyboard(-1);\n };\n\n const handlePressEnter = () => {\n return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard();\n };\n\n const handleCloseDropdown = () => {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n };\n\n const handleRecoveryClick = () => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick();\n autosuggestInputRef.current?.focus();\n };\n\n const formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('input');\n const footerControlId = useUniqueId('footer');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const listId = useUniqueId('list');\n const highlightedOptionIdSource = useUniqueId();\n const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : undefined;\n\n const isEmpty = !value && !autosuggestItemsState.items.length;\n const isFiltered = !!value && value.length !== 0 && !(filteringType === 'auto' && autosuggestItemsState.showAll);\n const filteredText = isFiltered\n ? filteringResultsText?.(autosuggestItemsState.items.length, options?.length ?? 0)\n : undefined;\n const dropdownStatus = useDropdownStatus({\n ...props,\n isEmpty,\n recoveryText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n filteringResultsText: filteredText,\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const shouldRenderDropdownContent =\n autosuggestItemsState.items.length !== 0 || !!dropdownStatus.content || (!hideEnteredTextOption && !!value);\n\n return (\n <AutosuggestInput\n {...restProps}\n className={clsx(styles.root, restProps.className)}\n ref={autosuggestInputRef}\n __internalRootRef={__internalRootRef}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onKeyUp={handleKeyUp}\n onKeyDown={handleKeyDown}\n name={name}\n controlId={controlId}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n autoFocus={autoFocus}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n expandToViewport={expandToViewport}\n ariaControls={listId}\n ariaActivedescendant={highlightedOptionId}\n dropdownExpanded={shouldRenderDropdownContent}\n style={style}\n dropdownContent={\n shouldRenderDropdownContent && (\n <AutosuggestOptionsList\n statusType={statusType}\n autosuggestItemsState={autosuggestItemsState}\n autosuggestItemsHandlers={autosuggestItemsHandlers}\n highlightedOptionId={highlightedOptionId}\n highlightText={value}\n listId={listId}\n controlId={controlId}\n handleLoadMore={autosuggestLoadMoreHandlers.fireLoadMoreOnScroll}\n hasDropdownStatus={dropdownStatus.content !== null}\n virtualScroll={virtualScroll}\n selectedAriaLabel={selectedAriaLabel}\n renderHighlightedAriaLive={renderHighlightedAriaLive}\n listBottom={\n !dropdownStatus.isSticky ? <DropdownFooter content={dropdownStatus.content} id={footerControlId} /> : null\n }\n ariaDescribedby={dropdownStatus.content ? footerControlId : undefined}\n />\n )\n }\n dropdownFooter={\n dropdownStatus.isSticky && dropdownStatus.content ? (\n <DropdownFooter\n id={footerControlId}\n content={dropdownStatus.content}\n hasItems={autosuggestItemsState.items.length >= 1}\n />\n ) : null\n }\n loopFocus={dropdownStatus.hasRecoveryButton}\n onCloseDropdown={handleCloseDropdown}\n onDelayedInput={handleDelayedInput}\n onPressArrowDown={handlePressArrowDown}\n onPressArrowUp={handlePressArrowUp}\n onPressEnter={handlePressEnter}\n />\n );\n});\n\nexport default InternalAutosuggest;\n"]}
@@ -1,18 +1,18 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_2rhyz_gipla_145",
5
- "input": "awsui_input_2rhyz_gipla_149",
6
- "input-readonly": "awsui_input-readonly_2rhyz_gipla_203",
7
- "input-invalid": "awsui_input-invalid_2rhyz_gipla_266",
8
- "input-has-icon-left": "awsui_input-has-icon-left_2rhyz_gipla_275",
9
- "input-warning": "awsui_input-warning_2rhyz_gipla_278",
10
- "input-type-search": "awsui_input-type-search_2rhyz_gipla_290",
11
- "input-has-icon-right": "awsui_input-has-icon-right_2rhyz_gipla_303",
12
- "input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_gipla_306",
13
- "input-container": "awsui_input-container_2rhyz_gipla_313",
14
- "input-icon-left": "awsui_input-icon-left_2rhyz_gipla_318",
15
- "input-icon-right": "awsui_input-icon-right_2rhyz_gipla_325",
16
- "input-button-right": "awsui_input-button-right_2rhyz_gipla_331"
4
+ "root": "awsui_root_2rhyz_i4lok_145",
5
+ "input": "awsui_input_2rhyz_i4lok_149",
6
+ "input-readonly": "awsui_input-readonly_2rhyz_i4lok_203",
7
+ "input-invalid": "awsui_input-invalid_2rhyz_i4lok_266",
8
+ "input-has-icon-left": "awsui_input-has-icon-left_2rhyz_i4lok_275",
9
+ "input-warning": "awsui_input-warning_2rhyz_i4lok_278",
10
+ "input-type-search": "awsui_input-type-search_2rhyz_i4lok_290",
11
+ "input-has-icon-right": "awsui_input-has-icon-right_2rhyz_i4lok_303",
12
+ "input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_i4lok_306",
13
+ "input-container": "awsui_input-container_2rhyz_i4lok_313",
14
+ "input-icon-left": "awsui_input-icon-left_2rhyz_i4lok_318",
15
+ "input-icon-right": "awsui_input-icon-right_2rhyz_i4lok_325",
16
+ "input-button-right": "awsui_input-button-right_2rhyz_i4lok_331"
17
17
  };
18
18
 
@@ -142,11 +142,11 @@
142
142
  */
143
143
  /* Style used for links in slots/components that are text heavy, to help links stand out among
144
144
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
145
- .awsui_root_2rhyz_gipla_145:not(#\9) {
145
+ .awsui_root_2rhyz_i4lok_145:not(#\9) {
146
146
  /* used in test-utils for component to distinguish input from other input-like components, for example autosuggest */
147
147
  }
148
148
 
149
- .awsui_input_2rhyz_gipla_149:not(#\9) {
149
+ .awsui_input_2rhyz_i4lok_149:not(#\9) {
150
150
  border-collapse: separate;
151
151
  border-spacing: 0;
152
152
  box-sizing: border-box;
@@ -194,20 +194,20 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
194
194
  line-height: var(--line-height-body-m-2mh3ke, 20px);
195
195
  block-size: var(--size-vertical-input-p1d7xx, 32px);
196
196
  }
197
- .awsui_input_2rhyz_gipla_149:not(#\9):hover {
197
+ .awsui_input_2rhyz_i4lok_149:not(#\9):hover {
198
198
  border-color: var(--awsui-style-border-color-hover-d43v8n, var(--awsui-style-border-color-default-d43v8n, var(--color-border-input-default-317xk5, #8c8c94)));
199
199
  color: var(--awsui-style-color-hover-d43v8n, var(--awsui-style-border-color-default-d43v8n, var(--color-text-body-default-vvtq8u, #0f141a)));
200
200
  background-color: var(--awsui-style-background-hover-d43v8n, var(--awsui-style-background-default-d43v8n, var(--color-background-input-default-ifz5bb, #ffffff)));
201
201
  box-shadow: var(--awsui-style-box-shadow-hover-d43v8n, --awsui-style-box-shadow-default-d43v8n);
202
202
  }
203
- .awsui_input_2rhyz_gipla_149.awsui_input-readonly_2rhyz_gipla_203:not(#\9) {
203
+ .awsui_input_2rhyz_i4lok_149.awsui_input-readonly_2rhyz_i4lok_203:not(#\9) {
204
204
  background-color: var(--awsui-style-background-readonly-d43v8n, var(--awsui-style-background-default-d43v8n, var(--color-background-input-default-ifz5bb, #ffffff)));
205
205
  border-block: var(--border-width-field-2xc78x, 1px) solid var(--awsui-style-border-color-readonly-d43v8n, var(--awsui-style-border-color-default-d43v8n, var(--color-border-input-disabled-zgnzvk, #ebebf0)));
206
206
  border-inline: var(--border-width-field-2xc78x, 1px) solid var(--awsui-style-border-color-readonly-d43v8n, var(--awsui-style-border-color-default-d43v8n, var(--color-border-input-disabled-zgnzvk, #ebebf0)));
207
207
  color: var(--awsui-style-color-readonly-d43v8n, var(--awsui-style-color-default-d43v8n, var(--color-text-body-default-vvtq8u, #0f141a)));
208
208
  box-shadow: var(--awsui-style-box-shadow-readonly-d43v8n);
209
209
  }
210
- .awsui_input_2rhyz_gipla_149:not(#\9)::-webkit-input-placeholder {
210
+ .awsui_input_2rhyz_i4lok_149:not(#\9)::-webkit-input-placeholder {
211
211
  color: var(--awsui-style-placeholder-color-d43v8n, var(--color-text-input-placeholder-dclg8u, #656871));
212
212
  font-size: var(--awsui-style-placeholder-font-size-d43v8n);
213
213
  font-style: var(--awsui-style-placeholder-font-style-d43v8n, italic);
@@ -215,21 +215,21 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
215
215
  -webkit-user-select: none;
216
216
  user-select: none;
217
217
  }
218
- .awsui_input_2rhyz_gipla_149:not(#\9)::-moz-placeholder {
218
+ .awsui_input_2rhyz_i4lok_149:not(#\9)::-moz-placeholder {
219
219
  color: var(--awsui-style-placeholder-color-d43v8n, var(--color-text-input-placeholder-dclg8u, #656871));
220
220
  font-size: var(--awsui-style-placeholder-font-size-d43v8n);
221
221
  font-style: var(--awsui-style-placeholder-font-style-d43v8n, italic);
222
222
  font-weight: var(--awsui-style-placeholder-font-weight-d43v8n);
223
223
  opacity: 1;
224
224
  }
225
- .awsui_input_2rhyz_gipla_149:not(#\9):-moz-placeholder {
225
+ .awsui_input_2rhyz_i4lok_149:not(#\9):-moz-placeholder {
226
226
  color: var(--awsui-style-placeholder-color-d43v8n, var(--color-text-input-placeholder-dclg8u, #656871));
227
227
  font-size: var(--awsui-style-placeholder-font-size-d43v8n);
228
228
  font-style: var(--awsui-style-placeholder-font-style-d43v8n, italic);
229
229
  font-weight: var(--awsui-style-placeholder-font-weight-d43v8n);
230
230
  opacity: 1;
231
231
  }
232
- .awsui_input_2rhyz_gipla_149:not(#\9):focus {
232
+ .awsui_input_2rhyz_i4lok_149:not(#\9):focus {
233
233
  outline: 2px dotted transparent;
234
234
  border-block: var(--border-width-field-2xc78x, 1px) solid var(--awsui-style-border-color-focus-d43v8n, var(--color-border-input-focused-4z0pgn, #006ce0));
235
235
  border-inline: var(--border-width-field-2xc78x, 1px) solid var(--awsui-style-border-color-focus-d43v8n, var(--color-border-input-focused-4z0pgn, #006ce0));
@@ -241,7 +241,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
241
241
  color: var(--awsui-style-color-focus-d43v8n, var(--color-text-body-default-vvtq8u, #0f141a));
242
242
  background-color: var(--awsui-style-background-focus-d43v8n, var(--color-background-input-default-ifz5bb, #ffffff));
243
243
  }
244
- .awsui_input_2rhyz_gipla_149:not(#\9):disabled {
244
+ .awsui_input_2rhyz_i4lok_149:not(#\9):disabled {
245
245
  background-color: var(--awsui-style-background-disabled-d43v8n, var(--color-background-input-disabled-dihaja, #ebebf0));
246
246
  border-block: var(--border-width-field-2xc78x, 1px) solid var(--awsui-style-border-color-disabled-d43v8n, var(--color-border-input-disabled-zgnzvk, #ebebf0));
247
247
  border-inline: var(--border-width-field-2xc78x, 1px) solid var(--awsui-style-border-color-disabled-d43v8n, var(--color-border-input-disabled-zgnzvk, #ebebf0));
@@ -249,87 +249,87 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
249
249
  cursor: default;
250
250
  box-shadow: var(--awsui-style-box-shadow-disabled-d43v8n);
251
251
  }
252
- .awsui_input_2rhyz_gipla_149:not(#\9):disabled::-webkit-input-placeholder {
253
- color: var(--color-text-input-placeholder-disabled-wg87og, #b4b4bb);
252
+ .awsui_input_2rhyz_i4lok_149:not(#\9):disabled::-webkit-input-placeholder {
253
+ color: var(--awsui-style-placeholder-color-d43v8n, var(--color-text-input-placeholder-disabled-wg87og, #b4b4bb));
254
254
  -webkit-user-select: none;
255
255
  user-select: none;
256
256
  }
257
- .awsui_input_2rhyz_gipla_149:not(#\9):disabled::-moz-placeholder {
258
- color: var(--color-text-input-placeholder-disabled-wg87og, #b4b4bb);
257
+ .awsui_input_2rhyz_i4lok_149:not(#\9):disabled::-moz-placeholder {
258
+ color: var(--awsui-style-placeholder-color-d43v8n, var(--color-text-input-placeholder-disabled-wg87og, #b4b4bb));
259
259
  opacity: 1;
260
260
  }
261
- .awsui_input_2rhyz_gipla_149:not(#\9):disabled:-moz-placeholder {
262
- color: var(--color-text-input-placeholder-disabled-wg87og, #b4b4bb);
261
+ .awsui_input_2rhyz_i4lok_149:not(#\9):disabled:-moz-placeholder {
262
+ color: var(--awsui-style-placeholder-color-d43v8n, var(--color-text-input-placeholder-disabled-wg87og, #b4b4bb));
263
263
  opacity: 1;
264
264
  }
265
- .awsui_input_2rhyz_gipla_149:not(#\9):invalid {
265
+ .awsui_input_2rhyz_i4lok_149:not(#\9):invalid {
266
266
  box-shadow: none;
267
267
  }
268
- .awsui_input_2rhyz_gipla_149.awsui_input-invalid_2rhyz_gipla_266:not(#\9) {
268
+ .awsui_input_2rhyz_i4lok_149.awsui_input-invalid_2rhyz_i4lok_266:not(#\9) {
269
269
  color: var(--awsui-style-color-default-d43v8n, var(--color-text-status-error-ksqavh, #db0000));
270
270
  border-color: var(--awsui-style-border-color-default-d43v8n, var(--color-text-status-error-ksqavh, #db0000));
271
271
  padding-inline-start: calc(var(--space-field-horizontal-0aq2ch, 12px) - (var(--border-invalid-width-3xd6e1, 8px) - var(--border-width-field-2xc78x, 1px)));
272
272
  border-inline-start-width: var(--border-invalid-width-3xd6e1, 8px);
273
273
  }
274
- .awsui_input_2rhyz_gipla_149.awsui_input-invalid_2rhyz_gipla_266:not(#\9):focus {
275
- box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-9jjf96, 2px) var(--color-border-item-focused-uk47pl, #006ce0);
274
+ .awsui_input_2rhyz_i4lok_149.awsui_input-invalid_2rhyz_i4lok_266:not(#\9):focus {
275
+ box-shadow: var(--awsui-style-box-shadow-focus-d43v8n, 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-9jjf96, 2px) var(--color-border-item-focused-uk47pl, #006ce0));
276
276
  }
277
- .awsui_input_2rhyz_gipla_149.awsui_input-invalid_2rhyz_gipla_266.awsui_input-has-icon-left_2rhyz_gipla_275:not(#\9) {
277
+ .awsui_input_2rhyz_i4lok_149.awsui_input-invalid_2rhyz_i4lok_266.awsui_input-has-icon-left_2rhyz_i4lok_275:not(#\9) {
278
278
  padding-inline-start: calc(var(--space-field-icon-offset-ikwzwx, 36px) - (var(--border-invalid-width-3xd6e1, 8px) - var(--border-width-field-2xc78x, 1px)));
279
279
  }
280
- .awsui_input_2rhyz_gipla_149.awsui_input-warning_2rhyz_gipla_278:not(#\9) {
280
+ .awsui_input_2rhyz_i4lok_149.awsui_input-warning_2rhyz_i4lok_278:not(#\9) {
281
281
  color: var(--awsui-style-color-default-d43v8n, var(--color-text-status-warning-6meo06, #855900));
282
282
  border-color: var(--awsui-style-border-color-default-d43v8n, var(--color-text-status-warning-6meo06, #855900));
283
283
  padding-inline-start: calc(var(--space-field-horizontal-0aq2ch, 12px) - (var(--border-invalid-width-3xd6e1, 8px) - var(--border-width-field-2xc78x, 1px)));
284
284
  border-inline-start-width: var(--border-invalid-width-3xd6e1, 8px);
285
285
  }
286
- .awsui_input_2rhyz_gipla_149.awsui_input-warning_2rhyz_gipla_278:not(#\9):focus {
287
- box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-9jjf96, 2px) var(--color-border-item-focused-uk47pl, #006ce0);
286
+ .awsui_input_2rhyz_i4lok_149.awsui_input-warning_2rhyz_i4lok_278:not(#\9):focus {
287
+ box-shadow: var(--awsui-style-box-shadow-focus-d43v8n, 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-9jjf96, 2px) var(--color-border-item-focused-uk47pl, #006ce0));
288
288
  }
289
- .awsui_input_2rhyz_gipla_149.awsui_input-warning_2rhyz_gipla_278.awsui_input-has-icon-left_2rhyz_gipla_275:not(#\9) {
289
+ .awsui_input_2rhyz_i4lok_149.awsui_input-warning_2rhyz_i4lok_278.awsui_input-has-icon-left_2rhyz_i4lok_275:not(#\9) {
290
290
  padding-inline-start: calc(var(--space-field-icon-offset-ikwzwx, 36px) - (var(--border-invalid-width-3xd6e1, 8px) - var(--border-width-field-2xc78x, 1px)));
291
291
  }
292
- .awsui_input_2rhyz_gipla_149.awsui_input-type-search_2rhyz_gipla_290:not(#\9) {
292
+ .awsui_input_2rhyz_i4lok_149.awsui_input-type-search_2rhyz_i4lok_290:not(#\9) {
293
293
  box-sizing: border-box;
294
294
  -webkit-appearance: none;
295
295
  }
296
- .awsui_input_2rhyz_gipla_149.awsui_input-type-search_2rhyz_gipla_290:not(#\9)::-webkit-search-decoration {
296
+ .awsui_input_2rhyz_i4lok_149.awsui_input-type-search_2rhyz_i4lok_290:not(#\9)::-webkit-search-decoration {
297
297
  -webkit-appearance: none;
298
298
  }
299
- .awsui_input_2rhyz_gipla_149.awsui_input-type-search_2rhyz_gipla_290:not(#\9)::-webkit-search-cancel-button {
299
+ .awsui_input_2rhyz_i4lok_149.awsui_input-type-search_2rhyz_i4lok_290:not(#\9)::-webkit-search-cancel-button {
300
300
  display: none;
301
301
  }
302
- .awsui_input_2rhyz_gipla_149.awsui_input-has-icon-left_2rhyz_gipla_275:not(#\9) {
302
+ .awsui_input_2rhyz_i4lok_149.awsui_input-has-icon-left_2rhyz_i4lok_275:not(#\9) {
303
303
  padding-inline-start: var(--space-field-icon-offset-ikwzwx, 36px);
304
304
  }
305
- .awsui_input_2rhyz_gipla_149.awsui_input-has-icon-right_2rhyz_gipla_303:not(#\9) {
305
+ .awsui_input_2rhyz_i4lok_149.awsui_input-has-icon-right_2rhyz_i4lok_303:not(#\9) {
306
306
  padding-inline-end: var(--space-field-icon-offset-ikwzwx, 36px);
307
307
  }
308
- .awsui_input_2rhyz_gipla_149.awsui_input-has-no-border-radius_2rhyz_gipla_306:not(#\9) {
308
+ .awsui_input_2rhyz_i4lok_149.awsui_input-has-no-border-radius_2rhyz_i4lok_306:not(#\9) {
309
309
  border-start-start-radius: var(--border-radius-dropdown-fgc2a1, 8px);
310
310
  border-start-end-radius: var(--border-radius-dropdown-fgc2a1, 8px);
311
311
  border-end-start-radius: var(--border-radius-dropdown-fgc2a1, 8px);
312
312
  border-end-end-radius: var(--border-radius-dropdown-fgc2a1, 8px);
313
313
  }
314
314
 
315
- .awsui_input-container_2rhyz_gipla_313:not(#\9) {
315
+ .awsui_input-container_2rhyz_i4lok_313:not(#\9) {
316
316
  display: flex;
317
317
  position: relative;
318
318
  }
319
319
 
320
- .awsui_input-icon-left_2rhyz_gipla_318:not(#\9) {
320
+ .awsui_input-icon-left_2rhyz_i4lok_318:not(#\9) {
321
321
  position: absolute;
322
322
  pointer-events: none;
323
323
  inset-inline-start: var(--space-field-horizontal-0aq2ch, 12px);
324
324
  inset-block-start: calc(50% - var(--line-height-body-m-2mh3ke, 20px) / 2);
325
325
  }
326
326
 
327
- .awsui_input-icon-right_2rhyz_gipla_325:not(#\9) {
327
+ .awsui_input-icon-right_2rhyz_i4lok_325:not(#\9) {
328
328
  position: absolute;
329
329
  inset-block-start: calc(calc(50% - var(--line-height-body-m-2mh3ke, 20px) / 2) - var(--space-xxxs-pajhad, 2px));
330
330
  inset-inline-end: calc(var(--space-field-horizontal-0aq2ch, 12px) - var(--space-xxs-hwfkai, 4px));
331
331
  }
332
332
 
333
- .awsui_input-button-right_2rhyz_gipla_331:not(#\9) {
333
+ .awsui_input-button-right_2rhyz_i4lok_331:not(#\9) {
334
334
  /* used in test-utils */
335
335
  }
@@ -2,18 +2,18 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "root": "awsui_root_2rhyz_gipla_145",
6
- "input": "awsui_input_2rhyz_gipla_149",
7
- "input-readonly": "awsui_input-readonly_2rhyz_gipla_203",
8
- "input-invalid": "awsui_input-invalid_2rhyz_gipla_266",
9
- "input-has-icon-left": "awsui_input-has-icon-left_2rhyz_gipla_275",
10
- "input-warning": "awsui_input-warning_2rhyz_gipla_278",
11
- "input-type-search": "awsui_input-type-search_2rhyz_gipla_290",
12
- "input-has-icon-right": "awsui_input-has-icon-right_2rhyz_gipla_303",
13
- "input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_gipla_306",
14
- "input-container": "awsui_input-container_2rhyz_gipla_313",
15
- "input-icon-left": "awsui_input-icon-left_2rhyz_gipla_318",
16
- "input-icon-right": "awsui_input-icon-right_2rhyz_gipla_325",
17
- "input-button-right": "awsui_input-button-right_2rhyz_gipla_331"
5
+ "root": "awsui_root_2rhyz_i4lok_145",
6
+ "input": "awsui_input_2rhyz_i4lok_149",
7
+ "input-readonly": "awsui_input-readonly_2rhyz_i4lok_203",
8
+ "input-invalid": "awsui_input-invalid_2rhyz_i4lok_266",
9
+ "input-has-icon-left": "awsui_input-has-icon-left_2rhyz_i4lok_275",
10
+ "input-warning": "awsui_input-warning_2rhyz_i4lok_278",
11
+ "input-type-search": "awsui_input-type-search_2rhyz_i4lok_290",
12
+ "input-has-icon-right": "awsui_input-has-icon-right_2rhyz_i4lok_303",
13
+ "input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_i4lok_306",
14
+ "input-container": "awsui_input-container_2rhyz_i4lok_313",
15
+ "input-icon-left": "awsui_input-icon-left_2rhyz_i4lok_318",
16
+ "input-icon-right": "awsui_input-icon-right_2rhyz_i4lok_325",
17
+ "input-button-right": "awsui_input-button-right_2rhyz_i4lok_331"
18
18
  };
19
19
 
@@ -2057,5 +2057,5 @@ body {
2057
2057
  }
2058
2058
  }
2059
2059
  :root {
2060
- --awsui-version-info-33e03331: true;
2060
+ --awsui-version-info-0c4c33e5: true;
2061
2061
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AutosuggestProps } from '../../../autosuggest/interfaces';
3
- import { BaseChangeDetail, BaseInputProps, InputAutoCorrect, InputClearLabel, InputKeyEvents } from '../../../input/interfaces';
3
+ import { BaseChangeDetail, BaseInputProps, InputAutoCorrect, InputClearLabel, InputKeyEvents, InputProps } from '../../../input/interfaces';
4
4
  import { BaseComponentProps } from '../../base-component';
5
5
  import { FormFieldValidationControlProps } from '../../context/form-field-context';
6
6
  import { NonCancelableEventHandler } from '../../events';
@@ -21,6 +21,7 @@ interface AutosuggestInputProps extends BaseComponentProps, BaseInputProps, Inpu
21
21
  onPressArrowDown?: () => void;
22
22
  onPressArrowUp?: () => void;
23
23
  onPressEnter?: () => boolean;
24
+ style?: InputProps['style'];
24
25
  }
25
26
  interface AutosuggestInputFocusOptions {
26
27
  preventDropdown?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/autosuggest-input/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAgE,MAAM,OAAO,CAAC;AAGrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,cAAc,EACf,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,kBAAkB,EAAgB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,+BAA+B,EAAuB,MAAM,kCAAkC,CAAC;AACxG,OAAO,EAA8D,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACrH,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAK5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI1D,UAAU,qBACR,SAAQ,kBAAkB,EACxB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,+BAA+B,EAC/B,gBAAgB,EAChB,0BAA0B;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAClD,cAAc,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,CAAC;IAC7D,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC;CAC9B;AAED,UAAU,4BAA4B;IACpC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB,CAAC,GAAG;IAC/D,KAAK,CAAC,OAAO,CAAC,EAAE,4BAA4B,GAAG,IAAI,CAAC;IACpD,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;CACf;AAED,QAAA,MAAM,gBAAgB,mGA8QrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/autosuggest-input/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAgE,MAAM,OAAO,CAAC;AAGrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,cAAc,E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,gBAAgB,CAAC,GAAG;IAC/D,KAAK,CAAC,OAAO,CAAC,EAAE,4BAA4B,GAAG,IAAI,CAAC;IACpD,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;CACf;AAED,QAAA,MAAM,gBAAgB,mGAgRrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -11,7 +11,7 @@ import { nodeBelongs } from '../../utils/node-belongs';
11
11
  import { processAttributes } from '../../utils/with-native-attributes';
12
12
  import Dropdown from '../dropdown';
13
13
  import styles from './styles.css.js';
14
- const AutosuggestInput = React.forwardRef(({ value, onChange, onBlur, onFocus, onKeyUp, onKeyDown, name, placeholder, disabled, readOnly, autoFocus, ariaLabel, ariaRequired, disableBrowserAutocorrect = false, expandToViewport, ariaControls, ariaActivedescendant, clearAriaLabel, dropdownExpanded = true, dropdownContentKey, dropdownContentFocusable = false, dropdownContent = null, dropdownFooter = null, dropdownWidth, loopFocus, nativeInputAttributes, onCloseDropdown, onDelayedInput, onPressArrowDown, onPressArrowUp, onPressEnter, __internalRootRef, ...restProps }, ref) => {
14
+ const AutosuggestInput = React.forwardRef(({ value, onChange, onBlur, onFocus, onKeyUp, onKeyDown, name, placeholder, disabled, readOnly, autoFocus, ariaLabel, ariaRequired, disableBrowserAutocorrect = false, expandToViewport, ariaControls, ariaActivedescendant, clearAriaLabel, dropdownExpanded = true, dropdownContentKey, dropdownContentFocusable = false, dropdownContent = null, dropdownFooter = null, dropdownWidth, loopFocus, nativeInputAttributes, onCloseDropdown, onDelayedInput, onPressArrowDown, onPressArrowUp, onPressEnter, style, __internalRootRef, ...restProps }, ref) => {
15
15
  const baseProps = getBaseProps(restProps);
16
16
  const formFieldContext = useFormFieldContext(restProps);
17
17
  const inputRef = useRef(null);
@@ -174,7 +174,7 @@ const AutosuggestInput = React.forwardRef(({ value, onChange, onBlur, onFocus, o
174
174
  }
175
175
  };
176
176
  return (React.createElement("div", { ...baseProps, className: clsx(baseProps.className, styles.root), ref: __internalRootRef },
177
- React.createElement(Dropdown, { minWidth: dropdownWidth, stretchWidth: !dropdownWidth, stretchBeyondTriggerWidth: true, contentKey: dropdownContentKey, onFocus: handleFocus, onBlur: handleBlur, trigger: React.createElement(InternalInput, { type: "visualSearch", value: value, onChange: event => handleChange(event.detail.value), __onDelayedInput: event => handleDelayedInput(event.detail.value), onKeyDown: handleKeyDown, onKeyUp: onKeyUp, disabled: disabled, disableBrowserAutocorrect: disableBrowserAutocorrect, readOnly: readOnly, ariaRequired: ariaRequired, clearAriaLabel: clearAriaLabel, ref: inputRef, autoComplete: false, nativeInputAttributes: processAttributes(nativeAttributes, nativeInputAttributes, 'Autosuggest'), __skipNativeAttributesWarnings: Object.keys(nativeAttributes), ...formFieldContext }), onMouseDown: handleDropdownMouseDown, open: open && (!!dropdownContent || !!dropdownFooter), footer: dropdownFooterRef && (React.createElement("div", { ref: dropdownFooterRef, className: styles['dropdown-footer'], onKeyDown: handleDropdownKeyDown }, open && dropdownFooter ? dropdownFooter : null)), expandToViewport: expandToViewport, loopFocus: loopFocus }, open && dropdownContent ? (React.createElement("div", { ref: dropdownContentRef, className: styles['dropdown-content'] }, dropdownContent)) : null)));
177
+ React.createElement(Dropdown, { minWidth: dropdownWidth, stretchWidth: !dropdownWidth, stretchBeyondTriggerWidth: true, contentKey: dropdownContentKey, onFocus: handleFocus, onBlur: handleBlur, trigger: React.createElement(InternalInput, { type: "visualSearch", value: value, onChange: event => handleChange(event.detail.value), __onDelayedInput: event => handleDelayedInput(event.detail.value), onKeyDown: handleKeyDown, onKeyUp: onKeyUp, disabled: disabled, disableBrowserAutocorrect: disableBrowserAutocorrect, readOnly: readOnly, ariaRequired: ariaRequired, clearAriaLabel: clearAriaLabel, ref: inputRef, autoComplete: false, nativeInputAttributes: processAttributes(nativeAttributes, nativeInputAttributes, 'Autosuggest'), __skipNativeAttributesWarnings: Object.keys(nativeAttributes), style: style, ...formFieldContext }), onMouseDown: handleDropdownMouseDown, open: open && (!!dropdownContent || !!dropdownFooter), footer: dropdownFooterRef && (React.createElement("div", { ref: dropdownFooterRef, className: styles['dropdown-footer'], onKeyDown: handleDropdownKeyDown }, open && dropdownFooter ? dropdownFooter : null)), expandToViewport: expandToViewport, loopFocus: loopFocus }, open && dropdownContent ? (React.createElement("div", { ref: dropdownContentRef, className: styles['dropdown-content'] }, dropdownContent)) : null)));
178
178
  });
179
179
  export default AutosuggestInput;
180
180
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/autosuggest-input/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAO,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,IAAI,MAAM,MAAM,CAAC;AAUxB,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAsB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAmC,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,EAAiB,mBAAmB,EAAE,sBAAsB,EAA6B,MAAM,cAAc,CAAC;AAErH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,QAAQ,MAAM,aAAa,CAAC;AAGnC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAqCrC,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CACvC,CACE,EACE,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,YAAY,EACZ,yBAAyB,GAAG,KAAK,EACjC,gBAAgB,EACh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Content":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { AutosuggestProps } from '../../../autosuggest/interfaces';\nimport {\n BaseChangeDetail,\n BaseInputProps,\n InputAutoCorrect,\n InputClearLabel,\n InputKeyEvents,\n} from '../../../input/interfaces';\nimport InternalInput from '../../../input/internal';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport { FormFieldValidationControlProps, useFormFieldContext } from '../../context/form-field-context';\nimport { BaseKeyDetail, fireCancelableEvent, fireNonCancelableEvent, NonCancelableEventHandler } from '../../events';\nimport { InternalBaseComponentProps } from '../../hooks/use-base-component';\nimport { KeyCode } from '../../keycode';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { processAttributes } from '../../utils/with-native-attributes';\nimport Dropdown from '../dropdown';\nimport { ExpandToViewport } from '../dropdown/interfaces';\n\nimport styles from './styles.css.js';\n\ninterface AutosuggestInputProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n ExpandToViewport,\n InternalBaseComponentProps {\n ariaControls?: string;\n ariaActivedescendant?: string;\n dropdownExpanded?: boolean;\n dropdownContentKey?: string;\n dropdownContentFocusable?: boolean;\n dropdownContent?: React.ReactNode;\n dropdownFooter?: React.ReactNode;\n dropdownWidth?: number;\n loopFocus?: boolean;\n onCloseDropdown?: NonCancelableEventHandler<null>;\n onDelayedInput?: NonCancelableEventHandler<BaseChangeDetail>;\n onPressArrowDown?: () => void;\n onPressArrowUp?: () => void;\n onPressEnter?: () => boolean;\n}\n\ninterface AutosuggestInputFocusOptions {\n preventDropdown?: boolean;\n}\n\nexport interface AutosuggestInputRef extends AutosuggestProps.Ref {\n focus(options?: AutosuggestInputFocusOptions): void;\n open(): void;\n close(): void;\n}\n\nconst AutosuggestInput = React.forwardRef(\n (\n {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onKeyDown,\n name,\n placeholder,\n disabled,\n readOnly,\n autoFocus,\n ariaLabel,\n ariaRequired,\n disableBrowserAutocorrect = false,\n expandToViewport,\n ariaControls,\n ariaActivedescendant,\n clearAriaLabel,\n dropdownExpanded = true,\n dropdownContentKey,\n dropdownContentFocusable = false,\n dropdownContent = null,\n dropdownFooter = null,\n dropdownWidth,\n loopFocus,\n nativeInputAttributes,\n onCloseDropdown,\n onDelayedInput,\n onPressArrowDown,\n onPressArrowUp,\n onPressEnter,\n __internalRootRef,\n ...restProps\n }: AutosuggestInputProps,\n ref: Ref<AutosuggestInputRef>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n\n const inputRef = useRef<HTMLInputElement>(null);\n const dropdownContentRef = useRef<HTMLDivElement>(null);\n const dropdownFooterRef = useRef<HTMLDivElement>(null);\n const preventOpenOnFocusRef = useRef(false);\n const preventCloseOnBlurRef = useRef(false);\n\n const [open, setOpen] = useState(false);\n\n const openDropdown = () => !readOnly && setOpen(true);\n\n const closeDropdown = () => {\n setOpen(false);\n fireNonCancelableEvent(onCloseDropdown, null);\n };\n\n useImperativeHandle(ref, () => ({\n focus(options?: AutosuggestInputFocusOptions) {\n if (options?.preventDropdown) {\n preventOpenOnFocusRef.current = true;\n }\n inputRef.current?.focus();\n },\n select() {\n inputRef.current?.select();\n },\n open: openDropdown,\n close: closeDropdown,\n }));\n\n const handleBlur = () => {\n if (!preventCloseOnBlurRef.current) {\n closeDropdown();\n fireNonCancelableEvent(onBlur, null);\n }\n };\n\n const handleFocus = () => {\n if (!preventOpenOnFocusRef.current) {\n openDropdown();\n fireNonCancelableEvent(onFocus, null);\n }\n preventOpenOnFocusRef.current = false;\n };\n\n const fireKeydown = (event: CustomEvent<BaseKeyDetail>) => fireCancelableEvent(onKeyDown, event.detail, event);\n\n // Shared ESC key handler logic for both input and dropdown elements\n // When returnFocus is true (from dropdown elements), focus returns to input after closing\n const handleEscapeKey = (returnFocus: boolean) => {\n if (open) {\n closeDropdown();\n if (returnFocus) {\n // Return focus to input when closing from dropdown elements (e.g., recovery button)\n inputRef.current?.focus();\n }\n } else if (value) {\n fireNonCancelableEvent(onChange, { value: '' });\n }\n };\n\n const handleKeyDown = (event: CustomEvent<BaseKeyDetail>) => {\n switch (event.detail.keyCode) {\n case KeyCode.down: {\n onPressArrowDown?.();\n openDropdown();\n event.preventDefault();\n break;\n }\n case KeyCode.up: {\n onPressArrowUp?.();\n openDropdown();\n event.preventDefault();\n break;\n }\n case KeyCode.enter: {\n if (open) {\n if (!onPressEnter?.()) {\n closeDropdown();\n }\n event.preventDefault();\n }\n fireKeydown(event);\n break;\n }\n case KeyCode.escape: {\n // Use shared ESC handler, without focus restoration since ESC came from input\n handleEscapeKey(false);\n if (open || value) {\n event.stopPropagation();\n }\n event.preventDefault();\n fireKeydown(event);\n break;\n }\n default: {\n fireKeydown(event);\n }\n }\n };\n\n const handleChange = (value: string) => {\n openDropdown();\n fireNonCancelableEvent(onChange, { value });\n };\n\n const handleDelayedInput = (value: string) => {\n fireNonCancelableEvent(onDelayedInput, { value });\n };\n\n const handleDropdownMouseDown: React.MouseEventHandler = event => {\n // Prevent currently focused element from losing focus.\n if (!dropdownContentFocusable) {\n event.preventDefault();\n }\n // Prevent closing dropdown on click inside.\n else {\n preventCloseOnBlurRef.current = true;\n requestAnimationFrame(() => {\n preventCloseOnBlurRef.current = false;\n });\n }\n };\n\n const expanded = open && dropdownExpanded;\n const nativeAttributes: BaseInputProps['nativeInputAttributes'] = {\n name,\n placeholder,\n autoFocus,\n onClick: openDropdown,\n role: 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-expanded': expanded,\n 'aria-controls': open ? ariaControls : undefined,\n // 'aria-owns' needed for safari+vo to announce activedescendant content\n 'aria-owns': open ? ariaControls : undefined,\n 'aria-label': ariaLabel,\n 'aria-activedescendant': ariaActivedescendant,\n };\n\n // Closes dropdown when outside click is detected.\n // Similar to the internal dropdown implementation but includes the target as well.\n useEffect(() => {\n if (!open) {\n return;\n }\n\n const clickListener = (event: MouseEvent) => {\n if (\n !nodeBelongs(inputRef.current, event.target) &&\n !nodeBelongs(dropdownContentRef.current, event.target) &&\n !nodeBelongs(dropdownFooterRef.current, event.target)\n ) {\n closeDropdown();\n }\n };\n\n window.addEventListener('mousedown', clickListener);\n\n return () => {\n window.removeEventListener('mousedown', clickListener);\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n const handleDropdownKeyDown: React.KeyboardEventHandler = event => {\n // Handle ESC key from focusable elements inside the dropdown (e.g., recovery button)\n // but NOT from the input itself (that's handled by handleKeyDown)\n const isFromInput = event.target === inputRef.current || nodeBelongs(inputRef.current, event.target);\n\n if (event.key === 'Escape' && !isFromInput) {\n event.stopPropagation();\n event.preventDefault();\n // Use shared ESC handler with focus restoration since ESC came from dropdown element\n handleEscapeKey(true);\n }\n };\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n <Dropdown\n minWidth={dropdownWidth}\n stretchWidth={!dropdownWidth}\n stretchBeyondTriggerWidth={true}\n contentKey={dropdownContentKey}\n onFocus={handleFocus}\n onBlur={handleBlur}\n trigger={\n <InternalInput\n type=\"visualSearch\"\n value={value}\n onChange={event => handleChange(event.detail.value)}\n __onDelayedInput={event => handleDelayedInput(event.detail.value)}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n disabled={disabled}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n readOnly={readOnly}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n ref={inputRef}\n autoComplete={false}\n nativeInputAttributes={processAttributes(nativeAttributes, nativeInputAttributes, 'Autosuggest')}\n __skipNativeAttributesWarnings={Object.keys(nativeAttributes)}\n {...formFieldContext}\n />\n }\n onMouseDown={handleDropdownMouseDown}\n open={open && (!!dropdownContent || !!dropdownFooter)}\n footer={\n dropdownFooterRef && (\n <div ref={dropdownFooterRef} className={styles['dropdown-footer']} onKeyDown={handleDropdownKeyDown}>\n {open && dropdownFooter ? dropdownFooter : null}\n </div>\n )\n }\n expandToViewport={expandToViewport}\n loopFocus={loopFocus}\n >\n {open && dropdownContent ? (\n <div ref={dropdownContentRef} className={styles['dropdown-content']}>\n {dropdownContent}\n </div>\n ) : null}\n </Dropdown>\n </div>\n );\n }\n);\n\nexport default AutosuggestInput;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/autosuggest-input/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAO,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,IAAI,MAAM,MAAM,CAAC;AAWxB,OAAO,aAAa,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAsB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAmC,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,EAAiB,mBAAmB,EAAE,sBAAsB,EAA6B,MAAM,cAAc,CAAC;AAErH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,QAAQ,MAAM,aAAa,CAAC;AAGnC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAsCrC,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CACvC,CACE,EACE,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,SAAS,EACT,YAAY,EACZ,yBAAyB,GAAG,KAAK,EACjC,gBAAgB,EAChB,YAAY,E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eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { AutosuggestProps } from '../../../autosuggest/interfaces';\nimport {\n BaseChangeDetail,\n BaseInputProps,\n InputAutoCorrect,\n InputClearLabel,\n InputKeyEvents,\n InputProps,\n} from '../../../input/interfaces';\nimport InternalInput from '../../../input/internal';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport { FormFieldValidationControlProps, useFormFieldContext } from '../../context/form-field-context';\nimport { BaseKeyDetail, fireCancelableEvent, fireNonCancelableEvent, NonCancelableEventHandler } from '../../events';\nimport { InternalBaseComponentProps } from '../../hooks/use-base-component';\nimport { KeyCode } from '../../keycode';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport { processAttributes } from '../../utils/with-native-attributes';\nimport Dropdown from '../dropdown';\nimport { ExpandToViewport } from '../dropdown/interfaces';\n\nimport styles from './styles.css.js';\n\ninterface AutosuggestInputProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n ExpandToViewport,\n InternalBaseComponentProps {\n ariaControls?: string;\n ariaActivedescendant?: string;\n dropdownExpanded?: boolean;\n dropdownContentKey?: string;\n dropdownContentFocusable?: boolean;\n dropdownContent?: React.ReactNode;\n dropdownFooter?: React.ReactNode;\n dropdownWidth?: number;\n loopFocus?: boolean;\n onCloseDropdown?: NonCancelableEventHandler<null>;\n onDelayedInput?: NonCancelableEventHandler<BaseChangeDetail>;\n onPressArrowDown?: () => void;\n onPressArrowUp?: () => void;\n onPressEnter?: () => boolean;\n style?: InputProps['style'];\n}\n\ninterface AutosuggestInputFocusOptions {\n preventDropdown?: boolean;\n}\n\nexport interface AutosuggestInputRef extends AutosuggestProps.Ref {\n focus(options?: AutosuggestInputFocusOptions): void;\n open(): void;\n close(): void;\n}\n\nconst AutosuggestInput = React.forwardRef(\n (\n {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onKeyDown,\n name,\n placeholder,\n disabled,\n readOnly,\n autoFocus,\n ariaLabel,\n ariaRequired,\n disableBrowserAutocorrect = false,\n expandToViewport,\n ariaControls,\n ariaActivedescendant,\n clearAriaLabel,\n dropdownExpanded = true,\n dropdownContentKey,\n dropdownContentFocusable = false,\n dropdownContent = null,\n dropdownFooter = null,\n dropdownWidth,\n loopFocus,\n nativeInputAttributes,\n onCloseDropdown,\n onDelayedInput,\n onPressArrowDown,\n onPressArrowUp,\n onPressEnter,\n style,\n __internalRootRef,\n ...restProps\n }: AutosuggestInputProps,\n ref: Ref<AutosuggestInputRef>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n\n const inputRef = useRef<HTMLInputElement>(null);\n const dropdownContentRef = useRef<HTMLDivElement>(null);\n const dropdownFooterRef = useRef<HTMLDivElement>(null);\n const preventOpenOnFocusRef = useRef(false);\n const preventCloseOnBlurRef = useRef(false);\n\n const [open, setOpen] = useState(false);\n\n const openDropdown = () => !readOnly && setOpen(true);\n\n const closeDropdown = () => {\n setOpen(false);\n fireNonCancelableEvent(onCloseDropdown, null);\n };\n\n useImperativeHandle(ref, () => ({\n focus(options?: AutosuggestInputFocusOptions) {\n if (options?.preventDropdown) {\n preventOpenOnFocusRef.current = true;\n }\n inputRef.current?.focus();\n },\n select() {\n inputRef.current?.select();\n },\n open: openDropdown,\n close: closeDropdown,\n }));\n\n const handleBlur = () => {\n if (!preventCloseOnBlurRef.current) {\n closeDropdown();\n fireNonCancelableEvent(onBlur, null);\n }\n };\n\n const handleFocus = () => {\n if (!preventOpenOnFocusRef.current) {\n openDropdown();\n fireNonCancelableEvent(onFocus, null);\n }\n preventOpenOnFocusRef.current = false;\n };\n\n const fireKeydown = (event: CustomEvent<BaseKeyDetail>) => fireCancelableEvent(onKeyDown, event.detail, event);\n\n // Shared ESC key handler logic for both input and dropdown elements\n // When returnFocus is true (from dropdown elements), focus returns to input after closing\n const handleEscapeKey = (returnFocus: boolean) => {\n if (open) {\n closeDropdown();\n if (returnFocus) {\n // Return focus to input when closing from dropdown elements (e.g., recovery button)\n inputRef.current?.focus();\n }\n } else if (value) {\n fireNonCancelableEvent(onChange, { value: '' });\n }\n };\n\n const handleKeyDown = (event: CustomEvent<BaseKeyDetail>) => {\n switch (event.detail.keyCode) {\n case KeyCode.down: {\n onPressArrowDown?.();\n openDropdown();\n event.preventDefault();\n break;\n }\n case KeyCode.up: {\n onPressArrowUp?.();\n openDropdown();\n event.preventDefault();\n break;\n }\n case KeyCode.enter: {\n if (open) {\n if (!onPressEnter?.()) {\n closeDropdown();\n }\n event.preventDefault();\n }\n fireKeydown(event);\n break;\n }\n case KeyCode.escape: {\n // Use shared ESC handler, without focus restoration since ESC came from input\n handleEscapeKey(false);\n if (open || value) {\n event.stopPropagation();\n }\n event.preventDefault();\n fireKeydown(event);\n break;\n }\n default: {\n fireKeydown(event);\n }\n }\n };\n\n const handleChange = (value: string) => {\n openDropdown();\n fireNonCancelableEvent(onChange, { value });\n };\n\n const handleDelayedInput = (value: string) => {\n fireNonCancelableEvent(onDelayedInput, { value });\n };\n\n const handleDropdownMouseDown: React.MouseEventHandler = event => {\n // Prevent currently focused element from losing focus.\n if (!dropdownContentFocusable) {\n event.preventDefault();\n }\n // Prevent closing dropdown on click inside.\n else {\n preventCloseOnBlurRef.current = true;\n requestAnimationFrame(() => {\n preventCloseOnBlurRef.current = false;\n });\n }\n };\n\n const expanded = open && dropdownExpanded;\n const nativeAttributes: BaseInputProps['nativeInputAttributes'] = {\n name,\n placeholder,\n autoFocus,\n onClick: openDropdown,\n role: 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-expanded': expanded,\n 'aria-controls': open ? ariaControls : undefined,\n // 'aria-owns' needed for safari+vo to announce activedescendant content\n 'aria-owns': open ? ariaControls : undefined,\n 'aria-label': ariaLabel,\n 'aria-activedescendant': ariaActivedescendant,\n };\n\n // Closes dropdown when outside click is detected.\n // Similar to the internal dropdown implementation but includes the target as well.\n useEffect(() => {\n if (!open) {\n return;\n }\n\n const clickListener = (event: MouseEvent) => {\n if (\n !nodeBelongs(inputRef.current, event.target) &&\n !nodeBelongs(dropdownContentRef.current, event.target) &&\n !nodeBelongs(dropdownFooterRef.current, event.target)\n ) {\n closeDropdown();\n }\n };\n\n window.addEventListener('mousedown', clickListener);\n\n return () => {\n window.removeEventListener('mousedown', clickListener);\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n const handleDropdownKeyDown: React.KeyboardEventHandler = event => {\n // Handle ESC key from focusable elements inside the dropdown (e.g., recovery button)\n // but NOT from the input itself (that's handled by handleKeyDown)\n const isFromInput = event.target === inputRef.current || nodeBelongs(inputRef.current, event.target);\n\n if (event.key === 'Escape' && !isFromInput) {\n event.stopPropagation();\n event.preventDefault();\n // Use shared ESC handler with focus restoration since ESC came from dropdown element\n handleEscapeKey(true);\n }\n };\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n <Dropdown\n minWidth={dropdownWidth}\n stretchWidth={!dropdownWidth}\n stretchBeyondTriggerWidth={true}\n contentKey={dropdownContentKey}\n onFocus={handleFocus}\n onBlur={handleBlur}\n trigger={\n <InternalInput\n type=\"visualSearch\"\n value={value}\n onChange={event => handleChange(event.detail.value)}\n __onDelayedInput={event => handleDelayedInput(event.detail.value)}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n disabled={disabled}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n readOnly={readOnly}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n ref={inputRef}\n autoComplete={false}\n nativeInputAttributes={processAttributes(nativeAttributes, nativeInputAttributes, 'Autosuggest')}\n __skipNativeAttributesWarnings={Object.keys(nativeAttributes)}\n style={style}\n {...formFieldContext}\n />\n }\n onMouseDown={handleDropdownMouseDown}\n open={open && (!!dropdownContent || !!dropdownFooter)}\n footer={\n dropdownFooterRef && (\n <div ref={dropdownFooterRef} className={styles['dropdown-footer']} onKeyDown={handleDropdownKeyDown}>\n {open && dropdownFooter ? dropdownFooter : null}\n </div>\n )\n }\n expandToViewport={expandToViewport}\n loopFocus={loopFocus}\n >\n {open && dropdownContent ? (\n <div ref={dropdownContentRef} className={styles['dropdown-content']}>\n {dropdownContent}\n </div>\n ) : null}\n </Dropdown>\n </div>\n );\n }\n);\n\nexport default AutosuggestInput;\n"]}
@@ -1,6 +1,6 @@
1
1
  export var PACKAGE_SOURCE = "components";
2
- export var PACKAGE_VERSION = "3.0.0 (33e03331)";
3
- export var GIT_SHA = "33e03331";
2
+ export var PACKAGE_VERSION = "3.0.0 (0c4c33e5)";
3
+ export var GIT_SHA = "0c4c33e5";
4
4
  export var THEME = "open-source-visual-refresh";
5
5
  export var SYSTEM = "console";
6
6
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "PACKAGE_SOURCE": "components",
3
- "PACKAGE_VERSION": "3.0.0 (33e03331)",
4
- "GIT_SHA": "33e03331",
3
+ "PACKAGE_VERSION": "3.0.0 (0c4c33e5)",
4
+ "GIT_SHA": "0c4c33e5",
5
5
  "THEME": "open-source-visual-refresh",
6
6
  "SYSTEM": "console",
7
7
  "ALWAYS_VISUAL_REFRESH": true
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "33e03331698642b261e043d223871f39ea3d4df7"
2
+ "commit": "0c4c33e5794f0ec84f8dfab241330d1577e3e5eb"
3
3
  }
package/package.json CHANGED
@@ -154,7 +154,7 @@
154
154
  "./internal/base-component/index.js",
155
155
  "./internal/base-component/styles.css.js"
156
156
  ],
157
- "version": "3.0.1141",
157
+ "version": "3.0.1143",
158
158
  "repository": {
159
159
  "type": "git",
160
160
  "url": "https://github.com/cloudscape-design/components.git"
@@ -1,4 +1,41 @@
1
+ import customCssProps from '../internal/generated/custom-css-properties';
1
2
  import { PromptInputProps } from './interfaces';
2
3
  export declare function getPromptInputStyles(style: PromptInputProps['style']): {
3
- [k: string]: string | undefined;
4
+ borderRadius?: undefined;
5
+ borderWidth?: undefined;
6
+ fontSize?: undefined;
7
+ fontWeight?: undefined;
8
+ paddingBlock?: undefined;
9
+ paddingInline?: undefined;
10
+ } | {
11
+ [customCssProps.promptInputStyleBackgroundDefault]: string | undefined;
12
+ [customCssProps.promptInputStyleBackgroundDisabled]: string | undefined;
13
+ [customCssProps.promptInputStyleBackgroundHover]: string | undefined;
14
+ [customCssProps.promptInputStyleBackgroundFocus]: string | undefined;
15
+ [customCssProps.promptInputStyleBackgroundReadonly]: string | undefined;
16
+ [customCssProps.promptInputStyleBorderColorDefault]: string | undefined;
17
+ [customCssProps.promptInputStyleBorderColorDisabled]: string | undefined;
18
+ [customCssProps.promptInputStyleBorderColorHover]: string | undefined;
19
+ [customCssProps.promptInputStyleBorderColorFocus]: string | undefined;
20
+ [customCssProps.promptInputStyleBorderColorReadonly]: string | undefined;
21
+ [customCssProps.promptInputStyleBoxShadowDefault]: string | undefined;
22
+ [customCssProps.promptInputStyleBoxShadowDisabled]: string | undefined;
23
+ [customCssProps.promptInputStyleBoxShadowHover]: string | undefined;
24
+ [customCssProps.promptInputStyleBoxShadowFocus]: string | undefined;
25
+ [customCssProps.promptInputStyleBoxShadowReadonly]: string | undefined;
26
+ [customCssProps.promptInputStyleColorDefault]: string | undefined;
27
+ [customCssProps.promptInputStyleColorDisabled]: string | undefined;
28
+ [customCssProps.promptInputStyleColorHover]: string | undefined;
29
+ [customCssProps.promptInputStyleColorFocus]: string | undefined;
30
+ [customCssProps.promptInputStyleColorReadonly]: string | undefined;
31
+ [customCssProps.promptInputStylePlaceholderColor]: string | undefined;
32
+ [customCssProps.promptInputStylePlaceholderFontSize]: string | undefined;
33
+ [customCssProps.promptInputStylePlaceholderFontWeight]: string | undefined;
34
+ [customCssProps.promptInputStylePlaceholderFontStyle]: string | undefined;
35
+ borderRadius: string | undefined;
36
+ borderWidth: string | undefined;
37
+ fontSize: string | undefined;
38
+ fontWeight: string | undefined;
39
+ paddingBlock: string | undefined;
40
+ paddingInline: string | undefined;
4
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/prompt-input/styles.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC;;EAuCpE"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/prompt-input/styles.tsx"],"names":[],"mappings":"AAGA,OAAO,cAAc,MAAM,6CAA6C,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC;;;;;;;;IAYjE,CAAC,cAAc,CAAC,iCAAiC,CAAC,qBAAuC;IACzF,CAAC,cAAc,CAAC,kCAAkC,CAAC,qBAAwC;IAC3F,CAAC,cAAc,CAAC,+BAA+B,CAAC,qBAAqC;IACrF,CAAC,cAAc,CAAC,+BAA+B,CAAC,qBAAqC;IACrF,CAAC,cAAc,CAAC,kCAAkC,CAAC,qBAAwC;IAC3F,CAAC,cAAc,CAAC,kCAAkC,CAAC,qBAAmC;IACtF,CAAC,cAAc,CAAC,mCAAmC,CAAC,qBAAoC;IACxF,CAAC,cAAc,CAAC,gCAAgC,CAAC,qBAAiC;IAClF,CAAC,cAAc,CAAC,gCAAgC,CAAC,qBAAiC;IAClF,CAAC,cAAc,CAAC,mCAAmC,CAAC,qBAAoC;IACxF,CAAC,cAAc,CAAC,gCAAgC,CAAC,qBAAiC;IAClF,CAAC,cAAc,CAAC,iCAAiC,CAAC,qBAAkC;IACpF,CAAC,cAAc,CAAC,8BAA8B,CAAC,qBAA+B;IAC9E,CAAC,cAAc,CAAC,8BAA8B,CAAC,qBAA+B;IAC9E,CAAC,cAAc,CAAC,iCAAiC,CAAC,qBAAkC;IACpF,CAAC,cAAc,CAAC,4BAA4B,CAAC,qBAA6B;IAC1E,CAAC,cAAc,CAAC,6BAA6B,CAAC,qBAA8B;IAC5E,CAAC,cAAc,CAAC,0BAA0B,CAAC,qBAA2B;IACtE,CAAC,cAAc,CAAC,0BAA0B,CAAC,qBAA2B;IACtE,CAAC,cAAc,CAAC,6BAA6B,CAAC,qBAA8B;IAC5E,CAAC,cAAc,CAAC,gCAAgC,CAAC,qBAA2B;IAC5E,CAAC,cAAc,CAAC,mCAAmC,CAAC,qBAA8B;IAClF,CAAC,cAAc,CAAC,qCAAqC,CAAC,qBAAgC;IACtF,CAAC,cAAc,CAAC,oCAAoC,CAAC,qBAA+B;;;;;;;EAEvF"}
@@ -7,7 +7,7 @@ export function getPromptInputStyles(style) {
7
7
  if (SYSTEM !== 'core') {
8
8
  return {};
9
9
  }
10
- const properties = {
10
+ return {
11
11
  borderRadius: (_a = style === null || style === void 0 ? void 0 : style.root) === null || _a === void 0 ? void 0 : _a.borderRadius,
12
12
  borderWidth: (_b = style === null || style === void 0 ? void 0 : style.root) === null || _b === void 0 ? void 0 : _b.borderWidth,
13
13
  fontSize: (_c = style === null || style === void 0 ? void 0 : style.root) === null || _c === void 0 ? void 0 : _c.fontSize,
@@ -39,6 +39,5 @@ export function getPromptInputStyles(style) {
39
39
  [customCssProps.promptInputStylePlaceholderFontWeight]: (_24 = style === null || style === void 0 ? void 0 : style.placeholder) === null || _24 === void 0 ? void 0 : _24.fontWeight,
40
40
  [customCssProps.promptInputStylePlaceholderFontStyle]: (_25 = style === null || style === void 0 ? void 0 : style.placeholder) === null || _25 === void 0 ? void 0 : _25.fontStyle,
41
41
  };
42
- return Object.fromEntries(Object.entries(properties).filter(([, value]) => value !== undefined));
43
42
  }
44
43
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceR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CAAC,EAAE,OAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,4CAAE,SAAS;KACrF,CAAC;IAEF,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;AACnG,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { SYSTEM } from '../internal/environment';\nimport customCssProps from '../internal/generated/custom-css-properties';\nimport { PromptInputProps } from './interfaces';\n\nexport function getPromptInputStyles(style: PromptInputProps['style']) {\n if (SYSTEM !== 'core') {\n return {};\n }\n\n const properties = {\n borderRadius: style?.root?.borderRadius,\n borderWidth: style?.root?.borderWidth,\n fontSize: style?.root?.fontSize,\n fontWeight: style?.root?.fontWeight,\n paddingBlock: style?.root?.paddingBlock,\n paddingInline: style?.root?.paddingInline,\n [customCssProps.promptInputStyleBackgroundDefault]: style?.root?.backgroundColor?.default,\n [customCssProps.promptInputStyleBackgroundDisabled]: style?.root?.backgroundColor?.disabled,\n [customCssProps.promptInputStyleBackgroundHover]: style?.root?.backgroundColor?.hover,\n [customCssProps.promptInputStyleBackgroundFocus]: style?.root?.backgroundColor?.focus,\n [customCssProps.promptInputStyleBackgroundReadonly]: style?.root?.backgroundColor?.readonly,\n [customCssProps.promptInputStyleBorderColorDefault]: style?.root?.borderColor?.default,\n [customCssProps.promptInputStyleBorderColorDisabled]: style?.root?.borderColor?.disabled,\n [customCssProps.promptInputStyleBorderColorHover]: style?.root?.borderColor?.hover,\n [customCssProps.promptInputStyleBorderColorFocus]: style?.root?.borderColor?.focus,\n [customCssProps.promptInputStyleBorderColorReadonly]: style?.root?.borderColor?.readonly,\n [customCssProps.promptInputStyleBoxShadowDefault]: style?.root?.boxShadow?.default,\n [customCssProps.promptInputStyleBoxShadowDisabled]: style?.root?.boxShadow?.disabled,\n [customCssProps.promptInputStyleBoxShadowHover]: style?.root?.boxShadow?.hover,\n [customCssProps.promptInputStyleBoxShadowFocus]: style?.root?.boxShadow?.focus,\n [customCssProps.promptInputStyleBoxShadowReadonly]: style?.root?.boxShadow?.readonly,\n [customCssProps.promptInputStyleColorDefault]: style?.root?.color?.default,\n [customCssProps.promptInputStyleColorDisabled]: style?.root?.color?.disabled,\n [customCssProps.promptInputStyleColorHover]: style?.root?.color?.hover,\n [customCssProps.promptInputStyleColorFocus]: style?.root?.color?.focus,\n [customCssProps.promptInputStyleColorReadonly]: style?.root?.color?.readonly,\n [customCssProps.promptInputStylePlaceholderColor]: style?.placeholder?.color,\n [customCssProps.promptInputStylePlaceholderFontSize]: style?.placeholder?.fontSize,\n [customCssProps.promptInputStylePlaceholderFontWeight]: style?.placeholder?.fontWeight,\n [customCssProps.promptInputStylePlaceholderFontStyle]: style?.placeholder?.fontStyle,\n };\n\n return Object.fromEntries(Object.entries(properties).filter(([, value]) => value !== undefined));\n}\n"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/prompt-input/styles.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,cAAc,MAAM,6CAA6C,CAAC;AAGzE,MAAM,UAAU,oBAAoB,CAAC,KAAgC;;IACnE,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO;QACL,YAAY,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,0CAAE,YAAY;QACvC,WAAW,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,0CAAE,WAAW;QACrC,QAAQ,EAAE,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,0CAAE,QAAQ;QAC/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aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,4CAAE,KAAK,4CAAE,KAAK;QACtE,CAAC,cAAc,CAAC,0BAA0B,CAAC,EAAE,OAAA,OAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,4CAAE,KAAK,4CAAE,KAAK;QACtE,CAAC,cAAc,CAAC,6BAA6B,CAAC,EAAE,OAAA,OAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,4CAAE,KAAK,4CAAE,QAAQ;QAC5E,CAAC,cAAc,CAAC,gCAAgC,CAAC,EAAE,OAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,4CAAE,KAAK;QAC5E,CAAC,cAAc,CAAC,mCAAmC,CAAC,EAAE,OAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,4CAAE,QAAQ;QAClF,CAAC,cAAc,CAAC,qCAAqC,CAAC,EAAE,OAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,4CAAE,UAAU;QACtF,CAAC,cAAc,CAAC,oCAAoC,CAAC,EAAE,OAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,4CAAE,SAAS;KACrF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { SYSTEM } from '../internal/environment';\nimport customCssProps from '../internal/generated/custom-css-properties';\nimport { PromptInputProps } from './interfaces';\n\nexport function getPromptInputStyles(style: PromptInputProps['style']) {\n if (SYSTEM !== 'core') {\n return {};\n }\n\n return {\n borderRadius: style?.root?.borderRadius,\n borderWidth: style?.root?.borderWidth,\n fontSize: style?.root?.fontSize,\n fontWeight: style?.root?.fontWeight,\n paddingBlock: style?.root?.paddingBlock,\n paddingInline: style?.root?.paddingInline,\n [customCssProps.promptInputStyleBackgroundDefault]: style?.root?.backgroundColor?.default,\n [customCssProps.promptInputStyleBackgroundDisabled]: style?.root?.backgroundColor?.disabled,\n [customCssProps.promptInputStyleBackgroundHover]: style?.root?.backgroundColor?.hover,\n [customCssProps.promptInputStyleBackgroundFocus]: style?.root?.backgroundColor?.focus,\n [customCssProps.promptInputStyleBackgroundReadonly]: style?.root?.backgroundColor?.readonly,\n [customCssProps.promptInputStyleBorderColorDefault]: style?.root?.borderColor?.default,\n [customCssProps.promptInputStyleBorderColorDisabled]: style?.root?.borderColor?.disabled,\n [customCssProps.promptInputStyleBorderColorHover]: style?.root?.borderColor?.hover,\n [customCssProps.promptInputStyleBorderColorFocus]: style?.root?.borderColor?.focus,\n [customCssProps.promptInputStyleBorderColorReadonly]: style?.root?.borderColor?.readonly,\n [customCssProps.promptInputStyleBoxShadowDefault]: style?.root?.boxShadow?.default,\n [customCssProps.promptInputStyleBoxShadowDisabled]: style?.root?.boxShadow?.disabled,\n [customCssProps.promptInputStyleBoxShadowHover]: style?.root?.boxShadow?.hover,\n [customCssProps.promptInputStyleBoxShadowFocus]: style?.root?.boxShadow?.focus,\n [customCssProps.promptInputStyleBoxShadowReadonly]: style?.root?.boxShadow?.readonly,\n [customCssProps.promptInputStyleColorDefault]: style?.root?.color?.default,\n [customCssProps.promptInputStyleColorDisabled]: style?.root?.color?.disabled,\n [customCssProps.promptInputStyleColorHover]: style?.root?.color?.hover,\n [customCssProps.promptInputStyleColorFocus]: style?.root?.color?.focus,\n [customCssProps.promptInputStyleColorReadonly]: style?.root?.color?.readonly,\n [customCssProps.promptInputStylePlaceholderColor]: style?.placeholder?.color,\n [customCssProps.promptInputStylePlaceholderFontSize]: style?.placeholder?.fontSize,\n [customCssProps.promptInputStylePlaceholderFontWeight]: style?.placeholder?.fontWeight,\n [customCssProps.promptInputStylePlaceholderFontStyle]: style?.placeholder?.fontStyle,\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,QAAA,MAAM,kBAAkB,0HA+EvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,QAAA,MAAM,kBAAkB,0HAgFvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -17,7 +17,7 @@ const InternalRadioGroup = React.forwardRef(({ name, value, items, ariaLabel, ar
17
17
  const baseProps = getBaseProps(props);
18
18
  const generatedName = useUniqueId('awsui-radio-');
19
19
  const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);
20
- return (React.createElement("div", { role: "radiogroup", "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired, "aria-controls": ariaControls, "aria-readonly": readOnly ? 'true' : undefined, ...baseProps, className: clsx(baseProps.className, testUtilStyles.root, styles['radio-group'], direction === 'horizontal' && styles['horizontal-group']), ref: __internalRootRef }, items &&
20
+ return (React.createElement("div", { role: "radiogroup", "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired, "aria-controls": ariaControls, "aria-readonly": readOnly ? 'true' : undefined, ...baseProps, className: clsx(baseProps.className, testUtilStyles.root, styles.root, styles['radio-group'], direction === 'horizontal' && styles['horizontal-group']), ref: __internalRootRef }, items &&
21
21
  items.map((item, index) => (React.createElement(RadioButton, { key: item.value, ref: index === radioButtonRefIndex ? radioButtonRef : undefined, className: clsx(styles.radio, item.description && styles['radio--has-description'], direction === 'horizontal' && styles.horizontal, item.value === value && analyticsSelectors.selected), checked: item.value === value, name: name || generatedName, value: item.value, description: item.description, disabled: item.disabled, onSelect: () => fireNonCancelableEvent(onChange, { value: item.value }), controlId: item.controlId, readOnly: readOnly, style: style, ...getAnalyticsMetadataAttribute(!item.disabled && !readOnly
22
22
  ? {
23
23
  detail: {
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,yBAAyB,MAAM,6CAA6C,CAAC;AAKpF,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AACpE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAI1D,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CACzC,CACE,EACE,IAAI,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACgB,EAC1B,GAAmC,EACnC,EAAE;IACF,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,YAAY,CAAC,K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AsB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,EACvE,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,KACR,6BAA6B,CAC/B,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ;gBACzB,CAAC,CAAC;oBACE,MAAM,EAAE;wBACN,QAAQ,EAAE,GAAG,KAAK,GAAG,CAAC,EAAE;wBACxB,KAAK,EAAE,IAAI,CAAC,KAAK;qBAC+C;iBACnE;gBACH,CAAC,CAAC,EAAE,CACP,IAEA,IAAI,CAAC,KAAK,CACC,CACf,CAAC,CACA,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { getBaseProps } from '../internal/base-component';\nimport RadioButton from '../internal/components/radio-button';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { GeneratedAnalyticsMetadataRadioGroupSelect } from './analytics-metadata/interfaces';\nimport { RadioGroupProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalRadioGroupProps = RadioGroupProps & InternalBaseComponentProps;\n\nconst InternalRadioGroup = React.forwardRef(\n (\n {\n name,\n value,\n items,\n ariaLabel,\n ariaRequired,\n ariaControls,\n onChange,\n readOnly,\n __internalRootRef,\n style,\n direction,\n ...props\n }: InternalRadioGroupProps,\n ref: React.Ref<RadioGroupProps.Ref>\n ) => {\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);\n const baseProps = getBaseProps(props);\n const generatedName = useUniqueId('awsui-radio-');\n\n const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);\n\n return (\n <div\n role=\"radiogroup\"\n aria-labelledby={ariaLabelledby}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-required={ariaRequired}\n aria-controls={ariaControls}\n aria-readonly={readOnly ? 'true' : undefined}\n {...baseProps}\n className={clsx(\n baseProps.className,\n testUtilStyles.root,\n styles['radio-group'],\n direction === 'horizontal' && styles['horizontal-group']\n )}\n ref={__internalRootRef}\n >\n {items &&\n items.map((item, index) => (\n <RadioButton\n key={item.value}\n ref={index === radioButtonRefIndex ? radioButtonRef : undefined}\n className={clsx(\n styles.radio,\n item.description && styles['radio--has-description'],\n direction === 'horizontal' && styles.horizontal,\n item.value === value && analyticsSelectors.selected\n )}\n checked={item.value === value}\n name={name || generatedName}\n value={item.value}\n description={item.description}\n disabled={item.disabled}\n onSelect={() => fireNonCancelableEvent(onChange, { value: item.value })}\n controlId={item.controlId}\n readOnly={readOnly}\n style={style}\n {...getAnalyticsMetadataAttribute(\n !item.disabled && !readOnly\n ? {\n detail: {\n position: `${index + 1}`,\n value: item.value,\n } as Partial<GeneratedAnalyticsMetadataRadioGroupSelect['detail']>,\n }\n : {}\n )}\n >\n {item.label}\n </RadioButton>\n ))}\n </div>\n );\n }\n);\n\nexport default InternalRadioGroup;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OA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,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { getBaseProps } from '../internal/base-component';\nimport RadioButton from '../internal/components/radio-button';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { GeneratedAnalyticsMetadataRadioGroupSelect } from './analytics-metadata/interfaces';\nimport { RadioGroupProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalRadioGroupProps = RadioGroupProps & InternalBaseComponentProps;\n\nconst InternalRadioGroup = React.forwardRef(\n (\n {\n name,\n value,\n items,\n ariaLabel,\n ariaRequired,\n ariaControls,\n onChange,\n readOnly,\n __internalRootRef,\n style,\n direction,\n ...props\n }: InternalRadioGroupProps,\n ref: React.Ref<RadioGroupProps.Ref>\n ) => {\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);\n const baseProps = getBaseProps(props);\n const generatedName = useUniqueId('awsui-radio-');\n\n const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);\n\n return (\n <div\n role=\"radiogroup\"\n aria-labelledby={ariaLabelledby}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-required={ariaRequired}\n aria-controls={ariaControls}\n aria-readonly={readOnly ? 'true' : undefined}\n {...baseProps}\n className={clsx(\n baseProps.className,\n testUtilStyles.root,\n styles.root,\n styles['radio-group'],\n direction === 'horizontal' && styles['horizontal-group']\n )}\n ref={__internalRootRef}\n >\n {items &&\n items.map((item, index) => (\n <RadioButton\n key={item.value}\n ref={index === radioButtonRefIndex ? radioButtonRef : undefined}\n className={clsx(\n styles.radio,\n item.description && styles['radio--has-description'],\n direction === 'horizontal' && styles.horizontal,\n item.value === value && analyticsSelectors.selected\n )}\n checked={item.value === value}\n name={name || generatedName}\n value={item.value}\n description={item.description}\n disabled={item.disabled}\n onSelect={() => fireNonCancelableEvent(onChange, { value: item.value })}\n controlId={item.controlId}\n readOnly={readOnly}\n style={style}\n {...getAnalyticsMetadataAttribute(\n !item.disabled && !readOnly\n ? {\n detail: {\n position: `${index + 1}`,\n value: item.value,\n } as Partial<GeneratedAnalyticsMetadataRadioGroupSelect['detail']>,\n }\n : {}\n )}\n >\n {item.label}\n </RadioButton>\n ))}\n </div>\n );\n }\n);\n\nexport default InternalRadioGroup;\n"]}
@@ -1,10 +1,11 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "radio-group": "awsui_radio-group_1mabk_1rw55_145",
5
- "horizontal-group": "awsui_horizontal-group_1mabk_1rw55_176",
6
- "radio": "awsui_radio_1mabk_1rw55_145",
7
- "horizontal": "awsui_horizontal_1mabk_1rw55_176",
8
- "radio--has-description": "awsui_radio--has-description_1mabk_1rw55_190"
4
+ "root": "awsui_root_1mabk_9xklq_145",
5
+ "radio-group": "awsui_radio-group_1mabk_9xklq_149",
6
+ "horizontal-group": "awsui_horizontal-group_1mabk_9xklq_180",
7
+ "radio": "awsui_radio_1mabk_9xklq_149",
8
+ "horizontal": "awsui_horizontal_1mabk_9xklq_180",
9
+ "radio--has-description": "awsui_radio--has-description_1mabk_9xklq_194"
9
10
  };
10
11
 
@@ -142,7 +142,11 @@
142
142
  */
143
143
  /* Style used for links in slots/components that are text heavy, to help links stand out among
144
144
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
145
- .awsui_radio-group_1mabk_1rw55_145:not(#\9) {
145
+ .awsui_root_1mabk_9xklq_145:not(#\9) {
146
+ /* used for backwards-compatibility with older versions of test-utils */
147
+ }
148
+
149
+ .awsui_radio-group_1mabk_9xklq_149:not(#\9) {
146
150
  border-collapse: separate;
147
151
  border-spacing: 0;
148
152
  box-sizing: border-box;
@@ -173,24 +177,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
173
177
  -webkit-font-smoothing: auto;
174
178
  -moz-osx-font-smoothing: auto;
175
179
  }
176
- .awsui_radio-group_1mabk_1rw55_145:not(#\9):not(.awsui_horizontal-group_1mabk_1rw55_176) {
180
+ .awsui_radio-group_1mabk_9xklq_149:not(#\9):not(.awsui_horizontal-group_1mabk_9xklq_180) {
177
181
  display: block;
178
182
  }
179
- .awsui_radio-group_1mabk_1rw55_145.awsui_horizontal-group_1mabk_1rw55_176:not(#\9) {
183
+ .awsui_radio-group_1mabk_9xklq_149.awsui_horizontal-group_1mabk_9xklq_180:not(#\9) {
180
184
  display: flex;
181
185
  align-items: flex-start;
182
186
  flex-wrap: wrap;
183
187
  gap: var(--space-scaled-l-sej05l, 20px);
184
188
  }
185
189
 
186
- .awsui_radio_1mabk_1rw55_145 + .awsui_radio_1mabk_1rw55_145:not(#\9):not(.awsui_horizontal_1mabk_1rw55_176) {
190
+ .awsui_radio_1mabk_9xklq_149 + .awsui_radio_1mabk_9xklq_149:not(#\9):not(.awsui_horizontal_1mabk_9xklq_180) {
187
191
  margin-block-start: var(--space-scaled-xxs-pfm1nx, 4px);
188
192
  }
189
193
 
190
- .awsui_radio--has-description_1mabk_1rw55_190 + .awsui_radio_1mabk_1rw55_145:not(#\9):not(.awsui_horizontal_1mabk_1rw55_176) {
194
+ .awsui_radio--has-description_1mabk_9xklq_194 + .awsui_radio_1mabk_9xklq_149:not(#\9):not(.awsui_horizontal_1mabk_9xklq_180) {
191
195
  margin-block-start: var(--space-scaled-xs-xwoogq, 8px);
192
196
  }
193
197
 
194
- .awsui_radio_1mabk_1rw55_145.awsui_horizontal_1mabk_1rw55_176:not(#\9) {
198
+ .awsui_radio_1mabk_9xklq_149.awsui_horizontal_1mabk_9xklq_180:not(#\9) {
195
199
  max-inline-size: calc(16 * var(--space-scaled-xxl-6wgq96, 32px));
196
200
  }
@@ -2,10 +2,11 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "radio-group": "awsui_radio-group_1mabk_1rw55_145",
6
- "horizontal-group": "awsui_horizontal-group_1mabk_1rw55_176",
7
- "radio": "awsui_radio_1mabk_1rw55_145",
8
- "horizontal": "awsui_horizontal_1mabk_1rw55_176",
9
- "radio--has-description": "awsui_radio--has-description_1mabk_1rw55_190"
5
+ "root": "awsui_root_1mabk_9xklq_145",
6
+ "radio-group": "awsui_radio-group_1mabk_9xklq_149",
7
+ "horizontal-group": "awsui_horizontal-group_1mabk_9xklq_180",
8
+ "radio": "awsui_radio_1mabk_9xklq_149",
9
+ "horizontal": "awsui_horizontal_1mabk_9xklq_180",
10
+ "radio--has-description": "awsui_radio--has-description_1mabk_9xklq_194"
10
11
  };
11
12
 
@@ -2,6 +2,7 @@ import { ComponentWrapper, ElementWrapper } from '@cloudscape-design/test-utils-
2
2
  import RadioButtonWrapper from '../radio-button';
3
3
  export default class RadioGroupWrapper extends ComponentWrapper {
4
4
  static rootSelector: string;
5
+ static legacyRootSelector: string;
5
6
  findButtons(): Array<RadioButtonWrapper>;
6
7
  findInputByValue(value: string): ElementWrapper<HTMLInputElement> | null;
7
8
  }
@@ -6,16 +6,18 @@ const dom_1 = require("@cloudscape-design/test-utils-core/dom");
6
6
  const utils_1 = require("@cloudscape-design/test-utils-core/utils");
7
7
  const radio_button_1 = require("../radio-button");
8
8
  const styles_selectors_js_1 = require("../../../internal/components/radio-button/test-classes/styles.selectors.js");
9
- const styles_selectors_js_2 = require("../../../radio-group/test-classes/styles.selectors.js");
9
+ const styles_selectors_js_2 = require("../../../radio-group/styles.selectors.js");
10
+ const styles_selectors_js_3 = require("../../../radio-group/test-classes/styles.selectors.js");
10
11
  class RadioGroupWrapper extends dom_1.ComponentWrapper {
11
12
  findButtons() {
12
- return this.findAllByClassName(styles_selectors_js_1.default.root).map(r => new radio_button_1.default(r.getElement()));
13
+ return this.findAll(`:is(.${styles_selectors_js_1.default.root}, .${styles_selectors_js_2.default.radio})`).map(r => new radio_button_1.default(r.getElement()));
13
14
  }
14
15
  findInputByValue(value) {
15
16
  const safeValue = (0, utils_1.escapeSelector)(value);
16
17
  return this.find(`input[value="${safeValue}"]`);
17
18
  }
18
19
  }
19
- RadioGroupWrapper.rootSelector = styles_selectors_js_2.default.root;
20
+ RadioGroupWrapper.rootSelector = styles_selectors_js_3.default.root;
21
+ RadioGroupWrapper.legacyRootSelector = styles_selectors_js_2.default.root;
20
22
  exports.default = RadioGroupWrapper;
21
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/radio-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAC1F,oEAA0E;AAE1E,kDAAiD;AAEjD,oHAA2G;AAC3G,+FAA2E;AAE3E,MAAqB,iBAAkB,SAAQ,sBAAgB;IAG7D,WAAW;QACT,OAAO,IAAI,CAAC,kBAAkB,CAAC,6BAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,sBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC1G,CAAC;IAED,gBAAgB,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,IAAI,CAAC,CAAC;IAClD,CAAC;;AATM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,iBAAiB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/radio-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAC1F,oEAA0E;AAE1E,kDAAiD;AAEjD,oHAA2G;AAC3G,kFAAoE;AACpE,+FAA2E;AAE3E,MAAqB,iBAAkB,SAAQ,sBAAgB;IAI7D,WAAW;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,6BAAiB,CAAC,IAAI,MAAM,6BAAY,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAChF,CAAC,CAAC,EAAE,CAAC,IAAI,sBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAC5C,CAAC;IACJ,CAAC;IAED,gBAAgB,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,IAAI,CAAC,CAAC;IAClD,CAAC;;AAZM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;AACnC,oCAAkB,GAAW,6BAAY,CAAC,IAAI,CAAC;kBAFnC,iBAAiB"}
@@ -2,6 +2,7 @@ import { ComponentWrapper, ElementWrapper } from "@cloudscape-design/test-utils-
2
2
  import RadioButtonWrapper from '../radio-button';
3
3
  export default class RadioGroupWrapper extends ComponentWrapper {
4
4
  static rootSelector: string;
5
+ static legacyRootSelector: string;
5
6
  findButtons(): import("@cloudscape-design/test-utils-core/selectors").MultiElementWrapper<RadioButtonWrapper>;
6
7
  findInputByValue(value: string): ElementWrapper;
7
8
  }
@@ -6,16 +6,18 @@ const selectors_1 = require("@cloudscape-design/test-utils-core/selectors");
6
6
  const utils_1 = require("@cloudscape-design/test-utils-core/utils");
7
7
  const radio_button_1 = require("../radio-button");
8
8
  const styles_selectors_js_1 = require("../../../internal/components/radio-button/test-classes/styles.selectors.js");
9
- const styles_selectors_js_2 = require("../../../radio-group/test-classes/styles.selectors.js");
9
+ const styles_selectors_js_2 = require("../../../radio-group/styles.selectors.js");
10
+ const styles_selectors_js_3 = require("../../../radio-group/test-classes/styles.selectors.js");
10
11
  class RadioGroupWrapper extends selectors_1.ComponentWrapper {
11
12
  findButtons() {
12
- return this.findAllByClassName(styles_selectors_js_1.default.root).map(r => new radio_button_1.default(r.getElement()));
13
+ return this.findAll(`:is(.${styles_selectors_js_1.default.root}, .${styles_selectors_js_2.default.radio})`).map(r => new radio_button_1.default(r.getElement()));
13
14
  }
14
15
  findInputByValue(value) {
15
16
  const safeValue = (0, utils_1.escapeSelector)(value);
16
17
  return this.find(`input[value="${safeValue}"]`);
17
18
  }
18
19
  }
19
- RadioGroupWrapper.rootSelector = styles_selectors_js_2.default.root;
20
+ RadioGroupWrapper.rootSelector = styles_selectors_js_3.default.root;
21
+ RadioGroupWrapper.legacyRootSelector = styles_selectors_js_2.default.root;
20
22
  exports.default = RadioGroupWrapper;
21
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/radio-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,oEAA0E;AAC1E,kDAAiD;AACjD,oHAA2G;AAC3G,+FAA2E;AAC3E,MAAqB,iBAAkB,SAAQ,4BAAgB;IAE7D,WAAW;QACT,OAAO,IAAI,CAAC,kBAAkB,CAAC,6BAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,sBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC1G,CAAC;IACD,gBAAgB,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,IAAI,CAAC,CAAC;IAClD,CAAC;;AAPM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,iBAAiB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/radio-group/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,4EAAgG;AAChG,oEAA0E;AAC1E,kDAAiD;AACjD,oHAA2G;AAC3G,kFAAoE;AACpE,+FAA2E;AAC3E,MAAqB,iBAAkB,SAAQ,4BAAgB;IAG7D,WAAW;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,6BAAiB,CAAC,IAAI,MAAM,6BAAY,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,sBAAkB,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAClI,CAAC;IACD,gBAAgB,CAAC,KAAa;QAC5B,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,KAAK,CAAC,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,SAAS,IAAI,CAAC,CAAC;IAClD,CAAC;;AARM,8BAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;AACnC,oCAAkB,GAAW,6BAAY,CAAC,IAAI,CAAC;kBAFnC,iBAAiB"}
@@ -1,8 +1,8 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "vertical-connector": "awsui_vertical-connector_1r2pu_l2zeb_9",
5
- "grid": "awsui_grid_1r2pu_l2zeb_13",
6
- "absolute": "awsui_absolute_1r2pu_l2zeb_20"
4
+ "vertical-connector": "awsui_vertical-connector_1r2pu_qy3uq_9",
5
+ "grid": "awsui_grid_1r2pu_qy3uq_13",
6
+ "absolute": "awsui_absolute_1r2pu_qy3uq_20"
7
7
  };
8
8
 
@@ -6,20 +6,20 @@
6
6
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
7
7
  SPDX-License-Identifier: Apache-2.0
8
8
  */
9
- .awsui_vertical-connector_1r2pu_l2zeb_9:not(#\9) {
9
+ .awsui_vertical-connector_1r2pu_qy3uq_9:not(#\9) {
10
10
  background-color: var(--color-tree-view-connector-line-1usxvn, #8c8c94);
11
11
  inline-size: var(--border-divider-list-width-tdfx1x, 1px);
12
12
  }
13
- .awsui_vertical-connector_1r2pu_l2zeb_9.awsui_grid_1r2pu_l2zeb_13:not(#\9) {
13
+ .awsui_vertical-connector_1r2pu_qy3uq_9.awsui_grid_1r2pu_qy3uq_13:not(#\9) {
14
14
  grid-row: 2/span 3;
15
15
  grid-column: 1;
16
16
  block-size: 100%;
17
17
  position: relative;
18
- inset-inline-start: 14px;
18
+ inset-inline-start: calc((28px - var(--border-divider-list-width-tdfx1x, 1px)) / 2);
19
19
  }
20
- .awsui_vertical-connector_1r2pu_l2zeb_9.awsui_absolute_1r2pu_l2zeb_20:not(#\9) {
20
+ .awsui_vertical-connector_1r2pu_qy3uq_9.awsui_absolute_1r2pu_qy3uq_20:not(#\9) {
21
21
  position: absolute;
22
22
  inset: 0;
23
23
  inset-block-end: var(--space-scaled-xs-xwoogq, 8px);
24
- inset-inline-start: 14px;
24
+ inset-inline-start: calc((28px - var(--border-divider-list-width-tdfx1x, 1px)) / 2);
25
25
  }
@@ -2,8 +2,8 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "vertical-connector": "awsui_vertical-connector_1r2pu_l2zeb_9",
6
- "grid": "awsui_grid_1r2pu_l2zeb_13",
7
- "absolute": "awsui_absolute_1r2pu_l2zeb_20"
5
+ "vertical-connector": "awsui_vertical-connector_1r2pu_qy3uq_9",
6
+ "grid": "awsui_grid_1r2pu_qy3uq_13",
7
+ "absolute": "awsui_absolute_1r2pu_qy3uq_20"
8
8
  };
9
9