@xjur-ui/react 1.0.1 → 1.0.3

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.
@@ -371,7 +371,7 @@ function SelectContent({
371
371
  align,
372
372
  className: cx5(
373
373
  className,
374
- "group z-10 max-h-[var(--radix-popover-content-available-height)] w-[var(--radix-popover-trigger-width)]"
374
+ "group z-10 max-h-[var(--radix-popover-content-available-height)] max-w-[var(--radix-popover-content-available-width)] min-w-[var(--radix-popover-trigger-width)]"
375
375
  ),
376
376
  side,
377
377
  sideOffset,
@@ -411,7 +411,7 @@ function SelectMultiValue({
411
411
  {
412
412
  className: cx5(
413
413
  className,
414
- "gap-small-1x scrollbar-hide group-has-[div[data-slot=select-left-slot]]:pl-large-1x flex overflow-x-auto"
414
+ "gap-small-1x scrollbar-hide group-has-[div[data-slot=select-left-slot]]:pl-large-1x overflow-x-small flex"
415
415
  ),
416
416
  ...props,
417
417
  children: [
@@ -442,25 +442,27 @@ function SelectLabel({
442
442
  {
443
443
  asChild: true,
444
444
  className: cx5(
445
- "bg-layer-2-idle w-fit font-normal",
446
- "pointer-events-none absolute top-1/2 left-auto -translate-y-1/2",
445
+ "inline-block max-w-full truncate text-left font-normal",
446
+ "left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2",
447
447
  "ease transition-all duration-250",
448
448
  // Content Open
449
449
  "group-data-[state=open]:text-primary-idle",
450
- "group-data-[state=open]:bg-layer-2-idle",
451
450
  "group-data-[state=open]:-top-[3px]",
452
451
  "group-data-[state=open]:text-size-label-sm-1x",
453
452
  "group-data-[state=open]:font-medium",
454
453
  // Filled
455
454
  "group-has-[input:not(:placeholder-shown)]:text-primary-idle",
456
- "group-has-[input:not(:placeholder-shown)]:bg-layer-2-idle",
457
455
  "group-has-[input:not(:placeholder-shown)]:-top-[3px]",
458
456
  "group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x",
459
457
  "group-has-[input:not(:placeholder-shown)]:font-medium",
460
458
  // If has left slot
461
459
  "group-has-[div[data-slot=select-left-slot]]:left-large-4x",
462
- "group-has-[div[data-slot=select-left-slot]]:group-data-[state=open]:left-auto",
463
- "group-has-[div[data-slot=select-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-auto",
460
+ "group-has-[div[data-slot=select-left-slot]]:group-data-[state=open]:left-small",
461
+ "group-has-[div[data-slot=select-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small",
462
+ // If has right slot
463
+ "group-has-[div[data-slot=select-right-slot]]:right-large-4x",
464
+ "group-has-[div[data-slot=select-right-slot]]:group-data-[state=open]:right-small",
465
+ "group-has-[div[data-slot=select-right-slot]]:group-has-[input:not(:placeholder-shown)]:right-small",
464
466
  // Animate
465
467
  "group-data-[state=open]:animate-in",
466
468
  "group-data-[state=closed]:animate-out",
@@ -469,7 +471,7 @@ function SelectLabel({
469
471
  ),
470
472
  weight: "medium",
471
473
  ...props,
472
- children: /* @__PURE__ */ jsx6("label", { htmlFor, children })
474
+ children: /* @__PURE__ */ jsx6("label", { htmlFor, children: /* @__PURE__ */ jsx6("span", { className: "bg-layer-2-idle rounded-small-1x max-w-full", children }) })
473
475
  }
474
476
  );
475
477
  }
@@ -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
+ };
@@ -6,7 +6,7 @@ import { Typography } from './typography.js';
6
6
  import { Icon, IconType } from './icon.js';
7
7
 
8
8
  declare const tagVariants: (props?: ({
9
- variant?: "primary" | "danger" | "neutral" | null | undefined;
9
+ variant?: "primary" | "neutral" | "danger" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
11
  declare function TagRoot({ className, variant, ...props }: ComponentProps<'div'> & ClassVariantProps<typeof tagVariants>): react_jsx_runtime.JSX.Element;
12
12
  declare function TagText({ variant, size, weight, className, ...props }: ComponentProps<typeof Typography>): react_jsx_runtime.JSX.Element;
@@ -5,9 +5,9 @@ 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
- weight?: "bold" | "normal" | "black" | "medium" | "thin" | "light" | "extraLight" | "semibold" | "extraBold" | 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;