@cloudscape-design/components 3.0.353 → 3.0.355
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/internal.d.ts.map +1 -1
- package/alert/internal.js +15 -13
- package/alert/internal.js.map +1 -1
- package/attribute-editor/styles.css.js +14 -14
- package/attribute-editor/styles.scoped.css +28 -29
- package/attribute-editor/styles.selectors.js +14 -14
- package/breadcrumb-group/item/styles.css.js +9 -9
- package/breadcrumb-group/item/styles.scoped.css +19 -19
- package/breadcrumb-group/item/styles.selectors.js +9 -9
- package/cards/index.d.ts.map +1 -1
- package/cards/index.js +9 -7
- package/cards/index.js.map +1 -1
- package/cards/interfaces.d.ts +1 -1
- package/cards/interfaces.js.map +1 -1
- package/help-panel/index.d.ts.map +1 -1
- package/help-panel/index.js +3 -1
- package/help-panel/index.js.map +1 -1
- package/help-panel/styles.css.js +4 -4
- package/help-panel/styles.scoped.css +67 -68
- package/help-panel/styles.selectors.js +4 -4
- package/internal/base-component/styles.scoped.css +0 -8
- package/internal/context/link-default-variant-context.d.ts +6 -0
- package/internal/context/link-default-variant-context.d.ts.map +1 -0
- package/internal/context/link-default-variant-context.js +7 -0
- package/internal/context/link-default-variant-context.js.map +1 -0
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/theming/index.cjs +0 -40
- package/internal/generated/theming/index.js +0 -40
- package/internal/manifest.json +1 -1
- package/link/index.d.ts.map +1 -1
- package/link/index.js +2 -2
- package/link/index.js.map +1 -1
- package/link/interfaces.d.ts +7 -0
- package/link/interfaces.d.ts.map +1 -1
- package/link/interfaces.js.map +1 -1
- package/link/internal.d.ts.map +1 -1
- package/link/internal.js +4 -1
- package/link/internal.js.map +1 -1
- package/link/styles.css.js +20 -20
- package/link/styles.scoped.css +79 -78
- package/link/styles.selectors.js +20 -20
- package/package.json +1 -1
- package/popover/internal.d.ts.map +1 -1
- package/popover/internal.js +3 -1
- package/popover/internal.js.map +1 -1
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +58 -56
- package/table/internal.js.map +1 -1
- package/text-content/styles.css.js +1 -1
- package/text-content/styles.scoped.css +68 -70
- package/text-content/styles.selectors.js +1 -1
- package/tutorial-panel/components/tutorial-detail-view/congratulation-screen.js +1 -1
- package/tutorial-panel/components/tutorial-detail-view/congratulation-screen.js.map +1 -1
- package/tutorial-panel/components/tutorial-list/index.js +1 -1
- package/tutorial-panel/components/tutorial-list/index.js.map +1 -1
- package/wizard/wizard-navigation.js +1 -1
- package/wizard/wizard-navigation.js.map +1 -1
package/cards/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["cards/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAqB,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,gBAA2C,MAAM,4BAA4B,CAAC;AACrF,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE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G,KAAK,GAAG,EAAE;gBAC5E,MAAM,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAG,MAAM,CAAO,CAAC,CAAC,CAAC,EAAE;gBACtE,OAAO,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,IAAG,OAAO,CAAC,IAAI,CAAC,CAAO,CAAC,CAAC,CAAC,EAAE,CAC5E,CACP,CAAC,CACE,CACH,CACN,CAAC,CACC,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { FocusEventHandler, useImperativeHandle, useRef } from 'react';\nimport { CardsForwardRefType, CardsProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { getCardsPerRow } from './cards-layout-helper';\nimport { getBaseProps } from '../internal/base-component';\nimport ToolsHeader from '../table/tools-header';\nimport { getItemKey } from '../table/utils';\nimport { focusMarkers, useFocusMove, useSelection } from '../table/use-selection';\nimport SelectionControl, { SelectionControlProps } from '../table/selection-control';\nimport InternalContainer from '../container/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport stickyScrolling from '../table/sticky-scrolling';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport LiveRegion from '../internal/components/live-region';\nimport useMouseDownTarget from '../internal/hooks/use-mouse-down-target';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { supportsStickyPosition } from '../internal/utils/dom';\nimport { useInternalI18n } from '../i18n/context';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { AnalyticsFunnelSubStep } from '../internal/analytics/components/analytics-funnel';\n\nexport { CardsProps };\n\nconst Cards = React.forwardRef(function <T = any>(\n {\n items = [],\n cardDefinition,\n cardsPerRow = [],\n header,\n filter,\n pagination,\n preferences,\n empty,\n loading,\n loadingText,\n trackBy,\n selectedItems,\n selectionType,\n isItemDisabled,\n onSelectionChange,\n ariaLabels,\n visibleSections,\n stickyHeader,\n stickyHeaderVerticalOffset,\n variant = 'container',\n renderAriaLive,\n firstIndex,\n totalItemsCount,\n ...rest\n }: CardsProps<T>,\n ref: React.Ref<CardsProps.Ref>\n) {\n const { __internalRootRef } = useBaseComponent('Cards');\n const baseProps = getBaseProps(rest);\n const isRefresh = useVisualRefresh();\n const isMobile = useMobile();\n\n const computedVariant = isRefresh ? variant : 'container';\n const instanceUniqueId = useUniqueId('cards');\n const cardsId = baseProps?.id || instanceUniqueId;\n const cardsHeaderId = header ? `${cardsId}-header` : undefined;\n\n const [columns, measureRef] = useContainerQuery<number>(\n ({ contentBoxWidth }) => getCardsPerRow(contentBoxWidth, cardsPerRow),\n [cardsPerRow]\n );\n const refObject = useRef(null);\n const mergedRef = useMergeRefs(measureRef, refObject, __internalRootRef);\n const getMouseDownTarget = useMouseDownTarget();\n\n const i18n = useInternalI18n('cards');\n const { isItemSelected, getItemSelectionProps, updateShiftToggle } = useSelection({\n items,\n trackBy,\n selectedItems,\n selectionType,\n isItemDisabled,\n onSelectionChange,\n ariaLabels: {\n itemSelectionLabel: ariaLabels?.itemSelectionLabel,\n selectionGroupLabel: i18n('ariaLabels.selectionGroupLabel', ariaLabels?.selectionGroupLabel),\n },\n });\n const hasToolsHeader = header || filter || pagination || preferences;\n const hasFooterPagination = isMobile && variant === 'full-page' && !!pagination;\n const headerRef = useRef<HTMLDivElement>(null);\n\n const { scrollToTop, scrollToItem } = stickyScrolling(refObject, headerRef);\n stickyHeader = supportsStickyPosition() && !isMobile && stickyHeader;\n const onCardFocus: FocusEventHandler<HTMLElement> = event => {\n // When an element inside card receives focus we want to adjust the scroll.\n // However, that behavior is unwanted when the focus is received as result of a click\n // as it causes the click to never reach the target element.\n if (stickyHeader && !event.currentTarget.contains(getMouseDownTarget())) {\n scrollToItem(event.currentTarget);\n }\n };\n useImperativeHandle(\n ref,\n () => ({\n scrollToTop: () => {\n if (stickyHeader) {\n scrollToTop();\n }\n },\n }),\n [stickyHeader, scrollToTop]\n );\n let status;\n if (loading) {\n status = (\n <div className={styles.loading}>\n <InternalStatusIndicator type=\"loading\">\n <LiveRegion visible={true}>{loadingText}</LiveRegion>\n </InternalStatusIndicator>\n </div>\n );\n } else if (empty && !items.length) {\n status = <div className={styles.empty}>{empty}</div>;\n }\n\n return (\n <AnalyticsFunnelSubStep>\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={mergedRef}>\n <InternalContainer\n header={\n hasToolsHeader && (\n <div\n className={clsx(\n styles.header,\n isRefresh && styles['header-refresh'],\n styles[`header-variant-${computedVariant}`]\n )}\n >\n <ToolsHeader header={header} filter={filter} pagination={pagination} preferences={preferences} />\n </div>\n )\n }\n footer={hasFooterPagination && <div className={styles['footer-pagination']}>{pagination}</div>}\n disableContentPaddings={true}\n disableHeaderPaddings={computedVariant === 'full-page'}\n variant={computedVariant === 'container' ? 'cards' : computedVariant}\n __stickyHeader={stickyHeader}\n __stickyOffset={stickyHeaderVerticalOffset}\n __headerRef={headerRef}\n __headerId={cardsHeaderId}\n __darkHeader={computedVariant === 'full-page'}\n __disableFooterDivider={true}\n >\n <div className={clsx(hasToolsHeader && styles['has-header'])}>\n {!!renderAriaLive && !!firstIndex && (\n <LiveRegion>\n <span>{renderAriaLive({ totalItemsCount, firstIndex, lastIndex: firstIndex + items.length - 1 })}</span>\n </LiveRegion>\n )}\n {status ?? (\n <CardsList\n items={items}\n cardDefinition={cardDefinition}\n trackBy={trackBy}\n selectionType={selectionType}\n columns={columns}\n isItemSelected={isItemSelected}\n getItemSelectionProps={getItemSelectionProps}\n visibleSections={visibleSections}\n updateShiftToggle={updateShiftToggle}\n onFocus={onCardFocus}\n ariaLabel={ariaLabels?.cardsLabel}\n ariaLabelledby={ariaLabels?.cardsLabel ? undefined : cardsHeaderId}\n />\n )}\n </div>\n </InternalContainer>\n </div>\n </AnalyticsFunnelSubStep>\n );\n}) as CardsForwardRefType;\n\nexport default Cards;\n\nconst CardsList = <T,>({\n items,\n cardDefinition,\n trackBy,\n selectionType,\n columns,\n isItemSelected,\n getItemSelectionProps,\n visibleSections,\n updateShiftToggle,\n onFocus,\n ariaLabelledby,\n ariaLabel,\n}: Pick<CardsProps<T>, 'items' | 'cardDefinition' | 'trackBy' | 'selectionType' | 'visibleSections'> & {\n columns: number | null;\n isItemSelected: (item: T) => boolean;\n getItemSelectionProps: (item: T) => SelectionControlProps;\n updateShiftToggle: (state: boolean) => void;\n onFocus: FocusEventHandler<HTMLElement>;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}) => {\n const selectable = !!selectionType;\n\n const { moveFocusDown, moveFocusUp } = useFocusMove(selectionType, items.length);\n\n let visibleSectionsDefinition = cardDefinition.sections || [];\n visibleSectionsDefinition = visibleSections\n ? visibleSectionsDefinition.filter(\n (section: CardsProps.SectionDefinition<T>) => section.id && visibleSections.indexOf(section.id) !== -1\n )\n : visibleSectionsDefinition;\n\n let listRole: 'group' | undefined = undefined;\n let listItemRole: 'presentation' | undefined = undefined;\n\n if (selectable) {\n listRole = 'group';\n listItemRole = 'presentation';\n }\n\n return (\n <ol\n className={clsx(styles.list, styles[`list-grid-${columns || 1}`])}\n role={listRole}\n aria-labelledby={ariaLabelledby}\n aria-label={ariaLabel}\n {...(focusMarkers && focusMarkers.root)}\n >\n {items.map((item, index) => (\n <li\n className={clsx(styles.card, {\n [styles['card-selectable']]: selectable,\n [styles['card-selected']]: selectable && isItemSelected(item),\n })}\n key={getItemKey(trackBy, item, index)}\n onFocus={onFocus}\n {...(focusMarkers && focusMarkers.item)}\n role={listItemRole}\n >\n <div className={styles['card-inner']}>\n <div className={styles['card-header']}>\n <div className={styles['card-header-inner']}>\n {cardDefinition.header ? cardDefinition.header(item) : ''}\n </div>\n {selectable && (\n <div className={styles['selection-control']}>\n <SelectionControl\n onFocusDown={moveFocusDown}\n onFocusUp={moveFocusUp}\n onShiftToggle={updateShiftToggle}\n {...getItemSelectionProps(item)}\n />\n </div>\n )}\n </div>\n {visibleSectionsDefinition.map(({ width = 100, header, content, id }, index) => (\n <div key={id || index} className={styles.section} style={{ width: `${width}%` }}>\n {header ? <div className={styles['section-header']}>{header}</div> : ''}\n {content ? <div className={styles['section-content']}>{content(item)}</div> : ''}\n </div>\n ))}\n </div>\n </li>\n ))}\n </ol>\n );\n};\n\napplyDisplayName(Cards, 'Cards');\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["cards/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAqB,mBAAmB,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,gBAA2C,MAAM,4BAA4B,CAAC;AACrF,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,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E,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAC9E,6BAAK,GAAG,EAAE,EAAE,IAAI,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,EAAE;gBAC5E,MAAM,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,IAAG,MAAM,CAAO,CAAC,CAAC,CAAC,EAAE;gBACtE,OAAO,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,IAAG,OAAO,CAAC,IAAI,CAAC,CAAO,CAAC,CAAC,CAAC,EAAE,CAC5E,CACP,CAAC,CACE,CACH,CACN,CAAC,CACC,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { FocusEventHandler, useImperativeHandle, useRef } from 'react';\nimport { CardsForwardRefType, CardsProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { getCardsPerRow } from './cards-layout-helper';\nimport { getBaseProps } from '../internal/base-component';\nimport ToolsHeader from '../table/tools-header';\nimport { getItemKey } from '../table/utils';\nimport { focusMarkers, useFocusMove, useSelection } from '../table/use-selection';\nimport SelectionControl, { SelectionControlProps } from '../table/selection-control';\nimport InternalContainer from '../container/internal';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport stickyScrolling from '../table/sticky-scrolling';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport LiveRegion from '../internal/components/live-region';\nimport useMouseDownTarget from '../internal/hooks/use-mouse-down-target';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { supportsStickyPosition } from '../internal/utils/dom';\nimport { useInternalI18n } from '../i18n/context';\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\nimport { AnalyticsFunnelSubStep } from '../internal/analytics/components/analytics-funnel';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\n\nexport { CardsProps };\n\nconst Cards = React.forwardRef(function <T = any>(\n {\n items = [],\n cardDefinition,\n cardsPerRow = [],\n header,\n filter,\n pagination,\n preferences,\n empty,\n loading,\n loadingText,\n trackBy,\n selectedItems,\n selectionType,\n isItemDisabled,\n onSelectionChange,\n ariaLabels,\n visibleSections,\n stickyHeader,\n stickyHeaderVerticalOffset,\n variant = 'container',\n renderAriaLive,\n firstIndex,\n totalItemsCount,\n ...rest\n }: CardsProps<T>,\n ref: React.Ref<CardsProps.Ref>\n) {\n const { __internalRootRef } = useBaseComponent('Cards');\n const baseProps = getBaseProps(rest);\n const isRefresh = useVisualRefresh();\n const isMobile = useMobile();\n\n const computedVariant = isRefresh ? variant : 'container';\n const instanceUniqueId = useUniqueId('cards');\n const cardsId = baseProps?.id || instanceUniqueId;\n const cardsHeaderId = header ? `${cardsId}-header` : undefined;\n\n const [columns, measureRef] = useContainerQuery<number>(\n ({ contentBoxWidth }) => getCardsPerRow(contentBoxWidth, cardsPerRow),\n [cardsPerRow]\n );\n const refObject = useRef(null);\n const mergedRef = useMergeRefs(measureRef, refObject, __internalRootRef);\n const getMouseDownTarget = useMouseDownTarget();\n\n const i18n = useInternalI18n('cards');\n const { isItemSelected, getItemSelectionProps, updateShiftToggle } = useSelection({\n items,\n trackBy,\n selectedItems,\n selectionType,\n isItemDisabled,\n onSelectionChange,\n ariaLabels: {\n itemSelectionLabel: ariaLabels?.itemSelectionLabel,\n selectionGroupLabel: i18n('ariaLabels.selectionGroupLabel', ariaLabels?.selectionGroupLabel),\n },\n });\n const hasToolsHeader = header || filter || pagination || preferences;\n const hasFooterPagination = isMobile && variant === 'full-page' && !!pagination;\n const headerRef = useRef<HTMLDivElement>(null);\n\n const { scrollToTop, scrollToItem } = stickyScrolling(refObject, headerRef);\n stickyHeader = supportsStickyPosition() && !isMobile && stickyHeader;\n const onCardFocus: FocusEventHandler<HTMLElement> = event => {\n // When an element inside card receives focus we want to adjust the scroll.\n // However, that behavior is unwanted when the focus is received as result of a click\n // as it causes the click to never reach the target element.\n if (stickyHeader && !event.currentTarget.contains(getMouseDownTarget())) {\n scrollToItem(event.currentTarget);\n }\n };\n useImperativeHandle(\n ref,\n () => ({\n scrollToTop: () => {\n if (stickyHeader) {\n scrollToTop();\n }\n },\n }),\n [stickyHeader, scrollToTop]\n );\n let status;\n if (loading) {\n status = (\n <div className={styles.loading}>\n <InternalStatusIndicator type=\"loading\">\n <LiveRegion visible={true}>{loadingText}</LiveRegion>\n </InternalStatusIndicator>\n </div>\n );\n } else if (empty && !items.length) {\n status = <div className={styles.empty}>{empty}</div>;\n }\n\n return (\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <AnalyticsFunnelSubStep>\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={mergedRef}>\n <InternalContainer\n header={\n hasToolsHeader && (\n <div\n className={clsx(\n styles.header,\n isRefresh && styles['header-refresh'],\n styles[`header-variant-${computedVariant}`]\n )}\n >\n <ToolsHeader header={header} filter={filter} pagination={pagination} preferences={preferences} />\n </div>\n )\n }\n footer={hasFooterPagination && <div className={styles['footer-pagination']}>{pagination}</div>}\n disableContentPaddings={true}\n disableHeaderPaddings={computedVariant === 'full-page'}\n variant={computedVariant === 'container' ? 'cards' : computedVariant}\n __stickyHeader={stickyHeader}\n __stickyOffset={stickyHeaderVerticalOffset}\n __headerRef={headerRef}\n __headerId={cardsHeaderId}\n __darkHeader={computedVariant === 'full-page'}\n __disableFooterDivider={true}\n >\n <div className={clsx(hasToolsHeader && styles['has-header'])}>\n {!!renderAriaLive && !!firstIndex && (\n <LiveRegion>\n <span>\n {renderAriaLive({ totalItemsCount, firstIndex, lastIndex: firstIndex + items.length - 1 })}\n </span>\n </LiveRegion>\n )}\n {status ?? (\n <CardsList\n items={items}\n cardDefinition={cardDefinition}\n trackBy={trackBy}\n selectionType={selectionType}\n columns={columns}\n isItemSelected={isItemSelected}\n getItemSelectionProps={getItemSelectionProps}\n visibleSections={visibleSections}\n updateShiftToggle={updateShiftToggle}\n onFocus={onCardFocus}\n ariaLabel={ariaLabels?.cardsLabel}\n ariaLabelledby={ariaLabels?.cardsLabel ? undefined : cardsHeaderId}\n />\n )}\n </div>\n </InternalContainer>\n </div>\n </AnalyticsFunnelSubStep>\n </LinkDefaultVariantContext.Provider>\n );\n}) as CardsForwardRefType;\n\nexport default Cards;\n\nconst CardsList = <T,>({\n items,\n cardDefinition,\n trackBy,\n selectionType,\n columns,\n isItemSelected,\n getItemSelectionProps,\n visibleSections,\n updateShiftToggle,\n onFocus,\n ariaLabelledby,\n ariaLabel,\n}: Pick<CardsProps<T>, 'items' | 'cardDefinition' | 'trackBy' | 'selectionType' | 'visibleSections'> & {\n columns: number | null;\n isItemSelected: (item: T) => boolean;\n getItemSelectionProps: (item: T) => SelectionControlProps;\n updateShiftToggle: (state: boolean) => void;\n onFocus: FocusEventHandler<HTMLElement>;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n}) => {\n const selectable = !!selectionType;\n\n const { moveFocusDown, moveFocusUp } = useFocusMove(selectionType, items.length);\n\n let visibleSectionsDefinition = cardDefinition.sections || [];\n visibleSectionsDefinition = visibleSections\n ? visibleSectionsDefinition.filter(\n (section: CardsProps.SectionDefinition<T>) => section.id && visibleSections.indexOf(section.id) !== -1\n )\n : visibleSectionsDefinition;\n\n let listRole: 'group' | undefined = undefined;\n let listItemRole: 'presentation' | undefined = undefined;\n\n if (selectable) {\n listRole = 'group';\n listItemRole = 'presentation';\n }\n\n return (\n <ol\n className={clsx(styles.list, styles[`list-grid-${columns || 1}`])}\n role={listRole}\n aria-labelledby={ariaLabelledby}\n aria-label={ariaLabel}\n {...(focusMarkers && focusMarkers.root)}\n >\n {items.map((item, index) => (\n <li\n className={clsx(styles.card, {\n [styles['card-selectable']]: selectable,\n [styles['card-selected']]: selectable && isItemSelected(item),\n })}\n key={getItemKey(trackBy, item, index)}\n onFocus={onFocus}\n {...(focusMarkers && focusMarkers.item)}\n role={listItemRole}\n >\n <div className={styles['card-inner']}>\n <div className={styles['card-header']}>\n <div className={styles['card-header-inner']}>\n {cardDefinition.header ? cardDefinition.header(item) : ''}\n </div>\n {selectable && (\n <div className={styles['selection-control']}>\n <SelectionControl\n onFocusDown={moveFocusDown}\n onFocusUp={moveFocusUp}\n onShiftToggle={updateShiftToggle}\n {...getItemSelectionProps(item)}\n />\n </div>\n )}\n </div>\n {visibleSectionsDefinition.map(({ width = 100, header, content, id }, index) => (\n <div key={id || index} className={styles.section} style={{ width: `${width}%` }}>\n {header ? <div className={styles['section-header']}>{header}</div> : ''}\n {content ? <div className={styles['section-content']}>{content(item)}</div> : ''}\n </div>\n ))}\n </div>\n </li>\n ))}\n </ol>\n );\n};\n\napplyDisplayName(Cards, 'Cards');\n"]}
|
package/cards/interfaces.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export interface CardsProps<T = any> extends BaseComponentProps {
|
|
|
44
44
|
/**
|
|
45
45
|
* Defines what to display in each card. It has the following properties:
|
|
46
46
|
* * `header` ((item) => ReactNode) - Responsible for displaying the card header. You receive the current item as an argument.
|
|
47
|
-
* Use `fontSize="
|
|
47
|
+
* Use `fontSize="inherit"` on [link](/components/link/) components inside card header.
|
|
48
48
|
* * `sections` (array) - Responsible for displaying the card content. Cards can have many sections in their
|
|
49
49
|
* body. Each entry in the array is responsible for displaying a section. An entry has the following properties:
|
|
50
50
|
* * `id`: (string) - A unique identifier for the section. The property is used as a [keys](https://reactjs.org/docs/lists-and-keys.html#keys)
|
package/cards/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["cards/interfaces.tsx"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface CardsForwardRefType {\n <T>(props: CardsProps<T> & { ref?: React.Ref<CardsProps.Ref> }): JSX.Element;\n}\n\nexport interface CardsProps<T = any> extends BaseComponentProps {\n /**\n * Displayed only when the list of items is empty.\n */\n empty?: React.ReactNode;\n\n /**\n * Heading element of the table container. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Use this slot to add filtering controls to the component.\n */\n filter?: React.ReactNode;\n\n /**\n * Use this slot to add the [pagination component](/components/pagination/) to the component.\n */\n pagination?: React.ReactNode;\n\n /**\n * Use this slot to add [collection preferences](/components/collection-preferences/) to the component.\n */\n preferences?: React.ReactNode;\n\n /**\n * Specifies the items that serve as data source for a card.\n *\n * The `cardDefinition` property handles the display of this data.\n */\n items: ReadonlyArray<T>;\n\n /**\n * Renders the cards in a loading state. We recommend that you also set a `loadingText`.\n */\n loading?: boolean;\n\n /**\n * Specifies the text to display when in loading state.\n */\n loadingText?: string;\n\n /**\n * Defines what to display in each card. It has the following properties:\n * * `header` ((item) => ReactNode) - Responsible for displaying the card header. You receive the current item as an argument.\n * Use `fontSize=\"
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["cards/interfaces.tsx"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface CardsForwardRefType {\n <T>(props: CardsProps<T> & { ref?: React.Ref<CardsProps.Ref> }): JSX.Element;\n}\n\nexport interface CardsProps<T = any> extends BaseComponentProps {\n /**\n * Displayed only when the list of items is empty.\n */\n empty?: React.ReactNode;\n\n /**\n * Heading element of the table container. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Use this slot to add filtering controls to the component.\n */\n filter?: React.ReactNode;\n\n /**\n * Use this slot to add the [pagination component](/components/pagination/) to the component.\n */\n pagination?: React.ReactNode;\n\n /**\n * Use this slot to add [collection preferences](/components/collection-preferences/) to the component.\n */\n preferences?: React.ReactNode;\n\n /**\n * Specifies the items that serve as data source for a card.\n *\n * The `cardDefinition` property handles the display of this data.\n */\n items: ReadonlyArray<T>;\n\n /**\n * Renders the cards in a loading state. We recommend that you also set a `loadingText`.\n */\n loading?: boolean;\n\n /**\n * Specifies the text to display when in loading state.\n */\n loadingText?: string;\n\n /**\n * Defines what to display in each card. It has the following properties:\n * * `header` ((item) => ReactNode) - Responsible for displaying the card header. You receive the current item as an argument.\n * Use `fontSize=\"inherit\"` on [link](/components/link/) components inside card header.\n * * `sections` (array) - Responsible for displaying the card content. Cards can have many sections in their\n * body. Each entry in the array is responsible for displaying a section. An entry has the following properties:\n * * `id`: (string) - A unique identifier for the section. The property is used as a [keys](https://reactjs.org/docs/lists-and-keys.html#keys)\n * source for React rendering, and to match entries in the `visibleSections` property (if it's defined).\n * * `header`: (ReactNode) - Responsible for displaying the section header.\n * * `content`: ((item) => ReactNode) - Responsible for displaying the section content. You receive the current item as an argument.\n * * `width`: (number) - Specifies the width of the card section in percent. Use this to display multiple sections in\n * the same row. The default value is 100%.\n *\n * All of the above properties are optional.\n */\n cardDefinition: CardsProps.CardDefinition<T>;\n /**\n * Determines the number of cards per row for any interval of container width.\n * It's an array whose entries are objects containing the following:\n * - `cards` (number) - Specifies the number of cards per row.\n * - `minWidth` (number) - Specifies the minimum container width (in pixels) for which this configuration object should apply.\n *\n * For example, with this configuration:\n * ```\n * [{\n * cards: 1\n * }, {\n * minWidth: 500,\n * cards: 2\n * }, {\n * minWidth: 800,\n * cards: 3\n * }]\n * ```\n *\n * the cards component displays:\n * * 1 card per row when the container width is below 500px.\n * * 2 cards per row when the container width is between 500px and 799px.\n * * 3 cards per row when the container width is 800px or wider.\n *\n * The number of cards per row can't be greater than 20.\n *\n * Default value:\n * ```\n * [{\n * cards: 1\n * }, {\n * minWidth: 768,\n * cards: 2\n * }, {\n * minWidth: 992,\n * cards: 3\n * }, {\n * minWidth: 1200,\n * cards: 4\n * }, {\n * minWidth: 1400,\n * cards: 5\n * }, {\n * minWidth: 1920,\n * cards: 6\n * }]\n * ```\n */\n cardsPerRow?: ReadonlyArray<CardsProps.CardsLayout>;\n /**\n * Specifies the property inside items that uniquely identifies them.\n * When it's set, it's used to provide [keys for React](https://reactjs.org/docs/lists-and-keys.html#keys)\n * for performance optimizations.\n *\n * It's also used for connecting `items` and `selectedItems` values when they don't reference the same object.\n */\n trackBy?: CardsProps.TrackBy<T>;\n /**\n * Specifies the selection mode. It can be either `single` or `multi`.\n */\n selectionType?: CardsProps.SelectionType;\n /**\n * Specifies the list of selected items.\n */\n selectedItems?: ReadonlyArray<T>;\n /**\n * Determines which items are disabled. If an item is disabled, users can't select it.\n */\n isItemDisabled?: CardsProps.IsItemDisabled<T>;\n /**\n * Adds labels to the selection components (checkboxes and radio buttons) as follows:\n * * `itemSelectionLabel` ((SelectionState, Item) => string) - Determines the label for an item.\n * * `selectionGroupLabel` (string) - Specifies the label for the group selection control.\n * * `cardsLabel` (string) - Provides alternative text for the cards list.\n * By default the contents of the `header` are used.\n *\n * You can use the first arguments of type `SelectionState` to access the current selection\n * state of the component (for example, the `selectedItems` list). The label function for individual\n * items also receives the corresponding `Item` object. You can use the group label to\n * add a meaningful description to the whole selection.\n * @i18n\n */\n ariaLabels?: CardsProps.AriaLabels<T>;\n /**\n * Specifies an array containing the `id` of each visible section. If not set, all sections are displayed.\n *\n * Use it in conjunction with the visible content preference of the [collection preferences](/components/collection-preferences/) component.\n *\n * The order of `id`s doesn't influence the order of display of sections, which is controlled by the `cardDefinition` property.\n */\n visibleSections?: ReadonlyArray<string>;\n /**\n * Called when a user interaction causes a change in the list of selected items.\n * The event `detail` contains the current list of `selectedItems`.\n */\n onSelectionChange?: NonCancelableEventHandler<CardsProps.SelectionChangeDetail<T>>;\n /**\n * If set to true, the cards header remains visible when the user scrolls down.\n */\n stickyHeader?: boolean;\n /**\n * Optionally provide a vertical offset (in pixels) for the sticky header, for example if you\n * need to position the sticky header below other fixed position elements on the page.\n */\n stickyHeaderVerticalOffset?: number;\n\n /**\n * Use this property to inform screen readers how many cards there are.\n * It specifies the total number of cards.\n * If there is an unknown total number of cards, leave this property undefined. */\n totalItemsCount?: number;\n /**\n * Use this property to inform screen readers which range of cards is currently displayed.\n * It specifies the index (1-based) of the first card.\n * If the cards list has no pagination, leave this property undefined. */\n firstIndex?: number;\n /**\n * Use this function to announce page changes to screen reader users.\n * Requires the properties firstIndex and totalItemsCount to be set correctly.\n */\n renderAriaLive?: (data: CardsProps.LiveAnnouncement) => string;\n\n /**\n * Specify a cards variant with one of the following:\n * * `container` - Use this variant to have the cards displayed as a container.\n * * `full-page` – Use this variant when cards are the entire content of a page. Full page variants\n * implement the high contrast header and content behavior automatically.\n * @visualrefresh `full-page` variant\n */\n variant?: 'container' | 'full-page';\n}\n\nexport namespace CardsProps {\n export interface CardDefinition<T> {\n header?(item: T): React.ReactNode;\n sections?: ReadonlyArray<SectionDefinition<T>>;\n }\n\n export interface SectionDefinition<T> {\n id?: string;\n header?: React.ReactNode;\n content?(item: T): React.ReactNode;\n width?: number;\n }\n\n export interface CardsLayout {\n cards: number;\n minWidth?: number;\n }\n\n export type TrackBy<T> = string | ((item: T) => string);\n\n export type SelectionType = 'single' | 'multi';\n\n export interface SelectionState<T> {\n selectedItems: ReadonlyArray<T>;\n }\n\n export interface SelectionChangeDetail<T> {\n selectedItems: T[];\n }\n\n export type IsItemDisabled<T> = (item: T) => boolean;\n\n export interface AriaLabels<T> {\n itemSelectionLabel: (data: CardsProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel: string;\n cardsLabel?: string;\n }\n\n export interface LiveAnnouncement {\n totalItemsCount?: number;\n firstIndex: number;\n lastIndex: number;\n }\n\n export interface Ref {\n /**\n * When the sticky header is enabled, calling this function scrolls cards's\n * scroll parent up to reveal the first card or row of cards.\n */\n scrollToTop(): void;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["help-panel/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["help-panel/index.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAK9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,SAAS,EAAE,EAAE,cAAc,eAuBjH"}
|
package/help-panel/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
|
10
10
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
11
11
|
import LiveRegion from '../internal/components/live-region';
|
|
12
12
|
import { useInternalI18n } from '../i18n/context';
|
|
13
|
+
import { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';
|
|
13
14
|
export default function HelpPanel(_a) {
|
|
14
15
|
var { header, footer, children, loading, loadingText } = _a, restProps = __rest(_a, ["header", "footer", "children", "loading", "loadingText"]);
|
|
15
16
|
const { __internalRootRef } = useBaseComponent('HelpPanel');
|
|
@@ -20,7 +21,8 @@ export default function HelpPanel(_a) {
|
|
|
20
21
|
React.createElement(InternalStatusIndicator, { type: "loading" },
|
|
21
22
|
React.createElement(LiveRegion, { visible: true }, i18n('loadingText', loadingText))))) : (React.createElement("div", Object.assign({}, containerProps, { ref: __internalRootRef }),
|
|
22
23
|
header && React.createElement("div", { className: clsx(styles.header) }, header),
|
|
23
|
-
React.createElement(
|
|
24
|
+
React.createElement(LinkDefaultVariantContext.Provider, { value: { defaultVariant: 'primary' } },
|
|
25
|
+
React.createElement("div", { className: clsx(styles.content) }, children)),
|
|
24
26
|
footer && React.createElement("div", { className: styles.footer }, footer)));
|
|
25
27
|
}
|
|
26
28
|
applyDisplayName(HelpPanel, 'HelpPanel');
|
package/help-panel/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["help-panel/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AACnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAEpE,OAAO,UAAU,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["help-panel/index.tsx"],"names":[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AG,EAAE,iBAAiB;QAC5C,MAAM,IAAI,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAG,MAAM,CAAO;QAC9D,oBAAC,yBAAyB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE;YACtE,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAG,QAAQ,CAAO,CACnB;QACpC,MAAM,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,IAAG,MAAM,CAAO,CACpD,CACP,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { HelpPanelProps } from './interfaces';\nimport LiveRegion from '../internal/components/live-region';\nimport { useInternalI18n } from '../i18n/context';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\n\nexport { HelpPanelProps };\n\nexport default function HelpPanel({ header, footer, children, loading, loadingText, ...restProps }: HelpPanelProps) {\n const { __internalRootRef } = useBaseComponent('HelpPanel');\n const baseProps = getBaseProps(restProps);\n const i18n = useInternalI18n('help-panel');\n const containerProps = {\n ...baseProps,\n className: clsx(baseProps.className, styles['help-panel']),\n };\n return loading ? (\n <div {...containerProps} ref={__internalRootRef}>\n <InternalStatusIndicator type=\"loading\">\n <LiveRegion visible={true}>{i18n('loadingText', loadingText)}</LiveRegion>\n </InternalStatusIndicator>\n </div>\n ) : (\n <div {...containerProps} ref={__internalRootRef}>\n {header && <div className={clsx(styles.header)}>{header}</div>}\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <div className={clsx(styles.content)}>{children}</div>\n </LinkDefaultVariantContext.Provider>\n {footer && <div className={styles.footer}>{footer}</div>}\n </div>\n );\n}\n\napplyDisplayName(HelpPanel, 'HelpPanel');\n"]}
|
package/help-panel/styles.css.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"help-panel": "awsui_help-
|
|
5
|
-
"header": "
|
|
6
|
-
"content": "
|
|
7
|
-
"footer": "
|
|
4
|
+
"help-panel": "awsui_help-panel_1d237_1n1b3_94",
|
|
5
|
+
"header": "awsui_header_1d237_1n1b3_228",
|
|
6
|
+
"content": "awsui_content_1d237_1n1b3_258",
|
|
7
|
+
"footer": "awsui_footer_1d237_1n1b3_304"
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -91,7 +91,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
93
|
/* stylelint-disable @cloudscape-design/no-implicit-descendant, selector-max-type */
|
|
94
|
-
.awsui_help-
|
|
94
|
+
.awsui_help-panel_1d237_1n1b3_94:not(#\9) {
|
|
95
95
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
96
96
|
border-collapse: separate;
|
|
97
97
|
border-spacing: 0;
|
|
@@ -131,32 +131,32 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
131
131
|
word-wrap: break-word;
|
|
132
132
|
padding: var(--space-scaled-l-0hpmd7, 20px) var(--space-panel-side-right-xofg51, 24px) 0 var(--space-panel-side-left-5t0who, 28px);
|
|
133
133
|
}
|
|
134
|
-
.awsui_help-
|
|
134
|
+
.awsui_help-panel_1d237_1n1b3_94 hr:not(#\9) {
|
|
135
135
|
border: none;
|
|
136
136
|
border-top: var(--border-divider-section-width-4ax5o2, 2px) solid var(--color-border-divider-default-d3adp9, #e9ebed);
|
|
137
137
|
margin: var(--space-scaled-xl-kswcw7, 24px) calc(-1 * var(--space-xs-zb16t3, 8px));
|
|
138
138
|
}
|
|
139
|
-
.awsui_help-
|
|
140
|
-
.awsui_help-
|
|
139
|
+
.awsui_help-panel_1d237_1n1b3_94 ol:not(#\9),
|
|
140
|
+
.awsui_help-panel_1d237_1n1b3_94 ul:not(#\9) {
|
|
141
141
|
padding-left: var(--space-l-t419sm, 20px);
|
|
142
142
|
list-style-position: outside;
|
|
143
143
|
margin: var(--space-s-34lx8l, 12px) 0;
|
|
144
144
|
}
|
|
145
|
-
.awsui_help-
|
|
145
|
+
.awsui_help-panel_1d237_1n1b3_94 li:not(#\9) {
|
|
146
146
|
margin: var(--space-scaled-xxs-7597g1, 4px) 0;
|
|
147
147
|
}
|
|
148
|
-
.awsui_help-
|
|
149
|
-
.awsui_help-
|
|
150
|
-
.awsui_help-
|
|
151
|
-
.awsui_help-
|
|
152
|
-
.awsui_help-
|
|
153
|
-
.awsui_help-
|
|
154
|
-
.awsui_help-
|
|
148
|
+
.awsui_help-panel_1d237_1n1b3_94 a:not(#\9),
|
|
149
|
+
.awsui_help-panel_1d237_1n1b3_94 h2:not(#\9),
|
|
150
|
+
.awsui_help-panel_1d237_1n1b3_94 h3:not(#\9),
|
|
151
|
+
.awsui_help-panel_1d237_1n1b3_94 h4:not(#\9),
|
|
152
|
+
.awsui_help-panel_1d237_1n1b3_94 h5:not(#\9),
|
|
153
|
+
.awsui_help-panel_1d237_1n1b3_94 pre:not(#\9),
|
|
154
|
+
.awsui_help-panel_1d237_1n1b3_94 code:not(#\9) {
|
|
155
155
|
margin: var(--space-xs-zb16t3, 8px) 0;
|
|
156
156
|
padding-top: 0;
|
|
157
157
|
padding-bottom: 0;
|
|
158
158
|
}
|
|
159
|
-
.awsui_help-
|
|
159
|
+
.awsui_help-panel_1d237_1n1b3_94 code:not(#\9) {
|
|
160
160
|
font-size: var(--font-body-s-size-8339kg, 12px);
|
|
161
161
|
line-height: var(--font-body-s-line-height-uztvf6, 16px);
|
|
162
162
|
letter-spacing: var(--font-body-s-letter-spacing-4obhmb, 0.005em);
|
|
@@ -166,7 +166,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
166
166
|
word-wrap: break-word;
|
|
167
167
|
white-space: pre-wrap;
|
|
168
168
|
}
|
|
169
|
-
.awsui_help-
|
|
169
|
+
.awsui_help-panel_1d237_1n1b3_94 pre:not(#\9) {
|
|
170
170
|
font-size: var(--font-body-s-size-8339kg, 12px);
|
|
171
171
|
line-height: var(--font-body-s-line-height-uztvf6, 16px);
|
|
172
172
|
letter-spacing: var(--font-body-s-letter-spacing-4obhmb, 0.005em);
|
|
@@ -177,38 +177,38 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
177
177
|
white-space: pre-wrap;
|
|
178
178
|
padding: var(--space-xxs-p8yyaw, 4px);
|
|
179
179
|
}
|
|
180
|
-
.awsui_help-
|
|
180
|
+
.awsui_help-panel_1d237_1n1b3_94 dl:not(#\9) {
|
|
181
181
|
margin: var(--space-s-34lx8l, 12px) 0;
|
|
182
182
|
/* stylelint-disable-next-line selector-max-universal */
|
|
183
183
|
}
|
|
184
|
-
.awsui_help-
|
|
184
|
+
.awsui_help-panel_1d237_1n1b3_94 dl *:not(#\9) {
|
|
185
185
|
margin-top: 0;
|
|
186
186
|
margin-bottom: 0;
|
|
187
187
|
}
|
|
188
|
-
.awsui_help-
|
|
188
|
+
.awsui_help-panel_1d237_1n1b3_94 dt:not(#\9) {
|
|
189
189
|
margin-top: var(--space-xs-zb16t3, 8px);
|
|
190
190
|
font-weight: 700;
|
|
191
191
|
}
|
|
192
|
-
.awsui_help-
|
|
192
|
+
.awsui_help-panel_1d237_1n1b3_94 dd:not(#\9) {
|
|
193
193
|
margin: 0 0 var(--space-xs-zb16t3, 8px);
|
|
194
194
|
}
|
|
195
|
-
.awsui_help-
|
|
196
|
-
.awsui_help-
|
|
197
|
-
.awsui_help-
|
|
198
|
-
.awsui_help-
|
|
199
|
-
.awsui_help-
|
|
195
|
+
.awsui_help-panel_1d237_1n1b3_94 h2:not(#\9),
|
|
196
|
+
.awsui_help-panel_1d237_1n1b3_94 h3:not(#\9),
|
|
197
|
+
.awsui_help-panel_1d237_1n1b3_94 h4:not(#\9),
|
|
198
|
+
.awsui_help-panel_1d237_1n1b3_94 h5:not(#\9),
|
|
199
|
+
.awsui_help-panel_1d237_1n1b3_94 h6:not(#\9) {
|
|
200
200
|
margin-top: var(--space-xl-lmui9r, 24px);
|
|
201
201
|
color: var(--color-text-heading-default-rtslvy, #000716);
|
|
202
202
|
}
|
|
203
|
-
.awsui_help-
|
|
203
|
+
.awsui_help-panel_1d237_1n1b3_94 > :not(#\9):last-child {
|
|
204
204
|
margin-bottom: var(--space-scaled-xxxl-fdg8ai, 40px);
|
|
205
205
|
}
|
|
206
|
-
.awsui_help-
|
|
206
|
+
.awsui_help-panel_1d237_1n1b3_94 p:not(#\9) {
|
|
207
207
|
color: inherit;
|
|
208
208
|
text-decoration: none;
|
|
209
209
|
margin: var(--space-s-34lx8l, 12px) 0;
|
|
210
210
|
}
|
|
211
|
-
.awsui_help-
|
|
211
|
+
.awsui_help-panel_1d237_1n1b3_94 h1:not(#\9) {
|
|
212
212
|
font-size: var(--font-heading-xl-size-h632xk, 24px);
|
|
213
213
|
line-height: var(--font-heading-xl-line-height-qs40h8, 30px);
|
|
214
214
|
letter-spacing: var(--font-heading-xl-letter-spacing-6telo5, -0.02em);
|
|
@@ -216,7 +216,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
216
216
|
-webkit-font-smoothing: var(--font-smoothing-webkit-m8nc84, antialiased);
|
|
217
217
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-foywby, grayscale);
|
|
218
218
|
}
|
|
219
|
-
.awsui_help-
|
|
219
|
+
.awsui_help-panel_1d237_1n1b3_94 h2:not(#\9) {
|
|
220
220
|
font-size: var(--font-heading-l-size-hknb7q, 20px);
|
|
221
221
|
line-height: var(--font-heading-l-line-height-thvd8z, 24px);
|
|
222
222
|
letter-spacing: var(--font-heading-l-letter-spacing-r9otw4, -0.015em);
|
|
@@ -224,7 +224,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
224
224
|
-webkit-font-smoothing: var(--font-smoothing-webkit-m8nc84, antialiased);
|
|
225
225
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-foywby, grayscale);
|
|
226
226
|
}
|
|
227
|
-
.awsui_help-
|
|
227
|
+
.awsui_help-panel_1d237_1n1b3_94 h3:not(#\9) {
|
|
228
228
|
font-size: var(--font-heading-m-size-ytqm4n, 18px);
|
|
229
229
|
line-height: var(--font-heading-m-line-height-bk6bii, 22px);
|
|
230
230
|
letter-spacing: var(--font-heading-m-letter-spacing-fefyfv, -0.01em);
|
|
@@ -232,7 +232,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
232
232
|
-webkit-font-smoothing: var(--font-smoothing-webkit-m8nc84, antialiased);
|
|
233
233
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-foywby, grayscale);
|
|
234
234
|
}
|
|
235
|
-
.awsui_help-
|
|
235
|
+
.awsui_help-panel_1d237_1n1b3_94 h4:not(#\9) {
|
|
236
236
|
font-size: var(--font-heading-s-size-5q52fl, 16px);
|
|
237
237
|
line-height: var(--font-heading-s-line-height-w6crw0, 20px);
|
|
238
238
|
letter-spacing: var(--font-heading-s-letter-spacing-ebpsb6, -0.005em);
|
|
@@ -240,18 +240,18 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
240
240
|
-webkit-font-smoothing: var(--font-smoothing-webkit-m8nc84, antialiased);
|
|
241
241
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-foywby, grayscale);
|
|
242
242
|
}
|
|
243
|
-
.awsui_help-
|
|
243
|
+
.awsui_help-panel_1d237_1n1b3_94 h5:not(#\9) {
|
|
244
244
|
font-size: var(--font-heading-xs-size-d24gfe, 14px);
|
|
245
245
|
line-height: var(--font-heading-xs-line-height-gyxcvc, 18px);
|
|
246
246
|
font-weight: var(--font-heading-xs-weight-dcgvdt, 700);
|
|
247
247
|
-webkit-font-smoothing: var(--font-smoothing-webkit-m8nc84, antialiased);
|
|
248
248
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-foywby, grayscale);
|
|
249
249
|
}
|
|
250
|
-
.awsui_help-
|
|
251
|
-
.awsui_help-
|
|
250
|
+
.awsui_help-panel_1d237_1n1b3_94 b:not(#\9),
|
|
251
|
+
.awsui_help-panel_1d237_1n1b3_94 strong:not(#\9) {
|
|
252
252
|
font-weight: 700;
|
|
253
253
|
}
|
|
254
|
-
.awsui_help-
|
|
254
|
+
.awsui_help-panel_1d237_1n1b3_94 .awsui_header_1d237_1n1b3_228:not(#\9) {
|
|
255
255
|
font-size: var(--font-panel-header-size-edjz3l, 18px);
|
|
256
256
|
line-height: var(--font-panel-header-line-height-kxi4u2, 22px);
|
|
257
257
|
font-weight: var(--font-heading-l-weight-a4lz4s, 700);
|
|
@@ -265,11 +265,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
265
265
|
border-bottom: var(--border-divider-section-width-4ax5o2, 2px) solid var(--color-border-divider-default-d3adp9, #e9ebed);
|
|
266
266
|
margin: 0 calc(-1 * var(--space-panel-side-right-xofg51, 24px)) var(--space-scaled-l-0hpmd7, 20px) calc(-1 * var(--space-panel-side-left-5t0who, 28px));
|
|
267
267
|
}
|
|
268
|
-
.awsui_help-
|
|
269
|
-
.awsui_help-
|
|
270
|
-
.awsui_help-
|
|
271
|
-
.awsui_help-
|
|
272
|
-
.awsui_help-
|
|
268
|
+
.awsui_help-panel_1d237_1n1b3_94 .awsui_header_1d237_1n1b3_228 h2:not(#\9),
|
|
269
|
+
.awsui_help-panel_1d237_1n1b3_94 .awsui_header_1d237_1n1b3_228 h3:not(#\9),
|
|
270
|
+
.awsui_help-panel_1d237_1n1b3_94 .awsui_header_1d237_1n1b3_228 h4:not(#\9),
|
|
271
|
+
.awsui_help-panel_1d237_1n1b3_94 .awsui_header_1d237_1n1b3_228 h5:not(#\9),
|
|
272
|
+
.awsui_help-panel_1d237_1n1b3_94 .awsui_header_1d237_1n1b3_228 h6:not(#\9) {
|
|
273
273
|
font-size: var(--font-panel-header-size-edjz3l, 18px);
|
|
274
274
|
line-height: var(--font-panel-header-line-height-kxi4u2, 22px);
|
|
275
275
|
font-weight: var(--font-heading-l-weight-a4lz4s, 700);
|
|
@@ -281,69 +281,68 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
281
281
|
margin-bottom: 0;
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
.
|
|
284
|
+
.awsui_content_1d237_1n1b3_258:not(#\9) {
|
|
285
285
|
color: var(--color-text-body-secondary-so8znq, #414d5c);
|
|
286
286
|
}
|
|
287
|
-
.
|
|
288
|
-
.
|
|
289
|
-
.
|
|
290
|
-
.
|
|
291
|
-
.
|
|
287
|
+
.awsui_content_1d237_1n1b3_258 h2:not(#\9):first-child,
|
|
288
|
+
.awsui_content_1d237_1n1b3_258 h3:not(#\9):first-child,
|
|
289
|
+
.awsui_content_1d237_1n1b3_258 h4:not(#\9):first-child,
|
|
290
|
+
.awsui_content_1d237_1n1b3_258 h5:not(#\9):first-child,
|
|
291
|
+
.awsui_content_1d237_1n1b3_258 h6:not(#\9):first-child {
|
|
292
292
|
margin-top: 0;
|
|
293
293
|
}
|
|
294
|
-
.
|
|
294
|
+
.awsui_content_1d237_1n1b3_258 a:not(#\9) {
|
|
295
295
|
color: var(--color-text-link-default-latg1a, #0972d3);
|
|
296
|
-
font-weight:
|
|
297
|
-
letter-spacing:
|
|
298
|
-
|
|
299
|
-
text-decoration: var(--font-link-primary-decoration-cp88s8, underline);
|
|
296
|
+
font-weight: inherit;
|
|
297
|
+
letter-spacing: normal;
|
|
298
|
+
text-decoration: underline;
|
|
300
299
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
301
|
-
text-decoration-color:
|
|
300
|
+
text-decoration-color: currentColor;
|
|
302
301
|
transition-property: color, -webkit-text-decoration;
|
|
303
302
|
transition-property: color, text-decoration;
|
|
304
303
|
transition-property: color, text-decoration, -webkit-text-decoration;
|
|
305
304
|
transition-duration: var(--motion-duration-refresh-only-medium-nf6485, 165ms);
|
|
306
305
|
}
|
|
307
306
|
@media (prefers-reduced-motion: reduce) {
|
|
308
|
-
.
|
|
307
|
+
.awsui_content_1d237_1n1b3_258 a:not(#\9) {
|
|
309
308
|
animation: none;
|
|
310
309
|
transition: none;
|
|
311
310
|
}
|
|
312
311
|
}
|
|
313
|
-
.awsui-motion-disabled .
|
|
312
|
+
.awsui-motion-disabled .awsui_content_1d237_1n1b3_258 a:not(#\9), .awsui-mode-entering .awsui_content_1d237_1n1b3_258 a:not(#\9) {
|
|
314
313
|
animation: none;
|
|
315
314
|
transition: none;
|
|
316
315
|
}
|
|
317
|
-
.
|
|
316
|
+
.awsui_content_1d237_1n1b3_258 a:not(#\9):hover {
|
|
318
317
|
cursor: pointer;
|
|
319
318
|
color: var(--color-text-link-hover-8j6p14, #033160);
|
|
320
319
|
}
|
|
321
|
-
.
|
|
320
|
+
.awsui_content_1d237_1n1b3_258 a:not(#\9):focus {
|
|
322
321
|
outline: none;
|
|
323
322
|
}
|
|
324
|
-
.
|
|
323
|
+
.awsui_content_1d237_1n1b3_258 a:not(#\9):active {
|
|
325
324
|
color: var(--color-text-link-hover-8j6p14, #033160);
|
|
326
325
|
}
|
|
327
|
-
.
|
|
326
|
+
.awsui_content_1d237_1n1b3_258 a:not(#\9):active, .awsui_content_1d237_1n1b3_258 a:not(#\9):focus, .awsui_content_1d237_1n1b3_258 a:not(#\9):hover {
|
|
328
327
|
text-decoration: underline;
|
|
329
328
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
330
329
|
text-decoration-color: currentColor;
|
|
331
330
|
}
|
|
332
331
|
|
|
333
|
-
.
|
|
332
|
+
.awsui_footer_1d237_1n1b3_304:not(#\9) {
|
|
334
333
|
color: var(--color-text-body-secondary-so8znq, #414d5c);
|
|
335
334
|
border-top: var(--border-divider-section-width-4ax5o2, 2px) solid var(--color-border-divider-default-d3adp9, #e9ebed);
|
|
336
335
|
margin: var(--space-scaled-xl-kswcw7, 24px) calc(-1 * var(--space-xs-zb16t3, 8px));
|
|
337
336
|
padding: 0 var(--space-s-34lx8l, 12px);
|
|
338
337
|
}
|
|
339
|
-
.
|
|
338
|
+
.awsui_footer_1d237_1n1b3_304 > :not(#\9):first-child {
|
|
340
339
|
margin-top: var(--space-scaled-xl-kswcw7, 24px);
|
|
341
340
|
}
|
|
342
|
-
.
|
|
341
|
+
.awsui_footer_1d237_1n1b3_304 ul:not(#\9) {
|
|
343
342
|
list-style: none;
|
|
344
343
|
padding-left: 0;
|
|
345
344
|
}
|
|
346
|
-
.
|
|
345
|
+
.awsui_footer_1d237_1n1b3_304 a:not(#\9) {
|
|
347
346
|
color: var(--color-text-link-default-latg1a, #0972d3);
|
|
348
347
|
font-weight: inherit;
|
|
349
348
|
letter-spacing: normal;
|
|
@@ -356,33 +355,33 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
356
355
|
transition-duration: var(--motion-duration-refresh-only-medium-nf6485, 165ms);
|
|
357
356
|
}
|
|
358
357
|
@media (prefers-reduced-motion: reduce) {
|
|
359
|
-
.
|
|
358
|
+
.awsui_footer_1d237_1n1b3_304 a:not(#\9) {
|
|
360
359
|
animation: none;
|
|
361
360
|
transition: none;
|
|
362
361
|
}
|
|
363
362
|
}
|
|
364
|
-
.awsui-motion-disabled .
|
|
363
|
+
.awsui-motion-disabled .awsui_footer_1d237_1n1b3_304 a:not(#\9), .awsui-mode-entering .awsui_footer_1d237_1n1b3_304 a:not(#\9) {
|
|
365
364
|
animation: none;
|
|
366
365
|
transition: none;
|
|
367
366
|
}
|
|
368
|
-
.
|
|
367
|
+
.awsui_footer_1d237_1n1b3_304 a:not(#\9):hover {
|
|
369
368
|
cursor: pointer;
|
|
370
369
|
color: var(--color-text-link-hover-8j6p14, #033160);
|
|
371
370
|
}
|
|
372
|
-
.
|
|
371
|
+
.awsui_footer_1d237_1n1b3_304 a:not(#\9):focus {
|
|
373
372
|
outline: none;
|
|
374
373
|
}
|
|
375
|
-
.
|
|
374
|
+
.awsui_footer_1d237_1n1b3_304 a:not(#\9):active {
|
|
376
375
|
color: var(--color-text-link-hover-8j6p14, #033160);
|
|
377
376
|
}
|
|
378
|
-
.
|
|
377
|
+
.awsui_footer_1d237_1n1b3_304 a:not(#\9):active, .awsui_footer_1d237_1n1b3_304 a:not(#\9):focus, .awsui_footer_1d237_1n1b3_304 a:not(#\9):hover {
|
|
379
378
|
text-decoration: underline;
|
|
380
379
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
381
380
|
text-decoration-color: currentColor;
|
|
382
381
|
}
|
|
383
382
|
|
|
384
|
-
.
|
|
385
|
-
.
|
|
383
|
+
.awsui_content_1d237_1n1b3_258 a:not(#\9):focus,
|
|
384
|
+
.awsui_footer_1d237_1n1b3_304 a:not(#\9):focus {
|
|
386
385
|
outline: thin dotted;
|
|
387
386
|
outline: var(--border-link-focus-ring-outline-kkfop6, 0);
|
|
388
387
|
outline-offset: 2px;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"help-panel": "awsui_help-
|
|
6
|
-
"header": "
|
|
7
|
-
"content": "
|
|
8
|
-
"footer": "
|
|
5
|
+
"help-panel": "awsui_help-panel_1d237_1n1b3_94",
|
|
6
|
+
"header": "awsui_header_1d237_1n1b3_228",
|
|
7
|
+
"content": "awsui_content_1d237_1n1b3_258",
|
|
8
|
+
"footer": "awsui_footer_1d237_1n1b3_304"
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -346,7 +346,6 @@
|
|
|
346
346
|
--color-text-link-inverted-hover-09cw7h:#ffffff;
|
|
347
347
|
--color-text-link-button-underline-ik5r9i:transparent;
|
|
348
348
|
--color-text-link-button-underline-hover-gyir88:transparent;
|
|
349
|
-
--color-text-link-primary-underline-gvxbge:#0972d3;
|
|
350
349
|
--color-text-notification-default-rdawv9:#fbfbfb;
|
|
351
350
|
--color-text-notification-stack-bar-jc9tvx:#ffffff;
|
|
352
351
|
--color-text-notification-yellow-p027cz:#000716;
|
|
@@ -409,9 +408,6 @@
|
|
|
409
408
|
--font-box-value-large-weight-onoq9k:700;
|
|
410
409
|
--font-link-button-letter-spacing-yi9f0l:0.005em;
|
|
411
410
|
--font-link-button-weight-jephf1:700;
|
|
412
|
-
--font-link-primary-decoration-cp88s8:underline;
|
|
413
|
-
--font-link-primary-letter-spacing-uqaf5f:"inherit";
|
|
414
|
-
--font-link-primary-weight-k726vk:"inherit";
|
|
415
411
|
--font-panel-header-line-height-kxi4u2:22px;
|
|
416
412
|
--font-panel-header-size-edjz3l:18px;
|
|
417
413
|
--font-smoothing-webkit-m8nc84:antialiased;
|
|
@@ -921,7 +917,6 @@
|
|
|
921
917
|
--color-text-layout-toggle-selected-b93usl:#000716;
|
|
922
918
|
--color-text-link-default-latg1a:#539fe5;
|
|
923
919
|
--color-text-link-hover-8j6p14:#89bdee;
|
|
924
|
-
--color-text-link-primary-underline-gvxbge:#539fe5;
|
|
925
920
|
--color-text-pagination-page-number-active-disabled-pnozll:#5f6b7a;
|
|
926
921
|
--color-text-pagination-page-number-default-i8se09:#9ba7b6;
|
|
927
922
|
--color-text-segment-active-6s77n9:#000716;
|
|
@@ -1199,7 +1194,6 @@
|
|
|
1199
1194
|
--color-text-layout-toggle-selected-b93usl:#000716;
|
|
1200
1195
|
--color-text-link-default-latg1a:#539fe5;
|
|
1201
1196
|
--color-text-link-hover-8j6p14:#89bdee;
|
|
1202
|
-
--color-text-link-primary-underline-gvxbge:#539fe5;
|
|
1203
1197
|
--color-text-pagination-page-number-active-disabled-pnozll:#5f6b7a;
|
|
1204
1198
|
--color-text-pagination-page-number-default-i8se09:#9ba7b6;
|
|
1205
1199
|
--color-text-segment-active-6s77n9:#000716;
|
|
@@ -1382,7 +1376,6 @@
|
|
|
1382
1376
|
--color-text-layout-toggle-selected-b93usl:#000716;
|
|
1383
1377
|
--color-text-link-default-latg1a:#539fe5;
|
|
1384
1378
|
--color-text-link-hover-8j6p14:#89bdee;
|
|
1385
|
-
--color-text-link-primary-underline-gvxbge:#539fe5;
|
|
1386
1379
|
--color-text-pagination-page-number-active-disabled-pnozll:#5f6b7a;
|
|
1387
1380
|
--color-text-pagination-page-number-default-i8se09:#9ba7b6;
|
|
1388
1381
|
--color-text-segment-active-6s77n9:#000716;
|
|
@@ -1653,7 +1646,6 @@
|
|
|
1653
1646
|
--color-text-layout-toggle-selected-b93usl:#000716;
|
|
1654
1647
|
--color-text-link-default-latg1a:#539fe5;
|
|
1655
1648
|
--color-text-link-hover-8j6p14:#89bdee;
|
|
1656
|
-
--color-text-link-primary-underline-gvxbge:#539fe5;
|
|
1657
1649
|
--color-text-pagination-page-number-active-disabled-pnozll:#5f6b7a;
|
|
1658
1650
|
--color-text-pagination-page-number-default-i8se09:#9ba7b6;
|
|
1659
1651
|
--color-text-segment-active-6s77n9:#000716;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-default-variant-context.d.ts","sourceRoot":"lib/default/","sources":["internal/context/link-default-variant-context.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,eAAO,MAAM,yBAAyB;oBAAmC,UAAU,OAAO;EAExF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { createContext } from 'react';
|
|
4
|
+
export const LinkDefaultVariantContext = createContext({
|
|
5
|
+
defaultVariant: 'secondary',
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=link-default-variant-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-default-variant-context.js","sourceRoot":"lib/default/","sources":["internal/context/link-default-variant-context.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,MAAM,CAAC,MAAM,yBAAyB,GAAG,aAAa,CAAwC;IAC5F,cAAc,EAAE,WAAW;CAC5B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { createContext } from 'react';\nimport { LinkProps } from '../../link/interfaces';\n\nexport const LinkDefaultVariantContext = createContext<{ defaultVariant: LinkProps.Variant }>({\n defaultVariant: 'secondary',\n});\n"]}
|
package/internal/environment.js
CHANGED