@xjur-ui/react 1.0.0 → 1.0.2
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/.turbo/turbo-build.log +63 -57
- package/CHANGELOG.md +18 -0
- package/dist/components/avatar.d.ts +11 -0
- package/dist/components/avatar.js +58 -0
- package/dist/components/badge.d.ts +13 -0
- package/dist/components/{ui/input/message.js → badge.js} +30 -47
- package/dist/components/{ui/button.d.ts → button.d.ts} +2 -2
- package/dist/components/{ui/button.js → button.js} +9 -6
- package/dist/components/calendar.d.ts +11 -0
- package/dist/components/calendar.js +751 -0
- package/dist/components/checkbox.d.ts +8 -0
- package/dist/components/{ui/input/root.js → checkbox.js} +69 -79
- package/dist/components/chip.d.ts +24 -0
- package/dist/components/chip.js +255 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +41 -0
- package/dist/components/date-picker.d.ts +20 -0
- package/dist/components/date-picker.js +232 -0
- package/dist/components/divider.d.ts +7 -0
- package/dist/components/divider.js +28 -0
- package/dist/components/dropdown-menu.d.ts +22 -0
- package/dist/components/dropdown-menu.js +294 -0
- package/dist/components/{resources/icons.d.ts → icon.d.ts} +11 -2
- package/dist/components/{ui/icon.js → icon.js} +20 -5
- package/dist/components/input.d.ts +32 -0
- package/dist/components/input.js +315 -0
- package/dist/components/list.d.ts +25 -0
- package/dist/components/{ui/input/content.js → list.js} +83 -87
- package/dist/components/{ui/logo.d.ts → logo.d.ts} +2 -2
- package/dist/components/{ui/logo.js → logo.js} +5 -5
- package/dist/components/{ui/otp-input.js → otp-input.js} +1 -1
- package/dist/components/radio.d.ts +10 -0
- package/dist/components/{ui/input/label.js → radio.js} +68 -77
- package/dist/components/search-input.d.ts +17 -0
- package/dist/components/search-input.js +274 -0
- package/dist/components/select.d.ts +33 -0
- package/dist/components/select.js +550 -0
- package/dist/components/sheet.d.ts +19 -0
- package/dist/components/sheet.js +251 -0
- package/dist/components/switch.d.ts +7 -0
- package/dist/components/switch.js +36 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +54 -0
- package/dist/components/tag.d.ts +18 -0
- package/dist/components/tag.js +189 -0
- package/dist/components/{ui/typography.d.ts → typography.d.ts} +4 -4
- package/dist/components/{ui/typography.js → typography.js} +1 -1
- package/dist/index.css +1233 -62
- package/dist/index.d.ts +2 -17
- package/dist/index.js +0 -788
- package/eslint.config.js +8 -1
- package/package.json +41 -10
- package/src/components/avatar.tsx +53 -0
- package/src/components/badge.tsx +40 -0
- package/src/components/{ui/button.tsx → button.tsx} +7 -5
- package/src/components/calendar.tsx +123 -0
- package/src/components/checkbox.tsx +57 -0
- package/src/components/chip.tsx +109 -0
- package/src/components/collapsible.tsx +35 -0
- package/src/components/date-picker.tsx +160 -0
- package/src/components/divider.tsx +23 -0
- package/src/components/dropdown-menu.tsx +101 -0
- package/src/components/{ui/icon.tsx → icon.tsx} +1 -1
- package/src/components/input.tsx +256 -0
- package/src/components/list.tsx +111 -0
- package/src/components/radio.tsx +74 -0
- package/src/components/search-input.tsx +112 -0
- package/src/components/select.tsx +240 -0
- package/src/components/sheet.tsx +141 -0
- package/src/components/switch.tsx +31 -0
- package/src/components/tabs.tsx +53 -0
- package/src/components/tag.tsx +91 -0
- package/src/index.css +4 -1
- package/src/index.ts +0 -1
- package/src/{components/resources → resources}/icons.ts +16 -1
- package/src/resources/input-mask.ts +91 -0
- package/dist/components/resources/icons.js +0 -133
- package/dist/components/resources/logo/horizontal.d.ts +0 -12
- package/dist/components/resources/logo/horizontal.js +0 -107
- package/dist/components/resources/logo/icon.d.ts +0 -12
- package/dist/components/resources/logo/icon.js +0 -79
- package/dist/components/resources/logo/index.d.ts +0 -4
- package/dist/components/resources/logo/index.js +0 -291
- package/dist/components/resources/logo/vertical.d.ts +0 -12
- package/dist/components/resources/logo/vertical.js +0 -107
- package/dist/components/ui/accordion.d.ts +0 -5
- package/dist/components/ui/accordion.js +0 -8
- package/dist/components/ui/icon.d.ts +0 -12
- package/dist/components/ui/index.d.ts +0 -17
- package/dist/components/ui/index.js +0 -788
- package/dist/components/ui/input/content.d.ts +0 -9
- package/dist/components/ui/input/index.d.ts +0 -12
- package/dist/components/ui/input/index.js +0 -335
- package/dist/components/ui/input/label.d.ts +0 -12
- package/dist/components/ui/input/message.d.ts +0 -10
- package/dist/components/ui/input/root.d.ts +0 -18
- package/dist/components/ui/input/slot.d.ts +0 -10
- package/dist/components/ui/input/slot.js +0 -20
- package/dist/components/ui/input/text.d.ts +0 -10
- package/dist/components/ui/input/text.js +0 -195
- package/src/components/ui/accordion.tsx +0 -3
- package/src/components/ui/index.ts +0 -13
- package/src/components/ui/input/content.tsx +0 -59
- package/src/components/ui/input/index.ts +0 -6
- package/src/components/ui/input/label.tsx +0 -41
- package/src/components/ui/input/message.tsx +0 -37
- package/src/components/ui/input/root.tsx +0 -57
- package/src/components/ui/input/slot.tsx +0 -21
- package/src/components/ui/input/text.tsx +0 -69
- /package/dist/components/{ui/otp-input.d.ts → otp-input.d.ts} +0 -0
- /package/src/components/{ui/logo.tsx → logo.tsx} +0 -0
- /package/src/components/{ui/otp-input.tsx → otp-input.tsx} +0 -0
- /package/src/components/{ui/typography.tsx → typography.tsx} +0 -0
- /package/src/{components/resources → resources}/logo/horizontal.tsx +0 -0
- /package/src/{components/resources → resources}/logo/icon.tsx +0 -0
- /package/src/{components/resources → resources}/logo/index.ts +0 -0
- /package/src/{components/resources → resources}/logo/vertical.tsx +0 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
// src/components/sheet.tsx
|
|
2
|
+
import "react";
|
|
3
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import { cx as cx3 } from "@xjur-ui/util";
|
|
5
|
+
|
|
6
|
+
// src/components/button.tsx
|
|
7
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
8
|
+
import { cva, cx } from "@xjur-ui/util";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var buttonVariants = cva(
|
|
11
|
+
[
|
|
12
|
+
"outline-none inline-flex items-center justify-center rounded-circle gap-small cursor-pointer disabled:opacity-38 disabled:pointer-events-none transition-colors"
|
|
13
|
+
],
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
size: {
|
|
17
|
+
md: "py-small_1x-alt px-medium text-size-body-md",
|
|
18
|
+
sm: "py-small-1x px-small text-size-label-sm",
|
|
19
|
+
icon_md: "p-small text-size-body-md h-large-4x w-large-4x",
|
|
20
|
+
icon_sm: "p-small-1x text-size-label-sm h-large-2x w-large-2x"
|
|
21
|
+
},
|
|
22
|
+
variant: {
|
|
23
|
+
primary: "",
|
|
24
|
+
secondary: "",
|
|
25
|
+
tertiary: "",
|
|
26
|
+
destructive: "",
|
|
27
|
+
outlined: "bg-layer-2-idle border border-border-layer-2 hover:bg-layer-2-hover active:bg-layer-2-pressed"
|
|
28
|
+
},
|
|
29
|
+
appearance: {
|
|
30
|
+
solid: "",
|
|
31
|
+
ghost: "bg-transparent"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
compoundVariants: [
|
|
35
|
+
{
|
|
36
|
+
variant: "primary",
|
|
37
|
+
appearance: "solid",
|
|
38
|
+
class: "bg-primary-idle text-neutral-label hover:bg-primary-hover active:bg-primary-pressed"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
variant: "primary",
|
|
42
|
+
appearance: "ghost",
|
|
43
|
+
class: "text-primary-idle hover:bg-primary-alt-idle active:bg-primary-alt-pressed"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
variant: "secondary",
|
|
47
|
+
appearance: "solid",
|
|
48
|
+
class: "bg-layer-1-hover text-neutral-dark hover:bg-layer-1-pressed active:bg-layer-1-active"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
variant: "secondary",
|
|
52
|
+
appearance: "ghost",
|
|
53
|
+
class: "hover:bg-layer-1-hover active:bg-layer-1-pressed"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
variant: "tertiary",
|
|
57
|
+
appearance: "solid",
|
|
58
|
+
class: "bg-layer-2-hover text-neutral-dark hover:bg-layer-2-pressed active:bg-layer-2-active"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
variant: "tertiary",
|
|
62
|
+
appearance: "ghost",
|
|
63
|
+
class: "hover:bg-layer-2-hover active:bg-layer-2-pressed"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
variant: "destructive",
|
|
67
|
+
appearance: "solid",
|
|
68
|
+
class: "bg-danger-idle text-neutral-label hover:bg-danger-hover active:bg-danger-pressed"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
variant: "destructive",
|
|
72
|
+
appearance: "ghost",
|
|
73
|
+
class: "text-danger-label-idle hover:bg-danger-alt-idle active:bg-danger-alt-pressed"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
defaultVariants: {
|
|
77
|
+
size: "md",
|
|
78
|
+
variant: "primary",
|
|
79
|
+
appearance: "solid"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
function Button({
|
|
84
|
+
asChild,
|
|
85
|
+
className,
|
|
86
|
+
variant = "primary",
|
|
87
|
+
size = "md",
|
|
88
|
+
appearance = "solid",
|
|
89
|
+
...props
|
|
90
|
+
}) {
|
|
91
|
+
const Component = asChild ? Slot : "button";
|
|
92
|
+
return /* @__PURE__ */ jsx(
|
|
93
|
+
Component,
|
|
94
|
+
{
|
|
95
|
+
className: cx(buttonVariants({ variant, appearance, size }), className),
|
|
96
|
+
...props
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// src/components/icon.tsx
|
|
102
|
+
import { cx as cx2 } from "@xjur-ui/util";
|
|
103
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
104
|
+
function Icon({ className, filled = false, name, ...props }) {
|
|
105
|
+
return /* @__PURE__ */ jsx2(
|
|
106
|
+
"span",
|
|
107
|
+
{
|
|
108
|
+
...props,
|
|
109
|
+
className: cx2(
|
|
110
|
+
"material-symbols-outlined",
|
|
111
|
+
"text-size-body-lg",
|
|
112
|
+
className
|
|
113
|
+
),
|
|
114
|
+
style: {
|
|
115
|
+
fontVariationSettings: `'FILL' ${filled ? 1 : 0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,
|
|
116
|
+
...props.style
|
|
117
|
+
},
|
|
118
|
+
children: name
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// src/components/sheet.tsx
|
|
124
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
125
|
+
function SheetRoot({
|
|
126
|
+
...props
|
|
127
|
+
}) {
|
|
128
|
+
return /* @__PURE__ */ jsx3(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
129
|
+
}
|
|
130
|
+
function SheetTrigger({
|
|
131
|
+
...props
|
|
132
|
+
}) {
|
|
133
|
+
return /* @__PURE__ */ jsx3(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
|
|
134
|
+
}
|
|
135
|
+
function SheetClose({
|
|
136
|
+
children = /* @__PURE__ */ jsx3(Button, { appearance: "ghost", size: "icon_md", variant: "tertiary", children: /* @__PURE__ */ jsx3(Icon, { className: "text-icon-neutral-3", name: "close" }) }),
|
|
137
|
+
...props
|
|
138
|
+
}) {
|
|
139
|
+
return /* @__PURE__ */ jsx3(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props, children });
|
|
140
|
+
}
|
|
141
|
+
function SheetPortal({
|
|
142
|
+
...props
|
|
143
|
+
}) {
|
|
144
|
+
return /* @__PURE__ */ jsx3(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
145
|
+
}
|
|
146
|
+
function SheetOverlay({
|
|
147
|
+
className,
|
|
148
|
+
...props
|
|
149
|
+
}) {
|
|
150
|
+
return /* @__PURE__ */ jsx3(
|
|
151
|
+
SheetPrimitive.Overlay,
|
|
152
|
+
{
|
|
153
|
+
className: cx3(
|
|
154
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
155
|
+
className
|
|
156
|
+
),
|
|
157
|
+
"data-slot": "sheet-overlay",
|
|
158
|
+
...props
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
function SheetContent({
|
|
163
|
+
className,
|
|
164
|
+
children,
|
|
165
|
+
side = "right",
|
|
166
|
+
overlay = false,
|
|
167
|
+
...props
|
|
168
|
+
}) {
|
|
169
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
170
|
+
overlay && /* @__PURE__ */ jsx3(SheetOverlay, {}),
|
|
171
|
+
/* @__PURE__ */ jsx3(
|
|
172
|
+
SheetPrimitive.Content,
|
|
173
|
+
{
|
|
174
|
+
className: cx3(
|
|
175
|
+
"border-border-layer-2 bg-layer-2-idle data-[state=open]:animate-in data-[state=closed]:animate-out shadow-elevation-2 fixed z-50 flex flex-col gap-4 transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
176
|
+
side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
|
177
|
+
side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
178
|
+
side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
179
|
+
side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
180
|
+
className
|
|
181
|
+
),
|
|
182
|
+
"data-slot": "sheet-content",
|
|
183
|
+
...props,
|
|
184
|
+
children
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
] });
|
|
188
|
+
}
|
|
189
|
+
function SheetBody({
|
|
190
|
+
className,
|
|
191
|
+
...props
|
|
192
|
+
}) {
|
|
193
|
+
return /* @__PURE__ */ jsx3("div", { className: cx3("px-large-2x", className), ...props });
|
|
194
|
+
}
|
|
195
|
+
function SheetHeader({
|
|
196
|
+
className,
|
|
197
|
+
...props
|
|
198
|
+
}) {
|
|
199
|
+
return /* @__PURE__ */ jsx3(
|
|
200
|
+
"div",
|
|
201
|
+
{
|
|
202
|
+
className: cx3(
|
|
203
|
+
"py-large px-large-2x border-b-border-layer-2 border-b",
|
|
204
|
+
className
|
|
205
|
+
),
|
|
206
|
+
"data-slot": "sheet-header",
|
|
207
|
+
...props
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
function SheetFooter({
|
|
212
|
+
className,
|
|
213
|
+
...props
|
|
214
|
+
}) {
|
|
215
|
+
return /* @__PURE__ */ jsx3(
|
|
216
|
+
"div",
|
|
217
|
+
{
|
|
218
|
+
className: cx3(
|
|
219
|
+
"py-large px-large-2x border-t-border-layer-2 mt-auto border-t",
|
|
220
|
+
className
|
|
221
|
+
),
|
|
222
|
+
"data-slot": "sheet-footer",
|
|
223
|
+
...props
|
|
224
|
+
}
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
function SheetTitle({
|
|
228
|
+
className,
|
|
229
|
+
...props
|
|
230
|
+
}) {
|
|
231
|
+
return /* @__PURE__ */ jsx3(
|
|
232
|
+
SheetPrimitive.Title,
|
|
233
|
+
{
|
|
234
|
+
className: cx3("text-size-title-lg font-medium", className),
|
|
235
|
+
"data-slot": "sheet-title",
|
|
236
|
+
...props
|
|
237
|
+
}
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
export {
|
|
241
|
+
SheetBody,
|
|
242
|
+
SheetClose,
|
|
243
|
+
SheetContent,
|
|
244
|
+
SheetFooter,
|
|
245
|
+
SheetHeader,
|
|
246
|
+
SheetOverlay,
|
|
247
|
+
SheetPortal,
|
|
248
|
+
SheetRoot,
|
|
249
|
+
SheetTitle,
|
|
250
|
+
SheetTrigger
|
|
251
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
4
|
+
|
|
5
|
+
declare function Switch({ className, ...props }: React.ComponentProps<typeof SwitchPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
6
|
+
|
|
7
|
+
export { Switch };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/components/switch.tsx
|
|
2
|
+
import "react";
|
|
3
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
4
|
+
import { cx } from "@xjur-ui/util";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function Switch({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
SwitchPrimitive.Root,
|
|
12
|
+
{
|
|
13
|
+
className: cx(
|
|
14
|
+
"w-large-3x h-large rounded-circle inline-flex shrink-0 items-center border border-transparent",
|
|
15
|
+
"peer data-[state=checked]:bg-primary-idle data-[state=unchecked]:bg-alt-4",
|
|
16
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 transition-all outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
17
|
+
"hover:shadow-focus-primary p-[2px]",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
"data-slot": "switch",
|
|
21
|
+
...props,
|
|
22
|
+
children: /* @__PURE__ */ jsx(
|
|
23
|
+
SwitchPrimitive.Thumb,
|
|
24
|
+
{
|
|
25
|
+
className: cx(
|
|
26
|
+
"bg-layer-2-idle size-medium pointer-events-none rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
|
|
27
|
+
),
|
|
28
|
+
"data-slot": "switch-thumb"
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
Switch
|
|
36
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
|
+
|
|
4
|
+
declare function TabsRoot({ ...props }: React.ComponentProps<typeof TabsPrimitive.Tabs>): react_jsx_runtime.JSX.Element;
|
|
5
|
+
declare function TabsList({ ...props }: React.ComponentProps<typeof TabsPrimitive.TabsList>): react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function TabsTrigger({ variant, className, ...props }: React.ComponentProps<typeof TabsPrimitive.TabsTrigger> & {
|
|
7
|
+
variant?: 'line' | 'button';
|
|
8
|
+
}): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare function TabsContent({ ...props }: React.ComponentProps<typeof TabsPrimitive.TabsContent>): react_jsx_runtime.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { TabsContent, TabsList, TabsRoot, TabsTrigger };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/components/tabs.tsx
|
|
2
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3
|
+
import { cva, cx } from "@xjur-ui/util";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function TabsRoot({
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.Tabs, { ...props });
|
|
9
|
+
}
|
|
10
|
+
function TabsList2({
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.TabsList, { ...props });
|
|
14
|
+
}
|
|
15
|
+
function TabsTrigger2({
|
|
16
|
+
variant,
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
const variants = cva(
|
|
21
|
+
[
|
|
22
|
+
"rounded-small-1x h-large-4x cursor-pointer text-size-label-md text-neutral-dark"
|
|
23
|
+
],
|
|
24
|
+
{
|
|
25
|
+
variants: {
|
|
26
|
+
variant: {
|
|
27
|
+
line: "py-small_1x-alt px-small data-[state=active]:border-b-[3px] data-[state=active]:border-b-primary-active data-[state=active]:rounded-none hover:bg-layer-2-hover",
|
|
28
|
+
button: "rounded-br-none rounded-bl-none py-small_1x-alt px-large bg-primary-idle text-neutral-label hover:bg-primary-hover data-[state=active]:bg-layer-2-idle data-[state=active]:text-primary-label-active"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
variant: "button"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
TabsPrimitive.TabsTrigger,
|
|
38
|
+
{
|
|
39
|
+
className: cx(className, variants({ variant })),
|
|
40
|
+
...props
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
function TabsContent2({
|
|
45
|
+
...props
|
|
46
|
+
}) {
|
|
47
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.TabsContent, { ...props });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
TabsContent2 as TabsContent,
|
|
51
|
+
TabsList2 as TabsList,
|
|
52
|
+
TabsRoot,
|
|
53
|
+
TabsTrigger2 as TabsTrigger
|
|
54
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { ClassVariantProps } from '@xjur-ui/util';
|
|
4
|
+
import { ComponentProps } from 'react';
|
|
5
|
+
import { Typography } from './typography.js';
|
|
6
|
+
import { Icon, IconType } from './icon.js';
|
|
7
|
+
|
|
8
|
+
declare const tagVariants: (props?: ({
|
|
9
|
+
variant?: "primary" | "neutral" | "danger" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
declare function TagRoot({ className, variant, ...props }: ComponentProps<'div'> & ClassVariantProps<typeof tagVariants>): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare function TagText({ variant, size, weight, className, ...props }: ComponentProps<typeof Typography>): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare function TagIcon({ className, ...props }: ComponentProps<typeof Icon>): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare function TagClose({ className, children, ...props }: ComponentProps<'button'> & {
|
|
15
|
+
name?: IconType;
|
|
16
|
+
}): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
export { TagClose, TagIcon, TagRoot, TagText };
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
// src/components/tag.tsx
|
|
2
|
+
import { cva as cva2, cx as cx2 } from "@xjur-ui/util";
|
|
3
|
+
import "react";
|
|
4
|
+
|
|
5
|
+
// src/components/typography.tsx
|
|
6
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
7
|
+
import { cva } from "@xjur-ui/util";
|
|
8
|
+
import { memo } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var typographyVariants = cva("", {
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
body: "",
|
|
14
|
+
label: "",
|
|
15
|
+
title: "",
|
|
16
|
+
headline: ""
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
"sm-2x": "",
|
|
20
|
+
"sm-1x": "",
|
|
21
|
+
sm: "",
|
|
22
|
+
md: "",
|
|
23
|
+
lg: ""
|
|
24
|
+
},
|
|
25
|
+
weight: {
|
|
26
|
+
thin: "font-thin",
|
|
27
|
+
extraLight: "font-extralight",
|
|
28
|
+
light: "font-light",
|
|
29
|
+
normal: "font-normal",
|
|
30
|
+
medium: "font-medium",
|
|
31
|
+
semibold: "font-semibold",
|
|
32
|
+
bold: "font-bold",
|
|
33
|
+
extraBold: "font-extrabold",
|
|
34
|
+
black: "font-black"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
compoundVariants: [
|
|
38
|
+
{ variant: "body", size: "sm-1x", class: "text-size-body-sm-1x" },
|
|
39
|
+
{ variant: "body", size: "sm", class: "text-size-body-sm" },
|
|
40
|
+
{ variant: "body", size: "md", class: "text-size-body-md" },
|
|
41
|
+
{ variant: "body", size: "lg", class: "text-size-body-lg" },
|
|
42
|
+
{ variant: "label", size: "sm-2x", class: "text-size-label-sm-2x" },
|
|
43
|
+
{ variant: "label", size: "sm-1x", class: "text-size-label-sm-1x" },
|
|
44
|
+
{ variant: "label", size: "sm", class: "text-size-label-sm" },
|
|
45
|
+
{ variant: "label", size: "md", class: "text-size-label-md" },
|
|
46
|
+
{ variant: "label", size: "lg", class: "text-size-label-lg" },
|
|
47
|
+
{ variant: "title", size: "sm", class: "text-size-title-sm" },
|
|
48
|
+
{ variant: "title", size: "md", class: "text-size-title-md" },
|
|
49
|
+
{ variant: "title", size: "lg", class: "text-size-title-lg" },
|
|
50
|
+
{ variant: "headline", size: "sm", class: "text-size-headline-sm" },
|
|
51
|
+
{ variant: "headline", size: "md", class: "text-size-headline-md" },
|
|
52
|
+
{ variant: "headline", size: "lg", class: "text-size-headline-lg" }
|
|
53
|
+
],
|
|
54
|
+
defaultVariants: {
|
|
55
|
+
variant: "body",
|
|
56
|
+
size: "md",
|
|
57
|
+
weight: "normal"
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
var Typography = memo(
|
|
61
|
+
({
|
|
62
|
+
variant,
|
|
63
|
+
size,
|
|
64
|
+
weight,
|
|
65
|
+
asChild,
|
|
66
|
+
className,
|
|
67
|
+
...props
|
|
68
|
+
}) => {
|
|
69
|
+
const Component = asChild ? Slot : "span";
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
Component,
|
|
72
|
+
{
|
|
73
|
+
className: typographyVariants({ variant, size, weight, className }),
|
|
74
|
+
...props
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
Typography.displayName = "Typography";
|
|
80
|
+
|
|
81
|
+
// src/components/icon.tsx
|
|
82
|
+
import { cx } from "@xjur-ui/util";
|
|
83
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
84
|
+
function Icon({ className, filled = false, name, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsx2(
|
|
86
|
+
"span",
|
|
87
|
+
{
|
|
88
|
+
...props,
|
|
89
|
+
className: cx(
|
|
90
|
+
"material-symbols-outlined",
|
|
91
|
+
"text-size-body-lg",
|
|
92
|
+
className
|
|
93
|
+
),
|
|
94
|
+
style: {
|
|
95
|
+
fontVariationSettings: `'FILL' ${filled ? 1 : 0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,
|
|
96
|
+
...props.style
|
|
97
|
+
},
|
|
98
|
+
children: name
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// src/components/tag.tsx
|
|
104
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
105
|
+
var tagVariants = cva2(
|
|
106
|
+
[
|
|
107
|
+
"group/tag relative h-large-2x w-fit rounded-small-1x px-small py-none flex items-center gap-small_1x-alt",
|
|
108
|
+
"transition-all duration-200"
|
|
109
|
+
],
|
|
110
|
+
{
|
|
111
|
+
variants: {
|
|
112
|
+
variant: {
|
|
113
|
+
primary: "bg-primary-alt-idle text-primary-label-idle hover:bg-primary-alt-hover",
|
|
114
|
+
danger: "bg-danger-alt-idle text-danger-label-idle hover:bg-danger-alt-hover",
|
|
115
|
+
neutral: "bg-layer-1-idle text-neutral-dark hover:bg-layer-1-hover"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
defaultVariants: {
|
|
119
|
+
variant: "primary"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
);
|
|
123
|
+
function TagRoot({
|
|
124
|
+
className,
|
|
125
|
+
variant = "primary",
|
|
126
|
+
...props
|
|
127
|
+
}) {
|
|
128
|
+
return /* @__PURE__ */ jsx3("div", { className: cx2(tagVariants({ variant }), className), ...props });
|
|
129
|
+
}
|
|
130
|
+
function TagText({
|
|
131
|
+
variant = "label",
|
|
132
|
+
size = "sm-1x",
|
|
133
|
+
weight = "medium",
|
|
134
|
+
className,
|
|
135
|
+
...props
|
|
136
|
+
}) {
|
|
137
|
+
return /* @__PURE__ */ jsx3(
|
|
138
|
+
Typography,
|
|
139
|
+
{
|
|
140
|
+
className: cx2(className, "truncate"),
|
|
141
|
+
size,
|
|
142
|
+
variant,
|
|
143
|
+
weight,
|
|
144
|
+
...props
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
function TagIcon({ className, ...props }) {
|
|
149
|
+
return /* @__PURE__ */ jsx3(
|
|
150
|
+
Icon,
|
|
151
|
+
{
|
|
152
|
+
className: (cx2(
|
|
153
|
+
"text-size-body-md",
|
|
154
|
+
"group-data-[variant=primary]:text-primary-label-idle",
|
|
155
|
+
"group-data-[variant=danger]:text-danger-label-idle",
|
|
156
|
+
"group-data-[variant=neutral]:text-icon-neutral-3"
|
|
157
|
+
), className),
|
|
158
|
+
...props
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
function TagClose({
|
|
163
|
+
className,
|
|
164
|
+
children = /* @__PURE__ */ jsx3(TagIcon, { name: "close" }),
|
|
165
|
+
...props
|
|
166
|
+
}) {
|
|
167
|
+
return /* @__PURE__ */ jsx3(
|
|
168
|
+
"button",
|
|
169
|
+
{
|
|
170
|
+
className: cx2(
|
|
171
|
+
className,
|
|
172
|
+
"cursor-pointer bg-inherit",
|
|
173
|
+
"invisible items-center justify-center group-hover/tag:visible",
|
|
174
|
+
"absolute top-0 right-0",
|
|
175
|
+
"h-large-2x w-large-2x rounded-circle",
|
|
176
|
+
"transition-[visibility] duration-200"
|
|
177
|
+
),
|
|
178
|
+
type: "button",
|
|
179
|
+
...props,
|
|
180
|
+
children
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
export {
|
|
185
|
+
TagClose,
|
|
186
|
+
TagIcon,
|
|
187
|
+
TagRoot,
|
|
188
|
+
TagText
|
|
189
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
@@ -6,12 +6,12 @@ import { ClassVariantProps } from '@xjur-ui/util';
|
|
|
6
6
|
|
|
7
7
|
declare const typographyVariants: (props?: ({
|
|
8
8
|
variant?: "body" | "label" | "title" | "headline" | null | undefined;
|
|
9
|
-
size?: "md" | "
|
|
10
|
-
weight?: "bold" | "
|
|
9
|
+
size?: "sm" | "md" | "lg" | "sm-2x" | "sm-1x" | null | undefined;
|
|
10
|
+
weight?: "bold" | "thin" | "extraLight" | "light" | "normal" | "medium" | "semibold" | "extraBold" | "black" | null | undefined;
|
|
11
11
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
12
|
interface TypographyProps extends ComponentProps<'base'>, ClassVariantProps<typeof typographyVariants> {
|
|
13
13
|
asChild?: boolean;
|
|
14
14
|
}
|
|
15
|
-
declare const Typography:
|
|
15
|
+
declare const Typography: React.MemoExoticComponent<({ variant, size, weight, asChild, className, ...props }: TypographyProps) => react_jsx_runtime.JSX.Element>;
|
|
16
16
|
|
|
17
17
|
export { Typography, type TypographyProps };
|