@cloudscape-design/components-themeable 3.0.1401 → 3.0.1403
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/action-card/mixins.scss +18 -4
- package/lib/internal/scss/action-card/styles.scss +63 -13
- package/lib/internal/scss/button/styles.scss +3 -0
- package/lib/internal/scss/copy-to-clipboard/styles.scss +0 -41
- package/lib/internal/scss/icon/hover-motion.scss +98 -60
- package/lib/internal/scss/internal/components/sticky-scrollbar/mixins.scss +10 -0
- package/lib/internal/scss/{table → internal/components}/sticky-scrollbar/styles.scss +2 -2
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/item-card/styles.scss +103 -13
- package/lib/internal/scss/table-root/styles.scss +3 -0
- package/lib/internal/scss/tabs/styles.scss +0 -1
- package/lib/internal/scss/tabs/tab-header-bar.scss +20 -42
- package/lib/internal/scss/token/styles.scss +1 -0
- package/lib/internal/template/action-card/internal.d.ts +10 -2
- package/lib/internal/template/action-card/internal.d.ts.map +1 -1
- package/lib/internal/template/action-card/internal.js +5 -5
- package/lib/internal/template/action-card/internal.js.map +1 -1
- package/lib/internal/template/action-card/styles.css.js +18 -17
- package/lib/internal/template/action-card/styles.scoped.css +274 -202
- package/lib/internal/template/action-card/styles.selectors.js +18 -17
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js +3 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/toolbar-container.js.map +1 -1
- package/lib/internal/template/button/styles.css.js +24 -24
- package/lib/internal/template/button/styles.scoped.css +83 -79
- package/lib/internal/template/button/styles.selectors.js +24 -24
- package/lib/internal/template/button-dropdown/filter.d.ts +1 -1
- package/lib/internal/template/copy-to-clipboard/internal.d.ts.map +1 -1
- package/lib/internal/template/copy-to-clipboard/internal.js +16 -36
- package/lib/internal/template/copy-to-clipboard/internal.js.map +1 -1
- package/lib/internal/template/copy-to-clipboard/styles.css.js +5 -10
- package/lib/internal/template/copy-to-clipboard/styles.scoped.css +6 -38
- package/lib/internal/template/copy-to-clipboard/styles.selectors.js +5 -10
- package/lib/internal/template/icon/generated/icons.d.ts +1 -1
- package/lib/internal/template/icon/generated/icons.js +3 -3
- package/lib/internal/template/icon/generated/icons.js.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.d.ts +1 -1
- package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/base-theme/styles.scoped.css +1 -0
- package/lib/internal/template/internal/components/listbox/interfaces.d.ts +13 -0
- package/lib/internal/template/internal/components/listbox/interfaces.d.ts.map +1 -0
- package/lib/internal/template/internal/components/listbox/interfaces.js +2 -0
- package/lib/internal/template/internal/components/listbox/interfaces.js.map +1 -0
- package/lib/internal/template/internal/components/listbox/parts/get-item-props.d.ts +1 -2
- package/lib/internal/template/internal/components/listbox/parts/get-item-props.d.ts.map +1 -1
- package/lib/internal/template/internal/components/listbox/parts/get-item-props.js +1 -2
- package/lib/internal/template/internal/components/listbox/parts/get-item-props.js.map +1 -1
- package/lib/internal/template/internal/components/listbox/parts/item.d.ts +44 -0
- package/lib/internal/template/internal/components/listbox/parts/item.d.ts.map +1 -0
- package/lib/internal/template/internal/components/listbox/parts/item.js +184 -0
- package/lib/internal/template/internal/components/listbox/parts/item.js.map +1 -0
- package/lib/internal/template/internal/components/listbox/parts/plain-list.d.ts +24 -0
- package/lib/internal/template/internal/components/listbox/parts/plain-list.d.ts.map +1 -0
- package/lib/internal/template/{select → internal/components/listbox}/parts/plain-list.js +9 -10
- package/lib/internal/template/internal/components/listbox/parts/plain-list.js.map +1 -0
- package/lib/internal/template/internal/components/listbox/parts/render-options.d.ts +3 -3
- package/lib/internal/template/internal/components/listbox/parts/render-options.d.ts.map +1 -1
- package/lib/internal/template/internal/components/listbox/parts/render-options.js +3 -6
- package/lib/internal/template/internal/components/listbox/parts/render-options.js.map +1 -1
- package/lib/internal/template/internal/components/listbox/use-listbox.d.ts +85 -0
- package/lib/internal/template/internal/components/listbox/use-listbox.d.ts.map +1 -0
- package/lib/internal/template/internal/components/listbox/use-listbox.js +117 -0
- package/lib/internal/template/internal/components/listbox/use-listbox.js.map +1 -0
- package/lib/internal/template/internal/components/listbox/use-type-ahead.d.ts +13 -0
- package/lib/internal/template/internal/components/listbox/use-type-ahead.d.ts.map +1 -0
- package/lib/internal/template/{select/utils/use-native-search.js → internal/components/listbox/use-type-ahead.js} +8 -8
- package/lib/internal/template/internal/components/listbox/use-type-ahead.js.map +1 -0
- package/lib/internal/template/internal/components/listbox/utils/navigation.d.ts +20 -0
- package/lib/internal/template/internal/components/listbox/utils/navigation.d.ts.map +1 -0
- package/lib/internal/template/internal/components/listbox/utils/navigation.js +22 -0
- package/lib/internal/template/internal/components/listbox/utils/navigation.js.map +1 -0
- package/lib/internal/template/internal/components/listbox/utils/option-props.d.ts +32 -0
- package/lib/internal/template/internal/components/listbox/utils/option-props.d.ts.map +1 -0
- package/lib/internal/template/internal/components/listbox/utils/option-props.js +51 -0
- package/lib/internal/template/internal/components/listbox/utils/option-props.js.map +1 -0
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.d.ts +1 -1
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.d.ts.map +1 -1
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.js +2 -2
- package/lib/internal/template/internal/components/options-list/utils/use-keyboard.js.map +1 -1
- package/lib/internal/template/internal/components/sticky-scrollbar/index.d.ts.map +1 -0
- package/lib/internal/template/internal/components/sticky-scrollbar/index.js.map +1 -0
- package/lib/internal/template/{table → internal/components}/sticky-scrollbar/sticky-scrollbar.d.ts +2 -1
- package/lib/internal/template/internal/components/sticky-scrollbar/sticky-scrollbar.d.ts.map +1 -0
- package/lib/internal/template/{table → internal/components}/sticky-scrollbar/sticky-scrollbar.js +8 -5
- package/lib/internal/template/internal/components/sticky-scrollbar/sticky-scrollbar.js.map +1 -0
- package/lib/internal/template/internal/components/sticky-scrollbar/styles.css.js +11 -0
- package/lib/internal/template/{table → internal/components}/sticky-scrollbar/styles.scoped.css +8 -8
- package/lib/internal/template/internal/components/sticky-scrollbar/styles.selectors.js +12 -0
- package/lib/internal/template/internal/components/sticky-scrollbar/use-sticky-scrollbar.d.ts +10 -0
- package/lib/internal/template/internal/components/sticky-scrollbar/use-sticky-scrollbar.d.ts.map +1 -0
- package/lib/internal/template/{table → internal/components}/sticky-scrollbar/use-sticky-scrollbar.js +17 -16
- package/lib/internal/template/internal/components/sticky-scrollbar/use-sticky-scrollbar.js.map +1 -0
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +1 -0
- package/lib/internal/template/internal/generated/styles/tokens.js +1 -0
- package/lib/internal/template/internal/generated/theming/index.cjs +4 -0
- package/lib/internal/template/internal/generated/theming/index.d.cts +9 -0
- package/lib/internal/template/internal/generated/theming/index.d.ts +9 -0
- package/lib/internal/template/internal/generated/theming/index.js +4 -0
- package/lib/internal/template/item-card/internal.d.ts +10 -1
- package/lib/internal/template/item-card/internal.d.ts.map +1 -1
- package/lib/internal/template/item-card/internal.js +4 -4
- package/lib/internal/template/item-card/internal.js.map +1 -1
- package/lib/internal/template/item-card/style.d.ts.map +1 -1
- package/lib/internal/template/item-card/style.js +6 -1
- package/lib/internal/template/item-card/style.js.map +1 -1
- package/lib/internal/template/item-card/styles.css.js +14 -14
- package/lib/internal/template/item-card/styles.scoped.css +125 -63
- package/lib/internal/template/item-card/styles.selectors.js +14 -14
- package/lib/internal/template/multiselect/embedded.d.ts.map +1 -1
- package/lib/internal/template/multiselect/embedded.js +2 -2
- package/lib/internal/template/multiselect/embedded.js.map +1 -1
- package/lib/internal/template/multiselect/internal.d.ts.map +1 -1
- package/lib/internal/template/multiselect/internal.js +2 -2
- package/lib/internal/template/multiselect/internal.js.map +1 -1
- package/lib/internal/template/multiselect/use-multiselect.d.ts +2 -3
- package/lib/internal/template/multiselect/use-multiselect.d.ts.map +1 -1
- package/lib/internal/template/multiselect/use-multiselect.js +7 -18
- package/lib/internal/template/multiselect/use-multiselect.js.map +1 -1
- package/lib/internal/template/select/internal.d.ts.map +1 -1
- package/lib/internal/template/select/internal.js +9 -19
- package/lib/internal/template/select/internal.js.map +1 -1
- package/lib/internal/template/select/parts/filter.d.ts +1 -1
- package/lib/internal/template/select/parts/virtual-list.d.ts +3 -2
- package/lib/internal/template/select/parts/virtual-list.d.ts.map +1 -1
- package/lib/internal/template/select/parts/virtual-list.js +7 -8
- package/lib/internal/template/select/parts/virtual-list.js.map +1 -1
- package/lib/internal/template/select/utils/use-select.d.ts +15 -11
- package/lib/internal/template/select/utils/use-select.d.ts.map +1 -1
- package/lib/internal/template/select/utils/use-select.js +41 -117
- package/lib/internal/template/select/utils/use-select.js.map +1 -1
- package/lib/internal/template/styling/action-card.scss +56 -0
- package/lib/internal/template/styling/item-card.scss +81 -0
- package/lib/internal/template/table/internal.d.ts.map +1 -1
- package/lib/internal/template/table/internal.js +1 -1
- package/lib/internal/template/table/internal.js.map +1 -1
- package/lib/internal/template/table-root/internal.d.ts.map +1 -1
- package/lib/internal/template/table-root/internal.js +17 -3
- package/lib/internal/template/table-root/internal.js.map +1 -1
- package/lib/internal/template/table-root/styles.css.js +5 -5
- package/lib/internal/template/table-root/styles.scoped.css +10 -6
- package/lib/internal/template/table-root/styles.selectors.js +5 -5
- package/lib/internal/template/tabs/styles.css.js +30 -31
- package/lib/internal/template/tabs/styles.scoped.css +51 -67
- package/lib/internal/template/tabs/styles.selectors.js +30 -31
- package/lib/internal/template/tabs/tab-header-bar.d.ts.map +1 -1
- package/lib/internal/template/tabs/tab-header-bar.js +5 -54
- package/lib/internal/template/tabs/tab-header-bar.js.map +1 -1
- package/lib/internal/template/toggle/internal.d.ts.map +1 -1
- package/lib/internal/template/toggle/internal.js +1 -1
- package/lib/internal/template/toggle/internal.js.map +1 -1
- package/lib/internal/template/token/styles.css.js +14 -14
- package/lib/internal/template/token/styles.scoped.css +25 -24
- package/lib/internal/template/token/styles.selectors.js +14 -14
- package/package.json +1 -1
- package/lib/internal/scss/copy-to-clipboard/motion.scss +0 -31
- package/lib/internal/scss/tabs/motion.scss +0 -22
- package/lib/internal/template/select/parts/item.d.ts +0 -34
- package/lib/internal/template/select/parts/item.d.ts.map +0 -1
- package/lib/internal/template/select/parts/item.js +0 -94
- package/lib/internal/template/select/parts/item.js.map +0 -1
- package/lib/internal/template/select/parts/multiselect-item.d.ts +0 -15
- package/lib/internal/template/select/parts/multiselect-item.d.ts.map +0 -1
- package/lib/internal/template/select/parts/multiselect-item.js +0 -112
- package/lib/internal/template/select/parts/multiselect-item.js.map +0 -1
- package/lib/internal/template/select/parts/plain-list.d.ts +0 -27
- package/lib/internal/template/select/parts/plain-list.d.ts.map +0 -1
- package/lib/internal/template/select/parts/plain-list.js.map +0 -1
- package/lib/internal/template/select/utils/use-native-search.d.ts +0 -13
- package/lib/internal/template/select/utils/use-native-search.d.ts.map +0 -1
- package/lib/internal/template/select/utils/use-native-search.js.map +0 -1
- package/lib/internal/template/table/sticky-scrollbar/index.d.ts.map +0 -1
- package/lib/internal/template/table/sticky-scrollbar/index.js.map +0 -1
- package/lib/internal/template/table/sticky-scrollbar/sticky-scrollbar.d.ts.map +0 -1
- package/lib/internal/template/table/sticky-scrollbar/sticky-scrollbar.js.map +0 -1
- package/lib/internal/template/table/sticky-scrollbar/styles.css.js +0 -11
- package/lib/internal/template/table/sticky-scrollbar/styles.selectors.js +0 -12
- package/lib/internal/template/table/sticky-scrollbar/use-sticky-scrollbar.d.ts +0 -4
- package/lib/internal/template/table/sticky-scrollbar/use-sticky-scrollbar.d.ts.map +0 -1
- package/lib/internal/template/table/sticky-scrollbar/use-sticky-scrollbar.js.map +0 -1
- /package/lib/internal/template/{table → internal/components}/sticky-scrollbar/index.d.ts +0 -0
- /package/lib/internal/template/{table → internal/components}/sticky-scrollbar/index.js +0 -0
package/lib/internal/template/{table → internal/components}/sticky-scrollbar/sticky-scrollbar.js
RENAMED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import React, { forwardRef } from 'react';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';
|
|
6
|
-
import { useIntersectionObserver } from '../../
|
|
7
|
-
import { useVisualRefresh } from '../../
|
|
8
|
-
import { browserScrollbarSize } from '../../
|
|
6
|
+
import { useIntersectionObserver } from '../../hooks/use-intersection-observer';
|
|
7
|
+
import { useVisualRefresh } from '../../hooks/use-visual-mode';
|
|
8
|
+
import { browserScrollbarSize } from '../../utils/browser-scrollbar-size';
|
|
9
9
|
import { useStickyScrollbar } from './use-sticky-scrollbar';
|
|
10
10
|
import styles from './styles.css.js';
|
|
11
11
|
export default forwardRef(StickyScrollbar);
|
|
12
|
-
function StickyScrollbar({ wrapperRef, tableRef, onScroll, hasStickyColumns }, ref) {
|
|
12
|
+
function StickyScrollbar({ wrapperRef, tableRef, onScroll, hasStickyColumns, getContentInlineSize, contentKey }, ref) {
|
|
13
13
|
const isVisualRefresh = useVisualRefresh();
|
|
14
14
|
const scrollbarRef = React.useRef(null);
|
|
15
15
|
const scrollbarContentRef = React.useRef(null);
|
|
@@ -19,7 +19,10 @@ function StickyScrollbar({ wrapperRef, tableRef, onScroll, hasStickyColumns }, r
|
|
|
19
19
|
* overlay scrollbars (e.g. Mac).
|
|
20
20
|
*/
|
|
21
21
|
const offsetScrollbar = hasStickyColumns || browserScrollbarSize().height === 0;
|
|
22
|
-
useStickyScrollbar(scrollbarRef, scrollbarContentRef, tableRef, wrapperRef, offsetScrollbar
|
|
22
|
+
useStickyScrollbar(scrollbarRef, scrollbarContentRef, tableRef, wrapperRef, offsetScrollbar, {
|
|
23
|
+
getContentInlineSize,
|
|
24
|
+
contentKey,
|
|
25
|
+
});
|
|
23
26
|
const { ref: stickyDetectionRef, isIntersecting: isStickyDetectionVisible } = useIntersectionObserver();
|
|
24
27
|
return (React.createElement(React.Fragment, null,
|
|
25
28
|
React.createElement("div", { ref: mergedRef, className: clsx(styles['sticky-scrollbar'], offsetScrollbar && styles['sticky-scrollbar-offset'], isVisualRefresh && styles['is-visual-refresh']), onScroll: onScroll, "data-stuck": !isStickyDetectionVisible },
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sticky-scrollbar.js","sourceRoot":"","sources":["../../../../../src/internal/components/sticky-scrollbar/sticky-scrollbar.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAiC,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE3F,OAAO,MAAM,MAAM,iBAAiB,CAAC;AASrC,eAAe,UAAU,CAAC,eAAe,CAAC,CAAC;AAE3C,SAAS,eAAe,CACtB,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,UAAU,EAAwB,EAC5G,GAA8B;IAE9B,MAAM,eAAe,GAAG,gBAAgB,EAAE,CAAC;IAC3C,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IACxD,MAAM,mBAAmB,GAAG,KAAK,CAAC,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAElD;;;OAGG;IACH,MAAM,eAAe,GAAG,gBAAgB,IAAI,oBAAoB,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;IAEhF,kBAAkB,CAAC,YAAY,EAAE,mBAAmB,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE;QAC3F,oBAAoB;QACpB,UAAU;KACX,CAAC,CAAC;IAEH,MAAM,EAAE,GAAG,EAAE,kBAAkB,EAAE,cAAc,EAAE,wBAAwB,EAAE,GAAG,uBAAuB,EAAE,CAAC;IAExG,OAAO,CACL;QACE,6BACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,kBAAkB,CAAC,EAC1B,eAAe,IAAI,MAAM,CAAC,yBAAyB,CAAC,EACpD,eAAe,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAC/C,EACD,QAAQ,EAAE,QAAQ,gBACN,CAAC,wBAAwB;YAErC,6BAAK,GAAG,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,CAAC,0BAA0B,CAAC,GAAI,CAC5E;QACN,6BAAK,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAI,CACzG,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useIntersectionObserver } from '../../hooks/use-intersection-observer';\nimport { useVisualRefresh } from '../../hooks/use-visual-mode';\nimport { browserScrollbarSize } from '../../utils/browser-scrollbar-size';\nimport { StickyScrollbarContentOptions, useStickyScrollbar } from './use-sticky-scrollbar';\n\nimport styles from './styles.css.js';\n\ninterface StickyScrollbarProps extends StickyScrollbarContentOptions {\n wrapperRef: React.RefObject<HTMLDivElement>;\n tableRef: React.RefObject<HTMLTableElement>;\n onScroll?: React.UIEventHandler<HTMLDivElement>;\n hasStickyColumns?: boolean;\n}\n\nexport default forwardRef(StickyScrollbar);\n\nfunction StickyScrollbar(\n { wrapperRef, tableRef, onScroll, hasStickyColumns, getContentInlineSize, contentKey }: StickyScrollbarProps,\n ref: React.Ref<HTMLDivElement>\n) {\n const isVisualRefresh = useVisualRefresh();\n const scrollbarRef = React.useRef<HTMLDivElement>(null);\n const scrollbarContentRef = React.useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs(ref, scrollbarRef);\n\n /**\n * If the height of the scrollbar is 0, we're likely on a platform that uses\n * overlay scrollbars (e.g. Mac).\n */\n const offsetScrollbar = hasStickyColumns || browserScrollbarSize().height === 0;\n\n useStickyScrollbar(scrollbarRef, scrollbarContentRef, tableRef, wrapperRef, offsetScrollbar, {\n getContentInlineSize,\n contentKey,\n });\n\n const { ref: stickyDetectionRef, isIntersecting: isStickyDetectionVisible } = useIntersectionObserver();\n\n return (\n <>\n <div\n ref={mergedRef}\n className={clsx(\n styles['sticky-scrollbar'],\n offsetScrollbar && styles['sticky-scrollbar-offset'],\n isVisualRefresh && styles['is-visual-refresh']\n )}\n onScroll={onScroll}\n data-stuck={!isStickyDetectionVisible}\n >\n <div ref={scrollbarContentRef} className={styles['sticky-scrollbar-content']} />\n </div>\n <div ref={stickyDetectionRef} style={{ position: 'absolute', right: 0, bottom: 0, left: 0, height: 1 }} />\n </>\n );\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
import './styles.scoped.css';
|
|
3
|
+
export default {
|
|
4
|
+
"sticky-scrollbar": "awsui_sticky-scrollbar_7a840_17w1n_9",
|
|
5
|
+
"sticky-scrollbar-content": "awsui_sticky-scrollbar-content_7a840_17w1n_21",
|
|
6
|
+
"sticky-scrollbar-visible": "awsui_sticky-scrollbar-visible_7a840_17w1n_24",
|
|
7
|
+
"sticky-scrollbar-native-invisible": "awsui_sticky-scrollbar-native-invisible_7a840_17w1n_27",
|
|
8
|
+
"sticky-scrollbar-offset": "awsui_sticky-scrollbar-offset_7a840_17w1n_30",
|
|
9
|
+
"is-visual-refresh": "awsui_is-visual-refresh_7a840_17w1n_33"
|
|
10
|
+
};
|
|
11
|
+
|
package/lib/internal/template/{table → internal/components}/sticky-scrollbar/styles.scoped.css
RENAMED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
7
7
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
8
8
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
9
|
-
.awsui_sticky-
|
|
9
|
+
.awsui_sticky-scrollbar_7a840_17w1n_9:not(#\9) {
|
|
10
10
|
block-size: 15px;
|
|
11
11
|
position: sticky;
|
|
12
12
|
display: none;
|
|
@@ -15,27 +15,27 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
15
15
|
inset-block-end: 0;
|
|
16
16
|
inline-size: 100%;
|
|
17
17
|
}
|
|
18
|
-
.awsui_sticky-
|
|
18
|
+
.awsui_sticky-scrollbar_7a840_17w1n_9[data-stuck=false]:not(#\9) {
|
|
19
19
|
clip-path: inset(-9999px 0 0 0 round var(--border-radius-container-33hhdh, 0px));
|
|
20
20
|
}
|
|
21
|
-
.awsui_sticky-scrollbar-
|
|
21
|
+
.awsui_sticky-scrollbar-content_7a840_17w1n_21:not(#\9) {
|
|
22
22
|
block-size: 15px;
|
|
23
23
|
}
|
|
24
|
-
.awsui_sticky-scrollbar-
|
|
24
|
+
.awsui_sticky-scrollbar-visible_7a840_17w1n_24:not(#\9) {
|
|
25
25
|
display: block;
|
|
26
26
|
}
|
|
27
|
-
.awsui_sticky-scrollbar-native-
|
|
27
|
+
.awsui_sticky-scrollbar-native-invisible_7a840_17w1n_27:not(#\9) {
|
|
28
28
|
margin-block-start: -15px;
|
|
29
29
|
}
|
|
30
|
-
.awsui_sticky-scrollbar-
|
|
30
|
+
.awsui_sticky-scrollbar-offset_7a840_17w1n_30:not(#\9) {
|
|
31
31
|
z-index: 799;
|
|
32
32
|
}
|
|
33
|
-
.awsui_sticky-scrollbar-
|
|
33
|
+
.awsui_sticky-scrollbar-offset_7a840_17w1n_30:not(#\9):not(.awsui_is-visual-refresh_7a840_17w1n_33) {
|
|
34
34
|
background-color: var(--color-background-container-content-mjfil9, #ffffff);
|
|
35
35
|
block-size: 15px;
|
|
36
36
|
margin-block-start: calc(-1 * var(--border-divider-section-width-dlkb8v, 1px));
|
|
37
37
|
border-block-start: var(--border-divider-section-width-dlkb8v, 1px) solid var(--color-border-divider-default-diwd4w, #eaeded);
|
|
38
38
|
}
|
|
39
|
-
.awsui_sticky-scrollbar-
|
|
39
|
+
.awsui_sticky-scrollbar-offset_7a840_17w1n_30.awsui_is-visual-refresh_7a840_17w1n_33:not(#\9) {
|
|
40
40
|
margin-block-start: -5px;
|
|
41
41
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
// es-module interop with Babel and Typescript
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
module.exports.default = {
|
|
5
|
+
"sticky-scrollbar": "awsui_sticky-scrollbar_7a840_17w1n_9",
|
|
6
|
+
"sticky-scrollbar-content": "awsui_sticky-scrollbar-content_7a840_17w1n_21",
|
|
7
|
+
"sticky-scrollbar-visible": "awsui_sticky-scrollbar-visible_7a840_17w1n_24",
|
|
8
|
+
"sticky-scrollbar-native-invisible": "awsui_sticky-scrollbar-native-invisible_7a840_17w1n_27",
|
|
9
|
+
"sticky-scrollbar-offset": "awsui_sticky-scrollbar-offset_7a840_17w1n_30",
|
|
10
|
+
"is-visual-refresh": "awsui_is-visual-refresh_7a840_17w1n_33"
|
|
11
|
+
};
|
|
12
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
type ContentInlineSizeGetter = (tableEl: HTMLElement, wrapperEl: HTMLElement) => number;
|
|
3
|
+
export declare const updatePosition: (tableEl: HTMLElement | null, wrapperEl: HTMLElement | null, scrollbarEl: HTMLElement | null, scrollbarContentEl: HTMLElement | null, inScrollableContainer: boolean, getContentInlineSize?: ContentInlineSizeGetter) => void;
|
|
4
|
+
export interface StickyScrollbarContentOptions {
|
|
5
|
+
getContentInlineSize?: ContentInlineSizeGetter;
|
|
6
|
+
contentKey?: unknown;
|
|
7
|
+
}
|
|
8
|
+
export declare function useStickyScrollbar(scrollbarRef: RefObject<HTMLDivElement>, scrollbarContentRef: RefObject<HTMLDivElement>, tableRef: RefObject<HTMLTableElement>, wrapperRef: RefObject<HTMLDivElement>, offsetScrollbar: boolean, { getContentInlineSize, contentKey }: StickyScrollbarContentOptions): void;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=use-sticky-scrollbar.d.ts.map
|
package/lib/internal/template/internal/components/sticky-scrollbar/use-sticky-scrollbar.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sticky-scrollbar.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/sticky-scrollbar/use-sticky-scrollbar.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAW/D,KAAK,uBAAuB,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,KAAK,MAAM,CAAC;AAExF,eAAO,MAAM,cAAc,GACzB,SAAS,WAAW,GAAG,IAAI,EAC3B,WAAW,WAAW,GAAG,IAAI,EAC7B,aAAa,WAAW,GAAG,IAAI,EAC/B,oBAAoB,WAAW,GAAG,IAAI,EACtC,uBAAuB,OAAO,EAC9B,uBAAsB,uBAAqF,SA8C5G,CAAC;AAEF,MAAM,WAAW,6BAA6B;IAE5C,oBAAoB,CAAC,EAAE,uBAAuB,CAAC;IAE/C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,EACvC,mBAAmB,EAAE,SAAS,CAAC,cAAc,CAAC,EAC9C,QAAQ,EAAE,SAAS,CAAC,gBAAgB,CAAC,EACrC,UAAU,EAAE,SAAS,CAAC,cAAc,CAAC,EACrC,eAAe,EAAE,OAAO,EACxB,EAAE,oBAAoB,EAAE,UAAU,EAAE,EAAE,6BAA6B,QAyDpE"}
|
package/lib/internal/template/{table → internal/components}/sticky-scrollbar/use-sticky-scrollbar.js
RENAMED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal';
|
|
5
|
-
import globalVars from '../../
|
|
6
|
-
import { browserScrollbarSize } from '../../
|
|
7
|
-
import { getContainingBlock } from '../../
|
|
8
|
-
import { getOverflowParents } from '../../
|
|
5
|
+
import globalVars from '../../styles/global-vars';
|
|
6
|
+
import { browserScrollbarSize } from '../../utils/browser-scrollbar-size';
|
|
7
|
+
import { getContainingBlock } from '../../utils/dom';
|
|
8
|
+
import { getOverflowParents } from '../../utils/scrollable-containers';
|
|
9
9
|
import styles from './styles.css.js';
|
|
10
|
-
export const updatePosition = (tableEl, wrapperEl, scrollbarEl, scrollbarContentEl, inScrollableContainer) => {
|
|
10
|
+
export const updatePosition = (tableEl, wrapperEl, scrollbarEl, scrollbarContentEl, inScrollableContainer, getContentInlineSize = tableEl => getLogicalBoundingClientRect(tableEl).inlineSize) => {
|
|
11
11
|
if (!tableEl || !scrollbarEl || !wrapperEl) {
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
const
|
|
14
|
+
const tableInlineSize = getContentInlineSize(tableEl, wrapperEl);
|
|
15
15
|
const { inlineSize: wrapperInlineSize } = getLogicalBoundingClientRect(wrapperEl);
|
|
16
16
|
// using 15 px as a height of transparent scrollbar on mac
|
|
17
17
|
const scrollbarHeight = browserScrollbarSize().height;
|
|
@@ -38,10 +38,8 @@ export const updatePosition = (tableEl, wrapperEl, scrollbarEl, scrollbarContent
|
|
|
38
38
|
scrollbarContentEl.style.blockSize = `${scrollbarHeight}px`;
|
|
39
39
|
}
|
|
40
40
|
if (tableEl && wrapperEl && scrollbarContentEl && scrollbarEl) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
scrollbarEl.style.inlineSize = `${wrapperElRect.inlineSize}px`;
|
|
44
|
-
scrollbarContentEl.style.inlineSize = `${tableElRect.inlineSize}px`;
|
|
41
|
+
scrollbarEl.style.inlineSize = `${wrapperInlineSize}px`;
|
|
42
|
+
scrollbarContentEl.style.inlineSize = `${tableInlineSize}px`;
|
|
45
43
|
// when using sticky scrollbars in containers
|
|
46
44
|
// we agreed to ignore dynamic bottom calculations for footer overlap
|
|
47
45
|
scrollbarEl.style.insetBlockEnd = inScrollableContainer
|
|
@@ -49,8 +47,10 @@ export const updatePosition = (tableEl, wrapperEl, scrollbarEl, scrollbarContent
|
|
|
49
47
|
: `var(${globalVars.stickyVerticalBottomOffset}, 0px)`;
|
|
50
48
|
}
|
|
51
49
|
};
|
|
52
|
-
export function useStickyScrollbar(scrollbarRef, scrollbarContentRef, tableRef, wrapperRef, offsetScrollbar) {
|
|
50
|
+
export function useStickyScrollbar(scrollbarRef, scrollbarContentRef, tableRef, wrapperRef, offsetScrollbar, { getContentInlineSize, contentKey }) {
|
|
53
51
|
const [inScrollableContainer, setInScrollableContainer] = useState(false);
|
|
52
|
+
const getContentInlineSizeRef = useRef(getContentInlineSize);
|
|
53
|
+
getContentInlineSizeRef.current = getContentInlineSize;
|
|
54
54
|
const wrapperEl = wrapperRef.current;
|
|
55
55
|
useEffect(() => {
|
|
56
56
|
if (wrapperEl) {
|
|
@@ -62,7 +62,7 @@ export function useStickyScrollbar(scrollbarRef, scrollbarContentRef, tableRef,
|
|
|
62
62
|
if (wrapperRef.current && tableRef.current && typeof ResizeObserver !== 'undefined') {
|
|
63
63
|
const observer = new ResizeObserver(() => {
|
|
64
64
|
if (scrollbarContentRef.current) {
|
|
65
|
-
updatePosition(tableRef.current, wrapperRef.current, scrollbarRef.current, scrollbarContentRef.current, inScrollableContainer);
|
|
65
|
+
updatePosition(tableRef.current, wrapperRef.current, scrollbarRef.current, scrollbarContentRef.current, inScrollableContainer, getContentInlineSizeRef.current);
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
// Scrollbar width must be in sync with wrapper width.
|
|
@@ -74,16 +74,17 @@ export function useStickyScrollbar(scrollbarRef, scrollbarContentRef, tableRef,
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
}, [scrollbarContentRef, scrollbarRef, tableRef, wrapperRef, inScrollableContainer, offsetScrollbar]);
|
|
77
|
-
// Update scrollbar position when window resizes (vertically)
|
|
77
|
+
// Update scrollbar position when window resizes (vertically), or when the content changes width without
|
|
78
|
+
// resizing either observed element.
|
|
78
79
|
useEffect(() => {
|
|
79
80
|
const resizeHandler = () => {
|
|
80
|
-
updatePosition(tableRef.current, wrapperRef.current, scrollbarRef.current, scrollbarContentRef.current, inScrollableContainer);
|
|
81
|
+
updatePosition(tableRef.current, wrapperRef.current, scrollbarRef.current, scrollbarContentRef.current, inScrollableContainer, getContentInlineSizeRef.current);
|
|
81
82
|
};
|
|
82
83
|
resizeHandler();
|
|
83
84
|
window.addEventListener('resize', resizeHandler);
|
|
84
85
|
return () => {
|
|
85
86
|
window.removeEventListener('resize', resizeHandler);
|
|
86
87
|
};
|
|
87
|
-
}, [tableRef, wrapperRef, scrollbarRef, scrollbarContentRef, inScrollableContainer]);
|
|
88
|
+
}, [tableRef, wrapperRef, scrollbarRef, scrollbarContentRef, inScrollableContainer, contentKey]);
|
|
88
89
|
}
|
|
89
90
|
//# sourceMappingURL=use-sticky-scrollbar.js.map
|
package/lib/internal/template/internal/components/sticky-scrollbar/use-sticky-scrollbar.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-sticky-scrollbar.js","sourceRoot":"","sources":["../../../../../src/internal/components/sticky-scrollbar/use-sticky-scrollbar.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAa,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAE7F,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,OAA2B,EAC3B,SAA6B,EAC7B,WAA+B,EAC/B,kBAAsC,EACtC,qBAA8B,EAC9B,uBAAgD,OAAO,CAAC,EAAE,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC,UAAU,EAC3G,EAAE;IACF,IAAI,CAAC,OAAO,IAAI,CAAC,WAAW,IAAI,CAAC,SAAS,EAAE,CAAC;QAC3C,OAAO;IACT,CAAC;IAED,MAAM,eAAe,GAAG,oBAAoB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACjE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,4BAA4B,CAAC,SAAS,CAAC,CAAC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OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACrC,4DAA4D;YAC5D,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACnC,OAAO,GAAG,EAAE;gBACV,QAAQ,CAAC,UAAU,EAAE,CAAC;YACxB,CAAC,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,CAAC,mBAAmB,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,qBAAqB,EAAE,eAAe,CAAC,CAAC,CAAC;IAEtG,wGAAwG;IACxG,oCAAoC;IACpC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,aAAa,GAAG,GAAG,EAAE;YACzB,cAAc,CACZ,QAAQ,CAAC,OAAO,EAChB,UAAU,CAAC,OAAO,EAClB,YAAY,CAAC,OAAO,EACpB,mBAAmB,CAAC,OAAO,EAC3B,qBAAqB,EACrB,uBAAuB,CAAC,OAAO,CAChC,CAAC;QACJ,CAAC,CAAC;QACF,aAAa,EAAE,CAAC;QAChB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QACjD,OAAO,GAAG,EAAE;YACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QACtD,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,UAAU,CAAC,CAAC,CAAC;AACnG,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { RefObject, useEffect, useRef, useState } from 'react';\n\nimport { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal';\n\nimport globalVars from '../../styles/global-vars';\nimport { browserScrollbarSize } from '../../utils/browser-scrollbar-size';\nimport { getContainingBlock } from '../../utils/dom';\nimport { getOverflowParents } from '../../utils/scrollable-containers';\n\nimport styles from './styles.css.js';\n\ntype ContentInlineSizeGetter = (tableEl: HTMLElement, wrapperEl: HTMLElement) => number;\n\nexport const updatePosition = (\n tableEl: HTMLElement | null,\n wrapperEl: HTMLElement | null,\n scrollbarEl: HTMLElement | null,\n scrollbarContentEl: HTMLElement | null,\n inScrollableContainer: boolean,\n getContentInlineSize: ContentInlineSizeGetter = tableEl => getLogicalBoundingClientRect(tableEl).inlineSize\n) => {\n if (!tableEl || !scrollbarEl || !wrapperEl) {\n return;\n }\n\n const tableInlineSize = getContentInlineSize(tableEl, wrapperEl);\n const { inlineSize: wrapperInlineSize } = getLogicalBoundingClientRect(wrapperEl);\n\n // using 15 px as a height of transparent scrollbar on mac\n const scrollbarHeight = browserScrollbarSize().height;\n const areaIsScrollable = tableInlineSize > wrapperInlineSize;\n\n if (!areaIsScrollable) {\n scrollbarEl.classList.remove(styles['sticky-scrollbar-visible']);\n } else {\n // when scrollbar is not displayed scrollLeft property cannot be set by useScrollSync\n // that's why syncing it separately\n if (!scrollbarEl.classList.contains(styles['sticky-scrollbar-visible'])) {\n requestAnimationFrame(() => {\n scrollbarEl.scrollLeft = wrapperEl.scrollLeft;\n });\n }\n\n scrollbarEl.classList.add(styles['sticky-scrollbar-visible']);\n if (!scrollbarHeight) {\n /* istanbul ignore next: covered by screenshot tests */\n scrollbarEl.classList.add(styles['sticky-scrollbar-native-invisible']);\n }\n }\n\n if (scrollbarHeight && scrollbarEl && scrollbarContentEl) {\n scrollbarEl.style.blockSize = `${scrollbarHeight}px`;\n scrollbarContentEl.style.blockSize = `${scrollbarHeight}px`;\n }\n\n if (tableEl && wrapperEl && scrollbarContentEl && scrollbarEl) {\n scrollbarEl.style.inlineSize = `${wrapperInlineSize}px`;\n scrollbarContentEl.style.inlineSize = `${tableInlineSize}px`;\n\n // when using sticky scrollbars in containers\n // we agreed to ignore dynamic bottom calculations for footer overlap\n scrollbarEl.style.insetBlockEnd = inScrollableContainer\n ? '0px'\n : `var(${globalVars.stickyVerticalBottomOffset}, 0px)`;\n }\n};\n\nexport interface StickyScrollbarContentOptions {\n // Measures the scrollable content's width; defaults to the table's width.\n getContentInlineSize?: ContentInlineSizeGetter;\n // Re-measures when this changes, for content that changes width without resizing the table or wrapper.\n contentKey?: unknown;\n}\n\nexport function useStickyScrollbar(\n scrollbarRef: RefObject<HTMLDivElement>,\n scrollbarContentRef: RefObject<HTMLDivElement>,\n tableRef: RefObject<HTMLTableElement>,\n wrapperRef: RefObject<HTMLDivElement>,\n offsetScrollbar: boolean,\n { getContentInlineSize, contentKey }: StickyScrollbarContentOptions\n) {\n const [inScrollableContainer, setInScrollableContainer] = useState(false);\n const getContentInlineSizeRef = useRef(getContentInlineSize);\n getContentInlineSizeRef.current = getContentInlineSize;\n\n const wrapperEl = wrapperRef.current;\n useEffect(() => {\n if (wrapperEl) {\n setInScrollableContainer(!!getContainingBlock(wrapperEl) || !!getOverflowParents(wrapperEl)[0]);\n }\n }, [wrapperEl]);\n\n // Update scrollbar position wrapper or table size change.\n useEffect(() => {\n if (wrapperRef.current && tableRef.current && typeof ResizeObserver !== 'undefined') {\n const observer = new ResizeObserver(() => {\n if (scrollbarContentRef.current) {\n updatePosition(\n tableRef.current,\n wrapperRef.current,\n scrollbarRef.current,\n scrollbarContentRef.current,\n inScrollableContainer,\n getContentInlineSizeRef.current\n );\n }\n });\n // Scrollbar width must be in sync with wrapper width.\n observer.observe(wrapperRef.current);\n // Scrollbar content width must be in sync with table width.\n observer.observe(tableRef.current);\n return () => {\n observer.disconnect();\n };\n }\n }, [scrollbarContentRef, scrollbarRef, tableRef, wrapperRef, inScrollableContainer, offsetScrollbar]);\n\n // Update scrollbar position when window resizes (vertically), or when the content changes width without\n // resizing either observed element.\n useEffect(() => {\n const resizeHandler = () => {\n updatePosition(\n tableRef.current,\n wrapperRef.current,\n scrollbarRef.current,\n scrollbarContentRef.current,\n inScrollableContainer,\n getContentInlineSizeRef.current\n );\n };\n resizeHandler();\n window.addEventListener('resize', resizeHandler);\n return () => {\n window.removeEventListener('resize', resizeHandler);\n };\n }, [tableRef, wrapperRef, scrollbarRef, scrollbarContentRef, inScrollableContainer, contentKey]);\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (d25043b3)";
|
|
3
|
+
export var GIT_SHA = "d25043b3";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "core";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
|
@@ -806,6 +806,7 @@ export const fontBoxValueLargeWeight: string;
|
|
|
806
806
|
export const fontButtonLetterSpacing: string;
|
|
807
807
|
export const fontChartDetailSize: string;
|
|
808
808
|
export const fontDecorationStyleLink: string;
|
|
809
|
+
export const fontDecorationLineButtonInlineLink: string;
|
|
809
810
|
export const fontDecorationLineLinkSecondary: string;
|
|
810
811
|
export const fontDecorationThicknessLink: string;
|
|
811
812
|
export const fontDecorationThicknessLinkDisplayL: string;
|
|
@@ -806,6 +806,7 @@ export var fontBoxValueLargeWeight = "var(--font-box-value-large-weight-x66hzl,
|
|
|
806
806
|
export var fontButtonLetterSpacing = "var(--font-button-letter-spacing-ki7gj3, 0.005em)";
|
|
807
807
|
export var fontChartDetailSize = "var(--font-chart-detail-size-5il5az, 12px)";
|
|
808
808
|
export var fontDecorationStyleLink = "var(--font-decoration-style-link-azri03, solid)";
|
|
809
|
+
export var fontDecorationLineButtonInlineLink = "var(--font-decoration-line-button-inline-link-14tvpm, none)";
|
|
809
810
|
export var fontDecorationLineLinkSecondary = "var(--font-decoration-line-link-secondary-henot1, none)";
|
|
810
811
|
export var fontDecorationThicknessLink = "var(--font-decoration-thickness-link-ue2y2g, 1px)";
|
|
811
812
|
export var fontDecorationThicknessLinkDisplayL = "var(--font-decoration-thickness-link-display-l-9280qx, 2px)";
|
|
@@ -3259,6 +3259,7 @@ module.exports.preset = {
|
|
|
3259
3259
|
"fontButtonLetterSpacing": "0.005em",
|
|
3260
3260
|
"fontChartDetailSize": "{fontSizeBodyS}",
|
|
3261
3261
|
"fontDecorationStyleLink": "solid",
|
|
3262
|
+
"fontDecorationLineButtonInlineLink": "none",
|
|
3262
3263
|
"fontDecorationLineLinkSecondary": "none",
|
|
3263
3264
|
"fontDecorationThicknessLink": "1px",
|
|
3264
3265
|
"fontDecorationThicknessLinkDisplayL": "2px",
|
|
@@ -17045,6 +17046,7 @@ module.exports.preset = {
|
|
|
17045
17046
|
"colorTextBadgeRed",
|
|
17046
17047
|
"colorBackgroundCodeView",
|
|
17047
17048
|
"fontDecorationStyleLink",
|
|
17049
|
+
"fontDecorationLineButtonInlineLink",
|
|
17048
17050
|
"fontDecorationThicknessLink",
|
|
17049
17051
|
"fontDecorationThicknessLinkDisplayL",
|
|
17050
17052
|
"fontSizeExpandableHeading",
|
|
@@ -18572,6 +18574,7 @@ module.exports.preset = {
|
|
|
18572
18574
|
"fontButtonLetterSpacing": "font-button-letter-spacing",
|
|
18573
18575
|
"fontChartDetailSize": "font-chart-detail-size",
|
|
18574
18576
|
"fontDecorationStyleLink": "font-decoration-style-link",
|
|
18577
|
+
"fontDecorationLineButtonInlineLink": "font-decoration-line-button-inline-link",
|
|
18575
18578
|
"fontDecorationLineLinkSecondary": "font-decoration-line-link-secondary",
|
|
18576
18579
|
"fontDecorationThicknessLink": "font-decoration-thickness-link",
|
|
18577
18580
|
"fontDecorationThicknessLinkDisplayL": "font-decoration-thickness-link-display-l",
|
|
@@ -19746,6 +19749,7 @@ module.exports.preset = {
|
|
|
19746
19749
|
"fontButtonLetterSpacing": "--font-button-letter-spacing-ki7gj3",
|
|
19747
19750
|
"fontChartDetailSize": "--font-chart-detail-size-5il5az",
|
|
19748
19751
|
"fontDecorationStyleLink": "--font-decoration-style-link-azri03",
|
|
19752
|
+
"fontDecorationLineButtonInlineLink": "--font-decoration-line-button-inline-link-14tvpm",
|
|
19749
19753
|
"fontDecorationLineLinkSecondary": "--font-decoration-line-link-secondary-henot1",
|
|
19750
19754
|
"fontDecorationThicknessLink": "--font-decoration-thickness-link-ue2y2g",
|
|
19751
19755
|
"fontDecorationThicknessLinkDisplayL": "--font-decoration-thickness-link-display-l-9280qx",
|
|
@@ -335,6 +335,7 @@ export declare interface TypedOverride {
|
|
|
335
335
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
336
336
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
337
337
|
fontDecorationStyleLink?: GlobalValue;
|
|
338
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
338
339
|
fontDecorationThicknessLink?: GlobalValue;
|
|
339
340
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
340
341
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -815,6 +816,7 @@ export declare interface TypedOverride {
|
|
|
815
816
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
816
817
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
817
818
|
fontDecorationStyleLink?: GlobalValue;
|
|
819
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
818
820
|
fontDecorationThicknessLink?: GlobalValue;
|
|
819
821
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
820
822
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -1295,6 +1297,7 @@ export declare interface TypedOverride {
|
|
|
1295
1297
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1296
1298
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1297
1299
|
fontDecorationStyleLink?: GlobalValue;
|
|
1300
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
1298
1301
|
fontDecorationThicknessLink?: GlobalValue;
|
|
1299
1302
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
1300
1303
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -1775,6 +1778,7 @@ export declare interface TypedOverride {
|
|
|
1775
1778
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1776
1779
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1777
1780
|
fontDecorationStyleLink?: GlobalValue;
|
|
1781
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
1778
1782
|
fontDecorationThicknessLink?: GlobalValue;
|
|
1779
1783
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
1780
1784
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -2255,6 +2259,7 @@ export declare interface TypedOverride {
|
|
|
2255
2259
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2256
2260
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2257
2261
|
fontDecorationStyleLink?: GlobalValue;
|
|
2262
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
2258
2263
|
fontDecorationThicknessLink?: GlobalValue;
|
|
2259
2264
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
2260
2265
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -2735,6 +2740,7 @@ export declare interface TypedOverride {
|
|
|
2735
2740
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2736
2741
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2737
2742
|
fontDecorationStyleLink?: GlobalValue;
|
|
2743
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
2738
2744
|
fontDecorationThicknessLink?: GlobalValue;
|
|
2739
2745
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
2740
2746
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -3215,6 +3221,7 @@ export declare interface TypedOverride {
|
|
|
3215
3221
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
3216
3222
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
3217
3223
|
fontDecorationStyleLink?: GlobalValue;
|
|
3224
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
3218
3225
|
fontDecorationThicknessLink?: GlobalValue;
|
|
3219
3226
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
3220
3227
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -3695,6 +3702,7 @@ export declare interface TypedOverride {
|
|
|
3695
3702
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
3696
3703
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
3697
3704
|
fontDecorationStyleLink?: GlobalValue;
|
|
3705
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
3698
3706
|
fontDecorationThicknessLink?: GlobalValue;
|
|
3699
3707
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
3700
3708
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -4175,6 +4183,7 @@ export declare interface TypedOverride {
|
|
|
4175
4183
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
4176
4184
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
4177
4185
|
fontDecorationStyleLink?: GlobalValue;
|
|
4186
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
4178
4187
|
fontDecorationThicknessLink?: GlobalValue;
|
|
4179
4188
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
4180
4189
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -334,6 +334,7 @@ export declare interface TypedOverride {
|
|
|
334
334
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
335
335
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
336
336
|
fontDecorationStyleLink?: GlobalValue;
|
|
337
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
337
338
|
fontDecorationThicknessLink?: GlobalValue;
|
|
338
339
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
339
340
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -814,6 +815,7 @@ export declare interface TypedOverride {
|
|
|
814
815
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
815
816
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
816
817
|
fontDecorationStyleLink?: GlobalValue;
|
|
818
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
817
819
|
fontDecorationThicknessLink?: GlobalValue;
|
|
818
820
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
819
821
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -1294,6 +1296,7 @@ export declare interface TypedOverride {
|
|
|
1294
1296
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1295
1297
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1296
1298
|
fontDecorationStyleLink?: GlobalValue;
|
|
1299
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
1297
1300
|
fontDecorationThicknessLink?: GlobalValue;
|
|
1298
1301
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
1299
1302
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -1774,6 +1777,7 @@ export declare interface TypedOverride {
|
|
|
1774
1777
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1775
1778
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1776
1779
|
fontDecorationStyleLink?: GlobalValue;
|
|
1780
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
1777
1781
|
fontDecorationThicknessLink?: GlobalValue;
|
|
1778
1782
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
1779
1783
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -2254,6 +2258,7 @@ export declare interface TypedOverride {
|
|
|
2254
2258
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2255
2259
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2256
2260
|
fontDecorationStyleLink?: GlobalValue;
|
|
2261
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
2257
2262
|
fontDecorationThicknessLink?: GlobalValue;
|
|
2258
2263
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
2259
2264
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -2734,6 +2739,7 @@ export declare interface TypedOverride {
|
|
|
2734
2739
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2735
2740
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
2736
2741
|
fontDecorationStyleLink?: GlobalValue;
|
|
2742
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
2737
2743
|
fontDecorationThicknessLink?: GlobalValue;
|
|
2738
2744
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
2739
2745
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -3214,6 +3220,7 @@ export declare interface TypedOverride {
|
|
|
3214
3220
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
3215
3221
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
3216
3222
|
fontDecorationStyleLink?: GlobalValue;
|
|
3223
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
3217
3224
|
fontDecorationThicknessLink?: GlobalValue;
|
|
3218
3225
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
3219
3226
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -3694,6 +3701,7 @@ export declare interface TypedOverride {
|
|
|
3694
3701
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
3695
3702
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
3696
3703
|
fontDecorationStyleLink?: GlobalValue;
|
|
3704
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
3697
3705
|
fontDecorationThicknessLink?: GlobalValue;
|
|
3698
3706
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
3699
3707
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -4174,6 +4182,7 @@ export declare interface TypedOverride {
|
|
|
4174
4182
|
colorTextBadgeRed?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
4175
4183
|
colorBackgroundCodeView?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
4176
4184
|
fontDecorationStyleLink?: GlobalValue;
|
|
4185
|
+
fontDecorationLineButtonInlineLink?: GlobalValue;
|
|
4177
4186
|
fontDecorationThicknessLink?: GlobalValue;
|
|
4178
4187
|
fontDecorationThicknessLinkDisplayL?: GlobalValue;
|
|
4179
4188
|
fontSizeExpandableHeading?: GlobalValue;
|
|
@@ -3259,6 +3259,7 @@ export var preset = {
|
|
|
3259
3259
|
"fontButtonLetterSpacing": "0.005em",
|
|
3260
3260
|
"fontChartDetailSize": "{fontSizeBodyS}",
|
|
3261
3261
|
"fontDecorationStyleLink": "solid",
|
|
3262
|
+
"fontDecorationLineButtonInlineLink": "none",
|
|
3262
3263
|
"fontDecorationLineLinkSecondary": "none",
|
|
3263
3264
|
"fontDecorationThicknessLink": "1px",
|
|
3264
3265
|
"fontDecorationThicknessLinkDisplayL": "2px",
|
|
@@ -17045,6 +17046,7 @@ export var preset = {
|
|
|
17045
17046
|
"colorTextBadgeRed",
|
|
17046
17047
|
"colorBackgroundCodeView",
|
|
17047
17048
|
"fontDecorationStyleLink",
|
|
17049
|
+
"fontDecorationLineButtonInlineLink",
|
|
17048
17050
|
"fontDecorationThicknessLink",
|
|
17049
17051
|
"fontDecorationThicknessLinkDisplayL",
|
|
17050
17052
|
"fontSizeExpandableHeading",
|
|
@@ -18572,6 +18574,7 @@ export var preset = {
|
|
|
18572
18574
|
"fontButtonLetterSpacing": "font-button-letter-spacing",
|
|
18573
18575
|
"fontChartDetailSize": "font-chart-detail-size",
|
|
18574
18576
|
"fontDecorationStyleLink": "font-decoration-style-link",
|
|
18577
|
+
"fontDecorationLineButtonInlineLink": "font-decoration-line-button-inline-link",
|
|
18575
18578
|
"fontDecorationLineLinkSecondary": "font-decoration-line-link-secondary",
|
|
18576
18579
|
"fontDecorationThicknessLink": "font-decoration-thickness-link",
|
|
18577
18580
|
"fontDecorationThicknessLinkDisplayL": "font-decoration-thickness-link-display-l",
|
|
@@ -19746,6 +19749,7 @@ export var preset = {
|
|
|
19746
19749
|
"fontButtonLetterSpacing": "--font-button-letter-spacing-ki7gj3",
|
|
19747
19750
|
"fontChartDetailSize": "--font-chart-detail-size-5il5az",
|
|
19748
19751
|
"fontDecorationStyleLink": "--font-decoration-style-link-azri03",
|
|
19752
|
+
"fontDecorationLineButtonInlineLink": "--font-decoration-line-button-inline-link-14tvpm",
|
|
19749
19753
|
"fontDecorationLineLinkSecondary": "--font-decoration-line-link-secondary-henot1",
|
|
19750
19754
|
"fontDecorationThicknessLink": "--font-decoration-thickness-link-ue2y2g",
|
|
19751
19755
|
"fontDecorationThicknessLinkDisplayL": "--font-decoration-thickness-link-display-l-9280qx",
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { InternalItemCardProps } from './internal-interfaces';
|
|
2
|
-
export
|
|
2
|
+
export interface StyleClassNames {
|
|
3
|
+
root?: string;
|
|
4
|
+
header?: string;
|
|
5
|
+
footer?: string;
|
|
6
|
+
}
|
|
7
|
+
interface InternalItemCardWithStyleProps extends InternalItemCardProps {
|
|
8
|
+
styleClassNames?: StyleClassNames;
|
|
9
|
+
}
|
|
10
|
+
export default function InternalItemCard({ actions, highlighted, children, className, header, description, footer, icon, style, metadataAttributes, nativeAttributes, onClick, disableHeaderPaddings, disableContentPaddings, disableFooterPaddings, fullHeight, variant, __internalRootRef, styleClassNames, ...restProps }: InternalItemCardWithStyleProps): JSX.Element;
|
|
11
|
+
export {};
|
|
3
12
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/item-card/internal.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/item-card/internal.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAO9D,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,8BAA+B,SAAQ,qBAAqB;IACpE,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,OAAO,EACP,WAAW,EACX,QAAQ,EACR,SAAS,EACT,MAAM,EACN,WAAW,EACX,MAAM,EACN,IAAI,EACJ,KAAK,EACL,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,UAAU,EACV,OAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,GAAG,SAAS,EACb,EAAE,8BAA8B,eA2EhC"}
|
|
@@ -10,22 +10,22 @@ import { processAttributes } from '../internal/utils/with-native-attributes';
|
|
|
10
10
|
import { getContentStyles, getFooterStyles, getHeaderStyles, getRootStyles } from './style';
|
|
11
11
|
import styles from './styles.css.js';
|
|
12
12
|
import testStyles from './test-classes/styles.css.js';
|
|
13
|
-
export default function InternalItemCard({ actions, highlighted, children, className, header, description, footer, icon, style, metadataAttributes, nativeAttributes, onClick, disableHeaderPaddings, disableContentPaddings, disableFooterPaddings, fullHeight, variant = 'default', __internalRootRef, ...restProps }) {
|
|
13
|
+
export default function InternalItemCard({ actions, highlighted, children, className, header, description, footer, icon, style, metadataAttributes, nativeAttributes, onClick, disableHeaderPaddings, disableContentPaddings, disableFooterPaddings, fullHeight, variant = 'default', __internalRootRef, styleClassNames, ...restProps }) {
|
|
14
14
|
const baseProps = getBaseProps(restProps);
|
|
15
15
|
const isRefresh = useVisualRefresh();
|
|
16
16
|
const rootRef = useMergeRefs(__internalRootRef, nativeAttributes === null || nativeAttributes === void 0 ? void 0 : nativeAttributes.ref);
|
|
17
17
|
const headerRowEmpty = !header && !description && !icon && !actions;
|
|
18
18
|
const rootAttributes = processAttributes({
|
|
19
|
-
className: clsx(className, styles.root, highlighted && styles.highlighted, fullHeight && styles['full-height'], isRefresh && styles.refresh, styles[`variant-${variant}`]),
|
|
19
|
+
className: clsx(className, styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.root, styles.root, highlighted && styles.highlighted, fullHeight && styles['full-height'], isRefresh && styles.refresh, styles[`variant-${variant}`]),
|
|
20
20
|
...metadataAttributes,
|
|
21
21
|
onClick,
|
|
22
22
|
style: getRootStyles(style),
|
|
23
23
|
}, 'Card', nativeAttributes);
|
|
24
24
|
return (React.createElement("div", { ...baseProps, ...rootAttributes, ref: rootRef },
|
|
25
25
|
React.createElement("div", { className: styles['inner-card'] },
|
|
26
|
-
!headerRowEmpty && (React.createElement("div", { className: clsx(styles.header, disableHeaderPaddings && styles['no-padding'], !!actions && styles['with-actions']), style: getHeaderStyles(style) },
|
|
26
|
+
!headerRowEmpty && (React.createElement("div", { className: clsx(styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.header, styles.header, disableHeaderPaddings && styles['no-padding'], !!actions && styles['with-actions']), style: getHeaderStyles(style) },
|
|
27
27
|
React.createElement(InternalStructuredItem, { content: header && React.createElement("div", { className: clsx(styles['header-inner'], testStyles.header) }, header), secondaryContent: description && React.createElement("div", { className: clsx(styles.description, testStyles.description) }, description), icon: icon && React.createElement("div", { className: testStyles.icon }, icon), actions: actions, disablePaddings: disableHeaderPaddings, wrapActions: true }))),
|
|
28
28
|
children && (React.createElement("div", { className: clsx(styles.body, testStyles.body, disableContentPaddings && styles['no-padding']), style: getContentStyles(style) }, children)),
|
|
29
|
-
footer && (React.createElement("div", { className: clsx(styles.footer, testStyles.footer, disableFooterPaddings && styles['no-padding']), style: getFooterStyles(style) }, footer)))));
|
|
29
|
+
footer && (React.createElement("div", { className: clsx(styleClassNames === null || styleClassNames === void 0 ? void 0 : styleClassNames.footer, styles.footer, testStyles.footer, disableFooterPaddings && styles['no-padding']), style: getFooterStyles(style) }, footer)))));
|
|
30
30
|
}
|
|
31
31
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/item-card/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,sBAAsB,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0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AU,CAAC,WAAW,CAAC,IAAG,WAAW,CAAO,EAEtG,IAAI,EAAE,IAAI,IAAI,6BAAK,SAAS,EAAE,UAAU,CAAC,IAAI,IAAG,IAAI,CAAO,EAC3D,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,qBAAqB,EACtC,WAAW,EAAE,IAAI,GACjB,CACE,CACP;YACA,QAAQ,IAAI,CACX,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,sBAAsB,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,EAC7F,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAE7B,QAAQ,CACL,CACP;YACA,MAAM,IAAI,CACT,6BACE,SAAS,EAAE,IAAI,CACb,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,MAAM,EACvB,MAAM,CAAC,MAAM,EACb,UAAU,CAAC,MAAM,EACjB,qBAAqB,IAAI,MAAM,CAAC,YAAY,CAAC,CAC9C,EACD,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,IAE5B,MAAM,CACH,CACP,CACG,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport InternalStructuredItem from '../internal/components/structured-item';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { processAttributes } from '../internal/utils/with-native-attributes';\nimport { InternalItemCardProps } from './internal-interfaces';\nimport { getContentStyles, getFooterStyles, getHeaderStyles, getRootStyles } from './style';\n\nimport styles from './styles.css.js';\nimport testStyles from './test-classes/styles.css.js';\n\n// Style API v2\nexport interface StyleClassNames {\n root?: string;\n header?: string;\n footer?: string;\n}\n\ninterface InternalItemCardWithStyleProps extends InternalItemCardProps {\n styleClassNames?: StyleClassNames;\n}\n\nexport default function InternalItemCard({\n actions,\n highlighted,\n children,\n className,\n header,\n description,\n footer,\n icon,\n style,\n metadataAttributes,\n nativeAttributes,\n onClick,\n disableHeaderPaddings,\n disableContentPaddings,\n disableFooterPaddings,\n fullHeight,\n variant = 'default',\n __internalRootRef,\n styleClassNames,\n ...restProps\n}: InternalItemCardWithStyleProps) {\n const baseProps = getBaseProps(restProps);\n const isRefresh = useVisualRefresh();\n const rootRef = useMergeRefs(__internalRootRef, nativeAttributes?.ref);\n\n const headerRowEmpty = !header && !description && !icon && !actions;\n\n const rootAttributes = processAttributes<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n {\n className: clsx(\n className,\n styleClassNames?.root,\n styles.root,\n highlighted && styles.highlighted,\n fullHeight && styles['full-height'],\n isRefresh && styles.refresh,\n styles[`variant-${variant}`]\n ),\n ...metadataAttributes,\n onClick,\n style: getRootStyles(style),\n },\n 'Card',\n nativeAttributes\n );\n\n return (\n <div {...baseProps} {...rootAttributes} ref={rootRef}>\n <div className={styles['inner-card']}>\n {!headerRowEmpty && (\n <div\n className={clsx(\n styleClassNames?.header,\n styles.header,\n disableHeaderPaddings && styles['no-padding'],\n !!actions && styles['with-actions']\n )}\n style={getHeaderStyles(style)}\n >\n <InternalStructuredItem\n content={header && <div className={clsx(styles['header-inner'], testStyles.header)}>{header}</div>}\n secondaryContent={\n description && <div className={clsx(styles.description, testStyles.description)}>{description}</div>\n }\n icon={icon && <div className={testStyles.icon}>{icon}</div>}\n actions={actions}\n disablePaddings={disableHeaderPaddings}\n wrapActions={true}\n />\n </div>\n )}\n {children && (\n <div\n className={clsx(styles.body, testStyles.body, disableContentPaddings && styles['no-padding'])}\n style={getContentStyles(style)}\n >\n {children}\n </div>\n )}\n {footer && (\n <div\n className={clsx(\n styleClassNames?.footer,\n styles.footer,\n testStyles.footer,\n disableFooterPaddings && styles['no-padding']\n )}\n style={getFooterStyles(style)}\n >\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/item-card/style.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,GAAG,SAAS;;;EAenE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,GAAG,SAAS;;;EAStE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,GAAG,SAAS;;;EASrE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,GAAG,SAAS;;;;;;
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/item-card/style.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,GAAG,SAAS;;;EAenE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,GAAG,SAAS;;;EAStE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,GAAG,SAAS;;;EASrE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,GAAG,SAAS;;;;;;EAmBrE"}
|
|
@@ -45,7 +45,12 @@ export function getFooterStyles(style) {
|
|
|
45
45
|
}
|
|
46
46
|
const hasDivider = ((_b = (_a = style === null || style === void 0 ? void 0 : style.footer) === null || _a === void 0 ? void 0 : _a.divider) === null || _b === void 0 ? void 0 : _b.borderColor) || ((_d = (_c = style === null || style === void 0 ? void 0 : style.footer) === null || _c === void 0 ? void 0 : _c.divider) === null || _d === void 0 ? void 0 : _d.borderWidth);
|
|
47
47
|
return {
|
|
48
|
-
|
|
48
|
+
// All three longhands: the footer presets a zero-width transparent border.
|
|
49
|
+
...(hasDivider && {
|
|
50
|
+
borderBlockStartStyle: 'solid',
|
|
51
|
+
borderBlockStartWidth: 'medium',
|
|
52
|
+
borderBlockStartColor: 'currentcolor',
|
|
53
|
+
}),
|
|
49
54
|
...(((_f = (_e = style === null || style === void 0 ? void 0 : style.footer) === null || _e === void 0 ? void 0 : _e.divider) === null || _f === void 0 ? void 0 : _f.borderColor) && { borderBlockStartColor: style.footer.divider.borderColor }),
|
|
50
55
|
...(((_h = (_g = style === null || style === void 0 ? void 0 : style.footer) === null || _g === void 0 ? void 0 : _g.divider) === null || _h === void 0 ? void 0 : _h.borderWidth) && { borderBlockStartWidth: style.footer.divider.borderWidth }),
|
|
51
56
|
...(((_k = (_j = style === null || style === void 0 ? void 0 : style.footer) === null || _j === void 0 ? void 0 : _j.root) === null || _k === void 0 ? void 0 : _k.paddingBlock) && { paddingBlock: style.footer.root.paddingBlock }),
|