@cloudscape-design/components 3.0.775 → 3.0.776

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 (48) hide show
  1. package/internal/components/tooltip/index.d.ts +2 -1
  2. package/internal/components/tooltip/index.d.ts.map +1 -1
  3. package/internal/components/tooltip/index.js +2 -2
  4. package/internal/components/tooltip/index.js.map +1 -1
  5. package/internal/environment.js +1 -1
  6. package/internal/environment.json +1 -1
  7. package/internal/manifest.json +1 -1
  8. package/package.json +1 -1
  9. package/popover/container.d.ts +2 -1
  10. package/popover/container.d.ts.map +1 -1
  11. package/popover/container.js +5 -4
  12. package/popover/container.js.map +1 -1
  13. package/popover/interfaces.d.ts +4 -0
  14. package/popover/interfaces.d.ts.map +1 -1
  15. package/popover/interfaces.js.map +1 -1
  16. package/popover/use-popover-position.d.ts +3 -1
  17. package/popover/use-popover-position.d.ts.map +1 -1
  18. package/popover/use-popover-position.js +21 -5
  19. package/popover/use-popover-position.js.map +1 -1
  20. package/popover/utils/positions.d.ts +2 -1
  21. package/popover/utils/positions.d.ts.map +1 -1
  22. package/popover/utils/positions.js +6 -0
  23. package/popover/utils/positions.js.map +1 -1
  24. package/prompt-input/interfaces.d.ts +16 -0
  25. package/prompt-input/interfaces.d.ts.map +1 -1
  26. package/prompt-input/interfaces.js.map +1 -1
  27. package/prompt-input/internal.d.ts.map +1 -1
  28. package/prompt-input/internal.js +28 -11
  29. package/prompt-input/internal.js.map +1 -1
  30. package/prompt-input/styles.css.js +14 -8
  31. package/prompt-input/styles.scoped.css +264 -68
  32. package/prompt-input/styles.selectors.js +14 -8
  33. package/prompt-input/test-classes/styles.css.js +5 -3
  34. package/prompt-input/test-classes/styles.scoped.css +11 -3
  35. package/prompt-input/test-classes/styles.selectors.js +5 -3
  36. package/select/parts/item.d.ts.map +1 -1
  37. package/select/parts/item.js +1 -1
  38. package/select/parts/item.js.map +1 -1
  39. package/select/parts/multiselect-item.d.ts.map +1 -1
  40. package/select/parts/multiselect-item.js +1 -1
  41. package/select/parts/multiselect-item.js.map +1 -1
  42. package/test-utils/dom/prompt-input/index.d.ts +2 -0
  43. package/test-utils/dom/prompt-input/index.js +6 -0
  44. package/test-utils/dom/prompt-input/index.js.map +1 -1
  45. package/test-utils/selectors/prompt-input/index.d.ts +2 -0
  46. package/test-utils/selectors/prompt-input/index.js +6 -0
  47. package/test-utils/selectors/prompt-input/index.js.map +1 -1
  48. package/test-utils/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/prompt-input/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { IconProps } from '../icon/interfaces';\nimport {\n BaseChangeDetail,\n BaseInputProps,\n InputAutoComplete,\n InputAutoCorrect,\n InputKeyEvents,\n InputSpellcheck,\n} from '../input/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { BaseKeyDetail, NonCancelableEventHandler } from '../internal/events';\n\nexport interface PromptInputProps\n extends BaseInputProps,\n InputKeyEvents,\n InputAutoCorrect,\n InputAutoComplete,\n InputSpellcheck,\n BaseComponentProps,\n FormFieldValidationControlProps {\n /**\n * Called whenever a user clicks the action button or presses the \"Enter\" key.\n * The event `detail` contains the current value of the field.\n */\n onAction?: NonCancelableEventHandler<PromptInputProps.ActionDetail>;\n /**\n * Determines what icon to display in the action button.\n */\n actionButtonIconName?: IconProps.Name;\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n *\n * If you set both `actionButtonIconUrl` and `actionButtonIconSvg`, `actionButtonIconSvg` will take precedence.\n */\n actionButtonIconUrl?: string;\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `actionButtonIconUrl` and `actionButtonIconSvg`, `iconSvg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n actionButtonIconSvg?: React.ReactNode;\n /**\n * Specifies alternate text for a custom icon. We recommend that you provide this for accessibility.\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `iconSvg` slot.\n */\n actionButtonIconAlt?: string;\n /**\n * Adds an aria-label to the action button.\n * @i18n\n */\n actionButtonAriaLabel?: string;\n\n /**\n * Specifies whether to disable the action button.\n */\n disableActionButton?: boolean;\n\n /**\n * Specifies the minimum number of lines of text to set the height to.\n */\n minRows?: number;\n\n /**\n * Specifies the maximum number of lines of text the textarea will expand to.\n */\n maxRows?: number;\n}\n\nexport namespace PromptInputProps {\n export type KeyDetail = BaseKeyDetail;\n export type ActionDetail = BaseChangeDetail;\n\n export interface Ref {\n /**\n * Sets input focus on the textarea control.\n */\n focus(): void;\n\n /**\n * Selects all text in the textarea control.\n */\n select(): void;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/prompt-input/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { IconProps } from '../icon/interfaces';\nimport {\n BaseChangeDetail,\n BaseInputProps,\n InputAutoComplete,\n InputAutoCorrect,\n InputKeyEvents,\n InputSpellcheck,\n} from '../input/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { BaseKeyDetail, NonCancelableEventHandler } from '../internal/events';\n\nexport interface PromptInputProps\n extends BaseInputProps,\n InputKeyEvents,\n InputAutoCorrect,\n InputAutoComplete,\n InputSpellcheck,\n BaseComponentProps,\n FormFieldValidationControlProps {\n /**\n * Called whenever a user clicks the action button or presses the \"Enter\" key.\n * The event `detail` contains the current value of the field.\n */\n onAction?: NonCancelableEventHandler<PromptInputProps.ActionDetail>;\n /**\n * Determines what icon to display in the action button.\n */\n actionButtonIconName?: IconProps.Name;\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available.\n *\n * If you set both `actionButtonIconUrl` and `actionButtonIconSvg`, `actionButtonIconSvg` will take precedence.\n */\n actionButtonIconUrl?: string;\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if you want your custom icon to inherit colors dictated by variant or hover states.\n * When this property is set, the component will be decorated with `aria-hidden=\"true\"`. Ensure that the `svg` element:\n * - has attribute `focusable=\"false\"`.\n * - has `viewBox=\"0 0 16 16\"`.\n *\n * If you set the `svg` element as the root node of the slot, the component will automatically\n * - set `stroke=\"currentColor\"`, `fill=\"none\"`, and `vertical-align=\"top\"`.\n * - set the stroke width based on the size of the icon.\n * - set the width and height of the SVG element based on the size of the icon.\n *\n * If you don't want these styles to be automatically set, wrap the `svg` element into a `span`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `actionButtonIconUrl` and `actionButtonIconSvg`, `iconSvg` will take precedence.\n *\n * *Note:* Remember to remove any additional elements (for example: `defs`) and related CSS classes from SVG files exported from design software.\n * In most cases, they aren't needed, as the `svg` element inherits styles from the icon component.\n */\n actionButtonIconSvg?: React.ReactNode;\n /**\n * Specifies alternate text for a custom icon. We recommend that you provide this for accessibility.\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `iconSvg` slot.\n */\n actionButtonIconAlt?: string;\n /**\n * Adds an aria-label to the action button.\n * @i18n\n */\n actionButtonAriaLabel?: string;\n\n /**\n * Specifies whether to disable the action button.\n */\n disableActionButton?: boolean;\n\n /**\n * Specifies the minimum number of lines of text to set the height to.\n */\n minRows?: number;\n\n /**\n * Specifies the maximum number of lines of text the textarea will expand to.\n */\n maxRows?: number;\n\n /**\n * Use this slot to add secondary actions to the prompt input.\n */\n secondaryActions?: React.ReactNode;\n\n /**\n * Use this slot to add secondary content, such as file attachments, to the prompt input.\n */\n secondaryContent?: React.ReactNode;\n\n /**\n * Determines whether the secondary actions area of the input has padding. If true, removes the default padding from the secondary actions area.\n */\n disableSecondaryActionsPaddings?: boolean;\n\n /**\n * Determines whether the secondary content area of the input has padding. If true, removes the default padding from the secondary content area.\n */\n disableSecondaryContentPaddings?: boolean;\n}\n\nexport namespace PromptInputProps {\n export type KeyDetail = BaseKeyDetail;\n export type ActionDetail = BaseChangeDetail;\n\n export interface Ref {\n /**\n * Sets input focus on the textarea control.\n */\n focus(): void;\n\n /**\n * Selects all text in the textarea control.\n */\n select(): void;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/prompt-input/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAWxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB,EAAE,0BAA0B;CAAG;AAEjG,QAAA,MAAM,mBAAmB,uGAkKxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/prompt-input/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAWxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB,EAAE,0BAA0B;CAAG;AAEjG,QAAA,MAAM,mBAAmB,uGAuMxB,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -14,7 +14,7 @@ import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
14
14
  import styles from './styles.css.js';
15
15
  import testutilStyles from './test-classes/styles.css.js';
16
16
  const InternalPromptInput = React.forwardRef((_a, ref) => {
17
- var { value, actionButtonAriaLabel, actionButtonIconName, actionButtonIconUrl, actionButtonIconSvg, actionButtonIconAlt, ariaLabel, autoComplete, autoFocus, disableActionButton, disableBrowserAutocorrect, disabled, maxRows = 3, minRows, name, onAction, onBlur, onChange, onFocus, onKeyDown, onKeyUp, placeholder, readOnly, spellcheck, __internalRootRef = null } = _a, rest = __rest(_a, ["value", "actionButtonAriaLabel", "actionButtonIconName", "actionButtonIconUrl", "actionButtonIconSvg", "actionButtonIconAlt", "ariaLabel", "autoComplete", "autoFocus", "disableActionButton", "disableBrowserAutocorrect", "disabled", "maxRows", "minRows", "name", "onAction", "onBlur", "onChange", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "spellcheck", "__internalRootRef"]);
17
+ var { value, actionButtonAriaLabel, actionButtonIconName, actionButtonIconUrl, actionButtonIconSvg, actionButtonIconAlt, ariaLabel, autoComplete, autoFocus, disableActionButton, disableBrowserAutocorrect, disabled, maxRows = 3, minRows, name, onAction, onBlur, onChange, onFocus, onKeyDown, onKeyUp, placeholder, readOnly, spellcheck, secondaryActions, secondaryContent, disableSecondaryActionsPaddings, disableSecondaryContentPaddings, __internalRootRef = null } = _a, rest = __rest(_a, ["value", "actionButtonAriaLabel", "actionButtonIconName", "actionButtonIconUrl", "actionButtonIconSvg", "actionButtonIconAlt", "ariaLabel", "autoComplete", "autoFocus", "disableActionButton", "disableBrowserAutocorrect", "disabled", "maxRows", "minRows", "name", "onAction", "onBlur", "onChange", "onFocus", "onKeyDown", "onKeyUp", "placeholder", "readOnly", "spellcheck", "secondaryActions", "secondaryContent", "disableSecondaryActionsPaddings", "disableSecondaryContentPaddings", "__internalRootRef"]);
18
18
  const { ariaLabelledby, ariaDescribedby, controlId, invalid, warning } = useFormFieldContext(rest);
19
19
  const baseProps = getBaseProps(rest);
20
20
  const textareaRef = useRef(null);
@@ -48,11 +48,12 @@ const InternalPromptInput = React.forwardRef((_a, ref) => {
48
48
  fireNonCancelableEvent(onChange, { value: event.target.value });
49
49
  adjustTextareaHeight();
50
50
  };
51
+ const hasActionButton = actionButtonIconName || actionButtonIconSvg || actionButtonIconUrl;
51
52
  const adjustTextareaHeight = useCallback(() => {
52
53
  if (textareaRef.current) {
53
54
  textareaRef.current.style.height = 'auto';
54
55
  const maxRowsHeight = `calc(${maxRows <= 0 ? 3 : maxRows} * (${LINE_HEIGHT} + ${PADDING} / 2) + ${PADDING})`;
55
- const scrollHeight = `calc(${textareaRef.current.scrollHeight}px + ${PADDING})`;
56
+ const scrollHeight = `calc(${textareaRef.current.scrollHeight}px)`;
56
57
  textareaRef.current.style.height = `min(${scrollHeight}, ${maxRowsHeight})`;
57
58
  }
58
59
  }, [maxRows, LINE_HEIGHT, PADDING]);
@@ -77,10 +78,8 @@ const InternalPromptInput = React.forwardRef((_a, ref) => {
77
78
  placeholder,
78
79
  autoFocus,
79
80
  className: clsx(styles.textarea, testutilStyles.textarea, {
80
- [styles['textarea-readonly']]: readOnly,
81
- [styles['textarea-invalid']]: invalid,
82
- [styles['textarea-warning']]: warning && !invalid,
83
- [styles['textarea-with-button']]: actionButtonIconName,
81
+ [styles.invalid]: invalid,
82
+ [styles.warning]: warning,
84
83
  }),
85
84
  autoComplete: convertAutoComplete(autoComplete),
86
85
  spellCheck: spellcheck,
@@ -95,15 +94,33 @@ const InternalPromptInput = React.forwardRef((_a, ref) => {
95
94
  onBlur: onBlur && (() => fireNonCancelableEvent(onBlur)),
96
95
  onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),
97
96
  };
98
- const hasActionButton = actionButtonIconName || actionButtonIconSvg || actionButtonIconUrl;
99
97
  if (disableBrowserAutocorrect) {
100
98
  attributes.autoCorrect = 'off';
101
99
  attributes.autoCapitalize = 'off';
102
100
  }
103
- return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(styles.root, testutilStyles.root, baseProps.className), ref: __internalRootRef }),
104
- React.createElement("textarea", Object.assign({ ref: textareaRef, id: controlId }, attributes)),
105
- hasActionButton && (React.createElement("div", { className: styles.button },
106
- React.createElement(InternalButton, { className: clsx(styles['action-button'], testutilStyles['action-button']), ariaLabel: actionButtonAriaLabel, disabled: disabled || readOnly || disableActionButton, iconName: actionButtonIconName, iconUrl: actionButtonIconUrl, iconSvg: actionButtonIconSvg, iconAlt: actionButtonIconAlt, onClick: () => fireNonCancelableEvent(onAction, { value }), variant: "icon" })))));
101
+ const action = (React.createElement("div", { className: styles.button },
102
+ React.createElement(InternalButton, { className: clsx(styles['action-button'], testutilStyles['action-button']), ariaLabel: actionButtonAriaLabel, disabled: disabled || readOnly || disableActionButton, __focusable: readOnly, iconName: actionButtonIconName, iconUrl: actionButtonIconUrl, iconSvg: actionButtonIconSvg, iconAlt: actionButtonIconAlt, onClick: () => fireNonCancelableEvent(onAction, { value }), variant: "icon" })));
103
+ return (React.createElement("div", Object.assign({}, baseProps, { "aria-label": ariaLabel, className: clsx(styles.root, testutilStyles.root, baseProps.className, {
104
+ [styles['textarea-readonly']]: readOnly,
105
+ [styles['textarea-invalid']]: invalid,
106
+ [styles['textarea-warning']]: warning && !invalid,
107
+ [styles.disabled]: disabled,
108
+ }), ref: __internalRootRef, role: "region" }),
109
+ secondaryContent && (React.createElement("div", { className: clsx(styles['secondary-content'], testutilStyles['secondary-content'], {
110
+ [styles['with-paddings']]: !disableSecondaryContentPaddings,
111
+ [styles.invalid]: invalid,
112
+ [styles.warning]: warning,
113
+ }) }, secondaryContent)),
114
+ React.createElement("div", { className: styles['textarea-wrapper'] },
115
+ React.createElement("textarea", Object.assign({ ref: textareaRef, id: controlId }, attributes)),
116
+ hasActionButton && !secondaryActions && action),
117
+ secondaryActions && (React.createElement("div", { className: clsx(styles['secondary-actions'], testutilStyles['secondary-actions'], {
118
+ [styles['with-paddings']]: !disableSecondaryActionsPaddings,
119
+ [styles.invalid]: invalid,
120
+ [styles.warning]: warning,
121
+ }) },
122
+ secondaryActions,
123
+ hasActionButton && action))));
107
124
  });
108
125
  export default InternalPromptInput;
109
126
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/prompt-input/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAE/E,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,MAAM,MAAM,qCAAqC,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAI1D,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAC1C,CACE,EA2B2B,EAC3B,GAA8B,EAC9B,EAAE;QA7BF,EACE,KAAK,EACL,qBAAqB,EACrB,oBAAoB,EACpB,m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CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useCallback, useEffect, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useDensityMode } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalButton from '../button/internal';\nimport { convertAutoComplete } from '../input/utils';\nimport { getBaseProps } from '../internal/base-component';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireKeyboardEvent, fireNonCancelableEvent } from '../internal/events';\nimport * as tokens from '../internal/generated/styles/tokens';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { PromptInputProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\n\nexport interface InternalPromptInputProps extends PromptInputProps, InternalBaseComponentProps {}\n\nconst InternalPromptInput = React.forwardRef(\n (\n {\n value,\n actionButtonAriaLabel,\n actionButtonIconName,\n actionButtonIconUrl,\n actionButtonIconSvg,\n actionButtonIconAlt,\n ariaLabel,\n autoComplete,\n autoFocus,\n disableActionButton,\n disableBrowserAutocorrect,\n disabled,\n maxRows = 3,\n minRows,\n name,\n onAction,\n onBlur,\n onChange,\n onFocus,\n onKeyDown,\n onKeyUp,\n placeholder,\n readOnly,\n spellcheck,\n __internalRootRef = null,\n ...rest\n }: InternalPromptInputProps,\n ref: Ref<PromptInputProps.Ref>\n ) => {\n const { ariaLabelledby, ariaDescribedby, controlId, invalid, warning } = useFormFieldContext(rest);\n\n const baseProps = getBaseProps(rest);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const isRefresh = useVisualRefresh();\n const isCompactMode = useDensityMode(textareaRef) === 'compact';\n\n const PADDING = isRefresh ? tokens.spaceXxs : tokens.spaceXxxs;\n const LINE_HEIGHT = tokens.lineHeightBodyM;\n\n useImperativeHandle(\n ref,\n () => ({\n focus(...args: Parameters<HTMLElement['focus']>) {\n textareaRef.current?.focus(...args);\n },\n select() {\n textareaRef.current?.select();\n },\n }),\n [textareaRef]\n );\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (onKeyDown) {\n fireKeyboardEvent(onKeyDown, event);\n }\n\n if (event.key === 'Enter' && !event.shiftKey) {\n if ('form' in event.target && event.target.form !== null && !event.isDefaultPrevented()) {\n (event.target.form as HTMLFormElement).requestSubmit();\n }\n\n event.preventDefault();\n fireNonCancelableEvent(onAction, { value });\n }\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n fireNonCancelableEvent(onChange, { value: event.target.value });\n adjustTextareaHeight();\n };\n\n const adjustTextareaHeight = useCallback(() => {\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n const maxRowsHeight = `calc(${maxRows <= 0 ? 3 : maxRows} * (${LINE_HEIGHT} + ${PADDING} / 2) + ${PADDING})`;\n const scrollHeight = `calc(${textareaRef.current.scrollHeight}px + ${PADDING})`;\n textareaRef.current.style.height = `min(${scrollHeight}, ${maxRowsHeight})`;\n }\n }, [maxRows, LINE_HEIGHT, PADDING]);\n\n useEffect(() => {\n const handleResize = () => {\n adjustTextareaHeight();\n };\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [adjustTextareaHeight]);\n\n useEffect(() => {\n adjustTextareaHeight();\n }, [value, adjustTextareaHeight, maxRows, isCompactMode]);\n\n const attributes: React.TextareaHTMLAttributes<HTMLTextAreaElement> = {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-invalid': invalid ? 'true' : undefined,\n name,\n placeholder,\n autoFocus,\n className: clsx(styles.textarea, testutilStyles.textarea, {\n [styles['textarea-readonly']]: readOnly,\n [styles['textarea-invalid']]: invalid,\n [styles['textarea-warning']]: warning && !invalid,\n [styles['textarea-with-button']]: actionButtonIconName,\n }),\n autoComplete: convertAutoComplete(autoComplete),\n spellCheck: spellcheck,\n disabled,\n readOnly: readOnly ? true : undefined,\n rows: minRows || 1,\n onKeyDown: handleKeyDown,\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: handleChange,\n onBlur: onBlur && (() => fireNonCancelableEvent(onBlur)),\n onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),\n };\n\n const hasActionButton = actionButtonIconName || actionButtonIconSvg || actionButtonIconUrl;\n\n if (disableBrowserAutocorrect) {\n attributes.autoCorrect = 'off';\n attributes.autoCapitalize = 'off';\n }\n\n return (\n <div\n {...baseProps}\n className={clsx(styles.root, testutilStyles.root, baseProps.className)}\n ref={__internalRootRef}\n >\n <textarea ref={textareaRef} id={controlId} {...attributes} />\n {hasActionButton && (\n <div className={styles.button}>\n <InternalButton\n className={clsx(styles['action-button'], testutilStyles['action-button'])}\n ariaLabel={actionButtonAriaLabel}\n disabled={disabled || readOnly || disableActionButton}\n iconName={actionButtonIconName}\n iconUrl={actionButtonIconUrl}\n iconSvg={actionButtonIconSvg}\n iconAlt={actionButtonIconAlt}\n onClick={() => fireNonCancelableEvent(onAction, { value })}\n variant=\"icon\"\n />\n </div>\n )}\n </div>\n );\n }\n);\n\nexport default InternalPromptInput;\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/prompt-input/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACxF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAE/E,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAA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MAAM,CAAC,mBAAmB,CAAC,EAAE,cAAc,CAAC,mBAAmB,CAAC,EAAE;gBAChF,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,+BAA+B;gBAC3D,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO;gBACzB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,OAAO;aAC1B,CAAC;YAED,gBAAgB;YAChB,eAAe,IAAI,MAAM,CACtB,CACP,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useCallback, useEffect, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useDensityMode } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalButton from '../button/internal';\nimport { convertAutoComplete } from '../input/utils';\nimport { getBaseProps } from '../internal/base-component';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { fireKeyboardEvent, fireNonCancelableEvent } from '../internal/events';\nimport * as tokens from '../internal/generated/styles/tokens';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { PromptInputProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testutilStyles from './test-classes/styles.css.js';\n\nexport interface InternalPromptInputProps extends PromptInputProps, InternalBaseComponentProps {}\n\nconst InternalPromptInput = React.forwardRef(\n (\n {\n value,\n actionButtonAriaLabel,\n actionButtonIconName,\n actionButtonIconUrl,\n actionButtonIconSvg,\n actionButtonIconAlt,\n ariaLabel,\n autoComplete,\n autoFocus,\n disableActionButton,\n disableBrowserAutocorrect,\n disabled,\n maxRows = 3,\n minRows,\n name,\n onAction,\n onBlur,\n onChange,\n onFocus,\n onKeyDown,\n onKeyUp,\n placeholder,\n readOnly,\n spellcheck,\n secondaryActions,\n secondaryContent,\n disableSecondaryActionsPaddings,\n disableSecondaryContentPaddings,\n __internalRootRef = null,\n ...rest\n }: InternalPromptInputProps,\n ref: Ref<PromptInputProps.Ref>\n ) => {\n const { ariaLabelledby, ariaDescribedby, controlId, invalid, warning } = useFormFieldContext(rest);\n\n const baseProps = getBaseProps(rest);\n\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n const isRefresh = useVisualRefresh();\n const isCompactMode = useDensityMode(textareaRef) === 'compact';\n\n const PADDING = isRefresh ? tokens.spaceXxs : tokens.spaceXxxs;\n const LINE_HEIGHT = tokens.lineHeightBodyM;\n\n useImperativeHandle(\n ref,\n () => ({\n focus(...args: Parameters<HTMLElement['focus']>) {\n textareaRef.current?.focus(...args);\n },\n select() {\n textareaRef.current?.select();\n },\n }),\n [textareaRef]\n );\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (onKeyDown) {\n fireKeyboardEvent(onKeyDown, event);\n }\n\n if (event.key === 'Enter' && !event.shiftKey) {\n if ('form' in event.target && event.target.form !== null && !event.isDefaultPrevented()) {\n (event.target.form as HTMLFormElement).requestSubmit();\n }\n\n event.preventDefault();\n fireNonCancelableEvent(onAction, { value });\n }\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n fireNonCancelableEvent(onChange, { value: event.target.value });\n adjustTextareaHeight();\n };\n\n const hasActionButton = actionButtonIconName || actionButtonIconSvg || actionButtonIconUrl;\n\n const adjustTextareaHeight = useCallback(() => {\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n const maxRowsHeight = `calc(${maxRows <= 0 ? 3 : maxRows} * (${LINE_HEIGHT} + ${PADDING} / 2) + ${PADDING})`;\n const scrollHeight = `calc(${textareaRef.current.scrollHeight}px)`;\n textareaRef.current.style.height = `min(${scrollHeight}, ${maxRowsHeight})`;\n }\n }, [maxRows, LINE_HEIGHT, PADDING]);\n\n useEffect(() => {\n const handleResize = () => {\n adjustTextareaHeight();\n };\n\n window.addEventListener('resize', handleResize);\n\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [adjustTextareaHeight]);\n\n useEffect(() => {\n adjustTextareaHeight();\n }, [value, adjustTextareaHeight, maxRows, isCompactMode]);\n\n const attributes: React.TextareaHTMLAttributes<HTMLTextAreaElement> = {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-invalid': invalid ? 'true' : undefined,\n name,\n placeholder,\n autoFocus,\n className: clsx(styles.textarea, testutilStyles.textarea, {\n [styles.invalid]: invalid,\n [styles.warning]: warning,\n }),\n autoComplete: convertAutoComplete(autoComplete),\n spellCheck: spellcheck,\n disabled,\n readOnly: readOnly ? true : undefined,\n rows: minRows || 1,\n onKeyDown: handleKeyDown,\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: handleChange,\n onBlur: onBlur && (() => fireNonCancelableEvent(onBlur)),\n onFocus: onFocus && (() => fireNonCancelableEvent(onFocus)),\n };\n\n if (disableBrowserAutocorrect) {\n attributes.autoCorrect = 'off';\n attributes.autoCapitalize = 'off';\n }\n\n const action = (\n <div className={styles.button}>\n <InternalButton\n className={clsx(styles['action-button'], testutilStyles['action-button'])}\n ariaLabel={actionButtonAriaLabel}\n disabled={disabled || readOnly || disableActionButton}\n __focusable={readOnly}\n iconName={actionButtonIconName}\n iconUrl={actionButtonIconUrl}\n iconSvg={actionButtonIconSvg}\n iconAlt={actionButtonIconAlt}\n onClick={() => fireNonCancelableEvent(onAction, { value })}\n variant=\"icon\"\n />\n </div>\n );\n\n return (\n <div\n {...baseProps}\n aria-label={ariaLabel}\n className={clsx(styles.root, testutilStyles.root, baseProps.className, {\n [styles['textarea-readonly']]: readOnly,\n [styles['textarea-invalid']]: invalid,\n [styles['textarea-warning']]: warning && !invalid,\n [styles.disabled]: disabled,\n })}\n ref={__internalRootRef}\n role=\"region\"\n >\n {secondaryContent && (\n <div\n className={clsx(styles['secondary-content'], testutilStyles['secondary-content'], {\n [styles['with-paddings']]: !disableSecondaryContentPaddings,\n [styles.invalid]: invalid,\n [styles.warning]: warning,\n })}\n >\n {secondaryContent}\n </div>\n )}\n <div className={styles['textarea-wrapper']}>\n <textarea ref={textareaRef} id={controlId} {...attributes} />\n {hasActionButton && !secondaryActions && action}\n </div>\n {secondaryActions && (\n <div\n className={clsx(styles['secondary-actions'], testutilStyles['secondary-actions'], {\n [styles['with-paddings']]: !disableSecondaryActionsPaddings,\n [styles.invalid]: invalid,\n [styles.warning]: warning,\n })}\n >\n {secondaryActions}\n {hasActionButton && action}\n </div>\n )}\n </div>\n );\n }\n);\n\nexport default InternalPromptInput;\n"]}
@@ -1,13 +1,19 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_55fkh_1r4bl_142",
5
- "button": "awsui_button_55fkh_1r4bl_145",
6
- "action-button": "awsui_action-button_55fkh_1r4bl_150",
7
- "textarea": "awsui_textarea_55fkh_1r4bl_172",
8
- "textarea-readonly": "awsui_textarea-readonly_55fkh_1r4bl_225",
9
- "textarea-invalid": "awsui_textarea-invalid_55fkh_1r4bl_267",
10
- "textarea-warning": "awsui_textarea-warning_55fkh_1r4bl_276",
11
- "textarea-with-button": "awsui_textarea-with-button_55fkh_1r4bl_285"
4
+ "root": "awsui_root_55fkh_1vvqx_142",
5
+ "textarea-readonly": "awsui_textarea-readonly_55fkh_1vvqx_184",
6
+ "disabled": "awsui_disabled_55fkh_1vvqx_189",
7
+ "textarea-invalid": "awsui_textarea-invalid_55fkh_1vvqx_197",
8
+ "textarea-warning": "awsui_textarea-warning_55fkh_1vvqx_222",
9
+ "textarea": "awsui_textarea_55fkh_1vvqx_184",
10
+ "invalid": "awsui_invalid_55fkh_1vvqx_325",
11
+ "warning": "awsui_warning_55fkh_1vvqx_325",
12
+ "textarea-wrapper": "awsui_textarea-wrapper_55fkh_1vvqx_344",
13
+ "button": "awsui_button_55fkh_1vvqx_348",
14
+ "action-button": "awsui_action-button_55fkh_1vvqx_353",
15
+ "secondary-content": "awsui_secondary-content_55fkh_1vvqx_378",
16
+ "with-paddings": "awsui_with-paddings_55fkh_1vvqx_416",
17
+ "secondary-actions": "awsui_secondary-actions_55fkh_1vvqx_426"
12
18
  };
13
19
 
@@ -139,37 +139,124 @@
139
139
  */
140
140
  /* Style used for links in slots/components that are text heavy, to help links stand out among
141
141
  surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
142
- .awsui_root_55fkh_1r4bl_142:not(#\9) {
143
- position: relative;
142
+ .awsui_root_55fkh_1vvqx_142:not(#\9) {
143
+ border-collapse: separate;
144
+ border-spacing: 0;
145
+ box-sizing: border-box;
146
+ caption-side: top;
147
+ cursor: auto;
148
+ direction: inherit;
149
+ empty-cells: show;
150
+ font-family: serif;
151
+ font-size: medium;
152
+ font-style: normal;
153
+ font-variant: normal;
154
+ font-weight: 400;
155
+ font-stretch: normal;
156
+ line-height: normal;
157
+ -webkit-hyphens: none;
158
+ hyphens: none;
159
+ letter-spacing: normal;
160
+ list-style: disc outside none;
161
+ tab-size: 8;
162
+ text-align: start;
163
+ text-indent: 0;
164
+ text-shadow: none;
165
+ text-transform: none;
166
+ visibility: visible;
167
+ white-space: normal;
168
+ word-spacing: normal;
169
+ font-size: var(--font-size-body-m-x4okxb, 14px);
170
+ line-height: var(--line-height-body-m-30ar75, 20px);
171
+ color: var(--color-text-body-default-7v1jfn, #0f141a);
172
+ font-weight: 400;
173
+ font-family: var(--font-family-base-dnvic8, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
174
+ -webkit-font-smoothing: auto;
175
+ -moz-osx-font-smoothing: auto;
176
+ border-start-start-radius: var(--border-radius-input-plgbrq, 8px);
177
+ border-start-end-radius: var(--border-radius-input-plgbrq, 8px);
178
+ border-end-start-radius: var(--border-radius-input-plgbrq, 8px);
179
+ border-end-end-radius: var(--border-radius-input-plgbrq, 8px);
180
+ cursor: text;
181
+ background-color: var(--color-background-input-default-u56ls1, #ffffff);
182
+ border-block: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-default-l7v83d, #8c8c94);
183
+ border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-default-l7v83d, #8c8c94);
144
184
  }
145
- .awsui_root_55fkh_1r4bl_142 > .awsui_button_55fkh_1r4bl_145:not(#\9) {
146
- position: absolute;
147
- inset-inline-end: var(--space-static-xxs-82cdfi, 4px);
148
- inset-block-end: 0;
185
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-readonly_55fkh_1vvqx_184:not(#\9) {
186
+ background-color: var(--color-background-input-default-u56ls1, #ffffff);
187
+ border-block: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
188
+ border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
149
189
  }
150
- body[data-awsui-focus-visible=true] .awsui_root_55fkh_1r4bl_142 > .awsui_button_55fkh_1r4bl_145 > .awsui_action-button_55fkh_1r4bl_150:not(#\9):focus {
151
- position: relative;
190
+ .awsui_root_55fkh_1vvqx_142.awsui_disabled_55fkh_1vvqx_189:not(#\9) {
191
+ background-color: var(--color-background-input-disabled-gvxsk4, #ebebf0);
192
+ border-block: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
193
+ border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
194
+ color: var(--color-text-input-disabled-fc4jfl, #b4b4bb);
195
+ cursor: auto;
196
+ cursor: default;
152
197
  }
153
- body[data-awsui-focus-visible=true] .awsui_root_55fkh_1r4bl_142 > .awsui_button_55fkh_1r4bl_145 > .awsui_action-button_55fkh_1r4bl_150:not(#\9):focus {
154
- outline: 2px dotted transparent;
155
- outline-offset: calc(calc((var(--space-xxxs-zbmxqb, 2px)) - 1px) - 1px);
198
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-invalid_55fkh_1vvqx_197:not(#\9) {
199
+ color: var(--color-text-status-error-5676bj, #db0000);
200
+ border-color: var(--color-text-status-error-5676bj, #db0000);
201
+ padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-field-width-09w7vk, 2px)));
202
+ border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
156
203
  }
157
- body[data-awsui-focus-visible=true] .awsui_root_55fkh_1r4bl_142 > .awsui_button_55fkh_1r4bl_145 > .awsui_action-button_55fkh_1r4bl_150:not(#\9):focus::before {
158
- content: " ";
159
- display: block;
160
- position: absolute;
161
- inset-inline-start: calc(-1 * calc((var(--space-xxxs-zbmxqb, 2px)) - 1px));
162
- inset-block-start: calc(-1 * calc(-1 * var(--space-xxxs-zbmxqb, 2px) - 1px));
163
- inline-size: calc(100% + calc((var(--space-xxxs-zbmxqb, 2px)) - 1px) + calc((var(--space-xxxs-zbmxqb, 2px)) - 1px));
164
- block-size: calc(100% + calc(-1 * var(--space-xxxs-zbmxqb, 2px) - 1px) + calc(-1 * var(--space-xxxs-zbmxqb, 2px) - 1px));
165
- border-start-start-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
166
- border-start-end-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
167
- border-end-start-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
168
- border-end-end-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
169
- box-shadow: 0 0 0 2px var(--color-border-item-focused-nv6mhz, #006ce0);
204
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-invalid_55fkh_1vvqx_197:not(#\9):focus {
205
+ box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
206
+ }
207
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-invalid_55fkh_1vvqx_197:not(#\9) {
208
+ padding-inline-start: 0;
209
+ }
210
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-invalid_55fkh_1vvqx_197:not(#\9):focus-within, .awsui_root_55fkh_1vvqx_142.awsui_textarea-invalid_55fkh_1vvqx_197:not(#\9):focus {
211
+ color: var(--color-text-status-error-5676bj, #db0000);
212
+ border-color: var(--color-text-status-error-5676bj, #db0000);
213
+ padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-field-width-09w7vk, 2px)));
214
+ border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
215
+ }
216
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-invalid_55fkh_1vvqx_197:not(#\9):focus-within:focus, .awsui_root_55fkh_1vvqx_142.awsui_textarea-invalid_55fkh_1vvqx_197:not(#\9):focus:focus {
217
+ box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
218
+ }
219
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-invalid_55fkh_1vvqx_197:not(#\9):focus-within, .awsui_root_55fkh_1vvqx_142.awsui_textarea-invalid_55fkh_1vvqx_197:not(#\9):focus {
220
+ padding-inline-start: 0;
221
+ box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
222
+ }
223
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-warning_55fkh_1vvqx_222:not(#\9) {
224
+ color: var(--color-text-status-warning-csaw41, #855900);
225
+ border-color: var(--color-text-status-warning-csaw41, #855900);
226
+ padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-field-width-09w7vk, 2px)));
227
+ border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
228
+ }
229
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-warning_55fkh_1vvqx_222:not(#\9):focus {
230
+ box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
231
+ }
232
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-warning_55fkh_1vvqx_222:not(#\9) {
233
+ padding-inline-start: 0;
234
+ }
235
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-warning_55fkh_1vvqx_222:not(#\9):focus-within, .awsui_root_55fkh_1vvqx_142.awsui_textarea-warning_55fkh_1vvqx_222:not(#\9):focus {
236
+ color: var(--color-text-status-warning-csaw41, #855900);
237
+ border-color: var(--color-text-status-warning-csaw41, #855900);
238
+ padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-field-width-09w7vk, 2px)));
239
+ border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
240
+ }
241
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-warning_55fkh_1vvqx_222:not(#\9):focus-within:focus, .awsui_root_55fkh_1vvqx_142.awsui_textarea-warning_55fkh_1vvqx_222:not(#\9):focus:focus {
242
+ box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
243
+ }
244
+ .awsui_root_55fkh_1vvqx_142.awsui_textarea-warning_55fkh_1vvqx_222:not(#\9):focus-within, .awsui_root_55fkh_1vvqx_142.awsui_textarea-warning_55fkh_1vvqx_222:not(#\9):focus {
245
+ padding-inline-start: 0;
246
+ box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
247
+ }
248
+ .awsui_root_55fkh_1vvqx_142:not(#\9):focus-within, .awsui_root_55fkh_1vvqx_142:not(#\9):focus {
249
+ outline: 2px dotted transparent;
250
+ border-block: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-focused-c6w5i5, #002b66);
251
+ border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-focused-c6w5i5, #002b66);
252
+ border-start-start-radius: var(--border-radius-input-plgbrq, 8px);
253
+ border-start-end-radius: var(--border-radius-input-plgbrq, 8px);
254
+ border-end-start-radius: var(--border-radius-input-plgbrq, 8px);
255
+ border-end-end-radius: var(--border-radius-input-plgbrq, 8px);
256
+ box-shadow: 0 0 0 var(--border-control-focus-ring-shadow-spread-0ctpjf, 0px) var(--color-border-item-focused-nv6mhz, #006ce0);
170
257
  }
171
258
 
172
- .awsui_textarea_55fkh_1r4bl_172:not(#\9) {
259
+ .awsui_textarea_55fkh_1vvqx_184:not(#\9) {
173
260
  border-collapse: separate;
174
261
  border-spacing: 0;
175
262
  box-sizing: border-box;
@@ -203,9 +290,16 @@ body[data-awsui-focus-visible=true] .awsui_root_55fkh_1r4bl_142 > .awsui_button_
203
290
  font-family: var(--font-family-base-dnvic8, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
204
291
  -webkit-font-smoothing: auto;
205
292
  -moz-osx-font-smoothing: auto;
293
+ border-start-start-radius: var(--border-radius-input-plgbrq, 8px);
294
+ border-start-end-radius: var(--border-radius-input-plgbrq, 8px);
295
+ border-end-start-radius: var(--border-radius-input-plgbrq, 8px);
296
+ border-end-end-radius: var(--border-radius-input-plgbrq, 8px);
297
+ font-size: var(--font-size-body-m-x4okxb, 14px);
298
+ line-height: var(--line-height-body-m-30ar75, 20px);
206
299
  resize: none;
207
300
  cursor: text;
208
301
  white-space: pre-wrap;
302
+ background-color: inherit;
209
303
  padding-block: var(--space-scaled-xxs-7597g1, 4px);
210
304
  padding-inline: var(--space-field-horizontal-gg19kw, 12px);
211
305
  color: var(--color-text-body-default-7v1jfn, #0f141a);
@@ -213,76 +307,178 @@ body[data-awsui-focus-visible=true] .awsui_root_55fkh_1r4bl_142 > .awsui_button_
213
307
  inline-size: 100%;
214
308
  display: block;
215
309
  box-sizing: border-box;
216
- background-color: var(--color-background-input-default-u56ls1, #ffffff);
217
- border-start-start-radius: var(--border-radius-input-plgbrq, 8px);
218
- border-start-end-radius: var(--border-radius-input-plgbrq, 8px);
219
- border-end-start-radius: var(--border-radius-input-plgbrq, 8px);
220
- border-end-end-radius: var(--border-radius-input-plgbrq, 8px);
221
- border-block: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-default-l7v83d, #8c8c94);
222
- border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-default-l7v83d, #8c8c94);
223
- font-size: var(--font-size-body-m-x4okxb, 14px);
224
- line-height: var(--line-height-body-m-30ar75, 20px);
310
+ border: 0;
225
311
  }
226
- .awsui_textarea_55fkh_1r4bl_172.awsui_textarea-readonly_55fkh_1r4bl_225:not(#\9) {
227
- background-color: var(--color-background-input-default-u56ls1, #ffffff);
228
- border-block: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
229
- border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
230
- }
231
- .awsui_textarea_55fkh_1r4bl_172:not(#\9)::placeholder {
312
+ .awsui_textarea_55fkh_1vvqx_184:not(#\9)::placeholder {
232
313
  color: var(--color-text-input-placeholder-f3x213, #656871);
233
314
  font-style: italic;
234
315
  opacity: 1;
235
316
  }
236
- .awsui_textarea_55fkh_1r4bl_172:not(#\9):-ms-input-placeholder {
317
+ .awsui_textarea_55fkh_1vvqx_184:not(#\9):-ms-input-placeholder {
237
318
  color: var(--color-text-input-placeholder-f3x213, #656871);
238
319
  font-style: italic;
239
320
  }
240
- .awsui_textarea_55fkh_1r4bl_172:not(#\9):focus {
241
- outline: 2px dotted transparent;
242
- border-block: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-focused-c6w5i5, #002b66);
243
- border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-focused-c6w5i5, #002b66);
244
- border-start-start-radius: var(--border-radius-input-plgbrq, 8px);
245
- border-start-end-radius: var(--border-radius-input-plgbrq, 8px);
246
- border-end-start-radius: var(--border-radius-input-plgbrq, 8px);
247
- border-end-end-radius: var(--border-radius-input-plgbrq, 8px);
248
- box-shadow: 0 0 0 var(--border-control-focus-ring-shadow-spread-0ctpjf, 0px) var(--color-border-item-focused-nv6mhz, #006ce0);
321
+ .awsui_textarea_55fkh_1vvqx_184:not(#\9):focus {
322
+ outline: none;
249
323
  }
250
- .awsui_textarea_55fkh_1r4bl_172:not(#\9):invalid {
324
+ .awsui_textarea_55fkh_1vvqx_184:not(#\9):invalid {
251
325
  box-shadow: none;
252
326
  }
253
- .awsui_textarea_55fkh_1r4bl_172:not(#\9):disabled {
327
+ .awsui_textarea_55fkh_1vvqx_184.awsui_invalid_55fkh_1vvqx_325:not(#\9), .awsui_textarea_55fkh_1vvqx_184.awsui_warning_55fkh_1vvqx_325:not(#\9) {
328
+ padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-field-width-09w7vk, 2px)));
329
+ }
330
+ .awsui_textarea_55fkh_1vvqx_184:not(#\9):disabled {
254
331
  background-color: var(--color-background-input-disabled-gvxsk4, #ebebf0);
255
332
  border-block: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
256
333
  border-inline: var(--border-field-width-09w7vk, 2px) solid var(--color-border-input-disabled-lb7zn3, #ebebf0);
257
334
  color: var(--color-text-input-disabled-fc4jfl, #b4b4bb);
258
335
  cursor: auto;
336
+ border: 0;
259
337
  cursor: default;
260
338
  }
261
- .awsui_textarea_55fkh_1r4bl_172:not(#\9):disabled::placeholder {
339
+ .awsui_textarea_55fkh_1vvqx_184:not(#\9):disabled::placeholder {
262
340
  color: var(--color-text-input-placeholder-disabled-7v2f7f, #b4b4bb);
263
341
  opacity: 1;
264
342
  }
265
- .awsui_textarea_55fkh_1r4bl_172:not(#\9):disabled:-ms-input-placeholder {
343
+ .awsui_textarea_55fkh_1vvqx_184:not(#\9):disabled:-ms-input-placeholder {
266
344
  color: var(--color-text-input-placeholder-disabled-7v2f7f, #b4b4bb);
267
345
  }
268
- .awsui_textarea_55fkh_1r4bl_172.awsui_textarea-invalid_55fkh_1r4bl_267:not(#\9) {
269
- color: var(--color-text-status-error-5676bj, #db0000);
270
- border-color: var(--color-text-status-error-5676bj, #db0000);
346
+ .awsui_textarea-wrapper_55fkh_1vvqx_344:not(#\9) {
347
+ display: flex;
348
+ }
349
+
350
+ .awsui_button_55fkh_1vvqx_348:not(#\9) {
351
+ align-self: flex-end;
352
+ padding-inline: calc(var(--space-field-horizontal-gg19kw, 12px) / 2);
353
+ padding-block-end: var(--space-scaled-xxxs-27y4hv, 2px);
354
+ }
355
+ .awsui_button_55fkh_1vvqx_348 > .awsui_action-button_55fkh_1vvqx_353:not(#\9) {
356
+ padding: 0;
357
+ }
358
+ body[data-awsui-focus-visible=true] .awsui_button_55fkh_1vvqx_348 > .awsui_action-button_55fkh_1vvqx_353:not(#\9):focus {
359
+ position: relative;
360
+ }
361
+ body[data-awsui-focus-visible=true] .awsui_button_55fkh_1vvqx_348 > .awsui_action-button_55fkh_1vvqx_353:not(#\9):focus {
362
+ outline: 2px dotted transparent;
363
+ outline-offset: calc(calc((var(--space-xxxs-zbmxqb, 2px)) - 1px) - 1px);
364
+ }
365
+ body[data-awsui-focus-visible=true] .awsui_button_55fkh_1vvqx_348 > .awsui_action-button_55fkh_1vvqx_353:not(#\9):focus::before {
366
+ content: " ";
367
+ display: block;
368
+ position: absolute;
369
+ inset-inline-start: calc(-1 * calc((var(--space-xxxs-zbmxqb, 2px)) - 1px));
370
+ inset-block-start: calc(-1 * calc(-1 * var(--space-xxxs-zbmxqb, 2px) - 1px));
371
+ inline-size: calc(100% + calc((var(--space-xxxs-zbmxqb, 2px)) - 1px) + calc((var(--space-xxxs-zbmxqb, 2px)) - 1px));
372
+ block-size: calc(100% + calc(-1 * var(--space-xxxs-zbmxqb, 2px) - 1px) + calc(-1 * var(--space-xxxs-zbmxqb, 2px) - 1px));
373
+ border-start-start-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
374
+ border-start-end-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
375
+ border-end-start-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
376
+ border-end-end-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
377
+ box-shadow: 0 0 0 2px var(--color-border-item-focused-nv6mhz, #006ce0);
378
+ }
379
+
380
+ .awsui_secondary-content_55fkh_1vvqx_378:not(#\9) {
381
+ border-collapse: separate;
382
+ border-spacing: 0;
383
+ box-sizing: border-box;
384
+ caption-side: top;
385
+ cursor: auto;
386
+ direction: inherit;
387
+ empty-cells: show;
388
+ font-family: serif;
389
+ font-size: medium;
390
+ font-style: normal;
391
+ font-variant: normal;
392
+ font-weight: 400;
393
+ font-stretch: normal;
394
+ line-height: normal;
395
+ -webkit-hyphens: none;
396
+ hyphens: none;
397
+ letter-spacing: normal;
398
+ list-style: disc outside none;
399
+ tab-size: 8;
400
+ text-align: start;
401
+ text-indent: 0;
402
+ text-shadow: none;
403
+ text-transform: none;
404
+ visibility: visible;
405
+ white-space: normal;
406
+ word-spacing: normal;
407
+ font-size: var(--font-size-body-m-x4okxb, 14px);
408
+ line-height: var(--line-height-body-m-30ar75, 20px);
409
+ color: var(--color-text-body-default-7v1jfn, #0f141a);
410
+ font-weight: 400;
411
+ font-family: var(--font-family-base-dnvic8, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
412
+ -webkit-font-smoothing: auto;
413
+ -moz-osx-font-smoothing: auto;
414
+ border-start-start-radius: var(--border-radius-input-plgbrq, 8px);
415
+ border-start-end-radius: var(--border-radius-input-plgbrq, 8px);
416
+ border-end-start-radius: var(--border-radius-input-plgbrq, 8px);
417
+ border-end-end-radius: var(--border-radius-input-plgbrq, 8px);
418
+ }
419
+ .awsui_secondary-content_55fkh_1vvqx_378.awsui_with-paddings_55fkh_1vvqx_416:not(#\9) {
420
+ padding-block-start: var(--space-scaled-xxs-7597g1, 4px);
421
+ padding-block-end: var(--space-scaled-s-aqzyko, 12px);
422
+ padding-inline-start: var(--space-field-horizontal-gg19kw, 12px);
423
+ padding-inline-end: calc(var(--space-field-horizontal-gg19kw, 12px) / 2);
424
+ }
425
+ .awsui_secondary-content_55fkh_1vvqx_378.awsui_with-paddings_55fkh_1vvqx_416.awsui_invalid_55fkh_1vvqx_325:not(#\9), .awsui_secondary-content_55fkh_1vvqx_378.awsui_with-paddings_55fkh_1vvqx_416.awsui_warning_55fkh_1vvqx_325:not(#\9) {
271
426
  padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-field-width-09w7vk, 2px)));
272
- border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
273
427
  }
274
- .awsui_textarea_55fkh_1r4bl_172.awsui_textarea-invalid_55fkh_1r4bl_267:not(#\9):focus {
275
- box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
428
+
429
+ .awsui_secondary-actions_55fkh_1vvqx_426:not(#\9) {
430
+ border-collapse: separate;
431
+ border-spacing: 0;
432
+ box-sizing: border-box;
433
+ caption-side: top;
434
+ cursor: auto;
435
+ direction: inherit;
436
+ empty-cells: show;
437
+ font-family: serif;
438
+ font-size: medium;
439
+ font-style: normal;
440
+ font-variant: normal;
441
+ font-weight: 400;
442
+ font-stretch: normal;
443
+ line-height: normal;
444
+ -webkit-hyphens: none;
445
+ hyphens: none;
446
+ letter-spacing: normal;
447
+ list-style: disc outside none;
448
+ tab-size: 8;
449
+ text-align: start;
450
+ text-indent: 0;
451
+ text-shadow: none;
452
+ text-transform: none;
453
+ visibility: visible;
454
+ white-space: normal;
455
+ word-spacing: normal;
456
+ font-size: var(--font-size-body-m-x4okxb, 14px);
457
+ line-height: var(--line-height-body-m-30ar75, 20px);
458
+ color: var(--color-text-body-default-7v1jfn, #0f141a);
459
+ font-weight: 400;
460
+ font-family: var(--font-family-base-dnvic8, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
461
+ -webkit-font-smoothing: auto;
462
+ -moz-osx-font-smoothing: auto;
463
+ border-start-start-radius: var(--border-radius-input-plgbrq, 8px);
464
+ border-start-end-radius: var(--border-radius-input-plgbrq, 8px);
465
+ border-end-start-radius: var(--border-radius-input-plgbrq, 8px);
466
+ border-end-end-radius: var(--border-radius-input-plgbrq, 8px);
467
+ display: flex;
468
+ justify-content: space-between;
469
+ align-items: flex-end;
276
470
  }
277
- .awsui_textarea_55fkh_1r4bl_172.awsui_textarea-warning_55fkh_1r4bl_276:not(#\9) {
278
- color: var(--color-text-status-warning-csaw41, #855900);
279
- border-color: var(--color-text-status-warning-csaw41, #855900);
471
+ .awsui_secondary-actions_55fkh_1vvqx_426.awsui_with-paddings_55fkh_1vvqx_416:not(#\9) {
472
+ padding-inline-start: var(--space-field-horizontal-gg19kw, 12px);
473
+ padding-block-start: var(--space-scaled-s-aqzyko, 12px);
474
+ padding-block-end: var(--space-scaled-xxs-7597g1, 4px);
475
+ }
476
+ .awsui_secondary-actions_55fkh_1vvqx_426.awsui_with-paddings_55fkh_1vvqx_416.awsui_invalid_55fkh_1vvqx_325:not(#\9), .awsui_secondary-actions_55fkh_1vvqx_426.awsui_with-paddings_55fkh_1vvqx_416.awsui_warning_55fkh_1vvqx_325:not(#\9) {
280
477
  padding-inline-start: calc(var(--space-field-horizontal-gg19kw, 12px) - (var(--border-invalid-width-5ktjp2, 8px) - var(--border-field-width-09w7vk, 2px)));
281
- border-inline-start-width: var(--border-invalid-width-5ktjp2, 8px);
282
478
  }
283
- .awsui_textarea_55fkh_1r4bl_172.awsui_textarea-warning_55fkh_1r4bl_276:not(#\9):focus {
284
- box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-fhmbjn, 2px) var(--color-border-item-focused-nv6mhz, #006ce0);
479
+ .awsui_secondary-actions_55fkh_1vvqx_426.awsui_with-paddings_55fkh_1vvqx_416 > .awsui_button_55fkh_1vvqx_348:not(#\9) {
480
+ padding-block-end: 0;
285
481
  }
286
- .awsui_textarea_55fkh_1r4bl_172.awsui_textarea-with-button_55fkh_1r4bl_285:not(#\9) {
287
- padding-inline-end: calc(var(--space-field-horizontal-gg19kw, 12px) + var(--space-static-xxs-82cdfi, 4px) + var(--size-icon-normal-0m1722, 16px));
482
+ .awsui_secondary-actions_55fkh_1vvqx_426 > .awsui_button_55fkh_1vvqx_348:not(#\9) {
483
+ padding-block-end: var(--space-scaled-xxs-7597g1, 4px);
288
484
  }
@@ -2,13 +2,19 @@
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_55fkh_1r4bl_142",
6
- "button": "awsui_button_55fkh_1r4bl_145",
7
- "action-button": "awsui_action-button_55fkh_1r4bl_150",
8
- "textarea": "awsui_textarea_55fkh_1r4bl_172",
9
- "textarea-readonly": "awsui_textarea-readonly_55fkh_1r4bl_225",
10
- "textarea-invalid": "awsui_textarea-invalid_55fkh_1r4bl_267",
11
- "textarea-warning": "awsui_textarea-warning_55fkh_1r4bl_276",
12
- "textarea-with-button": "awsui_textarea-with-button_55fkh_1r4bl_285"
5
+ "root": "awsui_root_55fkh_1vvqx_142",
6
+ "textarea-readonly": "awsui_textarea-readonly_55fkh_1vvqx_184",
7
+ "disabled": "awsui_disabled_55fkh_1vvqx_189",
8
+ "textarea-invalid": "awsui_textarea-invalid_55fkh_1vvqx_197",
9
+ "textarea-warning": "awsui_textarea-warning_55fkh_1vvqx_222",
10
+ "textarea": "awsui_textarea_55fkh_1vvqx_184",
11
+ "invalid": "awsui_invalid_55fkh_1vvqx_325",
12
+ "warning": "awsui_warning_55fkh_1vvqx_325",
13
+ "textarea-wrapper": "awsui_textarea-wrapper_55fkh_1vvqx_344",
14
+ "button": "awsui_button_55fkh_1vvqx_348",
15
+ "action-button": "awsui_action-button_55fkh_1vvqx_353",
16
+ "secondary-content": "awsui_secondary-content_55fkh_1vvqx_378",
17
+ "with-paddings": "awsui_with-paddings_55fkh_1vvqx_416",
18
+ "secondary-actions": "awsui_secondary-actions_55fkh_1vvqx_426"
13
19
  };
14
20