@robomous/ui-core 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +15 -7
  2. package/dist/{primitives → components}/alert.js +1 -1
  3. package/dist/{primitives → components}/badge.js +1 -1
  4. package/dist/{primitives → components}/button.d.ts +1 -1
  5. package/dist/{primitives → components}/button.js +4 -1
  6. package/dist/{primitives → components}/card.d.ts +1 -1
  7. package/dist/{primitives → components}/card.js +2 -2
  8. package/dist/{primitives → components}/combobox.js +3 -3
  9. package/dist/{primitives → components}/dialog.js +1 -1
  10. package/dist/{primitives → components}/dropdown-menu.js +11 -6
  11. package/dist/{primitives → components}/field.js +2 -4
  12. package/dist/{primitives → components}/input-group.js +1 -1
  13. package/dist/{primitives → components}/input.js +1 -1
  14. package/dist/{primitives → components}/label.js +1 -1
  15. package/dist/components/progress.js +7 -0
  16. package/dist/{primitives → components}/select.d.ts +3 -1
  17. package/dist/{primitives → components}/select.js +6 -4
  18. package/dist/{primitives → components}/separator.js +1 -1
  19. package/dist/{primitives → components}/sheet.js +1 -1
  20. package/dist/{primitives → components}/skeleton.js +1 -1
  21. package/dist/{primitives → components}/sonner.js +17 -12
  22. package/dist/{primitives → components}/table.d.ts +1 -1
  23. package/dist/{primitives → components}/table.js +3 -3
  24. package/dist/{primitives → components}/tabs.js +1 -1
  25. package/dist/{primitives → components}/textarea.js +1 -1
  26. package/dist/{primitives → components}/tooltip.js +1 -1
  27. package/dist/gates/index.d.ts +28 -0
  28. package/dist/gates/index.js +142 -0
  29. package/dist/index.d.ts +31 -32
  30. package/dist/index.js +32 -33
  31. package/dist/{tokens.d.ts → theme/tokens.d.ts} +5 -5
  32. package/dist/{tokens.js → theme/tokens.js} +12 -12
  33. package/package.json +23 -12
  34. package/{shadcn → src/components}/alert.tsx +14 -21
  35. package/src/{primitives → components}/badge.tsx +15 -21
  36. package/src/{primitives → components}/button.tsx +13 -10
  37. package/{shadcn → src/components}/card.tsx +16 -31
  38. package/src/{primitives → components}/combobox.test.tsx +15 -2
  39. package/src/{primitives → components}/combobox.tsx +45 -74
  40. package/src/{primitives/primitives.test.tsx → components/components.test.tsx} +106 -69
  41. package/src/{primitives → components}/dialog.tsx +31 -54
  42. package/src/{primitives → components}/dropdown-menu.tsx +51 -65
  43. package/src/{primitives → components}/field.tsx +48 -62
  44. package/src/{primitives → components}/input-group.tsx +37 -49
  45. package/{shadcn → src/components}/input.tsx +5 -5
  46. package/{shadcn → src/components}/label.tsx +7 -10
  47. package/src/{primitives → components}/progress.tsx +7 -6
  48. package/{shadcn → src/components}/select.tsx +39 -41
  49. package/{shadcn → src/components}/separator.tsx +7 -7
  50. package/src/{primitives → components}/sheet.tsx +27 -44
  51. package/{shadcn → src/components}/skeleton.tsx +3 -3
  52. package/src/{primitives → components}/sonner.test.tsx +12 -4
  53. package/src/components/sonner.tsx +67 -0
  54. package/{shadcn → src/components}/table.tsx +17 -44
  55. package/{shadcn → src/components}/tabs.tsx +16 -26
  56. package/{shadcn → src/components}/textarea.tsx +5 -5
  57. package/{shadcn → src/components}/tooltip.tsx +12 -16
  58. package/src/gates/design.test.ts +188 -0
  59. package/src/gates/index.test.ts +11 -0
  60. package/src/gates/index.ts +165 -0
  61. package/src/gates/tokens.test.ts +215 -0
  62. package/src/harness.test.tsx +1 -1
  63. package/src/index.ts +63 -33
  64. package/src/theme/imports.test.ts +160 -0
  65. package/src/{statusTone.test.ts → theme/statusTone.test.ts} +5 -1
  66. package/src/{styles.css → theme/styles.css} +45 -31
  67. package/src/theme/tailwind.css +646 -0
  68. package/src/{tokens.test.ts → theme/tokens.test.ts} +30 -23
  69. package/src/{tokens.ts → theme/tokens.ts} +12 -12
  70. package/components.json +0 -13
  71. package/dist/lib/button.d.ts +0 -1
  72. package/dist/lib/button.js +0 -4
  73. package/dist/lib/cn.d.ts +0 -18
  74. package/dist/lib/cn.js +0 -21
  75. package/dist/lib/menu.d.ts +0 -1
  76. package/dist/lib/menu.js +0 -16
  77. package/dist/lib/progress.d.ts +0 -3
  78. package/dist/lib/progress.js +0 -6
  79. package/dist/lib/select.d.ts +0 -1
  80. package/dist/lib/select.js +0 -3
  81. package/dist/primitives/progress.js +0 -7
  82. package/gates/canonical.test.mjs +0 -71
  83. package/gates/extensions.test.mjs +0 -373
  84. package/gates/index.d.mts +0 -51
  85. package/gates/index.mjs +0 -514
  86. package/gates/tokens.test.mjs +0 -276
  87. package/shadcn/README.md +0 -13
  88. package/shadcn/badge.tsx +0 -49
  89. package/shadcn/button.tsx +0 -67
  90. package/shadcn/combobox.tsx +0 -299
  91. package/shadcn/dialog.tsx +0 -166
  92. package/shadcn/dropdown-menu.tsx +0 -267
  93. package/shadcn/field.tsx +0 -236
  94. package/shadcn/input-group.tsx +0 -154
  95. package/shadcn/progress.tsx +0 -29
  96. package/shadcn/sheet.tsx +0 -145
  97. package/shadcn/sonner.tsx +0 -49
  98. package/src/lib/button.ts +0 -4
  99. package/src/lib/cn.test.ts +0 -33
  100. package/src/lib/cn.ts +0 -23
  101. package/src/lib/menu.ts +0 -16
  102. package/src/lib/progress.ts +0 -6
  103. package/src/lib/select.ts +0 -4
  104. package/src/primitives/alert.tsx +0 -76
  105. package/src/primitives/card.tsx +0 -103
  106. package/src/primitives/input.tsx +0 -19
  107. package/src/primitives/label.tsx +0 -22
  108. package/src/primitives/select.tsx +0 -192
  109. package/src/primitives/separator.tsx +0 -28
  110. package/src/primitives/skeleton.tsx +0 -13
  111. package/src/primitives/sonner.tsx +0 -65
  112. package/src/primitives/table.tsx +0 -114
  113. package/src/primitives/tabs.tsx +0 -88
  114. package/src/primitives/textarea.tsx +0 -18
  115. package/src/primitives/tooltip.tsx +0 -57
  116. /package/dist/{primitives → components}/alert.d.ts +0 -0
  117. /package/dist/{primitives → components}/badge.d.ts +0 -0
  118. /package/dist/{primitives → components}/combobox.d.ts +0 -0
  119. /package/dist/{primitives → components}/dialog.d.ts +0 -0
  120. /package/dist/{primitives → components}/dropdown-menu.d.ts +0 -0
  121. /package/dist/{primitives → components}/field.d.ts +0 -0
  122. /package/dist/{primitives → components}/input-group.d.ts +0 -0
  123. /package/dist/{primitives → components}/input.d.ts +0 -0
  124. /package/dist/{primitives → components}/label.d.ts +0 -0
  125. /package/dist/{primitives → components}/progress.d.ts +0 -0
  126. /package/dist/{primitives → components}/separator.d.ts +0 -0
  127. /package/dist/{primitives → components}/sheet.d.ts +0 -0
  128. /package/dist/{primitives → components}/skeleton.d.ts +0 -0
  129. /package/dist/{primitives → components}/sonner.d.ts +0 -0
  130. /package/dist/{primitives → components}/tabs.d.ts +0 -0
  131. /package/dist/{primitives → components}/textarea.d.ts +0 -0
  132. /package/dist/{primitives → components}/tooltip.d.ts +0 -0
  133. /package/dist/{statusTone.d.ts → theme/statusTone.d.ts} +0 -0
  134. /package/dist/{statusTone.js → theme/statusTone.js} +0 -0
  135. /package/src/{statusTone.ts → theme/statusTone.ts} +0 -0
@@ -1,192 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Select as SelectPrimitive } from "radix-ui"
5
-
6
- import { cn } from "../lib/cn.js"
7
- import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react"
8
-
9
- function Select({
10
- ...props
11
- }: React.ComponentProps<typeof SelectPrimitive.Root>) {
12
- return <SelectPrimitive.Root data-slot="select" {...props} />
13
- }
14
-
15
- function SelectGroup({
16
- className,
17
- ...props
18
- }: React.ComponentProps<typeof SelectPrimitive.Group>) {
19
- return (
20
- <SelectPrimitive.Group
21
- data-slot="select-group"
22
- className={cn("scroll-my-1 p-1", className)}
23
- {...props}
24
- />
25
- )
26
- }
27
-
28
- function SelectValue({
29
- ...props
30
- }: React.ComponentProps<typeof SelectPrimitive.Value>) {
31
- return <SelectPrimitive.Value data-slot="select-value" {...props} />
32
- }
33
-
34
- function SelectTrigger({
35
- className,
36
- size = "default",
37
- children,
38
- ...props
39
- }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
40
- size?: "sm" | "default"
41
- }) {
42
- return (
43
- <SelectPrimitive.Trigger
44
- data-slot="select-trigger"
45
- data-size={size}
46
- className={cn(
47
- "flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
48
- className
49
- )}
50
- {...props}
51
- >
52
- {children}
53
- <SelectPrimitive.Icon asChild>
54
- <ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
55
- </SelectPrimitive.Icon>
56
- </SelectPrimitive.Trigger>
57
- )
58
- }
59
-
60
- function SelectContent({
61
- className,
62
- children,
63
- position = "item-aligned",
64
- align = "center",
65
- ...props
66
- }: React.ComponentProps<typeof SelectPrimitive.Content>) {
67
- return (
68
- <SelectPrimitive.Portal>
69
- <SelectPrimitive.Content
70
- data-slot="select-content"
71
- data-align-trigger={position === "item-aligned"}
72
- className={cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", position ==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className )}
73
- position={position}
74
- align={align}
75
- {...props}
76
- >
77
- <SelectScrollUpButton />
78
- <SelectPrimitive.Viewport
79
- data-position={position}
80
- className={cn(
81
- "data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",
82
- position === "popper" && ""
83
- )}
84
- >
85
- {children}
86
- </SelectPrimitive.Viewport>
87
- <SelectScrollDownButton />
88
- </SelectPrimitive.Content>
89
- </SelectPrimitive.Portal>
90
- )
91
- }
92
-
93
- function SelectLabel({
94
- className,
95
- ...props
96
- }: React.ComponentProps<typeof SelectPrimitive.Label>) {
97
- return (
98
- <SelectPrimitive.Label
99
- data-slot="select-label"
100
- className={cn("px-1.5 py-1 text-xs text-muted-foreground", className)}
101
- {...props}
102
- />
103
- )
104
- }
105
-
106
- function SelectItem({
107
- className,
108
- children,
109
- ...props
110
- }: React.ComponentProps<typeof SelectPrimitive.Item>) {
111
- return (
112
- <SelectPrimitive.Item
113
- data-slot="select-item"
114
- className={cn(
115
- "relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
116
- className
117
- )}
118
- {...props}
119
- >
120
- <span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
121
- <SelectPrimitive.ItemIndicator>
122
- <CheckIcon className="pointer-events-none" />
123
- </SelectPrimitive.ItemIndicator>
124
- </span>
125
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
126
- </SelectPrimitive.Item>
127
- )
128
- }
129
-
130
- function SelectSeparator({
131
- className,
132
- ...props
133
- }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
134
- return (
135
- <SelectPrimitive.Separator
136
- data-slot="select-separator"
137
- className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
138
- {...props}
139
- />
140
- )
141
- }
142
-
143
- function SelectScrollUpButton({
144
- className,
145
- ...props
146
- }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
147
- return (
148
- <SelectPrimitive.ScrollUpButton
149
- data-slot="select-scroll-up-button"
150
- className={cn(
151
- "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
152
- className
153
- )}
154
- {...props}
155
- >
156
- <ChevronUpIcon
157
- />
158
- </SelectPrimitive.ScrollUpButton>
159
- )
160
- }
161
-
162
- function SelectScrollDownButton({
163
- className,
164
- ...props
165
- }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
166
- return (
167
- <SelectPrimitive.ScrollDownButton
168
- data-slot="select-scroll-down-button"
169
- className={cn(
170
- "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
171
- className
172
- )}
173
- {...props}
174
- >
175
- <ChevronDownIcon
176
- />
177
- </SelectPrimitive.ScrollDownButton>
178
- )
179
- }
180
-
181
- export {
182
- Select,
183
- SelectContent,
184
- SelectGroup,
185
- SelectItem,
186
- SelectLabel,
187
- SelectScrollDownButton,
188
- SelectScrollUpButton,
189
- SelectSeparator,
190
- SelectTrigger,
191
- SelectValue,
192
- }
@@ -1,28 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Separator as SeparatorPrimitive } from "radix-ui"
5
-
6
- import { cn } from "../lib/cn.js"
7
-
8
- function Separator({
9
- className,
10
- orientation = "horizontal",
11
- decorative = true,
12
- ...props
13
- }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
14
- return (
15
- <SeparatorPrimitive.Root
16
- data-slot="separator"
17
- decorative={decorative}
18
- orientation={orientation}
19
- className={cn(
20
- "shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",
21
- className
22
- )}
23
- {...props}
24
- />
25
- )
26
- }
27
-
28
- export { Separator }
@@ -1,13 +0,0 @@
1
- import { cn } from "../lib/cn.js"
2
-
3
- function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4
- return (
5
- <div
6
- data-slot="skeleton"
7
- className={cn("animate-pulse rounded-md bg-muted", className)}
8
- {...props}
9
- />
10
- )
11
- }
12
-
13
- export { Skeleton }
@@ -1,65 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Toaster as Sonner, type ToasterProps } from "sonner"
5
- import { CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, Loader2Icon } from "lucide-react"
6
-
7
- // SHADCN FRAMEWORK ADAPTER: shadcn's sonner reads next-themes (a Next.js
8
- // integration). VisionSet is Vite with one theme source, `.dark` on <html>
9
- // (styles.css `@custom-variant dark`). This hook is the only difference from
10
- // frontend/ui-core/shadcn/sonner.tsx; drop it if the app ever adopts a
11
- // provider that shadcn's file can read.
12
- function useTheme(): { theme: "light" | "dark" } {
13
- const read = () => (typeof document !== "undefined" && document.documentElement.classList.contains("dark") ? "dark" : "light")
14
- const [theme, setTheme] = React.useState<"light" | "dark">(read)
15
- React.useEffect(() => {
16
- const observer = new MutationObserver(() => setTheme(read()))
17
- observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] })
18
- return () => observer.disconnect()
19
- }, [])
20
- return { theme }
21
- }
22
-
23
- const Toaster = ({ ...props }: ToasterProps) => {
24
- const { theme = "system" } = useTheme()
25
-
26
- return (
27
- <Sonner
28
- theme={theme as ToasterProps["theme"]}
29
- className="toaster group"
30
- icons={{
31
- success: (
32
- <CircleCheckIcon className="size-4" />
33
- ),
34
- info: (
35
- <InfoIcon className="size-4" />
36
- ),
37
- warning: (
38
- <TriangleAlertIcon className="size-4" />
39
- ),
40
- error: (
41
- <OctagonXIcon className="size-4" />
42
- ),
43
- loading: (
44
- <Loader2Icon className="size-4 animate-spin" />
45
- ),
46
- }}
47
- style={
48
- {
49
- "--normal-bg": "var(--popover)",
50
- "--normal-text": "var(--popover-foreground)",
51
- "--normal-border": "var(--border)",
52
- "--border-radius": "var(--radius)",
53
- } as React.CSSProperties
54
- }
55
- toastOptions={{
56
- classNames: {
57
- toast: "cn-toast",
58
- },
59
- }}
60
- {...props}
61
- />
62
- )
63
- }
64
-
65
- export { Toaster }
@@ -1,114 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "../lib/cn.js"
4
-
5
- function Table({ className, ...props }: React.ComponentProps<"table">) {
6
- return (
7
- <div
8
- data-slot="table-container"
9
- className="relative w-full overflow-x-auto"
10
- >
11
- <table
12
- data-slot="table"
13
- className={cn("w-full caption-bottom text-sm", className)}
14
- {...props}
15
- />
16
- </div>
17
- )
18
- }
19
-
20
- function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
21
- return (
22
- <thead
23
- data-slot="table-header"
24
- className={cn("[&_tr]:border-b", className)}
25
- {...props}
26
- />
27
- )
28
- }
29
-
30
- function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
31
- return (
32
- <tbody
33
- data-slot="table-body"
34
- className={cn("[&_tr:last-child]:border-0", className)}
35
- {...props}
36
- />
37
- )
38
- }
39
-
40
- function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
41
- return (
42
- <tfoot
43
- data-slot="table-footer"
44
- className={cn(
45
- "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
46
- className
47
- )}
48
- {...props}
49
- />
50
- )
51
- }
52
-
53
- function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
54
- return (
55
- <tr
56
- data-slot="table-row"
57
- className={cn(
58
- "border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
59
- className
60
- )}
61
- {...props}
62
- />
63
- )
64
- }
65
-
66
- function TableHead({ className, ...props }: React.ComponentProps<"th">) {
67
- return (
68
- <th
69
- data-slot="table-head"
70
- className={cn(
71
- "h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
72
- className
73
- )}
74
- {...props}
75
- />
76
- )
77
- }
78
-
79
- function TableCell({ className, ...props }: React.ComponentProps<"td">) {
80
- return (
81
- <td
82
- data-slot="table-cell"
83
- className={cn(
84
- "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
85
- className
86
- )}
87
- {...props}
88
- />
89
- )
90
- }
91
-
92
- function TableCaption({
93
- className,
94
- ...props
95
- }: React.ComponentProps<"caption">) {
96
- return (
97
- <caption
98
- data-slot="table-caption"
99
- className={cn("mt-4 text-sm text-muted-foreground", className)}
100
- {...props}
101
- />
102
- )
103
- }
104
-
105
- export {
106
- Table,
107
- TableHeader,
108
- TableBody,
109
- TableFooter,
110
- TableHead,
111
- TableRow,
112
- TableCell,
113
- TableCaption,
114
- }
@@ -1,88 +0,0 @@
1
- import * as React from "react"
2
- import { cva, type VariantProps } from "class-variance-authority"
3
- import { Tabs as TabsPrimitive } from "radix-ui"
4
-
5
- import { cn } from "../lib/cn.js"
6
-
7
- function Tabs({
8
- className,
9
- orientation = "horizontal",
10
- ...props
11
- }: React.ComponentProps<typeof TabsPrimitive.Root>) {
12
- return (
13
- <TabsPrimitive.Root
14
- data-slot="tabs"
15
- data-orientation={orientation}
16
- className={cn(
17
- "group/tabs flex gap-2 data-horizontal:flex-col",
18
- className
19
- )}
20
- {...props}
21
- />
22
- )
23
- }
24
-
25
- const tabsListVariants = cva(
26
- "group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",
27
- {
28
- variants: {
29
- variant: {
30
- default: "bg-muted",
31
- line: "gap-1 bg-transparent",
32
- },
33
- },
34
- defaultVariants: {
35
- variant: "default",
36
- },
37
- }
38
- )
39
-
40
- function TabsList({
41
- className,
42
- variant = "default",
43
- ...props
44
- }: React.ComponentProps<typeof TabsPrimitive.List> &
45
- VariantProps<typeof tabsListVariants>) {
46
- return (
47
- <TabsPrimitive.List
48
- data-slot="tabs-list"
49
- data-variant={variant}
50
- className={cn(tabsListVariants({ variant }), className)}
51
- {...props}
52
- />
53
- )
54
- }
55
-
56
- function TabsTrigger({
57
- className,
58
- ...props
59
- }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
60
- return (
61
- <TabsPrimitive.Trigger
62
- data-slot="tabs-trigger"
63
- className={cn(
64
- "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
65
- "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
66
- "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
67
- "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
68
- className
69
- )}
70
- {...props}
71
- />
72
- )
73
- }
74
-
75
- function TabsContent({
76
- className,
77
- ...props
78
- }: React.ComponentProps<typeof TabsPrimitive.Content>) {
79
- return (
80
- <TabsPrimitive.Content
81
- data-slot="tabs-content"
82
- className={cn("flex-1 text-sm outline-none", className)}
83
- {...props}
84
- />
85
- )
86
- }
87
-
88
- export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
@@ -1,18 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "../lib/cn.js"
4
-
5
- function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
6
- return (
7
- <textarea
8
- data-slot="textarea"
9
- className={cn(
10
- "flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
11
- className
12
- )}
13
- {...props}
14
- />
15
- )
16
- }
17
-
18
- export { Textarea }
@@ -1,57 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Tooltip as TooltipPrimitive } from "radix-ui"
5
-
6
- import { cn } from "../lib/cn.js"
7
-
8
- function TooltipProvider({
9
- delayDuration = 0,
10
- ...props
11
- }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
12
- return (
13
- <TooltipPrimitive.Provider
14
- data-slot="tooltip-provider"
15
- delayDuration={delayDuration}
16
- {...props}
17
- />
18
- )
19
- }
20
-
21
- function Tooltip({
22
- ...props
23
- }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
24
- return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
25
- }
26
-
27
- function TooltipTrigger({
28
- ...props
29
- }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
30
- return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
31
- }
32
-
33
- function TooltipContent({
34
- className,
35
- sideOffset = 0,
36
- children,
37
- ...props
38
- }: React.ComponentProps<typeof TooltipPrimitive.Content>) {
39
- return (
40
- <TooltipPrimitive.Portal>
41
- <TooltipPrimitive.Content
42
- data-slot="tooltip-content"
43
- sideOffset={sideOffset}
44
- className={cn(
45
- "z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
46
- className
47
- )}
48
- {...props}
49
- >
50
- {children}
51
- <TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" />
52
- </TooltipPrimitive.Content>
53
- </TooltipPrimitive.Portal>
54
- )
55
- }
56
-
57
- export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes