@cloudscape-design/components-themeable 3.0.1150 → 3.0.1152

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 (42) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/input/styles.scss +7 -3
  3. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  4. package/lib/internal/scss/internal/styles/forms/mixins.scss +12 -4
  5. package/lib/internal/scss/radio-group/styles.scss +4 -0
  6. package/lib/internal/scss/tree-view/vertical-connector/styles.scss +4 -3
  7. package/lib/internal/template/autosuggest/interfaces.d.ts +48 -0
  8. package/lib/internal/template/autosuggest/interfaces.d.ts.map +1 -1
  9. package/lib/internal/template/autosuggest/interfaces.js.map +1 -1
  10. package/lib/internal/template/autosuggest/internal.d.ts.map +1 -1
  11. package/lib/internal/template/autosuggest/internal.js +2 -2
  12. package/lib/internal/template/autosuggest/internal.js.map +1 -1
  13. package/lib/internal/template/input/styles.css.js +13 -13
  14. package/lib/internal/template/input/styles.scoped.css +34 -34
  15. package/lib/internal/template/input/styles.selectors.js +13 -13
  16. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  17. package/lib/internal/template/internal/components/autosuggest-input/index.d.ts +2 -1
  18. package/lib/internal/template/internal/components/autosuggest-input/index.d.ts.map +1 -1
  19. package/lib/internal/template/internal/components/autosuggest-input/index.js +2 -2
  20. package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
  21. package/lib/internal/template/internal/environment.js +2 -2
  22. package/lib/internal/template/internal/environment.json +2 -2
  23. package/lib/internal/template/prompt-input/styles.d.ts +38 -1
  24. package/lib/internal/template/prompt-input/styles.d.ts.map +1 -1
  25. package/lib/internal/template/prompt-input/styles.js +1 -2
  26. package/lib/internal/template/prompt-input/styles.js.map +1 -1
  27. package/lib/internal/template/radio-group/internal.d.ts.map +1 -1
  28. package/lib/internal/template/radio-group/internal.js +1 -1
  29. package/lib/internal/template/radio-group/internal.js.map +1 -1
  30. package/lib/internal/template/radio-group/styles.css.js +6 -5
  31. package/lib/internal/template/radio-group/styles.scoped.css +10 -6
  32. package/lib/internal/template/radio-group/styles.selectors.js +6 -5
  33. package/lib/internal/template/test-utils/dom/radio-group/index.d.ts +1 -0
  34. package/lib/internal/template/test-utils/dom/radio-group/index.js +5 -3
  35. package/lib/internal/template/test-utils/dom/radio-group/index.js.map +1 -1
  36. package/lib/internal/template/test-utils/selectors/radio-group/index.d.ts +1 -0
  37. package/lib/internal/template/test-utils/selectors/radio-group/index.js +5 -3
  38. package/lib/internal/template/test-utils/selectors/radio-group/index.js.map +1 -1
  39. package/lib/internal/template/tree-view/vertical-connector/styles.css.js +3 -3
  40. package/lib/internal/template/tree-view/vertical-connector/styles.scoped.css +5 -5
  41. package/lib/internal/template/tree-view/vertical-connector/styles.selectors.js +3 -3
  42. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "33e03331698642b261e043d223871f39ea3d4df7"
2
+ "commit": "0c4c33e5794f0ec84f8dfab241330d1577e3e5eb"
3
3
  }
@@ -116,7 +116,9 @@
116
116
  );
117
117
  box-shadow: var(#{custom-props.$styleBoxShadowDisabled});
118
118
  @include placeholder {
119
- @include styles.form-placeholder-disabled;
119
+ @include styles.form-placeholder-disabled(
120
+ $color: var(#{custom-props.$stylePlaceholderColor}, awsui.$color-text-input-placeholder-disabled)
121
+ );
120
122
  }
121
123
  }
122
124
 
@@ -128,7 +130,8 @@
128
130
  &.input-invalid {
129
131
  @include styles.form-invalid-control(
130
132
  $color: var(#{custom-props.$styleColorDefault}, awsui.$color-text-status-error),
131
- $border-color: var(#{custom-props.$styleBorderColorDefault}, awsui.$color-text-status-error)
133
+ $border-color: var(#{custom-props.$styleBorderColorDefault}, awsui.$color-text-status-error),
134
+ $focus-box-shadow: var(#{custom-props.$styleBoxShadowFocus}, foundation.$box-shadow-focused-light-invalid)
132
135
  );
133
136
  &.input-has-icon-left {
134
137
  padding-inline-start: calc(
@@ -141,7 +144,8 @@
141
144
  &.input-warning {
142
145
  @include styles.form-warning-control(
143
146
  $color: var(#{custom-props.$styleColorDefault}, awsui.$color-text-status-warning),
144
- $border-color: var(#{custom-props.$styleBorderColorDefault}, awsui.$color-text-status-warning)
147
+ $border-color: var(#{custom-props.$styleBorderColorDefault}, awsui.$color-text-status-warning),
148
+ $focus-box-shadow: var(#{custom-props.$styleBoxShadowFocus}, foundation.$box-shadow-focused-light-invalid)
145
149
  );
146
150
  &.input-has-icon-left {
147
151
  padding-inline-start: calc(
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Build environment
3
- $awsui-commit-hash: "33e03331";
3
+ $awsui-commit-hash: "0c4c33e5";
4
4
  // Manually managed CSS-variables
5
5
  $maxContentWidth: --awsui-max-content-width-d43v8n;
6
6
  $minContentWidth: --awsui-min-content-width-d43v8n;
@@ -193,24 +193,32 @@
193
193
  @include typography.font-body-s;
194
194
  }
195
195
 
196
- @mixin form-invalid-control($color: awsui.$color-text-status-error, $border-color: awsui.$color-text-status-error) {
196
+ @mixin form-invalid-control(
197
+ $color: awsui.$color-text-status-error,
198
+ $border-color: awsui.$color-text-status-error,
199
+ $focus-box-shadow: foundation.$box-shadow-focused-light-invalid
200
+ ) {
197
201
  color: $color;
198
202
  border-color: $border-color;
199
203
  padding-inline-start: constants.$invalid-control-left-padding;
200
204
  border-inline-start-width: constants.$invalid-control-left-border;
201
205
  &:focus {
202
- box-shadow: foundation.$box-shadow-focused-light-invalid;
206
+ box-shadow: $focus-box-shadow;
203
207
  }
204
208
  @content;
205
209
  }
206
210
 
207
- @mixin form-warning-control($color: awsui.$color-text-status-warning, $border-color: awsui.$color-text-status-warning) {
211
+ @mixin form-warning-control(
212
+ $color: awsui.$color-text-status-warning,
213
+ $border-color: awsui.$color-text-status-warning,
214
+ $focus-box-shadow: foundation.$box-shadow-focused-light-invalid
215
+ ) {
208
216
  color: $color;
209
217
  border-color: $border-color;
210
218
  padding-inline-start: constants.$invalid-control-left-padding;
211
219
  border-inline-start-width: constants.$invalid-control-left-border;
212
220
  &:focus {
213
- box-shadow: foundation.$box-shadow-focused-light-invalid;
221
+ box-shadow: $focus-box-shadow;
214
222
  }
215
223
  @content;
216
224
  }
@@ -6,6 +6,10 @@
6
6
  @use '../internal/styles' as styles;
7
7
  @use '../internal/styles/tokens' as awsui;
8
8
 
9
+ .root {
10
+ /* used for backwards-compatibility with older versions of test-utils */
11
+ }
12
+
9
13
  .radio-group {
10
14
  @include styles.styles-reset;
11
15
 
@@ -7,23 +7,24 @@
7
7
  @use '../../internal/styles/tokens' as awsui;
8
8
 
9
9
  $item-toggle-column-width: 28px;
10
+ $connector-line-width: awsui.$border-divider-list-width;
10
11
 
11
12
  .vertical-connector {
12
13
  background-color: awsui.$color-tree-view-connector-line;
13
- inline-size: awsui.$border-divider-list-width;
14
+ inline-size: $connector-line-width;
14
15
 
15
16
  &.grid {
16
17
  grid-row: 2 / span 3;
17
18
  grid-column: 1;
18
19
  block-size: 100%;
19
20
  position: relative;
20
- inset-inline-start: calc($item-toggle-column-width / 2);
21
+ inset-inline-start: calc(($item-toggle-column-width - $connector-line-width) / 2);
21
22
  }
22
23
 
23
24
  &.absolute {
24
25
  position: absolute;
25
26
  inset: 0;
26
27
  inset-block-end: awsui.$space-scaled-xs;
27
- inset-inline-start: calc($item-toggle-column-width / 2);
28
+ inset-inline-start: calc(($item-toggle-column-width - $connector-line-width) / 2);
28
29
  }
29
30
  }
@@ -103,6 +103,10 @@ 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
+ */
109
+ style?: AutosuggestProps.Style;
106
110
  }
107
111
  export declare namespace AutosuggestProps {
108
112
  type ChangeDetail = InputProps.ChangeDetail;
@@ -134,6 +138,50 @@ export declare namespace AutosuggestProps {
134
138
  */
135
139
  select(): void;
136
140
  }
141
+ interface Style {
142
+ root?: {
143
+ backgroundColor?: {
144
+ default?: string;
145
+ disabled?: string;
146
+ focus?: string;
147
+ hover?: string;
148
+ readonly?: string;
149
+ };
150
+ borderColor?: {
151
+ default?: string;
152
+ disabled?: string;
153
+ focus?: string;
154
+ hover?: string;
155
+ readonly?: string;
156
+ };
157
+ borderRadius?: string;
158
+ borderWidth?: string;
159
+ boxShadow?: {
160
+ default?: string;
161
+ disabled?: string;
162
+ focus?: string;
163
+ hover?: string;
164
+ readonly?: string;
165
+ };
166
+ color?: {
167
+ default?: string;
168
+ disabled?: string;
169
+ focus?: string;
170
+ hover?: string;
171
+ readonly?: string;
172
+ };
173
+ fontSize?: string;
174
+ fontWeight?: string;
175
+ paddingBlock?: string;
176
+ paddingInline?: string;
177
+ };
178
+ placeholder?: {
179
+ color?: string;
180
+ fontSize?: string;
181
+ fontStyle?: string;
182
+ fontWeight?: string;
183
+ };
184
+ }
137
185
  }
138
186
  export type AutosuggestItem = (AutosuggestProps.Option | AutosuggestProps.OptionGroup) & {
139
187
  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,wCA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gBAClB,KAAK,CAAC,EAAE,MAAM,CAAC;gBACf,KAAK,CAAC,EAAE,MAAM,CAAC;gBACf,QAAQ,CAAC,EAAE,MAAM,CAAC;aACnB,CAAC;YACF,KAAK,CAAC,EAAE;gBACN,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAClB,KAAK,CAAC,EAAE,MAAM,CAAC;gBACf,KAAK,CAAC,EAAE,MAAM,CAAC;gBACf,QAAQ,CAAC,EAAE,MAAM,CAAC;aACnB,CAAC;YACF,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,WAAW,CAAC,EAAE;YACZ,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,UAAU,CAAC,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,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,CAAC;AAEpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAA+B,EAAE,GAA8B,EAAE,EAAE;;IAC/G,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,WAAW,EACX,OAAO,EACP,aAAa,GAAG,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,EACpB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,2BAA2B,CAAC,oBAAoB,EAChE,iBAAiB,EAAE,cAAc,CAAC,OAAO,KAAK,IAAI,EAClD,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,iBAAiB,EACpC,yBAAyB,EAAE,yBAAyB,EACpD,UAAU,EACR,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,oBAAC,cAAc,IAAC,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE,eAAe,GAAI,CAAC,CAAC,CAAC,IAAI,EAE5G,eAAe,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,GACrE,CACH,EAEH,cAAc,EACZ,cAAc,CAAC,QAAQ,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAClD,oBAAC,cAAc,IACb,EAAE,EAAE,eAAe,EACnB,OAAO,EAAE,cAAc,CAAC,OAAO,EAC/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;A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,EAAE,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE,eAAe,GAAI,CAAC,CAAC,CAAC,IAAI,EAE5G,eAAe,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,GACrE,CACH,EAEH,cAAc,EACZ,cAAc,CAAC,QAAQ,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAClD,oBAAC,cAAc,IACb,EAAE,EAAE,eAAe,EACnB,OAAO,EAAE,cAAc,CAAC,OAAO,EAC/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 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_q1m0j_145",
5
- "input": "awsui_input_2rhyz_q1m0j_149",
6
- "input-readonly": "awsui_input-readonly_2rhyz_q1m0j_203",
7
- "input-invalid": "awsui_input-invalid_2rhyz_q1m0j_266",
8
- "input-has-icon-left": "awsui_input-has-icon-left_2rhyz_q1m0j_275",
9
- "input-warning": "awsui_input-warning_2rhyz_q1m0j_278",
10
- "input-type-search": "awsui_input-type-search_2rhyz_q1m0j_290",
11
- "input-has-icon-right": "awsui_input-has-icon-right_2rhyz_q1m0j_303",
12
- "input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_q1m0j_306",
13
- "input-container": "awsui_input-container_2rhyz_q1m0j_313",
14
- "input-icon-left": "awsui_input-icon-left_2rhyz_q1m0j_318",
15
- "input-icon-right": "awsui_input-icon-right_2rhyz_q1m0j_325",
16
- "input-button-right": "awsui_input-button-right_2rhyz_q1m0j_331"
4
+ "root": "awsui_root_2rhyz_1fmui_145",
5
+ "input": "awsui_input_2rhyz_1fmui_149",
6
+ "input-readonly": "awsui_input-readonly_2rhyz_1fmui_203",
7
+ "input-invalid": "awsui_input-invalid_2rhyz_1fmui_266",
8
+ "input-has-icon-left": "awsui_input-has-icon-left_2rhyz_1fmui_275",
9
+ "input-warning": "awsui_input-warning_2rhyz_1fmui_278",
10
+ "input-type-search": "awsui_input-type-search_2rhyz_1fmui_290",
11
+ "input-has-icon-right": "awsui_input-has-icon-right_2rhyz_1fmui_303",
12
+ "input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_1fmui_306",
13
+ "input-container": "awsui_input-container_2rhyz_1fmui_313",
14
+ "input-icon-left": "awsui_input-icon-left_2rhyz_1fmui_318",
15
+ "input-icon-right": "awsui_input-icon-right_2rhyz_1fmui_325",
16
+ "input-button-right": "awsui_input-button-right_2rhyz_1fmui_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_q1m0j_145:not(#\9) {
145
+ .awsui_root_2rhyz_1fmui_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_q1m0j_149:not(#\9) {
149
+ .awsui_input_2rhyz_1fmui_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-bedeoh, 22px);
195
195
  block-size: var(--size-vertical-input-8gzd1t, 32px);
196
196
  }
197
- .awsui_input_2rhyz_q1m0j_149:not(#\9):hover {
197
+ .awsui_input_2rhyz_1fmui_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-txli8y, #687078)));
199
199
  color: var(--awsui-style-color-hover-d43v8n, var(--awsui-style-border-color-default-d43v8n, var(--color-text-body-default-5qid0u, #16191f)));
200
200
  background-color: var(--awsui-style-background-hover-d43v8n, var(--awsui-style-background-default-d43v8n, var(--color-background-input-default-1z2buq, #ffffff)));
201
201
  box-shadow: var(--awsui-style-box-shadow-hover-d43v8n, --awsui-style-box-shadow-default-d43v8n);
202
202
  }
203
- .awsui_input_2rhyz_q1m0j_149.awsui_input-readonly_2rhyz_q1m0j_203:not(#\9) {
203
+ .awsui_input_2rhyz_1fmui_149.awsui_input-readonly_2rhyz_1fmui_203:not(#\9) {
204
204
  background-color: var(--awsui-style-background-readonly-d43v8n, var(--awsui-style-background-default-d43v8n, var(--color-background-input-default-1z2buq, #ffffff)));
205
205
  border-block: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-readonly-d43v8n, var(--awsui-style-border-color-default-d43v8n, var(--color-border-input-disabled-tz38ro, #eaeded)));
206
206
  border-inline: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-readonly-d43v8n, var(--awsui-style-border-color-default-d43v8n, var(--color-border-input-disabled-tz38ro, #eaeded)));
207
207
  color: var(--awsui-style-color-readonly-d43v8n, var(--awsui-style-color-default-d43v8n, var(--color-text-body-default-5qid0u, #16191f)));
208
208
  box-shadow: var(--awsui-style-box-shadow-readonly-d43v8n);
209
209
  }
210
- .awsui_input_2rhyz_q1m0j_149:not(#\9)::-webkit-input-placeholder {
210
+ .awsui_input_2rhyz_1fmui_149:not(#\9)::-webkit-input-placeholder {
211
211
  color: var(--awsui-style-placeholder-color-d43v8n, var(--color-text-input-placeholder-hvcry0, #687078));
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_q1m0j_149:not(#\9)::-moz-placeholder {
218
+ .awsui_input_2rhyz_1fmui_149:not(#\9)::-moz-placeholder {
219
219
  color: var(--awsui-style-placeholder-color-d43v8n, var(--color-text-input-placeholder-hvcry0, #687078));
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_q1m0j_149:not(#\9):-moz-placeholder {
225
+ .awsui_input_2rhyz_1fmui_149:not(#\9):-moz-placeholder {
226
226
  color: var(--awsui-style-placeholder-color-d43v8n, var(--color-text-input-placeholder-hvcry0, #687078));
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_q1m0j_149:not(#\9):focus {
232
+ .awsui_input_2rhyz_1fmui_149:not(#\9):focus {
233
233
  outline: 2px dotted transparent;
234
234
  border-block: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-focus-d43v8n, var(--color-border-input-focused-lslq4r, #0073bb));
235
235
  border-inline: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-focus-d43v8n, var(--color-border-input-focused-lslq4r, #0073bb));
@@ -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-5qid0u, #16191f));
242
242
  background-color: var(--awsui-style-background-focus-d43v8n, var(--color-background-input-default-1z2buq, #ffffff));
243
243
  }
244
- .awsui_input_2rhyz_q1m0j_149:not(#\9):disabled {
244
+ .awsui_input_2rhyz_1fmui_149:not(#\9):disabled {
245
245
  background-color: var(--awsui-style-background-disabled-d43v8n, var(--color-background-input-disabled-4vlau3, #eaeded));
246
246
  border-block: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-disabled-d43v8n, var(--color-border-input-disabled-tz38ro, #eaeded));
247
247
  border-inline: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-disabled-d43v8n, var(--color-border-input-disabled-tz38ro, #eaeded));
@@ -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_q1m0j_149:not(#\9):disabled::-webkit-input-placeholder {
253
- color: var(--color-text-input-placeholder-disabled-x4lauf, #687078);
252
+ .awsui_input_2rhyz_1fmui_149:not(#\9):disabled::-webkit-input-placeholder {
253
+ color: var(--awsui-style-placeholder-color-d43v8n, var(--color-text-input-placeholder-disabled-x4lauf, #687078));
254
254
  -webkit-user-select: none;
255
255
  user-select: none;
256
256
  }
257
- .awsui_input_2rhyz_q1m0j_149:not(#\9):disabled::-moz-placeholder {
258
- color: var(--color-text-input-placeholder-disabled-x4lauf, #687078);
257
+ .awsui_input_2rhyz_1fmui_149:not(#\9):disabled::-moz-placeholder {
258
+ color: var(--awsui-style-placeholder-color-d43v8n, var(--color-text-input-placeholder-disabled-x4lauf, #687078));
259
259
  opacity: 1;
260
260
  }
261
- .awsui_input_2rhyz_q1m0j_149:not(#\9):disabled:-moz-placeholder {
262
- color: var(--color-text-input-placeholder-disabled-x4lauf, #687078);
261
+ .awsui_input_2rhyz_1fmui_149:not(#\9):disabled:-moz-placeholder {
262
+ color: var(--awsui-style-placeholder-color-d43v8n, var(--color-text-input-placeholder-disabled-x4lauf, #687078));
263
263
  opacity: 1;
264
264
  }
265
- .awsui_input_2rhyz_q1m0j_149:not(#\9):invalid {
265
+ .awsui_input_2rhyz_1fmui_149:not(#\9):invalid {
266
266
  box-shadow: none;
267
267
  }
268
- .awsui_input_2rhyz_q1m0j_149.awsui_input-invalid_2rhyz_q1m0j_266:not(#\9) {
268
+ .awsui_input_2rhyz_1fmui_149.awsui_input-invalid_2rhyz_1fmui_266:not(#\9) {
269
269
  color: var(--awsui-style-color-default-d43v8n, var(--color-text-status-error-aknuvu, #d13212));
270
270
  border-color: var(--awsui-style-border-color-default-d43v8n, var(--color-text-status-error-aknuvu, #d13212));
271
271
  padding-inline-start: calc(var(--space-field-horizontal-n5peob, 8px) - (var(--border-invalid-width-z5cnpo, 4px) - var(--border-width-field-9k1tdz, 1px)));
272
272
  border-inline-start-width: var(--border-invalid-width-z5cnpo, 4px);
273
273
  }
274
- .awsui_input_2rhyz_q1m0j_149.awsui_input-invalid_2rhyz_q1m0j_266:not(#\9):focus {
275
- box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-t0us6n, 1px) var(--color-border-item-focused-r5f6xl, #0073bb);
274
+ .awsui_input_2rhyz_1fmui_149.awsui_input-invalid_2rhyz_1fmui_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-t0us6n, 1px) var(--color-border-item-focused-r5f6xl, #0073bb));
276
276
  }
277
- .awsui_input_2rhyz_q1m0j_149.awsui_input-invalid_2rhyz_q1m0j_266.awsui_input-has-icon-left_2rhyz_q1m0j_275:not(#\9) {
277
+ .awsui_input_2rhyz_1fmui_149.awsui_input-invalid_2rhyz_1fmui_266.awsui_input-has-icon-left_2rhyz_1fmui_275:not(#\9) {
278
278
  padding-inline-start: calc(var(--space-field-icon-offset-ihoxql, 32px) - (var(--border-invalid-width-z5cnpo, 4px) - var(--border-width-field-9k1tdz, 1px)));
279
279
  }
280
- .awsui_input_2rhyz_q1m0j_149.awsui_input-warning_2rhyz_q1m0j_278:not(#\9) {
280
+ .awsui_input_2rhyz_1fmui_149.awsui_input-warning_2rhyz_1fmui_278:not(#\9) {
281
281
  color: var(--awsui-style-color-default-d43v8n, var(--color-text-status-warning-9b45qh, #906806));
282
282
  border-color: var(--awsui-style-border-color-default-d43v8n, var(--color-text-status-warning-9b45qh, #906806));
283
283
  padding-inline-start: calc(var(--space-field-horizontal-n5peob, 8px) - (var(--border-invalid-width-z5cnpo, 4px) - var(--border-width-field-9k1tdz, 1px)));
284
284
  border-inline-start-width: var(--border-invalid-width-z5cnpo, 4px);
285
285
  }
286
- .awsui_input_2rhyz_q1m0j_149.awsui_input-warning_2rhyz_q1m0j_278:not(#\9):focus {
287
- box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-t0us6n, 1px) var(--color-border-item-focused-r5f6xl, #0073bb);
286
+ .awsui_input_2rhyz_1fmui_149.awsui_input-warning_2rhyz_1fmui_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-t0us6n, 1px) var(--color-border-item-focused-r5f6xl, #0073bb));
288
288
  }
289
- .awsui_input_2rhyz_q1m0j_149.awsui_input-warning_2rhyz_q1m0j_278.awsui_input-has-icon-left_2rhyz_q1m0j_275:not(#\9) {
289
+ .awsui_input_2rhyz_1fmui_149.awsui_input-warning_2rhyz_1fmui_278.awsui_input-has-icon-left_2rhyz_1fmui_275:not(#\9) {
290
290
  padding-inline-start: calc(var(--space-field-icon-offset-ihoxql, 32px) - (var(--border-invalid-width-z5cnpo, 4px) - var(--border-width-field-9k1tdz, 1px)));
291
291
  }
292
- .awsui_input_2rhyz_q1m0j_149.awsui_input-type-search_2rhyz_q1m0j_290:not(#\9) {
292
+ .awsui_input_2rhyz_1fmui_149.awsui_input-type-search_2rhyz_1fmui_290:not(#\9) {
293
293
  box-sizing: border-box;
294
294
  -webkit-appearance: none;
295
295
  }
296
- .awsui_input_2rhyz_q1m0j_149.awsui_input-type-search_2rhyz_q1m0j_290:not(#\9)::-webkit-search-decoration {
296
+ .awsui_input_2rhyz_1fmui_149.awsui_input-type-search_2rhyz_1fmui_290:not(#\9)::-webkit-search-decoration {
297
297
  -webkit-appearance: none;
298
298
  }
299
- .awsui_input_2rhyz_q1m0j_149.awsui_input-type-search_2rhyz_q1m0j_290:not(#\9)::-webkit-search-cancel-button {
299
+ .awsui_input_2rhyz_1fmui_149.awsui_input-type-search_2rhyz_1fmui_290:not(#\9)::-webkit-search-cancel-button {
300
300
  display: none;
301
301
  }
302
- .awsui_input_2rhyz_q1m0j_149.awsui_input-has-icon-left_2rhyz_q1m0j_275:not(#\9) {
302
+ .awsui_input_2rhyz_1fmui_149.awsui_input-has-icon-left_2rhyz_1fmui_275:not(#\9) {
303
303
  padding-inline-start: var(--space-field-icon-offset-ihoxql, 32px);
304
304
  }
305
- .awsui_input_2rhyz_q1m0j_149.awsui_input-has-icon-right_2rhyz_q1m0j_303:not(#\9) {
305
+ .awsui_input_2rhyz_1fmui_149.awsui_input-has-icon-right_2rhyz_1fmui_303:not(#\9) {
306
306
  padding-inline-end: var(--space-field-icon-offset-ihoxql, 32px);
307
307
  }
308
- .awsui_input_2rhyz_q1m0j_149.awsui_input-has-no-border-radius_2rhyz_q1m0j_306:not(#\9) {
308
+ .awsui_input_2rhyz_1fmui_149.awsui_input-has-no-border-radius_2rhyz_1fmui_306:not(#\9) {
309
309
  border-start-start-radius: var(--border-radius-dropdown-oaxffg, 0px);
310
310
  border-start-end-radius: var(--border-radius-dropdown-oaxffg, 0px);
311
311
  border-end-start-radius: var(--border-radius-dropdown-oaxffg, 0px);
312
312
  border-end-end-radius: var(--border-radius-dropdown-oaxffg, 0px);
313
313
  }
314
314
 
315
- .awsui_input-container_2rhyz_q1m0j_313:not(#\9) {
315
+ .awsui_input-container_2rhyz_1fmui_313:not(#\9) {
316
316
  display: flex;
317
317
  position: relative;
318
318
  }
319
319
 
320
- .awsui_input-icon-left_2rhyz_q1m0j_318:not(#\9) {
320
+ .awsui_input-icon-left_2rhyz_1fmui_318:not(#\9) {
321
321
  position: absolute;
322
322
  pointer-events: none;
323
323
  inset-inline-start: var(--space-field-horizontal-n5peob, 8px);
324
324
  inset-block-start: calc(50% - var(--line-height-body-m-bedeoh, 22px) / 2);
325
325
  }
326
326
 
327
- .awsui_input-icon-right_2rhyz_q1m0j_325:not(#\9) {
327
+ .awsui_input-icon-right_2rhyz_1fmui_325:not(#\9) {
328
328
  position: absolute;
329
329
  inset-block-start: calc(calc(50% - var(--line-height-body-m-bedeoh, 22px) / 2) - var(--space-xxxs-3w1kr2, 2px));
330
330
  inset-inline-end: calc(var(--space-field-horizontal-n5peob, 8px) - var(--space-xxs-jnczic, 4px));
331
331
  }
332
332
 
333
- .awsui_input-button-right_2rhyz_q1m0j_331:not(#\9) {
333
+ .awsui_input-button-right_2rhyz_1fmui_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_q1m0j_145",
6
- "input": "awsui_input_2rhyz_q1m0j_149",
7
- "input-readonly": "awsui_input-readonly_2rhyz_q1m0j_203",
8
- "input-invalid": "awsui_input-invalid_2rhyz_q1m0j_266",
9
- "input-has-icon-left": "awsui_input-has-icon-left_2rhyz_q1m0j_275",
10
- "input-warning": "awsui_input-warning_2rhyz_q1m0j_278",
11
- "input-type-search": "awsui_input-type-search_2rhyz_q1m0j_290",
12
- "input-has-icon-right": "awsui_input-has-icon-right_2rhyz_q1m0j_303",
13
- "input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_q1m0j_306",
14
- "input-container": "awsui_input-container_2rhyz_q1m0j_313",
15
- "input-icon-left": "awsui_input-icon-left_2rhyz_q1m0j_318",
16
- "input-icon-right": "awsui_input-icon-right_2rhyz_q1m0j_325",
17
- "input-button-right": "awsui_input-button-right_2rhyz_q1m0j_331"
5
+ "root": "awsui_root_2rhyz_1fmui_145",
6
+ "input": "awsui_input_2rhyz_1fmui_149",
7
+ "input-readonly": "awsui_input-readonly_2rhyz_1fmui_203",
8
+ "input-invalid": "awsui_input-invalid_2rhyz_1fmui_266",
9
+ "input-has-icon-left": "awsui_input-has-icon-left_2rhyz_1fmui_275",
10
+ "input-warning": "awsui_input-warning_2rhyz_1fmui_278",
11
+ "input-type-search": "awsui_input-type-search_2rhyz_1fmui_290",
12
+ "input-has-icon-right": "awsui_input-has-icon-right_2rhyz_1fmui_303",
13
+ "input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_1fmui_306",
14
+ "input-container": "awsui_input-container_2rhyz_1fmui_313",
15
+ "input-icon-left": "awsui_input-icon-left_2rhyz_1fmui_318",
16
+ "input-icon-right": "awsui_input-icon-right_2rhyz_1fmui_325",
17
+ "input-button-right": "awsui_input-button-right_2rhyz_1fmui_331"
18
18
  };
19
19