@cloudscape-design/components-themeable 3.0.1210 → 3.0.1212
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/internal/components/dropdown/styles.scss +3 -2
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +140 -139
- package/lib/internal/template/alert/interfaces.d.ts +2 -0
- package/lib/internal/template/alert/interfaces.d.ts.map +1 -1
- package/lib/internal/template/alert/interfaces.js.map +1 -1
- 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 +13 -13
- package/lib/internal/template/annotation-context/annotation/styles.scoped.css +21 -21
- package/lib/internal/template/annotation-context/annotation/styles.selectors.js +13 -13
- 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/styles.css.js +30 -30
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +87 -87
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +30 -30
- 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/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/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/interfaces.d.ts +2 -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/badge/interfaces.d.ts +2 -0
- package/lib/internal/template/badge/interfaces.d.ts.map +1 -1
- package/lib/internal/template/badge/interfaces.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/interfaces.d.ts +2 -0
- package/lib/internal/template/button/interfaces.d.ts.map +1 -1
- package/lib/internal/template/button/interfaces.js.map +1 -1
- 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/category-elements/expandable-category-element.js +1 -1
- package/lib/internal/template/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
- package/lib/internal/template/button-dropdown/internal.d.ts.map +1 -1
- package/lib/internal/template/button-dropdown/internal.js +1 -1
- package/lib/internal/template/button-dropdown/internal.js.map +1 -1
- package/lib/internal/template/button-dropdown/item-element/styles.css.js +21 -21
- package/lib/internal/template/button-dropdown/item-element/styles.scoped.css +37 -37
- package/lib/internal/template/button-dropdown/item-element/styles.selectors.js +21 -21
- package/lib/internal/template/button-group/interfaces.d.ts +2 -0
- 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/interfaces.d.ts +2 -0
- package/lib/internal/template/checkbox/interfaces.d.ts.map +1 -1
- package/lib/internal/template/checkbox/interfaces.js.map +1 -1
- package/lib/internal/template/checkbox/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/column-layout/flexible-column-layout/index.js +2 -2
- package/lib/internal/template/column-layout/flexible-column-layout/index.js.map +1 -1
- package/lib/internal/template/column-layout/grid-column-layout.js +1 -1
- package/lib/internal/template/column-layout/grid-column-layout.js.map +1 -1
- package/lib/internal/template/container/interfaces.d.ts +2 -0
- package/lib/internal/template/container/interfaces.d.ts.map +1 -1
- package/lib/internal/template/container/interfaces.js.map +1 -1
- 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/date-picker/index.d.ts.map +1 -1
- package/lib/internal/template/date-picker/index.js +1 -1
- package/lib/internal/template/date-picker/index.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 +1 -1
- package/lib/internal/template/date-range-picker/index.js.map +1 -1
- package/lib/internal/template/flashbar/interfaces.d.ts +2 -0
- package/lib/internal/template/flashbar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/flashbar/interfaces.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/grid/internal.d.ts.map +1 -1
- package/lib/internal/template/grid/internal.js +2 -2
- package/lib/internal/template/grid/internal.js.map +1 -1
- 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/interfaces.d.ts +2 -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/styles.css.js +13 -13
- package/lib/internal/template/input/styles.scoped.css +74 -74
- package/lib/internal/template/input/styles.selectors.js +13 -13
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.js +2 -1
- package/lib/internal/template/internal/components/autosuggest-input/index.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.css.js +30 -30
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.scoped.css +58 -58
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.selectors.js +30 -30
- package/lib/internal/template/internal/components/dropdown/dropdown-fit-handler.d.ts +9 -9
- package/lib/internal/template/internal/components/dropdown/dropdown-fit-handler.d.ts.map +1 -1
- package/lib/internal/template/internal/components/dropdown/dropdown-fit-handler.js +22 -23
- package/lib/internal/template/internal/components/dropdown/dropdown-fit-handler.js.map +1 -1
- package/lib/internal/template/internal/components/dropdown/dropdown-position.d.ts.map +1 -1
- package/lib/internal/template/internal/components/dropdown/dropdown-position.js +4 -1
- package/lib/internal/template/internal/components/dropdown/dropdown-position.js.map +1 -1
- package/lib/internal/template/internal/components/dropdown/index.d.ts +1 -1
- package/lib/internal/template/internal/components/dropdown/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/dropdown/index.js +54 -30
- package/lib/internal/template/internal/components/dropdown/index.js.map +1 -1
- package/lib/internal/template/internal/components/dropdown/interfaces.d.ts +33 -18
- package/lib/internal/template/internal/components/dropdown/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/dropdown/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/dropdown/styles.css.js +20 -20
- package/lib/internal/template/internal/components/dropdown/styles.scoped.css +39 -38
- package/lib/internal/template/internal/components/dropdown/styles.selectors.js +20 -20
- package/lib/internal/template/internal/components/radio-button/interfaces.d.ts +2 -0
- package/lib/internal/template/internal/components/radio-button/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/radio-button/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/radio-button/styles.css.js +7 -7
- package/lib/internal/template/internal/components/radio-button/styles.scoped.css +18 -18
- package/lib/internal/template/internal/components/radio-button/styles.selectors.js +7 -7
- 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 +1 -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 +139 -138
- package/lib/internal/template/internal/generated/custom-css-properties/index.js.map +1 -1
- package/lib/internal/template/internal/hooks/use-base-component/styles-check.d.ts +1 -2
- package/lib/internal/template/internal/hooks/use-base-component/styles-check.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-base-component/styles-check.js +27 -7
- package/lib/internal/template/internal/hooks/use-base-component/styles-check.js.map +1 -1
- package/lib/internal/template/internal/utils/flatten-children.d.ts +3 -0
- package/lib/internal/template/internal/utils/flatten-children.d.ts.map +1 -0
- package/lib/internal/template/internal/utils/flatten-children.js +17 -0
- package/lib/internal/template/internal/utils/flatten-children.js.map +1 -0
- package/lib/internal/template/link/interfaces.d.ts +2 -0
- package/lib/internal/template/link/interfaces.d.ts.map +1 -1
- package/lib/internal/template/link/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/multiselect/internal.d.ts.map +1 -1
- package/lib/internal/template/multiselect/internal.js +2 -1
- package/lib/internal/template/multiselect/internal.js.map +1 -1
- package/lib/internal/template/multiselect/use-multiselect.d.ts +1 -1
- package/lib/internal/template/progress-bar/interfaces.d.ts +2 -0
- package/lib/internal/template/progress-bar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/progress-bar/interfaces.js.map +1 -1
- package/lib/internal/template/progress-bar/styles.css.js +18 -18
- package/lib/internal/template/progress-bar/styles.scoped.css +48 -48
- package/lib/internal/template/progress-bar/styles.selectors.js +18 -18
- package/lib/internal/template/prompt-input/interfaces.d.ts +2 -0
- package/lib/internal/template/prompt-input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/prompt-input/interfaces.js.map +1 -1
- package/lib/internal/template/prompt-input/styles.css.js +17 -17
- package/lib/internal/template/prompt-input/styles.scoped.css +79 -79
- package/lib/internal/template/prompt-input/styles.selectors.js +17 -17
- package/lib/internal/template/radio-group/interfaces.d.ts +2 -0
- package/lib/internal/template/radio-group/interfaces.d.ts.map +1 -1
- package/lib/internal/template/radio-group/interfaces.js.map +1 -1
- package/lib/internal/template/segmented-control/interfaces.d.ts +2 -0
- package/lib/internal/template/segmented-control/interfaces.d.ts.map +1 -1
- package/lib/internal/template/segmented-control/interfaces.js.map +1 -1
- package/lib/internal/template/segmented-control/styles.css.js +16 -16
- package/lib/internal/template/segmented-control/styles.scoped.css +46 -46
- package/lib/internal/template/segmented-control/styles.selectors.js +16 -16
- package/lib/internal/template/select/internal.d.ts.map +1 -1
- package/lib/internal/template/select/internal.js +2 -1
- package/lib/internal/template/select/internal.js.map +1 -1
- package/lib/internal/template/select/utils/use-select.d.ts +1 -1
- package/lib/internal/template/select/utils/use-select.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-select.js +1 -1
- package/lib/internal/template/select/utils/use-select.js.map +1 -1
- package/lib/internal/template/slider/interfaces.d.ts +2 -0
- package/lib/internal/template/slider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/slider/interfaces.js.map +1 -1
- package/lib/internal/template/slider/styles.css.js +26 -26
- package/lib/internal/template/slider/styles.scoped.css +165 -165
- package/lib/internal/template/slider/styles.selectors.js +26 -26
- package/lib/internal/template/space-between/internal.d.ts.map +1 -1
- package/lib/internal/template/space-between/internal.js +4 -3
- package/lib/internal/template/space-between/internal.js.map +1 -1
- 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/tabs/interfaces.d.ts +2 -0
- package/lib/internal/template/tabs/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tabs/interfaces.js.map +1 -1
- package/lib/internal/template/tabs/styles.css.js +30 -30
- package/lib/internal/template/tabs/styles.scoped.css +76 -76
- package/lib/internal/template/tabs/styles.selectors.js +30 -30
- 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/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/text-filter/interfaces.d.ts +2 -0
- package/lib/internal/template/text-filter/interfaces.d.ts.map +1 -1
- package/lib/internal/template/text-filter/interfaces.js.map +1 -1
- package/lib/internal/template/textarea/interfaces.d.ts +2 -0
- package/lib/internal/template/textarea/interfaces.d.ts.map +1 -1
- package/lib/internal/template/textarea/interfaces.js.map +1 -1
- package/lib/internal/template/textarea/styles.css.js +5 -5
- package/lib/internal/template/textarea/styles.scoped.css +45 -45
- package/lib/internal/template/textarea/styles.selectors.js +5 -5
- package/lib/internal/template/toggle/interfaces.d.ts +2 -0
- package/lib/internal/template/toggle/interfaces.d.ts.map +1 -1
- package/lib/internal/template/toggle/interfaces.js.map +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/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-group/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\n\nexport interface ButtonGroupProps extends BaseComponentProps {\n /**\n * Adds `aria-label` to the button group toolbar element.\n * Use this to provide a unique accessible name for each button group on the page.\n */\n ariaLabel?: string;\n /**\n * Determines the general styling of the button dropdown.\n * * `icon` for icon buttons.\n */\n variant: ButtonGroupProps.Variant;\n /**\n * Use this property to determine dropdown placement strategy for all menu dropdown items.\n *\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * We recommend you use discretion, and don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n dropdownExpandToViewport?: boolean;\n /**\n * Array of objects with a number of supported types.\n *\n * ### icon-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconAlt` (optional, string) - Specifies alternate text for the icon when using `iconUrl`.\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n *\n * ### icon-toggle-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `pressed` (boolean) - The toggle button pressed state.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `pressedIconName` (optional, string) - Specifies the name of the icon in pressed state, used with the [icon component](/components/icon/).\n * * `pressedIconUrl` (optional, string) - Specifies the URL of a custom icon in pressed state.\n * * `pressedIconSvg` (optional, ReactNode) - Custom SVG icon in pressed state. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n * * `pressedPopoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button in pressed state. Defaults to `popoverFeedback`.\n *\n * * ### file-input\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onFilesChange`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `accept` (optional, string) - Specifies the native file input `accept` attribute to describe the allow-list of file types.\n * * `multiple` (optional, string) - Specifies the native file input `multiple` attribute to allow users entering more than one file.\n *\n * ### menu-dropdown\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `disabled` (optional, boolean) - The disabled state indication for the menu button.\n * * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.\n * * `loading` (optional, boolean) - The loading state indication for the menu button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `items` (ButtonDropdownProps.ItemOrGroup[]) - The array of dropdown items that belong to this menu.\n *\n * ### group\n *\n * * `text` (string) - The name of the group rendered as ARIA label for this group.\n * * `items` ((ButtonGroupProps.IconButton | ButtonGroupProps.MenuDropdown)[]) - The array of items that belong to this group.\n */\n items: ReadonlyArray<ButtonGroupProps.ItemOrGroup>;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n /**\n * Called when the user uploads files. The event detail object contains the id and files from the file input item.\n */\n onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails>;\n /**\n * @awsuiSystem core\n */\n style?: ButtonGroupProps.Style;\n}\n\nexport interface InternalIconButton extends ButtonGroupProps.IconButton {\n analyticsAction?: string;\n}\nexport interface InternalIconToggleButton extends ButtonGroupProps.IconToggleButton {\n analyticsAction?: string;\n}\n\nexport interface IconButtonRuntime extends Omit<ButtonGroupProps.IconButton, 'iconSvg' | 'popoverFeedback'> {\n iconSvg?: string;\n}\nexport interface IconToggleButtonRuntime\n extends Omit<\n ButtonGroupProps.IconToggleButton,\n 'iconSvg' | 'pressedIconSvg' | 'popoverFeedback' | 'pressedPopoverFeedback'\n > {\n iconSvg?: string;\n pressedIconSvg?: string;\n}\nexport type ItemOrGroupRuntime = ItemRuntime | ButtonGroupProps.Group;\nexport type ItemRuntime =\n | IconButtonRuntime\n | IconToggleButtonRuntime\n | ButtonGroupProps.IconFileInput\n | ButtonGroupProps.MenuDropdown;\n\nexport type InternalItemOrGroup = InternalItem | ButtonGroupProps.Group;\nexport type InternalItem =\n | InternalIconButton\n | InternalIconToggleButton\n | ButtonGroupProps.IconFileInput\n | ButtonGroupProps.MenuDropdown;\n\nexport interface InternalButtonGroupProps\n extends SomeRequired<ButtonGroupProps, 'dropdownExpandToViewport'>,\n InternalBaseComponentProps {\n style?: ButtonGroupProps.Style;\n items: ReadonlyArray<InternalItemOrGroup>;\n}\n\nexport namespace ButtonGroupProps {\n export type Variant = 'icon';\n\n export type ItemOrGroup = Item | Group;\n export type Item = IconButton | IconToggleButton | IconFileInput | MenuDropdown;\n\n export interface IconButton {\n type: 'icon-button';\n id: string;\n text: string;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconAlt?: string;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n }\n\n export interface IconToggleButton {\n type: 'icon-toggle-button';\n id: string;\n text: string;\n pressed: boolean;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n pressedIconName?: IconProps.Name;\n pressedIconUrl?: string;\n pressedIconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n pressedPopoverFeedback?: React.ReactNode;\n }\n\n export interface IconFileInput {\n type: 'icon-file-input';\n id: string;\n text: string;\n accept?: string;\n multiple?: boolean;\n }\n\n export interface MenuDropdown {\n type: 'menu-dropdown';\n id: string;\n text: string;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n }\n\n export interface Group {\n type: 'group';\n text: string;\n items: ReadonlyArray<ButtonGroupProps.Item>;\n }\n\n export interface ItemClickDetails {\n id: string;\n pressed?: boolean;\n checked?: boolean;\n }\n\n export interface FilesChangeDetails {\n id: string;\n files: File[];\n }\n\n export interface Ref {\n /**\n * Focuses button group item by id.\n */\n focus(itemId: string): void;\n }\n export interface Style {\n root?: {\n background?: string;\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n paddingBlock?: string;\n paddingInline?: string;\n boxShadow?: string;\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n item?: {\n color?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n boxShadow?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/button-group/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces';\nimport { IconProps } from '../icon/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\n\nexport interface ButtonGroupProps extends BaseComponentProps {\n /**\n * Adds `aria-label` to the button group toolbar element.\n * Use this to provide a unique accessible name for each button group on the page.\n */\n ariaLabel?: string;\n /**\n * Determines the general styling of the button dropdown.\n * * `icon` for icon buttons.\n */\n variant: ButtonGroupProps.Variant;\n /**\n * Use this property to determine dropdown placement strategy for all menu dropdown items.\n *\n * By default, the dropdown height is constrained to fit inside the height of its next scrollable container element.\n * Enabling this property will allow the dropdown to extend beyond that container by using fixed positioning and\n * [React Portals](https://reactjs.org/docs/portals.html).\n *\n * Set this property if the dropdown would otherwise be constrained by a scrollable container,\n * for example inside table and split view layouts.\n *\n * We recommend you use discretion, and don't enable this property unless necessary\n * because fixed positioning results in a slight, visible lag when scrolling complex pages.\n */\n dropdownExpandToViewport?: boolean;\n /**\n * Array of objects with a number of supported types.\n *\n * ### icon-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconAlt` (optional, string) - Specifies alternate text for the icon when using `iconUrl`.\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n *\n * ### icon-toggle-button\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick` handler and to focus the button using `ref.focus(id)`.\n * * `pressed` (boolean) - The toggle button pressed state.\n * * `text` (string) - The name shown as a tooltip for this button.\n * * `disabled` (optional, boolean) - The disabled state indication for this button.\n * * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.\n * * `loading` (optional, boolean) - The loading state indication for this button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `iconName` (optional, string) - Specifies the name of the icon, used with the [icon component](/components/icon/).\n * * `iconUrl` (optional, string) - Specifies the URL of a custom icon.\n * * `iconSvg` (optional, ReactNode) - Custom SVG icon. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `pressedIconName` (optional, string) - Specifies the name of the icon in pressed state, used with the [icon component](/components/icon/).\n * * `pressedIconUrl` (optional, string) - Specifies the URL of a custom icon in pressed state.\n * * `pressedIconSvg` (optional, ReactNode) - Custom SVG icon in pressed state. Equivalent to the `svg` slot of the [icon component](/components/icon/).\n * * `popoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button. Use to provide feedback to the user.\n * * `pressedPopoverFeedback` (optional, ReactNode) - Text that appears when the user clicks the button in pressed state. Defaults to `popoverFeedback`.\n *\n * * ### file-input\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onFilesChange`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `accept` (optional, string) - Specifies the native file input `accept` attribute to describe the allow-list of file types.\n * * `multiple` (optional, string) - Specifies the native file input `multiple` attribute to allow users entering more than one file.\n *\n * ### menu-dropdown\n *\n * * `id` (string) - The unique identifier of the button, used as detail in `onItemClick`.\n * * `text` (string) - The name of the menu button shown as a tooltip.\n * * `disabled` (optional, boolean) - The disabled state indication for the menu button.\n * * `disabledReason` (optional, boolean) - Provides a reason why the button is disabled (only when `disabled` is `true`). If provided, the button becomes focusable.\n * * `loading` (optional, boolean) - The loading state indication for the menu button.\n * * `loadingText` (optional, string) - The loading text announced to screen readers.\n * * `items` (ButtonDropdownProps.ItemOrGroup[]) - The array of dropdown items that belong to this menu.\n *\n * ### group\n *\n * * `text` (string) - The name of the group rendered as ARIA label for this group.\n * * `items` ((ButtonGroupProps.IconButton | ButtonGroupProps.MenuDropdown)[]) - The array of items that belong to this group.\n */\n items: ReadonlyArray<ButtonGroupProps.ItemOrGroup>;\n /**\n * Called when the user clicks on an item, and the item is not disabled. The event detail object contains the id of the clicked item.\n */\n onItemClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n /**\n * Called when the user uploads files. The event detail object contains the id and files from the file input item.\n */\n onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails>;\n /**\n * An object containing CSS properties to customize the button group's visual appearance.\n * Refer to the [style](/components/button-group/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: ButtonGroupProps.Style;\n}\n\nexport interface InternalIconButton extends ButtonGroupProps.IconButton {\n analyticsAction?: string;\n}\nexport interface InternalIconToggleButton extends ButtonGroupProps.IconToggleButton {\n analyticsAction?: string;\n}\n\nexport interface IconButtonRuntime extends Omit<ButtonGroupProps.IconButton, 'iconSvg' | 'popoverFeedback'> {\n iconSvg?: string;\n}\nexport interface IconToggleButtonRuntime\n extends Omit<\n ButtonGroupProps.IconToggleButton,\n 'iconSvg' | 'pressedIconSvg' | 'popoverFeedback' | 'pressedPopoverFeedback'\n > {\n iconSvg?: string;\n pressedIconSvg?: string;\n}\nexport type ItemOrGroupRuntime = ItemRuntime | ButtonGroupProps.Group;\nexport type ItemRuntime =\n | IconButtonRuntime\n | IconToggleButtonRuntime\n | ButtonGroupProps.IconFileInput\n | ButtonGroupProps.MenuDropdown;\n\nexport type InternalItemOrGroup = InternalItem | ButtonGroupProps.Group;\nexport type InternalItem =\n | InternalIconButton\n | InternalIconToggleButton\n | ButtonGroupProps.IconFileInput\n | ButtonGroupProps.MenuDropdown;\n\nexport interface InternalButtonGroupProps\n extends SomeRequired<ButtonGroupProps, 'dropdownExpandToViewport'>,\n InternalBaseComponentProps {\n style?: ButtonGroupProps.Style;\n items: ReadonlyArray<InternalItemOrGroup>;\n}\n\nexport namespace ButtonGroupProps {\n export type Variant = 'icon';\n\n export type ItemOrGroup = Item | Group;\n export type Item = IconButton | IconToggleButton | IconFileInput | MenuDropdown;\n\n export interface IconButton {\n type: 'icon-button';\n id: string;\n text: string;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconAlt?: string;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n }\n\n export interface IconToggleButton {\n type: 'icon-toggle-button';\n id: string;\n text: string;\n pressed: boolean;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n iconName?: IconProps.Name;\n iconUrl?: string;\n iconSvg?: React.ReactNode;\n pressedIconName?: IconProps.Name;\n pressedIconUrl?: string;\n pressedIconSvg?: React.ReactNode;\n popoverFeedback?: React.ReactNode;\n pressedPopoverFeedback?: React.ReactNode;\n }\n\n export interface IconFileInput {\n type: 'icon-file-input';\n id: string;\n text: string;\n accept?: string;\n multiple?: boolean;\n }\n\n export interface MenuDropdown {\n type: 'menu-dropdown';\n id: string;\n text: string;\n disabled?: boolean;\n disabledReason?: string;\n loading?: boolean;\n loadingText?: string;\n items: ReadonlyArray<ButtonDropdownProps.ItemOrGroup>;\n }\n\n export interface Group {\n type: 'group';\n text: string;\n items: ReadonlyArray<ButtonGroupProps.Item>;\n }\n\n export interface ItemClickDetails {\n id: string;\n pressed?: boolean;\n checked?: boolean;\n }\n\n export interface FilesChangeDetails {\n id: string;\n files: File[];\n }\n\n export interface Ref {\n /**\n * Focuses button group item by id.\n */\n focus(itemId: string): void;\n }\n export interface Style {\n root?: {\n background?: string;\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n paddingBlock?: string;\n paddingInline?: string;\n boxShadow?: string;\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n item?: {\n color?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n boxShadow?: {\n active?: string;\n default?: string;\n disabled?: string;\n hover?: string;\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n }\n}\n"]}
|
|
@@ -26,6 +26,8 @@ export interface CheckboxProps extends BaseCheckboxProps {
|
|
|
26
26
|
*/
|
|
27
27
|
ariaRequired?: boolean;
|
|
28
28
|
/**
|
|
29
|
+
* An object containing CSS properties to customize the checkbox's visual appearance.
|
|
30
|
+
* Refer to the [style](/components/checkbox/?tabId=style) tab for more details.
|
|
29
31
|
* @awsuiSystem core
|
|
30
32
|
*/
|
|
31
33
|
style?: CheckboxProps.Style;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/checkbox/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,yBAAyB,EAAE,MAA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MAAM,CAAC;aACnB,CAAC;SACH,CAAC;KACH;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/checkbox/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 { NonCancelableEventHandler } from '../internal/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\nimport { BaseCheckboxProps } from './base-checkbox';\n\nexport interface CheckboxProps extends BaseCheckboxProps {\n /**\n * The control's label that's displayed next to the checkbox. A state change occurs when a user clicks on it.\n * @displayname label\n */\n children?: React.ReactNode;\n\n /**\n * Specifies that the component is in an indeterminate state. The behavior of this property replicates\n * the behavior of [the respective property](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes)\n * in the native control.\n */\n indeterminate?: boolean;\n\n /**\n * Called when the user changes the component state. The event `detail` contains the current value for the `checked` property.\n */\n onChange?: NonCancelableEventHandler<CheckboxProps.ChangeDetail>;\n\n /**\n * Specifies whether to add `aria-required` to the native control.\n */\n ariaRequired?: boolean;\n\n /**\n * @awsuiSystem core\n */\n style?: CheckboxProps.Style;\n\n /**\n * Attributes to add to the native `input` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeInputAttributes?: NativeAttributes<React.InputHTMLAttributes<HTMLInputElement>>;\n}\n\nexport namespace CheckboxProps {\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n }\n\n export interface ChangeDetail {\n checked: boolean;\n indeterminate: false;\n }\n\n export interface Style {\n input?: {\n fill?: {\n checked?: string;\n default?: string;\n disabled?: string;\n indeterminate?: string;\n readOnly?: string;\n };\n stroke?: {\n checked?: string;\n default?: string;\n disabled?: string;\n indeterminate?: string;\n readOnly?: string;\n };\n check?: {\n stroke?: {\n checked?: string;\n disabled?: string;\n indeterminate?: string;\n readOnly?: string;\n };\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n label?: {\n color?: {\n checked?: string;\n default?: string;\n disabled?: string;\n indeterminate?: string;\n readOnly?: string;\n };\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/checkbox/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 { NonCancelableEventHandler } from '../internal/events';\n/**\n * @awsuiSystem core\n */\nimport { NativeAttributes } from '../internal/utils/with-native-attributes';\nimport { BaseCheckboxProps } from './base-checkbox';\n\nexport interface CheckboxProps extends BaseCheckboxProps {\n /**\n * The control's label that's displayed next to the checkbox. A state change occurs when a user clicks on it.\n * @displayname label\n */\n children?: React.ReactNode;\n\n /**\n * Specifies that the component is in an indeterminate state. The behavior of this property replicates\n * the behavior of [the respective property](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#Indeterminate_state_checkboxes)\n * in the native control.\n */\n indeterminate?: boolean;\n\n /**\n * Called when the user changes the component state. The event `detail` contains the current value for the `checked` property.\n */\n onChange?: NonCancelableEventHandler<CheckboxProps.ChangeDetail>;\n\n /**\n * Specifies whether to add `aria-required` to the native control.\n */\n ariaRequired?: boolean;\n\n /**\n * An object containing CSS properties to customize the checkbox's visual appearance.\n * Refer to the [style](/components/checkbox/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: CheckboxProps.Style;\n\n /**\n * Attributes to add to the native `input` element.\n * Some attributes will be automatically combined with internal attribute values:\n * - `className` will be appended.\n * - Event handlers will be chained, unless the default is prevented.\n *\n * We do not support using this attribute to apply custom styling.\n *\n * @awsuiSystem core\n */\n nativeInputAttributes?: NativeAttributes<React.InputHTMLAttributes<HTMLInputElement>>;\n}\n\nexport namespace CheckboxProps {\n export interface Ref {\n /**\n * Sets input focus onto the UI control.\n */\n focus(): void;\n }\n\n export interface ChangeDetail {\n checked: boolean;\n indeterminate: false;\n }\n\n export interface Style {\n input?: {\n fill?: {\n checked?: string;\n default?: string;\n disabled?: string;\n indeterminate?: string;\n readOnly?: string;\n };\n stroke?: {\n checked?: string;\n default?: string;\n disabled?: string;\n indeterminate?: string;\n readOnly?: string;\n };\n check?: {\n stroke?: {\n checked?: string;\n disabled?: string;\n indeterminate?: string;\n readOnly?: string;\n };\n };\n focusRing?: {\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n };\n };\n label?: {\n color?: {\n checked?: string;\n default?: string;\n disabled?: string;\n indeterminate?: string;\n readOnly?: string;\n };\n };\n }\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"checkbox-control": "awsui_checkbox-
|
|
6
|
-
"outline": "
|
|
4
|
+
"root": "awsui_root_k2y2q_1cyq7_145",
|
|
5
|
+
"checkbox-control": "awsui_checkbox-control_k2y2q_1cyq7_178",
|
|
6
|
+
"outline": "awsui_outline_k2y2q_1cyq7_186"
|
|
7
7
|
};
|
|
8
8
|
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
*/
|
|
143
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.
|
|
145
|
+
.awsui_root_k2y2q_1cyq7_145.awsui_root_k2y2q_1cyq7_145:not(#\9) {
|
|
146
146
|
border-collapse: separate;
|
|
147
147
|
border-spacing: 0;
|
|
148
148
|
box-sizing: border-box;
|
|
@@ -175,7 +175,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
175
175
|
display: flex;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
.awsui_checkbox-
|
|
178
|
+
.awsui_checkbox-control_k2y2q_1cyq7_178:not(#\9) {
|
|
179
179
|
margin-block-start: calc((var(--line-height-body-m-bedeoh, 22px) - var(--size-control-lkpwjy, 14px)) / 2);
|
|
180
180
|
min-block-size: var(--size-control-lkpwjy, 14px);
|
|
181
181
|
min-inline-size: var(--size-control-lkpwjy, 14px);
|
|
@@ -183,15 +183,15 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
183
183
|
inline-size: var(--size-control-lkpwjy, 14px);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
.
|
|
187
|
-
--awsui-style-focus-ring-box-shadow-
|
|
186
|
+
.awsui_outline_k2y2q_1cyq7_186:not(#\9) {
|
|
187
|
+
--awsui-style-focus-ring-box-shadow-c5ek4l: 0 0 0 var(--awsui-style-focus-ring-border-width-c5ek4l, 2px) var(--awsui-style-focus-ring-border-color-c5ek4l, var(--color-border-item-focused-r5f6xl, #0073bb));
|
|
188
188
|
position: relative;
|
|
189
189
|
}
|
|
190
|
-
.
|
|
190
|
+
.awsui_outline_k2y2q_1cyq7_186:not(#\9) {
|
|
191
191
|
outline: 2px dotted transparent;
|
|
192
192
|
outline-offset: calc(2px - 1px);
|
|
193
193
|
}
|
|
194
|
-
.
|
|
194
|
+
.awsui_outline_k2y2q_1cyq7_186:not(#\9)::before {
|
|
195
195
|
content: " ";
|
|
196
196
|
display: block;
|
|
197
197
|
position: absolute;
|
|
@@ -199,9 +199,9 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
199
199
|
inset-block-start: calc(-1 * 2px);
|
|
200
200
|
inline-size: calc(100% + 2px + 2px);
|
|
201
201
|
block-size: calc(100% + 2px + 2px);
|
|
202
|
-
border-start-start-radius: var(--awsui-style-focus-ring-border-radius-
|
|
203
|
-
border-start-end-radius: var(--awsui-style-focus-ring-border-radius-
|
|
204
|
-
border-end-start-radius: var(--awsui-style-focus-ring-border-radius-
|
|
205
|
-
border-end-end-radius: var(--awsui-style-focus-ring-border-radius-
|
|
206
|
-
box-shadow: var(--awsui-style-focus-ring-box-shadow-
|
|
202
|
+
border-start-start-radius: var(--awsui-style-focus-ring-border-radius-c5ek4l, var(--border-radius-control-default-focus-ring-9xsko1, 2px));
|
|
203
|
+
border-start-end-radius: var(--awsui-style-focus-ring-border-radius-c5ek4l, var(--border-radius-control-default-focus-ring-9xsko1, 2px));
|
|
204
|
+
border-end-start-radius: var(--awsui-style-focus-ring-border-radius-c5ek4l, var(--border-radius-control-default-focus-ring-9xsko1, 2px));
|
|
205
|
+
border-end-end-radius: var(--awsui-style-focus-ring-border-radius-c5ek4l, var(--border-radius-control-default-focus-ring-9xsko1, 2px));
|
|
206
|
+
box-shadow: var(--awsui-style-focus-ring-box-shadow-c5ek4l);
|
|
207
207
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"checkbox-control": "awsui_checkbox-
|
|
7
|
-
"outline": "
|
|
5
|
+
"root": "awsui_root_k2y2q_1cyq7_145",
|
|
6
|
+
"checkbox-control": "awsui_checkbox-control_k2y2q_1cyq7_178",
|
|
7
|
+
"outline": "awsui_outline_k2y2q_1cyq7_186"
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import flattenChildren from 'react-keyed-flatten-children';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
import { useContainerQuery } from '@cloudscape-design/component-toolkit';
|
|
6
|
+
import { flattenChildren } from '../../internal/utils/flatten-children';
|
|
7
7
|
import styles from './styles.css.js';
|
|
8
8
|
const isOdd = (value) => value % 2 !== 0;
|
|
9
9
|
export function calculcateCssColumnCount(columns, minColumnWidth, containerWidth) {
|
|
@@ -24,7 +24,7 @@ export default function FlexibleColumnLayout({ columns = 1, minColumnWidth = 0,
|
|
|
24
24
|
const Tag = (__tagOverride !== null && __tagOverride !== void 0 ? __tagOverride : 'div');
|
|
25
25
|
return (React.createElement(Tag, { ref: containerRef, className: clsx(styles['css-grid'], styles[`grid-variant-${variant}`], shouldDisableGutters && [styles['grid-no-gutters']]), style: { gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))` } }, flattenedChildren.map((child, i) => {
|
|
26
26
|
// If this react child is a primitive value, the key will be undefined
|
|
27
|
-
const key = child.key;
|
|
27
|
+
const key = child && typeof child === 'object' ? child.key : undefined;
|
|
28
28
|
return (React.createElement("div", { key: key ? String(key) : undefined, className: clsx(styles.item, {
|
|
29
29
|
[styles['first-column']]: i % columnCount === 0,
|
|
30
30
|
}) }, child));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/column-layout/flexible-column-layout/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/column-layout/flexible-column-layout/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,KAAK,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CAAC,gBAAgB,OAAO,EAAE,CAAC,EACjC,oBAAoB,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CACpD,EACD,KAAK,EAAE,EAAE,mBAAmB,EAAE,UAAU,WAAW,mBAAmB,EAAE,IAEvE,iBAAiB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QAClC,sEAAsE;QACtE,MAAM,GAAG,GAAG,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAE,KAAgC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;QAEnG,OAAO,CACL,6BACE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,EAClC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;gBAC3B,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,WAAW,KAAK,CAAC;aAChD,CAAC,IAED,KAAK,CACF,CACP,CAAC;IACJ,CAAC,CAAC,CACE,CACP,CAAC;AACJ,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 { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport { flattenChildren } from '../../internal/utils/flatten-children';\nimport { InternalColumnLayoutProps } from '../interfaces';\n\nimport styles from './styles.css.js';\n\nconst isOdd = (value: number): boolean => value % 2 !== 0;\n\nexport function calculcateCssColumnCount(\n columns: number,\n minColumnWidth: number,\n containerWidth: number | null\n): number {\n if (!containerWidth) {\n return columns;\n }\n\n // First, calculate how many columns we can have based on the current container width and minColumnWidth.\n const targetColumnCount = Math.min(columns, Math.floor(containerWidth / minColumnWidth));\n\n // When we start wrapping into fewer columns than desired, we want to keep the number of columns even.\n return Math.max(\n 1,\n targetColumnCount < columns && isOdd(targetColumnCount) ? targetColumnCount - 1 : targetColumnCount\n );\n}\n\ninterface FlexibleColumnLayoutProps\n extends Pick<\n InternalColumnLayoutProps,\n 'minColumnWidth' | 'columns' | 'variant' | 'borders' | 'disableGutters' | '__tagOverride'\n > {\n children: React.ReactNode;\n}\n\nexport default function FlexibleColumnLayout({\n columns = 1,\n minColumnWidth = 0,\n disableGutters,\n variant,\n children,\n __tagOverride,\n}: FlexibleColumnLayoutProps) {\n const [containerWidth, containerRef] = useContainerQuery(rect => rect.contentBoxWidth);\n\n const columnCount = calculcateCssColumnCount(columns, minColumnWidth, containerWidth);\n const shouldDisableGutters = variant !== 'text-grid' && disableGutters;\n\n // Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n const flattenedChildren = flattenChildren(children);\n const Tag = (__tagOverride ?? 'div') as 'div';\n\n return (\n <Tag\n ref={containerRef}\n className={clsx(\n styles['css-grid'],\n styles[`grid-variant-${variant}`],\n shouldDisableGutters && [styles['grid-no-gutters']]\n )}\n style={{ gridTemplateColumns: `repeat(${columnCount}, minmax(0, 1fr))` }}\n >\n {flattenedChildren.map((child, i) => {\n // If this react child is a primitive value, the key will be undefined\n const key = child && typeof child === 'object' ? (child as Record<'key', unknown>).key : undefined;\n\n return (\n <div\n key={key ? String(key) : undefined}\n className={clsx(styles.item, {\n [styles['first-column']]: i % columnCount === 0,\n })}\n >\n {child}\n </div>\n );\n })}\n </Tag>\n );\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import flattenChildren from 'react-keyed-flatten-children';
|
|
5
4
|
import clsx from 'clsx';
|
|
6
5
|
import InternalGrid from '../grid/internal';
|
|
7
6
|
import { useContainerBreakpoints } from '../internal/hooks/container-queries';
|
|
7
|
+
import { flattenChildren } from '../internal/utils/flatten-children';
|
|
8
8
|
import { COLUMN_TRIGGERS } from './internal';
|
|
9
9
|
import { repeat } from './util';
|
|
10
10
|
import styles from './styles.css.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-column-layout.js","sourceRoot":"","sources":["../../../src/column-layout/grid-column-layout.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,
|
|
1
|
+
{"version":3,"file":"grid-column-layout.js","sourceRoot":"","sources":["../../../src/column-layout/grid-column-layout.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,eAAe,EAA0B,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,WAAW,GAA4D;IAC3E,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAChD,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE;IAC9C,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE;IAC9C,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC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UAAU,IAAI,MAAM,CAAC,mBAAmB,UAAU,EAAE,CAAC,EAC1F,aAAa,EAAE,aAAa,IAE3B,QAAQ,CACI,CAChB,CAAC;AACJ,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 { GridProps } from '../grid/interfaces';\nimport InternalGrid from '../grid/internal';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { flattenChildren } from '../internal/utils/flatten-children';\nimport { InternalColumnLayoutProps } from './interfaces';\nimport { COLUMN_TRIGGERS, ColumnLayoutBreakpoint } from './internal';\nimport { repeat } from './util';\n\nimport styles from './styles.css.js';\n\nconst COLUMN_DEFS: Record<number, GridProps.ElementDefinition | undefined> = {\n 1: { colspan: { default: 12, xxs: 12, xs: 12 } },\n 2: { colspan: { default: 12, xxs: 6, xs: 6 } },\n 3: { colspan: { default: 12, xxs: 6, xs: 4 } },\n 4: { colspan: { default: 12, xxs: 6, xs: 3 } },\n};\n\ninterface GridColumnLayoutProps\n extends Required<Pick<InternalColumnLayoutProps, 'columns' | 'variant' | 'borders' | 'disableGutters'>>,\n Pick<InternalColumnLayoutProps, '__tagOverride'> {\n children: React.ReactNode;\n __breakpoint?: ColumnLayoutBreakpoint;\n}\n\nexport default function GridColumnLayout({\n columns,\n variant,\n borders,\n disableGutters,\n __breakpoint,\n children,\n __tagOverride,\n}: GridColumnLayoutProps) {\n const isTextGridVariant = variant === 'text-grid';\n const shouldDisableGutters = !isTextGridVariant && disableGutters;\n const shouldHaveHorizontalBorders = !isTextGridVariant && (borders === 'horizontal' || borders === 'all');\n const shouldHaveVerticalBorders = !isTextGridVariant && (borders === 'vertical' || borders === 'all');\n\n // Flattening the children allows us to \"see through\" React Fragments and nested arrays.\n const flattenedChildren = flattenChildren(children);\n\n const [breakpoint, ref] = useContainerBreakpoints(COLUMN_TRIGGERS);\n\n return (\n <InternalGrid\n ref={ref}\n disableGutters={true}\n gridDefinition={repeat(COLUMN_DEFS[columns] ?? {}, flattenedChildren.length)}\n className={clsx(styles.grid, styles[`grid-columns-${columns}`], styles[`grid-variant-${variant}`], {\n [styles['grid-horizontal-borders']]: shouldHaveHorizontalBorders,\n [styles['grid-vertical-borders']]: shouldHaveVerticalBorders,\n [styles['grid-no-gutters']]: shouldDisableGutters,\n })}\n __breakpoint={__breakpoint || breakpoint}\n __responsiveClassName={breakpoint => breakpoint && styles[`grid-breakpoint-${breakpoint}`]}\n __tagOverride={__tagOverride}\n >\n {children}\n </InternalGrid>\n );\n}\n"]}
|
|
@@ -69,6 +69,8 @@ export interface ContainerProps extends BaseComponentProps {
|
|
|
69
69
|
*/
|
|
70
70
|
variant?: 'default' | 'stacked';
|
|
71
71
|
/**
|
|
72
|
+
* An object containing CSS properties to customize the container's visual appearance.
|
|
73
|
+
* Refer to the [style](/components/container/?tabId=style) tab for more details.
|
|
72
74
|
* @awsuiSystem core
|
|
73
75
|
*/
|
|
74
76
|
style?: ContainerProps.Style;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/container/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC;IAErD;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,sBAA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C,EAAE,MAAM,CAAC;KAC7B;IACD,UAAiB,KAAK;QACpB;;WAEG;QACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;QAEzB;;WAEG;QACH,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QAE1B;;;;;;WAMG;QACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAExB;;;;;;WAMG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC1B;IAED,UAAiB,KAAK;QACpB,IAAI,CAAC,EAAE;YACL,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,SAAS,CAAC,EAAE,MAAM,CAAC;SACpB,CAAC;QACF,OAAO,CAAC,EAAE;YACR,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,MAAM,CAAC,EAAE;YACP,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,aAAa,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,MAAM,CAAC,EAAE;YACP,IAAI,EAAE;gBACJ,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,aAAa,CAAC,EAAE,MAAM,CAAC;aACxB,CAAC;YACF,OAAO,EAAE;gBACP,WAAW,CAAC,EAAE,MAAM,CAAC;gBACrB,WAAW,CAAC,EAAE,MAAM,CAAC;aACtB,CAAC;SACH,CAAC;KACH;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/container/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 ContainerProps extends BaseComponentProps {\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * @analytics\n */\n analyticsMetadata?: ContainerProps.AnalyticsMetadata;\n\n /**\n * Heading element of the container. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Determines whether the container header has padding. If `true`, removes the default padding from the header.\n */\n disableHeaderPaddings?: boolean;\n\n /**\n *\n * Use this slot to render a media element. Supported element types are 'img', 'video', and 'picture'.\n * You can define different positions and sizes for the media element within the container.\n *\n * * `content` - Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.\n *\n * * `position` - Defines the media slot's position within the container. Defaults to `top`.\n *\n * * `width` - Defines the width of the media slot when positioned on the side. Corresponds to the `width` CSS-property.\n * When this value is set, media elements larger than the defined width may be cropped, with 'object-fit: cover' centering it.\n * Note: This value is considered only when `position` is set to `side`.\n * If no width is provided, the media slot will take a maximum of 66% of the container's width.\n *\n * * `height` - Defines the height of the media slot when position on the top. Corresponds to the `height` CSS-property.\n * When this value is set, media elements larger than the defined width may be cropped, with 'object-fit: cover' centering it. * Note: This value is only considered if `position` is set to `top`.\n * If no height is provided, the media slot will be displayed at its full height.\n *\n */\n media?: ContainerProps.Media;\n\n /**\n * Main content of the container.\n */\n children?: React.ReactNode;\n\n /**\n * Determines whether the container content has padding. If `true`, removes the default padding from the content area.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Enabling this property will make the container to fit into available height. If content is too short, the container\n * will stretch, if too long, the container will shrink and show vertical scrollbar.\n *\n * Use this property to align heights of multiple containers displayed in a single row. It is recommended to stretch\n * all containers to the height of the longest one, to avoid extra vertical scroll areas.\n */\n fitHeight?: boolean;\n\n /**\n * Footer of the container.\n */\n footer?: React.ReactNode;\n\n /**\n * Determines whether the container footer has padding. If `true`, removes the default padding from the footer.\n * @awsuiSystem core\n */\n disableFooterPaddings?: boolean;\n\n /**\n * Specify a container variant with one of the following:\n * * `default` - Use this variant in standalone context.\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * @visualrefresh `stacked` variant\n */\n variant?: 'default' | 'stacked';\n\n /**\n * @awsuiSystem core\n */\n style?: ContainerProps.Style;\n}\n\nexport namespace ContainerProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n }\n export interface Media {\n /**\n * Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.\n */\n content: React.ReactNode;\n\n /**\n * Defines the media slot's position within the container. Defaults to `top`.\n */\n position?: 'top' | 'side';\n\n /**\n * Defines the width of the media slot when positioned on the side. Corresponds to the `width` CSS-property.\n * When this value is set, the media element may be cropped, with `object-fit: cover` centering it.\n *\n * Note: This value is considered only when `position` is set to `side`.\n * If no width is provided, the media slot will take a maximum of 66% of the container's width.\n */\n width?: string | number;\n\n /**\n * Defines the height of the media slot when position on the top. Corresponds to the `height` CSS-property.\n * When this value is set, the media element may be cropped, with `object-fit: cover` centering it.\n *\n * Note: This value is only considered if `position` is set to `top`.\n * If no height is provided, the media slot will be displayed at its full height.\n */\n height?: string | number;\n }\n\n export interface Style {\n root?: {\n background?: string;\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: string;\n };\n content?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n header?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n footer?: {\n root: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n divider: {\n borderColor?: string;\n borderWidth?: string;\n };\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/container/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 ContainerProps extends BaseComponentProps {\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * @analytics\n */\n analyticsMetadata?: ContainerProps.AnalyticsMetadata;\n\n /**\n * Heading element of the container. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Determines whether the container header has padding. If `true`, removes the default padding from the header.\n */\n disableHeaderPaddings?: boolean;\n\n /**\n *\n * Use this slot to render a media element. Supported element types are 'img', 'video', and 'picture'.\n * You can define different positions and sizes for the media element within the container.\n *\n * * `content` - Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.\n *\n * * `position` - Defines the media slot's position within the container. Defaults to `top`.\n *\n * * `width` - Defines the width of the media slot when positioned on the side. Corresponds to the `width` CSS-property.\n * When this value is set, media elements larger than the defined width may be cropped, with 'object-fit: cover' centering it.\n * Note: This value is considered only when `position` is set to `side`.\n * If no width is provided, the media slot will take a maximum of 66% of the container's width.\n *\n * * `height` - Defines the height of the media slot when position on the top. Corresponds to the `height` CSS-property.\n * When this value is set, media elements larger than the defined width may be cropped, with 'object-fit: cover' centering it. * Note: This value is only considered if `position` is set to `top`.\n * If no height is provided, the media slot will be displayed at its full height.\n *\n */\n media?: ContainerProps.Media;\n\n /**\n * Main content of the container.\n */\n children?: React.ReactNode;\n\n /**\n * Determines whether the container content has padding. If `true`, removes the default padding from the content area.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Enabling this property will make the container to fit into available height. If content is too short, the container\n * will stretch, if too long, the container will shrink and show vertical scrollbar.\n *\n * Use this property to align heights of multiple containers displayed in a single row. It is recommended to stretch\n * all containers to the height of the longest one, to avoid extra vertical scroll areas.\n */\n fitHeight?: boolean;\n\n /**\n * Footer of the container.\n */\n footer?: React.ReactNode;\n\n /**\n * Determines whether the container footer has padding. If `true`, removes the default padding from the footer.\n * @awsuiSystem core\n */\n disableFooterPaddings?: boolean;\n\n /**\n * Specify a container variant with one of the following:\n * * `default` - Use this variant in standalone context.\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * @visualrefresh `stacked` variant\n */\n variant?: 'default' | 'stacked';\n\n /**\n * An object containing CSS properties to customize the container's visual appearance.\n * Refer to the [style](/components/container/?tabId=style) tab for more details.\n * @awsuiSystem core\n */\n style?: ContainerProps.Style;\n}\n\nexport namespace ContainerProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n }\n export interface Media {\n /**\n * Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.\n */\n content: React.ReactNode;\n\n /**\n * Defines the media slot's position within the container. Defaults to `top`.\n */\n position?: 'top' | 'side';\n\n /**\n * Defines the width of the media slot when positioned on the side. Corresponds to the `width` CSS-property.\n * When this value is set, the media element may be cropped, with `object-fit: cover` centering it.\n *\n * Note: This value is considered only when `position` is set to `side`.\n * If no width is provided, the media slot will take a maximum of 66% of the container's width.\n */\n width?: string | number;\n\n /**\n * Defines the height of the media slot when position on the top. Corresponds to the `height` CSS-property.\n * When this value is set, the media element may be cropped, with `object-fit: cover` centering it.\n *\n * Note: This value is only considered if `position` is set to `top`.\n * If no height is provided, the media slot will be displayed at its full height.\n */\n height?: string | number;\n }\n\n export interface Style {\n root?: {\n background?: string;\n borderColor?: string;\n borderRadius?: string;\n borderWidth?: string;\n boxShadow?: string;\n };\n content?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n header?: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n footer?: {\n root: {\n paddingBlock?: string;\n paddingInline?: string;\n };\n divider: {\n borderColor?: string;\n borderWidth?: string;\n };\n };\n }\n}\n"]}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"layout": "
|
|
5
|
-
"background": "
|
|
6
|
-
"is-overlap-disabled": "awsui_is-overlap-
|
|
7
|
-
"header-background": "awsui_header-
|
|
8
|
-
"notifications": "
|
|
9
|
-
"breadcrumbs": "
|
|
10
|
-
"default-padding": "awsui_default-
|
|
11
|
-
"header-wrapper": "awsui_header-
|
|
12
|
-
"with-divider": "awsui_with-
|
|
13
|
-
"content": "
|
|
14
|
-
"has-header": "awsui_has-
|
|
15
|
-
"is-visual-refresh": "awsui_is-visual-
|
|
16
|
-
"has-default-background": "awsui_has-default-
|
|
17
|
-
"has-notifications": "awsui_has-
|
|
4
|
+
"layout": "awsui_layout_5gtk3_zgbcy_145",
|
|
5
|
+
"background": "awsui_background_5gtk3_zgbcy_159",
|
|
6
|
+
"is-overlap-disabled": "awsui_is-overlap-disabled_5gtk3_zgbcy_164",
|
|
7
|
+
"header-background": "awsui_header-background_5gtk3_zgbcy_167",
|
|
8
|
+
"notifications": "awsui_notifications_5gtk3_zgbcy_171",
|
|
9
|
+
"breadcrumbs": "awsui_breadcrumbs_5gtk3_zgbcy_176",
|
|
10
|
+
"default-padding": "awsui_default-padding_5gtk3_zgbcy_181",
|
|
11
|
+
"header-wrapper": "awsui_header-wrapper_5gtk3_zgbcy_185",
|
|
12
|
+
"with-divider": "awsui_with-divider_5gtk3_zgbcy_190",
|
|
13
|
+
"content": "awsui_content_5gtk3_zgbcy_193",
|
|
14
|
+
"has-header": "awsui_has-header_5gtk3_zgbcy_197",
|
|
15
|
+
"is-visual-refresh": "awsui_is-visual-refresh_5gtk3_zgbcy_204",
|
|
16
|
+
"has-default-background": "awsui_has-default-background_5gtk3_zgbcy_204",
|
|
17
|
+
"has-notifications": "awsui_has-notifications_5gtk3_zgbcy_208"
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -142,72 +142,72 @@
|
|
|
142
142
|
*/
|
|
143
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.
|
|
146
|
-
--awsui-content-layout-default-horizontal-padding-
|
|
147
|
-
--awsui-content-layout-max-content-width-
|
|
148
|
-
--awsui-content-layout-main-gap-
|
|
145
|
+
.awsui_layout_5gtk3_zgbcy_145:not(#\9) {
|
|
146
|
+
--awsui-content-layout-default-horizontal-padding-c5ek4l: var(--space-layout-content-horizontal-q3zhej, 40px);
|
|
147
|
+
--awsui-content-layout-max-content-width-c5ek4l: 0px;
|
|
148
|
+
--awsui-content-layout-main-gap-c5ek4l: 0px;
|
|
149
149
|
display: grid;
|
|
150
|
-
grid-template-columns: 0 0 1fr minmax(0, var(--awsui-content-layout-max-content-width-
|
|
151
|
-
grid-template-rows: var(--awsui-content-layout-main-gap-
|
|
150
|
+
grid-template-columns: 0 0 1fr minmax(0, var(--awsui-content-layout-max-content-width-c5ek4l)) 1fr 0 0;
|
|
151
|
+
grid-template-rows: var(--awsui-content-layout-main-gap-c5ek4l) min-content min-content auto var(--space-dark-header-overlap-distance-45h6a9, 0px) 1fr;
|
|
152
152
|
min-block-size: 100%;
|
|
153
153
|
}
|
|
154
154
|
@media (max-width: 688px) {
|
|
155
|
-
.
|
|
156
|
-
--awsui-content-layout-default-horizontal-padding-
|
|
155
|
+
.awsui_layout_5gtk3_zgbcy_145:not(#\9) {
|
|
156
|
+
--awsui-content-layout-default-horizontal-padding-c5ek4l: var(--space-l-3cws6j, 20px);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
.
|
|
159
|
+
.awsui_layout_5gtk3_zgbcy_145 > .awsui_background_5gtk3_zgbcy_159:not(#\9) {
|
|
160
160
|
grid-column: 1/8;
|
|
161
161
|
grid-row: 1/6;
|
|
162
162
|
color: var(--color-text-body-default-5qid0u, #16191f);
|
|
163
163
|
}
|
|
164
|
-
.
|
|
164
|
+
.awsui_layout_5gtk3_zgbcy_145 > .awsui_background_5gtk3_zgbcy_159.awsui_is-overlap-disabled_5gtk3_zgbcy_164:not(#\9) {
|
|
165
165
|
grid-row: 1/5;
|
|
166
166
|
}
|
|
167
|
-
.
|
|
167
|
+
.awsui_layout_5gtk3_zgbcy_145 > .awsui_background_5gtk3_zgbcy_159 > .awsui_header-background_5gtk3_zgbcy_167:not(#\9) {
|
|
168
168
|
inline-size: 100%;
|
|
169
169
|
block-size: 100%;
|
|
170
170
|
}
|
|
171
|
-
.
|
|
171
|
+
.awsui_layout_5gtk3_zgbcy_145 > .awsui_notifications_5gtk3_zgbcy_171:not(#\9) {
|
|
172
172
|
grid-column: 4;
|
|
173
173
|
grid-row: 2;
|
|
174
174
|
padding-block-end: var(--space-xs-kw7k3v, 8px);
|
|
175
175
|
}
|
|
176
|
-
.
|
|
176
|
+
.awsui_layout_5gtk3_zgbcy_145 > .awsui_breadcrumbs_5gtk3_zgbcy_176:not(#\9) {
|
|
177
177
|
grid-column: 4;
|
|
178
178
|
grid-row: 3;
|
|
179
179
|
padding-block-end: var(--space-xs-kw7k3v, 8px);
|
|
180
180
|
}
|
|
181
|
-
.
|
|
182
|
-
--awsui-content-layout-main-gap-
|
|
183
|
-
grid-template-columns: var(--awsui-toggles-left-width-
|
|
181
|
+
.awsui_layout_5gtk3_zgbcy_145.awsui_default-padding_5gtk3_zgbcy_181:not(#\9) {
|
|
182
|
+
--awsui-content-layout-main-gap-c5ek4l: var(--space-scaled-m-sw9kcx, 16px);
|
|
183
|
+
grid-template-columns: var(--awsui-toggles-left-width-c5ek4l, 0) var(--awsui-content-layout-default-horizontal-padding-c5ek4l, 0) 1fr minmax(0, var(--awsui-content-layout-max-content-width-c5ek4l)) 1fr var(--awsui-content-layout-default-horizontal-padding-c5ek4l, 0) var(--awsui-toggles-right-width-c5ek4l, 0);
|
|
184
184
|
}
|
|
185
|
-
.
|
|
185
|
+
.awsui_layout_5gtk3_zgbcy_145 > .awsui_header-wrapper_5gtk3_zgbcy_185:not(#\9) {
|
|
186
186
|
grid-column: 4;
|
|
187
187
|
grid-row: 4;
|
|
188
188
|
padding-block-end: var(--space-content-header-padding-bottom-hjkugf, 16px);
|
|
189
189
|
}
|
|
190
|
-
.
|
|
190
|
+
.awsui_layout_5gtk3_zgbcy_145 > .awsui_header-wrapper_5gtk3_zgbcy_185.awsui_with-divider_5gtk3_zgbcy_190:not(#\9) {
|
|
191
191
|
border-block-end: 1px solid var(--color-border-divider-default-ipvpev, #eaeded);
|
|
192
192
|
}
|
|
193
|
-
.
|
|
193
|
+
.awsui_layout_5gtk3_zgbcy_145 > .awsui_content_5gtk3_zgbcy_193:not(#\9) {
|
|
194
194
|
grid-column: 4;
|
|
195
195
|
grid-row: 5/8;
|
|
196
196
|
}
|
|
197
|
-
.
|
|
198
|
-
grid-template-rows: var(--awsui-content-layout-main-gap-
|
|
197
|
+
.awsui_layout_5gtk3_zgbcy_145:not(#\9):not(.awsui_has-header_5gtk3_zgbcy_197) {
|
|
198
|
+
grid-template-rows: var(--awsui-content-layout-main-gap-c5ek4l) min-content min-content 0 calc(var(--space-dark-header-overlap-distance-45h6a9, 0px)) 1fr;
|
|
199
199
|
}
|
|
200
|
-
.
|
|
201
|
-
grid-template-rows: var(--awsui-content-layout-main-gap-
|
|
200
|
+
.awsui_layout_5gtk3_zgbcy_145.awsui_is-overlap-disabled_5gtk3_zgbcy_164:not(#\9) {
|
|
201
|
+
grid-template-rows: var(--awsui-content-layout-main-gap-c5ek4l) min-content min-content auto 0 1fr;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
.
|
|
204
|
+
.awsui_layout_5gtk3_zgbcy_145.awsui_is-visual-refresh_5gtk3_zgbcy_204 > .awsui_background_5gtk3_zgbcy_159.awsui_has-default-background_5gtk3_zgbcy_204:not(#\9) {
|
|
205
205
|
background-color: var(--color-background-layout-main-05m5y6, #f2f3f3);
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
.
|
|
209
|
-
--awsui-content-layout-main-gap-
|
|
208
|
+
.awsui_layout_5gtk3_zgbcy_145:not(#\9):not(.awsui_is-visual-refresh_5gtk3_zgbcy_204).awsui_has-notifications_5gtk3_zgbcy_208 {
|
|
209
|
+
--awsui-content-layout-main-gap-c5ek4l: 0px;
|
|
210
210
|
}
|
|
211
|
-
.
|
|
211
|
+
.awsui_layout_5gtk3_zgbcy_145:not(#\9):not(.awsui_is-visual-refresh_5gtk3_zgbcy_204) > .awsui_notifications_5gtk3_zgbcy_171 {
|
|
212
212
|
grid-column: 1/8;
|
|
213
213
|
}
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"layout": "
|
|
6
|
-
"background": "
|
|
7
|
-
"is-overlap-disabled": "awsui_is-overlap-
|
|
8
|
-
"header-background": "awsui_header-
|
|
9
|
-
"notifications": "
|
|
10
|
-
"breadcrumbs": "
|
|
11
|
-
"default-padding": "awsui_default-
|
|
12
|
-
"header-wrapper": "awsui_header-
|
|
13
|
-
"with-divider": "awsui_with-
|
|
14
|
-
"content": "
|
|
15
|
-
"has-header": "awsui_has-
|
|
16
|
-
"is-visual-refresh": "awsui_is-visual-
|
|
17
|
-
"has-default-background": "awsui_has-default-
|
|
18
|
-
"has-notifications": "awsui_has-
|
|
5
|
+
"layout": "awsui_layout_5gtk3_zgbcy_145",
|
|
6
|
+
"background": "awsui_background_5gtk3_zgbcy_159",
|
|
7
|
+
"is-overlap-disabled": "awsui_is-overlap-disabled_5gtk3_zgbcy_164",
|
|
8
|
+
"header-background": "awsui_header-background_5gtk3_zgbcy_167",
|
|
9
|
+
"notifications": "awsui_notifications_5gtk3_zgbcy_171",
|
|
10
|
+
"breadcrumbs": "awsui_breadcrumbs_5gtk3_zgbcy_176",
|
|
11
|
+
"default-padding": "awsui_default-padding_5gtk3_zgbcy_181",
|
|
12
|
+
"header-wrapper": "awsui_header-wrapper_5gtk3_zgbcy_185",
|
|
13
|
+
"with-divider": "awsui_with-divider_5gtk3_zgbcy_190",
|
|
14
|
+
"content": "awsui_content_5gtk3_zgbcy_193",
|
|
15
|
+
"has-header": "awsui_has-header_5gtk3_zgbcy_197",
|
|
16
|
+
"is-visual-refresh": "awsui_is-visual-refresh_5gtk3_zgbcy_204",
|
|
17
|
+
"has-default-background": "awsui_has-default-background_5gtk3_zgbcy_204",
|
|
18
|
+
"has-notifications": "awsui_has-notifications_5gtk3_zgbcy_208"
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6C,MAAM,OAAO,CAAC;AA0BlE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6C,MAAM,OAAO,CAAC;AA0BlE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FAuMf,CAAC;AAGF,eAAe,UAAU,CAAC"}
|
|
@@ -82,7 +82,7 @@ const DatePicker = React.forwardRef(({ locale, startOfWeek, isDateEnabled, dateD
|
|
|
82
82
|
React.createElement("div", null,
|
|
83
83
|
React.createElement(InternalButton, { iconName: "calendar", className: styles['open-calendar-button'], onClick: onButtonClickHandler, ref: buttonRef, ariaLabel: buttonAriaLabel, disabled: disabled || readOnly, formAction: "none" }))));
|
|
84
84
|
baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);
|
|
85
|
-
return (React.createElement("div", { ...baseProps, ref: mergedRef, onKeyDown: !disabled && !readOnly ? onWrapperKeyDownHandler : undefined }, disabled || readOnly ? (trigger) : (React.createElement(Dropdown, {
|
|
85
|
+
return (React.createElement("div", { ...baseProps, ref: mergedRef, onKeyDown: !disabled && !readOnly ? onWrapperKeyDownHandler : undefined }, disabled || readOnly ? (trigger) : (React.createElement(Dropdown, { minWidth: "trigger", maxWidth: "trigger", stretchHeight: true, open: isDropDownOpen, onDropdownClose: onDropdownCloseHandler, trigger: trigger, expandToViewport: expandToViewport, scrollable: false, dropdownId: dropdownId, content: isDropDownOpen ? (React.createElement(FocusLock, { className: styles['focus-lock'], autoFocus: true },
|
|
86
86
|
React.createElement("div", { tabIndex: 0, className: styles.calendar, role: "dialog" },
|
|
87
87
|
React.createElement(InternalCalendar, { value: value, onChange: e => {
|
|
88
88
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAG1F,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAA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,uBAAX,WAAW,CAAE,sBAAsB,mCAAI,sBAAsB;qBACtF,GACD;gBACF,oBAAC,kBAAkB,IAAC,EAAE,EAAE,qBAAqB,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAC,MAAM,IACxE,gBAAgB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC,CACzD,CACjB,CACI,CACb,CAAC,CAAC,CAAC,SAAS,GAEf,CACH,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAC3C,eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React, { Ref, useCallback, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalCalendar from '../calendar/internal';\nimport { useFormFieldContext } from '../contexts/form-field.js';\nimport InternalDateInput from '../date-input/internal';\nimport { useInternalI18n } from '../i18n/context.js';\nimport { useLocale } from '../i18n/context.js';\nimport { InputProps } from '../input/interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport Dropdown from '../internal/components/dropdown';\nimport FocusLock from '../internal/components/focus-lock';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker.js';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name.js';\nimport { parseDate } from '../internal/utils/date-time';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport InternalLiveRegion from '../live-region/internal';\nimport { DatePickerProps } from './interfaces';\nimport { getBaseDateLabel, getSelectedDateLabel, isValidFullDate } from './utils';\n\nimport styles from './styles.css.js';\n\nexport { DatePickerProps };\n\nconst DatePicker = React.forwardRef(\n (\n {\n locale,\n startOfWeek,\n isDateEnabled,\n dateDisabledReason,\n nextMonthAriaLabel,\n previousMonthAriaLabel,\n todayAriaLabel,\n i18nStrings,\n placeholder = '',\n value = '',\n readOnly = false,\n disabled = false,\n onBlur,\n autoFocus = false,\n onChange,\n onFocus,\n name,\n ariaLabel,\n ariaRequired,\n controlId,\n invalid,\n warning,\n openCalendarAriaLabel,\n expandToViewport,\n granularity = 'day',\n format = 'slashed',\n inputFormat = 'slashed',\n ...restProps\n }: DatePickerProps,\n ref: Ref<DatePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DatePicker', {\n props: { autoFocus, expandToViewport, granularity, readOnly },\n metadata: { hasDisabledReasons: Boolean(dateDisabledReason) },\n });\n checkControlled('DatePicker', 'value', value, 'onChange', onChange);\n\n const i18n = useInternalI18n('date-picker');\n const contextLocale = useLocale();\n const normalizedLocale = normalizeLocale('DatePicker', locale || contextLocale);\n\n const baseProps = getBaseProps(restProps);\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(restProps);\n\n const internalInputRef = useRef<HTMLInputElement>(null);\n const buttonRef = useRef<ButtonProps.Ref>(null);\n useForwardFocus(ref, internalInputRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('calender');\n const calendarDescriptionId = useUniqueId('calendar-description-');\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n useFocusTracker({ rootRef, onBlur, onFocus });\n\n const onDropdownCloseHandler = useCallback(() => setIsDropDownOpen(false), [setIsDropDownOpen]);\n\n const onButtonClickHandler = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(true);\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape && isDropDownOpen) {\n event.stopPropagation();\n buttonRef.current?.focus();\n setIsDropDownOpen(false);\n }\n };\n\n const onInputChangeHandler: InputProps['onChange'] = event => {\n fireNonCancelableEvent(onChange, { value: event.detail.value });\n };\n\n const onInputBlurHandler: InputProps['onBlur'] = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(false);\n }\n };\n\n // Set displayed date to value if defined or to current date otherwise.\n const parsedValue = value && value.length >= 4 ? parseDate(value) : null;\n const baseDate = parsedValue || new Date();\n\n const hasFullValue = isValidFullDate({ date: value, granularity });\n\n const defaultOpenCalendarAriaLabel = i18n(\n 'i18nStrings.openCalendarAriaLabel',\n i18nStrings?.openCalendarAriaLabel ?? openCalendarAriaLabel,\n format => (selectedDate: string | null) => format({ selectedDate: selectedDate ?? 'none' })\n );\n\n const buttonAriaLabel = defaultOpenCalendarAriaLabel?.(\n hasFullValue && parsedValue\n ? getSelectedDateLabel({ date: parsedValue, granularity, locale: normalizedLocale })\n : null\n );\n\n const trigger = (\n <div className={styles['date-picker-trigger']}>\n <div className={styles['date-picker-input']}>\n <InternalDateInput\n name={name}\n invalid={invalid}\n warning={warning}\n controlId={controlId}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n onChange={onInputChangeHandler}\n onBlur={onInputBlurHandler}\n placeholder={placeholder}\n ref={internalInputRef}\n autoFocus={autoFocus}\n onFocus={onDropdownCloseHandler}\n granularity={granularity}\n locale={locale}\n format={format}\n inputFormat={inputFormat}\n />\n </div>\n <div>\n <InternalButton\n iconName=\"calendar\"\n className={styles['open-calendar-button']}\n onClick={onButtonClickHandler}\n ref={buttonRef}\n ariaLabel={buttonAriaLabel}\n disabled={disabled || readOnly}\n formAction=\"none\"\n />\n </div>\n </div>\n );\n\n baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);\n\n return (\n <div {...baseProps} ref={mergedRef} onKeyDown={!disabled && !readOnly ? onWrapperKeyDownHandler : undefined}>\n {disabled || readOnly ? (\n trigger\n ) : (\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={onDropdownCloseHandler}\n trigger={trigger}\n expandToViewport={expandToViewport}\n scrollable={false}\n dropdownId={dropdownId}\n content={\n isDropDownOpen ? (\n <FocusLock className={styles['focus-lock']} autoFocus={true}>\n <div tabIndex={0} className={styles.calendar} role=\"dialog\">\n <InternalCalendar\n value={value}\n onChange={e => {\n fireNonCancelableEvent(onChange, e.detail);\n buttonRef?.current?.focus();\n setIsDropDownOpen(false);\n }}\n locale={normalizedLocale}\n startOfWeek={startOfWeek}\n ariaDescribedby={calendarDescriptionId}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n granularity={granularity}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n i18nStrings={{\n ...i18nStrings,\n todayAriaLabel: i18nStrings?.todayAriaLabel ?? todayAriaLabel,\n nextMonthAriaLabel: i18nStrings?.nextMonthAriaLabel ?? nextMonthAriaLabel,\n previousMonthAriaLabel: i18nStrings?.previousMonthAriaLabel ?? previousMonthAriaLabel,\n }}\n />\n <InternalLiveRegion id={calendarDescriptionId} hidden={true} tagName=\"span\">\n {getBaseDateLabel({ date: baseDate, granularity, locale: normalizedLocale })}\n </InternalLiveRegion>\n </div>\n </FocusLock>\n ) : undefined\n }\n />\n )}\n </div>\n );\n }\n);\n\napplyDisplayName(DatePicker, 'DatePicker');\nexport default DatePicker;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,IAAI,MAA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CAAC,CAAC;AAC3C,eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React, { Ref, useCallback, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalCalendar from '../calendar/internal';\nimport { useFormFieldContext } from '../contexts/form-field.js';\nimport InternalDateInput from '../date-input/internal';\nimport { useInternalI18n } from '../i18n/context.js';\nimport { useLocale } from '../i18n/context.js';\nimport { InputProps } from '../input/interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport Dropdown from '../internal/components/dropdown';\nimport FocusLock from '../internal/components/focus-lock';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker.js';\nimport { KeyCode } from '../internal/keycode';\nimport { applyDisplayName } from '../internal/utils/apply-display-name.js';\nimport { parseDate } from '../internal/utils/date-time';\nimport { normalizeLocale } from '../internal/utils/locale';\nimport InternalLiveRegion from '../live-region/internal';\nimport { DatePickerProps } from './interfaces';\nimport { getBaseDateLabel, getSelectedDateLabel, isValidFullDate } from './utils';\n\nimport styles from './styles.css.js';\n\nexport { DatePickerProps };\n\nconst DatePicker = React.forwardRef(\n (\n {\n locale,\n startOfWeek,\n isDateEnabled,\n dateDisabledReason,\n nextMonthAriaLabel,\n previousMonthAriaLabel,\n todayAriaLabel,\n i18nStrings,\n placeholder = '',\n value = '',\n readOnly = false,\n disabled = false,\n onBlur,\n autoFocus = false,\n onChange,\n onFocus,\n name,\n ariaLabel,\n ariaRequired,\n controlId,\n invalid,\n warning,\n openCalendarAriaLabel,\n expandToViewport,\n granularity = 'day',\n format = 'slashed',\n inputFormat = 'slashed',\n ...restProps\n }: DatePickerProps,\n ref: Ref<DatePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DatePicker', {\n props: { autoFocus, expandToViewport, granularity, readOnly },\n metadata: { hasDisabledReasons: Boolean(dateDisabledReason) },\n });\n checkControlled('DatePicker', 'value', value, 'onChange', onChange);\n\n const i18n = useInternalI18n('date-picker');\n const contextLocale = useLocale();\n const normalizedLocale = normalizeLocale('DatePicker', locale || contextLocale);\n\n const baseProps = getBaseProps(restProps);\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(restProps);\n\n const internalInputRef = useRef<HTMLInputElement>(null);\n const buttonRef = useRef<ButtonProps.Ref>(null);\n useForwardFocus(ref, internalInputRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('calender');\n const calendarDescriptionId = useUniqueId('calendar-description-');\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n useFocusTracker({ rootRef, onBlur, onFocus });\n\n const onDropdownCloseHandler = useCallback(() => setIsDropDownOpen(false), [setIsDropDownOpen]);\n\n const onButtonClickHandler = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(true);\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape && isDropDownOpen) {\n event.stopPropagation();\n buttonRef.current?.focus();\n setIsDropDownOpen(false);\n }\n };\n\n const onInputChangeHandler: InputProps['onChange'] = event => {\n fireNonCancelableEvent(onChange, { value: event.detail.value });\n };\n\n const onInputBlurHandler: InputProps['onBlur'] = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(false);\n }\n };\n\n // Set displayed date to value if defined or to current date otherwise.\n const parsedValue = value && value.length >= 4 ? parseDate(value) : null;\n const baseDate = parsedValue || new Date();\n\n const hasFullValue = isValidFullDate({ date: value, granularity });\n\n const defaultOpenCalendarAriaLabel = i18n(\n 'i18nStrings.openCalendarAriaLabel',\n i18nStrings?.openCalendarAriaLabel ?? openCalendarAriaLabel,\n format => (selectedDate: string | null) => format({ selectedDate: selectedDate ?? 'none' })\n );\n\n const buttonAriaLabel = defaultOpenCalendarAriaLabel?.(\n hasFullValue && parsedValue\n ? getSelectedDateLabel({ date: parsedValue, granularity, locale: normalizedLocale })\n : null\n );\n\n const trigger = (\n <div className={styles['date-picker-trigger']}>\n <div className={styles['date-picker-input']}>\n <InternalDateInput\n name={name}\n invalid={invalid}\n warning={warning}\n controlId={controlId}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n onChange={onInputChangeHandler}\n onBlur={onInputBlurHandler}\n placeholder={placeholder}\n ref={internalInputRef}\n autoFocus={autoFocus}\n onFocus={onDropdownCloseHandler}\n granularity={granularity}\n locale={locale}\n format={format}\n inputFormat={inputFormat}\n />\n </div>\n <div>\n <InternalButton\n iconName=\"calendar\"\n className={styles['open-calendar-button']}\n onClick={onButtonClickHandler}\n ref={buttonRef}\n ariaLabel={buttonAriaLabel}\n disabled={disabled || readOnly}\n formAction=\"none\"\n />\n </div>\n </div>\n );\n\n baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);\n\n return (\n <div {...baseProps} ref={mergedRef} onKeyDown={!disabled && !readOnly ? onWrapperKeyDownHandler : undefined}>\n {disabled || readOnly ? (\n trigger\n ) : (\n <Dropdown\n minWidth=\"trigger\"\n maxWidth=\"trigger\"\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={onDropdownCloseHandler}\n trigger={trigger}\n expandToViewport={expandToViewport}\n scrollable={false}\n dropdownId={dropdownId}\n content={\n isDropDownOpen ? (\n <FocusLock className={styles['focus-lock']} autoFocus={true}>\n <div tabIndex={0} className={styles.calendar} role=\"dialog\">\n <InternalCalendar\n value={value}\n onChange={e => {\n fireNonCancelableEvent(onChange, e.detail);\n buttonRef?.current?.focus();\n setIsDropDownOpen(false);\n }}\n locale={normalizedLocale}\n startOfWeek={startOfWeek}\n ariaDescribedby={calendarDescriptionId}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n granularity={granularity}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n i18nStrings={{\n ...i18nStrings,\n todayAriaLabel: i18nStrings?.todayAriaLabel ?? todayAriaLabel,\n nextMonthAriaLabel: i18nStrings?.nextMonthAriaLabel ?? nextMonthAriaLabel,\n previousMonthAriaLabel: i18nStrings?.previousMonthAriaLabel ?? previousMonthAriaLabel,\n }}\n />\n <InternalLiveRegion id={calendarDescriptionId} hidden={true} tagName=\"span\">\n {getBaseDateLabel({ date: baseDate, granularity, locale: normalizedLocale })}\n </InternalLiveRegion>\n </div>\n </FocusLock>\n ) : undefined\n }\n />\n )}\n </div>\n );\n }\n);\n\napplyDisplayName(DatePicker, 'DatePicker');\nexport default DatePicker;\n"]}
|