@brightlocal/ui-components 0.1.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 (320) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +349 -0
  3. package/dist/accordion.cjs +1 -0
  4. package/dist/accordion.d.ts +32 -0
  5. package/dist/accordion.d.ts.map +1 -0
  6. package/dist/accordion.js +107 -0
  7. package/dist/alert-dialog.cjs +1 -0
  8. package/dist/alert-dialog.d.ts +15 -0
  9. package/dist/alert-dialog.d.ts.map +1 -0
  10. package/dist/alert-dialog.js +146 -0
  11. package/dist/alert.cjs +1 -0
  12. package/dist/alert.d.ts +16 -0
  13. package/dist/alert.d.ts.map +1 -0
  14. package/dist/alert.js +174 -0
  15. package/dist/aspect-ratio.cjs +1 -0
  16. package/dist/aspect-ratio.d.ts +10 -0
  17. package/dist/aspect-ratio.d.ts.map +1 -0
  18. package/dist/aspect-ratio.js +22 -0
  19. package/dist/avatar.cjs +1 -0
  20. package/dist/avatar.d.ts +11 -0
  21. package/dist/avatar.d.ts.map +1 -0
  22. package/dist/avatar.js +46 -0
  23. package/dist/badge.cjs +1 -0
  24. package/dist/badge.d.ts +19 -0
  25. package/dist/badge.d.ts.map +1 -0
  26. package/dist/badge.js +50 -0
  27. package/dist/blocks/data-table.cjs +1 -0
  28. package/dist/blocks/data-table.d.ts +303 -0
  29. package/dist/blocks/data-table.d.ts.map +1 -0
  30. package/dist/blocks/data-table.js +555 -0
  31. package/dist/blocks/sidebar.cjs +1 -0
  32. package/dist/blocks/sidebar.d.ts +744 -0
  33. package/dist/blocks/sidebar.d.ts.map +1 -0
  34. package/dist/blocks/sidebar.js +839 -0
  35. package/dist/breadcrumb.cjs +1 -0
  36. package/dist/breadcrumb.d.ts +12 -0
  37. package/dist/breadcrumb.d.ts.map +1 -0
  38. package/dist/breadcrumb.js +102 -0
  39. package/dist/button.cjs +1 -0
  40. package/dist/button.d.ts +73 -0
  41. package/dist/button.d.ts.map +1 -0
  42. package/dist/button.js +195 -0
  43. package/dist/calendar.cjs +1 -0
  44. package/dist/calendar.d.ts +28 -0
  45. package/dist/calendar.d.ts.map +1 -0
  46. package/dist/calendar.js +191 -0
  47. package/dist/card.cjs +1 -0
  48. package/dist/card.d.ts +28 -0
  49. package/dist/card.d.ts.map +1 -0
  50. package/dist/card.js +131 -0
  51. package/dist/carousel.cjs +1 -0
  52. package/dist/carousel.d.ts +21 -0
  53. package/dist/carousel.d.ts.map +1 -0
  54. package/dist/carousel.js +185 -0
  55. package/dist/centred-layout.cjs +1 -0
  56. package/dist/centred-layout.d.ts +49 -0
  57. package/dist/centred-layout.d.ts.map +1 -0
  58. package/dist/centred-layout.js +35 -0
  59. package/dist/chart.cjs +10 -0
  60. package/dist/chart.d.ts +83 -0
  61. package/dist/chart.d.ts.map +1 -0
  62. package/dist/chart.js +254 -0
  63. package/dist/checkbox.cjs +1 -0
  64. package/dist/checkbox.d.ts +15 -0
  65. package/dist/checkbox.d.ts.map +1 -0
  66. package/dist/checkbox.js +96 -0
  67. package/dist/collapsible.cjs +1 -0
  68. package/dist/collapsible.d.ts +18 -0
  69. package/dist/collapsible.d.ts.map +1 -0
  70. package/dist/collapsible.js +58 -0
  71. package/dist/combobox.cjs +1 -0
  72. package/dist/combobox.d.ts +65 -0
  73. package/dist/combobox.d.ts.map +1 -0
  74. package/dist/combobox.js +203 -0
  75. package/dist/command.cjs +1 -0
  76. package/dist/command.d.ts +44 -0
  77. package/dist/command.d.ts.map +1 -0
  78. package/dist/command.js +166 -0
  79. package/dist/context-menu.cjs +1 -0
  80. package/dist/context-menu.d.ts +42 -0
  81. package/dist/context-menu.d.ts.map +1 -0
  82. package/dist/context-menu.js +226 -0
  83. package/dist/date-picker.cjs +1 -0
  84. package/dist/date-picker.d.ts +54 -0
  85. package/dist/date-picker.d.ts.map +1 -0
  86. package/dist/date-picker.js +95 -0
  87. package/dist/dialog.cjs +1 -0
  88. package/dist/dialog.d.ts +20 -0
  89. package/dist/dialog.d.ts.map +1 -0
  90. package/dist/dialog.js +130 -0
  91. package/dist/drawer.cjs +1 -0
  92. package/dist/drawer.d.ts +22 -0
  93. package/dist/drawer.d.ts.map +1 -0
  94. package/dist/drawer.js +149 -0
  95. package/dist/dropdown-menu.cjs +1 -0
  96. package/dist/dropdown-menu.d.ts +253 -0
  97. package/dist/dropdown-menu.d.ts.map +1 -0
  98. package/dist/dropdown-menu.js +325 -0
  99. package/dist/field.cjs +1 -0
  100. package/dist/field.d.ts +21 -0
  101. package/dist/field.d.ts.map +1 -0
  102. package/dist/field.js +148 -0
  103. package/dist/global-layout.cjs +1 -0
  104. package/dist/global-layout.d.ts +60 -0
  105. package/dist/global-layout.d.ts.map +1 -0
  106. package/dist/global-layout.js +87 -0
  107. package/dist/hooks/use-mobile.cjs +1 -0
  108. package/dist/hooks/use-mobile.d.ts +2 -0
  109. package/dist/hooks/use-mobile.d.ts.map +1 -0
  110. package/dist/hooks/use-mobile.js +16 -0
  111. package/dist/hover-card.cjs +1 -0
  112. package/dist/hover-card.d.ts +43 -0
  113. package/dist/hover-card.d.ts.map +1 -0
  114. package/dist/hover-card.js +71 -0
  115. package/dist/index.cjs +1 -0
  116. package/dist/index.d.ts +61 -0
  117. package/dist/index.d.ts.map +1 -0
  118. package/dist/index.js +412 -0
  119. package/dist/input-base.cjs +1 -0
  120. package/dist/input-base.d.ts +28 -0
  121. package/dist/input-base.d.ts.map +1 -0
  122. package/dist/input-base.js +56 -0
  123. package/dist/input-group.cjs +1 -0
  124. package/dist/input-group.d.ts +26 -0
  125. package/dist/input-group.d.ts.map +1 -0
  126. package/dist/input-group.js +116 -0
  127. package/dist/input-otp.cjs +1 -0
  128. package/dist/input-otp.d.ts +45 -0
  129. package/dist/input-otp.d.ts.map +1 -0
  130. package/dist/input-otp.js +186 -0
  131. package/dist/input-password.cjs +1 -0
  132. package/dist/input-password.d.ts +38 -0
  133. package/dist/input-password.d.ts.map +1 -0
  134. package/dist/input-password.js +101 -0
  135. package/dist/input.cjs +1 -0
  136. package/dist/input.d.ts +32 -0
  137. package/dist/input.d.ts.map +1 -0
  138. package/dist/input.js +146 -0
  139. package/dist/label.cjs +1 -0
  140. package/dist/label.d.ts +12 -0
  141. package/dist/label.d.ts.map +1 -0
  142. package/dist/label.js +34 -0
  143. package/dist/lib/utils.cjs +1 -0
  144. package/dist/lib/utils.d.ts +3 -0
  145. package/dist/lib/utils.d.ts.map +1 -0
  146. package/dist/lib/utils.js +8 -0
  147. package/dist/link.cjs +1 -0
  148. package/dist/link.d.ts +29 -0
  149. package/dist/link.d.ts.map +1 -0
  150. package/dist/link.figma.d.ts +2 -0
  151. package/dist/link.figma.d.ts.map +1 -0
  152. package/dist/link.js +71 -0
  153. package/dist/logo.cjs +1 -0
  154. package/dist/logo.d.ts +25 -0
  155. package/dist/logo.d.ts.map +1 -0
  156. package/dist/logo.js +71 -0
  157. package/dist/menubar.cjs +1 -0
  158. package/dist/menubar.d.ts +106 -0
  159. package/dist/menubar.d.ts.map +1 -0
  160. package/dist/menubar.js +270 -0
  161. package/dist/navigation-menu.cjs +1 -0
  162. package/dist/navigation-menu.d.ts +108 -0
  163. package/dist/navigation-menu.d.ts.map +1 -0
  164. package/dist/navigation-menu.js +175 -0
  165. package/dist/pagination.cjs +1 -0
  166. package/dist/pagination.d.ts +81 -0
  167. package/dist/pagination.d.ts.map +1 -0
  168. package/dist/pagination.js +216 -0
  169. package/dist/popover.cjs +1 -0
  170. package/dist/popover.d.ts +8 -0
  171. package/dist/popover.d.ts.map +1 -0
  172. package/dist/popover.js +44 -0
  173. package/dist/progress.cjs +1 -0
  174. package/dist/progress.d.ts +29 -0
  175. package/dist/progress.d.ts.map +1 -0
  176. package/dist/progress.js +64 -0
  177. package/dist/radio-group.cjs +1 -0
  178. package/dist/radio-group.d.ts +33 -0
  179. package/dist/radio-group.d.ts.map +1 -0
  180. package/dist/radio-group.js +193 -0
  181. package/dist/rating.cjs +1 -0
  182. package/dist/rating.d.ts +22 -0
  183. package/dist/rating.d.ts.map +1 -0
  184. package/dist/rating.js +51 -0
  185. package/dist/resizable.cjs +1 -0
  186. package/dist/resizable.d.ts +14 -0
  187. package/dist/resizable.d.ts.map +1 -0
  188. package/dist/resizable.js +46 -0
  189. package/dist/scroll-area.cjs +1 -0
  190. package/dist/scroll-area.d.ts +12 -0
  191. package/dist/scroll-area.d.ts.map +1 -0
  192. package/dist/scroll-area.js +67 -0
  193. package/dist/select.cjs +1 -0
  194. package/dist/select.d.ts +77 -0
  195. package/dist/select.d.ts.map +1 -0
  196. package/dist/select.js +259 -0
  197. package/dist/separator.cjs +1 -0
  198. package/dist/separator.d.ts +14 -0
  199. package/dist/separator.d.ts.map +1 -0
  200. package/dist/separator.js +43 -0
  201. package/dist/sheet.cjs +1 -0
  202. package/dist/sheet.d.ts +38 -0
  203. package/dist/sheet.d.ts.map +1 -0
  204. package/dist/sheet.js +190 -0
  205. package/dist/skeleton.cjs +1 -0
  206. package/dist/skeleton.d.ts +5 -0
  207. package/dist/skeleton.d.ts.map +1 -0
  208. package/dist/skeleton.js +15 -0
  209. package/dist/slider.cjs +1 -0
  210. package/dist/slider.d.ts +19 -0
  211. package/dist/slider.d.ts.map +1 -0
  212. package/dist/slider.js +69 -0
  213. package/dist/sonner.cjs +1 -0
  214. package/dist/sonner.d.ts +188 -0
  215. package/dist/sonner.d.ts.map +1 -0
  216. package/dist/sonner.js +150 -0
  217. package/dist/split-layout.cjs +1 -0
  218. package/dist/split-layout.d.ts +42 -0
  219. package/dist/split-layout.d.ts.map +1 -0
  220. package/dist/split-layout.js +108 -0
  221. package/dist/switch.cjs +1 -0
  222. package/dist/switch.d.ts +43 -0
  223. package/dist/switch.d.ts.map +1 -0
  224. package/dist/switch.figma.d.ts +2 -0
  225. package/dist/switch.figma.d.ts.map +1 -0
  226. package/dist/switch.js +110 -0
  227. package/dist/table.cjs +1 -0
  228. package/dist/table.d.ts +95 -0
  229. package/dist/table.d.ts.map +1 -0
  230. package/dist/table.js +164 -0
  231. package/dist/tabs.cjs +1 -0
  232. package/dist/tabs.d.ts +29 -0
  233. package/dist/tabs.d.ts.map +1 -0
  234. package/dist/tabs.js +96 -0
  235. package/dist/textarea.cjs +1 -0
  236. package/dist/textarea.d.ts +23 -0
  237. package/dist/textarea.d.ts.map +1 -0
  238. package/dist/textarea.js +47 -0
  239. package/dist/toggle-group.cjs +1 -0
  240. package/dist/toggle-group.d.ts +25 -0
  241. package/dist/toggle-group.d.ts.map +1 -0
  242. package/dist/toggle-group.js +74 -0
  243. package/dist/toggle.cjs +1 -0
  244. package/dist/toggle.d.ts +44 -0
  245. package/dist/toggle.d.ts.map +1 -0
  246. package/dist/toggle.figma.d.ts +2 -0
  247. package/dist/toggle.figma.d.ts.map +1 -0
  248. package/dist/toggle.js +57 -0
  249. package/dist/tooltip.cjs +1 -0
  250. package/dist/tooltip.d.ts +66 -0
  251. package/dist/tooltip.d.ts.map +1 -0
  252. package/dist/tooltip.js +78 -0
  253. package/package.json +184 -0
  254. package/src/blocks/data-table.tsx +1166 -0
  255. package/src/blocks/sidebar.tsx +1830 -0
  256. package/src/components/.gitkeep +0 -0
  257. package/src/components/accordion.tsx +142 -0
  258. package/src/components/alert-dialog.tsx +157 -0
  259. package/src/components/alert.tsx +199 -0
  260. package/src/components/aspect-ratio.tsx +30 -0
  261. package/src/components/avatar.tsx +56 -0
  262. package/src/components/badge.tsx +72 -0
  263. package/src/components/breadcrumb.tsx +109 -0
  264. package/src/components/button.tsx +296 -0
  265. package/src/components/calendar.tsx +234 -0
  266. package/src/components/card.tsx +158 -0
  267. package/src/components/carousel.tsx +256 -0
  268. package/src/components/centred-layout.tsx +91 -0
  269. package/src/components/chart.tsx +456 -0
  270. package/src/components/checkbox.tsx +132 -0
  271. package/src/components/collapsible.tsx +68 -0
  272. package/src/components/combobox.tsx +321 -0
  273. package/src/components/command.tsx +220 -0
  274. package/src/components/context-menu.tsx +305 -0
  275. package/src/components/date-picker.tsx +155 -0
  276. package/src/components/dialog.tsx +152 -0
  277. package/src/components/drawer.tsx +168 -0
  278. package/src/components/dropdown-menu.tsx +575 -0
  279. package/src/components/field.tsx +155 -0
  280. package/src/components/global-layout.tsx +153 -0
  281. package/src/components/hover-card.tsx +121 -0
  282. package/src/components/input-base.tsx +86 -0
  283. package/src/components/input-group.tsx +158 -0
  284. package/src/components/input-otp.tsx +327 -0
  285. package/src/components/input-password.tsx +191 -0
  286. package/src/components/input.tsx +220 -0
  287. package/src/components/label.tsx +42 -0
  288. package/src/components/link.figma.tsx +71 -0
  289. package/src/components/link.tsx +105 -0
  290. package/src/components/logo.tsx +97 -0
  291. package/src/components/menubar.tsx +379 -0
  292. package/src/components/navigation-menu.tsx +324 -0
  293. package/src/components/pagination.tsx +368 -0
  294. package/src/components/popover.tsx +46 -0
  295. package/src/components/progress.tsx +100 -0
  296. package/src/components/radio-group.tsx +281 -0
  297. package/src/components/rating.tsx +87 -0
  298. package/src/components/resizable.tsx +66 -0
  299. package/src/components/scroll-area.tsx +72 -0
  300. package/src/components/select.tsx +442 -0
  301. package/src/components/separator.tsx +53 -0
  302. package/src/components/sheet.tsx +220 -0
  303. package/src/components/skeleton.tsx +17 -0
  304. package/src/components/slider.tsx +86 -0
  305. package/src/components/sonner.tsx +396 -0
  306. package/src/components/split-layout.tsx +155 -0
  307. package/src/components/switch.figma.tsx +115 -0
  308. package/src/components/switch.tsx +173 -0
  309. package/src/components/table.tsx +277 -0
  310. package/src/components/tabs.tsx +142 -0
  311. package/src/components/textarea.tsx +77 -0
  312. package/src/components/toggle-group.tsx +109 -0
  313. package/src/components/toggle.figma.tsx +81 -0
  314. package/src/components/toggle.tsx +103 -0
  315. package/src/components/tooltip.tsx +156 -0
  316. package/src/hooks/.gitkeep +0 -0
  317. package/src/hooks/use-mobile.ts +21 -0
  318. package/src/index.ts +67 -0
  319. package/src/lib/utils.ts +6 -0
  320. package/src/types/external-modules.d.ts +16 -0
package/dist/rating.js ADDED
@@ -0,0 +1,51 @@
1
+ import { jsx as l, jsxs as p } from "react/jsx-runtime";
2
+ import * as u from "react";
3
+ import { StarRating as s } from "@brightlocal/icons";
4
+ import { cn as w } from "@brightlocal/ui-components/lib/utils";
5
+ const y = u.forwardRef(
6
+ ({ value: i, dataHook: o, trackingEl: n, trackingLabel: d, className: m, ...c }, f) => {
7
+ const a = Math.max(0, Math.min(5, i));
8
+ return /* @__PURE__ */ l(
9
+ "div",
10
+ {
11
+ ref: f,
12
+ "aria-label": `Rating: ${a} out of 5 stars`,
13
+ className: w("flex items-center gap-0.5", m),
14
+ "data-hook": o,
15
+ "data-slot": "rating",
16
+ "data-tracking-el": n,
17
+ "data-tracking-label": d,
18
+ role: "img",
19
+ ...c,
20
+ children: [...Array(5)].map((N, t) => {
21
+ const g = t + 1, e = a >= g, r = !e && a > t, h = r ? ((a - t) * 100).toFixed(0) : e ? "100" : "0";
22
+ return /* @__PURE__ */ p("div", { className: "relative", "data-slot": "rating-star", children: [
23
+ /* @__PURE__ */ l(
24
+ s,
25
+ {
26
+ className: "fill-muted stroke-muted h-6 w-6",
27
+ "data-slot": "rating-star-base"
28
+ }
29
+ ),
30
+ (e || r) && /* @__PURE__ */ l(
31
+ "div",
32
+ {
33
+ "aria-hidden": "true",
34
+ className: "absolute inset-0 overflow-hidden",
35
+ "data-slot": "rating-star-fill",
36
+ style: {
37
+ width: `${h}%`
38
+ },
39
+ children: /* @__PURE__ */ l(s, { className: "h-6 w-6 fill-yellow-400 stroke-yellow-400" })
40
+ }
41
+ )
42
+ ] }, t);
43
+ })
44
+ }
45
+ );
46
+ }
47
+ );
48
+ y.displayName = "Rating";
49
+ export {
50
+ y as Rating
51
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("lucide-react"),d=require("react-resizable-panels"),n=require("@brightlocal/ui-components/lib/utils");function u(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const i=u(d),f=({className:e,...a})=>r.jsx(i.PanelGroup,{className:n.cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),"data-slot":"resizable-panel-group",...a}),p=({...e})=>r.jsx(i.Panel,{"data-slot":"resizable-panel",...e}),b=({withHandle:e,className:a,dataHook:t,trackingEl:l,trackingLabel:o,...s})=>r.jsx(i.PanelResizeHandle,{className:n.cn("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-none data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",a),"data-hook":t,"data-slot":"resizable-handle","data-tracking-el":l,"data-tracking-label":o,...s,children:e&&r.jsx("div",{className:"border-border bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:r.jsx(c.GripVertical,{className:"h-2.5 w-2.5"})})});exports.ResizableHandle=b;exports.ResizablePanel=p;exports.ResizablePanelGroup=f;
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import * as ResizablePrimitive from "react-resizable-panels";
3
+ declare const ResizablePanelGroup: ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => import("react/jsx-runtime").JSX.Element;
4
+ declare const ResizablePanel: ({ ...props }: React.ComponentProps<typeof ResizablePrimitive.Panel>) => import("react/jsx-runtime").JSX.Element;
5
+ interface ResizableHandleProps extends React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> {
6
+ withHandle?: boolean;
7
+ dataHook?: string;
8
+ trackingEl?: string;
9
+ trackingLabel?: string;
10
+ }
11
+ declare const ResizableHandle: ({ withHandle, className, dataHook, trackingEl, trackingLabel, ...props }: ResizableHandleProps) => import("react/jsx-runtime").JSX.Element;
12
+ export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
13
+ export type { ResizableHandleProps };
14
+ //# sourceMappingURL=resizable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizable.d.ts","sourceRoot":"","sources":["../../src/components/resizable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,kBAAkB,MAAM,wBAAwB,CAAC;AAI7D,QAAA,MAAM,mBAAmB,GAAI,yBAG1B,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,UAAU,CAAC,4CAS5D,CAAC;AAEF,QAAA,MAAM,cAAc,GAAI,cAErB,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,KAAK,CAAC,4CAEvD,CAAC;AAEF,UAAU,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CACzD,OAAO,kBAAkB,CAAC,iBAAiB,CAC5C;IACC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,eAAe,GAAI,0EAOtB,oBAAoB,4CAkBtB,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AAEhE,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { GripVertical as c } from "lucide-react";
3
+ import * as t from "react-resizable-panels";
4
+ import { cn as l } from "@brightlocal/ui-components/lib/utils";
5
+ const u = ({
6
+ className: e,
7
+ ...r
8
+ }) => /* @__PURE__ */ a(
9
+ t.PanelGroup,
10
+ {
11
+ className: l(
12
+ "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
13
+ e
14
+ ),
15
+ "data-slot": "resizable-panel-group",
16
+ ...r
17
+ }
18
+ ), b = ({
19
+ ...e
20
+ }) => /* @__PURE__ */ a(t.Panel, { "data-slot": "resizable-panel", ...e }), g = ({
21
+ withHandle: e,
22
+ className: r,
23
+ dataHook: i,
24
+ trackingEl: o,
25
+ trackingLabel: n,
26
+ ...s
27
+ }) => /* @__PURE__ */ a(
28
+ t.PanelResizeHandle,
29
+ {
30
+ className: l(
31
+ "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-none data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
32
+ r
33
+ ),
34
+ "data-hook": i,
35
+ "data-slot": "resizable-handle",
36
+ "data-tracking-el": o,
37
+ "data-tracking-label": n,
38
+ ...s,
39
+ children: e && /* @__PURE__ */ a("div", { className: "border-border bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border", children: /* @__PURE__ */ a(c, { className: "h-2.5 w-2.5" }) })
40
+ }
41
+ );
42
+ export {
43
+ g as ResizableHandle,
44
+ b as ResizablePanel,
45
+ u as ResizablePanelGroup
46
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("@radix-ui/react-scroll-area"),c=require("@brightlocal/ui-components/lib/utils");function d(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const o=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(r,l,o.get?o:{enumerable:!0,get:()=>e[l]})}}return r.default=e,Object.freeze(r)}const a=d(u);function b({className:e,children:r,dataHook:l,trackingEl:o,trackingLabel:s,...i}){return t.jsxs(a.Root,{className:c.cn("relative",e),"data-hook":l,"data-slot":"scroll-area","data-tracking-el":o,"data-tracking-label":s,...i,children:[t.jsx(a.Viewport,{className:"focus-visible:shadow-default size-full rounded-[inherit] p-1 transition-[color,box-shadow] outline-none","data-slot":"scroll-area-viewport",tabIndex:0,children:r}),t.jsx(n,{}),t.jsx(a.Corner,{})]})}function n({className:e,orientation:r="vertical",...l}){return t.jsx(a.ScrollAreaScrollbar,{className:c.cn("flex touch-none p-px transition-colors select-none",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),"data-slot":"scroll-area-scrollbar",orientation:r,...l,children:t.jsx(a.ScrollAreaThumb,{className:"bg-border relative flex-1 rounded-full","data-slot":"scroll-area-thumb"})})}exports.ScrollArea=b;exports.ScrollBar=n;
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3
+ type ScrollAreaProps = React.ComponentProps<typeof ScrollAreaPrimitive.Root> & {
4
+ dataHook: string;
5
+ trackingEl?: string;
6
+ trackingLabel?: string;
7
+ };
8
+ declare function ScrollArea({ className, children, dataHook, trackingEl, trackingLabel, ...props }: ScrollAreaProps): import("react/jsx-runtime").JSX.Element;
9
+ declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): import("react/jsx-runtime").JSX.Element;
10
+ export { ScrollArea, ScrollBar };
11
+ export type { ScrollAreaProps };
12
+ //# sourceMappingURL=scroll-area.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../src/components/scroll-area.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAGnE,KAAK,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG;IAC7E,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,aAAa,EACb,GAAG,KAAK,EACT,EAAE,eAAe,2CAqBjB;AAED,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,WAAwB,EACxB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,mBAAmB,CAAC,2CAqBtE;AAED,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AAEjC,YAAY,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { jsxs as i, jsx as l } from "react/jsx-runtime";
2
+ import * as a from "@radix-ui/react-scroll-area";
3
+ import { cn as t } from "@brightlocal/ui-components/lib/utils";
4
+ function f({
5
+ className: o,
6
+ children: r,
7
+ dataHook: e,
8
+ trackingEl: s,
9
+ trackingLabel: c,
10
+ ...n
11
+ }) {
12
+ return /* @__PURE__ */ i(
13
+ a.Root,
14
+ {
15
+ className: t("relative", o),
16
+ "data-hook": e,
17
+ "data-slot": "scroll-area",
18
+ "data-tracking-el": s,
19
+ "data-tracking-label": c,
20
+ ...n,
21
+ children: [
22
+ /* @__PURE__ */ l(
23
+ a.Viewport,
24
+ {
25
+ className: "focus-visible:shadow-default size-full rounded-[inherit] p-1 transition-[color,box-shadow] outline-none",
26
+ "data-slot": "scroll-area-viewport",
27
+ tabIndex: 0,
28
+ children: r
29
+ }
30
+ ),
31
+ /* @__PURE__ */ l(d, {}),
32
+ /* @__PURE__ */ l(a.Corner, {})
33
+ ]
34
+ }
35
+ );
36
+ }
37
+ function d({
38
+ className: o,
39
+ orientation: r = "vertical",
40
+ ...e
41
+ }) {
42
+ return /* @__PURE__ */ l(
43
+ a.ScrollAreaScrollbar,
44
+ {
45
+ className: t(
46
+ "flex touch-none p-px transition-colors select-none",
47
+ r === "vertical" && "h-full w-2.5 border-l border-l-transparent",
48
+ r === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
49
+ o
50
+ ),
51
+ "data-slot": "scroll-area-scrollbar",
52
+ orientation: r,
53
+ ...e,
54
+ children: /* @__PURE__ */ l(
55
+ a.ScrollAreaThumb,
56
+ {
57
+ className: "bg-border relative flex-1 rounded-full",
58
+ "data-slot": "scroll-area-thumb"
59
+ }
60
+ )
61
+ }
62
+ );
63
+ }
64
+ export {
65
+ f as ScrollArea,
66
+ d as ScrollBar
67
+ };
@@ -0,0 +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;
@@ -0,0 +1,77 @@
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ interface SelectProps extends React.ComponentProps<typeof SelectPrimitive.Root> {
4
+ /** Label text displayed above the select */
5
+ label?: string;
6
+ /** Helper text displayed below the select */
7
+ description?: string;
8
+ /** Shows required indicator (*) next to label */
9
+ optional?: boolean;
10
+ /** Placeholder text when no value is selected */
11
+ placeholder?: string;
12
+ /** Children to render inside the select */
13
+ children?: React.ReactNode;
14
+ /** Accessible label for screen readers when no visible label is provided */
15
+ "aria-label"?: string;
16
+ }
17
+ /**
18
+ * Select component with optional label and description.
19
+ * Wraps Radix UI Select with additional accessibility and styling features.
20
+ * Error state should be managed via Form components (FormMessage).
21
+ */
22
+ declare function Select({ label, description, optional, placeholder, children, "aria-label": ariaLabel, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
23
+ /**
24
+ * SelectGroup - Groups related select options together
25
+ */
26
+ declare function SelectGroup(props: React.ComponentProps<typeof SelectPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
27
+ /**
28
+ * SelectValue - Displays the selected value in the trigger
29
+ */
30
+ declare function SelectValue(props: React.ComponentProps<typeof SelectPrimitive.Value>): import("react/jsx-runtime").JSX.Element;
31
+ interface SelectTriggerProps extends React.ComponentProps<typeof SelectPrimitive.Trigger> {
32
+ /** Placeholder text when no value is selected */
33
+ placeholder?: string;
34
+ /** Data hook for testing and automation */
35
+ dataHook?: string;
36
+ }
37
+ /**
38
+ * SelectTrigger - The button that opens the select dropdown
39
+ */
40
+ declare function SelectTrigger({ className, children, placeholder, dataHook, ...props }: SelectTriggerProps): import("react/jsx-runtime").JSX.Element;
41
+ /**
42
+ * SelectContent - The dropdown container for select options
43
+ */
44
+ declare function SelectContent({ className, children, position, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
45
+ /**
46
+ * SelectLabel - Label for a group of select options
47
+ */
48
+ declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): import("react/jsx-runtime").JSX.Element;
49
+ /**
50
+ * SelectItem - Individual selectable option in the dropdown
51
+ *
52
+ * Usage:
53
+ * 1. Simple text: <SelectItem value="apple">Apple</SelectItem>
54
+ * 2. With icon (appears in trigger):
55
+ * <SelectItem value="apple">
56
+ * <div className="flex items-center gap-2">
57
+ * <AppleIcon className="size-4" />
58
+ * Apple
59
+ * </div>
60
+ * </SelectItem>
61
+ */
62
+ declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
63
+ /**
64
+ * SelectSeparator - Visual separator between select items or groups
65
+ */
66
+ declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
67
+ /**
68
+ * SelectScrollUpButton - Button to scroll up in the dropdown (when content overflows)
69
+ */
70
+ declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): import("react/jsx-runtime").JSX.Element;
71
+ /**
72
+ * SelectScrollDownButton - Button to scroll down in the dropdown (when content overflows)
73
+ */
74
+ declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): import("react/jsx-runtime").JSX.Element;
75
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, };
76
+ export type { SelectProps, SelectTriggerProps };
77
+ //# sourceMappingURL=select.d.ts.map
@@ -0,0 +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,CAAC;IACnB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAMD;;;;GAIG;AACH,iBAAS,MAAM,CAAC,EACd,KAAK,EACL,WAAW,EACX,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACT,EAAE,WAAW,2CAkEb;AAED;;GAEG;AACH,iBAAS,WAAW,CAClB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAG1D;AAED;;GAEG;AACH,iBAAS,WAAW,CAClB,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAG1D;AAyCD,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CACvD,OAAO,eAAe,CAAC,OAAO,CAC/B;IACC,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD;;GAEG;AACH,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,kBAAkB,2CAkCpB;AAED;;GAEG;AACH,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,QAAmB,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAqDtD;AAED;;GAEG;AACH,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAWpD;AAED;;;;;;;;;;;;GAYG;AACH,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAsCnD;AAED;;GAEG;AACH,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,SAAS,CAAC,2CAQxD;AAED;;GAEG;AACH,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,cAAc,CAAC,2CAa7D;AAED;;GAEG;AACH,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,gBAAgB,CAAC,2CAa/D;AAED,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 ADDED
@@ -0,0 +1,259 @@
1
+ import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
+ import * as u from "react";
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";
6
+ import { cn as n } from "@brightlocal/ui-components/lib/utils";
7
+ import { Label as k } from "@brightlocal/ui-components/label";
8
+ function R({
9
+ label: t,
10
+ description: a,
11
+ optional: s,
12
+ placeholder: l,
13
+ children: o,
14
+ "aria-label": d,
15
+ ...m
16
+ }) {
17
+ const c = u.useId(), p = `${c}-label`, x = `${c}-description`, g = a, S = t || g, b = {
18
+ placeholder: l,
19
+ "aria-required": s ? void 0 : !0,
20
+ "aria-label": d
21
+ }, w = {
22
+ ...b,
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 }),
30
+ /* @__PURE__ */ e(r.Root, { "data-slot": "select", ...m, children: u.Children.map(
31
+ o,
32
+ (i) => v(i, w)
33
+ ) }),
34
+ g && /* @__PURE__ */ e("p", { className: "text-muted-foreground text-sm", id: x, children: g })
35
+ ] }) : /* @__PURE__ */ e(r.Root, { "data-slot": "select", ...m, children: u.Children.map(
36
+ o,
37
+ (i) => v(i, b)
38
+ ) });
39
+ }
40
+ function D(t) {
41
+ return /* @__PURE__ */ e(r.Group, { "data-slot": "select-group", ...t });
42
+ }
43
+ function E(t) {
44
+ return /* @__PURE__ */ e(r.Value, { "data-slot": "select-value", ...t });
45
+ }
46
+ const C = I([
47
+ // Base layout
48
+ "relative flex w-full h-9 items-center justify-between gap-2",
49
+ "px-3 py-2",
50
+ // Base appearance
51
+ "border border-border rounded-lg outline-none transition-all",
52
+ "bg-neutral-50 border-neutral-300",
53
+ "dark:bg-white/5 dark:border-white/15",
54
+ // Typography
55
+ "text-sm font-normal font-sans text-foreground",
56
+ // Text truncation for long content (shadcn default behavior)
57
+ "[&>span]:block [&>span]:truncate",
58
+ // Placeholder state
59
+ "data-[placeholder]:text-muted-foreground",
60
+ // Focus state (keyboard navigation only - not on click)
61
+ "focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background",
62
+ "focus-visible:shadow-default",
63
+ // Open dropdown state
64
+ "data-[state=open]:border-ring",
65
+ // Disabled state
66
+ "disabled:cursor-not-allowed disabled:opacity-50",
67
+ // Icon styles (chevron and custom icons)
68
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0",
69
+ "[&_svg:not([class*='size-'])]:size-4",
70
+ "[&_svg:not([class*='text-'])]:text-muted-foreground"
71
+ ]);
72
+ function _({
73
+ className: t,
74
+ children: a,
75
+ placeholder: s,
76
+ dataHook: l,
77
+ ...o
78
+ }) {
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(
81
+ r.Trigger,
82
+ {
83
+ ...o,
84
+ "aria-invalid": d ? "true" : void 0,
85
+ "aria-label": c,
86
+ "aria-required": m ? "true" : void 0,
87
+ className: n(C(), p, t),
88
+ "data-hook": l,
89
+ "data-slot": "select-trigger",
90
+ children: [
91
+ a,
92
+ /* @__PURE__ */ e(r.Icon, { asChild: !0, children: /* @__PURE__ */ e(h, { className: "text-muted-foreground size-4" }) })
93
+ ]
94
+ }
95
+ );
96
+ }
97
+ function U({
98
+ className: t,
99
+ children: a,
100
+ position: s = "popper",
101
+ ...l
102
+ }) {
103
+ const o = n(
104
+ // Base appearance
105
+ "relative z-50 overflow-hidden",
106
+ "min-w-[8rem]",
107
+ "rounded-md border border-border bg-popover shadow-md",
108
+ "text-popover-foreground",
109
+ // Size constraints using Radix CSS variables
110
+ "max-h-[var(--radix-select-content-available-height)]",
111
+ "origin-[var(--radix-select-content-transform-origin)]",
112
+ // Animations
113
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
114
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
115
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
116
+ "data-[side=bottom]:slide-in-from-top-2",
117
+ "data-[side=left]:slide-in-from-right-2",
118
+ "data-[side=right]:slide-in-from-left-2",
119
+ "data-[side=top]:slide-in-from-bottom-2"
120
+ ), d = s === "popper" && n(
121
+ "data-[side=bottom]:translate-y-1",
122
+ "data-[side=left]:-translate-x-1",
123
+ "data-[side=right]:translate-x-1",
124
+ "data-[side=top]:-translate-y-1"
125
+ );
126
+ return /* @__PURE__ */ e(r.Portal, { children: /* @__PURE__ */ f(
127
+ r.Content,
128
+ {
129
+ className: n(o, d, t),
130
+ "data-slot": "select-content",
131
+ position: s,
132
+ ...l,
133
+ children: [
134
+ /* @__PURE__ */ e(T, {}),
135
+ /* @__PURE__ */ e(
136
+ r.Viewport,
137
+ {
138
+ className: n(
139
+ "p-1",
140
+ s === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
141
+ ),
142
+ children: a
143
+ }
144
+ ),
145
+ /* @__PURE__ */ e(j, {})
146
+ ]
147
+ }
148
+ ) });
149
+ }
150
+ function G({
151
+ className: t,
152
+ ...a
153
+ }) {
154
+ return /* @__PURE__ */ e(
155
+ r.Label,
156
+ {
157
+ className: n(
158
+ "text-muted-foreground px-2 py-1.5 text-xs font-medium",
159
+ t
160
+ ),
161
+ "data-slot": "select-label",
162
+ ...a
163
+ }
164
+ );
165
+ }
166
+ function $({
167
+ className: t,
168
+ children: a,
169
+ ...s
170
+ }) {
171
+ const l = n(
172
+ // Base layout
173
+ "relative flex w-full cursor-default select-none items-center gap-2",
174
+ "rounded py-1.5 pl-2 pr-8",
175
+ // Typography
176
+ "text-sm font-normal leading-5 text-popover-foreground",
177
+ // Interactive states
178
+ "focus:bg-accent focus:text-accent-foreground",
179
+ "hover:bg-accent/50 hover:text-accent-foreground",
180
+ "outline-none focus:outline-none",
181
+ // Disabled state
182
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
183
+ // Icon styles
184
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0",
185
+ "[&_svg:not([class*='size-'])]:size-4",
186
+ "[&_svg:not([class*='text-'])]:text-foreground"
187
+ );
188
+ return /* @__PURE__ */ f(
189
+ r.Item,
190
+ {
191
+ className: n(l, t),
192
+ "data-slot": "select-item",
193
+ ...s,
194
+ 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" }) }) }),
196
+ /* @__PURE__ */ e(r.ItemText, { children: a })
197
+ ]
198
+ }
199
+ );
200
+ }
201
+ function F({
202
+ className: t,
203
+ ...a
204
+ }) {
205
+ return /* @__PURE__ */ e(
206
+ r.Separator,
207
+ {
208
+ className: n("bg-border pointer-events-none -mx-1 my-1 h-px", t),
209
+ "data-slot": "select-separator",
210
+ ...a
211
+ }
212
+ );
213
+ }
214
+ function T({
215
+ className: t,
216
+ ...a
217
+ }) {
218
+ return /* @__PURE__ */ e(
219
+ r.ScrollUpButton,
220
+ {
221
+ className: n(
222
+ "flex cursor-default items-center justify-center py-1",
223
+ t
224
+ ),
225
+ "data-slot": "select-scroll-up-button",
226
+ ...a,
227
+ children: /* @__PURE__ */ e(z, { className: "size-4" })
228
+ }
229
+ );
230
+ }
231
+ function j({
232
+ className: t,
233
+ ...a
234
+ }) {
235
+ return /* @__PURE__ */ e(
236
+ r.ScrollDownButton,
237
+ {
238
+ className: n(
239
+ "flex cursor-default items-center justify-center py-1",
240
+ t
241
+ ),
242
+ "data-slot": "select-scroll-down-button",
243
+ ...a,
244
+ children: /* @__PURE__ */ e(h, { className: "size-4" })
245
+ }
246
+ );
247
+ }
248
+ 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
+ };
@@ -0,0 +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;
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
3
+ export declare enum SeparatorOrientation {
4
+ HORIZONTAL = "horizontal",
5
+ VERTICAL = "vertical"
6
+ }
7
+ declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
8
+ interface SeparatorWithTextProps {
9
+ className?: string;
10
+ children: React.ReactNode;
11
+ }
12
+ declare function SeparatorWithText({ className, children }: SeparatorWithTextProps): import("react/jsx-runtime").JSX.Element;
13
+ export { Separator, SeparatorWithText };
14
+ //# sourceMappingURL=separator.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,43 @@
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,
13
+ {
14
+ className: o(
15
+ "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
17
+ ),
18
+ "data-slot": "separator-root",
19
+ decorative: i,
20
+ orientation: r,
21
+ ...n
22
+ }
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
+ }
39
+ export {
40
+ e as Separator,
41
+ m as SeparatorOrientation,
42
+ d as SeparatorWithText
43
+ };
package/dist/sheet.cjs ADDED
@@ -0,0 +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;