@fangxinyan/lumina 0.1.6 → 0.2.1
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 +18 -7
- package/dist/{Accordion-GSBY5T5U.css → Accordion-3TQPKNN3.css} +8 -1
- package/dist/Accordion.cjs +2 -2
- package/dist/Accordion.d.cts +12 -0
- package/dist/Accordion.d.ts +12 -0
- package/dist/Accordion.js +1 -1
- package/dist/{Alert-LSKBYDRI.css → Alert-JJ7GB3UU.css} +11 -0
- package/dist/Alert.cjs +2 -2
- package/dist/Alert.d.cts +4 -0
- package/dist/Alert.d.ts +4 -0
- package/dist/Alert.js +1 -1
- package/dist/{Avatar-OXDSG5Q6.css → Avatar-R5A4AFKZ.css} +4 -0
- package/dist/Avatar.cjs +2 -2
- package/dist/Avatar.d.cts +2 -0
- package/dist/Avatar.d.ts +2 -0
- package/dist/Avatar.js +1 -1
- package/dist/{Button-5UI7QXGU.css → Button-SDQD25AG.css} +2 -0
- package/dist/Button.cjs +3 -3
- package/dist/Button.d.cts +2 -0
- package/dist/Button.d.ts +2 -0
- package/dist/Button.js +1 -1
- package/dist/Calendar.cjs +2 -2
- package/dist/Calendar.d.cts +8 -0
- package/dist/Calendar.d.ts +8 -0
- package/dist/Calendar.js +1 -1
- package/dist/{Card-2CHHFD4Y.css → Card-RG7ECXL2.css} +11 -0
- package/dist/Card.cjs +3 -3
- package/dist/Card.d.cts +2 -0
- package/dist/Card.d.ts +2 -0
- package/dist/Card.js +1 -1
- package/dist/{Divider-Z37INS5E.css → Divider-OEE4Q2KS.css} +31 -0
- package/dist/Divider.cjs +2 -2
- package/dist/Divider.d.cts +7 -0
- package/dist/Divider.d.ts +7 -0
- package/dist/Divider.js +1 -1
- package/dist/{Empty-VM23UNLQ.css → Empty-NQ72W3D7.css} +22 -0
- package/dist/Empty.cjs +4 -4
- package/dist/Empty.d.cts +42 -2
- package/dist/Empty.d.ts +42 -2
- package/dist/Empty.js +1 -1
- package/dist/Input-33CAH4O6.css +134 -0
- package/dist/Input.cjs +3 -3
- package/dist/Input.d.cts +17 -1
- package/dist/Input.d.ts +17 -1
- package/dist/Input.js +1 -1
- package/dist/Modal.cjs +3 -3
- package/dist/Modal.js +2 -2
- package/dist/{Pagination-6FFOI4NM.css → Pagination-YIRYJUXP.css} +33 -0
- package/dist/Pagination.cjs +5 -2
- package/dist/Pagination.d.cts +14 -0
- package/dist/Pagination.d.ts +14 -0
- package/dist/Pagination.js +4 -1
- package/dist/Select.cjs +3 -3
- package/dist/Select.js +2 -2
- package/dist/{Slider-RE4HZQKF.css → Slider-X4PVA65R.css} +51 -2
- package/dist/Slider.cjs +2 -2
- package/dist/Slider.d.cts +20 -5
- package/dist/Slider.d.ts +20 -5
- package/dist/Slider.js +1 -1
- package/dist/Switch-36KJNDXM.css +92 -0
- package/dist/Switch.cjs +2 -2
- package/dist/Switch.d.cts +4 -0
- package/dist/Switch.d.ts +4 -0
- package/dist/Switch.js +1 -1
- package/dist/Table-YKVM42SW.css +295 -0
- package/dist/Table.cjs +7 -3
- package/dist/Table.d.cts +103 -7
- package/dist/Table.d.ts +103 -7
- package/dist/Table.js +5 -1
- package/dist/{Tabs-A27TSZOP.css → Tabs-RHK6XAFF.css} +7 -0
- package/dist/Tabs.cjs +3 -3
- package/dist/Tabs.d.cts +2 -0
- package/dist/Tabs.d.ts +2 -0
- package/dist/Tabs.js +1 -1
- package/dist/{Tag-EYOY3UWG.css → Tag-FGDY3W7E.css} +2 -0
- package/dist/Tag.cjs +3 -3
- package/dist/Tag.d.cts +5 -0
- package/dist/Tag.d.ts +5 -0
- package/dist/Tag.js +1 -1
- package/dist/chunk-437LB2V4.js +111 -0
- package/dist/chunk-437LB2V4.js.map +1 -0
- package/dist/chunk-4MR4GVTD.js +73 -0
- package/dist/chunk-4MR4GVTD.js.map +1 -0
- package/dist/{chunk-OXYFB2ZI.js → chunk-4U4OY5RA.js} +11 -5
- package/dist/chunk-4U4OY5RA.js.map +1 -0
- package/dist/{chunk-5EYI27B6.js → chunk-77BVQNAQ.js} +5 -3
- package/dist/chunk-77BVQNAQ.js.map +1 -0
- package/dist/{chunk-3QWHDCHJ.js → chunk-AJZKESHB.js} +13 -4
- package/dist/chunk-AJZKESHB.js.map +1 -0
- package/dist/{chunk-NZPJ7BUB.cjs → chunk-AXMEZGEG.cjs} +13 -4
- package/dist/chunk-AXMEZGEG.cjs.map +1 -0
- package/dist/{chunk-HTP6UEVR.js → chunk-BBPNQ44M.js} +22 -6
- package/dist/chunk-BBPNQ44M.js.map +1 -0
- package/dist/{chunk-QQXIWOI3.cjs → chunk-CCBHZYE6.cjs} +5 -5
- package/dist/{chunk-QQXIWOI3.cjs.map → chunk-CCBHZYE6.cjs.map} +1 -1
- package/dist/chunk-E6R63QOL.js +476 -0
- package/dist/chunk-E6R63QOL.js.map +1 -0
- package/dist/{chunk-KGYLUZOU.cjs → chunk-EPFYIR63.cjs} +5 -5
- package/dist/{chunk-KGYLUZOU.cjs.map → chunk-EPFYIR63.cjs.map} +1 -1
- package/dist/chunk-F7HW2PYR.cjs +119 -0
- package/dist/chunk-F7HW2PYR.cjs.map +1 -0
- package/dist/chunk-GIVMKGZN.js +39 -0
- package/dist/chunk-GIVMKGZN.js.map +1 -0
- package/dist/{chunk-FMG3ZPGK.js → chunk-H6FCIJOP.js} +5 -3
- package/dist/chunk-H6FCIJOP.js.map +1 -0
- package/dist/{chunk-ALFDP5WX.cjs → chunk-IDM6JJLP.cjs} +22 -6
- package/dist/chunk-IDM6JJLP.cjs.map +1 -0
- package/dist/{chunk-I2ERCHFV.cjs → chunk-JKLQOB2F.cjs} +11 -5
- package/dist/chunk-JKLQOB2F.cjs.map +1 -0
- package/dist/{chunk-IGHLSNXT.cjs → chunk-K7PVJLW4.cjs} +51 -4
- package/dist/chunk-K7PVJLW4.cjs.map +1 -0
- package/dist/chunk-LDENBYRC.cjs +210 -0
- package/dist/chunk-LDENBYRC.cjs.map +1 -0
- package/dist/{chunk-OOBSH7EL.js → chunk-LSLYY5FN.js} +3 -3
- package/dist/{chunk-OOBSH7EL.js.map → chunk-LSLYY5FN.js.map} +1 -1
- package/dist/chunk-NSUD5B22.js +187 -0
- package/dist/chunk-NSUD5B22.js.map +1 -0
- package/dist/{chunk-AAMYURWQ.cjs → chunk-OPTTHURA.cjs} +5 -3
- package/dist/chunk-OPTTHURA.cjs.map +1 -0
- package/dist/{chunk-F3NHM4GX.js → chunk-OYGFMXAA.js} +13 -4
- package/dist/chunk-OYGFMXAA.js.map +1 -0
- package/dist/chunk-PBBHUUXU.cjs +133 -0
- package/dist/chunk-PBBHUUXU.cjs.map +1 -0
- package/dist/chunk-RDLPX7RK.cjs +95 -0
- package/dist/chunk-RDLPX7RK.cjs.map +1 -0
- package/dist/chunk-SBMOIE5C.cjs +499 -0
- package/dist/chunk-SBMOIE5C.cjs.map +1 -0
- package/dist/{chunk-XFRP2MBR.js → chunk-TYQ5CN2C.js} +51 -4
- package/dist/chunk-TYQ5CN2C.js.map +1 -0
- package/dist/{chunk-7CKHWCEA.cjs → chunk-TZSWDH5T.cjs} +5 -3
- package/dist/chunk-TZSWDH5T.cjs.map +1 -0
- package/dist/{chunk-VMHNKD3N.cjs → chunk-URF6RBW6.cjs} +13 -4
- package/dist/chunk-URF6RBW6.cjs.map +1 -0
- package/dist/{chunk-G3UWXSNQ.js → chunk-V34OPWKZ.js} +5 -4
- package/dist/chunk-V34OPWKZ.js.map +1 -0
- package/dist/{chunk-ITGCHU3Y.cjs → chunk-VICGQC6G.cjs} +5 -4
- package/dist/chunk-VICGQC6G.cjs.map +1 -0
- package/dist/chunk-YEOARJKR.cjs +40 -0
- package/dist/chunk-YEOARJKR.cjs.map +1 -0
- package/dist/chunk-Z5X5AMLA.cjs +41 -0
- package/dist/chunk-Z5X5AMLA.cjs.map +1 -0
- package/dist/chunk-Z7P6QGMT.js +115 -0
- package/dist/chunk-Z7P6QGMT.js.map +1 -0
- package/dist/{chunk-OYH6A7IQ.js → chunk-ZVCMXDTP.js} +3 -3
- package/dist/{chunk-OYH6A7IQ.js.map → chunk-ZVCMXDTP.js.map} +1 -1
- package/dist/chunk-ZWP4LSS3.js +38 -0
- package/dist/chunk-ZWP4LSS3.js.map +1 -0
- package/dist/index.cjs +43 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/styles.css +455 -30
- package/docs/llms/accordion.md +66 -0
- package/docs/llms/alert.md +64 -0
- package/docs/llms/avatar.md +55 -0
- package/docs/llms/badge.md +41 -0
- package/docs/llms/button.md +122 -0
- package/docs/llms/calendar.md +44 -0
- package/docs/llms/card.md +68 -0
- package/docs/llms/cascader.md +33 -0
- package/docs/llms/checkbox.md +41 -0
- package/docs/llms/colorpicker.md +82 -0
- package/docs/llms/divider.md +69 -0
- package/docs/llms/drawer.md +70 -0
- package/docs/llms/empty.md +52 -0
- package/docs/llms/icon.md +34 -0
- package/docs/llms/image.md +39 -0
- package/docs/llms/input.md +127 -0
- package/docs/llms/intro.md +6 -0
- package/docs/llms/list.md +41 -0
- package/docs/llms/modal.md +89 -0
- package/docs/llms/pagination.md +82 -0
- package/docs/llms/popover.md +34 -0
- package/docs/llms/progress.md +58 -0
- package/docs/llms/radio.md +43 -0
- package/docs/llms/select.md +99 -0
- package/docs/llms/sidebar.md +43 -0
- package/docs/llms/skeleton.md +88 -0
- package/docs/llms/slider.md +72 -0
- package/docs/llms/spinner.md +58 -0
- package/docs/llms/switch.md +60 -0
- package/docs/llms/table.md +188 -0
- package/docs/llms/tablepro.md +56 -0
- package/docs/llms/tabs.md +50 -0
- package/docs/llms/tag.md +77 -0
- package/docs/llms/theme.md +165 -0
- package/docs/llms/titlebar.md +40 -0
- package/docs/llms/toast.md +51 -0
- package/docs/llms/tooltip.md +38 -0
- package/docs/llms/typography.md +103 -0
- package/docs/llms/windowcontrols.md +31 -0
- package/docs/llms.md +97 -0
- package/package.json +8 -2
- package/dist/Input-Z526ARZP.css +0 -66
- package/dist/Switch-NP7KKJOX.css +0 -44
- package/dist/Table-ZDPGWLH3.css +0 -139
- package/dist/chunk-2VA2HSL4.cjs +0 -121
- package/dist/chunk-2VA2HSL4.cjs.map +0 -1
- package/dist/chunk-2W2AJUZW.js +0 -118
- package/dist/chunk-2W2AJUZW.js.map +0 -1
- package/dist/chunk-3QWHDCHJ.js.map +0 -1
- package/dist/chunk-4AA22BOG.js +0 -63
- package/dist/chunk-4AA22BOG.js.map +0 -1
- package/dist/chunk-5EYI27B6.js.map +0 -1
- package/dist/chunk-77NP67ML.cjs +0 -70
- package/dist/chunk-77NP67ML.cjs.map +0 -1
- package/dist/chunk-7CKHWCEA.cjs.map +0 -1
- package/dist/chunk-7NM5BRUX.js +0 -91
- package/dist/chunk-7NM5BRUX.js.map +0 -1
- package/dist/chunk-7UJI437T.js +0 -49
- package/dist/chunk-7UJI437T.js.map +0 -1
- package/dist/chunk-AAMYURWQ.cjs.map +0 -1
- package/dist/chunk-ALFDP5WX.cjs.map +0 -1
- package/dist/chunk-F3NHM4GX.js.map +0 -1
- package/dist/chunk-FMG3ZPGK.js.map +0 -1
- package/dist/chunk-G3UWXSNQ.js.map +0 -1
- package/dist/chunk-HTP6UEVR.js.map +0 -1
- package/dist/chunk-I2ERCHFV.cjs.map +0 -1
- package/dist/chunk-IBZAGURN.cjs +0 -71
- package/dist/chunk-IBZAGURN.cjs.map +0 -1
- package/dist/chunk-IGHLSNXT.cjs.map +0 -1
- package/dist/chunk-ITGCHU3Y.cjs.map +0 -1
- package/dist/chunk-JNFCTYJT.cjs +0 -31
- package/dist/chunk-JNFCTYJT.cjs.map +0 -1
- package/dist/chunk-JWFVSBVX.cjs +0 -30
- package/dist/chunk-JWFVSBVX.cjs.map +0 -1
- package/dist/chunk-K67KIKX4.cjs +0 -67
- package/dist/chunk-K67KIKX4.cjs.map +0 -1
- package/dist/chunk-M6OTFXZA.js +0 -48
- package/dist/chunk-M6OTFXZA.js.map +0 -1
- package/dist/chunk-NWJW5KLN.js +0 -29
- package/dist/chunk-NWJW5KLN.js.map +0 -1
- package/dist/chunk-NZPJ7BUB.cjs.map +0 -1
- package/dist/chunk-OXYFB2ZI.js.map +0 -1
- package/dist/chunk-QT7SJITQ.cjs +0 -114
- package/dist/chunk-QT7SJITQ.cjs.map +0 -1
- package/dist/chunk-VMHNKD3N.cjs.map +0 -1
- package/dist/chunk-VXITDXLW.js +0 -28
- package/dist/chunk-VXITDXLW.js.map +0 -1
- package/dist/chunk-XFRP2MBR.js.map +0 -1
package/dist/Slider.d.ts
CHANGED
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
type SliderSingleValue = number;
|
|
4
|
+
type SliderRangeValue = [number, number];
|
|
5
|
+
type SliderValue = SliderSingleValue | SliderRangeValue;
|
|
6
|
+
interface SliderBaseProps {
|
|
7
7
|
min?: number;
|
|
8
8
|
max?: number;
|
|
9
9
|
step?: number;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
showValue?: boolean;
|
|
12
12
|
tone?: "accent" | "success" | "warning" | "danger";
|
|
13
|
+
/** Tick marks with labels. Clicking a mark snaps to it. */
|
|
14
|
+
marks?: Record<number, React.ReactNode>;
|
|
13
15
|
className?: string;
|
|
14
16
|
}
|
|
17
|
+
interface SliderSingleProps extends SliderBaseProps {
|
|
18
|
+
range?: false;
|
|
19
|
+
value?: number;
|
|
20
|
+
defaultValue?: number;
|
|
21
|
+
onChange?: (value: number) => void;
|
|
22
|
+
}
|
|
23
|
+
interface SliderRangeProps extends SliderBaseProps {
|
|
24
|
+
range: true;
|
|
25
|
+
value?: SliderRangeValue;
|
|
26
|
+
defaultValue?: SliderRangeValue;
|
|
27
|
+
onChange?: (value: SliderRangeValue) => void;
|
|
28
|
+
}
|
|
29
|
+
type SliderProps = SliderSingleProps | SliderRangeProps;
|
|
15
30
|
/** `Slider` — neumorphic range input with grooved track. */
|
|
16
31
|
declare const Slider: React.FC<SliderProps>;
|
|
17
32
|
|
|
18
|
-
export { Slider, type SliderProps };
|
|
33
|
+
export { Slider, type SliderProps, type SliderRangeProps, type SliderRangeValue, type SliderSingleProps, type SliderSingleValue, type SliderValue };
|
package/dist/Slider.js
CHANGED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/* ============ Switch ============ */
|
|
2
|
+
.switch {
|
|
3
|
+
--w: 46px;
|
|
4
|
+
--h: 26px;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 10px;
|
|
8
|
+
font-size: 13px;
|
|
9
|
+
color: var(--fg);
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
user-select: none;
|
|
12
|
+
}
|
|
13
|
+
.switch.disabled { opacity: 0.5; cursor: not-allowed; }
|
|
14
|
+
.switch-track {
|
|
15
|
+
position: relative;
|
|
16
|
+
width: var(--w);
|
|
17
|
+
height: var(--h);
|
|
18
|
+
border: none;
|
|
19
|
+
padding: 0;
|
|
20
|
+
border-radius: 999px;
|
|
21
|
+
background: var(--bg);
|
|
22
|
+
box-shadow: var(--neu-in-sm);
|
|
23
|
+
cursor: inherit;
|
|
24
|
+
flex-shrink: 0;
|
|
25
|
+
transition: all var(--dur) var(--ease);
|
|
26
|
+
}
|
|
27
|
+
.switch.sm { --w: 36px; --h: 20px; }
|
|
28
|
+
.switch.lg { --w: 58px; --h: 32px; }
|
|
29
|
+
/* When checkedChildren / unCheckedChildren are present, widen the track to fit. */
|
|
30
|
+
.switch.with-children { --w: 60px; }
|
|
31
|
+
.switch.with-children.sm { --w: 46px; }
|
|
32
|
+
.switch.with-children.lg { --w: 74px; }
|
|
33
|
+
|
|
34
|
+
.switch-thumb {
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 3px;
|
|
37
|
+
left: 3px;
|
|
38
|
+
width: calc(var(--h) - 6px);
|
|
39
|
+
height: calc(var(--h) - 6px);
|
|
40
|
+
border-radius: 999px;
|
|
41
|
+
background: var(--bg-raised);
|
|
42
|
+
box-shadow: var(--neu-out-sm);
|
|
43
|
+
transition: all var(--dur) var(--ease);
|
|
44
|
+
z-index: 1;
|
|
45
|
+
}
|
|
46
|
+
.switch.on .switch-thumb {
|
|
47
|
+
transform: translateX(calc(var(--w) - var(--h)));
|
|
48
|
+
background: var(--accent);
|
|
49
|
+
box-shadow: 0 2px 8px var(--accent-glow), 0 0 0 1px color-mix(in oklch, var(--accent) 40%, transparent);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Inline content (checkedChildren / unCheckedChildren) */
|
|
53
|
+
.switch-inner {
|
|
54
|
+
position: absolute;
|
|
55
|
+
inset: 0;
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
font-size: 11px;
|
|
59
|
+
font-weight: 500;
|
|
60
|
+
font-family: inherit;
|
|
61
|
+
line-height: 1;
|
|
62
|
+
pointer-events: none;
|
|
63
|
+
}
|
|
64
|
+
.switch.sm .switch-inner { font-size: 10px; }
|
|
65
|
+
.switch-inner-on,
|
|
66
|
+
.switch-inner-off {
|
|
67
|
+
position: absolute;
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
|
|
72
|
+
}
|
|
73
|
+
/* Checked label sits on the left side of the track (thumb pushes right). */
|
|
74
|
+
.switch-inner-on {
|
|
75
|
+
left: 8px;
|
|
76
|
+
right: calc(var(--h) - 2px);
|
|
77
|
+
color: white;
|
|
78
|
+
opacity: 0;
|
|
79
|
+
transform: translateX(-4px);
|
|
80
|
+
}
|
|
81
|
+
/* Unchecked label sits on the right side (thumb is at left). */
|
|
82
|
+
.switch-inner-off {
|
|
83
|
+
right: 8px;
|
|
84
|
+
left: calc(var(--h) - 2px);
|
|
85
|
+
color: var(--fg-muted);
|
|
86
|
+
opacity: 1;
|
|
87
|
+
transform: translateX(0);
|
|
88
|
+
}
|
|
89
|
+
.switch.sm .switch-inner-on { left: 5px; right: calc(var(--h) - 2px); }
|
|
90
|
+
.switch.sm .switch-inner-off { right: 5px; left: calc(var(--h) - 2px); }
|
|
91
|
+
.switch.on .switch-inner-on { opacity: 1; transform: translateX(0); }
|
|
92
|
+
.switch.on .switch-inner-off { opacity: 0; transform: translateX(4px); }
|
package/dist/Switch.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkIDM6JJLP_cjs = require('./chunk-IDM6JJLP.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Switch", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkIDM6JJLP_cjs.Switch; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=Switch.cjs.map
|
|
12
12
|
//# sourceMappingURL=Switch.cjs.map
|
package/dist/Switch.d.cts
CHANGED
|
@@ -7,6 +7,10 @@ interface SwitchProps {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
label?: React.ReactNode;
|
|
9
9
|
size?: "sm" | "md";
|
|
10
|
+
/** Content rendered inside the track when checked (short text or icon). */
|
|
11
|
+
checkedChildren?: React.ReactNode;
|
|
12
|
+
/** Content rendered inside the track when unchecked. */
|
|
13
|
+
unCheckedChildren?: React.ReactNode;
|
|
10
14
|
className?: string;
|
|
11
15
|
id?: string;
|
|
12
16
|
}
|
package/dist/Switch.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ interface SwitchProps {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
label?: React.ReactNode;
|
|
9
9
|
size?: "sm" | "md";
|
|
10
|
+
/** Content rendered inside the track when checked (short text or icon). */
|
|
11
|
+
checkedChildren?: React.ReactNode;
|
|
12
|
+
/** Content rendered inside the track when unchecked. */
|
|
13
|
+
unCheckedChildren?: React.ReactNode;
|
|
10
14
|
className?: string;
|
|
11
15
|
id?: string;
|
|
12
16
|
}
|
package/dist/Switch.js
CHANGED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
/* ============ Table ============ */
|
|
2
|
+
.table-card {
|
|
3
|
+
border-radius: var(--r-lg);
|
|
4
|
+
background: var(--bg);
|
|
5
|
+
box-shadow: var(--neu-out-sm);
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
}
|
|
8
|
+
.table-wrap {
|
|
9
|
+
border-radius: var(--r-lg);
|
|
10
|
+
background: var(--bg);
|
|
11
|
+
box-shadow: var(--neu-in-sm);
|
|
12
|
+
overflow: auto;
|
|
13
|
+
}
|
|
14
|
+
/* When scroll=y is on, the wrap itself becomes the scroll region. */
|
|
15
|
+
.table-wrap.scroll-y { overflow-y: auto; }
|
|
16
|
+
.table-wrap.scroll-x { overflow-x: auto; }
|
|
17
|
+
|
|
18
|
+
.table {
|
|
19
|
+
width: 100%;
|
|
20
|
+
border-collapse: separate;
|
|
21
|
+
border-spacing: 0;
|
|
22
|
+
font-size: 13px;
|
|
23
|
+
}
|
|
24
|
+
.table th {
|
|
25
|
+
text-align: left;
|
|
26
|
+
padding: 14px 18px;
|
|
27
|
+
background: var(--bg);
|
|
28
|
+
font-size: 11px;
|
|
29
|
+
font-weight: 700;
|
|
30
|
+
letter-spacing: 0.08em;
|
|
31
|
+
text-transform: uppercase;
|
|
32
|
+
color: var(--fg-subtle);
|
|
33
|
+
border-bottom: 1px solid var(--divider);
|
|
34
|
+
position: sticky; top: 0;
|
|
35
|
+
z-index: 1;
|
|
36
|
+
}
|
|
37
|
+
/* When the wrap is the scroll container (scroll.y), position:sticky on th needs
|
|
38
|
+
top:0 relative to the wrap — browsers already handle that. Adding a stronger
|
|
39
|
+
bg so content under the header doesn't bleed through. */
|
|
40
|
+
.table.sticky-head th { background: var(--bg); }
|
|
41
|
+
.table th.sortable { cursor: pointer; user-select: none; }
|
|
42
|
+
.table th.sortable:hover { color: var(--fg); }
|
|
43
|
+
.table th .th-label { vertical-align: middle; }
|
|
44
|
+
.table th .sort-ind {
|
|
45
|
+
display: inline-flex;
|
|
46
|
+
width: 16px; height: 16px;
|
|
47
|
+
border-radius: 6px;
|
|
48
|
+
background: var(--bg);
|
|
49
|
+
box-shadow: var(--neu-flat);
|
|
50
|
+
align-items: center; justify-content: center;
|
|
51
|
+
margin-left: 6px;
|
|
52
|
+
color: var(--fg-subtle);
|
|
53
|
+
vertical-align: middle;
|
|
54
|
+
}
|
|
55
|
+
.table th.sorted .sort-ind { color: var(--accent); box-shadow: var(--neu-in-sm); }
|
|
56
|
+
.table td {
|
|
57
|
+
padding: 12px 18px;
|
|
58
|
+
border-bottom: 1px solid var(--divider);
|
|
59
|
+
vertical-align: middle;
|
|
60
|
+
}
|
|
61
|
+
.table.hoverable tbody tr:hover td { background: color-mix(in oklch, var(--accent-soft) 40%, transparent); }
|
|
62
|
+
.table tbody tr.clickable { cursor: pointer; }
|
|
63
|
+
.table tbody tr.selected td { background: color-mix(in oklch, var(--accent-soft) 80%, transparent); color: var(--accent-ink); }
|
|
64
|
+
.table tbody tr:last-child td { border-bottom: none; }
|
|
65
|
+
.table.striped tbody tr:nth-child(even) td {
|
|
66
|
+
background: color-mix(in oklch, var(--bg-sunken) 40%, transparent);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Embossed: each row sits on the surface */
|
|
70
|
+
.table.embossed { border-spacing: 0; }
|
|
71
|
+
.table.embossed tbody td {
|
|
72
|
+
background: var(--bg);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Card-row variant: each row is its own raised pill */
|
|
76
|
+
.table.cards {
|
|
77
|
+
border-collapse: separate;
|
|
78
|
+
border-spacing: 0 10px;
|
|
79
|
+
padding: 10px;
|
|
80
|
+
background: transparent;
|
|
81
|
+
box-shadow: none;
|
|
82
|
+
}
|
|
83
|
+
.table.cards thead th {
|
|
84
|
+
background: transparent;
|
|
85
|
+
border-bottom: none;
|
|
86
|
+
padding-top: 0;
|
|
87
|
+
padding-bottom: 6px;
|
|
88
|
+
}
|
|
89
|
+
.table.cards tbody td {
|
|
90
|
+
background: var(--bg);
|
|
91
|
+
border-bottom: none;
|
|
92
|
+
padding: 14px 18px;
|
|
93
|
+
}
|
|
94
|
+
.table.cards tbody td:first-child {
|
|
95
|
+
border-radius: var(--r-md) 0 0 var(--r-md);
|
|
96
|
+
box-shadow: -4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
|
|
97
|
+
}
|
|
98
|
+
.table.cards tbody td:last-child {
|
|
99
|
+
border-radius: 0 var(--r-md) var(--r-md) 0;
|
|
100
|
+
box-shadow: 4px 4px 8px var(--shadow-dark), 4px -4px 8px var(--shadow-light);
|
|
101
|
+
}
|
|
102
|
+
.table.cards tbody td:not(:first-child):not(:last-child) {
|
|
103
|
+
box-shadow: 0 4px 8px var(--shadow-dark), 0 -4px 8px var(--shadow-light);
|
|
104
|
+
}
|
|
105
|
+
.table.cards.hoverable tbody tr:hover td { background: var(--bg); transform: translateY(-1px); }
|
|
106
|
+
|
|
107
|
+
.table .row-check { width: 44px; }
|
|
108
|
+
.table .row-check .checkbox { display: inline-flex; }
|
|
109
|
+
.table .row-expand { width: 40px; text-align: center; }
|
|
110
|
+
.table-empty { padding: 60px 20px; text-align: center; color: var(--fg-muted); }
|
|
111
|
+
|
|
112
|
+
/* Expand button */
|
|
113
|
+
.expand-btn {
|
|
114
|
+
width: 22px; height: 22px;
|
|
115
|
+
border: none;
|
|
116
|
+
border-radius: var(--r-sm);
|
|
117
|
+
background: var(--bg);
|
|
118
|
+
box-shadow: var(--neu-flat);
|
|
119
|
+
color: var(--fg-subtle);
|
|
120
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
|
|
123
|
+
}
|
|
124
|
+
.expand-btn:hover { color: var(--accent-ink); box-shadow: var(--neu-out-sm); }
|
|
125
|
+
.expand-btn.open { transform: rotate(90deg); color: var(--accent-ink); box-shadow: var(--neu-in-sm); }
|
|
126
|
+
|
|
127
|
+
/* Expanded row panel */
|
|
128
|
+
.table tbody tr.expanded-row td {
|
|
129
|
+
padding: 14px 18px;
|
|
130
|
+
border-bottom: 1px solid var(--divider);
|
|
131
|
+
background: color-mix(in oklch, var(--bg-sunken) 25%, transparent);
|
|
132
|
+
}
|
|
133
|
+
.expanded-panel {
|
|
134
|
+
padding: 14px 16px;
|
|
135
|
+
border-radius: var(--r-md);
|
|
136
|
+
background: var(--bg);
|
|
137
|
+
box-shadow: var(--neu-in-sm);
|
|
138
|
+
color: var(--fg);
|
|
139
|
+
font-size: 13px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Radio-style row selector */
|
|
143
|
+
.table .row-check .radio-dot {
|
|
144
|
+
width: 16px; height: 16px;
|
|
145
|
+
border-radius: 50%;
|
|
146
|
+
border: none;
|
|
147
|
+
padding: 0;
|
|
148
|
+
background: var(--bg);
|
|
149
|
+
box-shadow: var(--neu-in-sm);
|
|
150
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
151
|
+
cursor: pointer;
|
|
152
|
+
transition: box-shadow var(--dur-fast) var(--ease);
|
|
153
|
+
}
|
|
154
|
+
.table .row-check .radio-dot:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
155
|
+
.table .row-check .radio-dot.checked {
|
|
156
|
+
box-shadow: var(--neu-out-sm);
|
|
157
|
+
}
|
|
158
|
+
.table .row-check .radio-dot.checked::after {
|
|
159
|
+
content: "";
|
|
160
|
+
width: 8px; height: 8px;
|
|
161
|
+
border-radius: 50%;
|
|
162
|
+
background: var(--accent);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* Filter button on header */
|
|
166
|
+
.table th.filterable .filter-ind {
|
|
167
|
+
display: inline-flex;
|
|
168
|
+
width: 18px; height: 18px;
|
|
169
|
+
border-radius: 5px;
|
|
170
|
+
background: var(--bg);
|
|
171
|
+
box-shadow: var(--neu-flat);
|
|
172
|
+
color: var(--fg-subtle);
|
|
173
|
+
align-items: center; justify-content: center;
|
|
174
|
+
margin-left: 6px;
|
|
175
|
+
cursor: pointer;
|
|
176
|
+
border: none;
|
|
177
|
+
vertical-align: middle;
|
|
178
|
+
padding: 0;
|
|
179
|
+
transition: color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
|
|
180
|
+
}
|
|
181
|
+
.table th.filterable .filter-ind:hover { color: var(--fg); }
|
|
182
|
+
.table th.filterable .filter-ind.active {
|
|
183
|
+
color: var(--accent-ink);
|
|
184
|
+
box-shadow: var(--neu-in-sm);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/* Filter popover panel (portaled to body) */
|
|
188
|
+
.table-filter-panel {
|
|
189
|
+
z-index: 1001;
|
|
190
|
+
min-width: 200px;
|
|
191
|
+
max-width: 260px;
|
|
192
|
+
background: var(--bg);
|
|
193
|
+
border-radius: var(--r-md);
|
|
194
|
+
box-shadow: var(--neu-out-lg);
|
|
195
|
+
padding: 10px;
|
|
196
|
+
animation: menuIn var(--dur) var(--ease);
|
|
197
|
+
}
|
|
198
|
+
.table-filter-options {
|
|
199
|
+
display: flex;
|
|
200
|
+
flex-direction: column;
|
|
201
|
+
max-height: 220px;
|
|
202
|
+
overflow-y: auto;
|
|
203
|
+
gap: 4px;
|
|
204
|
+
padding: 4px;
|
|
205
|
+
}
|
|
206
|
+
.table-filter-item {
|
|
207
|
+
display: flex;
|
|
208
|
+
align-items: center;
|
|
209
|
+
gap: 8px;
|
|
210
|
+
padding: 6px 8px;
|
|
211
|
+
border-radius: var(--r-sm);
|
|
212
|
+
font-size: 13px;
|
|
213
|
+
color: var(--fg);
|
|
214
|
+
cursor: pointer;
|
|
215
|
+
transition: background var(--dur-fast) var(--ease);
|
|
216
|
+
}
|
|
217
|
+
.table-filter-item:hover {
|
|
218
|
+
background: color-mix(in oklch, var(--accent-soft) 40%, transparent);
|
|
219
|
+
}
|
|
220
|
+
.table-filter-actions {
|
|
221
|
+
display: flex;
|
|
222
|
+
justify-content: flex-end;
|
|
223
|
+
gap: 6px;
|
|
224
|
+
margin-top: 6px;
|
|
225
|
+
padding-top: 8px;
|
|
226
|
+
border-top: 1px solid var(--divider);
|
|
227
|
+
}
|
|
228
|
+
.table-filter-actions .tf-btn {
|
|
229
|
+
border: none;
|
|
230
|
+
padding: 6px 12px;
|
|
231
|
+
border-radius: var(--r-sm);
|
|
232
|
+
background: var(--bg);
|
|
233
|
+
box-shadow: var(--neu-out-sm);
|
|
234
|
+
font-size: 12px;
|
|
235
|
+
font-family: inherit;
|
|
236
|
+
color: var(--fg);
|
|
237
|
+
cursor: pointer;
|
|
238
|
+
transition: box-shadow var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
|
|
239
|
+
}
|
|
240
|
+
.table-filter-actions .tf-btn:hover { box-shadow: var(--neu-in-sm); }
|
|
241
|
+
.table-filter-actions .tf-btn.primary { color: var(--accent-ink); font-weight: 600; }
|
|
242
|
+
.table-filter-actions .tf-btn.ghost { color: var(--fg-muted); box-shadow: var(--neu-flat); }
|
|
243
|
+
.table-filter-actions .tf-btn.ghost:hover { box-shadow: var(--neu-in-sm); }
|
|
244
|
+
|
|
245
|
+
/* Built-in pagination bar */
|
|
246
|
+
.table-pagination {
|
|
247
|
+
margin-top: 12px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/* Pro: card-wrap with toolbar + table + footer */
|
|
251
|
+
.table-card {
|
|
252
|
+
border-radius: var(--r-lg);
|
|
253
|
+
background: var(--bg);
|
|
254
|
+
box-shadow: var(--neu-out-sm);
|
|
255
|
+
overflow: hidden;
|
|
256
|
+
}
|
|
257
|
+
.table-card .table-wrap { background: transparent; box-shadow: none; border-radius: 0; }
|
|
258
|
+
.table-card .table-wrap.joined { border-radius: 0; }
|
|
259
|
+
/* When TablePro hosts the built-in pagination, seat it inside the card. */
|
|
260
|
+
.table-card .table-pagination {
|
|
261
|
+
margin-top: 0;
|
|
262
|
+
padding: 6px 16px;
|
|
263
|
+
border-top: 1px solid var(--divider);
|
|
264
|
+
background: color-mix(in oklch, var(--bg-sunken) 30%, transparent);
|
|
265
|
+
}
|
|
266
|
+
.table-toolbar {
|
|
267
|
+
display: flex;
|
|
268
|
+
align-items: center;
|
|
269
|
+
gap: var(--gap-3);
|
|
270
|
+
padding: 14px 16px;
|
|
271
|
+
border-bottom: 1px solid var(--divider);
|
|
272
|
+
}
|
|
273
|
+
.table-toolbar .table-title {
|
|
274
|
+
font-size: 14px;
|
|
275
|
+
font-weight: 600;
|
|
276
|
+
margin-right: 8px;
|
|
277
|
+
}
|
|
278
|
+
.table-toolbar-main {
|
|
279
|
+
flex: 1;
|
|
280
|
+
display: flex;
|
|
281
|
+
align-items: center;
|
|
282
|
+
gap: 10px;
|
|
283
|
+
min-width: 0;
|
|
284
|
+
}
|
|
285
|
+
.table-toolbar-actions {
|
|
286
|
+
display: flex;
|
|
287
|
+
align-items: center;
|
|
288
|
+
gap: 8px;
|
|
289
|
+
flex-shrink: 0;
|
|
290
|
+
}
|
|
291
|
+
.table-footer {
|
|
292
|
+
padding: 10px 16px;
|
|
293
|
+
border-top: 1px solid var(--divider);
|
|
294
|
+
background: color-mix(in oklch, var(--bg-sunken) 30%, transparent);
|
|
295
|
+
}
|
package/dist/Table.cjs
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSBMOIE5C_cjs = require('./chunk-SBMOIE5C.cjs');
|
|
4
|
+
require('./chunk-K7PVJLW4.cjs');
|
|
5
|
+
require('./chunk-EPFYIR63.cjs');
|
|
6
|
+
require('./chunk-URF6RBW6.cjs');
|
|
4
7
|
require('./chunk-C5TGQ7CV.cjs');
|
|
8
|
+
require('./chunk-RZ2E3XEU.cjs');
|
|
5
9
|
require('./chunk-YVO7XO4W.cjs');
|
|
6
10
|
|
|
7
11
|
|
|
8
12
|
|
|
9
13
|
Object.defineProperty(exports, "Table", {
|
|
10
14
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkSBMOIE5C_cjs.Table; }
|
|
12
16
|
});
|
|
13
17
|
Object.defineProperty(exports, "TablePro", {
|
|
14
18
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkSBMOIE5C_cjs.TablePro; }
|
|
16
20
|
});
|
|
17
21
|
//# sourceMappingURL=Table.cjs.map
|
|
18
22
|
//# sourceMappingURL=Table.cjs.map
|
package/dist/Table.d.cts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
+
type RowKey = string | number;
|
|
5
|
+
interface TableColumnFilterItem {
|
|
6
|
+
text: React.ReactNode;
|
|
7
|
+
value: string | number;
|
|
8
|
+
}
|
|
4
9
|
interface TableColumn<Row = any> {
|
|
5
10
|
key: string;
|
|
6
11
|
title: React.ReactNode;
|
|
@@ -10,12 +15,78 @@ interface TableColumn<Row = any> {
|
|
|
10
15
|
width?: number | string;
|
|
11
16
|
align?: "left" | "center" | "right";
|
|
12
17
|
sortable?: boolean;
|
|
18
|
+
/** Filter options shown in header dropdown. Requires `onFilter` (or data index match). */
|
|
19
|
+
filters?: TableColumnFilterItem[];
|
|
20
|
+
/**
|
|
21
|
+
* Predicate to decide whether a row matches a given filter value.
|
|
22
|
+
* If omitted, falls back to strict equality on `row[dataIndex]`.
|
|
23
|
+
*/
|
|
24
|
+
onFilter?: (value: string | number, row: Row) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Default active filter values. When `filteredValue` is controlled externally via
|
|
27
|
+
* `Table.filteredValue`, prefer managing it at the table level.
|
|
28
|
+
*/
|
|
29
|
+
defaultFilteredValue?: (string | number)[];
|
|
30
|
+
/** Controlled filter selection — when provided, makes the column's filter controlled. */
|
|
31
|
+
filteredValue?: (string | number)[];
|
|
13
32
|
}
|
|
14
33
|
type TableVariant = "default" | "striped" | "embossed" | "cards";
|
|
34
|
+
interface PaginationConfig {
|
|
35
|
+
/** Current page (1-indexed). Makes pagination controlled. */
|
|
36
|
+
current?: number;
|
|
37
|
+
/** Uncontrolled initial page. */
|
|
38
|
+
defaultCurrent?: number;
|
|
39
|
+
/** Items per page. */
|
|
40
|
+
pageSize?: number;
|
|
41
|
+
/** Default items per page (uncontrolled). */
|
|
42
|
+
defaultPageSize?: number;
|
|
43
|
+
/** Total item count. Defaults to `data.length` when omitted. */
|
|
44
|
+
total?: number;
|
|
45
|
+
/** Fired when user picks a page or changes page size. */
|
|
46
|
+
onChange?: (page: number, pageSize: number) => void;
|
|
47
|
+
/** Reserved for future: jump-to-page input. */
|
|
48
|
+
showQuickJumper?: boolean;
|
|
49
|
+
/** Reserved for future: page size dropdown. */
|
|
50
|
+
showSizeChanger?: boolean;
|
|
51
|
+
/** Reserved for future: selectable page sizes. */
|
|
52
|
+
pageSizeOptions?: number[];
|
|
53
|
+
}
|
|
54
|
+
interface RowSelectionConfig<Row = any> {
|
|
55
|
+
/** "checkbox" (default) allows multi-select; "radio" allows only one row at a time. */
|
|
56
|
+
type?: "checkbox" | "radio";
|
|
57
|
+
/** Controlled list of selected row keys. */
|
|
58
|
+
selectedRowKeys?: RowKey[];
|
|
59
|
+
/** Uncontrolled initial selection. */
|
|
60
|
+
defaultSelectedRowKeys?: RowKey[];
|
|
61
|
+
/** Fired on selection change; receives the new keys and matching rows. */
|
|
62
|
+
onChange?: (selectedRowKeys: RowKey[], selectedRows: Row[]) => void;
|
|
63
|
+
/** Per-row switch toggling checkbox disabled state. */
|
|
64
|
+
getCheckboxProps?: (row: Row) => {
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
interface ExpandableConfig<Row = any> {
|
|
69
|
+
/** Controlled expanded row keys. */
|
|
70
|
+
expandedRowKeys?: RowKey[];
|
|
71
|
+
/** Uncontrolled initial expanded row keys. */
|
|
72
|
+
defaultExpandedRowKeys?: RowKey[];
|
|
73
|
+
/** Fired when a row expands / collapses. */
|
|
74
|
+
onExpand?: (expanded: boolean, row: Row) => void;
|
|
75
|
+
/** Render function for the expanded panel. When omitted, no expand UI renders. */
|
|
76
|
+
expandedRowRender?: (row: Row, index: number) => React.ReactNode;
|
|
77
|
+
/** Decide whether a given row can be expanded. */
|
|
78
|
+
rowExpandable?: (row: Row) => boolean;
|
|
79
|
+
}
|
|
80
|
+
interface TableScrollConfig {
|
|
81
|
+
/** Horizontal scroll: min-width of the inner table. */
|
|
82
|
+
x?: number | string;
|
|
83
|
+
/** Vertical scroll: max body height (with sticky header). */
|
|
84
|
+
y?: number | string;
|
|
85
|
+
}
|
|
15
86
|
interface TableProps<Row = any> {
|
|
16
87
|
columns: TableColumn<Row>[];
|
|
17
88
|
data: Row[];
|
|
18
|
-
rowKey?: keyof Row | ((row: Row) =>
|
|
89
|
+
rowKey?: keyof Row | ((row: Row) => RowKey);
|
|
19
90
|
/** Visual variant. */
|
|
20
91
|
variant?: TableVariant;
|
|
21
92
|
/** Hoverable rows. */
|
|
@@ -26,10 +97,32 @@ interface TableProps<Row = any> {
|
|
|
26
97
|
sortKey?: string;
|
|
27
98
|
sortDir?: "asc" | "desc";
|
|
28
99
|
onSort?: (key: string) => void;
|
|
29
|
-
/**
|
|
100
|
+
/**
|
|
101
|
+
* Row selection config — preferred API (antd-style).
|
|
102
|
+
* When provided, takes precedence over `selectable` / `selected` / `onSelect`.
|
|
103
|
+
*/
|
|
104
|
+
rowSelection?: RowSelectionConfig<Row>;
|
|
105
|
+
/**
|
|
106
|
+
* @deprecated Use `rowSelection` instead. Kept for backwards compatibility.
|
|
107
|
+
*/
|
|
30
108
|
selectable?: boolean;
|
|
31
|
-
|
|
32
|
-
|
|
109
|
+
/**
|
|
110
|
+
* @deprecated Use `rowSelection.selectedRowKeys` instead.
|
|
111
|
+
*/
|
|
112
|
+
selected?: RowKey[];
|
|
113
|
+
/**
|
|
114
|
+
* @deprecated Use `rowSelection.onChange` instead.
|
|
115
|
+
*/
|
|
116
|
+
onSelect?: (keys: RowKey[]) => void;
|
|
117
|
+
/** Expandable row config. */
|
|
118
|
+
expandable?: ExpandableConfig<Row>;
|
|
119
|
+
/**
|
|
120
|
+
* Pagination config — `false` disables pagination; otherwise renders a bottom
|
|
121
|
+
* pagination bar and slices the data accordingly.
|
|
122
|
+
*/
|
|
123
|
+
pagination?: false | PaginationConfig;
|
|
124
|
+
/** Horizontal / vertical scroll config. */
|
|
125
|
+
scroll?: TableScrollConfig;
|
|
33
126
|
/** Called when user clicks a row. */
|
|
34
127
|
onRowClick?: (row: Row, index: number) => void;
|
|
35
128
|
/** Empty state. */
|
|
@@ -37,13 +130,13 @@ interface TableProps<Row = any> {
|
|
|
37
130
|
className?: string;
|
|
38
131
|
}
|
|
39
132
|
/** `Table` — neumorphic data table with sorting, selection and visual variants. */
|
|
40
|
-
declare function Table<Row extends Record<string, any> = any>({ columns, data, rowKey, variant, hoverable, striped, sortKey, sortDir, onSort, selectable, selected, onSelect, onRowClick, empty, className, }: TableProps<Row>): react_jsx_runtime.JSX.Element;
|
|
133
|
+
declare function Table<Row extends Record<string, any> = any>({ columns, data, rowKey, variant, hoverable, striped, sortKey, sortDir, onSort, rowSelection, selectable, selected, onSelect, expandable, pagination, scroll, onRowClick, empty, className, }: TableProps<Row>): react_jsx_runtime.JSX.Element;
|
|
41
134
|
interface TableProProps<Row = any> extends TableProps<Row> {
|
|
42
135
|
/** Toolbar slot — search input, filter, etc. */
|
|
43
136
|
toolbar?: React.ReactNode;
|
|
44
137
|
/** Right-aligned actions slot in toolbar. */
|
|
45
138
|
actions?: React.ReactNode;
|
|
46
|
-
/** Footer slot — usually <Pagination />. */
|
|
139
|
+
/** Footer slot — usually <Pagination />. Optional now that `pagination` is built-in. */
|
|
47
140
|
footer?: React.ReactNode;
|
|
48
141
|
/** Title shown above the toolbar. */
|
|
49
142
|
title?: React.ReactNode;
|
|
@@ -51,7 +144,10 @@ interface TableProProps<Row = any> extends TableProps<Row> {
|
|
|
51
144
|
/**
|
|
52
145
|
* `TablePro` — full-featured table card with toolbar, sortable/selectable rows,
|
|
53
146
|
* variants, and a footer slot for pagination.
|
|
147
|
+
*
|
|
148
|
+
* Prefer the built-in `pagination` prop over rendering a `<Pagination />` in the
|
|
149
|
+
* `footer` slot; `footer` still works for custom footers.
|
|
54
150
|
*/
|
|
55
151
|
declare function TablePro<Row extends Record<string, any> = any>({ toolbar, actions, footer, title, className, ...tableProps }: TableProProps<Row>): react_jsx_runtime.JSX.Element;
|
|
56
152
|
|
|
57
|
-
export { Table, type TableColumn, TablePro, type TableProProps, type TableProps, type TableVariant };
|
|
153
|
+
export { type ExpandableConfig, type PaginationConfig, type RowKey, type RowSelectionConfig, Table, type TableColumn, type TableColumnFilterItem, TablePro, type TableProProps, type TableProps, type TableScrollConfig, type TableVariant };
|