@rockshin/tao-ui 0.0.59 → 0.0.60

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 (41) hide show
  1. package/dist/components/cascader/cascader.js +1 -0
  2. package/dist/components/color-picker/color-picker.css +1 -1
  3. package/dist/components/color-picker/color-picker.js +3 -2
  4. package/dist/components/context-menu/context-menu.d.ts +3 -1
  5. package/dist/components/context-menu/context-menu.js +48 -43
  6. package/dist/components/date-picker/calendar/time-panel.js +7 -3
  7. package/dist/components/date-picker/date-picker.js +3 -1
  8. package/dist/components/date-picker/range-picker.js +5 -3
  9. package/dist/components/dropdown/dropdown.d.ts +1 -0
  10. package/dist/components/dropdown/dropdown.js +18 -12
  11. package/dist/components/float-button/float-button.js +2 -1
  12. package/dist/components/form/use-form.js +2 -1
  13. package/dist/components/input-number/input-number.d.ts +2 -1
  14. package/dist/components/input-number/input-number.js +67 -52
  15. package/dist/components/mentions/mentions.js +3 -2
  16. package/dist/components/menu/menu-render.d.ts +6 -0
  17. package/dist/components/menu/menu-render.js +38 -26
  18. package/dist/components/modal/confirm-dialog.js +11 -6
  19. package/dist/components/modal/use-modal.js +1 -1
  20. package/dist/components/pagination/pagination.d.ts +3 -2
  21. package/dist/components/pagination/pagination.js +127 -117
  22. package/dist/components/popover/popover.js +125 -298
  23. package/dist/components/select/mobile-select.js +1 -1
  24. package/dist/components/select/select-model.js +1 -1
  25. package/dist/components/select/use-select-selection.js +94 -86
  26. package/dist/components/statistic/statistic.js +38 -31
  27. package/dist/components/table/table-filter.d.ts +3 -1
  28. package/dist/components/table/table-filter.js +100 -74
  29. package/dist/components/table/table.js +1 -0
  30. package/dist/components/tabs/tabs.d.ts +3 -2
  31. package/dist/components/tabs/tabs.js +122 -112
  32. package/dist/components/time-picker/time-picker.js +4 -2
  33. package/dist/components/tooltip/tooltip.d.ts +1 -1
  34. package/dist/components/tooltip/tooltip.js +168 -210
  35. package/dist/components/tree-select/tree-select.js +1 -0
  36. package/dist/number-input/use-number-input.d.ts +1 -0
  37. package/dist/number-input/use-number-input.js +6 -2
  38. package/dist/provider/tao-provider.js +18 -4
  39. package/dist/theme/control.css +5 -1
  40. package/dist/theme/theme.css +2 -2
  41. package/package.json +1 -1
@@ -171,6 +171,7 @@ function InternalCascader(props, ref) {
171
171
  "data-tao-error": 'error' === status || void 0,
172
172
  "data-tao-warning": 'warning' === status || void 0,
173
173
  disabled: disabled,
174
+ "aria-invalid": 'error' === status ? true : props['aria-invalid'],
174
175
  className: cx(className, rootClassName, classes?.root),
175
176
  style: {
176
177
  ...semanticStyles?.root,
@@ -60,7 +60,7 @@
60
60
  }
61
61
 
62
62
  [data-tao-color-popup] {
63
- z-index: calc(var(--tao-z-index-popup-base) + 50);
63
+ z-index: var(--tao-z-index-popup);
64
64
  width: 304px;
65
65
  max-width: calc(100vw - 24px);
66
66
  max-height: var(--radix-popover-content-available-height);
@@ -79,7 +79,8 @@ function PickerPanel() {
79
79
  step: step,
80
80
  value: number,
81
81
  onChange: (event)=>{
82
- if ("" !== event.target.value) change(clamp(Number(event.target.value), max));
82
+ const parsed = Number(event.target.value);
83
+ if ("" !== event.target.value && Number.isFinite(parsed)) change(clamp(parsed, max));
83
84
  }
84
85
  })
85
86
  ]
@@ -131,7 +132,7 @@ function PickerPanel() {
131
132
  };
132
133
  t9 = {
133
134
  popup: {
134
- zIndex: "calc(var(--tao-z-index-popup-base) + 60)"
135
+ zIndex: "calc(var(--tao-z-index-popup) + 10)"
135
136
  }
136
137
  };
137
138
  $[11] = t8;
@@ -1,4 +1,5 @@
1
1
  import { type CSSProperties, type ReactNode } from 'react';
2
+ import { type TaoSize } from '../../provider/tao-provider.js';
2
3
  import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic.js';
3
4
  import { type MenuProps, type MenuSemanticPart } from '../menu/menu-render.js';
4
5
  import './context-menu.css';
@@ -10,6 +11,7 @@ export interface ContextMenuProps {
10
11
  children: ReactNode;
11
12
  open?: boolean;
12
13
  onOpenChange?: (open: boolean) => void;
14
+ size?: TaoSize;
13
15
  disabled?: boolean;
14
16
  /** Merged onto the floating content. */
15
17
  className?: string;
@@ -17,4 +19,4 @@ export interface ContextMenuProps {
17
19
  classNames?: SemanticClassNames<ContextMenuSemanticPart>;
18
20
  styles?: SemanticStyles<ContextMenuSemanticPart>;
19
21
  }
20
- export declare function ContextMenu({ direction: directionProp, menu, children, open, onOpenChange, disabled, className, style, classNames, styles, }: ContextMenuProps): import("react").JSX.Element;
22
+ export declare function ContextMenu({ direction: directionProp, menu, children, open, onOpenChange, size: sizeProp, disabled, className, style, classNames, styles, }: ContextMenuProps): import("react").JSX.Element;
@@ -22,10 +22,11 @@ const CM = {
22
22
  ItemIndicator: __rspack_external__radix_ui_react_context_menu_d8b375cc.ItemIndicator
23
23
  };
24
24
  function ContextMenu(t0) {
25
- const $ = c(37);
26
- const { direction: directionProp, menu, children, open, onOpenChange, disabled, className, style, classNames, styles } = t0;
25
+ const $ = c(39);
26
+ const { direction: directionProp, menu, children, open, onOpenChange, size: sizeProp, disabled, className, style, classNames, styles } = t0;
27
27
  const [direction, directionRef] = useTaoDirection(directionProp, "self");
28
- const { size, disabled: ctxDisabled } = useTaoConfig();
28
+ const { size: ctxSize, disabled: ctxDisabled } = useTaoConfig();
29
+ const size = sizeProp ?? ctxSize;
29
30
  const resolvedDisabled = disabled ?? ctxDisabled;
30
31
  const t1 = !resolvedDisabled;
31
32
  let t2;
@@ -65,51 +66,55 @@ function ContextMenu(t0) {
65
66
  }
66
67
  useEffect(t3, t4);
67
68
  let t5;
68
- if ($[10] !== classNames || $[11] !== styles) {
69
+ if ($[10] !== classNames || $[11] !== direction || $[12] !== size || $[13] !== styles) {
69
70
  t5 = {
71
+ size,
72
+ direction,
70
73
  classNames,
71
74
  styles
72
75
  };
73
76
  $[10] = classNames;
74
- $[11] = styles;
75
- $[12] = t5;
76
- } else t5 = $[12];
77
+ $[11] = direction;
78
+ $[12] = size;
79
+ $[13] = styles;
80
+ $[14] = t5;
81
+ } else t5 = $[14];
77
82
  const { content } = useMenuController(menu, CM, t5);
78
83
  const t6 = realOpen && !resolvedDisabled;
79
84
  let t7;
80
- if ($[13] !== children || $[14] !== directionRef || $[15] !== resolvedDisabled) {
85
+ if ($[15] !== children || $[16] !== directionRef || $[17] !== resolvedDisabled) {
81
86
  t7 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_context_menu_d8b375cc.Trigger, {
82
87
  ref: directionRef,
83
88
  disabled: resolvedDisabled,
84
89
  "data-tao-context-menu-trigger": "",
85
90
  children: children
86
91
  });
87
- $[13] = children;
88
- $[14] = directionRef;
89
- $[15] = resolvedDisabled;
90
- $[16] = t7;
91
- } else t7 = $[16];
92
+ $[15] = children;
93
+ $[16] = directionRef;
94
+ $[17] = resolvedDisabled;
95
+ $[18] = t7;
96
+ } else t7 = $[18];
92
97
  const t8 = classNames?.content;
93
98
  let t9;
94
- if ($[17] !== className || $[18] !== t8) {
99
+ if ($[19] !== className || $[20] !== t8) {
95
100
  t9 = cx(t8, className);
96
- $[17] = className;
97
- $[18] = t8;
98
- $[19] = t9;
99
- } else t9 = $[19];
101
+ $[19] = className;
102
+ $[20] = t8;
103
+ $[21] = t9;
104
+ } else t9 = $[21];
100
105
  const t10 = styles?.content;
101
106
  let t11;
102
- if ($[20] !== style || $[21] !== t10) {
107
+ if ($[22] !== style || $[23] !== t10) {
103
108
  t11 = {
104
109
  ...t10,
105
110
  ...style
106
111
  };
107
- $[20] = style;
108
- $[21] = t10;
109
- $[22] = t11;
110
- } else t11 = $[22];
112
+ $[22] = style;
113
+ $[23] = t10;
114
+ $[24] = t11;
115
+ } else t11 = $[24];
111
116
  let t12;
112
- if ($[23] !== content || $[24] !== size || $[25] !== t11 || $[26] !== t9) {
117
+ if ($[25] !== content || $[26] !== size || $[27] !== t11 || $[28] !== t9) {
113
118
  t12 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_context_menu_d8b375cc.Content, {
114
119
  "data-tao-menu-content": "",
115
120
  "data-tao-context-menu": "",
@@ -118,14 +123,14 @@ function ContextMenu(t0) {
118
123
  style: t11,
119
124
  children: content
120
125
  });
121
- $[23] = content;
122
- $[24] = size;
123
- $[25] = t11;
124
- $[26] = t9;
125
- $[27] = t12;
126
- } else t12 = $[27];
126
+ $[25] = content;
127
+ $[26] = size;
128
+ $[27] = t11;
129
+ $[28] = t9;
130
+ $[29] = t12;
131
+ } else t12 = $[29];
127
132
  let t13;
128
- if ($[28] !== direction || $[29] !== t12) {
133
+ if ($[30] !== direction || $[31] !== t12) {
129
134
  t13 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_context_menu_d8b375cc.Portal, {
130
135
  children: /*#__PURE__*/ jsx(TaoPortalScope, {
131
136
  asChild: true,
@@ -133,12 +138,12 @@ function ContextMenu(t0) {
133
138
  children: t12
134
139
  })
135
140
  });
136
- $[28] = direction;
137
- $[29] = t12;
138
- $[30] = t13;
139
- } else t13 = $[30];
141
+ $[30] = direction;
142
+ $[31] = t12;
143
+ $[32] = t13;
144
+ } else t13 = $[32];
140
145
  let t14;
141
- if ($[31] !== direction || $[32] !== setOpen || $[33] !== t13 || $[34] !== t6 || $[35] !== t7) {
146
+ if ($[33] !== direction || $[34] !== setOpen || $[35] !== t13 || $[36] !== t6 || $[37] !== t7) {
142
147
  t14 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_context_menu_d8b375cc.Root, {
143
148
  dir: direction,
144
149
  open: t6,
@@ -148,13 +153,13 @@ function ContextMenu(t0) {
148
153
  t13
149
154
  ]
150
155
  });
151
- $[31] = direction;
152
- $[32] = setOpen;
153
- $[33] = t13;
154
- $[34] = t6;
155
- $[35] = t7;
156
- $[36] = t14;
157
- } else t14 = $[36];
156
+ $[33] = direction;
157
+ $[34] = setOpen;
158
+ $[35] = t13;
159
+ $[36] = t6;
160
+ $[37] = t7;
161
+ $[38] = t14;
162
+ } else t14 = $[38];
158
163
  return t14;
159
164
  }
160
165
  export { ContextMenu };
@@ -22,9 +22,10 @@ function TimePanel(t0) {
22
22
  $[1] = t1;
23
23
  } else t1 = $[1];
24
24
  const units = t1;
25
- const hourStep = config?.hourStep ?? 1;
26
- const minuteStep = config?.minuteStep ?? 1;
27
- const secondStep = config?.secondStep ?? 1;
25
+ const normalizeStep = _temp;
26
+ const hourStep = normalizeStep(config?.hourStep);
27
+ const minuteStep = normalizeStep(config?.minuteStep);
28
+ const secondStep = normalizeStep(config?.secondStep);
28
29
  let t2;
29
30
  if ($[2] !== hourStep) {
30
31
  t2 = Array.from({
@@ -132,6 +133,9 @@ function TimePanel(t0) {
132
133
  } else t8 = $[41];
133
134
  return t8;
134
135
  }
136
+ function _temp(step) {
137
+ return step && Number.isFinite(step) && step > 0 ? Math.max(1, Math.trunc(step)) : 1;
138
+ }
135
139
  function centerSelected(list, behavior) {
136
140
  const selected = list.querySelector('[data-tao-selected]');
137
141
  if (!selected) return;
@@ -15,8 +15,8 @@ import { MonthGrid } from "./calendar/month-grid.js";
15
15
  import { TimePanel, getTimeUnits } from "./calendar/time-panel.js";
16
16
  import { YearGrid } from "./calendar/year-grid.js";
17
17
  import "./date-picker.css";
18
- import { Presets } from "./presets.js";
19
18
  import { formatPickerDate, parsePickerDate } from "./date-localization.js";
19
+ import { Presets } from "./presets.js";
20
20
  import { getDefaultFormat } from "./types.js";
21
21
  import * as __rspack_external__radix_ui_react_popover_c8444160 from "@radix-ui/react-popover";
22
22
  const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
@@ -449,6 +449,7 @@ const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
449
449
  "data-tao-size": resolvedSize,
450
450
  "data-tao-variant": resolvedVariant,
451
451
  "data-tao-error": 'error' === status || void 0,
452
+ "data-tao-warning": 'warning' === status || void 0,
452
453
  disabled: resolvedDisabled,
453
454
  onClick: ()=>setOpen(true),
454
455
  className: cx(classNames?.root, className),
@@ -482,6 +483,7 @@ const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
482
483
  "data-tao-size": resolvedSize,
483
484
  "data-tao-variant": resolvedVariant,
484
485
  "data-tao-error": 'error' === status || void 0,
486
+ "data-tao-warning": 'warning' === status || void 0,
485
487
  "data-disabled": resolvedDisabled || void 0,
486
488
  className: cx(classNames?.root, className),
487
489
  style: {
@@ -7,15 +7,15 @@ import { useIsMobile } from "../../utils/breakpoint.js";
7
7
  import { useMobileTitle } from "../../utils/field-label.js";
8
8
  import { mergeRefs } from "../../utils/refs.js";
9
9
  import { cx } from "../../utils/semantic.js";
10
- import { Drawer } from "../drawer/drawer.js";
11
10
  import { Button } from "../button/button.js";
11
+ import { Drawer } from "../drawer/drawer.js";
12
12
  import { CalendarGrid } from "./calendar/calendar-grid.js";
13
13
  import { MonthGrid } from "./calendar/month-grid.js";
14
- import { YearGrid } from "./calendar/year-grid.js";
15
14
  import { TimePanel } from "./calendar/time-panel.js";
15
+ import { YearGrid } from "./calendar/year-grid.js";
16
16
  import "./date-picker.css";
17
- import { Presets } from "./presets.js";
18
17
  import { formatPickerDate, parsePickerDate } from "./date-localization.js";
18
+ import { Presets } from "./presets.js";
19
19
  import { getDefaultFormat } from "./types.js";
20
20
  import * as __rspack_external__radix_ui_react_popover_c8444160 from "@radix-ui/react-popover";
21
21
  const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
@@ -664,6 +664,7 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
664
664
  "data-tao-size": resolvedSize,
665
665
  "data-tao-variant": resolvedVariant,
666
666
  "data-tao-error": 'error' === status || void 0,
667
+ "data-tao-warning": 'warning' === status || void 0,
667
668
  disabled: resolvedDisabled,
668
669
  onClick: ()=>setOpen(true),
669
670
  className: cx(classNames?.root, className),
@@ -713,6 +714,7 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
713
714
  "data-tao-size": resolvedSize,
714
715
  "data-tao-variant": resolvedVariant,
715
716
  "data-tao-error": 'error' === status || void 0,
717
+ "data-tao-warning": 'warning' === status || void 0,
716
718
  "data-disabled": resolvedDisabled || void 0,
717
719
  className: cx(classNames?.root, className),
718
720
  style: {
@@ -20,6 +20,7 @@ export interface DropdownProps {
20
20
  open?: boolean;
21
21
  defaultOpen?: boolean;
22
22
  onOpenChange?: (open: boolean) => void;
23
+ size?: TaoSize;
23
24
  disabled?: boolean;
24
25
  /** Show a pointing arrow on the menu. Defaults to `false`. */
25
26
  arrow?: boolean;
@@ -69,8 +69,9 @@ function Dropdown(props) {
69
69
  const [direction, directionRef] = useTaoDirection(props.direction, 'self');
70
70
  const { menu, children, trigger = [
71
71
  'click'
72
- ], placement, open, defaultOpen, onOpenChange, disabled, arrow = false, className, style, classNames, styles } = props;
73
- const { size, disabled: ctxDisabled } = useTaoConfig();
72
+ ], placement, open, defaultOpen, onOpenChange, size: sizeProp, disabled, arrow = false, className, style, classNames, styles } = props;
73
+ const { size: ctxSize, disabled: ctxDisabled } = useTaoConfig();
74
+ const size = sizeProp ?? ctxSize;
74
75
  const resolvedDisabled = disabled ?? ctxDisabled;
75
76
  const isContext = trigger.includes('contextMenu');
76
77
  const hoverMode = !isContext && trigger.includes('hover');
@@ -124,6 +125,8 @@ function Dropdown(props) {
124
125
  realOpen
125
126
  ]);
126
127
  const { content, selectedKeys, commitSelection } = useMenuController(menu, DD, {
128
+ size,
129
+ direction,
127
130
  classNames,
128
131
  styles
129
132
  });
@@ -137,6 +140,7 @@ function Dropdown(props) {
137
140
  },
138
141
  open: realOpen && !resolvedDisabled,
139
142
  onOpenChange: setOpen,
143
+ size: sizeProp,
140
144
  disabled: disabled,
141
145
  className: className,
142
146
  style: style,
@@ -203,7 +207,7 @@ function Dropdown(props) {
203
207
  });
204
208
  }
205
209
  function DropdownButton(t0) {
206
- const $ = c(31);
210
+ const $ = c(32);
207
211
  let children;
208
212
  let disabled;
209
213
  let dropdownRest;
@@ -277,9 +281,10 @@ function DropdownButton(t0) {
277
281
  $[22] = t4;
278
282
  } else t4 = $[22];
279
283
  let t5;
280
- if ($[23] !== disabled || $[24] !== dropdownRest || $[25] !== menu || $[26] !== t4) {
284
+ if ($[23] !== disabled || $[24] !== dropdownRest || $[25] !== menu || $[26] !== resolvedSize || $[27] !== t4) {
281
285
  t5 = /*#__PURE__*/ jsx(Dropdown, {
282
286
  menu: menu,
287
+ size: resolvedSize,
283
288
  disabled: disabled,
284
289
  ...dropdownRest,
285
290
  children: t4
@@ -287,11 +292,12 @@ function DropdownButton(t0) {
287
292
  $[23] = disabled;
288
293
  $[24] = dropdownRest;
289
294
  $[25] = menu;
290
- $[26] = t4;
291
- $[27] = t5;
292
- } else t5 = $[27];
295
+ $[26] = resolvedSize;
296
+ $[27] = t4;
297
+ $[28] = t5;
298
+ } else t5 = $[28];
293
299
  let t6;
294
- if ($[28] !== t2 || $[29] !== t5) {
300
+ if ($[29] !== t2 || $[30] !== t5) {
295
301
  t6 = /*#__PURE__*/ jsxs("span", {
296
302
  "data-tao-dropdown-button-group": "",
297
303
  children: [
@@ -299,10 +305,10 @@ function DropdownButton(t0) {
299
305
  t5
300
306
  ]
301
307
  });
302
- $[28] = t2;
303
- $[29] = t5;
304
- $[30] = t6;
305
- } else t6 = $[30];
308
+ $[29] = t2;
309
+ $[30] = t5;
310
+ $[31] = t6;
311
+ } else t6 = $[31];
306
312
  return t6;
307
313
  }
308
314
  Dropdown.Button = DropdownButton;
@@ -124,7 +124,8 @@ const FloatButtonGroup = /*#__PURE__*/ forwardRef((props, ref)=>{
124
124
  kind: "close"
125
125
  }), trigger, children, onOpenChange, open, onClick, disabled = config.disabled, ...buttonProps } = props;
126
126
  const [internal, setInternal] = useState(false);
127
- const expanded = open ?? internal;
127
+ if (disabled && internal) setInternal(false);
128
+ const expanded = !disabled && (open ?? internal);
128
129
  const root = useRef(null);
129
130
  const triggerRef = useRef(null);
130
131
  const pointerInside = useRef(false);
@@ -84,7 +84,8 @@ function use_form_useForm(form) {
84
84
  function _temp(field_0) {
85
85
  return {
86
86
  name: field_0.name,
87
- errors: []
87
+ errors: [],
88
+ warnings: []
88
89
  };
89
90
  }
90
91
  export { fieldKey, getFieldRegistry, use_form_useForm as useForm };
@@ -1,4 +1,4 @@
1
- import { type AriaAttributes, type ReactNode, type Ref } from 'react';
1
+ import { type AriaAttributes, type CSSProperties, type ReactNode, type Ref } from 'react';
2
2
  import { type UseNumberInputOptions } from '../../number-input/use-number-input.js';
3
3
  import type { TaoSize, TaoStatus, TaoVariant } from '../../provider/tao-provider.js';
4
4
  import type { SemanticClassNames, SemanticStyles } from '../../utils/semantic.js';
@@ -17,6 +17,7 @@ export interface InputNumberProps extends UseNumberInputOptions, Pick<AriaAttrib
17
17
  id?: string;
18
18
  name?: string;
19
19
  className?: string;
20
+ style?: CSSProperties;
20
21
  classNames?: SemanticClassNames<InputNumberSemanticPart>;
21
22
  styles?: SemanticStyles<InputNumberSemanticPart>;
22
23
  }
@@ -5,7 +5,7 @@ import { useNumberInput } from "../../number-input/use-number-input.js";
5
5
  import { mergeRefs } from "../../utils/refs.js";
6
6
  import { BaseInput } from "../input/base-input.js";
7
7
  const input_number_InputNumber = /*#__PURE__*/ forwardRef(function(t0, forwardedRef) {
8
- const $ = c(49);
8
+ const $ = c(54);
9
9
  let ariaDescribedBy;
10
10
  let ariaErrorMessage;
11
11
  let ariaInvalid;
@@ -23,11 +23,12 @@ const input_number_InputNumber = /*#__PURE__*/ forwardRef(function(t0, forwarded
23
23
  let prefix;
24
24
  let size;
25
25
  let status;
26
+ let style;
26
27
  let styles;
27
28
  let suffix;
28
29
  let variant;
29
30
  if ($[0] !== t0) {
30
- ({ prefix, suffix, size, variant, error, status, disabled, placeholder, id, name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-errormessage": ariaErrorMessage, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, className, classNames, styles, ...hookOptions } = t0);
31
+ ({ prefix, suffix, size, variant, error, status, disabled, placeholder, id, name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-errormessage": ariaErrorMessage, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, className, style, classNames, styles, ...hookOptions } = t0);
31
32
  $[0] = t0;
32
33
  $[1] = ariaDescribedBy;
33
34
  $[2] = ariaErrorMessage;
@@ -46,9 +47,10 @@ const input_number_InputNumber = /*#__PURE__*/ forwardRef(function(t0, forwarded
46
47
  $[15] = prefix;
47
48
  $[16] = size;
48
49
  $[17] = status;
49
- $[18] = styles;
50
- $[19] = suffix;
51
- $[20] = variant;
50
+ $[18] = style;
51
+ $[19] = styles;
52
+ $[20] = suffix;
53
+ $[21] = variant;
52
54
  } else {
53
55
  ariaDescribedBy = $[1];
54
56
  ariaErrorMessage = $[2];
@@ -67,34 +69,45 @@ const input_number_InputNumber = /*#__PURE__*/ forwardRef(function(t0, forwarded
67
69
  prefix = $[15];
68
70
  size = $[16];
69
71
  status = $[17];
70
- styles = $[18];
71
- suffix = $[19];
72
- variant = $[20];
72
+ style = $[18];
73
+ styles = $[19];
74
+ suffix = $[20];
75
+ variant = $[21];
73
76
  }
74
- const { inputProps } = useNumberInput(hookOptions);
77
+ let t1;
78
+ if ($[22] !== disabled || $[23] !== hookOptions) {
79
+ t1 = {
80
+ ...hookOptions,
81
+ disabled
82
+ };
83
+ $[22] = disabled;
84
+ $[23] = hookOptions;
85
+ $[24] = t1;
86
+ } else t1 = $[24];
87
+ const { inputProps } = useNumberInput(t1);
75
88
  let inputRest;
76
89
  let ref;
77
- if ($[21] !== inputProps) {
90
+ if ($[25] !== inputProps) {
78
91
  ({ ref, ...inputRest } = inputProps);
79
- $[21] = inputProps;
80
- $[22] = inputRest;
81
- $[23] = ref;
92
+ $[25] = inputProps;
93
+ $[26] = inputRest;
94
+ $[27] = ref;
82
95
  } else {
83
- inputRest = $[22];
84
- ref = $[23];
96
+ inputRest = $[26];
97
+ ref = $[27];
85
98
  }
86
- let t1;
87
- if ($[24] !== forwardedRef || $[25] !== ref) {
88
- t1 = mergeRefs(ref, forwardedRef);
89
- $[24] = forwardedRef;
90
- $[25] = ref;
91
- $[26] = t1;
92
- } else t1 = $[26];
93
- const t2 = "error" === status || error ? true : ariaInvalid;
94
- let t3;
95
- if ($[27] !== ariaDescribedBy || $[28] !== ariaErrorMessage || $[29] !== ariaLabel || $[30] !== ariaLabelledBy || $[31] !== ariaRequired || $[32] !== className || $[33] !== classNames || $[34] !== disabled || $[35] !== error || $[36] !== id || $[37] !== inputRest || $[38] !== name || $[39] !== placeholder || $[40] !== prefix || $[41] !== size || $[42] !== status || $[43] !== styles || $[44] !== suffix || $[45] !== t1 || $[46] !== t2 || $[47] !== variant) {
96
- t3 = /*#__PURE__*/ jsx(BaseInput, {
97
- ref: t1,
99
+ let t2;
100
+ if ($[28] !== forwardedRef || $[29] !== ref) {
101
+ t2 = mergeRefs(ref, forwardedRef);
102
+ $[28] = forwardedRef;
103
+ $[29] = ref;
104
+ $[30] = t2;
105
+ } else t2 = $[30];
106
+ const t3 = "error" === status || error ? true : ariaInvalid;
107
+ let t4;
108
+ if ($[31] !== ariaDescribedBy || $[32] !== ariaErrorMessage || $[33] !== ariaLabel || $[34] !== ariaLabelledBy || $[35] !== ariaRequired || $[36] !== className || $[37] !== classNames || $[38] !== disabled || $[39] !== error || $[40] !== id || $[41] !== inputRest || $[42] !== name || $[43] !== placeholder || $[44] !== prefix || $[45] !== size || $[46] !== status || $[47] !== style || $[48] !== styles || $[49] !== suffix || $[50] !== t2 || $[51] !== t3 || $[52] !== variant) {
109
+ t4 = /*#__PURE__*/ jsx(BaseInput, {
110
+ ref: t2,
98
111
  prefix: prefix,
99
112
  suffix: suffix,
100
113
  size: size,
@@ -109,36 +122,38 @@ const input_number_InputNumber = /*#__PURE__*/ forwardRef(function(t0, forwarded
109
122
  "aria-labelledby": ariaLabelledBy,
110
123
  "aria-describedby": ariaDescribedBy,
111
124
  "aria-errormessage": ariaErrorMessage,
112
- "aria-invalid": t2,
125
+ "aria-invalid": t3,
113
126
  "aria-required": ariaRequired,
114
127
  className: className,
128
+ style: style,
115
129
  classNames: classNames,
116
130
  styles: styles,
117
131
  ...inputRest
118
132
  });
119
- $[27] = ariaDescribedBy;
120
- $[28] = ariaErrorMessage;
121
- $[29] = ariaLabel;
122
- $[30] = ariaLabelledBy;
123
- $[31] = ariaRequired;
124
- $[32] = className;
125
- $[33] = classNames;
126
- $[34] = disabled;
127
- $[35] = error;
128
- $[36] = id;
129
- $[37] = inputRest;
130
- $[38] = name;
131
- $[39] = placeholder;
132
- $[40] = prefix;
133
- $[41] = size;
134
- $[42] = status;
135
- $[43] = styles;
136
- $[44] = suffix;
137
- $[45] = t1;
138
- $[46] = t2;
139
- $[47] = variant;
140
- $[48] = t3;
141
- } else t3 = $[48];
142
- return t3;
133
+ $[31] = ariaDescribedBy;
134
+ $[32] = ariaErrorMessage;
135
+ $[33] = ariaLabel;
136
+ $[34] = ariaLabelledBy;
137
+ $[35] = ariaRequired;
138
+ $[36] = className;
139
+ $[37] = classNames;
140
+ $[38] = disabled;
141
+ $[39] = error;
142
+ $[40] = id;
143
+ $[41] = inputRest;
144
+ $[42] = name;
145
+ $[43] = placeholder;
146
+ $[44] = prefix;
147
+ $[45] = size;
148
+ $[46] = status;
149
+ $[47] = style;
150
+ $[48] = styles;
151
+ $[49] = suffix;
152
+ $[50] = t2;
153
+ $[51] = t3;
154
+ $[52] = variant;
155
+ $[53] = t4;
156
+ } else t4 = $[53];
157
+ return t4;
143
158
  });
144
159
  export { input_number_InputNumber as InputNumber };
@@ -9,9 +9,10 @@ import "./mentions.css";
9
9
  import { interopDefault } from "../../utils/interop-default.js";
10
10
  const RcMentionsComponent = /*#__PURE__*/ interopDefault(mentions);
11
11
  function getMentions(value = '', { prefix = '@', split = ' ' } = {}) {
12
- const prefixes = Array.isArray(prefix) ? prefix : [
12
+ const prefixes = (Array.isArray(prefix) ? prefix : [
13
13
  prefix
14
- ];
14
+ ]).filter(Boolean).sort((a, b)=>b.length - a.length);
15
+ if (!prefixes.length) return [];
15
16
  const tokens = ' ' === split ? value.split(/\s+/u) : value.split(split);
16
17
  return tokens.flatMap((text)=>{
17
18
  const match = prefixes.find((candidate)=>text.startsWith(candidate));
@@ -1,4 +1,5 @@
1
1
  import { type ComponentType, type ReactNode } from 'react';
2
+ import { type TaoDirection, type TaoSize } from '../../provider/tao-provider.js';
2
3
  import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic.js';
3
4
  import './menu.css';
4
5
  export type MenuSemanticPart = 'root' | 'content' | 'item' | 'itemIcon' | 'itemLabel' | 'itemExtra' | 'divider' | 'groupLabel' | 'subTrigger' | 'subContent';
@@ -67,6 +68,8 @@ export interface MenuPrimitives {
67
68
  }
68
69
  export interface RenderCtx {
69
70
  P: MenuPrimitives;
71
+ size?: TaoSize;
72
+ direction?: TaoDirection;
70
73
  classNames?: SemanticClassNames<MenuSemanticPart>;
71
74
  styles?: SemanticStyles<MenuSemanticPart>;
72
75
  /** Fire item.onClick + menu.onClick for a plain action item. */
@@ -76,6 +79,7 @@ export interface RenderCtx {
76
79
  multiple: boolean;
77
80
  selectable: boolean;
78
81
  onToggle: (key: string) => void;
82
+ onRadioChange: (key: string) => void;
79
83
  }
80
84
  export declare function renderMenuItems(items: MenuItem[], ctx: RenderCtx): ReactNode;
81
85
  /**
@@ -85,6 +89,8 @@ export declare function renderMenuItems(items: MenuItem[], ctx: RenderCtx): Reac
85
89
  * and ContextMenu.
86
90
  */
87
91
  export declare function useMenuController(menu: MenuProps, P: MenuPrimitives, semantic: {
92
+ size?: TaoSize;
93
+ direction?: TaoDirection;
88
94
  classNames?: SemanticClassNames<MenuSemanticPart>;
89
95
  styles?: SemanticStyles<MenuSemanticPart>;
90
96
  }): {