@brightlocal/ui-components 0.1.1 → 0.1.3

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 (244) hide show
  1. package/dist/accordion.cjs +1 -1
  2. package/dist/accordion.d.ts +74 -4
  3. package/dist/accordion.d.ts.map +1 -1
  4. package/dist/accordion.js +100 -105
  5. package/dist/alert-dialog.cjs +1 -1
  6. package/dist/alert-dialog.d.ts +30 -10
  7. package/dist/alert-dialog.d.ts.map +1 -1
  8. package/dist/alert-dialog.js +129 -132
  9. package/dist/alert.d.ts +22 -1
  10. package/dist/alert.d.ts.map +1 -1
  11. package/dist/aspect-ratio.cjs +1 -1
  12. package/dist/aspect-ratio.d.ts +11 -1
  13. package/dist/aspect-ratio.d.ts.map +1 -1
  14. package/dist/aspect-ratio.js +16 -20
  15. package/dist/avatar.cjs +1 -1
  16. package/dist/avatar.d.ts +43 -3
  17. package/dist/avatar.d.ts.map +1 -1
  18. package/dist/avatar.js +18 -16
  19. package/dist/badge.cjs +1 -1
  20. package/dist/badge.d.ts +24 -9
  21. package/dist/badge.d.ts.map +1 -1
  22. package/dist/badge.js +34 -32
  23. package/dist/blocks/data-table.cjs +1 -1
  24. package/dist/blocks/data-table.d.ts.map +1 -1
  25. package/dist/blocks/data-table.js +209 -202
  26. package/dist/blocks/sidebar.cjs +1 -1
  27. package/dist/blocks/sidebar.d.ts +1 -1
  28. package/dist/blocks/sidebar.d.ts.map +1 -1
  29. package/dist/blocks/sidebar.js +154 -154
  30. package/dist/breadcrumb.cjs +1 -1
  31. package/dist/breadcrumb.d.ts +63 -8
  32. package/dist/breadcrumb.d.ts.map +1 -1
  33. package/dist/breadcrumb.js +97 -93
  34. package/dist/button.cjs +1 -1
  35. package/dist/button.d.ts +17 -45
  36. package/dist/button.d.ts.map +1 -1
  37. package/dist/button.js +49 -50
  38. package/dist/calendar.cjs +1 -1
  39. package/dist/calendar.d.ts +12 -0
  40. package/dist/calendar.d.ts.map +1 -1
  41. package/dist/calendar.js +10 -8
  42. package/dist/card.cjs +1 -1
  43. package/dist/card.d.ts +58 -18
  44. package/dist/card.d.ts.map +1 -1
  45. package/dist/card.js +60 -51
  46. package/dist/carousel.cjs +1 -1
  47. package/dist/carousel.d.ts +99 -9
  48. package/dist/carousel.d.ts.map +1 -1
  49. package/dist/carousel.js +142 -128
  50. package/dist/centred-layout.cjs +1 -1
  51. package/dist/centred-layout.d.ts +18 -2
  52. package/dist/centred-layout.d.ts.map +1 -1
  53. package/dist/centred-layout.js +46 -33
  54. package/dist/chart.cjs +4 -4
  55. package/dist/chart.d.ts +70 -7
  56. package/dist/chart.d.ts.map +1 -1
  57. package/dist/chart.js +71 -66
  58. package/dist/checkbox.cjs +1 -1
  59. package/dist/checkbox.d.ts +9 -5
  60. package/dist/checkbox.d.ts.map +1 -1
  61. package/dist/checkbox.js +61 -82
  62. package/dist/collapsible.cjs +1 -1
  63. package/dist/collapsible.d.ts +65 -8
  64. package/dist/collapsible.d.ts.map +1 -1
  65. package/dist/collapsible.js +41 -55
  66. package/dist/combobox.cjs +1 -1
  67. package/dist/combobox.d.ts +29 -11
  68. package/dist/combobox.d.ts.map +1 -1
  69. package/dist/combobox.js +193 -159
  70. package/dist/command.cjs +1 -1
  71. package/dist/command.d.ts +115 -9
  72. package/dist/command.d.ts.map +1 -1
  73. package/dist/command.js +176 -152
  74. package/dist/context-menu.cjs +1 -1
  75. package/dist/context-menu.d.ts +188 -20
  76. package/dist/context-menu.d.ts.map +1 -1
  77. package/dist/context-menu.js +119 -121
  78. package/dist/date-picker.cjs +1 -1
  79. package/dist/date-picker.d.ts +75 -9
  80. package/dist/date-picker.d.ts.map +1 -1
  81. package/dist/date-picker.js +220 -81
  82. package/dist/description.cjs +1 -0
  83. package/dist/description.d.ts +37 -0
  84. package/dist/description.d.ts.map +1 -0
  85. package/dist/description.js +25 -0
  86. package/dist/dialog.cjs +1 -1
  87. package/dist/dialog.d.ts +73 -9
  88. package/dist/dialog.d.ts.map +1 -1
  89. package/dist/dialog.js +103 -112
  90. package/dist/drawer.cjs +1 -1
  91. package/dist/drawer.d.ts +92 -0
  92. package/dist/drawer.d.ts.map +1 -1
  93. package/dist/drawer.js +67 -52
  94. package/dist/dropdown-menu.cjs +1 -1
  95. package/dist/dropdown-menu.d.ts +95 -11
  96. package/dist/dropdown-menu.d.ts.map +1 -1
  97. package/dist/dropdown-menu.js +146 -106
  98. package/dist/field.cjs +1 -1
  99. package/dist/field.d.ts +23 -6
  100. package/dist/field.d.ts.map +1 -1
  101. package/dist/field.js +54 -53
  102. package/dist/global-layout.cjs +1 -1
  103. package/dist/global-layout.d.ts +27 -17
  104. package/dist/global-layout.d.ts.map +1 -1
  105. package/dist/global-layout.js +86 -79
  106. package/dist/hover-card.cjs +1 -1
  107. package/dist/hover-card.d.ts +36 -6
  108. package/dist/hover-card.d.ts.map +1 -1
  109. package/dist/hover-card.js +44 -42
  110. package/dist/index.cjs +1 -1
  111. package/dist/index.d.ts +1 -1
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +383 -387
  114. package/dist/input-group.cjs +1 -1
  115. package/dist/input-group.d.ts +21 -2
  116. package/dist/input-group.d.ts.map +1 -1
  117. package/dist/input-group.js +51 -41
  118. package/dist/input-password.cjs +1 -1
  119. package/dist/input-password.d.ts.map +1 -1
  120. package/dist/input-password.js +24 -25
  121. package/dist/input.cjs +1 -1
  122. package/dist/input.d.ts +38 -24
  123. package/dist/input.d.ts.map +1 -1
  124. package/dist/input.js +68 -136
  125. package/dist/label.cjs +1 -1
  126. package/dist/label.d.ts +20 -1
  127. package/dist/label.d.ts.map +1 -1
  128. package/dist/label.js +31 -18
  129. package/dist/logo.cjs +1 -1
  130. package/dist/logo.d.ts +3 -0
  131. package/dist/logo.d.ts.map +1 -1
  132. package/dist/logo.js +12 -10
  133. package/dist/menubar.cjs +1 -1
  134. package/dist/menubar.d.ts +40 -6
  135. package/dist/menubar.d.ts.map +1 -1
  136. package/dist/menubar.js +97 -76
  137. package/dist/popover.cjs +1 -1
  138. package/dist/popover.d.ts +59 -4
  139. package/dist/popover.d.ts.map +1 -1
  140. package/dist/popover.js +42 -34
  141. package/dist/progress.cjs +1 -1
  142. package/dist/progress.d.ts +9 -2
  143. package/dist/progress.d.ts.map +1 -1
  144. package/dist/progress.js +71 -59
  145. package/dist/radio-group.d.ts +40 -0
  146. package/dist/radio-group.d.ts.map +1 -1
  147. package/dist/rating.d.ts +4 -0
  148. package/dist/rating.d.ts.map +1 -1
  149. package/dist/resizable.cjs +1 -1
  150. package/dist/resizable.d.ts +65 -4
  151. package/dist/resizable.d.ts.map +1 -1
  152. package/dist/resizable.js +53 -36
  153. package/dist/scroll-area.cjs +1 -1
  154. package/dist/scroll-area.d.ts +46 -5
  155. package/dist/scroll-area.d.ts.map +1 -1
  156. package/dist/scroll-area.js +42 -38
  157. package/dist/select.cjs +1 -1
  158. package/dist/select.d.ts +30 -0
  159. package/dist/select.d.ts.map +1 -1
  160. package/dist/select.js +64 -54
  161. package/dist/separator.cjs +1 -1
  162. package/dist/separator.d.ts +49 -2
  163. package/dist/separator.d.ts.map +1 -1
  164. package/dist/separator.js +48 -36
  165. package/dist/sheet.cjs +1 -1
  166. package/dist/sheet.d.ts +80 -9
  167. package/dist/sheet.d.ts.map +1 -1
  168. package/dist/sheet.js +117 -113
  169. package/dist/skeleton.cjs +1 -1
  170. package/dist/skeleton.d.ts +24 -2
  171. package/dist/skeleton.d.ts.map +1 -1
  172. package/dist/skeleton.js +15 -9
  173. package/dist/slider.cjs +1 -1
  174. package/dist/slider.d.ts +18 -4
  175. package/dist/slider.d.ts.map +1 -1
  176. package/dist/slider.js +72 -66
  177. package/dist/sonner.cjs +1 -1
  178. package/dist/sonner.d.ts +4 -2
  179. package/dist/sonner.d.ts.map +1 -1
  180. package/dist/sonner.js +29 -28
  181. package/dist/split-layout.d.ts +4 -1
  182. package/dist/split-layout.d.ts.map +1 -1
  183. package/dist/table.cjs +1 -1
  184. package/dist/table.js +1 -1
  185. package/dist/toggle-group.cjs +1 -1
  186. package/dist/toggle-group.d.ts +3 -1
  187. package/dist/toggle-group.d.ts.map +1 -1
  188. package/dist/toggle-group.js +38 -36
  189. package/package.json +8 -2
  190. package/src/blocks/data-table.tsx +42 -32
  191. package/src/blocks/sidebar.tsx +4 -12
  192. package/src/components/accordion.tsx +163 -77
  193. package/src/components/alert-dialog.tsx +156 -111
  194. package/src/components/alert.tsx +26 -13
  195. package/src/components/aspect-ratio.tsx +25 -16
  196. package/src/components/avatar.tsx +56 -8
  197. package/src/components/badge.tsx +65 -42
  198. package/src/components/breadcrumb.tsx +158 -82
  199. package/src/components/button.tsx +41 -62
  200. package/src/components/calendar.tsx +16 -2
  201. package/src/components/card.tsx +92 -40
  202. package/src/components/carousel.tsx +240 -115
  203. package/src/components/centred-layout.tsx +67 -35
  204. package/src/components/chart.tsx +118 -47
  205. package/src/components/checkbox.tsx +42 -78
  206. package/src/components/collapsible.tsx +95 -26
  207. package/src/components/combobox.tsx +242 -144
  208. package/src/components/command.tsx +295 -121
  209. package/src/components/context-menu.tsx +278 -81
  210. package/src/components/date-picker.tsx +281 -30
  211. package/src/components/description.tsx +60 -0
  212. package/src/components/dialog.tsx +162 -86
  213. package/src/components/drawer.tsx +76 -2
  214. package/src/components/dropdown-menu.tsx +143 -37
  215. package/src/components/field.tsx +36 -11
  216. package/src/components/global-layout.tsx +116 -77
  217. package/src/components/hover-card.tsx +54 -14
  218. package/src/components/input-group.tsx +56 -18
  219. package/src/components/input-password.tsx +3 -4
  220. package/src/components/input.tsx +93 -186
  221. package/src/components/label.tsx +56 -15
  222. package/src/components/logo.tsx +3 -0
  223. package/src/components/menubar.tsx +58 -4
  224. package/src/components/popover.tsx +103 -20
  225. package/src/components/progress.tsx +82 -60
  226. package/src/components/radio-group.tsx +40 -0
  227. package/src/components/rating.tsx +4 -1
  228. package/src/components/resizable.tsx +119 -31
  229. package/src/components/scroll-area.tsx +123 -56
  230. package/src/components/select.tsx +21 -1
  231. package/src/components/separator.tsx +97 -20
  232. package/src/components/sheet.tsx +180 -79
  233. package/src/components/skeleton.tsx +40 -10
  234. package/src/components/slider.tsx +83 -57
  235. package/src/components/sonner.tsx +10 -7
  236. package/src/components/split-layout.tsx +4 -1
  237. package/src/components/table.tsx +1 -1
  238. package/src/components/toggle-group.tsx +4 -0
  239. package/src/index.ts +1 -1
  240. package/dist/input-base.cjs +0 -1
  241. package/dist/input-base.d.ts +0 -28
  242. package/dist/input-base.d.ts.map +0 -1
  243. package/dist/input-base.js +0 -56
  244. package/src/components/input-base.tsx +0 -86
package/dist/select.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),z=require("react"),_=require("@radix-ui/react-select"),m=require("lucide-react"),q=require("class-variance-authority"),s=require("@brightlocal/ui-components/lib/utils"),k=require("@brightlocal/ui-components/label");function v(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const u=v(z),a=v(_);function C({label:e,description:r,optional:n,placeholder:l,children:o,"aria-label":c,...f}){const d=u.useId(),g=`${d}-label`,y=`${d}-description`,p=r,w=e||p,x={placeholder:l,"aria-required":n?void 0:!0,"aria-label":c},N={...x,id:d},b=(i,I)=>u.isValidElement(i)&&i.type===h?u.cloneElement(i,I):i;return w?t.jsxs("div",{className:"flex flex-col gap-2",children:[e&&t.jsx(k.Label,{htmlFor:d,id:g,optional:n,children:e}),t.jsx(a.Root,{"data-slot":"select",...f,children:u.Children.map(o,i=>b(i,N))}),p&&t.jsx("p",{className:"text-muted-foreground text-sm",id:y,children:p})]}):t.jsx(a.Root,{"data-slot":"select",...f,children:u.Children.map(o,i=>b(i,x))})}function T(e){return t.jsx(a.Group,{"data-slot":"select-group",...e})}function P(e){return t.jsx(a.Value,{"data-slot":"select-value",...e})}const D=q.cva(["relative flex w-full h-9 items-center justify-between gap-2","px-3 py-2","border border-border rounded-lg outline-none transition-all","bg-neutral-50 border-neutral-300","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans text-foreground","[&>span]:block [&>span]:truncate","data-[placeholder]:text-muted-foreground","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0","[&_svg:not([class*='size-'])]:size-4","[&_svg:not([class*='text-'])]:text-muted-foreground"]);function h({className:e,children:r,placeholder:n,dataHook:l,...o}){const c=o["aria-invalid"]===!0||o["aria-invalid"]==="true",f=o["aria-required"]===!0||o["aria-required"]==="true",d=o["aria-label"]||n||"Select an option",g=c?"border-destructive dark:border-destructive focus-visible:border-destructive focus-visible:shadow-destructive":"";return t.jsxs(a.Trigger,{...o,"aria-invalid":c?"true":void 0,"aria-label":d,"aria-required":f?"true":void 0,className:s.cn(D(),g,e),"data-hook":l,"data-slot":"select-trigger",children:[r,t.jsx(a.Icon,{asChild:!0,children:t.jsx(m.ChevronDownIcon,{className:"text-muted-foreground size-4"})})]})}function R({className:e,children:r,position:n="popper",...l}){const o=s.cn("relative z-50 overflow-hidden","min-w-[8rem]","rounded-md border border-border bg-popover shadow-md","text-popover-foreground","max-h-[var(--radix-select-content-available-height)]","origin-[var(--radix-select-content-transform-origin)]","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2"),c=n==="popper"&&s.cn("data-[side=bottom]:translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1","data-[side=top]:-translate-y-1");return t.jsx(a.Portal,{children:t.jsxs(a.Content,{className:s.cn(o,c,e),"data-slot":"select-content",position:n,...l,children:[t.jsx(S,{}),t.jsx(a.Viewport,{className:s.cn("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),t.jsx(j,{})]})})}function V({className:e,...r}){return t.jsx(a.Label,{className:s.cn("text-muted-foreground px-2 py-1.5 text-xs font-medium",e),"data-slot":"select-label",...r})}function B({className:e,children:r,...n}){const l=s.cn("relative flex w-full cursor-default select-none items-center gap-2","rounded py-1.5 pl-2 pr-8","text-sm font-normal leading-5 text-popover-foreground","focus:bg-accent focus:text-accent-foreground","hover:bg-accent/50 hover:text-accent-foreground","outline-none focus:outline-none","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0","[&_svg:not([class*='size-'])]:size-4","[&_svg:not([class*='text-'])]:text-foreground");return t.jsxs(a.Item,{className:s.cn(l,e),"data-slot":"select-item",...n,children:[t.jsx("span",{className:"absolute right-2 flex size-4 items-center justify-center",children:t.jsx(a.ItemIndicator,{children:t.jsx(m.CheckIcon,{className:"size-4"})})}),t.jsx(a.ItemText,{children:r})]})}function O({className:e,...r}){return t.jsx(a.Separator,{className:s.cn("bg-border pointer-events-none -mx-1 my-1 h-px",e),"data-slot":"select-separator",...r})}function S({className:e,...r}){return t.jsx(a.ScrollUpButton,{className:s.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...r,children:t.jsx(m.ChevronUpIcon,{className:"size-4"})})}function j({className:e,...r}){return t.jsx(a.ScrollDownButton,{className:s.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...r,children:t.jsx(m.ChevronDownIcon,{className:"size-4"})})}exports.Select=C;exports.SelectContent=R;exports.SelectGroup=T;exports.SelectItem=B;exports.SelectLabel=V;exports.SelectScrollDownButton=j;exports.SelectScrollUpButton=S;exports.SelectSeparator=O;exports.SelectTrigger=h;exports.SelectValue=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),D=require("react"),P=require("@radix-ui/react-select"),p=require("lucide-react"),V=require("class-variance-authority"),s=require("@brightlocal/ui-components/lib/utils"),R=require("@brightlocal/ui-components/label");function j(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,l.get?l:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const u=j(D),a=j(P);function y({label:e,description:r,optional:o,placeholder:l,children:n,"aria-label":c,...m}){const d=u.useId(),f=`${d}-label`,k=`${d}-description`,g=r,C=e||g,S={placeholder:l,"aria-required":o?void 0:!0,"aria-label":c},T={...S,id:d},h=(i,B)=>u.isValidElement(i)&&i.type===b?u.cloneElement(i,B):i;return C?t.jsxs("div",{className:"flex flex-col gap-2",children:[e&&t.jsx(R.Label,{htmlFor:d,id:f,optional:o,children:e}),t.jsx(a.Root,{"data-slot":"select",...m,children:u.Children.map(n,i=>h(i,T))}),g&&t.jsx("p",{className:"text-muted-foreground text-sm",id:k,children:g})]}):t.jsx(a.Root,{"data-slot":"select",...m,children:u.Children.map(n,i=>h(i,S))})}y.displayName="Select";function N(e){return t.jsx(a.Group,{"data-slot":"select-group",...e})}N.displayName="SelectGroup";function w(e){return t.jsx(a.Value,{"data-slot":"select-value",...e})}w.displayName="SelectValue";const L=V.cva(["relative flex w-full h-9 items-center justify-between gap-2","px-3 py-2","border border-border rounded-sm outline-none transition-all","bg-neutral-50 border-neutral-300","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans text-foreground","[&>span]:block [&>span]:truncate","data-[placeholder]:text-muted-foreground","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0","[&_svg:not([class*='size-'])]:size-4","[&_svg:not([class*='text-'])]:text-muted-foreground"]);function b({className:e,children:r,placeholder:o,dataHook:l,...n}){const c=n["aria-invalid"]===!0||n["aria-invalid"]==="true",m=n["aria-required"]===!0||n["aria-required"]==="true",d=n["aria-label"]||o||"Select an option",f=c?"border-destructive dark:border-destructive focus-visible:border-destructive focus-visible:shadow-destructive":"";return t.jsxs(a.Trigger,{...n,"aria-invalid":c?"true":void 0,"aria-label":d,"aria-required":m?"true":void 0,className:s.cn(L(),f,e),"data-hook":l,"data-slot":"select-trigger",children:[r,t.jsx(a.Icon,{asChild:!0,children:t.jsx(p.ChevronDownIcon,{className:"text-muted-foreground size-4"})})]})}b.displayName="SelectTrigger";function I({className:e,children:r,position:o="popper",...l}){const n=s.cn("relative z-50 overflow-hidden","min-w-[8rem]","rounded-md border border-border bg-popover shadow-md","text-popover-foreground","max-h-[var(--radix-select-content-available-height)]","origin-[var(--radix-select-content-transform-origin)]","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2"),c=o==="popper"&&s.cn("data-[side=bottom]:translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1","data-[side=top]:-translate-y-1");return t.jsx(a.Portal,{children:t.jsxs(a.Content,{className:s.cn(n,c,e),"data-slot":"select-content",position:o,...l,children:[t.jsx(x,{}),t.jsx(a.Viewport,{className:s.cn("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),t.jsx(v,{})]})})}I.displayName="SelectContent";function z({className:e,...r}){return t.jsx(a.Label,{className:s.cn("text-muted-foreground px-2 py-1.5 text-xs font-medium",e),"data-slot":"select-label",...r})}z.displayName="SelectLabel";function _({className:e,children:r,...o}){const l=s.cn("relative flex w-full cursor-default select-none items-center gap-2","rounded py-1.5 pl-2 pr-8","text-sm font-normal leading-5 text-popover-foreground","focus:bg-accent focus:text-accent-foreground","hover:bg-accent/50 hover:text-accent-foreground","outline-none focus:outline-none","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0","[&_svg:not([class*='size-'])]:size-4","[&_svg:not([class*='text-'])]:text-foreground");return t.jsxs(a.Item,{className:s.cn(l,e),"data-slot":"select-item",...o,children:[t.jsx("span",{className:"absolute right-2 flex size-4 items-center justify-center",children:t.jsx(a.ItemIndicator,{children:t.jsx(p.CheckIcon,{className:"size-4"})})}),t.jsx(a.ItemText,{children:r})]})}_.displayName="SelectItem";function q({className:e,...r}){return t.jsx(a.Separator,{className:s.cn("bg-border pointer-events-none -mx-1 my-1 h-px",e),"data-slot":"select-separator",...r})}q.displayName="SelectSeparator";function x({className:e,...r}){return t.jsx(a.ScrollUpButton,{className:s.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...r,children:t.jsx(p.ChevronUpIcon,{className:"size-4"})})}x.displayName="SelectScrollUpButton";function v({className:e,...r}){return t.jsx(a.ScrollDownButton,{className:s.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...r,children:t.jsx(p.ChevronDownIcon,{className:"size-4"})})}v.displayName="SelectScrollDownButton";exports.Select=y;exports.SelectContent=I;exports.SelectGroup=N;exports.SelectItem=_;exports.SelectLabel=z;exports.SelectScrollDownButton=v;exports.SelectScrollUpButton=x;exports.SelectSeparator=q;exports.SelectTrigger=b;exports.SelectValue=w;
package/dist/select.d.ts CHANGED
@@ -20,14 +20,23 @@ interface SelectProps extends React.ComponentProps<typeof SelectPrimitive.Root>
20
20
  * Error state should be managed via Form components (FormMessage).
21
21
  */
22
22
  declare function Select({ label, description, optional, placeholder, children, "aria-label": ariaLabel, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
23
+ declare namespace Select {
24
+ var displayName: string;
25
+ }
23
26
  /**
24
27
  * SelectGroup - Groups related select options together
25
28
  */
26
29
  declare function SelectGroup(props: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
30
+ declare namespace SelectGroup {
31
+ var displayName: string;
32
+ }
27
33
  /**
28
34
  * SelectValue - Displays the selected value in the trigger
29
35
  */
30
36
  declare function SelectValue(props: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
37
+ declare namespace SelectValue {
38
+ var displayName: string;
39
+ }
31
40
  interface SelectTriggerProps extends React.ComponentProps<typeof SelectPrimitive.Trigger> {
32
41
  /** Placeholder text when no value is selected */
33
42
  placeholder?: string;
@@ -38,14 +47,23 @@ interface SelectTriggerProps extends React.ComponentProps<typeof SelectPrimitive
38
47
  * SelectTrigger - The button that opens the select dropdown
39
48
  */
40
49
  declare function SelectTrigger({ className, children, placeholder, dataHook, ...props }: SelectTriggerProps): import("react/jsx-runtime").JSX.Element;
50
+ declare namespace SelectTrigger {
51
+ var displayName: string;
52
+ }
41
53
  /**
42
54
  * SelectContent - The dropdown container for select options
43
55
  */
44
56
  declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
57
+ declare namespace SelectContent {
58
+ var displayName: string;
59
+ }
45
60
  /**
46
61
  * SelectLabel - Label for a group of select options
47
62
  */
48
63
  declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
64
+ declare namespace SelectLabel {
65
+ var displayName: string;
66
+ }
49
67
  /**
50
68
  * SelectItem - Individual selectable option in the dropdown
51
69
  *
@@ -60,18 +78,30 @@ declare function SelectLabel({ className, ...props }: React.ComponentProps<typeo
60
78
  * </SelectItem>
61
79
  */
62
80
  declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
81
+ declare namespace SelectItem {
82
+ var displayName: string;
83
+ }
63
84
  /**
64
85
  * SelectSeparator - Visual separator between select items or groups
65
86
  */
66
87
  declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
88
+ declare namespace SelectSeparator {
89
+ var displayName: string;
90
+ }
67
91
  /**
68
92
  * SelectScrollUpButton - Button to scroll up in the dropdown (when content overflows)
69
93
  */
70
94
  declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
95
+ declare namespace SelectScrollUpButton {
96
+ var displayName: string;
97
+ }
71
98
  /**
72
99
  * SelectScrollDownButton - Button to scroll down in the dropdown (when content overflows)
73
100
  */
74
101
  declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
102
+ declare namespace SelectScrollDownButton {
103
+ var displayName: string;
104
+ }
75
105
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
76
106
  export type { SelectProps, SelectTriggerProps };
77
107
  //# sourceMappingURL=select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/components/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAW1D,UAAU,WAAY,SAAQ,KAAK,CAAC,cAAc,CAChD,OAAO,eAAe,CAAC,IAAI,CAC5B;IACC,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,OAAO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H,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAsCnD;kBA1CQ,UAAU;;;AA8CnB;;GAEG;AACH,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,2CAQxD;kBAXQ,eAAe;;;AAexB;;GAEG;AACH,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,cAAc,CAAC,2CAa7D;kBAhBQ,oBAAoB;;;AAoB7B;;GAEG;AACH,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,2CAa/D;kBAhBQ,sBAAsB;;;AAoB/B,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAC;AAEF,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC"}
package/dist/select.js CHANGED
@@ -1,54 +1,57 @@
1
- import { jsx as e, jsxs as f } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
2
  import * as u from "react";
3
3
  import * as r from "@radix-ui/react-select";
4
- import { CheckIcon as N, ChevronDownIcon as h, ChevronUpIcon as z } from "lucide-react";
5
- import { cva as I } from "class-variance-authority";
4
+ import { CheckIcon as k, ChevronDownIcon as h, ChevronUpIcon as C } from "lucide-react";
5
+ import { cva as T } from "class-variance-authority";
6
6
  import { cn as n } from "@brightlocal/ui-components/lib/utils";
7
- import { Label as k } from "@brightlocal/ui-components/label";
8
- function R({
7
+ import { Label as _ } from "@brightlocal/ui-components/label";
8
+ function j({
9
9
  label: t,
10
10
  description: a,
11
11
  optional: s,
12
- placeholder: l,
12
+ placeholder: i,
13
13
  children: o,
14
14
  "aria-label": d,
15
15
  ...m
16
16
  }) {
17
- const c = u.useId(), p = `${c}-label`, x = `${c}-description`, g = a, S = t || g, b = {
18
- placeholder: l,
17
+ const c = u.useId(), f = `${c}-label`, N = `${c}-description`, g = a, w = t || g, b = {
18
+ placeholder: i,
19
19
  "aria-required": s ? void 0 : !0,
20
20
  "aria-label": d
21
- }, w = {
21
+ }, I = {
22
22
  ...b,
23
23
  id: c
24
- }, v = (i, y) => u.isValidElement(i) && i.type === _ ? u.cloneElement(
25
- i,
26
- y
27
- ) : i;
28
- return S ? /* @__PURE__ */ f("div", { className: "flex flex-col gap-2", children: [
29
- t && /* @__PURE__ */ e(k, { htmlFor: c, id: p, optional: s, children: t }),
24
+ }, v = (l, z) => u.isValidElement(l) && l.type === x ? u.cloneElement(
25
+ l,
26
+ z
27
+ ) : l;
28
+ return w ? /* @__PURE__ */ p("div", { className: "flex flex-col gap-2", children: [
29
+ t && /* @__PURE__ */ e(_, { htmlFor: c, id: f, optional: s, children: t }),
30
30
  /* @__PURE__ */ e(r.Root, { "data-slot": "select", ...m, children: u.Children.map(
31
31
  o,
32
- (i) => v(i, w)
32
+ (l) => v(l, I)
33
33
  ) }),
34
- g && /* @__PURE__ */ e("p", { className: "text-muted-foreground text-sm", id: x, children: g })
34
+ g && /* @__PURE__ */ e("p", { className: "text-muted-foreground text-sm", id: N, children: g })
35
35
  ] }) : /* @__PURE__ */ e(r.Root, { "data-slot": "select", ...m, children: u.Children.map(
36
36
  o,
37
- (i) => v(i, b)
37
+ (l) => v(l, b)
38
38
  ) });
39
39
  }
40
- function D(t) {
40
+ j.displayName = "Select";
41
+ function B(t) {
41
42
  return /* @__PURE__ */ e(r.Group, { "data-slot": "select-group", ...t });
42
43
  }
43
- function E(t) {
44
+ B.displayName = "SelectGroup";
45
+ function V(t) {
44
46
  return /* @__PURE__ */ e(r.Value, { "data-slot": "select-value", ...t });
45
47
  }
46
- const C = I([
48
+ V.displayName = "SelectValue";
49
+ const q = T([
47
50
  // Base layout
48
51
  "relative flex w-full h-9 items-center justify-between gap-2",
49
52
  "px-3 py-2",
50
53
  // Base appearance
51
- "border border-border rounded-lg outline-none transition-all",
54
+ "border border-border rounded-sm outline-none transition-all",
52
55
  "bg-neutral-50 border-neutral-300",
53
56
  "dark:bg-white/5 dark:border-white/15",
54
57
  // Typography
@@ -69,23 +72,23 @@ const C = I([
69
72
  "[&_svg:not([class*='size-'])]:size-4",
70
73
  "[&_svg:not([class*='text-'])]:text-muted-foreground"
71
74
  ]);
72
- function _({
75
+ function x({
73
76
  className: t,
74
77
  children: a,
75
78
  placeholder: s,
76
- dataHook: l,
79
+ dataHook: i,
77
80
  ...o
78
81
  }) {
79
- const d = o["aria-invalid"] === !0 || o["aria-invalid"] === "true", m = o["aria-required"] === !0 || o["aria-required"] === "true", c = o["aria-label"] || s || "Select an option", p = d ? "border-destructive dark:border-destructive focus-visible:border-destructive focus-visible:shadow-destructive" : "";
80
- return /* @__PURE__ */ f(
82
+ const d = o["aria-invalid"] === !0 || o["aria-invalid"] === "true", m = o["aria-required"] === !0 || o["aria-required"] === "true", c = o["aria-label"] || s || "Select an option", f = d ? "border-destructive dark:border-destructive focus-visible:border-destructive focus-visible:shadow-destructive" : "";
83
+ return /* @__PURE__ */ p(
81
84
  r.Trigger,
82
85
  {
83
86
  ...o,
84
87
  "aria-invalid": d ? "true" : void 0,
85
88
  "aria-label": c,
86
89
  "aria-required": m ? "true" : void 0,
87
- className: n(C(), p, t),
88
- "data-hook": l,
90
+ className: n(q(), f, t),
91
+ "data-hook": i,
89
92
  "data-slot": "select-trigger",
90
93
  children: [
91
94
  a,
@@ -94,11 +97,12 @@ function _({
94
97
  }
95
98
  );
96
99
  }
97
- function U({
100
+ x.displayName = "SelectTrigger";
101
+ function L({
98
102
  className: t,
99
103
  children: a,
100
104
  position: s = "popper",
101
- ...l
105
+ ...i
102
106
  }) {
103
107
  const o = n(
104
108
  // Base appearance
@@ -123,15 +127,15 @@ function U({
123
127
  "data-[side=right]:translate-x-1",
124
128
  "data-[side=top]:-translate-y-1"
125
129
  );
126
- return /* @__PURE__ */ e(r.Portal, { children: /* @__PURE__ */ f(
130
+ return /* @__PURE__ */ e(r.Portal, { children: /* @__PURE__ */ p(
127
131
  r.Content,
128
132
  {
129
133
  className: n(o, d, t),
130
134
  "data-slot": "select-content",
131
135
  position: s,
132
- ...l,
136
+ ...i,
133
137
  children: [
134
- /* @__PURE__ */ e(T, {}),
138
+ /* @__PURE__ */ e(S, {}),
135
139
  /* @__PURE__ */ e(
136
140
  r.Viewport,
137
141
  {
@@ -142,12 +146,13 @@ function U({
142
146
  children: a
143
147
  }
144
148
  ),
145
- /* @__PURE__ */ e(j, {})
149
+ /* @__PURE__ */ e(y, {})
146
150
  ]
147
151
  }
148
152
  ) });
149
153
  }
150
- function G({
154
+ L.displayName = "SelectContent";
155
+ function D({
151
156
  className: t,
152
157
  ...a
153
158
  }) {
@@ -163,12 +168,13 @@ function G({
163
168
  }
164
169
  );
165
170
  }
166
- function $({
171
+ D.displayName = "SelectLabel";
172
+ function P({
167
173
  className: t,
168
174
  children: a,
169
175
  ...s
170
176
  }) {
171
- const l = n(
177
+ const i = n(
172
178
  // Base layout
173
179
  "relative flex w-full cursor-default select-none items-center gap-2",
174
180
  "rounded py-1.5 pl-2 pr-8",
@@ -185,20 +191,21 @@ function $({
185
191
  "[&_svg:not([class*='size-'])]:size-4",
186
192
  "[&_svg:not([class*='text-'])]:text-foreground"
187
193
  );
188
- return /* @__PURE__ */ f(
194
+ return /* @__PURE__ */ p(
189
195
  r.Item,
190
196
  {
191
- className: n(l, t),
197
+ className: n(i, t),
192
198
  "data-slot": "select-item",
193
199
  ...s,
194
200
  children: [
195
- /* @__PURE__ */ e("span", { className: "absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ e(r.ItemIndicator, { children: /* @__PURE__ */ e(N, { className: "size-4" }) }) }),
201
+ /* @__PURE__ */ e("span", { className: "absolute right-2 flex size-4 items-center justify-center", children: /* @__PURE__ */ e(r.ItemIndicator, { children: /* @__PURE__ */ e(k, { className: "size-4" }) }) }),
196
202
  /* @__PURE__ */ e(r.ItemText, { children: a })
197
203
  ]
198
204
  }
199
205
  );
200
206
  }
201
- function F({
207
+ P.displayName = "SelectItem";
208
+ function R({
202
209
  className: t,
203
210
  ...a
204
211
  }) {
@@ -211,7 +218,8 @@ function F({
211
218
  }
212
219
  );
213
220
  }
214
- function T({
221
+ R.displayName = "SelectSeparator";
222
+ function S({
215
223
  className: t,
216
224
  ...a
217
225
  }) {
@@ -224,11 +232,12 @@ function T({
224
232
  ),
225
233
  "data-slot": "select-scroll-up-button",
226
234
  ...a,
227
- children: /* @__PURE__ */ e(z, { className: "size-4" })
235
+ children: /* @__PURE__ */ e(C, { className: "size-4" })
228
236
  }
229
237
  );
230
238
  }
231
- function j({
239
+ S.displayName = "SelectScrollUpButton";
240
+ function y({
232
241
  className: t,
233
242
  ...a
234
243
  }) {
@@ -245,15 +254,16 @@ function j({
245
254
  }
246
255
  );
247
256
  }
257
+ y.displayName = "SelectScrollDownButton";
248
258
  export {
249
- R as Select,
250
- U as SelectContent,
251
- D as SelectGroup,
252
- $ as SelectItem,
253
- G as SelectLabel,
254
- j as SelectScrollDownButton,
255
- T as SelectScrollUpButton,
256
- F as SelectSeparator,
257
- _ as SelectTrigger,
258
- E as SelectValue
259
+ j as Select,
260
+ L as SelectContent,
261
+ B as SelectGroup,
262
+ P as SelectItem,
263
+ D as SelectLabel,
264
+ y as SelectScrollDownButton,
265
+ S as SelectScrollUpButton,
266
+ R as SelectSeparator,
267
+ x as SelectTrigger,
268
+ V as SelectValue
259
269
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("@radix-ui/react-separator"),i=require("@brightlocal/ui-components/lib/utils");function c(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const u=c(l);var s=(t=>(t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))(s||{});function n({className:t,orientation:e="horizontal",decorative:r=!0,...o}){return a.jsx(u.Root,{className:i.cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),"data-slot":"separator-root",decorative:r,orientation:e,...o})}function p({className:t,children:e}){return a.jsxs("div",{className:i.cn("flex items-center gap-2",t),"data-slot":"separator-with-text",children:[a.jsx(n,{className:"flex-1"}),a.jsx("span",{className:"text-sidebar-foreground shrink-0 text-sm leading-none font-medium whitespace-nowrap",children:e}),a.jsx(n,{className:"flex-1"})]})}exports.Separator=n;exports.SeparatorOrientation=s;exports.SeparatorWithText=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("react"),h=require("@radix-ui/react-separator"),l=require("@brightlocal/ui-components/lib/utils");function c(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const d=c(x),g=c(h);var u=(t=>(t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))(u||{});const n=d.forwardRef(({className:t,orientation:a="horizontal",decorative:e=!0,dataHook:r,trackingEl:i,trackingLabel:s,...f},m)=>o.jsx(g.Root,{ref:m,className:l.cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),"data-hook":r,"data-slot":"separator","data-tracking-el":i,"data-tracking-label":s,decorative:e,orientation:a,...f}));n.displayName="Separator";const p=d.forwardRef(({className:t,children:a,dataHook:e,trackingEl:r,trackingLabel:i},s)=>o.jsxs("div",{ref:s,className:l.cn("flex items-center gap-2",t),"data-hook":e,"data-slot":"separator-with-text","data-tracking-el":r,"data-tracking-label":i,children:[o.jsx(n,{className:"flex-1"}),o.jsx("span",{className:"text-sidebar-foreground shrink-0 text-sm leading-none font-medium whitespace-nowrap",children:a}),o.jsx(n,{className:"flex-1"})]}));p.displayName="SeparatorWithText";exports.Separator=n;exports.SeparatorOrientation=u;exports.SeparatorWithText=p;
@@ -4,11 +4,58 @@ export declare enum SeparatorOrientation {
4
4
  HORIZONTAL = "horizontal",
5
5
  VERTICAL = "vertical"
6
6
  }
7
- declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
7
+ /**
8
+ * Props for the Separator component.
9
+ */
10
+ interface SeparatorProps extends React.ComponentProps<typeof SeparatorPrimitive.Root> {
11
+ /**
12
+ * Data hook for automated testing
13
+ */
14
+ dataHook?: string;
15
+ /**
16
+ * Tracking element identifier for analytics
17
+ */
18
+ trackingEl?: string;
19
+ /**
20
+ * Tracking label for analytics context
21
+ */
22
+ trackingLabel?: string;
23
+ }
24
+ /**
25
+ * Separator visually divides content using a horizontal or vertical line.
26
+ * Built on Radix UI Separator primitive.
27
+ */
28
+ declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
29
+ /**
30
+ * Props for the SeparatorWithText component.
31
+ */
8
32
  interface SeparatorWithTextProps {
33
+ /**
34
+ * Additional CSS classes
35
+ */
9
36
  className?: string;
37
+ /**
38
+ * Text content to display between separators
39
+ */
10
40
  children: React.ReactNode;
41
+ /**
42
+ * Data hook for automated testing
43
+ */
44
+ dataHook?: string;
45
+ /**
46
+ * Tracking element identifier for analytics
47
+ */
48
+ trackingEl?: string;
49
+ /**
50
+ * Tracking label for analytics context
51
+ */
52
+ trackingLabel?: string;
11
53
  }
12
- declare function SeparatorWithText({ className, children }: SeparatorWithTextProps): import("react/jsx-runtime").JSX.Element;
54
+ /**
55
+ * SeparatorWithText displays a horizontal separator with centered text.
56
+ * Commonly used for "OR" dividers in forms.
57
+ */
58
+ declare const SeparatorWithText: React.ForwardRefExoticComponent<SeparatorWithTextProps & React.RefAttributes<HTMLDivElement>>;
13
59
  export { Separator, SeparatorWithText };
60
+ export type { SeparatorProps, SeparatorWithTextProps };
14
61
  //# sourceMappingURL=separator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../src/components/separator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAIhE,oBAAY,oBAAoB;IAC9B,UAAU,eAAe;IACzB,QAAQ,aAAa;CACtB;AAED,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,WAA6C,EAC7C,UAAiB,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,2CAatD;AAED,UAAU,sBAAsB;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,iBAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,sBAAsB,2CAazE;AAED,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"separator.d.ts","sourceRoot":"","sources":["../../src/components/separator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAIhE,oBAAY,oBAAoB;IAC9B,UAAU,eAAe;IACzB,QAAQ,aAAa;CACtB;AAED;;GAEG;AACH,UAAU,cAAe,SAAQ,KAAK,CAAC,cAAc,CACnD,OAAO,kBAAkB,CAAC,IAAI,CAC/B;IACC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,QAAA,MAAM,SAAS,oGAiCd,CAAC;AAIF;;GAEG;AACH,UAAU,sBAAsB;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,QAAA,MAAM,iBAAiB,+FAoBrB,CAAC;AAIH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;AAExC,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,CAAC"}
package/dist/separator.js CHANGED
@@ -1,43 +1,55 @@
1
- import { jsx as a, jsxs as s } from "react/jsx-runtime";
2
- import * as l from "@radix-ui/react-separator";
3
- import { cn as o } from "@brightlocal/ui-components/lib/utils";
4
- var m = /* @__PURE__ */ ((t) => (t.HORIZONTAL = "horizontal", t.VERTICAL = "vertical", t))(m || {});
5
- function e({
6
- className: t,
7
- orientation: r = "horizontal",
8
- decorative: i = !0,
9
- ...n
10
- }) {
11
- return /* @__PURE__ */ a(
12
- l.Root,
1
+ import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import * as f from "@radix-ui/react-separator";
4
+ import { cn as d } from "@brightlocal/ui-components/lib/utils";
5
+ var h = /* @__PURE__ */ ((a) => (a.HORIZONTAL = "horizontal", a.VERTICAL = "vertical", a))(h || {});
6
+ const n = s.forwardRef(
7
+ ({
8
+ className: a,
9
+ orientation: r = "horizontal",
10
+ decorative: e = !0,
11
+ dataHook: o,
12
+ trackingEl: i,
13
+ trackingLabel: l,
14
+ ...m
15
+ }, c) => /* @__PURE__ */ t(
16
+ f.Root,
13
17
  {
14
- className: o(
18
+ ref: c,
19
+ className: d(
15
20
  "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
16
- t
21
+ a
17
22
  ),
18
- "data-slot": "separator-root",
19
- decorative: i,
23
+ "data-hook": o,
24
+ "data-slot": "separator",
25
+ "data-tracking-el": i,
26
+ "data-tracking-label": l,
27
+ decorative: e,
20
28
  orientation: r,
21
- ...n
29
+ ...m
22
30
  }
23
- );
24
- }
25
- function d({ className: t, children: r }) {
26
- return /* @__PURE__ */ s(
27
- "div",
28
- {
29
- className: o("flex items-center gap-2", t),
30
- "data-slot": "separator-with-text",
31
- children: [
32
- /* @__PURE__ */ a(e, { className: "flex-1" }),
33
- /* @__PURE__ */ a("span", { className: "text-sidebar-foreground shrink-0 text-sm leading-none font-medium whitespace-nowrap", children: r }),
34
- /* @__PURE__ */ a(e, { className: "flex-1" })
35
- ]
36
- }
37
- );
38
- }
31
+ )
32
+ );
33
+ n.displayName = "Separator";
34
+ const x = s.forwardRef(({ className: a, children: r, dataHook: e, trackingEl: o, trackingLabel: i }, l) => /* @__PURE__ */ p(
35
+ "div",
36
+ {
37
+ ref: l,
38
+ className: d("flex items-center gap-2", a),
39
+ "data-hook": e,
40
+ "data-slot": "separator-with-text",
41
+ "data-tracking-el": o,
42
+ "data-tracking-label": i,
43
+ children: [
44
+ /* @__PURE__ */ t(n, { className: "flex-1" }),
45
+ /* @__PURE__ */ t("span", { className: "text-sidebar-foreground shrink-0 text-sm leading-none font-medium whitespace-nowrap", children: r }),
46
+ /* @__PURE__ */ t(n, { className: "flex-1" })
47
+ ]
48
+ }
49
+ ));
50
+ x.displayName = "SeparatorWithText";
39
51
  export {
40
- e as Separator,
41
- m as SeparatorOrientation,
42
- d as SeparatorWithText
52
+ n as Separator,
53
+ h as SeparatorOrientation,
54
+ x as SeparatorWithText
43
55
  };
package/dist/sheet.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),c=require("@radix-ui/react-dialog"),u=require("class-variance-authority"),f=require("lucide-react"),n=require("@brightlocal/ui-components/lib/utils");function h(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,r.get?r:{enumerable:!0,get:()=>t[s]})}}return e.default=t,Object.freeze(e)}const a=h(c);var i=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t))(i||{});const g=u.cva(["bg-background","data-[state=open]:animate-in","data-[state=closed]:animate-out","fixed","z-50","flex","flex-col","gap-4","p-6","shadow-lg","transition","ease-in-out","data-[state=closed]:duration-300","data-[state=open]:duration-500"],{variants:{side:{top:["data-[state=closed]:slide-out-to-top","data-[state=open]:slide-in-from-top","inset-x-0","top-0","h-auto","border-b"],right:["data-[state=closed]:slide-out-to-right","data-[state=open]:slide-in-from-right","inset-y-0","right-0","h-full","w-3/4","border-l","sm:max-w-sm"],bottom:["data-[state=closed]:slide-out-to-bottom","data-[state=open]:slide-in-from-bottom","inset-x-0","bottom-0","h-auto","border-t"],left:["data-[state=closed]:slide-out-to-left","data-[state=open]:slide-in-from-left","inset-y-0","left-0","h-full","w-3/4","border-r","sm:max-w-sm"]}},defaultVariants:{side:"right"}});function m({...t}){return o.jsx(a.Root,{"data-slot":"sheet",modal:!0,...t})}function p({...t}){return o.jsx(a.Trigger,{"data-slot":"sheet-trigger",...t})}function x({...t}){return o.jsx(a.Close,{"data-slot":"sheet-close",...t})}function l({...t}){return o.jsx(a.Portal,{"data-slot":"sheet-portal",...t})}function d({className:t,...e}){return o.jsx(a.Overlay,{className:n.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),"data-slot":"sheet-overlay",...e})}function b({className:t,children:e,side:s,...r}){return o.jsxs(l,{children:[o.jsx(d,{}),o.jsxs(a.Content,{className:n.cn(g({side:s}),t),"data-slot":"sheet-content",...r,children:[e,o.jsxs(a.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[o.jsx(f.XIcon,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function j({className:t,...e}){return o.jsx("div",{className:n.cn("flex flex-col gap-2 text-center sm:text-left",t),"data-slot":"sheet-header",...e})}function S({className:t,...e}){return o.jsx("div",{className:n.cn("mt-auto flex flex-col gap-2 sm:flex-row sm:justify-end",t),"data-slot":"sheet-footer",...e})}function v({className:t,...e}){return o.jsx(a.Title,{className:n.cn("text-foreground text-lg font-semibold",t),"data-slot":"sheet-title",...e})}function y({className:t,...e}){return o.jsx(a.Description,{className:n.cn("text-muted-foreground text-sm",t),"data-slot":"sheet-description",...e})}exports.Sheet=m;exports.SheetClose=x;exports.SheetContent=b;exports.SheetDescription=y;exports.SheetFooter=S;exports.SheetHeader=j;exports.SheetOverlay=d;exports.SheetPortal=l;exports.SheetSide=i;exports.SheetTitle=v;exports.SheetTrigger=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),w=require("react"),T=require("@radix-ui/react-dialog"),R=require("class-variance-authority"),O=require("lucide-react"),n=require("@brightlocal/ui-components/lib/utils");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const r=c(w),s=c(T);var f=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e))(f||{});const C=R.cva(["bg-background","data-[state=open]:animate-in","data-[state=closed]:animate-out","fixed","z-50","flex","flex-col","gap-4","p-6","shadow-lg","transition","ease-in-out","data-[state=closed]:duration-300","data-[state=open]:duration-500"],{variants:{side:{top:["data-[state=closed]:slide-out-to-top","data-[state=open]:slide-in-from-top","inset-x-0","top-0","h-auto","border-b"],right:["data-[state=closed]:slide-out-to-right","data-[state=open]:slide-in-from-right","inset-y-0","right-0","h-full","w-3/4","border-l","sm:max-w-sm"],bottom:["data-[state=closed]:slide-out-to-bottom","data-[state=open]:slide-in-from-bottom","inset-x-0","bottom-0","h-auto","border-t"],left:["data-[state=closed]:slide-out-to-left","data-[state=open]:slide-in-from-left","inset-y-0","left-0","h-full","w-3/4","border-r","sm:max-w-sm"]}},defaultVariants:{side:"right"}});function h({...e}){return o.jsx(s.Root,{"data-slot":"sheet",modal:!0,...e})}h.displayName="Sheet";const u=r.forwardRef(({dataHook:e,...t},a)=>o.jsx(s.Trigger,{ref:a,"data-hook":e,"data-slot":"sheet-trigger",...t}));u.displayName="SheetTrigger";const m=r.forwardRef(({...e},t)=>o.jsx(s.Close,{ref:t,"data-slot":"sheet-close",...e}));m.displayName="SheetClose";function l({...e}){return o.jsx(s.Portal,{"data-slot":"sheet-portal",...e})}l.displayName="SheetPortal";const d=r.forwardRef(({className:e,...t},a)=>o.jsx(s.Overlay,{ref:a,className:n.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),"data-slot":"sheet-overlay",...t}));d.displayName="SheetOverlay";const p=r.forwardRef(({className:e,children:t,side:a,dataHook:i,trackingEl:y,trackingLabel:j,...v},N)=>o.jsxs(l,{children:[o.jsx(d,{}),o.jsxs(s.Content,{ref:N,className:n.cn(C({side:a}),e),"data-hook":i,"data-slot":"sheet-content","data-tracking-el":y,"data-tracking-label":j,...v,children:[t,o.jsxs(s.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[o.jsx(O.XIcon,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));p.displayName="SheetContent";const g=r.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:n.cn("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"sheet-header",...t}));g.displayName="SheetHeader";const x=r.forwardRef(({className:e,...t},a)=>o.jsx("div",{ref:a,className:n.cn("mt-auto flex flex-col gap-2 sm:flex-row sm:justify-end",e),"data-slot":"sheet-footer",...t}));x.displayName="SheetFooter";const S=r.forwardRef(({className:e,...t},a)=>o.jsx(s.Title,{ref:a,className:n.cn("text-foreground text-lg font-semibold",e),"data-slot":"sheet-title",...t}));S.displayName="SheetTitle";const b=r.forwardRef(({className:e,...t},a)=>o.jsx(s.Description,{ref:a,className:n.cn("text-muted-foreground text-sm",e),"data-slot":"sheet-description",...t}));b.displayName="SheetDescription";exports.Sheet=h;exports.SheetClose=m;exports.SheetContent=p;exports.SheetDescription=b;exports.SheetFooter=x;exports.SheetHeader=g;exports.SheetOverlay=d;exports.SheetPortal=l;exports.SheetSide=f;exports.SheetTitle=S;exports.SheetTrigger=u;