@unicom-cloud/ui 0.8.106 → 0.8.108

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 (197) hide show
  1. package/App.js +7 -0
  2. package/BackTop.js +2 -4
  3. package/Calendar.js +2 -2
  4. package/ColorPicker.js +15 -14
  5. package/Constant.js +4 -0
  6. package/Copy.js +4 -3
  7. package/Countdown.js +25 -0
  8. package/Grid.js +8 -10
  9. package/LiquidFill.js +4 -3
  10. package/List.js +7 -6
  11. package/Marquee.js +4 -3
  12. package/Modal.js +4 -2
  13. package/PageHeader.js +3 -2
  14. package/QrCode.js +4 -3
  15. package/RowCol.js +8 -0
  16. package/Segmented.js +14 -4
  17. package/Statistic.js +5 -4
  18. package/Tour.js +4 -3
  19. package/Transfer.js +4 -2
  20. package/anchor/Link.js +1 -1
  21. package/app/App.js +26 -0
  22. package/app/context.js +9 -0
  23. package/app/index.js +9 -0
  24. package/app/interface.js +1 -0
  25. package/app/useApp.js +8 -0
  26. package/avatar/Group.js +1 -1
  27. package/back-top/index.js +44 -56
  28. package/button/index.js +52 -51
  29. package/calendar/Lunar.js +71 -0
  30. package/calendar/index.js +11 -11
  31. package/cascader/base/node.js +22 -20
  32. package/cascader/base/store.js +10 -10
  33. package/cascader/util.js +29 -27
  34. package/color-picker/Mode.js +8 -7
  35. package/color-picker/hooks/useColorPicker.js +56 -55
  36. package/color-picker/index.js +49 -48
  37. package/color-picker/utils.js +58 -57
  38. package/components/common/empty/index.js +2 -2
  39. package/components/common/flex/index.js +64 -55
  40. package/components/common/flex/interface.js +6 -6
  41. package/components/common/hooks/useInterval.js +6 -6
  42. package/components/common/icons/file/index.js +13 -11
  43. package/components/common/space/index.js +53 -53
  44. package/components/common/utils/dayjs.js +114 -126
  45. package/components/common/utils/is.js +98 -104
  46. package/components/common/utils/setDir.js +12 -0
  47. package/components/common/utils/setTheme.js +13 -13
  48. package/components/common/utils/toArray.js +7 -5
  49. package/config-provider/ConfigProvider.js +32 -30
  50. package/constant/index.js +4 -0
  51. package/copy/index.js +2 -1
  52. package/countdown/index.js +113 -0
  53. package/countdown/interface.js +1 -0
  54. package/countdown/util.js +29 -0
  55. package/descriptions/index.js +45 -45
  56. package/divider/index.js +28 -20
  57. package/dropdown/Button.js +1 -1
  58. package/empty/index.js +1 -1
  59. package/flex/index.js +30 -29
  60. package/form/FormItem.js +126 -122
  61. package/grid/Grid.js +56 -90
  62. package/grid/Item.js +44 -65
  63. package/grid/context.js +2 -6
  64. package/grid/index.js +6 -8
  65. package/grid/util.js +6 -44
  66. package/hooks/useResponsiveState.js +54 -0
  67. package/index.js +614 -605
  68. package/input/Button.js +12 -12
  69. package/input/Group.js +11 -12
  70. package/input/Input.js +112 -102
  71. package/input/InputElement.js +25 -24
  72. package/input/Search.js +24 -24
  73. package/layout/Sider.js +1 -1
  74. package/liquid-fill/index.js +4 -3
  75. package/list/Item.js +21 -21
  76. package/list/index.js +53 -52
  77. package/marquee/index.js +20 -19
  78. package/marquee-/index.js +4 -3
  79. package/mentions/util.js +9 -8
  80. package/modal/Confirm.js +17 -17
  81. package/modal/Modal.js +247 -237
  82. package/modal/index.js +4 -2
  83. package/modal/use-modal/index.js +2 -2
  84. package/package.json +1 -1
  85. package/page-header/index.js +57 -56
  86. package/pagination/Pagination.js +89 -92
  87. package/qr-code/index.js +4 -3
  88. package/radio/Group.js +1 -1
  89. package/row-col/Col-.js +88 -0
  90. package/row-col/Col.js +159 -0
  91. package/row-col/Row.js +73 -0
  92. package/row-col/context.js +5 -0
  93. package/row-col/index.js +11 -0
  94. package/row-col/interface.js +1 -0
  95. package/segmented/index.js +257 -206
  96. package/select/Select.js +191 -191
  97. package/select/util.js +50 -50
  98. package/select-view/Core.js +31 -28
  99. package/space/index.js +15 -13
  100. package/splitter/SplitBar.js +44 -46
  101. package/statistic/index.js +56 -55
  102. package/statistic/interface.js +4 -1
  103. package/style.css +1 -1
  104. package/table/Table.js +198 -210
  105. package/table/hook/useColumns.js +27 -26
  106. package/table/hook/useStickyClassNames.js +9 -8
  107. package/table/hook/useThResizable.js +4 -3
  108. package/table/th-resizable/index.js +2 -2
  109. package/table/thead/index.js +18 -16
  110. package/time-picker/util.js +20 -30
  111. package/timeline/Item.js +1 -1
  112. package/tour/index.js +4 -3
  113. package/transfer/index.js +93 -91
  114. package/trigger/index.js +66 -66
  115. package/types/common/development/interface.d.ts +3 -3
  116. package/types/common/flex/index.d.ts +3 -9
  117. package/types/common/flex/interface.d.ts +15 -4
  118. package/types/common/space/index.d.ts +3 -5
  119. package/types/common/space/interface.d.ts +2 -0
  120. package/types/common/utils/dayjs.d.ts +3 -1
  121. package/types/common/utils/is.d.ts +3 -4
  122. package/types/common/utils/setDir.d.ts +2 -0
  123. package/types/pc/app/App.d.ts +6 -0
  124. package/types/pc/app/context.d.ts +4 -0
  125. package/types/pc/app/index.d.ts +5 -0
  126. package/types/pc/app/interface.d.ts +17 -0
  127. package/types/pc/app/useApp.d.ts +3 -0
  128. package/types/pc/back-top/interface.d.ts +4 -17
  129. package/types/pc/button/interface.d.ts +2 -2
  130. package/types/pc/calendar/Lunar.d.ts +17 -0
  131. package/types/pc/calendar/index.d.ts +1 -1
  132. package/types/pc/config-provider/interface.d.ts +17 -12
  133. package/types/pc/constant/index.d.ts +1 -0
  134. package/types/pc/countdown/interface.d.ts +65 -0
  135. package/types/pc/countdown/util.d.ts +7 -0
  136. package/types/pc/divider/interface.d.ts +1 -0
  137. package/types/pc/flex/index.d.ts +8 -6
  138. package/types/pc/flex/interface.d.ts +3 -10
  139. package/types/pc/form/FormItem.d.ts +1 -1
  140. package/types/pc/form/interface.d.ts +1 -1
  141. package/types/pc/grid/Grid.d.ts +2 -4
  142. package/types/pc/grid/Item.d.ts +1 -5
  143. package/types/pc/grid/context.d.ts +4 -15
  144. package/types/pc/grid/index.d.ts +4 -6
  145. package/types/pc/grid/interface.d.ts +14 -142
  146. package/types/pc/grid/util.d.ts +1 -10
  147. package/types/pc/hooks/useResponsiveState.d.ts +3 -0
  148. package/types/pc/index.d.ts +10 -4
  149. package/types/pc/input/Button.d.ts +2 -2
  150. package/types/pc/list/interface.d.ts +2 -1
  151. package/types/pc/message/index.d.ts +1 -9
  152. package/types/pc/message/interface.d.ts +8 -0
  153. package/types/pc/message/useMessage.d.ts +1 -2
  154. package/types/pc/modal/Modal.d.ts +1 -0
  155. package/types/pc/modal/config.d.ts +1 -2
  156. package/types/pc/modal/index.d.ts +2 -1
  157. package/types/pc/modal/interface.d.ts +17 -5
  158. package/types/pc/notification/index.d.ts +2 -9
  159. package/types/pc/notification/interface.d.ts +7 -0
  160. package/types/pc/notification/useNotification.d.ts +1 -2
  161. package/types/pc/pagination/PageOption.d.ts +0 -1
  162. package/types/pc/pagination/interface.d.ts +5 -6
  163. package/types/pc/{grid → row-col}/Col-.d.ts +1 -1
  164. package/types/pc/{grid → row-col}/Col.d.ts +1 -2
  165. package/types/pc/{grid → row-col}/Row.d.ts +1 -2
  166. package/types/pc/row-col/context.d.ts +6 -0
  167. package/types/pc/row-col/index.d.ts +7 -0
  168. package/types/pc/row-col/interface.d.ts +112 -0
  169. package/types/pc/segmented/index.d.ts +3 -7
  170. package/types/pc/segmented/interface.d.ts +38 -5
  171. package/types/pc/select-view/Core.d.ts +1 -8
  172. package/types/pc/select-view/index.d.ts +1 -8
  173. package/types/pc/select-view/interface.d.ts +9 -2
  174. package/types/pc/space/index.d.ts +5 -7
  175. package/types/pc/space/interface.d.ts +3 -10
  176. package/types/pc/statistic/index.d.ts +1 -1
  177. package/types/pc/statistic/interface.d.ts +1 -49
  178. package/types/pc/utils/is.d.ts +1 -1
  179. package/types/pc/utils/names.d.ts +422 -111
  180. package/types/pc/utils/responsiveObserve.d.ts +8 -8
  181. package/typography/Ellipsis.js +5 -4
  182. package/typography/Operations.js +4 -3
  183. package/utils/dayjs.js +13 -11
  184. package/utils/index.js +245 -244
  185. package/utils/is.js +65 -66
  186. package/utils/names.js +309 -150
  187. package/utils/responsiveObserve.js +43 -36
  188. package/version/index.js +1 -1
  189. package/grid/Col-.js +0 -86
  190. package/grid/Col.js +0 -169
  191. package/grid/Row.js +0 -96
  192. package/grid/hook/useResponsiveState.js +0 -38
  193. package/statistic/Countdown.js +0 -56
  194. package/statistic/util.js +0 -33
  195. package/types/pc/grid/hook/useResponsiveState.d.ts +0 -2
  196. package/types/pc/statistic/util.d.ts +0 -1
  197. /package/types/pc/{statistic/Countdown.d.ts → countdown/index.d.ts} +0 -0
@@ -1,228 +1,279 @@
1
- import { jsxs as D, jsx as v, Fragment as ne } from "react/jsx-runtime";
2
- import { forwardRef as re, useContext as oe, useMemo as ie, useState as P, useRef as A, useCallback as se, useEffect as $ } from "react";
1
+ import { jsx as h, jsxs as H, Fragment as $e } from "react/jsx-runtime";
2
+ import { forwardRef as he, useContext as ye, useMemo as ze, useState as xe, useRef as L, useEffect as K, useImperativeHandle as ve } from "react";
3
3
  import "../config-provider/ConfigProvider.js";
4
- import ae from "../components/common/hooks/useMergeProps.js";
5
- import j from "@unicom-cloud/utils/class-name";
4
+ import "lodash/isEqualWith";
6
5
  import "../components/common/utils/is.js";
7
- import { resizeObserver as le } from "../components/common/utils/resizeObserver.js";
8
- import ce from "../config-provider/context.js";
9
- import { isNil as ue, isFunction as de } from "@unicom-cloud/utils/is";
10
- const fe = {
6
+ import "@unicom-cloud/utils/constant/keyboardCode";
7
+ import "lodash/isNumber";
8
+ import "lodash/merge";
9
+ import "../components/common/utils/dom.js";
10
+ import we from "../components/common/hooks/useForceUpdate.js";
11
+ import "../components/common/hooks/useIntersectionObserver.js";
12
+ import Se from "../components/common/hooks/useMergeProps.js";
13
+ import "../components/common/utils/reactDOM.js";
14
+ import "@unicom-cloud/utils/constant";
15
+ import ke from "../components/common/hooks/useUpdateEffect.js";
16
+ import "lodash/debounce";
17
+ import M from "@unicom-cloud/utils/class-name";
18
+ import Ce from "../config-provider/context.js";
19
+ import { isString as Ie, isNumber as T, isFunction as W } from "@unicom-cloud/utils/is";
20
+ const G = {
21
+ mini: {
22
+ root: {
23
+ fontSize: "var(--pqb-font-size-body-1)",
24
+ padding: "2px"
25
+ },
26
+ option: {
27
+ size: "var(--pqb-size-mini)",
28
+ padding: `${10 + 3 * 0}px`
29
+ }
30
+ },
31
+ small: {
32
+ root: {
33
+ fontSize: "var(--pqb-font-size-body-3)",
34
+ padding: "3px"
35
+ },
36
+ option: {
37
+ size: "var(--pqb-size-small)",
38
+ padding: `${10 + 3 * 1}px`
39
+ }
40
+ },
41
+ medium: {
42
+ root: {
43
+ fontSize: "var(--pqb-font-size-body-3)",
44
+ padding: "4px"
45
+ },
46
+ option: {
47
+ size: "var(--pqb-size-medium)",
48
+ padding: `${10 + 3 * 2}px`
49
+ }
50
+ },
51
+ large: {
52
+ root: {
53
+ fontSize: "var(--pqb-font-size-body-3)",
54
+ padding: "5px"
55
+ },
56
+ option: {
57
+ size: "var(--pqb-size-large)",
58
+ padding: `${10 + 3 * 3}px`
59
+ }
60
+ }
61
+ }, Ne = {
11
62
  options: [],
12
63
  size: "medium",
13
64
  mode: "default",
14
65
  disabled: !1,
15
66
  block: !1,
67
+ split: !1,
16
68
  direction: "horizontal",
17
69
  showIndicator: !0,
70
+ keyboardSwitch: !0,
18
71
  animationDuration: 300
19
- }, pe = re(
20
- (B, p) => {
21
- const { getPrefixCls: E, componentConfig: M, rtl: F } = oe(ce), K = ae(
22
- B,
23
- fe,
24
- M?.Segmented
25
- ), {
26
- style: L,
27
- className: U,
28
- options: O = [],
29
- defaultValue: c,
30
- value: R,
31
- size: H,
32
- mode: k,
33
- disabled: m,
34
- block: T,
35
- direction: h,
36
- showIndicator: C,
37
- animationDuration: _,
38
- name: x,
39
- immediateTrigger: q,
40
- onChange: u,
41
- ...G
42
- } = K, i = ie(() => O.map((e) => typeof e == "string" ? { value: e, label: e } : e), [O]), [J, S] = P(() => c && i.some((e) => e.value === c) ? c : i[0]?.value || ""), [Q, b] = P({}), d = A(null), I = A([]), V = A(!1), r = E?.("segmented"), W = j(
43
- r,
44
- {
45
- [`${r}-block`]: T,
46
- [`${r}-disabled`]: m,
47
- [`${r}-rtl`]: F,
48
- [`${r}-${k}`]: k,
49
- [`${r}-${h}`]: h
50
- },
51
- U
52
- ), g = R !== void 0, a = g ? R : J, w = se(() => {
53
- if (!C || !d.current) {
54
- b((s) => ({ ...s, opacity: 0 }));
55
- return;
56
- }
57
- const e = i.findIndex(
58
- (s) => s?.value === a
59
- );
60
- if (e === -1) {
61
- b((s) => ({ ...s, opacity: 0 }));
62
- return;
63
- }
64
- const o = I.current[e];
65
- if (!o) {
66
- b((s) => ({ ...s, opacity: 0 }));
67
- return;
68
- }
69
- const n = d.current.getBoundingClientRect(), t = o.getBoundingClientRect(), l = h === "vertical" ? {
70
- width: t.width,
71
- // 垂直模式下宽度撑满
72
- top: t.top - n.top,
73
- height: t.height
74
- } : {
75
- width: t.width,
76
- left: t.left - n.left,
77
- height: t.height
78
- // 水平模式下高度撑满
79
- };
80
- b({
81
- ...l,
82
- opacity: 1
83
- });
84
- }, [a, i, C, h]), z = (e, o) => {
85
- o || m || (g || S(e), u?.(e));
86
- }, X = (e, o) => {
87
- if (m) return;
88
- const n = i.length;
89
- if (n === 0) return;
90
- let t = o;
91
- switch (e.key) {
92
- case "ArrowLeft":
93
- case "ArrowUp":
94
- e.preventDefault(), t = (o - 1 + n) % n;
95
- break;
96
- case "ArrowRight":
97
- case "ArrowDown":
98
- e.preventDefault(), t = (o + 1) % n;
99
- break;
100
- case "Home":
101
- e.preventDefault(), t = 0;
102
- break;
103
- case "End":
104
- e.preventDefault(), t = n - 1;
105
- break;
106
- default:
107
- return;
108
- }
109
- for (; t !== o && i[t]?.disabled; )
110
- t = (t + (e.key === "ArrowLeft" || e.key === "ArrowUp" ? -1 : 1) + n) % n;
111
- const l = i[t]?.value;
112
- l && l !== a && (z(l), I.current[t]?.focus());
72
+ };
73
+ function Oe(B, J) {
74
+ const { getPrefixCls: Q, componentConfig: X, rtl: k } = ye(Ce), f = Se(
75
+ B,
76
+ Ne,
77
+ X?.Segmented
78
+ ), {
79
+ style: Y,
80
+ className: Z,
81
+ options: C = [],
82
+ defaultValue: _,
83
+ value: ee,
84
+ size: y = "medium",
85
+ gap: I,
86
+ mode: z = "default",
87
+ disabled: u = !1,
88
+ block: N = !1,
89
+ split: oe,
90
+ direction: x = "horizontal",
91
+ showIndicator: O = !0,
92
+ keyboardSwitch: q = !0,
93
+ animationDuration: A = 300,
94
+ name: D,
95
+ immediateTrigger: te = !1,
96
+ onChange: P,
97
+ ...ie
98
+ } = f, R = we(), o = Q?.("segmented"), ne = x === "vertical", V = z === "pill", F = "value" in f, r = ze(() => C.map((e) => Ie(e) || T(e) ? { value: e, label: e } : e), [C]), [re, se] = xe(_), U = L(null), v = L([]), a = F ? ee : re, d = G[y] || G.medium;
99
+ function ae() {
100
+ let e = I;
101
+ return "gap" in f ? e = I : e = d.root.padding, e;
102
+ }
103
+ const m = ae();
104
+ function de() {
105
+ const e = {
106
+ padding: `0 ${d.option.padding}`,
107
+ height: `calc(${d.option.size} - ${d.root.padding} * 2)`
113
108
  };
114
- $(() => {
115
- if (!V.current) {
116
- V.current = !0;
117
- return;
118
- }
119
- if (!i.some((e) => e.value === a)) {
120
- const e = i[0]?.value || "";
121
- g || S(e), u?.(e);
122
- }
123
- }, [i, a, g, u]), $(() => {
124
- q && !ue(c) && de(u) && u(c);
125
- }, []), $(() => {
126
- w();
127
- }, [a, i, w]), $(() => {
128
- if (!d.current) return;
129
- const e = le(
130
- [d.current],
131
- () => {
132
- w();
133
- }
134
- );
135
- return () => {
136
- e();
137
- };
138
- }, [w]);
139
- const Y = (e, o) => {
140
- if (e.render)
141
- return e.render(e, o);
142
- const n = !e.label && !!e.icon;
143
- return /* @__PURE__ */ D(ne, { children: [
144
- e.icon && /* @__PURE__ */ v("span", { className: `${r}-option-icon`, children: e.icon }),
145
- !n && e.label && /* @__PURE__ */ v("span", { className: `${r}-option-label`, children: e.label })
146
- ] });
109
+ return V && (e.borderRadius = `calc(${e.height} / 2)`), e;
110
+ }
111
+ const b = de();
112
+ function le() {
113
+ const e = {
114
+ gap: m,
115
+ fontSize: d.root.fontSize,
116
+ padding: d.root.padding,
117
+ ...Y
147
118
  };
148
- return /* @__PURE__ */ D(
149
- "div",
119
+ if (e["--gap"] = T(m) ? `${m}px` : m, V && (e.borderRadius = `calc(${d.option.size} / 2)`), O) {
120
+ b.borderRadius && (e["--before-border-radius"] = b.borderRadius), A && (e["--before-transition-duration"] = `${A}ms`);
121
+ const i = r.findIndex((n) => n?.value === a), t = v.current[i];
122
+ t && (e["--before-width"] = `${t.offsetWidth}px`, e["--before-height"] = `${t.offsetHeight}px`, ne ? e["--before-top"] = `${t.offsetTop}px` : e["--before-left"] = `${t.offsetLeft}px`);
123
+ }
124
+ return e;
125
+ }
126
+ const pe = le();
127
+ function g(e, i, t) {
128
+ const n = t || r.find((p) => p.value === e);
129
+ F || se(e), W(P) && P(e, n);
130
+ }
131
+ function ce(e, i, t, n) {
132
+ n || u || g(e, i, t);
133
+ }
134
+ function fe(e) {
135
+ if (e.preventDefault(), !q || u)
136
+ return;
137
+ const i = r.findIndex((l) => l?.value === a);
138
+ let t = i;
139
+ const n = r.length;
140
+ switch (e.key) {
141
+ case "ArrowLeft":
142
+ case "ArrowUp":
143
+ t = (i - 1 + n) % n;
144
+ break;
145
+ case "ArrowRight":
146
+ case "ArrowDown":
147
+ t = (i + 1) % n;
148
+ break;
149
+ case "Home":
150
+ t = 0;
151
+ break;
152
+ case "End":
153
+ t = n - 1;
154
+ break;
155
+ default:
156
+ return;
157
+ }
158
+ for (; t !== i && r[t]?.disabled; ) {
159
+ const l = ["ArrowLeft", "ArrowUp"].includes(e.key) ? -1 : 1;
160
+ t = (t + l + n) % n;
161
+ }
162
+ const p = r[t], s = p?.value;
163
+ s && s !== a && (g(s, t, p), v.current[t]?.focus?.());
164
+ }
165
+ function ue(e, i, t) {
166
+ if (!e) return;
167
+ const {
168
+ style: n,
169
+ className: p,
170
+ value: s,
171
+ label: l,
172
+ icon: w,
173
+ disabled: me,
174
+ render: E,
175
+ ...be
176
+ } = e, c = s === a, $ = me || u, S = !l && !!w, ge = Object.assign(
177
+ {},
178
+ b,
179
+ S ? { padding: 0, width: b.height } : {},
180
+ n
181
+ );
182
+ return /* @__PURE__ */ H(
183
+ "button",
150
184
  {
151
- ref: (e) => {
152
- typeof p == "function" ? p(e) : p && (p.current = e), d.current = e;
185
+ ref: (j) => {
186
+ v.current[i] = j;
187
+ },
188
+ style: ge,
189
+ className: M(
190
+ `${o}-option`,
191
+ `${o}-option-size-${y}`,
192
+ `${o}-option-mode-${z}`,
193
+ `${o}-option-direction-${x}`,
194
+ {
195
+ [`${o}-option-rtl`]: k,
196
+ [`${o}-option-block`]: N,
197
+ [`${o}-option-split`]: oe,
198
+ [`${o}-option-active`]: c,
199
+ [`${o}-option-disabled`]: $
200
+ },
201
+ S ? `${o}-option-icon-only` : `${o}-option-not-icon-only`,
202
+ p
203
+ ),
204
+ disabled: $,
205
+ role: "radio",
206
+ "aria-checked": c,
207
+ "aria-disabled": $,
208
+ tabIndex: c ? 0 : -1,
209
+ onClick: (j) => {
210
+ ce(s, i, e, $);
153
211
  },
154
- ...G,
155
- style: L,
156
- className: W,
157
- role: "radiogroup",
212
+ ...be,
158
213
  children: [
159
- !Array.isArray(i) || i.length === 0 ? null : i.map((e, o) => {
160
- if (!e) return null;
161
- const {
162
- value: n,
163
- label: t,
164
- disabled: l,
165
- icon: s,
166
- render: he,
167
- ...Z
168
- } = e, f = n === a, y = l || m, ee = !t && !!s, te = [t, n, o].filter(Boolean).join("-");
169
- return /* @__PURE__ */ D(
170
- "button",
171
- {
172
- ref: (N) => I.current[o] = N,
173
- className: j(
174
- `${r}-option`,
175
- `${r}-option-${H}`,
176
- `${r}-option-${k}`,
177
- {
178
- [`${r}-option-active`]: f,
179
- [`${r}-option-disabled`]: y,
180
- [`${r}-option-icon-only`]: ee
181
- }
182
- ),
183
- onClick: () => z(n, y),
184
- onKeyDown: (N) => X(N, o),
185
- disabled: y,
186
- role: "radio",
187
- "aria-checked": f,
188
- "aria-disabled": y,
189
- tabIndex: f ? 0 : -1,
190
- ...Z,
191
- children: [
192
- x && /* @__PURE__ */ v(
193
- "input",
194
- {
195
- type: "radio",
196
- name: x,
197
- value: n,
198
- checked: f,
199
- className: `${r}-input`,
200
- tabIndex: -1,
201
- "aria-hidden": "true"
202
- }
203
- ),
204
- Y(e, f)
205
- ]
206
- },
207
- te
208
- );
209
- }),
210
- C && /* @__PURE__ */ v(
211
- "div",
214
+ !!D && /* @__PURE__ */ h(
215
+ "input",
212
216
  {
213
- className: `${r}-indicator`,
214
- style: {
215
- ...Q,
216
- transitionDuration: `${_}ms`
217
- }
217
+ type: "radio",
218
+ name: D,
219
+ value: s,
220
+ checked: c,
221
+ className: `${o}-input`,
222
+ tabIndex: -1,
223
+ "aria-hidden": "true"
218
224
  }
219
- )
225
+ ),
226
+ W(E) ? E(e, c) : /* @__PURE__ */ H($e, { children: [
227
+ w && /* @__PURE__ */ h("span", { className: `${o}-option-icon`, children: w }),
228
+ !S && /* @__PURE__ */ h("span", { className: `${o}-option-label`, children: l })
229
+ ] })
220
230
  ]
221
- }
231
+ },
232
+ `${l}-${s}-${i}`
222
233
  );
223
234
  }
224
- );
225
- pe.displayName = "Segmented";
235
+ return ke(() => {
236
+ a === void 0 || r.some((i) => i.value === a) || g(void 0);
237
+ }, [r]), K(() => {
238
+ const e = requestAnimationFrame(() => {
239
+ R();
240
+ });
241
+ return () => {
242
+ cancelAnimationFrame(e);
243
+ };
244
+ }, [R, f]), K(() => {
245
+ te && g(a);
246
+ }, []), ve(J, () => ({
247
+ dom: U.current
248
+ })), /* @__PURE__ */ h(
249
+ "div",
250
+ {
251
+ ref: U,
252
+ ...ie,
253
+ style: pe,
254
+ className: M(
255
+ o,
256
+ {
257
+ [`${o}-rtl`]: k,
258
+ [`${o}-block`]: N,
259
+ [`${o}-disabled`]: u,
260
+ [`${o}-indicator`]: O
261
+ },
262
+ `${o}-mode-${z}`,
263
+ `${o}-direction-${x}`,
264
+ `${o}-size-${y}`,
265
+ Z
266
+ ),
267
+ role: "radiogroup",
268
+ onKeyDown: q ? (e) => {
269
+ fe(e);
270
+ } : void 0,
271
+ children: r.map(ue)
272
+ }
273
+ );
274
+ }
275
+ const qe = he(Oe);
276
+ qe.displayName = "Segmented";
226
277
  export {
227
- pe as default
278
+ qe as default
228
279
  };