@cloudscape-design/components-themeable 3.0.611 → 3.0.613
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/app-layout/test-classes/styles.scss +3 -0
- package/lib/internal/scss/button-dropdown/category-elements/styles.scss +0 -13
- package/lib/internal/scss/button-dropdown/item-element/styles.scss +13 -39
- package/lib/internal/scss/table/body-cell/styles.scss +11 -17
- package/lib/internal/scss/table/expandable-rows/styles.scss +0 -1
- package/lib/internal/scss/table/header-cell/styles.scss +18 -25
- package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.js +2 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.js.map +1 -1
- package/lib/internal/template/app-layout/test-classes/styles.css.js +18 -17
- package/lib/internal/template/app-layout/test-classes/styles.scoped.css +21 -17
- package/lib/internal/template/app-layout/test-classes/styles.selectors.js +18 -17
- package/lib/internal/template/button-dropdown/category-elements/styles.css.js +14 -14
- package/lib/internal/template/button-dropdown/category-elements/styles.scoped.css +22 -33
- package/lib/internal/template/button-dropdown/category-elements/styles.selectors.js +14 -14
- package/lib/internal/template/button-dropdown/interfaces.d.ts +0 -2
- package/lib/internal/template/button-dropdown/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/interfaces.js.map +1 -1
- package/lib/internal/template/button-dropdown/item-element/index.d.ts +1 -1
- package/lib/internal/template/button-dropdown/item-element/index.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/item-element/index.js +1 -3
- package/lib/internal/template/button-dropdown/item-element/index.js.map +1 -1
- package/lib/internal/template/button-dropdown/item-element/styles.css.js +9 -16
- package/lib/internal/template/button-dropdown/item-element/styles.scoped.css +12 -29
- package/lib/internal/template/button-dropdown/item-element/styles.selectors.js +9 -16
- package/lib/internal/template/button-dropdown/items-list.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/items-list.js +1 -2
- package/lib/internal/template/button-dropdown/items-list.js.map +1 -1
- package/lib/internal/template/internal/components/token-list/index.d.ts +1 -1
- package/lib/internal/template/internal/components/token-list/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/token-list/index.js +2 -2
- package/lib/internal/template/internal/components/token-list/index.js.map +1 -1
- package/lib/internal/template/internal/components/token-list/interfaces.d.ts +2 -0
- package/lib/internal/template/internal/components/token-list/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/token-list/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/token-list/token-limit-toggle.d.ts +3 -1
- package/lib/internal/template/internal/components/token-list/token-limit-toggle.d.ts.map +1 -1
- package/lib/internal/template/internal/components/token-list/token-limit-toggle.js +3 -2
- package/lib/internal/template/internal/components/token-list/token-limit-toggle.js.map +1 -1
- package/lib/internal/template/internal/context/single-tab-stop-navigation-context.d.ts +3 -3
- package/lib/internal/template/internal/context/single-tab-stop-navigation-context.d.ts.map +1 -1
- package/lib/internal/template/internal/context/single-tab-stop-navigation-context.js.map +1 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/multiselect/interfaces.d.ts +10 -0
- package/lib/internal/template/multiselect/interfaces.d.ts.map +1 -1
- package/lib/internal/template/multiselect/interfaces.js.map +1 -1
- package/lib/internal/template/multiselect/internal.d.ts.map +1 -1
- package/lib/internal/template/multiselect/internal.js +2 -2
- package/lib/internal/template/multiselect/internal.js.map +1 -1
- package/lib/internal/template/property-filter/index.d.ts.map +1 -1
- package/lib/internal/template/property-filter/index.js +2 -2
- package/lib/internal/template/property-filter/index.js.map +1 -1
- package/lib/internal/template/property-filter/interfaces.d.ts +10 -0
- package/lib/internal/template/property-filter/interfaces.d.ts.map +1 -1
- package/lib/internal/template/property-filter/interfaces.js.map +1 -1
- package/lib/internal/template/table/body-cell/styles.css.js +42 -42
- package/lib/internal/template/table/body-cell/styles.scoped.css +162 -159
- package/lib/internal/template/table/body-cell/styles.selectors.js +42 -42
- package/lib/internal/template/table/header-cell/styles.css.js +25 -25
- package/lib/internal/template/table/header-cell/styles.scoped.css +60 -60
- package/lib/internal/template/table/header-cell/styles.selectors.js +25 -25
- package/lib/internal/template/table/internal.d.ts.map +1 -1
- package/lib/internal/template/table/internal.js +20 -11
- package/lib/internal/template/table/internal.js.map +1 -1
- package/lib/internal/template/table/table-role/grid-navigation.js +6 -0
- package/lib/internal/template/table/table-role/grid-navigation.js.map +1 -1
- package/lib/internal/template/test-utils/dom/app-layout/index.d.ts +2 -0
- package/lib/internal/template/test-utils/dom/app-layout/index.js +4 -0
- package/lib/internal/template/test-utils/dom/app-layout/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/app-layout/index.d.ts +2 -0
- package/lib/internal/template/test-utils/selectors/app-layout/index.js +4 -0
- package/lib/internal/template/test-utils/selectors/app-layout/index.js.map +1 -1
- package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
- package/lib/internal/template/token-group/interfaces.d.ts +10 -0
- package/lib/internal/template/token-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/token-group/interfaces.js.map +1 -1
- package/lib/internal/template/token-group/internal.d.ts +1 -1
- package/lib/internal/template/token-group/internal.d.ts.map +1 -1
- package/lib/internal/template/token-group/internal.js +2 -2
- package/lib/internal/template/token-group/internal.js.map +1 -1
- package/package.json +1 -1
|
@@ -192,8 +192,6 @@ export interface ItemProps {
|
|
|
192
192
|
highlighted: boolean;
|
|
193
193
|
onItemActivate: ItemActivate;
|
|
194
194
|
highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;
|
|
195
|
-
first?: boolean;
|
|
196
|
-
lastInSection: boolean;
|
|
197
195
|
showDivider: boolean;
|
|
198
196
|
hasCategoryHeader: boolean;
|
|
199
197
|
isKeyboardHighlighted?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/interfaces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AAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,OAAO,CAAC;IACrF,KAAK,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC;AAE/D,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,iBAAiB,CAAC;AAEnE,MAAM,WAAW,2BACf,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,OAAO,CAAC,EACpD,0BAA0B;IAC5B,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,KAAK,CAAC,SAAS,CAAC;IACtE,OAAO,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC;IACxD,KAAK,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IAE1C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-dropdown/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';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler } from '../internal/events';\nimport { IconProps } from '../icon/interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport { ButtonProps } from '../button/interfaces';\n\nexport interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewport {\n /**\n * Array of objects, each having the following properties:\n\n * - `id` (string) - allows to identify the item that the user clicked on. Mandatory for individual items, optional for categories.\n\n * - `text` (string) - description shown in the menu for this item. Mandatory for individual items, optional for categories.\n\n * - `lang` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.\n\n * - `disabled` (boolean) - whether the item is disabled. Disabled items are not clickable, but they can be highlighted with the keyboard to make them accessible.\n\n * - `disabledReason` (string) - (Optional) Displays text near the `text` property when item is disabled. Use to provide additional context.\n\n * - `items` (ReadonlyArray<Item>): an array of item objects. Items will be rendered as nested menu items but only for the first nesting level, multi-nesting is not supported.\n * An item which belongs to nested group has the following properties: `id`, `text`, `disabled` and `description`.\n\n * - `description` (string) - additional data that will be passed to a `data-description` attribute.\n\n * - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link.\n\n * - `external` (boolean) - Marks a menu item as external by adding an icon after the menu item text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n\n * - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon.\n\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n\n */\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n /**\n * Determines whether the button dropdown is disabled. Users cannot interact with the control if it's disabled.\n */\n disabled?: boolean;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents clicks.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button dropdown is in a loading state.\n */\n loadingText?: string;\n /** Determines the general styling of the button dropdown.\n * * `primary` for primary buttons\n * * `normal` for secondary buttons\n * * `icon` for icon buttons\n * * `inline-icon` for icon buttons with no outer padding\n */\n variant?: ButtonDropdownProps.Variant;\n /**\n * Controls expandability of the item groups.\n */\n expandableGroups?: boolean;\n /**\n * Adds `aria-label` to the button dropdown trigger.\n * Use this to provide an accessible name for buttons that don't have visible text.\n */\n ariaLabel?: string;\n /**\n * Text displayed in the button dropdown trigger.\n * @displayname text\n */\n children?: React.ReactNode;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * Called when the user clicks on an item with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the item has an `href` set.\n */\n onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * A standalone action that is shown prior to the dropdown trigger.\n * Use it with \"primary\" and \"normal\" variant only.\n *\n * Main action properties:\n * * `text` (string) - Specifies the text shown in the main action.\n * * `external` (boolean) - Marks the main action as external by adding an icon after the text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * * `externalIconAriaLabel` (string) - Adds an ARIA label to the external icon.\n *\n * The main action also supports the following properties of the [button](/components/button/?tabId=api) component:\n * `ariaLabel`, `disabled`, `loading`, `loadingText`, `href`, `target`, `rel`, `download`, `iconAlt`, `iconName`, `iconUrl`, `iconSvg`, `onClick`, `onFollow`.\n */\n mainAction?: ButtonDropdownProps.MainAction;\n}\n\nexport namespace ButtonDropdownProps {\n export type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';\n\n export interface MainAction {\n text: string;\n ariaLabel?: string;\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n href?: string;\n target?: string;\n rel?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface Item {\n id: string;\n text: string;\n lang?: string;\n disabled?: boolean;\n disabledReason?: string;\n description?: string;\n href?: string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface ItemGroup extends Omit<Item, 'id' | 'text'> {\n id?: string;\n text?: string;\n items: Items;\n }\n\n export type ItemOrGroup = Item | ItemGroup;\n\n export type Items = ReadonlyArray<ItemOrGroup>;\n\n export interface ItemClickDetails extends BaseNavigationDetail {\n id: string;\n }\n\n export interface Ref {\n /**\n * Focuses the underlying native button.\n */\n focus(): void;\n }\n}\n\nexport interface ButtonDropdownSettings {\n // this means whether action is required to make group expand\n hasExpandableGroups: boolean;\n // on smaller screens expandable groups are integrated into parent dropdown\n // this changes keyboard navigation, highlight and activation behavior for parent dropdown\n isInRestrictedView?: boolean;\n}\n\nexport interface HighlightProps {\n targetItem: ButtonDropdownProps.ItemOrGroup | null;\n isHighlighted: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isKeyboardHighlight: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isExpanded: (group: ButtonDropdownProps.ItemGroup) => boolean;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n}\n\nexport type GroupToggle = (item: ButtonDropdownProps.ItemGroup, event: React.SyntheticEvent) => void;\nexport type ItemActivate = (item: ButtonDropdownProps.Item, event: React.MouseEvent | React.KeyboardEvent) => void;\n\nexport interface CategoryProps extends HighlightProps {\n item: ButtonDropdownProps.ItemGroup;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n disabled: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: ItemListProps['variant'];\n}\n\nexport interface ItemListProps extends HighlightProps {\n items: ButtonDropdownProps.Items;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n categoryDisabled?: boolean;\n hasExpandableGroups?: boolean;\n hasCategoryHeader?: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: InternalButtonDropdownProps['variant'];\n}\n\nexport interface LinkItem extends ButtonDropdownProps.Item {\n href: string;\n}\n\nexport interface ItemProps {\n item: ButtonDropdownProps.Item | LinkItem;\n disabled: boolean;\n highlighted: boolean;\n onItemActivate: ItemActivate;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n first?: boolean;\n lastInSection: boolean;\n showDivider: boolean;\n hasCategoryHeader: boolean;\n isKeyboardHighlighted?: boolean;\n variant?: ItemListProps['variant'];\n}\n\nexport interface InternalItem extends ButtonDropdownProps.Item {\n badge?: boolean;\n}\n\nexport interface InternalItemGroup extends Omit<ButtonDropdownProps.ItemGroup, 'items'> {\n items: InternalItems;\n}\n\nexport type InternalItems = ReadonlyArray<InternalItemOrGroup>;\n\nexport type InternalItemOrGroup = InternalItem | InternalItemGroup;\n\nexport interface InternalButtonDropdownProps\n extends Omit<ButtonDropdownProps, 'variant' | 'items'>,\n InternalBaseComponentProps {\n customTriggerBuilder?: (props: CustomTriggerProps) => React.ReactNode;\n variant?: ButtonDropdownProps['variant'] | 'navigation';\n items: ReadonlyArray<InternalItemOrGroup>;\n\n /**\n * Optional text that is displayed as the title at the top of the dropdown.\n */\n title?: string;\n\n /**\n * Optional text that is displayed underneath the title at the top of the dropdown.\n */\n description?: string;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: boolean;\n}\n\nexport interface CustomTriggerProps {\n triggerRef: React.Ref<HTMLElement>;\n testUtilsClass: string;\n ariaLabel: string | undefined;\n disabled: boolean;\n isOpen: boolean;\n onClick: () => void;\n ariaExpanded: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-dropdown/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';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { BaseNavigationDetail, CancelableEventHandler } from '../internal/events';\nimport { IconProps } from '../icon/interfaces';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport { ButtonProps } from '../button/interfaces';\n\nexport interface ButtonDropdownProps extends BaseComponentProps, ExpandToViewport {\n /**\n * Array of objects, each having the following properties:\n\n * - `id` (string) - allows to identify the item that the user clicked on. Mandatory for individual items, optional for categories.\n\n * - `text` (string) - description shown in the menu for this item. Mandatory for individual items, optional for categories.\n\n * - `lang` (string) - (Optional) The language of the item, provided as a BCP 47 language tag.\n\n * - `disabled` (boolean) - whether the item is disabled. Disabled items are not clickable, but they can be highlighted with the keyboard to make them accessible.\n\n * - `disabledReason` (string) - (Optional) Displays text near the `text` property when item is disabled. Use to provide additional context.\n\n * - `items` (ReadonlyArray<Item>): an array of item objects. Items will be rendered as nested menu items but only for the first nesting level, multi-nesting is not supported.\n * An item which belongs to nested group has the following properties: `id`, `text`, `disabled` and `description`.\n\n * - `description` (string) - additional data that will be passed to a `data-description` attribute.\n\n * - `href` (string) - (Optional) Defines the target URL of the menu item, turning it into a link.\n\n * - `external` (boolean) - Marks a menu item as external by adding an icon after the menu item text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n\n * - `externalIconAriaLabel` (string) - Adds an `aria-label` to the external icon.\n\n * - `iconName` (string) - (Optional) Specifies the name of the icon, used with the [icon component](/components/icon/).\n\n * - `iconAlt` (string) - (Optional) Specifies alternate text for the icon when using `iconUrl`.\n\n * - `iconUrl` (string) - (Optional) Specifies the URL of a custom icon.\n\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n\n */\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n /**\n * Determines whether the button dropdown is disabled. Users cannot interact with the control if it's disabled.\n */\n disabled?: boolean;\n /**\n * Renders the button as being in a loading state. It takes precedence over the `disabled` if both are set to `true`.\n * It prevents clicks.\n */\n loading?: boolean;\n /**\n * Specifies the text that screen reader announces when the button dropdown is in a loading state.\n */\n loadingText?: string;\n /** Determines the general styling of the button dropdown.\n * * `primary` for primary buttons\n * * `normal` for secondary buttons\n * * `icon` for icon buttons\n * * `inline-icon` for icon buttons with no outer padding\n */\n variant?: ButtonDropdownProps.Variant;\n /**\n * Controls expandability of the item groups.\n */\n expandableGroups?: boolean;\n /**\n * Adds `aria-label` to the button dropdown trigger.\n * Use this to provide an accessible name for buttons that don't have visible text.\n */\n ariaLabel?: string;\n /**\n * Text displayed in the button dropdown trigger.\n * @displayname text\n */\n children?: React.ReactNode;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * Called when the user clicks on an item with the left mouse button without pressing\n * modifier keys (that is, CTRL, ALT, SHIFT, META), and the item has an `href` set.\n */\n onItemFollow?: CancelableEventHandler<ButtonDropdownProps.ItemClickDetails>;\n /**\n * A standalone action that is shown prior to the dropdown trigger.\n * Use it with \"primary\" and \"normal\" variant only.\n *\n * Main action properties:\n * * `text` (string) - Specifies the text shown in the main action.\n * * `external` (boolean) - Marks the main action as external by adding an icon after the text. The link will open in a new tab when clicked. Note that this only works when `href` is also provided.\n * * `externalIconAriaLabel` (string) - Adds an ARIA label to the external icon.\n *\n * The main action also supports the following properties of the [button](/components/button/?tabId=api) component:\n * `ariaLabel`, `disabled`, `loading`, `loadingText`, `href`, `target`, `rel`, `download`, `iconAlt`, `iconName`, `iconUrl`, `iconSvg`, `onClick`, `onFollow`.\n */\n mainAction?: ButtonDropdownProps.MainAction;\n}\n\nexport namespace ButtonDropdownProps {\n export type Variant = 'normal' | 'primary' | 'icon' | 'inline-icon';\n\n export interface MainAction {\n text: string;\n ariaLabel?: string;\n onClick?: CancelableEventHandler<ButtonProps.ClickDetail>;\n onFollow?: CancelableEventHandler<ButtonProps.FollowDetail>;\n disabled?: boolean;\n loading?: boolean;\n loadingText?: string;\n href?: string;\n target?: string;\n rel?: string;\n download?: boolean | string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface Item {\n id: string;\n text: string;\n lang?: string;\n disabled?: boolean;\n disabledReason?: string;\n description?: string;\n href?: string;\n external?: boolean;\n externalIconAriaLabel?: string;\n iconAlt?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n }\n\n export interface ItemGroup extends Omit<Item, 'id' | 'text'> {\n id?: string;\n text?: string;\n items: Items;\n }\n\n export type ItemOrGroup = Item | ItemGroup;\n\n export type Items = ReadonlyArray<ItemOrGroup>;\n\n export interface ItemClickDetails extends BaseNavigationDetail {\n id: string;\n }\n\n export interface Ref {\n /**\n * Focuses the underlying native button.\n */\n focus(): void;\n }\n}\n\nexport interface ButtonDropdownSettings {\n // this means whether action is required to make group expand\n hasExpandableGroups: boolean;\n // on smaller screens expandable groups are integrated into parent dropdown\n // this changes keyboard navigation, highlight and activation behavior for parent dropdown\n isInRestrictedView?: boolean;\n}\n\nexport interface HighlightProps {\n targetItem: ButtonDropdownProps.ItemOrGroup | null;\n isHighlighted: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isKeyboardHighlight: (item: ButtonDropdownProps.ItemOrGroup) => boolean;\n isExpanded: (group: ButtonDropdownProps.ItemGroup) => boolean;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n}\n\nexport type GroupToggle = (item: ButtonDropdownProps.ItemGroup, event: React.SyntheticEvent) => void;\nexport type ItemActivate = (item: ButtonDropdownProps.Item, event: React.MouseEvent | React.KeyboardEvent) => void;\n\nexport interface CategoryProps extends HighlightProps {\n item: ButtonDropdownProps.ItemGroup;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n disabled: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: ItemListProps['variant'];\n}\n\nexport interface ItemListProps extends HighlightProps {\n items: ButtonDropdownProps.Items;\n onGroupToggle: GroupToggle;\n onItemActivate: ItemActivate;\n categoryDisabled?: boolean;\n hasExpandableGroups?: boolean;\n hasCategoryHeader?: boolean;\n lastInDropdown: boolean;\n expandToViewport?: boolean;\n variant?: InternalButtonDropdownProps['variant'];\n}\n\nexport interface LinkItem extends ButtonDropdownProps.Item {\n href: string;\n}\n\nexport interface ItemProps {\n item: ButtonDropdownProps.Item | LinkItem;\n disabled: boolean;\n highlighted: boolean;\n onItemActivate: ItemActivate;\n highlightItem: (item: ButtonDropdownProps.ItemOrGroup) => void;\n showDivider: boolean;\n hasCategoryHeader: boolean;\n isKeyboardHighlighted?: boolean;\n variant?: ItemListProps['variant'];\n}\n\nexport interface InternalItem extends ButtonDropdownProps.Item {\n badge?: boolean;\n}\n\nexport interface InternalItemGroup extends Omit<ButtonDropdownProps.ItemGroup, 'items'> {\n items: InternalItems;\n}\n\nexport type InternalItems = ReadonlyArray<InternalItemOrGroup>;\n\nexport type InternalItemOrGroup = InternalItem | InternalItemGroup;\n\nexport interface InternalButtonDropdownProps\n extends Omit<ButtonDropdownProps, 'variant' | 'items'>,\n InternalBaseComponentProps {\n customTriggerBuilder?: (props: CustomTriggerProps) => React.ReactNode;\n variant?: ButtonDropdownProps['variant'] | 'navigation';\n items: ReadonlyArray<InternalItemOrGroup>;\n\n /**\n * Optional text that is displayed as the title at the top of the dropdown.\n */\n title?: string;\n\n /**\n * Optional text that is displayed underneath the title at the top of the dropdown.\n */\n description?: string;\n\n /**\n * Determines that the dropdown should preferably be aligned to the center of the trigger\n * instead of dropping left or right.\n */\n preferCenter?: boolean;\n}\n\nexport interface CustomTriggerProps {\n triggerRef: React.Ref<HTMLElement>;\n testUtilsClass: string;\n ariaLabel: string | undefined;\n disabled: boolean;\n isOpen: boolean;\n onClick: () => void;\n ariaExpanded: boolean;\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ItemProps } from '../interfaces';
|
|
3
3
|
import { ButtonDropdownProps } from '../interfaces';
|
|
4
|
-
declare const ItemElement: ({ item, disabled, onItemActivate, highlighted, highlightItem,
|
|
4
|
+
declare const ItemElement: ({ item, disabled, onItemActivate, highlighted, highlightItem, showDivider, hasCategoryHeader, isKeyboardHighlighted, variant, }: ItemProps) => JSX.Element;
|
|
5
5
|
export type InternalItemProps = ButtonDropdownProps.Item & {
|
|
6
6
|
badge?: boolean;
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/button-dropdown/item-element/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAK1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAOpD,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/button-dropdown/item-element/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAK1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAOpD,QAAA,MAAM,WAAW,oIAUd,SAAS,gBAqCX,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,IAAI,GAAG;IACzD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AA4FF,eAAe,WAAW,CAAC"}
|
|
@@ -10,7 +10,7 @@ import useHiddenDescription from '../utils/use-hidden-description';
|
|
|
10
10
|
import InternalIcon from '../../icon/internal';
|
|
11
11
|
import { useDropdownContext } from '../../internal/components/dropdown/context';
|
|
12
12
|
import { getMenuItemProps } from '../utils/menu-item';
|
|
13
|
-
const ItemElement = ({ item, disabled, onItemActivate, highlighted, highlightItem,
|
|
13
|
+
const ItemElement = ({ item, disabled, onItemActivate, highlighted, highlightItem, showDivider, hasCategoryHeader, isKeyboardHighlighted = false, variant = 'normal', }) => {
|
|
14
14
|
const isLink = isLinkItem(item);
|
|
15
15
|
const onClick = (event) => {
|
|
16
16
|
// Stop propagation to parent node and handle event exclusively in here. This ensures
|
|
@@ -29,8 +29,6 @@ const ItemElement = ({ item, disabled, onItemActivate, highlighted, highlightIte
|
|
|
29
29
|
return (React.createElement("li", { className: clsx(styles['item-element'], styles[`variant-${variant}`], {
|
|
30
30
|
[styles.highlighted]: highlighted,
|
|
31
31
|
[styles.disabled]: disabled,
|
|
32
|
-
[styles.first]: first,
|
|
33
|
-
[styles.last]: lastInSection,
|
|
34
32
|
[styles['has-category-header']]: hasCategoryHeader,
|
|
35
33
|
[styles['show-divider']]: showDivider,
|
|
36
34
|
[styles['is-focused']]: isKeyboardHighlighted,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/button-dropdown/item-element/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,OAAO,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,oBAAoB,MAAM,iCAAiC,CAAC;AACnE,OAAO,YAAmC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,WAAW,GAAG,CAAC,EACnB,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/button-dropdown/item-element/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,OAAO,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,oBAAoB,MAAM,iCAAiC,CAAC;AACnE,OAAO,YAAmC,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,WAAW,GAAG,CAAC,EACnB,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,qBAAqB,GAAG,KAAK,EAC7B,OAAO,GAAG,QAAQ,GACR,EAAE,EAAE;IACd,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,CAAC,KAAuB,EAAE,EAAE;QAC1C,qFAAqF;QACrF,kEAAkE;QAClE,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,IAAI,CAAC,MAAM,EAAE;YACX,KAAK,CAAC,cAAc,EAAE,CAAC;SACxB;QACD,IAAI,CAAC,QAAQ,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L,8BAAM,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,gBAAc,SAAS,IACjG,IAAI,CACA,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport clsx from 'clsx';\nimport { ItemProps } from '../interfaces';\nimport { isLinkItem } from '../utils/utils';\nimport styles from './styles.css.js';\nimport Tooltip from '../tooltip';\n\nimport { ButtonDropdownProps } from '../interfaces';\nimport { getItemTarget } from '../utils/utils';\nimport useHiddenDescription from '../utils/use-hidden-description';\nimport InternalIcon, { InternalIconProps } from '../../icon/internal';\nimport { useDropdownContext } from '../../internal/components/dropdown/context';\nimport { getMenuItemProps } from '../utils/menu-item';\n\nconst ItemElement = ({\n item,\n disabled,\n onItemActivate,\n highlighted,\n highlightItem,\n showDivider,\n hasCategoryHeader,\n isKeyboardHighlighted = false,\n variant = 'normal',\n}: ItemProps) => {\n const isLink = isLinkItem(item);\n const onClick = (event: React.MouseEvent) => {\n // Stop propagation to parent node and handle event exclusively in here. This ensures\n // that no group will interfere with the default behavior of links\n event.stopPropagation();\n if (!isLink) {\n event.preventDefault();\n }\n if (!disabled) {\n onItemActivate(item, event);\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n return (\n <li\n className={clsx(styles['item-element'], styles[`variant-${variant}`], {\n [styles.highlighted]: highlighted,\n [styles.disabled]: disabled,\n [styles['has-category-header']]: hasCategoryHeader,\n [styles['show-divider']]: showDivider,\n [styles['is-focused']]: isKeyboardHighlighted,\n })}\n role=\"presentation\"\n data-testid={item.id}\n data-description={item.description}\n onClick={onClick}\n onMouseEnter={onHover}\n onTouchStart={onHover}\n >\n <MenuItem item={item} disabled={disabled} highlighted={highlighted} />\n </li>\n );\n};\n\nexport type InternalItemProps = ButtonDropdownProps.Item & {\n badge?: boolean;\n};\n\ninterface MenuItemProps {\n item: InternalItemProps;\n disabled: boolean;\n highlighted: boolean;\n}\n\nfunction MenuItem({ item, disabled, highlighted }: MenuItemProps) {\n const menuItemRef = useRef<(HTMLSpanElement & HTMLAnchorElement) | null>(null);\n\n useEffect(() => {\n if (highlighted && menuItemRef.current) {\n menuItemRef.current.focus();\n }\n }, [highlighted]);\n\n const isDisabledWithReason = disabled && item.disabledReason;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n const menuItemProps: React.HTMLAttributes<HTMLSpanElement & HTMLAnchorElement> = {\n className: styles['menu-item'],\n lang: item.lang,\n ref: menuItemRef,\n // We are using the roving tabindex technique to manage the focus state of the dropdown.\n // The current element will always have tabindex=0 which means that it can be tabbed to,\n // while all other items have tabindex=-1 so we can focus them when necessary.\n tabIndex: highlighted ? 0 : -1,\n ...getMenuItemProps({ disabled }),\n ...(isDisabledWithReason ? targetProps : {}),\n };\n\n const menuItem = isLinkItem(item) ? (\n <a\n {...menuItemProps}\n href={!disabled ? item.href : undefined}\n target={getItemTarget(item)}\n rel={item.external ? 'noopener noreferrer' : undefined}\n >\n <MenuItemContent item={item} disabled={disabled} />\n </a>\n ) : (\n <span {...menuItemProps}>\n <MenuItemContent item={item} disabled={disabled} />\n </span>\n );\n\n const { position } = useDropdownContext();\n const tooltipPosition = position === 'bottom-left' || position === 'top-left' ? 'left' : 'right';\n return isDisabledWithReason ? (\n <Tooltip content={item.disabledReason} position={tooltipPosition}>\n {menuItem}\n {descriptionEl}\n </Tooltip>\n ) : (\n menuItem\n );\n}\n\nconst MenuItemContent = ({ item, disabled }: { item: InternalItemProps; disabled: boolean }) => {\n const hasIcon = !!(item.iconName || item.iconUrl || item.iconSvg);\n const hasExternal = isLinkItem(item) && item.external;\n return (\n <>\n {hasIcon && (\n <MenuItemIcon\n name={item.iconName}\n url={item.iconUrl}\n svg={item.iconSvg}\n alt={item.iconAlt}\n badge={item.badge}\n />\n )}{' '}\n {item.text} {hasExternal && <ExternalIcon disabled={disabled} ariaLabel={item.externalIconAriaLabel} />}\n </>\n );\n};\n\nconst MenuItemIcon = (props: InternalIconProps) => (\n <span className={styles.icon}>\n <InternalIcon {...props} />\n </span>\n);\n\nconst ExternalIcon = ({ disabled, ariaLabel }: { disabled: boolean; ariaLabel?: string }) => {\n const icon = <InternalIcon variant={disabled ? 'disabled' : 'normal'} name=\"external\" />;\n return (\n <span className={styles['external-icon']} role={ariaLabel ? 'img' : undefined} aria-label={ariaLabel}>\n {icon}\n </span>\n );\n};\n\nexport default ItemElement;\n"]}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"item-element": "awsui_item-
|
|
5
|
-
"disabled": "
|
|
6
|
-
"show-divider": "awsui_show-
|
|
7
|
-
"highlighted": "
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"variant-navigation": "awsui_variant-navigation_93a1u_1rwbp_142",
|
|
14
|
-
"first": "awsui_first_93a1u_1rwbp_145",
|
|
15
|
-
"has-category-header": "awsui_has-category-header_93a1u_1rwbp_145",
|
|
16
|
-
"last": "awsui_last_93a1u_1rwbp_148",
|
|
17
|
-
"menu-item": "awsui_menu-item_93a1u_1rwbp_158",
|
|
18
|
-
"icon": "awsui_icon_93a1u_1rwbp_176",
|
|
19
|
-
"external-icon": "awsui_external-icon_93a1u_1rwbp_181"
|
|
4
|
+
"item-element": "awsui_item-element_93a1u_9wgu0_99",
|
|
5
|
+
"disabled": "awsui_disabled_93a1u_9wgu0_111",
|
|
6
|
+
"show-divider": "awsui_show-divider_93a1u_9wgu0_118",
|
|
7
|
+
"highlighted": "awsui_highlighted_93a1u_9wgu0_121",
|
|
8
|
+
"is-focused": "awsui_is-focused_93a1u_9wgu0_136",
|
|
9
|
+
"menu-item": "awsui_menu-item_93a1u_9wgu0_141",
|
|
10
|
+
"has-category-header": "awsui_has-category-header_93a1u_9wgu0_155",
|
|
11
|
+
"icon": "awsui_icon_93a1u_9wgu0_159",
|
|
12
|
+
"external-icon": "awsui_external-icon_93a1u_9wgu0_164"
|
|
20
13
|
};
|
|
21
14
|
|
|
@@ -96,7 +96,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
96
96
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
97
97
|
SPDX-License-Identifier: Apache-2.0
|
|
98
98
|
*/
|
|
99
|
-
.awsui_item-
|
|
99
|
+
.awsui_item-element_93a1u_9wgu0_99:not(#\9) {
|
|
100
100
|
position: relative;
|
|
101
101
|
z-index: 1;
|
|
102
102
|
border-block: var(--border-item-width-0zxiwv, 1px) solid transparent;
|
|
@@ -108,21 +108,19 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
108
108
|
margin-block-start: calc(-1 * var(--border-field-width-yoy972, 1px));
|
|
109
109
|
cursor: pointer;
|
|
110
110
|
}
|
|
111
|
-
.awsui_item-
|
|
111
|
+
.awsui_item-element_93a1u_9wgu0_99.awsui_disabled_93a1u_9wgu0_111:not(#\9) {
|
|
112
112
|
cursor: default;
|
|
113
113
|
color: var(--color-text-dropdown-item-disabled-nf1b1j, #aab7b8);
|
|
114
114
|
}
|
|
115
|
-
.awsui_item-
|
|
115
|
+
.awsui_item-element_93a1u_9wgu0_99:not(#\9):first-child {
|
|
116
116
|
margin-block-start: 0;
|
|
117
117
|
}
|
|
118
|
-
.awsui_item-
|
|
118
|
+
.awsui_item-element_93a1u_9wgu0_99.awsui_show-divider_93a1u_9wgu0_118:not(#\9) {
|
|
119
119
|
border-block-end: var(--border-item-width-0zxiwv, 1px) solid var(--color-border-dropdown-group-mkqzrv, #eaeded);
|
|
120
120
|
}
|
|
121
|
-
.awsui_item-
|
|
121
|
+
.awsui_item-element_93a1u_9wgu0_99.awsui_highlighted_93a1u_9wgu0_121:not(#\9) {
|
|
122
122
|
color: var(--color-text-dropdown-item-highlighted-ek38zi, #16191f);
|
|
123
123
|
z-index: 2;
|
|
124
|
-
}
|
|
125
|
-
.awsui_item-element_93a1u_1rwbp_99.awsui_highlighted_93a1u_1rwbp_121.awsui_variant-icon_93a1u_1rwbp_125:not(#\9), .awsui_item-element_93a1u_1rwbp_99.awsui_highlighted_93a1u_1rwbp_121.awsui_variant-inline-icon_93a1u_1rwbp_125:not(#\9), .awsui_item-element_93a1u_1rwbp_99.awsui_highlighted_93a1u_1rwbp_121.awsui_variant-normal_93a1u_1rwbp_125:not(#\9), .awsui_item-element_93a1u_1rwbp_99.awsui_highlighted_93a1u_1rwbp_121.awsui_variant-primary_93a1u_1rwbp_125:not(#\9) {
|
|
126
124
|
background-color: var(--color-background-dropdown-item-hover-i8ac7r, #f2f3f3);
|
|
127
125
|
border-color: var(--color-border-dropdown-item-hover-gqjku2, #879596);
|
|
128
126
|
border-start-start-radius: var(--border-radius-item-jsz3j8, 0px);
|
|
@@ -130,32 +128,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
130
128
|
border-end-start-radius: var(--border-radius-item-jsz3j8, 0px);
|
|
131
129
|
border-end-end-radius: var(--border-radius-item-jsz3j8, 0px);
|
|
132
130
|
}
|
|
133
|
-
.awsui_item-
|
|
131
|
+
.awsui_item-element_93a1u_9wgu0_99.awsui_highlighted_93a1u_9wgu0_121.awsui_disabled_93a1u_9wgu0_111:not(#\9) {
|
|
134
132
|
color: var(--color-text-dropdown-item-dimmed-oru6hf, #aab7b8);
|
|
135
133
|
border-color: var(--color-border-dropdown-item-dimmed-hover-ydzhss, #879596);
|
|
136
134
|
background-color: var(--color-background-dropdown-item-dimmed-e83q5u, transparent);
|
|
137
135
|
}
|
|
138
|
-
.awsui_item-
|
|
136
|
+
.awsui_item-element_93a1u_9wgu0_99.awsui_highlighted_93a1u_9wgu0_121.awsui_is-focused_93a1u_9wgu0_136:not(#\9) {
|
|
139
137
|
border-color: var(--color-border-dropdown-item-focused-3o10kx, #0073bb);
|
|
140
138
|
box-shadow: inset 0 0 0 var(--border-control-focus-ring-shadow-spread-0k725q, 1px) var(--color-border-item-focused-v8nq2m, #0073bb);
|
|
141
139
|
}
|
|
142
|
-
.awsui_item-element_93a1u_1rwbp_99.awsui_variant-navigation_93a1u_1rwbp_142.awsui_highlighted_93a1u_1rwbp_121:not(#\9) {
|
|
143
|
-
color: var(--color-text-accent-yy9054, #0073bb);
|
|
144
|
-
}
|
|
145
|
-
.awsui_item-element_93a1u_1rwbp_99.awsui_variant-navigation_93a1u_1rwbp_142.awsui_first_93a1u_1rwbp_145:not(#\9):not(.awsui_has-category-header_93a1u_1rwbp_145) {
|
|
146
|
-
padding-block-start: var(--space-xxs-9rrxti, 4px);
|
|
147
|
-
}
|
|
148
|
-
.awsui_item-element_93a1u_1rwbp_99.awsui_variant-navigation_93a1u_1rwbp_142.awsui_last_93a1u_1rwbp_148:not(#\9) {
|
|
149
|
-
padding-block-end: var(--space-xxs-9rrxti, 4px);
|
|
150
|
-
}
|
|
151
|
-
.awsui_item-element_93a1u_1rwbp_99.awsui_variant-navigation_93a1u_1rwbp_142.awsui_first_93a1u_1rwbp_145.awsui_last_93a1u_1rwbp_148:not(#\9) {
|
|
152
|
-
padding-block: var(--space-xxs-9rrxti, 4px);
|
|
153
|
-
}
|
|
154
|
-
.awsui_item-element_93a1u_1rwbp_99.awsui_variant-navigation_93a1u_1rwbp_142.awsui_last_93a1u_1rwbp_148:not(#\9):last-child {
|
|
155
|
-
padding-block-end: var(--space-xxs-9rrxti, 4px);
|
|
156
|
-
}
|
|
157
140
|
|
|
158
|
-
.awsui_menu-
|
|
141
|
+
.awsui_menu-item_93a1u_9wgu0_141:not(#\9) {
|
|
159
142
|
min-inline-size: 0;
|
|
160
143
|
word-break: break-word;
|
|
161
144
|
display: flex;
|
|
@@ -166,18 +149,18 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
166
149
|
text-decoration: none;
|
|
167
150
|
/* stylelint-disable-next-line selector-max-type */
|
|
168
151
|
}
|
|
169
|
-
.awsui_menu-
|
|
152
|
+
.awsui_menu-item_93a1u_9wgu0_141:not(#\9):focus {
|
|
170
153
|
outline: none;
|
|
171
154
|
}
|
|
172
|
-
.awsui_has-category-
|
|
155
|
+
.awsui_has-category-header_93a1u_9wgu0_155 > .awsui_menu-item_93a1u_9wgu0_141:not(#\9), .awsui_has-category-header_93a1u_9wgu0_155 > span > .awsui_menu-item_93a1u_9wgu0_141:not(#\9) {
|
|
173
156
|
padding-inline-start: calc(var(--space-s-2025hl, 12px) + var(--space-button-horizontal-lcftji, 20px));
|
|
174
157
|
}
|
|
175
158
|
|
|
176
|
-
.
|
|
159
|
+
.awsui_icon_93a1u_9wgu0_159:not(#\9) {
|
|
177
160
|
padding-inline-end: var(--space-xs-xf5ch3, 8px);
|
|
178
161
|
flex-shrink: 0;
|
|
179
162
|
}
|
|
180
163
|
|
|
181
|
-
.awsui_external-
|
|
164
|
+
.awsui_external-icon_93a1u_9wgu0_164:not(#\9) {
|
|
182
165
|
margin-inline-start: var(--space-xxs-9rrxti, 4px);
|
|
183
166
|
}
|
|
@@ -2,21 +2,14 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"item-element": "awsui_item-
|
|
6
|
-
"disabled": "
|
|
7
|
-
"show-divider": "awsui_show-
|
|
8
|
-
"highlighted": "
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"variant-navigation": "awsui_variant-navigation_93a1u_1rwbp_142",
|
|
15
|
-
"first": "awsui_first_93a1u_1rwbp_145",
|
|
16
|
-
"has-category-header": "awsui_has-category-header_93a1u_1rwbp_145",
|
|
17
|
-
"last": "awsui_last_93a1u_1rwbp_148",
|
|
18
|
-
"menu-item": "awsui_menu-item_93a1u_1rwbp_158",
|
|
19
|
-
"icon": "awsui_icon_93a1u_1rwbp_176",
|
|
20
|
-
"external-icon": "awsui_external-icon_93a1u_1rwbp_181"
|
|
5
|
+
"item-element": "awsui_item-element_93a1u_9wgu0_99",
|
|
6
|
+
"disabled": "awsui_disabled_93a1u_9wgu0_111",
|
|
7
|
+
"show-divider": "awsui_show-divider_93a1u_9wgu0_118",
|
|
8
|
+
"highlighted": "awsui_highlighted_93a1u_9wgu0_121",
|
|
9
|
+
"is-focused": "awsui_is-focused_93a1u_9wgu0_136",
|
|
10
|
+
"menu-item": "awsui_menu-item_93a1u_9wgu0_141",
|
|
11
|
+
"has-category-header": "awsui_has-category-header_93a1u_9wgu0_155",
|
|
12
|
+
"icon": "awsui_icon_93a1u_9wgu0_159",
|
|
13
|
+
"external-icon": "awsui_external-icon_93a1u_9wgu0_164"
|
|
21
14
|
};
|
|
22
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items-list.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/items-list.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQ7C,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,KAAK,EACL,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,aAAa,EACb,gBAAwB,EACxB,mBAA2B,EAC3B,iBAAyB,EACzB,gBAAwB,EACxB,OAAkB,GACnB,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"items-list.d.ts","sourceRoot":"","sources":["../../../src/button-dropdown/items-list.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQ7C,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,KAAK,EACL,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,aAAa,EACb,gBAAwB,EACxB,mBAA2B,EAC3B,iBAAyB,EACzB,gBAAwB,EACxB,OAAkB,GACnB,EAAE,aAAa,eA6Ef"}
|
|
@@ -12,9 +12,8 @@ export default function ItemsList({ items, onItemActivate, onGroupToggle, target
|
|
|
12
12
|
const elements = items.map((item, index) => {
|
|
13
13
|
var _a, _b, _c, _d;
|
|
14
14
|
if (!isItemGroup(item)) {
|
|
15
|
-
const lastInSection = index === items.length - 1 || isItemGroup(items[index + 1]);
|
|
16
15
|
const showDivider = (index === items.length - 1 && !lastInDropdown) || isItemGroup(items[index + 1]);
|
|
17
|
-
return (React.createElement(ItemElement, { key: index, item: item, onItemActivate: onItemActivate, disabled: (_a = item.disabled) !== null && _a !== void 0 ? _a : categoryDisabled, highlighted: isHighlighted(item), isKeyboardHighlighted: isKeyboardHighlight(item), highlightItem: highlightItem,
|
|
16
|
+
return (React.createElement(ItemElement, { key: index, item: item, onItemActivate: onItemActivate, disabled: (_a = item.disabled) !== null && _a !== void 0 ? _a : categoryDisabled, highlighted: isHighlighted(item), isKeyboardHighlighted: isKeyboardHighlight(item), highlightItem: highlightItem, showDivider: showDivider, hasCategoryHeader: hasCategoryHeader, variant: variant }));
|
|
18
17
|
}
|
|
19
18
|
if (hasExpandableGroups) {
|
|
20
19
|
return item.text ? (isMobile ? (React.createElement(MobileExpandableCategoryElement, { key: index, item: item, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, lastInDropdown: lastInDropdown && index === items.length - 1, highlightItem: highlightItem, disabled: (_b = item.disabled) !== null && _b !== void 0 ? _b : false, variant: variant })) : (React.createElement(ExpandableCategoryElement, { key: index, item: item, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, lastInDropdown: true, highlightItem: highlightItem, disabled: (_c = item.disabled) !== null && _c !== void 0 ? _c : false, expandToViewport: expandToViewport, variant: variant }))) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items-list.js","sourceRoot":"","sources":["../../../src/button-dropdown/items-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,yBAAyB,MAAM,iDAAiD,CAAC;AACxF,OAAO,eAAe,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,+BAA+B,MAAM,wDAAwD,CAAC;AAErG,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,KAAK,EACL,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,aAAa,EACb,gBAAgB,GAAG,KAAK,EACxB,mBAAmB,GAAG,KAAK,EAC3B,iBAAiB,GAAG,KAAK,EACzB,gBAAgB,GAAG,KAAK,EACxB,OAAO,GAAG,QAAQ,GACJ;IACd,MAAM,QAAQ,GAAG,SAAS,EAAE,CAAC;IAE7B,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;;QACzC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;YACtB,MAAM,
|
|
1
|
+
{"version":3,"file":"items-list.js","sourceRoot":"","sources":["../../../src/button-dropdown/items-list.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,WAAW,MAAM,gBAAgB,C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,MAAM,GAAG,CAAC,EAC5D,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,MAAA,IAAI,CAAC,QAAQ,mCAAI,KAAK,EAChC,OAAO,EAAE,OAAO,GAChB,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,0CAAG,QAAQ,CAAI,CAAC;AACzB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { ItemListProps } from './interfaces';\nimport ItemElement from './item-element';\nimport ExpandableCategoryElement from './category-elements/expandable-category-element';\nimport CategoryElement from './category-elements/category-element';\nimport { isItemGroup } from './utils/utils';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport MobileExpandableCategoryElement from './category-elements/mobile-expandable-category-element';\n\nexport default function ItemsList({\n items,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n lastInDropdown,\n highlightItem,\n categoryDisabled = false,\n hasExpandableGroups = false,\n hasCategoryHeader = false,\n expandToViewport = false,\n variant = 'normal',\n}: ItemListProps) {\n const isMobile = useMobile();\n\n const elements = items.map((item, index) => {\n if (!isItemGroup(item)) {\n const showDivider = (index === items.length - 1 && !lastInDropdown) || isItemGroup(items[index + 1]);\n\n return (\n <ItemElement\n key={index}\n item={item}\n onItemActivate={onItemActivate}\n disabled={item.disabled ?? categoryDisabled}\n highlighted={isHighlighted(item)}\n isKeyboardHighlighted={isKeyboardHighlight(item)}\n highlightItem={highlightItem}\n showDivider={showDivider}\n hasCategoryHeader={hasCategoryHeader}\n variant={variant}\n />\n );\n }\n if (hasExpandableGroups) {\n return item.text ? (\n isMobile ? (\n <MobileExpandableCategoryElement\n key={index}\n item={item}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n lastInDropdown={lastInDropdown && index === items.length - 1}\n highlightItem={highlightItem}\n disabled={item.disabled ?? false}\n variant={variant}\n />\n ) : (\n <ExpandableCategoryElement\n key={index}\n item={item}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n lastInDropdown={true}\n highlightItem={highlightItem}\n disabled={item.disabled ?? false}\n expandToViewport={expandToViewport}\n variant={variant}\n />\n )\n ) : null;\n }\n return (\n <CategoryElement\n key={index}\n item={item}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n lastInDropdown={lastInDropdown && index === items.length - 1}\n highlightItem={highlightItem}\n disabled={item.disabled ?? false}\n variant={variant}\n />\n );\n });\n\n return <>{elements}</>;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TokenListProps } from './interfaces';
|
|
3
|
-
export default function TokenList<Item>({ items, alignment, renderItem, limit, after, i18nStrings, moveFocusNextToIndex, onExpandedClick, }: TokenListProps<Item>): JSX.Element;
|
|
3
|
+
export default function TokenList<Item>({ items, alignment, renderItem, limit, after, i18nStrings, limitShowFewerAriaLabel, limitShowMoreAriaLabel, moveFocusNextToIndex, onExpandedClick, }: TokenListProps<Item>): JSX.Element;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAK9C,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,IAAI,EAAE,EACtC,KAAK,EACL,SAAS,EACT,UAAU,EACV,KAAK,EACL,KAAK,EACL,WAAW,EACX,oBAAoB,EACpB,eAAiC,GAClC,EAAE,cAAc,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAK9C,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,IAAI,EAAE,EACtC,KAAK,EACL,SAAS,EACT,UAAU,EACV,KAAK,EACL,KAAK,EACL,WAAW,EACX,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,eAAiC,GAClC,EAAE,cAAc,CAAC,IAAI,CAAC,eAyEtB"}
|
|
@@ -6,7 +6,7 @@ import styles from './styles.css.js';
|
|
|
6
6
|
import { useUniqueId } from '../../hooks/use-unique-id';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import { useTokenFocusController } from './token-focus-controller';
|
|
9
|
-
export default function TokenList({ items, alignment, renderItem, limit, after, i18nStrings, moveFocusNextToIndex, onExpandedClick = () => undefined, }) {
|
|
9
|
+
export default function TokenList({ items, alignment, renderItem, limit, after, i18nStrings, limitShowFewerAriaLabel, limitShowMoreAriaLabel, moveFocusNextToIndex, onExpandedClick = () => undefined, }) {
|
|
10
10
|
const tokenListRef = useTokenFocusController({ moveFocusNextToIndex: moveFocusNextToIndex });
|
|
11
11
|
const controlId = useUniqueId();
|
|
12
12
|
const [expanded, setExpanded] = useState(false);
|
|
@@ -15,7 +15,7 @@ export default function TokenList({ items, alignment, renderItem, limit, after,
|
|
|
15
15
|
const visibleItems = hasHiddenItems && !expanded ? items.slice(0, limit) : items;
|
|
16
16
|
const hasVisibleItems = visibleItems.length > 0;
|
|
17
17
|
const toggle = hasHiddenItems ? (React.createElement("div", { className: styles[`toggle-container-${alignment}`] },
|
|
18
|
-
React.createElement(TokenLimitToggle, { controlId: hasVisibleItems ? controlId : undefined, allHidden: limit === 0, expanded: expanded, numberOfHiddenOptions: items.length - visibleItems.length, i18nStrings: i18nStrings, onClick: () => {
|
|
18
|
+
React.createElement(TokenLimitToggle, { controlId: hasVisibleItems ? controlId : undefined, allHidden: limit === 0, expanded: expanded, numberOfHiddenOptions: items.length - visibleItems.length, i18nStrings: i18nStrings, limitShowFewerAriaLabel: limitShowFewerAriaLabel, limitShowMoreAriaLabel: limitShowMoreAriaLabel, onClick: () => {
|
|
19
19
|
const isExpanded = !expanded;
|
|
20
20
|
setExpanded(isExpanded);
|
|
21
21
|
onExpandedClick(isExpanded);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,CAAC,OAAO,UAAU,SAAS,CAAO,EACtC,KAAK,EACL,SAAS,EACT,UAAU,EACV,KAAK,EACL,KAAK,EACL,WAAW,EACX,oBAAoB,EACpB,eAAe,GAAG,GAAG,EAAE,CAAC,SAAS,GACZ;IACrB,MAAM,YAAY,GAAG,uBAAuB,CAAC,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAC7F,MAAM,SAAS,GAAG,WAAW,EAAE,CAAC;IAEhC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;IAClC,MAAM,cAAc,GAAG,QAAQ,IAAI,KAAK,KAA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,mBACX,SAAS,GAAG,CAAC,IAE3B,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CACzB,CACN,CAAC,CACC,CACN;YACA,MAAM;YACN,KAAK,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,SAAS,GAAI;YAC7C,KAAK,CACF,CACP,CAAC;KACH;IAED,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC;QAClE,eAAe,IAAI,CAClB,4BAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,IAC/D,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CACrC,4BACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,kBAChB,KAAK,CAAC,MAAM,mBACX,SAAS,GAAG,CAAC,IAE3B,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CACzB,CACN,CAAC,CACC,CACN;QACA,MAAM;QACN,KAAK,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useState } from 'react';\n\nimport TokenLimitToggle from './token-limit-toggle';\nimport styles from './styles.css.js';\nimport { TokenListProps } from './interfaces';\nimport { useUniqueId } from '../../hooks/use-unique-id';\nimport clsx from 'clsx';\nimport { useTokenFocusController } from './token-focus-controller';\n\nexport default function TokenList<Item>({\n items,\n alignment,\n renderItem,\n limit,\n after,\n i18nStrings,\n moveFocusNextToIndex,\n onExpandedClick = () => undefined,\n}: TokenListProps<Item>) {\n const tokenListRef = useTokenFocusController({ moveFocusNextToIndex: moveFocusNextToIndex });\n const controlId = useUniqueId();\n\n const [expanded, setExpanded] = useState(false);\n const hasItems = items.length > 0;\n const hasHiddenItems = hasItems && limit !== undefined && items.length > limit;\n const visibleItems = hasHiddenItems && !expanded ? items.slice(0, limit) : items;\n const hasVisibleItems = visibleItems.length > 0;\n\n const toggle = hasHiddenItems ? (\n <div className={styles[`toggle-container-${alignment}`]}>\n <TokenLimitToggle\n controlId={hasVisibleItems ? controlId : undefined}\n allHidden={limit === 0}\n expanded={expanded}\n numberOfHiddenOptions={items.length - visibleItems.length}\n i18nStrings={i18nStrings}\n onClick={() => {\n const isExpanded = !expanded;\n setExpanded(isExpanded);\n onExpandedClick(isExpanded);\n }}\n />\n </div>\n ) : null;\n\n if (alignment === 'inline') {\n return (\n <div ref={tokenListRef} className={clsx(styles.root, styles.horizontal)}>\n {hasItems && (\n <ul id={controlId} className={styles.list}>\n {visibleItems.map((item, itemIndex) => (\n <li\n key={itemIndex}\n className={styles['list-item']}\n aria-setsize={items.length}\n aria-posinset={itemIndex + 1}\n >\n {renderItem(item, itemIndex)}\n </li>\n ))}\n </ul>\n )}\n {toggle}\n {after && <div className={styles.separator} />}\n {after}\n </div>\n );\n }\n\n return (\n <div ref={tokenListRef} className={clsx(styles.root, styles.vertical)}>\n {hasVisibleItems && (\n <ul id={controlId} className={clsx(styles.list, styles[alignment])}>\n {visibleItems.map((item, itemIndex) => (\n <li\n key={itemIndex}\n className={styles['list-item']}\n aria-setsize={items.length}\n aria-posinset={itemIndex + 1}\n >\n {renderItem(item, itemIndex)}\n </li>\n ))}\n </ul>\n )}\n {toggle}\n {after}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,WAAW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,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,kBAChB,KAAK,CAAC,MAAM,mBACX,SAAS,GAAG,CAAC,IAE3B,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CACzB,CACN,CAAC,CACC,CACN;QACA,MAAM;QACN,KAAK,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useState } from 'react';\n\nimport TokenLimitToggle from './token-limit-toggle';\nimport styles from './styles.css.js';\nimport { TokenListProps } from './interfaces';\nimport { useUniqueId } from '../../hooks/use-unique-id';\nimport clsx from 'clsx';\nimport { useTokenFocusController } from './token-focus-controller';\n\nexport default function TokenList<Item>({\n items,\n alignment,\n renderItem,\n limit,\n after,\n i18nStrings,\n limitShowFewerAriaLabel,\n limitShowMoreAriaLabel,\n moveFocusNextToIndex,\n onExpandedClick = () => undefined,\n}: TokenListProps<Item>) {\n const tokenListRef = useTokenFocusController({ moveFocusNextToIndex: moveFocusNextToIndex });\n const controlId = useUniqueId();\n\n const [expanded, setExpanded] = useState(false);\n const hasItems = items.length > 0;\n const hasHiddenItems = hasItems && limit !== undefined && items.length > limit;\n const visibleItems = hasHiddenItems && !expanded ? items.slice(0, limit) : items;\n const hasVisibleItems = visibleItems.length > 0;\n\n const toggle = hasHiddenItems ? (\n <div className={styles[`toggle-container-${alignment}`]}>\n <TokenLimitToggle\n controlId={hasVisibleItems ? controlId : undefined}\n allHidden={limit === 0}\n expanded={expanded}\n numberOfHiddenOptions={items.length - visibleItems.length}\n i18nStrings={i18nStrings}\n limitShowFewerAriaLabel={limitShowFewerAriaLabel}\n limitShowMoreAriaLabel={limitShowMoreAriaLabel}\n onClick={() => {\n const isExpanded = !expanded;\n setExpanded(isExpanded);\n onExpandedClick(isExpanded);\n }}\n />\n </div>\n ) : null;\n\n if (alignment === 'inline') {\n return (\n <div ref={tokenListRef} className={clsx(styles.root, styles.horizontal)}>\n {hasItems && (\n <ul id={controlId} className={styles.list}>\n {visibleItems.map((item, itemIndex) => (\n <li\n key={itemIndex}\n className={styles['list-item']}\n aria-setsize={items.length}\n aria-posinset={itemIndex + 1}\n >\n {renderItem(item, itemIndex)}\n </li>\n ))}\n </ul>\n )}\n {toggle}\n {after && <div className={styles.separator} />}\n {after}\n </div>\n );\n }\n\n return (\n <div ref={tokenListRef} className={clsx(styles.root, styles.vertical)}>\n {hasVisibleItems && (\n <ul id={controlId} className={clsx(styles.list, styles[alignment])}>\n {visibleItems.map((item, itemIndex) => (\n <li\n key={itemIndex}\n className={styles['list-item']}\n aria-setsize={items.length}\n aria-posinset={itemIndex + 1}\n >\n {renderItem(item, itemIndex)}\n </li>\n ))}\n </ul>\n )}\n {toggle}\n {after}\n </div>\n );\n}\n"]}
|
|
@@ -8,6 +8,8 @@ export interface TokenListProps<Item> {
|
|
|
8
8
|
i18nStrings?: I18nStrings;
|
|
9
9
|
moveFocusNextToIndex?: null | number;
|
|
10
10
|
onExpandedClick?: (isExpanded: boolean) => void;
|
|
11
|
+
limitShowFewerAriaLabel?: string;
|
|
12
|
+
limitShowMoreAriaLabel?: string;
|
|
11
13
|
}
|
|
12
14
|
export interface I18nStrings {
|
|
13
15
|
limitShowFewer?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,cAAc,CAAC,IAAI;IAClC,SAAS,EAAE,UAAU,GAAG,YAAY,GAAG,QAAQ,CAAC;IAChD,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,oBAAoB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACrC,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,cAAc,CAAC,IAAI;IAClC,SAAS,EAAE,UAAU,GAAG,YAAY,GAAG,QAAQ,CAAC;IAChD,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,oBAAoB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACrC,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/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\nimport React from 'react';\n\nexport interface TokenListProps<Item> {\n alignment: 'vertical' | 'horizontal' | 'inline';\n items: readonly Item[];\n limit?: number;\n after?: React.ReactNode;\n renderItem: (item: Item, itemIndex: number) => React.ReactNode;\n i18nStrings?: I18nStrings;\n moveFocusNextToIndex?: null | number;\n onExpandedClick?: (isExpanded: boolean) => void;\n}\n\nexport interface I18nStrings {\n limitShowFewer?: string;\n limitShowMore?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/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\nimport React from 'react';\n\nexport interface TokenListProps<Item> {\n alignment: 'vertical' | 'horizontal' | 'inline';\n items: readonly Item[];\n limit?: number;\n after?: React.ReactNode;\n renderItem: (item: Item, itemIndex: number) => React.ReactNode;\n i18nStrings?: I18nStrings;\n moveFocusNextToIndex?: null | number;\n onExpandedClick?: (isExpanded: boolean) => void;\n limitShowFewerAriaLabel?: string;\n limitShowMoreAriaLabel?: string;\n}\n\nexport interface I18nStrings {\n limitShowFewer?: string;\n limitShowMore?: string;\n}\n"]}
|
|
@@ -8,7 +8,9 @@ interface TokenLimitToggleProps {
|
|
|
8
8
|
numberOfHiddenOptions: number;
|
|
9
9
|
onClick?: NonCancelableEventHandler<null>;
|
|
10
10
|
i18nStrings?: I18nStrings;
|
|
11
|
+
limitShowFewerAriaLabel?: string;
|
|
12
|
+
limitShowMoreAriaLabel?: string;
|
|
11
13
|
}
|
|
12
|
-
export default function TokenLimitToggle({ controlId, allHidden, expanded, numberOfHiddenOptions, onClick, i18nStrings, }: TokenLimitToggleProps): JSX.Element;
|
|
14
|
+
export default function TokenLimitToggle({ controlId, allHidden, expanded, numberOfHiddenOptions, onClick, i18nStrings, limitShowFewerAriaLabel, limitShowMoreAriaLabel, }: TokenLimitToggleProps): JSX.Element;
|
|
13
15
|
export {};
|
|
14
16
|
//# sourceMappingURL=token-limit-toggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-limit-toggle.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/token-limit-toggle.tsx"],"names":[],"mappings":";AAKA,OAAO,EAA0B,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAI3C,UAAU,qBAAqB;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"token-limit-toggle.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/token-limit-toggle.tsx"],"names":[],"mappings":";AAKA,OAAO,EAA0B,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAI3C,UAAU,qBAAqB;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAC1C,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,SAAS,EACT,SAAS,EACT,QAAQ,EACR,qBAAqB,EACrB,OAAO,EACP,WAAgB,EAChB,uBAAuB,EACvB,sBAAsB,GACvB,EAAE,qBAAqB,eA0BvB"}
|
|
@@ -5,16 +5,17 @@ import InternalIcon from '../../../icon/internal';
|
|
|
5
5
|
import { fireNonCancelableEvent } from '../../events';
|
|
6
6
|
import styles from './styles.css.js';
|
|
7
7
|
import { useInternalI18n } from '../../../i18n/context';
|
|
8
|
-
export default function TokenLimitToggle({ controlId, allHidden, expanded, numberOfHiddenOptions, onClick, i18nStrings = {}, }) {
|
|
8
|
+
export default function TokenLimitToggle({ controlId, allHidden, expanded, numberOfHiddenOptions, onClick, i18nStrings = {}, limitShowFewerAriaLabel, limitShowMoreAriaLabel, }) {
|
|
9
9
|
const i18n = useInternalI18n('token-group');
|
|
10
10
|
const numberOfHiddenOptionLabel = allHidden ? numberOfHiddenOptions : `+${numberOfHiddenOptions}`;
|
|
11
11
|
const description = expanded
|
|
12
12
|
? i18n('i18nStrings.limitShowFewer', i18nStrings.limitShowFewer)
|
|
13
13
|
: `${i18n('i18nStrings.limitShowMore', i18nStrings.limitShowMore) || ''} (${numberOfHiddenOptionLabel})`;
|
|
14
|
+
const ariaLabel = expanded ? limitShowFewerAriaLabel : limitShowMoreAriaLabel;
|
|
14
15
|
const handleClick = useCallback(() => {
|
|
15
16
|
fireNonCancelableEvent(onClick, null);
|
|
16
17
|
}, [onClick]);
|
|
17
|
-
return (React.createElement("button", { type: "button", className: styles.toggle, onClick: handleClick, "aria-controls": controlId, "aria-expanded": expanded },
|
|
18
|
+
return (React.createElement("button", { type: "button", className: styles.toggle, onClick: handleClick, "aria-controls": controlId, "aria-expanded": expanded, "aria-label": ariaLabel },
|
|
18
19
|
React.createElement(InternalIcon, { name: expanded ? 'treeview-collapse' : 'treeview-expand' }),
|
|
19
20
|
React.createElement("span", { className: styles.description }, description)));
|
|
20
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-limit-toggle.js","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/token-limit-toggle.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAA6B,MAAM,cAAc,CAAC;AAGjF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"token-limit-toggle.js","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/token-limit-toggle.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAA6B,MAAM,cAAc,CAAC;AAGjF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAYxD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,SAAS,EACT,SAAS,EACT,QAAQ,EACR,qBAAqB,EACrB,OAAO,EACP,WAAW,GAAG,EAAE,EAChB,uBAAuB,EACvB,sBAAsB,GACA;IACtB,MAAM,IAAI,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC;IAE5C,MAAM,yBAAyB,GAAG,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,qBAAqB,EAAE,CAAC;IAClG,MAAM,WAAW,GAAG,QAAQ;QAC1B,CAAC,CAAC,IAAI,CAAC,4BAA4B,EAAE,WAAW,CAAC,cAAc,CAAC;QAChE,CAAC,CAAC,GAAG,IAAI,CAAC,2BAA2B,EAAE,WAAW,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,yBAAyB,GAAG,CAAC;IAC3G,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,sBAAsB,CAAC;IAE9E,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACnC,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,CACL,gCACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,MAAM,CAAC,MAAM,EACxB,OAAO,EAAE,WAAW,mBACL,SAAS,mBACT,QAAQ,gBACX,SAAS;QAErB,oBAAC,YAAY,IAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,iBAAiB,GAAI;QAC1E,8BAAM,SAAS,EAAE,MAAM,CAAC,WAAW,IAAG,WAAW,CAAQ,CAClD,CACV,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useCallback } from 'react';\nimport InternalIcon from '../../../icon/internal';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../../events';\nimport { I18nStrings } from './interfaces';\n\nimport styles from './styles.css.js';\nimport { useInternalI18n } from '../../../i18n/context';\ninterface TokenLimitToggleProps {\n controlId?: string;\n allHidden: boolean;\n expanded: boolean;\n numberOfHiddenOptions: number;\n onClick?: NonCancelableEventHandler<null>;\n i18nStrings?: I18nStrings;\n limitShowFewerAriaLabel?: string;\n limitShowMoreAriaLabel?: string;\n}\n\nexport default function TokenLimitToggle({\n controlId,\n allHidden,\n expanded,\n numberOfHiddenOptions,\n onClick,\n i18nStrings = {},\n limitShowFewerAriaLabel,\n limitShowMoreAriaLabel,\n}: TokenLimitToggleProps) {\n const i18n = useInternalI18n('token-group');\n\n const numberOfHiddenOptionLabel = allHidden ? numberOfHiddenOptions : `+${numberOfHiddenOptions}`;\n const description = expanded\n ? i18n('i18nStrings.limitShowFewer', i18nStrings.limitShowFewer)\n : `${i18n('i18nStrings.limitShowMore', i18nStrings.limitShowMore) || ''} (${numberOfHiddenOptionLabel})`;\n const ariaLabel = expanded ? limitShowFewerAriaLabel : limitShowMoreAriaLabel;\n\n const handleClick = useCallback(() => {\n fireNonCancelableEvent(onClick, null);\n }, [onClick]);\n\n return (\n <button\n type=\"button\"\n className={styles.toggle}\n onClick={handleClick}\n aria-controls={controlId}\n aria-expanded={expanded}\n aria-label={ariaLabel}\n >\n <InternalIcon name={expanded ? 'treeview-collapse' : 'treeview-expand'} />\n <span className={styles.description}>{description}</span>\n </button>\n );\n}\n"]}
|
|
@@ -5,7 +5,7 @@ export interface SingleTabStopNavigationOptions {
|
|
|
5
5
|
}
|
|
6
6
|
export declare const defaultValue: {
|
|
7
7
|
navigationActive: boolean;
|
|
8
|
-
registerFocusable(focusable:
|
|
8
|
+
registerFocusable(focusable: HTMLElement, handler: FocusableChangeHandler): () => void;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Single tab stop navigation context is used together with keyboard navigation that requires a single tab stop.
|
|
@@ -13,9 +13,9 @@ export declare const defaultValue: {
|
|
|
13
13
|
*/
|
|
14
14
|
export declare const SingleTabStopNavigationContext: import("react").Context<{
|
|
15
15
|
navigationActive: boolean;
|
|
16
|
-
registerFocusable(focusable:
|
|
16
|
+
registerFocusable(focusable: HTMLElement, handler: FocusableChangeHandler): () => void;
|
|
17
17
|
}>;
|
|
18
|
-
export declare function useSingleTabStopNavigation(focusable: null | React.RefObject<
|
|
18
|
+
export declare function useSingleTabStopNavigation(focusable: null | React.RefObject<HTMLElement>, options?: {
|
|
19
19
|
tabIndex?: number;
|
|
20
20
|
}): {
|
|
21
21
|
navigationActive: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-tab-stop-navigation-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/single-tab-stop-navigation-context.tsx"],"names":[],"mappings":";AAKA,MAAM,MAAM,sBAAsB,GAAG,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;AAEpE,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,EAAE;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"single-tab-stop-navigation-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/single-tab-stop-navigation-context.tsx"],"names":[],"mappings":";AAKA,MAAM,MAAM,sBAAsB,GAAG,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;AAEpE,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,EAAE;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,sBAAsB,GAAG,MAAM,IAAI,CAAC;CAIxF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,8BAA8B;sBAXvB,OAAO;iCACI,WAAW,WAAW,sBAAsB,GAAG,MAAM,IAAI;EAUf,CAAC;AAE1E,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,EAC9C,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;EAoBhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-tab-stop-navigation-context.js","sourceRoot":"","sources":["../../../../src/internal/context/single-tab-stop-navigation-context.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQvE,MAAM,CAAC,MAAM,YAAY,GAGrB;IACF,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAE1E,MAAM,UAAU,0BAA0B,CACxC,
|
|
1
|
+
{"version":3,"file":"single-tab-stop-navigation-context.js","sourceRoot":"","sources":["../../../../src/internal/context/single-tab-stop-navigation-context.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAQvE,MAAM,CAAC,MAAM,YAAY,GAGrB;IACF,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAE1E,MAAM,UAAU,0BAA0B,CACxC,SAA8C,EAC9C,OAA+B;;IAE/B,MAAM,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,GAAG,UAAU,CAAC,8BAA8B,CAAC,CAAC;IACpH,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClE,MAAM,kBAAkB,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,KAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,IAAG,CAAC,CAAC;IACtE,MAAM,gBAAgB,GAAG,uBAAuB,IAAI,CAAC,kBAAkB,CAAC;IAExE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,gBAAgB,IAAI,SAAS,IAAI,SAAS,CAAC,OAAO,EAAE;YACtD,MAAM,UAAU,GAAG,iBAAiB,CAAC,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC;YAC1G,OAAO,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC;SAC3B;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,QAAQ,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CAAC;IACjC,IAAI,gBAAgB,EAAE;QACpB,QAAQ,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,mCAAI,CAAC,CAAC;KAC7D;IAED,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC;AACxC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { createContext, useContext, useEffect, useState } from 'react';\n\nexport type FocusableChangeHandler = (isFocusable: boolean) => void;\n\nexport interface SingleTabStopNavigationOptions {\n tabIndex?: number;\n}\n\nexport const defaultValue: {\n navigationActive: boolean;\n registerFocusable(focusable: HTMLElement, handler: FocusableChangeHandler): () => void;\n} = {\n navigationActive: false,\n registerFocusable: () => () => {},\n};\n\n/**\n * Single tab stop navigation context is used together with keyboard navigation that requires a single tab stop.\n * It instructs interactive elements to override tab indices for just a single one to remain user-focusable.\n */\nexport const SingleTabStopNavigationContext = createContext(defaultValue);\n\nexport function useSingleTabStopNavigation(\n focusable: null | React.RefObject<HTMLElement>,\n options?: { tabIndex?: number }\n) {\n const { navigationActive: contextNavigationActive, registerFocusable } = useContext(SingleTabStopNavigationContext);\n const [focusTargetActive, setFocusTargetActive] = useState(false);\n const navigationDisabled = options?.tabIndex && options?.tabIndex < 0;\n const navigationActive = contextNavigationActive && !navigationDisabled;\n\n useEffect(() => {\n if (navigationActive && focusable && focusable.current) {\n const unregister = registerFocusable(focusable.current, isFocusable => setFocusTargetActive(isFocusable));\n return () => unregister();\n }\n });\n\n let tabIndex = options?.tabIndex;\n if (navigationActive) {\n tabIndex = !focusTargetActive ? -1 : options?.tabIndex ?? 0;\n }\n\n return { navigationActive, tabIndex };\n}\n"]}
|