@clubmed/trident-ui 1.0.1 → 1.1.0-beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (258) hide show
  1. package/BeachView-D7jbrjhw.js +6 -0
  2. package/BeachView-D7jbrjhw.js.map +1 -0
  3. package/CHANGELOG.md +15 -0
  4. package/GardenView-C4ezQxpq.js +6 -0
  5. package/GardenView-C4ezQxpq.js.map +1 -0
  6. package/PoolView-P2ZBXZA9.js +6 -0
  7. package/PoolView-P2ZBXZA9.js.map +1 -0
  8. package/README.md +4 -22
  9. package/SnowSerenity-DQAGaSZc.js +6 -0
  10. package/SnowSerenity-DQAGaSZc.js.map +1 -0
  11. package/SunView-D_XYC3V5.js +6 -0
  12. package/SunView-D_XYC3V5.js.map +1 -0
  13. package/Twitter-B4o_qFxz.js +6 -0
  14. package/Twitter-B4o_qFxz.js.map +1 -0
  15. package/WithView-CM90ePcH.js +6 -0
  16. package/WithView-CM90ePcH.js.map +1 -0
  17. package/assets/icons/Services/SnowSerenity.svg +8 -0
  18. package/assets/icons/Socials/Twitter.svg +3 -4
  19. package/assets/icons/Utilities/BeachView.svg +3 -0
  20. package/assets/icons/Utilities/GardenView.svg +3 -0
  21. package/assets/icons/Utilities/PoolView.svg +3 -0
  22. package/assets/icons/Utilities/SunView.svg +3 -0
  23. package/assets/icons/Utilities/WithView.svg +3 -0
  24. package/assets/style.css +1 -1
  25. package/atoms/Icons/Iconics.d.ts +2 -2
  26. package/atoms/Icons/svg/Services.js +4 -0
  27. package/atoms/Icons/svg/Services.js.map +1 -1
  28. package/atoms/Icons/svg/Socials.js +1 -1
  29. package/atoms/Icons/svg/Utilities.js +20 -0
  30. package/atoms/Icons/svg/Utilities.js.map +1 -1
  31. package/atoms/Icons/svg-use/Services.js +33 -28
  32. package/atoms/Icons/svg-use/Services.js.map +1 -1
  33. package/atoms/Icons/svg-use/Utilities.js +100 -75
  34. package/atoms/Icons/svg-use/Utilities.js.map +1 -1
  35. package/hooks/useSafeBoop.js +1 -1
  36. package/hooks/useValue.d.ts +1 -1
  37. package/hooks/useValue.js +18 -20
  38. package/hooks/useValue.js.map +1 -1
  39. package/molecules/Backdrop.js +1 -1
  40. package/molecules/Buttons/Button.js +1 -1
  41. package/molecules/Buttons/ButtonAnchor.js +1 -1
  42. package/molecules/ElasticHeight.js +1 -1
  43. package/molecules/Forms/Checkboxes/Checkbox.js +1 -1
  44. package/molecules/Forms/DateField.js +41 -39
  45. package/molecules/Forms/DateField.js.map +1 -1
  46. package/molecules/Forms/Filter.js +1 -1
  47. package/molecules/Forms/FormControl.d.ts +1 -1
  48. package/molecules/Forms/FormControl.js +23 -12
  49. package/molecules/Forms/FormControl.js.map +1 -1
  50. package/molecules/Forms/FormLabel.d.ts +2 -1
  51. package/molecules/Forms/FormLabel.js +20 -19
  52. package/molecules/Forms/FormLabel.js.map +1 -1
  53. package/molecules/Forms/NumberField.d.ts +8 -7
  54. package/molecules/Forms/NumberField.js +42 -40
  55. package/molecules/Forms/NumberField.js.map +1 -1
  56. package/molecules/Forms/Password/Password.js +23 -21
  57. package/molecules/Forms/Password/Password.js.map +1 -1
  58. package/molecules/Forms/Radios/Radio.js +1 -1
  59. package/molecules/Forms/Range.js +2 -4
  60. package/molecules/Forms/Range.js.map +1 -1
  61. package/molecules/Forms/Select.js +18 -16
  62. package/molecules/Forms/Select.js.map +1 -1
  63. package/molecules/Forms/Switch.js +1 -1
  64. package/molecules/Forms/TextField.d.ts +2 -0
  65. package/molecules/Forms/TextField.js +33 -30
  66. package/molecules/Forms/TextField.js.map +1 -1
  67. package/molecules/HamburgerIcon.js +1 -1
  68. package/molecules/Loader.js +1 -1
  69. package/molecules/Popin.js +1 -1
  70. package/molecules/Tabs/TabsHeader.js +1 -1
  71. package/molecules/Tabs/TabsHeading.js +1 -1
  72. package/molecules/Tabs/TabsPanel.js +1 -1
  73. package/package.json +16 -21
  74. package/{react-spring_web.modern-BPtZcx1z.js → react-spring_web.modern-DyRwH83_.js} +1275 -1781
  75. package/{react-spring_web.modern-BPtZcx1z.js.map → react-spring_web.modern-DyRwH83_.js.map} +1 -1
  76. package/Twitter-DtXFJEB1.js +0 -6
  77. package/Twitter-DtXFJEB1.js.map +0 -1
  78. package/atoms/Icons/fonts/Actions.d.ts +0 -2
  79. package/atoms/Icons/fonts/Actions.js +0 -113
  80. package/atoms/Icons/fonts/Actions.js.map +0 -1
  81. package/atoms/Icons/fonts/Activities.d.ts +0 -2
  82. package/atoms/Icons/fonts/Activities.js +0 -145
  83. package/atoms/Icons/fonts/Activities.js.map +0 -1
  84. package/atoms/Icons/fonts/Brand.d.ts +0 -2
  85. package/atoms/Icons/fonts/Brand.js +0 -92
  86. package/atoms/Icons/fonts/Brand.js.map +0 -1
  87. package/atoms/Icons/fonts/Covid.d.ts +0 -2
  88. package/atoms/Icons/fonts/Covid.js +0 -61
  89. package/atoms/Icons/fonts/Covid.js.map +0 -1
  90. package/atoms/Icons/fonts/FontIcon.d.ts +0 -5
  91. package/atoms/Icons/fonts/FontIcon.js +0 -24
  92. package/atoms/Icons/fonts/FontIcon.js.map +0 -1
  93. package/atoms/Icons/fonts/FontIconResolver.d.ts +0 -3
  94. package/atoms/Icons/fonts/FontIconResolver.js +0 -14
  95. package/atoms/Icons/fonts/FontIconResolver.js.map +0 -1
  96. package/atoms/Icons/fonts/Food.d.ts +0 -2
  97. package/atoms/Icons/fonts/Food.js +0 -106
  98. package/atoms/Icons/fonts/Food.js.map +0 -1
  99. package/atoms/Icons/fonts/HappyToCare.d.ts +0 -2
  100. package/atoms/Icons/fonts/HappyToCare.js +0 -58
  101. package/atoms/Icons/fonts/HappyToCare.js.map +0 -1
  102. package/atoms/Icons/fonts/Places.d.ts +0 -2
  103. package/atoms/Icons/fonts/Places.js +0 -61
  104. package/atoms/Icons/fonts/Places.js.map +0 -1
  105. package/atoms/Icons/fonts/Room.d.ts +0 -2
  106. package/atoms/Icons/fonts/Room.js +0 -115
  107. package/atoms/Icons/fonts/Room.js.map +0 -1
  108. package/atoms/Icons/fonts/Services.d.ts +0 -2
  109. package/atoms/Icons/fonts/Services.js +0 -73
  110. package/atoms/Icons/fonts/Services.js.map +0 -1
  111. package/atoms/Icons/fonts/Socials.d.ts +0 -2
  112. package/atoms/Icons/fonts/Socials.js +0 -73
  113. package/atoms/Icons/fonts/Socials.js.map +0 -1
  114. package/atoms/Icons/fonts/Transports.d.ts +0 -2
  115. package/atoms/Icons/fonts/Transports.js +0 -49
  116. package/atoms/Icons/fonts/Transports.js.map +0 -1
  117. package/atoms/Icons/fonts/Utilities.d.ts +0 -2
  118. package/atoms/Icons/fonts/Utilities.js +0 -154
  119. package/atoms/Icons/fonts/Utilities.js.map +0 -1
  120. package/atoms/Icons/fonts/index.d.ts +0 -2
  121. package/atoms/Icons/fonts/index.js +0 -7
  122. package/atoms/Icons/fonts/index.js.map +0 -1
  123. package/button-l0sNRNKZ.js +0 -2
  124. package/button-l0sNRNKZ.js.map +0 -1
  125. package/controls-l0sNRNKZ.js +0 -2
  126. package/controls-l0sNRNKZ.js.map +0 -1
  127. package/fonts/Actions/tui-actions.css +0 -52
  128. package/fonts/Actions/tui-actions.eot +0 -0
  129. package/fonts/Actions/tui-actions.less +0 -49
  130. package/fonts/Actions/tui-actions.module.less +0 -52
  131. package/fonts/Actions/tui-actions.scss +0 -84
  132. package/fonts/Actions/tui-actions.styl +0 -49
  133. package/fonts/Actions/tui-actions.svg +0 -111
  134. package/fonts/Actions/tui-actions.symbol.svg +0 -67
  135. package/fonts/Actions/tui-actions.ttf +0 -0
  136. package/fonts/Actions/tui-actions.woff +0 -0
  137. package/fonts/Actions/tui-actions.woff2 +0 -0
  138. package/fonts/Activities/tui-activities.css +0 -64
  139. package/fonts/Activities/tui-activities.eot +0 -0
  140. package/fonts/Activities/tui-activities.less +0 -61
  141. package/fonts/Activities/tui-activities.module.less +0 -64
  142. package/fonts/Activities/tui-activities.scss +0 -108
  143. package/fonts/Activities/tui-activities.styl +0 -61
  144. package/fonts/Activities/tui-activities.svg +0 -147
  145. package/fonts/Activities/tui-activities.symbol.svg +0 -91
  146. package/fonts/Activities/tui-activities.ttf +0 -0
  147. package/fonts/Activities/tui-activities.woff +0 -0
  148. package/fonts/Activities/tui-activities.woff2 +0 -0
  149. package/fonts/Brand/tui-brand.css +0 -36
  150. package/fonts/Brand/tui-brand.eot +0 -0
  151. package/fonts/Brand/tui-brand.less +0 -33
  152. package/fonts/Brand/tui-brand.module.less +0 -36
  153. package/fonts/Brand/tui-brand.scss +0 -52
  154. package/fonts/Brand/tui-brand.styl +0 -33
  155. package/fonts/Brand/tui-brand.svg +0 -63
  156. package/fonts/Brand/tui-brand.symbol.svg +0 -59
  157. package/fonts/Brand/tui-brand.ttf +0 -0
  158. package/fonts/Brand/tui-brand.woff +0 -0
  159. package/fonts/Brand/tui-brand.woff2 +0 -0
  160. package/fonts/Covid/tui-covid.css +0 -36
  161. package/fonts/Covid/tui-covid.eot +0 -0
  162. package/fonts/Covid/tui-covid.less +0 -33
  163. package/fonts/Covid/tui-covid.module.less +0 -36
  164. package/fonts/Covid/tui-covid.scss +0 -52
  165. package/fonts/Covid/tui-covid.styl +0 -33
  166. package/fonts/Covid/tui-covid.svg +0 -63
  167. package/fonts/Covid/tui-covid.symbol.svg +0 -36
  168. package/fonts/Covid/tui-covid.ttf +0 -0
  169. package/fonts/Covid/tui-covid.woff +0 -0
  170. package/fonts/Covid/tui-covid.woff2 +0 -0
  171. package/fonts/Food/tui-food.css +0 -51
  172. package/fonts/Food/tui-food.eot +0 -0
  173. package/fonts/Food/tui-food.less +0 -48
  174. package/fonts/Food/tui-food.module.less +0 -51
  175. package/fonts/Food/tui-food.scss +0 -82
  176. package/fonts/Food/tui-food.styl +0 -48
  177. package/fonts/Food/tui-food.svg +0 -108
  178. package/fonts/Food/tui-food.symbol.svg +0 -65
  179. package/fonts/Food/tui-food.ttf +0 -0
  180. package/fonts/Food/tui-food.woff +0 -0
  181. package/fonts/Food/tui-food.woff2 +0 -0
  182. package/fonts/HappyToCare/tui-happy-to-care.css +0 -35
  183. package/fonts/HappyToCare/tui-happy-to-care.eot +0 -0
  184. package/fonts/HappyToCare/tui-happy-to-care.less +0 -32
  185. package/fonts/HappyToCare/tui-happy-to-care.module.less +0 -35
  186. package/fonts/HappyToCare/tui-happy-to-care.scss +0 -50
  187. package/fonts/HappyToCare/tui-happy-to-care.styl +0 -32
  188. package/fonts/HappyToCare/tui-happy-to-care.svg +0 -60
  189. package/fonts/HappyToCare/tui-happy-to-care.symbol.svg +0 -34
  190. package/fonts/HappyToCare/tui-happy-to-care.ttf +0 -0
  191. package/fonts/HappyToCare/tui-happy-to-care.woff +0 -0
  192. package/fonts/HappyToCare/tui-happy-to-care.woff2 +0 -0
  193. package/fonts/Places/tui-places.css +0 -36
  194. package/fonts/Places/tui-places.eot +0 -0
  195. package/fonts/Places/tui-places.less +0 -33
  196. package/fonts/Places/tui-places.module.less +0 -36
  197. package/fonts/Places/tui-places.scss +0 -52
  198. package/fonts/Places/tui-places.styl +0 -33
  199. package/fonts/Places/tui-places.svg +0 -63
  200. package/fonts/Places/tui-places.symbol.svg +0 -35
  201. package/fonts/Places/tui-places.ttf +0 -0
  202. package/fonts/Places/tui-places.woff +0 -0
  203. package/fonts/Places/tui-places.woff2 +0 -0
  204. package/fonts/Room/tui-room.css +0 -54
  205. package/fonts/Room/tui-room.eot +0 -0
  206. package/fonts/Room/tui-room.less +0 -51
  207. package/fonts/Room/tui-room.module.less +0 -54
  208. package/fonts/Room/tui-room.scss +0 -88
  209. package/fonts/Room/tui-room.styl +0 -51
  210. package/fonts/Room/tui-room.svg +0 -117
  211. package/fonts/Room/tui-room.symbol.svg +0 -156
  212. package/fonts/Room/tui-room.ttf +0 -0
  213. package/fonts/Room/tui-room.woff +0 -0
  214. package/fonts/Room/tui-room.woff2 +0 -0
  215. package/fonts/Services/tui-services.css +0 -40
  216. package/fonts/Services/tui-services.eot +0 -0
  217. package/fonts/Services/tui-services.less +0 -37
  218. package/fonts/Services/tui-services.module.less +0 -40
  219. package/fonts/Services/tui-services.scss +0 -60
  220. package/fonts/Services/tui-services.styl +0 -37
  221. package/fonts/Services/tui-services.svg +0 -75
  222. package/fonts/Services/tui-services.symbol.svg +0 -106
  223. package/fonts/Services/tui-services.ttf +0 -0
  224. package/fonts/Services/tui-services.woff +0 -0
  225. package/fonts/Services/tui-services.woff2 +0 -0
  226. package/fonts/Socials/tui-socials.css +0 -36
  227. package/fonts/Socials/tui-socials.eot +0 -0
  228. package/fonts/Socials/tui-socials.less +0 -33
  229. package/fonts/Socials/tui-socials.module.less +0 -36
  230. package/fonts/Socials/tui-socials.scss +0 -52
  231. package/fonts/Socials/tui-socials.styl +0 -33
  232. package/fonts/Socials/tui-socials.svg +0 -63
  233. package/fonts/Socials/tui-socials.symbol.svg +0 -78
  234. package/fonts/Socials/tui-socials.ttf +0 -0
  235. package/fonts/Socials/tui-socials.woff +0 -0
  236. package/fonts/Socials/tui-socials.woff2 +0 -0
  237. package/fonts/Transports/tui-transports.css +0 -32
  238. package/fonts/Transports/tui-transports.eot +0 -0
  239. package/fonts/Transports/tui-transports.less +0 -29
  240. package/fonts/Transports/tui-transports.module.less +0 -32
  241. package/fonts/Transports/tui-transports.scss +0 -44
  242. package/fonts/Transports/tui-transports.styl +0 -29
  243. package/fonts/Transports/tui-transports.svg +0 -51
  244. package/fonts/Transports/tui-transports.symbol.svg +0 -53
  245. package/fonts/Transports/tui-transports.ttf +0 -0
  246. package/fonts/Transports/tui-transports.woff +0 -0
  247. package/fonts/Transports/tui-transports.woff2 +0 -0
  248. package/fonts/Utilities/tui-utilities.css +0 -67
  249. package/fonts/Utilities/tui-utilities.eot +0 -0
  250. package/fonts/Utilities/tui-utilities.less +0 -64
  251. package/fonts/Utilities/tui-utilities.module.less +0 -67
  252. package/fonts/Utilities/tui-utilities.scss +0 -114
  253. package/fonts/Utilities/tui-utilities.styl +0 -64
  254. package/fonts/Utilities/tui-utilities.svg +0 -156
  255. package/fonts/Utilities/tui-utilities.symbol.svg +0 -287
  256. package/fonts/Utilities/tui-utilities.ttf +0 -0
  257. package/fonts/Utilities/tui-utilities.woff +0 -0
  258. package/fonts/Utilities/tui-utilities.woff2 +0 -0
@@ -1,42 +1,42 @@
1
1
  import { jsx as m, jsxs as C } from "react/jsx-runtime";
2
- import { c as p } from "../../index-Cu0xwYjD.js";
2
+ import { c as g } from "../../index-Cu0xwYjD.js";
3
3
  import { useId as y } from "react";
4
4
  import { useValue as I } from "../../hooks/useValue.js";
5
- import { Button as g } from "../Buttons/Button.js";
5
+ import { Button as v } from "../Buttons/Button.js";
6
6
  import { FormControl as w } from "./FormControl.js";
7
7
  const F = { width: "28px", height: "28px" };
8
- function V(o) {
8
+ function S(o) {
9
9
  const e = y(), {
10
10
  id: n = e,
11
- name: l = n,
12
- value: c = 0,
13
- onChange: d,
11
+ name: r = n,
12
+ value: d = 0,
13
+ onChange: c,
14
14
  min: t = 0,
15
- max: r = 10,
16
- disabled: i = !1,
15
+ max: i = 10,
16
+ disabled: l = !1,
17
17
  dataTestId: u = "NumberField",
18
18
  ...f
19
19
  } = o, { value: a, setValue: s } = I({
20
- name: l,
21
- defaultValue: c,
20
+ name: r,
21
+ defaultValue: d,
22
22
  formatter: Number,
23
- onChange: d
23
+ onChange: c
24
24
  });
25
25
  return {
26
26
  ...f,
27
27
  id: n,
28
28
  min: t,
29
- max: r,
30
- name: l,
29
+ max: i,
30
+ name: r,
31
31
  value: a,
32
32
  dataTestId: u,
33
- disabled: i,
34
- handleChange: (v) => {
35
- const h = Number(v.target.value);
36
- h >= t && h <= r && s(Number(h));
33
+ disabled: l,
34
+ handleChange: (h) => {
35
+ const N = Number(h.target.value);
36
+ N >= t && N <= i && s(Number(N));
37
37
  },
38
38
  increase: () => {
39
- a < r && s(a + 1);
39
+ a < i && s(a + 1);
40
40
  },
41
41
  decrease: () => {
42
42
  a > t && s(a - 1);
@@ -47,42 +47,44 @@ const k = (o) => {
47
47
  const {
48
48
  disabled: e,
49
49
  min: n,
50
- max: l,
51
- label: c,
52
- description: d,
50
+ max: r,
51
+ label: d,
52
+ description: c,
53
53
  id: t,
54
- dataTestId: r,
55
- value: i,
54
+ dataTestId: i,
55
+ value: l,
56
56
  handleChange: u,
57
57
  increase: f,
58
58
  decrease: a,
59
59
  errorMessage: s,
60
- validationStatus: N,
60
+ validationStatus: x,
61
+ hideRequiredStar: p,
61
62
  required: b,
62
- ...x
63
- } = V(o);
63
+ ...h
64
+ } = S(o);
64
65
  return /* @__PURE__ */ m(
65
66
  w,
66
67
  {
67
68
  id: t,
68
- label: c,
69
- description: d,
70
- className: p("flex items-center justify-between", o.className),
69
+ label: d,
70
+ description: c,
71
+ className: g("flex items-center justify-between", o.className),
71
72
  dataName: "NumberField",
72
- dataTestId: r,
73
+ dataTestId: i,
73
74
  errorMessage: s,
74
- validationStatus: N,
75
+ validationStatus: x,
75
76
  disabled: e,
76
77
  required: b,
78
+ hideRequiredStar: p,
77
79
  layout: "vertical",
78
80
  children: /* @__PURE__ */ C("div", { className: "flex items-center gap-x-8", children: [
79
81
  /* @__PURE__ */ m(
80
- g,
82
+ v,
81
83
  {
82
84
  theme: "yellow",
83
85
  onClick: a,
84
86
  variant: "icon",
85
- disabled: i <= n || e,
87
+ disabled: l <= n || e,
86
88
  icon: "MinusDefault",
87
89
  label: "MINUS"
88
90
  }
@@ -90,8 +92,8 @@ const k = (o) => {
90
92
  /* @__PURE__ */ m(
91
93
  "input",
92
94
  {
93
- ...x,
94
- className: p("text-b2 text-center font-normal outline-none", {
95
+ ...h,
96
+ className: g("text-b2 text-center font-normal outline-none", {
95
97
  "bg-pearl text-grey": e
96
98
  }),
97
99
  style: F,
@@ -100,18 +102,18 @@ const k = (o) => {
100
102
  onChange: u,
101
103
  disabled: e,
102
104
  required: b,
103
- value: i,
105
+ value: l,
104
106
  min: n,
105
- max: l
107
+ max: r
106
108
  }
107
109
  ),
108
110
  /* @__PURE__ */ m(
109
- g,
111
+ v,
110
112
  {
111
113
  theme: "yellow",
112
114
  onClick: f,
113
115
  variant: "icon",
114
- disabled: i >= l || e,
116
+ disabled: l >= r || e,
115
117
  icon: "PlusDefault",
116
118
  label: "PLUS"
117
119
  }
@@ -122,6 +124,6 @@ const k = (o) => {
122
124
  };
123
125
  export {
124
126
  k as NumberField,
125
- V as useNumberField
127
+ S as useNumberField
126
128
  };
127
129
  //# sourceMappingURL=NumberField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberField.js","sources":["../../../lib/molecules/Forms/NumberField.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport { ChangeEvent, useId } from 'react';\n\nimport { useValue } from '@/hooks/useValue.js';\nimport { Button } from '../Buttons/Button';\nimport { FormControl, FormControlProps } from './FormControl.js';\n\ninterface NumberFieldProps extends FormControlProps<number> {\n min?: number;\n max?: number;\n}\n\nconst INPUT_STYLE = { width: '28px', height: '28px' };\n\nexport function useNumberField(props: NumberFieldProps) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n value: initialValue = 0,\n onChange,\n min = 0,\n max = 10,\n disabled = false,\n dataTestId = 'NumberField',\n ...rest\n } = props;\n\n const { value, setValue } = useValue<number, string | number | boolean>({\n name: name!,\n defaultValue: initialValue,\n formatter: Number,\n onChange,\n });\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = Number(e.target.value);\n\n if (newValue >= min && newValue <= max) {\n setValue(Number(newValue));\n }\n };\n\n const increase = () => {\n if (value < max) {\n setValue(value + 1);\n }\n };\n\n const decrease = () => {\n if (value > min) {\n setValue(value - 1);\n }\n };\n\n return {\n ...rest,\n id,\n min,\n max,\n name,\n value,\n dataTestId,\n disabled,\n handleChange,\n increase,\n decrease,\n };\n}\n\nexport const NumberField = (props: NumberFieldProps) => {\n const {\n disabled,\n min,\n max,\n label,\n description,\n id,\n dataTestId,\n value,\n handleChange,\n increase,\n decrease,\n errorMessage,\n validationStatus,\n required,\n ...rest\n } = useNumberField(props);\n\n return (\n <FormControl\n id={id}\n label={label}\n description={description}\n className={classnames('flex items-center justify-between', props.className)}\n dataName=\"NumberField\"\n dataTestId={dataTestId}\n errorMessage={errorMessage}\n validationStatus={validationStatus}\n disabled={disabled}\n required={required}\n layout=\"vertical\"\n >\n <div className=\"flex items-center gap-x-8\">\n <Button\n theme=\"yellow\"\n onClick={decrease}\n variant=\"icon\"\n disabled={value <= min || disabled}\n icon=\"MinusDefault\"\n // TODO have this from prop at some time\n label=\"MINUS\"\n />\n <input\n {...rest}\n className={classnames('text-b2 text-center font-normal outline-none', {\n 'bg-pearl text-grey': disabled,\n })}\n style={INPUT_STYLE}\n type=\"number\"\n id={id}\n onChange={handleChange}\n disabled={disabled}\n required={required}\n value={value}\n min={min}\n max={max}\n />\n <Button\n theme=\"yellow\"\n onClick={increase}\n variant=\"icon\"\n disabled={value >= max || disabled}\n icon=\"PlusDefault\"\n // TODO have this from prop at some time\n label=\"PLUS\"\n />\n </div>\n </FormControl>\n );\n};\n"],"names":["INPUT_STYLE","useNumberField","props","internalId","useId","id","name","initialValue","onChange","min","max","disabled","dataTestId","rest","value","setValue","useValue","e","newValue","NumberField","label","description","handleChange","increase","decrease","errorMessage","validationStatus","required","jsx","FormControl","classnames","jsxs","Button"],"mappings":";;;;;;AAaA,MAAMA,IAAc,EAAE,OAAO,QAAQ,QAAQ,OAAO;AAE7C,SAASC,EAAeC,GAAyB;AACtD,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAOE,IAAe;AAAA,IACtB,UAAAC;AAAA,IACA,KAAAC,IAAM;AAAA,IACN,KAAAC,IAAM;AAAA,IACN,UAAAC,IAAW;AAAA,IACX,YAAAC,IAAa;AAAA,IACb,GAAGC;AAAA,EACD,IAAAX,GAEE,EAAE,OAAAY,GAAO,UAAAC,EAAS,IAAIC,EAA4C;AAAA,IACtE,MAAAV;AAAA,IACA,cAAcC;AAAA,IACd,WAAW;AAAA,IACX,UAAAC;AAAA,EAAA,CACD;AAsBM,SAAA;AAAA,IACL,GAAGK;AAAA,IACH,IAAAR;AAAA,I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ACT,SAAQ;AAAA,YACR,UAAUV,KAASL,KAAOE;AAAA,YAC1B,MAAK;AAAA,YAEL,OAAM;AAAA,UAAA;AAAA,QACR;AAAA,QACA,gBAAAiB;AAAA,UAAC;AAAA,UAAA;AAAA,YACE,GAAGf;AAAA,YACJ,WAAWiB,EAAW,gDAAgD;AAAA,cACpE,sBAAsBnB;AAAA,YAAA,CACvB;AAAA,YACD,OAAOX;AAAA,YACP,MAAK;AAAA,YACL,IAAAK;AAAA,YACA,UAAUiB;AAAA,YACV,UAAAX;AAAA,YACA,UAAAgB;AAAA,YACA,OAAAb;AAAA,YACA,KAAAL;AAAA,YACA,KAAAC;AAAA,UAAA;AAAA,QACF;AAAA,QACA,gBAAAkB;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,OAAM;AAAA,YACN,SAAST;AAAA,YACT,SAAQ;AAAA,YACR,UAAUT,KAASJ,KAAOC;AAAA,YAC1B,MAAK;AAAA,YAEL,OAAM;AAAA,UAAA;AAAA,QACR;AAAA,MAAA,GACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"NumberField.js","sources":["../../../lib/molecules/Forms/NumberField.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport { ChangeEvent, useId } from 'react';\n\nimport { useValue } from '@/hooks/useValue.js';\nimport { Button } from '../Buttons/Button';\nimport { FormControl, FormControlProps } from './FormControl.js';\n\ninterface NumberFieldProps extends FormControlProps<number> {\n min?: number;\n max?: number;\n}\n\nconst INPUT_STYLE = { width: '28px', height: '28px' };\n\nexport function useNumberField(props: NumberFieldProps) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n value: initialValue = 0,\n onChange,\n min = 0,\n max = 10,\n disabled = false,\n dataTestId = 'NumberField',\n ...rest\n } = props;\n\n const { value, setValue } = useValue<number, string | number | boolean>({\n name: name!,\n defaultValue: initialValue,\n formatter: Number,\n onChange,\n });\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = Number(e.target.value);\n\n if (newValue >= min && newValue <= max) {\n setValue(Number(newValue));\n }\n };\n\n const increase = () => {\n if (value < max) {\n setValue(value + 1);\n }\n };\n\n const decrease = () => {\n if (value > min) {\n setValue(value - 1);\n }\n };\n\n return {\n ...rest,\n id,\n min,\n max,\n name,\n value,\n dataTestId,\n disabled,\n handleChange,\n increase,\n decrease,\n };\n}\n\nexport const NumberField = (props: NumberFieldProps) => {\n const {\n disabled,\n min,\n max,\n label,\n description,\n id,\n dataTestId,\n value,\n handleChange,\n increase,\n decrease,\n errorMessage,\n validationStatus,\n hideRequiredStar,\n required,\n ...rest\n } = useNumberField(props);\n\n return (\n <FormControl\n id={id}\n label={label}\n description={description}\n className={classnames('flex items-center justify-between', props.className)}\n dataName=\"NumberField\"\n dataTestId={dataTestId}\n errorMessage={errorMessage}\n validationStatus={validationStatus}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n layout=\"vertical\"\n >\n <div className=\"flex items-center gap-x-8\">\n <Button\n theme=\"yellow\"\n onClick={decrease}\n variant=\"icon\"\n disabled={value <= min || disabled}\n icon=\"MinusDefault\"\n // TODO have this from prop at some time\n label=\"MINUS\"\n />\n <input\n {...rest}\n className={classnames('text-b2 text-center font-normal outline-none', {\n 'bg-pearl text-grey': disabled,\n })}\n style={INPUT_STYLE}\n type=\"number\"\n id={id}\n onChange={handleChange}\n disabled={disabled}\n required={required}\n value={value}\n min={min}\n max={max}\n />\n <Button\n theme=\"yellow\"\n onClick={increase}\n variant=\"icon\"\n disabled={value >= max || disabled}\n icon=\"PlusDefault\"\n // TODO have this from prop at some time\n label=\"PLUS\"\n />\n </div>\n </FormControl>\n );\n};\n"],"names":["INPUT_STYLE","useNumberField","props","internalId","useId","id","name","initialValue","onChange","min","max","disabled","dataTestId","rest","value","setValue","useValue","e","newValue","NumberField","label","description","handleChange","increase","decrease","errorMessage","validationStatus","hideRequiredStar","required","jsx","FormControl","classnames","jsxs","Button"],"mappings":";;;;;;AAaA,MAAMA,IA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+1,7 @@
1
1
  import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
2
  import { c as m } from "../../../index-Cu0xwYjD.js";
3
- import { useId as M, useState as P, useEffect as S } from "react";
4
- import { useValue as T } from "../../../hooks/useValue.js";
3
+ import { useId as M, useState as P, useEffect as T } from "react";
4
+ import { useValue as q } from "../../../hooks/useValue.js";
5
5
  import { FormControl as D } from "../FormControl.js";
6
6
  import { Icon as n } from "../../../atoms/Icons/Icon.js";
7
7
  import "../../../atoms/Icons/contexts/IconsContext.js";
@@ -11,49 +11,51 @@ function K(f) {
11
11
  id: r = b,
12
12
  name: o = r,
13
13
  label: x,
14
- value: g,
14
+ value: h,
15
15
  disabled: d = !1,
16
16
  required: c = !1,
17
+ hideRequiredStar: g,
17
18
  validationStatus: e = "default",
18
- errorMessage: h,
19
+ errorMessage: v,
19
20
  validationMessages: p = [],
20
21
  withoutFieldValidation: s = !1,
21
- className: v,
22
- onChange: w,
23
- dataTestId: y = "Password",
24
- ...N
25
- } = f, { value: C, setValue: V } = T({
22
+ className: w,
23
+ onChange: y,
24
+ dataTestId: N = "Password",
25
+ ...C
26
+ } = f, { value: V, setValue: k } = q({
26
27
  name: o,
27
- initialValue: g,
28
- onChange: w
28
+ initialValue: h,
29
+ onChange: y
29
30
  }), [t, u] = P("password");
30
- S(() => u(t), [t]);
31
- const k = () => u(t === "password" ? "text" : "password");
31
+ T(() => u(t), [t]);
32
+ const I = () => u(t === "password" ? "text" : "password");
32
33
  return /* @__PURE__ */ i(
33
34
  D,
34
35
  {
35
- className: v,
36
+ className: w,
36
37
  id: r,
37
38
  label: x,
38
39
  dataName: "Password",
39
- dataTestId: y,
40
+ dataTestId: N,
40
41
  disabled: d,
41
42
  required: c,
43
+ hideRequiredStar: g,
42
44
  validationStatus: s ? "default" : e,
43
- errorMessage: h,
45
+ errorMessage: v,
44
46
  children: [
45
47
  /* @__PURE__ */ i("div", { className: "relative", children: [
46
48
  /* @__PURE__ */ a(
47
49
  "input",
48
50
  {
49
- ...N,
51
+ ...C,
50
52
  id: r,
51
53
  name: o,
52
54
  type: t,
53
- value: C,
55
+ value: V,
54
56
  disabled: d,
55
57
  required: c,
56
- onChange: (l) => V(l.target.value),
58
+ onChange: (l) => k(l.target.value),
57
59
  className: m(
58
60
  "text-b3 rounded-pill w-full border ps-20 py-[11px] font-normal outline-none bg-white text-black",
59
61
  {
@@ -80,7 +82,7 @@ function K(f) {
80
82
  {
81
83
  type: "button",
82
84
  className: "pointer-events-auto size-24 inline-flex",
83
- onClick: k,
85
+ onClick: I,
84
86
  children: /* @__PURE__ */ a(n, { name: t === "password" ? "Invisible" : "Visible", width: "24px", type: "svg" })
85
87
  }
86
88
  )
@@ -88,7 +90,7 @@ function K(f) {
88
90
  }
89
91
  )
90
92
  ] }),
91
- p.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-col gap-[10px] mt-8", children: p.map(({ label: l, status: I }, j) => /* @__PURE__ */ a(F, { label: l, status: I }, j)) })
93
+ p.length > 0 && /* @__PURE__ */ a("div", { className: "flex flex-col gap-[10px] mt-8", children: p.map(({ label: l, status: S }, j) => /* @__PURE__ */ a(F, { label: l, status: S }, j)) })
92
94
  ]
93
95
  }
94
96
  );
@@ -1 +1 @@
1
- {"version":3,"file":"Password.js","sources":["../../../../lib/molecules/Forms/Password/Password.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport { HTMLInputTypeAttribute, useEffect, useId, useState } from 'react';\n\nimport { useValue } from '@/hooks/useValue';\nimport { FormControl, FormControlProps } from '../FormControl';\nimport { Icon } from '@/atoms/Icons';\nimport { ValidationMessage } from './ValidationMessage';\n\nexport interface PasswordProps<Value> extends FormControlProps<Value> {\n validationMessages?: ValidationMessage[];\n withoutFieldValidation?: boolean;\n}\n\nexport function Password<Value = string>(props: PasswordProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n disabled = false,\n required = false,\n validationStatus = 'default',\n errorMessage,\n validationMessages = [],\n withoutFieldValidation = false,\n className,\n onChange,\n dataTestId = 'Password',\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({\n name,\n initialValue,\n onChange,\n });\n const [type, setType] = useState<HTMLInputTypeAttribute>('password');\n\n useEffect(() => setType(type), [type]);\n\n const toggleType = () => setType(type === 'password' ? 'text' : 'password');\n\n return (\n <FormControl\n className={className}\n id={id}\n label={label}\n dataName=\"Password\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n validationStatus={withoutFieldValidation ? 'default' : validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n id={id}\n name={name}\n type={type}\n value={value as any}\n disabled={disabled}\n required={required}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border ps-20 py-[11px] font-normal outline-none bg-white text-black',\n {\n 'border-lightGrey focus:border-black active:border-black pe-[52px]':\n withoutFieldValidation || validationStatus === 'default',\n 'pe-[84px]':\n !withoutFieldValidation &&\n (validationStatus === 'error' || validationStatus === 'success'),\n 'border-red': !withoutFieldValidation && validationStatus === 'error',\n 'border-green': !withoutFieldValidation && validationStatus === 'success',\n },\n )}\n aria-label={name}\n />\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n )}\n >\n <span className=\"ms-auto flex gap-x-8\">\n {!withoutFieldValidation && validationStatus === 'error' && (\n <Icon name=\"CrossDefault\" color=\"red\" width=\"24px\" />\n )}\n\n {!withoutFieldValidation && validationStatus === 'success' && (\n <Icon name=\"CheckDefault\" color=\"green\" width=\"24px\" />\n )}\n\n <button\n type=\"button\"\n className=\"pointer-events-auto size-24 inline-flex\"\n onClick={toggleType}\n >\n <Icon name={type === 'password' ? 'Invisible' : 'Visible'} width=\"24px\" type=\"svg\" />\n </button>\n </span>\n </div>\n </div>\n\n {validationMessages.length > 0 && (\n <div className=\"flex flex-col gap-[10px] mt-8\">\n {validationMessages.map(({ label, status }, index) => (\n <ValidationMessage label={label} status={status} key={index} />\n ))}\n </div>\n )}\n </FormControl>\n );\n}\n"],"names":["Password","props","internalId","useId","id","name","label","initialValue","disabled","required","validationStatus","errorMessage","validationMessages","withoutFieldValidation","className","onChange","dataTestId","rest","value","setValue","useValue","type","setType","useState","useEffect","toggleType","jsxs","FormControl","jsx","e","classnames","Icon","status","index","ValidationMessage"],"mappings":";;;;;;;;AAcO,SAASA,EAAyBC,GAA6B;AACpE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC,IAAmB;AAAA,IACnB,cAAAC;AAAA,IACA,oBAAAC,IAAqB,CAAC;AAAA,IACtB,wBAAAC,IAAyB;AAAA,IACzB,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,GAAGC;AAAA,EACD,IAAAhB,GAEE,EAAE,OAAAiB,GAAO,UAAAC,EAAS,IAAIC,EAAgB;AAAA,IAC1C,MAAAf;AAAA,IACA,cAAAE;AAAA,IACA,UAAAQ;AAAA,EAAA,CACD,GACK,CAACM,GAAMC,CAAO,IAAIC,EAAiC,UAAU;AAEnE,EAAAC,EAAU,MAAMF,EAAQD,CAAI,GAAG,CAACA,CAAI,CAAC;AAErC,QAAMI,IAAa,MAAMH,EAAQD,MAAS,aAAa,SAAS,UAAU;AAGxE,SAAA,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAAb;AAAA,MACA,IAAAV;AAAA,MACA,OAAAE;AAAA,MACA,UAAS;AAAA,MACT,YAAAU;AAAA,MACA,UAAAR;AAAA,MACA,UAAAC;AAAA,MACA,kBAAkBI,IAAyB,YAAYH;AAAA,MACvD,cAAAC;AAAA,MAEA,UAAA;AAAA,QAAC,gBAAAe,EAAA,OAAA,EAAI,WAAU,YACb,UAAA;AAAA,UAAA,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,iCACZ,UAAmBhB,EAAA,IAAI,CAAC,EAAE,OAAAN,GAAO,QAAA0B,EAAU,GAAAC,MACzC,gBAAAL,EAAAM,GAAA,EAAkB,OAAO5B,GAAO,QAAA0B,EAAA,GAAqBC,CAAO,CAC9D,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
1
+ {"version":3,"file":"Password.js","sources":["../../../../lib/molecules/Forms/Password/Password.tsx"],"sourcesContent":["import classnames from 'classnames';\n\nimport { HTMLInputTypeAttribute, useEffect, useId, useState } from 'react';\n\nimport { useValue } from '@/hooks/useValue';\nimport { FormControl, FormControlProps } from '../FormControl';\nimport { Icon } from '@/atoms/Icons';\nimport { ValidationMessage } from './ValidationMessage';\n\nexport interface PasswordProps<Value> extends FormControlProps<Value> {\n validationMessages?: ValidationMessage[];\n withoutFieldValidation?: boolean;\n}\n\nexport function Password<Value = string>(props: PasswordProps<Value>) {\n const internalId = useId();\n\n const {\n id = internalId,\n name = id,\n label,\n value: initialValue,\n disabled = false,\n required = false,\n hideRequiredStar,\n validationStatus = 'default',\n errorMessage,\n validationMessages = [],\n withoutFieldValidation = false,\n className,\n onChange,\n dataTestId = 'Password',\n ...rest\n } = props;\n\n const { value, setValue } = useValue<Value>({\n name,\n initialValue,\n onChange,\n });\n const [type, setType] = useState<HTMLInputTypeAttribute>('password');\n\n useEffect(() => setType(type), [type]);\n\n const toggleType = () => setType(type === 'password' ? 'text' : 'password');\n\n return (\n <FormControl\n className={className}\n id={id}\n label={label}\n dataName=\"Password\"\n dataTestId={dataTestId}\n disabled={disabled}\n required={required}\n hideRequiredStar={hideRequiredStar}\n validationStatus={withoutFieldValidation ? 'default' : validationStatus}\n errorMessage={errorMessage}\n >\n <div className=\"relative\">\n <input\n {...rest}\n id={id}\n name={name}\n type={type}\n value={value as any}\n disabled={disabled}\n required={required}\n onChange={(e) => setValue(e.target.value as Value)}\n className={classnames(\n 'text-b3 rounded-pill w-full border ps-20 py-[11px] font-normal outline-none bg-white text-black',\n {\n 'border-lightGrey focus:border-black active:border-black pe-[52px]':\n withoutFieldValidation || validationStatus === 'default',\n 'pe-[84px]':\n !withoutFieldValidation &&\n (validationStatus === 'error' || validationStatus === 'success'),\n 'border-red': !withoutFieldValidation && validationStatus === 'error',\n 'border-green': !withoutFieldValidation && validationStatus === 'success',\n },\n )}\n aria-label={name}\n />\n\n <div\n className={classnames(\n 'pointer-events-none absolute inset-0 flex items-center justify-between px-20 py-12',\n )}\n >\n <span className=\"ms-auto flex gap-x-8\">\n {!withoutFieldValidation && validationStatus === 'error' && (\n <Icon name=\"CrossDefault\" color=\"red\" width=\"24px\" />\n )}\n\n {!withoutFieldValidation && validationStatus === 'success' && (\n <Icon name=\"CheckDefault\" color=\"green\" width=\"24px\" />\n )}\n\n <button\n type=\"button\"\n className=\"pointer-events-auto size-24 inline-flex\"\n onClick={toggleType}\n >\n <Icon name={type === 'password' ? 'Invisible' : 'Visible'} width=\"24px\" type=\"svg\" />\n </button>\n </span>\n </div>\n </div>\n\n {validationMessages.length > 0 && (\n <div className=\"flex flex-col gap-[10px] mt-8\">\n {validationMessages.map(({ label, status }, index) => (\n <ValidationMessage label={label} status={status} key={index} />\n ))}\n </div>\n )}\n </FormControl>\n );\n}\n"],"names":["Password","props","internalId","useId","id","name","label","initialValue","disabled","required","hideRequiredStar","validationStatus","errorMessage","validationMessages","withoutFieldValidation","className","onChange","dataTestId","rest","value","setValue","useValue","type","setType","useState","useEffect","toggleType","jsxs","FormControl","jsx","e","classnames","Icon","status","index","ValidationMessage"],"mappings":";;;;;;;;AAcO,SAASA,EAAyBC,GAA6B;AACpE,QAAMC,IAAaC,KAEb;AAAA,IACJ,IAAAC,IAAKF;AAAA,IACL,MAAAG,IAAOD;AAAA,IACP,OAAAE;AAAA,IACA,OAAOC;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,kBAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,cAAAC;AAAA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cACF;AAAA,cACA,cAAYN;AAAA,YAAA;AAAA,UACd;AAAA,UAEA,gBAAAwB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAWE;AAAA,gBACT;AAAA,cACF;AAAA,cAEA,UAAA,gBAAAJ,EAAC,QAAK,EAAA,WAAU,wBACb,UAAA;AAAA,gBAAC,CAAAb,KAA0BH,MAAqB,WAC9C,gBAAAkB,EAAAG,GAAA,EAAK,MAAK,gBAAe,OAAM,OAAM,OAAM,OAAO,CAAA;AAAA,gBAGpD,CAAClB,KAA0BH,MAAqB,aAC/C,gBAAAkB,EAACG,GAAK,EAAA,MAAK,gBAAe,OAAM,SAAQ,OAAM,OAAO,CAAA;AAAA,gBAGvD,gBAAAH;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,MAAK;AAAA,oBACL,WAAU;AAAA,oBACV,SAASH;AAAA,oBAET,UAAA,gBAAAG,EAACG,GAAK,EAAA,MAAMV,MAAS,aAAa,cAAc,WAAW,OAAM,QAAO,MAAK,MAAM,CAAA;AAAA,kBAAA;AAAA,gBACrF;AAAA,cAAA,GACF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA,GACF;AAAA,QAECT,EAAmB,SAAS,KAC3B,gBAAAgB,EAAC,SAAI,WAAU,iCACZ,UAAmBhB,EAAA,IAAI,CAAC,EAAE,OAAAP,GAAO,QAAA2B,EAAU,GAAAC,MACzC,gBAAAL,EAAAM,GAAA,EAAkB,OAAO7B,GAAO,QAAA2B,EAAA,GAAqBC,CAAO,CAC9D,EACH,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR;"}
@@ -2,7 +2,7 @@ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
2
  import { c as b } from "../../../index-Cu0xwYjD.js";
3
3
  import { useId as k } from "react";
4
4
  import { useValue as w } from "../../../hooks/useValue.js";
5
- import "../../../controls-l0sNRNKZ.js";
5
+ /* empty css */
6
6
  function R(d) {
7
7
  const n = k(), {
8
8
  id: o = n,
@@ -339,8 +339,7 @@ function Pe(e) {
339
339
  N(() => (f.current = !0, () => void (f.current = !1)));
340
340
  const [T, m, h] = de(() => {
341
341
  const c = () => {
342
- if (!o.current.element)
343
- return;
342
+ if (!o.current.element) return;
344
343
  const {
345
344
  left: z,
346
345
  top: B,
@@ -399,8 +398,7 @@ function Fe(e, t) {
399
398
  }
400
399
  function ve(e) {
401
400
  const t = [];
402
- if (!e || e === document.body)
403
- return t;
401
+ if (!e || e === document.body) return t;
404
402
  const {
405
403
  overflow: r,
406
404
  overflowX: n,