@yselimcan/ui 0.0.8 → 0.0.10

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 (266) hide show
  1. package/dist/index.js +15277 -100
  2. package/dist/styles.css +1 -1
  3. package/package.json +7 -11
  4. package/dist/index10.js +0 -137
  5. package/dist/index100.js +0 -8
  6. package/dist/index101.js +0 -10
  7. package/dist/index102.js +0 -90
  8. package/dist/index103.js +0 -15
  9. package/dist/index104.js +0 -65
  10. package/dist/index105.js +0 -40
  11. package/dist/index106.js +0 -16
  12. package/dist/index107.js +0 -35
  13. package/dist/index108.js +0 -21
  14. package/dist/index109.js +0 -8
  15. package/dist/index11.js +0 -21
  16. package/dist/index110.js +0 -6
  17. package/dist/index111.js +0 -7
  18. package/dist/index112.js +0 -14
  19. package/dist/index113.js +0 -21
  20. package/dist/index114.js +0 -15
  21. package/dist/index115.js +0 -299
  22. package/dist/index116.js +0 -7
  23. package/dist/index117.js +0 -41
  24. package/dist/index118.js +0 -128
  25. package/dist/index119.js +0 -23
  26. package/dist/index12.js +0 -20
  27. package/dist/index120.js +0 -79
  28. package/dist/index121.js +0 -67
  29. package/dist/index122.js +0 -48
  30. package/dist/index123.js +0 -16
  31. package/dist/index124.js +0 -8
  32. package/dist/index125.js +0 -32
  33. package/dist/index126.js +0 -7
  34. package/dist/index127.js +0 -30
  35. package/dist/index128.js +0 -20
  36. package/dist/index129.js +0 -24
  37. package/dist/index13.js +0 -206
  38. package/dist/index130.js +0 -61
  39. package/dist/index131.js +0 -20
  40. package/dist/index132.js +0 -30
  41. package/dist/index133.js +0 -43
  42. package/dist/index134.js +0 -45
  43. package/dist/index135.js +0 -24
  44. package/dist/index136.js +0 -51
  45. package/dist/index137.js +0 -54
  46. package/dist/index138.js +0 -20
  47. package/dist/index139.js +0 -14
  48. package/dist/index14.js +0 -24
  49. package/dist/index140.js +0 -25
  50. package/dist/index141.js +0 -38
  51. package/dist/index142.js +0 -233
  52. package/dist/index143.js +0 -286
  53. package/dist/index144.js +0 -56
  54. package/dist/index145.js +0 -18
  55. package/dist/index146.js +0 -82
  56. package/dist/index147.js +0 -6
  57. package/dist/index148.js +0 -33
  58. package/dist/index149.js +0 -26
  59. package/dist/index15.js +0 -19
  60. package/dist/index150.js +0 -18
  61. package/dist/index151.js +0 -72
  62. package/dist/index152.js +0 -6
  63. package/dist/index153.js +0 -107
  64. package/dist/index154.js +0 -82
  65. package/dist/index155.js +0 -266
  66. package/dist/index156.js +0 -14
  67. package/dist/index157.js +0 -13
  68. package/dist/index158.js +0 -43
  69. package/dist/index159.js +0 -7
  70. package/dist/index16.js +0 -8
  71. package/dist/index160.js +0 -69
  72. package/dist/index161.js +0 -12
  73. package/dist/index162.js +0 -11
  74. package/dist/index163.js +0 -8
  75. package/dist/index164.js +0 -136
  76. package/dist/index165.js +0 -56
  77. package/dist/index166.js +0 -14
  78. package/dist/index167.js +0 -120
  79. package/dist/index168.js +0 -14
  80. package/dist/index169.js +0 -14
  81. package/dist/index17.js +0 -46
  82. package/dist/index170.js +0 -69
  83. package/dist/index171.js +0 -15
  84. package/dist/index172.js +0 -15
  85. package/dist/index173.js +0 -15
  86. package/dist/index174.js +0 -14
  87. package/dist/index175.js +0 -90
  88. package/dist/index176.js +0 -14
  89. package/dist/index177.js +0 -14
  90. package/dist/index178.js +0 -59
  91. package/dist/index179.js +0 -14
  92. package/dist/index18.js +0 -41
  93. package/dist/index180.js +0 -14
  94. package/dist/index181.js +0 -21
  95. package/dist/index182.js +0 -11
  96. package/dist/index183.js +0 -11
  97. package/dist/index184.js +0 -106
  98. package/dist/index185.js +0 -10
  99. package/dist/index186.js +0 -35
  100. package/dist/index187.js +0 -77
  101. package/dist/index188.js +0 -17
  102. package/dist/index189.js +0 -31
  103. package/dist/index19.js +0 -80
  104. package/dist/index190.js +0 -15
  105. package/dist/index191.js +0 -10
  106. package/dist/index192.js +0 -25
  107. package/dist/index193.js +0 -27
  108. package/dist/index194.js +0 -163
  109. package/dist/index195.js +0 -116
  110. package/dist/index196.js +0 -78
  111. package/dist/index197.js +0 -67
  112. package/dist/index198.js +0 -11
  113. package/dist/index199.js +0 -25
  114. package/dist/index20.js +0 -25
  115. package/dist/index200.js +0 -8
  116. package/dist/index201.js +0 -6
  117. package/dist/index202.js +0 -12
  118. package/dist/index203.js +0 -41
  119. package/dist/index204.js +0 -59
  120. package/dist/index205.js +0 -30
  121. package/dist/index206.js +0 -10
  122. package/dist/index207.js +0 -15
  123. package/dist/index208.js +0 -14
  124. package/dist/index209.js +0 -14
  125. package/dist/index21.js +0 -40
  126. package/dist/index210.js +0 -24
  127. package/dist/index211.js +0 -14
  128. package/dist/index212.js +0 -10
  129. package/dist/index213.js +0 -45
  130. package/dist/index214.js +0 -599
  131. package/dist/index215.js +0 -14
  132. package/dist/index216.js +0 -19
  133. package/dist/index217.js +0 -50
  134. package/dist/index218.js +0 -202
  135. package/dist/index219.js +0 -50
  136. package/dist/index22.js +0 -31
  137. package/dist/index220.js +0 -22
  138. package/dist/index221.js +0 -35
  139. package/dist/index222.js +0 -9
  140. package/dist/index223.js +0 -29
  141. package/dist/index224.js +0 -14
  142. package/dist/index225.js +0 -24
  143. package/dist/index226.js +0 -130
  144. package/dist/index227.js +0 -47
  145. package/dist/index228.js +0 -20
  146. package/dist/index229.js +0 -7
  147. package/dist/index23.js +0 -25
  148. package/dist/index230.js +0 -183
  149. package/dist/index231.js +0 -78
  150. package/dist/index232.js +0 -401
  151. package/dist/index233.js +0 -6
  152. package/dist/index234.js +0 -7
  153. package/dist/index235.js +0 -17
  154. package/dist/index236.js +0 -23
  155. package/dist/index237.js +0 -8
  156. package/dist/index238.js +0 -211
  157. package/dist/index239.js +0 -6
  158. package/dist/index24.js +0 -56
  159. package/dist/index240.js +0 -16
  160. package/dist/index241.js +0 -50
  161. package/dist/index242.js +0 -6
  162. package/dist/index243.js +0 -15
  163. package/dist/index244.js +0 -60
  164. package/dist/index245.js +0 -32
  165. package/dist/index246.js +0 -16
  166. package/dist/index247.js +0 -11
  167. package/dist/index248.js +0 -209
  168. package/dist/index249.js +0 -17
  169. package/dist/index25.js +0 -35
  170. package/dist/index250.js +0 -324
  171. package/dist/index251.js +0 -5
  172. package/dist/index252.js +0 -5
  173. package/dist/index253.js +0 -489
  174. package/dist/index254.js +0 -10
  175. package/dist/index255.js +0 -4
  176. package/dist/index256.js +0 -46
  177. package/dist/index257.js +0 -58
  178. package/dist/index258.js +0 -10
  179. package/dist/index259.js +0 -4
  180. package/dist/index26.js +0 -7
  181. package/dist/index260.js +0 -57
  182. package/dist/index261.js +0 -58
  183. package/dist/index262.js +0 -4
  184. package/dist/index263.js +0 -4
  185. package/dist/index264.js +0 -4
  186. package/dist/index265.js +0 -4
  187. package/dist/index27.js +0 -82
  188. package/dist/index28.js +0 -32
  189. package/dist/index29.js +0 -6
  190. package/dist/index3.js +0 -181
  191. package/dist/index30.js +0 -9
  192. package/dist/index31.js +0 -6
  193. package/dist/index32.js +0 -23
  194. package/dist/index33.js +0 -207
  195. package/dist/index34.js +0 -25
  196. package/dist/index35.js +0 -102
  197. package/dist/index36.js +0 -69
  198. package/dist/index37.js +0 -66
  199. package/dist/index38.js +0 -113
  200. package/dist/index39.js +0 -53
  201. package/dist/index4.js +0 -47
  202. package/dist/index40.js +0 -35
  203. package/dist/index41.js +0 -28
  204. package/dist/index42.js +0 -18
  205. package/dist/index43.js +0 -27
  206. package/dist/index44.js +0 -25
  207. package/dist/index45.js +0 -36
  208. package/dist/index46.js +0 -78
  209. package/dist/index47.js +0 -65
  210. package/dist/index48.js +0 -128
  211. package/dist/index49.js +0 -19
  212. package/dist/index5.js +0 -52
  213. package/dist/index50.js +0 -86
  214. package/dist/index51.js +0 -6
  215. package/dist/index52.js +0 -268
  216. package/dist/index53.js +0 -25
  217. package/dist/index54.js +0 -207
  218. package/dist/index55.js +0 -146
  219. package/dist/index56.js +0 -88
  220. package/dist/index57.js +0 -29
  221. package/dist/index58.js +0 -30
  222. package/dist/index59.js +0 -48
  223. package/dist/index6.js +0 -93
  224. package/dist/index60.js +0 -79
  225. package/dist/index61.js +0 -45
  226. package/dist/index62.js +0 -46
  227. package/dist/index63.js +0 -76
  228. package/dist/index64.js +0 -45
  229. package/dist/index65.js +0 -22
  230. package/dist/index66.js +0 -101
  231. package/dist/index67.js +0 -14
  232. package/dist/index68.js +0 -6
  233. package/dist/index69.js +0 -321
  234. package/dist/index7.js +0 -294
  235. package/dist/index70.js +0 -24
  236. package/dist/index71.js +0 -143
  237. package/dist/index72.js +0 -200
  238. package/dist/index73.js +0 -43
  239. package/dist/index74.js +0 -29
  240. package/dist/index75.js +0 -148
  241. package/dist/index76.js +0 -32
  242. package/dist/index77.js +0 -53
  243. package/dist/index78.js +0 -28
  244. package/dist/index79.js +0 -15
  245. package/dist/index8.js +0 -264
  246. package/dist/index80.js +0 -15
  247. package/dist/index81.js +0 -135
  248. package/dist/index82.js +0 -31
  249. package/dist/index83.js +0 -35
  250. package/dist/index84.js +0 -17
  251. package/dist/index85.js +0 -2765
  252. package/dist/index86.js +0 -14
  253. package/dist/index87.js +0 -57
  254. package/dist/index88.js +0 -98
  255. package/dist/index89.js +0 -21
  256. package/dist/index9.js +0 -197
  257. package/dist/index90.js +0 -18
  258. package/dist/index91.js +0 -35
  259. package/dist/index92.js +0 -14
  260. package/dist/index93.js +0 -92
  261. package/dist/index94.js +0 -7
  262. package/dist/index95.js +0 -69
  263. package/dist/index96.js +0 -11
  264. package/dist/index97.js +0 -16
  265. package/dist/index98.js +0 -6
  266. package/dist/index99.js +0 -6
package/dist/index7.js DELETED
@@ -1,294 +0,0 @@
1
- "use client";
2
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
3
- import * as d from "react";
4
- import { cn as a } from "./index16.js";
5
- import { Button as u } from "./index5.js";
6
- import { InputGroup as x, InputGroupInput as f, InputGroupAddon as h, InputGroupButton as b } from "./index10.js";
7
- import g from "./index29.js";
8
- import l from "./index30.js";
9
- import C from "./index31.js";
10
- import { ComboboxRoot as v } from "./index32.js";
11
- import { ComboboxInput as p } from "./index33.js";
12
- import { ComboboxPortal as w } from "./index34.js";
13
- import { ComboboxPositioner as y } from "./index35.js";
14
- import { ComboboxPopup as N } from "./index36.js";
15
- import { ComboboxList as I } from "./index37.js";
16
- import { ComboboxItem as z } from "./index38.js";
17
- import { ComboboxItemIndicator as $ } from "./index39.js";
18
- import { ComboboxGroup as G } from "./index40.js";
19
- import { ComboboxGroupLabel as j } from "./index41.js";
20
- import { ComboboxCollection as k } from "./index42.js";
21
- import { ComboboxEmpty as L } from "./index43.js";
22
- import { Separator as R } from "./index44.js";
23
- import { ComboboxChips as _ } from "./index45.js";
24
- import { ComboboxChip as E } from "./index46.js";
25
- import { ComboboxChipRemove as P } from "./index47.js";
26
- import { ComboboxTrigger as T } from "./index48.js";
27
- import { ComboboxValue as V } from "./index49.js";
28
- import { ComboboxClear as A } from "./index50.js";
29
- const co = v;
30
- function uo({ ...o }) {
31
- return /* @__PURE__ */ t(V, { "data-slot": "combobox-value", ...o });
32
- }
33
- function B({
34
- className: o,
35
- children: e,
36
- ...r
37
- }) {
38
- return /* @__PURE__ */ i(
39
- T,
40
- {
41
- "data-slot": "combobox-trigger",
42
- className: a("[&_svg:not([class*='size-'])]:size-4", o),
43
- ...r,
44
- children: [
45
- e,
46
- /* @__PURE__ */ t(C, { className: "text-muted-foreground size-4 pointer-events-none" })
47
- ]
48
- }
49
- );
50
- }
51
- function S({ className: o, ...e }) {
52
- return /* @__PURE__ */ t(
53
- A,
54
- {
55
- "data-slot": "combobox-clear",
56
- render: /* @__PURE__ */ t(b, { variant: "ghost", size: "icon-xs" }),
57
- className: a(o),
58
- ...e,
59
- children: /* @__PURE__ */ t(l, { className: "pointer-events-none" })
60
- }
61
- );
62
- }
63
- function xo({
64
- className: o,
65
- children: e,
66
- disabled: r = !1,
67
- showTrigger: n = !0,
68
- showClear: m = !1,
69
- ...s
70
- }) {
71
- return /* @__PURE__ */ i(x, { className: a("w-auto", o), children: [
72
- /* @__PURE__ */ t(
73
- p,
74
- {
75
- render: /* @__PURE__ */ t(f, { disabled: r }),
76
- ...s
77
- }
78
- ),
79
- /* @__PURE__ */ i(h, { align: "inline-end", children: [
80
- n && /* @__PURE__ */ t(
81
- b,
82
- {
83
- size: "icon-xs",
84
- variant: "ghost",
85
- render: /* @__PURE__ */ t(B, {}),
86
- "data-slot": "input-group-button",
87
- className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",
88
- disabled: r
89
- }
90
- ),
91
- m && /* @__PURE__ */ t(S, { disabled: r })
92
- ] }),
93
- e
94
- ] });
95
- }
96
- function fo({
97
- className: o,
98
- side: e = "bottom",
99
- sideOffset: r = 6,
100
- align: n = "start",
101
- alignOffset: m = 0,
102
- anchor: s,
103
- ...c
104
- }) {
105
- return /* @__PURE__ */ t(w, { children: /* @__PURE__ */ t(
106
- y,
107
- {
108
- side: e,
109
- sideOffset: r,
110
- align: n,
111
- alignOffset: m,
112
- anchor: s,
113
- className: "isolate z-50",
114
- children: /* @__PURE__ */ t(
115
- N,
116
- {
117
- "data-slot": "combobox-content",
118
- "data-chips": !!s,
119
- className: a("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:border-input/30 max-h-72 min-w-36 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:shadow-none group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)", o),
120
- ...c
121
- }
122
- )
123
- }
124
- ) });
125
- }
126
- function ho({ className: o, ...e }) {
127
- return /* @__PURE__ */ t(
128
- I,
129
- {
130
- "data-slot": "combobox-list",
131
- className: a(
132
- "no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0 overflow-y-auto overscroll-contain",
133
- o
134
- ),
135
- ...e
136
- }
137
- );
138
- }
139
- function go({
140
- className: o,
141
- children: e,
142
- ...r
143
- }) {
144
- return /* @__PURE__ */ i(
145
- z,
146
- {
147
- "data-slot": "combobox-item",
148
- className: a(
149
- "data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
150
- o
151
- ),
152
- ...r,
153
- children: [
154
- e,
155
- /* @__PURE__ */ t(
156
- $,
157
- {
158
- render: /* @__PURE__ */ t("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
159
- children: /* @__PURE__ */ t(g, { className: "pointer-events-none" })
160
- }
161
- )
162
- ]
163
- }
164
- );
165
- }
166
- function Co({ className: o, ...e }) {
167
- return /* @__PURE__ */ t(
168
- G,
169
- {
170
- "data-slot": "combobox-group",
171
- className: a(o),
172
- ...e
173
- }
174
- );
175
- }
176
- function vo({
177
- className: o,
178
- ...e
179
- }) {
180
- return /* @__PURE__ */ t(
181
- j,
182
- {
183
- "data-slot": "combobox-label",
184
- className: a("text-muted-foreground px-2 py-1.5 text-xs", o),
185
- ...e
186
- }
187
- );
188
- }
189
- function wo({ ...o }) {
190
- return /* @__PURE__ */ t(k, { "data-slot": "combobox-collection", ...o });
191
- }
192
- function yo({ className: o, ...e }) {
193
- return /* @__PURE__ */ t(
194
- L,
195
- {
196
- "data-slot": "combobox-empty",
197
- className: a("text-muted-foreground hidden w-full justify-center py-2 text-center text-sm group-data-empty/combobox-content:flex", o),
198
- ...e
199
- }
200
- );
201
- }
202
- function No({
203
- className: o,
204
- ...e
205
- }) {
206
- return /* @__PURE__ */ t(
207
- R,
208
- {
209
- "data-slot": "combobox-separator",
210
- className: a("bg-border -mx-1 my-1 h-px", o),
211
- ...e
212
- }
213
- );
214
- }
215
- function Io({
216
- className: o,
217
- ...e
218
- }) {
219
- return /* @__PURE__ */ t(
220
- _,
221
- {
222
- "data-slot": "combobox-chips",
223
- className: a("dark:bg-input/30 border-input focus-within:border-ring focus-within:ring-ring/50 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 has-aria-invalid:border-destructive dark:has-aria-invalid:border-destructive/50 flex min-h-8 flex-wrap items-center gap-1 rounded-lg border bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:ring-[3px] has-aria-invalid:ring-[3px] has-data-[slot=combobox-chip]:px-1", o),
224
- ...e
225
- }
226
- );
227
- }
228
- function zo({
229
- className: o,
230
- children: e,
231
- showRemove: r = !0,
232
- ...n
233
- }) {
234
- return /* @__PURE__ */ i(
235
- E,
236
- {
237
- "data-slot": "combobox-chip",
238
- className: a(
239
- "bg-muted text-foreground flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm px-1.5 text-xs font-medium whitespace-nowrap has-data-[slot=combobox-chip-remove]:pr-0 has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50",
240
- o
241
- ),
242
- ...n,
243
- children: [
244
- e,
245
- r && /* @__PURE__ */ t(
246
- P,
247
- {
248
- render: /* @__PURE__ */ t(u, { variant: "ghost", size: "icon-xs" }),
249
- className: "-ml-1 opacity-50 hover:opacity-100",
250
- "data-slot": "combobox-chip-remove",
251
- children: /* @__PURE__ */ t(l, { className: "pointer-events-none" })
252
- }
253
- )
254
- ]
255
- }
256
- );
257
- }
258
- function $o({
259
- className: o,
260
- ...e
261
- }) {
262
- return /* @__PURE__ */ t(
263
- p,
264
- {
265
- "data-slot": "combobox-chip-input",
266
- className: a(
267
- "min-w-16 flex-1 outline-none",
268
- o
269
- ),
270
- ...e
271
- }
272
- );
273
- }
274
- function Go() {
275
- return d.useRef(null);
276
- }
277
- export {
278
- co as Combobox,
279
- zo as ComboboxChip,
280
- Io as ComboboxChips,
281
- $o as ComboboxChipsInput,
282
- wo as ComboboxCollection,
283
- fo as ComboboxContent,
284
- yo as ComboboxEmpty,
285
- Co as ComboboxGroup,
286
- xo as ComboboxInput,
287
- go as ComboboxItem,
288
- vo as ComboboxLabel,
289
- ho as ComboboxList,
290
- No as ComboboxSeparator,
291
- B as ComboboxTrigger,
292
- uo as ComboboxValue,
293
- Go as useComboboxAnchor
294
- };
package/dist/index70.js DELETED
@@ -1,24 +0,0 @@
1
- "use client";
2
- import * as m from "react";
3
- import { SelectPortalContext as i } from "./index152.js";
4
- import { useSelectRootContext as u } from "./index129.js";
5
- import { selectors as t } from "./index134.js";
6
- import { jsx as e } from "react/jsx-runtime";
7
- import { FloatingPortal as f } from "./index118.js";
8
- import { useStore as r } from "./index145.js";
9
- const a = /* @__PURE__ */ m.forwardRef(function(n, l) {
10
- const {
11
- store: o
12
- } = u(), c = r(o, t.mounted), s = r(o, t.forceMount);
13
- return c || s ? /* @__PURE__ */ e(i.Provider, {
14
- value: !0,
15
- children: /* @__PURE__ */ e(f, {
16
- ref: l,
17
- ...n
18
- })
19
- }) : null;
20
- });
21
- process.env.NODE_ENV !== "production" && (a.displayName = "SelectPortal");
22
- export {
23
- a as SelectPortal
24
- };
package/dist/index71.js DELETED
@@ -1,143 +0,0 @@
1
- "use client";
2
- import * as o from "react";
3
- import { inertValue as ce } from "./index116.js";
4
- import { useIsoLayoutEffect as ae } from "./index126.js";
5
- import { useScrollLock as ue } from "./index153.js";
6
- import { useStableCallback as D } from "./index127.js";
7
- import { useSelectRootContext as me, useSelectFloatingContext as fe } from "./index129.js";
8
- import { CompositeList as pe } from "./index154.js";
9
- import { popupStateMapping as de } from "./index105.js";
10
- import { useAnchorPositioning as ge } from "./index155.js";
11
- import { SelectPositionerContext as he } from "./index156.js";
12
- import { InternalBackdrop as Ie } from "./index117.js";
13
- import { useRenderElement as Ae } from "./index87.js";
14
- import { DROPDOWN_COLLISION_AVOIDANCE as Re } from "./index119.js";
15
- import { clearStyles as P } from "./index157.js";
16
- import { selectors as t } from "./index134.js";
17
- import { createChangeEventDetails as Se } from "./index107.js";
18
- import { findItemIndex as ve, itemIncludes as R } from "./index138.js";
19
- import { jsx as T, jsxs as xe } from "react/jsx-runtime";
20
- import { useStore as c } from "./index145.js";
21
- import { none as Ee } from "./index108.js";
22
- const Ve = {
23
- position: "fixed"
24
- }, be = /* @__PURE__ */ o.forwardRef(function(S, O) {
25
- const {
26
- anchor: k,
27
- positionMethod: N = "absolute",
28
- className: Ce,
29
- render: ye,
30
- side: W = "bottom",
31
- align: z = "center",
32
- sideOffset: L = 0,
33
- alignOffset: H = 0,
34
- collisionBoundary: U = "clipping-ancestors",
35
- collisionPadding: _,
36
- arrowPadding: j = 5,
37
- sticky: q = !1,
38
- disableAnchorTracking: B,
39
- alignItemWithTrigger: g = !0,
40
- collisionAvoidance: F = Re,
41
- ...X
42
- } = S, {
43
- store: e,
44
- listRef: G,
45
- labelsRef: J,
46
- alignItemWithTriggerActiveRef: K,
47
- selectedItemTextRef: v,
48
- valuesRef: f,
49
- initialValueRef: Q,
50
- popupRef: Y,
51
- setValue: x
52
- } = me(), Z = fe(), a = c(e, t.open), n = c(e, t.mounted), E = c(e, t.modal), m = c(e, t.value), V = c(e, t.openMethod), $ = c(e, t.positionerElement), b = c(e, t.triggerElement), p = c(e, t.isItemEqualToValue), ee = o.useRef(null), te = o.useRef(null), [w, h] = o.useState(g), r = n && w && V !== "touch";
53
- !n && w !== g && h(g), ae(() => {
54
- n || (t.scrollUpArrowVisible(e.state) && e.set("scrollUpArrowVisible", !1), t.scrollDownArrowVisible(e.state) && e.set("scrollDownArrowVisible", !1));
55
- }, [e, n]), o.useImperativeHandle(K, () => r), ue((r || E) && a && V !== "touch", b);
56
- const i = ge({
57
- anchor: k,
58
- floatingRootContext: Z,
59
- positionMethod: N,
60
- mounted: n,
61
- side: W,
62
- sideOffset: L,
63
- align: z,
64
- alignOffset: H,
65
- arrowPadding: j,
66
- collisionBoundary: U,
67
- collisionPadding: _,
68
- sticky: q,
69
- disableAnchorTracking: B ?? r,
70
- collisionAvoidance: F,
71
- keepMounted: !0
72
- }), d = r ? "none" : i.side, C = r ? Ve : i.positionerStyles, oe = o.useMemo(() => {
73
- const s = {};
74
- return a || (s.pointerEvents = "none"), {
75
- role: "presentation",
76
- hidden: !n,
77
- style: {
78
- ...C,
79
- ...s
80
- }
81
- };
82
- }, [a, n, C]), ne = o.useMemo(() => ({
83
- open: a,
84
- side: d,
85
- align: i.align,
86
- anchorHidden: i.anchorHidden
87
- }), [a, d, i.align, i.anchorHidden]), re = D((s) => {
88
- e.set("positionerElement", s);
89
- }), ie = Ae("div", S, {
90
- ref: [O, re],
91
- state: ne,
92
- stateAttributesMapping: de,
93
- props: [oe, X]
94
- }), I = o.useRef(0), se = D((s) => {
95
- if (s.size === 0 && I.current === 0 || f.current.length === 0)
96
- return;
97
- const A = I.current;
98
- if (I.current = s.size, s.size === A)
99
- return;
100
- const y = Se(Ee);
101
- if (A !== 0 && !e.state.multiple && m !== null && ve(f.current, m, p) === -1) {
102
- const u = Q.current, M = u != null && R(f.current, u, p) ? u : null;
103
- x(M, y), M === null && (e.set("selectedIndex", null), v.current = null);
104
- }
105
- if (A !== 0 && e.state.multiple && Array.isArray(m)) {
106
- const l = m.filter((u) => R(f.current, u, p));
107
- (l.length !== m.length || l.some((u) => !R(m, u, p))) && (x(l, y), l.length === 0 && (e.set("selectedIndex", null), v.current = null));
108
- }
109
- if (a && r) {
110
- e.update({
111
- scrollUpArrowVisible: !1,
112
- scrollDownArrowVisible: !1
113
- });
114
- const l = {
115
- height: ""
116
- };
117
- P($, l), P(Y.current, l);
118
- }
119
- }), le = o.useMemo(() => ({
120
- ...i,
121
- side: d,
122
- alignItemWithTriggerActive: r,
123
- setControlledAlignItemWithTrigger: h,
124
- scrollUpArrowRef: ee,
125
- scrollDownArrowRef: te
126
- }), [i, d, r, h]);
127
- return /* @__PURE__ */ T(pe, {
128
- elementsRef: G,
129
- labelsRef: J,
130
- onMapChange: se,
131
- children: /* @__PURE__ */ xe(he.Provider, {
132
- value: le,
133
- children: [n && E && /* @__PURE__ */ T(Ie, {
134
- inert: ce(!a),
135
- cutout: b
136
- }), ie]
137
- })
138
- });
139
- });
140
- process.env.NODE_ENV !== "production" && (be.displayName = "SelectPositioner");
141
- export {
142
- be as SelectPositioner
143
- };
package/dist/index72.js DELETED
@@ -1,200 +0,0 @@
1
- "use client";
2
- import * as s from "react";
3
- import * as Dt from "react-dom";
4
- import { useTimeout as Nt } from "./index148.js";
5
- import { isWebKit as Wt } from "./index158.js";
6
- import { useStableCallback as $t } from "./index127.js";
7
- import { ownerDocument as lt } from "./index147.js";
8
- import { isMouseWithinBounds as kt } from "./index159.js";
9
- import { useIsoLayoutEffect as _ } from "./index126.js";
10
- import { useAnimationFrame as zt } from "./index160.js";
11
- import { useSelectRootContext as _t, useSelectFloatingContext as jt } from "./index129.js";
12
- import { popupStateMapping as Kt } from "./index105.js";
13
- import { useSelectPositionerContext as Vt } from "./index156.js";
14
- import { styleDisableScrollbar as ct } from "./index161.js";
15
- import { transitionStatusMapping as Yt } from "./index106.js";
16
- import { useOpenChangeComplete as qt } from "./index113.js";
17
- import { useRenderElement as Ut } from "./index87.js";
18
- import { selectors as u } from "./index134.js";
19
- import { clearStyles as at, LIST_FUNCTIONAL_STYLES as Xt } from "./index157.js";
20
- import { createChangeEventDetails as Zt } from "./index107.js";
21
- import { useToolbarRootContext as Gt } from "./index162.js";
22
- import { COMPOSITE_KEYS as Jt } from "./index114.js";
23
- import { getDisabledMountTransitionStyles as Qt } from "./index163.js";
24
- import { jsxs as te, jsx as ee } from "react/jsx-runtime";
25
- import { getWindow as mt } from "./index164.js";
26
- import { FloatingFocusManager as oe } from "./index115.js";
27
- import { useStore as g } from "./index145.js";
28
- import { windowResize as ne } from "./index108.js";
29
- const re = {
30
- ...Kt,
31
- ...Yt
32
- }, ie = /* @__PURE__ */ s.forwardRef(function(j, pt) {
33
- const {
34
- render: le,
35
- className: ce,
36
- ...ut
37
- } = j, {
38
- store: r,
39
- popupRef: p,
40
- onOpenChangeComplete: gt,
41
- setOpen: K,
42
- valueRef: V,
43
- selectedItemTextRef: Y,
44
- keyboardActiveRef: q,
45
- multiple: ft,
46
- handleScrollArrowVisibility: H,
47
- scrollHandlerRef: U
48
- } = _t(), {
49
- side: X,
50
- align: Z,
51
- alignItemWithTriggerActive: l,
52
- setControlledAlignItemWithTrigger: G,
53
- scrollDownArrowRef: ht,
54
- scrollUpArrowRef: dt
55
- } = Vt(), xt = Gt() != null, Tt = jt(), yt = Nt(), Rt = g(r, u.id), P = g(r, u.open), f = g(r, u.mounted), St = g(r, u.popupProps), O = g(r, u.transitionStatus), w = g(r, u.triggerElement), t = g(r, u.positionerElement), R = g(r, u.listElement), F = s.useRef(0), B = s.useRef(!1), Ht = s.useRef(0), C = s.useRef(!1), L = s.useRef({}), J = zt(), Q = $t((e) => {
56
- if (!t || !p.current || !C.current)
57
- return;
58
- if (B.current || !l) {
59
- H();
60
- return;
61
- }
62
- const i = t.style.top === "0px", b = t.style.bottom === "0px", M = t.getBoundingClientRect().height, I = lt(t), c = getComputedStyle(t), h = parseFloat(c.marginTop), A = parseFloat(c.marginBottom), d = I.documentElement.clientHeight - h - A, n = e.scrollTop, D = e.scrollHeight, N = e.clientHeight, x = D - N;
63
- let a = null, m = null, E = !1;
64
- if (i) {
65
- const S = x - n, T = M + S, o = Math.min(T, d);
66
- a = o, o !== d ? m = x : E = !0;
67
- } else if (b) {
68
- const S = n - 0, T = M + S, o = Math.min(T, d), W = T - d;
69
- a = o, o !== d ? m = 0 : (E = !0, n < x && (m = n - (S - W)));
70
- }
71
- a != null && (t.style.height = `${a}px`), m != null && (e.scrollTop = m), E && (B.current = !0), H();
72
- });
73
- s.useImperativeHandle(U, () => Q, [Q]), qt({
74
- open: P,
75
- ref: p,
76
- onComplete() {
77
- P && gt?.(!0);
78
- }
79
- });
80
- const Ct = s.useMemo(() => ({
81
- open: P,
82
- transitionStatus: O,
83
- side: X,
84
- align: Z
85
- }), [P, O, X, Z]);
86
- _(() => {
87
- !t || !p.current || Object.keys(L.current).length || (L.current = {
88
- top: t.style.top || "0",
89
- left: t.style.left || "0",
90
- right: t.style.right,
91
- height: t.style.height,
92
- bottom: t.style.bottom,
93
- minHeight: t.style.minHeight,
94
- maxHeight: t.style.maxHeight,
95
- marginTop: t.style.marginTop,
96
- marginBottom: t.style.marginBottom
97
- });
98
- }, [p, t]), _(() => {
99
- f || l || (C.current = !1, B.current = !1, F.current = 0, Ht.current = 0, at(t, L.current));
100
- }, [f, l, t, p]), _(() => {
101
- const e = p.current;
102
- if (!(!f || !w || !t || !e)) {
103
- if (!l) {
104
- C.current = !0, J.request(H);
105
- return;
106
- }
107
- queueMicrotask(() => {
108
- const i = getComputedStyle(t), b = getComputedStyle(e), M = lt(w), I = mt(t), c = w.getBoundingClientRect(), h = t.getBoundingClientRect(), A = c.left, d = c.height, n = R || e, D = n.scrollHeight, N = parseFloat(b.borderBottomWidth), x = parseFloat(i.marginTop) || 10, a = parseFloat(i.marginBottom) || 10, m = parseFloat(i.minHeight) || 100, E = 5, S = 5, T = 20, o = M.documentElement.clientHeight - x - a, W = M.documentElement.clientWidth, Et = o - c.bottom + d, tt = Y.current, et = V.current;
109
- let ot = 0, nt = 0;
110
- if (tt && et) {
111
- const v = et.getBoundingClientRect(), z = tt.getBoundingClientRect(), Lt = v.left - A, At = z.left - h.left, Ot = v.top - c.top + v.height / 2, It = z.top - h.top + z.height / 2;
112
- ot = Lt - At, nt = It - Ot;
113
- }
114
- const $ = Et + nt + a + N;
115
- let y = Math.min(o, $);
116
- const vt = o - x - a, k = $ - y, rt = Math.max(E, A + ot), Pt = W - S, wt = Math.max(0, rt + h.width - Pt);
117
- t.style.left = `${rt - wt}px`, t.style.height = `${y}px`, t.style.maxHeight = "auto", t.style.marginTop = `${x}px`, t.style.marginBottom = `${a}px`, e.style.height = "100%";
118
- const it = n.scrollHeight - n.clientHeight, st = k >= it;
119
- st && (y = Math.min(o, h.height) - (k - it));
120
- const Ft = c.top < T || c.bottom > o - T || y < Math.min(D, m), Bt = (I.visualViewport?.scale ?? 1) !== 1 && Wt;
121
- if (Ft || Bt) {
122
- C.current = !0, at(t, L.current), Dt.flushSync(() => G(!1));
123
- return;
124
- }
125
- if (st) {
126
- const v = Math.max(0, o - $);
127
- t.style.top = h.height >= vt ? "0" : `${v}px`, t.style.height = `${y}px`, n.scrollTop = n.scrollHeight - n.clientHeight, F.current = Math.max(m, y);
128
- } else
129
- t.style.bottom = "0", F.current = Math.max(m, y), n.scrollTop = k;
130
- F.current === o && (B.current = !0), H(), setTimeout(() => {
131
- C.current = !0;
132
- });
133
- });
134
- }
135
- }, [r, f, t, w, V, Y, p, H, l, G, J, ht, dt, R]), s.useEffect(() => {
136
- if (!l || !t || !f)
137
- return;
138
- const e = mt(t);
139
- function i(b) {
140
- K(!1, Zt(ne, b));
141
- }
142
- return e.addEventListener("resize", i), () => {
143
- e.removeEventListener("resize", i);
144
- };
145
- }, [K, l, t, f]);
146
- const bt = {
147
- ...R ? {
148
- role: "presentation",
149
- "aria-orientation": void 0
150
- } : {
151
- role: "listbox",
152
- "aria-multiselectable": ft || void 0,
153
- id: `${Rt}-list`
154
- },
155
- onKeyDown(e) {
156
- q.current = !0, xt && Jt.has(e.key) && e.stopPropagation();
157
- },
158
- onMouseMove() {
159
- q.current = !1;
160
- },
161
- onPointerLeave(e) {
162
- if (kt(e) || e.pointerType === "touch")
163
- return;
164
- const i = e.currentTarget;
165
- yt.start(0, () => {
166
- r.set("activeIndex", null), i.focus({
167
- preventScroll: !0
168
- });
169
- });
170
- },
171
- onScroll(e) {
172
- R || U.current?.(e.currentTarget);
173
- },
174
- ...l && {
175
- style: R ? {
176
- height: "100%"
177
- } : Xt
178
- }
179
- }, Mt = Ut("div", j, {
180
- ref: [pt, p],
181
- state: Ct,
182
- stateAttributesMapping: re,
183
- props: [St, bt, Qt(O), {
184
- className: !R && l ? ct.className : void 0
185
- }, ut]
186
- });
187
- return /* @__PURE__ */ te(s.Fragment, {
188
- children: [ct.element, /* @__PURE__ */ ee(oe, {
189
- context: Tt,
190
- modal: !1,
191
- disabled: !f,
192
- restoreFocus: !0,
193
- children: Mt
194
- })]
195
- });
196
- });
197
- process.env.NODE_ENV !== "production" && (ie.displayName = "SelectPopup");
198
- export {
199
- ie as SelectPopup
200
- };