@stll/ui 0.0.1-placeholder.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -0
- package/dist/components/accordion.d.ts +8 -0
- package/dist/components/accordion.js +38 -0
- package/dist/components/alert-dialog.d.ts +32 -0
- package/dist/components/alert-dialog.js +75 -0
- package/dist/components/avatar.d.ts +7 -0
- package/dist/components/avatar.js +22 -0
- package/dist/components/bidi-text.d.ts +24 -0
- package/dist/components/bidi-text.js +38 -0
- package/dist/components/brand-icons.d.ts +7 -0
- package/dist/components/brand-icons.js +18 -0
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.js +61 -0
- package/dist/components/button-variants.d.ts +17 -0
- package/dist/components/button-variants.js +43 -0
- package/dist/components/button.d.ts +20 -0
- package/dist/components/button.js +53 -0
- package/dist/components/checkbox.d.ts +5 -0
- package/dist/components/checkbox.js +44 -0
- package/dist/components/color-picker.d.ts +47 -0
- package/dist/components/color-picker.js +249 -0
- package/dist/components/combobox.d.ts +40 -0
- package/dist/components/combobox.js +208 -0
- package/dist/components/command.d.ts +34 -0
- package/dist/components/command.js +100 -0
- package/dist/components/date-picker-popover.d.ts +29 -0
- package/dist/components/date-picker-popover.js +548 -0
- package/dist/components/date-picker-popover.logic.d.ts +14 -0
- package/dist/components/date-picker-popover.logic.js +26 -0
- package/dist/components/destructive-action-confirmation.d.ts +21 -0
- package/dist/components/destructive-action-confirmation.js +60 -0
- package/dist/components/destructive-confirm-dialog.d.ts +17 -0
- package/dist/components/destructive-confirm-dialog.js +49 -0
- package/dist/components/dialog.d.ts +37 -0
- package/dist/components/dialog.js +92 -0
- package/dist/components/directional-icon.d.ts +30 -0
- package/dist/components/directional-icon.js +12 -0
- package/dist/components/field.d.ts +11 -0
- package/dist/components/field.js +34 -0
- package/dist/components/form.d.ts +5 -0
- package/dist/components/form.js +12 -0
- package/dist/components/frame.d.ts +10 -0
- package/dist/components/frame.js +35 -0
- package/dist/components/hex-color-picker.d.ts +11 -0
- package/dist/components/hex-color-picker.js +366 -0
- package/dist/components/input-group.d.ts +15 -0
- package/dist/components/input-group.js +53 -0
- package/dist/components/input-otp.d.ts +13 -0
- package/dist/components/input-otp.js +39 -0
- package/dist/components/input.d.ts +12 -0
- package/dist/components/input.js +46 -0
- package/dist/components/label.d.ts +5 -0
- package/dist/components/label.js +18 -0
- package/dist/components/menu.d.ts +44 -0
- package/dist/components/menu.js +152 -0
- package/dist/components/outline-rail.d.ts +43 -0
- package/dist/components/outline-rail.js +416 -0
- package/dist/components/pagination.d.ts +17 -0
- package/dist/components/pagination.js +78 -0
- package/dist/components/popover.d.ts +34 -0
- package/dist/components/popover.js +67 -0
- package/dist/components/preview-card.d.ts +12 -0
- package/dist/components/preview-card.js +25 -0
- package/dist/components/preview-pane.d.ts +23 -0
- package/dist/components/preview-pane.js +33 -0
- package/dist/components/scroll-area.d.ts +19 -0
- package/dist/components/scroll-area.js +38 -0
- package/dist/components/scroll-to-top.d.ts +12 -0
- package/dist/components/scroll-to-top.js +43 -0
- package/dist/components/secret-input.d.ts +9 -0
- package/dist/components/secret-input.js +38 -0
- package/dist/components/segmented-icon-toggle.d.ts +22 -0
- package/dist/components/segmented-icon-toggle.js +30 -0
- package/dist/components/select.d.ts +25 -0
- package/dist/components/select.js +196 -0
- package/dist/components/separator.d.ts +16 -0
- package/dist/components/separator.js +26 -0
- package/dist/components/sheet.d.ts +29 -0
- package/dist/components/sheet.js +87 -0
- package/dist/components/skeleton.d.ts +4 -0
- package/dist/components/skeleton.js +10 -0
- package/dist/components/stella-mark.d.ts +5 -0
- package/dist/components/stella-mark.js +12 -0
- package/dist/components/stella-wordmark.d.ts +5 -0
- package/dist/components/stella-wordmark.js +21 -0
- package/dist/components/table.d.ts +20 -0
- package/dist/components/table.js +80 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +46 -0
- package/dist/components/textarea.d.ts +9 -0
- package/dist/components/textarea.js +31 -0
- package/dist/components/toast.d.ts +60 -0
- package/dist/components/toast.js +261 -0
- package/dist/components/tooltip-trigger-helper.d.ts +11 -0
- package/dist/components/tooltip-trigger-helper.js +14 -0
- package/dist/components/tooltip.d.ts +15 -0
- package/dist/components/tooltip.js +32 -0
- package/dist/data-table/index.d.ts +2 -0
- package/dist/data-table/index.js +2 -0
- package/dist/data-table/schema.d.ts +70 -0
- package/dist/data-table/schema.js +40 -0
- package/dist/hooks/use-contained-handler.d.ts +55 -0
- package/dist/hooks/use-contained-handler.js +54 -0
- package/dist/hooks/use-content-dir.d.ts +48 -0
- package/dist/hooks/use-content-dir.js +45 -0
- package/dist/hooks/use-mobile.d.ts +4 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-viewport-width.d.ts +5 -0
- package/dist/hooks/use-viewport-width.js +14 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +65 -0
- package/dist/inspector/chrome.d.ts +72 -0
- package/dist/inspector/chrome.js +153 -0
- package/dist/inspector/dock.d.ts +48 -0
- package/dist/inspector/dock.js +36 -0
- package/dist/inspector/index.d.ts +6 -0
- package/dist/inspector/index.js +6 -0
- package/dist/inspector/layout-tokens.d.ts +28 -0
- package/dist/inspector/layout-tokens.js +28 -0
- package/dist/inspector/pane-width.d.ts +64 -0
- package/dist/inspector/pane-width.js +53 -0
- package/dist/inspector/use-pane-width.d.ts +99 -0
- package/dist/inspector/use-pane-width.js +149 -0
- package/dist/kanban/card-properties.d.ts +27 -0
- package/dist/kanban/card-properties.js +19 -0
- package/dist/kanban/card-shell.d.ts +32 -0
- package/dist/kanban/card-shell.js +46 -0
- package/dist/kanban/column-header.d.ts +23 -0
- package/dist/kanban/column-header.js +24 -0
- package/dist/kanban/grouping.d.ts +84 -0
- package/dist/kanban/grouping.js +76 -0
- package/dist/kanban/index.d.ts +5 -0
- package/dist/kanban/index.js +5 -0
- package/dist/lib/button-disposition.d.ts +63 -0
- package/dist/lib/button-disposition.js +52 -0
- package/dist/lib/option-color.d.ts +28 -0
- package/dist/lib/option-color.js +59 -0
- package/dist/lib/overlay-layer.d.ts +22 -0
- package/dist/lib/overlay-layer.js +21 -0
- package/dist/lib/tab-order.d.ts +15 -0
- package/dist/lib/tab-order.js +15 -0
- package/dist/lib/tooltip-content.d.ts +13 -0
- package/dist/lib/tooltip-content.js +12 -0
- package/dist/lib/utils.d.ts +20 -0
- package/dist/lib/utils.js +41 -0
- package/dist/lib/week.d.ts +25 -0
- package/dist/lib/week.js +40 -0
- package/dist/styles/theme.css +1209 -0
- package/package.json +518 -2
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { OVERLAY_LAYER_CLASS_NAMES } from "../lib/overlay-layer.js";
|
|
4
|
+
import { ChevronDownIcon, ChevronUpIcon, ChevronsUpDownIcon } from "lucide-react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import * as React$1 from "react";
|
|
7
|
+
import { Select as Select$1 } from "@base-ui/react/select";
|
|
8
|
+
//#region src/components/select.tsx
|
|
9
|
+
const SelectItemDisplaysContext = React$1.createContext(/* @__PURE__ */ new Map());
|
|
10
|
+
const renderSelectedDisplay = (displays, placeholder) => (value) => {
|
|
11
|
+
if (!displays.has(value)) return placeholder ?? null;
|
|
12
|
+
return displays.get(value) ?? null;
|
|
13
|
+
};
|
|
14
|
+
const Select = ({ children, itemToStringLabel, ...props }) => {
|
|
15
|
+
const itemLabels = collectSelectItemLabels(children);
|
|
16
|
+
const itemDisplays = collectSelectItemDisplays(children);
|
|
17
|
+
const root = itemToStringLabel || itemLabels.size === 0 ? /* @__PURE__ */ jsx(Select$1.Root, {
|
|
18
|
+
itemToStringLabel,
|
|
19
|
+
...props,
|
|
20
|
+
children
|
|
21
|
+
}) : /* @__PURE__ */ jsx(Select$1.Root, {
|
|
22
|
+
itemToStringLabel: (value) => {
|
|
23
|
+
const stringValue = String(value);
|
|
24
|
+
return itemLabels.get(value) ?? stringValue;
|
|
25
|
+
},
|
|
26
|
+
...props,
|
|
27
|
+
children
|
|
28
|
+
});
|
|
29
|
+
return /* @__PURE__ */ jsx(SelectItemDisplaysContext, {
|
|
30
|
+
value: itemDisplays,
|
|
31
|
+
children: root
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const SelectTrigger = ({ className, size = "default", children, ...props }) => /* @__PURE__ */ jsxs(Select$1.Trigger, {
|
|
35
|
+
className: cn("border-input bg-background text-foreground ring-ring/24 focus-visible:border-ring aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/16 dark:bg-input/32 dark:aria-invalid:ring-destructive/24 relative inline-flex min-h-9 w-full min-w-36 items-center justify-center gap-2 rounded-lg border px-[calc(--spacing(3)-1px)] text-start text-base shadow-xs/5 transition-shadow outline-none select-none not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-data-disabled:not-focus-visible:not-aria-invalid:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-[3px] data-disabled:pointer-events-none data-disabled:opacity-64 sm:min-h-8 sm:text-sm dark:not-data-disabled:not-focus-visible:not-aria-invalid:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/6%)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [[data-disabled],:focus-visible,[aria-invalid],[data-pressed]]:shadow-none", size === "sm" && "min-h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:min-h-7", size === "lg" && "min-h-10 sm:min-h-9", className),
|
|
36
|
+
"data-slot": "select-trigger",
|
|
37
|
+
...props,
|
|
38
|
+
children: [children, /* @__PURE__ */ jsx(Select$1.Icon, {
|
|
39
|
+
"data-slot": "select-icon",
|
|
40
|
+
children: /* @__PURE__ */ jsx(ChevronsUpDownIcon, { className: "-me-1 size-4.5 opacity-80 sm:size-4" })
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
const SelectValue = ({ className, children, placeholder, ...props }) => {
|
|
44
|
+
const displays = React$1.use(SelectItemDisplaysContext);
|
|
45
|
+
if (children !== void 0 || displays.size === 0) return /* @__PURE__ */ jsx(Select$1.Value, {
|
|
46
|
+
className: cn("data-placeholder:text-muted-foreground flex-1 truncate", className),
|
|
47
|
+
"data-slot": "select-value",
|
|
48
|
+
placeholder,
|
|
49
|
+
...props,
|
|
50
|
+
children
|
|
51
|
+
});
|
|
52
|
+
return /* @__PURE__ */ jsx(Select$1.Value, {
|
|
53
|
+
className: cn("data-placeholder:text-muted-foreground flex flex-1 items-center gap-2 truncate", className),
|
|
54
|
+
"data-slot": "select-value",
|
|
55
|
+
placeholder,
|
|
56
|
+
...props,
|
|
57
|
+
children: renderSelectedDisplay(displays, placeholder)
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
const DEFAULT_COLLISION_AVOIDANCE = {
|
|
61
|
+
align: "shift",
|
|
62
|
+
fallbackAxisSide: "none",
|
|
63
|
+
side: "none"
|
|
64
|
+
};
|
|
65
|
+
const SelectPopup = ({ className, children, side = "bottom", sideOffset = 4, align = "start", alignOffset = 0, alignItemWithTrigger = true, collisionAvoidance = DEFAULT_COLLISION_AVOIDANCE, ...props }) => /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(Select$1.Positioner, {
|
|
66
|
+
align,
|
|
67
|
+
alignItemWithTrigger,
|
|
68
|
+
alignOffset,
|
|
69
|
+
className: cn(OVERLAY_LAYER_CLASS_NAMES.popup, "select-none"),
|
|
70
|
+
collisionAvoidance,
|
|
71
|
+
"data-slot": "select-positioner",
|
|
72
|
+
side,
|
|
73
|
+
sideOffset,
|
|
74
|
+
children: /* @__PURE__ */ jsxs(Select$1.Popup, {
|
|
75
|
+
className: "text-foreground origin-(--transform-origin)",
|
|
76
|
+
"data-slot": "select-popup",
|
|
77
|
+
...props,
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ jsx(Select$1.ScrollUpArrow, {
|
|
80
|
+
className: "before:from-popover top-0 z-50 flex h-6 w-full cursor-default items-center justify-center before:pointer-events-none before:absolute before:inset-x-px before:top-px before:h-[200%] before:rounded-t-[calc(var(--radius-lg)-1px)] before:bg-linear-to-b before:from-50%",
|
|
81
|
+
"data-slot": "select-scroll-up-arrow",
|
|
82
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "relative size-4.5 sm:size-4" })
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ jsx("div", {
|
|
85
|
+
className: "bg-popover relative h-full min-w-(--anchor-width) rounded-lg border shadow-lg/5 not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]",
|
|
86
|
+
children: /* @__PURE__ */ jsx(Select$1.List, {
|
|
87
|
+
className: cn("max-h-(--available-height) overflow-y-auto p-1", className),
|
|
88
|
+
"data-slot": "select-list",
|
|
89
|
+
children
|
|
90
|
+
})
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ jsx(Select$1.ScrollDownArrow, {
|
|
93
|
+
className: "before:from-popover bottom-0 z-50 flex h-6 w-full cursor-default items-center justify-center before:pointer-events-none before:absolute before:inset-x-px before:bottom-px before:h-[200%] before:rounded-b-[calc(var(--radius-lg)-1px)] before:bg-linear-to-t before:from-50%",
|
|
94
|
+
"data-slot": "select-scroll-down-arrow",
|
|
95
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "relative size-4.5 sm:size-4" })
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
})
|
|
99
|
+
}) });
|
|
100
|
+
const SelectItem = ({ className, children, label: _label, ...props }) => /* @__PURE__ */ jsxs(Select$1.Item, {
|
|
101
|
+
className: cn("data-highlighted:bg-accent data-highlighted:text-accent-foreground grid min-h-8 cursor-pointer grid-cols-[1rem_1fr] items-center gap-2 rounded-sm py-1 ps-2 pe-4 text-base outline-none in-data-[side=none]:min-w-[calc(var(--anchor-width)+1.25rem)] data-disabled:pointer-events-none data-disabled:opacity-64 sm:min-h-7 sm:text-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4", className),
|
|
102
|
+
"data-slot": "select-item",
|
|
103
|
+
...props,
|
|
104
|
+
children: [/* @__PURE__ */ jsx(Select$1.ItemIndicator, {
|
|
105
|
+
className: "col-start-1",
|
|
106
|
+
children: /* @__PURE__ */ jsxs("svg", {
|
|
107
|
+
fill: "none",
|
|
108
|
+
height: "24",
|
|
109
|
+
stroke: "currentColor",
|
|
110
|
+
strokeLinecap: "round",
|
|
111
|
+
strokeLinejoin: "round",
|
|
112
|
+
strokeWidth: "2",
|
|
113
|
+
viewBox: "0 0 24 24",
|
|
114
|
+
width: "24",
|
|
115
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
116
|
+
children: [/* @__PURE__ */ jsx("title", { children: "Selected" }), /* @__PURE__ */ jsx("path", { d: "M5.252 12.7 10.2 18.63 18.748 5.37" })]
|
|
117
|
+
})
|
|
118
|
+
}), /* @__PURE__ */ jsx(Select$1.ItemText, {
|
|
119
|
+
className: "col-start-2 flex min-w-0 items-center gap-2",
|
|
120
|
+
children
|
|
121
|
+
})]
|
|
122
|
+
});
|
|
123
|
+
function collectSelectItemLabels(children) {
|
|
124
|
+
const labels = /* @__PURE__ */ new Map();
|
|
125
|
+
React$1.Children.forEach(children, (child) => {
|
|
126
|
+
collectSelectItemLabel(child, labels);
|
|
127
|
+
});
|
|
128
|
+
return labels;
|
|
129
|
+
}
|
|
130
|
+
function collectSelectItemDisplays(children) {
|
|
131
|
+
const displays = /* @__PURE__ */ new Map();
|
|
132
|
+
React$1.Children.forEach(children, (child) => {
|
|
133
|
+
collectSelectItemDisplay(child, displays);
|
|
134
|
+
});
|
|
135
|
+
return displays;
|
|
136
|
+
}
|
|
137
|
+
function collectSelectItemDisplay(child, displays) {
|
|
138
|
+
if (!isElementWithChildren(child)) return;
|
|
139
|
+
if (isSelectItemElement(child)) {
|
|
140
|
+
const value = child.props.value;
|
|
141
|
+
displays.set(value, child.props.children);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
React$1.Children.forEach(child.props.children, (nestedChild) => {
|
|
145
|
+
collectSelectItemDisplay(nestedChild, displays);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
function collectSelectItemLabel(child, labels) {
|
|
149
|
+
if (!isElementWithChildren(child)) return;
|
|
150
|
+
if (isSelectItemElement(child)) {
|
|
151
|
+
const value = child.props.value;
|
|
152
|
+
const label = child.props.label ?? getTextLabel(child.props.children);
|
|
153
|
+
if (label) labels.set(value, label);
|
|
154
|
+
}
|
|
155
|
+
React$1.Children.forEach(child.props.children, (nestedChild) => {
|
|
156
|
+
collectSelectItemLabel(nestedChild, labels);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function isElementWithChildren(node) {
|
|
160
|
+
return React$1.isValidElement(node);
|
|
161
|
+
}
|
|
162
|
+
function isSelectItemElement(node) {
|
|
163
|
+
return React$1.isValidElement(node) && node.type === SelectItem;
|
|
164
|
+
}
|
|
165
|
+
function isReactNodeArray(node) {
|
|
166
|
+
return Array.isArray(node);
|
|
167
|
+
}
|
|
168
|
+
function getTextLabel(node) {
|
|
169
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
170
|
+
if (isReactNodeArray(node)) {
|
|
171
|
+
const parts = [];
|
|
172
|
+
React$1.Children.forEach(node, (child) => {
|
|
173
|
+
const text = getTextLabel(child);
|
|
174
|
+
if (text) parts.push(text);
|
|
175
|
+
});
|
|
176
|
+
return parts.length > 0 ? parts.join("") : null;
|
|
177
|
+
}
|
|
178
|
+
if (isElementWithChildren(node)) return getTextLabel(node.props.children);
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
const SelectSeparator = ({ className, ...props }) => /* @__PURE__ */ jsx(Select$1.Separator, {
|
|
182
|
+
className: cn("bg-border mx-2 my-1 h-px", className),
|
|
183
|
+
"data-slot": "select-separator",
|
|
184
|
+
...props
|
|
185
|
+
});
|
|
186
|
+
const SelectGroup = (props) => /* @__PURE__ */ jsx(Select$1.Group, {
|
|
187
|
+
"data-slot": "select-group",
|
|
188
|
+
...props
|
|
189
|
+
});
|
|
190
|
+
const SelectGroupLabel = (props) => /* @__PURE__ */ jsx(Select$1.GroupLabel, {
|
|
191
|
+
className: "text-muted-foreground px-2 py-1.5 text-xs font-medium",
|
|
192
|
+
"data-slot": "select-group-label",
|
|
193
|
+
...props
|
|
194
|
+
});
|
|
195
|
+
//#endregion
|
|
196
|
+
export { Select, SelectPopup as SelectContent, SelectPopup, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger, SelectValue };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { Separator as Separator$1 } from "@base-ui/react/separator";
|
|
3
|
+
//#region src/components/separator.d.ts
|
|
4
|
+
declare const Separator: ({ className, orientation, ...props }: Separator$1.Props) => import("react").JSX.Element;
|
|
5
|
+
type TextSeparatorProps = PropsWithChildren<{
|
|
6
|
+
/** Container overrides, e.g. gap or vertical padding. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Label overrides, e.g. casing or size. */
|
|
9
|
+
labelClassName?: string;
|
|
10
|
+
}>;
|
|
11
|
+
/** Horizontal rule with a centered label — the "or sign in with email" /
|
|
12
|
+
* "or build a new one" divider that frames an either/or choice. The label
|
|
13
|
+
* names the alternative; flanking hairlines split the two options. */
|
|
14
|
+
declare const TextSeparator: ({ children, className, labelClassName }: TextSeparatorProps) => import("react").JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Separator, TextSeparator };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Separator as Separator$1 } from "@base-ui/react/separator";
|
|
4
|
+
//#region src/components/separator.tsx
|
|
5
|
+
const Separator = ({ className, orientation = "horizontal", ...props }) => /* @__PURE__ */ jsx(Separator$1, {
|
|
6
|
+
className: cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch", className),
|
|
7
|
+
"data-slot": "separator",
|
|
8
|
+
orientation,
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
/** Horizontal rule with a centered label — the "or sign in with email" /
|
|
12
|
+
* "or build a new one" divider that frames an either/or choice. The label
|
|
13
|
+
* names the alternative; flanking hairlines split the two options. */
|
|
14
|
+
const TextSeparator = ({ children, className, labelClassName }) => /* @__PURE__ */ jsxs("div", {
|
|
15
|
+
className: cn("flex items-center gap-3", className),
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsx("span", { className: "bg-border h-px flex-1" }),
|
|
18
|
+
/* @__PURE__ */ jsx("span", {
|
|
19
|
+
className: cn("text-muted-foreground text-xs", labelClassName),
|
|
20
|
+
children
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ jsx("span", { className: "bg-border h-px flex-1" })
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Separator, TextSeparator };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
3
|
+
//#region src/components/sheet.d.ts
|
|
4
|
+
declare const Sheet: typeof Dialog.Root;
|
|
5
|
+
declare const SheetPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
type SheetSide = "inline-start" | "inline-end" | "block-start" | "block-end";
|
|
7
|
+
declare function SheetTrigger({ tooltip, ...props }: Dialog.Trigger.Props & {
|
|
8
|
+
tooltip?: React$1.ReactNode;
|
|
9
|
+
}): React$1.JSX.Element;
|
|
10
|
+
declare function SheetClose({ tooltip, ...props }: Dialog.Close.Props & {
|
|
11
|
+
tooltip?: React$1.ReactNode;
|
|
12
|
+
}): React$1.JSX.Element;
|
|
13
|
+
declare const SheetBackdrop: ({ className, ...props }: Dialog.Backdrop.Props) => React$1.JSX.Element;
|
|
14
|
+
declare const SheetPopup: ({ className, children, showCloseButton, side, variant, ...props }: Dialog.Popup.Props & {
|
|
15
|
+
showCloseButton?: boolean;
|
|
16
|
+
side?: SheetSide;
|
|
17
|
+
variant?: "default" | "inset";
|
|
18
|
+
}) => React$1.JSX.Element;
|
|
19
|
+
declare const SheetHeader: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
20
|
+
declare const SheetFooter: ({ className, variant, ...props }: React$1.ComponentProps<"div"> & {
|
|
21
|
+
variant?: "default" | "bare";
|
|
22
|
+
}) => React$1.JSX.Element;
|
|
23
|
+
declare const SheetTitle: ({ className, ...props }: Dialog.Title.Props) => React$1.JSX.Element;
|
|
24
|
+
declare const SheetDescription: ({ className, ...props }: Dialog.Description.Props) => React$1.JSX.Element;
|
|
25
|
+
declare const SheetPanel: ({ className, scrollFade, ...props }: React$1.ComponentProps<"div"> & {
|
|
26
|
+
scrollFade?: boolean;
|
|
27
|
+
}) => React$1.JSX.Element;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Sheet, SheetBackdrop, SheetBackdrop as SheetOverlay, SheetClose, SheetPopup as SheetContent, SheetPopup, SheetDescription, SheetFooter, SheetHeader, SheetPanel, SheetPortal, type SheetSide, SheetTitle, SheetTrigger };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { renderTooltipTrigger } from "./tooltip-trigger-helper.js";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { ScrollArea } from "./scroll-area.js";
|
|
6
|
+
import { XIcon } from "lucide-react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
9
|
+
//#region src/components/sheet.tsx
|
|
10
|
+
const Sheet = Dialog.Root;
|
|
11
|
+
const SheetPortal = Dialog.Portal;
|
|
12
|
+
function SheetTrigger({ tooltip, ...props }) {
|
|
13
|
+
return renderTooltipTrigger({
|
|
14
|
+
tooltip: tooltip ?? props["aria-label"] ?? props.title,
|
|
15
|
+
trigger: /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
16
|
+
"data-slot": "sheet-trigger",
|
|
17
|
+
...props
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function SheetClose({ tooltip, ...props }) {
|
|
22
|
+
return renderTooltipTrigger({
|
|
23
|
+
tooltip: tooltip ?? props["aria-label"] ?? props.title,
|
|
24
|
+
trigger: /* @__PURE__ */ jsx(Dialog.Close, {
|
|
25
|
+
"data-slot": "sheet-close",
|
|
26
|
+
...props
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const SheetBackdrop = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
31
|
+
className: cn("fixed inset-0 z-50 bg-black/32 backdrop-blur-sm transition-opacity duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0", className),
|
|
32
|
+
"data-slot": "sheet-backdrop",
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
const SheetViewport = ({ className: _className, side, variant = "default", ...props }) => /* @__PURE__ */ jsx(Dialog.Viewport, {
|
|
36
|
+
className: cn("fixed inset-0 z-50", side === "block-end" && "grid grid-rows-[1fr_auto] pt-12", side === "block-start" && "grid grid-rows-[auto_1fr] pb-12", side === "inline-start" && "flex justify-start", side === "inline-end" && "flex justify-end", variant === "inset" && "sm:p-4"),
|
|
37
|
+
"data-slot": "sheet-viewport",
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
const SheetPopup = ({ className, children, showCloseButton = true, side = "inline-end", variant = "default", ...props }) => /* @__PURE__ */ jsxs(SheetPortal, { children: [/* @__PURE__ */ jsx(SheetBackdrop, {}), /* @__PURE__ */ jsx(SheetViewport, {
|
|
41
|
+
side,
|
|
42
|
+
variant,
|
|
43
|
+
children: /* @__PURE__ */ jsxs(Dialog.Popup, {
|
|
44
|
+
className: cn("bg-popover text-popover-foreground relative flex max-h-full min-h-0 w-full min-w-0 flex-col shadow-lg/5 transition-[opacity,translate] duration-200 ease-in-out will-change-transform not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:opacity-0 data-starting-style:opacity-0 max-sm:before:hidden dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", side === "block-end" && "row-start-2 border-t data-ending-style:translate-y-8 data-starting-style:translate-y-8", side === "block-start" && "border-b data-ending-style:-translate-y-8 data-starting-style:-translate-y-8", side === "inline-start" && "w-[calc(100%-(--spacing(12)))] max-w-md border-e data-ending-style:-translate-x-8 data-starting-style:-translate-x-8 rtl:data-ending-style:translate-x-8 rtl:data-starting-style:translate-x-8", side === "inline-end" && "w-[calc(100%-(--spacing(12)))] max-w-md border-s data-ending-style:translate-x-8 data-starting-style:translate-x-8 rtl:data-ending-style:-translate-x-8 rtl:data-starting-style:-translate-x-8", variant === "inset" && "before:hidden sm:rounded-2xl sm:border sm:before:rounded-[calc(var(--radius-2xl)-1px)] sm:**:data-[slot=sheet-footer]:rounded-b-[calc(var(--radius-2xl)-1px)]", className),
|
|
45
|
+
"data-slot": "sheet-popup",
|
|
46
|
+
...props,
|
|
47
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog.Close, {
|
|
48
|
+
"aria-label": "Close",
|
|
49
|
+
className: "absolute end-2 top-2",
|
|
50
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
51
|
+
size: "icon",
|
|
52
|
+
variant: "ghost"
|
|
53
|
+
}),
|
|
54
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
55
|
+
})]
|
|
56
|
+
})
|
|
57
|
+
})] });
|
|
58
|
+
const SheetHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
59
|
+
className: cn("flex flex-col gap-2 p-6 in-[[data-slot=sheet-popup]:has([data-slot=sheet-panel])]:pb-3 max-sm:pb-4", className),
|
|
60
|
+
"data-slot": "sheet-header",
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
const SheetFooter = ({ className, variant = "default", ...props }) => /* @__PURE__ */ jsx("div", {
|
|
64
|
+
className: cn("flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end", variant === "default" && "bg-muted/72 border-t py-4", variant === "bare" && "pt-4 pb-6 in-[[data-slot=sheet-popup]:has([data-slot=sheet-panel])]:pt-3", className),
|
|
65
|
+
"data-slot": "sheet-footer",
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
const SheetTitle = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Title, {
|
|
69
|
+
className: cn("font-heading text-xl leading-none font-semibold", className),
|
|
70
|
+
"data-slot": "sheet-title",
|
|
71
|
+
...props
|
|
72
|
+
});
|
|
73
|
+
const SheetDescription = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog.Description, {
|
|
74
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
75
|
+
"data-slot": "sheet-description",
|
|
76
|
+
...props
|
|
77
|
+
});
|
|
78
|
+
const SheetPanel = ({ className, scrollFade = true, ...props }) => /* @__PURE__ */ jsx(ScrollArea, {
|
|
79
|
+
scrollFade,
|
|
80
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
81
|
+
className: cn("p-6 in-[[data-slot=sheet-popup]:has([data-slot=sheet-footer]:not(.border-t))]:pb-1 in-[[data-slot=sheet-popup]:has([data-slot=sheet-header])]:pt-1", className),
|
|
82
|
+
"data-slot": "sheet-panel",
|
|
83
|
+
...props
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
//#endregion
|
|
87
|
+
export { Sheet, SheetBackdrop, SheetBackdrop as SheetOverlay, SheetClose, SheetPopup as SheetContent, SheetPopup, SheetDescription, SheetFooter, SheetHeader, SheetPanel, SheetPortal, SheetTitle, SheetTrigger };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/skeleton.tsx
|
|
4
|
+
const Skeleton = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
5
|
+
className: cn("animate-skeleton rounded-sm [--skeleton-highlight:--alpha(var(--color-white)/64%)] [background:linear-gradient(120deg,transparent_40%,var(--skeleton-highlight),transparent_60%)_var(--color-muted)_0_0/200%_100%_fixed] dark:[--skeleton-highlight:--alpha(var(--color-white)/4%)]", className),
|
|
6
|
+
"data-slot": "skeleton",
|
|
7
|
+
...props
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Skeleton };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/stella-mark.tsx
|
|
3
|
+
const StellaMark = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
4
|
+
"aria-hidden": "true",
|
|
5
|
+
fill: "currentColor",
|
|
6
|
+
viewBox: "0 0 40 41",
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
...props,
|
|
9
|
+
children: [/* @__PURE__ */ jsx("path", { d: "M6.58 11.3 16.69 5.05a5.9 5.9 0 0 1 6.62.01l14.68 9.07V9.26L25.52 1.55A11.8 11.8 0 0 0 20 0c-1.97 0-3.88.54-5.53 1.56L4.37 7.81A9.3 9.3 0 0 0 0 15.61a9.3 9.3 0 0 0 4.37 7.8l3.26 2.02-.01.01 11.15 6.9c.14.09.27.16.39.2.68.26 1.42.19 2.03-.19l9.59-5.93.1-.07 2.07-1.28-2.82-1.72-1.1-.69-9.02 5.56-.41-.24-13.01-8.05a5.57 5.57 0 0 1-2.41-4.31c0-1.79.88-3.36 2.41-4.3Z" }), /* @__PURE__ */ jsx("path", { d: "M33.34 29.25 23.24 35.5a5.9 5.9 0 0 1-6.63-.01L1.94 26.43v4.86l12.47 7.71a11.8 11.8 0 0 0 5.52 1.55c1.97 0 3.88-.54 5.53-1.56l10.1-6.25a9.3 9.3 0 0 0 4.37-7.8 9.3 9.3 0 0 0-4.37-7.8l-3.26-2.02.01-.01-11.15-6.9a1.6 1.6 0 0 0-.39-.2 1.64 1.64 0 0 0-2.03.19l-9.59 5.93-.1.07-2.07 1.28 2.82 1.72 1.1.69 9.02-5.56.41.24 13.01 8.05a5.57 5.57 0 0 1 2.41 4.31c0 1.79-.88 3.36-2.41 4.3Z" })]
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { StellaMark };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/stella-wordmark.tsx
|
|
3
|
+
const StellaWordmarkLatin = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
4
|
+
"aria-hidden": "true",
|
|
5
|
+
fill: "currentColor",
|
|
6
|
+
viewBox: "0 0 573 151",
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8
|
+
...props,
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ jsx("path", { d: "M23.54 44.93L59.65 22.32C63.19 20.1 67.28 18.94 71.49 18.94C75.7 18.94 79.79 20.1 83.32 22.32L135.77 55.14V37.56L91.2 9.63C85.32 5.96 78.5 3.99 71.49 3.99C64.48 3.99 57.63 5.93 51.74 9.63L15.63 32.24C5.85 38.39 0 48.96 0 60.52C0 72.08 5.85 82.65 15.63 88.77L27.27 96.05L67.11 121.04C67.63 121.36 68.08 121.59 68.5 121.75C70.94 122.68 73.58 122.42 75.77 121.07L110.05 99.62C110.05 99.62 110.3 99.46 110.4 99.36L117.8 94.72L107.73 88.48L103.78 86L71.55 106.13L70.07 105.26L23.57 76.11C18.11 72.66 14.95 66.99 14.95 60.52C14.95 54.05 18.11 48.38 23.57 44.93H23.54Z" }),
|
|
11
|
+
/* @__PURE__ */ jsx("path", { d: "M119.18 109.86L83.07 132.47C79.53 134.7 75.44 135.85 71.23 135.85C67.02 135.85 62.93 134.7 59.4 132.47L6.91 99.65V117.24L51.49 145.13C57.37 148.8 64.19 150.77 71.2 150.77C78.21 150.77 85.06 148.84 90.94 145.13L127.06 122.52C136.83 116.4 142.69 105.84 142.69 94.27C142.69 82.71 136.83 72.15 127.06 66.03L115.42 58.75L75.57 33.75C75.06 33.43 74.61 33.21 74.19 33.05C71.75 32.11 69.11 32.37 66.92 33.72L32.64 55.17C32.64 55.17 32.38 55.33 32.29 55.43L24.89 60.07L34.96 66.32L38.91 68.8L71.13 48.67L72.61 49.54L119.12 78.69C124.58 82.13 127.73 87.8 127.73 94.27C127.73 100.75 124.58 106.42 119.12 109.86H119.18Z" }),
|
|
12
|
+
/* @__PURE__ */ jsx("path", { d: "M230.38 123.02C212.11 123.02 195.46 115.06 189.49 98.78L200.89 89.91C203.96 99.87 213.55 109.82 230.92 109.82C241.23 109.82 248.11 105.84 248.11 98.06C248.11 90.1 240.15 87.56 229.83 85.21L218.26 82.5C205.77 79.6 192.2 73.63 192.2 57.53C192.2 41.61 204.51 31.84 223.5 31.84C241.96 31.84 254.8 41.61 259.69 53.19L247.75 62.05C243.4 51.74 235.08 45.23 222.6 45.23C213.55 45.23 207.04 49.21 207.04 56.63C207.04 64.41 212.83 67.12 224.77 70.01L235.99 72.91C255.71 77.61 262.22 85.75 262.22 97.88C262.22 115.24 247.38 123.02 230.38 123.02Z" }),
|
|
13
|
+
/* @__PURE__ */ jsx("path", { d: "M304.21 123.2C289.92 123.2 279.79 113.8 279.79 98.78V45.95H265.67V33.65H279.79V22.43L295.52 10.85V33.65H324.29V45.95H295.52V94.08C295.52 105.29 300.77 108.01 307.65 108.01C315.43 108.01 320.85 101.49 323.21 96.07L328.45 111.63C324.65 117.6 316.33 123.2 304.21 123.2Z" }),
|
|
14
|
+
/* @__PURE__ */ jsx("path", { d: "M371.45 123.02C346.66 123.02 329.48 105.29 329.48 77.43C329.48 49.75 346.48 31.84 370.54 31.84C395.33 31.84 410.34 48.3 410.34 73.99C410.34 76.71 409.98 79.42 409.62 81.05H344.67C345.58 99.5 355.89 110 371.45 110C389 110 396.05 100.41 399.49 92.81L409.08 103.66C402.57 114.16 390.44 123.02 371.45 123.02ZM370.54 45.05C356.43 45.05 347.02 53.37 345.03 69.65H396.23C394.6 53.55 385.2 45.05 370.54 45.05Z" }),
|
|
15
|
+
/* @__PURE__ */ jsx("path", { d: "M442.77 121.21H427.03V0H442.77V121.21Z" }),
|
|
16
|
+
/* @__PURE__ */ jsx("path", { d: "M478.55 121.21H462.81V0H478.55V121.21Z" }),
|
|
17
|
+
/* @__PURE__ */ jsx("path", { d: "M516.68 123.02C501.84 123.02 493.52 114.52 493.52 102.94C493.52 91.18 502.39 83.76 514.87 78.16L546.53 64.04C545.99 53.73 541.1 46.13 527.35 46.13C514.87 46.13 506.55 53.37 502.02 62.96L491.35 51.92C496.6 42.88 509.62 31.84 529.16 31.84C550.69 31.84 562.27 44.69 562.27 65.49V101.49C562.27 105.66 563.9 106.92 567.15 106.92H572.76V121.21H562.63C553.58 121.21 547.07 116.87 547.07 104.57V98.42C544.18 110 534.77 123.02 516.68 123.02ZM509.44 100.41C509.44 106.38 513.6 110 521.74 110C536.58 110 547.07 100.23 547.07 87.56V75.44L521.56 87.38C513.24 91.36 509.44 94.98 509.44 100.41Z" })
|
|
18
|
+
]
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
export { StellaWordmarkLatin };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/table.d.ts
|
|
3
|
+
declare const Table: ({ className, ...props }: React$1.ComponentProps<"table">) => React$1.JSX.Element;
|
|
4
|
+
declare const TableHeader: ({ className, ...props }: React$1.ComponentProps<"thead">) => React$1.JSX.Element;
|
|
5
|
+
declare const TableBody: ({ className, ...props }: React$1.ComponentProps<"tbody">) => React$1.JSX.Element;
|
|
6
|
+
declare const TableFooter: ({ className, ...props }: React$1.ComponentProps<"tfoot">) => React$1.JSX.Element;
|
|
7
|
+
declare const TableRow: ({ className, ...props }: React$1.ComponentProps<"tr">) => React$1.JSX.Element;
|
|
8
|
+
declare const TableHead: ({ className, ...props }: React$1.ComponentProps<"th">) => React$1.JSX.Element;
|
|
9
|
+
declare const TableCell: ({ className, ...props }: React$1.ComponentProps<"td">) => React$1.JSX.Element;
|
|
10
|
+
type SortDirection = "asc" | "desc" | null;
|
|
11
|
+
type SortableHeadProps = Omit<React$1.ComponentProps<"th">, "onClick"> & {
|
|
12
|
+
sortDirection?: SortDirection;
|
|
13
|
+
onSort: () => void;
|
|
14
|
+
/** Rendered next to the sort button inside the same cell (e.g. filter icon). */
|
|
15
|
+
trailing?: React$1.ReactNode;
|
|
16
|
+
};
|
|
17
|
+
declare const SortableHead: ({ children, sortDirection, onSort, trailing, className, ...props }: SortableHeadProps) => React$1.JSX.Element;
|
|
18
|
+
declare const TableCaption: ({ className, ...props }: React$1.ComponentProps<"caption">) => React$1.JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { type SortDirection, SortableHead, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { ArrowDownIcon, ArrowUpIcon } from "lucide-react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/table.tsx
|
|
5
|
+
const Table = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
6
|
+
className: "relative w-full overflow-x-auto",
|
|
7
|
+
"data-slot": "table-container",
|
|
8
|
+
children: /* @__PURE__ */ jsx("table", {
|
|
9
|
+
className: cn("w-full caption-bottom text-sm in-data-[slot=frame]:border-separate in-data-[slot=frame]:border-spacing-0", className),
|
|
10
|
+
"data-slot": "table",
|
|
11
|
+
...props
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
const TableHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("thead", {
|
|
15
|
+
className: cn("[&_tr]:border-b in-data-[slot=frame]:**:[th]:h-9 in-data-[slot=frame]:*:[tr]:border-none in-data-[slot=frame]:*:[tr]:hover:bg-transparent", className),
|
|
16
|
+
"data-slot": "table-header",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
const TableBody = ({ className, ...props }) => /* @__PURE__ */ jsx("tbody", {
|
|
20
|
+
className: cn("in-data-[slot=frame]:*:[tr]:*:[td]:bg-background in-data-[slot=frame]:*:[tr]:data-[state=selected]:*:[td]:bg-muted/72 relative before:pointer-events-none before:absolute before:inset-px before:rounded-[calc(var(--radius-xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] not-in-data-[slot=frame]:before:hidden in-data-[slot=frame]:rounded-xl in-data-[slot=frame]:shadow-xs/5 dark:before:shadow-[0_-1px_--theme(--color-white/8%)] [&_tr:last-child]:border-0 in-data-[slot=frame]:*:[tr]:border-0 in-data-[slot=frame]:*:[tr]:*:[td]:border-b in-data-[slot=frame]:*:[tr]:*:[td]:bg-clip-padding in-data-[slot=frame]:*:[tr]:first:*:[td]:first:rounded-ss-xl in-data-[slot=frame]:*:[tr]:*:[td]:first:border-s in-data-[slot=frame]:*:[tr]:first:*:[td]:border-t in-data-[slot=frame]:*:[tr]:last:*:[td]:last:rounded-ee-xl in-data-[slot=frame]:*:[tr]:*:[td]:last:border-e in-data-[slot=frame]:*:[tr]:first:*:[td]:last:rounded-se-xl in-data-[slot=frame]:*:[tr]:last:*:[td]:first:rounded-es-xl in-data-[slot=frame]:*:[tr]:hover:*:[td]:bg-transparent", className),
|
|
21
|
+
"data-slot": "table-body",
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
const TableFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("tfoot", {
|
|
25
|
+
className: cn("bg-muted/72 border-t font-medium in-data-[slot=frame]:border-none in-data-[slot=frame]:bg-transparent in-data-[slot=frame]:*:[tr]:hover:bg-transparent [&>tr]:last:border-b-0", className),
|
|
26
|
+
"data-slot": "table-footer",
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
const TableRow = ({ className, ...props }) => /* @__PURE__ */ jsx("tr", {
|
|
30
|
+
className: cn("hover:bg-muted/72 data-[state=selected]:bg-muted/72 border-b transition-colors in-data-[slot=frame]:hover:bg-transparent in-data-[slot=frame]:data-[state=selected]:bg-transparent", className),
|
|
31
|
+
"data-slot": "table-row",
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
const TableHead = ({ className, ...props }) => /* @__PURE__ */ jsx("th", {
|
|
35
|
+
className: cn("text-muted-foreground h-10 px-2.5 text-start align-middle leading-none font-medium whitespace-nowrap has-[[role=checkbox]]:w-px has-[[role=checkbox]]:pe-0", className),
|
|
36
|
+
"data-slot": "table-head",
|
|
37
|
+
...props
|
|
38
|
+
});
|
|
39
|
+
const TableCell = ({ className, ...props }) => /* @__PURE__ */ jsx("td", {
|
|
40
|
+
className: cn("p-2.5 align-middle leading-none whitespace-nowrap in-data-[slot=frame]:first:p-[calc(--spacing(2.5)-1px)] in-data-[slot=frame]:last:p-[calc(--spacing(2.5)-1px)] has-[[role=checkbox]]:pe-0", className),
|
|
41
|
+
"data-slot": "table-cell",
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
const SortableHead = ({ children, sortDirection = null, onSort, trailing, className, ...props }) => {
|
|
45
|
+
let ariaSort = "none";
|
|
46
|
+
if (sortDirection === "asc") ariaSort = "ascending";
|
|
47
|
+
else if (sortDirection === "desc") ariaSort = "descending";
|
|
48
|
+
let sortIcon = null;
|
|
49
|
+
if (sortDirection === "asc") sortIcon = /* @__PURE__ */ jsx(ArrowUpIcon, { className: "size-3" });
|
|
50
|
+
else if (sortDirection === "desc") sortIcon = /* @__PURE__ */ jsx(ArrowDownIcon, { className: "size-3" });
|
|
51
|
+
return /* @__PURE__ */ jsx(TableHead, {
|
|
52
|
+
"aria-sort": ariaSort,
|
|
53
|
+
className,
|
|
54
|
+
...props,
|
|
55
|
+
onClick: void 0,
|
|
56
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
57
|
+
className: "inline-flex items-center gap-1",
|
|
58
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
59
|
+
className: "text-muted-foreground hover:text-foreground inline-flex cursor-pointer items-center gap-1 font-medium select-none",
|
|
60
|
+
onClick: onSort,
|
|
61
|
+
type: "button",
|
|
62
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: "truncate",
|
|
64
|
+
children
|
|
65
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
66
|
+
"aria-hidden": true,
|
|
67
|
+
className: "inline-flex w-3 shrink-0 justify-center",
|
|
68
|
+
children: sortIcon
|
|
69
|
+
})]
|
|
70
|
+
}), trailing]
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const TableCaption = ({ className, ...props }) => /* @__PURE__ */ jsx("caption", {
|
|
75
|
+
className: cn("text-muted-foreground mt-4 text-sm in-data-[slot=frame]:my-4", className),
|
|
76
|
+
"data-slot": "table-caption",
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
79
|
+
//#endregion
|
|
80
|
+
export { SortableHead, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
|
|
2
|
+
//#region src/components/tabs.d.ts
|
|
3
|
+
type TabsVariant = "default" | "underline";
|
|
4
|
+
declare const Tabs: ({ className, ...props }: Tabs$1.Root.Props) => import("react").JSX.Element;
|
|
5
|
+
declare const TabsList: ({ variant, className, children, ref, ...props }: Tabs$1.List.Props & {
|
|
6
|
+
variant?: TabsVariant;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
8
|
+
declare const TabsTab: ({ className, ...props }: Tabs$1.Tab.Props) => import("react").JSX.Element;
|
|
9
|
+
declare const TabsPanel: ({ className, ...props }: Tabs$1.Panel.Props) => import("react").JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Tabs, TabsPanel as TabsContent, TabsPanel, TabsList, TabsTab, TabsTab as TabsTrigger };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn, composeRefs } from "../lib/utils.js";
|
|
3
|
+
import { hasTabOrderChanged } from "../lib/tab-order.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
6
|
+
import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
|
|
7
|
+
//#region src/components/tabs.tsx
|
|
8
|
+
const useIsoLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
9
|
+
const Tabs = ({ className, ...props }) => /* @__PURE__ */ jsx(Tabs$1.Root, {
|
|
10
|
+
className: cn("flex flex-col gap-2 data-[orientation=vertical]:flex-row", className),
|
|
11
|
+
"data-slot": "tabs",
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
const TabsList = ({ variant = "default", className, children, ref, ...props }) => {
|
|
15
|
+
const listRef = useRef(null);
|
|
16
|
+
const tabOrderRef = useRef([]);
|
|
17
|
+
const [, setRemeasureToken] = useState(0);
|
|
18
|
+
useIsoLayoutEffect(() => {
|
|
19
|
+
const tabs = listRef.current ? [...listRef.current.children] : [];
|
|
20
|
+
const previousTabs = tabOrderRef.current;
|
|
21
|
+
tabOrderRef.current = tabs;
|
|
22
|
+
if (hasTabOrderChanged(previousTabs, tabs)) setRemeasureToken((token) => token + 1);
|
|
23
|
+
});
|
|
24
|
+
return /* @__PURE__ */ jsxs(Tabs$1.List, {
|
|
25
|
+
className: cn("text-muted-foreground relative z-0 flex w-fit max-w-full items-center justify-center-safe gap-x-0.5", "scrollbar-none overflow-auto data-[orientation=horizontal]:overscroll-x-contain data-[orientation=vertical]:overscroll-y-contain [&::-webkit-scrollbar]:hidden", "data-[orientation=vertical]:flex-col", variant === "default" ? "bg-muted text-foreground-label rounded-lg p-0.5" : "*:data-[slot=tabs-tab]:hover:bg-accent data-[orientation=horizontal]:py-1 data-[orientation=vertical]:px-1", className),
|
|
26
|
+
"data-slot": "tabs-list",
|
|
27
|
+
ref: composeRefs(listRef, ref),
|
|
28
|
+
...props,
|
|
29
|
+
children: [children, /* @__PURE__ */ jsx(Tabs$1.Indicator, {
|
|
30
|
+
className: cn("absolute bottom-0 left-0 h-(--active-tab-height) w-(--active-tab-width) translate-x-(--active-tab-left) -translate-y-(--active-tab-bottom) transition-[width,translate] duration-200 ease-in-out", variant === "underline" ? "bg-primary z-10 data-[orientation=horizontal]:h-0.5 data-[orientation=vertical]:w-0.5 data-[orientation=vertical]:-translate-x-px" : "bg-background dark:bg-input -z-1 rounded-md shadow-sm/5"),
|
|
31
|
+
"data-slot": "tab-indicator"
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
const TabsTab = ({ className, ...props }) => /* @__PURE__ */ jsx(Tabs$1.Tab, {
|
|
36
|
+
className: cn("hover:text-foreground focus-visible:ring-ring data-active:text-foreground relative flex h-9 shrink-0 grow cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-[calc(--spacing(2.5)-1px)] text-base font-medium whitespace-nowrap transition-[color,background-color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-inset data-disabled:pointer-events-none data-disabled:opacity-64 data-[orientation=vertical]:w-full data-[orientation=vertical]:justify-start sm:h-8 sm:text-sm [&_svg]:pointer-events-none [&_svg]:-mx-0.5 [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4", className),
|
|
37
|
+
"data-slot": "tabs-tab",
|
|
38
|
+
...props
|
|
39
|
+
});
|
|
40
|
+
const TabsPanel = ({ className, ...props }) => /* @__PURE__ */ jsx(Tabs$1.Panel, {
|
|
41
|
+
className: cn("flex-1 outline-none", className),
|
|
42
|
+
"data-slot": "tabs-content",
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Tabs, TabsPanel as TabsContent, TabsPanel, TabsList, TabsTab, TabsTab as TabsTrigger };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/textarea.d.ts
|
|
3
|
+
type TextareaProps = React$1.ComponentProps<"textarea"> & {
|
|
4
|
+
size?: "sm" | "default" | "lg" | number;
|
|
5
|
+
unstyled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const Textarea: ({ className, size, unstyled, dir, onChange, ...props }: TextareaProps) => React$1.JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Textarea, type TextareaProps };
|