@sps-woodland/core 8.56.12 → 8.56.13
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.ve.js +1 -1
- package/lib/action-bar/index.js +3 -59
- package/lib/action-bar/style.css +1 -2
- package/lib/add-to-list/add-to-list/AddToList.js +4 -4
- package/lib/add-to-list/add-to-list/AddToList.ve.js +32 -32
- package/lib/add-to-list/add-to-list/ItemsList.js +3 -3
- package/lib/add-to-list/add-to-list/ListItem.js +1 -1
- package/lib/add-to-list/index.js +1 -402
- package/lib/add-to-list/style.css +1 -2
- package/lib/buttons/button/Button.js +2 -2
- package/lib/buttons/button/Button.ve.js +56 -56
- package/lib/buttons/index.js +1 -285
- package/lib/buttons/style.css +1 -2
- package/lib/cards/card/Card.ve.js +1 -1
- package/lib/cards/card-footer/CardFooter.ve.js +1 -1
- package/lib/cards/card-header/CardHeader.ve.js +1 -1
- package/lib/cards/card-title/CardTitle.ve.js +1 -1
- package/lib/cards/index.js +5 -56
- package/lib/cards/style.css +4 -2
- package/lib/components/icon/Icon.ve.js +5 -5
- package/lib/content-row/content-row/ContentRow.js +2 -2
- package/lib/content-row/content-row/ContentRow.ve.js +37 -37
- package/lib/content-row/content-row-col/ContentRowCol.ve.js +14 -14
- package/lib/content-row/index.js +5 -419
- package/lib/content-row/row-list-auto-layout/RowListAutoLayout.ve.js +3 -3
- package/lib/content-row/style.css +3 -2
- package/lib/content-tiles/content-tile/ContentTile.js +3 -3
- package/lib/content-tiles/content-tile/ContentTile.ve.js +12 -12
- package/lib/content-tiles/content-tile-list/ContentTileList.ve.js +1 -1
- package/lib/content-tiles/index.js +3 -162
- package/lib/content-tiles/style.css +2 -2
- package/lib/dropdowns/dropdown/Dropdown.js +1 -1
- package/lib/dropdowns/dropdown/Dropdown.ve.js +13 -13
- package/lib/dropdowns/index.js +4 -180
- package/lib/dropdowns/option-list/Option.js +1 -1
- package/lib/dropdowns/option-list/Option.ve.js +1 -1
- package/lib/dropdowns/option-list/OptionList.ve.js +1 -1
- package/lib/dropdowns/style.css +3 -2
- package/lib/feedback-block/FeedbackBlock.ve.js +18 -18
- package/lib/feedback-block/index.js +1 -138
- package/lib/feedback-block/style.css +1 -2
- package/lib/file-upload/file-upload/FileUpload.js +4 -4
- package/lib/file-upload/file-upload/FileUpload.ve.js +28 -28
- package/lib/file-upload/index.js +1 -398
- package/lib/file-upload/style.css +1 -2
- package/lib/filter-tiles/filter-tile/FilterTile.ve.js +20 -20
- package/lib/filter-tiles/filter-tile-set/FilterTileSet.ve.js +1 -1
- package/lib/filter-tiles/index.js +3 -148
- package/lib/filter-tiles/style.css +2 -2
- package/lib/focused-task/focused-task/FocusedTask.ve.js +5 -5
- package/lib/focused-task/index.js +4 -137
- package/lib/focused-task/style.css +1 -2
- package/lib/growler/Growler.js +1 -1
- package/lib/growler/Growler.ve.js +10 -10
- package/lib/growler/Sonner.ve.js +8 -8
- package/lib/growler/index.js +4 -261
- package/lib/growler/style.css +2 -2
- package/lib/index.js +28 -28
- package/lib/index.umd.cjs +1 -1
- package/lib/insight-card/InsightCard.ve.js +54 -54
- package/lib/insight-card/index.js +3 -276
- package/lib/insight-card/style.css +1 -2
- package/lib/key-value-set/index.js +3 -105
- package/lib/key-value-set/key-value-set/KeyValueSet.ve.js +2 -2
- package/lib/key-value-set/key-value-set-item/KeyValueSetItem.ve.js +4 -4
- package/lib/key-value-set/style.css +2 -2
- package/lib/list-bar/advanced-search/AdvancedSearch.ve.js +9 -9
- package/lib/list-bar/index.js +8 -321
- package/lib/list-bar/list-bar/ListBar.js +5 -5
- package/lib/list-bar/list-bar/ListBar.ve.js +4 -4
- package/lib/list-bar/search-results-bar/SearchResultsBar.js +2 -2
- package/lib/list-bar/search-results-bar/SearchResultsBar.ve.js +1 -1
- package/lib/list-bar/style.css +3 -2
- package/lib/matrix/index.js +7 -87
- package/lib/matrix/matrix/Matrix.ve.js +1 -1
- package/lib/matrix/style.css +1 -2
- package/lib/modal/index.js +4 -207
- package/lib/modal/modal/Modal.js +1 -1
- package/lib/modal/modal/Modal.ve.js +23 -23
- package/lib/modal/style.css +1 -2
- package/lib/page-title/index.js +4 -38
- package/lib/page-title/page-subtitle/PageSubtitle.ve.js +1 -1
- package/lib/page-title/page-title/PageTitle.ve.js +1 -1
- package/lib/page-title/style.css +2 -2
- package/lib/photo/index.js +3 -180
- package/lib/photo/photo/Photo.ve.js +7 -7
- package/lib/photo/photo-carousel/PhotoCarousel.ve.js +4 -4
- package/lib/photo/style.css +2 -2
- package/lib/product-bar/index.js +5 -387
- package/lib/product-bar/product-bar/ProductBar.ve.js +17 -17
- package/lib/product-bar/product-bar-name/ProductBarName.js +2 -2
- package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.js +3 -3
- package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.ve.js +1 -1
- package/lib/product-bar/product-bar-tab/ProductBarTab.js +1 -1
- package/lib/product-bar/slack-link/SlackLink.ve.js +1 -1
- package/lib/product-bar/style.css +3 -2
- package/lib/product-bar-vertical/index.js +5 -250
- package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.js +1 -1
- package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.ve.js +22 -22
- package/lib/product-bar-vertical/product-bar-vertical-header/ProductBarVerticalHeader.js +1 -1
- package/lib/product-bar-vertical/product-bar-vertical-item/ProductBarVerticalItem.js +2 -2
- package/lib/product-bar-vertical/style.css +1 -2
- package/lib/progress-indicators/index.js +4 -381
- package/lib/progress-indicators/progress-bar/ProgressBar.js +2 -2
- package/lib/progress-indicators/progress-bar/ProgressBar.ve.js +26 -26
- package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.ve.js +42 -42
- package/lib/progress-indicators/style.css +2 -2
- package/lib/rich-text-editor/index.js +1 -580
- package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.ve.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/RichTextEditor.js +2 -2
- package/lib/rich-text-editor/rich-text-editor/RichTextEditor.ve.js +7 -7
- package/lib/rich-text-editor/style.css +2 -2
- package/lib/scrollable-container/ScrollableContainer.ve.js +1 -1
- package/lib/scrollable-container/index.js +1 -22
- package/lib/scrollable-container/style.css +1 -2
- package/lib/side-nav/index.js +5 -202
- package/lib/side-nav/side-nav/SideNav.js +1 -1
- package/lib/side-nav/side-nav/SideNav.ve.js +7 -7
- package/lib/side-nav/side-nav-section/SideNavSection.js +1 -1
- package/lib/side-nav/style.css +1 -2
- package/lib/sorting-header/caret/caret.ve.js +3 -3
- package/lib/sorting-header/index.js +3 -276
- package/lib/sorting-header/sorting-header/SortingHeader.ve.js +9 -9
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.ve.js +6 -6
- package/lib/sorting-header/style.css +3 -2
- package/lib/style.css +1 -1
- package/lib/tabs/index.js +4 -261
- package/lib/tabs/style.css +2 -2
- package/lib/tabs/tab/Tab.ve.js +21 -21
- package/lib/tabs/tabs/Tabs.js +2 -2
- package/lib/tabs/tabs/Tabs.ve.js +5 -5
- package/lib/tags/clickable-tag/ClickableTag.js +1 -1
- package/lib/tags/clickable-tag/ClickableTag.ve.js +21 -21
- package/lib/tags/index.js +4 -352
- package/lib/tags/split-tag/SplitTag.js +1 -1
- package/lib/tags/split-tag/SplitTag.ve.js +15 -15
- package/lib/tags/style.css +3 -2
- package/lib/tags/tag/Tag.ve.js +19 -19
- package/lib/zero-state/ZeroState.js +1 -1
- package/lib/zero-state/ZeroState.ve.js +11 -11
- package/lib/zero-state/index.js +1 -109
- package/lib/zero-state/style.css +1 -2
- package/package.json +11 -41
- package/scripts/family-stylesheets.mjs +100 -0
- package/scripts/watch-all.mjs +11 -24
- package/vite.subpaths.config.mjs +15 -4
- package/lib/action-bar/index.umd.cjs +0 -1
- package/lib/add-to-list/index.umd.cjs +0 -1
- package/lib/buttons/index.umd.cjs +0 -1
- package/lib/cards/index.umd.cjs +0 -1
- package/lib/content-row/index.umd.cjs +0 -1
- package/lib/content-tiles/index.umd.cjs +0 -1
- package/lib/core.css +0 -2
- package/lib/dropdowns/index.umd.cjs +0 -1
- package/lib/feedback-block/index.umd.cjs +0 -1
- package/lib/file-upload/index.umd.cjs +0 -1
- package/lib/filter-tiles/index.umd.cjs +0 -1
- package/lib/focused-task/index.umd.cjs +0 -1
- package/lib/growler/index.umd.cjs +0 -1
- package/lib/insight-card/index.umd.cjs +0 -1
- package/lib/key-value-set/index.umd.cjs +0 -1
- package/lib/list-bar/index.umd.cjs +0 -1
- package/lib/matrix/index.umd.cjs +0 -1
- package/lib/modal/index.umd.cjs +0 -1
- package/lib/page-title/index.umd.cjs +0 -1
- package/lib/photo/index.umd.cjs +0 -1
- package/lib/product-bar/index.umd.cjs +0 -1
- package/lib/product-bar-vertical/index.umd.cjs +0 -1
- package/lib/progress-indicators/index.umd.cjs +0 -1
- package/lib/rich-text-editor/index.umd.cjs +0 -13
- package/lib/scrollable-container/index.umd.cjs +0 -1
- package/lib/side-nav/index.umd.cjs +0 -1
- package/lib/sorting-header/index.umd.cjs +0 -1
- package/lib/tabs/index.umd.cjs +0 -1
- package/lib/tags/index.umd.cjs +0 -1
- package/lib/zero-state/index.umd.cjs +0 -1
- package/vite.action-bar.config.mjs +0 -43
- package/vite.add-to-list.config.mjs +0 -43
- package/vite.buttons.config.mjs +0 -44
- package/vite.cards.config.mjs +0 -43
- package/vite.content-row.config.mjs +0 -43
- package/vite.content-tiles.config.mjs +0 -43
- package/vite.dropdowns.config.mjs +0 -44
- package/vite.editable-table.config.mjs +0 -71
- package/vite.feedback-block.config.mjs +0 -43
- package/vite.file-upload.config.mjs +0 -43
- package/vite.filter-tiles.config.mjs +0 -43
- package/vite.focused-task.config.mjs +0 -43
- package/vite.growler.config.mjs +0 -44
- package/vite.insight-card.config.mjs +0 -43
- package/vite.key-value-set.config.mjs +0 -43
- package/vite.list-bar.config.mjs +0 -43
- package/vite.matrix.config.mjs +0 -43
- package/vite.modal.config.mjs +0 -43
- package/vite.page-title.config.mjs +0 -43
- package/vite.photo.config.mjs +0 -43
- package/vite.product-bar-vertical.config.mjs +0 -43
- package/vite.product-bar.config.mjs +0 -45
- package/vite.progress-indicators.config.mjs +0 -43
- package/vite.rich-text-editor.config.mjs +0 -51
- package/vite.scrollable-container.config.mjs +0 -43
- package/vite.side-nav.config.mjs +0 -43
- package/vite.sorting-header.config.mjs +0 -43
- package/vite.tabs.config.mjs +0 -46
- package/vite.tags.config.mjs +0 -43
- package/vite.zero-state.config.mjs +0 -43
package/lib/zero-state/index.js
CHANGED
|
@@ -1,109 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Icon as t, Metadata as n, cl as r, contentOf as i } from "@sps-woodland/core";
|
|
3
|
-
import { BUILDING_LARGE as a } from "@sps-woodland/illustrations";
|
|
4
|
-
//#region ../../../node_modules/.pnpm/@vanilla-extract+recipes@0.2.5_@vanilla-extract+css@1.21.3/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
|
|
5
|
-
function o(e, t, n) {
|
|
6
|
-
return t in e ? Object.defineProperty(e, t, {
|
|
7
|
-
value: n,
|
|
8
|
-
enumerable: !0,
|
|
9
|
-
configurable: !0,
|
|
10
|
-
writable: !0
|
|
11
|
-
}) : e[t] = n, e;
|
|
12
|
-
}
|
|
13
|
-
function s(e, t) {
|
|
14
|
-
var n = Object.keys(e);
|
|
15
|
-
if (Object.getOwnPropertySymbols) {
|
|
16
|
-
var r = Object.getOwnPropertySymbols(e);
|
|
17
|
-
t && (r = r.filter(function(t) {
|
|
18
|
-
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
19
|
-
})), n.push.apply(n, r);
|
|
20
|
-
}
|
|
21
|
-
return n;
|
|
22
|
-
}
|
|
23
|
-
function c(e) {
|
|
24
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
25
|
-
var n = arguments[t] == null ? {} : arguments[t];
|
|
26
|
-
t % 2 ? s(Object(n), !0).forEach(function(t) {
|
|
27
|
-
o(e, t, n[t]);
|
|
28
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : s(Object(n)).forEach(function(t) {
|
|
29
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
return e;
|
|
33
|
-
}
|
|
34
|
-
var l = (e, t, n) => {
|
|
35
|
-
for (var r of Object.keys(e)) if (e[r] !== (t[r] ?? n[r])) return !1;
|
|
36
|
-
return !0;
|
|
37
|
-
}, u = (e) => (t) => {
|
|
38
|
-
var n = e.defaultClassName, r = c(c({}, e.defaultVariants), t);
|
|
39
|
-
for (var i in r) {
|
|
40
|
-
var a = r[i] ?? e.defaultVariants[i];
|
|
41
|
-
if (a != null) {
|
|
42
|
-
var o = a;
|
|
43
|
-
typeof o == "boolean" && (o = o === !0 ? "true" : "false");
|
|
44
|
-
var s = e.variantClassNames[i][o];
|
|
45
|
-
s && (n += " " + s);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
for (var [u, d] of e.compoundVariants) l(u, r, e.defaultVariants) && (n += " " + d);
|
|
49
|
-
return n;
|
|
50
|
-
}, d = u({
|
|
51
|
-
defaultClassName: "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luu0",
|
|
52
|
-
variantClassNames: { micro: {
|
|
53
|
-
true: "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luu1",
|
|
54
|
-
false: "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luu2"
|
|
55
|
-
} },
|
|
56
|
-
defaultVariants: {},
|
|
57
|
-
compoundVariants: []
|
|
58
|
-
}), f = u({
|
|
59
|
-
defaultClassName: "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luu3",
|
|
60
|
-
variantClassNames: { micro: {
|
|
61
|
-
true: "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luu4",
|
|
62
|
-
false: "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luu5"
|
|
63
|
-
} },
|
|
64
|
-
defaultVariants: { micro: !1 },
|
|
65
|
-
compoundVariants: []
|
|
66
|
-
}), p = "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luu6", m = u({
|
|
67
|
-
defaultClassName: "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luu7",
|
|
68
|
-
variantClassNames: { micro: {
|
|
69
|
-
true: "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luu8",
|
|
70
|
-
false: "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luu9"
|
|
71
|
-
} },
|
|
72
|
-
defaultVariants: { micro: !1 },
|
|
73
|
-
compoundVariants: []
|
|
74
|
-
}), h = "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luub", g = "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luuc";
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region src/zero-state/ZeroState.tsx
|
|
77
|
-
function _({ artwork: n, heading: o, illustration: s, subHeading: c, micro: l = !1, children: u, className: _, icon: v, ...y }) {
|
|
78
|
-
let b = s || n || a;
|
|
79
|
-
return /* @__PURE__ */ e.createElement("div", { className: d({ micro: l }) }, /* @__PURE__ */ e.createElement("div", {
|
|
80
|
-
className: r(f({ micro: l }), _),
|
|
81
|
-
...y
|
|
82
|
-
}, l ? /* @__PURE__ */ e.createElement(e.Fragment, null, v ? /* @__PURE__ */ e.createElement(t, {
|
|
83
|
-
className: g,
|
|
84
|
-
icon: v,
|
|
85
|
-
"aria-hidden": "true"
|
|
86
|
-
}) : /* @__PURE__ */ e.createElement("img", {
|
|
87
|
-
style: { height: "3rem" },
|
|
88
|
-
src: b
|
|
89
|
-
})) : /* @__PURE__ */ e.createElement("img", {
|
|
90
|
-
className: p,
|
|
91
|
-
src: b,
|
|
92
|
-
alt: ""
|
|
93
|
-
}), o && (typeof o == "string" ? /* @__PURE__ */ e.createElement("h1", { className: m({ micro: l }) }, o) : i(o)), c && (typeof c == "string" ? /* @__PURE__ */ e.createElement("h2", { className: "pkg_sps-woodland_core__family_zero-state__version_8_56_12__hash_sa7luua" }, c) : i(c)), /* @__PURE__ */ e.createElement("div", { className: h }, u)));
|
|
94
|
-
}
|
|
95
|
-
n.set(_, {
|
|
96
|
-
name: "ZeroState",
|
|
97
|
-
props: {
|
|
98
|
-
artwork: { type: "string" },
|
|
99
|
-
heading: { type: "string | ReactNodeOrRenderFn" },
|
|
100
|
-
illustration: { type: "string" },
|
|
101
|
-
subHeading: { type: "string | ReactNodeOrRenderFn" },
|
|
102
|
-
micro: {
|
|
103
|
-
type: "boolean",
|
|
104
|
-
default: "false"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
//#endregion
|
|
109
|
-
export { _ as ZeroState };
|
|
1
|
+
export { ZeroState } from "./ZeroState.js";
|
package/lib/zero-state/style.css
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
.pkg_sps-woodland_core__family_zero-
|
|
2
|
-
/*$vite$:1*/
|
|
1
|
+
.pkg_sps-woodland_core__family_zero-state__version_8_56_13__hash_sa7luu2{padding:1rem}.pkg_sps-woodland_core__family_zero-state__version_8_56_13__hash_sa7luu3{text-align:center;margin:auto;padding:2rem 0}.pkg_sps-woodland_core__family_zero-state__version_8_56_13__hash_sa7luu4{flex-direction:column;justify-content:center;align-items:center;width:auto;height:100%;display:flex}.pkg_sps-woodland_core__family_zero-state__version_8_56_13__hash_sa7luu6{width:12.5rem;height:6.25rem;margin-bottom:1rem}.pkg_sps-woodland_core__family_zero-state__version_8_56_13__hash_sa7luu7{margin-bottom:0}.pkg_sps-woodland_core__family_zero-state__version_8_56_13__hash_sa7luu8{color:#4b5356;font-size:1rem;font-weight:600;line-height:1.25rem}.pkg_sps-woodland_core__family_zero-state__version_8_56_13__hash_sa7luu9{color:#1f282c;font-size:1.5rem;line-height:1.5rem}.pkg_sps-woodland_core__family_zero-state__version_8_56_13__hash_sa7luua{color:#4b5356;margin-top:.25rem;margin-bottom:0;font-size:.875rem;line-height:1.25rem}.pkg_sps-woodland_core__family_zero-state__version_8_56_13__hash_sa7luub{margin-top:1rem}.pkg_sps-woodland_core__family_zero-state__version_8_56_13__hash_sa7luuc{color:#717779;padding-bottom:.25rem;font-size:3rem;line-height:3rem}@media screen and (width>=768px){.pkg_sps-woodland_core__family_zero-state__version_8_56_13__hash_sa7luu3{width:75%}}@media screen and (width>=992px){.pkg_sps-woodland_core__family_zero-state__version_8_56_13__hash_sa7luu3{width:50%}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/core",
|
|
3
3
|
"description": "SPS Woodland Design System core library code",
|
|
4
|
-
"version": "8.56.
|
|
4
|
+
"version": "8.56.13",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/core",
|
|
@@ -712,11 +712,11 @@
|
|
|
712
712
|
"@spscommerce/utils": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
713
713
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
714
714
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
715
|
-
"@sps-woodland/illustrations": "8.56.
|
|
716
|
-
"@sps-woodland/tokens": "8.56.
|
|
717
|
-
"@spscommerce/ds-react": "8.56.
|
|
718
|
-
"@spscommerce/ds-shared": "8.56.
|
|
719
|
-
"@spscommerce/i18n": "8.56.
|
|
715
|
+
"@sps-woodland/illustrations": "8.56.13",
|
|
716
|
+
"@sps-woodland/tokens": "8.56.13",
|
|
717
|
+
"@spscommerce/ds-react": "8.56.13",
|
|
718
|
+
"@spscommerce/ds-shared": "8.56.13",
|
|
719
|
+
"@spscommerce/i18n": "8.56.13"
|
|
720
720
|
},
|
|
721
721
|
"devDependencies": {
|
|
722
722
|
"@ariakit/react": "0.4.15",
|
|
@@ -729,10 +729,10 @@
|
|
|
729
729
|
"postcss-import": "^16.1.1",
|
|
730
730
|
"react": "16.14.0",
|
|
731
731
|
"react-dom": "16.14.0",
|
|
732
|
-
"@sps-woodland/illustrations": "8.56.
|
|
733
|
-
"@sps-woodland/tokens": "8.56.
|
|
734
|
-
"@spscommerce/ds-react": "8.56.
|
|
735
|
-
"@spscommerce/ds-shared": "8.56.
|
|
732
|
+
"@sps-woodland/illustrations": "8.56.13",
|
|
733
|
+
"@sps-woodland/tokens": "8.56.13",
|
|
734
|
+
"@spscommerce/ds-react": "8.56.13",
|
|
735
|
+
"@spscommerce/ds-shared": "8.56.13"
|
|
736
736
|
},
|
|
737
737
|
"dependencies": {
|
|
738
738
|
"@handsontable/react": "^15.3.0",
|
|
@@ -762,39 +762,9 @@
|
|
|
762
762
|
"unist-util-visit": "^5.1.0"
|
|
763
763
|
},
|
|
764
764
|
"scripts": {
|
|
765
|
-
"build": "pnpm run build:js && pnpm run build:subpaths && pnpm run build:
|
|
765
|
+
"build": "pnpm run build:js && pnpm run build:subpaths && pnpm run build:types",
|
|
766
766
|
"build:js": "vite build",
|
|
767
767
|
"build:subpaths": "vite build --config vite.subpaths.config.mjs",
|
|
768
|
-
"build:insight-card-css": "vite build --config vite.insight-card.config.mjs",
|
|
769
|
-
"build:page-title-css": "vite build --config vite.page-title.config.mjs",
|
|
770
|
-
"build:filter-tiles-css": "vite build --config vite.filter-tiles.config.mjs",
|
|
771
|
-
"build:key-value-set-css": "vite build --config vite.key-value-set.config.mjs",
|
|
772
|
-
"build:sorting-header-css": "vite build --config vite.sorting-header.config.mjs",
|
|
773
|
-
"build:content-tiles-css": "vite build --config vite.content-tiles.config.mjs",
|
|
774
|
-
"build:matrix-css": "vite build --config vite.matrix.config.mjs",
|
|
775
|
-
"build:photo-css": "vite build --config vite.photo.config.mjs",
|
|
776
|
-
"build:dropdowns-css": "vite build --config vite.dropdowns.config.mjs",
|
|
777
|
-
"build:side-nav-css": "vite build --config vite.side-nav.config.mjs",
|
|
778
|
-
"build:product-bar-css": "vite build --config vite.product-bar.config.mjs",
|
|
779
|
-
"build:editable-table-css": "vite build --config vite.editable-table.config.mjs",
|
|
780
|
-
"build:action-bar-css": "vite build --config vite.action-bar.config.mjs",
|
|
781
|
-
"build:content-row-css": "vite build --config vite.content-row.config.mjs",
|
|
782
|
-
"build:file-upload-css": "vite build --config vite.file-upload.config.mjs",
|
|
783
|
-
"build:focused-task-css": "vite build --config vite.focused-task.config.mjs",
|
|
784
|
-
"build:modal-css": "vite build --config vite.modal.config.mjs",
|
|
785
|
-
"build:product-bar-vertical-css": "vite build --config vite.product-bar-vertical.config.mjs",
|
|
786
|
-
"build:progress-indicators-css": "vite build --config vite.progress-indicators.config.mjs",
|
|
787
|
-
"build:growler-css": "vite build --config vite.growler.config.mjs",
|
|
788
|
-
"build:list-bar-css": "vite build --config vite.list-bar.config.mjs",
|
|
789
|
-
"build:cards-css": "vite build --config vite.cards.config.mjs",
|
|
790
|
-
"build:add-to-list-css": "vite build --config vite.add-to-list.config.mjs",
|
|
791
|
-
"build:rich-text-editor-css": "vite build --config vite.rich-text-editor.config.mjs",
|
|
792
|
-
"build:feedback-block-css": "vite build --config vite.feedback-block.config.mjs",
|
|
793
|
-
"build:scrollable-container-css": "vite build --config vite.scrollable-container.config.mjs",
|
|
794
|
-
"build:zero-state-css": "vite build --config vite.zero-state.config.mjs",
|
|
795
|
-
"build:tabs-css": "vite build --config vite.tabs.config.mjs",
|
|
796
|
-
"build:tags-css": "vite build --config vite.tags.config.mjs",
|
|
797
|
-
"build:buttons-css": "vite build --config vite.buttons.config.mjs",
|
|
798
768
|
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
|
|
799
769
|
"watch": "node scripts/watch-all.mjs",
|
|
800
770
|
"clean": "git clean -fdX",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vite plugin for vite.subpaths.config.mjs: writes lib/<family>/style.css for every family stylesheet
|
|
3
|
+
* that core's package.json exports (`./<family>/style.css`), from the same Rollup graph that builds
|
|
4
|
+
* the JS.
|
|
5
|
+
*
|
|
6
|
+
* The subpaths build runs with `cssCodeSplit: true`, so Vite emits one CSS asset per vanilla-extract
|
|
7
|
+
* module. For each family this walks the module graph from `<family>/index.ts` in source import
|
|
8
|
+
* order (dependencies first, the order the modules run in) and joins those modules' CSS. Imports of other
|
|
9
|
+
* families go through `@sps-woodland/*` specifiers, which are external, so each stylesheet holds only
|
|
10
|
+
* its own family's CSS. The per-module CSS assets are then dropped from the output.
|
|
11
|
+
*
|
|
12
|
+
* editable-table is the exception: its styles are a plain .css file that imports handsontable's
|
|
13
|
+
* stylesheet, so it is run through postcss-import to inline that import into one file.
|
|
14
|
+
*
|
|
15
|
+
* Only families whose `<family>/index` entry is in this build get a stylesheet, because
|
|
16
|
+
* scripts/watch-all.mjs runs the subpaths config as one watcher per family. That every exported
|
|
17
|
+
* stylesheet has an entry is checked in vite.subpaths.config.mjs against the full entry list.
|
|
18
|
+
*/
|
|
19
|
+
import fs from "node:fs";
|
|
20
|
+
import path from "node:path";
|
|
21
|
+
import postcss from "postcss";
|
|
22
|
+
import postcssImport from "postcss-import";
|
|
23
|
+
|
|
24
|
+
export function exportedStylesheetFamilies(exports) {
|
|
25
|
+
return Object.keys(exports)
|
|
26
|
+
.map((key) => /^\.\/([^/]+)\/style\.css$/.exec(key)?.[1])
|
|
27
|
+
.filter((family) => family && family !== "lib");
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function familyStylesheets({ exports, srcDir }) {
|
|
31
|
+
const editableTableCss = path.join(srcDir, "editable-table/EditableTable.css");
|
|
32
|
+
const exported = exportedStylesheetFamilies(exports);
|
|
33
|
+
// watch-all.mjs runs several builds with this one plugin instance at once, so nothing is kept
|
|
34
|
+
// between hooks: each hook reads its own build's entries.
|
|
35
|
+
const familiesIn = (entryNames) =>
|
|
36
|
+
exported.filter((family) => entryNames.includes(`${family}/index`));
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
name: "woodland-family-stylesheets",
|
|
40
|
+
enforce: "post",
|
|
41
|
+
buildStart(options) {
|
|
42
|
+
// Not imported by any module, so the watcher would not see edits to it otherwise.
|
|
43
|
+
if (familiesIn(Object.keys(options.input)).includes("editable-table")) {
|
|
44
|
+
this.addWatchFile(editableTableCss);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
async generateBundle(_options, bundle) {
|
|
48
|
+
const chunks = Object.values(bundle).filter((output) => output.type === "chunk");
|
|
49
|
+
const families = familiesIn(
|
|
50
|
+
chunks.filter((chunk) => chunk.isEntry).map((chunk) => chunk.name)
|
|
51
|
+
);
|
|
52
|
+
const chunkByFile = new Map(chunks.map((chunk) => [chunk.fileName, chunk]));
|
|
53
|
+
// preserveModules gives every module its own chunk.
|
|
54
|
+
const chunkByModule = new Map(chunks.map((chunk) => [chunk.facadeModuleId, chunk]));
|
|
55
|
+
|
|
56
|
+
for (const family of families) {
|
|
57
|
+
const fileName = `${family}/style.css`;
|
|
58
|
+
|
|
59
|
+
if (family === "editable-table") {
|
|
60
|
+
const result = await postcss([postcssImport()]).process(
|
|
61
|
+
await fs.promises.readFile(editableTableCss, "utf8"),
|
|
62
|
+
{ from: editableTableCss }
|
|
63
|
+
);
|
|
64
|
+
this.emitFile({ type: "asset", fileName, source: result.css });
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const entry = chunkByFile.get(`${family}/index.js`);
|
|
69
|
+
|
|
70
|
+
// Walk modules in source import order (chunk.imports is not), dependencies first.
|
|
71
|
+
const cssFiles = [];
|
|
72
|
+
const visited = new Set();
|
|
73
|
+
const visit = (moduleId) => {
|
|
74
|
+
if (visited.has(moduleId)) return;
|
|
75
|
+
visited.add(moduleId);
|
|
76
|
+
const chunk = chunkByModule.get(moduleId);
|
|
77
|
+
if (!chunk) return; // external
|
|
78
|
+
for (const imported of this.getModuleInfo(moduleId).importedIds) visit(imported);
|
|
79
|
+
for (const css of chunk.viteMetadata?.importedCss ?? []) {
|
|
80
|
+
if (!cssFiles.includes(css)) cssFiles.push(css);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
visit(entry.facadeModuleId);
|
|
84
|
+
|
|
85
|
+
this.emitFile({
|
|
86
|
+
type: "asset",
|
|
87
|
+
fileName,
|
|
88
|
+
source: cssFiles.map((css) => bundle[css].source).join(""),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const stylesheets = new Set(families.map((family) => `${family}/style.css`));
|
|
93
|
+
for (const output of Object.values(bundle)) {
|
|
94
|
+
if (output.type === "asset" && output.fileName.endsWith(".css") && !stylesheets.has(output.fileName)) {
|
|
95
|
+
delete bundle[output.fileName];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
}
|
package/scripts/watch-all.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Watches
|
|
4
|
-
* the main entry
|
|
5
|
-
* family's
|
|
3
|
+
* Watches both vite configs that make up @sps-woodland/core's dev output —
|
|
4
|
+
* the main entry and the subpaths build (@sps-woodland/core/<family>, which
|
|
5
|
+
* also writes each family's style.css) — in a single Node process.
|
|
6
6
|
*
|
|
7
7
|
* The old `watch` script (`vite build --watch`) only covered the main entry,
|
|
8
8
|
* so editing a component under src/<family> never showed up live in docs:
|
|
9
9
|
* the subpath JS and the family CSS it depends on were never rebuilt.
|
|
10
|
-
* Running each
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Running each watcher through Vite's `build()` API here instead of spawning
|
|
11
|
+
* separate `vite build --watch` CLI processes also avoids paying Node + Vite
|
|
12
|
+
* startup cost once per family.
|
|
13
13
|
*
|
|
14
14
|
* The subpaths config (vite.subpaths.config.mjs) builds every family's JS as
|
|
15
15
|
* entries in one shared Rollup graph. In watch mode, Rollup re-emits every
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* sees a rename land, never a partial write.
|
|
47
47
|
*/
|
|
48
48
|
import { build, loadConfigFromFile } from "vite";
|
|
49
|
-
import {
|
|
49
|
+
import { mkdirSync, mkdtempSync, readdirSync as readDirEntries, renameSync, rmSync } from "node:fs";
|
|
50
50
|
import path from "node:path";
|
|
51
51
|
import { fileURLToPath } from "node:url";
|
|
52
52
|
|
|
@@ -81,15 +81,6 @@ function atomicMovePlugin(realOutDir, tempOutDir) {
|
|
|
81
81
|
const MAIN_CONFIG = "vite.config.mjs";
|
|
82
82
|
const SUBPATHS_CONFIG = "vite.subpaths.config.mjs";
|
|
83
83
|
|
|
84
|
-
const familyConfigs = readdirSync(coreDir)
|
|
85
|
-
.filter((file) => /^vite\..+\.config\.mjs$/.test(file))
|
|
86
|
-
.filter((file) => file !== MAIN_CONFIG && file !== SUBPATHS_CONFIG)
|
|
87
|
-
.sort();
|
|
88
|
-
|
|
89
|
-
function labelFor(fileName) {
|
|
90
|
-
if (fileName === MAIN_CONFIG) return "core";
|
|
91
|
-
return fileName.replace(/^vite\./, "").replace(/\.config\.mjs$/, "");
|
|
92
|
-
}
|
|
93
84
|
|
|
94
85
|
async function loadUserConfig(fileName) {
|
|
95
86
|
// Load exactly the way `vite build --config <fileName>` would (handles the
|
|
@@ -132,8 +123,8 @@ function startWatcher(name, userConfig) {
|
|
|
132
123
|
});
|
|
133
124
|
}
|
|
134
125
|
|
|
135
|
-
async function
|
|
136
|
-
return startWatcher(
|
|
126
|
+
async function watchMain() {
|
|
127
|
+
return startWatcher("core", await loadUserConfig(MAIN_CONFIG));
|
|
137
128
|
}
|
|
138
129
|
|
|
139
130
|
async function watchSubpathsPerFamily() {
|
|
@@ -164,13 +155,9 @@ async function watchSubpathsPerFamily() {
|
|
|
164
155
|
return results.flat();
|
|
165
156
|
}
|
|
166
157
|
|
|
167
|
-
console.log(
|
|
168
|
-
`@sps-woodland/core: watching ${familyConfigs.length + 2} build targets (main, subpaths split per family, ${familyConfigs.length} family CSS configs)...`
|
|
169
|
-
);
|
|
158
|
+
console.log("@sps-woodland/core: watching the main entry and the subpaths build, split per family...");
|
|
170
159
|
|
|
171
|
-
const allWatchers = (
|
|
172
|
-
await Promise.all([watchConfig(MAIN_CONFIG), watchSubpathsPerFamily(), ...familyConfigs.map(watchConfig)])
|
|
173
|
-
).flat();
|
|
160
|
+
const allWatchers = (await Promise.all([watchMain(), watchSubpathsPerFamily()])).flat();
|
|
174
161
|
|
|
175
162
|
console.log("@sps-woodland/core: initial builds complete, watching for changes.");
|
|
176
163
|
|
package/vite.subpaths.config.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { defineConfig } from "vite";
|
|
|
4
4
|
import pkg from "./package.json" with { type: "json" };
|
|
5
5
|
import { getVanillaExtractPluginProps } from "../../../scripts/vanilla-extract-plugin-props.mjs";
|
|
6
6
|
import { withOutputGlobals } from "../../../scripts/with-output-globals.mjs";
|
|
7
|
+
import { exportedStylesheetFamilies, familyStylesheets } from "./scripts/family-stylesheets.mjs";
|
|
7
8
|
|
|
8
9
|
const packageVersion = process.env.PREDICTED_VERSION || pkg.version;
|
|
9
10
|
|
|
@@ -84,8 +85,8 @@ const entries = {
|
|
|
84
85
|
"product-bar/slack-link/SlackLink": path.resolve(__dirname, "src/product-bar/slack-link/SlackLink.tsx"),
|
|
85
86
|
|
|
86
87
|
// Editable Table — barrel only (EditableTable is name-clashed). Uses a plain .css file (not
|
|
87
|
-
// vanilla-extract);
|
|
88
|
-
//
|
|
88
|
+
// vanilla-extract); scripts/family-stylesheets.mjs runs it through postcss-import to inline the
|
|
89
|
+
// handsontable styles. Brings @handsontable/react +
|
|
89
90
|
// @handsontable/react-wrapper + handsontable as regular deps on core.
|
|
90
91
|
"editable-table/index": path.resolve(__dirname, "src/editable-table/index.ts"),
|
|
91
92
|
|
|
@@ -156,8 +157,8 @@ const entries = {
|
|
|
156
157
|
"add-to-list/index": path.resolve(__dirname, "src/add-to-list/index.ts"),
|
|
157
158
|
|
|
158
159
|
// Column Manager — barrel only (ColumnManager is name-clashed; useColumnManager is a hook).
|
|
159
|
-
// No .css.ts of its own — styles come from @sps-woodland/tokens sprinkles, so no
|
|
160
|
-
//
|
|
160
|
+
// No .css.ts of its own — styles come from @sps-woodland/tokens sprinkles, so no style.css
|
|
161
|
+
// export. Depends on AddToList (now in core/add-to-list).
|
|
161
162
|
"column-manager/index": path.resolve(__dirname, "src/column-manager/index.ts"),
|
|
162
163
|
|
|
163
164
|
// Rich Text Editor — barrel only (RichTextEditor is name-clashed). Bundles 9 unified/rehype/
|
|
@@ -202,6 +203,13 @@ const entries = {
|
|
|
202
203
|
"buttons/button/Button": path.resolve(__dirname, "src/buttons/button/Button.tsx"),
|
|
203
204
|
};
|
|
204
205
|
|
|
206
|
+
// Every `./<family>/style.css` in package.json's exports is built from that family's barrel entry.
|
|
207
|
+
for (const family of exportedStylesheetFamilies(pkg.exports)) {
|
|
208
|
+
if (!entries[`${family}/index`]) {
|
|
209
|
+
throw new Error(`package.json exports ./${family}/style.css, but entries has no "${family}/index"`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
205
213
|
export default defineConfig(
|
|
206
214
|
withOutputGlobals({
|
|
207
215
|
plugins: [
|
|
@@ -211,8 +219,11 @@ export default defineConfig(
|
|
|
211
219
|
packageVersion,
|
|
212
220
|
})
|
|
213
221
|
),
|
|
222
|
+
familyStylesheets({ exports: pkg.exports, srcDir: path.resolve(__dirname, "src") }),
|
|
214
223
|
],
|
|
215
224
|
build: {
|
|
225
|
+
// One CSS asset per module, which familyStylesheets joins into each family's style.css.
|
|
226
|
+
cssCodeSplit: true,
|
|
216
227
|
lib: {
|
|
217
228
|
entry: entries,
|
|
218
229
|
formats: ["es"],
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("@sps-woodland/core/button"),require("@sps-woodland/core"),require("@sps-woodland/core/tag"),require("@spscommerce/i18n")):typeof define==`function`&&define.amd?define([`exports`,`react`,`@sps-woodland/core/button`,`@sps-woodland/core`,`@sps-woodland/core/tag`,`@spscommerce/i18n`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ActionBar={},e.react,e.spsWoodlandCoreButton,e.spsWoodlandCore,e.spsWoodlandCoreTag,e.spscommerceI18n))})(this,function(e,t,n,r,i,a){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var o=Object.create,s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,f=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=l(t),a=0,o=i.length,u;a<o;a++)u=i[a],!d.call(e,u)&&u!==n&&s(e,u,{get:(e=>t[e]).bind(null,u),enumerable:!(r=c(t,u))||r.enumerable});return e};t=((e,t,n)=>(n=e==null?{}:o(u(e)),f(t||!e||!e.__esModule||!d.call(e,`default`)?s(n,`default`,{value:e,enumerable:!0}):n,e)))(t,1);var p=`pkg_sps-woodland_core__family_action-bar__version_8_56_12__hash_nz1a1l0`,m=`pkg_sps-woodland_core__family_action-bar__version_8_56_12__hash_nz1a1l1`,h=`pkg_sps-woodland_core__family_action-bar__version_8_56_12__hash_nz1a1l2`,g=`pkg_sps-woodland_core__family_action-bar__version_8_56_12__hash_nz1a1l3`,_=`pkg_sps-woodland_core__family_action-bar__version_8_56_12__hash_nz1a1l4`,v=`pkg_sps-woodland_core__family_action-bar__version_8_56_12__hash_nz1a1l5`,y=`pkg_sps-woodland_core__family_action-bar__version_8_56_12__hash_nz1a1l6`,b=`pkg_sps-woodland_core__family_action-bar__version_8_56_12__hash_nz1a1l7`;function x({className:e,children:n,...i}){return t.createElement(r.Box,{className:(0,r.cl)(b,e),...i},n)}r.Metadata.set(x,{name:`ActionBarAdditionalContent`,props:{}});function S({className:e,children:o,clearSelected:s,itemsSelected:c,itemsSelectedLabel:l,clearSelectedLabel:u,...d}){let{t:f}=(0,a.useWoodlandLanguage)(),[b,S]=(0,r.selectChildren)(o,[{type:x}]);return Number(c)>0?t.createElement(`div`,{className:(0,r.cl)(p,e),...d},t.createElement(`div`,{className:m},b,t.createElement(`div`,{className:h},t.createElement(`div`,{className:g},t.createElement(i.Tag,{kind:`info`,className:_},c),l??f(`listActionBar.itemsSelected`,{defaultValue:`Items Selected`})),t.createElement(`div`,{className:v},S),t.createElement(`div`,{className:y},t.createElement(n.Button,{title:f(`listActionBar.clearSelected`,{defaultValue:`Clear Selected`}),kind:`link`,icon:`x`,onPress:s},u??f(`listActionBar.clearSelected`,{defaultValue:`Clear Selected`})))))):t.createElement(t.Fragment,null)}r.Metadata.set(S,{name:`ActionBar`,props:{clearSelected:{type:`() => void`,required:!0},itemsSelected:{type:`number | string`,required:!0},itemsSelectedLabel:{type:`string`,required:!1},clearSelectedLabel:{type:`string`,required:!1}}}),e.ActionBar=S,e.ActionBarAdditionalContent=x});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("react-aria"),require("@spscommerce/ds-react"),require("@spscommerce/ds-shared"),require("@sps-woodland/illustrations"),require("@sps-woodland/core"),require("@sps-woodland/core/zero-state"),require("@sps-woodland/core/card"),require("@sps-woodland/tokens"),require("@sps-woodland/core/tag"),require("@sps-woodland/core/scrollable-container"),require("@sps-woodland/core/feedback-block"),require("@spscommerce/i18n"),require("@sps-woodland/core/buttons")):typeof define==`function`&&define.amd?define([`exports`,`react`,`react-aria`,`@spscommerce/ds-react`,`@spscommerce/ds-shared`,`@sps-woodland/illustrations`,`@sps-woodland/core`,`@sps-woodland/core/zero-state`,`@sps-woodland/core/card`,`@sps-woodland/tokens`,`@sps-woodland/core/tag`,`@sps-woodland/core/scrollable-container`,`@sps-woodland/core/feedback-block`,`@spscommerce/i18n`,`@sps-woodland/core/buttons`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.AddToList={},e.react,e.reactAria,e.spscommerceDsReact,e.spscommerceDsShared,e.spsWoodlandIllustrations,e.spsWoodlandCore,e.spsWoodlandCoreZeroState,e.spsWoodlandCoreCard,e.spsWoodlandTokens,e.spsWoodlandCoreTag,e.spsWoodlandCoreScrollableContainer,e.spsWoodlandCoreFeedbackBlock,e.spscommerceI18n,e.spsWoodlandCoreButtons))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var h=Object.create,g=Object.defineProperty,_=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,y=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,x=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=v(t),a=0,o=i.length,s;a<o;a++)s=i[a],!b.call(e,s)&&s!==n&&g(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=_(t,s))||r.enumerable});return e};t=((e,t,n)=>(n=e==null?{}:h(y(e)),x(t||!e||!e.__esModule||!b.call(e,`default`)?g(n,`default`,{value:e,enumerable:!0}):n,e)))(t,1);var S=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,C=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=S[n[e]&63];return t};function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(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 E(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?T(Object(n),!0).forEach(function(t){w(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var D=(e,t,n)=>{for(var r of Object.keys(e))if(e[r]!==(t[r]??n[r]))return!1;return!0},O=e=>t=>{var n=e.defaultClassName,r=E(E({},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)D(c,r,e.defaultVariants)&&(n+=` `+l);return n},k=O({defaultClassName:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx90`,variantClassNames:{vertical:{true:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx91`,false:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx92`}},defaultVariants:{},compoundVariants:[]}),A=O({defaultClassName:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx93`,variantClassNames:{vertical:{true:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx94`,false:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx95`}},defaultVariants:{},compoundVariants:[]}),j=`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx96`,M=O({defaultClassName:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx97`,variantClassNames:{isLeftSide:{true:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx98`,false:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx99`},isRightSide:{true:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9a`,false:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9b`},adjustForPhantomDroppableContainer:{true:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9c`,false:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9d`}},defaultVariants:{},compoundVariants:[]}),N=O({defaultClassName:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9e`,variantClassNames:{vertical:{true:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9f`,false:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9g`}},defaultVariants:{},compoundVariants:[]}),P=O({defaultClassName:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9h`,variantClassNames:{vertical:{true:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9i`,false:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9j`}},defaultVariants:{},compoundVariants:[]}),ee=`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9k`,F=`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9m`,te=O({defaultClassName:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9n`,variantClassNames:{isDragging:{true:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9o`,false:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9p`}},defaultVariants:{},compoundVariants:[]}),ne=`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9q`,I=O({defaultClassName:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9r`,variantClassNames:{isDropTarget:{true:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9s`,false:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9t`}},defaultVariants:{},compoundVariants:[]}),re=O({defaultClassName:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9u`,variantClassNames:{isDropTarget:{true:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9v`,false:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9w`}},defaultVariants:{},compoundVariants:[]}),ie=`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9x`,L=`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9y`,ae=`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx911`;function R({headerText:e,showCount:n,showIcons:r,showMoveAllLinks:i,showMoreOptionsText:a,disableMoveAllLinks:s,maxHeight:c,children:l,side:h,itemCount:g,otherHeader:_,className:v,vertical:y,moveAll:b,adjustForPhantomDroppableContainer:x,"data-testid":S}){let C=(0,o.useChildTestIdAttrBuilder)({"data-testid":S}),{t:w}=(0,p.useWoodlandLanguage)(),T=w(h===`left`?`addToList.onColumnHeader`:`addToList.offColumnHeader`),E=h===`left`?`eye`:`eye-slash`,D=w(h===`left`?`addToList.offColumnHeader`:`addToList.onColumnHeader`),O=w(`addToList.moveAllItemsToCol`,{columnName:_||D}),k=y?t.createElement(t.Fragment,null):t.createElement(`div`,{className:M({isLeftSide:h===`left`,isRightSide:h===`right`,adjustForPhantomDroppableContainer:!!x&&h===`left`})});function A(){b&&typeof b==`function`&&b(h)}return t.createElement(`div`,{className:(0,o.cl)(P({vertical:y}),v),"data-testid":S},t.createElement(`div`,{className:L,...C(`column-header`)},r&&t.createElement(o.Icon,{icon:E,className:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9z`}),e||T,n&&t.createElement(u.Tag,{kind:`key`,className:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx910`},g)),c?t.createElement(`div`,{className:j},k,t.createElement(d.ScrollableContainer,{maxHeight:c},l)):t.createElement(`div`,{className:j},k,l),i&&g>0&&t.createElement(m.Button,{className:x&&h===`right`?`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx913`:void 0,kind:`link`,onClick:A,disabled:s,...C(`move-all-button`)},O),a&&g>0&&t.createElement(f.FeedbackBlock,{kind:`info`,micro:!0},w(`addToList.moreOptionsAvailable`,{defaultValue:`More options available. Use the search field to filter results.`})))}function z({className:e,children:n,filtering:a,manualSorting:s,id:c,"data-testid":l}){let{t:u}=(0,p.useWoodlandLanguage)();return t.createElement(t.Fragment,null,t.createElement(`div`,{role:`listitem`,className:(0,o.cl)(e,I({isDropTarget:!1}),F,`listitem-component`),"data-testid":l},s&&a&&t.createElement(`i`,{className:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9l`,id:`list-item-${c}-drag-handle`}),n),s&&a&&t.createElement(r.SpsTooltip,{for:`list-item-${c}-drag-handle`,position:i.Position.TOP_LEFT,showOn:i.TooltipShowTrigger.CLICK},u(`addToList.disabledDragTooltip`,{defaultValue:`Drag and drop are disabled when filters are engaged`})))}o.Metadata.set(z,{name:`ListItem`});function B({onList:e,offList:u,onHeader:d,offHeader:f,showFilter:h,showCount:g,showIcons:_,showMoveAllLinks:v,manualSort:y,maxDisplayedItems:b,maxHeightPx:x,maxHeightRem:S,onChange:w,onListZeroState:T,offListZeroState:E,vertical:D=!1,onListAlphaSort:O=!0,"data-testid":j}){let M=(0,o.useChildTestIdAttrBuilder)({"data-testid":j}),{t:P}=(0,p.useWoodlandLanguage)(),{formValue:F,formMeta:L}=(0,r.useSpsForm)({filterString:``}),[B,V]=t.useState(``),H=x?x/16:S,U=H?`${H}rem`:``,W=t.useCallback((e,t)=>(!y&&O||t===`right`?[...e].sort((e,t)=>e.label.localeCompare(t.label)):e).map(e=>{let t={...e};return t.id||=C(),t}),[y,O]),G=t.useMemo(()=>W(e,`left`),[e,W]),K=t.useMemo(()=>W(u,`right`),[u,W]),q=t.useCallback(e=>!B||e.label.toLowerCase().includes(B.toLowerCase()),[B]),J=(e,t,n)=>{let r=n.find(t=>t.label===e);r?t===G?w({onList:[...G,r],offList:K.filter(e=>e.label!==r.label)}):n===G&&w({onList:G.filter(e=>e.label!==r.label),offList:[...K,r]}):console.error(`could not remove item`)};function oe(e){V(e.target.value)}function Y(e){w(e===`left`?{onList:G.filter(e=>e.required),offList:[...K,...G.filter(e=>!e.required)]}:{onList:[...G,...K],offList:[]})}let X=t.useCallback(e=>{let{className:r,index:i,isPhantomDroppableContainer:a,children:s,...c}=e,l=t.useRef(null),{dropProps:u,isDropTarget:d}=(0,n.useDrop)({ref:l,async onDrop(e){let t=await Promise.all(e.items.filter(e=>e.kind===`text`&&e.types.has(`text/plain`)).map(e=>e.getText(`text/plain`))),{index:n}=JSON.parse(t[0]),r=[...G],[a]=r.splice(n,1),o=i>n?i-1:i;r.splice(o,0,a),w({onList:r,offList:K})}});return t.createElement(`div`,{ref:l,...y?u:[],className:(0,o.cl)(r,a?re({isDropTarget:d}):I({isDropTarget:d})),...M(`droppable-container`),...c},s)},[G,y]),se=t.useCallback(e=>{let{label:r,data:i,listIndex:a,required:s}=e,c=t.useRef(null),l=t.useRef(null),u={...i,index:a},{dragProps:d,dragButtonProps:f,isDragging:p}=(0,n.useDrag)({preview:c,hasDragButton:!0,getItems(){return[{"text/plain":JSON.stringify(u)}]}}),{buttonProps:h}=(0,n.useButton)(f,l);return t.createElement(`div`,{...y?d:{},role:y?`button`:`listitem`,tabIndex:0,id:`${r}${a}-drag`,className:(0,o.cl)(te({isDragging:p})),...M(`draggable-item`)},t.createElement(X,{index:a},y&&t.createElement(`i`,{...h,ref:l,className:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9k`}),r,!s&&t.createElement(m.Button,{kind:`icon`,icon:`x`,"aria-label":P(`addToList.remove`,{elementName:r,defaultValue:`Remove ${r}`}),onClick:()=>{J(r,K,G)},className:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9x`,...M(`move-item-button`)})),t.createElement(n.DragPreview,{ref:c},()=>t.createElement(`div`,{className:ne},t.createElement(`i`,{className:ee}),r)))},[G,y]),Z=t.useMemo(()=>G.filter(q),[G,q]),Q=t.useMemo(()=>K.filter(q).slice(0,b),[K,q]),ce=!B&&!!v&&Z.length>0,le=!B&&!!v&&Q.length>0,ue=!B&&K.length>Q.length,$=!!y&&!B&&Z.length>0&&!H;return t.createElement(`div`,{"data-testid":j},h&&t.createElement(`div`,{className:l.grid.root},t.createElement(`div`,{className:(0,o.cl)(l.grid[12],`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx912`)},t.createElement(r.SpsTextInput,{value:F.filterString,formMeta:L.fields.filterString,icon:i.SpsIcon.FILTER,onChange:oe,...M(`filter-input`)}))),t.createElement(`div`,{className:(0,o.cl)(k({vertical:D}))},t.createElement(R,{headerText:d,showCount:!B&&g,showIcons:_,showMoveAllLinks:ce,disableMoveAllLinks:G.every(e=>e.required),maxHeight:U,vertical:D,side:`left`,className:A({vertical:D}),otherHeader:f,itemCount:G.length,moveAll:Y,adjustForPhantomDroppableContainer:$,...M(`on-items-list`)},Z.length>0?t.createElement(t.Fragment,null,y&&!B&&Z.map((e,n)=>t.createElement(t.Fragment,{key:e.id},t.createElement(se,{data:e,label:e.label,required:e.required,listIndex:n}),n===Z.length-1&&t.createElement(X,{isPhantomDroppableContainer:!0,index:n+1}))),(!y||B)&&Z.map(e=>t.createElement(z,{key:e.id,filtering:!!B,manualSorting:y,id:e.id,...M(`item`)},e.label,!e.required&&t.createElement(m.Button,{kind:`icon`,icon:`x`,"aria-label":P(`addToList.remove`,{elementName:e.label,defaultValue:`Remove ${e.label}`}),onClick:()=>{J(e.label,K,G)},className:`pkg_sps-woodland_core__family_add-to-list__version_8_56_12__hash_13b8tx9x`,...M(`move-item-button`)})))):t.createElement(c.Card,null,T?t.createElement(t.Fragment,null,T):t.createElement(s.ZeroState,{heading:P(`addToList.noDataZeroStateColumnTitle`,{defaultValue:`This Column is Empty`}),subHeading:P(`addToList.noDataZeroStateOnColumnSubheading`,{columnName:f,defaultValue:`Move options from the ${f}`}),artwork:a.DOCUMENT_SEARCH_NO_RESULTS_LARGE,micro:!0,...M(`on-list-zero-state`)}))),t.createElement(R,{headerText:f,showCount:!B&&g,showIcons:_,showMoveAllLinks:le,showMoreOptionsText:ue,maxHeight:U,vertical:D,side:`right`,className:N({vertical:D}),otherHeader:d,itemCount:K.length,moveAll:Y,adjustForPhantomDroppableContainer:$,...M(`off-items-list`)},Q.length>0?Q.map(e=>t.createElement(z,{key:e.id,className:ae,...M(`item`)},e.label,t.createElement(m.Button,{kind:`icon`,icon:`plus-sign`,"aria-label":P(`addToList.add`,{elementName:e.label,defaultValue:`Add ${e.label}`}),onClick:()=>{J(e.label,G,K)},className:ie,...M(`move-item-button`)}))):t.createElement(c.Card,null,E?t.createElement(t.Fragment,null,E):t.createElement(s.ZeroState,{heading:P(`addToList.noDataZeroStateColumnTitle`,{defaultValue:`This Column is Empty`}),subHeading:P(`addToList.noDataZeroStateOffColumnSubheading`,{columnName:d,defaultValue:`Remove options from the ${d}`}),artwork:a.DOCUMENT_SEARCH_NO_RESULTS_SMALL,micro:!0,...M(`off-list-zero-state`)})))))}o.Metadata.set(B,{name:`Add To List`,props:{onList:{type:`ItemProps[]`,required:!0},offList:{type:`ItemProps[]`,required:!0},onHeader:{type:`string`},offHeader:{type:`string`},showFilter:{type:`boolean`},showCount:{type:`boolean`},showIcons:{type:`boolean`},showMoveAllLinks:{type:`boolean`},manualSort:{type:`boolean`},maxDisplayedItems:{type:`number`},maxHeight:{type:`string`},onChange:{type:`(newValue: AddToListAggregateValue) => void`},autoSort:{type:`boolean`},onListZeroState:{type:`ZeroState`},offListZeroState:{type:`ZeroState`}}}),e.AddToList=B});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("@sps-woodland/core"),require("@react-aria/button"),require("@react-aria/interactions"),require("@react-aria/utils"),require("@react-aria/focus"),require("@spscommerce/i18n")):typeof define==`function`&&define.amd?define([`exports`,`react`,`@sps-woodland/core`,`@react-aria/button`,`@react-aria/interactions`,`@react-aria/utils`,`@react-aria/focus`,`@spscommerce/i18n`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Buttons={},e.react,e.spsWoodlandCore,e.reactAriaButton,e.reactAriaInteractions,e.reactAriaUtils,e.reactAriaFocus,e.spscommerceI18n))})(this,function(e,t,n,r,i,a,o,s){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var c=Object.create,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,f=Object.getPrototypeOf,p=Object.prototype.hasOwnProperty,m=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=d(t),a=0,o=i.length,s;a<o;a++)s=i[a],!p.call(e,s)&&s!==n&&l(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=u(t,s))||r.enumerable});return e};t=((e,t,n)=>(n=e==null?{}:c(f(e)),m(t||!e||!e.__esModule||!p.call(e,`default`)?l(n,`default`,{value:e,enumerable:!0}):n,e)))(t,1);function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(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 _(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?g(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var v=(e,t,n)=>{for(var r of Object.keys(e))if(e[r]!==(t[r]??n[r]))return!1;return!0},y=e=>t=>{var n=e.defaultClassName,r=_(_({},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)v(c,r,e.defaultVariants)&&(n+=` `+l);return n},b=y({defaultClassName:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq0`,variantClassNames:{disabled:{true:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq1`,false:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq2`},kind:{default:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq3`,link:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq4`,confirm:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq5`,delete:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq6`,key:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq7`,icon:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq8`},spinning:{true:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq9`,false:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqa`},fill:{true:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqb`,false:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqc`},noWrap:{true:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqd`,false:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqe`}},defaultVariants:{disabled:!1,kind:`default`,spinning:!1,fill:!1,noWrap:!1},compoundVariants:[[{kind:`icon`,spinning:!0},`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqf`],[{kind:`default`,spinning:!0},`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqg`],[{kind:`confirm`,spinning:!0},`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqh`],[{kind:`delete`,spinning:!0},`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqi`],[{kind:`key`,spinning:!0},`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqj`],[{disabled:!0,spinning:!1},`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqk`],[{kind:`link`,disabled:!0},`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieql`]]}),x=y({defaultClassName:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqm`,variantClassNames:{disabled:{true:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqn`,false:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqo`},kind:{icon:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqp`,default:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqq`,delete:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqr`,key:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqs`,confirm:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqt`,link:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqiequ`},spinning:{true:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqv`,false:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqw`},fill:{true:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqx`,false:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqy`},noWrap:{true:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieqz`,false:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq10`}},defaultVariants:{disabled:!1,kind:`default`,spinning:!1,fill:!1,noWrap:!1},compoundVariants:[[{kind:`link`,fill:!0},`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq11`]]}),S=y({defaultClassName:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq12`,variantClassNames:{spinning:{true:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq13`,false:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq14`},kind:{icon:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq15`,default:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq16`,delete:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq17`,key:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq18`,confirm:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq19`,link:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq1a`},fill:{true:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq1b`,false:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq1c`},noWrap:{true:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq1d`,false:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq1e`}},defaultVariants:{spinning:!1,fill:!1,noWrap:!1},compoundVariants:[[{kind:`link`,fill:!0},`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq1f`]]}),C=y({defaultClassName:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq1h`,variantClassNames:{spinning:{true:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq1i`,false:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq1j`}},defaultVariants:{spinning:!1},compoundVariants:[]}),w=t.forwardRef(({as:e,onClick:c,onPress:l,children:u,className:d,isDisabled:f,disabled:p,fill:m,href:h,icon:g,kind:_=`default`,noWrap:v,spinning:y,spinningTitle:w,title:T,...E},D)=>{let O=e??(h?`a`:`button`),k={onPress:l??c,isDisabled:!!(y||p||f),...E},{"data-testid":A}=E,j=t.useRef(null),M=D||j,{buttonProps:N}=(0,r.useButton)(k,M),{hoverProps:P}=(0,i.useHover)({isDisabled:k.isDisabled}),{type:F,...I}=N,L={...(0,a.mergeProps)(I,P),ref:M,title:T,className:h?S({spinning:y,kind:_,fill:m,noWrap:v}):x({disabled:f||p,kind:_,spinning:y,fill:m,noWrap:v}),...h?{href:h}:{type:F},...E},{t:R}=(0,s.useWoodlandLanguage)(),z=g&&(g===`ai-color`?t.createElement(n.Icon,{className:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq1g`,icon:_==="default"||_===`link`?`ai-color`:`ai`,size:`sm`,"aria-hidden":`true`,"data-testid":`${A}__${g}-icon`}):t.createElement(n.Icon,{className:`pkg_sps-woodland_core__family_buttons__version_8_56_12__hash_1flqieq1g`,icon:g,size:`sm`,"aria-hidden":`true`,"data-testid":`${A}__${g}-icon`})),B;B=_==="default"||_===`icon`||_===`link`?`dark`:`light`;let V=y&&t.createElement(n.Spinner,{color:B,className:C({spinning:y}),title:w||R(`button.spinningTitle`,{defaultValue:`Loading...`}),"data-testid":`${A}__spinner`});return t.createElement(o.FocusRing,null,t.createElement(`div`,{className:(0,n.cl)(b({disabled:f||p,kind:_,spinning:y,fill:m,noWrap:v}),d)},t.createElement(O,L,z,u?t.createElement(`span`,null,u):``,V)))});n.Metadata.set(w,{name:`Button`,props:{disabled:`boolean`,fill:{type:`boolean`,default:`false`},href:`string`,icon:`IconName`,kind:{type:`"default" | "link" | "icon" | "confirm" | "delete" | "key"`,default:`"default"`},noWrap:{type:`boolean`,default:`false`},spinning:`boolean`,spinningTitle:`string`,type:{type:`"button" | "submit"`,default:`"button"`},as:`button | a`,onClick:`() => void`,onPress:`() => void`,children:`ReactNode`,className:`string`,isDisabled:`boolean`,style:`CSSProperties`},panellable:!0}),e.Button=w});
|
package/lib/cards/index.umd.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@sps-woodland/core"),require("react")):typeof define==`function`&&define.amd?define([`exports`,`@sps-woodland/core`,`react`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Cards={},e.spsWoodlandCore,e.react))})(this,function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;l<u;l++)d=s[l],!c.call(e,d)&&d!==n&&i(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:r(s(e)),l(t||!e||!e.__esModule||!c.call(e,`default`)?i(n,`default`,{value:e,enumerable:!0}):n,e)))(n,1);var u=`pkg_sps-woodland_core__family_cards__version_8_56_12__hash_jj9br00`;function d({children:e,className:r=``,...i}){return n.createElement(t.CapContent,{className:(0,t.cl)(u,r),...i},e)}t.Metadata.set(d,{name:`CardFooter`});var f=`pkg_sps-woodland_core__family_cards__version_8_56_12__hash_171xmyc0`;function p({children:e,className:r=``,...i}){return n.createElement(t.CapContent,{className:(0,t.cl)(f,r),...i},e)}t.Metadata.set(p,{name:`CardHeader`});var m=`pkg_sps-woodland_core__family_cards__version_8_56_12__hash_1yomitg0`;function h({children:e,className:r,...i}){let[a,[o],s,c]=(0,t.selectChildren)(e,[{type:p},{custom:e=>t.Metadata.isWoodlandComponent(e)&&t.Metadata.get(e).name===`Tabs`},{type:d}]),l=(0,t.useChildTestIdAttrBuilder)(i);return n.createElement(`div`,{className:(0,t.cl)(m,r),...i},a,o?(0,t.addProps)(o,{context:`container`}):n.createElement(t.Content,l(`body`),c),s)}t.Metadata.set(h,{name:`Card`});var g=`pkg_sps-woodland_core__family_cards__version_8_56_12__hash_1c9yfku0`;function _({children:e,className:r=``,...i}){return n.createElement(t.CapContentTitle,{className:(0,t.cl)(g,r),...i},e)}t.Metadata.set(_,{name:`CardTitle`}),e.Card=h,e.CardFooter=d,e.CardHeader=p,e.CardTitle=_});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("@sps-woodland/core"),require("@sps-woodland/core/button"),require("@spscommerce/ds-react"),require("@spscommerce/i18n"),require("@spscommerce/ds-shared")):typeof define==`function`&&define.amd?define([`exports`,`react`,`@sps-woodland/core`,`@sps-woodland/core/button`,`@spscommerce/ds-react`,`@spscommerce/i18n`,`@spscommerce/ds-shared`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ContentRow={},e.react,e.spsWoodlandCore,e.spsWoodlandCoreButton,e.spscommerceDsReact,e.spscommerceI18n,e.spscommerceDsShared))})(this,function(e,t,n,r,i,a,o){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var s=Object.create,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,d=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty,p=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=u(t),a=0,o=i.length,s;a<o;a++)s=i[a],!f.call(e,s)&&s!==n&&c(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=l(t,s))||r.enumerable});return e};t=((e,t,n)=>(n=e==null?{}:s(d(e)),p(t||!e||!e.__esModule||!f.call(e,`default`)?c(n,`default`,{value:e,enumerable:!0}):n,e)))(t,1);function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(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 g(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?h(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var _=(e,t,n)=>{for(var r of Object.keys(e))if(e[r]!==(t[r]??n[r]))return!1;return!0},v=e=>t=>{var n=e.defaultClassName,r=g(g({},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)_(c,r,e.defaultVariants)&&(n+=` `+l);return n},y=v({defaultClassName:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jr0`,variantClassNames:{lean:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jr1`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jr2`},borderless:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jr3`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jr4`},wrapContent:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jr5`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jr6`}},defaultVariants:{lean:!1,borderless:!1,wrapContent:!1},compoundVariants:[]}),b=v({defaultClassName:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jr7`,variantClassNames:{lean:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jr8`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jr9`},borderless:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jra`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jrb`},wrapContent:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jrc`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_gqq3jrd`}},defaultVariants:{lean:!1,borderless:!1,wrapContent:!1},compoundVariants:[]});function x({children:e,className:r,borderless:i,lean:a,widthPx:o,widthRem:s,style:c,wrapContent:l=!1,__autoLayout:u=!1,...d}){let f=o?o/16:s,p=f?{...c,width:`${f}rem`}:c;return u?t.createElement(`td`,{className:(0,n.cl)(b({lean:a,borderless:i,wrapContent:l}),r),...d,style:p},e):t.createElement(`div`,{className:(0,n.cl)(y({lean:a,borderless:i,wrapContent:l}),r),...d,style:p},e)}n.Metadata.set(x,{name:`Content Row Col`,props:{borderless:{type:`boolean`},lean:{type:`boolean`},widthPx:{type:`number`},widthRem:{type:`number`},wrapContent:{type:`boolean`}}});var S=v({defaultClassName:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv4`,variantClassNames:{expanded:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv5`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv6`}},defaultVariants:{expanded:!1},compoundVariants:[]}),C=v({defaultClassName:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv7`,variantClassNames:{cardSpacing:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv8`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv9`},expanded:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhva`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvb`},selected:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvc`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvd`},reorderable:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhve`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvf`}},defaultVariants:{expanded:!1,selected:!1,cardSpacing:!1},compoundVariants:[[{expanded:!0,cardSpacing:!0},`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvg`]]}),w=v({defaultClassName:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvh`,variantClassNames:{selected:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvi`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvj`},expanded:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvk`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvl`}},defaultVariants:{selected:!1,expanded:!1},compoundVariants:[]}),T=`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvm`,ee=`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvn`,te=v({defaultClassName:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvo`,variantClassNames:{disabled:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvp`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvq`}},defaultVariants:{},compoundVariants:[]}),E=v({defaultClassName:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvr`,variantClassNames:{__autoLayout:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvs`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvt`}},defaultVariants:{__autoLayout:!1},compoundVariants:[]}),D=`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvv`,O=v({defaultClassName:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvw`,variantClassNames:{reorderable:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvx`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvy`}},defaultVariants:{reorderable:!1},compoundVariants:[]}),ne=`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvz`,re=`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv10`,k=`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv11`,A=v({defaultClassName:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv12`,variantClassNames:{disabled:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv13`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv14`},up:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv15`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv16`},down:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv17`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhv18`}},defaultVariants:{disabled:!1,up:!1,down:!1},compoundVariants:[]});function j({children:e,className:r,__autoLayout:i=!1,...a}){return i?t.createElement(`tr`,null,t.createElement(`td`,{className:(0,n.cl)(E({__autoLayout:i}),r),colSpan:100,...a},e)):t.createElement(`div`,{className:(0,n.cl)(E({__autoLayout:i}),r),...a},e)}n.Metadata.set(j,{name:`Content Row Expansion`});function M({children:e,className:s,alternateLayout:c=!1,initiallyExpanded:l=!1,cardSpacing:u=!1,expanded:d,onBeforeCollapsed:f,onBeforeExpanded:p,onSelectionChange:m,onCollapsed:h,onExpanded:g,selectable:_=!1,selected:v,selectIndeterminate:y,renderExpandedContent:b=!0,disableSelection:E=!1,disableExpansion:M=!1,hideExpansionControl:N=!1,__autoLayout:P=!1,__reorderable:F=!1,__onOrderChange:I=()=>{},__index:L=0,__canBeMovedUp:R,__canBeMovedDown:z,...B}){let[V,[H]]=(0,n.selectChildren)(e,[{type:x},{type:j}]),{t:U}=(0,a.useWoodlandLanguage)(),[ie,W]=t.useState(b||l),[ae,G]=t.useState(l),K=typeof d==`boolean`?d:ae,q=P?K:ie,[J,Y]=t.useState((L+1).toString()||``);t.useEffect(()=>{Y((L+1).toString()||``)},[L]);function oe(e){Y(e.target.value)}function X(){Number(J)?I(L,Number(J)-1):(Y((L+1).toString()||``),I(L,L))}function se(e){e.stopPropagation(),K&&(!f||f())?(G(!1),b||W(!1),h&&h()):!K&&(!p||p())&&(G(!0),b||W(!0),g&&g())}let Z=()=>t.createElement(i.SpsCheckbox,{disabled:E,checked:v,indeterminate:y,onChange:m}),Q=t.createElement(`button`,{type:`button`,className:(0,n.cl)(ee),onClick:se,"aria-label":U(`contentRow.${K?`collapse`:`expand`}`,{defaultValue:`${K?`Collapse`:`Expand`}`}),disabled:M},t.createElement(n.Icon,{className:(0,n.cl)(te({disabled:M})),icon:K?`minus-circle`:`plus-circle`}));if(P){let e=t.createElement(`tr`,null,t.createElement(`td`,{className:(0,n.cl)(T),colSpan:100}));return t.createElement(t.Fragment,null,t.createElement(`tr`,{className:(0,n.cl)(w({selected:v||y,expanded:K})),...B},_&&!c&&t.createElement(x,{widthPx:46,__autoLayout:!0},t.createElement(Z,null)),H&&!c&&!N&&t.createElement(x,{widthPx:44,__autoLayout:!0},Q),H&&_&&c&&t.createElement(x,{widthPx:46,__autoLayout:!0},N?t.createElement(Z,null):t.createElement(t.Fragment,null,t.createElement(`section`,{className:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvu`},t.createElement(Z,null)),t.createElement(`section`,{className:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvu`},Q))),V),q&&H,e)}let $=t.createElement(`div`,{className:(0,n.cl)(S({expanded:K}),s),...B},t.createElement(`div`,{className:(0,n.cl)(C({expanded:K,selected:v,cardSpacing:u,reorderable:F}))},F&&t.createElement(x,{widthPx:53,style:{position:`relative`}},t.createElement(`section`,{className:O({reorderable:F})},t.createElement(r.Button,{className:A({up:!0,disabled:!R}),kind:o.ButtonKind.ICON,icon:o.SpsIcon.CHEVRON_UP,onClick:()=>I(L,L-1),disabled:!R})),t.createElement(`section`,{className:O({reorderable:F})},t.createElement(r.Button,{className:A({down:!0,disabled:!z}),kind:o.ButtonKind.ICON,icon:o.SpsIcon.CHEVRON_DOWN,onClick:()=>I(L,L+1),disabled:!z}))),_&&!c&&t.createElement(x,{widthPx:46},t.createElement(Z,null)),H&&!c&&!N&&t.createElement(x,{widthPx:44},Q),H&&_&&c&&t.createElement(x,{widthPx:46},N?t.createElement(Z,null):t.createElement(t.Fragment,null,t.createElement(`section`,{className:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvu`},t.createElement(Z,null)),t.createElement(`section`,{className:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_1m5rxhvu`},Q))),V),q&&H);return F?t.createElement(`div`,{className:D},t.createElement(`div`,{className:(0,n.cl)(ne,s)},t.createElement(`div`,{className:re},t.createElement(i.SpsTextInput,{className:k,value:J,onChange:oe,onBlur:()=>X(),onKeyUp:e=>{e.key===`Enter`&&X()},notClearable:!0}))),$):$}n.Metadata.set(M,{name:`Content Row`,props:{alternateLayout:{type:`boolean`,default:`false`},initiallyExpanded:{type:`boolean`,default:`false`},cardSpacing:{type:`boolean`,default:`false`},expanded:{type:`boolean`},onBeforeCollapsed:{type:`() => boolean`},onBeforeExpanded:{type:`() => boolean`},onSelectionChange:{type:`ChangeEventHandler`},onCollapsed:{type:`() => void`},onExpanded:{type:`() => void`},selectable:{type:`boolean`,default:`false`},selected:{type:`boolean`},renderExpandedContent:{type:`boolean`,default:`true`},disableSelection:{type:`boolean`,default:`false`},disableExpansion:{type:`boolean`,default:`false`},hideExpansionControl:{type:`boolean`,default:`false`}}});var N=v({defaultClassName:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_14j3gmi0`,variantClassNames:{wrapContent:{true:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_14j3gmi1`,false:`pkg_sps-woodland_core__family_content-row__version_8_56_12__hash_14j3gmi2`}},defaultVariants:{wrapContent:!1},compoundVariants:[]}),P=new Set([`Content Row`,`Content Row Col`,`Content Row Expansion`,`Sorting Header`,`Sorting Header Cell`]);function F({children:e,className:r,wrapContent:i=!1,...a}){let o=t.useMemo(()=>(0,n.modChildren)(e,e=>n.Metadata.isWoodlandComponent(e.type)&&P.has(n.Metadata.get(e.type).name)?[{__autoLayout:!0}]:[{}]),[e]),[[s],c]=t.useMemo(()=>(0,n.selectChildren)(o,[{type:e=>!!(n.Metadata.isWoodlandComponent(e.type)&&n.Metadata.get(e.type).name===`Sorting Header`)}]),[o]);return t.createElement(`table`,{className:(0,n.cl)(N({wrapContent:i}),r),...a},s?t.createElement(`thead`,null,s):null,t.createElement(`tbody`,null,c))}n.Metadata.set(F,{name:`Row List Auto Layout`,props:{wrapContent:{type:`boolean`,default:`false`}}}),e.ContentRow=M,e.ContentRowCol=x,e.ContentRowExpansion=j,e.RowListAutoLayout=F});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@sps-woodland/core"),require("react"),require("@sps-woodland/tokens")):typeof define==`function`&&define.amd?define([`exports`,`@sps-woodland/core`,`react`,`@sps-woodland/tokens`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ContentTiles={},e.spsWoodlandCore,e.react,e.spsWoodlandTokens))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=s(t),c=0,u=i.length,d;c<u;c++)d=i[c],!l.call(e,d)&&d!==n&&a(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=o(t,d))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:i(c(e)),u(t||!e||!e.__esModule||!l.call(e,`default`)?a(n,`default`,{value:e,enumerable:!0}):n,e)))(n,1);var d=`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_1dggj5e0`,f=`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_1dggj5e1`;function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(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 h(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?m(Object(n),!0).forEach(function(t){p(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var g=(e,t,n)=>{for(var r of Object.keys(e))if(e[r]!==(t[r]??n[r]))return!1;return!0},_=e=>t=>{var n=e.defaultClassName,r=h(h({},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)g(c,r,e.defaultVariants)&&(n+=` `+l);return n},v=`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inw0`,y=_({defaultClassName:`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inw1`,variantClassNames:{disabled:{true:`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inw2`}},defaultVariants:{disabled:!1},compoundVariants:[]}),b=`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inw3`,x=_({defaultClassName:`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inw4`,variantClassNames:{error:{true:`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inw5`},warning:{true:`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inw6`},disabled:{true:`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inw7`}},defaultVariants:{error:!1,warning:!1,disabled:!1},compoundVariants:[]}),S=_({defaultClassName:``,variantClassNames:{error:{true:`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inw8`},warning:{true:`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inw9`},disabled:{true:`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inwa`}},defaultVariants:{error:!1,disabled:!1,warning:!1},compoundVariants:[]}),C=`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inwc`,w=`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inwd`;function T({className:e,href:i,icon:a,error:o=!1,errorIcon:s,title:c,warning:l=!1,warningIcon:u,disabled:d=!1,target:p,onClick:m,tagElement:h,...g}){let[_]=(0,t.selectChildren)(h,[{custom:e=>t.Metadata.isWoodlandComponent(e)&&t.Metadata.get(e).name===`Tag`}]);return n.createElement(`div`,{className:(0,t.cl)(r.grid[3],v,e),...g},n.createElement(`a`,{href:d?void 0:i,className:(0,t.cl)(x({error:o,warning:l,disabled:d}),f),target:p,onClick:m},(l||o)&&n.createElement(`div`,{className:`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inwb`},l&&(u?(0,t.contentOf)(u):n.createElement(t.Icon,{icon:`status-warning`,className:(0,t.cl)(S({warning:l,disabled:d}))})),o&&(s?(0,t.contentOf)(s):n.createElement(t.Icon,{icon:`ban`,className:(0,t.cl)(S({error:o,disabled:d}))}))),_[0]&&n.createElement(`div`,{className:(0,t.cl)(`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inwf`)},_[0]),n.createElement(`div`,null,n.createElement(`div`,{className:(0,t.cl)(b)},typeof a==`string`?n.createElement(`img`,{className:(0,t.cl)(y({disabled:d})),src:a,alt:``}):(0,t.contentOf)(a)),n.createElement(`div`,{className:(0,t.cl)(C)},n.createElement(`p`,{className:(0,t.cl)(w)},c,p===`_blank`&&n.createElement(t.Icon,{icon:`tabs`,className:(0,t.cl)(`pkg_sps-woodland_core__family_content-tiles__version_8_56_12__hash_w95inwe`)}))))))}t.Metadata.set(T,{name:`Content Tile`,props:{href:{type:`string`},icon:{type:`React.ReactNode | (() => React.ReactNode)`,required:!0},error:{type:`boolean`,default:`false`},errorIcon:{type:`React.ReactNode | (() => React.ReactNode)`},title:{type:`string`,required:!0},warning:{type:`boolean`,default:`false`},warningIcon:{type:`React.ReactNode | (() => React.ReactNode)`},disabled:{type:`boolean`,default:`false`},target:{type:`string`},onClick:{type:`() => void`}}});function E({children:e,className:r,...i}){return n.createElement(`div`,{className:(0,t.cl)(d,r),...i},e)}t.Metadata.set(E,{name:`Content Tile List`}),e.ContentTile=T,e.ContentTileList=E});
|