@vlrc-fe/components 2.2.0 → 2.3.0

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 (215) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/DataTable/DataTable.d.ts.map +1 -1
  3. package/dist/DataTable/components/DataTableTable.d.ts.map +1 -1
  4. package/dist/Form/Form.d.ts.map +1 -1
  5. package/dist/Form/FormDatePicker/FormDatePicker.d.ts.map +1 -1
  6. package/dist/Form/FormDatePicker/RangeDatePicker.d.ts.map +1 -1
  7. package/dist/Form/FormDatePicker/SingleDatePicker.d.ts +4 -3
  8. package/dist/Form/FormDatePicker/SingleDatePicker.d.ts.map +1 -1
  9. package/dist/Form/FormDatePicker/TimeInput.d.ts +3 -4
  10. package/dist/Form/FormDatePicker/TimeInput.d.ts.map +1 -1
  11. package/dist/Form/FormDatePicker/TimePicker.d.ts +3 -3
  12. package/dist/Form/FormDatePicker/TimePicker.d.ts.map +1 -1
  13. package/dist/Form/FormDatePicker/types.d.ts +1 -0
  14. package/dist/Form/FormDatePicker/types.d.ts.map +1 -1
  15. package/dist/Form/FormDatePicker/useFormDatePicker.d.ts +2 -2
  16. package/dist/Form/FormDatePicker/useFormDatePicker.d.ts.map +1 -1
  17. package/dist/Form/FormNumberInput/FormNumberInput.d.ts.map +1 -1
  18. package/dist/Form/FormNumberInput/StepperControls.d.ts.map +1 -1
  19. package/dist/Form/FormNumberInput/useFormNumberInput.d.ts.map +1 -1
  20. package/dist/MultiSelect/MultiSelect.d.ts.map +1 -1
  21. package/dist/MultiSelect/renderers.d.ts +2 -2
  22. package/dist/MultiSelect/renderers.d.ts.map +1 -1
  23. package/dist/assets/stylex.css +450 -0
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.js +25 -25
  26. package/dist/index101.cjs +1 -1
  27. package/dist/index101.js +120 -91
  28. package/dist/index103.cjs +1 -1
  29. package/dist/index103.js +32 -15
  30. package/dist/index107.cjs +1 -1
  31. package/dist/index107.js +245 -132
  32. package/dist/index109.cjs +1 -1
  33. package/dist/index109.js +319 -138
  34. package/dist/index113.cjs +1 -1
  35. package/dist/index113.js +230 -95
  36. package/dist/index119.cjs +1 -1
  37. package/dist/index119.js +62 -35
  38. package/dist/index120.cjs +1 -1
  39. package/dist/index120.js +71 -32
  40. package/dist/index121.cjs +1 -1
  41. package/dist/index121.js +201 -79
  42. package/dist/index125.cjs +1 -1
  43. package/dist/index125.js +661 -288
  44. package/dist/index129.cjs +1 -1
  45. package/dist/index129.js +6 -5
  46. package/dist/index144.cjs +1 -1
  47. package/dist/index144.js +33 -22
  48. package/dist/index148.cjs +1 -1
  49. package/dist/index148.js +95 -92
  50. package/dist/index151.cjs +1 -1
  51. package/dist/index151.js +56 -56
  52. package/dist/index152.cjs +1 -1
  53. package/dist/index152.js +87 -3
  54. package/dist/index153.cjs +1 -1
  55. package/dist/index153.js +321 -85
  56. package/dist/index154.cjs +1 -1
  57. package/dist/index154.js +160 -287
  58. package/dist/index155.cjs +1 -1
  59. package/dist/index155.js +198 -162
  60. package/dist/index156.cjs +1 -1
  61. package/dist/index156.js +24 -125
  62. package/dist/index157.cjs +1 -1
  63. package/dist/index157.js +8 -25
  64. package/dist/index158.cjs +1 -1
  65. package/dist/index158.js +13 -5
  66. package/dist/index159.cjs +1 -1
  67. package/dist/index159.js +18 -13
  68. package/dist/index160.cjs +1 -1
  69. package/dist/index160.js +12 -16
  70. package/dist/index161.cjs +1 -1
  71. package/dist/index161.js +5 -17
  72. package/dist/index162.cjs +1 -1
  73. package/dist/index162.js +6 -5
  74. package/dist/index163.cjs +1 -1
  75. package/dist/index163.js +6 -5
  76. package/dist/index164.cjs +1 -1
  77. package/dist/index164.js +5 -6
  78. package/dist/index165.cjs +1 -1
  79. package/dist/index165.js +5 -5
  80. package/dist/index166.cjs +1 -1
  81. package/dist/index166.js +7 -5
  82. package/dist/index167.cjs +1 -1
  83. package/dist/index167.js +68 -8
  84. package/dist/index168.cjs +1 -1
  85. package/dist/index168.js +9 -67
  86. package/dist/index169.cjs +1 -1
  87. package/dist/index169.js +201 -10
  88. package/dist/index170.cjs +1 -1
  89. package/dist/index170.js +101 -179
  90. package/dist/index171.cjs +1 -1
  91. package/dist/index171.js +24 -116
  92. package/dist/index172.cjs +1 -1
  93. package/dist/index172.js +18 -30
  94. package/dist/index173.cjs +1 -1
  95. package/dist/index173.js +66 -17
  96. package/dist/index174.cjs +1 -1
  97. package/dist/index174.js +30 -67
  98. package/dist/index175.cjs +1 -1
  99. package/dist/index175.js +10 -31
  100. package/dist/index176.cjs +1 -1
  101. package/dist/index176.js +279 -10
  102. package/dist/index177.cjs +1 -1
  103. package/dist/index177.js +125 -248
  104. package/dist/index178.cjs +1 -1
  105. package/dist/index178.js +18 -155
  106. package/dist/index179.cjs +1 -1
  107. package/dist/index179.js +9 -19
  108. package/dist/index180.cjs +1 -1
  109. package/dist/index180.js +12 -8
  110. package/dist/index181.cjs +1 -1
  111. package/dist/index181.js +6 -12
  112. package/dist/index182.cjs +1 -1
  113. package/dist/index182.js +6 -6
  114. package/dist/index183.cjs +1 -1
  115. package/dist/index183.js +9 -6
  116. package/dist/index184.cjs +1 -1
  117. package/dist/index184.js +8 -9
  118. package/dist/index185.cjs +1 -1
  119. package/dist/index185.js +4 -8
  120. package/dist/index186.cjs +1 -1
  121. package/dist/index186.js +6 -4
  122. package/dist/index187.cjs +1 -1
  123. package/dist/index187.js +6 -6
  124. package/dist/index188.cjs +1 -1
  125. package/dist/index188.js +8 -6
  126. package/dist/index189.cjs +1 -1
  127. package/dist/index189.js +9 -8
  128. package/dist/index190.cjs +1 -1
  129. package/dist/index190.js +12 -8
  130. package/dist/index191.cjs +1 -1
  131. package/dist/index191.js +7 -11
  132. package/dist/index192.cjs +1 -1
  133. package/dist/index192.js +7 -7
  134. package/dist/index193.cjs +1 -1
  135. package/dist/index193.js +4 -9
  136. package/dist/index194.cjs +1 -1
  137. package/dist/index194.js +42 -5
  138. package/dist/index195.cjs +1 -1
  139. package/dist/index195.js +375 -29
  140. package/dist/index196.cjs +1 -1
  141. package/dist/index196.js +35 -386
  142. package/dist/index197.cjs +1 -1
  143. package/dist/index197.js +22 -37
  144. package/dist/index198.cjs +1 -1
  145. package/dist/index198.js +56 -20
  146. package/dist/index199.cjs +1 -1
  147. package/dist/index199.js +36 -54
  148. package/dist/index200.cjs +1 -1
  149. package/dist/index200.js +102 -54
  150. package/dist/index201.cjs +1 -1
  151. package/dist/index201.js +76 -54
  152. package/dist/index202.cjs +1 -1
  153. package/dist/index202.js +68 -66
  154. package/dist/index203.cjs +1 -1
  155. package/dist/index203.js +147 -63
  156. package/dist/index204.cjs +1 -1
  157. package/dist/index204.js +69 -91
  158. package/dist/index205.cjs +9 -1
  159. package/dist/index205.js +585 -62
  160. package/dist/index206.cjs +1 -9
  161. package/dist/index206.js +65 -586
  162. package/dist/index207.cjs +1 -1
  163. package/dist/index207.js +42 -41
  164. package/dist/index208.cjs +1 -1
  165. package/dist/index208.js +64 -46
  166. package/dist/index209.cjs +1 -1
  167. package/dist/index209.js +48 -64
  168. package/dist/index210.cjs +1 -1
  169. package/dist/index210.js +75 -47
  170. package/dist/index211.cjs +1 -1
  171. package/dist/index211.js +173 -69
  172. package/dist/index212.cjs +1 -1
  173. package/dist/index212.js +24 -180
  174. package/dist/index213.cjs +1 -1
  175. package/dist/index213.js +25 -24
  176. package/dist/index214.cjs +1 -1
  177. package/dist/index214.js +61 -24
  178. package/dist/index215.cjs +1 -1
  179. package/dist/index215.js +408 -49
  180. package/dist/index216.cjs +1 -1
  181. package/dist/index216.js +25 -422
  182. package/dist/index37.cjs +1 -1
  183. package/dist/index37.js +123 -65
  184. package/dist/index42.cjs +1 -1
  185. package/dist/index42.js +175 -88
  186. package/dist/index91.cjs +1 -1
  187. package/dist/index91.js +252 -124
  188. package/dist/ui/calendar.d.ts +5 -2
  189. package/dist/ui/calendar.d.ts.map +1 -1
  190. package/dist/ui/carousel.d.ts +19 -5
  191. package/dist/ui/carousel.d.ts.map +1 -1
  192. package/dist/ui/context-menu.d.ts +37 -12
  193. package/dist/ui/context-menu.d.ts.map +1 -1
  194. package/dist/ui/form.d.ts +15 -4
  195. package/dist/ui/form.d.ts.map +1 -1
  196. package/dist/ui/hover-card.d.ts +5 -1
  197. package/dist/ui/hover-card.d.ts.map +1 -1
  198. package/dist/ui/item.d.ts +43 -18
  199. package/dist/ui/item.d.ts.map +1 -1
  200. package/dist/ui/menubar.d.ts +45 -14
  201. package/dist/ui/menubar.d.ts.map +1 -1
  202. package/dist/ui/navigation-menu.d.ts +34 -10
  203. package/dist/ui/navigation-menu.d.ts.map +1 -1
  204. package/dist/ui/resizable.d.ts +9 -3
  205. package/dist/ui/resizable.d.ts.map +1 -1
  206. package/dist/ui/scroll-area.d.ts +9 -2
  207. package/dist/ui/scroll-area.d.ts.map +1 -1
  208. package/dist/ui/select.d.ts +19 -5
  209. package/dist/ui/select.d.ts.map +1 -1
  210. package/dist/ui/sidebar.d.ts +99 -37
  211. package/dist/ui/sidebar.d.ts.map +1 -1
  212. package/dist/ui/sonner.d.ts.map +1 -1
  213. package/package.json +1 -1
  214. package/dist/index217.cjs +0 -1
  215. package/dist/index217.js +0 -25
package/dist/index207.js CHANGED
@@ -1,42 +1,43 @@
1
- import { Button as e } from "./index25.js";
2
- import { ChevronDown as t, ChevronUp as n } from "lucide-react";
3
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { c as a } from "react/compiler-runtime";
5
- import { useTranslation as o } from "react-i18next";
6
- // src/Form/FormNumberInput/StepperControls.tsx
7
- function s(s) {
8
- let c = a(17), { onIncrement: l, onDecrement: u, disableIncrement: d, disableDecrement: f } = s, { t: p } = o(), m;
9
- c[0] === p ? m = c[1] : (m = p("form_increase_value"), c[0] = p, c[1] = m);
10
- let h;
11
- c[2] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ r(n, { size: 15 }), c[2] = h) : h = c[2];
12
- let g;
13
- c[3] !== d || c[4] !== l || c[5] !== m ? (g = /* @__PURE__ */ r(e, {
14
- "aria-label": m,
15
- className: "px-2 h-5 rounded-l-none rounded-br-none border-input border-l-0 border-b-[0.5px] focus-visible:relative",
16
- variant: "outline",
17
- onClick: l,
18
- disabled: d,
19
- type: "button",
20
- children: h
21
- }), c[3] = d, c[4] = l, c[5] = m, c[6] = g) : g = c[6];
22
- let _;
23
- c[7] === p ? _ = c[8] : (_ = p("form_decrease_value"), c[7] = p, c[8] = _);
24
- let v;
25
- c[9] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ r(t, { size: 15 }), c[9] = v) : v = c[9];
26
- let y;
27
- c[10] !== f || c[11] !== u || c[12] !== _ ? (y = /* @__PURE__ */ r(e, {
28
- "aria-label": _,
29
- className: "px-2 h-5 rounded-l-none rounded-tr-none border-input border-l-0 border-t-[0.5px] focus-visible:relative",
30
- variant: "outline",
31
- onClick: u,
32
- disabled: f,
33
- type: "button",
34
- children: v
35
- }), c[10] = f, c[11] = u, c[12] = _, c[13] = y) : y = c[13];
36
- let b;
37
- return c[14] !== g || c[15] !== y ? (b = /* @__PURE__ */ i("div", {
38
- className: "flex flex-col ml-1",
39
- children: [g, y]
40
- }), c[14] = g, c[15] = y, c[16] = b) : b = c[16], b;
1
+ import { cn as e } from "./index36.js";
2
+ // src/Form/FormNumberInput/useFormNumberInput.ts
3
+ var t = [];
4
+ function n({ rules: n, inputClassName: r, stepper: i, min: a, max: o, onChange: s, passthroughProps: c }) {
5
+ let l = n?.required !== void 0 && n.required !== !1;
6
+ return {
7
+ isRequired: l,
8
+ enhancedRules: (() => {
9
+ if (!n) return n;
10
+ let e = { ...n };
11
+ return l && typeof e.required != "string" && typeof e.required != "object" ? e.required = "This field is required" : typeof e.required == "object" && !e.required.message && (e.required = {
12
+ ...e.required,
13
+ message: "This field is required"
14
+ }), e;
15
+ })(),
16
+ numericClass: e(t, r),
17
+ getHandlers: ({ currentValue: e, field: t }) => {
18
+ let n = () => {
19
+ let n = Math.min((e ?? 0) + i, o);
20
+ t.onChange(n), s?.(n);
21
+ }, r = () => {
22
+ let n = Math.max((e ?? 0) - i, a);
23
+ t.onChange(n), s?.(n);
24
+ };
25
+ return {
26
+ handleIncrement: n,
27
+ handleDecrement: r,
28
+ handleKeyDown: (e) => {
29
+ e.key === "ArrowUp" ? (e.preventDefault(), n()) : e.key === "ArrowDown" && (e.preventDefault(), r()), c.onKeyDown && c.onKeyDown(e);
30
+ },
31
+ handleBlur: () => {
32
+ let n = e;
33
+ n !== void 0 && (n < a ? (t.onChange(a), s?.(a)) : n > o && (t.onChange(o), s?.(o))), t.onBlur(), c.onBlur && c.onBlur();
34
+ },
35
+ numericOnValueChange: (e) => {
36
+ let n = e.floatValue === void 0 ? void 0 : e.floatValue;
37
+ t.onChange(n), s?.(n);
38
+ }
39
+ };
40
+ }
41
+ };
41
42
  }
42
- export { s as StepperControls };
43
+ export { n as useFormNumberInput };
package/dist/index208.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./index36.cjs");var t=[`[appearance:textfield]`,`[&::-webkit-outer-spin-button]:appearance-none`,`[&::-webkit-inner-spin-button]:appearance-none`,`rounded-r-none`,`relative`];function n({rules:n,inputClassName:r,stepper:i,min:a,max:o,onChange:s,passthroughProps:c}){let l=n?.required!==void 0&&n.required!==!1;return{isRequired:l,enhancedRules:(()=>{if(!n)return n;let e={...n};return l&&typeof e.required!=`string`&&typeof e.required!=`object`?e.required=`This field is required`:typeof e.required==`object`&&!e.required.message&&(e.required={...e.required,message:`This field is required`}),e})(),numericClass:e.cn(t,r),getHandlers:({currentValue:e,field:t})=>{let n=()=>{let n=Math.min((e??0)+i,o);t.onChange(n),s?.(n)},r=()=>{let n=Math.max((e??0)-i,a);t.onChange(n),s?.(n)};return{handleIncrement:n,handleDecrement:r,handleKeyDown:e=>{e.key===`ArrowUp`?(e.preventDefault(),n()):e.key===`ArrowDown`&&(e.preventDefault(),r()),c.onKeyDown&&c.onKeyDown(e)},handleBlur:()=>{let n=e;n!==void 0&&(n<a?(t.onChange(a),s?.(a)):n>o&&(t.onChange(o),s?.(o))),t.onBlur(),c.onBlur&&c.onBlur()},numericOnValueChange:e=>{let n=e.floatValue===void 0?void 0:e.floatValue;t.onChange(n),s?.(n)}}}}}exports.useFormNumberInput=n;
1
+ const e=require("./index2.cjs"),t=require("./index36.cjs"),n=require("./index151.cjs"),r=require("./index205.cjs"),i=require("./index206.cjs"),a=require("./index207.cjs");let o=require("@stylexjs/stylex");o=e.__toESM(o,1);let s=require("react/jsx-runtime");function c({control:e,name:o,label:c,stepper:l=1,min:u=`0`,max:d=`100`,minValue:f=-1/0,maxValue:p=1/0,thousandSeparator:m,placeholder:h,fixedDecimalScale:g=!1,decimalScale:_=0,suffix:v,prefix:y,inputClassName:b,onChange:x,rules:S,description:C,horizontal:w,controlFirst:T,width:E,...D}){let{enhancedRules:O,numericClass:k,getHandlers:A}=a.useFormNumberInput({min:f,max:p,rules:S,inputClassName:b,stepper:l,onChange:x,passthroughProps:D});return(0,s.jsx)(n.FormBase,{control:e,name:o,label:c,description:C,rules:O,horizontal:w,controlFirst:T,width:E,children:({id:e,"aria-invalid":n,...a})=>{let o=a.value,{handleIncrement:c,handleDecrement:l,handleKeyDown:b,handleBlur:x,numericOnValueChange:S}=A({currentValue:o,field:a}),C={className:`xh8yej3 xeuugli xsda711 x1a2w583 xjppbhk xmkeg23 x1y0btm7 xsyin8q xjbqb8w x84br7x x1dsmnui x1bh2a3r xx6bhzk x1a2a7pz xk8t5le x1ryrjj2 x18g2hj5 xkpwil5 x8r4c90`};return(0,s.jsxs)(`div`,{className:`x78zum5 x6s0dn4 xh8yej3`,children:[(0,s.jsx)(r.NumericFormat,{min:u,max:d,"aria-invalid":n,value:o??``,onValueChange:S,thousandSeparator:m,decimalScale:_,fixedDecimalScale:g,allowNegative:f<0,valueIsNumericString:!1,onBlur:x,suffix:v,prefix:y,placeholder:h||`0`,getInputRef:a.ref,onKeyDown:b,name:a.name,...D,id:e,...C,className:t.cn(C.className,k,D.className)}),(0,s.jsx)(i.StepperControls,{onIncrement:c,onDecrement:l,disableIncrement:o!==void 0&&o>=p,disableDecrement:o!==void 0&&o<=f})]})}})}exports.FormNumberInput=c;
package/dist/index208.js CHANGED
@@ -1,49 +1,67 @@
1
1
  import { cn as e } from "./index36.js";
2
- // src/Form/FormNumberInput/useFormNumberInput.ts
3
- var t = [
4
- "[appearance:textfield]",
5
- "[&::-webkit-outer-spin-button]:appearance-none",
6
- "[&::-webkit-inner-spin-button]:appearance-none",
7
- "rounded-r-none",
8
- "relative"
9
- ];
10
- function n({ rules: n, inputClassName: r, stepper: i, min: a, max: o, onChange: s, passthroughProps: c }) {
11
- let l = n?.required !== void 0 && n.required !== !1;
12
- return {
13
- isRequired: l,
14
- enhancedRules: (() => {
15
- if (!n) return n;
16
- let e = { ...n };
17
- return l && typeof e.required != "string" && typeof e.required != "object" ? e.required = "This field is required" : typeof e.required == "object" && !e.required.message && (e.required = {
18
- ...e.required,
19
- message: "This field is required"
20
- }), e;
21
- })(),
22
- numericClass: e(t, r),
23
- getHandlers: ({ currentValue: e, field: t }) => {
24
- let n = () => {
25
- let n = Math.min((e ?? 0) + i, o);
26
- t.onChange(n), s?.(n);
27
- }, r = () => {
28
- let n = Math.max((e ?? 0) - i, a);
29
- t.onChange(n), s?.(n);
30
- };
31
- return {
32
- handleIncrement: n,
33
- handleDecrement: r,
34
- handleKeyDown: (e) => {
35
- e.key === "ArrowUp" ? (e.preventDefault(), n()) : e.key === "ArrowDown" && (e.preventDefault(), r()), c.onKeyDown && c.onKeyDown(e);
36
- },
37
- handleBlur: () => {
38
- let n = e;
39
- n !== void 0 && (n < a ? (t.onChange(a), s?.(a)) : n > o && (t.onChange(o), s?.(o))), t.onBlur(), c.onBlur && c.onBlur();
40
- },
41
- numericOnValueChange: (e) => {
42
- let n = e.floatValue === void 0 ? void 0 : e.floatValue;
43
- t.onChange(n), s?.(n);
44
- }
45
- };
2
+ import { FormBase as t } from "./index151.js";
3
+ import { NumericFormat as n } from "./index205.js";
4
+ import { StepperControls as r } from "./index206.js";
5
+ import { useFormNumberInput as i } from "./index207.js";
6
+ import "@stylexjs/stylex";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
+ // src/Form/FormNumberInput/FormNumberInput.tsx
9
+ function s({ control: s, name: c, label: l, stepper: u = 1, min: d = "0", max: f = "100", minValue: p = -Infinity, maxValue: m = Infinity, thousandSeparator: h, placeholder: g, fixedDecimalScale: _ = !1, decimalScale: v = 0, suffix: y, prefix: b, inputClassName: x, onChange: S, rules: C, description: w, horizontal: T, controlFirst: E, width: D, ...O }) {
10
+ let { enhancedRules: k, numericClass: A, getHandlers: j } = i({
11
+ min: p,
12
+ max: m,
13
+ rules: C,
14
+ inputClassName: x,
15
+ stepper: u,
16
+ onChange: S,
17
+ passthroughProps: O
18
+ });
19
+ return /* @__PURE__ */ a(t, {
20
+ control: s,
21
+ name: c,
22
+ label: l,
23
+ description: w,
24
+ rules: k,
25
+ horizontal: T,
26
+ controlFirst: E,
27
+ width: D,
28
+ children: ({ id: t, "aria-invalid": i, ...s }) => {
29
+ let c = s.value, { handleIncrement: l, handleDecrement: u, handleKeyDown: x, handleBlur: S, numericOnValueChange: C } = j({
30
+ currentValue: c,
31
+ field: s
32
+ }), w = { className: "xh8yej3 xeuugli xsda711 x1a2w583 xjppbhk xmkeg23 x1y0btm7 xsyin8q xjbqb8w x84br7x x1dsmnui x1bh2a3r xx6bhzk x1a2a7pz xk8t5le x1ryrjj2 x18g2hj5 xkpwil5 x8r4c90" };
33
+ return /* @__PURE__ */ o("div", {
34
+ className: "x78zum5 x6s0dn4 xh8yej3",
35
+ children: [/* @__PURE__ */ a(n, {
36
+ min: d,
37
+ max: f,
38
+ "aria-invalid": i,
39
+ value: c ?? "",
40
+ onValueChange: C,
41
+ thousandSeparator: h,
42
+ decimalScale: v,
43
+ fixedDecimalScale: _,
44
+ allowNegative: p < 0,
45
+ valueIsNumericString: !1,
46
+ onBlur: S,
47
+ suffix: y,
48
+ prefix: b,
49
+ placeholder: g || "0",
50
+ getInputRef: s.ref,
51
+ onKeyDown: x,
52
+ name: s.name,
53
+ ...O,
54
+ id: t,
55
+ ...w,
56
+ className: e(w.className, A, O.className)
57
+ }), /* @__PURE__ */ a(r, {
58
+ onIncrement: l,
59
+ onDecrement: u,
60
+ disableIncrement: c !== void 0 && c >= m,
61
+ disableDecrement: c !== void 0 && c <= p
62
+ })]
63
+ });
46
64
  }
47
- };
65
+ });
48
66
  }
49
- export { n as useFormNumberInput };
67
+ export { s as FormNumberInput };
package/dist/index209.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./index36.cjs"),t=require("./index151.cjs"),n=require("./index206.cjs"),r=require("./index207.cjs"),i=require("./index208.cjs");let a=require("react/jsx-runtime");function o({control:o,name:s,label:c,stepper:l=1,min:u=`0`,max:d=`100`,minValue:f=-1/0,maxValue:p=1/0,thousandSeparator:m,placeholder:h,fixedDecimalScale:g=!1,decimalScale:_=0,suffix:v,prefix:y,inputClassName:b,onChange:x,rules:S,description:C,horizontal:w,controlFirst:T,width:E,...D}){let{enhancedRules:O,numericClass:k,getHandlers:A}=i.useFormNumberInput({min:f,max:p,rules:S,inputClassName:b,stepper:l,onChange:x,passthroughProps:D});return(0,a.jsx)(t.FormBase,{control:o,name:s,label:c,description:C,rules:O,horizontal:w,controlFirst:T,width:E,children:({id:t,"aria-invalid":i,...o})=>{let s=o.value,{handleIncrement:c,handleDecrement:l,handleKeyDown:b,handleBlur:x,numericOnValueChange:S}=A({currentValue:s,field:o});return(0,a.jsxs)(`div`,{className:`flex items-center`,children:[(0,a.jsx)(n.NumericFormat,{min:u,max:d,"aria-invalid":i,value:s??``,onValueChange:S,thousandSeparator:m,decimalScale:_,fixedDecimalScale:g,allowNegative:f<0,valueIsNumericString:!1,onBlur:x,suffix:v,prefix:y,placeholder:h||`0`,getInputRef:o.ref,onKeyDown:b,name:o.name,...D,id:t,className:e.cn(k,D.className)}),(0,a.jsx)(r.StepperControls,{onIncrement:c,onDecrement:l,disableIncrement:s!==void 0&&s>=p,disableDecrement:s!==void 0&&s<=f})]})}})}exports.FormNumberInput=o;
1
+ let e=require("lodash-es");function t(e){return e.isMulti===!0}function n(n){let{options:r,injectOptions:i,placeholder:a=`Select...`,description:o,disabled:s,isClearable:c=!0,isSearchable:l=!0,isLoading:u=!1,className:d,rules:f,onSearchTextChange:p,hasNextPage:m,isFetchingNextPage:h,fetchNextPage:g,maxTagCount:_=`responsive`,tagRender:v,showSelectAll:y=!1,allowClear:b,width:x}=n,S=(0,e.get)(f,`required`),C=!(0,e.isNil)(S)&&S!==!1,w={options:r,injectOptions:i,placeholder:a,isClearable:c,isSearchable:l,isLoading:u,className:d,disabled:s,onSearchTextChange:p,hasNextPage:m,isFetchingNextPage:h,fetchNextPage:g,maxTagCount:_,tagRender:v,showSelectAll:y,allowClear:b,width:x};return{isRequired:C,description:o,enhancedRules:(()=>{if(!f)return f;let e={...f};return C&&typeof e.required!=`string`&&typeof e.required!=`object`?e.required=`This field is required`:typeof e.required==`object`&&!e.required.message&&(e.required={...e.required,message:`This field is required`}),e})(),baseSelectProps:w,isMulti:t(n),createChangeHandlers:e=>({onChangeMulti:r=>{e.onChange(r),t(n)&&n.onChange&&n.onChange(r)},onChangeSingle:r=>{e.onChange(r),!t(n)&&n.onChange&&n.onChange(r)}})}}exports.useFormSelect=n;
package/dist/index209.js CHANGED
@@ -1,65 +1,49 @@
1
- import { cn as e } from "./index36.js";
2
- import { FormBase as t } from "./index151.js";
3
- import { NumericFormat as n } from "./index206.js";
4
- import { StepperControls as r } from "./index207.js";
5
- import { useFormNumberInput as i } from "./index208.js";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- // src/Form/FormNumberInput/FormNumberInput.tsx
8
- function s({ control: s, name: c, label: l, stepper: u = 1, min: d = "0", max: f = "100", minValue: p = -Infinity, maxValue: m = Infinity, thousandSeparator: h, placeholder: g, fixedDecimalScale: _ = !1, decimalScale: v = 0, suffix: y, prefix: b, inputClassName: x, onChange: S, rules: C, description: w, horizontal: T, controlFirst: E, width: D, ...O }) {
9
- let { enhancedRules: k, numericClass: A, getHandlers: j } = i({
10
- min: p,
11
- max: m,
12
- rules: C,
13
- inputClassName: x,
14
- stepper: u,
15
- onChange: S,
16
- passthroughProps: O
17
- });
18
- return /* @__PURE__ */ a(t, {
19
- control: s,
20
- name: c,
21
- label: l,
22
- description: w,
23
- rules: k,
24
- horizontal: T,
25
- controlFirst: E,
26
- width: D,
27
- children: ({ id: t, "aria-invalid": i, ...s }) => {
28
- let c = s.value, { handleIncrement: l, handleDecrement: u, handleKeyDown: x, handleBlur: S, numericOnValueChange: C } = j({
29
- currentValue: c,
30
- field: s
31
- });
32
- return /* @__PURE__ */ o("div", {
33
- className: "flex items-center",
34
- children: [/* @__PURE__ */ a(n, {
35
- min: d,
36
- max: f,
37
- "aria-invalid": i,
38
- value: c ?? "",
39
- onValueChange: C,
40
- thousandSeparator: h,
41
- decimalScale: v,
42
- fixedDecimalScale: _,
43
- allowNegative: p < 0,
44
- valueIsNumericString: !1,
45
- onBlur: S,
46
- suffix: y,
47
- prefix: b,
48
- placeholder: g || "0",
49
- getInputRef: s.ref,
50
- onKeyDown: x,
51
- name: s.name,
52
- ...O,
53
- id: t,
54
- className: e(A, O.className)
55
- }), /* @__PURE__ */ a(r, {
56
- onIncrement: l,
57
- onDecrement: u,
58
- disableIncrement: c !== void 0 && c >= m,
59
- disableDecrement: c !== void 0 && c <= p
60
- })]
61
- });
62
- }
63
- });
1
+ import { get as e, isNil as t } from "lodash-es";
2
+ // src/Form/FormSelect/useFormSelect.ts
3
+ function n(e) {
4
+ return e.isMulti === !0;
64
5
  }
65
- export { s as FormNumberInput };
6
+ function r(r) {
7
+ let { options: i, injectOptions: a, placeholder: o = "Select...", description: s, disabled: c, isClearable: l = !0, isSearchable: u = !0, isLoading: d = !1, className: f, rules: p, onSearchTextChange: m, hasNextPage: h, isFetchingNextPage: g, fetchNextPage: _, maxTagCount: v = "responsive", tagRender: y, showSelectAll: b = !1, allowClear: x, width: S } = r, C = e(p, "required"), w = !t(C) && C !== !1, T = {
8
+ options: i,
9
+ injectOptions: a,
10
+ placeholder: o,
11
+ isClearable: l,
12
+ isSearchable: u,
13
+ isLoading: d,
14
+ className: f,
15
+ disabled: c,
16
+ onSearchTextChange: m,
17
+ hasNextPage: h,
18
+ isFetchingNextPage: g,
19
+ fetchNextPage: _,
20
+ maxTagCount: v,
21
+ tagRender: y,
22
+ showSelectAll: b,
23
+ allowClear: x,
24
+ width: S
25
+ };
26
+ return {
27
+ isRequired: w,
28
+ description: s,
29
+ enhancedRules: (() => {
30
+ if (!p) return p;
31
+ let e = { ...p };
32
+ return w && typeof e.required != "string" && typeof e.required != "object" ? e.required = "This field is required" : typeof e.required == "object" && !e.required.message && (e.required = {
33
+ ...e.required,
34
+ message: "This field is required"
35
+ }), e;
36
+ })(),
37
+ baseSelectProps: T,
38
+ isMulti: n(r),
39
+ createChangeHandlers: (e) => ({
40
+ onChangeMulti: (t) => {
41
+ e.onChange(t), n(r) && r.onChange && r.onChange(t);
42
+ },
43
+ onChangeSingle: (t) => {
44
+ e.onChange(t), !n(r) && r.onChange && r.onChange(t);
45
+ }
46
+ })
47
+ };
48
+ }
49
+ export { r as useFormSelect };
package/dist/index210.cjs CHANGED
@@ -1 +1 @@
1
- let e=require("lodash-es");function t(e){return e.isMulti===!0}function n(n){let{options:r,injectOptions:i,placeholder:a=`Select...`,description:o,disabled:s,isClearable:c=!0,isSearchable:l=!0,isLoading:u=!1,className:d,rules:f,onSearchTextChange:p,hasNextPage:m,isFetchingNextPage:h,fetchNextPage:g,maxTagCount:_=`responsive`,tagRender:v,showSelectAll:y=!1,allowClear:b,width:x}=n,S=(0,e.get)(f,`required`),C=!(0,e.isNil)(S)&&S!==!1,w={options:r,injectOptions:i,placeholder:a,isClearable:c,isSearchable:l,isLoading:u,className:d,disabled:s,onSearchTextChange:p,hasNextPage:m,isFetchingNextPage:h,fetchNextPage:g,maxTagCount:_,tagRender:v,showSelectAll:y,allowClear:b,width:x};return{isRequired:C,description:o,enhancedRules:(()=>{if(!f)return f;let e={...f};return C&&typeof e.required!=`string`&&typeof e.required!=`object`?e.required=`This field is required`:typeof e.required==`object`&&!e.required.message&&(e.required={...e.required,message:`This field is required`}),e})(),baseSelectProps:w,isMulti:t(n),createChangeHandlers:e=>({onChangeMulti:r=>{e.onChange(r),t(n)&&n.onChange&&n.onChange(r)},onChangeSingle:r=>{e.onChange(r),!t(n)&&n.onChange&&n.onChange(r)}})}}exports.useFormSelect=n;
1
+ const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index34.cjs"),r=require("./index124.cjs");let i=require("react"),a=require("@stylexjs/stylex");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s={tag:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kOIVth:`xvh977a`,kg3NbH:`x18a9hih`,k8WAf4:`x1dus959`,kGuDYH:`xboafo0`,$$css:!0},moreBadge:{kGuDYH:`xboafo0`,kkrTdU:`xt0e3qv`,$$css:!0}};function c({selectedOptions:e,maxTagCount:a=`responsive`,onRemove:c,disabled:l,tagRender:u}){let d=(0,i.useRef)(null),[f,p]=(0,i.useState)(e.length),[m,h]=(0,i.useState)([]);(0,i.useEffect)(()=>{if(a===`responsive`&&d.current){let t=d.current,n=t.offsetWidth-60,r=0,i=0,a=Array.from(t.children);for(let e=0;e<a.length;e++){let t=a[e];if(t.classList?.contains(`select-tag`)){let e=t.offsetWidth+4;if(r+e<=n)r+=e,i++;else break}}i<e.length?(p(Math.max(1,i-1)),h(e.slice(Math.max(1,i-1)))):(p(e.length),h([]))}else typeof a==`number`?(p(Math.min(a,e.length)),h(e.slice(a))):(p(e.length),h([]))},[e,a]);let g=e.slice(0,f),_=e.length-f;return(0,o.jsxs)(`div`,{ref:d,className:`x78zum5 x1a02dak xvh977a x6s0dn4 x845mor xeuugli`,children:[g.map(e=>{let r=()=>c(e.value);return u?(0,o.jsx)(`span`,{className:`select-tag`,children:u(e,r)},String(e.value)):(0,o.jsxs)(n.Badge,{variant:`secondary`,className:`select-tag`,sx:s.tag,children:[e.icon&&(0,o.jsx)(`span`,{children:e.icon}),(0,o.jsx)(`span`,{children:e.label}),!l&&(0,o.jsx)(`span`,{onClick:e=>{e.stopPropagation(),r()},children:(0,o.jsx)(t.Icons.XIcon,{className:`x1jw3ynk xvle69y x1ypdohk x1ks1olk x1o7uuvo`})})]},String(e.value))}),_>0&&(0,o.jsx)(r.TooltipProvider,{children:(0,o.jsxs)(r.Tooltip,{children:[(0,o.jsx)(r.TooltipTrigger,{asChild:!0,children:(0,o.jsxs)(n.Badge,{variant:`outline`,sx:s.moreBadge,children:[`+`,_]})}),(0,o.jsx)(r.TooltipContent,{children:(0,o.jsx)(`div`,{className:`x78zum5 xdt5ytf xvh977a x1ok5v8c`,children:m.map(e=>(0,o.jsx)(`span`,{children:e.label},String(e.value)))})})]})})]})}exports.MultiSelectTags=c;
package/dist/index210.js CHANGED
@@ -1,49 +1,77 @@
1
- import { get as e, isNil as t } from "lodash-es";
2
- // src/Form/FormSelect/useFormSelect.ts
3
- function n(e) {
4
- return e.isMulti === !0;
5
- }
6
- function r(r) {
7
- let { options: i, injectOptions: a, placeholder: o = "Select...", description: s, disabled: c, isClearable: l = !0, isSearchable: u = !0, isLoading: d = !1, className: f, rules: p, onSearchTextChange: m, hasNextPage: h, isFetchingNextPage: g, fetchNextPage: _, maxTagCount: v = "responsive", tagRender: y, showSelectAll: b = !1, allowClear: x, width: S } = r, C = e(p, "required"), w = !t(C) && C !== !1, T = {
8
- options: i,
9
- injectOptions: a,
10
- placeholder: o,
11
- isClearable: l,
12
- isSearchable: u,
13
- isLoading: d,
14
- className: f,
15
- disabled: c,
16
- onSearchTextChange: m,
17
- hasNextPage: h,
18
- isFetchingNextPage: g,
19
- fetchNextPage: _,
20
- maxTagCount: v,
21
- tagRender: y,
22
- showSelectAll: b,
23
- allowClear: x,
24
- width: S
25
- };
26
- return {
27
- isRequired: w,
28
- description: s,
29
- enhancedRules: (() => {
30
- if (!p) return p;
31
- let e = { ...p };
32
- return w && typeof e.required != "string" && typeof e.required != "object" ? e.required = "This field is required" : typeof e.required == "object" && !e.required.message && (e.required = {
33
- ...e.required,
34
- message: "This field is required"
35
- }), e;
36
- })(),
37
- baseSelectProps: T,
38
- isMulti: n(r),
39
- createChangeHandlers: (e) => ({
40
- onChangeMulti: (t) => {
41
- e.onChange(t), n(r) && r.onChange && r.onChange(t);
42
- },
43
- onChangeSingle: (t) => {
44
- e.onChange(t), !n(r) && r.onChange && r.onChange(t);
1
+ import { Icons as e } from "./index4.js";
2
+ import { Badge as t } from "./index34.js";
3
+ import { Tooltip as n, TooltipContent as r, TooltipProvider as i, TooltipTrigger as a } from "./index124.js";
4
+ import { useEffect as o, useRef as s, useState as c } from "react";
5
+ import "@stylexjs/stylex";
6
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
7
+ // src/Select/MultiSelectTags.tsx
8
+ var d = {
9
+ tag: {
10
+ k1xSpc: "x3nfvp2",
11
+ kGNEyG: "x6s0dn4",
12
+ kOIVth: "xvh977a",
13
+ kg3NbH: "x18a9hih",
14
+ k8WAf4: "x1dus959",
15
+ kGuDYH: "xboafo0",
16
+ $$css: !0
17
+ },
18
+ moreBadge: {
19
+ kGuDYH: "xboafo0",
20
+ kkrTdU: "xt0e3qv",
21
+ $$css: !0
22
+ }
23
+ };
24
+ function f({ selectedOptions: f, maxTagCount: p = "responsive", onRemove: m, disabled: h, tagRender: g }) {
25
+ let _ = s(null), [v, y] = c(f.length), [b, x] = c([]);
26
+ o(() => {
27
+ if (p === "responsive" && _.current) {
28
+ let e = _.current, t = e.offsetWidth - 60, n = 0, r = 0, i = Array.from(e.children);
29
+ for (let e = 0; e < i.length; e++) {
30
+ let a = i[e];
31
+ if (a.classList?.contains("select-tag")) {
32
+ let e = a.offsetWidth + 4;
33
+ if (n + e <= t) n += e, r++;
34
+ else break;
35
+ }
45
36
  }
46
- })
47
- };
37
+ r < f.length ? (y(Math.max(1, r - 1)), x(f.slice(Math.max(1, r - 1)))) : (y(f.length), x([]));
38
+ } else typeof p == "number" ? (y(Math.min(p, f.length)), x(f.slice(p))) : (y(f.length), x([]));
39
+ }, [f, p]);
40
+ let S = f.slice(0, v), C = f.length - v;
41
+ return /* @__PURE__ */ u("div", {
42
+ ref: _,
43
+ className: "x78zum5 x1a02dak xvh977a x6s0dn4 x845mor xeuugli",
44
+ children: [S.map((n) => {
45
+ let r = () => m(n.value);
46
+ return g ? /* @__PURE__ */ l("span", {
47
+ className: "select-tag",
48
+ children: g(n, r)
49
+ }, String(n.value)) : /* @__PURE__ */ u(t, {
50
+ variant: "secondary",
51
+ className: "select-tag",
52
+ sx: d.tag,
53
+ children: [
54
+ n.icon && /* @__PURE__ */ l("span", { children: n.icon }),
55
+ /* @__PURE__ */ l("span", { children: n.label }),
56
+ !h && /* @__PURE__ */ l("span", {
57
+ onClick: (e) => {
58
+ e.stopPropagation(), r();
59
+ },
60
+ children: /* @__PURE__ */ l(e.XIcon, { className: "x1jw3ynk xvle69y x1ypdohk x1ks1olk x1o7uuvo" })
61
+ })
62
+ ]
63
+ }, String(n.value));
64
+ }), C > 0 && /* @__PURE__ */ l(i, { children: /* @__PURE__ */ u(n, { children: [/* @__PURE__ */ l(a, {
65
+ asChild: !0,
66
+ children: /* @__PURE__ */ u(t, {
67
+ variant: "outline",
68
+ sx: d.moreBadge,
69
+ children: ["+", C]
70
+ })
71
+ }), /* @__PURE__ */ l(r, { children: /* @__PURE__ */ l("div", {
72
+ className: "x78zum5 xdt5ytf xvh977a x1ok5v8c",
73
+ children: b.map((e) => /* @__PURE__ */ l("span", { children: e.label }, String(e.value)))
74
+ }) })] }) })]
75
+ });
48
76
  }
49
- export { r as useFormSelect };
77
+ export { f as MultiSelectTags };
package/dist/index211.cjs CHANGED
@@ -1 +1 @@
1
- const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index34.cjs"),r=require("./index124.cjs");let i=require("react"),a=require("@stylexjs/stylex");a=e.__toESM(a,1);let o=require("react/jsx-runtime");var s={tag:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kOIVth:`xvh977a`,kg3NbH:`x18a9hih`,k8WAf4:`x1dus959`,kGuDYH:`xboafo0`,$$css:!0},moreBadge:{kGuDYH:`xboafo0`,kkrTdU:`xt0e3qv`,$$css:!0}};function c({selectedOptions:e,maxTagCount:a=`responsive`,onRemove:c,disabled:l,tagRender:u}){let d=(0,i.useRef)(null),[f,p]=(0,i.useState)(e.length),[m,h]=(0,i.useState)([]);(0,i.useEffect)(()=>{if(a===`responsive`&&d.current){let t=d.current,n=t.offsetWidth-60,r=0,i=0,a=Array.from(t.children);for(let e=0;e<a.length;e++){let t=a[e];if(t.classList?.contains(`select-tag`)){let e=t.offsetWidth+4;if(r+e<=n)r+=e,i++;else break}}i<e.length?(p(Math.max(1,i-1)),h(e.slice(Math.max(1,i-1)))):(p(e.length),h([]))}else typeof a==`number`?(p(Math.min(a,e.length)),h(e.slice(a))):(p(e.length),h([]))},[e,a]);let g=e.slice(0,f),_=e.length-f;return(0,o.jsxs)(`div`,{ref:d,className:`x78zum5 x1a02dak xvh977a x6s0dn4 x845mor xeuugli`,children:[g.map(e=>{let r=()=>c(e.value);return u?(0,o.jsx)(`span`,{className:`select-tag`,children:u(e,r)},String(e.value)):(0,o.jsxs)(n.Badge,{variant:`secondary`,className:`select-tag`,sx:s.tag,children:[e.icon&&(0,o.jsx)(`span`,{children:e.icon}),(0,o.jsx)(`span`,{children:e.label}),!l&&(0,o.jsx)(`span`,{onClick:e=>{e.stopPropagation(),r()},children:(0,o.jsx)(t.Icons.XIcon,{className:`x1jw3ynk xvle69y x1ypdohk x1ks1olk x1o7uuvo`})})]},String(e.value))}),_>0&&(0,o.jsx)(r.TooltipProvider,{children:(0,o.jsxs)(r.Tooltip,{children:[(0,o.jsx)(r.TooltipTrigger,{asChild:!0,children:(0,o.jsxs)(n.Badge,{variant:`outline`,sx:s.moreBadge,children:[`+`,_]})}),(0,o.jsx)(r.TooltipContent,{children:(0,o.jsx)(`div`,{className:`x78zum5 xdt5ytf xvh977a x1ok5v8c`,children:m.map(e=>(0,o.jsx)(`span`,{children:e.label},String(e.value)))})})]})})]})}exports.MultiSelectTags=c;
1
+ const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index23.cjs"),r=require("./index115.cjs"),i=require("./index210.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("@stylexjs/stylex");o=e.__toESM(o,1);let s=require("react/jsx-runtime"),c=require("lodash-es");var l={popoverContent:{kmVPX3:`x1717udv`,kzqmXN:`x9ndnb8`,$$css:!0}};function u(e){return e.isMulti===!0}function d(e){let{options:o,injectOptions:d=[],placeholder:f=`Select...`,isClearable:p=!0,isSearchable:m=!0,isLoading:h=!1,className:g=``,disabled:_=!1,onSearchTextChange:v,hasNextPage:y=!1,isFetchingNextPage:b=!1,fetchNextPage:x,maxTagCount:S=`responsive`,tagRender:C,showSelectAll:w=!1,width:T}=e,E=u(e),{value:D}=e,O=n.resolveWidth(T),[k,A]=(0,a.useState)(!1),[j,M]=(0,a.useState)(``),N=(0,a.useRef)(null),P=(0,a.useMemo)(()=>{let e=new Map;for(let t of d)e.set(t.value,t);for(let t of o)e.set(t.value,t);return Array.from(e.values())},[o,d]),F=(0,a.useMemo)(()=>j.trim()?P.filter(e=>e.label.toLowerCase().includes(j.toLowerCase())):P,[P,j]),I=(0,a.useMemo)(()=>(0,c.isNil)(D)?[]:E?Array.isArray(D)?D:[]:[D],[D,E]),L=(0,a.useMemo)(()=>P.filter(e=>I.includes(e.value)),[P,I]),R=t=>{if(!_){if(E){let n=I.includes(t)?I.filter(e=>e!==t):[...I,t];e.onChange&&e.onChange(n)}else e.onChange&&e.onChange(t),A(!1)}},z=t=>{t.stopPropagation(),!_&&(E?e.onChange&&e.onChange([]):e.onChange&&e.onChange(void 0))},B=e=>{M(e.target.value),v?.(e.target.value)},V=e=>{let{scrollTop:t,scrollHeight:n,clientHeight:r}=e.currentTarget;n-t-r<20&&y&&!b&&x?.()},H=(0,a.useMemo)(()=>E?``:P.find(e=>e.value===I[0])?.label||``,[I,P,E]),U=t=>{if(_||!u(e))return;let n=I.filter(e=>e!==t);e.onChange&&e.onChange(n)},W=()=>{if(!_&&u(e)){if(I.length===F.length)e.onChange&&e.onChange([]);else{let t=F.map(e=>e.value);e.onChange&&e.onChange(t)}}},G={0:{className:`x78zum5 x6s0dn4 xh8yej3 x1nedpf2 xsda711 xmkeg23 x1y0btm7 xsyin8q x1ryrjj2 x1bilvtl xboafo0 x1mlyrtw x84br7x x1ypdohk x1a2a7pz x1dsmnui x16mfhj0 xx6bhzk`},2:{className:`x78zum5 x6s0dn4 xh8yej3 x1nedpf2 xsda711 xmkeg23 x1y0btm7 x1ryrjj2 x1bilvtl xboafo0 x1mlyrtw x84br7x x1ypdohk x1a2a7pz x16mfhj0 xx6bhzk x1puiyjm x1ivlsgs`},1:{className:`x78zum5 x6s0dn4 xh8yej3 x1nedpf2 xsda711 xmkeg23 x1y0btm7 xsyin8q x1ryrjj2 x1bilvtl xboafo0 x84br7x x1a2a7pz x1dsmnui x16mfhj0 xx6bhzk x1qry0bl x1h6gzvc x197sbye`},3:{className:`x78zum5 x6s0dn4 xh8yej3 x1nedpf2 xsda711 xmkeg23 x1y0btm7 x1ryrjj2 x1bilvtl xboafo0 x84br7x x1a2a7pz x16mfhj0 xx6bhzk x1puiyjm x1ivlsgs x1qry0bl x1h6gzvc x197sbye`}}[!!k<<1|!!_],K=g?`${G.className||``} ${g}`.trim():G.className;return(0,s.jsxs)(r.Popover,{open:k,onOpenChange:_?void 0:A,children:[(0,s.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,s.jsxs)(`button`,{type:`button`,"data-slot":`select`,"data-width":T,...G,style:{...G.style,...O?{width:O,minWidth:O}:{}},className:K,onClick:()=>!_&&A(e=>!e),disabled:_,children:[E&&I.length>0?(0,s.jsx)(i.MultiSelectTags,{selectedOptions:L,maxTagCount:S,onRemove:U,disabled:_,tagRender:C}):(0,s.jsx)(`span`,{className:`x845mor xb3r6kr xlyipyv xuxw1ft xdpxx8g xboafo0`,children:H||(0,s.jsx)(`span`,{className:`xw3nh4a`,children:f})}),p&&I.length>0&&!_&&(0,s.jsx)(t.Icons.XIcon,{className:`x1xvt488 xf08kfj x13zjp5t xw3nh4a x2lah0s x1ypdohk x1mqvv6a`,onClick:z}),(0,s.jsx)(t.Icons.ChevronDownIcon,{className:`x1xvt488 xf08kfj x13zjp5t xw3nh4a x2lah0s`})]})}),(0,s.jsxs)(r.PopoverContent,{sx:l.popoverContent,align:`start`,children:[m&&!_&&(0,s.jsxs)(`div`,{className:`x78zum5 x6s0dn4 x97vtpp x1bilvtl xso031l x1q0q8m5 x1c03eaz`,children:[(0,s.jsx)(t.Icons.SearchIcon,{className:`xcdlrvm x1l36t39 xpoiemb xw3nh4a`}),(0,s.jsx)(`input`,{ref:N,className:`xh8yej3 x1a2a7pz xc342km xjbqb8w xboafo0 x84br7x`,placeholder:`Search...`,value:j,onChange:B,autoFocus:!0,disabled:_})]}),E&&w&&!_&&F.length>0&&(0,s.jsxs)(`div`,{className:`x78zum5 x6s0dn4 x1ryrjj2 x18g2hj5 xso031l x1q0q8m5 x1c03eaz x1ypdohk xboafo0 xk50ysn x9p52ec`,onClick:W,children:[(0,s.jsx)(`span`,{className:`x845mor`,children:I.length===F.length?`Deselect all`:`Select all`}),(0,s.jsxs)(`span`,{className:`xw3nh4a`,children:[`(`,I.length,`/`,F.length,`)`]})]}),(0,s.jsx)(`div`,{className:`x17l2srq x1odjw0f`,onScroll:V,children:h&&P.length===0?(0,s.jsx)(`div`,{className:`x79iv2k x2b8uid xw3nh4a xboafo0`,children:`Loading...`}):F.length===0?(0,s.jsx)(`div`,{className:`x79iv2k x2b8uid xw3nh4a xboafo0`,children:`No data`}):(0,s.jsxs)(s.Fragment,{children:[F.map(e=>{let n=I.includes(e.value);return(0,s.jsxs)(`div`,{...{0:{className:`x78zum5 x6s0dn4 x1ryrjj2 x1bilvtl x1ypdohk xboafo0 x84br7x x9p52ec`},2:{className:`x78zum5 x6s0dn4 x1ryrjj2 x1bilvtl x1ypdohk xboafo0 x84br7x x9p52ec x1xke173`},1:{className:`x78zum5 x6s0dn4 x1ryrjj2 x1bilvtl x1ypdohk xboafo0 x84br7x x9p52ec x47corl x197sbye`},3:{className:`x78zum5 x6s0dn4 x1ryrjj2 x1bilvtl x1ypdohk xboafo0 x84br7x x9p52ec x1xke173 x47corl x197sbye`}}[!!n<<1|!!_],onClick:()=>R(e.value),children:[e.icon&&(0,s.jsx)(`span`,{className:`xpoiemb`,children:e.icon}),(0,s.jsx)(`span`,{className:`x845mor xb3r6kr xlyipyv xuxw1ft`,children:e.label}),E&&(0,s.jsx)(`span`,{...{0:{className:`x13zjp5t xcdlrvm x1l36t39 xmkeg23 x1y0btm7 xsyin8q x1q0v2j7 x78zum5 x6s0dn4 xl56j7k x1mlyrtw`},1:{className:`x13zjp5t xcdlrvm x1l36t39 xmkeg23 x1y0btm7 x1q0v2j7 x78zum5 x6s0dn4 xl56j7k x1j7ufkg x1khvrlk xstwp1q`}}[!!n|0],children:n&&(0,s.jsx)(t.Icons.CheckIcon,{className:`x1jw3ynk xvle69y`})}),!E&&n&&(0,s.jsx)(t.Icons.CheckIcon,{className:`x1jw3ynk xvle69y x6gpbkk`})]},String(e.value))}),(b||y&&F.length>0)&&(0,s.jsx)(`div`,{className:`x79iv2k x2b8uid xw3nh4a xboafo0`,children:b?`Loading more...`:``})]})})]})]})}exports.BaseSelect=d,exports.default=d;