@cloudscape-design/components-themeable 3.0.1127 → 3.0.1128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/input/styles.scss +62 -9
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +99 -87
- package/lib/internal/scss/internal/styles/forms/mixins.scss +42 -19
- package/lib/internal/template/alert/styles.css.js +27 -27
- package/lib/internal/template/alert/styles.scoped.css +50 -50
- package/lib/internal/template/alert/styles.selectors.js +27 -27
- package/lib/internal/template/annotation-context/annotation/styles.css.js +24 -24
- package/lib/internal/template/annotation-context/annotation/styles.scoped.css +32 -32
- package/lib/internal/template/annotation-context/annotation/styles.selectors.js +24 -24
- package/lib/internal/template/app-layout/notifications/styles.css.js +3 -3
- package/lib/internal/template/app-layout/notifications/styles.scoped.css +7 -7
- package/lib/internal/template/app-layout/notifications/styles.selectors.js +3 -3
- package/lib/internal/template/app-layout/visual-refresh/styles.css.js +86 -86
- package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +258 -258
- package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js +5 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +27 -27
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +84 -84
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +27 -27
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js +3 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/skeleton-parts.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/skeleton-parts.js +4 -5
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/skeleton-parts.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/slots.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/slots.js +8 -3
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/slots.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +27 -27
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +54 -54
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +27 -27
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts +20 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js +19 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.js +0 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +7 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
- package/lib/internal/template/attribute-editor/styles.css.js +15 -15
- package/lib/internal/template/attribute-editor/styles.scoped.css +28 -28
- package/lib/internal/template/attribute-editor/styles.selectors.js +15 -15
- package/lib/internal/template/autosuggest/index.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/index.js +3 -2
- package/lib/internal/template/autosuggest/index.js.map +1 -1
- package/lib/internal/template/autosuggest/interfaces.d.ts +4 -0
- package/lib/internal/template/autosuggest/interfaces.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/interfaces.js.map +1 -1
- package/lib/internal/template/autosuggest/internal.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/internal.js +3 -3
- package/lib/internal/template/autosuggest/internal.js.map +1 -1
- package/lib/internal/template/breadcrumb-group/item/styles.css.js +7 -7
- package/lib/internal/template/breadcrumb-group/item/styles.scoped.css +28 -28
- package/lib/internal/template/breadcrumb-group/item/styles.selectors.js +7 -7
- package/lib/internal/template/button/styles.css.js +22 -22
- package/lib/internal/template/button/styles.scoped.css +256 -256
- package/lib/internal/template/button/styles.selectors.js +22 -22
- package/lib/internal/template/button-dropdown/item-element/styles.css.js +16 -16
- package/lib/internal/template/button-dropdown/item-element/styles.scoped.css +27 -27
- package/lib/internal/template/button-dropdown/item-element/styles.selectors.js +16 -16
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts +2 -2
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.js +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.js.map +1 -1
- package/lib/internal/template/button-group/interfaces.d.ts +4 -1
- package/lib/internal/template/button-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-group/interfaces.js.map +1 -1
- package/lib/internal/template/checkbox/styles.css.js +3 -3
- package/lib/internal/template/checkbox/styles.scoped.css +11 -11
- package/lib/internal/template/checkbox/styles.selectors.js +3 -3
- package/lib/internal/template/content-layout/styles.css.js +14 -14
- package/lib/internal/template/content-layout/styles.scoped.css +27 -27
- package/lib/internal/template/content-layout/styles.selectors.js +14 -14
- package/lib/internal/template/copy-to-clipboard/internal.d.ts.map +1 -1
- package/lib/internal/template/copy-to-clipboard/internal.js +18 -5
- package/lib/internal/template/copy-to-clipboard/internal.js.map +1 -1
- package/lib/internal/template/date-range-picker/dropdown.d.ts +2 -1
- package/lib/internal/template/date-range-picker/dropdown.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/dropdown.js +2 -2
- package/lib/internal/template/date-range-picker/dropdown.js.map +1 -1
- package/lib/internal/template/date-range-picker/index.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/index.js +2 -2
- package/lib/internal/template/date-range-picker/index.js.map +1 -1
- package/lib/internal/template/date-range-picker/interfaces.d.ts +6 -0
- package/lib/internal/template/date-range-picker/interfaces.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/interfaces.js.map +1 -1
- package/lib/internal/template/date-range-picker/relative-range/index.d.ts +2 -1
- package/lib/internal/template/date-range-picker/relative-range/index.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/relative-range/index.js +4 -1
- package/lib/internal/template/date-range-picker/relative-range/index.js.map +1 -1
- package/lib/internal/template/flashbar/styles.css.js +50 -50
- package/lib/internal/template/flashbar/styles.scoped.css +187 -187
- package/lib/internal/template/flashbar/styles.selectors.js +50 -50
- package/lib/internal/template/help-panel/styles.css.js +6 -6
- package/lib/internal/template/help-panel/styles.scoped.css +73 -73
- package/lib/internal/template/help-panel/styles.selectors.js +6 -6
- package/lib/internal/template/input/index.d.ts.map +1 -1
- package/lib/internal/template/input/index.js +3 -2
- package/lib/internal/template/input/index.js.map +1 -1
- package/lib/internal/template/input/interfaces.d.ts +48 -0
- package/lib/internal/template/input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/input/interfaces.js.map +1 -1
- package/lib/internal/template/input/internal.d.ts.map +1 -1
- package/lib/internal/template/input/internal.js +3 -2
- package/lib/internal/template/input/internal.js.map +1 -1
- package/lib/internal/template/input/styles.css.js +13 -13
- package/lib/internal/template/input/styles.d.ts +3 -0
- package/lib/internal/template/input/styles.d.ts.map +1 -0
- package/lib/internal/template/input/styles.js +42 -0
- package/lib/internal/template/input/styles.js.map +1 -0
- package/lib/internal/template/input/styles.scoped.css +66 -49
- package/lib/internal/template/input/styles.selectors.js +13 -13
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts +1 -0
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js +5 -2
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.d.ts +1 -0
- package/lib/internal/template/internal/analytics/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.css.js +20 -20
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.scoped.css +48 -48
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.selectors.js +20 -20
- package/lib/internal/template/internal/components/dropdown/styles.css.js +20 -20
- package/lib/internal/template/internal/components/dropdown/styles.scoped.css +38 -38
- package/lib/internal/template/internal/components/dropdown/styles.selectors.js +20 -20
- package/lib/internal/template/internal/components/token-list/styles.css.js +10 -10
- package/lib/internal/template/internal/components/token-list/styles.scoped.css +25 -25
- package/lib/internal/template/internal/components/token-list/styles.selectors.js +10 -10
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts +12 -0
- package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/lib/internal/template/internal/generated/custom-css-properties/index.js +98 -86
- package/lib/internal/template/internal/generated/custom-css-properties/index.js.map +1 -1
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +0 -4
- package/lib/internal/template/internal/generated/styles/tokens.js +0 -4
- package/lib/internal/template/internal/generated/theming/index.cjs +0 -84
- package/lib/internal/template/internal/generated/theming/index.js +0 -84
- package/lib/internal/template/link/styles.css.js +20 -20
- package/lib/internal/template/link/styles.scoped.css +103 -103
- package/lib/internal/template/link/styles.selectors.js +20 -20
- package/lib/internal/template/popover/container.d.ts.map +1 -1
- package/lib/internal/template/popover/container.js +2 -5
- package/lib/internal/template/popover/container.js.map +1 -1
- package/lib/internal/template/popover/use-position-observer.d.ts +1 -2
- package/lib/internal/template/popover/use-position-observer.d.ts.map +1 -1
- package/lib/internal/template/popover/use-position-observer.js +10 -8
- package/lib/internal/template/popover/use-position-observer.js.map +1 -1
- package/lib/internal/template/radio-group/styles.css.js +10 -10
- package/lib/internal/template/radio-group/styles.scoped.css +22 -22
- package/lib/internal/template/radio-group/styles.selectors.js +10 -10
- package/lib/internal/template/select/parts/filter.d.ts +1 -1
- package/lib/internal/template/select/parts/filter.d.ts.map +1 -1
- package/lib/internal/template/side-navigation/interfaces.d.ts +4 -0
- package/lib/internal/template/side-navigation/interfaces.d.ts.map +1 -1
- package/lib/internal/template/side-navigation/interfaces.js.map +1 -1
- package/lib/internal/template/side-navigation/parts.d.ts.map +1 -1
- package/lib/internal/template/side-navigation/parts.js +4 -1
- package/lib/internal/template/side-navigation/parts.js.map +1 -1
- package/lib/internal/template/slider/styles.css.js +26 -26
- package/lib/internal/template/slider/styles.scoped.css +86 -86
- package/lib/internal/template/slider/styles.selectors.js +26 -26
- package/lib/internal/template/spinner/styles.css.js +13 -13
- package/lib/internal/template/spinner/styles.scoped.css +39 -39
- package/lib/internal/template/spinner/styles.selectors.js +13 -13
- package/lib/internal/template/tag-editor/styles.css.js +3 -3
- package/lib/internal/template/tag-editor/styles.scoped.css +13 -13
- package/lib/internal/template/tag-editor/styles.selectors.js +3 -3
- package/lib/internal/template/test-utils/dom/multiselect/index.d.ts +8 -0
- package/lib/internal/template/test-utils/dom/multiselect/index.js +18 -4
- package/lib/internal/template/test-utils/dom/multiselect/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/multiselect/index.d.ts +8 -0
- package/lib/internal/template/test-utils/selectors/multiselect/index.js +18 -4
- package/lib/internal/template/test-utils/selectors/multiselect/index.js.map +1 -1
- package/lib/internal/template/text-content/styles.css.js +1 -1
- package/lib/internal/template/text-content/styles.scoped.css +66 -66
- package/lib/internal/template/text-content/styles.selectors.js +1 -1
- package/lib/internal/template/toggle/styles.css.js +10 -10
- package/lib/internal/template/toggle/styles.scoped.css +23 -23
- package/lib/internal/template/toggle/styles.selectors.js +10 -10
- package/lib/internal/template/toggle-button/internal.d.ts +1 -0
- package/lib/internal/template/toggle-button/internal.d.ts.map +1 -1
- package/lib/internal/template/toggle-button/internal.js +2 -2
- package/lib/internal/template/toggle-button/internal.js.map +1 -1
- package/lib/internal/template/wizard/index.d.ts.map +1 -1
- package/lib/internal/template/wizard/index.js +2 -1
- package/lib/internal/template/wizard/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/input/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { BaseKeyDetail, CancelableEventHandler, NonCancelableEventHandler } from '../internal/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\n\nexport interface BaseInputProps {\n /**\n * Specifies the text entered into the form element.\n */\n value: string;\n\n /**\n * Specifies the name of the control used in HTML forms.\n */\n name?: string;\n\n /**\n * Specifies the placeholder text rendered when the value is an empty string.\n */\n placeholder?: string;\n\n /**\n * Specifies if the control is disabled, which prevents the\n * user from modifying the value and prevents the value from\n * being included in a form submission. A disabled control can't\n * receive focus.\n */\n disabled?: boolean;\n\n /**\n * Specifies if the control is read-only, which prevents the\n * user from modifying the value but includes it in a form\n * submission. A read-only control can receive focus.\n *\n * Don't use read-only inputs outside a form.\n */\n readOnly?: boolean;\n\n /**\n * Indicates whether the control should be focused as\n * soon as the page loads, which enables the user to\n * start typing without having to manually focus the control. Don't\n * use this option on pages where the control may be\n * scrolled out of the viewport.\n */\n autoFocus?: boolean;\n\n /**\n * Adds an `aria-label` to the native control.\n *\n * Use this if you don't have a visible label for this control.\n */\n ariaLabel?: string;\n\n /**\n * Specifies whether to add `aria-required` to the native control.\n */\n ariaRequired?: boolean;\n\n /**\n * Called when input focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler<null>;\n\n /**\n * Called when input focus is moved to the UI control.\n */\n onFocus?: NonCancelableEventHandler<null>;\n\n /**\n * Called whenever a user changes the input value (by typing or pasting).\n * The event `detail` contains the current value of the field.\n */\n onChange?: NonCancelableEventHandler<InputProps.ChangeDetail>;\n\n /**\n * Attributes to add to the native `input` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeInputAttributes?: NativeAttributes<React.InputHTMLAttributes<HTMLInputElement>>;\n}\n\nexport interface InputAutoCorrect {\n /**\n * Specifies whether to disable browser autocorrect and related features.\n * If you set this to `true`, it disables any native browser capabilities\n * that automatically correct user input, such as `autocorrect` and\n * `autocapitalize`. If you don't set it, the behavior follows the default behavior\n * of the user's browser.\n */\n disableBrowserAutocorrect?: boolean;\n}\n\nexport interface InputAutoComplete {\n /**\n * Specifies whether to enable a browser's autocomplete functionality for this input.\n * In some cases it might be appropriate to disable autocomplete (for example, for security-sensitive fields).\n * To use it correctly, set the `name` property.\n *\n * You can either provide a boolean value to set the property to \"on\" or \"off\", or specify a string value\n * for the [autocomplete](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) attribute.\n */\n autoComplete?: boolean | string;\n}\n\nexport interface InputSpellcheck {\n /**\n * Specifies the value of the `spellcheck` attribute on the native control.\n * This value controls the native browser capability to check for spelling/grammar errors.\n * If not set, the browser default behavior is to perform spellchecking.\n * For more details, check the [spellcheck MDN article](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck).\n *\n * Enhanced spellchecking features of your browser and/or operating system may send input values to external parties.\n * Make sure it’s deactivated for fields with sensitive information to prevent\n * inadvertently sending data (such as user passwords) to third parties.\n */\n spellcheck?: boolean;\n}\n\nexport interface InputKeyEvents {\n /**\n * Called when the underlying native textarea emits a `keydown` event.\n * The event `detail` contains the `keyCode` and information\n * about modifiers (that is, CTRL, ALT, SHIFT, META, etc.).\n */\n onKeyDown?: CancelableEventHandler<InputProps.KeyDetail>;\n\n /**\n * Called when the underlying native textarea emits a `keyup` event.\n * The event `detail` contains the `keyCode` and information\n * about modifiers (that is, CTRL, ALT, SHIFT, META, etc.).\n */\n onKeyUp?: CancelableEventHandler<InputProps.KeyDetail>;\n}\n\nexport interface InputClearLabel {\n /**\n * Adds an `aria-label` to the clear button inside the search input.\n * @i18n\n */\n clearAriaLabel?: string;\n}\n\nexport interface InputProps\n extends BaseComponentProps,\n BaseInputProps,\n InputKeyEvents,\n InputAutoCorrect,\n InputAutoComplete,\n InputSpellcheck,\n InputClearLabel,\n FormFieldValidationControlProps {\n /**\n * Specifies the type of control to render.\n * Inputs with a `number` type use the native element behavior, which might\n * be slightly different across browsers.\n */\n type?: InputProps.Type;\n\n /**\n * Adds a hint to the browser about the type of data a user may enter into this field.\n * Some devices may render a different virtual keyboard depending on this value.\n * This value may not be supported by all browsers or devices.\n */\n inputMode?: InputProps.InputMode;\n\n /**\n * The step attribute is a number that specifies the granularity that the value\n * must adhere to or the keyword \"any\". It is valid for the numeric input types,\n * including the date, month, week, time, datetime-local, number and range types.\n */\n step?: InputProps.Step;\n}\n\nexport namespace InputProps {\n export type Type = 'text' | 'password' | 'search' | 'number' | 'email' | 'url';\n export type InputMode = 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n export type Step = number | 'any';\n\n export type ChangeDetail = BaseChangeDetail;\n export type KeyDetail = BaseKeyDetail;\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}\nexport interface BaseChangeDetail {\n value: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/input/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { BaseKeyDetail, CancelableEventHandler, NonCancelableEventHandler } from '../internal/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\n\nexport interface BaseInputProps {\n /**\n * Specifies the text entered into the form element.\n */\n value: string;\n\n /**\n * Specifies the name of the control used in HTML forms.\n */\n name?: string;\n\n /**\n * Specifies the placeholder text rendered when the value is an empty string.\n */\n placeholder?: string;\n\n /**\n * Specifies if the control is disabled, which prevents the\n * user from modifying the value and prevents the value from\n * being included in a form submission. A disabled control can't\n * receive focus.\n */\n disabled?: boolean;\n\n /**\n * Specifies if the control is read-only, which prevents the\n * user from modifying the value but includes it in a form\n * submission. A read-only control can receive focus.\n *\n * Don't use read-only inputs outside a form.\n */\n readOnly?: boolean;\n\n /**\n * Indicates whether the control should be focused as\n * soon as the page loads, which enables the user to\n * start typing without having to manually focus the control. Don't\n * use this option on pages where the control may be\n * scrolled out of the viewport.\n */\n autoFocus?: boolean;\n\n /**\n * Adds an `aria-label` to the native control.\n *\n * Use this if you don't have a visible label for this control.\n */\n ariaLabel?: string;\n\n /**\n * Specifies whether to add `aria-required` to the native control.\n */\n ariaRequired?: boolean;\n\n /**\n * Called when input focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler<null>;\n\n /**\n * Called when input focus is moved to the UI control.\n */\n onFocus?: NonCancelableEventHandler<null>;\n\n /**\n * Called whenever a user changes the input value (by typing or pasting).\n * The event `detail` contains the current value of the field.\n */\n onChange?: NonCancelableEventHandler<InputProps.ChangeDetail>;\n\n /**\n * Attributes to add to the native `input` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeInputAttributes?: NativeAttributes<React.InputHTMLAttributes<HTMLInputElement>>;\n}\n\nexport interface InputAutoCorrect {\n /**\n * Specifies whether to disable browser autocorrect and related features.\n * If you set this to `true`, it disables any native browser capabilities\n * that automatically correct user input, such as `autocorrect` and\n * `autocapitalize`. If you don't set it, the behavior follows the default behavior\n * of the user's browser.\n */\n disableBrowserAutocorrect?: boolean;\n}\n\nexport interface InputAutoComplete {\n /**\n * Specifies whether to enable a browser's autocomplete functionality for this input.\n * In some cases it might be appropriate to disable autocomplete (for example, for security-sensitive fields).\n * To use it correctly, set the `name` property.\n *\n * You can either provide a boolean value to set the property to \"on\" or \"off\", or specify a string value\n * for the [autocomplete](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) attribute.\n */\n autoComplete?: boolean | string;\n}\n\nexport interface InputSpellcheck {\n /**\n * Specifies the value of the `spellcheck` attribute on the native control.\n * This value controls the native browser capability to check for spelling/grammar errors.\n * If not set, the browser default behavior is to perform spellchecking.\n * For more details, check the [spellcheck MDN article](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck).\n *\n * Enhanced spellchecking features of your browser and/or operating system may send input values to external parties.\n * Make sure it’s deactivated for fields with sensitive information to prevent\n * inadvertently sending data (such as user passwords) to third parties.\n */\n spellcheck?: boolean;\n}\n\nexport interface InputKeyEvents {\n /**\n * Called when the underlying native textarea emits a `keydown` event.\n * The event `detail` contains the `keyCode` and information\n * about modifiers (that is, CTRL, ALT, SHIFT, META, etc.).\n */\n onKeyDown?: CancelableEventHandler<InputProps.KeyDetail>;\n\n /**\n * Called when the underlying native textarea emits a `keyup` event.\n * The event `detail` contains the `keyCode` and information\n * about modifiers (that is, CTRL, ALT, SHIFT, META, etc.).\n */\n onKeyUp?: CancelableEventHandler<InputProps.KeyDetail>;\n}\n\nexport interface InputClearLabel {\n /**\n * Adds an `aria-label` to the clear button inside the search input.\n * @i18n\n */\n clearAriaLabel?: string;\n}\n\nexport interface InputProps\n extends BaseComponentProps,\n BaseInputProps,\n InputKeyEvents,\n InputAutoCorrect,\n InputAutoComplete,\n InputSpellcheck,\n InputClearLabel,\n FormFieldValidationControlProps {\n /**\n * Specifies the type of control to render.\n * Inputs with a `number` type use the native element behavior, which might\n * be slightly different across browsers.\n */\n type?: InputProps.Type;\n\n /**\n * Adds a hint to the browser about the type of data a user may enter into this field.\n * Some devices may render a different virtual keyboard depending on this value.\n * This value may not be supported by all browsers or devices.\n */\n inputMode?: InputProps.InputMode;\n\n /**\n * The step attribute is a number that specifies the granularity that the value\n * must adhere to or the keyword \"any\". It is valid for the numeric input types,\n * including the date, month, week, time, datetime-local, number and range types.\n */\n step?: InputProps.Step;\n\n /**\n * @awsuiSystem core\n */\n style?: InputProps.Style;\n}\n\nexport namespace InputProps {\n export type Type = 'text' | 'password' | 'search' | 'number' | 'email' | 'url';\n export type InputMode = 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n export type Step = number | 'any';\n\n export type ChangeDetail = BaseChangeDetail;\n export type KeyDetail = BaseKeyDetail;\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\nexport interface BaseChangeDetail {\n value: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/input/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAW3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAgB,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,+BAA+B,EAAuB,MAAM,wCAAwC,CAAC;AAC9G,OAAO,EAA6C,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC1G,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAA6B,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAK9F,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/input/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAW3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAgB,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,+BAA+B,EAAuB,MAAM,wCAAwC,CAAC;AAC9G,OAAO,EAA6C,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC1G,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAA6B,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAK9F,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM9F,MAAM,WAAW,kBACf,SAAQ,kBAAkB,EACxB,cAAc,EACd,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EACxB,gBAAgB,EAChB,+BAA+B,EAC/B,0BAA0B;IAC5B,IAAI,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC;IAC3C,UAAU,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/B,iBAAiB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACzC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAE/B,WAAW,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAEhC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,gBAAgB,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,CAAC;IAC/D,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;QAAE,aAAa,EAAE,IAAI,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IAE/E,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C,8BAA8B,CAAC,EAAE,YAAY,CAAC;CAC/C;;AAiMD,wBAA+C"}
|
|
@@ -13,10 +13,11 @@ import { useFormFieldContext } from '../internal/context/form-field-context';
|
|
|
13
13
|
import { fireKeyboardEvent, fireNonCancelableEvent } from '../internal/events';
|
|
14
14
|
import { useDebounceCallback } from '../internal/hooks/use-debounce-callback';
|
|
15
15
|
import WithNativeAttributes from '../internal/utils/with-native-attributes';
|
|
16
|
+
import { getInputStyles } from './styles';
|
|
16
17
|
import { convertAutoComplete, useSearchProps } from './utils';
|
|
17
18
|
import styles from './styles.css.js';
|
|
18
19
|
function InternalInput(_a, ref) {
|
|
19
|
-
var { type = 'text', step, inputMode, autoComplete = true, ariaLabel, clearAriaLabel: clearAriaLabelOverride, name, value, placeholder, autoFocus, disabled, readOnly, disableBrowserAutocorrect, spellcheck, __noBorderRadius, __leftIcon, __leftIconVariant = 'subtle', __onLeftIconClick, ariaRequired, __rightIcon, __onRightIconClick, onKeyDown, onKeyUp, onChange, __onDelayedInput, __onBlurWithDetail, onBlur, onFocus, nativeInputAttributes, __internalRootRef, __inheritFormFieldProps, __injectAnalyticsComponentMetadata, __skipNativeAttributesWarnings } = _a, rest = __rest(_a, ["type", "step", "inputMode", "autoComplete", "ariaLabel", "clearAriaLabel", "name", "value", "placeholder", "autoFocus", "disabled", "readOnly", "disableBrowserAutocorrect", "spellcheck", "__noBorderRadius", "__leftIcon", "__leftIconVariant", "__onLeftIconClick", "ariaRequired", "__rightIcon", "__onRightIconClick", "onKeyDown", "onKeyUp", "onChange", "__onDelayedInput", "__onBlurWithDetail", "onBlur", "onFocus", "nativeInputAttributes", "__internalRootRef", "__inheritFormFieldProps", "__injectAnalyticsComponentMetadata", "__skipNativeAttributesWarnings"]);
|
|
20
|
+
var { type = 'text', step, inputMode, autoComplete = true, ariaLabel, clearAriaLabel: clearAriaLabelOverride, name, value, placeholder, autoFocus, disabled, readOnly, disableBrowserAutocorrect, spellcheck, __noBorderRadius, __leftIcon, __leftIconVariant = 'subtle', __onLeftIconClick, ariaRequired, __rightIcon, __onRightIconClick, onKeyDown, onKeyUp, onChange, __onDelayedInput, __onBlurWithDetail, onBlur, onFocus, nativeInputAttributes, __internalRootRef, __inheritFormFieldProps, __injectAnalyticsComponentMetadata, __skipNativeAttributesWarnings, style } = _a, rest = __rest(_a, ["type", "step", "inputMode", "autoComplete", "ariaLabel", "clearAriaLabel", "name", "value", "placeholder", "autoFocus", "disabled", "readOnly", "disableBrowserAutocorrect", "spellcheck", "__noBorderRadius", "__leftIcon", "__leftIconVariant", "__onLeftIconClick", "ariaRequired", "__rightIcon", "__onRightIconClick", "onKeyDown", "onKeyUp", "onChange", "__onDelayedInput", "__onBlurWithDetail", "onBlur", "onFocus", "nativeInputAttributes", "__internalRootRef", "__inheritFormFieldProps", "__injectAnalyticsComponentMetadata", "__skipNativeAttributesWarnings", "style"]);
|
|
20
21
|
const baseProps = getBaseProps(rest);
|
|
21
22
|
const i18n = useInternalI18n('input');
|
|
22
23
|
const fireDelayedInput = useDebounceCallback((value) => fireNonCancelableEvent(__onDelayedInput, { value }));
|
|
@@ -102,7 +103,7 @@ function InternalInput(_a, ref) {
|
|
|
102
103
|
: copyAnalyticsMetadataAttribute(rest))),
|
|
103
104
|
__leftIcon && (React.createElement("span", { onClick: __onLeftIconClick, className: styles['input-icon-left'] },
|
|
104
105
|
React.createElement(InternalIcon, { name: __leftIcon, variant: disabled || readOnly ? 'disabled' : __leftIconVariant }))),
|
|
105
|
-
React.createElement(WithNativeAttributes, Object.assign({}, attributes, { tag: "input", componentName: "Input", nativeAttributes: nativeInputAttributes, skipWarnings: __skipNativeAttributesWarnings, ref: mergedRef })),
|
|
106
|
+
React.createElement(WithNativeAttributes, Object.assign({}, attributes, { tag: "input", componentName: "Input", nativeAttributes: nativeInputAttributes, skipWarnings: __skipNativeAttributesWarnings, ref: mergedRef, style: getInputStyles(style) })),
|
|
106
107
|
__rightIcon && (React.createElement("span", Object.assign({ className: styles['input-icon-right'] }, (__rightIcon === 'close'
|
|
107
108
|
? getAnalyticsMetadataAttribute({
|
|
108
109
|
action: 'clearInput',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/input/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO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S,EAAE,0BAA0B,EAAE,CAAC;QAC1E,CAAC,CAAC,8BAA8B,CAAC,IAAI,CAAC,CAAC;QAExC,UAAU,IAAI,CACb,8BAAM,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC;YACpE,oBAAC,YAAY,IAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,GAAI,CAC7F,CACR;QACD,oBAAC,oBAAoB,oBACf,UAAU,IACd,GAAG,EAAC,OAAO,EACX,aAAa,EAAC,OAAO,EACrB,gBAAgB,EAAE,qBAAqB,EACvC,YAAY,EAAE,8BAA8B,EAC5C,GAAG,EAAE,SAAS,IACd;QACD,WAAW,IAAI,CACd,4CACE,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC,IACjC,CAAC,WAAW,KAAK,OAAO;YAC1B,CAAC,CAAC,6BAA6B,CAAC;gBAC5B,MAAM,EAAE,YAAY;aACiC,CAAC;YAC1D,CAAC,CAAC,EAAE,CAAC;YAEP,oBAAC,cAAc;YACb,sBAAsB;;gBAAtB,sBAAsB;gBACtB,SAAS,EAAE,MAAM,CAAC,oBAAoB,CAAC,EACvC,OAAO,EAAC,4BAA4B,EACpC,UAAU,EAAC,MAAM,EACjB,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,EACzD,QAAQ,EAAE,QAAQ,GAClB,CACG,CACR,CACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\nimport {\n copyAnalyticsMetadataAttribute,\n getAnalyticsMetadataAttribute,\n} from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalButton from '../button/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport { BaseComponentProps, getBaseProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps, useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireKeyboardEvent, fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useDebounceCallback } from '../internal/hooks/use-debounce-callback';\nimport WithNativeAttributes, { SkipWarnings } from '../internal/utils/with-native-attributes';\nimport {\n GeneratedAnalyticsMetadataInputClearInput,\n GeneratedAnalyticsMetadataInputComponent,\n} from './analytics-metadata/interfaces';\nimport { BaseChangeDetail, BaseInputProps, InputAutoCorrect, InputProps } from './interfaces';\nimport { convertAutoComplete, useSearchProps } from './utils';\n\nimport styles from './styles.css.js';\n\nexport interface InternalInputProps\n extends BaseComponentProps,\n BaseInputProps,\n Omit<InputProps, 'type'>,\n InputAutoCorrect,\n FormFieldValidationControlProps,\n InternalBaseComponentProps {\n type?: InputProps['type'] | 'visualSearch';\n __leftIcon?: IconProps['name'];\n __leftIconVariant?: IconProps['variant'];\n __onLeftIconClick?: () => void;\n\n __rightIcon?: IconProps['name'];\n __onRightIconClick?: () => void;\n\n __noBorderRadius?: boolean;\n\n __onDelayedInput?: NonCancelableEventHandler<BaseChangeDetail>;\n __onBlurWithDetail?: NonCancelableEventHandler<{ relatedTarget: Node | null }>;\n\n __inheritFormFieldProps?: boolean;\n __injectAnalyticsComponentMetadata?: boolean;\n __skipNativeAttributesWarnings?: SkipWarnings;\n}\n\nfunction InternalInput(\n {\n type = 'text',\n step,\n inputMode,\n autoComplete = true,\n ariaLabel,\n clearAriaLabel: clearAriaLabelOverride,\n name,\n value,\n placeholder,\n autoFocus,\n disabled,\n readOnly,\n disableBrowserAutocorrect,\n spellcheck,\n __noBorderRadius,\n\n __leftIcon,\n __leftIconVariant = 'subtle',\n __onLeftIconClick,\n\n ariaRequired,\n\n __rightIcon,\n __onRightIconClick,\n\n onKeyDown,\n onKeyUp,\n onChange,\n __onDelayedInput,\n __onBlurWithDetail,\n onBlur,\n onFocus,\n nativeInputAttributes,\n __internalRootRef,\n __inheritFormFieldProps,\n __injectAnalyticsComponentMetadata,\n __skipNativeAttributesWarnings,\n ...rest\n }: InternalInputProps,\n ref: Ref<HTMLInputElement>\n) {\n const baseProps = getBaseProps(rest);\n const i18n = useInternalI18n('input');\n const fireDelayedInput = useDebounceCallback((value: string) => fireNonCancelableEvent(__onDelayedInput, { value }));\n\n const handleChange = (value: string) => {\n fireDelayedInput(value);\n fireNonCancelableEvent(onChange, { value });\n };\n\n const inputRef = useRef<HTMLInputElement>(null);\n const searchProps = useSearchProps(type, disabled, readOnly, value, inputRef, handleChange);\n __leftIcon = __leftIcon ?? searchProps.__leftIcon;\n __rightIcon = __rightIcon ?? searchProps.__rightIcon;\n __onRightIconClick = __onRightIconClick ?? searchProps.__onRightIconClick;\n\n const formFieldContext = useFormFieldContext(rest);\n const { ariaLabelledby, ariaDescribedby, controlId, invalid, warning } = __inheritFormFieldProps\n ? formFieldContext\n : rest;\n\n const attributes: React.InputHTMLAttributes<HTMLInputElement> = {\n 'aria-label': ariaLabel,\n // aria-labelledby has precedence over aria-label in accessible name calculation.\n // When aria-label is provided for Input, it should override aria-labelledBy from form-field context.\n // If both aria-label and aria-labelledby come from Input props, aria-labelledby will be used in accessible name\n 'aria-labelledby': ariaLabel && !rest.ariaLabelledby ? undefined : ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n name,\n placeholder,\n autoFocus,\n id: controlId,\n className: clsx(\n styles.input,\n type && styles[`input-type-${type}`],\n __rightIcon && styles['input-has-icon-right'],\n __leftIcon && styles['input-has-icon-left'],\n __noBorderRadius && styles['input-has-no-border-radius'],\n {\n [styles['input-readonly']]: readOnly,\n [styles['input-invalid']]: invalid,\n [styles['input-warning']]: warning && !invalid,\n }\n ),\n autoComplete: convertAutoComplete(autoComplete),\n disabled,\n readOnly,\n type,\n step,\n inputMode,\n spellCheck: spellcheck,\n onKeyDown: onKeyDown && (event => fireKeyboardEvent(onKeyDown, event)),\n onKeyUp: onKeyUp && (event => fireKeyboardEvent(onKeyUp, event)),\n // We set a default value on the component in order to force it into the controlled mode.\n value: value ?? '',\n onChange: onChange && (event => handleChange(event.target.value)),\n onBlur: e => {\n fireNonCancelableEvent(onBlur);\n fireNonCancelableEvent(__onBlurWithDetail, { relatedTarget: e.relatedTarget });\n },\n onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),\n };\n\n if (type === 'number') {\n // Chrome and Safari have a weird built-in behavior of letting focused\n // number inputs be controlled by scrolling on them. However, they don't\n // lock the browser's scroll, so it's very easy to accidentally increment\n // the input while scrolling down the page.\n attributes.onWheel = event => event.currentTarget.blur();\n }\n\n if (disableBrowserAutocorrect) {\n attributes.autoCorrect = 'off';\n attributes.autoCapitalize = 'off';\n }\n\n // ensure aria properties are string literal \"true\"\n if (ariaRequired) {\n attributes['aria-required'] = 'true';\n }\n if (invalid) {\n attributes['aria-invalid'] = 'true';\n }\n\n const mergedRef = useMergeRefs(ref, inputRef);\n\n // type = \"visualSearch\" renders a type=\"text' input\n if (attributes.type === 'visualSearch') {\n attributes.type = 'text';\n }\n\n const componentAnalyticsMetadata: GeneratedAnalyticsMetadataInputComponent = {\n name: 'awsui.Input',\n label: 'input',\n properties: {\n value: value || '',\n },\n };\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles['input-container'])}\n ref={__internalRootRef}\n dir={type === 'email' ? 'ltr' : undefined}\n {...(__injectAnalyticsComponentMetadata\n ? getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })\n : copyAnalyticsMetadataAttribute(rest))}\n >\n {__leftIcon && (\n <span onClick={__onLeftIconClick} className={styles['input-icon-left']}>\n <InternalIcon name={__leftIcon} variant={disabled || readOnly ? 'disabled' : __leftIconVariant} />\n </span>\n )}\n <WithNativeAttributes\n {...attributes}\n tag=\"input\"\n componentName=\"Input\"\n nativeAttributes={nativeInputAttributes}\n skipWarnings={__skipNativeAttributesWarnings}\n ref={mergedRef}\n />\n {__rightIcon && (\n <span\n className={styles['input-icon-right']}\n {...(__rightIcon === 'close'\n ? getAnalyticsMetadataAttribute({\n action: 'clearInput',\n } as Partial<GeneratedAnalyticsMetadataInputClearInput>)\n : {})}\n >\n <InternalButton\n // Used for test utils\n className={styles['input-button-right']}\n variant=\"inline-icon-pointer-target\"\n formAction=\"none\"\n iconName={__rightIcon}\n onClick={__onRightIconClick}\n ariaLabel={i18n('clearAriaLabel', clearAriaLabelOverride)}\n disabled={disabled}\n />\n </span>\n )}\n </div>\n );\n}\n\nexport default React.forwardRef(InternalInput);\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/input/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAC7E,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,kEAAkE,CAAC;AAE1E,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAsB,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAmC,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC9G,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAA6B,MAAM,oBAAoB,CAAC;AAE1G,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAA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EACd,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,IAC5B;QACD,WAAW,IAAI,CACd,4CACE,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC,IACjC,CAAC,WAAW,KAAK,OAAO;YAC1B,CAAC,CAAC,6BAA6B,CAAC;gBAC5B,MAAM,EAAE,YAAY;aACiC,CAAC;YAC1D,CAAC,CAAC,EAAE,CAAC;YAEP,oBAAC,cAAc;YACb,sBAAsB;;gBAAtB,sBAAsB;gBACtB,SAAS,EAAE,MAAM,CAAC,oBAAoB,CAAC,EACvC,OAAO,EAAC,4BAA4B,EACpC,UAAU,EAAC,MAAM,EACjB,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,EACzD,QAAQ,EAAE,QAAQ,GAClB,CACG,CACR,CACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\nimport {\n copyAnalyticsMetadataAttribute,\n getAnalyticsMetadataAttribute,\n} from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalButton from '../button/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { IconProps } from '../icon/interfaces';\nimport InternalIcon from '../icon/internal';\nimport { BaseComponentProps, getBaseProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps, useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireKeyboardEvent, fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useDebounceCallback } from '../internal/hooks/use-debounce-callback';\nimport WithNativeAttributes, { SkipWarnings } from '../internal/utils/with-native-attributes';\nimport {\n GeneratedAnalyticsMetadataInputClearInput,\n GeneratedAnalyticsMetadataInputComponent,\n} from './analytics-metadata/interfaces';\nimport { BaseChangeDetail, BaseInputProps, InputAutoCorrect, InputProps } from './interfaces';\nimport { getInputStyles } from './styles';\nimport { convertAutoComplete, useSearchProps } from './utils';\n\nimport styles from './styles.css.js';\n\nexport interface InternalInputProps\n extends BaseComponentProps,\n BaseInputProps,\n Omit<InputProps, 'type'>,\n InputAutoCorrect,\n FormFieldValidationControlProps,\n InternalBaseComponentProps {\n type?: InputProps['type'] | 'visualSearch';\n __leftIcon?: IconProps['name'];\n __leftIconVariant?: IconProps['variant'];\n __onLeftIconClick?: () => void;\n\n __rightIcon?: IconProps['name'];\n __onRightIconClick?: () => void;\n\n __noBorderRadius?: boolean;\n\n __onDelayedInput?: NonCancelableEventHandler<BaseChangeDetail>;\n __onBlurWithDetail?: NonCancelableEventHandler<{ relatedTarget: Node | null }>;\n\n __inheritFormFieldProps?: boolean;\n __injectAnalyticsComponentMetadata?: boolean;\n __skipNativeAttributesWarnings?: SkipWarnings;\n}\n\nfunction InternalInput(\n {\n type = 'text',\n step,\n inputMode,\n autoComplete = true,\n ariaLabel,\n clearAriaLabel: clearAriaLabelOverride,\n name,\n value,\n placeholder,\n autoFocus,\n disabled,\n readOnly,\n disableBrowserAutocorrect,\n spellcheck,\n __noBorderRadius,\n\n __leftIcon,\n __leftIconVariant = 'subtle',\n __onLeftIconClick,\n\n ariaRequired,\n\n __rightIcon,\n __onRightIconClick,\n\n onKeyDown,\n onKeyUp,\n onChange,\n __onDelayedInput,\n __onBlurWithDetail,\n onBlur,\n onFocus,\n nativeInputAttributes,\n __internalRootRef,\n __inheritFormFieldProps,\n __injectAnalyticsComponentMetadata,\n __skipNativeAttributesWarnings,\n style,\n ...rest\n }: InternalInputProps,\n ref: Ref<HTMLInputElement>\n) {\n const baseProps = getBaseProps(rest);\n const i18n = useInternalI18n('input');\n const fireDelayedInput = useDebounceCallback((value: string) => fireNonCancelableEvent(__onDelayedInput, { value }));\n\n const handleChange = (value: string) => {\n fireDelayedInput(value);\n fireNonCancelableEvent(onChange, { value });\n };\n\n const inputRef = useRef<HTMLInputElement>(null);\n const searchProps = useSearchProps(type, disabled, readOnly, value, inputRef, handleChange);\n __leftIcon = __leftIcon ?? searchProps.__leftIcon;\n __rightIcon = __rightIcon ?? searchProps.__rightIcon;\n __onRightIconClick = __onRightIconClick ?? searchProps.__onRightIconClick;\n\n const formFieldContext = useFormFieldContext(rest);\n const { ariaLabelledby, ariaDescribedby, controlId, invalid, warning } = __inheritFormFieldProps\n ? formFieldContext\n : rest;\n\n const attributes: React.InputHTMLAttributes<HTMLInputElement> = {\n 'aria-label': ariaLabel,\n // aria-labelledby has precedence over aria-label in accessible name calculation.\n // When aria-label is provided for Input, it should override aria-labelledBy from form-field context.\n // If both aria-label and aria-labelledby come from Input props, aria-labelledby will be used in accessible name\n 'aria-labelledby': ariaLabel && !rest.ariaLabelledby ? undefined : ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n name,\n placeholder,\n autoFocus,\n id: controlId,\n className: clsx(\n styles.input,\n type && styles[`input-type-${type}`],\n __rightIcon && styles['input-has-icon-right'],\n __leftIcon && styles['input-has-icon-left'],\n __noBorderRadius && styles['input-has-no-border-radius'],\n {\n [styles['input-readonly']]: readOnly,\n [styles['input-invalid']]: invalid,\n [styles['input-warning']]: warning && !invalid,\n }\n ),\n autoComplete: convertAutoComplete(autoComplete),\n disabled,\n readOnly,\n type,\n step,\n inputMode,\n spellCheck: spellcheck,\n onKeyDown: onKeyDown && (event => fireKeyboardEvent(onKeyDown, event)),\n onKeyUp: onKeyUp && (event => fireKeyboardEvent(onKeyUp, event)),\n // We set a default value on the component in order to force it into the controlled mode.\n value: value ?? '',\n onChange: onChange && (event => handleChange(event.target.value)),\n onBlur: e => {\n fireNonCancelableEvent(onBlur);\n fireNonCancelableEvent(__onBlurWithDetail, { relatedTarget: e.relatedTarget });\n },\n onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),\n };\n\n if (type === 'number') {\n // Chrome and Safari have a weird built-in behavior of letting focused\n // number inputs be controlled by scrolling on them. However, they don't\n // lock the browser's scroll, so it's very easy to accidentally increment\n // the input while scrolling down the page.\n attributes.onWheel = event => event.currentTarget.blur();\n }\n\n if (disableBrowserAutocorrect) {\n attributes.autoCorrect = 'off';\n attributes.autoCapitalize = 'off';\n }\n\n // ensure aria properties are string literal \"true\"\n if (ariaRequired) {\n attributes['aria-required'] = 'true';\n }\n if (invalid) {\n attributes['aria-invalid'] = 'true';\n }\n\n const mergedRef = useMergeRefs(ref, inputRef);\n\n // type = \"visualSearch\" renders a type=\"text' input\n if (attributes.type === 'visualSearch') {\n attributes.type = 'text';\n }\n\n const componentAnalyticsMetadata: GeneratedAnalyticsMetadataInputComponent = {\n name: 'awsui.Input',\n label: 'input',\n properties: {\n value: value || '',\n },\n };\n\n return (\n <div\n {...baseProps}\n className={clsx(baseProps.className, styles['input-container'])}\n ref={__internalRootRef}\n dir={type === 'email' ? 'ltr' : undefined}\n {...(__injectAnalyticsComponentMetadata\n ? getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })\n : copyAnalyticsMetadataAttribute(rest))}\n >\n {__leftIcon && (\n <span onClick={__onLeftIconClick} className={styles['input-icon-left']}>\n <InternalIcon name={__leftIcon} variant={disabled || readOnly ? 'disabled' : __leftIconVariant} />\n </span>\n )}\n <WithNativeAttributes\n {...attributes}\n tag=\"input\"\n componentName=\"Input\"\n nativeAttributes={nativeInputAttributes}\n skipWarnings={__skipNativeAttributesWarnings}\n ref={mergedRef}\n style={getInputStyles(style)}\n />\n {__rightIcon && (\n <span\n className={styles['input-icon-right']}\n {...(__rightIcon === 'close'\n ? getAnalyticsMetadataAttribute({\n action: 'clearInput',\n } as Partial<GeneratedAnalyticsMetadataInputClearInput>)\n : {})}\n >\n <InternalButton\n // Used for test utils\n className={styles['input-button-right']}\n variant=\"inline-icon-pointer-target\"\n formAction=\"none\"\n iconName={__rightIcon}\n onClick={__onRightIconClick}\n ariaLabel={i18n('clearAriaLabel', clearAriaLabelOverride)}\n disabled={disabled}\n />\n </span>\n )}\n </div>\n );\n}\n\nexport default React.forwardRef(InternalInput);\n"]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"input": "
|
|
6
|
-
"input-readonly": "awsui_input-
|
|
7
|
-
"input-invalid": "awsui_input-
|
|
8
|
-
"input-has-icon-left": "awsui_input-has-icon-
|
|
9
|
-
"input-warning": "awsui_input-
|
|
10
|
-
"input-type-search": "awsui_input-type-
|
|
11
|
-
"input-has-icon-right": "awsui_input-has-icon-
|
|
12
|
-
"input-has-no-border-radius": "awsui_input-has-no-border-
|
|
13
|
-
"input-container": "awsui_input-
|
|
14
|
-
"input-icon-left": "awsui_input-icon-
|
|
15
|
-
"input-icon-right": "awsui_input-icon-
|
|
16
|
-
"input-button-right": "awsui_input-button-
|
|
4
|
+
"root": "awsui_root_2rhyz_13ehy_145",
|
|
5
|
+
"input": "awsui_input_2rhyz_13ehy_149",
|
|
6
|
+
"input-readonly": "awsui_input-readonly_2rhyz_13ehy_197",
|
|
7
|
+
"input-invalid": "awsui_input-invalid_2rhyz_13ehy_266",
|
|
8
|
+
"input-has-icon-left": "awsui_input-has-icon-left_2rhyz_13ehy_275",
|
|
9
|
+
"input-warning": "awsui_input-warning_2rhyz_13ehy_278",
|
|
10
|
+
"input-type-search": "awsui_input-type-search_2rhyz_13ehy_290",
|
|
11
|
+
"input-has-icon-right": "awsui_input-has-icon-right_2rhyz_13ehy_303",
|
|
12
|
+
"input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_13ehy_306",
|
|
13
|
+
"input-container": "awsui_input-container_2rhyz_13ehy_313",
|
|
14
|
+
"input-icon-left": "awsui_input-icon-left_2rhyz_13ehy_318",
|
|
15
|
+
"input-icon-right": "awsui_input-icon-right_2rhyz_13ehy_325",
|
|
16
|
+
"input-button-right": "awsui_input-button-right_2rhyz_13ehy_331"
|
|
17
17
|
};
|
|
18
18
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/input/styles.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,kBAiDxD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { SYSTEM } from '../internal/environment';
|
|
4
|
+
import customCssProps from '../internal/generated/custom-css-properties';
|
|
5
|
+
export function getInputStyles(style) {
|
|
6
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
7
|
+
let properties = {};
|
|
8
|
+
if ((style === null || style === void 0 ? void 0 : style.root) && SYSTEM === 'core') {
|
|
9
|
+
properties = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ borderRadius: (_a = style === null || style === void 0 ? void 0 : style.root) === null || _a === void 0 ? void 0 : _a.borderRadius, borderWidth: (_b = style === null || style === void 0 ? void 0 : style.root) === null || _b === void 0 ? void 0 : _b.borderWidth, fontSize: (_c = style === null || style === void 0 ? void 0 : style.root) === null || _c === void 0 ? void 0 : _c.fontSize, fontWeight: (_d = style === null || style === void 0 ? void 0 : style.root) === null || _d === void 0 ? void 0 : _d.fontWeight, paddingBlock: (_e = style === null || style === void 0 ? void 0 : style.root) === null || _e === void 0 ? void 0 : _e.paddingBlock, paddingInline: (_f = style === null || style === void 0 ? void 0 : style.root) === null || _f === void 0 ? void 0 : _f.paddingInline }, (((_g = style === null || style === void 0 ? void 0 : style.root) === null || _g === void 0 ? void 0 : _g.backgroundColor) && {
|
|
10
|
+
[customCssProps.styleBackgroundDefault]: (_h = style.root.backgroundColor) === null || _h === void 0 ? void 0 : _h.default,
|
|
11
|
+
[customCssProps.styleBackgroundDisabled]: (_j = style.root.backgroundColor) === null || _j === void 0 ? void 0 : _j.disabled,
|
|
12
|
+
[customCssProps.styleBackgroundHover]: (_k = style.root.backgroundColor) === null || _k === void 0 ? void 0 : _k.hover,
|
|
13
|
+
[customCssProps.styleBackgroundFocus]: (_l = style.root.backgroundColor) === null || _l === void 0 ? void 0 : _l.focus,
|
|
14
|
+
[customCssProps.styleBackgroundReadonly]: (_m = style.root.backgroundColor) === null || _m === void 0 ? void 0 : _m.readonly,
|
|
15
|
+
})), (((_o = style === null || style === void 0 ? void 0 : style.root) === null || _o === void 0 ? void 0 : _o.borderColor) && {
|
|
16
|
+
[customCssProps.styleBorderColorDefault]: (_p = style.root.borderColor) === null || _p === void 0 ? void 0 : _p.default,
|
|
17
|
+
[customCssProps.styleBorderColorDisabled]: (_q = style.root.borderColor) === null || _q === void 0 ? void 0 : _q.disabled,
|
|
18
|
+
[customCssProps.styleBorderColorHover]: (_r = style.root.borderColor) === null || _r === void 0 ? void 0 : _r.hover,
|
|
19
|
+
[customCssProps.styleBorderColorFocus]: (_s = style.root.borderColor) === null || _s === void 0 ? void 0 : _s.focus,
|
|
20
|
+
[customCssProps.styleBorderColorReadonly]: (_t = style.root.borderColor) === null || _t === void 0 ? void 0 : _t.readonly,
|
|
21
|
+
})), (((_u = style === null || style === void 0 ? void 0 : style.root) === null || _u === void 0 ? void 0 : _u.boxShadow) && {
|
|
22
|
+
[customCssProps.styleBoxShadowDefault]: (_v = style.root.boxShadow) === null || _v === void 0 ? void 0 : _v.default,
|
|
23
|
+
[customCssProps.styleBoxShadowDisabled]: (_w = style.root.boxShadow) === null || _w === void 0 ? void 0 : _w.disabled,
|
|
24
|
+
[customCssProps.styleBoxShadowHover]: (_x = style.root.boxShadow) === null || _x === void 0 ? void 0 : _x.hover,
|
|
25
|
+
[customCssProps.styleBoxShadowFocus]: (_y = style.root.boxShadow) === null || _y === void 0 ? void 0 : _y.focus,
|
|
26
|
+
[customCssProps.styleBoxShadowReadonly]: (_z = style.root.boxShadow) === null || _z === void 0 ? void 0 : _z.readonly,
|
|
27
|
+
})), (((_0 = style === null || style === void 0 ? void 0 : style.root) === null || _0 === void 0 ? void 0 : _0.color) && {
|
|
28
|
+
[customCssProps.styleColorDefault]: (_1 = style.root.color) === null || _1 === void 0 ? void 0 : _1.default,
|
|
29
|
+
[customCssProps.styleColorDisabled]: (_2 = style.root.color) === null || _2 === void 0 ? void 0 : _2.disabled,
|
|
30
|
+
[customCssProps.styleColorHover]: (_3 = style.root.color) === null || _3 === void 0 ? void 0 : _3.hover,
|
|
31
|
+
[customCssProps.styleColorFocus]: (_4 = style.root.color) === null || _4 === void 0 ? void 0 : _4.focus,
|
|
32
|
+
[customCssProps.styleColorReadonly]: (_5 = style.root.color) === null || _5 === void 0 ? void 0 : _5.readonly,
|
|
33
|
+
})), ((style === null || style === void 0 ? void 0 : style.placeholder) && {
|
|
34
|
+
[customCssProps.stylePlaceholderColor]: (_6 = style.placeholder) === null || _6 === void 0 ? void 0 : _6.color,
|
|
35
|
+
[customCssProps.stylePlaceholderFontSize]: (_7 = style.placeholder) === null || _7 === void 0 ? void 0 : _7.fontSize,
|
|
36
|
+
[customCssProps.stylePlaceholderFontWeight]: (_8 = style.placeholder) === null || _8 === void 0 ? void 0 : _8.fontWeight,
|
|
37
|
+
[customCssProps.stylePlaceholderFontStyle]: (_9 = style.placeholder) === null || _9 === void 0 ? void 0 : _9.fontStyle,
|
|
38
|
+
}));
|
|
39
|
+
return properties;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/input/styles.ts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AAK,CAAC,IAAI,CAAC,SAAS,0CAAE,QAAQ;SACxE,CAAC,GACC,CAAC,CAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,0CAAE,KAAK,KAAI;YACxB,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,MAAA,KAAK,CAAC,IAAI,CAAC,KAAK,0CAAE,OAAO;YAC7D,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,MAAA,KAAK,CAAC,IAAI,CAAC,KAAK,0CAAE,QAAQ;YAC/D,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,MAAA,KAAK,CAAC,IAAI,CAAC,KAAK,0CAAE,KAAK;YACzD,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,MAAA,KAAK,CAAC,IAAI,CAAC,KAAK,0CAAE,KAAK;YACzD,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,MAAA,KAAK,CAAC,IAAI,CAAC,KAAK,0CAAE,QAAQ;SAChE,CAAC,GACC,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,KAAI;YACxB,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,MAAA,KAAK,CAAC,WAAW,0CAAE,KAAK;YAChE,CAAC,cAAc,CAAC,wBAAwB,CAAC,EAAE,MAAA,KAAK,CAAC,WAAW,0CAAE,QAAQ;YACtE,CAAC,cAAc,CAAC,0BAA0B,CAAC,EAAE,MAAA,KAAK,CAAC,WAAW,0CAAE,UAAU;YAC1E,CAAC,cAAc,CAAC,yBAAyB,CAAC,EAAE,MAAA,KAAK,CAAC,WAAW,0CAAE,SAAS;SACzE,CAAC,CACH,CAAC;QAEF,OAAO,UAAU,CAAC;KACnB;AACH,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 { InputProps } from './interfaces';\n\nexport function getInputStyles(style: InputProps['style']) {\n let properties = {};\n\n if (style?.root && SYSTEM === 'core') {\n 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 ...(style?.root?.backgroundColor && {\n [customCssProps.styleBackgroundDefault]: style.root.backgroundColor?.default,\n [customCssProps.styleBackgroundDisabled]: style.root.backgroundColor?.disabled,\n [customCssProps.styleBackgroundHover]: style.root.backgroundColor?.hover,\n [customCssProps.styleBackgroundFocus]: style.root.backgroundColor?.focus,\n [customCssProps.styleBackgroundReadonly]: style.root.backgroundColor?.readonly,\n }),\n ...(style?.root?.borderColor && {\n [customCssProps.styleBorderColorDefault]: style.root.borderColor?.default,\n [customCssProps.styleBorderColorDisabled]: style.root.borderColor?.disabled,\n [customCssProps.styleBorderColorHover]: style.root.borderColor?.hover,\n [customCssProps.styleBorderColorFocus]: style.root.borderColor?.focus,\n [customCssProps.styleBorderColorReadonly]: style.root.borderColor?.readonly,\n }),\n ...(style?.root?.boxShadow && {\n [customCssProps.styleBoxShadowDefault]: style.root.boxShadow?.default,\n [customCssProps.styleBoxShadowDisabled]: style.root.boxShadow?.disabled,\n [customCssProps.styleBoxShadowHover]: style.root.boxShadow?.hover,\n [customCssProps.styleBoxShadowFocus]: style.root.boxShadow?.focus,\n [customCssProps.styleBoxShadowReadonly]: style.root.boxShadow?.readonly,\n }),\n ...(style?.root?.color && {\n [customCssProps.styleColorDefault]: style.root.color?.default,\n [customCssProps.styleColorDisabled]: style.root.color?.disabled,\n [customCssProps.styleColorHover]: style.root.color?.hover,\n [customCssProps.styleColorFocus]: style.root.color?.focus,\n [customCssProps.styleColorReadonly]: style.root.color?.readonly,\n }),\n ...(style?.placeholder && {\n [customCssProps.stylePlaceholderColor]: style.placeholder?.color,\n [customCssProps.stylePlaceholderFontSize]: style.placeholder?.fontSize,\n [customCssProps.stylePlaceholderFontWeight]: style.placeholder?.fontWeight,\n [customCssProps.stylePlaceholderFontStyle]: style.placeholder?.fontStyle,\n }),\n };\n\n return properties;\n }\n}\n"]}
|
|
@@ -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
|
-
.
|
|
145
|
+
.awsui_root_2rhyz_13ehy_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
|
-
.
|
|
149
|
+
.awsui_input_2rhyz_13ehy_149:not(#\9) {
|
|
150
150
|
border-collapse: separate;
|
|
151
151
|
border-spacing: 0;
|
|
152
152
|
box-sizing: border-box;
|
|
@@ -178,141 +178,158 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
178
178
|
-moz-osx-font-smoothing: auto;
|
|
179
179
|
padding-block: var(--space-scaled-xxs-jatbiv, 4px);
|
|
180
180
|
padding-inline: var(--space-field-horizontal-n5peob, 8px);
|
|
181
|
-
color: var(--color-text-body-default-5qid0u, #16191f);
|
|
181
|
+
color: var(--awsui-style-color-default-b75yp7, var(--color-text-body-default-5qid0u, #16191f));
|
|
182
182
|
inline-size: 100%;
|
|
183
183
|
cursor: text;
|
|
184
184
|
box-sizing: border-box;
|
|
185
|
-
background-color: var(--color-background-input-default-1z2buq, #ffffff);
|
|
185
|
+
background-color: var(--awsui-style-background-default-b75yp7, var(--color-background-input-default-1z2buq, #ffffff));
|
|
186
186
|
border-start-start-radius: var(--border-radius-input-4vr9on, 2px);
|
|
187
187
|
border-start-end-radius: var(--border-radius-input-4vr9on, 2px);
|
|
188
188
|
border-end-start-radius: var(--border-radius-input-4vr9on, 2px);
|
|
189
189
|
border-end-end-radius: var(--border-radius-input-4vr9on, 2px);
|
|
190
|
-
border-block: var(--border-width-field-9k1tdz, 1px) solid var(--color-border-input-default-txli8y, #687078);
|
|
191
|
-
border-inline: var(--border-width-field-9k1tdz, 1px) solid var(--color-border-input-default-txli8y, #687078);
|
|
190
|
+
border-block: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-default-b75yp7, var(--color-border-input-default-txli8y, #687078));
|
|
191
|
+
border-inline: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-default-b75yp7, var(--color-border-input-default-txli8y, #687078));
|
|
192
|
+
box-shadow: var(--awsui-style-box-shadow-default-b75yp7);
|
|
192
193
|
font-size: var(--font-size-body-m-vv54cm, 14px);
|
|
193
194
|
line-height: var(--line-height-body-m-bedeoh, 22px);
|
|
194
195
|
block-size: var(--size-vertical-input-8gzd1t, 32px);
|
|
195
196
|
}
|
|
196
|
-
.
|
|
197
|
-
background-color: var(--color-background-input-default-1z2buq, #ffffff);
|
|
198
|
-
border-block: var(--border-width-field-9k1tdz, 1px) solid var(--color-border-input-disabled-tz38ro, #eaeded);
|
|
199
|
-
border-inline: var(--border-width-field-9k1tdz, 1px) solid var(--color-border-input-disabled-tz38ro, #eaeded);
|
|
197
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-readonly_2rhyz_13ehy_197:not(#\9) {
|
|
198
|
+
background-color: var(--awsui-style-background-readonly-b75yp7, var(--awsui-style-background-default-b75yp7, var(--color-background-input-default-1z2buq, #ffffff)));
|
|
199
|
+
border-block: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-readonly-b75yp7, var(--awsui-style-border-color-default-b75yp7, var(--color-border-input-disabled-tz38ro, #eaeded)));
|
|
200
|
+
border-inline: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-readonly-b75yp7, var(--awsui-style-border-color-default-b75yp7, var(--color-border-input-disabled-tz38ro, #eaeded)));
|
|
201
|
+
color: var(--awsui-style-color-readonly-b75yp7, var(--awsui-style-color-default-b75yp7, var(--color-text-body-default-5qid0u, #16191f)));
|
|
202
|
+
box-shadow: var(--awsui-style-box-shadow-readonly-b75yp7);
|
|
200
203
|
}
|
|
201
|
-
.
|
|
202
|
-
color: var(--color-text-input-placeholder-hvcry0, #687078);
|
|
203
|
-
font-
|
|
204
|
+
.awsui_input_2rhyz_13ehy_149:not(#\9)::-webkit-input-placeholder {
|
|
205
|
+
color: var(--awsui-style-placeholder-color-b75yp7, var(--color-text-input-placeholder-hvcry0, #687078));
|
|
206
|
+
font-size: var(--awsui-style-placeholder-font-size-b75yp7);
|
|
207
|
+
font-style: var(--awsui-style-placeholder-font-style-b75yp7, italic);
|
|
208
|
+
font-weight: var(--awsui-style-placeholder-font-weight-b75yp7);
|
|
204
209
|
-webkit-user-select: none;
|
|
205
210
|
user-select: none;
|
|
206
211
|
}
|
|
207
|
-
.
|
|
208
|
-
color: var(--color-text-input-placeholder-hvcry0, #687078);
|
|
209
|
-
font-
|
|
212
|
+
.awsui_input_2rhyz_13ehy_149:not(#\9)::-moz-placeholder {
|
|
213
|
+
color: var(--awsui-style-placeholder-color-b75yp7, var(--color-text-input-placeholder-hvcry0, #687078));
|
|
214
|
+
font-size: var(--awsui-style-placeholder-font-size-b75yp7);
|
|
215
|
+
font-style: var(--awsui-style-placeholder-font-style-b75yp7, italic);
|
|
216
|
+
font-weight: var(--awsui-style-placeholder-font-weight-b75yp7);
|
|
210
217
|
opacity: 1;
|
|
211
218
|
}
|
|
212
|
-
.
|
|
213
|
-
color: var(--color-text-input-placeholder-hvcry0, #687078);
|
|
214
|
-
font-
|
|
219
|
+
.awsui_input_2rhyz_13ehy_149:not(#\9):-moz-placeholder {
|
|
220
|
+
color: var(--awsui-style-placeholder-color-b75yp7, var(--color-text-input-placeholder-hvcry0, #687078));
|
|
221
|
+
font-size: var(--awsui-style-placeholder-font-size-b75yp7);
|
|
222
|
+
font-style: var(--awsui-style-placeholder-font-style-b75yp7, italic);
|
|
223
|
+
font-weight: var(--awsui-style-placeholder-font-weight-b75yp7);
|
|
215
224
|
opacity: 1;
|
|
216
225
|
}
|
|
217
|
-
.
|
|
226
|
+
.awsui_input_2rhyz_13ehy_149:not(#\9):focus {
|
|
218
227
|
outline: 2px dotted transparent;
|
|
219
|
-
border-block: var(--border-width-field-9k1tdz, 1px) solid var(--color-border-input-focused-lslq4r, #0073bb);
|
|
220
|
-
border-inline: var(--border-width-field-9k1tdz, 1px) solid var(--color-border-input-focused-lslq4r, #0073bb);
|
|
228
|
+
border-block: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-focus-b75yp7, var(--color-border-input-focused-lslq4r, #0073bb));
|
|
229
|
+
border-inline: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-focus-b75yp7, var(--color-border-input-focused-lslq4r, #0073bb));
|
|
221
230
|
border-start-start-radius: var(--border-radius-input-4vr9on, 2px);
|
|
222
231
|
border-start-end-radius: var(--border-radius-input-4vr9on, 2px);
|
|
223
232
|
border-end-start-radius: var(--border-radius-input-4vr9on, 2px);
|
|
224
233
|
border-end-end-radius: var(--border-radius-input-4vr9on, 2px);
|
|
225
|
-
box-shadow: 0 0 0 var(--border-control-focus-ring-shadow-spread-ql2vj7, 1px) var(--color-border-item-focused-r5f6xl, #0073bb);
|
|
234
|
+
box-shadow: var(--awsui-style-box-shadow-focus-b75yp7, 0 0 0 var(--border-control-focus-ring-shadow-spread-ql2vj7, 1px) var(--color-border-item-focused-r5f6xl, #0073bb));
|
|
235
|
+
color: var(--awsui-style-color-focus-b75yp7, var(--color-text-body-default-5qid0u, #16191f));
|
|
236
|
+
background-color: var(--awsui-style-background-focus-b75yp7, var(--color-background-input-default-1z2buq, #ffffff));
|
|
226
237
|
}
|
|
227
|
-
.
|
|
228
|
-
background-color: var(--color-background-input-disabled-4vlau3, #eaeded);
|
|
229
|
-
border-block: var(--border-width-field-9k1tdz, 1px) solid var(--color-border-input-disabled-tz38ro, #eaeded);
|
|
230
|
-
border-inline: var(--border-width-field-9k1tdz, 1px) solid var(--color-border-input-disabled-tz38ro, #eaeded);
|
|
231
|
-
color: var(--color-text-input-disabled-y5t5v9, #879596);
|
|
232
|
-
cursor: auto;
|
|
238
|
+
.awsui_input_2rhyz_13ehy_149:not(#\9):disabled {
|
|
239
|
+
background-color: var(--awsui-style-background-disabled-b75yp7, var(--color-background-input-disabled-4vlau3, #eaeded));
|
|
240
|
+
border-block: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-disabled-b75yp7, var(--color-border-input-disabled-tz38ro, #eaeded));
|
|
241
|
+
border-inline: var(--border-width-field-9k1tdz, 1px) solid var(--awsui-style-border-color-disabled-b75yp7, var(--color-border-input-disabled-tz38ro, #eaeded));
|
|
242
|
+
color: var(--awsui-style-color-disabled-b75yp7, var(--color-text-input-disabled-y5t5v9, #879596));
|
|
233
243
|
cursor: default;
|
|
244
|
+
box-shadow: var(--awsui-style-box-shadow-disabled-b75yp7);
|
|
234
245
|
}
|
|
235
|
-
.
|
|
246
|
+
.awsui_input_2rhyz_13ehy_149:not(#\9):disabled::-webkit-input-placeholder {
|
|
236
247
|
color: var(--color-text-input-placeholder-disabled-x4lauf, #687078);
|
|
237
248
|
-webkit-user-select: none;
|
|
238
249
|
user-select: none;
|
|
239
250
|
}
|
|
240
|
-
.
|
|
251
|
+
.awsui_input_2rhyz_13ehy_149:not(#\9):disabled::-moz-placeholder {
|
|
241
252
|
color: var(--color-text-input-placeholder-disabled-x4lauf, #687078);
|
|
242
253
|
opacity: 1;
|
|
243
254
|
}
|
|
244
|
-
.
|
|
255
|
+
.awsui_input_2rhyz_13ehy_149:not(#\9):disabled:-moz-placeholder {
|
|
245
256
|
color: var(--color-text-input-placeholder-disabled-x4lauf, #687078);
|
|
246
257
|
opacity: 1;
|
|
247
258
|
}
|
|
248
|
-
.
|
|
259
|
+
.awsui_input_2rhyz_13ehy_149:not(#\9):invalid {
|
|
249
260
|
box-shadow: none;
|
|
250
261
|
}
|
|
251
|
-
.
|
|
262
|
+
.awsui_input_2rhyz_13ehy_149:not(#\9):hover:not(:focus):not(:disabled):not(.awsui_input-readonly_2rhyz_13ehy_197) {
|
|
263
|
+
border-color: var(--awsui-style-border-color-hover-b75yp7, var(--awsui-style-border-color-default-b75yp7, var(--color-border-input-default-txli8y, #687078)));
|
|
264
|
+
color: var(--awsui-style-color-hover-b75yp7, var(--awsui-style-border-color-default-b75yp7, var(--color-text-body-default-5qid0u, #16191f)));
|
|
265
|
+
background-color: var(--awsui-style-background-hover-b75yp7, var(--awsui-style-background-default-b75yp7, var(--color-background-input-default-1z2buq, #ffffff)));
|
|
266
|
+
box-shadow: var(--awsui-style-box-shadow-hover-b75yp7, --awsui-style-box-shadow-default-b75yp7);
|
|
267
|
+
}
|
|
268
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-invalid_2rhyz_13ehy_266:not(#\9) {
|
|
252
269
|
color: var(--color-text-status-error-aknuvu, #d13212);
|
|
253
270
|
border-color: var(--color-text-status-error-aknuvu, #d13212);
|
|
254
271
|
padding-inline-start: calc(var(--space-field-horizontal-n5peob, 8px) - (var(--border-invalid-width-z5cnpo, 4px) - var(--border-width-field-9k1tdz, 1px)));
|
|
255
272
|
border-inline-start-width: var(--border-invalid-width-z5cnpo, 4px);
|
|
256
273
|
}
|
|
257
|
-
.
|
|
274
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-invalid_2rhyz_13ehy_266:not(#\9):focus {
|
|
258
275
|
box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-t0us6n, 1px) var(--color-border-item-focused-r5f6xl, #0073bb);
|
|
259
276
|
}
|
|
260
|
-
.
|
|
277
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-invalid_2rhyz_13ehy_266.awsui_input-has-icon-left_2rhyz_13ehy_275:not(#\9) {
|
|
261
278
|
padding-inline-start: calc(var(--space-field-icon-offset-ihoxql, 32px) - (var(--border-invalid-width-z5cnpo, 4px) - var(--border-width-field-9k1tdz, 1px)));
|
|
262
279
|
}
|
|
263
|
-
.
|
|
280
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-warning_2rhyz_13ehy_278:not(#\9) {
|
|
264
281
|
color: var(--color-text-status-warning-9b45qh, #906806);
|
|
265
282
|
border-color: var(--color-text-status-warning-9b45qh, #906806);
|
|
266
283
|
padding-inline-start: calc(var(--space-field-horizontal-n5peob, 8px) - (var(--border-invalid-width-z5cnpo, 4px) - var(--border-width-field-9k1tdz, 1px)));
|
|
267
284
|
border-inline-start-width: var(--border-invalid-width-z5cnpo, 4px);
|
|
268
285
|
}
|
|
269
|
-
.
|
|
286
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-warning_2rhyz_13ehy_278:not(#\9):focus {
|
|
270
287
|
box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-t0us6n, 1px) var(--color-border-item-focused-r5f6xl, #0073bb);
|
|
271
288
|
}
|
|
272
|
-
.
|
|
289
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-warning_2rhyz_13ehy_278.awsui_input-has-icon-left_2rhyz_13ehy_275:not(#\9) {
|
|
273
290
|
padding-inline-start: calc(var(--space-field-icon-offset-ihoxql, 32px) - (var(--border-invalid-width-z5cnpo, 4px) - var(--border-width-field-9k1tdz, 1px)));
|
|
274
291
|
}
|
|
275
|
-
.
|
|
292
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-type-search_2rhyz_13ehy_290:not(#\9) {
|
|
276
293
|
box-sizing: border-box;
|
|
277
294
|
-webkit-appearance: none;
|
|
278
295
|
}
|
|
279
|
-
.
|
|
296
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-type-search_2rhyz_13ehy_290:not(#\9)::-webkit-search-decoration {
|
|
280
297
|
-webkit-appearance: none;
|
|
281
298
|
}
|
|
282
|
-
.
|
|
299
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-type-search_2rhyz_13ehy_290:not(#\9)::-webkit-search-cancel-button {
|
|
283
300
|
display: none;
|
|
284
301
|
}
|
|
285
|
-
.
|
|
302
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-has-icon-left_2rhyz_13ehy_275:not(#\9) {
|
|
286
303
|
padding-inline-start: var(--space-field-icon-offset-ihoxql, 32px);
|
|
287
304
|
}
|
|
288
|
-
.
|
|
305
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-has-icon-right_2rhyz_13ehy_303:not(#\9) {
|
|
289
306
|
padding-inline-end: var(--space-field-icon-offset-ihoxql, 32px);
|
|
290
307
|
}
|
|
291
|
-
.
|
|
308
|
+
.awsui_input_2rhyz_13ehy_149.awsui_input-has-no-border-radius_2rhyz_13ehy_306:not(#\9) {
|
|
292
309
|
border-start-start-radius: var(--border-radius-dropdown-oaxffg, 0px);
|
|
293
310
|
border-start-end-radius: var(--border-radius-dropdown-oaxffg, 0px);
|
|
294
311
|
border-end-start-radius: var(--border-radius-dropdown-oaxffg, 0px);
|
|
295
312
|
border-end-end-radius: var(--border-radius-dropdown-oaxffg, 0px);
|
|
296
313
|
}
|
|
297
314
|
|
|
298
|
-
.awsui_input-
|
|
315
|
+
.awsui_input-container_2rhyz_13ehy_313:not(#\9) {
|
|
299
316
|
display: flex;
|
|
300
317
|
position: relative;
|
|
301
318
|
}
|
|
302
319
|
|
|
303
|
-
.awsui_input-icon-
|
|
320
|
+
.awsui_input-icon-left_2rhyz_13ehy_318:not(#\9) {
|
|
304
321
|
position: absolute;
|
|
305
322
|
pointer-events: none;
|
|
306
323
|
inset-inline-start: var(--space-field-horizontal-n5peob, 8px);
|
|
307
324
|
inset-block-start: calc(50% - var(--line-height-body-m-bedeoh, 22px) / 2);
|
|
308
325
|
}
|
|
309
326
|
|
|
310
|
-
.awsui_input-icon-
|
|
327
|
+
.awsui_input-icon-right_2rhyz_13ehy_325:not(#\9) {
|
|
311
328
|
position: absolute;
|
|
312
329
|
inset-block-start: calc(calc(50% - var(--line-height-body-m-bedeoh, 22px) / 2) - var(--space-xxxs-3w1kr2, 2px));
|
|
313
330
|
inset-inline-end: calc(var(--space-field-horizontal-n5peob, 8px) - var(--space-xxs-jnczic, 4px));
|
|
314
331
|
}
|
|
315
332
|
|
|
316
|
-
.awsui_input-button-
|
|
333
|
+
.awsui_input-button-right_2rhyz_13ehy_331:not(#\9) {
|
|
317
334
|
/* used in test-utils */
|
|
318
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": "
|
|
6
|
-
"input": "
|
|
7
|
-
"input-readonly": "awsui_input-
|
|
8
|
-
"input-invalid": "awsui_input-
|
|
9
|
-
"input-has-icon-left": "awsui_input-has-icon-
|
|
10
|
-
"input-warning": "awsui_input-
|
|
11
|
-
"input-type-search": "awsui_input-type-
|
|
12
|
-
"input-has-icon-right": "awsui_input-has-icon-
|
|
13
|
-
"input-has-no-border-radius": "awsui_input-has-no-border-
|
|
14
|
-
"input-container": "awsui_input-
|
|
15
|
-
"input-icon-left": "awsui_input-icon-
|
|
16
|
-
"input-icon-right": "awsui_input-icon-
|
|
17
|
-
"input-button-right": "awsui_input-button-
|
|
5
|
+
"root": "awsui_root_2rhyz_13ehy_145",
|
|
6
|
+
"input": "awsui_input_2rhyz_13ehy_149",
|
|
7
|
+
"input-readonly": "awsui_input-readonly_2rhyz_13ehy_197",
|
|
8
|
+
"input-invalid": "awsui_input-invalid_2rhyz_13ehy_266",
|
|
9
|
+
"input-has-icon-left": "awsui_input-has-icon-left_2rhyz_13ehy_275",
|
|
10
|
+
"input-warning": "awsui_input-warning_2rhyz_13ehy_278",
|
|
11
|
+
"input-type-search": "awsui_input-type-search_2rhyz_13ehy_290",
|
|
12
|
+
"input-has-icon-right": "awsui_input-has-icon-right_2rhyz_13ehy_303",
|
|
13
|
+
"input-has-no-border-radius": "awsui_input-has-no-border-radius_2rhyz_13ehy_306",
|
|
14
|
+
"input-container": "awsui_input-container_2rhyz_13ehy_313",
|
|
15
|
+
"input-icon-left": "awsui_input-icon-left_2rhyz_13ehy_318",
|
|
16
|
+
"input-icon-right": "awsui_input-icon-right_2rhyz_13ehy_325",
|
|
17
|
+
"input-button-right": "awsui_input-button-right_2rhyz_13ehy_331"
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -6,6 +6,7 @@ interface AnalyticsFunnelProps {
|
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
stepConfiguration?: StepConfiguration[];
|
|
8
8
|
funnelNameSelectors?: () => string[];
|
|
9
|
+
componentSelectors?: () => string[];
|
|
9
10
|
funnelType: FunnelStartProps['funnelType'];
|
|
10
11
|
optionalStepNumbers: FunnelStartProps['optionalStepNumbers'];
|
|
11
12
|
totalFunnelSteps: FunnelStartProps['totalFunnelSteps'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics-funnel.d.ts","sourceRoot":"","sources":["../../../../../src/internal/analytics/components/analytics-funnel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAQvE,OAAO,EAKL,sBAAsB,EAEtB,yBAAyB,EAC1B,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EAGlB,MAAM,eAAe,CAAC;AAavB,UAAU,oBAAoB;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACxC,mBAAmB,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;IACrC,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC3C,mBAAmB,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;IAC7D,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;IACvD,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAC3D,cAAc,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC/C,kBAAkB,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACvD,kBAAkB,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,eAAe,UAAW,oBAAoB,gBAa1D,CAAC;AAEF,eAAO,MAAM,kCAAkC,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"analytics-funnel.d.ts","sourceRoot":"","sources":["../../../../../src/internal/analytics/components/analytics-funnel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAQvE,OAAO,EAKL,sBAAsB,EAEtB,yBAAyB,EAC1B,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EAGlB,MAAM,eAAe,CAAC;AAavB,UAAU,oBAAoB;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACxC,mBAAmB,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,MAAM,EAAE,CAAC;IACpC,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC3C,mBAAmB,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,CAAC;IAC7D,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;IACvD,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAC3D,cAAc,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC/C,kBAAkB,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACvD,kBAAkB,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;CACxD;AAED,eAAO,MAAM,eAAe,UAAW,oBAAoB,gBAa1D,CAAC;AAEF,eAAO,MAAM,kCAAkC,kCAAkC,CAAC;AAoOlF,UAAU,wBAAwB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IACzD,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,sBAAsB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAClF,gBAAgB,CAAC,EAAE,eAAe,CAAC,kBAAkB,CAAC,CAAC;IACvD,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;CAC3C;AAED,eAAO,MAAM,mBAAmB,UAAW,wBAAwB,gBAMlE,CAAC;AAoOF,UAAU,2BAA2B;IACnC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAC5D,mBAAmB,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACxD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,yBAAyB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;CACtF;AAED,eAAO,MAAM,sBAAsB,0DAIhC,2BAA2B,gBAmG7B,CAAC"}
|
|
@@ -62,6 +62,7 @@ const InnerAnalyticsFunnel = (_a) => {
|
|
|
62
62
|
const isVisualRefresh = useVisualRefresh();
|
|
63
63
|
const funnelState = useRef('default');
|
|
64
64
|
const funnelNameSelector = useRef(getFunnelNameSelector());
|
|
65
|
+
const componentSelector = useRef();
|
|
65
66
|
const errorCount = useRef(0);
|
|
66
67
|
const loadingButtonCount = useRef(0);
|
|
67
68
|
const wizardCount = useRef(0);
|
|
@@ -88,14 +89,15 @@ const InnerAnalyticsFunnel = (_a) => {
|
|
|
88
89
|
*/
|
|
89
90
|
let funnelInteractionId;
|
|
90
91
|
const handle = setTimeout(() => {
|
|
91
|
-
var _a, _b;
|
|
92
|
+
var _a, _b, _c;
|
|
92
93
|
funnelNameSelector.current = evaluateSelectors(((_a = props.funnelNameSelectors) === null || _a === void 0 ? void 0 : _a.call(props)) || [], getFunnelNameSelector());
|
|
94
|
+
componentSelector.current = evaluateSelectors(((_b = props.componentSelectors) === null || _b === void 0 ? void 0 : _b.call(props)) || [], '');
|
|
93
95
|
if (props.funnelType === 'single-page' && wizardCount.current > 0) {
|
|
94
96
|
return;
|
|
95
97
|
}
|
|
96
98
|
// Reset the state, in case the component was re-mounted.
|
|
97
99
|
funnelState.current = 'default';
|
|
98
|
-
const funnelName = (
|
|
100
|
+
const funnelName = (_c = getTextFromSelector(funnelNameSelector.current)) !== null && _c !== void 0 ? _c : '';
|
|
99
101
|
const singleStepFlowStepConfiguration = [
|
|
100
102
|
{
|
|
101
103
|
number: 1,
|
|
@@ -114,6 +116,7 @@ const InnerAnalyticsFunnel = (_a) => {
|
|
|
114
116
|
funnelIdentifier: props.funnelIdentifier,
|
|
115
117
|
flowType: props.funnelFlowType,
|
|
116
118
|
funnelNameSelector: funnelNameSelector.current,
|
|
119
|
+
componentSelector: componentSelector.current,
|
|
117
120
|
optionalStepNumbers: props.optionalStepNumbers,
|
|
118
121
|
funnelType: props.funnelType,
|
|
119
122
|
totalFunnelSteps: props.totalFunnelSteps,
|