@cloudscape-design/components 3.0.870 → 3.0.872
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/app-layout/drawer/resizable-drawer.d.ts.map +1 -1
- package/app-layout/drawer/resizable-drawer.js +2 -3
- package/app-layout/drawer/resizable-drawer.js.map +1 -1
- package/app-layout/utils/use-focus-control.d.ts +1 -2
- package/app-layout/utils/use-focus-control.d.ts.map +1 -1
- package/app-layout/utils/use-focus-control.js +0 -2
- package/app-layout/utils/use-focus-control.js.map +1 -1
- package/app-layout/utils/use-resize.d.ts.map +1 -1
- package/app-layout/utils/use-resize.js +2 -3
- package/app-layout/utils/use-resize.js.map +1 -1
- package/app-layout/utils/use-split-panel-focus-control.d.ts +1 -2
- package/app-layout/utils/use-split-panel-focus-control.d.ts.map +1 -1
- package/app-layout/utils/use-split-panel-focus-control.js +0 -1
- package/app-layout/utils/use-split-panel-focus-control.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +2 -3
- package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +2 -3
- package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
- package/button-group/index.d.ts.map +1 -1
- package/button-group/index.js +22 -1
- package/button-group/index.js.map +1 -1
- package/button-group/interfaces.d.ts +2 -1
- package/button-group/interfaces.d.ts.map +1 -1
- package/button-group/interfaces.js.map +1 -1
- package/collection-preferences/content-display/index.d.ts.map +1 -1
- package/collection-preferences/content-display/index.js +8 -5
- package/collection-preferences/content-display/index.js.map +1 -1
- package/container/styles.css.js +32 -31
- package/container/styles.scoped.css +57 -54
- package/container/styles.selectors.js +32 -31
- package/flashbar/internal/analytics.d.ts.map +1 -1
- package/flashbar/internal/analytics.js +1 -3
- package/flashbar/internal/analytics.js.map +1 -1
- package/internal/components/autosuggest-input/index.d.ts.map +1 -1
- package/internal/components/autosuggest-input/index.js +6 -0
- package/internal/components/autosuggest-input/index.js.map +1 -1
- package/internal/components/drag-handle/index.d.ts +2 -2
- package/internal/components/drag-handle/index.d.ts.map +1 -1
- package/internal/components/drag-handle/index.js +7 -3
- package/internal/components/drag-handle/index.js.map +1 -1
- package/internal/components/drag-handle/interfaces.d.ts +1 -1
- package/internal/components/drag-handle/interfaces.d.ts.map +1 -1
- package/internal/components/drag-handle/interfaces.js.map +1 -1
- package/internal/components/panel-resize-handle/icon.d.ts +5 -0
- package/internal/components/panel-resize-handle/icon.d.ts.map +1 -0
- package/internal/components/panel-resize-handle/icon.js +9 -0
- package/internal/components/panel-resize-handle/icon.js.map +1 -0
- package/internal/components/panel-resize-handle/index.d.ts +2 -4
- package/internal/components/panel-resize-handle/index.d.ts.map +1 -1
- package/internal/components/panel-resize-handle/index.js +5 -8
- package/internal/components/panel-resize-handle/index.js.map +1 -1
- package/internal/components/panel-resize-handle/styles.css.js +5 -2
- package/internal/components/panel-resize-handle/styles.scoped.css +191 -3
- package/internal/components/panel-resize-handle/styles.selectors.js +5 -2
- package/internal/components/sortable-area/index.d.ts +6 -0
- package/internal/components/sortable-area/index.d.ts.map +1 -0
- package/internal/components/{dnd-area → sortable-area}/index.js +34 -25
- package/internal/components/sortable-area/index.js.map +1 -0
- package/internal/components/sortable-area/interfaces.d.ts +42 -0
- package/internal/components/sortable-area/interfaces.d.ts.map +1 -0
- package/internal/components/sortable-area/interfaces.js.map +1 -0
- package/internal/components/sortable-area/keyboard-sensor/defaults.d.ts.map +1 -0
- package/internal/components/sortable-area/keyboard-sensor/defaults.js.map +1 -0
- package/internal/components/sortable-area/keyboard-sensor/index.d.ts.map +1 -0
- package/internal/components/sortable-area/keyboard-sensor/index.js.map +1 -0
- package/internal/components/sortable-area/keyboard-sensor/utilities/events.d.ts.map +1 -0
- package/internal/components/sortable-area/keyboard-sensor/utilities/events.js.map +1 -0
- package/internal/components/sortable-area/keyboard-sensor/utilities/listeners.d.ts.map +1 -0
- package/internal/components/sortable-area/keyboard-sensor/utilities/listeners.js.map +1 -0
- package/internal/components/sortable-area/keyboard-sensor/utilities/scroll.d.ts.map +1 -0
- package/internal/components/sortable-area/keyboard-sensor/utilities/scroll.js.map +1 -0
- package/internal/components/sortable-area/styles.css.js +13 -0
- package/internal/components/{dnd-area → sortable-area}/styles.scoped.css +17 -17
- package/internal/components/sortable-area/styles.selectors.js +14 -0
- package/internal/components/{dnd-area → sortable-area}/use-drag-and-drop-reorder.d.ts +4 -3
- package/internal/components/sortable-area/use-drag-and-drop-reorder.d.ts.map +1 -0
- package/internal/components/{dnd-area → sortable-area}/use-drag-and-drop-reorder.js +4 -4
- package/internal/components/sortable-area/use-drag-and-drop-reorder.js.map +1 -0
- package/internal/components/sortable-area/use-live-announcements.d.ts +13 -0
- package/internal/components/sortable-area/use-live-announcements.d.ts.map +1 -0
- package/internal/components/{dnd-area → sortable-area}/use-live-announcements.js +6 -6
- package/internal/components/sortable-area/use-live-announcements.js.map +1 -0
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/internal/metrics.d.ts +3 -0
- package/internal/metrics.d.ts.map +1 -0
- package/internal/metrics.js +6 -0
- package/internal/metrics.js.map +1 -0
- package/internal/plugins/api.d.ts.map +1 -1
- package/internal/plugins/api.js +4 -0
- package/internal/plugins/api.js.map +1 -1
- package/internal/plugins/controllers/alert-flash-content.d.ts.map +1 -1
- package/internal/plugins/controllers/alert-flash-content.js +2 -1
- package/internal/plugins/controllers/alert-flash-content.js.map +1 -1
- package/internal/plugins/controllers/drawers.d.ts.map +1 -1
- package/internal/plugins/controllers/drawers.js +7 -3
- package/internal/plugins/controllers/drawers.js.map +1 -1
- package/internal/plugins/helpers/metrics.d.ts +3 -0
- package/internal/plugins/helpers/metrics.d.ts.map +1 -0
- package/internal/plugins/helpers/metrics.js +15 -0
- package/internal/plugins/helpers/metrics.js.map +1 -0
- package/internal/plugins/helpers/use-discovered-content.d.ts.map +1 -1
- package/internal/plugins/helpers/use-discovered-content.js +2 -1
- package/internal/plugins/helpers/use-discovered-content.js.map +1 -1
- package/internal/utils/dom.d.ts +1 -0
- package/internal/utils/dom.d.ts.map +1 -1
- package/internal/utils/dom.js +8 -0
- package/internal/utils/dom.js.map +1 -1
- package/package.json +1 -1
- package/split-panel/implementation.d.ts.map +1 -1
- package/split-panel/implementation.js +6 -7
- package/split-panel/implementation.js.map +1 -1
- package/table/header-cell/styles.css.js +28 -26
- package/table/header-cell/styles.scoped.css +68 -65
- package/table/header-cell/styles.selectors.js +28 -26
- package/table/table-role/utils.d.ts.map +1 -1
- package/table/table-role/utils.js +4 -5
- package/table/table-role/utils.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/exports.d.ts +0 -6
- package/app-layout/visual-refresh-toolbar/exports.d.ts.map +0 -1
- package/app-layout/visual-refresh-toolbar/exports.js +0 -8
- package/app-layout/visual-refresh-toolbar/exports.js.map +0 -1
- package/internal/components/dnd-area/index.d.ts +0 -4
- package/internal/components/dnd-area/index.d.ts.map +0 -1
- package/internal/components/dnd-area/index.js.map +0 -1
- package/internal/components/dnd-area/interfaces.d.ts +0 -39
- package/internal/components/dnd-area/interfaces.d.ts.map +0 -1
- package/internal/components/dnd-area/interfaces.js.map +0 -1
- package/internal/components/dnd-area/keyboard-sensor/defaults.d.ts.map +0 -1
- package/internal/components/dnd-area/keyboard-sensor/defaults.js.map +0 -1
- package/internal/components/dnd-area/keyboard-sensor/index.d.ts.map +0 -1
- package/internal/components/dnd-area/keyboard-sensor/index.js.map +0 -1
- package/internal/components/dnd-area/keyboard-sensor/utilities/events.d.ts.map +0 -1
- package/internal/components/dnd-area/keyboard-sensor/utilities/events.js.map +0 -1
- package/internal/components/dnd-area/keyboard-sensor/utilities/listeners.d.ts.map +0 -1
- package/internal/components/dnd-area/keyboard-sensor/utilities/listeners.js.map +0 -1
- package/internal/components/dnd-area/keyboard-sensor/utilities/scroll.d.ts.map +0 -1
- package/internal/components/dnd-area/keyboard-sensor/utilities/scroll.js.map +0 -1
- package/internal/components/dnd-area/styles.css.js +0 -13
- package/internal/components/dnd-area/styles.selectors.js +0 -14
- package/internal/components/dnd-area/use-drag-and-drop-reorder.d.ts.map +0 -1
- package/internal/components/dnd-area/use-drag-and-drop-reorder.js.map +0 -1
- package/internal/components/dnd-area/use-live-announcements.d.ts +0 -12
- package/internal/components/dnd-area/use-live-announcements.d.ts.map +0 -1
- package/internal/components/dnd-area/use-live-announcements.js.map +0 -1
- /package/internal/components/{dnd-area → sortable-area}/interfaces.js +0 -0
- /package/internal/components/{dnd-area → sortable-area}/keyboard-sensor/defaults.d.ts +0 -0
- /package/internal/components/{dnd-area → sortable-area}/keyboard-sensor/defaults.js +0 -0
- /package/internal/components/{dnd-area → sortable-area}/keyboard-sensor/index.d.ts +0 -0
- /package/internal/components/{dnd-area → sortable-area}/keyboard-sensor/index.js +0 -0
- /package/internal/components/{dnd-area → sortable-area}/keyboard-sensor/utilities/events.d.ts +0 -0
- /package/internal/components/{dnd-area → sortable-area}/keyboard-sensor/utilities/events.js +0 -0
- /package/internal/components/{dnd-area → sortable-area}/keyboard-sensor/utilities/listeners.d.ts +0 -0
- /package/internal/components/{dnd-area → sortable-area}/keyboard-sensor/utilities/listeners.js +0 -0
- /package/internal/components/{dnd-area → sortable-area}/keyboard-sensor/utilities/scroll.d.ts +0 -0
- /package/internal/components/{dnd-area → sortable-area}/keyboard-sensor/utilities/scroll.js +0 -0
|
@@ -8,6 +8,7 @@ import { getBaseProps } from '../../base-component';
|
|
|
8
8
|
import { useFormFieldContext } from '../../context/form-field-context';
|
|
9
9
|
import { fireCancelableEvent, fireNonCancelableEvent } from '../../events';
|
|
10
10
|
import { KeyCode } from '../../keycode';
|
|
11
|
+
import { documentHasFocus } from '../../utils/dom';
|
|
11
12
|
import { nodeBelongs } from '../../utils/node-belongs';
|
|
12
13
|
import Dropdown from '../dropdown';
|
|
13
14
|
import styles from './styles.css.js';
|
|
@@ -42,6 +43,11 @@ const AutosuggestInput = React.forwardRef((_a, ref) => {
|
|
|
42
43
|
close: closeDropdown,
|
|
43
44
|
}));
|
|
44
45
|
const handleBlur = () => {
|
|
46
|
+
// When the document in not in focus it means the focus moved outside the page. In that case the dropdown shall stay open
|
|
47
|
+
// so that when the user comes back it does not re-open unexpectedly when the focus is restored by the browser.
|
|
48
|
+
if (!documentHasFocus()) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
45
51
|
if (!preventCloseOnBlurRef.current) {
|
|
46
52
|
closeDropdown();
|
|
47
53
|
fireNonCancelableEvent(onBlur, null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/autosuggest-input/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAAO,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,IAAI,MAAM,MAAM,CAAC;AAUxB,OAAO,aAAqC,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAsB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAmC,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACxG,OAAO,EAAiB,mBAAmB,EAAE,sBAAsB,EAA6B,MAAM,cAAc,CAAC;AAErH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,QAAQ,MAAM,aAAa,CAAC;AAGnC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAqCrC,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CACvC,CACE,EAiCwB,EACxB,GAA6B,EAC7B,EAAE;QAnCF,EACE,KAAK,EACL,QAAQ,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AE,SAAS,IAEnB,IAAI,IAAI,eAAe,CAAC,CAAC,CAAC,CACzB,6BAAK,GAAG,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC,IAChE,eAAe,CACZ,CACP,CAAC,CAAC,CAAC,IAAI,CACC,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { AutosuggestProps } from '../../../autosuggest/interfaces';\nimport {\n BaseChangeDetail,\n BaseInputProps,\n InputAutoCorrect,\n InputClearLabel,\n InputKeyEvents,\n} from '../../../input/interfaces';\nimport InternalInput, { InternalInputProps } from '../../../input/internal';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport { FormFieldValidationControlProps, useFormFieldContext } from '../../context/form-field-context';\nimport { BaseKeyDetail, fireCancelableEvent, fireNonCancelableEvent, NonCancelableEventHandler } from '../../events';\nimport { InternalBaseComponentProps } from '../../hooks/use-base-component';\nimport { KeyCode } from '../../keycode';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport Dropdown from '../dropdown';\nimport { ExpandToViewport } from '../dropdown/interfaces';\n\nimport styles from './styles.css.js';\n\ninterface AutosuggestInputProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n ExpandToViewport,\n InternalBaseComponentProps {\n ariaControls?: string;\n ariaActivedescendant?: string;\n dropdownExpanded?: boolean;\n dropdownContentKey?: string;\n dropdownContentFocusable?: boolean;\n dropdownContent?: React.ReactNode;\n dropdownFooter?: React.ReactNode;\n dropdownWidth?: number;\n loopFocus?: boolean;\n onCloseDropdown?: NonCancelableEventHandler<null>;\n onDelayedInput?: NonCancelableEventHandler<BaseChangeDetail>;\n onPressArrowDown?: () => void;\n onPressArrowUp?: () => void;\n onPressEnter?: () => boolean;\n}\n\ninterface AutosuggestInputFocusOptions {\n preventDropdown?: boolean;\n}\n\nexport interface AutosuggestInputRef extends AutosuggestProps.Ref {\n focus(options?: AutosuggestInputFocusOptions): void;\n open(): void;\n close(): void;\n}\n\nconst AutosuggestInput = React.forwardRef(\n (\n {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onKeyDown,\n name,\n placeholder,\n disabled,\n readOnly,\n autoFocus,\n ariaLabel,\n ariaRequired,\n disableBrowserAutocorrect = false,\n expandToViewport,\n ariaControls,\n ariaActivedescendant,\n clearAriaLabel,\n dropdownExpanded = true,\n dropdownContentKey,\n dropdownContentFocusable = false,\n dropdownContent = null,\n dropdownFooter = null,\n dropdownWidth,\n loopFocus,\n onCloseDropdown,\n onDelayedInput,\n onPressArrowDown,\n onPressArrowUp,\n onPressEnter,\n __internalRootRef,\n ...restProps\n }: AutosuggestInputProps,\n ref: Ref<AutosuggestInputRef>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n\n const inputRef = useRef<HTMLInputElement>(null);\n const dropdownContentRef = useRef<HTMLDivElement>(null);\n const dropdownFooterRef = useRef<HTMLDivElement>(null);\n const preventOpenOnFocusRef = useRef(false);\n const preventCloseOnBlurRef = useRef(false);\n\n const [open, setOpen] = useState(false);\n\n const openDropdown = () => !readOnly && setOpen(true);\n\n const closeDropdown = () => {\n setOpen(false);\n fireNonCancelableEvent(onCloseDropdown, null);\n };\n\n useImperativeHandle(ref, () => ({\n focus(options?: AutosuggestInputFocusOptions) {\n if (options?.preventDropdown) {\n preventOpenOnFocusRef.current = true;\n }\n inputRef.current?.focus();\n },\n select() {\n inputRef.current?.select();\n },\n open: openDropdown,\n close: closeDropdown,\n }));\n\n const handleBlur = () => {\n if (!preventCloseOnBlurRef.current) {\n closeDropdown();\n fireNonCancelableEvent(onBlur, null);\n }\n };\n\n const handleFocus = () => {\n if (!preventOpenOnFocusRef.current) {\n openDropdown();\n fireNonCancelableEvent(onFocus, null);\n }\n preventOpenOnFocusRef.current = false;\n };\n\n const fireKeydown = (event: CustomEvent<BaseKeyDetail>) => fireCancelableEvent(onKeyDown, event.detail, event);\n\n const handleKeyDown = (event: CustomEvent<BaseKeyDetail>) => {\n switch (event.detail.keyCode) {\n case KeyCode.down: {\n onPressArrowDown?.();\n openDropdown();\n event.preventDefault();\n break;\n }\n case KeyCode.up: {\n onPressArrowUp?.();\n openDropdown();\n event.preventDefault();\n break;\n }\n case KeyCode.enter: {\n if (open) {\n if (!onPressEnter?.()) {\n closeDropdown();\n }\n event.preventDefault();\n }\n fireKeydown(event);\n break;\n }\n case KeyCode.escape: {\n if (open) {\n event.stopPropagation();\n closeDropdown();\n } else if (value) {\n event.stopPropagation();\n fireNonCancelableEvent(onChange, { value: '' });\n }\n event.preventDefault();\n fireKeydown(event);\n break;\n }\n default: {\n fireKeydown(event);\n }\n }\n };\n\n const handleChange = (value: string) => {\n openDropdown();\n fireNonCancelableEvent(onChange, { value });\n };\n\n const handleDelayedInput = (value: string) => {\n fireNonCancelableEvent(onDelayedInput, { value });\n };\n\n const handleDropdownMouseDown: React.MouseEventHandler = event => {\n // Prevent currently focused element from losing focus.\n if (!dropdownContentFocusable) {\n event.preventDefault();\n }\n // Prevent closing dropdown on click inside.\n else {\n preventCloseOnBlurRef.current = true;\n requestAnimationFrame(() => {\n preventCloseOnBlurRef.current = false;\n });\n }\n };\n\n const expanded = open && dropdownExpanded;\n const nativeAttributes: InternalInputProps['__nativeAttributes'] = {\n name,\n placeholder,\n autoFocus,\n onClick: openDropdown,\n role: 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-expanded': expanded,\n 'aria-controls': open ? ariaControls : undefined,\n // 'aria-owns' needed for safari+vo to announce activedescendant content\n 'aria-owns': open ? ariaControls : undefined,\n 'aria-label': ariaLabel,\n 'aria-activedescendant': ariaActivedescendant,\n };\n\n // Closes dropdown when outside click is detected.\n // Similar to the internal dropdown implementation but includes the target as well.\n useEffect(() => {\n if (!open) {\n return;\n }\n\n const clickListener = (event: MouseEvent) => {\n if (\n !nodeBelongs(inputRef.current, event.target) &&\n !nodeBelongs(dropdownContentRef.current, event.target) &&\n !nodeBelongs(dropdownFooterRef.current, event.target)\n ) {\n closeDropdown();\n }\n };\n\n window.addEventListener('mousedown', clickListener);\n\n return () => {\n window.removeEventListener('mousedown', clickListener);\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n <Dropdown\n minWidth={dropdownWidth}\n stretchWidth={!dropdownWidth}\n stretchBeyondTriggerWidth={true}\n contentKey={dropdownContentKey}\n onFocus={handleFocus}\n onBlur={handleBlur}\n trigger={\n <InternalInput\n type=\"visualSearch\"\n value={value}\n onChange={event => handleChange(event.detail.value)}\n __onDelayedInput={event => handleDelayedInput(event.detail.value)}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n disabled={disabled}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n readOnly={readOnly}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n ref={inputRef}\n autoComplete={false}\n __nativeAttributes={nativeAttributes}\n {...formFieldContext}\n />\n }\n onMouseDown={handleDropdownMouseDown}\n open={open && (!!dropdownContent || !!dropdownFooter)}\n footer={\n dropdownFooterRef && (\n <div ref={dropdownFooterRef} className={styles['dropdown-footer']}>\n {dropdownFooter}\n </div>\n )\n }\n expandToViewport={expandToViewport}\n loopFocus={loopFocus}\n >\n {open && dropdownContent ? (\n <div ref={dropdownContentRef} className={styles['dropdown-content']}>\n {dropdownContent}\n </div>\n ) : null}\n </Dropdown>\n </div>\n );\n }\n);\n\nexport default AutosuggestInput;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/autosuggest-input/index.tsx"],"names":[],"mappings":"AAA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BAAC,aAAa,kBACZ,IAAI,EAAC,cAAc,EACnB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACnD,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EACjE,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,yBAAyB,EAAE,yBAAyB,EACpD,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,QAAQ,EACb,YAAY,EAAE,KAAK,EACnB,kBAAkB,EAAE,gBAAgB,IAChC,gBAAgB,EACpB,EAEJ,WAAW,EAAE,uBAAuB,EACpC,IAAI,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,eAAe,IAAI,CAAC,CAAC,cAAc,CAAC,EACrD,MAAM,EACJ,iBAAiB,IAAI,CACnB,6BAAK,GAAG,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,IAC9D,cAAc,CACX,CACP,EAEH,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,IAEnB,IAAI,IAAI,eAAe,CAAC,CAAC,CAAC,CACzB,6BAAK,GAAG,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC,IAChE,eAAe,CACZ,CACP,CAAC,CAAC,CAAC,IAAI,CACC,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { Ref, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { AutosuggestProps } from '../../../autosuggest/interfaces';\nimport {\n BaseChangeDetail,\n BaseInputProps,\n InputAutoCorrect,\n InputClearLabel,\n InputKeyEvents,\n} from '../../../input/interfaces';\nimport InternalInput, { InternalInputProps } from '../../../input/internal';\nimport { BaseComponentProps, getBaseProps } from '../../base-component';\nimport { FormFieldValidationControlProps, useFormFieldContext } from '../../context/form-field-context';\nimport { BaseKeyDetail, fireCancelableEvent, fireNonCancelableEvent, NonCancelableEventHandler } from '../../events';\nimport { InternalBaseComponentProps } from '../../hooks/use-base-component';\nimport { KeyCode } from '../../keycode';\nimport { documentHasFocus } from '../../utils/dom';\nimport { nodeBelongs } from '../../utils/node-belongs';\nimport Dropdown from '../dropdown';\nimport { ExpandToViewport } from '../dropdown/interfaces';\n\nimport styles from './styles.css.js';\n\ninterface AutosuggestInputProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n ExpandToViewport,\n InternalBaseComponentProps {\n ariaControls?: string;\n ariaActivedescendant?: string;\n dropdownExpanded?: boolean;\n dropdownContentKey?: string;\n dropdownContentFocusable?: boolean;\n dropdownContent?: React.ReactNode;\n dropdownFooter?: React.ReactNode;\n dropdownWidth?: number;\n loopFocus?: boolean;\n onCloseDropdown?: NonCancelableEventHandler<null>;\n onDelayedInput?: NonCancelableEventHandler<BaseChangeDetail>;\n onPressArrowDown?: () => void;\n onPressArrowUp?: () => void;\n onPressEnter?: () => boolean;\n}\n\ninterface AutosuggestInputFocusOptions {\n preventDropdown?: boolean;\n}\n\nexport interface AutosuggestInputRef extends AutosuggestProps.Ref {\n focus(options?: AutosuggestInputFocusOptions): void;\n open(): void;\n close(): void;\n}\n\nconst AutosuggestInput = React.forwardRef(\n (\n {\n value,\n onChange,\n onBlur,\n onFocus,\n onKeyUp,\n onKeyDown,\n name,\n placeholder,\n disabled,\n readOnly,\n autoFocus,\n ariaLabel,\n ariaRequired,\n disableBrowserAutocorrect = false,\n expandToViewport,\n ariaControls,\n ariaActivedescendant,\n clearAriaLabel,\n dropdownExpanded = true,\n dropdownContentKey,\n dropdownContentFocusable = false,\n dropdownContent = null,\n dropdownFooter = null,\n dropdownWidth,\n loopFocus,\n onCloseDropdown,\n onDelayedInput,\n onPressArrowDown,\n onPressArrowUp,\n onPressEnter,\n __internalRootRef,\n ...restProps\n }: AutosuggestInputProps,\n ref: Ref<AutosuggestInputRef>\n ) => {\n const baseProps = getBaseProps(restProps);\n const formFieldContext = useFormFieldContext(restProps);\n\n const inputRef = useRef<HTMLInputElement>(null);\n const dropdownContentRef = useRef<HTMLDivElement>(null);\n const dropdownFooterRef = useRef<HTMLDivElement>(null);\n const preventOpenOnFocusRef = useRef(false);\n const preventCloseOnBlurRef = useRef(false);\n\n const [open, setOpen] = useState(false);\n\n const openDropdown = () => !readOnly && setOpen(true);\n\n const closeDropdown = () => {\n setOpen(false);\n fireNonCancelableEvent(onCloseDropdown, null);\n };\n\n useImperativeHandle(ref, () => ({\n focus(options?: AutosuggestInputFocusOptions) {\n if (options?.preventDropdown) {\n preventOpenOnFocusRef.current = true;\n }\n inputRef.current?.focus();\n },\n select() {\n inputRef.current?.select();\n },\n open: openDropdown,\n close: closeDropdown,\n }));\n\n const handleBlur = () => {\n // When the document in not in focus it means the focus moved outside the page. In that case the dropdown shall stay open\n // so that when the user comes back it does not re-open unexpectedly when the focus is restored by the browser.\n if (!documentHasFocus()) {\n return;\n }\n if (!preventCloseOnBlurRef.current) {\n closeDropdown();\n fireNonCancelableEvent(onBlur, null);\n }\n };\n\n const handleFocus = () => {\n if (!preventOpenOnFocusRef.current) {\n openDropdown();\n fireNonCancelableEvent(onFocus, null);\n }\n preventOpenOnFocusRef.current = false;\n };\n\n const fireKeydown = (event: CustomEvent<BaseKeyDetail>) => fireCancelableEvent(onKeyDown, event.detail, event);\n\n const handleKeyDown = (event: CustomEvent<BaseKeyDetail>) => {\n switch (event.detail.keyCode) {\n case KeyCode.down: {\n onPressArrowDown?.();\n openDropdown();\n event.preventDefault();\n break;\n }\n case KeyCode.up: {\n onPressArrowUp?.();\n openDropdown();\n event.preventDefault();\n break;\n }\n case KeyCode.enter: {\n if (open) {\n if (!onPressEnter?.()) {\n closeDropdown();\n }\n event.preventDefault();\n }\n fireKeydown(event);\n break;\n }\n case KeyCode.escape: {\n if (open) {\n event.stopPropagation();\n closeDropdown();\n } else if (value) {\n event.stopPropagation();\n fireNonCancelableEvent(onChange, { value: '' });\n }\n event.preventDefault();\n fireKeydown(event);\n break;\n }\n default: {\n fireKeydown(event);\n }\n }\n };\n\n const handleChange = (value: string) => {\n openDropdown();\n fireNonCancelableEvent(onChange, { value });\n };\n\n const handleDelayedInput = (value: string) => {\n fireNonCancelableEvent(onDelayedInput, { value });\n };\n\n const handleDropdownMouseDown: React.MouseEventHandler = event => {\n // Prevent currently focused element from losing focus.\n if (!dropdownContentFocusable) {\n event.preventDefault();\n }\n // Prevent closing dropdown on click inside.\n else {\n preventCloseOnBlurRef.current = true;\n requestAnimationFrame(() => {\n preventCloseOnBlurRef.current = false;\n });\n }\n };\n\n const expanded = open && dropdownExpanded;\n const nativeAttributes: InternalInputProps['__nativeAttributes'] = {\n name,\n placeholder,\n autoFocus,\n onClick: openDropdown,\n role: 'combobox',\n 'aria-autocomplete': 'list',\n 'aria-expanded': expanded,\n 'aria-controls': open ? ariaControls : undefined,\n // 'aria-owns' needed for safari+vo to announce activedescendant content\n 'aria-owns': open ? ariaControls : undefined,\n 'aria-label': ariaLabel,\n 'aria-activedescendant': ariaActivedescendant,\n };\n\n // Closes dropdown when outside click is detected.\n // Similar to the internal dropdown implementation but includes the target as well.\n useEffect(() => {\n if (!open) {\n return;\n }\n\n const clickListener = (event: MouseEvent) => {\n if (\n !nodeBelongs(inputRef.current, event.target) &&\n !nodeBelongs(dropdownContentRef.current, event.target) &&\n !nodeBelongs(dropdownFooterRef.current, event.target)\n ) {\n closeDropdown();\n }\n };\n\n window.addEventListener('mousedown', clickListener);\n\n return () => {\n window.removeEventListener('mousedown', clickListener);\n };\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n <Dropdown\n minWidth={dropdownWidth}\n stretchWidth={!dropdownWidth}\n stretchBeyondTriggerWidth={true}\n contentKey={dropdownContentKey}\n onFocus={handleFocus}\n onBlur={handleBlur}\n trigger={\n <InternalInput\n type=\"visualSearch\"\n value={value}\n onChange={event => handleChange(event.detail.value)}\n __onDelayedInput={event => handleDelayedInput(event.detail.value)}\n onKeyDown={handleKeyDown}\n onKeyUp={onKeyUp}\n disabled={disabled}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n readOnly={readOnly}\n ariaRequired={ariaRequired}\n clearAriaLabel={clearAriaLabel}\n ref={inputRef}\n autoComplete={false}\n __nativeAttributes={nativeAttributes}\n {...formFieldContext}\n />\n }\n onMouseDown={handleDropdownMouseDown}\n open={open && (!!dropdownContent || !!dropdownFooter)}\n footer={\n dropdownFooterRef && (\n <div ref={dropdownFooterRef} className={styles['dropdown-footer']}>\n {dropdownFooter}\n </div>\n )\n }\n expandToViewport={expandToViewport}\n loopFocus={loopFocus}\n >\n {open && dropdownContent ? (\n <div ref={dropdownContentRef} className={styles['dropdown-content']}>\n {dropdownContent}\n </div>\n ) : null}\n </Dropdown>\n </div>\n );\n }\n);\n\nexport default AutosuggestInput;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DragHandleProps } from './interfaces';
|
|
3
3
|
export { DragHandleProps };
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
4
|
+
declare const InternalDragHandle: React.ForwardRefExoticComponent<DragHandleProps & React.RefAttributes<DragHandleProps.Ref>>;
|
|
5
|
+
export default InternalDragHandle;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAOlD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,kBAAkB,6FAiEvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
1
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
4
|
import React, { forwardRef, useRef } from 'react';
|
|
4
5
|
import clsx from 'clsx';
|
|
5
6
|
import InternalIcon from '../../../icon/internal';
|
|
7
|
+
import { getBaseProps } from '../../base-component';
|
|
6
8
|
import useForwardFocus from '../../hooks/forward-focus';
|
|
7
9
|
import { ResizeIcon } from './resize-icon';
|
|
8
10
|
import styles from './styles.css.js';
|
|
9
|
-
const
|
|
11
|
+
const InternalDragHandle = forwardRef((_a, ref) => {
|
|
12
|
+
var { variant = 'drag-indicator', size = 'normal', ariaLabel, ariaDescribedby, ariaValue, disabled, onPointerDown, onKeyDown } = _a, rest = __rest(_a, ["variant", "size", "ariaLabel", "ariaDescribedby", "ariaValue", "disabled", "onPointerDown", "onKeyDown"]);
|
|
13
|
+
const baseProps = getBaseProps(rest);
|
|
10
14
|
const dragHandleRefObject = useRef(null);
|
|
11
15
|
useForwardFocus(ref, dragHandleRefObject);
|
|
12
16
|
const iconProps = (() => {
|
|
@@ -28,8 +32,8 @@ const DragHandle = forwardRef(({ variant = 'drag-indicator', size = 'normal', ar
|
|
|
28
32
|
// (See https://bugs.webkit.org/show_bug.cgi?id=22261)
|
|
29
33
|
// Otherwise, we can't reliably catch keyboard events coming from the handle
|
|
30
34
|
// when it is being dragged.
|
|
31
|
-
React.createElement("div", { ref: dragHandleRefObject, role: ariaValue ? 'slider' : 'button', tabIndex: 0, className: clsx(className, styles.handle, styles[`handle-${variant}`], styles[`handle-size-${size}`], disabled && styles['handle-disabled']), "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-disabled": disabled, "aria-valuemax": ariaValue === null || ariaValue === void 0 ? void 0 : ariaValue.valueMax, "aria-valuemin": ariaValue === null || ariaValue === void 0 ? void 0 : ariaValue.valueMin, "aria-valuenow": ariaValue === null || ariaValue === void 0 ? void 0 : ariaValue.valueNow, onPointerDown: onPointerDown, onKeyDown: onKeyDown },
|
|
35
|
+
React.createElement("div", Object.assign({}, baseProps, { ref: dragHandleRefObject, role: ariaValue ? 'slider' : 'button', tabIndex: 0, className: clsx(baseProps.className, styles.handle, styles[`handle-${variant}`], styles[`handle-size-${size}`], disabled && styles['handle-disabled']), "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-disabled": disabled, "aria-valuemax": ariaValue === null || ariaValue === void 0 ? void 0 : ariaValue.valueMax, "aria-valuemin": ariaValue === null || ariaValue === void 0 ? void 0 : ariaValue.valueMin, "aria-valuenow": ariaValue === null || ariaValue === void 0 ? void 0 : ariaValue.valueNow, onPointerDown: onPointerDown, onKeyDown: onKeyDown }),
|
|
32
36
|
React.createElement(InternalIcon, Object.assign({}, iconProps))));
|
|
33
37
|
});
|
|
34
|
-
export default
|
|
38
|
+
export default InternalDragHandle;
|
|
35
39
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,kBAAkB,GAAG,UAAU,CACnC,CACE,EAUkB,EAClB,GAAmC,EACnC,EAAE;QAZF,EACE,OAAO,GAAG,gBAAgB,EAC1B,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,eAAe,EACf,SAAS,EACT,QAAQ,EACR,aAAa,EACb,SAAS,OAEO,EADb,IAAI,cATT,0GAUC,CADQ;IAIT,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,mBAAmB,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAEzD,eAAe,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;IAE1C,MAAM,SAAS,GAAc,CAAC,GAAG,EAAE;QACjC,MAAM,MAAM,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAE,UAAoB,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC;QAC/E,QAAQ,OAAO,EAAE;YACf,KAAK,gBAAgB;gBACnB,uC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, { forwardRef, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { IconProps } from '../../../icon/interfaces';\nimport InternalIcon from '../../../icon/internal';\nimport { getBaseProps } from '../../base-component';\nimport useForwardFocus from '../../hooks/forward-focus';\nimport { DragHandleProps } from './interfaces';\nimport { ResizeIcon } from './resize-icon';\n\nimport styles from './styles.css.js';\n\nexport { DragHandleProps };\n\nconst InternalDragHandle = forwardRef(\n (\n {\n variant = 'drag-indicator',\n size = 'normal',\n ariaLabel,\n ariaDescribedby,\n ariaValue,\n disabled,\n onPointerDown,\n onKeyDown,\n ...rest\n }: DragHandleProps,\n ref: React.Ref<DragHandleProps.Ref>\n ) => {\n const baseProps = getBaseProps(rest);\n const dragHandleRefObject = useRef<HTMLDivElement>(null);\n\n useForwardFocus(ref, dragHandleRefObject);\n\n const iconProps: IconProps = (() => {\n const shared = { variant: disabled ? ('disabled' as const) : undefined, size };\n switch (variant) {\n case 'drag-indicator':\n return { ...shared, name: 'drag-indicator' };\n case 'resize-area':\n return { ...shared, name: 'resize-area' };\n case 'resize-horizontal':\n return { ...shared, svg: <ResizeIcon variant=\"horizontal\" /> };\n case 'resize-vertical':\n return { ...shared, svg: <ResizeIcon variant=\"vertical\" /> };\n }\n })();\n\n return (\n // We need to use a div with button role instead of a button\n // so that Safari will focus on it when clicking it.\n // (See https://bugs.webkit.org/show_bug.cgi?id=22261)\n // Otherwise, we can't reliably catch keyboard events coming from the handle\n // when it is being dragged.\n <div\n {...baseProps}\n ref={dragHandleRefObject}\n role={ariaValue ? 'slider' : 'button'}\n tabIndex={0}\n className={clsx(\n baseProps.className,\n styles.handle,\n styles[`handle-${variant}`],\n styles[`handle-size-${size}`],\n disabled && styles['handle-disabled']\n )}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-disabled={disabled}\n aria-valuemax={ariaValue?.valueMax}\n aria-valuemin={ariaValue?.valueMin}\n aria-valuenow={ariaValue?.valueNow}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n >\n <InternalIcon {...iconProps} />\n </div>\n );\n }\n);\n\nexport default InternalDragHandle;\n"]}
|
|
@@ -6,9 +6,9 @@ export interface DragHandleProps {
|
|
|
6
6
|
ariaDescribedby?: string;
|
|
7
7
|
ariaValue?: DragHandleProps.AriaValue;
|
|
8
8
|
disabled?: boolean;
|
|
9
|
+
className?: string;
|
|
9
10
|
onPointerDown?: React.PointerEventHandler;
|
|
10
11
|
onKeyDown?: React.KeyboardEventHandler;
|
|
11
|
-
className?: string;
|
|
12
12
|
}
|
|
13
13
|
export declare namespace DragHandleProps {
|
|
14
14
|
type Variant = 'drag-indicator' | 'resize-area' | 'resize-horizontal' | 'resize-vertical';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/interfaces.ts"],"names":[],"mappings":";AAGA,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC;IAClC,IAAI,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/interfaces.ts"],"names":[],"mappings":";AAGA,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC;IAClC,IAAI,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC;IAC1C,SAAS,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC;CACxC;AAED,yBAAiB,eAAe,CAAC;IAC/B,KAAY,OAAO,GAAG,gBAAgB,GAAG,aAAa,GAAG,mBAAmB,GAAG,iBAAiB,CAAC;IAEjG,KAAY,IAAI,GAAG,OAAO,GAAG,QAAQ,CAAC;IAEtC,UAAiB,SAAS;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KAClB;IAED,UAAiB,GAAG;QAClB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;KACrC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport interface DragHandleProps {\n variant?: DragHandleProps.Variant;\n size?: DragHandleProps.Size;\n ariaLabel: string;\n ariaDescribedby?: string;\n ariaValue?: DragHandleProps.AriaValue;\n disabled?: boolean;\n onPointerDown?: React.PointerEventHandler;\n onKeyDown?: React.KeyboardEventHandler;\n
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/drag-handle/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport interface DragHandleProps {\n variant?: DragHandleProps.Variant;\n size?: DragHandleProps.Size;\n ariaLabel: string;\n ariaDescribedby?: string;\n ariaValue?: DragHandleProps.AriaValue;\n disabled?: boolean;\n className?: string;\n onPointerDown?: React.PointerEventHandler;\n onKeyDown?: React.KeyboardEventHandler;\n}\n\nexport namespace DragHandleProps {\n export type Variant = 'drag-indicator' | 'resize-area' | 'resize-horizontal' | 'resize-vertical';\n\n export type Size = 'small' | 'normal';\n\n export interface AriaValue {\n valueMin: number;\n valueMax: number;\n valueNow: number;\n }\n\n export interface Ref {\n focus(options?: FocusOptions): void;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/icon.tsx"],"names":[],"mappings":";AAIA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,eAe7E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export default function ResizeHandleIcon({ className }) {
|
|
5
|
+
return (React.createElement("svg", { focusable: false, className: className, xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", "aria-hidden": true },
|
|
6
|
+
React.createElement("line", { strokeWidth: "2", x1: "2", y1: "5", x2: "14", y2: "5" }),
|
|
7
|
+
React.createElement("line", { strokeWidth: "2", x1: "14", y1: "10", x2: "2", y2: "10" })));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/icon.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,SAAS,EAA0B;IAC5E,OAAO,CACL,6BACE,SAAS,EAAE,KAAK,EAChB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,iBACN,IAAI;QAEjB,8BAAM,WAAW,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,GAAG;QACrD,8BAAM,WAAW,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,GAAG,CACnD,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nexport default function ResizeHandleIcon({ className }: { className?: string }) {\n return (\n <svg\n focusable={false}\n className={className}\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n aria-hidden={true}\n >\n <line strokeWidth=\"2\" x1=\"2\" y1=\"5\" x2=\"14\" y2=\"5\" />\n <line strokeWidth=\"2\" x1=\"14\" y1=\"10\" x2=\"2\" y2=\"10\" />\n </svg>\n );\n}\n"]}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
interface ResizeHandleProps {
|
|
3
|
+
className?: string;
|
|
3
4
|
ariaLabel: string | undefined;
|
|
4
5
|
position: 'side' | 'bottom';
|
|
5
6
|
ariaValuenow: number;
|
|
6
7
|
onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
|
|
7
8
|
onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;
|
|
8
|
-
className?: string;
|
|
9
9
|
}
|
|
10
|
-
declare const _default: React.ForwardRefExoticComponent<ResizeHandleProps & React.RefAttributes<
|
|
11
|
-
focus: () => void;
|
|
12
|
-
}>>;
|
|
10
|
+
declare const _default: React.ForwardRefExoticComponent<ResizeHandleProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
11
|
export default _default;
|
|
14
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC7D,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACjE;;AAED,wBAoBG"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import ResizeHandleIcon from './icon';
|
|
5
6
|
import styles from './styles.css.js';
|
|
6
|
-
export default React.forwardRef(function PanelResizeHandle({ ariaLabel, ariaValuenow, position, onKeyDown, onPointerDown
|
|
7
|
-
return (React.createElement("div", { className: styles[`
|
|
8
|
-
React.createElement(
|
|
9
|
-
valueMin: 0,
|
|
10
|
-
valueMax: 100,
|
|
11
|
-
valueNow: ariaValuenow,
|
|
12
|
-
}, onPointerDown: onPointerDown, onKeyDown: onKeyDown, className: className })));
|
|
7
|
+
export default React.forwardRef(function PanelResizeHandle({ className, ariaLabel, ariaValuenow, position, onKeyDown, onPointerDown }, ref) {
|
|
8
|
+
return (React.createElement("div", { ref: ref, className: clsx(className, styles.slider, styles[`slider-${position}`]), role: "slider", tabIndex: 0, "aria-label": ariaLabel, "aria-valuemax": 100, "aria-valuemin": 0, "aria-valuenow": ariaValuenow, onKeyDown: onKeyDown, onPointerDown: onPointerDown },
|
|
9
|
+
React.createElement(ResizeHandleIcon, { className: clsx(styles['slider-icon'], styles[`slider-icon-${position}`]) })));
|
|
13
10
|
});
|
|
14
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,gBAAgB,MAAM,QAAQ,CAAC;AAEtC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAWrC,eAAe,KAAK,CAAC,UAAU,CAAoC,SAAS,iBAAiB,CAC3F,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,EAC1E,GAAG;IAEH,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,QAAQ,EAAE,CAAC,CAAC,EACvE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,gBACC,SAAS,mBACN,GAAG,mBACH,CAAC,mBACD,YAAY,EAC3B,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa;QAE5B,oBAAC,gBAAgB,IAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC,eAAe,QAAQ,EAAE,CAAC,CAAC,GAAI,CAC3F,CACP,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport ResizeHandleIcon from './icon';\n\nimport styles from './styles.css.js';\n\ninterface ResizeHandleProps {\n className?: string;\n ariaLabel: string | undefined;\n position: 'side' | 'bottom';\n ariaValuenow: number;\n onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;\n onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;\n}\n\nexport default React.forwardRef<HTMLDivElement, ResizeHandleProps>(function PanelResizeHandle(\n { className, ariaLabel, ariaValuenow, position, onKeyDown, onPointerDown },\n ref\n) {\n return (\n <div\n ref={ref}\n className={clsx(className, styles.slider, styles[`slider-${position}`])}\n role=\"slider\"\n tabIndex={0}\n aria-label={ariaLabel}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={ariaValuenow}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n >\n <ResizeHandleIcon className={clsx(styles['slider-icon'], styles[`slider-icon-${position}`])} />\n </div>\n );\n});\n"]}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"
|
|
5
|
-
"
|
|
4
|
+
"slider": "awsui_slider_cqzlk_1vl2o_145",
|
|
5
|
+
"slider-side": "awsui_slider-side_cqzlk_1vl2o_180",
|
|
6
|
+
"slider-icon": "awsui_slider-icon_cqzlk_1vl2o_187",
|
|
7
|
+
"slider-icon-bottom": "awsui_slider-icon-bottom_cqzlk_1vl2o_193",
|
|
8
|
+
"slider-icon-side": "awsui_slider-icon-side_cqzlk_1vl2o_197"
|
|
6
9
|
};
|
|
7
10
|
|
|
@@ -2,10 +2,198 @@
|
|
|
2
2
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
/*
|
|
6
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
|
+
SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
9
|
+
/*
|
|
10
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
11
|
+
SPDX-License-Identifier: Apache-2.0
|
|
12
|
+
*/
|
|
13
|
+
/*
|
|
14
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
15
|
+
SPDX-License-Identifier: Apache-2.0
|
|
16
|
+
*/
|
|
17
|
+
/*
|
|
18
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
19
|
+
SPDX-License-Identifier: Apache-2.0
|
|
20
|
+
*/
|
|
21
|
+
/*
|
|
22
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
23
|
+
SPDX-License-Identifier: Apache-2.0
|
|
24
|
+
*/
|
|
25
|
+
/*
|
|
26
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
27
|
+
SPDX-License-Identifier: Apache-2.0
|
|
28
|
+
*/
|
|
29
|
+
/*
|
|
30
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
31
|
+
SPDX-License-Identifier: Apache-2.0
|
|
32
|
+
*/
|
|
33
|
+
/*
|
|
34
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
35
|
+
SPDX-License-Identifier: Apache-2.0
|
|
36
|
+
*/
|
|
37
|
+
/*
|
|
38
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
39
|
+
SPDX-License-Identifier: Apache-2.0
|
|
40
|
+
*/
|
|
41
|
+
/*
|
|
42
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
43
|
+
SPDX-License-Identifier: Apache-2.0
|
|
44
|
+
*/
|
|
45
|
+
/*
|
|
46
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
47
|
+
SPDX-License-Identifier: Apache-2.0
|
|
48
|
+
*/
|
|
49
|
+
/*
|
|
50
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
51
|
+
SPDX-License-Identifier: Apache-2.0
|
|
52
|
+
*/
|
|
53
|
+
/*
|
|
54
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
55
|
+
SPDX-License-Identifier: Apache-2.0
|
|
56
|
+
*/
|
|
57
|
+
/*
|
|
58
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
59
|
+
SPDX-License-Identifier: Apache-2.0
|
|
60
|
+
*/
|
|
61
|
+
/*
|
|
62
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
63
|
+
SPDX-License-Identifier: Apache-2.0
|
|
64
|
+
*/
|
|
65
|
+
/*
|
|
66
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
67
|
+
SPDX-License-Identifier: Apache-2.0
|
|
68
|
+
*/
|
|
69
|
+
/*
|
|
70
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
71
|
+
SPDX-License-Identifier: Apache-2.0
|
|
72
|
+
*/
|
|
73
|
+
/*
|
|
74
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
75
|
+
SPDX-License-Identifier: Apache-2.0
|
|
76
|
+
*/
|
|
77
|
+
/*
|
|
78
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
79
|
+
SPDX-License-Identifier: Apache-2.0
|
|
80
|
+
*/
|
|
81
|
+
/*
|
|
82
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
83
|
+
SPDX-License-Identifier: Apache-2.0
|
|
84
|
+
*/
|
|
85
|
+
/*
|
|
86
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
87
|
+
SPDX-License-Identifier: Apache-2.0
|
|
88
|
+
*/
|
|
89
|
+
/*
|
|
90
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
|
+
SPDX-License-Identifier: Apache-2.0
|
|
92
|
+
*/
|
|
93
|
+
/*
|
|
94
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
95
|
+
SPDX-License-Identifier: Apache-2.0
|
|
96
|
+
*/
|
|
97
|
+
/*
|
|
98
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
99
|
+
SPDX-License-Identifier: Apache-2.0
|
|
100
|
+
*/
|
|
101
|
+
/*
|
|
102
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
103
|
+
SPDX-License-Identifier: Apache-2.0
|
|
104
|
+
*/
|
|
105
|
+
/*
|
|
106
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
107
|
+
SPDX-License-Identifier: Apache-2.0
|
|
108
|
+
*/
|
|
109
|
+
/*
|
|
110
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
111
|
+
SPDX-License-Identifier: Apache-2.0
|
|
112
|
+
*/
|
|
113
|
+
/* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
114
|
+
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
115
|
+
/*
|
|
116
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
117
|
+
SPDX-License-Identifier: Apache-2.0
|
|
118
|
+
*/
|
|
119
|
+
/*
|
|
120
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
121
|
+
SPDX-License-Identifier: Apache-2.0
|
|
122
|
+
*/
|
|
123
|
+
/*
|
|
124
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
125
|
+
SPDX-License-Identifier: Apache-2.0
|
|
126
|
+
*/
|
|
127
|
+
/*
|
|
128
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
129
|
+
SPDX-License-Identifier: Apache-2.0
|
|
130
|
+
*/
|
|
131
|
+
/*
|
|
132
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
133
|
+
SPDX-License-Identifier: Apache-2.0
|
|
134
|
+
*/
|
|
135
|
+
/*
|
|
136
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
137
|
+
SPDX-License-Identifier: Apache-2.0
|
|
138
|
+
*/
|
|
139
|
+
/*
|
|
140
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
141
|
+
SPDX-License-Identifier: Apache-2.0
|
|
142
|
+
*/
|
|
143
|
+
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
|
+
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
+
.awsui_slider_cqzlk_1vl2o_145:not(#\9) {
|
|
146
|
+
padding-block: 0;
|
|
147
|
+
padding-inline: 0;
|
|
148
|
+
cursor: ns-resize;
|
|
149
|
+
margin-block-start: 2px;
|
|
150
|
+
margin-block-end: 0;
|
|
151
|
+
margin-inline: 0;
|
|
152
|
+
block-size: 16px;
|
|
153
|
+
touch-action: none;
|
|
154
|
+
}
|
|
155
|
+
.awsui_slider_cqzlk_1vl2o_145:not(#\9):focus {
|
|
156
|
+
outline: none;
|
|
157
|
+
}
|
|
158
|
+
body[data-awsui-focus-visible=true] .awsui_slider_cqzlk_1vl2o_145:not(#\9):focus {
|
|
159
|
+
position: relative;
|
|
160
|
+
}
|
|
161
|
+
body[data-awsui-focus-visible=true] .awsui_slider_cqzlk_1vl2o_145:not(#\9):focus {
|
|
162
|
+
outline: 2px dotted transparent;
|
|
163
|
+
outline-offset: calc(0px - 1px);
|
|
164
|
+
}
|
|
165
|
+
body[data-awsui-focus-visible=true] .awsui_slider_cqzlk_1vl2o_145:not(#\9):focus::before {
|
|
166
|
+
content: " ";
|
|
167
|
+
display: block;
|
|
168
|
+
position: absolute;
|
|
169
|
+
inset-inline-start: calc(-1 * 0px);
|
|
170
|
+
inset-block-start: calc(-1 * 0px);
|
|
171
|
+
inline-size: calc(100% + 0px + 0px);
|
|
172
|
+
block-size: calc(100% + 0px + 0px);
|
|
173
|
+
border-start-start-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
|
|
174
|
+
border-start-end-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
|
|
175
|
+
border-end-start-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
|
|
176
|
+
border-end-end-radius: var(--border-radius-control-default-focus-ring-u8zbsz, 4px);
|
|
177
|
+
box-shadow: 0 0 0 2px var(--color-border-item-focused-nv6mhz, #006ce0);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.awsui_slider-side_cqzlk_1vl2o_180:not(#\9) {
|
|
181
|
+
cursor: ew-resize;
|
|
182
|
+
margin-block: 0;
|
|
6
183
|
margin-inline-start: 2px;
|
|
184
|
+
margin-inline-end: 0;
|
|
7
185
|
}
|
|
8
186
|
|
|
9
|
-
.
|
|
10
|
-
|
|
187
|
+
.awsui_slider-icon_cqzlk_1vl2o_187:not(#\9) {
|
|
188
|
+
stroke: var(--color-text-interactive-default-tkx8fe, #424650);
|
|
189
|
+
}
|
|
190
|
+
.awsui_slider-icon_cqzlk_1vl2o_187:not(#\9):hover {
|
|
191
|
+
stroke: var(--color-text-interactive-hover-f9gqs8, #0f141a);
|
|
192
|
+
}
|
|
193
|
+
.awsui_slider-icon-bottom_cqzlk_1vl2o_193:not(#\9) {
|
|
194
|
+
margin-block: auto;
|
|
195
|
+
margin-inline: auto;
|
|
196
|
+
}
|
|
197
|
+
.awsui_slider-icon-side_cqzlk_1vl2o_197:not(#\9) {
|
|
198
|
+
transform: rotate(90deg);
|
|
11
199
|
}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"slider": "awsui_slider_cqzlk_1vl2o_145",
|
|
6
|
+
"slider-side": "awsui_slider-side_cqzlk_1vl2o_180",
|
|
7
|
+
"slider-icon": "awsui_slider-icon_cqzlk_1vl2o_187",
|
|
8
|
+
"slider-icon-bottom": "awsui_slider-icon-bottom_cqzlk_1vl2o_193",
|
|
9
|
+
"slider-icon-side": "awsui_slider-icon-side_cqzlk_1vl2o_197"
|
|
7
10
|
};
|
|
8
11
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SortableAreaProps } from './interfaces';
|
|
3
|
+
export { SortableAreaProps };
|
|
4
|
+
export default function SortableArea<Item>({ items, itemDefinition, renderItem, onItemsChange, disableReorder, i18nStrings, }: SortableAreaProps<Item>): JSX.Element;
|
|
5
|
+
export declare function getBorderRadiusVariant(itemDefinition: SortableAreaProps.ItemDefinition<any>): SortableAreaProps.BorderRadiusVariant;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/sortable-area/index.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMjD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,IAAI,EAAE,EACzC,KAAK,EACL,cAAc,EACd,UAAU,EACV,aAAa,EACb,cAAc,EACd,WAAW,GACZ,EAAE,iBAAiB,CAAC,IAAI,CAAC,eA4EzB;AAyED,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,iBAAiB,CAAC,cAAc,CAAC,GAAG,CAAC,GACpD,iBAAiB,CAAC,mBAAmB,CAEvC"}
|