@leonardaustin/ui 0.25.0 → 0.26.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/README.md +11 -0
- package/dist/components/app-shell/AppShell.d.ts +3 -3
- package/dist/components/app-shell/AppShell.js +82 -0
- package/dist/components/app-shell/AuthLayout.d.ts +3 -3
- package/dist/components/app-shell/AuthLayout.js +16 -0
- package/dist/components/app-shell/BackLink.d.ts +3 -3
- package/dist/components/app-shell/BackLink.js +19 -0
- package/dist/components/app-shell/BottomNav.d.ts +3 -2
- package/dist/components/app-shell/BottomNav.js +37 -0
- package/dist/components/app-shell/Breadcrumbs.d.ts +3 -2
- package/dist/components/app-shell/Breadcrumbs.js +46 -0
- package/dist/components/app-shell/CommandPalette.d.ts +3 -2
- package/dist/components/app-shell/CommandPalette.js +119 -0
- package/dist/components/app-shell/MobileDrawer.d.ts +3 -3
- package/dist/components/app-shell/MobileDrawer.js +128 -0
- package/dist/components/app-shell/Sidebar.d.ts +3 -3
- package/dist/components/app-shell/Sidebar.js +355 -0
- package/dist/components/app-shell/ThemeMenu.d.ts +3 -2
- package/dist/components/app-shell/ThemeMenu.js +273 -0
- package/dist/components/app-shell/TopBar.d.ts +3 -3
- package/dist/components/app-shell/TopBar.js +129 -0
- package/dist/components/app-shell/commandPaletteEvents.js +16 -0
- package/dist/components/app-shell/navigation.js +21 -0
- package/dist/components/app-shell/themeMenuEvents.js +7 -0
- package/dist/components/charts/AreaChart.d.ts +4 -3
- package/dist/components/charts/AreaChart.js +217 -0
- package/dist/components/charts/BarChart.d.ts +4 -3
- package/dist/components/charts/BarChart.js +91 -0
- package/dist/components/charts/DonutChart.d.ts +4 -3
- package/dist/components/charts/DonutChart.js +172 -0
- package/dist/components/charts/RadarChart.d.ts +4 -3
- package/dist/components/charts/RadarChart.js +142 -0
- package/dist/components/charts/RadialBarChart.d.ts +4 -3
- package/dist/components/charts/RadialBarChart.js +219 -0
- package/dist/components/charts/SparkLine.d.ts +4 -3
- package/dist/components/charts/SparkLine.js +39 -0
- package/dist/components/charts/StackedBarChart.d.ts +4 -3
- package/dist/components/charts/StackedBarChart.js +249 -0
- package/dist/components/charts/VerticalBarChart.d.ts +4 -3
- package/dist/components/charts/VerticalBarChart.js +143 -0
- package/dist/components/charts/chartUtils.js +68 -0
- package/dist/components/tables/ColumnPicker.d.ts +3 -3
- package/dist/components/tables/ColumnPicker.js +59 -0
- package/dist/components/tables/Pagination.d.ts +3 -3
- package/dist/components/tables/Pagination.js +56 -0
- package/dist/components/tables/ResourceTable.d.ts +3 -3
- package/dist/components/tables/ResourceTable.js +88 -0
- package/dist/components/tables/Table.js +95 -0
- package/dist/components/tables/sortRows.js +11 -0
- package/dist/components/ui/Accordion.d.ts +2 -1
- package/dist/components/ui/Accordion.js +35 -0
- package/dist/components/ui/Alert.d.ts +3 -2
- package/dist/components/ui/Alert.js +51 -0
- package/dist/components/ui/AttachmentList.d.ts +5 -5
- package/dist/components/ui/AttachmentList.js +90 -0
- package/dist/components/ui/AudioPlayer.d.ts +5 -2
- package/dist/components/ui/AudioPlayer.js +447 -0
- package/dist/components/ui/AuthCard.d.ts +3 -3
- package/dist/components/ui/AuthCard.js +39 -0
- package/dist/components/ui/AuthorByline.d.ts +3 -3
- package/dist/components/ui/AuthorByline.js +23 -0
- package/dist/components/ui/Avatar.d.ts +3 -2
- package/dist/components/ui/Avatar.js +36 -0
- package/dist/components/ui/Badge.d.ts +3 -2
- package/dist/components/ui/Badge.js +47 -0
- package/dist/components/ui/Button.d.ts +3 -3
- package/dist/components/ui/Button.js +83 -0
- package/dist/components/ui/Calendar.d.ts +3 -3
- package/dist/components/ui/Calendar.js +344 -0
- package/dist/components/ui/CalendarGrid.d.ts +3 -2
- package/dist/components/ui/CalendarGrid.js +136 -0
- package/dist/components/ui/Card.d.ts +6 -5
- package/dist/components/ui/Card.js +53 -0
- package/dist/components/ui/CharacterCount.d.ts +3 -3
- package/dist/components/ui/CharacterCount.js +27 -0
- package/dist/components/ui/Checkbox.d.ts +10 -8
- package/dist/components/ui/Checkbox.js +52 -0
- package/dist/components/ui/CodeInput.d.ts +7 -4
- package/dist/components/ui/CodeInput.js +97 -0
- package/dist/components/ui/Combobox.d.ts +8 -6
- package/dist/components/ui/Combobox.js +213 -0
- package/dist/components/ui/CopyButton.d.ts +1 -1
- package/dist/components/ui/CopyButton.js +57 -0
- package/dist/components/ui/DangerZone.d.ts +3 -3
- package/dist/components/ui/DangerZone.js +23 -0
- package/dist/components/ui/DatePartsInput.d.ts +6 -4
- package/dist/components/ui/DatePartsInput.js +138 -0
- package/dist/components/ui/DatePicker.d.ts +9 -4
- package/dist/components/ui/DatePicker.js +84 -0
- package/dist/components/ui/DateRangePicker.d.ts +7 -4
- package/dist/components/ui/DateRangePicker.js +143 -0
- package/dist/components/ui/DateTimePicker.d.ts +7 -4
- package/dist/components/ui/DateTimePicker.js +267 -0
- package/dist/components/ui/DetailPanel.d.ts +3 -3
- package/dist/components/ui/DetailPanel.js +183 -0
- package/dist/components/ui/Dialog.d.ts +3 -3
- package/dist/components/ui/Dialog.js +411 -0
- package/dist/components/ui/DialogActions.d.ts +3 -3
- package/dist/components/ui/DialogActions.js +35 -0
- package/dist/components/ui/Disclosure.d.ts +3 -3
- package/dist/components/ui/Disclosure.js +45 -0
- package/dist/components/ui/DividerLabel.d.ts +3 -3
- package/dist/components/ui/DividerLabel.js +20 -0
- package/dist/components/ui/DropdownMenu.d.ts +3 -3
- package/dist/components/ui/DropdownMenu.js +229 -0
- package/dist/components/ui/EmptyState.d.ts +3 -3
- package/dist/components/ui/EmptyState.js +31 -0
- package/dist/components/ui/ErrorBoundary.js +46 -0
- package/dist/components/ui/FieldContext.js +8 -0
- package/dist/components/ui/Fieldset.d.ts +2 -2
- package/dist/components/ui/Fieldset.js +39 -0
- package/dist/components/ui/FilterButton.d.ts +4 -7
- package/dist/components/ui/FilterButton.js +17 -0
- package/dist/components/ui/FilterDropdown.d.ts +4 -4
- package/dist/components/ui/FilterDropdown.js +18 -0
- package/dist/components/ui/FormField.d.ts +4 -4
- package/dist/components/ui/FormField.js +68 -0
- package/dist/components/ui/Grid.d.ts +1 -1
- package/dist/components/ui/Grid.js +19 -0
- package/dist/components/ui/GridItem.d.ts +1 -1
- package/dist/components/ui/GridItem.js +16 -0
- package/dist/components/ui/Inline.d.ts +1 -1
- package/dist/components/ui/Inline.js +24 -0
- package/dist/components/ui/Kbd.d.ts +3 -2
- package/dist/components/ui/Kbd.js +13 -0
- package/dist/components/ui/ListItemLink.d.ts +3 -3
- package/dist/components/ui/ListItemLink.js +44 -0
- package/dist/components/ui/LoadingSpinner.d.ts +3 -2
- package/dist/components/ui/LoadingSpinner.js +19 -0
- package/dist/components/ui/MessageBubble.d.ts +2 -2
- package/dist/components/ui/MessageBubble.js +41 -0
- package/dist/components/ui/MetadataGrid.d.ts +5 -3
- package/dist/components/ui/MetadataGrid.js +76 -0
- package/dist/components/ui/MetricCard.d.ts +3 -3
- package/dist/components/ui/MetricCard.js +51 -0
- package/dist/components/ui/NavTabs.d.ts +2 -2
- package/dist/components/ui/NavTabs.js +29 -0
- package/dist/components/ui/OAuthButton.d.ts +2 -2
- package/dist/components/ui/OAuthButton.js +55 -0
- package/dist/components/ui/OverlineLabel.d.ts +3 -3
- package/dist/components/ui/OverlineLabel.js +13 -0
- package/dist/components/ui/PageHeader.d.ts +3 -3
- package/dist/components/ui/PageHeader.js +33 -0
- package/dist/components/ui/PageSection.d.ts +3 -3
- package/dist/components/ui/PageSection.js +31 -0
- package/dist/components/ui/PaginationBar.d.ts +3 -3
- package/dist/components/ui/PaginationBar.js +62 -0
- package/dist/components/ui/PasswordInput.d.ts +3 -3
- package/dist/components/ui/PasswordInput.js +62 -0
- package/dist/components/ui/PasswordRequirements.d.ts +3 -2
- package/dist/components/ui/PasswordRequirements.js +34 -0
- package/dist/components/ui/Popover.d.ts +3 -3
- package/dist/components/ui/Popover.js +53 -0
- package/dist/components/ui/ProfileHeader.d.ts +3 -3
- package/dist/components/ui/ProfileHeader.js +54 -0
- package/dist/components/ui/ProgressBar.d.ts +3 -3
- package/dist/components/ui/ProgressBar.js +42 -0
- package/dist/components/ui/ProseContent.d.ts +3 -3
- package/dist/components/ui/ProseContent.js +13 -0
- package/dist/components/ui/QrCode.d.ts +3 -3
- package/dist/components/ui/QrCode.js +47 -0
- package/dist/components/ui/Radio.d.ts +9 -6
- package/dist/components/ui/Radio.js +58 -0
- package/dist/components/ui/RadioPill.d.ts +7 -4
- package/dist/components/ui/RadioPill.js +53 -0
- package/dist/components/ui/ReorderList.d.ts +3 -3
- package/dist/components/ui/ReorderList.js +123 -0
- package/dist/components/ui/SearchInput.d.ts +7 -5
- package/dist/components/ui/SearchInput.js +49 -0
- package/dist/components/ui/SectionHeader.d.ts +3 -3
- package/dist/components/ui/SectionHeader.js +13 -0
- package/dist/components/ui/Select.d.ts +4 -4
- package/dist/components/ui/Select.js +117 -0
- package/dist/components/ui/SelectDropdown.d.ts +8 -3
- package/dist/components/ui/SelectDropdown.js +206 -0
- package/dist/components/ui/SettingRow.d.ts +5 -5
- package/dist/components/ui/SettingRow.js +25 -0
- package/dist/components/ui/SideSheet.d.ts +3 -3
- package/dist/components/ui/SideSheet.js +164 -0
- package/dist/components/ui/Skeleton.d.ts +3 -3
- package/dist/components/ui/Skeleton.js +18 -0
- package/dist/components/ui/Slider.d.ts +11 -6
- package/dist/components/ui/Slider.js +58 -0
- package/dist/components/ui/SplitPaneLayout.d.ts +5 -5
- package/dist/components/ui/SplitPaneLayout.js +22 -0
- package/dist/components/ui/Stack.d.ts +1 -1
- package/dist/components/ui/Stack.js +18 -0
- package/dist/components/ui/StatusDot.d.ts +3 -2
- package/dist/components/ui/StatusDot.js +24 -0
- package/dist/components/ui/StepProgress.d.ts +3 -2
- package/dist/components/ui/StepProgress.js +33 -0
- package/dist/components/ui/Tabs.d.ts +5 -5
- package/dist/components/ui/Tabs.js +63 -0
- package/dist/components/ui/TextInput.d.ts +4 -4
- package/dist/components/ui/TextInput.js +57 -0
- package/dist/components/ui/Textarea.d.ts +3 -3
- package/dist/components/ui/Textarea.js +59 -0
- package/dist/components/ui/ThemePreview.d.ts +3 -3
- package/dist/components/ui/ThemePreview.js +28 -0
- package/dist/components/ui/TimeInput.d.ts +7 -6
- package/dist/components/ui/TimeInput.js +22 -0
- package/dist/components/ui/Timeline.d.ts +3 -2
- package/dist/components/ui/Timeline.js +29 -0
- package/dist/components/ui/Toast.js +121 -0
- package/dist/components/ui/Toggle.d.ts +5 -3
- package/dist/components/ui/Toggle.js +34 -0
- package/dist/components/ui/Toolbar.d.ts +3 -3
- package/dist/components/ui/Toolbar.js +70 -0
- package/dist/components/ui/Tooltip.js +91 -0
- package/dist/components/ui/TranscriptLine.d.ts +3 -3
- package/dist/components/ui/TranscriptLine.js +40 -0
- package/dist/components/ui/UploadDropzone.d.ts +3 -5
- package/dist/components/ui/UploadDropzone.js +55 -0
- package/dist/components/ui/badgeColors.js +5 -0
- package/dist/components/ui/calendar/AgendaView.js +140 -0
- package/dist/components/ui/calendar/MonthView.js +321 -0
- package/dist/components/ui/calendar/TimeGrid.js +501 -0
- package/dist/components/ui/calendar/TimelineView.js +311 -0
- package/dist/components/ui/calendar/context.js +10 -0
- package/dist/components/ui/calendar/items.js +152 -0
- package/dist/components/ui/calendar/types.js +38 -0
- package/dist/components/ui/calendar/useGridInteraction.js +393 -0
- package/dist/components/ui/useFieldControl.d.ts +1 -1
- package/dist/components/ui/useFieldControl.js +17 -0
- package/dist/config/theme.js +219 -0
- package/dist/core.css +2933 -0
- package/dist/hooks/useAnchoredPopup.js +162 -0
- package/dist/hooks/useApplyTheme.js +16 -0
- package/dist/hooks/useControllableState.d.ts +14 -0
- package/dist/hooks/useControllableState.js +10 -0
- package/dist/hooks/useDismiss.js +24 -0
- package/dist/hooks/useFocusTrap.js +42 -0
- package/dist/hooks/useOverlayStack.js +23 -0
- package/dist/hooks/usePopover.js +47 -0
- package/dist/hooks/usePortalContainer.js +14 -0
- package/dist/hooks/useSettings.js +8 -0
- package/dist/hooks/useTheme.js +8 -0
- package/dist/hooks/useTypeahead.js +19 -0
- package/dist/index.js +133 -12884
- package/dist/lib/anchorPlacement.js +75 -0
- package/dist/lib/calendar.js +666 -0
- package/dist/lib/cn.js +228 -0
- package/dist/lib/codeInput.js +51 -0
- package/dist/lib/dateParts.js +31 -0
- package/dist/lib/dialogDrag.js +45 -0
- package/dist/lib/dialogResize.js +47 -0
- package/dist/lib/formatDate.js +29 -0
- package/dist/lib/formatMediaTime.js +7 -0
- package/dist/lib/layout.js +29 -0
- package/dist/lib/math.js +6 -0
- package/dist/lib/mergeRefs.d.ts +6 -0
- package/dist/lib/mergeRefs.js +17 -0
- package/dist/lib/months.js +30 -0
- package/dist/lib/overlayStack.js +47 -0
- package/dist/lib/panelResize.js +8 -0
- package/dist/lib/passwordRequirements.js +23 -0
- package/dist/lib/qrCode.js +570 -0
- package/dist/lib/tones.js +104 -0
- package/dist/lib/typeahead.js +31 -0
- package/dist/providers/ControlSizeContext.js +9 -0
- package/dist/providers/ControlSizeProvider.js +11 -0
- package/dist/providers/SettingsContext.js +53 -0
- package/dist/providers/SettingsProvider.js +249 -0
- package/dist/providers/ThemeContext.js +5 -0
- package/dist/providers/ThemeProvider.js +17 -0
- package/dist/providers/accentColors.js +75 -0
- package/dist/providers/themeClasses.d.ts +1 -0
- package/dist/providers/themeClasses.js +20 -0
- package/dist/styles.css +228 -176
- package/dist/themes/cyber-brutal-dark.css +53 -0
- package/dist/themes/cyber-brutal-light.css +75 -0
- package/dist/themes/glass-dark.css +217 -0
- package/dist/themes/glass-light.css +215 -0
- package/dist/themes/hashi.css +66 -0
- package/dist/themes/light-inverted.css +32 -0
- package/dist/themes/light.css +1 -0
- package/dist/themes/monokai.css +51 -0
- package/dist/themes/solarized.css +55 -0
- package/package.json +3 -1
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { mergeRefs as t } from "../../lib/mergeRefs.js";
|
|
3
|
+
import { usePortalContainer as n } from "../../hooks/usePortalContainer.js";
|
|
4
|
+
import { useAnchoredPopup as r } from "../../hooks/useAnchoredPopup.js";
|
|
5
|
+
import { useDismiss as i } from "../../hooks/useDismiss.js";
|
|
6
|
+
import { Button as a } from "./Button.js";
|
|
7
|
+
import { findTypeaheadMatch as o, isTypeaheadKey as ee } from "../../lib/typeahead.js";
|
|
8
|
+
import { Fragment as s, cloneElement as c, isValidElement as te, useCallback as ne, useEffect as re, useId as ie, useMemo as ae, useRef as l, useState as u } from "react";
|
|
9
|
+
import { Fragment as oe, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
10
|
+
import { Check as se } from "lucide-react";
|
|
11
|
+
import { createPortal as ce } from "react-dom";
|
|
12
|
+
//#region src/components/ui/DropdownMenu.tsx
|
|
13
|
+
var le = (e) => !e.divider;
|
|
14
|
+
function ue(e) {
|
|
15
|
+
return e.checked === void 0 ? "menuitem" : e.type === "radio" ? "menuitemradio" : "menuitemcheckbox";
|
|
16
|
+
}
|
|
17
|
+
function p({ trigger: p, triggerIcon: m, triggerLabel: h, triggerSize: de = "xs", items: g, header: _, renderLink: v, align: fe = "right", ref: y, id: pe, className: b, style: x, onKeyDown: me, onFocus: S, onBlur: C, ...w }) {
|
|
18
|
+
let T = m ? /* @__PURE__ */ d(a, {
|
|
19
|
+
variant: "icon",
|
|
20
|
+
size: de,
|
|
21
|
+
hideLabel: !0,
|
|
22
|
+
icon: m,
|
|
23
|
+
"aria-label": h,
|
|
24
|
+
title: h
|
|
25
|
+
}) : p, [E, D] = u(!1), O = _ != null && _ !== !1, he = n(), [k, ge] = u(0), [A, _e] = u(""), [j, M] = u(-1), N = l(null), P = l(null), F = l(null), I = l(null), L = l([]), R = l(!1), z = ie(), B = pe ?? `${z}menu`, V = `${z}header`, H = te(T) && T.type !== s ? T : null, U = H?.props.id, W = typeof U == "string" && U ? U : `${z}trigger`, G = [];
|
|
26
|
+
g.forEach((e) => {
|
|
27
|
+
le(e) && G.push({
|
|
28
|
+
item: e,
|
|
29
|
+
index: G.length
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
let K = G.filter(({ item: e }) => !e.disabled), ve = () => {
|
|
33
|
+
let e = N.current;
|
|
34
|
+
return e ? H ? [...e.querySelectorAll("[id]")].find((e) => e.id === W) ?? e.querySelector("button, a[href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])") ?? e.firstElementChild ?? e : e : null;
|
|
35
|
+
}, q = ne((e) => {
|
|
36
|
+
D(!1), M(-1), (e === "escape" || e === "select" || e === "tab") && P.current?.focus();
|
|
37
|
+
}, []);
|
|
38
|
+
i(E, q, [I], [N]), r(E, P, I, {
|
|
39
|
+
side: "bottom",
|
|
40
|
+
align: fe === "left" ? "start" : "end",
|
|
41
|
+
gap: 4,
|
|
42
|
+
onAnchorHidden: q
|
|
43
|
+
}), re(() => {
|
|
44
|
+
E && (j >= 0 ? L.current[j] : F.current)?.focus();
|
|
45
|
+
}, [
|
|
46
|
+
E,
|
|
47
|
+
j,
|
|
48
|
+
O
|
|
49
|
+
]);
|
|
50
|
+
function J(e) {
|
|
51
|
+
let t = ve();
|
|
52
|
+
P.current = t, _e(t?.id ?? ""), ge(t?.getBoundingClientRect().width ?? 0), D(!0), M((e === "first" ? K[0] : e === "last" ? K.at(-1) : null)?.index ?? -1);
|
|
53
|
+
}
|
|
54
|
+
function ye(e) {
|
|
55
|
+
if (!(R.current && (R.current = !1, e.detail === 0))) {
|
|
56
|
+
if (E) {
|
|
57
|
+
q();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
J(e.detail === 0 ? "first" : "menu");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function be(e) {
|
|
64
|
+
R.current = !1, e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), J(e.key === "ArrowDown" ? "first" : "last")) : !H && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), E ? q("select") : J("first"));
|
|
65
|
+
}
|
|
66
|
+
function Y(e) {
|
|
67
|
+
!e || e.item.disabled || (q("select"), e.item.onClick?.());
|
|
68
|
+
}
|
|
69
|
+
function X(e, t) {
|
|
70
|
+
let n = G.length, r = e === -1 && t === -1 ? n : e;
|
|
71
|
+
for (let e = 1; e <= n; e++) {
|
|
72
|
+
let i = G[(r + t * e + n * 2) % n];
|
|
73
|
+
if (!i.item.disabled) return i.index;
|
|
74
|
+
}
|
|
75
|
+
return -1;
|
|
76
|
+
}
|
|
77
|
+
function xe(e) {
|
|
78
|
+
let t = o(G.map((e) => e.item.label), (e) => !!G[e].item.disabled, j, e);
|
|
79
|
+
return t === -1 ? j : G[t].index;
|
|
80
|
+
}
|
|
81
|
+
function Se(e) {
|
|
82
|
+
let { key: t } = e, n = null;
|
|
83
|
+
if (t === "ArrowDown") n = X(j, 1);
|
|
84
|
+
else if (t === "ArrowUp") n = X(j, -1);
|
|
85
|
+
else if (t === "Home") n = K[0]?.index ?? -1;
|
|
86
|
+
else if (t === "End") n = K.at(-1)?.index ?? -1;
|
|
87
|
+
else if (t === "Enter" || t === " ") {
|
|
88
|
+
let n = L.current.indexOf(e.target), r = n === -1 ? void 0 : G[n];
|
|
89
|
+
if (!r || r.item.disabled) {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (r.item.href !== void 0 && t === "Enter") return;
|
|
94
|
+
e.preventDefault(), t === " " && (R.current = !0), r.item.href === void 0 ? Y(r) : L.current[n]?.click();
|
|
95
|
+
return;
|
|
96
|
+
} else if (t === "Tab") {
|
|
97
|
+
q("tab");
|
|
98
|
+
return;
|
|
99
|
+
} else t !== " " && ee(e) && (n = xe(t));
|
|
100
|
+
n !== null && (e.preventDefault(), M(n));
|
|
101
|
+
}
|
|
102
|
+
let Ce = ae(() => t(F, O ? void 0 : I, y), [y, O]), Z = {
|
|
103
|
+
"aria-haspopup": "menu",
|
|
104
|
+
"aria-expanded": E,
|
|
105
|
+
"aria-controls": E ? B : void 0
|
|
106
|
+
}, Q = -1, $ = E ? /* @__PURE__ */ d("div", {
|
|
107
|
+
...w,
|
|
108
|
+
ref: Ce,
|
|
109
|
+
id: B,
|
|
110
|
+
role: "menu",
|
|
111
|
+
"aria-labelledby": A || W,
|
|
112
|
+
"aria-describedby": O ? V : void 0,
|
|
113
|
+
tabIndex: -1,
|
|
114
|
+
onKeyDown: (e) => {
|
|
115
|
+
me?.(e), !e.defaultPrevented && Se(e);
|
|
116
|
+
},
|
|
117
|
+
onFocus: (e) => {
|
|
118
|
+
S?.(e), e.stopPropagation();
|
|
119
|
+
},
|
|
120
|
+
onBlur: (e) => {
|
|
121
|
+
C?.(e), e.stopPropagation();
|
|
122
|
+
},
|
|
123
|
+
className: e("ui-glass ui-glass-popover bg-bg-tertiary border-border-strong animate-scale-in fixed top-0 left-0 z-[100] w-max rounded-md border py-1 shadow-lg focus:outline-none", b),
|
|
124
|
+
style: {
|
|
125
|
+
...x,
|
|
126
|
+
minWidth: k
|
|
127
|
+
},
|
|
128
|
+
children: g.map((t, n) => {
|
|
129
|
+
if (t.divider) return /* @__PURE__ */ d("div", {
|
|
130
|
+
className: "border-border my-1 border-t",
|
|
131
|
+
role: "separator"
|
|
132
|
+
}, `divider-${n}`);
|
|
133
|
+
Q++;
|
|
134
|
+
let r = G[Q], i = t.checked !== void 0, a = /* @__PURE__ */ f("button", {
|
|
135
|
+
type: "button",
|
|
136
|
+
ref: (e) => {
|
|
137
|
+
L.current[r.index] = e;
|
|
138
|
+
},
|
|
139
|
+
role: ue(t),
|
|
140
|
+
"aria-checked": i ? t.checked : void 0,
|
|
141
|
+
"aria-disabled": t.disabled || void 0,
|
|
142
|
+
tabIndex: r.index === j ? 0 : -1,
|
|
143
|
+
onClick: () => Y(r),
|
|
144
|
+
onMouseDown: t.disabled ? (e) => e.preventDefault() : void 0,
|
|
145
|
+
onFocus: () => M(r.index),
|
|
146
|
+
onMouseMove: () => {
|
|
147
|
+
!t.disabled && r.index !== j && M(r.index);
|
|
148
|
+
},
|
|
149
|
+
className: e("flex h-7 w-full items-center gap-2 px-4 text-left text-xs", "transition-colors duration-[100ms]", "focus:outline-none", t.disabled ? "text-text-secondary cursor-not-allowed opacity-50" : t.danger ? "text-danger-fg hover:bg-danger-muted focus:bg-danger-muted cursor-pointer" : "text-text-secondary hover:text-text-primary hover:bg-bg-hover focus:text-text-primary focus:bg-bg-hover cursor-pointer"),
|
|
150
|
+
children: [
|
|
151
|
+
t.icon && /* @__PURE__ */ d("span", {
|
|
152
|
+
className: "flex h-3.5 w-3.5 shrink-0 items-center",
|
|
153
|
+
children: t.icon
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ d("span", {
|
|
156
|
+
className: "flex-1",
|
|
157
|
+
children: t.label
|
|
158
|
+
}),
|
|
159
|
+
t.badge != null && /* @__PURE__ */ d("span", {
|
|
160
|
+
className: "ml-auto",
|
|
161
|
+
children: t.badge
|
|
162
|
+
}),
|
|
163
|
+
t.shortcut && /* @__PURE__ */ d("span", {
|
|
164
|
+
className: "text-2xs text-text-tertiary ml-auto pl-4 font-mono",
|
|
165
|
+
children: t.shortcut
|
|
166
|
+
}),
|
|
167
|
+
t.checked && /* @__PURE__ */ d(se, { className: "text-accent ml-auto h-3.5 w-3.5 shrink-0" })
|
|
168
|
+
]
|
|
169
|
+
}, `item-${n}`);
|
|
170
|
+
if (t.href === void 0) return a;
|
|
171
|
+
let o = {
|
|
172
|
+
...a.props,
|
|
173
|
+
type: void 0,
|
|
174
|
+
href: t.disabled ? void 0 : t.href,
|
|
175
|
+
target: t.target,
|
|
176
|
+
rel: t.rel,
|
|
177
|
+
download: t.download,
|
|
178
|
+
"aria-current": t["aria-current"],
|
|
179
|
+
onClick: (e) => {
|
|
180
|
+
if (t.disabled) {
|
|
181
|
+
e.preventDefault();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || Y(r);
|
|
185
|
+
},
|
|
186
|
+
onAuxClick: t.disabled ? (e) => e.preventDefault() : void 0,
|
|
187
|
+
ref: (e) => {
|
|
188
|
+
L.current[r.index] = e;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
return delete o.key, /* @__PURE__ */ d(s, { children: v ? v(o, t) : /* @__PURE__ */ d("a", { ...o }) }, `item-${n}`);
|
|
192
|
+
})
|
|
193
|
+
}) : null;
|
|
194
|
+
return /* @__PURE__ */ f(oe, { children: [/* @__PURE__ */ d("div", {
|
|
195
|
+
ref: N,
|
|
196
|
+
onClick: ye,
|
|
197
|
+
onKeyDown: be,
|
|
198
|
+
...H ? {} : {
|
|
199
|
+
...Z,
|
|
200
|
+
id: W,
|
|
201
|
+
role: "button",
|
|
202
|
+
tabIndex: 0
|
|
203
|
+
},
|
|
204
|
+
children: H ? c(H, {
|
|
205
|
+
...Z,
|
|
206
|
+
id: W
|
|
207
|
+
}) : T
|
|
208
|
+
}), $ && ce(O ? /* @__PURE__ */ f("div", {
|
|
209
|
+
ref: I,
|
|
210
|
+
onMouseDown: (e) => {
|
|
211
|
+
F.current?.contains(e.target) || e.preventDefault();
|
|
212
|
+
},
|
|
213
|
+
className: e("ui-glass ui-glass-popover bg-bg-tertiary border-border-strong animate-scale-in fixed top-0 left-0 z-[100] w-max rounded-md border py-1 shadow-lg focus:outline-none", b),
|
|
214
|
+
style: {
|
|
215
|
+
...x,
|
|
216
|
+
minWidth: k
|
|
217
|
+
},
|
|
218
|
+
children: [/* @__PURE__ */ d("div", {
|
|
219
|
+
id: V,
|
|
220
|
+
className: "border-border border-b px-4 py-2",
|
|
221
|
+
children: _
|
|
222
|
+
}), c($, {
|
|
223
|
+
className: "focus:outline-none",
|
|
224
|
+
style: void 0
|
|
225
|
+
})]
|
|
226
|
+
}) : $, he ?? document.body)] });
|
|
227
|
+
}
|
|
228
|
+
//#endregion
|
|
229
|
+
export { p as DropdownMenu };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
export interface EmptyStateProps {
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
export interface EmptyStateProps extends ComponentPropsWithRef<"div"> {
|
|
3
3
|
/** Icon shown in the tile above the title. Defaults to an inbox icon. */
|
|
4
4
|
icon?: ReactNode;
|
|
5
5
|
/** Heading text. */
|
|
@@ -11,4 +11,4 @@ export interface EmptyStateProps {
|
|
|
11
11
|
/** Additional utility classes for the root element. */
|
|
12
12
|
className?: string;
|
|
13
13
|
}
|
|
14
|
-
export declare function EmptyState({ icon, title, description, action, className, }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function EmptyState({ icon, title, description, action, className, ref, ...rest }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { Inbox as r } from "lucide-react";
|
|
4
|
+
//#region src/components/ui/EmptyState.tsx
|
|
5
|
+
function i({ icon: i, title: a, description: o, action: s, className: c, ref: l, ...u }) {
|
|
6
|
+
return /* @__PURE__ */ n("div", {
|
|
7
|
+
...u,
|
|
8
|
+
ref: l,
|
|
9
|
+
className: e("flex flex-col items-center justify-center px-4 py-12", c),
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ t("div", {
|
|
12
|
+
className: "bg-bg-tertiary text-text-tertiary mb-3 flex h-10 w-10 items-center justify-center rounded-md",
|
|
13
|
+
children: i || /* @__PURE__ */ t(r, { className: "h-5 w-5" })
|
|
14
|
+
}),
|
|
15
|
+
/* @__PURE__ */ t("p", {
|
|
16
|
+
className: "text-text-primary mb-1 text-sm font-medium",
|
|
17
|
+
children: a
|
|
18
|
+
}),
|
|
19
|
+
o && /* @__PURE__ */ t("p", {
|
|
20
|
+
className: "text-text-secondary max-w-[300px] text-center text-xs",
|
|
21
|
+
children: o
|
|
22
|
+
}),
|
|
23
|
+
s && /* @__PURE__ */ t("div", {
|
|
24
|
+
className: "mt-4",
|
|
25
|
+
children: s
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { i as EmptyState };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Button as e } from "./Button.js";
|
|
2
|
+
import { Component as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/ErrorBoundary.tsx
|
|
5
|
+
var i = class extends t {
|
|
6
|
+
state = {
|
|
7
|
+
hasError: !1,
|
|
8
|
+
error: null
|
|
9
|
+
};
|
|
10
|
+
static getDerivedStateFromError(e) {
|
|
11
|
+
return {
|
|
12
|
+
hasError: !0,
|
|
13
|
+
error: e
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
componentDidCatch(e, t) {
|
|
17
|
+
console.error("[ErrorBoundary] Uncaught error:", e, t.componentStack);
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return this.state.hasError ? /* @__PURE__ */ r("div", {
|
|
21
|
+
className: "ui-glass-shell bg-bg-primary flex min-h-svh flex-col items-center justify-center p-8 text-center",
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ n("p", {
|
|
24
|
+
className: "text-text-primary mb-2 text-lg font-semibold",
|
|
25
|
+
children: "Something went wrong"
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ n("p", {
|
|
28
|
+
className: "text-text-secondary mb-6 max-w-md text-xs",
|
|
29
|
+
children: this.state.error?.message ?? "An unexpected error occurred."
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ n(e, {
|
|
32
|
+
variant: "secondary",
|
|
33
|
+
onClick: () => {
|
|
34
|
+
this.setState({
|
|
35
|
+
hasError: !1,
|
|
36
|
+
error: null
|
|
37
|
+
}), window.location.href = "/";
|
|
38
|
+
},
|
|
39
|
+
children: "Go home"
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
}) : this.props.children;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { i as ErrorBoundary };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createContext as e } from "react";
|
|
2
|
+
//#region src/components/ui/FieldContext.ts
|
|
3
|
+
var t = e(null);
|
|
4
|
+
function n(...e) {
|
|
5
|
+
return [...new Set(e.flatMap((e) => e?.split(/\s+/).filter(Boolean) ?? []))].join(" ") || void 0;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as FieldContext, n as describeField };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface FieldsetProps extends
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
|
+
export interface FieldsetProps extends ComponentPropsWithRef<"fieldset"> {
|
|
3
3
|
/** Group caption rendered as the fieldset legend. */
|
|
4
4
|
legend: ReactNode;
|
|
5
5
|
/** Helper text shown below the legend and linked via aria-describedby. */
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { FieldContext as t, describeField as n } from "./FieldContext.js";
|
|
3
|
+
import { useId as r } from "react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/ui/Fieldset.tsx
|
|
6
|
+
function o({ id: o, legend: s, hint: c, error: l, children: u, className: d, "aria-describedby": f, ...p }) {
|
|
7
|
+
let m = r(), h = o ?? m, g = c ? `${h}-hint` : void 0, _ = l ? `${h}-error` : void 0, v = n(f, g, _);
|
|
8
|
+
return /* @__PURE__ */ a("fieldset", {
|
|
9
|
+
...p,
|
|
10
|
+
id: h,
|
|
11
|
+
"aria-describedby": v,
|
|
12
|
+
className: e("min-w-0 space-y-2", d),
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ i("legend", {
|
|
15
|
+
className: "text-text-primary font-label text-xs font-medium",
|
|
16
|
+
children: s
|
|
17
|
+
}),
|
|
18
|
+
c && /* @__PURE__ */ i("p", {
|
|
19
|
+
id: g,
|
|
20
|
+
className: "text-text-secondary text-xs",
|
|
21
|
+
children: c
|
|
22
|
+
}),
|
|
23
|
+
l && /* @__PURE__ */ i("p", {
|
|
24
|
+
id: _,
|
|
25
|
+
className: "text-danger-fg text-xs",
|
|
26
|
+
children: l
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ i(t.Provider, {
|
|
29
|
+
value: {
|
|
30
|
+
describedBy: v,
|
|
31
|
+
invalid: !!l
|
|
32
|
+
},
|
|
33
|
+
children: u
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { o as Fieldset };
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
* </FilterButton>
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
import {
|
|
29
|
-
export interface FilterButtonProps extends
|
|
28
|
+
import type { ComponentPropsWithRef, ElementType, ReactNode } from "react";
|
|
29
|
+
export interface FilterButtonProps extends ComponentPropsWithRef<"button"> {
|
|
30
30
|
/**
|
|
31
31
|
* A Lucide icon component rendered at 14px (h-3.5 w-3.5).
|
|
32
32
|
* Pass the component itself, not a JSX element.
|
|
@@ -38,8 +38,5 @@ export interface FilterButtonProps extends React.ButtonHTMLAttributes<HTMLButton
|
|
|
38
38
|
*/
|
|
39
39
|
children?: ReactNode;
|
|
40
40
|
}
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
* trigger, which may need to attach a ref for positioning.
|
|
44
|
-
*/
|
|
45
|
-
export declare const FilterButton: import("react").ForwardRefExoticComponent<FilterButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
41
|
+
/** Accepts `ref` so the button works as a `<DropdownMenu>` trigger. */
|
|
42
|
+
export declare function FilterButton({ icon: Icon, children, className, ref, ...rest }: FilterButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/ui/FilterButton.tsx
|
|
4
|
+
function r({ icon: r, children: i, className: a, ref: o, ...s }) {
|
|
5
|
+
return /* @__PURE__ */ n("button", {
|
|
6
|
+
type: "button",
|
|
7
|
+
ref: o,
|
|
8
|
+
className: e("flex h-7 cursor-pointer items-center gap-1.5 rounded-md px-2.5", "border-border bg-bg-secondary text-text-secondary border", "hover:bg-bg-hover hover:border-border-strong", "text-xs", "transition-colors duration-[100ms]", a),
|
|
9
|
+
...s,
|
|
10
|
+
children: [/* @__PURE__ */ t(r, { className: "h-3.5 w-3.5 shrink-0" }), i && /* @__PURE__ */ t("span", {
|
|
11
|
+
className: "hidden sm:inline",
|
|
12
|
+
children: i
|
|
13
|
+
})]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as FilterButton };
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
* </FilterDropdown>
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
import type { ComponentProps, ElementType, ReactNode } from "react";
|
|
28
|
+
import type { ComponentProps, ComponentPropsWithRef, ElementType, ReactNode } from "react";
|
|
29
29
|
import { DropdownMenu } from "./DropdownMenu";
|
|
30
|
-
export interface FilterDropdownProps {
|
|
30
|
+
export interface FilterDropdownProps extends Omit<ComponentPropsWithRef<"button">, "children"> {
|
|
31
31
|
/**
|
|
32
32
|
* A Lucide icon component for the trigger button.
|
|
33
33
|
* Passed through to FilterButton.
|
|
@@ -42,7 +42,7 @@ export interface FilterDropdownProps {
|
|
|
42
42
|
items: ComponentProps<typeof DropdownMenu>["items"];
|
|
43
43
|
/** Dropdown alignment relative to the trigger. Defaults to DropdownMenu's default. */
|
|
44
44
|
align?: ComponentProps<typeof DropdownMenu>["align"];
|
|
45
|
-
/** Additional utility classes for the trigger button. */
|
|
45
|
+
/** Additional utility classes for the trigger button; other button props, including `ref`, go to it too. */
|
|
46
46
|
className?: string;
|
|
47
47
|
}
|
|
48
|
-
export declare function FilterDropdown({ icon, children, items, align, className, }: FilterDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare function FilterDropdown({ icon, children, items, align, className, ...rest }: FilterDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FilterButton as e } from "./FilterButton.js";
|
|
2
|
+
import { DropdownMenu as t } from "./DropdownMenu.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/FilterDropdown.tsx
|
|
5
|
+
function r({ icon: r, children: i, items: a, align: o, className: s, ...c }) {
|
|
6
|
+
return /* @__PURE__ */ n(t, {
|
|
7
|
+
align: o,
|
|
8
|
+
trigger: /* @__PURE__ */ n(e, {
|
|
9
|
+
...c,
|
|
10
|
+
icon: r,
|
|
11
|
+
className: s,
|
|
12
|
+
children: i
|
|
13
|
+
}),
|
|
14
|
+
items: a
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as FilterDropdown };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
2
|
export interface FieldControlAttributes {
|
|
3
3
|
id: string;
|
|
4
4
|
"aria-describedby"?: string;
|
|
5
5
|
"aria-invalid"?: boolean;
|
|
6
6
|
required?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export interface FormFieldProps extends Omit<
|
|
8
|
+
export interface FormFieldProps extends Omit<ComponentPropsWithRef<"div">, "children"> {
|
|
9
9
|
/** Stable input ID, generated when omitted and passed to child UI controls. */
|
|
10
10
|
id?: string;
|
|
11
11
|
/** Label text for the control. */
|
|
@@ -31,6 +31,6 @@ export interface FormFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "ch
|
|
|
31
31
|
/** Label, hint and error association for one control. */
|
|
32
32
|
export declare function FormField({ id, label, hint, error, required, optionalLabel, labelPlacement, children, className, ...props }: FormFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
33
33
|
/** Standalone hint text for custom controls; connect its ID with aria-describedby. */
|
|
34
|
-
export declare function FieldHint({ className, ...props }:
|
|
34
|
+
export declare function FieldHint({ className, ...props }: ComponentPropsWithRef<"p">): import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
/** Standalone field error associated with its control. */
|
|
36
|
-
export declare function FieldError({ className, ...props }:
|
|
36
|
+
export declare function FieldError({ className, ...props }: ComponentPropsWithRef<"p">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { FieldContext as t, describeField as n } from "./FieldContext.js";
|
|
3
|
+
import { useCallback as r, useId as i, useState as a } from "react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/ui/FormField.tsx
|
|
6
|
+
function c({ id: c, label: l, hint: u, error: d, required: f, optionalLabel: p, labelPlacement: m = "above", children: h, className: g, ..._ }) {
|
|
7
|
+
let v = i(), y = c ?? v, b = u ? `${y}-hint` : void 0, x = d ? `${y}-error` : void 0, S = `${y}-label`, [C, w] = a(0), T = r(() => (w((e) => e + 1), () => w((e) => e - 1)), []), E = m === "placeholder" && typeof l == "string" && l ? l : void 0, D = {
|
|
8
|
+
id: y,
|
|
9
|
+
"aria-describedby": n(b, x),
|
|
10
|
+
"aria-invalid": !!d || void 0,
|
|
11
|
+
required: f
|
|
12
|
+
};
|
|
13
|
+
return /* @__PURE__ */ o(t.Provider, {
|
|
14
|
+
value: {
|
|
15
|
+
id: y,
|
|
16
|
+
describedBy: n(b, x),
|
|
17
|
+
invalid: !!d,
|
|
18
|
+
required: f,
|
|
19
|
+
placeholderLabel: E,
|
|
20
|
+
labelId: S,
|
|
21
|
+
claimLabel: T
|
|
22
|
+
},
|
|
23
|
+
children: /* @__PURE__ */ s("div", {
|
|
24
|
+
..._,
|
|
25
|
+
className: e("flex flex-col gap-1.5", g),
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ s("label", {
|
|
28
|
+
id: C > 0 ? S : void 0,
|
|
29
|
+
htmlFor: y,
|
|
30
|
+
className: e("ui-field-label font-label text-xs font-medium", E && "sr-only"),
|
|
31
|
+
children: [
|
|
32
|
+
l,
|
|
33
|
+
f && /* @__PURE__ */ o("span", {
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
children: " *"
|
|
36
|
+
}),
|
|
37
|
+
!f && p && /* @__PURE__ */ s("span", { children: [" ", p] })
|
|
38
|
+
]
|
|
39
|
+
}),
|
|
40
|
+
u && /* @__PURE__ */ o("p", {
|
|
41
|
+
id: b,
|
|
42
|
+
className: "text-text-secondary text-xs",
|
|
43
|
+
children: u
|
|
44
|
+
}),
|
|
45
|
+
d && /* @__PURE__ */ o("p", {
|
|
46
|
+
id: x,
|
|
47
|
+
className: "text-danger-fg text-xs",
|
|
48
|
+
children: d
|
|
49
|
+
}),
|
|
50
|
+
typeof h == "function" ? h(D) : h
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function l({ className: t, ...n }) {
|
|
56
|
+
return /* @__PURE__ */ o("p", {
|
|
57
|
+
...n,
|
|
58
|
+
className: e("text-text-secondary text-xs", t)
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function u({ className: t, ...n }) {
|
|
62
|
+
return /* @__PURE__ */ o("p", {
|
|
63
|
+
...n,
|
|
64
|
+
className: e("text-danger-fg text-xs", t)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { u as FieldError, l as FieldHint, c as FormField };
|
|
@@ -14,7 +14,7 @@ export interface GridOptions {
|
|
|
14
14
|
justify?: "start" | "center" | "end" | "stretch";
|
|
15
15
|
}
|
|
16
16
|
export type GridProps<E extends LayoutElement = "div"> = LayoutProps<E, GridOptions>;
|
|
17
|
-
export declare function Grid<E extends LayoutElement = "div">({ as, columns, gap, gapX, gapY, align, justify, className, style, ...props }: GridProps<E>): import("react").DetailedReactHTMLElement<Omit<GridProps<E>, "columns" | "
|
|
17
|
+
export declare function Grid<E extends LayoutElement = "div">({ as, columns, gap, gapX, gapY, align, justify, className, style, ...props }: GridProps<E>): import("react").DetailedReactHTMLElement<Omit<GridProps<E>, "columns" | "style" | "className" | "gap" | "justify" | "align" | "as" | "gapX" | "gapY"> & {
|
|
18
18
|
className: string;
|
|
19
19
|
style: LayoutStyle;
|
|
20
20
|
}, HTMLElement>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { columnTemplate as t, responsiveStyle as n, spacingStyle as r } from "../../lib/layout.js";
|
|
3
|
+
import { createElement as i } from "react";
|
|
4
|
+
//#region src/components/ui/Grid.tsx
|
|
5
|
+
function a({ as: a, columns: o = 1, gap: s = 0, gapX: c, gapY: l, align: u = "stretch", justify: d = "stretch", className: f, style: p, ...m }) {
|
|
6
|
+
return i(a ?? "div", {
|
|
7
|
+
...m,
|
|
8
|
+
className: e("ui-grid", f),
|
|
9
|
+
style: {
|
|
10
|
+
...r(s, c, l),
|
|
11
|
+
...n("columns", o, t, 1),
|
|
12
|
+
"--ui-align": u,
|
|
13
|
+
"--ui-justify": d,
|
|
14
|
+
...p
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { a as Grid };
|
|
@@ -4,7 +4,7 @@ export interface GridItemOptions {
|
|
|
4
4
|
span?: LayoutResponsive<number>;
|
|
5
5
|
}
|
|
6
6
|
export type GridItemProps<E extends LayoutElement = "div"> = LayoutProps<E, GridItemOptions>;
|
|
7
|
-
export declare function GridItem<E extends LayoutElement = "div">({ as, span, className, style, ...props }: GridItemProps<E>): import("react").DetailedReactHTMLElement<Omit<GridItemProps<E>, "
|
|
7
|
+
export declare function GridItem<E extends LayoutElement = "div">({ as, span, className, style, ...props }: GridItemProps<E>): import("react").DetailedReactHTMLElement<Omit<GridItemProps<E>, "span" | "style" | "className" | "as"> & {
|
|
8
8
|
className: string;
|
|
9
9
|
style: LayoutStyle;
|
|
10
10
|
}, HTMLElement>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { responsiveStyle as t } from "../../lib/layout.js";
|
|
3
|
+
import { createElement as n } from "react";
|
|
4
|
+
//#region src/components/ui/GridItem.tsx
|
|
5
|
+
function r({ as: r, span: i = 1, className: a, style: o, ...s }) {
|
|
6
|
+
return n(r ?? "div", {
|
|
7
|
+
...s,
|
|
8
|
+
className: e("ui-grid-item", a),
|
|
9
|
+
style: {
|
|
10
|
+
...t("span", i, (e) => `span ${e} / span ${e}`, 1),
|
|
11
|
+
...o
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { r as GridItem };
|
|
@@ -18,7 +18,7 @@ export interface InlineOptions {
|
|
|
18
18
|
stackBelow?: LayoutBreakpoint;
|
|
19
19
|
}
|
|
20
20
|
export type InlineProps<E extends LayoutElement = "div"> = LayoutProps<E, InlineOptions>;
|
|
21
|
-
export declare function Inline<E extends LayoutElement = "div">({ as, gap, gapX, gapY, align, justify, wrap, inline, stackBelow, className, style, ...props }: InlineProps<E>): import("react").DetailedReactHTMLElement<Omit<InlineProps<E>, "inline" | "
|
|
21
|
+
export declare function Inline<E extends LayoutElement = "div">({ as, gap, gapX, gapY, align, justify, wrap, inline, stackBelow, className, style, ...props }: InlineProps<E>): import("react").DetailedReactHTMLElement<Omit<InlineProps<E>, "inline" | "style" | "className" | "gap" | "wrap" | "justify" | "align" | "as" | "gapX" | "gapY" | "stackBelow"> & {
|
|
22
22
|
className: string;
|
|
23
23
|
style: LayoutStyle;
|
|
24
24
|
}, HTMLElement>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { flexAlign as t, flexJustify as n, responsiveStyle as r, spacingStyle as i } from "../../lib/layout.js";
|
|
3
|
+
import { createElement as a } from "react";
|
|
4
|
+
//#region src/components/ui/Inline.tsx
|
|
5
|
+
function o({ as: o, gap: s = 0, gapX: c, gapY: l, align: u = "stretch", justify: d = "start", wrap: f = !1, inline: p = !1, stackBelow: m, className: h, style: g, ..._ }) {
|
|
6
|
+
return a(o ?? "div", {
|
|
7
|
+
..._,
|
|
8
|
+
className: e("ui-inline", h),
|
|
9
|
+
style: {
|
|
10
|
+
...i(s, c, l),
|
|
11
|
+
"--ui-align": t(u),
|
|
12
|
+
"--ui-justify": n(d),
|
|
13
|
+
"--ui-wrap": f ? "wrap" : "nowrap",
|
|
14
|
+
"--ui-display": p ? "inline-flex" : "flex",
|
|
15
|
+
...r("direction", m ? {
|
|
16
|
+
base: "column",
|
|
17
|
+
[m]: "row"
|
|
18
|
+
} : "row", (e) => e, "row"),
|
|
19
|
+
...g
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { o as Inline };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ComponentPropsWithRef } from "react";
|
|
2
|
+
export interface KbdProps extends ComponentPropsWithRef<"kbd"> {
|
|
2
3
|
/** The key or key combination to display. */
|
|
3
4
|
children: React.ReactNode;
|
|
4
5
|
/** Additional utility classes appended to the root element. */
|
|
5
6
|
className?: string;
|
|
6
7
|
}
|
|
7
|
-
export declare function Kbd({ children, className }: KbdProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function Kbd({ children, className, ref, ...rest }: KbdProps): import("react/jsx-runtime").JSX.Element;
|