asheeui 0.6.2 → 0.6.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.
- package/dist/AsheeUIProvider.d.ts +34 -0
- package/dist/AsheeUIProvider.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.d.ts +55 -44
- package/dist/components/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/accordion/Accordion.js +27 -27
- package/dist/components/accordion/accordion-config.d.ts +41 -12
- package/dist/components/accordion/accordion-config.d.ts.map +1 -1
- package/dist/components/accordion/accordion-styles.d.ts +20 -0
- package/dist/components/accordion/accordion-styles.d.ts.map +1 -1
- package/dist/components/accordion/accordion-styles.js +1 -1
- package/dist/components/autocomplete/Autocomplete.d.ts +59 -39
- package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/Autocomplete.js +98 -91
- package/dist/components/autocomplete/autocomplete-config.d.ts +9 -62
- package/dist/components/autocomplete/autocomplete-config.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete-config.js +6 -21
- package/dist/components/button/Button.d.ts +50 -51
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +19 -19
- package/dist/components/button/button-config.d.ts +23 -15
- package/dist/components/button/button-config.d.ts.map +1 -1
- package/dist/components/button/button-styles.d.ts +11 -1
- package/dist/components/button/button-styles.d.ts.map +1 -1
- package/dist/components/card/Card.d.ts +85 -43
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +49 -49
- package/dist/components/card/card-config.d.ts +35 -18
- package/dist/components/card/card-config.d.ts.map +1 -1
- package/dist/components/card/card-config.js +0 -2
- package/dist/components/card/card-styles.d.ts +17 -1
- package/dist/components/card/card-styles.d.ts.map +1 -1
- package/dist/components/carousel/Carousel.d.ts +107 -12
- package/dist/components/carousel/Carousel.d.ts.map +1 -1
- package/dist/components/carousel/Carousel.js +63 -64
- package/dist/components/carousel/carousel-config.d.ts +94 -7
- package/dist/components/carousel/carousel-config.d.ts.map +1 -1
- package/dist/components/carousel/carousel-config.js +6 -4
- package/dist/components/carousel/carousel-styles.d.ts +32 -1
- package/dist/components/carousel/carousel-styles.d.ts.map +1 -1
- package/dist/components/chip/Chip.d.ts +55 -34
- package/dist/components/chip/Chip.d.ts.map +1 -1
- package/dist/components/chip/Chip.js +71 -72
- package/dist/components/chip/chip-config.d.ts +29 -15
- package/dist/components/chip/chip-config.d.ts.map +1 -1
- package/dist/components/chip/chip-config.js +5 -6
- package/dist/components/chip/chip-styles.d.ts +21 -1
- package/dist/components/chip/chip-styles.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +166 -2
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +110 -99
- package/dist/components/date-picker/date-picker-config.d.ts +31 -0
- package/dist/components/date-picker/date-picker-config.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-config.js +8 -16
- package/dist/components/date-picker/date-picker-styles.d.ts +21 -1
- package/dist/components/date-picker/date-picker-styles.d.ts.map +1 -1
- package/dist/components/date-picker/date-picker-styles.js +7 -11
- package/dist/components/drawer/Drawer.d.ts +97 -7
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +9 -9
- package/dist/components/drawer/drawer-config.d.ts +54 -1
- package/dist/components/drawer/drawer-config.d.ts.map +1 -1
- package/dist/components/drawer/drawer-styles.d.ts +21 -0
- package/dist/components/drawer/drawer-styles.d.ts.map +1 -1
- package/dist/components/field/FieldShell.d.ts +86 -0
- package/dist/components/field/FieldShell.d.ts.map +1 -1
- package/dist/components/field/field-config.d.ts +66 -3
- package/dist/components/field/field-config.d.ts.map +1 -1
- package/dist/components/field/field-config.js +2 -1
- package/dist/components/field/field-styles.d.ts +22 -0
- package/dist/components/field/field-styles.d.ts.map +1 -1
- package/dist/components/field/field-styles.js +10 -0
- package/dist/components/field/index.js +1 -0
- package/dist/components/image/Image.d.ts +35 -28
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +7 -7
- package/dist/components/image/image-config.d.ts +25 -7
- package/dist/components/image/image-config.d.ts.map +1 -1
- package/dist/components/image/image-styles.d.ts +9 -0
- package/dist/components/image/image-styles.d.ts.map +1 -1
- package/dist/components/input/Input.d.ts +117 -10
- package/dist/components/input/Input.d.ts.map +1 -1
- package/dist/components/input/Input.js +20 -20
- package/dist/components/input/PasswordInput.d.ts +48 -0
- package/dist/components/input/PasswordInput.d.ts.map +1 -1
- package/dist/components/input/input-config.d.ts +10 -1
- package/dist/components/input/input-config.d.ts.map +1 -1
- package/dist/components/input/input-config.js +5 -8
- package/dist/components/input/input-styles.d.ts +10 -0
- package/dist/components/input/input-styles.d.ts.map +1 -1
- package/dist/components/input/input-styles.js +5 -9
- package/dist/components/keyboard/OnScreenKeyboard.d.ts +58 -8
- package/dist/components/keyboard/OnScreenKeyboard.d.ts.map +1 -1
- package/dist/components/keyboard/OnScreenKeyboard.js +49 -48
- package/dist/components/keyboard/index.js +1 -1
- package/dist/components/keyboard/keyboard-config.d.ts +88 -3
- package/dist/components/keyboard/keyboard-config.d.ts.map +1 -1
- package/dist/components/keyboard/{default-keyboard-config.js → keyboard-config.js} +7 -1
- package/dist/components/keyboard/keyboard-context.d.ts +103 -13
- package/dist/components/keyboard/keyboard-context.d.ts.map +1 -1
- package/dist/components/keyboard/keyboard-context.js +66 -68
- package/dist/components/keyboard/use-keyboard-field.d.ts +37 -0
- package/dist/components/keyboard/use-keyboard-field.d.ts.map +1 -1
- package/dist/components/link/Link.d.ts +118 -9
- package/dist/components/link/Link.d.ts.map +1 -1
- package/dist/components/link/Link.js +29 -30
- package/dist/components/link/link-config.d.ts +58 -5
- package/dist/components/link/link-config.d.ts.map +1 -1
- package/dist/components/link/link-styles.d.ts +24 -4
- package/dist/components/link/link-styles.d.ts.map +1 -1
- package/dist/components/marquee/Marquee.d.ts +77 -8
- package/dist/components/marquee/Marquee.d.ts.map +1 -1
- package/dist/components/marquee/Marquee.js +5 -5
- package/dist/components/marquee/marquee-config.d.ts +74 -0
- package/dist/components/marquee/marquee-config.d.ts.map +1 -1
- package/dist/components/marquee/marquee-styles.d.ts +12 -0
- package/dist/components/marquee/marquee-styles.d.ts.map +1 -1
- package/dist/components/modal/Modal.d.ts +113 -25
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +75 -82
- package/dist/components/modal/modal-config.d.ts +59 -1
- package/dist/components/modal/modal-config.d.ts.map +1 -1
- package/dist/components/modal/modal-styles.d.ts +8 -1
- package/dist/components/modal/modal-styles.d.ts.map +1 -1
- package/dist/components/modal/modal-styles.js +4 -11
- package/dist/components/multi-select/MultiSelect.d.ts +152 -23
- package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
- package/dist/components/multi-select/MultiSelect.js +195 -217
- package/dist/components/multi-select/multi-select-config.d.ts +61 -23
- package/dist/components/multi-select/multi-select-config.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-config.js +16 -25
- package/dist/components/multi-select/multi-select-styles.d.ts +17 -0
- package/dist/components/multi-select/multi-select-styles.d.ts.map +1 -1
- package/dist/components/multi-select/multi-select-styles.js +9 -13
- package/dist/components/radio/Radio.d.ts +137 -13
- package/dist/components/radio/Radio.d.ts.map +1 -1
- package/dist/components/radio/Radio.js +66 -141
- package/dist/components/radio/RadioGroup.d.ts +88 -23
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/radio/RadioGroup.js +141 -66
- package/dist/components/radio/radio-config.d.ts +36 -11
- package/dist/components/radio/radio-config.d.ts.map +1 -1
- package/dist/components/radio/radio-config.js +9 -11
- package/dist/components/radio/radio-context.d.ts +44 -1
- package/dist/components/radio/radio-context.d.ts.map +1 -1
- package/dist/components/radio/radio-styles.d.ts +24 -1
- package/dist/components/radio/radio-styles.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.d.ts +79 -32
- package/dist/components/resizable-screen/ResizableScreen.d.ts.map +1 -1
- package/dist/components/resizable-screen/ResizableScreen.js +77 -72
- package/dist/components/resizable-screen/resizable-screen-config.d.ts +62 -0
- package/dist/components/resizable-screen/resizable-screen-config.d.ts.map +1 -1
- package/dist/components/scrollbar/scrollbar-config.d.ts +44 -9
- package/dist/components/scrollbar/scrollbar-config.d.ts.map +1 -1
- package/dist/components/select/Select.d.ts +157 -17
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +141 -152
- package/dist/components/select/select-config.d.ts +26 -19
- package/dist/components/select/select-config.d.ts.map +1 -1
- package/dist/components/select/select-config.js +5 -21
- package/dist/components/select/select-styles.d.ts +10 -0
- package/dist/components/select/select-styles.d.ts.map +1 -1
- package/dist/components/select/select-styles.js +5 -9
- package/dist/components/select-menu/SelectMenu.d.ts +125 -8
- package/dist/components/select-menu/SelectMenu.d.ts.map +1 -1
- package/dist/components/select-menu/SelectMenu.js +107 -79
- package/dist/components/select-menu/index.d.ts +2 -0
- package/dist/components/select-menu/index.d.ts.map +1 -1
- package/dist/components/select-menu/index.js +1 -0
- package/dist/components/select-menu/select-menu-config.d.ts +82 -0
- package/dist/components/select-menu/select-menu-config.d.ts.map +1 -0
- package/dist/components/select-menu/select-menu-config.js +12 -0
- package/dist/components/sidebar/Sidebar.d.ts +151 -51
- package/dist/components/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.js +211 -232
- package/dist/components/sidebar/sidebar-config.d.ts +140 -21
- package/dist/components/sidebar/sidebar-config.d.ts.map +1 -1
- package/dist/components/sidebar/sidebar-config.js +9 -12
- package/dist/components/sidebar/sidebar-styles.d.ts +24 -0
- package/dist/components/sidebar/sidebar-styles.d.ts.map +1 -1
- package/dist/components/spinner/spinner-config.d.ts +15 -9
- package/dist/components/spinner/spinner-config.d.ts.map +1 -1
- package/dist/components/spinner/spinner-styles.d.ts +10 -3
- package/dist/components/spinner/spinner-styles.d.ts.map +1 -1
- package/dist/components/spinner/spinner.d.ts +27 -20
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/spinner/spinner.js +18 -18
- package/dist/components/switch/Switch.d.ts +109 -9
- package/dist/components/switch/Switch.d.ts.map +1 -1
- package/dist/components/switch/Switch.js +19 -19
- package/dist/components/switch/switch-config.d.ts +20 -6
- package/dist/components/switch/switch-config.d.ts.map +1 -1
- package/dist/components/switch/switch-config.js +8 -16
- package/dist/components/switch/switch-styles.d.ts +17 -0
- package/dist/components/switch/switch-styles.d.ts.map +1 -1
- package/dist/components/table/Table.d.ts +101 -28
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/Table.js +56 -56
- package/dist/components/table/table-config.d.ts +75 -8
- package/dist/components/table/table-config.d.ts.map +1 -1
- package/dist/components/table/table-styles.d.ts +25 -6
- package/dist/components/table/table-styles.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.d.ts +84 -31
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +44 -44
- package/dist/components/tabs/tabs-config.d.ts +102 -9
- package/dist/components/tabs/tabs-config.d.ts.map +1 -1
- package/dist/components/tabs/tabs-styles.d.ts +16 -4
- package/dist/components/tabs/tabs-styles.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.d.ts +105 -11
- package/dist/components/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/textarea/Textarea.js +27 -24
- package/dist/components/textarea/textarea-config.d.ts +21 -0
- package/dist/components/textarea/textarea-config.d.ts.map +1 -1
- package/dist/components/textarea/textarea-config.js +8 -16
- package/dist/components/textarea/textarea-styles.d.ts +9 -0
- package/dist/components/textarea/textarea-styles.d.ts.map +1 -1
- package/dist/components/textarea/textarea-styles.js +5 -9
- package/dist/components/toast/ToastItem.d.ts +58 -4
- package/dist/components/toast/ToastItem.d.ts.map +1 -1
- package/dist/components/toast/ToastItem.js +18 -18
- package/dist/components/toast/toast-config.d.ts +104 -6
- package/dist/components/toast/toast-config.d.ts.map +1 -1
- package/dist/components/toast/toast-context.d.ts +123 -11
- package/dist/components/toast/toast-context.d.ts.map +1 -1
- package/dist/components/toast/toast-context.js +19 -19
- package/dist/components/toast/toast-styles.d.ts +27 -5
- package/dist/components/toast/toast-styles.d.ts.map +1 -1
- package/dist/components/toast/use-pausable-timeout.d.ts +29 -0
- package/dist/components/toast/use-pausable-timeout.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +76 -16
- package/dist/components/tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/Tooltip.js +25 -25
- package/dist/components/tooltip/tooltip-config.d.ts +73 -3
- package/dist/components/tooltip/tooltip-config.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip-styles.d.ts +12 -0
- package/dist/components/tooltip/tooltip-styles.d.ts.map +1 -1
- package/dist/config/config.d.ts +50 -2
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/default-config.d.ts +5 -0
- package/dist/config/default-config.d.ts.map +1 -1
- package/dist/config/default-config.js +23 -0
- package/dist/config/define-config.d.ts +23 -0
- package/dist/config/define-config.d.ts.map +1 -1
- package/dist/config/resolve-color.d.ts +25 -0
- package/dist/config/resolve-color.d.ts.map +1 -1
- package/dist/config/resolve-config.d.ts +23 -0
- package/dist/config/resolve-config.d.ts.map +1 -1
- package/dist/index.css +43 -7
- package/dist/index.d.ts +30 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +120 -115
- package/dist/libs/context.d.ts +50 -1
- package/dist/libs/context.d.ts.map +1 -1
- package/dist/libs/registry.d.ts +61 -5
- package/dist/libs/registry.d.ts.map +1 -1
- package/dist/libs/use-isomorphic-layout-effect.d.ts +18 -0
- package/dist/libs/use-isomorphic-layout-effect.d.ts.map +1 -1
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/radius.d.ts +37 -1
- package/dist/shared/radius.d.ts.map +1 -1
- package/dist/shared/variant.d.ts +31 -0
- package/dist/shared/variant.d.ts.map +1 -1
- package/dist/shared/variant.js +132 -45
- package/dist/theme/color.d.ts +89 -1
- package/dist/theme/color.d.ts.map +1 -1
- package/dist/theme/controller.d.ts +121 -0
- package/dist/theme/controller.d.ts.map +1 -1
- package/dist/theme/controller.js +84 -0
- package/dist/theme/useTheme.d.ts +68 -0
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +23 -0
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/resolve-token.d.ts +101 -0
- package/dist/utils/resolve-token.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/components/keyboard/default-keyboard-config.d.ts +0 -10
- package/dist/components/keyboard/default-keyboard-config.d.ts.map +0 -1
- package/dist/shared/size.d.ts +0 -2
- package/dist/shared/size.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/switch/Switch.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/switch/Switch.tsx"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,mBAAmB,EAIzB,MAAM,OAAO,CAAC;AAWf,OAAO,EAA0B,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAU5E,KAAK,eAAe,GAAG,YAAY,GACjC,IAAI,CACF,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAC3C,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CAC7E;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,eAAO,MAAM,MAAM,0GAiLlB,CAAC"}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
import { jsx as r, jsxs as P } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef as Q, useId as X, useState as Y, useCallback as $ } from "react";
|
|
4
4
|
import { useAsheeConfig as q } from "../../libs/context.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { resolveCascade as S, resolveRadiusKey as re, resolveClassKey as l } from "../../utils/resolve-token.js";
|
|
8
|
-
import { FieldShell as te } from "../field/FieldShell.js";
|
|
5
|
+
import { resolveCascade as S, resolveRadiusKey as ee, resolveClassKey as l } from "../../utils/resolve-token.js";
|
|
6
|
+
import { FieldShell as se } from "../field/FieldShell.js";
|
|
9
7
|
import { FALLBACK_SWITCH_CONFIG as s } from "./switch-config.js";
|
|
10
|
-
import { SWITCH_TRACK_SIZE_CLASS as
|
|
8
|
+
import { SWITCH_TRACK_SIZE_CLASS as re, SWITCH_THUMB_SIZE_CLASS as te, SWITCH_THUMB_TRANSLATE_CLASS as oe, SWITCH_STATUS_BORDER_CLASS as A } from "./switch-styles.js";
|
|
9
|
+
import { RADIUS_CLASS as ie } from "../../shared/radius.js";
|
|
10
|
+
import { resolveVariantClass as le } from "../../shared/variant.js";
|
|
11
11
|
import { cn as a } from "../../utils/cn.js";
|
|
12
12
|
const ae = Q(
|
|
13
13
|
({
|
|
14
14
|
size: k,
|
|
15
15
|
color: _,
|
|
16
16
|
radius: I,
|
|
17
|
-
status:
|
|
18
|
-
label:
|
|
17
|
+
status: y,
|
|
18
|
+
label: T,
|
|
19
19
|
labelAlign: z,
|
|
20
20
|
description: x,
|
|
21
21
|
message: N,
|
|
@@ -24,14 +24,14 @@ const ae = Q(
|
|
|
24
24
|
id: R,
|
|
25
25
|
className: w,
|
|
26
26
|
style: H,
|
|
27
|
-
disabled:
|
|
27
|
+
disabled: K,
|
|
28
28
|
checked: c,
|
|
29
|
-
defaultChecked:
|
|
29
|
+
defaultChecked: L = !1,
|
|
30
30
|
onChange: t,
|
|
31
31
|
...B
|
|
32
32
|
}, U) => {
|
|
33
33
|
var h;
|
|
34
|
-
const v = q(), e = (h = v.components) == null ? void 0 : h.switch, W = X(), d = R ?? W, [g, E] = Y(
|
|
34
|
+
const v = q(), e = (h = v.components) == null ? void 0 : h.switch, W = X(), d = R ?? W, [g, E] = Y(L), o = c ?? g, m = S(
|
|
35
35
|
k,
|
|
36
36
|
e == null ? void 0 : e.size,
|
|
37
37
|
void 0,
|
|
@@ -41,33 +41,33 @@ const ae = Q(
|
|
|
41
41
|
e == null ? void 0 : e.color,
|
|
42
42
|
v.defaultColor,
|
|
43
43
|
s.color
|
|
44
|
-
), D =
|
|
44
|
+
), D = ee(
|
|
45
45
|
I,
|
|
46
46
|
e == null ? void 0 : e.radius,
|
|
47
47
|
void 0,
|
|
48
48
|
s.radius
|
|
49
|
-
), u =
|
|
49
|
+
), u = y ?? s.status, j = S(
|
|
50
50
|
z,
|
|
51
51
|
e == null ? void 0 : e.labelAlign,
|
|
52
52
|
void 0,
|
|
53
53
|
s.labelAlign
|
|
54
54
|
), M = l(
|
|
55
55
|
m,
|
|
56
|
-
|
|
56
|
+
re,
|
|
57
57
|
s.size
|
|
58
58
|
), O = l(
|
|
59
59
|
m,
|
|
60
|
-
|
|
60
|
+
te,
|
|
61
61
|
s.size
|
|
62
62
|
), Z = l(
|
|
63
63
|
m,
|
|
64
|
-
|
|
64
|
+
oe,
|
|
65
65
|
s.size
|
|
66
66
|
), f = l(
|
|
67
67
|
D,
|
|
68
|
-
|
|
68
|
+
ie,
|
|
69
69
|
s.radius
|
|
70
|
-
), G = A[u] ?? A.default, V =
|
|
70
|
+
), G = A[u] ?? A.default, V = le("solid", F), i = K || n, J = $(
|
|
71
71
|
(b) => {
|
|
72
72
|
if (i) return;
|
|
73
73
|
const C = b.target.checked;
|
|
@@ -76,10 +76,10 @@ const ae = Q(
|
|
|
76
76
|
[c, i, t]
|
|
77
77
|
);
|
|
78
78
|
return /* @__PURE__ */ r(
|
|
79
|
-
|
|
79
|
+
se,
|
|
80
80
|
{
|
|
81
81
|
id: d,
|
|
82
|
-
label:
|
|
82
|
+
label: T,
|
|
83
83
|
labelAlign: j,
|
|
84
84
|
description: x,
|
|
85
85
|
message: N,
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
import { Radius } from '../../shared/radius';
|
|
2
|
-
import { Color } from '../../shared/variant';
|
|
3
1
|
import { FieldConfig, FieldSizeKey } from '../field/field-config';
|
|
2
|
+
/**
|
|
3
|
+
* Size key for the switch component.
|
|
4
|
+
* Maps to the FieldSizeKey type: "sm", "md", or "lg".
|
|
5
|
+
*/
|
|
4
6
|
export type SwitchSizeKey = FieldSizeKey;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Theme configuration options for the Switch component.
|
|
9
|
+
*
|
|
10
|
+
* Set under `components.switch` in the AsheeUI config. Values feed the
|
|
11
|
+
* component-level fallback tier of the theme cascade.
|
|
12
|
+
*/
|
|
13
|
+
export interface SwitchConfig extends FieldConfig {
|
|
9
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Default config values registered for the Switch component.
|
|
17
|
+
* Inherits the default field configuration.
|
|
18
|
+
*/
|
|
10
19
|
export declare const defaultSwitchConfig: SwitchConfig;
|
|
20
|
+
/**
|
|
21
|
+
* Hard fallback values used when no config tier provides a value.
|
|
22
|
+
* These values are used when instance props, component config,
|
|
23
|
+
* and global defaults are all undefined.
|
|
24
|
+
*/
|
|
11
25
|
export declare const FALLBACK_SWITCH_CONFIG: Required<SwitchConfig>;
|
|
12
26
|
declare module "../../libs/registry" {
|
|
13
27
|
interface ComponentTypeConfigRegistry {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch-config.d.ts","sourceRoot":"","sources":["../../../src/components/switch/switch-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"switch-config.d.ts","sourceRoot":"","sources":["../../../src/components/switch/switch-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAE/B;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW;CAAG;AAEpD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAGjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,YAAY,CACnC,CAAC;AAExB,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,MAAM,EAAE,YAAY,CAAC;KACtB;CACF"}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { registerComponentDefaults as
|
|
3
|
-
import { FALLBACK_FIELD_CONFIG as
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
labelAlign: "left",
|
|
2
|
+
import { registerComponentDefaults as t } from "../../libs/registry.js";
|
|
3
|
+
import { FALLBACK_FIELD_CONFIG as o, defaultFieldConfig as e } from "../field/field-config.js";
|
|
4
|
+
const i = {
|
|
5
|
+
...e,
|
|
7
6
|
radius: "full"
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
size: "md",
|
|
11
|
-
radius: "full",
|
|
12
|
-
color: "primary",
|
|
13
|
-
status: "default",
|
|
14
|
-
labelAlign: "left"
|
|
15
|
-
};
|
|
16
|
-
l("switch", e);
|
|
7
|
+
}, C = o;
|
|
8
|
+
t("switch", i);
|
|
17
9
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
C as FALLBACK_SWITCH_CONFIG,
|
|
11
|
+
i as defaultSwitchConfig
|
|
20
12
|
};
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { FieldSizeKey, FieldStatus } from '../field/field-config';
|
|
2
|
+
/**
|
|
3
|
+
* CSS classes for switch track size.
|
|
4
|
+
* Maps size keys to Tailwind width, height, and padding classes.
|
|
5
|
+
*/
|
|
2
6
|
export declare const SWITCH_TRACK_SIZE_CLASS: Record<FieldSizeKey, string>;
|
|
7
|
+
/**
|
|
8
|
+
* CSS classes for switch thumb size.
|
|
9
|
+
* Maps size keys to Tailwind width and height classes.
|
|
10
|
+
*/
|
|
3
11
|
export declare const SWITCH_THUMB_SIZE_CLASS: Record<FieldSizeKey, string>;
|
|
12
|
+
/**
|
|
13
|
+
* CSS classes for switch thumb translation.
|
|
14
|
+
* Maps size keys to Tailwind translate classes that control how far
|
|
15
|
+
* the thumb moves when checked.
|
|
16
|
+
*/
|
|
4
17
|
export declare const SWITCH_THUMB_TRANSLATE_CLASS: Record<FieldSizeKey, string>;
|
|
18
|
+
/**
|
|
19
|
+
* CSS classes for switch status border styles.
|
|
20
|
+
* Re-exports the FIELD_STATUS_BORDER_CLASS for consistent validation styling.
|
|
21
|
+
*/
|
|
5
22
|
export declare const SWITCH_STATUS_BORDER_CLASS: Record<FieldStatus, string>;
|
|
6
23
|
//# sourceMappingURL=switch-styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch-styles.d.ts","sourceRoot":"","sources":["../../../src/components/switch/switch-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEvE,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAIhE,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAIhE,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAIrE,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAKlE,CAAC"}
|
|
1
|
+
{"version":3,"file":"switch-styles.d.ts","sourceRoot":"","sources":["../../../src/components/switch/switch-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAIhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAIhE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAIrE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAKlE,CAAC"}
|
|
@@ -1,43 +1,116 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { ColumnDef, TableConfig } from './table-config';
|
|
3
|
+
type BaseTableProps = TableConfig & Omit<HTMLAttributes<HTMLDivElement>, "color" | "onClick">;
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for the Table component.
|
|
6
|
+
*/
|
|
7
|
+
export interface TableProps<TData> extends BaseTableProps {
|
|
8
|
+
/**
|
|
9
|
+
* Array of row data objects.
|
|
10
|
+
* Each object represents a row in the table.
|
|
11
|
+
*/
|
|
7
12
|
data: TData[];
|
|
8
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Column definition array.
|
|
15
|
+
* Defines the headers and cell renderers for each column.
|
|
16
|
+
*/
|
|
9
17
|
columns: ColumnDef<TData>[];
|
|
10
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Optional Tailwind grid or layout utility classes.
|
|
20
|
+
* Used for custom grid layouts in the table.
|
|
21
|
+
*/
|
|
11
22
|
gridClasses?: string;
|
|
12
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Accessor callback to return a unique key per row.
|
|
25
|
+
* Used as the React key for each row element.
|
|
26
|
+
*/
|
|
13
27
|
rowKeyAccessor?: (row: TData) => string | number;
|
|
14
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Primary row click handler.
|
|
30
|
+
* Called when a row is clicked.
|
|
31
|
+
*/
|
|
15
32
|
handleClick?: (data: TData, rowId?: string | number) => void;
|
|
16
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Primary row double-click handler.
|
|
35
|
+
* Called when a row is double-clicked.
|
|
36
|
+
*/
|
|
17
37
|
handleDoubleClick?: (data: TData, rowId?: string | number) => void;
|
|
18
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Key of currently selected row.
|
|
40
|
+
* Highlights the row with the matching key.
|
|
41
|
+
*/
|
|
19
42
|
selectedRowKey?: string | number;
|
|
20
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Display text or React element when data array is empty.
|
|
45
|
+
* Shown in the table body when there are no rows.
|
|
46
|
+
*/
|
|
21
47
|
emptyMessage?: ReactNode;
|
|
22
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Enables interactive hover, active press animations, and click styling on rows.
|
|
50
|
+
* When true, rows become clickable with visual feedback.
|
|
51
|
+
*/
|
|
23
52
|
isClickable?: boolean;
|
|
24
|
-
/** Visual table style variant. */
|
|
25
|
-
variant?: TableVariant;
|
|
26
|
-
/** Color token for row selections, hover states, and keyboard focus rings. */
|
|
27
|
-
color?: Color;
|
|
28
|
-
/** Density/size scale key. */
|
|
29
|
-
size?: TableSizeKey;
|
|
30
|
-
/** Border radius token key. */
|
|
31
|
-
radius?: Radius;
|
|
32
|
-
/** Custom class for header container. */
|
|
33
|
-
headerClassName?: string;
|
|
34
|
-
/** Custom class for individual row elements. */
|
|
35
|
-
rowClassName?: string;
|
|
36
|
-
/** Custom class for individual cells. */
|
|
37
|
-
cellClassName?: string;
|
|
38
53
|
}
|
|
39
|
-
|
|
54
|
+
/**
|
|
55
|
+
* A data table with configurable columns, row selection, and interactive states.
|
|
56
|
+
*
|
|
57
|
+
* Table renders a structured data grid with support for multiple variants
|
|
58
|
+
* (grid, striped, bordered, ghost), configurable size and color tokens,
|
|
59
|
+
* row selection highlighting, and interactive click handlers. It automatically
|
|
60
|
+
* handles accessibility attributes including aria-selected for selected rows,
|
|
61
|
+
* and keyboard interaction for clickable rows.
|
|
62
|
+
*
|
|
63
|
+
* Visual tokens resolve through the standard AsheeUI cascade: prop,
|
|
64
|
+
* component config, global theme defaults, and the built-in fallback.
|
|
65
|
+
*
|
|
66
|
+
* @param props - Table configuration options.
|
|
67
|
+
* @param props.data - Array of row data objects.
|
|
68
|
+
* @param props.columns - Column definition array.
|
|
69
|
+
* @param props.rowKeyAccessor - Function to generate unique row keys.
|
|
70
|
+
* @param props.handleClick - Row click handler.
|
|
71
|
+
* @param props.handleDoubleClick - Row double-click handler.
|
|
72
|
+
* @param props.selectedRowKey - Key of the currently selected row.
|
|
73
|
+
* @param props.emptyMessage - Message shown when data is empty.
|
|
74
|
+
* @param props.isClickable - Whether rows are interactive. Defaults to false.
|
|
75
|
+
* @param props.size - Density scale. Defaults to "md".
|
|
76
|
+
* @param props.variant - Visual style variant. Defaults to "grid".
|
|
77
|
+
* @param props.color - Theme accent color. Defaults to "primary".
|
|
78
|
+
* @param props.radius - Corner rounding. Defaults to "md".
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* import { Table } from "asheeui";
|
|
83
|
+
*
|
|
84
|
+
* const columns = [
|
|
85
|
+
* { header: "Name", cell: (row) => row.name },
|
|
86
|
+
* { header: "Email", cell: (row) => row.email },
|
|
87
|
+
* ];
|
|
88
|
+
*
|
|
89
|
+
* const data = [
|
|
90
|
+
* { name: "John Doe", email: "john@example.com" },
|
|
91
|
+
* { name: "Jane Smith", email: "jane@example.com" },
|
|
92
|
+
* ];
|
|
93
|
+
*
|
|
94
|
+
* export function Example() {
|
|
95
|
+
* return (
|
|
96
|
+
* <Table
|
|
97
|
+
* data={data}
|
|
98
|
+
* columns={columns}
|
|
99
|
+
* variant="striped"
|
|
100
|
+
* isClickable
|
|
101
|
+
* handleClick={(row) => console.log(row)}
|
|
102
|
+
* />
|
|
103
|
+
* );
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @see TableConfig - The configuration type for component defaults.
|
|
108
|
+
* @see ColumnDef - The column definition type.
|
|
109
|
+
* @see useAsheeConfig - Hook for accessing the global configuration.
|
|
110
|
+
*/
|
|
111
|
+
export declare function Table<TData>({ data, columns, gridClasses, rowKeyAccessor, handleClick, handleDoubleClick, selectedRowKey, emptyMessage, isClickable, variant, color, size, radius, headerClassName, rowClassName, cellClassName, className, style, ...props }: TableProps<TData>): import("react").JSX.Element;
|
|
40
112
|
export declare namespace Table {
|
|
41
113
|
var displayName: string;
|
|
42
114
|
}
|
|
115
|
+
export {};
|
|
43
116
|
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/table/Table.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/components/table/Table.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAUzE,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,WAAW,EAEjB,MAAM,gBAAgB,CAAC;AASxB,KAAK,cAAc,GAAG,WAAW,GAC/B,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,KAAK,CAAE,SAAQ,cAAc;IACvD;;;OAGG;IACH,IAAI,EAAE,KAAK,EAAE,CAAC;IAEd;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;IAE5B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,MAAM,GAAG,MAAM,CAAC;IAEjD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAE7D;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAEnE;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEjC;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,EAC3B,IAAS,EACT,OAAY,EACZ,WAAW,EACX,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,YAAmC,EACnC,WAAW,EACX,OAAO,EACP,KAAK,EACL,IAAI,EACJ,MAAM,EACN,eAAe,EACf,YAAY,EACZ,aAAa,EACb,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,UAAU,CAAC,KAAK,CAAC,+BAsOnB;yBA1Pe,KAAK"}
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
import { jsx as t, jsxs as V } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback as W } from "react";
|
|
4
4
|
import { useAsheeConfig as Z } from "../../libs/context.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
9
|
import { cn as l } from "../../utils/cn.js";
|
|
10
|
-
function
|
|
10
|
+
function ae({
|
|
11
11
|
data: u = [],
|
|
12
12
|
columns: n = [],
|
|
13
|
-
gridClasses:
|
|
14
|
-
rowKeyAccessor:
|
|
13
|
+
gridClasses: de,
|
|
14
|
+
rowKeyAccessor: y,
|
|
15
15
|
handleClick: i,
|
|
16
|
-
handleDoubleClick:
|
|
17
|
-
selectedRowKey:
|
|
18
|
-
emptyMessage:
|
|
19
|
-
isClickable:
|
|
20
|
-
variant:
|
|
16
|
+
handleDoubleClick: h,
|
|
17
|
+
selectedRowKey: x,
|
|
18
|
+
emptyMessage: z = "No items available",
|
|
19
|
+
isClickable: B,
|
|
20
|
+
variant: D,
|
|
21
21
|
color: R,
|
|
22
22
|
size: F,
|
|
23
23
|
radius: O,
|
|
@@ -29,58 +29,58 @@ function se({
|
|
|
29
29
|
...j
|
|
30
30
|
}) {
|
|
31
31
|
var E;
|
|
32
|
-
const
|
|
32
|
+
const v = Z(), e = (E = v.components) == null ? void 0 : E.table, p = L(
|
|
33
33
|
F,
|
|
34
34
|
e == null ? void 0 : e.size,
|
|
35
35
|
void 0,
|
|
36
|
-
|
|
36
|
+
s.size
|
|
37
37
|
), c = L(
|
|
38
|
-
|
|
38
|
+
D,
|
|
39
39
|
e == null ? void 0 : e.variant,
|
|
40
40
|
void 0,
|
|
41
|
-
|
|
41
|
+
s.variant
|
|
42
42
|
), C = L(
|
|
43
43
|
R,
|
|
44
44
|
e == null ? void 0 : e.color,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
), N = (r) => r === "full" ? "xl" : r, P =
|
|
45
|
+
v.defaultColor,
|
|
46
|
+
s.color
|
|
47
|
+
), N = (r) => r === "full" ? "xl" : r, P = $(
|
|
48
48
|
N(O),
|
|
49
49
|
N(e == null ? void 0 : e.radius),
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
v.defaultRadius,
|
|
51
|
+
s.radius
|
|
52
52
|
), _ = m(
|
|
53
53
|
p,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
k,
|
|
55
|
+
s.size
|
|
56
56
|
), f = m(
|
|
57
57
|
p,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
ee,
|
|
59
|
+
s.size
|
|
60
60
|
), X = m(
|
|
61
61
|
p,
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
re,
|
|
63
|
+
s.size
|
|
64
64
|
), H = m(
|
|
65
65
|
p,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
te,
|
|
67
|
+
s.size
|
|
68
68
|
), U = m(
|
|
69
69
|
P,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
), S =
|
|
73
|
-
(r,
|
|
74
|
-
if (
|
|
70
|
+
se,
|
|
71
|
+
s.radius
|
|
72
|
+
), S = K[C] ?? K.primary, q = W(
|
|
73
|
+
(r, a) => {
|
|
74
|
+
if (y)
|
|
75
75
|
try {
|
|
76
|
-
return
|
|
76
|
+
return y(r);
|
|
77
77
|
} catch {
|
|
78
|
-
return
|
|
78
|
+
return a;
|
|
79
79
|
}
|
|
80
|
-
return
|
|
80
|
+
return a;
|
|
81
81
|
},
|
|
82
|
-
[
|
|
83
|
-
), J = Array.isArray(u) && u.length > 0, b =
|
|
82
|
+
[y]
|
|
83
|
+
), J = Array.isArray(u) && u.length > 0, b = B ?? !!(i || h);
|
|
84
84
|
return /* @__PURE__ */ t(
|
|
85
85
|
"div",
|
|
86
86
|
{
|
|
@@ -101,8 +101,8 @@ function se({
|
|
|
101
101
|
e == null ? void 0 : e.headerClassName,
|
|
102
102
|
w
|
|
103
103
|
),
|
|
104
|
-
children: /* @__PURE__ */ t("tr", { children: n.map((r,
|
|
105
|
-
const
|
|
104
|
+
children: /* @__PURE__ */ t("tr", { children: n.map((r, a) => {
|
|
105
|
+
const o = r.id ?? (typeof r.header == "string" ? r.header : String(a));
|
|
106
106
|
return /* @__PURE__ */ t(
|
|
107
107
|
"th",
|
|
108
108
|
{
|
|
@@ -112,28 +112,28 @@ function se({
|
|
|
112
112
|
_,
|
|
113
113
|
f,
|
|
114
114
|
H,
|
|
115
|
-
c === "grid" &&
|
|
115
|
+
c === "grid" && a < n.length - 1 && "border-r border-border",
|
|
116
116
|
e == null ? void 0 : e.cellClassName,
|
|
117
117
|
A
|
|
118
118
|
),
|
|
119
119
|
children: r.header
|
|
120
120
|
},
|
|
121
|
-
|
|
121
|
+
o
|
|
122
122
|
);
|
|
123
123
|
}) })
|
|
124
124
|
}
|
|
125
125
|
),
|
|
126
|
-
/* @__PURE__ */ t("tbody", { children: J ? u.map((r,
|
|
127
|
-
const
|
|
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
128
|
return /* @__PURE__ */ t(
|
|
129
129
|
"tr",
|
|
130
130
|
{
|
|
131
131
|
tabIndex: b ? 0 : -1,
|
|
132
132
|
"aria-selected": g,
|
|
133
|
-
onClick: b && i ? () => i(r,
|
|
134
|
-
onDoubleClick: b &&
|
|
135
|
-
onKeyDown: (
|
|
136
|
-
b && (
|
|
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
137
|
},
|
|
138
138
|
className: l(
|
|
139
139
|
"border-b border-border/60 transition-all duration-150 outline-none align-middle",
|
|
@@ -149,8 +149,8 @@ function se({
|
|
|
149
149
|
e == null ? void 0 : e.rowClassName,
|
|
150
150
|
G
|
|
151
151
|
),
|
|
152
|
-
children: n.map((
|
|
153
|
-
const Q =
|
|
152
|
+
children: n.map((d, T) => {
|
|
153
|
+
const Q = d.id ?? (typeof d.header == "string" ? d.header : String(T));
|
|
154
154
|
return /* @__PURE__ */ t(
|
|
155
155
|
"td",
|
|
156
156
|
{
|
|
@@ -162,27 +162,27 @@ function se({
|
|
|
162
162
|
e == null ? void 0 : e.cellClassName,
|
|
163
163
|
A
|
|
164
164
|
),
|
|
165
|
-
children:
|
|
165
|
+
children: d.cell(r)
|
|
166
166
|
},
|
|
167
167
|
Q
|
|
168
168
|
);
|
|
169
169
|
})
|
|
170
170
|
},
|
|
171
|
-
String(
|
|
171
|
+
String(o)
|
|
172
172
|
);
|
|
173
173
|
}) : /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t(
|
|
174
174
|
"td",
|
|
175
175
|
{
|
|
176
176
|
colSpan: n.length || 1,
|
|
177
177
|
className: "h-48 text-center align-middle p-6 text-sm text-foreground/70",
|
|
178
|
-
children:
|
|
178
|
+
children: z
|
|
179
179
|
}
|
|
180
180
|
) }) })
|
|
181
181
|
] })
|
|
182
182
|
}
|
|
183
183
|
);
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
ae.displayName = "Table";
|
|
186
186
|
export {
|
|
187
|
-
|
|
187
|
+
ae as Table
|
|
188
188
|
};
|