@cloudscape-design/components 3.0.517 → 3.0.518
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/button-dropdown/category-elements/category-element.d.ts +1 -1
- package/button-dropdown/category-elements/category-element.d.ts.map +1 -1
- package/button-dropdown/category-elements/category-element.js +2 -2
- package/button-dropdown/category-elements/category-element.js.map +1 -1
- package/button-dropdown/category-elements/expandable-category-element.d.ts +1 -1
- package/button-dropdown/category-elements/expandable-category-element.d.ts.map +1 -1
- package/button-dropdown/category-elements/expandable-category-element.js +2 -2
- package/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
- package/button-dropdown/category-elements/mobile-expandable-category-element.d.ts +1 -1
- package/button-dropdown/category-elements/mobile-expandable-category-element.d.ts.map +1 -1
- package/button-dropdown/category-elements/mobile-expandable-category-element.js +2 -2
- package/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
- package/button-dropdown/category-elements/styles.css.js +13 -13
- package/button-dropdown/category-elements/styles.scoped.css +32 -21
- package/button-dropdown/category-elements/styles.selectors.js +13 -13
- package/button-dropdown/interfaces.d.ts +0 -2
- package/button-dropdown/interfaces.d.ts.map +1 -1
- package/button-dropdown/interfaces.js.map +1 -1
- package/button-dropdown/item-element/index.d.ts +1 -1
- package/button-dropdown/item-element/index.d.ts.map +1 -1
- package/button-dropdown/item-element/index.js +1 -6
- package/button-dropdown/item-element/index.js.map +1 -1
- package/button-dropdown/item-element/styles.css.js +15 -16
- package/button-dropdown/item-element/styles.scoped.css +18 -18
- package/button-dropdown/item-element/styles.selectors.js +15 -16
- package/button-dropdown/items-list.d.ts.map +1 -1
- package/button-dropdown/items-list.js +3 -3
- package/button-dropdown/items-list.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CategoryProps } from '../interfaces';
|
|
3
|
-
declare const CategoryElement: ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, disabled, variant,
|
|
3
|
+
declare const CategoryElement: ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, disabled, variant, }: CategoryProps) => JSX.Element;
|
|
4
4
|
export default CategoryElement;
|
|
5
5
|
//# sourceMappingURL=category-element.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-element.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/category-elements/category-element.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM9C,QAAA,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"category-element.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/category-elements/category-element.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM9C,QAAA,MAAM,eAAe,2IAWlB,aAAa,gBAiCf,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -2,12 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import styles from './styles.css.js';
|
|
4
4
|
import ItemsList from '../items-list';
|
|
5
|
-
const CategoryElement = ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, disabled, variant,
|
|
5
|
+
const CategoryElement = ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, disabled, variant, }) => {
|
|
6
6
|
// Hide the category title element from screen readers because it will be
|
|
7
7
|
// provided as an ARIA label.
|
|
8
8
|
return (React.createElement("li", { className: clsx(styles.category, styles[`variant-${variant}`], disabled && styles.disabled), role: "presentation", "aria-disabled": disabled ? 'true' : undefined },
|
|
9
9
|
item.text && (React.createElement("p", { className: clsx(styles.header, { [styles.disabled]: disabled }), "aria-hidden": "true" }, item.text)),
|
|
10
|
-
React.createElement("ul", { className: clsx(styles['items-list-container']), role: "group", "aria-label": item.text }, item.items && (React.createElement(ItemsList, { items: item.items, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, highlightItem: highlightItem, categoryDisabled: disabled, hasCategoryHeader: !!item.text, variant: variant
|
|
10
|
+
React.createElement("ul", { className: clsx(styles['items-list-container']), role: "group", "aria-label": item.text }, item.items && (React.createElement(ItemsList, { items: item.items, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, highlightItem: highlightItem, categoryDisabled: disabled, hasCategoryHeader: !!item.text, variant: variant })))));
|
|
11
11
|
};
|
|
12
12
|
export default CategoryElement;
|
|
13
13
|
//# sourceMappingURL=category-element.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"category-element.js","sourceRoot":"lib/default/","sources":["button-dropdown/category-elements/category-element.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,SAAS,MAAM,eAAe,CAAC;AAEtC,MAAM,eAAe,GAAG,CAAC,EACvB,IAAI,EACJ,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,QAAQ,EACR,OAAO,
|
|
1
|
+
{"version":3,"file":"category-element.js","sourceRoot":"lib/default/","sources":["button-dropdown/category-elements/category-element.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;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cesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { CategoryProps } from '../interfaces';\nimport React from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport ItemsList from '../items-list';\n\nconst CategoryElement = ({\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n disabled,\n variant,\n}: CategoryProps) => {\n // Hide the category title element from screen readers because it will be\n // provided as an ARIA label.\n return (\n <li\n className={clsx(styles.category, styles[`variant-${variant}`], disabled && styles.disabled)}\n role=\"presentation\"\n aria-disabled={disabled ? 'true' : undefined}\n >\n {item.text && (\n <p className={clsx(styles.header, { [styles.disabled]: disabled })} aria-hidden=\"true\">\n {item.text}\n </p>\n )}\n <ul className={clsx(styles['items-list-container'])} role=\"group\" aria-label={item.text}>\n {item.items && (\n <ItemsList\n items={item.items}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n highlightItem={highlightItem}\n categoryDisabled={disabled}\n hasCategoryHeader={!!item.text}\n variant={variant}\n />\n )}\n </ul>\n </li>\n );\n};\n\nexport default CategoryElement;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CategoryProps } from '../interfaces';
|
|
3
|
-
declare const ExpandableCategoryElement: ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, disabled, expandToViewport, variant,
|
|
3
|
+
declare const ExpandableCategoryElement: ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, disabled, expandToViewport, variant, }: CategoryProps) => JSX.Element;
|
|
4
4
|
export default ExpandableCategoryElement;
|
|
5
5
|
//# sourceMappingURL=expandable-category-element.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandable-category-element.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/category-elements/expandable-category-element.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAK9C,QAAA,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"expandable-category-element.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/category-elements/expandable-category-element.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAK9C,QAAA,MAAM,yBAAyB,6JAY5B,aAAa,gBA0Gf,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -9,7 +9,7 @@ import Dropdown from '../../internal/components/dropdown';
|
|
|
9
9
|
import useHiddenDescription from '../utils/use-hidden-description';
|
|
10
10
|
import Tooltip from '../tooltip.js';
|
|
11
11
|
import { getMenuItemProps } from '../utils/menu-item';
|
|
12
|
-
const ExpandableCategoryElement = ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, disabled, expandToViewport, variant,
|
|
12
|
+
const ExpandableCategoryElement = ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, disabled, expandToViewport, variant, }) => {
|
|
13
13
|
const highlighted = isHighlighted(item);
|
|
14
14
|
const expanded = isExpanded(item);
|
|
15
15
|
const isKeyboardHighlighted = isKeyboardHighlight(item);
|
|
@@ -58,7 +58,7 @@ const ExpandableCategoryElement = ({ item, onItemActivate, onGroupToggle, target
|
|
|
58
58
|
}
|
|
59
59
|
else {
|
|
60
60
|
content = (React.createElement(Dropdown, { open: expanded, stretchWidth: false, interior: true, expandToViewport: expandToViewport, trigger: trigger }, item.items && expanded && (React.createElement("ul", { role: "menu", "aria-label": item.text, className: clsx(styles['items-list-container']) },
|
|
61
|
-
React.createElement(ItemsList, { items: item.items, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, highlightItem: highlightItem, variant: variant
|
|
61
|
+
React.createElement(ItemsList, { items: item.items, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, highlightItem: highlightItem, variant: variant })))));
|
|
62
62
|
}
|
|
63
63
|
return (React.createElement("li", { className: clsx(styles.category, styles[`variant-${variant}`], styles.expandable, {
|
|
64
64
|
[styles.expanded]: expanded,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandable-category-element.js","sourceRoot":"lib/default/","sources":["button-dropdown/category-elements/expandable-category-element.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;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,SAAS,MAAM,eAAe,CAAC;AACtC,OAAO,QAAQ,MAAM,oCAAoC,CAAC;AAE1D,OAAO,oBAAoB,MAAM,iCAAiC,CAAC;AACnE,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,yBAAyB,GAAG,CAAC,EACjC,IAAI,EACJ,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,OAAO,
|
|
1
|
+
{"version":3,"file":"expandable-category-element.js","sourceRoot":"lib/default/","sources":["button-dropdown/category-elements/expandable-category-element.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC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R,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,IAEpB,OAAO,CACL,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,yBAAyB,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 styles from './styles.css.js';\n\nimport InternalIcon from '../../icon/internal';\nimport ItemsList from '../items-list';\nimport Dropdown from '../../internal/components/dropdown';\nimport { CategoryProps } from '../interfaces';\nimport useHiddenDescription from '../utils/use-hidden-description';\nimport Tooltip from '../tooltip.js';\nimport { getMenuItemProps } from '../utils/menu-item';\n\nconst ExpandableCategoryElement = ({\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n disabled,\n expandToViewport,\n variant,\n}: CategoryProps) => {\n const highlighted = isHighlighted(item);\n const expanded = isExpanded(item);\n const isKeyboardHighlighted = isKeyboardHighlight(item);\n const triggerRef = React.useRef<HTMLSpanElement>(null);\n const ref = useRef<HTMLLIElement>(null);\n\n useEffect(() => {\n if (triggerRef.current && highlighted && !expanded) {\n triggerRef.current.focus();\n }\n }, [expanded, highlighted]);\n\n const onClick: React.MouseEventHandler = event => {\n if (!disabled) {\n event.preventDefault();\n onGroupToggle(item, event);\n triggerRef.current?.focus();\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n const isDisabledWithReason = !!item.disabledReason && item.disabled;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n const trigger = item.text && (\n <span\n className={clsx(styles.header, styles['expandable-header'], styles[`variant-${variant}`], {\n [styles.disabled]: disabled,\n [styles.highlighted]: highlighted,\n [styles['is-focused']]: isKeyboardHighlighted,\n })}\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 ref={triggerRef}\n {...getMenuItemProps({ parent: true, expanded, disabled })}\n {...(isDisabledWithReason ? targetProps : {})}\n >\n {item.text}\n <span className={clsx(styles['expand-icon'], styles['expand-icon-right'])}>\n <InternalIcon name=\"caret-down-filled\" />\n </span>\n </span>\n );\n\n let content: React.ReactNode;\n // If the category element is disabled, we do not render a dropdown.\n // Screenreaders are confused by additional sections\n if (isDisabledWithReason) {\n content = (\n <Tooltip content={item.disabledReason}>\n {trigger}\n {descriptionEl}\n </Tooltip>\n );\n } else if (disabled) {\n content = trigger;\n } else {\n content = (\n <Dropdown\n open={expanded}\n stretchWidth={false}\n interior={true}\n expandToViewport={expandToViewport}\n trigger={trigger}\n >\n {item.items && expanded && (\n <ul role=\"menu\" aria-label={item.text} className={clsx(styles['items-list-container'])}>\n <ItemsList\n items={item.items}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n highlightItem={highlightItem}\n variant={variant}\n />\n </ul>\n )}\n </Dropdown>\n );\n }\n\n return (\n <li\n className={clsx(styles.category, styles[`variant-${variant}`], styles.expandable, {\n [styles.expanded]: expanded,\n [styles.disabled]: disabled,\n [styles.highlighted]: highlighted,\n })}\n role=\"presentation\"\n data-testid={item.id}\n ref={ref}\n onClick={onClick}\n onMouseEnter={onHover}\n onTouchStart={onHover}\n >\n {content}\n </li>\n );\n};\n\nexport default ExpandableCategoryElement;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CategoryProps } from '../interfaces';
|
|
3
|
-
declare const MobileExpandableCategoryElement: ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, disabled, variant,
|
|
3
|
+
declare const MobileExpandableCategoryElement: ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, disabled, variant, }: CategoryProps) => JSX.Element;
|
|
4
4
|
export default MobileExpandableCategoryElement;
|
|
5
5
|
//# sourceMappingURL=mobile-expandable-category-element.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-expandable-category-element.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/category-elements/mobile-expandable-category-element.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAK9C,QAAA,MAAM,+BAA+B,
|
|
1
|
+
{"version":3,"file":"mobile-expandable-category-element.d.ts","sourceRoot":"lib/default/","sources":["button-dropdown/category-elements/mobile-expandable-category-element.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAK9C,QAAA,MAAM,+BAA+B,2IAWlC,aAAa,gBAuGf,CAAC;AAEF,eAAe,+BAA+B,CAAC"}
|
|
@@ -9,7 +9,7 @@ import MobileExpandableGroup from '../mobile-expandable-group/mobile-expandable-
|
|
|
9
9
|
import Tooltip from '../tooltip.js';
|
|
10
10
|
import useHiddenDescription from '../utils/use-hidden-description.js';
|
|
11
11
|
import { getMenuItemProps } from '../utils/menu-item.js';
|
|
12
|
-
const MobileExpandableCategoryElement = ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, disabled, variant,
|
|
12
|
+
const MobileExpandableCategoryElement = ({ item, onItemActivate, onGroupToggle, targetItem, isHighlighted, isKeyboardHighlight, isExpanded, highlightItem, disabled, variant, }) => {
|
|
13
13
|
const highlighted = isHighlighted(item);
|
|
14
14
|
const expanded = isExpanded(item);
|
|
15
15
|
const isKeyboardHighlighted = isKeyboardHighlight(item);
|
|
@@ -56,7 +56,7 @@ const MobileExpandableCategoryElement = ({ item, onItemActivate, onGroupToggle,
|
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
58
|
content = (React.createElement(MobileExpandableGroup, { open: expanded, trigger: trigger }, item.items && expanded && (React.createElement("ul", { role: "menu", "aria-label": item.text, className: clsx(styles['items-list-container']) },
|
|
59
|
-
React.createElement(ItemsList, { items: item.items, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, highlightItem: highlightItem, hasCategoryHeader: true, variant: variant
|
|
59
|
+
React.createElement(ItemsList, { items: item.items, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, highlightItem: highlightItem, hasCategoryHeader: true, variant: variant })))));
|
|
60
60
|
}
|
|
61
61
|
return (React.createElement("li", { className: clsx(styles.category, styles[`variant-${variant}`], styles.expandable, {
|
|
62
62
|
[styles.expanded]: expanded,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-expandable-category-element.js","sourceRoot":"lib/default/","sources":["button-dropdown/category-elements/mobile-expandable-category-element.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,SAAS,MAAM,eAAe,CAAC;AACtC,OAAO,qBAAqB,MAAM,oDAAoD,CAAC;AAEvF,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,oBAAoB,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,+BAA+B,GAAG,CAAC,EACvC,IAAI,EACJ,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,QAAQ,EACR,OAAO,
|
|
1
|
+
{"version":3,"file":"mobile-expandable-category-element.js","sourceRoot":"lib/default/","sources":["button-dropdown/category-elements/mobile-expandable-category-element.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,SAAS,MAAM,eAAe,CAAC;AACtC,OAAO,qBAAqB,MAAM,oDAAoD,CAAC;AAEvF,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,oBAAoB,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,+BAA+B,GAAG,CAAC,EACvC,IAAI,EACJ,cAAc,EACd,aAAa,EACb,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,QAAQ,EACR,OAAO,GACO,EAAE,EAAE;IAClB,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAkB,IAAI,CAAC,CAAC;IAEvD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,UAAU,CAAC,OAAO,IAAI,WAAW,IAAI,CAAC,QAAQ,EAAE;YAClD,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;SAC5B;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAE5B,MAAM,OAAO,GAAG,CAAC,CAAmB,EAAE,EAAE;QACtC,I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AAQ;YAC7C,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,IAAI;SAC1B,CAAC,EACF,IAAI,EAAC,cAAc,EACnB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,OAAO,iBACR,IAAI,CAAC,EAAE,IAEnB,OAAO,CACL,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,+BAA+B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect } from 'react';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\n\nimport InternalIcon from '../../icon/internal';\nimport ItemsList from '../items-list';\nimport MobileExpandableGroup from '../mobile-expandable-group/mobile-expandable-group';\nimport { CategoryProps } from '../interfaces';\nimport Tooltip from '../tooltip.js';\nimport useHiddenDescription from '../utils/use-hidden-description.js';\nimport { getMenuItemProps } from '../utils/menu-item.js';\n\nconst MobileExpandableCategoryElement = ({\n item,\n onItemActivate,\n onGroupToggle,\n targetItem,\n isHighlighted,\n isKeyboardHighlight,\n isExpanded,\n highlightItem,\n disabled,\n variant,\n}: CategoryProps) => {\n const highlighted = isHighlighted(item);\n const expanded = isExpanded(item);\n const isKeyboardHighlighted = isKeyboardHighlight(item);\n const triggerRef = React.useRef<HTMLSpanElement>(null);\n\n useEffect(() => {\n if (triggerRef.current && highlighted && !expanded) {\n triggerRef.current.focus();\n }\n }, [expanded, highlighted]);\n\n const onClick = (e: React.MouseEvent) => {\n if (!disabled) {\n e.preventDefault();\n onGroupToggle(item, e);\n }\n };\n\n const onHover = () => {\n highlightItem(item);\n };\n\n const isDisabledWithReason = !!item.disabledReason && item.disabled;\n const { targetProps, descriptionEl } = useHiddenDescription(item.disabledReason);\n const trigger = item.text && (\n <span\n className={clsx(styles.header, styles['expandable-header'], styles[`variant-${variant}`], {\n [styles.highlighted]: highlighted,\n [styles['rolled-down']]: expanded,\n [styles.disabled]: disabled,\n [styles['is-focused']]: isKeyboardHighlighted,\n })}\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 ref={triggerRef}\n {...getMenuItemProps({ parent: true, disabled, expanded })}\n {...(isDisabledWithReason ? targetProps : {})}\n >\n {item.text}\n <span\n className={clsx(styles['expand-icon'], {\n [styles['expand-icon-up']]: expanded,\n })}\n >\n <InternalIcon name=\"caret-down-filled\" />\n </span>\n </span>\n );\n\n let content: React.ReactNode;\n\n if (isDisabledWithReason) {\n content = (\n <>\n {descriptionEl}\n <Tooltip content={item.disabledReason}>{trigger}</Tooltip>\n </>\n );\n } else if (disabled) {\n content = trigger;\n } else {\n content = (\n <MobileExpandableGroup open={expanded} trigger={trigger}>\n {item.items && expanded && (\n <ul role=\"menu\" aria-label={item.text} className={clsx(styles['items-list-container'])}>\n <ItemsList\n items={item.items}\n onItemActivate={onItemActivate}\n onGroupToggle={onGroupToggle}\n targetItem={targetItem}\n isHighlighted={isHighlighted}\n isKeyboardHighlight={isKeyboardHighlight}\n isExpanded={isExpanded}\n highlightItem={highlightItem}\n hasCategoryHeader={true}\n variant={variant}\n />\n </ul>\n )}\n </MobileExpandableGroup>\n );\n }\n\n return (\n <li\n className={clsx(styles.category, styles[`variant-${variant}`], styles.expandable, {\n [styles.expanded]: expanded,\n [styles.disabled]: disabled,\n [styles.highlighted]: highlighted || expanded,\n [styles.expandable]: true,\n })}\n role=\"presentation\"\n onClick={onClick}\n onMouseEnter={onHover}\n onTouchStart={onHover}\n data-testid={item.id}\n >\n {content}\n </li>\n );\n};\n\nexport default MobileExpandableCategoryElement;\n"]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"header": "
|
|
5
|
-
"disabled": "
|
|
6
|
-
"expandable-header": "awsui_expandable-
|
|
7
|
-
"rolled-down": "awsui_rolled-
|
|
8
|
-
"highlighted": "
|
|
9
|
-
"is-focused": "awsui_is-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"expand-icon": "awsui_expand-
|
|
14
|
-
"expand-icon-up": "awsui_expand-icon-
|
|
15
|
-
"expand-icon-right": "awsui_expand-icon-
|
|
16
|
-
"items-list-container": "awsui_items-list-
|
|
4
|
+
"header": "awsui_header_16mm3_q0qrm_93",
|
|
5
|
+
"disabled": "awsui_disabled_16mm3_q0qrm_108",
|
|
6
|
+
"expandable-header": "awsui_expandable-header_16mm3_q0qrm_112",
|
|
7
|
+
"rolled-down": "awsui_rolled-down_16mm3_q0qrm_123",
|
|
8
|
+
"highlighted": "awsui_highlighted_16mm3_q0qrm_126",
|
|
9
|
+
"is-focused": "awsui_is-focused_16mm3_q0qrm_139",
|
|
10
|
+
"variant-navigation": "awsui_variant-navigation_16mm3_q0qrm_143",
|
|
11
|
+
"category": "awsui_category_16mm3_q0qrm_155",
|
|
12
|
+
"expandable": "awsui_expandable_16mm3_q0qrm_112",
|
|
13
|
+
"expand-icon": "awsui_expand-icon_16mm3_q0qrm_176",
|
|
14
|
+
"expand-icon-up": "awsui_expand-icon-up_16mm3_q0qrm_183",
|
|
15
|
+
"expand-icon-right": "awsui_expand-icon-right_16mm3_q0qrm_186",
|
|
16
|
+
"items-list-container": "awsui_items-list-container_16mm3_q0qrm_200"
|
|
17
17
|
};
|
|
18
18
|
|
|
@@ -90,7 +90,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.
|
|
93
|
+
.awsui_header_16mm3_q0qrm_93:not(#\9) {
|
|
94
94
|
position: relative;
|
|
95
95
|
margin: 0;
|
|
96
96
|
color: var(--color-text-dropdown-group-label-4x4uyw, #414d5c);
|
|
@@ -105,25 +105,25 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
105
105
|
) calc(var(--space-button-horizontal-8jxzea, 20px) + var(--border-item-width-yel47s, 2px));
|
|
106
106
|
z-index: 1;
|
|
107
107
|
}
|
|
108
|
-
.
|
|
108
|
+
.awsui_header_16mm3_q0qrm_93.awsui_disabled_16mm3_q0qrm_108:not(#\9) {
|
|
109
109
|
color: var(--color-text-dropdown-item-disabled-6oq3n6, #9ba7b6);
|
|
110
110
|
cursor: default;
|
|
111
111
|
}
|
|
112
|
-
.
|
|
112
|
+
.awsui_header_16mm3_q0qrm_93.awsui_expandable-header_16mm3_q0qrm_112:not(#\9) {
|
|
113
113
|
border-top-color: var(--color-border-dropdown-group-yakmix, #b6bec9);
|
|
114
114
|
border-bottom-color: var(--color-border-dropdown-group-yakmix, #b6bec9);
|
|
115
115
|
cursor: pointer;
|
|
116
116
|
}
|
|
117
|
-
.
|
|
117
|
+
.awsui_header_16mm3_q0qrm_93.awsui_expandable-header_16mm3_q0qrm_112.awsui_disabled_16mm3_q0qrm_108:not(#\9) {
|
|
118
118
|
cursor: default;
|
|
119
119
|
}
|
|
120
|
-
.
|
|
120
|
+
.awsui_header_16mm3_q0qrm_93.awsui_expandable-header_16mm3_q0qrm_112:not(#\9):focus {
|
|
121
121
|
outline: none;
|
|
122
122
|
}
|
|
123
|
-
.
|
|
123
|
+
.awsui_header_16mm3_q0qrm_93.awsui_expandable-header_16mm3_q0qrm_112.awsui_rolled-down_16mm3_q0qrm_123:not(#\9) {
|
|
124
124
|
border-bottom-color: transparent;
|
|
125
125
|
}
|
|
126
|
-
.
|
|
126
|
+
.awsui_header_16mm3_q0qrm_93.awsui_expandable-header_16mm3_q0qrm_112.awsui_highlighted_16mm3_q0qrm_126:not(#\9) {
|
|
127
127
|
background-color: var(--color-background-dropdown-item-hover-swsulg, #f4f4f4);
|
|
128
128
|
color: var(--color-text-dropdown-item-highlighted-a51hdb, #000716);
|
|
129
129
|
padding: var(--space-xxs-p8yyaw, 4px) var(--space-button-horizontal-8jxzea, 20px);
|
|
@@ -131,62 +131,73 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
131
131
|
border-radius: var(--border-radius-item-05df9h, 8px);
|
|
132
132
|
z-index: 2;
|
|
133
133
|
}
|
|
134
|
-
.
|
|
134
|
+
.awsui_header_16mm3_q0qrm_93.awsui_expandable-header_16mm3_q0qrm_112.awsui_highlighted_16mm3_q0qrm_126.awsui_disabled_16mm3_q0qrm_108:not(#\9) {
|
|
135
135
|
background-color: var(--color-background-dropdown-item-dimmed-dlm6wk, transparent);
|
|
136
136
|
border-color: var(--color-border-dropdown-item-dimmed-hover-xdu0hf, #7d8998);
|
|
137
137
|
color: var(--color-text-dropdown-item-dimmed-f2joj8, #9ba7b6);
|
|
138
138
|
}
|
|
139
|
-
.
|
|
139
|
+
.awsui_header_16mm3_q0qrm_93.awsui_expandable-header_16mm3_q0qrm_112.awsui_highlighted_16mm3_q0qrm_126.awsui_is-focused_16mm3_q0qrm_139:not(#\9) {
|
|
140
140
|
border-color: var(--color-border-dropdown-item-focused-5hbaf3, #414d5c);
|
|
141
141
|
box-shadow: inset 0 0 0 var(--border-control-focus-ring-shadow-spread-0ctpjf, 0px) var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
142
142
|
}
|
|
143
|
+
.awsui_header_16mm3_q0qrm_93.awsui_expandable-header_16mm3_q0qrm_112.awsui_variant-navigation_16mm3_q0qrm_143:not(#\9) {
|
|
144
|
+
padding-top: var(--space-xs-zb16t3, 8px);
|
|
145
|
+
padding-bottom: var(--space-xs-zb16t3, 8px);
|
|
146
|
+
}
|
|
147
|
+
.awsui_header_16mm3_q0qrm_93.awsui_expandable-header_16mm3_q0qrm_112.awsui_variant-navigation_16mm3_q0qrm_143.awsui_highlighted_16mm3_q0qrm_126:not(#\9) {
|
|
148
|
+
border-color: transparent;
|
|
149
|
+
border-top-color: var(--color-border-dropdown-group-yakmix, #b6bec9);
|
|
150
|
+
border-bottom-color: var(--color-border-dropdown-group-yakmix, #b6bec9);
|
|
151
|
+
background-color: transparent;
|
|
152
|
+
color: var(--color-text-accent-n2acxv, #0972d3);
|
|
153
|
+
}
|
|
143
154
|
|
|
144
|
-
.
|
|
155
|
+
.awsui_category_16mm3_q0qrm_155:not(#\9) {
|
|
145
156
|
list-style: none;
|
|
146
157
|
margin-top: calc(-1 * var(--border-divider-list-width-27y3k5, 1px));
|
|
147
158
|
padding: 0;
|
|
148
159
|
}
|
|
149
|
-
.
|
|
160
|
+
.awsui_category_16mm3_q0qrm_155:not(#\9):first-child {
|
|
150
161
|
margin-top: 0;
|
|
151
162
|
}
|
|
152
|
-
.
|
|
163
|
+
.awsui_category_16mm3_q0qrm_155.awsui_expandable_16mm3_q0qrm_112:not(#\9) {
|
|
153
164
|
border-top: 0;
|
|
154
165
|
}
|
|
155
|
-
.
|
|
166
|
+
.awsui_category_16mm3_q0qrm_155:not(#\9):last-child {
|
|
156
167
|
border-bottom: none;
|
|
157
168
|
}
|
|
158
|
-
.
|
|
169
|
+
.awsui_category_16mm3_q0qrm_155.awsui_variant-navigation_16mm3_q0qrm_143:not(#\9) {
|
|
159
170
|
padding-top: var(--space-xxs-p8yyaw, 4px);
|
|
160
171
|
}
|
|
161
|
-
.
|
|
172
|
+
.awsui_category_16mm3_q0qrm_155.awsui_variant-navigation_16mm3_q0qrm_143.awsui_expandable_16mm3_q0qrm_112:not(#\9) {
|
|
162
173
|
padding-top: 0;
|
|
163
174
|
}
|
|
164
175
|
|
|
165
|
-
.awsui_expand-
|
|
176
|
+
.awsui_expand-icon_16mm3_q0qrm_176:not(#\9) {
|
|
166
177
|
position: relative;
|
|
167
178
|
left: var(--space-s-34lx8l, 12px);
|
|
168
179
|
width: var(--space-m-udix3p, 16px);
|
|
169
180
|
display: inline-block;
|
|
170
181
|
transition: transform var(--motion-duration-rotate-180-dpvl4m, 135ms) var(--motion-easing-rotate-180-e270ko, cubic-bezier(0.165, 0.84, 0.44, 1));
|
|
171
182
|
}
|
|
172
|
-
.awsui_expand-icon-
|
|
183
|
+
.awsui_expand-icon-up_16mm3_q0qrm_183:not(#\9) {
|
|
173
184
|
transform: rotate(-180deg);
|
|
174
185
|
}
|
|
175
|
-
.awsui_expand-icon-
|
|
186
|
+
.awsui_expand-icon-right_16mm3_q0qrm_186:not(#\9) {
|
|
176
187
|
transform: rotate(-90deg);
|
|
177
188
|
}
|
|
178
189
|
@media (prefers-reduced-motion: reduce) {
|
|
179
|
-
.awsui_expand-
|
|
190
|
+
.awsui_expand-icon_16mm3_q0qrm_176:not(#\9) {
|
|
180
191
|
animation: none;
|
|
181
192
|
transition: none;
|
|
182
193
|
}
|
|
183
194
|
}
|
|
184
|
-
.awsui-motion-disabled .awsui_expand-
|
|
195
|
+
.awsui-motion-disabled .awsui_expand-icon_16mm3_q0qrm_176:not(#\9), .awsui-mode-entering .awsui_expand-icon_16mm3_q0qrm_176:not(#\9) {
|
|
185
196
|
animation: none;
|
|
186
197
|
transition: none;
|
|
187
198
|
}
|
|
188
199
|
|
|
189
|
-
.awsui_items-list-
|
|
200
|
+
.awsui_items-list-container_16mm3_q0qrm_200:not(#\9) {
|
|
190
201
|
padding: 0;
|
|
191
202
|
margin: -1px 0 0 0;
|
|
192
203
|
overflow-y: auto;
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"header": "
|
|
6
|
-
"disabled": "
|
|
7
|
-
"expandable-header": "awsui_expandable-
|
|
8
|
-
"rolled-down": "awsui_rolled-
|
|
9
|
-
"highlighted": "
|
|
10
|
-
"is-focused": "awsui_is-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"expand-icon": "awsui_expand-
|
|
15
|
-
"expand-icon-up": "awsui_expand-icon-
|
|
16
|
-
"expand-icon-right": "awsui_expand-icon-
|
|
17
|
-
"items-list-container": "awsui_items-list-
|
|
5
|
+
"header": "awsui_header_16mm3_q0qrm_93",
|
|
6
|
+
"disabled": "awsui_disabled_16mm3_q0qrm_108",
|
|
7
|
+
"expandable-header": "awsui_expandable-header_16mm3_q0qrm_112",
|
|
8
|
+
"rolled-down": "awsui_rolled-down_16mm3_q0qrm_123",
|
|
9
|
+
"highlighted": "awsui_highlighted_16mm3_q0qrm_126",
|
|
10
|
+
"is-focused": "awsui_is-focused_16mm3_q0qrm_139",
|
|
11
|
+
"variant-navigation": "awsui_variant-navigation_16mm3_q0qrm_143",
|
|
12
|
+
"category": "awsui_category_16mm3_q0qrm_155",
|
|
13
|
+
"expandable": "awsui_expandable_16mm3_q0qrm_112",
|
|
14
|
+
"expand-icon": "awsui_expand-icon_16mm3_q0qrm_176",
|
|
15
|
+
"expand-icon-up": "awsui_expand-icon-up_16mm3_q0qrm_183",
|
|
16
|
+
"expand-icon-right": "awsui_expand-icon-right_16mm3_q0qrm_186",
|
|
17
|
+
"items-list-container": "awsui_items-list-container_16mm3_q0qrm_200"
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -167,7 +167,6 @@ export interface CategoryProps extends HighlightProps {
|
|
|
167
167
|
onGroupToggle: GroupToggle;
|
|
168
168
|
onItemActivate: ItemActivate;
|
|
169
169
|
disabled: boolean;
|
|
170
|
-
hasExpandableGroups: boolean;
|
|
171
170
|
expandToViewport?: boolean;
|
|
172
171
|
variant?: ItemListProps['variant'];
|
|
173
172
|
}
|
|
@@ -193,7 +192,6 @@ export interface ItemProps {
|
|
|
193
192
|
first?: boolean;
|
|
194
193
|
last: boolean;
|
|
195
194
|
hasCategoryHeader: boolean;
|
|
196
|
-
hasExpandableGroups: boolean;
|
|
197
195
|
isKeyboardHighlighted?: boolean;
|
|
198
196
|
variant?: ItemListProps['variant'];
|
|
199
197
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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AAC;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":"lib/default/","sources":["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 * 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 hasExpandableGroups: 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 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 last: boolean;\n hasCategoryHeader: boolean;\n hasExpandableGroups: 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":"lib/default/","sources":["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 * 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 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 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 last: 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, first, last, hasCategoryHeader,
|
|
4
|
+
declare const ItemElement: ({ item, disabled, onItemActivate, highlighted, highlightItem, first, last, 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":"lib/default/","sources":["button-dropdown/item-element/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAK1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["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,oIAWd,SAAS,gBAsCX,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,IAAI,GAAG;IACzD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AA4FF,eAAe,WAAW,CAAC"}
|
|
@@ -10,11 +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
|
-
|
|
14
|
-
import { useVisualRefresh } from '../../internal/hooks/use-visual-mode';
|
|
15
|
-
const ItemElement = ({ item, disabled, onItemActivate, highlighted, highlightItem, first = false, last, hasCategoryHeader, hasExpandableGroups, isKeyboardHighlighted = false, variant = 'normal', }) => {
|
|
16
|
-
const isMobile = useMobile();
|
|
17
|
-
const isVisualRefresh = useVisualRefresh();
|
|
13
|
+
const ItemElement = ({ item, disabled, onItemActivate, highlighted, highlightItem, first = false, last, hasCategoryHeader, isKeyboardHighlighted = false, variant = 'normal', }) => {
|
|
18
14
|
const isLink = isLinkItem(item);
|
|
19
15
|
const onClick = (event) => {
|
|
20
16
|
// Stop propagation to parent node and handle event exclusively in here. This ensures
|
|
@@ -36,7 +32,6 @@ const ItemElement = ({ item, disabled, onItemActivate, highlighted, highlightIte
|
|
|
36
32
|
[styles.first]: first,
|
|
37
33
|
[styles.last]: last,
|
|
38
34
|
[styles['has-category-header']]: hasCategoryHeader,
|
|
39
|
-
[styles['show-divider']]: last && (!hasExpandableGroups || isMobile || !isVisualRefresh),
|
|
40
35
|
[styles['is-focused']]: isKeyboardHighlighted,
|
|
41
36
|
}), role: "presentation", "data-testid": item.id, "data-description": item.description, onClick: onClick, onMouseEnter: onHover, onTouchStart: onHover },
|
|
42
37
|
React.createElement(MenuItem, { item: item, disabled: disabled, highlighted: highlighted })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["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;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,MAAM,WAAW,GAAG,CAAC,EACnB,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,WAAW,EACX,aAAa,EACb,KAAK,GAAG,KAAK,EACb,IAAI,EACJ,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,GAAG,KAAK,EAC7B,OAAO,GAAG,QAAQ,GACR,EAAE,EAAE;IACd,MAAM,QAAQ,GAAG,SAAS,EAAE,CAAC;IAC7B,MAAM,eAAe,GAAG,gBAAgB,EAAE,CAAC;IAE3C,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,OAAO,GAAG,CAAC,KAAuB,EAAE,EAAE;QAC1C,qFAAqF;QACrF,kEAAkE;QAClE,KAAK,C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AY,oBAAK,KAAK,EAAI,CACtB,CACR,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAA6C,EAAE,EAAE;IAC1F,MAAM,IAAI,GAAG,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAC,UAAU,GAAG,CAAC;IACzF,OAAO,CACL,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';\nimport { useMobile } from '../../internal/hooks/use-mobile';\nimport { useVisualRefresh } from '../../internal/hooks/use-visual-mode';\n\nconst ItemElement = ({\n item,\n disabled,\n onItemActivate,\n highlighted,\n highlightItem,\n first = false,\n last,\n hasCategoryHeader,\n hasExpandableGroups,\n isKeyboardHighlighted = false,\n variant = 'normal',\n}: ItemProps) => {\n const isMobile = useMobile();\n const isVisualRefresh = useVisualRefresh();\n\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.first]: first,\n [styles.last]: last,\n [styles['has-category-header']]: hasCategoryHeader,\n [styles['show-divider']]: last && (!hasExpandableGroups || isMobile || !isVisualRefresh),\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
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["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,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C,QAAQ,EACnB,GAAG,EAAE,IAAI,CAAC,OAAO,EACjB,GAAG,EAAE,IAAI,CAAC,OAAO,EACjB,GAAG,EAAE,IAAI,CAAC,OAAO,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,GACjB,CACH;QAAE,GAAG;QACL,IAAI,CAAC,IAAI;;QAAG,WAAW,IAAI,oBAAC,YAAY,IAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,qBAAqB,GAAI,CACtG,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,CACjD,8BAAM,SAAS,EAAE,MAAM,CAAC,IAAI;IAC1B,oBAAC,YAAY,oBAAK,KAAK,EAAI,CACtB,CACR,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAA6C,EAAE,EAAE;IAC1F,MAAM,IAAI,GAAG,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAC,UAAU,GAAG,CAAC;IACzF,OAAO,CACL,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 first = false,\n last,\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.first]: first,\n [styles.last]: last,\n [styles['has-category-header']]: hasCategoryHeader,\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,20 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"item-element": "awsui_item-
|
|
5
|
-
"disabled": "
|
|
6
|
-
"
|
|
7
|
-
"highlighted": "
|
|
8
|
-
"variant-icon": "awsui_variant-
|
|
9
|
-
"variant-inline-icon": "awsui_variant-inline-
|
|
10
|
-
"variant-normal": "awsui_variant-
|
|
11
|
-
"variant-primary": "awsui_variant-
|
|
12
|
-
"is-focused": "awsui_is-
|
|
13
|
-
"variant-navigation": "awsui_variant-
|
|
14
|
-
"first": "
|
|
15
|
-
"has-category-header": "awsui_has-category-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"icon": "
|
|
19
|
-
"external-icon": "awsui_external-icon_93a1u_qlb83_170"
|
|
4
|
+
"item-element": "awsui_item-element_93a1u_pd24x_93",
|
|
5
|
+
"disabled": "awsui_disabled_93a1u_pd24x_103",
|
|
6
|
+
"last": "awsui_last_93a1u_pd24x_110",
|
|
7
|
+
"highlighted": "awsui_highlighted_93a1u_pd24x_113",
|
|
8
|
+
"variant-icon": "awsui_variant-icon_93a1u_pd24x_117",
|
|
9
|
+
"variant-inline-icon": "awsui_variant-inline-icon_93a1u_pd24x_117",
|
|
10
|
+
"variant-normal": "awsui_variant-normal_93a1u_pd24x_117",
|
|
11
|
+
"variant-primary": "awsui_variant-primary_93a1u_pd24x_117",
|
|
12
|
+
"is-focused": "awsui_is-focused_93a1u_pd24x_127",
|
|
13
|
+
"variant-navigation": "awsui_variant-navigation_93a1u_pd24x_131",
|
|
14
|
+
"first": "awsui_first_93a1u_pd24x_134",
|
|
15
|
+
"has-category-header": "awsui_has-category-header_93a1u_pd24x_134",
|
|
16
|
+
"menu-item": "awsui_menu-item_93a1u_pd24x_148",
|
|
17
|
+
"icon": "awsui_icon_93a1u_pd24x_165",
|
|
18
|
+
"external-icon": "awsui_external-icon_93a1u_pd24x_170"
|
|
20
19
|
};
|
|
21
20
|
|
|
@@ -90,7 +90,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.awsui_item-
|
|
93
|
+
.awsui_item-element_93a1u_pd24x_93:not(#\9) {
|
|
94
94
|
position: relative;
|
|
95
95
|
z-index: 1;
|
|
96
96
|
border: var(--border-item-width-yel47s, 2px) solid transparent;
|
|
@@ -100,52 +100,52 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
100
100
|
margin-top: calc(-1 * var(--border-field-width-09w7vk, 2px));
|
|
101
101
|
cursor: pointer;
|
|
102
102
|
}
|
|
103
|
-
.awsui_item-
|
|
103
|
+
.awsui_item-element_93a1u_pd24x_93.awsui_disabled_93a1u_pd24x_103:not(#\9) {
|
|
104
104
|
cursor: default;
|
|
105
105
|
color: var(--color-text-dropdown-item-disabled-6oq3n6, #9ba7b6);
|
|
106
106
|
}
|
|
107
|
-
.awsui_item-
|
|
107
|
+
.awsui_item-element_93a1u_pd24x_93:not(#\9):first-child {
|
|
108
108
|
margin-top: 0;
|
|
109
109
|
}
|
|
110
|
-
.awsui_item-
|
|
110
|
+
.awsui_item-element_93a1u_pd24x_93.awsui_last_93a1u_pd24x_110:not(#\9) {
|
|
111
111
|
border-bottom: var(--border-item-width-yel47s, 2px) solid var(--color-border-dropdown-group-yakmix, #b6bec9);
|
|
112
112
|
}
|
|
113
|
-
.awsui_item-
|
|
113
|
+
.awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113:not(#\9) {
|
|
114
114
|
color: var(--color-text-dropdown-item-highlighted-a51hdb, #000716);
|
|
115
115
|
z-index: 2;
|
|
116
116
|
}
|
|
117
|
-
.awsui_item-
|
|
117
|
+
.awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113.awsui_variant-icon_93a1u_pd24x_117:not(#\9), .awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113.awsui_variant-inline-icon_93a1u_pd24x_117:not(#\9), .awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113.awsui_variant-normal_93a1u_pd24x_117:not(#\9), .awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113.awsui_variant-primary_93a1u_pd24x_117:not(#\9) {
|
|
118
118
|
background-color: var(--color-background-dropdown-item-hover-swsulg, #f4f4f4);
|
|
119
119
|
border-color: var(--color-border-dropdown-item-hover-461g78, #7d8998);
|
|
120
120
|
border-radius: var(--border-radius-item-05df9h, 8px);
|
|
121
121
|
}
|
|
122
|
-
.awsui_item-
|
|
122
|
+
.awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113.awsui_variant-icon_93a1u_pd24x_117.awsui_disabled_93a1u_pd24x_103:not(#\9), .awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113.awsui_variant-inline-icon_93a1u_pd24x_117.awsui_disabled_93a1u_pd24x_103:not(#\9), .awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113.awsui_variant-normal_93a1u_pd24x_117.awsui_disabled_93a1u_pd24x_103:not(#\9), .awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113.awsui_variant-primary_93a1u_pd24x_117.awsui_disabled_93a1u_pd24x_103:not(#\9) {
|
|
123
123
|
color: var(--color-text-dropdown-item-dimmed-f2joj8, #9ba7b6);
|
|
124
124
|
border-color: var(--color-border-dropdown-item-dimmed-hover-xdu0hf, #7d8998);
|
|
125
125
|
background-color: var(--color-background-dropdown-item-dimmed-dlm6wk, transparent);
|
|
126
126
|
}
|
|
127
|
-
.awsui_item-
|
|
127
|
+
.awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113.awsui_variant-icon_93a1u_pd24x_117.awsui_is-focused_93a1u_pd24x_127:not(#\9), .awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113.awsui_variant-inline-icon_93a1u_pd24x_117.awsui_is-focused_93a1u_pd24x_127:not(#\9), .awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113.awsui_variant-normal_93a1u_pd24x_117.awsui_is-focused_93a1u_pd24x_127:not(#\9), .awsui_item-element_93a1u_pd24x_93.awsui_highlighted_93a1u_pd24x_113.awsui_variant-primary_93a1u_pd24x_117.awsui_is-focused_93a1u_pd24x_127:not(#\9) {
|
|
128
128
|
border-color: var(--color-border-dropdown-item-focused-5hbaf3, #414d5c);
|
|
129
129
|
box-shadow: inset 0 0 0 var(--border-control-focus-ring-shadow-spread-0ctpjf, 0px) var(--color-border-item-focused-b2ntyl, #0972d3);
|
|
130
130
|
}
|
|
131
|
-
.awsui_item-
|
|
131
|
+
.awsui_item-element_93a1u_pd24x_93.awsui_variant-navigation_93a1u_pd24x_131.awsui_highlighted_93a1u_pd24x_113:not(#\9) {
|
|
132
132
|
color: var(--color-text-accent-n2acxv, #0972d3);
|
|
133
133
|
}
|
|
134
|
-
.awsui_item-
|
|
134
|
+
.awsui_item-element_93a1u_pd24x_93.awsui_variant-navigation_93a1u_pd24x_131.awsui_first_93a1u_pd24x_134:not(#\9):not(.awsui_has-category-header_93a1u_pd24x_134) {
|
|
135
135
|
padding-top: var(--space-xxs-p8yyaw, 4px);
|
|
136
136
|
}
|
|
137
|
-
.awsui_item-
|
|
137
|
+
.awsui_item-element_93a1u_pd24x_93.awsui_variant-navigation_93a1u_pd24x_131.awsui_last_93a1u_pd24x_110:not(#\9) {
|
|
138
138
|
padding-bottom: var(--space-xxs-p8yyaw, 4px);
|
|
139
139
|
}
|
|
140
|
-
.awsui_item-
|
|
140
|
+
.awsui_item-element_93a1u_pd24x_93.awsui_variant-navigation_93a1u_pd24x_131.awsui_first_93a1u_pd24x_134.awsui_last_93a1u_pd24x_110:not(#\9) {
|
|
141
141
|
padding-bottom: var(--space-xxs-p8yyaw, 4px);
|
|
142
142
|
padding-top: var(--space-xxs-p8yyaw, 4px);
|
|
143
143
|
}
|
|
144
|
-
.awsui_item-
|
|
144
|
+
.awsui_item-element_93a1u_pd24x_93.awsui_variant-navigation_93a1u_pd24x_131.awsui_last_93a1u_pd24x_110:not(#\9):last-child {
|
|
145
145
|
padding-bottom: var(--space-xxs-p8yyaw, 4px);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
.awsui_menu-
|
|
148
|
+
.awsui_menu-item_93a1u_pd24x_148:not(#\9) {
|
|
149
149
|
min-width: 0;
|
|
150
150
|
word-break: break-word;
|
|
151
151
|
display: flex;
|
|
@@ -155,18 +155,18 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
155
155
|
text-decoration: none;
|
|
156
156
|
/* stylelint-disable-next-line selector-max-type */
|
|
157
157
|
}
|
|
158
|
-
.awsui_menu-
|
|
158
|
+
.awsui_menu-item_93a1u_pd24x_148:not(#\9):focus {
|
|
159
159
|
outline: none;
|
|
160
160
|
}
|
|
161
|
-
.awsui_has-category-
|
|
161
|
+
.awsui_has-category-header_93a1u_pd24x_134 > .awsui_menu-item_93a1u_pd24x_148:not(#\9), .awsui_has-category-header_93a1u_pd24x_134 > span > .awsui_menu-item_93a1u_pd24x_148:not(#\9) {
|
|
162
162
|
padding-left: calc(var(--space-s-34lx8l, 12px) + var(--space-button-horizontal-8jxzea, 20px));
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
.
|
|
165
|
+
.awsui_icon_93a1u_pd24x_165:not(#\9) {
|
|
166
166
|
padding-right: var(--space-xs-zb16t3, 8px);
|
|
167
167
|
flex-shrink: 0;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
.awsui_external-
|
|
170
|
+
.awsui_external-icon_93a1u_pd24x_170:not(#\9) {
|
|
171
171
|
margin-left: var(--space-xxs-p8yyaw, 4px);
|
|
172
172
|
}
|
|
@@ -2,21 +2,20 @@
|
|
|
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
|
-
"
|
|
8
|
-
"highlighted": "
|
|
9
|
-
"variant-icon": "awsui_variant-
|
|
10
|
-
"variant-inline-icon": "awsui_variant-inline-
|
|
11
|
-
"variant-normal": "awsui_variant-
|
|
12
|
-
"variant-primary": "awsui_variant-
|
|
13
|
-
"is-focused": "awsui_is-
|
|
14
|
-
"variant-navigation": "awsui_variant-
|
|
15
|
-
"first": "
|
|
16
|
-
"has-category-header": "awsui_has-category-
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"icon": "
|
|
20
|
-
"external-icon": "awsui_external-icon_93a1u_qlb83_170"
|
|
5
|
+
"item-element": "awsui_item-element_93a1u_pd24x_93",
|
|
6
|
+
"disabled": "awsui_disabled_93a1u_pd24x_103",
|
|
7
|
+
"last": "awsui_last_93a1u_pd24x_110",
|
|
8
|
+
"highlighted": "awsui_highlighted_93a1u_pd24x_113",
|
|
9
|
+
"variant-icon": "awsui_variant-icon_93a1u_pd24x_117",
|
|
10
|
+
"variant-inline-icon": "awsui_variant-inline-icon_93a1u_pd24x_117",
|
|
11
|
+
"variant-normal": "awsui_variant-normal_93a1u_pd24x_117",
|
|
12
|
+
"variant-primary": "awsui_variant-primary_93a1u_pd24x_117",
|
|
13
|
+
"is-focused": "awsui_is-focused_93a1u_pd24x_127",
|
|
14
|
+
"variant-navigation": "awsui_variant-navigation_93a1u_pd24x_131",
|
|
15
|
+
"first": "awsui_first_93a1u_pd24x_134",
|
|
16
|
+
"has-category-header": "awsui_has-category-header_93a1u_pd24x_134",
|
|
17
|
+
"menu-item": "awsui_menu-item_93a1u_pd24x_148",
|
|
18
|
+
"icon": "awsui_icon_93a1u_pd24x_165",
|
|
19
|
+
"external-icon": "awsui_external-icon_93a1u_pd24x_170"
|
|
21
20
|
};
|
|
22
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items-list.d.ts","sourceRoot":"lib/default/","sources":["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,aAAa,EACb,gBAAwB,EACxB,mBAA2B,EAC3B,iBAAyB,EACzB,gBAAwB,EACxB,OAAkB,GACnB,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"items-list.d.ts","sourceRoot":"lib/default/","sources":["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,aAAa,EACb,gBAAwB,EACxB,mBAA2B,EAC3B,iBAAyB,EACzB,gBAAwB,EACxB,OAAkB,GACnB,EAAE,aAAa,eAyEf"}
|
|
@@ -12,12 +12,12 @@ 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
|
-
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, first: index === 0 || isItemGroup(items[index - 1]), last: index === items.length - 1 || isItemGroup(items[index + 1]), hasCategoryHeader: hasCategoryHeader,
|
|
15
|
+
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, first: index === 0 || isItemGroup(items[index - 1]), last: index === items.length - 1 || isItemGroup(items[index + 1]), hasCategoryHeader: hasCategoryHeader, variant: variant }));
|
|
16
16
|
}
|
|
17
17
|
if (hasExpandableGroups) {
|
|
18
|
-
return item.text ? (isMobile ? (React.createElement(MobileExpandableCategoryElement, { key: index, item: item, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, highlightItem: highlightItem, disabled: (_b = item.disabled) !== null && _b !== void 0 ? _b : false, variant: variant
|
|
18
|
+
return item.text ? (isMobile ? (React.createElement(MobileExpandableCategoryElement, { key: index, item: item, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, 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, highlightItem: highlightItem, disabled: (_c = item.disabled) !== null && _c !== void 0 ? _c : false, expandToViewport: expandToViewport, variant: variant }))) : null;
|
|
19
19
|
}
|
|
20
|
-
return (React.createElement(CategoryElement, { key: index, item: item, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, highlightItem: highlightItem, disabled: (_d = item.disabled) !== null && _d !== void 0 ? _d : false, variant: variant
|
|
20
|
+
return (React.createElement(CategoryElement, { key: index, item: item, onItemActivate: onItemActivate, onGroupToggle: onGroupToggle, targetItem: targetItem, isHighlighted: isHighlighted, isKeyboardHighlight: isKeyboardHighlight, isExpanded: isExpanded, highlightItem: highlightItem, disabled: (_d = item.disabled) !== null && _d !== void 0 ? _d : false, variant: variant }));
|
|
21
21
|
});
|
|
22
22
|
return React.createElement(React.Fragment, null, elements);
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"items-list.js","sourceRoot":"lib/default/","sources":["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,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,OAAO,CACL,oBAAC,WAAW,IACV,GAAG,EAAE,KAAK,EACV,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,MAAA,IAAI,CAAC,QAAQ,mCAAI,gBAAgB,EAC3C,WAAW,EAAE,aAAa,CAAC,IAAI,CAAC,EAChC,qBA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,MAAA,IAAI,CAAC,QAAQ,mCAAI,KAAK,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,OAAO,GAChB,CACH,CACF,CAAC,CAAC,CAAC,IAAI,CAAC;SACV;QACD,OAAO,CACL,oBAAC,eAAe,IACd,GAAG,EAAE,KAAK,EACV,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,UAAU,EACtB,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 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 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 first={index === 0 || isItemGroup(items[index - 1])}\n last={index === items.length - 1 || isItemGroup(items[index + 1])}\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 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 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 highlightItem={highlightItem}\n disabled={item.disabled ?? false}\n variant={variant}\n />\n );\n });\n\n return <>{elements}</>;\n}\n"]}
|
package/internal/environment.js
CHANGED
package/internal/manifest.json
CHANGED
package/package.json
CHANGED