asheeui 0.6.14 → 0.7.0
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/README.md +1 -14
- package/dist/AsheeUIProvider.js +22 -24
- package/dist/components/accordion/Accordion.js +79 -173
- package/dist/components/accordion/accordion-config.js +12 -13
- package/dist/components/accordion/accordion-styles.js +21 -24
- package/dist/components/autocomplete/Autocomplete.js +78 -136
- package/dist/components/autocomplete/autocomplete-config.js +7 -12
- package/dist/components/button/Button.d.ts +29 -1
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +47 -108
- package/dist/components/button/button-config.js +16 -17
- package/dist/components/button/button-styles.js +10 -11
- package/dist/components/card/Card.d.ts +36 -16
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +115 -205
- package/dist/components/card/card-config.js +24 -21
- package/dist/components/card/card-styles.js +19 -22
- package/dist/components/carousel/Carousel.js +123 -248
- package/dist/components/carousel/carousel-config.js +24 -25
- package/dist/components/carousel/carousel-styles.js +14 -16
- package/dist/components/chip/Chip.js +84 -191
- package/dist/components/chip/chip-config.js +13 -14
- package/dist/components/chip/chip-styles.js +22 -26
- package/dist/components/date-picker/Calendar.d.ts +3 -3
- package/dist/components/date-picker/Calendar.d.ts.map +1 -1
- package/dist/components/date-picker/Calendar.js +141 -222
- package/dist/components/date-picker/DatePicker.d.ts +5 -5
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +122 -220
- package/dist/components/date-picker/TimeSpinner.js +58 -82
- package/dist/components/date-picker/date-picker-config.d.ts +4 -4
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +10 -11
- package/dist/components/date-picker/date-picker-styles.js +44 -45
- package/dist/components/date-picker/date-picker.helpers.d.ts +4 -4
- package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker.helpers.js +74 -102
- package/dist/components/drawer/Drawer.d.ts +26 -8
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +54 -131
- package/dist/components/drawer/drawer-config.js +14 -15
- package/dist/components/drawer/drawer-styles.js +38 -42
- package/dist/components/field/FieldShell.js +49 -56
- package/dist/components/field/field-config.js +17 -18
- package/dist/components/field/field-styles.js +8 -8
- package/dist/components/image/Image.d.ts +7 -7
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +65 -132
- package/dist/components/image/image-config.js +17 -18
- package/dist/components/image/image-styles.js +14 -15
- package/dist/components/input/Input.js +65 -150
- package/dist/components/input/PasswordInput.js +30 -49
- package/dist/components/input/input-config.js +7 -7
- package/dist/components/input/input-styles.js +9 -10
- package/dist/components/keyboard/KeyboardContext.js +10 -11
- package/dist/components/keyboard/KeyboardProvider.js +100 -181
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +159 -166
- package/dist/components/keyboard/keyboard-config.js +59 -57
- package/dist/components/keyboard/keyboard-styles.js +10 -11
- package/dist/components/keyboard/use-keyboard-field.js +29 -21
- package/dist/components/link/Link.js +47 -137
- package/dist/components/link/link-config.js +14 -15
- package/dist/components/link/link-styles.js +25 -29
- package/dist/components/marquee/Marquee.js +55 -144
- package/dist/components/marquee/marquee-config.js +18 -19
- package/dist/components/marquee/marquee-styles.js +13 -15
- package/dist/components/modal/Modal.d.ts +26 -10
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +56 -136
- package/dist/components/modal/modal-config.js +15 -16
- package/dist/components/modal/modal-styles.js +13 -14
- package/dist/components/multi-select/MultiSelect.d.ts +18 -2
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +149 -283
- package/dist/components/multi-select/multi-select-config.d.ts +23 -18
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +18 -21
- package/dist/components/multi-select/multi-select-styles.js +17 -20
- package/dist/components/radio/Radio.js +43 -80
- package/dist/components/radio/RadioGroup.js +57 -155
- package/dist/components/radio/radio-config.js +15 -16
- package/dist/components/radio/radio-context.js +6 -6
- package/dist/components/radio/radio-styles.js +55 -60
- package/dist/components/resizable-screen/ResizableScreen.js +87 -177
- package/dist/components/resizable-screen/resizable-screen-config.js +16 -17
- package/dist/components/select/Select.d.ts +3 -2
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +97 -195
- package/dist/components/select/select-config.js +8 -9
- package/dist/components/select/select-styles.js +5 -5
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +102 -196
- package/dist/components/select-menu/select-menu-config.js +12 -12
- package/dist/components/select-menu/use-select-floating.d.ts +11 -1
- package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
- package/dist/components/select-menu/use-select-floating.js +41 -48
- package/dist/components/sidebar/Sidebar.d.ts +43 -22
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.js +146 -331
- package/dist/components/sidebar/sidebar-config.d.ts +98 -31
- package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-config.js +47 -33
- package/dist/components/sidebar/sidebar-styles.js +27 -32
- package/dist/components/spinner/spinner-config.js +12 -13
- package/dist/components/spinner/spinner-styles.js +13 -14
- package/dist/components/spinner/spinner.js +39 -82
- package/dist/components/switch/Switch.js +62 -154
- package/dist/components/switch/switch-config.js +11 -12
- package/dist/components/switch/switch-styles.js +14 -16
- package/dist/components/table/Table.js +64 -186
- package/dist/components/table/table-config.js +17 -18
- package/dist/components/table/table-styles.js +48 -52
- package/dist/components/tabs/Tabs.d.ts +16 -8
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +93 -208
- package/dist/components/tabs/tabs-config.d.ts +42 -20
- package/dist/components/tabs/tabs-config.d.ts.map +1 -1
- package/dist/components/tabs/tabs-config.js +26 -18
- package/dist/components/tabs/tabs-styles.js +15 -17
- package/dist/components/textarea/Textarea.js +52 -138
- package/dist/components/textarea/textarea-config.js +10 -11
- package/dist/components/textarea/textarea-styles.js +9 -10
- package/dist/components/toast/ToastContext.js +22 -26
- package/dist/components/toast/ToastItem.js +82 -144
- package/dist/components/toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/toast/ToastProvider.js +128 -190
- package/dist/components/toast/toast-config.js +23 -24
- package/dist/components/toast/toast-styles.js +50 -55
- package/dist/components/toast/use-pausable-timeout.js +17 -13
- package/dist/components/tooltip/Tooltip.d.ts +5 -0
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +68 -158
- package/dist/components/tooltip/tooltip-config.d.ts +25 -0
- package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip-config.js +26 -22
- package/dist/components/tooltip/tooltip-styles.js +15 -17
- package/dist/config/default-config.js +11 -34
- package/dist/config/resolve-color.js +23 -23
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/config/resolve-config.js +14 -12
- package/dist/icons/ArrowLeftIcon.js +16 -19
- package/dist/icons/CalendarIcon.js +43 -24
- package/dist/icons/CheckIcon.js +16 -19
- package/dist/icons/ChevronDownIcon.js +15 -21
- package/dist/icons/ChevronLeftIcon.js +16 -19
- package/dist/icons/ChevronRightIcon.js +16 -19
- package/dist/icons/ChevronUpIcon.js +16 -19
- package/dist/icons/ClearIcon.js +26 -22
- package/dist/icons/ClockIcon.js +20 -22
- package/dist/icons/CloseIcon.js +26 -22
- package/dist/icons/ErrorIcon.js +16 -19
- package/dist/icons/ExternalLinkIcon.js +25 -23
- package/dist/icons/EyeIcon.js +20 -22
- package/dist/icons/EyeOffIcon.js +21 -22
- package/dist/icons/InfoIcon.js +16 -19
- package/dist/icons/SearchIcon.js +25 -22
- package/dist/icons/WarningIcon.js +16 -19
- package/dist/index.js +65 -163
- package/dist/libs/context.js +10 -13
- package/dist/libs/index.js +1 -0
- package/dist/libs/registry.js +10 -12
- package/dist/libs/use-floating-z-index.d.ts +32 -0
- package/dist/libs/use-floating-z-index.d.ts.map +1 -0
- package/dist/libs/use-floating-z-index.js +16 -0
- package/dist/libs/use-isomorphic-layout-effect.js +5 -5
- package/dist/scripts/AsheeThemeScript.js +35 -44
- package/dist/shared/radius.d.ts.map +1 -1
- package/dist/shared/radius.js +12 -13
- package/dist/shared/variant.js +46 -134
- package/dist/theme/color.js +28 -28
- package/dist/theme/controller.d.ts.map +1 -1
- package/dist/theme/controller.js +65 -178
- package/dist/theme/useTheme.js +13 -44
- package/dist/utils/cn.js +7 -7
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/merge-object.js +13 -14
- package/dist/utils/resolve-token.js +11 -14
- package/dist/utils/stacking.d.ts +76 -0
- package/dist/utils/stacking.d.ts.map +1 -0
- package/dist/utils/stacking.js +34 -0
- package/package.json +12 -11
|
@@ -1,188 +1,66 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import { useAsheeConfig as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
s.size
|
|
64
|
-
), H = m(
|
|
65
|
-
p,
|
|
66
|
-
te,
|
|
67
|
-
s.size
|
|
68
|
-
), U = m(
|
|
69
|
-
P,
|
|
70
|
-
se,
|
|
71
|
-
s.radius
|
|
72
|
-
), S = K[C] ?? K.primary, q = W(
|
|
73
|
-
(r, a) => {
|
|
74
|
-
if (y)
|
|
75
|
-
try {
|
|
76
|
-
return y(r);
|
|
77
|
-
} catch {
|
|
78
|
-
return a;
|
|
79
|
-
}
|
|
80
|
-
return a;
|
|
81
|
-
},
|
|
82
|
-
[y]
|
|
83
|
-
), J = Array.isArray(u) && u.length > 0, b = B ?? !!(i || h);
|
|
84
|
-
return /* @__PURE__ */ t(
|
|
85
|
-
"div",
|
|
86
|
-
{
|
|
87
|
-
className: l(
|
|
88
|
-
"w-full h-full scrollable",
|
|
89
|
-
c === "ghost" ? "border-0 shadow-none rounded-none" : l("border border-border", U),
|
|
90
|
-
e == null ? void 0 : e.className,
|
|
91
|
-
I
|
|
92
|
-
),
|
|
93
|
-
style: Y,
|
|
94
|
-
...j,
|
|
95
|
-
children: /* @__PURE__ */ V("table", { className: "w-full border-collapse text-left caption-bottom", children: [
|
|
96
|
-
/* @__PURE__ */ t(
|
|
97
|
-
"thead",
|
|
98
|
-
{
|
|
99
|
-
className: l(
|
|
100
|
-
"sticky top-0 z-10 border-b border-border bg-secondary/90 backdrop-blur-xs font-semibold text-foreground/70 select-none",
|
|
101
|
-
e == null ? void 0 : e.headerClassName,
|
|
102
|
-
w
|
|
103
|
-
),
|
|
104
|
-
children: /* @__PURE__ */ t("tr", { children: n.map((r, a) => {
|
|
105
|
-
const o = r.id ?? (typeof r.header == "string" ? r.header : String(a));
|
|
106
|
-
return /* @__PURE__ */ t(
|
|
107
|
-
"th",
|
|
108
|
-
{
|
|
109
|
-
scope: "col",
|
|
110
|
-
className: l(
|
|
111
|
-
"font-medium uppercase tracking-wider text-left align-middle truncate min-w-0",
|
|
112
|
-
_,
|
|
113
|
-
f,
|
|
114
|
-
H,
|
|
115
|
-
c === "grid" && a < n.length - 1 && "border-r border-border",
|
|
116
|
-
e == null ? void 0 : e.cellClassName,
|
|
117
|
-
A
|
|
118
|
-
),
|
|
119
|
-
children: r.header
|
|
120
|
-
},
|
|
121
|
-
o
|
|
122
|
-
);
|
|
123
|
-
}) })
|
|
124
|
-
}
|
|
125
|
-
),
|
|
126
|
-
/* @__PURE__ */ t("tbody", { children: J ? u.map((r, a) => {
|
|
127
|
-
const o = q(r, a), g = o === x, M = c === "striped" && a % 2 === 1;
|
|
128
|
-
return /* @__PURE__ */ t(
|
|
129
|
-
"tr",
|
|
130
|
-
{
|
|
131
|
-
tabIndex: b ? 0 : -1,
|
|
132
|
-
"aria-selected": g,
|
|
133
|
-
onClick: b && i ? () => i(r, o) : void 0,
|
|
134
|
-
onDoubleClick: b && h ? () => h(r, o) : void 0,
|
|
135
|
-
onKeyDown: (d) => {
|
|
136
|
-
b && (d.key === "Enter" || d.key === " ") && (d.preventDefault(), i == null || i(r, o));
|
|
137
|
-
},
|
|
138
|
-
className: l(
|
|
139
|
-
"border-b border-border/60 transition-all duration-150 outline-none align-middle",
|
|
140
|
-
X,
|
|
141
|
-
c === "ghost" && "last:border-b-0",
|
|
142
|
-
M && "bg-secondary",
|
|
143
|
-
b && l(
|
|
144
|
-
"cursor-pointer select-none active:scale-[0.99] active:opacity-90",
|
|
145
|
-
S.hover,
|
|
146
|
-
S.focus
|
|
147
|
-
),
|
|
148
|
-
g && S.selected,
|
|
149
|
-
e == null ? void 0 : e.rowClassName,
|
|
150
|
-
G
|
|
151
|
-
),
|
|
152
|
-
children: n.map((d, T) => {
|
|
153
|
-
const Q = d.id ?? (typeof d.header == "string" ? d.header : String(T));
|
|
154
|
-
return /* @__PURE__ */ t(
|
|
155
|
-
"td",
|
|
156
|
-
{
|
|
157
|
-
className: l(
|
|
158
|
-
"truncate min-w-0 align-middle",
|
|
159
|
-
_,
|
|
160
|
-
f,
|
|
161
|
-
c === "grid" && T < n.length - 1 && "border-r border-border",
|
|
162
|
-
e == null ? void 0 : e.cellClassName,
|
|
163
|
-
A
|
|
164
|
-
),
|
|
165
|
-
children: d.cell(r)
|
|
166
|
-
},
|
|
167
|
-
Q
|
|
168
|
-
);
|
|
169
|
-
})
|
|
170
|
-
},
|
|
171
|
-
String(o)
|
|
172
|
-
);
|
|
173
|
-
}) : /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t(
|
|
174
|
-
"td",
|
|
175
|
-
{
|
|
176
|
-
colSpan: n.length || 1,
|
|
177
|
-
className: "h-48 text-center align-middle p-6 text-sm text-foreground/70",
|
|
178
|
-
children: z
|
|
179
|
-
}
|
|
180
|
-
) }) })
|
|
181
|
-
] })
|
|
182
|
-
}
|
|
183
|
-
);
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { useAsheeConfig as t } from "../../libs/context.js";
|
|
5
|
+
import { RADIUS_CLASS as n } from "../../shared/radius.js";
|
|
6
|
+
import { resolveCascade as r, resolveClassKey as i, resolveRadiusKey as a } from "../../utils/resolve-token.js";
|
|
7
|
+
import { FALLBACK_TABLE_CONFIG as o } from "./table-config.js";
|
|
8
|
+
import { TABLE_CELL_PADDING_X_CLASS as s, TABLE_CELL_PADDING_Y_CLASS as c, TABLE_COLOR_STYLES as l, TABLE_FONT_CLASS as u, TABLE_HEADER_FONT_CLASS as d } from "./table-styles.js";
|
|
9
|
+
import { useCallback as f } from "react";
|
|
10
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/table/Table.tsx
|
|
12
|
+
function h({ data: h = [], columns: g = [], gridClasses: _, rowKeyAccessor: v, handleClick: y, handleDoubleClick: b, selectedRowKey: x, emptyMessage: S = "No items available", isClickable: C, variant: w, color: T, size: E, radius: D, headerClassName: O, rowClassName: k, cellClassName: A, className: j, style: M, ...N }) {
|
|
13
|
+
let P = t(), F = P.components?.table, I = r(E, F?.size, void 0, o.size), L = r(w, F?.variant, void 0, o.variant), R = r(T, F?.color, P.defaultColor, o.color), z = (e) => e === "full" ? "xl" : e, B = a(z(D), z(F?.radius), P.defaultRadius, o.radius), V = i(I, c, o.size), H = i(I, s, o.size), U = i(I, u, o.size), W = i(I, d, o.size), G = i(B, n, o.radius), K = l[R] ?? l.primary, q = f((e, t) => {
|
|
14
|
+
if (v) try {
|
|
15
|
+
return v(e);
|
|
16
|
+
} catch {
|
|
17
|
+
return t;
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
}, [v]), J = Array.isArray(h) && h.length > 0, Y = C ?? !!(y || b);
|
|
21
|
+
return /* @__PURE__ */ p("div", {
|
|
22
|
+
className: e("w-full h-full scrollable", L === "ghost" ? "border-0 shadow-none rounded-none" : e("border border-border", G), F?.className, j),
|
|
23
|
+
style: M,
|
|
24
|
+
...N,
|
|
25
|
+
children: /* @__PURE__ */ m("table", {
|
|
26
|
+
className: "w-full border-collapse text-left caption-bottom",
|
|
27
|
+
children: [/* @__PURE__ */ p("thead", {
|
|
28
|
+
className: e("sticky top-0 z-10 border-b border-border bg-secondary/90 backdrop-blur-xs font-semibold text-foreground/70 select-none", F?.headerClassName, O),
|
|
29
|
+
children: /* @__PURE__ */ p("tr", { children: g.map((t, n) => {
|
|
30
|
+
let r = t.id ?? (typeof t.header == "string" ? t.header : String(n));
|
|
31
|
+
return /* @__PURE__ */ p("th", {
|
|
32
|
+
scope: "col",
|
|
33
|
+
className: e("font-medium uppercase tracking-wider text-left align-middle truncate min-w-0", V, H, W, L === "grid" && n < g.length - 1 && "border-r border-border", F?.cellClassName, A),
|
|
34
|
+
children: t.header
|
|
35
|
+
}, r);
|
|
36
|
+
}) })
|
|
37
|
+
}), /* @__PURE__ */ p("tbody", { children: J ? h.map((t, n) => {
|
|
38
|
+
let r = q(t, n), i = r === x, a = L === "striped" && n % 2 == 1;
|
|
39
|
+
return /* @__PURE__ */ p("tr", {
|
|
40
|
+
tabIndex: Y ? 0 : -1,
|
|
41
|
+
"aria-selected": i,
|
|
42
|
+
onClick: Y && y ? () => y(t, r) : void 0,
|
|
43
|
+
onDoubleClick: Y && b ? () => b(t, r) : void 0,
|
|
44
|
+
onKeyDown: (e) => {
|
|
45
|
+
Y && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), y?.(t, r));
|
|
46
|
+
},
|
|
47
|
+
className: e("border-b border-border/60 transition-all duration-150 outline-none align-middle", U, L === "ghost" && "last:border-b-0", a && "bg-secondary", Y && e("cursor-pointer select-none active:scale-[0.99] active:opacity-90", K.hover, K.focus), i && K.selected, F?.rowClassName, k),
|
|
48
|
+
children: g.map((n, r) => {
|
|
49
|
+
let i = n.id ?? (typeof n.header == "string" ? n.header : String(r));
|
|
50
|
+
return /* @__PURE__ */ p("td", {
|
|
51
|
+
className: e("truncate min-w-0 align-middle", V, H, L === "grid" && r < g.length - 1 && "border-r border-border", F?.cellClassName, A),
|
|
52
|
+
children: n.cell(t)
|
|
53
|
+
}, i);
|
|
54
|
+
})
|
|
55
|
+
}, String(r));
|
|
56
|
+
}) : /* @__PURE__ */ p("tr", { children: /* @__PURE__ */ p("td", {
|
|
57
|
+
colSpan: g.length || 1,
|
|
58
|
+
className: "h-48 text-center align-middle p-6 text-sm text-foreground/70",
|
|
59
|
+
children: S
|
|
60
|
+
}) }) })]
|
|
61
|
+
})
|
|
62
|
+
});
|
|
184
63
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
};
|
|
64
|
+
h.displayName = "Table";
|
|
65
|
+
//#endregion
|
|
66
|
+
export { h as Table };
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
a("table", e);
|
|
17
|
-
export {
|
|
18
|
-
r as FALLBACK_TABLE_CONFIG,
|
|
19
|
-
e as defaultTableConfig
|
|
2
|
+
import { registerComponentDefaults as e } from "../../libs/registry.js";
|
|
3
|
+
//#region src/components/table/table-config.ts
|
|
4
|
+
var t = {
|
|
5
|
+
size: "md",
|
|
6
|
+
variant: "grid"
|
|
7
|
+
}, n = {
|
|
8
|
+
size: "md",
|
|
9
|
+
variant: "grid",
|
|
10
|
+
color: "primary",
|
|
11
|
+
radius: "md",
|
|
12
|
+
className: "",
|
|
13
|
+
headerClassName: "",
|
|
14
|
+
rowClassName: "",
|
|
15
|
+
cellClassName: ""
|
|
20
16
|
};
|
|
17
|
+
e("table", t);
|
|
18
|
+
//#endregion
|
|
19
|
+
export { n as FALLBACK_TABLE_CONFIG, t as defaultTableConfig };
|
|
@@ -1,56 +1,52 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
//#region src/components/table/table-styles.ts
|
|
3
|
+
var e = {
|
|
4
|
+
sm: "py-1.5",
|
|
5
|
+
md: "py-2.5",
|
|
6
|
+
lg: "py-3.5"
|
|
7
|
+
}, t = {
|
|
8
|
+
sm: "px-2",
|
|
9
|
+
md: "px-3",
|
|
10
|
+
lg: "px-4"
|
|
11
|
+
}, n = {
|
|
12
|
+
sm: "text-[0.8125rem]",
|
|
13
|
+
md: "text-sm",
|
|
14
|
+
lg: "text-base"
|
|
10
15
|
}, r = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}, o = {
|
|
15
|
-
sm: "text-xs",
|
|
16
|
-
md: "text-[0.8125rem]",
|
|
17
|
-
lg: "text-sm"
|
|
16
|
+
sm: "text-xs",
|
|
17
|
+
md: "text-[0.8125rem]",
|
|
18
|
+
lg: "text-sm"
|
|
18
19
|
}, i = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
export {
|
|
51
|
-
s as TABLE_CELL_PADDING_X_CLASS,
|
|
52
|
-
e as TABLE_CELL_PADDING_Y_CLASS,
|
|
53
|
-
i as TABLE_COLOR_STYLES,
|
|
54
|
-
r as TABLE_FONT_CLASS,
|
|
55
|
-
o as TABLE_HEADER_FONT_CLASS
|
|
20
|
+
primary: {
|
|
21
|
+
selected: "bg-primary text-secondary font-medium hover:bg-primary/90 hover:text-secondary",
|
|
22
|
+
hover: "hover:bg-primary/10 hover:text-foreground",
|
|
23
|
+
focus: "focus-visible:bg-primary/15 focus-visible:ring-1 focus-visible:ring-primary focus-visible:ring-inset"
|
|
24
|
+
},
|
|
25
|
+
secondary: {
|
|
26
|
+
selected: "bg-secondary text-foreground font-medium hover:bg-secondary/90 hover:text-foreground",
|
|
27
|
+
hover: "hover:bg-secondary/10 hover:text-foreground",
|
|
28
|
+
focus: "focus-visible:bg-secondary/15 focus-visible:ring-1 focus-visible:ring-secondary focus-visible:ring-inset"
|
|
29
|
+
},
|
|
30
|
+
danger: {
|
|
31
|
+
selected: "bg-danger text-secondary font-medium hover:bg-danger/90 hover:text-secondary",
|
|
32
|
+
hover: "hover:bg-danger/10 hover:text-foreground",
|
|
33
|
+
focus: "focus-visible:bg-danger/15 focus-visible:ring-1 focus-visible:ring-danger focus-visible:ring-inset"
|
|
34
|
+
},
|
|
35
|
+
warning: {
|
|
36
|
+
selected: "bg-warning text-secondary font-medium hover:bg-warning/90 hover:text-secondary",
|
|
37
|
+
hover: "hover:bg-warning/10 hover:text-foreground",
|
|
38
|
+
focus: "focus-visible:bg-warning/15 focus-visible:ring-1 focus-visible:ring-warning focus-visible:ring-inset"
|
|
39
|
+
},
|
|
40
|
+
success: {
|
|
41
|
+
selected: "bg-success text-secondary font-medium hover:bg-success/90 hover:text-secondary",
|
|
42
|
+
hover: "hover:bg-success/10 hover:text-foreground",
|
|
43
|
+
focus: "focus-visible:bg-success/15 focus-visible:ring-1 focus-visible:ring-success focus-visible:ring-inset"
|
|
44
|
+
},
|
|
45
|
+
none: {
|
|
46
|
+
selected: "bg-secondary text-foreground font-medium hover:bg-secondary/80",
|
|
47
|
+
hover: "hover:bg-secondary/40 hover:text-foreground",
|
|
48
|
+
focus: "focus-visible:bg-secondary/50 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset"
|
|
49
|
+
}
|
|
56
50
|
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { t as TABLE_CELL_PADDING_X_CLASS, e as TABLE_CELL_PADDING_Y_CLASS, i as TABLE_COLOR_STYLES, n as TABLE_FONT_CLASS, r as TABLE_HEADER_FONT_CLASS };
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import { TabItem, TabsConfig } from './tabs-config';
|
|
2
|
-
|
|
1
|
+
import { TabItem, TabsConfig, TabsOptionsConfig } from './tabs-config';
|
|
2
|
+
/**
|
|
3
|
+
* Options props for the tab items.
|
|
4
|
+
* Extends the options config with instance-only props.
|
|
5
|
+
*/
|
|
6
|
+
export interface TabsOptionProps extends TabsOptionsConfig {
|
|
7
|
+
/**
|
|
8
|
+
* Class name for individual tab trigger buttons.
|
|
9
|
+
*/
|
|
10
|
+
tabClassName?: string;
|
|
11
|
+
}
|
|
12
|
+
type BaseTabsProps = Omit<TabsConfig, "options"> & Omit<React.HTMLAttributes<HTMLDivElement>, "color" | "onChange">;
|
|
3
13
|
/**
|
|
4
14
|
* Configuration options for the Tabs component.
|
|
5
15
|
*/
|
|
@@ -36,9 +46,10 @@ export interface TabsProps extends BaseTabsProps {
|
|
|
36
46
|
*/
|
|
37
47
|
tabListClassName?: string;
|
|
38
48
|
/**
|
|
39
|
-
*
|
|
49
|
+
* Options configuration for the tab items (active/inactive styling),
|
|
50
|
+
* plus the instance-only tab class override.
|
|
40
51
|
*/
|
|
41
|
-
|
|
52
|
+
options?: TabsOptionProps;
|
|
42
53
|
/**
|
|
43
54
|
* Class name for the tab content panel wrapper.
|
|
44
55
|
*/
|
|
@@ -66,11 +77,8 @@ export interface TabsProps extends BaseTabsProps {
|
|
|
66
77
|
* @param props.variant - Visual style variant. Defaults to "underline".
|
|
67
78
|
* @param props.size - Density scale. Defaults to "md".
|
|
68
79
|
* @param props.radius - Corner rounding of the container. Defaults to "md".
|
|
69
|
-
* @param props.
|
|
70
|
-
* @param props.activeVariant - Visual variant for the active tab. Defaults to "solid".
|
|
71
|
-
* @param props.activeColor - Theme color for the active tab. Defaults to "primary".
|
|
80
|
+
* @param props.options - Tab item options (active/inactive radius, variant and color) plus tabClassName.
|
|
72
81
|
* @param props.tabListClassName - Extra classes for the tablist.
|
|
73
|
-
* @param props.tabClassName - Extra classes for individual tabs.
|
|
74
82
|
* @param props.tabPanelClassName - Extra classes for the content panel.
|
|
75
83
|
*
|
|
76
84
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/Tabs.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/Tabs.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,iBAAiB,EAEvB,MAAM,eAAe,CAAC;AASvB;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,KAAK,aAAa,GAAG,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,GAC9C,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C;;;OAGG;IACH,IAAI,EAAE,OAAO,EAAE,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAEzC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAE1B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,eAAO,MAAM,IAAI,sGAgShB,CAAC"}
|