@rovula/ui 0.1.7 → 0.1.9
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/cjs/bundle.css +273 -126
- package/dist/cjs/bundle.js +1545 -1545
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/AlertDialog/AlertDialog.stories.d.ts +3 -0
- package/dist/cjs/types/components/Dialog/Dialog.d.ts +7 -1
- package/dist/cjs/types/components/Dialog/Dialog.stories.d.ts +3 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +2 -0
- package/dist/cjs/types/components/Form/Field.d.ts +26 -0
- package/dist/cjs/types/components/Form/FieldMessage.d.ts +7 -0
- package/dist/cjs/types/components/Form/Form.d.ts +49 -11
- package/dist/cjs/types/components/Form/Form.stories.d.ts +23 -0
- package/dist/cjs/types/components/Form/ValidationHintList.d.ts +20 -0
- package/dist/cjs/types/components/Form/ValidationHintList.stories.d.ts +9 -0
- package/dist/cjs/types/components/Form/index.d.ts +10 -0
- package/dist/cjs/types/components/Form/useOptionBridge.d.ts +17 -0
- package/dist/cjs/types/components/OtpInput/OtpInput.d.ts +17 -0
- package/dist/cjs/types/components/OtpInput/OtpInput.stories.d.ts +15 -0
- package/dist/cjs/types/components/OtpInput/OtpInputGroup.d.ts +25 -0
- package/dist/cjs/types/components/OtpInput/index.d.ts +5 -0
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +3 -0
- package/dist/cjs/types/index.d.ts +5 -0
- package/dist/cjs/types/theme/ThemeColorCoverageRuntime.stories.d.ts +10 -0
- package/dist/cjs/types/utils/colors.d.ts +84 -0
- package/dist/components/ActionButton/ActionButton.stories.js +2 -2
- package/dist/components/ActionButton/ActionButton.styles.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +6 -6
- package/dist/components/AlertDialog/AlertDialog.stories.js +3 -0
- package/dist/components/Avatar/Avatar.stories.js +1 -1
- package/dist/components/Avatar/Avatar.styles.js +1 -1
- package/dist/components/Avatar/AvatarBase.js +1 -1
- package/dist/components/Avatar/AvatarGroup.stories.js +1 -1
- package/dist/components/Button/Buttons.stories.js +2 -2
- package/dist/components/Calendar/Calendar.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +17 -7
- package/dist/components/Collapsible/Collapsible.styles.js +1 -1
- package/dist/components/DataTable/DataTable.js +2 -2
- package/dist/components/Dialog/Dialog.js +12 -7
- package/dist/components/Dialog/Dialog.stories.js +90 -2
- package/dist/components/Dropdown/Dropdown.js +2 -2
- package/dist/components/DropdownMenu/DropdownMenu.js +3 -3
- package/dist/components/FocusedScrollView/FocusedScrollView.stories.js +6 -6
- package/dist/components/Form/Field.js +60 -0
- package/dist/components/Form/FieldMessage.js +24 -0
- package/dist/components/Form/Form.js +73 -41
- package/dist/components/Form/Form.stories.js +221 -0
- package/dist/components/Form/ValidationHintList.js +30 -0
- package/dist/components/Form/ValidationHintList.stories.js +50 -0
- package/dist/components/Form/index.js +5 -0
- package/dist/components/Form/useOptionBridge.js +27 -0
- package/dist/components/InputFilter/InputFilter.js +5 -4
- package/dist/components/InputFilter/InputFilter.stories.js +1 -1
- package/dist/components/InputFilter/InputFilter.styles.js +14 -1
- package/dist/components/Label/Label.styles.js +1 -1
- package/dist/components/Menu/Menu.js +2 -2
- package/dist/components/NumberInput/NumberInput.stories.js +1 -1
- package/dist/components/OtpInput/OtpInput.js +118 -0
- package/dist/components/OtpInput/OtpInput.stories.js +60 -0
- package/dist/components/OtpInput/OtpInputGroup.js +23 -0
- package/dist/components/OtpInput/index.js +3 -0
- package/dist/components/PasswordInput/PasswordInput.stories.js +1 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +2 -2
- package/dist/components/Search/Search.js +13 -1
- package/dist/components/Search/Search.stories.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider.stories.js +5 -5
- package/dist/components/Switch/Switch.stories.js +2 -2
- package/dist/components/Table/Table.js +5 -5
- package/dist/components/Tabs/Tabs.js +12 -9
- package/dist/components/Tabs/Tabs.stories.js +1 -1
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/Text/Text.stories.js +1 -1
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.styles.js +3 -3
- package/dist/components/TextInput/TextInput.js +3 -2
- package/dist/components/TextInput/TextInput.stories.js +3 -3
- package/dist/components/TextInput/TextInput.styles.js +41 -19
- package/dist/components/Toast/Toast.js +4 -2
- package/dist/components/Toast/Toast.stories.js +1 -1
- package/dist/components/Toast/Toast.styles.js +4 -4
- package/dist/components/Toast/Toaster.js +2 -2
- package/dist/components/Tree/Tree.stories.js +1 -1
- package/dist/components/Tree/TreeItem.js +1 -1
- package/dist/esm/bundle.css +273 -126
- package/dist/esm/bundle.js +1545 -1545
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/AlertDialog/AlertDialog.stories.d.ts +3 -0
- package/dist/esm/types/components/Dialog/Dialog.d.ts +7 -1
- package/dist/esm/types/components/Dialog/Dialog.stories.d.ts +3 -0
- package/dist/esm/types/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +2 -0
- package/dist/esm/types/components/Form/Field.d.ts +26 -0
- package/dist/esm/types/components/Form/FieldMessage.d.ts +7 -0
- package/dist/esm/types/components/Form/Form.d.ts +49 -11
- package/dist/esm/types/components/Form/Form.stories.d.ts +23 -0
- package/dist/esm/types/components/Form/ValidationHintList.d.ts +20 -0
- package/dist/esm/types/components/Form/ValidationHintList.stories.d.ts +9 -0
- package/dist/esm/types/components/Form/index.d.ts +10 -0
- package/dist/esm/types/components/Form/useOptionBridge.d.ts +17 -0
- package/dist/esm/types/components/OtpInput/OtpInput.d.ts +17 -0
- package/dist/esm/types/components/OtpInput/OtpInput.stories.d.ts +15 -0
- package/dist/esm/types/components/OtpInput/OtpInputGroup.d.ts +25 -0
- package/dist/esm/types/components/OtpInput/index.d.ts +5 -0
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +3 -0
- package/dist/esm/types/index.d.ts +5 -0
- package/dist/esm/types/theme/ThemeColorCoverageRuntime.stories.d.ts +10 -0
- package/dist/esm/types/utils/colors.d.ts +84 -0
- package/dist/index.d.ts +248 -2
- package/dist/index.js +3 -0
- package/dist/src/theme/global.css +340 -151
- package/dist/theme/ThemeColorCoverageRuntime.stories.js +91 -0
- package/dist/utils/colors.js +92 -0
- package/package.json +4 -2
- package/src/components/ActionButton/ActionButton.stories.tsx +6 -6
- package/src/components/ActionButton/ActionButton.styles.ts +1 -1
- package/src/components/AlertDialog/AlertDialog.stories.tsx +22 -0
- package/src/components/AlertDialog/AlertDialog.tsx +6 -6
- package/src/components/Avatar/Avatar.stories.tsx +1 -1
- package/src/components/Avatar/Avatar.styles.ts +1 -1
- package/src/components/Avatar/AvatarBase.tsx +1 -1
- package/src/components/Avatar/AvatarGroup.stories.tsx +1 -1
- package/src/components/Button/Buttons.stories.tsx +10 -10
- package/src/components/Calendar/Calendar.tsx +3 -3
- package/src/components/Checkbox/Checkbox.stories.tsx +35 -12
- package/src/components/Checkbox/Checkbox.tsx +7 -5
- package/src/components/Collapsible/Collapsible.styles.ts +1 -1
- package/src/components/DataTable/DataTable.tsx +2 -2
- package/src/components/Dialog/Dialog.stories.tsx +173 -0
- package/src/components/Dialog/Dialog.tsx +32 -15
- package/src/components/Dropdown/Dropdown.styles.ts +1 -1
- package/src/components/Dropdown/Dropdown.tsx +16 -14
- package/src/components/DropdownMenu/DropdownMenu.tsx +3 -3
- package/src/components/FocusedScrollView/FocusedScrollView.stories.tsx +10 -10
- package/src/components/Form/Field.tsx +160 -0
- package/src/components/Form/FieldMessage.tsx +38 -0
- package/src/components/Form/Form.docs.mdx +67 -0
- package/src/components/Form/Form.stories.tsx +490 -0
- package/src/components/Form/Form.tsx +185 -87
- package/src/components/Form/README.md +284 -0
- package/src/components/Form/ValidationHintList.stories.tsx +118 -0
- package/src/components/Form/ValidationHintList.tsx +95 -0
- package/src/components/Form/index.ts +28 -0
- package/src/components/Form/useOptionBridge.ts +55 -0
- package/src/components/InputFilter/InputFilter.stories.tsx +1 -1
- package/src/components/InputFilter/InputFilter.styles.ts +14 -1
- package/src/components/InputFilter/InputFilter.tsx +33 -28
- package/src/components/Label/Label.styles.ts +2 -2
- package/src/components/Label/Label.tsx +1 -1
- package/src/components/Menu/Menu.tsx +12 -12
- package/src/components/NumberInput/NumberInput.stories.tsx +1 -1
- package/src/components/OtpInput/OtpInput.stories.tsx +168 -0
- package/src/components/OtpInput/OtpInput.tsx +223 -0
- package/src/components/OtpInput/OtpInputGroup.tsx +74 -0
- package/src/components/OtpInput/index.ts +5 -0
- package/src/components/PasswordInput/PasswordInput.stories.tsx +1 -1
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/RadioGroup/RadioGroup.stories.tsx +4 -4
- package/src/components/RadioGroup/RadioGroup.tsx +2 -1
- package/src/components/Search/Search.stories.tsx +1 -1
- package/src/components/Search/Search.tsx +6 -2
- package/src/components/Slider/Slider.stories.tsx +7 -7
- package/src/components/Slider/Slider.tsx +1 -1
- package/src/components/Switch/Switch.stories.tsx +4 -4
- package/src/components/Table/Table.tsx +5 -5
- package/src/components/Tabs/Tabs.stories.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +29 -18
- package/src/components/Text/Text.stories.tsx +1 -1
- package/src/components/Text/Text.tsx +1 -1
- package/src/components/TextArea/TextArea.stories.tsx +1 -1
- package/src/components/TextArea/TextArea.styles.ts +3 -3
- package/src/components/TextInput/TextInput.stories.tsx +7 -7
- package/src/components/TextInput/TextInput.styles.ts +42 -19
- package/src/components/TextInput/TextInput.tsx +3 -1
- package/src/components/Toast/Toast.stories.tsx +1 -1
- package/src/components/Toast/Toast.styles.tsx +7 -7
- package/src/components/Toast/Toast.tsx +5 -4
- package/src/components/Toast/Toaster.tsx +17 -20
- package/src/components/Tree/Tree.stories.tsx +1 -1
- package/src/components/Tree/TreeItem.tsx +1 -1
- package/src/index.ts +5 -0
- package/src/theme/ThemeColorCoverageRuntime.stories.tsx +236 -0
- package/src/theme/direct-token-migration-plan.md +121 -0
- package/src/theme/figma-mcp-check-report.md +225 -0
- package/src/theme/figma-mcp-component-checklist.json +1250 -0
- package/src/theme/presets/colors.js +155 -44
- package/src/theme/themes/xspector/components/loading.css +2 -2
- package/src/theme/tokens/color.css +3 -3
- package/src/theme/tokens/components/action-button.css +1 -1
- package/src/theme/tokens/components/dropdown-menu.css +3 -3
- package/src/theme/tokens/components/loading.css +2 -2
- package/src/theme/tokens/components/switch.css +1 -1
- package/src/theme/utils.js +164 -25
- package/src/utils/colors.ts +92 -0
|
@@ -13,10 +13,16 @@ declare const DialogHeader: {
|
|
|
13
13
|
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
|
16
|
+
declare const DialogBody: {
|
|
17
|
+
({ className, scrollable, ...props }: React.HTMLAttributes<HTMLDivElement> & {
|
|
18
|
+
scrollable?: boolean;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
16
22
|
declare const DialogFooter: {
|
|
17
23
|
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
18
24
|
displayName: string;
|
|
19
25
|
};
|
|
20
26
|
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
21
27
|
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
22
|
-
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
28
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogBody, DialogFooter, DialogTitle, DialogDescription, };
|
|
@@ -31,6 +31,7 @@ export type DropdownProps = {
|
|
|
31
31
|
optionContainerClassName?: string;
|
|
32
32
|
optionItemClassName?: string;
|
|
33
33
|
optionNotFoundItemClassName?: string;
|
|
34
|
+
segmentedInput?: boolean;
|
|
34
35
|
options: Options[];
|
|
35
36
|
value?: Options;
|
|
36
37
|
onChangeText?: InputProps["onChange"];
|
|
@@ -62,6 +63,7 @@ declare const Dropdown: React.ForwardRefExoticComponent<{
|
|
|
62
63
|
optionContainerClassName?: string;
|
|
63
64
|
optionItemClassName?: string;
|
|
64
65
|
optionNotFoundItemClassName?: string;
|
|
66
|
+
segmentedInput?: boolean;
|
|
65
67
|
options: Options[];
|
|
66
68
|
value?: Options;
|
|
67
69
|
onChangeText?: InputProps["onChange"];
|
|
@@ -22,6 +22,7 @@ declare const meta: {
|
|
|
22
22
|
optionContainerClassName?: string;
|
|
23
23
|
optionItemClassName?: string;
|
|
24
24
|
optionNotFoundItemClassName?: string;
|
|
25
|
+
segmentedInput?: boolean;
|
|
25
26
|
options: Options[];
|
|
26
27
|
value?: Options;
|
|
27
28
|
onChangeText?: import("../..").InputProps["onChange"];
|
|
@@ -57,6 +58,7 @@ declare const meta: {
|
|
|
57
58
|
optionContainerClassName?: string | undefined;
|
|
58
59
|
optionItemClassName?: string | undefined;
|
|
59
60
|
optionNotFoundItemClassName?: string | undefined;
|
|
61
|
+
segmentedInput?: boolean | undefined;
|
|
60
62
|
options: Options[];
|
|
61
63
|
value?: Options | undefined;
|
|
62
64
|
onChangeText?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
|
+
import { FieldPath, FieldPathValue, FieldValues, RegisterOptions } from "react-hook-form";
|
|
3
|
+
type ControlledComponentProps = object;
|
|
4
|
+
export type FieldProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>, TComponentProps extends ControlledComponentProps = ControlledComponentProps> = {
|
|
5
|
+
name: TName;
|
|
6
|
+
component: ComponentType<TComponentProps>;
|
|
7
|
+
componentProps?: Omit<TComponentProps, "name" | "value" | "onChange" | "onBlur" | "ref" | "aria-invalid">;
|
|
8
|
+
rules?: Omit<RegisterOptions<TFieldValues, TName>, "disabled" | "setValueAs" | "valueAsDate" | "valueAsNumber">;
|
|
9
|
+
defaultValue?: FieldPathValue<TFieldValues, TName>;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
shouldUnregister?: boolean;
|
|
12
|
+
id?: string;
|
|
13
|
+
describedBy?: string;
|
|
14
|
+
valuePropName?: string;
|
|
15
|
+
changePropName?: string;
|
|
16
|
+
blurPropName?: string | false;
|
|
17
|
+
refPropName?: string | false;
|
|
18
|
+
errorMessagePropName?: string | false;
|
|
19
|
+
invalidPropName?: string | false;
|
|
20
|
+
parseValue?: (incomingValue: unknown, rawPayload: unknown) => FieldPathValue<TFieldValues, TName>;
|
|
21
|
+
formatValue?: (value: FieldPathValue<TFieldValues, TName>) => TComponentProps[keyof TComponentProps];
|
|
22
|
+
onChange?: (value: FieldPathValue<TFieldValues, TName>, rawPayload: unknown) => void;
|
|
23
|
+
onBlur?: () => void;
|
|
24
|
+
};
|
|
25
|
+
export declare const Field: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>, TComponentProps extends ControlledComponentProps = object>({ name, component: Component, componentProps, rules, defaultValue, disabled, shouldUnregister, id, describedBy, valuePropName, changePropName, blurPropName, refPropName, errorMessagePropName, invalidPropName, parseValue, formatValue, onChange, onBlur, }: FieldProps<TFieldValues, TName, TComponentProps>) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export default Field;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { FieldPath, FieldValues } from "react-hook-form";
|
|
3
|
+
export type FieldMessageProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>> = HTMLAttributes<HTMLParagraphElement> & {
|
|
4
|
+
name: TName;
|
|
5
|
+
};
|
|
6
|
+
export declare const FieldMessage: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>({ name, className, ...props }: FieldMessageProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export default FieldMessage;
|
|
@@ -1,12 +1,50 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import React, { FormHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import { DefaultValues, FieldValues, Mode, Resolver, SubmitErrorHandler, SubmitHandler, UseFormReturn } from "react-hook-form";
|
|
3
|
+
import * as yup from "yup";
|
|
4
|
+
type FormChildren<TFieldValues extends FieldValues> = ReactNode | ((methods: UseFormReturn<TFieldValues>) => ReactNode);
|
|
5
|
+
export type FormController<TFieldValues extends FieldValues> = {
|
|
6
|
+
submit: () => Promise<void>;
|
|
7
|
+
getValues: () => TFieldValues;
|
|
8
|
+
setValue: UseFormReturn<TFieldValues>["setValue"];
|
|
9
|
+
trigger: UseFormReturn<TFieldValues>["trigger"];
|
|
10
|
+
reset: UseFormReturn<TFieldValues>["reset"];
|
|
11
|
+
};
|
|
12
|
+
export type FormProps<TFieldValues extends FieldValues> = Omit<FormHTMLAttributes<HTMLFormElement>, "children" | "onSubmit"> & {
|
|
13
|
+
children: FormChildren<TFieldValues>;
|
|
14
|
+
defaultValues: DefaultValues<TFieldValues>;
|
|
15
|
+
methods?: UseFormReturn<TFieldValues>;
|
|
16
|
+
controllerRef?: React.MutableRefObject<FormController<TFieldValues> | null>;
|
|
17
|
+
onSubmit: SubmitHandler<TFieldValues>;
|
|
18
|
+
onInvalidSubmit?: SubmitErrorHandler<TFieldValues>;
|
|
19
|
+
resolver?: Resolver<TFieldValues>;
|
|
20
|
+
validationSchema?: yup.ObjectSchema<any>;
|
|
21
|
+
mode?: Mode;
|
|
22
|
+
reValidateMode?: Exclude<Mode, "onTouched" | "all">;
|
|
23
|
+
};
|
|
24
|
+
export declare const createYupResolver: <TFieldValues extends FieldValues>(schema: yup.ObjectSchema<any>) => Resolver<TFieldValues>;
|
|
25
|
+
export type ControlledFormFactoryOptions<TFieldValues extends FieldValues> = {
|
|
26
|
+
methods: UseFormReturn<TFieldValues>;
|
|
27
|
+
defaultValues: DefaultValues<TFieldValues>;
|
|
28
|
+
controllerRef?: React.MutableRefObject<FormController<TFieldValues> | null>;
|
|
29
|
+
};
|
|
30
|
+
export type UseControlledFormOptions<TFieldValues extends FieldValues> = {
|
|
31
|
+
defaultValues: DefaultValues<TFieldValues>;
|
|
32
|
+
controllerRef?: React.MutableRefObject<FormController<TFieldValues> | null>;
|
|
33
|
+
resolver?: Resolver<TFieldValues>;
|
|
34
|
+
validationSchema?: yup.ObjectSchema<any>;
|
|
35
|
+
mode?: Mode;
|
|
36
|
+
reValidateMode?: Exclude<Mode, "onTouched" | "all">;
|
|
37
|
+
};
|
|
38
|
+
export declare const createControlledForm: <TFieldValues extends FieldValues>({ methods, defaultValues, controllerRef, }: ControlledFormFactoryOptions<TFieldValues>) => {
|
|
39
|
+
methods: UseFormReturn<TFieldValues>;
|
|
40
|
+
FormRoot: React.ForwardRefExoticComponent<Omit<FormProps<TFieldValues>, "methods" | "defaultValues" | "controllerRef"> & React.RefAttributes<FormController<TFieldValues>>>;
|
|
41
|
+
};
|
|
42
|
+
export declare const useControlledForm: <TFieldValues extends FieldValues>({ defaultValues, controllerRef, resolver, validationSchema, mode, reValidateMode, }: UseControlledFormOptions<TFieldValues>) => {
|
|
43
|
+
methods: UseFormReturn<TFieldValues>;
|
|
44
|
+
FormRoot: React.ForwardRefExoticComponent<Omit<FormProps<TFieldValues>, "methods" | "defaultValues" | "controllerRef"> & React.RefAttributes<FormController<TFieldValues>>>;
|
|
45
|
+
};
|
|
46
|
+
type FormComponent = <TFieldValues extends FieldValues>(props: FormProps<TFieldValues> & {
|
|
47
|
+
ref?: React.Ref<FormController<TFieldValues>>;
|
|
48
|
+
}) => React.ReactElement;
|
|
49
|
+
export declare const Form: FormComponent;
|
|
12
50
|
export default Form;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Meta } from "@storybook/react";
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
export declare const BasicYupLogin: {
|
|
5
|
+
args: {};
|
|
6
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
export declare const MixedUiKitControls: {
|
|
9
|
+
args: {};
|
|
10
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
};
|
|
12
|
+
export declare const ResolverBasedValidation: {
|
|
13
|
+
args: {};
|
|
14
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
};
|
|
16
|
+
export declare const RenderPropsCodeControl: {
|
|
17
|
+
args: {};
|
|
18
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
};
|
|
20
|
+
export declare const HigherLayerCodeControl: {
|
|
21
|
+
args: {};
|
|
22
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ValidationHintState = "pending" | "valid" | "invalid";
|
|
2
|
+
export type ValidationHintMode = ValidationHintState[];
|
|
3
|
+
export type ValidationHintRule<TValues> = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
validate: (values: TValues) => boolean;
|
|
7
|
+
when?: (values: TValues) => boolean;
|
|
8
|
+
};
|
|
9
|
+
export type ValidationHintStateClassMap = Partial<Record<ValidationHintState, string>>;
|
|
10
|
+
export type ValidationHintListProps<TValues> = {
|
|
11
|
+
values: TValues;
|
|
12
|
+
rules: ValidationHintRule<TValues>[];
|
|
13
|
+
mode?: ValidationHintMode;
|
|
14
|
+
className?: string;
|
|
15
|
+
itemClassName?: string;
|
|
16
|
+
labelStateClassName?: ValidationHintStateClassMap;
|
|
17
|
+
iconStateClassName?: ValidationHintStateClassMap;
|
|
18
|
+
};
|
|
19
|
+
export declare const ValidationHintList: <TValues>({ values, rules, mode, className, itemClassName, labelStateClassName, iconStateClassName, }: ValidationHintListProps<TValues>) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export default ValidationHintList;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta } from "@storybook/react";
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
export declare const ThreeState: {
|
|
5
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export declare const TwoState: {
|
|
8
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { Form, createControlledForm, createYupResolver, useControlledForm, } from "./Form";
|
|
2
|
+
export type { ControlledFormFactoryOptions, FormController, FormProps, UseControlledFormOptions, } from "./Form";
|
|
3
|
+
export { Field } from "./Field";
|
|
4
|
+
export type { FieldProps } from "./Field";
|
|
5
|
+
export { FieldMessage } from "./FieldMessage";
|
|
6
|
+
export type { FieldMessageProps } from "./FieldMessage";
|
|
7
|
+
export { ValidationHintList } from "./ValidationHintList";
|
|
8
|
+
export type { ValidationHintListProps, ValidationHintMode, ValidationHintRule, ValidationHintState, } from "./ValidationHintList";
|
|
9
|
+
export { useOptionBridge } from "./useOptionBridge";
|
|
10
|
+
export type { OptionLike, UseOptionBridgeOptions, } from "./useOptionBridge";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type OptionValue = string | number;
|
|
2
|
+
export type OptionLike<TValue extends OptionValue = string> = {
|
|
3
|
+
value: TValue;
|
|
4
|
+
label?: string;
|
|
5
|
+
};
|
|
6
|
+
export type UseOptionBridgeOptions<TValue extends OptionValue, TOption extends OptionLike<TValue>> = {
|
|
7
|
+
options: TOption[];
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
buildFallbackOption?: (value: TValue, loading: boolean) => TOption;
|
|
10
|
+
};
|
|
11
|
+
export declare const useOptionBridge: <TValue extends OptionValue = string, TOption extends OptionLike<TValue> = OptionLike<TValue>>({ options, loading, buildFallbackOption, }: UseOptionBridgeOptions<TValue, TOption>) => {
|
|
12
|
+
toOption: (value: TValue | null | undefined) => TOption | undefined;
|
|
13
|
+
toOptionWithFallback: (value: TValue | null | undefined) => TOption | undefined;
|
|
14
|
+
toValue: (option: TOption | null | undefined) => TValue | undefined;
|
|
15
|
+
optionsByValue: Map<TValue, TOption>;
|
|
16
|
+
};
|
|
17
|
+
export default useOptionBridge;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type OtpInputProps = {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
onBlur?: () => void;
|
|
6
|
+
onComplete?: (value: string) => void;
|
|
7
|
+
length?: number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
invalid?: boolean;
|
|
10
|
+
autoFocus?: boolean;
|
|
11
|
+
inputMode?: React.HTMLAttributes<HTMLInputElement>["inputMode"];
|
|
12
|
+
charPattern?: RegExp;
|
|
13
|
+
className?: string;
|
|
14
|
+
inputClassName?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const OtpInput: React.ForwardRefExoticComponent<OtpInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
17
|
+
export default OtpInput;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Meta } from "@storybook/react";
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
export declare const Basic: {
|
|
5
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
export declare const WithFormField: {
|
|
8
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
export declare const GroupWithLabelAndError: {
|
|
11
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
};
|
|
13
|
+
export declare const GroupWithFormField: {
|
|
14
|
+
render: () => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { OtpInputProps } from "./OtpInput";
|
|
3
|
+
export type OtpInputGroupProps = OtpInputProps & {
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
helperText?: string;
|
|
8
|
+
error?: boolean;
|
|
9
|
+
errorMessage?: string;
|
|
10
|
+
keepFooterSpace?: boolean;
|
|
11
|
+
labelClassName?: string;
|
|
12
|
+
messageClassName?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const OtpInputGroup: React.ForwardRefExoticComponent<OtpInputProps & {
|
|
15
|
+
id?: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
helperText?: string;
|
|
19
|
+
error?: boolean;
|
|
20
|
+
errorMessage?: string;
|
|
21
|
+
keepFooterSpace?: boolean;
|
|
22
|
+
labelClassName?: string;
|
|
23
|
+
messageClassName?: string;
|
|
24
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
25
|
+
export default OtpInputGroup;
|
|
@@ -34,6 +34,9 @@ export declare const inlineStartIconWrapperVariant: (props?: ({
|
|
|
34
34
|
export declare const iconActionVariant: (props?: ({
|
|
35
35
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
36
36
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
37
|
+
export declare const searchIconVariant: (props?: ({
|
|
38
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
39
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
37
40
|
export declare const segmentedIconWrapperVariant: (props?: ({
|
|
38
41
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
39
42
|
rounded?: "none" | "normal" | "full" | null | undefined;
|
|
@@ -19,6 +19,8 @@ export { Avatar, AvatarGroup } from "./components/Avatar";
|
|
|
19
19
|
export { Collapsible } from "./components/Collapsible";
|
|
20
20
|
export { Calendar } from "./components/Calendar";
|
|
21
21
|
export { default as DatePicker } from "./components/DatePicker/DatePicker";
|
|
22
|
+
export { default as OtpInput } from "./components/OtpInput";
|
|
23
|
+
export { OtpInputGroup } from "./components/OtpInput";
|
|
22
24
|
export { Popover, PopoverTrigger, PopoverContent, } from "./components/Popover/Popover";
|
|
23
25
|
export { default as Loading } from "./components/Loading/Loading";
|
|
24
26
|
export { default as ProgressBar } from "./components/ProgressBar/ProgressBar";
|
|
@@ -41,12 +43,15 @@ export * from "./components/Toast/useToast";
|
|
|
41
43
|
export * from "./components/Tree";
|
|
42
44
|
export * from "./components/FocusedScrollView/FocusedScrollView";
|
|
43
45
|
export * from "./components/RadioGroup/RadioGroup";
|
|
46
|
+
export * from "./components/Form";
|
|
44
47
|
export type { ButtonProps } from "./components/Button/Button";
|
|
45
48
|
export type { InputProps } from "./components/TextInput/TextInput";
|
|
46
49
|
export type { PasswordInputProps } from "./components/PasswordInput/PasswordInput";
|
|
47
50
|
export type { MaskedTextInputProps, MaskRule, } from "./components/MaskedTextInput";
|
|
48
51
|
export type { NumberInputProps } from "./components/NumberInput/NumberInput";
|
|
49
52
|
export type { TextAreaProps } from "./components/TextArea/TextArea";
|
|
53
|
+
export type { OtpInputProps } from "./components/OtpInput";
|
|
54
|
+
export type { OtpInputGroupProps } from "./components/OtpInput";
|
|
50
55
|
export type { DropdownProps, Options } from "./components/Dropdown/Dropdown";
|
|
51
56
|
export type { NavbarProps, NavbarVariant } from "./components/Navbar/Navbar";
|
|
52
57
|
export type { FooterProps, FooterVariant } from "./components/Footer/Footer";
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/** CSS variable names for theme colors (resolved by data-theme) */
|
|
2
2
|
export declare const THEME_COLOR_KEYS: {
|
|
3
|
+
readonly "main-primary": "--main-primary";
|
|
4
|
+
readonly "main-secondary": "--main-secondary";
|
|
5
|
+
readonly "main-tertiary": "--main-tertiary";
|
|
6
|
+
readonly "brand-midnight-blue": "--brand-midnight-blue";
|
|
7
|
+
readonly "brand-columbia-blue": "--brand-columbia-blue";
|
|
8
|
+
readonly "brand-background": "--brand-background";
|
|
9
|
+
readonly "brand-lemon-glacier": "--brand-lemon-glacier";
|
|
3
10
|
readonly "primary-5": "--ramps-primary-5";
|
|
4
11
|
readonly "primary-10": "--ramps-primary-10";
|
|
5
12
|
readonly "primary-20": "--ramps-primary-20";
|
|
@@ -192,6 +199,13 @@ export declare const THEME_COLOR_KEYS: {
|
|
|
192
199
|
readonly "disable-solid": "--state-disable-solid";
|
|
193
200
|
readonly "disable-outline": "--state-disable-outline";
|
|
194
201
|
readonly "text-black": "--text-black";
|
|
202
|
+
readonly "text-contrast-low": "--text-contrast-low";
|
|
203
|
+
readonly "text-contrast-medium": "--text-contrast-medium";
|
|
204
|
+
readonly "text-contrast-high": "--text-contrast-high";
|
|
205
|
+
readonly "text-contrast-max": "--text-contrast-max";
|
|
206
|
+
readonly "text-g-contrast-low": "--text-g-contrast-low";
|
|
207
|
+
readonly "text-g-contrast-medium": "--text-g-contrast-medium";
|
|
208
|
+
readonly "text-g-contrast-high": "--text-g-contrast-high";
|
|
195
209
|
readonly "text-dark": "--text-dark";
|
|
196
210
|
readonly "text-medium": "--text-medium";
|
|
197
211
|
readonly "text-light": "--text-light";
|
|
@@ -219,6 +233,28 @@ export declare const THEME_COLOR_KEYS: {
|
|
|
219
233
|
readonly "function-active-hover-bg": "--function-active-hover-bg";
|
|
220
234
|
readonly "function-active-stroke": "--function-active-stroke";
|
|
221
235
|
readonly "function-active-icon": "--function-active-icon";
|
|
236
|
+
readonly "modal-surface": "--modal-surface";
|
|
237
|
+
readonly "modal-highlight": "--modal-highlight";
|
|
238
|
+
readonly "modal-overlay": "--modal-overlay";
|
|
239
|
+
readonly "bg-bg1": "--bg-bg1";
|
|
240
|
+
readonly "bg-bg2": "--bg-bg2";
|
|
241
|
+
readonly "bg-bg3": "--bg-bg3";
|
|
242
|
+
readonly "bg-stroke1": "--bg-stroke1";
|
|
243
|
+
readonly "bg-stroke2": "--bg-stroke2";
|
|
244
|
+
readonly "state-primary-text-solid": "--state-primary-text-solid";
|
|
245
|
+
readonly "state-primary-text-hover": "--state-primary-text-hover";
|
|
246
|
+
readonly "state-secondary-text-solid": "--state-secondary-text-solid";
|
|
247
|
+
readonly "state-secondary-text-hover": "--state-secondary-text-hover";
|
|
248
|
+
readonly "state-tertiary-text-solid": "--state-tertiary-text-solid";
|
|
249
|
+
readonly "state-tertiary-text-hover": "--state-tertiary-text-hover";
|
|
250
|
+
readonly "state-info-text-solid": "--state-info-text-solid";
|
|
251
|
+
readonly "state-info-text-hover": "--state-info-text-hover";
|
|
252
|
+
readonly "state-success-text-solid": "--state-success-text-solid";
|
|
253
|
+
readonly "state-success-text-hover": "--state-success-text-hover";
|
|
254
|
+
readonly "state-warning-text-solid": "--state-warning-text-solid";
|
|
255
|
+
readonly "state-warning-text-hover": "--state-warning-text-hover";
|
|
256
|
+
readonly "state-error-text-solid": "--state-error-text-solid";
|
|
257
|
+
readonly "state-error-text-hover": "--state-error-text-hover";
|
|
222
258
|
readonly "base-bg": "--base-color-bg";
|
|
223
259
|
readonly "base-bg2": "--base-color-bg2";
|
|
224
260
|
readonly "base-bg3": "--base-color-bg3";
|
|
@@ -230,6 +266,54 @@ export declare const THEME_COLOR_KEYS: {
|
|
|
230
266
|
readonly "base-popup-foreground": "--base-color-popup-foreground";
|
|
231
267
|
readonly "common-white": "--common-white";
|
|
232
268
|
readonly "common-black": "--common-black";
|
|
269
|
+
readonly "brand-rvl-yellow": "--brand-rvl-yellow";
|
|
270
|
+
readonly "brand-rvl-grey": "--brand-rvl-grey";
|
|
271
|
+
readonly "others-1": "--others-1";
|
|
272
|
+
readonly "others-2": "--others-2";
|
|
273
|
+
readonly "others-3": "--others-3";
|
|
274
|
+
readonly "others-4": "--others-4";
|
|
275
|
+
readonly "others-5": "--others-5";
|
|
276
|
+
readonly "others-6": "--others-6";
|
|
277
|
+
readonly "others-7": "--others-7";
|
|
278
|
+
readonly "others-8": "--others-8";
|
|
279
|
+
readonly "others-9": "--others-9";
|
|
280
|
+
readonly "others-10": "--others-10";
|
|
281
|
+
readonly "others-11": "--others-11";
|
|
282
|
+
readonly "others-12": "--others-12";
|
|
283
|
+
readonly "others-13": "--others-13";
|
|
284
|
+
readonly "others-14": "--others-14";
|
|
285
|
+
readonly "others-15": "--others-15";
|
|
286
|
+
readonly "others-16": "--others-16";
|
|
287
|
+
readonly "others-17": "--others-17";
|
|
288
|
+
readonly "others-18": "--others-18";
|
|
289
|
+
readonly "others-19": "--others-19";
|
|
290
|
+
readonly "others-20": "--others-20";
|
|
291
|
+
readonly "others-21": "--others-21";
|
|
292
|
+
readonly "others-22": "--others-22";
|
|
293
|
+
readonly "others-23": "--others-23";
|
|
294
|
+
readonly "others-24": "--others-24";
|
|
295
|
+
readonly "others-25": "--others-25";
|
|
296
|
+
readonly "others-26": "--others-26";
|
|
297
|
+
readonly "others-27": "--others-27";
|
|
298
|
+
readonly "others-28": "--others-28";
|
|
299
|
+
readonly "others-29": "--others-29";
|
|
300
|
+
readonly "others-30": "--others-30";
|
|
301
|
+
readonly "others-31": "--others-31";
|
|
302
|
+
readonly "others-32": "--others-32";
|
|
303
|
+
readonly "others-33": "--others-33";
|
|
304
|
+
readonly "others-34": "--others-34";
|
|
305
|
+
readonly "others-35": "--others-35";
|
|
306
|
+
readonly "page-bg-main": "--page-bg-main";
|
|
307
|
+
readonly "page-bg-circle-top-g-in": "--page-bg-circle-top-g-in";
|
|
308
|
+
readonly "page-bg-circle-top-g-out": "--page-bg-circle-top-g-out";
|
|
309
|
+
readonly "page-bg-circle-bottom-g-in": "--page-bg-circle-bottom-g-in";
|
|
310
|
+
readonly "page-bg-circle-bottom-g-out": "--page-bg-circle-bottom-g-out";
|
|
311
|
+
readonly "modal-line": "--modal-line";
|
|
312
|
+
readonly "bg-bg4": "--bg-bg4";
|
|
313
|
+
readonly "bg-bg5": "--bg-bg5";
|
|
314
|
+
readonly "bg-stroke3": "--bg-stroke3";
|
|
315
|
+
readonly "bg-stroke4": "--bg-stroke4";
|
|
316
|
+
readonly "bg-stroke5": "--bg-stroke5";
|
|
233
317
|
readonly background: "--background";
|
|
234
318
|
readonly foreground: "--foreground";
|
|
235
319
|
readonly surface: "--surface";
|
|
@@ -16,7 +16,7 @@ const meta = {
|
|
|
16
16
|
layout: "fullscreen",
|
|
17
17
|
},
|
|
18
18
|
decorators: [
|
|
19
|
-
(Story) => (_jsx("div", { className: "p-5 bg-
|
|
19
|
+
(Story) => (_jsx("div", { className: "p-5 bg-bg-bg2", children: _jsx(Story, {}) })),
|
|
20
20
|
],
|
|
21
21
|
};
|
|
22
22
|
export default meta;
|
|
@@ -59,7 +59,7 @@ const forcedStateClassName = {
|
|
|
59
59
|
disable: {},
|
|
60
60
|
};
|
|
61
61
|
const icon = _jsx(ArrowsUpDownIcon, {});
|
|
62
|
-
const renderPreview = (shape) => (_jsx("div", { className: "bg-
|
|
62
|
+
const renderPreview = (shape) => (_jsx("div", { className: "bg-bg-bg2 p-8 min-h-screen", children: _jsxs("div", { className: "flex flex-col gap-6", children: [_jsx("h3", { className: "text-xl font-semibold tracking-wide text-text-contrast-max", children: "Function button" }), previewStates.map((state) => (_jsxs("div", { className: "grid grid-cols-[120px_repeat(3,minmax(0,1fr))] items-stretch gap-4", children: [_jsx("span", { className: "pt-3 text-sm font-semibold text-text-contrast-max", children: state.label }), previewVariants.map((previewVariant) => (_jsxs("div", { className: "h-full rounded-lg border border-bg-stroke1 bg-bg-bg1 p-3", children: [_jsx("span", { className: "text-xs font-semibold tracking-wide text-text-contrast-max uppercase", children: previewVariant.label }), _jsx("div", { className: "mt-3 flex flex-wrap items-center gap-2", children: previewVariant.sizes.map((size) => (_jsx(ActionButton, { variant: previewVariant.variant, size: size, shape: shape, active: state.key === "active" || state.key === "active-hover", disabled: state.key === "disable", className: forcedStateClassName[state.key][previewVariant.variant], children: icon }, `${previewVariant.variant}-${size}-${state.key}`))) })] }, previewVariant.variant)))] }, state.key)))] }) }));
|
|
63
63
|
export const FigmaPreview = {
|
|
64
64
|
render: () => renderPreview("round"),
|
|
65
65
|
};
|
|
@@ -103,7 +103,7 @@ export const actionButtonVariants = cva(["box-border flex items-center justify-c
|
|
|
103
103
|
{
|
|
104
104
|
size: "xxs",
|
|
105
105
|
variant: "icon",
|
|
106
|
-
className: "px-[1px] py-[1px] [&_svg]:size-[
|
|
106
|
+
className: "px-[1px] py-[1px] [&_svg]:size-[10px]",
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
size: "xs",
|
|
@@ -20,32 +20,32 @@ const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
|
20
20
|
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
21
21
|
const AlertDialogOverlay = React.forwardRef((_a, ref) => {
|
|
22
22
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
23
|
-
return (_jsx(AlertDialogPrimitive.Overlay, Object.assign({ className: cn("fixed inset-0 bg-
|
|
23
|
+
return (_jsx(AlertDialogPrimitive.Overlay, Object.assign({ className: cn("fixed inset-0 bg-modal-overlay z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className) }, props, { ref: ref })));
|
|
24
24
|
});
|
|
25
25
|
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
26
26
|
const AlertDialogContent = React.forwardRef((_a, ref) => {
|
|
27
27
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
28
|
-
return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, Object.assign({ ref: ref, className: cn("fixed
|
|
28
|
+
return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, Object.assign({ ref: ref, className: cn("fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-32px)] max-w-[460px] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-md bg-modal-surface px-6 py-8 text-text-contrast-max shadow-[0px_12px_24px_-4px_rgba(0,0,0,0.12)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]", className) }, props))] }));
|
|
29
29
|
});
|
|
30
30
|
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
31
31
|
const AlertDialogHeader = (_a) => {
|
|
32
32
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
33
|
-
return (_jsx("div", Object.assign({ className: cn("flex flex-col
|
|
33
|
+
return (_jsx("div", Object.assign({ className: cn("flex flex-col items-center gap-2 text-center", className) }, props)));
|
|
34
34
|
};
|
|
35
35
|
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
36
36
|
const AlertDialogFooter = (_a) => {
|
|
37
37
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
38
|
-
return (_jsx("div", Object.assign({ className: cn("flex flex-col-reverse sm:flex-row sm:
|
|
38
|
+
return (_jsx("div", Object.assign({ className: cn("flex flex-col-reverse items-center justify-center gap-3 sm:flex-row sm:gap-4", className) }, props)));
|
|
39
39
|
};
|
|
40
40
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
41
41
|
const AlertDialogTitle = React.forwardRef((_a, ref) => {
|
|
42
42
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
43
|
-
return (_jsx(AlertDialogPrimitive.Title, Object.assign({ ref: ref, className: cn("typography-
|
|
43
|
+
return (_jsx(AlertDialogPrimitive.Title, Object.assign({ ref: ref, className: cn("typography-subtitle3 text-text-contrast-max", className) }, props)));
|
|
44
44
|
});
|
|
45
45
|
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
46
46
|
const AlertDialogDescription = React.forwardRef((_a, ref) => {
|
|
47
47
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
48
|
-
return (_jsx(AlertDialogPrimitive.Description, Object.assign({ ref: ref, className: cn("text-
|
|
48
|
+
return (_jsx(AlertDialogPrimitive.Description, Object.assign({ ref: ref, className: cn("typography-small1 text-text-contrast-max", className) }, props)));
|
|
49
49
|
});
|
|
50
50
|
AlertDialogDescription.displayName =
|
|
51
51
|
AlertDialogPrimitive.Description.displayName;
|
|
@@ -38,3 +38,6 @@ export const CustomStyle = {
|
|
|
38
38
|
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { children: "Open" }), _jsxs(AlertDialogContent, { className: "justify-center text-center", children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { className: "text-center", children: "Are you absolutely sure?" }), _jsx(AlertDialogDescription, { className: "text-center", children: "This action cannot be undone. This will permanently delete your account and remove your data from our servers." })] }), _jsxs(AlertDialogFooter, { className: "flex sm:justify-stretch", children: [_jsx(AlertDialogCancel, { className: "flex-1 justify-center", children: "Cancel" }), _jsx(AlertDialogAction, { className: "flex-1 justify-center", children: "Continue" })] })] })] }) }));
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
|
+
export const FigmaFail = {
|
|
42
|
+
render: () => (_jsx("div", { className: "flex w-full", children: _jsx(AlertDialog, { defaultOpen: true, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Infomation update failed" }), _jsx(AlertDialogDescription, { children: "Please login again and complete your profile to activate your account." })] }), _jsx(AlertDialogFooter, { children: _jsx(AlertDialogAction, { className: "w-[140px] justify-center", children: "Try again" }) })] }) }) })),
|
|
43
|
+
};
|
|
@@ -31,6 +31,6 @@ export const Preview = {
|
|
|
31
31
|
console.log("args ", args);
|
|
32
32
|
const props = Object.assign({}, args);
|
|
33
33
|
const BORDER = ["full", "normal", "none"];
|
|
34
|
-
return (_jsxs("div", { className: "flex flex-col gap-2 w-full
|
|
34
|
+
return (_jsxs("div", { className: "flex flex-col gap-2 w-full bg-bg-bg2 p-20", children: [BORDER.map((rounded) => (_jsxs("div", { className: "flex flex-row items-center gap-3", children: [_jsx(Avatar, { size: "xxs", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "xs", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "sm", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "md", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "lg", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" })] }, rounded))), BORDER.map((rounded) => (_jsxs("div", { className: "flex flex-row items-center gap-3", children: [_jsx(Avatar, { size: "xxs", rounded: rounded, type: "text", text: "AS" }), _jsx(Avatar, { size: "xs", rounded: rounded, type: "text", text: "AS" }), _jsx(Avatar, { size: "sm", rounded: rounded, type: "text", text: "AS" }), _jsx(Avatar, { size: "md", rounded: rounded, type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: rounded, type: "text", text: "AS" })] }, rounded)))] }));
|
|
35
35
|
},
|
|
36
36
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
2
|
export const avatarVariants = cva([
|
|
3
|
-
"flex items-center justify-center bg-grey2-700 text-
|
|
3
|
+
"flex items-center justify-center bg-grey2-700 text-common-black typography-subtitle2 truncate",
|
|
4
4
|
], {
|
|
5
5
|
variants: {
|
|
6
6
|
size: {
|
|
@@ -26,7 +26,7 @@ const AvatarImage = React.forwardRef((_a, ref) => {
|
|
|
26
26
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
|
|
27
27
|
const AvatarFallback = React.forwardRef((_a, ref) => {
|
|
28
28
|
var { className } = _a, props = __rest(_a, ["className"]);
|
|
29
|
-
return (_jsx(AvatarPrimitive.Fallback, Object.assign({ ref: ref, className: cn("flex h-full w-full items-center justify-center rounded-full bg-
|
|
29
|
+
return (_jsx(AvatarPrimitive.Fallback, Object.assign({ ref: ref, className: cn("flex h-full w-full items-center justify-center rounded-full bg-inherit text-inherit", className) }, props)));
|
|
30
30
|
});
|
|
31
31
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
|
|
32
32
|
export { AvatarBase, AvatarImage, AvatarFallback };
|
|
@@ -31,6 +31,6 @@ export const Preview = {
|
|
|
31
31
|
render: (args) => {
|
|
32
32
|
console.log("args ", args);
|
|
33
33
|
const props = Object.assign({}, args);
|
|
34
|
-
return (_jsx("div", { className: "flex flex-col gap-2 w-full
|
|
34
|
+
return (_jsx("div", { className: "flex flex-col gap-2 w-full bg-bg-bg2 p-20", children: _jsx("div", { className: "flex flex-row items-center gap-3", children: _jsxs(AvatarGroup, { children: [_jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" })] }) }) }));
|
|
35
35
|
},
|
|
36
36
|
};
|