@rockshin/tao-ui 0.0.43 → 0.0.45

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 (77) hide show
  1. package/README.md +7 -1
  2. package/component-manifest.json +10 -3
  3. package/dist/components/auto-complete/auto-complete.js +12 -3
  4. package/dist/components/breadcrumb/breadcrumb.css +4 -0
  5. package/dist/components/breadcrumb/breadcrumb.js +1 -0
  6. package/dist/components/calendar/calendar.d.ts +1 -0
  7. package/dist/components/calendar/calendar.js +10 -3
  8. package/dist/components/card/card-tabs.js +204 -182
  9. package/dist/components/card/card.js +1 -1
  10. package/dist/components/carousel/carousel.js +11 -5
  11. package/dist/components/cascader/cascader.js +16 -4
  12. package/dist/components/collapse/collapse.css +8 -0
  13. package/dist/components/context-menu/context-menu.d.ts +2 -1
  14. package/dist/components/context-menu/context-menu.js +57 -44
  15. package/dist/components/date-picker/calendar/calendar-grid.js +3 -2
  16. package/dist/components/date-picker/date-picker.css +4 -0
  17. package/dist/components/date-picker/date-picker.d.ts +1 -0
  18. package/dist/components/date-picker/date-picker.js +13 -3
  19. package/dist/components/date-picker/range-picker.d.ts +1 -0
  20. package/dist/components/date-picker/range-picker.js +13 -3
  21. package/dist/components/drawer/drawer.d.ts +2 -1
  22. package/dist/components/drawer/drawer.js +32 -20
  23. package/dist/components/dropdown/dropdown.d.ts +1 -0
  24. package/dist/components/dropdown/dropdown.js +139 -123
  25. package/dist/components/form/field-control.d.ts +6 -0
  26. package/dist/components/form/field-control.js +42 -0
  27. package/dist/components/form/form-context.d.ts +3 -0
  28. package/dist/components/form/form-item.d.ts +2 -1
  29. package/dist/components/form/form-item.js +55 -42
  30. package/dist/components/form/form.d.ts +5 -5
  31. package/dist/components/form/form.js +86 -68
  32. package/dist/components/form/index.d.ts +1 -0
  33. package/dist/components/form/use-form.d.ts +16 -0
  34. package/dist/components/form/use-form.js +69 -0
  35. package/dist/components/form-field/form-field-view.d.ts +4 -2
  36. package/dist/components/form-field/form-field-view.js +42 -35
  37. package/dist/components/mentions/mentions.js +6 -2
  38. package/dist/components/modal/modal.d.ts +2 -1
  39. package/dist/components/modal/modal.js +14 -4
  40. package/dist/components/pagination/pagination.css +4 -0
  41. package/dist/components/popover/popover.d.ts +2 -1
  42. package/dist/components/popover/popover.js +185 -176
  43. package/dist/components/rate/rate.js +114 -88
  44. package/dist/components/scroll-area/scroll-area.js +127 -118
  45. package/dist/components/segmented/segmented.js +52 -29
  46. package/dist/components/select/mobile-select.d.ts +2 -1
  47. package/dist/components/select/mobile-select.js +52 -47
  48. package/dist/components/select/select-types.d.ts +1 -0
  49. package/dist/components/select/select.js +19 -6
  50. package/dist/components/slider/slider.js +136 -133
  51. package/dist/components/splitter/splitter.css +4 -0
  52. package/dist/components/splitter/splitter.js +5 -3
  53. package/dist/components/table/table.css +29 -11
  54. package/dist/components/table/table.js +383 -547
  55. package/dist/components/tabs/tabs.js +3 -2
  56. package/dist/components/time-picker/time-picker.js +21 -7
  57. package/dist/components/tooltip/tooltip.d.ts +2 -1
  58. package/dist/components/tooltip/tooltip.js +82 -71
  59. package/dist/components/transfer/transfer-parts.js +12 -2
  60. package/dist/components/transfer/transfer.js +10 -4
  61. package/dist/components/tree/tree-keyboard.d.ts +6 -0
  62. package/dist/components/tree/tree-keyboard.js +27 -0
  63. package/dist/components/tree/tree.js +14 -3
  64. package/dist/components/tree-select/select-engine.d.ts +2 -1
  65. package/dist/components/tree-select/select-engine.js +23 -15
  66. package/dist/components/tree-select/tree-select.js +20 -10
  67. package/dist/docs/components/form.doc.js +3 -1
  68. package/dist/docs/components/tao-provider.doc.js +6 -1
  69. package/dist/entries/form.d.ts +2 -2
  70. package/dist/entries/provider.d.ts +1 -1
  71. package/dist/index.d.ts +3 -3
  72. package/dist/provider/tao-provider.d.ts +10 -3
  73. package/dist/provider/tao-provider.js +198 -88
  74. package/dist/utils/scroll-left.d.ts +3 -0
  75. package/dist/utils/scroll-left.js +7 -0
  76. package/llms.txt +3 -3
  77. package/package.json +4 -2
@@ -197,3 +197,11 @@
197
197
  }
198
198
  }
199
199
 
200
+ [data-tao-collapse-panel-trigger]:dir(rtl) [data-tao-collapse-arrow] {
201
+ transform: scaleX(-1);
202
+ }
203
+
204
+ [data-tao-collapse-panel-trigger][data-state="open"]:dir(rtl) [data-tao-collapse-arrow] {
205
+ transform: rotate(90deg);
206
+ }
207
+
@@ -4,6 +4,7 @@ import { type MenuProps, type MenuSemanticPart } from '../menu/menu-render.js';
4
4
  import './context-menu.css';
5
5
  export type ContextMenuSemanticPart = MenuSemanticPart;
6
6
  export interface ContextMenuProps {
7
+ direction?: 'ltr' | 'rtl';
7
8
  menu: MenuProps;
8
9
  /** Element whose right-click (long-press on touch) opens the menu. */
9
10
  children: ReactNode;
@@ -16,4 +17,4 @@ export interface ContextMenuProps {
16
17
  classNames?: SemanticClassNames<ContextMenuSemanticPart>;
17
18
  styles?: SemanticStyles<ContextMenuSemanticPart>;
18
19
  }
19
- export declare function ContextMenu({ menu, children, open, onOpenChange, disabled, className, style, classNames, styles, }: ContextMenuProps): import("react").JSX.Element;
20
+ export declare function ContextMenu({ direction: directionProp, menu, children, open, onOpenChange, disabled, className, style, classNames, styles, }: ContextMenuProps): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
- import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
3
+ import { TaoPortalScope, useTaoConfig, useTaoDirection } from "../../provider/tao-provider.js";
4
4
  import { cx } from "../../utils/semantic.js";
5
5
  import { useMenuController } from "../menu/menu-render.js";
6
6
  import "./context-menu.css";
@@ -20,8 +20,9 @@ const CM = {
20
20
  ItemIndicator: __rspack_external__radix_ui_react_context_menu_d8b375cc.ItemIndicator
21
21
  };
22
22
  function ContextMenu(t0) {
23
- const $ = c(22);
24
- const { menu, children, open, onOpenChange, disabled, className, style, classNames, styles } = t0;
23
+ const $ = c(27);
24
+ const { direction: directionProp, menu, children, open, onOpenChange, disabled, className, style, classNames, styles } = t0;
25
+ const [direction, directionRef] = useTaoDirection(directionProp, "self");
25
26
  const { size, disabled: ctxDisabled } = useTaoConfig();
26
27
  const resolvedDisabled = disabled ?? ctxDisabled;
27
28
  let t1;
@@ -36,72 +37,84 @@ function ContextMenu(t0) {
36
37
  } else t1 = $[2];
37
38
  const content = useMenuController(menu, CM, t1);
38
39
  let t2;
39
- if ($[3] !== children || $[4] !== resolvedDisabled) {
40
+ if ($[3] !== children || $[4] !== directionRef || $[5] !== resolvedDisabled) {
40
41
  t2 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_context_menu_d8b375cc.Trigger, {
42
+ ref: directionRef,
41
43
  disabled: resolvedDisabled,
42
44
  "data-tao-context-menu-trigger": "",
43
45
  children: children
44
46
  });
45
47
  $[3] = children;
46
- $[4] = resolvedDisabled;
47
- $[5] = t2;
48
- } else t2 = $[5];
48
+ $[4] = directionRef;
49
+ $[5] = resolvedDisabled;
50
+ $[6] = t2;
51
+ } else t2 = $[6];
49
52
  const t3 = classNames?.content;
50
53
  let t4;
51
- if ($[6] !== className || $[7] !== t3) {
54
+ if ($[7] !== className || $[8] !== t3) {
52
55
  t4 = cx(t3, className);
53
- $[6] = className;
54
- $[7] = t3;
55
- $[8] = t4;
56
- } else t4 = $[8];
56
+ $[7] = className;
57
+ $[8] = t3;
58
+ $[9] = t4;
59
+ } else t4 = $[9];
57
60
  const t5 = styles?.content;
58
61
  let t6;
59
- if ($[9] !== style || $[10] !== t5) {
62
+ if ($[10] !== style || $[11] !== t5) {
60
63
  t6 = {
61
64
  ...t5,
62
65
  ...style
63
66
  };
64
- $[9] = style;
65
- $[10] = t5;
66
- $[11] = t6;
67
- } else t6 = $[11];
67
+ $[10] = style;
68
+ $[11] = t5;
69
+ $[12] = t6;
70
+ } else t6 = $[12];
68
71
  let t7;
69
- if ($[12] !== content || $[13] !== size || $[14] !== t4 || $[15] !== t6) {
70
- t7 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_context_menu_d8b375cc.Portal, {
72
+ if ($[13] !== content || $[14] !== size || $[15] !== t4 || $[16] !== t6) {
73
+ t7 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_context_menu_d8b375cc.Content, {
74
+ "data-tao-menu-content": "",
75
+ "data-tao-context-menu": "",
76
+ "data-tao-size": size,
77
+ className: t4,
78
+ style: t6,
79
+ children: content
80
+ });
81
+ $[13] = content;
82
+ $[14] = size;
83
+ $[15] = t4;
84
+ $[16] = t6;
85
+ $[17] = t7;
86
+ } else t7 = $[17];
87
+ let t8;
88
+ if ($[18] !== direction || $[19] !== t7) {
89
+ t8 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_context_menu_d8b375cc.Portal, {
71
90
  children: /*#__PURE__*/ jsx(TaoPortalScope, {
72
91
  asChild: true,
73
- children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_context_menu_d8b375cc.Content, {
74
- "data-tao-menu-content": "",
75
- "data-tao-context-menu": "",
76
- "data-tao-size": size,
77
- className: t4,
78
- style: t6,
79
- children: content
80
- })
92
+ direction: direction,
93
+ children: t7
81
94
  })
82
95
  });
83
- $[12] = content;
84
- $[13] = size;
85
- $[14] = t4;
86
- $[15] = t6;
87
- $[16] = t7;
88
- } else t7 = $[16];
89
- let t8;
90
- if ($[17] !== onOpenChange || $[18] !== open || $[19] !== t2 || $[20] !== t7) {
91
- t8 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_context_menu_d8b375cc.Root, {
96
+ $[18] = direction;
97
+ $[19] = t7;
98
+ $[20] = t8;
99
+ } else t8 = $[20];
100
+ let t9;
101
+ if ($[21] !== direction || $[22] !== onOpenChange || $[23] !== open || $[24] !== t2 || $[25] !== t8) {
102
+ t9 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_context_menu_d8b375cc.Root, {
103
+ dir: direction,
92
104
  open: open,
93
105
  onOpenChange: onOpenChange,
94
106
  children: [
95
107
  t2,
96
- t7
108
+ t8
97
109
  ]
98
110
  });
99
- $[17] = onOpenChange;
100
- $[18] = open;
101
- $[19] = t2;
102
- $[20] = t7;
103
- $[21] = t8;
104
- } else t8 = $[21];
105
- return t8;
111
+ $[21] = direction;
112
+ $[22] = onOpenChange;
113
+ $[23] = open;
114
+ $[24] = t2;
115
+ $[25] = t8;
116
+ $[26] = t9;
117
+ } else t9 = $[26];
118
+ return t9;
106
119
  }
107
120
  export { ContextMenu };
@@ -65,8 +65,9 @@ function CalendarGrid({ viewDate, value, rangeStart, rangeEnd, hoverDate, onSele
65
65
  };
66
66
  const handleKeyDown = (event, date_4)=>{
67
67
  let next_0;
68
- if ('ArrowLeft' === event.key) next_0 = date_4.subtract(1, 'day');
69
- else if ('ArrowRight' === event.key) next_0 = date_4.add(1, 'day');
68
+ const rtl = 'rtl' === getComputedStyle(event.currentTarget).direction;
69
+ if ('ArrowLeft' === event.key) next_0 = date_4.add(rtl ? 1 : -1, 'day');
70
+ else if ('ArrowRight' === event.key) next_0 = date_4.add(rtl ? -1 : 1, 'day');
70
71
  else if ('ArrowUp' === event.key) next_0 = date_4.subtract(7, 'day');
71
72
  else if ('ArrowDown' === event.key) next_0 = date_4.add(7, 'day');
72
73
  else if ('Home' === event.key) next_0 = date_4.subtract((date_4.day() + 6) % 7, 'day');
@@ -722,3 +722,7 @@ input[data-tao-range-input]::placeholder {
722
722
  }
723
723
  }
724
724
 
725
+ [data-tao-calendar-nav-btn]:dir(rtl) > svg {
726
+ transform: scaleX(-1);
727
+ }
728
+
@@ -7,6 +7,7 @@ import { type PickerRef, type PresetItem, type TimeConfig } from './types.js';
7
7
  export type { PickerRef } from './types.js';
8
8
  export type DatePickerSemanticPart = 'root' | 'input' | 'popup' | 'calendar' | 'cell' | 'footer';
9
9
  export interface DatePickerProps extends Pick<AriaAttributes, 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'aria-errormessage' | 'aria-invalid' | 'aria-required'> {
10
+ direction?: 'ltr' | 'rtl';
10
11
  id?: string;
11
12
  value?: Dayjs | null;
12
13
  defaultValue?: Dayjs | null;
@@ -3,11 +3,12 @@ import { c } from "react-compiler-runtime";
3
3
  import dayjs from "dayjs";
4
4
  import customParseFormat from "dayjs/plugin/customParseFormat";
5
5
  import { forwardRef, useCallback, useEffect, useId, useImperativeHandle, useMemo, useRef, useState } from "react";
6
- import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
6
+ import { TaoPortalScope, useTaoConfig, useTaoDirection } from "../../provider/tao-provider.js";
7
7
  import { useIsMobile } from "../../utils/breakpoint.js";
8
8
  import { useMobileTitle } from "../../utils/field-label.js";
9
- import { Button } from "../button/button.js";
9
+ import { mergeRefs } from "../../utils/refs.js";
10
10
  import { cx } from "../../utils/semantic.js";
11
+ import { Button } from "../button/button.js";
11
12
  import { Drawer } from "../drawer/drawer.js";
12
13
  import { CalendarGrid } from "./calendar/calendar-grid.js";
13
14
  import { CalendarHeader } from "./calendar/calendar-header.js";
@@ -31,6 +32,10 @@ const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
31
32
  const autoMobile = useIsMobile();
32
33
  const isMobile = mobile ?? autoMobile;
33
34
  const mobileTriggerRef = useRef(null);
35
+ const [direction, directionRef] = useTaoDirection(props.direction);
36
+ const mergedMobileRef = useMemo(()=>mergeRefs(mobileTriggerRef, directionRef), [
37
+ directionRef
38
+ ]);
34
39
  const inputRef = useRef(null);
35
40
  useImperativeHandle(ref, ()=>({
36
41
  focus: ()=>(isMobile ? mobileTriggerRef.current : inputRef.current)?.focus(),
@@ -373,7 +378,8 @@ const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
373
378
  }
374
379
  };
375
380
  const mobileTrigger = /*#__PURE__*/ jsxs("button", {
376
- ref: mobileTriggerRef,
381
+ ref: mergedMobileRef,
382
+ dir: direction,
377
383
  id: props.id,
378
384
  ...controlAria,
379
385
  type: "button",
@@ -407,6 +413,8 @@ const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
407
413
  ]
408
414
  });
409
415
  const desktopTrigger = /*#__PURE__*/ jsxs("div", {
416
+ ref: directionRef,
417
+ dir: direction,
410
418
  "data-tao-control": "",
411
419
  "data-tao-picker-trigger": "",
412
420
  onClick: ()=>!resolvedDisabled && setOpen(!isOpen),
@@ -464,6 +472,7 @@ const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
464
472
  children: [
465
473
  mobileTrigger,
466
474
  /*#__PURE__*/ jsx(Drawer, {
475
+ direction: direction,
467
476
  open: isOpen,
468
477
  onClose: ()=>setOpen(false),
469
478
  placement: "bottom",
@@ -484,6 +493,7 @@ const date_picker_DatePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
484
493
  /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Portal, {
485
494
  children: /*#__PURE__*/ jsx(TaoPortalScope, {
486
495
  asChild: true,
496
+ direction: direction,
487
497
  children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Content, {
488
498
  id: popupId,
489
499
  ref: popupRef,
@@ -7,6 +7,7 @@ import { type PickerRef, type RangePresetItem } from './types.js';
7
7
  type RangeValue = [Dayjs | null, Dayjs | null] | null;
8
8
  export type RangePickerSemanticPart = 'root' | 'input' | 'separator' | 'popup' | 'calendar' | 'cell';
9
9
  export interface RangePickerProps extends Pick<AriaAttributes, 'aria-label' | 'aria-labelledby' | 'aria-describedby' | 'aria-errormessage' | 'aria-invalid' | 'aria-required'> {
10
+ direction?: 'ltr' | 'rtl';
10
11
  id?: string;
11
12
  value?: RangeValue;
12
13
  defaultValue?: [Dayjs | null, Dayjs | null];
@@ -2,10 +2,11 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
3
  import dayjs from "dayjs";
4
4
  import customParseFormat from "dayjs/plugin/customParseFormat";
5
- import { forwardRef, useCallback, useEffect, useId, useImperativeHandle, useRef, useState } from "react";
6
- import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
5
+ import { forwardRef, useCallback, useEffect, useId, useImperativeHandle, useMemo, useRef, useState } from "react";
6
+ import { TaoPortalScope, useTaoConfig, useTaoDirection } from "../../provider/tao-provider.js";
7
7
  import { useIsMobile } from "../../utils/breakpoint.js";
8
8
  import { useMobileTitle } from "../../utils/field-label.js";
9
+ import { mergeRefs } from "../../utils/refs.js";
9
10
  import { cx } from "../../utils/semantic.js";
10
11
  import { Drawer } from "../drawer/drawer.js";
11
12
  import { CalendarGrid } from "./calendar/calendar-grid.js";
@@ -34,6 +35,10 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
34
35
  const autoMobile = useIsMobile();
35
36
  const isMobile = mobile ?? autoMobile;
36
37
  const mobileTriggerRef = useRef(null);
38
+ const [direction, directionRef] = useTaoDirection(props.direction);
39
+ const mergedMobileRef = useMemo(()=>mergeRefs(mobileTriggerRef, directionRef), [
40
+ directionRef
41
+ ]);
37
42
  const startInputRef = useRef(null);
38
43
  const endInputRef = useRef(null);
39
44
  useImperativeHandle(ref, ()=>({
@@ -448,7 +453,8 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
448
453
  if (!isOpen) setOpen(true);
449
454
  };
450
455
  const mobileTrigger = /*#__PURE__*/ jsxs("button", {
451
- ref: mobileTriggerRef,
456
+ ref: mergedMobileRef,
457
+ dir: direction,
452
458
  id: props.id,
453
459
  ...controlAria,
454
460
  type: "button",
@@ -495,6 +501,8 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
495
501
  ]
496
502
  });
497
503
  const desktopTrigger = /*#__PURE__*/ jsxs("div", {
504
+ ref: directionRef,
505
+ dir: direction,
498
506
  "data-tao-control": "",
499
507
  "data-tao-range-trigger": "",
500
508
  onClick: ()=>!resolvedDisabled && setOpen(!isOpen),
@@ -619,6 +627,7 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
619
627
  children: [
620
628
  mobileTrigger,
621
629
  /*#__PURE__*/ jsx(Drawer, {
630
+ direction: direction,
622
631
  open: isOpen,
623
632
  onClose: ()=>setOpen(false),
624
633
  placement: "bottom",
@@ -639,6 +648,7 @@ const range_picker_RangePicker = /*#__PURE__*/ forwardRef(function(props, ref) {
639
648
  /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Portal, {
640
649
  children: /*#__PURE__*/ jsx(TaoPortalScope, {
641
650
  asChild: true,
651
+ direction: direction,
642
652
  children: /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_popover_c8444160.Content, {
643
653
  id: popupId,
644
654
  ref: popupRef,
@@ -10,6 +10,7 @@ export interface DrawerResizableConfig {
10
10
  onResizeEnd?: () => void;
11
11
  }
12
12
  export interface DrawerProps extends Pick<AriaAttributes, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> {
13
+ direction?: 'ltr' | 'rtl';
13
14
  open: boolean;
14
15
  onClose?: () => void;
15
16
  title?: ReactNode;
@@ -47,4 +48,4 @@ export interface DrawerProps extends Pick<AriaAttributes, 'aria-label' | 'aria-l
47
48
  classNames?: SemanticClassNames<DrawerSemanticPart>;
48
49
  styles?: SemanticStyles<DrawerSemanticPart>;
49
50
  }
50
- export declare function Drawer({ open, onClose, title, extra, footer, placement, size, width, height, closable, closeIcon, maskClosable, mask, keyboard, resizable, afterOpenChange, afterClose, destroyOnHidden, children, classNames, styles: stylesProp, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, }: DrawerProps): import("react").JSX.Element;
51
+ export declare function Drawer({ direction, open, onClose, title, extra, footer, placement, size, width, height, closable, closeIcon, maskClosable, mask, keyboard, resizable, afterOpenChange, afterClose, destroyOnHidden, children, classNames, styles: stylesProp, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, }: DrawerProps): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
3
  import { useEffect, useRef, useState } from "react";
4
- import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
4
+ import { TaoPortalScope, TaoProvider, useTaoConfig } from "../../provider/tao-provider.js";
5
5
  import { DialogContent } from "../../utils/dialog-content.js";
6
6
  import { preventParentOutsideDismiss } from "../../utils/portal.js";
7
7
  import { cx } from "../../utils/semantic.js";
@@ -14,8 +14,8 @@ const SIZE_PRESET = {
14
14
  };
15
15
  const MIN_DRAG_SIZE = 200;
16
16
  function Drawer(t0) {
17
- const $ = c(101);
18
- const { open, onClose, title, extra, footer, placement: t1, size, width, height, closable: t2, closeIcon, maskClosable: t3, mask: t4, keyboard: t5, resizable, afterOpenChange, afterClose, destroyOnHidden: t6, children, classNames, styles: stylesProp, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy } = t0;
17
+ const $ = c(105);
18
+ const { direction, open, onClose, title, extra, footer, placement: t1, size, width, height, closable: t2, closeIcon, maskClosable: t3, mask: t4, keyboard: t5, resizable, afterOpenChange, afterClose, destroyOnHidden: t6, children, classNames, styles: stylesProp, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy } = t0;
19
19
  const placement = void 0 === t1 ? "right" : t1;
20
20
  const closable = void 0 === t2 ? true : t2;
21
21
  const maskClosable = void 0 === t3 ? true : t3;
@@ -349,40 +349,52 @@ function Drawer(t0) {
349
349
  $[90] = t27;
350
350
  } else t27 = $[90];
351
351
  let t28;
352
- if ($[91] !== t15 || $[92] !== t27) {
352
+ if ($[91] !== direction || $[92] !== t15 || $[93] !== t27) {
353
353
  t28 = /*#__PURE__*/ jsxs(TaoPortalScope, {
354
+ direction: direction,
354
355
  children: [
355
356
  t15,
356
357
  t27
357
358
  ]
358
359
  });
359
- $[91] = t15;
360
- $[92] = t27;
361
- $[93] = t28;
362
- } else t28 = $[93];
360
+ $[91] = direction;
361
+ $[92] = t15;
362
+ $[93] = t27;
363
+ $[94] = t28;
364
+ } else t28 = $[94];
363
365
  let t29;
364
- if ($[94] !== forceMount || $[95] !== t28) {
366
+ if ($[95] !== forceMount || $[96] !== t28) {
365
367
  t29 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Portal, {
366
368
  forceMount: forceMount,
367
369
  children: t28
368
370
  });
369
- $[94] = forceMount;
370
- $[95] = t28;
371
- $[96] = t29;
372
- } else t29 = $[96];
371
+ $[95] = forceMount;
372
+ $[96] = t28;
373
+ $[97] = t29;
374
+ } else t29 = $[97];
373
375
  let t30;
374
- if ($[97] !== open || $[98] !== t14 || $[99] !== t29) {
376
+ if ($[98] !== open || $[99] !== t14 || $[100] !== t29) {
375
377
  t30 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dialog_dabd8325.Root, {
376
378
  open: open,
377
379
  onOpenChange: t14,
378
380
  children: t29
379
381
  });
380
- $[97] = open;
381
- $[98] = t14;
382
- $[99] = t29;
383
- $[100] = t30;
384
- } else t30 = $[100];
385
- return t30;
382
+ $[98] = open;
383
+ $[99] = t14;
384
+ $[100] = t29;
385
+ $[101] = t30;
386
+ } else t30 = $[101];
387
+ let t31;
388
+ if ($[102] !== direction || $[103] !== t30) {
389
+ t31 = /*#__PURE__*/ jsx(TaoProvider, {
390
+ direction: direction,
391
+ children: t30
392
+ });
393
+ $[102] = direction;
394
+ $[103] = t30;
395
+ $[104] = t31;
396
+ } else t31 = $[104];
397
+ return t31;
386
398
  }
387
399
  function CloseIcon() {
388
400
  const $ = c(1);
@@ -9,6 +9,7 @@ export type { MenuDividerType, MenuGroupType, MenuItem, MenuItemType, MenuProps,
9
9
  export type DropdownPlacement = 'bottom' | 'bottomLeft' | 'bottomRight' | 'top' | 'topLeft' | 'topRight';
10
10
  export type DropdownTrigger = 'click' | 'hover' | 'contextMenu';
11
11
  export interface DropdownProps {
12
+ direction?: 'ltr' | 'rtl';
12
13
  menu: MenuProps;
13
14
  /** Trigger element (a single React element). */
14
15
  children: ReactNode;