@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,8 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as CheckoxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
+
|
|
4
|
+
declare function Checkbox({ label, name, className, disabled, ...props }: CheckoxPrimitive.CheckboxProps & {
|
|
5
|
+
label?: string;
|
|
6
|
+
}): react_jsx_runtime.JSX.Element;
|
|
7
|
+
|
|
8
|
+
export { Checkbox };
|
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
// src/components/
|
|
2
|
-
import
|
|
1
|
+
// src/components/checkbox.tsx
|
|
2
|
+
import * as CheckoxPrimitive from "@radix-ui/react-checkbox";
|
|
3
3
|
import { cx as cx2 } from "@xjur-ui/util";
|
|
4
4
|
|
|
5
|
-
// src/components/
|
|
6
|
-
import { memo as memo2 } from "react";
|
|
5
|
+
// src/components/icon.tsx
|
|
7
6
|
import { cx } from "@xjur-ui/util";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function Icon({ className, filled = false, name, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
"span",
|
|
11
|
+
{
|
|
12
|
+
...props,
|
|
13
|
+
className: cx(
|
|
14
|
+
"material-symbols-outlined",
|
|
15
|
+
"text-size-body-lg",
|
|
16
|
+
className
|
|
17
|
+
),
|
|
18
|
+
style: {
|
|
19
|
+
fontVariationSettings: `'FILL' ${filled ? 1 : 0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,
|
|
20
|
+
...props.style
|
|
21
|
+
},
|
|
22
|
+
children: name
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
8
26
|
|
|
9
|
-
// src/components/
|
|
27
|
+
// src/components/typography.tsx
|
|
10
28
|
import { Slot } from "@radix-ui/react-slot";
|
|
11
29
|
import { cva } from "@xjur-ui/util";
|
|
12
30
|
import { memo } from "react";
|
|
13
|
-
import { jsx } from "react/jsx-runtime";
|
|
31
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
14
32
|
var typographyVariants = cva("", {
|
|
15
33
|
variants: {
|
|
16
34
|
variant: {
|
|
@@ -71,7 +89,7 @@ var Typography = memo(
|
|
|
71
89
|
...props
|
|
72
90
|
}) => {
|
|
73
91
|
const Component = asChild ? Slot : "span";
|
|
74
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ jsx2(
|
|
75
93
|
Component,
|
|
76
94
|
{
|
|
77
95
|
className: typographyVariants({ variant, size, weight, className }),
|
|
@@ -82,82 +100,54 @@ var Typography = memo(
|
|
|
82
100
|
);
|
|
83
101
|
Typography.displayName = "Typography";
|
|
84
102
|
|
|
85
|
-
// src/components/
|
|
86
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
87
|
-
var InputMessage = memo2(
|
|
88
|
-
({
|
|
89
|
-
children,
|
|
90
|
-
className,
|
|
91
|
-
weight = "normal",
|
|
92
|
-
variant = "body",
|
|
93
|
-
size = "sm-1x",
|
|
94
|
-
...props
|
|
95
|
-
}) => {
|
|
96
|
-
const { errorMessage } = useInput();
|
|
97
|
-
return /* @__PURE__ */ jsx2(
|
|
98
|
-
Typography,
|
|
99
|
-
{
|
|
100
|
-
className: cx(
|
|
101
|
-
"text-neutral-dark data-[error=true]:text-danger-idle",
|
|
102
|
-
className
|
|
103
|
-
),
|
|
104
|
-
"data-error": !!errorMessage,
|
|
105
|
-
size,
|
|
106
|
-
variant,
|
|
107
|
-
weight,
|
|
108
|
-
...props,
|
|
109
|
-
children
|
|
110
|
-
}
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
);
|
|
114
|
-
InputMessage.displayName = "InputMessage";
|
|
115
|
-
|
|
116
|
-
// src/components/ui/input/root.tsx
|
|
103
|
+
// src/components/checkbox.tsx
|
|
117
104
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (!context) {
|
|
122
|
-
throw new Error(
|
|
123
|
-
"useInput must be called within <Input.Root> or <Select.Root>"
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
return context;
|
|
127
|
-
}
|
|
128
|
-
function InputRoot({
|
|
129
|
-
children,
|
|
105
|
+
function Checkbox({
|
|
106
|
+
label,
|
|
107
|
+
name,
|
|
130
108
|
className,
|
|
131
|
-
|
|
132
|
-
size = "lg",
|
|
133
|
-
rounded = false,
|
|
134
|
-
disabled,
|
|
109
|
+
disabled = false,
|
|
135
110
|
...props
|
|
136
111
|
}) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
112
|
+
const fieldId = `field-checkbox-${name}`;
|
|
113
|
+
return /* @__PURE__ */ jsxs("div", { className: "group gap-small flex items-center", children: [
|
|
114
|
+
/* @__PURE__ */ jsx3(
|
|
115
|
+
CheckoxPrimitive.Root,
|
|
116
|
+
{
|
|
117
|
+
disabled,
|
|
118
|
+
...props,
|
|
119
|
+
className: cx2(
|
|
120
|
+
// layout
|
|
121
|
+
"size-large-alt rounded-small-1x inline-flex items-center justify-center transition-[border-color,box-shadow,background-color] duration-200 outline-none",
|
|
122
|
+
// base
|
|
123
|
+
"border-border-layer-2 bg-layer-2-idle cursor-pointer border-2",
|
|
124
|
+
// hover/focus (desmarcado)
|
|
125
|
+
"hover:border-primary-idle focus:border-primary-idle focus:shadow-focus-primary",
|
|
126
|
+
// estado checked
|
|
127
|
+
"data-[state=checked]:bg-primary-active data-[state=checked]:border-primary-active",
|
|
128
|
+
// hover quando estiver checked (opcional)
|
|
129
|
+
"data-[state=checked]:hover:border-primary-idle",
|
|
130
|
+
// disabled
|
|
131
|
+
"disabled:hover:border-border-layer-2 disabled:cursor-not-allowed disabled:opacity-[38%]",
|
|
132
|
+
className
|
|
133
|
+
),
|
|
134
|
+
id: fieldId,
|
|
135
|
+
name,
|
|
136
|
+
children: /* @__PURE__ */ jsx3(CheckoxPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx3(Icon, { className: "text-neutral-label", name: "check" }) })
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
!!label && /* @__PURE__ */ jsx3(
|
|
140
|
+
Typography,
|
|
141
|
+
{
|
|
142
|
+
asChild: true,
|
|
143
|
+
className: "text-size-body-sm data-[disabled=true]:opacity-38",
|
|
144
|
+
"data-disabled": disabled,
|
|
145
|
+
weight: "medium",
|
|
146
|
+
children: /* @__PURE__ */ jsx3("label", { htmlFor: fieldId, children: label })
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
] });
|
|
158
150
|
}
|
|
159
151
|
export {
|
|
160
|
-
|
|
161
|
-
InputRootContext,
|
|
162
|
-
useInput
|
|
152
|
+
Checkbox
|
|
163
153
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
import { AvatarRoot } from './avatar.js';
|
|
8
|
+
import '@radix-ui/react-avatar';
|
|
9
|
+
|
|
10
|
+
declare const chipVariants: (props?: ({
|
|
11
|
+
variant?: "primary" | "neutral" | "danger" | null | undefined;
|
|
12
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
13
|
+
declare function ChipRoot({ className, variant, ...props }: ComponentProps<'div'> & ClassVariantProps<typeof chipVariants>): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare function ChipText({ variant, size, weight, className, ...props }: ComponentProps<typeof Typography>): react_jsx_runtime.JSX.Element;
|
|
15
|
+
declare function ChipIcon({ className, ...props }: ComponentProps<typeof Icon>): react_jsx_runtime.JSX.Element;
|
|
16
|
+
declare function ChipClose({ className, children, ...props }: ComponentProps<'button'> & {
|
|
17
|
+
name?: IconType;
|
|
18
|
+
}): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare function ChipAvatar({ size, avatarFallback, avatarUrl, ...props }: ComponentProps<typeof AvatarRoot> & {
|
|
20
|
+
avatarUrl?: string;
|
|
21
|
+
avatarFallback: string;
|
|
22
|
+
}): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
export { ChipAvatar, ChipClose, ChipIcon, ChipRoot, ChipText };
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
// src/components/chip.tsx
|
|
2
|
+
import { cva as cva2, cx as cx3 } 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/avatar.tsx
|
|
104
|
+
import "react";
|
|
105
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
106
|
+
import { cx as cx2 } from "@xjur-ui/util";
|
|
107
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
108
|
+
function AvatarRoot({
|
|
109
|
+
className,
|
|
110
|
+
size = "md",
|
|
111
|
+
...props
|
|
112
|
+
}) {
|
|
113
|
+
return /* @__PURE__ */ jsx3(
|
|
114
|
+
AvatarPrimitive.Root,
|
|
115
|
+
{
|
|
116
|
+
className: cx2(
|
|
117
|
+
"rounded-circle relative flex shrink-0 overflow-hidden",
|
|
118
|
+
"data-[size=lg]:size-large-8x data-[size=md]:size-large-4x data-[size=sm]:size-large-2x data-[size=xs]:size-large-1x",
|
|
119
|
+
className
|
|
120
|
+
),
|
|
121
|
+
"data-size": size,
|
|
122
|
+
"data-slot": "avatar",
|
|
123
|
+
...props
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
function AvatarImage({
|
|
128
|
+
className,
|
|
129
|
+
...props
|
|
130
|
+
}) {
|
|
131
|
+
return /* @__PURE__ */ jsx3(
|
|
132
|
+
AvatarPrimitive.Image,
|
|
133
|
+
{
|
|
134
|
+
className: cx2("aspect-square size-full", className),
|
|
135
|
+
"data-slot": "avatar-image",
|
|
136
|
+
...props
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
function AvatarFallback({
|
|
141
|
+
className,
|
|
142
|
+
...props
|
|
143
|
+
}) {
|
|
144
|
+
return /* @__PURE__ */ jsx3(
|
|
145
|
+
AvatarPrimitive.Fallback,
|
|
146
|
+
{
|
|
147
|
+
className: cx2(
|
|
148
|
+
"bg-alt-1 rounded-circle flex size-full items-center justify-center font-medium text-white",
|
|
149
|
+
className
|
|
150
|
+
),
|
|
151
|
+
"data-slot": "avatar-fallback",
|
|
152
|
+
...props
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// src/components/chip.tsx
|
|
158
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
159
|
+
var chipVariants = cva2(
|
|
160
|
+
[
|
|
161
|
+
"group/chip relative h-large-2x w-fit rounded-circle px-small py-none flex items-center gap-small_1x-alt",
|
|
162
|
+
"transition-all duration-200"
|
|
163
|
+
],
|
|
164
|
+
{
|
|
165
|
+
variants: {
|
|
166
|
+
variant: {
|
|
167
|
+
primary: "bg-primary-alt-idle text-primary-label-idle hover:bg-primary-alt-hover",
|
|
168
|
+
danger: "bg-danger-alt-idle text-danger-label-idle hover:bg-danger-alt-hover",
|
|
169
|
+
neutral: "bg-layer-1-idle text-neutral-dark hover:bg-layer-1-hover"
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
defaultVariants: {
|
|
173
|
+
variant: "primary"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
function ChipRoot({
|
|
178
|
+
className,
|
|
179
|
+
variant = "primary",
|
|
180
|
+
...props
|
|
181
|
+
}) {
|
|
182
|
+
return /* @__PURE__ */ jsx4("div", { className: cx3(chipVariants({ variant }), className), ...props });
|
|
183
|
+
}
|
|
184
|
+
function ChipText({
|
|
185
|
+
variant = "label",
|
|
186
|
+
size = "sm-1x",
|
|
187
|
+
weight = "medium",
|
|
188
|
+
className,
|
|
189
|
+
...props
|
|
190
|
+
}) {
|
|
191
|
+
return /* @__PURE__ */ jsx4(
|
|
192
|
+
Typography,
|
|
193
|
+
{
|
|
194
|
+
className: cx3(className, "truncate"),
|
|
195
|
+
size,
|
|
196
|
+
variant,
|
|
197
|
+
weight,
|
|
198
|
+
...props
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
function ChipIcon({ className, ...props }) {
|
|
203
|
+
return /* @__PURE__ */ jsx4(
|
|
204
|
+
Icon,
|
|
205
|
+
{
|
|
206
|
+
className: (cx3(
|
|
207
|
+
"text-size-body-md",
|
|
208
|
+
"group-data-[variant=primary]:text-primary-label-idle",
|
|
209
|
+
"group-data-[variant=danger]:text-danger-label-idle",
|
|
210
|
+
"group-data-[variant=neutral]:text-icon-neutral-3"
|
|
211
|
+
), className),
|
|
212
|
+
...props
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
function ChipClose({
|
|
217
|
+
className,
|
|
218
|
+
children = /* @__PURE__ */ jsx4(ChipIcon, { name: "close" }),
|
|
219
|
+
...props
|
|
220
|
+
}) {
|
|
221
|
+
return /* @__PURE__ */ jsx4(
|
|
222
|
+
"button",
|
|
223
|
+
{
|
|
224
|
+
className: cx3(
|
|
225
|
+
className,
|
|
226
|
+
"cursor-pointer bg-inherit",
|
|
227
|
+
"invisible items-center justify-center group-hover/chip:visible",
|
|
228
|
+
"absolute top-0 right-0",
|
|
229
|
+
"h-large-2x w-large-2x rounded-circle",
|
|
230
|
+
"transition-[visibility] duration-200"
|
|
231
|
+
),
|
|
232
|
+
type: "button",
|
|
233
|
+
...props,
|
|
234
|
+
children
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
function ChipAvatar({
|
|
239
|
+
size = "xs",
|
|
240
|
+
avatarFallback = "CN",
|
|
241
|
+
avatarUrl,
|
|
242
|
+
...props
|
|
243
|
+
}) {
|
|
244
|
+
return /* @__PURE__ */ jsxs(AvatarRoot, { size, style: { marginLeft: "-4px" }, ...props, children: [
|
|
245
|
+
avatarUrl && /* @__PURE__ */ jsx4(AvatarImage, { src: avatarUrl }),
|
|
246
|
+
/* @__PURE__ */ jsx4(AvatarFallback, { children: avatarFallback })
|
|
247
|
+
] });
|
|
248
|
+
}
|
|
249
|
+
export {
|
|
250
|
+
ChipAvatar,
|
|
251
|
+
ChipClose,
|
|
252
|
+
ChipIcon,
|
|
253
|
+
ChipRoot,
|
|
254
|
+
ChipText
|
|
255
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
3
|
+
|
|
4
|
+
declare function CollapsibleRoot({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
5
|
+
declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function CollapsibleContent({ className, ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): react_jsx_runtime.JSX.Element;
|
|
7
|
+
|
|
8
|
+
export { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/components/collapsible.tsx
|
|
2
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
3
|
+
import { cx } from "@xjur-ui/util";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function CollapsibleRoot({
|
|
6
|
+
...props
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
|
|
9
|
+
}
|
|
10
|
+
function CollapsibleTrigger2({
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
CollapsiblePrimitive.CollapsibleTrigger,
|
|
15
|
+
{
|
|
16
|
+
"data-slot": "collapsible-trigger",
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function CollapsibleContent2({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
CollapsiblePrimitive.CollapsibleContent,
|
|
27
|
+
{
|
|
28
|
+
className: cx(
|
|
29
|
+
className,
|
|
30
|
+
"data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up"
|
|
31
|
+
),
|
|
32
|
+
"data-slot": "collapsible-content",
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
CollapsibleContent2 as CollapsibleContent,
|
|
39
|
+
CollapsibleRoot,
|
|
40
|
+
CollapsibleTrigger2 as CollapsibleTrigger
|
|
41
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import * as RadixPopover from '@radix-ui/react-popover';
|
|
4
|
+
import { TypographyProps } from './typography.js';
|
|
5
|
+
import 'class-variance-authority/types';
|
|
6
|
+
import '@xjur-ui/util';
|
|
7
|
+
|
|
8
|
+
declare function DatePickerRoot(props: ComponentProps<typeof RadixPopover.Root>): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare function DatePickerTrigger({ className, ...props }: ComponentProps<typeof RadixPopover.Trigger>): react_jsx_runtime.JSX.Element;
|
|
10
|
+
declare function DatePickerContent({ className, sideOffset, side, align, ...props }: ComponentProps<typeof RadixPopover.Content>): react_jsx_runtime.JSX.Element;
|
|
11
|
+
declare function DatePickerValue({ className, displayValue, value, ...props }: ComponentProps<'input'> & {
|
|
12
|
+
displayValue?: string;
|
|
13
|
+
}): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare function DatePickerLabel({ className, htmlFor, children, ...props }: TypographyProps & {
|
|
15
|
+
htmlFor?: string;
|
|
16
|
+
}): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare function DatePickerLeftSlot({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function DatePickerRightSlot({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
20
|
+
export { DatePickerContent, DatePickerLabel, DatePickerLeftSlot, DatePickerRightSlot, DatePickerRoot, DatePickerTrigger, DatePickerValue };
|