@cloudscape-design/components-themeable 3.0.259 → 3.0.261
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/template/app-layout/visual-refresh/navigation.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh/navigation.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/tools.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh/tools.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh/tools.js.map +1 -1
- package/lib/internal/template/checkbox/interfaces.d.ts +4 -0
- package/lib/internal/template/checkbox/interfaces.d.ts.map +1 -1
- package/lib/internal/template/checkbox/interfaces.js.map +1 -1
- package/lib/internal/template/checkbox/internal.d.ts.map +1 -1
- package/lib/internal/template/checkbox/internal.js +2 -2
- package/lib/internal/template/checkbox/internal.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +12 -7
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/generated/theming/index.cjs +47 -25
- package/lib/internal/template/internal/generated/theming/index.js +47 -25
- package/lib/internal/template/s3-resource-selector/s3-modal/basic-table.d.ts.map +1 -1
- package/lib/internal/template/s3-resource-selector/s3-modal/basic-table.js +1 -1
- package/lib/internal/template/s3-resource-selector/s3-modal/basic-table.js.map +1 -1
- package/lib/internal/template/theming/index.d.ts +2 -1
- package/lib/internal/template/theming/index.d.ts.map +1 -1
- package/lib/internal/template/theming/index.js +2 -1
- package/lib/internal/template/theming/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -29,7 +29,7 @@ export default function Navigation() {
|
|
|
29
29
|
handleNavigationClick(false);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
const isUnfocusable = hasDrawerViewportOverlay && isToolsOpen && !toolsHide;
|
|
32
|
+
const isUnfocusable = hasDrawerViewportOverlay && (!isNavigationOpen || (isToolsOpen && !toolsHide));
|
|
33
33
|
return (React.createElement(Transition, { in: isNavigationOpen }, (state, transitionEventsRef) => {
|
|
34
34
|
var _a, _b, _c;
|
|
35
35
|
return (React.createElement("div", { className: clsx(styles['navigation-container'], {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/navigation.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU;IAChC,MAAM,EACJ,UAAU,EACV,qBAAqB,EACrB,wBAAwB,EACxB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,SAAS,EACT,cAAc,GACf,GAAG,qBAAqB,EAAE,CAAC;IAE5B,IAAI,cAAc,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED,0EAA0E;IAC1E,MAAM,iBAAiB,GAAG,CAAC,KAAuB,EAAE,EAAE;QACpD,MAAM,OAAO,GAAG,WAAW,CACzB,KAAK,CAAC,MAAqB,EAC3B,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,GAAG,IAAI,CAAC,CAAE,IAA0B,CAAC,IAAI,CACnE,CAAC;QACF,IAAI,OAAO,IAAI,QAAQ,EAAE;YACvB,qBAAqB,CAAC,KAAK,CAAC,CAAC;SAC9B;IACH,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,wBAAwB,IAAI,WAAW,IAAI,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/navigation.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,cAAc,MAAM,gDAAgD,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU;IAChC,MAAM,EACJ,UAAU,EACV,qBAAqB,EACrB,wBAAwB,EACxB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,SAAS,EACT,cAAc,GACf,GAAG,qBAAqB,EAAE,CAAC;IAE5B,IAAI,cAAc,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IAED,0EAA0E;IAC1E,MAAM,iBAAiB,GAAG,CAAC,KAAuB,EAAE,EAAE;QACpD,MAAM,OAAO,GAAG,WAAW,CACzB,KAAK,CAAC,MAAqB,EAC3B,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,GAAG,IAAI,CAAC,CAAE,IAA0B,CAAC,IAAI,CACnE,CAAC;QACF,IAAI,OAAO,IAAI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yright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { useAppLayoutInternals } from './context';\nimport { InternalButton } from '../../button/internal';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport { findUpUntil } from '../../internal/utils/dom';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\n/**\n * The Navigation component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the show navigation form that contains the trigger for the drawer in large viewports;\n * the navigation, or drawer, that contains the hide navigation form and the children\n * passed through the API;\n */\nexport default function Navigation() {\n const {\n ariaLabels,\n handleNavigationClick,\n hasDrawerViewportOverlay,\n isMobile,\n isNavigationOpen,\n navigation,\n navigationHide,\n navigationWidth,\n isToolsOpen,\n toolsHide,\n navigationRefs,\n } = useAppLayoutInternals();\n\n if (navigationHide) {\n return null;\n }\n\n // Close the Navigation drawer on mobile when a user clicks a link inside.\n const onNavigationClick = (event: React.MouseEvent) => {\n const hasLink = findUpUntil(\n event.target as HTMLElement,\n node => node.tagName === 'A' && !!(node as HTMLAnchorElement).href\n );\n if (hasLink && isMobile) {\n handleNavigationClick(false);\n }\n };\n\n const isUnfocusable = hasDrawerViewportOverlay && (!isNavigationOpen || (isToolsOpen && !toolsHide));\n\n return (\n <Transition in={isNavigationOpen}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['navigation-container'], {\n [testutilStyles['drawer-closed']]: !isNavigationOpen,\n [styles.unfocusable]: isUnfocusable,\n })}\n // Overwrite the default nav width (depends on breakpoints) only when the `navigationWidth` property is set.\n style={{ ...(navigationWidth && { [customCssProps.navigationWidth]: `${navigationWidth}px` }) }}\n >\n {!isMobile && (\n <nav\n aria-hidden={isMobile || isNavigationOpen ? true : false}\n aria-label={ariaLabels?.navigation ?? undefined}\n className={clsx(styles['show-navigation'], {\n [styles.animating]: state === 'exiting',\n [styles['is-navigation-open']]: isNavigationOpen,\n })}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle}\n iconName=\"menu\"\n className={testutilStyles['navigation-toggle']}\n onClick={() => handleNavigationClick(true)}\n ref={navigationRefs.toggle}\n />\n </nav>\n )}\n\n <nav\n aria-label={ariaLabels?.navigation ?? undefined}\n className={clsx(\n styles.navigation,\n {\n [styles.animating]: state === 'entering',\n [styles['is-navigation-open']]: isNavigationOpen,\n },\n testutilStyles.navigation\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n aria-hidden={!isNavigationOpen}\n onClick={event => {\n onNavigationClick && onNavigationClick(event);\n }}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-navigation'])}>\n <InternalButton\n ariaLabel={ariaLabels?.navigationClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-left'}\n onClick={() => handleNavigationClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['navigation-close']}\n ref={navigationRefs.close}\n />\n </div>\n {navigation}\n </div>\n </nav>\n </div>\n )}\n </Transition>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,UAAU,UAAU;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,UAAU,UAAU;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,UAAU,sBA+HrD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,OAAO,WAU/E"}
|
|
@@ -19,11 +19,11 @@ import customCssProps from '../../internal/generated/custom-css-properties';
|
|
|
19
19
|
* split panel in large viewports;
|
|
20
20
|
*/
|
|
21
21
|
export default function Tools({ children }) {
|
|
22
|
-
const { ariaLabels, drawers, handleSplitPanelClick, handleToolsClick, hasDefaultToolsWidth, hasDrawerViewportOverlay, isMobile,
|
|
22
|
+
const { ariaLabels, drawers, handleSplitPanelClick, handleToolsClick, hasDefaultToolsWidth, hasDrawerViewportOverlay, isMobile, isSplitPanelOpen, isToolsOpen, loseToolsFocus, splitPanelDisplayed, splitPanelPosition, splitPanelRefs, splitPanelToggle, tools, toolsHide, toolsRefs, toolsWidth, } = useAppLayoutInternals();
|
|
23
23
|
const hasSplitPanel = getSplitPanelStatus(splitPanelDisplayed, splitPanelPosition);
|
|
24
24
|
const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);
|
|
25
25
|
const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);
|
|
26
|
-
const isUnfocusable = hasDrawerViewportOverlay &&
|
|
26
|
+
const isUnfocusable = hasDrawerViewportOverlay && !isToolsOpen;
|
|
27
27
|
/**
|
|
28
28
|
* If the drawers property is defined the Tools and SplitPanel will be mounted and rendered
|
|
29
29
|
* by the Drawers component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CA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AAE;QACb,mDAAmD;QACnD,IAAI,aAAa,IAAI,CAAC,SAAS,EAAE;YAC/B,YAAY,GAAG,IAAI,CAAC;SACrB;QAED,mCAAmC;QACnC,IAAI,aAAa,IAAI,CAAC,gBAAgB,IAAI,SAAS,EAAE;YACnD,YAAY,GAAG,IAAI,CAAC;SACrB;QAED,6BAA6B;QAC7B,IAAI,CAAC,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW,EAAE;YAChD,YAAY,GAAG,IAAI,CAAC;SACrB;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAC9B,aAAsB,EACtB,gBAA0B,EAC1B,WAAqB,EACrB,SAAmB;IAEnB,IAAI,uBAAuB,GAAG,KAAK,CAAC;IAEpC,2DAA2D;IAC3D,IAAI,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,gBAAgB,IAAI,WAAW,CAAC,EAAE;QACpE,uBAAuB,GAAG,IAAI,CAAC;KAChC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../button/internal';\nimport { useAppLayoutInternals } from './context';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface ToolsProps {\n children: React.ReactNode;\n}\n\n/**\n * The Tools component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the split panel, which exists only if there is a split panel in side position;\n * the tools, or drawer, that contains the hide tools form and the children passed through the API;\n * the show tools form that contains the triggers for both the drawer and the\n * split panel in large viewports;\n */\nexport default function Tools({ children }: ToolsProps) {\n const {\n ariaLabels,\n drawers,\n handleSplitPanelClick,\n handleToolsClick,\n hasDefaultToolsWidth,\n hasDrawerViewportOverlay,\n isMobile,\n isNavigationOpen,\n isSplitPanelOpen,\n isToolsOpen,\n loseToolsFocus,\n navigationHide,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n tools,\n toolsHide,\n toolsRefs,\n toolsWidth,\n } = useAppLayoutInternals();\n\n const hasSplitPanel = getSplitPanelStatus(splitPanelDisplayed, splitPanelPosition);\n const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);\n const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);\n const isUnfocusable = hasDrawerViewportOverlay && isNavigationOpen && !navigationHide;\n\n /**\n * If the drawers property is defined the Tools and SplitPanel will be mounted and rendered\n * by the Drawers component.\n */\n if ((toolsHide && !hasSplitPanel) || drawers) {\n return null;\n }\n\n return (\n <Transition in={isToolsOpen ?? false}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['tools-container'], {\n [testutilStyles['drawer-closed']]: !isToolsOpen,\n [styles.unfocusable]: isUnfocusable,\n })}\n style={{\n [customCssProps.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`,\n // Overwrite the default tools width (depends on breakpoints) only when the `toolsWidth` property has been set.\n [customCssProps.toolsWidth]: hasDefaultToolsWidth ? '' : `${toolsWidth}px`,\n }}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseToolsFocus();\n }\n }}\n >\n {children}\n\n {!toolsHide && (\n <aside\n aria-hidden={!isToolsOpen ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles.tools,\n {\n [styles.animating]: state === 'entering',\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n [styles['is-tools-open']]: isToolsOpen,\n },\n testutilStyles.tools\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-tools'])}>\n <InternalButton\n ariaLabel={ariaLabels?.toolsClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => handleToolsClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['tools-close']}\n ref={toolsRefs.close}\n />\n </div>\n\n {tools}\n </div>\n </aside>\n )}\n\n {!isMobile && (\n <aside\n aria-hidden={!hasToolsForm ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(styles['show-tools'], {\n [styles.animating]: state === 'exiting',\n [styles['has-tools-form']]: hasToolsForm,\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n })}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n {!toolsHide && (\n <TriggerButton\n ariaLabel={ariaLabels?.toolsToggle}\n iconName=\"status-info\"\n onClick={() => handleToolsClick(!isToolsOpen)}\n selected={hasSplitPanel && isToolsOpen}\n className={testutilStyles['tools-toggle']}\n ref={toolsRefs.toggle}\n />\n )}\n\n {hasSplitPanel && splitPanelToggle.displayed && (\n <TriggerButton\n ariaLabel={splitPanelToggle.ariaLabel}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n className={splitPanelStyles['open-button']}\n ref={splitPanelRefs.toggle}\n />\n )}\n </aside>\n )}\n </div>\n )}\n </Transition>\n );\n}\n\n/**\n * Determine the default state of the Tools component. Mobile viewports should be\n * closed by default under all circumstances. If the toolsOpen prop has not been\n * set then it should be closed as well. Otherwise, default to the toolsOpen prop.\n */\nexport function getToolsDefaultState(isMobile: boolean, stateFromProps?: boolean) {\n let isToolsOpen;\n\n if (isMobile || stateFromProps === undefined) {\n isToolsOpen = false;\n } else {\n isToolsOpen = stateFromProps;\n }\n\n return isToolsOpen;\n}\n\n/**\n * This simple function returns the presence of the split panel as a child of the\n * Tools component. It must exist and be in side position.\n */\nfunction getSplitPanelStatus(splitPanelDisplayed: boolean, splitPanelPosition: string) {\n return splitPanelDisplayed && splitPanelPosition === 'side' ? true : false;\n}\n\n/**\n * By default the Tools form is styled as display: none; This behavior should\n * be unchanged in mobile viewports where the Tools form is always suppressed.\n * In large viewports, however the Tools form and its corresponding buttons\n * should be present in the UI under the below circumstances.\n */\nfunction getToolsFormStatus(\n hasSplitPanel: boolean,\n isMobile: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsForm = false;\n\n if (!isMobile) {\n // Both the Split Panel and Tools button are needed\n if (hasSplitPanel && !toolsHide) {\n hasToolsForm = true;\n }\n\n // The Split Panel button is needed\n if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {\n hasToolsForm = true;\n }\n\n // The Tools button is needed\n if (!hasSplitPanel && !toolsHide && !isToolsOpen) {\n hasToolsForm = true;\n }\n }\n\n return hasToolsForm;\n}\n\n/**\n * Under two scenarios the Tools form that contains the triggers\n * for the Tools content and the Split Panel may be persistent\n * in the UI (as opposed to disappearing when one of the drawers\n * is open). This will also add a white background as opposed to the\n * default transparent background. The buttons will present and in a\n * selected / not selected state.\n */\nfunction getToolsFormPersistence(\n hasSplitPanel: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsFormPersistence = false;\n\n // Both Tools and Split Panel exist and one or both is open\n if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) {\n hasToolsFormPersistence = true;\n }\n\n return hasToolsFormPersistence;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"lib/default/","sources":["app-layout/visual-refresh/tools.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAu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aAAa,IAAI,CAAC,gBAAgB,IAAI,SAAS,EAAE;YACnD,YAAY,GAAG,IAAI,CAAC;SACrB;QAED,6BAA6B;QAC7B,IAAI,CAAC,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,WAAW,EAAE;YAChD,YAAY,GAAG,IAAI,CAAC;SACrB;KACF;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAC9B,aAAsB,EACtB,gBAA0B,EAC1B,WAAqB,EACrB,SAAmB;IAEnB,IAAI,uBAAuB,GAAG,KAAK,CAAC;IAEpC,2DAA2D;IAC3D,IAAI,aAAa,IAAI,CAAC,SAAS,IAAI,CAAC,gBAAgB,IAAI,WAAW,CAAC,EAAE;QACpE,uBAAuB,GAAG,IAAI,CAAC;KAChC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\nimport { InternalButton } from '../../button/internal';\nimport { useAppLayoutInternals } from './context';\nimport TriggerButton from './trigger-button';\nimport styles from './styles.css.js';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport testutilStyles from '../test-classes/styles.css.js';\nimport { Transition } from '../../internal/components/transition';\nimport customCssProps from '../../internal/generated/custom-css-properties';\n\ninterface ToolsProps {\n children: React.ReactNode;\n}\n\n/**\n * The Tools component consists of the following elements:\n * the container, or root element, that sits as a direct child to the Layout grid definition;\n * the split panel, which exists only if there is a split panel in side position;\n * the tools, or drawer, that contains the hide tools form and the children passed through the API;\n * the show tools form that contains the triggers for both the drawer and the\n * split panel in large viewports;\n */\nexport default function Tools({ children }: ToolsProps) {\n const {\n ariaLabels,\n drawers,\n handleSplitPanelClick,\n handleToolsClick,\n hasDefaultToolsWidth,\n hasDrawerViewportOverlay,\n isMobile,\n isSplitPanelOpen,\n isToolsOpen,\n loseToolsFocus,\n splitPanelDisplayed,\n splitPanelPosition,\n splitPanelRefs,\n splitPanelToggle,\n tools,\n toolsHide,\n toolsRefs,\n toolsWidth,\n } = useAppLayoutInternals();\n\n const hasSplitPanel = getSplitPanelStatus(splitPanelDisplayed, splitPanelPosition);\n const hasToolsForm = getToolsFormStatus(hasSplitPanel, isMobile, isSplitPanelOpen, isToolsOpen, toolsHide);\n const hasToolsFormPersistence = getToolsFormPersistence(hasSplitPanel, isSplitPanelOpen, isToolsOpen, toolsHide);\n const isUnfocusable = hasDrawerViewportOverlay && !isToolsOpen;\n\n /**\n * If the drawers property is defined the Tools and SplitPanel will be mounted and rendered\n * by the Drawers component.\n */\n if ((toolsHide && !hasSplitPanel) || drawers) {\n return null;\n }\n\n return (\n <Transition in={isToolsOpen ?? false}>\n {(state, transitionEventsRef) => (\n <div\n className={clsx(styles['tools-container'], {\n [testutilStyles['drawer-closed']]: !isToolsOpen,\n [styles.unfocusable]: isUnfocusable,\n })}\n style={{\n [customCssProps.toolsAnimationStartingOpacity]: `${hasSplitPanel && isSplitPanelOpen ? 1 : 0}`,\n // Overwrite the default tools width (depends on breakpoints) only when the `toolsWidth` property has been set.\n [customCssProps.toolsWidth]: hasDefaultToolsWidth ? '' : `${toolsWidth}px`,\n }}\n onBlur={e => {\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n loseToolsFocus();\n }\n }}\n >\n {children}\n\n {!toolsHide && (\n <aside\n aria-hidden={!isToolsOpen ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(\n styles.tools,\n {\n [styles.animating]: state === 'entering',\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n [styles['is-tools-open']]: isToolsOpen,\n },\n testutilStyles.tools\n )}\n ref={state !== 'exiting' ? transitionEventsRef : undefined}\n >\n <div className={clsx(styles['animated-content'])}>\n <div className={clsx(styles['hide-tools'])}>\n <InternalButton\n ariaLabel={ariaLabels?.toolsClose ?? undefined}\n iconName={isMobile ? 'close' : 'angle-right'}\n onClick={() => handleToolsClick(false)}\n variant=\"icon\"\n formAction=\"none\"\n className={testutilStyles['tools-close']}\n ref={toolsRefs.close}\n />\n </div>\n\n {tools}\n </div>\n </aside>\n )}\n\n {!isMobile && (\n <aside\n aria-hidden={!hasToolsForm ? true : false}\n aria-label={ariaLabels?.tools ?? undefined}\n className={clsx(styles['show-tools'], {\n [styles.animating]: state === 'exiting',\n [styles['has-tools-form']]: hasToolsForm,\n [styles['has-tools-form-persistence']]: hasToolsFormPersistence,\n })}\n ref={state === 'exiting' ? transitionEventsRef : undefined}\n >\n {!toolsHide && (\n <TriggerButton\n ariaLabel={ariaLabels?.toolsToggle}\n iconName=\"status-info\"\n onClick={() => handleToolsClick(!isToolsOpen)}\n selected={hasSplitPanel && isToolsOpen}\n className={testutilStyles['tools-toggle']}\n ref={toolsRefs.toggle}\n />\n )}\n\n {hasSplitPanel && splitPanelToggle.displayed && (\n <TriggerButton\n ariaLabel={splitPanelToggle.ariaLabel}\n iconName=\"view-vertical\"\n onClick={() => handleSplitPanelClick()}\n selected={hasSplitPanel && isSplitPanelOpen}\n className={splitPanelStyles['open-button']}\n ref={splitPanelRefs.toggle}\n />\n )}\n </aside>\n )}\n </div>\n )}\n </Transition>\n );\n}\n\n/**\n * Determine the default state of the Tools component. Mobile viewports should be\n * closed by default under all circumstances. If the toolsOpen prop has not been\n * set then it should be closed as well. Otherwise, default to the toolsOpen prop.\n */\nexport function getToolsDefaultState(isMobile: boolean, stateFromProps?: boolean) {\n let isToolsOpen;\n\n if (isMobile || stateFromProps === undefined) {\n isToolsOpen = false;\n } else {\n isToolsOpen = stateFromProps;\n }\n\n return isToolsOpen;\n}\n\n/**\n * This simple function returns the presence of the split panel as a child of the\n * Tools component. It must exist and be in side position.\n */\nfunction getSplitPanelStatus(splitPanelDisplayed: boolean, splitPanelPosition: string) {\n return splitPanelDisplayed && splitPanelPosition === 'side' ? true : false;\n}\n\n/**\n * By default the Tools form is styled as display: none; This behavior should\n * be unchanged in mobile viewports where the Tools form is always suppressed.\n * In large viewports, however the Tools form and its corresponding buttons\n * should be present in the UI under the below circumstances.\n */\nfunction getToolsFormStatus(\n hasSplitPanel: boolean,\n isMobile: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsForm = false;\n\n if (!isMobile) {\n // Both the Split Panel and Tools button are needed\n if (hasSplitPanel && !toolsHide) {\n hasToolsForm = true;\n }\n\n // The Split Panel button is needed\n if (hasSplitPanel && !isSplitPanelOpen && toolsHide) {\n hasToolsForm = true;\n }\n\n // The Tools button is needed\n if (!hasSplitPanel && !toolsHide && !isToolsOpen) {\n hasToolsForm = true;\n }\n }\n\n return hasToolsForm;\n}\n\n/**\n * Under two scenarios the Tools form that contains the triggers\n * for the Tools content and the Split Panel may be persistent\n * in the UI (as opposed to disappearing when one of the drawers\n * is open). This will also add a white background as opposed to the\n * default transparent background. The buttons will present and in a\n * selected / not selected state.\n */\nfunction getToolsFormPersistence(\n hasSplitPanel: boolean,\n isSplitPanelOpen?: boolean,\n isToolsOpen?: boolean,\n toolsHide?: boolean\n) {\n let hasToolsFormPersistence = false;\n\n // Both Tools and Split Panel exist and one or both is open\n if (hasSplitPanel && !toolsHide && (isSplitPanelOpen || isToolsOpen)) {\n hasToolsFormPersistence = true;\n }\n\n return hasToolsFormPersistence;\n}\n"]}
|
|
@@ -17,6 +17,10 @@ export interface CheckboxProps extends BaseCheckboxProps {
|
|
|
17
17
|
* Called when the user changes the component state. The event `detail` contains the current value for the `checked` property.
|
|
18
18
|
*/
|
|
19
19
|
onChange?: NonCancelableEventHandler<CheckboxProps.ChangeDetail>;
|
|
20
|
+
/**
|
|
21
|
+
* Specifies whether to add `aria-required` to the native control.
|
|
22
|
+
*/
|
|
23
|
+
ariaRequired?: boolean;
|
|
20
24
|
}
|
|
21
25
|
export declare namespace CheckboxProps {
|
|
22
26
|
interface Ref {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["checkbox/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["checkbox/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAEjE;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;IAED,UAAiB,YAAY;QAC3B,OAAO,EAAE,OAAO,CAAC;QACjB,aAAa,EAAE,KAAK,CAAC;KACtB;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["checkbox/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseCheckboxProps } from './base-checkbox';\nimport React from 'react';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface CheckboxProps extends BaseCheckboxProps {\n /**\n * The control's label that's displayed next to the checkbox. A state change occurs when a user clicks on it.\n * @displayname label\n */\n children?: React.ReactNode;\n\n /**\n * Specifies that the component is in an indeterminate state. The behavior of this property replicates\n * the behavior of [the respective property](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes)\n * in the native control.\n */\n indeterminate?: boolean;\n\n /**\n * Called when the user changes the component state. The event `detail` contains the current value for the `checked` property.\n */\n onChange?: NonCancelableEventHandler<CheckboxProps.ChangeDetail>;\n}\n\nexport namespace CheckboxProps {\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n }\n\n export interface ChangeDetail {\n checked: boolean;\n indeterminate: false;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["checkbox/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseCheckboxProps } from './base-checkbox';\nimport React from 'react';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface CheckboxProps extends BaseCheckboxProps {\n /**\n * The control's label that's displayed next to the checkbox. A state change occurs when a user clicks on it.\n * @displayname label\n */\n children?: React.ReactNode;\n\n /**\n * Specifies that the component is in an indeterminate state. The behavior of this property replicates\n * the behavior of [the respective property](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes)\n * in the native control.\n */\n indeterminate?: boolean;\n\n /**\n * Called when the user changes the component state. The event `detail` contains the current value for the `checked` property.\n */\n onChange?: NonCancelableEventHandler<CheckboxProps.ChangeDetail>;\n\n /**\n * Specifies whether to add `aria-required` to the native control.\n */\n ariaRequired?: boolean;\n}\n\nexport namespace CheckboxProps {\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n }\n\n export interface ChangeDetail {\n checked: boolean;\n indeterminate: false;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["checkbox/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,UAAU,aAAc,SAAQ,aAAa,EAAE,0BAA0B;IACvE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"lib/default/","sources":["checkbox/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,UAAU,aAAc,SAAQ,aAAa,EAAE,0BAA0B;IACvE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,gBAAgB,yFA2ErB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -11,7 +11,7 @@ import styles from './styles.css.js';
|
|
|
11
11
|
import CheckboxIcon from '../internal/components/checkbox-icon';
|
|
12
12
|
import { useFormFieldContext } from '../internal/context/form-field-context';
|
|
13
13
|
const InternalCheckbox = React.forwardRef((_a, ref) => {
|
|
14
|
-
var { controlId, name, checked, disabled, indeterminate, children, description, ariaLabel, onFocus, onBlur, onChange, tabIndex, showOutline, __internalRootRef } = _a, rest = __rest(_a, ["controlId", "name", "checked", "disabled", "indeterminate", "children", "description", "ariaLabel", "onFocus", "onBlur", "onChange", "tabIndex", "showOutline", "__internalRootRef"]);
|
|
14
|
+
var { controlId, name, checked, disabled, ariaRequired, indeterminate, children, description, ariaLabel, onFocus, onBlur, onChange, tabIndex, showOutline, __internalRootRef } = _a, rest = __rest(_a, ["controlId", "name", "checked", "disabled", "ariaRequired", "indeterminate", "children", "description", "ariaLabel", "onFocus", "onBlur", "onChange", "tabIndex", "showOutline", "__internalRootRef"]);
|
|
15
15
|
const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(rest);
|
|
16
16
|
const baseProps = getBaseProps(rest);
|
|
17
17
|
const checkboxRef = useRef(null);
|
|
@@ -21,7 +21,7 @@ const InternalCheckbox = React.forwardRef((_a, ref) => {
|
|
|
21
21
|
checkboxRef.current.indeterminate = Boolean(indeterminate);
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
return (React.createElement(AbstractSwitch, Object.assign({}, baseProps, { className: clsx(styles.root, baseProps.className), controlClassName: styles['checkbox-control'], outlineClassName: styles.outline, controlId: controlId, disabled: disabled, label: children, description: description, descriptionBottomPadding: true, ariaLabel: ariaLabel, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby, showOutline: showOutline, nativeControl: nativeControlProps => (React.createElement("input", Object.assign({}, nativeControlProps, { ref: checkboxRef, type: "checkbox", checked: checked, name: name, tabIndex: tabIndex, onFocus: () => fireNonCancelableEvent(onFocus), onBlur: () => fireNonCancelableEvent(onBlur),
|
|
24
|
+
return (React.createElement(AbstractSwitch, Object.assign({}, baseProps, { className: clsx(styles.root, baseProps.className), controlClassName: styles['checkbox-control'], outlineClassName: styles.outline, controlId: controlId, disabled: disabled, label: children, description: description, descriptionBottomPadding: true, ariaLabel: ariaLabel, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby, showOutline: showOutline, nativeControl: nativeControlProps => (React.createElement("input", Object.assign({}, nativeControlProps, { ref: checkboxRef, type: "checkbox", checked: checked, name: name, "aria-required": ariaRequired ? 'true' : undefined, tabIndex: tabIndex, onFocus: () => fireNonCancelableEvent(onFocus), onBlur: () => fireNonCancelableEvent(onBlur),
|
|
25
25
|
// empty handler to suppress React controllability warning
|
|
26
26
|
onChange: () => { } }))), onClick: () => {
|
|
27
27
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["checkbox/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,cAAc,MAAM,wCAAwC,CAAC;AAEpE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAO7E,MAAM,gBAAgB,GAAG,KAAK,CAAC,UAAU,CACvC,CACE,
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["checkbox/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAA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I,EAC9B,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,kBAAkB,CAAC,EAAE,CAAC,CACnC,+CACM,kBAAkB,IACtB,GAAG,EAAE,WAAW,EAChB,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,mBACK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAChD,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,OAAO,CAAC,EAC9C,MAAM,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,MAAM,CAAC;YAC5C,0DAA0D;YAC1D,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC,IAClB,CACH,EACD,OAAO,EAAE,GAAG,EAAE;;YACZ,MAAA,WAAW,CAAC,OAAO,0CAAE,KAAK,EAAE,CAAC;YAC7B,sBAAsB,CACpB,QAAQ;YACR,4EAA4E;YAC5E,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CACtG,CAAC;QACJ,CAAC,EACD,aAAa,EAAE,oBAAC,YAAY,IAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAI,EACnG,iBAAiB,EAAE,iBAAiB,IACpC,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,gBAAgB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect, useRef } from 'react';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { getBaseProps } from '../internal/base-component';\nimport AbstractSwitch from '../internal/components/abstract-switch';\nimport { CheckboxProps } from './interfaces';\nimport styles from './styles.css.js';\nimport CheckboxIcon from '../internal/components/checkbox-icon';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\n\ninterface InternalProps extends CheckboxProps, InternalBaseComponentProps {\n tabIndex?: -1;\n showOutline?: boolean;\n}\n\nconst InternalCheckbox = React.forwardRef<CheckboxProps.Ref, InternalProps>(\n (\n {\n controlId,\n name,\n checked,\n disabled,\n ariaRequired,\n indeterminate,\n children,\n description,\n ariaLabel,\n onFocus,\n onBlur,\n onChange,\n tabIndex,\n showOutline,\n __internalRootRef,\n ...rest\n },\n ref\n ) => {\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(rest);\n const baseProps = getBaseProps(rest);\n const checkboxRef = useRef<HTMLInputElement>(null);\n useForwardFocus(ref, checkboxRef);\n useEffect(() => {\n if (checkboxRef.current) {\n checkboxRef.current.indeterminate = Boolean(indeterminate);\n }\n });\n\n return (\n <AbstractSwitch\n {...baseProps}\n className={clsx(styles.root, baseProps.className)}\n controlClassName={styles['checkbox-control']}\n outlineClassName={styles.outline}\n controlId={controlId}\n disabled={disabled}\n label={children}\n description={description}\n descriptionBottomPadding={true}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n showOutline={showOutline}\n nativeControl={nativeControlProps => (\n <input\n {...nativeControlProps}\n ref={checkboxRef}\n type=\"checkbox\"\n checked={checked}\n name={name}\n aria-required={ariaRequired ? 'true' : undefined}\n tabIndex={tabIndex}\n onFocus={() => fireNonCancelableEvent(onFocus)}\n onBlur={() => fireNonCancelableEvent(onBlur)}\n // empty handler to suppress React controllability warning\n onChange={() => {}}\n />\n )}\n onClick={() => {\n checkboxRef.current?.focus();\n fireNonCancelableEvent(\n onChange,\n // for deterministic transitions \"indeterminate\" -> \"checked\" -> \"unchecked\"\n indeterminate ? { checked: true, indeterminate: false } : { checked: !checked, indeterminate: false }\n );\n }}\n styledControl={<CheckboxIcon checked={checked} indeterminate={indeterminate} disabled={disabled} />}\n __internalRootRef={__internalRootRef}\n />\n );\n }\n);\n\nexport default InternalCheckbox;\n"]}
|
|
@@ -1275,7 +1275,7 @@
|
|
|
1275
1275
|
--color-border-control-checked-9uv01j:#0972d3;
|
|
1276
1276
|
--color-border-control-default-bwkbmv:#7d8998;
|
|
1277
1277
|
--color-border-control-disabled-zgidl5:#d1d5db;
|
|
1278
|
-
--color-border-divider-active-22zon0:#
|
|
1278
|
+
--color-border-divider-active-22zon0:#000716;
|
|
1279
1279
|
--color-border-divider-default-k96bks:#e9ebed;
|
|
1280
1280
|
--color-border-divider-panel-bottom-x6jr6g:#e9ebed;
|
|
1281
1281
|
--color-border-divider-panel-side-hxw8vd:#e9ebed;
|
|
@@ -1300,7 +1300,7 @@
|
|
|
1300
1300
|
--color-border-status-info-0iedcr:#0972d3;
|
|
1301
1301
|
--color-border-status-success-lb896w:#037f0c;
|
|
1302
1302
|
--color-border-status-warning-2otrg9:#7d8998;
|
|
1303
|
-
--color-border-divider-interactive-default-mrpwro:#
|
|
1303
|
+
--color-border-divider-interactive-default-mrpwro:#414d5c;
|
|
1304
1304
|
--color-border-tabs-divider-lf9ugx:#e9ebed;
|
|
1305
1305
|
--color-border-tabs-shadow-22eyu5:rgba(0, 7, 22, 0.12);
|
|
1306
1306
|
--color-border-tabs-underline-ba6hzi:#0972d3;
|
|
@@ -1610,6 +1610,7 @@
|
|
|
1610
1610
|
--color-border-code-editor-pane-item-hover-ibrahi:#5f6b7a;
|
|
1611
1611
|
--color-border-control-checked-9uv01j:#539fe5;
|
|
1612
1612
|
--color-border-control-disabled-zgidl5:#354150;
|
|
1613
|
+
--color-border-divider-active-22zon0:#fbfbfb;
|
|
1613
1614
|
--color-border-divider-default-k96bks:#414d5c;
|
|
1614
1615
|
--color-border-divider-panel-bottom-x6jr6g:rgba(0, 7, 22, 1);
|
|
1615
1616
|
--color-border-divider-panel-side-hxw8vd:#414d5c;
|
|
@@ -1632,7 +1633,7 @@
|
|
|
1632
1633
|
--color-border-status-info-0iedcr:#539fe5;
|
|
1633
1634
|
--color-border-status-success-lb896w:#29ad32;
|
|
1634
1635
|
--color-border-status-warning-2otrg9:#8d99a8;
|
|
1635
|
-
--color-border-divider-interactive-default-mrpwro:#
|
|
1636
|
+
--color-border-divider-interactive-default-mrpwro:#d1d5db;
|
|
1636
1637
|
--color-border-tabs-divider-lf9ugx:#414d5c;
|
|
1637
1638
|
--color-border-tabs-shadow-22eyu5:rgba(0, 7, 22, 1);
|
|
1638
1639
|
--color-border-tabs-underline-ba6hzi:#539fe5;
|
|
@@ -1865,6 +1866,7 @@
|
|
|
1865
1866
|
--color-border-container-top-1itxac:transparent;
|
|
1866
1867
|
--color-border-control-checked-9uv01j:#539fe5;
|
|
1867
1868
|
--color-border-control-disabled-zgidl5:#354150;
|
|
1869
|
+
--color-border-divider-active-22zon0:#fbfbfb;
|
|
1868
1870
|
--color-border-divider-default-k96bks:#414d5c;
|
|
1869
1871
|
--color-border-divider-panel-bottom-x6jr6g:rgba(0, 7, 22, 1);
|
|
1870
1872
|
--color-border-divider-panel-side-hxw8vd:#414d5c;
|
|
@@ -1888,7 +1890,7 @@
|
|
|
1888
1890
|
--color-border-status-info-0iedcr:#539fe5;
|
|
1889
1891
|
--color-border-status-success-lb896w:#29ad32;
|
|
1890
1892
|
--color-border-status-warning-2otrg9:#8d99a8;
|
|
1891
|
-
--color-border-divider-interactive-default-mrpwro:#
|
|
1893
|
+
--color-border-divider-interactive-default-mrpwro:#d1d5db;
|
|
1892
1894
|
--color-border-tabs-divider-lf9ugx:#414d5c;
|
|
1893
1895
|
--color-border-tabs-shadow-22eyu5:rgba(0, 7, 22, 1);
|
|
1894
1896
|
--color-border-tabs-underline-ba6hzi:#539fe5;
|
|
@@ -2048,6 +2050,7 @@
|
|
|
2048
2050
|
--color-border-code-editor-pane-item-hover-ibrahi:#5f6b7a;
|
|
2049
2051
|
--color-border-control-checked-9uv01j:#539fe5;
|
|
2050
2052
|
--color-border-control-disabled-zgidl5:#354150;
|
|
2053
|
+
--color-border-divider-active-22zon0:#fbfbfb;
|
|
2051
2054
|
--color-border-divider-default-k96bks:#414d5c;
|
|
2052
2055
|
--color-border-divider-panel-bottom-x6jr6g:rgba(0, 7, 22, 1);
|
|
2053
2056
|
--color-border-divider-panel-side-hxw8vd:#414d5c;
|
|
@@ -2070,7 +2073,7 @@
|
|
|
2070
2073
|
--color-border-status-info-0iedcr:#539fe5;
|
|
2071
2074
|
--color-border-status-success-lb896w:#29ad32;
|
|
2072
2075
|
--color-border-status-warning-2otrg9:#8d99a8;
|
|
2073
|
-
--color-border-divider-interactive-default-mrpwro:#
|
|
2076
|
+
--color-border-divider-interactive-default-mrpwro:#d1d5db;
|
|
2074
2077
|
--color-border-tabs-divider-lf9ugx:#414d5c;
|
|
2075
2078
|
--color-border-tabs-shadow-22eyu5:rgba(0, 7, 22, 1);
|
|
2076
2079
|
--color-border-tabs-underline-ba6hzi:#539fe5;
|
|
@@ -2232,6 +2235,7 @@
|
|
|
2232
2235
|
--color-border-code-editor-pane-item-hover-ibrahi:#5f6b7a;
|
|
2233
2236
|
--color-border-control-checked-9uv01j:#539fe5;
|
|
2234
2237
|
--color-border-control-disabled-zgidl5:#354150;
|
|
2238
|
+
--color-border-divider-active-22zon0:#fbfbfb;
|
|
2235
2239
|
--color-border-divider-default-k96bks:#414d5c;
|
|
2236
2240
|
--color-border-divider-panel-bottom-x6jr6g:rgba(0, 7, 22, 1);
|
|
2237
2241
|
--color-border-divider-panel-side-hxw8vd:#414d5c;
|
|
@@ -2254,7 +2258,7 @@
|
|
|
2254
2258
|
--color-border-status-info-0iedcr:#539fe5;
|
|
2255
2259
|
--color-border-status-success-lb896w:#29ad32;
|
|
2256
2260
|
--color-border-status-warning-2otrg9:#8d99a8;
|
|
2257
|
-
--color-border-divider-interactive-default-mrpwro:#
|
|
2261
|
+
--color-border-divider-interactive-default-mrpwro:#d1d5db;
|
|
2258
2262
|
--color-border-tabs-divider-lf9ugx:#414d5c;
|
|
2259
2263
|
--color-border-tabs-shadow-22eyu5:rgba(0, 7, 22, 1);
|
|
2260
2264
|
--color-border-tabs-underline-ba6hzi:#539fe5;
|
|
@@ -2426,6 +2430,7 @@
|
|
|
2426
2430
|
--color-border-code-editor-pane-item-hover-ibrahi:#5f6b7a;
|
|
2427
2431
|
--color-border-control-checked-9uv01j:#539fe5;
|
|
2428
2432
|
--color-border-control-disabled-zgidl5:#354150;
|
|
2433
|
+
--color-border-divider-active-22zon0:#fbfbfb;
|
|
2429
2434
|
--color-border-divider-default-k96bks:#414d5c;
|
|
2430
2435
|
--color-border-divider-panel-bottom-x6jr6g:rgba(0, 7, 22, 1);
|
|
2431
2436
|
--color-border-divider-panel-side-hxw8vd:#414d5c;
|
|
@@ -2448,7 +2453,7 @@
|
|
|
2448
2453
|
--color-border-status-info-0iedcr:#539fe5;
|
|
2449
2454
|
--color-border-status-success-lb896w:#29ad32;
|
|
2450
2455
|
--color-border-status-warning-2otrg9:#8d99a8;
|
|
2451
|
-
--color-border-divider-interactive-default-mrpwro:#
|
|
2456
|
+
--color-border-divider-interactive-default-mrpwro:#d1d5db;
|
|
2452
2457
|
--color-border-tabs-divider-lf9ugx:#414d5c;
|
|
2453
2458
|
--color-border-tabs-shadow-22eyu5:rgba(0, 7, 22, 1);
|
|
2454
2459
|
--color-border-tabs-underline-ba6hzi:#539fe5;
|
|
@@ -1060,8 +1060,8 @@ module.exports.preset = {
|
|
|
1060
1060
|
"dark": "{colorBackgroundControlDisabled}"
|
|
1061
1061
|
},
|
|
1062
1062
|
"colorBorderDividerActive": {
|
|
1063
|
-
"light": "{
|
|
1064
|
-
"dark": "{
|
|
1063
|
+
"light": "{colorGrey900}",
|
|
1064
|
+
"dark": "{colorGrey100}"
|
|
1065
1065
|
},
|
|
1066
1066
|
"colorBorderDividerDefault": {
|
|
1067
1067
|
"light": "{colorGrey200}",
|
|
@@ -1164,8 +1164,8 @@ module.exports.preset = {
|
|
|
1164
1164
|
"dark": "{colorGrey450}"
|
|
1165
1165
|
},
|
|
1166
1166
|
"colorBorderDividerInteractiveDefault": {
|
|
1167
|
-
"light": "{
|
|
1168
|
-
"dark": "{
|
|
1167
|
+
"light": "{colorTextInteractiveDefault}",
|
|
1168
|
+
"dark": "{colorTextInteractiveDefault}"
|
|
1169
1169
|
},
|
|
1170
1170
|
"colorBorderTabsDivider": {
|
|
1171
1171
|
"light": "{colorGrey200}",
|
|
@@ -2287,6 +2287,14 @@ module.exports.preset = {
|
|
|
2287
2287
|
"shadowStickyEmbedded": {
|
|
2288
2288
|
"light": "0px 2px 0px 0px #e9ebed, 0px 16px 16px -12px rgba(0, 7, 22, 0.10)",
|
|
2289
2289
|
"dark": "0px 2px 0px 0px #414d5c, 0px 16px 16px -12px rgba(0, 7, 22, 1)"
|
|
2290
|
+
},
|
|
2291
|
+
"shadowStickyColumnFirst": {
|
|
2292
|
+
"light": "4px 0px 20px 1px rgba(0, 7, 22, 0.1)",
|
|
2293
|
+
"dark": "0px 4px 20px 1px rgba(0, 7, 22, 1)"
|
|
2294
|
+
},
|
|
2295
|
+
"shadowStickyColumnLast": {
|
|
2296
|
+
"light": "-4px 0 20px 1px rgba(0, 28, 36, 0.1)",
|
|
2297
|
+
"dark": "0px 4px 20px 1px rgba(0, 7, 22, 1)"
|
|
2290
2298
|
}
|
|
2291
2299
|
},
|
|
2292
2300
|
"contexts": {
|
|
@@ -3013,8 +3021,8 @@ module.exports.preset = {
|
|
|
3013
3021
|
"dark": "{colorBackgroundControlDisabled}"
|
|
3014
3022
|
},
|
|
3015
3023
|
"colorBorderDividerActive": {
|
|
3016
|
-
"light": "{
|
|
3017
|
-
"dark": "{
|
|
3024
|
+
"light": "{colorGrey100}",
|
|
3025
|
+
"dark": "{colorGrey100}"
|
|
3018
3026
|
},
|
|
3019
3027
|
"colorBorderDividerDefault": {
|
|
3020
3028
|
"light": "{colorGrey600}",
|
|
@@ -3117,8 +3125,8 @@ module.exports.preset = {
|
|
|
3117
3125
|
"dark": "{colorGrey450}"
|
|
3118
3126
|
},
|
|
3119
3127
|
"colorBorderDividerInteractiveDefault": {
|
|
3120
|
-
"light": "{
|
|
3121
|
-
"dark": "{
|
|
3128
|
+
"light": "{colorTextInteractiveDefault}",
|
|
3129
|
+
"dark": "{colorTextInteractiveDefault}"
|
|
3122
3130
|
},
|
|
3123
3131
|
"colorBorderTabsDivider": {
|
|
3124
3132
|
"light": "{colorGrey600}",
|
|
@@ -3622,6 +3630,14 @@ module.exports.preset = {
|
|
|
3622
3630
|
"light": "0px 2px 0px 0px #414d5c, 0px 16px 16px -12px rgba(0, 7, 22, 1)",
|
|
3623
3631
|
"dark": "0px 2px 0px 0px #414d5c, 0px 16px 16px -12px rgba(0, 7, 22, 1)"
|
|
3624
3632
|
},
|
|
3633
|
+
"shadowStickyColumnFirst": {
|
|
3634
|
+
"light": "0px 4px 20px 1px rgba(0, 7, 22, 1)",
|
|
3635
|
+
"dark": "0px 4px 20px 1px rgba(0, 7, 22, 1)"
|
|
3636
|
+
},
|
|
3637
|
+
"shadowStickyColumnLast": {
|
|
3638
|
+
"light": "0px 4px 20px 1px rgba(0, 7, 22, 1)",
|
|
3639
|
+
"dark": "0px 4px 20px 1px rgba(0, 7, 22, 1)"
|
|
3640
|
+
},
|
|
3625
3641
|
"colorGreyOpaque25": {
|
|
3626
3642
|
"light": "rgba(255, 255, 255, 0.25)",
|
|
3627
3643
|
"dark": "rgba(255, 255, 255, 0.25)"
|
|
@@ -3983,8 +3999,8 @@ module.exports.preset = {
|
|
|
3983
3999
|
"dark": "{colorBackgroundControlDisabled}"
|
|
3984
4000
|
},
|
|
3985
4001
|
"colorBorderDividerActive": {
|
|
3986
|
-
"light": "{
|
|
3987
|
-
"dark": "{
|
|
4002
|
+
"light": "{colorGrey100}",
|
|
4003
|
+
"dark": "{colorGrey100}"
|
|
3988
4004
|
},
|
|
3989
4005
|
"colorBorderDividerDefault": {
|
|
3990
4006
|
"light": "{colorGrey600}",
|
|
@@ -4087,8 +4103,8 @@ module.exports.preset = {
|
|
|
4087
4103
|
"dark": "{colorGrey450}"
|
|
4088
4104
|
},
|
|
4089
4105
|
"colorBorderDividerInteractiveDefault": {
|
|
4090
|
-
"light": "{
|
|
4091
|
-
"dark": "{
|
|
4106
|
+
"light": "{colorTextInteractiveDefault}",
|
|
4107
|
+
"dark": "{colorTextInteractiveDefault}"
|
|
4092
4108
|
},
|
|
4093
4109
|
"colorBorderTabsDivider": {
|
|
4094
4110
|
"light": "{colorGrey600}",
|
|
@@ -4893,8 +4909,8 @@ module.exports.preset = {
|
|
|
4893
4909
|
"dark": "{colorBackgroundControlDisabled}"
|
|
4894
4910
|
},
|
|
4895
4911
|
"colorBorderDividerActive": {
|
|
4896
|
-
"light": "{
|
|
4897
|
-
"dark": "{
|
|
4912
|
+
"light": "{colorGrey900}",
|
|
4913
|
+
"dark": "{colorGrey100}"
|
|
4898
4914
|
},
|
|
4899
4915
|
"colorBorderDividerDefault": {
|
|
4900
4916
|
"light": "{colorGrey200}",
|
|
@@ -4997,8 +5013,8 @@ module.exports.preset = {
|
|
|
4997
5013
|
"dark": "{colorGrey450}"
|
|
4998
5014
|
},
|
|
4999
5015
|
"colorBorderDividerInteractiveDefault": {
|
|
5000
|
-
"light": "{
|
|
5001
|
-
"dark": "{
|
|
5016
|
+
"light": "{colorTextInteractiveDefault}",
|
|
5017
|
+
"dark": "{colorTextInteractiveDefault}"
|
|
5002
5018
|
},
|
|
5003
5019
|
"colorBorderTabsDivider": {
|
|
5004
5020
|
"light": "{colorGrey200}",
|
|
@@ -5803,8 +5819,8 @@ module.exports.preset = {
|
|
|
5803
5819
|
"dark": "{colorBackgroundControlDisabled}"
|
|
5804
5820
|
},
|
|
5805
5821
|
"colorBorderDividerActive": {
|
|
5806
|
-
"light": "{
|
|
5807
|
-
"dark": "{
|
|
5822
|
+
"light": "{colorGrey900}",
|
|
5823
|
+
"dark": "{colorGrey100}"
|
|
5808
5824
|
},
|
|
5809
5825
|
"colorBorderDividerDefault": {
|
|
5810
5826
|
"light": "{colorGrey200}",
|
|
@@ -5907,8 +5923,8 @@ module.exports.preset = {
|
|
|
5907
5923
|
"dark": "{colorGrey450}"
|
|
5908
5924
|
},
|
|
5909
5925
|
"colorBorderDividerInteractiveDefault": {
|
|
5910
|
-
"light": "{
|
|
5911
|
-
"dark": "{
|
|
5926
|
+
"light": "{colorTextInteractiveDefault}",
|
|
5927
|
+
"dark": "{colorTextInteractiveDefault}"
|
|
5912
5928
|
},
|
|
5913
5929
|
"colorBorderTabsDivider": {
|
|
5914
5930
|
"light": "{colorGrey200}",
|
|
@@ -6878,7 +6894,9 @@ module.exports.preset = {
|
|
|
6878
6894
|
"shadowSplitBottom": "color",
|
|
6879
6895
|
"shadowSplitSide": "color",
|
|
6880
6896
|
"shadowSticky": "color",
|
|
6881
|
-
"shadowStickyEmbedded": "color"
|
|
6897
|
+
"shadowStickyEmbedded": "color",
|
|
6898
|
+
"shadowStickyColumnFirst": "color",
|
|
6899
|
+
"shadowStickyColumnLast": "color"
|
|
6882
6900
|
}
|
|
6883
6901
|
},
|
|
6884
6902
|
"secondary": [],
|
|
@@ -7996,7 +8014,9 @@ module.exports.preset = {
|
|
|
7996
8014
|
"shadowSplitBottom": "shadow-split-bottom",
|
|
7997
8015
|
"shadowSplitSide": "shadow-split-side",
|
|
7998
8016
|
"shadowSticky": "shadow-sticky",
|
|
7999
|
-
"shadowStickyEmbedded": "shadow-sticky-embedded"
|
|
8017
|
+
"shadowStickyEmbedded": "shadow-sticky-embedded",
|
|
8018
|
+
"shadowStickyColumnFirst": "shadow-sticky-column-first",
|
|
8019
|
+
"shadowStickyColumnLast": "shadow-sticky-column-last"
|
|
8000
8020
|
},
|
|
8001
8021
|
"propertiesMap": {
|
|
8002
8022
|
"colorAmazonOrange": "--color-amazon-orange-ds51uu",
|
|
@@ -8288,7 +8308,7 @@ module.exports.preset = {
|
|
|
8288
8308
|
"colorBorderControlChecked": "--color-border-control-checked-4xvndc",
|
|
8289
8309
|
"colorBorderControlDefault": "--color-border-control-default-m3lmsh",
|
|
8290
8310
|
"colorBorderControlDisabled": "--color-border-control-disabled-vx8bco",
|
|
8291
|
-
"colorBorderDividerActive": "--color-border-divider-active-
|
|
8311
|
+
"colorBorderDividerActive": "--color-border-divider-active-t11l9l",
|
|
8292
8312
|
"colorBorderDividerDefault": "--color-border-divider-default-7s2wjw",
|
|
8293
8313
|
"colorBorderDividerPanelBottom": "--color-border-divider-panel-bottom-zrjpck",
|
|
8294
8314
|
"colorBorderDividerPanelSide": "--color-border-divider-panel-side-yjkfcr",
|
|
@@ -8314,7 +8334,7 @@ module.exports.preset = {
|
|
|
8314
8334
|
"colorBorderStatusInfo": "--color-border-status-info-546i7i",
|
|
8315
8335
|
"colorBorderStatusSuccess": "--color-border-status-success-cqi45f",
|
|
8316
8336
|
"colorBorderStatusWarning": "--color-border-status-warning-hg85ut",
|
|
8317
|
-
"colorBorderDividerInteractiveDefault": "--color-border-divider-interactive-default-
|
|
8337
|
+
"colorBorderDividerInteractiveDefault": "--color-border-divider-interactive-default-0hdcst",
|
|
8318
8338
|
"colorBorderTabsDivider": "--color-border-tabs-divider-69fx5i",
|
|
8319
8339
|
"colorBorderTabsShadow": "--color-border-tabs-shadow-4lmh2z",
|
|
8320
8340
|
"colorBorderTabsUnderline": "--color-border-tabs-underline-9bcfzu",
|
|
@@ -8661,6 +8681,8 @@ module.exports.preset = {
|
|
|
8661
8681
|
"shadowSplitBottom": "--shadow-split-bottom-otfetg",
|
|
8662
8682
|
"shadowSplitSide": "--shadow-split-side-qv353u",
|
|
8663
8683
|
"shadowSticky": "--shadow-sticky-aijlo6",
|
|
8664
|
-
"shadowStickyEmbedded": "--shadow-sticky-embedded-qit8ba"
|
|
8684
|
+
"shadowStickyEmbedded": "--shadow-sticky-embedded-qit8ba",
|
|
8685
|
+
"shadowStickyColumnFirst": "--shadow-sticky-column-first-h2plme",
|
|
8686
|
+
"shadowStickyColumnLast": "--shadow-sticky-column-last-s13kkz"
|
|
8665
8687
|
}
|
|
8666
8688
|
};
|
|
@@ -1060,8 +1060,8 @@ export var preset = {
|
|
|
1060
1060
|
"dark": "{colorBackgroundControlDisabled}"
|
|
1061
1061
|
},
|
|
1062
1062
|
"colorBorderDividerActive": {
|
|
1063
|
-
"light": "{
|
|
1064
|
-
"dark": "{
|
|
1063
|
+
"light": "{colorGrey900}",
|
|
1064
|
+
"dark": "{colorGrey100}"
|
|
1065
1065
|
},
|
|
1066
1066
|
"colorBorderDividerDefault": {
|
|
1067
1067
|
"light": "{colorGrey200}",
|
|
@@ -1164,8 +1164,8 @@ export var preset = {
|
|
|
1164
1164
|
"dark": "{colorGrey450}"
|
|
1165
1165
|
},
|
|
1166
1166
|
"colorBorderDividerInteractiveDefault": {
|
|
1167
|
-
"light": "{
|
|
1168
|
-
"dark": "{
|
|
1167
|
+
"light": "{colorTextInteractiveDefault}",
|
|
1168
|
+
"dark": "{colorTextInteractiveDefault}"
|
|
1169
1169
|
},
|
|
1170
1170
|
"colorBorderTabsDivider": {
|
|
1171
1171
|
"light": "{colorGrey200}",
|
|
@@ -2287,6 +2287,14 @@ export var preset = {
|
|
|
2287
2287
|
"shadowStickyEmbedded": {
|
|
2288
2288
|
"light": "0px 2px 0px 0px #e9ebed, 0px 16px 16px -12px rgba(0, 7, 22, 0.10)",
|
|
2289
2289
|
"dark": "0px 2px 0px 0px #414d5c, 0px 16px 16px -12px rgba(0, 7, 22, 1)"
|
|
2290
|
+
},
|
|
2291
|
+
"shadowStickyColumnFirst": {
|
|
2292
|
+
"light": "4px 0px 20px 1px rgba(0, 7, 22, 0.1)",
|
|
2293
|
+
"dark": "0px 4px 20px 1px rgba(0, 7, 22, 1)"
|
|
2294
|
+
},
|
|
2295
|
+
"shadowStickyColumnLast": {
|
|
2296
|
+
"light": "-4px 0 20px 1px rgba(0, 28, 36, 0.1)",
|
|
2297
|
+
"dark": "0px 4px 20px 1px rgba(0, 7, 22, 1)"
|
|
2290
2298
|
}
|
|
2291
2299
|
},
|
|
2292
2300
|
"contexts": {
|
|
@@ -3013,8 +3021,8 @@ export var preset = {
|
|
|
3013
3021
|
"dark": "{colorBackgroundControlDisabled}"
|
|
3014
3022
|
},
|
|
3015
3023
|
"colorBorderDividerActive": {
|
|
3016
|
-
"light": "{
|
|
3017
|
-
"dark": "{
|
|
3024
|
+
"light": "{colorGrey100}",
|
|
3025
|
+
"dark": "{colorGrey100}"
|
|
3018
3026
|
},
|
|
3019
3027
|
"colorBorderDividerDefault": {
|
|
3020
3028
|
"light": "{colorGrey600}",
|
|
@@ -3117,8 +3125,8 @@ export var preset = {
|
|
|
3117
3125
|
"dark": "{colorGrey450}"
|
|
3118
3126
|
},
|
|
3119
3127
|
"colorBorderDividerInteractiveDefault": {
|
|
3120
|
-
"light": "{
|
|
3121
|
-
"dark": "{
|
|
3128
|
+
"light": "{colorTextInteractiveDefault}",
|
|
3129
|
+
"dark": "{colorTextInteractiveDefault}"
|
|
3122
3130
|
},
|
|
3123
3131
|
"colorBorderTabsDivider": {
|
|
3124
3132
|
"light": "{colorGrey600}",
|
|
@@ -3622,6 +3630,14 @@ export var preset = {
|
|
|
3622
3630
|
"light": "0px 2px 0px 0px #414d5c, 0px 16px 16px -12px rgba(0, 7, 22, 1)",
|
|
3623
3631
|
"dark": "0px 2px 0px 0px #414d5c, 0px 16px 16px -12px rgba(0, 7, 22, 1)"
|
|
3624
3632
|
},
|
|
3633
|
+
"shadowStickyColumnFirst": {
|
|
3634
|
+
"light": "0px 4px 20px 1px rgba(0, 7, 22, 1)",
|
|
3635
|
+
"dark": "0px 4px 20px 1px rgba(0, 7, 22, 1)"
|
|
3636
|
+
},
|
|
3637
|
+
"shadowStickyColumnLast": {
|
|
3638
|
+
"light": "0px 4px 20px 1px rgba(0, 7, 22, 1)",
|
|
3639
|
+
"dark": "0px 4px 20px 1px rgba(0, 7, 22, 1)"
|
|
3640
|
+
},
|
|
3625
3641
|
"colorGreyOpaque25": {
|
|
3626
3642
|
"light": "rgba(255, 255, 255, 0.25)",
|
|
3627
3643
|
"dark": "rgba(255, 255, 255, 0.25)"
|
|
@@ -3983,8 +3999,8 @@ export var preset = {
|
|
|
3983
3999
|
"dark": "{colorBackgroundControlDisabled}"
|
|
3984
4000
|
},
|
|
3985
4001
|
"colorBorderDividerActive": {
|
|
3986
|
-
"light": "{
|
|
3987
|
-
"dark": "{
|
|
4002
|
+
"light": "{colorGrey100}",
|
|
4003
|
+
"dark": "{colorGrey100}"
|
|
3988
4004
|
},
|
|
3989
4005
|
"colorBorderDividerDefault": {
|
|
3990
4006
|
"light": "{colorGrey600}",
|
|
@@ -4087,8 +4103,8 @@ export var preset = {
|
|
|
4087
4103
|
"dark": "{colorGrey450}"
|
|
4088
4104
|
},
|
|
4089
4105
|
"colorBorderDividerInteractiveDefault": {
|
|
4090
|
-
"light": "{
|
|
4091
|
-
"dark": "{
|
|
4106
|
+
"light": "{colorTextInteractiveDefault}",
|
|
4107
|
+
"dark": "{colorTextInteractiveDefault}"
|
|
4092
4108
|
},
|
|
4093
4109
|
"colorBorderTabsDivider": {
|
|
4094
4110
|
"light": "{colorGrey600}",
|
|
@@ -4893,8 +4909,8 @@ export var preset = {
|
|
|
4893
4909
|
"dark": "{colorBackgroundControlDisabled}"
|
|
4894
4910
|
},
|
|
4895
4911
|
"colorBorderDividerActive": {
|
|
4896
|
-
"light": "{
|
|
4897
|
-
"dark": "{
|
|
4912
|
+
"light": "{colorGrey900}",
|
|
4913
|
+
"dark": "{colorGrey100}"
|
|
4898
4914
|
},
|
|
4899
4915
|
"colorBorderDividerDefault": {
|
|
4900
4916
|
"light": "{colorGrey200}",
|
|
@@ -4997,8 +5013,8 @@ export var preset = {
|
|
|
4997
5013
|
"dark": "{colorGrey450}"
|
|
4998
5014
|
},
|
|
4999
5015
|
"colorBorderDividerInteractiveDefault": {
|
|
5000
|
-
"light": "{
|
|
5001
|
-
"dark": "{
|
|
5016
|
+
"light": "{colorTextInteractiveDefault}",
|
|
5017
|
+
"dark": "{colorTextInteractiveDefault}"
|
|
5002
5018
|
},
|
|
5003
5019
|
"colorBorderTabsDivider": {
|
|
5004
5020
|
"light": "{colorGrey200}",
|
|
@@ -5803,8 +5819,8 @@ export var preset = {
|
|
|
5803
5819
|
"dark": "{colorBackgroundControlDisabled}"
|
|
5804
5820
|
},
|
|
5805
5821
|
"colorBorderDividerActive": {
|
|
5806
|
-
"light": "{
|
|
5807
|
-
"dark": "{
|
|
5822
|
+
"light": "{colorGrey900}",
|
|
5823
|
+
"dark": "{colorGrey100}"
|
|
5808
5824
|
},
|
|
5809
5825
|
"colorBorderDividerDefault": {
|
|
5810
5826
|
"light": "{colorGrey200}",
|
|
@@ -5907,8 +5923,8 @@ export var preset = {
|
|
|
5907
5923
|
"dark": "{colorGrey450}"
|
|
5908
5924
|
},
|
|
5909
5925
|
"colorBorderDividerInteractiveDefault": {
|
|
5910
|
-
"light": "{
|
|
5911
|
-
"dark": "{
|
|
5926
|
+
"light": "{colorTextInteractiveDefault}",
|
|
5927
|
+
"dark": "{colorTextInteractiveDefault}"
|
|
5912
5928
|
},
|
|
5913
5929
|
"colorBorderTabsDivider": {
|
|
5914
5930
|
"light": "{colorGrey200}",
|
|
@@ -6878,7 +6894,9 @@ export var preset = {
|
|
|
6878
6894
|
"shadowSplitBottom": "color",
|
|
6879
6895
|
"shadowSplitSide": "color",
|
|
6880
6896
|
"shadowSticky": "color",
|
|
6881
|
-
"shadowStickyEmbedded": "color"
|
|
6897
|
+
"shadowStickyEmbedded": "color",
|
|
6898
|
+
"shadowStickyColumnFirst": "color",
|
|
6899
|
+
"shadowStickyColumnLast": "color"
|
|
6882
6900
|
}
|
|
6883
6901
|
},
|
|
6884
6902
|
"secondary": [],
|
|
@@ -7996,7 +8014,9 @@ export var preset = {
|
|
|
7996
8014
|
"shadowSplitBottom": "shadow-split-bottom",
|
|
7997
8015
|
"shadowSplitSide": "shadow-split-side",
|
|
7998
8016
|
"shadowSticky": "shadow-sticky",
|
|
7999
|
-
"shadowStickyEmbedded": "shadow-sticky-embedded"
|
|
8017
|
+
"shadowStickyEmbedded": "shadow-sticky-embedded",
|
|
8018
|
+
"shadowStickyColumnFirst": "shadow-sticky-column-first",
|
|
8019
|
+
"shadowStickyColumnLast": "shadow-sticky-column-last"
|
|
8000
8020
|
},
|
|
8001
8021
|
"propertiesMap": {
|
|
8002
8022
|
"colorAmazonOrange": "--color-amazon-orange-ds51uu",
|
|
@@ -8288,7 +8308,7 @@ export var preset = {
|
|
|
8288
8308
|
"colorBorderControlChecked": "--color-border-control-checked-4xvndc",
|
|
8289
8309
|
"colorBorderControlDefault": "--color-border-control-default-m3lmsh",
|
|
8290
8310
|
"colorBorderControlDisabled": "--color-border-control-disabled-vx8bco",
|
|
8291
|
-
"colorBorderDividerActive": "--color-border-divider-active-
|
|
8311
|
+
"colorBorderDividerActive": "--color-border-divider-active-t11l9l",
|
|
8292
8312
|
"colorBorderDividerDefault": "--color-border-divider-default-7s2wjw",
|
|
8293
8313
|
"colorBorderDividerPanelBottom": "--color-border-divider-panel-bottom-zrjpck",
|
|
8294
8314
|
"colorBorderDividerPanelSide": "--color-border-divider-panel-side-yjkfcr",
|
|
@@ -8314,7 +8334,7 @@ export var preset = {
|
|
|
8314
8334
|
"colorBorderStatusInfo": "--color-border-status-info-546i7i",
|
|
8315
8335
|
"colorBorderStatusSuccess": "--color-border-status-success-cqi45f",
|
|
8316
8336
|
"colorBorderStatusWarning": "--color-border-status-warning-hg85ut",
|
|
8317
|
-
"colorBorderDividerInteractiveDefault": "--color-border-divider-interactive-default-
|
|
8337
|
+
"colorBorderDividerInteractiveDefault": "--color-border-divider-interactive-default-0hdcst",
|
|
8318
8338
|
"colorBorderTabsDivider": "--color-border-tabs-divider-69fx5i",
|
|
8319
8339
|
"colorBorderTabsShadow": "--color-border-tabs-shadow-4lmh2z",
|
|
8320
8340
|
"colorBorderTabsUnderline": "--color-border-tabs-underline-9bcfzu",
|
|
@@ -8661,6 +8681,8 @@ export var preset = {
|
|
|
8661
8681
|
"shadowSplitBottom": "--shadow-split-bottom-otfetg",
|
|
8662
8682
|
"shadowSplitSide": "--shadow-split-side-qv353u",
|
|
8663
8683
|
"shadowSticky": "--shadow-sticky-aijlo6",
|
|
8664
|
-
"shadowStickyEmbedded": "--shadow-sticky-embedded-qit8ba"
|
|
8684
|
+
"shadowStickyEmbedded": "--shadow-sticky-embedded-qit8ba",
|
|
8685
|
+
"shadowStickyColumnFirst": "--shadow-sticky-column-first-h2plme",
|
|
8686
|
+
"shadowStickyColumnLast": "--shadow-sticky-column-last-s13kkz"
|
|
8665
8687
|
}
|
|
8666
8688
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-table.d.ts","sourceRoot":"lib/default/","sources":["s3-resource-selector/s3-modal/basic-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAI3D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIpD,OAAwB,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAEtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAGxD,UAAU,mBAAmB,CAAC,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,uBAAuB,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,E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CAAC;IACzD,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,SAAS,KAAK,IAAI,CAAC;CACzC;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,uBAAuB,CAAC,WAAW,GAAG,SAAS;;;;;;;EAS/F;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC9B,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,WAAgB,EAChB,eAAe,EACf,cAAc,EACd,cAAc,EACd,QAAQ,GACT,EAAE,iBAAiB,CAAC,CAAC,CAAC,eA4FtB"}
|
|
@@ -59,6 +59,6 @@ export function BasicS3Table({ forwardFocusRef, columnDefinitions, fetchData, tr
|
|
|
59
59
|
useEffect(() => {
|
|
60
60
|
onSelectLatest(selectedItem);
|
|
61
61
|
}, [selectedItem, onSelectLatest]);
|
|
62
|
-
return (React.createElement(InternalTable, Object.assign({ variant: "embedded" }, collectionProps, { header: React.createElement(InternalHeader, { variant: isVisualRefresh ? 'h3' : 'h2', actions: React.createElement(InternalButton, { iconName: "refresh", ariaLabel: i18nStrings.labelRefresh, onClick: loadData }), counter: selectedItem ? `(1/${allItems.length})` : `(${allItems.length})` }, i18nStrings.header), trackBy: trackBy, filter: React.createElement(InternalTextFilter, Object.assign({}, filterProps, { ref: textFilterRef, filteringAriaLabel: i18nStrings.filteringAriaLabel, filteringPlaceholder: i18nStrings.filteringPlaceholder, countText: i18nStrings.filteringCounterText ? i18nStrings.filteringCounterText(filteredItemsCount) : '' })), pagination: React.createElement(InternalPagination, Object.assign({}, paginationProps, { ariaLabels: i18nStrings.labelsPagination })), selectionType: "single", ariaLabels: i18nStrings.selectionLabels, loading: loading, loadingText: i18nStrings.loadingText, items: items, visibleColumns: visibleColumns, isItemDisabled: isItemDisabled, columnDefinitions: columnDefinitions })));
|
|
62
|
+
return (React.createElement(InternalTable, Object.assign({ variant: "embedded" }, collectionProps, { header: React.createElement(InternalHeader, { variant: isVisualRefresh ? 'h3' : 'h2', headingTagOverride: 'h3', actions: React.createElement(InternalButton, { iconName: "refresh", ariaLabel: i18nStrings.labelRefresh, onClick: loadData }), counter: selectedItem ? `(1/${allItems.length})` : `(${allItems.length})` }, i18nStrings.header), trackBy: trackBy, filter: React.createElement(InternalTextFilter, Object.assign({}, filterProps, { ref: textFilterRef, filteringAriaLabel: i18nStrings.filteringAriaLabel, filteringPlaceholder: i18nStrings.filteringPlaceholder, countText: i18nStrings.filteringCounterText ? i18nStrings.filteringCounterText(filteredItemsCount) : '' })), pagination: React.createElement(InternalPagination, Object.assign({}, paginationProps, { ariaLabels: i18nStrings.labelsPagination })), selectionType: "single", ariaLabels: i18nStrings.selectionLabels, loading: loading, loadingText: i18nStrings.loadingText, items: items, visibleColumns: visibleColumns, isItemDisabled: isItemDisabled, columnDefinitions: columnDefinitions })));
|
|
63
63
|
}
|
|
64
64
|
//# sourceMappingURL=basic-table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-table.js","sourceRoot":"lib/default/","sources":["s3-resource-selector/s3-modal/basic-table.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAEnD,OAAO,kBAAkB,MAAM,2BAA2B,CAAC;AAE3D,OAAO,aAAa,MAAM,sBAAsB,CAAC;AAEjD,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,eAAoC,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAEtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA+B3C,MAAM,UAAU,mBAAmB,CAAC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,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,IAExE,WAAW,CAAC,MAAM,CACJ,EAEnB,OAAO,EAAE,OAAO,EAChB,MAAM,EACJ,oBAAC,kBAAkB,oBACb,WAAW,IACf,GAAG,EAAE,aAAa,EAClB,kBAAkB,EAAE,WAAW,CAAC,kBAAkB,EAClD,oBAAoB,EAAE,WAAW,CAAC,oBAAoB,EACtD,SAAS,EAAE,WAAW,CAAC,oBAAoB,CAAC,CAAC,CAAC,WAAW,CAAC,oBAAoB,CAAC,kBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,IACxG,EAEJ,UAAU,EAAE,oBAAC,kBAAkB,oBAAK,eAAe,IAAE,UAAU,EAAE,WAAW,CAAC,gBAAgB,IAAI,EACjG,aAAa,EAAC,QAAQ,EACtB,UAAU,EAAE,WAAW,CAAC,eAAe,EACvC,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,CAAC,WAAW,EACpC,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,iBAAiB,IACpC,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useState, useRef } from 'react';\nimport { useCollection } from '@cloudscape-design/collection-hooks';\nimport { InternalButton } from '../../button/internal';\nimport InternalHeader from '../../header/internal';\nimport { PaginationProps } from '../../pagination/interfaces';\nimport InternalPagination from '../../pagination/internal';\nimport { TableProps } from '../../table/interfaces';\nimport InternalTable from '../../table/internal';\nimport { TextFilterProps } from '../../text-filter/interfaces';\nimport InternalTextFilter from '../../text-filter/internal';\nimport useForwardFocus, { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport { useStableEventHandler } from '../../internal/hooks/use-stable-event-handler';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { EmptyState } from './empty-state';\n\ninterface BasicS3TableStrings<T> {\n labelRefresh?: string;\n labelsPagination?: PaginationProps.Labels;\n header?: string;\n loadingText?: string;\n filteringPlaceholder?: string;\n filteringAriaLabel?: string;\n filteringCounterText?: S3ResourceSelectorProps.I18nStrings['filteringCounterText'];\n emptyText?: string;\n noMatchTitle?: string;\n noMatchSubtitle?: string;\n clearFilterButtonText?: string;\n selectionLabels?: TableProps.AriaLabels<T>;\n}\n\ninterface BasicS3TableProps<T> {\n // We do not use idiomatic `ref` prop because it does not allow generics.\n // Option 3 from this solution: https://stackoverflow.com/a/58473012/1297743\n forwardFocusRef: React.Ref<ForwardFocusRef>;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;\n fetchData: () => Promise<ReadonlyArray<T>>;\n trackBy: TableProps.TrackBy<T>;\n i18nStrings: BasicS3TableStrings<T>;\n isVisualRefresh?: boolean;\n visibleColumns: ReadonlyArray<string>;\n isItemDisabled: TableProps.IsItemDisabled<T> | undefined;\n onSelect: (item: T | undefined) => void;\n}\n\nexport function getSharedI18Strings(i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined) {\n return {\n filteringCounterText: i18nStrings?.filteringCounterText,\n labelRefresh: i18nStrings?.labelRefresh,\n labelsPagination: i18nStrings?.labelsPagination,\n noMatchTitle: i18nStrings?.filteringNoMatches,\n noMatchSubtitle: i18nStrings?.filteringCantFindMatch,\n clearFilterButtonText: i18nStrings?.clearFilterButtonText,\n };\n}\n\nexport function BasicS3Table<T>({\n forwardFocusRef,\n columnDefinitions,\n fetchData,\n trackBy,\n i18nStrings = {},\n isVisualRefresh,\n visibleColumns,\n isItemDisabled,\n onSelect,\n}: BasicS3TableProps<T>) {\n const [loading, setLoading] = useState(false);\n const [allItems, setAllItems] = useState<ReadonlyArray<T>>([]);\n const textFilterRef = useRef<TextFilterProps.Ref>(null);\n const onSelectLatest = useStableEventHandler(onSelect);\n\n function loadData() {\n setLoading(true);\n fetchData()\n .then(items => {\n setAllItems(items);\n setLoading(false);\n })\n .catch(() => {\n // error handling should happen on the customer side, outside of this component\n setLoading(false);\n });\n }\n\n useEffect(() => {\n loadData();\n // Data loading is only happening on initial render, or via refresh button\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useForwardFocus(forwardFocusRef, textFilterRef);\n\n const { items, filteredItemsCount, collectionProps, filterProps, paginationProps, actions } = useCollection(\n allItems,\n {\n selection: { trackBy },\n filtering: {\n empty: i18nStrings.emptyText,\n noMatch: (\n <EmptyState\n title={i18nStrings.noMatchTitle}\n subtitle={i18nStrings.noMatchSubtitle}\n action={\n <InternalButton onClick={() => actions.setFiltering('')}>\n {i18nStrings.clearFilterButtonText}\n </InternalButton>\n }\n />\n ),\n },\n pagination: {},\n sorting: {},\n }\n );\n const selectedItem = collectionProps.selectedItems?.[0];\n\n // selectedItem can change internally inside the hook after pagination or filtering\n // useEffect will capture all possible changes\n useEffect(() => {\n onSelectLatest(selectedItem);\n }, [selectedItem, onSelectLatest]);\n\n return (\n <InternalTable<T>\n variant=\"embedded\"\n {...collectionProps}\n header={\n <InternalHeader\n variant={isVisualRefresh ? 'h3' : 'h2'}\n actions={<InternalButton iconName=\"refresh\" ariaLabel={i18nStrings.labelRefresh} onClick={loadData} />}\n counter={selectedItem ? `(1/${allItems.length})` : `(${allItems.length})`}\n >\n {i18nStrings.header}\n </InternalHeader>\n }\n trackBy={trackBy}\n filter={\n <InternalTextFilter\n {...filterProps}\n ref={textFilterRef}\n filteringAriaLabel={i18nStrings.filteringAriaLabel}\n filteringPlaceholder={i18nStrings.filteringPlaceholder}\n countText={i18nStrings.filteringCounterText ? i18nStrings.filteringCounterText(filteredItemsCount!) : ''}\n />\n }\n pagination={<InternalPagination {...paginationProps} ariaLabels={i18nStrings.labelsPagination} />}\n selectionType=\"single\"\n ariaLabels={i18nStrings.selectionLabels}\n loading={loading}\n loadingText={i18nStrings.loadingText}\n items={items}\n visibleColumns={visibleColumns}\n isItemDisabled={isItemDisabled}\n columnDefinitions={columnDefinit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WAAW,CAAC,eAAe,EACvC,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,CAAC,WAAW,EACpC,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,iBAAiB,IACpC,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useState, useRef } from 'react';\nimport { useCollection } from '@cloudscape-design/collection-hooks';\nimport { InternalButton } from '../../button/internal';\nimport InternalHeader from '../../header/internal';\nimport { PaginationProps } from '../../pagination/interfaces';\nimport InternalPagination from '../../pagination/internal';\nimport { TableProps } from '../../table/interfaces';\nimport InternalTable from '../../table/internal';\nimport { TextFilterProps } from '../../text-filter/interfaces';\nimport InternalTextFilter from '../../text-filter/internal';\nimport useForwardFocus, { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport { useStableEventHandler } from '../../internal/hooks/use-stable-event-handler';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { EmptyState } from './empty-state';\n\ninterface BasicS3TableStrings<T> {\n labelRefresh?: string;\n labelsPagination?: PaginationProps.Labels;\n header?: string;\n loadingText?: string;\n filteringPlaceholder?: string;\n filteringAriaLabel?: string;\n filteringCounterText?: S3ResourceSelectorProps.I18nStrings['filteringCounterText'];\n emptyText?: string;\n noMatchTitle?: string;\n noMatchSubtitle?: string;\n clearFilterButtonText?: string;\n selectionLabels?: TableProps.AriaLabels<T>;\n}\n\ninterface BasicS3TableProps<T> {\n // We do not use idiomatic `ref` prop because it does not allow generics.\n // Option 3 from this solution: https://stackoverflow.com/a/58473012/1297743\n forwardFocusRef: React.Ref<ForwardFocusRef>;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;\n fetchData: () => Promise<ReadonlyArray<T>>;\n trackBy: TableProps.TrackBy<T>;\n i18nStrings: BasicS3TableStrings<T>;\n isVisualRefresh?: boolean;\n visibleColumns: ReadonlyArray<string>;\n isItemDisabled: TableProps.IsItemDisabled<T> | undefined;\n onSelect: (item: T | undefined) => void;\n}\n\nexport function getSharedI18Strings(i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined) {\n return {\n filteringCounterText: i18nStrings?.filteringCounterText,\n labelRefresh: i18nStrings?.labelRefresh,\n labelsPagination: i18nStrings?.labelsPagination,\n noMatchTitle: i18nStrings?.filteringNoMatches,\n noMatchSubtitle: i18nStrings?.filteringCantFindMatch,\n clearFilterButtonText: i18nStrings?.clearFilterButtonText,\n };\n}\n\nexport function BasicS3Table<T>({\n forwardFocusRef,\n columnDefinitions,\n fetchData,\n trackBy,\n i18nStrings = {},\n isVisualRefresh,\n visibleColumns,\n isItemDisabled,\n onSelect,\n}: BasicS3TableProps<T>) {\n const [loading, setLoading] = useState(false);\n const [allItems, setAllItems] = useState<ReadonlyArray<T>>([]);\n const textFilterRef = useRef<TextFilterProps.Ref>(null);\n const onSelectLatest = useStableEventHandler(onSelect);\n\n function loadData() {\n setLoading(true);\n fetchData()\n .then(items => {\n setAllItems(items);\n setLoading(false);\n })\n .catch(() => {\n // error handling should happen on the customer side, outside of this component\n setLoading(false);\n });\n }\n\n useEffect(() => {\n loadData();\n // Data loading is only happening on initial render, or via refresh button\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useForwardFocus(forwardFocusRef, textFilterRef);\n\n const { items, filteredItemsCount, collectionProps, filterProps, paginationProps, actions } = useCollection(\n allItems,\n {\n selection: { trackBy },\n filtering: {\n empty: i18nStrings.emptyText,\n noMatch: (\n <EmptyState\n title={i18nStrings.noMatchTitle}\n subtitle={i18nStrings.noMatchSubtitle}\n action={\n <InternalButton onClick={() => actions.setFiltering('')}>\n {i18nStrings.clearFilterButtonText}\n </InternalButton>\n }\n />\n ),\n },\n pagination: {},\n sorting: {},\n }\n );\n const selectedItem = collectionProps.selectedItems?.[0];\n\n // selectedItem can change internally inside the hook after pagination or filtering\n // useEffect will capture all possible changes\n useEffect(() => {\n onSelectLatest(selectedItem);\n }, [selectedItem, onSelectLatest]);\n\n return (\n <InternalTable<T>\n variant=\"embedded\"\n {...collectionProps}\n header={\n <InternalHeader\n variant={isVisualRefresh ? 'h3' : 'h2'}\n headingTagOverride={'h3'}\n actions={<InternalButton iconName=\"refresh\" ariaLabel={i18nStrings.labelRefresh} onClick={loadData} />}\n counter={selectedItem ? `(1/${allItems.length})` : `(${allItems.length})`}\n >\n {i18nStrings.header}\n </InternalHeader>\n }\n trackBy={trackBy}\n filter={\n <InternalTextFilter\n {...filterProps}\n ref={textFilterRef}\n filteringAriaLabel={i18nStrings.filteringAriaLabel}\n filteringPlaceholder={i18nStrings.filteringPlaceholder}\n countText={i18nStrings.filteringCounterText ? i18nStrings.filteringCounterText(filteredItemsCount!) : ''}\n />\n }\n pagination={<InternalPagination {...paginationProps} ariaLabels={i18nStrings.labelsPagination} />}\n selectionType=\"single\"\n ariaLabels={i18nStrings.selectionLabels}\n loading={loading}\n loadingText={i18nStrings.loadingText}\n items={items}\n visibleColumns={visibleColumns}\n isItemDisabled={isItemDisabled}\n columnDefinitions={columnDefinitions}\n />\n );\n}\n"]}
|
|
@@ -2,9 +2,10 @@ import { TypedOverride } from '../internal/generated/theming';
|
|
|
2
2
|
export type Theme = TypedOverride;
|
|
3
3
|
export interface ApplyThemeParams {
|
|
4
4
|
theme: Theme;
|
|
5
|
+
baseThemeId?: string;
|
|
5
6
|
}
|
|
6
7
|
export interface ApplyThemeResult {
|
|
7
8
|
reset: () => void;
|
|
8
9
|
}
|
|
9
|
-
export declare function applyTheme({ theme }: ApplyThemeParams): ApplyThemeResult;
|
|
10
|
+
export declare function applyTheme({ theme, baseThemeId }: ApplyThemeParams): ApplyThemeResult;
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["theming/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAU,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,MAAM,KAAK,GAAG,aAAa,CAAC;AAClC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["theming/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAU,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,MAAM,KAAK,GAAG,aAAa,CAAC;AAClC,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,gBAAgB,GAAG,gBAAgB,CAMrF"}
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { applyTheme as coreApplyTheme } from '@cloudscape-design/theming-runtime';
|
|
4
4
|
import { preset } from '../internal/generated/theming';
|
|
5
|
-
export function applyTheme({ theme }) {
|
|
5
|
+
export function applyTheme({ theme, baseThemeId }) {
|
|
6
6
|
return coreApplyTheme({
|
|
7
7
|
override: theme,
|
|
8
8
|
preset,
|
|
9
|
+
baseThemeId,
|
|
9
10
|
});
|
|
10
11
|
}
|
|
11
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["theming/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,MAAM,EAAiB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["theming/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,MAAM,EAAiB,MAAM,+BAA+B,CAAC;AAYtE,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,WAAW,EAAoB;IACjE,OAAO,cAAc,CAAC;QACpB,QAAQ,EAAE,KAAK;QACf,MAAM;QACN,WAAW;KACZ,CAAC,CAAC;AACL,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { applyTheme as coreApplyTheme } from '@cloudscape-design/theming-runtime';\nimport { preset, TypedOverride } from '../internal/generated/theming';\n\nexport type Theme = TypedOverride;\nexport interface ApplyThemeParams {\n theme: Theme;\n baseThemeId?: string;\n}\n\nexport interface ApplyThemeResult {\n reset: () => void;\n}\n\nexport function applyTheme({ theme, baseThemeId }: ApplyThemeParams): ApplyThemeResult {\n return coreApplyTheme({\n override: theme,\n preset,\n baseThemeId,\n });\n}\n"]}
|