@rockshin/tao-ui 0.0.31 → 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.
Files changed (158) hide show
  1. package/README.md +14 -3
  2. package/dist/components/alert/alert.js +1 -1
  3. package/dist/components/breadcrumb/breadcrumb.js +1 -1
  4. package/dist/components/button/button.d.ts +2 -2
  5. package/dist/components/button/button.js +48 -50
  6. package/dist/components/checkbox/checkbox.css +5 -1
  7. package/dist/components/checkbox/checkbox.d.ts +2 -2
  8. package/dist/components/checkbox/checkbox.js +135 -120
  9. package/dist/components/collapsible/collapsible.js +1 -1
  10. package/dist/components/context-menu/context-menu.js +1 -1
  11. package/dist/components/date-picker/calendar/calendar-header.js +1 -1
  12. package/dist/components/date-picker/calendar/month-grid.d.ts +3 -1
  13. package/dist/components/date-picker/calendar/month-grid.js +19 -17
  14. package/dist/components/date-picker/calendar/time-panel.js +1 -1
  15. package/dist/components/date-picker/calendar/year-grid.d.ts +3 -1
  16. package/dist/components/date-picker/calendar/year-grid.js +28 -24
  17. package/dist/components/date-picker/date-picker.d.ts +1 -1
  18. package/dist/components/date-picker/date-picker.js +37 -24
  19. package/dist/components/date-picker/presets.js +1 -1
  20. package/dist/components/date-picker/range-picker.d.ts +1 -1
  21. package/dist/components/date-picker/range-picker.js +104 -56
  22. package/dist/components/drawer/drawer.d.ts +1 -1
  23. package/dist/components/drawer/drawer.js +98 -91
  24. package/dist/components/dropdown/dropdown.js +84 -84
  25. package/dist/components/form/form-item.js +8 -4
  26. package/dist/components/form/form.js +1 -1
  27. package/dist/components/form-actions/form-actions.js +1 -1
  28. package/dist/components/form-field/form-field-view.js +58 -51
  29. package/dist/components/form-field/form-field.js +1 -1
  30. package/dist/components/form-section/form-section.js +1 -1
  31. package/dist/components/input/input.js +42 -39
  32. package/dist/components/input-number/input-number.d.ts +2 -2
  33. package/dist/components/input-number/input-number.js +57 -59
  34. package/dist/components/menu/menu-render.js +1 -1
  35. package/dist/components/modal/confirm-dialog.d.ts +2 -1
  36. package/dist/components/modal/confirm-dialog.js +25 -5
  37. package/dist/components/modal/confirm.js +15 -3
  38. package/dist/components/modal/modal.d.ts +1 -1
  39. package/dist/components/modal/modal.js +131 -132
  40. package/dist/components/modal/use-modal.js +48 -35
  41. package/dist/components/pagination/pagination.js +3 -1
  42. package/dist/components/popconfirm/popconfirm.js +1 -1
  43. package/dist/components/popover/popover.js +253 -228
  44. package/dist/components/radio/radio.css +2 -2
  45. package/dist/components/radio/radio.d.ts +1 -1
  46. package/dist/components/radio/radio.js +7 -7
  47. package/dist/components/scroll-area/scroll-area.css +2 -2
  48. package/dist/components/scroll-area/scroll-area.js +187 -165
  49. package/dist/components/select/mobile-select.d.ts +2 -1
  50. package/dist/components/select/mobile-select.js +12 -6
  51. package/dist/components/select/select-icons.js +1 -1
  52. package/dist/components/select/select-searchable-list.d.ts +1 -1
  53. package/dist/components/select/select-searchable-list.js +35 -21
  54. package/dist/components/select/select-tags.js +1 -1
  55. package/dist/components/select/select-types.d.ts +2 -2
  56. package/dist/components/select/select.css +4 -0
  57. package/dist/components/select/select.d.ts +2 -2
  58. package/dist/components/select/select.js +124 -72
  59. package/dist/components/sonner/sonner.js +6 -5
  60. package/dist/components/spinner/spinner.js +1 -1
  61. package/dist/components/splitter/splitter.js +187 -194
  62. package/dist/components/status-icon/status-icon.js +1 -1
  63. package/dist/components/switch/switch.d.ts +1 -1
  64. package/dist/components/switch/switch.js +6 -6
  65. package/dist/components/table/table-filter.js +1 -1
  66. package/dist/components/table/table-icons.js +1 -1
  67. package/dist/components/table/table.js +483 -599
  68. package/dist/components/tabs/tabs.js +179 -161
  69. package/dist/components/tag/tag.js +1 -1
  70. package/dist/components/textarea/textarea.d.ts +1 -1
  71. package/dist/components/textarea/textarea.js +142 -108
  72. package/dist/components/tooltip/tooltip.js +88 -72
  73. package/dist/entries/alert.d.ts +3 -0
  74. package/dist/entries/alert.js +4 -0
  75. package/dist/entries/breadcrumb.d.ts +3 -0
  76. package/dist/entries/breadcrumb.js +4 -0
  77. package/dist/entries/button.d.ts +3 -0
  78. package/dist/entries/button.js +4 -0
  79. package/dist/entries/checkbox.d.ts +3 -0
  80. package/dist/entries/checkbox.js +4 -0
  81. package/dist/entries/collapsible.d.ts +3 -0
  82. package/dist/entries/collapsible.js +4 -0
  83. package/dist/entries/context-menu.d.ts +3 -0
  84. package/dist/entries/context-menu.js +4 -0
  85. package/dist/entries/date-picker.d.ts +3 -0
  86. package/dist/entries/date-picker.js +4 -0
  87. package/dist/entries/drawer.d.ts +3 -0
  88. package/dist/entries/drawer.js +4 -0
  89. package/dist/entries/dropdown.d.ts +3 -0
  90. package/dist/entries/dropdown.js +4 -0
  91. package/dist/entries/form-actions.d.ts +3 -0
  92. package/dist/entries/form-actions.js +4 -0
  93. package/dist/entries/form-field.d.ts +3 -0
  94. package/dist/entries/form-field.js +4 -0
  95. package/dist/entries/form-layout.d.ts +3 -0
  96. package/dist/entries/form-layout.js +4 -0
  97. package/dist/entries/form-section.d.ts +3 -0
  98. package/dist/entries/form-section.js +4 -0
  99. package/dist/entries/form.d.ts +4 -0
  100. package/dist/entries/form.js +4 -0
  101. package/dist/entries/input-number.d.ts +3 -0
  102. package/dist/entries/input-number.js +4 -0
  103. package/dist/entries/input.d.ts +3 -0
  104. package/dist/entries/input.js +4 -0
  105. package/dist/entries/modal.d.ts +3 -0
  106. package/dist/entries/modal.js +4 -0
  107. package/dist/entries/number-input.d.ts +3 -0
  108. package/dist/entries/number-input.js +4 -0
  109. package/dist/entries/pagination.d.ts +3 -0
  110. package/dist/entries/pagination.js +4 -0
  111. package/dist/entries/popconfirm.d.ts +3 -0
  112. package/dist/entries/popconfirm.js +4 -0
  113. package/dist/entries/popover.d.ts +3 -0
  114. package/dist/entries/popover.js +4 -0
  115. package/dist/entries/provider.d.ts +3 -0
  116. package/dist/entries/provider.js +4 -0
  117. package/dist/entries/radio.d.ts +3 -0
  118. package/dist/entries/radio.js +4 -0
  119. package/dist/entries/range-picker.d.ts +3 -0
  120. package/dist/entries/range-picker.js +4 -0
  121. package/dist/entries/scroll-area.d.ts +3 -0
  122. package/dist/entries/scroll-area.js +4 -0
  123. package/dist/entries/select.d.ts +3 -0
  124. package/dist/entries/select.js +4 -0
  125. package/dist/entries/sonner.d.ts +3 -0
  126. package/dist/entries/sonner.js +4 -0
  127. package/dist/entries/spinner.d.ts +3 -0
  128. package/dist/entries/spinner.js +4 -0
  129. package/dist/entries/splitter.d.ts +3 -0
  130. package/dist/entries/splitter.js +4 -0
  131. package/dist/entries/stack.d.ts +3 -0
  132. package/dist/entries/stack.js +4 -0
  133. package/dist/entries/switch.d.ts +3 -0
  134. package/dist/entries/switch.js +4 -0
  135. package/dist/entries/table.d.ts +3 -0
  136. package/dist/entries/table.js +4 -0
  137. package/dist/entries/tabs.d.ts +3 -0
  138. package/dist/entries/tabs.js +4 -0
  139. package/dist/entries/tag.d.ts +3 -0
  140. package/dist/entries/tag.js +4 -0
  141. package/dist/entries/textarea.d.ts +3 -0
  142. package/dist/entries/textarea.js +4 -0
  143. package/dist/entries/tooltip.d.ts +3 -0
  144. package/dist/entries/tooltip.js +4 -0
  145. package/dist/layouts/form-layout/form-layout.js +1 -1
  146. package/dist/layouts/stack/stack.js +1 -1
  147. package/dist/number-input/number-input.js +1 -1
  148. package/dist/number-input/use-number-input.d.ts +2 -2
  149. package/dist/number-input/use-number-input.js +224 -131
  150. package/dist/number-input/validate.js +7 -2
  151. package/dist/provider/tao-provider.js +1 -1
  152. package/dist/utils/dialog-content.d.ts +10 -0
  153. package/dist/utils/dialog-content.js +222 -0
  154. package/dist/utils/overlay.d.ts +2 -2
  155. package/dist/utils/overlay.js +8 -3
  156. package/dist/utils/refs.js +17 -2
  157. package/llms.txt +5 -3
  158. package/package.json +21 -8
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # tao-ui
2
2
 
3
- A modern React 19 component library with semantic DOM customization and OKLCH-based theming.
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** — built for the latest React, ships with the React Compiler.
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 >=19`, `react-dom >=19`, `dayjs >=1.11` (for the date pickers).
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/compiler-runtime";
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/compiler-runtime";
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 { ButtonHTMLAttributes, ReactNode, Ref } from 'react';
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 function Button({ variant, size, disabled, loading, icon, loadingIcon, children, ref, className, style, classNames, styles, ...rest }: ButtonProps): import("react/jsx-runtime").JSX.Element;
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/compiler-runtime";
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
- function Button(t0) {
7
- const $ = c(37);
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, ref, className, style, classNames, styles, ...rest } = t0);
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] = ref;
32
- $[9] = rest;
33
- $[10] = size;
34
- $[11] = style;
35
- $[12] = styles;
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
- ref = $[8];
46
- rest = $[9];
47
- size = $[10];
48
- style = $[11];
49
- styles = $[12];
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 ($[14] !== className || $[15] !== t2) {
58
+ if ($[13] !== className || $[14] !== t2) {
61
59
  t3 = cx(t2, className);
62
- $[14] = className;
63
- $[15] = t2;
64
- $[16] = t3;
65
- } else t3 = $[16];
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 ($[17] !== style || $[18] !== t4) {
66
+ if ($[16] !== style || $[17] !== t4) {
69
67
  t5 = {
70
68
  ...t4,
71
69
  ...style
72
70
  };
73
- $[17] = style;
74
- $[18] = t4;
75
- $[19] = t5;
76
- } else t5 = $[19];
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 ($[20] !== hasIconSlot || $[21] !== icon || $[22] !== loading || $[23] !== loadingIcon) {
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
- $[20] = hasIconSlot;
96
- $[21] = icon;
97
- $[22] = loading;
98
- $[23] = loadingIcon;
99
- $[24] = t8;
100
- } else t8 = $[24];
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 ($[25] !== children || $[26] !== isDisabled || $[27] !== ref || $[28] !== resolvedSize || $[29] !== rest || $[30] !== t3 || $[31] !== t5 || $[32] !== t6 || $[33] !== t7 || $[34] !== t8 || $[35] !== variant) {
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
- $[25] = children;
121
- $[26] = isDisabled;
122
- $[27] = ref;
123
- $[28] = resolvedSize;
124
- $[29] = rest;
125
- $[30] = t3;
126
- $[31] = t5;
127
- $[32] = t6;
128
- $[33] = t7;
129
- $[34] = t8;
130
- $[35] = variant;
131
- $[36] = t9;
132
- } else t9 = $[36];
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-checked], [data-tao-checkbox][data-tao-indeterminate] {
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 function Checkbox({ checked, defaultChecked, indeterminate, disabled, onChange, value, children, classNames, styles, ref, }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
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({ options, value, onChange, disabled, direction, children, }: CheckboxGroupProps): import("react/jsx-runtime").JSX.Element;
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/compiler-runtime";
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
- function Checkbox(t0) {
10
- const $ = c(49);
11
- const { checked, defaultChecked, indeterminate, disabled, onChange, value, children, classNames, styles, ref } = t0;
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 || $[25] !== resolvedChecked) {
102
- t17 = resolvedChecked && !indeterminate && /*#__PURE__*/ jsx(CheckIcon, {});
101
+ if ($[24] !== indeterminate) {
102
+ t17 = !indeterminate && /*#__PURE__*/ jsx(CheckIcon, {});
103
103
  $[24] = indeterminate;
104
- $[25] = resolvedChecked;
105
- $[26] = t17;
106
- } else t17 = $[26];
104
+ $[25] = t17;
105
+ } else t17 = $[25];
107
106
  let t18;
108
- if ($[27] !== indeterminate) {
107
+ if ($[26] !== indeterminate) {
109
108
  t18 = indeterminate && /*#__PURE__*/ jsx(MinusIcon, {});
110
- $[27] = indeterminate;
111
- $[28] = t18;
112
- } else t18 = $[28];
109
+ $[26] = indeterminate;
110
+ $[27] = t18;
111
+ } else t18 = $[27];
113
112
  let t19;
114
- if ($[29] !== t12 || $[30] !== t13 || $[31] !== t15 || $[32] !== t16 || $[33] !== t17 || $[34] !== t18) {
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
- $[29] = t12;
127
- $[30] = t13;
128
- $[31] = t15;
129
- $[32] = t16;
130
- $[33] = t17;
131
- $[34] = t18;
132
- $[35] = t19;
133
- } else t19 = $[35];
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 ($[36] !== t11 || $[37] !== t19) {
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
- $[36] = t11;
144
- $[37] = t19;
145
- $[38] = t20;
146
- } else t20 = $[38];
142
+ $[35] = t11;
143
+ $[36] = t19;
144
+ $[37] = t20;
145
+ } else t20 = $[37];
147
146
  let t21;
148
- if ($[39] !== children || $[40] !== classNames?.label || $[41] !== styles?.label) {
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
- $[39] = children;
156
- $[40] = classNames?.label;
157
- $[41] = styles?.label;
158
- $[42] = t21;
159
- } else t21 = $[42];
154
+ $[38] = children;
155
+ $[39] = classNames?.label;
156
+ $[40] = styles?.label;
157
+ $[41] = t21;
158
+ } else t21 = $[41];
160
159
  let t22;
161
- if ($[43] !== t20 || $[44] !== t21 || $[45] !== t5 || $[46] !== t7 || $[47] !== t8) {
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
- $[43] = t20;
173
- $[44] = t21;
174
- $[45] = t5;
175
- $[46] = t7;
176
- $[47] = t8;
177
- $[48] = t22;
178
- } else t22 = $[48];
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(t0) {
182
- const $ = c(26);
183
- const { options, value: t1, onChange, disabled, direction: t2, children } = t0;
184
- let t3;
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 t4;
195
- if ($[2] !== onChange || $[3] !== value) {
196
- t4 = (itemValue, checked)=>{
197
- const next = checked ? [
198
- ...value,
199
- itemValue
200
- ] : value.filter((v)=>v !== itemValue);
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
- $[2] = onChange;
204
- $[3] = value;
205
- $[4] = t4;
206
- } else t4 = $[4];
207
- const handleItemChange = t4;
208
- let t5;
209
- if ($[5] !== handleItemChange || $[6] !== resolvedDisabled || $[7] !== value) {
210
- t5 = {
211
- value,
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
- $[5] = handleItemChange;
216
- $[6] = resolvedDisabled;
217
- $[7] = value;
218
- $[8] = t5;
219
- } else t5 = $[8];
220
- const groupCtxValue = t5;
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
- let t9;
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
- t9 = groupCtxValue;
230
- t6 = "";
231
- t7 = direction;
232
- t8 = normalizedOptions ? normalizedOptions.map(_temp2) : children;
233
- $[9] = children;
234
- $[10] = direction;
235
- $[11] = groupCtxValue;
236
- $[12] = options;
237
- $[13] = T0;
238
- $[14] = t6;
239
- $[15] = t7;
240
- $[16] = t8;
241
- $[17] = t9;
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 = $[13];
244
- t6 = $[14];
245
- t7 = $[15];
246
- t8 = $[16];
247
- t9 = $[17];
258
+ T0 = $[18];
259
+ t5 = $[19];
260
+ t6 = $[20];
261
+ t7 = $[21];
262
+ t8 = $[22];
248
263
  }
249
- let t10;
250
- if ($[18] !== t6 || $[19] !== t7 || $[20] !== t8) {
251
- t10 = /*#__PURE__*/ jsx("div", {
252
- "data-tao-checkbox-group": t6,
253
- "data-tao-direction": t7,
254
- children: t8
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
- $[18] = t6;
257
- $[19] = t7;
258
- $[20] = t8;
259
- $[21] = t10;
260
- } else t10 = $[21];
261
- let t11;
262
- if ($[22] !== T0 || $[23] !== t10 || $[24] !== t9) {
263
- t11 = /*#__PURE__*/ jsx(T0, {
264
- value: t9,
265
- children: t10
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
- $[22] = T0;
268
- $[23] = t10;
269
- $[24] = t9;
270
- $[25] = t11;
271
- } else t11 = $[25];
272
- return t11;
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(Checkbox, {
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 { Checkbox, CheckboxGroup };
352
+ export { CheckboxGroup, checkbox_Checkbox as Checkbox };
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
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/compiler-runtime";
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/compiler-runtime";
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 {};