@smartyweb/ui 2.2.0-max-storefront-handoff.gc716d21 → 2.2.0-max-storefront-handoff.gd68edbb

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -65,7 +65,6 @@ If a variable is not set, components fall back to `system-ui` (headings/body) or
65
65
  | `/validate-tokens` | Check the library still mirrors Figma — recapture every component's bindings, run the mirror, repair. |
66
66
  | `/version-up` | Cut a new version with changesets (bump, changelog, release prep). |
67
67
  | `/commit-push` | Commit and push all changes with a summary commit message. |
68
- | `/link-ui` | Live-link local `@smartyweb/ui` into storefront-2 so edits show up without publishing. |
69
68
  | `/use-in-storefront` | Carry a component into a storefront-2 page — install, place, gates, preview. |
70
69
 
71
70
  Local commands, for the times you do need to run something by hand:
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),W="_h1_1765w_1",P={h1:W};function k({children:e,className:n}){const s=[P.h1,n].filter(Boolean).join(" ");return t.jsx("h1",{className:s,children:e})}const R="_h2_1eque_1",T={h2:R};function U({children:e}){return t.jsx("h2",{className:T.h2,children:e})}const F="_paragraph_11t85_1",V={paragraph:F};function K({children:e}){return t.jsx("p",{className:V.paragraph,children:e})}const z=typeof process<"u"&&process.env.NODE_ENV!=="production",$=new Set;function N(e){$.has(e)||($.add(e),console.warn(`[@smartyweb/ui] ${e}`))}function G(e){if(typeof e=="string")return`<${e}>`;if(typeof e=="function")return`<${e.name||"Component"}>`;if(typeof e=="object"&&e!==null&&"displayName"in e){const{displayName:n}=e;if(typeof n=="string")return`<${n}>`}return"an unknown element"}function S(e,n){for(const s of l.Children.toArray(e)){if(!l.isValidElement(s)){if(typeof s!="string"&&typeof s!="number")continue;const r=String(s).trim();if(r==="")continue;N(`<UnorderedList> received the text ${JSON.stringify(r.slice(0,40))} as a direct child. A <ul> may only contain list items — wrap it in <ListItem>.`);continue}if(s.type===l.Fragment){const{children:r}=s.props;S(r,n);continue}n(s.type)||s.type==="li"||N(`<UnorderedList> received ${G(s.type)} as a direct child. A <ul> may only contain list items — wrap it in <ListItem>.`)}}function J(){N("<ListItem> was rendered outside of an <UnorderedList>. It renders an <li>, which browsers only style correctly inside a list.")}const X="_list_1p627_1",Z="_item_1p627_14",C={list:X,item:Z},D=l.createContext(!1);function L({children:e}){const n=l.useContext(D);return z&&!n&&J(),t.jsx("li",{className:C.item,children:e})}L.isSmartyListItem=!0;function Q(e){return e===L?!0:typeof e=="function"&&e.isSmartyListItem===!0}function Y({children:e}){return z&&S(e,Q),t.jsx(D,{value:!0,children:t.jsx("ul",{role:"list",className:C.list,children:e})})}const ee="_button_81qo0_1",te="_sm_81qo0_26",ne="_primary_81qo0_33",se="_secondary_81qo0_49",ie="_negative_81qo0_68",v={button:ee,sm:te,primary:ne,secondary:se,negative:ie};function re({as:e="button",variant:n="primary",size:s="default",href:r,openInNewTab:d,disabled:p,type:a,onClick:c,children:u}){const m=[v.button,v[n],s==="sm"&&v.sm].filter(Boolean).join(" ");return t.jsx(e,{className:m,href:r,target:d?"_blank":void 0,rel:d?"noopener noreferrer":void 0,disabled:p,type:a,onClick:c,children:u})}const oe=typeof process<"u"&&process.env.NODE_ENV!=="production",w=new Set;function ae(e){w.has(e)||(w.add(e),console.warn(`[@smartyweb/ui] ${e}`))}function ce(){ae("<SideNav> was rendered with no accessible name. Pass `label` so screen reader users can tell this nav apart from the other navigation landmarks on the page.")}const le="_nav_dxkjl_3",de="_list_dxkjl_7",ue="_item_dxkjl_16",_e="_link_dxkjl_20",me="_current_dxkjl_48",g={nav:le,list:de,item:ue,link:_e,current:me},I=l.createContext(null);function pe({label:e,current:n,children:s}){return oe&&!e?.trim()&&ce(),t.jsx("nav",{className:g.nav,"aria-label":e,children:t.jsx(I,{value:n??null,children:t.jsx("ul",{className:g.list,children:s})})})}function fe({as:e="a",href:n,current:s,openInNewTab:r,onClick:d,children:p}){const a=l.useContext(I),c=s??(a!==null&&a===n),u=[g.link,c&&g.current].filter(Boolean).join(" ");return t.jsx("li",{className:g.item,children:t.jsx(e,{className:u,href:n,target:r?"_blank":void 0,rel:r?"noopener noreferrer":void 0,onClick:d,"aria-current":c?"location":void 0,children:p})})}const he="_hero_93692_11",ge="_layout_93692_16",ye="_content_93692_21",xe="_titleLine_93692_25",ve="_titleWord_93692_29",je="_description_93692_35",Ne="_media_93692_48",h={hero:he,layout:ge,content:ye,titleLine:xe,titleWord:ve,description:je,media:Ne};function Le(e){return e.replace(/([- ])/g,n=>`${n===" "?" ":n}|split|`).split("|split|")}const be=e=>({"--hero-index":e});function $e({title:e,description:n,media:s}){const r=Array.isArray(e);let d=0;const p=(r?e:[e]).map(a=>Le(a).map(c=>({word:c,index:d++})));return t.jsx("section",{className:h.hero,children:t.jsxs("div",{className:h.layout,children:[t.jsx("div",{className:h.media,children:s}),t.jsxs("div",{className:h.content,children:[t.jsx(k,{children:p.map((a,c)=>t.jsx("span",{className:r?h.titleLine:void 0,children:a.map(({word:u,index:_})=>t.jsx("span",{className:h.titleWord,style:be(_),children:u},_))},c))}),t.jsx("p",{className:h.description,children:n})]})]})})}function we(){return t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.58586 8L1.29297 2.70711L2.70718 1.29289L8.00008 6.58579L13.293 1.29289L14.7072 2.70711L9.41429 8L14.7072 13.2929L13.293 14.7071L8.00008 9.41421L2.70718 14.7071L1.29297 13.2929L6.58586 8Z",fill:"currentColor"})})}const ke="_field_7z5g3_1",ze="_error_7z5g3_17",Se="_message_7z5g3_21",Ce="_content_7z5g3_36",De="_reveal_7z5g3_43",Ie="_label_7z5g3_53",Oe="_tags_7z5g3_64",Be="_input_7z5g3_71",Me="_counter_7z5g3_88",qe="_empty_7z5g3_100",Ae="_disabled_7z5g3_127",He="_chip_7z5g3_132",Ee="_chipText_7z5g3_153",We="_remove_7z5g3_158",Pe="_invalid_7z5g3_169",o={field:ke,error:ze,message:Se,content:Ce,reveal:De,label:Ie,tags:Oe,input:Be,counter:Me,empty:qe,disabled:Ae,chip:He,chipText:Ee,remove:We,invalid:Pe};function Re({children:e,invalid:n,onRemove:s}){return t.jsxs("span",{className:[o.chip,n&&o.invalid].filter(Boolean).join(" "),children:[t.jsx("span",{className:o.chipText,children:e}),s&&t.jsx("button",{type:"button",className:o.remove,"aria-label":`Remove ${e}${n?" (invalid)":""}`,onClick:s,children:t.jsx(we,{})})]})}const j=100;function Te({label:e,value:n,onChange:s,disabled:r=!1,isTagInvalid:d,onInputChange:p,error:a}){const c=l.useId(),u=`${c}-message`,_=l.useRef(null),[m,O]=l.useState(""),B=n.length>=j,M=i=>{O(i),p?.(i)},y=i=>{const f=i.split(/[\s,]+/),b=f.pop()??"",x=f.filter(Boolean).slice(0,j-n.length);x.length&&s([...n,...x]),M(b)},q=i=>{i.key==="Enter"&&m&&!i.nativeEvent.isComposing?(i.preventDefault(),y(`${m},`)):i.key==="Backspace"&&!m&&n.length&&s(n.slice(0,-1))},A=i=>{i.preventDefault(),y(`${m}${i.clipboardData.getData("text")},`)},H=i=>{r||i.target===_.current||i.target.closest("button")||(i.preventDefault(),_.current?.focus())},E=[o.field,!n.length&&o.empty,r&&o.disabled,a&&o.error].filter(Boolean).join(" ");return t.jsxs("div",{children:[t.jsxs("div",{className:E,onMouseDown:H,children:[t.jsxs("div",{className:o.content,children:[t.jsx("label",{htmlFor:c,className:o.label,children:e}),t.jsx("div",{className:o.reveal,children:t.jsxs("div",{className:o.tags,children:[n.map((i,f)=>t.jsx(Re,{invalid:d?.(i,f)??!1,onRemove:r?void 0:()=>{s(n.filter((b,x)=>x!==f)),f===n.length-1&&_.current?.focus()},children:i},f)),t.jsx("input",{ref:_,id:c,className:o.input,size:1,value:m,disabled:r,readOnly:B,"aria-invalid":a?!0:void 0,"aria-describedby":a?u:void 0,onChange:i=>{y(i.target.value)},onKeyDown:q,onPaste:A,onBlur:()=>{y(`${m},`)}})]})})]}),t.jsx("div",{className:o.reveal,children:t.jsxs("p",{className:o.counter,children:[n.length," / ",j]})})]}),t.jsx("p",{id:u,className:o.message,"aria-live":"polite",children:a})]})}exports.Button=re;exports.H1=k;exports.H2=U;exports.Hero=$e;exports.ListItem=L;exports.MultitagField=Te;exports.Paragraph=K;exports.SideNav=pe;exports.SideNavLink=fe;exports.UnorderedList=Y;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),E="_h1_1765w_1",W={h1:E};function k({children:e,className:n}){const s=[W.h1,n].filter(Boolean).join(" ");return t.jsx("h1",{className:s,children:e})}const R="_h2_1eque_1",T={h2:R};function U({children:e}){return t.jsx("h2",{className:T.h2,children:e})}const F="_paragraph_11t85_1",P={paragraph:F};function V({children:e}){return t.jsx("p",{className:P.paragraph,children:e})}const z=typeof process<"u"&&process.env.NODE_ENV!=="production",$=new Set;function N(e){$.has(e)||($.add(e),console.warn(`[@smartyweb/ui] ${e}`))}function K(e){if(typeof e=="string")return`<${e}>`;if(typeof e=="function")return`<${e.name||"Component"}>`;if(typeof e=="object"&&e!==null&&"displayName"in e){const{displayName:n}=e;if(typeof n=="string")return`<${n}>`}return"an unknown element"}function S(e,n){for(const s of l.Children.toArray(e)){if(!l.isValidElement(s)){if(typeof s!="string"&&typeof s!="number")continue;const r=String(s).trim();if(r==="")continue;N(`<UnorderedList> received the text ${JSON.stringify(r.slice(0,40))} as a direct child. A <ul> may only contain list items — wrap it in <ListItem>.`);continue}if(s.type===l.Fragment){const{children:r}=s.props;S(r,n);continue}n(s.type)||s.type==="li"||N(`<UnorderedList> received ${K(s.type)} as a direct child. A <ul> may only contain list items — wrap it in <ListItem>.`)}}function G(){N("<ListItem> was rendered outside of an <UnorderedList>. It renders an <li>, which browsers only style correctly inside a list.")}const J="_list_1p627_1",X="_item_1p627_14",C={list:J,item:X},I=l.createContext(!1);function L({children:e}){const n=l.useContext(I);return z&&!n&&G(),t.jsx("li",{className:C.item,children:e})}L.isSmartyListItem=!0;function Z(e){return e===L?!0:typeof e=="function"&&e.isSmartyListItem===!0}function Q({children:e}){return z&&S(e,Z),t.jsx(I,{value:!0,children:t.jsx("ul",{role:"list",className:C.list,children:e})})}const Y="_button_81qo0_1",ee="_sm_81qo0_26",te="_primary_81qo0_33",ne="_secondary_81qo0_49",se="_negative_81qo0_68",v={button:Y,sm:ee,primary:te,secondary:ne,negative:se};function ie({as:e="button",variant:n="primary",size:s="default",href:r,openInNewTab:d,disabled:m,type:a,onClick:c,children:u}){const p=[v.button,v[n],s==="sm"&&v.sm].filter(Boolean).join(" ");return t.jsx(e,{className:p,href:r,target:d?"_blank":void 0,rel:d?"noopener noreferrer":void 0,disabled:m,type:a,onClick:c,children:u})}const re=typeof process<"u"&&process.env.NODE_ENV!=="production",w=new Set;function oe(e){w.has(e)||(w.add(e),console.warn(`[@smartyweb/ui] ${e}`))}function ae(){oe("<SideNav> was rendered with no accessible name. Pass `label` so screen reader users can tell this nav apart from the other navigation landmarks on the page.")}const ce="_nav_dxkjl_3",le="_list_dxkjl_7",de="_item_dxkjl_16",ue="_link_dxkjl_20",_e="_current_dxkjl_48",g={nav:ce,list:le,item:de,link:ue,current:_e},O=l.createContext(null);function me({label:e,current:n,children:s}){return re&&!e?.trim()&&ae(),t.jsx("nav",{className:g.nav,"aria-label":e,children:t.jsx(O,{value:n??null,children:t.jsx("ul",{className:g.list,children:s})})})}function pe({as:e="a",href:n,current:s,openInNewTab:r,onClick:d,children:m}){const a=l.useContext(O),c=s??(a!==null&&a===n),u=[g.link,c&&g.current].filter(Boolean).join(" ");return t.jsx("li",{className:g.item,children:t.jsx(e,{className:u,href:n,target:r?"_blank":void 0,rel:r?"noopener noreferrer":void 0,onClick:d,"aria-current":c?"location":void 0,children:m})})}const fe="_hero_93692_11",he="_layout_93692_16",ge="_content_93692_21",ye="_titleLine_93692_25",xe="_titleWord_93692_29",ve="_description_93692_35",je="_media_93692_48",h={hero:fe,layout:he,content:ge,titleLine:ye,titleWord:xe,description:ve,media:je};function Ne(e){return e.replace(/([- ])/g,n=>`${n===" "?" ":n}|split|`).split("|split|")}const Le=e=>({"--hero-index":e});function be({title:e,description:n,media:s}){const r=Array.isArray(e);let d=0;const m=(r?e:[e]).map(a=>Ne(a).map(c=>({word:c,index:d++})));return t.jsx("section",{className:h.hero,children:t.jsxs("div",{className:h.layout,children:[t.jsx("div",{className:h.media,children:s}),t.jsxs("div",{className:h.content,children:[t.jsx(k,{children:m.map((a,c)=>t.jsx("span",{className:r?h.titleLine:void 0,children:a.map(({word:u,index:_})=>t.jsx("span",{className:h.titleWord,style:Le(_),children:u},_))},c))}),t.jsx("p",{className:h.description,children:n})]})]})})}function $e(){return t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.58586 8L1.29297 2.70711L2.70718 1.29289L8.00008 6.58579L13.293 1.29289L14.7072 2.70711L9.41429 8L14.7072 13.2929L13.293 14.7071L8.00008 9.41421L2.70718 14.7071L1.29297 13.2929L6.58586 8Z",fill:"currentColor"})})}const we="_field_7z5g3_1",ke="_error_7z5g3_17",ze="_message_7z5g3_21",Se="_content_7z5g3_36",Ce="_reveal_7z5g3_43",Ie="_label_7z5g3_53",Oe="_tags_7z5g3_64",Be="_input_7z5g3_71",De="_counter_7z5g3_88",Me="_empty_7z5g3_100",qe="_disabled_7z5g3_127",Ae="_chip_7z5g3_132",He="_chipText_7z5g3_153",Ee="_remove_7z5g3_158",We="_invalid_7z5g3_169",o={field:we,error:ke,message:ze,content:Se,reveal:Ce,label:Ie,tags:Oe,input:Be,counter:De,empty:Me,disabled:qe,chip:Ae,chipText:He,remove:Ee,invalid:We};function Re({children:e,invalid:n,onRemove:s}){return t.jsxs("span",{className:[o.chip,n&&o.invalid].filter(Boolean).join(" "),children:[t.jsx("span",{className:o.chipText,children:e}),s&&t.jsx("button",{type:"button",className:o.remove,"aria-label":`Remove ${e}${n?" (invalid)":""}`,onClick:s,children:t.jsx($e,{})})]})}const j=100;function Te({label:e,value:n,onChange:s,disabled:r=!1,isTagInvalid:d,onInputChange:m,error:a}){const c=l.useId(),u=`${c}-message`,_=l.useRef(null),[p,B]=l.useState(""),D=n.length>=j,M=i=>{B(i),m?.(i)},x=i=>{const f=i.split(/[\s,]+/),b=f.pop()??"",y=f.filter(Boolean).slice(0,Math.max(0,j-n.length));y.length&&s([...n,...y]),M(b)},q=i=>{i.key==="Enter"&&p&&!i.nativeEvent.isComposing?(i.preventDefault(),x(`${p},`)):i.key==="Backspace"&&!p&&n.length&&s(n.slice(0,-1))},A=i=>{r||i.target===_.current||i.target.closest("button")||(i.preventDefault(),_.current?.focus())},H=[o.field,!n.length&&o.empty,r&&o.disabled,a&&o.error].filter(Boolean).join(" ");return t.jsxs("div",{children:[t.jsxs("div",{className:H,onMouseDown:A,children:[t.jsxs("div",{className:o.content,children:[t.jsx("label",{htmlFor:c,className:o.label,children:e}),t.jsx("div",{className:o.reveal,children:t.jsxs("div",{className:o.tags,children:[n.map((i,f)=>t.jsx(Re,{invalid:d?.(i,f)??!1,onRemove:r?void 0:()=>{s(n.filter((b,y)=>y!==f)),f===n.length-1&&_.current?.focus()},children:i},f)),t.jsx("input",{ref:_,id:c,className:o.input,size:1,value:p,disabled:r,readOnly:D,"aria-invalid":a?!0:void 0,"aria-describedby":a?u:void 0,onChange:i=>{x(i.target.value)},onKeyDown:q,onBlur:()=>{x(`${p},`)}})]})})]}),t.jsx("div",{className:o.reveal,children:t.jsxs("p",{className:o.counter,children:[n.length," / ",j]})})]}),t.jsx("p",{id:u,className:o.message,"aria-live":"polite",children:a})]})}exports.Button=ie;exports.H1=k;exports.H2=U;exports.Hero=be;exports.ListItem=L;exports.MultitagField=Te;exports.Paragraph=V;exports.SideNav=me;exports.SideNavLink=pe;exports.UnorderedList=Q;
package/dist/index.js CHANGED
@@ -1,30 +1,30 @@
1
1
  "use client";
2
- import { jsx as n, jsxs as m } from "react/jsx-runtime";
3
- import { Children as R, isValidElement as T, Fragment as U, createContext as k, useContext as z, useId as F, useRef as P, useState as V } from "react";
4
- const K = "_h1_1765w_1", G = {
2
+ import { jsx as n, jsxs as _ } from "react/jsx-runtime";
3
+ import { Children as H, isValidElement as R, Fragment as T, createContext as k, useContext as z, useId as U, useRef as F, useState as V } from "react";
4
+ const K = "_h1_1765w_1", P = {
5
5
  h1: K
6
6
  };
7
- function J({ children: e, className: t }) {
8
- const s = [G.h1, t].filter(Boolean).join(" ");
7
+ function G({ children: e, className: t }) {
8
+ const s = [P.h1, t].filter(Boolean).join(" ");
9
9
  return /* @__PURE__ */ n("h1", { className: s, children: e });
10
10
  }
11
- const X = "_h2_1eque_1", Z = {
12
- h2: X
11
+ const J = "_h2_1eque_1", X = {
12
+ h2: J
13
13
  };
14
14
  function Ve({ children: e }) {
15
- return /* @__PURE__ */ n("h2", { className: Z.h2, children: e });
15
+ return /* @__PURE__ */ n("h2", { className: X.h2, children: e });
16
16
  }
17
- const Q = "_paragraph_11t85_1", Y = {
18
- paragraph: Q
17
+ const Z = "_paragraph_11t85_1", Q = {
18
+ paragraph: Z
19
19
  };
20
20
  function Ke({ children: e }) {
21
- return /* @__PURE__ */ n("p", { className: Y.paragraph, children: e });
21
+ return /* @__PURE__ */ n("p", { className: Q.paragraph, children: e });
22
22
  }
23
23
  const j = typeof process < "u" && process.env.NODE_ENV !== "production", w = /* @__PURE__ */ new Set();
24
24
  function $(e) {
25
25
  w.has(e) || (w.add(e), console.warn(`[@smartyweb/ui] ${e}`));
26
26
  }
27
- function ee(e) {
27
+ function Y(e) {
28
28
  if (typeof e == "string") return `<${e}>`;
29
29
  if (typeof e == "function") return `<${e.name || "Component"}>`;
30
30
  if (typeof e == "object" && e !== null && "displayName" in e) {
@@ -33,9 +33,9 @@ function ee(e) {
33
33
  }
34
34
  return "an unknown element";
35
35
  }
36
- function D(e, t) {
37
- for (const s of R.toArray(e)) {
38
- if (!T(s)) {
36
+ function C(e, t) {
37
+ for (const s of H.toArray(e)) {
38
+ if (!R(s)) {
39
39
  if (typeof s != "string" && typeof s != "number") continue;
40
40
  const r = String(s).trim();
41
41
  if (r === "") continue;
@@ -44,98 +44,98 @@ function D(e, t) {
44
44
  );
45
45
  continue;
46
46
  }
47
- if (s.type === U) {
47
+ if (s.type === T) {
48
48
  const { children: r } = s.props;
49
- D(r, t);
49
+ C(r, t);
50
50
  continue;
51
51
  }
52
52
  t(s.type) || s.type === "li" || $(
53
- `<UnorderedList> received ${ee(s.type)} as a direct child. A <ul> may only contain list items — wrap it in <ListItem>.`
53
+ `<UnorderedList> received ${Y(s.type)} as a direct child. A <ul> may only contain list items — wrap it in <ListItem>.`
54
54
  );
55
55
  }
56
56
  }
57
- function te() {
57
+ function ee() {
58
58
  $(
59
59
  "<ListItem> was rendered outside of an <UnorderedList>. It renders an <li>, which browsers only style correctly inside a list."
60
60
  );
61
61
  }
62
- const ne = "_list_1p627_1", se = "_item_1p627_14", C = {
63
- list: ne,
64
- item: se
65
- }, I = k(!1);
66
- function O({ children: e }) {
67
- const t = z(I);
68
- return j && !t && te(), /* @__PURE__ */ n("li", { className: C.item, children: e });
62
+ const te = "_list_1p627_1", ne = "_item_1p627_14", I = {
63
+ list: te,
64
+ item: ne
65
+ }, O = k(!1);
66
+ function S({ children: e }) {
67
+ const t = z(O);
68
+ return j && !t && ee(), /* @__PURE__ */ n("li", { className: I.item, children: e });
69
69
  }
70
- O.isSmartyListItem = !0;
71
- function ie(e) {
72
- return e === O ? !0 : typeof e == "function" && e.isSmartyListItem === !0;
70
+ S.isSmartyListItem = !0;
71
+ function se(e) {
72
+ return e === S ? !0 : typeof e == "function" && e.isSmartyListItem === !0;
73
73
  }
74
- function Ge({ children: e }) {
75
- return j && D(e, ie), /* @__PURE__ */ n(I, { value: !0, children: /* @__PURE__ */ n("ul", { role: "list", className: C.list, children: e }) });
74
+ function Pe({ children: e }) {
75
+ return j && C(e, se), /* @__PURE__ */ n(O, { value: !0, children: /* @__PURE__ */ n("ul", { role: "list", className: I.list, children: e }) });
76
76
  }
77
- const re = "_button_81qo0_1", oe = "_sm_81qo0_26", ae = "_primary_81qo0_33", ce = "_secondary_81qo0_49", le = "_negative_81qo0_68", N = {
78
- button: re,
79
- sm: oe,
80
- primary: ae,
81
- secondary: ce,
82
- negative: le
77
+ const ie = "_button_81qo0_1", re = "_sm_81qo0_26", oe = "_primary_81qo0_33", ae = "_secondary_81qo0_49", ce = "_negative_81qo0_68", N = {
78
+ button: ie,
79
+ sm: re,
80
+ primary: oe,
81
+ secondary: ae,
82
+ negative: ce
83
83
  };
84
- function Je({
84
+ function Ge({
85
85
  as: e = "button",
86
86
  variant: t = "primary",
87
87
  size: s = "default",
88
88
  href: r,
89
89
  openInNewTab: l,
90
- disabled: p,
90
+ disabled: m,
91
91
  type: a,
92
92
  onClick: c,
93
93
  children: d
94
94
  }) {
95
- const _ = [N.button, N[t], s === "sm" && N.sm].filter(Boolean).join(" ");
95
+ const p = [N.button, N[t], s === "sm" && N.sm].filter(Boolean).join(" ");
96
96
  return /* @__PURE__ */ n(
97
97
  e,
98
98
  {
99
- className: _,
99
+ className: p,
100
100
  href: r,
101
101
  target: l ? "_blank" : void 0,
102
102
  rel: l ? "noopener noreferrer" : void 0,
103
- disabled: p,
103
+ disabled: m,
104
104
  type: a,
105
105
  onClick: c,
106
106
  children: d
107
107
  }
108
108
  );
109
109
  }
110
- const de = typeof process < "u" && process.env.NODE_ENV !== "production", x = /* @__PURE__ */ new Set();
111
- function ue(e) {
110
+ const le = typeof process < "u" && process.env.NODE_ENV !== "production", x = /* @__PURE__ */ new Set();
111
+ function de(e) {
112
112
  x.has(e) || (x.add(e), console.warn(`[@smartyweb/ui] ${e}`));
113
113
  }
114
- function _e() {
115
- ue(
114
+ function ue() {
115
+ de(
116
116
  "<SideNav> was rendered with no accessible name. Pass `label` so screen reader users can tell this nav apart from the other navigation landmarks on the page."
117
117
  );
118
118
  }
119
- const me = "_nav_dxkjl_3", pe = "_list_dxkjl_7", fe = "_item_dxkjl_16", he = "_link_dxkjl_20", ge = "_current_dxkjl_48", g = {
120
- nav: me,
121
- list: pe,
122
- item: fe,
123
- link: he,
124
- current: ge
125
- }, S = k(null);
126
- function Xe({ label: e, current: t, children: s }) {
127
- return de && !e?.trim() && _e(), /* @__PURE__ */ n("nav", { className: g.nav, "aria-label": e, children: /* @__PURE__ */ n(S, { value: t ?? null, children: /* @__PURE__ */ n("ul", { className: g.list, children: s }) }) });
119
+ const _e = "_nav_dxkjl_3", me = "_list_dxkjl_7", pe = "_item_dxkjl_16", fe = "_link_dxkjl_20", he = "_current_dxkjl_48", y = {
120
+ nav: _e,
121
+ list: me,
122
+ item: pe,
123
+ link: fe,
124
+ current: he
125
+ }, B = k(null);
126
+ function Je({ label: e, current: t, children: s }) {
127
+ return le && !e?.trim() && ue(), /* @__PURE__ */ n("nav", { className: y.nav, "aria-label": e, children: /* @__PURE__ */ n(B, { value: t ?? null, children: /* @__PURE__ */ n("ul", { className: y.list, children: s }) }) });
128
128
  }
129
- function Ze({
129
+ function Xe({
130
130
  as: e = "a",
131
131
  href: t,
132
132
  current: s,
133
133
  openInNewTab: r,
134
134
  onClick: l,
135
- children: p
135
+ children: m
136
136
  }) {
137
- const a = z(S), c = s ?? (a !== null && a === t), d = [g.link, c && g.current].filter(Boolean).join(" ");
138
- return /* @__PURE__ */ n("li", { className: g.item, children: /* @__PURE__ */ n(
137
+ const a = z(B), c = s ?? (a !== null && a === t), d = [y.link, c && y.current].filter(Boolean).join(" ");
138
+ return /* @__PURE__ */ n("li", { className: y.item, children: /* @__PURE__ */ n(
139
139
  e,
140
140
  {
141
141
  className: d,
@@ -144,38 +144,38 @@ function Ze({
144
144
  rel: r ? "noopener noreferrer" : void 0,
145
145
  onClick: l,
146
146
  "aria-current": c ? "location" : void 0,
147
- children: p
147
+ children: m
148
148
  }
149
149
  ) });
150
150
  }
151
- const ye = "_hero_93692_11", ve = "_layout_93692_16", Ne = "_content_93692_21", Le = "_titleLine_93692_25", $e = "_titleWord_93692_29", be = "_description_93692_35", we = "_media_93692_48", h = {
151
+ const ye = "_hero_93692_11", ge = "_layout_93692_16", ve = "_content_93692_21", Ne = "_titleLine_93692_25", Le = "_titleWord_93692_29", $e = "_description_93692_35", be = "_media_93692_48", h = {
152
152
  hero: ye,
153
- layout: ve,
154
- content: Ne,
155
- titleLine: Le,
156
- titleWord: $e,
157
- description: be,
158
- media: we
153
+ layout: ge,
154
+ content: ve,
155
+ titleLine: Ne,
156
+ titleWord: Le,
157
+ description: $e,
158
+ media: be
159
159
  };
160
- function xe(e) {
160
+ function we(e) {
161
161
  return e.replace(/([- ])/g, (t) => `${t === " " ? " " : t}|split|`).split("|split|");
162
162
  }
163
- const ke = (e) => ({ "--hero-index": e });
164
- function Qe({ title: e, description: t, media: s }) {
163
+ const xe = (e) => ({ "--hero-index": e });
164
+ function Ze({ title: e, description: t, media: s }) {
165
165
  const r = Array.isArray(e);
166
166
  let l = 0;
167
- const p = (r ? e : [e]).map(
168
- (a) => xe(a).map((c) => ({ word: c, index: l++ }))
167
+ const m = (r ? e : [e]).map(
168
+ (a) => we(a).map((c) => ({ word: c, index: l++ }))
169
169
  );
170
- return /* @__PURE__ */ n("section", { className: h.hero, children: /* @__PURE__ */ m("div", { className: h.layout, children: [
170
+ return /* @__PURE__ */ n("section", { className: h.hero, children: /* @__PURE__ */ _("div", { className: h.layout, children: [
171
171
  /* @__PURE__ */ n("div", { className: h.media, children: s }),
172
- /* @__PURE__ */ m("div", { className: h.content, children: [
173
- /* @__PURE__ */ n(J, { children: p.map((a, c) => /* @__PURE__ */ n("span", { className: r ? h.titleLine : void 0, children: a.map(({ word: d, index: u }) => /* @__PURE__ */ n("span", { className: h.titleWord, style: ke(u), children: d }, u)) }, c)) }),
172
+ /* @__PURE__ */ _("div", { className: h.content, children: [
173
+ /* @__PURE__ */ n(G, { children: m.map((a, c) => /* @__PURE__ */ n("span", { className: r ? h.titleLine : void 0, children: a.map(({ word: d, index: u }) => /* @__PURE__ */ n("span", { className: h.titleWord, style: xe(u), children: d }, u)) }, c)) }),
174
174
  /* @__PURE__ */ n("p", { className: h.description, children: t })
175
175
  ] })
176
176
  ] }) });
177
177
  }
178
- function ze() {
178
+ function ke() {
179
179
  return /* @__PURE__ */ n("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ n(
180
180
  "path",
181
181
  {
@@ -186,25 +186,25 @@ function ze() {
186
186
  }
187
187
  ) });
188
188
  }
189
- const je = "_field_7z5g3_1", De = "_error_7z5g3_17", Ce = "_message_7z5g3_21", Ie = "_content_7z5g3_36", Oe = "_reveal_7z5g3_43", Se = "_label_7z5g3_53", Be = "_tags_7z5g3_64", Ae = "_input_7z5g3_71", Ee = "_counter_7z5g3_88", Me = "_empty_7z5g3_100", We = "_disabled_7z5g3_127", qe = "_chip_7z5g3_132", He = "_chipText_7z5g3_153", Re = "_remove_7z5g3_158", Te = "_invalid_7z5g3_169", o = {
190
- field: je,
191
- error: De,
189
+ const ze = "_field_7z5g3_1", je = "_error_7z5g3_17", Ce = "_message_7z5g3_21", Ie = "_content_7z5g3_36", Oe = "_reveal_7z5g3_43", Se = "_label_7z5g3_53", Be = "_tags_7z5g3_64", De = "_input_7z5g3_71", Ae = "_counter_7z5g3_88", Me = "_empty_7z5g3_100", Ee = "_disabled_7z5g3_127", We = "_chip_7z5g3_132", qe = "_chipText_7z5g3_153", He = "_remove_7z5g3_158", Re = "_invalid_7z5g3_169", o = {
190
+ field: ze,
191
+ error: je,
192
192
  message: Ce,
193
193
  content: Ie,
194
194
  reveal: Oe,
195
195
  label: Se,
196
196
  tags: Be,
197
- input: Ae,
198
- counter: Ee,
197
+ input: De,
198
+ counter: Ae,
199
199
  empty: Me,
200
- disabled: We,
201
- chip: qe,
202
- chipText: He,
203
- remove: Re,
204
- invalid: Te
200
+ disabled: Ee,
201
+ chip: We,
202
+ chipText: qe,
203
+ remove: He,
204
+ invalid: Re
205
205
  };
206
- function Ue({ children: e, invalid: t, onRemove: s }) {
207
- return /* @__PURE__ */ m("span", { className: [o.chip, t && o.invalid].filter(Boolean).join(" "), children: [
206
+ function Te({ children: e, invalid: t, onRemove: s }) {
207
+ return /* @__PURE__ */ _("span", { className: [o.chip, t && o.invalid].filter(Boolean).join(" "), children: [
208
208
  /* @__PURE__ */ n("span", { className: o.chipText, children: e }),
209
209
  s && /* @__PURE__ */ n(
210
210
  "button",
@@ -213,49 +213,47 @@ function Ue({ children: e, invalid: t, onRemove: s }) {
213
213
  className: o.remove,
214
214
  "aria-label": `Remove ${e}${t ? " (invalid)" : ""}`,
215
215
  onClick: s,
216
- children: /* @__PURE__ */ n(ze, {})
216
+ children: /* @__PURE__ */ n(ke, {})
217
217
  }
218
218
  )
219
219
  ] });
220
220
  }
221
221
  const L = 100;
222
- function Ye({
222
+ function Qe({
223
223
  label: e,
224
224
  value: t,
225
225
  onChange: s,
226
226
  disabled: r = !1,
227
227
  isTagInvalid: l,
228
- onInputChange: p,
228
+ onInputChange: m,
229
229
  error: a
230
230
  }) {
231
- const c = F(), d = `${c}-message`, u = P(null), [_, B] = V(""), A = t.length >= L, E = (i) => {
232
- B(i), p?.(i);
233
- }, y = (i) => {
234
- const f = i.split(/[\s,]+/), b = f.pop() ?? "", v = f.filter(Boolean).slice(0, L - t.length);
235
- v.length && s([...t, ...v]), E(b);
236
- }, M = (i) => {
237
- i.key === "Enter" && _ && !i.nativeEvent.isComposing ? (i.preventDefault(), y(`${_},`)) : i.key === "Backspace" && !_ && t.length && s(t.slice(0, -1));
231
+ const c = U(), d = `${c}-message`, u = F(null), [p, D] = V(""), A = t.length >= L, M = (i) => {
232
+ D(i), m?.(i);
233
+ }, v = (i) => {
234
+ const f = i.split(/[\s,]+/), b = f.pop() ?? "", g = f.filter(Boolean).slice(0, Math.max(0, L - t.length));
235
+ g.length && s([...t, ...g]), M(b);
236
+ }, E = (i) => {
237
+ i.key === "Enter" && p && !i.nativeEvent.isComposing ? (i.preventDefault(), v(`${p},`)) : i.key === "Backspace" && !p && t.length && s(t.slice(0, -1));
238
238
  }, W = (i) => {
239
- i.preventDefault(), y(`${_}${i.clipboardData.getData("text")},`);
240
- }, q = (i) => {
241
239
  r || i.target === u.current || i.target.closest("button") || (i.preventDefault(), u.current?.focus());
242
- }, H = [
240
+ }, q = [
243
241
  o.field,
244
242
  !t.length && o.empty,
245
243
  r && o.disabled,
246
244
  a && o.error
247
245
  ].filter(Boolean).join(" ");
248
- return /* @__PURE__ */ m("div", { children: [
249
- /* @__PURE__ */ m("div", { className: H, onMouseDown: q, children: [
250
- /* @__PURE__ */ m("div", { className: o.content, children: [
246
+ return /* @__PURE__ */ _("div", { children: [
247
+ /* @__PURE__ */ _("div", { className: q, onMouseDown: W, children: [
248
+ /* @__PURE__ */ _("div", { className: o.content, children: [
251
249
  /* @__PURE__ */ n("label", { htmlFor: c, className: o.label, children: e }),
252
- /* @__PURE__ */ n("div", { className: o.reveal, children: /* @__PURE__ */ m("div", { className: o.tags, children: [
250
+ /* @__PURE__ */ n("div", { className: o.reveal, children: /* @__PURE__ */ _("div", { className: o.tags, children: [
253
251
  t.map((i, f) => /* @__PURE__ */ n(
254
- Ue,
252
+ Te,
255
253
  {
256
254
  invalid: l?.(i, f) ?? !1,
257
255
  onRemove: r ? void 0 : () => {
258
- s(t.filter((b, v) => v !== f)), f === t.length - 1 && u.current?.focus();
256
+ s(t.filter((b, g) => g !== f)), f === t.length - 1 && u.current?.focus();
259
257
  },
260
258
  children: i
261
259
  },
@@ -268,24 +266,23 @@ function Ye({
268
266
  id: c,
269
267
  className: o.input,
270
268
  size: 1,
271
- value: _,
269
+ value: p,
272
270
  disabled: r,
273
271
  readOnly: A,
274
272
  "aria-invalid": a ? !0 : void 0,
275
273
  "aria-describedby": a ? d : void 0,
276
274
  onChange: (i) => {
277
- y(i.target.value);
275
+ v(i.target.value);
278
276
  },
279
- onKeyDown: M,
280
- onPaste: W,
277
+ onKeyDown: E,
281
278
  onBlur: () => {
282
- y(`${_},`);
279
+ v(`${p},`);
283
280
  }
284
281
  }
285
282
  )
286
283
  ] }) })
287
284
  ] }),
288
- /* @__PURE__ */ n("div", { className: o.reveal, children: /* @__PURE__ */ m("p", { className: o.counter, children: [
285
+ /* @__PURE__ */ n("div", { className: o.reveal, children: /* @__PURE__ */ _("p", { className: o.counter, children: [
289
286
  t.length,
290
287
  " / ",
291
288
  L
@@ -295,14 +292,14 @@ function Ye({
295
292
  ] });
296
293
  }
297
294
  export {
298
- Je as Button,
299
- J as H1,
295
+ Ge as Button,
296
+ G as H1,
300
297
  Ve as H2,
301
- Qe as Hero,
302
- O as ListItem,
303
- Ye as MultitagField,
298
+ Ze as Hero,
299
+ S as ListItem,
300
+ Qe as MultitagField,
304
301
  Ke as Paragraph,
305
- Xe as SideNav,
306
- Ze as SideNavLink,
307
- Ge as UnorderedList
302
+ Je as SideNav,
303
+ Xe as SideNavLink,
304
+ Pe as UnorderedList
308
305
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartyweb/ui",
3
- "version": "2.2.0-max-storefront-handoff.gc716d21",
3
+ "version": "2.2.0-max-storefront-handoff.gd68edbb",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",