@adam-milo/ui 1.0.30 → 1.0.32

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 (158) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +6 -2
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +1 -1
  5. package/dist/index11.cjs +1 -1
  6. package/dist/index11.js +1 -1
  7. package/dist/index12.cjs +1 -1
  8. package/dist/index12.js +1 -1
  9. package/dist/index13.cjs +1 -1
  10. package/dist/index13.js +1 -1
  11. package/dist/index14.cjs +1 -1
  12. package/dist/index14.js +1 -1
  13. package/dist/index15.cjs +1 -1
  14. package/dist/index15.js +1 -1
  15. package/dist/index16.cjs +1 -1
  16. package/dist/index16.js +1 -1
  17. package/dist/index17.cjs +1 -1
  18. package/dist/index17.js +1 -1
  19. package/dist/index18.cjs +1 -1
  20. package/dist/index18.js +1 -1
  21. package/dist/index19.cjs +1 -1
  22. package/dist/index19.js +28 -27
  23. package/dist/index2.cjs +1 -1
  24. package/dist/index2.js +1 -1
  25. package/dist/index20.cjs +1 -1
  26. package/dist/index20.js +43 -12
  27. package/dist/index21.cjs +1 -0
  28. package/dist/index21.js +55 -0
  29. package/dist/index22.cjs +1 -1
  30. package/dist/index22.js +12 -20
  31. package/dist/index24.cjs +1 -1
  32. package/dist/index24.js +298 -13
  33. package/dist/index25.cjs +1 -0
  34. package/dist/index25.js +16 -0
  35. package/dist/index3.cjs +1 -1
  36. package/dist/index3.js +2 -2
  37. package/dist/index4.cjs +1 -1
  38. package/dist/index4.js +1 -1
  39. package/dist/index42.cjs +1 -1
  40. package/dist/index42.js +18 -3
  41. package/dist/index5.cjs +1 -1
  42. package/dist/index5.js +1 -1
  43. package/dist/index6.cjs +1 -1
  44. package/dist/index6.js +2 -2
  45. package/dist/index7.cjs +1 -1
  46. package/dist/index7.js +1 -1
  47. package/dist/index8.cjs +1 -1
  48. package/dist/index8.js +1 -1
  49. package/dist/index9.cjs +1 -1
  50. package/dist/index9.js +14 -14
  51. package/dist/src/components/layout/divider/Divider.component.d.ts +39 -0
  52. package/dist/src/components/layout/divider/Divider.component.d.ts.map +1 -0
  53. package/dist/src/components/layout/grid/Grid.component.d.ts +53 -0
  54. package/dist/src/components/layout/grid/Grid.component.d.ts.map +1 -0
  55. package/dist/src/index.d.ts +4 -0
  56. package/dist/src/index.d.ts.map +1 -1
  57. package/dist/style.css +1 -1
  58. package/package.json +2 -1
  59. package/dist/index23.cjs +0 -1
  60. package/dist/index23.js +0 -301
  61. package/dist/index27.cjs +0 -1
  62. package/dist/index27.js +0 -1193
  63. package/dist/index40.cjs +0 -1
  64. package/dist/index40.js +0 -21
  65. package/dist/index43.cjs +0 -1
  66. package/dist/index43.js +0 -11
  67. package/dist/index44.cjs +0 -1
  68. package/dist/index44.js +0 -70
  69. package/dist/index45.cjs +0 -1
  70. package/dist/index45.js +0 -39
  71. package/dist/index46.cjs +0 -1
  72. package/dist/index46.js +0 -64
  73. package/dist/index47.cjs +0 -1
  74. package/dist/index47.js +0 -10
  75. package/dist/index48.cjs +0 -1
  76. package/dist/index48.js +0 -212
  77. package/dist/index49.cjs +0 -1
  78. package/dist/index49.js +0 -29
  79. package/dist/index50.cjs +0 -1
  80. package/dist/index50.js +0 -208
  81. package/dist/index51.cjs +0 -1
  82. package/dist/index51.js +0 -14
  83. package/dist/index52.cjs +0 -1
  84. package/dist/index52.js +0 -293
  85. package/dist/index53.cjs +0 -1
  86. package/dist/index53.js +0 -18
  87. package/dist/index54.cjs +0 -1
  88. package/dist/index54.js +0 -43
  89. package/dist/index55.cjs +0 -1
  90. package/dist/index55.js +0 -89
  91. package/dist/index56.cjs +0 -1
  92. package/dist/index56.js +0 -14
  93. package/dist/index57.cjs +0 -1
  94. package/dist/index57.js +0 -71
  95. package/dist/index58.cjs +0 -1
  96. package/dist/index58.js +0 -6
  97. package/dist/index59.cjs +0 -1
  98. package/dist/index59.js +0 -14
  99. package/dist/index60.cjs +0 -1
  100. package/dist/index60.js +0 -34
  101. package/dist/index61.cjs +0 -1
  102. package/dist/index61.js +0 -122
  103. package/dist/index62.cjs +0 -1
  104. package/dist/index62.js +0 -11
  105. package/dist/index63.cjs +0 -1
  106. package/dist/index63.js +0 -17
  107. package/dist/index64.cjs +0 -1
  108. package/dist/index64.js +0 -297
  109. package/dist/index65.cjs +0 -1
  110. package/dist/index65.js +0 -25
  111. package/dist/index66.cjs +0 -1
  112. package/dist/index66.js +0 -39
  113. package/dist/index67.cjs +0 -1
  114. package/dist/index67.js +0 -625
  115. package/dist/index68.cjs +0 -1
  116. package/dist/index68.js +0 -39
  117. package/dist/index69.cjs +0 -1
  118. package/dist/index69.js +0 -38
  119. package/dist/index70.cjs +0 -1
  120. package/dist/index70.js +0 -7
  121. package/dist/index71.cjs +0 -1
  122. package/dist/index71.js +0 -10
  123. package/dist/index72.cjs +0 -1
  124. package/dist/index72.js +0 -5
  125. package/dist/index73.cjs +0 -1
  126. package/dist/index73.js +0 -35
  127. package/dist/index74.cjs +0 -1
  128. package/dist/index74.js +0 -180
  129. package/dist/index75.cjs +0 -1
  130. package/dist/index75.js +0 -21
  131. package/dist/index76.cjs +0 -1
  132. package/dist/index76.js +0 -721
  133. package/dist/index77.cjs +0 -1
  134. package/dist/index77.js +0 -154
  135. package/dist/index78.cjs +0 -1
  136. package/dist/index78.js +0 -173
  137. package/dist/index79.cjs +0 -1
  138. package/dist/index79.js +0 -88
  139. package/dist/index80.cjs +0 -1
  140. package/dist/index80.js +0 -47
  141. package/dist/index81.cjs +0 -1
  142. package/dist/index81.js +0 -13
  143. package/dist/index82.cjs +0 -1
  144. package/dist/index82.js +0 -19
  145. package/dist/index83.cjs +0 -1
  146. package/dist/index83.js +0 -102
  147. package/dist/index84.cjs +0 -1
  148. package/dist/index84.js +0 -11
  149. package/dist/index85.cjs +0 -1
  150. package/dist/index85.js +0 -29
  151. package/dist/index86.cjs +0 -1
  152. package/dist/index86.js +0 -16
  153. package/dist/index87.cjs +0 -1
  154. package/dist/index87.js +0 -48
  155. package/dist/index88.cjs +0 -1
  156. package/dist/index88.js +0 -9
  157. package/dist/index89.cjs +0 -1
  158. package/dist/index89.js +0 -37
package/dist/index24.js CHANGED
@@ -1,16 +1,301 @@
1
- import { useCallback } from "react";
2
- function useMergedRef(...refs) {
3
- return useCallback((element) => {
4
- refs.forEach((ref) => {
5
- if (!ref) return;
6
- if (typeof ref === "function") {
7
- ref(element);
8
- } else {
9
- ref.current = element;
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useState, useRef, useId, useMemo, useEffect } from "react";
3
+ import { cn } from "./index22.js";
4
+ /* empty css */
5
+ import { useMergedRef } from "./index25.js";
6
+ import { debounce } from "./index42.js";
7
+ const Input = forwardRef(
8
+ ({
9
+ type = "text",
10
+ label,
11
+ error: externalError,
12
+ helperText,
13
+ fullWidth = false,
14
+ showPasswordToggle = true,
15
+ showLastChar = true,
16
+ lastCharDelay = 500,
17
+ validate,
18
+ onValidationChange,
19
+ className,
20
+ id: providedId,
21
+ onChange,
22
+ onBlur,
23
+ required,
24
+ value: controlledValue,
25
+ "data-cy": dataCy,
26
+ "data-testid": dataTestId,
27
+ ...props
28
+ }, ref) => {
29
+ const [isPasswordVisible, setIsPasswordVisible] = useState(false);
30
+ const [internalError, setInternalError] = useState();
31
+ const [isFocused, setIsFocused] = useState(false);
32
+ const [isHovered, setIsHovered] = useState(false);
33
+ const touchedRef = useRef(false);
34
+ const [displayPassword, setDisplayPassword] = useState("");
35
+ const actualPasswordRef = useRef("");
36
+ const timeoutRef = useRef(null);
37
+ const inputRef = useRef(null);
38
+ const mergedRef = useMergedRef(ref, inputRef);
39
+ const generatedId = useId();
40
+ const id = providedId || generatedId;
41
+ const errorId = `${id}-error`;
42
+ const helperId = `${id}-helper`;
43
+ const finalDataCy = dataCy || "input";
44
+ const finalTestId = dataTestId || "input";
45
+ const isPasswordType = type === "password";
46
+ const showToggle = isPasswordType && showPasswordToggle;
47
+ const shouldEnableLastCharPreview = isPasswordType && showLastChar && !isPasswordVisible;
48
+ const inputType = isPasswordType && (isPasswordVisible || shouldEnableLastCharPreview && actualPasswordRef.current.length > 0) ? "text" : type;
49
+ const displayLabel = label && required && !label.includes("*") ? `${label} *` : label;
50
+ const togglePasswordVisibility = () => {
51
+ setIsPasswordVisible((prev) => !prev);
52
+ setTimeout(() => {
53
+ var _a;
54
+ return (_a = inputRef.current) == null ? void 0 : _a.focus();
55
+ }, 0);
56
+ };
57
+ const debouncedValidate = useMemo(
58
+ () => debounce((value) => {
59
+ if (validate && touchedRef.current) {
60
+ const validationError = validate(value);
61
+ setInternalError(validationError);
62
+ onValidationChange == null ? void 0 : onValidationChange(!validationError);
63
+ }
64
+ }, 300),
65
+ [validate, onValidationChange]
66
+ );
67
+ const debouncedValidateRef = useRef(debouncedValidate);
68
+ useEffect(() => {
69
+ debouncedValidateRef.current = debouncedValidate;
70
+ }, [debouncedValidate]);
71
+ useEffect(() => {
72
+ if (process.env.NODE_ENV === "development") {
73
+ if (isPasswordType && showLastChar && controlledValue !== void 0) {
74
+ console.warn(
75
+ "[Input] Password last character preview (showLastChar) only works in uncontrolled mode. Remove the value prop to use this feature, or set showLastChar={false}."
76
+ );
77
+ }
10
78
  }
11
- });
12
- }, refs);
13
- }
79
+ }, [isPasswordType, showLastChar, controlledValue]);
80
+ useEffect(() => {
81
+ return () => {
82
+ if (timeoutRef.current) {
83
+ clearTimeout(timeoutRef.current);
84
+ }
85
+ debouncedValidateRef.current.cancel();
86
+ };
87
+ }, []);
88
+ const inputValue = shouldEnableLastCharPreview && controlledValue === void 0 ? displayPassword : isPasswordVisible && isPasswordType && controlledValue === void 0 ? actualPasswordRef.current || "" : controlledValue;
89
+ const handleChange = (e) => {
90
+ onChange == null ? void 0 : onChange(e);
91
+ let value = e.target.value;
92
+ if (shouldEnableLastCharPreview) {
93
+ const input = e.target;
94
+ const newValue = input.value;
95
+ actualPasswordRef.current = newValue;
96
+ const masked = newValue ? "•".repeat(newValue.length - 1) + newValue.slice(-1) : "";
97
+ setDisplayPassword(masked);
98
+ input.value = masked;
99
+ value = newValue;
100
+ if (timeoutRef.current) {
101
+ clearTimeout(timeoutRef.current);
102
+ }
103
+ timeoutRef.current = setTimeout(() => {
104
+ setDisplayPassword("•".repeat(newValue.length));
105
+ }, lastCharDelay);
106
+ }
107
+ if (touchedRef.current) {
108
+ debouncedValidate(value);
109
+ }
110
+ };
111
+ const handleFocus = (e) => {
112
+ var _a;
113
+ setIsFocused(true);
114
+ (_a = props.onFocus) == null ? void 0 : _a.call(props, e);
115
+ };
116
+ const handleBlur = (e) => {
117
+ setIsFocused(false);
118
+ touchedRef.current = true;
119
+ if (validate) {
120
+ const valueToValidate = shouldEnableLastCharPreview ? actualPasswordRef.current : e.target.value;
121
+ const validationError = validate(valueToValidate);
122
+ setInternalError(validationError);
123
+ onValidationChange == null ? void 0 : onValidationChange(!validationError);
124
+ }
125
+ onBlur == null ? void 0 : onBlur(e);
126
+ };
127
+ const handleMouseEnter = () => {
128
+ setIsHovered(true);
129
+ };
130
+ const handleMouseLeave = () => {
131
+ setIsHovered(false);
132
+ };
133
+ const displayError = externalError || internalError;
134
+ const inputState = props.disabled ? "disabled" : displayError ? "error" : isFocused ? "focus" : isHovered ? "hover" : "idle";
135
+ return /* @__PURE__ */ jsxs(
136
+ "div",
137
+ {
138
+ className: cn("input-wrapper", fullWidth && "input-wrapper--full-width"),
139
+ "data-cy": `${finalDataCy}-wrapper`,
140
+ "data-testid": `${finalTestId}-wrapper`,
141
+ children: [
142
+ label && /* @__PURE__ */ jsx(
143
+ "label",
144
+ {
145
+ htmlFor: id,
146
+ className: "input__label",
147
+ "data-cy": `${finalDataCy}-label`,
148
+ "data-testid": `${finalTestId}-label`,
149
+ children: displayLabel
150
+ }
151
+ ),
152
+ /* @__PURE__ */ jsxs("div", { className: "input__field-container", children: [
153
+ /* @__PURE__ */ jsx(
154
+ "input",
155
+ {
156
+ ref: mergedRef,
157
+ id,
158
+ type: inputType,
159
+ value: inputValue,
160
+ className: cn(
161
+ "input",
162
+ displayError && "input--error",
163
+ fullWidth && "input--full-width",
164
+ showToggle && "input--with-toggle",
165
+ className
166
+ ),
167
+ "aria-invalid": displayError ? "true" : "false",
168
+ "aria-required": required ? "true" : void 0,
169
+ "aria-describedby": displayError ? errorId : helperText ? helperId : void 0,
170
+ "data-cy": finalDataCy,
171
+ "data-testid": finalTestId,
172
+ "data-state": inputState,
173
+ onChange: handleChange,
174
+ onFocus: handleFocus,
175
+ onBlur: handleBlur,
176
+ onMouseEnter: handleMouseEnter,
177
+ onMouseLeave: handleMouseLeave,
178
+ required,
179
+ ...props
180
+ }
181
+ ),
182
+ showToggle && /* @__PURE__ */ jsx(
183
+ "button",
184
+ {
185
+ type: "button",
186
+ className: "input__toggle",
187
+ onClick: togglePasswordVisibility,
188
+ "aria-label": isPasswordVisible ? "Hide password" : "Show password",
189
+ "data-cy": `${finalDataCy}-toggle`,
190
+ "data-testid": `${finalTestId}-toggle`,
191
+ children: isPasswordVisible ? /* @__PURE__ */ jsxs(
192
+ "svg",
193
+ {
194
+ width: "20",
195
+ height: "20",
196
+ viewBox: "0 0 20 20",
197
+ fill: "none",
198
+ xmlns: "http://www.w3.org/2000/svg",
199
+ "aria-hidden": "true",
200
+ children: [
201
+ /* @__PURE__ */ jsx(
202
+ "path",
203
+ {
204
+ d: "M10 4C5.5 4 2 10 2 10s3.5 6 8 6 8-6 8-6-3.5-6-8-6z",
205
+ stroke: "currentColor",
206
+ strokeWidth: "1.5",
207
+ strokeLinecap: "round",
208
+ strokeLinejoin: "round",
209
+ fill: "none"
210
+ }
211
+ ),
212
+ /* @__PURE__ */ jsx(
213
+ "circle",
214
+ {
215
+ cx: "10",
216
+ cy: "10",
217
+ r: "2.5",
218
+ stroke: "currentColor",
219
+ strokeWidth: "1.5",
220
+ fill: "none"
221
+ }
222
+ )
223
+ ]
224
+ }
225
+ ) : /* @__PURE__ */ jsxs(
226
+ "svg",
227
+ {
228
+ width: "20",
229
+ height: "20",
230
+ viewBox: "0 0 20 20",
231
+ fill: "none",
232
+ xmlns: "http://www.w3.org/2000/svg",
233
+ "aria-hidden": "true",
234
+ children: [
235
+ /* @__PURE__ */ jsx(
236
+ "path",
237
+ {
238
+ d: "M10 4C5.5 4 2 10 2 10s3.5 6 8 6 8-6 8-6-3.5-6-8-6z",
239
+ stroke: "currentColor",
240
+ strokeWidth: "1.5",
241
+ strokeLinecap: "round",
242
+ strokeLinejoin: "round",
243
+ fill: "none"
244
+ }
245
+ ),
246
+ /* @__PURE__ */ jsx(
247
+ "circle",
248
+ {
249
+ cx: "10",
250
+ cy: "10",
251
+ r: "2.5",
252
+ stroke: "currentColor",
253
+ strokeWidth: "1.5",
254
+ fill: "none"
255
+ }
256
+ ),
257
+ /* @__PURE__ */ jsx(
258
+ "path",
259
+ {
260
+ d: "M3 3l14 14",
261
+ stroke: "currentColor",
262
+ strokeWidth: "1.5",
263
+ strokeLinecap: "round"
264
+ }
265
+ )
266
+ ]
267
+ }
268
+ )
269
+ }
270
+ )
271
+ ] }),
272
+ displayError && /* @__PURE__ */ jsx(
273
+ "span",
274
+ {
275
+ id: errorId,
276
+ className: "input__error",
277
+ role: "alert",
278
+ "data-cy": `${finalDataCy}-error`,
279
+ "data-testid": `${finalTestId}-error`,
280
+ children: displayError
281
+ }
282
+ ),
283
+ helperText && !displayError && /* @__PURE__ */ jsx(
284
+ "span",
285
+ {
286
+ id: helperId,
287
+ className: "input__helper",
288
+ "data-cy": `${finalDataCy}-helper`,
289
+ "data-testid": `${finalTestId}-helper`,
290
+ children: helperText
291
+ }
292
+ )
293
+ ]
294
+ }
295
+ );
296
+ }
297
+ );
298
+ Input.displayName = "Input";
14
299
  export {
15
- useMergedRef
300
+ Input
16
301
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");exports.useMergedRef=function(...r){return e.useCallback(e=>{r.forEach(r=>{r&&("function"==typeof r?r(e):r.current=e)})},r)};
@@ -0,0 +1,16 @@
1
+ import { useCallback } from "react";
2
+ function useMergedRef(...refs) {
3
+ return useCallback((element) => {
4
+ refs.forEach((ref) => {
5
+ if (!ref) return;
6
+ if (typeof ref === "function") {
7
+ ref(element);
8
+ } else {
9
+ ref.current = element;
10
+ }
11
+ });
12
+ }, refs);
13
+ }
14
+ export {
15
+ useMergedRef
16
+ };
package/dist/index3.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),t=require("./index22.cjs"),i=require("./index23.cjs"),r=a.forwardRef(({validateEmail:r=!0,invalidEmailMessage:l="Not a valid email address",validate:d,"data-cy":s,"data-testid":u,...n},c)=>{const o=a.useCallback(e=>{if(e)return t.validate(e)?void 0:l},[l]),m=a.useCallback(e=>r?d?o(e)||d(e):o(e):null==d?void 0:d(e),[r,d,o]);return e.jsx(i.Input,{ref:c,type:"email",validate:m,"data-cy":s||"email-input","data-testid":u||"email-input",...n})});r.displayName="EmailInput",exports.EmailInput=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),e=require("react"),t=require("email-validator"),i=require("./index24.cjs"),l=e.forwardRef(({validateEmail:l=!0,invalidEmailMessage:r="Not a valid email address",validate:d,"data-cy":s,"data-testid":u,...n},o)=>{const m=e.useCallback(a=>{if(a)return t.validate(a)?void 0:r},[r]),c=e.useCallback(a=>l?d?m(a)||d(a):m(a):null==d?void 0:d(a),[l,d,m]);return a.jsx(i.Input,{ref:o,type:"email",validate:c,"data-cy":s||"email-input","data-testid":u||"email-input",...n})});l.displayName="EmailInput",exports.EmailInput=l;
package/dist/index3.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useCallback } from "react";
3
- import { validate } from "./index22.js";
4
- import { Input } from "./index23.js";
3
+ import { validate } from "email-validator";
4
+ import { Input } from "./index24.js";
5
5
  const EmailInput = forwardRef(
6
6
  ({
7
7
  validateEmail = true,
package/dist/index4.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),s=require("./index23.cjs"),r=t.forwardRef(({showToggle:t=!0,"data-cy":r,"data-testid":a,...o},d)=>e.jsx(s.Input,{ref:d,type:"password",showPasswordToggle:t,"data-cy":r||"password-input","data-testid":a||"password-input",...o}));r.displayName="PasswordInput",exports.PasswordInput=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),s=require("./index24.cjs"),r=t.forwardRef(({showToggle:t=!0,"data-cy":r,"data-testid":a,...o},d)=>e.jsx(s.Input,{ref:d,type:"password",showPasswordToggle:t,"data-cy":r||"password-input","data-testid":a||"password-input",...o}));r.displayName="PasswordInput",exports.PasswordInput=r;
package/dist/index4.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
- import { Input } from "./index23.js";
3
+ import { Input } from "./index24.js";
4
4
  const PasswordInput = forwardRef(
5
5
  ({ showToggle = true, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
6
6
  return /* @__PURE__ */ jsx(
package/dist/index42.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.clamp=function(t,[e,r]){return Math.min(r,Math.max(e,t))};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.debounce=function(e,t){let l=null;const n=function(...n){l&&clearTimeout(l);const o=this;l=setTimeout(()=>{e.apply(o,n),l=null},t)};return n.cancel=()=>{l&&(clearTimeout(l),l=null)},n};
package/dist/index42.js CHANGED
@@ -1,6 +1,21 @@
1
- function clamp(value, [min, max]) {
2
- return Math.min(max, Math.max(min, value));
1
+ function debounce(func, wait) {
2
+ let timeoutId = null;
3
+ const debounced = function(...args) {
4
+ if (timeoutId) clearTimeout(timeoutId);
5
+ const context = this;
6
+ timeoutId = setTimeout(() => {
7
+ func.apply(context, args);
8
+ timeoutId = null;
9
+ }, wait);
10
+ };
11
+ debounced.cancel = () => {
12
+ if (timeoutId) {
13
+ clearTimeout(timeoutId);
14
+ timeoutId = null;
15
+ }
16
+ };
17
+ return debounced;
3
18
  }
4
19
  export {
5
- clamp
20
+ debounce
6
21
  };
package/dist/index5.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index23.cjs"),r=t.forwardRef(({min:r,max:i,step:s=1,allowDecimals:u=!1,validate:n,"data-cy":l,"data-testid":c,...d},o)=>{const m=t.useCallback(e=>{if(!e)return;const t=parseFloat(e);return isNaN(t)?"Please enter a valid number":u||Number.isInteger(t)?void 0!==r&&t<r?`Must be at least ${r}`:void 0!==i&&t>i?`Must be at most ${i}`:void 0:"Decimals are not allowed"},[r,i,u]),p=t.useCallback(e=>n?m(e)||n(e):m(e),[m,n]);return e.jsx(a.Input,{ref:o,type:"number",min:r,max:i,validate:p,"data-cy":l||"numeric-input","data-testid":c||"numeric-input",...d,step:u?"any":s})});r.displayName="NumericInput",exports.NumericInput=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index24.cjs"),r=t.forwardRef(({min:r,max:i,step:s=1,allowDecimals:u=!1,validate:n,"data-cy":l,"data-testid":c,...d},o)=>{const m=t.useCallback(e=>{if(!e)return;const t=parseFloat(e);return isNaN(t)?"Please enter a valid number":u||Number.isInteger(t)?void 0!==r&&t<r?`Must be at least ${r}`:void 0!==i&&t>i?`Must be at most ${i}`:void 0:"Decimals are not allowed"},[r,i,u]),p=t.useCallback(e=>n?m(e)||n(e):m(e),[m,n]);return e.jsx(a.Input,{ref:o,type:"number",min:r,max:i,validate:p,"data-cy":l||"numeric-input","data-testid":c||"numeric-input",...d,step:u?"any":s})});r.displayName="NumericInput",exports.NumericInput=r;
package/dist/index5.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useCallback } from "react";
3
- import { Input } from "./index23.js";
3
+ import { Input } from "./index24.js";
4
4
  const NumericInput = forwardRef(
5
5
  ({
6
6
  min,
package/dist/index6.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index23.cjs"),n=require("./index24.cjs"),l=t.forwardRef(({allowHyphen:l=!1,allowUnderscore:r=!1,allowSpace:s=!1,minLength:u,maxLength:i,validate:c,onChange:o,"data-cy":p,"data-testid":d,...h},g)=>{const m=t.useRef(null),f=n.useMergedRef(g,m),v=t.useMemo(()=>{let e="^[a-zA-Z0-9";return l&&(e+="\\-"),r&&(e+="_"),s&&(e+=" "),e+="]*$",new RegExp(e)},[l,r,s]),x=t.useMemo(()=>{let e="[a-zA-Z0-9";return l&&(e+="\\-"),r&&(e+="_"),s&&(e+=" "),e+="]",new RegExp(e)},[l,r,s]),y=t.useCallback(e=>{if(e){if(!v.test(e)){let e="letters and numbers";const t=[];return l&&t.push("hyphens"),r&&t.push("underscores"),s&&t.push("spaces"),t.length>0&&(e+=`, ${t.join(", ")}`),`Only ${e} are allowed`}return void 0!==u&&e.length<u?`Must be at least ${u} characters`:void 0!==i&&e.length>i?`Must be at most ${i} characters`:void 0}},[v,u,i,l,r,s]),b=t.useCallback(e=>c?y(e)||c(e):y(e),[y,c]),[j,w]=t.useState(null);t.useEffect(()=>{null!==j&&m.current&&(m.current.setSelectionRange(j,j),w(null))},[h.value,j]);const R=t.useCallback(e=>{const t=e.target,a=t.value,n=t.selectionStart||0,l=a.split("").filter(e=>x.test(e)).join(""),r=n-a.slice(0,n).split("").filter(e=>!x.test(e)).length;t.value=l;void 0!==h.value?w(r):t.setSelectionRange(r,r),null==o||o(e)},[x,o,h.value]);return e.jsx(a.Input,{ref:f,type:"text",minLength:u,maxLength:i,validate:b,onChange:R,"data-cy":p||"alphanumeric-input","data-testid":d||"alphanumeric-input",...h})});l.displayName="AlphanumericInput",exports.AlphanumericInput=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index24.cjs"),n=require("./index25.cjs"),l=t.forwardRef(({allowHyphen:l=!1,allowUnderscore:r=!1,allowSpace:s=!1,minLength:u,maxLength:i,validate:c,onChange:o,"data-cy":p,"data-testid":d,...h},g)=>{const m=t.useRef(null),f=n.useMergedRef(g,m),v=t.useMemo(()=>{let e="^[a-zA-Z0-9";return l&&(e+="\\-"),r&&(e+="_"),s&&(e+=" "),e+="]*$",new RegExp(e)},[l,r,s]),x=t.useMemo(()=>{let e="[a-zA-Z0-9";return l&&(e+="\\-"),r&&(e+="_"),s&&(e+=" "),e+="]",new RegExp(e)},[l,r,s]),y=t.useCallback(e=>{if(e){if(!v.test(e)){let e="letters and numbers";const t=[];return l&&t.push("hyphens"),r&&t.push("underscores"),s&&t.push("spaces"),t.length>0&&(e+=`, ${t.join(", ")}`),`Only ${e} are allowed`}return void 0!==u&&e.length<u?`Must be at least ${u} characters`:void 0!==i&&e.length>i?`Must be at most ${i} characters`:void 0}},[v,u,i,l,r,s]),b=t.useCallback(e=>c?y(e)||c(e):y(e),[y,c]),[j,w]=t.useState(null);t.useEffect(()=>{null!==j&&m.current&&(m.current.setSelectionRange(j,j),w(null))},[h.value,j]);const R=t.useCallback(e=>{const t=e.target,a=t.value,n=t.selectionStart||0,l=a.split("").filter(e=>x.test(e)).join(""),r=n-a.slice(0,n).split("").filter(e=>!x.test(e)).length;t.value=l;void 0!==h.value?w(r):t.setSelectionRange(r,r),null==o||o(e)},[x,o,h.value]);return e.jsx(a.Input,{ref:f,type:"text",minLength:u,maxLength:i,validate:b,onChange:R,"data-cy":p||"alphanumeric-input","data-testid":d||"alphanumeric-input",...h})});l.displayName="AlphanumericInput",exports.AlphanumericInput=l;
package/dist/index6.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useRef, useMemo, useCallback, useState, useEffect } from "react";
3
- import { Input } from "./index23.js";
4
- import { useMergedRef } from "./index24.js";
3
+ import { Input } from "./index24.js";
4
+ import { useMergedRef } from "./index25.js";
5
5
  const AlphanumericInput = forwardRef(
6
6
  ({
7
7
  allowHyphen = false,
package/dist/index7.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index20.cjs");;/* empty css */const c=r.forwardRef(({label:c,error:t,helperText:d,indeterminate:i=!1,className:s,id:l,required:n,disabled:o,checked:u,"data-cy":b,"data-testid":h,...x},p)=>{const k=r.useId(),m=l||k,y=`${m}-error`,_=`${m}-helper`,$=b||"checkbox",f=h||"checkbox",j=r.useRef(null),N=r.useCallback(e=>{j.current=e,p&&("function"==typeof p?p(e):"current"in p&&(p.current=e))},[p]);r.useEffect(()=>{j.current&&(j.current.indeterminate=i)},[i]);const q=c&&n&&!c.includes("*")?`${c} *`:c;return e.jsxs("div",{className:a.cn("checkbox-wrapper",o&&"checkbox-wrapper--disabled"),"data-cy":`${$}-wrapper`,"data-testid":`${f}-wrapper`,children:[e.jsxs("div",{className:"checkbox__container",children:[e.jsx("input",{ref:N,id:m,type:"checkbox",checked:u,className:a.cn("checkbox__input",t&&"checkbox__input--error",s),"aria-invalid":t?"true":"false","aria-required":n?"true":void 0,"aria-describedby":t?y:d?_:void 0,"data-cy":$,"data-testid":f,"data-indeterminate":i?"true":void 0,disabled:o,required:n,...x}),c&&e.jsx("label",{htmlFor:m,className:"checkbox__label","data-cy":`${$}-label`,"data-testid":`${f}-label`,children:q})]}),t&&e.jsx("span",{id:y,className:"checkbox__error",role:"alert","data-cy":`${$}-error`,"data-testid":`${f}-error`,children:t}),d&&!t&&e.jsx("span",{id:_,className:"checkbox__helper","data-cy":`${$}-helper`,"data-testid":`${f}-helper`,children:d})]})});c.displayName="Checkbox",exports.Checkbox=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index22.cjs");;/* empty css */const c=r.forwardRef(({label:c,error:t,helperText:d,indeterminate:i=!1,className:s,id:l,required:n,disabled:o,checked:u,"data-cy":b,"data-testid":h,...x},p)=>{const k=r.useId(),m=l||k,y=`${m}-error`,_=`${m}-helper`,$=b||"checkbox",f=h||"checkbox",j=r.useRef(null),N=r.useCallback(e=>{j.current=e,p&&("function"==typeof p?p(e):"current"in p&&(p.current=e))},[p]);r.useEffect(()=>{j.current&&(j.current.indeterminate=i)},[i]);const q=c&&n&&!c.includes("*")?`${c} *`:c;return e.jsxs("div",{className:a.cn("checkbox-wrapper",o&&"checkbox-wrapper--disabled"),"data-cy":`${$}-wrapper`,"data-testid":`${f}-wrapper`,children:[e.jsxs("div",{className:"checkbox__container",children:[e.jsx("input",{ref:N,id:m,type:"checkbox",checked:u,className:a.cn("checkbox__input",t&&"checkbox__input--error",s),"aria-invalid":t?"true":"false","aria-required":n?"true":void 0,"aria-describedby":t?y:d?_:void 0,"data-cy":$,"data-testid":f,"data-indeterminate":i?"true":void 0,disabled:o,required:n,...x}),c&&e.jsx("label",{htmlFor:m,className:"checkbox__label","data-cy":`${$}-label`,"data-testid":`${f}-label`,children:q})]}),t&&e.jsx("span",{id:y,className:"checkbox__error",role:"alert","data-cy":`${$}-error`,"data-testid":`${f}-error`,children:t}),d&&!t&&e.jsx("span",{id:_,className:"checkbox__helper","data-cy":`${$}-helper`,"data-testid":`${f}-helper`,children:d})]})});c.displayName="Checkbox",exports.Checkbox=c;
package/dist/index7.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useId, useRef, useCallback, useEffect } from "react";
3
- import { cn } from "./index20.js";
3
+ import { cn } from "./index22.js";
4
4
  /* empty css */
5
5
  const Checkbox = forwardRef(
6
6
  ({
package/dist/index8.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index20.cjs");;/* empty css */const d=r.forwardRef(({label:d,error:i,helperText:t,className:s,id:l,required:c,disabled:o,checked:n,"data-cy":p,"data-testid":u,...b},h)=>{const x=r.useId(),y=l||x,_=`${y}-error`,m=`${y}-helper`,$=p||"radio",j=u||"radio",N=r.useRef(null),f=r.useCallback(e=>{N.current=e,h&&("function"==typeof h?h(e):"current"in h&&(h.current=e))},[h]),q=d&&c&&!d.includes("*")?`${d} *`:d;return e.jsxs("div",{className:a.cn("radio-wrapper",o&&"radio-wrapper--disabled"),"data-cy":`${$}-wrapper`,"data-testid":`${j}-wrapper`,children:[e.jsxs("div",{className:"radio__container",children:[e.jsx("input",{ref:f,id:y,type:"radio",checked:n,className:a.cn("radio__input",i&&"radio__input--error",s),"aria-describedby":i?_:t?m:void 0,"data-cy":$,"data-testid":j,disabled:o,required:c,...b}),d&&e.jsx("label",{htmlFor:y,className:"radio__label","data-cy":`${$}-label`,"data-testid":`${j}-label`,children:q})]}),i&&e.jsx("span",{id:_,className:"radio__error",role:"alert","data-cy":`${$}-error`,"data-testid":`${j}-error`,children:i}),t&&!i&&e.jsx("span",{id:m,className:"radio__helper","data-cy":`${$}-helper`,"data-testid":`${j}-helper`,children:t})]})});d.displayName="Radio",exports.Radio=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index22.cjs");;/* empty css */const d=r.forwardRef(({label:d,error:i,helperText:t,className:s,id:l,required:c,disabled:o,checked:n,"data-cy":p,"data-testid":u,...b},h)=>{const x=r.useId(),y=l||x,_=`${y}-error`,m=`${y}-helper`,$=p||"radio",j=u||"radio",N=r.useRef(null),f=r.useCallback(e=>{N.current=e,h&&("function"==typeof h?h(e):"current"in h&&(h.current=e))},[h]),q=d&&c&&!d.includes("*")?`${d} *`:d;return e.jsxs("div",{className:a.cn("radio-wrapper",o&&"radio-wrapper--disabled"),"data-cy":`${$}-wrapper`,"data-testid":`${j}-wrapper`,children:[e.jsxs("div",{className:"radio__container",children:[e.jsx("input",{ref:f,id:y,type:"radio",checked:n,className:a.cn("radio__input",i&&"radio__input--error",s),"aria-describedby":i?_:t?m:void 0,"data-cy":$,"data-testid":j,disabled:o,required:c,...b}),d&&e.jsx("label",{htmlFor:y,className:"radio__label","data-cy":`${$}-label`,"data-testid":`${j}-label`,children:q})]}),i&&e.jsx("span",{id:_,className:"radio__error",role:"alert","data-cy":`${$}-error`,"data-testid":`${j}-error`,children:i}),t&&!i&&e.jsx("span",{id:m,className:"radio__helper","data-cy":`${$}-helper`,"data-testid":`${j}-helper`,children:t})]})});d.displayName="Radio",exports.Radio=d;
package/dist/index8.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useId, useRef, useCallback } from "react";
3
- import { cn } from "./index20.js";
3
+ import { cn } from "./index22.js";
4
4
  /* empty css */
5
5
  const Radio = forwardRef(
6
6
  ({
package/dist/index9.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("./index27.cjs"),a=require("./index20.cjs");;/* empty css */const l=r.Root,s=t.forwardRef(({className:l,children:s,label:c,error:d,helperText:i,fullWidth:o=!1,hasValue:n=!1,id:p,"data-cy":f,"data-testid":h,disabled:x,required:_,...g},m)=>{const b=t.useId(),u=p||b,N=`${u}-error`,j=`${u}-helper`,y=f||"select-trigger",w=h||"select-trigger",S=n;return e.jsxs("div",{className:a.cn("select-wrapper",o&&"select-wrapper--full-width"),"data-cy":`${y}-wrapper`,"data-testid":`${w}-wrapper`,children:[e.jsxs("div",{className:"select-field",children:[e.jsxs("div",{className:"select-field__top",children:[e.jsx("div",{className:a.cn("select-field__border-left",d&&"select-field__border-left--error",S&&"select-field__border-left--floating",x&&"select-field__border-left--disabled")}),c&&S&&e.jsx("div",{className:a.cn("select-field__label-container",d&&"select-field__label-container--error"),children:e.jsx("span",{className:a.cn("select-field__label select-field__label--floating",d&&"select-field__label--error",x&&"select-field__label--disabled"),"data-cy":`${y}-label`,"data-testid":`${w}-label`,children:c})}),e.jsx("div",{className:a.cn("select-field__border-right",d&&"select-field__border-right--error",S&&"select-field__border-right--floating",x&&"select-field__border-right--disabled")})]}),e.jsxs(r.Trigger,{ref:m,id:u,className:a.cn("select-trigger",d&&"select-trigger--error",o&&"select-trigger--full-width",S&&"select-trigger--floating",l),"aria-invalid":d?"true":"false","aria-describedby":d?N:i?j:void 0,"aria-required":_?"true":void 0,"data-cy":y,"data-testid":w,disabled:x,...g,children:[c&&!S&&e.jsx("span",{className:"select-trigger__placeholder-label","data-cy":`${y}-placeholder`,"data-testid":`${w}-placeholder`,children:c}),S&&s,e.jsx(r.Icon,{className:"select-trigger__icon","data-cy":`${y}-icon`,"data-testid":`${w}-icon`,children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M7 10L12 15L17 10H7Z",fill:"currentColor"})})})]})]}),d&&e.jsx("span",{id:N,className:"select__error",role:"alert","data-cy":`${y}-error`,"data-testid":`${w}-error`,children:d}),i&&!d&&e.jsx("span",{id:j,className:"select__helper","data-cy":`${y}-helper`,"data-testid":`${w}-helper`,children:i})]})});s.displayName="SelectTrigger";const c=r.Value,d=t.forwardRef(({className:t,children:l,position:s="popper","data-cy":c,"data-testid":d,...i},o)=>{const n=c||"select-content",p=d||"select-content";return e.jsx(r.Portal,{children:e.jsx(r.Content,{ref:o,className:a.cn("select-content",t),position:s,sideOffset:8,"data-cy":n,"data-testid":p,...i,children:e.jsx(r.Viewport,{className:"select-viewport",children:l})})})});d.displayName="SelectContent";const i=t.forwardRef(({className:t,children:l,value:s,"data-cy":c,"data-testid":d,...i},o)=>{const n=c||`select-item-${s}`,p=d||`select-item-${s}`;return e.jsx(r.Item,{ref:o,className:a.cn("select-item",t),value:s,"data-cy":n,"data-testid":p,...i,children:e.jsx(r.ItemText,{children:l})})});i.displayName="SelectItem";const o=r.Group,n=t.forwardRef(({className:t,"data-cy":l,"data-testid":s,...c},d)=>{const i=l||"select-label",o=s||"select-label";return e.jsx(r.Label,{ref:d,className:a.cn("select-group-label",t),"data-cy":i,"data-testid":o,...c})});n.displayName="SelectLabel";const p=t.forwardRef(({className:t,"data-cy":l,"data-testid":s,...c},d)=>{const i=l||"select-separator",o=s||"select-separator";return e.jsx(r.Separator,{ref:d,className:a.cn("select-separator",t),"data-cy":i,"data-testid":o,...c})});p.displayName="SelectSeparator",exports.Select=l,exports.SelectContent=d,exports.SelectGroup=o,exports.SelectItem=i,exports.SelectLabel=n,exports.SelectSeparator=p,exports.SelectTrigger=s,exports.SelectValue=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("@radix-ui/react-select"),a=require("./index22.cjs");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)};/* empty css */const s=l(r),c=s.Root,d=t.forwardRef(({className:r,children:l,label:c,error:d,helperText:i,fullWidth:o=!1,hasValue:n=!1,id:p,"data-cy":f,"data-testid":g,disabled:h,required:u,...b},m)=>{const x=t.useId(),_=p||x,j=`${_}-error`,y=`${_}-helper`,N=f||"select-trigger",w=g||"select-trigger",S=n;return e.jsxs("div",{className:a.cn("select-wrapper",o&&"select-wrapper--full-width"),"data-cy":`${N}-wrapper`,"data-testid":`${w}-wrapper`,children:[e.jsxs("div",{className:"select-field",children:[e.jsxs("div",{className:"select-field__top",children:[e.jsx("div",{className:a.cn("select-field__border-left",d&&"select-field__border-left--error",S&&"select-field__border-left--floating",h&&"select-field__border-left--disabled")}),c&&S&&e.jsx("div",{className:a.cn("select-field__label-container",d&&"select-field__label-container--error"),children:e.jsx("span",{className:a.cn("select-field__label select-field__label--floating",d&&"select-field__label--error",h&&"select-field__label--disabled"),"data-cy":`${N}-label`,"data-testid":`${w}-label`,children:c})}),e.jsx("div",{className:a.cn("select-field__border-right",d&&"select-field__border-right--error",S&&"select-field__border-right--floating",h&&"select-field__border-right--disabled")})]}),e.jsxs(s.Trigger,{ref:m,id:_,className:a.cn("select-trigger",d&&"select-trigger--error",o&&"select-trigger--full-width",S&&"select-trigger--floating",r),"aria-invalid":d?"true":"false","aria-describedby":d?j:i?y:void 0,"aria-required":u?"true":void 0,"data-cy":N,"data-testid":w,disabled:h,...b,children:[c&&!S&&e.jsx("span",{className:"select-trigger__placeholder-label","data-cy":`${N}-placeholder`,"data-testid":`${w}-placeholder`,children:c}),S&&l,e.jsx(s.Icon,{className:"select-trigger__icon","data-cy":`${N}-icon`,"data-testid":`${w}-icon`,children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M7 10L12 15L17 10H7Z",fill:"currentColor"})})})]})]}),d&&e.jsx("span",{id:j,className:"select__error",role:"alert","data-cy":`${N}-error`,"data-testid":`${w}-error`,children:d}),i&&!d&&e.jsx("span",{id:y,className:"select__helper","data-cy":`${N}-helper`,"data-testid":`${w}-helper`,children:i})]})});d.displayName="SelectTrigger";const i=s.Value,o=t.forwardRef(({className:t,children:r,position:l="popper","data-cy":c,"data-testid":d,...i},o)=>{const n=c||"select-content",p=d||"select-content";return e.jsx(s.Portal,{children:e.jsx(s.Content,{ref:o,className:a.cn("select-content",t),position:l,sideOffset:8,"data-cy":n,"data-testid":p,...i,children:e.jsx(s.Viewport,{className:"select-viewport",children:r})})})});o.displayName="SelectContent";const n=t.forwardRef(({className:t,children:r,value:l,"data-cy":c,"data-testid":d,...i},o)=>{const n=c||`select-item-${l}`,p=d||`select-item-${l}`;return e.jsx(s.Item,{ref:o,className:a.cn("select-item",t),value:l,"data-cy":n,"data-testid":p,...i,children:e.jsx(s.ItemText,{children:r})})});n.displayName="SelectItem";const p=s.Group,f=t.forwardRef(({className:t,"data-cy":r,"data-testid":l,...c},d)=>{const i=r||"select-label",o=l||"select-label";return e.jsx(s.Label,{ref:d,className:a.cn("select-group-label",t),"data-cy":i,"data-testid":o,...c})});f.displayName="SelectLabel";const g=t.forwardRef(({className:t,"data-cy":r,"data-testid":l,...c},d)=>{const i=r||"select-separator",o=l||"select-separator";return e.jsx(s.Separator,{ref:d,className:a.cn("select-separator",t),"data-cy":i,"data-testid":o,...c})});g.displayName="SelectSeparator",exports.Select=c,exports.SelectContent=o,exports.SelectGroup=p,exports.SelectItem=n,exports.SelectLabel=f,exports.SelectSeparator=g,exports.SelectTrigger=d,exports.SelectValue=i;
package/dist/index9.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useId } from "react";
3
- import { Root as Root2, Value, Group, Trigger, Icon, Portal, Content as Content2, Viewport, Item, ItemText, Label, Separator } from "./index27.js";
4
- import { cn } from "./index20.js";
3
+ import * as SelectPrimitive from "@radix-ui/react-select";
4
+ import { cn } from "./index22.js";
5
5
  /* empty css */
6
- const Select = Root2;
6
+ const Select = SelectPrimitive.Root;
7
7
  const SelectTrigger = forwardRef(
8
8
  ({
9
9
  className,
@@ -82,7 +82,7 @@ const SelectTrigger = forwardRef(
82
82
  )
83
83
  ] }),
84
84
  /* @__PURE__ */ jsxs(
85
- Trigger,
85
+ SelectPrimitive.Trigger,
86
86
  {
87
87
  ref,
88
88
  id,
@@ -112,7 +112,7 @@ const SelectTrigger = forwardRef(
112
112
  ),
113
113
  isFloating && children,
114
114
  /* @__PURE__ */ jsx(
115
- Icon,
115
+ SelectPrimitive.Icon,
116
116
  {
117
117
  className: "select-trigger__icon",
118
118
  "data-cy": `${finalDataCy}-icon`,
@@ -162,7 +162,7 @@ const SelectTrigger = forwardRef(
162
162
  }
163
163
  );
164
164
  SelectTrigger.displayName = "SelectTrigger";
165
- const SelectValue = Value;
165
+ const SelectValue = SelectPrimitive.Value;
166
166
  const SelectContent = forwardRef(
167
167
  ({
168
168
  className,
@@ -174,8 +174,8 @@ const SelectContent = forwardRef(
174
174
  }, ref) => {
175
175
  const finalDataCy = dataCy || "select-content";
176
176
  const finalTestId = dataTestId || "select-content";
177
- return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(
178
- Content2,
177
+ return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx(
178
+ SelectPrimitive.Content,
179
179
  {
180
180
  ref,
181
181
  className: cn("select-content", className),
@@ -184,7 +184,7 @@ const SelectContent = forwardRef(
184
184
  "data-cy": finalDataCy,
185
185
  "data-testid": finalTestId,
186
186
  ...props,
187
- children: /* @__PURE__ */ jsx(Viewport, { className: "select-viewport", children })
187
+ children: /* @__PURE__ */ jsx(SelectPrimitive.Viewport, { className: "select-viewport", children })
188
188
  }
189
189
  ) });
190
190
  }
@@ -195,7 +195,7 @@ const SelectItem = forwardRef(
195
195
  const finalDataCy = dataCy || `select-item-${value}`;
196
196
  const finalTestId = dataTestId || `select-item-${value}`;
197
197
  return /* @__PURE__ */ jsx(
198
- Item,
198
+ SelectPrimitive.Item,
199
199
  {
200
200
  ref,
201
201
  className: cn("select-item", className),
@@ -203,19 +203,19 @@ const SelectItem = forwardRef(
203
203
  "data-cy": finalDataCy,
204
204
  "data-testid": finalTestId,
205
205
  ...props,
206
- children: /* @__PURE__ */ jsx(ItemText, { children })
206
+ children: /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
207
207
  }
208
208
  );
209
209
  }
210
210
  );
211
211
  SelectItem.displayName = "SelectItem";
212
- const SelectGroup = Group;
212
+ const SelectGroup = SelectPrimitive.Group;
213
213
  const SelectLabel = forwardRef(
214
214
  ({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
215
215
  const finalDataCy = dataCy || "select-label";
216
216
  const finalTestId = dataTestId || "select-label";
217
217
  return /* @__PURE__ */ jsx(
218
- Label,
218
+ SelectPrimitive.Label,
219
219
  {
220
220
  ref,
221
221
  className: cn("select-group-label", className),
@@ -231,7 +231,7 @@ const SelectSeparator = forwardRef(({ className, "data-cy": dataCy, "data-testid
231
231
  const finalDataCy = dataCy || "select-separator";
232
232
  const finalTestId = dataTestId || "select-separator";
233
233
  return /* @__PURE__ */ jsx(
234
- Separator,
234
+ SelectPrimitive.Separator,
235
235
  {
236
236
  ref,
237
237
  className: cn("select-separator", className),
@@ -0,0 +1,39 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+
3
+ import * as SeparatorPrimitive from '@radix-ui/react-separator';
4
+ export interface DividerProps extends Omit<ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>, 'decorative'> {
5
+ /**
6
+ * The orientation of the divider
7
+ * @default 'horizontal'
8
+ */
9
+ orientation?: 'horizontal' | 'vertical';
10
+ /**
11
+ * Whether the divider is decorative (hidden from screen readers)
12
+ * If true, uses aria-hidden. If false, uses role="separator"
13
+ * @default true
14
+ */
15
+ decorative?: boolean;
16
+ /**
17
+ * Spacing around the divider (uses design system spacing scale)
18
+ * Applied as margin-block for horizontal or margin-inline for vertical
19
+ * @default '0'
20
+ */
21
+ spacing?: '0' | '1' | '2' | '3' | '4' | '5' | '6' | '8' | '10' | '12';
22
+ /**
23
+ * Custom color for the divider line
24
+ * If not provided, uses --color-border from design tokens
25
+ */
26
+ color?: string;
27
+ /**
28
+ * Custom data-cy attribute for Cypress testing
29
+ * Auto-generates as "divider-{orientation}" if not provided
30
+ */
31
+ 'data-cy'?: string;
32
+ /**
33
+ * Custom data-testid attribute for unit testing
34
+ * Auto-generates as "divider-{orientation}" if not provided
35
+ */
36
+ 'data-testid'?: string;
37
+ }
38
+ export declare const Divider: import('react').ForwardRefExoticComponent<DividerProps & import('react').RefAttributes<HTMLDivElement>>;
39
+ //# sourceMappingURL=Divider.component.d.ts.map