@sps-woodland/content-row 8.7.6 → 8.8.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.css.d.ts +44 -5
- package/lib/content-row/ContentRow.d.ts +3 -2
- package/lib/content-row-col/ContentRowCol.css.d.ts +29 -0
- package/lib/content-row-col/ContentRowCol.d.ts +4 -2
- package/lib/content-row-expansion/ContentRowExpansion.d.ts +3 -1
- package/lib/index.cjs.js +10 -10
- package/lib/index.d.ts +1 -0
- package/lib/index.es.js +530 -117
- package/lib/row-list-auto-layout/RowListAutoLayout.css.d.ts +8 -0
- package/lib/row-list-auto-layout/RowListAutoLayout.d.ts +5 -0
- package/lib/style.css +1 -1
- package/package.json +11 -11
@@ -1,4 +1,6 @@
|
|
1
1
|
export declare const expandedVar: any;
|
2
|
+
export declare const expandedBorderRadiusVar: any;
|
3
|
+
export declare const selectedBordersVar: any;
|
2
4
|
export declare const contentRow: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
3
5
|
expanded: {
|
4
6
|
true: {
|
@@ -14,6 +16,13 @@ export declare const contentRow: import("@vanilla-extract/recipes/dist/declarati
|
|
14
16
|
};
|
15
17
|
}>;
|
16
18
|
export declare const contentRowColGroup: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
19
|
+
cardSpacing: {
|
20
|
+
true: {
|
21
|
+
borderRadius: string;
|
22
|
+
marginTop: string;
|
23
|
+
};
|
24
|
+
false: {};
|
25
|
+
};
|
17
26
|
expanded: {
|
18
27
|
true: {
|
19
28
|
borderTopLeftRadius: string;
|
@@ -30,14 +39,35 @@ export declare const contentRowColGroup: import("@vanilla-extract/recipes/dist/d
|
|
30
39
|
};
|
31
40
|
false: {};
|
32
41
|
};
|
33
|
-
|
42
|
+
}>;
|
43
|
+
export declare const contentTableRow: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
44
|
+
selected: {
|
34
45
|
true: {
|
35
|
-
|
36
|
-
|
46
|
+
background: string;
|
47
|
+
vars: {
|
48
|
+
[x: number]: string;
|
49
|
+
};
|
50
|
+
};
|
51
|
+
false: {
|
52
|
+
vars: {
|
53
|
+
[x: number]: string;
|
54
|
+
};
|
55
|
+
};
|
56
|
+
};
|
57
|
+
expanded: {
|
58
|
+
true: {
|
59
|
+
vars: {
|
60
|
+
[x: number]: string;
|
61
|
+
};
|
62
|
+
};
|
63
|
+
false: {
|
64
|
+
vars: {
|
65
|
+
[x: number]: string;
|
66
|
+
};
|
37
67
|
};
|
38
|
-
false: {};
|
39
68
|
};
|
40
69
|
}>;
|
70
|
+
export declare const contentTableRowSpacer: string;
|
41
71
|
export declare const expandButton: string;
|
42
72
|
export declare const expandIcon: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
43
73
|
disabled: {
|
@@ -55,5 +85,14 @@ export declare const expandIcon: import("@vanilla-extract/recipes/dist/declarati
|
|
55
85
|
};
|
56
86
|
};
|
57
87
|
}>;
|
58
|
-
export declare const contentRowExpansion:
|
88
|
+
export declare const contentRowExpansion: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
89
|
+
__autoLayout: {
|
90
|
+
true: {
|
91
|
+
display: "table-cell";
|
92
|
+
};
|
93
|
+
false: {
|
94
|
+
display: any;
|
95
|
+
};
|
96
|
+
};
|
97
|
+
}>;
|
59
98
|
export declare const section: string;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
import { 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, ...rest }: ComponentProps<{
|
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, __autoLayout, ...rest }: ComponentProps<{
|
4
4
|
alternateLayout?: boolean;
|
5
5
|
initiallyExpanded?: boolean;
|
6
6
|
cardSpacing?: boolean;
|
@@ -15,4 +15,5 @@ export declare function ContentRow({ children, className, alternateLayout, initi
|
|
15
15
|
renderExpandedContent?: boolean;
|
16
16
|
disableSelection?: boolean;
|
17
17
|
disableExpansion?: boolean;
|
18
|
+
__autoLayout?: boolean;
|
18
19
|
}, HTMLDivElement>): React.ReactElement;
|
@@ -18,4 +18,33 @@ export declare const contentRowCol: import("@vanilla-extract/recipes/dist/declar
|
|
18
18
|
};
|
19
19
|
};
|
20
20
|
};
|
21
|
+
wrapContent: {
|
22
|
+
true: {
|
23
|
+
wordBreak: "break-word";
|
24
|
+
};
|
25
|
+
false: {};
|
26
|
+
};
|
27
|
+
}>;
|
28
|
+
export declare const contentRowTableCol: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
29
|
+
lean: {
|
30
|
+
true: {
|
31
|
+
paddingTop: string;
|
32
|
+
paddingRight: string;
|
33
|
+
paddingBottom: string;
|
34
|
+
paddingLeft: string;
|
35
|
+
};
|
36
|
+
false: {};
|
37
|
+
};
|
38
|
+
borderless: {
|
39
|
+
true: {
|
40
|
+
borderLeftWidth: "0";
|
41
|
+
};
|
42
|
+
false: {};
|
43
|
+
};
|
44
|
+
wrapContent: {
|
45
|
+
true: {
|
46
|
+
wordBreak: "break-word";
|
47
|
+
};
|
48
|
+
false: {};
|
49
|
+
};
|
21
50
|
}>;
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import * as React from "react";
|
2
|
-
import { ComponentProps } from "@sps-woodland/core";
|
3
|
-
export declare function ContentRowCol({ children, className, borderless, lean, widthPx, widthRem, style, ...rest }: ComponentProps<{
|
2
|
+
import type { ComponentProps } from "@sps-woodland/core";
|
3
|
+
export declare function ContentRowCol({ children, className, borderless, lean, widthPx, widthRem, style, wrapContent, __autoLayout, ...rest }: ComponentProps<{
|
4
4
|
borderless?: boolean;
|
5
5
|
lean?: boolean;
|
6
6
|
widthPx?: number;
|
7
7
|
widthRem?: number;
|
8
|
+
wrapContent?: boolean;
|
9
|
+
__autoLayout?: boolean;
|
8
10
|
}, HTMLDivElement>): React.ReactElement;
|
@@ -1,3 +1,5 @@
|
|
1
1
|
import * as React from "react";
|
2
2
|
import { ComponentProps } from "@sps-woodland/core";
|
3
|
-
export declare function ContentRowExpansion({ children, className, ...rest }: ComponentProps<
|
3
|
+
export declare function ContentRowExpansion({ children, className, __autoLayout, ...rest }: ComponentProps<{
|
4
|
+
__autoLayout?: boolean;
|
5
|
+
}, HTMLDivElement>): React.ReactElement;
|
package/lib/index.cjs.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react"),r=require("@sps-woodland/core"),q=require("@spscommerce/ds-react"),m=require("@spscommerce/utils");function G(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const o=G(W);function K(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function I(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),t.push.apply(t,n)}return t}function F(e){for(var a=1;a<arguments.length;a++){var t=arguments[a]!=null?arguments[a]:{};a%2?I(Object(t),!0).forEach(function(n){K(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):I(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var B=(e,a,t)=>{for(var n of Object.keys(e)){var s;if(e[n]!==((s=a[n])!==null&&s!==void 0?s:t[n]))return!1}return!0},p=e=>a=>{var t=e.defaultClassName,n=F(F({},e.defaultVariants),a);for(var s in n){var d,i=(d=n[s])!==null&&d!==void 0?d:e.defaultVariants[s];if(i!=null){var l=i;typeof l=="boolean"&&(l=l===!0?"true":"false");var b=e.variantClassNames[s][l];b&&(t+=" "+b)}}for(var[u,C]of e.compoundVariants)B(u,n,e.defaultVariants)&&(t+=" "+C);return t},J=p({defaultClassName:"_1mxrufv0",variantClassNames:{lean:{true:"_1mxrufv1",false:"_1mxrufv2"},borderless:{true:"_1mxrufv3",false:"_1mxrufv4"},wrapContent:{true:"_1mxrufv5",false:"_1mxrufv6"}},defaultVariants:{lean:!1,borderless:!1,wrapContent:!1},compoundVariants:[]}),Q=p({defaultClassName:"_1mxrufv7",variantClassNames:{lean:{true:"_1mxrufv8",false:"_1mxrufv9"},borderless:{true:"_1mxrufva",false:"_1mxrufvb"},wrapContent:{true:"_1mxrufvc",false:"_1mxrufvd"}},defaultVariants:{lean:!1,borderless:!1,wrapContent:!1},compoundVariants:[]});function c({children:e,className:a,borderless:t,lean:n,widthPx:s,widthRem:d,style:i,wrapContent:l=!1,__autoLayout:b=!1,...u}){const C=s?s/16:d,f=C?{...i,width:`${C}rem`}:i;return b?o.createElement("td",{className:r.cl(Q({lean:n,borderless:t,wrapContent:l}),a),...u,style:f},e):o.createElement("div",{className:r.cl(J({lean:n,borderless:t,wrapContent:l}),a),...u,style:f},e)}r.Metadata.set(c,{name:"Content Row Col",props:{borderless:{type:"boolean"},lean:{type:"boolean"},widthPx:{type:"number"},widthRem:{type:"number"},wrapContent:{type:"boolean"}}});var U=p({defaultClassName:"_11ztjee3",variantClassNames:{expanded:{true:"_11ztjee4",false:"_11ztjee5"}},defaultVariants:{expanded:!1},compoundVariants:[]}),X=p({defaultClassName:"_11ztjee6",variantClassNames:{cardSpacing:{true:"_11ztjee7",false:"_11ztjee8"},expanded:{true:"_11ztjee9",false:"_11ztjeea"},selected:{true:"_11ztjeeb",false:"_11ztjeec"}},defaultVariants:{expanded:!1,selected:!1,cardSpacing:!1},compoundVariants:[[{expanded:!0,cardSpacing:!0},"_11ztjeed"]]}),O=p({defaultClassName:"_11ztjeeo",variantClassNames:{__autoLayout:{true:"_11ztjeep",false:"_11ztjeeq"}},defaultVariants:{__autoLayout:!1},compoundVariants:[]}),Y=p({defaultClassName:"_11ztjeee",variantClassNames:{selected:{true:"_11ztjeef",false:"_11ztjeeg"},expanded:{true:"_11ztjeeh",false:"_11ztjeei"}},defaultVariants:{selected:!1,expanded:!1},compoundVariants:[]}),Z="_11ztjeej",$="_11ztjeek",ee=p({defaultClassName:"_11ztjeel",variantClassNames:{disabled:{true:"_11ztjeem",false:"_11ztjeen"}},defaultVariants:{},compoundVariants:[]}),S="_11ztjeer";function E({children:e,className:a,__autoLayout:t=!1,...n}){return t?o.createElement("tr",null,o.createElement("td",{className:r.cl(O({__autoLayout:t}),a),colSpan:100,...n},e)):o.createElement("div",{className:r.cl(O({__autoLayout:t}),a),...n},e)}r.Metadata.set(E,{name:"Content Row Expansion"});function k({children:e,className:a,alternateLayout:t=!1,initiallyExpanded:n=!1,cardSpacing:s=!1,expanded:d,onBeforeCollapsed:i,onBeforeExpanded:l,onSelectionChange:b,onCollapsed:u,onExpanded:C,selectable:f=!1,selected:v,renderExpandedContent:y=!0,disableSelection:A=!1,disableExpansion:_=!1,__autoLayout:x=!1,...M}){const[P,[R]]=r.selectChildren(e,[{type:c},{type:E}]),{t:D}=o.useContext(r.I18nContext),[j,V]=o.useState(!x&&y?y:n),[T,z]=o.useState(n),w=typeof d=="boolean"?d:T;function L(N){N.stopPropagation(),w&&(!i||i())?(z(!1),(!y||x)&&V(!1),u&&u()):!w&&(!l||l())&&(z(!0),(!y||x)&&V(!0),C&&C())}const g=()=>o.createElement(q.SpsCheckbox,{disabled:A,checked:v,onChange:b}),h=o.createElement("button",{type:"button",className:r.cl($),onClick:L,"aria-label":D(`design-system:contentRow.${w?"collapse":"expand"}`),disabled:_},o.createElement(r.Icon,{className:r.cl(ee({disabled:_})),icon:w?"minus-circle":"plus-circle"}));if(x){const N=o.createElement("tr",null,o.createElement("td",{className:r.cl(Z),colSpan:100}));return o.createElement(o.Fragment,null,o.createElement("tr",{className:r.cl(Y({selected:v,expanded:w})),...M},f&&!t&&o.createElement(c,{widthPx:46,__autoLayout:!0},o.createElement(g,null)),R&&!t&&o.createElement(c,{widthPx:44,__autoLayout:!0},h),R&&f&&t&&o.createElement(c,{widthPx:46,__autoLayout:!0},o.createElement("section",{className:S},o.createElement(g,null)),o.createElement("section",{className:S},h)),P),j&&R,N)}return o.createElement("div",{className:r.cl(U({expanded:w}),a),...M},o.createElement("div",{className:r.cl(X({expanded:w,selected:v,cardSpacing:s}))},f&&!t&&o.createElement(c,{widthPx:46},o.createElement(g,null)),R&&!t&&o.createElement(c,{widthPx:44},h),R&&f&&t&&o.createElement(c,{widthPx:46},o.createElement("section",{className:S},o.createElement(g,null)),o.createElement("section",{className:S},h)),P),j&&R)}r.Metadata.set(k,{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"}}});var te=p({defaultClassName:"_1wuky9j0",variantClassNames:{wrapContent:{true:"_1wuky9j1",false:"_1wuky9j2"}},defaultVariants:{wrapContent:!1},compoundVariants:[]});const oe=new Set(["Content Row","Content Row Col","Content Row Expansion","Sorting Header","Sorting Header Cell"]);function H({children:e,className:a,wrapContent:t=!1,...n}){const s=o.useMemo(()=>r.modChildren(e,l=>r.Metadata.isWoodlandComponent(l.type)&&oe.has(r.Metadata.get(l.type).name)?[{__autoLayout:!0}]:[{}]),[e]),[[d],i]=o.useMemo(()=>r.selectChildren(s,[{type:l=>!!(r.Metadata.isWoodlandComponent(l.type)&&r.Metadata.get(l.type).name==="Sorting Header")}]),[s]);return o.createElement("table",{className:r.cl(te({wrapContent:t}),a),...n},d?o.createElement("thead",null,d):null,o.createElement("tbody",null,i))}r.Metadata.set(H,{name:"Row List Auto Layout",props:{wrapContent:{type:"boolean",default:"false"}}});const ne={components:[k,c,E],examples:{basic:{label:"Content Rows",examples:{basic:{react:m.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:m.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:m.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:m.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:m.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:m.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:m.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:m.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,7 @@
|
|
295
295
|
</ContentRow>
|
296
296
|
)
|
297
297
|
}
|
298
|
-
`}}},sortable:{label:"Sortable Content Rows",examples:{basic:{react:
|
298
|
+
`}}},sortable:{label:"Sortable Content Rows",examples:{basic:{react:m.code`
|
299
299
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
300
300
|
import { Card } from "@sps-woodland/cards";
|
301
301
|
import { SortingHeader, SortingHeaderCell } from "@sps-woodland/sorting-header";
|
@@ -398,4 +398,4 @@
|
|
398
398
|
</>
|
399
399
|
)
|
400
400
|
}
|
401
|
-
`}}}}},
|
401
|
+
`}}}}},ae={"Content Rows":ne};exports.ContentRow=k;exports.ContentRowCol=c;exports.ContentRowExpansion=E;exports.MANIFEST=ae;exports.RowListAutoLayout=H;
|
package/lib/index.d.ts
CHANGED
package/lib/index.es.js
CHANGED
@@ -1,168 +1,193 @@
|
|
1
|
-
import * as
|
2
|
-
import { Metadata as
|
3
|
-
import { SpsCheckbox as
|
4
|
-
import { code as
|
5
|
-
function
|
6
|
-
return
|
1
|
+
import * as e from "react";
|
2
|
+
import { Metadata as p, cl as i, selectChildren as O, I18nContext as G, Icon as K, modChildren as B } from "@sps-woodland/core";
|
3
|
+
import { SpsCheckbox as q } from "@spscommerce/ds-react";
|
4
|
+
import { code as c } from "@spscommerce/utils";
|
5
|
+
function J(t, a, o) {
|
6
|
+
return a in t ? Object.defineProperty(t, a, {
|
7
7
|
value: o,
|
8
8
|
enumerable: !0,
|
9
9
|
configurable: !0,
|
10
10
|
writable: !0
|
11
|
-
}) :
|
11
|
+
}) : t[a] = o, t;
|
12
12
|
}
|
13
|
-
function
|
14
|
-
var o = Object.keys(
|
13
|
+
function I(t, a) {
|
14
|
+
var o = Object.keys(t);
|
15
15
|
if (Object.getOwnPropertySymbols) {
|
16
|
-
var
|
17
|
-
|
18
|
-
return Object.getOwnPropertyDescriptor(
|
19
|
-
})), o.push.apply(o,
|
16
|
+
var n = Object.getOwnPropertySymbols(t);
|
17
|
+
a && (n = n.filter(function(r) {
|
18
|
+
return Object.getOwnPropertyDescriptor(t, r).enumerable;
|
19
|
+
})), o.push.apply(o, n);
|
20
20
|
}
|
21
21
|
return o;
|
22
22
|
}
|
23
|
-
function
|
24
|
-
for (var
|
25
|
-
var o = arguments[
|
26
|
-
|
27
|
-
|
28
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
29
|
-
Object.defineProperty(
|
23
|
+
function F(t) {
|
24
|
+
for (var a = 1; a < arguments.length; a++) {
|
25
|
+
var o = arguments[a] != null ? arguments[a] : {};
|
26
|
+
a % 2 ? I(Object(o), !0).forEach(function(n) {
|
27
|
+
J(t, n, o[n]);
|
28
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(o)) : I(Object(o)).forEach(function(n) {
|
29
|
+
Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(o, n));
|
30
30
|
});
|
31
31
|
}
|
32
|
-
return
|
32
|
+
return t;
|
33
33
|
}
|
34
|
-
var
|
35
|
-
for (var
|
34
|
+
var Q = (t, a, o) => {
|
35
|
+
for (var n of Object.keys(t)) {
|
36
36
|
var r;
|
37
|
-
if (
|
37
|
+
if (t[n] !== ((r = a[n]) !== null && r !== void 0 ? r : o[n]))
|
38
38
|
return !1;
|
39
39
|
}
|
40
40
|
return !0;
|
41
|
-
},
|
42
|
-
var o =
|
43
|
-
for (var r in
|
44
|
-
var
|
41
|
+
}, u = (t) => (a) => {
|
42
|
+
var o = t.defaultClassName, n = F(F({}, t.defaultVariants), a);
|
43
|
+
for (var r in n) {
|
44
|
+
var l, d = (l = n[r]) !== null && l !== void 0 ? l : t.defaultVariants[r];
|
45
45
|
if (d != null) {
|
46
|
-
var
|
47
|
-
typeof
|
48
|
-
var
|
46
|
+
var s = d;
|
47
|
+
typeof s == "boolean" && (s = s === !0 ? "true" : "false");
|
48
|
+
var R = (
|
49
49
|
// @ts-expect-error
|
50
|
-
|
50
|
+
t.variantClassNames[r][s]
|
51
51
|
);
|
52
|
-
|
52
|
+
R && (o += " " + R);
|
53
53
|
}
|
54
54
|
}
|
55
|
-
for (var [
|
56
|
-
|
55
|
+
for (var [C, f] of t.compoundVariants)
|
56
|
+
Q(C, n, t.defaultVariants) && (o += " " + f);
|
57
57
|
return o;
|
58
|
-
},
|
59
|
-
function
|
60
|
-
children:
|
61
|
-
className:
|
58
|
+
}, U = u({ defaultClassName: "_1mxrufv0", variantClassNames: { lean: { true: "_1mxrufv1", false: "_1mxrufv2" }, borderless: { true: "_1mxrufv3", false: "_1mxrufv4" }, wrapContent: { true: "_1mxrufv5", false: "_1mxrufv6" } }, defaultVariants: { lean: !1, borderless: !1, wrapContent: !1 }, compoundVariants: [] }), X = u({ defaultClassName: "_1mxrufv7", variantClassNames: { lean: { true: "_1mxrufv8", false: "_1mxrufv9" }, borderless: { true: "_1mxrufva", false: "_1mxrufvb" }, wrapContent: { true: "_1mxrufvc", false: "_1mxrufvd" } }, defaultVariants: { lean: !1, borderless: !1, wrapContent: !1 }, compoundVariants: [] });
|
59
|
+
function m({
|
60
|
+
children: t,
|
61
|
+
className: a,
|
62
62
|
borderless: o,
|
63
|
-
lean:
|
63
|
+
lean: n,
|
64
64
|
widthPx: r,
|
65
|
-
widthRem:
|
65
|
+
widthRem: l,
|
66
66
|
style: d,
|
67
|
-
|
67
|
+
wrapContent: s = !1,
|
68
|
+
__autoLayout: R = !1,
|
69
|
+
...C
|
68
70
|
}) {
|
69
|
-
const
|
71
|
+
const f = r ? r / 16 : l, w = f ? {
|
70
72
|
...d,
|
71
|
-
width: `${
|
73
|
+
width: `${f}rem`
|
72
74
|
} : d;
|
73
|
-
return /* @__PURE__ */
|
75
|
+
return R ? /* @__PURE__ */ e.createElement(
|
76
|
+
"td",
|
77
|
+
{
|
78
|
+
className: i(X({ lean: n, borderless: o, wrapContent: s }), a),
|
79
|
+
...C,
|
80
|
+
style: w
|
81
|
+
},
|
82
|
+
t
|
83
|
+
) : /* @__PURE__ */ e.createElement(
|
74
84
|
"div",
|
75
85
|
{
|
76
|
-
className:
|
77
|
-
...
|
78
|
-
style:
|
86
|
+
className: i(U({ lean: n, borderless: o, wrapContent: s }), a),
|
87
|
+
...C,
|
88
|
+
style: w
|
79
89
|
},
|
80
|
-
|
90
|
+
t
|
81
91
|
);
|
82
92
|
}
|
83
|
-
|
93
|
+
p.set(m, {
|
84
94
|
name: "Content Row Col",
|
85
95
|
props: {
|
86
96
|
borderless: { type: "boolean" },
|
87
97
|
lean: { type: "boolean" },
|
88
98
|
widthPx: { type: "number" },
|
89
|
-
widthRem: { type: "number" }
|
99
|
+
widthRem: { type: "number" },
|
100
|
+
wrapContent: { type: "boolean" }
|
90
101
|
}
|
91
102
|
});
|
92
|
-
var
|
93
|
-
function
|
94
|
-
children:
|
95
|
-
className:
|
96
|
-
|
103
|
+
var Y = u({ defaultClassName: "_11ztjee3", variantClassNames: { expanded: { true: "_11ztjee4", false: "_11ztjee5" } }, defaultVariants: { expanded: !1 }, compoundVariants: [] }), Z = u({ defaultClassName: "_11ztjee6", variantClassNames: { cardSpacing: { true: "_11ztjee7", false: "_11ztjee8" }, expanded: { true: "_11ztjee9", false: "_11ztjeea" }, selected: { true: "_11ztjeeb", false: "_11ztjeec" } }, defaultVariants: { expanded: !1, selected: !1, cardSpacing: !1 }, compoundVariants: [[{ expanded: !0, cardSpacing: !0 }, "_11ztjeed"]] }), H = u({ defaultClassName: "_11ztjeeo", variantClassNames: { __autoLayout: { true: "_11ztjeep", false: "_11ztjeeq" } }, defaultVariants: { __autoLayout: !1 }, compoundVariants: [] }), $ = u({ defaultClassName: "_11ztjeee", variantClassNames: { selected: { true: "_11ztjeef", false: "_11ztjeeg" }, expanded: { true: "_11ztjeeh", false: "_11ztjeei" } }, defaultVariants: { selected: !1, expanded: !1 }, compoundVariants: [] }), ee = "_11ztjeej", te = "_11ztjeek", oe = u({ defaultClassName: "_11ztjeel", variantClassNames: { disabled: { true: "_11ztjeem", false: "_11ztjeen" } }, defaultVariants: {}, compoundVariants: [] }), S = "_11ztjeer";
|
104
|
+
function k({
|
105
|
+
children: t,
|
106
|
+
className: a,
|
107
|
+
__autoLayout: o = !1,
|
108
|
+
...n
|
97
109
|
}) {
|
98
|
-
return /* @__PURE__ */
|
110
|
+
return o ? /* @__PURE__ */ e.createElement("tr", null, /* @__PURE__ */ e.createElement(
|
111
|
+
"td",
|
112
|
+
{
|
113
|
+
className: i(H({ __autoLayout: o }), a),
|
114
|
+
colSpan: 100,
|
115
|
+
...n
|
116
|
+
},
|
117
|
+
t
|
118
|
+
)) : /* @__PURE__ */ e.createElement("div", { className: i(H({ __autoLayout: o }), a), ...n }, t);
|
99
119
|
}
|
100
|
-
|
120
|
+
p.set(k, {
|
101
121
|
name: "Content Row Expansion"
|
102
122
|
});
|
103
|
-
function
|
104
|
-
children:
|
105
|
-
className:
|
123
|
+
function A({
|
124
|
+
children: t,
|
125
|
+
className: a,
|
106
126
|
alternateLayout: o = !1,
|
107
|
-
initiallyExpanded:
|
127
|
+
initiallyExpanded: n = !1,
|
108
128
|
cardSpacing: r = !1,
|
109
|
-
expanded:
|
129
|
+
expanded: l,
|
110
130
|
onBeforeCollapsed: d,
|
111
|
-
onBeforeExpanded:
|
112
|
-
onSelectionChange:
|
113
|
-
onCollapsed:
|
114
|
-
onExpanded:
|
115
|
-
selectable:
|
116
|
-
selected:
|
117
|
-
renderExpandedContent:
|
118
|
-
disableSelection:
|
119
|
-
disableExpansion:
|
120
|
-
|
131
|
+
onBeforeExpanded: s,
|
132
|
+
onSelectionChange: R,
|
133
|
+
onCollapsed: C,
|
134
|
+
onExpanded: f,
|
135
|
+
selectable: w = !1,
|
136
|
+
selected: v,
|
137
|
+
renderExpandedContent: y = !0,
|
138
|
+
disableSelection: D = !1,
|
139
|
+
disableExpansion: _ = !1,
|
140
|
+
__autoLayout: h = !1,
|
141
|
+
...P
|
121
142
|
}) {
|
122
|
-
const [
|
123
|
-
{ type:
|
124
|
-
{ type:
|
125
|
-
]), { t:
|
126
|
-
|
127
|
-
), [
|
128
|
-
function
|
129
|
-
|
143
|
+
const [V, [x]] = O(t, [
|
144
|
+
{ type: m },
|
145
|
+
{ type: k }
|
146
|
+
]), { t: T } = e.useContext(G), [j, z] = e.useState(
|
147
|
+
!h && y ? y : n
|
148
|
+
), [L, M] = e.useState(n), b = typeof l == "boolean" ? l : L;
|
149
|
+
function W(N) {
|
150
|
+
N.stopPropagation(), b && (!d || d()) ? (M(!1), (!y || h) && z(!1), C && C()) : !b && (!s || s()) && (M(!0), (!y || h) && z(!0), f && f());
|
130
151
|
}
|
131
|
-
const
|
152
|
+
const g = () => /* @__PURE__ */ e.createElement(q, { disabled: D, checked: v, onChange: R }), E = /* @__PURE__ */ e.createElement(
|
132
153
|
"button",
|
133
154
|
{
|
134
155
|
type: "button",
|
135
|
-
className:
|
136
|
-
onClick:
|
137
|
-
"aria-label":
|
138
|
-
disabled:
|
156
|
+
className: i(te),
|
157
|
+
onClick: W,
|
158
|
+
"aria-label": T(`design-system:contentRow.${b ? "collapse" : "expand"}`),
|
159
|
+
disabled: _
|
139
160
|
},
|
140
|
-
/* @__PURE__ */
|
161
|
+
/* @__PURE__ */ e.createElement(
|
141
162
|
K,
|
142
163
|
{
|
143
|
-
className:
|
144
|
-
icon:
|
164
|
+
className: i(oe({ disabled: _ })),
|
165
|
+
icon: b ? "minus-circle" : "plus-circle"
|
145
166
|
}
|
146
167
|
)
|
147
168
|
);
|
148
|
-
|
169
|
+
if (h) {
|
170
|
+
const N = /* @__PURE__ */ e.createElement("tr", null, /* @__PURE__ */ e.createElement("td", { className: i(ee), colSpan: 100 }));
|
171
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("tr", { className: i($({ selected: v, expanded: b })), ...P }, w && !o && /* @__PURE__ */ e.createElement(m, { widthPx: 46, __autoLayout: !0 }, /* @__PURE__ */ e.createElement(g, null)), x && !o && /* @__PURE__ */ e.createElement(m, { widthPx: 44, __autoLayout: !0 }, E), x && w && o && /* @__PURE__ */ e.createElement(m, { widthPx: 46, __autoLayout: !0 }, /* @__PURE__ */ e.createElement("section", { className: S }, /* @__PURE__ */ e.createElement(g, null)), /* @__PURE__ */ e.createElement("section", { className: S }, E)), V), j && x, N);
|
172
|
+
}
|
173
|
+
return /* @__PURE__ */ e.createElement("div", { className: i(Y({ expanded: b }), a), ...P }, /* @__PURE__ */ e.createElement(
|
149
174
|
"div",
|
150
175
|
{
|
151
|
-
className:
|
152
|
-
|
153
|
-
expanded:
|
154
|
-
selected:
|
176
|
+
className: i(
|
177
|
+
Z({
|
178
|
+
expanded: b,
|
179
|
+
selected: v,
|
155
180
|
cardSpacing: r
|
156
181
|
})
|
157
182
|
)
|
158
183
|
},
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
),
|
184
|
+
w && !o && /* @__PURE__ */ e.createElement(m, { widthPx: 46 }, /* @__PURE__ */ e.createElement(g, null)),
|
185
|
+
x && !o && /* @__PURE__ */ e.createElement(m, { widthPx: 44 }, E),
|
186
|
+
x && w && o && /* @__PURE__ */ e.createElement(m, { widthPx: 46 }, /* @__PURE__ */ e.createElement("section", { className: S }, /* @__PURE__ */ e.createElement(g, null)), /* @__PURE__ */ e.createElement("section", { className: S }, E)),
|
187
|
+
V
|
188
|
+
), j && x);
|
164
189
|
}
|
165
|
-
|
190
|
+
p.set(A, {
|
166
191
|
name: "Content Row",
|
167
192
|
props: {
|
168
193
|
alternateLayout: { type: "boolean", default: "false" },
|
@@ -181,14 +206,57 @@ x.set(I, {
|
|
181
206
|
disableExpansion: { type: "boolean", default: "false" }
|
182
207
|
}
|
183
208
|
});
|
184
|
-
|
185
|
-
|
209
|
+
var ne = u({ defaultClassName: "_1wuky9j0", variantClassNames: { wrapContent: { true: "_1wuky9j1", false: "_1wuky9j2" } }, defaultVariants: { wrapContent: !1 }, compoundVariants: [] });
|
210
|
+
const ae = /* @__PURE__ */ new Set([
|
211
|
+
"Content Row",
|
212
|
+
"Content Row Col",
|
213
|
+
"Content Row Expansion",
|
214
|
+
"Sorting Header",
|
215
|
+
"Sorting Header Cell"
|
216
|
+
]);
|
217
|
+
function re({
|
218
|
+
children: t,
|
219
|
+
className: a,
|
220
|
+
wrapContent: o = !1,
|
221
|
+
...n
|
222
|
+
}) {
|
223
|
+
const r = e.useMemo(
|
224
|
+
() => (
|
225
|
+
// eslint-disable-next-line implicit-arrow-linebreak
|
226
|
+
B(t, (s) => p.isWoodlandComponent(s.type) && ae.has(p.get(s.type).name) ? [
|
227
|
+
{
|
228
|
+
__autoLayout: !0
|
229
|
+
}
|
230
|
+
] : [{}])
|
231
|
+
),
|
232
|
+
[t]
|
233
|
+
), [[l], d] = e.useMemo(
|
234
|
+
() => (
|
235
|
+
// eslint-disable-next-line implicit-arrow-linebreak
|
236
|
+
O(r, [
|
237
|
+
{
|
238
|
+
type: (s) => !!(p.isWoodlandComponent(s.type) && p.get(s.type).name === "Sorting Header")
|
239
|
+
}
|
240
|
+
])
|
241
|
+
),
|
242
|
+
[r]
|
243
|
+
);
|
244
|
+
return /* @__PURE__ */ e.createElement("table", { className: i(ne({ wrapContent: o }), a), ...n }, l ? /* @__PURE__ */ e.createElement("thead", null, l) : null, /* @__PURE__ */ e.createElement("tbody", null, d));
|
245
|
+
}
|
246
|
+
p.set(re, {
|
247
|
+
name: "Row List Auto Layout",
|
248
|
+
props: {
|
249
|
+
wrapContent: { type: "boolean", default: "false" }
|
250
|
+
}
|
251
|
+
});
|
252
|
+
const se = {
|
253
|
+
components: [A, m, k],
|
186
254
|
examples: {
|
187
255
|
basic: {
|
188
256
|
label: "Content Rows",
|
189
257
|
examples: {
|
190
258
|
basic: {
|
191
|
-
react:
|
259
|
+
react: c`
|
192
260
|
import { ContentRow, ContentRowCol } from "@sps-woodland/content-row";
|
193
261
|
import { Icon } from "@sps-woodland/core";
|
194
262
|
import { sprinkles } from "@sps-woodland/tokens";
|
@@ -209,7 +277,7 @@ const Z = {
|
|
209
277
|
`
|
210
278
|
},
|
211
279
|
withCheckbox: {
|
212
|
-
react:
|
280
|
+
react: c`
|
213
281
|
import { ContentRow, ContentRowCol } from "@sps-woodland/content-row";
|
214
282
|
import { Icon } from "@sps-woodland/core";
|
215
283
|
import { sprinkles } from "@sps-woodland/tokens";
|
@@ -242,7 +310,7 @@ const Z = {
|
|
242
310
|
`
|
243
311
|
},
|
244
312
|
withCheckboxAndFavorite: {
|
245
|
-
react:
|
313
|
+
react: c`
|
246
314
|
import { ContentRow, ContentRowCol } from "@sps-woodland/content-row";
|
247
315
|
import { Icon } from "@sps-woodland/core";
|
248
316
|
import { sprinkles } from "@sps-woodland/tokens";
|
@@ -283,7 +351,7 @@ const Z = {
|
|
283
351
|
label: "Expandable Content Rows",
|
284
352
|
examples: {
|
285
353
|
basic: {
|
286
|
-
react:
|
354
|
+
react: c`
|
287
355
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
288
356
|
import { Card } from "@sps-woodland/cards";
|
289
357
|
import { Icon } from "@sps-woodland/core";
|
@@ -318,7 +386,7 @@ const Z = {
|
|
318
386
|
`
|
319
387
|
},
|
320
388
|
expandableWithCheckbox: {
|
321
|
-
react:
|
389
|
+
react: c`
|
322
390
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
323
391
|
import { Card } from "@sps-woodland/cards";
|
324
392
|
import { Icon } from "@sps-woodland/core";
|
@@ -365,7 +433,7 @@ const Z = {
|
|
365
433
|
`
|
366
434
|
},
|
367
435
|
expandableWithCheckboxAlternate: {
|
368
|
-
react:
|
436
|
+
react: c`
|
369
437
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
370
438
|
import { Card } from "@sps-woodland/cards";
|
371
439
|
import { Icon } from "@sps-woodland/core";
|
@@ -413,7 +481,7 @@ const Z = {
|
|
413
481
|
`
|
414
482
|
},
|
415
483
|
expandableWithCheckboxAndFavorite: {
|
416
|
-
react:
|
484
|
+
react: c`
|
417
485
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
418
486
|
import { Card } from "@sps-woodland/cards";
|
419
487
|
import { Icon } from "@sps-woodland/core";
|
@@ -463,7 +531,7 @@ const Z = {
|
|
463
531
|
`
|
464
532
|
},
|
465
533
|
expandableWithCheckboxAndFavoriteAlternate: {
|
466
|
-
react:
|
534
|
+
react: c`
|
467
535
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
468
536
|
import { Card } from "@sps-woodland/cards";
|
469
537
|
import { Icon } from "@sps-woodland/core";
|
@@ -519,7 +587,7 @@ const Z = {
|
|
519
587
|
label: "Sortable Content Rows",
|
520
588
|
examples: {
|
521
589
|
basic: {
|
522
|
-
react:
|
590
|
+
react: c`
|
523
591
|
import { ContentRow, ContentRowCol, ContentRowExpansion } from "@sps-woodland/content-row";
|
524
592
|
import { Card } from "@sps-woodland/cards";
|
525
593
|
import { SortingHeader, SortingHeaderCell } from "@sps-woodland/sorting-header";
|
@@ -626,13 +694,358 @@ const Z = {
|
|
626
694
|
}
|
627
695
|
}
|
628
696
|
}
|
697
|
+
// autoLayout: {
|
698
|
+
// label: "Auto Layout Content Rows",
|
699
|
+
// description: "Content rows with uniform column widths that automatically adjust based on their content (by leveraging a table layout).",
|
700
|
+
// examples: {
|
701
|
+
// basic: {
|
702
|
+
// description: "Basic example with simple content",
|
703
|
+
// react: code`
|
704
|
+
// import { ContentRow, ContentRowCol, ContentRowExpansion, RowListAutoLayout } from "@sps-woodland/content-row";
|
705
|
+
// import { Card } from "@sps-woodland/cards";
|
706
|
+
// import { SortingHeader, SortingHeaderCell } from "@sps-woodland/sorting-header";
|
707
|
+
// import { grid } from "@sps-woodland/tokens";
|
708
|
+
// function Component() {
|
709
|
+
// const [pinSortingHeader, setPinSortingHeader] = React.useState(false);
|
710
|
+
// const [sort, setSort] = React.useState([{ key: 'id', direction: SortDirection.DESCENDING }]);
|
711
|
+
// const { formValue, formMeta, updateForm } = useSpsForm({
|
712
|
+
// selected: null
|
713
|
+
// });
|
714
|
+
// function selectRow(id) {
|
715
|
+
// updateForm({ selected: formValue.selected !== id ? id : null });
|
716
|
+
// }
|
717
|
+
// const items = React.useMemo(() => [
|
718
|
+
// {
|
719
|
+
// id: '9712323',
|
720
|
+
// type: '850',
|
721
|
+
// status: 'processing',
|
722
|
+
// timestamp: 'July 21, 2021 @ 4:40 PM'
|
723
|
+
// },
|
724
|
+
// {
|
725
|
+
// id: '8712378',
|
726
|
+
// type: '810',
|
727
|
+
// status: 'success',
|
728
|
+
// timestamp: 'May 24, 2021 @ 4:39 PM'
|
729
|
+
// },
|
730
|
+
// {
|
731
|
+
// id: '8912389',
|
732
|
+
// type: '850',
|
733
|
+
// status: 'success',
|
734
|
+
// timestamp: 'May 23, 2021 @ 4:38 PM'
|
735
|
+
// }
|
736
|
+
// ].sort((a, b) => {
|
737
|
+
// if (!sort.length) {
|
738
|
+
// return 0;
|
739
|
+
// }
|
740
|
+
// const [{ key, direction }] = sort;
|
741
|
+
// if (a[key] < b[key]) {
|
742
|
+
// return direction === SortDirection.ASCENDING ? -1 : 1;
|
743
|
+
// } else if (a[key] > b[key]) {
|
744
|
+
// return direction === SortDirection.ASCENDING ? 1 : -1;
|
745
|
+
// } else {
|
746
|
+
// return 0;
|
747
|
+
// }
|
748
|
+
// }), [sort]);
|
749
|
+
// return (
|
750
|
+
// <>
|
751
|
+
// <SpsToggle label="Pin the Sorting Header" onChange={() => { setPinSortingHeader(!pinSortingHeader); }}/>
|
752
|
+
// <RowListAutoLayout>
|
753
|
+
// <SortingHeader pinSortingHeader={pinSortingHeader} sort={sort} onSortChange={setSort} className={grid[12]}>
|
754
|
+
// <SortingHeaderCell sortDisabled widthRem={2.9} />
|
755
|
+
// <SortingHeaderCell sortDisabled widthRem={2.9} />
|
756
|
+
// <SortingHeaderCell sortKey='id'>ID</SortingHeaderCell>
|
757
|
+
// <SortingHeaderCell sortKey='type'>Type</SortingHeaderCell>
|
758
|
+
// <SortingHeaderCell sortKey='timestamp' widthPx={150}>Timestamp</SortingHeaderCell>
|
759
|
+
// </SortingHeader>
|
760
|
+
// {items.map(item => {
|
761
|
+
// return (
|
762
|
+
// <ContentRow
|
763
|
+
// key={item.id}
|
764
|
+
// selectable
|
765
|
+
// selected={formValue.selected === item.id}
|
766
|
+
// onSelectionChange={() => selectRow(item.id)}
|
767
|
+
// className={grid[12]}
|
768
|
+
// >
|
769
|
+
// <ContentRowCol>
|
770
|
+
// {item.status === 'processing' && <Icon className={sprinkles({ mr: "sm" })} icon="status-in-process" size="lg" color="purple-medium" />}
|
771
|
+
// {item.status === 'success' && <Icon className={sprinkles({ mr: "sm" })} icon="status-ok" size="lg" color="green-medium" />}
|
772
|
+
// <a href="#" className={sprinkles({ fs: "body-md" })}>{item.id}</a>
|
773
|
+
// </ContentRowCol>
|
774
|
+
// <ContentRowCol>
|
775
|
+
// <a href="#" className={sprinkles({ fs: "body-md" })}>{item.type}</a>
|
776
|
+
// </ContentRowCol>
|
777
|
+
// <ContentRowCol widthPx={150}>
|
778
|
+
// {item.timestamp}
|
779
|
+
// </ContentRowCol>
|
780
|
+
// <ContentRowExpansion>
|
781
|
+
// <Card>
|
782
|
+
// <br />
|
783
|
+
// <br />
|
784
|
+
// <br />
|
785
|
+
// <br />
|
786
|
+
// Additional content
|
787
|
+
// <br />
|
788
|
+
// <br />
|
789
|
+
// <br />
|
790
|
+
// <br />
|
791
|
+
// </Card>
|
792
|
+
// </ContentRowExpansion>
|
793
|
+
// </ContentRow>
|
794
|
+
// );
|
795
|
+
// })}
|
796
|
+
// </RowListAutoLayout>
|
797
|
+
// </>
|
798
|
+
// )
|
799
|
+
// }
|
800
|
+
// `,
|
801
|
+
// },
|
802
|
+
// wrappingCells: {
|
803
|
+
// description: "With wrapping cells when the content is really long",
|
804
|
+
// react: code`
|
805
|
+
// import { ContentRow, ContentRowCol, ContentRowExpansion, RowListAutoLayout } from "@sps-woodland/content-row";
|
806
|
+
// import { Card } from "@sps-woodland/cards";
|
807
|
+
// import { SortingHeader, SortingHeaderCell } from "@sps-woodland/sorting-header";
|
808
|
+
// import { grid } from "@sps-woodland/tokens";
|
809
|
+
// function Component() {
|
810
|
+
// const [pinSortingHeader, setPinSortingHeader] = React.useState(false);
|
811
|
+
// const [sort, setSort] = React.useState([{ key: 'id', direction: SortDirection.DESCENDING }]);
|
812
|
+
// const { formValue, formMeta, updateForm } = useSpsForm({
|
813
|
+
// selected: null
|
814
|
+
// });
|
815
|
+
// function selectRow(id) {
|
816
|
+
// updateForm({ selected: formValue.selected !== id ? id : null });
|
817
|
+
// }
|
818
|
+
// const items = React.useMemo(() => [
|
819
|
+
// {
|
820
|
+
// id: '9712323',
|
821
|
+
// type: '850',
|
822
|
+
// name: "Simple name",
|
823
|
+
// status: 'processing',
|
824
|
+
// timestamp: 'July 21, 2021 @ 4:40 PM'
|
825
|
+
// },
|
826
|
+
// {
|
827
|
+
// id: '8712378',
|
828
|
+
// type: '810',
|
829
|
+
// name: "Simple name",
|
830
|
+
// status: 'success',
|
831
|
+
// timestamp: 'May 24, 2021 @ 4:39 PM'
|
832
|
+
// },
|
833
|
+
// {
|
834
|
+
// id: '8912389',
|
835
|
+
// type: '850',
|
836
|
+
// name: "This is a really long name that should wrap",
|
837
|
+
// status: 'success',
|
838
|
+
// timestamp: 'May 23, 2021 @ 4:38 PM'
|
839
|
+
// },
|
840
|
+
// {
|
841
|
+
// id: '91284128412877128732187321887312783127831',
|
842
|
+
// type: '850',
|
843
|
+
// name: "This is a really long name that should wrap",
|
844
|
+
// status: 'processing',
|
845
|
+
// timestamp: 'July 21, 2021 @ 4:40 PM'
|
846
|
+
// },
|
847
|
+
// {
|
848
|
+
// id: '91283891489123891289312893891238912',
|
849
|
+
// type: '810',
|
850
|
+
// name: "Simple name",
|
851
|
+
// status: 'success',
|
852
|
+
// timestamp: 'May 24, 2021 @ 4:39 PM'
|
853
|
+
// },
|
854
|
+
// {
|
855
|
+
// id: '8128731782378127841782348123412',
|
856
|
+
// type: '850',
|
857
|
+
// name: "Simple name",
|
858
|
+
// status: 'success',
|
859
|
+
// timestamp: 'May 23, 2021 @ 4:38 PM'
|
860
|
+
// }
|
861
|
+
// ].sort((a, b) => {
|
862
|
+
// if (!sort.length) {
|
863
|
+
// return 0;
|
864
|
+
// }
|
865
|
+
// const [{ key, direction }] = sort;
|
866
|
+
// if (a[key] < b[key]) {
|
867
|
+
// return direction === SortDirection.ASCENDING ? -1 : 1;
|
868
|
+
// } else if (a[key] > b[key]) {
|
869
|
+
// return direction === SortDirection.ASCENDING ? 1 : -1;
|
870
|
+
// } else {
|
871
|
+
// return 0;
|
872
|
+
// }
|
873
|
+
// }), [sort]);
|
874
|
+
// return (
|
875
|
+
// <>
|
876
|
+
// <SpsToggle label="Pin the Sorting Header" onChange={() => { setPinSortingHeader(!pinSortingHeader); }}/>
|
877
|
+
// <RowListAutoLayout>
|
878
|
+
// <SortingHeader pinSortingHeader={pinSortingHeader} sort={sort} onSortChange={setSort} className={grid[12]}>
|
879
|
+
// <SortingHeaderCell sortDisabled widthRem={2.9} />
|
880
|
+
// <SortingHeaderCell sortDisabled widthRem={2.9} />
|
881
|
+
// <SortingHeaderCell sortKey='id'>ID</SortingHeaderCell>
|
882
|
+
// <SortingHeaderCell sortKey='name'>Name</SortingHeaderCell>
|
883
|
+
// <SortingHeaderCell sortKey='type'>Type</SortingHeaderCell>
|
884
|
+
// <SortingHeaderCell sortKey='timestamp' widthPx={150}>Timestamp</SortingHeaderCell>
|
885
|
+
// </SortingHeader>
|
886
|
+
// {items.map(item => {
|
887
|
+
// return (
|
888
|
+
// <ContentRow
|
889
|
+
// key={item.id}
|
890
|
+
// selectable
|
891
|
+
// selected={formValue.selected === item.id}
|
892
|
+
// onSelectionChange={() => selectRow(item.id)}
|
893
|
+
// className={grid[12]}
|
894
|
+
// >
|
895
|
+
// <ContentRowCol wrapContent>
|
896
|
+
// {item.status === 'processing' && <Icon className={sprinkles({ mr: "sm" })} icon="status-in-process" size="lg" color="purple-medium" />}
|
897
|
+
// {item.status === 'success' && <Icon className={sprinkles({ mr: "sm" })} icon="status-ok" size="lg" color="green-medium" />}
|
898
|
+
// <a href="#" className={sprinkles({ fs: "body-md" })}>{item.id}</a>
|
899
|
+
// </ContentRowCol>
|
900
|
+
// <ContentRowCol wrapContent>
|
901
|
+
// {item.name}
|
902
|
+
// </ContentRowCol>
|
903
|
+
// <ContentRowCol>
|
904
|
+
// <a href="#" className={sprinkles({ fs: "body-md" })}>{item.type}</a>
|
905
|
+
// </ContentRowCol>
|
906
|
+
// <ContentRowCol widthPx={150}>
|
907
|
+
// {item.timestamp}
|
908
|
+
// </ContentRowCol>
|
909
|
+
// <ContentRowExpansion>
|
910
|
+
// <Card>
|
911
|
+
// <br />
|
912
|
+
// <br />
|
913
|
+
// <br />
|
914
|
+
// <br />
|
915
|
+
// Additional content
|
916
|
+
// <br />
|
917
|
+
// <br />
|
918
|
+
// <br />
|
919
|
+
// <br />
|
920
|
+
// </Card>
|
921
|
+
// </ContentRowExpansion>
|
922
|
+
// </ContentRow>
|
923
|
+
// );
|
924
|
+
// })}
|
925
|
+
// </RowListAutoLayout>
|
926
|
+
// </>
|
927
|
+
// )
|
928
|
+
// }
|
929
|
+
// `,
|
930
|
+
// },
|
931
|
+
// alternateLayout: {
|
932
|
+
// description: "With alternate layout",
|
933
|
+
// react: code`
|
934
|
+
// import { ContentRow, ContentRowCol, ContentRowExpansion, RowListAutoLayout } from "@sps-woodland/content-row";
|
935
|
+
// import { Card } from "@sps-woodland/cards";
|
936
|
+
// import { SortingHeader, SortingHeaderCell } from "@sps-woodland/sorting-header";
|
937
|
+
// import { grid } from "@sps-woodland/tokens";
|
938
|
+
// function Component() {
|
939
|
+
// const [pinSortingHeader, setPinSortingHeader] = React.useState(false);
|
940
|
+
// const [sort, setSort] = React.useState([{ key: 'id', direction: SortDirection.DESCENDING }]);
|
941
|
+
// const { formValue, formMeta, updateForm } = useSpsForm({
|
942
|
+
// selected: null
|
943
|
+
// });
|
944
|
+
// function selectRow(id) {
|
945
|
+
// updateForm({ selected: formValue.selected !== id ? id : null });
|
946
|
+
// }
|
947
|
+
// const items = React.useMemo(() => [
|
948
|
+
// {
|
949
|
+
// id: '9712323',
|
950
|
+
// type: '850',
|
951
|
+
// name: "Simple name",
|
952
|
+
// status: 'processing',
|
953
|
+
// timestamp: 'July 21, 2021 @ 4:40 PM'
|
954
|
+
// },
|
955
|
+
// {
|
956
|
+
// id: '8712378',
|
957
|
+
// type: '810',
|
958
|
+
// name: "Simple name",
|
959
|
+
// status: 'success',
|
960
|
+
// timestamp: 'May 24, 2021 @ 4:39 PM'
|
961
|
+
// },
|
962
|
+
// {
|
963
|
+
// id: '8912389',
|
964
|
+
// type: '850',
|
965
|
+
// name: "This is a really long name that should wrap if there isn't enough space",
|
966
|
+
// status: 'success',
|
967
|
+
// timestamp: 'May 23, 2021 @ 4:38 PM'
|
968
|
+
// },
|
969
|
+
// ].sort((a, b) => {
|
970
|
+
// if (!sort.length) {
|
971
|
+
// return 0;
|
972
|
+
// }
|
973
|
+
// const [{ key, direction }] = sort;
|
974
|
+
// if (a[key] < b[key]) {
|
975
|
+
// return direction === SortDirection.ASCENDING ? -1 : 1;
|
976
|
+
// } else if (a[key] > b[key]) {
|
977
|
+
// return direction === SortDirection.ASCENDING ? 1 : -1;
|
978
|
+
// } else {
|
979
|
+
// return 0;
|
980
|
+
// }
|
981
|
+
// }), [sort]);
|
982
|
+
// return (
|
983
|
+
// <>
|
984
|
+
// <SpsToggle label="Pin the Sorting Header" onChange={() => { setPinSortingHeader(!pinSortingHeader); }}/>
|
985
|
+
// <RowListAutoLayout>
|
986
|
+
// <SortingHeader pinSortingHeader={pinSortingHeader} sort={sort} onSortChange={setSort} className={grid[12]}>
|
987
|
+
// <SortingHeaderCell sortDisabled widthRem={2.9} />
|
988
|
+
// <SortingHeaderCell sortKey='id'>ID</SortingHeaderCell>
|
989
|
+
// <SortingHeaderCell sortKey='name'>Name</SortingHeaderCell>
|
990
|
+
// <SortingHeaderCell sortKey='type'>Type</SortingHeaderCell>
|
991
|
+
// <SortingHeaderCell sortKey='timestamp' widthPx={150}>Timestamp</SortingHeaderCell>
|
992
|
+
// </SortingHeader>
|
993
|
+
// {items.map(item => {
|
994
|
+
// return (
|
995
|
+
// <ContentRow
|
996
|
+
// key={item.id}
|
997
|
+
// selectable
|
998
|
+
// selected={formValue.selected === item.id}
|
999
|
+
// onSelectionChange={() => selectRow(item.id)}
|
1000
|
+
// className={grid[12]}
|
1001
|
+
// alternateLayout
|
1002
|
+
// >
|
1003
|
+
// <ContentRowCol wrapContent>
|
1004
|
+
// {item.status === 'processing' && <Icon className={sprinkles({ mr: "sm" })} icon="status-in-process" size="lg" color="purple-medium" />}
|
1005
|
+
// {item.status === 'success' && <Icon className={sprinkles({ mr: "sm" })} icon="status-ok" size="lg" color="green-medium" />}
|
1006
|
+
// <a href="#" className={sprinkles({ fs: "body-md" })}>{item.id}</a>
|
1007
|
+
// </ContentRowCol>
|
1008
|
+
// <ContentRowCol wrapContent>
|
1009
|
+
// {item.name}
|
1010
|
+
// </ContentRowCol>
|
1011
|
+
// <ContentRowCol>
|
1012
|
+
// <a href="#" className={sprinkles({ fs: "body-md" })}>{item.type}</a>
|
1013
|
+
// </ContentRowCol>
|
1014
|
+
// <ContentRowCol widthPx={150}>
|
1015
|
+
// {item.timestamp}
|
1016
|
+
// </ContentRowCol>
|
1017
|
+
// <ContentRowExpansion>
|
1018
|
+
// <Card>
|
1019
|
+
// <br />
|
1020
|
+
// <br />
|
1021
|
+
// <br />
|
1022
|
+
// <br />
|
1023
|
+
// Additional content
|
1024
|
+
// <br />
|
1025
|
+
// <br />
|
1026
|
+
// <br />
|
1027
|
+
// <br />
|
1028
|
+
// </Card>
|
1029
|
+
// </ContentRowExpansion>
|
1030
|
+
// </ContentRow>
|
1031
|
+
// );
|
1032
|
+
// })}
|
1033
|
+
// </RowListAutoLayout>
|
1034
|
+
// </>
|
1035
|
+
// )
|
1036
|
+
// }
|
1037
|
+
// `,
|
1038
|
+
// },
|
1039
|
+
// },
|
1040
|
+
// },
|
629
1041
|
}
|
630
|
-
},
|
631
|
-
"Content Rows":
|
1042
|
+
}, ce = {
|
1043
|
+
"Content Rows": se
|
632
1044
|
};
|
633
1045
|
export {
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
1046
|
+
A as ContentRow,
|
1047
|
+
m as ContentRowCol,
|
1048
|
+
k as ContentRowExpansion,
|
1049
|
+
ce as MANIFEST,
|
1050
|
+
re as RowListAutoLayout
|
638
1051
|
};
|
package/lib/style.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
.
|
1
|
+
._11ztjee3{background:#fff;display:block}._11ztjee4{--_11ztjee0: block}._11ztjee5{--_11ztjee0: none}._11ztjee6{display:table;table-layout:fixed;width:100.06%;border-width:.0625rem;border-style:solid;border-color:#d2d4d4;border-radius:.25rem}._11ztjee7{border-radius:.25rem;margin-top:1rem}._11ztjee9{border-top-left-radius:.25rem;border-top-right-radius:.25rem;border-bottom-right-radius:0;border-bottom-left-radius:0}._11ztjeeb{background:#e6f2f8;border-color:#027db8}._11ztjeed{border-top-left-radius:.25rem;border-top-right-radius:.25rem;border-bottom-right-radius:0;border-bottom-left-radius:0}._11ztjeee{background:#fff}._11ztjeef{--_11ztjee2: oklch(56.21% .128 239.83);background:#e6f2f8}._11ztjeeg{--_11ztjee2: oklch(86.84% .002 197.12)}._11ztjeeh{--_11ztjee1: 0}._11ztjeei{--_11ztjee1: .25rem}._11ztjeej{height:1rem;background:transparent;border:0}._11ztjeek{background:none;border:0;padding:0}._11ztjeel{cursor:pointer;font-size:1rem;line-height:1.125rem;padding:0;vertical-align:middle}._11ztjeem{color:#d2d4d4;cursor:not-allowed}._11ztjeen{color:#027db8}._11ztjeen:hover{color:#08638d}._11ztjeeo{display:var(--_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}._11ztjeep{display:table-cell}._11ztjeeq{display:var(--_11ztjee0)}._11ztjeer{padding:1rem}._11ztjeer:first-child{margin:-1rem -1rem 0}._11ztjeer: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}._1mxrufv0{display:table-cell;padding:1rem;vertical-align:middle}._1mxrufv1{padding:.5rem 1rem}._1mxrufv4:not(:first-child){border-left:.0625rem solid oklch(86.84% .002 197.12)}._1mxrufv5{word-break:break-word}._1mxrufv7{padding:1rem;vertical-align:middle;border-style:solid;border-color:var(--_11ztjee2);border-top-width:.0625rem;border-bottom-width:.0625rem;border-left-width:.0625rem;border-right-width:0;text-align:left}._1mxrufv7:first-child{border-top-left-radius:.25rem;border-bottom-left-radius:var(--_11ztjee1)}._1mxrufv7:last-child{border-right-width:.0625rem;border-top-right-radius:.25rem;border-bottom-right-radius:var(--_11ztjee1)}._1mxrufv8{padding:.5rem 1rem}._1mxrufva{border-left-width:0}._1mxrufvc{word-break:break-word}._1mxrufv0>*{vertical-align:middle}._1wuky9j0{table-layout:auto;width:100%;border-collapse:separate;border-spacing:0;white-space:normal;overflow:hidden}._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.8.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,11 +30,11 @@
|
|
30
30
|
"@spscommerce/utils": "^6.12.1",
|
31
31
|
"react": "^16.14.0",
|
32
32
|
"react-dom": "^16.14.0",
|
33
|
-
"@sps-woodland/core": "8.
|
34
|
-
"@sps-woodland/tokens": "8.
|
35
|
-
"@spscommerce/ds-colors": "8.
|
36
|
-
"@spscommerce/ds-react": "8.
|
37
|
-
"@spscommerce/ds-shared": "8.
|
33
|
+
"@sps-woodland/core": "8.8.0",
|
34
|
+
"@sps-woodland/tokens": "8.8.0",
|
35
|
+
"@spscommerce/ds-colors": "8.8.0",
|
36
|
+
"@spscommerce/ds-react": "8.8.0",
|
37
|
+
"@spscommerce/ds-shared": "8.8.0"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
40
|
"@spscommerce/ds-illustrations": "^6.12.1",
|
@@ -43,11 +43,11 @@
|
|
43
43
|
"@vanilla-extract/recipes": "^0.2.5",
|
44
44
|
"react": "^16.14.0",
|
45
45
|
"react-dom": "^16.14.0",
|
46
|
-
"@sps-woodland/core": "8.
|
47
|
-
"@sps-woodland/tokens": "8.
|
48
|
-
"@spscommerce/ds-colors": "8.
|
49
|
-
"@spscommerce/ds-react": "8.
|
50
|
-
"@spscommerce/ds-shared": "8.
|
46
|
+
"@sps-woodland/core": "8.8.0",
|
47
|
+
"@sps-woodland/tokens": "8.8.0",
|
48
|
+
"@spscommerce/ds-colors": "8.8.0",
|
49
|
+
"@spscommerce/ds-react": "8.8.0",
|
50
|
+
"@spscommerce/ds-shared": "8.8.0"
|
51
51
|
},
|
52
52
|
"scripts": {
|
53
53
|
"build": "pnpm run build:js && pnpm run build:types",
|