@sps-woodland/tags 8.17.0 → 8.17.2
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/index.cjs.js +12 -12
- package/lib/index.es.js +100 -100
- package/lib/style.css +1 -1
- package/package.json +5 -5
- package/vite.config.mjs +11 -2
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 C=require("react"),r=require("@sps-woodland/core"),i=require("@spscommerce/utils");function N(a){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(o,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}return o.default=a,Object.freeze(o)}const l=N(C);function O(a,o,e){return o in a?Object.defineProperty(a,o,{value:e,enumerable:!0,configurable:!0,writable:!0}):a[o]=e,a}function T(a,o){var e=Object.keys(a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(a);o&&(s=s.filter(function(_){return Object.getOwnPropertyDescriptor(a,_).enumerable})),e.push.apply(e,s)}return e}function h(a){for(var o=1;o<arguments.length;o++){var e=arguments[o]!=null?arguments[o]:{};o%2?T(Object(e),!0).forEach(function(s){O(a,s,e[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(e)):T(Object(e)).forEach(function(s){Object.defineProperty(a,s,Object.getOwnPropertyDescriptor(e,s))})}return a}var S=(a,o,e)=>{for(var s of Object.keys(a)){var _;if(a[s]!==((_=o[s])!==null&&_!==void 0?_:e[s]))return!1}return!0},m=a=>o=>{var e=a.defaultClassName,s=h(h({},a.defaultVariants),o);for(var _ in s){var c,d=(c=s[_])!==null&&c!==void 0?c:a.defaultVariants[_];if(d!=null){var n=d;typeof n=="boolean"&&(n=n===!0?"true":"false");var t=a.variantClassNames[_][n];t&&(e+=" "+t)}}for(var[f,u]of a.compoundVariants)S(f,s,a.defaultVariants)&&(e+=" "+u);return e},E=m({defaultClassName:"pkg_sps-woodland_tags__version_8_17_2__hash_160drw10",variantClassNames:{kind:{blue:"pkg_sps-woodland_tags__version_8_17_2__hash_160drw11",gray:"pkg_sps-woodland_tags__version_8_17_2__hash_160drw12"},disabled:{true:"pkg_sps-woodland_tags__version_8_17_2__hash_160drw13",false:"pkg_sps-woodland_tags__version_8_17_2__hash_160drw14"}},defaultVariants:{kind:"blue",disabled:!1},compoundVariants:[]}),K="pkg_sps-woodland_tags__version_8_17_2__hash_160drw1e",x="pkg_sps-woodland_tags__version_8_17_2__hash_160drw1d",P=m({defaultClassName:"pkg_sps-woodland_tags__version_8_17_2__hash_160drw15",variantClassNames:{link:{true:"pkg_sps-woodland_tags__version_8_17_2__hash_160drw16",false:"pkg_sps-woodland_tags__version_8_17_2__hash_160drw17"},disabled:{true:"pkg_sps-woodland_tags__version_8_17_2__hash_160drw18",false:"pkg_sps-woodland_tags__version_8_17_2__hash_160drw19"},addOrRemove:{true:"pkg_sps-woodland_tags__version_8_17_2__hash_160drw1a",false:"pkg_sps-woodland_tags__version_8_17_2__hash_160drw1b"}},defaultVariants:{link:!1,disabled:!1,addOrRemove:!1},compoundVariants:[[{disabled:!1,addOrRemove:!0},"pkg_sps-woodland_tags__version_8_17_2__hash_160drw1c"]]}),j="pkg_sps-woodland_tags__version_8_17_2__hash_160drw1f";function k({children:a,className:o,onClick:e,disabled:s,href:_,target:c,kind:d,onAdd:n,onRemove:t,...f}){const u=l.Children.toArray(a).filter(g=>typeof g=="string").join("");l.useEffect(()=>{if(t&&n)throw new Error("Clickable tag should have onRemove or onAdd, not both")},[n,t]);function w(g){n?n():t&&t(),g.stopPropagation()}function y(g){g.stopPropagation(),e&&e(g)}return l.createElement("div",{className:r.cl(E({kind:d,disabled:s}),o),...f},l.createElement("span",{className:r.cl(P({link:!!_||!!e,disabled:s,addOrRemove:n||t})),onClick:y,title:u},_?l.createElement("a",{className:j,href:_,target:c},a):a),(n||t)&&!s&&l.createElement("div",{className:x,onClick:s?void 0:w,tabIndex:-1,"aria-label":n?"Add":"Remove"},l.createElement(r.Icon,{className:K,"aria-hidden":"true",icon:n?"plus-sign":"x"})))}r.Metadata.set(k,{name:"Clickable Tag",props:{disabled:{type:"boolean",default:"false"},href:{type:"string"},target:{type:"'_blank' | '_self' | '_parent' | '_top'"},kind:{type:"ClickableTagKind",default:"blue"},onAdd:{type:"() => void"},onRemove:{type:"() => void"}}});var F=m({defaultClassName:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi0",variantClassNames:{kind:{default:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi1",key:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi2",warning:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi3",error:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi4",pending:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi5",success:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi6",info:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi7"}},defaultVariants:{kind:"default"},compoundVariants:[]}),V=m({defaultClassName:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi8",variantClassNames:{kind:{default:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi9",key:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efia",warning:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efib",error:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efic",pending:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efid",success:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efie",info:"pkg_sps-woodland_tags__version_8_17_2__hash_5f3efif"}},defaultVariants:{kind:"default"},compoundVariants:[]});const v=Object.freeze({default:"info-circle",key:"info-circle",warning:"status-warning",error:"status-error",pending:"status-in-process",success:"status-ok",info:"info-circle"});function p({children:a,className:o,kind:e="default",icon:s,..._}){return l.createElement("span",{className:r.cl(F({kind:e}),o),..._},s&&l.createElement(r.Icon,{className:r.cl(V({kind:e})),icon:v[e]}),a)}r.Metadata.set(p,{name:"Tag",props:{kind:{type:"TagKind",default:"default"},icon:{type:"boolean",default:"false"}}});var I="pkg_sps-woodland_tags__version_8_17_2__hash_79ofse0",D="pkg_sps-woodland_tags__version_8_17_2__hash_79ofse1",R="pkg_sps-woodland_tags__version_8_17_2__hash_79ofse2",L="pkg_sps-woodland_tags__version_8_17_2__hash_79ofsed",M=m({defaultClassName:"pkg_sps-woodland_tags__version_8_17_2__hash_79ofse3",variantClassNames:{href:{true:"pkg_sps-woodland_tags__version_8_17_2__hash_79ofse4",false:"pkg_sps-woodland_tags__version_8_17_2__hash_79ofse5"},kind:{default:"pkg_sps-woodland_tags__version_8_17_2__hash_79ofse6",key:"pkg_sps-woodland_tags__version_8_17_2__hash_79ofse7",warning:"pkg_sps-woodland_tags__version_8_17_2__hash_79ofse8",error:"pkg_sps-woodland_tags__version_8_17_2__hash_79ofse9",pending:"pkg_sps-woodland_tags__version_8_17_2__hash_79ofsea",success:"pkg_sps-woodland_tags__version_8_17_2__hash_79ofseb",info:"pkg_sps-woodland_tags__version_8_17_2__hash_79ofsec"}},defaultVariants:{href:!1,kind:"default"},compoundVariants:[]});function b({children:a,className:o,color:e="default",href:s,target:_,icon:c,tagKey:d,value:n,...t}){return l.createElement("span",{className:r.cl(I,o),...t},l.createElement(p,{className:r.cl(D),icon:c,kind:e},d&&l.createElement("span",{className:r.cl(R)},d)),l.createElement(p,{className:r.cl(M({href:!!s,kind:e}))},s?l.createElement("a",{className:L,href:s,target:_},n):n))}r.Metadata.set(b,{name:"Split Tag",props:{color:{type:"TagKind",default:"key"},href:{type:"string"},target:{type:"'_blank' | '_self' | '_parent' | '_top'"},icon:{type:"boolean",default:"false"},tagKey:{type:"string",required:!0},value:{type:"string",required:!0}}});const q={components:[k],examples:{basic:{label:"Basic Tag",examples:{basic:{react:i.code`
|
|
2
2
|
import { ClickableTag } from "@sps-woodland/tags";
|
|
3
3
|
|
|
4
4
|
function Component() {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</>
|
|
10
10
|
);
|
|
11
11
|
}
|
|
12
|
-
`},disabled:{react:
|
|
12
|
+
`},disabled:{react:i.code`
|
|
13
13
|
import { ClickableTag } from "@sps-woodland/tags";
|
|
14
14
|
|
|
15
15
|
function Component() {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
</>
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
-
`}}},button:{label:"Button",examples:{remove:{react:
|
|
22
|
+
`}}},button:{label:"Button",examples:{remove:{react:i.code`
|
|
23
23
|
import { ClickableTag } from "@sps-woodland/tags";
|
|
24
24
|
|
|
25
25
|
function Component() {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
</>
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
|
-
`},add:{react:
|
|
33
|
+
`},add:{react:i.code`
|
|
34
34
|
import { ClickableTag } from "@sps-woodland/tags";
|
|
35
35
|
|
|
36
36
|
function Component() {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
</>
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
|
-
`}}},link:{label:"Link",examples:{basic:{react:
|
|
44
|
+
`}}},link:{label:"Link",examples:{basic:{react:i.code`
|
|
45
45
|
import { ClickableTag } from "@sps-woodland/tags";
|
|
46
46
|
|
|
47
47
|
function Component() {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
</>
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
|
-
`},button:{react:
|
|
55
|
+
`},button:{react:i.code`
|
|
56
56
|
import { ClickableTag } from "@sps-woodland/tags";
|
|
57
57
|
|
|
58
58
|
function Component() {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
</>
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
|
-
`}}}}},B={components:[
|
|
66
|
+
`}}}}},B={components:[p],examples:{basic:{label:"Basic Tag",examples:{basic:{react:i.code`
|
|
67
67
|
import { Tag } from "@sps-woodland/tags";
|
|
68
68
|
|
|
69
69
|
function Component() {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
</>
|
|
80
80
|
)
|
|
81
81
|
}
|
|
82
|
-
`}}},withIcon:{label:"Tag with icon",examples:{basic:{react:
|
|
82
|
+
`}}},withIcon:{label:"Tag with icon",examples:{basic:{react:i.code`
|
|
83
83
|
import { Tag } from "@sps-woodland/tags";
|
|
84
84
|
|
|
85
85
|
function Component() {
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
</>
|
|
96
96
|
)
|
|
97
97
|
}
|
|
98
|
-
`}}}}},A={components:[
|
|
98
|
+
`}}}}},A={components:[b],examples:{basic:{label:"Basic",examples:{basic:{react:i.code`
|
|
99
99
|
import { SplitTag } from "@sps-woodland/tag";
|
|
100
100
|
|
|
101
101
|
function Component() {
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
</>
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
|
-
`}}},icon:{label:"Icon",examples:{basic:{react:
|
|
113
|
+
`}}},icon:{label:"Icon",examples:{basic:{react:i.code`
|
|
114
114
|
import { SplitTag } from "@sps-woodland/tag";
|
|
115
115
|
|
|
116
116
|
function Component() {
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
</>
|
|
126
126
|
);
|
|
127
127
|
}
|
|
128
|
-
`}}},link:{label:"Link",examples:{basic:{react:
|
|
128
|
+
`}}},link:{label:"Link",examples:{basic:{react:i.code`
|
|
129
129
|
import { SplitTag } from "@sps-woodland/tag";
|
|
130
130
|
|
|
131
131
|
function Component() {
|
|
@@ -133,4 +133,4 @@
|
|
|
133
133
|
<SplitTag tagKey="Foo" value="1234" icon href="https://www.google.com" />
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
|
-
`}}}}},W={"Clickable Tags":q,Tags:B,"Split Tags":A};exports.ClickableTag=
|
|
136
|
+
`}}}}},W={"Clickable Tags":q,Tags:B,"Split Tags":A};exports.ClickableTag=k;exports.MANIFEST=W;exports.SplitTag=b;exports.Tag=p;exports.TagIcons=v;
|
package/lib/index.es.js
CHANGED
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Metadata as
|
|
3
|
-
import { code as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { Metadata as k, cl as i, Icon as T } from "@sps-woodland/core";
|
|
3
|
+
import { code as t } from "@spscommerce/utils";
|
|
4
|
+
function N(a, _, e) {
|
|
5
|
+
return _ in a ? Object.defineProperty(a, _, {
|
|
6
6
|
value: e,
|
|
7
7
|
enumerable: !0,
|
|
8
8
|
configurable: !0,
|
|
9
9
|
writable: !0
|
|
10
|
-
}) : a[
|
|
10
|
+
}) : a[_] = e, a;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function h(a, _) {
|
|
13
13
|
var e = Object.keys(a);
|
|
14
14
|
if (Object.getOwnPropertySymbols) {
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
return Object.getOwnPropertyDescriptor(a,
|
|
18
|
-
})), e.push.apply(e,
|
|
15
|
+
var s = Object.getOwnPropertySymbols(a);
|
|
16
|
+
_ && (s = s.filter(function(o) {
|
|
17
|
+
return Object.getOwnPropertyDescriptor(a, o).enumerable;
|
|
18
|
+
})), e.push.apply(e, s);
|
|
19
19
|
}
|
|
20
20
|
return e;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
for (var
|
|
24
|
-
var e = arguments[
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(e)) :
|
|
28
|
-
Object.defineProperty(a,
|
|
22
|
+
function b(a) {
|
|
23
|
+
for (var _ = 1; _ < arguments.length; _++) {
|
|
24
|
+
var e = arguments[_] != null ? arguments[_] : {};
|
|
25
|
+
_ % 2 ? h(Object(e), !0).forEach(function(s) {
|
|
26
|
+
N(a, s, e[s]);
|
|
27
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(e)) : h(Object(e)).forEach(function(s) {
|
|
28
|
+
Object.defineProperty(a, s, Object.getOwnPropertyDescriptor(e, s));
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
return a;
|
|
32
32
|
}
|
|
33
|
-
var
|
|
34
|
-
for (var
|
|
35
|
-
var
|
|
36
|
-
if (a[
|
|
33
|
+
var O = (a, _, e) => {
|
|
34
|
+
for (var s of Object.keys(a)) {
|
|
35
|
+
var o;
|
|
36
|
+
if (a[s] !== ((o = _[s]) !== null && o !== void 0 ? o : e[s]))
|
|
37
37
|
return !1;
|
|
38
38
|
}
|
|
39
39
|
return !0;
|
|
40
|
-
},
|
|
41
|
-
var e = a.defaultClassName,
|
|
42
|
-
for (var
|
|
43
|
-
var
|
|
44
|
-
if (
|
|
45
|
-
var
|
|
46
|
-
typeof
|
|
47
|
-
var
|
|
40
|
+
}, p = (a) => (_) => {
|
|
41
|
+
var e = a.defaultClassName, s = b(b({}, a.defaultVariants), _);
|
|
42
|
+
for (var o in s) {
|
|
43
|
+
var g, d = (g = s[o]) !== null && g !== void 0 ? g : a.defaultVariants[o];
|
|
44
|
+
if (d != null) {
|
|
45
|
+
var n = d;
|
|
46
|
+
typeof n == "boolean" && (n = n === !0 ? "true" : "false");
|
|
47
|
+
var r = (
|
|
48
48
|
// @ts-expect-error
|
|
49
|
-
a.variantClassNames[
|
|
49
|
+
a.variantClassNames[o][n]
|
|
50
50
|
);
|
|
51
|
-
|
|
51
|
+
r && (e += " " + r);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
for (var [
|
|
55
|
-
|
|
54
|
+
for (var [f, u] of a.compoundVariants)
|
|
55
|
+
O(f, s, a.defaultVariants) && (e += " " + u);
|
|
56
56
|
return e;
|
|
57
|
-
},
|
|
58
|
-
function
|
|
57
|
+
}, S = p({ defaultClassName: "pkg_sps-woodland_tags__version_8_17_2__hash_160drw10", variantClassNames: { kind: { blue: "pkg_sps-woodland_tags__version_8_17_2__hash_160drw11", gray: "pkg_sps-woodland_tags__version_8_17_2__hash_160drw12" }, disabled: { true: "pkg_sps-woodland_tags__version_8_17_2__hash_160drw13", false: "pkg_sps-woodland_tags__version_8_17_2__hash_160drw14" } }, defaultVariants: { kind: "blue", disabled: !1 }, compoundVariants: [] }), E = "pkg_sps-woodland_tags__version_8_17_2__hash_160drw1e", K = "pkg_sps-woodland_tags__version_8_17_2__hash_160drw1d", x = p({ defaultClassName: "pkg_sps-woodland_tags__version_8_17_2__hash_160drw15", variantClassNames: { link: { true: "pkg_sps-woodland_tags__version_8_17_2__hash_160drw16", false: "pkg_sps-woodland_tags__version_8_17_2__hash_160drw17" }, disabled: { true: "pkg_sps-woodland_tags__version_8_17_2__hash_160drw18", false: "pkg_sps-woodland_tags__version_8_17_2__hash_160drw19" }, addOrRemove: { true: "pkg_sps-woodland_tags__version_8_17_2__hash_160drw1a", false: "pkg_sps-woodland_tags__version_8_17_2__hash_160drw1b" } }, defaultVariants: { link: !1, disabled: !1, addOrRemove: !1 }, compoundVariants: [[{ disabled: !1, addOrRemove: !0 }, "pkg_sps-woodland_tags__version_8_17_2__hash_160drw1c"]] }), F = "pkg_sps-woodland_tags__version_8_17_2__hash_160drw1f";
|
|
58
|
+
function v({
|
|
59
59
|
children: a,
|
|
60
|
-
className:
|
|
60
|
+
className: _,
|
|
61
61
|
onClick: e,
|
|
62
|
-
disabled:
|
|
63
|
-
href:
|
|
64
|
-
target:
|
|
65
|
-
kind:
|
|
66
|
-
onAdd:
|
|
67
|
-
onRemove:
|
|
68
|
-
...
|
|
62
|
+
disabled: s,
|
|
63
|
+
href: o,
|
|
64
|
+
target: g,
|
|
65
|
+
kind: d,
|
|
66
|
+
onAdd: n,
|
|
67
|
+
onRemove: r,
|
|
68
|
+
...f
|
|
69
69
|
}) {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
if (
|
|
70
|
+
const u = l.Children.toArray(a).filter((c) => typeof c == "string").join("");
|
|
71
|
+
l.useEffect(() => {
|
|
72
|
+
if (r && n)
|
|
73
73
|
throw new Error("Clickable tag should have onRemove or onAdd, not both");
|
|
74
|
-
}, [
|
|
75
|
-
function
|
|
76
|
-
|
|
74
|
+
}, [n, r]);
|
|
75
|
+
function C(c) {
|
|
76
|
+
n ? n() : r && r(), c.stopPropagation();
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
|
|
78
|
+
function y(c) {
|
|
79
|
+
c.stopPropagation(), e && e(c);
|
|
80
80
|
}
|
|
81
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ l.createElement("div", { className: i(S({ kind: d, disabled: s }), _), ...f }, /* @__PURE__ */ l.createElement(
|
|
82
82
|
"span",
|
|
83
83
|
{
|
|
84
|
-
className:
|
|
84
|
+
className: i(
|
|
85
85
|
x({
|
|
86
|
-
link: !!
|
|
87
|
-
disabled:
|
|
88
|
-
addOrRemove:
|
|
86
|
+
link: !!o || !!e,
|
|
87
|
+
disabled: s,
|
|
88
|
+
addOrRemove: n || r
|
|
89
89
|
})
|
|
90
90
|
),
|
|
91
|
-
onClick:
|
|
92
|
-
title:
|
|
91
|
+
onClick: y,
|
|
92
|
+
title: u
|
|
93
93
|
},
|
|
94
|
-
|
|
95
|
-
), (
|
|
94
|
+
o ? /* @__PURE__ */ l.createElement("a", { className: F, href: o, target: g }, a) : a
|
|
95
|
+
), (n || r) && !s && /* @__PURE__ */ l.createElement(
|
|
96
96
|
"div",
|
|
97
97
|
{
|
|
98
98
|
className: K,
|
|
99
|
-
onClick:
|
|
99
|
+
onClick: s ? void 0 : C,
|
|
100
100
|
tabIndex: -1,
|
|
101
|
-
"aria-label":
|
|
101
|
+
"aria-label": n ? "Add" : "Remove"
|
|
102
102
|
},
|
|
103
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ l.createElement(T, { className: E, "aria-hidden": "true", icon: n ? "plus-sign" : "x" })
|
|
104
104
|
));
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
k.set(v, {
|
|
107
107
|
name: "Clickable Tag",
|
|
108
108
|
props: {
|
|
109
109
|
disabled: { type: "boolean", default: "false" },
|
|
@@ -114,7 +114,7 @@ T.set(w, {
|
|
|
114
114
|
onRemove: { type: "() => void" }
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
|
-
var V =
|
|
117
|
+
var V = p({ defaultClassName: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi0", variantClassNames: { kind: { default: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi1", key: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi2", warning: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi3", error: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi4", pending: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi5", success: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi6", info: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi7" } }, defaultVariants: { kind: "default" }, compoundVariants: [] }), P = p({ defaultClassName: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi8", variantClassNames: { kind: { default: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi9", key: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efia", warning: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efib", error: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efic", pending: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efid", success: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efie", info: "pkg_sps-woodland_tags__version_8_17_2__hash_5f3efif" } }, defaultVariants: { kind: "default" }, compoundVariants: [] });
|
|
118
118
|
const j = Object.freeze({
|
|
119
119
|
default: "info-circle",
|
|
120
120
|
key: "info-circle",
|
|
@@ -124,37 +124,37 @@ const j = Object.freeze({
|
|
|
124
124
|
success: "status-ok",
|
|
125
125
|
info: "info-circle"
|
|
126
126
|
});
|
|
127
|
-
function
|
|
127
|
+
function m({
|
|
128
128
|
children: a,
|
|
129
|
-
className:
|
|
129
|
+
className: _,
|
|
130
130
|
kind: e = "default",
|
|
131
|
-
icon:
|
|
132
|
-
...
|
|
131
|
+
icon: s,
|
|
132
|
+
...o
|
|
133
133
|
}) {
|
|
134
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ l.createElement("span", { className: i(V({ kind: e }), _), ...o }, s && /* @__PURE__ */ l.createElement(T, { className: i(P({ kind: e })), icon: j[e] }), a);
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
k.set(m, {
|
|
137
137
|
name: "Tag",
|
|
138
138
|
props: {
|
|
139
139
|
kind: { type: "TagKind", default: "default" },
|
|
140
140
|
icon: { type: "boolean", default: "false" }
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
|
-
var I = "
|
|
144
|
-
function
|
|
143
|
+
var I = "pkg_sps-woodland_tags__version_8_17_2__hash_79ofse0", R = "pkg_sps-woodland_tags__version_8_17_2__hash_79ofse1", D = "pkg_sps-woodland_tags__version_8_17_2__hash_79ofse2", L = "pkg_sps-woodland_tags__version_8_17_2__hash_79ofsed", B = p({ defaultClassName: "pkg_sps-woodland_tags__version_8_17_2__hash_79ofse3", variantClassNames: { href: { true: "pkg_sps-woodland_tags__version_8_17_2__hash_79ofse4", false: "pkg_sps-woodland_tags__version_8_17_2__hash_79ofse5" }, kind: { default: "pkg_sps-woodland_tags__version_8_17_2__hash_79ofse6", key: "pkg_sps-woodland_tags__version_8_17_2__hash_79ofse7", warning: "pkg_sps-woodland_tags__version_8_17_2__hash_79ofse8", error: "pkg_sps-woodland_tags__version_8_17_2__hash_79ofse9", pending: "pkg_sps-woodland_tags__version_8_17_2__hash_79ofsea", success: "pkg_sps-woodland_tags__version_8_17_2__hash_79ofseb", info: "pkg_sps-woodland_tags__version_8_17_2__hash_79ofsec" } }, defaultVariants: { href: !1, kind: "default" }, compoundVariants: [] });
|
|
144
|
+
function w({
|
|
145
145
|
children: a,
|
|
146
|
-
className:
|
|
146
|
+
className: _,
|
|
147
147
|
color: e = "default",
|
|
148
|
-
href:
|
|
149
|
-
target:
|
|
150
|
-
icon:
|
|
151
|
-
tagKey:
|
|
152
|
-
value:
|
|
153
|
-
...
|
|
148
|
+
href: s,
|
|
149
|
+
target: o,
|
|
150
|
+
icon: g,
|
|
151
|
+
tagKey: d,
|
|
152
|
+
value: n,
|
|
153
|
+
...r
|
|
154
154
|
}) {
|
|
155
|
-
return /* @__PURE__ */
|
|
155
|
+
return /* @__PURE__ */ l.createElement("span", { className: i(I, _), ...r }, /* @__PURE__ */ l.createElement(m, { className: i(R), icon: g, kind: e }, d && /* @__PURE__ */ l.createElement("span", { className: i(D) }, d)), /* @__PURE__ */ l.createElement(m, { className: i(B({ href: !!s, kind: e })) }, s ? /* @__PURE__ */ l.createElement("a", { className: L, href: s, target: o }, n) : n));
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
k.set(w, {
|
|
158
158
|
name: "Split Tag",
|
|
159
159
|
props: {
|
|
160
160
|
color: { type: "TagKind", default: "key" },
|
|
@@ -166,13 +166,13 @@ T.set(y, {
|
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
const A = {
|
|
169
|
-
components: [
|
|
169
|
+
components: [v],
|
|
170
170
|
examples: {
|
|
171
171
|
basic: {
|
|
172
172
|
label: "Basic Tag",
|
|
173
173
|
examples: {
|
|
174
174
|
basic: {
|
|
175
|
-
react:
|
|
175
|
+
react: t`
|
|
176
176
|
import { ClickableTag } from "@sps-woodland/tags";
|
|
177
177
|
|
|
178
178
|
function Component() {
|
|
@@ -186,7 +186,7 @@ const A = {
|
|
|
186
186
|
`
|
|
187
187
|
},
|
|
188
188
|
disabled: {
|
|
189
|
-
react:
|
|
189
|
+
react: t`
|
|
190
190
|
import { ClickableTag } from "@sps-woodland/tags";
|
|
191
191
|
|
|
192
192
|
function Component() {
|
|
@@ -204,7 +204,7 @@ const A = {
|
|
|
204
204
|
label: "Button",
|
|
205
205
|
examples: {
|
|
206
206
|
remove: {
|
|
207
|
-
react:
|
|
207
|
+
react: t`
|
|
208
208
|
import { ClickableTag } from "@sps-woodland/tags";
|
|
209
209
|
|
|
210
210
|
function Component() {
|
|
@@ -218,7 +218,7 @@ const A = {
|
|
|
218
218
|
`
|
|
219
219
|
},
|
|
220
220
|
add: {
|
|
221
|
-
react:
|
|
221
|
+
react: t`
|
|
222
222
|
import { ClickableTag } from "@sps-woodland/tags";
|
|
223
223
|
|
|
224
224
|
function Component() {
|
|
@@ -237,7 +237,7 @@ const A = {
|
|
|
237
237
|
label: "Link",
|
|
238
238
|
examples: {
|
|
239
239
|
basic: {
|
|
240
|
-
react:
|
|
240
|
+
react: t`
|
|
241
241
|
import { ClickableTag } from "@sps-woodland/tags";
|
|
242
242
|
|
|
243
243
|
function Component() {
|
|
@@ -251,7 +251,7 @@ const A = {
|
|
|
251
251
|
`
|
|
252
252
|
},
|
|
253
253
|
button: {
|
|
254
|
-
react:
|
|
254
|
+
react: t`
|
|
255
255
|
import { ClickableTag } from "@sps-woodland/tags";
|
|
256
256
|
|
|
257
257
|
function Component() {
|
|
@@ -268,13 +268,13 @@ const A = {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
}, W = {
|
|
271
|
-
components: [
|
|
271
|
+
components: [m],
|
|
272
272
|
examples: {
|
|
273
273
|
basic: {
|
|
274
274
|
label: "Basic Tag",
|
|
275
275
|
examples: {
|
|
276
276
|
basic: {
|
|
277
|
-
react:
|
|
277
|
+
react: t`
|
|
278
278
|
import { Tag } from "@sps-woodland/tags";
|
|
279
279
|
|
|
280
280
|
function Component() {
|
|
@@ -298,7 +298,7 @@ const A = {
|
|
|
298
298
|
label: "Tag with icon",
|
|
299
299
|
examples: {
|
|
300
300
|
basic: {
|
|
301
|
-
react:
|
|
301
|
+
react: t`
|
|
302
302
|
import { Tag } from "@sps-woodland/tags";
|
|
303
303
|
|
|
304
304
|
function Component() {
|
|
@@ -320,13 +320,13 @@ const A = {
|
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
}, q = {
|
|
323
|
-
components: [
|
|
323
|
+
components: [w],
|
|
324
324
|
examples: {
|
|
325
325
|
basic: {
|
|
326
326
|
label: "Basic",
|
|
327
327
|
examples: {
|
|
328
328
|
basic: {
|
|
329
|
-
react:
|
|
329
|
+
react: t`
|
|
330
330
|
import { SplitTag } from "@sps-woodland/tag";
|
|
331
331
|
|
|
332
332
|
function Component() {
|
|
@@ -349,7 +349,7 @@ const A = {
|
|
|
349
349
|
label: "Icon",
|
|
350
350
|
examples: {
|
|
351
351
|
basic: {
|
|
352
|
-
react:
|
|
352
|
+
react: t`
|
|
353
353
|
import { SplitTag } from "@sps-woodland/tag";
|
|
354
354
|
|
|
355
355
|
function Component() {
|
|
@@ -372,7 +372,7 @@ const A = {
|
|
|
372
372
|
label: "Link",
|
|
373
373
|
examples: {
|
|
374
374
|
basic: {
|
|
375
|
-
react:
|
|
375
|
+
react: t`
|
|
376
376
|
import { SplitTag } from "@sps-woodland/tag";
|
|
377
377
|
|
|
378
378
|
function Component() {
|
|
@@ -391,9 +391,9 @@ const A = {
|
|
|
391
391
|
"Split Tags": q
|
|
392
392
|
};
|
|
393
393
|
export {
|
|
394
|
-
|
|
394
|
+
v as ClickableTag,
|
|
395
395
|
G as MANIFEST,
|
|
396
|
-
|
|
397
|
-
|
|
396
|
+
w as SplitTag,
|
|
397
|
+
m as Tag,
|
|
398
398
|
j as TagIcons
|
|
399
399
|
};
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.pkg_sps-woodland_tags__version_8_17_2__hash_160drw10{border-radius:.125rem;display:inline-flex;color:#08638d;font-size:.75rem;font-weight:600;height:1.125rem;line-height:.75rem;max-width:100%}.pkg_sps-woodland_tags__version_8_17_2__hash_160drw11{background-color:#e6f2f8}.pkg_sps-woodland_tags__version_8_17_2__hash_160drw12{background-color:#e9e9ea}.pkg_sps-woodland_tags__version_8_17_2__hash_160drw13{background-color:#fff;border-width:.0625rem;border-style:solid;border-color:#d2d4d4;color:#717779;cursor:not-allowed}.pkg_sps-woodland_tags__version_8_17_2__hash_160drw15{border-radius:.125rem;flex-grow:1;flex-shrink:1;height:1.125rem;overflow:hidden;padding:.125rem .25rem;text-overflow:ellipsis;white-space:nowrap}.pkg_sps-woodland_tags__version_8_17_2__hash_160drw16{cursor:pointer;text-decoration:underline}.pkg_sps-woodland_tags__version_8_17_2__hash_160drw16:hover{color:#e6f2f8;background-color:#08638d;border-radius:.125rem}.pkg_sps-woodland_tags__version_8_17_2__hash_160drw1c{border-top-left-radius:.125rem;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:.125rem}.pkg_sps-woodland_tags__version_8_17_2__hash_160drw1d{border-top-left-radius:0;border-top-right-radius:.125rem;border-bottom-right-radius:.125rem;border-bottom-left-radius:0;color:#08638d;height:1.125rem;line-height:.75rem;padding:.125rem .25rem}.pkg_sps-woodland_tags__version_8_17_2__hash_160drw1d:focus,.pkg_sps-woodland_tags__version_8_17_2__hash_160drw1d:hover{background-color:#08638d;color:#e6f2f8;cursor:pointer}.pkg_sps-woodland_tags__version_8_17_2__hash_160drw1e{cursor:pointer;font-size:.625rem;position:relative;text-decoration:none;top:-.0625rem;vertical-align:middle}span>.pkg_sps-woodland_tags__version_8_17_2__hash_160drw1f{color:#08638d}span:hover>.pkg_sps-woodland_tags__version_8_17_2__hash_160drw1f{color:#e6f2f8}.pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi0{border-radius:.125rem;display:inline-block;font-size:.75rem;font-weight:600;line-height:.75rem;overflow:hidden;padding:.125rem .25rem;text-align:left;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi1{background:#e9e9ea;color:#4b5356}.pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi2{background:#4b5356;color:#fff}.pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi3{background:#e77609;color:#fff}.pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi4{background:#de012e;color:#fff}.pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi5{background:#91467f;color:#fff}.pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi6{background:#0b8940;color:#fff}.pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi7{background:#027db8;color:#fff}.pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi8{font-size:.75rem;line-height:.625rem;margin-right:.25rem}.pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi8:before{vertical-align:text-bottom}.pkg_sps-woodland_tags__version_8_17_2__hash_5f3efi9{display:none}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofse0{display:inline-block}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofse1{border-top-left-radius:.125rem;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:.125rem}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofse2{margin-left:.25rem}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofse3{background:#fff;border-top-left-radius:0;border-top-right-radius:.125rem;border-bottom-right-radius:.125rem;border-bottom-left-radius:0;padding:.125rem .25rem;box-shadow:.0625rem 0 #e9e9ea inset,-.0625rem 0 #e9e9ea inset,0 .0625rem #e9e9ea inset,0 -.0625rem #e9e9ea inset}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofse4{cursor:pointer;text-decoration:underline;color:#4b5356}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofse7{box-shadow:.0625rem 0 #4b5356 inset,-.0625rem 0 #4b5356 inset,0 .0625rem #4b5356 inset,0 -.0625rem #4b5356 inset}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofse8{box-shadow:.0625rem 0 #e77609 inset,-.0625rem 0 #e77609 inset,0 .0625rem #e77609 inset,0 -.0625rem #e77609 inset}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofse9{box-shadow:.0625rem 0 #de012e inset,-.0625rem 0 #de012e inset,0 .0625rem #de012e inset,0 -.0625rem #de012e inset}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofsea{box-shadow:.0625rem 0 #91467f inset,-.0625rem 0 #91467f inset,0 .0625rem #91467f inset,0 -.0625rem #91467f inset}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofseb{box-shadow:.0625rem 0 #0b8940 inset,-.0625rem 0 #0b8940 inset,0 .0625rem #0b8940 inset,0 -.0625rem #0b8940 inset}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofsec{box-shadow:.0625rem 0 #027db8 inset,-.0625rem 0 #027db8 inset,0 .0625rem #027db8 inset,0 -.0625rem #027db8 inset}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofsed,.pkg_sps-woodland_tags__version_8_17_2__hash_79ofsed:hover{color:#4b5356}.pkg_sps-woodland_tags__version_8_17_2__hash_79ofse1>i{margin-right:0}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/tags",
|
|
3
3
|
"description": "SPS Woodland Design System tag components",
|
|
4
|
-
"version": "8.17.
|
|
4
|
+
"version": "8.17.2",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/cards",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@spscommerce/utils": "^7.0.0",
|
|
30
30
|
"react": "^16.14.0",
|
|
31
31
|
"react-dom": "^16.14.0",
|
|
32
|
-
"@sps-woodland/core": "8.17.
|
|
33
|
-
"@sps-woodland/tokens": "8.17.
|
|
32
|
+
"@sps-woodland/core": "8.17.2",
|
|
33
|
+
"@sps-woodland/tokens": "8.17.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@spscommerce/utils": "^7.0.0",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@vanilla-extract/recipes": "^0.2.5",
|
|
39
39
|
"react": "^16.14.0",
|
|
40
40
|
"react-dom": "^16.14.0",
|
|
41
|
-
"@sps-woodland/core": "8.17.
|
|
42
|
-
"@sps-woodland/tokens": "8.17.
|
|
41
|
+
"@sps-woodland/core": "8.17.2",
|
|
42
|
+
"@sps-woodland/tokens": "8.17.2"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "pnpm run build:js && pnpm run build:types",
|
package/vite.config.mjs
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
3
3
|
import { defineConfig } from "vite";
|
|
4
|
-
|
|
4
|
+
import { getVanillaExtractPluginProps } from "../../../scripts/vanilla-extract-plugin-props.mjs";
|
|
5
5
|
import pkg from "./package.json";
|
|
6
6
|
|
|
7
|
+
const packageVersion = process.env.PREDICTED_VERSION || pkg.version;
|
|
8
|
+
|
|
7
9
|
export default defineConfig({
|
|
8
|
-
plugins: [
|
|
10
|
+
plugins: [
|
|
11
|
+
vanillaExtractPlugin(
|
|
12
|
+
getVanillaExtractPluginProps({
|
|
13
|
+
packageName: pkg.name,
|
|
14
|
+
packageVersion,
|
|
15
|
+
})
|
|
16
|
+
),
|
|
17
|
+
],
|
|
9
18
|
build: {
|
|
10
19
|
lib: {
|
|
11
20
|
entry: path.resolve(__dirname, "src/index.ts"),
|