@sps-woodland/core 8.56.2 → 8.56.3
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/action-bar/action-bar/ActionBar.js +44 -59
- package/lib/action-bar/action-bar/ActionBar.ve.js +4 -11
- package/lib/action-bar/action-bar-additional-content/ActionBarAdditionalContent.js +14 -22
- package/lib/action-bar/index.js +54 -74
- package/lib/action-bar/index.umd.cjs +1 -1
- package/lib/action-bar/style.css +2 -1
- package/lib/add-to-list/add-to-list/AddToList.js +220 -302
- package/lib/add-to-list/add-to-list/AddToList.ve.js +79 -24
- package/lib/add-to-list/add-to-list/ItemsList.js +42 -67
- package/lib/add-to-list/add-to-list/ListItem.js +24 -50
- package/lib/add-to-list/index.js +393 -453
- package/lib/add-to-list/index.umd.cjs +1 -1
- package/lib/add-to-list/style.css +2 -1
- package/lib/buttons/button/Button.js +95 -121
- package/lib/buttons/button/Button.ve.js +150 -9
- package/lib/buttons/index.js +281 -171
- package/lib/buttons/index.umd.cjs +1 -1
- package/lib/buttons/style.css +2 -1
- package/lib/cards/card/Card.js +19 -27
- package/lib/cards/card/Card.ve.js +4 -4
- package/lib/cards/card-footer/CardFooter.js +12 -13
- package/lib/cards/card-footer/CardFooter.ve.js +4 -4
- package/lib/cards/card-header/CardHeader.js +12 -13
- package/lib/cards/card-header/CardHeader.ve.js +4 -4
- package/lib/cards/card-title/CardTitle.js +11 -12
- package/lib/cards/card-title/CardTitle.ve.js +4 -4
- package/lib/cards/index.js +52 -52
- package/lib/cards/index.umd.cjs +1 -1
- package/lib/cards/style.css +2 -1
- package/lib/column-manager/column-manager/ColumnManager.js +95 -112
- package/lib/column-manager/column-manager/useColumnManager.js +59 -48
- package/lib/column-manager/index.js +2 -5
- package/lib/components/icon/Icon.ve.js +15 -5
- package/lib/components/icon/icons/sprite.svg.js +4 -4
- package/lib/content-row/content-row/ContentRow.js +146 -173
- package/lib/content-row/content-row/ContentRow.ve.js +105 -18
- package/lib/content-row/content-row-col/ContentRowCol.js +37 -48
- package/lib/content-row/content-row-col/ContentRowCol.ve.js +49 -6
- package/lib/content-row/content-row-expansion/ContentRowExpansion.js +16 -24
- package/lib/content-row/index.js +407 -318
- package/lib/content-row/index.umd.cjs +1 -1
- package/lib/content-row/row-list-auto-layout/RowListAutoLayout.js +24 -39
- package/lib/content-row/row-list-auto-layout/RowListAutoLayout.ve.js +13 -5
- package/lib/content-row/style.css +2 -1
- package/lib/content-tiles/content-tile/ContentTile.js +71 -60
- package/lib/content-tiles/content-tile/ContentTile.ve.js +36 -14
- package/lib/content-tiles/content-tile-list/ContentTileList.js +12 -13
- package/lib/content-tiles/content-tile-list/ContentTileList.ve.js +4 -5
- package/lib/content-tiles/index.js +156 -118
- package/lib/content-tiles/index.umd.cjs +1 -1
- package/lib/content-tiles/style.css +2 -1
- package/lib/core.css +2 -1
- package/lib/dropdowns/dropdown/Dropdown.js +56 -68
- package/lib/dropdowns/dropdown/Dropdown.ve.js +37 -8
- package/lib/dropdowns/index.js +171 -171
- package/lib/dropdowns/index.umd.cjs +1 -1
- package/lib/dropdowns/option-list/Option.js +14 -18
- package/lib/dropdowns/option-list/Option.ve.js +4 -5
- package/lib/dropdowns/option-list/OptionList.js +28 -44
- package/lib/dropdowns/option-list/OptionList.ve.js +4 -5
- package/lib/dropdowns/style.css +2 -1
- package/lib/editable-table/EditableTable.js +68 -85
- package/lib/editable-table/index.js +1 -4
- package/lib/feedback-block/FeedbackBlock.js +40 -35
- package/lib/feedback-block/FeedbackBlock.ve.js +56 -7
- package/lib/feedback-block/index.js +132 -85
- package/lib/feedback-block/index.umd.cjs +1 -1
- package/lib/feedback-block/style.css +2 -1
- package/lib/file-upload/file-upload/FileUpload.js +164 -202
- package/lib/file-upload/file-upload/FileUpload.ve.js +84 -18
- package/lib/file-upload/file-upload/mime-type.enum.js +106 -106
- package/lib/file-upload/index.js +390 -353
- package/lib/file-upload/index.umd.cjs +1 -1
- package/lib/file-upload/style.css +2 -1
- package/lib/filter-tiles/filter-tile/FilterTile.js +41 -46
- package/lib/filter-tiles/filter-tile/FilterTile.ve.js +51 -9
- package/lib/filter-tiles/filter-tile-set/FilterTileSet.js +12 -15
- package/lib/filter-tiles/filter-tile-set/FilterTileSet.ve.js +4 -4
- package/lib/filter-tiles/index.js +142 -107
- package/lib/filter-tiles/index.umd.cjs +1 -1
- package/lib/filter-tiles/style.css +2 -1
- package/lib/focused-task/focused-task/FocusedTask.js +52 -74
- package/lib/focused-task/focused-task/FocusedTask.ve.js +13 -12
- package/lib/focused-task/focused-task/useFocusedTask.js +20 -18
- package/lib/focused-task/focused-task-actions/FocusedTaskActions.js +12 -13
- package/lib/focused-task/index.js +127 -144
- package/lib/focused-task/index.umd.cjs +1 -1
- package/lib/focused-task/style.css +2 -1
- package/lib/growler/Growler.js +78 -90
- package/lib/growler/Growler.ve.js +23 -12
- package/lib/growler/GrowlerListProvider.js +38 -39
- package/lib/growler/Sonner.ve.js +17 -12
- package/lib/growler/index.js +249 -274
- package/lib/growler/index.umd.cjs +1 -1
- package/lib/growler/sonner.js +73 -102
- package/lib/growler/style.css +2 -1
- package/lib/index.js +520 -501
- package/lib/index.umd.cjs +4 -4
- package/lib/insight-card/InsightCard.js +90 -84
- package/lib/insight-card/InsightCard.ve.js +148 -15
- package/lib/insight-card/InsightCardSet.js +12 -12
- package/lib/insight-card/index.js +269 -141
- package/lib/insight-card/index.umd.cjs +1 -1
- package/lib/insight-card/style.css +2 -1
- package/lib/key-value-set/index.js +97 -87
- package/lib/key-value-set/index.umd.cjs +1 -1
- package/lib/key-value-set/key-value-set/KeyValueSet.js +17 -21
- package/lib/key-value-set/key-value-set/KeyValueSet.ve.js +10 -5
- package/lib/key-value-set/key-value-set-item/KeyValueSetItem.js +25 -21
- package/lib/key-value-set/key-value-set-item/KeyValueSetItem.ve.js +13 -6
- package/lib/key-value-set/style.css +2 -1
- package/lib/list-bar/advanced-search/AdvancedSearch.js +51 -54
- package/lib/list-bar/advanced-search/AdvancedSearch.ve.js +30 -8
- package/lib/list-bar/index.js +305 -301
- package/lib/list-bar/index.umd.cjs +1 -1
- package/lib/list-bar/list-bar/InputGroupWrapper.js +10 -19
- package/lib/list-bar/list-bar/ListBar.js +105 -121
- package/lib/list-bar/list-bar/ListBar.ve.js +13 -17
- package/lib/list-bar/list-bar/ListBarSearch.js +20 -21
- package/lib/list-bar/list-bar/ListBarSearchInfo.js +8 -12
- package/lib/list-bar/list-bar/ListBarSortBy.js +28 -38
- package/lib/list-bar/search-results-bar/SearchResultsBar.js +38 -28
- package/lib/list-bar/search-results-bar/SearchResultsBar.ve.js +4 -11
- package/lib/list-bar/style.css +2 -1
- package/lib/matrix/index.js +79 -87
- package/lib/matrix/index.umd.cjs +1 -1
- package/lib/matrix/matrix/Matrix.js +18 -26
- package/lib/matrix/matrix/Matrix.ve.js +4 -7
- package/lib/matrix/matrix-body/MatrixBody.js +10 -13
- package/lib/matrix/matrix-cell/MatrixCell.js +23 -18
- package/lib/matrix/matrix-head/MatrixHead.js +10 -13
- package/lib/matrix/matrix-header/MatrixHeader.js +20 -23
- package/lib/matrix/matrix-row/MatrixRow.js +10 -13
- package/lib/matrix/style.css +2 -1
- package/lib/modal/index.js +197 -187
- package/lib/modal/index.umd.cjs +1 -1
- package/lib/modal/modal/Modal.js +90 -108
- package/lib/modal/modal/Modal.ve.js +43 -13
- package/lib/modal/modal/useModal.js +19 -24
- package/lib/modal/modal-footer/ModalFooter.js +11 -12
- package/lib/modal/style.css +2 -1
- package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +49 -0
- package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/index.browser.js +8 -10
- package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/url-alphabet/index.js +4 -4
- package/lib/page-title/heading-level/HeadingLevel.js +8 -12
- package/lib/page-title/index.js +33 -40
- package/lib/page-title/index.umd.cjs +1 -1
- package/lib/page-title/page-subtitle/PageSubtitle.js +13 -18
- package/lib/page-title/page-subtitle/PageSubtitle.ve.js +4 -5
- package/lib/page-title/page-title/PageTitle.js +15 -19
- package/lib/page-title/page-title/PageTitle.ve.js +4 -7
- package/lib/page-title/style.css +2 -1
- package/lib/photo/index.js +174 -177
- package/lib/photo/index.umd.cjs +1 -1
- package/lib/photo/photo/Photo.js +72 -81
- package/lib/photo/photo/Photo.ve.js +21 -7
- package/lib/photo/photo-carousel/PhotoCarousel.js +36 -51
- package/lib/photo/photo-carousel/PhotoCarousel.ve.js +13 -9
- package/lib/photo/style.css +2 -1
- package/lib/product-bar/hooks/usePriorityPlus.js +88 -104
- package/lib/product-bar/index.js +372 -395
- package/lib/product-bar/index.umd.cjs +1 -1
- package/lib/product-bar/product-bar/ProductBar.js +77 -103
- package/lib/product-bar/product-bar/ProductBar.ve.js +46 -15
- package/lib/product-bar/product-bar-name/ProductBarName.js +37 -40
- package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.js +48 -70
- package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.ve.js +4 -8
- package/lib/product-bar/product-bar-tab/ProductBarTab.js +28 -26
- package/lib/product-bar/slack-link/SlackLink.js +26 -30
- package/lib/product-bar/slack-link/SlackLink.ve.js +4 -5
- package/lib/product-bar/style.css +2 -1
- package/lib/product-bar-vertical/index.js +240 -251
- package/lib/product-bar-vertical/index.umd.cjs +1 -1
- package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.js +42 -61
- package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.ve.js +53 -23
- package/lib/product-bar-vertical/product-bar-vertical-header/ProductBarVerticalHeader.js +30 -42
- package/lib/product-bar-vertical/product-bar-vertical-item/ProductBarVerticalItem.js +71 -89
- package/lib/product-bar-vertical/product-bar-vertical-section/ProductBarVerticalSection.js +22 -29
- package/lib/product-bar-vertical/style.css +2 -1
- package/lib/progress-indicators/index.js +372 -255
- package/lib/progress-indicators/index.umd.cjs +1 -1
- package/lib/progress-indicators/progress-bar/ProgressBar.js +66 -110
- package/lib/progress-indicators/progress-bar/ProgressBar.ve.js +66 -13
- package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.js +34 -54
- package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.ve.js +136 -8
- package/lib/progress-indicators/progress-ring/ProgressRing.js +45 -52
- package/lib/progress-indicators/style.css +2 -1
- package/lib/rich-text-editor/index.js +556 -582
- package/lib/rich-text-editor/index.umd.cjs +11 -11
- package/lib/rich-text-editor/rich-text-editor/RTELinkModal.js +29 -33
- package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.js +23 -37
- package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.ve.js +13 -6
- package/lib/rich-text-editor/rich-text-editor/RichTextEditor.js +68 -77
- package/lib/rich-text-editor/rich-text-editor/RichTextEditor.ve.js +21 -8
- package/lib/rich-text-editor/rich-text-editor/hooks/useHtmlToMd.js +14 -20
- package/lib/rich-text-editor/rich-text-editor/hooks/useMdToHtml.js +14 -20
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTEContent.js +33 -27
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTEObserver.js +79 -88
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTESelectionListener.js +28 -36
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTEToolbarButtons.js +195 -211
- package/lib/rich-text-editor/rich-text-editor/icons/BOLD.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/INDENT.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/ITALICS.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/LINK.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/ORDERED_LIST.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/OUTDENT.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/REDO.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/UNDO.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/UNLINK.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/UNORDERED_LIST.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/utils/flattenListItemParagraphs.js +12 -12
- package/lib/rich-text-editor/rich-text-editor/utils/removeUnrepresentableBreaks.js +20 -19
- package/lib/rich-text-editor/rich-text-editor/utils/utils.js +11 -15
- package/lib/rich-text-editor/style.css +2 -1
- package/lib/scrollable-container/ScrollableContainer.js +18 -27
- package/lib/scrollable-container/ScrollableContainer.ve.js +4 -4
- package/lib/scrollable-container/index.js +20 -27
- package/lib/scrollable-container/index.umd.cjs +1 -1
- package/lib/scrollable-container/style.css +2 -1
- package/lib/side-nav/index.js +190 -228
- package/lib/side-nav/index.umd.cjs +1 -1
- package/lib/side-nav/side-nav/SideNav.js +43 -60
- package/lib/side-nav/side-nav/SideNav.ve.js +22 -16
- package/lib/side-nav/side-nav/navContext.js +7 -7
- package/lib/side-nav/side-nav-header/SideNavHeader.js +14 -15
- package/lib/side-nav/side-nav-item/SideNavItem.js +68 -94
- package/lib/side-nav/side-nav-section/SideNavSection.js +16 -26
- package/lib/side-nav/style.css +2 -1
- package/lib/sorting-header/caret/caret.ve.js +13 -5
- package/lib/sorting-header/index.js +269 -251
- package/lib/sorting-header/index.umd.cjs +1 -1
- package/lib/sorting-header/sorting-header/SortingHeader.js +110 -124
- package/lib/sorting-header/sorting-header/SortingHeader.ve.js +30 -6
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.js +69 -83
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.ve.js +21 -7
- package/lib/sorting-header/style.css +2 -1
- package/lib/style.css +2 -1
- package/lib/tabs/index.js +255 -201
- package/lib/tabs/index.umd.cjs +1 -1
- package/lib/tabs/style.css +2 -1
- package/lib/tabs/tab/Tab.js +24 -27
- package/lib/tabs/tab/Tab.ve.js +76 -6
- package/lib/tabs/tab-panel/TabPanel.js +16 -25
- package/lib/tabs/tabs/Tabs.js +101 -112
- package/lib/tabs/tabs/Tabs.ve.js +13 -11
- package/lib/tags/clickable-tag/ClickableTag.js +86 -90
- package/lib/tags/clickable-tag/ClickableTag.ve.js +66 -9
- package/lib/tags/index.js +342 -199
- package/lib/tags/index.umd.cjs +1 -1
- package/lib/tags/split-tag/SplitTag.js +49 -30
- package/lib/tags/split-tag/SplitTag.ve.js +35 -9
- package/lib/tags/style.css +2 -1
- package/lib/tags/tag/Tag.js +42 -38
- package/lib/tags/tag/Tag.ve.js +41 -6
- package/lib/utils/cl.js +5 -5
- package/lib/zero-state/ZeroState.js +36 -29
- package/lib/zero-state/ZeroState.ve.js +29 -11
- package/lib/zero-state/index.js +103 -78
- package/lib/zero-state/index.umd.cjs +1 -1
- package/lib/zero-state/style.css +2 -1
- package/package.json +12 -12
- package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.17.4/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +0 -57
package/lib/tabs/index.js
CHANGED
|
@@ -1,207 +1,261 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { useTabListState as
|
|
3
|
-
import { useTab as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { useTabListState as t } from "@react-stately/tabs";
|
|
3
|
+
import { useTab as n, useTabList as r, useTabPanel as i } from "@react-aria/tabs";
|
|
4
|
+
import { Content as a, Icon as o, Metadata as s, cl as c, modChildren as l, useChildTestIdAttrBuilder as u } from "@sps-woodland/core";
|
|
5
|
+
//#region ../../../node_modules/.pnpm/@vanilla-extract+recipes@0.2.5_@vanilla-extract+css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
|
|
6
|
+
function d(e, t, n) {
|
|
7
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
8
|
+
value: n,
|
|
9
|
+
enumerable: !0,
|
|
10
|
+
configurable: !0,
|
|
11
|
+
writable: !0
|
|
12
|
+
}) : e[t] = n, e;
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
function f(e, t) {
|
|
15
|
+
var n = Object.keys(e);
|
|
16
|
+
if (Object.getOwnPropertySymbols) {
|
|
17
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
18
|
+
t && (r = r.filter(function(t) {
|
|
19
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
20
|
+
})), n.push.apply(n, r);
|
|
21
|
+
}
|
|
22
|
+
return n;
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
function p(e) {
|
|
25
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
26
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
27
|
+
t % 2 ? f(Object(n), !0).forEach(function(t) {
|
|
28
|
+
d(e, t, n[t]);
|
|
29
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : f(Object(n)).forEach(function(t) {
|
|
30
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return e;
|
|
33
34
|
}
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
35
|
+
var m = (e, t, n) => {
|
|
36
|
+
for (var r of Object.keys(e)) if (e[r] !== (t[r] ?? n[r])) return !1;
|
|
37
|
+
return !0;
|
|
38
|
+
}, h = (e) => (t) => {
|
|
39
|
+
var n = e.defaultClassName, r = p(p({}, e.defaultVariants), t);
|
|
40
|
+
for (var i in r) {
|
|
41
|
+
var a = r[i] ?? e.defaultVariants[i];
|
|
42
|
+
if (a != null) {
|
|
43
|
+
var o = a;
|
|
44
|
+
typeof o == "boolean" && (o = o === !0 ? "true" : "false");
|
|
45
|
+
var s = e.variantClassNames[i][o];
|
|
46
|
+
s && (n += " " + s);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
for (var [c, l] of e.compoundVariants) m(c, r, e.defaultVariants) && (n += " " + l);
|
|
50
|
+
return n;
|
|
51
|
+
}, g = h({
|
|
52
|
+
defaultClassName: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u540",
|
|
53
|
+
variantClassNames: {
|
|
54
|
+
context: {
|
|
55
|
+
container: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u541",
|
|
56
|
+
navigation: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u542"
|
|
57
|
+
},
|
|
58
|
+
active: {
|
|
59
|
+
true: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u543",
|
|
60
|
+
false: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u544"
|
|
61
|
+
},
|
|
62
|
+
disabled: {
|
|
63
|
+
true: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u545",
|
|
64
|
+
false: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u546"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
defaultVariants: {},
|
|
68
|
+
compoundVariants: [
|
|
69
|
+
[{
|
|
70
|
+
context: "container",
|
|
71
|
+
active: !0
|
|
72
|
+
}, "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u547"],
|
|
73
|
+
[{
|
|
74
|
+
context: "container",
|
|
75
|
+
active: !1
|
|
76
|
+
}, "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u548"],
|
|
77
|
+
[{
|
|
78
|
+
context: "container",
|
|
79
|
+
active: !1,
|
|
80
|
+
disabled: !1
|
|
81
|
+
}, "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u549"],
|
|
82
|
+
[{
|
|
83
|
+
context: "navigation",
|
|
84
|
+
active: !0
|
|
85
|
+
}, "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54a"],
|
|
86
|
+
[{
|
|
87
|
+
context: "navigation",
|
|
88
|
+
active: !1
|
|
89
|
+
}, "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54b"],
|
|
90
|
+
[{
|
|
91
|
+
context: "navigation",
|
|
92
|
+
active: !1,
|
|
93
|
+
disabled: !1
|
|
94
|
+
}, "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54c"],
|
|
95
|
+
[{
|
|
96
|
+
context: "navigation",
|
|
97
|
+
active: !1,
|
|
98
|
+
disabled: !0
|
|
99
|
+
}, "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54d"]
|
|
100
|
+
]
|
|
101
|
+
}), _ = h({
|
|
102
|
+
defaultClassName: "",
|
|
103
|
+
variantClassNames: {
|
|
104
|
+
active: {
|
|
105
|
+
true: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54e",
|
|
106
|
+
false: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54f"
|
|
107
|
+
},
|
|
108
|
+
disabled: {
|
|
109
|
+
true: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54g",
|
|
110
|
+
false: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54h"
|
|
111
|
+
},
|
|
112
|
+
context: {
|
|
113
|
+
navigation: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54i",
|
|
114
|
+
container: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54j"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
defaultVariants: {},
|
|
118
|
+
compoundVariants: [[{
|
|
119
|
+
context: "navigation",
|
|
120
|
+
active: !0
|
|
121
|
+
}, "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54k"]]
|
|
122
|
+
});
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/tabs/tab/Tab.tsx
|
|
125
|
+
function v({ context: t, item: r, state: i, ...a }) {
|
|
126
|
+
let { key: o } = r, u = e.useRef(null), { tabProps: d } = n({ key: o }, i, u), f = i.selectedKey === o, p = i.disabledKeys.has(o), m = l(r.rendered, (e) => e.type.displayName === "SpsTag" || s.isWoodlandComponent(e.type) && s.get(e.type).name === "Tag" ? [{ className: c(e.props.className, _({
|
|
127
|
+
active: f,
|
|
128
|
+
disabled: p,
|
|
129
|
+
context: t
|
|
130
|
+
})) }] : [{}]);
|
|
131
|
+
return /* @__PURE__ */ e.createElement("div", {
|
|
132
|
+
...d,
|
|
133
|
+
ref: u,
|
|
134
|
+
className: g({
|
|
135
|
+
active: f,
|
|
136
|
+
disabled: p,
|
|
137
|
+
context: t
|
|
138
|
+
}),
|
|
139
|
+
...a
|
|
140
|
+
}, m);
|
|
78
141
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
142
|
+
s.set(v, { name: "Tab" });
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/tabs/tabs/Tabs.css.ts
|
|
145
|
+
var y = "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k1", b = h({
|
|
146
|
+
defaultClassName: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k5 pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k0",
|
|
147
|
+
variantClassNames: { context: {
|
|
148
|
+
container: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k6",
|
|
149
|
+
navigation: "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k7"
|
|
150
|
+
} },
|
|
151
|
+
defaultVariants: {},
|
|
152
|
+
compoundVariants: []
|
|
153
|
+
}), x = "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k8";
|
|
154
|
+
//#endregion
|
|
155
|
+
//#region src/tabs/tab-panel/TabPanel.tsx
|
|
156
|
+
function S({ context: t, "data-testid": n, state: r, ...o }) {
|
|
157
|
+
let s = e.useRef(null), { tabPanelProps: c } = i(o, r, s), l = t === "container" ? a : "div";
|
|
158
|
+
return /* @__PURE__ */ e.createElement(l, {
|
|
159
|
+
...c,
|
|
160
|
+
ref: s,
|
|
161
|
+
className: x,
|
|
162
|
+
"data-testid": n
|
|
163
|
+
}, r.selectedItem ? r.selectedItem.props.children : null);
|
|
98
164
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
)), /* @__PURE__ */ o.createElement(
|
|
193
|
-
R,
|
|
194
|
-
{
|
|
195
|
-
key: n.selectedItem ? n.selectedItem.key : null,
|
|
196
|
-
state: n,
|
|
197
|
-
context: a,
|
|
198
|
-
...p("tab-panel")
|
|
199
|
-
}
|
|
200
|
-
));
|
|
165
|
+
s.set(S, { name: "TabPanel" });
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/tabs/tabs/Tabs.tsx
|
|
168
|
+
var C = .75;
|
|
169
|
+
function w({ className: n, context: i = "navigation", "data-testid": a, selectedKey: s, defaultSelectedKey: l, ...d }) {
|
|
170
|
+
let f = {
|
|
171
|
+
...d,
|
|
172
|
+
selectedKey: s ?? void 0,
|
|
173
|
+
defaultSelectedKey: l ?? void 0
|
|
174
|
+
}, p = t(f), m = e.useRef(null), { tabListProps: h } = r(f, p, m), g = u({ "data-testid": a }), _ = i === "container", [x, w] = e.useState(!1), [T, E] = e.useState(!1), D = e.useCallback(() => {
|
|
175
|
+
let e = m.current;
|
|
176
|
+
if (!e) return;
|
|
177
|
+
let t = e.scrollWidth - e.clientWidth;
|
|
178
|
+
w(e.scrollLeft > 1), E(t - e.scrollLeft > 1);
|
|
179
|
+
}, []);
|
|
180
|
+
e.useEffect(() => {
|
|
181
|
+
let e = m.current;
|
|
182
|
+
if (!e) return;
|
|
183
|
+
D(), e.addEventListener("scroll", D, { passive: !0 });
|
|
184
|
+
let t = new ResizeObserver(D);
|
|
185
|
+
return t.observe(e), () => {
|
|
186
|
+
e.removeEventListener("scroll", D), t.disconnect();
|
|
187
|
+
};
|
|
188
|
+
}, [D]);
|
|
189
|
+
let O = (e) => {
|
|
190
|
+
let t = m.current;
|
|
191
|
+
if (!t) return;
|
|
192
|
+
let n = t.clientWidth * C;
|
|
193
|
+
t.scrollBy({
|
|
194
|
+
left: e === "left" ? -n : n,
|
|
195
|
+
behavior: "smooth"
|
|
196
|
+
});
|
|
197
|
+
}, k = e.useCallback(() => {
|
|
198
|
+
let e = m.current;
|
|
199
|
+
if (!e) return;
|
|
200
|
+
let t = e.querySelector("[aria-selected=\"true\"]");
|
|
201
|
+
if (!t) return;
|
|
202
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = e.scrollLeft > 1, a = e.scrollWidth - e.clientWidth - e.scrollLeft > 1, o = n.left + (i ? 39 : 0), s = n.right - (a ? 39 : 0);
|
|
203
|
+
r.left < o ? e.scrollBy({
|
|
204
|
+
left: r.left - (n.left + 39),
|
|
205
|
+
behavior: "smooth"
|
|
206
|
+
}) : r.right > s && e.scrollBy({
|
|
207
|
+
left: r.right - (n.right - 39),
|
|
208
|
+
behavior: "smooth"
|
|
209
|
+
});
|
|
210
|
+
}, []);
|
|
211
|
+
e.useEffect(() => {
|
|
212
|
+
k();
|
|
213
|
+
}, [p.selectedKey, k]);
|
|
214
|
+
let A = () => {
|
|
215
|
+
requestAnimationFrame(() => k());
|
|
216
|
+
};
|
|
217
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", {
|
|
218
|
+
className: y,
|
|
219
|
+
"data-testid": a
|
|
220
|
+
}, _ && x && /* @__PURE__ */ e.createElement("button", {
|
|
221
|
+
"aria-label": "Show previous tabs",
|
|
222
|
+
title: "Show previous tabs",
|
|
223
|
+
className: c("pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k2", "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k3"),
|
|
224
|
+
"data-side": "left",
|
|
225
|
+
onClick: () => O("left"),
|
|
226
|
+
type: "button"
|
|
227
|
+
}, /* @__PURE__ */ e.createElement(o, {
|
|
228
|
+
icon: "chevron-left",
|
|
229
|
+
size: "sm",
|
|
230
|
+
"aria-hidden": "true"
|
|
231
|
+
})), /* @__PURE__ */ e.createElement("div", {
|
|
232
|
+
...h,
|
|
233
|
+
ref: m,
|
|
234
|
+
className: c(b({ context: i }), n),
|
|
235
|
+
onClickCapture: A
|
|
236
|
+
}, [...p.collection].map((t) => /* @__PURE__ */ e.createElement(v, {
|
|
237
|
+
key: t.key,
|
|
238
|
+
item: t,
|
|
239
|
+
state: p,
|
|
240
|
+
context: i,
|
|
241
|
+
...g(`tab-${String(t.key)}`)
|
|
242
|
+
}))), _ && T && /* @__PURE__ */ e.createElement("button", {
|
|
243
|
+
"aria-label": "Show more tabs",
|
|
244
|
+
title: "Show more tabs",
|
|
245
|
+
className: c("pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k2", "pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k4"),
|
|
246
|
+
onClick: () => O("right"),
|
|
247
|
+
type: "button"
|
|
248
|
+
}, /* @__PURE__ */ e.createElement(o, {
|
|
249
|
+
icon: "chevron-right",
|
|
250
|
+
size: "sm",
|
|
251
|
+
"aria-hidden": "true"
|
|
252
|
+
}))), /* @__PURE__ */ e.createElement(S, {
|
|
253
|
+
key: p.selectedItem ? p.selectedItem.key : null,
|
|
254
|
+
state: p,
|
|
255
|
+
context: i,
|
|
256
|
+
...g("tab-panel")
|
|
257
|
+
}));
|
|
201
258
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
R as TabPanel,
|
|
206
|
-
ae as Tabs
|
|
207
|
-
};
|
|
259
|
+
s.set(w, { name: "Tabs" });
|
|
260
|
+
//#endregion
|
|
261
|
+
export { v as Tab, S as TabPanel, w as Tabs };
|
package/lib/tabs/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("@react-stately/tabs"),require("@react-aria/tabs"),require("@sps-woodland/core")):typeof define==`function`&&define.amd?define([`exports`,`react`,`@react-stately/tabs`,`@react-aria/tabs`,`@sps-woodland/core`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Tabs={},e.react,e.reactStatelyTabs,e.reactAriaTabs,e.spsWoodlandCore))})(this,function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=c(t),a=0,l=i.length,d;a<l;a++)d=i[a],!u.call(e,d)&&d!==n&&o(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=s(t,d))||r.enumerable});return e};t=((e,t,n)=>(n=e==null?{}:a(l(e)),d(t||!e||!e.__esModule||!u.call(e,`default`)?o(n,`default`,{value:e,enumerable:!0}):n,e)))(t,1);function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?p(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var h=(e,t,n)=>{for(var r of Object.keys(e))if(e[r]!==(t[r]??n[r]))return!1;return!0},g=e=>t=>{var n=e.defaultClassName,r=m(m({},e.defaultVariants),t);for(var i in r){var a=r[i]??e.defaultVariants[i];if(a!=null){var o=a;typeof o==`boolean`&&(o=o===!0?`true`:`false`);var s=e.variantClassNames[i][o];s&&(n+=` `+s)}}for(var[c,l]of e.compoundVariants)h(c,r,e.defaultVariants)&&(n+=` `+l);return n},_=g({defaultClassName:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u540`,variantClassNames:{context:{container:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u541`,navigation:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u542`},active:{true:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u543`,false:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u544`},disabled:{true:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u545`,false:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u546`}},defaultVariants:{},compoundVariants:[[{context:`container`,active:!0},`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u547`],[{context:`container`,active:!1},`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u548`],[{context:`container`,active:!1,disabled:!1},`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u549`],[{context:`navigation`,active:!0},`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54a`],[{context:`navigation`,active:!1},`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54b`],[{context:`navigation`,active:!1,disabled:!1},`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54c`],[{context:`navigation`,active:!1,disabled:!0},`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54d`]]}),v=g({defaultClassName:``,variantClassNames:{active:{true:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54e`,false:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54f`},disabled:{true:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54g`,false:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54h`},context:{navigation:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54i`,container:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54j`}},defaultVariants:{},compoundVariants:[[{context:`navigation`,active:!0},`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54k`]]});function y({context:e,item:n,state:a,...o}){let{key:s}=n,c=t.useRef(null),{tabProps:l}=(0,r.useTab)({key:s},a,c),u=a.selectedKey===s,d=a.disabledKeys.has(s),f=(0,i.modChildren)(n.rendered,t=>t.type.displayName===`SpsTag`||i.Metadata.isWoodlandComponent(t.type)&&i.Metadata.get(t.type).name===`Tag`?[{className:(0,i.cl)(t.props.className,v({active:u,disabled:d,context:e}))}]:[{}]);return t.createElement(`div`,{...l,ref:c,className:_({active:u,disabled:d,context:e}),...o},f)}i.Metadata.set(y,{name:`Tab`});var b=`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k1`,x=g({defaultClassName:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k5 pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k0`,variantClassNames:{context:{container:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k6`,navigation:`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k7`}},defaultVariants:{},compoundVariants:[]}),S=`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k8`;function C({context:e,"data-testid":n,state:a,...o}){let s=t.useRef(null),{tabPanelProps:c}=(0,r.useTabPanel)(o,a,s),l=e===`container`?i.Content:`div`;return t.createElement(l,{...c,ref:s,className:S,"data-testid":n},a.selectedItem?a.selectedItem.props.children:null)}i.Metadata.set(C,{name:`TabPanel`});var w=.75;function T({className:e,context:a=`navigation`,"data-testid":o,selectedKey:s,defaultSelectedKey:c,...l}){let u={...l,selectedKey:s??void 0,defaultSelectedKey:c??void 0},d=(0,n.useTabListState)(u),f=t.useRef(null),{tabListProps:p}=(0,r.useTabList)(u,d,f),m=(0,i.useChildTestIdAttrBuilder)({"data-testid":o}),h=a===`container`,[g,_]=t.useState(!1),[v,S]=t.useState(!1),T=t.useCallback(()=>{let e=f.current;if(!e)return;let t=e.scrollWidth-e.clientWidth;_(e.scrollLeft>1),S(t-e.scrollLeft>1)},[]);t.useEffect(()=>{let e=f.current;if(!e)return;T(),e.addEventListener(`scroll`,T,{passive:!0});let t=new ResizeObserver(T);return t.observe(e),()=>{e.removeEventListener(`scroll`,T),t.disconnect()}},[T]);let E=e=>{let t=f.current;if(!t)return;let n=t.clientWidth*w;t.scrollBy({left:e===`left`?-n:n,behavior:`smooth`})},D=t.useCallback(()=>{let e=f.current;if(!e)return;let t=e.querySelector(`[aria-selected="true"]`);if(!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=e.scrollLeft>1,a=e.scrollWidth-e.clientWidth-e.scrollLeft>1,o=n.left+(i?39:0),s=n.right-(a?39:0);r.left<o?e.scrollBy({left:r.left-(n.left+39),behavior:`smooth`}):r.right>s&&e.scrollBy({left:r.right-(n.right-39),behavior:`smooth`})},[]);t.useEffect(()=>{D()},[d.selectedKey,D]);let O=()=>{requestAnimationFrame(()=>D())};return t.createElement(t.Fragment,null,t.createElement(`div`,{className:b,"data-testid":o},h&&g&&t.createElement(`button`,{"aria-label":`Show previous tabs`,title:`Show previous tabs`,className:(0,i.cl)(`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k2`,`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k3`),"data-side":`left`,onClick:()=>E(`left`),type:`button`},t.createElement(i.Icon,{icon:`chevron-left`,size:`sm`,"aria-hidden":`true`})),t.createElement(`div`,{...p,ref:f,className:(0,i.cl)(x({context:a}),e),onClickCapture:O},[...d.collection].map(e=>t.createElement(y,{key:e.key,item:e,state:d,context:a,...m(`tab-${String(e.key)}`)}))),h&&v&&t.createElement(`button`,{"aria-label":`Show more tabs`,title:`Show more tabs`,className:(0,i.cl)(`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k2`,`pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k4`),onClick:()=>E(`right`),type:`button`},t.createElement(i.Icon,{icon:`chevron-right`,size:`sm`,"aria-hidden":`true`}))),t.createElement(C,{key:d.selectedItem?d.selectedItem.key:null,state:d,context:a,...m(`tab-panel`)}))}i.Metadata.set(T,{name:`Tabs`}),e.Tab=y,e.TabPanel=C,e.Tabs=T});
|
package/lib/tabs/style.css
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
.pkg_sps-
|
|
1
|
+
.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u540{cursor:pointer;white-space:nowrap;border-style:solid;border-top-width:.0625rem;border-right-width:.0625rem;align-items:center;padding:.5rem 1rem;font-size:.75rem;font-weight:600;line-height:.875rem;display:flex}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u540:focus{outline-offset:.125rem;outline:.125rem solid #007db8;box-shadow:0 0 0 .375rem #fff}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u541{color:#717779;border-bottom-width:0;border-left-width:.0625rem;border-top-left-radius:.25rem;border-top-right-radius:.25rem;margin-bottom:-1px}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u542{border-bottom-width:.0625rem;border-left-width:0}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u542:first-child{border-left-width:.0625rem;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u542:last-child{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u545{cursor:not-allowed}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u547{color:#1f282c;background-color:#fff;border-color:#d2d4d4}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u548{border-color:#0000}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u549:hover{background-color:#f3f4f4;border-color:#d2d4d4;box-shadow:inset 0 -.0625rem #d2d4d4}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54a{color:#fff;background-color:#007db8;border-color:#007db8}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54b{color:#4b5356;background-color:#fff;border-color:#d2d4d4}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54c:hover{background-color:#f3f4f4}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54d{color:#717779}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u54k{color:#4b5356!important;background-color:#fff!important}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_p40u540 svg{margin-bottom:0}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k0{scrollbar-width:none;flex-wrap:nowrap;display:flex;overflow:auto hidden}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k0::-webkit-scrollbar{display:none}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k1{position:relative}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k2{z-index:1;cursor:pointer;background-color:#e9e9ea;border:none;justify-content:center;align-items:center;width:32px;height:34px;padding:0;display:flex;position:absolute;bottom:1px}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k2:focus{outline:none}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k2:after{content:"";width:8px;height:34px;display:block;position:absolute}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k3{left:0}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k3:after{background:linear-gradient(90deg,#e9e9ea,#0000);right:-7px}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k4{right:0}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k4:after{background:linear-gradient(270deg,#e9e9ea,#0000);left:-7px}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k6{background-color:#e9e9ea;border-bottom:.0625rem solid #d2d4d4;border-top-left-radius:.25rem;border-top-right-radius:.25rem;padding-top:1rem;padding-left:1rem;padding-right:1rem}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k7{margin-bottom:1rem}.pkg_sps-woodland_core__family_tabs__version_8_56_3__hash_1mdnm0k8:focus{outline-offset:.125rem;outline:.125rem solid #007db8;box-shadow:0 0 0 6px #fff}
|
|
2
|
+
/*$vite$:1*/
|
package/lib/tabs/tab/Tab.js
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Metadata as
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
d
|
|
23
|
-
);
|
|
1
|
+
import { tab as e, tabTag as t } from "./Tab.ve.js";
|
|
2
|
+
import { Metadata as n, cl as r, modChildren as i } from "@sps-woodland/core";
|
|
3
|
+
import * as a from "react";
|
|
4
|
+
import { useTab as o } from "@react-aria/tabs";
|
|
5
|
+
//#region src/tabs/tab/Tab.tsx
|
|
6
|
+
function s({ context: s, item: c, state: l, ...u }) {
|
|
7
|
+
let { key: d } = c, f = a.useRef(null), { tabProps: p } = o({ key: d }, l, f), m = l.selectedKey === d, h = l.disabledKeys.has(d), g = i(c.rendered, (e) => e.type.displayName === "SpsTag" || n.isWoodlandComponent(e.type) && n.get(e.type).name === "Tag" ? [{ className: r(e.props.className, t({
|
|
8
|
+
active: m,
|
|
9
|
+
disabled: h,
|
|
10
|
+
context: s
|
|
11
|
+
})) }] : [{}]);
|
|
12
|
+
return /* @__PURE__ */ a.createElement("div", {
|
|
13
|
+
...p,
|
|
14
|
+
ref: f,
|
|
15
|
+
className: e({
|
|
16
|
+
active: m,
|
|
17
|
+
disabled: h,
|
|
18
|
+
context: s
|
|
19
|
+
}),
|
|
20
|
+
...u
|
|
21
|
+
}, g);
|
|
24
22
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
23
|
+
n.set(s, { name: "Tab" });
|
|
24
|
+
//#endregion
|
|
25
|
+
export { s as Tab };
|