@codefast/ui 0.3.9 → 0.3.10

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 (245) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/accordion.cjs +97 -1
  3. package/dist/components/accordion.d.ts +4 -4
  4. package/dist/components/accordion.js +51 -1
  5. package/dist/components/alert-dialog.cjs +155 -1
  6. package/dist/components/alert-dialog.d.ts +11 -11
  7. package/dist/components/alert-dialog.js +94 -1
  8. package/dist/components/alert.cjs +84 -1
  9. package/dist/components/alert.d.ts +5 -5
  10. package/dist/components/alert.js +41 -1
  11. package/dist/components/aspect-ratio.cjs +43 -1
  12. package/dist/components/aspect-ratio.d.ts +2 -2
  13. package/dist/components/aspect-ratio.js +9 -1
  14. package/dist/components/avatar.cjs +65 -1
  15. package/dist/components/avatar.d.ts +2 -2
  16. package/dist/components/avatar.js +25 -1
  17. package/dist/components/badge.cjs +66 -1
  18. package/dist/components/badge.d.ts +3 -3
  19. package/dist/components/badge.js +29 -1
  20. package/dist/components/breadcrumb.cjs +126 -1
  21. package/dist/components/breadcrumb.d.ts +8 -8
  22. package/dist/components/breadcrumb.js +74 -1
  23. package/dist/components/button-group.cjs +86 -1
  24. package/dist/components/button-group.d.ts +5 -5
  25. package/dist/components/button-group.js +43 -1
  26. package/dist/components/button.cjs +92 -1
  27. package/dist/components/button.d.ts +6 -6
  28. package/dist/components/button.js +55 -1
  29. package/dist/components/calendar.cjs +150 -1
  30. package/dist/components/calendar.d.ts +12 -19
  31. package/dist/components/calendar.js +113 -1
  32. package/dist/components/card.cjs +105 -1
  33. package/dist/components/card.d.ts +8 -8
  34. package/dist/components/card.js +53 -1
  35. package/dist/components/carousel.cjs +210 -1
  36. package/dist/components/carousel.d.ts +10 -10
  37. package/dist/components/carousel.js +151 -1
  38. package/dist/components/chart.cjs +250 -3
  39. package/dist/components/chart.d.ts +9 -9
  40. package/dist/components/chart.js +198 -3
  41. package/dist/components/checkbox-cards.cjs +69 -1
  42. package/dist/components/checkbox-cards.d.ts +2 -2
  43. package/dist/components/checkbox-cards.js +32 -1
  44. package/dist/components/checkbox-group.cjs +63 -1
  45. package/dist/components/checkbox-group.d.ts +2 -2
  46. package/dist/components/checkbox-group.js +26 -1
  47. package/dist/components/checkbox.cjs +53 -1
  48. package/dist/components/checkbox.d.ts +2 -2
  49. package/dist/components/checkbox.js +19 -1
  50. package/dist/components/collapsible.cjs +61 -1
  51. package/dist/components/collapsible.d.ts +2 -2
  52. package/dist/components/collapsible.js +21 -1
  53. package/dist/components/command.cjs +167 -1
  54. package/dist/components/command.d.ts +4 -4
  55. package/dist/components/command.js +106 -1
  56. package/dist/components/context-menu.cjs +218 -1
  57. package/dist/components/context-menu.d.ts +4 -4
  58. package/dist/components/context-menu.js +142 -1
  59. package/dist/components/dialog.cjs +164 -1
  60. package/dist/components/dialog.d.ts +10 -10
  61. package/dist/components/dialog.js +106 -1
  62. package/dist/components/drawer.cjs +143 -1
  63. package/dist/components/drawer.d.ts +9 -9
  64. package/dist/components/drawer.js +85 -1
  65. package/dist/components/dropdown-menu.cjs +221 -1
  66. package/dist/components/dropdown-menu.d.ts +4 -4
  67. package/dist/components/dropdown-menu.js +145 -1
  68. package/dist/components/empty.cjs +113 -1
  69. package/dist/components/empty.d.ts +9 -9
  70. package/dist/components/empty.js +61 -1
  71. package/dist/components/field.cjs +193 -1
  72. package/dist/components/field.d.ts +14 -14
  73. package/dist/components/field.js +129 -1
  74. package/dist/components/form.cjs +151 -1
  75. package/dist/components/form.d.ts +10 -10
  76. package/dist/components/form.js +96 -1
  77. package/dist/components/hover-card.cjs +77 -1
  78. package/dist/components/hover-card.d.ts +2 -2
  79. package/dist/components/hover-card.js +34 -1
  80. package/dist/components/input-group.cjs +155 -1
  81. package/dist/components/input-group.d.ts +15 -15
  82. package/dist/components/input-group.js +97 -1
  83. package/dist/components/input-number.cjs +98 -1
  84. package/dist/components/input-number.d.ts +2 -2
  85. package/dist/components/input-number.js +64 -1
  86. package/dist/components/input-otp.cjs +101 -1
  87. package/dist/components/input-otp.d.ts +6 -6
  88. package/dist/components/input-otp.js +49 -1
  89. package/dist/components/input-password.cjs +71 -1
  90. package/dist/components/input-password.d.ts +3 -3
  91. package/dist/components/input-password.js +37 -1
  92. package/dist/components/input-search.cjs +80 -1
  93. package/dist/components/input-search.d.ts +3 -3
  94. package/dist/components/input-search.js +46 -1
  95. package/dist/components/input.cjs +45 -1
  96. package/dist/components/input.d.ts +2 -2
  97. package/dist/components/input.js +11 -1
  98. package/dist/components/item.cjs +186 -1
  99. package/dist/components/item.d.ts +12 -12
  100. package/dist/components/item.js +119 -1
  101. package/dist/components/kbd.cjs +54 -1
  102. package/dist/components/kbd.d.ts +3 -3
  103. package/dist/components/kbd.js +17 -1
  104. package/dist/components/label.cjs +45 -1
  105. package/dist/components/label.d.ts +2 -2
  106. package/dist/components/label.js +11 -1
  107. package/dist/components/menubar.cjs +232 -1
  108. package/dist/components/menubar.d.ts +4 -4
  109. package/dist/components/menubar.js +153 -1
  110. package/dist/components/native-select.cjs +75 -1
  111. package/dist/components/native-select.d.ts +4 -4
  112. package/dist/components/native-select.js +35 -1
  113. package/dist/components/navigation-menu.cjs +146 -2
  114. package/dist/components/navigation-menu.d.ts +2 -2
  115. package/dist/components/navigation-menu.js +94 -2
  116. package/dist/components/pagination.cjs +138 -1
  117. package/dist/components/pagination.d.ts +10 -10
  118. package/dist/components/pagination.js +86 -1
  119. package/dist/components/popover.cjs +86 -1
  120. package/dist/components/popover.d.ts +3 -3
  121. package/dist/components/popover.js +40 -1
  122. package/dist/components/progress-circle.cjs +184 -1
  123. package/dist/components/progress-circle.d.ts +5 -5
  124. package/dist/components/progress-circle.js +147 -1
  125. package/dist/components/progress.cjs +52 -1
  126. package/dist/components/progress.d.ts +2 -2
  127. package/dist/components/progress.js +18 -1
  128. package/dist/components/radio-cards.cjs +66 -1
  129. package/dist/components/radio-cards.d.ts +2 -2
  130. package/dist/components/radio-cards.js +29 -1
  131. package/dist/components/radio-group.cjs +59 -1
  132. package/dist/components/radio-group.d.ts +2 -2
  133. package/dist/components/radio-group.js +22 -1
  134. package/dist/components/radio.cjs +47 -1
  135. package/dist/components/radio.d.ts +2 -2
  136. package/dist/components/radio.js +13 -1
  137. package/dist/components/resizable.cjs +71 -1
  138. package/dist/components/resizable.d.ts +8 -8
  139. package/dist/components/resizable.js +31 -1
  140. package/dist/components/scroll-area.cjs +140 -1
  141. package/dist/components/scroll-area.d.ts +5 -5
  142. package/dist/components/scroll-area.js +100 -1
  143. package/dist/components/select.cjs +180 -1
  144. package/dist/components/select.d.ts +5 -5
  145. package/dist/components/select.js +119 -1
  146. package/dist/components/separator.cjs +82 -1
  147. package/dist/components/separator.d.ts +5 -5
  148. package/dist/components/separator.js +42 -1
  149. package/dist/components/sheet.cjs +184 -1
  150. package/dist/components/sheet.d.ts +9 -9
  151. package/dist/components/sheet.js +123 -1
  152. package/dist/components/sidebar.cjs +506 -1
  153. package/dist/components/sidebar.d.ts +31 -31
  154. package/dist/components/sidebar.js +400 -1
  155. package/dist/components/skeleton.cjs +44 -1
  156. package/dist/components/skeleton.d.ts +2 -2
  157. package/dist/components/skeleton.js +10 -1
  158. package/dist/components/slider.cjs +79 -1
  159. package/dist/components/slider.d.ts +2 -2
  160. package/dist/components/slider.js +45 -1
  161. package/dist/components/sonner.cjs +57 -1
  162. package/dist/components/sonner.d.ts +3 -3
  163. package/dist/components/sonner.js +17 -1
  164. package/dist/components/spinner.cjs +75 -1
  165. package/dist/components/spinner.d.ts +2 -2
  166. package/dist/components/spinner.js +41 -1
  167. package/dist/components/switch.cjs +49 -1
  168. package/dist/components/switch.d.ts +2 -2
  169. package/dist/components/switch.js +15 -1
  170. package/dist/components/table.cjs +118 -1
  171. package/dist/components/table.d.ts +9 -9
  172. package/dist/components/table.js +63 -1
  173. package/dist/components/tabs.cjs +75 -1
  174. package/dist/components/tabs.d.ts +3 -3
  175. package/dist/components/tabs.js +32 -1
  176. package/dist/components/textarea.cjs +44 -1
  177. package/dist/components/textarea.d.ts +2 -2
  178. package/dist/components/textarea.js +10 -1
  179. package/dist/components/toggle-group.cjs +90 -1
  180. package/dist/components/toggle-group.d.ts +10 -12
  181. package/dist/components/toggle-group.js +53 -1
  182. package/dist/components/toggle.cjs +71 -1
  183. package/dist/components/toggle.d.ts +10 -12
  184. package/dist/components/toggle.js +34 -1
  185. package/dist/components/tooltip.cjs +90 -1
  186. package/dist/components/tooltip.d.ts +3 -3
  187. package/dist/components/tooltip.js +44 -1
  188. package/dist/css/amber.css +95 -1
  189. package/dist/css/blue.css +95 -1
  190. package/dist/css/cyan.css +95 -1
  191. package/dist/css/emerald.css +95 -1
  192. package/dist/css/fuchsia.css +95 -1
  193. package/dist/css/gray.css +95 -1
  194. package/dist/css/green.css +95 -1
  195. package/dist/css/indigo.css +95 -1
  196. package/dist/css/lime.css +95 -1
  197. package/dist/css/neutral.css +95 -1
  198. package/dist/css/orange.css +95 -1
  199. package/dist/css/pink.css +95 -1
  200. package/dist/css/preset.css +118 -1
  201. package/dist/css/purple.css +95 -1
  202. package/dist/css/red.css +95 -1
  203. package/dist/css/rose.css +95 -1
  204. package/dist/css/sky.css +95 -1
  205. package/dist/css/slate.css +95 -1
  206. package/dist/css/stone.css +95 -1
  207. package/dist/css/style.css +3 -1
  208. package/dist/css/teal.css +95 -1
  209. package/dist/css/violet.css +95 -1
  210. package/dist/css/yellow.css +95 -1
  211. package/dist/css/zinc.css +95 -1
  212. package/dist/hooks/use-animated-value.cjs +74 -1
  213. package/dist/hooks/use-animated-value.d.ts +9 -10
  214. package/dist/hooks/use-animated-value.js +40 -1
  215. package/dist/hooks/use-copy-to-clipboard.cjs +57 -1
  216. package/dist/hooks/use-copy-to-clipboard.d.ts +18 -1
  217. package/dist/hooks/use-copy-to-clipboard.js +23 -1
  218. package/dist/hooks/use-is-mobile.cjs +39 -1
  219. package/dist/hooks/use-is-mobile.d.ts +15 -6
  220. package/dist/hooks/use-is-mobile.js +5 -1
  221. package/dist/hooks/use-media-query.cjs +56 -1
  222. package/dist/hooks/use-media-query.d.ts +11 -3
  223. package/dist/hooks/use-media-query.js +22 -1
  224. package/dist/hooks/use-mutation-observer.cjs +56 -1
  225. package/dist/hooks/use-mutation-observer.d.ts +8 -12
  226. package/dist/hooks/use-mutation-observer.js +22 -1
  227. package/dist/hooks/use-pagination.cjs +92 -1
  228. package/dist/hooks/use-pagination.d.ts +12 -10
  229. package/dist/hooks/use-pagination.js +55 -1
  230. package/dist/index.cjs +1081 -1
  231. package/dist/index.d.ts +130 -131
  232. package/dist/index.js +69 -1
  233. package/dist/primitives/checkbox-group.cjs +151 -1
  234. package/dist/primitives/checkbox-group.d.ts +11 -11
  235. package/dist/primitives/checkbox-group.js +99 -1
  236. package/dist/primitives/input-number.cjs +439 -1
  237. package/dist/primitives/input-number.d.ts +8 -8
  238. package/dist/primitives/input-number.js +381 -1
  239. package/dist/primitives/input.cjs +99 -1
  240. package/dist/primitives/input.d.ts +4 -4
  241. package/dist/primitives/input.js +53 -1
  242. package/dist/primitives/progress-circle.cjs +198 -1
  243. package/dist/primitives/progress-circle.d.ts +7 -7
  244. package/dist/primitives/progress-circle.js +128 -1
  245. package/package.json +385 -38
@@ -1 +1,113 @@
1
- "use strict";const __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,t)=>{for(var a in t)__webpack_require__.o(t,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{EmptyTitle:()=>EmptyTitle,emptyMediaVariants:()=>emptyMediaVariants,EmptyHeader:()=>EmptyHeader,Empty:()=>Empty,EmptyContent:()=>EmptyContent,EmptyDescription:()=>EmptyDescription,EmptyMedia:()=>EmptyMedia});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),tailwind_variants_namespaceObject=require("@codefast/tailwind-variants"),emptyMediaVariants=(0,tailwind_variants_namespaceObject.tv)({base:"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",defaultVariants:{variant:"default"},variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-xl [&_svg:not([class*='size-'])]:size-6"}}});function Empty({className:e,...t}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-xl border-dashed p-6 text-center text-balance md:p-12",e),"data-slot":"empty",...t})}function EmptyHeader({className:e,...t}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("flex max-w-sm flex-col items-center gap-2 text-center",e),"data-slot":"empty-header",...t})}function EmptyMedia({className:e,variant:t="default",...a}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:emptyMediaVariants({className:e,variant:t}),"data-slot":"empty-icon","data-variant":t,...a})}function EmptyTitle({className:e,...t}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("text-lg font-medium tracking-tight",e),"data-slot":"empty-title",...t})}function EmptyDescription({className:e,...t}){return(0,jsx_runtime_namespaceObject.jsx)("p",{className:(0,tailwind_variants_namespaceObject.cn)("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),"data-slot":"empty-description",...t})}function EmptyContent({className:e,...t}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",e),"data-slot":"empty-content",...t})}for(var __webpack_i__ in exports.Empty=__webpack_exports__.Empty,exports.EmptyContent=__webpack_exports__.EmptyContent,exports.EmptyDescription=__webpack_exports__.EmptyDescription,exports.EmptyHeader=__webpack_exports__.EmptyHeader,exports.EmptyMedia=__webpack_exports__.EmptyMedia,exports.EmptyTitle=__webpack_exports__.EmptyTitle,exports.emptyMediaVariants=__webpack_exports__.emptyMediaVariants,__webpack_exports__)-1===["Empty","EmptyContent","EmptyDescription","EmptyHeader","EmptyMedia","EmptyTitle","emptyMediaVariants"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ EmptyTitle: ()=>EmptyTitle,
28
+ emptyMediaVariants: ()=>emptyMediaVariants,
29
+ EmptyHeader: ()=>EmptyHeader,
30
+ Empty: ()=>Empty,
31
+ EmptyContent: ()=>EmptyContent,
32
+ EmptyDescription: ()=>EmptyDescription,
33
+ EmptyMedia: ()=>EmptyMedia
34
+ });
35
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
36
+ const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
37
+ const emptyMediaVariants = (0, tailwind_variants_namespaceObject.tv)({
38
+ base: 'mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
39
+ defaultVariants: {
40
+ variant: 'default'
41
+ },
42
+ variants: {
43
+ variant: {
44
+ default: 'bg-transparent',
45
+ icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-xl [&_svg:not([class*='size-'])]:size-6"
46
+ }
47
+ }
48
+ });
49
+ function Empty({ className, ...props }) {
50
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
51
+ className: (0, tailwind_variants_namespaceObject.cn)('flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-xl border-dashed p-6 text-center text-balance md:p-12', className),
52
+ "data-slot": "empty",
53
+ ...props
54
+ });
55
+ }
56
+ function EmptyHeader({ className, ...props }) {
57
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
58
+ className: (0, tailwind_variants_namespaceObject.cn)('flex max-w-sm flex-col items-center gap-2 text-center', className),
59
+ "data-slot": "empty-header",
60
+ ...props
61
+ });
62
+ }
63
+ function EmptyMedia({ className, variant = 'default', ...props }) {
64
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
65
+ className: emptyMediaVariants({
66
+ className,
67
+ variant
68
+ }),
69
+ "data-slot": "empty-icon",
70
+ "data-variant": variant,
71
+ ...props
72
+ });
73
+ }
74
+ function EmptyTitle({ className, ...props }) {
75
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
76
+ className: (0, tailwind_variants_namespaceObject.cn)('text-lg font-medium tracking-tight', className),
77
+ "data-slot": "empty-title",
78
+ ...props
79
+ });
80
+ }
81
+ function EmptyDescription({ className, ...props }) {
82
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
83
+ className: (0, tailwind_variants_namespaceObject.cn)('text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4', className),
84
+ "data-slot": "empty-description",
85
+ ...props
86
+ });
87
+ }
88
+ function EmptyContent({ className, ...props }) {
89
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
90
+ className: (0, tailwind_variants_namespaceObject.cn)('flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance', className),
91
+ "data-slot": "empty-content",
92
+ ...props
93
+ });
94
+ }
95
+ exports.Empty = __webpack_exports__.Empty;
96
+ exports.EmptyContent = __webpack_exports__.EmptyContent;
97
+ exports.EmptyDescription = __webpack_exports__.EmptyDescription;
98
+ exports.EmptyHeader = __webpack_exports__.EmptyHeader;
99
+ exports.EmptyMedia = __webpack_exports__.EmptyMedia;
100
+ exports.EmptyTitle = __webpack_exports__.EmptyTitle;
101
+ exports.emptyMediaVariants = __webpack_exports__.emptyMediaVariants;
102
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
103
+ "Empty",
104
+ "EmptyContent",
105
+ "EmptyDescription",
106
+ "EmptyHeader",
107
+ "EmptyMedia",
108
+ "EmptyTitle",
109
+ "emptyMediaVariants"
110
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
111
+ Object.defineProperty(exports, '__esModule', {
112
+ value: true
113
+ });
@@ -1,22 +1,22 @@
1
- import type { ComponentProps, JSX } from "react";
2
- import type { VariantProps } from "@codefast/tailwind-variants";
1
+ import type { VariantProps } from '@codefast/tailwind-variants';
2
+ import type { ComponentProps, JSX } from 'react';
3
3
  declare const emptyMediaVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
4
4
  variant: {
5
5
  default: string;
6
6
  icon: string;
7
7
  };
8
8
  }, Record<string, never>>;
9
- type EmptyProps = ComponentProps<"div">;
9
+ type EmptyProps = ComponentProps<'div'>;
10
10
  declare function Empty({ className, ...props }: EmptyProps): JSX.Element;
11
- type EmptyHeaderProps = ComponentProps<"div">;
11
+ type EmptyHeaderProps = ComponentProps<'div'>;
12
12
  declare function EmptyHeader({ className, ...props }: EmptyHeaderProps): JSX.Element;
13
- type EmptyMediaProps = ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>;
13
+ type EmptyMediaProps = ComponentProps<'div'> & VariantProps<typeof emptyMediaVariants>;
14
14
  declare function EmptyMedia({ className, variant, ...props }: EmptyMediaProps): JSX.Element;
15
- type EmptyTitleProps = ComponentProps<"div">;
15
+ type EmptyTitleProps = ComponentProps<'div'>;
16
16
  declare function EmptyTitle({ className, ...props }: EmptyTitleProps): JSX.Element;
17
- type EmptyDescriptionProps = ComponentProps<"p">;
17
+ type EmptyDescriptionProps = ComponentProps<'p'>;
18
18
  declare function EmptyDescription({ className, ...props }: EmptyDescriptionProps): JSX.Element;
19
- type EmptyContentProps = ComponentProps<"div">;
19
+ type EmptyContentProps = ComponentProps<'div'>;
20
20
  declare function EmptyContent({ className, ...props }: EmptyContentProps): JSX.Element;
21
- export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, emptyMediaVariants, EmptyTitle, };
21
+ export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, emptyMediaVariants, EmptyTitle };
22
22
  export type { EmptyContentProps, EmptyDescriptionProps, EmptyHeaderProps, EmptyMediaProps, EmptyProps, EmptyTitleProps, };
@@ -1 +1,61 @@
1
- import{jsx as t}from"react/jsx-runtime";import{cn as e,tv as a}from"@codefast/tailwind-variants";let n=a({base:"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",defaultVariants:{variant:"default"},variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-xl [&_svg:not([class*='size-'])]:size-6"}}});function r({className:a,...n}){return t("div",{className:e("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-xl border-dashed p-6 text-center text-balance md:p-12",a),"data-slot":"empty",...n})}function i({className:a,...n}){return t("div",{className:e("flex max-w-sm flex-col items-center gap-2 text-center",a),"data-slot":"empty-header",...n})}function s({className:e,variant:a="default",...r}){return t("div",{className:n({className:e,variant:a}),"data-slot":"empty-icon","data-variant":a,...r})}function m({className:a,...n}){return t("div",{className:e("text-lg font-medium tracking-tight",a),"data-slot":"empty-title",...n})}function l({className:a,...n}){return t("p",{className:e("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",a),"data-slot":"empty-description",...n})}function o({className:a,...n}){return t("div",{className:e("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",a),"data-slot":"empty-content",...n})}export{r as Empty,o as EmptyContent,l as EmptyDescription,i as EmptyHeader,s as EmptyMedia,m as EmptyTitle,n as emptyMediaVariants};
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn, tv } from "@codefast/tailwind-variants";
3
+ const emptyMediaVariants = tv({
4
+ base: 'mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0',
5
+ defaultVariants: {
6
+ variant: 'default'
7
+ },
8
+ variants: {
9
+ variant: {
10
+ default: 'bg-transparent',
11
+ icon: "bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-xl [&_svg:not([class*='size-'])]:size-6"
12
+ }
13
+ }
14
+ });
15
+ function Empty({ className, ...props }) {
16
+ return /*#__PURE__*/ jsx("div", {
17
+ className: cn('flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-xl border-dashed p-6 text-center text-balance md:p-12', className),
18
+ "data-slot": "empty",
19
+ ...props
20
+ });
21
+ }
22
+ function EmptyHeader({ className, ...props }) {
23
+ return /*#__PURE__*/ jsx("div", {
24
+ className: cn('flex max-w-sm flex-col items-center gap-2 text-center', className),
25
+ "data-slot": "empty-header",
26
+ ...props
27
+ });
28
+ }
29
+ function EmptyMedia({ className, variant = 'default', ...props }) {
30
+ return /*#__PURE__*/ jsx("div", {
31
+ className: emptyMediaVariants({
32
+ className,
33
+ variant
34
+ }),
35
+ "data-slot": "empty-icon",
36
+ "data-variant": variant,
37
+ ...props
38
+ });
39
+ }
40
+ function EmptyTitle({ className, ...props }) {
41
+ return /*#__PURE__*/ jsx("div", {
42
+ className: cn('text-lg font-medium tracking-tight', className),
43
+ "data-slot": "empty-title",
44
+ ...props
45
+ });
46
+ }
47
+ function EmptyDescription({ className, ...props }) {
48
+ return /*#__PURE__*/ jsx("p", {
49
+ className: cn('text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4', className),
50
+ "data-slot": "empty-description",
51
+ ...props
52
+ });
53
+ }
54
+ function EmptyContent({ className, ...props }) {
55
+ return /*#__PURE__*/ jsx("div", {
56
+ className: cn('flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance', className),
57
+ "data-slot": "empty-content",
58
+ ...props
59
+ });
60
+ }
61
+ export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, emptyMediaVariants };
@@ -1,2 +1,194 @@
1
+ "use strict";
1
2
  "use client";
2
- "use strict";const __rslib_import_meta_url__="undefined"==typeof document?new(require("url".replace("",""))).URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href;var __webpack_require__={};__webpack_require__.d=(e,a)=>{for(var t in a)__webpack_require__.o(a,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:a[t]})},__webpack_require__.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{FieldContent:()=>FieldContent,FieldError:()=>FieldError,FieldLabel:()=>FieldLabel,FieldDescription:()=>FieldDescription,FieldSeparator:()=>FieldSeparator,fieldVariants:()=>fieldVariants,FieldGroup:()=>FieldGroup,FieldTitle:()=>FieldTitle,FieldSet:()=>FieldSet,Field:()=>Field,FieldLegend:()=>FieldLegend});const jsx_runtime_namespaceObject=require("react/jsx-runtime"),external_react_namespaceObject=require("react"),external_label_cjs_namespaceObject=require("./label.cjs"),external_separator_cjs_namespaceObject=require("./separator.cjs"),tailwind_variants_namespaceObject=require("@codefast/tailwind-variants"),fieldVariants=(0,tailwind_variants_namespaceObject.tv)({base:"group/field flex w-full gap-3 data-[invalid=true]:text-destructive",defaultVariants:{orientation:"vertical"},variants:{orientation:{horizontal:(0,tailwind_variants_namespaceObject.cn)("flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"),responsive:(0,tailwind_variants_namespaceObject.cn)("flex-col [&>*]:w-full [&>.sr-only]:w-auto","@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"),vertical:"flex-col [&>*]:w-full [&>.sr-only]:w-auto"}}});function FieldSet({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)("fieldset",{className:(0,tailwind_variants_namespaceObject.cn)("flex flex-col gap-6","has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",e),"data-slot":"field-set",...a})}function FieldLegend({className:e,variant:a="legend",...t}){return(0,jsx_runtime_namespaceObject.jsx)("legend",{className:(0,tailwind_variants_namespaceObject.cn)("mb-3 text-base font-medium","data-[variant=label]:text-sm",e),"data-slot":"field-legend","data-variant":a,...t})}function FieldGroup({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",e),"data-slot":"field-group",...a})}function Field({className:e,orientation:a="vertical",...t}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:fieldVariants({className:e,orientation:a}),"data-orientation":a,"data-slot":"field",role:"group",...t})}function FieldContent({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("group/field-content flex flex-1 flex-col gap-1.5 leading-snug",e),"data-slot":"field-content",...a})}function FieldLabel({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)(external_label_cjs_namespaceObject.Label,{className:(0,tailwind_variants_namespaceObject.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10",e),"data-slot":"field-label",...a})}function FieldTitle({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",e),"data-slot":"field-label",...a})}function FieldDescription({className:e,...a}){return(0,jsx_runtime_namespaceObject.jsx)("p",{className:(0,tailwind_variants_namespaceObject.cn)("text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",e),"data-slot":"field-description",...a})}function FieldSeparator({children:e,className:a,...t}){let l=!!e;return(0,jsx_runtime_namespaceObject.jsxs)("div",{className:(0,tailwind_variants_namespaceObject.cn)("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",a),"data-content":l,"data-slot":"field-separator",...t,children:[(0,jsx_runtime_namespaceObject.jsx)(external_separator_cjs_namespaceObject.Separator,{className:"absolute inset-0 top-1/2"}),l?(0,jsx_runtime_namespaceObject.jsx)("span",{className:"bg-background text-muted-foreground relative mx-auto block w-fit px-2","data-slot":"field-separator-content",children:e}):null]})}function FieldError({children:e,className:a,errors:t,...l}){let r=(0,external_react_namespaceObject.useMemo)(()=>{if(!t?.length)return null;let e=[...new Map(t.map(e=>[e?.message,e])).values()];return 1===e.length?e[0]?.message??null:(0,jsx_runtime_namespaceObject.jsx)("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:e.map(e=>e?.message?(0,jsx_runtime_namespaceObject.jsx)("li",{children:e.message},e.message):null)})},[t]),i=e??r;return null==i||!1===i?null:(0,jsx_runtime_namespaceObject.jsx)("div",{className:(0,tailwind_variants_namespaceObject.cn)("text-destructive text-sm font-normal",a),"data-slot":"field-error",role:"alert",...l,children:i})}for(var __webpack_i__ in exports.Field=__webpack_exports__.Field,exports.FieldContent=__webpack_exports__.FieldContent,exports.FieldDescription=__webpack_exports__.FieldDescription,exports.FieldError=__webpack_exports__.FieldError,exports.FieldGroup=__webpack_exports__.FieldGroup,exports.FieldLabel=__webpack_exports__.FieldLabel,exports.FieldLegend=__webpack_exports__.FieldLegend,exports.FieldSeparator=__webpack_exports__.FieldSeparator,exports.FieldSet=__webpack_exports__.FieldSet,exports.FieldTitle=__webpack_exports__.FieldTitle,exports.fieldVariants=__webpack_exports__.fieldVariants,__webpack_exports__)-1===["Field","FieldContent","FieldDescription","FieldError","FieldGroup","FieldLabel","FieldLegend","FieldSeparator","FieldSet","FieldTitle","fieldVariants"].indexOf(__webpack_i__)&&(exports[__webpack_i__]=__webpack_exports__[__webpack_i__]);Object.defineProperty(exports,"__esModule",{value:!0});
3
+ var __webpack_require__ = {};
4
+ (()=>{
5
+ __webpack_require__.d = (exports1, definition)=>{
6
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
+ enumerable: true,
8
+ get: definition[key]
9
+ });
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.r = (exports1)=>{
17
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
18
+ value: 'Module'
19
+ });
20
+ Object.defineProperty(exports1, '__esModule', {
21
+ value: true
22
+ });
23
+ };
24
+ })();
25
+ var __webpack_exports__ = {};
26
+ __webpack_require__.r(__webpack_exports__);
27
+ __webpack_require__.d(__webpack_exports__, {
28
+ FieldContent: ()=>FieldContent,
29
+ FieldError: ()=>FieldError,
30
+ FieldLabel: ()=>FieldLabel,
31
+ FieldDescription: ()=>FieldDescription,
32
+ FieldSeparator: ()=>FieldSeparator,
33
+ fieldVariants: ()=>fieldVariants,
34
+ FieldGroup: ()=>FieldGroup,
35
+ FieldTitle: ()=>FieldTitle,
36
+ FieldSet: ()=>FieldSet,
37
+ Field: ()=>Field,
38
+ FieldLegend: ()=>FieldLegend
39
+ });
40
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
41
+ const tailwind_variants_namespaceObject = require("@codefast/tailwind-variants");
42
+ const external_react_namespaceObject = require("react");
43
+ const external_label_cjs_namespaceObject = require("./label.cjs");
44
+ const external_separator_cjs_namespaceObject = require("./separator.cjs");
45
+ const fieldVariants = (0, tailwind_variants_namespaceObject.tv)({
46
+ base: 'group/field flex w-full gap-3 data-[invalid=true]:text-destructive',
47
+ defaultVariants: {
48
+ orientation: 'vertical'
49
+ },
50
+ variants: {
51
+ orientation: {
52
+ horizontal: (0, tailwind_variants_namespaceObject.cn)('flex-row items-center', '[&>[data-slot=field-label]]:flex-auto', 'has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'),
53
+ responsive: (0, tailwind_variants_namespaceObject.cn)('flex-col [&>*]:w-full [&>.sr-only]:w-auto', '@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto', '@md/field-group:[&>[data-slot=field-label]]:flex-auto', '@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'),
54
+ vertical: 'flex-col [&>*]:w-full [&>.sr-only]:w-auto'
55
+ }
56
+ }
57
+ });
58
+ function FieldSet({ className, ...props }) {
59
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("fieldset", {
60
+ className: (0, tailwind_variants_namespaceObject.cn)('flex flex-col gap-6', 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3', className),
61
+ "data-slot": "field-set",
62
+ ...props
63
+ });
64
+ }
65
+ function FieldLegend({ className, variant = 'legend', ...props }) {
66
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("legend", {
67
+ className: (0, tailwind_variants_namespaceObject.cn)('mb-3 text-base font-medium', 'data-[variant=label]:text-sm', className),
68
+ "data-slot": "field-legend",
69
+ "data-variant": variant,
70
+ ...props
71
+ });
72
+ }
73
+ function FieldGroup({ className, ...props }) {
74
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
75
+ className: (0, tailwind_variants_namespaceObject.cn)('group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4', className),
76
+ "data-slot": "field-group",
77
+ ...props
78
+ });
79
+ }
80
+ function Field({ className, orientation = 'vertical', ...props }) {
81
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
82
+ className: fieldVariants({
83
+ className,
84
+ orientation
85
+ }),
86
+ "data-orientation": orientation,
87
+ "data-slot": "field",
88
+ role: "group",
89
+ ...props
90
+ });
91
+ }
92
+ function FieldContent({ className, ...props }) {
93
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
94
+ className: (0, tailwind_variants_namespaceObject.cn)('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className),
95
+ "data-slot": "field-content",
96
+ ...props
97
+ });
98
+ }
99
+ function FieldLabel({ className, ...props }) {
100
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_label_cjs_namespaceObject.Label, {
101
+ className: (0, tailwind_variants_namespaceObject.cn)('group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50', 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4', 'has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10', className),
102
+ "data-slot": "field-label",
103
+ ...props
104
+ });
105
+ }
106
+ function FieldTitle({ className, ...props }) {
107
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
108
+ className: (0, tailwind_variants_namespaceObject.cn)('flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50', className),
109
+ "data-slot": "field-label",
110
+ ...props
111
+ });
112
+ }
113
+ function FieldDescription({ className, ...props }) {
114
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("p", {
115
+ className: (0, tailwind_variants_namespaceObject.cn)('text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance', 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5', '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4', className),
116
+ "data-slot": "field-description",
117
+ ...props
118
+ });
119
+ }
120
+ function FieldSeparator({ children, className, ...props }) {
121
+ const hasContent = Boolean(children);
122
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
123
+ className: (0, tailwind_variants_namespaceObject.cn)('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className),
124
+ "data-content": hasContent,
125
+ "data-slot": "field-separator",
126
+ ...props,
127
+ children: [
128
+ /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_separator_cjs_namespaceObject.Separator, {
129
+ className: "absolute inset-0 top-1/2"
130
+ }),
131
+ hasContent ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
132
+ className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
133
+ "data-slot": "field-separator-content",
134
+ children: children
135
+ }) : null
136
+ ]
137
+ });
138
+ }
139
+ function FieldError({ children, className, errors, ...props }) {
140
+ const fallbackContent = (0, external_react_namespaceObject.useMemo)(()=>{
141
+ if (!errors?.length) return null;
142
+ const uniqueErrors = [
143
+ ...new Map(errors.map((error)=>[
144
+ error?.message,
145
+ error
146
+ ])).values()
147
+ ];
148
+ if (1 === uniqueErrors.length) return uniqueErrors[0]?.message ?? null;
149
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("ul", {
150
+ className: "ml-4 flex list-disc flex-col gap-1",
151
+ children: uniqueErrors.map((error)=>error?.message ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("li", {
152
+ children: error.message
153
+ }, error.message) : null)
154
+ });
155
+ }, [
156
+ errors
157
+ ]);
158
+ const content = children ?? fallbackContent;
159
+ if (null == content || false === content) return null;
160
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
161
+ className: (0, tailwind_variants_namespaceObject.cn)('text-destructive text-sm font-normal', className),
162
+ "data-slot": "field-error",
163
+ role: "alert",
164
+ ...props,
165
+ children: content
166
+ });
167
+ }
168
+ exports.Field = __webpack_exports__.Field;
169
+ exports.FieldContent = __webpack_exports__.FieldContent;
170
+ exports.FieldDescription = __webpack_exports__.FieldDescription;
171
+ exports.FieldError = __webpack_exports__.FieldError;
172
+ exports.FieldGroup = __webpack_exports__.FieldGroup;
173
+ exports.FieldLabel = __webpack_exports__.FieldLabel;
174
+ exports.FieldLegend = __webpack_exports__.FieldLegend;
175
+ exports.FieldSeparator = __webpack_exports__.FieldSeparator;
176
+ exports.FieldSet = __webpack_exports__.FieldSet;
177
+ exports.FieldTitle = __webpack_exports__.FieldTitle;
178
+ exports.fieldVariants = __webpack_exports__.fieldVariants;
179
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
180
+ "Field",
181
+ "FieldContent",
182
+ "FieldDescription",
183
+ "FieldError",
184
+ "FieldGroup",
185
+ "FieldLabel",
186
+ "FieldLegend",
187
+ "FieldSeparator",
188
+ "FieldSet",
189
+ "FieldTitle",
190
+ "fieldVariants"
191
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
192
+ Object.defineProperty(exports, '__esModule', {
193
+ value: true
194
+ });
@@ -1,6 +1,6 @@
1
- import type { ComponentProps, JSX } from "react";
2
- import type { VariantProps } from "@codefast/tailwind-variants";
3
- import { Label } from "./label";
1
+ import type { VariantProps } from '@codefast/tailwind-variants';
2
+ import type { ComponentProps, JSX } from 'react';
3
+ import { Label } from './label';
4
4
  declare const fieldVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
5
5
  orientation: {
6
6
  horizontal: string;
@@ -8,32 +8,32 @@ declare const fieldVariants: import("@codefast/tailwind-variants").VariantFuncti
8
8
  vertical: string;
9
9
  };
10
10
  }, Record<string, never>>;
11
- type FieldSetProps = ComponentProps<"fieldset">;
11
+ type FieldSetProps = ComponentProps<'fieldset'>;
12
12
  declare function FieldSet({ className, ...props }: FieldSetProps): JSX.Element;
13
- type FieldLegendProps = ComponentProps<"legend"> & {
14
- variant?: "label" | "legend";
13
+ type FieldLegendProps = ComponentProps<'legend'> & {
14
+ variant?: 'label' | 'legend';
15
15
  };
16
16
  declare function FieldLegend({ className, variant, ...props }: FieldLegendProps): JSX.Element;
17
- type FieldGroupProps = ComponentProps<"div">;
17
+ type FieldGroupProps = ComponentProps<'div'>;
18
18
  declare function FieldGroup({ className, ...props }: FieldGroupProps): JSX.Element;
19
- type FieldProps = ComponentProps<"div"> & VariantProps<typeof fieldVariants>;
19
+ type FieldProps = ComponentProps<'div'> & VariantProps<typeof fieldVariants>;
20
20
  declare function Field({ className, orientation, ...props }: FieldProps): JSX.Element;
21
- type FieldContentProps = ComponentProps<"div">;
21
+ type FieldContentProps = ComponentProps<'div'>;
22
22
  declare function FieldContent({ className, ...props }: FieldContentProps): JSX.Element;
23
23
  type FieldLabelProps = ComponentProps<typeof Label>;
24
24
  declare function FieldLabel({ className, ...props }: FieldLabelProps): JSX.Element;
25
- type FieldTitleProps = ComponentProps<"div">;
25
+ type FieldTitleProps = ComponentProps<'div'>;
26
26
  declare function FieldTitle({ className, ...props }: FieldTitleProps): JSX.Element;
27
- type FieldDescriptionProps = ComponentProps<"p">;
27
+ type FieldDescriptionProps = ComponentProps<'p'>;
28
28
  declare function FieldDescription({ className, ...props }: FieldDescriptionProps): JSX.Element;
29
- type FieldSeparatorProps = ComponentProps<"div"> & {
30
- children?: ComponentProps<"span">["children"];
29
+ type FieldSeparatorProps = ComponentProps<'div'> & {
30
+ children?: ComponentProps<'span'>['children'];
31
31
  };
32
32
  declare function FieldSeparator({ children, className, ...props }: FieldSeparatorProps): JSX.Element;
33
33
  interface FieldErrorMessage {
34
34
  message?: string;
35
35
  }
36
- interface FieldErrorProps extends ComponentProps<"div"> {
36
+ interface FieldErrorProps extends ComponentProps<'div'> {
37
37
  errors?: (FieldErrorMessage | undefined)[];
38
38
  }
39
39
  declare function FieldError({ children, className, errors, ...props }: FieldErrorProps): JSX.Element | null;
@@ -1,2 +1,130 @@
1
1
  "use client";
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useMemo as a}from"react";import{Label as l}from"./label.js";import{Separator as o}from"./separator.js";import{cn as r,tv as d}from"@codefast/tailwind-variants";let i=d({base:"group/field flex w-full gap-3 data-[invalid=true]:text-destructive",defaultVariants:{orientation:"vertical"},variants:{orientation:{horizontal:r("flex-row items-center","[&>[data-slot=field-label]]:flex-auto","has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"),responsive:r("flex-col [&>*]:w-full [&>.sr-only]:w-auto","@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto","@md/field-group:[&>[data-slot=field-label]]:flex-auto","@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"),vertical:"flex-col [&>*]:w-full [&>.sr-only]:w-auto"}}});function s({className:t,...a}){return e("fieldset",{className:r("flex flex-col gap-6","has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",t),"data-slot":"field-set",...a})}function n({className:t,variant:a="legend",...l}){return e("legend",{className:r("mb-3 text-base font-medium","data-[variant=label]:text-sm",t),"data-slot":"field-legend","data-variant":a,...l})}function f({className:t,...a}){return e("div",{className:r("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",t),"data-slot":"field-group",...a})}function u({className:t,orientation:a="vertical",...l}){return e("div",{className:i({className:t,orientation:a}),"data-orientation":a,"data-slot":"field",role:"group",...l})}function c({className:t,...a}){return e("div",{className:r("group/field-content flex flex-1 flex-col gap-1.5 leading-snug",t),"data-slot":"field-content",...a})}function m({className:t,...a}){return e(l,{className:r("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4","has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10",t),"data-slot":"field-label",...a})}function p({className:t,...a}){return e("div",{className:r("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",t),"data-slot":"field-label",...a})}function g({className:t,...a}){return e("p",{className:r("text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",t),"data-slot":"field-description",...a})}function x({children:a,className:l,...d}){let i=!!a;return t("div",{className:r("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",l),"data-content":i,"data-slot":"field-separator",...d,children:[e(o,{className:"absolute inset-0 top-1/2"}),i?e("span",{className:"bg-background text-muted-foreground relative mx-auto block w-fit px-2","data-slot":"field-separator-content",children:a}):null]})}function h({children:t,className:l,errors:o,...d}){let i=a(()=>{if(!o?.length)return null;let t=[...new Map(o.map(e=>[e?.message,e])).values()];return 1===t.length?t[0]?.message??null:e("ul",{className:"ml-4 flex list-disc flex-col gap-1",children:t.map(t=>t?.message?e("li",{children:t.message},t.message):null)})},[o]),s=t??i;return null==s||!1===s?null:e("div",{className:r("text-destructive text-sm font-normal",l),"data-slot":"field-error",role:"alert",...d,children:s})}export{u as Field,c as FieldContent,g as FieldDescription,h as FieldError,f as FieldGroup,m as FieldLabel,n as FieldLegend,x as FieldSeparator,s as FieldSet,p as FieldTitle,i as fieldVariants};
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { cn, tv } from "@codefast/tailwind-variants";
4
+ import { useMemo } from "react";
5
+ import { Label } from "./label.js";
6
+ import { Separator } from "./separator.js";
7
+ const fieldVariants = tv({
8
+ base: 'group/field flex w-full gap-3 data-[invalid=true]:text-destructive',
9
+ defaultVariants: {
10
+ orientation: 'vertical'
11
+ },
12
+ variants: {
13
+ orientation: {
14
+ horizontal: cn('flex-row items-center', '[&>[data-slot=field-label]]:flex-auto', 'has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'),
15
+ responsive: cn('flex-col [&>*]:w-full [&>.sr-only]:w-auto', '@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto', '@md/field-group:[&>[data-slot=field-label]]:flex-auto', '@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px'),
16
+ vertical: 'flex-col [&>*]:w-full [&>.sr-only]:w-auto'
17
+ }
18
+ }
19
+ });
20
+ function FieldSet({ className, ...props }) {
21
+ return /*#__PURE__*/ jsx("fieldset", {
22
+ className: cn('flex flex-col gap-6', 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3', className),
23
+ "data-slot": "field-set",
24
+ ...props
25
+ });
26
+ }
27
+ function FieldLegend({ className, variant = 'legend', ...props }) {
28
+ return /*#__PURE__*/ jsx("legend", {
29
+ className: cn('mb-3 text-base font-medium', 'data-[variant=label]:text-sm', className),
30
+ "data-slot": "field-legend",
31
+ "data-variant": variant,
32
+ ...props
33
+ });
34
+ }
35
+ function FieldGroup({ className, ...props }) {
36
+ return /*#__PURE__*/ jsx("div", {
37
+ className: cn('group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4', className),
38
+ "data-slot": "field-group",
39
+ ...props
40
+ });
41
+ }
42
+ function Field({ className, orientation = 'vertical', ...props }) {
43
+ return /*#__PURE__*/ jsx("div", {
44
+ className: fieldVariants({
45
+ className,
46
+ orientation
47
+ }),
48
+ "data-orientation": orientation,
49
+ "data-slot": "field",
50
+ role: "group",
51
+ ...props
52
+ });
53
+ }
54
+ function FieldContent({ className, ...props }) {
55
+ return /*#__PURE__*/ jsx("div", {
56
+ className: cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className),
57
+ "data-slot": "field-content",
58
+ ...props
59
+ });
60
+ }
61
+ function FieldLabel({ className, ...props }) {
62
+ return /*#__PURE__*/ jsx(Label, {
63
+ className: cn('group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50', 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4', 'has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10', className),
64
+ "data-slot": "field-label",
65
+ ...props
66
+ });
67
+ }
68
+ function FieldTitle({ className, ...props }) {
69
+ return /*#__PURE__*/ jsx("div", {
70
+ className: cn('flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50', className),
71
+ "data-slot": "field-label",
72
+ ...props
73
+ });
74
+ }
75
+ function FieldDescription({ className, ...props }) {
76
+ return /*#__PURE__*/ jsx("p", {
77
+ className: cn('text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance', 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5', '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4', className),
78
+ "data-slot": "field-description",
79
+ ...props
80
+ });
81
+ }
82
+ function FieldSeparator({ children, className, ...props }) {
83
+ const hasContent = Boolean(children);
84
+ return /*#__PURE__*/ jsxs("div", {
85
+ className: cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className),
86
+ "data-content": hasContent,
87
+ "data-slot": "field-separator",
88
+ ...props,
89
+ children: [
90
+ /*#__PURE__*/ jsx(Separator, {
91
+ className: "absolute inset-0 top-1/2"
92
+ }),
93
+ hasContent ? /*#__PURE__*/ jsx("span", {
94
+ className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
95
+ "data-slot": "field-separator-content",
96
+ children: children
97
+ }) : null
98
+ ]
99
+ });
100
+ }
101
+ function FieldError({ children, className, errors, ...props }) {
102
+ const fallbackContent = useMemo(()=>{
103
+ if (!errors?.length) return null;
104
+ const uniqueErrors = [
105
+ ...new Map(errors.map((error)=>[
106
+ error?.message,
107
+ error
108
+ ])).values()
109
+ ];
110
+ if (1 === uniqueErrors.length) return uniqueErrors[0]?.message ?? null;
111
+ return /*#__PURE__*/ jsx("ul", {
112
+ className: "ml-4 flex list-disc flex-col gap-1",
113
+ children: uniqueErrors.map((error)=>error?.message ? /*#__PURE__*/ jsx("li", {
114
+ children: error.message
115
+ }, error.message) : null)
116
+ });
117
+ }, [
118
+ errors
119
+ ]);
120
+ const content = children ?? fallbackContent;
121
+ if (null == content || false === content) return null;
122
+ return /*#__PURE__*/ jsx("div", {
123
+ className: cn('text-destructive text-sm font-normal', className),
124
+ "data-slot": "field-error",
125
+ role: "alert",
126
+ ...props,
127
+ children: content
128
+ });
129
+ }
130
+ export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, fieldVariants };