@mesob/ui 0.0.2

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 (194) hide show
  1. package/dist/components/accordion.d.ts +10 -0
  2. package/dist/components/accordion.js +74 -0
  3. package/dist/components/accordion.js.map +1 -0
  4. package/dist/components/alert-dialog.d.ts +17 -0
  5. package/dist/components/alert-dialog.js +187 -0
  6. package/dist/components/alert-dialog.js.map +1 -0
  7. package/dist/components/alert.d.ts +13 -0
  8. package/dist/components/alert.js +74 -0
  9. package/dist/components/alert.js.map +1 -0
  10. package/dist/components/animated-tabs.d.ts +26 -0
  11. package/dist/components/animated-tabs.js +290 -0
  12. package/dist/components/animated-tabs.js.map +1 -0
  13. package/dist/components/aspect-ratio.d.ts +6 -0
  14. package/dist/components/aspect-ratio.js +14 -0
  15. package/dist/components/aspect-ratio.js.map +1 -0
  16. package/dist/components/avatar.d.ts +9 -0
  17. package/dist/components/avatar.js +63 -0
  18. package/dist/components/avatar.js.map +1 -0
  19. package/dist/components/badge.d.ts +13 -0
  20. package/dist/components/badge.js +48 -0
  21. package/dist/components/badge.js.map +1 -0
  22. package/dist/components/breadcrumb.d.ts +14 -0
  23. package/dist/components/breadcrumb.js +110 -0
  24. package/dist/components/breadcrumb.js.map +1 -0
  25. package/dist/components/button-group.d.ts +17 -0
  26. package/dist/components/button-group.js +106 -0
  27. package/dist/components/button-group.js.map +1 -0
  28. package/dist/components/button.d.ts +14 -0
  29. package/dist/components/button.js +60 -0
  30. package/dist/components/button.js.map +1 -0
  31. package/dist/components/calendar.d.ts +13 -0
  32. package/dist/components/calendar.js +254 -0
  33. package/dist/components/calendar.js.map +1 -0
  34. package/dist/components/card.d.ts +12 -0
  35. package/dist/components/card.js +98 -0
  36. package/dist/components/card.js.map +1 -0
  37. package/dist/components/carousel.d.ts +24 -0
  38. package/dist/components/carousel.js +260 -0
  39. package/dist/components/carousel.js.map +1 -0
  40. package/dist/components/chart.d.ts +43 -0
  41. package/dist/components/chart.js +261 -0
  42. package/dist/components/chart.js.map +1 -0
  43. package/dist/components/checkbox.d.ts +7 -0
  44. package/dist/components/checkbox.js +41 -0
  45. package/dist/components/checkbox.js.map +1 -0
  46. package/dist/components/collapsible.d.ts +8 -0
  47. package/dist/components/collapsible.js +38 -0
  48. package/dist/components/collapsible.js.map +1 -0
  49. package/dist/components/command.d.ts +22 -0
  50. package/dist/components/command.js +281 -0
  51. package/dist/components/command.js.map +1 -0
  52. package/dist/components/context-menu.d.ts +28 -0
  53. package/dist/components/context-menu.js +233 -0
  54. package/dist/components/context-menu.js.map +1 -0
  55. package/dist/components/data-table/index.d.ts +46 -0
  56. package/dist/components/data-table/index.js +639 -0
  57. package/dist/components/data-table/index.js.map +1 -0
  58. package/dist/components/dialog.d.ts +18 -0
  59. package/dist/components/dialog.js +146 -0
  60. package/dist/components/dialog.js.map +1 -0
  61. package/dist/components/drawer.d.ts +16 -0
  62. package/dist/components/drawer.js +138 -0
  63. package/dist/components/drawer.js.map +1 -0
  64. package/dist/components/dropdown-menu.d.ts +28 -0
  65. package/dist/components/dropdown-menu.js +241 -0
  66. package/dist/components/dropdown-menu.js.map +1 -0
  67. package/dist/components/empty.d.ts +15 -0
  68. package/dist/components/empty.js +110 -0
  69. package/dist/components/empty.js.map +1 -0
  70. package/dist/components/entity/index.d.ts +160 -0
  71. package/dist/components/entity/index.js +1671 -0
  72. package/dist/components/entity/index.js.map +1 -0
  73. package/dist/components/field.d.ts +30 -0
  74. package/dist/components/field.js +279 -0
  75. package/dist/components/field.js.map +1 -0
  76. package/dist/components/form.d.ts +28 -0
  77. package/dist/components/form.js +150 -0
  78. package/dist/components/form.js.map +1 -0
  79. package/dist/components/hover-card.d.ts +9 -0
  80. package/dist/components/hover-card.js +48 -0
  81. package/dist/components/hover-card.js.map +1 -0
  82. package/dist/components/input-group.d.ts +20 -0
  83. package/dist/components/input-group.js +257 -0
  84. package/dist/components/input-group.js.map +1 -0
  85. package/dist/components/input-otp.d.ts +14 -0
  86. package/dist/components/input-otp.js +76 -0
  87. package/dist/components/input-otp.js.map +1 -0
  88. package/dist/components/input.d.ts +6 -0
  89. package/dist/components/input.js +29 -0
  90. package/dist/components/input.js.map +1 -0
  91. package/dist/components/item.d.ts +28 -0
  92. package/dist/components/item.js +220 -0
  93. package/dist/components/item.js.map +1 -0
  94. package/dist/components/jiret-logo.d.ts +13 -0
  95. package/dist/components/jiret-logo.js +80 -0
  96. package/dist/components/jiret-logo.js.map +1 -0
  97. package/dist/components/kbd.d.ts +6 -0
  98. package/dist/components/kbd.js +39 -0
  99. package/dist/components/kbd.js.map +1 -0
  100. package/dist/components/label.d.ts +7 -0
  101. package/dist/components/label.js +32 -0
  102. package/dist/components/label.js.map +1 -0
  103. package/dist/components/menubar.d.ts +29 -0
  104. package/dist/components/menubar.js +261 -0
  105. package/dist/components/menubar.js.map +1 -0
  106. package/dist/components/navigation-menu.d.ts +18 -0
  107. package/dist/components/navigation-menu.js +178 -0
  108. package/dist/components/navigation-menu.js.map +1 -0
  109. package/dist/components/pagination.d.ts +18 -0
  110. package/dist/components/pagination.js +160 -0
  111. package/dist/components/pagination.js.map +1 -0
  112. package/dist/components/popover.d.ts +10 -0
  113. package/dist/components/popover.js +54 -0
  114. package/dist/components/popover.js.map +1 -0
  115. package/dist/components/powered-by.d.ts +5 -0
  116. package/dist/components/powered-by.js +98 -0
  117. package/dist/components/powered-by.js.map +1 -0
  118. package/dist/components/progress.d.ts +7 -0
  119. package/dist/components/progress.js +41 -0
  120. package/dist/components/progress.js.map +1 -0
  121. package/dist/components/radio-group.d.ts +8 -0
  122. package/dist/components/radio-group.js +55 -0
  123. package/dist/components/radio-group.js.map +1 -0
  124. package/dist/components/resizable.d.ts +11 -0
  125. package/dist/components/resizable.js +58 -0
  126. package/dist/components/resizable.js.map +1 -0
  127. package/dist/components/scroll-area.d.ts +8 -0
  128. package/dist/components/scroll-area.js +70 -0
  129. package/dist/components/scroll-area.js.map +1 -0
  130. package/dist/components/section/index.d.ts +14 -0
  131. package/dist/components/section/index.js +139 -0
  132. package/dist/components/section/index.js.map +1 -0
  133. package/dist/components/select.d.ts +18 -0
  134. package/dist/components/select.js +181 -0
  135. package/dist/components/select.js.map +1 -0
  136. package/dist/components/separator.d.ts +7 -0
  137. package/dist/components/separator.js +36 -0
  138. package/dist/components/separator.js.map +1 -0
  139. package/dist/components/sheet.d.ts +16 -0
  140. package/dist/components/sheet.js +136 -0
  141. package/dist/components/sheet.js.map +1 -0
  142. package/dist/components/sidebar.d.ts +75 -0
  143. package/dist/components/sidebar.js +909 -0
  144. package/dist/components/sidebar.js.map +1 -0
  145. package/dist/components/skeleton.d.ts +5 -0
  146. package/dist/components/skeleton.js +23 -0
  147. package/dist/components/skeleton.js.map +1 -0
  148. package/dist/components/slider.d.ts +7 -0
  149. package/dist/components/slider.js +76 -0
  150. package/dist/components/slider.js.map +1 -0
  151. package/dist/components/sonner.d.ts +6 -0
  152. package/dist/components/sonner.js +41 -0
  153. package/dist/components/sonner.js.map +1 -0
  154. package/dist/components/spinner.d.ts +6 -0
  155. package/dist/components/spinner.js +28 -0
  156. package/dist/components/spinner.js.map +1 -0
  157. package/dist/components/spotlight-search.d.ts +25 -0
  158. package/dist/components/spotlight-search.js +387 -0
  159. package/dist/components/spotlight-search.js.map +1 -0
  160. package/dist/components/switch.d.ts +7 -0
  161. package/dist/components/switch.js +41 -0
  162. package/dist/components/switch.js.map +1 -0
  163. package/dist/components/table.d.ts +13 -0
  164. package/dist/components/table.js +124 -0
  165. package/dist/components/table.js.map +1 -0
  166. package/dist/components/tabs.d.ts +10 -0
  167. package/dist/components/tabs.js +77 -0
  168. package/dist/components/tabs.js.map +1 -0
  169. package/dist/components/textarea.d.ts +6 -0
  170. package/dist/components/textarea.js +26 -0
  171. package/dist/components/textarea.js.map +1 -0
  172. package/dist/components/theme-toggle.d.ts +8 -0
  173. package/dist/components/theme-toggle.js +86 -0
  174. package/dist/components/theme-toggle.js.map +1 -0
  175. package/dist/components/toggle-group.d.ts +14 -0
  176. package/dist/components/toggle-group.js +102 -0
  177. package/dist/components/toggle-group.js.map +1 -0
  178. package/dist/components/toggle.d.ts +13 -0
  179. package/dist/components/toggle.js +53 -0
  180. package/dist/components/toggle.js.map +1 -0
  181. package/dist/components/tooltip.d.ts +10 -0
  182. package/dist/components/tooltip.js +65 -0
  183. package/dist/components/tooltip.js.map +1 -0
  184. package/dist/hooks/use-mobile.d.ts +3 -0
  185. package/dist/hooks/use-mobile.js +22 -0
  186. package/dist/hooks/use-mobile.js.map +1 -0
  187. package/dist/index.d.ts +2 -0
  188. package/dist/index.js +10 -0
  189. package/dist/index.js.map +1 -0
  190. package/dist/lib/utils.d.ts +5 -0
  191. package/dist/lib/utils.js +10 -0
  192. package/dist/lib/utils.js.map +1 -0
  193. package/package.json +123 -0
  194. package/src/styles/globals.css +125 -0
@@ -0,0 +1,17 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import { Separator } from './separator.js';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import '@radix-ui/react-separator';
6
+ import 'react';
7
+
8
+ declare const buttonGroupVariants: (props?: ({
9
+ orientation?: "horizontal" | "vertical" | null | undefined;
10
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
11
+ declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<'fieldset'> & VariantProps<typeof buttonGroupVariants>): react_jsx_runtime.JSX.Element;
12
+ declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<'div'> & {
13
+ asChild?: boolean;
14
+ }): react_jsx_runtime.JSX.Element;
15
+ declare function ButtonGroupSeparator({ className, orientation, ...props }: React.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
16
+
17
+ export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
@@ -0,0 +1,106 @@
1
+ // src/lib/utils.ts
2
+ import { clsx } from "clsx";
3
+ import { twMerge } from "tailwind-merge";
4
+ function cn(...inputs) {
5
+ return twMerge(clsx(inputs));
6
+ }
7
+
8
+ // src/components/separator.tsx
9
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
10
+ import { jsx } from "react/jsx-runtime";
11
+ function Separator({
12
+ className,
13
+ orientation = "horizontal",
14
+ decorative = true,
15
+ ...props
16
+ }) {
17
+ return /* @__PURE__ */ jsx(
18
+ SeparatorPrimitive.Root,
19
+ {
20
+ "data-slot": "separator",
21
+ decorative,
22
+ orientation,
23
+ className: cn(
24
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
25
+ className
26
+ ),
27
+ ...props
28
+ }
29
+ );
30
+ }
31
+
32
+ // src/components/button-group.tsx
33
+ import { Slot } from "@radix-ui/react-slot";
34
+ import { cva } from "class-variance-authority";
35
+ import { jsx as jsx2 } from "react/jsx-runtime";
36
+ var buttonGroupVariants = cva(
37
+ "flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
38
+ {
39
+ variants: {
40
+ orientation: {
41
+ horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
42
+ vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
43
+ }
44
+ },
45
+ defaultVariants: {
46
+ orientation: "horizontal"
47
+ }
48
+ }
49
+ );
50
+ function ButtonGroup({
51
+ className,
52
+ orientation,
53
+ ...props
54
+ }) {
55
+ return /* @__PURE__ */ jsx2(
56
+ "fieldset",
57
+ {
58
+ "data-slot": "button-group",
59
+ "data-orientation": orientation,
60
+ className: cn(buttonGroupVariants({ orientation }), className),
61
+ ...props
62
+ }
63
+ );
64
+ }
65
+ function ButtonGroupText({
66
+ className,
67
+ asChild = false,
68
+ ...props
69
+ }) {
70
+ const Comp = asChild ? Slot : "div";
71
+ return /* @__PURE__ */ jsx2(
72
+ Comp,
73
+ {
74
+ className: cn(
75
+ "bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
76
+ className
77
+ ),
78
+ ...props
79
+ }
80
+ );
81
+ }
82
+ function ButtonGroupSeparator({
83
+ className,
84
+ orientation = "vertical",
85
+ ...props
86
+ }) {
87
+ return /* @__PURE__ */ jsx2(
88
+ Separator,
89
+ {
90
+ "data-slot": "button-group-separator",
91
+ orientation,
92
+ className: cn(
93
+ "bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
94
+ className
95
+ ),
96
+ ...props
97
+ }
98
+ );
99
+ }
100
+ export {
101
+ ButtonGroup,
102
+ ButtonGroupSeparator,
103
+ ButtonGroupText,
104
+ buttonGroupVariants
105
+ };
106
+ //# sourceMappingURL=button-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/components/separator.tsx","../../src/components/button-group.tsx"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport { cn } from '@mesob/ui/lib/utils';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport type * as React from 'react';\n\nfunction Separator({\n className,\n orientation = 'horizontal',\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Separator };\n","import { Separator } from '@mesob/ui/components/separator';\nimport { cn } from '@mesob/ui/lib/utils';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nconst buttonGroupVariants = cva(\n \"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2\",\n {\n variants: {\n orientation: {\n horizontal:\n '[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none',\n vertical:\n 'flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n },\n);\n\nfunction ButtonGroup({\n className,\n orientation,\n ...props\n}: React.ComponentProps<'fieldset'> &\n VariantProps<typeof buttonGroupVariants>) {\n return (\n <fieldset\n data-slot=\"button-group\"\n data-orientation={orientation}\n className={cn(buttonGroupVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction ButtonGroupText({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<'div'> & {\n asChild?: boolean;\n}) {\n const Comp = asChild ? Slot : 'div';\n\n return (\n <Comp\n className={cn(\n \"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ButtonGroupSeparator({\n className,\n orientation = 'vertical',\n ...props\n}: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"button-group-separator\"\n orientation={orientation}\n className={cn(\n 'bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n ButtonGroup,\n ButtonGroupSeparator,\n ButtonGroupText,\n buttonGroupVariants,\n};\n"],"mappings":";AAAA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACFA,YAAY,wBAAwB;AAUhC;AAPJ,SAAS,UAAU;AAAA,EACjB;AAAA,EACA,cAAc;AAAA,EACd,aAAa;AAAA,EACb,GAAG;AACL,GAAyD;AACvD,SACE;AAAA,IAAoB;AAAA,IAAnB;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;;;ACtBA,SAAS,YAAY;AACrB,SAAS,WAA8B;AA0BnC,gBAAAA,YAAA;AAxBJ,IAAM,sBAAsB;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,aAAa;AAAA,QACX,YACE;AAAA,QACF,UACE;AAAA,MACJ;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,aAAa;AAAA,IACf;AAAA,EACF;AACF;AAEA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAC4C;AAC1C,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,oBAAkB;AAAA,MAClB,WAAW,GAAG,oBAAoB,EAAE,YAAY,CAAC,GAAG,SAAS;AAAA,MAC5D,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,gBAAgB;AAAA,EACvB;AAAA,EACA,UAAU;AAAA,EACV,GAAG;AACL,GAEG;AACD,QAAM,OAAO,UAAU,OAAO;AAE9B,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,qBAAqB;AAAA,EAC5B;AAAA,EACA,cAAc;AAAA,EACd,GAAG;AACL,GAA2C;AACzC,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["jsx"]}
@@ -0,0 +1,14 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import * as React from 'react';
5
+
6
+ declare const buttonVariants: (props?: ({
7
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
8
+ size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
11
+ asChild?: boolean;
12
+ }): react_jsx_runtime.JSX.Element;
13
+
14
+ export { Button, buttonVariants };
@@ -0,0 +1,60 @@
1
+ // src/lib/utils.ts
2
+ import { clsx } from "clsx";
3
+ import { twMerge } from "tailwind-merge";
4
+ function cn(...inputs) {
5
+ return twMerge(clsx(inputs));
6
+ }
7
+
8
+ // src/components/button.tsx
9
+ import { Slot } from "@radix-ui/react-slot";
10
+ import { cva } from "class-variance-authority";
11
+ import { jsx } from "react/jsx-runtime";
12
+ var buttonVariants = cva(
13
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
14
+ {
15
+ variants: {
16
+ variant: {
17
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
18
+ destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
19
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
20
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
21
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
22
+ link: "text-primary underline-offset-4 hover:underline"
23
+ },
24
+ size: {
25
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
26
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
27
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
28
+ icon: "size-9",
29
+ "icon-sm": "size-8",
30
+ "icon-lg": "size-10"
31
+ }
32
+ },
33
+ defaultVariants: {
34
+ variant: "default",
35
+ size: "default"
36
+ }
37
+ }
38
+ );
39
+ function Button({
40
+ className,
41
+ variant,
42
+ size,
43
+ asChild = false,
44
+ ...props
45
+ }) {
46
+ const Comp = asChild ? Slot : "button";
47
+ return /* @__PURE__ */ jsx(
48
+ Comp,
49
+ {
50
+ "data-slot": "button",
51
+ className: cn(buttonVariants({ variant, size, className })),
52
+ ...props
53
+ }
54
+ );
55
+ }
56
+ export {
57
+ Button,
58
+ buttonVariants
59
+ };
60
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/components/button.tsx"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { cn } from '@mesob/ui/lib/utils';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type * as React from 'react';\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90',\n destructive:\n 'bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',\n outline:\n 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n ghost:\n 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9',\n 'icon-sm': 'size-8',\n 'icon-lg': 'size-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n"],"mappings":";AAAA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACJA,SAAS,YAAY;AACrB,SAAS,WAA8B;AAgDnC;AA7CJ,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,WAAW;AAAA,QACX,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,SAAS,OAAO;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,GAAG;AACL,GAGK;AACH,QAAM,OAAO,UAAU,OAAO;AAE9B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
@@ -0,0 +1,13 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { Button } from './button.js';
3
+ import * as React from 'react';
4
+ import { DayPicker, DayButton } from 'react-day-picker';
5
+ import 'class-variance-authority/types';
6
+ import 'class-variance-authority';
7
+
8
+ declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
9
+ buttonVariant?: React.ComponentProps<typeof Button>['variant'];
10
+ }): react_jsx_runtime.JSX.Element;
11
+ declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): react_jsx_runtime.JSX.Element;
12
+
13
+ export { Calendar, CalendarDayButton };
@@ -0,0 +1,254 @@
1
+ "use client";
2
+
3
+ // src/lib/utils.ts
4
+ import { clsx } from "clsx";
5
+ import { twMerge } from "tailwind-merge";
6
+ function cn(...inputs) {
7
+ return twMerge(clsx(inputs));
8
+ }
9
+
10
+ // src/components/button.tsx
11
+ import { Slot } from "@radix-ui/react-slot";
12
+ import { cva } from "class-variance-authority";
13
+ import { jsx } from "react/jsx-runtime";
14
+ var buttonVariants = cva(
15
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
16
+ {
17
+ variants: {
18
+ variant: {
19
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
20
+ destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
21
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
22
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
23
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
24
+ link: "text-primary underline-offset-4 hover:underline"
25
+ },
26
+ size: {
27
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
28
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
29
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
30
+ icon: "size-9",
31
+ "icon-sm": "size-8",
32
+ "icon-lg": "size-10"
33
+ }
34
+ },
35
+ defaultVariants: {
36
+ variant: "default",
37
+ size: "default"
38
+ }
39
+ }
40
+ );
41
+ function Button({
42
+ className,
43
+ variant,
44
+ size,
45
+ asChild = false,
46
+ ...props
47
+ }) {
48
+ const Comp = asChild ? Slot : "button";
49
+ return /* @__PURE__ */ jsx(
50
+ Comp,
51
+ {
52
+ "data-slot": "button",
53
+ className: cn(buttonVariants({ variant, size, className })),
54
+ ...props
55
+ }
56
+ );
57
+ }
58
+
59
+ // src/components/calendar.tsx
60
+ import {
61
+ IconChevronDown,
62
+ IconChevronLeft,
63
+ IconChevronRight
64
+ } from "@tabler/icons-react";
65
+ import * as React from "react";
66
+ import {
67
+ DayPicker,
68
+ getDefaultClassNames
69
+ } from "react-day-picker";
70
+ import { jsx as jsx2 } from "react/jsx-runtime";
71
+ function Calendar({
72
+ className,
73
+ classNames,
74
+ showOutsideDays = true,
75
+ captionLayout = "label",
76
+ buttonVariant = "ghost",
77
+ formatters,
78
+ components,
79
+ ...props
80
+ }) {
81
+ const defaultClassNames = getDefaultClassNames();
82
+ return /* @__PURE__ */ jsx2(
83
+ DayPicker,
84
+ {
85
+ showOutsideDays,
86
+ className: cn(
87
+ "bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
88
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
89
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
90
+ className
91
+ ),
92
+ captionLayout,
93
+ formatters: {
94
+ formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
95
+ ...formatters
96
+ },
97
+ classNames: {
98
+ root: cn("w-fit", defaultClassNames.root),
99
+ months: cn(
100
+ "flex gap-4 flex-col md:flex-row relative",
101
+ defaultClassNames.months
102
+ ),
103
+ month: cn("flex flex-col w-full gap-4", defaultClassNames.month),
104
+ nav: cn(
105
+ "flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",
106
+ defaultClassNames.nav
107
+ ),
108
+ button_previous: cn(
109
+ buttonVariants({ variant: buttonVariant }),
110
+ "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
111
+ defaultClassNames.button_previous
112
+ ),
113
+ button_next: cn(
114
+ buttonVariants({ variant: buttonVariant }),
115
+ "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
116
+ defaultClassNames.button_next
117
+ ),
118
+ month_caption: cn(
119
+ "flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",
120
+ defaultClassNames.month_caption
121
+ ),
122
+ dropdowns: cn(
123
+ "w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",
124
+ defaultClassNames.dropdowns
125
+ ),
126
+ dropdown_root: cn(
127
+ "relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",
128
+ defaultClassNames.dropdown_root
129
+ ),
130
+ dropdown: cn(
131
+ "absolute bg-popover inset-0 opacity-0",
132
+ defaultClassNames.dropdown
133
+ ),
134
+ caption_label: cn(
135
+ "select-none font-medium",
136
+ captionLayout === "label" ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",
137
+ defaultClassNames.caption_label
138
+ ),
139
+ table: "w-full border-collapse",
140
+ weekdays: cn("flex", defaultClassNames.weekdays),
141
+ weekday: cn(
142
+ "text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",
143
+ defaultClassNames.weekday
144
+ ),
145
+ week: cn("flex w-full mt-2", defaultClassNames.week),
146
+ week_number_header: cn(
147
+ "select-none w-(--cell-size)",
148
+ defaultClassNames.week_number_header
149
+ ),
150
+ week_number: cn(
151
+ "text-[0.8rem] select-none text-muted-foreground",
152
+ defaultClassNames.week_number
153
+ ),
154
+ day: cn(
155
+ "relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",
156
+ props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md",
157
+ defaultClassNames.day
158
+ ),
159
+ range_start: cn(
160
+ "rounded-l-md bg-accent",
161
+ defaultClassNames.range_start
162
+ ),
163
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
164
+ range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
165
+ today: cn(
166
+ "bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",
167
+ defaultClassNames.today
168
+ ),
169
+ outside: cn(
170
+ "text-muted-foreground aria-selected:text-muted-foreground",
171
+ defaultClassNames.outside
172
+ ),
173
+ disabled: cn(
174
+ "text-muted-foreground opacity-50",
175
+ defaultClassNames.disabled
176
+ ),
177
+ hidden: cn("invisible", defaultClassNames.hidden),
178
+ ...classNames
179
+ },
180
+ components: {
181
+ Root: ({ className: className2, rootRef, ...props2 }) => {
182
+ return /* @__PURE__ */ jsx2(
183
+ "div",
184
+ {
185
+ "data-slot": "calendar",
186
+ ref: rootRef,
187
+ className: cn(className2),
188
+ ...props2
189
+ }
190
+ );
191
+ },
192
+ Chevron: ({ className: className2, orientation, ...props2 }) => {
193
+ if (orientation === "left") {
194
+ return /* @__PURE__ */ jsx2(IconChevronLeft, { className: cn("size-4", className2), ...props2 });
195
+ }
196
+ if (orientation === "right") {
197
+ return /* @__PURE__ */ jsx2(
198
+ IconChevronRight,
199
+ {
200
+ className: cn("size-4", className2),
201
+ ...props2
202
+ }
203
+ );
204
+ }
205
+ return /* @__PURE__ */ jsx2(IconChevronDown, { className: cn("size-4", className2), ...props2 });
206
+ },
207
+ DayButton: CalendarDayButton,
208
+ WeekNumber: ({ children, ...props2 }) => {
209
+ return /* @__PURE__ */ jsx2("td", { ...props2, children: /* @__PURE__ */ jsx2("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
210
+ },
211
+ ...components
212
+ },
213
+ ...props
214
+ }
215
+ );
216
+ }
217
+ function CalendarDayButton({
218
+ className,
219
+ day,
220
+ modifiers,
221
+ ...props
222
+ }) {
223
+ const defaultClassNames = getDefaultClassNames();
224
+ const ref = React.useRef(null);
225
+ React.useEffect(() => {
226
+ if (modifiers.focused) {
227
+ ref.current?.focus();
228
+ }
229
+ }, [modifiers.focused]);
230
+ return /* @__PURE__ */ jsx2(
231
+ Button,
232
+ {
233
+ ref,
234
+ variant: "ghost",
235
+ size: "icon",
236
+ "data-day": day.date.toLocaleDateString(),
237
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
238
+ "data-range-start": modifiers.range_start,
239
+ "data-range-end": modifiers.range_end,
240
+ "data-range-middle": modifiers.range_middle,
241
+ className: cn(
242
+ "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
243
+ defaultClassNames.day,
244
+ className
245
+ ),
246
+ ...props
247
+ }
248
+ );
249
+ }
250
+ export {
251
+ Calendar,
252
+ CalendarDayButton
253
+ };
254
+ //# sourceMappingURL=calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/components/button.tsx","../../src/components/calendar.tsx"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { cn } from '@mesob/ui/lib/utils';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type * as React from 'react';\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90',\n destructive:\n 'bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',\n outline:\n 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n ghost:\n 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'h-9 px-4 py-2 has-[>svg]:px-3',\n sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',\n lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',\n icon: 'size-9',\n 'icon-sm': 'size-8',\n 'icon-lg': 'size-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot : 'button';\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n","'use client';\n\nimport { Button, buttonVariants } from '@mesob/ui/components/button';\nimport { cn } from '@mesob/ui/lib/utils';\nimport {\n IconChevronDown,\n IconChevronLeft,\n IconChevronRight,\n} from '@tabler/icons-react';\nimport * as React from 'react';\nimport {\n type DayButton,\n DayPicker,\n getDefaultClassNames,\n} from 'react-day-picker';\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>['variant'];\n}) {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n 'bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString('default', { month: 'short' }),\n ...formatters,\n }}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn(\n 'flex gap-4 flex-col md:flex-row relative',\n defaultClassNames.months,\n ),\n month: cn('flex flex-col w-full gap-4', defaultClassNames.month),\n nav: cn(\n 'flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between',\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none',\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) aria-disabled:opacity-50 p-0 select-none',\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n 'flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)',\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n 'w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5',\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n 'relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md',\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn(\n 'absolute bg-popover inset-0 opacity-0',\n defaultClassNames.dropdown,\n ),\n caption_label: cn(\n 'select-none font-medium',\n captionLayout === 'label'\n ? 'text-sm'\n : 'rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5',\n defaultClassNames.caption_label,\n ),\n table: 'w-full border-collapse',\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none',\n defaultClassNames.weekday,\n ),\n week: cn('flex w-full mt-2', defaultClassNames.week),\n week_number_header: cn(\n 'select-none w-(--cell-size)',\n defaultClassNames.week_number_header,\n ),\n week_number: cn(\n 'text-[0.8rem] select-none text-muted-foreground',\n defaultClassNames.week_number,\n ),\n day: cn(\n 'relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none',\n props.showWeekNumber\n ? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-md'\n : '[&:first-child[data-selected=true]_button]:rounded-l-md',\n defaultClassNames.day,\n ),\n range_start: cn(\n 'rounded-l-md bg-accent',\n defaultClassNames.range_start,\n ),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn('rounded-r-md bg-accent', defaultClassNames.range_end),\n today: cn(\n 'bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none',\n defaultClassNames.today,\n ),\n outside: cn(\n 'text-muted-foreground aria-selected:text-muted-foreground',\n defaultClassNames.outside,\n ),\n disabled: cn(\n 'text-muted-foreground opacity-50',\n defaultClassNames.disabled,\n ),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n );\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === 'left') {\n return (\n <IconChevronLeft className={cn('size-4', className)} {...props} />\n );\n }\n\n if (orientation === 'right') {\n return (\n <IconChevronRight\n className={cn('size-4', className)}\n {...props}\n />\n );\n }\n\n return (\n <IconChevronDown className={cn('size-4', className)} {...props} />\n );\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n {...props}\n />\n );\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) {\n ref.current?.focus();\n }\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n 'data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70',\n defaultClassNames.day,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, CalendarDayButton };\n"],"mappings":";;;AAAA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,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EACZ,UACH,GACF;AAAA,QAEJ;AAAA,QACA,GAAG;AAAA,MACL;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAA2C;AACzC,QAAM,oBAAoB,qBAAqB;AAE/C,QAAM,MAAY,aAA0B,IAAI;AAChD,EAAM,gBAAU,MAAM;AACpB,QAAI,UAAU,SAAS;AACrB,UAAI,SAAS,MAAM;AAAA,IACrB;AAAA,EACF,GAAG,CAAC,UAAU,OAAO,CAAC;AAEtB,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,YAAU,IAAI,KAAK,mBAAmB;AAAA,MACtC,wBACE,UAAU,YACV,CAAC,UAAU,eACX,CAAC,UAAU,aACX,CAAC,UAAU;AAAA,MAEb,oBAAkB,UAAU;AAAA,MAC5B,kBAAgB,UAAU;AAAA,MAC1B,qBAAmB,UAAU;AAAA,MAC7B,WAAW;AAAA,QACT;AAAA,QACA,kBAAkB;AAAA,QAClB;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":["jsx","className","props"]}
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ declare function Card({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
5
+ declare function CardHeader({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
6
+ declare function CardTitle({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
7
+ declare function CardDescription({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
8
+ declare function CardAction({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
9
+ declare function CardContent({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
10
+ declare function CardFooter({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
11
+
12
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
@@ -0,0 +1,98 @@
1
+ // src/lib/utils.ts
2
+ import { clsx } from "clsx";
3
+ import { twMerge } from "tailwind-merge";
4
+ function cn(...inputs) {
5
+ return twMerge(clsx(inputs));
6
+ }
7
+
8
+ // src/components/card.tsx
9
+ import { jsx } from "react/jsx-runtime";
10
+ function Card({ className, ...props }) {
11
+ return /* @__PURE__ */ jsx(
12
+ "div",
13
+ {
14
+ "data-slot": "card",
15
+ className: cn(
16
+ "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 ",
17
+ className
18
+ ),
19
+ ...props
20
+ }
21
+ );
22
+ }
23
+ function CardHeader({ className, ...props }) {
24
+ return /* @__PURE__ */ jsx(
25
+ "div",
26
+ {
27
+ "data-slot": "card-header",
28
+ className: cn(
29
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
30
+ className
31
+ ),
32
+ ...props
33
+ }
34
+ );
35
+ }
36
+ function CardTitle({ className, ...props }) {
37
+ return /* @__PURE__ */ jsx(
38
+ "div",
39
+ {
40
+ "data-slot": "card-title",
41
+ className: cn("leading-none font-semibold", className),
42
+ ...props
43
+ }
44
+ );
45
+ }
46
+ function CardDescription({ className, ...props }) {
47
+ return /* @__PURE__ */ jsx(
48
+ "div",
49
+ {
50
+ "data-slot": "card-description",
51
+ className: cn("text-muted-foreground text-sm", className),
52
+ ...props
53
+ }
54
+ );
55
+ }
56
+ function CardAction({ className, ...props }) {
57
+ return /* @__PURE__ */ jsx(
58
+ "div",
59
+ {
60
+ "data-slot": "card-action",
61
+ className: cn(
62
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
63
+ className
64
+ ),
65
+ ...props
66
+ }
67
+ );
68
+ }
69
+ function CardContent({ className, ...props }) {
70
+ return /* @__PURE__ */ jsx(
71
+ "div",
72
+ {
73
+ "data-slot": "card-content",
74
+ className: cn("px-6", className),
75
+ ...props
76
+ }
77
+ );
78
+ }
79
+ function CardFooter({ className, ...props }) {
80
+ return /* @__PURE__ */ jsx(
81
+ "div",
82
+ {
83
+ "data-slot": "card-footer",
84
+ className: cn("flex items-center px-6 [.border-t]:pt-6", className),
85
+ ...props
86
+ }
87
+ );
88
+ }
89
+ export {
90
+ Card,
91
+ CardAction,
92
+ CardContent,
93
+ CardDescription,
94
+ CardFooter,
95
+ CardHeader,
96
+ CardTitle
97
+ };
98
+ //# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/components/card.tsx"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { cn } from '@mesob/ui/lib/utils';\nimport type * as React from 'react';\n\nfunction Card({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n 'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 ',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\n 'col-start-2 row-span-2 row-start-1 self-start justify-self-end',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn('px-6', className)}\n {...props}\n />\n );\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('flex items-center px-6 [.border-t]:pt-6', className)}\n {...props}\n />\n );\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n};\n"],"mappings":";AAAA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACAI;AAFJ,SAAS,KAAK,EAAE,WAAW,GAAG,MAAM,GAAgC;AAClE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,MAAM,GAAgC;AACxE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,UAAU,EAAE,WAAW,GAAG,MAAM,GAAgC;AACvE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,8BAA8B,SAAS;AAAA,MACpD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,gBAAgB,EAAE,WAAW,GAAG,MAAM,GAAgC;AAC7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SA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