@dnotrever2/super-kit 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +666 -0
- package/dist/Badge/Badge.d.ts +15 -0
- package/dist/Badge/index.d.ts +1 -0
- package/dist/Button/Button.d.ts +17 -0
- package/dist/Button/index.d.ts +1 -0
- package/dist/Card/Card.d.ts +33 -0
- package/dist/Card/index.d.ts +1 -0
- package/dist/Input/Input.d.ts +43 -0
- package/dist/Input/index.d.ts +1 -0
- package/dist/Markers/Markers.d.ts +38 -0
- package/dist/Markers/index.d.ts +1 -0
- package/dist/Menu/Menu.d.ts +23 -0
- package/dist/Menu/index.d.ts +1 -0
- package/dist/Modal/Modal.d.ts +19 -0
- package/dist/Modal/index.d.ts +1 -0
- package/dist/Popover/Popover.d.ts +17 -0
- package/dist/Popover/index.d.ts +1 -0
- package/dist/PushButton/PushButton.d.ts +19 -0
- package/dist/PushButton/index.d.ts +1 -0
- package/dist/Scrollable/Scrollable.d.ts +16 -0
- package/dist/Scrollable/index.d.ts +1 -0
- package/dist/Select/Select.d.ts +44 -0
- package/dist/Select/index.d.ts +1 -0
- package/dist/Spinner/Spinner.d.ts +13 -0
- package/dist/Spinner/index.d.ts +1 -0
- package/dist/Textarea/Textarea.d.ts +23 -0
- package/dist/Textarea/index.d.ts +1 -0
- package/dist/Toast/Toast.d.ts +28 -0
- package/dist/Toast/index.d.ts +1 -0
- package/dist/Tooltip/Tooltip.d.ts +13 -0
- package/dist/Tooltip/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useControlledState.d.ts +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/super-kit.cjs +2 -0
- package/dist/super-kit.cjs.map +1 -0
- package/dist/super-kit.css +1 -0
- package/dist/super-kit.js +1239 -0
- package/dist/super-kit.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/mask.d.ts +6 -0
- package/package.json +50 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ButtonVariant = "primary" | "secondary" | "ghost" | "danger" | "success" | "warning";
|
|
3
|
+
export type ButtonSize = "sm" | "md" | "lg";
|
|
4
|
+
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
5
|
+
variant?: ButtonVariant;
|
|
6
|
+
size?: ButtonSize;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare const Button: import('react').ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
12
|
+
variant?: ButtonVariant;
|
|
13
|
+
size?: ButtonSize;
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Button';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type CardPadding = "none" | "sm" | "md" | "lg";
|
|
3
|
+
export type CardProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
padding?: CardPadding;
|
|
5
|
+
bordered?: boolean;
|
|
6
|
+
tilt?: boolean;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
closeBtnProps?: ButtonHTMLAttributes<HTMLButtonElement>;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare function Card({ padding, bordered, tilt, onClose, closeBtnProps, children, className, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare namespace Card {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
export type CardHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
title: ReactNode;
|
|
18
|
+
subtitle?: ReactNode;
|
|
19
|
+
};
|
|
20
|
+
export declare function CardHeader({ icon, title, subtitle, className, ...props }: CardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare namespace CardHeader {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
24
|
+
export type CardStatProps = HTMLAttributes<HTMLDivElement> & {
|
|
25
|
+
value: ReactNode;
|
|
26
|
+
unit?: string;
|
|
27
|
+
delta?: string;
|
|
28
|
+
deltaDirection?: "positive" | "negative" | "neutral";
|
|
29
|
+
};
|
|
30
|
+
export declare function CardStat({ value, unit, delta, deltaDirection, className, ...props }: CardStatProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare namespace CardStat {
|
|
32
|
+
var displayName: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Card';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React, ButtonHTMLAttributes, ChangeEvent, HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type InputValueChange = {
|
|
3
|
+
value: string;
|
|
4
|
+
rawValue: string;
|
|
5
|
+
};
|
|
6
|
+
export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "value"> & {
|
|
7
|
+
label?: string;
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
iconPosition?: "left" | "right";
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
mask?: string;
|
|
13
|
+
maskPlaceholder?: string;
|
|
14
|
+
maskAllowedPattern?: RegExp;
|
|
15
|
+
clearable?: boolean;
|
|
16
|
+
clearLabel?: string;
|
|
17
|
+
selectOnFocus?: boolean;
|
|
18
|
+
textAlign?: "left" | "center" | "right";
|
|
19
|
+
wrapperProps?: HTMLAttributes<HTMLSpanElement>;
|
|
20
|
+
fieldProps?: HTMLAttributes<HTMLDivElement>;
|
|
21
|
+
clearButtonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
|
|
22
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
23
|
+
onValueChange?: (change: InputValueChange) => void;
|
|
24
|
+
};
|
|
25
|
+
export declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "value"> & {
|
|
26
|
+
label?: string;
|
|
27
|
+
icon?: ReactNode;
|
|
28
|
+
iconPosition?: "left" | "right";
|
|
29
|
+
value?: string;
|
|
30
|
+
defaultValue?: string;
|
|
31
|
+
mask?: string;
|
|
32
|
+
maskPlaceholder?: string;
|
|
33
|
+
maskAllowedPattern?: RegExp;
|
|
34
|
+
clearable?: boolean;
|
|
35
|
+
clearLabel?: string;
|
|
36
|
+
selectOnFocus?: boolean;
|
|
37
|
+
textAlign?: "left" | "center" | "right";
|
|
38
|
+
wrapperProps?: HTMLAttributes<HTMLSpanElement>;
|
|
39
|
+
fieldProps?: HTMLAttributes<HTMLDivElement>;
|
|
40
|
+
clearButtonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
|
|
41
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
42
|
+
onValueChange?: (change: InputValueChange) => void;
|
|
43
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Input';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> & {
|
|
3
|
+
label?: ReactNode;
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
defaultChecked?: boolean;
|
|
6
|
+
indeterminate?: boolean;
|
|
7
|
+
onChange?: (checked: boolean) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function Checkbox({ label, checked, defaultChecked, indeterminate, disabled, onChange, className, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare namespace Checkbox {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
13
|
+
export type RadioProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> & {
|
|
14
|
+
label?: ReactNode;
|
|
15
|
+
checked?: boolean;
|
|
16
|
+
onChange?: (value: string) => void;
|
|
17
|
+
};
|
|
18
|
+
export declare function Radio({ label, checked, disabled, onChange, value, className, ...props }: RadioProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare namespace Radio {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
export type RadioGroupProps = HTMLAttributes<HTMLDivElement> & {
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
export declare function RadioGroup({ children, className, ...props }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare namespace RadioGroup {
|
|
27
|
+
var displayName: string;
|
|
28
|
+
}
|
|
29
|
+
export type SwitchProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange"> & {
|
|
30
|
+
label?: ReactNode;
|
|
31
|
+
checked?: boolean;
|
|
32
|
+
defaultChecked?: boolean;
|
|
33
|
+
onChange?: (checked: boolean) => void;
|
|
34
|
+
};
|
|
35
|
+
export declare function Switch({ label, checked, defaultChecked, disabled, onChange, className, ...props }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare namespace Switch {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Markers';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type MenuProps = HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export declare function Menu({ children, className, ...props }: MenuProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare namespace Menu {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
}
|
|
9
|
+
export type MenuItemProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
kbd?: string;
|
|
12
|
+
active?: boolean;
|
|
13
|
+
danger?: boolean;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export declare function MenuItem({ icon, kbd, active, danger, disabled, children, className, ...props }: MenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare namespace MenuItem {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function MenuSeparator({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare namespace MenuSeparator {
|
|
22
|
+
var displayName: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Menu';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ModalProps = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
title?: ReactNode;
|
|
5
|
+
subtitle?: ReactNode;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
footer?: ReactNode;
|
|
8
|
+
closeOnBackdrop?: boolean;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
backdropProps?: HTMLAttributes<HTMLDivElement>;
|
|
11
|
+
modalProps?: HTMLAttributes<HTMLDivElement>;
|
|
12
|
+
headerProps?: HTMLAttributes<HTMLElement>;
|
|
13
|
+
bodyProps?: HTMLAttributes<HTMLElement>;
|
|
14
|
+
footerProps?: HTMLAttributes<HTMLElement>;
|
|
15
|
+
closeButtonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const Modal: import('react').ForwardRefExoticComponent<ModalProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Modal';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type PopoverSide = "bottom-start" | "bottom-end" | "top-start" | "top-end";
|
|
3
|
+
export type PopoverProps = {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
title?: ReactNode;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
trigger?: ReactNode;
|
|
9
|
+
side?: PopoverSide;
|
|
10
|
+
showCloseButton?: boolean;
|
|
11
|
+
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
popProps?: HTMLAttributes<HTMLDivElement>;
|
|
13
|
+
};
|
|
14
|
+
export declare function Popover({ open: openProp, defaultOpen, title, children, trigger, side, showCloseButton, onOpenChange, popProps }: PopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace Popover {
|
|
16
|
+
var displayName: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Popover';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type PushButtonGroupProps = HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export declare function PushButtonGroup({ children, className, ...props }: PushButtonGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare namespace PushButtonGroup {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
}
|
|
9
|
+
export type PushButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
10
|
+
on?: boolean;
|
|
11
|
+
accent?: boolean;
|
|
12
|
+
solo?: boolean;
|
|
13
|
+
icon?: ReactNode;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export declare function PushButton({ on, accent, solo, icon, children, disabled, className, ...props }: PushButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare namespace PushButton {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PushButton';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ScrollableDirection = "vertical" | "horizontal" | "both";
|
|
3
|
+
export type ScrollableProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
direction?: ScrollableDirection;
|
|
5
|
+
track?: boolean;
|
|
6
|
+
arrows?: boolean;
|
|
7
|
+
autoHide?: boolean;
|
|
8
|
+
expand?: boolean;
|
|
9
|
+
scrollbarSize?: number;
|
|
10
|
+
height?: string | number;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export declare function Scrollable({ direction, track, arrows, autoHide, expand, scrollbarSize, height, children, className, style, ...props }: ScrollableProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare namespace Scrollable {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Scrollable';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type SelectOption<Value extends string = string> = {
|
|
3
|
+
value: Value;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
meta?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type SelectValue<Value extends string = string> = Value | Value[] | null;
|
|
9
|
+
export type SelectProps<Value extends string = string> = Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> & {
|
|
10
|
+
label?: string;
|
|
11
|
+
options: SelectOption<Value>[];
|
|
12
|
+
value?: SelectValue<Value>;
|
|
13
|
+
defaultValue?: SelectValue<Value>;
|
|
14
|
+
multiple?: boolean;
|
|
15
|
+
searchable?: boolean;
|
|
16
|
+
clearable?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
searchPlaceholder?: string;
|
|
20
|
+
emptyLabel?: string;
|
|
21
|
+
loadingLabel?: string;
|
|
22
|
+
isLoading?: boolean;
|
|
23
|
+
filterOptions?: (options: SelectOption<Value>[], searchValue: string) => SelectOption<Value>[];
|
|
24
|
+
onSearchChange?: (searchValue: string) => void;
|
|
25
|
+
onValueChange?: (value: SelectValue<Value>, selectedOptions: SelectOption<Value>[]) => void;
|
|
26
|
+
};
|
|
27
|
+
export declare const Select: import('react').ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> & {
|
|
28
|
+
label?: string;
|
|
29
|
+
options: SelectOption<string>[];
|
|
30
|
+
value?: SelectValue<string> | undefined;
|
|
31
|
+
defaultValue?: SelectValue<string> | undefined;
|
|
32
|
+
multiple?: boolean;
|
|
33
|
+
searchable?: boolean;
|
|
34
|
+
clearable?: boolean;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
searchPlaceholder?: string;
|
|
38
|
+
emptyLabel?: string;
|
|
39
|
+
loadingLabel?: string;
|
|
40
|
+
isLoading?: boolean;
|
|
41
|
+
filterOptions?: ((options: SelectOption<string>[], searchValue: string) => SelectOption<string>[]) | undefined;
|
|
42
|
+
onSearchChange?: (searchValue: string) => void;
|
|
43
|
+
onValueChange?: ((value: SelectValue<string>, selectedOptions: SelectOption<string>[]) => void) | undefined;
|
|
44
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Select';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export type SpinnerVariant = "ring" | "dots" | "bar";
|
|
3
|
+
export type SpinnerSize = "sm" | "md" | "lg";
|
|
4
|
+
export type SpinnerProps = HTMLAttributes<HTMLSpanElement> & {
|
|
5
|
+
variant?: SpinnerVariant;
|
|
6
|
+
size?: SpinnerSize;
|
|
7
|
+
muted?: boolean;
|
|
8
|
+
onAccent?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function Spinner({ variant, size, muted, onAccent, className, ...props }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare namespace Spinner {
|
|
12
|
+
var displayName: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Spinner';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
2
|
+
export type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "defaultValue" | "onChange" | "value"> & {
|
|
3
|
+
label?: string;
|
|
4
|
+
helpText?: string;
|
|
5
|
+
maxLength?: number;
|
|
6
|
+
clearable?: boolean;
|
|
7
|
+
mono?: boolean;
|
|
8
|
+
value?: string;
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
onChange?: TextareaHTMLAttributes<HTMLTextAreaElement>["onChange"];
|
|
11
|
+
onValueChange?: (value: string) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const Textarea: import('react').ForwardRefExoticComponent<Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "defaultValue" | "onChange" | "value"> & {
|
|
14
|
+
label?: string;
|
|
15
|
+
helpText?: string;
|
|
16
|
+
maxLength?: number;
|
|
17
|
+
clearable?: boolean;
|
|
18
|
+
mono?: boolean;
|
|
19
|
+
value?: string;
|
|
20
|
+
defaultValue?: string;
|
|
21
|
+
onChange?: TextareaHTMLAttributes<HTMLTextAreaElement>["onChange"];
|
|
22
|
+
onValueChange?: (value: string) => void;
|
|
23
|
+
} & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Textarea';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ToastVariant = "ok" | "error" | "warning" | "info";
|
|
3
|
+
export type ToastItem = {
|
|
4
|
+
id: string;
|
|
5
|
+
variant: ToastVariant;
|
|
6
|
+
title: string;
|
|
7
|
+
message?: string;
|
|
8
|
+
duration?: number;
|
|
9
|
+
};
|
|
10
|
+
export type ToastProps = HTMLAttributes<HTMLDivElement> & {
|
|
11
|
+
variant?: ToastVariant;
|
|
12
|
+
title: string;
|
|
13
|
+
message?: string;
|
|
14
|
+
onDismiss?: () => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function Toast({ variant, title, message, onDismiss, className, ...props }: ToastProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare namespace Toast {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
type ToastContextValue = {
|
|
21
|
+
toast: (options: Omit<ToastItem, "id">) => string;
|
|
22
|
+
dismiss: (id: string) => void;
|
|
23
|
+
};
|
|
24
|
+
export declare function ToastProvider({ children }: {
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function useToast(): ToastContextValue;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Toast';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type TooltipSide = "top" | "bottom";
|
|
3
|
+
export type TooltipProps = {
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
side?: TooltipSide;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
wrapperProps?: HTMLAttributes<HTMLSpanElement>;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function Tooltip({ content, side, children, wrapperProps, disabled }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare namespace Tooltip {
|
|
12
|
+
var displayName: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Tooltip';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useControlledState';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useControlledState<T>(controlledValue: T | undefined, defaultValue: T, onChange?: (value: T) => void): readonly [T, (nextValue: T) => void, boolean];
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './Badge';
|
|
2
|
+
export * from './Scrollable';
|
|
3
|
+
export * from './Button';
|
|
4
|
+
export * from './Card';
|
|
5
|
+
export * from './Input';
|
|
6
|
+
export * from './Markers';
|
|
7
|
+
export * from './Menu';
|
|
8
|
+
export * from './Modal';
|
|
9
|
+
export * from './Popover';
|
|
10
|
+
export * from './PushButton';
|
|
11
|
+
export * from './Select';
|
|
12
|
+
export * from './Spinner';
|
|
13
|
+
export * from './Textarea';
|
|
14
|
+
export * from './Toast';
|
|
15
|
+
export * from './Tooltip';
|
|
16
|
+
export * from './hooks';
|
|
17
|
+
export * from './types';
|
|
18
|
+
export * from './utils';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),qe=require("react-dom"),Te="_badge_lyltm_1",De="_neutral_lyltm_18",Oe="_accent_lyltm_24",Ee="_outline_lyltm_29",We="_success_lyltm_35",Ae="_warning_lyltm_40",Fe="_danger_lyltm_45",ze="_info_lyltm_50",Xe="_count_lyltm_55",Ge="_mono_lyltm_63",Ve="_version_lyltm_71",Ue="_dismiss_lyltm_80",He="_dismissBtn_lyltm_84",Ke="_dot_lyltm_98",Ye="_dotIndicator_lyltm_111",Ze="_pill_lyltm_119",W={badge:Te,neutral:De,accent:Oe,outline:Ee,success:We,warning:Ae,danger:Fe,info:ze,count:Xe,mono:Ge,version:Ve,dismiss:Ue,dismissBtn:He,dot:Ke,dotIndicator:Ye,pill:Ze},Je=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"10",height:"10",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})});function ie({variant:n="neutral",icon:l,pill:t=!1,dismissable:s=!1,onDismiss:a,dotColor:o,children:c,className:r,...i}){if(n==="dot"){const x=[W.badge,W.dot,r].filter(Boolean).join(" ");return e.jsxs("span",{...i,className:x,children:[e.jsx("span",{className:W.dotIndicator,style:{background:o??"var(--accent)"}}),c]})}const h=[W.badge,W[n],t?W.pill:null,s?W.dismiss:null,r].filter(Boolean).join(" ");return e.jsxs("span",{...i,className:h,children:[l||null,c,s&&e.jsx("button",{type:"button",className:W.dismissBtn,"aria-label":"Remove",onClick:a,children:e.jsx(Je,{})})]})}ie.displayName="Badge";function re({direction:n="vertical",track:l=!1,arrows:t=!1,autoHide:s=!1,expand:a=!1,scrollbarSize:o,height:c,children:r,className:i,style:h,...x}){const j=["sb",l?"sb-track":null,t?"sb-arrows":null,s?"sb-auto-hide":null,a?"sb-expand":null,i].filter(Boolean).join(" "),g=n==="vertical"?{overflowY:"auto",overflowX:"hidden"}:n==="horizontal"?{overflowX:"auto",overflowY:"hidden"}:{overflow:"auto"},f=o!==void 0?{"--sb-w":`${o}px`}:void 0;return e.jsx("div",{...x,className:j,style:{height:c,...g,...f,...h},children:r})}re.displayName="Scrollable";const Qe="_btn_8cdvn_1",Pe="_icon_8cdvn_34",et="_primary_8cdvn_43",tt="_secondary_8cdvn_51",st="_ghost_8cdvn_61",nt="_danger_8cdvn_71",lt="_success_8cdvn_79",ot="_warning_8cdvn_87",at="_sm_8cdvn_96",ct="_md_8cdvn_104",it="_lg_8cdvn_106",J={btn:Qe,icon:Pe,primary:et,secondary:tt,ghost:st,danger:nt,success:lt,warning:ot,sm:at,md:ct,lg:it},de=u.forwardRef(({type:n="button",variant:l="secondary",size:t="md",icon:s,loading:a=!1,children:o,className:c,disabled:r,...i},h)=>{const x=[J.btn,J[l],J[t],c].filter(Boolean).join(" ");return e.jsxs("button",{ref:h,type:n,disabled:r||a,className:x,...i,children:[s?e.jsx("span",{className:J.icon,children:s}):null,o]})});de.displayName="Button";const rt="_card_1gxgi_1",dt="_bordered_1gxgi_8",_t="_tilt_1gxgi_12",ut="_closeBtn_1gxgi_20",ht="_padSm_1gxgi_41",xt="_padMd_1gxgi_42",mt="_padLg_1gxgi_43",ft="_padNone_1gxgi_44",jt="_header_1gxgi_47",pt="_headerIcon_1gxgi_54",gt="_title_1gxgi_63",vt="_subtitle_1gxgi_69",kt="_stat_1gxgi_76",bt="_statValue_1gxgi_83",Nt="_statUnit_1gxgi_91",yt="_statDelta_1gxgi_97",wt="_deltaPositive_1gxgi_102",Bt="_deltaNegative_1gxgi_103",Ct="_deltaNeutral_1gxgi_104",p={card:rt,bordered:dt,tilt:_t,closeBtn:ut,padSm:ht,padMd:xt,padLg:mt,padNone:ft,header:jt,headerIcon:pt,title:gt,subtitle:vt,stat:kt,statValue:bt,statUnit:Nt,statDelta:yt,deltaPositive:wt,deltaNegative:Bt,deltaNeutral:Ct},It={none:p.padNone,sm:p.padSm,md:p.padMd,lg:p.padLg},$t=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"10",height:"10",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})});function _e({padding:n="md",bordered:l=!1,tilt:t=!1,onClose:s,closeBtnProps:a,children:o,className:c,...r}){const i=[p.card,It[n],l?p.bordered:null,t?p.tilt:null,c].filter(Boolean).join(" ");return e.jsxs("div",{...r,className:i,children:[s&&e.jsx("button",{type:"button","aria-label":"Close",...a,className:[p.closeBtn,a==null?void 0:a.className].filter(Boolean).join(" "),onClick:s,children:e.jsx($t,{})}),o]})}_e.displayName="Card";function ue({icon:n,title:l,subtitle:t,className:s,...a}){return e.jsxs("div",{...a,className:[p.header,s].filter(Boolean).join(" "),children:[n&&e.jsx("span",{className:p.headerIcon,children:n}),e.jsxs("div",{children:[e.jsx("div",{className:p.title,children:l}),t&&e.jsx("div",{className:p.subtitle,children:t})]})]})}ue.displayName="CardHeader";function he({value:n,unit:l,delta:t,deltaDirection:s="positive",className:a,...o}){const c=[p.statDelta,s==="positive"?p.deltaPositive:s==="negative"?p.deltaNegative:p.deltaNeutral].filter(Boolean).join(" ");return e.jsxs("div",{...o,className:[p.stat,a].filter(Boolean).join(" "),children:[e.jsxs("span",{className:p.statValue,children:[n,l&&e.jsxs("span",{className:p.statUnit,children:[" ",l]})]}),t&&e.jsx("span",{className:c,children:t})]})}he.displayName="CardStat";function Q(n,l,t){const[s,a]=u.useState(l),o=n!==void 0,c=o?n:s,r=u.useCallback(i=>{o||a(i),t==null||t(i)},[o,t]);return[c,r,o]}const Mt="X",St=/[a-zA-Z0-9]/;function se(n,l={}){const t=l.allowedPattern??St;return n.split("").filter(s=>t.test(s)).join("")}function xe(n,l,t={}){const s=t.placeholder??Mt,a=se(n,t);let o=0,c="";for(const r of l){if(o>=a.length)break;if(r===s){c+=a[o],o+=1;continue}c+=r}return c}const Lt="_wrapper_25x8h_1",Rt="_field_25x8h_7",qt="_label_25x8h_13",Tt="_input_25x8h_22",Dt="_hasIcon_25x8h_52",Ot="_hasIconRight_25x8h_55",Et="_hasClear_25x8h_58",Wt="_hasClearAndIconRight_25x8h_61",At="_iconSlot_25x8h_64",Ft="_iconSlotRight_25x8h_78",zt="_iconSlotRightWithClear_25x8h_92",Xt="_clearBtn_25x8h_95",M={wrapper:Lt,field:Rt,label:qt,input:Tt,hasIcon:Dt,hasIconRight:Ot,hasClear:Et,hasClearAndIconRight:Wt,iconSlot:At,iconSlotRight:Ft,iconSlotRightWithClear:zt,clearBtn:Xt},Gt=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"12",height:"12",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),me=u.forwardRef(({label:n,icon:l,iconPosition:t="left",clearable:s=!1,clearButtonProps:a,clearLabel:o,defaultValue:c="",disabled:r,mask:i,maskAllowedPattern:h,maskPlaceholder:x,selectOnFocus:j=!1,textAlign:g,onChange:f,onValueChange:k,value:q,wrapperProps:B,fieldProps:b,className:$,...m},N)=>{const y=u.useRef(null),[z,X]=Q(q,c,v=>{k==null||k({value:v,rawValue:i?se(v,{allowedPattern:h}):v})});u.useImperativeHandle(N,()=>y.current);const O=u.useCallback(v=>i?xe(v,i,{allowedPattern:h,placeholder:x}):v,[i,h,x]),U=v=>{const E=O(v.target.value);v.target.value=E,X(E),f==null||f(v)},C=()=>{var v;X(""),(v=y.current)==null||v.focus()},L=l&&t==="right",H=l&&t==="left",K=[M.input,H?M.hasIcon:null,L?M.hasIconRight:null,s&&L?M.hasClearAndIconRight:s?M.hasClear:null,$].filter(Boolean).join(" "),P=v=>{var E;j&&v.target.select(),(E=m.onFocus)==null||E.call(m,v)},Y=e.jsx("input",{ref:y,disabled:r,value:O(z),onChange:U,onFocus:P,className:K,style:g?{textAlign:g,...m.style}:m.style,...m}),ee=[M.wrapper,B==null?void 0:B.className].filter(Boolean).join(" "),Z=e.jsxs("span",{...B,className:ee,children:[H?e.jsx("span",{className:M.iconSlot,children:l}):null,Y,L?e.jsx("span",{className:[M.iconSlotRight,s?M.iconSlotRightWithClear:null].filter(Boolean).join(" "),children:l}):null,s?e.jsx("button",{type:"button","aria-label":"Clear",title:"Clear",disabled:r||z.length===0,onClick:C,className:M.clearBtn,...a,children:(a==null?void 0:a.children)??e.jsx(Gt,{})}):null]});return!n&&!b?Z:e.jsxs("div",{...b,className:[M.field,b==null?void 0:b.className].filter(Boolean).join(" "),children:[n?e.jsx("label",{className:M.label,children:n}):null,Z]})});me.displayName="Input";const Vt="_checkbox_7kjwa_2",Ut="_checkboxBox_7kjwa_13",Ht="_checked_7kjwa_33",Kt="_indeterminate_7kjwa_42",Yt="_disabled_7kjwa_55",Zt="_radio_7kjwa_61",Jt="_radioDot_7kjwa_72",Qt="_radioChecked_7kjwa_85",Pt="_radioDisabled_7kjwa_97",es="_radioGroup_7kjwa_102",ts="_switchWrap_7kjwa_109",ss="_switchTrack_7kjwa_120",ns="_switchOn_7kjwa_143",ls="_switchDisabled_7kjwa_153",w={checkbox:Vt,checkboxBox:Ut,checked:Ht,indeterminate:Kt,disabled:Yt,radio:Zt,radioDot:Jt,radioChecked:Qt,radioDisabled:Pt,radioGroup:es,switchWrap:ts,switchTrack:ss,switchOn:ns,switchDisabled:ls},os=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})});function fe({label:n,checked:l,defaultChecked:t,indeterminate:s=!1,disabled:a=!1,onChange:o,className:c,...r}){const i=l??t??!1,h=[w.checkbox,i&&!s?w.checked:null,s?w.indeterminate:null,a?w.disabled:null,c].filter(Boolean).join(" ");return e.jsxs("label",{className:h,children:[e.jsx("input",{...r,type:"checkbox",checked:i,disabled:a,style:{display:"none"},onChange:x=>o==null?void 0:o(x.currentTarget.checked)}),e.jsx("span",{className:w.checkboxBox,children:!s&&e.jsx(os,{})}),n]})}fe.displayName="Checkbox";function je({label:n,checked:l=!1,disabled:t=!1,onChange:s,value:a,className:o,...c}){const r=[w.radio,l?w.radioChecked:null,t?w.radioDisabled:null,o].filter(Boolean).join(" ");return e.jsxs("label",{className:r,children:[e.jsx("input",{...c,type:"radio",checked:l,disabled:t,value:a,style:{display:"none"},onChange:i=>s==null?void 0:s(i.currentTarget.value)}),e.jsx("span",{className:w.radioDot}),n]})}je.displayName="Radio";function pe({children:n,className:l,...t}){const s=[w.radioGroup,l].filter(Boolean).join(" ");return e.jsx("div",{...t,className:s,role:"radiogroup",children:n})}pe.displayName="RadioGroup";function ge({label:n,checked:l,defaultChecked:t,disabled:s=!1,onChange:a,className:o,...c}){const r=l??t??!1,i=[w.switchWrap,r?w.switchOn:null,s?w.switchDisabled:null,o].filter(Boolean).join(" ");return e.jsxs("label",{className:i,children:[e.jsx("input",{...c,type:"checkbox",checked:r,disabled:s,style:{display:"none"},onChange:h=>a==null?void 0:a(h.currentTarget.checked)}),e.jsx("span",{className:w.switchTrack}),n]})}ge.displayName="Switch";const as="_menu_pga52_1",cs="_item_pga52_13",is="_active_pga52_41",rs="_danger_pga52_53",ds="_disabled_pga52_65",_s="_kbd_pga52_71",us="_separator_pga52_79",F={menu:as,item:cs,active:is,danger:rs,disabled:ds,kbd:_s,separator:us};function ve({children:n,className:l,...t}){const s=[F.menu,l].filter(Boolean).join(" ");return e.jsx("div",{...t,className:s,role:"menu",children:n})}ve.displayName="Menu";function ke({icon:n,kbd:l,active:t=!1,danger:s=!1,disabled:a=!1,children:o,className:c,...r}){const i=[F.item,t?F.active:null,s?F.danger:null,a?F.disabled:null,c].filter(Boolean).join(" ");return e.jsxs("button",{...r,type:"button",className:i,disabled:a,role:"menuitem",children:[n,o,l&&e.jsx("span",{className:F.kbd,children:l})]})}ke.displayName="MenuItem";function be({className:n,...l}){const t=[F.separator,n].filter(Boolean).join(" ");return e.jsx("div",{...l,className:t,role:"separator"})}be.displayName="MenuSeparator";const hs="_backdrop_pya14_1",xs="_modal_pya14_23",ms="_header_pya14_37",fs="_titleBlock_pya14_45",js="_title_pya14_45",ps="_subtitle_pya14_58",gs="_closeBtn_pya14_64",vs="_body_pya14_86",ks="_footer_pya14_92",T={backdrop:hs,modal:xs,header:ms,titleBlock:fs,title:js,subtitle:ps,closeBtn:gs,body:vs,footer:ks},bs=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"11",height:"11",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),Ne=u.forwardRef(({open:n,title:l,subtitle:t,children:s,footer:a,closeOnBackdrop:o=!0,showCloseButton:c=!0,backdropProps:r,modalProps:i,headerProps:h,bodyProps:x,footerProps:j,closeButtonProps:g,onOpenChange:f,onClose:k},q)=>{const B=u.useRef(null);u.useImperativeHandle(q,()=>B.current),u.useEffect(()=>{if(!n)return;const y=z=>{z.key==="Escape"&&b()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]);const b=()=>{f==null||f(!1),k==null||k()},$=y=>{o&&y.target===y.currentTarget&&b()};if(!n)return null;const m=[T.backdrop,r==null?void 0:r.className].filter(Boolean).join(" "),N=[T.modal,i==null?void 0:i.className].filter(Boolean).join(" ");return e.jsx("div",{...r,className:m,onClick:$,role:"presentation",children:e.jsxs("div",{ref:B,...i,className:N,role:"dialog","aria-modal":"true",children:[(l||c)&&e.jsxs("header",{...h,className:[T.header,h==null?void 0:h.className].filter(Boolean).join(" "),children:[e.jsxs("div",{className:T.titleBlock,children:[l?e.jsx("div",{className:T.title,children:l}):null,t?e.jsx("div",{className:T.subtitle,children:t}):null]}),c&&e.jsx("button",{type:"button","aria-label":"Close",className:T.closeBtn,onClick:b,...g,children:(g==null?void 0:g.children)??e.jsx(bs,{})})]}),e.jsx("section",{...x,className:[T.body,x==null?void 0:x.className].filter(Boolean).join(" "),children:s}),a&&e.jsx("footer",{...j,className:[T.footer,j==null?void 0:j.className].filter(Boolean).join(" "),children:a})]})})});Ne.displayName="Modal";const Ns="_wrapper_10d4l_1",ys="_pop_10d4l_8",ws="_sideRight_10d4l_22",Bs="_sideTop_10d4l_27",Cs="_arrow_10d4l_34",Is="_head_10d4l_60",$s="_title_10d4l_67",Ms="_closeBtn_10d4l_74",Ss="_body_10d4l_105",D={wrapper:Ns,pop:ys,sideRight:ws,sideTop:Bs,arrow:Cs,head:Is,title:$s,closeBtn:Ms,body:Ss},Ls=()=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]});function ye({open:n,defaultOpen:l=!1,title:t,children:s,trigger:a,side:o="bottom-start",showCloseButton:c=!0,onOpenChange:r,popProps:i}){const[h,x]=u.useState(l),j=n!==void 0,g=j?n:h,f=u.useRef(null);function k($){j||x($),r==null||r($)}u.useEffect(()=>{function $(m){f.current&&!f.current.contains(m.target)&&k(!1)}return g&&document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[g]);const q=o.startsWith("top"),B=o.endsWith("end"),b=[D.pop,B?D.sideRight:null,q?D.sideTop:null,i==null?void 0:i.className].filter(Boolean).join(" ");return e.jsxs("div",{ref:f,className:D.wrapper,children:[a&&e.jsx("div",{onClick:()=>k(!g),style:{display:"inline-flex"},children:a}),g&&e.jsxs("div",{...i,className:b,children:[e.jsx("span",{className:D.arrow}),(t||c)&&e.jsxs("div",{className:D.head,children:[t&&e.jsx("span",{className:D.title,children:t}),c&&e.jsx("button",{type:"button",className:D.closeBtn,"aria-label":"Close",onClick:()=>k(!1),children:e.jsx(Ls,{})})]}),e.jsx("div",{className:D.body,children:s})]})]})}ye.displayName="Popover";const Rs="_group_1ehqf_1",qs="_pb_1ehqf_9",Ts="_on_1ehqf_37",Ds="_accent_1ehqf_42",Os="_solo_1ehqf_47",Es="_disabled_1ehqf_62",V={group:Rs,pb:qs,on:Ts,accent:Ds,solo:Os,disabled:Es};function we({children:n,className:l,...t}){const s=[V.group,l].filter(Boolean).join(" ");return e.jsx("div",{...t,className:s,role:"group",children:n})}we.displayName="PushButtonGroup";function Be({on:n=!1,accent:l=!1,solo:t=!1,icon:s,children:a,disabled:o=!1,className:c,...r}){const i=[V.pb,n?V.on:null,n&&l?V.accent:null,t?V.solo:null,o?V.disabled:null,c].filter(Boolean).join(" ");return e.jsxs("button",{...r,type:"button",className:i,disabled:o,children:[s,a]})}Be.displayName="PushButton";const Ws="_root_156qh_1",As="_field_156qh_6",Fs="_label_156qh_12",zs="_labelMeta_156qh_24",Xs="_trigger_156qh_33",Gs="_triggerOpen_156qh_59",Vs="_triggerConnected_156qh_64",Us="_triggerValue_156qh_69",Hs="_triggerPlaceholder_156qh_78",Ks="_chevron_156qh_80",Ys="_chevronOpen_156qh_89",Zs="_chips_156qh_92",Js="_chip_156qh_92",Qs="_chipOverflow_156qh_115",Ps="_clearBtn_156qh_118",en="_popover_156qh_138",tn="_search_156qh_160",sn="_searchIcon_156qh_167",nn="_searchInput_156qh_174",ln="_list_156qh_188",on="_item_156qh_196",an="_itemActive_156qh_209",cn="_itemDisabled_156qh_217",rn="_itemMeta_156qh_219",dn="_checkbox_156qh_227",_n="_checkboxChecked_156qh_239",un="_checkIcon_156qh_245",hn="_emptyState_156qh_256",xn="_popFooter_156qh_264",mn="_popFooterBtn_156qh_274",_={root:Ws,field:As,label:Fs,labelMeta:zs,trigger:Xs,triggerOpen:Gs,triggerConnected:Vs,triggerValue:Us,triggerPlaceholder:Hs,chevron:Ks,chevronOpen:Ys,chips:Zs,chip:Js,chipOverflow:Qs,clearBtn:Ps,popover:en,search:tn,searchIcon:sn,searchInput:nn,list:ln,item:on,itemActive:an,itemDisabled:cn,itemMeta:rn,checkbox:dn,checkboxChecked:_n,checkIcon:un,emptyState:hn,popFooter:xn,popFooterBtn:mn},fn=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"14",height:"14",children:e.jsx("path",{d:"m6 9 6 6 6-6"})}),ae=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"12",height:"12",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),jn=()=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"7"}),e.jsx("path",{d:"m20 20-3.5-3.5"})]}),ce=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",width:"10",height:"10",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})}),pn=(n,l)=>{const t=l.trim().toLowerCase();return t?n.filter(s=>String(s.label).toLowerCase().includes(t)):n},Ce=u.forwardRef(({label:n,clearable:l=!1,defaultValue:t=null,disabled:s=!1,emptyLabel:a="No options found",filterOptions:o=pn,isLoading:c=!1,loadingLabel:r="Loading...",multiple:i=!1,onSearchChange:h,onValueChange:x,options:j,placeholder:g="Select",searchable:f=!1,searchPlaceholder:k="Search...",value:q,className:B,...b},$)=>{const[m,N]=u.useState(!1),[y,z]=u.useState(""),X=u.useRef(null),[O,U]=Q(q,t,d=>{const I=j.filter(G=>Array.isArray(d)?d.includes(G.value):G.value===d);x==null||x(d,I)}),C=u.useMemo(()=>Array.isArray(O)?O:O?[O]:[],[O]),L=u.useMemo(()=>j.filter(d=>C.includes(d.value)),[j,C]),H=u.useMemo(()=>o(j,y),[o,j,y]);u.useEffect(()=>{if(!m)return;const d=I=>{X.current&&!X.current.contains(I.target)&&N(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[m]);const K=d=>{z(d),h==null||h(d)},P=d=>{if(!d.disabled){if(i){const I=C.includes(d.value)?C.filter(G=>G!==d.value):[...C,d.value];U(I);return}U(d.value),N(!1)}},Y=()=>{U(i?[]:null),K("")},ee=d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),N(I=>!I)),d.key==="Escape"&&N(!1)},Z=[_.trigger,m?_.triggerOpen:null,m?_.triggerConnected:null].filter(Boolean).join(" "),v=i&&L.length>0,E=2,le=L.length-E,Re=[_.root,B].filter(Boolean).join(" "),oe=e.jsxs("div",{ref:X,...b,className:Re,children:[e.jsxs("button",{type:"button",className:Z,disabled:s,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>!s&&N(d=>!d),onKeyDown:ee,children:[v?e.jsxs("div",{className:_.chips,children:[L.slice(0,E).map(d=>e.jsx("span",{className:_.chip,children:d.label},d.value)),le>0&&e.jsxs("span",{className:[_.chip,_.chipOverflow].join(" "),children:["+",le]})]}):e.jsx("span",{className:[_.triggerValue,L.length===0?_.triggerPlaceholder:null].filter(Boolean).join(" "),children:L.length>0?L.map(d=>d.label).join(", "):g}),l&&C.length>0&&e.jsx("button",{type:"button","aria-label":"Clear",className:_.clearBtn,disabled:s,onClick:d=>{d.stopPropagation(),Y()},children:e.jsx(ae,{})}),e.jsx("span",{className:[_.chevron,m?_.chevronOpen:null].filter(Boolean).join(" "),children:e.jsx(fn,{})})]}),m&&e.jsxs("div",{className:_.popover,role:"listbox","aria-multiselectable":i||void 0,children:[f&&e.jsxs("div",{className:_.search,children:[e.jsx("span",{className:_.searchIcon,children:e.jsx(jn,{})}),e.jsx("input",{autoFocus:!0,value:y,placeholder:k,className:_.searchInput,onChange:d=>K(d.target.value)}),y&&e.jsx("button",{className:_.clearBtn,onClick:()=>K(""),children:e.jsx(ae,{})})]}),e.jsxs("ul",{className:_.list,children:[c&&e.jsx("li",{className:_.emptyState,children:r}),!c&&H.length===0&&e.jsx("li",{className:_.emptyState,children:a}),!c&&H.map(d=>{const I=C.includes(d.value),G=[_.item,I?_.itemActive:null,d.disabled?_.itemDisabled:null].filter(Boolean).join(" ");return e.jsxs("li",{className:G,role:"option","aria-selected":I,onClick:()=>P(d),children:[i?e.jsx("span",{className:[_.checkbox,I?_.checkboxChecked:null].filter(Boolean).join(" "),children:I&&e.jsx(ce,{})}):null,e.jsx("span",{children:d.label}),d.meta&&e.jsx("span",{className:_.itemMeta,children:d.meta}),!i&&I&&e.jsx("span",{className:_.checkIcon,children:e.jsx(ce,{})})]},d.value)})]}),i&&C.length>0&&e.jsxs("div",{className:_.popFooter,children:[e.jsxs("span",{children:[C.length," selected"]}),e.jsx("button",{className:_.popFooterBtn,onClick:Y,children:"Clear all"})]})]})]});return n?e.jsxs("div",{className:_.field,children:[e.jsxs("label",{className:_.label,children:[n,i&&C.length>0&&e.jsxs("span",{className:_.labelMeta,children:["· ",C.length," selected"]})]}),oe]}):oe});Ce.displayName="Select";const gn="_ring_mxe7t_2",vn="_spin_mxe7t_1",kn="_ringMuted_mxe7t_12",bn="_sm_mxe7t_14",Nn="_md_mxe7t_15",yn="_lg_mxe7t_16",wn="_onAccent_mxe7t_19",Bn="_dots_mxe7t_29",Cn="_dot_mxe7t_29",In="_dotPulse_mxe7t_1",$n="_bar_mxe7t_52",Mn="_barFill_mxe7t_62",Sn="_barSlide_mxe7t_1",R={ring:gn,spin:vn,ringMuted:kn,sm:bn,md:Nn,lg:yn,onAccent:wn,dots:Bn,dot:Cn,dotPulse:In,bar:$n,barFill:Mn,barSlide:Sn};function Ie({variant:n="ring",size:l="md",muted:t=!1,onAccent:s=!1,className:a,...o}){if(n==="dots"){const r=[R.dots,a].filter(Boolean).join(" ");return e.jsxs("span",{...o,className:r,role:"status","aria-label":"Loading",children:[e.jsx("span",{className:R.dot}),e.jsx("span",{className:R.dot}),e.jsx("span",{className:R.dot})]})}if(n==="bar"){const r=[R.bar,a].filter(Boolean).join(" ");return e.jsx("span",{...o,className:r,role:"status","aria-label":"Loading",children:e.jsx("span",{className:R.barFill})})}const c=[R.ring,R[l],t?R.ringMuted:null,s?R.onAccent:null,a].filter(Boolean).join(" ");return e.jsx("span",{...o,className:c,role:"status","aria-label":"Loading"})}Ie.displayName="Spinner";const Ln="_field_fazrx_1",Rn="_label_fazrx_7",qn="_wrapper_fazrx_16",Tn="_textarea_fazrx_20",Dn="_mono_fazrx_53",On="_hasClear_fazrx_59",En="_clearBtn_fazrx_62",Wn="_footer_fazrx_84",An="_helpText_fazrx_92",Fn="_charCount_fazrx_94",zn="_charCountOver_fazrx_100",S={field:Ln,label:Rn,wrapper:qn,textarea:Tn,mono:Dn,hasClear:On,clearBtn:En,footer:Wn,helpText:An,charCount:Fn,charCountOver:zn},Xn=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"12",height:"12",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),$e=u.forwardRef(({label:n,helpText:l,maxLength:t,clearable:s=!1,mono:a=!1,value:o,defaultValue:c="",disabled:r,onChange:i,onValueChange:h,className:x,...j},g)=>{const[f,k]=Q(o,c,N=>h==null?void 0:h(N)),q=N=>{k(N.target.value),i==null||i(N)},B=()=>{k("")},b=t!==void 0&&f.length>t,$=[S.textarea,"sb",a?S.mono:null,s?S.hasClear:null,x].filter(Boolean).join(" "),m=e.jsxs("div",{className:S.wrapper,children:[e.jsx("textarea",{ref:g,disabled:r,maxLength:t,value:f,onChange:q,className:$,...j}),s&&e.jsx("button",{type:"button",className:S.clearBtn,disabled:r||f.length===0,"aria-label":"Clear",onClick:B,children:e.jsx(Xn,{})})]});return!n&&!l&&t===void 0?m:e.jsxs("div",{className:S.field,children:[n&&e.jsx("label",{className:S.label,children:n}),m,(l||t!==void 0)&&e.jsxs("div",{className:S.footer,children:[l&&e.jsx("span",{className:S.helpText,children:l}),t!==void 0&&e.jsxs("span",{className:[S.charCount,b?S.charCountOver:null].filter(Boolean).join(" "),children:[f.length," / ",t]})]})]})});$e.displayName="Textarea";const Gn="_toast_d6t69_1",Vn="_slideUp_d6t69_1",Un="_toastExiting_d6t69_26",Hn="_slideOut_d6t69_1",Kn="_lead_d6t69_30",Yn="_body_d6t69_37",Zn="_title_d6t69_45",Jn="_message_d6t69_51",Qn="_closeBtn_d6t69_56",Pn="_ok_d6t69_79",el="_error_d6t69_82",tl="_warning_d6t69_85",sl="_info_d6t69_88",nl="_stack_d6t69_92",A={toast:Gn,slideUp:Vn,toastExiting:Un,slideOut:Hn,lead:Kn,body:Yn,title:Zn,message:Jn,closeBtn:Qn,ok:Pn,error:el,warning:tl,info:sl,stack:nl},ll=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})}),Me=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"11",height:"11",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),ol=()=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:[e.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),al=()=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),cl={ok:e.jsx(ll,{}),error:e.jsx(Me,{}),warning:e.jsx(ol,{}),info:e.jsx(al,{})};function ne({variant:n="ok",title:l,message:t,onDismiss:s,className:a,...o}){const c=[A.toast,A[n],a].filter(Boolean).join(" ");return e.jsxs("div",{...o,className:c,role:"alert",children:[e.jsx("span",{className:A.lead,children:cl[n]}),e.jsxs("div",{className:A.body,children:[e.jsx("div",{className:A.title,children:l}),t&&e.jsx("div",{className:A.message,children:t})]}),s&&e.jsx("button",{type:"button",className:A.closeBtn,"aria-label":"Dismiss",onClick:s,children:e.jsx(Me,{})})]})}ne.displayName="Toast";const Se=u.createContext(null);function il({children:n}){const[l,t]=u.useState([]),s=u.useCallback(o=>{t(c=>c.filter(r=>r.id!==o))},[]),a=u.useCallback(o=>{const c=Math.random().toString(36).slice(2),r=o.duration??4e3;return t(i=>[...i,{...o,id:c}]),r>0&&setTimeout(()=>s(c),r),c},[s]);return e.jsxs(Se.Provider,{value:{toast:a,dismiss:s},children:[n,typeof document<"u"&&qe.createPortal(e.jsx("div",{className:A.stack,children:l.map(o=>e.jsx(ne,{variant:o.variant,title:o.title,message:o.message,onDismiss:()=>s(o.id)},o.id))}),document.body)]})}function rl(){const n=u.useContext(Se);if(!n)throw new Error("useToast must be used within a ToastProvider");return n}const dl="_wrapper_18lxw_1",_l="_tooltip_18lxw_6",ul="_fadeIn_18lxw_1",hl="_top_18lxw_33",xl="_bottom_18lxw_52",ml="_kbd_18lxw_72",te={wrapper:dl,tooltip:_l,fadeIn:ul,top:hl,bottom:xl,kbd:ml};function Le({content:n,side:l="top",children:t,wrapperProps:s,disabled:a=!1}){const[o,c]=u.useState(!1);if(a)return e.jsx(e.Fragment,{children:t});const r=[te.tooltip,te[l]].filter(Boolean).join(" "),i=[te.wrapper,s==null?void 0:s.className].filter(Boolean).join(" ");return e.jsxs("span",{...s,className:i,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocus:()=>c(!0),onBlur:()=>c(!1),children:[t,o&&e.jsx("span",{className:r,role:"tooltip",children:n})]})}Le.displayName="Tooltip";exports.Badge=ie;exports.Button=de;exports.Card=_e;exports.CardHeader=ue;exports.CardStat=he;exports.Checkbox=fe;exports.Input=me;exports.Menu=ve;exports.MenuItem=ke;exports.MenuSeparator=be;exports.Modal=Ne;exports.Popover=ye;exports.PushButton=Be;exports.PushButtonGroup=we;exports.Radio=je;exports.RadioGroup=pe;exports.Scrollable=re;exports.Select=Ce;exports.Spinner=Ie;exports.Switch=ge;exports.Textarea=$e;exports.Toast=ne;exports.ToastProvider=il;exports.Tooltip=Le;exports.applyMask=xe;exports.getRawMaskValue=se;exports.useControlledState=Q;exports.useToast=rl;
|
|
2
|
+
//# sourceMappingURL=super-kit.cjs.map
|