@solibo/solibo-ui 1.1.7 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/assets/index10.css +1 -1
  2. package/dist/assets/index11.css +1 -1
  3. package/dist/assets/index12.css +1 -1
  4. package/dist/assets/index13.css +1 -1
  5. package/dist/assets/index14.css +1 -1
  6. package/dist/assets/index15.css +1 -1
  7. package/dist/assets/index16.css +1 -1
  8. package/dist/assets/index17.css +1 -1
  9. package/dist/assets/index18.css +1 -1
  10. package/dist/assets/index19.css +1 -0
  11. package/dist/assets/index20.css +0 -1
  12. package/dist/assets/index21.css +1 -1
  13. package/dist/assets/index22.css +1 -1
  14. package/dist/assets/index23.css +1 -1
  15. package/dist/assets/index24.css +1 -1
  16. package/dist/assets/index25.css +1 -1
  17. package/dist/assets/index26.css +1 -1
  18. package/dist/assets/index27.css +1 -1
  19. package/dist/assets/index28.css +1 -1
  20. package/dist/assets/index29.css +1 -1
  21. package/dist/assets/index30.css +1 -1
  22. package/dist/assets/index31.css +1 -1
  23. package/dist/assets/index32.css +1 -1
  24. package/dist/assets/index33.css +1 -1
  25. package/dist/assets/index34.css +1 -1
  26. package/dist/assets/index35.css +1 -1
  27. package/dist/assets/index36.css +1 -1
  28. package/dist/assets/index37.css +1 -1
  29. package/dist/assets/index38.css +1 -1
  30. package/dist/assets/index39.css +1 -1
  31. package/dist/assets/index40.css +1 -1
  32. package/dist/assets/index41.css +1 -1
  33. package/dist/assets/index42.css +1 -1
  34. package/dist/assets/index43.css +1 -1
  35. package/dist/assets/index44.css +1 -1
  36. package/dist/assets/index45.css +1 -1
  37. package/dist/assets/index46.css +1 -1
  38. package/dist/assets/index47.css +1 -1
  39. package/dist/assets/index48.css +1 -1
  40. package/dist/assets/index49.css +1 -1
  41. package/dist/assets/index50.css +1 -1
  42. package/dist/assets/index51.css +1 -1
  43. package/dist/assets/index52.css +1 -0
  44. package/dist/assets/index53.css +1 -0
  45. package/dist/assets/index54.css +1 -0
  46. package/dist/assets/index9.css +1 -1
  47. package/dist/components/app-link/index.cjs +1 -1
  48. package/dist/components/app-link/index.js +1 -1
  49. package/dist/components/app-shell/index.cjs +2 -0
  50. package/dist/components/app-shell/index.cjs.map +1 -0
  51. package/dist/components/app-shell/index.js +18 -0
  52. package/dist/components/app-shell/index.js.map +1 -0
  53. package/dist/components/aside/index.cjs +1 -1
  54. package/dist/components/aside/index.js +1 -1
  55. package/dist/components/avatar/index.cjs +1 -1
  56. package/dist/components/avatar/index.js +1 -1
  57. package/dist/components/badge/index.cjs +1 -1
  58. package/dist/components/badge/index.js +1 -1
  59. package/dist/components/banner/index.cjs +1 -1
  60. package/dist/components/banner/index.js +1 -1
  61. package/dist/components/branding/index.cjs +1 -1
  62. package/dist/components/branding/index.js +1 -1
  63. package/dist/components/button/index.cjs +1 -1
  64. package/dist/components/button/index.js +1 -1
  65. package/dist/components/card/index.cjs +1 -1
  66. package/dist/components/card/index.js +1 -1
  67. package/dist/components/checkbox/index.cjs +1 -1
  68. package/dist/components/checkbox/index.js +1 -1
  69. package/dist/components/chip/index.cjs +1 -1
  70. package/dist/components/chip/index.js +1 -1
  71. package/dist/components/collapsible/index.cjs +1 -1
  72. package/dist/components/collapsible/index.js +1 -1
  73. package/dist/components/controls/index.cjs +1 -1
  74. package/dist/components/controls/index.js +1 -1
  75. package/dist/components/croppable/index.cjs +1 -1
  76. package/dist/components/croppable/index.js +1 -1
  77. package/dist/components/dialog/index.cjs +1 -1
  78. package/dist/components/dialog/index.js +1 -1
  79. package/dist/components/divider/index.cjs +2 -0
  80. package/dist/components/divider/index.cjs.map +1 -0
  81. package/dist/components/divider/index.js +12 -0
  82. package/dist/components/divider/index.js.map +1 -0
  83. package/dist/components/dropdown/index.cjs +1 -1
  84. package/dist/components/dropdown/index.js +3 -3
  85. package/dist/components/dropzone/index.cjs +1 -1
  86. package/dist/components/dropzone/index.js +1 -1
  87. package/dist/components/editor/index.cjs +1 -1
  88. package/dist/components/editor/index.js +2 -2
  89. package/dist/components/empty-state/index.cjs +1 -1
  90. package/dist/components/empty-state/index.js +1 -1
  91. package/dist/components/fieldset/index.cjs +1 -1
  92. package/dist/components/fieldset/index.js +1 -1
  93. package/dist/components/figure/index.cjs +1 -1
  94. package/dist/components/figure/index.js +1 -1
  95. package/dist/components/file/index.cjs +1 -1
  96. package/dist/components/file/index.js +1 -1
  97. package/dist/components/footer/index.cjs +1 -1
  98. package/dist/components/footer/index.js +1 -1
  99. package/dist/components/form/index.cjs +1 -1
  100. package/dist/components/form/index.js +1 -1
  101. package/dist/components/graph/index.cjs +1 -1
  102. package/dist/components/graph/index.js +1 -1
  103. package/dist/components/group/index.cjs +1 -1
  104. package/dist/components/group/index.js +1 -1
  105. package/dist/components/header/index.cjs +1 -1
  106. package/dist/components/header/index.js +1 -1
  107. package/dist/components/icon/index.cjs +1 -1
  108. package/dist/components/icon/index.js +1 -1
  109. package/dist/components/iframe/index.cjs +1 -1
  110. package/dist/components/iframe/index.js +1 -1
  111. package/dist/components/image/index.cjs +1 -1
  112. package/dist/components/image/index.js +1 -1
  113. package/dist/components/input/index.cjs +1 -1
  114. package/dist/components/input/index.js +1 -1
  115. package/dist/components/link/index.cjs +1 -1
  116. package/dist/components/link/index.js +1 -1
  117. package/dist/components/list/index.cjs +1 -1
  118. package/dist/components/list/index.js +1 -1
  119. package/dist/components/loading/index.cjs +1 -1
  120. package/dist/components/loading/index.js +1 -1
  121. package/dist/components/message/index.cjs +1 -1
  122. package/dist/components/message/index.js +1 -1
  123. package/dist/components/messages/index.cjs +1 -1
  124. package/dist/components/messages/index.js +1 -1
  125. package/dist/components/nav/index.cjs +1 -1
  126. package/dist/components/nav/index.cjs.map +1 -1
  127. package/dist/components/nav/index.js +47 -34
  128. package/dist/components/nav/index.js.map +1 -1
  129. package/dist/components/object/index.cjs +1 -1
  130. package/dist/components/object/index.js +1 -1
  131. package/dist/components/page-layout/index.cjs +2 -0
  132. package/dist/components/page-layout/index.cjs.map +1 -0
  133. package/dist/components/page-layout/index.js +23 -0
  134. package/dist/components/page-layout/index.js.map +1 -0
  135. package/dist/components/popover/index.cjs +1 -1
  136. package/dist/components/popover/index.js +1 -1
  137. package/dist/components/search/index.cjs +1 -1
  138. package/dist/components/search/index.js +1 -1
  139. package/dist/components/select/index.cjs +1 -1
  140. package/dist/components/select/index.js +1 -1
  141. package/dist/components/toolbar/index.cjs +1 -1
  142. package/dist/components/toolbar/index.js +1 -1
  143. package/dist/components/tooltip/index.cjs +1 -1
  144. package/dist/components/tooltip/index.js +1 -1
  145. package/dist/{index-CwIzKfBo.js → index-BLb3JiCr.js} +2 -2
  146. package/dist/{index-CwIzKfBo.js.map → index-BLb3JiCr.js.map} +1 -1
  147. package/dist/{index-CXaYq0By.cjs → index-Bt7vnwji.cjs} +2 -2
  148. package/dist/{index-CXaYq0By.cjs.map → index-Bt7vnwji.cjs.map} +1 -1
  149. package/dist/index-CQlMdqOp.cjs +2 -0
  150. package/dist/index-CQlMdqOp.cjs.map +1 -0
  151. package/dist/index-CbJ2-IPc.js +83 -0
  152. package/dist/index-CbJ2-IPc.js.map +1 -0
  153. package/dist/index.cjs +1 -1
  154. package/dist/index.d.ts +29 -2
  155. package/dist/index.js +109 -102
  156. package/dist/index.js.map +1 -1
  157. package/dist/tokens.json +1 -1
  158. package/package.json +1 -1
  159. package/dist/index-5yOssOic.cjs +0 -2
  160. package/dist/index-5yOssOic.cjs.map +0 -1
  161. package/dist/index-Cv6TtBnd.js +0 -76
  162. package/dist/index-Cv6TtBnd.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index12.css');const o=require("react/jsx-runtime"),r=require("../../classix-5H4IWnMA.cjs"),p=require("react"),h=require("../../icons-Dv_p0bUF.cjs"),v="_nav_1hgi7_3",f="_label_1hgi7_9",g="_horizontal_1hgi7_17",m="_sidebar_1hgi7_27",w="_tabs_1hgi7_66",N="_pills_1hgi7_86",t={nav:v,label:f,horizontal:g,sidebar:m,tabs:w,pills:N},x={default:t.default,pills:t.pills,sidebar:t.sidebar,tabs:t.tabs},j=({className:e,...n})=>o.jsx("span",{className:r.t(e,t.label),...n,"data-component":"navlabel"}),q=({animation:e,children:n,className:c,horizontal:i=!1,variant:s="default",...d})=>{const[b,l]=p.useState(!1),u={"--icon-svg":h.iconSVG("CaretDown")};return o.jsx("nav",{className:r.t(c,i&&t.horizontal,t.nav,x[s]),"data-animation":e,"data-open":b?"true":"false","data-orientation":i?"horizontal":"vertical",onBlurCapture:a=>{if(s!=="pills"||window.innerWidth>960)return;const _=a.relatedTarget;a.currentTarget.contains(_)||l(!1)},onClick:()=>{s!=="pills"||window.innerWidth>960||l(a=>!a)},style:u,...d,"data-component":"nav",children:n})};exports.Nav=q;exports.NavLabel=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index13.css');const l=require("react/jsx-runtime"),c=require("../../classix-5H4IWnMA.cjs"),b=require("react"),m=require("../../icons-Dv_p0bUF.cjs"),v="_nav_1h1i0_3",p="_label_1h1i0_9",g="_item_1h1i0_17",f="_actions_1h1i0_36",N="_highlighted_1h1i0_48",x="_horizontal_1h1i0_52",j="_sidebar_1h1i0_62",w="_tabs_1h1i0_101",q="_pills_1h1i0_121",t={nav:v,label:p,item:g,actions:f,highlighted:N,horizontal:x,sidebar:j,tabs:w,pills:q},y={default:t.default,pills:t.pills,sidebar:t.sidebar,tabs:t.tabs},z=({className:a,...e})=>l.jsx("span",{className:c.t(a,t.label),...e,"data-component":"navlabel"}),S=({actions:a,children:e,className:o,highlighted:n=!1,...s})=>l.jsxs("div",{className:c.t(t.item,n&&t.highlighted,o),"data-nav-item":!0,...s,"data-component":"navitem",children:[e,a&&l.jsx("span",{className:t.actions,children:a})]}),C=({animation:a,children:e,className:o,horizontal:n=!1,variant:s="default",...h})=>{const[d,r]=b.useState(!1),_={"--icon-svg":m.iconSVG("CaretDown")};return l.jsx("nav",{className:c.t(o,n&&t.horizontal,t.nav,y[s]),"data-animation":a,"data-open":d?"true":"false","data-orientation":n?"horizontal":"vertical",onBlurCapture:i=>{if(s!=="pills"||window.innerWidth>960)return;const u=i.relatedTarget;i.currentTarget.contains(u)||r(!1)},onClick:()=>{s!=="pills"||window.innerWidth>960||r(i=>!i)},style:_,...h,"data-component":"nav",children:e})};exports.Nav=C;exports.NavItem=S;exports.NavLabel=z;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/nav/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { useState } from 'react';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\n\nimport styles from './styles.module.css';\n\nconst variants = {\n default: styles.default,\n pills: styles.pills,\n sidebar: styles.sidebar,\n tabs: styles.tabs,\n};\n\nexport type NavProps = React.HTMLAttributes<HTMLElement> & {\n animation?: string;\n children?: React.ReactNode;\n className?: string;\n horizontal?: boolean;\n variant?: keyof typeof variants;\n};\n\nexport type NavLabelProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const NavLabel = ({ className, ...props }: NavLabelProps) => (\n <span\n className={cx(className, styles.label)}\n {...props}\n />\n);\n\nexport const Nav = ({\n animation,\n children,\n className,\n horizontal = false,\n variant = 'default',\n ...props\n}: NavProps) => {\n const [open, setOpen] = useState(false);\n\n type withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n };\n const withVars: withVars = {\n '--icon-svg': iconSVG('CaretDown'),\n };\n\n return (\n <nav\n className={cx(className, horizontal && styles.horizontal, styles.nav, variants[variant])}\n data-animation={animation}\n data-open={open ? 'true' : 'false'}\n data-orientation={horizontal ? 'horizontal' : 'vertical'}\n onBlurCapture={(e) => {\n if (variant !== 'pills' || window.innerWidth > 960) return;\n\n const next = e.relatedTarget as Node | null;\n if (!e.currentTarget.contains(next)) {\n setOpen(false);\n }\n }}\n onClick={() => {\n if (variant !== 'pills' || window.innerWidth > 960) return;\n\n setOpen((v) => !v);\n }}\n style={withVars}\n {...props}\n >\n {children}\n </nav>\n );\n};\n"],"names":["variants","default","styles","pills","sidebar","tabs","NavLabel","className","props","jsx","cx","label","Nav","animation","children","horizontal","variant","open","setOpen","useState","withVars","iconSVG","nav","e","window","innerWidth","next","relatedTarget","currentTarget","contains","v"],"mappings":"wYAOMA,EAAW,CACfC,QAASC,EAAOD,QAChBE,MAAOD,EAAOC,MACdC,QAASF,EAAOE,QAChBC,KAAMH,EAAOG,IACf,EAYaC,EAAWA,CAAC,CAAEC,UAAAA,EAAW,GAAGC,CAAqB,IAC5DC,MAAC,OAAA,CACC,UAAWC,EAAAA,EAAGH,EAAWL,EAAOS,KAAK,EACrC,GAAIH,EAAM,iBAAA,UAAA,CAAA,EAIDI,EAAMA,CAAC,CAClBC,UAAAA,EACAC,SAAAA,EACAP,UAAAA,EACAQ,WAAAA,EAAa,GACbC,QAAAA,EAAU,UACV,GAAGR,CACK,IAAM,CACd,KAAM,CAACS,EAAMC,CAAO,EAAIC,EAAAA,SAAS,EAAK,EAKhCC,EAAqB,CACzB,aAAcC,EAAAA,QAAQ,WAAW,CAAA,EAGnC,OACEZ,EAAAA,IAAC,MAAA,CACC,UAAWC,EAAAA,EAAGH,EAAWQ,GAAcb,EAAOa,WAAYb,EAAOoB,IAAKtB,EAASgB,CAAO,CAAC,EACvF,iBAAgBH,EAChB,YAAWI,EAAO,OAAS,QAC3B,mBAAkBF,EAAa,aAAe,WAC9C,cAAgBQ,GAAM,CACpB,GAAIP,IAAY,SAAWQ,OAAOC,WAAa,IAAK,OAEpD,MAAMC,EAAOH,EAAEI,cACVJ,EAAEK,cAAcC,SAASH,CAAI,GAChCR,EAAQ,EAAK,CAEjB,EACA,QAAS,IAAM,CACTF,IAAY,SAAWQ,OAAOC,WAAa,KAE/CP,EAASY,GAAM,CAACA,CAAC,CACnB,EACA,MAAOV,EACP,GAAIZ,EAAM,iBAAA,MAETM,SAAAA,EACH,CAEJ"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/nav/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { useState } from 'react';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\n\nimport styles from './styles.module.css';\n\nconst variants = {\n default: styles.default,\n pills: styles.pills,\n sidebar: styles.sidebar,\n tabs: styles.tabs,\n};\n\nexport type NavProps = React.HTMLAttributes<HTMLElement> & {\n animation?: string;\n children?: React.ReactNode;\n className?: string;\n horizontal?: boolean;\n variant?: keyof typeof variants;\n};\n\nexport type NavLabelProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport type NavItemProps = React.HTMLAttributes<HTMLDivElement> & {\n actions?: React.ReactNode;\n highlighted?: boolean;\n};\n\nexport const NavLabel = ({ className, ...props }: NavLabelProps) => (\n <span\n className={cx(className, styles.label)}\n {...props}\n />\n);\n\nexport const NavItem = ({\n actions,\n children,\n className,\n highlighted = false,\n ...props\n}: NavItemProps) => (\n <div\n className={cx(styles.item, highlighted && styles.highlighted, className)}\n data-nav-item\n {...props}\n >\n {children}\n {actions && <span className={styles.actions}>{actions}</span>}\n </div>\n);\n\nexport const Nav = ({\n animation,\n children,\n className,\n horizontal = false,\n variant = 'default',\n ...props\n}: NavProps) => {\n const [open, setOpen] = useState(false);\n\n type withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n };\n const withVars: withVars = {\n '--icon-svg': iconSVG('CaretDown'),\n };\n\n return (\n <nav\n className={cx(className, horizontal && styles.horizontal, styles.nav, variants[variant])}\n data-animation={animation}\n data-open={open ? 'true' : 'false'}\n data-orientation={horizontal ? 'horizontal' : 'vertical'}\n onBlurCapture={(e) => {\n if (variant !== 'pills' || window.innerWidth > 960) return;\n\n const next = e.relatedTarget as Node | null;\n if (!e.currentTarget.contains(next)) {\n setOpen(false);\n }\n }}\n onClick={() => {\n if (variant !== 'pills' || window.innerWidth > 960) return;\n\n setOpen((v) => !v);\n }}\n style={withVars}\n {...props}\n >\n {children}\n </nav>\n );\n};\n"],"names":["variants","default","styles","pills","sidebar","tabs","NavLabel","className","props","jsx","cx","label","NavItem","actions","children","highlighted","item","Nav","animation","horizontal","variant","open","setOpen","useState","withVars","iconSVG","nav","e","window","innerWidth","next","relatedTarget","currentTarget","contains","v"],"mappings":"4eAOMA,EAAW,CACfC,QAASC,EAAOD,QAChBE,MAAOD,EAAOC,MACdC,QAASF,EAAOE,QAChBC,KAAMH,EAAOG,IACf,EAiBaC,EAAWA,CAAC,CAAEC,UAAAA,EAAW,GAAGC,CAAqB,IAC5DC,MAAC,OAAA,CACC,UAAWC,EAAAA,EAAGH,EAAWL,EAAOS,KAAK,EACrC,GAAIH,EAAM,iBAAA,UAAA,CAAA,EAIDI,EAAUA,CAAC,CACtBC,QAAAA,EACAC,SAAAA,EACAP,UAAAA,EACAQ,YAAAA,EAAc,GACd,GAAGP,CACS,WACX,MAAA,CACC,UAAWE,EAAAA,EAAGR,EAAOc,KAAMD,GAAeb,EAAOa,YAAaR,CAAS,EACvE,gBAAa,GACb,GAAIC,EAAM,iBAAA,UAETM,SAAAA,CAAAA,EACAD,GAAWJ,EAAAA,IAAC,OAAA,CAAK,UAAWP,EAAOW,QAAUA,SAAAA,CAAAA,CAAQ,CAAA,CAAA,CACxD,EAGWI,EAAMA,CAAC,CAClBC,UAAAA,EACAJ,SAAAA,EACAP,UAAAA,EACAY,WAAAA,EAAa,GACbC,QAAAA,EAAU,UACV,GAAGZ,CACK,IAAM,CACd,KAAM,CAACa,EAAMC,CAAO,EAAIC,EAAAA,SAAS,EAAK,EAKhCC,EAAqB,CACzB,aAAcC,EAAAA,QAAQ,WAAW,CAAA,EAGnC,OACEhB,EAAAA,IAAC,MAAA,CACC,UAAWC,EAAAA,EAAGH,EAAWY,GAAcjB,EAAOiB,WAAYjB,EAAOwB,IAAK1B,EAASoB,CAAO,CAAC,EACvF,iBAAgBF,EAChB,YAAWG,EAAO,OAAS,QAC3B,mBAAkBF,EAAa,aAAe,WAC9C,cAAgBQ,GAAM,CACpB,GAAIP,IAAY,SAAWQ,OAAOC,WAAa,IAAK,OAEpD,MAAMC,EAAOH,EAAEI,cACVJ,EAAEK,cAAcC,SAASH,CAAI,GAChCR,EAAQ,EAAK,CAEjB,EACA,QAAS,IAAM,CACTF,IAAY,SAAWQ,OAAOC,WAAa,KAE/CP,EAASY,GAAM,CAACA,CAAC,CACnB,EACA,MAAOV,EACP,GAAIhB,EAAM,iBAAA,MAETM,SAAAA,EACH,CAEJ"}
@@ -1,43 +1,56 @@
1
- import { jsx as l } from "react/jsx-runtime";
1
+ import { jsx as l, jsxs as p } from "react/jsx-runtime";
2
2
  import { t as r } from "../../classix-DG18itHa.js";
3
- import { useState as f } from "react";
4
- import { i as h } from "../../icons-dUP7sKyt.js";
5
- import '../../assets/index12.css';const m = "_nav_1hgi7_3", u = "_label_1hgi7_9", v = "_horizontal_1hgi7_17", g = "_sidebar_1hgi7_27", w = "_tabs_1hgi7_66", z = "_pills_1hgi7_86", a = {
6
- nav: m,
3
+ import { useState as b } from "react";
4
+ import { i as f } from "../../icons-dUP7sKyt.js";
5
+ import '../../assets/index13.css';const v = "_nav_1h1i0_3", u = "_label_1h1i0_9", g = "_item_1h1i0_17", N = "_actions_1h1i0_36", w = "_highlighted_1h1i0_48", x = "_horizontal_1h1i0_52", z = "_sidebar_1h1i0_62", C = "_tabs_1h1i0_101", j = "_pills_1h1i0_121", t = {
6
+ nav: v,
7
7
  label: u,
8
- horizontal: v,
9
- sidebar: g,
10
- tabs: w,
11
- pills: z
12
- }, N = {
13
- default: a.default,
14
- pills: a.pills,
15
- sidebar: a.sidebar,
16
- tabs: a.tabs
17
- }, T = ({
18
- className: n,
19
- ...s
20
- }) => /* @__PURE__ */ l("span", { className: r(n, a.label), ...s, "data-component": "navlabel" }), V = ({
21
- animation: n,
22
- children: s,
23
- className: c,
24
- horizontal: e = !1,
25
- variant: o = "default",
26
- ...p
8
+ item: g,
9
+ actions: N,
10
+ highlighted: w,
11
+ horizontal: x,
12
+ sidebar: z,
13
+ tabs: C,
14
+ pills: j
15
+ }, y = {
16
+ default: t.default,
17
+ pills: t.pills,
18
+ sidebar: t.sidebar,
19
+ tabs: t.tabs
20
+ }, k = ({
21
+ className: a,
22
+ ...i
23
+ }) => /* @__PURE__ */ l("span", { className: r(a, t.label), ...i, "data-component": "navlabel" }), B = ({
24
+ actions: a,
25
+ children: i,
26
+ className: o,
27
+ highlighted: s = !1,
28
+ ...n
29
+ }) => /* @__PURE__ */ p("div", { className: r(t.item, s && t.highlighted, o), "data-nav-item": !0, ...n, "data-component": "navitem", children: [
30
+ i,
31
+ a && /* @__PURE__ */ l("span", { className: t.actions, children: a })
32
+ ] }), D = ({
33
+ animation: a,
34
+ children: i,
35
+ className: o,
36
+ horizontal: s = !1,
37
+ variant: n = "default",
38
+ ...h
27
39
  }) => {
28
- const [d, i] = f(!1), _ = {
29
- "--icon-svg": h("CaretDown")
40
+ const [d, c] = b(!1), _ = {
41
+ "--icon-svg": f("CaretDown")
30
42
  };
31
- return /* @__PURE__ */ l("nav", { className: r(c, e && a.horizontal, a.nav, N[o]), "data-animation": n, "data-open": d ? "true" : "false", "data-orientation": e ? "horizontal" : "vertical", onBlurCapture: (t) => {
32
- if (o !== "pills" || window.innerWidth > 960) return;
33
- const b = t.relatedTarget;
34
- t.currentTarget.contains(b) || i(!1);
43
+ return /* @__PURE__ */ l("nav", { className: r(o, s && t.horizontal, t.nav, y[n]), "data-animation": a, "data-open": d ? "true" : "false", "data-orientation": s ? "horizontal" : "vertical", onBlurCapture: (e) => {
44
+ if (n !== "pills" || window.innerWidth > 960) return;
45
+ const m = e.relatedTarget;
46
+ e.currentTarget.contains(m) || c(!1);
35
47
  }, onClick: () => {
36
- o !== "pills" || window.innerWidth > 960 || i((t) => !t);
37
- }, style: _, ...p, "data-component": "nav", children: s });
48
+ n !== "pills" || window.innerWidth > 960 || c((e) => !e);
49
+ }, style: _, ...h, "data-component": "nav", children: i });
38
50
  };
39
51
  export {
40
- V as Nav,
41
- T as NavLabel
52
+ D as Nav,
53
+ B as NavItem,
54
+ k as NavLabel
42
55
  };
43
56
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/nav/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { useState } from 'react';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\n\nimport styles from './styles.module.css';\n\nconst variants = {\n default: styles.default,\n pills: styles.pills,\n sidebar: styles.sidebar,\n tabs: styles.tabs,\n};\n\nexport type NavProps = React.HTMLAttributes<HTMLElement> & {\n animation?: string;\n children?: React.ReactNode;\n className?: string;\n horizontal?: boolean;\n variant?: keyof typeof variants;\n};\n\nexport type NavLabelProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport const NavLabel = ({ className, ...props }: NavLabelProps) => (\n <span\n className={cx(className, styles.label)}\n {...props}\n />\n);\n\nexport const Nav = ({\n animation,\n children,\n className,\n horizontal = false,\n variant = 'default',\n ...props\n}: NavProps) => {\n const [open, setOpen] = useState(false);\n\n type withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n };\n const withVars: withVars = {\n '--icon-svg': iconSVG('CaretDown'),\n };\n\n return (\n <nav\n className={cx(className, horizontal && styles.horizontal, styles.nav, variants[variant])}\n data-animation={animation}\n data-open={open ? 'true' : 'false'}\n data-orientation={horizontal ? 'horizontal' : 'vertical'}\n onBlurCapture={(e) => {\n if (variant !== 'pills' || window.innerWidth > 960) return;\n\n const next = e.relatedTarget as Node | null;\n if (!e.currentTarget.contains(next)) {\n setOpen(false);\n }\n }}\n onClick={() => {\n if (variant !== 'pills' || window.innerWidth > 960) return;\n\n setOpen((v) => !v);\n }}\n style={withVars}\n {...props}\n >\n {children}\n </nav>\n );\n};\n"],"names":["variants","default","styles","pills","sidebar","tabs","NavLabel","className","props","jsx","cx","label","Nav","animation","children","horizontal","variant","open","setOpen","useState","withVars","iconSVG","nav","e","window","innerWidth","next","relatedTarget","currentTarget","contains","v"],"mappings":";;;;;;;;;;;GAOMA,IAAW;AAAA,EACfC,SAASC,EAAOD;AAAAA,EAChBE,OAAOD,EAAOC;AAAAA,EACdC,SAASF,EAAOE;AAAAA,EAChBC,MAAMH,EAAOG;AACf,GAYaC,IAAWA,CAAC;AAAA,EAAEC,WAAAA;AAAAA,EAAW,GAAGC;AAAqB,MAC5D,gBAAAC,EAAC,QAAA,EACC,WAAWC,EAAGH,GAAWL,EAAOS,KAAK,GACrC,GAAIH,GAAM,kBAAA,WAAA,CAAA,GAIDI,IAAMA,CAAC;AAAA,EAClBC,WAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAP,WAAAA;AAAAA,EACAQ,YAAAA,IAAa;AAAA,EACbC,SAAAA,IAAU;AAAA,EACV,GAAGR;AACK,MAAM;AACd,QAAM,CAACS,GAAMC,CAAO,IAAIC,EAAS,EAAK,GAKhCC,IAAqB;AAAA,IACzB,cAAcC,EAAQ,WAAW;AAAA,EAAA;AAGnC,SACE,gBAAAZ,EAAC,OAAA,EACC,WAAWC,EAAGH,GAAWQ,KAAcb,EAAOa,YAAYb,EAAOoB,KAAKtB,EAASgB,CAAO,CAAC,GACvF,kBAAgBH,GAChB,aAAWI,IAAO,SAAS,SAC3B,oBAAkBF,IAAa,eAAe,YAC9C,eAAgBQ,CAAAA,MAAM;AACpB,QAAIP,MAAY,WAAWQ,OAAOC,aAAa,IAAK;AAEpD,UAAMC,IAAOH,EAAEI;AACf,IAAKJ,EAAEK,cAAcC,SAASH,CAAI,KAChCR,EAAQ,EAAK;AAAA,EAEjB,GACA,SAAS,MAAM;AACb,IAAIF,MAAY,WAAWQ,OAAOC,aAAa,OAE/CP,EAASY,CAAAA,MAAM,CAACA,CAAC;AAAA,EACnB,GACA,OAAOV,GACP,GAAIZ,GAAM,kBAAA,OAETM,UAAAA,GACH;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/nav/index.tsx"],"sourcesContent":["import cx from 'classix';\nimport { useState } from 'react';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\n\nimport styles from './styles.module.css';\n\nconst variants = {\n default: styles.default,\n pills: styles.pills,\n sidebar: styles.sidebar,\n tabs: styles.tabs,\n};\n\nexport type NavProps = React.HTMLAttributes<HTMLElement> & {\n animation?: string;\n children?: React.ReactNode;\n className?: string;\n horizontal?: boolean;\n variant?: keyof typeof variants;\n};\n\nexport type NavLabelProps = React.HTMLAttributes<HTMLSpanElement>;\n\nexport type NavItemProps = React.HTMLAttributes<HTMLDivElement> & {\n actions?: React.ReactNode;\n highlighted?: boolean;\n};\n\nexport const NavLabel = ({ className, ...props }: NavLabelProps) => (\n <span\n className={cx(className, styles.label)}\n {...props}\n />\n);\n\nexport const NavItem = ({\n actions,\n children,\n className,\n highlighted = false,\n ...props\n}: NavItemProps) => (\n <div\n className={cx(styles.item, highlighted && styles.highlighted, className)}\n data-nav-item\n {...props}\n >\n {children}\n {actions && <span className={styles.actions}>{actions}</span>}\n </div>\n);\n\nexport const Nav = ({\n animation,\n children,\n className,\n horizontal = false,\n variant = 'default',\n ...props\n}: NavProps) => {\n const [open, setOpen] = useState(false);\n\n type withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n };\n const withVars: withVars = {\n '--icon-svg': iconSVG('CaretDown'),\n };\n\n return (\n <nav\n className={cx(className, horizontal && styles.horizontal, styles.nav, variants[variant])}\n data-animation={animation}\n data-open={open ? 'true' : 'false'}\n data-orientation={horizontal ? 'horizontal' : 'vertical'}\n onBlurCapture={(e) => {\n if (variant !== 'pills' || window.innerWidth > 960) return;\n\n const next = e.relatedTarget as Node | null;\n if (!e.currentTarget.contains(next)) {\n setOpen(false);\n }\n }}\n onClick={() => {\n if (variant !== 'pills' || window.innerWidth > 960) return;\n\n setOpen((v) => !v);\n }}\n style={withVars}\n {...props}\n >\n {children}\n </nav>\n );\n};\n"],"names":["variants","default","styles","pills","sidebar","tabs","NavLabel","className","props","jsx","cx","label","NavItem","actions","children","highlighted","item","Nav","animation","horizontal","variant","open","setOpen","useState","withVars","iconSVG","nav","e","window","innerWidth","next","relatedTarget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AAY,WAAWQ,OAAOC,aAAa,IAAK;AAEpD,UAAMC,IAAOH,EAAEI;AACf,IAAKJ,EAAEK,cAAcC,SAASH,CAAI,KAChCR,EAAQ,EAAK;AAAA,EAEjB,GACA,SAAS,MAAM;AACb,IAAIF,MAAY,WAAWQ,OAAOC,aAAa,OAE/CP,EAASY,CAAAA,MAAM,CAACA,CAAC;AAAA,EACnB,GACA,OAAOV,GACP,GAAIhB,GAAM,kBAAA,OAETM,UAAAA,GACH;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index11.css');const e=require("react/jsx-runtime"),n="_object_xxgm1_1",s={object:n},a=({accessibleLabel:c,url:t,...o})=>e.jsx("object",{"aria-label":c,className:s.object,data:t,type:"application/pdf",...o,"data-component":"objectcomponent",children:t&&e.jsxs(e.Fragment,{children:["We cannot show this file. You can try accessing it directly:",e.jsx("br",{}),e.jsx("a",{href:t,children:t})]})});exports.Object=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index12.css');const e=require("react/jsx-runtime"),n="_object_xxgm1_1",s={object:n},a=({accessibleLabel:c,url:t,...o})=>e.jsx("object",{"aria-label":c,className:s.object,data:t,type:"application/pdf",...o,"data-component":"objectcomponent",children:t&&e.jsxs(e.Fragment,{children:["We cannot show this file. You can try accessing it directly:",e.jsx("br",{}),e.jsx("a",{href:t,children:t})]})});exports.Object=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as n, Fragment as a } from "react/jsx-runtime";
2
- import '../../assets/index11.css';const s = "_object_xxgm1_1", i = {
2
+ import '../../assets/index12.css';const s = "_object_xxgm1_1", i = {
3
3
  object: s
4
4
  }, b = ({
5
5
  accessibleLabel: c,
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index11.css');const n=require("react/jsx-runtime"),c=require("../../classix-5H4IWnMA.cjs"),u="_layout_1clzr_1",y="_loading_1clzr_26",a={layout:u,"with-sidebar":"_with-sidebar_1clzr_10","fill-viewport":"_fill-viewport_1clzr_20",loading:y},_=({"aria-busy":o,children:e,className:i,fillViewport:s=!1,loading:t=!1,sidebar:l,...r})=>n.jsxs("main",{"aria-busy":o??(t||void 0),className:c.t(a.layout,!!l&&a["with-sidebar"],s&&a["fill-viewport"],t&&a.loading,i),...r,"data-component":"pagelayout",children:[l,e]});exports.PageLayout=_;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/page-layout/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport styles from './styles.module.css';\n\nexport type PageLayoutProps = React.ComponentPropsWithoutRef<'main'> & {\n fillViewport?: boolean;\n loading?: boolean;\n sidebar?: React.ReactNode;\n};\n\nexport const PageLayout = ({\n 'aria-busy': ariaBusy,\n children,\n className,\n fillViewport = false,\n loading = false,\n sidebar,\n ...props\n}: PageLayoutProps) => (\n <main\n aria-busy={ariaBusy ?? (loading || undefined)}\n className={cx(\n styles.layout,\n Boolean(sidebar) && styles['with-sidebar'],\n fillViewport && styles['fill-viewport'],\n loading && styles.loading,\n className\n )}\n {...props}\n >\n {sidebar}\n {children}\n </main>\n);\n"],"names":["PageLayout","ariaBusy","children","className","fillViewport","loading","sidebar","props","jsxs","undefined","cx","styles","layout","Boolean"],"mappings":"gTAUaA,EAAaA,CAAC,CACzB,YAAaC,EACbC,SAAAA,EACAC,UAAAA,EACAC,aAAAA,EAAe,GACfC,QAAAA,EAAU,GACVC,QAAAA,EACA,GAAGC,CACY,IACfC,EAAAA,KAAC,OAAA,CACC,YAAWP,IAAaI,GAAWI,QACnC,UAAWC,EAAAA,EACTC,EAAOC,OACPC,EAAQP,GAAYK,EAAO,cAAc,EACzCP,GAAgBO,EAAO,eAAe,EACtCN,GAAWM,EAAON,QAClBF,CACF,EACA,GAAII,EAAM,iBAAA,aAETD,SAAAA,CAAAA,EACAJ,CAAAA,CAAAA,CACH"}
@@ -0,0 +1,23 @@
1
+ import { jsxs as n } from "react/jsx-runtime";
2
+ import { t as _ } from "../../classix-DG18itHa.js";
3
+ import '../../assets/index11.css';const c = "_layout_1clzr_1", y = "_loading_1clzr_26", o = {
4
+ layout: c,
5
+ "with-sidebar": "_with-sidebar_1clzr_10",
6
+ "fill-viewport": "_fill-viewport_1clzr_20",
7
+ loading: y
8
+ }, u = ({
9
+ "aria-busy": t,
10
+ children: i,
11
+ className: r,
12
+ fillViewport: s = !1,
13
+ loading: a = !1,
14
+ sidebar: l,
15
+ ...e
16
+ }) => /* @__PURE__ */ n("main", { "aria-busy": t ?? (a || void 0), className: _(o.layout, !!l && o["with-sidebar"], s && o["fill-viewport"], a && o.loading, r), ...e, "data-component": "pagelayout", children: [
17
+ l,
18
+ i
19
+ ] });
20
+ export {
21
+ u as PageLayout
22
+ };
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/page-layout/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport styles from './styles.module.css';\n\nexport type PageLayoutProps = React.ComponentPropsWithoutRef<'main'> & {\n fillViewport?: boolean;\n loading?: boolean;\n sidebar?: React.ReactNode;\n};\n\nexport const PageLayout = ({\n 'aria-busy': ariaBusy,\n children,\n className,\n fillViewport = false,\n loading = false,\n sidebar,\n ...props\n}: PageLayoutProps) => (\n <main\n aria-busy={ariaBusy ?? (loading || undefined)}\n className={cx(\n styles.layout,\n Boolean(sidebar) && styles['with-sidebar'],\n fillViewport && styles['fill-viewport'],\n loading && styles.loading,\n className\n )}\n {...props}\n >\n {sidebar}\n {children}\n </main>\n);\n"],"names":["PageLayout","ariaBusy","children","className","fillViewport","loading","sidebar","props","jsxs","undefined","cx","styles","layout","Boolean"],"mappings":";;;;;;;GAUaA,IAAaA,CAAC;AAAA,EACzB,aAAaC;AAAAA,EACbC,UAAAA;AAAAA,EACAC,WAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,SAAAA,IAAU;AAAA,EACVC,SAAAA;AAAAA,EACA,GAAGC;AACY,MACf,gBAAAC,EAAC,QAAA,EACC,aAAWP,MAAaI,KAAWI,SACnC,WAAWC,EACTC,EAAOC,QACPC,EAAQP,KAAYK,EAAO,cAAc,GACzCP,KAAgBO,EAAO,eAAe,GACtCN,KAAWM,EAAON,SAClBF,CACF,GACA,GAAII,GAAM,kBAAA,cAETD,UAAAA;AAAAA,EAAAA;AAAAA,EACAJ;AAAAA,EAAAA,CACH;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index49.css');const m=require("react/jsx-runtime"),k=require("../../classix-5H4IWnMA.cjs"),o=require("react"),S=require("react-dom"),K=require("../button/index.cjs"),O="_popover_14bo5_1",I="_inline_14bo5_6",N="_below_14bo5_47",H="_above_14bo5_52",W="_left_14bo5_62",M="_right_14bo5_67",U="_trigger_14bo5_72",r={popover:O,inline:I,"popover-panel":"_popover-panel_14bo5_26",below:N,above:H,"inline-panel":"_inline-panel_14bo5_57",left:W,right:M,trigger:U,"inline-trigger":"_inline-trigger_14bo5_76"},X=({children:v,inline:s=!1,triggerAccessibleLabel:C,triggerAriaHasPopup:T,triggerButtonContent:z})=>{var B;const h=o.useRef(null),y=o.useRef(void 0),b=o.useRef(null),P=o.useId(),p=o.useRef(null),[t,R]=o.useState(!1),[f,D]=o.useState(!1),[d,x]=o.useState("right"),_=({initialFocus:e}={})=>{y.current=e,D(!1),x("right"),R(!0)},l=o.useCallback(({restoreFocus:e=!0}={})=>{var i;R(!1),e&&((i=p.current)==null||i.focus())},[]),L=e=>{t&&e.key==="Escape"&&l()},j=e=>{if(!t){if(e.key==="ArrowDown"){e.preventDefault(),_({initialFocus:"first"});return}e.key==="ArrowUp"&&(e.preventDefault(),_({initialFocus:"last"}))}};o.useEffect(()=>{if(!t)return;const e=i=>{var n,g;const u=i.target;(n=h.current)!=null&&n.contains(u)||(g=b.current)!=null&&g.contains(u)||l({restoreFocus:!1})};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[l,t]);const a=o.useCallback(()=>{const e=b.current,i=p.current;if(!e||!i)return;const u=e.getBoundingClientRect(),n=i.getBoundingClientRect(),g=n.top,E=window.innerHeight-n.bottom;D(u.height>E&&g>E),x(u.width>window.innerWidth-n.left&&n.right>window.innerWidth-n.left?"left":"right")},[]);o.useLayoutEffect(()=>{if(t)return a(),window.addEventListener("resize",a),window.addEventListener("scroll",a,!0),()=>{window.removeEventListener("resize",a),window.removeEventListener("scroll",a,!0)}},[t,a]);const F=e=>{e.preventDefault(),e.stopPropagation(),t?l({restoreFocus:!1}):_()},q={"aria-controls":t?P:void 0,"aria-expanded":t,"aria-haspopup":T,"aria-label":C,className:s?r["inline-trigger"]:r.trigger,onClick:F,onKeyDown:j},c=s?(B=p.current)==null?void 0:B.getBoundingClientRect():void 0,A=[d==="left"?"translateX(-100%)":"",f?"translateY(calc(-100% - var(--shape-spacing-2xs)))":""].filter(Boolean).join(" "),w=t?m.jsx("div",{className:k.t(r["popover-panel"],r[f?"above":"below"],s&&r["inline-panel"],!s&&r[d]),"data-horizontal-placement":d,"data-placement":f?"above":"below",id:P,ref:b,style:c?{left:d==="left"?c.right:c.left,position:"fixed",top:f?c.top:c.bottom,transform:A||void 0}:void 0,children:typeof v=="function"?v({close:l,initialFocus:y.current,isOpen:t}):v}):null;return m.jsxs("div",{className:k.t(r.popover,s&&r.inline),"data-open":t,onKeyDown:L,onClick:e=>{e.preventDefault(),e.stopPropagation()},ref:h,"data-component":"popover",children:[m.jsx(K.Button,{...q,ref:p,variant:"simple",children:z}),s&&w&&typeof document<"u"?S.createPortal(w,document.body):w]})};exports.Popover=X;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index52.css');const m=require("react/jsx-runtime"),k=require("../../classix-5H4IWnMA.cjs"),o=require("react"),S=require("react-dom"),K=require("../button/index.cjs"),O="_popover_14bo5_1",I="_inline_14bo5_6",N="_below_14bo5_47",H="_above_14bo5_52",W="_left_14bo5_62",M="_right_14bo5_67",U="_trigger_14bo5_72",r={popover:O,inline:I,"popover-panel":"_popover-panel_14bo5_26",below:N,above:H,"inline-panel":"_inline-panel_14bo5_57",left:W,right:M,trigger:U,"inline-trigger":"_inline-trigger_14bo5_76"},X=({children:v,inline:s=!1,triggerAccessibleLabel:C,triggerAriaHasPopup:T,triggerButtonContent:z})=>{var B;const h=o.useRef(null),y=o.useRef(void 0),b=o.useRef(null),P=o.useId(),p=o.useRef(null),[t,R]=o.useState(!1),[f,D]=o.useState(!1),[d,x]=o.useState("right"),_=({initialFocus:e}={})=>{y.current=e,D(!1),x("right"),R(!0)},l=o.useCallback(({restoreFocus:e=!0}={})=>{var i;R(!1),e&&((i=p.current)==null||i.focus())},[]),L=e=>{t&&e.key==="Escape"&&l()},j=e=>{if(!t){if(e.key==="ArrowDown"){e.preventDefault(),_({initialFocus:"first"});return}e.key==="ArrowUp"&&(e.preventDefault(),_({initialFocus:"last"}))}};o.useEffect(()=>{if(!t)return;const e=i=>{var n,g;const u=i.target;(n=h.current)!=null&&n.contains(u)||(g=b.current)!=null&&g.contains(u)||l({restoreFocus:!1})};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[l,t]);const a=o.useCallback(()=>{const e=b.current,i=p.current;if(!e||!i)return;const u=e.getBoundingClientRect(),n=i.getBoundingClientRect(),g=n.top,E=window.innerHeight-n.bottom;D(u.height>E&&g>E),x(u.width>window.innerWidth-n.left&&n.right>window.innerWidth-n.left?"left":"right")},[]);o.useLayoutEffect(()=>{if(t)return a(),window.addEventListener("resize",a),window.addEventListener("scroll",a,!0),()=>{window.removeEventListener("resize",a),window.removeEventListener("scroll",a,!0)}},[t,a]);const F=e=>{e.preventDefault(),e.stopPropagation(),t?l({restoreFocus:!1}):_()},q={"aria-controls":t?P:void 0,"aria-expanded":t,"aria-haspopup":T,"aria-label":C,className:s?r["inline-trigger"]:r.trigger,onClick:F,onKeyDown:j},c=s?(B=p.current)==null?void 0:B.getBoundingClientRect():void 0,A=[d==="left"?"translateX(-100%)":"",f?"translateY(calc(-100% - var(--shape-spacing-2xs)))":""].filter(Boolean).join(" "),w=t?m.jsx("div",{className:k.t(r["popover-panel"],r[f?"above":"below"],s&&r["inline-panel"],!s&&r[d]),"data-horizontal-placement":d,"data-placement":f?"above":"below",id:P,ref:b,style:c?{left:d==="left"?c.right:c.left,position:"fixed",top:f?c.top:c.bottom,transform:A||void 0}:void 0,children:typeof v=="function"?v({close:l,initialFocus:y.current,isOpen:t}):v}):null;return m.jsxs("div",{className:k.t(r.popover,s&&r.inline),"data-open":t,onKeyDown:L,onClick:e=>{e.preventDefault(),e.stopPropagation()},ref:h,"data-component":"popover",children:[m.jsx(K.Button,{...q,ref:p,variant:"simple",children:z}),s&&w&&typeof document<"u"?S.createPortal(w,document.body):w]})};exports.Popover=X;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -3,7 +3,7 @@ import { t as C } from "../../classix-DG18itHa.js";
3
3
  import { useRef as g, useId as H, useState as b, useCallback as L, useEffect as W, useLayoutEffect as S } from "react";
4
4
  import { createPortal as U } from "react-dom";
5
5
  import { Button as X } from "../button/index.js";
6
- import '../../assets/index49.css';const Y = "_popover_14bo5_1", q = "_inline_14bo5_6", G = "_below_14bo5_47", J = "_above_14bo5_52", M = "_left_14bo5_62", Q = "_right_14bo5_67", V = "_trigger_14bo5_72", n = {
6
+ import '../../assets/index52.css';const Y = "_popover_14bo5_1", q = "_inline_14bo5_6", G = "_below_14bo5_47", J = "_above_14bo5_52", M = "_left_14bo5_62", Q = "_right_14bo5_67", V = "_trigger_14bo5_72", n = {
7
7
  popover: Y,
8
8
  inline: q,
9
9
  "popover-panel": "_popover-panel_14bo5_26",
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index9.css');const a=require("react/jsx-runtime"),b=require("react"),h=require("../button/index.cjs"),I=require("../checkbox/index.cjs"),T=require("../chip/index.cjs"),H=require("../collapsible/index.cjs"),P=require("../controls/index.cjs"),z=require("../dialog/index.cjs"),A=require("../header/index.cjs"),E=require("../../index-5yOssOic.cjs"),J="_search_1rde5_3",K="_controls_1rde5_15",Q="_chips_1rde5_35",S="_radio_1rde5_101",l={search:J,controls:K,chips:Q,"filter-dialog":"_filter-dialog_1rde5_42","filter-groups":"_filter-groups_1rde5_47","filter-group":"_filter-group_1rde5_47","filter-option":"_filter-option_1rde5_83","option-copy":"_option-copy_1rde5_89",radio:S,"collapsible-options":"_collapsible-options_1rde5_128"},U=({filterButtonLabel:x="Filters",filterDialogColumns:k=1,filterDialogTitle:q="Filters",filterGroups:d=[],onChange:M,onSelectedFiltersChange:i,removeFilterLabel:$=c=>`Remove ${c.label} filter`,resetLabel:j="Reset",searchLabel:O="Search",searchPlaceholder:w="Search",selectedFilters:t=[],showResultsLabel:B="Show results",value:D=""})=>{const c=b.useId(),[v,r]=b.useState(!1),R=b.useMemo(()=>new Map(d.flatMap(e=>{var n;return[...e.options,...((n=e.collapsible)==null?void 0:n.options)??[]]}).map(e=>[e.value,e])),[d]),p=t.flatMap(e=>{const n=R.get(e);return n?[n]:[]}),_=(e,n,s)=>{var f;if(!i)return;const m=new Set([...(s==null?void 0:s.options.map(o=>o.value))??[],...((f=s==null?void 0:s.collapsible)==null?void 0:f.options.map(o=>o.value))??[]]),N=t.filter(o=>!m.has(o));if(n&&(s==null?void 0:s.defaultValue)===e){i(N);return}i(n?(s==null?void 0:s.control)==="radio"||(s==null?void 0:s.selectionMode)==="single"?[...N,e]:[...new Set([...t,e])]:t.filter(o=>o!==e))},u=(e,n)=>{var s;return t.includes(e)||n.defaultValue===e&&![...n.options,...((s=n.collapsible)==null?void 0:s.options)??[]].some(m=>t.includes(m.value))},y=(e,n)=>a.jsx("div",{className:l["filter-option"],"data-component":"renderfilter",children:n.control==="radio"?a.jsxs("label",{className:l.radio,children:[a.jsx("input",{checked:u(e.value,n),name:`${c}-filter-${n.label??"group"}`,onChange:s=>_(e.value,s.target.checked,n),type:"radio"}),a.jsxs("span",{className:l["option-copy"],children:[e.label,e.description&&a.jsx("sub",{children:e.description})]})]}):a.jsx(I.Checkbox,{checked:u(e.value,n),label:a.jsxs("span",{className:l["option-copy"],children:[e.label,e.description&&a.jsx("sub",{children:e.description})]}),onChange:s=>_(e.value,s.target.checked,n)})},e.value);return a.jsxs("div",{className:l.search,"data-component":"search",children:[a.jsxs("div",{className:l.controls,children:[a.jsx(E.Input,{"aria-label":O,icon:"MagnifyingGlass",onChange:e=>M(e.target.value),placeholder:w,type:"search",value:D}),d.length>0&&a.jsx(h.Button,{"aria-expanded":v,"aria-haspopup":"dialog",badge:p.length,icon:"Funnel",onClick:()=>r(!0),variant:"tertiary",children:x})]}),p.length>0&&a.jsxs("div",{"aria-label":x,className:l.chips,children:[p.map(e=>a.jsx(T.Chip,{accessibleLabel:$(e),label:e.label,onDelete:()=>_(e.value,!1)},e.value)),a.jsx(h.Button,{onClick:()=>i==null?void 0:i([]),variant:"tertiary",children:j})]}),v&&a.jsx(z.Dialog,{"aria-labelledby":c,className:l["filter-dialog"],controls:a.jsxs(P.Controls,{children:[a.jsx(h.Button,{onClick:()=>{i==null||i([]),r(!1)},children:j}),a.jsx(h.Button,{onClick:()=>r(!1),variant:"primary",children:B})]}),header:a.jsx(A.Header,{children:a.jsx("h2",{id:c,children:q})}),open:!0,setOpen:r,children:a.jsx("div",{className:l["filter-groups"],"data-columns":k,children:d.map((e,n)=>a.jsxs("section",{"aria-labelledby":e.label?`${c}-${n}`:void 0,className:l["filter-group"],"data-column-span":e.columnSpan??1,role:e.control==="radio"?"radiogroup":"group",children:[e.label&&a.jsx("h3",{id:`${c}-${n}`,children:e.label}),e.options.map(s=>y(s,e)),e.collapsible&&a.jsx(H.Collapsible,{summary:e.collapsible.label,children:a.jsx("div",{className:l["collapsible-options"],children:e.collapsible.options.map(s=>y(s,e))})})]},e.label??n))})})]})};exports.Search=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index9.css');const a=require("react/jsx-runtime"),b=require("react"),h=require("../button/index.cjs"),I=require("../checkbox/index.cjs"),T=require("../chip/index.cjs"),H=require("../collapsible/index.cjs"),P=require("../controls/index.cjs"),z=require("../dialog/index.cjs"),A=require("../header/index.cjs"),E=require("../../index-CQlMdqOp.cjs"),J="_search_1rde5_3",K="_controls_1rde5_15",Q="_chips_1rde5_35",S="_radio_1rde5_101",l={search:J,controls:K,chips:Q,"filter-dialog":"_filter-dialog_1rde5_42","filter-groups":"_filter-groups_1rde5_47","filter-group":"_filter-group_1rde5_47","filter-option":"_filter-option_1rde5_83","option-copy":"_option-copy_1rde5_89",radio:S,"collapsible-options":"_collapsible-options_1rde5_128"},U=({filterButtonLabel:x="Filters",filterDialogColumns:k=1,filterDialogTitle:q="Filters",filterGroups:d=[],onChange:M,onSelectedFiltersChange:i,removeFilterLabel:$=c=>`Remove ${c.label} filter`,resetLabel:j="Reset",searchLabel:O="Search",searchPlaceholder:w="Search",selectedFilters:t=[],showResultsLabel:B="Show results",value:D=""})=>{const c=b.useId(),[v,r]=b.useState(!1),R=b.useMemo(()=>new Map(d.flatMap(e=>{var n;return[...e.options,...((n=e.collapsible)==null?void 0:n.options)??[]]}).map(e=>[e.value,e])),[d]),p=t.flatMap(e=>{const n=R.get(e);return n?[n]:[]}),_=(e,n,s)=>{var f;if(!i)return;const m=new Set([...(s==null?void 0:s.options.map(o=>o.value))??[],...((f=s==null?void 0:s.collapsible)==null?void 0:f.options.map(o=>o.value))??[]]),N=t.filter(o=>!m.has(o));if(n&&(s==null?void 0:s.defaultValue)===e){i(N);return}i(n?(s==null?void 0:s.control)==="radio"||(s==null?void 0:s.selectionMode)==="single"?[...N,e]:[...new Set([...t,e])]:t.filter(o=>o!==e))},u=(e,n)=>{var s;return t.includes(e)||n.defaultValue===e&&![...n.options,...((s=n.collapsible)==null?void 0:s.options)??[]].some(m=>t.includes(m.value))},y=(e,n)=>a.jsx("div",{className:l["filter-option"],"data-component":"renderfilter",children:n.control==="radio"?a.jsxs("label",{className:l.radio,children:[a.jsx("input",{checked:u(e.value,n),name:`${c}-filter-${n.label??"group"}`,onChange:s=>_(e.value,s.target.checked,n),type:"radio"}),a.jsxs("span",{className:l["option-copy"],children:[e.label,e.description&&a.jsx("sub",{children:e.description})]})]}):a.jsx(I.Checkbox,{checked:u(e.value,n),label:a.jsxs("span",{className:l["option-copy"],children:[e.label,e.description&&a.jsx("sub",{children:e.description})]}),onChange:s=>_(e.value,s.target.checked,n)})},e.value);return a.jsxs("div",{className:l.search,"data-component":"search",children:[a.jsxs("div",{className:l.controls,children:[a.jsx(E.Input,{"aria-label":O,icon:"MagnifyingGlass",onChange:e=>M(e.target.value),placeholder:w,type:"search",value:D}),d.length>0&&a.jsx(h.Button,{"aria-expanded":v,"aria-haspopup":"dialog",badge:p.length,icon:"Funnel",onClick:()=>r(!0),variant:"tertiary",children:x})]}),p.length>0&&a.jsxs("div",{"aria-label":x,className:l.chips,children:[p.map(e=>a.jsx(T.Chip,{accessibleLabel:$(e),label:e.label,onDelete:()=>_(e.value,!1)},e.value)),a.jsx(h.Button,{onClick:()=>i==null?void 0:i([]),variant:"tertiary",children:j})]}),v&&a.jsx(z.Dialog,{"aria-labelledby":c,className:l["filter-dialog"],controls:a.jsxs(P.Controls,{children:[a.jsx(h.Button,{onClick:()=>{i==null||i([]),r(!1)},children:j}),a.jsx(h.Button,{onClick:()=>r(!1),variant:"primary",children:B})]}),header:a.jsx(A.Header,{children:a.jsx("h2",{id:c,children:q})}),open:!0,setOpen:r,children:a.jsx("div",{className:l["filter-groups"],"data-columns":k,children:d.map((e,n)=>a.jsxs("section",{"aria-labelledby":e.label?`${c}-${n}`:void 0,className:l["filter-group"],"data-column-span":e.columnSpan??1,role:e.control==="radio"?"radiogroup":"group",children:[e.label&&a.jsx("h3",{id:`${c}-${n}`,children:e.label}),e.options.map(s=>y(s,e)),e.collapsible&&a.jsx(H.Collapsible,{summary:e.collapsible.label,children:a.jsx("div",{className:l["collapsible-options"],children:e.collapsible.options.map(s=>y(s,e))})})]},e.label??n))})})]})};exports.Search=U;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -7,7 +7,7 @@ import { Collapsible as E } from "../collapsible/index.js";
7
7
  import { Controls as J } from "../controls/index.js";
8
8
  import { Dialog as K } from "../dialog/index.js";
9
9
  import { Header as P } from "../header/index.js";
10
- import { I as Q } from "../../index-Cv6TtBnd.js";
10
+ import { I as Q } from "../../index-CbJ2-IPc.js";
11
11
  import '../../assets/index9.css';const U = "_search_1rde5_3", V = "_controls_1rde5_15", W = "_chips_1rde5_35", X = "_radio_1rde5_101", o = {
12
12
  search: U,
13
13
  controls: V,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../../classix-5H4IWnMA.cjs");require("../../icons-Dv_p0bUF.cjs");const e=require("../../index-CXaYq0By.cjs");require("../../use-touched-Bq5Gjbpz.cjs");exports.Select=e.Select;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../../classix-5H4IWnMA.cjs");require("../../icons-Dv_p0bUF.cjs");const e=require("../../index-Bt7vnwji.cjs");require("../../use-touched-Bq5Gjbpz.cjs");exports.Select=e.Select;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "../../classix-DG18itHa.js";
3
3
  import "../../icons-dUP7sKyt.js";
4
- import { S as e } from "../../index-CwIzKfBo.js";
4
+ import { S as e } from "../../index-BLb3JiCr.js";
5
5
  import "../../use-touched-B999bBr8.js";
6
6
  export {
7
7
  e as Select
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index51.css');const a=require("react/jsx-runtime"),l=require("../../classix-5H4IWnMA.cjs"),s="_toolbar_vp38k_1",n="_editor_vp38k_34",o={toolbar:s,default:"_default_vp38k_28",editor:n},i=({children:t,variant:e="default"})=>a.jsx("div",{className:l.t(o.toolbar,o[e]),onClick:r=>r.stopPropagation(),"data-component":"toolbar",children:t});exports.Toolbar=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index54.css');const a=require("react/jsx-runtime"),l=require("../../classix-5H4IWnMA.cjs"),s="_toolbar_vp38k_1",n="_editor_vp38k_34",o={toolbar:s,default:"_default_vp38k_28",editor:n},i=({children:t,variant:e="default"})=>a.jsx("div",{className:l.t(o.toolbar,o[e]),onClick:r=>r.stopPropagation(),"data-component":"toolbar",children:t});exports.Toolbar=i;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,6 +1,6 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
2
  import { t as e } from "../../classix-DG18itHa.js";
3
- import '../../assets/index51.css';const s = "_toolbar_vp38k_1", n = "_editor_vp38k_34", o = {
3
+ import '../../assets/index54.css';const s = "_toolbar_vp38k_1", n = "_editor_vp38k_34", o = {
4
4
  toolbar: s,
5
5
  default: "_default_vp38k_28",
6
6
  editor: n
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index14.css');const s=require("react/jsx-runtime"),c=require("../../classix-5H4IWnMA.cjs"),a=require("../icon/index.cjs"),t={static:"_static_r8l1k_1"},r={default:t.default,static:t.static},l=({variant:o="default",children:i,iconName:e,...n})=>s.jsxs("div",{className:c.t(t.tooltip,r[o]),...n,"data-component":"tooltip",children:[e&&s.jsx(a.Icon,{gap:"right",name:e}),i]});exports.Tooltip=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index15.css');const s=require("react/jsx-runtime"),c=require("../../classix-5H4IWnMA.cjs"),a=require("../icon/index.cjs"),t={static:"_static_r8l1k_1"},r={default:t.default,static:t.static},l=({variant:o="default",children:i,iconName:e,...n})=>s.jsxs("div",{className:c.t(t.tooltip,r[o]),...n,"data-component":"tooltip",children:[e&&s.jsx(a.Icon,{gap:"right",name:e}),i]});exports.Tooltip=l;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  import { jsxs as r, jsx as c } from "react/jsx-runtime";
2
2
  import { t as l } from "../../classix-DG18itHa.js";
3
3
  import { Icon as e } from "../icon/index.js";
4
- import '../../assets/index14.css';const t = {
4
+ import '../../assets/index15.css';const t = {
5
5
  static: "_static_r8l1k_1"
6
6
  }, n = {
7
7
  default: t.default,
@@ -2,7 +2,7 @@ import { jsxs as m, jsx as p } from "react/jsx-runtime";
2
2
  import { t as v } from "./classix-DG18itHa.js";
3
3
  import { i as w } from "./icons-dUP7sKyt.js";
4
4
  import { u as C, c as S } from "./use-touched-B999bBr8.js";
5
- import './assets/index50.css';const P = /* @__PURE__ */ new Set(["aria-activedescendant", "aria-autocomplete", "aria-busy", "aria-controls", "aria-describedby", "aria-details", "aria-disabled", "aria-errormessage", "aria-expanded", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-required", "aria-roledescription", "autoComplete", "autoFocus", "className", "defaultValue", "dir", "disabled", "form", "id", "multiple", "name", "onBlur", "onChange", "onClick", "onFocus", "onInput", "onInvalid", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerUp", "required", "role", "size", "style", "tabIndex", "title", "value"]);
5
+ import './assets/index53.css';const P = /* @__PURE__ */ new Set(["aria-activedescendant", "aria-autocomplete", "aria-busy", "aria-controls", "aria-describedby", "aria-details", "aria-disabled", "aria-errormessage", "aria-expanded", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-live", "aria-owns", "aria-required", "aria-roledescription", "autoComplete", "autoFocus", "className", "defaultValue", "dir", "disabled", "form", "id", "multiple", "name", "onBlur", "onChange", "onClick", "onFocus", "onInput", "onInvalid", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseUp", "onPointerDown", "onPointerUp", "required", "role", "size", "style", "tabIndex", "title", "value"]);
6
6
  function _(n) {
7
7
  return Object.fromEntries(Object.entries(n).filter(([e]) => e.startsWith("data-") || e.startsWith("aria-") || P.has(e)));
8
8
  }
@@ -71,4 +71,4 @@ export {
71
71
  N as r,
72
72
  _ as s
73
73
  };
74
- //# sourceMappingURL=index-CwIzKfBo.js.map
74
+ //# sourceMappingURL=index-BLb3JiCr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-CwIzKfBo.js","sources":["../src/components/select/sanitize-select-props.ts","../src/utils/color.ts","../src/components/select/index.tsx"],"sourcesContent":["const selectKeys = new Set([\n 'aria-activedescendant',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-controls',\n 'aria-describedby',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-live',\n 'aria-owns',\n 'aria-required',\n 'aria-roledescription',\n 'autoComplete',\n 'autoFocus',\n 'className',\n 'defaultValue',\n 'dir',\n 'disabled',\n 'form',\n 'id',\n 'multiple',\n 'name',\n 'onBlur',\n 'onChange',\n 'onClick',\n 'onFocus',\n 'onInput',\n 'onInvalid',\n 'onKeyDown',\n 'onKeyUp',\n 'onMouseDown',\n 'onMouseUp',\n 'onPointerDown',\n 'onPointerUp',\n 'required',\n 'role',\n 'size',\n 'style',\n 'tabIndex',\n 'title',\n 'value',\n]);\n\nexport function sanitizeSelectProps<T extends Record<string, unknown>>(props: T) {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([key]) => key.startsWith('data-') || key.startsWith('aria-') || selectKeys.has(key)\n )\n ) as Partial<T>;\n}\n","const cssVariablePattern = /^--[\\w-]+$/;\nconst cssVariableReferencePattern = /^var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*(.+))?\\)$/;\n\nconst unresolvedColorKeywords = new Set([\n 'currentcolor',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n]);\n\nconst probe = typeof document !== 'undefined' ? document.createElement('span') : null;\n\nfunction normalizeColorValue(input: string): string {\n const value = input.trim();\n\n if (!value || !probe || unresolvedColorKeywords.has(value.toLowerCase())) {\n return value;\n }\n\n const mountNode = document.body ?? document.documentElement;\n\n if (!mountNode) {\n return value;\n }\n\n probe.style.color = value;\n\n if (!probe.style.color) {\n return value;\n }\n\n mountNode.appendChild(probe);\n\n const normalized = getComputedStyle(probe).color.trim();\n probe.remove();\n\n return normalized || value;\n}\n\nexport function resolveColor(input: `--${string}` | string, fallback = 'currentColor'): string {\n if (typeof document === 'undefined') {\n return fallback;\n }\n\n const styles = getComputedStyle(document.documentElement);\n const seen = new Set<string>();\n let current = input.trim();\n\n while (current) {\n const match = current.match(cssVariableReferencePattern);\n const variableName = match?.[1] ?? (cssVariablePattern.test(current) ? current : null);\n const nestedFallback = match?.[2]?.trim();\n\n if (!variableName) {\n return normalizeColorValue(current);\n }\n\n if (seen.has(variableName)) {\n current = nestedFallback ?? '';\n continue;\n }\n\n seen.add(variableName);\n\n current = styles.getPropertyValue(variableName).trim() || nestedFallback || '';\n }\n\n return normalizeColorValue(fallback);\n}\n","import cx from 'classix';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\nimport { resolveColor } from '@/utils/color';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { useTouched } from '@/utils/use-touched';\n\nimport { sanitizeSelectProps } from './sanitize-select-props';\nimport styles from './styles.module.css';\n\nexport type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n children: React.ReactNode;\n label?: string;\n placeholder?: string;\n};\n\ntype withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n};\n\nexport const Select = ({ children, label, placeholder, ...props }: SelectProps) => {\n const { touched, onBlur } = useTouched(props.value === '');\n const selectProps = sanitizeSelectProps(props);\n const { className, onBlur: onBlurProp, style, ...restSelectProps } = selectProps;\n const withVars = {\n ...style,\n '--icon-svg': iconSVG('CaretDown', resolveColor('--colors-semantic-content-secondary')),\n } satisfies withVars;\n\n const selectElement = (\n <select\n className={cx(styles.select, className, touched && styles.touched)}\n onBlur={composeEventHandlers(onBlur, onBlurProp)}\n style={withVars}\n {...restSelectProps}\n >\n {placeholder && (\n <option\n key='placeholder'\n value={''}\n hidden\n >\n {placeholder}\n </option>\n )}\n {children}\n </select>\n );\n\n if (!label) {\n return selectElement;\n }\n\n return (\n <label>\n <span\n className={styles.label}\n data-required={props.required || undefined}\n >\n {label}\n </span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","cssVariablePattern","cssVariableReferencePattern","unresolvedColorKeywords","probe","document","createElement","normalizeColorValue","input","value","trim","toLowerCase","mountNode","body","documentElement","style","color","appendChild","normalized","getComputedStyle","remove","resolveColor","fallback","styles","seen","current","match","variableName","test","nestedFallback","add","getPropertyValue","Select","children","label","placeholder","touched","onBlur","useTouched","selectProps","className","onBlurProp","restSelectProps","withVars","iconSVG","selectElement","cx","select","composeEventHandlers","jsxs","jsx","required","undefined"],"mappings":";;;;AAAA,MAAMA,IAAa,oBAAIC,IAAI,CACzB,yBACA,qBACA,aACA,iBACA,oBACA,gBACA,iBACA,qBACA,iBACA,iBACA,eACA,gBACA,qBACA,cACA,mBACA,aACA,aACA,iBACA,wBACA,gBACA,aACA,aACA,gBACA,OACA,YACA,QACA,MACA,YACA,QACA,UACA,YACA,WACA,WACA,WACA,aACA,aACA,WACA,eACA,aACA,iBACA,eACA,YACA,QACA,QACA,SACA,YACA,SACA,OAAO,CACR;AAEM,SAASC,EAAuDC,GAAU;AAC/E,SAAOC,OAAOC,YACZD,OAAOE,QAAQH,CAAK,EAAEI,OACp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AC5B;AAAA,IACF;AAEAL,IAAAA,EAAKM,IAAIH,CAAY,GAErBF,IAAUF,EAAOQ,iBAAiBJ,CAAY,EAAEjB,KAAAA,KAAUmB,KAAkB;AAAA,EAC9E;AAEA,SAAOtB,EAAoBe,CAAQ;AACrC;;;;;GClDaU,IAASA,CAAC;AAAA,EAAEC,UAAAA;AAAAA,EAAUC,OAAAA;AAAAA,EAAOC,aAAAA;AAAAA,EAAa,GAAG1C;AAAmB,MAAM;AACjF,QAAM;AAAA,IAAE2C,SAAAA;AAAAA,IAASC,QAAAA;AAAAA,EAAAA,IAAWC,EAAW7C,EAAMgB,UAAU,EAAE,GACnD8B,IAAc/C,EAAoBC,CAAK,GACvC;AAAA,IAAE+C,WAAAA;AAAAA,IAAWH,QAAQI;AAAAA,IAAY1B,OAAAA;AAAAA,IAAO,GAAG2B;AAAAA,EAAAA,IAAoBH,GAC/DI,IAAW;AAAA,IACf,GAAG5B;AAAAA,IACH,cAAc6B,EAAQ,aAAavB,EAAa,qCAAqC,CAAC;AAAA,EAAA,GAGlFwB,sBACH,UAAA,EACC,WAAWC,EAAGvB,EAAOwB,QAAQP,GAAWJ,KAAWb,EAAOa,OAAO,GACjE,QAAQY,EAAqBX,GAAQI,CAAU,GAC/C,OAAOE,GACP,GAAID,GAEHP,UAAAA;AAAAA,IAAAA,uBACE,UAAA,EAEC,OAAO,IACP,QAAM,IAELA,eAJG,aAKN;AAAA,IAEDF;AAAAA,EAAAA,GACH;AAGF,SAAKC,IAKH,gBAAAe,EAAC,SAAA,EAAK,kBAAA,UACJ,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAA,EACC,WAAW3B,EAAOW,OAClB,iBAAezC,EAAM0D,YAAYC,QAEhClB,UAAAA,EAAAA,CACH;AAAA,IACCW;AAAAA,EAAAA,GACH,IAZOA;AAcX;"}
1
+ {"version":3,"file":"index-BLb3JiCr.js","sources":["../src/components/select/sanitize-select-props.ts","../src/utils/color.ts","../src/components/select/index.tsx"],"sourcesContent":["const selectKeys = new Set([\n 'aria-activedescendant',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-controls',\n 'aria-describedby',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-live',\n 'aria-owns',\n 'aria-required',\n 'aria-roledescription',\n 'autoComplete',\n 'autoFocus',\n 'className',\n 'defaultValue',\n 'dir',\n 'disabled',\n 'form',\n 'id',\n 'multiple',\n 'name',\n 'onBlur',\n 'onChange',\n 'onClick',\n 'onFocus',\n 'onInput',\n 'onInvalid',\n 'onKeyDown',\n 'onKeyUp',\n 'onMouseDown',\n 'onMouseUp',\n 'onPointerDown',\n 'onPointerUp',\n 'required',\n 'role',\n 'size',\n 'style',\n 'tabIndex',\n 'title',\n 'value',\n]);\n\nexport function sanitizeSelectProps<T extends Record<string, unknown>>(props: T) {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([key]) => key.startsWith('data-') || key.startsWith('aria-') || selectKeys.has(key)\n )\n ) as Partial<T>;\n}\n","const cssVariablePattern = /^--[\\w-]+$/;\nconst cssVariableReferencePattern = /^var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*(.+))?\\)$/;\n\nconst unresolvedColorKeywords = new Set([\n 'currentcolor',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n]);\n\nconst probe = typeof document !== 'undefined' ? document.createElement('span') : null;\n\nfunction normalizeColorValue(input: string): string {\n const value = input.trim();\n\n if (!value || !probe || unresolvedColorKeywords.has(value.toLowerCase())) {\n return value;\n }\n\n const mountNode = document.body ?? document.documentElement;\n\n if (!mountNode) {\n return value;\n }\n\n probe.style.color = value;\n\n if (!probe.style.color) {\n return value;\n }\n\n mountNode.appendChild(probe);\n\n const normalized = getComputedStyle(probe).color.trim();\n probe.remove();\n\n return normalized || value;\n}\n\nexport function resolveColor(input: `--${string}` | string, fallback = 'currentColor'): string {\n if (typeof document === 'undefined') {\n return fallback;\n }\n\n const styles = getComputedStyle(document.documentElement);\n const seen = new Set<string>();\n let current = input.trim();\n\n while (current) {\n const match = current.match(cssVariableReferencePattern);\n const variableName = match?.[1] ?? (cssVariablePattern.test(current) ? current : null);\n const nestedFallback = match?.[2]?.trim();\n\n if (!variableName) {\n return normalizeColorValue(current);\n }\n\n if (seen.has(variableName)) {\n current = nestedFallback ?? '';\n continue;\n }\n\n seen.add(variableName);\n\n current = styles.getPropertyValue(variableName).trim() || nestedFallback || '';\n }\n\n return normalizeColorValue(fallback);\n}\n","import cx from 'classix';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\nimport { resolveColor } from '@/utils/color';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { useTouched } from '@/utils/use-touched';\n\nimport { sanitizeSelectProps } from './sanitize-select-props';\nimport styles from './styles.module.css';\n\nexport type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n children: React.ReactNode;\n label?: string;\n placeholder?: string;\n};\n\ntype withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n};\n\nexport const Select = ({ children, label, placeholder, ...props }: SelectProps) => {\n const { touched, onBlur } = useTouched(props.value === '');\n const selectProps = sanitizeSelectProps(props);\n const { className, onBlur: onBlurProp, style, ...restSelectProps } = selectProps;\n const withVars = {\n ...style,\n '--icon-svg': iconSVG('CaretDown', resolveColor('--colors-semantic-content-secondary')),\n } satisfies withVars;\n\n const selectElement = (\n <select\n className={cx(styles.select, className, touched && styles.touched)}\n onBlur={composeEventHandlers(onBlur, onBlurProp)}\n style={withVars}\n {...restSelectProps}\n >\n {placeholder && (\n <option\n key='placeholder'\n value={''}\n hidden\n >\n {placeholder}\n </option>\n )}\n {children}\n </select>\n );\n\n if (!label) {\n return selectElement;\n }\n\n return (\n <label>\n <span\n className={styles.label}\n data-required={props.required || undefined}\n >\n {label}\n </span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","cssVariablePattern","cssVariableReferencePattern","unresolvedColorKeywords","probe","document","createElement","normalizeColorValue","input","value","trim","toLowerCase","mountNode","body","documentElement","style","color","appendChild","normalized","getComputedStyle","remove","resolveColor","fallback","styles","seen","current","match","variableName","test","nestedFallback","add","getPropertyValue","Select","children","label","placeholder","touched","onBlur","useTouched","selectProps","className","onBlurProp","restSelectProps","withVars","iconSVG","selectElement","cx","select","composeEventHandlers","jsxs","jsx","required","undefined"],"mappings":";;;;AAAA,MAAMA,IAAa,oBAAIC,IAAI,CACzB,yBACA,qBACA,aACA,iBACA,oBACA,gBACA,iBACA,qBACA,iBACA,iBACA,eACA,gBACA,qBACA,cACA,mBACA,aACA,aACA,iBACA,wBACA,gBACA,aACA,aACA,gBACA,OACA,YACA,QACA,MACA,YACA,QACA,UACA,YACA,WACA,WACA,WACA,aACA,aACA,WACA,eACA,aACA,iBACA,eACA,YACA,QACA,QACA,SACA,YACA,SACA,OAAO,CACR;AAEM,SAASC,EAAuDC,GAAU;AAC/E,SAAOC,OAAOC,YACZD,OAAOE,QAAQH,CAAK,EAAEI,OACpB,CAAC,CAACC,CAAG,MAAMA,EAAIC,WAAW,OAAO,KAAKD,EAAIC,WAAW,OAAO,KAAKT,EAAWU,IAAIF,CAAG,CACrF,CACF;AACF;ACzDA,MAAMG,IAAqB,cACrBC,IAA8B,0CAE9BC,IAA0B,oBAAIZ,IAAI,CACtC,gBACA,WACA,WACA,UACA,gBACA,OAAO,CACR,GAEKa,IAAQ,OAAOC,WAAa,MAAcA,SAASC,cAAc,MAAM,IAAI;AAEjF,SAASC,EAAoBC,GAAuB;AAClD,QAAMC,IAAQD,EAAME,KAAAA;AAEpB,MAAI,CAACD,KAAS,CAACL,KAASD,EAAwBH,IAAIS,EAAME,YAAAA,CAAa;AACrE,WAAOF;AAGT,QAAMG,IAAYP,SAASQ,QAAQR,SAASS;AAQ5C,MANI,CAACF,MAILR,EAA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AAA,IAAO,GAAG2B;AAAAA,EAAAA,IAAoBH,GAC/DI,IAAW;AAAA,IACf,GAAG5B;AAAAA,IACH,cAAc6B,EAAQ,aAAavB,EAAa,qCAAqC,CAAC;AAAA,EAAA,GAGlFwB,sBACH,UAAA,EACC,WAAWC,EAAGvB,EAAOwB,QAAQP,GAAWJ,KAAWb,EAAOa,OAAO,GACjE,QAAQY,EAAqBX,GAAQI,CAAU,GAC/C,OAAOE,GACP,GAAID,GAEHP,UAAAA;AAAAA,IAAAA,uBACE,UAAA,EAEC,OAAO,IACP,QAAM,IAELA,eAJG,aAKN;AAAA,IAEDF;AAAAA,EAAAA,GACH;AAGF,SAAKC,IAKH,gBAAAe,EAAC,SAAA,EAAK,kBAAA,UACJ,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAA,EACC,WAAW3B,EAAOW,OAClB,iBAAezC,EAAM0D,YAAYC,QAEhClB,UAAAA,EAAAA,CACH;AAAA,IACCW;AAAAA,EAAAA,GACH,IAZOA;AAcX;"}
@@ -1,2 +1,2 @@
1
- "use strict";require('./assets/index50.css');const u=require("react/jsx-runtime"),C=require("./classix-5H4IWnMA.cjs"),S=require("./icons-Dv_p0bUF.cjs"),p=require("./use-touched-Bq5Gjbpz.cjs"),P=new Set(["aria-activedescendant","aria-autocomplete","aria-busy","aria-controls","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-owns","aria-required","aria-roledescription","autoComplete","autoFocus","className","defaultValue","dir","disabled","form","id","multiple","name","onBlur","onChange","onClick","onFocus","onInput","onInvalid","onKeyDown","onKeyUp","onMouseDown","onMouseUp","onPointerDown","onPointerUp","required","role","size","style","tabIndex","title","value"]);function h(r){return Object.fromEntries(Object.entries(r).filter(([e])=>e.startsWith("data-")||e.startsWith("aria-")||P.has(e)))}const _=/^--[\w-]+$/,q=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\)$/,x=new Set(["currentcolor","inherit","initial","revert","revert-layer","unset"]),l=typeof document<"u"?document.createElement("span"):null;function b(r){const e=r.trim();if(!e||!l||x.has(e.toLowerCase()))return e;const s=document.body??document.documentElement;if(!s||(l.style.color=e,!l.style.color))return e;s.appendChild(l);const n=getComputedStyle(l).color.trim();return l.remove(),n||e}function y(r,e="currentColor"){var i;if(typeof document>"u")return e;const s=getComputedStyle(document.documentElement),n=new Set;let t=r.trim();for(;t;){const o=t.match(q),a=(o==null?void 0:o[1])??(_.test(t)?t:null),c=(i=o==null?void 0:o[2])==null?void 0:i.trim();if(!a)return b(t);if(n.has(a)){t=c??"";continue}n.add(a),t=s.getPropertyValue(a).trim()||c||""}return b(e)}const j="_select_1bm47_3",V="_touched_1bm47_24",g="_label_1bm47_29",d={select:j,touched:V,label:g},E=({children:r,label:e,placeholder:s,...n})=>{const{touched:t,onBlur:i}=p.useTouched(n.value===""),o=h(n),{className:a,onBlur:c,style:v,...f}=o,w={...v,"--icon-svg":S.iconSVG("CaretDown",y("--colors-semantic-content-secondary"))},m=u.jsxs("select",{className:C.t(d.select,a,t&&d.touched),onBlur:p.composeEventHandlers(i,c),style:w,...f,children:[s&&u.jsx("option",{value:"",hidden:!0,children:s},"placeholder"),r]});return e?u.jsxs("label",{"data-component":"select",children:[u.jsx("span",{className:d.label,"data-required":n.required||void 0,children:e}),m]}):m};exports.Select=E;exports.resolveColor=y;exports.sanitizeSelectProps=h;
2
- //# sourceMappingURL=index-CXaYq0By.cjs.map
1
+ "use strict";require('./assets/index53.css');const u=require("react/jsx-runtime"),C=require("./classix-5H4IWnMA.cjs"),S=require("./icons-Dv_p0bUF.cjs"),p=require("./use-touched-Bq5Gjbpz.cjs"),P=new Set(["aria-activedescendant","aria-autocomplete","aria-busy","aria-controls","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-live","aria-owns","aria-required","aria-roledescription","autoComplete","autoFocus","className","defaultValue","dir","disabled","form","id","multiple","name","onBlur","onChange","onClick","onFocus","onInput","onInvalid","onKeyDown","onKeyUp","onMouseDown","onMouseUp","onPointerDown","onPointerUp","required","role","size","style","tabIndex","title","value"]);function h(r){return Object.fromEntries(Object.entries(r).filter(([e])=>e.startsWith("data-")||e.startsWith("aria-")||P.has(e)))}const _=/^--[\w-]+$/,q=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.+))?\)$/,x=new Set(["currentcolor","inherit","initial","revert","revert-layer","unset"]),l=typeof document<"u"?document.createElement("span"):null;function b(r){const e=r.trim();if(!e||!l||x.has(e.toLowerCase()))return e;const s=document.body??document.documentElement;if(!s||(l.style.color=e,!l.style.color))return e;s.appendChild(l);const n=getComputedStyle(l).color.trim();return l.remove(),n||e}function y(r,e="currentColor"){var i;if(typeof document>"u")return e;const s=getComputedStyle(document.documentElement),n=new Set;let t=r.trim();for(;t;){const o=t.match(q),a=(o==null?void 0:o[1])??(_.test(t)?t:null),c=(i=o==null?void 0:o[2])==null?void 0:i.trim();if(!a)return b(t);if(n.has(a)){t=c??"";continue}n.add(a),t=s.getPropertyValue(a).trim()||c||""}return b(e)}const j="_select_1bm47_3",V="_touched_1bm47_24",g="_label_1bm47_29",d={select:j,touched:V,label:g},E=({children:r,label:e,placeholder:s,...n})=>{const{touched:t,onBlur:i}=p.useTouched(n.value===""),o=h(n),{className:a,onBlur:c,style:v,...f}=o,w={...v,"--icon-svg":S.iconSVG("CaretDown",y("--colors-semantic-content-secondary"))},m=u.jsxs("select",{className:C.t(d.select,a,t&&d.touched),onBlur:p.composeEventHandlers(i,c),style:w,...f,children:[s&&u.jsx("option",{value:"",hidden:!0,children:s},"placeholder"),r]});return e?u.jsxs("label",{"data-component":"select",children:[u.jsx("span",{className:d.label,"data-required":n.required||void 0,children:e}),m]}):m};exports.Select=E;exports.resolveColor=y;exports.sanitizeSelectProps=h;
2
+ //# sourceMappingURL=index-Bt7vnwji.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-CXaYq0By.cjs","sources":["../src/components/select/sanitize-select-props.ts","../src/utils/color.ts","../src/components/select/index.tsx"],"sourcesContent":["const selectKeys = new Set([\n 'aria-activedescendant',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-controls',\n 'aria-describedby',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-live',\n 'aria-owns',\n 'aria-required',\n 'aria-roledescription',\n 'autoComplete',\n 'autoFocus',\n 'className',\n 'defaultValue',\n 'dir',\n 'disabled',\n 'form',\n 'id',\n 'multiple',\n 'name',\n 'onBlur',\n 'onChange',\n 'onClick',\n 'onFocus',\n 'onInput',\n 'onInvalid',\n 'onKeyDown',\n 'onKeyUp',\n 'onMouseDown',\n 'onMouseUp',\n 'onPointerDown',\n 'onPointerUp',\n 'required',\n 'role',\n 'size',\n 'style',\n 'tabIndex',\n 'title',\n 'value',\n]);\n\nexport function sanitizeSelectProps<T extends Record<string, unknown>>(props: T) {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([key]) => key.startsWith('data-') || key.startsWith('aria-') || selectKeys.has(key)\n )\n ) as Partial<T>;\n}\n","const cssVariablePattern = /^--[\\w-]+$/;\nconst cssVariableReferencePattern = /^var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*(.+))?\\)$/;\n\nconst unresolvedColorKeywords = new Set([\n 'currentcolor',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n]);\n\nconst probe = typeof document !== 'undefined' ? document.createElement('span') : null;\n\nfunction normalizeColorValue(input: string): string {\n const value = input.trim();\n\n if (!value || !probe || unresolvedColorKeywords.has(value.toLowerCase())) {\n return value;\n }\n\n const mountNode = document.body ?? document.documentElement;\n\n if (!mountNode) {\n return value;\n }\n\n probe.style.color = value;\n\n if (!probe.style.color) {\n return value;\n }\n\n mountNode.appendChild(probe);\n\n const normalized = getComputedStyle(probe).color.trim();\n probe.remove();\n\n return normalized || value;\n}\n\nexport function resolveColor(input: `--${string}` | string, fallback = 'currentColor'): string {\n if (typeof document === 'undefined') {\n return fallback;\n }\n\n const styles = getComputedStyle(document.documentElement);\n const seen = new Set<string>();\n let current = input.trim();\n\n while (current) {\n const match = current.match(cssVariableReferencePattern);\n const variableName = match?.[1] ?? (cssVariablePattern.test(current) ? current : null);\n const nestedFallback = match?.[2]?.trim();\n\n if (!variableName) {\n return normalizeColorValue(current);\n }\n\n if (seen.has(variableName)) {\n current = nestedFallback ?? '';\n continue;\n }\n\n seen.add(variableName);\n\n current = styles.getPropertyValue(variableName).trim() || nestedFallback || '';\n }\n\n return normalizeColorValue(fallback);\n}\n","import cx from 'classix';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\nimport { resolveColor } from '@/utils/color';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { useTouched } from '@/utils/use-touched';\n\nimport { sanitizeSelectProps } from './sanitize-select-props';\nimport styles from './styles.module.css';\n\nexport type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n children: React.ReactNode;\n label?: string;\n placeholder?: string;\n};\n\ntype withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n};\n\nexport const Select = ({ children, label, placeholder, ...props }: SelectProps) => {\n const { touched, onBlur } = useTouched(props.value === '');\n const selectProps = sanitizeSelectProps(props);\n const { className, onBlur: onBlurProp, style, ...restSelectProps } = selectProps;\n const withVars = {\n ...style,\n '--icon-svg': iconSVG('CaretDown', resolveColor('--colors-semantic-content-secondary')),\n } satisfies withVars;\n\n const selectElement = (\n <select\n className={cx(styles.select, className, touched && styles.touched)}\n onBlur={composeEventHandlers(onBlur, onBlurProp)}\n style={withVars}\n {...restSelectProps}\n >\n {placeholder && (\n <option\n key='placeholder'\n value={''}\n hidden\n >\n {placeholder}\n </option>\n )}\n {children}\n </select>\n );\n\n if (!label) {\n return selectElement;\n }\n\n return (\n <label>\n <span\n className={styles.label}\n data-required={props.required || undefined}\n >\n {label}\n </span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","cssVariablePattern","cssVariableReferencePattern","unresolvedColorKeywords","probe","document","createElement","normalizeColorValue","input","value","trim","toLowerCase","mountNode","body","documentElement","style","color","appendChild","normalized","getComputedStyle","remove","resolveColor","fallback","styles","seen","current","match","variableName","test","nestedFallback","add","getPropertyValue","Select","children","label","placeholder","touched","onBlur","useTouched","selectProps","className","onBlurProp","restSelectProps","withVars","iconSVG","selectElement","cx","select","composeEventHandlers","jsxs","jsx","required","undefined"],"mappings":"gKAAMA,EAAa,IAAIC,IAAI,CACzB,wBACA,oBACA,YACA,gBACA,mBACA,eACA,gBACA,oBACA,gBACA,gBACA,cACA,eACA,oBACA,aACA,kBACA,YACA,YACA,gBACA,uBACA,eACA,YACA,YACA,eACA,MACA,WACA,OACA,KACA,WACA,OACA,SACA,WACA,UACA,UACA,UACA,YACA,YACA,UACA,cACA,YACA,gBACA,cACA,WACA,OACA,OACA,QACA,WACA,QACA,OAAO,CACR,EAEM,SAASC,EAAuDC,EAAU,CAC/E,OAAOC,OAAOC,YACZD,OAAOE,QAAQH,CAAK,EAAEI,OACpB,CAAC,CAACC,CAAG,IAAMA,EAAIC,WAAW,OAAO,GAAKD,EAAIC,WAAW,OAAO,GAAKT,EAAWU,IAAIF,CAAG,CACrF,CACF,CACF,CCzDA,MAAMG,EAAqB,aACrBC,EAA8B,yCAE9BC,EAA0B,IAAIZ,IAAI,CACtC,eACA,UACA,UACA,SACA,eACA,OAAO,CACR,EAEKa,EAAQ,OAAOC,SAAa,IAAcA,SAASC,cAAc,MAAM,EAAI,KAEjF,SAASC,EAAoBC,EAAuB,CAClD,MAAMC,EAAQD,EAAME,KAAAA,EAEpB,GAAI,CAACD,GAAS,CAACL,GAASD,EAAwBH,IAAIS,EAAME,YAAAA,CAAa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,EAAW,CACf,GAAG5B,EACH,aAAc6B,EAAAA,QAAQ,YAAavB,EAAa,qCAAqC,CAAC,CAAA,EAGlFwB,SACH,SAAA,CACC,UAAWC,EAAAA,EAAGvB,EAAOwB,OAAQP,EAAWJ,GAAWb,EAAOa,OAAO,EACjE,OAAQY,EAAAA,qBAAqBX,EAAQI,CAAU,EAC/C,MAAOE,EACP,GAAID,EAEHP,SAAAA,CAAAA,SACE,SAAA,CAEC,MAAO,GACP,OAAM,GAELA,YAJG,aAKN,EAEDF,CAAAA,EACH,EAGF,OAAKC,EAKHe,EAAAA,KAAC,QAAA,CAAK,iBAAA,SACJ,SAAA,CAAAC,EAAAA,IAAC,OAAA,CACC,UAAW3B,EAAOW,MAClB,gBAAezC,EAAM0D,UAAYC,OAEhClB,SAAAA,CAAAA,CACH,EACCW,CAAAA,EACH,EAZOA,CAcX"}
1
+ {"version":3,"file":"index-Bt7vnwji.cjs","sources":["../src/components/select/sanitize-select-props.ts","../src/utils/color.ts","../src/components/select/index.tsx"],"sourcesContent":["const selectKeys = new Set([\n 'aria-activedescendant',\n 'aria-autocomplete',\n 'aria-busy',\n 'aria-controls',\n 'aria-describedby',\n 'aria-details',\n 'aria-disabled',\n 'aria-errormessage',\n 'aria-expanded',\n 'aria-haspopup',\n 'aria-hidden',\n 'aria-invalid',\n 'aria-keyshortcuts',\n 'aria-label',\n 'aria-labelledby',\n 'aria-live',\n 'aria-owns',\n 'aria-required',\n 'aria-roledescription',\n 'autoComplete',\n 'autoFocus',\n 'className',\n 'defaultValue',\n 'dir',\n 'disabled',\n 'form',\n 'id',\n 'multiple',\n 'name',\n 'onBlur',\n 'onChange',\n 'onClick',\n 'onFocus',\n 'onInput',\n 'onInvalid',\n 'onKeyDown',\n 'onKeyUp',\n 'onMouseDown',\n 'onMouseUp',\n 'onPointerDown',\n 'onPointerUp',\n 'required',\n 'role',\n 'size',\n 'style',\n 'tabIndex',\n 'title',\n 'value',\n]);\n\nexport function sanitizeSelectProps<T extends Record<string, unknown>>(props: T) {\n return Object.fromEntries(\n Object.entries(props).filter(\n ([key]) => key.startsWith('data-') || key.startsWith('aria-') || selectKeys.has(key)\n )\n ) as Partial<T>;\n}\n","const cssVariablePattern = /^--[\\w-]+$/;\nconst cssVariableReferencePattern = /^var\\(\\s*(--[\\w-]+)\\s*(?:,\\s*(.+))?\\)$/;\n\nconst unresolvedColorKeywords = new Set([\n 'currentcolor',\n 'inherit',\n 'initial',\n 'revert',\n 'revert-layer',\n 'unset',\n]);\n\nconst probe = typeof document !== 'undefined' ? document.createElement('span') : null;\n\nfunction normalizeColorValue(input: string): string {\n const value = input.trim();\n\n if (!value || !probe || unresolvedColorKeywords.has(value.toLowerCase())) {\n return value;\n }\n\n const mountNode = document.body ?? document.documentElement;\n\n if (!mountNode) {\n return value;\n }\n\n probe.style.color = value;\n\n if (!probe.style.color) {\n return value;\n }\n\n mountNode.appendChild(probe);\n\n const normalized = getComputedStyle(probe).color.trim();\n probe.remove();\n\n return normalized || value;\n}\n\nexport function resolveColor(input: `--${string}` | string, fallback = 'currentColor'): string {\n if (typeof document === 'undefined') {\n return fallback;\n }\n\n const styles = getComputedStyle(document.documentElement);\n const seen = new Set<string>();\n let current = input.trim();\n\n while (current) {\n const match = current.match(cssVariableReferencePattern);\n const variableName = match?.[1] ?? (cssVariablePattern.test(current) ? current : null);\n const nestedFallback = match?.[2]?.trim();\n\n if (!variableName) {\n return normalizeColorValue(current);\n }\n\n if (seen.has(variableName)) {\n current = nestedFallback ?? '';\n continue;\n }\n\n seen.add(variableName);\n\n current = styles.getPropertyValue(variableName).trim() || nestedFallback || '';\n }\n\n return normalizeColorValue(fallback);\n}\n","import cx from 'classix';\n\nimport { iconSVG } from '@/components/icon/icons.ts';\nimport { resolveColor } from '@/utils/color';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { useTouched } from '@/utils/use-touched';\n\nimport { sanitizeSelectProps } from './sanitize-select-props';\nimport styles from './styles.module.css';\n\nexport type SelectProps = React.SelectHTMLAttributes<HTMLSelectElement> & {\n children: React.ReactNode;\n label?: string;\n placeholder?: string;\n};\n\ntype withVars = React.CSSProperties & {\n '--icon-svg'?: string;\n};\n\nexport const Select = ({ children, label, placeholder, ...props }: SelectProps) => {\n const { touched, onBlur } = useTouched(props.value === '');\n const selectProps = sanitizeSelectProps(props);\n const { className, onBlur: onBlurProp, style, ...restSelectProps } = selectProps;\n const withVars = {\n ...style,\n '--icon-svg': iconSVG('CaretDown', resolveColor('--colors-semantic-content-secondary')),\n } satisfies withVars;\n\n const selectElement = (\n <select\n className={cx(styles.select, className, touched && styles.touched)}\n onBlur={composeEventHandlers(onBlur, onBlurProp)}\n style={withVars}\n {...restSelectProps}\n >\n {placeholder && (\n <option\n key='placeholder'\n value={''}\n hidden\n >\n {placeholder}\n </option>\n )}\n {children}\n </select>\n );\n\n if (!label) {\n return selectElement;\n }\n\n return (\n <label>\n <span\n className={styles.label}\n data-required={props.required || undefined}\n >\n {label}\n </span>\n {selectElement}\n </label>\n );\n};\n"],"names":["selectKeys","Set","sanitizeSelectProps","props","Object","fromEntries","entries","filter","key","startsWith","has","cssVariablePattern","cssVariableReferencePattern","unresolvedColorKeywords","probe","document","createElement","normalizeColorValue","input","value","trim","toLowerCase","mountNode","body","documentElement","style","color","appendChild","normalized","getComputedStyle","remove","resolveColor","fallback","styles","seen","current","match","variableName","test","nestedFallback","add","getPropertyValue","Select","children","label","placeholder","touched","onBlur","useTouched","selectProps","className","onBlurProp","restSelectProps","withVars","iconSVG","selectElement","cx","select","composeEventHandlers","jsxs","jsx","required","undefined"],"mappings":"gKAAMA,EAAa,IAAIC,IAAI,CACzB,wBACA,oBACA,YACA,gBACA,mBACA,eACA,gBACA,oBACA,gBACA,gBACA,cACA,eACA,oBACA,aACA,kBACA,YACA,YACA,gBACA,uBACA,eACA,YACA,YACA,eACA,MACA,WACA,OACA,KACA,WACA,OACA,SACA,WACA,UACA,UACA,UACA,YACA,YACA,UACA,cACA,YACA,gBACA,cACA,WACA,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AAOpB,EAAoBkB,CAAO,EAGpC,GAAID,EAAKxB,IAAI2B,CAAY,EAAG,CAC1BF,EAAUI,GAAkB,GAC5B,QACF,CAEAL,EAAKM,IAAIH,CAAY,EAErBF,EAAUF,EAAOQ,iBAAiBJ,CAAY,EAAEjB,KAAAA,GAAUmB,GAAkB,EAC9E,CAEA,OAAOtB,EAAoBe,CAAQ,CACrC,oGClDaU,EAASA,CAAC,CAAEC,SAAAA,EAAUC,MAAAA,EAAOC,YAAAA,EAAa,GAAG1C,CAAmB,IAAM,CACjF,KAAM,CAAE2C,QAAAA,EAASC,OAAAA,CAAAA,EAAWC,aAAW7C,EAAMgB,QAAU,EAAE,EACnD8B,EAAc/C,EAAoBC,CAAK,EACvC,CAAE+C,UAAAA,EAAWH,OAAQI,EAAY1B,MAAAA,EAAO,GAAG2B,CAAAA,EAAoBH,EAC/DI,EAAW,CACf,GAAG5B,EACH,aAAc6B,EAAAA,QAAQ,YAAavB,EAAa,qCAAqC,CAAC,CAAA,EAGlFwB,SACH,SAAA,CACC,UAAWC,EAAAA,EAAGvB,EAAOwB,OAAQP,EAAWJ,GAAWb,EAAOa,OAAO,EACjE,OAAQY,EAAAA,qBAAqBX,EAAQI,CAAU,EAC/C,MAAOE,EACP,GAAID,EAEHP,SAAAA,CAAAA,SACE,SAAA,CAEC,MAAO,GACP,OAAM,GAELA,YAJG,aAKN,EAEDF,CAAAA,EACH,EAGF,OAAKC,EAKHe,EAAAA,KAAC,QAAA,CAAK,iBAAA,SACJ,SAAA,CAAAC,EAAAA,IAAC,OAAA,CACC,UAAW3B,EAAOW,MAClB,gBAAezC,EAAM0D,UAAYC,OAEhClB,SAAAA,CAAAA,CACH,EACCW,CAAAA,EACH,EAZOA,CAcX"}
@@ -0,0 +1,2 @@
1
+ "use strict";require('./assets/index48.css');const e=require("react/jsx-runtime"),_=require("./classix-5H4IWnMA.cjs"),r=require("react"),U=require("./icons-Dv_p0bUF.cjs"),F=require("./use-touched-Bq5Gjbpz.cjs");function W(n){return n&&`${n[0].toLocaleUpperCase()}${n.slice(1)}`}function P(n){const o=W(n);return o&&!o.endsWith(":")?`${o}:`:o}const k="_field_yagit_3",A="_input_yagit_8",D="_touched_yagit_48",J="_label_yagit_57",K="_inline_yagit_78",O="_error_yagit_99",Q="_code_yagit_106",t={field:k,input:A,touched:D,label:J,inline:K,error:O,code:Q};function X({className:n,defaultCountryCode:o="+47",disabled:c=!1,errorMessage:b,icon:j,invalid:g=!1,label:m,onBlur:R,placeholder:I,ref:y,required:f,style:B,type:i="text",variant:p="default",...s}){const V=r.useId(),[v,L]=r.useState(""),[l,N]=r.useState(""),{name:q,onChange:u,pattern:w,value:d,...z}=s,{touched:E,onBlur:G}=F.useTouched(d===""),h=j&&i!=="radio"&&i!=="datetime-local"?j:void 0,C=m&&p==="inline"?P(m):m,x=g&&b?V:void 0,S=[s["aria-describedby"],x].filter(Boolean).join(" ")||void 0,T=h?{...B,"--icon-svg":U.iconSVG(h)}:B,$=F.composeEventHandlers(G,R);r.useEffect(()=>{if(u&&i==="tel"){const a={name:q,value:l?(v||o).split(" ").join("")+l.split(" ").join(""):void 0};u({target:a,currentTarget:a})}},[v,o,q,u,l,i]),r.useEffect(()=>{i==="tel"&&!d&&(N(""),L(""))},[i,d]);const H=e.jsxs(e.Fragment,{children:[e.jsx("input",{disabled:c,hidden:!0,onChange:u,pattern:void 0,placeholder:I,ref:y,type:i,value:d}),e.jsx("input",{type:"text",className:_.t(t.code,t.input),disabled:c,maxLength:5,onChange:a=>L(a.target.value),placeholder:o,value:v}),e.jsx("input",{...z,"aria-describedby":S,"aria-invalid":g?!0:s["aria-invalid"],type:"tel",className:_.t(t.input,n,E&&t.touched),"data-icon":h?"true":void 0,disabled:c,maxLength:14,name:void 0,onChange:a=>N(a.target.value),onBlur:$,pattern:w,required:f,style:T,value:l})]});return e.jsxs("div",{className:t.field,"data-component":"input",children:[e.jsxs("label",{className:_.t(t.label,p==="inline"&&t.inline),children:[C&&e.jsx("span",{"data-required":f&&p!=="inline"?!0:void 0,children:C}),i==="tel"?H:e.jsx("input",{...s,"aria-describedby":S,"aria-invalid":g?!0:s["aria-invalid"],ref:y,className:_.t(t.input,n,E&&t.touched),"data-icon":h?"true":void 0,disabled:c,onBlur:$,placeholder:I,required:f,style:T,type:i})]}),x&&e.jsx("span",{className:t.error,id:x,role:"alert",children:b})]})}exports.Input=X;exports.formatInlineLabel=P;
2
+ //# sourceMappingURL=index-CQlMdqOp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CQlMdqOp.cjs","sources":["../src/utils/text.ts","../src/components/input/index.tsx"],"sourcesContent":["export function capitalizeFirstLetter(value: string): string {\n return value ? `${value[0].toLocaleUpperCase()}${value.slice(1)}` : value;\n}\n\nexport function formatInlineLabel(value: string): string {\n const label = capitalizeFirstLetter(value);\n return label && !label.endsWith(':') ? `${label}:` : label;\n}\n","import cx from 'classix';\nimport { useEffect, useId, useState } from 'react';\n\nimport { IconName, iconSVG } from '@/components/icon/icons.ts';\nimport { composeEventHandlers } from '@/utils/compose-event-handlers';\nimport { formatInlineLabel } from '@/utils/text';\nimport { useTouched } from '@/utils/use-touched';\n\nimport styles from './styles.module.css';\n\nexport type InputProps = React.ComponentPropsWithRef<'input'> & {\n defaultCountryCode?: string;\n disabled?: boolean;\n errorMessage?: React.ReactNode;\n icon?: IconName;\n invalid?: boolean;\n label?: string;\n onClick?: React.MouseEventHandler<HTMLInputElement>;\n placeholder?: string;\n variant?: 'default' | 'inline';\n type?:\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'number'\n | 'password'\n | 'radio'\n | 'search'\n | 'tel'\n | 'text';\n};\n\nexport function Input({\n className,\n defaultCountryCode = '+47',\n disabled = false,\n errorMessage,\n icon,\n invalid = false,\n label,\n onBlur: onBlurProp,\n placeholder,\n ref,\n required,\n style,\n type = 'text',\n variant = 'default',\n ...props\n}: InputProps) {\n const generatedErrorId = useId();\n const [countryCode, setCountryCode] = useState('');\n const [phoneNumber, setPhoneNumber] = useState('');\n const { name, onChange, pattern, value, ...restProps } = props;\n const { touched, onBlur } = useTouched(value === '');\n const inputIcon = icon && type !== 'radio' && type !== 'datetime-local' ? icon : undefined;\n const displayLabel = label && variant === 'inline' ? formatInlineLabel(label) : label;\n const errorId = invalid && errorMessage ? generatedErrorId : undefined;\n const describedBy = [props['aria-describedby'], errorId].filter(Boolean).join(' ') || undefined;\n\n type withVars =\n | (React.CSSProperties & {\n '--icon-svg'?: string;\n })\n | undefined;\n\n const withVars: withVars = inputIcon\n ? {\n ...style,\n '--icon-svg': iconSVG(inputIcon),\n }\n : style;\n const handleBlur = composeEventHandlers(onBlur, onBlurProp);\n\n useEffect(() => {\n if (onChange && type === 'tel') {\n const target = {\n name,\n value: phoneNumber\n ? (countryCode || defaultCountryCode).split(' ').join('') +\n phoneNumber.split(' ').join('')\n : undefined,\n } as unknown as HTMLInputElement;\n\n onChange({ target, currentTarget: target } as React.ChangeEvent<HTMLInputElement>);\n }\n }, [countryCode, defaultCountryCode, name, onChange, phoneNumber, type]);\n\n useEffect(() => {\n if (type === 'tel' && !value) {\n setPhoneNumber('');\n setCountryCode('');\n }\n }, [type, value]);\n\n const telephoneInput = (\n <>\n <input\n disabled={disabled}\n hidden\n onChange={onChange}\n pattern={undefined}\n placeholder={placeholder}\n ref={ref}\n type={type}\n value={value}\n />\n <input\n type='text'\n className={cx(styles.code, styles.input)}\n disabled={disabled}\n maxLength={5}\n onChange={(e) => setCountryCode(e.target.value)}\n placeholder={defaultCountryCode}\n value={countryCode}\n />\n <input\n {...restProps}\n aria-describedby={describedBy}\n aria-invalid={invalid ? true : props['aria-invalid']}\n type='tel'\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n maxLength={14}\n name={undefined}\n onChange={(e) => setPhoneNumber(e.target.value)}\n onBlur={handleBlur}\n pattern={pattern}\n required={required}\n style={withVars}\n value={phoneNumber}\n />\n </>\n );\n\n return (\n <div className={styles.field}>\n <label className={cx(styles.label, variant === 'inline' && styles.inline)}>\n {displayLabel && (\n <span data-required={required && variant !== 'inline' ? true : undefined}>\n {displayLabel}\n </span>\n )}\n {type === 'tel' ? (\n telephoneInput\n ) : (\n <input\n {...props}\n aria-describedby={describedBy}\n aria-invalid={invalid ? true : props['aria-invalid']}\n ref={ref}\n className={cx(styles.input, className, touched && styles.touched)}\n data-icon={inputIcon ? 'true' : undefined}\n disabled={disabled}\n onBlur={handleBlur}\n placeholder={placeholder}\n required={required}\n style={withVars}\n type={type}\n />\n )}\n </label>\n {errorId && (\n <span\n className={styles.error}\n id={errorId}\n role='alert'\n >\n {errorMessage}\n </span>\n )}\n </div>\n );\n}\n"],"names":["capitalizeFirstLetter","value","toLocaleUpperCase","slice","formatInlineLabel","label","endsWith","Input","className","defaultCountryCode","disabled","errorMessage","icon","invalid","onBlur","onBlurProp","placeholder","ref","required","style","type","variant","props","generatedErrorId","useId","countryCode","setCountryCode","useState","phoneNumber","setPhoneNumber","name","onChange","pattern","restProps","touched","useTouched","inputIcon","undefined","displayLabel","errorId","describedBy","filter","Boolean","join","withVars","iconSVG","handleBlur","composeEventHandlers","useEffect","target","split","currentTarget","telephoneInput","jsxs","Fragment","jsx","cx","styles","code","input","e","field","inline","error"],"mappings":"mLAAO,SAASA,EAAsBC,EAAuB,CAC3D,OAAOA,GAAQ,GAAGA,EAAM,CAAC,EAAEC,mBAAmB,GAAGD,EAAME,MAAM,CAAC,CAAC,EACjE,CAEO,SAASC,EAAkBH,EAAuB,CACvD,MAAMI,EAAQL,EAAsBC,CAAK,EACzC,OAAOI,GAAS,CAACA,EAAMC,SAAS,GAAG,EAAI,GAAGD,CAAK,IAAMA,CACvD,kNCyBO,SAASE,EAAM,CACpBC,UAAAA,EACAC,mBAAAA,EAAqB,MACrBC,SAAAA,EAAW,GACXC,aAAAA,EACAC,KAAAA,EACAC,QAAAA,EAAU,GACVR,MAAAA,EACAS,OAAQC,EACRC,YAAAA,EACAC,IAAAA,EACAC,SAAAA,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AWuC,EAAAA,EAAGC,EAAOE,MAAOnD,EAAW0B,GAAWuB,EAAOvB,OAAO,EAChE,YAAWE,EAAY,OAASC,OAChC,SAAA3B,EACA,OAAQoC,EACR,YAAA9B,EACA,SAAAE,EACA,MAAO0B,EACP,KAAAxB,CAAA,CAAW,CAAA,EAGjB,EACCmB,GACCgB,EAAAA,IAAC,OAAA,CACC,UAAWE,EAAOM,MAClB,GAAIxB,EACJ,KAAK,QAEJ5B,SAAAA,CAAAA,CACH,CAAA,EAEJ,CAEJ"}
@@ -0,0 +1,83 @@
1
+ import { jsxs as b, Fragment as k, jsx as a } from "react/jsx-runtime";
2
+ import { t as m } from "./classix-DG18itHa.js";
3
+ import { useId as A, useState as T, useEffect as V } from "react";
4
+ import { i as D } from "./icons-dUP7sKyt.js";
5
+ import { u as J, c as K } from "./use-touched-B999bBr8.js";
6
+ import './assets/index48.css';function O(t) {
7
+ return t && `${t[0].toLocaleUpperCase()}${t.slice(1)}`;
8
+ }
9
+ function Q(t) {
10
+ const i = O(t);
11
+ return i && !i.endsWith(":") ? `${i}:` : i;
12
+ }
13
+ const R = "_field_yagit_3", X = "_input_yagit_8", Y = "_touched_yagit_48", Z = "_label_yagit_57", q = "_inline_yagit_78", M = "_error_yagit_99", ee = "_code_yagit_106", e = {
14
+ field: R,
15
+ input: X,
16
+ touched: Y,
17
+ label: Z,
18
+ inline: q,
19
+ error: M,
20
+ code: ee
21
+ };
22
+ function re({
23
+ className: t,
24
+ defaultCountryCode: i = "+47",
25
+ disabled: c = !1,
26
+ errorMessage: y,
27
+ icon: I,
28
+ invalid: h = !1,
29
+ label: p,
30
+ onBlur: w,
31
+ placeholder: x,
32
+ ref: B,
33
+ required: _,
34
+ style: N,
35
+ type: n = "text",
36
+ variant: f = "default",
37
+ ...r
38
+ }) {
39
+ const z = A(), [g, L] = T(""), [l, j] = T(""), {
40
+ name: C,
41
+ onChange: s,
42
+ pattern: G,
43
+ value: d,
44
+ ...H
45
+ } = r, {
46
+ touched: E,
47
+ onBlur: U
48
+ } = J(d === ""), u = I && n !== "radio" && n !== "datetime-local" ? I : void 0, $ = p && f === "inline" ? Q(p) : p, v = h && y ? z : void 0, F = [r["aria-describedby"], v].filter(Boolean).join(" ") || void 0, P = u ? {
49
+ ...N,
50
+ "--icon-svg": D(u)
51
+ } : N, S = K(U, w);
52
+ V(() => {
53
+ if (s && n === "tel") {
54
+ const o = {
55
+ name: C,
56
+ value: l ? (g || i).split(" ").join("") + l.split(" ").join("") : void 0
57
+ };
58
+ s({
59
+ target: o,
60
+ currentTarget: o
61
+ });
62
+ }
63
+ }, [g, i, C, s, l, n]), V(() => {
64
+ n === "tel" && !d && (j(""), L(""));
65
+ }, [n, d]);
66
+ const W = /* @__PURE__ */ b(k, { children: [
67
+ /* @__PURE__ */ a("input", { disabled: c, hidden: !0, onChange: s, pattern: void 0, placeholder: x, ref: B, type: n, value: d }),
68
+ /* @__PURE__ */ a("input", { type: "text", className: m(e.code, e.input), disabled: c, maxLength: 5, onChange: (o) => L(o.target.value), placeholder: i, value: g }),
69
+ /* @__PURE__ */ a("input", { ...H, "aria-describedby": F, "aria-invalid": h ? !0 : r["aria-invalid"], type: "tel", className: m(e.input, t, E && e.touched), "data-icon": u ? "true" : void 0, disabled: c, maxLength: 14, name: void 0, onChange: (o) => j(o.target.value), onBlur: S, pattern: G, required: _, style: P, value: l })
70
+ ] });
71
+ return /* @__PURE__ */ b("div", { className: e.field, "data-component": "input", children: [
72
+ /* @__PURE__ */ b("label", { className: m(e.label, f === "inline" && e.inline), children: [
73
+ $ && /* @__PURE__ */ a("span", { "data-required": _ && f !== "inline" ? !0 : void 0, children: $ }),
74
+ n === "tel" ? W : /* @__PURE__ */ a("input", { ...r, "aria-describedby": F, "aria-invalid": h ? !0 : r["aria-invalid"], ref: B, className: m(e.input, t, E && e.touched), "data-icon": u ? "true" : void 0, disabled: c, onBlur: S, placeholder: x, required: _, style: P, type: n })
75
+ ] }),
76
+ v && /* @__PURE__ */ a("span", { className: e.error, id: v, role: "alert", children: y })
77
+ ] });
78
+ }
79
+ export {
80
+ re as I,
81
+ Q as f
82
+ };
83
+ //# sourceMappingURL=index-CbJ2-IPc.js.map