@xjur-ui/react 1.0.2 → 1.0.4

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.
Files changed (42) hide show
  1. package/.turbo/turbo-build.log +26 -16
  2. package/CHANGELOG.md +20 -0
  3. package/dist/components/avatar-group.d.ts +34 -0
  4. package/dist/components/avatar-group.js +179 -0
  5. package/dist/components/avatar.js +1 -0
  6. package/dist/components/chip.js +1 -0
  7. package/dist/components/date-picker.js +1 -1
  8. package/dist/components/divider.js +2 -1
  9. package/dist/components/dropdown-menu.js +3 -2
  10. package/dist/components/icon.d.ts +1 -1
  11. package/dist/components/icon.js +5 -1
  12. package/dist/components/input.js +1 -1
  13. package/dist/components/otp-input.js +1 -1
  14. package/dist/components/rich-editor.d.ts +25 -0
  15. package/dist/components/rich-editor.js +723 -0
  16. package/dist/components/search-input.js +1 -1
  17. package/dist/components/select.js +2 -2
  18. package/dist/components/skeleton.d.ts +6 -0
  19. package/dist/components/skeleton.js +16 -0
  20. package/dist/components/table.d.ts +17 -0
  21. package/dist/components/table.js +196 -0
  22. package/dist/components/tooltip.d.ts +11 -0
  23. package/dist/components/tooltip.js +58 -0
  24. package/dist/components/typography.d.ts +1 -1
  25. package/dist/index.css +401 -23
  26. package/package.json +14 -2
  27. package/src/components/avatar-group.tsx +76 -0
  28. package/src/components/avatar.tsx +1 -0
  29. package/src/components/date-picker.tsx +1 -1
  30. package/src/components/divider.tsx +2 -1
  31. package/src/components/dropdown-menu.tsx +1 -1
  32. package/src/components/input.tsx +1 -1
  33. package/src/components/otp-input.tsx +1 -1
  34. package/src/components/rich-editor.tsx +371 -0
  35. package/src/components/search-input.tsx +1 -2
  36. package/src/components/select.tsx +1 -1
  37. package/src/components/skeleton.tsx +12 -0
  38. package/src/components/table.tsx +160 -0
  39. package/src/components/tooltip.tsx +63 -0
  40. package/src/hooks/index.ts +1 -0
  41. package/src/hooks/use-os.ts +32 -0
  42. 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 focus-within:shadow-focus-primary",
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 focus-within:shadow-focus-primary",
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 data-[state=open]:shadow-focus-primary",
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,6 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ComponentProps } from 'react';
3
+
4
+ declare function Skeleton({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
5
+
6
+ export { Skeleton };
@@ -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,17 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function Table({ className, ...props }: React.ComponentProps<'table'>): react_jsx_runtime.JSX.Element;
4
+ declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): react_jsx_runtime.JSX.Element;
5
+ declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): react_jsx_runtime.JSX.Element;
6
+ declare function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>): react_jsx_runtime.JSX.Element;
7
+ declare function TableRow({ className, isSelected, ...props }: React.ComponentProps<'tr'> & {
8
+ isSelected?: boolean;
9
+ }): react_jsx_runtime.JSX.Element;
10
+ declare function TableHead({ className, ...props }: React.ComponentProps<'th'>): react_jsx_runtime.JSX.Element;
11
+ declare function TableHeadContent({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
12
+ declare function TableSort({ className, sortedDirection, ...props }: React.ComponentProps<'button'> & {
13
+ sortedDirection?: 'asc' | 'desc';
14
+ }): react_jsx_runtime.JSX.Element;
15
+ declare function TableCell({ className, ...props }: React.ComponentProps<'td'>): react_jsx_runtime.JSX.Element;
16
+
17
+ export { Table, TableBody, TableCell, TableFooter, TableHead, TableHeadContent, TableHeader, TableRow, TableSort };
@@ -0,0 +1,196 @@
1
+ // src/components/table.tsx
2
+ import { cx as cx2 } from "@xjur-ui/util";
3
+
4
+ // src/components/icon.tsx
5
+ import { cx } from "@xjur-ui/util";
6
+ import { jsx } from "react/jsx-runtime";
7
+ function Icon({ className, filled = false, name, ...props }) {
8
+ return /* @__PURE__ */ jsx(
9
+ "span",
10
+ {
11
+ ...props,
12
+ className: cx(
13
+ "material-symbols-outlined",
14
+ "text-size-body-lg",
15
+ className
16
+ ),
17
+ style: {
18
+ fontVariationSettings: `'FILL' ${filled ? 1 : 0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,
19
+ ...props.style
20
+ },
21
+ children: name
22
+ }
23
+ );
24
+ }
25
+
26
+ // src/components/table.tsx
27
+ import { jsx as jsx2 } from "react/jsx-runtime";
28
+ function Table({ className, ...props }) {
29
+ return /* @__PURE__ */ jsx2(
30
+ "div",
31
+ {
32
+ className: "text-size-body-md scrollbar-thin relative w-full overflow-hidden transition-all hover:overflow-x-auto",
33
+ "data-slot": "table-container",
34
+ children: /* @__PURE__ */ jsx2(
35
+ "table",
36
+ {
37
+ className: cx2("w-full caption-bottom", className),
38
+ "data-slot": "table",
39
+ ...props
40
+ }
41
+ )
42
+ }
43
+ );
44
+ }
45
+ function TableHeader({
46
+ className,
47
+ ...props
48
+ }) {
49
+ return /* @__PURE__ */ jsx2(
50
+ "thead",
51
+ {
52
+ className: cx2(
53
+ "group/table-header [&_tr]:border-border-layer-2 hover:bg-layer-2-hover [&_tr]:border-b",
54
+ className
55
+ ),
56
+ "data-slot": "table-header",
57
+ ...props
58
+ }
59
+ );
60
+ }
61
+ function TableBody({
62
+ className,
63
+ ...props
64
+ }) {
65
+ return /* @__PURE__ */ jsx2(
66
+ "tbody",
67
+ {
68
+ className: cx2(
69
+ "[&_tr]:border-border-layer-2 [&_tr]:border-b [&_tr:last-child]:border-0",
70
+ className
71
+ ),
72
+ "data-slot": "table-body",
73
+ ...props
74
+ }
75
+ );
76
+ }
77
+ function TableFooter({
78
+ className,
79
+ ...props
80
+ }) {
81
+ return /* @__PURE__ */ jsx2(
82
+ "tfoot",
83
+ {
84
+ className: cx2(
85
+ "border-border-layer-2 border-t font-medium [&>tr]:last:border-b-0",
86
+ className
87
+ ),
88
+ "data-slot": "table-footer",
89
+ ...props
90
+ }
91
+ );
92
+ }
93
+ function TableRow({
94
+ className,
95
+ isSelected = false,
96
+ ...props
97
+ }) {
98
+ return /* @__PURE__ */ jsx2(
99
+ "tr",
100
+ {
101
+ className: cx2(
102
+ "bg-layer-2-idle hover:bg-layer-2-hover ease border-b transition-colors duration-100",
103
+ "active:bg-layer-2-pressed",
104
+ "data-[selected=true]:bg-primary-alt-active",
105
+ className
106
+ ),
107
+ "data-selected": isSelected,
108
+ "data-slot": "table-row",
109
+ ...props
110
+ }
111
+ );
112
+ }
113
+ function TableHead({ className, ...props }) {
114
+ return /* @__PURE__ */ jsx2(
115
+ "th",
116
+ {
117
+ className: cx2(
118
+ "group/th text-neutral-placeholder text-size-label-sm h-large-4x py-small-1x px-small text-left align-middle font-medium whitespace-nowrap",
119
+ "pr-large-2x relative",
120
+ "animate-in fade-in duration-200 ease-in",
121
+ className
122
+ ),
123
+ "data-slot": "table-head",
124
+ ...props
125
+ }
126
+ );
127
+ }
128
+ function TableHeadContent({
129
+ className,
130
+ ...props
131
+ }) {
132
+ return /* @__PURE__ */ jsx2(
133
+ "div",
134
+ {
135
+ className: cx2(
136
+ "gap-small pr-large-3x relative flex w-fit items-center",
137
+ className
138
+ ),
139
+ ...props
140
+ }
141
+ );
142
+ }
143
+ function TableSort({
144
+ className,
145
+ sortedDirection,
146
+ ...props
147
+ }) {
148
+ return /* @__PURE__ */ jsx2(
149
+ "button",
150
+ {
151
+ className: cx2(
152
+ "size-large-1x rounded-small-1x",
153
+ "flex cursor-pointer items-center justify-center",
154
+ "hidden group-hover/th:flex",
155
+ "data-[sorted=true]:flex",
156
+ "transition-all duration-200 ease-out",
157
+ "data-[sorted=true]:bg-primary-alt-active data-[sorted=true]:text-primary-label-active",
158
+ "absolute top-1/2 right-0 -translate-y-1/2",
159
+ className
160
+ ),
161
+ "data-sorted": sortedDirection !== void 0,
162
+ type: "button",
163
+ ...props,
164
+ children: sortedDirection !== void 0 ? /* @__PURE__ */ jsx2(
165
+ Icon,
166
+ {
167
+ name: sortedDirection === "asc" ? "arrow_downward" : "arrow_upward"
168
+ }
169
+ ) : /* @__PURE__ */ jsx2(Icon, { name: "swap_vert" })
170
+ }
171
+ );
172
+ }
173
+ function TableCell({ className, ...props }) {
174
+ return /* @__PURE__ */ jsx2(
175
+ "td",
176
+ {
177
+ className: cx2(
178
+ "px-small py-none h-large-8x text-left align-middle whitespace-nowrap",
179
+ className
180
+ ),
181
+ "data-slot": "table-cell",
182
+ ...props
183
+ }
184
+ );
185
+ }
186
+ export {
187
+ Table,
188
+ TableBody,
189
+ TableCell,
190
+ TableFooter,
191
+ TableHead,
192
+ TableHeadContent,
193
+ TableHeader,
194
+ TableRow,
195
+ TableSort
196
+ };
@@ -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
+ };
@@ -5,7 +5,7 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
5
5
  import { ClassVariantProps } from '@xjur-ui/util';
6
6
 
7
7
  declare const typographyVariants: (props?: ({
8
- variant?: "body" | "label" | "title" | "headline" | null | undefined;
8
+ variant?: "label" | "body" | "title" | "headline" | null | undefined;
9
9
  size?: "sm" | "md" | "lg" | "sm-2x" | "sm-1x" | null | undefined;
10
10
  weight?: "bold" | "thin" | "extraLight" | "light" | "normal" | "medium" | "semibold" | "extraBold" | "black" | null | undefined;
11
11
  } & class_variance_authority_types.ClassProp) | undefined) => string;