@xjur-ui/react 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +61 -57
- package/CHANGELOG.md +11 -0
- package/dist/components/avatar.d.ts +11 -0
- package/dist/components/avatar.js +58 -0
- 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 +230 -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} +18 -5
- package/dist/components/input.d.ts +32 -0
- package/dist/components/input.js +299 -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 +548 -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} +3 -3
- package/dist/components/{ui/typography.js → typography.js} +1 -1
- package/dist/index.css +1156 -62
- package/dist/index.d.ts +2 -17
- package/dist/index.js +0 -788
- package/eslint.config.js +8 -1
- package/package.json +40 -10
- package/src/components/avatar.tsx +53 -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 +154 -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 +241 -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 +234 -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 +14 -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/message.js +0 -128
- 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
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
3
|
-
|
|
4
|
-
type InputContentProps = ComponentProps<'div'> & {
|
|
5
|
-
children: ComponentProps<'div'>['children'];
|
|
6
|
-
};
|
|
7
|
-
declare function InputContent({ className, children, ...props }: InputContentProps): react_jsx_runtime.JSX.Element;
|
|
8
|
-
|
|
9
|
-
export { InputContent, type InputContentProps };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { InputRoot, InputRootContext, InputRootProps, useInput } from './root.js';
|
|
2
|
-
export { InputText, InputTextProps } from './text.js';
|
|
3
|
-
export { InputContent, InputContentProps } from './content.js';
|
|
4
|
-
export { InputSlot, InputSlotProps } from './slot.js';
|
|
5
|
-
export { InputMessage, InputMessageProps } from './message.js';
|
|
6
|
-
export { InputLabel, InputLabelProps } from './label.js';
|
|
7
|
-
import 'react/jsx-runtime';
|
|
8
|
-
import 'react';
|
|
9
|
-
import '@react-input/mask';
|
|
10
|
-
import '../typography.js';
|
|
11
|
-
import 'class-variance-authority/types';
|
|
12
|
-
import '@xjur-ui/util';
|
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
// src/components/ui/input/root.tsx
|
|
2
|
-
import { createContext, use } from "react";
|
|
3
|
-
import { cx as cx2 } from "@xjur-ui/util";
|
|
4
|
-
|
|
5
|
-
// src/components/ui/input/message.tsx
|
|
6
|
-
import { memo as memo2 } from "react";
|
|
7
|
-
import { cx } from "@xjur-ui/util";
|
|
8
|
-
|
|
9
|
-
// src/components/ui/typography.tsx
|
|
10
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
11
|
-
import { cva } from "@xjur-ui/util";
|
|
12
|
-
import { memo } from "react";
|
|
13
|
-
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
var typographyVariants = cva("", {
|
|
15
|
-
variants: {
|
|
16
|
-
variant: {
|
|
17
|
-
body: "",
|
|
18
|
-
label: "",
|
|
19
|
-
title: "",
|
|
20
|
-
headline: ""
|
|
21
|
-
},
|
|
22
|
-
size: {
|
|
23
|
-
"sm-2x": "",
|
|
24
|
-
"sm-1x": "",
|
|
25
|
-
sm: "",
|
|
26
|
-
md: "",
|
|
27
|
-
lg: ""
|
|
28
|
-
},
|
|
29
|
-
weight: {
|
|
30
|
-
thin: "font-thin",
|
|
31
|
-
extraLight: "font-extralight",
|
|
32
|
-
light: "font-light",
|
|
33
|
-
normal: "font-normal",
|
|
34
|
-
medium: "font-medium",
|
|
35
|
-
semibold: "font-semibold",
|
|
36
|
-
bold: "font-bold",
|
|
37
|
-
extraBold: "font-extrabold",
|
|
38
|
-
black: "font-black"
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
compoundVariants: [
|
|
42
|
-
{ variant: "body", size: "sm-1x", class: "text-size-body-sm-1x" },
|
|
43
|
-
{ variant: "body", size: "sm", class: "text-size-body-sm" },
|
|
44
|
-
{ variant: "body", size: "md", class: "text-size-body-md" },
|
|
45
|
-
{ variant: "body", size: "lg", class: "text-size-body-lg" },
|
|
46
|
-
{ variant: "label", size: "sm-2x", class: "text-size-label-sm-2x" },
|
|
47
|
-
{ variant: "label", size: "sm-1x", class: "text-size-label-sm-1x" },
|
|
48
|
-
{ variant: "label", size: "sm", class: "text-size-label-sm" },
|
|
49
|
-
{ variant: "label", size: "md", class: "text-size-label-md" },
|
|
50
|
-
{ variant: "label", size: "lg", class: "text-size-label-lg" },
|
|
51
|
-
{ variant: "title", size: "sm", class: "text-size-title-sm" },
|
|
52
|
-
{ variant: "title", size: "md", class: "text-size-title-md" },
|
|
53
|
-
{ variant: "title", size: "lg", class: "text-size-title-lg" },
|
|
54
|
-
{ variant: "headline", size: "sm", class: "text-size-headline-sm" },
|
|
55
|
-
{ variant: "headline", size: "md", class: "text-size-headline-md" },
|
|
56
|
-
{ variant: "headline", size: "lg", class: "text-size-headline-lg" }
|
|
57
|
-
],
|
|
58
|
-
defaultVariants: {
|
|
59
|
-
variant: "body",
|
|
60
|
-
size: "md",
|
|
61
|
-
weight: "normal"
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
var Typography = memo(
|
|
65
|
-
({
|
|
66
|
-
variant,
|
|
67
|
-
size,
|
|
68
|
-
weight,
|
|
69
|
-
asChild,
|
|
70
|
-
className,
|
|
71
|
-
...props
|
|
72
|
-
}) => {
|
|
73
|
-
const Component = asChild ? Slot : "span";
|
|
74
|
-
return /* @__PURE__ */ jsx(
|
|
75
|
-
Component,
|
|
76
|
-
{
|
|
77
|
-
className: typographyVariants({ variant, size, weight, className }),
|
|
78
|
-
...props
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
Typography.displayName = "Typography";
|
|
84
|
-
|
|
85
|
-
// src/components/ui/input/message.tsx
|
|
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
|
|
117
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
118
|
-
var InputRootContext = createContext({});
|
|
119
|
-
function useInput() {
|
|
120
|
-
const context = use(InputRootContext);
|
|
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,
|
|
130
|
-
className,
|
|
131
|
-
errorMessage,
|
|
132
|
-
size = "lg",
|
|
133
|
-
rounded = false,
|
|
134
|
-
disabled,
|
|
135
|
-
...props
|
|
136
|
-
}) {
|
|
137
|
-
return /* @__PURE__ */ jsx3(
|
|
138
|
-
InputRootContext.Provider,
|
|
139
|
-
{
|
|
140
|
-
value: { errorMessage, disabled, size, rounded },
|
|
141
|
-
children: /* @__PURE__ */ jsxs(
|
|
142
|
-
"div",
|
|
143
|
-
{
|
|
144
|
-
...props,
|
|
145
|
-
className: cx2(
|
|
146
|
-
"group gap-small relative flex flex-col data-[disabled=true]:opacity-60",
|
|
147
|
-
className
|
|
148
|
-
),
|
|
149
|
-
"data-disabled": disabled,
|
|
150
|
-
children: [
|
|
151
|
-
children,
|
|
152
|
-
errorMessage && /* @__PURE__ */ jsx3(InputMessage, { children: errorMessage })
|
|
153
|
-
]
|
|
154
|
-
}
|
|
155
|
-
)
|
|
156
|
-
}
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// src/components/ui/input/text.tsx
|
|
161
|
-
import { InputMask } from "@react-input/mask";
|
|
162
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
163
|
-
import { cx as cx3 } from "@xjur-ui/util";
|
|
164
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
165
|
-
function InputText({
|
|
166
|
-
className,
|
|
167
|
-
value,
|
|
168
|
-
mask,
|
|
169
|
-
...props
|
|
170
|
-
}) {
|
|
171
|
-
const { errorMessage } = useInput();
|
|
172
|
-
const inputRef = useRef(null);
|
|
173
|
-
const InputComponent = mask ? InputMask : "input";
|
|
174
|
-
const onCheckInputFilled = useCallback(
|
|
175
|
-
({ shouldUnfill = false }) => {
|
|
176
|
-
if (inputRef.current) {
|
|
177
|
-
if (shouldUnfill) inputRef.current.dataset.filled = "false";
|
|
178
|
-
else {
|
|
179
|
-
const hasNotErrorAndHasValue = !errorMessage && !!inputRef.current.value;
|
|
180
|
-
inputRef.current.dataset.filled = String(hasNotErrorAndHasValue);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
[errorMessage]
|
|
185
|
-
);
|
|
186
|
-
function setRef(ref) {
|
|
187
|
-
inputRef.current = ref;
|
|
188
|
-
if (typeof props.ref === "function") {
|
|
189
|
-
props.ref(ref);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
useEffect(() => {
|
|
193
|
-
onCheckInputFilled({ shouldUnfill: false });
|
|
194
|
-
}, [onCheckInputFilled]);
|
|
195
|
-
return /* @__PURE__ */ jsx4(
|
|
196
|
-
InputComponent,
|
|
197
|
-
{
|
|
198
|
-
...props,
|
|
199
|
-
...mask && { ...mask },
|
|
200
|
-
className: cx3(
|
|
201
|
-
"h-full w-full bg-transparent",
|
|
202
|
-
"border-hidden outline-hidden",
|
|
203
|
-
"placeholder:text-placeholder-neutral font-normal",
|
|
204
|
-
"text-neutral-dark text-size-body-md overflow-hidden text-ellipsis",
|
|
205
|
-
className
|
|
206
|
-
),
|
|
207
|
-
"data-filled": !!value && !errorMessage,
|
|
208
|
-
readOnly: props.readOnly !== void 0 && props.readOnly,
|
|
209
|
-
ref: setRef,
|
|
210
|
-
value,
|
|
211
|
-
onBlur: (event) => {
|
|
212
|
-
props.onBlur?.(event);
|
|
213
|
-
onCheckInputFilled({ shouldUnfill: false });
|
|
214
|
-
},
|
|
215
|
-
onFocus: (event) => {
|
|
216
|
-
props.onFocus?.(event);
|
|
217
|
-
onCheckInputFilled({ shouldUnfill: true });
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// src/components/ui/input/content.tsx
|
|
224
|
-
import { cx as cx4, cva as cva2 } from "@xjur-ui/util";
|
|
225
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
226
|
-
var variants = cva2(
|
|
227
|
-
[
|
|
228
|
-
"flex items-center gap-small py-small_1x-alt px-small",
|
|
229
|
-
"border-1 border-border-layer-2",
|
|
230
|
-
"bg-layer-2-idle",
|
|
231
|
-
"group-hover:border-border-layer-3",
|
|
232
|
-
"transition-[border-color] duration-100 ease",
|
|
233
|
-
"data-[disabled=true]:pointer-events-none",
|
|
234
|
-
"has-[input[data-filled=true]]:bg-layer-2-hover"
|
|
235
|
-
],
|
|
236
|
-
{
|
|
237
|
-
variants: {
|
|
238
|
-
isError: {
|
|
239
|
-
true: "border-1 border-danger-idle focus-within:border-danger-idle focus-within:shadow-focus-danger group-hover:border-danger-idle",
|
|
240
|
-
false: "focus-within:border-primary-idle focus-within:shadow-focus-primary"
|
|
241
|
-
},
|
|
242
|
-
rounded: {
|
|
243
|
-
true: "rounded-circle",
|
|
244
|
-
false: "rounded-small-1x"
|
|
245
|
-
}
|
|
246
|
-
},
|
|
247
|
-
defaultVariants: {
|
|
248
|
-
rounded: false
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
);
|
|
252
|
-
function InputContent({
|
|
253
|
-
className,
|
|
254
|
-
children,
|
|
255
|
-
...props
|
|
256
|
-
}) {
|
|
257
|
-
const { errorMessage, rounded, disabled } = useInput();
|
|
258
|
-
const classNames = variants({
|
|
259
|
-
className,
|
|
260
|
-
isError: !!errorMessage,
|
|
261
|
-
rounded
|
|
262
|
-
});
|
|
263
|
-
return /* @__PURE__ */ jsx5(
|
|
264
|
-
"div",
|
|
265
|
-
{
|
|
266
|
-
...props,
|
|
267
|
-
className: cx4("group", classNames),
|
|
268
|
-
"data-disabled": disabled,
|
|
269
|
-
children
|
|
270
|
-
}
|
|
271
|
-
);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
// src/components/ui/input/slot.tsx
|
|
275
|
-
import { memo as memo3 } from "react";
|
|
276
|
-
import { cx as cx5 } from "@xjur-ui/util";
|
|
277
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
278
|
-
var InputSlot = memo3(
|
|
279
|
-
({ children, className, ...props }) => {
|
|
280
|
-
return /* @__PURE__ */ jsx6(
|
|
281
|
-
"label",
|
|
282
|
-
{
|
|
283
|
-
...props,
|
|
284
|
-
className: cx5("flex items-center justify-center", className),
|
|
285
|
-
children
|
|
286
|
-
}
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
);
|
|
290
|
-
InputSlot.displayName = "InputSlot";
|
|
291
|
-
|
|
292
|
-
// src/components/ui/input/label.tsx
|
|
293
|
-
import { memo as memo4 } from "react";
|
|
294
|
-
import { cx as cx6 } from "@xjur-ui/util";
|
|
295
|
-
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
296
|
-
var InputLabel = memo4(
|
|
297
|
-
({
|
|
298
|
-
children,
|
|
299
|
-
htmlFor,
|
|
300
|
-
variant = "label",
|
|
301
|
-
weight = "medium",
|
|
302
|
-
size = "sm",
|
|
303
|
-
className,
|
|
304
|
-
...props
|
|
305
|
-
}) => {
|
|
306
|
-
const { errorMessage } = useInput();
|
|
307
|
-
return /* @__PURE__ */ jsx7(
|
|
308
|
-
Typography,
|
|
309
|
-
{
|
|
310
|
-
asChild: true,
|
|
311
|
-
className: cx6(
|
|
312
|
-
"text-title-neutral data-[error=true]:text-danger-label-active w-fit",
|
|
313
|
-
className
|
|
314
|
-
),
|
|
315
|
-
"data-error": !!errorMessage,
|
|
316
|
-
size,
|
|
317
|
-
variant,
|
|
318
|
-
weight,
|
|
319
|
-
...props,
|
|
320
|
-
children: /* @__PURE__ */ jsx7("label", { htmlFor, children })
|
|
321
|
-
}
|
|
322
|
-
);
|
|
323
|
-
}
|
|
324
|
-
);
|
|
325
|
-
InputLabel.displayName = "InputLabel";
|
|
326
|
-
export {
|
|
327
|
-
InputContent,
|
|
328
|
-
InputLabel,
|
|
329
|
-
InputMessage,
|
|
330
|
-
InputRoot,
|
|
331
|
-
InputRootContext,
|
|
332
|
-
InputSlot,
|
|
333
|
-
InputText,
|
|
334
|
-
useInput
|
|
335
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { TypographyProps } from '../typography.js';
|
|
4
|
-
import 'class-variance-authority/types';
|
|
5
|
-
import '@xjur-ui/util';
|
|
6
|
-
|
|
7
|
-
type InputLabelProps = TypographyProps & {
|
|
8
|
-
htmlFor?: string;
|
|
9
|
-
};
|
|
10
|
-
declare const InputLabel: react.MemoExoticComponent<({ children, htmlFor, variant, weight, size, className, ...props }: InputLabelProps) => react_jsx_runtime.JSX.Element>;
|
|
11
|
-
|
|
12
|
-
export { InputLabel, type InputLabelProps };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { TypographyProps } from '../typography.js';
|
|
4
|
-
import 'class-variance-authority/types';
|
|
5
|
-
import '@xjur-ui/util';
|
|
6
|
-
|
|
7
|
-
type InputMessageProps = TypographyProps;
|
|
8
|
-
declare const InputMessage: react.MemoExoticComponent<({ children, className, weight, variant, size, ...props }: InputMessageProps) => react_jsx_runtime.JSX.Element>;
|
|
9
|
-
|
|
10
|
-
export { InputMessage, type InputMessageProps };
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
// src/components/ui/input/message.tsx
|
|
2
|
-
import { memo as memo2 } from "react";
|
|
3
|
-
import { cx as cx2 } from "@xjur-ui/util";
|
|
4
|
-
|
|
5
|
-
// src/components/ui/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/ui/input/root.tsx
|
|
82
|
-
import { createContext, use } from "react";
|
|
83
|
-
import { cx } from "@xjur-ui/util";
|
|
84
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
85
|
-
var InputRootContext = createContext({});
|
|
86
|
-
function useInput() {
|
|
87
|
-
const context = use(InputRootContext);
|
|
88
|
-
if (!context) {
|
|
89
|
-
throw new Error(
|
|
90
|
-
"useInput must be called within <Input.Root> or <Select.Root>"
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
return context;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// src/components/ui/input/message.tsx
|
|
97
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
98
|
-
var InputMessage = memo2(
|
|
99
|
-
({
|
|
100
|
-
children,
|
|
101
|
-
className,
|
|
102
|
-
weight = "normal",
|
|
103
|
-
variant = "body",
|
|
104
|
-
size = "sm-1x",
|
|
105
|
-
...props
|
|
106
|
-
}) => {
|
|
107
|
-
const { errorMessage } = useInput();
|
|
108
|
-
return /* @__PURE__ */ jsx3(
|
|
109
|
-
Typography,
|
|
110
|
-
{
|
|
111
|
-
className: cx2(
|
|
112
|
-
"text-neutral-dark data-[error=true]:text-danger-idle",
|
|
113
|
-
className
|
|
114
|
-
),
|
|
115
|
-
"data-error": !!errorMessage,
|
|
116
|
-
size,
|
|
117
|
-
variant,
|
|
118
|
-
weight,
|
|
119
|
-
...props,
|
|
120
|
-
children
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
InputMessage.displayName = "InputMessage";
|
|
126
|
-
export {
|
|
127
|
-
InputMessage
|
|
128
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as react from 'react';
|
|
3
|
-
import { ComponentProps } from 'react';
|
|
4
|
-
|
|
5
|
-
declare const InputRootContext: react.Context<InputRoot>;
|
|
6
|
-
declare function useInput(): InputRoot;
|
|
7
|
-
type InputRootProps = ComponentProps<'div'> & {
|
|
8
|
-
children: ComponentProps<'div'>['children'];
|
|
9
|
-
} & InputRoot;
|
|
10
|
-
type InputRoot = {
|
|
11
|
-
size?: 'md' | 'lg';
|
|
12
|
-
rounded?: boolean;
|
|
13
|
-
errorMessage?: string;
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
};
|
|
16
|
-
declare function InputRoot({ children, className, errorMessage, size, rounded, disabled, ...props }: InputRootProps): react_jsx_runtime.JSX.Element;
|
|
17
|
-
|
|
18
|
-
export { InputRoot, InputRootContext, type InputRootProps, useInput };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
type InputSlotProps = ComponentProps<'label'> & {
|
|
6
|
-
children: ComponentProps<'label'>['children'];
|
|
7
|
-
};
|
|
8
|
-
declare const InputSlot: react.MemoExoticComponent<({ children, className, ...props }: InputSlotProps) => react_jsx_runtime.JSX.Element>;
|
|
9
|
-
|
|
10
|
-
export { InputSlot, type InputSlotProps };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// src/components/ui/input/slot.tsx
|
|
2
|
-
import { memo } from "react";
|
|
3
|
-
import { cx } from "@xjur-ui/util";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
var InputSlot = memo(
|
|
6
|
-
({ children, className, ...props }) => {
|
|
7
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
-
"label",
|
|
9
|
-
{
|
|
10
|
-
...props,
|
|
11
|
-
className: cx("flex items-center justify-center", className),
|
|
12
|
-
children
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
}
|
|
16
|
-
);
|
|
17
|
-
InputSlot.displayName = "InputSlot";
|
|
18
|
-
export {
|
|
19
|
-
InputSlot
|
|
20
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { MaskOptions } from '@react-input/mask';
|
|
3
|
-
import { ComponentProps } from 'react';
|
|
4
|
-
|
|
5
|
-
type InputTextProps = ComponentProps<'input'> & {
|
|
6
|
-
mask?: MaskOptions;
|
|
7
|
-
};
|
|
8
|
-
declare function InputText({ className, value, mask, ...props }: InputTextProps): react_jsx_runtime.JSX.Element;
|
|
9
|
-
|
|
10
|
-
export { InputText, type InputTextProps };
|