@sps-woodland/content-row 8.31.7 → 8.32.0
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/content-row/ContentRow.d.ts +2 -1
- package/lib/index.js +200 -116
- package/lib/index.umd.cjs +70 -10
- package/lib/style.css +1 -1
- package/package.json +13 -13
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import type { ComponentProps } from "@sps-woodland/core";
|
3
|
-
export declare function ContentRow({ children, className, alternateLayout, initiallyExpanded, cardSpacing, expanded, onBeforeCollapsed, onBeforeExpanded, onSelectionChange, onCollapsed, onExpanded, selectable, selected, renderExpandedContent, disableSelection, disableExpansion, hideExpansionControl, __autoLayout, __reorderable, __onOrderChange, __index, __canBeMovedUp, __canBeMovedDown, ...rest }: ComponentProps<{
|
3
|
+
export declare function ContentRow({ children, className, alternateLayout, initiallyExpanded, cardSpacing, expanded, onBeforeCollapsed, onBeforeExpanded, onSelectionChange, onCollapsed, onExpanded, selectable, selected, selectIndeterminate, renderExpandedContent, disableSelection, disableExpansion, hideExpansionControl, __autoLayout, __reorderable, __onOrderChange, __index, __canBeMovedUp, __canBeMovedDown, ...rest }: ComponentProps<{
|
4
4
|
alternateLayout?: boolean;
|
5
5
|
initiallyExpanded?: boolean;
|
6
6
|
cardSpacing?: boolean;
|
@@ -12,6 +12,7 @@ export declare function ContentRow({ children, className, alternateLayout, initi
|
|
12
12
|
onExpanded?: () => void;
|
13
13
|
selectable?: boolean;
|
14
14
|
selected?: boolean;
|
15
|
+
selectIndeterminate?: boolean;
|
15
16
|
renderExpandedContent?: boolean;
|
16
17
|
disableSelection?: boolean;
|
17
18
|
disableExpansion?: boolean;
|
package/lib/index.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import * as e from "react";
|
2
|
-
import { Metadata as u, cl as l, selectChildren as
|
3
|
-
import { Button as
|
4
|
-
import { SpsTextInput as
|
5
|
-
import { SpsIcon as
|
6
|
-
import { code as
|
7
|
-
function
|
2
|
+
import { Metadata as u, cl as l, selectChildren as $, I18nContext as le, Icon as de, modChildren as _e } from "@sps-woodland/core";
|
3
|
+
import { Button as G } from "@sps-woodland/buttons";
|
4
|
+
import { SpsTextInput as ie, SpsCheckbox as ce } from "@spscommerce/ds-react";
|
5
|
+
import { SpsIcon as q, ButtonKind as J } from "@spscommerce/ds-shared";
|
6
|
+
import { code as c } from "@spscommerce/utils";
|
7
|
+
function pe(o, s, t) {
|
8
8
|
return s in o ? Object.defineProperty(o, s, {
|
9
9
|
value: t,
|
10
10
|
enumerable: !0,
|
@@ -12,7 +12,7 @@ function ce(o, s, t) {
|
|
12
12
|
writable: !0
|
13
13
|
}) : o[s] = t, o;
|
14
14
|
}
|
15
|
-
function
|
15
|
+
function U(o, s) {
|
16
16
|
var t = Object.keys(o);
|
17
17
|
if (Object.getOwnPropertySymbols) {
|
18
18
|
var n = Object.getOwnPropertySymbols(o);
|
@@ -22,28 +22,28 @@ function J(o, s) {
|
|
22
22
|
}
|
23
23
|
return t;
|
24
24
|
}
|
25
|
-
function
|
25
|
+
function Q(o) {
|
26
26
|
for (var s = 1; s < arguments.length; s++) {
|
27
27
|
var t = arguments[s] != null ? arguments[s] : {};
|
28
|
-
s % 2 ?
|
29
|
-
|
30
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(t)) :
|
28
|
+
s % 2 ? U(Object(t), !0).forEach(function(n) {
|
29
|
+
pe(o, n, t[n]);
|
30
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(o, Object.getOwnPropertyDescriptors(t)) : U(Object(t)).forEach(function(n) {
|
31
31
|
Object.defineProperty(o, n, Object.getOwnPropertyDescriptor(t, n));
|
32
32
|
});
|
33
33
|
}
|
34
34
|
return o;
|
35
35
|
}
|
36
|
-
var
|
36
|
+
var me = (o, s, t) => {
|
37
37
|
for (var n of Object.keys(o)) {
|
38
38
|
var a;
|
39
39
|
if (o[n] !== ((a = s[n]) !== null && a !== void 0 ? a : t[n]))
|
40
40
|
return !1;
|
41
41
|
}
|
42
42
|
return !0;
|
43
|
-
},
|
44
|
-
var t = o.defaultClassName, n =
|
43
|
+
}, m = (o) => (s) => {
|
44
|
+
var t = o.defaultClassName, n = Q(Q({}, o.defaultVariants), s);
|
45
45
|
for (var a in n) {
|
46
|
-
var
|
46
|
+
var d, i = (d = n[a]) !== null && d !== void 0 ? d : o.defaultVariants[a];
|
47
47
|
if (i != null) {
|
48
48
|
var r = i;
|
49
49
|
typeof r == "boolean" && (r = r === !0 ? "true" : "false");
|
@@ -55,29 +55,29 @@ var pe = (o, s, t) => {
|
|
55
55
|
}
|
56
56
|
}
|
57
57
|
for (var [C, f] of o.compoundVariants)
|
58
|
-
|
58
|
+
me(C, n, o.defaultVariants) && (t += " " + f);
|
59
59
|
return t;
|
60
|
-
},
|
61
|
-
function
|
60
|
+
}, we = m({ defaultClassName: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv0", variantClassNames: { lean: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv1", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv2" }, borderless: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv3", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv4" }, wrapContent: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv5", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv6" } }, defaultVariants: { lean: !1, borderless: !1, wrapContent: !1 }, compoundVariants: [] }), ue = m({ defaultClassName: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv7", variantClassNames: { lean: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv8", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv9" }, borderless: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufva", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufvb" }, wrapContent: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufvc", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufvd" } }, defaultVariants: { lean: !1, borderless: !1, wrapContent: !1 }, compoundVariants: [] });
|
61
|
+
function p({
|
62
62
|
children: o,
|
63
63
|
className: s,
|
64
64
|
borderless: t,
|
65
65
|
lean: n,
|
66
66
|
widthPx: a,
|
67
|
-
widthRem:
|
67
|
+
widthRem: d,
|
68
68
|
style: i,
|
69
69
|
wrapContent: r = !1,
|
70
70
|
__autoLayout: R = !1,
|
71
71
|
...C
|
72
72
|
}) {
|
73
|
-
const f = a ? a / 16 :
|
73
|
+
const f = a ? a / 16 : d, h = f ? {
|
74
74
|
...i,
|
75
75
|
width: `${f}rem`
|
76
76
|
} : i;
|
77
77
|
return R ? /* @__PURE__ */ e.createElement(
|
78
78
|
"td",
|
79
79
|
{
|
80
|
-
className: l(
|
80
|
+
className: l(ue({ lean: n, borderless: t, wrapContent: r }), s),
|
81
81
|
...C,
|
82
82
|
style: h
|
83
83
|
},
|
@@ -85,14 +85,14 @@ function c({
|
|
85
85
|
) : /* @__PURE__ */ e.createElement(
|
86
86
|
"div",
|
87
87
|
{
|
88
|
-
className: l(
|
88
|
+
className: l(we({ lean: n, borderless: t, wrapContent: r }), s),
|
89
89
|
...C,
|
90
90
|
style: h
|
91
91
|
},
|
92
92
|
o
|
93
93
|
);
|
94
94
|
}
|
95
|
-
u.set(
|
95
|
+
u.set(p, {
|
96
96
|
name: "Content Row Col",
|
97
97
|
props: {
|
98
98
|
borderless: { type: "boolean" },
|
@@ -102,8 +102,8 @@ u.set(c, {
|
|
102
102
|
wrapContent: { type: "boolean" }
|
103
103
|
}
|
104
104
|
});
|
105
|
-
var
|
106
|
-
function
|
105
|
+
var Ce = m({ defaultClassName: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee4", variantClassNames: { expanded: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee5", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee6" } }, defaultVariants: { expanded: !1 }, compoundVariants: [] }), fe = m({ defaultClassName: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee7", variantClassNames: { cardSpacing: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee8", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee9" }, expanded: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeea", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeb" }, selected: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeec", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeed" }, reorderable: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeee", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeef" } }, defaultVariants: { expanded: !1, selected: !1, cardSpacing: !1 }, compoundVariants: [[{ expanded: !0, cardSpacing: !0 }, "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeg"]] }), he = m({ defaultClassName: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeh", variantClassNames: { selected: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeei", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeej" }, expanded: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeek", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeel" } }, defaultVariants: { selected: !1, expanded: !1 }, compoundVariants: [] }), be = "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeem", Re = "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeen", ge = m({ defaultClassName: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeo", variantClassNames: { disabled: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeep", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeq" } }, defaultVariants: {}, compoundVariants: [] }), X = m({ defaultClassName: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeer", variantClassNames: { __autoLayout: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjees", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeet" } }, defaultVariants: { __autoLayout: !1 }, compoundVariants: [] }), S = "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeu", ve = "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeev", Y = m({ defaultClassName: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeew", variantClassNames: { reorderable: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeex", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeey" } }, defaultVariants: { reorderable: !1 }, compoundVariants: [] }), ke = "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeez", ye = "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee10", xe = "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee11", Z = m({ defaultClassName: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee12", variantClassNames: { disabled: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee13", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee14" }, up: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee15", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee16" }, down: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee17", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee18" } }, defaultVariants: { disabled: !1, up: !1, down: !1 }, compoundVariants: [] });
|
106
|
+
function I({
|
107
107
|
children: o,
|
108
108
|
className: s,
|
109
109
|
__autoLayout: t = !1,
|
@@ -112,139 +112,160 @@ function P({
|
|
112
112
|
return t ? /* @__PURE__ */ e.createElement("tr", null, /* @__PURE__ */ e.createElement(
|
113
113
|
"td",
|
114
114
|
{
|
115
|
-
className: l(
|
115
|
+
className: l(X({ __autoLayout: t }), s),
|
116
116
|
colSpan: 100,
|
117
117
|
...n
|
118
118
|
},
|
119
119
|
o
|
120
|
-
)) : /* @__PURE__ */ e.createElement("div", { className: l(
|
120
|
+
)) : /* @__PURE__ */ e.createElement("div", { className: l(X({ __autoLayout: t }), s), ...n }, o);
|
121
121
|
}
|
122
|
-
u.set(
|
122
|
+
u.set(I, {
|
123
123
|
name: "Content Row Expansion"
|
124
124
|
});
|
125
|
-
function
|
125
|
+
function ee({
|
126
126
|
children: o,
|
127
127
|
className: s,
|
128
128
|
alternateLayout: t = !1,
|
129
129
|
initiallyExpanded: n = !1,
|
130
130
|
cardSpacing: a = !1,
|
131
|
-
expanded:
|
131
|
+
expanded: d,
|
132
132
|
onBeforeCollapsed: i,
|
133
133
|
onBeforeExpanded: r,
|
134
134
|
onSelectionChange: R,
|
135
135
|
onCollapsed: C,
|
136
136
|
onExpanded: f,
|
137
137
|
selectable: h = !1,
|
138
|
-
selected:
|
138
|
+
selected: N,
|
139
|
+
selectIndeterminate: P,
|
139
140
|
renderExpandedContent: z = !0,
|
140
|
-
disableSelection:
|
141
|
-
disableExpansion:
|
141
|
+
disableSelection: oe = !1,
|
142
|
+
disableExpansion: M = !1,
|
142
143
|
hideExpansionControl: y = !1,
|
143
|
-
__autoLayout:
|
144
|
+
__autoLayout: F = !1,
|
144
145
|
__reorderable: k = !1,
|
145
146
|
__onOrderChange: x = () => {
|
146
147
|
},
|
147
|
-
__index:
|
148
|
-
__canBeMovedUp:
|
149
|
-
__canBeMovedDown:
|
150
|
-
...
|
148
|
+
__index: _ = 0,
|
149
|
+
__canBeMovedUp: H,
|
150
|
+
__canBeMovedDown: O,
|
151
|
+
...A
|
151
152
|
}) {
|
152
|
-
const [
|
153
|
-
{ type:
|
154
|
-
{ type:
|
155
|
-
]), { t:
|
153
|
+
const [D, [g]] = $(o, [
|
154
|
+
{ type: p },
|
155
|
+
{ type: I }
|
156
|
+
]), { t: te } = e.useContext(le), [ne, L] = e.useState(
|
156
157
|
z || n
|
157
|
-
), [
|
158
|
+
), [se, T] = e.useState(n), w = typeof d == "boolean" ? d : se, W = F ? w : ne, [j, V] = e.useState((_ + 1).toString() || "");
|
158
159
|
e.useEffect(() => {
|
159
|
-
V((
|
160
|
-
}, [
|
161
|
-
function
|
160
|
+
V((_ + 1).toString() || "");
|
161
|
+
}, [_]);
|
162
|
+
function ae(b) {
|
162
163
|
V(b.target.value);
|
163
164
|
}
|
164
|
-
function
|
165
|
-
Number(j) ? x(
|
165
|
+
function B() {
|
166
|
+
Number(j) ? x(_, Number(j) - 1) : (V((_ + 1).toString() || ""), x(_, _));
|
166
167
|
}
|
167
|
-
function
|
168
|
-
b.stopPropagation(),
|
168
|
+
function re(b) {
|
169
|
+
b.stopPropagation(), w && (!i || i()) ? (T(!1), z || L(!1), C && C()) : !w && (!r || r()) && (T(!0), z || L(!0), f && f());
|
169
170
|
}
|
170
|
-
const v = () => /* @__PURE__ */ e.createElement(
|
171
|
+
const v = () => /* @__PURE__ */ e.createElement(
|
172
|
+
ce,
|
173
|
+
{
|
174
|
+
disabled: oe,
|
175
|
+
checked: N,
|
176
|
+
indeterminate: P,
|
177
|
+
onChange: R
|
178
|
+
}
|
179
|
+
), E = /* @__PURE__ */ e.createElement(
|
171
180
|
"button",
|
172
181
|
{
|
173
182
|
type: "button",
|
174
|
-
className: l(
|
175
|
-
onClick:
|
176
|
-
"aria-label":
|
177
|
-
disabled:
|
183
|
+
className: l(Re),
|
184
|
+
onClick: re,
|
185
|
+
"aria-label": te(`design-system:contentRow.${w ? "collapse" : "expand"}`, { defaultValue: `${w ? "Collapse" : "Expand"}` }),
|
186
|
+
disabled: M
|
178
187
|
},
|
179
188
|
/* @__PURE__ */ e.createElement(
|
180
|
-
|
189
|
+
de,
|
181
190
|
{
|
182
|
-
className: l(
|
183
|
-
icon:
|
191
|
+
className: l(ge({ disabled: M })),
|
192
|
+
icon: w ? "minus-circle" : "plus-circle"
|
184
193
|
}
|
185
194
|
)
|
186
195
|
);
|
187
|
-
if (
|
188
|
-
const b = /* @__PURE__ */ e.createElement("tr", null, /* @__PURE__ */ e.createElement("td", { className: l(
|
189
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
196
|
+
if (F) {
|
197
|
+
const b = /* @__PURE__ */ e.createElement("tr", null, /* @__PURE__ */ e.createElement("td", { className: l(be), colSpan: 100 }));
|
198
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
199
|
+
"tr",
|
200
|
+
{
|
201
|
+
className: l(
|
202
|
+
he({ selected: N || P, expanded: w })
|
203
|
+
),
|
204
|
+
...A
|
205
|
+
},
|
206
|
+
h && !t && /* @__PURE__ */ e.createElement(p, { widthPx: 46, __autoLayout: !0 }, /* @__PURE__ */ e.createElement(v, null)),
|
207
|
+
g && !t && !y && /* @__PURE__ */ e.createElement(p, { widthPx: 44, __autoLayout: !0 }, E),
|
208
|
+
g && h && t && /* @__PURE__ */ e.createElement(p, { widthPx: 46, __autoLayout: !0 }, y ? /* @__PURE__ */ e.createElement(v, null) : /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("section", { className: S }, /* @__PURE__ */ e.createElement(v, null)), /* @__PURE__ */ e.createElement("section", { className: S }, E))),
|
209
|
+
D
|
210
|
+
), W && g, b);
|
190
211
|
}
|
191
|
-
const K = /* @__PURE__ */ e.createElement("div", { className: l(
|
212
|
+
const K = /* @__PURE__ */ e.createElement("div", { className: l(Ce({ expanded: w }), s), ...A }, /* @__PURE__ */ e.createElement(
|
192
213
|
"div",
|
193
214
|
{
|
194
215
|
className: l(
|
195
|
-
|
196
|
-
expanded:
|
197
|
-
selected:
|
216
|
+
fe({
|
217
|
+
expanded: w,
|
218
|
+
selected: N,
|
198
219
|
cardSpacing: a,
|
199
220
|
reorderable: k
|
200
221
|
})
|
201
222
|
)
|
202
223
|
},
|
203
|
-
k && /* @__PURE__ */ e.createElement(
|
204
|
-
|
224
|
+
k && /* @__PURE__ */ e.createElement(p, { widthPx: 53, style: { position: "relative" } }, /* @__PURE__ */ e.createElement("section", { className: Y({ reorderable: k }) }, /* @__PURE__ */ e.createElement(
|
225
|
+
G,
|
205
226
|
{
|
206
|
-
className:
|
227
|
+
className: Z({
|
207
228
|
up: !0,
|
208
|
-
disabled: !
|
229
|
+
disabled: !H
|
209
230
|
}),
|
210
|
-
kind:
|
211
|
-
icon:
|
212
|
-
onClick: () => x(
|
213
|
-
disabled: !
|
231
|
+
kind: J.ICON,
|
232
|
+
icon: q.CHEVRON_UP,
|
233
|
+
onClick: () => x(_, _ - 1),
|
234
|
+
disabled: !H
|
214
235
|
}
|
215
|
-
)), /* @__PURE__ */ e.createElement("section", { className:
|
216
|
-
|
236
|
+
)), /* @__PURE__ */ e.createElement("section", { className: Y({ reorderable: k }) }, /* @__PURE__ */ e.createElement(
|
237
|
+
G,
|
217
238
|
{
|
218
|
-
className:
|
239
|
+
className: Z({
|
219
240
|
down: !0,
|
220
|
-
disabled: !
|
241
|
+
disabled: !O
|
221
242
|
}),
|
222
|
-
kind:
|
223
|
-
icon:
|
224
|
-
onClick: () => x(
|
225
|
-
disabled: !
|
243
|
+
kind: J.ICON,
|
244
|
+
icon: q.CHEVRON_DOWN,
|
245
|
+
onClick: () => x(_, _ + 1),
|
246
|
+
disabled: !O
|
226
247
|
}
|
227
248
|
))),
|
228
|
-
h && !t && /* @__PURE__ */ e.createElement(
|
229
|
-
g && !t && !y && /* @__PURE__ */ e.createElement(
|
230
|
-
g && h && t && /* @__PURE__ */ e.createElement(
|
231
|
-
|
232
|
-
),
|
233
|
-
return k ? /* @__PURE__ */ e.createElement("div", { className:
|
234
|
-
|
249
|
+
h && !t && /* @__PURE__ */ e.createElement(p, { widthPx: 46 }, /* @__PURE__ */ e.createElement(v, null)),
|
250
|
+
g && !t && !y && /* @__PURE__ */ e.createElement(p, { widthPx: 44 }, E),
|
251
|
+
g && h && t && /* @__PURE__ */ e.createElement(p, { widthPx: 46 }, y ? /* @__PURE__ */ e.createElement(v, null) : /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("section", { className: S }, /* @__PURE__ */ e.createElement(v, null)), /* @__PURE__ */ e.createElement("section", { className: S }, E))),
|
252
|
+
D
|
253
|
+
), W && g);
|
254
|
+
return k ? /* @__PURE__ */ e.createElement("div", { className: ve }, /* @__PURE__ */ e.createElement("div", { className: l(ke, s) }, /* @__PURE__ */ e.createElement("div", { className: ye }, /* @__PURE__ */ e.createElement(
|
255
|
+
ie,
|
235
256
|
{
|
236
|
-
className:
|
257
|
+
className: xe,
|
237
258
|
value: j,
|
238
|
-
onChange:
|
239
|
-
onBlur: () =>
|
259
|
+
onChange: ae,
|
260
|
+
onBlur: () => B(),
|
240
261
|
onKeyUp: (b) => {
|
241
|
-
b.key === "Enter" &&
|
262
|
+
b.key === "Enter" && B();
|
242
263
|
},
|
243
264
|
notClearable: !0
|
244
265
|
}
|
245
266
|
))), K) : K;
|
246
267
|
}
|
247
|
-
u.set(
|
268
|
+
u.set(ee, {
|
248
269
|
name: "Content Row",
|
249
270
|
props: {
|
250
271
|
alternateLayout: { type: "boolean", default: "false" },
|
@@ -264,8 +285,8 @@ u.set($, {
|
|
264
285
|
hideExpansionControl: { type: "boolean", default: "false" }
|
265
286
|
}
|
266
287
|
});
|
267
|
-
var
|
268
|
-
const
|
288
|
+
var Ee = m({ defaultClassName: "pkg_sps-woodland_content-row__version_8_32_0__hash_1wuky9j0", variantClassNames: { wrapContent: { true: "pkg_sps-woodland_content-row__version_8_32_0__hash_1wuky9j1", false: "pkg_sps-woodland_content-row__version_8_32_0__hash_1wuky9j2" } }, defaultVariants: { wrapContent: !1 }, compoundVariants: [] });
|
289
|
+
const Se = /* @__PURE__ */ new Set([
|
269
290
|
"Content Row",
|
270
291
|
"Content Row Col",
|
271
292
|
"Content Row Expansion",
|
@@ -281,17 +302,17 @@ function Ne({
|
|
281
302
|
const a = e.useMemo(
|
282
303
|
() => (
|
283
304
|
// eslint-disable-next-line implicit-arrow-linebreak
|
284
|
-
_e(o, (r) => u.isWoodlandComponent(r.type) &&
|
305
|
+
_e(o, (r) => u.isWoodlandComponent(r.type) && Se.has(u.get(r.type).name) ? [
|
285
306
|
{
|
286
307
|
__autoLayout: !0
|
287
308
|
}
|
288
309
|
] : [{}])
|
289
310
|
),
|
290
311
|
[o]
|
291
|
-
), [[
|
312
|
+
), [[d], i] = e.useMemo(
|
292
313
|
() => (
|
293
314
|
// eslint-disable-next-line implicit-arrow-linebreak
|
294
|
-
|
315
|
+
$(a, [
|
295
316
|
{
|
296
317
|
type: (r) => !!(u.isWoodlandComponent(r.type) && u.get(r.type).name === "Sorting Header")
|
297
318
|
}
|
@@ -299,7 +320,7 @@ function Ne({
|
|
299
320
|
),
|
300
321
|
[a]
|
301
322
|
);
|
302
|
-
return /* @__PURE__ */ e.createElement("table", { className: l(
|
323
|
+
return /* @__PURE__ */ e.createElement("table", { className: l(Ee({ wrapContent: t }), s), ...n }, d ? /* @__PURE__ */ e.createElement("thead", null, d) : null, /* @__PURE__ */ e.createElement("tbody", null, i));
|
303
324
|
}
|
304
325
|
u.set(Ne, {
|
305
326
|
name: "Row List Auto Layout",
|
@@ -307,14 +328,14 @@ u.set(Ne, {
|
|
307
328
|
wrapContent: { type: "boolean", default: "false" }
|
308
329
|
}
|
309
330
|
});
|
310
|
-
const
|
311
|
-
components: [
|
331
|
+
const ze = {
|
332
|
+
components: [ee, p, I],
|
312
333
|
examples: {
|
313
334
|
basic: {
|
314
335
|
label: "Content Rows",
|
315
336
|
examples: {
|
316
337
|
basic: {
|
317
|
-
react:
|
338
|
+
react: c`
|
318
339
|
import { ContentRow, ContentRowCol } from "@sps-woodland/content-row";
|
319
340
|
import { Icon } from "@sps-woodland/core";
|
320
341
|
import { sprinkles } from "@sps-woodland/tokens";
|
@@ -335,7 +356,7 @@ const Se = {
|
|
335
356
|
`
|
336
357
|
},
|
337
358
|
withCheckbox: {
|
338
|
-
react:
|
359
|
+
react: c`
|
339
360
|
import { ContentRow, ContentRowCol } from "@sps-woodland/content-row";
|
340
361
|
import { Icon } from "@sps-woodland/core";
|
341
362
|
import { sprinkles } from "@sps-woodland/tokens";
|
@@ -368,7 +389,7 @@ const Se = {
|
|
368
389
|
`
|
369
390
|
},
|
370
391
|
withCheckboxAndFavorite: {
|
371
|
-
react:
|
392
|
+
react: c`
|
372
393
|
import { ContentRow, ContentRowCol } from "@sps-woodland/content-row";
|
373
394
|
import { Icon } from "@sps-woodland/core";
|
374
395
|
import { sprinkles } from "@sps-woodland/tokens";
|
@@ -409,7 +430,7 @@ const Se = {
|
|
409
430
|
label: "Expandable Content Rows",
|
410
431
|
examples: {
|
411
432
|
basic: {
|
412
|
-
react:
|
433
|
+
react: c`
|
413
434
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
414
435
|
import { Card } from "@sps-woodland/cards";
|
415
436
|
import { Icon } from "@sps-woodland/core";
|
@@ -444,7 +465,7 @@ const Se = {
|
|
444
465
|
`
|
445
466
|
},
|
446
467
|
expandableWithCheckbox: {
|
447
|
-
react:
|
468
|
+
react: c`
|
448
469
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
449
470
|
import { Card } from "@sps-woodland/cards";
|
450
471
|
import { Icon } from "@sps-woodland/core";
|
@@ -491,7 +512,7 @@ const Se = {
|
|
491
512
|
`
|
492
513
|
},
|
493
514
|
expandableWithCheckboxAlternate: {
|
494
|
-
react:
|
515
|
+
react: c`
|
495
516
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
496
517
|
import { Card } from "@sps-woodland/cards";
|
497
518
|
import { Icon } from "@sps-woodland/core";
|
@@ -539,7 +560,7 @@ const Se = {
|
|
539
560
|
`
|
540
561
|
},
|
541
562
|
expandableWithCheckboxAndFavorite: {
|
542
|
-
react:
|
563
|
+
react: c`
|
543
564
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
544
565
|
import { Card } from "@sps-woodland/cards";
|
545
566
|
import { Icon } from "@sps-woodland/core";
|
@@ -589,7 +610,7 @@ const Se = {
|
|
589
610
|
`
|
590
611
|
},
|
591
612
|
expandableWithCheckboxAndFavoriteAlternate: {
|
592
|
-
react:
|
613
|
+
react: c`
|
593
614
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
594
615
|
import { Card } from "@sps-woodland/cards";
|
595
616
|
import { Icon } from "@sps-woodland/core";
|
@@ -638,6 +659,69 @@ const Se = {
|
|
638
659
|
)
|
639
660
|
}
|
640
661
|
`
|
662
|
+
},
|
663
|
+
expandableWithCheckboxAndIndeterminate: {
|
664
|
+
react: c`
|
665
|
+
import { ContentRow, ContentRowCol } from "@sps-woodland/content-row";
|
666
|
+
import { Icon } from "@sps-woodland/core";
|
667
|
+
import { sprinkles } from "@sps-woodland/tokens";
|
668
|
+
|
669
|
+
function Component() {
|
670
|
+
colors = ["Red", "Blue", "Green"];
|
671
|
+
const [selectedColors, setSelectedColors] = React.useState([colors[0]]);
|
672
|
+
|
673
|
+
const isIndeterminate =
|
674
|
+
selectedColors.length > 0 && selectedColors.length < colors.length;
|
675
|
+
const isSelected = selectedColors.length > 0;
|
676
|
+
|
677
|
+
return (
|
678
|
+
<ContentRow
|
679
|
+
selectable
|
680
|
+
selectIndeterminate={isIndeterminate}
|
681
|
+
selected={isSelected}
|
682
|
+
onSelectionChange={() => {
|
683
|
+
if (isIndeterminate || isSelected) {
|
684
|
+
setSelectedColors([]);
|
685
|
+
} else {
|
686
|
+
setSelectedColors(colors);
|
687
|
+
}
|
688
|
+
}}
|
689
|
+
expanded
|
690
|
+
>
|
691
|
+
<ContentRowCol>
|
692
|
+
<Icon
|
693
|
+
className={sprinkles({ mr: "sm" })}
|
694
|
+
icon="status-in-process"
|
695
|
+
size="lg"
|
696
|
+
color="purple-medium"
|
697
|
+
/>
|
698
|
+
<a href="#" className={sprinkles({ fs: "body-md" })}>
|
699
|
+
3532379
|
700
|
+
</a>
|
701
|
+
</ContentRowCol>
|
702
|
+
<ContentRowCol widthPx={160}>May 23, 2018 @ 4:38 PM</ContentRowCol>
|
703
|
+
<ContentRowExpansion>
|
704
|
+
<Card>
|
705
|
+
{colors.map((color) => (
|
706
|
+
<SpsCheckbox
|
707
|
+
checked={selectedColors.includes(color)}
|
708
|
+
inline
|
709
|
+
label={color}
|
710
|
+
onChange={() => {
|
711
|
+
if (selectedColors.includes(color)) {
|
712
|
+
setSelectedColors(selectedColors.filter((c) => c !== color));
|
713
|
+
} else {
|
714
|
+
setSelectedColors([...selectedColors, color]);
|
715
|
+
}
|
716
|
+
}}
|
717
|
+
/>
|
718
|
+
))}
|
719
|
+
</Card>
|
720
|
+
</ContentRowExpansion>
|
721
|
+
</ContentRow>
|
722
|
+
);
|
723
|
+
}
|
724
|
+
`
|
641
725
|
}
|
642
726
|
}
|
643
727
|
},
|
@@ -645,7 +729,7 @@ const Se = {
|
|
645
729
|
label: "Sortable Content Rows",
|
646
730
|
examples: {
|
647
731
|
basic: {
|
648
|
-
react:
|
732
|
+
react: c`
|
649
733
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
650
734
|
import { Card } from "@sps-woodland/cards";
|
651
735
|
import { SortingHeader, SortingHeaderCell } from "@sps-woodland/sorting-header";
|
@@ -1097,13 +1181,13 @@ const Se = {
|
|
1097
1181
|
// },
|
1098
1182
|
// },
|
1099
1183
|
}
|
1100
|
-
},
|
1101
|
-
"Content Rows":
|
1184
|
+
}, Fe = {
|
1185
|
+
"Content Rows": ze
|
1102
1186
|
};
|
1103
1187
|
export {
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1188
|
+
ee as ContentRow,
|
1189
|
+
p as ContentRowCol,
|
1190
|
+
I as ContentRowExpansion,
|
1191
|
+
Fe as MANIFEST,
|
1108
1192
|
Ne as RowListAutoLayout
|
1109
1193
|
};
|
package/lib/index.umd.cjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
(function(l,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("react"),require("@sps-woodland/core"),require("@sps-woodland/buttons"),require("@spscommerce/ds-react"),require("@spscommerce/ds-shared"),require("@spscommerce/utils")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@sps-woodland/buttons","@spscommerce/ds-react","@spscommerce/ds-shared","@spscommerce/utils"],k):(l=typeof globalThis<"u"?globalThis:l||self,k(l.ContentRow={},l.React,l.core,l.buttons,l.dsReact,l.dsShared,l.utils))})(this,function(l,k,a,O,H,x,u){"use strict";function oe(o){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(s,t,n.get?n:{enumerable:!0,get:()=>o[t]})}}return s.default=o,Object.freeze(s)}const e=oe(k);function te(o,s,t){return s in o?Object.defineProperty(o,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[s]=t,o}function A(o,s){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);s&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function D(o){for(var s=1;s<arguments.length;s++){var t=arguments[s]!=null?arguments[s]:{};s%2?A(Object(t),!0).forEach(function(n){te(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):A(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}var ne=(o,s,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=s[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},p=o=>s=>{var t=o.defaultClassName,n=D(D({},o.defaultVariants),s);for(var r in n){var i,m=(i=n[r])!==null&&i!==void 0?i:o.defaultVariants[r];if(m!=null){var d=m;typeof d=="boolean"&&(d=d===!0?"true":"false");var R=o.variantClassNames[r][d];R&&(t+=" "+R)}}for(var[f,C]of o.compoundVariants)ne(f,n,o.defaultVariants)&&(t+=" "+C);return t},se=p({defaultClassName:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufv0",variantClassNames:{lean:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufv1",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufv2"},borderless:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufv3",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufv4"},wrapContent:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufv5",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufv6"}},defaultVariants:{lean:!1,borderless:!1,wrapContent:!1},compoundVariants:[]}),ae=p({defaultClassName:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufv7",variantClassNames:{lean:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufv8",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufv9"},borderless:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufva",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufvb"},wrapContent:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufvc",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_1mxrufvd"}},defaultVariants:{lean:!1,borderless:!1,wrapContent:!1},compoundVariants:[]});function _({children:o,className:s,borderless:t,lean:n,widthPx:r,widthRem:i,style:m,wrapContent:d=!1,__autoLayout:R=!1,...f}){const C=r?r/16:i,h=C?{...m,width:`${C}rem`}:m;return R?e.createElement("td",{className:a.cl(ae({lean:n,borderless:t,wrapContent:d}),s),...f,style:h},o):e.createElement("div",{className:a.cl(se({lean:n,borderless:t,wrapContent:d}),s),...f,style:h},o)}a.Metadata.set(_,{name:"Content Row Col",props:{borderless:{type:"boolean"},lean:{type:"boolean"},widthPx:{type:"number"},widthRem:{type:"number"},wrapContent:{type:"boolean"}}});var re=p({defaultClassName:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee4",variantClassNames:{expanded:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee5",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee6"}},defaultVariants:{expanded:!1},compoundVariants:[]}),le=p({defaultClassName:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee7",variantClassNames:{cardSpacing:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee8",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee9"},expanded:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeea",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeeb"},selected:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeec",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeed"},reorderable:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeee",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeef"}},defaultVariants:{expanded:!1,selected:!1,cardSpacing:!1},compoundVariants:[[{expanded:!0,cardSpacing:!0},"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeeg"]]}),de=p({defaultClassName:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeeh",variantClassNames:{selected:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeei",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeej"},expanded:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeek",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeel"}},defaultVariants:{selected:!1,expanded:!1},compoundVariants:[]}),_e="pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeem",ie="pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeen",ce=p({defaultClassName:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeeo",variantClassNames:{disabled:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeep",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeeq"}},defaultVariants:{},compoundVariants:[]}),T=p({defaultClassName:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeer",variantClassNames:{__autoLayout:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjees",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeet"}},defaultVariants:{__autoLayout:!1},compoundVariants:[]}),E="pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeeu",pe="pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeev",L=p({defaultClassName:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeew",variantClassNames:{reorderable:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeex",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeey"}},defaultVariants:{reorderable:!1},compoundVariants:[]}),me="pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjeez",ue="pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee10",we="pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee11",W=p({defaultClassName:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee12",variantClassNames:{disabled:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee13",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee14"},up:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee15",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee16"},down:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee17",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_11ztjee18"}},defaultVariants:{disabled:!1,up:!1,down:!1},compoundVariants:[]});function N({children:o,className:s,__autoLayout:t=!1,...n}){return t?e.createElement("tr",null,e.createElement("td",{className:a.cl(T({__autoLayout:t}),s),colSpan:100,...n},o)):e.createElement("div",{className:a.cl(T({__autoLayout:t}),s),...n},o)}a.Metadata.set(N,{name:"Content Row Expansion"});function V({children:o,className:s,alternateLayout:t=!1,initiallyExpanded:n=!1,cardSpacing:r=!1,expanded:i,onBeforeCollapsed:m,onBeforeExpanded:d,onSelectionChange:R,onCollapsed:f,onExpanded:C,selectable:h=!1,selected:P,renderExpandedContent:M=!0,disableSelection:be=!1,disableExpansion:B=!1,hideExpansionControl:S=!1,__autoLayout:K=!1,__reorderable:y=!1,__onOrderChange:j=()=>{},__index:c=0,__canBeMovedUp:G,__canBeMovedDown:J,...U}){const[Q,[g]]=a.selectChildren(o,[{type:_},{type:N}]),{t:Re}=e.useContext(a.I18nContext),[ge,X]=e.useState(M||n),[ve,Y]=e.useState(n),w=typeof i=="boolean"?i:ve,Z=K?w:ge,[I,F]=e.useState((c+1).toString()||"");e.useEffect(()=>{F((c+1).toString()||"")},[c]);function ke(b){F(b.target.value)}function $(){Number(I)?j(c,Number(I)-1):(F((c+1).toString()||""),j(c,c))}function ye(b){b.stopPropagation(),w&&(!m||m())?(Y(!1),M||X(!1),f&&f()):!w&&(!d||d())&&(Y(!0),M||X(!0),C&&C())}const v=()=>e.createElement(H.SpsCheckbox,{disabled:be,checked:P,onChange:R}),z=e.createElement("button",{type:"button",className:a.cl(ie),onClick:ye,"aria-label":Re(`design-system:contentRow.${w?"collapse":"expand"}`,{defaultValue:`${w?"Collapse":"Expand"}`}),disabled:B},e.createElement(a.Icon,{className:a.cl(ce({disabled:B})),icon:w?"minus-circle":"plus-circle"}));if(K){const b=e.createElement("tr",null,e.createElement("td",{className:a.cl(_e),colSpan:100}));return e.createElement(e.Fragment,null,e.createElement("tr",{className:a.cl(de({selected:P,expanded:w})),...U},h&&!t&&e.createElement(_,{widthPx:46,__autoLayout:!0},e.createElement(v,null)),g&&!t&&!S&&e.createElement(_,{widthPx:44,__autoLayout:!0},z),g&&h&&t&&e.createElement(_,{widthPx:46,__autoLayout:!0},S?e.createElement(v,null):e.createElement(e.Fragment,null,e.createElement("section",{className:E},e.createElement(v,null)),e.createElement("section",{className:E},z))),Q),Z&&g,b)}const ee=e.createElement("div",{className:a.cl(re({expanded:w}),s),...U},e.createElement("div",{className:a.cl(le({expanded:w,selected:P,cardSpacing:r,reorderable:y}))},y&&e.createElement(_,{widthPx:53,style:{position:"relative"}},e.createElement("section",{className:L({reorderable:y})},e.createElement(O.Button,{className:W({up:!0,disabled:!G}),kind:x.ButtonKind.ICON,icon:x.SpsIcon.CHEVRON_UP,onClick:()=>j(c,c-1),disabled:!G})),e.createElement("section",{className:L({reorderable:y})},e.createElement(O.Button,{className:W({down:!0,disabled:!J}),kind:x.ButtonKind.ICON,icon:x.SpsIcon.CHEVRON_DOWN,onClick:()=>j(c,c+1),disabled:!J}))),h&&!t&&e.createElement(_,{widthPx:46},e.createElement(v,null)),g&&!t&&!S&&e.createElement(_,{widthPx:44},z),g&&h&&t&&e.createElement(_,{widthPx:46},S?e.createElement(v,null):e.createElement(e.Fragment,null,e.createElement("section",{className:E},e.createElement(v,null)),e.createElement("section",{className:E},z))),Q),Z&&g);return y?e.createElement("div",{className:pe},e.createElement("div",{className:a.cl(me,s)},e.createElement("div",{className:ue},e.createElement(H.SpsTextInput,{className:we,value:I,onChange:ke,onBlur:()=>$(),onKeyUp:b=>{b.key==="Enter"&&$()},notClearable:!0}))),ee):ee}a.Metadata.set(V,{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 fe=p({defaultClassName:"pkg_sps-woodland_content-row__version_8_31_7__hash_1wuky9j0",variantClassNames:{wrapContent:{true:"pkg_sps-woodland_content-row__version_8_31_7__hash_1wuky9j1",false:"pkg_sps-woodland_content-row__version_8_31_7__hash_1wuky9j2"}},defaultVariants:{wrapContent:!1},compoundVariants:[]});const Ce=new Set(["Content Row","Content Row Col","Content Row Expansion","Sorting Header","Sorting Header Cell"]);function q({children:o,className:s,wrapContent:t=!1,...n}){const r=e.useMemo(()=>a.modChildren(o,d=>a.Metadata.isWoodlandComponent(d.type)&&Ce.has(a.Metadata.get(d.type).name)?[{__autoLayout:!0}]:[{}]),[o]),[[i],m]=e.useMemo(()=>a.selectChildren(r,[{type:d=>!!(a.Metadata.isWoodlandComponent(d.type)&&a.Metadata.get(d.type).name==="Sorting Header")}]),[r]);return e.createElement("table",{className:a.cl(fe({wrapContent:t}),s),...n},i?e.createElement("thead",null,i):null,e.createElement("tbody",null,m))}a.Metadata.set(q,{name:"Row List Auto Layout",props:{wrapContent:{type:"boolean",default:"false"}}});const he={"Content Rows":{components:[V,_,N],examples:{basic:{label:"Content Rows",examples:{basic:{react:u.code`
|
1
|
+
(function(l,k){typeof exports=="object"&&typeof module<"u"?k(exports,require("react"),require("@sps-woodland/core"),require("@sps-woodland/buttons"),require("@spscommerce/ds-react"),require("@spscommerce/ds-shared"),require("@spscommerce/utils")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@sps-woodland/buttons","@spscommerce/ds-react","@spscommerce/ds-shared","@spscommerce/utils"],k):(l=typeof globalThis<"u"?globalThis:l||self,k(l.ContentRow={},l.React,l.core,l.buttons,l.dsReact,l.dsShared,l.utils))})(this,function(l,k,a,O,H,x,p){"use strict";function te(o){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(s,t,n.get?n:{enumerable:!0,get:()=>o[t]})}}return s.default=o,Object.freeze(s)}const e=te(k);function ne(o,s,t){return s in o?Object.defineProperty(o,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[s]=t,o}function A(o,s){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);s&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(o,r).enumerable})),t.push.apply(t,n)}return t}function D(o){for(var s=1;s<arguments.length;s++){var t=arguments[s]!=null?arguments[s]:{};s%2?A(Object(t),!0).forEach(function(n){ne(o,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):A(Object(t)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(t,n))})}return o}var se=(o,s,t)=>{for(var n of Object.keys(o)){var r;if(o[n]!==((r=s[n])!==null&&r!==void 0?r:t[n]))return!1}return!0},m=o=>s=>{var t=o.defaultClassName,n=D(D({},o.defaultVariants),s);for(var r in n){var c,w=(c=n[r])!==null&&c!==void 0?c:o.defaultVariants[r];if(w!=null){var d=w;typeof d=="boolean"&&(d=d===!0?"true":"false");var R=o.variantClassNames[r][d];R&&(t+=" "+R)}}for(var[C,f]of o.compoundVariants)se(C,n,o.defaultVariants)&&(t+=" "+f);return t},ae=m({defaultClassName:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv0",variantClassNames:{lean:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv1",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv2"},borderless:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv3",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv4"},wrapContent:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv5",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv6"}},defaultVariants:{lean:!1,borderless:!1,wrapContent:!1},compoundVariants:[]}),re=m({defaultClassName:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv7",variantClassNames:{lean:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv8",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv9"},borderless:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufva",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufvb"},wrapContent:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufvc",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufvd"}},defaultVariants:{lean:!1,borderless:!1,wrapContent:!1},compoundVariants:[]});function _({children:o,className:s,borderless:t,lean:n,widthPx:r,widthRem:c,style:w,wrapContent:d=!1,__autoLayout:R=!1,...C}){const f=r?r/16:c,h=f?{...w,width:`${f}rem`}:w;return R?e.createElement("td",{className:a.cl(re({lean:n,borderless:t,wrapContent:d}),s),...C,style:h},o):e.createElement("div",{className:a.cl(ae({lean:n,borderless:t,wrapContent:d}),s),...C,style:h},o)}a.Metadata.set(_,{name:"Content Row Col",props:{borderless:{type:"boolean"},lean:{type:"boolean"},widthPx:{type:"number"},widthRem:{type:"number"},wrapContent:{type:"boolean"}}});var le=m({defaultClassName:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee4",variantClassNames:{expanded:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee5",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee6"}},defaultVariants:{expanded:!1},compoundVariants:[]}),de=m({defaultClassName:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee7",variantClassNames:{cardSpacing:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee8",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee9"},expanded:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeea",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeb"},selected:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeec",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeed"},reorderable:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeee",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeef"}},defaultVariants:{expanded:!1,selected:!1,cardSpacing:!1},compoundVariants:[[{expanded:!0,cardSpacing:!0},"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeg"]]}),_e=m({defaultClassName:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeh",variantClassNames:{selected:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeei",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeej"},expanded:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeek",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeel"}},defaultVariants:{selected:!1,expanded:!1},compoundVariants:[]}),ce="pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeem",ie="pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeen",pe=m({defaultClassName:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeo",variantClassNames:{disabled:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeep",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeq"}},defaultVariants:{},compoundVariants:[]}),T=m({defaultClassName:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeer",variantClassNames:{__autoLayout:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjees",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeet"}},defaultVariants:{__autoLayout:!1},compoundVariants:[]}),E="pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeu",me="pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeev",L=m({defaultClassName:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeew",variantClassNames:{reorderable:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeex",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeey"}},defaultVariants:{reorderable:!1},compoundVariants:[]}),we="pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeez",ue="pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee10",Ce="pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee11",W=m({defaultClassName:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee12",variantClassNames:{disabled:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee13",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee14"},up:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee15",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee16"},down:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee17",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee18"}},defaultVariants:{disabled:!1,up:!1,down:!1},compoundVariants:[]});function S({children:o,className:s,__autoLayout:t=!1,...n}){return t?e.createElement("tr",null,e.createElement("td",{className:a.cl(T({__autoLayout:t}),s),colSpan:100,...n},o)):e.createElement("div",{className:a.cl(T({__autoLayout:t}),s),...n},o)}a.Metadata.set(S,{name:"Content Row Expansion"});function V({children:o,className:s,alternateLayout:t=!1,initiallyExpanded:n=!1,cardSpacing:r=!1,expanded:c,onBeforeCollapsed:w,onBeforeExpanded:d,onSelectionChange:R,onCollapsed:C,onExpanded:f,selectable:h=!1,selected:P,selectIndeterminate:q,renderExpandedContent:I=!0,disableSelection:Re=!1,disableExpansion:K=!1,hideExpansionControl:N=!1,__autoLayout:G=!1,__reorderable:y=!1,__onOrderChange:j=()=>{},__index:i=0,__canBeMovedUp:J,__canBeMovedDown:U,...Q}){const[X,[g]]=a.selectChildren(o,[{type:_},{type:S}]),{t:ge}=e.useContext(a.I18nContext),[ve,Y]=e.useState(I||n),[ke,Z]=e.useState(n),u=typeof c=="boolean"?c:ke,$=G?u:ve,[M,F]=e.useState((i+1).toString()||"");e.useEffect(()=>{F((i+1).toString()||"")},[i]);function ye(b){F(b.target.value)}function ee(){Number(M)?j(i,Number(M)-1):(F((i+1).toString()||""),j(i,i))}function xe(b){b.stopPropagation(),u&&(!w||w())?(Z(!1),I||Y(!1),C&&C()):!u&&(!d||d())&&(Z(!0),I||Y(!0),f&&f())}const v=()=>e.createElement(H.SpsCheckbox,{disabled:Re,checked:P,indeterminate:q,onChange:R}),z=e.createElement("button",{type:"button",className:a.cl(ie),onClick:xe,"aria-label":ge(`design-system:contentRow.${u?"collapse":"expand"}`,{defaultValue:`${u?"Collapse":"Expand"}`}),disabled:K},e.createElement(a.Icon,{className:a.cl(pe({disabled:K})),icon:u?"minus-circle":"plus-circle"}));if(G){const b=e.createElement("tr",null,e.createElement("td",{className:a.cl(ce),colSpan:100}));return e.createElement(e.Fragment,null,e.createElement("tr",{className:a.cl(_e({selected:P||q,expanded:u})),...Q},h&&!t&&e.createElement(_,{widthPx:46,__autoLayout:!0},e.createElement(v,null)),g&&!t&&!N&&e.createElement(_,{widthPx:44,__autoLayout:!0},z),g&&h&&t&&e.createElement(_,{widthPx:46,__autoLayout:!0},N?e.createElement(v,null):e.createElement(e.Fragment,null,e.createElement("section",{className:E},e.createElement(v,null)),e.createElement("section",{className:E},z))),X),$&&g,b)}const oe=e.createElement("div",{className:a.cl(le({expanded:u}),s),...Q},e.createElement("div",{className:a.cl(de({expanded:u,selected:P,cardSpacing:r,reorderable:y}))},y&&e.createElement(_,{widthPx:53,style:{position:"relative"}},e.createElement("section",{className:L({reorderable:y})},e.createElement(O.Button,{className:W({up:!0,disabled:!J}),kind:x.ButtonKind.ICON,icon:x.SpsIcon.CHEVRON_UP,onClick:()=>j(i,i-1),disabled:!J})),e.createElement("section",{className:L({reorderable:y})},e.createElement(O.Button,{className:W({down:!0,disabled:!U}),kind:x.ButtonKind.ICON,icon:x.SpsIcon.CHEVRON_DOWN,onClick:()=>j(i,i+1),disabled:!U}))),h&&!t&&e.createElement(_,{widthPx:46},e.createElement(v,null)),g&&!t&&!N&&e.createElement(_,{widthPx:44},z),g&&h&&t&&e.createElement(_,{widthPx:46},N?e.createElement(v,null):e.createElement(e.Fragment,null,e.createElement("section",{className:E},e.createElement(v,null)),e.createElement("section",{className:E},z))),X),$&&g);return y?e.createElement("div",{className:me},e.createElement("div",{className:a.cl(we,s)},e.createElement("div",{className:ue},e.createElement(H.SpsTextInput,{className:Ce,value:M,onChange:ye,onBlur:()=>ee(),onKeyUp:b=>{b.key==="Enter"&&ee()},notClearable:!0}))),oe):oe}a.Metadata.set(V,{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 fe=m({defaultClassName:"pkg_sps-woodland_content-row__version_8_32_0__hash_1wuky9j0",variantClassNames:{wrapContent:{true:"pkg_sps-woodland_content-row__version_8_32_0__hash_1wuky9j1",false:"pkg_sps-woodland_content-row__version_8_32_0__hash_1wuky9j2"}},defaultVariants:{wrapContent:!1},compoundVariants:[]});const he=new Set(["Content Row","Content Row Col","Content Row Expansion","Sorting Header","Sorting Header Cell"]);function B({children:o,className:s,wrapContent:t=!1,...n}){const r=e.useMemo(()=>a.modChildren(o,d=>a.Metadata.isWoodlandComponent(d.type)&&he.has(a.Metadata.get(d.type).name)?[{__autoLayout:!0}]:[{}]),[o]),[[c],w]=e.useMemo(()=>a.selectChildren(r,[{type:d=>!!(a.Metadata.isWoodlandComponent(d.type)&&a.Metadata.get(d.type).name==="Sorting Header")}]),[r]);return e.createElement("table",{className:a.cl(fe({wrapContent:t}),s),...n},c?e.createElement("thead",null,c):null,e.createElement("tbody",null,w))}a.Metadata.set(B,{name:"Row List Auto Layout",props:{wrapContent:{type:"boolean",default:"false"}}});const be={"Content Rows":{components:[V,_,S],examples:{basic:{label:"Content Rows",examples:{basic:{react:p.code`
|
2
2
|
import { ContentRow, ContentRowCol } from "@sps-woodland/content-row";
|
3
3
|
import { Icon } from "@sps-woodland/core";
|
4
4
|
import { sprinkles } from "@sps-woodland/tokens";
|
@@ -16,7 +16,7 @@
|
|
16
16
|
</ContentRow>
|
17
17
|
)
|
18
18
|
}
|
19
|
-
`},withCheckbox:{react:
|
19
|
+
`},withCheckbox:{react:p.code`
|
20
20
|
import { ContentRow, ContentRowCol } from "@sps-woodland/content-row";
|
21
21
|
import { Icon } from "@sps-woodland/core";
|
22
22
|
import { sprinkles } from "@sps-woodland/tokens";
|
@@ -46,7 +46,7 @@
|
|
46
46
|
</ContentRow>
|
47
47
|
)
|
48
48
|
}
|
49
|
-
`},withCheckboxAndFavorite:{react:
|
49
|
+
`},withCheckboxAndFavorite:{react:p.code`
|
50
50
|
import { ContentRow, ContentRowCol } from "@sps-woodland/content-row";
|
51
51
|
import { Icon } from "@sps-woodland/core";
|
52
52
|
import { sprinkles } from "@sps-woodland/tokens";
|
@@ -79,7 +79,7 @@
|
|
79
79
|
</ContentRow>
|
80
80
|
)
|
81
81
|
}
|
82
|
-
`}}},expandable:{label:"Expandable Content Rows",examples:{basic:{react:
|
82
|
+
`}}},expandable:{label:"Expandable Content Rows",examples:{basic:{react:p.code`
|
83
83
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
84
84
|
import { Card } from "@sps-woodland/cards";
|
85
85
|
import { Icon } from "@sps-woodland/core";
|
@@ -111,7 +111,7 @@
|
|
111
111
|
</ContentRow>
|
112
112
|
)
|
113
113
|
}
|
114
|
-
`},expandableWithCheckbox:{react:
|
114
|
+
`},expandableWithCheckbox:{react:p.code`
|
115
115
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
116
116
|
import { Card } from "@sps-woodland/cards";
|
117
117
|
import { Icon } from "@sps-woodland/core";
|
@@ -155,7 +155,7 @@
|
|
155
155
|
</ContentRow>
|
156
156
|
)
|
157
157
|
}
|
158
|
-
`},expandableWithCheckboxAlternate:{react:
|
158
|
+
`},expandableWithCheckboxAlternate:{react:p.code`
|
159
159
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
160
160
|
import { Card } from "@sps-woodland/cards";
|
161
161
|
import { Icon } from "@sps-woodland/core";
|
@@ -200,7 +200,7 @@
|
|
200
200
|
</ContentRow>
|
201
201
|
)
|
202
202
|
}
|
203
|
-
`},expandableWithCheckboxAndFavorite:{react:
|
203
|
+
`},expandableWithCheckboxAndFavorite:{react:p.code`
|
204
204
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
205
205
|
import { Card } from "@sps-woodland/cards";
|
206
206
|
import { Icon } from "@sps-woodland/core";
|
@@ -247,7 +247,7 @@
|
|
247
247
|
</ContentRow>
|
248
248
|
)
|
249
249
|
}
|
250
|
-
`},expandableWithCheckboxAndFavoriteAlternate:{react:
|
250
|
+
`},expandableWithCheckboxAndFavoriteAlternate:{react:p.code`
|
251
251
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
252
252
|
import { Card } from "@sps-woodland/cards";
|
253
253
|
import { Icon } from "@sps-woodland/core";
|
@@ -295,7 +295,67 @@
|
|
295
295
|
</ContentRow>
|
296
296
|
)
|
297
297
|
}
|
298
|
-
`}
|
298
|
+
`},expandableWithCheckboxAndIndeterminate:{react:p.code`
|
299
|
+
import { ContentRow, ContentRowCol } from "@sps-woodland/content-row";
|
300
|
+
import { Icon } from "@sps-woodland/core";
|
301
|
+
import { sprinkles } from "@sps-woodland/tokens";
|
302
|
+
|
303
|
+
function Component() {
|
304
|
+
colors = ["Red", "Blue", "Green"];
|
305
|
+
const [selectedColors, setSelectedColors] = React.useState([colors[0]]);
|
306
|
+
|
307
|
+
const isIndeterminate =
|
308
|
+
selectedColors.length > 0 && selectedColors.length < colors.length;
|
309
|
+
const isSelected = selectedColors.length > 0;
|
310
|
+
|
311
|
+
return (
|
312
|
+
<ContentRow
|
313
|
+
selectable
|
314
|
+
selectIndeterminate={isIndeterminate}
|
315
|
+
selected={isSelected}
|
316
|
+
onSelectionChange={() => {
|
317
|
+
if (isIndeterminate || isSelected) {
|
318
|
+
setSelectedColors([]);
|
319
|
+
} else {
|
320
|
+
setSelectedColors(colors);
|
321
|
+
}
|
322
|
+
}}
|
323
|
+
expanded
|
324
|
+
>
|
325
|
+
<ContentRowCol>
|
326
|
+
<Icon
|
327
|
+
className={sprinkles({ mr: "sm" })}
|
328
|
+
icon="status-in-process"
|
329
|
+
size="lg"
|
330
|
+
color="purple-medium"
|
331
|
+
/>
|
332
|
+
<a href="#" className={sprinkles({ fs: "body-md" })}>
|
333
|
+
3532379
|
334
|
+
</a>
|
335
|
+
</ContentRowCol>
|
336
|
+
<ContentRowCol widthPx={160}>May 23, 2018 @ 4:38 PM</ContentRowCol>
|
337
|
+
<ContentRowExpansion>
|
338
|
+
<Card>
|
339
|
+
{colors.map((color) => (
|
340
|
+
<SpsCheckbox
|
341
|
+
checked={selectedColors.includes(color)}
|
342
|
+
inline
|
343
|
+
label={color}
|
344
|
+
onChange={() => {
|
345
|
+
if (selectedColors.includes(color)) {
|
346
|
+
setSelectedColors(selectedColors.filter((c) => c !== color));
|
347
|
+
} else {
|
348
|
+
setSelectedColors([...selectedColors, color]);
|
349
|
+
}
|
350
|
+
}}
|
351
|
+
/>
|
352
|
+
))}
|
353
|
+
</Card>
|
354
|
+
</ContentRowExpansion>
|
355
|
+
</ContentRow>
|
356
|
+
);
|
357
|
+
}
|
358
|
+
`}}},sortable:{label:"Sortable Content Rows",examples:{basic:{react:p.code`
|
299
359
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
300
360
|
import { Card } from "@sps-woodland/cards";
|
301
361
|
import { SortingHeader, SortingHeaderCell } from "@sps-woodland/sorting-header";
|
@@ -398,4 +458,4 @@
|
|
398
458
|
</>
|
399
459
|
)
|
400
460
|
}
|
401
|
-
`}}}}}};l.ContentRow=V,l.ContentRowCol=_,l.ContentRowExpansion=
|
461
|
+
`}}}}}};l.ContentRow=V,l.ContentRowCol=_,l.ContentRowExpansion=S,l.MANIFEST=be,l.RowListAutoLayout=B,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
package/lib/style.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
.pkg_sps-woodland_content-
|
1
|
+
.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee4{background:#fff;border-radius:.25rem;display:block}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee5{--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee0: block}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee6{--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee0: none}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee7{display:table;table-layout:fixed;width:100.06%;border-width:.0625rem;border-style:solid;border-color:#d2d4d4;border-radius:.25rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee8{border-radius:.25rem;margin-top:1rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeea{border-top-left-radius:.25rem;border-top-right-radius:.25rem;border-bottom-right-radius:0;border-bottom-left-radius:0}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeec{background:#e6f2f8;border-color:#007db8}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeee{min-height:3.875rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeg{border-top-left-radius:.25rem;border-top-right-radius:.25rem;border-bottom-right-radius:0;border-bottom-left-radius:0}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeh{background:#fff}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeei{--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee2: #007db8ff;background:#e6f2f8}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeej{--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee2: #d2d4d4ff}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeek{--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee1: 0}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeel{--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee1: .25rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeem{height:1rem;background:transparent;border:0}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeen{background:none;border:0;padding:0}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeo{cursor:pointer;font-size:1rem;line-height:1.125rem;padding:0;margin-bottom:0}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeep{color:#d2d4d4;cursor:not-allowed}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeq{color:#007db8}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeq:hover{color:#09638d}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeer{display:var(--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee0);background:#f3f4f4;border-color:#d2d4d4;border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem;border-style:solid;border-top-width:0;border-right-width:.0625rem;border-bottom-width:.0625rem;border-left-width:.0625rem;padding:1rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjees{display:table-cell}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeet{display:var(--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee0)}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeu{padding:1rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeu:first-child{margin:-1rem -1rem 0}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeeu:last-child{border-top-width:.0625rem;border-right-width:0;border-bottom-width:0;border-left-width:0;border-style:solid;border-top-color:#d2d4d4;margin:0 -1rem -1rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeev{display:flex}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeew{position:absolute}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeew:first-child{margin:-1rem -1rem 0;top:1rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeew:last-child{border-top-width:.0625rem;border-right-width:0;border-bottom-width:0;border-left-width:0;border-style:solid;border-top-color:#d2d4d4;margin:0 -1rem -1rem;bottom:1rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeex{min-height:1.78125rem;width:3.3125rem;height:50%;display:flex}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeey{padding:1rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeez{display:block}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee10{border-width:.0625rem;border-style:solid;border-color:#d2d4d4;border-radius:.25rem;background:#fff;height:100%;display:table;table-layout:fixed;min-height:3.5rem;width:3.5rem;margin-right:.5rem;padding:.5rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee11{display:table-cell;vertical-align:middle}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee12{border-radius:0;padding:0}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee13{--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee3: none;border:none}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee14{--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee3: inline}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee15{border-top-left-radius:.1875rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee17{border-bottom-left-radius:.1875rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeew .pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee12{width:100%;height:100%}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeew .pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee12 button{padding:0;width:100%;height:100%;min-height:1.78125rem;min-width:3.3125rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjeew .pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee12 button>i{display:var(--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee3)}.pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee11 input{text-align:center}.pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv0{display:table-cell;padding:1rem;vertical-align:middle}.pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv1{padding:.5rem 1rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv4:not(:first-child){border-left:.0625rem solid #d2d4d4ff}.pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv5{word-break:break-word}.pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv7{padding:1rem;vertical-align:middle;border-style:solid;border-color:var(--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee2);border-top-width:.0625rem;border-bottom-width:.0625rem;border-left-width:.0625rem;border-right-width:0;text-align:left}.pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv7:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:var(--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee1)}.pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv7:last-child{border-right-width:.0625rem;border-top-right-radius:.25rem;border-bottom-right-radius:var(--pkg_sps-woodland_content-row__version_8_32_0__hash_11ztjee1)}.pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv8{padding:.5rem 1rem}.pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufva{border-left-width:0}.pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufvc{word-break:break-word}.pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv0>*{vertical-align:middle}.pkg_sps-woodland_content-row__version_8_32_0__hash_1mxrufv0 svg{margin-left:-.125rem;margin-top:-.125rem;vertical-align:middle;margin-bottom:0}.pkg_sps-woodland_content-row__version_8_32_0__hash_1wuky9j0{table-layout:auto;width:100%;border-collapse:separate;border-spacing:0;white-space:normal;overflow:hidden}.pkg_sps-woodland_content-row__version_8_32_0__hash_1wuky9j1{word-break:break-word}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sps-woodland/content-row",
|
3
3
|
"description": "SPS Woodland Design System page title component",
|
4
|
-
"version": "8.
|
4
|
+
"version": "8.32.0",
|
5
5
|
"author": "SPS Commerce",
|
6
6
|
"license": "UNLICENSED",
|
7
7
|
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/page-title",
|
@@ -30,12 +30,12 @@
|
|
30
30
|
"@spscommerce/utils": "^7.0.0",
|
31
31
|
"react": "^16.14.0",
|
32
32
|
"react-dom": "^16.14.0",
|
33
|
-
"@sps-woodland/
|
34
|
-
"@sps-woodland/
|
35
|
-
"@
|
36
|
-
"@
|
37
|
-
"@spscommerce/ds-react": "8.
|
38
|
-
"@spscommerce/ds-shared": "8.
|
33
|
+
"@sps-woodland/tokens": "8.32.0",
|
34
|
+
"@sps-woodland/core": "8.32.0",
|
35
|
+
"@spscommerce/ds-colors": "8.32.0",
|
36
|
+
"@sps-woodland/buttons": "8.32.0",
|
37
|
+
"@spscommerce/ds-react": "8.32.0",
|
38
|
+
"@spscommerce/ds-shared": "8.32.0"
|
39
39
|
},
|
40
40
|
"devDependencies": {
|
41
41
|
"@spscommerce/ds-illustrations": "^6.12.1",
|
@@ -44,12 +44,12 @@
|
|
44
44
|
"@vanilla-extract/recipes": "^0.2.5",
|
45
45
|
"react": "^16.14.0",
|
46
46
|
"react-dom": "^16.14.0",
|
47
|
-
"@sps-woodland/core": "8.
|
48
|
-
"@sps-woodland/tokens": "8.
|
49
|
-
"@sps-woodland/buttons": "8.
|
50
|
-
"@spscommerce/ds-colors": "8.
|
51
|
-
"@spscommerce/ds-react": "8.
|
52
|
-
"@spscommerce/ds-shared": "8.
|
47
|
+
"@sps-woodland/core": "8.32.0",
|
48
|
+
"@sps-woodland/tokens": "8.32.0",
|
49
|
+
"@sps-woodland/buttons": "8.32.0",
|
50
|
+
"@spscommerce/ds-colors": "8.32.0",
|
51
|
+
"@spscommerce/ds-react": "8.32.0",
|
52
|
+
"@spscommerce/ds-shared": "8.32.0"
|
53
53
|
},
|
54
54
|
"scripts": {
|
55
55
|
"build": "pnpm run build:js && pnpm run build:types",
|