@health-samurai/react-components 0.0.0-alpha.3 → 0.0.0-alpha.5
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.
- package/dist/bundle.css +687 -446
- package/dist/src/components/code-editor/http/grammar/http.d.ts +3 -0
- package/dist/src/components/code-editor/http/grammar/http.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.grammar +74 -0
- package/dist/src/components/code-editor/http/grammar/http.js +38 -0
- package/dist/src/components/code-editor/http/grammar/http.js.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.d.ts +2 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.js +4 -0
- package/dist/src/components/code-editor/http/grammar/http.terms.js.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.test.d.ts +2 -0
- package/dist/src/components/code-editor/http/grammar/http.test.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/grammar/http.test.js +80 -0
- package/dist/src/components/code-editor/http/grammar/http.test.js.map +1 -0
- package/dist/src/components/code-editor/http/index.d.ts +4 -0
- package/dist/src/components/code-editor/http/index.d.ts.map +1 -0
- package/dist/src/components/code-editor/http/index.js +66 -0
- package/dist/src/components/code-editor/http/index.js.map +1 -0
- package/dist/src/components/code-editor/index.d.ts +13 -2
- package/dist/src/components/code-editor/index.d.ts.map +1 -1
- package/dist/src/components/code-editor/index.js +161 -20
- package/dist/src/components/code-editor/index.js.map +1 -1
- package/dist/src/components/code-editor.stories.js +3 -1
- package/dist/src/components/code-editor.stories.js.map +1 -1
- package/dist/src/components/request-line-editor.d.ts +11 -35
- package/dist/src/components/request-line-editor.d.ts.map +1 -1
- package/dist/src/components/request-line-editor.js +51 -49
- package/dist/src/components/request-line-editor.js.map +1 -1
- package/dist/src/components/request-line-editor.stories.d.ts.map +1 -1
- package/dist/src/components/request-line-editor.stories.js +17 -53
- package/dist/src/components/request-line-editor.stories.js.map +1 -1
- package/dist/src/components/tree-view.d.ts +16 -0
- package/dist/src/components/tree-view.d.ts.map +1 -0
- package/dist/src/components/tree-view.js +67 -0
- package/dist/src/components/tree-view.js.map +1 -0
- package/dist/src/components/tree-view.stories.d.ts +13 -0
- package/dist/src/components/tree-view.stories.d.ts.map +1 -0
- package/dist/src/components/tree-view.stories.js +274 -0
- package/dist/src/components/tree-view.stories.js.map +1 -0
- package/dist/src/icons.d.ts +3 -0
- package/dist/src/icons.d.ts.map +1 -0
- package/dist/src/icons.js +47 -0
- package/dist/src/icons.js.map +1 -0
- package/dist/src/index.css +42 -3
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/shadcn/components/ui/accordion.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/accordion.js +23 -5
- package/dist/src/shadcn/components/ui/accordion.js.map +1 -1
- package/dist/src/shadcn/components/ui/alert.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/alert.js +12 -5
- package/dist/src/shadcn/components/ui/alert.js.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/avatar.js +4 -3
- package/dist/src/shadcn/components/ui/avatar.js.map +1 -1
- package/dist/src/shadcn/components/ui/badge.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/badge.js +16 -5
- package/dist/src/shadcn/components/ui/badge.js.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/breadcrumb.js +6 -6
- package/dist/src/shadcn/components/ui/breadcrumb.js.map +1 -1
- package/dist/src/shadcn/components/ui/button.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/button.js +19 -11
- package/dist/src/shadcn/components/ui/button.js.map +1 -1
- package/dist/src/shadcn/components/ui/card.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/card.js +14 -6
- package/dist/src/shadcn/components/ui/card.js.map +1 -1
- package/dist/src/shadcn/components/ui/carousel.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/carousel.js +1 -0
- package/dist/src/shadcn/components/ui/carousel.js.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.js +20 -5
- package/dist/src/shadcn/components/ui/checkbox.js.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/checkbox.stories.js +44 -35
- package/dist/src/shadcn/components/ui/checkbox.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/combobox.d.ts +18 -0
- package/dist/src/shadcn/components/ui/combobox.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/combobox.js +121 -0
- package/dist/src/shadcn/components/ui/combobox.js.map +1 -0
- package/dist/src/shadcn/components/ui/combobox.stories.d.ts +11 -0
- package/dist/src/shadcn/components/ui/combobox.stories.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/combobox.stories.js +16 -0
- package/dist/src/shadcn/components/ui/combobox.stories.js.map +1 -0
- package/dist/src/shadcn/components/ui/command.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/command.js +73 -12
- package/dist/src/shadcn/components/ui/command.js.map +1 -1
- package/dist/src/shadcn/components/ui/command.stories.js +0 -1
- package/dist/src/shadcn/components/ui/command.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/dialog.js +35 -7
- package/dist/src/shadcn/components/ui/dialog.js.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/drawer.js +26 -5
- package/dist/src/shadcn/components/ui/drawer.js.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.js +12 -1
- package/dist/src/shadcn/components/ui/dropdown-menu.js.map +1 -1
- package/dist/src/shadcn/components/ui/form.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/form.js +12 -4
- package/dist/src/shadcn/components/ui/form.js.map +1 -1
- package/dist/src/shadcn/components/ui/input-otp.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/input-otp.js +1 -0
- package/dist/src/shadcn/components/ui/input-otp.js.map +1 -1
- package/dist/src/shadcn/components/ui/input.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/input.js +87 -16
- package/dist/src/shadcn/components/ui/input.js.map +1 -1
- package/dist/src/shadcn/components/ui/label.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/label.js +8 -1
- package/dist/src/shadcn/components/ui/label.js.map +1 -1
- package/dist/src/shadcn/components/ui/menubar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/menubar.js +35 -13
- package/dist/src/shadcn/components/ui/menubar.js.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/pagination.js +6 -6
- package/dist/src/shadcn/components/ui/pagination.js.map +1 -1
- package/dist/src/shadcn/components/ui/popover.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/popover.js +12 -1
- package/dist/src/shadcn/components/ui/popover.js.map +1 -1
- package/dist/src/shadcn/components/ui/progress.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/progress.js +6 -2
- package/dist/src/shadcn/components/ui/progress.js.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.js +11 -6
- package/dist/src/shadcn/components/ui/radio-group.js.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/radio-group.stories.js +57 -34
- package/dist/src/shadcn/components/ui/radio-group.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/resizable.js +1 -0
- package/dist/src/shadcn/components/ui/resizable.js.map +1 -1
- package/dist/src/shadcn/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/scroll-area.js +9 -3
- package/dist/src/shadcn/components/ui/scroll-area.js.map +1 -1
- package/dist/src/shadcn/components/ui/select.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/select.js +49 -14
- package/dist/src/shadcn/components/ui/select.js.map +1 -1
- package/dist/src/shadcn/components/ui/select.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/select.stories.js +1 -4
- package/dist/src/shadcn/components/ui/select.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/separator.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/separator.js +7 -1
- package/dist/src/shadcn/components/ui/separator.js.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/sidebar.js +20 -6
- package/dist/src/shadcn/components/ui/sidebar.js.map +1 -1
- package/dist/src/shadcn/components/ui/skeleton.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/skeleton.js +3 -1
- package/dist/src/shadcn/components/ui/skeleton.js.map +1 -1
- package/dist/src/shadcn/components/ui/slider.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/slider.js +34 -4
- package/dist/src/shadcn/components/ui/slider.js.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.d.ts +16 -1
- package/dist/src/shadcn/components/ui/sonner.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.js +23 -3
- package/dist/src/shadcn/components/ui/sonner.js.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/sonner.stories.js +19 -11
- package/dist/src/shadcn/components/ui/sonner.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/switch.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/switch.js +18 -2
- package/dist/src/shadcn/components/ui/switch.js.map +1 -1
- package/dist/src/shadcn/components/ui/table.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/table.js +12 -8
- package/dist/src/shadcn/components/ui/table.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.d.ts +21 -3
- package/dist/src/shadcn/components/ui/tabs.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.js +314 -9
- package/dist/src/shadcn/components/ui/tabs.js.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.stories.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tabs.stories.js +50 -1
- package/dist/src/shadcn/components/ui/tabs.stories.js.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/textarea.js +15 -1
- package/dist/src/shadcn/components/ui/textarea.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/toggle-group.js +7 -2
- package/dist/src/shadcn/components/ui/toggle-group.js.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/toggle.js +18 -6
- package/dist/src/shadcn/components/ui/toggle.js.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/shadcn/components/ui/tooltip.js +11 -1
- package/dist/src/shadcn/components/ui/tooltip.js.map +1 -1
- package/dist/src/shadcn/components/ui/tree.d.ts +20 -0
- package/dist/src/shadcn/components/ui/tree.d.ts.map +1 -0
- package/dist/src/shadcn/components/ui/tree.js +111 -0
- package/dist/src/shadcn/components/ui/tree.js.map +1 -0
- package/package.json +9 -2
- package/src/components/code-editor/http/grammar/http.grammar +74 -0
- package/src/components/code-editor/http/grammar/http.terms.ts +9 -0
- package/src/components/code-editor/http/grammar/http.test.ts +110 -0
- package/src/components/code-editor/http/grammar/http.ts +21 -0
- package/src/components/code-editor/http/index.ts +87 -0
- package/src/components/code-editor/index.tsx +182 -21
- package/src/components/code-editor.stories.tsx +1 -1
- package/src/components/request-line-editor.stories.tsx +17 -27
- package/src/components/request-line-editor.tsx +72 -61
- package/src/components/tree-view.stories.tsx +260 -0
- package/src/components/tree-view.tsx +101 -0
- package/src/icons.tsx +45 -0
- package/src/index.css +42 -3
- package/src/index.tsx +1 -1
- package/src/shadcn/components/ui/accordion.tsx +66 -8
- package/src/shadcn/components/ui/alert.tsx +53 -15
- package/src/shadcn/components/ui/avatar.tsx +17 -6
- package/src/shadcn/components/ui/badge.tsx +67 -18
- package/src/shadcn/components/ui/breadcrumb.tsx +35 -7
- package/src/shadcn/components/ui/button.tsx +118 -57
- package/src/shadcn/components/ui/card.tsx +44 -13
- package/src/shadcn/components/ui/carousel.tsx +1 -0
- package/src/shadcn/components/ui/checkbox.stories.tsx +20 -24
- package/src/shadcn/components/ui/checkbox.tsx +45 -4
- package/src/shadcn/components/ui/combobox.stories.tsx +19 -0
- package/src/shadcn/components/ui/combobox.tsx +142 -0
- package/src/shadcn/components/ui/command.stories.tsx +1 -1
- package/src/shadcn/components/ui/command.tsx +192 -36
- package/src/shadcn/components/ui/dialog.tsx +101 -13
- package/src/shadcn/components/ui/drawer.tsx +93 -18
- package/src/shadcn/components/ui/dropdown-menu.tsx +38 -9
- package/src/shadcn/components/ui/form.tsx +16 -4
- package/src/shadcn/components/ui/input-otp.tsx +1 -0
- package/src/shadcn/components/ui/input.tsx +281 -29
- package/src/shadcn/components/ui/label.tsx +21 -4
- package/src/shadcn/components/ui/menubar.tsx +188 -43
- package/src/shadcn/components/ui/pagination.tsx +12 -6
- package/src/shadcn/components/ui/popover.tsx +35 -4
- package/src/shadcn/components/ui/progress.tsx +21 -5
- package/src/shadcn/components/ui/radio-group.stories.tsx +22 -14
- package/src/shadcn/components/ui/radio-group.tsx +42 -5
- package/src/shadcn/components/ui/resizable.tsx +1 -0
- package/src/shadcn/components/ui/scroll-area.tsx +33 -5
- package/src/shadcn/components/ui/select.stories.tsx +0 -2
- package/src/shadcn/components/ui/select.tsx +184 -33
- package/src/shadcn/components/ui/separator.tsx +15 -5
- package/src/shadcn/components/ui/sidebar.tsx +68 -26
- package/src/shadcn/components/ui/skeleton.tsx +4 -1
- package/src/shadcn/components/ui/slider.tsx +82 -11
- package/src/shadcn/components/ui/sonner.stories.tsx +19 -15
- package/src/shadcn/components/ui/sonner.tsx +53 -3
- package/src/shadcn/components/ui/switch.tsx +53 -7
- package/src/shadcn/components/ui/table.tsx +38 -11
- package/src/shadcn/components/ui/tabs.stories.tsx +32 -0
- package/src/shadcn/components/ui/tabs.tsx +455 -17
- package/src/shadcn/components/ui/textarea.tsx +42 -4
- package/src/shadcn/components/ui/toggle-group.tsx +28 -5
- package/src/shadcn/components/ui/toggle.tsx +59 -18
- package/src/shadcn/components/ui/tooltip.tsx +33 -8
- package/src/shadcn/components/ui/tree.tsx +200 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.stories.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/tabs.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tabs.stories.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/tabs.stories.tsx"],"names":[],"mappings":"AAsBA,QAAA,MAAM,IAAI;;;;;;;;;;CAQM,CAAC;AACjB,eAAe,IAAI,CAAC;AAIpB,eAAO,MAAM,IAAI;;;;;;;;;;;;CA2DA,CAAC;AAclB,eAAO,MAAM,OAAO;;;;;CAwEH,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { Button } from "./button.js";
|
|
|
4
4
|
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./card.js";
|
|
5
5
|
import { Input } from "./input.js";
|
|
6
6
|
import { Label } from "./label.js";
|
|
7
|
-
import { Tabs, TabsAddButton, TabsContent, TabsList, TabsTrigger } from "./tabs.js";
|
|
7
|
+
import { Tabs, TabsAddButton, TabsContent, TabsList, TabsListDropdown, TabsTrigger } from "./tabs.js";
|
|
8
8
|
const meta = {
|
|
9
9
|
title: "Component/Tabs",
|
|
10
10
|
argTypes: {
|
|
@@ -223,6 +223,55 @@ export const Browser = {
|
|
|
223
223
|
}),
|
|
224
224
|
/*#__PURE__*/ _jsx(TabsAddButton, {
|
|
225
225
|
onClick: BrowserTabOnAdd
|
|
226
|
+
}),
|
|
227
|
+
/*#__PURE__*/ _jsx(TabsListDropdown, {
|
|
228
|
+
tabs: [
|
|
229
|
+
{
|
|
230
|
+
id: "first",
|
|
231
|
+
content: /*#__PURE__*/ _jsxs("span", {
|
|
232
|
+
className: "flex items-center gap-1",
|
|
233
|
+
children: [
|
|
234
|
+
/*#__PURE__*/ _jsx("span", {
|
|
235
|
+
className: "text-utility-green",
|
|
236
|
+
children: "GET"
|
|
237
|
+
}),
|
|
238
|
+
/*#__PURE__*/ _jsx("span", {
|
|
239
|
+
children: "/fhir/Patient"
|
|
240
|
+
})
|
|
241
|
+
]
|
|
242
|
+
})
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
id: "second",
|
|
246
|
+
content: /*#__PURE__*/ _jsxs("span", {
|
|
247
|
+
className: "flex items-center gap-1",
|
|
248
|
+
children: [
|
|
249
|
+
/*#__PURE__*/ _jsx("span", {
|
|
250
|
+
className: "text-utility-yellow",
|
|
251
|
+
children: "POST"
|
|
252
|
+
}),
|
|
253
|
+
/*#__PURE__*/ _jsx("span", {
|
|
254
|
+
children: "/fhir"
|
|
255
|
+
})
|
|
256
|
+
]
|
|
257
|
+
})
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
id: "third",
|
|
261
|
+
content: /*#__PURE__*/ _jsxs("span", {
|
|
262
|
+
className: "flex items-center gap-1",
|
|
263
|
+
children: [
|
|
264
|
+
/*#__PURE__*/ _jsx("span", {
|
|
265
|
+
className: "text-utility-yellow",
|
|
266
|
+
children: "POST"
|
|
267
|
+
}),
|
|
268
|
+
/*#__PURE__*/ _jsx("span", {
|
|
269
|
+
children: "/$graphql"
|
|
270
|
+
})
|
|
271
|
+
]
|
|
272
|
+
})
|
|
273
|
+
}
|
|
274
|
+
]
|
|
226
275
|
})
|
|
227
276
|
]
|
|
228
277
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/shadcn/components/ui/tabs.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport { action } from \"storybook/internal/actions\";\nimport { Button } from \"#shadcn/components/ui/button\";\nimport {\n\tCard,\n\tCardContent,\n\tCardDescription,\n\tCardFooter,\n\tCardHeader,\n\tCardTitle,\n} from \"#shadcn/components/ui/card\";\nimport { Input } from \"#shadcn/components/ui/input\";\nimport { Label } from \"#shadcn/components/ui/label\";\nimport {\n\tTabs,\n\tTabsAddButton,\n\tTabsContent,\n\tTabsList,\n\tTabsTrigger,\n} from \"#shadcn/components/ui/tabs\";\n\nconst meta = {\n\ttitle: \"Component/Tabs\",\n\targTypes: {\n\t\tvariant: {\n\t\t\toptions: [\"button\", \"dashed\"],\n\t\t\tcontrol: { type: \"select\" },\n\t\t},\n\t},\n} satisfies Meta;\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Demo = {\n\trender: (props) => (\n\t\t<div className=\"flex w-full max-w-sm flex-col gap-6\">\n\t\t\t<Tabs defaultValue=\"account\" {...props}>\n\t\t\t\t<TabsList>\n\t\t\t\t\t<TabsTrigger value=\"account\">Account</TabsTrigger>\n\t\t\t\t\t<TabsTrigger value=\"password\">Password</TabsTrigger>\n\t\t\t\t</TabsList>\n\t\t\t\t<TabsContent value=\"account\">\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardHeader>\n\t\t\t\t\t\t\t<CardTitle>Account</CardTitle>\n\t\t\t\t\t\t\t<CardDescription>\n\t\t\t\t\t\t\t\tMake changes to your account here. Click save when you're\n\t\t\t\t\t\t\t\tdone.\n\t\t\t\t\t\t\t</CardDescription>\n\t\t\t\t\t\t</CardHeader>\n\t\t\t\t\t\t<CardContent className=\"grid gap-6\">\n\t\t\t\t\t\t\t<div className=\"grid gap-3\">\n\t\t\t\t\t\t\t\t<Label htmlFor=\"tabs-demo-name\">Name</Label>\n\t\t\t\t\t\t\t\t<Input id=\"tabs-demo-name\" defaultValue=\"Pedro Duarte\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"grid gap-3\">\n\t\t\t\t\t\t\t\t<Label htmlFor=\"tabs-demo-username\">Username</Label>\n\t\t\t\t\t\t\t\t<Input id=\"tabs-demo-username\" defaultValue=\"@peduarte\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</CardContent>\n\t\t\t\t\t\t<CardFooter>\n\t\t\t\t\t\t\t<Button>Save changes</Button>\n\t\t\t\t\t\t</CardFooter>\n\t\t\t\t\t</Card>\n\t\t\t\t</TabsContent>\n\t\t\t\t<TabsContent value=\"password\">\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardHeader>\n\t\t\t\t\t\t\t<CardTitle>Password</CardTitle>\n\t\t\t\t\t\t\t<CardDescription>\n\t\t\t\t\t\t\t\tChange your password here. After saving, you'll be logged\n\t\t\t\t\t\t\t\tout.\n\t\t\t\t\t\t\t</CardDescription>\n\t\t\t\t\t\t</CardHeader>\n\t\t\t\t\t\t<CardContent className=\"grid gap-6\">\n\t\t\t\t\t\t\t<div className=\"grid gap-3\">\n\t\t\t\t\t\t\t\t<Label htmlFor=\"tabs-demo-current\">Current password</Label>\n\t\t\t\t\t\t\t\t<Input id=\"tabs-demo-current\" type=\"password\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"grid gap-3\">\n\t\t\t\t\t\t\t\t<Label htmlFor=\"tabs-demo-new\">New password</Label>\n\t\t\t\t\t\t\t\t<Input id=\"tabs-demo-new\" type=\"password\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</CardContent>\n\t\t\t\t\t\t<CardFooter>\n\t\t\t\t\t\t\t<Button>Save password</Button>\n\t\t\t\t\t\t</CardFooter>\n\t\t\t\t\t</Card>\n\t\t\t\t</TabsContent>\n\t\t\t</Tabs>\n\t\t</div>\n\t),\n} satisfies Story;\n\nfunction BrowserTabOnClose(value: string) {\n\taction(\"onClose\")(value);\n}\n\nfunction BrowserTabOnClick() {\n\taction(\"onClick\")();\n}\n\nfunction BrowserTabOnAdd() {\n\taction(\"onAdd\")();\n}\n\nexport const Browser = {\n\tparameters: {\n\t\tlayout: \"fullscreen\",\n\t},\n\trender: () => (\n\t\t<Tabs defaultValue=\"first\" variant=\"browser\">\n\t\t\t<TabsList>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue=\"first\"\n\t\t\t\t\tonClick={BrowserTabOnClick}\n\t\t\t\t\tonClose={BrowserTabOnClose}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"flex items-center gap-1\">\n\t\t\t\t\t\t<span className=\"text-utility-green\">GET</span>\n\t\t\t\t\t\t<span>/fhir/Patient</span>\n\t\t\t\t\t</span>\n\t\t\t\t</TabsTrigger>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue=\"second\"\n\t\t\t\t\tonClick={BrowserTabOnClick}\n\t\t\t\t\tonClose={BrowserTabOnClose}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"flex items-center gap-1\">\n\t\t\t\t\t\t<span className=\"text-utility-yellow\">POST</span>\n\t\t\t\t\t\t<span>/fhir</span>\n\t\t\t\t\t</span>\n\t\t\t\t</TabsTrigger>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue=\"third\"\n\t\t\t\t\tonClick={BrowserTabOnClick}\n\t\t\t\t\tonClose={BrowserTabOnClose}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"flex items-center gap-1\">\n\t\t\t\t\t\t<span className=\"text-utility-yellow\">POST</span>\n\t\t\t\t\t\t<span>/$graphql</span>\n\t\t\t\t\t</span>\n\t\t\t\t</TabsTrigger>\n\t\t\t</TabsList>\n\t\t\t<TabsAddButton onClick={BrowserTabOnAdd} />\n\t\t</Tabs>\n\t),\n} satisfies Story;\n"],"names":["action","Button","Card","CardContent","CardDescription","CardFooter","CardHeader","CardTitle","Input","Label","Tabs","TabsAddButton","TabsContent","TabsList","TabsTrigger","meta","title","argTypes","variant","options","control","type","Demo","render","props","div","className","defaultValue","value","htmlFor","id","BrowserTabOnClose","BrowserTabOnClick","BrowserTabOnAdd","Browser","parameters","layout","onClick","onClose","span"],"mappings":";AACA,SAASA,MAAM,QAAQ,6BAA6B;AACpD,SAASC,MAAM,QAAQ,cAA+B;AACtD,SACCC,IAAI,EACJC,WAAW,EACXC,eAAe,EACfC,UAAU,EACVC,UAAU,EACVC,SAAS,QACH,YAA6B;AACpC,SAASC,KAAK,QAAQ,aAA8B;AACpD,SAASC,KAAK,QAAQ,aAA8B;AACpD,SACCC,IAAI,EACJC,aAAa,EACbC,WAAW,EACXC,QAAQ,EACRC,WAAW,QACL,YAA6B;AAEpC,MAAMC,OAAO;IACZC,OAAO;IACPC,UAAU;QACTC,SAAS;YACRC,SAAS;gBAAC;gBAAU;aAAS;YAC7BC,SAAS;gBAAEC,MAAM;YAAS;QAC3B;IACD;AACD;AACA,eAAeN,KAAK;AAIpB,OAAO,MAAMO,OAAO;IACnBC,QAAQ,CAACC,sBACR,KAACC;YAAIC,WAAU;sBACd,cAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../../src/shadcn/components/ui/tabs.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport { action } from \"storybook/internal/actions\";\nimport { Button } from \"#shadcn/components/ui/button\";\nimport {\n\tCard,\n\tCardContent,\n\tCardDescription,\n\tCardFooter,\n\tCardHeader,\n\tCardTitle,\n} from \"#shadcn/components/ui/card\";\nimport { Input } from \"#shadcn/components/ui/input\";\nimport { Label } from \"#shadcn/components/ui/label\";\nimport {\n\tTabs,\n\tTabsAddButton,\n\tTabsContent,\n\tTabsList,\n\tTabsListDropdown,\n\tTabsTrigger,\n} from \"#shadcn/components/ui/tabs\";\n\nconst meta = {\n\ttitle: \"Component/Tabs\",\n\targTypes: {\n\t\tvariant: {\n\t\t\toptions: [\"button\", \"dashed\"],\n\t\t\tcontrol: { type: \"select\" },\n\t\t},\n\t},\n} satisfies Meta;\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Demo = {\n\trender: (props) => (\n\t\t<div className=\"flex w-full max-w-sm flex-col gap-6\">\n\t\t\t<Tabs defaultValue=\"account\" {...props}>\n\t\t\t\t<TabsList>\n\t\t\t\t\t<TabsTrigger value=\"account\">Account</TabsTrigger>\n\t\t\t\t\t<TabsTrigger value=\"password\">Password</TabsTrigger>\n\t\t\t\t</TabsList>\n\t\t\t\t<TabsContent value=\"account\">\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardHeader>\n\t\t\t\t\t\t\t<CardTitle>Account</CardTitle>\n\t\t\t\t\t\t\t<CardDescription>\n\t\t\t\t\t\t\t\tMake changes to your account here. Click save when you're\n\t\t\t\t\t\t\t\tdone.\n\t\t\t\t\t\t\t</CardDescription>\n\t\t\t\t\t\t</CardHeader>\n\t\t\t\t\t\t<CardContent className=\"grid gap-6\">\n\t\t\t\t\t\t\t<div className=\"grid gap-3\">\n\t\t\t\t\t\t\t\t<Label htmlFor=\"tabs-demo-name\">Name</Label>\n\t\t\t\t\t\t\t\t<Input id=\"tabs-demo-name\" defaultValue=\"Pedro Duarte\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"grid gap-3\">\n\t\t\t\t\t\t\t\t<Label htmlFor=\"tabs-demo-username\">Username</Label>\n\t\t\t\t\t\t\t\t<Input id=\"tabs-demo-username\" defaultValue=\"@peduarte\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</CardContent>\n\t\t\t\t\t\t<CardFooter>\n\t\t\t\t\t\t\t<Button>Save changes</Button>\n\t\t\t\t\t\t</CardFooter>\n\t\t\t\t\t</Card>\n\t\t\t\t</TabsContent>\n\t\t\t\t<TabsContent value=\"password\">\n\t\t\t\t\t<Card>\n\t\t\t\t\t\t<CardHeader>\n\t\t\t\t\t\t\t<CardTitle>Password</CardTitle>\n\t\t\t\t\t\t\t<CardDescription>\n\t\t\t\t\t\t\t\tChange your password here. After saving, you'll be logged\n\t\t\t\t\t\t\t\tout.\n\t\t\t\t\t\t\t</CardDescription>\n\t\t\t\t\t\t</CardHeader>\n\t\t\t\t\t\t<CardContent className=\"grid gap-6\">\n\t\t\t\t\t\t\t<div className=\"grid gap-3\">\n\t\t\t\t\t\t\t\t<Label htmlFor=\"tabs-demo-current\">Current password</Label>\n\t\t\t\t\t\t\t\t<Input id=\"tabs-demo-current\" type=\"password\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"grid gap-3\">\n\t\t\t\t\t\t\t\t<Label htmlFor=\"tabs-demo-new\">New password</Label>\n\t\t\t\t\t\t\t\t<Input id=\"tabs-demo-new\" type=\"password\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</CardContent>\n\t\t\t\t\t\t<CardFooter>\n\t\t\t\t\t\t\t<Button>Save password</Button>\n\t\t\t\t\t\t</CardFooter>\n\t\t\t\t\t</Card>\n\t\t\t\t</TabsContent>\n\t\t\t</Tabs>\n\t\t</div>\n\t),\n} satisfies Story;\n\nfunction BrowserTabOnClose(value: string) {\n\taction(\"onClose\")(value);\n}\n\nfunction BrowserTabOnClick() {\n\taction(\"onClick\")();\n}\n\nfunction BrowserTabOnAdd() {\n\taction(\"onAdd\")();\n}\n\nexport const Browser = {\n\tparameters: {\n\t\tlayout: \"fullscreen\",\n\t},\n\trender: () => (\n\t\t<Tabs defaultValue=\"first\" variant=\"browser\">\n\t\t\t<TabsList>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue=\"first\"\n\t\t\t\t\tonClick={BrowserTabOnClick}\n\t\t\t\t\tonClose={BrowserTabOnClose}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"flex items-center gap-1\">\n\t\t\t\t\t\t<span className=\"text-utility-green\">GET</span>\n\t\t\t\t\t\t<span>/fhir/Patient</span>\n\t\t\t\t\t</span>\n\t\t\t\t</TabsTrigger>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue=\"second\"\n\t\t\t\t\tonClick={BrowserTabOnClick}\n\t\t\t\t\tonClose={BrowserTabOnClose}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"flex items-center gap-1\">\n\t\t\t\t\t\t<span className=\"text-utility-yellow\">POST</span>\n\t\t\t\t\t\t<span>/fhir</span>\n\t\t\t\t\t</span>\n\t\t\t\t</TabsTrigger>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue=\"third\"\n\t\t\t\t\tonClick={BrowserTabOnClick}\n\t\t\t\t\tonClose={BrowserTabOnClose}\n\t\t\t\t>\n\t\t\t\t\t<span className=\"flex items-center gap-1\">\n\t\t\t\t\t\t<span className=\"text-utility-yellow\">POST</span>\n\t\t\t\t\t\t<span>/$graphql</span>\n\t\t\t\t\t</span>\n\t\t\t\t</TabsTrigger>\n\t\t\t</TabsList>\n\t\t\t<TabsAddButton onClick={BrowserTabOnAdd} />\n\t\t\t<TabsListDropdown\n\t\t\t\ttabs={[\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"first\",\n\t\t\t\t\t\tcontent: (\n\t\t\t\t\t\t\t<span className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t\t<span className=\"text-utility-green\">GET</span>\n\t\t\t\t\t\t\t\t<span>/fhir/Patient</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"second\",\n\t\t\t\t\t\tcontent: (\n\t\t\t\t\t\t\t<span className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t\t<span className=\"text-utility-yellow\">POST</span>\n\t\t\t\t\t\t\t\t<span>/fhir</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"third\",\n\t\t\t\t\t\tcontent: (\n\t\t\t\t\t\t\t<span className=\"flex items-center gap-1\">\n\t\t\t\t\t\t\t\t<span className=\"text-utility-yellow\">POST</span>\n\t\t\t\t\t\t\t\t<span>/$graphql</span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t]}\n\t\t\t/>\n\t\t</Tabs>\n\t),\n} satisfies Story;\n"],"names":["action","Button","Card","CardContent","CardDescription","CardFooter","CardHeader","CardTitle","Input","Label","Tabs","TabsAddButton","TabsContent","TabsList","TabsListDropdown","TabsTrigger","meta","title","argTypes","variant","options","control","type","Demo","render","props","div","className","defaultValue","value","htmlFor","id","BrowserTabOnClose","BrowserTabOnClick","BrowserTabOnAdd","Browser","parameters","layout","onClick","onClose","span","tabs","content"],"mappings":";AACA,SAASA,MAAM,QAAQ,6BAA6B;AACpD,SAASC,MAAM,QAAQ,cAA+B;AACtD,SACCC,IAAI,EACJC,WAAW,EACXC,eAAe,EACfC,UAAU,EACVC,UAAU,EACVC,SAAS,QACH,YAA6B;AACpC,SAASC,KAAK,QAAQ,aAA8B;AACpD,SAASC,KAAK,QAAQ,aAA8B;AACpD,SACCC,IAAI,EACJC,aAAa,EACbC,WAAW,EACXC,QAAQ,EACRC,gBAAgB,EAChBC,WAAW,QACL,YAA6B;AAEpC,MAAMC,OAAO;IACZC,OAAO;IACPC,UAAU;QACTC,SAAS;YACRC,SAAS;gBAAC;gBAAU;aAAS;YAC7BC,SAAS;gBAAEC,MAAM;YAAS;QAC3B;IACD;AACD;AACA,eAAeN,KAAK;AAIpB,OAAO,MAAMO,OAAO;IACnBC,QAAQ,CAACC,sBACR,KAACC;YAAIC,WAAU;sBACd,cAAA,MAACjB;gBAAKkB,cAAa;gBAAW,GAAGH,KAAK;;kCACrC,MAACZ;;0CACA,KAACE;gCAAYc,OAAM;0CAAU;;0CAC7B,KAACd;gCAAYc,OAAM;0CAAW;;;;kCAE/B,KAACjB;wBAAYiB,OAAM;kCAClB,cAAA,MAAC3B;;8CACA,MAACI;;sDACA,KAACC;sDAAU;;sDACX,KAACH;sDAAgB;;;;8CAKlB,MAACD;oCAAYwB,WAAU;;sDACtB,MAACD;4CAAIC,WAAU;;8DACd,KAAClB;oDAAMqB,SAAQ;8DAAiB;;8DAChC,KAACtB;oDAAMuB,IAAG;oDAAiBH,cAAa;;;;sDAEzC,MAACF;4CAAIC,WAAU;;8DACd,KAAClB;oDAAMqB,SAAQ;8DAAqB;;8DACpC,KAACtB;oDAAMuB,IAAG;oDAAqBH,cAAa;;;;;;8CAG9C,KAACvB;8CACA,cAAA,KAACJ;kDAAO;;;;;;kCAIX,KAACW;wBAAYiB,OAAM;kCAClB,cAAA,MAAC3B;;8CACA,MAACI;;sDACA,KAACC;sDAAU;;sDACX,KAACH;sDAAgB;;;;8CAKlB,MAACD;oCAAYwB,WAAU;;sDACtB,MAACD;4CAAIC,WAAU;;8DACd,KAAClB;oDAAMqB,SAAQ;8DAAoB;;8DACnC,KAACtB;oDAAMuB,IAAG;oDAAoBT,MAAK;;;;sDAEpC,MAACI;4CAAIC,WAAU;;8DACd,KAAClB;oDAAMqB,SAAQ;8DAAgB;;8DAC/B,KAACtB;oDAAMuB,IAAG;oDAAgBT,MAAK;;;;;;8CAGjC,KAACjB;8CACA,cAAA,KAACJ;kDAAO;;;;;;;;;AAOf,EAAkB;AAElB,SAAS+B,kBAAkBH,KAAa;IACvC7B,OAAO,WAAW6B;AACnB;AAEA,SAASI;IACRjC,OAAO;AACR;AAEA,SAASkC;IACRlC,OAAO;AACR;AAEA,OAAO,MAAMmC,UAAU;IACtBC,YAAY;QACXC,QAAQ;IACT;IACAb,QAAQ,kBACP,MAACd;YAAKkB,cAAa;YAAQT,SAAQ;;8BAClC,MAACN;;sCACA,KAACE;4BACAc,OAAM;4BACNS,SAASL;4BACTM,SAASP;sCAET,cAAA,MAACQ;gCAAKb,WAAU;;kDACf,KAACa;wCAAKb,WAAU;kDAAqB;;kDACrC,KAACa;kDAAK;;;;;sCAGR,KAACzB;4BACAc,OAAM;4BACNS,SAASL;4BACTM,SAASP;sCAET,cAAA,MAACQ;gCAAKb,WAAU;;kDACf,KAACa;wCAAKb,WAAU;kDAAsB;;kDACtC,KAACa;kDAAK;;;;;sCAGR,KAACzB;4BACAc,OAAM;4BACNS,SAASL;4BACTM,SAASP;sCAET,cAAA,MAACQ;gCAAKb,WAAU;;kDACf,KAACa;wCAAKb,WAAU;kDAAsB;;kDACtC,KAACa;kDAAK;;;;;;;8BAIT,KAAC7B;oBAAc2B,SAASJ;;8BACxB,KAACpB;oBACA2B,MAAM;wBACL;4BACCV,IAAI;4BACJW,uBACC,MAACF;gCAAKb,WAAU;;kDACf,KAACa;wCAAKb,WAAU;kDAAqB;;kDACrC,KAACa;kDAAK;;;;wBAGT;wBACA;4BACCT,IAAI;4BACJW,uBACC,MAACF;gCAAKb,WAAU;;kDACf,KAACa;wCAAKb,WAAU;kDAAsB;;kDACtC,KAACa;kDAAK;;;;wBAGT;wBACA;4BACCT,IAAI;4BACJW,uBACC,MAACF;gCAAKb,WAAU;;kDACf,KAACa;wCAAKb,WAAU;kDAAsB;;kDACtC,KAACa;kDAAK;;;;wBAGT;qBACA;;;;AAIL,EAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AA6CpC,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,2CAQ1E;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "../../lib/utils.js";
|
|
3
|
+
// Textarea styles
|
|
4
|
+
const textareaStyles = cn(// Layout
|
|
5
|
+
"flex", "w-full", "min-h-16", "field-sizing-content", // Shape
|
|
6
|
+
"rounded-md", // Borders
|
|
7
|
+
"border", "border-border-primary", // Background & Colors
|
|
8
|
+
"bg-transparent", "text-base", // Spacing
|
|
9
|
+
"px-3", "py-2", // Typography
|
|
10
|
+
"md:text-sm", // Placeholder
|
|
11
|
+
"placeholder:text-text-tertiary", // Transitions
|
|
12
|
+
"transition-[color,box-shadow]", "outline-none", // Hover
|
|
13
|
+
"hover:border-border-primary_hover", // Focus
|
|
14
|
+
"focus-visible:border-border-link", "focus-visible:ring-2", "focus-visible:ring-utility-blue/70", // Invalid
|
|
15
|
+
"aria-invalid:border-border-error", "aria-invalid:ring-2", "aria-invalid:ring-utility-red/70", // Disabled
|
|
16
|
+
"disabled:cursor-not-allowed", "disabled:opacity-50", "disabled:border-border-disabled");
|
|
3
17
|
function Textarea({ className, ...props }) {
|
|
4
18
|
return /*#__PURE__*/ _jsx("textarea", {
|
|
5
19
|
"data-slot": "textarea",
|
|
6
|
-
className: cn(
|
|
20
|
+
className: cn(textareaStyles, className),
|
|
7
21
|
...props
|
|
8
22
|
});
|
|
9
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/shadcn/components/ui/textarea.tsx"],"sourcesContent":["import type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\
|
|
1
|
+
{"version":3,"sources":["../../../../../src/shadcn/components/ui/textarea.tsx"],"sourcesContent":["import type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\n// Textarea styles\nconst textareaStyles = cn(\n\t// Layout\n\t\"flex\",\n\t\"w-full\",\n\t\"min-h-16\",\n\t\"field-sizing-content\",\n\t// Shape\n\t\"rounded-md\",\n\t// Borders\n\t\"border\",\n\t\"border-border-primary\",\n\t// Background & Colors\n\t\"bg-transparent\",\n\t\"text-base\",\n\t// Spacing\n\t\"px-3\",\n\t\"py-2\",\n\t// Typography\n\t\"md:text-sm\",\n\t// Placeholder\n\t\"placeholder:text-text-tertiary\",\n\t// Transitions\n\t\"transition-[color,box-shadow]\",\n\t\"outline-none\",\n\t// Hover\n\t\"hover:border-border-primary_hover\",\n\t// Focus\n\t\"focus-visible:border-border-link\",\n\t\"focus-visible:ring-2\",\n\t\"focus-visible:ring-utility-blue/70\",\n\t// Invalid\n\t\"aria-invalid:border-border-error\",\n\t\"aria-invalid:ring-2\",\n\t\"aria-invalid:ring-utility-red/70\",\n\t// Disabled\n\t\"disabled:cursor-not-allowed\",\n\t\"disabled:opacity-50\",\n\t\"disabled:border-border-disabled\",\n);\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n\treturn (\n\t\t<textarea\n\t\t\tdata-slot=\"textarea\"\n\t\t\tclassName={cn(textareaStyles, className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Textarea };\n"],"names":["cn","textareaStyles","Textarea","className","props","textarea","data-slot"],"mappings":";AAEA,SAASA,EAAE,QAAQ,qBAAoB;AAEvC,kBAAkB;AAClB,MAAMC,iBAAiBD,GACtB,SAAS;AACT,QACA,UACA,YACA,wBACA,QAAQ;AACR,cACA,UAAU;AACV,UACA,yBACA,sBAAsB;AACtB,kBACA,aACA,UAAU;AACV,QACA,QACA,aAAa;AACb,cACA,cAAc;AACd,kCACA,cAAc;AACd,iCACA,gBACA,QAAQ;AACR,qCACA,QAAQ;AACR,oCACA,wBACA,sCACA,UAAU;AACV,oCACA,uBACA,oCACA,WAAW;AACX,+BACA,uBACA;AAGD,SAASE,SAAS,EAAEC,SAAS,EAAE,GAAGC,OAAyC;IAC1E,qBACC,KAACC;QACAC,aAAU;QACVH,WAAWH,GAAGC,gBAAgBE;QAC7B,GAAGC,KAAK;;AAGZ;AAEA,SAASF,QAAQ,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/toggle-group.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/toggle-group.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAmC9D,iBAAS,WAAW,CAAC,EACpB,SAAS,EACT,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GACxD,YAAY,CAAC,OAAO,cAAc,CAAC,2CAcnC;AAED,iBAAS,eAAe,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GACxD,YAAY,CAAC,OAAO,cAAc,CAAC,2CAqBnC;AAED,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
3
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
3
4
|
import * as React from "react";
|
|
4
5
|
import { toggleVariants } from "./toggle.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
7
|
+
// Toggle group styles
|
|
8
|
+
const toggleGroupStyles = cn("group/toggle-group", "flex", "w-fit", "items-center", "rounded-md", "data-[variant=outline]:shadow-xs");
|
|
9
|
+
// Toggle group item styles
|
|
10
|
+
const toggleGroupItemStyles = cn("min-w-0", "flex-1", "shrink-0", "rounded-none", "shadow-none", "first:rounded-l-md", "last:rounded-r-md", "focus:z-10", "focus-visible:z-10", "data-[variant=outline]:border-l-0", "data-[variant=outline]:first:border-l");
|
|
6
11
|
const ToggleGroupContext = /*#__PURE__*/ React.createContext({
|
|
7
12
|
size: "default",
|
|
8
13
|
variant: "default"
|
|
@@ -12,7 +17,7 @@ function ToggleGroup({ className, variant, size, children, ...props }) {
|
|
|
12
17
|
"data-slot": "toggle-group",
|
|
13
18
|
"data-variant": variant,
|
|
14
19
|
"data-size": size,
|
|
15
|
-
className: cn(
|
|
20
|
+
className: cn(toggleGroupStyles, className),
|
|
16
21
|
...props,
|
|
17
22
|
children: /*#__PURE__*/ _jsx(ToggleGroupContext.Provider, {
|
|
18
23
|
value: {
|
|
@@ -32,7 +37,7 @@ function ToggleGroupItem({ className, children, variant, size, ...props }) {
|
|
|
32
37
|
className: cn(toggleVariants({
|
|
33
38
|
variant: context.variant || variant,
|
|
34
39
|
size: context.size || size
|
|
35
|
-
}),
|
|
40
|
+
}), toggleGroupItemStyles, className),
|
|
36
41
|
...props,
|
|
37
42
|
children: children
|
|
38
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/shadcn/components/ui/toggle-group.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../../../src/shadcn/components/ui/toggle-group.tsx"],"sourcesContent":["\"use client\";\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport { toggleVariants } from \"#shadcn/components/ui/toggle\";\nimport { cn } from \"#shadcn/lib/utils\";\n\n// Toggle group styles\nconst toggleGroupStyles = cn(\n\t\"group/toggle-group\",\n\t\"flex\",\n\t\"w-fit\",\n\t\"items-center\",\n\t\"rounded-md\",\n\t\"data-[variant=outline]:shadow-xs\",\n);\n\n// Toggle group item styles\nconst toggleGroupItemStyles = cn(\n\t\"min-w-0\",\n\t\"flex-1\",\n\t\"shrink-0\",\n\t\"rounded-none\",\n\t\"shadow-none\",\n\t\"first:rounded-l-md\",\n\t\"last:rounded-r-md\",\n\t\"focus:z-10\",\n\t\"focus-visible:z-10\",\n\t\"data-[variant=outline]:border-l-0\",\n\t\"data-[variant=outline]:first:border-l\",\n);\n\nconst ToggleGroupContext = React.createContext<\n\tVariantProps<typeof toggleVariants>\n>({\n\tsize: \"default\",\n\tvariant: \"default\",\n});\n\nfunction ToggleGroup({\n\tclassName,\n\tvariant,\n\tsize,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &\n\tVariantProps<typeof toggleVariants>) {\n\treturn (\n\t\t<ToggleGroupPrimitive.Root\n\t\t\tdata-slot=\"toggle-group\"\n\t\t\tdata-variant={variant}\n\t\t\tdata-size={size}\n\t\t\tclassName={cn(toggleGroupStyles, className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<ToggleGroupContext.Provider value={{ variant, size }}>\n\t\t\t\t{children}\n\t\t\t</ToggleGroupContext.Provider>\n\t\t</ToggleGroupPrimitive.Root>\n\t);\n}\n\nfunction ToggleGroupItem({\n\tclassName,\n\tchildren,\n\tvariant,\n\tsize,\n\t...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &\n\tVariantProps<typeof toggleVariants>) {\n\tconst context = React.useContext(ToggleGroupContext);\n\n\treturn (\n\t\t<ToggleGroupPrimitive.Item\n\t\t\tdata-slot=\"toggle-group-item\"\n\t\t\tdata-variant={context.variant || variant}\n\t\t\tdata-size={context.size || size}\n\t\t\tclassName={cn(\n\t\t\t\ttoggleVariants({\n\t\t\t\t\tvariant: context.variant || variant,\n\t\t\t\t\tsize: context.size || size,\n\t\t\t\t}),\n\t\t\t\ttoggleGroupItemStyles,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</ToggleGroupPrimitive.Item>\n\t);\n}\n\nexport { ToggleGroup, ToggleGroupItem };\n"],"names":["ToggleGroupPrimitive","React","toggleVariants","cn","toggleGroupStyles","toggleGroupItemStyles","ToggleGroupContext","createContext","size","variant","ToggleGroup","className","children","props","Root","data-slot","data-variant","data-size","Provider","value","ToggleGroupItem","context","useContext","Item"],"mappings":"AAAA;;AACA,YAAYA,0BAA0B,+BAA+B;AAErE,YAAYC,WAAW,QAAQ;AAC/B,SAASC,cAAc,QAAQ,cAA+B;AAC9D,SAASC,EAAE,QAAQ,qBAAoB;AAEvC,sBAAsB;AACtB,MAAMC,oBAAoBD,GACzB,sBACA,QACA,SACA,gBACA,cACA;AAGD,2BAA2B;AAC3B,MAAME,wBAAwBF,GAC7B,WACA,UACA,YACA,gBACA,eACA,sBACA,qBACA,cACA,sBACA,qCACA;AAGD,MAAMG,mCAAqBL,MAAMM,aAAa,CAE5C;IACDC,MAAM;IACNC,SAAS;AACV;AAEA,SAASC,YAAY,EACpBC,SAAS,EACTF,OAAO,EACPD,IAAI,EACJI,QAAQ,EACR,GAAGC,OAEgC;IACnC,qBACC,KAACb,qBAAqBc,IAAI;QACzBC,aAAU;QACVC,gBAAcP;QACdQ,aAAWT;QACXG,WAAWR,GAAGC,mBAAmBO;QAChC,GAAGE,KAAK;kBAET,cAAA,KAACP,mBAAmBY,QAAQ;YAACC,OAAO;gBAAEV;gBAASD;YAAK;sBAClDI;;;AAIL;AAEA,SAASQ,gBAAgB,EACxBT,SAAS,EACTC,QAAQ,EACRH,OAAO,EACPD,IAAI,EACJ,GAAGK,OAEgC;IACnC,MAAMQ,UAAUpB,MAAMqB,UAAU,CAAChB;IAEjC,qBACC,KAACN,qBAAqBuB,IAAI;QACzBR,aAAU;QACVC,gBAAcK,QAAQZ,OAAO,IAAIA;QACjCQ,aAAWI,QAAQb,IAAI,IAAIA;QAC3BG,WAAWR,GACVD,eAAe;YACdO,SAASY,QAAQZ,OAAO,IAAIA;YAC5BD,MAAMa,QAAQb,IAAI,IAAIA;QACvB,IACAH,uBACAM;QAEA,GAAGE,KAAK;kBAERD;;AAGJ;AAEA,SAASF,WAAW,EAAEU,eAAe,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AA0CpC,QAAA,MAAM,cAAc;;;8EAuBlB,CAAC;AAEH,iBAAS,MAAM,CAAC,EACf,SAAS,EACT,OAAO,EACP,IAAI,EACJ,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,GACnD,YAAY,CAAC,OAAO,cAAc,CAAC,2CAQnC;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -2,16 +2,28 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
|
-
|
|
5
|
+
// Base toggle styles
|
|
6
|
+
const baseToggleStyles = cn(// Layout
|
|
7
|
+
"inline-flex", "items-center", "justify-center", "gap-2", "whitespace-nowrap", // Shape
|
|
8
|
+
"rounded-md", // Typography
|
|
9
|
+
"text-sm", "font-medium", // Interaction
|
|
10
|
+
"outline-none", "transition-[color,box-shadow]", // Hover
|
|
11
|
+
"hover:bg-bg-tertiary", "hover:text-text-secondary", // Pressed/On state
|
|
12
|
+
"data-[state=on]:bg-bg-secondary", "data-[state=on]:text-text-primary", // Disabled
|
|
13
|
+
"disabled:pointer-events-none", "disabled:opacity-50", // SVG icons
|
|
14
|
+
"[&_svg]:pointer-events-none", "[&_svg:not([class*='size-'])]:size-4", "[&_svg]:shrink-0", // Focus
|
|
15
|
+
"focus-visible:ring-2", "focus-visible:ring-utility-blue/70", // Invalid
|
|
16
|
+
"aria-invalid:ring-2", "aria-invalid:ring-utility-red/70", "aria-invalid:border-border-error");
|
|
17
|
+
const toggleVariants = cva(baseToggleStyles, {
|
|
6
18
|
variants: {
|
|
7
19
|
variant: {
|
|
8
|
-
default: "bg-transparent",
|
|
9
|
-
outline: "border border-
|
|
20
|
+
default: cn("bg-transparent"),
|
|
21
|
+
outline: cn("border", "border-border-primary", "bg-transparent", "shadow-xs", "hover:bg-bg-secondary", "hover:text-text-primary")
|
|
10
22
|
},
|
|
11
23
|
size: {
|
|
12
|
-
default: "h-9 px-2 min-w-9",
|
|
13
|
-
sm: "h-8 px-1.5 min-w-8",
|
|
14
|
-
lg: "h-10 px-2.5 min-w-10"
|
|
24
|
+
default: cn("h-9", "px-2", "min-w-9"),
|
|
25
|
+
sm: cn("h-8", "px-1.5", "min-w-8"),
|
|
26
|
+
lg: cn("h-10", "px-2.5", "min-w-10")
|
|
15
27
|
}
|
|
16
28
|
},
|
|
17
29
|
defaultVariants: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/shadcn/components/ui/toggle.tsx"],"sourcesContent":["import * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\nconst
|
|
1
|
+
{"version":3,"sources":["../../../../../src/shadcn/components/ui/toggle.tsx"],"sourcesContent":["import * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\n// Base toggle styles\nconst baseToggleStyles = cn(\n\t// Layout\n\t\"inline-flex\",\n\t\"items-center\",\n\t\"justify-center\",\n\t\"gap-2\",\n\t\"whitespace-nowrap\",\n\t// Shape\n\t\"rounded-md\",\n\t// Typography\n\t\"text-sm\",\n\t\"font-medium\",\n\t// Interaction\n\t\"outline-none\",\n\t\"transition-[color,box-shadow]\",\n\t// Hover\n\t\"hover:bg-bg-tertiary\",\n\t\"hover:text-text-secondary\",\n\t// Pressed/On state\n\t\"data-[state=on]:bg-bg-secondary\",\n\t\"data-[state=on]:text-text-primary\",\n\t// Disabled\n\t\"disabled:pointer-events-none\",\n\t\"disabled:opacity-50\",\n\t// SVG icons\n\t\"[&_svg]:pointer-events-none\",\n\t\"[&_svg:not([class*='size-'])]:size-4\",\n\t\"[&_svg]:shrink-0\",\n\t// Focus\n\t\"focus-visible:ring-2\",\n\t\"focus-visible:ring-utility-blue/70\",\n\t// Invalid\n\t\"aria-invalid:ring-2\",\n\t\"aria-invalid:ring-utility-red/70\",\n\t\"aria-invalid:border-border-error\",\n);\n\nconst toggleVariants = cva(baseToggleStyles, {\n\tvariants: {\n\t\tvariant: {\n\t\t\tdefault: cn(\"bg-transparent\"),\n\t\t\toutline: cn(\n\t\t\t\t\"border\",\n\t\t\t\t\"border-border-primary\",\n\t\t\t\t\"bg-transparent\",\n\t\t\t\t\"shadow-xs\",\n\t\t\t\t\"hover:bg-bg-secondary\",\n\t\t\t\t\"hover:text-text-primary\",\n\t\t\t),\n\t\t},\n\t\tsize: {\n\t\t\tdefault: cn(\"h-9\", \"px-2\", \"min-w-9\"),\n\t\t\tsm: cn(\"h-8\", \"px-1.5\", \"min-w-8\"),\n\t\t\tlg: cn(\"h-10\", \"px-2.5\", \"min-w-10\"),\n\t\t},\n\t},\n\tdefaultVariants: {\n\t\tvariant: \"default\",\n\t\tsize: \"default\",\n\t},\n});\n\nfunction Toggle({\n\tclassName,\n\tvariant,\n\tsize,\n\t...props\n}: React.ComponentProps<typeof TogglePrimitive.Root> &\n\tVariantProps<typeof toggleVariants>) {\n\treturn (\n\t\t<TogglePrimitive.Root\n\t\t\tdata-slot=\"toggle\"\n\t\t\tclassName={cn(toggleVariants({ variant, size, className }))}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Toggle, toggleVariants };\n"],"names":["TogglePrimitive","cva","cn","baseToggleStyles","toggleVariants","variants","variant","default","outline","size","sm","lg","defaultVariants","Toggle","className","props","Root","data-slot"],"mappings":";AAAA,YAAYA,qBAAqB,yBAAyB;AAC1D,SAASC,GAAG,QAA2B,2BAA2B;AAGlE,SAASC,EAAE,QAAQ,qBAAoB;AAEvC,qBAAqB;AACrB,MAAMC,mBAAmBD,GACxB,SAAS;AACT,eACA,gBACA,kBACA,SACA,qBACA,QAAQ;AACR,cACA,aAAa;AACb,WACA,eACA,cAAc;AACd,gBACA,iCACA,QAAQ;AACR,wBACA,6BACA,mBAAmB;AACnB,mCACA,qCACA,WAAW;AACX,gCACA,uBACA,YAAY;AACZ,+BACA,wCACA,oBACA,QAAQ;AACR,wBACA,sCACA,UAAU;AACV,uBACA,oCACA;AAGD,MAAME,iBAAiBH,IAAIE,kBAAkB;IAC5CE,UAAU;QACTC,SAAS;YACRC,SAASL,GAAG;YACZM,SAASN,GACR,UACA,yBACA,kBACA,aACA,yBACA;QAEF;QACAO,MAAM;YACLF,SAASL,GAAG,OAAO,QAAQ;YAC3BQ,IAAIR,GAAG,OAAO,UAAU;YACxBS,IAAIT,GAAG,QAAQ,UAAU;QAC1B;IACD;IACAU,iBAAiB;QAChBN,SAAS;QACTG,MAAM;IACP;AACD;AAEA,SAASI,OAAO,EACfC,SAAS,EACTR,OAAO,EACPG,IAAI,EACJ,GAAGM,OAEgC;IACnC,qBACC,KAACf,gBAAgBgB,IAAI;QACpBC,aAAU;QACVH,WAAWZ,GAAGE,eAAe;YAAEE;YAASG;YAAMK;QAAU;QACvD,GAAGC,KAAK;;AAGZ;AAEA,SAASF,MAAM,EAAET,cAAc,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAoCpC,iBAAS,eAAe,CAAC,EACxB,aAAiB,EACjB,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,2CAQxD;AAED,iBAAS,OAAO,CAAC,EAChB,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAMpD;AAED,iBAAS,cAAc,CAAC,EACvB,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,2CAEvD;AAED,iBAAS,cAAc,CAAC,EACvB,SAAS,EACT,UAAc,EACd,QAAQ,EACR,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,2CAavD;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4
4
|
import { cn } from "../../lib/utils.js";
|
|
5
|
+
// Tooltip content styles
|
|
6
|
+
const tooltipContentStyles = cn(// Layout
|
|
7
|
+
"z-50", "w-fit", "origin-(--radix-tooltip-content-transform-origin)", // Shape
|
|
8
|
+
"rounded-md", // Background & Colors
|
|
9
|
+
"bg-bg-overlay", "text-text-primary_on-brand", // Spacing
|
|
10
|
+
"px-3", "py-1.5", // Typography
|
|
11
|
+
"text-xs", "text-balance", // Animations - open
|
|
12
|
+
"animate-in", "fade-in-0", "zoom-in-95", // Animations - closed
|
|
13
|
+
"data-[state=closed]:animate-out", "data-[state=closed]:fade-out-0", "data-[state=closed]:zoom-out-95", // Slide animations
|
|
14
|
+
"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");
|
|
5
15
|
function TooltipProvider({ delayDuration = 0, ...props }) {
|
|
6
16
|
return /*#__PURE__*/ _jsx(TooltipPrimitive.Provider, {
|
|
7
17
|
"data-slot": "tooltip-provider",
|
|
@@ -28,7 +38,7 @@ function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
|
28
38
|
children: /*#__PURE__*/ _jsx(TooltipPrimitive.Content, {
|
|
29
39
|
"data-slot": "tooltip-content",
|
|
30
40
|
sideOffset: sideOffset,
|
|
31
|
-
className: cn(
|
|
41
|
+
className: cn(tooltipContentStyles, className),
|
|
32
42
|
...props,
|
|
33
43
|
children: children
|
|
34
44
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/shadcn/components/ui/tooltip.tsx"],"sourcesContent":["\"use client\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\nfunction TooltipProvider({\n\tdelayDuration = 0,\n\t...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n\treturn (\n\t\t<TooltipPrimitive.Provider\n\t\t\tdata-slot=\"tooltip-provider\"\n\t\t\tdelayDuration={delayDuration}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction Tooltip({\n\t...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n\t\t</TooltipProvider>\n\t);\n}\n\nfunction TooltipTrigger({\n\t...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n\treturn <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n\tclassName,\n\tsideOffset = 0,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n\treturn (\n\t\t<TooltipPrimitive.Portal>\n\t\t\t<TooltipPrimitive.Content\n\t\t\t\tdata-slot=\"tooltip-content\"\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={cn(
|
|
1
|
+
{"version":3,"sources":["../../../../../src/shadcn/components/ui/tooltip.tsx"],"sourcesContent":["\"use client\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport type * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\n// Tooltip content styles\nconst tooltipContentStyles = cn(\n\t// Layout\n\t\"z-50\",\n\t\"w-fit\",\n\t\"origin-(--radix-tooltip-content-transform-origin)\",\n\t// Shape\n\t\"rounded-md\",\n\t// Background & Colors\n\t\"bg-bg-overlay\",\n\t\"text-text-primary_on-brand\",\n\t// Spacing\n\t\"px-3\",\n\t\"py-1.5\",\n\t// Typography\n\t\"text-xs\",\n\t\"text-balance\",\n\t// Animations - open\n\t\"animate-in\",\n\t\"fade-in-0\",\n\t\"zoom-in-95\",\n\t// Animations - closed\n\t\"data-[state=closed]:animate-out\",\n\t\"data-[state=closed]:fade-out-0\",\n\t\"data-[state=closed]:zoom-out-95\",\n\t// Slide animations\n\t\"data-[side=bottom]:slide-in-from-top-2\",\n\t\"data-[side=left]:slide-in-from-right-2\",\n\t\"data-[side=right]:slide-in-from-left-2\",\n\t\"data-[side=top]:slide-in-from-bottom-2\",\n);\n\nfunction TooltipProvider({\n\tdelayDuration = 0,\n\t...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n\treturn (\n\t\t<TooltipPrimitive.Provider\n\t\t\tdata-slot=\"tooltip-provider\"\n\t\t\tdelayDuration={delayDuration}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction Tooltip({\n\t...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />\n\t\t</TooltipProvider>\n\t);\n}\n\nfunction TooltipTrigger({\n\t...props\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n\treturn <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipContent({\n\tclassName,\n\tsideOffset = 0,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n\treturn (\n\t\t<TooltipPrimitive.Portal>\n\t\t\t<TooltipPrimitive.Content\n\t\t\t\tdata-slot=\"tooltip-content\"\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={cn(tooltipContentStyles, className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</TooltipPrimitive.Content>\n\t\t</TooltipPrimitive.Portal>\n\t);\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"],"names":["TooltipPrimitive","cn","tooltipContentStyles","TooltipProvider","delayDuration","props","Provider","data-slot","Tooltip","Root","TooltipTrigger","Trigger","TooltipContent","className","sideOffset","children","Portal","Content"],"mappings":"AAAA;;AACA,YAAYA,sBAAsB,0BAA0B;AAG5D,SAASC,EAAE,QAAQ,qBAAoB;AAEvC,yBAAyB;AACzB,MAAMC,uBAAuBD,GAC5B,SAAS;AACT,QACA,SACA,qDACA,QAAQ;AACR,cACA,sBAAsB;AACtB,iBACA,8BACA,UAAU;AACV,QACA,UACA,aAAa;AACb,WACA,gBACA,oBAAoB;AACpB,cACA,aACA,cACA,sBAAsB;AACtB,mCACA,kCACA,mCACA,mBAAmB;AACnB,0CACA,0CACA,0CACA;AAGD,SAASE,gBAAgB,EACxBC,gBAAgB,CAAC,EACjB,GAAGC,OACqD;IACxD,qBACC,KAACL,iBAAiBM,QAAQ;QACzBC,aAAU;QACVH,eAAeA;QACd,GAAGC,KAAK;;AAGZ;AAEA,SAASG,QAAQ,EAChB,GAAGH,OACiD;IACpD,qBACC,KAACF;kBACA,cAAA,KAACH,iBAAiBS,IAAI;YAACF,aAAU;YAAW,GAAGF,KAAK;;;AAGvD;AAEA,SAASK,eAAe,EACvB,GAAGL,OACoD;IACvD,qBAAO,KAACL,iBAAiBW,OAAO;QAACJ,aAAU;QAAmB,GAAGF,KAAK;;AACvE;AAEA,SAASO,eAAe,EACvBC,SAAS,EACTC,aAAa,CAAC,EACdC,QAAQ,EACR,GAAGV,OACoD;IACvD,qBACC,KAACL,iBAAiBgB,MAAM;kBACvB,cAAA,KAAChB,iBAAiBiB,OAAO;YACxBV,aAAU;YACVO,YAAYA;YACZD,WAAWZ,GAAGC,sBAAsBW;YACnC,GAAGR,KAAK;sBAERU;;;AAIL;AAEA,SAASP,OAAO,EAAEE,cAAc,EAAEE,cAAc,EAAET,eAAe,GAAG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ItemInstance } from "@headless-tree/core";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
interface TreeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
indent?: number;
|
|
5
|
+
tree?: any;
|
|
6
|
+
}
|
|
7
|
+
declare function Tree({ indent, tree, className, ...props }: TreeProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
interface TreeItemProps<T = any> extends React.HTMLAttributes<HTMLButtonElement> {
|
|
9
|
+
item: ItemInstance<T>;
|
|
10
|
+
indent?: number;
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare function TreeItem<T = any>({ item, className, asChild, children, ...props }: Omit<TreeItemProps<T>, "indent">): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
interface TreeItemLabelProps<T = any> extends React.HTMLAttributes<HTMLSpanElement> {
|
|
15
|
+
item?: ItemInstance<T>;
|
|
16
|
+
}
|
|
17
|
+
declare function TreeItemLabel<T = any>({ item: propItem, children, className, ...props }: TreeItemLabelProps<T>): import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
declare function TreeDragLine({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
export { Tree, TreeItem, TreeItemLabel, TreeDragLine };
|
|
20
|
+
//# sourceMappingURL=tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../../../src/shadcn/components/ui/tree.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqB/B,UAAU,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,IAAI,CAAC,EAAE,GAAG,CAAC;CACX;AAED,iBAAS,IAAI,CAAC,EAAE,MAAW,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CA2BlE;AAGD,UAAU,aAAa,CAAC,CAAC,GAAG,GAAG,CAC9B,SAAQ,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC;IAC/C,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAGD,iBAAS,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,EAC1B,IAAI,EACJ,SAAS,EACT,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACR,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,2CA0DlC;AAGD,UAAU,kBAAkB,CAAC,CAAC,GAAG,GAAG,CACnC,SAAQ,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC;IAC7C,IAAI,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;CACvB;AAGD,iBAAS,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,EAC/B,IAAI,EAAE,QAAQ,EACd,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACR,EAAE,kBAAkB,CAAC,CAAC,CAAC,kDAyBvB;AAED,iBAAS,YAAY,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACR,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,kDAqBtC;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
const TreeContext = /*#__PURE__*/ React.createContext({
|
|
7
|
+
indent: 20
|
|
8
|
+
});
|
|
9
|
+
// biome-ignore lint/suspicious/noExplicitAny: FIXME Origin UI as-is
|
|
10
|
+
function useTreeContext() {
|
|
11
|
+
return React.useContext(TreeContext);
|
|
12
|
+
}
|
|
13
|
+
function Tree({ indent = 20, tree, className, ...props }) {
|
|
14
|
+
const containerProps = tree && typeof tree.getContainerProps === "function" ? tree.getContainerProps() : {};
|
|
15
|
+
const mergedProps = {
|
|
16
|
+
...props,
|
|
17
|
+
...containerProps
|
|
18
|
+
};
|
|
19
|
+
// Extract style from mergedProps to merge with our custom styles
|
|
20
|
+
const { style: propStyle, ...otherProps } = mergedProps;
|
|
21
|
+
// Merge styles
|
|
22
|
+
const mergedStyle = {
|
|
23
|
+
...propStyle,
|
|
24
|
+
"--tree-indent": `${indent}px`,
|
|
25
|
+
"--border": `var(--color-fg-disabled)`
|
|
26
|
+
};
|
|
27
|
+
return /*#__PURE__*/ _jsx(TreeContext.Provider, {
|
|
28
|
+
value: {
|
|
29
|
+
indent,
|
|
30
|
+
tree
|
|
31
|
+
},
|
|
32
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
33
|
+
"data-slot": "tree",
|
|
34
|
+
style: mergedStyle,
|
|
35
|
+
className: cn("flex flex-col", className),
|
|
36
|
+
...otherProps
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
// biome-ignore lint/suspicious/noExplicitAny: FIXME Origin UI as-is
|
|
41
|
+
function TreeItem({ item, className, asChild, children, ...props }) {
|
|
42
|
+
const { indent } = useTreeContext();
|
|
43
|
+
const itemProps = typeof item.getProps === "function" ? item.getProps() : {};
|
|
44
|
+
const mergedProps = {
|
|
45
|
+
...props,
|
|
46
|
+
...itemProps
|
|
47
|
+
};
|
|
48
|
+
// Extract style from mergedProps to merge with our custom styles
|
|
49
|
+
const { style: propStyle, ...otherProps } = mergedProps;
|
|
50
|
+
// Merge styles
|
|
51
|
+
const mergedStyle = {
|
|
52
|
+
...propStyle,
|
|
53
|
+
"--tree-padding": `${item.getItemMeta().level * indent}px`
|
|
54
|
+
};
|
|
55
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
56
|
+
return /*#__PURE__*/ _jsx(TreeContext.Provider, {
|
|
57
|
+
value: {
|
|
58
|
+
indent,
|
|
59
|
+
currentItem: item
|
|
60
|
+
},
|
|
61
|
+
children: /*#__PURE__*/ _jsx(Comp, {
|
|
62
|
+
"data-slot": "tree-item",
|
|
63
|
+
style: mergedStyle,
|
|
64
|
+
className: cn("z-10 ps-(--tree-padding) outline-hidden select-none focus:z-20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
65
|
+
"data-focus": typeof item.isFocused === "function" ? item.isFocused() || false : undefined,
|
|
66
|
+
"data-folder": typeof item.isFolder === "function" ? item.isFolder() || false : undefined,
|
|
67
|
+
"data-selected": typeof item.isSelected === "function" ? item.isSelected() || false : undefined,
|
|
68
|
+
"data-drag-target": typeof item.isDragTarget === "function" ? item.isDragTarget() || false : undefined,
|
|
69
|
+
"data-search-match": typeof item.isMatchingSearch === "function" ? item.isMatchingSearch() || false : undefined,
|
|
70
|
+
"aria-expanded": item.isExpanded(),
|
|
71
|
+
...otherProps,
|
|
72
|
+
children: children
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
// biome-ignore lint/suspicious/noExplicitAny: FIXME Origin UI as-is
|
|
77
|
+
function TreeItemLabel({ item: propItem, children, className, ...props }) {
|
|
78
|
+
const { currentItem } = useTreeContext();
|
|
79
|
+
const item = propItem || currentItem;
|
|
80
|
+
if (!item) {
|
|
81
|
+
console.warn("TreeItemLabel: No item provided via props or context");
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return /*#__PURE__*/ _jsxs("span", {
|
|
85
|
+
"data-slot": "tree-item-label",
|
|
86
|
+
className: cn("group/tree-item-label cursor-pointer in-data-[selected=true]:border-l-border-brand border-l-2 border-l-transparent in-focus-visible:ring-ring/50 bg-background hover:bg-bg-secondary in-data-[selected=true]:bg-bg-quaternary! text-text-secondary hover:text-text-primary in-data-[selected=true]:text-text-primary in-data-[drag-target=true]:bg-accent flex items-center gap-2 pr-2 pl-1.5 py-1.5 text-sm transition-colors not-in-data-[folder=true]:ps-2.5 in-focus-visible:ring-[3px] in-data-[search-match=true]:bg-blue-400/20! [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
|
|
87
|
+
...props,
|
|
88
|
+
children: [
|
|
89
|
+
item.isFolder() && /*#__PURE__*/ _jsx(ChevronDownIcon, {
|
|
90
|
+
className: "text-muted-foreground size-4 in-aria-[expanded=false]:-rotate-90"
|
|
91
|
+
}),
|
|
92
|
+
children || (typeof item.getItemName === "function" ? item.getItemName() : null)
|
|
93
|
+
]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function TreeDragLine({ className, ...props }) {
|
|
97
|
+
const { tree } = useTreeContext();
|
|
98
|
+
if (!tree || typeof tree.getDragLineStyle !== "function") {
|
|
99
|
+
console.warn("TreeDragLine: No tree provided via context or tree does not have getDragLineStyle method");
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
const dragLine = tree.getDragLineStyle();
|
|
103
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
104
|
+
style: dragLine,
|
|
105
|
+
className: cn("bg-primary before:bg-background before:border-primary absolute z-30 -mt-px h-0.5 w-[unset] before:absolute before:-top-[3px] before:left-0 before:size-2 before:rounded-full before:border-2", className),
|
|
106
|
+
...props
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
export { Tree, TreeItem, TreeItemLabel, TreeDragLine };
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/shadcn/components/ui/tree.tsx"],"sourcesContent":["import type { ItemInstance } from \"@headless-tree/core\";\nimport { ChevronDownIcon } from \"lucide-react\";\nimport { Slot } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { cn } from \"#shadcn/lib/utils\";\n\n// biome-ignore lint/suspicious/noExplicitAny: FIXME Origin UI as-is\ninterface TreeContextValue<T = any> {\n\tindent: number;\n\tcurrentItem?: ItemInstance<T>;\n\t// biome-ignore lint/suspicious/noExplicitAny: FIXME Origin UI as-is\n\ttree?: any;\n}\n\nconst TreeContext = React.createContext<TreeContextValue>({\n\tindent: 20,\n});\n\n// biome-ignore lint/suspicious/noExplicitAny: FIXME Origin UI as-is\nfunction useTreeContext<T = any>() {\n\treturn React.useContext(TreeContext) as TreeContextValue<T>;\n}\n\ninterface TreeProps extends React.HTMLAttributes<HTMLDivElement> {\n\tindent?: number;\n\t// biome-ignore lint/suspicious/noExplicitAny: FIXME Origin UI as-is\n\ttree?: any;\n}\n\nfunction Tree({ indent = 20, tree, className, ...props }: TreeProps) {\n\tconst containerProps =\n\t\ttree && typeof tree.getContainerProps === \"function\"\n\t\t\t? tree.getContainerProps()\n\t\t\t: {};\n\tconst mergedProps = { ...props, ...containerProps };\n\n\t// Extract style from mergedProps to merge with our custom styles\n\tconst { style: propStyle, ...otherProps } = mergedProps;\n\n\t// Merge styles\n\tconst mergedStyle = {\n\t\t...propStyle,\n\t\t\"--tree-indent\": `${indent}px`,\n\t\t\"--border\": `var(--color-fg-disabled)`,\n\t} as React.CSSProperties;\n\n\treturn (\n\t\t<TreeContext.Provider value={{ indent, tree }}>\n\t\t\t<div\n\t\t\t\tdata-slot=\"tree\"\n\t\t\t\tstyle={mergedStyle}\n\t\t\t\tclassName={cn(\"flex flex-col\", className)}\n\t\t\t\t{...otherProps}\n\t\t\t/>\n\t\t</TreeContext.Provider>\n\t);\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: FIXME Origin UI as-is\ninterface TreeItemProps<T = any>\n\textends React.HTMLAttributes<HTMLButtonElement> {\n\titem: ItemInstance<T>;\n\tindent?: number;\n\tasChild?: boolean;\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: FIXME Origin UI as-is\nfunction TreeItem<T = any>({\n\titem,\n\tclassName,\n\tasChild,\n\tchildren,\n\t...props\n}: Omit<TreeItemProps<T>, \"indent\">) {\n\tconst { indent } = useTreeContext<T>();\n\n\tconst itemProps = typeof item.getProps === \"function\" ? item.getProps() : {};\n\tconst mergedProps = { ...props, ...itemProps };\n\n\t// Extract style from mergedProps to merge with our custom styles\n\tconst { style: propStyle, ...otherProps } = mergedProps;\n\n\t// Merge styles\n\tconst mergedStyle = {\n\t\t...propStyle,\n\t\t\"--tree-padding\": `${item.getItemMeta().level * indent}px`,\n\t} as React.CSSProperties;\n\n\tconst Comp = asChild ? Slot.Root : \"button\";\n\n\treturn (\n\t\t<TreeContext.Provider value={{ indent, currentItem: item }}>\n\t\t\t<Comp\n\t\t\t\tdata-slot=\"tree-item\"\n\t\t\t\tstyle={mergedStyle}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"z-10 ps-(--tree-padding) outline-hidden select-none focus:z-20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tdata-focus={\n\t\t\t\t\ttypeof item.isFocused === \"function\"\n\t\t\t\t\t\t? item.isFocused() || false\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tdata-folder={\n\t\t\t\t\ttypeof item.isFolder === \"function\"\n\t\t\t\t\t\t? item.isFolder() || false\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tdata-selected={\n\t\t\t\t\ttypeof item.isSelected === \"function\"\n\t\t\t\t\t\t? item.isSelected() || false\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tdata-drag-target={\n\t\t\t\t\ttypeof item.isDragTarget === \"function\"\n\t\t\t\t\t\t? item.isDragTarget() || false\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\tdata-search-match={\n\t\t\t\t\ttypeof item.isMatchingSearch === \"function\"\n\t\t\t\t\t\t? item.isMatchingSearch() || false\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\taria-expanded={item.isExpanded()}\n\t\t\t\t{...otherProps}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Comp>\n\t\t</TreeContext.Provider>\n\t);\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: FIXME Origin UI as-is\ninterface TreeItemLabelProps<T = any>\n\textends React.HTMLAttributes<HTMLSpanElement> {\n\titem?: ItemInstance<T>;\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: FIXME Origin UI as-is\nfunction TreeItemLabel<T = any>({\n\titem: propItem,\n\tchildren,\n\tclassName,\n\t...props\n}: TreeItemLabelProps<T>) {\n\tconst { currentItem } = useTreeContext<T>();\n\tconst item = propItem || currentItem;\n\n\tif (!item) {\n\t\tconsole.warn(\"TreeItemLabel: No item provided via props or context\");\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"tree-item-label\"\n\t\t\tclassName={cn(\n\t\t\t\t\"group/tree-item-label cursor-pointer in-data-[selected=true]:border-l-border-brand border-l-2 border-l-transparent in-focus-visible:ring-ring/50 bg-background hover:bg-bg-secondary in-data-[selected=true]:bg-bg-quaternary! text-text-secondary hover:text-text-primary in-data-[selected=true]:text-text-primary in-data-[drag-target=true]:bg-accent flex items-center gap-2 pr-2 pl-1.5 py-1.5 text-sm transition-colors not-in-data-[folder=true]:ps-2.5 in-focus-visible:ring-[3px] in-data-[search-match=true]:bg-blue-400/20! [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{item.isFolder() && (\n\t\t\t\t<ChevronDownIcon className=\"text-muted-foreground size-4 in-aria-[expanded=false]:-rotate-90\" />\n\t\t\t)}\n\t\t\t{children ||\n\t\t\t\t(typeof item.getItemName === \"function\" ? item.getItemName() : null)}\n\t\t</span>\n\t);\n}\n\nfunction TreeDragLine({\n\tclassName,\n\t...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n\tconst { tree } = useTreeContext();\n\n\tif (!tree || typeof tree.getDragLineStyle !== \"function\") {\n\t\tconsole.warn(\n\t\t\t\"TreeDragLine: No tree provided via context or tree does not have getDragLineStyle method\",\n\t\t);\n\t\treturn null;\n\t}\n\n\tconst dragLine = tree.getDragLineStyle();\n\treturn (\n\t\t<div\n\t\t\tstyle={dragLine}\n\t\t\tclassName={cn(\n\t\t\t\t\"bg-primary before:bg-background before:border-primary absolute z-30 -mt-px h-0.5 w-[unset] before:absolute before:-top-[3px] before:left-0 before:size-2 before:rounded-full before:border-2\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Tree, TreeItem, TreeItemLabel, TreeDragLine };\n"],"names":["ChevronDownIcon","Slot","React","cn","TreeContext","createContext","indent","useTreeContext","useContext","Tree","tree","className","props","containerProps","getContainerProps","mergedProps","style","propStyle","otherProps","mergedStyle","Provider","value","div","data-slot","TreeItem","item","asChild","children","itemProps","getProps","getItemMeta","level","Comp","Root","currentItem","data-focus","isFocused","undefined","data-folder","isFolder","data-selected","isSelected","data-drag-target","isDragTarget","data-search-match","isMatchingSearch","aria-expanded","isExpanded","TreeItemLabel","propItem","console","warn","span","getItemName","TreeDragLine","getDragLineStyle","dragLine"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@health-samurai/react-components",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -25,8 +25,12 @@
|
|
|
25
25
|
"@codemirror/search": "^6.5.11",
|
|
26
26
|
"@codemirror/state": "^6.5.2",
|
|
27
27
|
"@codemirror/view": "^6.38.1",
|
|
28
|
+
"@headless-tree/core": "^1.4.0",
|
|
29
|
+
"@headless-tree/react": "^1.4.0",
|
|
28
30
|
"@hookform/resolvers": "^5.2.1",
|
|
31
|
+
"@lezer/common": "^1.2.3",
|
|
29
32
|
"@lezer/highlight": "^1.2.1",
|
|
33
|
+
"@lezer/lr": "^1.4.2",
|
|
30
34
|
"@radix-ui/react-accordion": "^1.2.11",
|
|
31
35
|
"@radix-ui/react-alert-dialog": "^1.1.14",
|
|
32
36
|
"@radix-ui/react-aspect-ratio": "^1.1.7",
|
|
@@ -61,6 +65,7 @@
|
|
|
61
65
|
"input-otp": "^1.4.2",
|
|
62
66
|
"lucide-react": "^0.539.0",
|
|
63
67
|
"next-themes": "^0.4.6",
|
|
68
|
+
"radix-ui": "^1.4.3",
|
|
64
69
|
"react": "^19.1.0",
|
|
65
70
|
"react-day-picker": "^9.8.1",
|
|
66
71
|
"react-dom": "^19.1.0",
|
|
@@ -73,6 +78,7 @@
|
|
|
73
78
|
"zod": "^4.0.17"
|
|
74
79
|
},
|
|
75
80
|
"devDependencies": {
|
|
81
|
+
"@lezer/generator": "^1.8.0",
|
|
76
82
|
"@storybook/addon-docs": "^9.1.1",
|
|
77
83
|
"@storybook/react-vite": "^9.1.1",
|
|
78
84
|
"@swc/cli": "^0.7.8",
|
|
@@ -88,7 +94,8 @@
|
|
|
88
94
|
"tsx": "^4.20.4",
|
|
89
95
|
"tw-animate-css": "^1.3.6",
|
|
90
96
|
"typescript": "~5.8.3",
|
|
91
|
-
"vite": "^7.0.4"
|
|
97
|
+
"vite": "^7.0.4",
|
|
98
|
+
"vitest": "^3.2.4"
|
|
92
99
|
},
|
|
93
100
|
"publishConfig": {
|
|
94
101
|
"access": "public"
|