@rockshin/tao-ui 0.0.44 → 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 (63) hide show
  1. package/README.md +6 -0
  2. package/component-manifest.json +7 -2
  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/mentions/mentions.js +6 -2
  26. package/dist/components/modal/modal.d.ts +2 -1
  27. package/dist/components/modal/modal.js +14 -4
  28. package/dist/components/pagination/pagination.css +4 -0
  29. package/dist/components/popover/popover.d.ts +2 -1
  30. package/dist/components/popover/popover.js +185 -176
  31. package/dist/components/rate/rate.js +114 -88
  32. package/dist/components/scroll-area/scroll-area.js +127 -118
  33. package/dist/components/segmented/segmented.js +52 -29
  34. package/dist/components/select/mobile-select.d.ts +2 -1
  35. package/dist/components/select/mobile-select.js +52 -47
  36. package/dist/components/select/select-types.d.ts +1 -0
  37. package/dist/components/select/select.js +19 -6
  38. package/dist/components/slider/slider.js +136 -133
  39. package/dist/components/splitter/splitter.css +4 -0
  40. package/dist/components/splitter/splitter.js +5 -3
  41. package/dist/components/table/table.css +29 -11
  42. package/dist/components/table/table.js +383 -547
  43. package/dist/components/tabs/tabs.js +3 -2
  44. package/dist/components/time-picker/time-picker.js +21 -7
  45. package/dist/components/tooltip/tooltip.d.ts +2 -1
  46. package/dist/components/tooltip/tooltip.js +82 -71
  47. package/dist/components/transfer/transfer-parts.js +12 -2
  48. package/dist/components/transfer/transfer.js +10 -4
  49. package/dist/components/tree/tree-keyboard.d.ts +6 -0
  50. package/dist/components/tree/tree-keyboard.js +27 -0
  51. package/dist/components/tree/tree.js +14 -3
  52. package/dist/components/tree-select/select-engine.d.ts +2 -1
  53. package/dist/components/tree-select/select-engine.js +23 -15
  54. package/dist/components/tree-select/tree-select.js +20 -10
  55. package/dist/docs/components/tao-provider.doc.js +6 -1
  56. package/dist/entries/provider.d.ts +1 -1
  57. package/dist/index.d.ts +1 -1
  58. package/dist/provider/tao-provider.d.ts +10 -3
  59. package/dist/provider/tao-provider.js +198 -88
  60. package/dist/utils/scroll-left.d.ts +3 -0
  61. package/dist/utils/scroll-left.js +7 -0
  62. package/llms.txt +2 -2
  63. package/package.json +1 -1
@@ -24,7 +24,7 @@ const taoProviderDoc = {
24
24
  'tokenVar'
25
25
  ],
26
26
  usage: {
27
- description: 'Wrap an app or subtree with TaoProvider to set size, disabled, variant, and theme defaults.',
27
+ description: 'Wrap an app or subtree with TaoProvider to set size, disabled, variant, direction, and theme defaults.',
28
28
  bestPractices: [
29
29
  'Prefer provider-level defaults for app-wide decisions.',
30
30
  'Use nested providers for scoped theme overrides.'
@@ -34,6 +34,11 @@ const taoProviderDoc = {
34
34
  ]
35
35
  },
36
36
  props: [
37
+ {
38
+ name: 'direction',
39
+ type: "'ltr' | 'rtl'",
40
+ description: 'Text and interaction direction. Inherits the surrounding DOM when omitted; nested providers and component props can override it. Portals retain their source direction.'
41
+ },
37
42
  {
38
43
  name: 'size',
39
44
  type: 'TaoSize',
@@ -1,3 +1,3 @@
1
1
  import '../theme/theme.css';
2
2
  import '../theme/control.css';
3
- export { type ButtonComponentToken, enUS, type FormFieldComponentToken, type InputComponentToken, type TaoComponentTokenMap, type TaoConfig, type TaoLocale, TaoProvider, type TaoProviderProps, type TaoSeedToken, type TaoSize, type TaoStatus, type TaoThemeConfig, type TaoThemeMode, type TaoVariant, useTaoConfig, useTaoToken, zhCN, } from '../provider/tao-provider.js';
3
+ export { type ButtonComponentToken, enUS, type FormFieldComponentToken, type InputComponentToken, type TaoComponentTokenMap, type TaoConfig, type TaoDirection, type TaoLocale, TaoProvider, type TaoProviderProps, type TaoSeedToken, type TaoSize, type TaoStatus, type TaoThemeConfig, type TaoThemeMode, type TaoVariant, useTaoConfig, useTaoToken, zhCN, } from '../provider/tao-provider.js';
package/dist/index.d.ts CHANGED
@@ -80,7 +80,7 @@ export { Watermark, type WatermarkContent, type WatermarkFont, type WatermarkPro
80
80
  export { FormLayout, type FormLayoutProps, type FormLayoutSemanticPart, } from './layouts/form-layout/form-layout.js';
81
81
  export { Stack, type StackProps, type StackSemanticPart, } from './layouts/stack/stack.js';
82
82
  export { type FormatOptions, HeadlessInputNumber, type HeadlessInputNumberProps, NumberInput, type NumberInputProps, type PadDecimalsOnBlur, type UseNumberInputOptions, type UseNumberInputReturn, useNumberInput, } from './number-input/index.js';
83
- export { type ButtonComponentToken, enUS, type FormFieldComponentToken, type InputComponentToken, type TaoComponentTokenMap, type TaoConfig, type TaoLocale, TaoProvider, type TaoProviderProps, type TaoSeedToken, type TaoSize, type TaoStatus, type TaoThemeConfig, type TaoThemeMode, type TaoVariant, useTaoConfig, useTaoToken, zhCN, } from './provider/tao-provider.js';
83
+ export { type ButtonComponentToken, enUS, type FormFieldComponentToken, type InputComponentToken, type TaoComponentTokenMap, type TaoConfig, type TaoDirection, type TaoLocale, TaoProvider, type TaoProviderProps, type TaoSeedToken, type TaoSize, type TaoStatus, type TaoThemeConfig, type TaoThemeMode, type TaoVariant, useTaoConfig, useTaoToken, zhCN, } from './provider/tao-provider.js';
84
84
  export { type TaoTokenName, taoTokenNames, tokenVar } from './theme/tokens.js';
85
85
  export { resolveResponsiveValue, type TaoBreakpoint, type TaoBreakpointMap, type TaoResponsiveValue, useBreakpoint, useIsMobile, } from './utils/breakpoint.js';
86
86
  export { cx, type SemanticClassNames, type SemanticStyles, } from './utils/semantic.js';
@@ -1,7 +1,7 @@
1
1
  import { type CSSProperties, type ReactNode } from 'react';
2
2
  import { type TaoTokenName } from '../theme/tokens.js';
3
3
  import { type TaoLocale } from './locale.js';
4
- export { enUS, zhCN, type TaoLocale } from './locale.js';
4
+ export { enUS, type TaoLocale, zhCN } from './locale.js';
5
5
  export interface TaoSeedToken {
6
6
  colorPrimary?: string;
7
7
  colorSuccess?: string;
@@ -94,7 +94,9 @@ export interface TaoThemeConfig {
94
94
  export type TaoSize = 'small' | 'medium' | 'large';
95
95
  export type TaoVariant = 'outlined' | 'filled' | 'borderless';
96
96
  export type TaoStatus = 'error' | 'warning';
97
+ export type TaoDirection = 'ltr' | 'rtl';
97
98
  export interface TaoConfig {
99
+ direction?: TaoDirection;
98
100
  locale: TaoLocale;
99
101
  size: TaoSize;
100
102
  disabled: boolean;
@@ -115,6 +117,8 @@ interface TaoConfigContextValue extends TaoConfig {
115
117
  export declare function useTaoConfig(): TaoConfig;
116
118
  /** Internal component access for token propagation through third-party portals. */
117
119
  export declare function useTaoInternalConfig(): TaoConfigContextValue;
120
+ /** Resolve DOM inheritance at a component's source, before it creates portals. */
121
+ export declare function useTaoDirection(explicit?: TaoDirection | 'auto', source?: 'parent' | 'self'): readonly [TaoDirection, import("react").Dispatch<import("react").SetStateAction<HTMLElement | null>>];
118
122
  /**
119
123
  * antd `theme.useToken` counterpart, zero-runtime edition: returns every
120
124
  * design token as a `var(--tao-*)` reference string, so custom components can
@@ -142,12 +146,15 @@ export declare function useTaoToken(): {
142
146
  * div would otherwise render even while the popup is closed, leaving a ghost
143
147
  * `<div data-tao-provider>` in the body for every mounted-but-closed Select.
144
148
  */
145
- export declare function TaoPortalScope({ children, style, asChild, }: {
149
+ export declare function TaoPortalScope({ children, style, asChild, direction: directionProp, }: {
146
150
  children: ReactNode;
147
151
  style?: CSSProperties;
148
152
  asChild?: boolean;
153
+ direction?: TaoDirection;
149
154
  }): import("react").JSX.Element;
150
155
  export interface TaoProviderProps {
156
+ /** Text and interaction direction. Defaults to the surrounding DOM direction. */
157
+ direction?: TaoDirection;
151
158
  /** Select and calendar text; missing keys inherit from the parent (English at the root). */
152
159
  locale?: Partial<TaoLocale>;
153
160
  children: ReactNode;
@@ -156,4 +163,4 @@ export interface TaoProviderProps {
156
163
  disabled?: boolean;
157
164
  variant?: TaoVariant;
158
165
  }
159
- export declare function TaoProvider({ locale: localeProp, theme, size, disabled, variant, children, }: TaoProviderProps): import("react").JSX.Element;
166
+ export declare function TaoProvider({ direction: directionProp, locale: localeProp, theme, size, disabled, variant, children, }: TaoProviderProps): import("react").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
3
  import { Slot } from "@radix-ui/react-slot";
4
- import { createContext, useContext, useRef } from "react";
4
+ import { createContext, useContext, useLayoutEffect, useRef, useState } from "react";
5
5
  import { taoTokenVars } from "../theme/tokens.js";
6
6
  import { enUS, zhCN } from "./locale.js";
7
7
  const TaoConfigContext = /*#__PURE__*/ createContext({
@@ -14,31 +14,97 @@ const TaoConfigContext = /*#__PURE__*/ createContext({
14
14
  locale: enUS
15
15
  });
16
16
  function useTaoConfig() {
17
- const $ = c(7);
18
- const { size, disabled, variant, mode, compact, locale } = useContext(TaoConfigContext);
17
+ const $ = c(8);
18
+ const { size, disabled, variant, mode, compact, locale, direction } = useContext(TaoConfigContext);
19
19
  let t0;
20
- if ($[0] !== compact || $[1] !== disabled || $[2] !== locale || $[3] !== mode || $[4] !== size || $[5] !== variant) {
20
+ if ($[0] !== compact || $[1] !== direction || $[2] !== disabled || $[3] !== locale || $[4] !== mode || $[5] !== size || $[6] !== variant) {
21
21
  t0 = {
22
22
  size,
23
23
  disabled,
24
24
  variant,
25
25
  mode,
26
26
  compact,
27
- locale
27
+ locale,
28
+ direction
28
29
  };
29
30
  $[0] = compact;
30
- $[1] = disabled;
31
- $[2] = locale;
32
- $[3] = mode;
33
- $[4] = size;
34
- $[5] = variant;
35
- $[6] = t0;
36
- } else t0 = $[6];
31
+ $[1] = direction;
32
+ $[2] = disabled;
33
+ $[3] = locale;
34
+ $[4] = mode;
35
+ $[5] = size;
36
+ $[6] = variant;
37
+ $[7] = t0;
38
+ } else t0 = $[7];
37
39
  return t0;
38
40
  }
39
41
  function useTaoInternalConfig() {
40
42
  return useContext(TaoConfigContext);
41
43
  }
44
+ function useTaoDirection(explicit, t0) {
45
+ const $ = c(8);
46
+ const source = void 0 === t0 ? "parent" : t0;
47
+ const { direction: contextDirection } = useContext(TaoConfigContext);
48
+ const [element, setElement] = useState(null);
49
+ const [inherited, setInherited] = useState();
50
+ let t1;
51
+ let t2;
52
+ if ($[0] !== contextDirection || $[1] !== element || $[2] !== explicit || $[3] !== source) {
53
+ t1 = ()=>{
54
+ if (explicit && "auto" !== explicit || !element) return;
55
+ const target = "self" === source || "auto" === explicit ? element : element.parentElement;
56
+ if (!target) return;
57
+ const update = ()=>{
58
+ const value = getComputedStyle(target).direction || target.closest("[dir]")?.getAttribute("dir") || contextDirection;
59
+ setInherited("rtl" === value ? "rtl" : "ltr");
60
+ for(let ancestor = target; ancestor; ancestor = ancestor.parentElement){
61
+ const auto = "auto" === ancestor.dir;
62
+ observer.observe(ancestor, {
63
+ attributes: true,
64
+ attributeFilter: [
65
+ "dir",
66
+ "style",
67
+ "class"
68
+ ],
69
+ childList: auto,
70
+ characterData: auto,
71
+ subtree: auto
72
+ });
73
+ }
74
+ };
75
+ const observer = new MutationObserver(update);
76
+ update();
77
+ return ()=>observer.disconnect();
78
+ };
79
+ t2 = [
80
+ element,
81
+ explicit,
82
+ contextDirection,
83
+ source
84
+ ];
85
+ $[0] = contextDirection;
86
+ $[1] = element;
87
+ $[2] = explicit;
88
+ $[3] = source;
89
+ $[4] = t1;
90
+ $[5] = t2;
91
+ } else {
92
+ t1 = $[4];
93
+ t2 = $[5];
94
+ }
95
+ useLayoutEffect(t1, t2);
96
+ const t3 = ("auto" === explicit ? void 0 : explicit) ?? inherited ?? contextDirection ?? "ltr";
97
+ let t4;
98
+ if ($[6] !== t3) {
99
+ t4 = [
100
+ t3,
101
+ setElement
102
+ ];
103
+ $[6] = t3;
104
+ $[7] = t4;
105
+ } else t4 = $[7];
106
+ return t4;
107
+ }
42
108
  function useTaoToken() {
43
109
  const $ = c(1);
44
110
  let t0;
@@ -51,82 +117,119 @@ function useTaoToken() {
51
117
  return t0;
52
118
  }
53
119
  function TaoPortalScope(t0) {
54
- const $ = c(20);
55
- const { children, style, asChild } = t0;
56
- const { tokenStyle, mode, compact } = useTaoInternalConfig();
120
+ const $ = c(31);
121
+ const { children, style, asChild, direction: directionProp } = t0;
122
+ const config = useTaoInternalConfig();
123
+ const { tokenStyle, mode, compact } = config;
124
+ const direction = directionProp ?? config.direction;
57
125
  let t1;
58
- if ($[0] !== mode) {
59
- t1 = "light" === mode ? void 0 : {
60
- "data-tao-theme": mode
126
+ if ($[0] !== config || $[1] !== direction) {
127
+ t1 = {
128
+ ...config,
129
+ direction
61
130
  };
62
- $[0] = mode;
63
- $[1] = t1;
64
- } else t1 = $[1];
65
- const themeAttr = t1;
131
+ $[0] = config;
132
+ $[1] = direction;
133
+ $[2] = t1;
134
+ } else t1 = $[2];
135
+ const portalConfig = t1;
66
136
  let t2;
67
- if ($[2] !== compact) {
68
- t2 = compact ? {
137
+ if ($[3] !== mode) {
138
+ t2 = "light" === mode ? void 0 : {
139
+ "data-tao-theme": mode
140
+ };
141
+ $[3] = mode;
142
+ $[4] = t2;
143
+ } else t2 = $[4];
144
+ const themeAttr = t2;
145
+ let t3;
146
+ if ($[5] !== compact) {
147
+ t3 = compact ? {
69
148
  "data-tao-density": "compact"
70
149
  } : void 0;
71
- $[2] = compact;
72
- $[3] = t2;
73
- } else t2 = $[3];
74
- const densityAttr = t2;
150
+ $[5] = compact;
151
+ $[6] = t3;
152
+ } else t3 = $[6];
153
+ const densityAttr = t3;
75
154
  if (asChild) {
76
- let t3;
77
- if ($[4] !== style || $[5] !== tokenStyle) {
78
- t3 = {
155
+ let t4;
156
+ if ($[7] !== style || $[8] !== tokenStyle) {
157
+ t4 = {
79
158
  ...tokenStyle,
80
159
  ...style
81
160
  };
82
- $[4] = style;
83
- $[5] = tokenStyle;
84
- $[6] = t3;
85
- } else t3 = $[6];
86
- let t4;
87
- if ($[7] !== children || $[8] !== densityAttr || $[9] !== t3 || $[10] !== themeAttr) {
88
- t4 = /*#__PURE__*/ jsx(Slot, {
161
+ $[7] = style;
162
+ $[8] = tokenStyle;
163
+ $[9] = t4;
164
+ } else t4 = $[9];
165
+ let t5;
166
+ if ($[10] !== children || $[11] !== densityAttr || $[12] !== direction || $[13] !== t4 || $[14] !== themeAttr) {
167
+ t5 = /*#__PURE__*/ jsx(Slot, {
168
+ dir: direction,
89
169
  "data-tao-provider": "",
90
170
  ...themeAttr,
91
171
  ...densityAttr,
92
- style: t3,
172
+ style: t4,
93
173
  children: children
94
174
  });
95
- $[7] = children;
96
- $[8] = densityAttr;
97
- $[9] = t3;
98
- $[10] = themeAttr;
99
- $[11] = t4;
100
- } else t4 = $[11];
101
- return t4;
175
+ $[10] = children;
176
+ $[11] = densityAttr;
177
+ $[12] = direction;
178
+ $[13] = t4;
179
+ $[14] = themeAttr;
180
+ $[15] = t5;
181
+ } else t5 = $[15];
182
+ let t6;
183
+ if ($[16] !== portalConfig || $[17] !== t5) {
184
+ t6 = /*#__PURE__*/ jsx(TaoConfigContext.Provider, {
185
+ value: portalConfig,
186
+ children: t5
187
+ });
188
+ $[16] = portalConfig;
189
+ $[17] = t5;
190
+ $[18] = t6;
191
+ } else t6 = $[18];
192
+ return t6;
102
193
  }
103
- let t3;
104
- if ($[12] !== style || $[13] !== tokenStyle) {
105
- t3 = {
194
+ let t4;
195
+ if ($[19] !== style || $[20] !== tokenStyle) {
196
+ t4 = {
106
197
  display: "contents",
107
198
  ...tokenStyle,
108
199
  ...style
109
200
  };
110
- $[12] = style;
111
- $[13] = tokenStyle;
112
- $[14] = t3;
113
- } else t3 = $[14];
114
- let t4;
115
- if ($[15] !== children || $[16] !== densityAttr || $[17] !== t3 || $[18] !== themeAttr) {
116
- t4 = /*#__PURE__*/ jsx("div", {
201
+ $[19] = style;
202
+ $[20] = tokenStyle;
203
+ $[21] = t4;
204
+ } else t4 = $[21];
205
+ let t5;
206
+ if ($[22] !== children || $[23] !== densityAttr || $[24] !== direction || $[25] !== t4 || $[26] !== themeAttr) {
207
+ t5 = /*#__PURE__*/ jsx("div", {
208
+ dir: direction,
117
209
  "data-tao-provider": "",
118
210
  ...themeAttr,
119
211
  ...densityAttr,
120
- style: t3,
212
+ style: t4,
121
213
  children: children
122
214
  });
123
- $[15] = children;
124
- $[16] = densityAttr;
125
- $[17] = t3;
126
- $[18] = themeAttr;
127
- $[19] = t4;
128
- } else t4 = $[19];
129
- return t4;
215
+ $[22] = children;
216
+ $[23] = densityAttr;
217
+ $[24] = direction;
218
+ $[25] = t4;
219
+ $[26] = themeAttr;
220
+ $[27] = t5;
221
+ } else t5 = $[27];
222
+ let t6;
223
+ if ($[28] !== portalConfig || $[29] !== t5) {
224
+ t6 = /*#__PURE__*/ jsx(TaoConfigContext.Provider, {
225
+ value: portalConfig,
226
+ children: t5
227
+ });
228
+ $[28] = portalConfig;
229
+ $[29] = t5;
230
+ $[30] = t6;
231
+ } else t6 = $[30];
232
+ return t6;
130
233
  }
131
234
  const TOKEN_TO_VAR = {
132
235
  colorPrimary: '--tao-color-primary',
@@ -188,8 +291,9 @@ const UNITLESS_COMPONENT_TOKEN_KEYS = new Set([
188
291
  'fontWeight'
189
292
  ]);
190
293
  function TaoProvider(t0) {
191
- const $ = c(30);
192
- const { locale: localeProp, theme, size, disabled, variant, children } = t0;
294
+ const $ = c(33);
295
+ const { direction: directionProp, locale: localeProp, theme, size, disabled, variant, children } = t0;
296
+ const [direction, directionRef] = useTaoDirection(directionProp);
193
297
  const parentConfig = useContext(TaoConfigContext);
194
298
  let t1;
195
299
  if ($[0] !== localeProp || $[1] !== parentConfig.locale) {
@@ -291,8 +395,9 @@ function TaoProvider(t0) {
291
395
  const t7 = disabled ?? (inherit ? parentDisabled : false);
292
396
  const t8 = variant ?? (inherit ? parentVariant : "outlined");
293
397
  let t9;
294
- if ($[14] !== compact || $[15] !== locale || $[16] !== mode || $[17] !== t6 || $[18] !== t7 || $[19] !== t8 || $[20] !== tokenStyle) {
398
+ if ($[14] !== compact || $[15] !== direction || $[16] !== locale || $[17] !== mode || $[18] !== t6 || $[19] !== t7 || $[20] !== t8 || $[21] !== tokenStyle) {
295
399
  t9 = {
400
+ direction,
296
401
  size: t6,
297
402
  disabled: t7,
298
403
  variant: t8,
@@ -302,42 +407,47 @@ function TaoProvider(t0) {
302
407
  locale
303
408
  };
304
409
  $[14] = compact;
305
- $[15] = locale;
306
- $[16] = mode;
307
- $[17] = t6;
308
- $[18] = t7;
309
- $[19] = t8;
310
- $[20] = tokenStyle;
311
- $[21] = t9;
312
- } else t9 = $[21];
410
+ $[15] = direction;
411
+ $[16] = locale;
412
+ $[17] = mode;
413
+ $[18] = t6;
414
+ $[19] = t7;
415
+ $[20] = t8;
416
+ $[21] = tokenStyle;
417
+ $[22] = t9;
418
+ } else t9 = $[22];
313
419
  const config = t9;
314
420
  const t10 = "light" === mode ? void 0 : mode;
315
421
  const t11 = compact ? "compact" : void 0;
316
422
  let t12;
317
- if ($[22] !== children || $[23] !== divStyle || $[24] !== t10 || $[25] !== t11) {
423
+ if ($[23] !== children || $[24] !== directionProp || $[25] !== directionRef || $[26] !== divStyle || $[27] !== t10 || $[28] !== t11) {
318
424
  t12 = /*#__PURE__*/ jsx("div", {
425
+ ref: directionRef,
426
+ dir: directionProp,
319
427
  style: divStyle,
320
428
  "data-tao-provider": "",
321
429
  "data-tao-theme": t10,
322
430
  "data-tao-density": t11,
323
431
  children: children
324
432
  });
325
- $[22] = children;
326
- $[23] = divStyle;
327
- $[24] = t10;
328
- $[25] = t11;
329
- $[26] = t12;
330
- } else t12 = $[26];
433
+ $[23] = children;
434
+ $[24] = directionProp;
435
+ $[25] = directionRef;
436
+ $[26] = divStyle;
437
+ $[27] = t10;
438
+ $[28] = t11;
439
+ $[29] = t12;
440
+ } else t12 = $[29];
331
441
  let t13;
332
- if ($[27] !== config || $[28] !== t12) {
442
+ if ($[30] !== config || $[31] !== t12) {
333
443
  t13 = /*#__PURE__*/ jsx(TaoConfigContext.Provider, {
334
444
  value: config,
335
445
  children: t12
336
446
  });
337
- $[27] = config;
338
- $[28] = t12;
339
- $[29] = t13;
340
- } else t13 = $[29];
447
+ $[30] = config;
448
+ $[31] = t12;
449
+ $[32] = t13;
450
+ } else t13 = $[32];
341
451
  return t13;
342
452
  }
343
- export { TaoPortalScope, TaoProvider, enUS, useTaoConfig, useTaoInternalConfig, useTaoToken, zhCN };
453
+ export { TaoPortalScope, TaoProvider, enUS, useTaoConfig, useTaoDirection, useTaoInternalConfig, useTaoToken, zhCN };
@@ -0,0 +1,3 @@
1
+ /** Physical offset from the left edge; native RTL scrollLeft runs from -max to 0. */
2
+ export declare function getScrollLeft(element: HTMLElement, direction?: string): number;
3
+ export declare function setScrollLeft(element: HTMLElement, left: number): void;
@@ -0,0 +1,7 @@
1
+ function getScrollLeft(element, direction = getComputedStyle(element).direction) {
2
+ return 'rtl' === direction ? element.scrollWidth - element.clientWidth + element.scrollLeft : element.scrollLeft;
3
+ }
4
+ function setScrollLeft(element, left) {
5
+ element.scrollLeft = 'rtl' === getComputedStyle(element).direction ? left - (element.scrollWidth - element.clientWidth) : left;
6
+ }
7
+ export { getScrollLeft, setScrollLeft };
package/llms.txt CHANGED
@@ -15,7 +15,7 @@ The package root remains available and includes all component styles.
15
15
 
16
16
  ## Core Concepts
17
17
 
18
- - `TaoProvider` supplies size, disabled, variant, portal scope, and theme seed token defaults.
18
+ - `TaoProvider` supplies size, disabled, variant, direction, portal scope, and theme seed token defaults.
19
19
  - Components expose semantic DOM customization through `classNames` and `styles` props.
20
20
  - Theme tokens are CSS custom properties prefixed with `--tao-*`; import `tokenVar(name)` and `taoTokenNames` from `@rockshin/tao-ui/tokens`.
21
21
  - Import `componentDocs` and `getComponentDoc(name)` from `@rockshin/tao-ui/meta` for machine-readable component metadata.
@@ -851,7 +851,7 @@ Provides global component defaults, portal scoping, and theme seed token overrid
851
851
  - Storybook: `stories/provider.stories.tsx`
852
852
  - Tests: `tests/provider/tao-provider.test.tsx`
853
853
 
854
- Wrap an app or subtree with TaoProvider to set size, disabled, variant, and theme defaults.
854
+ Wrap an app or subtree with TaoProvider to set size, disabled, variant, direction, and theme defaults.
855
855
 
856
856
  ### Textarea
857
857
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rockshin/tao-ui",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "type": "module",
5
5
  "description": "A modern React component library with semantic DOM customization and OKLCH-based theming.",
6
6
  "keywords": [