dt-shared-front 1.0.0 → 1.0.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/components/auto-complete/auto-complete.d.ts +26 -0
- package/dist/components/auto-complete/index.d.ts +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +12 -0
- package/dist/components/breadcrumbs/index.d.ts +1 -0
- package/dist/components/button/button.d.ts +29 -0
- package/dist/components/checkbox/checkbox.d.ts +10 -0
- package/dist/components/counter/counter.d.ts +8 -0
- package/dist/components/counter/index.d.ts +1 -0
- package/dist/components/date-picker/date-picker.d.ts +58 -0
- package/dist/components/date-picker/index.d.ts +1 -0
- package/dist/components/divider/divider.d.ts +9 -0
- package/dist/components/divider/index.d.ts +1 -0
- package/dist/components/dropdown/dropdown.d.ts +5 -0
- package/dist/components/form/form-focus-error.d.ts +6 -0
- package/dist/components/form/form.d.ts +11 -0
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/form-control/form-control.d.ts +12 -0
- package/dist/components/form-control/index.d.ts +1 -0
- package/dist/components/heading/heading.d.ts +21 -0
- package/dist/components/heading/index.d.ts +1 -0
- package/dist/components/icon/icon.d.ts +25 -0
- package/dist/components/icon/index.d.ts +1 -0
- package/{src/components/input/index.ts → dist/components/input/index.d.ts} +1 -0
- package/dist/components/input/input.d.ts +57 -0
- package/dist/components/link/index.d.ts +1 -0
- package/dist/components/link/link.d.ts +27 -0
- package/dist/components/loader/index.d.ts +1 -0
- package/dist/components/loader/loader.d.ts +6 -0
- package/dist/components/loader-line/index.d.ts +1 -0
- package/dist/components/loader-line/loader-line.d.ts +5 -0
- package/dist/components/media/index.d.ts +2 -0
- package/dist/components/media/media.d.d.ts +3 -0
- package/dist/components/media/media.d.ts +24 -0
- package/dist/components/menu/menu.d.ts +6 -0
- package/dist/components/modal/index.d.ts +3 -0
- package/dist/components/modal/modal.d.ts +27 -0
- package/dist/components/modal/modal.provider.d.ts +5 -0
- package/dist/components/radio/index.d.ts +1 -0
- package/dist/components/radio/radio.d.ts +14 -0
- package/dist/components/range-picker/index.d.ts +1 -0
- package/dist/components/range-picker/range-picker.d.ts +53 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/select.d.ts +32 -0
- package/dist/components/selector/index.d.ts +1 -0
- package/dist/components/selector/selector.d.ts +8 -0
- package/dist/components/skeleton/index.d.ts +1 -0
- package/dist/components/skeleton/skeleton.d.ts +4 -0
- package/dist/components/slider/index.d.ts +1 -0
- package/dist/components/slider/slider.d.ts +21 -0
- package/dist/components/spoiler/index.d.ts +1 -0
- package/dist/components/spoiler/spoiler.d.ts +7 -0
- package/dist/components/stacked-input/index.d.ts +2 -0
- package/dist/components/stacked-input/stacked-input.d.ts +22 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/switch/switch.d.ts +9 -0
- package/dist/components/tag-box/index.d.ts +1 -0
- package/dist/components/tag-box/tag-box.d.ts +22 -0
- package/dist/components/tag-button/index.d.ts +2 -0
- package/dist/components/tag-button/tag-button.d.ts +27 -0
- package/dist/components/tag-button/tag-buttton-group.d.ts +17 -0
- package/dist/components/text/text.d.ts +21 -0
- package/dist/components/text-area/index.d.ts +1 -0
- package/dist/components/text-area/text-area.d.ts +28 -0
- package/dist/components/text-spoiler/index.d.ts +1 -0
- package/dist/components/text-spoiler/text-spoiler.d.ts +2 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/tooltip.d.ts +11 -0
- package/dist/components/tooltip/tooltip.utils.d.ts +12 -0
- package/dist/components/upload/index.d.ts +1 -0
- package/dist/components/upload/upload.d.ts +10 -0
- package/dist/components/utils/apple-detect.d.ts +1 -0
- package/dist/components/utils/combine-ref.d.ts +2 -0
- package/dist/components/utils/date-format.d.ts +7 -0
- package/dist/components/utils/date.d.ts +2 -0
- package/dist/components/utils/index.d.ts +1 -0
- package/dist/components/utils/pluralize.d.ts +1 -0
- package/dist/components/utils/price-format.d.ts +1 -0
- package/dist/components/utils/text-sanitize.d.ts +1 -0
- package/dist/components/utils/time-left.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +20 -12
- package/src/components/button/button.module.scss +0 -166
- package/src/components/button/button.tsx +0 -79
- package/src/components/checkbox/checkbox.module.scss +0 -82
- package/src/components/checkbox/checkbox.tsx +0 -36
- package/src/components/dropdown/dropdown.tsx +0 -9
- package/src/components/icon/icons/button-loader.svg +0 -18
- package/src/components/icon/icons/clear.svg +0 -3
- package/src/components/icon/icons/input-loader.svg +0 -18
- package/src/components/input/input.module.scss +0 -178
- package/src/components/input/input.tsx +0 -138
- package/src/components/link/index.ts +0 -1
- package/src/components/link/link.module.scss +0 -26
- package/src/components/link/link.tsx +0 -40
- package/src/components/menu/menu.tsx +0 -8
- package/src/components/text/text.module.scss +0 -28
- package/src/components/text/text.tsx +0 -31
- package/src/index.ts +0 -7
- package/src/styles/_components.scss +0 -111
- /package/{src/components/button/index.ts → dist/components/button/index.d.ts} +0 -0
- /package/{src/components/checkbox/index.ts → dist/components/checkbox/index.d.ts} +0 -0
- /package/{src/components/dropdown/index.ts → dist/components/dropdown/index.d.ts} +0 -0
- /package/{src/components/menu/index.ts → dist/components/menu/index.d.ts} +0 -0
- /package/{src/components/text/index.ts → dist/components/text/index.d.ts} +0 -0
@@ -1,138 +0,0 @@
|
|
1
|
-
import React, { InputHTMLAttributes, useMemo, ChangeEvent } from 'react';
|
2
|
-
import classnames from 'classnames';
|
3
|
-
import Loader from '../icon/icons/input-loader.svg';
|
4
|
-
import Clear from '../icon/icons/clear.svg';
|
5
|
-
|
6
|
-
import styles from './input.module.scss';
|
7
|
-
import { useState } from 'react';
|
8
|
-
import { useCallback } from 'react';
|
9
|
-
import { useEffect } from 'react';
|
10
|
-
|
11
|
-
export enum EInputVariant {
|
12
|
-
filled = 'filled',
|
13
|
-
outlined = 'outlined',
|
14
|
-
}
|
15
|
-
|
16
|
-
export enum EInputSize {
|
17
|
-
small = 'small',
|
18
|
-
medium = 'medium',
|
19
|
-
large = 'large',
|
20
|
-
}
|
21
|
-
|
22
|
-
type IInputProps = {
|
23
|
-
invalid?: boolean;
|
24
|
-
icon?: any;
|
25
|
-
variant: EInputVariant;
|
26
|
-
size: EInputSize;
|
27
|
-
loading?: boolean;
|
28
|
-
showClear?: boolean;
|
29
|
-
onClear?: () => void;
|
30
|
-
} & Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'variant'>;
|
31
|
-
|
32
|
-
export const Input = ({
|
33
|
-
onChange,
|
34
|
-
onFocus = () => {},
|
35
|
-
onBlur = () => {},
|
36
|
-
onClear,
|
37
|
-
icon: Icon,
|
38
|
-
name,
|
39
|
-
required,
|
40
|
-
disabled,
|
41
|
-
value,
|
42
|
-
type = 'text',
|
43
|
-
placeholder,
|
44
|
-
style,
|
45
|
-
loading,
|
46
|
-
showClear,
|
47
|
-
size = EInputSize.medium,
|
48
|
-
variant = EInputVariant.outlined,
|
49
|
-
}: IInputProps) => {
|
50
|
-
const [_value, _setValue] = useState(value);
|
51
|
-
|
52
|
-
useEffect(() => _setValue(value), [value]);
|
53
|
-
|
54
|
-
const classNames = useMemo(
|
55
|
-
() =>
|
56
|
-
classnames(
|
57
|
-
styles.input,
|
58
|
-
styles[`input__${variant}`],
|
59
|
-
styles[`input__${size}`],
|
60
|
-
{
|
61
|
-
[styles[`input__action_${size}`]]: Icon || loading || showClear,
|
62
|
-
[styles[`input__actions_${size}`]]: (Icon || loading) && showClear,
|
63
|
-
[styles.input__disabled]: disabled,
|
64
|
-
}
|
65
|
-
),
|
66
|
-
[variant, size, disabled, loading, showClear]
|
67
|
-
);
|
68
|
-
|
69
|
-
const clearClassNames = useMemo(
|
70
|
-
() =>
|
71
|
-
classnames(
|
72
|
-
styles.clear,
|
73
|
-
styles[`clear__${variant}`],
|
74
|
-
styles[`clear__${size}`],
|
75
|
-
{
|
76
|
-
[styles[`clear__action_${size}`]]: Icon || loading,
|
77
|
-
}
|
78
|
-
),
|
79
|
-
[variant, size, Icon, loading]
|
80
|
-
);
|
81
|
-
|
82
|
-
const loaderClassNames = useMemo(
|
83
|
-
() =>
|
84
|
-
classnames(
|
85
|
-
styles.loader,
|
86
|
-
styles[`loader__${variant}`],
|
87
|
-
styles[`loader__${size}`]
|
88
|
-
),
|
89
|
-
[variant, size]
|
90
|
-
);
|
91
|
-
|
92
|
-
const iconClassNames = useMemo(
|
93
|
-
() =>
|
94
|
-
classnames(
|
95
|
-
styles.icon,
|
96
|
-
styles[`icon__${variant}`],
|
97
|
-
styles[`icon__${size}`]
|
98
|
-
),
|
99
|
-
[variant, size]
|
100
|
-
);
|
101
|
-
|
102
|
-
const _onChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {
|
103
|
-
_setValue(e.target.value);
|
104
|
-
if (onChange) {
|
105
|
-
onChange(e);
|
106
|
-
}
|
107
|
-
}, []);
|
108
|
-
|
109
|
-
const _onClear = useCallback(() => {
|
110
|
-
_setValue(undefined);
|
111
|
-
|
112
|
-
if (onClear) {
|
113
|
-
onClear();
|
114
|
-
}
|
115
|
-
}, [onClear]);
|
116
|
-
|
117
|
-
return (
|
118
|
-
<div className={classNames}>
|
119
|
-
<input
|
120
|
-
name={name}
|
121
|
-
disabled={disabled}
|
122
|
-
placeholder={placeholder}
|
123
|
-
type={type}
|
124
|
-
value={_value || ''}
|
125
|
-
onChange={_onChange}
|
126
|
-
onFocus={onFocus}
|
127
|
-
onBlur={onBlur}
|
128
|
-
required={required}
|
129
|
-
style={style}
|
130
|
-
/>
|
131
|
-
{showClear && _value && (
|
132
|
-
<Clear className={clearClassNames} onClick={_onClear} />
|
133
|
-
)}
|
134
|
-
{Icon && !loading && <Icon className={iconClassNames} />}
|
135
|
-
{loading && <Loader className={loaderClassNames} />}
|
136
|
-
</div>
|
137
|
-
);
|
138
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export { Link, ELinkVariant } from './link';
|
@@ -1,26 +0,0 @@
|
|
1
|
-
$actionColor: var(--color-pink);
|
2
|
-
$iconColor: var(--color-icon-default);
|
3
|
-
$iconColorHover: var(--color-icon-default--hover);
|
4
|
-
|
5
|
-
.link {
|
6
|
-
text-decoration: none;
|
7
|
-
&__link {
|
8
|
-
color: $actionColor;
|
9
|
-
}
|
10
|
-
|
11
|
-
&__action {
|
12
|
-
}
|
13
|
-
|
14
|
-
& svg {
|
15
|
-
// color: $iconColor;
|
16
|
-
|
17
|
-
&:hover {
|
18
|
-
color: $iconColorHover;
|
19
|
-
}
|
20
|
-
}
|
21
|
-
}
|
22
|
-
|
23
|
-
|
24
|
-
.linkBold {
|
25
|
-
font-weight: 600;
|
26
|
-
}
|
@@ -1,40 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
3
|
-
import { useMemo } from 'react';
|
4
|
-
import classnames from 'classnames';
|
5
|
-
|
6
|
-
import styles from './link.module.scss';
|
7
|
-
|
8
|
-
export enum ELinkVariant {
|
9
|
-
link = 'link',
|
10
|
-
action = 'action',
|
11
|
-
}
|
12
|
-
|
13
|
-
interface ILinkProps {
|
14
|
-
variant?: ELinkVariant;
|
15
|
-
children: any;
|
16
|
-
href?: string;
|
17
|
-
bold?: boolean;
|
18
|
-
}
|
19
|
-
|
20
|
-
export const Link = ({ children, variant = ELinkVariant.link, href, bold }: ILinkProps) => {
|
21
|
-
const classNames = useMemo(
|
22
|
-
() =>
|
23
|
-
classnames(styles.link, styles[`link__${variant}`], {
|
24
|
-
[styles.linkBold]: bold,
|
25
|
-
}),
|
26
|
-
[variant]
|
27
|
-
);
|
28
|
-
|
29
|
-
const link = useMemo(
|
30
|
-
() =>
|
31
|
-
variant === ELinkVariant.link ? (
|
32
|
-
<a href={href} className={classNames}>{children}</a>
|
33
|
-
) : (
|
34
|
-
<div className={classNames}>{children}</div>
|
35
|
-
),
|
36
|
-
[variant, children]
|
37
|
-
);
|
38
|
-
|
39
|
-
return link;
|
40
|
-
};
|
@@ -1,28 +0,0 @@
|
|
1
|
-
$textSmallFontSize: var(--size-text-s);
|
2
|
-
$textMediumFontSize: var(--size-text-m);
|
3
|
-
$textLargeFontSize: var(--size-text-l);
|
4
|
-
|
5
|
-
$textColorAddition: var(--color-font-addition);
|
6
|
-
|
7
|
-
.text {
|
8
|
-
&__small {
|
9
|
-
font-size: $textSmallFontSize;
|
10
|
-
}
|
11
|
-
|
12
|
-
&__medium {
|
13
|
-
font-size: $textMediumFontSize;
|
14
|
-
}
|
15
|
-
|
16
|
-
&__large {
|
17
|
-
font-size: $textLargeFontSize;
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
|
-
|
22
|
-
.textAddition {
|
23
|
-
color: $textColorAddition;
|
24
|
-
}
|
25
|
-
|
26
|
-
.textBold {
|
27
|
-
font-weight: 600;
|
28
|
-
}
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import { useMemo } from 'react';
|
2
|
-
import classnames from 'classnames';
|
3
|
-
|
4
|
-
import styles from './text.module.scss';
|
5
|
-
import React from 'react';
|
6
|
-
|
7
|
-
export enum ETextSize {
|
8
|
-
small = 'small',
|
9
|
-
medium = 'medium',
|
10
|
-
large = 'large',
|
11
|
-
}
|
12
|
-
|
13
|
-
interface ITextProps {
|
14
|
-
size?: ETextSize;
|
15
|
-
children?: any;
|
16
|
-
bold?: boolean;
|
17
|
-
addition?: boolean;
|
18
|
-
}
|
19
|
-
|
20
|
-
export const Text = ({ children, size = ETextSize.medium, bold, addition }: ITextProps) => {
|
21
|
-
const classNames = useMemo(
|
22
|
-
() =>
|
23
|
-
classnames(styles.text, styles[`text__${size}`], {
|
24
|
-
[styles.textAddition]: addition,
|
25
|
-
[styles.textBold]: bold,
|
26
|
-
}),
|
27
|
-
[size]
|
28
|
-
);
|
29
|
-
|
30
|
-
return <div className={classNames}>{children}</div>;
|
31
|
-
};
|
package/src/index.ts
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
export { Button, EButtonSize, EButtonVariant } from './components/button';
|
2
|
-
export { Checkbox } from './components/checkbox';
|
3
|
-
export { Dropdown } from './components/dropdown';
|
4
|
-
export { Input, EInputSize, EInputVariant } from './components/input';
|
5
|
-
export { Link, ELinkVariant } from './components/link';
|
6
|
-
export { Menu } from './components/menu';
|
7
|
-
export { Text, ETextSize } from './components/text';
|
@@ -1,111 +0,0 @@
|
|
1
|
-
:root {
|
2
|
-
//Font sizes
|
3
|
-
--size-text-xs: 10px;
|
4
|
-
--size-text-s: 12px;
|
5
|
-
--size-text-m: 14px;
|
6
|
-
--size-text-l: 16px;
|
7
|
-
--size-text-xl: 20px;
|
8
|
-
|
9
|
-
--size-header-s: 18px;
|
10
|
-
--size-header-m: 24px;
|
11
|
-
--size-header-l: 28px;
|
12
|
-
--size-header-xl: 36px;
|
13
|
-
|
14
|
-
//Colors
|
15
|
-
--color-default: #8F07CF;
|
16
|
-
--color-secondary: #FEE833;
|
17
|
-
--color-tertiary: #FB8A29;
|
18
|
-
--color-pink: #CB11AB;
|
19
|
-
|
20
|
-
--color-resolve: #00A611;
|
21
|
-
--color-reject: #FF4444;
|
22
|
-
--color-other: #1e90ff;
|
23
|
-
--color-danger: #ff773c;
|
24
|
-
--color-link: #4682b4;
|
25
|
-
|
26
|
-
--color-f8: #F8F8F8;
|
27
|
-
--color-d5: #d5d5d5;
|
28
|
-
--color-b6: #b6b6b6;
|
29
|
-
--color-8b: #8b8b8b;
|
30
|
-
--color-64: #646464;
|
31
|
-
|
32
|
-
//Button
|
33
|
-
--color-button-default-text: #FFFFFF;
|
34
|
-
--color-button-default: #8F07CF;
|
35
|
-
--color-button-default--active: #7E06B6;
|
36
|
-
--color-button-default--hover: #A008E8;
|
37
|
-
--color-button-default--disabled: #d5d5d5;
|
38
|
-
|
39
|
-
--color-button-secondary-text: #000000;
|
40
|
-
--color-button-secondary: #FEE833;
|
41
|
-
--color-button-secondary--active: darken(#FEE833, 5%);
|
42
|
-
--color-button-secondary--hover: lighten(#FEE833, 5%);
|
43
|
-
--color-button-secondary--disabled: #d5d5d5;
|
44
|
-
|
45
|
-
--color-button-tertiary-text: #8B8B8B;
|
46
|
-
--color-button-tertiary: #F8F8F8;
|
47
|
-
--color-button-tertiary--active: #F8F8F8;
|
48
|
-
--color-button-tertiary--hover: #F8F8F8;
|
49
|
-
--color-button-tertiary--disabled: #d5d5d5;
|
50
|
-
|
51
|
-
//Icon
|
52
|
-
--color-icon-default: #000000;
|
53
|
-
--color-icon-default--active: #CB11AB;
|
54
|
-
--color-icon-default--hover: #CB11AB;
|
55
|
-
|
56
|
-
|
57
|
-
//Input
|
58
|
-
--color-input-filled: #F8F8F8;
|
59
|
-
--color-input-filled-placeholder: #646464;
|
60
|
-
--color-input-filled-text: #000000;
|
61
|
-
--color-input-filled-text--disabled: #000000;
|
62
|
-
|
63
|
-
--color-input-filled--hover: #F8F8F8;
|
64
|
-
--color-input-filled--focus: #F8F8F8;
|
65
|
-
--color-input-filled--disabled: #646464;
|
66
|
-
|
67
|
-
--color-input: #ffffff;
|
68
|
-
--color-input--disabled: #f5f5f5;
|
69
|
-
|
70
|
-
|
71
|
-
--backdrop-blur: none;
|
72
|
-
--box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
73
|
-
|
74
|
-
--color-font: #000000;
|
75
|
-
--color-font-inverse: #ffffff;
|
76
|
-
--color-font-addition: #8b8b8b;
|
77
|
-
--color-font--disabled: #b6b6b6;
|
78
|
-
|
79
|
-
--color-text: #000000;
|
80
|
-
--color-text--hover: #000000;
|
81
|
-
--color-text--active: #000000;
|
82
|
-
|
83
|
-
--color-background: #ffffff;
|
84
|
-
--color-background--hover: #f5f5f5;
|
85
|
-
|
86
|
-
|
87
|
-
--color-element: #f5f5f5;
|
88
|
-
--color-element--active: #d5d5d5;
|
89
|
-
--color-element--hover: #f5f5f5;
|
90
|
-
|
91
|
-
--color-tab: #f5f5f5;
|
92
|
-
--color-tab--hover: #d5d5d5;
|
93
|
-
|
94
|
-
--color-border: #d5d5d5;
|
95
|
-
--color-border--active: #b6b6b6;
|
96
|
-
--color-border--hover: #b6b6b6;
|
97
|
-
--color-border--disabled: #d5d5d5;
|
98
|
-
|
99
|
-
--color-placeholder: #b6b6b6;
|
100
|
-
|
101
|
-
--color-icon-grey: #b6b6b6;
|
102
|
-
--color-icon-grey--hover: #8b8b8b;
|
103
|
-
|
104
|
-
--color-scroll: rgba(0, 0, 0, 0.15);
|
105
|
-
|
106
|
-
--color-bg: #FFFFFF;
|
107
|
-
|
108
|
-
--color-toast-reject: #fe3d3eee;
|
109
|
-
--color-toast-resolve: #56b661ee;
|
110
|
-
|
111
|
-
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|