@burtson-labs/ui 0.14.0 → 0.14.1
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/LICENSES/DEPENDENCIES.txt +1 -1
- package/README.md +15 -11
- package/dist/components/accordion.d.ts +3 -3
- package/dist/components/accordion.js +13 -10
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.d.ts +12 -10
- package/dist/components/alert-dialog.js +29 -20
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.d.ts +5 -3
- package/dist/components/alert.js +11 -7
- package/dist/components/alert.js.map +1 -1
- package/dist/components/app-shell.d.ts +7 -6
- package/dist/components/app-shell.js +21 -14
- package/dist/components/app-shell.js.map +1 -1
- package/dist/components/attachment.d.ts +3 -3
- package/dist/components/attachment.js +10 -7
- package/dist/components/attachment.js.map +1 -1
- package/dist/components/audio-player.d.ts +2 -2
- package/dist/components/audio-player.js +8 -6
- package/dist/components/audio-player.js.map +1 -1
- package/dist/components/avatar.d.ts +3 -3
- package/dist/components/avatar.js +10 -7
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.d.ts +1 -1
- package/dist/components/badge.js +12 -10
- package/dist/components/badge.js.map +1 -1
- package/dist/components/breadcrumb.d.ts +8 -8
- package/dist/components/breadcrumb.js +24 -17
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button.d.ts +8 -1
- package/dist/components/button.js +12 -3
- package/dist/components/button.js.map +1 -1
- package/dist/components/card.d.ts +8 -8
- package/dist/components/card.js +32 -23
- package/dist/components/card.js.map +1 -1
- package/dist/components/chat-history.d.ts +1 -1
- package/dist/components/chat-history.js +10 -9
- package/dist/components/chat-history.js.map +1 -1
- package/dist/components/chat-layout.d.ts +1 -1
- package/dist/components/chat-layout.js +7 -3
- package/dist/components/chat-layout.js.map +1 -1
- package/dist/components/checkbox-card.d.ts +2 -2
- package/dist/components/checkbox-card.js +9 -7
- package/dist/components/checkbox-card.js.map +1 -1
- package/dist/components/checkbox.d.ts +23 -2
- package/dist/components/checkbox.js +48 -6
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/collapsible.d.ts +2 -2
- package/dist/components/collapsible.js +7 -5
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.d.ts +14 -4
- package/dist/components/combobox.js +18 -8
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.d.ts +68 -12
- package/dist/components/command.js +38 -25
- package/dist/components/command.js.map +1 -1
- package/dist/components/composer.d.ts +2 -2
- package/dist/components/composer.js +9 -7
- package/dist/components/composer.js.map +1 -1
- package/dist/components/connection-status.d.ts +3 -3
- package/dist/components/connection-status.js +18 -14
- package/dist/components/connection-status.js.map +1 -1
- package/dist/components/context-menu.d.ts +14 -13
- package/dist/components/context-menu.js +33 -23
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/conversation.d.ts +1 -1
- package/dist/components/conversation.js +6 -5
- package/dist/components/conversation.js.map +1 -1
- package/dist/components/copy-button.d.ts +1 -1
- package/dist/components/copy-button.js +3 -2
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/data-table.d.ts +7 -2
- package/dist/components/data-table.js +16 -42
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/dialog.d.ts +18 -9
- package/dist/components/dialog.js +38 -22
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dropdown-menu.d.ts +14 -13
- package/dist/components/dropdown-menu.js +33 -23
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/editor-tabs.d.ts +1 -1
- package/dist/components/editor-tabs.js +6 -5
- package/dist/components/editor-tabs.js.map +1 -1
- package/dist/components/empty-state.d.ts +5 -5
- package/dist/components/empty-state.js +16 -11
- package/dist/components/empty-state.js.map +1 -1
- package/dist/components/error-summary.d.ts +21 -0
- package/dist/components/error-summary.js +62 -0
- package/dist/components/error-summary.js.map +1 -0
- package/dist/components/field.d.ts +66 -7
- package/dist/components/field.js +151 -20
- package/dist/components/field.js.map +1 -1
- package/dist/components/form-actions.d.ts +18 -0
- package/dist/components/form-actions.js +30 -0
- package/dist/components/form-actions.js.map +1 -0
- package/dist/components/icon-button.d.ts +3 -1
- package/dist/components/icon-button.js +5 -3
- package/dist/components/icon-button.js.map +1 -1
- package/dist/components/input.d.ts +42 -7
- package/dist/components/input.js +53 -10
- package/dist/components/input.js.map +1 -1
- package/dist/components/kbd.d.ts +2 -2
- package/dist/components/kbd.js +7 -5
- package/dist/components/kbd.js.map +1 -1
- package/dist/components/label.d.ts +6 -1
- package/dist/components/label.js +10 -4
- package/dist/components/label.js.map +1 -1
- package/dist/components/markdown.d.ts +4 -3
- package/dist/components/markdown.js +7 -6
- package/dist/components/markdown.js.map +1 -1
- package/dist/components/menubar.d.ts +16 -14
- package/dist/components/menubar.js +39 -27
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/message-actions.d.ts +3 -3
- package/dist/components/message-actions.js +15 -12
- package/dist/components/message-actions.js.map +1 -1
- package/dist/components/message.d.ts +1 -1
- package/dist/components/message.js +5 -3
- package/dist/components/message.js.map +1 -1
- package/dist/components/mobile-nav.d.ts +1 -1
- package/dist/components/mobile-nav.js +6 -5
- package/dist/components/mobile-nav.js.map +1 -1
- package/dist/components/native-select.d.ts +16 -0
- package/dist/components/native-select.js +33 -0
- package/dist/components/native-select.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +12 -11
- package/dist/components/navigation-menu.js +32 -23
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/number-input.d.ts +23 -0
- package/dist/components/number-input.js +45 -0
- package/dist/components/number-input.js.map +1 -0
- package/dist/components/onboarding-checklist.d.ts +1 -1
- package/dist/components/onboarding-checklist.js +4 -3
- package/dist/components/onboarding-checklist.js.map +1 -1
- package/dist/components/page-header.d.ts +7 -6
- package/dist/components/page-header.js +22 -15
- package/dist/components/page-header.js.map +1 -1
- package/dist/components/pagination.d.ts +1 -1
- package/dist/components/pagination.js +3 -2
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.d.ts +13 -10
- package/dist/components/popover.js +23 -17
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.d.ts +1 -1
- package/dist/components/progress.js +6 -5
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.d.ts +22 -3
- package/dist/components/radio-group.js +51 -10
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/reasoning.d.ts +3 -3
- package/dist/components/reasoning.js +9 -7
- package/dist/components/reasoning.js.map +1 -1
- package/dist/components/scroll-area.d.ts +3 -2
- package/dist/components/scroll-area.js +10 -7
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/secret-input.d.ts +3 -2
- package/dist/components/secret-input.js +6 -4
- package/dist/components/secret-input.js.map +1 -1
- package/dist/components/select.d.ts +11 -6
- package/dist/components/select.js +24 -18
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.d.ts +1 -1
- package/dist/components/separator.js +4 -3
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sheet.d.ts +10 -8
- package/dist/components/sheet.js +31 -20
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/skeleton.d.ts +2 -1
- package/dist/components/skeleton.js +6 -4
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.d.ts +10 -6
- package/dist/components/slider.js +15 -7
- package/dist/components/slider.js.map +1 -1
- package/dist/components/source.d.ts +2 -2
- package/dist/components/source.js +9 -7
- package/dist/components/source.js.map +1 -1
- package/dist/components/spinner.d.ts +4 -2
- package/dist/components/spinner.js +4 -3
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/stat-card.d.ts +27 -2
- package/dist/components/stat-card.js +69 -9
- package/dist/components/stat-card.js.map +1 -1
- package/dist/components/status.d.ts +7 -6
- package/dist/components/status.js +11 -5
- package/dist/components/status.js.map +1 -1
- package/dist/components/steps.d.ts +1 -1
- package/dist/components/steps.js +4 -3
- package/dist/components/steps.js.map +1 -1
- package/dist/components/switch.d.ts +46 -2
- package/dist/components/switch.js +85 -8
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.d.ts +29 -12
- package/dist/components/table.js +79 -34
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.d.ts +9 -4
- package/dist/components/tabs.js +22 -13
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/textarea.d.ts +6 -1
- package/dist/components/textarea.js +3 -3
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/toast.d.ts +10 -6
- package/dist/components/toast.js +27 -18
- package/dist/components/toast.js.map +1 -1
- package/dist/components/toaster.d.ts +4 -2
- package/dist/components/toaster.js +6 -2
- package/dist/components/toaster.js.map +1 -1
- package/dist/components/tool-call.d.ts +2 -2
- package/dist/components/tool-call.js +10 -8
- package/dist/components/tool-call.js.map +1 -1
- package/dist/components/toolbar.d.ts +9 -4
- package/dist/components/toolbar.js +14 -9
- package/dist/components/toolbar.js.map +1 -1
- package/dist/components/tooltip.d.ts +3 -2
- package/dist/components/tooltip.js +7 -4
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/tour.js +2 -2
- package/dist/components/tour.js.map +1 -1
- package/dist/components/tree-view.d.ts +1 -1
- package/dist/components/tree-view.js +9 -5
- package/dist/components/tree-view.js.map +1 -1
- package/dist/components/voice-recorder.d.ts +1 -1
- package/dist/components/voice-recorder.js +4 -2
- package/dist/components/voice-recorder.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +17 -12
- package/dist/lib/media.d.ts +18 -0
- package/dist/lib/media.js +34 -0
- package/dist/lib/media.js.map +1 -0
- package/dist/lib/utils.d.ts +32 -0
- package/dist/lib/utils.js +33 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/mui/index.js +20 -8
- package/dist/mui/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +36 -17
- package/dist/tokens.d.ts +78 -36
- package/dist/tokens.js +63 -32
- package/dist/tokens.js.map +1 -1
- package/package.json +5 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
3
|
import { CheckboxItem, Content, Group, Item, ItemIndicator, Label, Portal, RadioGroup, RadioItem, Root, Separator, Sub, SubContent, SubTrigger, Trigger } from "../primitives/vendor/radix/react-dropdown-menu/dropdown-menu.js";
|
|
4
|
-
import { menuItemClasses, surfaceClasses } from "./popover.js";
|
|
5
|
-
import "react";
|
|
4
|
+
import { menuItemClasses, menuLabelClasses, surfaceClasses } from "./popover.js";
|
|
5
|
+
import * as React from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import ChevronRight from "@burtson-labs/icons/react/chevron-right";
|
|
8
8
|
import Check from "@burtson-labs/icons/react/check";
|
|
@@ -13,37 +13,41 @@ function DropdownMenu(props) {
|
|
|
13
13
|
...props
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function DropdownMenuTrigger(props) {
|
|
16
|
+
var DropdownMenuTrigger = React.forwardRef(function DropdownMenuTrigger(props, ref) {
|
|
17
17
|
return /* @__PURE__ */ jsx(Trigger, {
|
|
18
|
+
ref,
|
|
18
19
|
"data-slot": "dropdown-menu-trigger",
|
|
19
20
|
...props
|
|
20
21
|
});
|
|
21
|
-
}
|
|
22
|
+
});
|
|
22
23
|
function DropdownMenuGroup(props) {
|
|
23
24
|
return /* @__PURE__ */ jsx(Group, {
|
|
24
25
|
"data-slot": "dropdown-menu-group",
|
|
25
26
|
...props
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
|
-
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
29
|
+
var DropdownMenuContent = React.forwardRef(function DropdownMenuContent({ className, sideOffset = 4, ...props }, ref) {
|
|
29
30
|
return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, {
|
|
31
|
+
ref,
|
|
30
32
|
"data-slot": "dropdown-menu-content",
|
|
31
33
|
sideOffset,
|
|
32
34
|
className: cn(surfaceClasses, "max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto p-1", className),
|
|
33
35
|
...props
|
|
34
36
|
}) });
|
|
35
|
-
}
|
|
36
|
-
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
37
|
+
});
|
|
38
|
+
var DropdownMenuItem = React.forwardRef(function DropdownMenuItem({ className, inset, variant = "default", ...props }, ref) {
|
|
37
39
|
return /* @__PURE__ */ jsx(Item, {
|
|
40
|
+
ref,
|
|
38
41
|
"data-slot": "dropdown-menu-item",
|
|
39
42
|
"data-inset": inset || void 0,
|
|
40
43
|
"data-variant": variant,
|
|
41
44
|
className: cn(menuItemClasses, "data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:*:[svg]:!text-destructive", className),
|
|
42
45
|
...props
|
|
43
46
|
});
|
|
44
|
-
}
|
|
45
|
-
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
47
|
+
});
|
|
48
|
+
var DropdownMenuCheckboxItem = React.forwardRef(function DropdownMenuCheckboxItem({ className, children, checked, ...props }, ref) {
|
|
46
49
|
return /* @__PURE__ */ jsxs(CheckboxItem, {
|
|
50
|
+
ref,
|
|
47
51
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
48
52
|
className: cn(menuItemClasses, "pl-8", className),
|
|
49
53
|
checked,
|
|
@@ -56,15 +60,16 @@ function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
|
56
60
|
}) })
|
|
57
61
|
}), children]
|
|
58
62
|
});
|
|
59
|
-
}
|
|
63
|
+
});
|
|
60
64
|
function DropdownMenuRadioGroup(props) {
|
|
61
65
|
return /* @__PURE__ */ jsx(RadioGroup, {
|
|
62
66
|
"data-slot": "dropdown-menu-radio-group",
|
|
63
67
|
...props
|
|
64
68
|
});
|
|
65
69
|
}
|
|
66
|
-
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
70
|
+
var DropdownMenuRadioItem = React.forwardRef(function DropdownMenuRadioItem({ className, children, ...props }, ref) {
|
|
67
71
|
return /* @__PURE__ */ jsxs(RadioItem, {
|
|
72
|
+
ref,
|
|
68
73
|
"data-slot": "dropdown-menu-radio-item",
|
|
69
74
|
className: cn(menuItemClasses, "pl-8", className),
|
|
70
75
|
...props,
|
|
@@ -73,37 +78,41 @@ function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
|
73
78
|
children: /* @__PURE__ */ jsx(ItemIndicator, { children: /* @__PURE__ */ jsx("span", { className: "block size-2 rounded-full bg-foreground" }) })
|
|
74
79
|
}), children]
|
|
75
80
|
});
|
|
76
|
-
}
|
|
77
|
-
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
81
|
+
});
|
|
82
|
+
var DropdownMenuLabel = React.forwardRef(function DropdownMenuLabel({ className, inset, ...props }, ref) {
|
|
78
83
|
return /* @__PURE__ */ jsx(Label, {
|
|
84
|
+
ref,
|
|
79
85
|
"data-slot": "dropdown-menu-label",
|
|
80
86
|
"data-inset": inset || void 0,
|
|
81
|
-
className: cn("
|
|
87
|
+
className: cn(menuLabelClasses, "data-[inset]:pl-8", className),
|
|
82
88
|
...props
|
|
83
89
|
});
|
|
84
|
-
}
|
|
85
|
-
function DropdownMenuSeparator({ className, ...props }) {
|
|
90
|
+
});
|
|
91
|
+
var DropdownMenuSeparator = React.forwardRef(function DropdownMenuSeparator({ className, ...props }, ref) {
|
|
86
92
|
return /* @__PURE__ */ jsx(Separator, {
|
|
93
|
+
ref,
|
|
87
94
|
"data-slot": "dropdown-menu-separator",
|
|
88
95
|
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
89
96
|
...props
|
|
90
97
|
});
|
|
91
|
-
}
|
|
92
|
-
function DropdownMenuShortcut({ className, ...props }) {
|
|
98
|
+
});
|
|
99
|
+
var DropdownMenuShortcut = React.forwardRef(function DropdownMenuShortcut({ className, ...props }, ref) {
|
|
93
100
|
return /* @__PURE__ */ jsx("span", {
|
|
101
|
+
ref,
|
|
94
102
|
"data-slot": "dropdown-menu-shortcut",
|
|
95
103
|
className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className),
|
|
96
104
|
...props
|
|
97
105
|
});
|
|
98
|
-
}
|
|
106
|
+
});
|
|
99
107
|
function DropdownMenuSub(props) {
|
|
100
108
|
return /* @__PURE__ */ jsx(Sub, {
|
|
101
109
|
"data-slot": "dropdown-menu-sub",
|
|
102
110
|
...props
|
|
103
111
|
});
|
|
104
112
|
}
|
|
105
|
-
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
113
|
+
var DropdownMenuSubTrigger = React.forwardRef(function DropdownMenuSubTrigger({ className, inset, children, ...props }, ref) {
|
|
106
114
|
return /* @__PURE__ */ jsxs(SubTrigger, {
|
|
115
|
+
ref,
|
|
107
116
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
108
117
|
"data-inset": inset || void 0,
|
|
109
118
|
className: cn(menuItemClasses, "data-[state=open]:bg-secondary", className),
|
|
@@ -113,14 +122,15 @@ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
113
122
|
"aria-hidden": true
|
|
114
123
|
})]
|
|
115
124
|
});
|
|
116
|
-
}
|
|
117
|
-
function DropdownMenuSubContent({ className, ...props }) {
|
|
125
|
+
});
|
|
126
|
+
var DropdownMenuSubContent = React.forwardRef(function DropdownMenuSubContent({ className, ...props }, ref) {
|
|
118
127
|
return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(SubContent, {
|
|
128
|
+
ref,
|
|
119
129
|
"data-slot": "dropdown-menu-sub-content",
|
|
120
130
|
className: cn(surfaceClasses, "min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden p-1", className),
|
|
121
131
|
...props
|
|
122
132
|
}) });
|
|
123
|
-
}
|
|
133
|
+
});
|
|
124
134
|
//#endregion
|
|
125
135
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
|
|
126
136
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","names":["DropdownMenuPrimitive.Root","DropdownMenuPrimitive.Trigger","DropdownMenuPrimitive.Group","DropdownMenuPrimitive.Portal","DropdownMenuPrimitive.Content","DropdownMenuPrimitive.Item","itemClasses","DropdownMenuPrimitive.CheckboxItem","DropdownMenuPrimitive.ItemIndicator","DropdownMenuPrimitive.RadioGroup","DropdownMenuPrimitive.RadioItem","DropdownMenuPrimitive.Label","DropdownMenuPrimitive.Separator","DropdownMenuPrimitive.Sub","DropdownMenuPrimitive.SubTrigger","DropdownMenuPrimitive.SubContent"],"sources":["../../src/components/dropdown-menu.tsx"],"sourcesContent":["import Check from '@burtson-labs/icons/react/check';\nimport ChevronRight from '@burtson-labs/icons/react/chevron-right';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\nimport * as DropdownMenuPrimitive from '../primitives/vendor/radix/react-dropdown-menu';\n\nimport { menuItemClasses as itemClasses, surfaceClasses } from './popover';\n\nfunction DropdownMenu(props: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuTrigger(props: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuGroup(props: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n surfaceClasses,\n 'max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto p-1',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset || undefined}\n data-variant={variant}\n className={cn(\n itemClasses,\n 'data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:*:[svg]:!text-destructive',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(itemClasses, 'pl-8', className)}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"size-4 text-foreground\" aria-hidden />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup(\n props: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>,\n) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(itemClasses, 'pl-8', className)}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <span className=\"block size-2 rounded-full bg-foreground\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & { inset?: boolean }) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset || undefined}\n className={cn(\n 'px-2 pt-2 pb-1 text-[11px] font-semibold tracking-[0.08em] text-muted-foreground uppercase data-[inset]:pl-8',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub(props: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & { inset?: boolean }) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset || undefined}\n className={cn(itemClasses, 'data-[state=open]:bg-secondary', className)}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto size-4\" aria-hidden />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n surfaceClasses,\n 'min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden p-1',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n};\n"],"mappings":";;;;;;;;;AASA,SAAS,aAAa,OAAgE;CACpF,OAAO,oBAACA,MAAD;EAA4B,aAAU;EAAgB,GAAI;CAAQ,CAAA;AAC3E;AAEA,SAAS,oBAAoB,OAAmE;CAC9F,OAAO,oBAACC,SAAD;EAA+B,aAAU;EAAwB,GAAI;CAAQ,CAAA;AACtF;AAEA,SAAS,kBAAkB,OAAiE;CAC1F,OAAO,oBAACC,OAAD;EAA6B,aAAU;EAAsB,GAAI;CAAQ,CAAA;AAClF;AAEA,SAAS,oBAAoB,EAC3B,WACA,aAAa,GACb,GAAG,SAC0D;CAC7D,OACE,oBAACC,QAAD,EAAA,UACE,oBAACC,SAAD;EACE,aAAU;EACE;EACZ,WAAW,GACT,gBACA,qKACA,SACF;EACA,GAAI;CACL,CAAA,EAC2B,CAAA;AAElC;AAEA,SAAS,iBAAiB,EACxB,WACA,OACA,UAAU,WACV,GAAG,SAIF;CACD,OACE,oBAACC,MAAD;EACE,aAAU;EACV,cAAY,SAAS,KAAA;EACrB,gBAAc;EACd,WAAW,GACTC,iBACA,uJACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,yBAAyB,EAChC,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,SAAS,uBAAuB,EAC9B,WACA,OACA,UACA,GAAG,SACmF;CACtF,OACE,qBAACC,YAAD;EACE,aAAU;EACV,cAAY,SAAS,KAAA;EACrB,WAAW,GAAGR,iBAAa,kCAAkC,SAAS;EACtE,GAAI;EAJN,UAAA,CAMG,UACD,oBAAC,cAAD;GAAc,WAAU;GAAiB,eAAA;EAAa,CAAA,CACtB;;AAEtC;AAEA,SAAS,uBAAuB,EAC9B,WACA,GAAG,SAC6D;CAChE,OACE,oBAACH,QAAD,EAAA,UACE,oBAACY,YAAD;EACE,aAAU;EACV,WAAW,GACT,gBACA,4FACA,SACF;EACA,GAAI;CACL,CAAA,EAC2B,CAAA;AAElC"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","names":["DropdownMenuPrimitive.Root","DropdownMenuPrimitive.Trigger","DropdownMenuPrimitive.Group","DropdownMenuPrimitive.Portal","DropdownMenuPrimitive.Content","DropdownMenuPrimitive.Item","itemClasses","DropdownMenuPrimitive.CheckboxItem","DropdownMenuPrimitive.ItemIndicator","DropdownMenuPrimitive.RadioGroup","DropdownMenuPrimitive.RadioItem","DropdownMenuPrimitive.Label","DropdownMenuPrimitive.Separator","DropdownMenuPrimitive.Sub","DropdownMenuPrimitive.SubTrigger","DropdownMenuPrimitive.SubContent"],"sources":["../../src/components/dropdown-menu.tsx"],"sourcesContent":["import Check from '@burtson-labs/icons/react/check';\nimport ChevronRight from '@burtson-labs/icons/react/chevron-right';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\nimport * as DropdownMenuPrimitive from '../primitives/vendor/radix/react-dropdown-menu';\n\nimport { menuItemClasses as itemClasses, menuLabelClasses, surfaceClasses } from './popover';\n\nfunction DropdownMenu(props: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nconst DropdownMenuTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>\n>(function DropdownMenuTrigger(props, ref) {\n return <DropdownMenuPrimitive.Trigger ref={ref} data-slot=\"dropdown-menu-trigger\" {...props} />;\n});\n\nfunction DropdownMenuGroup(props: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nconst DropdownMenuContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof DropdownMenuPrimitive.Content>\n>(function DropdownMenuContent({ className, sideOffset = 4, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n surfaceClasses,\n 'max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto p-1',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n});\n\nexport interface DropdownMenuItemProps extends React.ComponentProps<\n typeof DropdownMenuPrimitive.Item\n> {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}\n\nconst DropdownMenuItem = React.forwardRef<HTMLDivElement, DropdownMenuItemProps>(\n function DropdownMenuItem({ className, inset, variant = 'default', ...props }, ref) {\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n data-inset={inset || undefined}\n data-variant={variant}\n className={cn(\n itemClasses,\n 'data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:*:[svg]:!text-destructive',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>\n>(function DropdownMenuCheckboxItem({ className, children, checked, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(itemClasses, 'pl-8', className)}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"size-4 text-foreground\" aria-hidden />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n});\n\nfunction DropdownMenuRadioGroup(\n props: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>,\n) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nconst DropdownMenuRadioItem = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>\n>(function DropdownMenuRadioItem({ className, children, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(itemClasses, 'pl-8', className)}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <span className=\"block size-2 rounded-full bg-foreground\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n});\n\nconst DropdownMenuLabel = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof DropdownMenuPrimitive.Label> & { inset?: boolean }\n>(function DropdownMenuLabel({ className, inset, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.Label\n ref={ref}\n data-slot=\"dropdown-menu-label\"\n data-inset={inset || undefined}\n className={cn(menuLabelClasses, 'data-[inset]:pl-8', className)}\n {...props}\n />\n );\n});\n\nconst DropdownMenuSeparator = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof DropdownMenuPrimitive.Separator>\n>(function DropdownMenuSeparator({ className, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n});\n\nconst DropdownMenuShortcut = React.forwardRef<HTMLSpanElement, React.ComponentProps<'span'>>(\n function DropdownMenuShortcut({ className, ...props }, ref) {\n return (\n <span\n ref={ref}\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)}\n {...props}\n />\n );\n },\n);\n\nfunction DropdownMenuSub(props: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & { inset?: boolean }\n>(function DropdownMenuSubTrigger({ className, inset, children, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset || undefined}\n className={cn(itemClasses, 'data-[state=open]:bg-secondary', className)}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto size-4\" aria-hidden />\n </DropdownMenuPrimitive.SubTrigger>\n );\n});\n\nconst DropdownMenuSubContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>\n>(function DropdownMenuSubContent({ className, ...props }, ref) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n surfaceClasses,\n 'min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden p-1',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n});\n\nexport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortc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AU,GAAG,SAAS,KAAK;CAC/E,OACE,qBAACC,YAAD;EACO;EACL,aAAU;EACV,cAAY,SAAS,KAAA;EACrB,WAAW,GAAGR,iBAAa,kCAAkC,SAAS;EACtE,GAAI;EALN,UAAA,CAOG,UACD,oBAAC,cAAD;GAAc,WAAU;GAAiB,eAAA;EAAa,CAAA,CACtB;;AAEtC,CAAC;AAED,IAAM,yBAAyB,MAAM,WAGnC,SAAS,uBAAuB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC9D,OACE,oBAACH,QAAD,EAAA,UACE,oBAACY,YAAD;EACO;EACL,aAAU;EACV,WAAW,GACT,gBACA,4FACA,SACF;EACA,GAAI;CACL,CAAA,EAC2B,CAAA;AAElC,CAAC"}
|
|
@@ -43,5 +43,5 @@ export interface EditorTabsProps extends Omit<React.ComponentProps<'div'>, 'chil
|
|
|
43
43
|
* and PageDown move the tab. Middle-click closes. The strip scrolls when the
|
|
44
44
|
* tabs overflow and keeps the active tab in view.
|
|
45
45
|
*/
|
|
46
|
-
declare
|
|
46
|
+
declare const EditorTabs: React.ForwardRefExoticComponent<Omit<EditorTabsProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
47
47
|
export { EditorTabs };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { cn, focusRingClasses } from "../lib/utils.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import X from "@burtson-labs/icons/react/x";
|
|
@@ -10,7 +10,7 @@ import X from "@burtson-labs/icons/react/x";
|
|
|
10
10
|
* and PageDown move the tab. Middle-click closes. The strip scrolls when the
|
|
11
11
|
* tabs overflow and keeps the active tab in view.
|
|
12
12
|
*/
|
|
13
|
-
function EditorTabs({ tabs, activeId, onActiveChange, onClose, onMove, actions, onTabContextMenu, className, "aria-label": ariaLabel, ...props }) {
|
|
13
|
+
var EditorTabs = React.forwardRef(function EditorTabs({ tabs, activeId, onActiveChange, onClose, onMove, actions, onTabContextMenu, className, "aria-label": ariaLabel, ...props }, ref) {
|
|
14
14
|
const baseId = React.useId();
|
|
15
15
|
const tabRefs = React.useRef(/* @__PURE__ */ new Map());
|
|
16
16
|
const listRef = React.useRef(null);
|
|
@@ -110,6 +110,7 @@ function EditorTabs({ tabs, activeId, onActiveChange, onClose, onMove, actions,
|
|
|
110
110
|
if (handled) event.preventDefault();
|
|
111
111
|
};
|
|
112
112
|
return /* @__PURE__ */ jsxs("div", {
|
|
113
|
+
ref,
|
|
113
114
|
"data-slot": "editor-tabs",
|
|
114
115
|
className: cn("flex h-9 min-w-0 items-stretch border-b bg-surface-muted", className),
|
|
115
116
|
...props,
|
|
@@ -166,7 +167,7 @@ function EditorTabs({ tabs, activeId, onActiveChange, onClose, onMove, actions,
|
|
|
166
167
|
onFocus: () => setFocusedId(tab.id),
|
|
167
168
|
onClick: () => onActiveChange(tab.id),
|
|
168
169
|
onKeyDown: (event) => onKeyDown(event, tab),
|
|
169
|
-
className: cn("flex h-full min-w-0 items-center gap-1.5 ps-3
|
|
170
|
+
className: cn("flex h-full min-w-0 items-center gap-1.5 ps-3", focusRingClasses, "focus-visible:outline-offset-[-2px]", closeable ? "pe-1" : "pe-3"),
|
|
170
171
|
children: [
|
|
171
172
|
tab.icon && /* @__PURE__ */ jsx("span", {
|
|
172
173
|
"aria-hidden": true,
|
|
@@ -194,7 +195,7 @@ function EditorTabs({ tabs, activeId, onActiveChange, onClose, onMove, actions,
|
|
|
194
195
|
"aria-label": `Close ${tab.label}`,
|
|
195
196
|
title: "Close (Delete)",
|
|
196
197
|
onClick: () => onClose?.(tab.id),
|
|
197
|
-
className: "me-1 flex size-5 shrink-0 items-center justify-center rounded-xs text-muted-foreground
|
|
198
|
+
className: cn("me-1 flex size-5 shrink-0 items-center justify-center rounded-xs text-muted-foreground hover:bg-muted hover:text-foreground", focusRingClasses, "focus-visible:outline-offset-[-1px]"),
|
|
198
199
|
children: [tab.dirty && /* @__PURE__ */ jsx("span", {
|
|
199
200
|
"aria-hidden": true,
|
|
200
201
|
className: "size-2 rounded-full bg-foreground/70 group-hover/tab:hidden"
|
|
@@ -215,7 +216,7 @@ function EditorTabs({ tabs, activeId, onActiveChange, onClose, onMove, actions,
|
|
|
215
216
|
children: actions
|
|
216
217
|
})]
|
|
217
218
|
});
|
|
218
|
-
}
|
|
219
|
+
});
|
|
219
220
|
//#endregion
|
|
220
221
|
export { EditorTabs };
|
|
221
222
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-tabs.js","names":[],"sources":["../../src/components/editor-tabs.tsx"],"sourcesContent":["import X from '@burtson-labs/icons/react/x';\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nexport interface EditorTab {\n /** Stable identity, usually the file path. */\n id: string;\n label: string;\n /** Full path or context; the tooltip and the accessible description. */\n description?: string;\n icon?: React.ReactNode;\n /** Unsaved changes: a dot replaces the close button until hover. */\n dirty?: boolean;\n /** Default true. */\n closeable?: boolean;\n /** A preview tab that the next opened file replaces; shown in italics. */\n preview?: boolean;\n /** The id of the panel this tab shows, for aria-controls. */\n controls?: string;\n}\n\nexport interface EditorTabsProps extends Omit<\n React.ComponentProps<'div'>,\n 'children' | 'aria-label'\n> {\n tabs: EditorTab[];\n activeId: string | null;\n onActiveChange: (id: string) => void;\n /**\n * A request to close. The component never removes a tab itself: for a dirty\n * tab, ask the person (save, discard, cancel) and then update `tabs`.\n */\n onClose?: (id: string) => void;\n /**\n * Reorder by drag or Ctrl+Shift+PageUp/PageDown. `toIndex` is the new position.\n * Dragging uses pointer events, not HTML5 drag and drop, so it also works in\n * desktop webviews (Tauri, Electron) that intercept native drags.\n */\n onMove?: (id: string, toIndex: number) => void;\n /** Required: e.g. \"Open editors\". */\n 'aria-label': string;\n /** Right-hand slot for split, more and similar buttons. */\n actions?: React.ReactNode;\n /** Right-click on a tab. */\n onTabContextMenu?: (id: string, event: React.MouseEvent) => void;\n}\n\n/**\n * The strip of open files above an editor. One tab stop; Left/Right/Home/End\n * move focus, Enter or Space opens, Delete asks to close, Ctrl+Shift+PageUp\n * and PageDown move the tab. Middle-click closes. The strip scrolls when the\n * tabs overflow and keeps the active tab in view.\n */\nfunction EditorTabs({\n tabs,\n activeId,\n onActiveChange,\n onClose,\n onMove,\n actions,\n onTabContextMenu,\n className,\n 'aria-label': ariaLabel,\n ...props\n}: EditorTabsProps) {\n const baseId = React.useId();\n const tabRefs = React.useRef(new Map<string, HTMLButtonElement>());\n const listRef = React.useRef<HTMLDivElement>(null);\n const [focusedId, setFocusedId] = React.useState<string | null>(null);\n const [dragId, setDragId] = React.useState<string | null>(null);\n // The gap a dragged tab would land in: 0 is before the first tab,\n // tabs.length after the last.\n const [dropGap, setDropGap] = React.useState<number | null>(null);\n // Set once a press becomes a drag, so the click that ends it does nothing.\n const dragged = React.useRef(false);\n const dragCleanup = React.useRef<(() => void) | null>(null);\n React.useEffect(() => () => dragCleanup.current?.(), []);\n const lastIds = React.useRef<string[]>([]);\n const hadFocus = React.useRef(false);\n\n const ids = tabs.map((t) => t.id);\n const idsKey = ids.join('\\u0000');\n const tabStop =\n (focusedId && ids.includes(focusedId) ? focusedId : null) ??\n (activeId && ids.includes(activeId) ? activeId : null) ??\n ids[0] ??\n null;\n\n React.useEffect(() => {\n if (activeId)\n tabRefs.current.get(activeId)?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' });\n }, [activeId]);\n\n // After a close, keep keyboard focus in the strip: the active tab if the\n // app picked one, else the neighbour at the closed tab's position.\n React.useLayoutEffect(() => {\n if (focusedId && !ids.includes(focusedId)) {\n const next =\n (activeId && ids.includes(activeId) ? activeId : null) ??\n ids[Math.min(Math.max(0, lastIds.current.indexOf(focusedId)), ids.length - 1)] ??\n null;\n setFocusedId(next);\n const active = document.activeElement;\n if (next && hadFocus.current && (!active || active === document.body))\n tabRefs.current.get(next)?.focus();\n }\n lastIds.current = ids;\n // ids is derived from tabs each render; idsKey is its stable form.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [focusedId, idsKey, activeId]);\n\n /** Which gap the pointer is over, measured from the rendered tabs. */\n const gapAt = (clientX: number) => {\n const els = Array.from(\n listRef.current?.querySelectorAll<HTMLElement>('[data-slot=\"editor-tab\"]') ?? [],\n );\n const rtl = listRef.current ? getComputedStyle(listRef.current).direction === 'rtl' : false;\n for (let i = 0; i < els.length; i++) {\n const rect = els[i]!.getBoundingClientRect();\n const mid = rect.left + rect.width / 2;\n if (rtl ? clientX > mid : clientX < mid) return i;\n }\n return els.length;\n };\n\n const startDrag = (event: React.PointerEvent, id: string) => {\n if (!onMove || event.button !== 0) return;\n dragCleanup.current?.();\n dragged.current = false;\n const downX = event.clientX;\n const move = (e: PointerEvent) => {\n // A few pixels of slop so an ordinary click is not read as a drag.\n if (!dragged.current && Math.abs(e.clientX - downX) < 4) return;\n if (!dragged.current) {\n dragged.current = true;\n setDragId(id);\n }\n setDropGap(gapAt(e.clientX));\n };\n const stop = (e: PointerEvent | null) => {\n window.removeEventListener('pointermove', move);\n window.removeEventListener('pointerup', up);\n window.removeEventListener('pointercancel', cancel);\n dragCleanup.current = null;\n if (e && dragged.current) {\n const from = lastIds.current.indexOf(id);\n const gap = gapAt(e.clientX);\n const to = gap > from ? gap - 1 : gap;\n if (from !== -1 && to !== from) onMove(id, to);\n }\n setDragId(null);\n setDropGap(null);\n };\n const up = (e: PointerEvent) => stop(e);\n const cancel = () => stop(null);\n window.addEventListener('pointermove', move);\n window.addEventListener('pointerup', up);\n window.addEventListener('pointercancel', cancel);\n dragCleanup.current = () => stop(null);\n };\n\n const focusTab = (id: string | undefined) => {\n if (!id) return;\n setFocusedId(id);\n tabRefs.current.get(id)?.focus();\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>, tab: EditorTab) => {\n const i = ids.indexOf(tab.id);\n const rtl = listRef.current ? getComputedStyle(listRef.current).direction === 'rtl' : false;\n const [prev, next] = rtl ? ['ArrowRight', 'ArrowLeft'] : ['ArrowLeft', 'ArrowRight'];\n let handled = true;\n if (event.ctrlKey && event.shiftKey && (event.key === 'PageUp' || event.key === 'PageDown')) {\n const to = event.key === 'PageUp' ? i - 1 : i + 1;\n if (onMove && to >= 0 && to < ids.length) onMove(tab.id, to);\n } else if (event.key === prev) focusTab(ids[(i - 1 + ids.length) % ids.length]);\n else if (event.key === next) focusTab(ids[(i + 1) % ids.length]);\n else if (event.key === 'Home') focusTab(ids[0]);\n else if (event.key === 'End') focusTab(ids[ids.length - 1]);\n else if (event.key === 'Delete' && tab.closeable !== false && onClose) onClose(tab.id);\n else handled = false;\n if (handled) event.preventDefault();\n };\n\n return (\n <div\n data-slot=\"editor-tabs\"\n className={cn('flex h-9 min-w-0 items-stretch border-b bg-surface-muted', className)}\n {...props}\n >\n <div\n ref={listRef}\n role=\"tablist\"\n aria-label={ariaLabel}\n aria-orientation=\"horizontal\"\n className=\"flex min-w-0 flex-1 items-stretch overflow-x-auto [scrollbar-width:thin]\"\n onFocus={() => (hadFocus.current = true)}\n onBlur={(event) => {\n if (!listRef.current?.contains(event.relatedTarget)) hadFocus.current = false;\n }}\n >\n {tabs.map((tab, i) => {\n const active = tab.id === activeId;\n const closeable = tab.closeable !== false && Boolean(onClose);\n const tabId = `${baseId}-tab-${i}`;\n return (\n <div\n key={tab.id}\n data-slot=\"editor-tab\"\n data-state={active ? 'active' : 'inactive'}\n data-dirty={tab.dirty || undefined}\n data-dragging={dragId === tab.id || undefined}\n data-drop={\n dragId === null\n ? undefined\n : dropGap === i\n ? 'before'\n : dropGap === tabs.length && i === tabs.length - 1\n ? 'after'\n : undefined\n }\n onPointerDown={(event) => startDrag(event, tab.id)}\n onClickCapture={(event) => {\n // Swallow the click that ends a drag.\n if (dragged.current) {\n dragged.current = false;\n event.stopPropagation();\n event.preventDefault();\n }\n }}\n onAuxClick={(event) => {\n if (event.button === 1 && closeable) {\n event.preventDefault();\n onClose?.(tab.id);\n }\n }}\n onContextMenu={\n onTabContextMenu ? (event) => onTabContextMenu(tab.id, event) : undefined\n }\n className={cn(\n 'group/tab relative flex max-w-60 shrink-0 items-center border-e text-[13px] text-muted-foreground',\n 'hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground',\n // The active tab's top edge carries the brand colour.\n 'data-[state=active]:before:absolute data-[state=active]:before:inset-x-0 data-[state=active]:before:top-0 data-[state=active]:before:h-0.5 data-[state=active]:before:bg-brand data-[state=active]:before:content-[\"\"]',\n 'data-[dragging]:opacity-50 data-[dragging]:select-none',\n // Where a dragged tab will land.\n 'data-[drop=before]:shadow-[inset_2px_0_0_var(--brand)] data-[drop=after]:shadow-[inset_-2px_0_0_var(--brand)]',\n )}\n >\n <button\n ref={(el) => {\n if (el) tabRefs.current.set(tab.id, el);\n else tabRefs.current.delete(tab.id);\n }}\n type=\"button\"\n role=\"tab\"\n id={tabId}\n aria-selected={active}\n aria-controls={tab.controls}\n aria-describedby={tab.description ? `${tabId}-desc` : undefined}\n title={tab.description}\n tabIndex={tab.id === tabStop ? 0 : -1}\n onFocus={() => setFocusedId(tab.id)}\n onClick={() => onActiveChange(tab.id)}\n onKeyDown={(event) => onKeyDown(event, tab)}\n className={cn(\n 'flex h-full min-w-0 items-center gap-1.5 ps-3 outline-none focus-visible:shadow-[inset_0_0_0_1px_var(--ring)]',\n closeable ? 'pe-1' : 'pe-3',\n )}\n >\n {tab.icon && (\n <span aria-hidden className=\"flex shrink-0 [&_svg]:size-4\">\n {tab.icon}\n </span>\n )}\n <span className={cn('truncate', tab.preview && 'italic')}>{tab.label}</span>\n {tab.dirty && <span className=\"sr-only\">, unsaved changes</span>}\n </button>\n {tab.description && (\n <span id={`${tabId}-desc`} hidden>\n {tab.description}\n </span>\n )}\n {closeable ? (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={`Close ${tab.label}`}\n title=\"Close (Delete)\"\n onClick={() => onClose?.(tab.id)}\n className=\"me-1 flex size-5 shrink-0 items-center justify-center rounded-xs text-muted-foreground outline-none hover:bg-muted hover:text-foreground\"\n >\n {tab.dirty && (\n <span\n aria-hidden\n className=\"size-2 rounded-full bg-foreground/70 group-hover/tab:hidden\"\n />\n )}\n <X\n aria-hidden\n className={cn(\n 'size-3.5',\n tab.dirty\n ? 'hidden group-hover/tab:block'\n : 'opacity-0 group-hover/tab:opacity-100 group-data-[state=active]/tab:opacity-100 group-focus-within/tab:opacity-100',\n )}\n />\n </button>\n ) : tab.dirty ? (\n <span aria-hidden className=\"me-3 size-2 shrink-0 rounded-full bg-foreground/70\" />\n ) : null}\n </div>\n );\n })}\n </div>\n {actions && (\n <div data-slot=\"editor-tabs-actions\" className=\"flex shrink-0 items-center gap-0.5 px-1\">\n {actions}\n </div>\n )}\n </div>\n );\n}\n\nexport { EditorTabs };\n"],"mappings":";;;;;;;;;;;;AAsDA,SAAS,WAAW,EAClB,MACA,UACA,gBACA,SACA,QACA,SACA,kBACA,WACA,cAAc,WACd,GAAG,SACe;CAClB,MAAM,SAAS,MAAM,MAAM;CAC3B,MAAM,UAAU,MAAM,uBAAO,IAAI,IAA+B,CAAC;CACjE,MAAM,UAAU,MAAM,OAAuB,IAAI;CACjD,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAwB,IAAI;CACpE,MAAM,CAAC,QAAQ,aAAa,MAAM,SAAwB,IAAI;CAG9D,MAAM,CAAC,SAAS,cAAc,MAAM,SAAwB,IAAI;CAEhE,MAAM,UAAU,MAAM,OAAO,KAAK;CAClC,MAAM,cAAc,MAAM,OAA4B,IAAI;CAC1D,MAAM,sBAAsB,YAAY,UAAU,GAAG,CAAC,CAAC;CACvD,MAAM,UAAU,MAAM,OAAiB,CAAC,CAAC;CACzC,MAAM,WAAW,MAAM,OAAO,KAAK;CAEnC,MAAM,MAAM,KAAK,KAAK,MAAM,EAAE,EAAE;CAChC,MAAM,SAAS,IAAI,KAAK,IAAQ;CAChC,MAAM,WACH,aAAa,IAAI,SAAS,SAAS,IAAI,YAAY,UACnD,YAAY,IAAI,SA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,EAAE;OAC/B,WAAU;OANZ,UAAA,CAQG,IAAI,SACH,oBAAC,QAAD;QACE,eAAA;QACA,WAAU;OACX,CAAA,GAEH,oBAAC,GAAD;QACE,eAAA;QACA,WAAW,GACT,YACA,IAAI,QACA,iCACA,oHACN;OACD,CAAA,CACK;MACN,CAAA,IAAA,IAAI,QACN,oBAAC,QAAD;OAAM,eAAA;OAAY,WAAU;MAAsD,CAAA,IAChF;KACD;IAxGE,GAAA,IAAI,EAwGN;GAET,CAAC;EACE,CAAA,GACJ,WACC,oBAAC,OAAD;GAAK,aAAU;GAAsB,WAAU;GAC5C,UAAA;EACE,CAAA,CAEJ;;AAET"}
|
|
1
|
+
{"version":3,"file":"editor-tabs.js","names":[],"sources":["../../src/components/editor-tabs.tsx"],"sourcesContent":["import X from '@burtson-labs/icons/react/x';\nimport * as React from 'react';\n\nimport { cn, focusRingClasses } from '../lib/utils';\n\nexport interface EditorTab {\n /** Stable identity, usually the file path. */\n id: string;\n label: string;\n /** Full path or context; the tooltip and the accessible description. */\n description?: string;\n icon?: React.ReactNode;\n /** Unsaved changes: a dot replaces the close button until hover. */\n dirty?: boolean;\n /** Default true. */\n closeable?: boolean;\n /** A preview tab that the next opened file replaces; shown in italics. */\n preview?: boolean;\n /** The id of the panel this tab shows, for aria-controls. */\n controls?: string;\n}\n\nexport interface EditorTabsProps extends Omit<\n React.ComponentProps<'div'>,\n 'children' | 'aria-label'\n> {\n tabs: EditorTab[];\n activeId: string | null;\n onActiveChange: (id: string) => void;\n /**\n * A request to close. The component never removes a tab itself: for a dirty\n * tab, ask the person (save, discard, cancel) and then update `tabs`.\n */\n onClose?: (id: string) => void;\n /**\n * Reorder by drag or Ctrl+Shift+PageUp/PageDown. `toIndex` is the new position.\n * Dragging uses pointer events, not HTML5 drag and drop, so it also works in\n * desktop webviews (Tauri, Electron) that intercept native drags.\n */\n onMove?: (id: string, toIndex: number) => void;\n /** Required: e.g. \"Open editors\". */\n 'aria-label': string;\n /** Right-hand slot for split, more and similar buttons. */\n actions?: React.ReactNode;\n /** Right-click on a tab. */\n onTabContextMenu?: (id: string, event: React.MouseEvent) => void;\n}\n\n/**\n * The strip of open files above an editor. One tab stop; Left/Right/Home/End\n * move focus, Enter or Space opens, Delete asks to close, Ctrl+Shift+PageUp\n * and PageDown move the tab. Middle-click closes. The strip scrolls when the\n * tabs overflow and keeps the active tab in view.\n */\nconst EditorTabs = React.forwardRef<HTMLDivElement, EditorTabsProps>(function EditorTabs(\n {\n tabs,\n activeId,\n onActiveChange,\n onClose,\n onMove,\n actions,\n onTabContextMenu,\n className,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n) {\n const baseId = React.useId();\n const tabRefs = React.useRef(new Map<string, HTMLButtonElement>());\n const listRef = React.useRef<HTMLDivElement>(null);\n const [focusedId, setFocusedId] = React.useState<string | null>(null);\n const [dragId, setDragId] = React.useState<string | null>(null);\n // The gap a dragged tab would land in: 0 is before the first tab,\n // tabs.length after the last.\n const [dropGap, setDropGap] = React.useState<number | null>(null);\n // Set once a press becomes a drag, so the click that ends it does nothing.\n const dragged = React.useRef(false);\n const dragCleanup = React.useRef<(() => void) | null>(null);\n React.useEffect(() => () => dragCleanup.current?.(), []);\n const lastIds = React.useRef<string[]>([]);\n const hadFocus = React.useRef(false);\n\n const ids = tabs.map((t) => t.id);\n const idsKey = ids.join('\\u0000');\n const tabStop =\n (focusedId && ids.includes(focusedId) ? focusedId : null) ??\n (activeId && ids.includes(activeId) ? activeId : null) ??\n ids[0] ??\n null;\n\n React.useEffect(() => {\n if (activeId)\n tabRefs.current.get(activeId)?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' });\n }, [activeId]);\n\n // After a close, keep keyboard focus in the strip: the active tab if the\n // app picked one, else the neighbour at the closed tab's position.\n React.useLayoutEffect(() => {\n if (focusedId && !ids.includes(focusedId)) {\n const next =\n (activeId && ids.includes(activeId) ? activeId : null) ??\n ids[Math.min(Math.max(0, lastIds.current.indexOf(focusedId)), ids.length - 1)] ??\n null;\n setFocusedId(next);\n const active = document.activeElement;\n if (next && hadFocus.current && (!active || active === document.body))\n tabRefs.current.get(next)?.focus();\n }\n lastIds.current = ids;\n // ids is derived from tabs each render; idsKey is its stable form.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [focusedId, idsKey, activeId]);\n\n /** Which gap the pointer is over, measured from the rendered tabs. */\n const gapAt = (clientX: number) => {\n const els = Array.from(\n listRef.current?.querySelectorAll<HTMLElement>('[data-slot=\"editor-tab\"]') ?? [],\n );\n const rtl = listRef.current ? getComputedStyle(listRef.current).direction === 'rtl' : false;\n for (let i = 0; i < els.length; i++) {\n const rect = els[i]!.getBoundingClientRect();\n const mid = rect.left + rect.width / 2;\n if (rtl ? clientX > mid : clientX < mid) return i;\n }\n return els.length;\n };\n\n const startDrag = (event: React.PointerEvent, id: string) => {\n if (!onMove || event.button !== 0) return;\n dragCleanup.current?.();\n dragged.current = false;\n const downX = event.clientX;\n const move = (e: PointerEvent) => {\n // A few pixels of slop so an ordinary click is not read as a drag.\n if (!dragged.current && Math.abs(e.clientX - downX) < 4) return;\n if (!dragged.current) {\n dragged.current = true;\n setDragId(id);\n }\n setDropGap(gapAt(e.clientX));\n };\n const stop = (e: PointerEvent | null) => {\n window.removeEventListener('pointermove', move);\n window.removeEventListener('pointerup', up);\n window.removeEventListener('pointercancel', cancel);\n dragCleanup.current = null;\n if (e && dragged.current) {\n const from = lastIds.current.indexOf(id);\n const gap = gapAt(e.clientX);\n const to = gap > from ? gap - 1 : gap;\n if (from !== -1 && to !== from) onMove(id, to);\n }\n setDragId(null);\n setDropGap(null);\n };\n const up = (e: PointerEvent) => stop(e);\n const cancel = () => stop(null);\n window.addEventListener('pointermove', move);\n window.addEventListener('pointerup', up);\n window.addEventListener('pointercancel', cancel);\n dragCleanup.current = () => stop(null);\n };\n\n const focusTab = (id: string | undefined) => {\n if (!id) return;\n setFocusedId(id);\n tabRefs.current.get(id)?.focus();\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLButtonElement>, tab: EditorTab) => {\n const i = ids.indexOf(tab.id);\n const rtl = listRef.current ? getComputedStyle(listRef.current).direction === 'rtl' : false;\n const [prev, next] = rtl ? ['ArrowRight', 'ArrowLeft'] : ['ArrowLeft', 'ArrowRight'];\n let handled = true;\n if (event.ctrlKey && event.shiftKey && (event.key === 'PageUp' || event.key === 'PageDown')) {\n const to = event.key === 'PageUp' ? i - 1 : i + 1;\n if (onMove && to >= 0 && to < ids.length) onMove(tab.id, to);\n } else if (event.key === prev) focusTab(ids[(i - 1 + ids.length) % ids.length]);\n else if (event.key === next) focusTab(ids[(i + 1) % ids.length]);\n else if (event.key === 'Home') focusTab(ids[0]);\n else if (event.key === 'End') focusTab(ids[ids.length - 1]);\n else if (event.key === 'Delete' && tab.closeable !== false && onClose) onClose(tab.id);\n else handled = false;\n if (handled) event.preventDefault();\n };\n\n return (\n <div\n ref={ref}\n data-slot=\"editor-tabs\"\n className={cn('flex h-9 min-w-0 items-stretch border-b bg-surface-muted', className)}\n {...props}\n >\n <div\n ref={listRef}\n role=\"tablist\"\n aria-label={ariaLabel}\n aria-orientation=\"horizontal\"\n className=\"flex min-w-0 flex-1 items-stretch overflow-x-auto [scrollbar-width:thin]\"\n onFocus={() => (hadFocus.current = true)}\n onBlur={(event) => {\n if (!listRef.current?.contains(event.relatedTarget)) hadFocus.current = false;\n }}\n >\n {tabs.map((tab, i) => {\n const active = tab.id === activeId;\n const closeable = tab.closeable !== false && Boolean(onClose);\n const tabId = `${baseId}-tab-${i}`;\n return (\n <div\n key={tab.id}\n data-slot=\"editor-tab\"\n data-state={active ? 'active' : 'inactive'}\n data-dirty={tab.dirty || undefined}\n data-dragging={dragId === tab.id || undefined}\n data-drop={\n dragId === null\n ? undefined\n : dropGap === i\n ? 'before'\n : dropGap === tabs.length && i === tabs.length - 1\n ? 'after'\n : undefined\n }\n onPointerDown={(event) => startDrag(event, tab.id)}\n onClickCapture={(event) => {\n // Swallow the click that ends a drag.\n if (dragged.current) {\n dragged.current = false;\n event.stopPropagation();\n event.preventDefault();\n }\n }}\n onAuxClick={(event) => {\n if (event.button === 1 && closeable) {\n event.preventDefault();\n onClose?.(tab.id);\n }\n }}\n onContextMenu={\n onTabContextMenu ? (event) => onTabContextMenu(tab.id, event) : undefined\n }\n className={cn(\n 'group/tab relative flex max-w-60 shrink-0 items-center border-e text-[13px] text-muted-foreground',\n 'hover:bg-muted/60 data-[state=active]:bg-background data-[state=active]:text-foreground',\n // The active tab's top edge carries the brand colour.\n 'data-[state=active]:before:absolute data-[state=active]:before:inset-x-0 data-[state=active]:before:top-0 data-[state=active]:before:h-0.5 data-[state=active]:before:bg-brand data-[state=active]:before:content-[\"\"]',\n 'data-[dragging]:opacity-50 data-[dragging]:select-none',\n // Where a dragged tab will land.\n 'data-[drop=before]:shadow-[inset_2px_0_0_var(--brand)] data-[drop=after]:shadow-[inset_-2px_0_0_var(--brand)]',\n )}\n >\n <button\n ref={(el) => {\n if (el) tabRefs.current.set(tab.id, el);\n else tabRefs.current.delete(tab.id);\n }}\n type=\"button\"\n role=\"tab\"\n id={tabId}\n aria-selected={active}\n aria-controls={tab.controls}\n aria-describedby={tab.description ? `${tabId}-desc` : undefined}\n title={tab.description}\n tabIndex={tab.id === tabStop ? 0 : -1}\n onFocus={() => setFocusedId(tab.id)}\n onClick={() => onActiveChange(tab.id)}\n onKeyDown={(event) => onKeyDown(event, tab)}\n className={cn(\n 'flex h-full min-w-0 items-center gap-1.5 ps-3',\n focusRingClasses,\n 'focus-visible:outline-offset-[-2px]',\n closeable ? 'pe-1' : 'pe-3',\n )}\n >\n {tab.icon && (\n <span aria-hidden className=\"flex shrink-0 [&_svg]:size-4\">\n {tab.icon}\n </span>\n )}\n <span className={cn('truncate', tab.preview && 'italic')}>{tab.label}</span>\n {tab.dirty && <span className=\"sr-only\">, unsaved changes</span>}\n </button>\n {tab.description && (\n <span id={`${tabId}-desc`} hidden>\n {tab.description}\n </span>\n )}\n {closeable ? (\n <button\n type=\"button\"\n tabIndex={-1}\n aria-label={`Close ${tab.label}`}\n title=\"Close (Delete)\"\n onClick={() => onClose?.(tab.id)}\n className={cn(\n 'me-1 flex size-5 shrink-0 items-center justify-center rounded-xs text-muted-foreground hover:bg-muted hover:text-foreground',\n focusRingClasses,\n 'focus-visible:outline-offset-[-1px]',\n )}\n >\n {tab.dirty && (\n <span\n aria-hidden\n className=\"size-2 rounded-full bg-foreground/70 group-hover/tab:hidden\"\n />\n )}\n <X\n aria-hidden\n className={cn(\n 'size-3.5',\n tab.dirty\n ? 'hidden group-hover/tab:block'\n : 'opacity-0 group-hover/tab:opacity-100 group-data-[state=active]/tab:opacity-100 group-focus-within/tab:opacity-100',\n )}\n />\n </button>\n ) : tab.dirty ? (\n <span aria-hidden className=\"me-3 size-2 shrink-0 rounded-full bg-foreground/70\" />\n ) : null}\n </div>\n );\n })}\n </div>\n {actions && (\n <div data-slot=\"editor-tabs-actions\" className=\"flex shrink-0 items-center gap-0.5 px-1\">\n {actions}\n </div>\n )}\n </div>\n );\n});\n\nexport { EditorTabs };\n"],"mappings":";;;;;;;;;;;;AAsDA,IAAM,aAAa,MAAM,WAA4C,SAAS,WAC5E,EACE,MACA,UACA,gBACA,SACA,QACA,SACA,kBACA,WACA,cAAc,WACd,GAAG,SAEL,KACA;CACA,MAAM,SAAS,MAAM,MAAM;CAC3B,MAAM,UAAU,MAAM,uBAAO,IAAI,IAA+B,CAAC;CACjE,MAAM,UAAU,MAAM,OAAuB,IAAI;CACjD,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAwB,IAAI;CACpE,MAAM,CAAC,QAAQ,aAAa,MAAM,SAAwB,IAAI;CAG9D,MAAM,CAAC,SAAS,cAAc,MAAM,SAAwB,IAAI;CAEhE,MAAM,UAAU,MAAM,OAAO,KAAK;CAClC,MAAM,cAAc,MAAM,OAA4B,IAAI;CAC1D,MAAM,sBAAsB,YAAY,UAAU,GAAG,CAAC,CAAC;CACvD,MAAM,UAAU,MAAM,OAAiB,CAAC,CAAC;C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AAA;OACzD;;MACP,IAAI,eACH,oBAAC,QAAD;OAAM,IAAI,GAAG,MAAM;OAAQ,QAAA;OACxB,UAAA,IAAI;MACD,CAAA;MAEP,YACC,qBAAC,UAAD;OACE,MAAK;OACL,UAAU;OACV,cAAY,SAAS,IAAI;OACzB,OAAM;OACN,eAAe,UAAU,IAAI,EAAE;OAC/B,WAAW,GACT,+HACA,kBACA,qCACF;OAVF,UAAA,CAYG,IAAI,SACH,oBAAC,QAAD;QACE,eAAA;QACA,WAAU;OACX,CAAA,GAEH,oBAAC,GAAD;QACE,eAAA;QACA,WAAW,GACT,YACA,IAAI,QACA,iCACA,oHACN;OACD,CAAA,CACK;MACN,CAAA,IAAA,IAAI,QACN,oBAAC,QAAD;OAAM,eAAA;OAAY,WAAU;MAAsD,CAAA,IAChF;KACD;IA9GE,GAAA,IAAI,EA8GN;GAET,CAAC;EACE,CAAA,GACJ,WACC,oBAAC,OAAD;GAAK,aAAU;GAAsB,WAAU;GAC5C,UAAA;EACE,CAAA,CAEJ;;AAET,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
declare
|
|
3
|
-
declare
|
|
4
|
-
declare
|
|
5
|
-
declare
|
|
6
|
-
declare
|
|
2
|
+
declare const EmptyState: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const EmptyStateIcon: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const EmptyStateTitle: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
5
|
+
declare const EmptyStateDescription: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
6
|
+
declare const EmptyStateActions: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIcon, EmptyStateTitle };
|
|
@@ -1,44 +1,49 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/utils.js";
|
|
3
|
-
import "react";
|
|
3
|
+
import * as React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/empty-state.tsx
|
|
6
|
-
function EmptyState({ className, ...props }) {
|
|
6
|
+
var EmptyState = React.forwardRef(function EmptyState({ className, ...props }, ref) {
|
|
7
7
|
return /* @__PURE__ */ jsx("div", {
|
|
8
|
+
ref,
|
|
8
9
|
"data-slot": "empty-state",
|
|
9
10
|
className: cn("flex min-h-64 flex-col items-center justify-center rounded-xl border border-dashed border-border-strong bg-surface-muted/60 px-6 py-10 text-center", className),
|
|
10
11
|
...props
|
|
11
12
|
});
|
|
12
|
-
}
|
|
13
|
-
function EmptyStateIcon({ className, ...props }) {
|
|
13
|
+
});
|
|
14
|
+
var EmptyStateIcon = React.forwardRef(function EmptyStateIcon({ className, ...props }, ref) {
|
|
14
15
|
return /* @__PURE__ */ jsx("div", {
|
|
16
|
+
ref,
|
|
15
17
|
"data-slot": "empty-state-icon",
|
|
16
18
|
className: cn("mb-4 grid size-10 place-items-center rounded-lg border border-brand/15 bg-brand-soft text-brand [&_svg]:size-5", className),
|
|
17
19
|
...props
|
|
18
20
|
});
|
|
19
|
-
}
|
|
20
|
-
function EmptyStateTitle({ className, children, ...props }) {
|
|
21
|
+
});
|
|
22
|
+
var EmptyStateTitle = React.forwardRef(function EmptyStateTitle({ className, children, ...props }, ref) {
|
|
21
23
|
return /* @__PURE__ */ jsx("h3", {
|
|
24
|
+
ref,
|
|
22
25
|
"data-slot": "empty-state-title",
|
|
23
26
|
className: cn("text-sm font-semibold text-foreground", className),
|
|
24
27
|
...props,
|
|
25
28
|
children
|
|
26
29
|
});
|
|
27
|
-
}
|
|
28
|
-
function EmptyStateDescription({ className, ...props }) {
|
|
30
|
+
});
|
|
31
|
+
var EmptyStateDescription = React.forwardRef(function EmptyStateDescription({ className, ...props }, ref) {
|
|
29
32
|
return /* @__PURE__ */ jsx("p", {
|
|
33
|
+
ref,
|
|
30
34
|
"data-slot": "empty-state-description",
|
|
31
35
|
className: cn("mt-1 max-w-md text-sm leading-5 text-muted-foreground", className),
|
|
32
36
|
...props
|
|
33
37
|
});
|
|
34
|
-
}
|
|
35
|
-
function EmptyStateActions({ className, ...props }) {
|
|
38
|
+
});
|
|
39
|
+
var EmptyStateActions = React.forwardRef(function EmptyStateActions({ className, ...props }, ref) {
|
|
36
40
|
return /* @__PURE__ */ jsx("div", {
|
|
41
|
+
ref,
|
|
37
42
|
"data-slot": "empty-state-actions",
|
|
38
43
|
className: cn("mt-5 flex flex-wrap justify-center gap-2", className),
|
|
39
44
|
...props
|
|
40
45
|
});
|
|
41
|
-
}
|
|
46
|
+
});
|
|
42
47
|
//#endregion
|
|
43
48
|
export { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIcon, EmptyStateTitle };
|
|
44
49
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-state.js","names":[],"sources":["../../src/components/empty-state.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\
|
|
1
|
+
{"version":3,"file":"empty-state.js","names":[],"sources":["../../src/components/empty-state.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\nconst EmptyState = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(\n function EmptyState({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n data-slot=\"empty-state\"\n className={cn(\n 'flex min-h-64 flex-col items-center justify-center rounded-xl border border-dashed border-border-strong bg-surface-muted/60 px-6 py-10 text-center',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nconst EmptyStateIcon = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(\n function EmptyStateIcon({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n data-slot=\"empty-state-icon\"\n className={cn(\n 'mb-4 grid size-10 place-items-center rounded-lg border border-brand/15 bg-brand-soft text-brand [&_svg]:size-5',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nconst EmptyStateTitle = React.forwardRef<HTMLHeadingElement, React.ComponentProps<'h3'>>(\n function EmptyStateTitle({ className, children, ...props }, ref) {\n return (\n <h3\n ref={ref}\n data-slot=\"empty-state-title\"\n className={cn('text-sm font-semibold text-foreground', className)}\n {...props}\n >\n {children}\n </h3>\n );\n },\n);\n\nconst EmptyStateDescription = React.forwardRef<HTMLParagraphElement, React.ComponentProps<'p'>>(\n function EmptyStateDescription({ className, ...props }, ref) {\n return (\n <p\n ref={ref}\n data-slot=\"empty-state-description\"\n className={cn('mt-1 max-w-md text-sm leading-5 text-muted-foreground', className)}\n {...props}\n />\n );\n },\n);\n\nconst EmptyStateActions = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'>>(\n function EmptyStateActions({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n data-slot=\"empty-state-actions\"\n className={cn('mt-5 flex flex-wrap justify-center gap-2', className)}\n {...props}\n />\n );\n },\n);\n\nexport { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIcon, EmptyStateTitle };\n"],"mappings":";;;;;AAIA,IAAM,aAAa,MAAM,WACvB,SAAS,WAAW,EAAE,WAAW,GAAG,SAAS,KAAK;CAChD,OACE,oBAAC,OAAD;EACO;EACL,aAAU;EACV,WAAW,GACT,sJACA,SACF;EACA,GAAI;CACL,CAAA;AAEL,CACF;AAEA,IAAM,iBAAiB,MAAM,WAC3B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,oBAAC,OAAD;EACO;EACL,aAAU;EACV,WAAW,GACT,kHACA,SACF;EACA,GAAI;CACL,CAAA;AAEL,CACF;AAEA,IAAM,kBAAkB,MAAM,WAC5B,SAAS,gBAAgB,EAAE,WAAW,UAAU,GAAG,SAAS,KAAK;CAC/D,OACE,oBAAC,MAAD;EACO;EACL,aAAU;EACV,WAAW,GAAG,yCAAyC,SAAS;EAChE,GAAI;EAEH;CACC,CAAA;AAER,CACF;AAEA,IAAM,wBAAwB,MAAM,WAClC,SAAS,sBAAsB,EAAE,WAAW,GAAG,SAAS,KAAK;CAC3D,OACE,oBAAC,KAAD;EACO;EACL,aAAU;EACV,WAAW,GAAG,yDAAyD,SAAS;EAChF,GAAI;CACL,CAAA;AAEL,CACF;AAEA,IAAM,oBAAoB,MAAM,WAC9B,SAAS,kBAAkB,EAAE,WAAW,GAAG,SAAS,KAAK;CACvD,OACE,oBAAC,OAAD;EACO;EACL,aAAU;EACV,WAAW,GAAG,4CAA4C,SAAS;EACnE,GAAI;CACL,CAAA;AAEL,CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ErrorSummaryItem {
|
|
3
|
+
/** The id of the field with the problem; the entry links to it. */
|
|
4
|
+
id: string;
|
|
5
|
+
message: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export interface ErrorSummaryProps extends Omit<React.ComponentProps<'div'>, 'children' | 'title' | 'onSelect'> {
|
|
8
|
+
/** Nothing renders while this is empty. */
|
|
9
|
+
errors: ErrorSummaryItem[];
|
|
10
|
+
title?: React.ReactNode;
|
|
11
|
+
/** Called with the field id when an entry is chosen, after the field is focused. */
|
|
12
|
+
onSelect?: (id: string) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The errors of a long form, at the top of it after a failed submit, each a
|
|
16
|
+
* link to its field. Focus moves here when errors appear, so a screen reader
|
|
17
|
+
* hears the list; choosing an entry focuses the field and scrolls it into
|
|
18
|
+
* view.
|
|
19
|
+
*/
|
|
20
|
+
declare const ErrorSummary: React.ForwardRefExoticComponent<Omit<ErrorSummaryProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export { ErrorSummary };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn, focusRingClasses } from "../lib/utils.js";
|
|
3
|
+
import { Alert, AlertDescription, AlertTitle } from "./alert.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import AlertCircle from "@burtson-labs/icons/react/alert-circle";
|
|
7
|
+
//#region src/components/error-summary.tsx
|
|
8
|
+
/**
|
|
9
|
+
* The errors of a long form, at the top of it after a failed submit, each a
|
|
10
|
+
* link to its field. Focus moves here when errors appear, so a screen reader
|
|
11
|
+
* hears the list; choosing an entry focuses the field and scrolls it into
|
|
12
|
+
* view.
|
|
13
|
+
*/
|
|
14
|
+
var ErrorSummary = React.forwardRef(function ErrorSummary({ errors, title = "Fix these to continue", onSelect, className, ...props }, ref) {
|
|
15
|
+
const local = React.useRef(null);
|
|
16
|
+
const count = errors.length;
|
|
17
|
+
React.useEffect(() => {
|
|
18
|
+
if (count) local.current?.focus();
|
|
19
|
+
}, [count]);
|
|
20
|
+
if (!count) return null;
|
|
21
|
+
return /* @__PURE__ */ jsx("div", {
|
|
22
|
+
ref: (node) => {
|
|
23
|
+
local.current = node;
|
|
24
|
+
if (typeof ref === "function") ref(node);
|
|
25
|
+
else if (ref) ref.current = node;
|
|
26
|
+
},
|
|
27
|
+
tabIndex: -1,
|
|
28
|
+
"data-slot": "error-summary",
|
|
29
|
+
className: cn("outline-none", className),
|
|
30
|
+
...props,
|
|
31
|
+
children: /* @__PURE__ */ jsxs(Alert, {
|
|
32
|
+
variant: "destructive",
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx(AlertCircle, {}),
|
|
35
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: title }),
|
|
36
|
+
/* @__PURE__ */ jsx(AlertDescription, { children: /* @__PURE__ */ jsx("ul", {
|
|
37
|
+
className: "grid gap-0.5",
|
|
38
|
+
children: errors.map(({ id, message }) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", {
|
|
39
|
+
href: `#${id}`,
|
|
40
|
+
className: cn("rounded-xs text-foreground underline underline-offset-2 hover:text-destructive", focusRingClasses),
|
|
41
|
+
onClick: (event) => {
|
|
42
|
+
const el = document.getElementById(id);
|
|
43
|
+
if (!el) return;
|
|
44
|
+
event.preventDefault();
|
|
45
|
+
el.focus();
|
|
46
|
+
el.scrollIntoView?.({
|
|
47
|
+
block: "center",
|
|
48
|
+
behavior: typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth"
|
|
49
|
+
});
|
|
50
|
+
onSelect?.(id);
|
|
51
|
+
},
|
|
52
|
+
children: message
|
|
53
|
+
}) }, id))
|
|
54
|
+
}) })
|
|
55
|
+
]
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
//#endregion
|
|
60
|
+
export { ErrorSummary };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=error-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-summary.js","names":[],"sources":["../../src/components/error-summary.tsx"],"sourcesContent":["import AlertCircle from '@burtson-labs/icons/react/alert-circle';\nimport * as React from 'react';\n\nimport { cn, focusRingClasses } from '../lib/utils';\n\nimport { Alert, AlertDescription, AlertTitle } from './alert';\n\nexport interface ErrorSummaryItem {\n /** The id of the field with the problem; the entry links to it. */\n id: string;\n message: React.ReactNode;\n}\n\nexport interface ErrorSummaryProps extends Omit<\n React.ComponentProps<'div'>,\n 'children' | 'title' | 'onSelect'\n> {\n /** Nothing renders while this is empty. */\n errors: ErrorSummaryItem[];\n title?: React.ReactNode;\n /** Called with the field id when an entry is chosen, after the field is focused. */\n onSelect?: (id: string) => void;\n}\n\n/**\n * The errors of a long form, at the top of it after a failed submit, each a\n * link to its field. Focus moves here when errors appear, so a screen reader\n * hears the list; choosing an entry focuses the field and scrolls it into\n * view.\n */\nconst ErrorSummary = React.forwardRef<HTMLDivElement, ErrorSummaryProps>(function ErrorSummary(\n { errors, title = 'Fix these to continue', onSelect, className, ...props },\n ref,\n) {\n const local = React.useRef<HTMLDivElement | null>(null);\n const count = errors.length;\n React.useEffect(() => {\n if (count) local.current?.focus();\n }, [count]);\n if (!count) return null;\n return (\n <div\n ref={(node) => {\n local.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n tabIndex={-1}\n data-slot=\"error-summary\"\n className={cn('outline-none', className)}\n {...props}\n >\n <Alert variant=\"destructive\">\n <AlertCircle />\n <AlertTitle>{title}</AlertTitle>\n <AlertDescription>\n <ul className=\"grid gap-0.5\">\n {errors.map(({ id, message }) => (\n <li key={id}>\n <a\n href={`#${id}`}\n className={cn(\n 'rounded-xs text-foreground underline underline-offset-2 hover:text-destructive',\n focusRingClasses,\n )}\n onClick={(event) => {\n const el = document.getElementById(id);\n if (!el) return;\n event.preventDefault();\n el.focus();\n el.scrollIntoView?.({\n block: 'center',\n behavior:\n typeof matchMedia === 'function' &&\n matchMedia('(prefers-reduced-motion: reduce)').matches\n ? 'auto'\n : 'smooth',\n });\n onSelect?.(id);\n }}\n >\n {message}\n </a>\n </li>\n ))}\n </ul>\n </AlertDescription>\n </Alert>\n </div>\n );\n});\n\nexport { ErrorSummary };\n"],"mappings":";;;;;;;;;;;;;AA8BA,IAAM,eAAe,MAAM,WAA8C,SAAS,aAChF,EAAE,QAAQ,QAAQ,yBAAyB,UAAU,WAAW,GAAG,SACnE,KACA;CACA,MAAM,QAAQ,MAAM,OAA8B,IAAI;CACtD,MAAM,QAAQ,OAAO;CACrB,MAAM,gBAAgB;EACpB,IAAI,OAA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