@cloudscape-design/components-themeable 3.0.1127 → 3.0.1129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/input/styles.scss +62 -9
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +99 -87
- package/lib/internal/scss/internal/styles/forms/mixins.scss +42 -19
- package/lib/internal/template/alert/styles.css.js +27 -27
- package/lib/internal/template/alert/styles.scoped.css +50 -50
- package/lib/internal/template/alert/styles.selectors.js +27 -27
- package/lib/internal/template/annotation-context/annotation/styles.css.js +24 -24
- package/lib/internal/template/annotation-context/annotation/styles.scoped.css +32 -32
- package/lib/internal/template/annotation-context/annotation/styles.selectors.js +24 -24
- package/lib/internal/template/app-layout/notifications/styles.css.js +3 -3
- package/lib/internal/template/app-layout/notifications/styles.scoped.css +7 -7
- package/lib/internal/template/app-layout/notifications/styles.selectors.js +3 -3
- package/lib/internal/template/app-layout/visual-refresh/styles.css.js +86 -86
- package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +258 -258
- package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js +5 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +27 -27
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +84 -84
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +27 -27
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js +3 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/skeleton-parts.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/skeleton-parts.js +4 -5
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/skeleton-parts.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/slots.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/slots.js +8 -3
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/slots.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +27 -27
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +54 -54
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +27 -27
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts +20 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js +19 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.js +0 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +7 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
- package/lib/internal/template/attribute-editor/styles.css.js +15 -15
- package/lib/internal/template/attribute-editor/styles.scoped.css +28 -28
- package/lib/internal/template/attribute-editor/styles.selectors.js +15 -15
- package/lib/internal/template/autosuggest/index.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/index.js +3 -2
- package/lib/internal/template/autosuggest/index.js.map +1 -1
- package/lib/internal/template/autosuggest/interfaces.d.ts +4 -0
- package/lib/internal/template/autosuggest/interfaces.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/interfaces.js.map +1 -1
- package/lib/internal/template/autosuggest/internal.d.ts.map +1 -1
- package/lib/internal/template/autosuggest/internal.js +3 -3
- package/lib/internal/template/autosuggest/internal.js.map +1 -1
- package/lib/internal/template/breadcrumb-group/item/styles.css.js +7 -7
- package/lib/internal/template/breadcrumb-group/item/styles.scoped.css +28 -28
- package/lib/internal/template/breadcrumb-group/item/styles.selectors.js +7 -7
- package/lib/internal/template/button/styles.css.js +22 -22
- package/lib/internal/template/button/styles.scoped.css +256 -256
- package/lib/internal/template/button/styles.selectors.js +22 -22
- package/lib/internal/template/button-dropdown/item-element/styles.css.js +16 -16
- package/lib/internal/template/button-dropdown/item-element/styles.scoped.css +27 -27
- package/lib/internal/template/button-dropdown/item-element/styles.selectors.js +16 -16
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts +2 -2
- package/lib/internal/template/button-group/icon-toggle-button-item.d.ts.map +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.js +1 -1
- package/lib/internal/template/button-group/icon-toggle-button-item.js.map +1 -1
- package/lib/internal/template/button-group/interfaces.d.ts +4 -1
- package/lib/internal/template/button-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button-group/interfaces.js.map +1 -1
- package/lib/internal/template/checkbox/styles.css.js +3 -3
- package/lib/internal/template/checkbox/styles.scoped.css +11 -11
- package/lib/internal/template/checkbox/styles.selectors.js +3 -3
- package/lib/internal/template/content-layout/styles.css.js +14 -14
- package/lib/internal/template/content-layout/styles.scoped.css +27 -27
- package/lib/internal/template/content-layout/styles.selectors.js +14 -14
- package/lib/internal/template/copy-to-clipboard/internal.d.ts.map +1 -1
- package/lib/internal/template/copy-to-clipboard/internal.js +18 -5
- package/lib/internal/template/copy-to-clipboard/internal.js.map +1 -1
- package/lib/internal/template/date-range-picker/dropdown.d.ts +2 -1
- package/lib/internal/template/date-range-picker/dropdown.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/dropdown.js +2 -2
- package/lib/internal/template/date-range-picker/dropdown.js.map +1 -1
- package/lib/internal/template/date-range-picker/index.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/index.js +2 -2
- package/lib/internal/template/date-range-picker/index.js.map +1 -1
- package/lib/internal/template/date-range-picker/interfaces.d.ts +6 -0
- package/lib/internal/template/date-range-picker/interfaces.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/interfaces.js.map +1 -1
- package/lib/internal/template/date-range-picker/relative-range/index.d.ts +2 -1
- package/lib/internal/template/date-range-picker/relative-range/index.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/relative-range/index.js +4 -1
- package/lib/internal/template/date-range-picker/relative-range/index.js.map +1 -1
- package/lib/internal/template/flashbar/styles.css.js +50 -50
- package/lib/internal/template/flashbar/styles.scoped.css +187 -187
- package/lib/internal/template/flashbar/styles.selectors.js +50 -50
- package/lib/internal/template/help-panel/styles.css.js +6 -6
- package/lib/internal/template/help-panel/styles.scoped.css +73 -73
- package/lib/internal/template/help-panel/styles.selectors.js +6 -6
- package/lib/internal/template/input/index.d.ts.map +1 -1
- package/lib/internal/template/input/index.js +3 -2
- package/lib/internal/template/input/index.js.map +1 -1
- package/lib/internal/template/input/interfaces.d.ts +48 -0
- package/lib/internal/template/input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/input/interfaces.js.map +1 -1
- package/lib/internal/template/input/internal.d.ts.map +1 -1
- package/lib/internal/template/input/internal.js +3 -2
- package/lib/internal/template/input/internal.js.map +1 -1
- package/lib/internal/template/input/styles.css.js +13 -13
- package/lib/internal/template/input/styles.d.ts +3 -0
- package/lib/internal/template/input/styles.d.ts.map +1 -0
- package/lib/internal/template/input/styles.js +42 -0
- package/lib/internal/template/input/styles.js.map +1 -0
- package/lib/internal/template/input/styles.scoped.css +66 -49
- package/lib/internal/template/input/styles.selectors.js +13 -13
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts +1 -0
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js +5 -2
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.d.ts +1 -0
- package/lib/internal/template/internal/analytics/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.css.js +20 -20
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.scoped.css +48 -48
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.selectors.js +20 -20
- package/lib/internal/template/internal/components/dropdown/styles.css.js +20 -20
- package/lib/internal/template/internal/components/dropdown/styles.scoped.css +38 -38
- package/lib/internal/template/internal/components/dropdown/styles.selectors.js +20 -20
- package/lib/internal/template/internal/components/token-list/styles.css.js +10 -10
- package/lib/internal/template/internal/components/token-list/styles.scoped.css +25 -25
- package/lib/internal/template/internal/components/token-list/styles.selectors.js +10 -10
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts +12 -0
- package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/lib/internal/template/internal/generated/custom-css-properties/index.js +98 -86
- package/lib/internal/template/internal/generated/custom-css-properties/index.js.map +1 -1
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +0 -4
- package/lib/internal/template/internal/generated/styles/tokens.js +0 -4
- package/lib/internal/template/internal/generated/theming/index.cjs +0 -84
- package/lib/internal/template/internal/generated/theming/index.js +0 -84
- package/lib/internal/template/internal/plugins/widget/interfaces.d.ts +1 -1
- package/lib/internal/template/internal/plugins/widget/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/widget/interfaces.js.map +1 -1
- package/lib/internal/template/link/styles.css.js +20 -20
- package/lib/internal/template/link/styles.scoped.css +103 -103
- package/lib/internal/template/link/styles.selectors.js +20 -20
- package/lib/internal/template/package.json +2 -0
- package/lib/internal/template/popover/container.d.ts.map +1 -1
- package/lib/internal/template/popover/container.js +2 -5
- package/lib/internal/template/popover/container.js.map +1 -1
- package/lib/internal/template/popover/use-position-observer.d.ts +1 -2
- package/lib/internal/template/popover/use-position-observer.d.ts.map +1 -1
- package/lib/internal/template/popover/use-position-observer.js +10 -8
- package/lib/internal/template/popover/use-position-observer.js.map +1 -1
- package/lib/internal/template/radio-group/styles.css.js +10 -10
- package/lib/internal/template/radio-group/styles.scoped.css +22 -22
- package/lib/internal/template/radio-group/styles.selectors.js +10 -10
- package/lib/internal/template/select/parts/filter.d.ts +1 -1
- package/lib/internal/template/select/parts/filter.d.ts.map +1 -1
- package/lib/internal/template/side-navigation/interfaces.d.ts +4 -0
- package/lib/internal/template/side-navigation/interfaces.d.ts.map +1 -1
- package/lib/internal/template/side-navigation/interfaces.js.map +1 -1
- package/lib/internal/template/side-navigation/parts.d.ts.map +1 -1
- package/lib/internal/template/side-navigation/parts.js +4 -1
- package/lib/internal/template/side-navigation/parts.js.map +1 -1
- package/lib/internal/template/slider/styles.css.js +26 -26
- package/lib/internal/template/slider/styles.scoped.css +86 -86
- package/lib/internal/template/slider/styles.selectors.js +26 -26
- package/lib/internal/template/spinner/styles.css.js +13 -13
- package/lib/internal/template/spinner/styles.scoped.css +39 -39
- package/lib/internal/template/spinner/styles.selectors.js +13 -13
- package/lib/internal/template/tag-editor/styles.css.js +3 -3
- package/lib/internal/template/tag-editor/styles.scoped.css +13 -13
- package/lib/internal/template/tag-editor/styles.selectors.js +3 -3
- package/lib/internal/template/test-utils/dom/multiselect/index.d.ts +8 -0
- package/lib/internal/template/test-utils/dom/multiselect/index.js +18 -4
- package/lib/internal/template/test-utils/dom/multiselect/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/multiselect/index.d.ts +8 -0
- package/lib/internal/template/test-utils/selectors/multiselect/index.js +18 -4
- package/lib/internal/template/test-utils/selectors/multiselect/index.js.map +1 -1
- package/lib/internal/template/text-content/styles.css.js +1 -1
- package/lib/internal/template/text-content/styles.scoped.css +66 -66
- package/lib/internal/template/text-content/styles.selectors.js +1 -1
- package/lib/internal/template/toggle/styles.css.js +10 -10
- package/lib/internal/template/toggle/styles.scoped.css +23 -23
- package/lib/internal/template/toggle/styles.selectors.js +10 -10
- package/lib/internal/template/toggle-button/internal.d.ts +1 -0
- package/lib/internal/template/toggle-button/internal.d.ts.map +1 -1
- package/lib/internal/template/toggle-button/internal.js +2 -2
- package/lib/internal/template/toggle-button/internal.js.map +1 -1
- package/lib/internal/template/wizard/index.d.ts.map +1 -1
- package/lib/internal/template/wizard/index.js +2 -1
- package/lib/internal/template/wizard/index.js.map +1 -1
- package/package.json +1 -1
package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BreadcrumbGroupProps } from '../../../breadcrumb-group/interfaces';
|
|
3
|
+
interface ToolbarContainerProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
hasAiDrawer?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function ToolbarContainer({ children, hasAiDrawer }: ToolbarContainerProps): JSX.Element;
|
|
8
|
+
interface ToolbarBreadcrumbsSectionProps {
|
|
9
|
+
ownBreadcrumbs: React.ReactNode;
|
|
10
|
+
discoveredBreadcrumbs?: BreadcrumbGroupProps | null;
|
|
11
|
+
includeTestUtils?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function ToolbarBreadcrumbsSection({ ownBreadcrumbs, discoveredBreadcrumbs, includeTestUtils, }: ToolbarBreadcrumbsSectionProps): JSX.Element;
|
|
14
|
+
interface ToolbarSkeletonStructureProps {
|
|
15
|
+
ownBreadcrumbs: React.ReactNode;
|
|
16
|
+
discoveredBreadcrumbs?: BreadcrumbGroupProps | null;
|
|
17
|
+
}
|
|
18
|
+
export declare const ToolbarSkeletonStructure: React.ForwardRefExoticComponent<ToolbarSkeletonStructureProps & React.RefAttributes<HTMLElement>>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=toolbar-container.d.ts.map
|
package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-container.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAM5E,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,qBAAqB,eAMhF;AAED,UAAU,8BAA8B;IACtC,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,qBAAqB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACpD,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,yBAAyB,CAAC,EACxC,cAAc,EACd,qBAAqB,EACrB,gBAAwB,GACzB,EAAE,8BAA8B,eAQhC;AAED,UAAU,6BAA6B;IACrC,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,qBAAqB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACrD;AAED,eAAO,MAAM,wBAAwB,mGASpC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { BreadcrumbsSlot, ToolbarSlot } from './slots';
|
|
6
|
+
import testutilStyles from '../../test-classes/styles.css.js';
|
|
7
|
+
import toolbarStyles from '../toolbar/styles.css.js';
|
|
8
|
+
export function ToolbarContainer({ children, hasAiDrawer }) {
|
|
9
|
+
return (React.createElement("div", { className: clsx(toolbarStyles['toolbar-container'], hasAiDrawer && toolbarStyles['with-ai-drawer']) }, children));
|
|
10
|
+
}
|
|
11
|
+
export function ToolbarBreadcrumbsSection({ ownBreadcrumbs, discoveredBreadcrumbs, includeTestUtils = false, }) {
|
|
12
|
+
return (React.createElement("div", { className: clsx(toolbarStyles['universal-toolbar-breadcrumbs'], includeTestUtils && testutilStyles.breadcrumbs) },
|
|
13
|
+
React.createElement(BreadcrumbsSlot, { ownBreadcrumbs: ownBreadcrumbs, discoveredBreadcrumbs: discoveredBreadcrumbs })));
|
|
14
|
+
}
|
|
15
|
+
export const ToolbarSkeletonStructure = React.forwardRef(({ ownBreadcrumbs, discoveredBreadcrumbs }, ref) => (React.createElement(ToolbarSlot, { ref: ref },
|
|
16
|
+
React.createElement(ToolbarContainer, null,
|
|
17
|
+
React.createElement(ToolbarBreadcrumbsSection, { ownBreadcrumbs: ownBreadcrumbs, discoveredBreadcrumbs: discoveredBreadcrumbs }),
|
|
18
|
+
React.createElement("div", { className: toolbarStyles['universal-toolbar-drawers'] })))));
|
|
19
|
+
//# sourceMappingURL=toolbar-container.js.map
|
package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar-container.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,aAAa,MAAM,0BAA0B,CAAC;AAOrD,MAAM,UAAU,gBAAgB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAyB;IAC/E,OAAO,CACL,6BAAK,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,EAAE,WAAW,IAAI,aAAa,CAAC,gBAAgB,CAAC,CAAC,IACrG,QAAQ,CACL,CACP,CAAC;AACJ,CAAC;AAQD,MAAM,UAAU,yBAAyB,CAAC,EACxC,cAAc,EACd,qBAAqB,EACrB,gBAAgB,GAAG,KAAK,GACO;IAC/B,OAAO,CACL,6BACE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,+BAA+B,CAAC,EAAE,gBAAgB,IAAI,cAAc,CAAC,WAAW,CAAC;QAE/G,oBAAC,eAAe,IAAC,cAAc,EAAE,cAAc,EAAE,qBAAqB,EAAE,qBAAqB,GAAI,CAC7F,CACP,CAAC;AACJ,CAAC;AAOD,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC,UAAU,CACtD,CAAC,EAAE,cAAc,EAAE,qBAAqB,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClD,oBAAC,WAAW,IAAC,GAAG,EAAE,GAAG;IACnB,oBAAC,gBAAgB;QACf,oBAAC,yBAAyB,IAAC,cAAc,EAAE,cAAc,EAAE,qBAAqB,EAAE,qBAAqB,GAAI;QAC3G,6BAAK,SAAS,EAAE,aAAa,CAAC,2BAA2B,CAAC,GAAI,CAC7C,CACP,CACf,CACF,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';\n\nimport { BreadcrumbGroupProps } from '../../../breadcrumb-group/interfaces';\nimport { BreadcrumbsSlot, ToolbarSlot } from './slots';\n\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport toolbarStyles from '../toolbar/styles.css.js';\n\ninterface ToolbarContainerProps {\n children: React.ReactNode;\n hasAiDrawer?: boolean;\n}\n\nexport function ToolbarContainer({ children, hasAiDrawer }: ToolbarContainerProps) {\n return (\n <div className={clsx(toolbarStyles['toolbar-container'], hasAiDrawer && toolbarStyles['with-ai-drawer'])}>\n {children}\n </div>\n );\n}\n\ninterface ToolbarBreadcrumbsSectionProps {\n ownBreadcrumbs: React.ReactNode;\n discoveredBreadcrumbs?: BreadcrumbGroupProps | null;\n includeTestUtils?: boolean;\n}\n\nexport function ToolbarBreadcrumbsSection({\n ownBreadcrumbs,\n discoveredBreadcrumbs,\n includeTestUtils = false,\n}: ToolbarBreadcrumbsSectionProps) {\n return (\n <div\n className={clsx(toolbarStyles['universal-toolbar-breadcrumbs'], includeTestUtils && testutilStyles.breadcrumbs)}\n >\n <BreadcrumbsSlot ownBreadcrumbs={ownBreadcrumbs} discoveredBreadcrumbs={discoveredBreadcrumbs} />\n </div>\n );\n}\n\ninterface ToolbarSkeletonStructureProps {\n ownBreadcrumbs: React.ReactNode;\n discoveredBreadcrumbs?: BreadcrumbGroupProps | null;\n}\n\nexport const ToolbarSkeletonStructure = React.forwardRef<HTMLElement, ToolbarSkeletonStructureProps>(\n ({ ownBreadcrumbs, discoveredBreadcrumbs }, ref) => (\n <ToolbarSlot ref={ref}>\n <ToolbarContainer>\n <ToolbarBreadcrumbsSection ownBreadcrumbs={ownBreadcrumbs} discoveredBreadcrumbs={discoveredBreadcrumbs} />\n <div className={toolbarStyles['universal-toolbar-drawers']} />\n </ToolbarContainer>\n </ToolbarSlot>\n )\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-skeleton-slots-attributes.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAOjE,eAAO,MAAM,0BAA0B,eACzB,OAAO,kBACH,sBAAsB,kBACtB,cAAc,KAC7B,
|
|
1
|
+
{"version":3,"file":"use-skeleton-slots-attributes.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAOjE,eAAO,MAAM,0BAA0B,eACzB,OAAO,kBACH,sBAAsB,kBACtB,cAAc,KAC7B,uBA2EF,CAAC"}
|
|
@@ -32,7 +32,6 @@ export const useSkeletonSlotsAttributes = (hasToolbar, appLayoutProps, appLayout
|
|
|
32
32
|
[customCssProps.navigationWidth]: `${navigationWidth}px`,
|
|
33
33
|
[customCssProps.toolsWidth]: `${activeDrawerSize}px`,
|
|
34
34
|
},
|
|
35
|
-
'data-awsui-app-layout-widget-loaded': true,
|
|
36
35
|
};
|
|
37
36
|
const mainElAttributes = {
|
|
38
37
|
className: clsx(styles['main-landmark'], isMobile && anyPanelOpen && styles['unfocusable-mobile'], drawerExpandedMode && styles.hidden),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-skeleton-slots-attributes.js","sourceRoot":"","sources":["../../../../../src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gB,CAAC;IAEvG,MAAM,mBAAmB,GAAG;QAC1B,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE;YAChD,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,EAAE,CAAC,uBAAuB,CAAC,QAAQ,CAAC,WAAW,CAAC;YACvF,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC,EAAE,WAAW,KAAK,WAAW;YACtE,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC,EAAE,kBAAkB;YACpD,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,EAAE,oBAAoB;YACzD,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,EAAE,wBAAwB;SAClE,CAAC;QACF,KAAK,EAAE;YACL,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,SAAS,CAAC,eAAe,GAAG,SAAS,CAAC,aAAa,KAAK;YAC1G,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,eAAe,IAAI,CAAC,CAAC,CAAC,EAAE;YACrG,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,GAAG,eAAe,IAAI;YACxD,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,GAAG,gBAAgB,IAAI;SACrD;
|
|
1
|
+
{"version":3,"file":"use-skeleton-slots-attributes.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,UAAU,MAAM,sCAAsC,CAAC;AAI9D,OAAO,c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,CAAC,IAAI;gBACzE,CAAC,UAAU,CAAC,0BAA0B,CAAC,EAAE,GAAG,MAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,0BAA0B,mCAAI,CAAC,IAAI;aACnG;YACH,CAAC,CAAC,EAAE,CAAC,GACJ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,eAAe,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAC3D;KACF,CAAC;IAEF,MAAM,yBAAyB,GAAG;QAChC,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC;KACpC,CAAC;IAEF,MAAM,mBAAmB,GAAG;QAC1B,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC;KACxD,CAAC;IAEF,OAAO;QACL,mBAAmB;QACnB,gBAAgB;QAChB,0BAA0B;QAC1B,yBAAyB;QACzB,mBAAmB;KACpB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\n\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { useMobile } from '../../../internal/hooks/use-mobile';\nimport globalVars from '../../../internal/styles/global-vars';\nimport { AppLayoutInternalProps, AppLayoutState } from '../interfaces';\nimport { SkeletonSlotsAttributes } from '../skeleton/interfaces';\n\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from '../skeleton/styles.css.js';\n\nconst contentTypeCustomWidths: Array<string | undefined> = ['dashboard', 'cards', 'table'];\n\nexport const useSkeletonSlotsAttributes = (\n hasToolbar: boolean,\n appLayoutProps: AppLayoutInternalProps,\n appLayoutState: AppLayoutState\n): SkeletonSlotsAttributes => {\n const {\n isNested,\n activeDrawerSize,\n navigationOpen,\n verticalOffsets,\n splitPanelOffsets,\n activeDrawer,\n expandedDrawerId,\n activeAiDrawer,\n activeGlobalBottomDrawerId,\n } = appLayoutState.widgetizedState ?? {};\n const { contentType, placement, maxContentWidth, navigationWidth, minContentWidth, disableContentPaddings } =\n appLayoutProps;\n const isMobile = useMobile();\n const toolsOpen = !!activeDrawer;\n const drawerExpandedMode = !!expandedDrawerId;\n const aiDrawerExpandedMode = expandedDrawerId === activeAiDrawer?.id;\n const bottomDrawerExpandedMode = expandedDrawerId === activeGlobalBottomDrawerId;\n const anyPanelOpen = navigationOpen || toolsOpen;\n const isMaxWidth = maxContentWidth === Number.MAX_VALUE || maxContentWidth === Number.MAX_SAFE_INTEGER;\n\n const wrapperElAttributes = {\n className: clsx(styles.root, testutilStyles.root, {\n [styles['has-adaptive-widths-default']]: !contentTypeCustomWidths.includes(contentType),\n [styles['has-adaptive-widths-dashboard']]: contentType === 'dashboard',\n [styles['drawer-expanded-mode']]: drawerExpandedMode,\n [styles['ai-drawer-expanded-mode']]: aiDrawerExpandedMode,\n [styles['bottom-drawer-expanded-mode']]: bottomDrawerExpandedMode,\n }),\n style: {\n minBlockSize: isNested ? '100%' : `calc(100vh - ${placement.insetBlockStart + placement.insetBlockEnd}px)`,\n [customCssProps.maxContentWidth]: isMaxWidth ? '100%' : maxContentWidth ? `${maxContentWidth}px` : '',\n [customCssProps.navigationWidth]: `${navigationWidth}px`,\n [customCssProps.toolsWidth]: `${activeDrawerSize}px`,\n },\n };\n\n const mainElAttributes = {\n className: clsx(\n styles['main-landmark'],\n isMobile && anyPanelOpen && styles['unfocusable-mobile'],\n drawerExpandedMode && styles.hidden\n ),\n };\n\n const contentWrapperElAttributes = {\n className: clsx(styles.main, { [styles['main-disable-paddings']]: disableContentPaddings }),\n style: {\n paddingBlockEnd: splitPanelOffsets?.mainContentPaddingBlockEnd,\n ...(hasToolbar || !isNested\n ? {\n [globalVars.stickyVerticalTopOffset]: `${verticalOffsets?.header ?? 0}px`,\n [globalVars.stickyVerticalBottomOffset]: `${splitPanelOffsets?.stickyVerticalBottomOffset ?? 0}px`,\n }\n : {}),\n ...(!isMobile ? { minWidth: `${minContentWidth}px` } : {}),\n },\n };\n\n const contentHeaderElAttributes = {\n className: styles['content-header'],\n };\n\n const contentElAttributes = {\n className: clsx(styles.content, testutilStyles.content),\n };\n\n return {\n wrapperElAttributes,\n mainElAttributes,\n contentWrapperElAttributes,\n contentHeaderElAttributes,\n contentElAttributes,\n };\n};\n"]}
|
|
@@ -40,4 +40,5 @@ export interface AppLayoutToolbarImplementationProps {
|
|
|
40
40
|
toolbarProps: ToolbarProps;
|
|
41
41
|
}
|
|
42
42
|
export declare function AppLayoutToolbarImplementation({ appLayoutInternals, toolbarProps, }: AppLayoutToolbarImplementationProps): JSX.Element;
|
|
43
|
+
export declare const AppLayoutToolbar: (Loader?: typeof AppLayoutToolbarImplementation | undefined) => typeof AppLayoutToolbarImplementation;
|
|
43
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAOjD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAInD,OAAO,EAAkB,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAO1E,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;IAE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,gCAAgC,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAE1F,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAErD,QAAQ,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;IACjC,sBAAsB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,gBAAgB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,mCAAmC;IAClD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,kBAAkB,EAGlB,YAAiB,GAClB,EAAE,mCAAmC,eA4LrC;AAED,eAAO,MAAM,gBAAgB,uGAA6E,CAAC"}
|
|
@@ -4,7 +4,10 @@ import React, { useEffect, useRef } from 'react';
|
|
|
4
4
|
import { Transition } from 'react-transition-group';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';
|
|
7
|
-
import {
|
|
7
|
+
import { createWidgetizedComponent } from '../../../internal/widgets';
|
|
8
|
+
import { ToolbarSkeleton } from '../skeleton/skeleton-parts';
|
|
9
|
+
import { ToolbarSlot } from '../skeleton/slots';
|
|
10
|
+
import { ToolbarBreadcrumbsSection, ToolbarContainer } from '../skeleton/toolbar-container';
|
|
8
11
|
import { DrawerTriggers } from './drawer-triggers';
|
|
9
12
|
import TriggerButton from './trigger-button';
|
|
10
13
|
import sharedStyles from '../../resize/styles.css.js';
|
|
@@ -69,7 +72,7 @@ toolbarProps = {}, }) {
|
|
|
69
72
|
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 });
|
|
70
73
|
}, 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' : 'circle', hasTooltip: true, testId: `awsui-app-layout-trigger-${aiDrawer === null || aiDrawer === void 0 ? void 0 : aiDrawer.id}`, isForPreviousActiveDrawer: true })));
|
|
71
74
|
}),
|
|
72
|
-
React.createElement(
|
|
75
|
+
React.createElement(ToolbarContainer, { hasAiDrawer: !!(aiDrawer === null || aiDrawer === void 0 ? void 0 : aiDrawer.trigger) },
|
|
73
76
|
hasNavigation && (React.createElement("nav", Object.assign({}, navLandmarkAttributes, { className: clsx(styles['universal-toolbar-nav']) }),
|
|
74
77
|
React.createElement(TriggerButton, { ariaLabel: (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationToggle) !== null && _a !== void 0 ? _a : undefined, ariaExpanded: !drawerExpandedMode && navigationOpen, iconName: "menu", className: testutilStyles['navigation-toggle'], onClick: () => {
|
|
75
78
|
if (setExpandedDrawerId) {
|
|
@@ -80,12 +83,12 @@ toolbarProps = {}, }) {
|
|
|
80
83
|
}
|
|
81
84
|
onNavigationToggle === null || onNavigationToggle === void 0 ? void 0 : onNavigationToggle(!navigationOpen);
|
|
82
85
|
}, ref: navigationFocusRef, selected: !drawerExpandedMode && navigationOpen, disabled: anyPanelOpenInMobile }))),
|
|
83
|
-
(breadcrumbs || discoveredBreadcrumbs) && (React.createElement(
|
|
84
|
-
React.createElement(BreadcrumbsSlot, { ownBreadcrumbs: appLayoutInternals.breadcrumbs, discoveredBreadcrumbs: appLayoutInternals.discoveredBreadcrumbs }))),
|
|
86
|
+
(breadcrumbs || discoveredBreadcrumbs) && (React.createElement(ToolbarBreadcrumbsSection, { ownBreadcrumbs: appLayoutInternals.breadcrumbs, discoveredBreadcrumbs: appLayoutInternals.discoveredBreadcrumbs, includeTestUtils: true })),
|
|
85
87
|
((drawers === null || drawers === void 0 ? void 0 : drawers.length) ||
|
|
86
88
|
(globalDrawers === null || globalDrawers === void 0 ? void 0 : globalDrawers.length) ||
|
|
87
89
|
(bottomDrawers === null || bottomDrawers === void 0 ? void 0 : bottomDrawers.length) ||
|
|
88
90
|
(hasSplitPanel && (splitPanelToggleProps === null || splitPanelToggleProps === void 0 ? void 0 : splitPanelToggleProps.displayed))) && (React.createElement("div", { className: clsx(styles['universal-toolbar-drawers']) },
|
|
89
91
|
React.createElement(DrawerTriggers, { ariaLabels: ariaLabels, activeDrawerId: activeDrawerId !== null && activeDrawerId !== void 0 ? activeDrawerId : null, drawers: (_b = drawers === null || drawers === void 0 ? void 0 : drawers.filter(item => !!item.trigger)) !== null && _b !== void 0 ? _b : [], drawersFocusRef: drawersFocusRef, onActiveDrawerChange: onActiveDrawerChange, splitPanelToggleProps: (splitPanelToggleProps === null || splitPanelToggleProps === void 0 ? void 0 : splitPanelToggleProps.displayed) ? splitPanelToggleProps : undefined, splitPanelFocusRef: splitPanelFocusRef, onSplitPanelToggle: onSplitPanelToggle, disabled: anyPanelOpenInMobile, globalDrawersFocusControl: globalDrawersFocusControl, bottomDrawersFocusRef: bottomDrawersFocusRef, globalDrawers: (_c = globalDrawers === null || globalDrawers === void 0 ? void 0 : globalDrawers.filter(item => !!item.trigger)) !== null && _c !== void 0 ? _c : [], activeGlobalDrawersIds: activeGlobalDrawersIds !== null && activeGlobalDrawersIds !== void 0 ? activeGlobalDrawersIds : [], onActiveGlobalDrawersChange: onActiveGlobalDrawersChange, expandedDrawerId: expandedDrawerId, setExpandedDrawerId: setExpandedDrawerId, bottomDrawers: bottomDrawers, onActiveGlobalBottomDrawerChange: onActiveGlobalBottomDrawerChange, activeGlobalBottomDrawerId: activeGlobalBottomDrawerId }))))));
|
|
90
92
|
}
|
|
93
|
+
export const AppLayoutToolbar = createWidgetizedComponent(AppLayoutToolbarImplementation, ToolbarSkeleton);
|
|
91
94
|
//# sourceMappingURL=index.js.map
|
|
@@ -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;AAMlF,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACjE,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;AAiDrC,MAAM,UAAU,8BAA8B,CAAC,EAC7C,kBAAkB;AAClB,yGAAyG;AACzG,yCAAyC;AACzC,YAAY,GAAG,EAAE,GACmB;;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,EACzB,aAAa,EACb,sBAAsB,EACtB,2BAA2B,EAC3B,aAAa,EACb,cAAc,EACd,kBAAkB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mBAAoB,EACzC,aAAa,EAAE,aAAa,EAC5B,gCAAgC,EAAE,gCAAgC,EAClE,0BAA0B,EAAE,0BAA0B,GACtD,CACE,CACP,CACG,CACM,CACf,CAAC;AACJ,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 { AppLayoutProps } from '../../interfaces';\nimport { OnChangeParams } from '../../utils/use-drawers';\nimport { Focusable, FocusControlMultipleStates } from '../../utils/use-focus-control';\nimport { AppLayoutInternals } from '../interfaces';\nimport { BreadcrumbsSlot, ToolbarSlot } from '../skeleton/slots';\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}\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}: 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(\n styles['universal-toolbar'],\n aiDrawer?.trigger && styles['with-ai-drawer'],\n testutilStyles.toolbar,\n {\n [testutilStyles['mobile-bar']]: isMobile,\n }\n )}\n style={{\n insetBlockStart: verticalOffsets.toolbar,\n }}\n >\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 hasTooltip={true}\n testId={`awsui-app-layout-trigger-${aiDrawer?.id}`}\n isForPreviousActiveDrawer={true}\n />\n </div>\n )}\n </Transition>\n <div className={clsx(styles['toolbar-container'], !!aiDrawer?.trigger && styles['with-ai-drawer'])}>\n {hasNavigation && (\n <nav {...navLandmarkAttributes} className={clsx(styles['universal-toolbar-nav'])}>\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 </nav>\n )}\n {(breadcrumbs || discoveredBreadcrumbs) && (\n <div className={clsx(styles['universal-toolbar-breadcrumbs'], testutilStyles.breadcrumbs)}>\n <BreadcrumbsSlot\n ownBreadcrumbs={appLayoutInternals.breadcrumbs}\n discoveredBreadcrumbs={appLayoutInternals.discoveredBreadcrumbs}\n />\n </div>\n )}\n {(drawers?.length ||\n globalDrawers?.length ||\n bottomDrawers?.length ||\n (hasSplitPanel && splitPanelToggleProps?.displayed)) && (\n <div className={clsx(styles['universal-toolbar-drawers'])}>\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 />\n </div>\n )}\n </div>\n </ToolbarSlot>\n );\n}\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,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;AAC5F,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;AAiDrC,MAAM,UAAU,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b,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,GACtD,CACE,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 { 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 { 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}\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}: 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(\n styles['universal-toolbar'],\n aiDrawer?.trigger && styles['with-ai-drawer'],\n testutilStyles.toolbar,\n {\n [testutilStyles['mobile-bar']]: isMobile,\n }\n )}\n style={{\n insetBlockStart: verticalOffsets.toolbar,\n }}\n >\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 hasTooltip={true}\n testId={`awsui-app-layout-trigger-${aiDrawer?.id}`}\n isForPreviousActiveDrawer={true}\n />\n </div>\n )}\n </Transition>\n <ToolbarContainer hasAiDrawer={!!aiDrawer?.trigger}>\n {hasNavigation && (\n <nav {...navLandmarkAttributes} className={clsx(styles['universal-toolbar-nav'])}>\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 </nav>\n )}\n {(breadcrumbs || discoveredBreadcrumbs) && (\n <ToolbarBreadcrumbsSection\n ownBreadcrumbs={appLayoutInternals.breadcrumbs}\n discoveredBreadcrumbs={appLayoutInternals.discoveredBreadcrumbs}\n includeTestUtils={true}\n />\n )}\n {(drawers?.length ||\n globalDrawers?.length ||\n bottomDrawers?.length ||\n (hasSplitPanel && splitPanelToggleProps?.displayed)) && (\n <div className={clsx(styles['universal-toolbar-drawers'])}>\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 />\n </div>\n )}\n </ToolbarContainer>\n </ToolbarSlot>\n );\n}\n\nexport const AppLayoutToolbar = createWidgetizedComponent(AppLayoutToolbarImplementation, ToolbarSkeleton);\n"]}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"empty-appear": "awsui_empty-
|
|
5
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
6
|
-
"root": "
|
|
7
|
-
"empty": "
|
|
8
|
-
"row": "
|
|
9
|
-
"divider": "
|
|
10
|
-
"row-control": "awsui_row-
|
|
11
|
-
"field": "
|
|
12
|
-
"additional-info": "awsui_additional-
|
|
13
|
-
"add-row": "awsui_add-
|
|
14
|
-
"add-button": "awsui_add-
|
|
15
|
-
"remove-button-container": "awsui_remove-button-
|
|
16
|
-
"remove-button-field-padding": "awsui_remove-button-field-
|
|
17
|
-
"remove-button-own-row": "awsui_remove-button-own-
|
|
18
|
-
"remove-button": "awsui_remove-
|
|
4
|
+
"empty-appear": "awsui_empty-appear_n4qlp_9hu3t_153",
|
|
5
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_9hu3t_1",
|
|
6
|
+
"root": "awsui_root_n4qlp_9hu3t_175",
|
|
7
|
+
"empty": "awsui_empty_n4qlp_9hu3t_153",
|
|
8
|
+
"row": "awsui_row_n4qlp_9hu3t_218",
|
|
9
|
+
"divider": "awsui_divider_n4qlp_9hu3t_222",
|
|
10
|
+
"row-control": "awsui_row-control_n4qlp_9hu3t_227",
|
|
11
|
+
"field": "awsui_field_n4qlp_9hu3t_231",
|
|
12
|
+
"additional-info": "awsui_additional-info_n4qlp_9hu3t_235",
|
|
13
|
+
"add-row": "awsui_add-row_n4qlp_9hu3t_281",
|
|
14
|
+
"add-button": "awsui_add-button_n4qlp_9hu3t_285",
|
|
15
|
+
"remove-button-container": "awsui_remove-button-container_n4qlp_9hu3t_289",
|
|
16
|
+
"remove-button-field-padding": "awsui_remove-button-field-padding_n4qlp_9hu3t_293",
|
|
17
|
+
"remove-button-own-row": "awsui_remove-button-own-row_n4qlp_9hu3t_297",
|
|
18
|
+
"remove-button": "awsui_remove-button_n4qlp_9hu3t_289"
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -150,10 +150,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
150
150
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
151
151
|
SPDX-License-Identifier: Apache-2.0
|
|
152
152
|
*/
|
|
153
|
-
.awsui_empty-
|
|
154
|
-
animation: awsui_awsui-motion-fade-
|
|
153
|
+
.awsui_empty-appear_n4qlp_9hu3t_153:not(#\9) {
|
|
154
|
+
animation: awsui_awsui-motion-fade-in_n4qlp_9hu3t_1 var(--motion-duration-transition-show-paced-0w35xp, 180ms) var(--motion-easing-transition-show-paced-ufdgkj, ease-out);
|
|
155
155
|
}
|
|
156
|
-
@keyframes awsui_awsui-motion-fade-
|
|
156
|
+
@keyframes awsui_awsui-motion-fade-in_n4qlp_9hu3t_1 {
|
|
157
157
|
from {
|
|
158
158
|
opacity: 0.2;
|
|
159
159
|
}
|
|
@@ -162,17 +162,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
@media (prefers-reduced-motion: reduce) {
|
|
165
|
-
.awsui_empty-
|
|
165
|
+
.awsui_empty-appear_n4qlp_9hu3t_153:not(#\9) {
|
|
166
166
|
animation: none;
|
|
167
167
|
transition: none;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
.awsui-motion-disabled .awsui_empty-
|
|
170
|
+
.awsui-motion-disabled .awsui_empty-appear_n4qlp_9hu3t_153:not(#\9), .awsui-mode-entering .awsui_empty-appear_n4qlp_9hu3t_153:not(#\9) {
|
|
171
171
|
animation: none;
|
|
172
172
|
transition: none;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
.
|
|
175
|
+
.awsui_root_n4qlp_9hu3t_175:not(#\9) {
|
|
176
176
|
border-collapse: separate;
|
|
177
177
|
border-spacing: 0;
|
|
178
178
|
box-sizing: border-box;
|
|
@@ -208,31 +208,31 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
208
208
|
align-items: start;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
.
|
|
211
|
+
.awsui_empty_n4qlp_9hu3t_153:not(#\9) {
|
|
212
212
|
font-size: var(--font-size-body-m-vv54cm, 14px);
|
|
213
213
|
line-height: var(--line-height-body-m-bedeoh, 22px);
|
|
214
214
|
color: var(--color-text-empty-vtt4l2, #687078);
|
|
215
215
|
grid-column: 1/-1;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
.
|
|
218
|
+
.awsui_row_n4qlp_9hu3t_218:not(#\9) {
|
|
219
219
|
display: contents;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
.
|
|
222
|
+
.awsui_divider_n4qlp_9hu3t_222:not(#\9) {
|
|
223
223
|
grid-column: 1/-1;
|
|
224
224
|
border-block-start: var(--border-divider-section-width-sznrdy, 1px) solid var(--color-border-divider-default-ipvpev, #eaeded);
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
.awsui_row-
|
|
227
|
+
.awsui_row-control_n4qlp_9hu3t_227:not(#\9) {
|
|
228
228
|
/* used in test-utils */
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
.
|
|
231
|
+
.awsui_field_n4qlp_9hu3t_231:not(#\9) {
|
|
232
232
|
/* used in test-utils */
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
.awsui_additional-
|
|
235
|
+
.awsui_additional-info_n4qlp_9hu3t_235:not(#\9) {
|
|
236
236
|
color: var(--color-text-form-secondary-4sp9un, #687078);
|
|
237
237
|
font-size: var(--font-size-body-s-psgqn2, 12px);
|
|
238
238
|
line-height: var(--line-height-body-s-otgtsr, 16px);
|
|
@@ -242,10 +242,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
242
242
|
margin-block-start: var(--space-xxs-jnczic, 4px);
|
|
243
243
|
/* stylelint-disable-next-line selector-max-type */
|
|
244
244
|
}
|
|
245
|
-
.awsui_additional-
|
|
245
|
+
.awsui_additional-info_n4qlp_9hu3t_235 > a:not(#\9) {
|
|
246
246
|
text-underline-offset: 0.3em;
|
|
247
247
|
text-decoration-thickness: 1px;
|
|
248
|
-
color: var(--awsui-style-color-default-
|
|
248
|
+
color: var(--awsui-style-color-default-b75yp7, var(--color-text-link-default-x6cnv5, #0073bb));
|
|
249
249
|
font-weight: inherit;
|
|
250
250
|
letter-spacing: normal;
|
|
251
251
|
text-decoration-line: underline;
|
|
@@ -256,50 +256,50 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
256
256
|
transition-duration: var(--motion-duration-refresh-only-medium-h3wrr6, 0ms);
|
|
257
257
|
}
|
|
258
258
|
@media (prefers-reduced-motion: reduce) {
|
|
259
|
-
.awsui_additional-
|
|
259
|
+
.awsui_additional-info_n4qlp_9hu3t_235 > a:not(#\9) {
|
|
260
260
|
animation: none;
|
|
261
261
|
transition: none;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
.awsui-motion-disabled .awsui_additional-
|
|
264
|
+
.awsui-motion-disabled .awsui_additional-info_n4qlp_9hu3t_235 > a:not(#\9), .awsui-mode-entering .awsui_additional-info_n4qlp_9hu3t_235 > a:not(#\9) {
|
|
265
265
|
animation: none;
|
|
266
266
|
transition: none;
|
|
267
267
|
}
|
|
268
|
-
.awsui_additional-
|
|
268
|
+
.awsui_additional-info_n4qlp_9hu3t_235 > a:not(#\9):hover {
|
|
269
269
|
cursor: pointer;
|
|
270
|
-
color: var(--awsui-style-color-hover-
|
|
270
|
+
color: var(--awsui-style-color-hover-b75yp7, var(--color-text-link-hover-tk5gkv, #0a4a74));
|
|
271
271
|
}
|
|
272
|
-
.awsui_additional-
|
|
272
|
+
.awsui_additional-info_n4qlp_9hu3t_235 > a:not(#\9):focus {
|
|
273
273
|
outline: none;
|
|
274
274
|
}
|
|
275
|
-
.awsui_additional-
|
|
276
|
-
color: var(--awsui-style-color-active-
|
|
275
|
+
.awsui_additional-info_n4qlp_9hu3t_235 > a:not(#\9):active {
|
|
276
|
+
color: var(--awsui-style-color-active-b75yp7, var(--color-text-link-hover-tk5gkv, #0a4a74));
|
|
277
277
|
}
|
|
278
|
-
.awsui_additional-
|
|
278
|
+
.awsui_additional-info_n4qlp_9hu3t_235 > a:not(#\9):active, .awsui_additional-info_n4qlp_9hu3t_235 > a:not(#\9):focus, .awsui_additional-info_n4qlp_9hu3t_235 > a:not(#\9):hover {
|
|
279
279
|
text-decoration-line: underline;
|
|
280
280
|
text-decoration-color: currentColor;
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
.awsui_add-
|
|
283
|
+
.awsui_add-row_n4qlp_9hu3t_281:not(#\9) {
|
|
284
284
|
grid-column: 1/-1;
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
.awsui_add-
|
|
287
|
+
.awsui_add-button_n4qlp_9hu3t_285:not(#\9) {
|
|
288
288
|
/* used in test-utils */
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
.awsui_remove-button-
|
|
291
|
+
.awsui_remove-button-container_n4qlp_9hu3t_289:not(#\9) {
|
|
292
292
|
display: inline-block;
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
.awsui_remove-button-field-
|
|
295
|
+
.awsui_remove-button-field-padding_n4qlp_9hu3t_293:not(#\9) {
|
|
296
296
|
padding-block-start: calc(var(--space-xxs-jnczic, 4px) + var(--line-height-body-m-bedeoh, 22px));
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
.awsui_remove-button-own-
|
|
299
|
+
.awsui_remove-button-own-row_n4qlp_9hu3t_297:not(#\9) {
|
|
300
300
|
justify-self: end;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
.awsui_remove-
|
|
303
|
+
.awsui_remove-button_n4qlp_9hu3t_289:not(#\9) {
|
|
304
304
|
/* used in test-utils */
|
|
305
305
|
}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"empty-appear": "awsui_empty-
|
|
6
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
7
|
-
"root": "
|
|
8
|
-
"empty": "
|
|
9
|
-
"row": "
|
|
10
|
-
"divider": "
|
|
11
|
-
"row-control": "awsui_row-
|
|
12
|
-
"field": "
|
|
13
|
-
"additional-info": "awsui_additional-
|
|
14
|
-
"add-row": "awsui_add-
|
|
15
|
-
"add-button": "awsui_add-
|
|
16
|
-
"remove-button-container": "awsui_remove-button-
|
|
17
|
-
"remove-button-field-padding": "awsui_remove-button-field-
|
|
18
|
-
"remove-button-own-row": "awsui_remove-button-own-
|
|
19
|
-
"remove-button": "awsui_remove-
|
|
5
|
+
"empty-appear": "awsui_empty-appear_n4qlp_9hu3t_153",
|
|
6
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_9hu3t_1",
|
|
7
|
+
"root": "awsui_root_n4qlp_9hu3t_175",
|
|
8
|
+
"empty": "awsui_empty_n4qlp_9hu3t_153",
|
|
9
|
+
"row": "awsui_row_n4qlp_9hu3t_218",
|
|
10
|
+
"divider": "awsui_divider_n4qlp_9hu3t_222",
|
|
11
|
+
"row-control": "awsui_row-control_n4qlp_9hu3t_227",
|
|
12
|
+
"field": "awsui_field_n4qlp_9hu3t_231",
|
|
13
|
+
"additional-info": "awsui_additional-info_n4qlp_9hu3t_235",
|
|
14
|
+
"add-row": "awsui_add-row_n4qlp_9hu3t_281",
|
|
15
|
+
"add-button": "awsui_add-button_n4qlp_9hu3t_285",
|
|
16
|
+
"remove-button-container": "awsui_remove-button-container_n4qlp_9hu3t_289",
|
|
17
|
+
"remove-button-field-padding": "awsui_remove-button-field-padding_n4qlp_9hu3t_293",
|
|
18
|
+
"remove-button-own-row": "awsui_remove-button-own-row_n4qlp_9hu3t_297",
|
|
19
|
+
"remove-button": "awsui_remove-button_n4qlp_9hu3t_289"
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+FA8ChB,CAAC;AAGF,eAAe,WAAW,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
|
9
9
|
import { getExternalProps } from '../internal/utils/external-props';
|
|
10
10
|
import InternalAutosuggest from './internal';
|
|
11
11
|
const Autosuggest = React.forwardRef((_a, ref) => {
|
|
12
|
-
var { filteringType = 'auto', statusType = 'finished', disableBrowserAutocorrect = false } = _a, props = __rest(_a, ["filteringType", "statusType", "disableBrowserAutocorrect"]);
|
|
12
|
+
var { filteringType = 'auto', statusType = 'finished', disableBrowserAutocorrect = false, hideEnteredTextOption = false } = _a, props = __rest(_a, ["filteringType", "statusType", "disableBrowserAutocorrect", "hideEnteredTextOption"]);
|
|
13
13
|
const baseComponentProps = useBaseComponent('Autosuggest', {
|
|
14
14
|
props: {
|
|
15
15
|
autoFocus: props.autoFocus,
|
|
@@ -18,6 +18,7 @@ const Autosuggest = React.forwardRef((_a, ref) => {
|
|
|
18
18
|
filteringType,
|
|
19
19
|
readOnly: props.readOnly,
|
|
20
20
|
virtualScroll: props.virtualScroll,
|
|
21
|
+
hideEnteredTextOption,
|
|
21
22
|
},
|
|
22
23
|
});
|
|
23
24
|
const componentAnalyticsMetadata = {
|
|
@@ -29,7 +30,7 @@ const Autosuggest = React.forwardRef((_a, ref) => {
|
|
|
29
30
|
},
|
|
30
31
|
};
|
|
31
32
|
const externalProps = getExternalProps(props);
|
|
32
|
-
return (React.createElement(InternalAutosuggest, Object.assign({ filteringType: filteringType, statusType: statusType, disableBrowserAutocorrect: disableBrowserAutocorrect }, externalProps, baseComponentProps, { ref: ref }, getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata }))));
|
|
33
|
+
return (React.createElement(InternalAutosuggest, Object.assign({ filteringType: filteringType, statusType: statusType, disableBrowserAutocorrect: disableBrowserAutocorrect, hideEnteredTextOption: hideEnteredTextOption }, externalProps, baseComponentProps, { ref: ref }, getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata }))));
|
|
33
34
|
});
|
|
34
35
|
applyDisplayName(Autosuggest, 'Autosuggest');
|
|
35
36
|
export default Autosuggest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/autosuggest/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE,OAAO,mBAAmB,MAAM,YAAY,CAAC;AAI7C,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/autosuggest/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE,OAA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ved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { GeneratedAnalyticsMetadataAutosuggestComponent } from './analytics-metadata/interfaces';\nimport { AutosuggestProps } from './interfaces';\nimport InternalAutosuggest from './internal';\n\nexport { AutosuggestProps };\n\nconst Autosuggest = React.forwardRef(\n (\n {\n filteringType = 'auto',\n statusType = 'finished',\n disableBrowserAutocorrect = false,\n hideEnteredTextOption = false,\n ...props\n }: AutosuggestProps,\n ref: React.Ref<AutosuggestProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('Autosuggest', {\n props: {\n autoFocus: props.autoFocus,\n disableBrowserAutocorrect,\n expandToViewport: props.expandToViewport,\n filteringType,\n readOnly: props.readOnly,\n virtualScroll: props.virtualScroll,\n hideEnteredTextOption,\n },\n });\n\n const componentAnalyticsMetadata: GeneratedAnalyticsMetadataAutosuggestComponent = {\n name: 'awsui.Autosuggest',\n label: 'input',\n properties: {\n disabled: `${!!props.disabled}`,\n value: props.value || '',\n },\n };\n\n const externalProps = getExternalProps(props);\n return (\n <InternalAutosuggest\n filteringType={filteringType}\n statusType={statusType}\n disableBrowserAutocorrect={disableBrowserAutocorrect}\n hideEnteredTextOption={hideEnteredTextOption}\n {...externalProps}\n {...baseComponentProps}\n ref={ref}\n {...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })}\n />\n );\n }\n);\n\napplyDisplayName(Autosuggest, 'Autosuggest');\nexport default Autosuggest;\n"]}
|
|
@@ -63,6 +63,10 @@ export interface AutosuggestProps extends BaseComponentProps, BaseInputProps, In
|
|
|
63
63
|
* @i18n
|
|
64
64
|
*/
|
|
65
65
|
enteredTextLabel?: AutosuggestProps.EnteredTextLabel;
|
|
66
|
+
/**
|
|
67
|
+
* Defines whether entered text option is shown as the first option in the dropdown when value is non-empty.
|
|
68
|
+
*/
|
|
69
|
+
hideEnteredTextOption?: boolean;
|
|
66
70
|
/**
|
|
67
71
|
* Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.
|
|
68
72
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/autosuggest/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,gBACf,SAAQ,kBAAkB,EACxB,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,+BAA+B,EAC/B,mBAAmB;IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA+BI;IACJ,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC;IACnC;;;;;;;;;;;;;;;;QAgBI;IACJ,aAAa,CAAC,EAAE,oBAAoB,CAAC;IAErC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;IAErD;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UA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C,gBAAgB,CAAC,MAAM,GAAG,gBAAgB,CAAC,WAAW,CAAC,GAAG;IACvF,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;IAC1C,MAAM,EAAE,gBAAgB,GAAG,WAAW,CAAC;CACxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/autosuggest/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseInputProps, InputAutoCorrect, InputClearLabel, InputKeyEvents, InputProps } from '../input/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport {\n BaseDropdownHostProps,\n OptionsFilteringType,\n OptionsLoadItemsDetail,\n} from '../internal/components/dropdown/interfaces';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface AutosuggestProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n BaseDropdownHostProps,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n DropdownStatusProps {\n /**\n * Specifies an array of options that are displayed to the user as a dropdown list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n * - `label` (string) - (Optional) Option text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option.\n * - `iconAriaLabel` (string) - (Optional) Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n * - `iconAlt` (string) - (Optional) **Deprecated**, replaced by \\`iconAriaLabel\\`. Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * #### OptionGroup\n * - `label` (string) - Option group text displayed to the user.\n * - `disabled` (boolean) - (Optional) Determines whether the option group is disabled.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n **/\n options?: AutosuggestProps.Options;\n /**\n * Determines how filtering is applied to the list of `options`:\n *\n * * `auto` - The component will automatically filter options based on user input.\n * * `manual` - You will set up `onChange` or `onLoadItems` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the dropdown list. In that case make sure that you use the `onChange` or `onLoadItems` events in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: OptionsFilteringType;\n\n /**\n * Specifies a function that generates the custom value indicator (for example, `Use \"${value}\"`).\n * @i18n\n */\n enteredTextLabel?: AutosuggestProps.EnteredTextLabel;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n *\n * Note that the `matchesCount` includes the `enteredTextLabel` (\"Use ${value}\") item, so in most cases you\n * should subtract 1 from `matchesCount`. If using manual filtering, you should provide your own value for `totalCount`.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n\n /**\n * Specifies the text that's displayed when there aren't any suggestions to display.\n * This is displayed when `statusType` is set to `finished` or it's not set at all.\n */\n empty?: React.ReactNode;\n\n /**\n * Called whenever a user selects an option in the dropdown. Don't use this event as the only way to handle user input.\n * Instead, use `onSelect` in combination with the `onChange` handler only as an optional convenience for the user.\n */\n onSelect?: NonCancelableEventHandler<AutosuggestProps.SelectDetail>;\n\n /**\n * Specifies the localized string that describes an option as being selected.\n * This is required to provide a good screen reader experience. For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n * @i18n\n */\n selectedAriaLabel?: string;\n /**\n * Overrides the element that is announced to screen readers\n * when the highlighted option changes. By default, this announces\n * the option's name and properties, and its selected state if\n * the `selectedLabel` property is defined.\n * The highlighted option is provided, and its group (if groups\n * are used and it differs from the group of the previously highlighted option).\n *\n * For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n */\n renderHighlightedAriaLive?: AutosuggestProps.ContainingOptionAndGroupString;\n}\n\nexport namespace AutosuggestProps {\n export type ChangeDetail = InputProps.ChangeDetail;\n export type KeyDetail = InputProps.KeyDetail;\n export type FilteringType = OptionsFilteringType;\n export type Option = OptionDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n export type EnteredTextLabel = (value: string) => string;\n export interface OptionGroup extends Option {\n label?: string;\n options: ReadonlyArray<Option>;\n }\n export type LoadItemsDetail = OptionsLoadItemsDetail;\n export type StatusType = DropdownStatusProps.StatusType;\n export interface SelectDetail {\n value: string;\n selectedOption?: Option;\n }\n\n export interface ContainingOptionAndGroupString {\n (option: Option, group?: OptionGroup): string;\n }\n\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n\n /**\n * Selects all text in the input control.\n */\n select(): void;\n }\n}\n\n// TODO: use DropdownOption type same as in select and multiselect\nexport type AutosuggestItem = (AutosuggestProps.Option | AutosuggestProps.OptionGroup) & {\n type?: 'parent' | 'child' | 'use-entered';\n option: OptionDefinition | OptionGroup;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/autosuggest/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseInputProps, InputAutoCorrect, InputClearLabel, InputKeyEvents, InputProps } from '../input/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport {\n BaseDropdownHostProps,\n OptionsFilteringType,\n OptionsLoadItemsDetail,\n} from '../internal/components/dropdown/interfaces';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status';\nimport { OptionDefinition, OptionGroup } from '../internal/components/option/interfaces';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface AutosuggestProps\n extends BaseComponentProps,\n BaseInputProps,\n InputAutoCorrect,\n BaseDropdownHostProps,\n InputKeyEvents,\n InputClearLabel,\n FormFieldValidationControlProps,\n DropdownStatusProps {\n /**\n * Specifies an array of options that are displayed to the user as a dropdown list.\n * The options can be grouped using `OptionGroup` objects.\n *\n * #### Option\n * - `value` (string) - The returned value of the option when selected.\n * - `label` (string) - (Optional) Option text displayed to the user.\n * - `lang` (string) - (Optional) The language of the option, provided as a BCP 47 language tag.\n * - `description` (string) - (Optional) Further information about the option that appears below the label.\n * - `disabled` (boolean) - (Optional) Determines whether the option is disabled.\n * - `labelTag` (string) - (Optional) A label tag that provides additional guidance, shown next to the label.\n * - `tags` [string[]] - (Optional) A list of tags giving further guidance about the option.\n * - `filteringTags` [string[]] - (Optional) A list of additional tags used for automatic filtering.\n * - `iconName` (string) - (Optional) Specifies the name of an [icon](/components/icon/) to display in the option.\n * - `iconAriaLabel` (string) - (Optional) Specifies alternate text for the icon. We recommend that you provide this for accessibility.\n * - `iconAlt` (string) - (Optional) **Deprecated**, replaced by \\`iconAriaLabel\\`. Specifies alternate text for a custom icon, for use with `iconUrl`.\n * - `iconUrl` (string) - (Optional) URL of a custom icon.\n * - `iconSvg` (ReactNode) - (Optional) Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n *\n * #### OptionGroup\n * - `label` (string) - Option group text displayed to the user.\n * - `disabled` (boolean) - (Optional) Determines whether the option group is disabled.\n * - `options` (Option[]) - (Optional) The options under this group.\n *\n * Note: Only one level of option nesting is supported.\n *\n * If you want to use the built-in filtering capabilities of this component, provide\n * a list of all valid options here and they will be automatically filtered based on the user's filtering input.\n *\n * Alternatively, you can listen to the `onChange` or `onLoadItems` event and set new options\n * on your own.\n **/\n options?: AutosuggestProps.Options;\n /**\n * Determines how filtering is applied to the list of `options`:\n *\n * * `auto` - The component will automatically filter options based on user input.\n * * `manual` - You will set up `onChange` or `onLoadItems` event listeners and filter options on your side or request\n * them from server.\n *\n * By default the component will filter the provided `options` based on the value of the filtering input field.\n * Only options that have a `value`, `label`, `description` or `labelTag` that contains the input value as a substring\n * are displayed in the list of options.\n *\n * If you set this property to `manual`, this default filtering mechanism is disabled and all provided `options` are\n * displayed in the dropdown list. In that case make sure that you use the `onChange` or `onLoadItems` events in order\n * to set the `options` property to the options that are relevant for the user, given the filtering input value.\n *\n * Note: Manual filtering doesn't disable match highlighting.\n **/\n filteringType?: OptionsFilteringType;\n\n /**\n * Specifies a function that generates the custom value indicator (for example, `Use \"${value}\"`).\n * @i18n\n */\n enteredTextLabel?: AutosuggestProps.EnteredTextLabel;\n\n /**\n * Defines whether entered text option is shown as the first option in the dropdown when value is non-empty.\n */\n hideEnteredTextOption?: boolean;\n\n /**\n * Specifies the text to display with the number of matches at the bottom of the dropdown menu while filtering.\n *\n * Note that the `matchesCount` includes the `enteredTextLabel` (\"Use ${value}\") item, so in most cases you\n * should subtract 1 from `matchesCount`. If using manual filtering, you should provide your own value for `totalCount`.\n */\n filteringResultsText?: (matchesCount: number, totalCount: number) => string;\n\n /**\n * Specifies the text that's displayed when there aren't any suggestions to display.\n * This is displayed when `statusType` is set to `finished` or it's not set at all.\n */\n empty?: React.ReactNode;\n\n /**\n * Called whenever a user selects an option in the dropdown. Don't use this event as the only way to handle user input.\n * Instead, use `onSelect` in combination with the `onChange` handler only as an optional convenience for the user.\n */\n onSelect?: NonCancelableEventHandler<AutosuggestProps.SelectDetail>;\n\n /**\n * Specifies the localized string that describes an option as being selected.\n * This is required to provide a good screen reader experience. For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n * @i18n\n */\n selectedAriaLabel?: string;\n /**\n * Overrides the element that is announced to screen readers\n * when the highlighted option changes. By default, this announces\n * the option's name and properties, and its selected state if\n * the `selectedLabel` property is defined.\n * The highlighted option is provided, and its group (if groups\n * are used and it differs from the group of the previously highlighted option).\n *\n * For more information, see the\n * [accessibility guidelines](/components/autosuggest/?tabId=usage#accessibility-guidelines).\n */\n renderHighlightedAriaLive?: AutosuggestProps.ContainingOptionAndGroupString;\n}\n\nexport namespace AutosuggestProps {\n export type ChangeDetail = InputProps.ChangeDetail;\n export type KeyDetail = InputProps.KeyDetail;\n export type FilteringType = OptionsFilteringType;\n export type Option = OptionDefinition;\n export type Options = ReadonlyArray<Option | OptionGroup>;\n export type EnteredTextLabel = (value: string) => string;\n export interface OptionGroup extends Option {\n label?: string;\n options: ReadonlyArray<Option>;\n }\n export type LoadItemsDetail = OptionsLoadItemsDetail;\n export type StatusType = DropdownStatusProps.StatusType;\n export interface SelectDetail {\n value: string;\n selectedOption?: Option;\n }\n\n export interface ContainingOptionAndGroupString {\n (option: Option, group?: OptionGroup): string;\n }\n\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n\n /**\n * Selects all text in the input control.\n */\n select(): void;\n }\n}\n\n// TODO: use DropdownOption type same as in select and multiselect\nexport type AutosuggestItem = (AutosuggestProps.Option | AutosuggestProps.OptionGroup) & {\n type?: 'parent' | 'child' | 'use-entered';\n option: OptionDefinition | OptionGroup;\n};\n"]}
|