@sps-woodland/side-nav 8.17.1 → 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 +6 -6
- package/lib/index.es.js +72 -72
- 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 T=require("react"),d=require("@sps-woodland/core"),_=require("@spscommerce/utils");function x(a){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:()=>a[t]})}}return n.default=a,Object.freeze(n)}const e=x(T);function H(a,n,t){return n in a?Object.defineProperty(a,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[n]=t,a}function E(a,n){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);n&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(a,s).enumerable})),t.push.apply(t,i)}return t}function w(a){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?E(Object(t),!0).forEach(function(i){H(a,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):E(Object(t)).forEach(function(i){Object.defineProperty(a,i,Object.getOwnPropertyDescriptor(t,i))})}return a}var F=(a,n,t)=>{for(var i of Object.keys(a)){var s;if(a[i]!==((s=n[i])!==null&&s!==void 0?s:t[i]))return!1}return!0},V=a=>n=>{var t=a.defaultClassName,i=w(w({},a.defaultVariants),n);for(var s in i){var o,v=(o=i[s])!==null&&o!==void 0?o:a.defaultVariants[s];if(v!=null){var r=v;typeof r=="boolean"&&(r=r===!0?"true":"false");var c=a.variantClassNames[s][r];c&&(t+=" "+c)}}for(var[l,I]of a.compoundVariants)F(l,i,a.defaultVariants)&&(t+=" "+I);return t},j="pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco7",A="pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco0",G="pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8",D="pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcof",M="pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcoe",q="pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco3",U="pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco4",R="pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco1",z=V({defaultClassName:"pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco9",variantClassNames:{selected:{true:"pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcoa",false:"pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcob"},inFilter:{true:"pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcoc",false:"pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcod"}},defaultVariants:{selected:!1,inFilter:!0},compoundVariants:[]}),C="pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcog",B="pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco5",L="pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco6",K="pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco2";function h({children:a,className:n,...t}){return e.createElement("div",{className:R,...t},e.createElement("div",{className:K},a))}d.Metadata.set(h,{name:"SideNavHeader",props:{}});const O=T.createContext({filterValue:"",activeItem:""});function m({children:a,className:n,onSelect:t,as:i,keyId:s,...o}){const v=i??"a",[r,c]=d.selectChildren(a,[{type:m}]),[l,I]=e.useState(!0),[g,k]=e.useState(!0),S=e.useContext(O),p=e.useRef(null);return e.useEffect(()=>{var f;k(((f=p.current)==null?void 0:f.innerText.includes(S.filterValue))||!1)},[S]),e.createElement(e.Fragment,null,r.length?e.createElement("ul",{className:G},e.createElement("li",{ref:p,className:M,onClick:()=>I(!l)},e.createElement(v,{className:C,...o},e.createElement("div",null,e.createElement(d.Icon,{className:D,icon:l?"chevron-down":"chevron-up"})),c)),l&&r):e.createElement("li",{ref:p,className:z({selected:S.activeItem===s,inFilter:g})},e.createElement(v,{className:C,onClick:()=>{t(s)},...o},a)))}d.Metadata.set(m,{name:"SideNavItem",props:{keyId:{type:"string",required:!0},as:{type:"string"}}});function u({children:a,className:n,title:t,onSelect:i,...s}){const[o,v]=d.selectChildren(a,[{type:m}]),r=d.modChildren(o,c=>c.type===m?[{onSelect:i?l=>i(l):()=>{}}]:[]);return e.createElement("div",{className:B,...s},t&&e.createElement("div",{className:L},t),e.createElement("ul",{className:j},r),v)}d.Metadata.set(u,{name:"SideNavSection",props:{title:{type:"string"}}});function b({children:a,className:n,activeNavItem:t,filterable:i,filterInputPlaceholder:s,...o}){const[v,r,c]=d.selectChildren(a,[{type:h},{type:u},{type:m}]),l=e.useRef(t),[I,g]=e.useState(t),[k,S]=e.useState(""),p=N=>{g(N)},f=d.modChildren(c,N=>N.type===m?[{onSelect:y=>p(y)}]:[]),P=d.modChildren(r,N=>N.type===u?[{onSelect:y=>p(y)}]:[]);return t!==l.current&&(g(t),l.current=t),e.createElement(O.Provider,{value:{filterValue:k,activeItem:I}},e.createElement("div",{className:d.cl(A),...o},v,i&&e.createElement("div",{className:q},e.createElement("div",{className:U},e.createElement("div",{className:"sps-text-input"},e.createElement("div",{className:"sps-form-control"},e.createElement("i",{className:"sps-text-input__icon sps-icon sps-icon-filter"}),e.createElement("input",{type:"text",className:"sps-text-input__input",placeholder:s,onChange:N=>{S(N.target.value)}}))))),P,e.createElement("ul",{className:j},f)))}d.Metadata.set(b,{name:"SideNav",props:{activeNavItem:{type:"string",required:!0},filterable:{type:"boolean"},filterInputPlaceholder:{type:"string"}}});const W={description:()=>e.createElement("p",null,"Side Navigations are used to provide quick access to a series of related pages or content. It can be used to navigate between different page views, or as an anchor-style menu to scroll to specific content on the same page."),components:[b,h,u,m],examples:{general:{label:"Usage",description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"Use the Side Navigation if:"),e.createElement("ul",null,e.createElement("li",null,"The navigation benefits from subsections or nested structures"),e.createElement("li",null,"There are too many items for Tabbed Navigation"),e.createElement("li",null,"The navigation items have long names")),e.createElement("p",null,"Avoid using the Side Navigation if:"),e.createElement("ul",null,e.createElement("li",null,"Tabbed Navigation is sufficient"),e.createElement("li",null,"The full width of the page is required to sufficiently display content")))},filter:{label:"Filter",description:"Use Filters when the Side Navigation benefits from filtering, usually when it contains a long list of navigation items.",examples:{filter:{react:_.code`
|
|
2
2
|
import { SideNav, SideNavHeader, SideNavItem } from "@sps-woodland/side-nav";
|
|
3
3
|
import { Icon } from "@sps-woodland/core";
|
|
4
4
|
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
</div>
|
|
51
51
|
)
|
|
52
52
|
}
|
|
53
|
-
`}}},icons:{label:"Icons",description:({Link:a})=>e.createElement(e.Fragment,null,e.createElement("p",null,"Use Icons to further illustrate what the navigation item contains. If one navigation item has an Icon, all of the need to have an Icon. Do not use an Icon more than once in a single Side Navigation. Example: A bell icon to represent a Notifications navigation item."),e.createElement(a,{to:"/style-and-layout/icons"},"View All Icons")),examples:{icons:{react:
|
|
53
|
+
`}}},icons:{label:"Icons",description:({Link:a})=>e.createElement(e.Fragment,null,e.createElement("p",null,"Use Icons to further illustrate what the navigation item contains. If one navigation item has an Icon, all of the need to have an Icon. Do not use an Icon more than once in a single Side Navigation. Example: A bell icon to represent a Notifications navigation item."),e.createElement(a,{to:"/style-and-layout/icons"},"View All Icons")),examples:{icons:{react:_.code`
|
|
54
54
|
import { SideNav, SideNavHeader, SideNavItem } from "@sps-woodland/side-nav";
|
|
55
55
|
import { Icon } from "@sps-woodland/core";
|
|
56
56
|
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
</div>
|
|
95
95
|
)
|
|
96
96
|
}
|
|
97
|
-
`}}},nesting:{label:"Nesting",description:"Use Nesting to organize related navigation items. Avoid nesting beyond grandchildren.",examples:{icons:{react:
|
|
97
|
+
`}}},nesting:{label:"Nesting",description:"Use Nesting to organize related navigation items. Avoid nesting beyond grandchildren.",examples:{icons:{react:_.code`
|
|
98
98
|
import { SideNav, SideNavHeader, SideNavItem } from "@sps-woodland/side-nav";
|
|
99
99
|
import { Icon } from "@sps-woodland/core";
|
|
100
100
|
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
</div>
|
|
145
145
|
)
|
|
146
146
|
}
|
|
147
|
-
`}}},sections:{label:"Sections",description:"Use Sections to break up content into different categories. Sections utilize Subtitles.",examples:{icons:{react:
|
|
147
|
+
`}}},sections:{label:"Sections",description:"Use Sections to break up content into different categories. Sections utilize Subtitles.",examples:{icons:{react:_.code`
|
|
148
148
|
import { SideNav, SideNavHeader, SideNavItem } from "@sps-woodland/side-nav";
|
|
149
149
|
import { Icon } from "@sps-woodland/core";
|
|
150
150
|
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
</div>
|
|
194
194
|
)
|
|
195
195
|
}
|
|
196
|
-
`}}},tags:{label:"Tags",description:"Use Tags to indicate a number of additional detail related to the navigation item.",examples:{icons:{react:
|
|
196
|
+
`}}},tags:{label:"Tags",description:"Use Tags to indicate a number of additional detail related to the navigation item.",examples:{icons:{react:_.code`
|
|
197
197
|
import { SideNav, SideNavHeader, SideNavItem } from "@sps-woodland/side-nav";
|
|
198
198
|
import { Tag } from "@sps-woodland/tags";
|
|
199
199
|
import { Icon } from "@sps-woodland/core";
|
|
@@ -238,4 +238,4 @@
|
|
|
238
238
|
</div>
|
|
239
239
|
)
|
|
240
240
|
}
|
|
241
|
-
`}}}}},J={"Side Navigation":W};exports.MANIFEST=J;exports.SideNav=
|
|
241
|
+
`}}}}},J={"Side Navigation":W};exports.MANIFEST=J;exports.SideNav=b;exports.SideNavHeader=h;exports.SideNavItem=m;exports.SideNavSection=u;
|
package/lib/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import { createContext as H } from "react";
|
|
3
|
-
import { Metadata as
|
|
4
|
-
import { code as
|
|
3
|
+
import { Metadata as f, selectChildren as b, Icon as F, modChildren as y, cl as V } from "@sps-woodland/core";
|
|
4
|
+
import { code as S } from "@spscommerce/utils";
|
|
5
5
|
function G(a, n, t) {
|
|
6
6
|
return n in a ? Object.defineProperty(a, n, {
|
|
7
7
|
value: t,
|
|
@@ -10,22 +10,22 @@ function G(a, n, t) {
|
|
|
10
10
|
writable: !0
|
|
11
11
|
}) : a[n] = t, a;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function w(a, n) {
|
|
14
14
|
var t = Object.keys(a);
|
|
15
15
|
if (Object.getOwnPropertySymbols) {
|
|
16
16
|
var i = Object.getOwnPropertySymbols(a);
|
|
17
|
-
n && (i = i.filter(function(
|
|
18
|
-
return Object.getOwnPropertyDescriptor(a,
|
|
17
|
+
n && (i = i.filter(function(s) {
|
|
18
|
+
return Object.getOwnPropertyDescriptor(a, s).enumerable;
|
|
19
19
|
})), t.push.apply(t, i);
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function C(a) {
|
|
24
24
|
for (var n = 1; n < arguments.length; n++) {
|
|
25
25
|
var t = arguments[n] != null ? arguments[n] : {};
|
|
26
|
-
n % 2 ?
|
|
26
|
+
n % 2 ? w(Object(t), !0).forEach(function(i) {
|
|
27
27
|
G(a, i, t[i]);
|
|
28
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) :
|
|
28
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(t)) : w(Object(t)).forEach(function(i) {
|
|
29
29
|
Object.defineProperty(a, i, Object.getOwnPropertyDescriptor(t, i));
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -33,41 +33,41 @@ function w(a) {
|
|
|
33
33
|
}
|
|
34
34
|
var A = (a, n, t) => {
|
|
35
35
|
for (var i of Object.keys(a)) {
|
|
36
|
-
var
|
|
37
|
-
if (a[i] !== ((
|
|
36
|
+
var s;
|
|
37
|
+
if (a[i] !== ((s = n[i]) !== null && s !== void 0 ? s : t[i]))
|
|
38
38
|
return !1;
|
|
39
39
|
}
|
|
40
40
|
return !0;
|
|
41
41
|
}, U = (a) => (n) => {
|
|
42
|
-
var t = a.defaultClassName, i =
|
|
43
|
-
for (var
|
|
44
|
-
var
|
|
42
|
+
var t = a.defaultClassName, i = C(C({}, a.defaultVariants), n);
|
|
43
|
+
for (var s in i) {
|
|
44
|
+
var r, l = (r = i[s]) !== null && r !== void 0 ? r : a.defaultVariants[s];
|
|
45
45
|
if (l != null) {
|
|
46
|
-
var
|
|
47
|
-
typeof
|
|
48
|
-
var
|
|
46
|
+
var d = l;
|
|
47
|
+
typeof d == "boolean" && (d = d === !0 ? "true" : "false");
|
|
48
|
+
var v = (
|
|
49
49
|
// @ts-expect-error
|
|
50
|
-
a.variantClassNames[
|
|
50
|
+
a.variantClassNames[s][d]
|
|
51
51
|
);
|
|
52
|
-
|
|
52
|
+
v && (t += " " + v);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
for (var [o,
|
|
56
|
-
A(o, i, a.defaultVariants) && (t += " " +
|
|
55
|
+
for (var [o, p] of a.compoundVariants)
|
|
56
|
+
A(o, i, a.defaultVariants) && (t += " " + p);
|
|
57
57
|
return t;
|
|
58
|
-
},
|
|
59
|
-
function
|
|
58
|
+
}, j = "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco7", D = "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco0", R = "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8", q = "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcof", B = "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcoe", L = "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco3", z = "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco4", M = "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco1", K = U({ defaultClassName: "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco9", variantClassNames: { selected: { true: "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcoa", false: "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcob" }, inFilter: { true: "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcoc", false: "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcod" } }, defaultVariants: { selected: !1, inFilter: !0 }, compoundVariants: [] }), T = "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcog", W = "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco5", J = "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco6", Q = "pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco2";
|
|
59
|
+
function E({
|
|
60
60
|
children: a,
|
|
61
61
|
className: n,
|
|
62
62
|
...t
|
|
63
63
|
}) {
|
|
64
64
|
return /* @__PURE__ */ e.createElement("div", { className: M, ...t }, /* @__PURE__ */ e.createElement("div", { className: Q }, a));
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
f.set(E, {
|
|
67
67
|
name: "SideNavHeader",
|
|
68
68
|
props: {}
|
|
69
69
|
});
|
|
70
|
-
const
|
|
70
|
+
const x = H({
|
|
71
71
|
filterValue: "",
|
|
72
72
|
activeItem: ""
|
|
73
73
|
});
|
|
@@ -76,50 +76,50 @@ function c({
|
|
|
76
76
|
className: n,
|
|
77
77
|
onSelect: t,
|
|
78
78
|
as: i,
|
|
79
|
-
keyId:
|
|
80
|
-
...
|
|
79
|
+
keyId: s,
|
|
80
|
+
...r
|
|
81
81
|
}) {
|
|
82
|
-
const l = i ?? "a", [
|
|
82
|
+
const l = i ?? "a", [d, v] = b(a, [{ type: c }]), [o, p] = e.useState(!0), [_, h] = e.useState(!0), I = e.useContext(x), N = e.useRef(null);
|
|
83
83
|
return e.useEffect(() => {
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
}, [
|
|
84
|
+
var u;
|
|
85
|
+
h(((u = N.current) == null ? void 0 : u.innerText.includes(I.filterValue)) || !1);
|
|
86
|
+
}, [I]), /* @__PURE__ */ e.createElement(e.Fragment, null, d.length ? /* @__PURE__ */ e.createElement("ul", { className: R }, /* @__PURE__ */ e.createElement(
|
|
87
87
|
"li",
|
|
88
88
|
{
|
|
89
89
|
ref: N,
|
|
90
90
|
className: B,
|
|
91
|
-
onClick: () =>
|
|
91
|
+
onClick: () => p(!o)
|
|
92
92
|
},
|
|
93
|
-
/* @__PURE__ */ e.createElement(l, { className:
|
|
93
|
+
/* @__PURE__ */ e.createElement(l, { className: T, ...r }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(
|
|
94
94
|
F,
|
|
95
95
|
{
|
|
96
96
|
className: q,
|
|
97
97
|
icon: o ? "chevron-down" : "chevron-up"
|
|
98
98
|
}
|
|
99
|
-
)),
|
|
100
|
-
), o &&
|
|
99
|
+
)), v)
|
|
100
|
+
), o && d) : /* @__PURE__ */ e.createElement(
|
|
101
101
|
"li",
|
|
102
102
|
{
|
|
103
103
|
ref: N,
|
|
104
104
|
className: K({
|
|
105
|
-
selected:
|
|
106
|
-
inFilter:
|
|
105
|
+
selected: I.activeItem === s,
|
|
106
|
+
inFilter: _
|
|
107
107
|
})
|
|
108
108
|
},
|
|
109
109
|
/* @__PURE__ */ e.createElement(
|
|
110
110
|
l,
|
|
111
111
|
{
|
|
112
|
-
className:
|
|
112
|
+
className: T,
|
|
113
113
|
onClick: () => {
|
|
114
|
-
t(
|
|
114
|
+
t(s);
|
|
115
115
|
},
|
|
116
|
-
...
|
|
116
|
+
...r
|
|
117
117
|
},
|
|
118
118
|
a
|
|
119
119
|
)
|
|
120
120
|
));
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
f.set(c, {
|
|
123
123
|
name: "SideNavItem",
|
|
124
124
|
props: {
|
|
125
125
|
keyId: { type: "string", required: !0 },
|
|
@@ -131,65 +131,65 @@ function g({
|
|
|
131
131
|
className: n,
|
|
132
132
|
title: t,
|
|
133
133
|
onSelect: i,
|
|
134
|
-
...
|
|
134
|
+
...s
|
|
135
135
|
}) {
|
|
136
|
-
const [
|
|
136
|
+
const [r, l] = b(a, [{ type: c }]), d = y(r, (v) => v.type === c ? [
|
|
137
137
|
{
|
|
138
138
|
onSelect: i ? (o) => i(o) : () => {
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
] : []);
|
|
142
|
-
return /* @__PURE__ */ e.createElement("div", { className: W, ...
|
|
142
|
+
return /* @__PURE__ */ e.createElement("div", { className: W, ...s }, t && /* @__PURE__ */ e.createElement("div", { className: J }, t), /* @__PURE__ */ e.createElement("ul", { className: j }, d), l);
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
f.set(g, {
|
|
145
145
|
name: "SideNavSection",
|
|
146
146
|
props: {
|
|
147
147
|
title: { type: "string" }
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
|
-
function
|
|
150
|
+
function P({
|
|
151
151
|
children: a,
|
|
152
152
|
className: n,
|
|
153
153
|
activeNavItem: t,
|
|
154
154
|
filterable: i,
|
|
155
|
-
filterInputPlaceholder:
|
|
156
|
-
...
|
|
155
|
+
filterInputPlaceholder: s,
|
|
156
|
+
...r
|
|
157
157
|
}) {
|
|
158
158
|
const [
|
|
159
159
|
l,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
] =
|
|
163
|
-
{ type:
|
|
160
|
+
d,
|
|
161
|
+
v
|
|
162
|
+
] = b(a, [
|
|
163
|
+
{ type: E },
|
|
164
164
|
{ type: g },
|
|
165
165
|
{ type: c }
|
|
166
|
-
]), o = e.useRef(t), [
|
|
167
|
-
|
|
168
|
-
},
|
|
166
|
+
]), o = e.useRef(t), [p, _] = e.useState(t), [h, I] = e.useState(""), N = (m) => {
|
|
167
|
+
_(m);
|
|
168
|
+
}, u = y(v, (m) => m.type === c ? [
|
|
169
169
|
{
|
|
170
170
|
onSelect: (k) => N(k)
|
|
171
171
|
}
|
|
172
|
-
] : []),
|
|
173
|
-
|
|
174
|
-
(
|
|
172
|
+
] : []), O = y(
|
|
173
|
+
d,
|
|
174
|
+
(m) => m.type === g ? [
|
|
175
175
|
{
|
|
176
176
|
onSelect: (k) => N(k)
|
|
177
177
|
}
|
|
178
178
|
] : []
|
|
179
179
|
);
|
|
180
|
-
return t !== o.current && (
|
|
180
|
+
return t !== o.current && (_(t), o.current = t), /* @__PURE__ */ e.createElement(x.Provider, { value: { filterValue: h, activeItem: p } }, /* @__PURE__ */ e.createElement("div", { className: V(D), ...r }, l, i && /* @__PURE__ */ e.createElement("div", { className: L }, /* @__PURE__ */ e.createElement("div", { className: z }, /* @__PURE__ */ e.createElement("div", { className: "sps-text-input" }, /* @__PURE__ */ e.createElement("div", { className: "sps-form-control" }, /* @__PURE__ */ e.createElement("i", { className: "sps-text-input__icon sps-icon sps-icon-filter" }), /* @__PURE__ */ e.createElement(
|
|
181
181
|
"input",
|
|
182
182
|
{
|
|
183
183
|
type: "text",
|
|
184
184
|
className: "sps-text-input__input",
|
|
185
|
-
placeholder:
|
|
186
|
-
onChange: (
|
|
187
|
-
|
|
185
|
+
placeholder: s,
|
|
186
|
+
onChange: (m) => {
|
|
187
|
+
I(m.target.value);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
))))),
|
|
190
|
+
))))), O, /* @__PURE__ */ e.createElement("ul", { className: j }, u)));
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
f.set(P, {
|
|
193
193
|
name: "SideNav",
|
|
194
194
|
props: {
|
|
195
195
|
activeNavItem: { type: "string", required: !0 },
|
|
@@ -200,8 +200,8 @@ h.set(O, {
|
|
|
200
200
|
const X = {
|
|
201
201
|
description: () => /* @__PURE__ */ e.createElement("p", null, "Side Navigations are used to provide quick access to a series of related pages or content. It can be used to navigate between different page views, or as an anchor-style menu to scroll to specific content on the same page."),
|
|
202
202
|
components: [
|
|
203
|
-
|
|
204
|
-
|
|
203
|
+
P,
|
|
204
|
+
E,
|
|
205
205
|
g,
|
|
206
206
|
c
|
|
207
207
|
],
|
|
@@ -215,7 +215,7 @@ const X = {
|
|
|
215
215
|
description: "Use Filters when the Side Navigation benefits from filtering, usually when it contains a long list of navigation items.",
|
|
216
216
|
examples: {
|
|
217
217
|
filter: {
|
|
218
|
-
react:
|
|
218
|
+
react: S`
|
|
219
219
|
import { SideNav, SideNavHeader, SideNavItem } from "@sps-woodland/side-nav";
|
|
220
220
|
import { Icon } from "@sps-woodland/core";
|
|
221
221
|
|
|
@@ -276,7 +276,7 @@ const X = {
|
|
|
276
276
|
description: ({ Link: a }) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("p", null, "Use Icons to further illustrate what the navigation item contains. If one navigation item has an Icon, all of the need to have an Icon. Do not use an Icon more than once in a single Side Navigation. Example: A bell icon to represent a Notifications navigation item."), /* @__PURE__ */ e.createElement(a, { to: "/style-and-layout/icons" }, "View All Icons")),
|
|
277
277
|
examples: {
|
|
278
278
|
icons: {
|
|
279
|
-
react:
|
|
279
|
+
react: S`
|
|
280
280
|
import { SideNav, SideNavHeader, SideNavItem } from "@sps-woodland/side-nav";
|
|
281
281
|
import { Icon } from "@sps-woodland/core";
|
|
282
282
|
|
|
@@ -329,7 +329,7 @@ const X = {
|
|
|
329
329
|
description: "Use Nesting to organize related navigation items. Avoid nesting beyond grandchildren.",
|
|
330
330
|
examples: {
|
|
331
331
|
icons: {
|
|
332
|
-
react:
|
|
332
|
+
react: S`
|
|
333
333
|
import { SideNav, SideNavHeader, SideNavItem } from "@sps-woodland/side-nav";
|
|
334
334
|
import { Icon } from "@sps-woodland/core";
|
|
335
335
|
|
|
@@ -388,7 +388,7 @@ const X = {
|
|
|
388
388
|
description: "Use Sections to break up content into different categories. Sections utilize Subtitles.",
|
|
389
389
|
examples: {
|
|
390
390
|
icons: {
|
|
391
|
-
react:
|
|
391
|
+
react: S`
|
|
392
392
|
import { SideNav, SideNavHeader, SideNavItem } from "@sps-woodland/side-nav";
|
|
393
393
|
import { Icon } from "@sps-woodland/core";
|
|
394
394
|
|
|
@@ -446,7 +446,7 @@ const X = {
|
|
|
446
446
|
description: "Use Tags to indicate a number of additional detail related to the navigation item.",
|
|
447
447
|
examples: {
|
|
448
448
|
icons: {
|
|
449
|
-
react:
|
|
449
|
+
react: S`
|
|
450
450
|
import { SideNav, SideNavHeader, SideNavItem } from "@sps-woodland/side-nav";
|
|
451
451
|
import { Tag } from "@sps-woodland/tags";
|
|
452
452
|
import { Icon } from "@sps-woodland/core";
|
|
@@ -501,8 +501,8 @@ const X = {
|
|
|
501
501
|
};
|
|
502
502
|
export {
|
|
503
503
|
ee as MANIFEST,
|
|
504
|
-
|
|
505
|
-
|
|
504
|
+
P as SideNav,
|
|
505
|
+
E as SideNavHeader,
|
|
506
506
|
c as SideNavItem,
|
|
507
507
|
g as SideNavSection
|
|
508
508
|
};
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco0{word-wrap:break-word;background-clip:border-box;background-color:#fff;border-width:.0625rem;border-style:solid;border-color:#d2d4d4;border-radius:.125rem;display:flex;flex-direction:column;min-width:0;position:relative}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco1{background-color:#fff;border-bottom:.0625rem solid oklch(86.84% .002 197.12);margin-bottom:0;padding:.5rem}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco2{align-items:center;display:flex;float:left;font-size:.75rem;font-weight:600;line-height:1.5rem;margin-bottom:0;padding-left:.5rem;text-transform:uppercase}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco2>i{font-size:.875rem;margin-right:.25rem}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco3{border-bottom:.0625rem solid oklch(86.84% .002 197.12);padding:.5rem 0}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco4{margin:6px 21px}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco5{margin:0;padding:.5rem 0}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco5+.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco5{border-top:.0625rem solid oklch(86.84% .002 197.12)}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco6{color:#717779;font-size:1rem;font-weight:400;margin:.25rem 0 .5rem 1rem}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco7{list-style:none;margin-top:0;margin-bottom:0;padding:0;font-size:.875rem;line-height:1.25rem}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8{padding-left:0}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco9{display:block;width:100%}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcoa{background-color:#e6f2f8;box-shadow:inset .125rem 0 #027db8;color:#1f282c;font-weight:700}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcod{display:none}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcoe{display:block;width:100%}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcof{font-size:.625rem;vertical-align:middle;display:inline-block;line-height:1.25rem;margin-top:0;margin-right:.25rem;margin-bottom:0;margin-left:-.875rem}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcog{color:#1f282c;cursor:pointer;display:flex;font-size:.875rem;line-height:1.25rem;padding:.5rem 1rem .5rem 1.25rem;text-decoration:none}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcog:hover{background-color:#f3f4f4}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco9>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcog{padding-left:2.125rem}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco9>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcog{padding-left:3rem}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco9>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcog{padding-left:3.875rem}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco9>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcog{padding-left:undefined}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcoe>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcog{padding-left:2.125rem}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcoe>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcog{padding-left:3rem}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcoe>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcog{padding-left:3.875rem}.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvco8>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcoe>.pkg_sps-woodland_side-nav__version_8_17_2__hash_1j8bvcog{padding-left:undefined}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/side-nav",
|
|
3
3
|
"description": "SPS Woodland Design System side navigation 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/side-nav",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@spscommerce/utils": "^7.0.0",
|
|
30
30
|
"react": "^16.9.0",
|
|
31
31
|
"react-dom": "^16.9.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.9.0",
|
|
40
40
|
"react-dom": "^16.9.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"),
|