@refine-studio/ui 0.0.0 → 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 (211) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +102 -2
  3. package/dist/components/accordion/accordion.d.ts +15 -0
  4. package/dist/components/accordion/accordion.js +58 -0
  5. package/dist/components/accordion/accordion.js.map +1 -0
  6. package/dist/components/alert/alert.d.ts +24 -0
  7. package/dist/components/alert/alert.js +98 -0
  8. package/dist/components/alert/alert.js.map +1 -0
  9. package/dist/components/alert-dialog/alert-dialog.d.ts +36 -0
  10. package/dist/components/alert-dialog/alert-dialog.js +112 -0
  11. package/dist/components/alert-dialog/alert-dialog.js.map +1 -0
  12. package/dist/components/app-shell/app-shell.d.ts +77 -0
  13. package/dist/components/app-shell/app-shell.js +224 -0
  14. package/dist/components/app-shell/app-shell.js.map +1 -0
  15. package/dist/components/avatar/avatar.d.ts +32 -0
  16. package/dist/components/avatar/avatar.js +83 -0
  17. package/dist/components/avatar/avatar.js.map +1 -0
  18. package/dist/components/badge/badge.d.ts +15 -0
  19. package/dist/components/badge/badge.js +50 -0
  20. package/dist/components/badge/badge.js.map +1 -0
  21. package/dist/components/breadcrumb/breadcrumb.d.ts +24 -0
  22. package/dist/components/breadcrumb/breadcrumb.js +82 -0
  23. package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
  24. package/dist/components/button/button.d.ts +15 -0
  25. package/dist/components/button/button.js +75 -0
  26. package/dist/components/button/button.js.map +1 -0
  27. package/dist/components/card/card.d.ts +46 -0
  28. package/dist/components/card/card.js +124 -0
  29. package/dist/components/card/card.js.map +1 -0
  30. package/dist/components/checkbox/checkbox.d.ts +6 -0
  31. package/dist/components/checkbox/checkbox.js +31 -0
  32. package/dist/components/checkbox/checkbox.js.map +1 -0
  33. package/dist/components/chip/chip.d.ts +25 -0
  34. package/dist/components/chip/chip.js +54 -0
  35. package/dist/components/chip/chip.js.map +1 -0
  36. package/dist/components/code/code.d.ts +15 -0
  37. package/dist/components/code/code.js +63 -0
  38. package/dist/components/code/code.js.map +1 -0
  39. package/dist/components/collapsible/collapsible.d.ts +14 -0
  40. package/dist/components/collapsible/collapsible.js +55 -0
  41. package/dist/components/collapsible/collapsible.js.map +1 -0
  42. package/dist/components/combobox/combobox.d.ts +33 -0
  43. package/dist/components/combobox/combobox.js +244 -0
  44. package/dist/components/combobox/combobox.js.map +1 -0
  45. package/dist/components/command-menu/command-menu.d.ts +35 -0
  46. package/dist/components/command-menu/command-menu.js +116 -0
  47. package/dist/components/command-menu/command-menu.js.map +1 -0
  48. package/dist/components/context-menu/context-menu.d.ts +45 -0
  49. package/dist/components/context-menu/context-menu.js +136 -0
  50. package/dist/components/context-menu/context-menu.js.map +1 -0
  51. package/dist/components/data-table/data-table.d.ts +49 -0
  52. package/dist/components/data-table/data-table.js +171 -0
  53. package/dist/components/data-table/data-table.js.map +1 -0
  54. package/dist/components/data-table/sort-rows.d.ts +6 -0
  55. package/dist/components/data-table/sort-rows.js +33 -0
  56. package/dist/components/data-table/sort-rows.js.map +1 -0
  57. package/dist/components/dialog/dialog.d.ts +42 -0
  58. package/dist/components/dialog/dialog.js +118 -0
  59. package/dist/components/dialog/dialog.js.map +1 -0
  60. package/dist/components/dropdown-menu/dropdown-menu.d.ts +45 -0
  61. package/dist/components/dropdown-menu/dropdown-menu.js +137 -0
  62. package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -0
  63. package/dist/components/dropdown-menu/menu-styles.d.ts +10 -0
  64. package/dist/components/dropdown-menu/menu-styles.js +34 -0
  65. package/dist/components/dropdown-menu/menu-styles.js.map +1 -0
  66. package/dist/components/empty-state/empty-state.d.ts +12 -0
  67. package/dist/components/empty-state/empty-state.js +46 -0
  68. package/dist/components/empty-state/empty-state.js.map +1 -0
  69. package/dist/components/eyebrow/eyebrow.d.ts +9 -0
  70. package/dist/components/eyebrow/eyebrow.js +25 -0
  71. package/dist/components/eyebrow/eyebrow.js.map +1 -0
  72. package/dist/components/field/field.d.ts +56 -0
  73. package/dist/components/field/field.js +135 -0
  74. package/dist/components/field/field.js.map +1 -0
  75. package/dist/components/glow-border/glow-border.d.ts +9 -0
  76. package/dist/components/glow-border/glow-border.js +39 -0
  77. package/dist/components/glow-border/glow-border.js.map +1 -0
  78. package/dist/components/hex-field/hex-field.d.ts +12 -0
  79. package/dist/components/hex-field/hex-field.js +86 -0
  80. package/dist/components/hex-field/hex-field.js.map +1 -0
  81. package/dist/components/input/input.d.ts +14 -0
  82. package/dist/components/input/input.js +52 -0
  83. package/dist/components/input/input.js.map +1 -0
  84. package/dist/components/kbd/kbd.d.ts +9 -0
  85. package/dist/components/kbd/kbd.js +26 -0
  86. package/dist/components/kbd/kbd.js.map +1 -0
  87. package/dist/components/label/label.d.ts +6 -0
  88. package/dist/components/label/label.js +17 -0
  89. package/dist/components/label/label.js.map +1 -0
  90. package/dist/components/logo/logo-paths.d.ts +5 -0
  91. package/dist/components/logo/logo-paths.js +20 -0
  92. package/dist/components/logo/logo-paths.js.map +1 -0
  93. package/dist/components/logo/logo.d.ts +18 -0
  94. package/dist/components/logo/logo.js +94 -0
  95. package/dist/components/logo/logo.js.map +1 -0
  96. package/dist/components/marquee/marquee.d.ts +15 -0
  97. package/dist/components/marquee/marquee.js +54 -0
  98. package/dist/components/marquee/marquee.js.map +1 -0
  99. package/dist/components/page-header/page-header.d.ts +15 -0
  100. package/dist/components/page-header/page-header.js +50 -0
  101. package/dist/components/page-header/page-header.js.map +1 -0
  102. package/dist/components/pagination/pagination.d.ts +28 -0
  103. package/dist/components/pagination/pagination.js +95 -0
  104. package/dist/components/pagination/pagination.js.map +1 -0
  105. package/dist/components/popover/popover.d.ts +14 -0
  106. package/dist/components/popover/popover.js +48 -0
  107. package/dist/components/popover/popover.js.map +1 -0
  108. package/dist/components/progress/progress.d.ts +14 -0
  109. package/dist/components/progress/progress.js +41 -0
  110. package/dist/components/progress/progress.js.map +1 -0
  111. package/dist/components/radio-group/radio-group.d.ts +10 -0
  112. package/dist/components/radio-group/radio-group.js +33 -0
  113. package/dist/components/radio-group/radio-group.js.map +1 -0
  114. package/dist/components/section-heading/section-heading.d.ts +18 -0
  115. package/dist/components/section-heading/section-heading.js +57 -0
  116. package/dist/components/section-heading/section-heading.js.map +1 -0
  117. package/dist/components/select/select.d.ts +32 -0
  118. package/dist/components/select/select.js +100 -0
  119. package/dist/components/select/select.js.map +1 -0
  120. package/dist/components/separator/separator.d.ts +10 -0
  121. package/dist/components/separator/separator.js +37 -0
  122. package/dist/components/separator/separator.js.map +1 -0
  123. package/dist/components/sheet/sheet.d.ts +29 -0
  124. package/dist/components/sheet/sheet.js +130 -0
  125. package/dist/components/sheet/sheet.js.map +1 -0
  126. package/dist/components/skeleton/skeleton.d.ts +5 -0
  127. package/dist/components/skeleton/skeleton.js +18 -0
  128. package/dist/components/skeleton/skeleton.js.map +1 -0
  129. package/dist/components/slider/slider.d.ts +10 -0
  130. package/dist/components/slider/slider.js +36 -0
  131. package/dist/components/slider/slider.js.map +1 -0
  132. package/dist/components/spinner/spinner.d.ts +9 -0
  133. package/dist/components/spinner/spinner.js +40 -0
  134. package/dist/components/spinner/spinner.js.map +1 -0
  135. package/dist/components/spotlight/spotlight.d.ts +9 -0
  136. package/dist/components/spotlight/spotlight.js +32 -0
  137. package/dist/components/spotlight/spotlight.js.map +1 -0
  138. package/dist/components/starfield/starfield.d.ts +11 -0
  139. package/dist/components/starfield/starfield.js +76 -0
  140. package/dist/components/starfield/starfield.js.map +1 -0
  141. package/dist/components/stat/stat.d.ts +28 -0
  142. package/dist/components/stat/stat.js +100 -0
  143. package/dist/components/stat/stat.js.map +1 -0
  144. package/dist/components/switch/switch.d.ts +13 -0
  145. package/dist/components/switch/switch.js +44 -0
  146. package/dist/components/switch/switch.js.map +1 -0
  147. package/dist/components/table/table.d.ts +52 -0
  148. package/dist/components/table/table.js +96 -0
  149. package/dist/components/table/table.js.map +1 -0
  150. package/dist/components/tabs/tabs.d.ts +24 -0
  151. package/dist/components/tabs/tabs.js +89 -0
  152. package/dist/components/tabs/tabs.js.map +1 -0
  153. package/dist/components/textarea/textarea.d.ts +5 -0
  154. package/dist/components/textarea/textarea.js +20 -0
  155. package/dist/components/textarea/textarea.js.map +1 -0
  156. package/dist/components/theme-switcher/theme-switcher.d.ts +7 -0
  157. package/dist/components/theme-switcher/theme-switcher.js +57 -0
  158. package/dist/components/theme-switcher/theme-switcher.js.map +1 -0
  159. package/dist/components/toaster/toaster.d.ts +7 -0
  160. package/dist/components/toaster/toaster.js +43 -0
  161. package/dist/components/toaster/toaster.js.map +1 -0
  162. package/dist/components/toggle-group/toggle-group.d.ts +24 -0
  163. package/dist/components/toggle-group/toggle-group.js +84 -0
  164. package/dist/components/toggle-group/toggle-group.js.map +1 -0
  165. package/dist/components/tooltip/tooltip.d.ts +19 -0
  166. package/dist/components/tooltip/tooltip.js +49 -0
  167. package/dist/components/tooltip/tooltip.js.map +1 -0
  168. package/dist/fonts/geist-cyrillic-ext-wght-normal.woff2 +0 -0
  169. package/dist/fonts/geist-cyrillic-wght-normal.woff2 +0 -0
  170. package/dist/fonts/geist-latin-ext-wght-normal.woff2 +0 -0
  171. package/dist/fonts/geist-latin-wght-normal.woff2 +0 -0
  172. package/dist/fonts/geist-mono-cyrillic-ext-wght-normal.woff2 +0 -0
  173. package/dist/fonts/geist-mono-cyrillic-wght-normal.woff2 +0 -0
  174. package/dist/fonts/geist-mono-latin-ext-wght-normal.woff2 +0 -0
  175. package/dist/fonts/geist-mono-latin-wght-normal.woff2 +0 -0
  176. package/dist/fonts/geist-mono-symbols2-wght-normal.woff2 +0 -0
  177. package/dist/fonts/geist-mono-vietnamese-wght-normal.woff2 +0 -0
  178. package/dist/fonts/geist-mono.LICENSE +93 -0
  179. package/dist/fonts/geist-vietnamese-wght-normal.woff2 +0 -0
  180. package/dist/fonts/geist.LICENSE +93 -0
  181. package/dist/icons/create-refine-icon.d.ts +13 -0
  182. package/dist/icons/create-refine-icon.js +37 -0
  183. package/dist/icons/create-refine-icon.js.map +1 -0
  184. package/dist/icons/icon.d.ts +10 -0
  185. package/dist/icons/icon.js +13 -0
  186. package/dist/icons/icon.js.map +1 -0
  187. package/dist/icons/refine-icon-names.d.ts +1857 -0
  188. package/dist/icons/refine-icon-names.js +471 -0
  189. package/dist/icons/refine-icon-names.js.map +1 -0
  190. package/dist/icons/refine-icons.d.ts +1852 -0
  191. package/dist/icons/refine-icons.js +604 -0
  192. package/dist/icons/refine-icons.js.map +1 -0
  193. package/dist/index.d.ts +61 -0
  194. package/dist/index.js +61 -0
  195. package/dist/lib/cn.d.ts +5 -0
  196. package/dist/lib/cn.js +49 -0
  197. package/dist/lib/cn.js.map +1 -0
  198. package/dist/lib/use-breakpoint.d.ts +16 -0
  199. package/dist/lib/use-breakpoint.js +52 -0
  200. package/dist/lib/use-breakpoint.js.map +1 -0
  201. package/dist/styles.css +697 -0
  202. package/dist/theme/theme-provider.d.ts +31 -0
  203. package/dist/theme/theme-provider.js +115 -0
  204. package/dist/theme/theme-provider.js.map +1 -0
  205. package/dist/theme/theme-scope.d.ts +12 -0
  206. package/dist/theme/theme-scope.js +22 -0
  207. package/dist/theme/theme-scope.js.map +1 -0
  208. package/dist/theme/theme.d.ts +20 -0
  209. package/dist/theme/theme.js +37 -0
  210. package/dist/theme/theme.js.map +1 -0
  211. package/package.json +91 -5
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ import { cn } from "../../lib/cn.js";
3
+ import { useFieldControl } from "../field/field.js";
4
+ import { Switch } from "radix-ui";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { cva } from "class-variance-authority";
7
+ // src/components/switch/switch.tsx
8
+ var switchVariants = cva([
9
+ "peer inline-flex shrink-0 items-center rounded-full border border-transparent bg-input p-0.5",
10
+ "transition-colors duration-200 ease-out-expo",
11
+ "focus-ring",
12
+ "hover:bg-foreground/25",
13
+ "data-[state=checked]:bg-gem data-[state=checked]:hover:bg-gem/85",
14
+ "aria-invalid:border-danger",
15
+ "disabled:cursor-not-allowed disabled:opacity-45"
16
+ ], {
17
+ variants: { size: {
18
+ sm: "h-4.5 w-8",
19
+ md: "h-6 w-11"
20
+ } },
21
+ defaultVariants: { size: "md" }
22
+ });
23
+ var switchThumbVariants = cva(["pointer-events-none block rounded-full bg-background shadow-sm", "transition-transform duration-200 ease-spring data-[state=unchecked]:translate-x-0"], {
24
+ variants: { size: {
25
+ sm: "size-3.5 data-[state=checked]:translate-x-3.5",
26
+ md: "size-5 data-[state=checked]:translate-x-5"
27
+ } },
28
+ defaultVariants: { size: "md" }
29
+ });
30
+ /**
31
+ * Toggles a setting on or off immediately, filling with the current gem when on.
32
+ */
33
+ var Switch$1 = ({ className, size, ...props }) => {
34
+ const controlProps = useFieldControl(props);
35
+ return /* @__PURE__ */ jsx(Switch.Root, {
36
+ className: cn(switchVariants({ size }), className),
37
+ "data-slot": "switch",
38
+ ...controlProps,
39
+ children: /* @__PURE__ */ jsx(Switch.Thumb, { className: switchThumbVariants({ size }) })
40
+ });
41
+ };
42
+ export { Switch$1 as Switch };
43
+
44
+ //# sourceMappingURL=switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.js","names":["Switch","SwitchPrimitive"],"sources":["../../../src/components/switch/switch.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Switch as SwitchPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../lib/cn';\nimport { useFieldControl } from '../field/field';\n\nconst switchVariants = cva(\n [\n // base\n 'peer inline-flex shrink-0 items-center rounded-full border border-transparent bg-input p-0.5',\n 'transition-colors duration-200 ease-out-expo',\n 'focus-ring',\n // hover\n 'hover:bg-foreground/25',\n // checked\n 'data-[state=checked]:bg-gem data-[state=checked]:hover:bg-gem/85',\n // invalid\n 'aria-invalid:border-danger',\n // disabled\n 'disabled:cursor-not-allowed disabled:opacity-45',\n ],\n {\n variants: {\n size: {\n sm: 'h-4.5 w-8',\n md: 'h-6 w-11',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst switchThumbVariants = cva(\n [\n // base\n 'pointer-events-none block rounded-full bg-background shadow-sm',\n // animation\n 'transition-transform duration-200 ease-spring data-[state=unchecked]:translate-x-0',\n ],\n {\n variants: {\n size: {\n sm: 'size-3.5 data-[state=checked]:translate-x-3.5',\n md: 'size-5 data-[state=checked]:translate-x-5',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\ninterface SwitchProps extends ComponentProps<typeof SwitchPrimitive.Root>, VariantProps<typeof switchVariants> {}\n\n/**\n * Toggles a setting on or off immediately, filling with the current gem when on.\n */\nexport const Switch = ({ className, size, ...props }: SwitchProps) => {\n const controlProps = useFieldControl(props);\n\n return (\n <SwitchPrimitive.Root className={cn(switchVariants({ size }), className)} data-slot=\"switch\" {...controlProps}>\n <SwitchPrimitive.Thumb className={switchThumbVariants({ size })} />\n </SwitchPrimitive.Root>\n );\n};\n"],"mappings":";;;;;;;AASA,IAAM,iBAAiB,IACrB;CAEE;CACA;CACA;CAEA;CAEA;CAEA;CAEA;AACF,GACA;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;CACN,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CACF;AAEA,IAAM,sBAAsB,IAC1B,CAEE,kEAEA,oFACF,GACA;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,IAAI;CACN,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CACF;;;;AAOA,IAAaA,YAAU,EAAE,WAAW,MAAM,GAAG,YAAyB;CACpE,MAAM,eAAe,gBAAgB,KAAK;CAE1C,OACE,oBAACC,OAAgB,MAAjB;EAAsB,WAAW,GAAG,eAAe,EAAE,KAAK,CAAC,GAAG,SAAS;EAAG,aAAU;EAAS,GAAI;EAC/F,UAAA,oBAACA,OAAgB,OAAjB,EAAuB,WAAW,oBAAoB,EAAE,KAAK,CAAC,EAAI,CAAA;CAC9C,CAAA;AAE1B"}
@@ -0,0 +1,52 @@
1
+ import type { ComponentProps } from 'react';
2
+ interface TableProps extends ComponentProps<'table'> {
3
+ containerClassName?: string;
4
+ stickyHeader?: boolean;
5
+ }
6
+ /**
7
+ * A dense data table inside a scroll container; `stickyHeader` pins the header row while the body scrolls.
8
+ * Rows carry no rule between them: a hairline sits under the header and over the totals, and a
9
+ * row shows itself on hover with a rounded fill. Borders and corners live on the cells, because
10
+ * a separated table is the only one whose cells take a radius.
11
+ */
12
+ export declare const Table: ({ className, containerClassName, stickyHeader, ...props }: TableProps) => import("react").JSX.Element;
13
+ /**
14
+ * The header row group.
15
+ */
16
+ export declare const TableHeader: ({ className, ...props }: ComponentProps<"thead">) => import("react").JSX.Element;
17
+ /**
18
+ * The body row group.
19
+ */
20
+ export declare const TableBody: ({ className, ...props }: ComponentProps<"tbody">) => import("react").JSX.Element;
21
+ /**
22
+ * The totals row group.
23
+ */
24
+ export declare const TableFooter: ({ className, ...props }: ComponentProps<"tfoot">) => import("react").JSX.Element;
25
+ interface TableRowProps extends ComponentProps<'tr'> {
26
+ /** `false` for a row that is not a record, such as a group heading or an empty state: it never lights up */
27
+ hoverable?: boolean;
28
+ }
29
+ /**
30
+ * A row that fills on hover and when `data-state="selected"`, with rounded ends. The fill sits on
31
+ * its cells, so a header row of `TableHead` cells never takes it.
32
+ */
33
+ export declare const TableRow: ({ className, hoverable, ...props }: TableRowProps) => import("react").JSX.Element;
34
+ interface TableCellProps extends ComponentProps<'td'> {
35
+ numeric?: boolean;
36
+ }
37
+ interface TableHeadProps extends ComponentProps<'th'> {
38
+ numeric?: boolean;
39
+ }
40
+ /**
41
+ * A header cell in the mono eyebrow voice; `numeric` right-aligns it over a number column.
42
+ */
43
+ export declare const TableHead: ({ className, numeric, ...props }: TableHeadProps) => import("react").JSX.Element;
44
+ /**
45
+ * A body cell; `numeric` right-aligns it with tabular figures so digits line up.
46
+ */
47
+ export declare const TableCell: ({ className, numeric, ...props }: TableCellProps) => import("react").JSX.Element;
48
+ /**
49
+ * A caption under the table.
50
+ */
51
+ export declare const TableCaption: ({ className, ...props }: ComponentProps<"caption">) => import("react").JSX.Element;
52
+ export {};
@@ -0,0 +1,96 @@
1
+ import { cn } from "../../lib/cn.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ // src/components/table/table.tsx
4
+ /**
5
+ * A dense data table inside a scroll container; `stickyHeader` pins the header row while the body scrolls.
6
+ * Rows carry no rule between them: a hairline sits under the header and over the totals, and a
7
+ * row shows itself on hover with a rounded fill. Borders and corners live on the cells, because
8
+ * a separated table is the only one whose cells take a radius.
9
+ */
10
+ var Table = ({ className, containerClassName, stickyHeader = false, ...props }) => {
11
+ return /* @__PURE__ */ jsx("div", {
12
+ className: cn("relative w-full overflow-auto", containerClassName),
13
+ "data-slot": "table-container",
14
+ "data-sticky": stickyHeader || void 0,
15
+ children: /* @__PURE__ */ jsx("table", {
16
+ className: cn("group/table w-full caption-bottom border-separate border-spacing-0 text-body-sm", className),
17
+ "data-slot": "table",
18
+ "data-sticky": stickyHeader || void 0,
19
+ ...props
20
+ })
21
+ });
22
+ };
23
+ /**
24
+ * The header row group.
25
+ */
26
+ var TableHeader = ({ className, ...props }) => {
27
+ return /* @__PURE__ */ jsx("thead", {
28
+ className: cn("[&_th]:border-b group-data-sticky/table:sticky group-data-sticky/table:top-0 group-data-sticky/table:z-10 group-data-sticky/table:bg-background/90 group-data-sticky/table:backdrop-blur", className),
29
+ "data-slot": "table-header",
30
+ ...props
31
+ });
32
+ };
33
+ /**
34
+ * The body row group.
35
+ */
36
+ var TableBody = ({ className, ...props }) => {
37
+ return /* @__PURE__ */ jsx("tbody", {
38
+ className,
39
+ "data-slot": "table-body",
40
+ ...props
41
+ });
42
+ };
43
+ /**
44
+ * The totals row group.
45
+ */
46
+ var TableFooter = ({ className, ...props }) => {
47
+ return /* @__PURE__ */ jsx("tfoot", {
48
+ className: cn("bg-muted/60 font-medium [&>tr:first-child>td]:border-t", className),
49
+ "data-slot": "table-footer",
50
+ ...props
51
+ });
52
+ };
53
+ /**
54
+ * A row that fills on hover and when `data-state="selected"`, with rounded ends. The fill sits on
55
+ * its cells, so a header row of `TableHead` cells never takes it.
56
+ */
57
+ var TableRow = ({ className, hoverable = true, ...props }) => {
58
+ return /* @__PURE__ */ jsx("tr", {
59
+ className: cn("[&>td]:transition-colors [&>td:first-child]:rounded-l-control [&>td:last-child]:rounded-r-control", hoverable && "[&:hover>td]:bg-hover data-[state=selected]:[&>td]:bg-gem/10 data-[state=selected]:[&:hover>td]:bg-gem/15", className),
60
+ "data-slot": "table-row",
61
+ ...props
62
+ });
63
+ };
64
+ /**
65
+ * A header cell in the mono eyebrow voice; `numeric` right-aligns it over a number column.
66
+ */
67
+ var TableHead = ({ className, numeric = false, ...props }) => {
68
+ return /* @__PURE__ */ jsx("th", {
69
+ className: cn("eyebrow h-control-md px-3 text-left align-middle whitespace-nowrap text-muted-foreground [&:has([role=checkbox])]:w-0 [&:has([role=checkbox])]:pr-0", { "text-right": numeric }, className),
70
+ "data-slot": "table-head",
71
+ ...props
72
+ });
73
+ };
74
+ /**
75
+ * A body cell; `numeric` right-aligns it with tabular figures so digits line up.
76
+ */
77
+ var TableCell = ({ className, numeric = false, ...props }) => {
78
+ return /* @__PURE__ */ jsx("td", {
79
+ className: cn("h-control-lg px-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", { "text-right font-mono tabular-nums": numeric }, className),
80
+ "data-slot": "table-cell",
81
+ ...props
82
+ });
83
+ };
84
+ /**
85
+ * A caption under the table.
86
+ */
87
+ var TableCaption = ({ className, ...props }) => {
88
+ return /* @__PURE__ */ jsx("caption", {
89
+ className: cn("mt-4 text-body-sm text-muted-foreground", className),
90
+ "data-slot": "table-caption",
91
+ ...props
92
+ });
93
+ };
94
+ export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
95
+
96
+ //# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.js","names":[],"sources":["../../../src/components/table/table.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../../lib/cn';\n\ninterface TableProps extends ComponentProps<'table'> {\n containerClassName?: string;\n stickyHeader?: boolean;\n}\n\n/**\n * A dense data table inside a scroll container; `stickyHeader` pins the header row while the body scrolls.\n * Rows carry no rule between them: a hairline sits under the header and over the totals, and a\n * row shows itself on hover with a rounded fill. Borders and corners live on the cells, because\n * a separated table is the only one whose cells take a radius.\n */\nexport const Table = ({ className, containerClassName, stickyHeader = false, ...props }: TableProps) => {\n return (\n <div\n className={cn('relative w-full overflow-auto', containerClassName)}\n data-slot=\"table-container\"\n data-sticky={stickyHeader || undefined}\n >\n <table\n className={cn('group/table w-full caption-bottom border-separate border-spacing-0 text-body-sm', className)}\n data-slot=\"table\"\n data-sticky={stickyHeader || undefined}\n {...props}\n />\n </div>\n );\n};\n\n/**\n * The header row group.\n */\nexport const TableHeader = ({ className, ...props }: ComponentProps<'thead'>) => {\n return (\n <thead\n className={cn(\n '[&_th]:border-b group-data-sticky/table:sticky group-data-sticky/table:top-0 group-data-sticky/table:z-10 group-data-sticky/table:bg-background/90 group-data-sticky/table:backdrop-blur',\n className,\n )}\n data-slot=\"table-header\"\n {...props}\n />\n );\n};\n\n/**\n * The body row group.\n */\nexport const TableBody = ({ className, ...props }: ComponentProps<'tbody'>) => {\n return <tbody className={className} data-slot=\"table-body\" {...props} />;\n};\n\n/**\n * The totals row group.\n */\nexport const TableFooter = ({ className, ...props }: ComponentProps<'tfoot'>) => {\n return (\n <tfoot\n className={cn('bg-muted/60 font-medium [&>tr:first-child>td]:border-t', className)}\n data-slot=\"table-footer\"\n {...props}\n />\n );\n};\n\ninterface TableRowProps extends ComponentProps<'tr'> {\n /** `false` for a row that is not a record, such as a group heading or an empty state: it never lights up */\n hoverable?: boolean;\n}\n\n/**\n * A row that fills on hover and when `data-state=\"selected\"`, with rounded ends. The fill sits on\n * its cells, so a header row of `TableHead` cells never takes it.\n */\nexport const TableRow = ({ className, hoverable = true, ...props }: TableRowProps) => {\n return (\n <tr\n className={cn(\n '[&>td]:transition-colors [&>td:first-child]:rounded-l-control [&>td:last-child]:rounded-r-control',\n hoverable &&\n '[&:hover>td]:bg-hover data-[state=selected]:[&>td]:bg-gem/10 data-[state=selected]:[&:hover>td]:bg-gem/15',\n className,\n )}\n data-slot=\"table-row\"\n {...props}\n />\n );\n};\n\ninterface TableCellProps extends ComponentProps<'td'> {\n numeric?: boolean;\n}\n\ninterface TableHeadProps extends ComponentProps<'th'> {\n numeric?: boolean;\n}\n\n/**\n * A header cell in the mono eyebrow voice; `numeric` right-aligns it over a number column.\n */\nexport const TableHead = ({ className, numeric = false, ...props }: TableHeadProps) => {\n return (\n <th\n className={cn(\n 'eyebrow h-control-md px-3 text-left align-middle whitespace-nowrap text-muted-foreground [&:has([role=checkbox])]:w-0 [&:has([role=checkbox])]:pr-0',\n {\n 'text-right': numeric,\n },\n className,\n )}\n data-slot=\"table-head\"\n {...props}\n />\n );\n};\n\n/**\n * A body cell; `numeric` right-aligns it with tabular figures so digits line up.\n */\nexport const TableCell = ({ className, numeric = false, ...props }: TableCellProps) => {\n return (\n <td\n className={cn(\n 'h-control-lg px-3 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0',\n {\n 'text-right font-mono tabular-nums': numeric,\n },\n className,\n )}\n data-slot=\"table-cell\"\n {...props}\n />\n );\n};\n\n/**\n * A caption under the table.\n */\nexport const TableCaption = ({ className, ...props }: ComponentProps<'caption'>) => {\n return (\n <caption className={cn('mt-4 text-body-sm text-muted-foreground', className)} data-slot=\"table-caption\" {...props} />\n );\n};\n"],"mappings":";;;;;;;;;AAeA,IAAa,SAAS,EAAE,WAAW,oBAAoB,eAAe,OAAO,GAAG,YAAwB;CACtG,OACE,oBAAC,OAAD;EACE,WAAW,GAAG,iCAAiC,kBAAkB;EACjE,aAAU;EACV,eAAa,gBAAgB,KAAA;EAE7B,UAAA,oBAAC,SAAD;GACE,WAAW,GAAG,mFAAmF,SAAS;GAC1G,aAAU;GACV,eAAa,gBAAgB,KAAA;GAC7B,GAAI;EACL,CAAA;CACE,CAAA;AAET;;;;AAKA,IAAa,eAAe,EAAE,WAAW,GAAG,YAAqC;CAC/E,OACE,oBAAC,SAAD;EACE,WAAW,GACT,4LACA,SACF;EACA,aAAU;EACV,GAAI;CACL,CAAA;AAEL;;;;AAKA,IAAa,aAAa,EAAE,WAAW,GAAG,YAAqC;CAC7E,OAAO,oBAAC,SAAD;EAAkB;EAAW,aAAU;EAAa,GAAI;CAAQ,CAAA;AACzE;;;;AAKA,IAAa,eAAe,EAAE,WAAW,GAAG,YAAqC;CAC/E,OACE,oBAAC,SAAD;EACE,WAAW,GAAG,0DAA0D,SAAS;EACjF,aAAU;EACV,GAAI;CACL,CAAA;AAEL;;;;;AAWA,IAAa,YAAY,EAAE,WAAW,YAAY,MAAM,GAAG,YAA2B;CACpF,OACE,oBAAC,MAAD;EACE,WAAW,GACT,qGACA,aACE,6GACF,SACF;EACA,aAAU;EACV,GAAI;CACL,CAAA;AAEL;;;;AAaA,IAAa,aAAa,EAAE,WAAW,UAAU,OAAO,GAAG,YAA4B;CACrF,OACE,oBAAC,MAAD;EACE,WAAW,GACT,uJACA,EACE,cAAc,QAChB,GACA,SACF;EACA,aAAU;EACV,GAAI;CACL,CAAA;AAEL;;;;AAKA,IAAa,aAAa,EAAE,WAAW,UAAU,OAAO,GAAG,YAA4B;CACrF,OACE,oBAAC,MAAD;EACE,WAAW,GACT,kFACA,EACE,qCAAqC,QACvC,GACA,SACF;EACA,aAAU;EACV,GAAI;CACL,CAAA;AAEL;;;;AAKA,IAAa,gBAAgB,EAAE,WAAW,GAAG,YAAuC;CAClF,OACE,oBAAC,WAAD;EAAS,WAAW,GAAG,2CAA2C,SAAS;EAAG,aAAU;EAAgB,GAAI;CAAQ,CAAA;AAExH"}
@@ -0,0 +1,24 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import { Tabs as TabsPrimitive } from 'radix-ui';
3
+ import { type ComponentProps } from 'react';
4
+ declare const tabsListVariants: (props?: ({
5
+ variant?: "underline" | "pill" | "segmented" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ /**
8
+ * Holds the active tab; reads `defaultValue` or the controlled `value`.
9
+ */
10
+ export declare const Tabs: ({ className, ...props }: ComponentProps<typeof TabsPrimitive.Root>) => import("react").JSX.Element;
11
+ type TabsListProps = ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>;
12
+ /**
13
+ * Lays out the triggers and hands its `variant` down to them.
14
+ */
15
+ export declare const TabsList: ({ className, variant, ...props }: TabsListProps) => import("react").JSX.Element;
16
+ interface TabsTriggerProps extends ComponentProps<typeof TabsPrimitive.Trigger> {
17
+ count?: number | string;
18
+ }
19
+ /**
20
+ * Activates its panel; an optional `count` renders as a small tally after the label.
21
+ */
22
+ export declare const TabsTrigger: ({ children, className, count, ...props }: TabsTriggerProps) => import("react").JSX.Element;
23
+ export declare const TabsContent: ({ className, ...props }: ComponentProps<typeof TabsPrimitive.Content>) => import("react").JSX.Element;
24
+ export {};
@@ -0,0 +1,89 @@
1
+ "use client";
2
+ import { cn } from "../../lib/cn.js";
3
+ import { Tabs } from "radix-ui";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { cva } from "class-variance-authority";
6
+ import { createContext, use } from "react";
7
+ // src/components/tabs/tabs.tsx
8
+ var tabsListVariants = cva(["inline-flex w-fit shrink-0 items-center text-muted-foreground"], {
9
+ variants: { variant: {
10
+ underline: "gap-6 border-b",
11
+ pill: "gap-1",
12
+ segmented: "gap-0.5 rounded-control bg-muted p-0.5"
13
+ } },
14
+ defaultVariants: { variant: "underline" }
15
+ });
16
+ var tabsTriggerVariants = cva([
17
+ "group/tab relative inline-flex shrink-0 items-center justify-center gap-2 text-body-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow] duration-150 focus-ring",
18
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
19
+ "hover:text-foreground",
20
+ "disabled:pointer-events-none disabled:opacity-45"
21
+ ], {
22
+ variants: { variant: {
23
+ underline: [
24
+ "h-control-md rounded-t-control px-0.5",
25
+ "after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:rounded-full after:bg-transparent after:transition-colors",
26
+ "data-[state=active]:text-foreground data-[state=active]:after:bg-gem"
27
+ ],
28
+ pill: [
29
+ "h-control-sm rounded-full px-3.5",
30
+ "hover:bg-hover",
31
+ "data-[state=active]:bg-primary data-[state=active]:text-primary-foreground"
32
+ ],
33
+ segmented: ["h-[calc(var(--spacing-control-sm)-0.25rem)] flex-1 rounded-inner px-3", "data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-soft"]
34
+ } },
35
+ defaultVariants: { variant: "underline" }
36
+ });
37
+ var TabsVariantContext = createContext("underline");
38
+ /**
39
+ * Holds the active tab; reads `defaultValue` or the controlled `value`.
40
+ */
41
+ var Tabs$1 = ({ className, ...props }) => {
42
+ return /* @__PURE__ */ jsx(Tabs.Root, {
43
+ className: cn("flex flex-col gap-4", className),
44
+ "data-slot": "tabs",
45
+ ...props
46
+ });
47
+ };
48
+ /**
49
+ * Lays out the triggers and hands its `variant` down to them.
50
+ */
51
+ var TabsList = ({ className, variant = "underline", ...props }) => {
52
+ return /* @__PURE__ */ jsx(TabsVariantContext, {
53
+ value: variant ?? "underline",
54
+ children: /* @__PURE__ */ jsx(Tabs.List, {
55
+ className: cn(tabsListVariants({ variant }), className),
56
+ "data-slot": "tabs-list",
57
+ "data-variant": variant,
58
+ ...props
59
+ })
60
+ });
61
+ };
62
+ /**
63
+ * Activates its panel; an optional `count` renders as a small tally after the label.
64
+ */
65
+ var TabsTrigger = ({ children, className, count, ...props }) => {
66
+ const variant = use(TabsVariantContext);
67
+ return /* @__PURE__ */ jsxs(Tabs.Trigger, {
68
+ className: cn(tabsTriggerVariants({ variant }), className),
69
+ "data-slot": "tabs-trigger",
70
+ ...props,
71
+ children: [children, count !== void 0 && /* @__PURE__ */ jsx("span", {
72
+ className: cn("min-w-5 rounded-full bg-muted px-1.5 text-center font-mono text-caption tabular-nums text-muted-foreground transition-colors", {
73
+ "group-data-[state=active]/tab:bg-gem-soft group-data-[state=active]/tab:text-gem-ink": variant !== "pill",
74
+ "group-data-[state=active]/tab:bg-primary-foreground/15 group-data-[state=active]/tab:text-primary-foreground": variant === "pill"
75
+ }),
76
+ children: count
77
+ })]
78
+ });
79
+ };
80
+ var TabsContent = ({ className, ...props }) => {
81
+ return /* @__PURE__ */ jsx(Tabs.Content, {
82
+ className: cn("flex-1 outline-none focus-ring", className),
83
+ "data-slot": "tabs-content",
84
+ ...props
85
+ });
86
+ };
87
+ export { Tabs$1 as Tabs, TabsContent, TabsList, TabsTrigger };
88
+
89
+ //# sourceMappingURL=tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.js","names":["Tabs","TabsPrimitive"],"sources":["../../../src/components/tabs/tabs.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { type ComponentProps, createContext, use } from 'react';\n\nimport { cn } from '../../lib/cn';\n\ntype TabsVariant = NonNullable<VariantProps<typeof tabsListVariants>['variant']>;\n\nconst tabsListVariants = cva(\n [\n // base\n 'inline-flex w-fit shrink-0 items-center text-muted-foreground',\n ],\n {\n variants: {\n variant: {\n underline: 'gap-6 border-b',\n pill: 'gap-1',\n segmented: 'gap-0.5 rounded-control bg-muted p-0.5',\n },\n },\n defaultVariants: {\n variant: 'underline',\n },\n },\n);\n\nconst tabsTriggerVariants = cva(\n [\n // base\n 'group/tab relative inline-flex shrink-0 items-center justify-center gap-2 text-body-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow] duration-150 focus-ring',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n // hover\n 'hover:text-foreground',\n // disabled\n 'disabled:pointer-events-none disabled:opacity-45',\n ],\n {\n variants: {\n variant: {\n underline: [\n 'h-control-md rounded-t-control px-0.5',\n 'after:absolute after:inset-x-0 after:-bottom-px after:h-0.5 after:rounded-full after:bg-transparent after:transition-colors',\n 'data-[state=active]:text-foreground data-[state=active]:after:bg-gem',\n ],\n pill: [\n 'h-control-sm rounded-full px-3.5',\n 'hover:bg-hover',\n 'data-[state=active]:bg-primary data-[state=active]:text-primary-foreground',\n ],\n segmented: [\n 'h-[calc(var(--spacing-control-sm)-0.25rem)] flex-1 rounded-inner px-3',\n 'data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-soft',\n ],\n },\n },\n defaultVariants: {\n variant: 'underline',\n },\n },\n);\n\nconst TabsVariantContext = createContext<TabsVariant>('underline');\n\n/**\n * Holds the active tab; reads `defaultValue` or the controlled `value`.\n */\nexport const Tabs = ({ className, ...props }: ComponentProps<typeof TabsPrimitive.Root>) => {\n return <TabsPrimitive.Root className={cn('flex flex-col gap-4', className)} data-slot=\"tabs\" {...props} />;\n};\n\ntype TabsListProps = ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>;\n\n/**\n * Lays out the triggers and hands its `variant` down to them.\n */\nexport const TabsList = ({ className, variant = 'underline', ...props }: TabsListProps) => {\n return (\n <TabsVariantContext value={variant ?? 'underline'}>\n <TabsPrimitive.List\n className={cn(tabsListVariants({ variant }), className)}\n data-slot=\"tabs-list\"\n data-variant={variant}\n {...props}\n />\n </TabsVariantContext>\n );\n};\n\ninterface TabsTriggerProps extends ComponentProps<typeof TabsPrimitive.Trigger> {\n count?: number | string;\n}\n\n/**\n * Activates its panel; an optional `count` renders as a small tally after the label.\n */\nexport const TabsTrigger = ({ children, className, count, ...props }: TabsTriggerProps) => {\n const variant = use(TabsVariantContext);\n\n return (\n <TabsPrimitive.Trigger\n className={cn(tabsTriggerVariants({ variant }), className)}\n data-slot=\"tabs-trigger\"\n {...props}\n >\n {children}\n {count !== undefined && (\n <span\n className={cn(\n 'min-w-5 rounded-full bg-muted px-1.5 text-center font-mono text-caption tabular-nums text-muted-foreground transition-colors',\n {\n 'group-data-[state=active]/tab:bg-gem-soft group-data-[state=active]/tab:text-gem-ink': variant !== 'pill',\n 'group-data-[state=active]/tab:bg-primary-foreground/15 group-data-[state=active]/tab:text-primary-foreground':\n variant === 'pill',\n },\n )}\n >\n {count}\n </span>\n )}\n </TabsPrimitive.Trigger>\n );\n};\n\nexport const TabsContent = ({ className, ...props }: ComponentProps<typeof TabsPrimitive.Content>) => {\n return (\n <TabsPrimitive.Content\n className={cn('flex-1 outline-none focus-ring', className)}\n data-slot=\"tabs-content\"\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;AAUA,IAAM,mBAAmB,IACvB,CAEE,+DACF,GACA;CACE,UAAU,EACR,SAAS;EACP,WAAW;EACX,MAAM;EACN,WAAW;CACb,EACF;CACA,iBAAiB,EACf,SAAS,YACX;AACF,CACF;AAEA,IAAM,sBAAsB,IAC1B;CAEE;CACA;CAEA;CAEA;AACF,GACA;CACE,UAAU,EACR,SAAS;EACP,WAAW;GACT;GACA;GACA;EACF;EACA,MAAM;GACJ;GACA;GACA;EACF;EACA,WAAW,CACT,yEACA,uGACF;CACF,EACF;CACA,iBAAiB,EACf,SAAS,YACX;AACF,CACF;AAEA,IAAM,qBAAqB,cAA2B,WAAW;;;;AAKjE,IAAaA,UAAQ,EAAE,WAAW,GAAG,YAAuD;CAC1F,OAAO,oBAACC,KAAc,MAAf;EAAoB,WAAW,GAAG,uBAAuB,SAAS;EAAG,aAAU;EAAO,GAAI;CAAQ,CAAA;AAC3G;;;;AAOA,IAAa,YAAY,EAAE,WAAW,UAAU,aAAa,GAAG,YAA2B;CACzF,OACE,oBAAC,oBAAD;EAAoB,OAAO,WAAW;EACpC,UAAA,oBAACA,KAAc,MAAf;GACE,WAAW,GAAG,iBAAiB,EAAE,QAAQ,CAAC,GAAG,SAAS;GACtD,aAAU;GACV,gBAAc;GACd,GAAI;EACL,CAAA;CACiB,CAAA;AAExB;;;;AASA,IAAa,eAAe,EAAE,UAAU,WAAW,OAAO,GAAG,YAA8B;CACzF,MAAM,UAAU,IAAI,kBAAkB;CAEtC,OACE,qBAACA,KAAc,SAAf;EACE,WAAW,GAAG,oBAAoB,EAAE,QAAQ,CAAC,GAAG,SAAS;EACzD,aAAU;EACV,GAAI;EAHN,UAAA,CAKG,UACA,UAAU,KAAA,KACT,oBAAC,QAAD;GACE,WAAW,GACT,gIACA;IACE,wFAAwF,YAAY;IACpG,gHACE,YAAY;GAChB,CACF;GAEC,UAAA;EACG,CAAA,CAEa;;AAE3B;AAEA,IAAa,eAAe,EAAE,WAAW,GAAG,YAA0D;CACpG,OACE,oBAACA,KAAc,SAAf;EACE,WAAW,GAAG,kCAAkC,SAAS;EACzD,aAAU;EACV,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,5 @@
1
+ import type { ComponentProps } from 'react';
2
+ /**
3
+ * Renders a multi-line input that grows with its content up to `max-h-64`, then scrolls.
4
+ */
5
+ export declare const Textarea: ({ className, rows, ...props }: ComponentProps<"textarea">) => import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { cn } from "../../lib/cn.js";
3
+ import { useFieldControl } from "../field/field.js";
4
+ import { jsx } from "react/jsx-runtime";
5
+ // src/components/textarea/textarea.tsx
6
+ /**
7
+ * Renders a multi-line input that grows with its content up to `max-h-64`, then scrolls.
8
+ */
9
+ var Textarea = ({ className, rows = 3, ...props }) => {
10
+ const controlProps = useFieldControl(props);
11
+ return /* @__PURE__ */ jsx("textarea", {
12
+ className: cn("field-sizing-content max-h-64 min-h-20 w-full resize-y rounded-control border border-input bg-background px-3 py-2 text-body-sm text-foreground outline-none placeholder:text-subtle", "transition-[border-color,box-shadow] duration-150 ease-out-expo", "hover:border-foreground/25", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/20", "aria-invalid:border-danger aria-invalid:focus-visible:ring-danger/20", "disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-60 disabled:hover:border-input", "read-only:bg-muted", className),
13
+ "data-slot": "textarea",
14
+ rows,
15
+ ...controlProps
16
+ });
17
+ };
18
+ export { Textarea };
19
+
20
+ //# sourceMappingURL=textarea.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textarea.js","names":[],"sources":["../../../src/components/textarea/textarea.tsx"],"sourcesContent":["'use client';\n\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../lib/cn';\nimport { useFieldControl } from '../field/field';\n\n/**\n * Renders a multi-line input that grows with its content up to `max-h-64`, then scrolls.\n */\nexport const Textarea = ({ className, rows = 3, ...props }: ComponentProps<'textarea'>) => {\n const controlProps = useFieldControl(props);\n\n return (\n <textarea\n className={cn(\n // base\n 'field-sizing-content max-h-64 min-h-20 w-full resize-y rounded-control border border-input bg-background px-3 py-2 text-body-sm text-foreground outline-none placeholder:text-subtle',\n 'transition-[border-color,box-shadow] duration-150 ease-out-expo',\n // hover\n 'hover:border-foreground/25',\n // focus\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/20',\n // invalid\n 'aria-invalid:border-danger aria-invalid:focus-visible:ring-danger/20',\n // disabled\n 'disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-60 disabled:hover:border-input',\n // read-only\n 'read-only:bg-muted',\n className,\n )}\n data-slot=\"textarea\"\n rows={rows}\n {...controlProps}\n />\n );\n};\n"],"mappings":";;;;;;;;AAUA,IAAa,YAAY,EAAE,WAAW,OAAO,GAAG,GAAG,YAAwC;CACzF,MAAM,eAAe,gBAAgB,KAAK;CAE1C,OACE,oBAAC,YAAD;EACE,WAAW,GAET,wLACA,mEAEA,8BAEA,6EAEA,wEAEA,iGAEA,sBACA,SACF;EACA,aAAU;EACJ;EACN,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,7 @@
1
+ import type { ComponentProps } from 'react';
2
+ type ThemeSwitcherProps = Omit<ComponentProps<'div'>, 'defaultValue' | 'dir'>;
3
+ /**
4
+ * Lets a person pick light, dark or system mode; the choice writes through `useTheme`, so it applies app-wide and persists.
5
+ */
6
+ export declare const ThemeSwitcher: ({ className, ...props }: ThemeSwitcherProps) => import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { cn } from "../../lib/cn.js";
3
+ import { useTheme } from "../../theme/theme-provider.js";
4
+ import { Monitor, Moon, Sun } from "lucide-react";
5
+ import { ToggleGroup } from "radix-ui";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ // src/components/theme-switcher/theme-switcher.tsx
8
+ var MODE_OPTIONS = [
9
+ {
10
+ icon: Sun,
11
+ label: "Light",
12
+ value: "light"
13
+ },
14
+ {
15
+ icon: Moon,
16
+ label: "Dark",
17
+ value: "dark"
18
+ },
19
+ {
20
+ icon: Monitor,
21
+ label: "System",
22
+ value: "system"
23
+ }
24
+ ];
25
+ /**
26
+ * Lets a person pick light, dark or system mode; the choice writes through `useTheme`, so it applies app-wide and persists.
27
+ */
28
+ var ThemeSwitcher = ({ className, ...props }) => {
29
+ const theme = useTheme();
30
+ return /* @__PURE__ */ jsx(ToggleGroup.Root, {
31
+ className: cn("inline-flex items-center gap-0.5 rounded-control border border-border bg-muted p-0.5", className),
32
+ "data-slot": "theme-switcher",
33
+ onValueChange: (value) => {
34
+ if (value) theme.setTheme({ mode: value });
35
+ },
36
+ type: "single",
37
+ value: theme.mode,
38
+ ...props,
39
+ children: MODE_OPTIONS.map(({ icon: Icon, label, value }) => {
40
+ return /* @__PURE__ */ jsxs(ToggleGroup.Item, {
41
+ className: cn("inline-flex size-control-xs items-center justify-center rounded-inner text-muted-foreground transition-colors focus-ring", "hover:text-foreground", "data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-soft"),
42
+ title: label,
43
+ value,
44
+ children: [/* @__PURE__ */ jsx(Icon, {
45
+ "aria-hidden": true,
46
+ className: "size-3.5"
47
+ }), /* @__PURE__ */ jsx("span", {
48
+ className: "sr-only",
49
+ children: label
50
+ })]
51
+ }, value);
52
+ })
53
+ });
54
+ };
55
+ export { ThemeSwitcher };
56
+
57
+ //# sourceMappingURL=theme-switcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-switcher.js","names":["ToggleGroupPrimitive"],"sources":["../../../src/components/theme-switcher/theme-switcher.tsx"],"sourcesContent":["'use client';\n\nimport { Monitor, Moon, Sun } from 'lucide-react';\nimport { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';\nimport type { ComponentProps } from 'react';\n\nimport { cn } from '../../lib/cn';\nimport type { Mode } from '../../theme/theme';\nimport { useTheme } from '../../theme/theme-provider';\n\nconst MODE_OPTIONS = [\n {\n icon: Sun,\n label: 'Light',\n value: 'light',\n },\n {\n icon: Moon,\n label: 'Dark',\n value: 'dark',\n },\n {\n icon: Monitor,\n label: 'System',\n value: 'system',\n },\n] satisfies {\n icon: typeof Sun;\n label: string;\n value: Mode;\n}[];\n\ntype ThemeSwitcherProps = Omit<ComponentProps<'div'>, 'defaultValue' | 'dir'>;\n\n/**\n * Lets a person pick light, dark or system mode; the choice writes through `useTheme`, so it applies app-wide and persists.\n */\nexport const ThemeSwitcher = ({ className, ...props }: ThemeSwitcherProps) => {\n const theme = useTheme();\n\n return (\n <ToggleGroupPrimitive.Root\n className={cn('inline-flex items-center gap-0.5 rounded-control border border-border bg-muted p-0.5', className)}\n data-slot=\"theme-switcher\"\n onValueChange={(value) => {\n if (value) theme.setTheme({ mode: value as Mode });\n }}\n type=\"single\"\n value={theme.mode}\n {...props}\n >\n {MODE_OPTIONS.map(({ icon: Icon, label, value }) => {\n return (\n <ToggleGroupPrimitive.Item\n className={cn(\n // base\n 'inline-flex size-control-xs items-center justify-center rounded-inner text-muted-foreground transition-colors focus-ring',\n // hover\n 'hover:text-foreground',\n // active\n 'data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-soft',\n )}\n key={value}\n title={label}\n value={value}\n >\n <Icon aria-hidden className=\"size-3.5\" />\n <span className=\"sr-only\">{label}</span>\n </ToggleGroupPrimitive.Item>\n );\n })}\n </ToggleGroupPrimitive.Root>\n );\n};\n"],"mappings":";;;;;;;AAUA,IAAM,eAAe;CACnB;EACE,MAAM;EACN,OAAO;EACP,OAAO;CACT;CACA;EACE,MAAM;EACN,OAAO;EACP,OAAO;CACT;CACA;EACE,MAAM;EACN,OAAO;EACP,OAAO;CACT;AACF;;;;AAWA,IAAa,iBAAiB,EAAE,WAAW,GAAG,YAAgC;CAC5E,MAAM,QAAQ,SAAS;CAEvB,OACE,oBAACA,YAAqB,MAAtB;EACE,WAAW,GAAG,wFAAwF,SAAS;EAC/G,aAAU;EACV,gBAAgB,UAAU;GACxB,IAAI,OAAO,MAAM,SAAS,EAAE,MAAM,MAAc,CAAC;EACnD;EACA,MAAK;EACL,OAAO,MAAM;EACb,GAAI;EAEH,UAAA,aAAa,KAAK,EAAE,MAAM,MAAM,OAAO,YAAY;GAClD,OACE,qBAACA,YAAqB,MAAtB;IACE,WAAW,GAET,4HAEA,yBAEA,2FACF;IAEA,OAAO;IACA;IAXT,UAAA,CAaE,oBAAC,MAAD;KAAM,eAAA;KAAY,WAAU;IAAY,CAAA,GACxC,oBAAC,QAAD;KAAM,WAAU;KAAW,UAAA;IAAY,CAAA,CACd;GANpB,GAAA,KAMoB;EAE/B,CAAC;CACwB,CAAA;AAE/B"}
@@ -0,0 +1,7 @@
1
+ import type { ComponentProps } from 'react';
2
+ import { Toaster as SonnerToaster } from 'sonner';
3
+ export { toast } from 'sonner';
4
+ /**
5
+ * Mounts the toast stack once per app, styled as Refine popover cards with status-coloured icons.
6
+ */
7
+ export declare const Toaster: ({ className, toastOptions, ...props }: ComponentProps<typeof SonnerToaster>) => import("react").JSX.Element;
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { cn } from "../../lib/cn.js";
3
+ import { Spinner } from "../spinner/spinner.js";
4
+ import { CircleAlert, CircleCheck, Info, TriangleAlert } from "lucide-react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { Toaster, toast } from "sonner";
7
+ // src/components/toaster/toaster.tsx
8
+ /**
9
+ * Mounts the toast stack once per app, styled as Refine popover cards with status-coloured icons.
10
+ */
11
+ var Toaster$1 = ({ className, toastOptions, ...props }) => {
12
+ return /* @__PURE__ */ jsx(Toaster, {
13
+ className: cn("toaster group", className),
14
+ gap: 10,
15
+ icons: {
16
+ error: /* @__PURE__ */ jsx(CircleAlert, { className: "size-4 text-danger-ink" }),
17
+ info: /* @__PURE__ */ jsx(Info, { className: "size-4 text-info-ink" }),
18
+ loading: /* @__PURE__ */ jsx(Spinner, { className: "text-gem-ink" }),
19
+ success: /* @__PURE__ */ jsx(CircleCheck, { className: "size-4 text-success-ink" }),
20
+ warning: /* @__PURE__ */ jsx(TriangleAlert, { className: "size-4 text-warning-ink" })
21
+ },
22
+ position: "bottom-right",
23
+ toastOptions: {
24
+ ...toastOptions,
25
+ classNames: {
26
+ actionButton: "ml-auto inline-flex h-control-xs shrink-0 items-center rounded-control bg-primary px-2.5 text-caption font-medium text-primary-foreground transition-colors hover:bg-primary/85 focus-ring",
27
+ cancelButton: "inline-flex h-control-xs shrink-0 items-center rounded-control bg-secondary px-2.5 text-caption font-medium text-secondary-foreground transition-colors hover:bg-pressed focus-ring",
28
+ closeButton: "absolute -top-2 -left-2 flex size-5 items-center justify-center rounded-full border bg-popover text-muted-foreground transition-colors hover:text-foreground focus-ring [&_svg]:size-3",
29
+ content: "flex min-w-0 flex-col gap-0.5",
30
+ description: "text-body-sm text-muted-foreground",
31
+ icon: "mt-0.5 flex size-4 shrink-0 items-center justify-center self-start",
32
+ title: "text-body-sm font-semibold text-foreground",
33
+ toast: "flex w-full items-center gap-3 rounded-card border bg-popover p-4 font-sans text-popover-foreground shadow-float sm:w-(--width)",
34
+ ...toastOptions?.classNames
35
+ },
36
+ unstyled: true
37
+ },
38
+ ...props
39
+ });
40
+ };
41
+ export { Toaster$1 as Toaster, toast };
42
+
43
+ //# sourceMappingURL=toaster.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toaster.js","names":["Toaster","SonnerToaster"],"sources":["../../../src/components/toaster/toaster.tsx"],"sourcesContent":["'use client';\n\nimport { CircleAlert, CircleCheck, Info, TriangleAlert } from 'lucide-react';\nimport type { ComponentProps } from 'react';\nimport { Toaster as SonnerToaster } from 'sonner';\n\nimport { cn } from '../../lib/cn';\nimport { Spinner } from '../spinner/spinner';\n\nexport { toast } from 'sonner';\n\n/**\n * Mounts the toast stack once per app, styled as Refine popover cards with status-coloured icons.\n */\nexport const Toaster = ({ className, toastOptions, ...props }: ComponentProps<typeof SonnerToaster>) => {\n return (\n <SonnerToaster\n className={cn('toaster group', className)}\n gap={10}\n icons={{\n error: <CircleAlert className=\"size-4 text-danger-ink\" />,\n info: <Info className=\"size-4 text-info-ink\" />,\n loading: <Spinner className=\"text-gem-ink\" />,\n success: <CircleCheck className=\"size-4 text-success-ink\" />,\n warning: <TriangleAlert className=\"size-4 text-warning-ink\" />,\n }}\n position=\"bottom-right\"\n toastOptions={{\n ...toastOptions,\n classNames: {\n actionButton:\n 'ml-auto inline-flex h-control-xs shrink-0 items-center rounded-control bg-primary px-2.5 text-caption font-medium text-primary-foreground transition-colors hover:bg-primary/85 focus-ring',\n cancelButton:\n 'inline-flex h-control-xs shrink-0 items-center rounded-control bg-secondary px-2.5 text-caption font-medium text-secondary-foreground transition-colors hover:bg-pressed focus-ring',\n closeButton:\n 'absolute -top-2 -left-2 flex size-5 items-center justify-center rounded-full border bg-popover text-muted-foreground transition-colors hover:text-foreground focus-ring [&_svg]:size-3',\n content: 'flex min-w-0 flex-col gap-0.5',\n description: 'text-body-sm text-muted-foreground',\n icon: 'mt-0.5 flex size-4 shrink-0 items-center justify-center self-start',\n title: 'text-body-sm font-semibold text-foreground',\n toast:\n 'flex w-full items-center gap-3 rounded-card border bg-popover p-4 font-sans text-popover-foreground shadow-float sm:w-(--width)',\n ...toastOptions?.classNames,\n },\n unstyled: true,\n }}\n {...props}\n />\n );\n};\n"],"mappings":";;;;;;;;;;AAcA,IAAaA,aAAW,EAAE,WAAW,cAAc,GAAG,YAAkD;CACtG,OACE,oBAACC,SAAD;EACE,WAAW,GAAG,iBAAiB,SAAS;EACxC,KAAK;EACL,OAAO;GACL,OAAO,oBAAC,aAAD,EAAa,WAAU,yBAA0B,CAAA;GACxD,MAAM,oBAAC,MAAD,EAAM,WAAU,uBAAwB,CAAA;GAC9C,SAAS,oBAAC,SAAD,EAAS,WAAU,eAAgB,CAAA;GAC5C,SAAS,oBAAC,aAAD,EAAa,WAAU,0BAA2B,CAAA;GAC3D,SAAS,oBAAC,eAAD,EAAe,WAAU,0BAA2B,CAAA;EAC/D;EACA,UAAS;EACT,cAAc;GACZ,GAAG;GACH,YAAY;IACV,cACE;IACF,cACE;IACF,aACE;IACF,SAAS;IACT,aAAa;IACb,MAAM;IACN,OAAO;IACP,OACE;IACF,GAAG,cAAc;GACnB;GACA,UAAU;EACZ;EACA,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,24 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import { Toggle as TogglePrimitive, ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';
3
+ import { type ComponentProps } from 'react';
4
+ export declare const toggleVariants: (props?: ({
5
+ variant?: "outline" | "ghost" | "segmented" | null | undefined;
6
+ size?: "sm" | "md" | "lg" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ type ToggleVariantProps = VariantProps<typeof toggleVariants>;
9
+ interface ToggleProps extends ComponentProps<typeof TogglePrimitive.Root>, ToggleVariantProps {
10
+ }
11
+ /**
12
+ * Renders a two-state button that stays pressed while on, such as "Billable only".
13
+ */
14
+ export declare const Toggle: ({ className, size, variant, ...props }: ToggleProps) => import("react").JSX.Element;
15
+ type ToggleGroupProps = ComponentProps<typeof ToggleGroupPrimitive.Root> & ToggleVariantProps;
16
+ /**
17
+ * Groups toggles; the default `segmented` variant sits the items in a muted track, as a view switcher.
18
+ */
19
+ export declare const ToggleGroup: ({ className, size, variant, ...props }: ToggleGroupProps) => import("react").JSX.Element;
20
+ /**
21
+ * Renders one option of a `ToggleGroup`, inheriting the group's size and variant.
22
+ */
23
+ export declare const ToggleGroupItem: ({ className, size, variant, ...props }: ComponentProps<typeof ToggleGroupPrimitive.Item> & ToggleVariantProps) => import("react").JSX.Element;
24
+ export {};
@@ -0,0 +1,84 @@
1
+ "use client";
2
+ import { cn } from "../../lib/cn.js";
3
+ import { Toggle, ToggleGroup } from "radix-ui";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { cva } from "class-variance-authority";
6
+ import { createContext, use } from "react";
7
+ // src/components/toggle-group/toggle-group.tsx
8
+ var toggleVariants = cva([
9
+ "inline-flex shrink-0 items-center justify-center gap-1.5 rounded-control font-medium whitespace-nowrap text-muted-foreground select-none",
10
+ "transition-[background-color,color,box-shadow] duration-150 ease-out-expo",
11
+ "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-[1.1em]",
12
+ "focus-ring",
13
+ "hover:bg-hover hover:text-foreground",
14
+ "active:scale-[0.98]",
15
+ "disabled:pointer-events-none disabled:opacity-45"
16
+ ], {
17
+ variants: {
18
+ variant: {
19
+ ghost: "data-[state=on]:bg-pressed data-[state=on]:text-foreground",
20
+ outline: "border border-input data-[state=on]:border-foreground/30 data-[state=on]:bg-pressed data-[state=on]:text-foreground",
21
+ segmented: "data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm data-[state=on]:hover:bg-background"
22
+ },
23
+ size: {
24
+ sm: "h-control-xs px-2 text-caption",
25
+ md: "h-control-sm px-3 text-body-sm",
26
+ lg: "h-control-md px-4 text-body-sm"
27
+ }
28
+ },
29
+ defaultVariants: {
30
+ variant: "ghost",
31
+ size: "md"
32
+ }
33
+ });
34
+ /**
35
+ * Renders a two-state button that stays pressed while on, such as "Billable only".
36
+ */
37
+ var Toggle$1 = ({ className, size, variant, ...props }) => {
38
+ return /* @__PURE__ */ jsx(Toggle.Root, {
39
+ className: cn(toggleVariants({
40
+ size,
41
+ variant
42
+ }), className),
43
+ "data-slot": "toggle",
44
+ ...props
45
+ });
46
+ };
47
+ var ToggleGroupContext = createContext({
48
+ size: "md",
49
+ variant: "segmented"
50
+ });
51
+ /**
52
+ * Groups toggles; the default `segmented` variant sits the items in a muted track, as a view switcher.
53
+ */
54
+ var ToggleGroup$1 = ({ className, size = "md", variant = "segmented", ...props }) => {
55
+ return /* @__PURE__ */ jsx(ToggleGroupContext, {
56
+ value: {
57
+ size,
58
+ variant
59
+ },
60
+ children: /* @__PURE__ */ jsx(ToggleGroup.Root, {
61
+ className: cn("inline-flex w-fit items-center gap-1", { "rounded-control bg-muted p-1": variant === "segmented" }, className),
62
+ "data-slot": "toggle-group",
63
+ "data-variant": variant,
64
+ ...props
65
+ })
66
+ });
67
+ };
68
+ /**
69
+ * Renders one option of a `ToggleGroup`, inheriting the group's size and variant.
70
+ */
71
+ var ToggleGroupItem = ({ className, size, variant, ...props }) => {
72
+ const group = use(ToggleGroupContext);
73
+ return /* @__PURE__ */ jsx(ToggleGroup.Item, {
74
+ className: cn(toggleVariants({
75
+ size: size ?? group.size,
76
+ variant: variant ?? group.variant
77
+ }), className),
78
+ "data-slot": "toggle-group-item",
79
+ ...props
80
+ });
81
+ };
82
+ export { Toggle$1 as Toggle, ToggleGroup$1 as ToggleGroup, ToggleGroupItem, toggleVariants };
83
+
84
+ //# sourceMappingURL=toggle-group.js.map