@utk09/finra-ui 0.0.2 → 0.0.4

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.
package/dist/unstyled.js CHANGED
@@ -1,26 +1,230 @@
1
- import { a as o } from "./Switch-BgWsJGsh.js";
2
- import { B as C, C as x, I as d, S as I } from "./Switch-BgWsJGsh.js";
3
- import { jsx as s } from "react/jsx-runtime";
4
- import { forwardRef as r } from "react";
5
- const m = r(
6
- ({ asChild: a = !1, ...e }, t) => /* @__PURE__ */ s(a ? o : "input", { ref: t, ...e })
1
+ import { b as w } from "./Slider-BXQjDfhb.js";
2
+ import { B as L, C as M, I as Q, R as U, a as W, S as X } from "./Slider-BXQjDfhb.js";
3
+ import { jsx as p, jsxs as k } from "react/jsx-runtime";
4
+ import { forwardRef as C, useId as E, Children as K, isValidElement as j, cloneElement as O, useState as b, useRef as R, useCallback as i } from "react";
5
+ const S = C(
6
+ ({ asChild: a = !1, ...o }, e) => /* @__PURE__ */ p(a ? w : "input", { ref: e, ...o })
7
7
  );
8
- m.displayName = "InputBase";
9
- const n = r(
10
- ({ asChild: a = !1, ...e }, t) => /* @__PURE__ */ s(a ? o : "textarea", { ref: t, ...e })
8
+ S.displayName = "InputBase";
9
+ const V = C(
10
+ ({ asChild: a = !1, ...o }, e) => /* @__PURE__ */ p(a ? w : "textarea", { ref: e, ...o })
11
11
  );
12
- n.displayName = "TextareaBase";
13
- const u = r(
14
- ({ asChild: a = !1, ...e }, t) => /* @__PURE__ */ s(a ? o : "input", { ref: t, inputMode: "decimal", ...e })
12
+ V.displayName = "TextareaBase";
13
+ const $ = C(
14
+ ({ asChild: a = !1, ...o }, e) => /* @__PURE__ */ p(a ? w : "input", { ref: e, inputMode: "decimal", ...o })
15
15
  );
16
- u.displayName = "NumberInputBase";
16
+ $.displayName = "NumberInputBase";
17
+ const P = C(
18
+ ({
19
+ label: a,
20
+ helperText: o,
21
+ errorMessage: e,
22
+ validationStatus: n,
23
+ required: d,
24
+ disabled: D,
25
+ htmlFor: m,
26
+ children: g,
27
+ ...h
28
+ }, y) => {
29
+ const s = E(), c = m ?? s, u = `${c}-helper`, l = `${c}-error`, f = n === "error" && e, v = [f ? l : void 0, o ? u : void 0].filter(Boolean).join(" ") || void 0, B = K.map(g, (t) => j(t) ? O(t, {
30
+ id: c,
31
+ "aria-describedby": v,
32
+ "aria-invalid": n === "error" ? !0 : void 0,
33
+ disabled: D || void 0
34
+ }) : t);
35
+ return /* @__PURE__ */ k("div", { ref: y, ...h, children: [
36
+ /* @__PURE__ */ k("label", { htmlFor: c, children: [
37
+ a,
38
+ d ? " *" : null
39
+ ] }),
40
+ B,
41
+ f ? /* @__PURE__ */ p("p", { id: l, role: "alert", children: e }) : null,
42
+ o ? /* @__PURE__ */ p("p", { id: u, children: o }) : null
43
+ ] });
44
+ }
45
+ );
46
+ P.displayName = "FormFieldBase";
47
+ function Z(...a) {
48
+ return (o) => {
49
+ for (const e of a)
50
+ typeof e == "function" ? e(o) : e && typeof e == "object" && (e.current = o);
51
+ };
52
+ }
53
+ const A = C(
54
+ ({
55
+ values: a,
56
+ onChange: o,
57
+ placeholder: e,
58
+ disabled: n,
59
+ maxPills: d,
60
+ delimiters: D = [],
61
+ ...m
62
+ }, g) => {
63
+ const [h, y] = b([]), [s, c] = b(""), u = R(null), l = a ?? h, f = i(
64
+ (r) => {
65
+ a || y(r), o?.(r);
66
+ },
67
+ [a, o]
68
+ ), v = i(
69
+ (r) => {
70
+ const I = r.trim();
71
+ I && (l.includes(I) || d != null && l.length >= d || (f([...l, I]), c("")));
72
+ },
73
+ [l, d, f]
74
+ ), B = i(
75
+ (r) => {
76
+ f(l.filter((I, N) => N !== r)), u.current?.focus();
77
+ },
78
+ [l, f]
79
+ ), t = i(
80
+ (r) => {
81
+ if (r.key === "Enter") {
82
+ r.preventDefault(), v(s);
83
+ return;
84
+ }
85
+ if (r.key === "Backspace" && s === "" && l.length > 0) {
86
+ B(l.length - 1);
87
+ return;
88
+ }
89
+ D.includes(r.key) && (r.preventDefault(), v(s));
90
+ },
91
+ [s, l, D, v, B]
92
+ ), x = i(() => {
93
+ n || u.current?.focus();
94
+ }, [n]), F = i(
95
+ (r) => {
96
+ !n && (r.key === "Enter" || r.key === " ") && u.current?.focus();
97
+ },
98
+ [n]
99
+ );
100
+ return /* @__PURE__ */ k(
101
+ "div",
102
+ {
103
+ role: "toolbar",
104
+ onClick: x,
105
+ onKeyDown: F,
106
+ ...m,
107
+ children: [
108
+ l.map((r) => /* @__PURE__ */ k("span", { children: [
109
+ r,
110
+ n ? null : /* @__PURE__ */ p(
111
+ "button",
112
+ {
113
+ type: "button",
114
+ onClick: (I) => {
115
+ I.stopPropagation(), B(l.indexOf(r));
116
+ },
117
+ "aria-label": `Remove ${r}`,
118
+ tabIndex: -1,
119
+ children: "×"
120
+ }
121
+ )
122
+ ] }, r)),
123
+ /* @__PURE__ */ p(
124
+ "input",
125
+ {
126
+ ref: Z(g, u),
127
+ type: "text",
128
+ value: s,
129
+ onChange: (r) => c(r.target.value),
130
+ onKeyDown: t,
131
+ placeholder: l.length === 0 ? e : void 0,
132
+ disabled: n,
133
+ "aria-label": m["aria-label"],
134
+ "aria-labelledby": m["aria-labelledby"]
135
+ }
136
+ )
137
+ ]
138
+ }
139
+ );
140
+ }
141
+ );
142
+ A.displayName = "PillInputBase";
143
+ function T(...a) {
144
+ return (o) => {
145
+ for (const e of a)
146
+ typeof e == "function" ? e(o) : e && typeof e == "object" && (e.current = o);
147
+ };
148
+ }
149
+ const _ = C(
150
+ ({ onChange: a, accept: o, multiple: e, disabled: n, children: d, ...D }, m) => {
151
+ const [g, h] = b(!1), y = R(null), s = i(
152
+ (t) => {
153
+ !t || t.length === 0 || a?.(Array.from(t));
154
+ },
155
+ [a]
156
+ ), c = i(
157
+ (t) => {
158
+ t.preventDefault(), n || h(!0);
159
+ },
160
+ [n]
161
+ ), u = i((t) => {
162
+ t.preventDefault(), h(!1);
163
+ }, []), l = i(
164
+ (t) => {
165
+ t.preventDefault(), h(!1), n || s(t.dataTransfer.files);
166
+ },
167
+ [n, s]
168
+ ), f = i(
169
+ (t) => {
170
+ s(t.target.files), t.target.value = "";
171
+ },
172
+ [s]
173
+ ), v = i(() => {
174
+ n || y.current?.click();
175
+ }, [n]), B = i(
176
+ (t) => {
177
+ !n && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), y.current?.click());
178
+ },
179
+ [n]
180
+ );
181
+ return /* @__PURE__ */ k(
182
+ "div",
183
+ {
184
+ role: "button",
185
+ tabIndex: n ? -1 : 0,
186
+ "aria-disabled": n || void 0,
187
+ "data-drag-over": g || void 0,
188
+ onClick: v,
189
+ onKeyDown: B,
190
+ onDragOver: c,
191
+ onDragLeave: u,
192
+ onDrop: l,
193
+ ...D,
194
+ children: [
195
+ /* @__PURE__ */ p(
196
+ "input",
197
+ {
198
+ ref: T(m, y),
199
+ type: "file",
200
+ style: { display: "none" },
201
+ accept: o,
202
+ multiple: e,
203
+ disabled: n,
204
+ onChange: f,
205
+ tabIndex: -1,
206
+ "aria-hidden": "true"
207
+ }
208
+ ),
209
+ d ?? /* @__PURE__ */ p("span", { children: "Drop files here or click to browse" })
210
+ ]
211
+ }
212
+ );
213
+ }
214
+ );
215
+ _.displayName = "FileDropZoneBase";
17
216
  export {
18
- C as ButtonBase,
19
- x as CheckboxBase,
20
- d as IconButtonBase,
21
- m as InputBase,
22
- u as NumberInputBase,
23
- I as SwitchBase,
24
- n as TextareaBase
217
+ L as ButtonBase,
218
+ M as CheckboxBase,
219
+ _ as FileDropZoneBase,
220
+ P as FormFieldBase,
221
+ Q as IconButtonBase,
222
+ S as InputBase,
223
+ $ as NumberInputBase,
224
+ A as PillInputBase,
225
+ U as RadioButtonBase,
226
+ W as SliderBase,
227
+ X as SwitchBase,
228
+ V as TextareaBase
25
229
  };
26
230
  //# sourceMappingURL=unstyled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unstyled.js","sources":["../src/unstyled/Input/Input.tsx","../src/unstyled/Textarea/Textarea.tsx","../src/unstyled/NumberInput/NumberInput.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes } from \"react\";\nimport { Slot } from \"../Slot\";\n\nexport interface InputBaseProps extends InputHTMLAttributes<HTMLInputElement> {\n asChild?: boolean;\n}\n\nexport const InputBase = forwardRef<HTMLInputElement, InputBaseProps>(\n ({ asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"input\";\n\n return <Comp ref={ref} {...props} />;\n },\n);\n\nInputBase.displayName = \"InputBase\";\n","import { forwardRef, type TextareaHTMLAttributes } from \"react\";\nimport { Slot } from \"../Slot\";\n\nexport interface TextareaBaseProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n asChild?: boolean;\n}\n\nexport const TextareaBase = forwardRef<HTMLTextAreaElement, TextareaBaseProps>(\n ({ asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"textarea\";\n\n return <Comp ref={ref} {...props} />;\n },\n);\n\nTextareaBase.displayName = \"TextareaBase\";\n","import { forwardRef, type InputHTMLAttributes } from \"react\";\nimport { Slot } from \"../Slot\";\n\nexport interface NumberInputBaseProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> {\n asChild?: boolean;\n}\n\nexport const NumberInputBase = forwardRef<HTMLInputElement, NumberInputBaseProps>(\n ({ asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"input\";\n\n return <Comp ref={ref} inputMode=\"decimal\" {...props} />;\n },\n);\n\nNumberInputBase.displayName = \"NumberInputBase\";\n"],"names":["InputBase","forwardRef","asChild","props","ref","jsx","Slot","TextareaBase","NumberInputBase"],"mappings":";;;;AAOO,MAAMA,IAAYC;AAAA,EACvB,CAAC,EAAE,SAAAC,IAAU,IAAO,GAAGC,EAAA,GAASC,MAGvB,gBAAAC,EAFMH,IAAUI,IAAO,SAEtB,EAAK,KAAAF,GAAW,GAAGD,EAAA,CAAO;AAEtC;AAEAH,EAAU,cAAc;ACRjB,MAAMO,IAAeN;AAAA,EAC1B,CAAC,EAAE,SAAAC,IAAU,IAAO,GAAGC,EAAA,GAASC,MAGvB,gBAAAC,EAFMH,IAAUI,IAAO,YAEtB,EAAK,KAAAF,GAAW,GAAGD,EAAA,CAAO;AAEtC;AAEAI,EAAa,cAAc;ACRpB,MAAMC,IAAkBP;AAAA,EAC7B,CAAC,EAAE,SAAAC,IAAU,IAAO,GAAGC,EAAA,GAASC,wBACjBF,IAAUI,IAAO,SAEtB,EAAK,KAAAF,GAAU,WAAU,WAAW,GAAGD,GAAO;AAE1D;AAEAK,EAAgB,cAAc;"}
1
+ {"version":3,"file":"unstyled.js","sources":["../src/unstyled/Input/Input.tsx","../src/unstyled/Textarea/Textarea.tsx","../src/unstyled/NumberInput/NumberInput.tsx","../src/unstyled/FormField/FormField.tsx","../src/unstyled/PillInput/PillInput.tsx","../src/unstyled/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes } from \"react\";\nimport { Slot } from \"../Slot\";\n\nexport interface InputBaseProps extends InputHTMLAttributes<HTMLInputElement> {\n asChild?: boolean;\n}\n\nexport const InputBase = forwardRef<HTMLInputElement, InputBaseProps>(\n ({ asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"input\";\n\n return <Comp ref={ref} {...props} />;\n },\n);\n\nInputBase.displayName = \"InputBase\";\n","import { forwardRef, type TextareaHTMLAttributes } from \"react\";\nimport { Slot } from \"../Slot\";\n\nexport interface TextareaBaseProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n asChild?: boolean;\n}\n\nexport const TextareaBase = forwardRef<HTMLTextAreaElement, TextareaBaseProps>(\n ({ asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"textarea\";\n\n return <Comp ref={ref} {...props} />;\n },\n);\n\nTextareaBase.displayName = \"TextareaBase\";\n","import { forwardRef, type InputHTMLAttributes } from \"react\";\nimport { Slot } from \"../Slot\";\n\nexport interface NumberInputBaseProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> {\n asChild?: boolean;\n}\n\nexport const NumberInputBase = forwardRef<HTMLInputElement, NumberInputBaseProps>(\n ({ asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"input\";\n\n return <Comp ref={ref} inputMode=\"decimal\" {...props} />;\n },\n);\n\nNumberInputBase.displayName = \"NumberInputBase\";\n","import {\n forwardRef,\n useId,\n Children,\n isValidElement,\n cloneElement,\n type ReactNode,\n type HTMLAttributes,\n} from \"react\";\n\nexport type ValidationStatus = \"error\" | \"warning\" | \"success\";\n\nexport interface FormFieldBaseProps extends HTMLAttributes<HTMLDivElement> {\n label: string;\n helperText?: string;\n errorMessage?: string;\n validationStatus?: ValidationStatus;\n required?: boolean;\n disabled?: boolean;\n /** Explicit id for the input element. Auto-generated if omitted. */\n htmlFor?: string;\n children: ReactNode;\n}\n\nexport const FormFieldBase = forwardRef<HTMLDivElement, FormFieldBaseProps>(\n (\n {\n label,\n helperText,\n errorMessage,\n validationStatus,\n required,\n disabled,\n htmlFor,\n children,\n ...props\n },\n ref,\n ) => {\n const autoId = useId();\n const fieldId = htmlFor ?? autoId;\n const helperId = `${fieldId}-helper`;\n const errorId = `${fieldId}-error`;\n\n const showError = validationStatus === \"error\" && errorMessage;\n\n const describedBy =\n [showError ? errorId : undefined, helperText ? helperId : undefined]\n .filter(Boolean)\n .join(\" \") || undefined;\n\n const enhancedChildren = Children.map(children, (child) => {\n if (!isValidElement(child)) return child;\n return cloneElement(child as React.ReactElement<Record<string, unknown>>, {\n id: fieldId,\n \"aria-describedby\": describedBy,\n \"aria-invalid\": validationStatus === \"error\" ? true : undefined,\n disabled: disabled || undefined,\n });\n });\n\n return (\n <div ref={ref} {...props}>\n <label htmlFor={fieldId}>\n {label}\n {required ? \" *\" : null}\n </label>\n\n {enhancedChildren}\n\n {showError ? (\n <p id={errorId} role=\"alert\">\n {errorMessage}\n </p>\n ) : null}\n\n {helperText ? <p id={helperId}>{helperText}</p> : null}\n </div>\n );\n },\n);\n\nFormFieldBase.displayName = \"FormFieldBase\";\n","import {\n forwardRef,\n useState,\n useRef,\n useCallback,\n type KeyboardEvent,\n type HTMLAttributes,\n type Ref,\n} from \"react\";\n\nfunction mergeRefs<T>(...refs: (Ref<T> | undefined)[]): (value: T | null) => void {\n return (value: T | null) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref && typeof ref === \"object\") {\n (ref as React.RefObject<T | null>).current = value;\n }\n }\n };\n}\n\nexport interface PillInputBaseProps extends Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /** Current list of pills (controlled). */\n values?: string[];\n /** Called when the pill list changes. */\n onChange?: (values: string[]) => void;\n /** Placeholder shown when no pills and input is empty. */\n placeholder?: string;\n /** Disable the entire component. */\n disabled?: boolean;\n /** Maximum number of pills allowed. */\n maxPills?: number;\n /** Characters that trigger pill creation (default: Enter). */\n delimiters?: string[];\n}\n\nexport const PillInputBase = forwardRef<HTMLInputElement, PillInputBaseProps>(\n (\n {\n values: controlledValues,\n onChange,\n placeholder,\n disabled,\n maxPills,\n delimiters = [],\n ...props\n },\n forwardedRef,\n ) => {\n const [internalValues, setInternalValues] = useState<string[]>([]);\n const [inputValue, setInputValue] = useState(\"\");\n const internalRef = useRef<HTMLInputElement>(null);\n\n const values = controlledValues ?? internalValues;\n\n const updateValues = useCallback(\n (next: string[]) => {\n if (!controlledValues) {\n setInternalValues(next);\n }\n onChange?.(next);\n },\n [controlledValues, onChange],\n );\n\n const addPill = useCallback(\n (text: string) => {\n const trimmed = text.trim();\n if (!trimmed) return;\n if (values.includes(trimmed)) return;\n if (maxPills != null && values.length >= maxPills) return;\n updateValues([...values, trimmed]);\n setInputValue(\"\");\n },\n [values, maxPills, updateValues],\n );\n\n const removePill = useCallback(\n (index: number) => {\n updateValues(values.filter((_, i) => i !== index));\n internalRef.current?.focus();\n },\n [values, updateValues],\n );\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n addPill(inputValue);\n return;\n }\n if (e.key === \"Backspace\" && inputValue === \"\" && values.length > 0) {\n removePill(values.length - 1);\n return;\n }\n if (delimiters.includes(e.key)) {\n e.preventDefault();\n addPill(inputValue);\n }\n },\n [inputValue, values, delimiters, addPill, removePill],\n );\n\n const handleContainerClick = useCallback(() => {\n if (!disabled) {\n internalRef.current?.focus();\n }\n }, [disabled]);\n\n const handleContainerKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (!disabled && (e.key === \"Enter\" || e.key === \" \")) {\n internalRef.current?.focus();\n }\n },\n [disabled],\n );\n\n return (\n <div\n role=\"toolbar\"\n onClick={handleContainerClick}\n onKeyDown={handleContainerKeyDown}\n {...props}>\n {values.map((pill) => (\n <span key={pill}>\n {pill}\n {!disabled ? (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n removePill(values.indexOf(pill));\n }}\n aria-label={`Remove ${pill}`}\n tabIndex={-1}>\n ×\n </button>\n ) : null}\n </span>\n ))}\n <input\n ref={mergeRefs(forwardedRef, internalRef)}\n type=\"text\"\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={values.length === 0 ? placeholder : undefined}\n disabled={disabled}\n aria-label={props[\"aria-label\"]}\n aria-labelledby={props[\"aria-labelledby\"]}\n />\n </div>\n );\n },\n);\n\nPillInputBase.displayName = \"PillInputBase\";\n","import {\n forwardRef,\n useState,\n useRef,\n useCallback,\n type DragEvent,\n type ChangeEvent,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\";\n\nfunction mergeRefs<T>(...refs: (Ref<T> | undefined)[]): (value: T | null) => void {\n return (value: T | null) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref && typeof ref === \"object\") {\n (ref as React.RefObject<T | null>).current = value;\n }\n }\n };\n}\n\nexport interface FileDropZoneBaseProps extends Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /** Called with selected files. */\n onChange?: (files: File[]) => void;\n /** Accepted file types (e.g. \".pdf,.csv\" or \"image/*\"). */\n accept?: string;\n /** Allow multiple file selection. */\n multiple?: boolean;\n /** Disable the component. */\n disabled?: boolean;\n /** Custom content inside the drop zone. */\n children?: ReactNode;\n}\n\nexport const FileDropZoneBase = forwardRef<HTMLInputElement, FileDropZoneBaseProps>(\n ({ onChange, accept, multiple, disabled, children, ...props }, forwardedRef) => {\n const [isDragOver, setIsDragOver] = useState(false);\n const internalRef = useRef<HTMLInputElement>(null);\n\n const handleFiles = useCallback(\n (fileList: FileList | null) => {\n if (!fileList || fileList.length === 0) return;\n onChange?.(Array.from(fileList));\n },\n [onChange],\n );\n\n const handleDragOver = useCallback(\n (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n if (!disabled) {\n setIsDragOver(true);\n }\n },\n [disabled],\n );\n\n const handleDragLeave = useCallback((e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n setIsDragOver(false);\n }, []);\n\n const handleDrop = useCallback(\n (e: DragEvent<HTMLDivElement>) => {\n e.preventDefault();\n setIsDragOver(false);\n if (!disabled) {\n handleFiles(e.dataTransfer.files);\n }\n },\n [disabled, handleFiles],\n );\n\n const handleInputChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n handleFiles(e.target.files);\n // Reset so the same file can be selected again\n e.target.value = \"\";\n },\n [handleFiles],\n );\n\n const handleClick = useCallback(() => {\n if (!disabled) {\n internalRef.current?.click();\n }\n }, [disabled]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (!disabled && (e.key === \"Enter\" || e.key === \" \")) {\n e.preventDefault();\n internalRef.current?.click();\n }\n },\n [disabled],\n );\n\n return (\n <div\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n aria-disabled={disabled || undefined}\n data-drag-over={isDragOver || undefined}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n {...props}>\n <input\n ref={mergeRefs(forwardedRef, internalRef)}\n type=\"file\"\n style={{ display: \"none\" }}\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n onChange={handleInputChange}\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n {children ?? <span>Drop files here or click to browse</span>}\n </div>\n );\n },\n);\n\nFileDropZoneBase.displayName = \"FileDropZoneBase\";\n"],"names":["InputBase","forwardRef","asChild","props","ref","jsx","Slot","TextareaBase","NumberInputBase","FormFieldBase","label","helperText","errorMessage","validationStatus","required","disabled","htmlFor","children","autoId","useId","fieldId","helperId","errorId","showError","describedBy","enhancedChildren","Children","child","isValidElement","cloneElement","jsxs","mergeRefs","refs","value","PillInputBase","controlledValues","onChange","placeholder","maxPills","delimiters","forwardedRef","internalValues","setInternalValues","useState","inputValue","setInputValue","internalRef","useRef","values","updateValues","useCallback","next","addPill","text","trimmed","removePill","index","_","i","handleKeyDown","e","handleContainerClick","handleContainerKeyDown","pill","FileDropZoneBase","accept","multiple","isDragOver","setIsDragOver","handleFiles","fileList","handleDragOver","handleDragLeave","handleDrop","handleInputChange","handleClick"],"mappings":";;;;AAOO,MAAMA,IAAYC;AAAA,EACvB,CAAC,EAAE,SAAAC,IAAU,IAAO,GAAGC,EAAA,GAASC,MAGvB,gBAAAC,EAFMH,IAAUI,IAAO,SAEtB,EAAK,KAAAF,GAAW,GAAGD,EAAA,CAAO;AAEtC;AAEAH,EAAU,cAAc;ACRjB,MAAMO,IAAeN;AAAA,EAC1B,CAAC,EAAE,SAAAC,IAAU,IAAO,GAAGC,EAAA,GAASC,MAGvB,gBAAAC,EAFMH,IAAUI,IAAO,YAEtB,EAAK,KAAAF,GAAW,GAAGD,EAAA,CAAO;AAEtC;AAEAI,EAAa,cAAc;ACRpB,MAAMC,IAAkBP;AAAA,EAC7B,CAAC,EAAE,SAAAC,IAAU,IAAO,GAAGC,EAAA,GAASC,wBACjBF,IAAUI,IAAO,SAE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AA;AAAA,EAG3D;AACF;AAEA2D,EAAiB,cAAc;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utk09/finra-ui",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Component library for web applications. Core UI components and styles.",
5
5
  "displayName": "Finra UI",
6
6
  "type": "module",
@@ -1,67 +0,0 @@
1
- import { jsx as c, jsxs as u } from "react/jsx-runtime";
2
- import { forwardRef as r, isValidElement as p, cloneElement as l, useRef as m, useEffect as y } from "react";
3
- function B(...t) {
4
- return (o) => {
5
- for (const e of t)
6
- typeof e == "function" ? e(o) : e && typeof e == "object" && (e.current = o);
7
- };
8
- }
9
- function b(t, o) {
10
- const e = { ...t, ...o };
11
- for (const n of Object.keys(t)) {
12
- if (n === "children" || n === "ref") continue;
13
- const f = t[n], s = o[n];
14
- typeof f == "function" && typeof s == "function" && (e[n] = (...a) => {
15
- s(...a), f(...a);
16
- }), n === "className" && typeof f == "string" && typeof s == "string" && (e[n] = `${f} ${s}`.trim()), n === "style" && typeof f == "object" && typeof s == "object" && (e[n] = { ...f, ...s });
17
- }
18
- return e;
19
- }
20
- const i = r(
21
- ({ children: t, ...o }, e) => {
22
- if (!p(t))
23
- return null;
24
- const n = t.props, f = t.ref;
25
- return l(t, {
26
- ...b(o, n),
27
- ref: B(e, f)
28
- });
29
- }
30
- );
31
- i.displayName = "Slot";
32
- const d = r(
33
- ({ asChild: t = !1, ...o }, e) => /* @__PURE__ */ c(t ? i : "button", { ref: e, ...o })
34
- );
35
- d.displayName = "ButtonBase";
36
- const h = r(
37
- ({ asChild: t = !1, icon: o, children: e, ...n }, f) => /* @__PURE__ */ u(t ? i : "button", { ref: f, ...n, children: [
38
- o,
39
- e
40
- ] })
41
- );
42
- h.displayName = "IconButtonBase";
43
- function j(...t) {
44
- return (o) => {
45
- for (const e of t)
46
- typeof e == "function" ? e(o) : e && typeof e == "object" && (e.current = o);
47
- };
48
- }
49
- const x = r(
50
- ({ indeterminate: t, ...o }, e) => {
51
- const n = m(null);
52
- return y(() => {
53
- n.current && (n.current.indeterminate = t ?? !1);
54
- }, [t]), /* @__PURE__ */ c("input", { ref: j(e, n), type: "checkbox", ...o });
55
- }
56
- );
57
- x.displayName = "CheckboxBase";
58
- const C = r((t, o) => /* @__PURE__ */ c("input", { ref: o, type: "checkbox", role: "switch", ...t }));
59
- C.displayName = "SwitchBase";
60
- export {
61
- d as B,
62
- x as C,
63
- h as I,
64
- C as S,
65
- i as a
66
- };
67
- //# sourceMappingURL=Switch-BgWsJGsh.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Switch-BgWsJGsh.js","sources":["../src/unstyled/Slot.tsx","../src/unstyled/Button/Button.tsx","../src/unstyled/IconButton/IconButton.tsx","../src/unstyled/Checkbox/Checkbox.tsx","../src/unstyled/Switch/Switch.tsx"],"sourcesContent":["import {\n forwardRef,\n isValidElement,\n cloneElement,\n type ReactNode,\n type HTMLAttributes,\n type Ref,\n} from \"react\";\n\nfunction mergeRefs<T>(...refs: (Ref<T> | undefined)[]): Ref<T> {\n return (value: T | null) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref && typeof ref === \"object\") {\n (ref as React.RefObject<T | null>).current = value;\n }\n }\n };\n}\n\nfunction mergeProps(\n slotProps: Record<string, unknown>,\n childProps: Record<string, unknown>,\n): Record<string, unknown> {\n const merged: Record<string, unknown> = { ...slotProps, ...childProps };\n\n for (const key of Object.keys(slotProps)) {\n if (key === \"children\" || key === \"ref\") continue;\n\n const slotVal = slotProps[key];\n const childVal = childProps[key];\n\n // Merge event handlers\n if (typeof slotVal === \"function\" && typeof childVal === \"function\") {\n merged[key] = (...args: unknown[]) => {\n childVal(...args);\n slotVal(...args);\n };\n }\n\n // Merge className\n if (key === \"className\" && typeof slotVal === \"string\" && typeof childVal === \"string\") {\n merged[key] = `${slotVal} ${childVal}`.trim();\n }\n\n // Merge style\n if (key === \"style\" && typeof slotVal === \"object\" && typeof childVal === \"object\") {\n merged[key] = { ...(slotVal as object), ...(childVal as object) };\n }\n }\n\n return merged;\n}\n\nexport interface SlotProps extends HTMLAttributes<HTMLElement> {\n children?: ReactNode;\n}\n\nexport const Slot = forwardRef<HTMLElement, SlotProps>(\n ({ children, ...slotProps }, forwardedRef) => {\n if (!isValidElement(children)) {\n return null;\n }\n\n const childProps = children.props as Record<string, unknown>;\n const childRef = (children as unknown as { ref?: Ref<HTMLElement> }).ref;\n\n return cloneElement(children, {\n ...mergeProps(slotProps, childProps),\n ref: mergeRefs(forwardedRef, childRef),\n } as Record<string, unknown>);\n },\n);\n\nSlot.displayName = \"Slot\";\n","import { forwardRef, type ButtonHTMLAttributes } from \"react\";\nimport { Slot } from \"../Slot\";\n\nexport interface ButtonBaseProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n asChild?: boolean;\n}\n\nexport const ButtonBase = forwardRef<HTMLButtonElement, ButtonBaseProps>(\n ({ asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n\n return <Comp ref={ref} {...props} />;\n },\n);\n\nButtonBase.displayName = \"ButtonBase\";\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from \"react\";\nimport { Slot } from \"../Slot\";\n\nexport interface IconButtonBaseProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n asChild?: boolean;\n icon: ReactNode;\n \"aria-label\": string;\n}\n\nexport const IconButtonBase = forwardRef<HTMLButtonElement, IconButtonBaseProps>(\n ({ asChild = false, icon, children, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp ref={ref} {...props}>\n {icon}\n {children}\n </Comp>\n );\n },\n);\n\nIconButtonBase.displayName = \"IconButtonBase\";\n","import { forwardRef, useEffect, useRef, type InputHTMLAttributes, type Ref } from \"react\";\n\nexport interface CheckboxBaseProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\"> {\n indeterminate?: boolean;\n}\n\nfunction mergeRefs<T>(...refs: (Ref<T> | undefined)[]): (value: T | null) => void {\n return (value: T | null) => {\n for (const ref of refs) {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref && typeof ref === \"object\") {\n (ref as React.RefObject<T | null>).current = value;\n }\n }\n };\n}\n\nexport const CheckboxBase = forwardRef<HTMLInputElement, CheckboxBaseProps>(\n ({ indeterminate, ...props }, forwardedRef) => {\n const internalRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (internalRef.current) {\n internalRef.current.indeterminate = indeterminate ?? false;\n }\n }, [indeterminate]);\n\n return <input ref={mergeRefs(forwardedRef, internalRef)} type=\"checkbox\" {...props} />;\n },\n);\n\nCheckboxBase.displayName = \"CheckboxBase\";\n","import { forwardRef, type InputHTMLAttributes } from \"react\";\n\nexport interface SwitchBaseProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"role\"\n> {}\n\nexport const SwitchBase = forwardRef<HTMLInputElement, SwitchBaseProps>((props, ref) => {\n return <input ref={ref} type=\"checkbox\" role=\"switch\" {...props} />;\n});\n\nSwitchBase.displayName = \"SwitchBase\";\n"],"names":["mergeRefs","refs","value","ref","mergeProps","slotProps","childProps","merged","key","slotVal","childVal","args","Slot","forwardRef","children","forwardedRef","isValidElement","childRef","cloneElement","ButtonBase","asChild","props","jsx","IconButtonBase","icon","jsxs","CheckboxBase","indeterminate","internalRef","useRef","useEffect","SwitchBase"],"mappings":";;AASA,SAASA,KAAgBC,GAAsC;AAC7D,SAAO,CAACC,MAAoB;AAC1B,eAAWC,KAAOF;AAChB,MAAI,OAAOE,KAAQ,aACjBA,EAAID,CAAK,IACAC,KAAO,OAAOA,KAAQ,aAC9BA,EAAkC,UAAUD;AAAA,EAGnD;AACF;AAEA,SAASE,EACPC,GACAC,GACyB;AACzB,QAAMC,IAAkC,EAAE,GAAGF,GAAW,GAAGC,EAAA;AAE3D,aAAWE,KAAO,OAAO,KAAKH,CAAS,GAAG;AACxC,QAAIG,MAAQ,cAAcA,MAAQ,MAAO;AAEzC,UAAMC,IA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