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.
Files changed (184) hide show
  1. package/README.md +1 -14
  2. package/dist/AsheeUIProvider.js +22 -24
  3. package/dist/components/accordion/Accordion.js +79 -173
  4. package/dist/components/accordion/accordion-config.js +12 -13
  5. package/dist/components/accordion/accordion-styles.js +21 -24
  6. package/dist/components/autocomplete/Autocomplete.js +78 -136
  7. package/dist/components/autocomplete/autocomplete-config.js +7 -12
  8. package/dist/components/button/Button.d.ts +29 -1
  9. package/dist/components/button/Button.d.ts.map +1 -1
  10. package/dist/components/button/Button.js +47 -108
  11. package/dist/components/button/button-config.js +16 -17
  12. package/dist/components/button/button-styles.js +10 -11
  13. package/dist/components/card/Card.d.ts +36 -16
  14. package/dist/components/card/Card.d.ts.map +1 -1
  15. package/dist/components/card/Card.js +115 -205
  16. package/dist/components/card/card-config.js +24 -21
  17. package/dist/components/card/card-styles.js +19 -22
  18. package/dist/components/carousel/Carousel.js +123 -248
  19. package/dist/components/carousel/carousel-config.js +24 -25
  20. package/dist/components/carousel/carousel-styles.js +14 -16
  21. package/dist/components/chip/Chip.js +84 -191
  22. package/dist/components/chip/chip-config.js +13 -14
  23. package/dist/components/chip/chip-styles.js +22 -26
  24. package/dist/components/date-picker/Calendar.d.ts +3 -3
  25. package/dist/components/date-picker/Calendar.d.ts.map +1 -1
  26. package/dist/components/date-picker/Calendar.js +141 -222
  27. package/dist/components/date-picker/DatePicker.d.ts +5 -5
  28. package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
  29. package/dist/components/date-picker/DatePicker.js +122 -220
  30. package/dist/components/date-picker/TimeSpinner.js +58 -82
  31. package/dist/components/date-picker/date-picker-config.d.ts +4 -4
  32. package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
  33. package/dist/components/date-picker/date-picker-config.js +10 -11
  34. package/dist/components/date-picker/date-picker-styles.js +44 -45
  35. package/dist/components/date-picker/date-picker.helpers.d.ts +4 -4
  36. package/dist/components/date-picker/date-picker.helpers.d.ts.map +1 -1
  37. package/dist/components/date-picker/date-picker.helpers.js +74 -102
  38. package/dist/components/drawer/Drawer.d.ts +26 -8
  39. package/dist/components/drawer/Drawer.d.ts.map +1 -1
  40. package/dist/components/drawer/Drawer.js +54 -131
  41. package/dist/components/drawer/drawer-config.js +14 -15
  42. package/dist/components/drawer/drawer-styles.js +38 -42
  43. package/dist/components/field/FieldShell.js +49 -56
  44. package/dist/components/field/field-config.js +17 -18
  45. package/dist/components/field/field-styles.js +8 -8
  46. package/dist/components/image/Image.d.ts +7 -7
  47. package/dist/components/image/Image.d.ts.map +1 -1
  48. package/dist/components/image/Image.js +65 -132
  49. package/dist/components/image/image-config.js +17 -18
  50. package/dist/components/image/image-styles.js +14 -15
  51. package/dist/components/input/Input.js +65 -150
  52. package/dist/components/input/PasswordInput.js +30 -49
  53. package/dist/components/input/input-config.js +7 -7
  54. package/dist/components/input/input-styles.js +9 -10
  55. package/dist/components/keyboard/KeyboardContext.js +10 -11
  56. package/dist/components/keyboard/KeyboardProvider.js +100 -181
  57. package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
  58. package/dist/components/keyboard/OnScreenKeyboard.js +159 -166
  59. package/dist/components/keyboard/keyboard-config.js +59 -57
  60. package/dist/components/keyboard/keyboard-styles.js +10 -11
  61. package/dist/components/keyboard/use-keyboard-field.js +29 -21
  62. package/dist/components/link/Link.js +47 -137
  63. package/dist/components/link/link-config.js +14 -15
  64. package/dist/components/link/link-styles.js +25 -29
  65. package/dist/components/marquee/Marquee.js +55 -144
  66. package/dist/components/marquee/marquee-config.js +18 -19
  67. package/dist/components/marquee/marquee-styles.js +13 -15
  68. package/dist/components/modal/Modal.d.ts +26 -10
  69. package/dist/components/modal/Modal.d.ts.map +1 -1
  70. package/dist/components/modal/Modal.js +56 -136
  71. package/dist/components/modal/modal-config.js +15 -16
  72. package/dist/components/modal/modal-styles.js +13 -14
  73. package/dist/components/multi-select/MultiSelect.d.ts +18 -2
  74. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  75. package/dist/components/multi-select/MultiSelect.js +149 -283
  76. package/dist/components/multi-select/multi-select-config.d.ts +23 -18
  77. package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
  78. package/dist/components/multi-select/multi-select-config.js +18 -21
  79. package/dist/components/multi-select/multi-select-styles.js +17 -20
  80. package/dist/components/radio/Radio.js +43 -80
  81. package/dist/components/radio/RadioGroup.js +57 -155
  82. package/dist/components/radio/radio-config.js +15 -16
  83. package/dist/components/radio/radio-context.js +6 -6
  84. package/dist/components/radio/radio-styles.js +55 -60
  85. package/dist/components/resizable-screen/ResizableScreen.js +87 -177
  86. package/dist/components/resizable-screen/resizable-screen-config.js +16 -17
  87. package/dist/components/select/Select.d.ts +3 -2
  88. package/dist/components/select/Select.d.ts.map +1 -1
  89. package/dist/components/select/Select.js +97 -195
  90. package/dist/components/select/select-config.js +8 -9
  91. package/dist/components/select/select-styles.js +5 -5
  92. package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
  93. package/dist/components/select-menu/SelectMenu.js +102 -196
  94. package/dist/components/select-menu/select-menu-config.js +12 -12
  95. package/dist/components/select-menu/use-select-floating.d.ts +11 -1
  96. package/dist/components/select-menu/use-select-floating.d.ts.map +1 -1
  97. package/dist/components/select-menu/use-select-floating.js +41 -48
  98. package/dist/components/sidebar/Sidebar.d.ts +43 -22
  99. package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
  100. package/dist/components/sidebar/Sidebar.js +146 -331
  101. package/dist/components/sidebar/sidebar-config.d.ts +98 -31
  102. package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
  103. package/dist/components/sidebar/sidebar-config.js +47 -33
  104. package/dist/components/sidebar/sidebar-styles.js +27 -32
  105. package/dist/components/spinner/spinner-config.js +12 -13
  106. package/dist/components/spinner/spinner-styles.js +13 -14
  107. package/dist/components/spinner/spinner.js +39 -82
  108. package/dist/components/switch/Switch.js +62 -154
  109. package/dist/components/switch/switch-config.js +11 -12
  110. package/dist/components/switch/switch-styles.js +14 -16
  111. package/dist/components/table/Table.js +64 -186
  112. package/dist/components/table/table-config.js +17 -18
  113. package/dist/components/table/table-styles.js +48 -52
  114. package/dist/components/tabs/Tabs.d.ts +16 -8
  115. package/dist/components/tabs/Tabs.d.ts.map +1 -1
  116. package/dist/components/tabs/Tabs.js +93 -208
  117. package/dist/components/tabs/tabs-config.d.ts +42 -20
  118. package/dist/components/tabs/tabs-config.d.ts.map +1 -1
  119. package/dist/components/tabs/tabs-config.js +26 -18
  120. package/dist/components/tabs/tabs-styles.js +15 -17
  121. package/dist/components/textarea/Textarea.js +52 -138
  122. package/dist/components/textarea/textarea-config.js +10 -11
  123. package/dist/components/textarea/textarea-styles.js +9 -10
  124. package/dist/components/toast/ToastContext.js +22 -26
  125. package/dist/components/toast/ToastItem.js +82 -144
  126. package/dist/components/toast/ToastProvider.d.ts.map +1 -1
  127. package/dist/components/toast/ToastProvider.js +128 -190
  128. package/dist/components/toast/toast-config.js +23 -24
  129. package/dist/components/toast/toast-styles.js +50 -55
  130. package/dist/components/toast/use-pausable-timeout.js +17 -13
  131. package/dist/components/tooltip/Tooltip.d.ts +5 -0
  132. package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
  133. package/dist/components/tooltip/Tooltip.js +68 -158
  134. package/dist/components/tooltip/tooltip-config.d.ts +25 -0
  135. package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
  136. package/dist/components/tooltip/tooltip-config.js +26 -22
  137. package/dist/components/tooltip/tooltip-styles.js +15 -17
  138. package/dist/config/default-config.js +11 -34
  139. package/dist/config/resolve-color.js +23 -23
  140. package/dist/config/resolve-config.d.ts.map +1 -1
  141. package/dist/config/resolve-config.js +14 -12
  142. package/dist/icons/ArrowLeftIcon.js +16 -19
  143. package/dist/icons/CalendarIcon.js +43 -24
  144. package/dist/icons/CheckIcon.js +16 -19
  145. package/dist/icons/ChevronDownIcon.js +15 -21
  146. package/dist/icons/ChevronLeftIcon.js +16 -19
  147. package/dist/icons/ChevronRightIcon.js +16 -19
  148. package/dist/icons/ChevronUpIcon.js +16 -19
  149. package/dist/icons/ClearIcon.js +26 -22
  150. package/dist/icons/ClockIcon.js +20 -22
  151. package/dist/icons/CloseIcon.js +26 -22
  152. package/dist/icons/ErrorIcon.js +16 -19
  153. package/dist/icons/ExternalLinkIcon.js +25 -23
  154. package/dist/icons/EyeIcon.js +20 -22
  155. package/dist/icons/EyeOffIcon.js +21 -22
  156. package/dist/icons/InfoIcon.js +16 -19
  157. package/dist/icons/SearchIcon.js +25 -22
  158. package/dist/icons/WarningIcon.js +16 -19
  159. package/dist/index.js +65 -163
  160. package/dist/libs/context.js +10 -13
  161. package/dist/libs/index.js +1 -0
  162. package/dist/libs/registry.js +10 -12
  163. package/dist/libs/use-floating-z-index.d.ts +32 -0
  164. package/dist/libs/use-floating-z-index.d.ts.map +1 -0
  165. package/dist/libs/use-floating-z-index.js +16 -0
  166. package/dist/libs/use-isomorphic-layout-effect.js +5 -5
  167. package/dist/scripts/AsheeThemeScript.js +35 -44
  168. package/dist/shared/radius.d.ts.map +1 -1
  169. package/dist/shared/radius.js +12 -13
  170. package/dist/shared/variant.js +46 -134
  171. package/dist/theme/color.js +28 -28
  172. package/dist/theme/controller.d.ts.map +1 -1
  173. package/dist/theme/controller.js +65 -178
  174. package/dist/theme/useTheme.js +13 -44
  175. package/dist/utils/cn.js +7 -7
  176. package/dist/utils/index.d.ts +1 -0
  177. package/dist/utils/index.d.ts.map +1 -1
  178. package/dist/utils/index.js +1 -0
  179. package/dist/utils/merge-object.js +13 -14
  180. package/dist/utils/resolve-token.js +11 -14
  181. package/dist/utils/stacking.d.ts +76 -0
  182. package/dist/utils/stacking.d.ts.map +1 -0
  183. package/dist/utils/stacking.js +34 -0
  184. package/package.json +12 -11
@@ -1,188 +1,66 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as V } from "react/jsx-runtime";
3
- import { useCallback as W } from "react";
4
- import { useAsheeConfig as Z } from "../../libs/context.js";
5
- import { resolveCascade as L, resolveRadiusKey as $, resolveClassKey as m } from "../../utils/resolve-token.js";
6
- import { FALLBACK_TABLE_CONFIG as s } from "./table-config.js";
7
- import { TABLE_CELL_PADDING_Y_CLASS as k, TABLE_CELL_PADDING_X_CLASS as ee, TABLE_FONT_CLASS as re, TABLE_HEADER_FONT_CLASS as te, TABLE_COLOR_STYLES as K } from "./table-styles.js";
8
- import { RADIUS_CLASS as se } from "../../shared/radius.js";
9
- import { cn as l } from "../../utils/cn.js";
10
- function ae({
11
- data: u = [],
12
- columns: n = [],
13
- gridClasses: de,
14
- rowKeyAccessor: y,
15
- handleClick: i,
16
- handleDoubleClick: h,
17
- selectedRowKey: x,
18
- emptyMessage: z = "No items available",
19
- isClickable: B,
20
- variant: D,
21
- color: R,
22
- size: F,
23
- radius: O,
24
- headerClassName: w,
25
- rowClassName: G,
26
- cellClassName: A,
27
- className: I,
28
- style: Y,
29
- ...j
30
- }) {
31
- var E;
32
- const v = Z(), e = (E = v.components) == null ? void 0 : E.table, p = L(
33
- F,
34
- e == null ? void 0 : e.size,
35
- void 0,
36
- s.size
37
- ), c = L(
38
- D,
39
- e == null ? void 0 : e.variant,
40
- void 0,
41
- s.variant
42
- ), C = L(
43
- R,
44
- e == null ? void 0 : e.color,
45
- v.defaultColor,
46
- s.color
47
- ), N = (r) => r === "full" ? "xl" : r, P = $(
48
- N(O),
49
- N(e == null ? void 0 : e.radius),
50
- v.defaultRadius,
51
- s.radius
52
- ), _ = m(
53
- p,
54
- k,
55
- s.size
56
- ), f = m(
57
- p,
58
- ee,
59
- s.size
60
- ), X = m(
61
- p,
62
- re,
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
- ae.displayName = "Table";
186
- export {
187
- ae as Table
188
- };
64
+ h.displayName = "Table";
65
+ //#endregion
66
+ export { h as Table };
@@ -1,20 +1,19 @@
1
1
  "use client";
2
- import { registerComponentDefaults as a } from "../../libs/registry.js";
3
- const e = {
4
- size: "md",
5
- variant: "grid"
6
- }, r = {
7
- size: "md",
8
- variant: "grid",
9
- color: "primary",
10
- radius: "md",
11
- className: "",
12
- headerClassName: "",
13
- rowClassName: "",
14
- cellClassName: ""
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
- const e = {
3
- sm: "py-1.5",
4
- md: "py-2.5",
5
- lg: "py-3.5"
6
- }, s = {
7
- sm: "px-2",
8
- md: "px-3",
9
- lg: "px-4"
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
- sm: "text-[0.8125rem]",
12
- md: "text-sm",
13
- lg: "text-base"
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
- primary: {
20
- selected: "bg-primary text-secondary font-medium hover:bg-primary/90 hover:text-secondary",
21
- hover: "hover:bg-primary/10 hover:text-foreground",
22
- focus: "focus-visible:bg-primary/15 focus-visible:ring-1 focus-visible:ring-primary focus-visible:ring-inset"
23
- },
24
- secondary: {
25
- selected: "bg-secondary text-foreground font-medium hover:bg-secondary/90 hover:text-foreground",
26
- hover: "hover:bg-secondary/10 hover:text-foreground",
27
- focus: "focus-visible:bg-secondary/15 focus-visible:ring-1 focus-visible:ring-secondary focus-visible:ring-inset"
28
- },
29
- danger: {
30
- selected: "bg-danger text-secondary font-medium hover:bg-danger/90 hover:text-secondary",
31
- hover: "hover:bg-danger/10 hover:text-foreground",
32
- focus: "focus-visible:bg-danger/15 focus-visible:ring-1 focus-visible:ring-danger focus-visible:ring-inset"
33
- },
34
- warning: {
35
- selected: "bg-warning text-secondary font-medium hover:bg-warning/90 hover:text-secondary",
36
- hover: "hover:bg-warning/10 hover:text-foreground",
37
- focus: "focus-visible:bg-warning/15 focus-visible:ring-1 focus-visible:ring-warning focus-visible:ring-inset"
38
- },
39
- success: {
40
- selected: "bg-success text-secondary font-medium hover:bg-success/90 hover:text-secondary",
41
- hover: "hover:bg-success/10 hover:text-foreground",
42
- focus: "focus-visible:bg-success/15 focus-visible:ring-1 focus-visible:ring-success focus-visible:ring-inset"
43
- },
44
- none: {
45
- selected: "bg-secondary text-foreground font-medium hover:bg-secondary/80",
46
- hover: "hover:bg-secondary/40 hover:text-foreground",
47
- focus: "focus-visible:bg-secondary/50 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset"
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
- type BaseTabsProps = TabsConfig & Omit<React.HTMLAttributes<HTMLDivElement>, "color" | "onChange">;
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
- * Class name for individual tab trigger buttons.
49
+ * Options configuration for the tab items (active/inactive styling),
50
+ * plus the instance-only tab class override.
40
51
  */
41
- tabClassName?: string;
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.activeRadius - Corner rounding of the active tab. Defaults to "md".
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,EAEhB,MAAM,eAAe,CAAC;AASvB,KAAK,aAAa,GAAG,UAAU,GAC7B,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;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,eAAO,MAAM,IAAI,sGA4QhB,CAAC"}
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"}