@cloudscape-design/components 3.0.629 → 3.0.631
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/breadcrumb-group/implementation.d.ts +8 -0
- package/breadcrumb-group/implementation.d.ts.map +1 -0
- package/breadcrumb-group/implementation.js +71 -0
- package/breadcrumb-group/implementation.js.map +1 -0
- package/breadcrumb-group/index.js +1 -1
- package/breadcrumb-group/index.js.map +1 -1
- package/breadcrumb-group/internal.d.ts +1 -11
- package/breadcrumb-group/internal.d.ts.map +1 -1
- package/breadcrumb-group/internal.js +2 -70
- package/breadcrumb-group/internal.js.map +1 -1
- package/breadcrumb-group/item/item.js +1 -1
- package/breadcrumb-group/item/item.js.map +1 -1
- package/breadcrumb-group/utils.d.ts +7 -0
- package/breadcrumb-group/utils.d.ts.map +1 -0
- package/breadcrumb-group/utils.js +6 -0
- package/breadcrumb-group/utils.js.map +1 -0
- package/drawer/implementation.d.ts +7 -0
- package/drawer/implementation.d.ts.map +1 -0
- package/drawer/implementation.js +24 -0
- package/drawer/implementation.js.map +1 -0
- package/drawer/index.d.ts +1 -1
- package/drawer/index.d.ts.map +1 -1
- package/drawer/index.js +4 -18
- package/drawer/index.js.map +1 -1
- package/drawer/internal.d.ts +2 -0
- package/drawer/internal.d.ts.map +1 -0
- package/drawer/internal.js +5 -0
- package/drawer/internal.js.map +1 -0
- package/header/styles.css.js +35 -35
- package/header/styles.scoped.css +51 -59
- package/header/styles.selectors.js +35 -35
- package/help-panel/implementation.d.ts +7 -0
- package/help-panel/implementation.d.ts.map +1 -0
- package/help-panel/implementation.js +27 -0
- package/help-panel/implementation.js.map +1 -0
- package/help-panel/index.d.ts +1 -1
- package/help-panel/index.d.ts.map +1 -1
- package/help-panel/index.js +4 -21
- package/help-panel/index.js.map +1 -1
- package/help-panel/internal.d.ts +2 -0
- package/help-panel/internal.d.ts.map +1 -0
- package/help-panel/internal.js +5 -0
- package/help-panel/internal.js.map +1 -0
- package/input/internal.d.ts.map +1 -1
- package/input/internal.js +1 -1
- package/input/internal.js.map +1 -1
- package/internal/base-component/styles.scoped.css +5 -0
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/styles/tokens.d.ts +1 -0
- package/internal/generated/styles/tokens.js +1 -0
- package/internal/generated/theming/index.cjs +31 -0
- package/internal/generated/theming/index.js +31 -0
- package/internal/manifest.json +1 -1
- package/internal/widgets/index.d.ts +4 -0
- package/internal/widgets/index.d.ts.map +1 -0
- package/internal/widgets/index.js +28 -0
- package/internal/widgets/index.js.map +1 -0
- package/package.json +1 -1
- package/s3-resource-selector/s3-modal/index.js +2 -2
- package/s3-resource-selector/s3-modal/index.js.map +1 -1
- package/side-navigation/implementation.d.ts +7 -0
- package/side-navigation/implementation.d.ts.map +1 -0
- package/side-navigation/implementation.js +36 -0
- package/side-navigation/implementation.js.map +1 -0
- package/side-navigation/index.d.ts +1 -1
- package/side-navigation/index.d.ts.map +1 -1
- package/side-navigation/index.js +5 -29
- package/side-navigation/index.js.map +1 -1
- package/side-navigation/internal.d.ts +1 -17
- package/side-navigation/internal.d.ts.map +1 -1
- package/side-navigation/internal.js +2 -182
- package/side-navigation/internal.js.map +1 -1
- package/side-navigation/parts.d.ts +18 -0
- package/side-navigation/parts.d.ts.map +1 -0
- package/side-navigation/parts.js +185 -0
- package/side-navigation/parts.js.map +1 -0
- package/slider/internal.d.ts.map +1 -1
- package/slider/internal.js +6 -2
- package/slider/internal.js.map +1 -1
- package/slider/styles.css.js +25 -23
- package/slider/styles.scoped.css +95 -52
- package/slider/styles.selectors.js +25 -23
- package/slider/tick-marks.d.ts +1 -0
- package/slider/tick-marks.d.ts.map +1 -1
- package/slider/tick-marks.js +4 -1
- package/slider/tick-marks.js.map +1 -1
- package/split-panel/implementation.d.ts +1 -0
- package/split-panel/implementation.d.ts.map +1 -1
- package/split-panel/implementation.js +2 -0
- package/split-panel/implementation.js.map +1 -1
- package/split-panel/styles.css.js +57 -57
- package/split-panel/styles.scoped.css +78 -77
- package/split-panel/styles.selectors.js +57 -57
- package/split-panel/widget.d.ts +1 -5
- package/split-panel/widget.d.ts.map +1 -1
- package/split-panel/widget.js +1 -13
- package/split-panel/widget.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAG/E,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAG5E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,UAAU,MAAM,gCAAgC,CAAC;AAIxD,MAAM,CAAC,MAAM,wBAAwB,GAAG,KA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,CAC5C;gBACD,cAAc,EAAE,IAAI,CAAC,uCAAuC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,yBAAyB,CAAC;gBACrG,YAAY,EAAE,IAAI,CAAC,qCAAqC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,uBAAuB,CAAC;aAChG,EACD,SAAS,EAAE,WAAW,CAAC,EAAE;gBACvB,mBAAmB,mBAAM,WAAW,EAAG,CAAC;gBACxC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,EACD,SAAS,EAAE,GAAG,EAAE;gBACd,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,GACD,CACH,CACA,CACJ,CACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\n\nimport { SplitPanelProps } from './interfaces';\nimport ResizeHandler from './icons/resize-handler';\nimport PreferencesModal from './preferences-modal';\nimport { usePointerEvents } from '../app-layout/utils/use-pointer-events';\nimport { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';\nimport { SizeControlProps } from '../app-layout/utils/interfaces';\n\nimport styles from './styles.css.js';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { Transition } from '../internal/components/transition';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SplitPanelContentSide } from './side';\nimport { SplitPanelContentBottom } from './bottom';\nimport { useInternalI18n } from '../i18n/context';\nimport globalVars from '../internal/styles/global-vars';\n\nexport { SplitPanelProps };\n\nexport const SplitPanelImplementation = React.forwardRef<HTMLElement, SplitPanelProps>(\n (\n { header, children, hidePreferencesButton = false, closeBehavior = 'collapse', i18nStrings, ...restProps },\n __internalRootRef\n ) => {\n const isRefresh = useVisualRefresh();\n\n const {\n position,\n topOffset,\n bottomOffset,\n rightOffset,\n contentWidthStyles,\n isOpen,\n isForcedPosition,\n onPreferencesChange,\n onResize,\n onToggle,\n size,\n relativeSize,\n setSplitPanelToggle,\n refs,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const i18n = useInternalI18n('split-panel');\n const [isPreferencesOpen, setPreferencesOpen] = useState<boolean>(false);\n\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n const openButtonAriaLabel = i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel);\n useEffect(() => {\n setSplitPanelToggle({ displayed: closeBehavior === 'collapse', ariaLabel: openButtonAriaLabel });\n }, [setSplitPanelToggle, openButtonAriaLabel, closeBehavior]);\n\n const splitPanelRefObject = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n panelRef: splitPanelRefObject,\n handleRef: refs.slider,\n onResize,\n };\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const contentStyle = {\n [globalVars.stickyVerticalTopOffset]: topOffset,\n [globalVars.stickyVerticalBottomOffset]: bottomOffset,\n };\n\n const panelHeaderId = useUniqueId('split-panel-header');\n\n const wrappedHeader = (\n <div className={styles.header} style={appLayoutMaxWidth}>\n <h2 className={styles['header-text']} id={panelHeaderId}>\n {header}\n </h2>\n <div className={styles['header-actions']}>\n {!hidePreferencesButton && isOpen && (\n <>\n <InternalButton\n className={styles['preferences-button']}\n iconName=\"settings\"\n variant=\"icon\"\n onClick={() => setPreferencesOpen(true)}\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.preferencesTitle', i18nStrings?.preferencesTitle)}\n ref={refs.preferences}\n />\n <span className={styles.divider} />\n </>\n )}\n\n {isOpen ? (\n <InternalButton\n className={styles['close-button']}\n iconName={\n isRefresh && closeBehavior === 'collapse'\n ? position === 'side'\n ? 'angle-right'\n : 'angle-down'\n : 'close'\n }\n variant=\"icon\"\n onClick={onToggle}\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.closeButtonAriaLabel', i18nStrings?.closeButtonAriaLabel)}\n ariaExpanded={isOpen}\n />\n ) : position === 'side' ? null : (\n <InternalButton\n className={styles['open-button']}\n iconName=\"angle-up\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel)}\n ref={refs.toggle}\n ariaExpanded={isOpen}\n />\n )}\n </div>\n </div>\n );\n\n const resizeHandle = (\n <div\n ref={refs.slider}\n role=\"slider\"\n tabIndex={0}\n aria-label={i18n('i18nStrings.resizeHandleAriaLabel', i18nStrings?.resizeHandleAriaLabel)}\n aria-valuemax={100}\n aria-valuemin={0}\n // Allows us to use the logical left/right keys to move the slider left/right,\n // but match aria keyboard behavior of using left/right to decrease/increase\n // the slider value.\n aria-valuenow={position === 'bottom' ? relativeSize : 100 - relativeSize}\n className={clsx(styles.slider, styles[`slider-${position}`])}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n >\n <ResizeHandler className={clsx(styles['slider-icon'], styles[`slider-icon-${position}`])} />\n </div>\n );\n\n /*\n This effect forces the browser to recalculate the layout\n whenever the split panel might have moved.\n\n This is needed as a workaround for a bug in Safari, which does\n not automatically calculate the new position of the split panel\n _content_ when the split panel moves.\n */\n useLayoutEffect(() => {\n const root = splitPanelRefObject.current;\n\n if (root) {\n const property = 'transform';\n const temporaryValue = 'translateZ(0)';\n\n const valueBefore = root.style[property];\n root.style[property] = temporaryValue;\n\n // This line forces the browser to recalculate the layout\n void root.offsetHeight;\n\n root.style[property] = valueBefore;\n }\n }, [rightOffset, __internalRootRef]);\n\n const mergedRef = useMergeRefs(splitPanelRefObject, __internalRootRef);\n\n if (closeBehavior === 'hide' && !isOpen) {\n return <></>;\n }\n\n /**\n * The AppLayout factor moved the circular buttons out of the\n * SplitPanel and into the Tools component. This conditional\n * is still needed for the early return to prevent execution\n * of the following code.\n */\n if (isRefresh && !isOpen && position === 'side') {\n return <></>;\n }\n\n return (\n <Transition in={isOpen ?? false}>\n {(state, transitioningElementRef) => (\n <>\n {position === 'side' && (\n <SplitPanelContentSide\n style={contentStyle}\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={size}\n onToggle={onToggle}\n openButtonAriaLabel={i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel)}\n toggleRef={refs.toggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n >\n {children}\n </SplitPanelContentSide>\n )}\n\n {position === 'bottom' && (\n <SplitPanelContentBottom\n style={contentStyle}\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={size}\n onToggle={onToggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n state={state}\n transitioningElementRef={transitioningElementRef}\n appLayoutMaxWidth={appLayoutMaxWidth}\n >\n {children}\n </SplitPanelContentBottom>\n )}\n {isPreferencesOpen && (\n <PreferencesModal\n visible={true}\n preferences={{ position }}\n disabledSidePosition={position === 'bottom' && isForcedPosition}\n isRefresh={isRefresh}\n i18nStrings={{\n header: i18n('i18nStrings.preferencesTitle', i18nStrings?.preferencesTitle),\n confirm: i18n('i18nStrings.preferencesConfirm', i18nStrings?.preferencesConfirm),\n cancel: i18n('i18nStrings.preferencesCancel', i18nStrings?.preferencesCancel),\n positionLabel: i18n('i18nStrings.preferencesPositionLabel', i18nStrings?.preferencesPositionLabel),\n positionDescription: i18n(\n 'i18nStrings.preferencesPositionDescription',\n i18nStrings?.preferencesPositionDescription\n ),\n positionBottom: i18n('i18nStrings.preferencesPositionBottom', i18nStrings?.preferencesPositionBottom),\n positionSide: i18n('i18nStrings.preferencesPositionSide', i18nStrings?.preferencesPositionSide),\n }}\n onConfirm={preferences => {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n </>\n )}\n </Transition>\n );\n }\n);\n"]}
|
|
1
|
+
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/split-panel/implementation.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAG/E,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAG5E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,UAAU,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MA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4CAA4C,EAC5C,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,8BAA8B,CAC5C;gBACD,cAAc,EAAE,IAAI,CAAC,uCAAuC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,yBAAyB,CAAC;gBACrG,YAAY,EAAE,IAAI,CAAC,qCAAqC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,uBAAuB,CAAC;aAChG,EACD,SAAS,EAAE,WAAW,CAAC,EAAE;gBACvB,mBAAmB,mBAAM,WAAW,EAAG,CAAC;gBACxC,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,EACD,SAAS,EAAE,GAAG,EAAE;gBACd,kBAAkB,CAAC,KAAK,CAAC,CAAC;YAC5B,CAAC,GACD,CACH,CACA,CACJ,CACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,0BAA0B,CAIlE,wBAAwB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState, useEffect, useLayoutEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { useSplitPanelContext } from '../internal/context/split-panel-context';\n\nimport { SplitPanelProps } from './interfaces';\nimport ResizeHandler from './icons/resize-handler';\nimport PreferencesModal from './preferences-modal';\nimport { usePointerEvents } from '../app-layout/utils/use-pointer-events';\nimport { useKeyboardEvents } from '../app-layout/utils/use-keyboard-events';\nimport { SizeControlProps } from '../app-layout/utils/interfaces';\n\nimport styles from './styles.css.js';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { Transition } from '../internal/components/transition';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SplitPanelContentSide } from './side';\nimport { SplitPanelContentBottom } from './bottom';\nimport { useInternalI18n } from '../i18n/context';\nimport globalVars from '../internal/styles/global-vars';\nimport { createWidgetizedForwardRef } from '../internal/widgets';\n\nexport { SplitPanelProps };\n\nexport const SplitPanelImplementation = React.forwardRef<HTMLElement, SplitPanelProps>(\n (\n { header, children, hidePreferencesButton = false, closeBehavior = 'collapse', i18nStrings, ...restProps },\n __internalRootRef\n ) => {\n const isRefresh = useVisualRefresh();\n\n const {\n position,\n topOffset,\n bottomOffset,\n rightOffset,\n contentWidthStyles,\n isOpen,\n isForcedPosition,\n onPreferencesChange,\n onResize,\n onToggle,\n size,\n relativeSize,\n setSplitPanelToggle,\n refs,\n } = useSplitPanelContext();\n const baseProps = getBaseProps(restProps);\n const i18n = useInternalI18n('split-panel');\n const [isPreferencesOpen, setPreferencesOpen] = useState<boolean>(false);\n\n const appLayoutMaxWidth = isRefresh && position === 'bottom' ? contentWidthStyles : undefined;\n\n const openButtonAriaLabel = i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel);\n useEffect(() => {\n setSplitPanelToggle({ displayed: closeBehavior === 'collapse', ariaLabel: openButtonAriaLabel });\n }, [setSplitPanelToggle, openButtonAriaLabel, closeBehavior]);\n\n const splitPanelRefObject = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position,\n panelRef: splitPanelRefObject,\n handleRef: refs.slider,\n onResize,\n };\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const contentStyle = {\n [globalVars.stickyVerticalTopOffset]: topOffset,\n [globalVars.stickyVerticalBottomOffset]: bottomOffset,\n };\n\n const panelHeaderId = useUniqueId('split-panel-header');\n\n const wrappedHeader = (\n <div className={styles.header} style={appLayoutMaxWidth}>\n <h2 className={styles['header-text']} id={panelHeaderId}>\n {header}\n </h2>\n <div className={styles['header-actions']}>\n {!hidePreferencesButton && isOpen && (\n <>\n <InternalButton\n className={styles['preferences-button']}\n iconName=\"settings\"\n variant=\"icon\"\n onClick={() => setPreferencesOpen(true)}\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.preferencesTitle', i18nStrings?.preferencesTitle)}\n ref={refs.preferences}\n />\n <span className={styles.divider} />\n </>\n )}\n\n {isOpen ? (\n <InternalButton\n className={styles['close-button']}\n iconName={\n isRefresh && closeBehavior === 'collapse'\n ? position === 'side'\n ? 'angle-right'\n : 'angle-down'\n : 'close'\n }\n variant=\"icon\"\n onClick={onToggle}\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.closeButtonAriaLabel', i18nStrings?.closeButtonAriaLabel)}\n ariaExpanded={isOpen}\n />\n ) : position === 'side' ? null : (\n <InternalButton\n className={styles['open-button']}\n iconName=\"angle-up\"\n variant=\"icon\"\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel)}\n ref={refs.toggle}\n ariaExpanded={isOpen}\n />\n )}\n </div>\n </div>\n );\n\n const resizeHandle = (\n <div\n ref={refs.slider}\n role=\"slider\"\n tabIndex={0}\n aria-label={i18n('i18nStrings.resizeHandleAriaLabel', i18nStrings?.resizeHandleAriaLabel)}\n aria-valuemax={100}\n aria-valuemin={0}\n // Allows us to use the logical left/right keys to move the slider left/right,\n // but match aria keyboard behavior of using left/right to decrease/increase\n // the slider value.\n aria-valuenow={position === 'bottom' ? relativeSize : 100 - relativeSize}\n className={clsx(styles.slider, styles[`slider-${position}`])}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n >\n <ResizeHandler className={clsx(styles['slider-icon'], styles[`slider-icon-${position}`])} />\n </div>\n );\n\n /*\n This effect forces the browser to recalculate the layout\n whenever the split panel might have moved.\n\n This is needed as a workaround for a bug in Safari, which does\n not automatically calculate the new position of the split panel\n _content_ when the split panel moves.\n */\n useLayoutEffect(() => {\n const root = splitPanelRefObject.current;\n\n if (root) {\n const property = 'transform';\n const temporaryValue = 'translateZ(0)';\n\n const valueBefore = root.style[property];\n root.style[property] = temporaryValue;\n\n // This line forces the browser to recalculate the layout\n void root.offsetHeight;\n\n root.style[property] = valueBefore;\n }\n }, [rightOffset, __internalRootRef]);\n\n const mergedRef = useMergeRefs(splitPanelRefObject, __internalRootRef);\n\n if (closeBehavior === 'hide' && !isOpen) {\n return <></>;\n }\n\n /**\n * The AppLayout factor moved the circular buttons out of the\n * SplitPanel and into the Tools component. This conditional\n * is still needed for the early return to prevent execution\n * of the following code.\n */\n if (isRefresh && !isOpen && position === 'side') {\n return <></>;\n }\n\n return (\n <Transition in={isOpen ?? false}>\n {(state, transitioningElementRef) => (\n <>\n {position === 'side' && (\n <SplitPanelContentSide\n style={contentStyle}\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={size}\n onToggle={onToggle}\n openButtonAriaLabel={i18n('i18nStrings.openButtonAriaLabel', i18nStrings?.openButtonAriaLabel)}\n toggleRef={refs.toggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n >\n {children}\n </SplitPanelContentSide>\n )}\n\n {position === 'bottom' && (\n <SplitPanelContentBottom\n style={contentStyle}\n resizeHandle={resizeHandle}\n baseProps={baseProps}\n isOpen={isOpen}\n splitPanelRef={mergedRef}\n cappedSize={size}\n onToggle={onToggle}\n header={wrappedHeader}\n panelHeaderId={panelHeaderId}\n state={state}\n transitioningElementRef={transitioningElementRef}\n appLayoutMaxWidth={appLayoutMaxWidth}\n >\n {children}\n </SplitPanelContentBottom>\n )}\n {isPreferencesOpen && (\n <PreferencesModal\n visible={true}\n preferences={{ position }}\n disabledSidePosition={position === 'bottom' && isForcedPosition}\n isRefresh={isRefresh}\n i18nStrings={{\n header: i18n('i18nStrings.preferencesTitle', i18nStrings?.preferencesTitle),\n confirm: i18n('i18nStrings.preferencesConfirm', i18nStrings?.preferencesConfirm),\n cancel: i18n('i18nStrings.preferencesCancel', i18nStrings?.preferencesCancel),\n positionLabel: i18n('i18nStrings.preferencesPositionLabel', i18nStrings?.preferencesPositionLabel),\n positionDescription: i18n(\n 'i18nStrings.preferencesPositionDescription',\n i18nStrings?.preferencesPositionDescription\n ),\n positionBottom: i18n('i18nStrings.preferencesPositionBottom', i18nStrings?.preferencesPositionBottom),\n positionSide: i18n('i18nStrings.preferencesPositionSide', i18nStrings?.preferencesPositionSide),\n }}\n onConfirm={preferences => {\n onPreferencesChange({ ...preferences });\n setPreferencesOpen(false);\n }}\n onDismiss={() => {\n setPreferencesOpen(false);\n }}\n />\n )}\n </>\n )}\n </Transition>\n );\n }\n);\n\nexport const createWidgetizedSplitPanel = createWidgetizedForwardRef<\n SplitPanelProps,\n HTMLElement,\n typeof SplitPanelImplementation\n>(SplitPanelImplementation);\n"]}
|
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"drawer": "
|
|
5
|
-
"refresh": "
|
|
6
|
-
"animating": "
|
|
7
|
-
"preference-icon--svg": "awsui_preference-icon--
|
|
8
|
-
"preference-icon--layout-border": "awsui_preference-icon--layout-
|
|
9
|
-
"preference-icon--layout-background": "awsui_preference-icon--layout-
|
|
10
|
-
"preference-icon--layout-header": "awsui_preference-icon--layout-
|
|
11
|
-
"preference-icon--border": "awsui_preference-icon--
|
|
12
|
-
"preference-icon--primary-button": "awsui_preference-icon--primary-
|
|
13
|
-
"preference-icon--secondary": "awsui_preference-icon--
|
|
14
|
-
"preference-icon--disabled-element": "awsui_preference-icon--disabled-
|
|
15
|
-
"preference-icon--separator": "awsui_preference-icon--
|
|
16
|
-
"preference-icon--focus-text": "awsui_preference-icon--focus-
|
|
17
|
-
"preference-icon-refresh--svg": "awsui_preference-icon-refresh--
|
|
18
|
-
"preference-icon-refresh--layout-top": "awsui_preference-icon-refresh--layout-
|
|
19
|
-
"preference-icon-refresh--layout-main": "awsui_preference-icon-refresh--layout-
|
|
20
|
-
"preference-icon-refresh--primary": "awsui_preference-icon-refresh--
|
|
21
|
-
"preference-icon-refresh--disabled": "awsui_preference-icon-refresh--
|
|
22
|
-
"preference-icon-refresh--column-header": "awsui_preference-icon-refresh--column-
|
|
23
|
-
"preference-icon-refresh--window": "awsui_preference-icon-refresh--
|
|
24
|
-
"preference-icon-refresh--secondary": "awsui_preference-icon-refresh--
|
|
25
|
-
"preference-icon-refresh--default": "awsui_preference-icon-refresh--
|
|
26
|
-
"preference-icon-refresh--separator": "awsui_preference-icon-refresh--
|
|
27
|
-
"preference-icon-refresh--input-default": "awsui_preference-icon-refresh--input-
|
|
28
|
-
"preference-icon-refresh--heading": "awsui_preference-icon-refresh--
|
|
29
|
-
"root": "
|
|
30
|
-
"preferences-button": "awsui_preferences-
|
|
31
|
-
"close-button": "awsui_close-
|
|
32
|
-
"drawer-closed": "awsui_drawer-
|
|
33
|
-
"drawer-content-side": "awsui_drawer-content-
|
|
34
|
-
"drawer-content-bottom": "awsui_drawer-content-
|
|
35
|
-
"position-bottom": "awsui_position-
|
|
36
|
-
"position-side": "awsui_position-
|
|
37
|
-
"slider": "
|
|
38
|
-
"slider-side": "awsui_slider-
|
|
39
|
-
"slider-wrapper-bottom": "awsui_slider-wrapper-
|
|
40
|
-
"slider-wrapper-side": "awsui_slider-wrapper-
|
|
41
|
-
"open-button": "awsui_open-
|
|
42
|
-
"open-button-side": "awsui_open-button-
|
|
43
|
-
"slider-icon": "awsui_slider-
|
|
44
|
-
"slider-icon-bottom": "awsui_slider-icon-
|
|
45
|
-
"slider-icon-side": "awsui_slider-icon-
|
|
46
|
-
"pane-header-wrapper-bottom": "awsui_pane-header-wrapper-
|
|
47
|
-
"drawer-mobile": "awsui_drawer-
|
|
48
|
-
"drawer-disable-content-paddings": "awsui_drawer-disable-content-
|
|
49
|
-
"content-bottom": "awsui_content-
|
|
50
|
-
"pane-bottom-center-align": "awsui_pane-bottom-center-
|
|
51
|
-
"pane-bottom-content-nav-padding": "awsui_pane-bottom-content-nav-
|
|
52
|
-
"pane-bottom-content-tools-padding": "awsui_pane-bottom-content-tools-
|
|
53
|
-
"content-bottom-max-width": "awsui_content-bottom-max-
|
|
54
|
-
"content-side": "awsui_content-
|
|
55
|
-
"pane-header-wrapper-side": "awsui_pane-header-wrapper-
|
|
56
|
-
"pane-content-wrapper-side": "awsui_pane-content-wrapper-
|
|
57
|
-
"header": "
|
|
58
|
-
"header-text": "awsui_header-
|
|
59
|
-
"header-actions": "awsui_header-
|
|
60
|
-
"divider": "
|
|
4
|
+
"drawer": "awsui_drawer_1r9lg_1y4zq_201",
|
|
5
|
+
"refresh": "awsui_refresh_1r9lg_1y4zq_201",
|
|
6
|
+
"animating": "awsui_animating_1r9lg_1y4zq_215",
|
|
7
|
+
"preference-icon--svg": "awsui_preference-icon--svg_1r9lg_1y4zq_328",
|
|
8
|
+
"preference-icon--layout-border": "awsui_preference-icon--layout-border_1r9lg_1y4zq_331",
|
|
9
|
+
"preference-icon--layout-background": "awsui_preference-icon--layout-background_1r9lg_1y4zq_335",
|
|
10
|
+
"preference-icon--layout-header": "awsui_preference-icon--layout-header_1r9lg_1y4zq_338",
|
|
11
|
+
"preference-icon--border": "awsui_preference-icon--border_1r9lg_1y4zq_341",
|
|
12
|
+
"preference-icon--primary-button": "awsui_preference-icon--primary-button_1r9lg_1y4zq_345",
|
|
13
|
+
"preference-icon--secondary": "awsui_preference-icon--secondary_1r9lg_1y4zq_348",
|
|
14
|
+
"preference-icon--disabled-element": "awsui_preference-icon--disabled-element_1r9lg_1y4zq_351",
|
|
15
|
+
"preference-icon--separator": "awsui_preference-icon--separator_1r9lg_1y4zq_354",
|
|
16
|
+
"preference-icon--focus-text": "awsui_preference-icon--focus-text_1r9lg_1y4zq_357",
|
|
17
|
+
"preference-icon-refresh--svg": "awsui_preference-icon-refresh--svg_1r9lg_1y4zq_361",
|
|
18
|
+
"preference-icon-refresh--layout-top": "awsui_preference-icon-refresh--layout-top_1r9lg_1y4zq_364",
|
|
19
|
+
"preference-icon-refresh--layout-main": "awsui_preference-icon-refresh--layout-main_1r9lg_1y4zq_367",
|
|
20
|
+
"preference-icon-refresh--primary": "awsui_preference-icon-refresh--primary_1r9lg_1y4zq_370",
|
|
21
|
+
"preference-icon-refresh--disabled": "awsui_preference-icon-refresh--disabled_1r9lg_1y4zq_373",
|
|
22
|
+
"preference-icon-refresh--column-header": "awsui_preference-icon-refresh--column-header_1r9lg_1y4zq_376",
|
|
23
|
+
"preference-icon-refresh--window": "awsui_preference-icon-refresh--window_1r9lg_1y4zq_379",
|
|
24
|
+
"preference-icon-refresh--secondary": "awsui_preference-icon-refresh--secondary_1r9lg_1y4zq_383",
|
|
25
|
+
"preference-icon-refresh--default": "awsui_preference-icon-refresh--default_1r9lg_1y4zq_386",
|
|
26
|
+
"preference-icon-refresh--separator": "awsui_preference-icon-refresh--separator_1r9lg_1y4zq_389",
|
|
27
|
+
"preference-icon-refresh--input-default": "awsui_preference-icon-refresh--input-default_1r9lg_1y4zq_392",
|
|
28
|
+
"preference-icon-refresh--heading": "awsui_preference-icon-refresh--heading_1r9lg_1y4zq_395",
|
|
29
|
+
"root": "awsui_root_1r9lg_1y4zq_399",
|
|
30
|
+
"preferences-button": "awsui_preferences-button_1r9lg_1y4zq_434",
|
|
31
|
+
"close-button": "awsui_close-button_1r9lg_1y4zq_438",
|
|
32
|
+
"drawer-closed": "awsui_drawer-closed_1r9lg_1y4zq_450",
|
|
33
|
+
"drawer-content-side": "awsui_drawer-content-side_1r9lg_1y4zq_455",
|
|
34
|
+
"drawer-content-bottom": "awsui_drawer-content-bottom_1r9lg_1y4zq_471",
|
|
35
|
+
"position-bottom": "awsui_position-bottom_1r9lg_1y4zq_478",
|
|
36
|
+
"position-side": "awsui_position-side_1r9lg_1y4zq_505",
|
|
37
|
+
"slider": "awsui_slider_1r9lg_1y4zq_511",
|
|
38
|
+
"slider-side": "awsui_slider-side_1r9lg_1y4zq_546",
|
|
39
|
+
"slider-wrapper-bottom": "awsui_slider-wrapper-bottom_1r9lg_1y4zq_553",
|
|
40
|
+
"slider-wrapper-side": "awsui_slider-wrapper-side_1r9lg_1y4zq_564",
|
|
41
|
+
"open-button": "awsui_open-button_1r9lg_1y4zq_575",
|
|
42
|
+
"open-button-side": "awsui_open-button-side_1r9lg_1y4zq_579",
|
|
43
|
+
"slider-icon": "awsui_slider-icon_1r9lg_1y4zq_588",
|
|
44
|
+
"slider-icon-bottom": "awsui_slider-icon-bottom_1r9lg_1y4zq_594",
|
|
45
|
+
"slider-icon-side": "awsui_slider-icon-side_1r9lg_1y4zq_598",
|
|
46
|
+
"pane-header-wrapper-bottom": "awsui_pane-header-wrapper-bottom_1r9lg_1y4zq_602",
|
|
47
|
+
"drawer-mobile": "awsui_drawer-mobile_1r9lg_1y4zq_613",
|
|
48
|
+
"drawer-disable-content-paddings": "awsui_drawer-disable-content-paddings_1r9lg_1y4zq_617",
|
|
49
|
+
"content-bottom": "awsui_content-bottom_1r9lg_1y4zq_626",
|
|
50
|
+
"pane-bottom-center-align": "awsui_pane-bottom-center-align_1r9lg_1y4zq_642",
|
|
51
|
+
"pane-bottom-content-nav-padding": "awsui_pane-bottom-content-nav-padding_1r9lg_1y4zq_647",
|
|
52
|
+
"pane-bottom-content-tools-padding": "awsui_pane-bottom-content-tools-padding_1r9lg_1y4zq_651",
|
|
53
|
+
"content-bottom-max-width": "awsui_content-bottom-max-width_1r9lg_1y4zq_655",
|
|
54
|
+
"content-side": "awsui_content-side_1r9lg_1y4zq_660",
|
|
55
|
+
"pane-header-wrapper-side": "awsui_pane-header-wrapper-side_1r9lg_1y4zq_670",
|
|
56
|
+
"pane-content-wrapper-side": "awsui_pane-content-wrapper-side_1r9lg_1y4zq_676",
|
|
57
|
+
"header": "awsui_header_1r9lg_1y4zq_683",
|
|
58
|
+
"header-text": "awsui_header-text_1r9lg_1y4zq_693",
|
|
59
|
+
"header-actions": "awsui_header-actions_1r9lg_1y4zq_706",
|
|
60
|
+
"divider": "awsui_divider_1r9lg_1y4zq_714"
|
|
61
61
|
};
|
|
62
62
|
|