@linyao.tw/ui 0.0.0-snapshot.07df57

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 (169) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +85 -0
  3. package/dist/components/date-time/calendar.d.ts +20 -0
  4. package/dist/components/date-time/calendar.js +102 -0
  5. package/dist/components/date-time/calendar.js.map +1 -0
  6. package/dist/components/date-time/date-field.d.ts +11 -0
  7. package/dist/components/date-time/date-field.js +44 -0
  8. package/dist/components/date-time/date-field.js.map +1 -0
  9. package/dist/components/date-time/date-picker.d.ts +28 -0
  10. package/dist/components/date-time/date-picker.js +74 -0
  11. package/dist/components/date-time/date-picker.js.map +1 -0
  12. package/dist/components/date-time/date-range-picker.d.ts +11 -0
  13. package/dist/components/date-time/date-range-picker.js +79 -0
  14. package/dist/components/date-time/date-range-picker.js.map +1 -0
  15. package/dist/components/date-time/date-types.d.ts +110 -0
  16. package/dist/components/date-time/index.d.ts +8 -0
  17. package/dist/components/date-time/index.js +8 -0
  18. package/dist/components/date-time/shared.d.ts +25 -0
  19. package/dist/components/date-time/shared.js +53 -0
  20. package/dist/components/date-time/shared.js.map +1 -0
  21. package/dist/components/date-time/time-field.d.ts +13 -0
  22. package/dist/components/date-time/time-field.js +52 -0
  23. package/dist/components/date-time/time-field.js.map +1 -0
  24. package/dist/components/feedback/alert.d.ts +21 -0
  25. package/dist/components/feedback/alert.js +44 -0
  26. package/dist/components/feedback/alert.js.map +1 -0
  27. package/dist/components/feedback/banner.d.ts +8 -0
  28. package/dist/components/feedback/banner.js +20 -0
  29. package/dist/components/feedback/banner.js.map +1 -0
  30. package/dist/components/feedback/empty-state.d.ts +12 -0
  31. package/dist/components/feedback/empty-state.js +48 -0
  32. package/dist/components/feedback/empty-state.js.map +1 -0
  33. package/dist/components/feedback/feedback.module.js +42 -0
  34. package/dist/components/feedback/feedback.module.js.map +1 -0
  35. package/dist/components/feedback/feedback.types.d.ts +8 -0
  36. package/dist/components/feedback/feedback.types.js +24 -0
  37. package/dist/components/feedback/feedback.types.js.map +1 -0
  38. package/dist/components/feedback/index.d.ts +9 -0
  39. package/dist/components/feedback/meter.d.ts +12 -0
  40. package/dist/components/feedback/meter.js +28 -0
  41. package/dist/components/feedback/meter.js.map +1 -0
  42. package/dist/components/feedback/progress.d.ts +12 -0
  43. package/dist/components/feedback/progress.js +28 -0
  44. package/dist/components/feedback/progress.js.map +1 -0
  45. package/dist/components/feedback/skeleton.d.ts +5 -0
  46. package/dist/components/feedback/skeleton.js +18 -0
  47. package/dist/components/feedback/skeleton.js.map +1 -0
  48. package/dist/components/feedback/spinner.d.ts +23 -0
  49. package/dist/components/feedback/spinner.js +35 -0
  50. package/dist/components/feedback/spinner.js.map +1 -0
  51. package/dist/components/feedback/toast.d.ts +33 -0
  52. package/dist/components/feedback/toast.js +76 -0
  53. package/dist/components/feedback/toast.js.map +1 -0
  54. package/dist/components/forms/CodeField.d.ts +23 -0
  55. package/dist/components/forms/CodeField.js +63 -0
  56. package/dist/components/forms/CodeField.js.map +1 -0
  57. package/dist/components/forms/FileUpload.d.ts +34 -0
  58. package/dist/components/forms/FileUpload.js +319 -0
  59. package/dist/components/forms/FileUpload.js.map +1 -0
  60. package/dist/components/forms/Input.d.ts +14 -0
  61. package/dist/components/forms/Input.js +33 -0
  62. package/dist/components/forms/Input.js.map +1 -0
  63. package/dist/components/forms/NumberField.d.ts +15 -0
  64. package/dist/components/forms/NumberField.js +71 -0
  65. package/dist/components/forms/NumberField.js.map +1 -0
  66. package/dist/components/forms/OTPField.d.ts +15 -0
  67. package/dist/components/forms/OTPField.js +54 -0
  68. package/dist/components/forms/OTPField.js.map +1 -0
  69. package/dist/components/forms/TextField.d.ts +61 -0
  70. package/dist/components/forms/TextField.js +199 -0
  71. package/dist/components/forms/TextField.js.map +1 -0
  72. package/dist/components/forms/index.d.ts +7 -0
  73. package/dist/components/forms/internal.d.ts +33 -0
  74. package/dist/components/forms/internal.js +61 -0
  75. package/dist/components/forms/internal.js.map +1 -0
  76. package/dist/components/foundations/Avatar.d.ts +33 -0
  77. package/dist/components/foundations/Avatar.js +45 -0
  78. package/dist/components/foundations/Avatar.js.map +1 -0
  79. package/dist/components/foundations/Badge.d.ts +15 -0
  80. package/dist/components/foundations/Badge.js +32 -0
  81. package/dist/components/foundations/Badge.js.map +1 -0
  82. package/dist/components/foundations/Button.d.ts +18 -0
  83. package/dist/components/foundations/Button.js +47 -0
  84. package/dist/components/foundations/Button.js.map +1 -0
  85. package/dist/components/foundations/Card.d.ts +47 -0
  86. package/dist/components/foundations/Card.js +57 -0
  87. package/dist/components/foundations/Card.js.map +1 -0
  88. package/dist/components/foundations/IconButton.d.ts +25 -0
  89. package/dist/components/foundations/IconButton.js +19 -0
  90. package/dist/components/foundations/IconButton.js.map +1 -0
  91. package/dist/components/foundations/Link.d.ts +19 -0
  92. package/dist/components/foundations/Link.js +40 -0
  93. package/dist/components/foundations/Link.js.map +1 -0
  94. package/dist/components/foundations/ListCell.d.ts +68 -0
  95. package/dist/components/foundations/ListCell.js +105 -0
  96. package/dist/components/foundations/ListCell.js.map +1 -0
  97. package/dist/components/foundations/SectionHeading.d.ts +17 -0
  98. package/dist/components/foundations/SectionHeading.js +50 -0
  99. package/dist/components/foundations/SectionHeading.js.map +1 -0
  100. package/dist/components/foundations/Separator.d.ts +11 -0
  101. package/dist/components/foundations/Separator.js +21 -0
  102. package/dist/components/foundations/Separator.js.map +1 -0
  103. package/dist/components/foundations/index.d.ts +9 -0
  104. package/dist/components/foundations/shared.d.ts +5 -0
  105. package/dist/components/foundations/shared.js +8 -0
  106. package/dist/components/foundations/shared.js.map +1 -0
  107. package/dist/components/navigation-data/breadcrumb-pagination.d.ts +34 -0
  108. package/dist/components/navigation-data/breadcrumb-pagination.js +161 -0
  109. package/dist/components/navigation-data/breadcrumb-pagination.js.map +1 -0
  110. package/dist/components/navigation-data/command-palette.d.ts +35 -0
  111. package/dist/components/navigation-data/command-palette.js +151 -0
  112. package/dist/components/navigation-data/command-palette.js.map +1 -0
  113. package/dist/components/navigation-data/header-tab-bar.d.ts +23 -0
  114. package/dist/components/navigation-data/header-tab-bar.js +102 -0
  115. package/dist/components/navigation-data/header-tab-bar.js.map +1 -0
  116. package/dist/components/navigation-data/index.d.ts +7 -0
  117. package/dist/components/navigation-data/menubar-toolbar.d.ts +26 -0
  118. package/dist/components/navigation-data/menubar-toolbar.js +161 -0
  119. package/dist/components/navigation-data/menubar-toolbar.js.map +1 -0
  120. package/dist/components/navigation-data/navigation-menu.d.ts +14 -0
  121. package/dist/components/navigation-data/navigation-menu.js +87 -0
  122. package/dist/components/navigation-data/navigation-menu.js.map +1 -0
  123. package/dist/components/navigation-data/scroll-area.d.ts +6 -0
  124. package/dist/components/navigation-data/scroll-area.js +52 -0
  125. package/dist/components/navigation-data/scroll-area.js.map +1 -0
  126. package/dist/components/navigation-data/table-collection.d.ts +61 -0
  127. package/dist/components/navigation-data/table-collection.js +181 -0
  128. package/dist/components/navigation-data/table-collection.js.map +1 -0
  129. package/dist/components/navigation-data/utils.d.ts +2 -0
  130. package/dist/components/navigation-data/utils.js +11 -0
  131. package/dist/components/navigation-data/utils.js.map +1 -0
  132. package/dist/components/overlays/class-names.d.ts +6 -0
  133. package/dist/components/overlays/class-names.js +11 -0
  134. package/dist/components/overlays/class-names.js.map +1 -0
  135. package/dist/components/overlays/dialog.d.ts +98 -0
  136. package/dist/components/overlays/dialog.js +158 -0
  137. package/dist/components/overlays/dialog.js.map +1 -0
  138. package/dist/components/overlays/disclosure.d.ts +40 -0
  139. package/dist/components/overlays/disclosure.js +138 -0
  140. package/dist/components/overlays/disclosure.js.map +1 -0
  141. package/dist/components/overlays/drawer.d.ts +88 -0
  142. package/dist/components/overlays/drawer.js +192 -0
  143. package/dist/components/overlays/drawer.js.map +1 -0
  144. package/dist/components/overlays/floating.d.ts +83 -0
  145. package/dist/components/overlays/floating.js +220 -0
  146. package/dist/components/overlays/floating.js.map +1 -0
  147. package/dist/components/overlays/index.d.ts +4 -0
  148. package/dist/components/selection/classnames.d.ts +4 -0
  149. package/dist/components/selection/classnames.js +14 -0
  150. package/dist/components/selection/classnames.js.map +1 -0
  151. package/dist/components/selection/combobox.d.ts +118 -0
  152. package/dist/components/selection/combobox.js +284 -0
  153. package/dist/components/selection/combobox.js.map +1 -0
  154. package/dist/components/selection/controls.d.ts +65 -0
  155. package/dist/components/selection/controls.js +171 -0
  156. package/dist/components/selection/controls.js.map +1 -0
  157. package/dist/components/selection/index.d.ts +7 -0
  158. package/dist/components/selection/menu.d.ts +87 -0
  159. package/dist/components/selection/menu.js +157 -0
  160. package/dist/components/selection/menu.js.map +1 -0
  161. package/dist/components/selection/select.d.ts +55 -0
  162. package/dist/components/selection/select.js +138 -0
  163. package/dist/components/selection/select.js.map +1 -0
  164. package/dist/components/selection/selection.module.js +51 -0
  165. package/dist/components/selection/selection.module.js.map +1 -0
  166. package/dist/index.d.ts +7 -0
  167. package/dist/index.js +52 -0
  168. package/dist/styles.css +2 -0
  169. package/package.json +74 -0
@@ -0,0 +1,171 @@
1
+ import e from "./selection.module.js";
2
+ import { cx as t, mergeStateClassName as n } from "./classnames.js";
3
+ import { forwardRef as r, useState as i } from "react";
4
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ import { MinusIcon as c } from "@phosphor-icons/react/dist/csr/Minus";
6
+ import { CheckIcon as l } from "@phosphor-icons/react/dist/csr/Check";
7
+ import { Checkbox as u } from "@base-ui/react/checkbox";
8
+ import { CheckboxGroup as d } from "@base-ui/react/checkbox-group";
9
+ import { Radio as f } from "@base-ui/react/radio";
10
+ import { RadioGroup as p } from "@base-ui/react/radio-group";
11
+ import { Slider as m } from "@base-ui/react/slider";
12
+ import { Switch as h } from "@base-ui/react/switch";
13
+ import { Toggle as g } from "@base-ui/react/toggle";
14
+ import { ToggleGroup as _ } from "@base-ui/react/toggle-group";
15
+ //#region src/components/selection/controls.tsx
16
+ function v({ indeterminate: e = !1 }) {
17
+ return o(e ? c : l, {
18
+ "aria-hidden": "true",
19
+ weight: "bold"
20
+ });
21
+ }
22
+ var y = r(function({ children: t, className: r, indicator: i, indeterminate: a, ...c }, l) {
23
+ return /* @__PURE__ */ s(u.Root, {
24
+ ...c,
25
+ className: n(e.checkbox, r),
26
+ indeterminate: a,
27
+ ref: l,
28
+ children: [/* @__PURE__ */ o(u.Indicator, {
29
+ className: e.checkboxIndicator,
30
+ keepMounted: !0,
31
+ children: i ?? /* @__PURE__ */ o(v, { indeterminate: a ?? !1 })
32
+ }), t]
33
+ });
34
+ }), b = r(function({ className: t, ...r }, i) {
35
+ return /* @__PURE__ */ o(d, {
36
+ ...r,
37
+ className: n(e.choiceGroup, t),
38
+ ref: i
39
+ });
40
+ }), x = r(function({ description: n, label: r, wrapperClassName: i, ...a }, c) {
41
+ return /* @__PURE__ */ s("label", {
42
+ className: t(e.choiceLabel, i),
43
+ children: [/* @__PURE__ */ o(y, {
44
+ ...a,
45
+ ref: c
46
+ }), /* @__PURE__ */ s("span", {
47
+ className: e.choiceCopy,
48
+ children: [/* @__PURE__ */ o("span", {
49
+ className: e.choiceTitle,
50
+ children: r
51
+ }), n ? /* @__PURE__ */ o("span", {
52
+ className: e.choiceDescription,
53
+ children: n
54
+ }) : null]
55
+ })]
56
+ });
57
+ }), S = r(function({ className: t, ...r }, i) {
58
+ return /* @__PURE__ */ o(p, {
59
+ ...r,
60
+ className: n(e.choiceGroup, t),
61
+ ref: i
62
+ });
63
+ }), C = r(function({ children: t, className: r, ...i }, a) {
64
+ return /* @__PURE__ */ s(f.Root, {
65
+ ...i,
66
+ className: n(e.radio, r),
67
+ ref: a,
68
+ children: [/* @__PURE__ */ o(f.Indicator, {
69
+ className: e.radioIndicator,
70
+ keepMounted: !0
71
+ }), t]
72
+ });
73
+ }), w = r(function({ description: n, label: r, wrapperClassName: i, ...a }, c) {
74
+ return /* @__PURE__ */ s("label", {
75
+ className: t(e.choiceLabel, i),
76
+ children: [/* @__PURE__ */ o(C, {
77
+ ...a,
78
+ ref: c
79
+ }), /* @__PURE__ */ s("span", {
80
+ className: e.choiceCopy,
81
+ children: [/* @__PURE__ */ o("span", {
82
+ className: e.choiceTitle,
83
+ children: r
84
+ }), n ? /* @__PURE__ */ o("span", {
85
+ className: e.choiceDescription,
86
+ children: n
87
+ }) : null]
88
+ })]
89
+ });
90
+ }), T = r(function({ children: t, className: r, ...i }, a) {
91
+ return /* @__PURE__ */ s(h.Root, {
92
+ ...i,
93
+ className: n(e.switch, r),
94
+ ref: a,
95
+ children: [
96
+ /* @__PURE__ */ o("span", {
97
+ "aria-hidden": "true",
98
+ className: e.switchSignal
99
+ }),
100
+ /* @__PURE__ */ o(h.Thumb, { className: e.switchThumb }),
101
+ t
102
+ ]
103
+ });
104
+ });
105
+ function E(e) {
106
+ return Array.isArray(e) ? Math.max(e.length, 1) : 1;
107
+ }
108
+ var D = r(function({ "aria-describedby": t, "aria-label": r, "aria-labelledby": i, className: a, defaultValue: c, getAriaLabel: l, getAriaValueText: u, showValue: d = !1, value: f, ...p }, h) {
109
+ let g = E(f ?? c), _ = r ? (e) => g === 1 ? r : `${r} ${e + 1}` : void 0;
110
+ return /* @__PURE__ */ s(m.Root, {
111
+ ...p,
112
+ "aria-label": r,
113
+ "aria-labelledby": i,
114
+ className: n(e.slider, a),
115
+ defaultValue: c,
116
+ ref: h,
117
+ value: f,
118
+ children: [d ? /* @__PURE__ */ o(m.Value, { className: e.sliderValue }) : null, /* @__PURE__ */ o(m.Control, {
119
+ className: e.sliderControl,
120
+ children: /* @__PURE__ */ s(m.Track, {
121
+ className: e.sliderTrack,
122
+ children: [/* @__PURE__ */ o(m.Indicator, { className: e.sliderIndicator }), Array.from({ length: g }, (n, r) => /* @__PURE__ */ o(m.Thumb, {
123
+ className: e.sliderThumb,
124
+ getAriaLabel: l ?? _,
125
+ getAriaValueText: u,
126
+ inputRef: (e) => {
127
+ e && (t && e.setAttribute("aria-describedby", t), i && !l && e.setAttribute("aria-labelledby", i));
128
+ },
129
+ index: r
130
+ }, r))]
131
+ })
132
+ })]
133
+ });
134
+ }), O = r(function({ className: n, variant: r = "standard", ...i }, a) {
135
+ return /* @__PURE__ */ o(g, {
136
+ ...i,
137
+ className: (i) => t(e.toggle, r === "quiet" && e.toggleQuiet, typeof n == "function" ? n(i) : n),
138
+ ref: a
139
+ });
140
+ }), k = r(function({ className: t, ...r }, i) {
141
+ return /* @__PURE__ */ o(_, {
142
+ ...r,
143
+ className: n(e.toggleGroup, t),
144
+ ref: i
145
+ });
146
+ }), A = r(function({ allowEmpty: t = !1, "aria-label": r, className: c, defaultValue: l = null, disabled: u = !1, name: d, onValueChange: f, size: p = "md", value: m, ...h }, g) {
147
+ let v = m !== void 0, [y, b] = i(l), x = v ? m : y;
148
+ return /* @__PURE__ */ s(a, { children: [/* @__PURE__ */ o(_, {
149
+ ...h,
150
+ "aria-label": r,
151
+ className: n(e.segmentedControl, c),
152
+ "data-size": p,
153
+ disabled: u,
154
+ multiple: !1,
155
+ onValueChange: (e, n) => {
156
+ let r = e[0] ?? null;
157
+ !t && r === null || (f?.(r, n), !n.isCanceled && (v || b(r)));
158
+ },
159
+ ref: g,
160
+ value: x === null ? [] : [x]
161
+ }), d ? /* @__PURE__ */ o("input", {
162
+ disabled: u,
163
+ name: d,
164
+ type: "hidden",
165
+ value: x ?? ""
166
+ }) : null] });
167
+ }), j = O;
168
+ //#endregion
169
+ export { y as Checkbox, b as CheckboxGroup, x as CheckboxItem, C as Radio, S as RadioGroup, w as RadioItem, A as SegmentedControl, j as SegmentedControlItem, D as Slider, T as Switch, O as Toggle, k as ToggleGroup };
170
+
171
+ //# sourceMappingURL=controls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controls.js","names":[],"sources":["../../../src/components/selection/controls.tsx"],"sourcesContent":["import { Checkbox as BaseCheckbox, type CheckboxRootProps } from \"@base-ui/react/checkbox\";\nimport { CheckboxGroup as BaseCheckboxGroup, type CheckboxGroupProps as BaseCheckboxGroupProps } from \"@base-ui/react/checkbox-group\";\nimport { Radio as BaseRadio, type RadioRootProps } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup, type RadioGroupProps as BaseRadioGroupProps } from \"@base-ui/react/radio-group\";\nimport { Slider as BaseSlider, type SliderRootProps } from \"@base-ui/react/slider\";\nimport { Switch as BaseSwitch, type SwitchRootProps } from \"@base-ui/react/switch\";\nimport { Toggle as BaseToggle, type ToggleProps as BaseToggleProps } from \"@base-ui/react/toggle\";\nimport { ToggleGroup as BaseToggleGroup, type ToggleGroupProps as BaseToggleGroupProps } from \"@base-ui/react/toggle-group\";\nimport { CheckIcon } from \"@phosphor-icons/react/dist/csr/Check\";\nimport { MinusIcon } from \"@phosphor-icons/react/dist/csr/Minus\";\nimport { forwardRef, useState, type ForwardedRef, type JSX, type ReactNode, type RefAttributes } from \"react\";\n\nimport { cx, mergeStateClassName } from \"./classnames\";\nimport styles from \"./selection.module.css\";\n\nfunction CheckGlyph({ indeterminate = false }: { indeterminate?: boolean }) {\n\treturn indeterminate ? <MinusIcon aria-hidden=\"true\" weight=\"bold\" /> : <CheckIcon aria-hidden=\"true\" weight=\"bold\" />;\n}\n\nexport interface CheckboxProps extends CheckboxRootProps {\n\tindicator?: ReactNode;\n}\n\nexport const Checkbox = forwardRef<HTMLElement, CheckboxProps>(function Checkbox({ children, className, indicator, indeterminate, ...props }, ref) {\n\treturn (\n\t\t<BaseCheckbox.Root {...props} className={mergeStateClassName(styles.checkbox, className)} indeterminate={indeterminate} ref={ref}>\n\t\t\t<BaseCheckbox.Indicator className={styles.checkboxIndicator} keepMounted>\n\t\t\t\t{indicator ?? <CheckGlyph indeterminate={indeterminate ?? false} />}\n\t\t\t</BaseCheckbox.Indicator>\n\t\t\t{children}\n\t\t</BaseCheckbox.Root>\n\t);\n});\n\nexport type CheckboxGroupProps = BaseCheckboxGroupProps;\n\nexport const CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(function CheckboxGroup({ className, ...props }, ref) {\n\treturn <BaseCheckboxGroup {...props} className={mergeStateClassName(styles.choiceGroup, className)} ref={ref} />;\n});\n\nexport interface CheckboxItemProps extends CheckboxProps {\n\tlabel: ReactNode;\n\tdescription?: ReactNode;\n\twrapperClassName?: string;\n}\n\nexport const CheckboxItem = forwardRef<HTMLElement, CheckboxItemProps>(function CheckboxItem({ description, label, wrapperClassName, ...props }, ref) {\n\treturn (\n\t\t<label className={cx(styles.choiceLabel, wrapperClassName)}>\n\t\t\t<Checkbox {...props} ref={ref} />\n\t\t\t<span className={styles.choiceCopy}>\n\t\t\t\t<span className={styles.choiceTitle}>{label}</span>\n\t\t\t\t{description ? <span className={styles.choiceDescription}>{description}</span> : null}\n\t\t\t</span>\n\t\t</label>\n\t);\n});\n\nexport type RadioGroupProps<Value = string> = BaseRadioGroupProps<Value>;\n\ntype RadioGroupComponent = <Value = string>(props: RadioGroupProps<Value> & RefAttributes<HTMLDivElement>) => JSX.Element;\n\nexport const RadioGroup = forwardRef(function RadioGroup<Value = string>({ className, ...props }: RadioGroupProps<Value>, ref: ForwardedRef<HTMLDivElement>) {\n\treturn <BaseRadioGroup {...props} className={mergeStateClassName(styles.choiceGroup, className)} ref={ref} />;\n}) as RadioGroupComponent;\n\nexport type RadioProps<Value = string> = RadioRootProps<Value>;\n\ntype RadioComponent = <Value = string>(props: RadioProps<Value> & RefAttributes<HTMLElement>) => JSX.Element;\n\nexport const Radio = forwardRef(function Radio<Value = string>({ children, className, ...props }: RadioProps<Value>, ref: ForwardedRef<HTMLElement>) {\n\treturn (\n\t\t<BaseRadio.Root {...props} className={mergeStateClassName(styles.radio, className)} ref={ref}>\n\t\t\t<BaseRadio.Indicator className={styles.radioIndicator} keepMounted />\n\t\t\t{children}\n\t\t</BaseRadio.Root>\n\t);\n}) as RadioComponent;\n\nexport interface RadioItemProps<Value = string> extends RadioProps<Value> {\n\tlabel: ReactNode;\n\tdescription?: ReactNode;\n\twrapperClassName?: string;\n}\n\ntype RadioItemComponent = <Value = string>(props: RadioItemProps<Value> & RefAttributes<HTMLElement>) => JSX.Element;\n\nexport const RadioItem = forwardRef(function RadioItem<Value = string>({ description, label, wrapperClassName, ...props }: RadioItemProps<Value>, ref: ForwardedRef<HTMLElement>) {\n\treturn (\n\t\t<label className={cx(styles.choiceLabel, wrapperClassName)}>\n\t\t\t<Radio {...props} ref={ref} />\n\t\t\t<span className={styles.choiceCopy}>\n\t\t\t\t<span className={styles.choiceTitle}>{label}</span>\n\t\t\t\t{description ? <span className={styles.choiceDescription}>{description}</span> : null}\n\t\t\t</span>\n\t\t</label>\n\t);\n}) as RadioItemComponent;\n\nexport interface SwitchProps extends SwitchRootProps {\n\tchildren?: ReactNode;\n}\n\nexport const Switch = forwardRef<HTMLElement, SwitchProps>(function Switch({ children, className, ...props }, ref) {\n\treturn (\n\t\t<BaseSwitch.Root {...props} className={mergeStateClassName(styles.switch, className)} ref={ref}>\n\t\t\t<span aria-hidden=\"true\" className={styles.switchSignal} />\n\t\t\t<BaseSwitch.Thumb className={styles.switchThumb} />\n\t\t\t{children}\n\t\t</BaseSwitch.Root>\n\t);\n});\n\nexport interface SliderProps<Value extends number | readonly number[] = number> extends SliderRootProps<Value> {\n\tgetAriaLabel?: (index: number) => string;\n\tgetAriaValueText?: (formattedValue: string, value: number, index: number) => string;\n\tshowValue?: boolean;\n}\n\ntype SliderComponent = <Value extends number | readonly number[] = number>(props: SliderProps<Value> & RefAttributes<HTMLDivElement>) => JSX.Element;\n\nfunction getThumbCount(value: number | readonly number[] | undefined): number {\n\treturn Array.isArray(value) ? Math.max(value.length, 1) : 1;\n}\n\nexport const Slider = forwardRef(function Slider<Value extends number | readonly number[] = number>(\n\t{\n\t\t\"aria-describedby\": ariaDescribedby,\n\t\t\"aria-label\": ariaLabel,\n\t\t\"aria-labelledby\": ariaLabelledby,\n\t\tclassName,\n\t\tdefaultValue,\n\t\tgetAriaLabel,\n\t\tgetAriaValueText,\n\t\tshowValue = false,\n\t\tvalue,\n\t\t...props\n\t}: SliderProps<Value>,\n\tref: ForwardedRef<HTMLDivElement>\n) {\n\tconst thumbCount = getThumbCount(value ?? defaultValue);\n\tconst fallbackThumbLabel = ariaLabel ? (index: number) => (thumbCount === 1 ? ariaLabel : `${ariaLabel} ${index + 1}`) : undefined;\n\n\treturn (\n\t\t<BaseSlider.Root {...props} aria-label={ariaLabel} aria-labelledby={ariaLabelledby} className={mergeStateClassName(styles.slider, className)} defaultValue={defaultValue} ref={ref} value={value}>\n\t\t\t{showValue ? <BaseSlider.Value className={styles.sliderValue} /> : null}\n\t\t\t<BaseSlider.Control className={styles.sliderControl}>\n\t\t\t\t<BaseSlider.Track className={styles.sliderTrack}>\n\t\t\t\t\t<BaseSlider.Indicator className={styles.sliderIndicator} />\n\t\t\t\t\t{Array.from({ length: thumbCount }, (_, index) => (\n\t\t\t\t\t\t<BaseSlider.Thumb\n\t\t\t\t\t\t\tclassName={styles.sliderThumb}\n\t\t\t\t\t\t\tgetAriaLabel={getAriaLabel ?? fallbackThumbLabel}\n\t\t\t\t\t\t\tgetAriaValueText={getAriaValueText}\n\t\t\t\t\t\t\tinputRef={input => {\n\t\t\t\t\t\t\t\tif (!input) return;\n\t\t\t\t\t\t\t\tif (ariaDescribedby) input.setAttribute(\"aria-describedby\", ariaDescribedby);\n\t\t\t\t\t\t\t\tif (ariaLabelledby && !getAriaLabel) input.setAttribute(\"aria-labelledby\", ariaLabelledby);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</BaseSlider.Track>\n\t\t\t</BaseSlider.Control>\n\t\t</BaseSlider.Root>\n\t);\n}) as SliderComponent;\n\nexport interface ToggleProps<Value extends string = string> extends BaseToggleProps<Value> {\n\tvariant?: \"standard\" | \"quiet\";\n}\n\ntype ToggleComponent = <Value extends string = string>(props: ToggleProps<Value> & RefAttributes<HTMLButtonElement>) => JSX.Element;\n\nexport const Toggle = forwardRef(function Toggle<Value extends string = string>({ className, variant = \"standard\", ...props }: ToggleProps<Value>, ref: ForwardedRef<HTMLButtonElement>) {\n\treturn <BaseToggle {...props} className={state => cx(styles.toggle, variant === \"quiet\" && styles.toggleQuiet, typeof className === \"function\" ? className(state) : className)} ref={ref} />;\n}) as ToggleComponent;\n\nexport type ToggleGroupProps<Value extends string = string> = BaseToggleGroupProps<Value>;\n\ntype ToggleGroupComponent = <Value extends string = string>(props: ToggleGroupProps<Value> & RefAttributes<HTMLDivElement>) => JSX.Element;\n\nexport const ToggleGroup = forwardRef(function ToggleGroup<Value extends string = string>({ className, ...props }: ToggleGroupProps<Value>, ref: ForwardedRef<HTMLDivElement>) {\n\treturn <BaseToggleGroup {...props} className={mergeStateClassName(styles.toggleGroup, className)} ref={ref} />;\n}) as ToggleGroupComponent;\n\nexport interface SegmentedControlProps<Value extends string = string> extends Omit<BaseToggleGroupProps<Value>, \"aria-readonly\" | \"defaultValue\" | \"multiple\" | \"onValueChange\" | \"value\"> {\n\tallowEmpty?: boolean;\n\tdefaultValue?: Value | null;\n\tname?: string;\n\tonValueChange?: (value: Value | null, details: BaseToggleGroup.ChangeEventDetails) => void;\n\tsize?: \"sm\" | \"md\";\n\tvalue?: Value | null;\n}\n\ntype SegmentedControlComponent = <Value extends string = string>(props: SegmentedControlProps<Value> & RefAttributes<HTMLDivElement>) => JSX.Element;\n\nexport const SegmentedControl = forwardRef(function SegmentedControl<Value extends string = string>(\n\t{ allowEmpty = false, \"aria-label\": ariaLabel, className, defaultValue = null, disabled = false, name, onValueChange, size = \"md\", value, ...props }: SegmentedControlProps<Value>,\n\tref: ForwardedRef<HTMLDivElement>\n) {\n\tconst controlled = value !== undefined;\n\tconst [internalValue, setInternalValue] = useState<Value | null>(defaultValue);\n\tconst currentValue = controlled ? value : internalValue;\n\n\treturn (\n\t\t<>\n\t\t\t<BaseToggleGroup\n\t\t\t\t{...props}\n\t\t\t\taria-label={ariaLabel}\n\t\t\t\tclassName={mergeStateClassName(styles.segmentedControl, className)}\n\t\t\t\tdata-size={size}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tmultiple={false}\n\t\t\t\tonValueChange={(nextValues, details) => {\n\t\t\t\t\tconst nextValue = nextValues[0] ?? null;\n\t\t\t\t\tif (!allowEmpty && nextValue === null) return;\n\t\t\t\t\tonValueChange?.(nextValue, details);\n\t\t\t\t\tif (details.isCanceled) return;\n\t\t\t\t\tif (!controlled) setInternalValue(nextValue);\n\t\t\t\t}}\n\t\t\t\tref={ref}\n\t\t\t\tvalue={currentValue === null ? [] : [currentValue]}\n\t\t\t/>\n\t\t\t{name ? <input disabled={disabled} name={name} type=\"hidden\" value={currentValue ?? \"\"} /> : null}\n\t\t</>\n\t);\n}) as SegmentedControlComponent;\n\nexport const SegmentedControlItem = Toggle;\n"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAS,EAAW,EAAE,mBAAgB,MAAsC;CAC3E,OAAuB,EAAhB,IAAiB,IAAiD,GAAlD;EAAW,eAAY;EAAO,QAAO;CAAQ,CAAiD;AACtH;AAMA,IAAa,IAAW,EAAuC,SAAkB,EAAE,aAAU,cAAW,cAAW,kBAAe,GAAG,KAAS,GAAK;CAClJ,OACC,kBAAC,EAAa,MAAd;EAAmB,GAAI;EAAO,WAAW,EAAoB,EAAO,UAAU,CAAS;EAAkB;EAAoB;EAA7H,UAAA,CACC,kBAAC,EAAa,WAAd;GAAwB,WAAW,EAAO;GAAmB,aAAA;GAC3D,UAAA,KAAa,kBAAC,GAAD,EAAY,eAAe,KAAiB,GAAQ,CAAA;EAC3C,CAAA,GACvB,CACiB;;AAErB,CAAC,GAIY,IAAgB,EAA+C,SAAuB,EAAE,cAAW,GAAG,KAAS,GAAK;CAChI,OAAO,kBAAC,GAAD;EAAmB,GAAI;EAAO,WAAW,EAAoB,EAAO,aAAa,CAAS;EAAQ;CAAM,CAAA;AAChH,CAAC,GAQY,IAAe,EAA2C,SAAsB,EAAE,gBAAa,UAAO,qBAAkB,GAAG,KAAS,GAAK;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1,7 @@
1
+ export { Autocomplete, AutocompleteInputGroup, AutocompleteItem, Combobox, ComboboxClear, ComboboxEmpty, ComboboxInput, ComboboxInputGroup, ComboboxItem, ComboboxItemIndicator, ComboboxList, ComboboxPopup, ComboboxPositioner, ComboboxTrigger } from './combobox.js';
2
+ export type { AutocompleteOption, AutocompleteProps, ComboboxOption, ComboboxProps } from './combobox.js';
3
+ export { Checkbox, CheckboxGroup, CheckboxItem, Radio, RadioGroup, RadioItem, SegmentedControl, SegmentedControlItem, Slider, Switch, Toggle, ToggleGroup } from './controls.js';
4
+ export type { CheckboxGroupProps, CheckboxItemProps, CheckboxProps, RadioGroupProps, RadioItemProps, RadioProps, SegmentedControlProps, SliderProps, SwitchProps, ToggleGroupProps, ToggleProps } from './controls.js';
5
+ export { ContextMenu, ContextMenuTrigger, DropdownMenu, Menu, MenuCheckboxItem, MenuCheckboxItemIndicator, MenuGroupLabel, MenuItem, MenuLinkItem, MenuPopup, MenuPositioner, MenuRadioItem, MenuRadioItemIndicator, MenuSeparator, MenuSubmenuTrigger, MenuTrigger } from './menu.js';
6
+ export { Select, SelectGroupLabel, SelectItem, SelectItemIndicator, SelectItemText, SelectList, SelectPopup, SelectPositioner, SelectSeparator, SelectTrigger, SelectValue } from './select.js';
7
+ export type { SelectOption, SelectProps } from './select.js';
@@ -0,0 +1,87 @@
1
+ import { ContextMenu as BaseContextMenu, ContextMenuTriggerProps } from '@base-ui/react/context-menu';
2
+ import { Menu as BaseMenu, MenuCheckboxItemIndicatorProps, MenuCheckboxItemProps, MenuGroupLabelProps, MenuItemProps, MenuLinkItemProps, MenuPopupProps, MenuPositionerProps, MenuRadioItemIndicatorProps, MenuRadioItemProps, MenuSubmenuTriggerProps, MenuTriggerProps } from '@base-ui/react/menu';
3
+ import { SeparatorProps } from '@base-ui/react/separator';
4
+ export declare const MenuTrigger: import('react').ForwardRefExoticComponent<Omit<MenuTriggerProps<unknown>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
5
+ export declare const MenuPositioner: import('react').ForwardRefExoticComponent<Omit<MenuPositionerProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
6
+ export declare const MenuPopup: import('react').ForwardRefExoticComponent<Omit<MenuPopupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
7
+ export declare const MenuItem: import('react').ForwardRefExoticComponent<Omit<MenuItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
8
+ export declare const MenuLinkItem: import('react').ForwardRefExoticComponent<Omit<MenuLinkItemProps, "ref"> & import('react').RefAttributes<HTMLAnchorElement>>;
9
+ export declare const MenuCheckboxItem: import('react').ForwardRefExoticComponent<Omit<MenuCheckboxItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
10
+ export declare const MenuCheckboxItemIndicator: import('react').ForwardRefExoticComponent<Omit<MenuCheckboxItemIndicatorProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
11
+ export declare const MenuRadioItem: import('react').ForwardRefExoticComponent<Omit<MenuRadioItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
12
+ export declare const MenuRadioItemIndicator: import('react').ForwardRefExoticComponent<Omit<MenuRadioItemIndicatorProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
13
+ export declare const MenuGroupLabel: import('react').ForwardRefExoticComponent<Omit<MenuGroupLabelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
14
+ export declare const MenuSeparator: import('react').ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
15
+ export declare const MenuSubmenuTrigger: import('react').ForwardRefExoticComponent<Omit<MenuSubmenuTriggerProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
16
+ /** 由按鈕觸發的應用程式選單。 */
17
+ export declare const DropdownMenu: {
18
+ readonly Arrow: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ContextMenuArrowProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
19
+ readonly Backdrop: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ContextMenuBackdropProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
20
+ readonly CheckboxItem: import('react').ForwardRefExoticComponent<Omit<MenuCheckboxItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
21
+ readonly CheckboxItemIndicator: import('react').ForwardRefExoticComponent<Omit<MenuCheckboxItemIndicatorProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
22
+ readonly Group: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ContextMenuGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
23
+ readonly GroupLabel: import('react').ForwardRefExoticComponent<Omit<MenuGroupLabelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
24
+ readonly Handle: typeof BaseMenu.Handle;
25
+ readonly Item: import('react').ForwardRefExoticComponent<Omit<MenuItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
26
+ readonly LinkItem: import('react').ForwardRefExoticComponent<Omit<MenuLinkItemProps, "ref"> & import('react').RefAttributes<HTMLAnchorElement>>;
27
+ readonly Popup: import('react').ForwardRefExoticComponent<Omit<MenuPopupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
28
+ readonly Portal: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ContextMenuPortalProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
29
+ readonly Positioner: import('react').ForwardRefExoticComponent<Omit<MenuPositionerProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
30
+ readonly RadioGroup: import('react').NamedExoticComponent<Omit<import('@base-ui/react').ContextMenuRadioGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
31
+ readonly RadioItem: import('react').ForwardRefExoticComponent<Omit<MenuRadioItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
32
+ readonly RadioItemIndicator: import('react').ForwardRefExoticComponent<Omit<MenuRadioItemIndicatorProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
33
+ readonly Root: <Payload>(props: BaseMenu.Root.Props<Payload>) => import("react").JSX.Element;
34
+ readonly Separator: import('react').ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
35
+ readonly SubmenuRoot: typeof BaseContextMenu.SubmenuRoot;
36
+ readonly SubmenuTrigger: import('react').ForwardRefExoticComponent<Omit<MenuSubmenuTriggerProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
37
+ readonly Trigger: import('react').ForwardRefExoticComponent<Omit<MenuTriggerProps<unknown>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
38
+ readonly Viewport: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').MenuViewportProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
39
+ readonly createHandle: typeof BaseMenu.createHandle;
40
+ };
41
+ /** DropdownMenu 的別名,名稱與 Base UI 詞彙一致。 */
42
+ export declare const Menu: {
43
+ readonly Arrow: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ContextMenuArrowProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
44
+ readonly Backdrop: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ContextMenuBackdropProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
45
+ readonly CheckboxItem: import('react').ForwardRefExoticComponent<Omit<MenuCheckboxItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
46
+ readonly CheckboxItemIndicator: import('react').ForwardRefExoticComponent<Omit<MenuCheckboxItemIndicatorProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
47
+ readonly Group: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ContextMenuGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
48
+ readonly GroupLabel: import('react').ForwardRefExoticComponent<Omit<MenuGroupLabelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
49
+ readonly Handle: typeof BaseMenu.Handle;
50
+ readonly Item: import('react').ForwardRefExoticComponent<Omit<MenuItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
51
+ readonly LinkItem: import('react').ForwardRefExoticComponent<Omit<MenuLinkItemProps, "ref"> & import('react').RefAttributes<HTMLAnchorElement>>;
52
+ readonly Popup: import('react').ForwardRefExoticComponent<Omit<MenuPopupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
53
+ readonly Portal: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ContextMenuPortalProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
54
+ readonly Positioner: import('react').ForwardRefExoticComponent<Omit<MenuPositionerProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
55
+ readonly RadioGroup: import('react').NamedExoticComponent<Omit<import('@base-ui/react').ContextMenuRadioGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
56
+ readonly RadioItem: import('react').ForwardRefExoticComponent<Omit<MenuRadioItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
57
+ readonly RadioItemIndicator: import('react').ForwardRefExoticComponent<Omit<MenuRadioItemIndicatorProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
58
+ readonly Root: <Payload>(props: BaseMenu.Root.Props<Payload>) => import("react").JSX.Element;
59
+ readonly Separator: import('react').ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
60
+ readonly SubmenuRoot: typeof BaseContextMenu.SubmenuRoot;
61
+ readonly SubmenuTrigger: import('react').ForwardRefExoticComponent<Omit<MenuSubmenuTriggerProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
62
+ readonly Trigger: import('react').ForwardRefExoticComponent<Omit<MenuTriggerProps<unknown>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
63
+ readonly Viewport: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').MenuViewportProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
64
+ readonly createHandle: typeof BaseMenu.createHandle;
65
+ };
66
+ export declare const ContextMenuTrigger: import('react').ForwardRefExoticComponent<Omit<ContextMenuTriggerProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
67
+ export declare const ContextMenu: {
68
+ readonly Arrow: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ContextMenuArrowProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
69
+ readonly Backdrop: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ContextMenuBackdropProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
70
+ readonly CheckboxItem: import('react').ForwardRefExoticComponent<Omit<MenuCheckboxItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
71
+ readonly CheckboxItemIndicator: import('react').ForwardRefExoticComponent<Omit<MenuCheckboxItemIndicatorProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
72
+ readonly Group: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ContextMenuGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
73
+ readonly GroupLabel: import('react').ForwardRefExoticComponent<Omit<MenuGroupLabelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
74
+ readonly Item: import('react').ForwardRefExoticComponent<Omit<MenuItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
75
+ readonly LinkItem: import('react').ForwardRefExoticComponent<Omit<MenuLinkItemProps, "ref"> & import('react').RefAttributes<HTMLAnchorElement>>;
76
+ readonly Popup: import('react').ForwardRefExoticComponent<Omit<MenuPopupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
77
+ readonly Portal: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').ContextMenuPortalProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
78
+ readonly Positioner: import('react').ForwardRefExoticComponent<Omit<MenuPositionerProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
79
+ readonly RadioGroup: import('react').NamedExoticComponent<Omit<import('@base-ui/react').ContextMenuRadioGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
80
+ readonly RadioItem: import('react').ForwardRefExoticComponent<Omit<MenuRadioItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
81
+ readonly RadioItemIndicator: import('react').ForwardRefExoticComponent<Omit<MenuRadioItemIndicatorProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
82
+ readonly Root: typeof BaseContextMenu.Root;
83
+ readonly Separator: import('react').ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
84
+ readonly SubmenuRoot: typeof BaseContextMenu.SubmenuRoot;
85
+ readonly SubmenuTrigger: import('react').ForwardRefExoticComponent<Omit<MenuSubmenuTriggerProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
86
+ readonly Trigger: import('react').ForwardRefExoticComponent<Omit<ContextMenuTriggerProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
87
+ };
@@ -0,0 +1,157 @@
1
+ import e from "./selection.module.js";
2
+ import { mergeStateClassName as t } from "./classnames.js";
3
+ import { forwardRef as n } from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import { Separator as i } from "@base-ui/react/separator";
6
+ import { CheckIcon as a } from "@phosphor-icons/react/dist/csr/Check";
7
+ import { Menu as o } from "@base-ui/react/menu";
8
+ import { ContextMenu as s } from "@base-ui/react/context-menu";
9
+ //#region src/components/selection/menu.tsx
10
+ var c = n(function({ className: n, ...i }, a) {
11
+ return /* @__PURE__ */ r(o.Trigger, {
12
+ ...i,
13
+ className: t(e.menuTrigger, n),
14
+ ref: a
15
+ });
16
+ }), l = n(function({ className: n, ...i }, a) {
17
+ return /* @__PURE__ */ r(o.Positioner, {
18
+ ...i,
19
+ className: t(e.positioner, n),
20
+ ref: a
21
+ });
22
+ }), u = n(function({ className: n, ...i }, a) {
23
+ return /* @__PURE__ */ r(o.Popup, {
24
+ ...i,
25
+ className: t(e.menuPopup, n),
26
+ ref: a
27
+ });
28
+ }), d = n(function({ className: n, ...i }, a) {
29
+ return /* @__PURE__ */ r(o.Item, {
30
+ ...i,
31
+ className: t(e.menuItem, n),
32
+ ref: a
33
+ });
34
+ }), f = n(function({ className: n, ...i }, a) {
35
+ return /* @__PURE__ */ r(o.LinkItem, {
36
+ ...i,
37
+ className: t(e.menuItem, n),
38
+ ref: a
39
+ });
40
+ }), p = n(function({ className: n, ...i }, a) {
41
+ return /* @__PURE__ */ r(o.CheckboxItem, {
42
+ ...i,
43
+ className: t(e.menuItem, n),
44
+ ref: a
45
+ });
46
+ }), m = n(function({ children: n, className: i, ...s }, c) {
47
+ return /* @__PURE__ */ r(o.CheckboxItemIndicator, {
48
+ ...s,
49
+ className: t(e.menuItemIndicator, i),
50
+ ref: c,
51
+ children: n ?? /* @__PURE__ */ r(a, {
52
+ "aria-hidden": "true",
53
+ weight: "bold"
54
+ })
55
+ });
56
+ }), h = n(function({ className: n, ...i }, a) {
57
+ return /* @__PURE__ */ r(o.RadioItem, {
58
+ ...i,
59
+ className: t(e.menuItem, n),
60
+ ref: a
61
+ });
62
+ }), g = n(function({ children: n, className: i, ...s }, c) {
63
+ return /* @__PURE__ */ r(o.RadioItemIndicator, {
64
+ ...s,
65
+ className: t(e.menuItemIndicator, i),
66
+ ref: c,
67
+ children: n ?? /* @__PURE__ */ r(a, {
68
+ "aria-hidden": "true",
69
+ "data-lyds-glyph": "check",
70
+ weight: "bold"
71
+ })
72
+ });
73
+ }), _ = n(function({ className: n, ...i }, a) {
74
+ return /* @__PURE__ */ r(o.GroupLabel, {
75
+ ...i,
76
+ className: t(e.groupLabel, n),
77
+ ref: a
78
+ });
79
+ }), v = n(function({ className: n, ...a }, o) {
80
+ return /* @__PURE__ */ r(i, {
81
+ ...a,
82
+ className: t(e.separator, n),
83
+ ref: o
84
+ });
85
+ }), y = n(function({ className: n, ...i }, a) {
86
+ return /* @__PURE__ */ r(o.SubmenuTrigger, {
87
+ ...i,
88
+ className: t(e.menuItem, n),
89
+ ref: a
90
+ });
91
+ }), b = {
92
+ Arrow: o.Arrow,
93
+ Backdrop: o.Backdrop,
94
+ CheckboxItem: p,
95
+ CheckboxItemIndicator: m,
96
+ Group: o.Group,
97
+ GroupLabel: _,
98
+ Handle: o.Handle,
99
+ Item: d,
100
+ LinkItem: f,
101
+ Popup: u,
102
+ Portal: o.Portal,
103
+ Positioner: l,
104
+ RadioGroup: o.RadioGroup,
105
+ RadioItem: h,
106
+ RadioItemIndicator: g,
107
+ Root: o.Root,
108
+ Separator: v,
109
+ SubmenuRoot: o.SubmenuRoot,
110
+ SubmenuTrigger: y,
111
+ Trigger: c,
112
+ Viewport: o.Viewport,
113
+ createHandle: o.createHandle
114
+ }, x = b, S = b, C = n(function({ className: n, onKeyDown: i, ...a }, o) {
115
+ let c = (e) => {
116
+ if (i?.(e), e.defaultPrevented || e.key !== "F10" || !e.shiftKey) return;
117
+ e.preventDefault();
118
+ let t = e.currentTarget, n = t.getBoundingClientRect();
119
+ t.dispatchEvent(new globalThis.MouseEvent("contextmenu", {
120
+ bubbles: !0,
121
+ button: 2,
122
+ cancelable: !0,
123
+ clientX: n.left + n.width / 2,
124
+ clientY: n.top + n.height / 2
125
+ }));
126
+ };
127
+ return /* @__PURE__ */ r(s.Trigger, {
128
+ ...a,
129
+ className: t(e.contextTrigger, n),
130
+ ref: o,
131
+ onKeyDown: c
132
+ });
133
+ }), w = {
134
+ Arrow: s.Arrow,
135
+ Backdrop: s.Backdrop,
136
+ CheckboxItem: p,
137
+ CheckboxItemIndicator: m,
138
+ Group: s.Group,
139
+ GroupLabel: _,
140
+ Item: d,
141
+ LinkItem: f,
142
+ Popup: u,
143
+ Portal: s.Portal,
144
+ Positioner: l,
145
+ RadioGroup: s.RadioGroup,
146
+ RadioItem: h,
147
+ RadioItemIndicator: g,
148
+ Root: s.Root,
149
+ Separator: v,
150
+ SubmenuRoot: s.SubmenuRoot,
151
+ SubmenuTrigger: y,
152
+ Trigger: C
153
+ };
154
+ //#endregion
155
+ export { w as ContextMenu, C as ContextMenuTrigger, x as DropdownMenu, S as Menu, p as MenuCheckboxItem, m as MenuCheckboxItemIndicator, _ as MenuGroupLabel, d as MenuItem, f as MenuLinkItem, u as MenuPopup, l as MenuPositioner, h as MenuRadioItem, g as MenuRadioItemIndicator, v as MenuSeparator, y as MenuSubmenuTrigger, c as MenuTrigger };
156
+
157
+ //# sourceMappingURL=menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu.js","names":[],"sources":["../../../src/components/selection/menu.tsx"],"sourcesContent":["import { ContextMenu as BaseContextMenu, type ContextMenuTriggerProps } from \"@base-ui/react/context-menu\";\nimport {\n\tMenu as BaseMenu,\n\ttype MenuCheckboxItemIndicatorProps,\n\ttype MenuCheckboxItemProps,\n\ttype MenuGroupLabelProps,\n\ttype MenuItemProps,\n\ttype MenuLinkItemProps,\n\ttype MenuPopupProps,\n\ttype MenuPositionerProps,\n\ttype MenuRadioItemIndicatorProps,\n\ttype MenuRadioItemProps,\n\ttype MenuSubmenuTriggerProps,\n\ttype MenuTriggerProps\n} from \"@base-ui/react/menu\";\nimport { Separator as BaseSeparator, type SeparatorProps } from \"@base-ui/react/separator\";\nimport { CheckIcon } from \"@phosphor-icons/react/dist/csr/Check\";\nimport { forwardRef } from \"react\";\n\nimport { mergeStateClassName } from \"./classnames\";\nimport styles from \"./selection.module.css\";\n\nexport const MenuTrigger = forwardRef<HTMLButtonElement, MenuTriggerProps>(function MenuTrigger({ className, ...props }, ref) {\n\treturn <BaseMenu.Trigger {...props} className={mergeStateClassName(styles.menuTrigger, className)} ref={ref} />;\n});\n\nexport const MenuPositioner = forwardRef<HTMLDivElement, MenuPositionerProps>(function MenuPositioner({ className, ...props }, ref) {\n\treturn <BaseMenu.Positioner {...props} className={mergeStateClassName(styles.positioner, className)} ref={ref} />;\n});\n\nexport const MenuPopup = forwardRef<HTMLDivElement, MenuPopupProps>(function MenuPopup({ className, ...props }, ref) {\n\treturn <BaseMenu.Popup {...props} className={mergeStateClassName(styles.menuPopup, className)} ref={ref} />;\n});\n\nexport const MenuItem = forwardRef<HTMLElement, MenuItemProps>(function MenuItem({ className, ...props }, ref) {\n\treturn <BaseMenu.Item {...props} className={mergeStateClassName(styles.menuItem, className)} ref={ref} />;\n});\n\nexport const MenuLinkItem = forwardRef<HTMLAnchorElement, MenuLinkItemProps>(function MenuLinkItem({ className, ...props }, ref) {\n\treturn <BaseMenu.LinkItem {...props} className={mergeStateClassName(styles.menuItem, className)} ref={ref} />;\n});\n\nexport const MenuCheckboxItem = forwardRef<HTMLElement, MenuCheckboxItemProps>(function MenuCheckboxItem({ className, ...props }, ref) {\n\treturn <BaseMenu.CheckboxItem {...props} className={mergeStateClassName(styles.menuItem, className)} ref={ref} />;\n});\n\nexport const MenuCheckboxItemIndicator = forwardRef<HTMLSpanElement, MenuCheckboxItemIndicatorProps>(function MenuCheckboxItemIndicator({ children, className, ...props }, ref) {\n\treturn (\n\t\t<BaseMenu.CheckboxItemIndicator {...props} className={mergeStateClassName(styles.menuItemIndicator, className)} ref={ref}>\n\t\t\t{children ?? <CheckIcon aria-hidden=\"true\" weight=\"bold\" />}\n\t\t</BaseMenu.CheckboxItemIndicator>\n\t);\n});\n\nexport const MenuRadioItem = forwardRef<HTMLElement, MenuRadioItemProps>(function MenuRadioItem({ className, ...props }, ref) {\n\treturn <BaseMenu.RadioItem {...props} className={mergeStateClassName(styles.menuItem, className)} ref={ref} />;\n});\n\nexport const MenuRadioItemIndicator = forwardRef<HTMLSpanElement, MenuRadioItemIndicatorProps>(function MenuRadioItemIndicator({ children, className, ...props }, ref) {\n\treturn (\n\t\t<BaseMenu.RadioItemIndicator {...props} className={mergeStateClassName(styles.menuItemIndicator, className)} ref={ref}>\n\t\t\t{children ?? <CheckIcon aria-hidden=\"true\" data-lyds-glyph=\"check\" weight=\"bold\" />}\n\t\t</BaseMenu.RadioItemIndicator>\n\t);\n});\n\nexport const MenuGroupLabel = forwardRef<HTMLDivElement, MenuGroupLabelProps>(function MenuGroupLabel({ className, ...props }, ref) {\n\treturn <BaseMenu.GroupLabel {...props} className={mergeStateClassName(styles.groupLabel, className)} ref={ref} />;\n});\n\nexport const MenuSeparator = forwardRef<HTMLDivElement, SeparatorProps>(function MenuSeparator({ className, ...props }, ref) {\n\treturn <BaseSeparator {...props} className={mergeStateClassName(styles.separator, className)} ref={ref} />;\n});\n\nexport const MenuSubmenuTrigger = forwardRef<HTMLElement, MenuSubmenuTriggerProps>(function MenuSubmenuTrigger({ className, ...props }, ref) {\n\treturn <BaseMenu.SubmenuTrigger {...props} className={mergeStateClassName(styles.menuItem, className)} ref={ref} />;\n});\n\nconst menuParts = {\n\tArrow: BaseMenu.Arrow,\n\tBackdrop: BaseMenu.Backdrop,\n\tCheckboxItem: MenuCheckboxItem,\n\tCheckboxItemIndicator: MenuCheckboxItemIndicator,\n\tGroup: BaseMenu.Group,\n\tGroupLabel: MenuGroupLabel,\n\tHandle: BaseMenu.Handle,\n\tItem: MenuItem,\n\tLinkItem: MenuLinkItem,\n\tPopup: MenuPopup,\n\tPortal: BaseMenu.Portal,\n\tPositioner: MenuPositioner,\n\tRadioGroup: BaseMenu.RadioGroup,\n\tRadioItem: MenuRadioItem,\n\tRadioItemIndicator: MenuRadioItemIndicator,\n\tRoot: BaseMenu.Root,\n\tSeparator: MenuSeparator,\n\tSubmenuRoot: BaseMenu.SubmenuRoot,\n\tSubmenuTrigger: MenuSubmenuTrigger,\n\tTrigger: MenuTrigger,\n\tViewport: BaseMenu.Viewport,\n\tcreateHandle: BaseMenu.createHandle\n} as const;\n\n/** 由按鈕觸發的應用程式選單。 */\nexport const DropdownMenu = menuParts;\n\n/** DropdownMenu 的別名,名稱與 Base UI 詞彙一致。 */\nexport const Menu = menuParts;\n\nexport const ContextMenuTrigger = forwardRef<HTMLDivElement, ContextMenuTriggerProps>(function ContextMenuTrigger({ className, onKeyDown, ...props }, ref) {\n\tconst handleKeyDown: NonNullable<ContextMenuTriggerProps[\"onKeyDown\"]> = event => {\n\t\tonKeyDown?.(event);\n\t\tif (event.defaultPrevented || event.key !== \"F10\" || !event.shiftKey) return;\n\n\t\tevent.preventDefault();\n\t\tconst target = event.currentTarget;\n\t\tconst bounds = target.getBoundingClientRect();\n\t\ttarget.dispatchEvent(\n\t\t\tnew globalThis.MouseEvent(\"contextmenu\", {\n\t\t\t\tbubbles: true,\n\t\t\t\tbutton: 2,\n\t\t\t\tcancelable: true,\n\t\t\t\tclientX: bounds.left + bounds.width / 2,\n\t\t\t\tclientY: bounds.top + bounds.height / 2\n\t\t\t})\n\t\t);\n\t};\n\n\treturn <BaseContextMenu.Trigger {...props} className={mergeStateClassName(styles.contextTrigger, className)} ref={ref} onKeyDown={handleKeyDown} />;\n});\n\nexport const ContextMenu = {\n\tArrow: BaseContextMenu.Arrow,\n\tBackdrop: BaseContextMenu.Backdrop,\n\tCheckboxItem: MenuCheckboxItem,\n\tCheckboxItemIndicator: MenuCheckboxItemIndicator,\n\tGroup: BaseContextMenu.Group,\n\tGroupLabel: MenuGroupLabel,\n\tItem: MenuItem,\n\tLinkItem: MenuLinkItem,\n\tPopup: MenuPopup,\n\tPortal: BaseContextMenu.Portal,\n\tPositioner: MenuPositioner,\n\tRadioGroup: BaseContextMenu.RadioGroup,\n\tRadioItem: MenuRadioItem,\n\tRadioItemIndicator: MenuRadioItemIndicator,\n\tRoot: BaseContextMenu.Root,\n\tSeparator: MenuSeparator,\n\tSubmenuRoot: BaseContextMenu.SubmenuRoot,\n\tSubmenuTrigger: MenuSubmenuTrigger,\n\tTrigger: ContextMenuTrigger\n} as const;\n"],"mappings":";;;;;;;;;AAsBA,IAAa,IAAc,EAAgD,SAAqB,EAAE,cAAW,GAAG,KAAS,GAAK;CAC7H,OAAO,kBAAC,EAAS,SAAV;EAAkB,GAAI;EAAO,WAAW,EAAoB,EAAO,aAAa,CAAS;EAAQ;CAAM,CAAA;AAC/G,CAAC,GAEY,IAAiB,EAAgD,SAAwB,EAAE,cAAW,GAAG,KAAS,GAAK;CACnI,OAAO,kBAAC,EAAS,YAAV;EAAqB,GAAI;EAAO,WAAW,EAAoB,EAAO,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EtE,EAAM,eAAe;EACrB,IAAM,IAAS,EAAM,eACf,IAAS,EAAO,sBAAsB;EAC5C,EAAO,cACN,IAAI,WAAW,WAAW,eAAe;GACxC,SAAS;GACT,QAAQ;GACR,YAAY;GACZ,SAAS,EAAO,OAAO,EAAO,QAAQ;GACtC,SAAS,EAAO,MAAM,EAAO,SAAS;EACvC,CAAC,CACF;CACD;CAEA,OAAO,kBAAC,EAAgB,SAAjB;EAAyB,GAAI;EAAO,WAAW,EAAoB,EAAO,gBAAgB,CAAS;EAAQ;EAAK,WAAW;CAAgB,CAAA;AACnJ,CAAC,GAEY,IAAc;CAC1B,OAAO,EAAgB;CACvB,UAAU,EAAgB;CAC1B,cAAc;CACd,uBAAuB;CACvB,OAAO,EAAgB;CACvB,YAAY;CACZ,MAAM;CACN,UAAU;CACV,OAAO;CACP,QAAQ,EAAgB;CACxB,YAAY;CACZ,YAAY,EAAgB;CAC5B,WAAW;CACX,oBAAoB;CACpB,MAAM,EAAgB;CACtB,WAAW;CACX,aAAa,EAAgB;CAC7B,gBAAgB;CAChB,SAAS;AACV"}
@@ -0,0 +1,55 @@
1
+ import { Select as BaseSelect, SelectGroupLabelProps, SelectItemIndicatorProps, SelectItemProps, SelectItemTextProps, SelectListProps, SelectPopupProps, SelectPositionerProps, SelectRootProps, SelectSeparatorProps, SelectTriggerProps, SelectValueProps } from '@base-ui/react/select';
2
+ import { Key, ReactNode } from 'react';
3
+ export declare const SelectTrigger: import('react').ForwardRefExoticComponent<Omit<SelectTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
4
+ export declare const SelectValue: import('react').ForwardRefExoticComponent<Omit<SelectValueProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
5
+ export declare const SelectPositioner: import('react').ForwardRefExoticComponent<Omit<SelectPositionerProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
6
+ export declare const SelectPopup: import('react').ForwardRefExoticComponent<Omit<SelectPopupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
7
+ export declare const SelectList: import('react').ForwardRefExoticComponent<Omit<SelectListProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
8
+ export declare const SelectItem: import('react').ForwardRefExoticComponent<Omit<SelectItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
9
+ export declare const SelectItemIndicator: import('react').ForwardRefExoticComponent<Omit<SelectItemIndicatorProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
10
+ export declare const SelectItemText: import('react').ForwardRefExoticComponent<Omit<SelectItemTextProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
11
+ export declare const SelectGroupLabel: import('react').ForwardRefExoticComponent<Omit<SelectGroupLabelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
12
+ export declare const SelectSeparator: import('react').ForwardRefExoticComponent<Omit<SelectSeparatorProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
13
+ export interface SelectOption<Value> {
14
+ description?: ReactNode;
15
+ disabled?: boolean;
16
+ key?: Key;
17
+ label: ReactNode;
18
+ textValue?: string;
19
+ value: Value;
20
+ }
21
+ export interface SelectProps<Value> extends Omit<SelectRootProps<Value, false>, "children" | "items" | "multiple"> {
22
+ "aria-describedby"?: string;
23
+ "aria-label"?: string;
24
+ "aria-labelledby"?: string;
25
+ className?: string;
26
+ invalid?: boolean;
27
+ options: readonly SelectOption<Value>[];
28
+ placeholder?: ReactNode;
29
+ popupProps?: SelectPopupProps;
30
+ positionerProps?: SelectPositionerProps;
31
+ triggerProps?: Omit<SelectTriggerProps, "children">;
32
+ }
33
+ declare function SelectComponent<Value>({ "aria-describedby": ariaDescribedby, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, className, invalid, options, placeholder, popupProps, positionerProps, triggerProps, ...rootProps }: SelectProps<Value>): import("react").JSX.Element;
34
+ export declare const Select: typeof SelectComponent & {
35
+ Arrow: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').SelectArrowProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
36
+ Backdrop: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').SelectBackdropProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
37
+ Group: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').SelectGroupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
38
+ GroupLabel: import('react').ForwardRefExoticComponent<Omit<SelectGroupLabelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
39
+ Icon: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').SelectIconProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
40
+ Item: import('react').ForwardRefExoticComponent<Omit<SelectItemProps, "ref"> & import('react').RefAttributes<HTMLElement>>;
41
+ ItemIndicator: import('react').ForwardRefExoticComponent<Omit<SelectItemIndicatorProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
42
+ ItemText: import('react').ForwardRefExoticComponent<Omit<SelectItemTextProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
43
+ Label: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').SelectLabelProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
44
+ List: import('react').ForwardRefExoticComponent<Omit<SelectListProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
45
+ Popup: import('react').ForwardRefExoticComponent<Omit<SelectPopupProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
46
+ Portal: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').SelectPortalProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
47
+ Positioner: import('react').ForwardRefExoticComponent<Omit<SelectPositionerProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
48
+ Root: typeof BaseSelect.Root;
49
+ ScrollDownArrow: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').SelectScrollDownArrowProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
50
+ ScrollUpArrow: import('react').ForwardRefExoticComponent<Omit<import('@base-ui/react').SelectScrollUpArrowProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
51
+ Separator: import('react').ForwardRefExoticComponent<Omit<SelectSeparatorProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
52
+ Trigger: import('react').ForwardRefExoticComponent<Omit<SelectTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
53
+ Value: import('react').ForwardRefExoticComponent<Omit<SelectValueProps, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
54
+ };
55
+ export {};