@cloudscape-design/components 3.0.1071 → 3.0.1073
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/alert/interfaces.d.ts +0 -16
- package/alert/interfaces.d.ts.map +1 -1
- package/alert/interfaces.js.map +1 -1
- package/alert/styles.css.js +27 -27
- package/alert/styles.scoped.css +46 -46
- package/alert/styles.selectors.js +27 -27
- package/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +32 -32
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +7 -7
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/visual-refresh/styles.css.js +86 -86
- package/app-layout/visual-refresh/styles.scoped.css +258 -258
- package/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +17 -17
- package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +39 -39
- package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +17 -17
- package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
- package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
- package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
- package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +23 -23
- package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +46 -46
- package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +23 -23
- package/attribute-editor/styles.css.js +15 -15
- package/attribute-editor/styles.scoped.css +28 -28
- package/attribute-editor/styles.selectors.js +15 -15
- package/badge/interfaces.d.ts +0 -9
- package/badge/interfaces.d.ts.map +1 -1
- package/badge/interfaces.js.map +1 -1
- package/breadcrumb-group/item/styles.css.js +7 -7
- package/breadcrumb-group/item/styles.scoped.css +28 -28
- package/breadcrumb-group/item/styles.selectors.js +7 -7
- package/button/interfaces.d.ts +6 -12
- package/button/interfaces.d.ts.map +1 -1
- package/button/interfaces.js.map +1 -1
- package/button/style.d.ts.map +1 -1
- package/button/style.js +17 -12
- package/button/style.js.map +1 -1
- package/button/styles.css.js +22 -22
- package/button/styles.scoped.css +256 -212
- package/button/styles.selectors.js +22 -22
- package/button-dropdown/item-element/styles.css.js +16 -16
- package/button-dropdown/item-element/styles.scoped.css +27 -27
- package/button-dropdown/item-element/styles.selectors.js +16 -16
- package/button-group/index.d.ts.map +1 -1
- package/button-group/index.js +11 -44
- package/button-group/interfaces.d.ts +41 -1
- package/button-group/interfaces.d.ts.map +1 -1
- package/button-group/interfaces.js.map +1 -1
- package/button-group/internal-do-not-use-core.js +51 -0
- package/button-group/internal-do-not-use-core.js.map +1 -0
- package/button-group/internal.d.ts.map +1 -1
- package/button-group/internal.js +5 -3
- package/button-group/internal.js.map +1 -1
- package/button-group/item-element.d.ts +1 -0
- package/button-group/item-element.d.ts.map +1 -1
- package/button-group/item-element.js +4 -2
- package/button-group/item-element.js.map +1 -1
- package/button-group/style.d.ts +12 -0
- package/button-group/style.d.ts.map +1 -0
- package/button-group/style.js +37 -0
- package/button-group/style.js.map +1 -0
- package/checkbox/interfaces.d.ts +0 -1
- package/checkbox/interfaces.d.ts.map +1 -1
- package/checkbox/interfaces.js.map +1 -1
- package/checkbox/styles.css.js +3 -3
- package/checkbox/styles.scoped.css +11 -11
- package/checkbox/styles.selectors.js +3 -3
- package/container/interfaces.d.ts +0 -15
- package/container/interfaces.d.ts.map +1 -1
- package/container/interfaces.js.map +1 -1
- package/content-layout/styles.css.js +14 -14
- package/content-layout/styles.scoped.css +27 -27
- package/content-layout/styles.selectors.js +14 -14
- package/date-range-picker/time-offset.js +3 -3
- package/date-range-picker/time-offset.js.map +1 -1
- package/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/collapsible-flashbar.js +3 -5
- package/flashbar/collapsible-flashbar.js.map +1 -1
- package/flashbar/common.d.ts.map +1 -1
- package/flashbar/common.js +2 -5
- package/flashbar/common.js.map +1 -1
- package/flashbar/flash.d.ts +1 -1
- package/flashbar/flash.d.ts.map +1 -1
- package/flashbar/flash.js +4 -2
- package/flashbar/flash.js.map +1 -1
- package/flashbar/interfaces.d.ts +0 -24
- package/flashbar/interfaces.d.ts.map +1 -1
- package/flashbar/interfaces.js.map +1 -1
- package/flashbar/styles.css.js +50 -50
- package/flashbar/styles.scoped.css +187 -187
- package/flashbar/styles.selectors.js +50 -50
- package/flashbar/utils.d.ts +1 -1
- package/flashbar/utils.d.ts.map +1 -1
- package/flashbar/utils.js +1 -1
- package/flashbar/utils.js.map +1 -1
- package/help-panel/styles.css.js +6 -6
- package/help-panel/styles.scoped.css +73 -73
- package/help-panel/styles.selectors.js +6 -6
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/components/drag-handle-wrapper/styles.css.js +21 -21
- package/internal/components/drag-handle-wrapper/styles.scoped.css +44 -44
- package/internal/components/drag-handle-wrapper/styles.selectors.js +21 -21
- package/internal/components/dropdown/styles.css.js +20 -20
- package/internal/components/dropdown/styles.scoped.css +38 -38
- package/internal/components/dropdown/styles.selectors.js +20 -20
- package/internal/components/token-list/styles.css.js +10 -10
- package/internal/components/token-list/styles.scoped.css +25 -25
- package/internal/components/token-list/styles.selectors.js +10 -10
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/generated/custom-css-properties/index.d.ts +4 -0
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +83 -79
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/internal/utils/date-time/format-time-offset.d.ts +11 -0
- package/internal/utils/date-time/format-time-offset.d.ts.map +1 -1
- package/internal/utils/date-time/format-time-offset.js +17 -0
- package/internal/utils/date-time/format-time-offset.js.map +1 -1
- package/internal/utils/date-time/index.d.ts +1 -1
- package/internal/utils/date-time/index.d.ts.map +1 -1
- package/internal/utils/date-time/index.js +1 -1
- package/internal/utils/date-time/index.js.map +1 -1
- package/link/interfaces.d.ts +0 -6
- package/link/interfaces.d.ts.map +1 -1
- package/link/interfaces.js.map +1 -1
- package/link/styles.css.js +20 -20
- package/link/styles.scoped.css +103 -103
- package/link/styles.selectors.js +20 -20
- package/package.json +1 -1
- package/radio-group/interfaces.d.ts +0 -1
- package/radio-group/interfaces.d.ts.map +1 -1
- package/radio-group/interfaces.js.map +1 -1
- package/radio-group/styles.css.js +10 -10
- package/radio-group/styles.scoped.css +22 -22
- package/radio-group/styles.selectors.js +10 -10
- package/slider/styles.css.js +26 -26
- package/slider/styles.scoped.css +86 -86
- package/slider/styles.selectors.js +26 -26
- package/spinner/styles.css.js +13 -13
- package/spinner/styles.scoped.css +39 -39
- package/spinner/styles.selectors.js +13 -13
- package/tag-editor/styles.css.js +3 -3
- package/tag-editor/styles.scoped.css +13 -13
- package/tag-editor/styles.selectors.js +3 -3
- package/text-content/styles.css.js +1 -1
- package/text-content/styles.scoped.css +66 -66
- package/text-content/styles.selectors.js +1 -1
- package/toggle/interfaces.d.ts +0 -1
- package/toggle/interfaces.d.ts.map +1 -1
- package/toggle/interfaces.js.map +1 -1
- package/toggle/styles.css.js +10 -10
- package/toggle/styles.scoped.css +23 -23
- package/toggle/styles.selectors.js +10 -10
- package/button-group/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/button-group/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAGvF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,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C,CAAC,CAC9B,6BAAK,GAAG,EAAE,KAAK,EAAE,IAAI,EAAC,OAAO,gBAAa,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,KAAK,IAChF,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC,CAAC,CACzF,CACP,CAAC,CAAC,CAAC,CACF,WAAW,CAAC,WAAW,EAAE,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,CACzC,CACc,CAClB,CAAC;QACJ,CAAC,CAAC,CAC8B,CAC9B,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { getAllFocusables } from '../internal/components/focus-lock/utils';\nimport {\n SingleTabStopNavigationAPI,\n SingleTabStopNavigationProvider,\n} from '../internal/context/single-tab-stop-navigation-context';\nimport { hasModifierKeys } from '../internal/events';\nimport { KeyCode } from '../internal/keycode';\nimport { circleIndex } from '../internal/utils/circle-index';\nimport handleKey from '../internal/utils/handle-key';\nimport { ButtonGroupProps, InternalButtonGroupProps } from './interfaces';\nimport ItemElement from './item-element.js';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nconst InternalButtonGroup = forwardRef(\n (\n {\n items = [],\n onItemClick,\n onFilesChange,\n ariaLabel,\n dropdownExpandToViewport,\n __internalRootRef,\n ...props\n }: InternalButtonGroupProps,\n ref: React.Ref<ButtonGroupProps.Ref>\n ) => {\n const baseProps = getBaseProps(props);\n const focusedIdRef = useRef<null | string>(null);\n const navigationAPI = useRef<SingleTabStopNavigationAPI>(null);\n const containerObjectRef = useRef<HTMLDivElement>(null);\n const containerRef = useMergeRefs(containerObjectRef, __internalRootRef);\n const itemsRef = useRef<Record<string, ButtonProps.Ref | null>>({});\n const [tooltip, setTooltip] = useState<null | { item: string; feedback: boolean }>(null);\n\n useImperativeHandle(ref, () => ({\n focus: id => {\n itemsRef.current[id]?.focus();\n },\n }));\n\n function getNextFocusTarget(): null | HTMLElement {\n if (containerObjectRef.current) {\n const buttons: HTMLButtonElement[] = Array.from(\n containerObjectRef.current.querySelectorAll(`.${testUtilStyles.item}`)\n );\n const activeButtons = buttons.filter(button => !button.disabled);\n return activeButtons.find(button => button.dataset.itemid === focusedIdRef.current) ?? activeButtons[0] ?? null;\n }\n return null;\n }\n\n function onUnregisterActive(focusableElement: HTMLElement) {\n // Only refocus when the node is actually removed (no such ID anymore).\n const target = navigationAPI.current?.getFocusTarget();\n\n if (target && target.dataset.itemid !== focusableElement.dataset.itemid) {\n target.focus();\n }\n }\n\n useEffect(() => {\n navigationAPI.current?.updateFocusTarget();\n });\n\n function onFocus(event: React.FocusEvent) {\n if (event.target instanceof HTMLElement && event.target.dataset.itemid) {\n focusedIdRef.current = event.target.dataset.itemid;\n }\n\n navigationAPI.current?.updateFocusTarget();\n }\n\n function onBlur() {\n navigationAPI.current?.updateFocusTarget();\n }\n\n function onKeyDown(event: React.KeyboardEvent) {\n const focusTarget = navigationAPI.current?.getFocusTarget();\n const specialKeys = [KeyCode.right, KeyCode.left, KeyCode.end, KeyCode.home, KeyCode.pageUp, KeyCode.pageDown];\n if (hasModifierKeys(event) || specialKeys.indexOf(event.keyCode) === -1) {\n return;\n }\n if (!containerObjectRef.current || !focusTarget) {\n return;\n }\n // Ignore navigation when the focused element is not an item.\n if (document.activeElement && !document.activeElement.matches(`.${testUtilStyles.item}`)) {\n return;\n }\n event.preventDefault();\n\n const focusables = getFocusablesFrom(containerObjectRef.current);\n const activeIndex = focusables.indexOf(focusTarget);\n handleKey(event as any, {\n onHome: () => focusElement(focusables[0]),\n onEnd: () => focusElement(focusables[focusables.length - 1]),\n onInlineStart: () => focusElement(focusables[circleIndex(activeIndex - 1, [0, focusables.length - 1])]),\n onInlineEnd: () => focusElement(focusables[circleIndex(activeIndex + 1, [0, focusables.length - 1])]),\n });\n }\n\n function focusElement(element: HTMLElement) {\n element.focus();\n }\n\n // List all non-disabled and registered focusables: those are eligible for keyboard navigation.\n function getFocusablesFrom(target: HTMLElement) {\n function isElementRegistered(element: HTMLElement) {\n return navigationAPI.current?.isRegistered(element) ?? false;\n }\n\n function isElementDisabled(element: HTMLElement) {\n if (element instanceof HTMLButtonElement) {\n return element.disabled;\n }\n\n return false;\n }\n\n return getAllFocusables(target).filter(el => isElementRegistered(el) && !isElementDisabled(el));\n }\n\n return (\n <div\n {...baseProps}\n className={clsx(styles.root, testUtilStyles['button-group'], baseProps.className)}\n ref={containerRef}\n role=\"toolbar\"\n aria-label={ariaLabel}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n >\n <SingleTabStopNavigationProvider\n ref={navigationAPI}\n navigationActive={true}\n getNextFocusTarget={getNextFocusTarget}\n onUnregisterActive={onUnregisterActive}\n >\n {items.map((itemOrGroup, index) => {\n const itemContent = (item: ButtonGroupProps.Item, position: string) => (\n <ItemElement\n key={item.id}\n item={item}\n dropdownExpandToViewport={dropdownExpandToViewport}\n tooltip={tooltip}\n setTooltip={setTooltip}\n onItemClick={onItemClick}\n onFilesChange={onFilesChange}\n ref={element => (itemsRef.current[item.id] = element)}\n position={position}\n />\n );\n\n const isGroupBefore = items[index - 1]?.type === 'group';\n const currentItem = items[index];\n const isGroupNow = currentItem?.type === 'group';\n const shouldAddDivider = isGroupBefore || (!isGroupBefore && isGroupNow && index !== 0);\n\n if (isGroupNow && currentItem.items.length === 0) {\n warnOnce('ButtonGroup', 'Empty group detected. Empty groups are not allowed.');\n }\n\n return (\n <React.Fragment key={itemOrGroup.type === 'group' ? index : itemOrGroup.id}>\n {shouldAddDivider && <div className={styles.divider} />}\n {itemOrGroup.type === 'group' ? (\n <div key={index} role=\"group\" aria-label={itemOrGroup.text} className={styles.group}>\n {itemOrGroup.items.map((item, subIndex) => itemContent(item, `${index + 1},${subIndex + 1}`))}\n </div>\n ) : (\n itemContent(itemOrGroup, `${index + 1}`)\n )}\n </React.Fragment>\n );\n })}\n </SingleTabStopNavigationProvider>\n </div>\n );\n }\n);\n\nexport default InternalButtonGroup;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/button-group/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAGvF,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAEL,+BAA+B,GAChC,MAAM,wDAAwD,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,SAAS,MAAM,8BAA8B,CAAC;AAErD,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,cAAc,MAAM,8BAA8B,CAAC;AAE1D,MAAM,mBAAm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AAC,CAAC,CACzF,CACP,CAAC,CAAC,CAAC,CACF,WAAW,CAAC,WAAW,EAAE,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,CACzC,CACc,CAClB,CAAC;QACJ,CAAC,CAAC,CAC8B,CAC9B,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { getBaseProps } from '../internal/base-component';\nimport { getAllFocusables } from '../internal/components/focus-lock/utils';\nimport {\n SingleTabStopNavigationAPI,\n SingleTabStopNavigationProvider,\n} from '../internal/context/single-tab-stop-navigation-context';\nimport { hasModifierKeys } from '../internal/events';\nimport { KeyCode } from '../internal/keycode';\nimport { circleIndex } from '../internal/utils/circle-index';\nimport handleKey from '../internal/utils/handle-key';\nimport { ButtonGroupProps, InternalButtonGroupProps } from './interfaces';\nimport ItemElement from './item-element.js';\nimport { getButtonGroupStyles } from './style';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nconst InternalButtonGroup = forwardRef(\n (\n {\n items = [],\n onItemClick,\n onFilesChange,\n ariaLabel,\n dropdownExpandToViewport,\n style,\n __internalRootRef,\n ...props\n }: InternalButtonGroupProps,\n ref: React.Ref<ButtonGroupProps.Ref>\n ) => {\n const baseProps = getBaseProps(props);\n const focusedIdRef = useRef<null | string>(null);\n const navigationAPI = useRef<SingleTabStopNavigationAPI>(null);\n const containerObjectRef = useRef<HTMLDivElement>(null);\n const containerRef = useMergeRefs(containerObjectRef, __internalRootRef);\n const itemsRef = useRef<Record<string, ButtonProps.Ref | null>>({});\n const [tooltip, setTooltip] = useState<null | { item: string; feedback: boolean }>(null);\n\n useImperativeHandle(ref, () => ({\n focus: id => {\n itemsRef.current[id]?.focus();\n },\n }));\n\n function getNextFocusTarget(): null | HTMLElement {\n if (containerObjectRef.current) {\n const buttons: HTMLButtonElement[] = Array.from(\n containerObjectRef.current.querySelectorAll(`.${testUtilStyles.item}`)\n );\n const activeButtons = buttons.filter(button => !button.disabled);\n return activeButtons.find(button => button.dataset.itemid === focusedIdRef.current) ?? activeButtons[0] ?? null;\n }\n return null;\n }\n\n function onUnregisterActive(focusableElement: HTMLElement) {\n // Only refocus when the node is actually removed (no such ID anymore).\n const target = navigationAPI.current?.getFocusTarget();\n\n if (target && target.dataset.itemid !== focusableElement.dataset.itemid) {\n target.focus();\n }\n }\n\n useEffect(() => {\n navigationAPI.current?.updateFocusTarget();\n });\n\n function onFocus(event: React.FocusEvent) {\n if (event.target instanceof HTMLElement && event.target.dataset.itemid) {\n focusedIdRef.current = event.target.dataset.itemid;\n }\n\n navigationAPI.current?.updateFocusTarget();\n }\n\n function onBlur() {\n navigationAPI.current?.updateFocusTarget();\n }\n\n function onKeyDown(event: React.KeyboardEvent) {\n const focusTarget = navigationAPI.current?.getFocusTarget();\n const specialKeys = [KeyCode.right, KeyCode.left, KeyCode.end, KeyCode.home, KeyCode.pageUp, KeyCode.pageDown];\n if (hasModifierKeys(event) || specialKeys.indexOf(event.keyCode) === -1) {\n return;\n }\n if (!containerObjectRef.current || !focusTarget) {\n return;\n }\n // Ignore navigation when the focused element is not an item.\n if (document.activeElement && !document.activeElement.matches(`.${testUtilStyles.item}`)) {\n return;\n }\n event.preventDefault();\n\n const focusables = getFocusablesFrom(containerObjectRef.current);\n const activeIndex = focusables.indexOf(focusTarget);\n handleKey(event as any, {\n onHome: () => focusElement(focusables[0]),\n onEnd: () => focusElement(focusables[focusables.length - 1]),\n onInlineStart: () => focusElement(focusables[circleIndex(activeIndex - 1, [0, focusables.length - 1])]),\n onInlineEnd: () => focusElement(focusables[circleIndex(activeIndex + 1, [0, focusables.length - 1])]),\n });\n }\n\n function focusElement(element: HTMLElement) {\n element.focus();\n }\n\n // List all non-disabled and registered focusables: those are eligible for keyboard navigation.\n function getFocusablesFrom(target: HTMLElement) {\n function isElementRegistered(element: HTMLElement) {\n return navigationAPI.current?.isRegistered(element) ?? false;\n }\n\n function isElementDisabled(element: HTMLElement) {\n if (element instanceof HTMLButtonElement) {\n return element.disabled;\n }\n\n return false;\n }\n\n return getAllFocusables(target).filter(el => isElementRegistered(el) && !isElementDisabled(el));\n }\n\n const stylePropertiesAndVariables = getButtonGroupStyles(style);\n\n return (\n <div\n {...baseProps}\n className={clsx(styles.root, testUtilStyles['button-group'], baseProps.className)}\n ref={containerRef}\n role=\"toolbar\"\n aria-label={ariaLabel}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n style={stylePropertiesAndVariables}\n >\n <SingleTabStopNavigationProvider\n ref={navigationAPI}\n navigationActive={true}\n getNextFocusTarget={getNextFocusTarget}\n onUnregisterActive={onUnregisterActive}\n >\n {items.map((itemOrGroup, index) => {\n const itemContent = (item: ButtonGroupProps.Item, position: string) => (\n <ItemElement\n key={item.id}\n item={item}\n dropdownExpandToViewport={dropdownExpandToViewport}\n tooltip={tooltip}\n setTooltip={setTooltip}\n onItemClick={onItemClick}\n onFilesChange={onFilesChange}\n ref={element => (itemsRef.current[item.id] = element)}\n position={position}\n style={style}\n />\n );\n\n const isGroupBefore = items[index - 1]?.type === 'group';\n const currentItem = items[index];\n const isGroupNow = currentItem?.type === 'group';\n const shouldAddDivider = isGroupBefore || (!isGroupBefore && isGroupNow && index !== 0);\n\n if (isGroupNow && currentItem.items.length === 0) {\n warnOnce('ButtonGroup', 'Empty group detected. Empty groups are not allowed.');\n }\n\n return (\n <React.Fragment key={itemOrGroup.type === 'group' ? index : itemOrGroup.id}>\n {shouldAddDivider && <div className={styles.divider} />}\n {itemOrGroup.type === 'group' ? (\n <div key={index} role=\"group\" aria-label={itemOrGroup.text} className={styles.group}>\n {itemOrGroup.items.map((item, subIndex) => itemContent(item, `${index + 1},${subIndex + 1}`))}\n </div>\n ) : (\n itemContent(itemOrGroup, `${index + 1}`)\n )}\n </React.Fragment>\n );\n })}\n </SingleTabStopNavigationProvider>\n </div>\n );\n }\n);\n\nexport default InternalButtonGroup;\n"]}
|
|
@@ -16,6 +16,7 @@ interface ItemElementProps {
|
|
|
16
16
|
onItemClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails> | undefined;
|
|
17
17
|
onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails> | undefined;
|
|
18
18
|
position: string;
|
|
19
|
+
style?: ButtonGroupProps.Style;
|
|
19
20
|
}
|
|
20
21
|
declare const ItemElement: React.ForwardRefExoticComponent<ItemElementProps & React.RefAttributes<ButtonProps.Ref>>;
|
|
21
22
|
export default ItemElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-element.d.ts","sourceRoot":"","sources":["../../../src/button-group/item-element.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAIlF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAuB,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAKpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"item-element.d.ts","sourceRoot":"","sources":["../../../src/button-group/item-element.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAIlF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EAAuB,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAKpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMhD,UAAU,gBAAgB;IACxB,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;IAC5B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,OAAO,EAAE,IAAI,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IACpD,UAAU,EAAE,CAAC,OAAO,EAAE,IAAI,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1E,WAAW,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;IACvF,aAAa,CAAC,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,SAAS,CAAC;IAC3F,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC;CAChC;AAED,QAAA,MAAM,WAAW,0FA2JhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -8,8 +8,9 @@ import FileInputItem from './file-input-item';
|
|
|
8
8
|
import IconButtonItem from './icon-button-item';
|
|
9
9
|
import IconToggleButtonItem from './icon-toggle-button-item.js';
|
|
10
10
|
import MenuDropdownItem from './menu-dropdown-item';
|
|
11
|
+
import { getButtonGroupItemStyles } from './style';
|
|
11
12
|
import styles from './styles.css.js';
|
|
12
|
-
const ItemElement = forwardRef(({ item, dropdownExpandToViewport, tooltip, setTooltip, onItemClick, onFilesChange, position }, ref) => {
|
|
13
|
+
const ItemElement = forwardRef(({ item, dropdownExpandToViewport, tooltip, setTooltip, onItemClick, onFilesChange, position, style, }, ref) => {
|
|
13
14
|
const containerRef = useRef(null);
|
|
14
15
|
const buttonRef = useRef(null);
|
|
15
16
|
const fileInputRef = useRef(null);
|
|
@@ -70,6 +71,7 @@ const ItemElement = forwardRef(({ item, dropdownExpandToViewport, tooltip, setTo
|
|
|
70
71
|
fireCancelableEvent(onFilesChange, event.detail, event);
|
|
71
72
|
setTooltip(null);
|
|
72
73
|
};
|
|
74
|
+
const itemStylePropertiesAndVariables = getButtonGroupItemStyles(style);
|
|
73
75
|
return (React.createElement("div", Object.assign({ key: item.id, className: styles['item-wrapper'], ref: containerRef, onPointerEnter: () => onShowTooltipSoft(true), onPointerLeave: () => onShowTooltipSoft(false), onFocus: event => {
|
|
74
76
|
// Showing no tooltip when the focus comes from inside the container.
|
|
75
77
|
// This is needed to prevent the tooltip after a menu closes with item selection or Escape.
|
|
@@ -77,7 +79,7 @@ const ItemElement = forwardRef(({ item, dropdownExpandToViewport, tooltip, setTo
|
|
|
77
79
|
return;
|
|
78
80
|
}
|
|
79
81
|
onShowTooltipHard(true);
|
|
80
|
-
}, onBlur: () => onShowTooltipHard(false) }, (item.type === 'menu-dropdown' || item.disabled
|
|
82
|
+
}, onBlur: () => onShowTooltipHard(false), style: itemStylePropertiesAndVariables }, (item.type === 'menu-dropdown' || item.disabled
|
|
81
83
|
? {}
|
|
82
84
|
: getAnalyticsMetadataAttribute({ detail: { position, id: item.id } }))),
|
|
83
85
|
item.type === 'icon-button' && (React.createElement(IconButtonItem, { ref: buttonRef, item: item, onItemClick: onClickHandler, showTooltip: (tooltip === null || tooltip === void 0 ? void 0 : tooltip.item) === item.id, showFeedback: !!(tooltip === null || tooltip === void 0 ? void 0 : tooltip.feedback), onTooltipDismiss: () => setTooltip(null) })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-element.js","sourceRoot":"","sources":["../../../src/button-group/item-element.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAElF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAKjH,OAAO,EAAE,mBAAmB,EAA6B,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,cAAc,MAAM,oBAAoB,C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AAC,gBAAgB,IACf,GAAG,EAAE,iBAAiB,EACtB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,MAAK,IAAI,CAAC,EAAE,EACtC,WAAW,EAAE,cAAc,EAC3B,gBAAgB,EAAE,wBAAwB,EAC1C,gBAAgB,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EACxC,QAAQ,EAAE,QAAQ,GAClB,CACH,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { ButtonProps } from '../button/interfaces.js';\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces.js';\nimport { FileInputProps } from '../file-input/interfaces';\nimport { fireCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport FileInputItem from './file-input-item';\nimport IconButtonItem from './icon-button-item';\nimport IconToggleButtonItem from './icon-toggle-button-item.js';\nimport { ButtonGroupProps } from './interfaces';\nimport MenuDropdownItem from './menu-dropdown-item';\n\nimport styles from './styles.css.js';\n\ninterface ItemElementProps {\n item: ButtonGroupProps.Item;\n dropdownExpandToViewport?: boolean;\n tooltip: null | { item: string; feedback: boolean };\n setTooltip: (tooltip: null | { item: string; feedback: boolean }) => void;\n onItemClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails> | undefined;\n onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails> | undefined;\n position: string;\n}\n\nconst ItemElement = forwardRef(\n (\n { item, dropdownExpandToViewport, tooltip, setTooltip, onItemClick, onFilesChange, position }: ItemElementProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const buttonRef = useRef<ButtonProps.Ref>(null);\n const fileInputRef = useRef<FileInputProps.Ref>(null);\n const buttonDropdownRef = useRef<ButtonDropdownProps.Ref>(null);\n\n useImperativeHandle(ref, () => ({\n focus: () => {\n buttonRef.current?.focus();\n fileInputRef.current?.focus();\n buttonDropdownRef.current?.focus();\n },\n }));\n\n useEffect(() => {\n if (tooltip?.item !== item.id) {\n return;\n }\n\n const close = () => {\n setTooltip(null);\n };\n\n const handlePointerDownEvent = (event: PointerEvent) => {\n if (event.target && containerRef.current?.contains(event.target as HTMLElement)) {\n return;\n }\n\n close();\n };\n\n const handleKeyDownEvent = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n close();\n }\n };\n\n const controller = new AbortController();\n window.addEventListener('pointerdown', handlePointerDownEvent, { signal: controller.signal });\n window.addEventListener('keydown', handleKeyDownEvent, { signal: controller.signal });\n\n return () => {\n controller.abort();\n };\n }, [item.id, tooltip, setTooltip]);\n\n const onShowTooltipSoft = (show: boolean) => {\n if (!tooltip?.feedback) {\n setTooltip(show ? { item: item.id, feedback: false } : null);\n }\n };\n\n const onShowTooltipHard = (show: boolean) => {\n if (!show && item.id !== tooltip?.item) {\n return;\n }\n\n setTooltip(show ? { item: item.id, feedback: false } : null);\n };\n\n const onClickHandler = (event: CustomEvent<ButtonGroupProps.ItemClickDetails>) => {\n const hasPopoverFeedback = 'popoverFeedback' in item && item.popoverFeedback;\n\n if (hasPopoverFeedback) {\n setTooltip({ item: item.id, feedback: true });\n }\n\n fireCancelableEvent(onItemClick, event.detail, event);\n };\n\n const onFilesChangeHandler = (event: CustomEvent<ButtonGroupProps.FilesChangeDetails>) => {\n fireCancelableEvent(onFilesChange, event.detail, event);\n\n setTooltip(null);\n };\n\n return (\n <div\n key={item.id}\n className={styles['item-wrapper']}\n ref={containerRef}\n onPointerEnter={() => onShowTooltipSoft(true)}\n onPointerLeave={() => onShowTooltipSoft(false)}\n onFocus={event => {\n // Showing no tooltip when the focus comes from inside the container.\n // This is needed to prevent the tooltip after a menu closes with item selection or Escape.\n if (event && event.relatedTarget && nodeBelongs(containerRef.current, event.relatedTarget)) {\n return;\n }\n onShowTooltipHard(true);\n }}\n onBlur={() => onShowTooltipHard(false)}\n {...(item.type === 'menu-dropdown' || (item as ButtonGroupProps.IconButton).disabled\n ? {}\n : getAnalyticsMetadataAttribute({ detail: { position, id: item.id } }))}\n >\n {item.type === 'icon-button' && (\n <IconButtonItem\n ref={buttonRef}\n item={item}\n onItemClick={onClickHandler}\n showTooltip={tooltip?.item === item.id}\n showFeedback={!!tooltip?.feedback}\n onTooltipDismiss={() => setTooltip(null)}\n />\n )}\n {item.type === 'icon-toggle-button' && (\n <IconToggleButtonItem\n ref={buttonRef}\n item={item}\n onItemClick={onClickHandler}\n showTooltip={tooltip?.item === item.id}\n showFeedback={!!tooltip?.feedback}\n onTooltipDismiss={() => setTooltip(null)}\n />\n )}\n {item.type === 'icon-file-input' && (\n <FileInputItem\n ref={fileInputRef}\n item={item}\n onFilesChange={onFilesChangeHandler}\n showTooltip={tooltip?.item === item.id}\n onTooltipDismiss={() => setTooltip(null)}\n />\n )}\n {item.type === 'menu-dropdown' && (\n <MenuDropdownItem\n ref={buttonDropdownRef}\n item={item}\n showTooltip={tooltip?.item === item.id}\n onItemClick={onClickHandler}\n expandToViewport={dropdownExpandToViewport}\n onTooltipDismiss={() => setTooltip(null)}\n position={position}\n />\n )}\n </div>\n );\n }\n);\n\nexport default ItemElement;\n"]}
|
|
1
|
+
{"version":3,"file":"item-element.js","sourceRoot":"","sources":["../../../src/button-group/item-element.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAElF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAKjH,OAAO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ClC,oBAAC,aAAa,IACZ,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,oBAAoB,EACnC,WAAW,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,MAAK,IAAI,CAAC,EAAE,EACtC,gBAAgB,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,GACxC,CACH;QACA,IAAI,CAAC,IAAI,KAAK,eAAe,IAAI,CAChC,oBAAC,gBAAgB,IACf,GAAG,EAAE,iBAAiB,EACtB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,MAAK,IAAI,CAAC,EAAE,EACtC,WAAW,EAAE,cAAc,EAC3B,gBAAgB,EAAE,wBAAwB,EAC1C,gBAAgB,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EACxC,QAAQ,EAAE,QAAQ,GAClB,CACH,CACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { ButtonProps } from '../button/interfaces.js';\nimport { ButtonDropdownProps } from '../button-dropdown/interfaces.js';\nimport { FileInputProps } from '../file-input/interfaces';\nimport { fireCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport FileInputItem from './file-input-item';\nimport IconButtonItem from './icon-button-item';\nimport IconToggleButtonItem from './icon-toggle-button-item.js';\nimport { ButtonGroupProps } from './interfaces';\nimport MenuDropdownItem from './menu-dropdown-item';\nimport { getButtonGroupItemStyles } from './style';\n\nimport styles from './styles.css.js';\n\ninterface ItemElementProps {\n item: ButtonGroupProps.Item;\n dropdownExpandToViewport?: boolean;\n tooltip: null | { item: string; feedback: boolean };\n setTooltip: (tooltip: null | { item: string; feedback: boolean }) => void;\n onItemClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails> | undefined;\n onFilesChange?: NonCancelableEventHandler<ButtonGroupProps.FilesChangeDetails> | undefined;\n position: string;\n style?: ButtonGroupProps.Style;\n}\n\nconst ItemElement = forwardRef(\n (\n {\n item,\n dropdownExpandToViewport,\n tooltip,\n setTooltip,\n onItemClick,\n onFilesChange,\n position,\n style,\n }: ItemElementProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const buttonRef = useRef<ButtonProps.Ref>(null);\n const fileInputRef = useRef<FileInputProps.Ref>(null);\n const buttonDropdownRef = useRef<ButtonDropdownProps.Ref>(null);\n\n useImperativeHandle(ref, () => ({\n focus: () => {\n buttonRef.current?.focus();\n fileInputRef.current?.focus();\n buttonDropdownRef.current?.focus();\n },\n }));\n\n useEffect(() => {\n if (tooltip?.item !== item.id) {\n return;\n }\n\n const close = () => {\n setTooltip(null);\n };\n\n const handlePointerDownEvent = (event: PointerEvent) => {\n if (event.target && containerRef.current?.contains(event.target as HTMLElement)) {\n return;\n }\n\n close();\n };\n\n const handleKeyDownEvent = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n close();\n }\n };\n\n const controller = new AbortController();\n window.addEventListener('pointerdown', handlePointerDownEvent, { signal: controller.signal });\n window.addEventListener('keydown', handleKeyDownEvent, { signal: controller.signal });\n\n return () => {\n controller.abort();\n };\n }, [item.id, tooltip, setTooltip]);\n\n const onShowTooltipSoft = (show: boolean) => {\n if (!tooltip?.feedback) {\n setTooltip(show ? { item: item.id, feedback: false } : null);\n }\n };\n\n const onShowTooltipHard = (show: boolean) => {\n if (!show && item.id !== tooltip?.item) {\n return;\n }\n\n setTooltip(show ? { item: item.id, feedback: false } : null);\n };\n\n const onClickHandler = (event: CustomEvent<ButtonGroupProps.ItemClickDetails>) => {\n const hasPopoverFeedback = 'popoverFeedback' in item && item.popoverFeedback;\n\n if (hasPopoverFeedback) {\n setTooltip({ item: item.id, feedback: true });\n }\n\n fireCancelableEvent(onItemClick, event.detail, event);\n };\n\n const onFilesChangeHandler = (event: CustomEvent<ButtonGroupProps.FilesChangeDetails>) => {\n fireCancelableEvent(onFilesChange, event.detail, event);\n\n setTooltip(null);\n };\n\n const itemStylePropertiesAndVariables = getButtonGroupItemStyles(style);\n\n return (\n <div\n key={item.id}\n className={styles['item-wrapper']}\n ref={containerRef}\n onPointerEnter={() => onShowTooltipSoft(true)}\n onPointerLeave={() => onShowTooltipSoft(false)}\n onFocus={event => {\n // Showing no tooltip when the focus comes from inside the container.\n // This is needed to prevent the tooltip after a menu closes with item selection or Escape.\n if (event && event.relatedTarget && nodeBelongs(containerRef.current, event.relatedTarget)) {\n return;\n }\n onShowTooltipHard(true);\n }}\n onBlur={() => onShowTooltipHard(false)}\n style={itemStylePropertiesAndVariables}\n {...(item.type === 'menu-dropdown' || (item as ButtonGroupProps.IconButton).disabled\n ? {}\n : getAnalyticsMetadataAttribute({ detail: { position, id: item.id } }))}\n >\n {item.type === 'icon-button' && (\n <IconButtonItem\n ref={buttonRef}\n item={item}\n onItemClick={onClickHandler}\n showTooltip={tooltip?.item === item.id}\n showFeedback={!!tooltip?.feedback}\n onTooltipDismiss={() => setTooltip(null)}\n />\n )}\n {item.type === 'icon-toggle-button' && (\n <IconToggleButtonItem\n ref={buttonRef}\n item={item}\n onItemClick={onClickHandler}\n showTooltip={tooltip?.item === item.id}\n showFeedback={!!tooltip?.feedback}\n onTooltipDismiss={() => setTooltip(null)}\n />\n )}\n {item.type === 'icon-file-input' && (\n <FileInputItem\n ref={fileInputRef}\n item={item}\n onFilesChange={onFilesChangeHandler}\n showTooltip={tooltip?.item === item.id}\n onTooltipDismiss={() => setTooltip(null)}\n />\n )}\n {item.type === 'menu-dropdown' && (\n <MenuDropdownItem\n ref={buttonDropdownRef}\n item={item}\n showTooltip={tooltip?.item === item.id}\n onItemClick={onClickHandler}\n expandToViewport={dropdownExpandToViewport}\n onTooltipDismiss={() => setTooltip(null)}\n position={position}\n />\n )}\n </div>\n );\n }\n);\n\nexport default ItemElement;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ButtonGroupProps } from './interfaces';
|
|
2
|
+
export declare function getButtonGroupStyles(style: ButtonGroupProps['style']): {
|
|
3
|
+
borderRadius: string | undefined;
|
|
4
|
+
borderWidth: string | undefined;
|
|
5
|
+
borderStyle: string | undefined;
|
|
6
|
+
boxShadow: string | undefined;
|
|
7
|
+
paddingBlock: string | undefined;
|
|
8
|
+
paddingInline: string | undefined;
|
|
9
|
+
background: string | undefined;
|
|
10
|
+
borderColor: string | undefined;
|
|
11
|
+
} | undefined;
|
|
12
|
+
export declare function getButtonGroupItemStyles(style: ButtonGroupProps['style']): React.CSSProperties | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/button-group/style.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC;;;;;;;;;cAoBpE;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,aAAa,GAAG,SAAS,CAwB1G"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { SYSTEM } from '../internal/environment';
|
|
4
|
+
import customCssProps from '../internal/generated/custom-css-properties';
|
|
5
|
+
export function getButtonGroupStyles(style) {
|
|
6
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
7
|
+
if (SYSTEM !== 'core' || !(style === null || style === void 0 ? void 0 : style.root)) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
return Object.assign({ borderRadius: (_a = style === null || style === void 0 ? void 0 : style.root) === null || _a === void 0 ? void 0 : _a.borderRadius, borderWidth: (_b = style === null || style === void 0 ? void 0 : style.root) === null || _b === void 0 ? void 0 : _b.borderWidth, borderStyle: ((_c = style === null || style === void 0 ? void 0 : style.root) === null || _c === void 0 ? void 0 : _c.borderWidth) ? 'solid' : undefined, boxShadow: (_d = style === null || style === void 0 ? void 0 : style.root) === null || _d === void 0 ? void 0 : _d.boxShadow, paddingBlock: (_e = style === null || style === void 0 ? void 0 : style.root) === null || _e === void 0 ? void 0 : _e.paddingBlock, paddingInline: (_f = style === null || style === void 0 ? void 0 : style.root) === null || _f === void 0 ? void 0 : _f.paddingInline, background: (_g = style === null || style === void 0 ? void 0 : style.root) === null || _g === void 0 ? void 0 : _g.background, borderColor: (_h = style === null || style === void 0 ? void 0 : style.root) === null || _h === void 0 ? void 0 : _h.borderColor }, (((_j = style === null || style === void 0 ? void 0 : style.root) === null || _j === void 0 ? void 0 : _j.focusRing) && {
|
|
11
|
+
[customCssProps.styleFocusRingBorderColor]: (_k = style.root.focusRing) === null || _k === void 0 ? void 0 : _k.borderColor,
|
|
12
|
+
[customCssProps.styleFocusRingBorderRadius]: (_l = style.root.focusRing) === null || _l === void 0 ? void 0 : _l.borderRadius,
|
|
13
|
+
[customCssProps.styleFocusRingBorderWidth]: (_m = style.root.focusRing) === null || _m === void 0 ? void 0 : _m.borderWidth,
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
export function getButtonGroupItemStyles(style) {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
18
|
+
if (SYSTEM !== 'core' || !(style === null || style === void 0 ? void 0 : style.item)) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
return Object.assign(Object.assign(Object.assign({}, (((_a = style === null || style === void 0 ? void 0 : style.item) === null || _a === void 0 ? void 0 : _a.color) && {
|
|
22
|
+
[customCssProps.styleColorActive]: (_b = style.item.color) === null || _b === void 0 ? void 0 : _b.active,
|
|
23
|
+
[customCssProps.styleColorDefault]: (_c = style.item.color) === null || _c === void 0 ? void 0 : _c.default,
|
|
24
|
+
[customCssProps.styleColorDisabled]: (_d = style.item.color) === null || _d === void 0 ? void 0 : _d.disabled,
|
|
25
|
+
[customCssProps.styleColorHover]: (_e = style.item.color) === null || _e === void 0 ? void 0 : _e.hover,
|
|
26
|
+
})), (((_f = style === null || style === void 0 ? void 0 : style.item) === null || _f === void 0 ? void 0 : _f.boxShadow) && {
|
|
27
|
+
[customCssProps.styleBoxShadowActive]: (_g = style.item.boxShadow) === null || _g === void 0 ? void 0 : _g.active,
|
|
28
|
+
[customCssProps.styleBoxShadowDefault]: (_h = style.item.boxShadow) === null || _h === void 0 ? void 0 : _h.default,
|
|
29
|
+
[customCssProps.styleBoxShadowDisabled]: (_j = style.item.boxShadow) === null || _j === void 0 ? void 0 : _j.disabled,
|
|
30
|
+
[customCssProps.styleBoxShadowHover]: (_k = style.item.boxShadow) === null || _k === void 0 ? void 0 : _k.hover,
|
|
31
|
+
})), (((_l = style === null || style === void 0 ? void 0 : style.item) === null || _l === void 0 ? void 0 : _l.focusRing) && {
|
|
32
|
+
[customCssProps.styleFocusRingBorderColor]: (_m = style.item.focusRing) === null || _m === void 0 ? void 0 : _m.borderColor,
|
|
33
|
+
[customCssProps.styleFocusRingBorderRadius]: (_o = style.item.focusRing) === null || _o === void 0 ? void 0 : _o.borderRadius,
|
|
34
|
+
[customCssProps.styleFocusRingBorderWidth]: (_p = style.item.focusRing) === null || _p === void 0 ? void 0 : _p.borderWidth,
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","sourceRoot":"","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ACvE,CAAC,cAAc,CAAC,mBAAmB,CAAC,EAAE,MAAA,KAAK,CAAC,IAAI,CAAC,SAAS,0CAAE,KAAK;KAClE,CAAC,GACC,CAAC,CAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,0CAAE,SAAS,KAAI;QAC5B,CAAC,cAAc,CAAC,yBAAyB,CAAC,EAAE,MAAA,KAAK,CAAC,IAAI,CAAC,SAAS,0CAAE,WAAW;QAC7E,CAAC,cAAc,CAAC,0BAA0B,CAAC,EAAE,MAAA,KAAK,CAAC,IAAI,CAAC,SAAS,0CAAE,YAAY;QAC/E,CAAC,cAAc,CAAC,yBAAyB,CAAC,EAAE,MAAA,KAAK,CAAC,IAAI,CAAC,SAAS,0CAAE,WAAW;KAC9E,CAAC,EACF;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { SYSTEM } from '../internal/environment';\nimport customCssProps from '../internal/generated/custom-css-properties';\nimport { ButtonGroupProps } from './interfaces';\n\nexport function getButtonGroupStyles(style: ButtonGroupProps['style']) {\n if (SYSTEM !== 'core' || !style?.root) {\n return undefined;\n }\n\n return {\n borderRadius: style?.root?.borderRadius,\n borderWidth: style?.root?.borderWidth,\n borderStyle: style?.root?.borderWidth ? 'solid' : undefined,\n boxShadow: style?.root?.boxShadow,\n paddingBlock: style?.root?.paddingBlock,\n paddingInline: style?.root?.paddingInline,\n background: style?.root?.background,\n borderColor: style?.root?.borderColor,\n ...(style?.root?.focusRing && {\n [customCssProps.styleFocusRingBorderColor]: style.root.focusRing?.borderColor,\n [customCssProps.styleFocusRingBorderRadius]: style.root.focusRing?.borderRadius,\n [customCssProps.styleFocusRingBorderWidth]: style.root.focusRing?.borderWidth,\n }),\n };\n}\n\nexport function getButtonGroupItemStyles(style: ButtonGroupProps['style']): React.CSSProperties | undefined {\n if (SYSTEM !== 'core' || !style?.item) {\n return undefined;\n }\n\n return {\n ...(style?.item?.color && {\n [customCssProps.styleColorActive]: style.item.color?.active,\n [customCssProps.styleColorDefault]: style.item.color?.default,\n [customCssProps.styleColorDisabled]: style.item.color?.disabled,\n [customCssProps.styleColorHover]: style.item.color?.hover,\n }),\n ...(style?.item?.boxShadow && {\n [customCssProps.styleBoxShadowActive]: style.item.boxShadow?.active,\n [customCssProps.styleBoxShadowDefault]: style.item.boxShadow?.default,\n [customCssProps.styleBoxShadowDisabled]: style.item.boxShadow?.disabled,\n [customCssProps.styleBoxShadowHover]: style.item.boxShadow?.hover,\n }),\n ...(style?.item?.focusRing && {\n [customCssProps.styleFocusRingBorderColor]: style.item.focusRing?.borderColor,\n [customCssProps.styleFocusRingBorderRadius]: style.item.focusRing?.borderRadius,\n [customCssProps.styleFocusRingBorderWidth]: style.item.focusRing?.borderWidth,\n }),\n };\n}\n"]}
|
package/checkbox/interfaces.d.ts
CHANGED
|
@@ -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,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAEjE;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/checkbox/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE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E,MAAM,CAAC;oBAClB,aAAa,CAAC,EAAE,MAAM,CAAC;oBACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;iBACnB,CAAC;aACH,CAAC;YACF,SAAS,CAAC,EAAE;gBACV,WAAW,CAAC,EAAE,MAAM,CAAC;gBACrB,YAAY,CAAC,EAAE,MAAM,CAAC;gBACtB,WAAW,CAAC,EAAE,MAAM,CAAC;aACtB,CAAC;SACH,CAAC;QACF,KAAK,CAAC,EAAE;YACN,KAAK,CAAC,EAAE;gBACN,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,OAAO,CAAC,EAAE,MAAM,CAAC;gBACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAClB,aAAa,CAAC,EAAE,MAAM,CAAC;gBACvB,QAAQ,CAAC,EAAE,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';\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 *
|
|
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';\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\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"]}
|
package/checkbox/styles.css.js
CHANGED
|
@@ -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_136q5_145",
|
|
5
|
+
"checkbox-control": "awsui_checkbox-control_k2y2q_136q5_178",
|
|
6
|
+
"outline": "awsui_outline_k2y2q_136q5_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_136q5_145.awsui_root_k2y2q_136q5_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_136q5_178:not(#\9) {
|
|
179
179
|
margin-block-start: calc((var(--line-height-body-m-2mh3ke, 20px) - var(--size-control-adm93y, 16px)) / 2);
|
|
180
180
|
min-block-size: var(--size-control-adm93y, 16px);
|
|
181
181
|
min-inline-size: var(--size-control-adm93y, 16px);
|
|
@@ -183,15 +183,15 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
183
183
|
inline-size: var(--size-control-adm93y, 16px);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
.
|
|
187
|
-
--awsui-style-focus-ring-box-shadow-
|
|
186
|
+
.awsui_outline_k2y2q_136q5_186:not(#\9) {
|
|
187
|
+
--awsui-style-focus-ring-box-shadow-kiajpc: 0 0 0 var(--awsui-style-focus-ring-border-width-kiajpc, 2px) var(--awsui-style-focus-ring-border-color-kiajpc, var(--color-border-item-focused-uk47pl, #006ce0));
|
|
188
188
|
position: relative;
|
|
189
189
|
}
|
|
190
|
-
.
|
|
190
|
+
.awsui_outline_k2y2q_136q5_186:not(#\9) {
|
|
191
191
|
outline: 2px dotted transparent;
|
|
192
192
|
outline-offset: calc(2px - 1px);
|
|
193
193
|
}
|
|
194
|
-
.
|
|
194
|
+
.awsui_outline_k2y2q_136q5_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-kiajpc, var(--border-radius-control-default-focus-ring-1uabki, 4px));
|
|
203
|
+
border-start-end-radius: var(--awsui-style-focus-ring-border-radius-kiajpc, var(--border-radius-control-default-focus-ring-1uabki, 4px));
|
|
204
|
+
border-end-start-radius: var(--awsui-style-focus-ring-border-radius-kiajpc, var(--border-radius-control-default-focus-ring-1uabki, 4px));
|
|
205
|
+
border-end-end-radius: var(--awsui-style-focus-ring-border-radius-kiajpc, var(--border-radius-control-default-focus-ring-1uabki, 4px));
|
|
206
|
+
box-shadow: var(--awsui-style-focus-ring-box-shadow-kiajpc);
|
|
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_136q5_145",
|
|
6
|
+
"checkbox-control": "awsui_checkbox-control_k2y2q_136q5_178",
|
|
7
|
+
"outline": "awsui_outline_k2y2q_136q5_186"
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -69,21 +69,6 @@ export interface ContainerProps extends BaseComponentProps {
|
|
|
69
69
|
*/
|
|
70
70
|
variant?: 'default' | 'stacked';
|
|
71
71
|
/**
|
|
72
|
-
* Specifies an object of selectors and properties that are used to apply custom styles.
|
|
73
|
-
*
|
|
74
|
-
* - `root.background` (string) - (Optional) Background of the container.
|
|
75
|
-
* - `root.borderColor` (string) - (Optional) Border color of the container.
|
|
76
|
-
* - `root.borderRadius` (string) - (Optional) Border radius of the container.
|
|
77
|
-
* - `root.borderWidth` (string) - (Optional) Border width of the container.
|
|
78
|
-
* - `root.boxShadow` (string) - (Optional) Box shadow of the container.
|
|
79
|
-
* - `content.paddingBlock` (string) - (Optional) Block dimension padding of the content slot.
|
|
80
|
-
* - `content.paddingInline` (string) - (Optional) Inline dimension padding of the content slot.
|
|
81
|
-
* - `header.paddingBlock` (string) - (Optional) Block dimension padding of the header slot.
|
|
82
|
-
* - `header.paddingInline` (string) - (Optional) Inline dimension padding of the header slot.
|
|
83
|
-
* - `footer.root.paddingBlock` (string) - (Optional) Block dimension padding of the footer slot.
|
|
84
|
-
* - `footer.root.paddingInline` (string) - (Optional) Inline dimension padding of the footer slot.
|
|
85
|
-
* - `footer.divider.borderColor` (string) - (Optional) Border color of the footer divider.
|
|
86
|
-
* - `footer.divider.borderWidth` (string) - (Optional) Border width of the footer divider.
|
|
87
72
|
* @awsuiSystem core
|
|
88
73
|
*/
|
|
89
74
|
}
|
|
@@ -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,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAEhC
|
|
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,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M,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 *
|
|
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,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_7q3ar_145",
|
|
5
|
+
"background": "awsui_background_5gtk3_7q3ar_159",
|
|
6
|
+
"is-overlap-disabled": "awsui_is-overlap-disabled_5gtk3_7q3ar_164",
|
|
7
|
+
"header-background": "awsui_header-background_5gtk3_7q3ar_167",
|
|
8
|
+
"notifications": "awsui_notifications_5gtk3_7q3ar_171",
|
|
9
|
+
"breadcrumbs": "awsui_breadcrumbs_5gtk3_7q3ar_176",
|
|
10
|
+
"default-padding": "awsui_default-padding_5gtk3_7q3ar_181",
|
|
11
|
+
"header-wrapper": "awsui_header-wrapper_5gtk3_7q3ar_185",
|
|
12
|
+
"with-divider": "awsui_with-divider_5gtk3_7q3ar_190",
|
|
13
|
+
"content": "awsui_content_5gtk3_7q3ar_193",
|
|
14
|
+
"has-header": "awsui_has-header_5gtk3_7q3ar_197",
|
|
15
|
+
"is-visual-refresh": "awsui_is-visual-refresh_5gtk3_7q3ar_204",
|
|
16
|
+
"has-default-background": "awsui_has-default-background_5gtk3_7q3ar_204",
|
|
17
|
+
"has-notifications": "awsui_has-notifications_5gtk3_7q3ar_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_7q3ar_145:not(#\9) {
|
|
146
|
+
--awsui-content-layout-default-horizontal-padding-kiajpc: var(--space-layout-content-horizontal-buc0zz, 24px);
|
|
147
|
+
--awsui-content-layout-max-content-width-kiajpc: 0px;
|
|
148
|
+
--awsui-content-layout-main-gap-kiajpc: 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-kiajpc)) 1fr 0 0;
|
|
151
|
+
grid-template-rows: var(--awsui-content-layout-main-gap-kiajpc) min-content min-content auto var(--space-dark-header-overlap-distance-ld45ap, 36px) 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_7q3ar_145:not(#\9) {
|
|
156
|
+
--awsui-content-layout-default-horizontal-padding-kiajpc: var(--space-l-2ud1p3, 20px);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
.
|
|
159
|
+
.awsui_layout_5gtk3_7q3ar_145 > .awsui_background_5gtk3_7q3ar_159:not(#\9) {
|
|
160
160
|
grid-column: 1/8;
|
|
161
161
|
grid-row: 1/6;
|
|
162
162
|
color: var(--color-text-body-default-vvtq8u, #0f141a);
|
|
163
163
|
}
|
|
164
|
-
.
|
|
164
|
+
.awsui_layout_5gtk3_7q3ar_145 > .awsui_background_5gtk3_7q3ar_159.awsui_is-overlap-disabled_5gtk3_7q3ar_164:not(#\9) {
|
|
165
165
|
grid-row: 1/5;
|
|
166
166
|
}
|
|
167
|
-
.
|
|
167
|
+
.awsui_layout_5gtk3_7q3ar_145 > .awsui_background_5gtk3_7q3ar_159 > .awsui_header-background_5gtk3_7q3ar_167:not(#\9) {
|
|
168
168
|
inline-size: 100%;
|
|
169
169
|
block-size: 100%;
|
|
170
170
|
}
|
|
171
|
-
.
|
|
171
|
+
.awsui_layout_5gtk3_7q3ar_145 > .awsui_notifications_5gtk3_7q3ar_171:not(#\9) {
|
|
172
172
|
grid-column: 4;
|
|
173
173
|
grid-row: 2;
|
|
174
174
|
padding-block-end: var(--space-xs-ymlm0b, 8px);
|
|
175
175
|
}
|
|
176
|
-
.
|
|
176
|
+
.awsui_layout_5gtk3_7q3ar_145 > .awsui_breadcrumbs_5gtk3_7q3ar_176:not(#\9) {
|
|
177
177
|
grid-column: 4;
|
|
178
178
|
grid-row: 3;
|
|
179
179
|
padding-block-end: var(--space-xs-ymlm0b, 8px);
|
|
180
180
|
}
|
|
181
|
-
.
|
|
182
|
-
--awsui-content-layout-main-gap-
|
|
183
|
-
grid-template-columns: var(--awsui-toggles-left-width-
|
|
181
|
+
.awsui_layout_5gtk3_7q3ar_145.awsui_default-padding_5gtk3_7q3ar_181:not(#\9) {
|
|
182
|
+
--awsui-content-layout-main-gap-kiajpc: var(--space-scaled-m-m892r9, 16px);
|
|
183
|
+
grid-template-columns: var(--awsui-toggles-left-width-kiajpc, 0) var(--awsui-content-layout-default-horizontal-padding-kiajpc, 0) 1fr minmax(0, var(--awsui-content-layout-max-content-width-kiajpc)) 1fr var(--awsui-content-layout-default-horizontal-padding-kiajpc, 0) var(--awsui-toggles-right-width-kiajpc, 0);
|
|
184
184
|
}
|
|
185
|
-
.
|
|
185
|
+
.awsui_layout_5gtk3_7q3ar_145 > .awsui_header-wrapper_5gtk3_7q3ar_185:not(#\9) {
|
|
186
186
|
grid-column: 4;
|
|
187
187
|
grid-row: 4;
|
|
188
188
|
padding-block-end: var(--space-content-header-padding-bottom-rvy5xz, 16px);
|
|
189
189
|
}
|
|
190
|
-
.
|
|
190
|
+
.awsui_layout_5gtk3_7q3ar_145 > .awsui_header-wrapper_5gtk3_7q3ar_185.awsui_with-divider_5gtk3_7q3ar_190:not(#\9) {
|
|
191
191
|
border-block-end: 1px solid var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
192
192
|
}
|
|
193
|
-
.
|
|
193
|
+
.awsui_layout_5gtk3_7q3ar_145 > .awsui_content_5gtk3_7q3ar_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_7q3ar_145:not(#\9):not(.awsui_has-header_5gtk3_7q3ar_197) {
|
|
198
|
+
grid-template-rows: var(--awsui-content-layout-main-gap-kiajpc) min-content min-content 0 calc(var(--space-dark-header-overlap-distance-ld45ap, 36px)) 1fr;
|
|
199
199
|
}
|
|
200
|
-
.
|
|
201
|
-
grid-template-rows: var(--awsui-content-layout-main-gap-
|
|
200
|
+
.awsui_layout_5gtk3_7q3ar_145.awsui_is-overlap-disabled_5gtk3_7q3ar_164:not(#\9) {
|
|
201
|
+
grid-template-rows: var(--awsui-content-layout-main-gap-kiajpc) min-content min-content auto 0 1fr;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
.
|
|
204
|
+
.awsui_layout_5gtk3_7q3ar_145.awsui_is-visual-refresh_5gtk3_7q3ar_204 > .awsui_background_5gtk3_7q3ar_159.awsui_has-default-background_5gtk3_7q3ar_204:not(#\9) {
|
|
205
205
|
background-color: var(--color-background-layout-main-5ilwcb, #ffffff);
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
.
|
|
209
|
-
--awsui-content-layout-main-gap-
|
|
208
|
+
.awsui_layout_5gtk3_7q3ar_145:not(#\9):not(.awsui_is-visual-refresh_5gtk3_7q3ar_204).awsui_has-notifications_5gtk3_7q3ar_208 {
|
|
209
|
+
--awsui-content-layout-main-gap-kiajpc: 0px;
|
|
210
210
|
}
|
|
211
|
-
.
|
|
211
|
+
.awsui_layout_5gtk3_7q3ar_145:not(#\9):not(.awsui_is-visual-refresh_5gtk3_7q3ar_204) > .awsui_notifications_5gtk3_7q3ar_171 {
|
|
212
212
|
grid-column: 1/8;
|
|
213
213
|
}
|