@cloudscape-design/components 3.0.1050 → 3.0.1052
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/multi-layout.d.ts +0 -3
- package/app-layout/visual-refresh-toolbar/multi-layout.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/multi-layout.js +6 -2
- package/app-layout/visual-refresh-toolbar/multi-layout.js.map +1 -1
- package/flashbar/interfaces.d.ts +1 -0
- package/flashbar/interfaces.d.ts.map +1 -1
- package/flashbar/interfaces.js.map +1 -1
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/manifest.json +1 -1
- package/internal/plugins/controllers/app-layout-widget.d.ts +4 -1
- package/internal/plugins/controllers/app-layout-widget.d.ts.map +1 -1
- package/internal/plugins/controllers/app-layout-widget.js.map +1 -1
- package/key-value-pairs/interfaces.d.ts +1 -1
- package/key-value-pairs/interfaces.js.map +1 -1
- package/package.json +1 -1
|
@@ -28,9 +28,6 @@ export interface SharedProps {
|
|
|
28
28
|
}
|
|
29
29
|
export declare function mergeProps(ownProps: SharedProps, additionalProps: ReadonlyArray<Partial<SharedProps>>): ToolbarProps | null;
|
|
30
30
|
export declare function useMultiAppLayout(props: SharedProps, isEnabled: boolean): {
|
|
31
|
-
registered: string;
|
|
32
|
-
toolbarProps: ToolbarProps | null;
|
|
33
|
-
} | {
|
|
34
31
|
registered: boolean;
|
|
35
32
|
toolbarProps: ToolbarProps | null;
|
|
36
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-layout.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/multi-layout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAMzD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,sBA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GAAG,IAAI,CAAA;CAAE,CAyC5D"}
|
|
@@ -67,7 +67,11 @@ export function useMultiAppLayout(props, isEnabled) {
|
|
|
67
67
|
setRegistration({ type: 'primary', discoveredProps: [] });
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
const unregister = awsuiPluginsInternal.appLayoutWidget.register(forceDeduplicationType, props => setRegistration(props));
|
|
71
|
+
return () => {
|
|
72
|
+
unregister();
|
|
73
|
+
setRegistration({ type: 'suspended' });
|
|
74
|
+
};
|
|
71
75
|
}, [forceDeduplicationType, isEnabled, isToolbar]);
|
|
72
76
|
useLayoutEffect(() => {
|
|
73
77
|
if ((registration === null || registration === void 0 ? void 0 : registration.type) === 'secondary') {
|
|
@@ -76,7 +80,7 @@ export function useMultiAppLayout(props, isEnabled) {
|
|
|
76
80
|
});
|
|
77
81
|
if (!isToolbar) {
|
|
78
82
|
return {
|
|
79
|
-
registered:
|
|
83
|
+
registered: true,
|
|
80
84
|
// mergeProps is needed here because the toolbar's behavior depends on reconciliation logic
|
|
81
85
|
// in this function. For example, navigation trigger visibility
|
|
82
86
|
toolbarProps: mergeProps(props, []),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-layout.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/multi-layout.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AA6BjE,SAAS,kBAAkB,CAAC,KAAc,EAAE,QAAgB;IAC1D,IAAI,KAAK,EAAE;QACT,QAAQ,CACN,WAAW,EACX,4DAA4D,QAAQ,2CAA2C,CAChH,CAAC;QACF,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,eAAe,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;QACzC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,sBAAsB,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;IAEnD,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,MAAK,WAAW,EAAE;YACtC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAC5B;IACH,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,SAAS,EAAE;QACd,OAAO;YACL,UAAU,EAAE,IAAI;YAChB,2FAA2F;YAC3F,+DAA+D;YAC/D,YAAY,EAAE,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC;SACpC,CAAC;KACH;IAED,OAAO;QACL,UAAU,EAAE,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAA;QAChC,YAAY,EAAE,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,MAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI;KACxG,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useLayoutEffect, useState } from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { awsuiPluginsInternal } from '../../internal/plugins/api';\nimport { RegistrationState } from '../../internal/plugins/controllers/app-layout-widget';\nimport { AppLayoutProps } from '../interfaces';\nimport { useAppLayoutFlagEnabled } from '../utils/feature-flags';\nimport { OnChangeParams } from '../utils/use-drawers';\nimport { Focusable, FocusControlMultipleStates } from '../utils/use-focus-control';\nimport { SplitPanelToggleProps, ToolbarProps } from './toolbar';\n\nexport interface SharedProps {\n forceDeduplicationType?: 'primary' | 'secondary' | 'suspended' | 'off';\n ariaLabels: AppLayoutProps.Labels | undefined;\n navigation: React.ReactNode;\n navigationOpen: boolean;\n onNavigationToggle: (open: boolean) => void;\n navigationFocusRef: React.Ref<Focusable> | undefined;\n breadcrumbs: React.ReactNode;\n activeDrawerId: string | null;\n drawers: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n onActiveDrawerChange: ((drawerId: string | null, params: OnChangeParams) => void) | undefined;\n drawersFocusRef: React.Ref<Focusable> | undefined;\n globalDrawersFocusControl?: FocusControlMultipleStates | undefined;\n globalDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n activeGlobalDrawersIds?: Array<string> | undefined;\n onActiveGlobalDrawersChange?: ((newDrawerId: string, params: OnChangeParams) => void) | undefined;\n splitPanel: React.ReactNode;\n splitPanelToggleProps: SplitPanelToggleProps | undefined;\n splitPanelFocusRef: React.Ref<Focusable> | undefined;\n onSplitPanelToggle: () => void;\n expandedDrawerId?: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n}\n\nfunction checkAlreadyExists(value: boolean, propName: string) {\n if (value) {\n warnOnce(\n 'AppLayout',\n `Another app layout instance on this page already defines ${propName} property. This instance will be ignored.`\n );\n return true;\n }\n return false;\n}\n\nexport function mergeProps(\n ownProps: SharedProps,\n additionalProps: ReadonlyArray<Partial<SharedProps>>\n): ToolbarProps | null {\n const toolbar: ToolbarProps = {};\n for (const props of [ownProps, ...additionalProps]) {\n toolbar.ariaLabels = Object.assign(toolbar.ariaLabels ?? {}, props.ariaLabels);\n if (\n props.drawers &&\n props.drawers.some(drawer => drawer.trigger) &&\n !checkAlreadyExists(!!toolbar.drawers, 'tools or drawers')\n ) {\n toolbar.drawers = props.drawers;\n toolbar.activeDrawerId = props.activeDrawerId;\n toolbar.drawersFocusRef = props.drawersFocusRef;\n toolbar.onActiveDrawerChange = props.onActiveDrawerChange;\n }\n if (props.globalDrawers && !checkAlreadyExists(!!toolbar.globalDrawers, 'globalDrawers')) {\n toolbar.globalDrawersFocusControl = props.globalDrawersFocusControl;\n toolbar.globalDrawers = props.globalDrawers;\n toolbar.activeGlobalDrawersIds = props.activeGlobalDrawersIds;\n toolbar.onActiveGlobalDrawersChange = props.onActiveGlobalDrawersChange;\n }\n if (props.navigation && !checkAlreadyExists(!!toolbar.hasNavigation, 'navigation')) {\n toolbar.hasNavigation = true;\n toolbar.navigationOpen = props.navigationOpen;\n toolbar.navigationFocusRef = props.navigationFocusRef;\n toolbar.onNavigationToggle = props.onNavigationToggle;\n }\n if (\n props.splitPanel &&\n props.splitPanelToggleProps?.displayed &&\n !checkAlreadyExists(!!toolbar.hasSplitPanel, 'splitPanel')\n ) {\n toolbar.hasSplitPanel = true;\n toolbar.splitPanelFocusRef = props.splitPanelFocusRef;\n toolbar.splitPanelToggleProps = props.splitPanelToggleProps;\n toolbar.onSplitPanelToggle = props.onSplitPanelToggle;\n }\n if (props.breadcrumbs && !checkAlreadyExists(!!toolbar.hasBreadcrumbsPortal, 'hasBreadcrumbsPortal')) {\n toolbar.hasBreadcrumbsPortal = true;\n }\n if (props.expandedDrawerId && !checkAlreadyExists(!!toolbar.expandedDrawerId, 'expandedDrawerId')) {\n toolbar.expandedDrawerId = props.expandedDrawerId;\n toolbar.setExpandedDrawerId = props.setExpandedDrawerId;\n }\n }\n // do not render toolbar if no fields are defined, except ariaLabels, which are always there\n return Object.keys(toolbar).filter(key => key !== 'ariaLabels').length > 0 ? toolbar : null;\n}\n\nexport function useMultiAppLayout(\n props: SharedProps,\n isEnabled: boolean\n): { registered: boolean; toolbarProps: ToolbarProps | null } {\n const [registration, setRegistration] = useState<RegistrationState<SharedProps> | null>(null);\n const { forceDeduplicationType } = props;\n const isToolbar = useAppLayoutFlagEnabled();\n\n useLayoutEffect(() => {\n if (!isEnabled || forceDeduplicationType === 'suspended' || !isToolbar) {\n return;\n }\n if (forceDeduplicationType === 'off') {\n setRegistration({ type: 'primary', discoveredProps: [] });\n return;\n }\n const unregister = awsuiPluginsInternal.appLayoutWidget.register(forceDeduplicationType, props =>\n setRegistration(props as RegistrationState<SharedProps>)\n );\n return () => {\n unregister();\n setRegistration({ type: 'suspended' });\n };\n }, [forceDeduplicationType, isEnabled, isToolbar]);\n\n useLayoutEffect(() => {\n if (registration?.type === 'secondary') {\n registration.update(props);\n }\n });\n\n if (!isToolbar) {\n return {\n registered: true,\n // mergeProps is needed here because the toolbar's behavior depends on reconciliation logic\n // in this function. For example, navigation trigger visibility\n toolbarProps: mergeProps(props, []),\n };\n }\n\n return {\n registered: !!registration?.type,\n toolbarProps: registration?.type === 'primary' ? mergeProps(props, registration.discoveredProps) : null,\n };\n}\n"]}
|
package/flashbar/interfaces.d.ts
CHANGED
|
@@ -165,6 +165,7 @@ export interface FlashbarProps extends BaseComponentProps {
|
|
|
165
165
|
* If the `action` property is set, this property is ignored. **Deprecated**, replaced by `action`.
|
|
166
166
|
* * `onButtonClick` (event => void) - Called when a user clicks on the action button. This is not called if you create a custom button
|
|
167
167
|
* using the `action` property. **Deprecated**, replaced by `action`.
|
|
168
|
+
* * `onDismiss` (event => void) - (Optional) Called when a user clicks on the dismiss button.
|
|
168
169
|
* * `id` (string) - Specifies a unique flash message identifier. This property is used in two ways:
|
|
169
170
|
* 1. As a [keys](https://reactjs.org/docs/lists-and-keys.html#keys) source for React rendering.
|
|
170
171
|
* 2. To identify which flash message will be removed from the DOM when it is dismissed, to animate it out.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/flashbar/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,iBAAiB;QAChC,MAAM,CAA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;iBACtB,CAAC;aACH,CAAC;SACH,CAAC;KACH;IAED,KAAY,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,aAAa,CAAC;IAC5E,KAAY,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;CAC3C;AAED,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAEtD;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC;IAExC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC;CAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/flashbar/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 { ButtonProps } from '../button/interfaces';\nimport { ErrorContext } from '../internal/analytics/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport namespace FlashbarProps {\n export interface MessageDefinition {\n header?: React.ReactNode;\n content?: React.ReactNode;\n dismissible?: boolean;\n dismissLabel?: string;\n statusIconAriaLabel?: string;\n loading?: boolean;\n type?: FlashbarProps.Type;\n ariaRole?: FlashbarProps.AriaRole;\n action?: React.ReactNode;\n id?: string;\n buttonText?: ButtonProps['children'];\n onButtonClick?: ButtonProps['onClick'];\n onDismiss?: ButtonProps['onClick'];\n analyticsMetadata?: FlashbarProps.ItemAnalyticsMetadata;\n }\n\n export interface ItemAnalyticsMetadata {\n suppressFlowMetricEvents?: boolean;\n errorContext?: ErrorContext;\n }\n\n export interface I18nStrings {\n ariaLabel?: string;\n errorIconAriaLabel?: string;\n infoIconAriaLabel?: string;\n inProgressIconAriaLabel?: string;\n notificationBarAriaLabel?: string;\n notificationBarText?: string;\n successIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n }\n\n export interface Style {\n item?: {\n root?: {\n background?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n borderColor?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n color?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n focusRing?: {\n borderColor?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n dismissButton?: {\n color?: {\n active?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n default?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n hover?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n };\n focusRing?: {\n borderColor?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n };\n notificationBar?: {\n root?: {\n background?: {\n active?: string;\n default?: string;\n hover?: string;\n };\n borderColor?: {\n active?: string;\n default?: string;\n hover?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n color?: {\n active?: string;\n default?: string;\n hover?: string;\n };\n };\n expandButton?: {\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n };\n }\n\n export type Type = 'success' | 'warning' | 'info' | 'error' | 'in-progress';\n export type AriaRole = 'alert' | 'status';\n}\n\nexport interface FlashbarProps extends BaseComponentProps {\n /**\n * Specifies flash messages that appear in the same order that they are listed.\n * The value is an array of flash message definition objects.\n *\n * A flash message object contains the following properties:\n * * `header` (ReactNode) - Specifies the heading text.\n * * `content` (ReactNode) - Specifies the primary text displayed in the flash element.\n * * `type` (string) - Indicates the type of the message to be displayed. Allowed values are as follows: `success, error, warning, info, in-progress`. The default is `info`.\n * * `loading` (boolean) - Replaces the status icon with a spinner and forces the type to `info`.\n * * `dismissible` (boolean) - Determines whether the component includes a close button icon. By default, the close button is not included.\n * When a user clicks on this button the `onDismiss` handler is called.\n * * `dismissLabel` (string) - Specifies an `aria-label` for to the dismiss icon button for improved accessibility.\n * * `statusIconAriaLabel` (string) - Specifies an `aria-label` for to the status icon for improved accessibility.\n * If not provided, `i18nStrings.{type}IconAriaLabel` will be used as a fallback.\n * * `ariaRole` (string) - For flash messages added after page load, specifies how this message is communicated to assistive\n * technology. Use \"status\" for status updates or informational content. Use \"alert\" for important messages that need the\n * user's attention.\n * * `action` (ReactNode) - Specifies an action for the flash message. Although it is technically possible to insert any content,\n * our UX guidelines only allow you to add a button.\n * * `buttonText` (string) - Specifies that an action button should be displayed, with the specified text.\n * When a user clicks on this button the `onButtonClick` handler is called.\n * If the `action` property is set, this property is ignored. **Deprecated**, replaced by `action`.\n * * `onButtonClick` (event => void) - Called when a user clicks on the action button. This is not called if you create a custom button\n * using the `action` property. **Deprecated**, replaced by `action`.\n * * `id` (string) - Specifies a unique flash message identifier. This property is used in two ways:\n * 1. As a [keys](https://reactjs.org/docs/lists-and-keys.html#keys) source for React rendering.\n * 2. To identify which flash message will be removed from the DOM when it is dismissed, to animate it out.\n * * `analyticsMetadata` (FlashbarProps.ItemAnalyticsMetadata) - (Optional) Specifies additional analytics-related metadata.\n * * `suppressFlowMetricEvents` - Prevent this item from generating events related to flow metrics.\n * @analytics\n */\n items: ReadonlyArray<FlashbarProps.MessageDefinition>;\n\n /**\n * Specifies whether flash messages should be stacked.\n */\n stackItems?: boolean;\n\n /**\n * An object containing all the necessary localized strings required by the component. The object should contain:\n *\n * * `ariaLabel` - Specifies the ARIA label for the list of notifications.\n *\n * If `stackItems` is set to `true`, it should also contain:\n *\n * * `notificationBarAriaLabel` - (optional) Specifies the ARIA label for the notification bar\n * * `notificationBarText` - (optional) Specifies the text shown in the notification bar\n * * `errorIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `error`.\n * * `warningIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `warning`.\n * * `infoIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `info`.\n * * `successIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `success`.\n * * `inProgressIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `in-progress` or with `loading` set to `true`.\n * @i18n\n */\n i18nStrings?: FlashbarProps.I18nStrings;\n\n /**\n * Specifies an object of selectors and properties that are used to apply custom styles.\n *\n * - `item.root.background` {error, info, inProgress, success, warning} - (Optional) Background for item types.\n * - `item.root.borderColor` {error, info, inProgress, success, warning} - (Optional) Border color for item types.\n * - `item.root.borderRadius` (string) - (Optional) Item border radius.\n * - `item.root.borderWidth` (string) - (Optional) Item border width.\n * - `item.root.color` {error, info, inProgress, success, warning} - (Optional) Color for item types.\n * - `item.root.focusRing.borderColor` {error, info, inProgress, success, warning} - (Optional) Item focus ring border color.\n * - `item.root.focusRing.borderRadius` (string) - (Optional) Item focus ring border radius.\n * - `item.root.focusRing.borderWidth` (string) - (Optional) Item focus ring border width.\n * - `item.dismissButton.color.active` {error, info, inProgress, success, warning} - (Optional) Color for dismiss button active state.\n * - `item.dismissButton.color.default` {error, info, inProgress, success, warning} - (Optional) Color for dismiss button default state.\n * - `item.dismissButton.color.hover` {error, info, inProgress, success, warning} - (Optional) Color for dismiss button hover state.\n * - `item.dismissButton.focusRing.borderColor` {error, info, inProgress, success, warning} - (Optional) Dismiss button focus ring border color.\n * - `item.dismissButton.focusRing.borderRadius` (string) - (Optional) Dismiss button focus ring border radius.\n * - `item.dismissButton.focusRing.borderWidth` (string) - (Optional) Dismiss button focus ring border width.\n * - `notificationBar.root.background` {active, default, hover} - (Optional) Background for notification bar states.\n * - `notificationBar.root.borderColor` {active, default, hover} - (Optional) Border color for notification bar states.\n * - `notificationBar.root.borderRadius` (string) - (Optional) Notification bar border radius.\n * - `notificationBar.root.borderWidth` (string) - (Optional) Notification bar border width.\n * - `notificationBar.root.color` {active, default, hover} - (Optional) Color for notification bar states.\n * - `notificationBar.expandButton.focusRing.borderColor` (string) - (Optional) Border color for the expand button.\n * - `notificationBar.expandButton.focusRing.borderRadius` (string) - (Optional) Border radius for the expand button.\n * - `notificationBar.expandButton.focusRing.borderWidth` (string) - (Optional) Border width for the expand button.\n * @awsuiSystem core\n */\n style?: FlashbarProps.Style;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/flashbar/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 { ButtonProps } from '../button/interfaces';\nimport { ErrorContext } from '../internal/analytics/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport namespace FlashbarProps {\n export interface MessageDefinition {\n header?: React.ReactNode;\n content?: React.ReactNode;\n dismissible?: boolean;\n dismissLabel?: string;\n statusIconAriaLabel?: string;\n loading?: boolean;\n type?: FlashbarProps.Type;\n ariaRole?: FlashbarProps.AriaRole;\n action?: React.ReactNode;\n id?: string;\n buttonText?: ButtonProps['children'];\n onButtonClick?: ButtonProps['onClick'];\n onDismiss?: ButtonProps['onClick'];\n analyticsMetadata?: FlashbarProps.ItemAnalyticsMetadata;\n }\n\n export interface ItemAnalyticsMetadata {\n suppressFlowMetricEvents?: boolean;\n errorContext?: ErrorContext;\n }\n\n export interface I18nStrings {\n ariaLabel?: string;\n errorIconAriaLabel?: string;\n infoIconAriaLabel?: string;\n inProgressIconAriaLabel?: string;\n notificationBarAriaLabel?: string;\n notificationBarText?: string;\n successIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n }\n\n export interface Style {\n item?: {\n root?: {\n background?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n borderColor?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n color?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n focusRing?: {\n borderColor?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n dismissButton?: {\n color?: {\n active?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n default?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n hover?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n };\n focusRing?: {\n borderColor?: {\n error?: string;\n info?: string;\n inProgress?: string;\n success?: string;\n warning?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n };\n notificationBar?: {\n root?: {\n background?: {\n active?: string;\n default?: string;\n hover?: string;\n };\n borderColor?: {\n active?: string;\n default?: string;\n hover?: string;\n };\n borderRadius?: string;\n borderWidth?: string;\n color?: {\n active?: string;\n default?: string;\n hover?: string;\n };\n };\n expandButton?: {\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n };\n }\n\n export type Type = 'success' | 'warning' | 'info' | 'error' | 'in-progress';\n export type AriaRole = 'alert' | 'status';\n}\n\nexport interface FlashbarProps extends BaseComponentProps {\n /**\n * Specifies flash messages that appear in the same order that they are listed.\n * The value is an array of flash message definition objects.\n *\n * A flash message object contains the following properties:\n * * `header` (ReactNode) - Specifies the heading text.\n * * `content` (ReactNode) - Specifies the primary text displayed in the flash element.\n * * `type` (string) - Indicates the type of the message to be displayed. Allowed values are as follows: `success, error, warning, info, in-progress`. The default is `info`.\n * * `loading` (boolean) - Replaces the status icon with a spinner and forces the type to `info`.\n * * `dismissible` (boolean) - Determines whether the component includes a close button icon. By default, the close button is not included.\n * When a user clicks on this button the `onDismiss` handler is called.\n * * `dismissLabel` (string) - Specifies an `aria-label` for to the dismiss icon button for improved accessibility.\n * * `statusIconAriaLabel` (string) - Specifies an `aria-label` for to the status icon for improved accessibility.\n * If not provided, `i18nStrings.{type}IconAriaLabel` will be used as a fallback.\n * * `ariaRole` (string) - For flash messages added after page load, specifies how this message is communicated to assistive\n * technology. Use \"status\" for status updates or informational content. Use \"alert\" for important messages that need the\n * user's attention.\n * * `action` (ReactNode) - Specifies an action for the flash message. Although it is technically possible to insert any content,\n * our UX guidelines only allow you to add a button.\n * * `buttonText` (string) - Specifies that an action button should be displayed, with the specified text.\n * When a user clicks on this button the `onButtonClick` handler is called.\n * If the `action` property is set, this property is ignored. **Deprecated**, replaced by `action`.\n * * `onButtonClick` (event => void) - Called when a user clicks on the action button. This is not called if you create a custom button\n * using the `action` property. **Deprecated**, replaced by `action`.\n * * `onDismiss` (event => void) - (Optional) Called when a user clicks on the dismiss button.\n * * `id` (string) - Specifies a unique flash message identifier. This property is used in two ways:\n * 1. As a [keys](https://reactjs.org/docs/lists-and-keys.html#keys) source for React rendering.\n * 2. To identify which flash message will be removed from the DOM when it is dismissed, to animate it out.\n * * `analyticsMetadata` (FlashbarProps.ItemAnalyticsMetadata) - (Optional) Specifies additional analytics-related metadata.\n * * `suppressFlowMetricEvents` - Prevent this item from generating events related to flow metrics.\n * @analytics\n */\n items: ReadonlyArray<FlashbarProps.MessageDefinition>;\n\n /**\n * Specifies whether flash messages should be stacked.\n */\n stackItems?: boolean;\n\n /**\n * An object containing all the necessary localized strings required by the component. The object should contain:\n *\n * * `ariaLabel` - Specifies the ARIA label for the list of notifications.\n *\n * If `stackItems` is set to `true`, it should also contain:\n *\n * * `notificationBarAriaLabel` - (optional) Specifies the ARIA label for the notification bar\n * * `notificationBarText` - (optional) Specifies the text shown in the notification bar\n * * `errorIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `error`.\n * * `warningIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `warning`.\n * * `infoIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `info`.\n * * `successIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `success`.\n * * `inProgressIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `in-progress` or with `loading` set to `true`.\n * @i18n\n */\n i18nStrings?: FlashbarProps.I18nStrings;\n\n /**\n * Specifies an object of selectors and properties that are used to apply custom styles.\n *\n * - `item.root.background` {error, info, inProgress, success, warning} - (Optional) Background for item types.\n * - `item.root.borderColor` {error, info, inProgress, success, warning} - (Optional) Border color for item types.\n * - `item.root.borderRadius` (string) - (Optional) Item border radius.\n * - `item.root.borderWidth` (string) - (Optional) Item border width.\n * - `item.root.color` {error, info, inProgress, success, warning} - (Optional) Color for item types.\n * - `item.root.focusRing.borderColor` {error, info, inProgress, success, warning} - (Optional) Item focus ring border color.\n * - `item.root.focusRing.borderRadius` (string) - (Optional) Item focus ring border radius.\n * - `item.root.focusRing.borderWidth` (string) - (Optional) Item focus ring border width.\n * - `item.dismissButton.color.active` {error, info, inProgress, success, warning} - (Optional) Color for dismiss button active state.\n * - `item.dismissButton.color.default` {error, info, inProgress, success, warning} - (Optional) Color for dismiss button default state.\n * - `item.dismissButton.color.hover` {error, info, inProgress, success, warning} - (Optional) Color for dismiss button hover state.\n * - `item.dismissButton.focusRing.borderColor` {error, info, inProgress, success, warning} - (Optional) Dismiss button focus ring border color.\n * - `item.dismissButton.focusRing.borderRadius` (string) - (Optional) Dismiss button focus ring border radius.\n * - `item.dismissButton.focusRing.borderWidth` (string) - (Optional) Dismiss button focus ring border width.\n * - `notificationBar.root.background` {active, default, hover} - (Optional) Background for notification bar states.\n * - `notificationBar.root.borderColor` {active, default, hover} - (Optional) Border color for notification bar states.\n * - `notificationBar.root.borderRadius` (string) - (Optional) Notification bar border radius.\n * - `notificationBar.root.borderWidth` (string) - (Optional) Notification bar border width.\n * - `notificationBar.root.color` {active, default, hover} - (Optional) Color for notification bar states.\n * - `notificationBar.expandButton.focusRing.borderColor` (string) - (Optional) Border color for the expand button.\n * - `notificationBar.expandButton.focusRing.borderRadius` (string) - (Optional) Border radius for the expand button.\n * - `notificationBar.expandButton.focusRing.borderWidth` (string) - (Optional) Border width for the expand button.\n * @awsuiSystem core\n */\n style?: FlashbarProps.Style;\n}\n"]}
|
package/internal/environment.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (2c99e1af)";
|
|
3
|
+
export var GIT_SHA = "2c99e1af";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "console";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
package/internal/manifest.json
CHANGED
|
@@ -6,7 +6,10 @@ interface SecondaryRegistration<Props> {
|
|
|
6
6
|
type: 'secondary';
|
|
7
7
|
update: (props: Props) => void;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
interface SuspendedRegistration {
|
|
10
|
+
type: 'suspended';
|
|
11
|
+
}
|
|
12
|
+
export type RegistrationState<Props> = PrimaryRegistration<Props> | SecondaryRegistration<Props> | SuspendedRegistration;
|
|
10
13
|
type RegistrationType = RegistrationState<unknown>['type'];
|
|
11
14
|
type RegistrationChangeHandler<Props> = (registration: PrimaryRegistration<Props> | SecondaryRegistration<Props>) => void;
|
|
12
15
|
interface RegistrationInternal<Props> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-layout-widget.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/app-layout-widget.ts"],"names":[],"mappings":"AAIA,UAAU,mBAAmB,CAAC,KAAK;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;CAC/B;AAED,UAAU,qBAAqB,CAAC,KAAK;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAChC;AAED,MAAM,MAAM,iBAAiB,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"app-layout-widget.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/app-layout-widget.ts"],"names":[],"mappings":"AAIA,UAAU,mBAAmB,CAAC,KAAK;IACjC,IAAI,EAAE,SAAS,CAAC;IAChB,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;CAC/B;AAED,UAAU,qBAAqB,CAAC,KAAK;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAChC;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,CAAC,KAAK,IAC/B,mBAAmB,CAAC,KAAK,CAAC,GAC1B,qBAAqB,CAAC,KAAK,CAAC,GAC5B,qBAAqB,CAAC;AAC1B,KAAK,gBAAgB,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,KAAK,yBAAyB,CAAC,KAAK,IAAI,CACtC,YAAY,EAAE,mBAAmB,CAAC,KAAK,CAAC,GAAG,qBAAqB,CAAC,KAAK,CAAC,KACpE,IAAI,CAAC;AAEV,UAAU,oBAAoB,CAAC,KAAK;IAClC,SAAS,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACxC,KAAK,EAAE,KAAK,CAAC;IACb,iBAAiB,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAChD,QAAQ,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC,KAAK,CAAC,GAAG,qBAAqB,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;CAC7F;AAED,MAAM,WAAW,0BAA0B,CAAC,KAAK,GAAG,OAAO;IACzD,QAAQ,CACN,sBAAsB,EAAE,gBAAgB,GAAG,SAAS,EACpD,aAAa,EAAE,yBAAyB,CAAC,KAAK,CAAC,GAC9C,MAAM,IAAI,CAAC;IACd,kBAAkB,IAAI;QAAE,aAAa,EAAE,KAAK,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAA;KAAE,CAAC;CAC7E;AAED,qBAAa,yBAAyB,CAAC,KAAK,GAAG,OAAO;;IAmCpD,QAAQ,cACK,gBAAgB,GAAG,SAAS,wBACjB,0BAA0B,KAAK,CAAC,KACrD,CAAC,MAAM,IAAI,CAAC,CA0Bb;IAEF,kBAAkB;;MAIhB;IAEF,eAAe,iBACA,QAAQ,2BAA2B,KAAK,CAAC,CAAC,KACtD,2BAA2B,KAAK,CAAC,CAIlC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-layout-widget.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/app-layout-widget.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"app-layout-widget.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/controllers/app-layout-widget.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAyCtC,MAAM,OAAO,yBAAyB;IAAtC;QACE,mDAAqD,EAAE,EAAC;QAExD,iDAAe,GAAG,EAAE;YAClB,MAAM,aAAa,GAAG,uBAAA,IAAI,gDAAe,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC;YACrG,IAAI,aAAa,EAAE;gBACjB,OAAO,aAA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,SAAS;gBACT,QAAQ,EAAE,oBAAoB;gBAC9B,KAAK,EAAE,EAAW;gBAClB,iBAAiB,EAAE;oBACjB,IAAI,EAAE,WAAW;oBACjB,MAAM,EAAE,KAAK,CAAC,EAAE;wBACd,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;wBAC3B,uBAAA,IAAI,iDAAgB,MAApB,IAAI,CAAkB,CAAC;oBACzB,CAAC;iBACF;aACF,CAAC;YACF,uBAAA,IAAI,gDAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAEvC,uBAAA,IAAI,yCAAQ,MAAZ,IAAI,CAAU,CAAC;YAEf,OAAO,GAAG,EAAE;gBACV,uBAAA,IAAI,gDAAe,CAAC,MAAM,CAAC,uBAAA,IAAI,gDAAe,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;gBACzE,uBAAA,IAAI,iDAAgB,MAApB,IAAI,CAAkB,CAAC;YACzB,CAAC,CAAC;QACJ,CAAC,CAAC;QAEF,uBAAkB,GAAG,GAAG,EAAE;YACxB,OAAO;gBACL,aAAa,EAAE,uBAAA,IAAI,gDAAe;aACnC,CAAC;QACJ,CAAC,CAAC;QAEF,oBAAe,GAAG,CAChB,cAA0D,EAAE,EACzB,EAAE;;YACrC,MAAA,WAAW,CAAC,QAAQ,oCAApB,WAAW,CAAC,QAAQ,GAAK,IAAI,CAAC,QAAQ,EAAC;YACvC,MAAA,WAAW,CAAC,kBAAkB,oCAA9B,WAAW,CAAC,kBAAkB,GAAK,IAAI,CAAC,kBAAkB,EAAC;YAC3D,OAAO,WAAgD,CAAC;QAC1D,CAAC,CAAC;IACJ,CAAC;CAAA","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport debounce from '../../debounce';\n\ninterface PrimaryRegistration<Props> {\n type: 'primary';\n discoveredProps: Array<Props>;\n}\n\ninterface SecondaryRegistration<Props> {\n type: 'secondary';\n update: (props: Props) => void;\n}\n\ninterface SuspendedRegistration {\n type: 'suspended';\n}\n\nexport type RegistrationState<Props> =\n | PrimaryRegistration<Props>\n | SecondaryRegistration<Props>\n | SuspendedRegistration;\ntype RegistrationType = RegistrationState<unknown>['type'];\n\ntype RegistrationChangeHandler<Props> = (\n registration: PrimaryRegistration<Props> | SecondaryRegistration<Props>\n) => void;\n\ninterface RegistrationInternal<Props> {\n forceType: RegistrationType | undefined;\n props: Props;\n secondaryInstance: SecondaryRegistration<Props>;\n onChange: (registration: PrimaryRegistration<Props> | SecondaryRegistration<Props>) => void;\n}\n\nexport interface AppLayoutWidgetApiInternal<Props = unknown> {\n register(\n forceDeduplicationType: RegistrationType | undefined,\n onPropsChange: RegistrationChangeHandler<Props>\n ): () => void;\n getStateForTesting(): { registrations: Array<RegistrationInternal<Props>> };\n}\n\nexport class AppLayoutWidgetController<Props = unknown> {\n #registrations: Array<RegistrationInternal<Props>> = [];\n\n #findPrimary = () => {\n const forcedPrimary = this.#registrations.find(registration => registration.forceType === 'primary');\n if (forcedPrimary) {\n return forcedPrimary;\n }\n for (const registration of this.#registrations.slice()) {\n if (registration.forceType !== 'secondary') {\n return registration;\n }\n }\n return undefined;\n };\n\n #update = () => {\n const primary = this.#findPrimary();\n const discoveredProps = this.#registrations\n .filter(registration => registration !== primary)\n .map(registration => registration.props);\n for (const registration of this.#registrations) {\n if (registration === primary) {\n registration.onChange({\n type: 'primary',\n discoveredProps,\n });\n } else {\n registration.onChange(registration.secondaryInstance);\n }\n }\n };\n\n #scheduleUpdate = debounce(() => this.#update(), 0);\n\n register = (\n forceType: RegistrationType | undefined,\n onRegistrationChange: RegistrationChangeHandler<Props>\n ): (() => void) => {\n const hasForcedPrimary = this.#registrations.some(instance => instance.forceType === 'primary');\n if (forceType === 'primary' && hasForcedPrimary) {\n throw new Error('Double primary registration attempt');\n }\n\n const registration: RegistrationInternal<Props> = {\n forceType,\n onChange: onRegistrationChange,\n props: {} as Props,\n secondaryInstance: {\n type: 'secondary',\n update: props => {\n registration.props = props;\n this.#scheduleUpdate();\n },\n },\n };\n this.#registrations.push(registration);\n\n this.#update();\n\n return () => {\n this.#registrations.splice(this.#registrations.indexOf(registration), 1);\n this.#scheduleUpdate();\n };\n };\n\n getStateForTesting = () => {\n return {\n registrations: this.#registrations,\n };\n };\n\n installInternal = (\n internalApi: Partial<AppLayoutWidgetApiInternal<Props>> = {}\n ): AppLayoutWidgetApiInternal<Props> => {\n internalApi.register ??= this.register;\n internalApi.getStateForTesting ??= this.getStateForTesting;\n return internalApi as AppLayoutWidgetApiInternal<Props>;\n };\n}\n"]}
|
|
@@ -13,7 +13,7 @@ export interface KeyValuePairsProps extends BaseComponentProps {
|
|
|
13
13
|
*
|
|
14
14
|
* Each key-value pair definition has the following properties:
|
|
15
15
|
* * `type` (string) - (Optional) Item type (pair).
|
|
16
|
-
* * `label` (
|
|
16
|
+
* * `label` (React.ReactNode) - The key label.
|
|
17
17
|
* * `info` (React.ReactNode) - (Optional) Area next to the key to display an info link.
|
|
18
18
|
* * `value` (React.ReactNode) - The corresponding value for the key.
|
|
19
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/key-value-pairs/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 { BaseComponentProps } from '../internal/base-component';\n\nexport interface KeyValuePairsProps extends BaseComponentProps {\n /**\n * Specifies the number of columns in each grid row.\n * Valid values are any integer between 1 and 4. It defaults to 1.\n */\n columns?: number;\n /**\n * An array of either key-value pairs individual items or groups.\n * They could be combined.\n * Each item has `type` prop, which might be either `group` or `pair`. Defaults to `pair` if not specified.\n *\n * Each key-value pair definition has the following properties:\n * * `type` (string) - (Optional) Item type (pair).\n * * `label` (
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/key-value-pairs/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 { BaseComponentProps } from '../internal/base-component';\n\nexport interface KeyValuePairsProps extends BaseComponentProps {\n /**\n * Specifies the number of columns in each grid row.\n * Valid values are any integer between 1 and 4. It defaults to 1.\n */\n columns?: number;\n /**\n * An array of either key-value pairs individual items or groups.\n * They could be combined.\n * Each item has `type` prop, which might be either `group` or `pair`. Defaults to `pair` if not specified.\n *\n * Each key-value pair definition has the following properties:\n * * `type` (string) - (Optional) Item type (pair).\n * * `label` (React.ReactNode) - The key label.\n * * `info` (React.ReactNode) - (Optional) Area next to the key to display an info link.\n * * `value` (React.ReactNode) - The corresponding value for the key.\n *\n * Each group definition has the following properties:\n * * `type` (string) - Item type (group).\n * * `title` (string) - (Optional) An optional title for this column.\n * * `items` (ReadonlyArray<KeyValuePairProps.KeyValuePair>) - An array of\n * key-value pair items.\n */\n items: ReadonlyArray<KeyValuePairsProps.Item>;\n /**\n * Provides an `aria-label` to the Key-value pairs container.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabel?: string;\n /**\n * Sets the `aria-labelledby` property on the Key-value pairs container.\n * If there's a visible label element that you can reference, use this instead of `ariaLabel`.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabelledby?: string;\n\n /**\n * Use to specify the desired minimum width for each column in pixels.\n *\n * The number of columns is determined by the value of this property, the available space,\n * and the maximum number of columns as defined by the `columns` property.\n * If not set, defaults to 150.\n */\n minColumnWidth?: number;\n}\n\nexport namespace KeyValuePairsProps {\n export type Item = Group | Pair;\n\n export interface Group {\n type: 'group';\n title?: string;\n items: ReadonlyArray<Pair>;\n }\n\n export interface Pair extends BaseComponentProps {\n type?: 'pair';\n label: React.ReactNode;\n value: React.ReactNode;\n info?: React.ReactNode;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"./internal/base-component/index.js",
|
|
151
151
|
"./internal/base-component/styles.css.js"
|
|
152
152
|
],
|
|
153
|
-
"version": "3.0.
|
|
153
|
+
"version": "3.0.1052",
|
|
154
154
|
"repository": {
|
|
155
155
|
"type": "git",
|
|
156
156
|
"url": "https://github.com/cloudscape-design/components.git"
|