@rockshin/tao-ui 0.0.47 → 0.0.49

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 (144) hide show
  1. package/dist/components/affix/affix.js +20 -16
  2. package/dist/components/alert/alert.js +114 -99
  3. package/dist/components/app/app-modals.js +134 -96
  4. package/dist/components/app/app-notices.js +39 -23
  5. package/dist/components/auto-complete/auto-complete.js +21 -7
  6. package/dist/components/avatar/avatar.js +31 -11
  7. package/dist/components/badge/badge.css +1 -1
  8. package/dist/components/badge/badge.js +72 -257
  9. package/dist/components/border-beam/border-beam.js +21 -17
  10. package/dist/components/breadcrumb/breadcrumb.js +178 -159
  11. package/dist/components/button/button.js +61 -53
  12. package/dist/components/calendar/calendar.js +6 -4
  13. package/dist/components/card/card.js +24 -8
  14. package/dist/components/carousel/carousel.d.ts +1 -1
  15. package/dist/components/carousel/carousel.js +105 -68
  16. package/dist/components/cascader/cascader.js +54 -19
  17. package/dist/components/checkbox/checkbox.css +13 -2
  18. package/dist/components/checkbox/checkbox.d.ts +2 -0
  19. package/dist/components/checkbox/checkbox.js +320 -229
  20. package/dist/components/collapse/collapse-panels.d.ts +1 -1
  21. package/dist/components/collapse/collapse-panels.js +122 -113
  22. package/dist/components/collapse/collapse.js +98 -63
  23. package/dist/components/color-picker/color-picker.js +539 -441
  24. package/dist/components/color-picker/color.js +1 -1
  25. package/dist/components/context-menu/context-menu.d.ts +1 -1
  26. package/dist/components/context-menu/context-menu.js +108 -68
  27. package/dist/components/date-picker/calendar/calendar-grid.js +42 -39
  28. package/dist/components/date-picker/calendar/month-grid.d.ts +8 -1
  29. package/dist/components/date-picker/calendar/month-grid.js +79 -37
  30. package/dist/components/date-picker/calendar/time-panel.d.ts +2 -1
  31. package/dist/components/date-picker/calendar/time-panel.js +94 -89
  32. package/dist/components/date-picker/calendar/year-grid.d.ts +8 -1
  33. package/dist/components/date-picker/calendar/year-grid.js +66 -35
  34. package/dist/components/date-picker/date-picker.css +24 -1
  35. package/dist/components/date-picker/date-picker.js +99 -53
  36. package/dist/components/date-picker/presets.d.ts +2 -1
  37. package/dist/components/date-picker/presets.js +27 -24
  38. package/dist/components/date-picker/range-picker.js +308 -153
  39. package/dist/components/descriptions/descriptions.js +7 -3
  40. package/dist/components/divider/divider.css +1 -1
  41. package/dist/components/divider/divider.js +1 -1
  42. package/dist/components/drawer/drawer.js +201 -369
  43. package/dist/components/dropdown/dropdown.d.ts +1 -1
  44. package/dist/components/dropdown/dropdown.js +183 -279
  45. package/dist/components/empty/empty.js +57 -78
  46. package/dist/components/float-button/float-button.d.ts +1 -0
  47. package/dist/components/float-button/float-button.js +47 -30
  48. package/dist/components/form/field-control.d.ts +4 -2
  49. package/dist/components/form/field-control.js +17 -9
  50. package/dist/components/form/form-context.d.ts +8 -2
  51. package/dist/components/form/form-context.js +2 -1
  52. package/dist/components/form/form-item.js +85 -63
  53. package/dist/components/form/form.css +3 -2
  54. package/dist/components/form/use-form.d.ts +2 -1
  55. package/dist/components/form/use-form.js +2 -1
  56. package/dist/components/form-field/form-field-view.d.ts +3 -1
  57. package/dist/components/form-field/form-field-view.js +194 -141
  58. package/dist/components/form-section/form-section.d.ts +1 -1
  59. package/dist/components/form-section/form-section.js +52 -45
  60. package/dist/components/image/image.js +585 -477
  61. package/dist/components/input/base-input.js +8 -9
  62. package/dist/components/input/input-shared.d.ts +5 -2
  63. package/dist/components/input/input-shared.js +42 -18
  64. package/dist/components/input/otp.js +236 -217
  65. package/dist/components/input/password.js +2 -1
  66. package/dist/components/input/search.js +8 -7
  67. package/dist/components/list/list-pagination.js +41 -36
  68. package/dist/components/list/list.js +141 -125
  69. package/dist/components/listy/listy.js +175 -106
  70. package/dist/components/masonry/masonry.js +108 -85
  71. package/dist/components/mentions/mentions.js +12 -3
  72. package/dist/components/menu/menu-render.d.ts +9 -3
  73. package/dist/components/menu/menu-render.js +99 -36
  74. package/dist/components/modal/confirm-dialog.js +10 -4
  75. package/dist/components/modal/confirm.js +3 -7
  76. package/dist/components/modal/index.js +9 -3
  77. package/dist/components/modal/modal.js +390 -365
  78. package/dist/components/pagination/pagination.js +105 -96
  79. package/dist/components/popconfirm/popconfirm.d.ts +1 -1
  80. package/dist/components/popconfirm/popconfirm.js +219 -168
  81. package/dist/components/popover/popover.js +330 -243
  82. package/dist/components/progress/progress.css +2 -2
  83. package/dist/components/progress/progress.js +232 -458
  84. package/dist/components/qr-code/qr-code.js +72 -66
  85. package/dist/components/radio/radio.css +15 -4
  86. package/dist/components/radio/radio.d.ts +2 -1
  87. package/dist/components/radio/radio.js +260 -198
  88. package/dist/components/rate/rate.js +173 -113
  89. package/dist/components/scroll-area/scroll-area.js +241 -211
  90. package/dist/components/segmented/segmented.js +73 -41
  91. package/dist/components/select/mobile-select.d.ts +2 -1
  92. package/dist/components/select/mobile-select.js +24 -13
  93. package/dist/components/select/select-searchable-list.d.ts +2 -1
  94. package/dist/components/select/select-searchable-list.js +2 -3
  95. package/dist/components/select/select.js +49 -25
  96. package/dist/components/select/use-select-selection.d.ts +1 -1
  97. package/dist/components/select/use-select-selection.js +7 -4
  98. package/dist/components/skeleton/skeleton.js +56 -48
  99. package/dist/components/slider/slider.js +87 -212
  100. package/dist/components/sonner/sonner.js +109 -93
  101. package/dist/components/spinner/spinner.js +147 -138
  102. package/dist/components/splitter/splitter.js +222 -159
  103. package/dist/components/statistic/statistic.js +7 -6
  104. package/dist/components/steps/steps.js +88 -81
  105. package/dist/components/steps/use-display-steps.js +1 -1
  106. package/dist/components/switch/switch.js +89 -89
  107. package/dist/components/table/table-filter.js +66 -56
  108. package/dist/components/table/table-icons.d.ts +2 -1
  109. package/dist/components/table/table-icons.js +11 -9
  110. package/dist/components/table/table-model.js +1 -1
  111. package/dist/components/table/table.js +107 -83
  112. package/dist/components/table/use-table-data.d.ts +6 -3
  113. package/dist/components/table/use-table-data.js +166 -130
  114. package/dist/components/tabs/tabs.css +1 -1
  115. package/dist/components/tabs/tabs.js +236 -179
  116. package/dist/components/tag/tag.d.ts +2 -2
  117. package/dist/components/tag/tag.js +111 -108
  118. package/dist/components/textarea/textarea.js +22 -17
  119. package/dist/components/time-picker/time-picker.js +5 -3
  120. package/dist/components/timeline/timeline.css +6 -1
  121. package/dist/components/timeline/timeline.js +21 -11
  122. package/dist/components/tooltip/tooltip.d.ts +2 -2
  123. package/dist/components/tooltip/tooltip.js +123 -233
  124. package/dist/components/tour/tour.css +4 -0
  125. package/dist/components/tour/tour.js +400 -331
  126. package/dist/components/transfer/transfer-list.js +29 -11
  127. package/dist/components/transfer/transfer-parts.js +1 -1
  128. package/dist/components/transfer/transfer-types.d.ts +1 -0
  129. package/dist/components/transfer/transfer.js +29 -14
  130. package/dist/components/tree/tree-keyboard.d.ts +1 -1
  131. package/dist/components/tree/tree-keyboard.js +5 -3
  132. package/dist/components/tree/tree.js +74 -59
  133. package/dist/components/tree-select/select-engine.d.ts +3 -2
  134. package/dist/components/tree-select/select-engine.js +18 -16
  135. package/dist/components/tree-select/tree-select.js +21 -5
  136. package/dist/components/upload/upload.css +8 -0
  137. package/dist/components/upload/upload.js +160 -72
  138. package/dist/components/watermark/watermark.js +36 -29
  139. package/dist/number-input/use-number-input.js +129 -90
  140. package/dist/number-input/validate.js +32 -5
  141. package/dist/provider/merge-locale.js +12 -9
  142. package/dist/provider/tao-provider.d.ts +3 -1
  143. package/dist/provider/tao-provider.js +123 -86
  144. package/package.json +1 -1
@@ -8,141 +8,150 @@ function toKeys(value) {
8
8
  value
9
9
  ]).map(String);
10
10
  }
11
- function CollapsePanels(t0) {
12
- const $ = c(49);
13
- const { items, activeKey, defaultActiveKey, onChange, accordion: t1, bordered: t2, ghost: t3, size, disabled, collapsible: t4, expandIconPlacement: t5, expandIcon, destroyOnHidden: t6, className, style, classNames, styles } = t0;
14
- const accordion = void 0 === t1 ? false : t1;
15
- const bordered = void 0 === t2 ? true : t2;
16
- const ghost = void 0 === t3 ? false : t3;
17
- const collapsible = void 0 === t4 ? "header" : t4;
18
- const expandIconPlacement = void 0 === t5 ? "start" : t5;
19
- const destroyOnHidden = void 0 === t6 ? false : t6;
11
+ function CollapsePanels(props) {
12
+ const $ = c(51);
13
+ const { items, activeKey, defaultActiveKey, onChange, accordion: t0, bordered: t1, ghost: t2, size, disabled, collapsible: t3, expandIconPlacement: t4, expandIcon, destroyOnHidden: t5, className, style, classNames, styles } = props;
14
+ const accordion = void 0 === t0 ? false : t0;
15
+ const bordered = void 0 === t1 ? true : t1;
16
+ const ghost = void 0 === t2 ? false : t2;
17
+ const collapsible = void 0 === t3 ? "header" : t3;
18
+ const expandIconPlacement = void 0 === t4 ? "start" : t4;
19
+ const destroyOnHidden = void 0 === t5 ? false : t5;
20
20
  const config = useTaoConfig();
21
- let t7;
21
+ let t6;
22
22
  if ($[0] !== defaultActiveKey) {
23
- t7 = ()=>toKeys(defaultActiveKey);
23
+ t6 = ()=>toKeys(defaultActiveKey);
24
24
  $[0] = defaultActiveKey;
25
- $[1] = t7;
26
- } else t7 = $[1];
27
- const [internalKeys, setInternalKeys] = useState(t7);
28
- let t8;
29
- if ($[2] !== activeKey || $[3] !== internalKeys) {
30
- t8 = void 0 === activeKey ? internalKeys : toKeys(activeKey);
25
+ $[1] = t6;
26
+ } else t6 = $[1];
27
+ const [internalKeys, setInternalKeys] = useState(t6);
28
+ const controlled = "activeKey" in props;
29
+ let t7;
30
+ if ($[2] !== activeKey || $[3] !== controlled || $[4] !== internalKeys) {
31
+ t7 = controlled ? toKeys(activeKey) : internalKeys;
31
32
  $[2] = activeKey;
32
- $[3] = internalKeys;
33
- $[4] = t8;
34
- } else t8 = $[4];
35
- const keys = t8;
33
+ $[3] = controlled;
34
+ $[4] = internalKeys;
35
+ $[5] = t7;
36
+ } else t7 = $[5];
37
+ const keys = t7;
38
+ let t8;
39
+ if ($[6] !== accordion || $[7] !== keys) {
40
+ t8 = accordion ? keys.slice(0, 1) : keys;
41
+ $[6] = accordion;
42
+ $[7] = keys;
43
+ $[8] = t8;
44
+ } else t8 = $[8];
45
+ const activeKeys = t8;
36
46
  let t9;
37
- if ($[5] !== accordion || $[6] !== keys) {
38
- t9 = accordion ? keys.slice(0, 1) : keys;
39
- $[5] = accordion;
40
- $[6] = keys;
41
- $[7] = t9;
42
- } else t9 = $[7];
43
- const activeKeys = t9;
44
- let t10;
45
- if ($[8] !== accordion || $[9] !== activeKey || $[10] !== activeKeys || $[11] !== onChange) {
46
- t10 = (key)=>{
47
- const next = activeKeys.includes(key) ? activeKeys.filter((active)=>active !== key) : accordion ? [
47
+ if ($[9] !== accordion || $[10] !== activeKeys || $[11] !== controlled || $[12] !== items || $[13] !== onChange) {
48
+ t9 = (key)=>{
49
+ const presentKeys = new Set(items.map(_temp));
50
+ const next = activeKeys.includes(key) ? activeKeys.filter((active)=>active !== key && presentKeys.has(active)) : accordion ? [
48
51
  key
49
52
  ] : [
50
- ...activeKeys,
53
+ ...activeKeys.filter((active_0)=>presentKeys.has(active_0)),
51
54
  key
52
55
  ];
53
- if (void 0 === activeKey) setInternalKeys(next);
54
- onChange?.(next);
56
+ if (!controlled) setInternalKeys(next);
57
+ onChange?.([
58
+ ...next
59
+ ]);
55
60
  };
56
- $[8] = accordion;
57
- $[9] = activeKey;
61
+ $[9] = accordion;
58
62
  $[10] = activeKeys;
59
- $[11] = onChange;
60
- $[12] = t10;
61
- } else t10 = $[12];
62
- const toggle = t10;
63
- const t11 = size ?? config.size;
64
- const t12 = ghost || void 0;
65
- const t13 = classNames?.root;
66
- let t14;
67
- if ($[13] !== className || $[14] !== t13) {
68
- t14 = cx(t13, className);
69
- $[13] = className;
70
- $[14] = t13;
71
- $[15] = t14;
72
- } else t14 = $[15];
73
- const t15 = styles?.root;
74
- let t16;
75
- if ($[16] !== style || $[17] !== t15) {
76
- t16 = {
77
- ...t15,
63
+ $[11] = controlled;
64
+ $[12] = items;
65
+ $[13] = onChange;
66
+ $[14] = t9;
67
+ } else t9 = $[14];
68
+ const toggle = t9;
69
+ const t10 = size ?? config.size;
70
+ const t11 = ghost || void 0;
71
+ const t12 = classNames?.root;
72
+ let t13;
73
+ if ($[15] !== className || $[16] !== t12) {
74
+ t13 = cx(t12, className);
75
+ $[15] = className;
76
+ $[16] = t12;
77
+ $[17] = t13;
78
+ } else t13 = $[17];
79
+ const t14 = styles?.root;
80
+ let t15;
81
+ if ($[18] !== style || $[19] !== t14) {
82
+ t15 = {
83
+ ...t14,
78
84
  ...style
79
85
  };
80
- $[16] = style;
81
- $[17] = t15;
82
- $[18] = t16;
83
- } else t16 = $[18];
84
- let t17;
85
- if ($[19] !== activeKeys || $[20] !== classNames || $[21] !== collapsible || $[22] !== config || $[23] !== destroyOnHidden || $[24] !== disabled || $[25] !== expandIcon || $[26] !== expandIconPlacement || $[27] !== items || $[28] !== styles || $[29] !== toggle) {
86
- let t18;
87
- if ($[31] !== activeKeys || $[32] !== classNames || $[33] !== collapsible || $[34] !== config || $[35] !== destroyOnHidden || $[36] !== disabled || $[37] !== expandIcon || $[38] !== expandIconPlacement || $[39] !== styles || $[40] !== toggle) {
88
- t18 = (item)=>/*#__PURE__*/ jsx(CollapsePanel, {
89
- item: item,
90
- open: activeKeys.includes(String(item.key)),
91
- onToggle: ()=>toggle(String(item.key)),
92
- triggerMode: disabled ?? config.disabled ? "disabled" : item.collapsible ?? collapsible,
86
+ $[18] = style;
87
+ $[19] = t14;
88
+ $[20] = t15;
89
+ } else t15 = $[20];
90
+ let t16;
91
+ if ($[21] !== activeKeys || $[22] !== classNames || $[23] !== collapsible || $[24] !== config || $[25] !== destroyOnHidden || $[26] !== disabled || $[27] !== expandIcon || $[28] !== expandIconPlacement || $[29] !== items || $[30] !== styles || $[31] !== toggle) {
92
+ let t17;
93
+ if ($[33] !== activeKeys || $[34] !== classNames || $[35] !== collapsible || $[36] !== config || $[37] !== destroyOnHidden || $[38] !== disabled || $[39] !== expandIcon || $[40] !== expandIconPlacement || $[41] !== styles || $[42] !== toggle) {
94
+ t17 = (item_0)=>/*#__PURE__*/ jsx(CollapsePanel, {
95
+ item: item_0,
96
+ open: activeKeys.includes(String(item_0.key)),
97
+ onToggle: ()=>toggle(String(item_0.key)),
98
+ triggerMode: disabled ?? config.disabled ? "disabled" : item_0.collapsible ?? collapsible,
93
99
  expandIcon: expandIcon,
94
100
  expandIconPlacement: expandIconPlacement,
95
101
  destroyOnHidden: destroyOnHidden,
96
102
  classNames: classNames,
97
103
  styles: styles
98
- }, item.key);
99
- $[31] = activeKeys;
100
- $[32] = classNames;
101
- $[33] = collapsible;
102
- $[34] = config;
103
- $[35] = destroyOnHidden;
104
- $[36] = disabled;
105
- $[37] = expandIcon;
106
- $[38] = expandIconPlacement;
107
- $[39] = styles;
108
- $[40] = toggle;
109
- $[41] = t18;
110
- } else t18 = $[41];
111
- t17 = items.map(t18);
112
- $[19] = activeKeys;
113
- $[20] = classNames;
114
- $[21] = collapsible;
115
- $[22] = config;
116
- $[23] = destroyOnHidden;
117
- $[24] = disabled;
118
- $[25] = expandIcon;
119
- $[26] = expandIconPlacement;
120
- $[27] = items;
121
- $[28] = styles;
122
- $[29] = toggle;
123
- $[30] = t17;
124
- } else t17 = $[30];
125
- let t18;
126
- if ($[42] !== bordered || $[43] !== t11 || $[44] !== t12 || $[45] !== t14 || $[46] !== t16 || $[47] !== t17) {
127
- t18 = /*#__PURE__*/ jsx("div", {
104
+ }, item_0.key);
105
+ $[33] = activeKeys;
106
+ $[34] = classNames;
107
+ $[35] = collapsible;
108
+ $[36] = config;
109
+ $[37] = destroyOnHidden;
110
+ $[38] = disabled;
111
+ $[39] = expandIcon;
112
+ $[40] = expandIconPlacement;
113
+ $[41] = styles;
114
+ $[42] = toggle;
115
+ $[43] = t17;
116
+ } else t17 = $[43];
117
+ t16 = items.map(t17);
118
+ $[21] = activeKeys;
119
+ $[22] = classNames;
120
+ $[23] = collapsible;
121
+ $[24] = config;
122
+ $[25] = destroyOnHidden;
123
+ $[26] = disabled;
124
+ $[27] = expandIcon;
125
+ $[28] = expandIconPlacement;
126
+ $[29] = items;
127
+ $[30] = styles;
128
+ $[31] = toggle;
129
+ $[32] = t16;
130
+ } else t16 = $[32];
131
+ let t17;
132
+ if ($[44] !== bordered || $[45] !== t10 || $[46] !== t11 || $[47] !== t13 || $[48] !== t15 || $[49] !== t16) {
133
+ t17 = /*#__PURE__*/ jsx("div", {
128
134
  "data-tao-collapse": "",
129
135
  "data-tao-collapse-panels": "",
130
- "data-tao-size": t11,
136
+ "data-tao-size": t10,
131
137
  "data-tao-bordered": bordered,
132
- "data-tao-ghost": t12,
133
- className: t14,
134
- style: t16,
135
- children: t17
138
+ "data-tao-ghost": t11,
139
+ className: t13,
140
+ style: t15,
141
+ children: t16
136
142
  });
137
- $[42] = bordered;
138
- $[43] = t11;
139
- $[44] = t12;
140
- $[45] = t14;
141
- $[46] = t16;
142
- $[47] = t17;
143
- $[48] = t18;
144
- } else t18 = $[48];
145
- return t18;
143
+ $[44] = bordered;
144
+ $[45] = t10;
145
+ $[46] = t11;
146
+ $[47] = t13;
147
+ $[48] = t15;
148
+ $[49] = t16;
149
+ $[50] = t17;
150
+ } else t17 = $[50];
151
+ return t17;
152
+ }
153
+ function _temp(item) {
154
+ return String(item.key);
146
155
  }
147
156
  function CollapsePanel(t0) {
148
157
  const $ = c(73);
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { c } from "react-compiler-runtime";
3
- import { createContext, useContext, useState } from "react";
3
+ import { cloneElement, createContext, isValidElement, useContext, useState } from "react";
4
4
  import { useTaoConfig } from "../../provider/tao-provider.js";
5
5
  import { cx } from "../../utils/semantic.js";
6
6
  import { CollapsePanels } from "./collapse-panels.js";
@@ -23,7 +23,7 @@ function Collapse(props) {
23
23
  return t0;
24
24
  }
25
25
  function CollapseRoot(props) {
26
- const $ = c(22);
26
+ const $ = c(23);
27
27
  const { open, defaultOpen, onOpenChange, disabled, children, className, style, classNames, styles } = props;
28
28
  const { disabled: ctxDisabled } = useTaoConfig();
29
29
  const resolvedDisabled = disabled ?? ctxDisabled;
@@ -42,36 +42,38 @@ function CollapseRoot(props) {
42
42
  } else t0 = $[2];
43
43
  const setOpen = t0;
44
44
  let t1;
45
- if ($[3] !== classNames || $[4] !== styles) {
45
+ if ($[3] !== classNames || $[4] !== resolvedDisabled || $[5] !== styles) {
46
46
  t1 = {
47
47
  classNames,
48
- styles
48
+ styles,
49
+ disabled: resolvedDisabled
49
50
  };
50
51
  $[3] = classNames;
51
- $[4] = styles;
52
- $[5] = t1;
53
- } else t1 = $[5];
52
+ $[4] = resolvedDisabled;
53
+ $[5] = styles;
54
+ $[6] = t1;
55
+ } else t1 = $[6];
54
56
  const t2 = classNames?.root;
55
57
  let t3;
56
- if ($[6] !== className || $[7] !== t2) {
58
+ if ($[7] !== className || $[8] !== t2) {
57
59
  t3 = cx(t2, className);
58
- $[6] = className;
59
- $[7] = t2;
60
- $[8] = t3;
61
- } else t3 = $[8];
60
+ $[7] = className;
61
+ $[8] = t2;
62
+ $[9] = t3;
63
+ } else t3 = $[9];
62
64
  const t4 = styles?.root;
63
65
  let t5;
64
- if ($[9] !== style || $[10] !== t4) {
66
+ if ($[10] !== style || $[11] !== t4) {
65
67
  t5 = {
66
68
  ...t4,
67
69
  ...style
68
70
  };
69
- $[9] = style;
70
- $[10] = t4;
71
- $[11] = t5;
72
- } else t5 = $[11];
71
+ $[10] = style;
72
+ $[11] = t4;
73
+ $[12] = t5;
74
+ } else t5 = $[12];
73
75
  let t6;
74
- if ($[12] !== children || $[13] !== realOpen || $[14] !== resolvedDisabled || $[15] !== setOpen || $[16] !== t3 || $[17] !== t5) {
76
+ if ($[13] !== children || $[14] !== realOpen || $[15] !== resolvedDisabled || $[16] !== setOpen || $[17] !== t3 || $[18] !== t5) {
75
77
  t6 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_collapsible_4aef300f.Root, {
76
78
  open: realOpen,
77
79
  onOpenChange: setOpen,
@@ -81,65 +83,98 @@ function CollapseRoot(props) {
81
83
  style: t5,
82
84
  children: children
83
85
  });
84
- $[12] = children;
85
- $[13] = realOpen;
86
- $[14] = resolvedDisabled;
87
- $[15] = setOpen;
88
- $[16] = t3;
89
- $[17] = t5;
90
- $[18] = t6;
91
- } else t6 = $[18];
86
+ $[13] = children;
87
+ $[14] = realOpen;
88
+ $[15] = resolvedDisabled;
89
+ $[16] = setOpen;
90
+ $[17] = t3;
91
+ $[18] = t5;
92
+ $[19] = t6;
93
+ } else t6 = $[19];
92
94
  let t7;
93
- if ($[19] !== t1 || $[20] !== t6) {
95
+ if ($[20] !== t1 || $[21] !== t6) {
94
96
  t7 = /*#__PURE__*/ jsx(Ctx.Provider, {
95
97
  value: t1,
96
98
  children: t6
97
99
  });
98
- $[19] = t1;
99
- $[20] = t6;
100
- $[21] = t7;
101
- } else t7 = $[21];
100
+ $[20] = t1;
101
+ $[21] = t6;
102
+ $[22] = t7;
103
+ } else t7 = $[22];
102
104
  return t7;
103
105
  }
104
106
  function CollapseTrigger(props) {
105
- const $ = c(11);
107
+ const $ = c(17);
106
108
  const { children, asChild, className, style } = props;
107
- const { classNames, styles } = useContext(Ctx);
108
- const t0 = classNames?.trigger;
109
- let t1;
110
- if ($[0] !== className || $[1] !== t0) {
111
- t1 = cx(t0, className);
112
- $[0] = className;
113
- $[1] = t0;
114
- $[2] = t1;
115
- } else t1 = $[2];
116
- const t2 = styles?.trigger;
117
- let t3;
118
- if ($[3] !== style || $[4] !== t2) {
119
- t3 = {
120
- ...t2,
109
+ const { classNames, styles, disabled } = useContext(Ctx);
110
+ const customDisabled = asChild && disabled;
111
+ const blockActivation = customDisabled ? _temp : void 0;
112
+ let t0;
113
+ if ($[0] !== children || $[1] !== customDisabled) {
114
+ t0 = customDisabled && /*#__PURE__*/ isValidElement(children) ? /*#__PURE__*/ cloneElement(children, {
115
+ "aria-disabled": true,
116
+ tabIndex: -1,
117
+ ..."a" === children.type ? {
118
+ href: void 0,
119
+ role: children.props.role ?? "link"
120
+ } : {},
121
+ ..."button" === children.type ? {
122
+ disabled: true
123
+ } : {}
124
+ }) : children;
125
+ $[0] = children;
126
+ $[1] = customDisabled;
127
+ $[2] = t0;
128
+ } else t0 = $[2];
129
+ const trigger = t0;
130
+ const t1 = customDisabled || void 0;
131
+ const t2 = customDisabled ? -1 : void 0;
132
+ const t3 = classNames?.trigger;
133
+ let t4;
134
+ if ($[3] !== className || $[4] !== t3) {
135
+ t4 = cx(t3, className);
136
+ $[3] = className;
137
+ $[4] = t3;
138
+ $[5] = t4;
139
+ } else t4 = $[5];
140
+ const t5 = styles?.trigger;
141
+ let t6;
142
+ if ($[6] !== style || $[7] !== t5) {
143
+ t6 = {
144
+ ...t5,
121
145
  ...style
122
146
  };
123
- $[3] = style;
124
- $[4] = t2;
125
- $[5] = t3;
126
- } else t3 = $[5];
127
- let t4;
128
- if ($[6] !== asChild || $[7] !== children || $[8] !== t1 || $[9] !== t3) {
129
- t4 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_collapsible_4aef300f.Trigger, {
147
+ $[6] = style;
148
+ $[7] = t5;
149
+ $[8] = t6;
150
+ } else t6 = $[8];
151
+ let t7;
152
+ if ($[9] !== asChild || $[10] !== blockActivation || $[11] !== t1 || $[12] !== t2 || $[13] !== t4 || $[14] !== t6 || $[15] !== trigger) {
153
+ t7 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_collapsible_4aef300f.Trigger, {
130
154
  asChild: asChild,
155
+ "aria-disabled": t1,
156
+ tabIndex: t2,
157
+ onClickCapture: blockActivation,
158
+ onAuxClickCapture: blockActivation,
131
159
  "data-tao-collapse-trigger": "",
132
- className: t1,
133
- style: t3,
134
- children: children
160
+ className: t4,
161
+ style: t6,
162
+ children: trigger
135
163
  });
136
- $[6] = asChild;
137
- $[7] = children;
138
- $[8] = t1;
139
- $[9] = t3;
140
- $[10] = t4;
141
- } else t4 = $[10];
142
- return t4;
164
+ $[9] = asChild;
165
+ $[10] = blockActivation;
166
+ $[11] = t1;
167
+ $[12] = t2;
168
+ $[13] = t4;
169
+ $[14] = t6;
170
+ $[15] = trigger;
171
+ $[16] = t7;
172
+ } else t7 = $[16];
173
+ return t7;
174
+ }
175
+ function _temp(event) {
176
+ event.preventDefault();
177
+ event.stopPropagation();
143
178
  }
144
179
  function CollapseContent(props) {
145
180
  const $ = c(10);