@cloudscape-design/components 3.0.1166 → 3.0.1168
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/autosuggest/internal.d.ts.map +1 -1
- package/autosuggest/internal.js +5 -1
- package/autosuggest/internal.js.map +1 -1
- package/icon/interfaces.d.ts +1 -1
- package/icon/interfaces.d.ts.map +1 -1
- package/icon/interfaces.js.map +1 -1
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/components/button-trigger/index.d.ts +1 -0
- package/internal/components/button-trigger/index.d.ts.map +1 -1
- package/internal/components/button-trigger/index.js +2 -2
- package/internal/components/button-trigger/index.js.map +1 -1
- package/internal/components/button-trigger/styles.css.js +14 -13
- package/internal/components/button-trigger/styles.scoped.css +32 -27
- package/internal/components/button-trigger/styles.selectors.js +14 -13
- package/internal/components/drag-handle-wrapper/direction-button.d.ts +5 -1
- package/internal/components/drag-handle-wrapper/direction-button.d.ts.map +1 -1
- package/internal/components/drag-handle-wrapper/direction-button.js +2 -2
- package/internal/components/drag-handle-wrapper/direction-button.js.map +1 -1
- package/internal/components/drag-handle-wrapper/index.d.ts.map +1 -1
- package/internal/components/drag-handle-wrapper/index.js +30 -7
- package/internal/components/drag-handle-wrapper/index.js.map +1 -1
- package/internal/components/drag-handle-wrapper/styles.css.js +30 -21
- package/internal/components/drag-handle-wrapper/styles.scoped.css +75 -39
- package/internal/components/drag-handle-wrapper/styles.selectors.js +30 -21
- package/internal/components/option/index.d.ts +1 -0
- package/internal/components/option/index.d.ts.map +1 -1
- package/internal/components/option/index.js +5 -1
- package/internal/components/option/index.js.map +1 -1
- package/internal/components/option/interfaces.d.ts +2 -1
- package/internal/components/option/interfaces.d.ts.map +1 -1
- package/internal/components/option/interfaces.js.map +1 -1
- package/internal/components/option/styles.css.js +17 -16
- package/internal/components/option/styles.scoped.css +32 -28
- package/internal/components/option/styles.selectors.js +17 -16
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/manifest.json +1 -1
- package/multiselect/index.d.ts.map +1 -1
- package/multiselect/index.js +2 -2
- package/multiselect/index.js.map +1 -1
- package/multiselect/interfaces.d.ts +37 -0
- package/multiselect/interfaces.d.ts.map +1 -1
- package/multiselect/interfaces.js.map +1 -1
- package/multiselect/internal.d.ts.map +1 -1
- package/multiselect/internal.js +8 -4
- package/multiselect/internal.js.map +1 -1
- package/package.json +1 -1
- package/select/index.d.ts.map +1 -1
- package/select/index.js +2 -2
- package/select/index.js.map +1 -1
- package/select/interfaces.d.ts +31 -1
- package/select/interfaces.d.ts.map +1 -1
- package/select/interfaces.js.map +1 -1
- package/select/internal.d.ts.map +1 -1
- package/select/internal.js +8 -4
- package/select/internal.js.map +1 -1
- package/select/parts/item.d.ts +13 -2
- package/select/parts/item.d.ts.map +1 -1
- package/select/parts/item.js +62 -6
- package/select/parts/item.js.map +1 -1
- package/select/parts/multiselect-item.d.ts +9 -2
- package/select/parts/multiselect-item.d.ts.map +1 -1
- package/select/parts/multiselect-item.js +79 -5
- package/select/parts/multiselect-item.js.map +1 -1
- package/select/parts/plain-list.d.ts +3 -0
- package/select/parts/plain-list.d.ts.map +1 -1
- package/select/parts/plain-list.js +2 -1
- package/select/parts/plain-list.js.map +1 -1
- package/select/parts/trigger.d.ts +1 -0
- package/select/parts/trigger.d.ts.map +1 -1
- package/select/parts/trigger.js +17 -3
- package/select/parts/trigger.js.map +1 -1
- package/select/parts/virtual-list.d.ts.map +1 -1
- package/select/parts/virtual-list.js +2 -1
- package/select/parts/virtual-list.js.map +1 -1
- package/select/utils/render-options.d.ts +5 -1
- package/select/utils/render-options.d.ts.map +1 -1
- package/select/utils/render-options.js +15 -4
- package/select/utils/render-options.js.map +1 -1
- package/test-utils/dom/internal/option.d.ts +4 -0
- package/test-utils/dom/internal/option.js +10 -1
- package/test-utils/dom/internal/option.js.map +1 -1
- package/test-utils/selectors/internal/option.d.ts +4 -0
- package/test-utils/selectors/internal/option.js +10 -1
- package/test-utils/selectors/internal/option.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAmBhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAmB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOjE,UAAU,wBAAyB,SAAQ,gBAAgB,EAAE,0BAA0B;CAAG;AAE1F,QAAA,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAmBhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAmB,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAOjE,UAAU,wBAAyB,SAAQ,gBAAgB,EAAE,0BAA0B;CAAG;AAE1F,QAAA,MAAM,mBAAmB,uGA8OvB,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
|
package/autosuggest/internal.js
CHANGED
|
@@ -126,7 +126,11 @@ const InternalAutosuggest = React.forwardRef((props, ref) => {
|
|
|
126
126
|
hasRecoveryCallback: !!onLoadItems,
|
|
127
127
|
});
|
|
128
128
|
const shouldRenderDropdownContent = autosuggestItemsState.items.length !== 0 || !!dropdownStatus.content || (!hideEnteredTextOption && !!value);
|
|
129
|
-
|
|
129
|
+
const hasItems = useRef(autosuggestItemsState.items.length > 0);
|
|
130
|
+
hasItems.current = hasItems.current || autosuggestItemsState.items.length > 0;
|
|
131
|
+
return (React.createElement(AutosuggestInput, { ...restProps, className: clsx(styles.root, restProps.className), ref: autosuggestInputRef, __internalRootRef: __internalRootRef, value: value, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyUp: handleKeyUp, onKeyDown: handleKeyDown, name: name, controlId: controlId, placeholder: placeholder, disabled: disabled, readOnly: readOnly, autoFocus: autoFocus, ariaLabel: ariaLabel, ariaRequired: ariaRequired, clearAriaLabel: clearAriaLabel, disableBrowserAutocorrect: disableBrowserAutocorrect, expandToViewport: expandToViewport, ariaControls: listId, ariaActivedescendant: highlightedOptionId, dropdownExpanded: shouldRenderDropdownContent, style: style, dropdownContent: shouldRenderDropdownContent && (React.createElement(AutosuggestOptionsList, { statusType: statusType, autosuggestItemsState: autosuggestItemsState, autosuggestItemsHandlers: autosuggestItemsHandlers, highlightedOptionId: highlightedOptionId, highlightText: value, listId: listId, controlId: controlId, handleLoadMore: autosuggestLoadMoreHandlers.fireLoadMoreOnScroll, hasDropdownStatus: dropdownStatus.content !== null, virtualScroll: virtualScroll, selectedAriaLabel: selectedAriaLabel, renderHighlightedAriaLive: renderHighlightedAriaLive, listBottom: !dropdownStatus.isSticky ? React.createElement(DropdownFooter, { content: dropdownStatus.content, id: footerControlId }) : null, ariaDescribedby: dropdownStatus.content ? footerControlId : undefined })), dropdownFooter: dropdownStatus.isSticky && dropdownStatus.content ? (React.createElement(DropdownFooter, { id: footerControlId, content: dropdownStatus.content, hasItems: autosuggestItemsState.items.length >= 1 })) : null,
|
|
132
|
+
// Forces dropdown position recalculation when new options are loaded
|
|
133
|
+
dropdownContentKey: hasItems.current.toString(), loopFocus: dropdownStatus.hasRecoveryButton, onCloseDropdown: handleCloseDropdown, onDelayedInput: handleDelayedInput, onPressArrowDown: handlePressArrowDown, onPressArrowUp: handlePressArrowUp, onPressEnter: handlePressEnter }));
|
|
130
134
|
});
|
|
131
135
|
export default InternalAutosuggest;
|
|
132
136
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/autosuggest/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAO,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CA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OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,EAAE,EAAE,eAAe,GAAI,CAAC,CAAC,CAAC,IAAI,EAE5G,eAAe,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,GACrE,CACH,EAEH,cAAc,EACZ,cAAc,CAAC,QAAQ,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAClD,oBAAC,cAAc,IACb,EAAE,EAAE,eAAe,EACnB,OAAO,EAAE,cAAc,CAAC,OAAO,EAC/B,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GACjD,CACH,CAAC,CAAC,CAAC,IAAI,EAEV,SAAS,EAAE,cAAc,CAAC,iBAAiB,EAC3C,eAAe,EAAE,mBAAmB,EACpC,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,oBAAoB,EACtC,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gBAAgB,GAC9B,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { useInternalI18n } from '../i18n/context';\nimport { BaseChangeDetail } from '../input/interfaces';\nimport AutosuggestInput, { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport { OptionsLoadItemsDetail } from '../internal/components/dropdown/interfaces';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport {\n BaseKeyDetail,\n fireCancelableEvent,\n fireNonCancelableEvent,\n NonCancelableCustomEvent,\n} from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field';\nimport { AutosuggestItem, AutosuggestProps } from './interfaces';\nimport { useAutosuggestLoadMore } from './load-more-controller';\nimport { useAutosuggestItems } from './options-controller';\nimport AutosuggestOptionsList from './options-list';\n\nimport styles from './styles.css.js';\n\ninterface InternalAutosuggestProps extends AutosuggestProps, InternalBaseComponentProps {}\n\nconst InternalAutosuggest = React.forwardRef((props: InternalAutosuggestProps, ref: Ref<AutosuggestProps.Ref>) => {\n const {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onLoadItems,\n options,\n filteringType = 'auto',\n statusType = 'finished',\n placeholder,\n clearAriaLabel,\n name,\n disabled,\n disableBrowserAutocorrect = false,\n autoFocus,\n readOnly,\n ariaLabel,\n ariaRequired,\n enteredTextLabel,\n hideEnteredTextOption,\n filteringResultsText,\n onKeyDown,\n virtualScroll,\n expandToViewport,\n onSelect,\n renderHighlightedAriaLive,\n style,\n __internalRootRef,\n ...restProps\n } = props;\n\n checkControlled('Autosuggest', 'value', value, 'onChange', onChange);\n checkOptionValueField('Autosuggest', 'options', options);\n\n const autosuggestInputRef = useRef<AutosuggestInputRef>(null);\n useImperativeHandle(\n ref,\n () => ({\n focus: () => autosuggestInputRef.current?.focus(),\n select: () => autosuggestInputRef.current?.select(),\n }),\n []\n );\n\n const i18n = useInternalI18n('autosuggest');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Autosuggest', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({\n options: options || [],\n filterValue: value,\n filterText: value,\n filteringType,\n enteredTextLabel,\n hideEnteredTextLabel: hideEnteredTextOption,\n onSelectItem: (option: AutosuggestItem) => {\n const value = option.value || '';\n fireNonCancelableEvent(onChange, { value });\n fireNonCancelableEvent(onSelect, {\n value,\n selectedOption: option.type !== 'use-entered' ? option.option : undefined,\n });\n autosuggestInputRef.current?.close();\n },\n });\n\n const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({\n options,\n statusType,\n onLoadItems: (detail: OptionsLoadItemsDetail) => fireNonCancelableEvent(onLoadItems, detail),\n });\n\n const handleChange = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestItemsHandlers.setShowAll(false);\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n fireNonCancelableEvent(onChange, event.detail);\n };\n\n const handleDelayedInput = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value);\n };\n\n const handleBlur = () => {\n fireNonCancelableEvent(onBlur, null);\n };\n\n const handleFocus = () => {\n autosuggestItemsHandlers.setShowAll(true);\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus();\n fireNonCancelableEvent(onFocus, null);\n };\n\n const handleKeyUp = (event: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyUp, event.detail, event);\n };\n\n const handleKeyDown = (event: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyDown, event.detail, event);\n };\n\n const handlePressArrowDown = () => {\n if (autosuggestItemsState.items.length - 1 === autosuggestItemsState.highlightedIndex) {\n autosuggestItemsHandlers.goHomeWithKeyboard();\n return;\n }\n\n autosuggestItemsHandlers.moveHighlightWithKeyboard(1);\n };\n\n const handlePressArrowUp = () => {\n if (\n (autosuggestItemsState.highlightedOption?.type === 'child' && autosuggestItemsState.highlightedIndex === 1) ||\n autosuggestItemsState.highlightedIndex === 0\n ) {\n autosuggestItemsHandlers.goEndWithKeyboard();\n return;\n }\n\n autosuggestItemsHandlers.moveHighlightWithKeyboard(-1);\n };\n\n const handlePressEnter = () => {\n return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard();\n };\n\n const handleCloseDropdown = () => {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n };\n\n const handleRecoveryClick = () => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick();\n autosuggestInputRef.current?.focus();\n };\n\n const formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('input');\n const footerControlId = useUniqueId('footer');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const listId = useUniqueId('list');\n const highlightedOptionIdSource = useUniqueId();\n const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : undefined;\n\n const isEmpty = !value && !autosuggestItemsState.items.length;\n const isFiltered = !!value && value.length !== 0 && !(filteringType === 'auto' && autosuggestItemsState.showAll);\n const filteredText = isFiltered\n ? filteringResultsText?.(autosuggestItemsState.items.length, options?.length ?? 0)\n : undefined;\n const dropdownStatus = useDropdownStatus({\n ...props,\n isEmpty,\n recoveryText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n filteringResultsText: filteredText,\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const shouldRenderDropdownContent =\n autosuggestItemsState.items.length !== 0 || !!dropdownStatus.content || (!hideEnteredTextOption && !!value);\n\n return (\n <AutosuggestInput\n {...restProps}\n className={clsx(styles.root, restProps.className)}\n ref={autosuggestInputRef}\n __internalRootRef={__internalRootRef}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onKeyUp={handleKeyUp}\n onKeyDown={handleKeyDown}\n name={name}\n controlId={controlId}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n autoFocus={autoFocus}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n expandToViewport={expandToViewport}\n ariaControls={listId}\n ariaActivedescendant={highlightedOptionId}\n dropdownExpanded={shouldRenderDropdownContent}\n style={style}\n dropdownContent={\n shouldRenderDropdownContent && (\n <AutosuggestOptionsList\n statusType={statusType}\n autosuggestItemsState={autosuggestItemsState}\n autosuggestItemsHandlers={autosuggestItemsHandlers}\n highlightedOptionId={highlightedOptionId}\n highlightText={value}\n listId={listId}\n controlId={controlId}\n handleLoadMore={autosuggestLoadMoreHandlers.fireLoadMoreOnScroll}\n hasDropdownStatus={dropdownStatus.content !== null}\n virtualScroll={virtualScroll}\n selectedAriaLabel={selectedAriaLabel}\n renderHighlightedAriaLive={renderHighlightedAriaLive}\n listBottom={\n !dropdownStatus.isSticky ? <DropdownFooter content={dropdownStatus.content} id={footerControlId} /> : null\n }\n ariaDescribedby={dropdownStatus.content ? footerControlId : undefined}\n />\n )\n }\n dropdownFooter={\n dropdownStatus.isSticky && dropdownStatus.content ? (\n <DropdownFooter\n id={footerControlId}\n content={dropdownStatus.content}\n hasItems={autosuggestItemsState.items.length >= 1}\n />\n ) : null\n }\n loopFocus={dropdownStatus.hasRecoveryButton}\n onCloseDropdown={handleCloseDropdown}\n onDelayedInput={handleDelayedInput}\n onPressArrowDown={handlePressArrowDown}\n onPressArrowUp={handlePressArrowUp}\n onPressEnter={handlePressEnter}\n />\n );\n});\n\nexport default InternalAutosuggest;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/autosuggest/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAO,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,gBAAyC,MAAM,0CAA0C,CAAC;AAEjG,OAAO,cAAc,MAAM,wCAAwC,CAA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AE5G,eAAe,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,GACrE,CACH,EAEH,cAAc,EACZ,cAAc,CAAC,QAAQ,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAClD,oBAAC,cAAc,IACb,EAAE,EAAE,eAAe,EACnB,OAAO,EAAE,cAAc,CAAC,OAAO,EAC/B,QAAQ,EAAE,qBAAqB,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,GACjD,CACH,CAAC,CAAC,CAAC,IAAI;QAEV,qEAAqE;QACrE,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAC/C,SAAS,EAAE,cAAc,CAAC,iBAAiB,EAC3C,eAAe,EAAE,mBAAmB,EACpC,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,oBAAoB,EACtC,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gBAAgB,GAC9B,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useImperativeHandle, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { useInternalI18n } from '../i18n/context';\nimport { BaseChangeDetail } from '../input/interfaces';\nimport AutosuggestInput, { AutosuggestInputRef } from '../internal/components/autosuggest-input';\nimport { OptionsLoadItemsDetail } from '../internal/components/dropdown/interfaces';\nimport DropdownFooter from '../internal/components/dropdown-footer';\nimport { useDropdownStatus } from '../internal/components/dropdown-status';\nimport {\n BaseKeyDetail,\n fireCancelableEvent,\n fireNonCancelableEvent,\n NonCancelableCustomEvent,\n} from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { checkOptionValueField } from '../select/utils/check-option-value-field';\nimport { AutosuggestItem, AutosuggestProps } from './interfaces';\nimport { useAutosuggestLoadMore } from './load-more-controller';\nimport { useAutosuggestItems } from './options-controller';\nimport AutosuggestOptionsList from './options-list';\n\nimport styles from './styles.css.js';\n\ninterface InternalAutosuggestProps extends AutosuggestProps, InternalBaseComponentProps {}\n\nconst InternalAutosuggest = React.forwardRef((props: InternalAutosuggestProps, ref: Ref<AutosuggestProps.Ref>) => {\n const {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onLoadItems,\n options,\n filteringType = 'auto',\n statusType = 'finished',\n placeholder,\n clearAriaLabel,\n name,\n disabled,\n disableBrowserAutocorrect = false,\n autoFocus,\n readOnly,\n ariaLabel,\n ariaRequired,\n enteredTextLabel,\n hideEnteredTextOption,\n filteringResultsText,\n onKeyDown,\n virtualScroll,\n expandToViewport,\n onSelect,\n renderHighlightedAriaLive,\n style,\n __internalRootRef,\n ...restProps\n } = props;\n\n checkControlled('Autosuggest', 'value', value, 'onChange', onChange);\n checkOptionValueField('Autosuggest', 'options', options);\n\n const autosuggestInputRef = useRef<AutosuggestInputRef>(null);\n useImperativeHandle(\n ref,\n () => ({\n focus: () => autosuggestInputRef.current?.focus(),\n select: () => autosuggestInputRef.current?.select(),\n }),\n []\n );\n\n const i18n = useInternalI18n('autosuggest');\n const errorIconAriaLabel = i18n('errorIconAriaLabel', restProps.errorIconAriaLabel);\n const selectedAriaLabel = i18n('selectedAriaLabel', restProps.selectedAriaLabel);\n const recoveryText = i18n('recoveryText', restProps.recoveryText);\n\n if (restProps.recoveryText && !onLoadItems) {\n warnOnce('Autosuggest', '`onLoadItems` must be provided for `recoveryText` to be displayed.');\n }\n\n const [autosuggestItemsState, autosuggestItemsHandlers] = useAutosuggestItems({\n options: options || [],\n filterValue: value,\n filterText: value,\n filteringType,\n enteredTextLabel,\n hideEnteredTextLabel: hideEnteredTextOption,\n onSelectItem: (option: AutosuggestItem) => {\n const value = option.value || '';\n fireNonCancelableEvent(onChange, { value });\n fireNonCancelableEvent(onSelect, {\n value,\n selectedOption: option.type !== 'use-entered' ? option.option : undefined,\n });\n autosuggestInputRef.current?.close();\n },\n });\n\n const autosuggestLoadMoreHandlers = useAutosuggestLoadMore({\n options,\n statusType,\n onLoadItems: (detail: OptionsLoadItemsDetail) => fireNonCancelableEvent(onLoadItems, detail),\n });\n\n const handleChange = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestItemsHandlers.setShowAll(false);\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n fireNonCancelableEvent(onChange, event.detail);\n };\n\n const handleDelayedInput = (event: NonCancelableCustomEvent<BaseChangeDetail>) => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputChange(event.detail.value);\n };\n\n const handleBlur = () => {\n fireNonCancelableEvent(onBlur, null);\n };\n\n const handleFocus = () => {\n autosuggestItemsHandlers.setShowAll(true);\n autosuggestLoadMoreHandlers.fireLoadMoreOnInputFocus();\n fireNonCancelableEvent(onFocus, null);\n };\n\n const handleKeyUp = (event: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyUp, event.detail, event);\n };\n\n const handleKeyDown = (event: CustomEvent<BaseKeyDetail>) => {\n fireCancelableEvent(onKeyDown, event.detail, event);\n };\n\n const handlePressArrowDown = () => {\n if (autosuggestItemsState.items.length - 1 === autosuggestItemsState.highlightedIndex) {\n autosuggestItemsHandlers.goHomeWithKeyboard();\n return;\n }\n\n autosuggestItemsHandlers.moveHighlightWithKeyboard(1);\n };\n\n const handlePressArrowUp = () => {\n if (\n (autosuggestItemsState.highlightedOption?.type === 'child' && autosuggestItemsState.highlightedIndex === 1) ||\n autosuggestItemsState.highlightedIndex === 0\n ) {\n autosuggestItemsHandlers.goEndWithKeyboard();\n return;\n }\n\n autosuggestItemsHandlers.moveHighlightWithKeyboard(-1);\n };\n\n const handlePressEnter = () => {\n return autosuggestItemsHandlers.selectHighlightedOptionWithKeyboard();\n };\n\n const handleCloseDropdown = () => {\n autosuggestItemsHandlers.resetHighlightWithKeyboard();\n };\n\n const handleRecoveryClick = () => {\n autosuggestLoadMoreHandlers.fireLoadMoreOnRecoveryClick();\n autosuggestInputRef.current?.focus();\n };\n\n const formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('input');\n const footerControlId = useUniqueId('footer');\n const controlId = formFieldContext.controlId ?? selfControlId;\n const listId = useUniqueId('list');\n const highlightedOptionIdSource = useUniqueId();\n const highlightedOptionId = autosuggestItemsState.highlightedOption ? highlightedOptionIdSource : undefined;\n\n const isEmpty = !value && !autosuggestItemsState.items.length;\n const isFiltered = !!value && value.length !== 0 && !(filteringType === 'auto' && autosuggestItemsState.showAll);\n const filteredText = isFiltered\n ? filteringResultsText?.(autosuggestItemsState.items.length, options?.length ?? 0)\n : undefined;\n const dropdownStatus = useDropdownStatus({\n ...props,\n isEmpty,\n recoveryText,\n errorIconAriaLabel,\n onRecoveryClick: handleRecoveryClick,\n filteringResultsText: filteredText,\n hasRecoveryCallback: !!onLoadItems,\n });\n\n const shouldRenderDropdownContent =\n autosuggestItemsState.items.length !== 0 || !!dropdownStatus.content || (!hideEnteredTextOption && !!value);\n\n const hasItems = useRef(autosuggestItemsState.items.length > 0);\n hasItems.current = hasItems.current || autosuggestItemsState.items.length > 0;\n\n return (\n <AutosuggestInput\n {...restProps}\n className={clsx(styles.root, restProps.className)}\n ref={autosuggestInputRef}\n __internalRootRef={__internalRootRef}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n onFocus={handleFocus}\n onKeyUp={handleKeyUp}\n onKeyDown={handleKeyDown}\n name={name}\n controlId={controlId}\n placeholder={placeholder}\n disabled={disabled}\n readOnly={readOnly}\n autoFocus={autoFocus}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n expandToViewport={expandToViewport}\n ariaControls={listId}\n ariaActivedescendant={highlightedOptionId}\n dropdownExpanded={shouldRenderDropdownContent}\n style={style}\n dropdownContent={\n shouldRenderDropdownContent && (\n <AutosuggestOptionsList\n statusType={statusType}\n autosuggestItemsState={autosuggestItemsState}\n autosuggestItemsHandlers={autosuggestItemsHandlers}\n highlightedOptionId={highlightedOptionId}\n highlightText={value}\n listId={listId}\n controlId={controlId}\n handleLoadMore={autosuggestLoadMoreHandlers.fireLoadMoreOnScroll}\n hasDropdownStatus={dropdownStatus.content !== null}\n virtualScroll={virtualScroll}\n selectedAriaLabel={selectedAriaLabel}\n renderHighlightedAriaLive={renderHighlightedAriaLive}\n listBottom={\n !dropdownStatus.isSticky ? <DropdownFooter content={dropdownStatus.content} id={footerControlId} /> : null\n }\n ariaDescribedby={dropdownStatus.content ? footerControlId : undefined}\n />\n )\n }\n dropdownFooter={\n dropdownStatus.isSticky && dropdownStatus.content ? (\n <DropdownFooter\n id={footerControlId}\n content={dropdownStatus.content}\n hasItems={autosuggestItemsState.items.length >= 1}\n />\n ) : null\n }\n // Forces dropdown position recalculation when new options are loaded\n dropdownContentKey={hasItems.current.toString()}\n loopFocus={dropdownStatus.hasRecoveryButton}\n onCloseDropdown={handleCloseDropdown}\n onDelayedInput={handleDelayedInput}\n onPressArrowDown={handlePressArrowDown}\n onPressArrowUp={handlePressArrowUp}\n onPressEnter={handlePressEnter}\n />\n );\n});\n\nexport default InternalAutosuggest;\n"]}
|
package/icon/interfaces.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export interface IconProps extends BaseComponentProps {
|
|
|
76
76
|
nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLElement>>;
|
|
77
77
|
}
|
|
78
78
|
export declare namespace IconProps {
|
|
79
|
-
type Name = 'add-plus' | 'anchor-link' | 'angle-left-double' | 'angle-left' | 'angle-right-double' | 'angle-right' | 'angle-up' | 'angle-down' | 'arrow-left' | 'arrow-right' | 'arrow-up' | 'arrow-down' | 'at-symbol' | 'audio-full' | 'audio-half' | 'audio-off' | 'backward-10-seconds' | 'bug' | 'call' | 'calendar' | 'caret-down-filled' | 'caret-down' | 'caret-left-filled' | 'caret-right-filled' | 'caret-up-filled' | 'caret-up' | 'check' | 'contact' | 'close' | 'closed-caption' | 'closed-caption-unavailable' | 'copy' | 'command-prompt' | 'delete-marker' | 'download' | 'drag-indicator' | 'edit' | 'ellipsis' | 'envelope' | 'exit-full-screen' | 'expand' | 'external' | 'face-happy' | 'face-happy-filled' | 'face-neutral' | 'face-neutral-filled' | 'face-sad' | 'face-sad-filled' | 'file-open' | 'file' | 'filter' | 'flag' | 'folder-open' | 'folder' | 'forward-10-seconds' | 'full-screen' | 'gen-ai' | 'globe' | 'grid-view' | 'group-active' | 'group' | 'heart' | 'heart-filled' | 'history' | 'insert-row' | 'key' | 'keyboard' | 'list-view' | 'location-pin' | 'lock-private' | 'map' | 'menu' | 'microphone' | 'microphone-off' | 'mini-player' | 'multiscreen' | 'notification' | 'pause' | 'play' | 'redo' | 'refresh' | 'remove' | 'resize-area' | 'script' | 'search' | 'security' | 'settings' | 'send' | 'share' | 'shrink' | 'slash' | 'star-filled' | 'star-half' | 'star' | 'status-in-progress' | 'status-info' | 'status-negative' | 'status-not-started' | 'status-pending' | 'status-positive' | 'status-stopped' | 'status-warning' | 'stop-circle' | 'subtract-minus' | 'suggestions' | 'support' | 'thumbs-down-filled' | 'thumbs-down' | 'thumbs-up-filled' | 'thumbs-up' | 'ticket' | 'transcript' | 'treeview-collapse' | 'treeview-expand' | 'undo' | 'unlocked' | 'upload-download' | 'upload' | 'user-profile-active' | 'user-profile' | 'video-off' | 'video-on' | 'video-unavailable' | 'video-camera-off' | 'video-camera-on' | 'video-camera-unavailable' | 'view-full' | 'view-horizontal' | 'view-vertical' | 'zoom-in' | 'zoom-out' | 'zoom-to-fit';
|
|
79
|
+
type Name = 'add-plus' | 'anchor-link' | 'angle-left-double' | 'angle-left' | 'angle-right-double' | 'angle-right' | 'angle-up' | 'angle-down' | 'arrow-left' | 'arrow-right' | 'arrow-up' | 'arrow-down' | 'at-symbol' | 'audio-full' | 'audio-half' | 'audio-off' | 'backward-10-seconds' | 'bug' | 'call' | 'calendar' | 'caret-down-filled' | 'caret-down' | 'caret-left-filled' | 'caret-right-filled' | 'caret-up-filled' | 'caret-up' | 'check' | 'contact' | 'close' | 'closed-caption' | 'closed-caption-unavailable' | 'copy' | 'command-prompt' | 'delete-marker' | 'download' | 'drag-indicator' | 'edit' | 'edit-gen-ai' | 'ellipsis' | 'envelope' | 'exit-full-screen' | 'expand' | 'external' | 'face-happy' | 'face-happy-filled' | 'face-neutral' | 'face-neutral-filled' | 'face-sad' | 'face-sad-filled' | 'file-open' | 'file' | 'filter' | 'flag' | 'folder-open' | 'folder' | 'forward-10-seconds' | 'full-screen' | 'gen-ai' | 'globe' | 'grid-view' | 'group-active' | 'group' | 'heart' | 'heart-filled' | 'history' | 'insert-row' | 'key' | 'keyboard' | 'list-view' | 'location-pin' | 'lock-private' | 'map' | 'menu' | 'microphone' | 'microphone-off' | 'mini-player' | 'multiscreen' | 'notification' | 'pause' | 'play' | 'redo' | 'refresh' | 'remove' | 'resize-area' | 'script' | 'search' | 'search-gen-ai' | 'security' | 'settings' | 'send' | 'share' | 'shrink' | 'slash' | 'star-filled' | 'star-half' | 'star' | 'status-in-progress' | 'status-info' | 'status-negative' | 'status-not-started' | 'status-pending' | 'status-positive' | 'status-stopped' | 'status-warning' | 'stop-circle' | 'subtract-minus' | 'suggestions' | 'suggestions-gen-ai' | 'support' | 'thumbs-down-filled' | 'thumbs-down' | 'thumbs-up-filled' | 'thumbs-up' | 'ticket' | 'transcript' | 'treeview-collapse' | 'treeview-expand' | 'undo' | 'unlocked' | 'upload-download' | 'upload' | 'user-profile-active' | 'user-profile' | 'video-off' | 'video-on' | 'video-unavailable' | 'video-camera-off' | 'video-camera-on' | 'video-camera-unavailable' | 'view-full' | 'view-horizontal' | 'view-vertical' | 'zoom-in' | 'zoom-out' | 'zoom-to-fit';
|
|
80
80
|
type Variant = 'normal' | 'disabled' | 'error' | 'inverted' | 'link' | 'subtle' | 'success' | 'warning';
|
|
81
81
|
type Size = 'small' | 'normal' | 'medium' | 'big' | 'large' | 'inherit';
|
|
82
82
|
}
|
package/icon/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/icon/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,MAAM,WAAW,SAAU,SAAQ,kBAAkB;IACnD;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAEtB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC;IAE5B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEtB;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;CACxE;AAED,yBAAiB,SAAS,CAAC;IAGzB,KAAY,IAAI,GACZ,UAAU,GACV,aAAa,GACb,mBAAmB,GACnB,YAAY,GACZ,oBAAoB,GACpB,aAAa,GACb,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,UAAU,GACV,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,WAA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gB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,aAAa,GACb,gBAAgB,GAChB,aAAa,GACb,oBAAoB,GACpB,SAAS,GACT,oBAAoB,GACpB,aAAa,GACb,kBAAkB,GAClB,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,mBAAmB,GACnB,iBAAiB,GACjB,MAAM,GACN,UAAU,GACV,iBAAiB,GACjB,QAAQ,GACR,qBAAqB,GACrB,cAAc,GACd,WAAW,GACX,UAAU,GACV,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,0BAA0B,GAC1B,WAAW,GACX,iBAAiB,GACjB,eAAe,GACf,SAAS,GACT,UAAU,GACV,aAAa,CAAC;IAElB,KAAY,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAE/G,KAAY,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC;CAChF"}
|
package/icon/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/icon/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\n\nexport interface IconProps extends BaseComponentProps {\n /**\n * Specifies the icon to be displayed.\n */\n name?: IconProps.Name;\n\n /**\n * Specifies the size of the icon.\n *\n * If you set size to `inherit`, an icon size will be assigned based on the icon's inherited line height.\n * For icons used alongside text, ensure the icon is placed inside the acompanying text tag.\n * The icon will be vertically centered based on the height.\n *\n * @visualrefresh `medium` size\n */\n size?: IconProps.Size;\n\n /**\n * Specifies the color variant of the icon. The `normal` variant picks up the current color of its context.\n */\n variant?: IconProps.Variant;\n\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon cannot be an SVG.\n * For SVG icons, use the `svg` slot instead.\n *\n * If you set both `url` and `svg`, `svg` will take precedence.\n */\n url?: string;\n\n /**\n * Specifies alternate text for a custom icon (using the `url` attribute).\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `svg` slot.\n *\n * @deprecated Use `ariaLabel` instead.\n */\n alt?: string;\n\n /**\n * Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n */\n ariaLabel?: string;\n\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if the icon you want isn't available, and 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` and ensure icon `size` is not set to `inherit`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `url` and `svg`, `svg` 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 svg?: React.ReactNode;\n\n /**\n * Attributes to add to the native 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 nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLElement>>;\n}\n\nexport namespace IconProps {\n // Why not enums? Explained there\n // https://stackoverflow.com/questions/52393730/typescript-string-literal-union-type-from-enum\n export type Name =\n | 'add-plus'\n | 'anchor-link'\n | 'angle-left-double'\n | 'angle-left'\n | 'angle-right-double'\n | 'angle-right'\n | 'angle-up'\n | 'angle-down'\n | 'arrow-left'\n | 'arrow-right'\n | 'arrow-up'\n | 'arrow-down'\n | 'at-symbol'\n | 'audio-full'\n | 'audio-half'\n | 'audio-off'\n | 'backward-10-seconds'\n | 'bug'\n | 'call'\n | 'calendar'\n | 'caret-down-filled'\n | 'caret-down'\n | 'caret-left-filled'\n | 'caret-right-filled'\n | 'caret-up-filled'\n | 'caret-up'\n | 'check'\n | 'contact'\n | 'close'\n | 'closed-caption'\n | 'closed-caption-unavailable'\n | 'copy'\n | 'command-prompt'\n | 'delete-marker'\n | 'download'\n | 'drag-indicator'\n | 'edit'\n | 'ellipsis'\n | 'envelope'\n | 'exit-full-screen'\n | 'expand'\n | 'external'\n | 'face-happy'\n | 'face-happy-filled'\n | 'face-neutral'\n | 'face-neutral-filled'\n | 'face-sad'\n | 'face-sad-filled'\n | 'file-open'\n | 'file'\n | 'filter'\n | 'flag'\n | 'folder-open'\n | 'folder'\n | 'forward-10-seconds'\n | 'full-screen'\n | 'gen-ai'\n | 'globe'\n | 'grid-view'\n | 'group-active'\n | 'group'\n | 'heart'\n | 'heart-filled'\n | 'history'\n | 'insert-row'\n | 'key'\n | 'keyboard'\n | 'list-view'\n | 'location-pin'\n | 'lock-private'\n | 'map'\n | 'menu'\n | 'microphone'\n | 'microphone-off'\n | 'mini-player'\n | 'multiscreen'\n | 'notification'\n | 'pause'\n | 'play'\n | 'redo'\n | 'refresh'\n | 'remove'\n | 'resize-area'\n | 'script'\n | 'search'\n | 'security'\n | 'settings'\n | 'send'\n | 'share'\n | 'shrink'\n | 'slash'\n | 'star-filled'\n | 'star-half'\n | 'star'\n | 'status-in-progress'\n | 'status-info'\n | 'status-negative'\n | 'status-not-started'\n | 'status-pending'\n | 'status-positive'\n | 'status-stopped'\n | 'status-warning'\n | 'stop-circle'\n | 'subtract-minus'\n | 'suggestions'\n | 'support'\n | 'thumbs-down-filled'\n | 'thumbs-down'\n | 'thumbs-up-filled'\n | 'thumbs-up'\n | 'ticket'\n | 'transcript'\n | 'treeview-collapse'\n | 'treeview-expand'\n | 'undo'\n | 'unlocked'\n | 'upload-download'\n | 'upload'\n | 'user-profile-active'\n | 'user-profile'\n | 'video-off'\n | 'video-on'\n | 'video-unavailable'\n | 'video-camera-off'\n | 'video-camera-on'\n | 'video-camera-unavailable'\n | 'view-full'\n | 'view-horizontal'\n | 'view-vertical'\n | 'zoom-in'\n | 'zoom-out'\n | 'zoom-to-fit';\n\n export type Variant = 'normal' | 'disabled' | 'error' | 'inverted' | 'link' | 'subtle' | 'success' | 'warning';\n\n export type Size = 'small' | 'normal' | 'medium' | 'big' | 'large' | 'inherit';\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/icon/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\n\nexport interface IconProps extends BaseComponentProps {\n /**\n * Specifies the icon to be displayed.\n */\n name?: IconProps.Name;\n\n /**\n * Specifies the size of the icon.\n *\n * If you set size to `inherit`, an icon size will be assigned based on the icon's inherited line height.\n * For icons used alongside text, ensure the icon is placed inside the acompanying text tag.\n * The icon will be vertically centered based on the height.\n *\n * @visualrefresh `medium` size\n */\n size?: IconProps.Size;\n\n /**\n * Specifies the color variant of the icon. The `normal` variant picks up the current color of its context.\n */\n variant?: IconProps.Variant;\n\n /**\n * Specifies the URL of a custom icon. Use this property if the icon you want isn't available, and your custom icon cannot be an SVG.\n * For SVG icons, use the `svg` slot instead.\n *\n * If you set both `url` and `svg`, `svg` will take precedence.\n */\n url?: string;\n\n /**\n * Specifies alternate text for a custom icon (using the `url` attribute).\n * This property is ignored if you use a predefined icon or if you set your custom icon using the `svg` slot.\n *\n * @deprecated Use `ariaLabel` instead.\n */\n alt?: string;\n\n /**\n * Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n */\n ariaLabel?: string;\n\n /**\n * Specifies the SVG of a custom icon.\n *\n * Use this property if the icon you want isn't available, and 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` and ensure icon `size` is not set to `inherit`.\n * You can still set the stroke to `currentColor` to inherit the color of the surrounding elements.\n *\n * If you set both `url` and `svg`, `svg` 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 svg?: React.ReactNode;\n\n /**\n * Attributes to add to the native 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 nativeAttributes?: NativeAttributes<React.HTMLAttributes<HTMLElement>>;\n}\n\nexport namespace IconProps {\n // Why not enums? Explained there\n // https://stackoverflow.com/questions/52393730/typescript-string-literal-union-type-from-enum\n export type Name =\n | 'add-plus'\n | 'anchor-link'\n | 'angle-left-double'\n | 'angle-left'\n | 'angle-right-double'\n | 'angle-right'\n | 'angle-up'\n | 'angle-down'\n | 'arrow-left'\n | 'arrow-right'\n | 'arrow-up'\n | 'arrow-down'\n | 'at-symbol'\n | 'audio-full'\n | 'audio-half'\n | 'audio-off'\n | 'backward-10-seconds'\n | 'bug'\n | 'call'\n | 'calendar'\n | 'caret-down-filled'\n | 'caret-down'\n | 'caret-left-filled'\n | 'caret-right-filled'\n | 'caret-up-filled'\n | 'caret-up'\n | 'check'\n | 'contact'\n | 'close'\n | 'closed-caption'\n | 'closed-caption-unavailable'\n | 'copy'\n | 'command-prompt'\n | 'delete-marker'\n | 'download'\n | 'drag-indicator'\n | 'edit'\n | 'edit-gen-ai'\n | 'ellipsis'\n | 'envelope'\n | 'exit-full-screen'\n | 'expand'\n | 'external'\n | 'face-happy'\n | 'face-happy-filled'\n | 'face-neutral'\n | 'face-neutral-filled'\n | 'face-sad'\n | 'face-sad-filled'\n | 'file-open'\n | 'file'\n | 'filter'\n | 'flag'\n | 'folder-open'\n | 'folder'\n | 'forward-10-seconds'\n | 'full-screen'\n | 'gen-ai'\n | 'globe'\n | 'grid-view'\n | 'group-active'\n | 'group'\n | 'heart'\n | 'heart-filled'\n | 'history'\n | 'insert-row'\n | 'key'\n | 'keyboard'\n | 'list-view'\n | 'location-pin'\n | 'lock-private'\n | 'map'\n | 'menu'\n | 'microphone'\n | 'microphone-off'\n | 'mini-player'\n | 'multiscreen'\n | 'notification'\n | 'pause'\n | 'play'\n | 'redo'\n | 'refresh'\n | 'remove'\n | 'resize-area'\n | 'script'\n | 'search'\n | 'search-gen-ai'\n | 'security'\n | 'settings'\n | 'send'\n | 'share'\n | 'shrink'\n | 'slash'\n | 'star-filled'\n | 'star-half'\n | 'star'\n | 'status-in-progress'\n | 'status-info'\n | 'status-negative'\n | 'status-not-started'\n | 'status-pending'\n | 'status-positive'\n | 'status-stopped'\n | 'status-warning'\n | 'stop-circle'\n | 'subtract-minus'\n | 'suggestions'\n | 'suggestions-gen-ai'\n | 'support'\n | 'thumbs-down-filled'\n | 'thumbs-down'\n | 'thumbs-up-filled'\n | 'thumbs-up'\n | 'ticket'\n | 'transcript'\n | 'treeview-collapse'\n | 'treeview-expand'\n | 'undo'\n | 'unlocked'\n | 'upload-download'\n | 'upload'\n | 'user-profile-active'\n | 'user-profile'\n | 'video-off'\n | 'video-on'\n | 'video-unavailable'\n | 'video-camera-off'\n | 'video-camera-on'\n | 'video-camera-unavailable'\n | 'view-full'\n | 'view-horizontal'\n | 'view-vertical'\n | 'zoom-in'\n | 'zoom-out'\n | 'zoom-to-fit';\n\n export type Variant = 'normal' | 'disabled' | 'error' | 'inverted' | 'link' | 'subtle' | 'success' | 'warning';\n\n export type Size = 'small' | 'normal' | 'medium' | 'big' | 'large' | 'inherit';\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/button-trigger/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAMpD,OAAO,EAAE,kBAAkB,EAAgB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAA0C,MAAM,cAAc,CAAC;AAS7G,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB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S,CAAC,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAClD,OAAO,CAAC,EAAE,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAChD,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,MAAM,CAAC,EAAE,sBAAsB,CAAC;QAAE,aAAa,EAAE,IAAI,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IAChE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAqGD,yBAAiB,kBAAkB,CAAC;IAClC,UAAiB,GAAG;QAClB,KAAK,IAAI,IAAI,CAAC;KACf;CACF;;AAED,wBAA+C"}
|
|
@@ -8,12 +8,12 @@ import { getBaseProps } from '../../base-component';
|
|
|
8
8
|
import { fireCancelableEvent, fireKeyboardEvent } from '../../events';
|
|
9
9
|
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
10
10
|
import styles from './styles.css.js';
|
|
11
|
-
const ButtonTrigger = ({ children, pressed, hideCaret = false, disabled = false, readOnly = false, invalid = false, warning = false, inlineTokens, inFilteringToken, ariaHasPopup, ariaLabel, ariaLabelledby, ariaDescribedby, ariaControls, onKeyDown, onKeyUp, onMouseDown, onClick, onFocus, onBlur, autoFocus, ...restProps }, ref) => {
|
|
11
|
+
const ButtonTrigger = ({ children, pressed, hideCaret = false, disabled = false, readOnly = false, invalid = false, warning = false, inlineTokens, inFilteringToken, ariaHasPopup, ariaLabel, ariaLabelledby, ariaDescribedby, ariaControls, onKeyDown, onKeyUp, onMouseDown, onClick, onFocus, onBlur, hasCustomContent = false, autoFocus, ...restProps }, ref) => {
|
|
12
12
|
const baseProps = getBaseProps(restProps);
|
|
13
13
|
let attributes = {
|
|
14
14
|
...baseProps,
|
|
15
15
|
type: 'button',
|
|
16
|
-
className: clsx(styles['button-trigger'], analyticsSelectors['button-trigger'], baseProps.className, pressed && styles.pressed, disabled && styles.disabled, invalid && styles.invalid, warning && !invalid && styles.warning, !hideCaret && styles['has-caret'], readOnly && styles.readonly, inFilteringToken && styles['in-filtering-token'], inFilteringToken && styles[`in-filtering-token-${inFilteringToken}`], inlineTokens && styles['inline-tokens']),
|
|
16
|
+
className: clsx(styles['button-trigger'], analyticsSelectors['button-trigger'], baseProps.className, pressed && styles.pressed, disabled && styles.disabled, invalid && styles.invalid, warning && !invalid && styles.warning, !hideCaret && styles['has-caret'], readOnly && styles.readonly, inFilteringToken && styles['in-filtering-token'], inFilteringToken && styles[`in-filtering-token-${inFilteringToken}`], inlineTokens && styles['inline-tokens'], !!hasCustomContent && styles['custom-option']),
|
|
17
17
|
disabled: disabled,
|
|
18
18
|
'aria-expanded': pressed,
|
|
19
19
|
'aria-label': ariaLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/button-trigger/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAsB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAyC,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAM7G,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AACpE,OAAO,MAAM,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/button-trigger/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO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CAAC,aAAa,EAAE,EAAE,KAAK,CAAC,CAAC;SACxG,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,EAAE,CAAC;QACZ,UAAU,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC;IACvC,CAAC;IAED,MAAM,iBAAiB,GAE+B;QACpD,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU;QACxC,MAAM,EAAE;YACN,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SACxB;KACF,CAAC;IAEF,OAAO,CACL,gCACE,GAAG,EAAE,GAAG,KACJ,UAAU,KACV,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,6BAA6B,CAAC,iBAAiB,CAAC,CAAC;QAEjF,QAAQ;QACR,CAAC,SAAS,IAAI,CACb,8BAAM,SAAS,EAAE,MAAM,CAAC,KAAK;YAC3B,oBAAC,YAAY,IAAC,IAAI,EAAC,mBAAmB,EAAC,OAAO,EAAE,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,GAAI,CAC3F,CACR,CACM,CACV,CAAC;AACJ,CAAC,CAAC;AAQF,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, { ButtonHTMLAttributes } from 'react';\nimport clsx from 'clsx';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalIcon from '../../../icon/internal';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport { BaseKeyDetail, CancelableEventHandler, fireCancelableEvent, fireKeyboardEvent } from '../../events';\nimport {\n GeneratedAnalyticsMetadataButtonTriggerCollapse,\n GeneratedAnalyticsMetadataButtonTriggerExpand,\n} from './analytics-metadata/interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface ButtonTriggerProps extends BaseComponentProps {\n children?: React.ReactNode;\n pressed?: boolean;\n hideCaret?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n warning?: boolean;\n inFilteringToken?: 'root' | 'nested';\n inlineTokens?: boolean;\n ariaHasPopup?: 'true' | 'listbox' | 'dialog';\n ariaControls?: string;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n onKeyDown?: CancelableEventHandler<BaseKeyDetail>;\n onKeyUp?: CancelableEventHandler<BaseKeyDetail>;\n onMouseDown?: CancelableEventHandler;\n onClick?: CancelableEventHandler;\n onFocus?: CancelableEventHandler;\n onBlur?: CancelableEventHandler<{ relatedTarget: Node | null }>;\n hasCustomContent?: boolean;\n autoFocus?: boolean;\n}\n\nconst ButtonTrigger = (\n {\n children,\n pressed,\n hideCaret = false,\n disabled = false,\n readOnly = false,\n invalid = false,\n warning = false,\n inlineTokens,\n inFilteringToken,\n ariaHasPopup,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n ariaControls,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onClick,\n onFocus,\n onBlur,\n hasCustomContent = false,\n autoFocus,\n ...restProps\n }: ButtonTriggerProps,\n ref: React.Ref<HTMLButtonElement>\n) => {\n const baseProps = getBaseProps(restProps);\n let attributes: ButtonHTMLAttributes<HTMLButtonElement> = {\n ...baseProps,\n type: 'button',\n className: clsx(\n styles['button-trigger'],\n analyticsSelectors['button-trigger'],\n baseProps.className,\n pressed && styles.pressed,\n disabled && styles.disabled,\n invalid && styles.invalid,\n warning && !invalid && styles.warning,\n !hideCaret && styles['has-caret'],\n readOnly && styles.readonly,\n inFilteringToken && styles['in-filtering-token'],\n inFilteringToken && styles[`in-filtering-token-${inFilteringToken}`],\n inlineTokens && styles['inline-tokens'],\n !!hasCustomContent && styles['custom-option']\n ),\n disabled: disabled,\n 'aria-expanded': pressed,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n 'aria-haspopup': ariaHasPopup ?? 'listbox',\n 'aria-controls': ariaControls,\n 'aria-disabled': readOnly && !disabled ? 'true' : undefined,\n autoFocus,\n };\n\n if (!readOnly) {\n attributes = {\n ...attributes,\n onKeyDown: onKeyDown && (event => fireKeyboardEvent(onKeyDown, event)),\n onKeyUp: onKeyUp && (event => fireKeyboardEvent(onKeyUp, event)),\n onMouseDown: onMouseDown && (event => fireCancelableEvent(onMouseDown, {}, event)),\n onClick: onClick && (event => fireCancelableEvent(onClick, {}, event)),\n onFocus: onFocus && (event => fireCancelableEvent(onFocus, {}, event)),\n onBlur: onBlur && (event => fireCancelableEvent(onBlur, { relatedTarget: event.relatedTarget }, event)),\n };\n }\n\n if (invalid) {\n attributes['aria-invalid'] = invalid;\n }\n\n const analyticsMetadata:\n | GeneratedAnalyticsMetadataButtonTriggerExpand\n | GeneratedAnalyticsMetadataButtonTriggerCollapse = {\n action: !pressed ? 'expand' : 'collapse',\n detail: {\n label: { root: 'self' },\n },\n };\n\n return (\n <button\n ref={ref}\n {...attributes}\n {...(disabled || readOnly ? {} : getAnalyticsMetadataAttribute(analyticsMetadata))}\n >\n {children}\n {!hideCaret && (\n <span className={styles.arrow}>\n <InternalIcon name=\"caret-down-filled\" variant={disabled || readOnly ? 'disabled' : 'normal'} />\n </span>\n )}\n </button>\n );\n};\n\nexport namespace ButtonTriggerProps {\n export interface Ref {\n focus(): void;\n }\n}\n\nexport default React.forwardRef(ButtonTrigger);\n"]}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"button-trigger": "awsui_button-
|
|
5
|
-
"arrow": "
|
|
6
|
-
"in-filtering-token-root": "awsui_in-filtering-token-
|
|
7
|
-
"in-filtering-token-nested": "awsui_in-filtering-token-
|
|
8
|
-
"has-caret": "awsui_has-
|
|
9
|
-
"placeholder": "
|
|
10
|
-
"pressed": "
|
|
11
|
-
"disabled": "
|
|
12
|
-
"in-filtering-token": "awsui_in-filtering-
|
|
13
|
-
"readonly": "
|
|
14
|
-
"invalid": "
|
|
15
|
-
"warning": "
|
|
16
|
-
"
|
|
4
|
+
"button-trigger": "awsui_button-trigger_18eso_el76d_161",
|
|
5
|
+
"arrow": "awsui_arrow_18eso_el76d_161",
|
|
6
|
+
"in-filtering-token-root": "awsui_in-filtering-token-root_18eso_el76d_221",
|
|
7
|
+
"in-filtering-token-nested": "awsui_in-filtering-token-nested_18eso_el76d_221",
|
|
8
|
+
"has-caret": "awsui_has-caret_18eso_el76d_257",
|
|
9
|
+
"placeholder": "awsui_placeholder_18eso_el76d_260",
|
|
10
|
+
"pressed": "awsui_pressed_18eso_el76d_273",
|
|
11
|
+
"disabled": "awsui_disabled_18eso_el76d_276",
|
|
12
|
+
"in-filtering-token": "awsui_in-filtering-token_18eso_el76d_221",
|
|
13
|
+
"readonly": "awsui_readonly_18eso_el76d_297",
|
|
14
|
+
"invalid": "awsui_invalid_18eso_el76d_319",
|
|
15
|
+
"warning": "awsui_warning_18eso_el76d_328",
|
|
16
|
+
"custom-option": "awsui_custom-option_18eso_el76d_337",
|
|
17
|
+
"inline-tokens": "awsui_inline-tokens_18eso_el76d_342"
|
|
17
18
|
};
|
|
18
19
|
|
|
@@ -158,21 +158,21 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
158
158
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
159
159
|
SPDX-License-Identifier: Apache-2.0
|
|
160
160
|
*/
|
|
161
|
-
.awsui_button-
|
|
161
|
+
.awsui_button-trigger_18eso_el76d_161 > .awsui_arrow_18eso_el76d_161:not(#\9) {
|
|
162
162
|
transition: transform var(--motion-duration-rotate-180-cxi9g7, 135ms) var(--motion-easing-rotate-180-7a58rc, cubic-bezier(0.165, 0.84, 0.44, 1));
|
|
163
163
|
}
|
|
164
164
|
@media (prefers-reduced-motion: reduce) {
|
|
165
|
-
.awsui_button-
|
|
165
|
+
.awsui_button-trigger_18eso_el76d_161 > .awsui_arrow_18eso_el76d_161:not(#\9) {
|
|
166
166
|
animation: none;
|
|
167
167
|
transition: none;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
.awsui-motion-disabled .awsui_button-
|
|
170
|
+
.awsui-motion-disabled .awsui_button-trigger_18eso_el76d_161 > .awsui_arrow_18eso_el76d_161:not(#\9), .awsui-mode-entering .awsui_button-trigger_18eso_el76d_161 > .awsui_arrow_18eso_el76d_161:not(#\9) {
|
|
171
171
|
animation: none;
|
|
172
172
|
transition: none;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
.awsui_button-
|
|
175
|
+
.awsui_button-trigger_18eso_el76d_161:not(#\9) {
|
|
176
176
|
border-collapse: separate;
|
|
177
177
|
border-spacing: 0;
|
|
178
178
|
box-sizing: border-box;
|
|
@@ -218,7 +218,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
218
218
|
border-inline: var(--border-width-field-2xc78x, 1px) solid var(--color-border-input-default-317xk5, #8c8c94);
|
|
219
219
|
min-block-size: var(--size-vertical-input-p1d7xx, 32px);
|
|
220
220
|
}
|
|
221
|
-
.awsui_button-
|
|
221
|
+
.awsui_button-trigger_18eso_el76d_161.awsui_in-filtering-token-root_18eso_el76d_221:not(#\9), .awsui_button-trigger_18eso_el76d_161.awsui_in-filtering-token-nested_18eso_el76d_221:not(#\9) {
|
|
222
222
|
padding-block: 0px;
|
|
223
223
|
padding-inline: var(--space-field-horizontal-0aq2ch, 12px);
|
|
224
224
|
border-block-width: var(--border-width-token-2ukdpu, 2px);
|
|
@@ -229,14 +229,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
229
229
|
block-size: 100%;
|
|
230
230
|
min-block-size: unset;
|
|
231
231
|
}
|
|
232
|
-
body[data-awsui-focus-visible=true] .awsui_button-
|
|
232
|
+
body[data-awsui-focus-visible=true] .awsui_button-trigger_18eso_el76d_161.awsui_in-filtering-token-root_18eso_el76d_221:not(#\9):focus, body[data-awsui-focus-visible=true] .awsui_button-trigger_18eso_el76d_161.awsui_in-filtering-token-nested_18eso_el76d_221:not(#\9):focus {
|
|
233
233
|
position: relative;
|
|
234
234
|
}
|
|
235
|
-
body[data-awsui-focus-visible=true] .awsui_button-
|
|
235
|
+
body[data-awsui-focus-visible=true] .awsui_button-trigger_18eso_el76d_161.awsui_in-filtering-token-root_18eso_el76d_221:not(#\9):focus, body[data-awsui-focus-visible=true] .awsui_button-trigger_18eso_el76d_161.awsui_in-filtering-token-nested_18eso_el76d_221:not(#\9):focus {
|
|
236
236
|
outline: 2px dotted transparent;
|
|
237
237
|
outline-offset: calc(var(--space-filtering-token-operation-select-focus-outline-gutter-jacx1t, -5px) - 1px);
|
|
238
238
|
}
|
|
239
|
-
body[data-awsui-focus-visible=true] .awsui_button-
|
|
239
|
+
body[data-awsui-focus-visible=true] .awsui_button-trigger_18eso_el76d_161.awsui_in-filtering-token-root_18eso_el76d_221:not(#\9):focus::before, body[data-awsui-focus-visible=true] .awsui_button-trigger_18eso_el76d_161.awsui_in-filtering-token-nested_18eso_el76d_221:not(#\9):focus::before {
|
|
240
240
|
content: " ";
|
|
241
241
|
display: block;
|
|
242
242
|
position: absolute;
|
|
@@ -250,40 +250,40 @@ body[data-awsui-focus-visible=true] .awsui_button-trigger_18eso_zlq2e_161.awsui_
|
|
|
250
250
|
border-end-end-radius: var(--border-radius-control-default-focus-ring-1uabki, 4px);
|
|
251
251
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-uk47pl, #006ce0);
|
|
252
252
|
}
|
|
253
|
-
.awsui_button-
|
|
253
|
+
.awsui_button-trigger_18eso_el76d_161.awsui_in-filtering-token-nested_18eso_el76d_221:not(#\9) {
|
|
254
254
|
border-start-start-radius: calc(var(--border-radius-input-7q0str, 8px) / 2);
|
|
255
255
|
border-end-start-radius: calc(var(--border-radius-input-7q0str, 8px) / 2);
|
|
256
256
|
}
|
|
257
|
-
.awsui_button-
|
|
257
|
+
.awsui_button-trigger_18eso_el76d_161.awsui_has-caret_18eso_el76d_257:not(#\9) {
|
|
258
258
|
padding-inline-end: var(--space-field-icon-offset-ikwzwx, 36px);
|
|
259
259
|
}
|
|
260
|
-
.awsui_button-
|
|
260
|
+
.awsui_button-trigger_18eso_el76d_161 > .awsui_placeholder_18eso_el76d_260:not(#\9) {
|
|
261
261
|
color: var(--color-text-input-placeholder-dclg8u, #656871);
|
|
262
262
|
font-style: italic;
|
|
263
263
|
}
|
|
264
|
-
.awsui_button-
|
|
264
|
+
.awsui_button-trigger_18eso_el76d_161 > .awsui_arrow_18eso_el76d_161:not(#\9) {
|
|
265
265
|
position: absolute;
|
|
266
266
|
inset-inline-end: var(--space-field-horizontal-0aq2ch, 12px);
|
|
267
267
|
inset-block-start: calc(50% - var(--line-height-body-m-2mh3ke, 20px) / 2);
|
|
268
268
|
color: var(--color-text-button-inline-icon-default-sm4ql6, #006ce0);
|
|
269
269
|
}
|
|
270
|
-
.awsui_button-
|
|
270
|
+
.awsui_button-trigger_18eso_el76d_161:not(#\9):hover > .awsui_arrow_18eso_el76d_161 {
|
|
271
271
|
color: var(--color-text-button-inline-icon-hover-rbyzfc, #002b66);
|
|
272
272
|
}
|
|
273
|
-
.awsui_button-
|
|
273
|
+
.awsui_button-trigger_18eso_el76d_161.awsui_pressed_18eso_el76d_273 > .awsui_arrow_18eso_el76d_161:not(#\9) {
|
|
274
274
|
transform: rotate(-180deg);
|
|
275
275
|
}
|
|
276
|
-
.awsui_button-
|
|
276
|
+
.awsui_button-trigger_18eso_el76d_161.awsui_disabled_18eso_el76d_276:not(#\9) {
|
|
277
277
|
background-color: var(--color-background-input-disabled-dihaja, #ebebf0);
|
|
278
278
|
border-block: var(--border-width-field-2xc78x, 1px) solid var(--color-border-input-disabled-zgnzvk, #ebebf0);
|
|
279
279
|
border-inline: var(--border-width-field-2xc78x, 1px) solid var(--color-border-input-disabled-zgnzvk, #ebebf0);
|
|
280
280
|
color: var(--color-text-input-disabled-wh1f3y, #b4b4bb);
|
|
281
281
|
cursor: auto;
|
|
282
282
|
}
|
|
283
|
-
.awsui_button-
|
|
283
|
+
.awsui_button-trigger_18eso_el76d_161.awsui_disabled_18eso_el76d_276 > .awsui_arrow_18eso_el76d_161:not(#\9) {
|
|
284
284
|
color: var(--color-text-button-inline-icon-disabled-82hho0, #b4b4bb);
|
|
285
285
|
}
|
|
286
|
-
.awsui_button-
|
|
286
|
+
.awsui_button-trigger_18eso_el76d_161.awsui_disabled_18eso_el76d_276.awsui_in-filtering-token_18eso_el76d_221:not(#\9) {
|
|
287
287
|
background-color: var(--color-background-input-disabled-dihaja, #ebebf0);
|
|
288
288
|
border-block: var(--border-width-token-2ukdpu, 2px) solid var(--color-border-input-disabled-zgnzvk, #ebebf0);
|
|
289
289
|
border-inline: var(--border-width-token-2ukdpu, 2px) solid var(--color-border-input-disabled-zgnzvk, #ebebf0);
|
|
@@ -291,19 +291,19 @@ body[data-awsui-focus-visible=true] .awsui_button-trigger_18eso_zlq2e_161.awsui_
|
|
|
291
291
|
cursor: auto;
|
|
292
292
|
border-color: var(--color-border-control-disabled-uj7t08, #dedee3);
|
|
293
293
|
}
|
|
294
|
-
.awsui_button-
|
|
294
|
+
.awsui_button-trigger_18eso_el76d_161.awsui_disabled_18eso_el76d_276 > .awsui_placeholder_18eso_el76d_260:not(#\9) {
|
|
295
295
|
color: var(--color-text-input-placeholder-disabled-wg87og, #b4b4bb);
|
|
296
296
|
}
|
|
297
|
-
.awsui_button-
|
|
297
|
+
.awsui_button-trigger_18eso_el76d_161.awsui_readonly_18eso_el76d_297:not(#\9):not(.awsui_button-trigger_18eso_el76d_161.awsui_disabled_18eso_el76d_276):not(.awsui_button-trigger_18eso_el76d_161.awsui_in-filtering-token_18eso_el76d_221) {
|
|
298
298
|
background-color: var(--color-background-input-default-ifz5bb, #ffffff);
|
|
299
299
|
border-block: var(--border-width-field-2xc78x, 1px) solid var(--color-border-input-disabled-zgnzvk, #ebebf0);
|
|
300
300
|
border-inline: var(--border-width-field-2xc78x, 1px) solid var(--color-border-input-disabled-zgnzvk, #ebebf0);
|
|
301
301
|
}
|
|
302
|
-
.awsui_button-
|
|
302
|
+
.awsui_button-trigger_18eso_el76d_161:not(#\9):focus {
|
|
303
303
|
outline: none;
|
|
304
304
|
text-decoration: none;
|
|
305
305
|
}
|
|
306
|
-
body[data-awsui-focus-visible=true] .awsui_button-
|
|
306
|
+
body[data-awsui-focus-visible=true] .awsui_button-trigger_18eso_el76d_161:not(#\9):not(.awsui_in-filtering-token_18eso_el76d_221):focus {
|
|
307
307
|
outline: 2px dotted transparent;
|
|
308
308
|
border-block: var(--border-width-field-2xc78x, 1px) solid var(--color-border-input-focused-4z0pgn, #006ce0);
|
|
309
309
|
border-inline: var(--border-width-field-2xc78x, 1px) solid var(--color-border-input-focused-4z0pgn, #006ce0);
|
|
@@ -313,27 +313,32 @@ body[data-awsui-focus-visible=true] .awsui_button-trigger_18eso_zlq2e_161:not(#\
|
|
|
313
313
|
border-end-end-radius: var(--border-radius-input-7q0str, 8px);
|
|
314
314
|
box-shadow: 0 0 0 var(--border-control-focus-ring-shadow-spread-9mjajk, 1px) var(--color-border-item-focused-uk47pl, #006ce0);
|
|
315
315
|
}
|
|
316
|
-
.awsui_button-
|
|
316
|
+
.awsui_button-trigger_18eso_el76d_161:not(#\9):not(.awsui_in-filtering-token_18eso_el76d_221):invalid {
|
|
317
317
|
box-shadow: none;
|
|
318
318
|
}
|
|
319
|
-
.awsui_button-
|
|
319
|
+
.awsui_button-trigger_18eso_el76d_161:not(#\9):not(.awsui_in-filtering-token_18eso_el76d_221).awsui_invalid_18eso_el76d_319, .awsui_button-trigger_18eso_el76d_161:not(#\9):not(.awsui_in-filtering-token_18eso_el76d_221).awsui_invalid_18eso_el76d_319:focus {
|
|
320
320
|
color: var(--color-text-status-error-ksqavh, #db0000);
|
|
321
321
|
border-color: var(--color-text-status-error-ksqavh, #db0000);
|
|
322
322
|
padding-inline-start: calc(var(--space-field-horizontal-0aq2ch, 12px) - (var(--border-invalid-width-3xd6e1, 8px) - var(--border-width-field-2xc78x, 1px)));
|
|
323
323
|
border-inline-start-width: var(--border-invalid-width-3xd6e1, 8px);
|
|
324
324
|
}
|
|
325
|
-
.awsui_button-
|
|
325
|
+
.awsui_button-trigger_18eso_el76d_161:not(#\9):not(.awsui_in-filtering-token_18eso_el76d_221).awsui_invalid_18eso_el76d_319:focus, .awsui_button-trigger_18eso_el76d_161:not(#\9):not(.awsui_in-filtering-token_18eso_el76d_221).awsui_invalid_18eso_el76d_319:focus:focus {
|
|
326
326
|
box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-9jjf96, 2px) var(--color-border-item-focused-uk47pl, #006ce0);
|
|
327
327
|
}
|
|
328
|
-
.awsui_button-
|
|
328
|
+
.awsui_button-trigger_18eso_el76d_161:not(#\9):not(.awsui_in-filtering-token_18eso_el76d_221).awsui_warning_18eso_el76d_328, .awsui_button-trigger_18eso_el76d_161:not(#\9):not(.awsui_in-filtering-token_18eso_el76d_221).awsui_warning_18eso_el76d_328:focus {
|
|
329
329
|
color: var(--color-text-status-warning-6meo06, #855900);
|
|
330
330
|
border-color: var(--color-text-status-warning-6meo06, #855900);
|
|
331
331
|
padding-inline-start: calc(var(--space-field-horizontal-0aq2ch, 12px) - (var(--border-invalid-width-3xd6e1, 8px) - var(--border-width-field-2xc78x, 1px)));
|
|
332
332
|
border-inline-start-width: var(--border-invalid-width-3xd6e1, 8px);
|
|
333
333
|
}
|
|
334
|
-
.awsui_button-
|
|
334
|
+
.awsui_button-trigger_18eso_el76d_161:not(#\9):not(.awsui_in-filtering-token_18eso_el76d_221).awsui_warning_18eso_el76d_328:focus, .awsui_button-trigger_18eso_el76d_161:not(#\9):not(.awsui_in-filtering-token_18eso_el76d_221).awsui_warning_18eso_el76d_328:focus:focus {
|
|
335
335
|
box-shadow: 0 0 0 var(--border-control-invalid-focus-ring-shadow-spread-9jjf96, 2px) var(--color-border-item-focused-uk47pl, #006ce0);
|
|
336
336
|
}
|
|
337
|
-
.awsui_button-
|
|
337
|
+
.awsui_button-trigger_18eso_el76d_161.awsui_custom-option_18eso_el76d_337:not(#\9) {
|
|
338
|
+
padding-block: 0;
|
|
339
|
+
padding-inline-start: 0;
|
|
340
|
+
overflow: clip;
|
|
341
|
+
}
|
|
342
|
+
.awsui_button-trigger_18eso_el76d_161.awsui_inline-tokens_18eso_el76d_342:not(#\9) {
|
|
338
343
|
padding-block: 0;
|
|
339
344
|
}
|
|
@@ -2,18 +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
|
-
"button-trigger": "awsui_button-
|
|
6
|
-
"arrow": "
|
|
7
|
-
"in-filtering-token-root": "awsui_in-filtering-token-
|
|
8
|
-
"in-filtering-token-nested": "awsui_in-filtering-token-
|
|
9
|
-
"has-caret": "awsui_has-
|
|
10
|
-
"placeholder": "
|
|
11
|
-
"pressed": "
|
|
12
|
-
"disabled": "
|
|
13
|
-
"in-filtering-token": "awsui_in-filtering-
|
|
14
|
-
"readonly": "
|
|
15
|
-
"invalid": "
|
|
16
|
-
"warning": "
|
|
17
|
-
"
|
|
5
|
+
"button-trigger": "awsui_button-trigger_18eso_el76d_161",
|
|
6
|
+
"arrow": "awsui_arrow_18eso_el76d_161",
|
|
7
|
+
"in-filtering-token-root": "awsui_in-filtering-token-root_18eso_el76d_221",
|
|
8
|
+
"in-filtering-token-nested": "awsui_in-filtering-token-nested_18eso_el76d_221",
|
|
9
|
+
"has-caret": "awsui_has-caret_18eso_el76d_257",
|
|
10
|
+
"placeholder": "awsui_placeholder_18eso_el76d_260",
|
|
11
|
+
"pressed": "awsui_pressed_18eso_el76d_273",
|
|
12
|
+
"disabled": "awsui_disabled_18eso_el76d_276",
|
|
13
|
+
"in-filtering-token": "awsui_in-filtering-token_18eso_el76d_221",
|
|
14
|
+
"readonly": "awsui_readonly_18eso_el76d_297",
|
|
15
|
+
"invalid": "awsui_invalid_18eso_el76d_319",
|
|
16
|
+
"warning": "awsui_warning_18eso_el76d_328",
|
|
17
|
+
"custom-option": "awsui_custom-option_18eso_el76d_337",
|
|
18
|
+
"inline-tokens": "awsui_inline-tokens_18eso_el76d_342"
|
|
18
19
|
};
|
|
19
20
|
|
|
@@ -5,11 +5,15 @@ interface DirectionButtonProps {
|
|
|
5
5
|
state: DirectionState;
|
|
6
6
|
onClick: React.MouseEventHandler;
|
|
7
7
|
show: boolean;
|
|
8
|
+
forcedPosition: null | 'top' | 'bottom';
|
|
9
|
+
forcedIndex: number;
|
|
8
10
|
}
|
|
9
11
|
export default function DirectionButton({
|
|
10
12
|
direction,
|
|
11
13
|
state,
|
|
12
14
|
show,
|
|
13
|
-
onClick
|
|
15
|
+
onClick,
|
|
16
|
+
forcedPosition,
|
|
17
|
+
forcedIndex
|
|
14
18
|
}: DirectionButtonProps): JSX.Element;
|
|
15
19
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direction-button.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle-wrapper/direction-button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAezD,UAAU,oBAAoB;IAC5B,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC,IAAI,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"direction-button.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle-wrapper/direction-button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAezD,UAAU,oBAAoB;IAC5B,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,cAAc,CAAC;IACtB,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,cAAc,EAAE,IAAI,GAAG,KAAK,GAAG,QAAQ,CAAC;IACxC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,SAAS,EACT,KAAK,EACL,IAAI,EACJ,OAAO,EACP,cAAc,EACd,WAAW,GACZ,EAAE,oBAAoB,eAqCtB"}
|
|
@@ -15,12 +15,12 @@ const ICON_LOGICAL_PROPERTY_MAP = {
|
|
|
15
15
|
'inline-start': 'arrow-left',
|
|
16
16
|
'inline-end': 'arrow-right',
|
|
17
17
|
};
|
|
18
|
-
export default function DirectionButton({ direction, state, show, onClick }) {
|
|
18
|
+
export default function DirectionButton({ direction, state, show, onClick, forcedPosition, forcedIndex, }) {
|
|
19
19
|
return (React.createElement(Transition, { in: show }, (transitionState, ref) => (
|
|
20
20
|
// The wrapper exists to provide a padding around each direction button that
|
|
21
21
|
// prevents any accidental presses around the button from propagating to any
|
|
22
22
|
// interactive elements behind the button.
|
|
23
|
-
React.createElement("span", { ref: ref, className: clsx(styles['direction-button-wrapper'], styles[`direction-button-wrapper-${direction}`], transitionState === 'exited' && styles['direction-button-wrapper-hidden'], styles[`direction-button-wrapper-motion-${transitionState}`]) },
|
|
23
|
+
React.createElement("span", { ref: ref, className: clsx(styles['direction-button-wrapper'], !forcedPosition && styles[`direction-button-wrapper-${direction}`], forcedPosition && styles['direction-button-wrapper-forced'], forcedPosition && styles[`direction-button-wrapper-forced-${forcedPosition}-${forcedIndex}`], transitionState === 'exited' && styles['direction-button-wrapper-hidden'], styles[`direction-button-wrapper-motion-${transitionState}`]) },
|
|
24
24
|
React.createElement("span", { className: clsx(styles['direction-button'], state === 'disabled' && styles['direction-button-disabled'], testUtilsStyles[`direction-button-${direction}`], !['exiting', 'exited'].includes(transitionState) && testUtilsStyles['direction-button-visible']), onClick: state !== 'disabled' ? onClick : undefined,
|
|
25
25
|
// This prevents focus from being lost to `document.body` on
|
|
26
26
|
// mouse/pointer press. This allows us to listen to onClick while
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direction-button.js","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle-wrapper/direction-button.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAE3D,+EAA+E;AAC/E,6EAA6E;AAC7E,+BAA+B;AAC/B,MAAM,yBAAyB,GAAsC;IACnE,aAAa,EAAE,UAAU;IACzB,WAAW,EAAE,YAAY;IACzB,cAAc,EAAE,YAAY;IAC5B,YAAY,EAAE,aAAa;CAC5B,CAAC;
|
|
1
|
+
{"version":3,"file":"direction-button.js","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle-wrapper/direction-button.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAE3D,+EAA+E;AAC/E,6EAA6E;AAC7E,+BAA+B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AC,cAAc,EAAE;YAE9C,oBAAC,YAAY,IAAC,IAAI,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAAE,IAAI,EAAC,OAAO,GAAG,CACpE,CACF,CACR,CACU,CACd,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { IconProps } from '../../../icon/interfaces';\nimport InternalIcon from '../../../icon/internal';\nimport { Transition } from '../transition';\nimport { Direction, DirectionState } from './interfaces';\n\nimport styles from './styles.css.js';\nimport testUtilsStyles from './test-classes/styles.css.js';\n\n// Mapping from CSS logical property direction to icon name. The icon component\n// already flips the left/right icons automatically based on RTL, so we don't\n// need to do anything special.\nconst ICON_LOGICAL_PROPERTY_MAP: Record<Direction, IconProps.Name> = {\n 'block-start': 'arrow-up',\n 'block-end': 'arrow-down',\n 'inline-start': 'arrow-left',\n 'inline-end': 'arrow-right',\n};\n\ninterface DirectionButtonProps {\n direction: Direction;\n state: DirectionState;\n onClick: React.MouseEventHandler;\n show: boolean;\n forcedPosition: null | 'top' | 'bottom';\n forcedIndex: number;\n}\n\nexport default function DirectionButton({\n direction,\n state,\n show,\n onClick,\n forcedPosition,\n forcedIndex,\n}: DirectionButtonProps) {\n return (\n <Transition in={show}>\n {(transitionState, ref) => (\n // The wrapper exists to provide a padding around each direction button that\n // prevents any accidental presses around the button from propagating to any\n // interactive elements behind the button.\n <span\n ref={ref}\n className={clsx(\n styles['direction-button-wrapper'],\n !forcedPosition && styles[`direction-button-wrapper-${direction}`],\n forcedPosition && styles['direction-button-wrapper-forced'],\n forcedPosition && styles[`direction-button-wrapper-forced-${forcedPosition}-${forcedIndex}`],\n transitionState === 'exited' && styles['direction-button-wrapper-hidden'],\n styles[`direction-button-wrapper-motion-${transitionState}`]\n )}\n >\n <span\n className={clsx(\n styles['direction-button'],\n state === 'disabled' && styles['direction-button-disabled'],\n testUtilsStyles[`direction-button-${direction}`],\n !['exiting', 'exited'].includes(transitionState) && testUtilsStyles['direction-button-visible']\n )}\n onClick={state !== 'disabled' ? onClick : undefined}\n // This prevents focus from being lost to `document.body` on\n // mouse/pointer press. This allows us to listen to onClick while\n // keeping this button pointer-accessible only.\n onPointerDown={event => event.preventDefault()}\n >\n <InternalIcon name={ICON_LOGICAL_PROPERTY_MAP[direction]} size=\"small\" />\n </span>\n </span>\n )}\n </Transition>\n );\n}\n"]}
|