ddingdong-design-system 0.2.0 → 0.2.2
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/.gitkeep +0 -0
- package/dist/App.d.ts +1 -0
- package/dist/ddingdong-design-system.es.js +3226 -0
- package/dist/ddingdong-design-system.es.js.map +1 -0
- package/dist/ddingdong-design-system.umd.js +2 -0
- package/dist/ddingdong-design-system.umd.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/shared/constants/motion.d.ts +113 -0
- package/dist/shared/hooks/useCarouselController.d.ts +11 -0
- package/dist/shared/hooks/usePortal.d.ts +5 -0
- package/dist/shared/hooks/useTooltip.d.ts +10 -0
- package/dist/shared/index.d.ts +27 -0
- package/dist/shared/lib/colors.d.ts +46 -0
- package/dist/shared/lib/core.d.ts +2 -0
- package/dist/shared/ui/Accordion/Accordion.d.ts +29 -0
- package/dist/shared/ui/Accordion/index.d.ts +2 -0
- package/dist/shared/ui/Avatar/Avatar.d.ts +22 -0
- package/dist/shared/ui/Avatar/index.d.ts +1 -0
- package/dist/shared/ui/Badge/Badge.d.ts +13 -0
- package/dist/shared/ui/Badge/index.d.ts +1 -0
- package/dist/shared/ui/Button/Button.d.ts +40 -0
- package/dist/shared/ui/Button/index.d.ts +1 -0
- package/dist/shared/ui/Card/Card.d.ts +13 -0
- package/dist/shared/ui/Card/index.d.ts +1 -0
- package/dist/shared/ui/Carousel/Carousel.d.ts +21 -0
- package/dist/shared/ui/Carousel/CarouselContext.d.ts +44 -0
- package/dist/shared/ui/Carousel/index.d.ts +1 -0
- package/dist/shared/ui/DoubleButton/DoubleButton.d.ts +12 -0
- package/dist/shared/ui/DoubleButton/index.d.ts +1 -0
- package/dist/shared/ui/Drawer/Drawer.d.ts +12 -0
- package/dist/shared/ui/Drawer/index.d.ts +1 -0
- package/dist/shared/ui/FileUpload/FileUpload.d.ts +12 -0
- package/dist/shared/ui/FileUpload/index.d.ts +1 -0
- package/dist/shared/ui/Flex/Flex.d.ts +72 -0
- package/dist/shared/ui/Flex/index.d.ts +1 -0
- package/dist/shared/ui/Icon/Icon.d.ts +21 -0
- package/dist/shared/ui/Icon/index.d.ts +1 -0
- package/dist/shared/ui/IconButton/IconButton.d.ts +22 -0
- package/dist/shared/ui/IconButton/index.d.ts +1 -0
- package/dist/shared/ui/Input/Input.d.ts +9 -0
- package/dist/shared/ui/Input/index.d.ts +1 -0
- package/dist/shared/ui/Modal/Modal.d.ts +20 -0
- package/dist/shared/ui/Modal/index.d.ts +1 -0
- package/dist/shared/ui/NavBack/NavBack.d.ts +16 -0
- package/dist/shared/ui/NavBack/index.d.ts +1 -0
- package/dist/shared/ui/Pagination/Pagination.d.ts +20 -0
- package/dist/shared/ui/Pagination/index.d.ts +1 -0
- package/dist/shared/ui/Portal/Portal.d.ts +12 -0
- package/dist/shared/ui/Portal/index.d.ts +1 -0
- package/dist/shared/ui/Select/Option.d.ts +10 -0
- package/dist/shared/ui/Select/OptionGroupName.d.ts +5 -0
- package/dist/shared/ui/Select/OptionList.d.ts +9 -0
- package/dist/shared/ui/Select/Select.context.d.ts +12 -0
- package/dist/shared/ui/Select/SelectButton.d.ts +8 -0
- package/dist/shared/ui/Select/SelectMain.d.ts +26 -0
- package/dist/shared/ui/Select/index.d.ts +16 -0
- package/dist/shared/ui/Skeleton/Skeleton.d.ts +20 -0
- package/dist/shared/ui/Skeleton/index.d.ts +2 -0
- package/dist/shared/ui/Switch/Switch.d.ts +11 -0
- package/dist/shared/ui/Switch/index.d.ts +1 -0
- package/dist/shared/ui/Tabs/Tabs.context.d.ts +5 -0
- package/dist/shared/ui/Tabs/TabsItem.d.ts +12 -0
- package/dist/shared/ui/Tabs/TabsRoot.d.ts +12 -0
- package/dist/shared/ui/Tabs/index.d.ts +2 -0
- package/dist/shared/ui/TextArea/TextArea.d.ts +28 -0
- package/dist/shared/ui/TextArea/index.d.ts +1 -0
- package/dist/shared/ui/Tooltip/Tooltip.d.ts +22 -0
- package/dist/shared/ui/Tooltip/index.d.ts +1 -0
- package/dist/shared/ui/Tooltip/tooltipColorMap.d.ts +38 -0
- package/dist/shared/ui/Typography/Typography.d.ts +39 -0
- package/dist/shared/ui/Typography/index.d.ts +1 -0
- package/dist/shared/ui/assets/index.d.ts +23 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
/**
|
|
3
|
+
* The title to display in the navigation back button.
|
|
4
|
+
*/
|
|
5
|
+
title: string;
|
|
6
|
+
/**
|
|
7
|
+
* The size of the navigation back button.
|
|
8
|
+
*/
|
|
9
|
+
size: 'sm' | 'lg';
|
|
10
|
+
/**
|
|
11
|
+
* Callback function to be called when the button is clicked.
|
|
12
|
+
*/
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
};
|
|
15
|
+
export declare function NavBack({ title, size, onClick }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NavBack } from './NavBack';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
/**
|
|
3
|
+
* current page number.
|
|
4
|
+
*/
|
|
5
|
+
currentPage: number;
|
|
6
|
+
/**
|
|
7
|
+
* total page number.
|
|
8
|
+
*/
|
|
9
|
+
totalPages: number;
|
|
10
|
+
/**
|
|
11
|
+
* function to be called when page is changed.
|
|
12
|
+
*/
|
|
13
|
+
onPageChange: (page: number) => void;
|
|
14
|
+
/**
|
|
15
|
+
* additional className.
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function Pagination({ currentPage, totalPages, onPageChange, className }: Props): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pagination } from './Pagination';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
/**
|
|
3
|
+
* Controls whether the portal is open or closed.
|
|
4
|
+
*/
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* The content to render inside the portal.
|
|
8
|
+
*/
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare function Portal({ isOpen, children }: Props): import('react').ReactPortal | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Portal } from './Portal';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const optionVariants: (props?: ({
|
|
3
|
+
size?: "md" | "lg" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
type Props = {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
} & VariantProps<typeof optionVariants>;
|
|
9
|
+
export declare function Option({ id, name, size }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const optionListVariants: (props?: ({
|
|
3
|
+
size?: "md" | "lg" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
type Props = {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
} & VariantProps<typeof optionListVariants>;
|
|
8
|
+
export declare function OptionList({ children, size }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type OptionProps = {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
};
|
|
5
|
+
export type SelectContextType = {
|
|
6
|
+
selected: OptionProps;
|
|
7
|
+
onSelect: (option: OptionProps) => void;
|
|
8
|
+
size: 'md' | 'lg';
|
|
9
|
+
};
|
|
10
|
+
export declare const SelectContext: import('react').Context<SelectContextType | undefined>;
|
|
11
|
+
export declare const useSelectContext: () => SelectContextType;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
type OptionProps = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
type Props = {
|
|
7
|
+
/**
|
|
8
|
+
* The size of the select component.
|
|
9
|
+
* @default 'lg'
|
|
10
|
+
*/
|
|
11
|
+
size?: 'md' | 'lg';
|
|
12
|
+
/**
|
|
13
|
+
* Callback function called when the selected option changes.
|
|
14
|
+
*/
|
|
15
|
+
onChange?: (option: OptionProps) => void;
|
|
16
|
+
/**
|
|
17
|
+
* The default value of the select component.
|
|
18
|
+
*/
|
|
19
|
+
defaultValue: string;
|
|
20
|
+
/**
|
|
21
|
+
* The content to be displayed inside the select component.
|
|
22
|
+
*/
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
};
|
|
25
|
+
export declare function SelectMain({ children, defaultValue, onChange, size }: Props): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Option } from './Option';
|
|
2
|
+
import { OptionGroupName } from './OptionGroupName';
|
|
3
|
+
import { OptionList } from './OptionList';
|
|
4
|
+
import { SelectButton } from './SelectButton';
|
|
5
|
+
import { SelectMain } from './SelectMain';
|
|
6
|
+
export declare const Select: typeof SelectMain & {
|
|
7
|
+
Option: typeof Option;
|
|
8
|
+
Button: typeof SelectButton;
|
|
9
|
+
List: typeof OptionList;
|
|
10
|
+
};
|
|
11
|
+
export declare const GroupingSelect: typeof SelectMain & {
|
|
12
|
+
Option: typeof Option;
|
|
13
|
+
Select: typeof SelectButton;
|
|
14
|
+
List: typeof OptionList;
|
|
15
|
+
Group: typeof OptionGroupName;
|
|
16
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
/**
|
|
3
|
+
* optional additional CSS class names like size etc.
|
|
4
|
+
*/
|
|
5
|
+
className?: string;
|
|
6
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
7
|
+
export declare function Skeleton({ className, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
type TextProps = {
|
|
9
|
+
/**
|
|
10
|
+
* optional additional CSS class names like size etc.
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* length of text line
|
|
15
|
+
* @default 2
|
|
16
|
+
*/
|
|
17
|
+
length?: number;
|
|
18
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
19
|
+
export declare function TextSkeleton({ length, className, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SwitchColor } from '../../lib/colors';
|
|
2
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
3
|
+
type Props = React.ComponentProps<typeof SwitchPrimitives.Root> & {
|
|
4
|
+
/**
|
|
5
|
+
* color of the switch.
|
|
6
|
+
* @default 'primary'
|
|
7
|
+
*/
|
|
8
|
+
color?: SwitchColor;
|
|
9
|
+
};
|
|
10
|
+
export declare function Switch({ color, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Switch } from './Switch';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
/**
|
|
3
|
+
* tab name to be displayed.
|
|
4
|
+
*/
|
|
5
|
+
label: string;
|
|
6
|
+
/**
|
|
7
|
+
* if activated, exposed element.
|
|
8
|
+
*/
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
11
|
+
export declare function TabsItem({ label, children, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
/**
|
|
3
|
+
* children elements of the Tabs
|
|
4
|
+
*/
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* default focusing tabsItem index.
|
|
8
|
+
*/
|
|
9
|
+
defaultIndex?: number;
|
|
10
|
+
} & React.HTMLAttributes<HTMLDivElement>;
|
|
11
|
+
export declare function TabsRoot({ children, defaultIndex, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
type TextAreaProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Current value of the textarea
|
|
5
|
+
*/
|
|
6
|
+
value: string;
|
|
7
|
+
/**
|
|
8
|
+
* Background color of the textarea
|
|
9
|
+
* @default 'gray'
|
|
10
|
+
*/
|
|
11
|
+
variant: 'gray' | 'white';
|
|
12
|
+
/**
|
|
13
|
+
* Default height in number of rows
|
|
14
|
+
* @default 3
|
|
15
|
+
*/
|
|
16
|
+
rows?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to show character counter
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
showCounter?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Custom class name for styling
|
|
24
|
+
*/
|
|
25
|
+
className?: string;
|
|
26
|
+
} & Omit<ComponentProps<'textarea'>, 'rows'>;
|
|
27
|
+
export declare function TextArea({ value, variant, rows, showCounter, className, ...props }: TextAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TextArea } from './TextArea';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TOOLTIP_MOTION } from '../../constants/motion';
|
|
2
|
+
import { tooltipColorMap } from './tooltipColorMap';
|
|
3
|
+
type TooltipProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The content to display in the tooltip
|
|
6
|
+
*/
|
|
7
|
+
content: string;
|
|
8
|
+
/**
|
|
9
|
+
* The color of the tooltip
|
|
10
|
+
*/
|
|
11
|
+
color: keyof typeof tooltipColorMap;
|
|
12
|
+
/**
|
|
13
|
+
* The animation mode for the tooltip
|
|
14
|
+
*/
|
|
15
|
+
animationMode?: keyof typeof TOOLTIP_MOTION;
|
|
16
|
+
/**
|
|
17
|
+
* The content to display in the tooltip
|
|
18
|
+
*/
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
};
|
|
21
|
+
export declare function Tooltip({ content, color, animationMode, children, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tooltip } from './Tooltip';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const tooltipColorMap: {
|
|
2
|
+
readonly primary: {
|
|
3
|
+
readonly bg: "bg-primary-300";
|
|
4
|
+
readonly text: "text-white";
|
|
5
|
+
};
|
|
6
|
+
readonly gray: {
|
|
7
|
+
readonly bg: "bg-gray-400";
|
|
8
|
+
readonly text: "text-white";
|
|
9
|
+
};
|
|
10
|
+
readonly red: {
|
|
11
|
+
readonly bg: "bg-red-300";
|
|
12
|
+
readonly text: "text-white";
|
|
13
|
+
};
|
|
14
|
+
readonly green: {
|
|
15
|
+
readonly bg: "bg-green-300";
|
|
16
|
+
readonly text: "text-white";
|
|
17
|
+
};
|
|
18
|
+
readonly orange: {
|
|
19
|
+
readonly bg: "bg-orange-500";
|
|
20
|
+
readonly text: "text-white";
|
|
21
|
+
};
|
|
22
|
+
readonly yellow: {
|
|
23
|
+
readonly bg: "bg-yellow-400";
|
|
24
|
+
readonly text: "text-black";
|
|
25
|
+
};
|
|
26
|
+
readonly purple: {
|
|
27
|
+
readonly bg: "bg-purple-500";
|
|
28
|
+
readonly text: "text-white";
|
|
29
|
+
};
|
|
30
|
+
readonly white: {
|
|
31
|
+
readonly bg: "bg-white border border-gray-200";
|
|
32
|
+
readonly text: "text-gray-800";
|
|
33
|
+
};
|
|
34
|
+
readonly black: {
|
|
35
|
+
readonly bg: "bg-black";
|
|
36
|
+
readonly text: "text-white";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
type TypographyVariant = 'Title1' | 'Title2' | 'Title3' | 'Body1' | 'Body2' | 'Body3' | 'Caption1';
|
|
3
|
+
type FontWeight = 'normal' | 'medium' | 'semibold' | 'bold';
|
|
4
|
+
type AllowedTag = 'p' | 'div' | 'label' | 'span';
|
|
5
|
+
type TypographyProps<T extends AllowedTag> = {
|
|
6
|
+
/**
|
|
7
|
+
* The HTML element to use for the typography component.
|
|
8
|
+
*/
|
|
9
|
+
as?: T;
|
|
10
|
+
/**
|
|
11
|
+
* The variant of the typography component.
|
|
12
|
+
* @default 'Body1'
|
|
13
|
+
*/
|
|
14
|
+
variant?: TypographyVariant;
|
|
15
|
+
/**
|
|
16
|
+
* The font weight of the typography component.
|
|
17
|
+
* @default 'medium'
|
|
18
|
+
*/
|
|
19
|
+
weight?: FontWeight;
|
|
20
|
+
/**
|
|
21
|
+
* Additional CSS classes to apply to the typography component.
|
|
22
|
+
*/
|
|
23
|
+
className?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The content of the typography component.
|
|
26
|
+
*/
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
} & Omit<ComponentPropsWithoutRef<T>, 'as' | 'className' | 'children'>;
|
|
29
|
+
export declare function Typography<T extends AllowedTag = 'p'>({ as, weight, className, children, ...props }: TypographyProps<T>): import('react').ReactElement<{
|
|
30
|
+
className: string;
|
|
31
|
+
} & Omit<TypographyProps<T>, "className" | "children" | "weight" | "as">, string | import('react').JSXElementConstructor<any>>;
|
|
32
|
+
export declare const Title1: <T extends AllowedTag = "p">(props: Omit<TypographyProps<T>, "variant">) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare const Title2: <T extends AllowedTag = "p">(props: Omit<TypographyProps<T>, "variant">) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare const Title3: <T extends AllowedTag = "p">(props: Omit<TypographyProps<T>, "variant">) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export declare const Body1: <T extends AllowedTag = "p">(props: Omit<TypographyProps<T>, "variant">) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export declare const Body2: <T extends AllowedTag = "p">(props: Omit<TypographyProps<T>, "variant">) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const Body3: <T extends AllowedTag = "p">(props: Omit<TypographyProps<T>, "variant">) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare const Caption1: <T extends AllowedTag = "p">(props: Omit<TypographyProps<T>, "variant">) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Title1, Title2, Title3, Caption1, Body1, Body2, Body3 } from './Typography';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const Icons: {
|
|
2
|
+
add: string;
|
|
3
|
+
arrowDown: string;
|
|
4
|
+
arrowUp: string;
|
|
5
|
+
arrowLeft: string;
|
|
6
|
+
arrowRight: string;
|
|
7
|
+
check: string;
|
|
8
|
+
close: string;
|
|
9
|
+
download: string;
|
|
10
|
+
etc: string;
|
|
11
|
+
file: string;
|
|
12
|
+
list: string;
|
|
13
|
+
navbarArrow: string;
|
|
14
|
+
new: string;
|
|
15
|
+
pin: string;
|
|
16
|
+
trash: string;
|
|
17
|
+
write: string;
|
|
18
|
+
loading: string;
|
|
19
|
+
instagram: string;
|
|
20
|
+
youtube: string;
|
|
21
|
+
};
|
|
22
|
+
export type IconName = keyof typeof Icons;
|
|
23
|
+
export declare const iconNames: IconName[];
|