@xingxingmofashu/ui 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/dist/components/accordion.d.ts +1 -1
- package/dist/components/radio-group.d.ts +35 -0
- package/dist/components/radio-group.mjs +156 -0
- package/dist/components/tabs.d.ts +46 -0
- package/dist/components/tabs.mjs +136 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +4 -0
- package/dist/theme/accordion.d.ts +1 -63
- package/dist/theme/alert-dialog.d.ts +2 -69
- package/dist/theme/button.d.ts +1 -73
- package/dist/theme/card.d.ts +2 -64
- package/dist/theme/checkbox.d.ts +1 -69
- package/dist/theme/dialog.d.ts +2 -69
- package/dist/theme/drawer.d.ts +1 -65
- package/dist/theme/input.d.ts +1 -87
- package/dist/theme/popover.d.ts +2 -69
- package/dist/theme/progress.d.ts +1 -53
- package/dist/theme/radio-group.d.ts +40 -0
- package/dist/theme/radio-group.mjs +106 -0
- package/dist/theme/scroll-area.d.ts +2 -59
- package/dist/theme/slider.d.ts +2 -44
- package/dist/theme/switch.d.ts +1 -63
- package/dist/theme/tabs.d.ts +32 -0
- package/dist/theme/tabs.mjs +80 -0
- package/dist/theme/toast.d.ts +1 -57
- package/dist/theme/toggle-group.d.ts +1 -53
- package/dist/theme/toggle.d.ts +1 -63
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -20,9 +20,9 @@ components with a Liquid Glass visual style, built with
|
|
|
20
20
|
[Tailwind Variants](https://www.tailwind-variants.org). Glass surfaces, rim
|
|
21
21
|
highlights, and inner shadows are drawn entirely with CSS.
|
|
22
22
|
|
|
23
|
-
The package ships
|
|
24
|
-
Checkbox, Dialog, Drawer, Input, Popover, Progress,
|
|
25
|
-
Toast, Toggle, and Toggle Group.
|
|
23
|
+
The package ships eighteen components: Accordion, Alert Dialog, Button, Card,
|
|
24
|
+
Checkbox, Dialog, Drawer, Input, Popover, Progress, Radio Group, Scroll Area,
|
|
25
|
+
Slider, Switch, Tabs, Toast, Toggle, and Toggle Group.
|
|
26
26
|
|
|
27
27
|
> [!NOTE]
|
|
28
28
|
> Requires React 19, React DOM 19, Tailwind CSS 4, Node.js 22+, and an
|
|
@@ -101,6 +101,8 @@ pnpm install
|
|
|
101
101
|
pnpm build # build dist with unbuild
|
|
102
102
|
pnpm lint # lint with oxlint
|
|
103
103
|
pnpm test # run the Vitest suite
|
|
104
|
+
pnpm test:visual # run the Playwright visual regression suite
|
|
105
|
+
pnpm test:visual:update # refresh the Surface Lab screenshots
|
|
104
106
|
pnpm typecheck # typecheck the package
|
|
105
107
|
pnpm docs:dev # docs site on http://localhost:3001
|
|
106
108
|
pnpm playground:dev # component playground on http://localhost:3002
|
|
@@ -5,7 +5,7 @@ import { type ComponentConfig } from "../internal/tv";
|
|
|
5
5
|
import theme from "../theme/accordion";
|
|
6
6
|
type Accordion = ComponentConfig<typeof theme>;
|
|
7
7
|
/** One panel managed by the accordion. */
|
|
8
|
-
type AccordionItemProps<Value extends string = string> = Omit<UIAccordion.Item.Props, "children" | "className" | "style" | "title" | "value"> & {
|
|
8
|
+
type AccordionItemProps<Value extends string = string> = Omit<UIAccordion.Item.Props, "children" | "className" | "content" | "style" | "title" | "value"> & {
|
|
9
9
|
/** Value that identifies the item in the accordion value. */
|
|
10
10
|
value: Value;
|
|
11
11
|
/** Visible heading inside the trigger. */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Radio as UIRadio } from "@base-ui/react/radio";
|
|
2
|
+
import { RadioGroup as UIRadioGroup } from "@base-ui/react/radio-group";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { type VariantProps } from "tailwind-variants";
|
|
5
|
+
import { type ComponentConfig } from "../internal/tv";
|
|
6
|
+
import theme from "../theme/radio-group";
|
|
7
|
+
type RadioGroup = ComponentConfig<typeof theme>;
|
|
8
|
+
/** One option managed by the radio group. */
|
|
9
|
+
type RadioGroupItemProps<Value extends string = string> = Omit<UIRadio.Root.Props<Value>, "className" | "children" | "style" | "value"> & {
|
|
10
|
+
/** Value that identifies the option in the group value. */
|
|
11
|
+
value: Value;
|
|
12
|
+
/** Visible label rendered next to the control. */
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
/** Supporting text rendered under the label. */
|
|
15
|
+
description?: React.ReactNode;
|
|
16
|
+
/** Tailwind classes merged into the item root. */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Tailwind classes for this item's internal slots, keyed by `data-slot`. */
|
|
19
|
+
ui?: Partial<Pick<RadioGroup["slots"], "item" | "box" | "glass" | "overlay" | "indicator" | "dot" | "wrapper" | "itemLabel" | "itemDescription">>;
|
|
20
|
+
};
|
|
21
|
+
type RadioGroupProps<Value extends string = string> = Omit<UIRadioGroup.Props<Value>, "className" | "style" | "children"> & VariantProps<typeof theme> & {
|
|
22
|
+
/** Options rendered by the radio group. */
|
|
23
|
+
items: readonly RadioGroupItemProps<Value>[];
|
|
24
|
+
/** Visible label for the group. */
|
|
25
|
+
label?: React.ReactNode;
|
|
26
|
+
/** Supporting text rendered under the group label. */
|
|
27
|
+
description?: React.ReactNode;
|
|
28
|
+
/** Tailwind classes merged into the group root. */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** Tailwind classes for internal slots, keyed by `data-slot`. */
|
|
31
|
+
ui?: RadioGroup["slots"];
|
|
32
|
+
};
|
|
33
|
+
declare function RadioGroup<Value extends string = string>({ className, ui, size, items, label, description, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...props }: RadioGroupProps<Value>): React.JSX.Element;
|
|
34
|
+
export { RadioGroup };
|
|
35
|
+
export type { RadioGroupItemProps, RadioGroupProps };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Radio as UIRadio } from "@base-ui/react/radio";
|
|
3
|
+
import { RadioGroup as UIRadioGroup } from "@base-ui/react/radio-group";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { mergeIds } from "../internal/aria.mjs";
|
|
7
|
+
import theme from "../theme/radio-group.mjs";
|
|
8
|
+
function RadioGroup({
|
|
9
|
+
className,
|
|
10
|
+
ui,
|
|
11
|
+
size,
|
|
12
|
+
items,
|
|
13
|
+
label,
|
|
14
|
+
description,
|
|
15
|
+
"aria-label": ariaLabel,
|
|
16
|
+
"aria-labelledby": ariaLabelledBy,
|
|
17
|
+
"aria-describedby": ariaDescribedBy,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
const styles = theme({ size });
|
|
21
|
+
const labelId = React.useId();
|
|
22
|
+
const descriptionId = React.useId();
|
|
23
|
+
const hasName = Boolean(label || ariaLabel || ariaLabelledBy);
|
|
24
|
+
const labelledBy = ariaLabelledBy || (label && !ariaLabel ? labelId : void 0);
|
|
25
|
+
const describedBy = mergeIds(
|
|
26
|
+
ariaDescribedBy,
|
|
27
|
+
description && hasName ? descriptionId : void 0
|
|
28
|
+
);
|
|
29
|
+
return /* @__PURE__ */ React.createElement(
|
|
30
|
+
UIRadioGroup,
|
|
31
|
+
{
|
|
32
|
+
...props,
|
|
33
|
+
"aria-describedby": describedBy,
|
|
34
|
+
"aria-label": ariaLabel,
|
|
35
|
+
"aria-labelledby": labelledBy,
|
|
36
|
+
"data-slot": "root",
|
|
37
|
+
className: cn(styles.root(), ui?.root, className)
|
|
38
|
+
},
|
|
39
|
+
label || description ? /* @__PURE__ */ React.createElement("div", { "data-slot": "header", className: cn(styles.header(), ui?.header) }, label ? /* @__PURE__ */ React.createElement(
|
|
40
|
+
"span",
|
|
41
|
+
{
|
|
42
|
+
id: labelId,
|
|
43
|
+
"data-slot": "label",
|
|
44
|
+
className: cn(styles.label(), ui?.label)
|
|
45
|
+
},
|
|
46
|
+
label
|
|
47
|
+
) : null, description ? /* @__PURE__ */ React.createElement(
|
|
48
|
+
"span",
|
|
49
|
+
{
|
|
50
|
+
id: descriptionId,
|
|
51
|
+
"data-slot": "description",
|
|
52
|
+
className: cn(styles.description(), ui?.description)
|
|
53
|
+
},
|
|
54
|
+
description
|
|
55
|
+
) : null) : null,
|
|
56
|
+
/* @__PURE__ */ React.createElement("div", { "data-slot": "items", className: cn(styles.items(), ui?.items) }, items.map((item) => /* @__PURE__ */ React.createElement(
|
|
57
|
+
RadioGroupItem,
|
|
58
|
+
{
|
|
59
|
+
key: item.value,
|
|
60
|
+
...item,
|
|
61
|
+
ui: {
|
|
62
|
+
item: cn(ui?.item, item.ui?.item),
|
|
63
|
+
box: cn(ui?.box, item.ui?.box),
|
|
64
|
+
glass: cn(ui?.glass, item.ui?.glass),
|
|
65
|
+
overlay: cn(ui?.overlay, item.ui?.overlay),
|
|
66
|
+
indicator: cn(ui?.indicator, item.ui?.indicator),
|
|
67
|
+
dot: cn(ui?.dot, item.ui?.dot),
|
|
68
|
+
wrapper: cn(
|
|
69
|
+
styles.wrapper(),
|
|
70
|
+
ui?.wrapper,
|
|
71
|
+
item.ui?.wrapper
|
|
72
|
+
),
|
|
73
|
+
itemLabel: cn(ui?.itemLabel, item.ui?.itemLabel),
|
|
74
|
+
itemDescription: cn(
|
|
75
|
+
ui?.itemDescription,
|
|
76
|
+
item.ui?.itemDescription
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
)))
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
function RadioGroupItem({
|
|
84
|
+
className,
|
|
85
|
+
ui,
|
|
86
|
+
label,
|
|
87
|
+
description,
|
|
88
|
+
"aria-label": ariaLabel,
|
|
89
|
+
"aria-labelledby": ariaLabelledBy,
|
|
90
|
+
"aria-describedby": ariaDescribedBy,
|
|
91
|
+
...props
|
|
92
|
+
}) {
|
|
93
|
+
const styles = theme();
|
|
94
|
+
const labelId = React.useId();
|
|
95
|
+
const descriptionId = React.useId();
|
|
96
|
+
const hasName = Boolean(label || ariaLabel || ariaLabelledBy);
|
|
97
|
+
const labelledBy = ariaLabelledBy || (label && !ariaLabel ? labelId : void 0);
|
|
98
|
+
const describedBy = mergeIds(
|
|
99
|
+
ariaDescribedBy,
|
|
100
|
+
description && hasName ? descriptionId : void 0
|
|
101
|
+
);
|
|
102
|
+
return /* @__PURE__ */ React.createElement(
|
|
103
|
+
UIRadio.Root,
|
|
104
|
+
{
|
|
105
|
+
...props,
|
|
106
|
+
"aria-describedby": describedBy,
|
|
107
|
+
"aria-label": ariaLabel,
|
|
108
|
+
"aria-labelledby": labelledBy,
|
|
109
|
+
"data-slot": "item",
|
|
110
|
+
className: cn(styles.item(), ui?.item, className)
|
|
111
|
+
},
|
|
112
|
+
/* @__PURE__ */ React.createElement("span", { "data-slot": "box", className: cn(styles.box(), ui?.box) }, /* @__PURE__ */ React.createElement(
|
|
113
|
+
"span",
|
|
114
|
+
{
|
|
115
|
+
"aria-hidden": "true",
|
|
116
|
+
"data-slot": "glass",
|
|
117
|
+
className: cn(styles.glass(), ui?.glass)
|
|
118
|
+
},
|
|
119
|
+
/* @__PURE__ */ React.createElement(
|
|
120
|
+
"span",
|
|
121
|
+
{
|
|
122
|
+
"aria-hidden": "true",
|
|
123
|
+
"data-slot": "overlay",
|
|
124
|
+
className: cn(styles.overlay(), ui?.overlay)
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
), /* @__PURE__ */ React.createElement(
|
|
128
|
+
UIRadio.Indicator,
|
|
129
|
+
{
|
|
130
|
+
keepMounted: true,
|
|
131
|
+
"aria-hidden": "true",
|
|
132
|
+
"data-slot": "indicator",
|
|
133
|
+
className: cn(styles.indicator(), ui?.indicator)
|
|
134
|
+
},
|
|
135
|
+
/* @__PURE__ */ React.createElement("span", { "data-slot": "dot", className: cn(styles.dot(), ui?.dot) })
|
|
136
|
+
)),
|
|
137
|
+
label || description ? /* @__PURE__ */ React.createElement("span", { "data-slot": "wrapper", className: cn(styles.wrapper(), ui?.wrapper) }, label ? /* @__PURE__ */ React.createElement(
|
|
138
|
+
"span",
|
|
139
|
+
{
|
|
140
|
+
id: labelId,
|
|
141
|
+
"data-slot": "item-label",
|
|
142
|
+
className: cn(styles.itemLabel(), ui?.itemLabel)
|
|
143
|
+
},
|
|
144
|
+
label
|
|
145
|
+
) : null, description ? /* @__PURE__ */ React.createElement(
|
|
146
|
+
"span",
|
|
147
|
+
{
|
|
148
|
+
id: descriptionId,
|
|
149
|
+
"data-slot": "item-description",
|
|
150
|
+
className: cn(styles.itemDescription(), ui?.itemDescription)
|
|
151
|
+
},
|
|
152
|
+
description
|
|
153
|
+
) : null) : null
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
export { RadioGroup };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Tabs as UITabs } from "@base-ui/react/tabs";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { type VariantProps } from "tailwind-variants";
|
|
4
|
+
import { type ComponentConfig } from "../internal/tv";
|
|
5
|
+
import theme from "../theme/tabs";
|
|
6
|
+
type Tabs = ComponentConfig<typeof theme>;
|
|
7
|
+
/** One tab and its related panel. */
|
|
8
|
+
type TabsItemProps<Value extends string = string> = Omit<UITabs.Tab.Props, "children" | "className" | "content" | "style" | "value"> & {
|
|
9
|
+
/** Value that identifies the tab and its panel. */
|
|
10
|
+
value: Value;
|
|
11
|
+
/** Visible label inside the tab. */
|
|
12
|
+
label?: React.ReactNode;
|
|
13
|
+
/** Decorative icon rendered before the label. */
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
/** Panel content shown while the tab is active. */
|
|
16
|
+
content?: React.ReactNode;
|
|
17
|
+
/** Whether to keep the panel mounted while another tab is active. */
|
|
18
|
+
keepMounted?: boolean;
|
|
19
|
+
/** Tailwind classes merged into the tab button. */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Tailwind classes for this item's internal slots, keyed by `data-slot`. */
|
|
22
|
+
ui?: Partial<Pick<Tabs["slots"], "tab" | "icon" | "label" | "panel" | "panelContent">>;
|
|
23
|
+
};
|
|
24
|
+
type TabsProps<Value extends string = string> = Omit<UITabs.Root.Props, "children" | "className" | "style" | "value" | "defaultValue" | "onValueChange"> & VariantProps<typeof theme> & {
|
|
25
|
+
/** Tabs and panels rendered by the component. */
|
|
26
|
+
items: readonly TabsItemProps<Value>[];
|
|
27
|
+
/** Controlled active value. Use `null` to render no active tab. */
|
|
28
|
+
value?: Value | null;
|
|
29
|
+
/** Initial active value when uncontrolled. */
|
|
30
|
+
defaultValue?: Value | null;
|
|
31
|
+
/** Called when the active value changes. */
|
|
32
|
+
onValueChange?: (value: Value, details: UITabs.Root.ChangeEventDetails) => void;
|
|
33
|
+
/** Whether arrow keys activate a tab as focus moves. */
|
|
34
|
+
activateOnFocus?: boolean;
|
|
35
|
+
/** Whether keyboard focus loops back to the first tab. */
|
|
36
|
+
loopFocus?: boolean;
|
|
37
|
+
/** Disables every tab. */
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
/** Tailwind classes merged into the root. */
|
|
40
|
+
className?: string;
|
|
41
|
+
/** Tailwind classes for internal slots, keyed by `data-slot`. */
|
|
42
|
+
ui?: Tabs["slots"];
|
|
43
|
+
};
|
|
44
|
+
declare function Tabs<Value extends string = string>({ className, ui, size, items, value, defaultValue, onValueChange, activateOnFocus, loopFocus, disabled, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...props }: TabsProps<Value>): React.JSX.Element;
|
|
45
|
+
export { Tabs };
|
|
46
|
+
export type { TabsItemProps, TabsProps };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Tabs as UITabs } from "@base-ui/react/tabs";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import theme from "../theme/tabs.mjs";
|
|
6
|
+
function Tabs({
|
|
7
|
+
className,
|
|
8
|
+
ui,
|
|
9
|
+
size,
|
|
10
|
+
items,
|
|
11
|
+
value,
|
|
12
|
+
defaultValue,
|
|
13
|
+
onValueChange,
|
|
14
|
+
activateOnFocus,
|
|
15
|
+
loopFocus,
|
|
16
|
+
disabled,
|
|
17
|
+
"aria-label": ariaLabel,
|
|
18
|
+
"aria-labelledby": ariaLabelledBy,
|
|
19
|
+
"aria-describedby": ariaDescribedBy,
|
|
20
|
+
...props
|
|
21
|
+
}) {
|
|
22
|
+
const styles = theme({ size });
|
|
23
|
+
const initialValue = defaultValue !== void 0 ? defaultValue : items.find((item) => !item.disabled)?.value;
|
|
24
|
+
return /* @__PURE__ */ React.createElement(
|
|
25
|
+
UITabs.Root,
|
|
26
|
+
{
|
|
27
|
+
...props,
|
|
28
|
+
value,
|
|
29
|
+
defaultValue: initialValue,
|
|
30
|
+
onValueChange,
|
|
31
|
+
"data-slot": "root",
|
|
32
|
+
"data-disabled": disabled || void 0,
|
|
33
|
+
className: cn(styles.root(), ui?.root, className)
|
|
34
|
+
},
|
|
35
|
+
/* @__PURE__ */ React.createElement(
|
|
36
|
+
UITabs.List,
|
|
37
|
+
{
|
|
38
|
+
activateOnFocus,
|
|
39
|
+
loopFocus,
|
|
40
|
+
"aria-label": ariaLabel,
|
|
41
|
+
"aria-labelledby": ariaLabelledBy,
|
|
42
|
+
"aria-describedby": ariaDescribedBy,
|
|
43
|
+
"data-slot": "list",
|
|
44
|
+
className: cn(styles.list(), ui?.list)
|
|
45
|
+
},
|
|
46
|
+
/* @__PURE__ */ React.createElement(
|
|
47
|
+
"span",
|
|
48
|
+
{
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
"data-slot": "glass",
|
|
51
|
+
className: cn(styles.glass(), ui?.glass)
|
|
52
|
+
},
|
|
53
|
+
/* @__PURE__ */ React.createElement(
|
|
54
|
+
"span",
|
|
55
|
+
{
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
"data-slot": "overlay",
|
|
58
|
+
className: cn(styles.overlay(), ui?.overlay)
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ React.createElement(
|
|
63
|
+
UITabs.Indicator,
|
|
64
|
+
{
|
|
65
|
+
"data-slot": "indicator",
|
|
66
|
+
className: cn(styles.indicator(), ui?.indicator)
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
items.map(
|
|
70
|
+
({ content: _content, keepMounted: _keepMounted, ui: itemUi, ...item }) => /* @__PURE__ */ React.createElement(
|
|
71
|
+
TabsItem,
|
|
72
|
+
{
|
|
73
|
+
key: item.value,
|
|
74
|
+
...item,
|
|
75
|
+
disabled: disabled || item.disabled,
|
|
76
|
+
ui: {
|
|
77
|
+
tab: cn(ui?.tab, itemUi?.tab),
|
|
78
|
+
icon: cn(ui?.icon, itemUi?.icon),
|
|
79
|
+
label: cn(ui?.label, itemUi?.label)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ React.createElement("div", { "data-slot": "panels", className: cn(styles.panels(), ui?.panels) }, items.map((item) => /* @__PURE__ */ React.createElement(
|
|
86
|
+
UITabs.Panel,
|
|
87
|
+
{
|
|
88
|
+
key: item.value,
|
|
89
|
+
value: item.value,
|
|
90
|
+
keepMounted: item.keepMounted,
|
|
91
|
+
"data-slot": "panel",
|
|
92
|
+
className: cn(styles.panel(), ui?.panel, item.ui?.panel)
|
|
93
|
+
},
|
|
94
|
+
/* @__PURE__ */ React.createElement(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
"data-slot": "panel-content",
|
|
98
|
+
className: cn(
|
|
99
|
+
styles.panelContent(),
|
|
100
|
+
ui?.panelContent,
|
|
101
|
+
item.ui?.panelContent
|
|
102
|
+
)
|
|
103
|
+
},
|
|
104
|
+
item.content
|
|
105
|
+
)
|
|
106
|
+
)))
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
function TabsItem({
|
|
110
|
+
className,
|
|
111
|
+
ui,
|
|
112
|
+
label,
|
|
113
|
+
icon,
|
|
114
|
+
...props
|
|
115
|
+
}) {
|
|
116
|
+
const styles = theme();
|
|
117
|
+
return /* @__PURE__ */ React.createElement(
|
|
118
|
+
UITabs.Tab,
|
|
119
|
+
{
|
|
120
|
+
...props,
|
|
121
|
+
"data-slot": "tab",
|
|
122
|
+
className: cn(styles.tab(), ui?.tab, className)
|
|
123
|
+
},
|
|
124
|
+
icon ? /* @__PURE__ */ React.createElement(
|
|
125
|
+
"span",
|
|
126
|
+
{
|
|
127
|
+
"aria-hidden": "true",
|
|
128
|
+
"data-slot": "icon",
|
|
129
|
+
className: cn(styles.icon(), ui?.icon)
|
|
130
|
+
},
|
|
131
|
+
icon
|
|
132
|
+
) : null,
|
|
133
|
+
label !== void 0 && label !== null ? /* @__PURE__ */ React.createElement("span", { "data-slot": "label", className: cn(styles.label(), ui?.label) }, label) : null
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
export { Tabs };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,9 +8,11 @@ export { Drawer, type DrawerProps } from "./components/drawer";
|
|
|
8
8
|
export { Input, type InputProps } from "./components/input";
|
|
9
9
|
export { Popover, type PopoverProps } from "./components/popover";
|
|
10
10
|
export { Progress, type ProgressProps } from "./components/progress";
|
|
11
|
+
export { RadioGroup, type RadioGroupItemProps, type RadioGroupProps, } from "./components/radio-group";
|
|
11
12
|
export { ScrollArea, type ScrollAreaOrientation, type ScrollAreaProps, } from "./components/scroll-area";
|
|
12
13
|
export { Slider, type SliderProps } from "./components/slider";
|
|
13
14
|
export { Switch, type SwitchProps } from "./components/switch";
|
|
15
|
+
export { Tabs, type TabsItemProps, type TabsProps } from "./components/tabs";
|
|
14
16
|
export { Toast, ToastProvider, type ToastPosition, type ToastProps, type ToastProviderProps, } from "./components/toast";
|
|
15
17
|
export { createToastManager, useToast, type ToastManager, type ToastManagerAddOptions, type ToastManagerPromiseOptions, type ToastManagerUpdateOptions, type ToastObject, } from "./composables/use-toast";
|
|
16
18
|
export { Toggle, type ToggleProps } from "./components/toggle";
|
package/dist/index.mjs
CHANGED
|
@@ -10,11 +10,15 @@ export { Drawer } from "./components/drawer.mjs";
|
|
|
10
10
|
export { Input } from "./components/input.mjs";
|
|
11
11
|
export { Popover } from "./components/popover.mjs";
|
|
12
12
|
export { Progress } from "./components/progress.mjs";
|
|
13
|
+
export {
|
|
14
|
+
RadioGroup
|
|
15
|
+
} from "./components/radio-group.mjs";
|
|
13
16
|
export {
|
|
14
17
|
ScrollArea
|
|
15
18
|
} from "./components/scroll-area.mjs";
|
|
16
19
|
export { Slider } from "./components/slider.mjs";
|
|
17
20
|
export { Switch } from "./components/switch.mjs";
|
|
21
|
+
export { Tabs } from "./components/tabs.mjs";
|
|
18
22
|
export {
|
|
19
23
|
Toast,
|
|
20
24
|
ToastProvider
|
|
@@ -29,67 +29,5 @@ declare const _default: import("tailwind-variants").TVReturnType<{
|
|
|
29
29
|
indicatorIcon: string;
|
|
30
30
|
panel: string[];
|
|
31
31
|
panelContent: string[];
|
|
32
|
-
}, undefined,
|
|
33
|
-
size: {
|
|
34
|
-
xs: {
|
|
35
|
-
root: string;
|
|
36
|
-
};
|
|
37
|
-
sm: {
|
|
38
|
-
root: string;
|
|
39
|
-
};
|
|
40
|
-
md: {
|
|
41
|
-
root: string;
|
|
42
|
-
};
|
|
43
|
-
lg: {
|
|
44
|
-
root: string;
|
|
45
|
-
};
|
|
46
|
-
xl: {
|
|
47
|
-
root: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
}, {
|
|
51
|
-
root: string[];
|
|
52
|
-
glass: string[];
|
|
53
|
-
overlay: string;
|
|
54
|
-
content: string;
|
|
55
|
-
item: string[];
|
|
56
|
-
header: string;
|
|
57
|
-
trigger: string[];
|
|
58
|
-
title: string[];
|
|
59
|
-
indicator: string[];
|
|
60
|
-
indicatorIcon: string;
|
|
61
|
-
panel: string[];
|
|
62
|
-
panelContent: string[];
|
|
63
|
-
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
64
|
-
size: {
|
|
65
|
-
xs: {
|
|
66
|
-
root: string;
|
|
67
|
-
};
|
|
68
|
-
sm: {
|
|
69
|
-
root: string;
|
|
70
|
-
};
|
|
71
|
-
md: {
|
|
72
|
-
root: string;
|
|
73
|
-
};
|
|
74
|
-
lg: {
|
|
75
|
-
root: string;
|
|
76
|
-
};
|
|
77
|
-
xl: {
|
|
78
|
-
root: string;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
}, {
|
|
82
|
-
root: string[];
|
|
83
|
-
glass: string[];
|
|
84
|
-
overlay: string;
|
|
85
|
-
content: string;
|
|
86
|
-
item: string[];
|
|
87
|
-
header: string;
|
|
88
|
-
trigger: string[];
|
|
89
|
-
title: string[];
|
|
90
|
-
indicator: string[];
|
|
91
|
-
indicatorIcon: string;
|
|
92
|
-
panel: string[];
|
|
93
|
-
panelContent: string[];
|
|
94
|
-
}>>;
|
|
32
|
+
}, undefined, undefined, undefined, undefined>;
|
|
95
33
|
export default _default;
|
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
declare const _default: import("tailwind-variants").TVReturnType<{
|
|
2
|
-
[key: string]: {
|
|
3
|
-
[key: string]: import("tailwind-variants").ClassValue | {
|
|
4
|
-
overlay?: import("tailwind-variants").ClassValue;
|
|
5
|
-
content?: import("tailwind-variants").ClassValue;
|
|
6
|
-
glass?: import("tailwind-variants").ClassValue;
|
|
7
|
-
title?: import("tailwind-variants").ClassValue;
|
|
8
|
-
body?: import("tailwind-variants").ClassValue;
|
|
9
|
-
footer?: import("tailwind-variants").ClassValue;
|
|
10
|
-
popup?: import("tailwind-variants").ClassValue;
|
|
11
|
-
viewport?: import("tailwind-variants").ClassValue;
|
|
12
|
-
description?: import("tailwind-variants").ClassValue;
|
|
13
|
-
backdrop?: import("tailwind-variants").ClassValue;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
} | {
|
|
17
|
-
[x: string]: {
|
|
18
|
-
[x: string]: import("tailwind-variants").ClassValue | {
|
|
19
|
-
overlay?: import("tailwind-variants").ClassValue;
|
|
20
|
-
content?: import("tailwind-variants").ClassValue;
|
|
21
|
-
glass?: import("tailwind-variants").ClassValue;
|
|
22
|
-
title?: import("tailwind-variants").ClassValue;
|
|
23
|
-
body?: import("tailwind-variants").ClassValue;
|
|
24
|
-
footer?: import("tailwind-variants").ClassValue;
|
|
25
|
-
popup?: import("tailwind-variants").ClassValue;
|
|
26
|
-
viewport?: import("tailwind-variants").ClassValue;
|
|
27
|
-
description?: import("tailwind-variants").ClassValue;
|
|
28
|
-
backdrop?: import("tailwind-variants").ClassValue;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
} | {}, {
|
|
1
|
+
declare const _default: import("tailwind-variants").TVReturnType<{}, {
|
|
32
2
|
backdrop: string[];
|
|
33
3
|
viewport: string;
|
|
34
4
|
popup: string[];
|
|
@@ -39,42 +9,5 @@ declare const _default: import("tailwind-variants").TVReturnType<{
|
|
|
39
9
|
description: string;
|
|
40
10
|
body: string;
|
|
41
11
|
footer: string;
|
|
42
|
-
}, undefined,
|
|
43
|
-
[key: string]: {
|
|
44
|
-
[key: string]: import("tailwind-variants").ClassValue | {
|
|
45
|
-
overlay?: import("tailwind-variants").ClassValue;
|
|
46
|
-
content?: import("tailwind-variants").ClassValue;
|
|
47
|
-
glass?: import("tailwind-variants").ClassValue;
|
|
48
|
-
title?: import("tailwind-variants").ClassValue;
|
|
49
|
-
body?: import("tailwind-variants").ClassValue;
|
|
50
|
-
footer?: import("tailwind-variants").ClassValue;
|
|
51
|
-
popup?: import("tailwind-variants").ClassValue;
|
|
52
|
-
viewport?: import("tailwind-variants").ClassValue;
|
|
53
|
-
description?: import("tailwind-variants").ClassValue;
|
|
54
|
-
backdrop?: import("tailwind-variants").ClassValue;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
} | {}, {
|
|
58
|
-
backdrop: string[];
|
|
59
|
-
viewport: string;
|
|
60
|
-
popup: string[];
|
|
61
|
-
glass: string[];
|
|
62
|
-
overlay: string;
|
|
63
|
-
content: string;
|
|
64
|
-
title: string[];
|
|
65
|
-
description: string;
|
|
66
|
-
body: string;
|
|
67
|
-
footer: string;
|
|
68
|
-
}, import("tailwind-variants").TVReturnTypeLike<unknown, {
|
|
69
|
-
backdrop: string[];
|
|
70
|
-
viewport: string;
|
|
71
|
-
popup: string[];
|
|
72
|
-
glass: string[];
|
|
73
|
-
overlay: string;
|
|
74
|
-
content: string;
|
|
75
|
-
title: string[];
|
|
76
|
-
description: string;
|
|
77
|
-
body: string;
|
|
78
|
-
footer: string;
|
|
79
|
-
}>>;
|
|
12
|
+
}, undefined, undefined, undefined, undefined>;
|
|
80
13
|
export default _default;
|
package/dist/theme/button.d.ts
CHANGED
|
@@ -34,77 +34,5 @@ declare const _default: import("tailwind-variants").TVReturnType<{
|
|
|
34
34
|
leadingIcon: string[];
|
|
35
35
|
trailingIcon: string[];
|
|
36
36
|
overlay: string;
|
|
37
|
-
}, undefined,
|
|
38
|
-
size: {
|
|
39
|
-
xs: {
|
|
40
|
-
base: string;
|
|
41
|
-
leadingIcon: string;
|
|
42
|
-
trailingIcon: string;
|
|
43
|
-
};
|
|
44
|
-
sm: {
|
|
45
|
-
base: string;
|
|
46
|
-
leadingIcon: string;
|
|
47
|
-
trailingIcon: string;
|
|
48
|
-
};
|
|
49
|
-
md: {
|
|
50
|
-
base: string;
|
|
51
|
-
leadingIcon: string;
|
|
52
|
-
trailingIcon: string;
|
|
53
|
-
};
|
|
54
|
-
lg: {
|
|
55
|
-
base: string;
|
|
56
|
-
leadingIcon: string;
|
|
57
|
-
trailingIcon: string;
|
|
58
|
-
};
|
|
59
|
-
xl: {
|
|
60
|
-
base: string;
|
|
61
|
-
leadingIcon: string;
|
|
62
|
-
trailingIcon: string;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
}, {
|
|
66
|
-
root: string[];
|
|
67
|
-
base: string[];
|
|
68
|
-
glass: string[];
|
|
69
|
-
label: string[];
|
|
70
|
-
leadingIcon: string[];
|
|
71
|
-
trailingIcon: string[];
|
|
72
|
-
overlay: string;
|
|
73
|
-
}, import("tailwind-variants").TVReturnTypeLike<{
|
|
74
|
-
size: {
|
|
75
|
-
xs: {
|
|
76
|
-
base: string;
|
|
77
|
-
leadingIcon: string;
|
|
78
|
-
trailingIcon: string;
|
|
79
|
-
};
|
|
80
|
-
sm: {
|
|
81
|
-
base: string;
|
|
82
|
-
leadingIcon: string;
|
|
83
|
-
trailingIcon: string;
|
|
84
|
-
};
|
|
85
|
-
md: {
|
|
86
|
-
base: string;
|
|
87
|
-
leadingIcon: string;
|
|
88
|
-
trailingIcon: string;
|
|
89
|
-
};
|
|
90
|
-
lg: {
|
|
91
|
-
base: string;
|
|
92
|
-
leadingIcon: string;
|
|
93
|
-
trailingIcon: string;
|
|
94
|
-
};
|
|
95
|
-
xl: {
|
|
96
|
-
base: string;
|
|
97
|
-
leadingIcon: string;
|
|
98
|
-
trailingIcon: string;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
}, {
|
|
102
|
-
root: string[];
|
|
103
|
-
base: string[];
|
|
104
|
-
glass: string[];
|
|
105
|
-
label: string[];
|
|
106
|
-
leadingIcon: string[];
|
|
107
|
-
trailingIcon: string[];
|
|
108
|
-
overlay: string;
|
|
109
|
-
}>>;
|
|
37
|
+
}, undefined, undefined, undefined, undefined>;
|
|
110
38
|
export default _default;
|