@smart-react-components/ui 2.0.0-alpha-6 → 2.0.0-alpha-8
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/Button/ButtonAddon/index.d.ts +14 -0
- package/Button/ButtonAddon/index.js +17 -0
- package/Button/ButtonGroup/index.d.ts +6 -0
- package/Button/ButtonGroup/index.js +10 -0
- package/Button/ButtonLink/index.d.ts +8 -0
- package/Button/ButtonLink/index.js +26 -0
- package/Button/ButtonList/index.d.ts +8 -0
- package/Button/ButtonList/index.js +38 -0
- package/Button/ButtonLoading/index.d.ts +7 -0
- package/Button/ButtonLoading/index.js +18 -0
- package/Button/ButtonSelect/index.d.ts +12 -0
- package/Button/ButtonSelect/index.js +64 -0
- package/Button/index.d.ts +11 -0
- package/Button/index.js +90 -0
- package/Input/InputAddon/index.js +1 -1
- package/Input/InputFile/index.js +18 -14
- package/Input/InputNumber/index.js +18 -14
- package/Input/index.js +18 -14
- package/Modal/ModalBody/index.d.ts +3 -0
- package/Modal/ModalBody/index.js +16 -0
- package/Modal/ModalCloseIcon/index.d.ts +2 -0
- package/Modal/ModalCloseIcon/index.js +7 -0
- package/Modal/ModalFooter/index.d.ts +6 -0
- package/Modal/ModalFooter/index.js +21 -0
- package/Modal/ModalHeader/index.d.ts +6 -0
- package/Modal/ModalHeader/index.js +30 -0
- package/Modal/ModalTitle/index.d.ts +3 -0
- package/Modal/ModalTitle/index.js +11 -0
- package/Modal/index.d.ts +27 -0
- package/Modal/index.js +18 -0
- package/Overlay/OverlayElement.d.ts +4 -3
- package/Overlay/index.d.ts +1 -0
- package/Overlay/index.js +5 -1
- package/PopUp/Alert/index.d.ts +24 -0
- package/PopUp/Alert/index.js +50 -0
- package/PopUp/Confirm/index.d.ts +26 -0
- package/PopUp/Confirm/index.js +53 -0
- package/PopUp/Prompt/index.d.ts +28 -0
- package/PopUp/Prompt/index.js +64 -0
- package/Select/SelectBox/index.js +20 -42
- package/Select/index.js +18 -14
- package/components/Button/ButtonAddon/index.d.ts +15 -0
- package/components/Button/ButtonAddon/index.js +110 -0
- package/components/Button/ButtonContent/index.d.ts +2 -0
- package/components/Button/ButtonContent/index.js +20 -0
- package/components/Button/ButtonGroup/index.d.ts +3 -0
- package/components/Button/ButtonGroup/index.js +41 -0
- package/components/Button/ButtonList/index.d.ts +9 -0
- package/components/Button/ButtonList/index.js +31 -0
- package/components/Button/ButtonLoading/index.d.ts +6 -0
- package/components/Button/ButtonLoading/index.js +45 -0
- package/components/Button/index.d.ts +21 -0
- package/components/Button/index.js +268 -0
- package/components/Modal/Overlay/index.d.ts +7 -0
- package/components/Modal/Overlay/index.js +62 -0
- package/components/Modal/index.d.ts +11 -0
- package/components/Modal/index.js +65 -0
- package/hooks/useAddons.d.ts +16 -0
- package/hooks/{useInputAddons.js → useAddons.js} +8 -22
- package/hooks/useSelectBoxItemList.d.ts +14 -0
- package/hooks/useSelectBoxItemList.js +41 -0
- package/index.d.ts +16 -0
- package/index.js +33 -1
- package/package.json +7 -7
- package/types/button.d.ts +40 -0
- package/types/button.js +9 -0
- package/util/wave-effect.d.ts +21 -0
- package/util/wave-effect.js +43 -0
- package/hooks/useInputAddons.d.ts +0 -18
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
7
|
+
exports.default = styled_components_1.default.span `
|
|
8
|
+
align-items: center;
|
|
9
|
+
border: solid 1px;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
cursor: default;
|
|
12
|
+
display: flex;
|
|
13
|
+
fill: currentcolor;
|
|
14
|
+
flex: 1 1 auto;
|
|
15
|
+
transition: 300ms 0s ease-in-out;
|
|
16
|
+
transition-property: background, border, color, fill;
|
|
17
|
+
user-select: none;
|
|
18
|
+
word-break: break-word;
|
|
19
|
+
word-wrap: break-word;
|
|
20
|
+
`;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
7
|
+
const __1 = __importDefault(require("../"));
|
|
8
|
+
const ButtonAddon_1 = __importDefault(require("../ButtonAddon"));
|
|
9
|
+
const ButtonContent_1 = __importDefault(require("../ButtonContent"));
|
|
10
|
+
const ButtonList_1 = __importDefault(require("../ButtonList"));
|
|
11
|
+
exports.default = (0, styled_components_1.default)(ButtonList_1.default) `
|
|
12
|
+
align-items: stretch;
|
|
13
|
+
flex-wrap: nowrap;
|
|
14
|
+
|
|
15
|
+
> * {
|
|
16
|
+
:not(:first-child) {
|
|
17
|
+
&,
|
|
18
|
+
${__1.default},
|
|
19
|
+
${ButtonAddon_1.default},
|
|
20
|
+
${ButtonContent_1.default} {
|
|
21
|
+
border-left: 0;
|
|
22
|
+
border-top-left-radius: 0;
|
|
23
|
+
border-bottom-left-radius: 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:not(:last-child) {
|
|
28
|
+
&,
|
|
29
|
+
${__1.default},
|
|
30
|
+
${ButtonAddon_1.default},
|
|
31
|
+
${ButtonContent_1.default} {
|
|
32
|
+
border-top-right-radius: 0;
|
|
33
|
+
border-bottom-right-radius: 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:focus {
|
|
38
|
+
box-shadow: none;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { StyledProps } from '@smart-react-components/core/styled-props';
|
|
2
|
+
import { Partial, ResponsiveProp, SizeProp } from '@smart-react-components/core/types';
|
|
3
|
+
export interface Props extends StyledProps, Partial<ResponsiveProp<'buttonSize', SizeProp>> {
|
|
4
|
+
hasSpace?: boolean;
|
|
5
|
+
isBlock?: boolean;
|
|
6
|
+
length?: number;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import("styled-components").StyledComponent<"div", any, StyledProps & Props, never>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Div_1 = __importDefault(require("@smart-react-components/core/Element/Div"));
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ hasSpace }) => ({
|
|
9
|
+
getButtonSize: (v, t) => `
|
|
10
|
+
${hasSpace
|
|
11
|
+
? `
|
|
12
|
+
margin: -${t.$.size.button[v].margin.y} -${t.$.size.button[v].margin.x};
|
|
13
|
+
`
|
|
14
|
+
: ''}
|
|
15
|
+
`,
|
|
16
|
+
}))(({ isBlock, length }) => `
|
|
17
|
+
align-items: center;
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: flex-start;
|
|
20
|
+
|
|
21
|
+
${isBlock
|
|
22
|
+
? `
|
|
23
|
+
> * {
|
|
24
|
+
flex: 1 1 ${100 / length}%;
|
|
25
|
+
width: ${100 / length}%;
|
|
26
|
+
}
|
|
27
|
+
`
|
|
28
|
+
: `
|
|
29
|
+
flex-wrap: wrap;
|
|
30
|
+
`}
|
|
31
|
+
`);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StyledProps } from '@smart-react-components/core/styled-props';
|
|
2
|
+
interface Props extends StyledProps {
|
|
3
|
+
hasAnimation: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: import("styled-components").StyledComponent<"div", any, StyledProps & Props, never>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Div_1 = __importDefault(require("@smart-react-components/core/Element/Div"));
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
exports.default = (0, styled_components_1.default)(Div_1.default)(({ theme, hasAnimation }) => `
|
|
9
|
+
align-items: center;
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100%;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
left: 0;
|
|
14
|
+
position: absolute;
|
|
15
|
+
width: 100%;
|
|
16
|
+
z-index: ${theme.$.zIndex.buttonLoading};
|
|
17
|
+
|
|
18
|
+
${hasAnimation
|
|
19
|
+
? `
|
|
20
|
+
&.src-button-loading-show {
|
|
21
|
+
opacity: 0;
|
|
22
|
+
transform: scale(0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&.src-button-loading-show-active {
|
|
26
|
+
transition: 300ms 0s ease-in-out;
|
|
27
|
+
transition-property: opacity, transform;
|
|
28
|
+
opacity: 1;
|
|
29
|
+
transform: scale(1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.src-button-loading-hide {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
transform: scale(1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.src-button-loading-hide-active {
|
|
38
|
+
transition: 300ms 0s ease-in-out;
|
|
39
|
+
transition-property: opacity, transform;
|
|
40
|
+
opacity: 0;
|
|
41
|
+
transform: scale(0);
|
|
42
|
+
}
|
|
43
|
+
`
|
|
44
|
+
: ''}
|
|
45
|
+
`);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StyledProps } from '@smart-react-components/core/styled-props';
|
|
2
|
+
import { PaletteProp, ResponsiveProp, ShapeProp, SizeProp } from '@smart-react-components/core/types';
|
|
3
|
+
interface Props extends StyledProps, ResponsiveProp<'buttonSize', SizeProp> {
|
|
4
|
+
hasButtonContainer: boolean;
|
|
5
|
+
hasHover: boolean;
|
|
6
|
+
hasLeftAddon: boolean;
|
|
7
|
+
hasRightAddon: boolean;
|
|
8
|
+
hasSeparatedLeftAddon: boolean;
|
|
9
|
+
hasSeparatedRightAddon: boolean;
|
|
10
|
+
isBlock: boolean;
|
|
11
|
+
isDisabled: boolean;
|
|
12
|
+
isFixedSize: boolean;
|
|
13
|
+
isLink: boolean;
|
|
14
|
+
isLoading: boolean;
|
|
15
|
+
isSoft: boolean;
|
|
16
|
+
isOutline: boolean;
|
|
17
|
+
palette: PaletteProp;
|
|
18
|
+
shape: ShapeProp;
|
|
19
|
+
}
|
|
20
|
+
declare const _default: import("styled-components").StyledComponent<"button", any, StyledProps & Props, never>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Button_1 = __importDefault(require("@smart-react-components/core/Element/Button"));
|
|
7
|
+
const Svg_1 = __importDefault(require("@smart-react-components/core/Element/Svg"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const css_1 = require("../../util/css");
|
|
10
|
+
const ButtonAddon_1 = __importDefault(require("./ButtonAddon"));
|
|
11
|
+
const ButtonContent_1 = __importDefault(require("./ButtonContent"));
|
|
12
|
+
exports.default = (0, styled_components_1.default)(Button_1.default).attrs(({ hasLeftAddon, hasRightAddon, isFixedSize }) => ({
|
|
13
|
+
getButtonSize: (v, t) => `
|
|
14
|
+
${ButtonContent_1.default} {
|
|
15
|
+
font-size: ${t.$.size.button[v].fontSize};
|
|
16
|
+
|
|
17
|
+
> ${Svg_1.default} {
|
|
18
|
+
height: ${t.$.size.button[v].iconSize};
|
|
19
|
+
width: ${t.$.size.button[v].iconSize};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
${!isFixedSize
|
|
23
|
+
? `
|
|
24
|
+
padding: ${t.$.size.button[v].padding.y} ${t.$.size.button[v].padding.x};
|
|
25
|
+
|
|
26
|
+
${hasLeftAddon
|
|
27
|
+
? `
|
|
28
|
+
padding-left: ${(0, css_1.toCSSValue)(t.$.size.button[v].padding.x)(val => val / 2)};
|
|
29
|
+
`
|
|
30
|
+
: ''}
|
|
31
|
+
|
|
32
|
+
${hasRightAddon
|
|
33
|
+
? `
|
|
34
|
+
padding-right: ${(0, css_1.toCSSValue)(t.$.size.button[v].padding.x)(val => val / 2)};
|
|
35
|
+
`
|
|
36
|
+
: ''}
|
|
37
|
+
`
|
|
38
|
+
: `
|
|
39
|
+
height: ${t.$.size.button[v].fixedSize};
|
|
40
|
+
width: ${t.$.size.button[v].fixedSize};
|
|
41
|
+
`}
|
|
42
|
+
|
|
43
|
+
> :not(:last-child) {
|
|
44
|
+
margin-right: ${(0, css_1.toCSSValue)(t.$.size.button[v].padding.x)(val => val / 4)};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`,
|
|
48
|
+
}))(({ theme, hasButtonContainer, hasHover, hasLeftAddon, hasRightAddon, hasSeparatedLeftAddon, hasSeparatedRightAddon, isBlock, isDisabled, isFixedSize, isLink, isLoading, isSoft, isOutline, palette, shape }) => `
|
|
49
|
+
align-items: stretch;
|
|
50
|
+
background: transparent;
|
|
51
|
+
border: 0;
|
|
52
|
+
font-family: ${theme.$.fontFamily.button};
|
|
53
|
+
position: relative;
|
|
54
|
+
transition: box-shadow 300ms 0s ease-in-out;
|
|
55
|
+
|
|
56
|
+
&,
|
|
57
|
+
${ButtonContent_1.default} {
|
|
58
|
+
border-radius: ${(isFixedSize && shape === 'rounded') ? '100%' : theme.$.radius.button[shape]};
|
|
59
|
+
|
|
60
|
+
${hasSeparatedLeftAddon
|
|
61
|
+
? `
|
|
62
|
+
border-top-left-radius: 0;
|
|
63
|
+
border-bottom-left-radius: 0;
|
|
64
|
+
`
|
|
65
|
+
: ''}
|
|
66
|
+
|
|
67
|
+
${hasSeparatedRightAddon
|
|
68
|
+
? `
|
|
69
|
+
border-top-right-radius: 0;
|
|
70
|
+
border-bottom-right-radius: 0;
|
|
71
|
+
`
|
|
72
|
+
: ''}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
${ButtonContent_1.default} {
|
|
76
|
+
${hasLeftAddon
|
|
77
|
+
? `
|
|
78
|
+
border-left: 0;
|
|
79
|
+
border-top-left-radius: 0;
|
|
80
|
+
border-bottom-left-radius: 0;
|
|
81
|
+
`
|
|
82
|
+
: ''}
|
|
83
|
+
|
|
84
|
+
${hasRightAddon
|
|
85
|
+
? `
|
|
86
|
+
border-right: 0;
|
|
87
|
+
border-top-right-radius: 0;
|
|
88
|
+
border-bottom-right-radius: 0;
|
|
89
|
+
`
|
|
90
|
+
: ''}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:active {
|
|
94
|
+
outline: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
${!isFixedSize
|
|
98
|
+
? `
|
|
99
|
+
${(!isBlock)
|
|
100
|
+
? `
|
|
101
|
+
display: inline-flex;
|
|
102
|
+
flex: 0 1 auto;
|
|
103
|
+
`
|
|
104
|
+
: `
|
|
105
|
+
display: flex;
|
|
106
|
+
flex: 1 1 auto;
|
|
107
|
+
`}
|
|
108
|
+
`
|
|
109
|
+
: ''}
|
|
110
|
+
|
|
111
|
+
${(isBlock || isFixedSize)
|
|
112
|
+
? `
|
|
113
|
+
${ButtonContent_1.default} {
|
|
114
|
+
justify-content: center;
|
|
115
|
+
}
|
|
116
|
+
`
|
|
117
|
+
: ''}
|
|
118
|
+
|
|
119
|
+
${!isLink
|
|
120
|
+
? `
|
|
121
|
+
${!isOutline
|
|
122
|
+
? `
|
|
123
|
+
${!isSoft
|
|
124
|
+
? `
|
|
125
|
+
${ButtonContent_1.default} {
|
|
126
|
+
background: ${theme.$.palette[palette].main};
|
|
127
|
+
border-color: ${theme.$.palette[palette].main};
|
|
128
|
+
color: ${theme.$.palette[palette].font};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
${hasHover
|
|
132
|
+
? `
|
|
133
|
+
&:hover {
|
|
134
|
+
${ButtonContent_1.default} {
|
|
135
|
+
background: ${theme.$.palette[palette].dynamic};
|
|
136
|
+
border-color: ${theme.$.palette[palette].dynamic};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
${ButtonAddon_1.default} {
|
|
140
|
+
background: ${theme.$.palette[palette].dynamicest};
|
|
141
|
+
border-color: ${theme.$.palette[palette].dynamicest};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
`
|
|
145
|
+
: ''}
|
|
146
|
+
`
|
|
147
|
+
: `
|
|
148
|
+
${ButtonContent_1.default} {
|
|
149
|
+
background: ${theme.$.palette[palette].soft};
|
|
150
|
+
border-color: ${theme.$.palette[palette].soft};
|
|
151
|
+
color: ${theme.$.palette[palette].softFont};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
${hasHover
|
|
156
|
+
? `
|
|
157
|
+
&:hover {
|
|
158
|
+
${ButtonContent_1.default} {
|
|
159
|
+
background: ${theme.$.palette[palette].softDark};
|
|
160
|
+
border-color: ${theme.$.palette[palette].softDark};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
${ButtonAddon_1.default} {
|
|
164
|
+
background: ${theme.$.palette[palette].softDarkest};
|
|
165
|
+
border-color: ${theme.$.palette[palette].softDarkest};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
`
|
|
169
|
+
: ''}
|
|
170
|
+
`}
|
|
171
|
+
`
|
|
172
|
+
: `
|
|
173
|
+
${!isSoft
|
|
174
|
+
? `
|
|
175
|
+
${ButtonContent_1.default} {
|
|
176
|
+
border-color: ${theme.$.palette[palette].main};
|
|
177
|
+
color: ${theme.$.palette[palette].main};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
${hasHover
|
|
181
|
+
? `
|
|
182
|
+
&:hover {
|
|
183
|
+
${ButtonContent_1.default} {
|
|
184
|
+
background: ${theme.$.palette[palette].main};
|
|
185
|
+
color: ${theme.$.palette[palette].font};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
${ButtonAddon_1.default} {
|
|
189
|
+
background: ${theme.$.palette[palette].dynamicer};
|
|
190
|
+
color: ${theme.$.palette[palette].font};
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
`
|
|
194
|
+
: ''}
|
|
195
|
+
`
|
|
196
|
+
: `
|
|
197
|
+
${ButtonContent_1.default} {
|
|
198
|
+
border-color: ${theme.$.palette[palette].soft};
|
|
199
|
+
color: ${theme.$.palette[palette].soft};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
${hasHover
|
|
203
|
+
? `
|
|
204
|
+
&:hover {
|
|
205
|
+
${ButtonContent_1.default} {
|
|
206
|
+
background: ${theme.$.palette[palette].soft};
|
|
207
|
+
color: ${theme.$.palette[palette].softFont};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
${ButtonAddon_1.default} {
|
|
211
|
+
background: ${theme.$.palette[palette].softDarker};
|
|
212
|
+
color: ${theme.$.palette[palette].softFont};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
`
|
|
216
|
+
: ''}
|
|
217
|
+
`}
|
|
218
|
+
`}
|
|
219
|
+
`
|
|
220
|
+
: `
|
|
221
|
+
${ButtonContent_1.default} {
|
|
222
|
+
border-color: transparent;
|
|
223
|
+
color: ${theme.$.palette[palette].main};
|
|
224
|
+
fill: ${theme.$.palette[palette].main};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
${hasHover
|
|
228
|
+
? `
|
|
229
|
+
&:hover {
|
|
230
|
+
${ButtonContent_1.default} {
|
|
231
|
+
color: ${theme.$.palette[palette].dynamicest};
|
|
232
|
+
text-decoration: underline;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
`
|
|
236
|
+
: ''}
|
|
237
|
+
`}
|
|
238
|
+
|
|
239
|
+
${!hasButtonContainer
|
|
240
|
+
? `
|
|
241
|
+
&:focus {
|
|
242
|
+
box-shadow: 0 0 0 .15rem ${theme.$.palette[palette].shadow};
|
|
243
|
+
}
|
|
244
|
+
`
|
|
245
|
+
: ''}
|
|
246
|
+
|
|
247
|
+
${isDisabled
|
|
248
|
+
? `
|
|
249
|
+
opacity: ${theme.$.opacity.buttonDisabled};
|
|
250
|
+
pointer-events: none;
|
|
251
|
+
`
|
|
252
|
+
: ''}
|
|
253
|
+
|
|
254
|
+
${isLoading
|
|
255
|
+
? `
|
|
256
|
+
pointer-events: none;
|
|
257
|
+
|
|
258
|
+
${ButtonContent_1.default},
|
|
259
|
+
${ButtonAddon_1.default} {
|
|
260
|
+
color: transparent;
|
|
261
|
+
|
|
262
|
+
> * {
|
|
263
|
+
visibility: hidden;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
`
|
|
267
|
+
: ''}
|
|
268
|
+
`);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Props as OverlayProps } from '../../../Overlay/OverlayElement';
|
|
2
|
+
interface Props extends OverlayProps {
|
|
3
|
+
duration: number;
|
|
4
|
+
isFullScreen: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import("styled-components").StyledComponent<"div", any, import("@smart-react-components/core").StyledProps & OverlayProps & Props, never>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
7
|
+
const __1 = __importDefault(require("../"));
|
|
8
|
+
const OverlayElement_1 = __importDefault(require("../../../Overlay/OverlayElement"));
|
|
9
|
+
exports.default = (0, styled_components_1.default)(OverlayElement_1.default)(({ theme, duration, isFullScreen }) => `
|
|
10
|
+
${isFullScreen
|
|
11
|
+
? `
|
|
12
|
+
padding: 0;
|
|
13
|
+
`
|
|
14
|
+
: ''}
|
|
15
|
+
|
|
16
|
+
will-change: opacity;
|
|
17
|
+
|
|
18
|
+
> ${__1.default} {
|
|
19
|
+
will-change: transform;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.src-modal-show {
|
|
23
|
+
opacity: 0;
|
|
24
|
+
|
|
25
|
+
> ${__1.default} {
|
|
26
|
+
transform: translateY(-${theme.$.length.overlay.space});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.src-modal-show-active {
|
|
31
|
+
opacity: 1;
|
|
32
|
+
|
|
33
|
+
> ${__1.default} {
|
|
34
|
+
transform: translateY(0);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.src-modal-hide {
|
|
39
|
+
opacity: 1;
|
|
40
|
+
|
|
41
|
+
> ${__1.default} {
|
|
42
|
+
transform: translateY(0);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.src-modal-hide-active {
|
|
47
|
+
opacity: 0;
|
|
48
|
+
|
|
49
|
+
> ${__1.default} {
|
|
50
|
+
transform: translateY(-${theme.$.length.overlay.space});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&.src-modal-show-active,
|
|
55
|
+
&.src-modal-hide-active {
|
|
56
|
+
transition: opacity ${duration}ms 0s ease-in-out;
|
|
57
|
+
|
|
58
|
+
> ${__1.default} {
|
|
59
|
+
transition: transform ${duration}ms 0s ease-in-out;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StyledProps } from '@smart-react-components/core/styled-props';
|
|
2
|
+
import { ResponsiveProp, ShapeProp, SizeProp } from '@smart-react-components/core/types';
|
|
3
|
+
interface Props extends StyledProps, ResponsiveProp<'modalSize', SizeProp> {
|
|
4
|
+
isBlock: boolean;
|
|
5
|
+
isCentered: boolean;
|
|
6
|
+
isFullScreen: boolean;
|
|
7
|
+
isStretched: boolean;
|
|
8
|
+
shape: ShapeProp;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: import("styled-components").StyledComponent<"div", any, StyledProps & Props, never>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Div_1 = __importDefault(require("@smart-react-components/core/Element/Div"));
|
|
7
|
+
const Svg_1 = __importDefault(require("@smart-react-components/core/Element/Svg"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const ModalHeader_1 = __importDefault(require("../../Modal/ModalHeader"));
|
|
10
|
+
const ModalTitle_1 = __importDefault(require("../../Modal/ModalTitle"));
|
|
11
|
+
exports.default = (0, styled_components_1.default)(Div_1.default).attrs(({ isBlock, isFullScreen }) => ({
|
|
12
|
+
getModalSize: (v, t) => `
|
|
13
|
+
${(!isBlock && !isFullScreen)
|
|
14
|
+
? `
|
|
15
|
+
width: ${t.$.size.modal[v].width};
|
|
16
|
+
`
|
|
17
|
+
: ''}
|
|
18
|
+
|
|
19
|
+
> * {
|
|
20
|
+
padding: ${t.$.size.modal[v].padding.y} ${t.$.size.modal[v].padding.x};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
${ModalHeader_1.default} {
|
|
24
|
+
${ModalTitle_1.default} {
|
|
25
|
+
font-size: ${t.$.size.modal[v].titleFontSize};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
${Svg_1.default} {
|
|
29
|
+
margin: -${t.$.size.modal[v].padding.y} -${t.$.size.modal[v].padding.x} -${t.$.size.modal[v].padding.y} 0;
|
|
30
|
+
padding: ${t.$.size.modal[v].padding.y} ${t.$.size.modal[v].padding.x};
|
|
31
|
+
height: ${t.$.size.icon[v]};
|
|
32
|
+
width: ${t.$.size.icon[v]};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`,
|
|
36
|
+
}))(({ theme, isBlock, isCentered, isFullScreen, isStretched, shape }) => `
|
|
37
|
+
background: ${theme.$.color.dynamic.background};
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
color: ${theme.$.color.dynamic.font};
|
|
40
|
+
display: flex;
|
|
41
|
+
fill: currentcolor;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
max-height: 100%;
|
|
44
|
+
|
|
45
|
+
${(isBlock || isFullScreen)
|
|
46
|
+
? `
|
|
47
|
+
width: 100%;
|
|
48
|
+
`
|
|
49
|
+
: ''}
|
|
50
|
+
|
|
51
|
+
${(isStretched || isFullScreen)
|
|
52
|
+
? `
|
|
53
|
+
align-self: stretch;
|
|
54
|
+
`
|
|
55
|
+
: `
|
|
56
|
+
align-self: ${isCentered ? 'center' : 'flex-start'};
|
|
57
|
+
`}
|
|
58
|
+
|
|
59
|
+
${!isFullScreen
|
|
60
|
+
? `
|
|
61
|
+
border: solid 1px ${theme.$.color.dynamic.accent};
|
|
62
|
+
border-radius: ${theme.$.radius.modal[shape]};
|
|
63
|
+
`
|
|
64
|
+
: ''}
|
|
65
|
+
`);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ContentElement, Nullable } from '@smart-react-components/core/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface Props {
|
|
4
|
+
Component: React.ElementType;
|
|
5
|
+
leftAddon: Nullable<ContentElement>;
|
|
6
|
+
rightAddon: Nullable<ContentElement>;
|
|
7
|
+
props: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
interface Return {
|
|
12
|
+
leftAddon: Nullable<JSX.Element>;
|
|
13
|
+
rightAddon: Nullable<JSX.Element>;
|
|
14
|
+
}
|
|
15
|
+
declare const useAddons: ({ Component, leftAddon, rightAddon, props }: Props) => Return;
|
|
16
|
+
export default useAddons;
|
|
@@ -5,43 +5,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const useChangeEffect_1 = __importDefault(require("@smart-react-components/core/hooks/useChangeEffect"));
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const InputAddon_1 = __importDefault(require("../Input/InputAddon"));
|
|
9
8
|
const types_1 = require("../types");
|
|
10
|
-
const
|
|
9
|
+
const useAddons = ({ Component, leftAddon, rightAddon, props }) => {
|
|
11
10
|
const generateAddonEl = (item, position) => {
|
|
11
|
+
var _a;
|
|
12
12
|
if (!item) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
isFocused,
|
|
18
|
-
isOutline,
|
|
19
|
-
isSoft,
|
|
20
|
-
palette,
|
|
21
|
-
position,
|
|
22
|
-
shape,
|
|
23
|
-
size,
|
|
24
|
-
sizeSm,
|
|
25
|
-
sizeMd,
|
|
26
|
-
sizeLg,
|
|
27
|
-
sizeXl,
|
|
28
|
-
};
|
|
29
|
-
if ((item === null || item === void 0 ? void 0 : item.displayName) === 'SRCInputAddon') {
|
|
30
|
-
return react_1.default.cloneElement(item, Object.assign(Object.assign({}, props), item.props));
|
|
15
|
+
if (((_a = item === null || item === void 0 ? void 0 : item.type) === null || _a === void 0 ? void 0 : _a.displayName) === 'SRCAddon') {
|
|
16
|
+
return react_1.default.cloneElement(item, Object.assign(Object.assign(Object.assign({}, props), item.props), { position }));
|
|
31
17
|
}
|
|
32
|
-
return (react_1.default.createElement(
|
|
18
|
+
return (react_1.default.createElement(Component, Object.assign({}, props, { position: position }), item));
|
|
33
19
|
};
|
|
34
20
|
const [leftAddonEl, setLeftAddonEl] = react_1.default.useState(() => generateAddonEl(leftAddon, types_1.OrderPosition.LEFT));
|
|
35
21
|
const [rightAddonEl, setRightAddonEl] = react_1.default.useState(() => generateAddonEl(rightAddon, types_1.OrderPosition.RIGHT));
|
|
36
22
|
(0, useChangeEffect_1.default)(() => {
|
|
37
23
|
setLeftAddonEl(generateAddonEl(leftAddon, types_1.OrderPosition.LEFT));
|
|
38
|
-
}, [leftAddon, isDisabled, isFocused]);
|
|
24
|
+
}, [leftAddon, props.isDisabled, props.isFocused]);
|
|
39
25
|
(0, useChangeEffect_1.default)(() => {
|
|
40
26
|
setRightAddonEl(generateAddonEl(rightAddon, types_1.OrderPosition.RIGHT));
|
|
41
|
-
}, [rightAddon, isDisabled, isFocused]);
|
|
27
|
+
}, [rightAddon, props.isDisabled, props.isFocused]);
|
|
42
28
|
return {
|
|
43
29
|
leftAddon: leftAddonEl,
|
|
44
30
|
rightAddon: rightAddonEl,
|
|
45
31
|
};
|
|
46
32
|
};
|
|
47
|
-
exports.default =
|
|
33
|
+
exports.default = useAddons;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ContentElement } from '@smart-react-components/core/types';
|
|
2
|
+
interface Props {
|
|
3
|
+
children: JSX.Element | JSX.Element[];
|
|
4
|
+
}
|
|
5
|
+
interface Return {
|
|
6
|
+
itemList: {
|
|
7
|
+
[key: string]: {
|
|
8
|
+
children: ContentElement;
|
|
9
|
+
idx: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
declare const useSelectBoxItemList: ({ children }: Props) => Return;
|
|
14
|
+
export default useSelectBoxItemList;
|