@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 CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),r=require("@sps-woodland/core"),u=require("@spscommerce/utils");function _(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=_(w);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 C(a,n){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);n&&(i=i.filter(function(d){return Object.getOwnPropertyDescriptor(a,d).enumerable})),t.push.apply(t,i)}return t}function T(a){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?C(Object(t),!0).forEach(function(i){H(a,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):C(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 d;if(a[i]!==((d=n[i])!==null&&d!==void 0?d:t[i]))return!1}return!0},V=a=>n=>{var t=a.defaultClassName,i=T(T({},a.defaultVariants),n);for(var d in i){var o,c=(o=i[d])!==null&&o!==void 0?o:a.defaultVariants[d];if(c!=null){var s=c;typeof s=="boolean"&&(s=s===!0?"true":"false");var m=a.variantClassNames[d][s];m&&(t+=" "+m)}}for(var[l,S]of a.compoundVariants)F(l,i,a.defaultVariants)&&(t+=" "+S);return t},O="_1j8bvco7",A="_1j8bvco0",G="_1j8bvco8",D="_1j8bvcof",M="_1j8bvcoe",q="_1j8bvco3",U="_1j8bvco4",R="_1j8bvco1",z=V({defaultClassName:"_1j8bvco9",variantClassNames:{selected:{true:"_1j8bvcoa",false:"_1j8bvcob"},inFilter:{true:"_1j8bvcoc",false:"_1j8bvcod"}},defaultVariants:{selected:!1,inFilter:!0},compoundVariants:[]}),j="_1j8bvcog",B="_1j8bvco5",L="_1j8bvco6",K="_1j8bvco2";function y({children:a,className:n,...t}){return e.createElement("div",{className:R,...t},e.createElement("div",{className:K},a))}r.Metadata.set(y,{name:"SideNavHeader",props:{}});const P=w.createContext({filterValue:"",activeItem:""});function v({children:a,className:n,onSelect:t,as:i,keyId:d,...o}){const c=i??"a",[s,m]=r.selectChildren(a,[{type:v}]),[l,S]=e.useState(!0),[g,b]=e.useState(!0),p=e.useContext(P),I=e.useRef(null);return e.useEffect(()=>{var h;b(((h=I.current)==null?void 0:h.innerText.includes(p.filterValue))||!1)},[p]),e.createElement(e.Fragment,null,s.length?e.createElement("ul",{className:G},e.createElement("li",{ref:I,className:M,onClick:()=>S(!l)},e.createElement(c,{className:j,...o},e.createElement("div",null,e.createElement(r.Icon,{className:D,icon:l?"chevron-down":"chevron-up"})),m)),l&&s):e.createElement("li",{ref:I,className:z({selected:p.activeItem===d,inFilter:g})},e.createElement(c,{className:j,onClick:()=>{t(d)},...o},a)))}r.Metadata.set(v,{name:"SideNavItem",props:{keyId:{type:"string",required:!0},as:{type:"string"}}});function f({children:a,className:n,title:t,onSelect:i,...d}){const[o,c]=r.selectChildren(a,[{type:v}]),s=r.modChildren(o,m=>m.type===v?[{onSelect:i?l=>i(l):()=>{}}]:[]);return e.createElement("div",{className:B,...d},t&&e.createElement("div",{className:L},t),e.createElement("ul",{className:O},s),c)}r.Metadata.set(f,{name:"SideNavSection",props:{title:{type:"string"}}});function E({children:a,className:n,activeNavItem:t,filterable:i,filterInputPlaceholder:d,...o}){const[c,s,m]=r.selectChildren(a,[{type:y},{type:f},{type:v}]),l=e.useRef(t),[S,g]=e.useState(t),[b,p]=e.useState(""),I=N=>{g(N)},h=r.modChildren(m,N=>N.type===v?[{onSelect:k=>I(k)}]:[]),x=r.modChildren(s,N=>N.type===f?[{onSelect:k=>I(k)}]:[]);return t!==l.current&&(g(t),l.current=t),e.createElement(P.Provider,{value:{filterValue:b,activeItem:S}},e.createElement("div",{className:r.cl(A),...o},c,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:d,onChange:N=>{p(N.target.value)}}))))),x,e.createElement("ul",{className:O},h)))}r.Metadata.set(E,{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:[E,y,f,v],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:u.code`
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:u.code`
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:u.code`
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:u.code`
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:u.code`
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=E;exports.SideNavHeader=y;exports.SideNavItem=v;exports.SideNavSection=f;
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 h, selectChildren as E, Icon as F, modChildren as b, cl as V } from "@sps-woodland/core";
4
- import { code as p } from "@spscommerce/utils";
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 T(a, n) {
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(d) {
18
- return Object.getOwnPropertyDescriptor(a, d).enumerable;
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 w(a) {
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 ? T(Object(t), !0).forEach(function(i) {
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)) : T(Object(t)).forEach(function(i) {
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 d;
37
- if (a[i] !== ((d = n[i]) !== null && d !== void 0 ? d : t[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 = w(w({}, a.defaultVariants), n);
43
- for (var d in i) {
44
- var s, l = (s = i[d]) !== null && s !== void 0 ? s : a.defaultVariants[d];
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 r = l;
47
- typeof r == "boolean" && (r = r === !0 ? "true" : "false");
48
- var m = (
46
+ var d = l;
47
+ typeof d == "boolean" && (d = d === !0 ? "true" : "false");
48
+ var v = (
49
49
  // @ts-expect-error
50
- a.variantClassNames[d][r]
50
+ a.variantClassNames[s][d]
51
51
  );
52
- m && (t += " " + m);
52
+ v && (t += " " + v);
53
53
  }
54
54
  }
55
- for (var [o, I] of a.compoundVariants)
56
- A(o, i, a.defaultVariants) && (t += " " + I);
55
+ for (var [o, p] of a.compoundVariants)
56
+ A(o, i, a.defaultVariants) && (t += " " + p);
57
57
  return t;
58
- }, x = "_1j8bvco7", D = "_1j8bvco0", R = "_1j8bvco8", q = "_1j8bvcof", B = "_1j8bvcoe", L = "_1j8bvco3", z = "_1j8bvco4", M = "_1j8bvco1", K = U({ defaultClassName: "_1j8bvco9", variantClassNames: { selected: { true: "_1j8bvcoa", false: "_1j8bvcob" }, inFilter: { true: "_1j8bvcoc", false: "_1j8bvcod" } }, defaultVariants: { selected: !1, inFilter: !0 }, compoundVariants: [] }), j = "_1j8bvcog", W = "_1j8bvco5", J = "_1j8bvco6", Q = "_1j8bvco2";
59
- function C({
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
- h.set(C, {
66
+ f.set(E, {
67
67
  name: "SideNavHeader",
68
68
  props: {}
69
69
  });
70
- const P = H({
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: d,
80
- ...s
79
+ keyId: s,
80
+ ...r
81
81
  }) {
82
- const l = i ?? "a", [r, m] = E(a, [{ type: c }]), [o, I] = e.useState(!0), [u, y] = e.useState(!0), S = e.useContext(P), N = e.useRef(null);
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 f;
85
- y(((f = N.current) == null ? void 0 : f.innerText.includes(S.filterValue)) || !1);
86
- }, [S]), /* @__PURE__ */ e.createElement(e.Fragment, null, r.length ? /* @__PURE__ */ e.createElement("ul", { className: R }, /* @__PURE__ */ e.createElement(
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: () => I(!o)
91
+ onClick: () => p(!o)
92
92
  },
93
- /* @__PURE__ */ e.createElement(l, { className: j, ...s }, /* @__PURE__ */ e.createElement("div", null, /* @__PURE__ */ e.createElement(
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
- )), m)
100
- ), o && r) : /* @__PURE__ */ e.createElement(
99
+ )), v)
100
+ ), o && d) : /* @__PURE__ */ e.createElement(
101
101
  "li",
102
102
  {
103
103
  ref: N,
104
104
  className: K({
105
- selected: S.activeItem === d,
106
- inFilter: u
105
+ selected: I.activeItem === s,
106
+ inFilter: _
107
107
  })
108
108
  },
109
109
  /* @__PURE__ */ e.createElement(
110
110
  l,
111
111
  {
112
- className: j,
112
+ className: T,
113
113
  onClick: () => {
114
- t(d);
114
+ t(s);
115
115
  },
116
- ...s
116
+ ...r
117
117
  },
118
118
  a
119
119
  )
120
120
  ));
121
121
  }
122
- h.set(c, {
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
- ...d
134
+ ...s
135
135
  }) {
136
- const [s, l] = E(a, [{ type: c }]), r = b(s, (m) => m.type === c ? [
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, ...d }, t && /* @__PURE__ */ e.createElement("div", { className: J }, t), /* @__PURE__ */ e.createElement("ul", { className: x }, r), l);
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
- h.set(g, {
144
+ f.set(g, {
145
145
  name: "SideNavSection",
146
146
  props: {
147
147
  title: { type: "string" }
148
148
  }
149
149
  });
150
- function O({
150
+ function P({
151
151
  children: a,
152
152
  className: n,
153
153
  activeNavItem: t,
154
154
  filterable: i,
155
- filterInputPlaceholder: d,
156
- ...s
155
+ filterInputPlaceholder: s,
156
+ ...r
157
157
  }) {
158
158
  const [
159
159
  l,
160
- r,
161
- m
162
- ] = E(a, [
163
- { type: C },
160
+ d,
161
+ v
162
+ ] = b(a, [
163
+ { type: E },
164
164
  { type: g },
165
165
  { type: c }
166
- ]), o = e.useRef(t), [I, u] = e.useState(t), [y, S] = e.useState(""), N = (v) => {
167
- u(v);
168
- }, f = b(m, (v) => v.type === c ? [
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
- ] : []), _ = b(
173
- r,
174
- (v) => v.type === g ? [
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 && (u(t), o.current = t), /* @__PURE__ */ e.createElement(P.Provider, { value: { filterValue: y, activeItem: I } }, /* @__PURE__ */ e.createElement("div", { className: V(D), ...s }, 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(
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: d,
186
- onChange: (v) => {
187
- S(v.target.value);
185
+ placeholder: s,
186
+ onChange: (m) => {
187
+ I(m.target.value);
188
188
  }
189
189
  }
190
- ))))), _, /* @__PURE__ */ e.createElement("ul", { className: x }, f)));
190
+ ))))), O, /* @__PURE__ */ e.createElement("ul", { className: j }, u)));
191
191
  }
192
- h.set(O, {
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
- O,
204
- C,
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: p`
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: p`
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: p`
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: p`
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: p`
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
- O as SideNav,
505
- C as SideNavHeader,
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
- ._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}._1j8bvco1{background-color:#fff;border-bottom:.0625rem solid oklch(86.84% .002 197.12);margin-bottom:0;padding:.5rem}._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}._1j8bvco2>i{font-size:.875rem;margin-right:.25rem}._1j8bvco3{border-bottom:.0625rem solid oklch(86.84% .002 197.12);padding:.5rem 0}._1j8bvco4{margin:6px 21px}._1j8bvco5{margin:0;padding:.5rem 0}._1j8bvco5+._1j8bvco5{border-top:.0625rem solid oklch(86.84% .002 197.12)}._1j8bvco6{color:#717779;font-size:1rem;font-weight:400;margin:.25rem 0 .5rem 1rem}._1j8bvco7{list-style:none;margin-top:0;margin-bottom:0;padding:0;font-size:.875rem;line-height:1.25rem}._1j8bvco8{padding-left:0}._1j8bvco9{display:block;width:100%}._1j8bvcoa{background-color:#e6f2f8;box-shadow:inset .125rem 0 #027db8;color:#1f282c;font-weight:700}._1j8bvcod{display:none}._1j8bvcoe{display:block;width:100%}._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}._1j8bvcog{color:#1f282c;cursor:pointer;display:flex;font-size:.875rem;line-height:1.25rem;padding:.5rem 1rem .5rem 1.25rem;text-decoration:none}._1j8bvcog:hover{background-color:#f3f4f4}._1j8bvco8>._1j8bvco9>._1j8bvcog{padding-left:2.125rem}._1j8bvco8>._1j8bvco8>._1j8bvco9>._1j8bvcog{padding-left:3rem}._1j8bvco8>._1j8bvco8>._1j8bvco8>._1j8bvco9>._1j8bvcog{padding-left:3.875rem}._1j8bvco8>._1j8bvco8>._1j8bvco8>._1j8bvco8>._1j8bvco9>._1j8bvcog{padding-left:undefined}._1j8bvco8>._1j8bvco8>._1j8bvcoe>._1j8bvcog{padding-left:2.125rem}._1j8bvco8>._1j8bvco8>._1j8bvco8>._1j8bvcoe>._1j8bvcog{padding-left:3rem}._1j8bvco8>._1j8bvco8>._1j8bvco8>._1j8bvco8>._1j8bvcoe>._1j8bvcog{padding-left:3.875rem}._1j8bvco8>._1j8bvco8>._1j8bvco8>._1j8bvco8>._1j8bvco8>._1j8bvcoe>._1j8bvcog{padding-left:undefined}
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.1",
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.1",
33
- "@sps-woodland/tokens": "8.17.1"
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.1",
42
- "@sps-woodland/tokens": "8.17.1"
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: [vanillaExtractPlugin()],
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"),