@codefast/ui 0.0.6 → 0.0.8

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 (150) hide show
  1. package/dist/alert-dialog.js +3 -3
  2. package/dist/alert-dialog.mjs +1 -1
  3. package/dist/badge.js +4 -4
  4. package/dist/badge.js.map +1 -1
  5. package/dist/badge.mjs +4 -4
  6. package/dist/badge.mjs.map +1 -1
  7. package/dist/blockquote.d.mts +7 -0
  8. package/dist/blockquote.d.ts +7 -0
  9. package/dist/blockquote.js +13 -0
  10. package/dist/blockquote.js.map +1 -0
  11. package/dist/blockquote.mjs +13 -0
  12. package/dist/blockquote.mjs.map +1 -0
  13. package/dist/box.d.mts +14 -0
  14. package/dist/box.d.ts +14 -0
  15. package/dist/box.js +15 -0
  16. package/dist/box.js.map +1 -0
  17. package/dist/box.mjs +15 -0
  18. package/dist/box.mjs.map +1 -0
  19. package/dist/button.d.mts +1 -1
  20. package/dist/button.d.ts +1 -1
  21. package/dist/button.js +2 -2
  22. package/dist/button.mjs +1 -1
  23. package/dist/calendar.js +3 -3
  24. package/dist/calendar.mjs +1 -1
  25. package/dist/carousel.js +3 -3
  26. package/dist/carousel.mjs +1 -1
  27. package/dist/chunk-2D7SRYKN.js +135 -0
  28. package/dist/chunk-2D7SRYKN.js.map +1 -0
  29. package/dist/chunk-EDVCMWDT.mjs +158 -0
  30. package/dist/chunk-EDVCMWDT.mjs.map +1 -0
  31. package/dist/chunk-ESWGFN3R.mjs +135 -0
  32. package/dist/chunk-ESWGFN3R.mjs.map +1 -0
  33. package/dist/{chunk-Z524G4RY.mjs → chunk-KW5FJ62U.mjs} +6 -2
  34. package/dist/chunk-KW5FJ62U.mjs.map +1 -0
  35. package/dist/chunk-OCLLX7EY.js +158 -0
  36. package/dist/chunk-OCLLX7EY.js.map +1 -0
  37. package/dist/{chunk-4K26QLS2.js → chunk-U2WDUCW3.js} +6 -2
  38. package/dist/chunk-U2WDUCW3.js.map +1 -0
  39. package/dist/code.d.mts +7 -0
  40. package/dist/code.d.ts +7 -0
  41. package/dist/code.js +13 -0
  42. package/dist/code.js.map +1 -0
  43. package/dist/code.mjs +13 -0
  44. package/dist/code.mjs.map +1 -0
  45. package/dist/container.d.mts +7 -0
  46. package/dist/container.d.ts +7 -0
  47. package/dist/container.js +17 -0
  48. package/dist/container.js.map +1 -0
  49. package/dist/container.mjs +17 -0
  50. package/dist/container.mjs.map +1 -0
  51. package/dist/data-table.d.mts +16 -0
  52. package/dist/data-table.d.ts +16 -0
  53. package/dist/data-table.js +255 -0
  54. package/dist/data-table.js.map +1 -0
  55. package/dist/data-table.mjs +255 -0
  56. package/dist/data-table.mjs.map +1 -0
  57. package/dist/dropdown-menu.js +34 -157
  58. package/dist/dropdown-menu.js.map +1 -1
  59. package/dist/dropdown-menu.mjs +16 -139
  60. package/dist/dropdown-menu.mjs.map +1 -1
  61. package/dist/em.d.mts +7 -0
  62. package/dist/em.d.ts +7 -0
  63. package/dist/em.js +13 -0
  64. package/dist/em.js.map +1 -0
  65. package/dist/em.mjs +13 -0
  66. package/dist/em.mjs.map +1 -0
  67. package/dist/heading.d.mts +8 -0
  68. package/dist/heading.d.ts +8 -0
  69. package/dist/heading.js +13 -0
  70. package/dist/heading.js.map +1 -0
  71. package/dist/heading.mjs +13 -0
  72. package/dist/heading.mjs.map +1 -0
  73. package/dist/input-otp.d.mts +2 -2
  74. package/dist/input-otp.d.ts +2 -2
  75. package/dist/input.d.mts +58 -1
  76. package/dist/input.d.ts +58 -1
  77. package/dist/input.js +17 -6
  78. package/dist/input.js.map +1 -1
  79. package/dist/input.mjs +18 -7
  80. package/dist/input.mjs.map +1 -1
  81. package/dist/kbd.d.mts +7 -0
  82. package/dist/kbd.d.ts +7 -0
  83. package/dist/kbd.js +27 -0
  84. package/dist/kbd.js.map +1 -0
  85. package/dist/kbd.mjs +27 -0
  86. package/dist/kbd.mjs.map +1 -0
  87. package/dist/pagination.js +2 -2
  88. package/dist/pagination.mjs +1 -1
  89. package/dist/pre.d.mts +7 -0
  90. package/dist/pre.d.ts +7 -0
  91. package/dist/pre.js +13 -0
  92. package/dist/pre.js.map +1 -0
  93. package/dist/pre.mjs +13 -0
  94. package/dist/pre.mjs.map +1 -0
  95. package/dist/quote.d.mts +7 -0
  96. package/dist/quote.d.ts +7 -0
  97. package/dist/quote.js +13 -0
  98. package/dist/quote.js.map +1 -0
  99. package/dist/quote.mjs +13 -0
  100. package/dist/quote.mjs.map +1 -0
  101. package/dist/section.d.mts +7 -0
  102. package/dist/section.d.ts +7 -0
  103. package/dist/section.js +13 -0
  104. package/dist/section.js.map +1 -0
  105. package/dist/section.mjs +13 -0
  106. package/dist/section.mjs.map +1 -0
  107. package/dist/select.js +26 -134
  108. package/dist/select.js.map +1 -1
  109. package/dist/select.mjs +12 -120
  110. package/dist/select.mjs.map +1 -1
  111. package/dist/sheet.d.mts +1 -1
  112. package/dist/sheet.d.ts +1 -1
  113. package/dist/strong.d.mts +7 -0
  114. package/dist/strong.d.ts +7 -0
  115. package/dist/strong.js +13 -0
  116. package/dist/strong.js.map +1 -0
  117. package/dist/strong.mjs +13 -0
  118. package/dist/strong.mjs.map +1 -0
  119. package/dist/styles.css +1 -1
  120. package/dist/styles.css.map +1 -1
  121. package/dist/table.js +2 -5
  122. package/dist/table.js.map +1 -1
  123. package/dist/table.mjs +2 -5
  124. package/dist/table.mjs.map +1 -1
  125. package/dist/text.d.mts +14 -0
  126. package/dist/text.d.ts +14 -0
  127. package/dist/text.js +15 -0
  128. package/dist/text.js.map +1 -0
  129. package/dist/text.mjs +15 -0
  130. package/dist/text.mjs.map +1 -0
  131. package/package.json +69 -3
  132. package/src/badge.tsx +4 -6
  133. package/src/blockquote.tsx +24 -0
  134. package/src/box.tsx +33 -0
  135. package/src/button.tsx +4 -0
  136. package/src/code.tsx +22 -0
  137. package/src/container.tsx +25 -0
  138. package/src/data-table.tsx +255 -0
  139. package/src/em.tsx +22 -0
  140. package/src/heading.tsx +25 -0
  141. package/src/input.tsx +26 -8
  142. package/src/kbd.tsx +32 -0
  143. package/src/pre.tsx +22 -0
  144. package/src/quote.tsx +22 -0
  145. package/src/section.tsx +24 -0
  146. package/src/strong.tsx +22 -0
  147. package/src/table.tsx +2 -5
  148. package/src/text.tsx +34 -0
  149. package/dist/chunk-4K26QLS2.js.map +0 -1
  150. package/dist/chunk-Z524G4RY.mjs.map +0 -1
@@ -0,0 +1,255 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import type * as ReactTable from "@tanstack/react-table";
5
+ import {
6
+ ArrowDownIcon,
7
+ ArrowUpIcon,
8
+ CaretSortIcon,
9
+ ChevronLeftIcon,
10
+ ChevronRightIcon,
11
+ DoubleArrowLeftIcon,
12
+ DoubleArrowRightIcon,
13
+ EyeNoneIcon,
14
+ MixerHorizontalIcon,
15
+ } from "@radix-ui/react-icons";
16
+ import {
17
+ DropdownMenu,
18
+ DropdownMenuCheckboxItem,
19
+ DropdownMenuContent,
20
+ DropdownMenuItem,
21
+ DropdownMenuLabel,
22
+ DropdownMenuSeparator,
23
+ DropdownMenuTrigger,
24
+ } from "./dropdown-menu";
25
+ import { Button } from "./button";
26
+ import {
27
+ Select,
28
+ SelectContent,
29
+ SelectItem,
30
+ SelectTrigger,
31
+ SelectValue,
32
+ } from "./select";
33
+ import { cn } from "./utils";
34
+
35
+ /* -----------------------------------------------------------------------------
36
+ * Component: DataTableViewOptions
37
+ * -------------------------------------------------------------------------- */
38
+
39
+ function DataTableViewOptions<TData>({
40
+ table,
41
+ }: {
42
+ table: ReactTable.Table<TData>;
43
+ }): React.JSX.Element {
44
+ return (
45
+ <DropdownMenu>
46
+ <DropdownMenuTrigger asChild>
47
+ <Button
48
+ variant="outline"
49
+ size="sm"
50
+ className="ml-auto hidden h-8 lg:flex"
51
+ >
52
+ <MixerHorizontalIcon className="mr-2 size-4" />
53
+ View
54
+ </Button>
55
+ </DropdownMenuTrigger>
56
+ <DropdownMenuContent align="end" className="w-[150px]">
57
+ <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>
58
+ <DropdownMenuSeparator />
59
+ {table
60
+ .getAllColumns()
61
+ .filter(
62
+ (column) =>
63
+ typeof column.accessorFn !== "undefined" && column.getCanHide(),
64
+ )
65
+ .map((column) => {
66
+ return (
67
+ <DropdownMenuCheckboxItem
68
+ key={column.id}
69
+ className="capitalize"
70
+ checked={column.getIsVisible()}
71
+ onCheckedChange={(value) => {
72
+ column.toggleVisibility(Boolean(value));
73
+ }}
74
+ >
75
+ {column.id}
76
+ </DropdownMenuCheckboxItem>
77
+ );
78
+ })}
79
+ </DropdownMenuContent>
80
+ </DropdownMenu>
81
+ );
82
+ }
83
+
84
+ /* -----------------------------------------------------------------------------
85
+ * Component: DataTablePagination
86
+ * -------------------------------------------------------------------------- */
87
+
88
+ function DataTablePagination<TData>({
89
+ table,
90
+ className,
91
+ ...props
92
+ }: React.HTMLAttributes<HTMLDivElement> & {
93
+ table: ReactTable.Table<TData>;
94
+ }): React.JSX.Element {
95
+ return (
96
+ <div
97
+ className={cn("flex items-center justify-between px-2", className)}
98
+ {...props}
99
+ >
100
+ <div className="text-muted-foreground flex-1 text-sm">
101
+ {table.getFilteredSelectedRowModel().rows.length} of{" "}
102
+ {table.getFilteredRowModel().rows.length} row(s) selected.
103
+ </div>
104
+ <div className="flex items-center space-x-6 lg:space-x-8">
105
+ <div className="flex items-center space-x-2">
106
+ <p className="text-sm font-medium">Rows per page</p>
107
+ <Select
108
+ value={`${table.getState().pagination.pageSize}`}
109
+ onValueChange={(value) => {
110
+ table.setPageSize(Number(value));
111
+ }}
112
+ >
113
+ <SelectTrigger className="h-8 w-[70px]">
114
+ <SelectValue placeholder={table.getState().pagination.pageSize} />
115
+ </SelectTrigger>
116
+ <SelectContent side="top">
117
+ {[10, 20, 30, 40, 50].map((pageSize) => (
118
+ <SelectItem key={pageSize} value={`${pageSize}`}>
119
+ {pageSize}
120
+ </SelectItem>
121
+ ))}
122
+ </SelectContent>
123
+ </Select>
124
+ </div>
125
+ <div className="flex w-[100px] items-center justify-center text-sm font-medium">
126
+ Page {table.getState().pagination.pageIndex + 1} of{" "}
127
+ {table.getPageCount()}
128
+ </div>
129
+ <div className="flex items-center space-x-2">
130
+ <Button
131
+ variant="outline"
132
+ size="icon-xs"
133
+ className="hidden lg:flex"
134
+ onClick={() => {
135
+ table.setPageIndex(0);
136
+ }}
137
+ disabled={!table.getCanPreviousPage()}
138
+ >
139
+ <span className="sr-only">Go to first page</span>
140
+ <DoubleArrowLeftIcon className="size-4" />
141
+ </Button>
142
+ <Button
143
+ variant="outline"
144
+ size="icon-xs"
145
+ onClick={() => {
146
+ table.previousPage();
147
+ }}
148
+ disabled={!table.getCanPreviousPage()}
149
+ >
150
+ <span className="sr-only">Go to previous page</span>
151
+ <ChevronLeftIcon className="size-4" />
152
+ </Button>
153
+ <Button
154
+ variant="outline"
155
+ size="icon-xs"
156
+ onClick={() => {
157
+ table.nextPage();
158
+ }}
159
+ disabled={!table.getCanNextPage()}
160
+ >
161
+ <span className="sr-only">Go to next page</span>
162
+ <ChevronRightIcon className="size-4" />
163
+ </Button>
164
+ <Button
165
+ variant="outline"
166
+ size="icon-xs"
167
+ className="hidden lg:flex"
168
+ onClick={() => {
169
+ table.setPageIndex(table.getPageCount() - 1);
170
+ }}
171
+ disabled={!table.getCanNextPage()}
172
+ >
173
+ <span className="sr-only">Go to last page</span>
174
+ <DoubleArrowRightIcon className="size-4" />
175
+ </Button>
176
+ </div>
177
+ </div>
178
+ </div>
179
+ );
180
+ }
181
+
182
+ /* -----------------------------------------------------------------------------
183
+ * Component: DataTableColumnHeader
184
+ * -------------------------------------------------------------------------- */
185
+
186
+ function DataTableColumnHeader<TData, TValue>({
187
+ column,
188
+ title,
189
+ className,
190
+ }: React.HTMLAttributes<HTMLDivElement> & {
191
+ column: ReactTable.Column<TData, TValue>;
192
+ title: string;
193
+ }): React.JSX.Element {
194
+ if (!column.getCanSort()) {
195
+ return <div className={cn(className)}>{title}</div>;
196
+ }
197
+
198
+ return (
199
+ <div className={cn("flex items-center space-x-2", className)}>
200
+ <DropdownMenu>
201
+ <DropdownMenuTrigger asChild>
202
+ <Button
203
+ variant="ghost"
204
+ size="xs"
205
+ className="data-[state=open]:bg-accent -ml-3"
206
+ >
207
+ <span>{title}</span>
208
+ {column.getIsSorted() === "desc" ? (
209
+ <ArrowDownIcon className="ml-2 size-4" />
210
+ ) : column.getIsSorted() === "asc" ? (
211
+ <ArrowUpIcon className="ml-2 size-4" />
212
+ ) : (
213
+ <CaretSortIcon className="ml-2 size-4" />
214
+ )}
215
+ </Button>
216
+ </DropdownMenuTrigger>
217
+ <DropdownMenuContent align="start">
218
+ <DropdownMenuItem
219
+ onClick={() => {
220
+ column.toggleSorting(false);
221
+ }}
222
+ >
223
+ <ArrowUpIcon className="text-muted-foreground/70 mr-2 size-3.5" />
224
+ Asc
225
+ </DropdownMenuItem>
226
+ <DropdownMenuItem
227
+ onClick={() => {
228
+ column.toggleSorting(true);
229
+ }}
230
+ >
231
+ <ArrowDownIcon className="text-muted-foreground/70 mr-2 size-3.5" />
232
+ Desc
233
+ </DropdownMenuItem>
234
+ <DropdownMenuSeparator />
235
+ <DropdownMenuItem
236
+ onClick={() => {
237
+ column.toggleVisibility(false);
238
+ }}
239
+ >
240
+ <EyeNoneIcon className="text-muted-foreground/70 mr-2 size-3.5" />
241
+ Hide
242
+ </DropdownMenuItem>
243
+ </DropdownMenuContent>
244
+ </DropdownMenu>
245
+ </div>
246
+ );
247
+ }
248
+
249
+ /* -----------------------------------------------------------------------------
250
+ * Exports
251
+ * -------------------------------------------------------------------------- */
252
+
253
+ export { DataTableViewOptions, DataTablePagination, DataTableColumnHeader };
254
+
255
+ export * from "@tanstack/react-table";
package/src/em.tsx ADDED
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Em
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Em = React.forwardRef<
9
+ HTMLElement,
10
+ React.HTMLAttributes<HTMLElement> & { asChild?: boolean }
11
+ >(({ asChild, ...props }, ref) => {
12
+ const Comp = asChild ? Slot : "em";
13
+
14
+ return <Comp ref={ref} {...props} />;
15
+ });
16
+ Em.displayName = "Em";
17
+
18
+ /* -----------------------------------------------------------------------------
19
+ * Exports
20
+ * -------------------------------------------------------------------------- */
21
+
22
+ export { Em };
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Heading
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Heading = React.forwardRef<
9
+ HTMLHeadingElement,
10
+ React.HTMLAttributes<HTMLHeadingElement> & {
11
+ as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
12
+ asChild?: boolean;
13
+ }
14
+ >(({ asChild, as: Tag = "h1", ...props }, ref) => {
15
+ const Com = asChild ? Slot : Tag;
16
+
17
+ return <Com ref={ref} {...props} />;
18
+ });
19
+ Heading.displayName = "Heading";
20
+
21
+ /* -----------------------------------------------------------------------------
22
+ * Exports
23
+ * -------------------------------------------------------------------------- */
24
+
25
+ export { Heading };
package/src/input.tsx CHANGED
@@ -1,5 +1,25 @@
1
1
  import * as React from "react";
2
- import { cn } from "./utils";
2
+ import { type VariantProps } from "cva";
3
+ import { cva } from "./utils";
4
+
5
+ /* -----------------------------------------------------------------------------
6
+ * Variant: Input
7
+ * -------------------------------------------------------------------------- */
8
+
9
+ const inputVariants = cva({
10
+ base: "border-input focus-visible:ring-ring focus-visible:ring-offset-background placeholder:text-muted-foreground flex w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
11
+ variants: {
12
+ inputSize: {
13
+ default: "h-10",
14
+ xs: "h-8",
15
+ sm: "h-9",
16
+ lg: "h-11",
17
+ },
18
+ },
19
+ defaultVariants: {
20
+ inputSize: "default",
21
+ },
22
+ });
3
23
 
4
24
  /* -----------------------------------------------------------------------------
5
25
  * Component: Input
@@ -7,15 +27,13 @@ import { cn } from "./utils";
7
27
 
8
28
  const Input = React.forwardRef<
9
29
  HTMLInputElement,
10
- React.InputHTMLAttributes<HTMLInputElement>
11
- >(({ className, type, ...props }, ref) => {
30
+ Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> &
31
+ VariantProps<typeof inputVariants>
32
+ >(({ className, inputSize, ...props }, ref) => {
12
33
  return (
13
34
  <input
14
- type={type}
15
- className={cn(
16
- "border-input focus-visible:ring-ring focus-visible:ring-offset-background placeholder:text-muted-foreground flex h-10 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
17
- className,
18
- )}
35
+ type="text"
36
+ className={inputVariants({ className, inputSize })}
19
37
  ref={ref}
20
38
  {...props}
21
39
  />
package/src/kbd.tsx ADDED
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+ import { cn } from "./utils";
4
+
5
+ /* -----------------------------------------------------------------------------
6
+ * Component: Kbd
7
+ * -------------------------------------------------------------------------- */
8
+
9
+ const Kbd = React.forwardRef<
10
+ HTMLElement,
11
+ React.HTMLAttributes<HTMLElement> & { asChild?: boolean }
12
+ >(({ asChild, className, ...props }, ref) => {
13
+ const Comp = asChild ? Slot : "kbd";
14
+
15
+ return (
16
+ <Comp
17
+ ref={ref}
18
+ className={cn(
19
+ "bg-muted text-muted-foreground inline-flex h-5 select-none items-center gap-1 rounded border px-1.5 font-mono text-xs font-medium",
20
+ className,
21
+ )}
22
+ {...props}
23
+ />
24
+ );
25
+ });
26
+ Kbd.displayName = "Kbd";
27
+
28
+ /* -----------------------------------------------------------------------------
29
+ * Exports
30
+ * -------------------------------------------------------------------------- */
31
+
32
+ export { Kbd };
package/src/pre.tsx ADDED
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Pre
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Pre = React.forwardRef<
9
+ HTMLPreElement,
10
+ React.HTMLAttributes<HTMLPreElement> & { asChild?: boolean }
11
+ >(({ asChild, ...props }, ref) => {
12
+ const Comp = asChild ? Slot : "pre";
13
+
14
+ return <Comp ref={ref} {...props} />;
15
+ });
16
+ Pre.displayName = "Pre";
17
+
18
+ /* -----------------------------------------------------------------------------
19
+ * Exports
20
+ * -------------------------------------------------------------------------- */
21
+
22
+ export { Pre };
package/src/quote.tsx ADDED
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Quote
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Quote = React.forwardRef<
9
+ HTMLQuoteElement,
10
+ React.QuoteHTMLAttributes<HTMLQuoteElement> & { asChild?: boolean }
11
+ >(({ asChild, ...props }, ref) => {
12
+ const Comp = asChild ? Slot : "q";
13
+
14
+ return <Comp ref={ref} {...props} />;
15
+ });
16
+ Quote.displayName = "Quote";
17
+
18
+ /* -----------------------------------------------------------------------------
19
+ * Exports
20
+ * -------------------------------------------------------------------------- */
21
+
22
+ export { Quote };
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Section
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Section = React.forwardRef<
9
+ HTMLElement,
10
+ React.HTMLAttributes<HTMLElement> & {
11
+ asChild?: boolean;
12
+ }
13
+ >(({ asChild, ...props }, ref) => {
14
+ const Comp = asChild ? Slot : "section";
15
+
16
+ return <Comp ref={ref} {...props} />;
17
+ });
18
+ Section.displayName = "Section";
19
+
20
+ /* -----------------------------------------------------------------------------
21
+ * Exports
22
+ * -------------------------------------------------------------------------- */
23
+
24
+ export { Section };
package/src/strong.tsx ADDED
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Strong
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ const Strong = React.forwardRef<
9
+ HTMLElement,
10
+ React.HTMLAttributes<HTMLElement> & { asChild?: boolean }
11
+ >(({ asChild, ...props }, ref) => {
12
+ const Comp = asChild ? Slot : "strong";
13
+
14
+ return <Comp ref={ref} {...props} />;
15
+ });
16
+ Strong.displayName = "Strong";
17
+
18
+ /* -----------------------------------------------------------------------------
19
+ * Exports
20
+ * -------------------------------------------------------------------------- */
21
+
22
+ export { Strong };
package/src/table.tsx CHANGED
@@ -96,7 +96,7 @@ const TableHead = React.forwardRef<
96
96
  <th
97
97
  ref={ref}
98
98
  className={cn(
99
- "text-muted-foreground h-10 px-3 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5",
99
+ "text-muted-foreground h-12 px-4 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0",
100
100
  className,
101
101
  )}
102
102
  {...props}
@@ -114,10 +114,7 @@ const TableCell = React.forwardRef<
114
114
  >(({ className, ...props }, ref) => (
115
115
  <td
116
116
  ref={ref}
117
- className={cn(
118
- "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-0.5",
119
- className,
120
- )}
117
+ className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
121
118
  {...props}
122
119
  />
123
120
  ));
package/src/text.tsx ADDED
@@ -0,0 +1,34 @@
1
+ import * as React from "react";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+
4
+ /* -----------------------------------------------------------------------------
5
+ * Component: Text
6
+ * -------------------------------------------------------------------------- */
7
+
8
+ interface TextParagraphProps
9
+ extends React.HTMLAttributes<HTMLParagraphElement> {
10
+ as?: "p";
11
+ }
12
+
13
+ interface TextSpanProps extends React.HTMLAttributes<HTMLSpanElement> {
14
+ as: "span";
15
+ }
16
+
17
+ type TextProps = (TextParagraphProps | TextSpanProps) & {
18
+ asChild?: boolean;
19
+ };
20
+
21
+ const Text = React.forwardRef<HTMLParagraphElement, TextProps>(
22
+ ({ as: Tag = "p", asChild, ...props }, ref) => {
23
+ const Comp = asChild ? Slot : Tag;
24
+
25
+ return <Comp ref={ref} {...props} />;
26
+ },
27
+ );
28
+ Text.displayName = "Text";
29
+
30
+ /* -----------------------------------------------------------------------------
31
+ * Exports
32
+ * -------------------------------------------------------------------------- */
33
+
34
+ export { Text };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/button.tsx"],"names":[],"mappings":";;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAkDf;AA1CN,IAAM,iBAAiB,IAAI;AAAA,EACzB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,aACE;AAAA,MACF,OAAO;AAAA,MACP,MAAM;AAAA,MACN,SACE;AAAA,MACF,WACE;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AACF,CAAC;AAYD,IAAM,SAAe;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,OAAO;AAE9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,MAAM,UAAU,SAAY;AAAA,QAC5B,WAAW,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC;AAAA,QACrD,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,OAAO,cAAc","sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { type VariantProps } from \"cva\";\nimport { cva } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Variant: Button\n * -------------------------------------------------------------------------- */\n\nconst buttonVariants = cva({\n base: \"focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90 shadow\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n outline:\n \"border-input bg-background hover:bg-accent hover:text-accent-foreground border shadow-sm\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm\",\n },\n size: {\n default: \"h-10 px-4\",\n sm: \"h-9 px-3\",\n lg: \"h-11 px-8\",\n icon: \"size-10\",\n },\n },\n defaultVariants: {\n size: \"default\",\n variant: \"default\",\n },\n});\n\n/* -----------------------------------------------------------------------------\n * Component: Button\n * -------------------------------------------------------------------------- */\n\ninterface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n ref={ref}\n type={asChild ? undefined : \"button\"}\n className={buttonVariants({ variant, size, className })}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Button, buttonVariants, type ButtonProps };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { type VariantProps } from \"cva\";\nimport { cva } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Variant: Button\n * -------------------------------------------------------------------------- */\n\nconst buttonVariants = cva({\n base: \"focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90 shadow\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n outline:\n \"border-input bg-background hover:bg-accent hover:text-accent-foreground border shadow-sm\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm\",\n },\n size: {\n default: \"h-10 px-4\",\n sm: \"h-9 px-3\",\n lg: \"h-11 px-8\",\n icon: \"size-10\",\n },\n },\n defaultVariants: {\n size: \"default\",\n variant: \"default\",\n },\n});\n\n/* -----------------------------------------------------------------------------\n * Component: Button\n * -------------------------------------------------------------------------- */\n\ninterface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n ref={ref}\n type={asChild ? undefined : \"button\"}\n className={buttonVariants({ variant, size, className })}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Button, buttonVariants, type ButtonProps };\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAkDf;AA1CN,IAAM,iBAAiB,IAAI;AAAA,EACzB,MAAM;AAAA,EACN,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,aACE;AAAA,MACF,OAAO;AAAA,MACP,MAAM;AAAA,MACN,SACE;AAAA,MACF,WACE;AAAA,IACJ;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AACF,CAAC;AAYD,IAAM,SAAe;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,OAAO;AAE9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,MAAM,UAAU,SAAY;AAAA,QAC5B,WAAW,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC;AAAA,QACrD,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,OAAO,cAAc;","names":[]}