@utk09/finra-ui 0.0.1
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/LICENSE +21 -0
- package/dist/Switch-BgWsJGsh.js +67 -0
- package/dist/Switch-BgWsJGsh.js.map +1 -0
- package/dist/components/Badge/Badge.d.ts +12 -0
- package/dist/components/Button/Button.d.ts +15 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +5 -0
- package/dist/components/Checkbox/Checkbox.d.ts +6 -0
- package/dist/components/Divider/Divider.d.ts +7 -0
- package/dist/components/FormField/FormField.d.ts +16 -0
- package/dist/components/IconButton/IconButton.d.ts +11 -0
- package/dist/components/Input/Input.d.ts +16 -0
- package/dist/components/NumberInput/NumberInput.d.ts +19 -0
- package/dist/components/Switch/Switch.d.ts +6 -0
- package/dist/components/Textarea/Textarea.d.ts +17 -0
- package/dist/components/componentIds.d.ts +24 -0
- package/dist/fonts/InclusiveSans-Bold.ttf +0 -0
- package/dist/fonts/InclusiveSans-BoldItalic.ttf +0 -0
- package/dist/fonts/InclusiveSans-Italic.ttf +0 -0
- package/dist/fonts/InclusiveSans-Light.ttf +0 -0
- package/dist/fonts/InclusiveSans-LightItalic.ttf +0 -0
- package/dist/fonts/InclusiveSans-Medium.ttf +0 -0
- package/dist/fonts/InclusiveSans-MediumItalic.ttf +0 -0
- package/dist/fonts/InclusiveSans-Regular.ttf +0 -0
- package/dist/fonts/InclusiveSans-SemiBold.ttf +0 -0
- package/dist/fonts/InclusiveSans-SemiBoldItalic.ttf +0 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +834 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/styles.d.ts +2 -0
- package/dist/types/global.d.ts +14 -0
- package/dist/unstyled/Button/Button.d.ts +5 -0
- package/dist/unstyled/Checkbox/Checkbox.d.ts +5 -0
- package/dist/unstyled/IconButton/IconButton.d.ts +7 -0
- package/dist/unstyled/Input/Input.d.ts +5 -0
- package/dist/unstyled/NumberInput/NumberInput.d.ts +5 -0
- package/dist/unstyled/Slot.d.ts +5 -0
- package/dist/unstyled/Switch/Switch.d.ts +4 -0
- package/dist/unstyled/Textarea/Textarea.d.ts +5 -0
- package/dist/unstyled.d.ts +14 -0
- package/dist/unstyled.js +26 -0
- package/dist/unstyled.js.map +1 -0
- package/package.json +81 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Utkarsh Tiwari
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
export type BadgeSentiment = "danger" | "success" | "warning" | "info";
|
|
4
|
+
declare const badgeVariants: (props?: ({
|
|
5
|
+
variant?: "primary" | "secondary" | "tertiary" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
8
|
+
sentiment?: BadgeSentiment;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const Badge: import('react').ForwardRefExoticComponent<BadgeProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { ButtonBaseProps } from '../../unstyled/Button/Button';
|
|
4
|
+
export type ButtonSentiment = "danger" | "success" | "warning" | "info";
|
|
5
|
+
declare const buttonVariants: (props?: ({
|
|
6
|
+
variant?: "primary" | "secondary" | "tertiary" | null | undefined;
|
|
7
|
+
fullWidth?: boolean | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
export interface ButtonProps extends ButtonBaseProps, VariantProps<typeof buttonVariants> {
|
|
10
|
+
sentiment?: ButtonSentiment;
|
|
11
|
+
startIcon?: ReactNode;
|
|
12
|
+
endIcon?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
orientation?: "horizontal" | "vertical";
|
|
4
|
+
}
|
|
5
|
+
export declare const ButtonGroup: import('react').ForwardRefExoticComponent<ButtonGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CheckboxBaseProps } from '../../unstyled/Checkbox/Checkbox';
|
|
2
|
+
export interface CheckboxProps extends Omit<CheckboxBaseProps, "className"> {
|
|
3
|
+
label?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Checkbox: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface DividerProps extends HTMLAttributes<HTMLHRElement> {
|
|
3
|
+
orientation?: "horizontal" | "vertical";
|
|
4
|
+
decorative?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const Divider: import('react').ForwardRefExoticComponent<DividerProps & import('react').RefAttributes<HTMLHRElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
import { ValidationStatus } from '../Input/Input';
|
|
3
|
+
export interface FormFieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
label: string;
|
|
5
|
+
helperText?: string;
|
|
6
|
+
errorMessage?: string;
|
|
7
|
+
validationStatus?: ValidationStatus;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Explicit id for the input element. Auto-generated if omitted. */
|
|
12
|
+
htmlFor?: string;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const FormField: import('react').ForwardRefExoticComponent<FormFieldProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { IconButtonBaseProps } from '../../unstyled/IconButton/IconButton';
|
|
3
|
+
export type IconButtonSentiment = "danger" | "success" | "warning" | "info";
|
|
4
|
+
declare const iconButtonVariants: (props?: ({
|
|
5
|
+
variant?: "primary" | "secondary" | "tertiary" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface IconButtonProps extends IconButtonBaseProps, VariantProps<typeof iconButtonVariants> {
|
|
8
|
+
sentiment?: IconButtonSentiment;
|
|
9
|
+
}
|
|
10
|
+
export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
export type ValidationStatus = "error" | "warning" | "success";
|
|
4
|
+
declare const inputVariants: (props?: ({
|
|
5
|
+
variant?: "primary" | "secondary" | "tertiary" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size">, VariantProps<typeof inputVariants> {
|
|
8
|
+
validationStatus?: ValidationStatus;
|
|
9
|
+
startAdornment?: ReactNode;
|
|
10
|
+
endAdornment?: ReactNode;
|
|
11
|
+
clearable?: boolean;
|
|
12
|
+
onClear?: () => void;
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { ValidationStatus } from '../Input/Input';
|
|
4
|
+
declare const numberInputVariants: (props?: ({
|
|
5
|
+
variant?: "primary" | "secondary" | "tertiary" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface NumberInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "onChange" | "value" | "defaultValue" | "min" | "max" | "step">, VariantProps<typeof numberInputVariants> {
|
|
8
|
+
validationStatus?: ValidationStatus;
|
|
9
|
+
value?: number | "";
|
|
10
|
+
defaultValue?: number;
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
step?: number;
|
|
14
|
+
precision?: number;
|
|
15
|
+
onChange?: (value: number | undefined) => void;
|
|
16
|
+
fullWidth?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const NumberInput: import('react').ForwardRefExoticComponent<NumberInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SwitchBaseProps } from '../../unstyled/Switch/Switch';
|
|
2
|
+
export interface SwitchProps extends Omit<SwitchBaseProps, "className"> {
|
|
3
|
+
label?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Switch: import('react').ForwardRefExoticComponent<SwitchProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { ValidationStatus } from '../Input/Input';
|
|
4
|
+
declare const textareaVariants: (props?: ({
|
|
5
|
+
variant?: "primary" | "secondary" | "tertiary" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size">, VariantProps<typeof textareaVariants> {
|
|
8
|
+
validationStatus?: ValidationStatus;
|
|
9
|
+
showCharCount?: boolean;
|
|
10
|
+
warningThreshold?: number;
|
|
11
|
+
autoResize?: boolean;
|
|
12
|
+
minRows?: number;
|
|
13
|
+
maxRows?: number;
|
|
14
|
+
fullWidth?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const Textarea: import('react').ForwardRefExoticComponent<TextareaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const FINRA_UI_ATTR: "data-finra-ui";
|
|
2
|
+
export declare const componentIds: {
|
|
3
|
+
readonly button: "button";
|
|
4
|
+
readonly iconButton: "icon-button";
|
|
5
|
+
readonly buttonGroup: "button-group";
|
|
6
|
+
readonly input: "input";
|
|
7
|
+
readonly inputField: "input-field";
|
|
8
|
+
readonly textarea: "textarea";
|
|
9
|
+
readonly textareaField: "textarea-field";
|
|
10
|
+
readonly textareaCount: "textarea-count";
|
|
11
|
+
readonly numberInput: "number-input";
|
|
12
|
+
readonly numberInputField: "number-input-field";
|
|
13
|
+
readonly numberInputIncrement: "number-input-increment";
|
|
14
|
+
readonly numberInputDecrement: "number-input-decrement";
|
|
15
|
+
readonly formField: "form-field";
|
|
16
|
+
readonly formFieldLabel: "form-field-label";
|
|
17
|
+
readonly formFieldHelper: "form-field-helper";
|
|
18
|
+
readonly formFieldError: "form-field-error";
|
|
19
|
+
readonly checkbox: "checkbox";
|
|
20
|
+
readonly switch: "switch";
|
|
21
|
+
readonly badge: "badge";
|
|
22
|
+
readonly divider: "divider";
|
|
23
|
+
};
|
|
24
|
+
export type ComponentId = (typeof componentIds)[keyof typeof componentIds];
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { FINRA_UI_ATTR, componentIds } from './components/componentIds';
|
|
2
|
+
export type { ComponentId } from './components/componentIds';
|
|
3
|
+
export { Button } from './components/Button/Button';
|
|
4
|
+
export type { ButtonProps, ButtonSentiment } from './components/Button/Button';
|
|
5
|
+
export { IconButton } from './components/IconButton/IconButton';
|
|
6
|
+
export type { IconButtonProps, IconButtonSentiment } from './components/IconButton/IconButton';
|
|
7
|
+
export { ButtonGroup } from './components/ButtonGroup/ButtonGroup';
|
|
8
|
+
export type { ButtonGroupProps } from './components/ButtonGroup/ButtonGroup';
|
|
9
|
+
export { Input } from './components/Input/Input';
|
|
10
|
+
export type { InputProps, ValidationStatus } from './components/Input/Input';
|
|
11
|
+
export { Textarea } from './components/Textarea/Textarea';
|
|
12
|
+
export type { TextareaProps } from './components/Textarea/Textarea';
|
|
13
|
+
export { NumberInput } from './components/NumberInput/NumberInput';
|
|
14
|
+
export type { NumberInputProps } from './components/NumberInput/NumberInput';
|
|
15
|
+
export { FormField } from './components/FormField/FormField';
|
|
16
|
+
export type { FormFieldProps } from './components/FormField/FormField';
|
|
17
|
+
export { Checkbox } from './components/Checkbox/Checkbox';
|
|
18
|
+
export type { CheckboxProps } from './components/Checkbox/Checkbox';
|
|
19
|
+
export { Switch } from './components/Switch/Switch';
|
|
20
|
+
export type { SwitchProps } from './components/Switch/Switch';
|
|
21
|
+
export { Badge } from './components/Badge/Badge';
|
|
22
|
+
export type { BadgeProps, BadgeSentiment } from './components/Badge/Badge';
|
|
23
|
+
export { Divider } from './components/Divider/Divider';
|
|
24
|
+
export type { DividerProps } from './components/Divider/Divider';
|