@rockshin/tao-ui 0.0.30 → 0.0.32
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 +14 -3
- package/dist/components/alert/alert.js +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/components/button/button.d.ts +2 -2
- package/dist/components/button/button.js +48 -50
- package/dist/components/checkbox/checkbox.css +5 -1
- package/dist/components/checkbox/checkbox.d.ts +2 -2
- package/dist/components/checkbox/checkbox.js +135 -120
- package/dist/components/collapsible/collapsible.js +1 -1
- package/dist/components/context-menu/context-menu.js +1 -1
- package/dist/components/date-picker/calendar/calendar-header.js +1 -1
- package/dist/components/date-picker/calendar/month-grid.d.ts +3 -1
- package/dist/components/date-picker/calendar/month-grid.js +19 -17
- package/dist/components/date-picker/calendar/time-panel.js +1 -1
- package/dist/components/date-picker/calendar/year-grid.d.ts +3 -1
- package/dist/components/date-picker/calendar/year-grid.js +28 -24
- package/dist/components/date-picker/date-picker.d.ts +1 -1
- package/dist/components/date-picker/date-picker.js +37 -24
- package/dist/components/date-picker/presets.js +1 -1
- package/dist/components/date-picker/range-picker.d.ts +1 -1
- package/dist/components/date-picker/range-picker.js +104 -56
- package/dist/components/drawer/drawer.d.ts +1 -1
- package/dist/components/drawer/drawer.js +98 -91
- package/dist/components/dropdown/dropdown.js +84 -84
- package/dist/components/form/form-item.js +8 -4
- package/dist/components/form/form.js +1 -1
- package/dist/components/form-actions/form-actions.js +1 -1
- package/dist/components/form-field/form-field-view.js +58 -51
- package/dist/components/form-field/form-field.js +1 -1
- package/dist/components/form-section/form-section.js +1 -1
- package/dist/components/input/input.js +42 -39
- package/dist/components/input-number/input-number.d.ts +2 -2
- package/dist/components/input-number/input-number.js +57 -59
- package/dist/components/menu/menu-render.js +1 -1
- package/dist/components/modal/confirm-dialog.d.ts +2 -1
- package/dist/components/modal/confirm-dialog.js +25 -5
- package/dist/components/modal/confirm.js +15 -3
- package/dist/components/modal/modal.d.ts +1 -1
- package/dist/components/modal/modal.js +131 -132
- package/dist/components/modal/use-modal.js +48 -35
- package/dist/components/pagination/pagination.js +3 -1
- package/dist/components/popconfirm/popconfirm.js +1 -1
- package/dist/components/popover/popover.js +253 -228
- package/dist/components/radio/radio.css +2 -2
- package/dist/components/radio/radio.d.ts +1 -1
- package/dist/components/radio/radio.js +7 -7
- package/dist/components/scroll-area/scroll-area.css +2 -2
- package/dist/components/scroll-area/scroll-area.js +187 -165
- package/dist/components/select/mobile-select.d.ts +2 -1
- package/dist/components/select/mobile-select.js +12 -6
- package/dist/components/select/select-icons.js +1 -1
- package/dist/components/select/select-searchable-list.d.ts +1 -1
- package/dist/components/select/select-searchable-list.js +35 -21
- package/dist/components/select/select-tags.js +1 -1
- package/dist/components/select/select-types.d.ts +2 -2
- package/dist/components/select/select.css +4 -0
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.js +124 -72
- package/dist/components/sonner/sonner.js +6 -5
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/splitter/splitter.js +187 -194
- package/dist/components/status-icon/status-icon.js +1 -1
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/switch.js +6 -6
- package/dist/components/table/table-filter.js +1 -1
- package/dist/components/table/table-icons.js +1 -1
- package/dist/components/table/table.css +11 -10
- package/dist/components/table/table.js +483 -599
- package/dist/components/tabs/tabs.js +179 -161
- package/dist/components/tag/tag.js +1 -1
- package/dist/components/textarea/textarea.d.ts +1 -1
- package/dist/components/textarea/textarea.js +142 -108
- package/dist/components/tooltip/tooltip.js +88 -72
- package/dist/entries/alert.d.ts +3 -0
- package/dist/entries/alert.js +4 -0
- package/dist/entries/breadcrumb.d.ts +3 -0
- package/dist/entries/breadcrumb.js +4 -0
- package/dist/entries/button.d.ts +3 -0
- package/dist/entries/button.js +4 -0
- package/dist/entries/checkbox.d.ts +3 -0
- package/dist/entries/checkbox.js +4 -0
- package/dist/entries/collapsible.d.ts +3 -0
- package/dist/entries/collapsible.js +4 -0
- package/dist/entries/context-menu.d.ts +3 -0
- package/dist/entries/context-menu.js +4 -0
- package/dist/entries/date-picker.d.ts +3 -0
- package/dist/entries/date-picker.js +4 -0
- package/dist/entries/drawer.d.ts +3 -0
- package/dist/entries/drawer.js +4 -0
- package/dist/entries/dropdown.d.ts +3 -0
- package/dist/entries/dropdown.js +4 -0
- package/dist/entries/form-actions.d.ts +3 -0
- package/dist/entries/form-actions.js +4 -0
- package/dist/entries/form-field.d.ts +3 -0
- package/dist/entries/form-field.js +4 -0
- package/dist/entries/form-layout.d.ts +3 -0
- package/dist/entries/form-layout.js +4 -0
- package/dist/entries/form-section.d.ts +3 -0
- package/dist/entries/form-section.js +4 -0
- package/dist/entries/form.d.ts +4 -0
- package/dist/entries/form.js +4 -0
- package/dist/entries/input-number.d.ts +3 -0
- package/dist/entries/input-number.js +4 -0
- package/dist/entries/input.d.ts +3 -0
- package/dist/entries/input.js +4 -0
- package/dist/entries/modal.d.ts +3 -0
- package/dist/entries/modal.js +4 -0
- package/dist/entries/number-input.d.ts +3 -0
- package/dist/entries/number-input.js +4 -0
- package/dist/entries/pagination.d.ts +3 -0
- package/dist/entries/pagination.js +4 -0
- package/dist/entries/popconfirm.d.ts +3 -0
- package/dist/entries/popconfirm.js +4 -0
- package/dist/entries/popover.d.ts +3 -0
- package/dist/entries/popover.js +4 -0
- package/dist/entries/provider.d.ts +3 -0
- package/dist/entries/provider.js +4 -0
- package/dist/entries/radio.d.ts +3 -0
- package/dist/entries/radio.js +4 -0
- package/dist/entries/range-picker.d.ts +3 -0
- package/dist/entries/range-picker.js +4 -0
- package/dist/entries/scroll-area.d.ts +3 -0
- package/dist/entries/scroll-area.js +4 -0
- package/dist/entries/select.d.ts +3 -0
- package/dist/entries/select.js +4 -0
- package/dist/entries/sonner.d.ts +3 -0
- package/dist/entries/sonner.js +4 -0
- package/dist/entries/spinner.d.ts +3 -0
- package/dist/entries/spinner.js +4 -0
- package/dist/entries/splitter.d.ts +3 -0
- package/dist/entries/splitter.js +4 -0
- package/dist/entries/stack.d.ts +3 -0
- package/dist/entries/stack.js +4 -0
- package/dist/entries/switch.d.ts +3 -0
- package/dist/entries/switch.js +4 -0
- package/dist/entries/table.d.ts +3 -0
- package/dist/entries/table.js +4 -0
- package/dist/entries/tabs.d.ts +3 -0
- package/dist/entries/tabs.js +4 -0
- package/dist/entries/tag.d.ts +3 -0
- package/dist/entries/tag.js +4 -0
- package/dist/entries/textarea.d.ts +3 -0
- package/dist/entries/textarea.js +4 -0
- package/dist/entries/tooltip.d.ts +3 -0
- package/dist/entries/tooltip.js +4 -0
- package/dist/layouts/form-layout/form-layout.js +1 -1
- package/dist/layouts/stack/stack.js +1 -1
- package/dist/number-input/number-input.js +1 -1
- package/dist/number-input/use-number-input.d.ts +2 -2
- package/dist/number-input/use-number-input.js +224 -131
- package/dist/number-input/validate.js +7 -2
- package/dist/provider/tao-provider.js +1 -1
- package/dist/utils/dialog-content.d.ts +10 -0
- package/dist/utils/dialog-content.js +222 -0
- package/dist/utils/overlay.d.ts +2 -2
- package/dist/utils/overlay.js +8 -3
- package/dist/utils/refs.js +17 -2
- package/llms.txt +5 -3
- package/package.json +21 -8
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# tao-ui
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A component library for React 18.2 and 19 with semantic DOM customization and OKLCH-based theming.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **React 19** —
|
|
7
|
+
- **React 18.2 and 19** — supports React 18.2 as the minimum version and React 19, with React Compiler optimizations.
|
|
8
8
|
- **Semantic DOM** — every visual component exposes `classNames` / `styles` props to style internal parts by semantic name, no fragile selector hacks.
|
|
9
9
|
- **OKLCH theming** — `TaoProvider` derives a full theme (radius, font scale, control heights) from a small seed token set; components inherit `size` / `disabled` / `variant`.
|
|
10
10
|
- **Typed** — full `.d.ts`, every Props and SemanticPart type exported.
|
|
@@ -17,7 +17,7 @@ npm install @rockshin/tao-ui
|
|
|
17
17
|
bun add @rockshin/tao-ui
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Peer dependencies: `react
|
|
20
|
+
Peer dependencies: `react ^18.2.0 || ^19.0.0`, `react-dom ^18.2.0 || ^19.0.0`. The minimum version is 18.2; React 19 is also supported. The date pickers' `dayjs` dependency is installed automatically.
|
|
21
21
|
|
|
22
22
|
## Usage
|
|
23
23
|
|
|
@@ -37,6 +37,17 @@ export default function App() {
|
|
|
37
37
|
}
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
### Component imports
|
|
41
|
+
|
|
42
|
+
Use component entries to include only their styles and shared theme styles. No separate CSS import is needed. The root entry remains available and includes all component styles.
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { Button, type ButtonProps } from '@rockshin/tao-ui/button';
|
|
46
|
+
import { TaoProvider } from '@rockshin/tao-ui/provider';
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Entry names use kebab-case, such as `/input-number`, `/range-picker`, and `/form-layout`. Related exports share an entry: `CheckboxGroup` uses `/checkbox`, and `HeadlessInputNumber` uses `/number-input`.
|
|
50
|
+
|
|
40
51
|
### Dark mode
|
|
41
52
|
|
|
42
53
|
Pure-CSS dark algorithm — no JS runtime. One prop flips every component, including portaled popups (Modal, Drawer, Select dropdowns):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { cx } from "../../utils/semantic.js";
|
|
5
5
|
import { StatusIcon } from "../status-icon/status-icon.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
4
|
import { Fragment, isValidElement } from "react";
|
|
5
5
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode, type Ref } from 'react';
|
|
2
2
|
import { type TaoSize } from '../../provider/tao-provider';
|
|
3
3
|
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
4
4
|
import './button.css';
|
|
@@ -25,4 +25,4 @@ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement
|
|
|
25
25
|
/** Semantic style overrides keyed by ButtonSemanticPart. */
|
|
26
26
|
styles?: SemanticStyles<ButtonSemanticPart>;
|
|
27
27
|
}
|
|
28
|
-
export declare
|
|
28
|
+
export declare const Button: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
|
+
import { forwardRef } from "react";
|
|
3
4
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
4
5
|
import { cx } from "../../utils/semantic.js";
|
|
5
6
|
import "./button.css";
|
|
6
|
-
|
|
7
|
-
const $ = c(
|
|
7
|
+
const button_Button = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
8
|
+
const $ = c(36);
|
|
8
9
|
let children;
|
|
9
10
|
let className;
|
|
10
11
|
let classNames;
|
|
@@ -12,14 +13,13 @@ function Button(t0) {
|
|
|
12
13
|
let icon;
|
|
13
14
|
let loading;
|
|
14
15
|
let loadingIcon;
|
|
15
|
-
let ref;
|
|
16
16
|
let rest;
|
|
17
17
|
let size;
|
|
18
18
|
let style;
|
|
19
19
|
let styles;
|
|
20
20
|
let t1;
|
|
21
21
|
if ($[0] !== t0) {
|
|
22
|
-
({ variant: t1, size, disabled, loading, icon, loadingIcon, children,
|
|
22
|
+
({ variant: t1, size, disabled, loading, icon, loadingIcon, children, className, style, classNames, styles, ...rest } = t0);
|
|
23
23
|
$[0] = t0;
|
|
24
24
|
$[1] = children;
|
|
25
25
|
$[2] = className;
|
|
@@ -28,12 +28,11 @@ function Button(t0) {
|
|
|
28
28
|
$[5] = icon;
|
|
29
29
|
$[6] = loading;
|
|
30
30
|
$[7] = loadingIcon;
|
|
31
|
-
$[8] =
|
|
32
|
-
$[9] =
|
|
33
|
-
$[10] =
|
|
34
|
-
$[11] =
|
|
35
|
-
$[12] =
|
|
36
|
-
$[13] = t1;
|
|
31
|
+
$[8] = rest;
|
|
32
|
+
$[9] = size;
|
|
33
|
+
$[10] = style;
|
|
34
|
+
$[11] = styles;
|
|
35
|
+
$[12] = t1;
|
|
37
36
|
} else {
|
|
38
37
|
children = $[1];
|
|
39
38
|
className = $[2];
|
|
@@ -42,12 +41,11 @@ function Button(t0) {
|
|
|
42
41
|
icon = $[5];
|
|
43
42
|
loading = $[6];
|
|
44
43
|
loadingIcon = $[7];
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
t1 = $[13];
|
|
44
|
+
rest = $[8];
|
|
45
|
+
size = $[9];
|
|
46
|
+
style = $[10];
|
|
47
|
+
styles = $[11];
|
|
48
|
+
t1 = $[12];
|
|
51
49
|
}
|
|
52
50
|
const variant = void 0 === t1 ? "primary" : t1;
|
|
53
51
|
const ctx = useTaoConfig();
|
|
@@ -57,27 +55,27 @@ function Button(t0) {
|
|
|
57
55
|
const hasIconSlot = null != icon || loading;
|
|
58
56
|
const t2 = classNames?.root;
|
|
59
57
|
let t3;
|
|
60
|
-
if ($[
|
|
58
|
+
if ($[13] !== className || $[14] !== t2) {
|
|
61
59
|
t3 = cx(t2, className);
|
|
62
|
-
$[
|
|
63
|
-
$[
|
|
64
|
-
$[
|
|
65
|
-
} else t3 = $[
|
|
60
|
+
$[13] = className;
|
|
61
|
+
$[14] = t2;
|
|
62
|
+
$[15] = t3;
|
|
63
|
+
} else t3 = $[15];
|
|
66
64
|
const t4 = styles?.root;
|
|
67
65
|
let t5;
|
|
68
|
-
if ($[
|
|
66
|
+
if ($[16] !== style || $[17] !== t4) {
|
|
69
67
|
t5 = {
|
|
70
68
|
...t4,
|
|
71
69
|
...style
|
|
72
70
|
};
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
} else t5 = $[
|
|
71
|
+
$[16] = style;
|
|
72
|
+
$[17] = t4;
|
|
73
|
+
$[18] = t5;
|
|
74
|
+
} else t5 = $[18];
|
|
77
75
|
const t6 = loading || void 0;
|
|
78
76
|
const t7 = hasIconSlot || void 0;
|
|
79
77
|
let t8;
|
|
80
|
-
if ($[
|
|
78
|
+
if ($[19] !== hasIconSlot || $[20] !== icon || $[21] !== loading || $[22] !== loadingIcon) {
|
|
81
79
|
t8 = hasIconSlot && /*#__PURE__*/ jsxs("span", {
|
|
82
80
|
"data-tao-button-icon": "",
|
|
83
81
|
"data-tao-loading": loading || void 0,
|
|
@@ -92,14 +90,14 @@ function Button(t0) {
|
|
|
92
90
|
})
|
|
93
91
|
]
|
|
94
92
|
});
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
} else t8 = $[
|
|
93
|
+
$[19] = hasIconSlot;
|
|
94
|
+
$[20] = icon;
|
|
95
|
+
$[21] = loading;
|
|
96
|
+
$[22] = loadingIcon;
|
|
97
|
+
$[23] = t8;
|
|
98
|
+
} else t8 = $[23];
|
|
101
99
|
let t9;
|
|
102
|
-
if ($[
|
|
100
|
+
if ($[24] !== children || $[25] !== isDisabled || $[26] !== ref || $[27] !== resolvedSize || $[28] !== rest || $[29] !== t3 || $[30] !== t5 || $[31] !== t6 || $[32] !== t7 || $[33] !== t8 || $[34] !== variant) {
|
|
103
101
|
t9 = /*#__PURE__*/ jsxs("button", {
|
|
104
102
|
ref: ref,
|
|
105
103
|
type: "button",
|
|
@@ -117,21 +115,21 @@ function Button(t0) {
|
|
|
117
115
|
children
|
|
118
116
|
]
|
|
119
117
|
});
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
} else t9 = $[
|
|
118
|
+
$[24] = children;
|
|
119
|
+
$[25] = isDisabled;
|
|
120
|
+
$[26] = ref;
|
|
121
|
+
$[27] = resolvedSize;
|
|
122
|
+
$[28] = rest;
|
|
123
|
+
$[29] = t3;
|
|
124
|
+
$[30] = t5;
|
|
125
|
+
$[31] = t6;
|
|
126
|
+
$[32] = t7;
|
|
127
|
+
$[33] = t8;
|
|
128
|
+
$[34] = variant;
|
|
129
|
+
$[35] = t9;
|
|
130
|
+
} else t9 = $[35];
|
|
133
131
|
return t9;
|
|
134
|
-
}
|
|
132
|
+
});
|
|
135
133
|
function LoadingSpinner() {
|
|
136
134
|
const $ = c(1);
|
|
137
135
|
let t0;
|
|
@@ -156,4 +154,4 @@ function LoadingSpinner() {
|
|
|
156
154
|
} else t0 = $[0];
|
|
157
155
|
return t0;
|
|
158
156
|
}
|
|
159
|
-
export { Button };
|
|
157
|
+
export { button_Button as Button };
|
|
@@ -54,11 +54,15 @@
|
|
|
54
54
|
box-shadow: 0 0 0 2px var(--tao-control-outline);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
[data-tao-checkbox][data-tao-
|
|
57
|
+
[data-tao-checkbox-input]:checked + [data-tao-checkbox], [data-tao-checkbox][data-tao-indeterminate] {
|
|
58
58
|
background: var(--tao-primary);
|
|
59
59
|
border-color: var(--tao-primary);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
[data-tao-checkbox-input]:not(:checked) + [data-tao-checkbox]:not([data-tao-indeterminate]) [data-tao-checkbox-icon] {
|
|
63
|
+
display: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
62
66
|
[data-tao-checkbox-icon] {
|
|
63
67
|
color: #fff;
|
|
64
68
|
}
|
|
@@ -15,7 +15,7 @@ export interface CheckboxProps {
|
|
|
15
15
|
styles?: SemanticStyles<CheckboxSemanticPart>;
|
|
16
16
|
ref?: Ref<HTMLInputElement>;
|
|
17
17
|
}
|
|
18
|
-
export declare
|
|
18
|
+
export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
19
19
|
export type CheckboxOptionType = {
|
|
20
20
|
label: ReactNode;
|
|
21
21
|
value: string;
|
|
@@ -31,4 +31,4 @@ export interface CheckboxGroupProps {
|
|
|
31
31
|
direction?: 'horizontal' | 'vertical';
|
|
32
32
|
children?: ReactNode;
|
|
33
33
|
}
|
|
34
|
-
export declare function CheckboxGroup(
|
|
34
|
+
export declare function CheckboxGroup(props: CheckboxGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
3
|
-
import { createContext, useContext, useEffect, useRef } from "react";
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
|
+
import { createContext, forwardRef, useContext, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
5
|
import { mergeRefs } from "../../utils/refs.js";
|
|
6
6
|
import { cx } from "../../utils/semantic.js";
|
|
7
7
|
import "./checkbox.css";
|
|
8
8
|
const CheckboxGroupContext = /*#__PURE__*/ createContext(null);
|
|
9
|
-
|
|
10
|
-
const $ = c(
|
|
11
|
-
const { checked, defaultChecked, indeterminate, disabled, onChange, value, children, classNames, styles
|
|
9
|
+
const checkbox_Checkbox = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
10
|
+
const $ = c(48);
|
|
11
|
+
const { checked, defaultChecked, indeterminate, disabled, onChange, value, children, classNames, styles } = t0;
|
|
12
12
|
const ctx = useTaoConfig();
|
|
13
13
|
const groupCtx = useContext(CheckboxGroupContext);
|
|
14
14
|
const inputRef = useRef(null);
|
|
@@ -98,20 +98,19 @@ function Checkbox(t0) {
|
|
|
98
98
|
} else t15 = $[23];
|
|
99
99
|
const t16 = styles?.indicator;
|
|
100
100
|
let t17;
|
|
101
|
-
if ($[24] !== indeterminate
|
|
102
|
-
t17 =
|
|
101
|
+
if ($[24] !== indeterminate) {
|
|
102
|
+
t17 = !indeterminate && /*#__PURE__*/ jsx(CheckIcon, {});
|
|
103
103
|
$[24] = indeterminate;
|
|
104
|
-
$[25] =
|
|
105
|
-
|
|
106
|
-
} else t17 = $[26];
|
|
104
|
+
$[25] = t17;
|
|
105
|
+
} else t17 = $[25];
|
|
107
106
|
let t18;
|
|
108
|
-
if ($[
|
|
107
|
+
if ($[26] !== indeterminate) {
|
|
109
108
|
t18 = indeterminate && /*#__PURE__*/ jsx(MinusIcon, {});
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
} else t18 = $[
|
|
109
|
+
$[26] = indeterminate;
|
|
110
|
+
$[27] = t18;
|
|
111
|
+
} else t18 = $[27];
|
|
113
112
|
let t19;
|
|
114
|
-
if ($[
|
|
113
|
+
if ($[28] !== t12 || $[29] !== t13 || $[30] !== t15 || $[31] !== t16 || $[32] !== t17 || $[33] !== t18) {
|
|
115
114
|
t19 = /*#__PURE__*/ jsxs("span", {
|
|
116
115
|
"data-tao-checkbox": "",
|
|
117
116
|
"data-tao-checked": t12,
|
|
@@ -123,16 +122,16 @@ function Checkbox(t0) {
|
|
|
123
122
|
t18
|
|
124
123
|
]
|
|
125
124
|
});
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
} else t19 = $[
|
|
125
|
+
$[28] = t12;
|
|
126
|
+
$[29] = t13;
|
|
127
|
+
$[30] = t15;
|
|
128
|
+
$[31] = t16;
|
|
129
|
+
$[32] = t17;
|
|
130
|
+
$[33] = t18;
|
|
131
|
+
$[34] = t19;
|
|
132
|
+
} else t19 = $[34];
|
|
134
133
|
let t20;
|
|
135
|
-
if ($[
|
|
134
|
+
if ($[35] !== t11 || $[36] !== t19) {
|
|
136
135
|
t20 = /*#__PURE__*/ jsxs("span", {
|
|
137
136
|
"data-tao-checkbox-control": "",
|
|
138
137
|
children: [
|
|
@@ -140,25 +139,25 @@ function Checkbox(t0) {
|
|
|
140
139
|
t19
|
|
141
140
|
]
|
|
142
141
|
});
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
} else t20 = $[
|
|
142
|
+
$[35] = t11;
|
|
143
|
+
$[36] = t19;
|
|
144
|
+
$[37] = t20;
|
|
145
|
+
} else t20 = $[37];
|
|
147
146
|
let t21;
|
|
148
|
-
if ($[
|
|
147
|
+
if ($[38] !== children || $[39] !== classNames?.label || $[40] !== styles?.label) {
|
|
149
148
|
t21 = null != children && /*#__PURE__*/ jsx("span", {
|
|
150
149
|
"data-tao-checkbox-label": "",
|
|
151
150
|
className: cx(classNames?.label),
|
|
152
151
|
style: styles?.label,
|
|
153
152
|
children: children
|
|
154
153
|
});
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
} else t21 = $[
|
|
154
|
+
$[38] = children;
|
|
155
|
+
$[39] = classNames?.label;
|
|
156
|
+
$[40] = styles?.label;
|
|
157
|
+
$[41] = t21;
|
|
158
|
+
} else t21 = $[41];
|
|
160
159
|
let t22;
|
|
161
|
-
if ($[
|
|
160
|
+
if ($[42] !== t20 || $[43] !== t21 || $[44] !== t5 || $[45] !== t7 || $[46] !== t8) {
|
|
162
161
|
t22 = /*#__PURE__*/ jsxs("label", {
|
|
163
162
|
"data-tao-checkbox-wrapper": "",
|
|
164
163
|
"data-tao-disabled": t5,
|
|
@@ -169,110 +168,126 @@ function Checkbox(t0) {
|
|
|
169
168
|
t21
|
|
170
169
|
]
|
|
171
170
|
});
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
} else t22 = $[
|
|
171
|
+
$[42] = t20;
|
|
172
|
+
$[43] = t21;
|
|
173
|
+
$[44] = t5;
|
|
174
|
+
$[45] = t7;
|
|
175
|
+
$[46] = t8;
|
|
176
|
+
$[47] = t22;
|
|
177
|
+
} else t22 = $[47];
|
|
179
178
|
return t22;
|
|
180
|
-
}
|
|
181
|
-
function CheckboxGroup(
|
|
182
|
-
const $ = c(
|
|
183
|
-
const { options, value
|
|
184
|
-
|
|
185
|
-
if ($[0] !== t1) {
|
|
186
|
-
t3 = void 0 === t1 ? [] : t1;
|
|
187
|
-
$[0] = t1;
|
|
188
|
-
$[1] = t3;
|
|
189
|
-
} else t3 = $[1];
|
|
190
|
-
const value = t3;
|
|
191
|
-
const direction = void 0 === t2 ? "horizontal" : t2;
|
|
179
|
+
});
|
|
180
|
+
function CheckboxGroup(props) {
|
|
181
|
+
const $ = c(31);
|
|
182
|
+
const { options, value, defaultValue, onChange, disabled, direction: t0, children } = props;
|
|
183
|
+
const direction = void 0 === t0 ? "horizontal" : t0;
|
|
192
184
|
const ctx = useTaoConfig();
|
|
193
185
|
const resolvedDisabled = disabled ?? ctx.disabled ?? false;
|
|
194
|
-
let
|
|
195
|
-
if ($[
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
186
|
+
let t1;
|
|
187
|
+
if ($[0] !== defaultValue) {
|
|
188
|
+
t1 = ()=>[
|
|
189
|
+
...new Set(defaultValue ?? [])
|
|
190
|
+
];
|
|
191
|
+
$[0] = defaultValue;
|
|
192
|
+
$[1] = t1;
|
|
193
|
+
} else t1 = $[1];
|
|
194
|
+
const [internalValue, setInternalValue] = useState(t1);
|
|
195
|
+
const isControlled = "value" in props;
|
|
196
|
+
let t2;
|
|
197
|
+
if ($[2] !== internalValue || $[3] !== isControlled || $[4] !== value) {
|
|
198
|
+
t2 = isControlled ? value ?? [] : internalValue;
|
|
199
|
+
$[2] = internalValue;
|
|
200
|
+
$[3] = isControlled;
|
|
201
|
+
$[4] = value;
|
|
202
|
+
$[5] = t2;
|
|
203
|
+
} else t2 = $[5];
|
|
204
|
+
const resolvedValue = t2;
|
|
205
|
+
let t3;
|
|
206
|
+
if ($[6] !== isControlled || $[7] !== onChange || $[8] !== resolvedValue) {
|
|
207
|
+
t3 = (itemValue, checked)=>{
|
|
208
|
+
const next = [
|
|
209
|
+
...new Set(checked ? [
|
|
210
|
+
...resolvedValue,
|
|
211
|
+
itemValue
|
|
212
|
+
] : resolvedValue.filter((v)=>v !== itemValue))
|
|
213
|
+
];
|
|
214
|
+
if (!isControlled) setInternalValue(next);
|
|
201
215
|
onChange?.(next);
|
|
202
216
|
};
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
217
|
+
$[6] = isControlled;
|
|
218
|
+
$[7] = onChange;
|
|
219
|
+
$[8] = resolvedValue;
|
|
220
|
+
$[9] = t3;
|
|
221
|
+
} else t3 = $[9];
|
|
222
|
+
const handleItemChange = t3;
|
|
223
|
+
let t4;
|
|
224
|
+
if ($[10] !== handleItemChange || $[11] !== resolvedDisabled || $[12] !== resolvedValue) {
|
|
225
|
+
t4 = {
|
|
226
|
+
value: resolvedValue,
|
|
212
227
|
disabled: resolvedDisabled,
|
|
213
228
|
onChange: handleItemChange
|
|
214
229
|
};
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
} else
|
|
220
|
-
const groupCtxValue =
|
|
230
|
+
$[10] = handleItemChange;
|
|
231
|
+
$[11] = resolvedDisabled;
|
|
232
|
+
$[12] = resolvedValue;
|
|
233
|
+
$[13] = t4;
|
|
234
|
+
} else t4 = $[13];
|
|
235
|
+
const groupCtxValue = t4;
|
|
221
236
|
let T0;
|
|
237
|
+
let t5;
|
|
222
238
|
let t6;
|
|
223
239
|
let t7;
|
|
224
240
|
let t8;
|
|
225
|
-
|
|
226
|
-
if ($[9] !== children || $[10] !== direction || $[11] !== groupCtxValue || $[12] !== options) {
|
|
241
|
+
if ($[14] !== children || $[15] !== direction || $[16] !== groupCtxValue || $[17] !== options) {
|
|
227
242
|
const normalizedOptions = options?.map(_temp);
|
|
228
243
|
T0 = CheckboxGroupContext.Provider;
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
$[
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
244
|
+
t8 = groupCtxValue;
|
|
245
|
+
t5 = "";
|
|
246
|
+
t6 = direction;
|
|
247
|
+
t7 = normalizedOptions ? normalizedOptions.map(_temp2) : children;
|
|
248
|
+
$[14] = children;
|
|
249
|
+
$[15] = direction;
|
|
250
|
+
$[16] = groupCtxValue;
|
|
251
|
+
$[17] = options;
|
|
252
|
+
$[18] = T0;
|
|
253
|
+
$[19] = t5;
|
|
254
|
+
$[20] = t6;
|
|
255
|
+
$[21] = t7;
|
|
256
|
+
$[22] = t8;
|
|
242
257
|
} else {
|
|
243
|
-
T0 = $[
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
258
|
+
T0 = $[18];
|
|
259
|
+
t5 = $[19];
|
|
260
|
+
t6 = $[20];
|
|
261
|
+
t7 = $[21];
|
|
262
|
+
t8 = $[22];
|
|
248
263
|
}
|
|
249
|
-
let
|
|
250
|
-
if ($[
|
|
251
|
-
|
|
252
|
-
"data-tao-checkbox-group":
|
|
253
|
-
"data-tao-direction":
|
|
254
|
-
children:
|
|
264
|
+
let t9;
|
|
265
|
+
if ($[23] !== t5 || $[24] !== t6 || $[25] !== t7) {
|
|
266
|
+
t9 = /*#__PURE__*/ jsx("div", {
|
|
267
|
+
"data-tao-checkbox-group": t5,
|
|
268
|
+
"data-tao-direction": t6,
|
|
269
|
+
children: t7
|
|
255
270
|
});
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
} else
|
|
261
|
-
let
|
|
262
|
-
if ($[
|
|
263
|
-
|
|
264
|
-
value:
|
|
265
|
-
children:
|
|
271
|
+
$[23] = t5;
|
|
272
|
+
$[24] = t6;
|
|
273
|
+
$[25] = t7;
|
|
274
|
+
$[26] = t9;
|
|
275
|
+
} else t9 = $[26];
|
|
276
|
+
let t10;
|
|
277
|
+
if ($[27] !== T0 || $[28] !== t8 || $[29] !== t9) {
|
|
278
|
+
t10 = /*#__PURE__*/ jsx(T0, {
|
|
279
|
+
value: t8,
|
|
280
|
+
children: t9
|
|
266
281
|
});
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
} else
|
|
272
|
-
return
|
|
282
|
+
$[27] = T0;
|
|
283
|
+
$[28] = t8;
|
|
284
|
+
$[29] = t9;
|
|
285
|
+
$[30] = t10;
|
|
286
|
+
} else t10 = $[30];
|
|
287
|
+
return t10;
|
|
273
288
|
}
|
|
274
289
|
function _temp2(opt_0) {
|
|
275
|
-
return /*#__PURE__*/ jsx(
|
|
290
|
+
return /*#__PURE__*/ jsx(checkbox_Checkbox, {
|
|
276
291
|
value: opt_0.value,
|
|
277
292
|
disabled: opt_0.disabled,
|
|
278
293
|
children: opt_0.label
|
|
@@ -334,4 +349,4 @@ function MinusIcon() {
|
|
|
334
349
|
} else t0 = $[0];
|
|
335
350
|
return t0;
|
|
336
351
|
}
|
|
337
|
-
export {
|
|
352
|
+
export { CheckboxGroup, checkbox_Checkbox as Checkbox };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { createContext, useContext, useState } from "react";
|
|
4
4
|
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
5
|
import { cx } from "../../utils/semantic.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
|
|
4
4
|
import { cx } from "../../utils/semantic.js";
|
|
5
5
|
import { useMenuController } from "../menu/menu-render.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react
|
|
2
|
+
import { c } from "react-compiler-runtime";
|
|
3
3
|
function CalendarHeader(t0) {
|
|
4
4
|
const $ = c(58);
|
|
5
5
|
const { viewDate, panelMode, onViewDateChange, onPanelModeChange } = t0;
|
|
@@ -4,6 +4,8 @@ interface MonthGridProps {
|
|
|
4
4
|
value?: Dayjs | null;
|
|
5
5
|
onSelect: (date: Dayjs) => void;
|
|
6
6
|
disabledDate?: (date: Dayjs) => boolean;
|
|
7
|
+
minDate?: Dayjs;
|
|
8
|
+
maxDate?: Dayjs;
|
|
7
9
|
}
|
|
8
|
-
export declare function MonthGrid({ viewDate, value, onSelect, disabledDate, }: MonthGridProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function MonthGrid({ viewDate, value, onSelect, disabledDate, minDate, maxDate, }: MonthGridProps): import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
export {};
|