@xjur-ui/react 1.0.3 → 1.0.6
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 +32 -22
- package/CHANGELOG.md +20 -0
- package/dist/components/date-picker.js +1 -1
- package/dist/components/divider.js +2 -1
- package/dist/components/dropdown-menu.js +3 -2
- package/dist/components/icon.d.ts +1 -1
- package/dist/components/icon.js +5 -1
- package/dist/components/input.js +1 -1
- package/dist/components/otp-input.js +1 -1
- package/dist/components/rich-editor.d.ts +25 -0
- package/dist/components/rich-editor.js +723 -0
- package/dist/components/search-input.js +1 -1
- package/dist/components/select.js +2 -2
- package/dist/components/skeleton.d.ts +6 -0
- package/dist/components/skeleton.js +16 -0
- package/dist/components/status.d.ts +14 -0
- package/dist/components/status.js +111 -0
- package/dist/components/test.d.ts +5 -0
- package/dist/components/test.js +8 -0
- package/dist/components/tooltip.d.ts +11 -0
- package/dist/components/tooltip.js +58 -0
- package/dist/index.css +251 -25
- package/package.json +14 -2
- package/src/components/date-picker.tsx +1 -1
- package/src/components/divider.tsx +2 -1
- package/src/components/dropdown-menu.tsx +1 -1
- package/src/components/input.tsx +1 -1
- package/src/components/otp-input.tsx +1 -1
- package/src/components/rich-editor.tsx +371 -0
- package/src/components/search-input.tsx +1 -2
- package/src/components/select.tsx +1 -1
- package/src/components/skeleton.tsx +12 -0
- package/src/components/status.tsx +43 -0
- package/src/components/test.tsx +3 -0
- package/src/components/tooltip.tsx +63 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-os.ts +32 -0
- package/src/resources/icons.ts +5 -1
|
@@ -201,7 +201,7 @@ function SearchInputContent({
|
|
|
201
201
|
{
|
|
202
202
|
variants: {
|
|
203
203
|
variant: {
|
|
204
|
-
outlined: "rounded-circle focus-within:border-primary-idle
|
|
204
|
+
outlined: "rounded-circle focus-within:border-primary-idle ",
|
|
205
205
|
line: "rounded-none border-t-0 border-b-1 border-x-0",
|
|
206
206
|
action: "rounded-tr-none rounded-br-none border-r-0"
|
|
207
207
|
}
|
|
@@ -285,7 +285,7 @@ function SearchInputContent({
|
|
|
285
285
|
{
|
|
286
286
|
variants: {
|
|
287
287
|
variant: {
|
|
288
|
-
outlined: "rounded-circle focus-within:border-primary-idle
|
|
288
|
+
outlined: "rounded-circle focus-within:border-primary-idle ",
|
|
289
289
|
line: "rounded-none border-t-0 border-b-1 border-x-0",
|
|
290
290
|
action: "rounded-tr-none rounded-br-none border-r-0"
|
|
291
291
|
}
|
|
@@ -349,7 +349,7 @@ function SelectTrigger({
|
|
|
349
349
|
className,
|
|
350
350
|
"group h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small relative flex w-full cursor-pointer items-center",
|
|
351
351
|
"bg-layer-2-idle border-border-layer-2 hover:border-border-layer-3 border",
|
|
352
|
-
"data-[state=open]:border-primary-idle
|
|
352
|
+
"data-[state=open]:border-primary-idle",
|
|
353
353
|
"has-[input:not(:placeholder-shown)]:text-primary-idle",
|
|
354
354
|
"has-[input:not(:placeholder-shown)]:border-primary-idle"
|
|
355
355
|
),
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/components/skeleton.tsx
|
|
2
|
+
import { cx } from "@xjur-ui/util";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
function Skeleton({ className, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: cx("bg-layer-skeleton animate-pulse", className),
|
|
9
|
+
"data-slot": "skeleton",
|
|
10
|
+
...props
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
Skeleton
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
import { ClassVariantProps } from '@xjur-ui/util';
|
|
5
|
+
|
|
6
|
+
declare const statusVariants: (props?: ({
|
|
7
|
+
variant?: "neutral" | "success" | "warning" | "danger" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
interface StatusProps extends ComponentProps<'div'>, ClassVariantProps<typeof statusVariants> {
|
|
10
|
+
text?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function Status({ text, variant, className, ...props }: StatusProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { Status, type StatusProps, statusVariants };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// src/components/status.tsx
|
|
2
|
+
import { cva as cva2, cx } from "@xjur-ui/util";
|
|
3
|
+
|
|
4
|
+
// src/components/typography.tsx
|
|
5
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
+
import { cva } from "@xjur-ui/util";
|
|
7
|
+
import { memo } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var typographyVariants = cva("", {
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
body: "",
|
|
13
|
+
label: "",
|
|
14
|
+
title: "",
|
|
15
|
+
headline: ""
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
"sm-2x": "",
|
|
19
|
+
"sm-1x": "",
|
|
20
|
+
sm: "",
|
|
21
|
+
md: "",
|
|
22
|
+
lg: ""
|
|
23
|
+
},
|
|
24
|
+
weight: {
|
|
25
|
+
thin: "font-thin",
|
|
26
|
+
extraLight: "font-extralight",
|
|
27
|
+
light: "font-light",
|
|
28
|
+
normal: "font-normal",
|
|
29
|
+
medium: "font-medium",
|
|
30
|
+
semibold: "font-semibold",
|
|
31
|
+
bold: "font-bold",
|
|
32
|
+
extraBold: "font-extrabold",
|
|
33
|
+
black: "font-black"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
compoundVariants: [
|
|
37
|
+
{ variant: "body", size: "sm-1x", class: "text-size-body-sm-1x" },
|
|
38
|
+
{ variant: "body", size: "sm", class: "text-size-body-sm" },
|
|
39
|
+
{ variant: "body", size: "md", class: "text-size-body-md" },
|
|
40
|
+
{ variant: "body", size: "lg", class: "text-size-body-lg" },
|
|
41
|
+
{ variant: "label", size: "sm-2x", class: "text-size-label-sm-2x" },
|
|
42
|
+
{ variant: "label", size: "sm-1x", class: "text-size-label-sm-1x" },
|
|
43
|
+
{ variant: "label", size: "sm", class: "text-size-label-sm" },
|
|
44
|
+
{ variant: "label", size: "md", class: "text-size-label-md" },
|
|
45
|
+
{ variant: "label", size: "lg", class: "text-size-label-lg" },
|
|
46
|
+
{ variant: "title", size: "sm", class: "text-size-title-sm" },
|
|
47
|
+
{ variant: "title", size: "md", class: "text-size-title-md" },
|
|
48
|
+
{ variant: "title", size: "lg", class: "text-size-title-lg" },
|
|
49
|
+
{ variant: "headline", size: "sm", class: "text-size-headline-sm" },
|
|
50
|
+
{ variant: "headline", size: "md", class: "text-size-headline-md" },
|
|
51
|
+
{ variant: "headline", size: "lg", class: "text-size-headline-lg" }
|
|
52
|
+
],
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
variant: "body",
|
|
55
|
+
size: "md",
|
|
56
|
+
weight: "normal"
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
var Typography = memo(
|
|
60
|
+
({
|
|
61
|
+
variant,
|
|
62
|
+
size,
|
|
63
|
+
weight,
|
|
64
|
+
asChild,
|
|
65
|
+
className,
|
|
66
|
+
...props
|
|
67
|
+
}) => {
|
|
68
|
+
const Component = asChild ? Slot : "span";
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
Component,
|
|
71
|
+
{
|
|
72
|
+
className: typographyVariants({ variant, size, weight, className }),
|
|
73
|
+
...props
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
Typography.displayName = "Typography";
|
|
79
|
+
|
|
80
|
+
// src/components/status.tsx
|
|
81
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
82
|
+
var statusVariants = cva2(
|
|
83
|
+
[
|
|
84
|
+
"inline-flex items-center justify-center px-small py-small-1x rounded-small-1x text-label-sm font-medium text-neutral-label h-large-2x"
|
|
85
|
+
],
|
|
86
|
+
{
|
|
87
|
+
variants: {
|
|
88
|
+
variant: {
|
|
89
|
+
success: "bg-success-idle",
|
|
90
|
+
warning: "bg-warning-idle",
|
|
91
|
+
danger: "bg-danger-idle",
|
|
92
|
+
neutral: "bg-alt-3"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
defaultVariants: {
|
|
96
|
+
variant: "neutral"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
);
|
|
100
|
+
function Status({
|
|
101
|
+
text = "Status",
|
|
102
|
+
variant = "neutral",
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}) {
|
|
106
|
+
return /* @__PURE__ */ jsx2("div", { className: cx(statusVariants({ variant }), className), ...props, children: /* @__PURE__ */ jsx2(Typography, { size: "sm", variant: "label", weight: "medium", children: text }) });
|
|
107
|
+
}
|
|
108
|
+
export {
|
|
109
|
+
Status,
|
|
110
|
+
statusVariants
|
|
111
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
|
|
4
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): react_jsx_runtime.JSX.Element;
|
|
5
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
7
|
+
declare function TooltipContent({ className, sideOffset, variant, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content> & {
|
|
8
|
+
variant?: 'simple' | 'rich';
|
|
9
|
+
}): react_jsx_runtime.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// src/components/tooltip.tsx
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
+
import { cx } from "@xjur-ui/util";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function TooltipProvider({
|
|
6
|
+
delayDuration = 0,
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
TooltipPrimitive.Provider,
|
|
11
|
+
{
|
|
12
|
+
"data-slot": "tooltip-provider",
|
|
13
|
+
delayDuration,
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function Tooltip({
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
22
|
+
}
|
|
23
|
+
function TooltipTrigger({
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
27
|
+
}
|
|
28
|
+
function TooltipContent({
|
|
29
|
+
className,
|
|
30
|
+
sideOffset = 1,
|
|
31
|
+
variant = "simple",
|
|
32
|
+
children,
|
|
33
|
+
...props
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
36
|
+
TooltipPrimitive.Content,
|
|
37
|
+
{
|
|
38
|
+
className: cx(
|
|
39
|
+
"text-size-body-sm text-balance",
|
|
40
|
+
"data-[variant=simple]:bg-alt-2 data-[variant=simple]:text-neutral-label data-[variant=simple]:rounded-small-1x data-[variant=simple]:px-small data-[variant=simple]:py-small-1x",
|
|
41
|
+
"data-[variant=rich]:bg-layer-2-idle data-[variant=rich]:text-neutral-dark data-[variant=rich]:rounded-small data-[variant=rich]:border-border-layer-2 data-[variant=rich]:p-large data-[variant=rich]:border",
|
|
42
|
+
"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin)",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
"data-slot": "tooltip-content",
|
|
46
|
+
"data-variant": variant,
|
|
47
|
+
sideOffset,
|
|
48
|
+
...props,
|
|
49
|
+
children
|
|
50
|
+
}
|
|
51
|
+
) });
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
Tooltip,
|
|
55
|
+
TooltipContent,
|
|
56
|
+
TooltipProvider,
|
|
57
|
+
TooltipTrigger
|
|
58
|
+
};
|