@zvk/ui 0.1.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/LICENSE.md +26 -0
- package/README.md +31 -0
- package/dist/components/accordion/accordion.d.ts +43 -0
- package/dist/components/accordion/accordion.js +207 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.js +2 -0
- package/dist/components/alert/alert.d.ts +24 -0
- package/dist/components/alert/alert.js +17 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +1 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +46 -0
- package/dist/components/alert-dialog/alert-dialog.js +112 -0
- package/dist/components/alert-dialog/index.d.ts +2 -0
- package/dist/components/alert-dialog/index.js +2 -0
- package/dist/components/avatar/avatar.d.ts +14 -0
- package/dist/components/avatar/avatar.js +22 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +2 -0
- package/dist/components/badge/badge.d.ts +11 -0
- package/dist/components/badge/badge.js +6 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +24 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +18 -0
- package/dist/components/breadcrumbs/index.d.ts +2 -0
- package/dist/components/breadcrumbs/index.js +1 -0
- package/dist/components/button/button.d.ts +13 -0
- package/dist/components/button/button.js +8 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/card/card.d.ts +31 -0
- package/dist/components/card/card.js +28 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/checkbox/checkbox.d.ts +11 -0
- package/dist/components/checkbox/checkbox.js +30 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +2 -0
- package/dist/components/code-block/code-block.d.ts +10 -0
- package/dist/components/code-block/code-block.js +16 -0
- package/dist/components/code-block/index.d.ts +2 -0
- package/dist/components/code-block/index.js +1 -0
- package/dist/components/collapsible/collapsible.d.ts +23 -0
- package/dist/components/collapsible/collapsible.js +52 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/collapsible/index.js +2 -0
- package/dist/components/combobox/combobox.d.ts +20 -0
- package/dist/components/combobox/combobox.js +121 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/combobox/index.js +2 -0
- package/dist/components/command/command-dialog.d.ts +2 -0
- package/dist/components/command/command-dialog.js +1 -0
- package/dist/components/command/command-filter.d.ts +7 -0
- package/dist/components/command/command-filter.js +14 -0
- package/dist/components/command/command.d.ts +55 -0
- package/dist/components/command/command.js +200 -0
- package/dist/components/command/index.d.ts +2 -0
- package/dist/components/command/index.js +2 -0
- package/dist/components/context-menu/context-menu.d.ts +34 -0
- package/dist/components/context-menu/context-menu.js +154 -0
- package/dist/components/context-menu/index.d.ts +2 -0
- package/dist/components/context-menu/index.js +2 -0
- package/dist/components/conversation/conversation.d.ts +60 -0
- package/dist/components/conversation/conversation.js +49 -0
- package/dist/components/conversation/index.d.ts +2 -0
- package/dist/components/conversation/index.js +1 -0
- package/dist/components/copy-button/copy-button.d.ts +23 -0
- package/dist/components/copy-button/copy-button.js +50 -0
- package/dist/components/copy-button/index.d.ts +2 -0
- package/dist/components/copy-button/index.js +2 -0
- package/dist/components/dialog/dialog.d.ts +62 -0
- package/dist/components/dialog/dialog.js +141 -0
- package/dist/components/dialog/index.d.ts +2 -0
- package/dist/components/dialog/index.js +2 -0
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +43 -0
- package/dist/components/dropdown-menu/dropdown-menu.js +286 -0
- package/dist/components/dropdown-menu/index.d.ts +2 -0
- package/dist/components/dropdown-menu/index.js +2 -0
- package/dist/components/empty-state/empty-state.d.ts +13 -0
- package/dist/components/empty-state/empty-state.js +34 -0
- package/dist/components/empty-state/index.d.ts +2 -0
- package/dist/components/empty-state/index.js +1 -0
- package/dist/components/error-boundary/error-boundary.d.ts +29 -0
- package/dist/components/error-boundary/error-boundary.js +43 -0
- package/dist/components/error-boundary/index.d.ts +2 -0
- package/dist/components/error-boundary/index.js +2 -0
- package/dist/components/field/field.d.ts +23 -0
- package/dist/components/field/field.js +20 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/file-upload-input/file-upload-input.d.ts +13 -0
- package/dist/components/file-upload-input/file-upload-input.js +41 -0
- package/dist/components/file-upload-input/index.d.ts +2 -0
- package/dist/components/file-upload-input/index.js +2 -0
- package/dist/components/form/form.d.ts +30 -0
- package/dist/components/form/form.js +88 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +2 -0
- package/dist/components/icon-button/icon-button.d.ts +10 -0
- package/dist/components/icon-button/icon-button.js +8 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +1 -0
- package/dist/components/index.d.ts +102 -0
- package/dist/components/index.js +51 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/index.js +1 -0
- package/dist/components/input/input.d.ts +11 -0
- package/dist/components/input/input.js +27 -0
- package/dist/components/label/index.d.ts +2 -0
- package/dist/components/label/index.js +1 -0
- package/dist/components/label/label.d.ts +9 -0
- package/dist/components/label/label.js +6 -0
- package/dist/components/menubar/index.d.ts +2 -0
- package/dist/components/menubar/index.js +2 -0
- package/dist/components/menubar/menubar.d.ts +39 -0
- package/dist/components/menubar/menubar.js +214 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/pagination/pagination.d.ts +21 -0
- package/dist/components/pagination/pagination.js +92 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.js +2 -0
- package/dist/components/popover/popover.d.ts +28 -0
- package/dist/components/popover/popover.js +164 -0
- package/dist/components/progress/index.d.ts +2 -0
- package/dist/components/progress/index.js +1 -0
- package/dist/components/progress/progress.d.ts +24 -0
- package/dist/components/progress/progress.js +29 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.js +2 -0
- package/dist/components/radio-group/radio-group.d.ts +42 -0
- package/dist/components/radio-group/radio-group.js +69 -0
- package/dist/components/responsive-container/index.d.ts +2 -0
- package/dist/components/responsive-container/index.js +1 -0
- package/dist/components/responsive-container/responsive-container.d.ts +10 -0
- package/dist/components/responsive-container/responsive-container.js +6 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.js +2 -0
- package/dist/components/scroll-area/scroll-area.d.ts +21 -0
- package/dist/components/scroll-area/scroll-area.js +23 -0
- package/dist/components/sectioned-sidebar-nav/index.d.ts +2 -0
- package/dist/components/sectioned-sidebar-nav/index.js +1 -0
- package/dist/components/sectioned-sidebar-nav/sectioned-sidebar-nav.d.ts +39 -0
- package/dist/components/sectioned-sidebar-nav/sectioned-sidebar-nav.js +37 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +2 -0
- package/dist/components/select/select.d.ts +46 -0
- package/dist/components/select/select.js +239 -0
- package/dist/components/separator/index.d.ts +2 -0
- package/dist/components/separator/index.js +1 -0
- package/dist/components/separator/separator.d.ts +8 -0
- package/dist/components/separator/separator.js +6 -0
- package/dist/components/sheet/index.d.ts +2 -0
- package/dist/components/sheet/index.js +2 -0
- package/dist/components/sheet/sheet.d.ts +49 -0
- package/dist/components/sheet/sheet.js +116 -0
- package/dist/components/sidebar-shell/index.d.ts +2 -0
- package/dist/components/sidebar-shell/index.js +1 -0
- package/dist/components/sidebar-shell/sidebar-shell.d.ts +35 -0
- package/dist/components/sidebar-shell/sidebar-shell.js +28 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/skeleton/skeleton.d.ts +10 -0
- package/dist/components/skeleton/skeleton.js +16 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +2 -0
- package/dist/components/slider/slider.d.ts +12 -0
- package/dist/components/slider/slider.js +30 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/index.js +1 -0
- package/dist/components/spinner/spinner.d.ts +10 -0
- package/dist/components/spinner/spinner.js +7 -0
- package/dist/components/stat/index.d.ts +2 -0
- package/dist/components/stat/index.js +1 -0
- package/dist/components/stat/stat.d.ts +13 -0
- package/dist/components/stat/stat.js +8 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +2 -0
- package/dist/components/switch/switch.d.ts +11 -0
- package/dist/components/switch/switch.js +27 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/table/table.d.ts +45 -0
- package/dist/components/table/table.js +36 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/index.js +2 -0
- package/dist/components/tabs/tabs.d.ts +34 -0
- package/dist/components/tabs/tabs.js +233 -0
- package/dist/components/tabs-with-sidebar/index.d.ts +2 -0
- package/dist/components/tabs-with-sidebar/index.js +2 -0
- package/dist/components/tabs-with-sidebar/tabs-with-sidebar.d.ts +21 -0
- package/dist/components/tabs-with-sidebar/tabs-with-sidebar.js +18 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/index.js +2 -0
- package/dist/components/textarea/textarea.d.ts +11 -0
- package/dist/components/textarea/textarea.js +28 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/toast/toast.d.ts +33 -0
- package/dist/components/toast/toast.js +27 -0
- package/dist/components/toggle/index.d.ts +2 -0
- package/dist/components/toggle/index.js +2 -0
- package/dist/components/toggle/toggle.d.ts +12 -0
- package/dist/components/toggle/toggle.js +18 -0
- package/dist/components/toggle-group/index.d.ts +2 -0
- package/dist/components/toggle-group/index.js +2 -0
- package/dist/components/toggle-group/toggle-group.d.ts +28 -0
- package/dist/components/toggle-group/toggle-group.js +67 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +2 -0
- package/dist/components/tooltip/tooltip.d.ts +10 -0
- package/dist/components/tooltip/tooltip.js +100 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +5 -0
- package/dist/hooks/use-composed-refs.d.ts +3 -0
- package/dist/hooks/use-composed-refs.js +18 -0
- package/dist/hooks/use-controllable-state.d.ts +7 -0
- package/dist/hooks/use-controllable-state.js +30 -0
- package/dist/hooks/use-disclosure.d.ts +13 -0
- package/dist/hooks/use-disclosure.js +20 -0
- package/dist/hooks/use-event.d.ts +1 -0
- package/dist/hooks/use-event.js +11 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/internal/collection/collection.d.ts +18 -0
- package/dist/internal/collection/collection.js +54 -0
- package/dist/internal/collection/index.d.ts +2 -0
- package/dist/internal/collection/index.js +1 -0
- package/dist/internal/dismissable-layer/dismissable-layer.d.ts +13 -0
- package/dist/internal/dismissable-layer/dismissable-layer.js +73 -0
- package/dist/internal/dismissable-layer/index.d.ts +2 -0
- package/dist/internal/dismissable-layer/index.js +1 -0
- package/dist/internal/floating/auto-update.d.ts +9 -0
- package/dist/internal/floating/auto-update.js +48 -0
- package/dist/internal/floating/compute-position.d.ts +2 -0
- package/dist/internal/floating/compute-position.js +96 -0
- package/dist/internal/floating/detect-overflow.d.ts +13 -0
- package/dist/internal/floating/detect-overflow.js +13 -0
- package/dist/internal/floating/floating-types.d.ts +42 -0
- package/dist/internal/floating/floating-types.js +1 -0
- package/dist/internal/floating/index.d.ts +27 -0
- package/dist/internal/floating/index.js +5 -0
- package/dist/internal/floating/middleware.d.ts +11 -0
- package/dist/internal/floating/middleware.js +42 -0
- package/dist/internal/floating/use-floating-position.d.ts +2 -0
- package/dist/internal/floating/use-floating-position.js +113 -0
- package/dist/internal/focus/focus-scope.d.ts +10 -0
- package/dist/internal/focus/focus-scope.js +68 -0
- package/dist/internal/focus/focus-utils.d.ts +9 -0
- package/dist/internal/focus/focus-utils.js +94 -0
- package/dist/internal/focus/index.d.ts +3 -0
- package/dist/internal/focus/index.js +2 -0
- package/dist/internal/overlay-stack/index.d.ts +1 -0
- package/dist/internal/overlay-stack/index.js +1 -0
- package/dist/internal/overlay-stack/overlay-stack.d.ts +12 -0
- package/dist/internal/overlay-stack/overlay-stack.js +41 -0
- package/dist/internal/portal/index.d.ts +2 -0
- package/dist/internal/portal/index.js +1 -0
- package/dist/internal/portal/portal.d.ts +7 -0
- package/dist/internal/portal/portal.js +19 -0
- package/dist/internal/scroll-lock/index.d.ts +1 -0
- package/dist/internal/scroll-lock/index.js +1 -0
- package/dist/internal/scroll-lock/scroll-lock.d.ts +4 -0
- package/dist/internal/scroll-lock/scroll-lock.js +69 -0
- package/dist/styles.css +3852 -0
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/index.js +1 -0
- package/dist/tokens/token-types.d.ts +23 -0
- package/dist/tokens/token-types.js +1 -0
- package/dist/tokens/tokens.d.ts +139 -0
- package/dist/tokens/tokens.js +139 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +3 -0
- package/dist/utils/compose-event-handlers.d.ts +6 -0
- package/dist/utils/compose-event-handlers.js +8 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +2 -0
- package/package.json +282 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { composeEventHandlers } from "../../utils/compose-event-handlers.js";
|
|
5
|
+
import { cn } from "../../utils/cn.js";
|
|
6
|
+
import { useControllableState } from "../../hooks/use-controllable-state.js";
|
|
7
|
+
import { DismissableLayer } from "../../internal/dismissable-layer/index.js";
|
|
8
|
+
import { FocusScope } from "../../internal/focus/index.js";
|
|
9
|
+
import { Portal } from "../../internal/portal/index.js";
|
|
10
|
+
import { lockScroll, unlockScroll } from "../../internal/scroll-lock/index.js";
|
|
11
|
+
const SheetContext = React.createContext(null);
|
|
12
|
+
function useSheetContext(calledBy) {
|
|
13
|
+
const context = React.useContext(SheetContext);
|
|
14
|
+
if (context === null) {
|
|
15
|
+
throw new Error(`"${calledBy}" must be used inside a <Sheet />`);
|
|
16
|
+
}
|
|
17
|
+
return context;
|
|
18
|
+
}
|
|
19
|
+
function composeRefs(...refs) {
|
|
20
|
+
return (node) => {
|
|
21
|
+
for (const ref of refs) {
|
|
22
|
+
if (typeof ref === "function") {
|
|
23
|
+
ref(node);
|
|
24
|
+
}
|
|
25
|
+
else if (ref && "current" in ref) {
|
|
26
|
+
ref.current = node;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function SheetRoot({ children, className, defaultOpen = false, onOpenChange, open: openProp, ref, side = "right", ...props }) {
|
|
32
|
+
const [open, setOpen] = useControllableState({
|
|
33
|
+
...(openProp !== undefined ? { value: openProp } : {}),
|
|
34
|
+
defaultValue: defaultOpen,
|
|
35
|
+
...(onOpenChange ? { onChange: onOpenChange } : {})
|
|
36
|
+
});
|
|
37
|
+
const instanceId = React.useId();
|
|
38
|
+
const triggerRef = React.useRef(null);
|
|
39
|
+
const [labelledBy, setLabelledBy] = React.useState();
|
|
40
|
+
const [describedBy, setDescribedBy] = React.useState();
|
|
41
|
+
const registerTitle = React.useCallback((id) => {
|
|
42
|
+
setLabelledBy(id);
|
|
43
|
+
return () => setLabelledBy((current) => (current === id ? undefined : current));
|
|
44
|
+
}, []);
|
|
45
|
+
const registerDescription = React.useCallback((id) => {
|
|
46
|
+
setDescribedBy(id);
|
|
47
|
+
return () => setDescribedBy((current) => (current === id ? undefined : current));
|
|
48
|
+
}, []);
|
|
49
|
+
React.useLayoutEffect(() => {
|
|
50
|
+
if (!open) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
lockScroll();
|
|
54
|
+
return () => unlockScroll();
|
|
55
|
+
}, [open]);
|
|
56
|
+
return (_jsx(SheetContext.Provider, { value: {
|
|
57
|
+
close: () => setOpen(false),
|
|
58
|
+
contentId: `${instanceId}-content`,
|
|
59
|
+
descriptionId: `${instanceId}-description`,
|
|
60
|
+
describedBy,
|
|
61
|
+
labelledBy,
|
|
62
|
+
open,
|
|
63
|
+
registerDescription,
|
|
64
|
+
registerTitle,
|
|
65
|
+
setOpen,
|
|
66
|
+
side,
|
|
67
|
+
titleId: `${instanceId}-title`,
|
|
68
|
+
triggerRef
|
|
69
|
+
}, children: _jsx("div", { ...props, ref: ref, className: cn("liano-sheet", className), "data-state": open ? "open" : "closed", children: children }) }));
|
|
70
|
+
}
|
|
71
|
+
function SheetTrigger({ className, disabled, onClick, ref, type = "button", ...props }) {
|
|
72
|
+
const { contentId, open, setOpen, triggerRef } = useSheetContext("Sheet.Trigger");
|
|
73
|
+
return (_jsx("button", { ...props, ref: composeRefs(ref, triggerRef), type: type, disabled: disabled, "aria-controls": contentId, "aria-expanded": open ? "true" : "false", className: cn("liano-sheet__trigger", className), "data-state": open ? "open" : "closed", onClick: composeEventHandlers(onClick, () => {
|
|
74
|
+
if (!disabled) {
|
|
75
|
+
setOpen(true);
|
|
76
|
+
}
|
|
77
|
+
}) }));
|
|
78
|
+
}
|
|
79
|
+
function SheetContent({ children, className, ref, ...props }) {
|
|
80
|
+
const { close, contentId, describedBy, labelledBy, open, side } = useSheetContext("Sheet.Content");
|
|
81
|
+
if (!open) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
return (_jsxs(Portal, { children: [_jsx("div", { "aria-hidden": "true", className: "liano-sheet__overlay" }), _jsx(DismissableLayer, { open: open, onDismiss: close, children: _jsx(FocusScope, { active: open, trapped: true, children: _jsx("div", { ...props, ref: ref, id: contentId, role: "dialog", "aria-modal": "true", "aria-describedby": describedBy, "aria-labelledby": labelledBy, className: cn("liano-sheet__content", className), "data-side": side, "data-state": open ? "open" : "closed", children: children }) }) })] }));
|
|
85
|
+
}
|
|
86
|
+
function SheetHeader({ className, ref, ...props }) {
|
|
87
|
+
return _jsx("div", { ...props, ref: ref, className: cn("liano-sheet__header", className) });
|
|
88
|
+
}
|
|
89
|
+
function SheetTitle({ className, ref, ...props }) {
|
|
90
|
+
const { registerTitle, titleId } = useSheetContext("Sheet.Title");
|
|
91
|
+
const id = props.id ?? titleId;
|
|
92
|
+
React.useLayoutEffect(() => registerTitle(id), [id, registerTitle]);
|
|
93
|
+
return _jsx("h2", { ...props, ref: ref, id: id, className: cn("liano-sheet__title", className) });
|
|
94
|
+
}
|
|
95
|
+
function SheetDescription({ className, ref, ...props }) {
|
|
96
|
+
const { descriptionId, registerDescription } = useSheetContext("Sheet.Description");
|
|
97
|
+
const id = props.id ?? descriptionId;
|
|
98
|
+
React.useLayoutEffect(() => registerDescription(id), [id, registerDescription]);
|
|
99
|
+
return _jsx("p", { ...props, ref: ref, id: id, className: cn("liano-sheet__description", className) });
|
|
100
|
+
}
|
|
101
|
+
function SheetFooter({ className, ref, ...props }) {
|
|
102
|
+
return _jsx("div", { ...props, ref: ref, className: cn("liano-sheet__footer", className) });
|
|
103
|
+
}
|
|
104
|
+
function SheetClose({ className, onClick, ref, type = "button", ...props }) {
|
|
105
|
+
const { close } = useSheetContext("Sheet.Close");
|
|
106
|
+
return (_jsx("button", { ...props, ref: ref, type: type, className: cn("liano-sheet__close", className), onClick: composeEventHandlers(onClick, close) }));
|
|
107
|
+
}
|
|
108
|
+
export const Sheet = Object.assign(SheetRoot, {
|
|
109
|
+
Close: SheetClose,
|
|
110
|
+
Content: SheetContent,
|
|
111
|
+
Description: SheetDescription,
|
|
112
|
+
Footer: SheetFooter,
|
|
113
|
+
Header: SheetHeader,
|
|
114
|
+
Title: SheetTitle,
|
|
115
|
+
Trigger: SheetTrigger
|
|
116
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SidebarShell } from "./sidebar-shell.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SidebarShellSide = "left" | "right";
|
|
3
|
+
export type SidebarShellWidth = "sm" | "md" | "lg";
|
|
4
|
+
export interface SidebarShellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
side?: SidebarShellSide;
|
|
6
|
+
width?: SidebarShellWidth;
|
|
7
|
+
collapsed?: boolean;
|
|
8
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
9
|
+
}
|
|
10
|
+
export interface SidebarShellSidebarProps extends React.HTMLAttributes<HTMLElement> {
|
|
11
|
+
ref?: React.Ref<HTMLElement>;
|
|
12
|
+
}
|
|
13
|
+
export interface SidebarShellMainProps extends React.HTMLAttributes<HTMLElement> {
|
|
14
|
+
ref?: React.Ref<HTMLElement>;
|
|
15
|
+
}
|
|
16
|
+
export interface SidebarShellSlotProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
17
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
18
|
+
}
|
|
19
|
+
export interface SidebarShellLandmarkSlotProps extends React.HTMLAttributes<HTMLElement> {
|
|
20
|
+
ref?: React.Ref<HTMLElement>;
|
|
21
|
+
}
|
|
22
|
+
declare function SidebarShellRoot({ className, collapsed, ref, side, width, ...props }: SidebarShellProps): React.JSX.Element;
|
|
23
|
+
declare function SidebarShellSidebar({ className, ref, ...props }: SidebarShellSidebarProps): React.JSX.Element;
|
|
24
|
+
declare function SidebarShellHeader({ className, ref, ...props }: SidebarShellLandmarkSlotProps): React.JSX.Element;
|
|
25
|
+
declare function SidebarShellMain({ className, ref, ...props }: SidebarShellMainProps): React.JSX.Element;
|
|
26
|
+
declare function SidebarShellContent({ className, ref, ...props }: SidebarShellSlotProps): React.JSX.Element;
|
|
27
|
+
declare function SidebarShellFooter({ className, ref, ...props }: SidebarShellLandmarkSlotProps): React.JSX.Element;
|
|
28
|
+
export declare const SidebarShell: typeof SidebarShellRoot & {
|
|
29
|
+
Sidebar: typeof SidebarShellSidebar;
|
|
30
|
+
Header: typeof SidebarShellHeader;
|
|
31
|
+
Main: typeof SidebarShellMain;
|
|
32
|
+
Content: typeof SidebarShellContent;
|
|
33
|
+
Footer: typeof SidebarShellFooter;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
function SidebarShellRoot({ className, collapsed = false, ref, side = "left", width = "md", ...props }) {
|
|
5
|
+
return (_jsx("div", { ...props, ref: ref, className: cn("liano-sidebar-shell", className), "data-collapsed": collapsed ? "true" : "false", "data-side": side, "data-width": width }));
|
|
6
|
+
}
|
|
7
|
+
function SidebarShellSidebar({ className, ref, ...props }) {
|
|
8
|
+
return _jsx("aside", { ...props, ref: ref, className: cn("liano-sidebar-shell__sidebar", className) });
|
|
9
|
+
}
|
|
10
|
+
function SidebarShellHeader({ className, ref, ...props }) {
|
|
11
|
+
return _jsx("header", { ...props, ref: ref, className: cn("liano-sidebar-shell__header", className) });
|
|
12
|
+
}
|
|
13
|
+
function SidebarShellMain({ className, ref, ...props }) {
|
|
14
|
+
return _jsx("main", { ...props, ref: ref, className: cn("liano-sidebar-shell__main", className) });
|
|
15
|
+
}
|
|
16
|
+
function SidebarShellContent({ className, ref, ...props }) {
|
|
17
|
+
return _jsx("div", { ...props, ref: ref, className: cn("liano-sidebar-shell__content", className) });
|
|
18
|
+
}
|
|
19
|
+
function SidebarShellFooter({ className, ref, ...props }) {
|
|
20
|
+
return _jsx("footer", { ...props, ref: ref, className: cn("liano-sidebar-shell__footer", className) });
|
|
21
|
+
}
|
|
22
|
+
export const SidebarShell = Object.assign(SidebarShellRoot, {
|
|
23
|
+
Sidebar: SidebarShellSidebar,
|
|
24
|
+
Header: SidebarShellHeader,
|
|
25
|
+
Main: SidebarShellMain,
|
|
26
|
+
Content: SidebarShellContent,
|
|
27
|
+
Footer: SidebarShellFooter
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Skeleton } from "./skeleton.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SkeletonRounded = "sm" | "md" | "lg" | "full";
|
|
3
|
+
export interface SkeletonProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
width?: string | number;
|
|
5
|
+
height?: string | number;
|
|
6
|
+
rounded?: SkeletonRounded;
|
|
7
|
+
animate?: boolean;
|
|
8
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
9
|
+
}
|
|
10
|
+
export declare function Skeleton({ animate, className, height, ref, rounded, style, width, ...props }: SkeletonProps): React.JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
function toCssSize(value) {
|
|
5
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
6
|
+
}
|
|
7
|
+
export function Skeleton({ animate = true, className, height, ref, rounded = "md", style, width, ...props }) {
|
|
8
|
+
const dimensionStyle = {};
|
|
9
|
+
if (width !== undefined) {
|
|
10
|
+
dimensionStyle.width = toCssSize(width);
|
|
11
|
+
}
|
|
12
|
+
if (height !== undefined) {
|
|
13
|
+
dimensionStyle.height = toCssSize(height);
|
|
14
|
+
}
|
|
15
|
+
return (_jsx("span", { ...props, ref: ref, "aria-hidden": props["aria-hidden"] ?? true, className: cn("liano-skeleton", className), "data-animate": animate ? "true" : "false", "data-rounded": rounded, style: { ...dimensionStyle, ...style } }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SliderSize = "sm" | "md" | "lg";
|
|
3
|
+
export interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "onChange"> {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
error?: React.ReactNode;
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
size?: SliderSize;
|
|
9
|
+
onValueChange?: (value: number, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
11
|
+
}
|
|
12
|
+
export declare function Slider({ "aria-describedby": ariaDescribedBy, className, description, disabled, error, id, invalid, label, onValueChange, ref, required, size, ...props }: SliderProps): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Field } from "../field/field.js";
|
|
5
|
+
import { cn } from "../../utils/cn.js";
|
|
6
|
+
function hasRenderableNode(value) {
|
|
7
|
+
return value !== undefined && value !== null && value !== false;
|
|
8
|
+
}
|
|
9
|
+
function joinIds(...ids) {
|
|
10
|
+
const value = ids.filter(Boolean).join(" ");
|
|
11
|
+
return value.length > 0 ? value : undefined;
|
|
12
|
+
}
|
|
13
|
+
export function Slider({ "aria-describedby": ariaDescribedBy, className, description, disabled, error, id, invalid, label, onValueChange, ref, required, size = "md", ...props }) {
|
|
14
|
+
const generatedId = React.useId();
|
|
15
|
+
const hasLabel = hasRenderableNode(label);
|
|
16
|
+
const hasDescription = hasRenderableNode(description);
|
|
17
|
+
const hasError = hasRenderableNode(error);
|
|
18
|
+
const sliderId = id ?? (hasLabel || hasDescription || hasError ? generatedId : undefined);
|
|
19
|
+
const invalidState = invalid || hasError;
|
|
20
|
+
const descriptionId = hasDescription ? `${sliderId}-description` : undefined;
|
|
21
|
+
const errorId = hasError ? `${sliderId}-error` : undefined;
|
|
22
|
+
const describedBy = joinIds(ariaDescribedBy, descriptionId, errorId);
|
|
23
|
+
const slider = (_jsx("input", { ...props, ref: ref, "aria-describedby": describedBy, "aria-invalid": invalidState ? true : undefined, className: cn("liano-slider", className), "data-disabled": disabled ? "true" : undefined, "data-invalid": invalidState ? "true" : undefined, "data-required": required ? "true" : undefined, "data-size": size, disabled: disabled, id: sliderId, onChange: (event) => {
|
|
24
|
+
onValueChange?.(event.currentTarget.valueAsNumber, event);
|
|
25
|
+
}, required: required, type: "range" }));
|
|
26
|
+
if (!hasLabel && !hasDescription && !hasError) {
|
|
27
|
+
return slider;
|
|
28
|
+
}
|
|
29
|
+
return (_jsxs(Field, { disabled: Boolean(disabled), invalid: invalidState, required: Boolean(required), children: [hasLabel ? _jsx(Field.Label, { htmlFor: sliderId, children: label }) : null, slider, hasDescription ? _jsx(Field.Description, { id: descriptionId, children: description }) : null, hasError ? _jsx(Field.Error, { id: errorId, children: error }) : null] }));
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Spinner } from "./spinner.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SpinnerSize = "sm" | "md" | "lg";
|
|
3
|
+
export type SpinnerTone = "primary" | "muted";
|
|
4
|
+
export interface SpinnerProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
size?: SpinnerSize;
|
|
6
|
+
tone?: SpinnerTone;
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
9
|
+
}
|
|
10
|
+
export declare function Spinner({ className, label, ref, size, tone, ...props }: SpinnerProps): React.JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
export function Spinner({ className, label, ref, size = "md", tone = "primary", ...props }) {
|
|
5
|
+
const hasLabel = label !== undefined && label !== null && label !== false;
|
|
6
|
+
return (_jsx("span", { ...props, ref: ref, "aria-hidden": hasLabel ? undefined : true, "aria-live": hasLabel ? "polite" : undefined, className: cn("liano-spinner", className), "data-size": size, "data-tone": tone, role: hasLabel ? "status" : undefined, children: hasLabel ? _jsx("span", { className: "liano-sr-only", children: label }) : null }));
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Stat } from "./stat.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type StatTone = "neutral" | "success" | "warning" | "destructive" | "info";
|
|
3
|
+
export type StatSize = "sm" | "md" | "lg";
|
|
4
|
+
export interface StatProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
value: React.ReactNode;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
trend?: React.ReactNode;
|
|
9
|
+
tone?: StatTone;
|
|
10
|
+
size?: StatSize;
|
|
11
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
12
|
+
}
|
|
13
|
+
export declare function Stat({ className, description, label, ref, size, tone, trend, value, ...props }: StatProps): React.JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
export function Stat({ className, description, label, ref, size = "md", tone = "neutral", trend, value, ...props }) {
|
|
5
|
+
const showDescription = description !== undefined && description !== null && description !== false;
|
|
6
|
+
const showTrend = trend !== undefined && trend !== null && trend !== false;
|
|
7
|
+
return (_jsxs("div", { ...props, ref: ref, className: cn("liano-stat", className), "data-size": size, "data-tone": tone, children: [_jsx("p", { className: "liano-stat__label", children: label }), _jsx("div", { className: "liano-stat__value", children: value }), showDescription ? _jsx("p", { className: "liano-stat__description", children: description }) : null, showTrend ? _jsx("div", { className: "liano-stat__trend", children: trend }) : null] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SwitchSize = "sm" | "md" | "lg";
|
|
3
|
+
export interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type" | "role"> {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
error?: React.ReactNode;
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
size?: SwitchSize;
|
|
9
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
10
|
+
}
|
|
11
|
+
export declare function Switch({ "aria-describedby": ariaDescribedBy, className, description, disabled, error, id, invalid, label, ref, required, size, ...props }: SwitchProps): React.JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Field } from "../field/field.js";
|
|
5
|
+
import { cn } from "../../utils/cn.js";
|
|
6
|
+
function hasRenderableNode(value) {
|
|
7
|
+
return value !== undefined && value !== null && value !== false;
|
|
8
|
+
}
|
|
9
|
+
function joinIds(...ids) {
|
|
10
|
+
const value = ids.filter(Boolean).join(" ");
|
|
11
|
+
return value.length > 0 ? value : undefined;
|
|
12
|
+
}
|
|
13
|
+
export function Switch({ "aria-describedby": ariaDescribedBy, className, description, disabled, error, id, invalid, label, ref, required, size = "md", ...props }) {
|
|
14
|
+
const generatedId = React.useId();
|
|
15
|
+
const hasLabel = hasRenderableNode(label);
|
|
16
|
+
const hasDescription = hasRenderableNode(description);
|
|
17
|
+
const hasError = hasRenderableNode(error);
|
|
18
|
+
const shouldUseWrapperId = hasLabel || hasDescription || hasError;
|
|
19
|
+
const switchId = id ?? (shouldUseWrapperId ? generatedId : undefined);
|
|
20
|
+
const invalidState = invalid || Boolean(hasError);
|
|
21
|
+
const descriptionId = hasDescription ? `${switchId}-description` : undefined;
|
|
22
|
+
const errorId = hasError ? `${switchId}-error` : undefined;
|
|
23
|
+
const describedBy = joinIds(ariaDescribedBy, descriptionId, errorId);
|
|
24
|
+
const input = (_jsx("input", { ...props, ref: ref, "aria-describedby": describedBy, "aria-invalid": invalidState ? true : undefined, className: "liano-switch__input", "data-disabled": disabled ? "true" : undefined, "data-invalid": invalidState ? "true" : undefined, "data-required": required ? "true" : undefined, disabled: disabled, id: switchId, required: required, role: "switch", type: "checkbox" }));
|
|
25
|
+
const content = (_jsxs(_Fragment, { children: [input, _jsx("span", { className: "liano-switch__track", "aria-hidden": "true", children: _jsx("span", { className: "liano-switch__thumb" }) }), hasLabel ? _jsx("span", { className: "liano-switch__label", children: label }) : null] }));
|
|
26
|
+
return (_jsxs(Field, { disabled: Boolean(disabled), invalid: invalidState, required: Boolean(required), children: [_jsx("label", { className: cn("liano-switch", className), "data-size": size, "data-disabled": disabled ? "true" : undefined, "data-invalid": invalidState ? "true" : undefined, "data-required": required ? "true" : undefined, children: content }), hasDescription ? _jsx(Field.Description, { id: descriptionId, children: description }) : null, hasError ? _jsx(Field.Error, { id: errorId, children: error }) : null] }));
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Table } from "./table.js";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {
|
|
3
|
+
density?: "compact" | "default" | "comfortable";
|
|
4
|
+
variant?: "plain" | "surface";
|
|
5
|
+
ref?: React.Ref<HTMLTableElement>;
|
|
6
|
+
}
|
|
7
|
+
export interface TableCaptionProps extends React.HTMLAttributes<HTMLTableCaptionElement> {
|
|
8
|
+
ref?: React.Ref<HTMLTableCaptionElement>;
|
|
9
|
+
}
|
|
10
|
+
export interface TableHeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
11
|
+
ref?: React.Ref<HTMLTableSectionElement>;
|
|
12
|
+
}
|
|
13
|
+
export interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
14
|
+
ref?: React.Ref<HTMLTableSectionElement>;
|
|
15
|
+
}
|
|
16
|
+
export interface TableFooterProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
17
|
+
ref?: React.Ref<HTMLTableSectionElement>;
|
|
18
|
+
}
|
|
19
|
+
export interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
20
|
+
ref?: React.Ref<HTMLTableRowElement>;
|
|
21
|
+
}
|
|
22
|
+
export interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableHeaderCellElement> {
|
|
23
|
+
ref?: React.Ref<HTMLTableHeaderCellElement>;
|
|
24
|
+
}
|
|
25
|
+
export interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
|
|
26
|
+
ref?: React.Ref<HTMLTableCellElement>;
|
|
27
|
+
}
|
|
28
|
+
declare function TableRoot({ className, density, ref, variant, ...props }: TableProps): React.JSX.Element;
|
|
29
|
+
declare function TableCaption({ className, ref, ...props }: TableCaptionProps): React.JSX.Element;
|
|
30
|
+
declare function TableHeader({ className, ref, ...props }: TableHeaderProps): React.JSX.Element;
|
|
31
|
+
declare function TableBody({ className, ref, ...props }: TableBodyProps): React.JSX.Element;
|
|
32
|
+
declare function TableFooter({ className, ref, ...props }: TableFooterProps): React.JSX.Element;
|
|
33
|
+
declare function TableRow({ className, ref, ...props }: TableRowProps): React.JSX.Element;
|
|
34
|
+
declare function TableHead({ className, ref, scope, ...props }: TableHeadProps): React.JSX.Element;
|
|
35
|
+
declare function TableCell({ className, ref, ...props }: TableCellProps): React.JSX.Element;
|
|
36
|
+
export declare const Table: typeof TableRoot & {
|
|
37
|
+
Caption: typeof TableCaption;
|
|
38
|
+
Header: typeof TableHeader;
|
|
39
|
+
Body: typeof TableBody;
|
|
40
|
+
Footer: typeof TableFooter;
|
|
41
|
+
Row: typeof TableRow;
|
|
42
|
+
Head: typeof TableHead;
|
|
43
|
+
Cell: typeof TableCell;
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../utils/cn.js";
|
|
4
|
+
function TableRoot({ className, density = "default", ref, variant = "plain", ...props }) {
|
|
5
|
+
return (_jsx("table", { ...props, ref: ref, className: cn("liano-table", className), "data-density": density, "data-variant": variant }));
|
|
6
|
+
}
|
|
7
|
+
function TableCaption({ className, ref, ...props }) {
|
|
8
|
+
return _jsx("caption", { ...props, ref: ref, className: cn("liano-table__caption", className) });
|
|
9
|
+
}
|
|
10
|
+
function TableHeader({ className, ref, ...props }) {
|
|
11
|
+
return _jsx("thead", { ...props, ref: ref, className: cn("liano-table__header", className) });
|
|
12
|
+
}
|
|
13
|
+
function TableBody({ className, ref, ...props }) {
|
|
14
|
+
return _jsx("tbody", { ...props, ref: ref, className: cn("liano-table__body", className) });
|
|
15
|
+
}
|
|
16
|
+
function TableFooter({ className, ref, ...props }) {
|
|
17
|
+
return _jsx("tfoot", { ...props, ref: ref, className: cn("liano-table__footer", className) });
|
|
18
|
+
}
|
|
19
|
+
function TableRow({ className, ref, ...props }) {
|
|
20
|
+
return _jsx("tr", { ...props, ref: ref, className: cn("liano-table__row", className) });
|
|
21
|
+
}
|
|
22
|
+
function TableHead({ className, ref, scope = "col", ...props }) {
|
|
23
|
+
return _jsx("th", { ...props, ref: ref, scope: scope, className: cn("liano-table__head", className) });
|
|
24
|
+
}
|
|
25
|
+
function TableCell({ className, ref, ...props }) {
|
|
26
|
+
return _jsx("td", { ...props, ref: ref, className: cn("liano-table__cell", className) });
|
|
27
|
+
}
|
|
28
|
+
export const Table = Object.assign(TableRoot, {
|
|
29
|
+
Caption: TableCaption,
|
|
30
|
+
Header: TableHeader,
|
|
31
|
+
Body: TableBody,
|
|
32
|
+
Footer: TableFooter,
|
|
33
|
+
Row: TableRow,
|
|
34
|
+
Head: TableHead,
|
|
35
|
+
Cell: TableCell
|
|
36
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type TabsOrientation = "horizontal" | "vertical";
|
|
3
|
+
export type TabsActivationMode = "automatic" | "manual";
|
|
4
|
+
export interface TabsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
value?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onValueChange?: (value: string) => void;
|
|
8
|
+
orientation?: TabsOrientation;
|
|
9
|
+
activationMode?: TabsActivationMode;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
12
|
+
}
|
|
13
|
+
export interface TabsListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
15
|
+
}
|
|
16
|
+
export interface TabsTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
17
|
+
value: string;
|
|
18
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
19
|
+
}
|
|
20
|
+
export interface TabsContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
value: string;
|
|
22
|
+
forceMount?: boolean;
|
|
23
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
24
|
+
}
|
|
25
|
+
declare function TabsRoot({ children, className, defaultValue, disabled, ref, activationMode, onValueChange, orientation, value, ...props }: TabsProps): React.JSX.Element;
|
|
26
|
+
declare function TabsList({ className, ref, ...props }: TabsListProps): React.JSX.Element;
|
|
27
|
+
declare function TabsTrigger({ className, onClick, onKeyDown, ref, value, ...props }: TabsTriggerProps): React.JSX.Element;
|
|
28
|
+
declare function TabsContent({ className, forceMount, ref, value, ...props }: TabsContentProps): React.JSX.Element | null;
|
|
29
|
+
export declare const Tabs: typeof TabsRoot & {
|
|
30
|
+
List: typeof TabsList;
|
|
31
|
+
Trigger: typeof TabsTrigger;
|
|
32
|
+
Content: typeof TabsContent;
|
|
33
|
+
};
|
|
34
|
+
export {};
|