@cloudscape-design/components 3.0.1270 → 3.0.1271
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app-layout/visual-refresh-toolbar/toolbar/index.js +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.d.ts +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js +1 -2
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js.map +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.css.js +6 -7
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.scoped.css +20 -26
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.selectors.js +6 -7
- package/button/styles.css.js +22 -22
- package/button/styles.scoped.css +78 -78
- package/button/styles.selectors.js +22 -22
- package/help-panel/styles.css.js +6 -6
- package/help-panel/styles.scoped.css +70 -70
- package/help-panel/styles.selectors.js +6 -6
- package/i18n/messages/all.all.js +1 -1
- package/i18n/messages/all.all.json +1 -1
- package/i18n/messages/all.ar.js +1 -1
- package/i18n/messages/all.ar.json +1 -1
- package/i18n/messages/all.de.js +1 -1
- package/i18n/messages/all.de.json +1 -1
- package/i18n/messages/all.en-GB.js +1 -1
- package/i18n/messages/all.en-GB.json +1 -1
- package/i18n/messages/all.en.js +1 -1
- package/i18n/messages/all.en.json +1 -1
- package/i18n/messages/all.es.js +1 -1
- package/i18n/messages/all.es.json +1 -1
- package/i18n/messages/all.fr.js +1 -1
- package/i18n/messages/all.fr.json +1 -1
- package/i18n/messages/all.id.js +1 -1
- package/i18n/messages/all.id.json +1 -1
- package/i18n/messages/all.it.js +1 -1
- package/i18n/messages/all.it.json +1 -1
- package/i18n/messages/all.ja.js +1 -1
- package/i18n/messages/all.ja.json +1 -1
- package/i18n/messages/all.ko.js +1 -1
- package/i18n/messages/all.ko.json +1 -1
- package/i18n/messages/all.pt-BR.js +1 -1
- package/i18n/messages/all.pt-BR.json +1 -1
- package/i18n/messages/all.tr.js +1 -1
- package/i18n/messages/all.tr.json +1 -1
- package/i18n/messages/all.zh-CN.js +1 -1
- package/i18n/messages/all.zh-CN.json +1 -1
- package/i18n/messages/all.zh-TW.js +1 -1
- package/i18n/messages/all.zh-TW.json +1 -1
- package/i18n/messages-types.d.ts +18 -0
- package/i18n/messages-types.d.ts.map +1 -1
- package/i18n/messages-types.js.map +1 -1
- package/internal/base-component/styles.scoped.css +63 -4
- package/internal/components/token-list/styles.css.js +10 -10
- package/internal/components/token-list/styles.scoped.css +25 -25
- package/internal/components/token-list/styles.selectors.js +10 -10
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/generated/styles/tokens.d.ts +17 -3
- package/internal/generated/styles/tokens.js +17 -3
- package/internal/generated/theming/index.cjs +417 -9
- package/internal/generated/theming/index.cjs.d.ts +189 -0
- package/internal/generated/theming/index.d.ts +189 -0
- package/internal/generated/theming/index.js +417 -9
- package/internal/keycode.d.ts +3 -1
- package/internal/keycode.d.ts.map +1 -1
- package/internal/keycode.js +5 -0
- package/internal/keycode.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/internal/utils/handle-key.d.ts +22 -1
- package/internal/utils/handle-key.d.ts.map +1 -1
- package/internal/utils/handle-key.js +62 -4
- package/internal/utils/handle-key.js.map +1 -1
- package/link/styles.css.js +21 -21
- package/link/styles.scoped.css +81 -81
- package/link/styles.selectors.js +21 -21
- package/package.json +1 -1
- package/prompt-input/components/menu-dropdown.d.ts +33 -0
- package/prompt-input/components/menu-dropdown.d.ts.map +1 -0
- package/prompt-input/components/menu-dropdown.js +48 -0
- package/prompt-input/components/menu-dropdown.js.map +1 -0
- package/prompt-input/components/textarea-mode.d.ts +15 -0
- package/prompt-input/components/textarea-mode.d.ts.map +1 -0
- package/prompt-input/components/textarea-mode.js +8 -0
- package/prompt-input/components/textarea-mode.js.map +1 -0
- package/prompt-input/components/token-mode.d.ts +61 -0
- package/prompt-input/components/token-mode.d.ts.map +1 -0
- package/prompt-input/components/token-mode.js +37 -0
- package/prompt-input/components/token-mode.js.map +1 -0
- package/prompt-input/core/caret-controller.d.ts +73 -0
- package/prompt-input/core/caret-controller.d.ts.map +1 -0
- package/prompt-input/core/caret-controller.js +396 -0
- package/prompt-input/core/caret-controller.js.map +1 -0
- package/prompt-input/core/caret-spot-utils.d.ts +6 -0
- package/prompt-input/core/caret-spot-utils.d.ts.map +1 -0
- package/prompt-input/core/caret-spot-utils.js +52 -0
- package/prompt-input/core/caret-spot-utils.js.map +1 -0
- package/prompt-input/core/caret-utils.d.ts +25 -0
- package/prompt-input/core/caret-utils.d.ts.map +1 -0
- package/prompt-input/core/caret-utils.js +183 -0
- package/prompt-input/core/caret-utils.js.map +1 -0
- package/prompt-input/core/constants.d.ts +14 -0
- package/prompt-input/core/constants.d.ts.map +1 -0
- package/prompt-input/core/constants.js +18 -0
- package/prompt-input/core/constants.js.map +1 -0
- package/prompt-input/core/dom-utils.d.ts +60 -0
- package/prompt-input/core/dom-utils.d.ts.map +1 -0
- package/prompt-input/core/dom-utils.js +252 -0
- package/prompt-input/core/dom-utils.js.map +1 -0
- package/prompt-input/core/event-handlers.d.ts +68 -0
- package/prompt-input/core/event-handlers.d.ts.map +1 -0
- package/prompt-input/core/event-handlers.js +678 -0
- package/prompt-input/core/event-handlers.js.map +1 -0
- package/prompt-input/core/menu-state.d.ts +62 -0
- package/prompt-input/core/menu-state.d.ts.map +1 -0
- package/prompt-input/core/menu-state.js +168 -0
- package/prompt-input/core/menu-state.js.map +1 -0
- package/prompt-input/core/token-operations.d.ts +21 -0
- package/prompt-input/core/token-operations.d.ts.map +1 -0
- package/prompt-input/core/token-operations.js +273 -0
- package/prompt-input/core/token-operations.js.map +1 -0
- package/prompt-input/core/token-renderer.d.ts +26 -0
- package/prompt-input/core/token-renderer.d.ts.map +1 -0
- package/prompt-input/core/token-renderer.js +230 -0
- package/prompt-input/core/token-renderer.js.map +1 -0
- package/prompt-input/core/token-utils.d.ts +22 -0
- package/prompt-input/core/token-utils.d.ts.map +1 -0
- package/prompt-input/core/token-utils.js +262 -0
- package/prompt-input/core/token-utils.js.map +1 -0
- package/prompt-input/core/trigger-utils.d.ts +18 -0
- package/prompt-input/core/trigger-utils.d.ts.map +1 -0
- package/prompt-input/core/trigger-utils.js +174 -0
- package/prompt-input/core/trigger-utils.js.map +1 -0
- package/prompt-input/core/type-guards.d.ts +13 -0
- package/prompt-input/core/type-guards.d.ts.map +1 -0
- package/prompt-input/core/type-guards.js +36 -0
- package/prompt-input/core/type-guards.js.map +1 -0
- package/prompt-input/index.d.ts +1 -1
- package/prompt-input/index.d.ts.map +1 -1
- package/prompt-input/index.js.map +1 -1
- package/prompt-input/interfaces.d.ts +356 -7
- package/prompt-input/interfaces.d.ts.map +1 -1
- package/prompt-input/interfaces.js.map +1 -1
- package/prompt-input/internal.d.ts +1 -1
- package/prompt-input/internal.d.ts.map +1 -1
- package/prompt-input/internal.js +195 -61
- package/prompt-input/internal.js.map +1 -1
- package/prompt-input/styles.css.js +26 -17
- package/prompt-input/styles.scoped.css +152 -39
- package/prompt-input/styles.selectors.js +26 -17
- package/prompt-input/test-classes/styles.css.js +7 -6
- package/prompt-input/test-classes/styles.scoped.css +10 -6
- package/prompt-input/test-classes/styles.selectors.js +7 -6
- package/prompt-input/tokens/use-shortcuts.d.ts +37 -0
- package/prompt-input/tokens/use-shortcuts.d.ts.map +1 -0
- package/prompt-input/tokens/use-shortcuts.js +89 -0
- package/prompt-input/tokens/use-shortcuts.js.map +1 -0
- package/prompt-input/tokens/use-token-mode.d.ts +78 -0
- package/prompt-input/tokens/use-token-mode.d.ts.map +1 -0
- package/prompt-input/tokens/use-token-mode.js +817 -0
- package/prompt-input/tokens/use-token-mode.js.map +1 -0
- package/prompt-input/utils/insert-text-content-editable.d.ts +10 -0
- package/prompt-input/utils/insert-text-content-editable.d.ts.map +1 -0
- package/prompt-input/utils/insert-text-content-editable.js +133 -0
- package/prompt-input/utils/insert-text-content-editable.js.map +1 -0
- package/tabs/styles.css.js +30 -30
- package/tabs/styles.scoped.css +55 -55
- package/tabs/styles.selectors.js +30 -30
- package/test-utils/dom/hotspot/index.js +1 -2
- package/test-utils/dom/hotspot/index.js.map +1 -1
- package/test-utils/dom/prompt-input/index.d.ts +53 -1
- package/test-utils/dom/prompt-input/index.js +121 -13
- package/test-utils/dom/prompt-input/index.js.map +1 -1
- package/test-utils/dom/s3-resource-selector/index.js +2 -3
- package/test-utils/dom/s3-resource-selector/index.js.map +1 -1
- package/test-utils/selectors/hotspot/index.js +1 -2
- package/test-utils/selectors/hotspot/index.js.map +1 -1
- package/test-utils/selectors/prompt-input/index.d.ts +30 -0
- package/test-utils/selectors/prompt-input/index.js +53 -7
- package/test-utils/selectors/prompt-input/index.js.map +1 -1
- package/test-utils/selectors/s3-resource-selector/index.js +2 -3
- package/test-utils/selectors/s3-resource-selector/index.js.map +1 -1
|
@@ -72,7 +72,7 @@ toolbarProps = {}, featureNotificationsProps, }) {
|
|
|
72
72
|
setExpandedDrawerId(null);
|
|
73
73
|
}
|
|
74
74
|
onActiveAiDrawerChange === null || onActiveAiDrawerChange === void 0 ? void 0 : onActiveAiDrawerChange((_a = aiDrawer === null || aiDrawer === void 0 ? void 0 : aiDrawer.id) !== null && _a !== void 0 ? _a : null, { initiatedByUserAction: true });
|
|
75
|
-
}, ref: aiDrawerFocusRef, selected: !drawerExpandedMode && !!activeAiDrawerId, disabled: anyPanelOpenInMobile, variant: ((_c = aiDrawer === null || aiDrawer === void 0 ? void 0 : aiDrawer.trigger) === null || _c === void 0 ? void 0 : _c.customIcon) ? 'custom' : '
|
|
75
|
+
}, ref: aiDrawerFocusRef, selected: !drawerExpandedMode && !!activeAiDrawerId, disabled: anyPanelOpenInMobile, variant: ((_c = aiDrawer === null || aiDrawer === void 0 ? void 0 : aiDrawer.trigger) === null || _c === void 0 ? void 0 : _c.customIcon) ? 'custom' : 'default', testId: `awsui-app-layout-trigger-${aiDrawer === null || aiDrawer === void 0 ? void 0 : aiDrawer.id}`, isForPreviousActiveDrawer: true })));
|
|
76
76
|
})),
|
|
77
77
|
React.createElement(ToolbarContainer, { hasAiDrawer: !!activeAiDrawerId },
|
|
78
78
|
hasNavigation && (React.createElement("nav", { ...navLandmarkAttributes, className: clsx(styles['universal-toolbar-nav']) },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAKtE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAE5F,OAAO,EAAE,cAAc,EAAyB,MAAM,mBAAmB,CAAC;AAC1E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAkDrC,MAAM,UAAU,8BAA8B,CAAC,EAC7C,kBAAkB;AAClB,yGAAyG;AACzG,yCAAyC;AACzC,YAAY,GAAG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AAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,mCAAI,EAAE,EAClE,sBAAsB,EAAE,sBAAsB,aAAtB,sBAAsB,cAAtB,sBAAsB,GAAI,EAAE,EACpD,2BAA2B,EAAE,2BAA2B,EACxD,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,mBAAoB,EACzC,aAAa,EAAE,aAAa,EAC5B,gCAAgC,EAAE,gCAAgC,EAClE,0BAA0B,EAAE,0BAA0B,EACtD,yBAAyB,EAAE,yBAAyB,GACpD,CAC4B,CAC5B,CACP,CACgB,CACP,CACf,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,8BAA8B,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutProps } from '../../interfaces';\nimport { OnChangeParams } from '../../utils/use-drawers';\nimport { Focusable, FocusControlMultipleStates } from '../../utils/use-focus-control';\nimport { AppLayoutInternals } from '../interfaces';\nimport { ToolbarSkeleton } from '../skeleton/skeleton-parts';\nimport { ToolbarSlot } from '../skeleton/slots';\nimport { ToolbarBreadcrumbsSection, ToolbarContainer } from '../skeleton/toolbar-container';\nimport { FeatureNotificationsProps } from '../state/use-feature-notifications';\nimport { DrawerTriggers, SplitPanelToggleProps } from './drawer-triggers';\nimport TriggerButton from './trigger-button';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport { SplitPanelToggleProps };\n\nexport interface ToolbarProps {\n ariaLabels?: AppLayoutProps.Labels;\n // navigation\n hasNavigation?: boolean;\n navigationOpen?: boolean;\n onNavigationToggle?: (open: boolean) => void;\n navigationFocusRef?: React.Ref<Focusable>;\n\n // breadcrumbs\n hasBreadcrumbsPortal?: boolean;\n\n // split panel\n hasSplitPanel?: boolean;\n splitPanelToggleProps?: SplitPanelToggleProps;\n splitPanelFocusRef?: React.Ref<Focusable>;\n onSplitPanelToggle?: () => void;\n\n // drawers\n activeDrawerId?: string | null;\n drawers?: ReadonlyArray<AppLayoutProps.Drawer>;\n drawersFocusRef?: React.Ref<Focusable>;\n bottomDrawersFocusRef?: React.Ref<Focusable>;\n globalDrawersFocusControl?: FocusControlMultipleStates;\n onActiveDrawerChange?: (drawerId: string | null, params: OnChangeParams) => void;\n globalDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n activeGlobalDrawersIds?: ReadonlyArray<string>;\n onActiveGlobalDrawersChange?: ((drawerId: string, params: OnChangeParams) => void) | undefined;\n bottomDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n activeGlobalBottomDrawerId?: string | null;\n onActiveGlobalBottomDrawerChange?: (value: string | null, params: OnChangeParams) => void;\n\n expandedDrawerId?: string | null;\n setExpandedDrawerId?: (value: string | null) => void;\n\n aiDrawer?: AppLayoutProps.Drawer;\n onActiveAiDrawerChange?: (value: string | null) => void;\n activeAiDrawerId?: string | null;\n aiDrawerFocusRef?: React.Ref<Focusable>;\n}\n\nexport interface AppLayoutToolbarImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n toolbarProps: ToolbarProps;\n featureNotificationsProps?: FeatureNotificationsProps;\n}\n\nexport function AppLayoutToolbarImplementation({\n appLayoutInternals,\n // the value could be undefined if this component is loaded as a widget by a different app layout version\n // not testable in a single-version setup\n toolbarProps = {},\n featureNotificationsProps,\n}: AppLayoutToolbarImplementationProps) {\n const {\n breadcrumbs,\n discoveredBreadcrumbs,\n verticalOffsets,\n isMobile,\n setToolbarHeight,\n aiDrawer,\n activeAiDrawer,\n onActiveAiDrawerChange,\n } = appLayoutInternals;\n const {\n ariaLabels,\n activeDrawerId,\n drawers,\n drawersFocusRef,\n onActiveDrawerChange,\n globalDrawersFocusControl,\n globalDrawers,\n activeGlobalDrawersIds,\n onActiveGlobalDrawersChange,\n hasNavigation,\n navigationOpen,\n navigationFocusRef,\n onNavigationToggle,\n hasSplitPanel,\n splitPanelFocusRef,\n splitPanelToggleProps,\n onSplitPanelToggle,\n expandedDrawerId,\n setExpandedDrawerId,\n aiDrawerFocusRef,\n onActiveGlobalBottomDrawerChange,\n activeGlobalBottomDrawerId,\n bottomDrawersFocusRef,\n bottomDrawers,\n } = toolbarProps;\n const drawerExpandedMode = !!expandedDrawerId;\n const ref = useRef<HTMLElement>(null);\n const aiDrawerTransitionRef = useRef<HTMLDivElement>(null);\n const activeAiDrawerId = activeAiDrawer?.id;\n useResizeObserver(ref, entry => setToolbarHeight(entry.borderBoxHeight));\n useEffect(() => {\n return () => {\n setToolbarHeight(0);\n };\n // unmount effect only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const anyPanelOpenInMobile =\n !!isMobile &&\n (!!activeDrawerId ||\n !!activeGlobalDrawersIds?.length ||\n !!activeAiDrawerId ||\n !!activeGlobalBottomDrawerId ||\n (!!navigationOpen && !!hasNavigation));\n useEffect(() => {\n if (anyPanelOpenInMobile) {\n document.body.classList.add(styles['block-body-scroll']);\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n return () => {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n }, [anyPanelOpenInMobile]);\n\n const navLandmarkAttributes = navigationOpen\n ? { role: 'presentation' }\n : { role: 'navigation', 'aria-label': ariaLabels?.navigation };\n\n return (\n <ToolbarSlot\n ref={ref}\n className={clsx((aiDrawer?.trigger || !!activeAiDrawerId) && styles['with-ai-drawer'], {\n [testutilStyles['mobile-bar']]: isMobile,\n })}\n style={{\n insetBlockStart: verticalOffsets.toolbar,\n }}\n >\n <AppLayoutBuiltInErrorBoundary>\n <Transition\n in={!!(aiDrawer?.trigger && !activeAiDrawerId)}\n timeout={{ enter: 0, exit: 165 }}\n mountOnEnter={true}\n unmountOnExit={true}\n nodeRef={aiDrawerTransitionRef}\n >\n {state => (\n <div\n className={clsx(!!aiDrawer?.trigger?.customIcon && styles['universal-toolbar-ai-custom'], [\n sharedStyles['with-motion-horizontal'],\n ])}\n style={{\n opacity: ['entering', 'exiting'].includes(state) ? 0 : 1,\n }}\n >\n <TriggerButton\n ariaLabel={aiDrawer?.ariaLabels?.triggerButton}\n ariaExpanded={!!activeAiDrawerId}\n iconName={aiDrawer?.trigger!.iconName}\n iconSvg={aiDrawer?.trigger!.iconSvg}\n customSvg={aiDrawer?.trigger!.customIcon}\n className={testutilStyles['ai-drawer-toggle']}\n onClick={() => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n onActiveAiDrawerChange?.(aiDrawer?.id ?? null, { initiatedByUserAction: true });\n }}\n ref={aiDrawerFocusRef}\n selected={!drawerExpandedMode && !!activeAiDrawerId}\n disabled={anyPanelOpenInMobile}\n variant={aiDrawer?.trigger?.customIcon ? 'custom' : 'circle'}\n testId={`awsui-app-layout-trigger-${aiDrawer?.id}`}\n isForPreviousActiveDrawer={true}\n />\n </div>\n )}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n <ToolbarContainer hasAiDrawer={!!activeAiDrawerId}>\n {hasNavigation && (\n <nav {...navLandmarkAttributes} className={clsx(styles['universal-toolbar-nav'])}>\n <AppLayoutBuiltInErrorBoundary>\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle ?? undefined}\n ariaExpanded={!drawerExpandedMode && navigationOpen}\n iconName=\"menu\"\n className={testutilStyles['navigation-toggle']}\n onClick={() => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n if (navigationOpen && expandedDrawerId) {\n return;\n }\n onNavigationToggle?.(!navigationOpen);\n }}\n ref={navigationFocusRef}\n selected={!drawerExpandedMode && navigationOpen}\n disabled={anyPanelOpenInMobile}\n />\n </AppLayoutBuiltInErrorBoundary>\n </nav>\n )}\n {(breadcrumbs || discoveredBreadcrumbs) && (\n <AppLayoutBuiltInErrorBoundary>\n <ToolbarBreadcrumbsSection\n ownBreadcrumbs={appLayoutInternals.breadcrumbs}\n discoveredBreadcrumbs={appLayoutInternals.discoveredBreadcrumbs}\n includeTestUtils={true}\n />\n </AppLayoutBuiltInErrorBoundary>\n )}\n {(drawers?.length ||\n globalDrawers?.length ||\n bottomDrawers?.length ||\n (hasSplitPanel && splitPanelToggleProps?.displayed)) && (\n <div className={clsx(styles['universal-toolbar-drawers'])}>\n <AppLayoutBuiltInErrorBoundary>\n <DrawerTriggers\n ariaLabels={ariaLabels}\n activeDrawerId={activeDrawerId ?? null}\n drawers={drawers?.filter(item => !!item.trigger) ?? []}\n drawersFocusRef={drawersFocusRef}\n onActiveDrawerChange={onActiveDrawerChange}\n splitPanelToggleProps={splitPanelToggleProps?.displayed ? splitPanelToggleProps : undefined}\n splitPanelFocusRef={splitPanelFocusRef}\n onSplitPanelToggle={onSplitPanelToggle}\n disabled={anyPanelOpenInMobile}\n globalDrawersFocusControl={globalDrawersFocusControl}\n bottomDrawersFocusRef={bottomDrawersFocusRef}\n globalDrawers={globalDrawers?.filter(item => !!item.trigger) ?? []}\n activeGlobalDrawersIds={activeGlobalDrawersIds ?? []}\n onActiveGlobalDrawersChange={onActiveGlobalDrawersChange}\n expandedDrawerId={expandedDrawerId}\n setExpandedDrawerId={setExpandedDrawerId!}\n bottomDrawers={bottomDrawers}\n onActiveGlobalBottomDrawerChange={onActiveGlobalBottomDrawerChange}\n activeGlobalBottomDrawerId={activeGlobalBottomDrawerId}\n featureNotificationsProps={featureNotificationsProps}\n />\n </AppLayoutBuiltInErrorBoundary>\n </div>\n )}\n </ToolbarContainer>\n </ToolbarSlot>\n );\n}\n\nexport const AppLayoutToolbar = createWidgetizedComponent(AppLayoutToolbarImplementation, ToolbarSkeleton);\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAKtE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAE5F,OAAO,EAAE,cAAc,EAAyB,MAAM,mBAAmB,CAAC;AAC1E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAkDrC,MAAM,UAAU,8BAA8B,CAAC,EAC7C,kBAAkB;AAClB,yGAAyG;AACzG,yCAAyC;AACzC,YAAY,GAAG,EAAE,EACjB,yBAAyB,GACW;;IACpC,MAAM,EACJ,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,sBAAsB,GACvB,GAAG,kBAAkB,CAAC;IACvB,MAAM,EACJ,UAAU,EACV,cAAc,EACd,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,yBAAyB,EAC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gB,EAClC,mBAAmB,EAAE,mBAAoB,EACzC,aAAa,EAAE,aAAa,EAC5B,gCAAgC,EAAE,gCAAgC,EAClE,0BAA0B,EAAE,0BAA0B,EACtD,yBAAyB,EAAE,yBAAyB,GACpD,CAC4B,CAC5B,CACP,CACgB,CACP,CACf,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,8BAA8B,EAAE,eAAe,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutProps } from '../../interfaces';\nimport { OnChangeParams } from '../../utils/use-drawers';\nimport { Focusable, FocusControlMultipleStates } from '../../utils/use-focus-control';\nimport { AppLayoutInternals } from '../interfaces';\nimport { ToolbarSkeleton } from '../skeleton/skeleton-parts';\nimport { ToolbarSlot } from '../skeleton/slots';\nimport { ToolbarBreadcrumbsSection, ToolbarContainer } from '../skeleton/toolbar-container';\nimport { FeatureNotificationsProps } from '../state/use-feature-notifications';\nimport { DrawerTriggers, SplitPanelToggleProps } from './drawer-triggers';\nimport TriggerButton from './trigger-button';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport { SplitPanelToggleProps };\n\nexport interface ToolbarProps {\n ariaLabels?: AppLayoutProps.Labels;\n // navigation\n hasNavigation?: boolean;\n navigationOpen?: boolean;\n onNavigationToggle?: (open: boolean) => void;\n navigationFocusRef?: React.Ref<Focusable>;\n\n // breadcrumbs\n hasBreadcrumbsPortal?: boolean;\n\n // split panel\n hasSplitPanel?: boolean;\n splitPanelToggleProps?: SplitPanelToggleProps;\n splitPanelFocusRef?: React.Ref<Focusable>;\n onSplitPanelToggle?: () => void;\n\n // drawers\n activeDrawerId?: string | null;\n drawers?: ReadonlyArray<AppLayoutProps.Drawer>;\n drawersFocusRef?: React.Ref<Focusable>;\n bottomDrawersFocusRef?: React.Ref<Focusable>;\n globalDrawersFocusControl?: FocusControlMultipleStates;\n onActiveDrawerChange?: (drawerId: string | null, params: OnChangeParams) => void;\n globalDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n activeGlobalDrawersIds?: ReadonlyArray<string>;\n onActiveGlobalDrawersChange?: ((drawerId: string, params: OnChangeParams) => void) | undefined;\n bottomDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n activeGlobalBottomDrawerId?: string | null;\n onActiveGlobalBottomDrawerChange?: (value: string | null, params: OnChangeParams) => void;\n\n expandedDrawerId?: string | null;\n setExpandedDrawerId?: (value: string | null) => void;\n\n aiDrawer?: AppLayoutProps.Drawer;\n onActiveAiDrawerChange?: (value: string | null) => void;\n activeAiDrawerId?: string | null;\n aiDrawerFocusRef?: React.Ref<Focusable>;\n}\n\nexport interface AppLayoutToolbarImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n toolbarProps: ToolbarProps;\n featureNotificationsProps?: FeatureNotificationsProps;\n}\n\nexport function AppLayoutToolbarImplementation({\n appLayoutInternals,\n // the value could be undefined if this component is loaded as a widget by a different app layout version\n // not testable in a single-version setup\n toolbarProps = {},\n featureNotificationsProps,\n}: AppLayoutToolbarImplementationProps) {\n const {\n breadcrumbs,\n discoveredBreadcrumbs,\n verticalOffsets,\n isMobile,\n setToolbarHeight,\n aiDrawer,\n activeAiDrawer,\n onActiveAiDrawerChange,\n } = appLayoutInternals;\n const {\n ariaLabels,\n activeDrawerId,\n drawers,\n drawersFocusRef,\n onActiveDrawerChange,\n globalDrawersFocusControl,\n globalDrawers,\n activeGlobalDrawersIds,\n onActiveGlobalDrawersChange,\n hasNavigation,\n navigationOpen,\n navigationFocusRef,\n onNavigationToggle,\n hasSplitPanel,\n splitPanelFocusRef,\n splitPanelToggleProps,\n onSplitPanelToggle,\n expandedDrawerId,\n setExpandedDrawerId,\n aiDrawerFocusRef,\n onActiveGlobalBottomDrawerChange,\n activeGlobalBottomDrawerId,\n bottomDrawersFocusRef,\n bottomDrawers,\n } = toolbarProps;\n const drawerExpandedMode = !!expandedDrawerId;\n const ref = useRef<HTMLElement>(null);\n const aiDrawerTransitionRef = useRef<HTMLDivElement>(null);\n const activeAiDrawerId = activeAiDrawer?.id;\n useResizeObserver(ref, entry => setToolbarHeight(entry.borderBoxHeight));\n useEffect(() => {\n return () => {\n setToolbarHeight(0);\n };\n // unmount effect only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const anyPanelOpenInMobile =\n !!isMobile &&\n (!!activeDrawerId ||\n !!activeGlobalDrawersIds?.length ||\n !!activeAiDrawerId ||\n !!activeGlobalBottomDrawerId ||\n (!!navigationOpen && !!hasNavigation));\n useEffect(() => {\n if (anyPanelOpenInMobile) {\n document.body.classList.add(styles['block-body-scroll']);\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n return () => {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n }, [anyPanelOpenInMobile]);\n\n const navLandmarkAttributes = navigationOpen\n ? { role: 'presentation' }\n : { role: 'navigation', 'aria-label': ariaLabels?.navigation };\n\n return (\n <ToolbarSlot\n ref={ref}\n className={clsx((aiDrawer?.trigger || !!activeAiDrawerId) && styles['with-ai-drawer'], {\n [testutilStyles['mobile-bar']]: isMobile,\n })}\n style={{\n insetBlockStart: verticalOffsets.toolbar,\n }}\n >\n <AppLayoutBuiltInErrorBoundary>\n <Transition\n in={!!(aiDrawer?.trigger && !activeAiDrawerId)}\n timeout={{ enter: 0, exit: 165 }}\n mountOnEnter={true}\n unmountOnExit={true}\n nodeRef={aiDrawerTransitionRef}\n >\n {state => (\n <div\n className={clsx(!!aiDrawer?.trigger?.customIcon && styles['universal-toolbar-ai-custom'], [\n sharedStyles['with-motion-horizontal'],\n ])}\n style={{\n opacity: ['entering', 'exiting'].includes(state) ? 0 : 1,\n }}\n >\n <TriggerButton\n ariaLabel={aiDrawer?.ariaLabels?.triggerButton}\n ariaExpanded={!!activeAiDrawerId}\n iconName={aiDrawer?.trigger!.iconName}\n iconSvg={aiDrawer?.trigger!.iconSvg}\n customSvg={aiDrawer?.trigger!.customIcon}\n className={testutilStyles['ai-drawer-toggle']}\n onClick={() => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n onActiveAiDrawerChange?.(aiDrawer?.id ?? null, { initiatedByUserAction: true });\n }}\n ref={aiDrawerFocusRef}\n selected={!drawerExpandedMode && !!activeAiDrawerId}\n disabled={anyPanelOpenInMobile}\n variant={aiDrawer?.trigger?.customIcon ? 'custom' : 'default'}\n testId={`awsui-app-layout-trigger-${aiDrawer?.id}`}\n isForPreviousActiveDrawer={true}\n />\n </div>\n )}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n <ToolbarContainer hasAiDrawer={!!activeAiDrawerId}>\n {hasNavigation && (\n <nav {...navLandmarkAttributes} className={clsx(styles['universal-toolbar-nav'])}>\n <AppLayoutBuiltInErrorBoundary>\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle ?? undefined}\n ariaExpanded={!drawerExpandedMode && navigationOpen}\n iconName=\"menu\"\n className={testutilStyles['navigation-toggle']}\n onClick={() => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n if (navigationOpen && expandedDrawerId) {\n return;\n }\n onNavigationToggle?.(!navigationOpen);\n }}\n ref={navigationFocusRef}\n selected={!drawerExpandedMode && navigationOpen}\n disabled={anyPanelOpenInMobile}\n />\n </AppLayoutBuiltInErrorBoundary>\n </nav>\n )}\n {(breadcrumbs || discoveredBreadcrumbs) && (\n <AppLayoutBuiltInErrorBoundary>\n <ToolbarBreadcrumbsSection\n ownBreadcrumbs={appLayoutInternals.breadcrumbs}\n discoveredBreadcrumbs={appLayoutInternals.discoveredBreadcrumbs}\n includeTestUtils={true}\n />\n </AppLayoutBuiltInErrorBoundary>\n )}\n {(drawers?.length ||\n globalDrawers?.length ||\n bottomDrawers?.length ||\n (hasSplitPanel && splitPanelToggleProps?.displayed)) && (\n <div className={clsx(styles['universal-toolbar-drawers'])}>\n <AppLayoutBuiltInErrorBoundary>\n <DrawerTriggers\n ariaLabels={ariaLabels}\n activeDrawerId={activeDrawerId ?? null}\n drawers={drawers?.filter(item => !!item.trigger) ?? []}\n drawersFocusRef={drawersFocusRef}\n onActiveDrawerChange={onActiveDrawerChange}\n splitPanelToggleProps={splitPanelToggleProps?.displayed ? splitPanelToggleProps : undefined}\n splitPanelFocusRef={splitPanelFocusRef}\n onSplitPanelToggle={onSplitPanelToggle}\n disabled={anyPanelOpenInMobile}\n globalDrawersFocusControl={globalDrawersFocusControl}\n bottomDrawersFocusRef={bottomDrawersFocusRef}\n globalDrawers={globalDrawers?.filter(item => !!item.trigger) ?? []}\n activeGlobalDrawersIds={activeGlobalDrawersIds ?? []}\n onActiveGlobalDrawersChange={onActiveGlobalDrawersChange}\n expandedDrawerId={expandedDrawerId}\n setExpandedDrawerId={setExpandedDrawerId!}\n bottomDrawers={bottomDrawers}\n onActiveGlobalBottomDrawerChange={onActiveGlobalBottomDrawerChange}\n activeGlobalBottomDrawerId={activeGlobalBottomDrawerId}\n featureNotificationsProps={featureNotificationsProps}\n />\n </AppLayoutBuiltInErrorBoundary>\n </div>\n )}\n </ToolbarContainer>\n </ToolbarSlot>\n );\n}\n\nexport const AppLayoutToolbar = createWidgetizedComponent(AppLayoutToolbarImplementation, ToolbarSkeleton);\n"]}
|
|
@@ -49,7 +49,7 @@ export interface TriggerButtonProps {
|
|
|
49
49
|
*/
|
|
50
50
|
isForSplitPanel?: boolean;
|
|
51
51
|
tabIndex?: number | undefined;
|
|
52
|
-
variant?: '
|
|
52
|
+
variant?: 'default' | 'custom';
|
|
53
53
|
}
|
|
54
54
|
declare const _default: React.ForwardRefExoticComponent<TriggerButtonProps & React.RefAttributes<ButtonProps.Ref>>;
|
|
55
55
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiE,MAAM,OAAO,CAAC;AAStF,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAOxD,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAEpD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAiE,MAAM,OAAO,CAAC;AAStF,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAOxD,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAEpD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAChC;;AAkMD,wBAA+C"}
|
|
@@ -7,7 +7,7 @@ import Icon from '../../../../icon/internal';
|
|
|
7
7
|
import Tooltip from '../../../../tooltip/internal.js';
|
|
8
8
|
import testutilStyles from '../../../test-classes/styles.css.js';
|
|
9
9
|
import styles from './styles.css.js';
|
|
10
|
-
function TriggerButton({ ariaLabel, className, iconName, iconSvg, customSvg, ariaExpanded, ariaControls, onClick, testId, disabled = false, badge, selected = false, hasTooltip = false, tooltipText, hasOpenDrawer = false, isMobile = false, isForPreviousActiveDrawer = false, isForSplitPanel = false, variant = '
|
|
10
|
+
function TriggerButton({ ariaLabel, className, iconName, iconSvg, customSvg, ariaExpanded, ariaControls, onClick, testId, disabled = false, badge, selected = false, hasTooltip = false, tooltipText, hasOpenDrawer = false, isMobile = false, isForPreviousActiveDrawer = false, isForSplitPanel = false, variant = 'default', }, ref) {
|
|
11
11
|
const containerRef = useRef(null);
|
|
12
12
|
const tooltipValue = tooltipText ? tooltipText : ariaLabel ? ariaLabel : '';
|
|
13
13
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
@@ -114,7 +114,6 @@ function TriggerButton({ ariaLabel, className, iconName, iconSvg, customSvg, ari
|
|
|
114
114
|
}), className: styles['trigger-wrapper'] },
|
|
115
115
|
React.createElement("button", { "aria-expanded": ariaExpanded, "aria-controls": ariaControls, "aria-haspopup": true, "aria-label": ariaLabel, "aria-disabled": disabled, disabled: disabled, className: clsx(styles.trigger, styles[variant], {
|
|
116
116
|
[styles.selected]: selected,
|
|
117
|
-
[styles['trigger-with-badge']]: badge,
|
|
118
117
|
[testutilStyles['drawers-trigger-with-badge']]: badge,
|
|
119
118
|
}, className), onClick: handleTriggerClick, ref: ref, type: "button", "data-testid": testId, "data-shift-focus": "awsui-layout-drawer-trigger", ...getAnalyticsMetadataAttribute(triggerEventMetadata) }, customSvg !== null && customSvg !== void 0 ? customSvg : ((iconName || iconSvg) && React.createElement(Icon, { name: iconName, svg: iconSvg }))),
|
|
120
119
|
badge && React.createElement("div", { className: styles.dot }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAQjH,OAAO,IAAI,MAAM,2BAA2B,CAAC;AAC7C,OAAO,OAAO,MAAM,iCAAiC,CAAC;AAEtD,OAAO,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAsDrC,SAAS,aAAa,CACpB,EACE,SAAS,EACT,SAAS,EACT,QAAQ,EACR,OAAO,EACP,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,OAAO,EACP,MAAM,EACN,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,UAAU,GAAG,KAAK,EAClB,WAAW,EACX,aAAa,GAAG,KAAK,EACrB,QAAQ,GAAG,KAAK,EAChB,yBAAyB,GAAG,KAAK,EACjC,eAAe,GAAG,KAAK,EACvB,OAAO,GAAG,QAAQ,GACC,EACrB,GAA+B;IAE/B,MAAM,YAAY,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IACzD,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5E,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAC/D,MAAM,CAAC,eAAe,EAAE,iBA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ACb,cAAc,CAAC,KAAK,CAAC,CAAC;gBACtB,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC,GACD,CACH,CACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport {\n GeneratedAnalyticsMetadataAppLayoutToolbarClose,\n GeneratedAnalyticsMetadataAppLayoutToolbarOpen,\n} from '../../../../app-layout-toolbar/analytics-metadata/interfaces';\nimport { ButtonProps } from '../../../../button/interfaces';\nimport { IconProps } from '../../../../icon/interfaces';\nimport Icon from '../../../../icon/internal';\nimport Tooltip from '../../../../tooltip/internal.js';\n\nimport testutilStyles from '../../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface TriggerButtonProps {\n ariaLabel?: string;\n className?: string;\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n customSvg?: React.ReactNode;\n ariaExpanded: boolean | undefined;\n ariaControls?: string;\n disabled?: boolean;\n /**\n * Ovewrwrites any internal testIds when provided\n */\n testId?: string;\n /**\n * If button is selected. Used only for desktop and applies a selected class\n */\n selected?: boolean;\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n\n badge?: boolean;\n /**\n * If the button is expected to have a tooltip. When false it will not set the event listeners\n *\n * defaults to false\n */\n hasTooltip?: boolean;\n /**\n * This text allows for a customized tooltip.\n *\n * When falsy, the tooltip will parse the tooltip form the aria-lable\n */\n tooltipText?: string;\n hasOpenDrawer?: boolean;\n /**\n * If the AppLayout is in mobile mode\n * Used to determine if and where to render tooltips\n */\n isMobile?: boolean;\n /**\n * set to true if the trigger button was used to open the last active drawer\n * this is also used to hide the tooltip should the focus be set programmatically\n * on focus from a drawer close using this\n */\n isForPreviousActiveDrawer?: boolean;\n /**\n * if the trigger button is for the split panel\n */\n isForSplitPanel?: boolean;\n tabIndex?: number | undefined;\n variant?: 'circle' | 'custom';\n}\n\nfunction TriggerButton(\n {\n ariaLabel,\n className,\n iconName,\n iconSvg,\n customSvg,\n ariaExpanded,\n ariaControls,\n onClick,\n testId,\n disabled = false,\n badge,\n selected = false,\n hasTooltip = false,\n tooltipText,\n hasOpenDrawer = false,\n isMobile = false,\n isForPreviousActiveDrawer = false,\n isForSplitPanel = false,\n variant = 'circle',\n }: TriggerButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n) {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const tooltipValue = tooltipText ? tooltipText : ariaLabel ? ariaLabel : '';\n const [showTooltip, setShowTooltip] = useState<boolean>(false);\n const [suppressTooltip, setSupressTooltip] = useState<boolean>(false);\n\n const handleTriggerClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation(); // Stop the event from propagating to the badge icon\n setShowTooltip(false);\n setSupressTooltip(true);\n onClick(event);\n };\n\n const handleBlur = (keepSupressed = false) => {\n setSupressTooltip(keepSupressed);\n setShowTooltip(false);\n };\n\n const handlePointerEnter = (event: React.MouseEvent) => {\n const suppressedTooltip = event.currentTarget.querySelector('button')?.dataset?.awsuiSuppressTooltip === 'true';\n if (suppressedTooltip) {\n return;\n }\n setSupressTooltip(false);\n setShowTooltip(true);\n };\n\n /**\n * Takes the drawer being closed and the data-shift-focus value from a close button on that drawer that persists\n * on the event relatedTarget to determine not to show the tooltip\n * @param event\n */\n const handleOnFocus = useCallback(\n (event: FocusEvent) => {\n let shouldShowTooltip = false;\n const eventWithRelatedTarget = event as any;\n const relatedTarget = eventWithRelatedTarget?.relatedTarget;\n const isSuppressedOnTarget = eventWithRelatedTarget?.target?.dataset?.awsuiSuppressTooltip === 'true';\n const isFromAnotherTrigger = relatedTarget?.dataset?.shiftFocus === 'awsui-layout-drawer-trigger';\n if (\n (isForSplitPanel && !!relatedTarget) || // relatedTarget is null when split panel is closed\n (!isForSplitPanel &&\n (isFromAnotherTrigger || // for key navigation from another trigger button\n !isForPreviousActiveDrawer)) // for when the drawer was not opened recently\n ) {\n shouldShowTooltip = true;\n }\n if (isSuppressedOnTarget) {\n shouldShowTooltip = false;\n }\n setSupressTooltip(!shouldShowTooltip);\n setShowTooltip(true);\n },\n [\n // To assert reference equality check\n isForPreviousActiveDrawer,\n isForSplitPanel,\n ]\n );\n\n const tooltipVisible = useMemo(() => {\n return (\n hasTooltip &&\n showTooltip &&\n !suppressTooltip &&\n !!containerRef?.current &&\n tooltipValue &&\n !(isMobile && hasOpenDrawer)\n );\n }, [hasTooltip, showTooltip, containerRef, tooltipValue, isMobile, hasOpenDrawer, suppressTooltip]);\n\n useEffect(() => {\n if (hasTooltip && tooltipValue) {\n const close = () => {\n setShowTooltip(false);\n setSupressTooltip(false);\n };\n\n const shouldCloseTooltip = (event: PointerEvent) => {\n if (event.target && containerRef && (containerRef.current as any)?.contains(event.target as HTMLElement)) {\n return false;\n }\n return true;\n };\n\n const handlePointerDownEvent = (event: PointerEvent) => {\n if (shouldCloseTooltip(event)) {\n close();\n }\n };\n\n const handleKeyDownEvent = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n close();\n }\n };\n\n const wrapperDiv = containerRef.current;\n if (wrapperDiv) {\n const controller = new AbortController();\n wrapperDiv.addEventListener('pointerdown', handlePointerDownEvent, { signal: controller.signal });\n wrapperDiv.addEventListener('keydown', handleKeyDownEvent, { signal: controller.signal });\n\n return () => {\n controller.abort();\n };\n }\n }\n }, [containerRef, hasTooltip, tooltipValue]);\n\n const triggerEventMetadata:\n | GeneratedAnalyticsMetadataAppLayoutToolbarClose\n | GeneratedAnalyticsMetadataAppLayoutToolbarOpen = {\n action: selected ? 'close' : 'open',\n detail: { label: { root: 'self' } },\n };\n\n return (\n <div\n ref={containerRef}\n {...(hasTooltip && {\n onPointerEnter: event => handlePointerEnter(event),\n onPointerLeave: () => handleBlur(true),\n onFocus: e => handleOnFocus(e as any),\n onBlur: () => handleBlur(true),\n })}\n className={styles['trigger-wrapper']}\n >\n <button\n aria-expanded={ariaExpanded}\n aria-controls={ariaControls}\n aria-haspopup={true}\n aria-label={ariaLabel}\n aria-disabled={disabled}\n disabled={disabled}\n className={clsx(\n styles.trigger,\n styles[variant],\n {\n [styles.selected]: selected,\n [styles['trigger-with-badge']]: badge,\n [testutilStyles['drawers-trigger-with-badge']]: badge,\n },\n className\n )}\n onClick={handleTriggerClick}\n ref={ref as Ref<HTMLButtonElement>}\n type=\"button\"\n data-testid={testId}\n data-shift-focus=\"awsui-layout-drawer-trigger\"\n {...getAnalyticsMetadataAttribute(triggerEventMetadata)}\n >\n {customSvg ?? ((iconName || iconSvg) && <Icon name={iconName} svg={iconSvg} />)}\n </button>\n {badge && <div className={styles.dot} />}\n {tooltipVisible && (\n <Tooltip\n getTrack={() => containerRef.current}\n className={testutilStyles['trigger-tooltip']}\n content={tooltipValue}\n onEscape={() => {\n setShowTooltip(false);\n setSupressTooltip(false);\n }}\n />\n )}\n </div>\n );\n}\n\nexport default React.forwardRef(TriggerButton);\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtF,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAQjH,OAAO,IAAI,MAAM,2BAA2B,CAAC;AAC7C,OAAO,OAAO,MAAM,iCAAiC,CAAC;AAEtD,OAAO,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,MAAM,MAAM,iBAAiB,CAAC;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4B,CAAC,CAAC,EAAE,KAAK;aACtD,EACD,SAAS,CACV,EACD,OAAO,EAAE,kBAAkB,EAC3B,GAAG,EAAE,GAA6B,EAClC,IAAI,EAAC,QAAQ,iBACA,MAAM,sBACF,6BAA6B,KAC1C,6BAA6B,CAAC,oBAAoB,CAAC,IAEtD,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,CAAC,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,oBAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,GAAI,CAAC,CACxE;QACR,KAAK,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,GAAG,GAAI;QACvC,cAAc,IAAI,CACjB,oBAAC,OAAO,IACN,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,EACpC,SAAS,EAAE,cAAc,CAAC,iBAAiB,CAAC,EAC5C,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,GAAG,EAAE;gBACb,cAAc,CAAC,KAAK,CAAC,CAAC;gBACtB,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC,GACD,CACH,CACG,CACP,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport {\n GeneratedAnalyticsMetadataAppLayoutToolbarClose,\n GeneratedAnalyticsMetadataAppLayoutToolbarOpen,\n} from '../../../../app-layout-toolbar/analytics-metadata/interfaces';\nimport { ButtonProps } from '../../../../button/interfaces';\nimport { IconProps } from '../../../../icon/interfaces';\nimport Icon from '../../../../icon/internal';\nimport Tooltip from '../../../../tooltip/internal.js';\n\nimport testutilStyles from '../../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface TriggerButtonProps {\n ariaLabel?: string;\n className?: string;\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n customSvg?: React.ReactNode;\n ariaExpanded: boolean | undefined;\n ariaControls?: string;\n disabled?: boolean;\n /**\n * Ovewrwrites any internal testIds when provided\n */\n testId?: string;\n /**\n * If button is selected. Used only for desktop and applies a selected class\n */\n selected?: boolean;\n onClick: React.MouseEventHandler<HTMLButtonElement>;\n\n badge?: boolean;\n /**\n * If the button is expected to have a tooltip. When false it will not set the event listeners\n *\n * defaults to false\n */\n hasTooltip?: boolean;\n /**\n * This text allows for a customized tooltip.\n *\n * When falsy, the tooltip will parse the tooltip form the aria-lable\n */\n tooltipText?: string;\n hasOpenDrawer?: boolean;\n /**\n * If the AppLayout is in mobile mode\n * Used to determine if and where to render tooltips\n */\n isMobile?: boolean;\n /**\n * set to true if the trigger button was used to open the last active drawer\n * this is also used to hide the tooltip should the focus be set programmatically\n * on focus from a drawer close using this\n */\n isForPreviousActiveDrawer?: boolean;\n /**\n * if the trigger button is for the split panel\n */\n isForSplitPanel?: boolean;\n tabIndex?: number | undefined;\n variant?: 'default' | 'custom';\n}\n\nfunction TriggerButton(\n {\n ariaLabel,\n className,\n iconName,\n iconSvg,\n customSvg,\n ariaExpanded,\n ariaControls,\n onClick,\n testId,\n disabled = false,\n badge,\n selected = false,\n hasTooltip = false,\n tooltipText,\n hasOpenDrawer = false,\n isMobile = false,\n isForPreviousActiveDrawer = false,\n isForSplitPanel = false,\n variant = 'default',\n }: TriggerButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n) {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const tooltipValue = tooltipText ? tooltipText : ariaLabel ? ariaLabel : '';\n const [showTooltip, setShowTooltip] = useState<boolean>(false);\n const [suppressTooltip, setSupressTooltip] = useState<boolean>(false);\n\n const handleTriggerClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.stopPropagation(); // Stop the event from propagating to the badge icon\n setShowTooltip(false);\n setSupressTooltip(true);\n onClick(event);\n };\n\n const handleBlur = (keepSupressed = false) => {\n setSupressTooltip(keepSupressed);\n setShowTooltip(false);\n };\n\n const handlePointerEnter = (event: React.MouseEvent) => {\n const suppressedTooltip = event.currentTarget.querySelector('button')?.dataset?.awsuiSuppressTooltip === 'true';\n if (suppressedTooltip) {\n return;\n }\n setSupressTooltip(false);\n setShowTooltip(true);\n };\n\n /**\n * Takes the drawer being closed and the data-shift-focus value from a close button on that drawer that persists\n * on the event relatedTarget to determine not to show the tooltip\n * @param event\n */\n const handleOnFocus = useCallback(\n (event: FocusEvent) => {\n let shouldShowTooltip = false;\n const eventWithRelatedTarget = event as any;\n const relatedTarget = eventWithRelatedTarget?.relatedTarget;\n const isSuppressedOnTarget = eventWithRelatedTarget?.target?.dataset?.awsuiSuppressTooltip === 'true';\n const isFromAnotherTrigger = relatedTarget?.dataset?.shiftFocus === 'awsui-layout-drawer-trigger';\n if (\n (isForSplitPanel && !!relatedTarget) || // relatedTarget is null when split panel is closed\n (!isForSplitPanel &&\n (isFromAnotherTrigger || // for key navigation from another trigger button\n !isForPreviousActiveDrawer)) // for when the drawer was not opened recently\n ) {\n shouldShowTooltip = true;\n }\n if (isSuppressedOnTarget) {\n shouldShowTooltip = false;\n }\n setSupressTooltip(!shouldShowTooltip);\n setShowTooltip(true);\n },\n [\n // To assert reference equality check\n isForPreviousActiveDrawer,\n isForSplitPanel,\n ]\n );\n\n const tooltipVisible = useMemo(() => {\n return (\n hasTooltip &&\n showTooltip &&\n !suppressTooltip &&\n !!containerRef?.current &&\n tooltipValue &&\n !(isMobile && hasOpenDrawer)\n );\n }, [hasTooltip, showTooltip, containerRef, tooltipValue, isMobile, hasOpenDrawer, suppressTooltip]);\n\n useEffect(() => {\n if (hasTooltip && tooltipValue) {\n const close = () => {\n setShowTooltip(false);\n setSupressTooltip(false);\n };\n\n const shouldCloseTooltip = (event: PointerEvent) => {\n if (event.target && containerRef && (containerRef.current as any)?.contains(event.target as HTMLElement)) {\n return false;\n }\n return true;\n };\n\n const handlePointerDownEvent = (event: PointerEvent) => {\n if (shouldCloseTooltip(event)) {\n close();\n }\n };\n\n const handleKeyDownEvent = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n close();\n }\n };\n\n const wrapperDiv = containerRef.current;\n if (wrapperDiv) {\n const controller = new AbortController();\n wrapperDiv.addEventListener('pointerdown', handlePointerDownEvent, { signal: controller.signal });\n wrapperDiv.addEventListener('keydown', handleKeyDownEvent, { signal: controller.signal });\n\n return () => {\n controller.abort();\n };\n }\n }\n }, [containerRef, hasTooltip, tooltipValue]);\n\n const triggerEventMetadata:\n | GeneratedAnalyticsMetadataAppLayoutToolbarClose\n | GeneratedAnalyticsMetadataAppLayoutToolbarOpen = {\n action: selected ? 'close' : 'open',\n detail: { label: { root: 'self' } },\n };\n\n return (\n <div\n ref={containerRef}\n {...(hasTooltip && {\n onPointerEnter: event => handlePointerEnter(event),\n onPointerLeave: () => handleBlur(true),\n onFocus: e => handleOnFocus(e as any),\n onBlur: () => handleBlur(true),\n })}\n className={styles['trigger-wrapper']}\n >\n <button\n aria-expanded={ariaExpanded}\n aria-controls={ariaControls}\n aria-haspopup={true}\n aria-label={ariaLabel}\n aria-disabled={disabled}\n disabled={disabled}\n className={clsx(\n styles.trigger,\n styles[variant],\n {\n [styles.selected]: selected,\n [testutilStyles['drawers-trigger-with-badge']]: badge,\n },\n className\n )}\n onClick={handleTriggerClick}\n ref={ref as Ref<HTMLButtonElement>}\n type=\"button\"\n data-testid={testId}\n data-shift-focus=\"awsui-layout-drawer-trigger\"\n {...getAnalyticsMetadataAttribute(triggerEventMetadata)}\n >\n {customSvg ?? ((iconName || iconSvg) && <Icon name={iconName} svg={iconSvg} />)}\n </button>\n {badge && <div className={styles.dot} />}\n {tooltipVisible && (\n <Tooltip\n getTrack={() => containerRef.current}\n className={testutilStyles['trigger-tooltip']}\n content={tooltipValue}\n onEscape={() => {\n setShowTooltip(false);\n setSupressTooltip(false);\n }}\n />\n )}\n </div>\n );\n}\n\nexport default React.forwardRef(TriggerButton);\n"]}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"trigger": "
|
|
5
|
-
"custom": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"dot": "awsui_dot_lpshu_10v1l_219"
|
|
4
|
+
"trigger": "awsui_trigger_lpshu_j537b_145",
|
|
5
|
+
"custom": "awsui_custom_lpshu_j537b_151",
|
|
6
|
+
"default": "awsui_default_lpshu_j537b_160",
|
|
7
|
+
"selected": "awsui_selected_lpshu_j537b_176",
|
|
8
|
+
"trigger-wrapper": "awsui_trigger-wrapper_lpshu_j537b_187",
|
|
9
|
+
"dot": "awsui_dot_lpshu_j537b_212"
|
|
11
10
|
};
|
|
12
11
|
|
|
@@ -142,66 +142,59 @@
|
|
|
142
142
|
*/
|
|
143
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.
|
|
145
|
+
.awsui_trigger_lpshu_j537b_145:not(#\9) {
|
|
146
146
|
all: initial;
|
|
147
147
|
cursor: pointer;
|
|
148
148
|
color: var(--color-text-interactive-default-ugh9wp, #424650);
|
|
149
149
|
text-align: center;
|
|
150
150
|
}
|
|
151
|
-
.
|
|
151
|
+
.awsui_trigger_lpshu_j537b_145.awsui_custom_lpshu_j537b_151:not(#\9) {
|
|
152
152
|
display: flex;
|
|
153
153
|
block-size: 100%;
|
|
154
154
|
inline-size: 100%;
|
|
155
155
|
box-sizing: border-box;
|
|
156
156
|
}
|
|
157
|
-
.
|
|
158
|
-
clip-path: path("M29.2862 10.4145C28.7243 10.5998 28.1238 10.7 27.4999 10.7C24.3519 10.7 21.7999 8.14803 21.7999 5C21.7999 3.92883 22.0954 2.92667 22.6093 2.07057C20.3785 0.754846 17.7774 0 15 0C6.71573 0 0 6.71573 0 15C0 23.2843 6.71573 30 15 30C23.2843 30 30 23.2843 30 15C30 13.4007 29.7497 11.8599 29.2862 10.4145Z");
|
|
159
|
-
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
160
|
-
}
|
|
161
|
-
.awsui_trigger-with-badge_lpshu_10v1l_157:not(#\9):dir(rtl) {
|
|
162
|
-
clip-path: path("M2.21384 10.4145C2.77569 10.5998 3.37617 10.7 4.00007 10.7C7.1481 10.7 9.70007 8.14803 9.70007 5C9.70007 3.92883 9.4046 2.92667 8.89071 2.07057C11.1215 0.754846 13.7226 0 16.5 0C24.7843 0 31.5 6.71573 31.5 15C31.5 23.2843 24.7843 30 16.5 30C8.21573 30 1.5 23.2843 1.5 15C1.5 13.4007 1.75029 11.8599 2.21384 10.4145Z");
|
|
163
|
-
}
|
|
164
|
-
.awsui_trigger_lpshu_10v1l_145:not(#\9):focus {
|
|
157
|
+
.awsui_trigger_lpshu_j537b_145:not(#\9):focus {
|
|
165
158
|
outline: none;
|
|
166
159
|
}
|
|
167
|
-
.
|
|
168
|
-
border-start-start-radius:
|
|
169
|
-
border-start-end-radius:
|
|
170
|
-
border-end-start-radius:
|
|
171
|
-
border-end-end-radius:
|
|
160
|
+
.awsui_trigger_lpshu_j537b_145.awsui_default_lpshu_j537b_160:not(#\9) {
|
|
161
|
+
border-start-start-radius: var(--border-radius-button-7bgkcs, 20px);
|
|
162
|
+
border-start-end-radius: var(--border-radius-button-7bgkcs, 20px);
|
|
163
|
+
border-end-start-radius: var(--border-radius-button-7bgkcs, 20px);
|
|
164
|
+
border-end-end-radius: var(--border-radius-button-7bgkcs, 20px);
|
|
172
165
|
block-size: 30px;
|
|
173
166
|
inline-size: 30px;
|
|
174
167
|
}
|
|
175
|
-
.
|
|
168
|
+
.awsui_trigger_lpshu_j537b_145.awsui_default_lpshu_j537b_160:not(#\9):hover {
|
|
176
169
|
background: var(--color-background-input-disabled-dihaja, #ebebf0);
|
|
177
170
|
color: var(--color-text-interactive-hover-6naf7i, #0f141a);
|
|
178
171
|
}
|
|
179
|
-
.
|
|
172
|
+
.awsui_trigger_lpshu_j537b_145.awsui_default_lpshu_j537b_160:not(#\9):active {
|
|
180
173
|
background: var(--color-background-control-disabled-1f3718, #dedee3);
|
|
181
174
|
color: var(--color-text-interactive-hover-6naf7i, #0f141a);
|
|
182
175
|
}
|
|
183
|
-
.
|
|
176
|
+
.awsui_trigger_lpshu_j537b_145.awsui_default_lpshu_j537b_160.awsui_selected_lpshu_j537b_176:not(#\9) {
|
|
184
177
|
background: var(--color-background-layout-toggle-selected-default-izfana, #006ce0);
|
|
185
178
|
color: var(--color-text-layout-toggle-selected-xpximc, #ffffff);
|
|
186
179
|
}
|
|
187
|
-
.
|
|
180
|
+
.awsui_trigger_lpshu_j537b_145.awsui_default_lpshu_j537b_160.awsui_selected_lpshu_j537b_176:not(#\9):hover {
|
|
188
181
|
background: var(--color-background-layout-toggle-selected-hover-7953u1, #004a9e);
|
|
189
182
|
}
|
|
190
|
-
.
|
|
183
|
+
.awsui_trigger_lpshu_j537b_145.awsui_default_lpshu_j537b_160.awsui_selected_lpshu_j537b_176:not(#\9):active {
|
|
191
184
|
background: var(--color-background-layout-toggle-selected-active-zcl8w3, #006ce0);
|
|
192
185
|
}
|
|
193
186
|
|
|
194
|
-
.awsui_trigger-
|
|
187
|
+
.awsui_trigger-wrapper_lpshu_j537b_187:not(#\9) {
|
|
195
188
|
position: relative;
|
|
196
189
|
}
|
|
197
|
-
.awsui_trigger-
|
|
190
|
+
.awsui_trigger-wrapper_lpshu_j537b_187:not(#\9):has(:focus-visible) {
|
|
198
191
|
position: relative;
|
|
199
192
|
}
|
|
200
|
-
.awsui_trigger-
|
|
193
|
+
.awsui_trigger-wrapper_lpshu_j537b_187:not(#\9):has(:focus-visible) {
|
|
201
194
|
outline: 2px dotted transparent;
|
|
202
195
|
outline-offset: calc(3px - 1px);
|
|
203
196
|
}
|
|
204
|
-
.awsui_trigger-
|
|
197
|
+
.awsui_trigger-wrapper_lpshu_j537b_187:not(#\9):has(:focus-visible)::before {
|
|
205
198
|
content: " ";
|
|
206
199
|
display: block;
|
|
207
200
|
position: absolute;
|
|
@@ -216,7 +209,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
216
209
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-uk47pl, #006ce0);
|
|
217
210
|
}
|
|
218
211
|
|
|
219
|
-
.
|
|
212
|
+
.awsui_dot_lpshu_j537b_212:not(#\9) {
|
|
220
213
|
position: absolute;
|
|
221
214
|
inline-size: 8px;
|
|
222
215
|
block-size: 8px;
|
|
@@ -225,6 +218,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
225
218
|
border-end-start-radius: 8px;
|
|
226
219
|
border-end-end-radius: 8px;
|
|
227
220
|
background-color: var(--color-background-badge-icon-jyxnxa, #db0000);
|
|
228
|
-
inset-block-start: 1px;
|
|
221
|
+
inset-block-start: -1px;
|
|
229
222
|
inset-inline-end: -1px;
|
|
223
|
+
outline: solid 2px var(--color-background-layout-panel-content-xto15e, #ffffff);
|
|
230
224
|
}
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"trigger": "
|
|
6
|
-
"custom": "
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"dot": "awsui_dot_lpshu_10v1l_219"
|
|
5
|
+
"trigger": "awsui_trigger_lpshu_j537b_145",
|
|
6
|
+
"custom": "awsui_custom_lpshu_j537b_151",
|
|
7
|
+
"default": "awsui_default_lpshu_j537b_160",
|
|
8
|
+
"selected": "awsui_selected_lpshu_j537b_176",
|
|
9
|
+
"trigger-wrapper": "awsui_trigger-wrapper_lpshu_j537b_187",
|
|
10
|
+
"dot": "awsui_dot_lpshu_j537b_212"
|
|
12
11
|
};
|
|
13
12
|
|
package/button/styles.css.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"content": "
|
|
5
|
-
"button": "
|
|
6
|
-
"variant-normal": "awsui_variant-
|
|
7
|
-
"disabled": "
|
|
8
|
-
"variant-primary": "awsui_variant-
|
|
9
|
-
"variant-link": "awsui_variant-
|
|
10
|
-
"variant-icon": "awsui_variant-
|
|
11
|
-
"variant-inline-icon": "awsui_variant-inline-
|
|
12
|
-
"variant-inline-icon-pointer-target": "awsui_variant-inline-icon-pointer-
|
|
13
|
-
"variant-inline-link": "awsui_variant-inline-
|
|
14
|
-
"variant-modal-dismiss": "awsui_variant-modal-
|
|
15
|
-
"variant-flashbar-icon": "awsui_variant-flashbar-
|
|
16
|
-
"variant-breadcrumb-group": "awsui_variant-breadcrumb-
|
|
17
|
-
"variant-menu-trigger": "awsui_variant-menu-
|
|
18
|
-
"button-no-text": "awsui_button-no-
|
|
19
|
-
"button-no-wrap": "awsui_button-no-
|
|
20
|
-
"full-width": "awsui_full-
|
|
21
|
-
"icon-left": "awsui_icon-
|
|
22
|
-
"icon-right": "awsui_icon-
|
|
23
|
-
"icon": "
|
|
24
|
-
"link": "
|
|
25
|
-
"disabled-with-reason": "awsui_disabled-with-
|
|
4
|
+
"content": "awsui_content_vjswe_1oayo_153",
|
|
5
|
+
"button": "awsui_button_vjswe_1oayo_157",
|
|
6
|
+
"variant-normal": "awsui_variant-normal_vjswe_1oayo_206",
|
|
7
|
+
"disabled": "awsui_disabled_vjswe_1oayo_227",
|
|
8
|
+
"variant-primary": "awsui_variant-primary_vjswe_1oayo_235",
|
|
9
|
+
"variant-link": "awsui_variant-link_vjswe_1oayo_264",
|
|
10
|
+
"variant-icon": "awsui_variant-icon_vjswe_1oayo_293",
|
|
11
|
+
"variant-inline-icon": "awsui_variant-inline-icon_vjswe_1oayo_322",
|
|
12
|
+
"variant-inline-icon-pointer-target": "awsui_variant-inline-icon-pointer-target_vjswe_1oayo_351",
|
|
13
|
+
"variant-inline-link": "awsui_variant-inline-link_vjswe_1oayo_380",
|
|
14
|
+
"variant-modal-dismiss": "awsui_variant-modal-dismiss_vjswe_1oayo_413",
|
|
15
|
+
"variant-flashbar-icon": "awsui_variant-flashbar-icon_vjswe_1oayo_442",
|
|
16
|
+
"variant-breadcrumb-group": "awsui_variant-breadcrumb-group_vjswe_1oayo_471",
|
|
17
|
+
"variant-menu-trigger": "awsui_variant-menu-trigger_vjswe_1oayo_505",
|
|
18
|
+
"button-no-text": "awsui_button-no-text_vjswe_1oayo_601",
|
|
19
|
+
"button-no-wrap": "awsui_button-no-wrap_vjswe_1oayo_605",
|
|
20
|
+
"full-width": "awsui_full-width_vjswe_1oayo_608",
|
|
21
|
+
"icon-left": "awsui_icon-left_vjswe_1oayo_630",
|
|
22
|
+
"icon-right": "awsui_icon-right_vjswe_1oayo_635",
|
|
23
|
+
"icon": "awsui_icon_vjswe_1oayo_630",
|
|
24
|
+
"link": "awsui_link_vjswe_1oayo_654",
|
|
25
|
+
"disabled-with-reason": "awsui_disabled-with-reason_vjswe_1oayo_654"
|
|
26
26
|
};
|
|
27
27
|
|