@sps-woodland/key-value-set 8.50.2 → 8.51.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/README.md CHANGED
@@ -1,3 +1,27 @@
1
1
  ## [@sps-woodland/key-value-set](https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/key-value-set#readme)
2
2
 
3
- SPS Woodland Design System key value set component
3
+ SPS Woodland Design System key value set component.
4
+
5
+ > **Heads up — this is a wrapper package.** The component source now lives in
6
+ > [`@sps-woodland/core`](../core). This package re-exports from core so existing
7
+ > imports keep working, but new code should prefer the core paths.
8
+
9
+ ### Preferred imports (core)
10
+
11
+ ```ts
12
+ import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/core/key-value-set";
13
+ // or, if you only need the item:
14
+ import { KeyValueSetItem } from "@sps-woodland/core/key-value-set-item";
15
+
16
+ import "@sps-woodland/core/key-value-set/style.css";
17
+ ```
18
+
19
+ `KeyValueSet` is barrel-only (the family name and the parent component share a
20
+ name). `KeyValueSetItem` additionally has its own flat subpath.
21
+
22
+ ### Legacy imports (still supported)
23
+
24
+ ```ts
25
+ import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
26
+ import "@sps-woodland/key-value-set/style.css";
27
+ ```
package/lib/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- export * from "./key-value-set/KeyValueSet";
2
- export * from "./key-value-set-item/KeyValueSetItem";
1
+ export * from "@sps-woodland/core/key-value-set";
3
2
  export * from "./manifest";
package/lib/index.js CHANGED
@@ -1,98 +1,10 @@
1
- import { Metadata as p, cl as y, useChildTestIdAttrBuilder as v } from "@sps-woodland/core";
1
+ import { KeyValueSet as a, KeyValueSetItem as n } from "@sps-woodland/core/key-value-set";
2
+ export * from "@sps-woodland/core/key-value-set";
3
+ import { code as t } from "@spscommerce/utils";
2
4
  import * as e from "react";
3
- import { code as s } from "@spscommerce/utils";
4
- function _(t, n, a) {
5
- return n in t ? Object.defineProperty(t, n, {
6
- value: a,
7
- enumerable: !0,
8
- configurable: !0,
9
- writable: !0
10
- }) : t[n] = a, t;
11
- }
12
- function c(t, n) {
13
- var a = Object.keys(t);
14
- if (Object.getOwnPropertySymbols) {
15
- var l = Object.getOwnPropertySymbols(t);
16
- n && (l = l.filter(function(r) {
17
- return Object.getOwnPropertyDescriptor(t, r).enumerable;
18
- })), a.push.apply(a, l);
19
- }
20
- return a;
21
- }
22
- function d(t) {
23
- for (var n = 1; n < arguments.length; n++) {
24
- var a = arguments[n] != null ? arguments[n] : {};
25
- n % 2 ? c(Object(a), !0).forEach(function(l) {
26
- _(t, l, a[l]);
27
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(a)) : c(Object(a)).forEach(function(l) {
28
- Object.defineProperty(t, l, Object.getOwnPropertyDescriptor(a, l));
29
- });
30
- }
31
- return t;
32
- }
33
- var E = (t, n, a) => {
34
- for (var l of Object.keys(t)) {
35
- var r;
36
- if (t[l] !== ((r = n[l]) !== null && r !== void 0 ? r : a[l]))
37
- return !1;
38
- }
39
- return !0;
40
- }, V = (t) => (n) => {
41
- var a = t.defaultClassName, l = d(d({}, t.defaultVariants), n);
42
- for (var r in l) {
43
- var o, u = (o = l[r]) !== null && o !== void 0 ? o : t.defaultVariants[r];
44
- if (u != null) {
45
- var i = u;
46
- typeof i == "boolean" && (i = i === !0 ? "true" : "false");
47
- var m = (
48
- // @ts-expect-error
49
- t.variantClassNames[r][i]
50
- );
51
- m && (a += " " + m);
52
- }
53
- }
54
- for (var [f, K] of t.compoundVariants)
55
- E(f, l, t.defaultVariants) && (a += " " + K);
56
- return a;
57
- }, b = V({ defaultClassName: "pkg_sps-woodland_key-value-set__version_8_50_2__hash_1i7enhj1", variantClassNames: { inline: { true: "pkg_sps-woodland_key-value-set__version_8_50_2__hash_1i7enhj2 pkg_sps-woodland_key-value-set__version_8_50_2__hash_1i7enhj0" } }, defaultVariants: {}, compoundVariants: [] });
58
- function S({
59
- children: t,
60
- className: n,
61
- inline: a,
62
- ...l
63
- }) {
64
- return /* @__PURE__ */ e.createElement("div", { className: y(
65
- b({ inline: a }),
66
- n
67
- ), ...l }, t);
68
- }
69
- p.set(S, {
70
- name: "KeyValueSet",
71
- props: {
72
- inline: { type: "boolean", default: "false" }
73
- }
74
- });
75
- var g = "pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj090", I = V({ defaultClassName: "pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj091", variantClassNames: { wrap: { normal: "pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj092", truncate: "pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj093" } }, defaultVariants: {}, compoundVariants: [] });
76
- function h({
77
- children: t,
78
- className: n,
79
- itemKey: a,
80
- wrap: l,
81
- ...r
82
- }) {
83
- const o = v(r), u = l === "truncate" && typeof t == "string" ? t : void 0;
84
- return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("span", { className: g, ...o("key") }, a), /* @__PURE__ */ e.createElement("span", { className: y(I({ wrap: l }), n), title: u, ...r }, t));
85
- }
86
- p.set(h, {
87
- name: "KeyValueSetItem",
88
- props: {
89
- itemKey: { type: "React.ReactNode | (() => React.ReactNode)", required: !0 },
90
- wrap: { type: "'normal' | 'truncate'" }
91
- }
92
- });
93
- const w = {
5
+ const r = {
94
6
  description: () => /* @__PURE__ */ e.createElement("p", null, "Key Value Sets consist of a title and value, or values, paired together visually. They are ideal for displaying details (a value or values) that require additional context (title)."),
95
- components: [S, h],
7
+ components: [a, n],
96
8
  examples: {
97
9
  vertical: {
98
10
  label: "Vertical Key Value Sets",
@@ -100,7 +12,7 @@ const w = {
100
12
  examples: {
101
13
  standard: {
102
14
  description: () => /* @__PURE__ */ e.createElement("h4", null, "Standard"),
103
- react: s`
15
+ react: t`
104
16
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
105
17
 
106
18
  function Component() {
@@ -116,7 +28,7 @@ const w = {
116
28
  },
117
29
  multipleValues: {
118
30
  description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h4", null, "Multiple Values"), /* @__PURE__ */ e.createElement("p", null, /* @__PURE__ */ e.createElement("b", null, "Note:"), " There is no limit to the number of values that can be listed, but extensive lists should be avoided.")),
119
- react: s`
31
+ react: t`
120
32
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
121
33
 
122
34
  function Component() {
@@ -134,7 +46,7 @@ const w = {
134
46
  },
135
47
  secondaryValues: {
136
48
  description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h5", null, "Secondary Values"), /* @__PURE__ */ e.createElement("p", null, /* @__PURE__ */ e.createElement("b", null, "Note:"), " When using a secondary value (styled in lighter grey text) the number of values listed should be limited to two (2).")),
137
- react: s`
49
+ react: t`
138
50
  import { Box } from "@sps-woodland/core";
139
51
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
140
52
 
@@ -151,8 +63,8 @@ const w = {
151
63
  `
152
64
  },
153
65
  tags: {
154
- description: ({ NavigateTo: t }) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h4", null, "Tags"), /* @__PURE__ */ e.createElement("p", null, /* @__PURE__ */ e.createElement("b", null, "Note:"), " Tags can appear inline or on individual lines as the length of content requires. Reference the ", /* @__PURE__ */ e.createElement(t, { to: "tags" }, "Tag"), " component for spacing rules.")),
155
- react: s`
66
+ description: ({ NavigateTo: l }) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h4", null, "Tags"), /* @__PURE__ */ e.createElement("p", null, /* @__PURE__ */ e.createElement("b", null, "Note:"), " Tags can appear inline or on individual lines as the length of content requires. Reference the ", /* @__PURE__ */ e.createElement(l, { to: "tags" }, "Tag"), " component for spacing rules.")),
67
+ react: t`
156
68
  import { SpsTag } from "@spscommerce/ds-react";
157
69
  import { Box } from "@sps-woodland/core";
158
70
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
@@ -173,7 +85,7 @@ const w = {
173
85
  },
174
86
  hyperlinksAndIcons: {
175
87
  description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h4", null, "Hyperlinks & Icons"), /* @__PURE__ */ e.createElement("p", null, /* @__PURE__ */ e.createElement("b", null, "Note:"), " Icons and Hyperlinks can be used independently of one another.")),
176
- react: s`
88
+ react: t`
177
89
  import { Box } from "@sps-woodland/core";
178
90
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
179
91
 
@@ -197,7 +109,7 @@ const w = {
197
109
  examples: {
198
110
  standard: {
199
111
  description: () => /* @__PURE__ */ e.createElement("h4", null, "Standard"),
200
- react: s`
112
+ react: t`
201
113
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
202
114
 
203
115
  function Component() {
@@ -213,7 +125,7 @@ const w = {
213
125
  },
214
126
  stacked: {
215
127
  description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h4", null, "Stacked"), /* @__PURE__ */ e.createElement("p", null, /* @__PURE__ */ e.createElement("b", null, "Note:"), " There is no limit to the number of stacked listings, but more than three in a single container should be avoided."), /* @__PURE__ */ e.createElement("p", null, /* @__PURE__ */ e.createElement("b", null, "Note:"), " Titles are right-aligned in the horizontal Key Value Sets to optimize scanability of the values.")),
216
- react: s`
128
+ react: t`
217
129
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
218
130
 
219
131
  function Component() {
@@ -242,7 +154,7 @@ const w = {
242
154
  },
243
155
  withLinks: {
244
156
  description: () => /* @__PURE__ */ e.createElement("h4", null, "With Links"),
245
- react: s`
157
+ react: t`
246
158
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
247
159
 
248
160
  function Component() {
@@ -269,11 +181,9 @@ const w = {
269
181
  }
270
182
  }
271
183
  }
272
- }, k = {
273
- "Key Value Sets": w
184
+ }, m = {
185
+ "Key Value Sets": r
274
186
  };
275
187
  export {
276
- S as KeyValueSet,
277
- h as KeyValueSetItem,
278
- k as MANIFEST
188
+ m as MANIFEST
279
189
  };
package/lib/index.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(s,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@sps-woodland/core"),require("react"),require("@spscommerce/utils")):typeof define=="function"&&define.amd?define(["exports","@sps-woodland/core","react","@spscommerce/utils"],o):(s=typeof globalThis<"u"?globalThis:s||self,o(s.KeyValueSet={},s.core,s.React,s.utils))})(this,(function(s,o,h,u){"use strict";function K(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,l.get?l:{enumerable:!0,get:()=>t[a]})}}return n.default=t,Object.freeze(n)}const e=K(h);function _(t,n,a){return n in t?Object.defineProperty(t,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[n]=a,t}function y(t,n){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);n&&(l=l.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),a.push.apply(a,l)}return a}function f(t){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?y(Object(a),!0).forEach(function(l){_(t,l,a[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):y(Object(a)).forEach(function(l){Object.defineProperty(t,l,Object.getOwnPropertyDescriptor(a,l))})}return t}var b=(t,n,a)=>{for(var l of Object.keys(t)){var r;if(t[l]!==((r=n[l])!==null&&r!==void 0?r:a[l]))return!1}return!0},S=t=>n=>{var a=t.defaultClassName,l=f(f({},t.defaultVariants),n);for(var r in l){var i,m=(i=l[r])!==null&&i!==void 0?i:t.defaultVariants[r];if(m!=null){var c=m;typeof c=="boolean"&&(c=c===!0?"true":"false");var V=t.variantClassNames[r][c];V&&(a+=" "+V)}}for(var[I,N]of t.compoundVariants)b(I,l,t.defaultVariants)&&(a+=" "+N);return a},v=S({defaultClassName:"pkg_sps-woodland_key-value-set__version_8_50_2__hash_1i7enhj1",variantClassNames:{inline:{true:"pkg_sps-woodland_key-value-set__version_8_50_2__hash_1i7enhj2 pkg_sps-woodland_key-value-set__version_8_50_2__hash_1i7enhj0"}},defaultVariants:{},compoundVariants:[]});function d({children:t,className:n,inline:a,...l}){return e.createElement("div",{className:o.cl(v({inline:a}),n),...l},t)}o.Metadata.set(d,{name:"KeyValueSet",props:{inline:{type:"boolean",default:"false"}}});var E="pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj090",g=S({defaultClassName:"pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj091",variantClassNames:{wrap:{normal:"pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj092",truncate:"pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj093"}},defaultVariants:{},compoundVariants:[]});function p({children:t,className:n,itemKey:a,wrap:l,...r}){const i=o.useChildTestIdAttrBuilder(r),m=l==="truncate"&&typeof t=="string"?t:void 0;return e.createElement(e.Fragment,null,e.createElement("span",{className:E,...i("key")},a),e.createElement("span",{className:o.cl(g({wrap:l}),n),title:m,...r},t))}o.Metadata.set(p,{name:"KeyValueSetItem",props:{itemKey:{type:"React.ReactNode | (() => React.ReactNode)",required:!0},wrap:{type:"'normal' | 'truncate'"}}});const w={"Key Value Sets":{description:()=>e.createElement("p",null,"Key Value Sets consist of a title and value, or values, paired together visually. They are ideal for displaying details (a value or values) that require additional context (title)."),components:[d,p],examples:{vertical:{label:"Vertical Key Value Sets",description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Use:"),e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"Vertical containers such as a side bar or general card")),e.createElement("h5",null,"Do Not Use:"),e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"In Table cells or Description Lists")),e.createElement("h5",null,"Usage Rules"),e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"Titles must be written in Title Case"),e.createElement("li",{className:"mb-2"},"Values can be written in Sentence Case or Title Case as best suits the content"),e.createElement("li",{className:"mb-2"},"Titles or Values can include hyperlinks and/or icons",e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"Icons should always appear on the left before any text content"))),e.createElement("li",{className:"mb-2"},"Values can include tags"),e.createElement("li",{className:"mb-2"},"Can include multiple values on additional lines"))),examples:{standard:{description:()=>e.createElement("h4",null,"Standard"),react:u.code`
1
+ (function(l,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@sps-woodland/core/key-value-set"),require("@spscommerce/utils"),require("react")):typeof define=="function"&&define.amd?define(["exports","@sps-woodland/core/key-value-set","@spscommerce/utils","react"],a):(l=typeof globalThis<"u"?globalThis:l||self,a(l.KeyValueSet={},l.keyValueSet,l.utils,l.React))})(this,(function(l,a,n,i){"use strict";function m(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(o,r,s.get?s:{enumerable:!0,get:()=>t[r]})}}return o.default=t,Object.freeze(o)}const e=m(i),u={"Key Value Sets":{description:()=>e.createElement("p",null,"Key Value Sets consist of a title and value, or values, paired together visually. They are ideal for displaying details (a value or values) that require additional context (title)."),components:[a.KeyValueSet,a.KeyValueSetItem],examples:{vertical:{label:"Vertical Key Value Sets",description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Use:"),e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"Vertical containers such as a side bar or general card")),e.createElement("h5",null,"Do Not Use:"),e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"In Table cells or Description Lists")),e.createElement("h5",null,"Usage Rules"),e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"Titles must be written in Title Case"),e.createElement("li",{className:"mb-2"},"Values can be written in Sentence Case or Title Case as best suits the content"),e.createElement("li",{className:"mb-2"},"Titles or Values can include hyperlinks and/or icons",e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"Icons should always appear on the left before any text content"))),e.createElement("li",{className:"mb-2"},"Values can include tags"),e.createElement("li",{className:"mb-2"},"Can include multiple values on additional lines"))),examples:{standard:{description:()=>e.createElement("h4",null,"Standard"),react:n.code`
2
2
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
3
3
 
4
4
  function Component() {
@@ -10,7 +10,7 @@
10
10
  </KeyValueSet>
11
11
  )
12
12
  }
13
- `},multipleValues:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Multiple Values"),e.createElement("p",null,e.createElement("b",null,"Note:")," There is no limit to the number of values that can be listed, but extensive lists should be avoided.")),react:u.code`
13
+ `},multipleValues:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Multiple Values"),e.createElement("p",null,e.createElement("b",null,"Note:")," There is no limit to the number of values that can be listed, but extensive lists should be avoided.")),react:n.code`
14
14
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
15
15
 
16
16
  function Component() {
@@ -24,7 +24,7 @@
24
24
  </KeyValueSet>
25
25
  )
26
26
  }
27
- `},secondaryValues:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Secondary Values"),e.createElement("p",null,e.createElement("b",null,"Note:")," When using a secondary value (styled in lighter grey text) the number of values listed should be limited to two (2).")),react:u.code`
27
+ `},secondaryValues:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Secondary Values"),e.createElement("p",null,e.createElement("b",null,"Note:")," When using a secondary value (styled in lighter grey text) the number of values listed should be limited to two (2).")),react:n.code`
28
28
  import { Box } from "@sps-woodland/core";
29
29
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
30
30
 
@@ -38,7 +38,7 @@
38
38
  </KeyValueSet>
39
39
  )
40
40
  }
41
- `},tags:{description:({NavigateTo:t})=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Tags"),e.createElement("p",null,e.createElement("b",null,"Note:")," Tags can appear inline or on individual lines as the length of content requires. Reference the ",e.createElement(t,{to:"tags"},"Tag")," component for spacing rules.")),react:u.code`
41
+ `},tags:{description:({NavigateTo:t})=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Tags"),e.createElement("p",null,e.createElement("b",null,"Note:")," Tags can appear inline or on individual lines as the length of content requires. Reference the ",e.createElement(t,{to:"tags"},"Tag")," component for spacing rules.")),react:n.code`
42
42
  import { SpsTag } from "@spscommerce/ds-react";
43
43
  import { Box } from "@sps-woodland/core";
44
44
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
@@ -55,7 +55,7 @@
55
55
  </KeyValueSet>
56
56
  )
57
57
  }
58
- `},hyperlinksAndIcons:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Hyperlinks & Icons"),e.createElement("p",null,e.createElement("b",null,"Note:")," Icons and Hyperlinks can be used independently of one another.")),react:u.code`
58
+ `},hyperlinksAndIcons:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Hyperlinks & Icons"),e.createElement("p",null,e.createElement("b",null,"Note:")," Icons and Hyperlinks can be used independently of one another.")),react:n.code`
59
59
  import { Box } from "@sps-woodland/core";
60
60
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
61
61
 
@@ -69,7 +69,7 @@
69
69
  </KeyValueSet>
70
70
  )
71
71
  }
72
- `}}},horizontal:{label:"Horizontal Key Value Sets",description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Use:"),e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"Horizontal containers such as a content row")),e.createElement("h5",null,"Do Not Use:"),e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"In Table cells or Description Lists")),e.createElement("h5",null,"Usage Rules"),e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"Titles must be written in Title Case"),e.createElement("li",{className:"mb-2"},"Values can be written in Sentence Case or Title Case as best suits the content"),e.createElement("li",{className:"mb-2"},"Titles or Values can include hyperlinks and/or icons",e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"Icons should always appear on the left before any text content"))),e.createElement("li",{className:"mb-2"},"Can be used individually or stacked on top of one another",e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"When stacking, the value lists should share a common category or theme"))))),examples:{standard:{description:()=>e.createElement("h4",null,"Standard"),react:u.code`
72
+ `}}},horizontal:{label:"Horizontal Key Value Sets",description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Use:"),e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"Horizontal containers such as a content row")),e.createElement("h5",null,"Do Not Use:"),e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"In Table cells or Description Lists")),e.createElement("h5",null,"Usage Rules"),e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"Titles must be written in Title Case"),e.createElement("li",{className:"mb-2"},"Values can be written in Sentence Case or Title Case as best suits the content"),e.createElement("li",{className:"mb-2"},"Titles or Values can include hyperlinks and/or icons",e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"Icons should always appear on the left before any text content"))),e.createElement("li",{className:"mb-2"},"Can be used individually or stacked on top of one another",e.createElement("ul",null,e.createElement("li",{className:"mb-2"},"When stacking, the value lists should share a common category or theme"))))),examples:{standard:{description:()=>e.createElement("h4",null,"Standard"),react:n.code`
73
73
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
74
74
 
75
75
  function Component() {
@@ -81,7 +81,7 @@
81
81
  </KeyValueSet>
82
82
  )
83
83
  }
84
- `},stacked:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Stacked"),e.createElement("p",null,e.createElement("b",null,"Note:")," There is no limit to the number of stacked listings, but more than three in a single container should be avoided."),e.createElement("p",null,e.createElement("b",null,"Note:")," Titles are right-aligned in the horizontal Key Value Sets to optimize scanability of the values.")),react:u.code`
84
+ `},stacked:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Stacked"),e.createElement("p",null,e.createElement("b",null,"Note:")," There is no limit to the number of stacked listings, but more than three in a single container should be avoided."),e.createElement("p",null,e.createElement("b",null,"Note:")," Titles are right-aligned in the horizontal Key Value Sets to optimize scanability of the values.")),react:n.code`
85
85
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
86
86
 
87
87
  function Component() {
@@ -106,7 +106,7 @@
106
106
  </div>
107
107
  )
108
108
  }
109
- `},withLinks:{description:()=>e.createElement("h4",null,"With Links"),react:u.code`
109
+ `},withLinks:{description:()=>e.createElement("h4",null,"With Links"),react:n.code`
110
110
  import { KeyValueSet, KeyValueSetItem } from "@sps-woodland/key-value-set";
111
111
 
112
112
  function Component() {
@@ -128,4 +128,4 @@
128
128
  </div>
129
129
  )
130
130
  }
131
- `}}}}}};s.KeyValueSet=d,s.KeyValueSetItem=p,s.MANIFEST=w,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}));
131
+ `}}}}}};l.MANIFEST=u,Object.keys(a).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(l,t)&&Object.defineProperty(l,t,{enumerable:!0,get:()=>a[t]})}),Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
package/lib/style.css CHANGED
@@ -1 +1 @@
1
- .pkg_sps-woodland_key-value-set__version_8_50_2__hash_1i7enhj0{grid-template-columns:auto auto}.pkg_sps-woodland_key-value-set__version_8_50_2__hash_1i7enhj1{column-gap:.5rem;display:inline-grid;font-size:.75rem;line-height:1.125rem;max-width:100%}.pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj090{font-weight:600;min-width:0}.pkg_sps-woodland_key-value-set__version_8_50_2__hash_1i7enhj0 .pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj090{text-align:right}.pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj091{min-width:0;overflow-wrap:break-word}.pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj092{overflow-wrap:normal}.pkg_sps-woodland_key-value-set__version_8_50_2__hash_18tyj093{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1
+ .pkg_sps-woodland_core__version_8_51_0__hash_1ovxcsc0{grid-template-columns:auto auto}.pkg_sps-woodland_core__version_8_51_0__hash_1ovxcsc1{column-gap:.5rem;display:inline-grid;font-size:.75rem;line-height:1.125rem;max-width:100%}.pkg_sps-woodland_core__version_8_51_0__hash_fm6p690{font-weight:600;min-width:0}.pkg_sps-woodland_core__version_8_51_0__hash_1ovxcsc0 .pkg_sps-woodland_core__version_8_51_0__hash_fm6p690{text-align:right}.pkg_sps-woodland_core__version_8_51_0__hash_fm6p691{min-width:0;overflow-wrap:break-word}.pkg_sps-woodland_core__version_8_51_0__hash_fm6p692{overflow-wrap:normal}.pkg_sps-woodland_core__version_8_51_0__hash_fm6p693{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sps-woodland/key-value-set",
3
3
  "description": "SPS Woodland Design System key value set component",
4
- "version": "8.50.2",
4
+ "version": "8.51.0",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/key-value-set",
@@ -17,6 +17,7 @@
17
17
  "import": "./lib/index.js",
18
18
  "default": "./lib/index.js"
19
19
  },
20
+ "./style.css": "./lib/style.css",
20
21
  "./lib/style.css": {
21
22
  "import": "./lib/style.css",
22
23
  "require": "./lib/style.css"
@@ -29,22 +30,19 @@
29
30
  "@spscommerce/utils": "^7.0.0 || ^8.0.0 || ^9.0.0",
30
31
  "react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
31
32
  "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
32
- "@sps-woodland/core": "8.50.2",
33
- "@sps-woodland/tokens": "8.50.2"
33
+ "@sps-woodland/core": "8.51.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@spscommerce/utils": "9.0.3",
37
- "@vanilla-extract/css": "1.17.4",
38
- "@vanilla-extract/recipes": "0.2.5",
39
37
  "react": "16.14.0",
40
38
  "react-dom": "16.14.0",
41
- "@sps-woodland/core": "8.50.2",
42
- "@sps-woodland/tokens": "8.50.2"
39
+ "@sps-woodland/core": "8.51.0"
43
40
  },
44
41
  "scripts": {
45
- "build": "pnpm run build:js && pnpm run build:types",
42
+ "build": "pnpm run build:js && pnpm run build:types && pnpm run build:css",
46
43
  "build:js": "vite build",
47
44
  "build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
45
+ "build:css": "cp ../core/lib/key-value-set/style.css lib/style.css 2>/dev/null || echo 'key-value-set style.css not found, skipping'",
48
46
  "watch": "vite build --watch",
49
47
  "clean": "git clean -fdX",
50
48
  "pub": "node ../../../scripts/publish-package.mjs"
package/vite.config.mjs CHANGED
@@ -1,31 +1,24 @@
1
1
  import path from "node:path";
2
- import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
3
2
  import { defineConfig } from "vite";
4
- import { getVanillaExtractPluginProps } from "../../../scripts/vanilla-extract-plugin-props.mjs";
5
3
  import pkg from "./package.json";
6
4
 
7
- const packageVersion = process.env.PREDICTED_VERSION || pkg.version;
5
+ // Key-value-set is now a wrapper package that re-exports from @sps-woodland/core.
6
+ // No vanilla-extract needed - CSS is provided by the mono-package.
7
+
8
+ const peerDeps = pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [];
8
9
 
9
10
  export default defineConfig({
10
- plugins: [
11
- vanillaExtractPlugin(
12
- getVanillaExtractPluginProps({
13
- packageName: pkg.name,
14
- packageVersion,
15
- })
16
- ),
17
- ],
18
11
  build: {
19
12
  lib: {
20
13
  entry: path.resolve(__dirname, "src/index.ts"),
21
14
  name: "KeyValueSet",
22
15
  fileName: "index",
23
- cssFileName: "style",
24
16
  },
25
17
  outDir: path.resolve(__dirname, "./lib"),
26
18
  emptyOutDir: false,
27
19
  rollupOptions: {
28
- external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
20
+ // External must match subpath imports like @sps-woodland/core/key-value-set
21
+ external: (id) => peerDeps.some((dep) => id === dep || id.startsWith(dep + "/")),
29
22
  },
30
23
  },
31
24
  });
@@ -1,6 +0,0 @@
1
- export declare const kvsInlineStyle: string;
2
- export declare const keyValueSet: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
3
- inline: {
4
- true: string[];
5
- };
6
- }>;
@@ -1,5 +0,0 @@
1
- import type { ComponentProps } from "@sps-woodland/core";
2
- import * as React from "react";
3
- export declare function KeyValueSet({ children, className, inline, ...rest }: ComponentProps<{
4
- inline?: boolean;
5
- }, HTMLDivElement>): React.ReactElement;
@@ -1,13 +0,0 @@
1
- export declare const key: string;
2
- export declare const value: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
3
- wrap: {
4
- normal: {
5
- overflowWrap: "normal";
6
- };
7
- truncate: {
8
- overflow: "hidden";
9
- textOverflow: "ellipsis";
10
- whiteSpace: "nowrap";
11
- };
12
- };
13
- }>;
@@ -1,6 +0,0 @@
1
- import type { ComponentProps } from "@sps-woodland/core";
2
- import * as React from "react";
3
- export declare function KeyValueSetItem({ children, className, itemKey, wrap, ...rest }: ComponentProps<{
4
- itemKey: React.ReactNode | (() => React.ReactNode);
5
- wrap?: "normal" | "truncate";
6
- }, HTMLSpanElement>): React.ReactElement;