@cloudscape-design/components 3.0.263 → 3.0.265
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/attribute-editor/interfaces.d.ts +3 -2
- package/attribute-editor/interfaces.d.ts.map +1 -1
- package/attribute-editor/interfaces.js.map +1 -1
- package/attribute-editor/row.d.ts.map +1 -1
- package/attribute-editor/row.js +2 -1
- package/attribute-editor/row.js.map +1 -1
- package/autosuggest/options-controller.d.ts +1 -1
- package/autosuggest/options-controller.d.ts.map +1 -1
- package/autosuggest/options-controller.js +22 -23
- package/autosuggest/options-controller.js.map +1 -1
- package/autosuggest/options-list.d.ts.map +1 -1
- package/autosuggest/options-list.js +1 -2
- package/autosuggest/options-list.js.map +1 -1
- package/button/internal.d.ts +0 -1
- package/button/internal.d.ts.map +1 -1
- package/button/internal.js +1 -3
- package/button/internal.js.map +1 -1
- package/button/styles.css.js +18 -20
- package/button/styles.scoped.css +136 -298
- package/button/styles.selectors.js +18 -20
- package/collection-preferences/content-display/styles.css.js +15 -15
- package/collection-preferences/content-display/styles.scoped.css +24 -24
- package/collection-preferences/content-display/styles.selectors.js +15 -15
- package/collection-preferences/styles.css.js +36 -36
- package/collection-preferences/styles.scoped.css +46 -46
- package/collection-preferences/styles.selectors.js +36 -36
- package/expandable-section/expandable-section-header.js +1 -1
- package/expandable-section/expandable-section-header.js.map +1 -1
- package/expandable-section/styles.css.js +24 -23
- package/expandable-section/styles.scoped.css +66 -44
- package/expandable-section/styles.selectors.js +24 -23
- package/file-upload/file-input/index.d.ts.map +1 -1
- package/file-upload/file-input/index.js +2 -1
- package/file-upload/file-input/index.js.map +1 -1
- package/file-upload/file-input/styles.css.js +4 -3
- package/file-upload/file-input/styles.scoped.css +107 -4
- package/file-upload/file-input/styles.selectors.js +4 -3
- package/internal/components/autosuggest-input/index.js +1 -1
- package/internal/components/autosuggest-input/index.js.map +1 -1
- package/internal/components/options-list/utils/test-indexes.d.ts +1 -1
- package/internal/components/options-list/utils/test-indexes.d.ts.map +1 -1
- package/internal/components/options-list/utils/test-indexes.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/tag-editor/index.d.ts.map +1 -1
- package/tag-editor/index.js +6 -1
- package/tag-editor/index.js.map +1 -1
- package/tag-editor/interfaces.d.ts +1 -0
- package/tag-editor/interfaces.d.ts.map +1 -1
- package/tag-editor/interfaces.js.map +1 -1
|
@@ -2,41 +2,41 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"visible-content": "awsui_visible-
|
|
6
|
-
"visible-content-toggle": "awsui_visible-content-
|
|
7
|
-
"visible-content-groups": "awsui_visible-content-
|
|
8
|
-
"visible-content-group": "awsui_visible-content-
|
|
9
|
-
"visible-content-title": "awsui_visible-content-
|
|
10
|
-
"visible-content-group-label": "awsui_visible-content-group-
|
|
11
|
-
"visible-content-option": "awsui_visible-content-
|
|
12
|
-
"visible-content-option-label": "awsui_visible-content-option-
|
|
13
|
-
"sortable-item-toggle": "awsui_sortable-item-
|
|
14
|
-
"sortable-item": "awsui_sortable-
|
|
15
|
-
"sortable-item-placeholder": "awsui_sortable-item-
|
|
16
|
-
"sortable-item-content": "awsui_sortable-item-
|
|
17
|
-
"draggable": "
|
|
18
|
-
"active": "
|
|
19
|
-
"sorting": "
|
|
20
|
-
"sortable-item-label": "awsui_sortable-item-
|
|
21
|
-
"content-display": "awsui_content-
|
|
22
|
-
"content-display-groups": "awsui_content-display-
|
|
23
|
-
"content-display-group": "awsui_content-display-
|
|
24
|
-
"content-display-option": "awsui_content-display-
|
|
25
|
-
"content-display-title": "awsui_content-display-
|
|
26
|
-
"content-display-description": "awsui_content-display-
|
|
27
|
-
"content-display-option-list": "awsui_content-display-option-
|
|
28
|
-
"root": "
|
|
29
|
-
"modal-root": "awsui_modal-
|
|
30
|
-
"trigger-button": "awsui_trigger-
|
|
31
|
-
"cancel-button": "awsui_cancel-
|
|
32
|
-
"confirm-button": "awsui_confirm-
|
|
33
|
-
"custom": "
|
|
34
|
-
"second-column-small": "awsui_second-column-
|
|
35
|
-
"wrap-lines": "awsui_wrap-
|
|
36
|
-
"striped-rows": "awsui_striped-
|
|
37
|
-
"content-density": "awsui_content-
|
|
38
|
-
"page-size": "awsui_page-
|
|
39
|
-
"page-size-form-field": "awsui_page-size-form-
|
|
40
|
-
"page-size-radio-group": "awsui_page-size-radio-
|
|
5
|
+
"visible-content": "awsui_visible-content_tc96w_1m6re_185",
|
|
6
|
+
"visible-content-toggle": "awsui_visible-content-toggle_tc96w_1m6re_186",
|
|
7
|
+
"visible-content-groups": "awsui_visible-content-groups_tc96w_1m6re_187",
|
|
8
|
+
"visible-content-group": "awsui_visible-content-group_tc96w_1m6re_187",
|
|
9
|
+
"visible-content-title": "awsui_visible-content-title_tc96w_1m6re_192",
|
|
10
|
+
"visible-content-group-label": "awsui_visible-content-group-label_tc96w_1m6re_201",
|
|
11
|
+
"visible-content-option": "awsui_visible-content-option_tc96w_1m6re_207",
|
|
12
|
+
"visible-content-option-label": "awsui_visible-content-option-label_tc96w_1m6re_218",
|
|
13
|
+
"sortable-item-toggle": "awsui_sortable-item-toggle_tc96w_1m6re_409",
|
|
14
|
+
"sortable-item": "awsui_sortable-item_tc96w_1m6re_409",
|
|
15
|
+
"sortable-item-placeholder": "awsui_sortable-item-placeholder_tc96w_1m6re_417",
|
|
16
|
+
"sortable-item-content": "awsui_sortable-item-content_tc96w_1m6re_427",
|
|
17
|
+
"draggable": "awsui_draggable_tc96w_1m6re_437",
|
|
18
|
+
"active": "awsui_active_tc96w_1m6re_446",
|
|
19
|
+
"sorting": "awsui_sorting_tc96w_1m6re_452",
|
|
20
|
+
"sortable-item-label": "awsui_sortable-item-label_tc96w_1m6re_495",
|
|
21
|
+
"content-display": "awsui_content-display_tc96w_1m6re_500",
|
|
22
|
+
"content-display-groups": "awsui_content-display-groups_tc96w_1m6re_501",
|
|
23
|
+
"content-display-group": "awsui_content-display-group_tc96w_1m6re_501",
|
|
24
|
+
"content-display-option": "awsui_content-display-option_tc96w_1m6re_503",
|
|
25
|
+
"content-display-title": "awsui_content-display-title_tc96w_1m6re_507",
|
|
26
|
+
"content-display-description": "awsui_content-display-description_tc96w_1m6re_515",
|
|
27
|
+
"content-display-option-list": "awsui_content-display-option-list_tc96w_1m6re_523",
|
|
28
|
+
"root": "awsui_root_tc96w_1m6re_529",
|
|
29
|
+
"modal-root": "awsui_modal-root_tc96w_1m6re_530",
|
|
30
|
+
"trigger-button": "awsui_trigger-button_tc96w_1m6re_531",
|
|
31
|
+
"cancel-button": "awsui_cancel-button_tc96w_1m6re_532",
|
|
32
|
+
"confirm-button": "awsui_confirm-button_tc96w_1m6re_533",
|
|
33
|
+
"custom": "awsui_custom_tc96w_1m6re_534",
|
|
34
|
+
"second-column-small": "awsui_second-column-small_tc96w_1m6re_538",
|
|
35
|
+
"wrap-lines": "awsui_wrap-lines_tc96w_1m6re_542",
|
|
36
|
+
"striped-rows": "awsui_striped-rows_tc96w_1m6re_543",
|
|
37
|
+
"content-density": "awsui_content-density_tc96w_1m6re_544",
|
|
38
|
+
"page-size": "awsui_page-size_tc96w_1m6re_545",
|
|
39
|
+
"page-size-form-field": "awsui_page-size-form-field_tc96w_1m6re_546",
|
|
40
|
+
"page-size-radio-group": "awsui_page-size-radio-group_tc96w_1m6re_547"
|
|
41
41
|
};
|
|
42
42
|
|
|
@@ -28,7 +28,7 @@ const ExpandableContainerHeader = ({ id, className, onClick, ariaLabel, ariaCont
|
|
|
28
28
|
};
|
|
29
29
|
return (React.createElement("div", { id: id, className: className, onClick: onClick },
|
|
30
30
|
React.createElement(Wrapper, null,
|
|
31
|
-
React.createElement("span", { className: styles['header-container-button'], role: "button", tabIndex: 0, onKeyUp: onKeyUp, onKeyDown: onKeyDown, "aria-label": ariaLabel, "aria-labelledby": ariaLabel || !isContainer ? undefined : screenreaderContentId, "aria-controls": ariaControls, "aria-expanded": expanded },
|
|
31
|
+
React.createElement("span", { className: isContainer ? styles['header-container-button'] : styles['header-button'], role: "button", tabIndex: 0, onKeyUp: onKeyUp, onKeyDown: onKeyDown, "aria-label": ariaLabel, "aria-labelledby": ariaLabel || !isContainer ? undefined : screenreaderContentId, "aria-controls": ariaControls, "aria-expanded": expanded },
|
|
32
32
|
React.createElement("span", { className: clsx(styles['icon-container'], styles[`icon-container-${variant}`]) }, icon),
|
|
33
33
|
React.createElement("span", null, children))),
|
|
34
34
|
isContainer && (React.createElement(ScreenreaderOnly, { id: screenreaderContentId },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandable-section-header.js","sourceRoot":"lib/default/","sources":["expandable-section/expandable-section-header.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAClF,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAoC/C,MAAM,uBAAuB,GAAG,CAAC,EAC/B,EAAE,EACF,SAAS,EACT,OAAO,EACP,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,SAAS,EACT,OAAO,GACsB,EAAE,EAAE;IACjC,OAAO,CACL,6BACE,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,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C;KACH;IAED,OAAO,CACL,oBAAC,uBAAuB,kBACtB,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,gBAAgB,EAAE,MAAM,CAAC,SAAS,EAAE,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,EAC3F,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,IAChB,kBAAkB,GAErB,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,MAAM,CACG,CAC3B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ExpandableSectionProps } from './interfaces';\nimport React, { KeyboardEventHandler, MouseEventHandler, ReactNode } from 'react';\nimport InternalIcon from '../icon/internal';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport InternalHeader from '../header/internal';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '../internal/logging';\n\ninterface ExpandableDefaultHeaderProps {\n id: string;\n className?: string;\n children?: ReactNode;\n expanded: boolean;\n ariaControls: string;\n ariaLabel?: string;\n onKeyUp: KeyboardEventHandler;\n onKeyDown: KeyboardEventHandler;\n onClick: MouseEventHandler;\n icon: JSX.Element;\n variant: ExpandableSectionProps.Variant;\n}\n\ninterface ExpandableNavigationHeaderProps extends Omit<ExpandableDefaultHeaderProps, 'onKeyUp' | 'onKeyDown'> {\n ariaLabelledBy?: string;\n}\n\ninterface ExpandableContainerHeaderProps extends ExpandableDefaultHeaderProps {\n headerDescription?: ReactNode;\n headerCounter?: string;\n headingTagOverride?: ExpandableSectionProps.HeadingTag;\n}\n\ninterface ExpandableSectionHeaderProps extends Omit<ExpandableDefaultHeaderProps, 'children' | 'icon'> {\n variant: ExpandableSectionProps.Variant;\n header?: ReactNode;\n headerText?: ReactNode;\n headerDescription?: ReactNode;\n headerCounter?: string;\n headingTagOverride?: ExpandableSectionProps.HeadingTag;\n ariaLabelledBy?: string;\n}\n\nconst ExpandableDefaultHeader = ({\n id,\n className,\n onClick,\n ariaLabel,\n ariaControls,\n expanded,\n children,\n icon,\n onKeyUp,\n onKeyDown,\n variant,\n}: ExpandableDefaultHeaderProps) => {\n return (\n <div\n id={id}\n role=\"button\"\n className={className}\n tabIndex={0}\n onKeyUp={onKeyUp}\n onKeyDown={onKeyDown}\n onClick={onClick}\n aria-label={ariaLabel}\n aria-controls={ariaControls}\n aria-expanded={expanded}\n >\n <div className={clsx(styles['icon-container'], styles[`icon-container-${variant}`])}>{icon}</div>\n {children}\n </div>\n );\n};\n\nconst ExpandableNavigationHeader = ({\n id,\n className,\n onClick,\n ariaLabelledBy,\n ariaLabel,\n ariaControls,\n expanded,\n children,\n icon,\n}: ExpandableNavigationHeaderProps) => {\n return (\n <div id={id} className={className} onClick={onClick}>\n <button\n className={styles['icon-container']}\n aria-labelledby={ariaLabelledBy}\n aria-label={ariaLabel}\n aria-controls={ariaControls}\n aria-expanded={expanded}\n type=\"button\"\n >\n {icon}\n </button>\n {children}\n </div>\n );\n};\n\nconst ExpandableContainerHeader = ({\n id,\n className,\n onClick,\n ariaLabel,\n ariaControls,\n expanded,\n children,\n icon,\n headerDescription,\n headerCounter,\n variant,\n headingTagOverride,\n onKeyUp,\n onKeyDown,\n}: ExpandableContainerHeaderProps) => {\n const screenreaderContentId = useUniqueId('expandable-section-header-content-');\n const isContainer = variant === 'container';\n\n const Wrapper = isContainer\n ? ({ children }: { children: ReactNode }) => (\n <InternalHeader\n variant=\"h2\"\n description={headerDescription}\n counter={headerCounter}\n headingTagOverride={headingTagOverride}\n >\n {children}\n </InternalHeader>\n )\n : ({ children }: { children: ReactNode }) => {\n const Tag = headingTagOverride || 'div';\n return <Tag className={styles['header-wrapper']}>{children}</Tag>;\n };\n\n return (\n <div id={id} className={className} onClick={onClick}>\n <Wrapper>\n <span\n className={styles['header-container-button']}\n role=\"button\"\n tabIndex={0}\n onKeyUp={onKeyUp}\n onKeyDown={onKeyDown}\n aria-label={ariaLabel}\n // Do not use aria-labelledby={id} but ScreenreaderOnly because safari+VO does not read headerText in this case.\n aria-labelledby={ariaLabel || !isContainer ? undefined : screenreaderContentId}\n aria-controls={ariaControls}\n aria-expanded={expanded}\n >\n <span className={clsx(styles['icon-container'], styles[`icon-container-${variant}`])}>{icon}</span>\n <span>{children}</span>\n </span>\n </Wrapper>\n {isContainer && (\n <ScreenreaderOnly id={screenreaderContentId}>\n {children} {headerCounter} {headerDescription}\n </ScreenreaderOnly>\n )}\n </div>\n );\n};\n\nexport const ExpandableSectionHeader = ({\n id,\n className,\n variant,\n header,\n headerText,\n headerDescription,\n headerCounter,\n headingTagOverride,\n expanded,\n ariaControls,\n ariaLabel,\n ariaLabelledBy,\n onKeyUp,\n onKeyDown,\n onClick,\n}: ExpandableSectionHeaderProps) => {\n const icon = (\n <InternalIcon\n size={variant === 'container' ? 'medium' : 'normal'}\n className={clsx(styles.icon, expanded && styles.expanded)}\n name=\"caret-down-filled\"\n />\n );\n const defaultHeaderProps = {\n id: id,\n icon: icon,\n expanded: expanded,\n ariaControls: ariaControls,\n ariaLabel: ariaLabel,\n onClick: onClick,\n variant,\n };\n\n const triggerClassName = clsx(styles.trigger, styles[`trigger-${variant}`], expanded && styles['trigger-expanded']);\n if (variant === 'navigation') {\n return (\n <ExpandableNavigationHeader\n className={clsx(className, triggerClassName)}\n ariaLabelledBy={ariaLabelledBy}\n {...defaultHeaderProps}\n >\n {headerText ?? header}\n </ExpandableNavigationHeader>\n );\n }\n\n if (headerText) {\n return (\n <ExpandableContainerHeader\n className={clsx(className, triggerClassName, expanded && styles.expanded)}\n headerDescription={headerDescription}\n headerCounter={headerCounter}\n headingTagOverride={headingTagOverride}\n onKeyUp={onKeyUp}\n onKeyDown={onKeyDown}\n {...defaultHeaderProps}\n >\n {headerText}\n </ExpandableContainerHeader>\n );\n }\n\n if (variant === 'container' && header && isDevelopment) {\n warnOnce(\n 'ExpandableSection',\n 'Use `headerText` instead of `header` to provide the button within the heading for a11y.'\n );\n }\n\n return (\n <ExpandableDefaultHeader\n className={clsx(className, triggerClassName, styles.focusable, expanded && styles.expanded)}\n onKeyUp={onKeyUp}\n onKeyDown={onKeyDown}\n {...defaultHeaderProps}\n >\n {headerText ?? header}\n </ExpandableDefaultHeader>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"expandable-section-header.js","sourceRoot":"lib/default/","sources":["expandable-section/expandable-section-header.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAClF,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAoC/C,MAAM,uBAAuB,GAAG,CAAC,EAC/B,EAAE,EACF,SAAS,EACT,OAAO,EACP,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,SAAS,EACT,OAAO,GACsB,EAAE,EAAE;IACjC,OAAO,CACL,6BACE,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,gBACJ,SAAS,mBACN,YAAY,mBACZ,QAAQ;QAEvB,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAC,IAA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S,EAAE,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,EAC3F,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,IAChB,kBAAkB,GAErB,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,MAAM,CACG,CAC3B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ExpandableSectionProps } from './interfaces';\nimport React, { KeyboardEventHandler, MouseEventHandler, ReactNode } from 'react';\nimport InternalIcon from '../icon/internal';\nimport clsx from 'clsx';\nimport styles from './styles.css.js';\nimport InternalHeader from '../header/internal';\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { isDevelopment } from '../internal/is-development';\nimport { warnOnce } from '../internal/logging';\n\ninterface ExpandableDefaultHeaderProps {\n id: string;\n className?: string;\n children?: ReactNode;\n expanded: boolean;\n ariaControls: string;\n ariaLabel?: string;\n onKeyUp: KeyboardEventHandler;\n onKeyDown: KeyboardEventHandler;\n onClick: MouseEventHandler;\n icon: JSX.Element;\n variant: ExpandableSectionProps.Variant;\n}\n\ninterface ExpandableNavigationHeaderProps extends Omit<ExpandableDefaultHeaderProps, 'onKeyUp' | 'onKeyDown'> {\n ariaLabelledBy?: string;\n}\n\ninterface ExpandableContainerHeaderProps extends ExpandableDefaultHeaderProps {\n headerDescription?: ReactNode;\n headerCounter?: string;\n headingTagOverride?: ExpandableSectionProps.HeadingTag;\n}\n\ninterface ExpandableSectionHeaderProps extends Omit<ExpandableDefaultHeaderProps, 'children' | 'icon'> {\n variant: ExpandableSectionProps.Variant;\n header?: ReactNode;\n headerText?: ReactNode;\n headerDescription?: ReactNode;\n headerCounter?: string;\n headingTagOverride?: ExpandableSectionProps.HeadingTag;\n ariaLabelledBy?: string;\n}\n\nconst ExpandableDefaultHeader = ({\n id,\n className,\n onClick,\n ariaLabel,\n ariaControls,\n expanded,\n children,\n icon,\n onKeyUp,\n onKeyDown,\n variant,\n}: ExpandableDefaultHeaderProps) => {\n return (\n <div\n id={id}\n role=\"button\"\n className={className}\n tabIndex={0}\n onKeyUp={onKeyUp}\n onKeyDown={onKeyDown}\n onClick={onClick}\n aria-label={ariaLabel}\n aria-controls={ariaControls}\n aria-expanded={expanded}\n >\n <div className={clsx(styles['icon-container'], styles[`icon-container-${variant}`])}>{icon}</div>\n {children}\n </div>\n );\n};\n\nconst ExpandableNavigationHeader = ({\n id,\n className,\n onClick,\n ariaLabelledBy,\n ariaLabel,\n ariaControls,\n expanded,\n children,\n icon,\n}: ExpandableNavigationHeaderProps) => {\n return (\n <div id={id} className={className} onClick={onClick}>\n <button\n className={styles['icon-container']}\n aria-labelledby={ariaLabelledBy}\n aria-label={ariaLabel}\n aria-controls={ariaControls}\n aria-expanded={expanded}\n type=\"button\"\n >\n {icon}\n </button>\n {children}\n </div>\n );\n};\n\nconst ExpandableContainerHeader = ({\n id,\n className,\n onClick,\n ariaLabel,\n ariaControls,\n expanded,\n children,\n icon,\n headerDescription,\n headerCounter,\n variant,\n headingTagOverride,\n onKeyUp,\n onKeyDown,\n}: ExpandableContainerHeaderProps) => {\n const screenreaderContentId = useUniqueId('expandable-section-header-content-');\n const isContainer = variant === 'container';\n\n const Wrapper = isContainer\n ? ({ children }: { children: ReactNode }) => (\n <InternalHeader\n variant=\"h2\"\n description={headerDescription}\n counter={headerCounter}\n headingTagOverride={headingTagOverride}\n >\n {children}\n </InternalHeader>\n )\n : ({ children }: { children: ReactNode }) => {\n const Tag = headingTagOverride || 'div';\n return <Tag className={styles['header-wrapper']}>{children}</Tag>;\n };\n\n return (\n <div id={id} className={className} onClick={onClick}>\n <Wrapper>\n <span\n className={isContainer ? styles['header-container-button'] : styles['header-button']}\n role=\"button\"\n tabIndex={0}\n onKeyUp={onKeyUp}\n onKeyDown={onKeyDown}\n aria-label={ariaLabel}\n // Do not use aria-labelledby={id} but ScreenreaderOnly because safari+VO does not read headerText in this case.\n aria-labelledby={ariaLabel || !isContainer ? undefined : screenreaderContentId}\n aria-controls={ariaControls}\n aria-expanded={expanded}\n >\n <span className={clsx(styles['icon-container'], styles[`icon-container-${variant}`])}>{icon}</span>\n <span>{children}</span>\n </span>\n </Wrapper>\n {isContainer && (\n <ScreenreaderOnly id={screenreaderContentId}>\n {children} {headerCounter} {headerDescription}\n </ScreenreaderOnly>\n )}\n </div>\n );\n};\n\nexport const ExpandableSectionHeader = ({\n id,\n className,\n variant,\n header,\n headerText,\n headerDescription,\n headerCounter,\n headingTagOverride,\n expanded,\n ariaControls,\n ariaLabel,\n ariaLabelledBy,\n onKeyUp,\n onKeyDown,\n onClick,\n}: ExpandableSectionHeaderProps) => {\n const icon = (\n <InternalIcon\n size={variant === 'container' ? 'medium' : 'normal'}\n className={clsx(styles.icon, expanded && styles.expanded)}\n name=\"caret-down-filled\"\n />\n );\n const defaultHeaderProps = {\n id: id,\n icon: icon,\n expanded: expanded,\n ariaControls: ariaControls,\n ariaLabel: ariaLabel,\n onClick: onClick,\n variant,\n };\n\n const triggerClassName = clsx(styles.trigger, styles[`trigger-${variant}`], expanded && styles['trigger-expanded']);\n if (variant === 'navigation') {\n return (\n <ExpandableNavigationHeader\n className={clsx(className, triggerClassName)}\n ariaLabelledBy={ariaLabelledBy}\n {...defaultHeaderProps}\n >\n {headerText ?? header}\n </ExpandableNavigationHeader>\n );\n }\n\n if (headerText) {\n return (\n <ExpandableContainerHeader\n className={clsx(className, triggerClassName, expanded && styles.expanded)}\n headerDescription={headerDescription}\n headerCounter={headerCounter}\n headingTagOverride={headingTagOverride}\n onKeyUp={onKeyUp}\n onKeyDown={onKeyDown}\n {...defaultHeaderProps}\n >\n {headerText}\n </ExpandableContainerHeader>\n );\n }\n\n if (variant === 'container' && header && isDevelopment) {\n warnOnce(\n 'ExpandableSection',\n 'Use `headerText` instead of `header` to provide the button within the heading for a11y.'\n );\n }\n\n return (\n <ExpandableDefaultHeader\n className={clsx(className, triggerClassName, styles.focusable, expanded && styles.expanded)}\n onKeyUp={onKeyUp}\n onKeyDown={onKeyDown}\n {...defaultHeaderProps}\n >\n {headerText ?? header}\n </ExpandableDefaultHeader>\n );\n};\n"]}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"content-enter": "awsui_content-
|
|
5
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
6
|
-
"trigger-expanded": "awsui_trigger-
|
|
7
|
-
"icon": "
|
|
8
|
-
"root": "
|
|
9
|
-
"expanded": "
|
|
10
|
-
"icon-container": "awsui_icon-
|
|
11
|
-
"icon-container-container": "awsui_icon-container-
|
|
12
|
-
"trigger": "
|
|
13
|
-
"trigger-default": "awsui_trigger-
|
|
14
|
-
"trigger-footer": "awsui_trigger-
|
|
15
|
-
"trigger-navigation": "awsui_trigger-
|
|
16
|
-
"trigger-container": "awsui_trigger-
|
|
17
|
-
"header": "
|
|
18
|
-
"header-wrapper": "awsui_header-
|
|
19
|
-
"header-
|
|
20
|
-
"header-container
|
|
21
|
-
"header-
|
|
22
|
-
"
|
|
23
|
-
"content
|
|
24
|
-
"content-
|
|
25
|
-
"content-
|
|
26
|
-
"
|
|
4
|
+
"content-enter": "awsui_content-enter_gwq0h_15y3s_97",
|
|
5
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_gwq0h_15y3s_1",
|
|
6
|
+
"trigger-expanded": "awsui_trigger-expanded_gwq0h_15y3s_119",
|
|
7
|
+
"icon": "awsui_icon_gwq0h_15y3s_133",
|
|
8
|
+
"root": "awsui_root_gwq0h_15y3s_151",
|
|
9
|
+
"expanded": "awsui_expanded_gwq0h_15y3s_171",
|
|
10
|
+
"icon-container": "awsui_icon-container_gwq0h_15y3s_175",
|
|
11
|
+
"icon-container-container": "awsui_icon-container-container_gwq0h_15y3s_180",
|
|
12
|
+
"trigger": "awsui_trigger_gwq0h_15y3s_119",
|
|
13
|
+
"trigger-default": "awsui_trigger-default_gwq0h_15y3s_193",
|
|
14
|
+
"trigger-footer": "awsui_trigger-footer_gwq0h_15y3s_196",
|
|
15
|
+
"trigger-navigation": "awsui_trigger-navigation_gwq0h_15y3s_202",
|
|
16
|
+
"trigger-container": "awsui_trigger-container_gwq0h_15y3s_216",
|
|
17
|
+
"header": "awsui_header_gwq0h_15y3s_226",
|
|
18
|
+
"header-wrapper": "awsui_header-wrapper_gwq0h_15y3s_229",
|
|
19
|
+
"header-button": "awsui_header-button_gwq0h_15y3s_236",
|
|
20
|
+
"header-container": "awsui_header-container_gwq0h_15y3s_258",
|
|
21
|
+
"header-container-button": "awsui_header-container-button_gwq0h_15y3s_273",
|
|
22
|
+
"header-navigation": "awsui_header-navigation_gwq0h_15y3s_281",
|
|
23
|
+
"content": "awsui_content_gwq0h_15y3s_97",
|
|
24
|
+
"content-default": "awsui_content-default_gwq0h_15y3s_317",
|
|
25
|
+
"content-footer": "awsui_content-footer_gwq0h_15y3s_320",
|
|
26
|
+
"content-expanded": "awsui_content-expanded_gwq0h_15y3s_323",
|
|
27
|
+
"focusable": "awsui_focusable_gwq0h_15y3s_327"
|
|
27
28
|
};
|
|
28
29
|
|
|
@@ -94,10 +94,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
94
94
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
95
95
|
SPDX-License-Identifier: Apache-2.0
|
|
96
96
|
*/
|
|
97
|
-
.awsui_content-
|
|
98
|
-
animation: awsui_awsui-motion-fade-
|
|
97
|
+
.awsui_content-enter_gwq0h_15y3s_97:not(#\9) {
|
|
98
|
+
animation: awsui_awsui-motion-fade-in_gwq0h_15y3s_1 var(--motion-duration-show-paced-7wspqf, 180ms) var(--motion-easing-show-paced-wj4ybn, ease-out);
|
|
99
99
|
}
|
|
100
|
-
@keyframes awsui_awsui-motion-fade-
|
|
100
|
+
@keyframes awsui_awsui-motion-fade-in_gwq0h_15y3s_1 {
|
|
101
101
|
from {
|
|
102
102
|
opacity: 0.2;
|
|
103
103
|
}
|
|
@@ -106,40 +106,40 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
@media (prefers-reduced-motion: reduce) {
|
|
109
|
-
.awsui_content-
|
|
109
|
+
.awsui_content-enter_gwq0h_15y3s_97:not(#\9) {
|
|
110
110
|
animation: none;
|
|
111
111
|
transition: none;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
.awsui-motion-disabled .awsui_content-
|
|
114
|
+
.awsui-motion-disabled .awsui_content-enter_gwq0h_15y3s_97:not(#\9), .awsui-mode-entering .awsui_content-enter_gwq0h_15y3s_97:not(#\9) {
|
|
115
115
|
animation: none;
|
|
116
116
|
transition: none;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
.awsui_trigger-
|
|
119
|
+
.awsui_trigger-expanded_gwq0h_15y3s_119:not(#\9) {
|
|
120
120
|
transition: border-bottom-color var(--motion-duration-show-paced-7wspqf, 180ms) var(--motion-easing-show-paced-wj4ybn, ease-out);
|
|
121
121
|
}
|
|
122
122
|
@media (prefers-reduced-motion: reduce) {
|
|
123
|
-
.awsui_trigger-
|
|
123
|
+
.awsui_trigger-expanded_gwq0h_15y3s_119:not(#\9) {
|
|
124
124
|
animation: none;
|
|
125
125
|
transition: none;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
.awsui-motion-disabled .awsui_trigger-
|
|
128
|
+
.awsui-motion-disabled .awsui_trigger-expanded_gwq0h_15y3s_119:not(#\9), .awsui-mode-entering .awsui_trigger-expanded_gwq0h_15y3s_119:not(#\9) {
|
|
129
129
|
animation: none;
|
|
130
130
|
transition: none;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
.
|
|
133
|
+
.awsui_icon_gwq0h_15y3s_133:not(#\9) {
|
|
134
134
|
transition: transform var(--motion-duration-rotate-90-ux18sr, 135ms) var(--motion-easing-rotate-90-eoew89, cubic-bezier(0.165, 0.84, 0.44, 1));
|
|
135
135
|
}
|
|
136
136
|
@media (prefers-reduced-motion: reduce) {
|
|
137
|
-
.
|
|
137
|
+
.awsui_icon_gwq0h_15y3s_133:not(#\9) {
|
|
138
138
|
animation: none;
|
|
139
139
|
transition: none;
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
|
-
.awsui-motion-disabled .
|
|
142
|
+
.awsui-motion-disabled .awsui_icon_gwq0h_15y3s_133:not(#\9), .awsui-mode-entering .awsui_icon_gwq0h_15y3s_133:not(#\9) {
|
|
143
143
|
animation: none;
|
|
144
144
|
transition: none;
|
|
145
145
|
}
|
|
@@ -148,7 +148,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
148
148
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
149
149
|
SPDX-License-Identifier: Apache-2.0
|
|
150
150
|
*/
|
|
151
|
-
.
|
|
151
|
+
.awsui_root_gwq0h_15y3s_151:not(#\9) {
|
|
152
152
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
153
153
|
border-collapse: separate;
|
|
154
154
|
border-spacing: 0;
|
|
@@ -191,23 +191,23 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
191
191
|
display: block;
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
.
|
|
194
|
+
.awsui_icon_gwq0h_15y3s_133:not(#\9) {
|
|
195
195
|
transform: rotate(-90deg);
|
|
196
196
|
}
|
|
197
|
-
.
|
|
197
|
+
.awsui_icon_gwq0h_15y3s_133.awsui_expanded_gwq0h_15y3s_171:not(#\9) {
|
|
198
198
|
transform: rotate(0deg);
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
.awsui_icon-
|
|
201
|
+
.awsui_icon-container_gwq0h_15y3s_175:not(#\9) {
|
|
202
202
|
position: relative;
|
|
203
203
|
margin-left: calc((var(--font-body-m-line-height-i7xxvv, 22px) - var(--size-icon-normal-j1z5fn, 16px)) / -2);
|
|
204
204
|
margin-right: calc(var(--space-xxs-ynfts5, 4px) + var(--border-divider-list-width-hacikr, 1px));
|
|
205
205
|
}
|
|
206
|
-
.awsui_icon-container-
|
|
206
|
+
.awsui_icon-container-container_gwq0h_15y3s_180:not(#\9) {
|
|
207
207
|
margin-right: var(--space-xs-rsr2qu, 8px);
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
.
|
|
210
|
+
.awsui_trigger_gwq0h_15y3s_119:not(#\9) {
|
|
211
211
|
cursor: pointer;
|
|
212
212
|
box-sizing: border-box;
|
|
213
213
|
display: flex;
|
|
@@ -216,19 +216,19 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
216
216
|
line-height: var(--font-body-m-line-height-i7xxvv, 22px);
|
|
217
217
|
text-align: left;
|
|
218
218
|
}
|
|
219
|
-
.awsui_trigger-
|
|
219
|
+
.awsui_trigger-default_gwq0h_15y3s_193:not(#\9) {
|
|
220
220
|
padding: var(--space-scaled-xxs-95dhkm, 4px) var(--space-xxs-ynfts5, 4px);
|
|
221
221
|
}
|
|
222
|
-
.awsui_trigger-
|
|
222
|
+
.awsui_trigger-footer_gwq0h_15y3s_196:not(#\9) {
|
|
223
223
|
padding: var(--space-scaled-xxs-95dhkm, 4px) 0;
|
|
224
224
|
}
|
|
225
|
-
.awsui_trigger-
|
|
225
|
+
.awsui_trigger-default_gwq0h_15y3s_193:not(#\9), .awsui_trigger-footer_gwq0h_15y3s_196:not(#\9) {
|
|
226
226
|
border: var(--border-divider-section-width-4wm2it, 2px) solid transparent;
|
|
227
227
|
}
|
|
228
|
-
.awsui_trigger-
|
|
228
|
+
.awsui_trigger-navigation_gwq0h_15y3s_202:not(#\9) {
|
|
229
229
|
border-left: var(--border-divider-section-width-4wm2it, 2px) solid transparent;
|
|
230
230
|
}
|
|
231
|
-
.awsui_trigger-
|
|
231
|
+
.awsui_trigger-default_gwq0h_15y3s_193:not(#\9), .awsui_trigger-navigation_gwq0h_15y3s_202:not(#\9), .awsui_trigger-footer_gwq0h_15y3s_196:not(#\9) {
|
|
232
232
|
color: var(--color-text-expandable-section-default-k03p1p, #000716);
|
|
233
233
|
font-weight: var(--font-heading-s-weight-k8ys41, 800);
|
|
234
234
|
-webkit-font-smoothing: var(--font-smoothing-webkit-vu3hx4, antialiased);
|
|
@@ -236,36 +236,58 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
236
236
|
font-size: var(--font-expandable-heading-size-m2wptt, 16px);
|
|
237
237
|
letter-spacing: var(--font-heading-s-letter-spacing-4d69jc, -0.005em);
|
|
238
238
|
}
|
|
239
|
-
.awsui_trigger-
|
|
239
|
+
.awsui_trigger-default_gwq0h_15y3s_193:not(#\9):hover, .awsui_trigger-navigation_gwq0h_15y3s_202:not(#\9):hover, .awsui_trigger-footer_gwq0h_15y3s_196:not(#\9):hover {
|
|
240
240
|
color: var(--color-text-expandable-section-hover-73g3du, #0972d3);
|
|
241
241
|
}
|
|
242
|
-
.awsui_trigger-
|
|
242
|
+
.awsui_trigger-container_gwq0h_15y3s_216:not(#\9) {
|
|
243
243
|
padding: var(--space-container-header-vertical-zsjhel, 12px) var(--space-container-horizontal-tlw03i, 20px);
|
|
244
244
|
}
|
|
245
|
-
body[data-awsui-focus-visible=true] .awsui_trigger-
|
|
245
|
+
body[data-awsui-focus-visible=true] .awsui_trigger-container_gwq0h_15y3s_216:not(#\9):focus {
|
|
246
246
|
padding: calc(var(--space-scaled-s-cu1hzn, 12px) - var(--border-divider-section-width-4wm2it, 2px)) calc(var(--space-l-4vl6xu, 20px) - var(--border-divider-section-width-4wm2it, 2px));
|
|
247
247
|
}
|
|
248
|
-
.awsui_trigger-
|
|
248
|
+
.awsui_trigger-default_gwq0h_15y3s_193.awsui_trigger-expanded_gwq0h_15y3s_119:not(#\9) {
|
|
249
249
|
border-bottom-color: var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
.
|
|
252
|
+
.awsui_header_gwq0h_15y3s_226:not(#\9) {
|
|
253
253
|
display: flex;
|
|
254
254
|
}
|
|
255
|
-
.awsui_header-
|
|
255
|
+
.awsui_header-wrapper_gwq0h_15y3s_229:not(#\9) {
|
|
256
256
|
font-weight: inherit;
|
|
257
257
|
font-size: inherit;
|
|
258
258
|
letter-spacing: inherit;
|
|
259
259
|
margin: 0;
|
|
260
260
|
padding: 0;
|
|
261
261
|
}
|
|
262
|
-
.awsui_header-
|
|
262
|
+
.awsui_header-button_gwq0h_15y3s_236:not(#\9) {
|
|
263
|
+
box-sizing: border-box;
|
|
264
|
+
display: flex;
|
|
265
|
+
}
|
|
266
|
+
body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_15y3s_236:not(#\9):focus {
|
|
267
|
+
position: relative;
|
|
268
|
+
}
|
|
269
|
+
body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_15y3s_236:not(#\9):focus {
|
|
270
|
+
outline: 2px dotted transparent;
|
|
271
|
+
outline-offset: calc(0px - 1px);
|
|
272
|
+
}
|
|
273
|
+
body[data-awsui-focus-visible=true] .awsui_header-button_gwq0h_15y3s_236:not(#\9):focus::before {
|
|
274
|
+
content: " ";
|
|
275
|
+
display: block;
|
|
276
|
+
position: absolute;
|
|
277
|
+
left: calc(-1 * 0px);
|
|
278
|
+
top: calc(-1 * 0px);
|
|
279
|
+
width: calc(100% + 2 * 0px);
|
|
280
|
+
height: calc(100% + 2 * 0px);
|
|
281
|
+
border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
|
|
282
|
+
box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
|
|
283
|
+
}
|
|
284
|
+
.awsui_header-container_gwq0h_15y3s_258:not(#\9) {
|
|
263
285
|
width: 100%;
|
|
264
286
|
}
|
|
265
|
-
.awsui_header-
|
|
287
|
+
.awsui_header-container_gwq0h_15y3s_258 > .awsui_icon-container_gwq0h_15y3s_175:not(#\9) {
|
|
266
288
|
margin-top: var(--space-expandable-section-icon-offset-top-q2xewd, 4px);
|
|
267
289
|
}
|
|
268
|
-
|
|
290
|
+
body[data-awsui-focus-visible=true] .awsui_header-container_gwq0h_15y3s_258:not(#\9):focus-within {
|
|
269
291
|
outline: none;
|
|
270
292
|
text-decoration: none;
|
|
271
293
|
padding: calc(var(--space-scaled-s-cu1hzn, 12px) - var(--border-divider-section-width-4wm2it, 2px)) calc(var(--space-l-4vl6xu, 20px) - var(--border-divider-section-width-4wm2it, 2px));
|
|
@@ -274,15 +296,15 @@ body[data-awsui-focus-visible=true] .awsui_trigger-container_gwq0h_lduum_216:not
|
|
|
274
296
|
border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
|
|
275
297
|
box-shadow: 0 0 0 var(--border-control-focus-ring-shadow-spread-srzyiu, 0px) var(--color-border-item-focused-ap3b6s, #0972d3);
|
|
276
298
|
}
|
|
277
|
-
.awsui_header-container-
|
|
299
|
+
.awsui_header-container-button_gwq0h_15y3s_273:not(#\9) {
|
|
278
300
|
box-sizing: border-box;
|
|
279
301
|
display: flex;
|
|
280
302
|
}
|
|
281
|
-
.awsui_header-container-
|
|
303
|
+
body[data-awsui-focus-visible=true] .awsui_header-container-button_gwq0h_15y3s_273:not(#\9):focus {
|
|
282
304
|
outline: none;
|
|
283
305
|
text-decoration: none;
|
|
284
306
|
}
|
|
285
|
-
.awsui_header-
|
|
307
|
+
.awsui_header-navigation_gwq0h_15y3s_281 > .awsui_icon-container_gwq0h_15y3s_175:not(#\9) {
|
|
286
308
|
display: inline-flex;
|
|
287
309
|
cursor: pointer;
|
|
288
310
|
color: var(--color-text-expandable-section-navigation-icon-default-lb9rm0, #414d5c);
|
|
@@ -293,17 +315,17 @@ body[data-awsui-focus-visible=true] .awsui_trigger-container_gwq0h_lduum_216:not
|
|
|
293
315
|
text-decoration: none;
|
|
294
316
|
flex-direction: column;
|
|
295
317
|
}
|
|
296
|
-
.awsui_header-
|
|
318
|
+
.awsui_header-navigation_gwq0h_15y3s_281 > .awsui_icon-container_gwq0h_15y3s_175:not(#\9):hover {
|
|
297
319
|
color: var(--color-text-expandable-section-hover-73g3du, #0972d3);
|
|
298
320
|
}
|
|
299
|
-
body[data-awsui-focus-visible=true] .awsui_header-
|
|
321
|
+
body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_15y3s_281 > .awsui_icon-container_gwq0h_15y3s_175:not(#\9):focus {
|
|
300
322
|
position: relative;
|
|
301
323
|
}
|
|
302
|
-
body[data-awsui-focus-visible=true] .awsui_header-
|
|
324
|
+
body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_15y3s_281 > .awsui_icon-container_gwq0h_15y3s_175:not(#\9):focus {
|
|
303
325
|
outline: 2px dotted transparent;
|
|
304
326
|
outline-offset: calc(2px - 1px);
|
|
305
327
|
}
|
|
306
|
-
body[data-awsui-focus-visible=true] .awsui_header-
|
|
328
|
+
body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_15y3s_281 > .awsui_icon-container_gwq0h_15y3s_175:not(#\9):focus::before {
|
|
307
329
|
content: " ";
|
|
308
330
|
display: block;
|
|
309
331
|
position: absolute;
|
|
@@ -315,24 +337,24 @@ body[data-awsui-focus-visible=true] .awsui_header-navigation_gwq0h_lduum_259 > .
|
|
|
315
337
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
|
|
316
338
|
}
|
|
317
339
|
|
|
318
|
-
.
|
|
340
|
+
.awsui_content_gwq0h_15y3s_97:not(#\9) {
|
|
319
341
|
display: none;
|
|
320
342
|
}
|
|
321
|
-
.awsui_content-
|
|
343
|
+
.awsui_content-default_gwq0h_15y3s_317:not(#\9) {
|
|
322
344
|
padding: var(--space-scaled-xs-6859qs, 8px) 0;
|
|
323
345
|
}
|
|
324
|
-
.awsui_content-
|
|
346
|
+
.awsui_content-footer_gwq0h_15y3s_320:not(#\9) {
|
|
325
347
|
padding: var(--space-xs-rsr2qu, 8px) 0;
|
|
326
348
|
}
|
|
327
|
-
.awsui_content-
|
|
349
|
+
.awsui_content-expanded_gwq0h_15y3s_323:not(#\9) {
|
|
328
350
|
display: block;
|
|
329
351
|
}
|
|
330
352
|
|
|
331
|
-
.
|
|
353
|
+
.awsui_focusable_gwq0h_15y3s_327:not(#\9):focus {
|
|
332
354
|
outline: none;
|
|
333
355
|
text-decoration: none;
|
|
334
356
|
}
|
|
335
|
-
body[data-awsui-focus-visible=true] .
|
|
357
|
+
body[data-awsui-focus-visible=true] .awsui_focusable_gwq0h_15y3s_327:not(#\9):focus {
|
|
336
358
|
outline: 2px dotted transparent;
|
|
337
359
|
border: var(--border-field-width-idlekx, 2px) solid var(--color-border-item-focused-ap3b6s, #0972d3);
|
|
338
360
|
border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
|
|
@@ -2,28 +2,29 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"content-enter": "awsui_content-
|
|
6
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
7
|
-
"trigger-expanded": "awsui_trigger-
|
|
8
|
-
"icon": "
|
|
9
|
-
"root": "
|
|
10
|
-
"expanded": "
|
|
11
|
-
"icon-container": "awsui_icon-
|
|
12
|
-
"icon-container-container": "awsui_icon-container-
|
|
13
|
-
"trigger": "
|
|
14
|
-
"trigger-default": "awsui_trigger-
|
|
15
|
-
"trigger-footer": "awsui_trigger-
|
|
16
|
-
"trigger-navigation": "awsui_trigger-
|
|
17
|
-
"trigger-container": "awsui_trigger-
|
|
18
|
-
"header": "
|
|
19
|
-
"header-wrapper": "awsui_header-
|
|
20
|
-
"header-
|
|
21
|
-
"header-container
|
|
22
|
-
"header-
|
|
23
|
-
"
|
|
24
|
-
"content
|
|
25
|
-
"content-
|
|
26
|
-
"content-
|
|
27
|
-
"
|
|
5
|
+
"content-enter": "awsui_content-enter_gwq0h_15y3s_97",
|
|
6
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_gwq0h_15y3s_1",
|
|
7
|
+
"trigger-expanded": "awsui_trigger-expanded_gwq0h_15y3s_119",
|
|
8
|
+
"icon": "awsui_icon_gwq0h_15y3s_133",
|
|
9
|
+
"root": "awsui_root_gwq0h_15y3s_151",
|
|
10
|
+
"expanded": "awsui_expanded_gwq0h_15y3s_171",
|
|
11
|
+
"icon-container": "awsui_icon-container_gwq0h_15y3s_175",
|
|
12
|
+
"icon-container-container": "awsui_icon-container-container_gwq0h_15y3s_180",
|
|
13
|
+
"trigger": "awsui_trigger_gwq0h_15y3s_119",
|
|
14
|
+
"trigger-default": "awsui_trigger-default_gwq0h_15y3s_193",
|
|
15
|
+
"trigger-footer": "awsui_trigger-footer_gwq0h_15y3s_196",
|
|
16
|
+
"trigger-navigation": "awsui_trigger-navigation_gwq0h_15y3s_202",
|
|
17
|
+
"trigger-container": "awsui_trigger-container_gwq0h_15y3s_216",
|
|
18
|
+
"header": "awsui_header_gwq0h_15y3s_226",
|
|
19
|
+
"header-wrapper": "awsui_header-wrapper_gwq0h_15y3s_229",
|
|
20
|
+
"header-button": "awsui_header-button_gwq0h_15y3s_236",
|
|
21
|
+
"header-container": "awsui_header-container_gwq0h_15y3s_258",
|
|
22
|
+
"header-container-button": "awsui_header-container-button_gwq0h_15y3s_273",
|
|
23
|
+
"header-navigation": "awsui_header-navigation_gwq0h_15y3s_281",
|
|
24
|
+
"content": "awsui_content_gwq0h_15y3s_97",
|
|
25
|
+
"content-default": "awsui_content-default_gwq0h_15y3s_317",
|
|
26
|
+
"content-footer": "awsui_content-footer_gwq0h_15y3s_320",
|
|
27
|
+
"content-expanded": "awsui_content-expanded_gwq0h_15y3s_323",
|
|
28
|
+
"focusable": "awsui_focusable_gwq0h_15y3s_327"
|
|
28
29
|
};
|
|
29
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["file-upload/file-input/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiE,MAAM,OAAO,CAAC;AAMtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAG5F,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["file-upload/file-input/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiE,MAAM,OAAO,CAAC;AAMtF,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAG5F,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIhD,UAAU,cAAe,SAAQ,+BAA+B;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;;AAED,wBAA2C"}
|
|
@@ -9,6 +9,7 @@ import { useUniqueId } from '../../internal/hooks/use-unique-id';
|
|
|
9
9
|
import { joinStrings } from '../../internal/utils/strings';
|
|
10
10
|
import ScreenreaderOnly from '../../internal/components/screenreader-only';
|
|
11
11
|
import useForwardFocus from '../../internal/hooks/forward-focus';
|
|
12
|
+
import clsx from 'clsx';
|
|
12
13
|
export default React.forwardRef(FileInput);
|
|
13
14
|
function FileInput(_a, ref) {
|
|
14
15
|
var _b;
|
|
@@ -49,7 +50,7 @@ function FileInput(_a, ref) {
|
|
|
49
50
|
}, [value]);
|
|
50
51
|
return (React.createElement("div", { className: styles['file-input-container'] },
|
|
51
52
|
React.createElement("input", Object.assign({ id: controlId, ref: uploadInputRef, type: "file", hidden: false, multiple: multiple, accept: accept, onChange: onUploadInputChange, onFocus: onUploadInputFocus, onBlur: onUploadInputBlur, className: styles['upload-input'] }, nativeAttributes)),
|
|
52
|
-
React.createElement(InternalButton, { iconName: "upload", formAction: "none", onClick: onUploadButtonClick, className: styles['upload-button'], __nativeAttributes: { tabIndex: -1, 'aria-hidden': true }
|
|
53
|
+
React.createElement(InternalButton, { iconName: "upload", formAction: "none", onClick: onUploadButtonClick, className: clsx(styles['upload-button'], isFocused && styles['force-focus-outline']), __nativeAttributes: { tabIndex: -1, 'aria-hidden': true } }, children),
|
|
53
54
|
React.createElement(ScreenreaderOnly, { id: uploadButtonLabelId }, children)));
|
|
54
55
|
}
|
|
55
56
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["file-upload/file-input/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtF,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,gBAAgB,MAAM,6CAA6C,CAAC;AAE3E,OAAO,eAAe,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["file-upload/file-input/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtF,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AAM,EAAE,iBAAiB,EACzB,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,IAC7B,gBAAgB,EACpB;QAIF,oBAAC,cAAc,IACb,QAAQ,EAAC,QAAQ,EACjB,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,SAAS,IAAI,MAAM,CAAC,qBAAqB,CAAC,CAAC,EACpF,kBAAkB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,IAExD,QAAQ,CACM;QAGjB,oBAAC,gBAAgB,IAAC,EAAE,EAAE,mBAAmB,IAAG,QAAQ,CAAoB,CACpE,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, { ChangeEvent, ForwardedRef, useEffect, useRef, useState } from 'react';\n\nimport InternalButton from '../../button/internal';\nimport styles from './styles.css.js';\nimport { useFormFieldContext } from '../../contexts/form-field';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { FormFieldValidationControlProps } from '../../internal/context/form-field-context';\nimport { joinStrings } from '../../internal/utils/strings';\nimport ScreenreaderOnly from '../../internal/components/screenreader-only';\nimport { FileUploadProps } from '../interfaces';\nimport useForwardFocus from '../../internal/hooks/forward-focus';\nimport clsx from 'clsx';\n\ninterface FileInputProps extends FormFieldValidationControlProps {\n accept?: string;\n ariaRequired?: boolean;\n multiple: boolean;\n value: readonly File[];\n onChange: (files: File[]) => void;\n children: React.ReactNode;\n}\n\nexport default React.forwardRef(FileInput);\n\nfunction FileInput(\n { accept, ariaRequired, multiple, value, onChange, children, ...restProps }: FileInputProps,\n ref: ForwardedRef<FileUploadProps.Ref>\n) {\n const uploadInputRef = useRef<HTMLInputElement>(null);\n const uploadButtonLabelId = useUniqueId('upload-button-label');\n const formFieldContext = useFormFieldContext(restProps);\n const selfControlId = useUniqueId('upload-input');\n const controlId = formFieldContext.controlId ?? selfControlId;\n\n useForwardFocus(ref, uploadInputRef);\n\n const [isFocused, setIsFocused] = useState(false);\n\n const onUploadButtonClick = () => uploadInputRef.current?.click();\n\n const onUploadInputFocus = () => setIsFocused(true);\n\n const onUploadInputBlur = () => setIsFocused(false);\n\n const onUploadInputChange = ({ target }: ChangeEvent<HTMLInputElement>) => {\n onChange(target.files ? Array.from(target.files) : []);\n };\n\n const nativeAttributes: Record<string, any> = {\n 'aria-labelledby': joinStrings(formFieldContext.ariaLabelledby, uploadButtonLabelId),\n 'aria-describedby': formFieldContext.ariaDescribedby,\n };\n if (formFieldContext.invalid) {\n nativeAttributes['aria-invalid'] = true;\n }\n if (ariaRequired) {\n nativeAttributes['aria-required'] = true;\n }\n\n // Synchronizing component's value with the native file input state.\n useEffect(() => {\n // The DataTransfer is not available in jsdom.\n if (window.DataTransfer) {\n const dataTransfer = new DataTransfer();\n for (const file of value) {\n dataTransfer.items.add(file);\n }\n uploadInputRef.current!.files = dataTransfer.files;\n }\n }, [value]);\n\n return (\n <div className={styles['file-input-container']}>\n {/* This is the actual interactive and accessible file-upload element. */}\n {/* It is visually hidden to achieve the desired UX design. */}\n <input\n id={controlId}\n ref={uploadInputRef}\n type=\"file\"\n hidden={false}\n multiple={multiple}\n accept={accept}\n onChange={onUploadInputChange}\n onFocus={onUploadInputFocus}\n onBlur={onUploadInputBlur}\n className={styles['upload-input']}\n {...nativeAttributes}\n />\n\n {/* The button is decorative. It dispatches clicks to the file input and is ARIA-hidden. */}\n {/* When the input is focused the focus outline is forced on the button. */}\n <InternalButton\n iconName=\"upload\"\n formAction=\"none\"\n onClick={onUploadButtonClick}\n className={clsx(styles['upload-button'], isFocused && styles['force-focus-outline'])}\n __nativeAttributes={{ tabIndex: -1, 'aria-hidden': true }}\n >\n {children}\n </InternalButton>\n\n {/* The file input needs to be labelled with provided content. Can't use the button because it is ARIA-hidden. */}\n <ScreenreaderOnly id={uploadButtonLabelId}>{children}</ScreenreaderOnly>\n </div>\n );\n}\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"upload-button": "awsui_upload-
|
|
5
|
-
"upload-input": "awsui_upload-
|
|
6
|
-
"file-input-container": "awsui_file-input-
|
|
4
|
+
"upload-button": "awsui_upload-button_4xu1k_2ymx3_93",
|
|
5
|
+
"upload-input": "awsui_upload-input_4xu1k_2ymx3_94",
|
|
6
|
+
"file-input-container": "awsui_file-input-container_4xu1k_2ymx3_98",
|
|
7
|
+
"force-focus-outline": "awsui_force-focus-outline_4xu1k_2ymx3_107"
|
|
7
8
|
};
|
|
8
9
|
|