@wishket/design-system 0.3.0 → 0.5.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/dist/Components/Atoms/LoadingIndicator/LoadingIndicator.d.ts +3 -0
- package/dist/Components/Atoms/LoadingIndicator/LoadingIndicator.parts.d.ts +3 -0
- package/dist/Components/Atoms/LoadingIndicator/LoadingIndicator.stories.d.ts +7 -0
- package/dist/Components/Atoms/LoadingIndicator/LoadingIndicator.types.d.ts +5 -0
- package/dist/Components/Atoms/LoadingIndicator/index.d.ts +2 -0
- package/dist/Components/Atoms/TextInput/TextInput.d.ts +3 -0
- package/dist/Components/Atoms/TextInput/TextInput.stories.d.ts +7 -0
- package/dist/Components/Atoms/TextInput/TextInput.types.d.ts +32 -0
- package/dist/Components/Atoms/TextInput/index.d.ts +2 -0
- package/dist/Components/Atoms/TextInput/parts/Icon.d.ts +6 -0
- package/dist/Components/Atoms/TextInput/parts/InputContainer.d.ts +3 -0
- package/dist/Components/Atoms/TextInput/parts/LabelContainer.d.ts +3 -0
- package/dist/Components/Atoms/TextInput/parts/PasswordContainer.d.ts +3 -0
- package/dist/Components/Atoms/TextInput/parts/SupportContainer.d.ts +3 -0
- package/dist/Components/Atoms/TextInput/parts/index.d.ts +3 -0
- package/dist/Components/Atoms/index.d.ts +2 -0
- package/dist/Components/Molecules/RadioList/RadioList.d.ts +3 -0
- package/dist/Components/Molecules/RadioList/RadioList.stories.d.ts +7 -0
- package/dist/Components/Molecules/RadioList/RadioList.types.d.ts +14 -0
- package/dist/Components/Molecules/RadioList/RadioListItem.d.ts +13 -0
- package/dist/Components/Molecules/RadioList/index.d.ts +2 -0
- package/dist/Components/Molecules/index.d.ts +1 -0
- package/dist/Components/Organisms/Modal/Modal.d.ts +10 -0
- package/dist/Components/Organisms/Modal/Modal.parts.d.ts +4 -0
- package/dist/Components/Organisms/Modal/Modal.stories.d.ts +22 -0
- package/dist/Components/Organisms/Modal/Modal.types.d.ts +23 -0
- package/dist/Components/Organisms/Modal/hooks/index.d.ts +1 -0
- package/dist/Components/Organisms/Modal/hooks/usePreventScroll.d.ts +2 -0
- package/dist/Components/Organisms/Modal/index.d.ts +2 -0
- package/dist/Components/Organisms/index.d.ts +1 -0
- package/dist/config/tailwind.config.js +40 -22
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LoadingIndicatorSize } from './LoadingIndicator.types';
|
|
2
|
+
export declare const generateBoxSize: (size: LoadingIndicatorSize) => "w-4" | "w-6" | "w-8" | "w-12" | "w-16" | "w-20" | "w-24" | "w-32";
|
|
3
|
+
export declare const generateSpinnerBorderSize: (size: LoadingIndicatorSize) => "border-[3px]" | "border-[4px]" | "border-[6px]" | "border-[8px]" | "border-[10px]" | "border-[12px]" | "border-[14px]" | "border-[16px]";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { LoadingIndicatorProps } from './LoadingIndicator.types';
|
|
3
|
+
import LoadingIndicator from '.';
|
|
4
|
+
declare const meta: Meta<typeof LoadingIndicator>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<LoadingIndicatorProps>;
|
|
7
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TextInputProps } from './TextInput.types';
|
|
2
|
+
declare const TextInput: ({ type, name, value, variant, placeholder, lable, startIcon, endIcon, maxLength, supportMessage, measure, isError, errorMessage, disabled, testId, onChange, }: TextInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default TextInput;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import TextInput from './TextInput';
|
|
3
|
+
import { TextInputProps } from './TextInput.types';
|
|
4
|
+
declare const meta: Meta<typeof TextInput>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<TextInputProps>;
|
|
7
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
type variant = 'default' | 'lable' | 'lable_fixed';
|
|
3
|
+
export interface TextInputProps extends ComponentPropsWithRef<'input'> {
|
|
4
|
+
variant?: variant;
|
|
5
|
+
lable?: string;
|
|
6
|
+
isError?: boolean;
|
|
7
|
+
startIcon?: string;
|
|
8
|
+
endIcon?: string;
|
|
9
|
+
supportMessage?: string;
|
|
10
|
+
measure?: string;
|
|
11
|
+
errorMessage?: string;
|
|
12
|
+
testId?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface InputContainerProps extends ComponentPropsWithRef<'input'> {
|
|
15
|
+
variant: variant;
|
|
16
|
+
lable?: string;
|
|
17
|
+
isFocused?: boolean;
|
|
18
|
+
isError?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface LabelContainerProps extends InputContainerProps {
|
|
21
|
+
startIcon?: string;
|
|
22
|
+
endIcon?: string;
|
|
23
|
+
measure?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SupportContainerProps {
|
|
26
|
+
isError?: boolean;
|
|
27
|
+
errorMessage?: string;
|
|
28
|
+
supportMessage?: string;
|
|
29
|
+
currentLength?: number;
|
|
30
|
+
maxLength?: number;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputContainerProps } from '../TextInput.types';
|
|
2
|
+
declare const InputContainer: ({ type, name, value, lable, maxLength, placeholder, variant, disabled, isFocused, isError, onChange, onFocus, onBlur, }: InputContainerProps) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
3
|
+
export default InputContainer;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LabelContainerProps } from '../TextInput.types';
|
|
2
|
+
declare const LabelContainer: ({ type, name, value, variant, lable, placeholder, startIcon, endIcon, maxLength, measure, isFocused, isError, onBlur, onFocus, disabled, onChange, }: LabelContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default LabelContainer;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { InputContainerProps } from '../TextInput.types';
|
|
2
|
+
declare const PasswordContainer: ({ type, name, value, lable, maxLength, placeholder, variant, disabled, isFocused, isError, onChange, onFocus, onBlur, }: InputContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default PasswordContainer;
|
|
@@ -5,3 +5,5 @@ export { default as Box } from './Box';
|
|
|
5
5
|
export { default as ProductIcon } from './ProductIcon';
|
|
6
6
|
export { default as Radio } from './Radio';
|
|
7
7
|
export { default as Button } from './Button';
|
|
8
|
+
export { default as LoadingIndicator } from './LoadingIndicator';
|
|
9
|
+
export { default as TextInput } from './TextInput';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { RadioListProps } from './RadioList.types';
|
|
3
|
+
import RadioList from './RadioList';
|
|
4
|
+
declare const meta: Meta<typeof RadioList>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<RadioListProps>;
|
|
7
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { RadioStatus } from '../../../types';
|
|
3
|
+
export interface RadioListData extends Omit<RadioStatus, 'isHover'> {
|
|
4
|
+
label: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface RadioListProps {
|
|
10
|
+
name: string;
|
|
11
|
+
data: RadioListData[];
|
|
12
|
+
className?: string;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
|
+
import { RadioStatus } from '../../../types';
|
|
3
|
+
interface RadioListProps extends RadioStatus {
|
|
4
|
+
label: string;
|
|
5
|
+
name: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
RadioClassName?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const RadioListItem: ({ name, value, label, description, checked, disabled, isError, className, RadioClassName, onChange, }: RadioListProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default RadioListItem;
|
|
@@ -2,3 +2,4 @@ export { default as WithBadge } from './WithBadge';
|
|
|
2
2
|
export { default as GridLayout } from './GridLayout';
|
|
3
3
|
export { default as CheckboxList } from './CheckboxList';
|
|
4
4
|
export { default as CheckboxCard } from './CheckboxCard';
|
|
5
|
+
export { default as RadioList } from './RadioList';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ModalRootProps } from './Modal.types';
|
|
2
|
+
export interface ModalProps extends ModalRootProps {
|
|
3
|
+
isPreventClose?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const Modal: {
|
|
6
|
+
Root: ({ children, hasBackground, isPreventClose, size, }: ModalRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
Trigger: ({ children, testId }: import("./Modal.types").ModalTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Content: ({ children, testId, role, className, }: import("./Modal.types").ModalContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
export default Modal;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ModalContentProps, ModalRootProps, ModalTriggerProps } from './Modal.types';
|
|
2
|
+
export declare const Root: ({ children, hasBackground, isPreventClose, size, }: ModalRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const Trigger: ({ children, testId }: ModalTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const Content: ({ children, testId, role, className, }: ModalContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { ModalRootProps } from './Modal.types';
|
|
3
|
+
import Modal from '.';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: ({ children, ...rest }: ModalRootProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
argTypes: {
|
|
8
|
+
hasBackground: {
|
|
9
|
+
control: string;
|
|
10
|
+
};
|
|
11
|
+
isPreventClose: {
|
|
12
|
+
control: string;
|
|
13
|
+
};
|
|
14
|
+
size: {
|
|
15
|
+
options: string[];
|
|
16
|
+
control: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj<typeof Modal.Root>;
|
|
22
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ModalRootProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
hasBackground?: boolean;
|
|
5
|
+
isPreventClose?: boolean;
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
}
|
|
8
|
+
export interface ModalTriggerProps {
|
|
9
|
+
setOpen?: () => void;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
testId?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ModalBackgroundProps {
|
|
14
|
+
isOpen?: boolean;
|
|
15
|
+
hasBackground?: boolean;
|
|
16
|
+
testId?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ModalContentProps {
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
testId?: string;
|
|
21
|
+
role?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as usePreventScroll } from './usePreventScroll';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Modal } from './Modal';
|
|
@@ -8,16 +8,16 @@ module.exports = {
|
|
|
8
8
|
],
|
|
9
9
|
theme: {
|
|
10
10
|
screens: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
mobile: '360px',
|
|
12
|
+
tablet: '720px',
|
|
13
|
+
desktop: '960px',
|
|
14
14
|
},
|
|
15
15
|
extend: {
|
|
16
16
|
gridAutoColumns: {
|
|
17
17
|
'1fr': '1fr',
|
|
18
18
|
},
|
|
19
19
|
spacing: {
|
|
20
|
-
|
|
20
|
+
container: '1200px',
|
|
21
21
|
},
|
|
22
22
|
colors: {
|
|
23
23
|
'w-cyan-10': '#F2FCFF',
|
|
@@ -125,22 +125,38 @@ module.exports = {
|
|
|
125
125
|
'w-secondary': '#2E6BAA',
|
|
126
126
|
'y-primary': '#6B16EE',
|
|
127
127
|
},
|
|
128
|
+
boxShadow: {
|
|
129
|
+
'graysmall': '0px 1px 4px 0px rgba(0, 0, 0, 0.12)',
|
|
130
|
+
'graymedium': '0px 2px 8px 0px rgba(0, 0, 0, 0.16)',
|
|
131
|
+
'bluegray': '0px 1px 4px 0px rgba(230, 235, 240, 0.80)',
|
|
132
|
+
'cyan': '0px 2px 8px 0px rgba(59, 163, 199, 0.32)',
|
|
133
|
+
'indigo': '0px 2px 8px 0px rgba(46, 107, 170, 0.32)',
|
|
134
|
+
'violet': '0px 2px 8px 0px rgba(107, 22, 238, 0.32)',
|
|
135
|
+
},
|
|
128
136
|
backgroundImage: {
|
|
129
|
-
'gradient-cyan-0':
|
|
130
|
-
'gradient-violet-0':
|
|
131
|
-
'gradient-indigo-0':
|
|
132
|
-
'gradient-cyan-30':
|
|
133
|
-
'gradient-violet-30':
|
|
134
|
-
|
|
135
|
-
'gradient-
|
|
136
|
-
|
|
137
|
-
'gradient-
|
|
138
|
-
'gradient-
|
|
139
|
-
|
|
140
|
-
'gradient-indigo-
|
|
141
|
-
|
|
142
|
-
'gradient-
|
|
143
|
-
'gradient-
|
|
137
|
+
'gradient-cyan-0': 'linear-gradient(0deg, #5db6d4 0%, #369cc2 100%)',
|
|
138
|
+
'gradient-violet-0': 'linear-gradient(0deg, #8e2de2 0%, #5a00db 100%)',
|
|
139
|
+
'gradient-indigo-0': 'linear-gradient(0deg, #5487ba 0%, #26619e 100%)',
|
|
140
|
+
'gradient-cyan-30': 'linear-gradient(30deg, #5db6d4 0%, #369cc2 100%)',
|
|
141
|
+
'gradient-violet-30':
|
|
142
|
+
'linear-gradient(30deg, #8e2de2 0%, #5a00db 100%)',
|
|
143
|
+
'gradient-indigo-30':
|
|
144
|
+
'linear-gradient(30deg, #5487ba 0%, #26619e 100%)',
|
|
145
|
+
'gradient-cyan-45': 'linear-gradient(45deg, #5db6d4 0%, #369cc2 100%)',
|
|
146
|
+
'gradient-violet-45':
|
|
147
|
+
'linear-gradient(45deg, #8e2de2 0%, #5a00db 100%)',
|
|
148
|
+
'gradient-indigo-45':
|
|
149
|
+
'linear-gradient(45deg, #5487ba 0%, #26619e 100%)',
|
|
150
|
+
'gradient-cyan-60': 'linear-gradient(60deg, #5db6d4 0%, #369cc2 100%)',
|
|
151
|
+
'gradient-violet-60':
|
|
152
|
+
'linear-gradient(60deg, #8e2de2 0%, #5a00db 100%)',
|
|
153
|
+
'gradient-indigo-60':
|
|
154
|
+
'linear-gradient(60deg, #5487ba 0%, #26619e 100%)',
|
|
155
|
+
'gradient-cyan-90': 'linear-gradient(90deg, #5db6d4 0%, #369cc2 100%)',
|
|
156
|
+
'gradient-violet-90':
|
|
157
|
+
'linear-gradient(90deg, #8e2de2 0%, #5a00db 100%)',
|
|
158
|
+
'gradient-indigo-90':
|
|
159
|
+
'linear-gradient(90deg, #5487ba 0%, #26619e 100%)',
|
|
144
160
|
},
|
|
145
161
|
gridTemplateAreas: {
|
|
146
162
|
'default-mobile': ['content content content content'],
|
|
@@ -150,13 +166,16 @@ module.exports = {
|
|
|
150
166
|
'default-desktop': [
|
|
151
167
|
'content content content content content content content content content content content content',
|
|
152
168
|
],
|
|
153
|
-
'checkbox-list-item-container':['checkbox label',' . description']
|
|
169
|
+
'checkbox-list-item-container': ['checkbox label', ' . description'],
|
|
170
|
+
'radio-list-item-container': ['radio label', ' . description'],
|
|
154
171
|
},
|
|
155
172
|
gridTemplateRows: {
|
|
156
173
|
'checkbox-list-item-container': 'min-content min-content',
|
|
174
|
+
'radio-list-item-container': 'min-content min-content',
|
|
157
175
|
},
|
|
158
176
|
gridTemplateColumns: {
|
|
159
177
|
'checkbox-list-item-container': '18px min-content',
|
|
178
|
+
'radio-list-item-container': '18px min-content',
|
|
160
179
|
},
|
|
161
180
|
},
|
|
162
181
|
},
|
|
@@ -164,5 +183,4 @@ module.exports = {
|
|
|
164
183
|
variants: {
|
|
165
184
|
gridTemplateAreas: ['responsive'],
|
|
166
185
|
},
|
|
167
|
-
}
|
|
168
|
-
|
|
186
|
+
};
|
package/dist/index.d.ts
CHANGED