@veracity/vui 0.0.15 → 0.2.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/avatar/avatar.js +2 -2
- package/box/box.js +1 -1
- package/button/button.d.ts +7 -1
- package/button/button.js +56 -23
- package/button/button.types.d.ts +8 -6
- package/button/buttonIcon.d.ts +3 -0
- package/{alert/alertText.js → button/buttonIcon.js} +9 -9
- package/button/buttonText.d.ts +3 -0
- package/button/buttonText.js +30 -0
- package/button/buttons.d.ts +4 -3
- package/button/buttons.js +4 -3
- package/button/consts.js +3 -2
- package/button/context.d.ts +2 -2
- package/button/context.js +4 -4
- package/button/index.d.ts +2 -2
- package/button/index.js +2 -2
- package/button/theme.d.ts +79 -41
- package/button/theme.js +85 -46
- package/{button → buttonGroup}/buttonGroup.d.ts +3 -1
- package/{button → buttonGroup}/buttonGroup.js +4 -2
- package/buttonGroup/context.d.ts +4 -0
- package/buttonGroup/context.js +23 -0
- package/buttonGroup/helpers.d.ts +3 -0
- package/buttonGroup/helpers.js +10 -0
- package/buttonGroup/index.d.ts +4 -0
- package/{alert → buttonGroup}/index.js +4 -8
- package/card/card.d.ts +3 -0
- package/{tile/tile.js → card/card.js} +8 -7
- package/{tile/tile.types.d.ts → card/card.types.d.ts} +1 -1
- package/card/index.d.ts +3 -0
- package/{tile → card}/index.js +4 -4
- package/card/theme.d.ts +6 -0
- package/card/theme.js +10 -0
- package/checkbox/checkbox.js +4 -4
- package/checkbox/checkbox.types.d.ts +1 -1
- package/checkbox/checkboxGroup.types.d.ts +1 -1
- package/core/globalStyle.d.ts +4 -1
- package/core/globalStyle.js +7 -3
- package/core/index.d.ts +2 -0
- package/core/index.js +5 -1
- package/core/styled.d.ts +4 -0
- package/core/styled.js +80 -0
- package/core/types/component.d.ts +12 -12
- package/core/types/index.d.ts +1 -0
- package/core/types/index.js +1 -0
- package/core/types/styled.d.ts +11 -0
- package/core/utils.d.ts +2 -2
- package/core/utils.js +7 -7
- package/core/v.d.ts +182 -0
- package/core/v.js +6 -0
- package/core/vuiProvider.d.ts +13 -2
- package/core/vuiProvider.js +1 -1
- package/divider/divider.types.d.ts +1 -1
- package/heading/heading.types.d.ts +2 -1
- package/icon/helpers.d.ts +2 -3
- package/icon/helpers.js +6 -8
- package/icon/icon.js +3 -2
- package/icon/icon.types.d.ts +4 -2
- package/icons/library.js +1 -1
- package/icons/types.d.ts +1 -1
- package/image/image.d.ts +3 -0
- package/image/image.js +38 -0
- package/image/image.types.d.ts +5 -0
- package/image/index.d.ts +3 -0
- package/{label → image}/index.js +4 -4
- package/image/theme.d.ts +6 -0
- package/image/theme.js +10 -0
- package/index.d.ts +6 -3
- package/index.js +6 -3
- package/input/context.d.ts +4 -0
- package/{alert → input}/context.js +4 -4
- package/input/index.d.ts +2 -0
- package/input/index.js +2 -0
- package/input/input.d.ts +7 -2
- package/input/input.js +33 -22
- package/input/input.types.d.ts +7 -3
- package/input/inputIcon.d.ts +3 -0
- package/input/inputIcon.js +30 -0
- package/input/inputInput.d.ts +5 -0
- package/input/inputInput.js +36 -0
- package/input/theme.d.ts +40 -15
- package/input/theme.js +40 -16
- package/list/index.d.ts +3 -1
- package/list/index.js +3 -1
- package/list/list.d.ts +2 -0
- package/list/list.js +3 -1
- package/list/list.types.d.ts +19 -1
- package/list/listHeading.d.ts +2 -2
- package/list/listHeading.js +2 -2
- package/list/listIcon.js +1 -1
- package/list/listItem.d.ts +1 -1
- package/list/listItem.js +8 -5
- package/list/listText.d.ts +3 -0
- package/list/listText.js +30 -0
- package/list/theme.d.ts +20 -6
- package/list/theme.js +26 -12
- package/notification/consts.d.ts +2 -0
- package/{alert → notification}/consts.js +7 -7
- package/notification/context.d.ts +4 -0
- package/notification/context.js +23 -0
- package/notification/index.d.ts +8 -0
- package/notification/index.js +25 -0
- package/notification/notification.d.ts +13 -0
- package/{alert/alert.js → notification/notification.js} +25 -25
- package/notification/notification.types.d.ts +20 -0
- package/notification/notificationButton.d.ts +3 -0
- package/{alert/alertButton.js → notification/notificationButton.js} +8 -8
- package/notification/notificationIcon.d.ts +3 -0
- package/{alert/alertIcon.js → notification/notificationIcon.js} +9 -9
- package/notification/notificationText.d.ts +3 -0
- package/notification/notificationText.js +30 -0
- package/notification/notificationTitle.d.ts +3 -0
- package/notification/notificationTitle.js +30 -0
- package/{alert → notification}/theme.d.ts +0 -15
- package/{alert → notification}/theme.js +1 -22
- package/package.json +2 -3
- package/panel/index.d.ts +3 -0
- package/panel/index.js +20 -0
- package/panel/panel.d.ts +3 -0
- package/panel/panel.js +39 -0
- package/panel/panel.types.d.ts +4 -0
- package/{tile → panel}/theme.d.ts +1 -8
- package/{tile → panel}/theme.js +4 -11
- package/radio/radio.js +4 -4
- package/radio/radio.types.d.ts +1 -1
- package/radio/radioGroup.types.d.ts +1 -1
- package/skeleton/skeleton.types.d.ts +1 -0
- package/spinner/spinner.types.d.ts +1 -0
- package/svg/cache.js +1 -5
- package/svg/svg.js +2 -3
- package/switch/index.d.ts +0 -1
- package/switch/index.js +0 -1
- package/switch/switch.js +6 -6
- package/switch/switch.types.d.ts +19 -4
- package/switch/switchButton.d.ts +2 -2
- package/switch/switchButton.js +18 -19
- package/switch/theme.d.ts +41 -46
- package/switch/theme.js +50 -72
- package/system/borders.d.ts +3 -1
- package/system/custom.d.ts +24 -7
- package/system/custom.js +33 -13
- package/system/system.d.ts +2 -2
- package/system/system.js +1 -1
- package/t/t.types.d.ts +2 -1
- package/tag/context.d.ts +4 -0
- package/tag/context.js +23 -0
- package/tag/index.d.ts +6 -0
- package/tag/index.js +23 -0
- package/tag/tag.d.ts +11 -0
- package/tag/tag.js +99 -0
- package/{label/label.types.d.ts → tag/tag.types.d.ts} +6 -7
- package/tag/tag.types.js +2 -0
- package/tag/tagIcon.d.ts +3 -0
- package/{alert/alertTitle.js → tag/tagIcon.js} +9 -9
- package/tag/tagText.d.ts +3 -0
- package/tag/tagText.js +30 -0
- package/tag/theme.d.ts +65 -0
- package/tag/theme.js +78 -0
- package/textarea/textarea.js +2 -1
- package/textarea/textarea.types.d.ts +1 -0
- package/theme/components.d.ts +291 -223
- package/theme/components.js +32 -28
- package/theme/defaultTheme.d.ts +291 -223
- package/utils/assertion.d.ts +14 -0
- package/utils/assertion.js +34 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/object.d.ts +5 -18
- package/utils/object.js +17 -50
- package/utils/types.d.ts +2 -0
- package/alert/alert.d.ts +0 -13
- package/alert/alert.types.d.ts +0 -20
- package/alert/alertButton.d.ts +0 -3
- package/alert/alertIcon.d.ts +0 -3
- package/alert/alertText.d.ts +0 -3
- package/alert/alertTitle.d.ts +0 -3
- package/alert/consts.d.ts +0 -2
- package/alert/context.d.ts +0 -4
- package/alert/index.d.ts +0 -8
- package/label/index.d.ts +0 -3
- package/label/label.d.ts +0 -5
- package/label/label.js +0 -71
- package/label/theme.d.ts +0 -61
- package/label/theme.js +0 -107
- package/list/listItem.types.d.ts +0 -16
- package/switch/switchButton.types.d.ts +0 -19
- package/tile/index.d.ts +0 -3
- package/tile/tile.d.ts +0 -3
- /package/{button → buttonGroup}/buttonGroup.types.d.ts +0 -0
- /package/{button → buttonGroup}/buttonGroup.types.js +0 -0
- /package/{alert/alert.types.js → card/card.types.js} +0 -0
- /package/{label/label.types.js → core/types/styled.js} +0 -0
- /package/{list/listItem.types.js → image/image.types.js} +0 -0
- /package/{switch/switchButton.types.js → notification/notification.types.js} +0 -0
- /package/{tile/tile.types.js → panel/panel.types.js} +0 -0
package/button/theme.js
CHANGED
|
@@ -12,91 +12,129 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
function variantOutlined(props) {
|
|
15
|
+
var _a;
|
|
15
16
|
var c = props.colorScheme;
|
|
16
|
-
var
|
|
17
|
-
return
|
|
18
|
-
}
|
|
19
|
-
function variantSubtle(props) {
|
|
20
|
-
var c = props.colorScheme;
|
|
21
|
-
var styles = {
|
|
22
|
-
hoverBg: c + ".30",
|
|
23
|
-
activeBg: c + ".40",
|
|
24
|
-
bg: c + ".20",
|
|
25
|
-
color: c + ".90"
|
|
26
|
-
};
|
|
27
|
-
// Special cases
|
|
28
|
-
if (c === 'grey') {
|
|
29
|
-
styles.color = 'prussian.80';
|
|
30
|
-
}
|
|
31
|
-
return styles;
|
|
17
|
+
var container = __assign(__assign({}, (_a = variantText(props)) === null || _a === void 0 ? void 0 : _a.container), { borderColor: c + ".80", hoverBorderColor: c + ".80" });
|
|
18
|
+
return { container: container };
|
|
32
19
|
}
|
|
33
20
|
function variantSolid(props) {
|
|
34
21
|
var c = props.colorScheme;
|
|
35
|
-
var
|
|
36
|
-
borderColor: c + ".100",
|
|
22
|
+
var container = {
|
|
37
23
|
hoverBg: c + ".90",
|
|
24
|
+
hoverBorderColor: c + ".90",
|
|
38
25
|
activeBg: c + ".100",
|
|
39
26
|
bg: c + ".80",
|
|
27
|
+
borderColor: c + ".80",
|
|
28
|
+
borderWidth: 1,
|
|
40
29
|
color: 'white'
|
|
41
30
|
};
|
|
42
31
|
// Special cases
|
|
43
32
|
if (c === 'prussian') {
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
container.activeBg = 'prussian.60';
|
|
34
|
+
container.hoverBg = 'prussian.70';
|
|
35
|
+
}
|
|
36
|
+
return { container: container };
|
|
37
|
+
}
|
|
38
|
+
function variantSubtle(props) {
|
|
39
|
+
var c = props.colorScheme;
|
|
40
|
+
var container = {
|
|
41
|
+
hoverBg: c + ".30",
|
|
42
|
+
hoverBorderColor: c + ".30",
|
|
43
|
+
activeBg: c + ".40",
|
|
44
|
+
bg: c + ".20",
|
|
45
|
+
borderColor: c + ".20",
|
|
46
|
+
borderWidth: 1,
|
|
47
|
+
color: c + ".90"
|
|
48
|
+
};
|
|
49
|
+
// Special cases
|
|
50
|
+
if (c === 'prussian') {
|
|
51
|
+
container.activeBg = 'blue.40';
|
|
52
|
+
container.hoverBg = 'blue.30';
|
|
53
|
+
container.hoverBorderColor = 'blue.30';
|
|
54
|
+
container.bg = 'blue.20';
|
|
55
|
+
container.borderColor = 'blue.20';
|
|
56
|
+
}
|
|
57
|
+
if (c === 'grey') {
|
|
58
|
+
container.color = 'prussian.80';
|
|
46
59
|
}
|
|
47
|
-
return
|
|
60
|
+
return { container: container };
|
|
48
61
|
}
|
|
49
62
|
function variantText(props) {
|
|
50
63
|
var c = props.colorScheme;
|
|
51
|
-
var
|
|
64
|
+
var container = {
|
|
52
65
|
hoverBg: c + ".20",
|
|
66
|
+
hoverBorderColor: c + ".20",
|
|
53
67
|
activeBg: c + ".30",
|
|
54
68
|
bg: 'transparent',
|
|
69
|
+
borderColor: 'transparent',
|
|
70
|
+
borderWidth: 1,
|
|
55
71
|
color: c + ".80"
|
|
56
72
|
};
|
|
57
73
|
// Special cases
|
|
58
74
|
if (c === 'prussian') {
|
|
59
|
-
|
|
60
|
-
|
|
75
|
+
container.activeBg = 'blue.30';
|
|
76
|
+
container.hoverBg = 'blue.20';
|
|
77
|
+
container.hoverBorderColor = 'blue.20';
|
|
61
78
|
}
|
|
62
79
|
if (c === 'grey') {
|
|
63
|
-
|
|
80
|
+
container.color = 'prussian.80';
|
|
64
81
|
}
|
|
65
|
-
return
|
|
82
|
+
return { container: container };
|
|
66
83
|
}
|
|
67
84
|
var defaultProps = {
|
|
68
85
|
colorScheme: 'prussian',
|
|
69
86
|
size: 'md',
|
|
70
87
|
variant: 'solid'
|
|
71
88
|
};
|
|
89
|
+
var parts = ['container', 'icon', 'text'];
|
|
72
90
|
var sizes = {
|
|
73
91
|
xs: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
92
|
+
container: {
|
|
93
|
+
fontSize: 'sm',
|
|
94
|
+
h: 24,
|
|
95
|
+
minW: 48,
|
|
96
|
+
spaceX: 4
|
|
97
|
+
},
|
|
98
|
+
icon: {
|
|
99
|
+
size: 'xs'
|
|
100
|
+
},
|
|
101
|
+
text: {}
|
|
79
102
|
},
|
|
80
103
|
sm: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
104
|
+
container: {
|
|
105
|
+
fontSize: 'sm',
|
|
106
|
+
h: 32,
|
|
107
|
+
minW: 64,
|
|
108
|
+
spaceX: 6
|
|
109
|
+
},
|
|
110
|
+
icon: {
|
|
111
|
+
size: 'sm'
|
|
112
|
+
},
|
|
113
|
+
text: {}
|
|
86
114
|
},
|
|
87
115
|
md: {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
116
|
+
container: {
|
|
117
|
+
fontSize: 'md',
|
|
118
|
+
h: 40,
|
|
119
|
+
minW: 80,
|
|
120
|
+
spaceX: 8
|
|
121
|
+
},
|
|
122
|
+
icon: {
|
|
123
|
+
size: 'md'
|
|
124
|
+
},
|
|
125
|
+
text: {}
|
|
93
126
|
},
|
|
94
127
|
lg: {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
128
|
+
container: {
|
|
129
|
+
fontSize: 'lg',
|
|
130
|
+
h: 48,
|
|
131
|
+
minW: 96,
|
|
132
|
+
spaceX: 10
|
|
133
|
+
},
|
|
134
|
+
icon: {
|
|
135
|
+
size: 'lg'
|
|
136
|
+
},
|
|
137
|
+
text: {}
|
|
100
138
|
}
|
|
101
139
|
};
|
|
102
140
|
var variants = {
|
|
@@ -107,6 +145,7 @@ var variants = {
|
|
|
107
145
|
};
|
|
108
146
|
exports.default = {
|
|
109
147
|
defaultProps: defaultProps,
|
|
148
|
+
parts: parts,
|
|
110
149
|
sizes: sizes,
|
|
111
150
|
variants: variants
|
|
112
151
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ButtonGroupProps } from './buttonGroup.types';
|
|
2
2
|
import { SystemProps } from '../system';
|
|
3
|
-
export declare const ButtonGroupBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, SystemProps
|
|
3
|
+
export declare const ButtonGroupBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, SystemProps & {
|
|
4
|
+
innerBorderColor: string;
|
|
5
|
+
}, never>;
|
|
4
6
|
export declare const ButtonGroup: import("../core").VuiComponent<"div", ButtonGroupProps>;
|
|
5
7
|
export default ButtonGroup;
|
|
@@ -52,12 +52,14 @@ exports.ButtonGroup = exports.ButtonGroupBase = void 0;
|
|
|
52
52
|
var react_1 = __importStar(require("react"));
|
|
53
53
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
54
54
|
var context_1 = require("./context");
|
|
55
|
+
var helpers_1 = require("./helpers");
|
|
55
56
|
var core_1 = require("../core");
|
|
56
57
|
var system_1 = require("../system");
|
|
57
58
|
var utils_1 = require("../utils");
|
|
58
|
-
exports.ButtonGroupBase = styled_components_1.default.div.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\n\t// First Button\n\t> *:first-of-type:not(:last-of-type) {\n\t\tborder-bottom-right-radius: 0;\n\t\tborder-right-width: 1px;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t// Middle Buttons\n\t> *:not(:first-of-type):not(:last-of-type) {\n\t\tborder-left-width: 0px;\n\t\tborder-radius: 0;\n\t\tborder-right-width: 1px;\n\t}\n\n\t// Last Button\n\t> *:not(:first-of-type):last-of-type {\n\t\tborder-bottom-left-radius: 0;\n\t\tborder-left-width: 0px;\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t", "\n"], ["\n\tdisplay: flex;\n\n\t// First Button\n\t> *:first-of-type:not(:last-of-type) {\n\t\tborder-bottom-right-radius: 0;\n\t\tborder-right-width: 1px;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t// Middle Buttons\n\t> *:not(:first-of-type):not(:last-of-type) {\n\t\tborder-left-width: 0px;\n\t\tborder-radius: 0;\n\t\tborder-right-width: 1px;\n\t}\n\n\t// Last Button\n\t> *:not(:first-of-type):last-of-type {\n\t\tborder-bottom-left-radius: 0;\n\t\tborder-left-width: 0px;\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t", "\n"])), system_1.system);
|
|
59
|
+
exports.ButtonGroupBase = styled_components_1.default.div.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\n\t// Border color between Buttons\n\t> *:not(:last-of-type):not(:disabled):not(:focus) {\n\t\tborder-right-color: ", ";\n\t}\n\n\t// First Button\n\t> *:first-of-type:not(:last-of-type) {\n\t\tborder-bottom-right-radius: 0;\n\t\tborder-right-width: 1px;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t// Middle Buttons\n\t> *:not(:first-of-type):not(:last-of-type) {\n\t\tborder-left-width: 0px;\n\t\tborder-radius: 0;\n\t\tborder-right-width: 1px;\n\t}\n\n\t// Last Button\n\t> *:not(:first-of-type):last-of-type {\n\t\tborder-bottom-left-radius: 0;\n\t\tborder-left-width: 0px;\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t", "\n"], ["\n\tdisplay: flex;\n\n\t// Border color between Buttons\n\t> *:not(:last-of-type):not(:disabled):not(:focus) {\n\t\tborder-right-color: ", ";\n\t}\n\n\t// First Button\n\t> *:first-of-type:not(:last-of-type) {\n\t\tborder-bottom-right-radius: 0;\n\t\tborder-right-width: 1px;\n\t\tborder-top-right-radius: 0;\n\t}\n\n\t// Middle Buttons\n\t> *:not(:first-of-type):not(:last-of-type) {\n\t\tborder-left-width: 0px;\n\t\tborder-radius: 0;\n\t\tborder-right-width: 1px;\n\t}\n\n\t// Last Button\n\t> *:not(:first-of-type):last-of-type {\n\t\tborder-bottom-left-radius: 0;\n\t\tborder-left-width: 0px;\n\t\tborder-top-left-radius: 0;\n\t}\n\n\t", "\n"])), function (p) { return core_1.th.color(p.innerBorderColor); }, system_1.system);
|
|
59
60
|
exports.ButtonGroup = core_1.vui(function (props, ref) {
|
|
60
61
|
var className = props.className, colorScheme = props.colorScheme, disabled = props.disabled, size = props.size, variant = props.variant, rest = __rest(props, ["className", "colorScheme", "disabled", "size", "variant"]);
|
|
62
|
+
var innerBorderColor = helpers_1.getInnerBorderColor(props);
|
|
61
63
|
var context = react_1.useMemo(function () { return utils_1.filterUndefined({ colorScheme: colorScheme, disabled: disabled, size: size, variant: variant }); }, [
|
|
62
64
|
colorScheme,
|
|
63
65
|
disabled,
|
|
@@ -65,7 +67,7 @@ exports.ButtonGroup = core_1.vui(function (props, ref) {
|
|
|
65
67
|
variant
|
|
66
68
|
]);
|
|
67
69
|
return (react_1.default.createElement(context_1.ButtonGroupProvider, { value: context },
|
|
68
|
-
react_1.default.createElement(exports.ButtonGroupBase, __assign({ className: utils_1.cs('vui-buttonGroup', className), ref: ref }, rest))));
|
|
70
|
+
react_1.default.createElement(exports.ButtonGroupBase, __assign({ className: utils_1.cs('vui-buttonGroup', className) }, { innerBorderColor: innerBorderColor, ref: ref }, rest))));
|
|
69
71
|
});
|
|
70
72
|
exports.ButtonGroup.displayName = 'ButtonGroup';
|
|
71
73
|
exports.default = exports.ButtonGroup;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.useButtonGroup = exports.ButtonGroupProvider = void 0;
|
|
20
|
+
var core_1 = require("../core");
|
|
21
|
+
var _a = __read(core_1.createContext({ isOptional: true }), 2), ButtonGroupProvider = _a[0], useButtonGroup = _a[1];
|
|
22
|
+
exports.ButtonGroupProvider = ButtonGroupProvider;
|
|
23
|
+
exports.useButtonGroup = useButtonGroup;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInnerBorderColor = void 0;
|
|
4
|
+
/** Returns appropriate color for the border between the buttons */
|
|
5
|
+
function getInnerBorderColor(props) {
|
|
6
|
+
var _a = props.colorScheme, colorScheme = _a === void 0 ? 'prussian' : _a, _b = props.variant, variant = _b === void 0 ? 'solid' : _b;
|
|
7
|
+
var shade = variant === 'solid' ? '100' : '80';
|
|
8
|
+
return colorScheme + "." + shade;
|
|
9
|
+
}
|
|
10
|
+
exports.getInnerBorderColor = getInnerBorderColor;
|
|
@@ -14,12 +14,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.default = void 0;
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./alertButton"), exports);
|
|
20
|
-
__exportStar(require("./alertIcon"), exports);
|
|
21
|
-
__exportStar(require("./alertText"), exports);
|
|
22
|
-
__exportStar(require("./alertTitle"), exports);
|
|
17
|
+
__exportStar(require("./buttonGroup"), exports);
|
|
18
|
+
__exportStar(require("./buttonGroup.types"), exports);
|
|
23
19
|
__exportStar(require("./context"), exports);
|
|
24
|
-
var
|
|
25
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(
|
|
20
|
+
var buttonGroup_1 = require("./buttonGroup");
|
|
21
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(buttonGroup_1).default; } });
|
package/card/card.d.ts
ADDED
|
@@ -25,22 +25,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.
|
|
28
|
+
exports.Card = void 0;
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var box_1 = __importDefault(require("../box"));
|
|
31
31
|
var core_1 = require("../core");
|
|
32
32
|
var utils_1 = require("../utils");
|
|
33
|
-
exports.
|
|
33
|
+
exports.Card = core_1.vui(function (props, ref) {
|
|
34
34
|
var _a = core_1.omitThemingProps(props), className = _a.className, _b = _a.isInteractive, isInteractive = _b === void 0 ? props.onClick !== undefined : _b, rest = __rest(_a, ["className", "isInteractive"]);
|
|
35
|
-
var
|
|
35
|
+
var styles = core_1.useStyleConfig('Card', props);
|
|
36
36
|
var interactiveProps = isInteractive
|
|
37
37
|
? {
|
|
38
38
|
cursor: 'pointer',
|
|
39
|
-
|
|
39
|
+
hoverRingColor: 'prussian.80',
|
|
40
|
+
hoverShadow: '4',
|
|
40
41
|
userSelect: 'none'
|
|
41
42
|
}
|
|
42
43
|
: {};
|
|
43
|
-
return react_1.default.createElement(box_1.default, __assign({ className: utils_1.cs('vui-
|
|
44
|
+
return (react_1.default.createElement(box_1.default, __assign({ bg: "white", borderRadius: "md", className: utils_1.cs('vui-card', className), ref: ref, ring: 1, ringColor: "transparent", shadow: "2" }, styles, interactiveProps, rest)));
|
|
44
45
|
});
|
|
45
|
-
exports.
|
|
46
|
-
exports.default = exports.
|
|
46
|
+
exports.Card.displayName = 'Card';
|
|
47
|
+
exports.default = exports.Card;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BoxProps } from '../box';
|
|
2
2
|
import { ThemingProps } from '../theme';
|
|
3
|
-
export interface
|
|
3
|
+
export interface CardProps extends Omit<BoxProps, 'size' | 'variant'>, ThemingProps<'Card'> {
|
|
4
4
|
isInteractive?: boolean;
|
|
5
5
|
}
|
package/card/index.d.ts
ADDED
package/{tile → card}/index.js
RENAMED
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.default = void 0;
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
var
|
|
20
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(
|
|
17
|
+
__exportStar(require("./card"), exports);
|
|
18
|
+
__exportStar(require("./card.types"), exports);
|
|
19
|
+
var card_1 = require("./card");
|
|
20
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(card_1).default; } });
|
package/card/theme.d.ts
ADDED
package/card/theme.js
ADDED
package/checkbox/checkbox.js
CHANGED
|
@@ -79,7 +79,7 @@ exports.CheckboxControl = styled_components_1.default.span.withConfig(core_1.for
|
|
|
79
79
|
exports.Checkbox = core_1.vui(function (props, ref) {
|
|
80
80
|
var checkboxGroupProps = context_1.useCheckboxGroup();
|
|
81
81
|
var mergedProps = __assign(__assign({}, checkboxGroupProps), props);
|
|
82
|
-
var _a = core_1.omitThemingProps(mergedProps), checked = _a.checked, children = _a.children, className = _a.className, defaultChecked = _a.defaultChecked, disabled = _a.disabled, _b = _a.icon, iconProp = _b === void 0 ? 'cuiCheckboxUnselected' : _b, _c = _a.iconChecked, iconChecked = _c === void 0 ? 'cuiCheckboxSelected' : _c, _d = _a.iconIndeterminate, iconIndeterminate = _d === void 0 ? 'cuiCheckboxIndeterminate' : _d, inputProps = _a.inputProps, inputRef = _a.inputRef, isIndeterminate = _a.isIndeterminate, label = _a.label, name = _a.name, onChange = _a.onChange, required = _a.required, value = _a.value, rest = __rest(_a, ["checked", "children", "className", "defaultChecked", "disabled", "icon", "iconChecked", "iconIndeterminate", "inputProps", "inputRef", "isIndeterminate", "label", "name", "onChange", "required", "value"]);
|
|
82
|
+
var _a = core_1.omitThemingProps(mergedProps), checked = _a.checked, children = _a.children, className = _a.className, defaultChecked = _a.defaultChecked, disabled = _a.disabled, _b = _a.icon, iconProp = _b === void 0 ? 'cuiCheckboxUnselected' : _b, _c = _a.iconChecked, iconChecked = _c === void 0 ? 'cuiCheckboxSelected' : _c, _d = _a.iconIndeterminate, iconIndeterminate = _d === void 0 ? 'cuiCheckboxIndeterminate' : _d, id = _a.id, inputProps = _a.inputProps, inputRef = _a.inputRef, isIndeterminate = _a.isIndeterminate, label = _a.label, name = _a.name, onChange = _a.onChange, required = _a.required, value = _a.value, rest = __rest(_a, ["checked", "children", "className", "defaultChecked", "disabled", "icon", "iconChecked", "iconIndeterminate", "id", "inputProps", "inputRef", "isIndeterminate", "label", "name", "onChange", "required", "value"]);
|
|
83
83
|
var _e = __read(react_1.useState(defaultChecked), 2), isChecked = _e[0], setIsChecked = _e[1];
|
|
84
84
|
var styles = core_1.useStyleConfig('Checkbox', mergedProps);
|
|
85
85
|
var _f = styles.control, controlColor = _f.color, hoverColor = _f.hoverColor, controlStyles = __rest(_f, ["color", "hoverColor"]);
|
|
@@ -89,7 +89,7 @@ exports.Checkbox = core_1.vui(function (props, ref) {
|
|
|
89
89
|
var isFilled = isChecked || isIndeterminate;
|
|
90
90
|
var icon = isIndeterminate ? iconIndeterminate : isChecked ? iconChecked : iconProp;
|
|
91
91
|
var controlMr = children || label ? 1 : 0;
|
|
92
|
-
var color = isFilled ? controlColor : 'grey.
|
|
92
|
+
var color = isFilled ? controlColor : 'grey.60';
|
|
93
93
|
var controlHoverColor = isFilled ? hoverColor : 'grey.90';
|
|
94
94
|
function handleOnChange(e) {
|
|
95
95
|
setIsChecked(e.target.checked);
|
|
@@ -97,8 +97,8 @@ exports.Checkbox = core_1.vui(function (props, ref) {
|
|
|
97
97
|
}
|
|
98
98
|
return (react_1.default.createElement(exports.CheckboxBase, __assign({ className: utils_1.cs('vui-checkbox', disabled && 'disabled', className), controlHoverColor: controlHoverColor, ref: ref }, styles.container, rest),
|
|
99
99
|
react_1.default.createElement(exports.CheckboxControl, __assign({ borderRadius: "sm", className: "vui-checkboxControl", color: color, focusWithinRing: 3, mr: controlMr, transitionDuration: "fast" }, controlStyles),
|
|
100
|
-
react_1.default.createElement(exports.CheckboxInput, __assign({ className: "vui-checkboxInput", onChange: handleOnChange, ref: inputRef, type: "checkbox" }, { checked: checked, defaultChecked: defaultChecked, disabled: disabled, name: name, required: required, value: value }, inputProps)),
|
|
101
|
-
react_1.default.createElement(icon_1.default, { className: "vui-checkboxIcon", h: "100%",
|
|
100
|
+
react_1.default.createElement(exports.CheckboxInput, __assign({ className: "vui-checkboxInput", onChange: handleOnChange, ref: inputRef, type: "checkbox" }, { checked: checked, defaultChecked: defaultChecked, disabled: disabled, id: id, name: name, required: required, value: value }, inputProps)),
|
|
101
|
+
react_1.default.createElement(icon_1.default, { className: "vui-checkboxIcon", h: "100%", name: icon, w: "100%" })), children !== null && children !== void 0 ? children : (label && (react_1.default.createElement(t_1.default, __assign({ className: "vui-checkboxLabel", lineHeight: "normal" }, styles.label), label)))));
|
|
102
102
|
});
|
|
103
103
|
exports.Checkbox.displayName = 'Checkbox';
|
|
104
104
|
exports.default = exports.Checkbox;
|
|
@@ -5,7 +5,7 @@ import { SystemProps } from '../system';
|
|
|
5
5
|
import { ThemingProps } from '../theme';
|
|
6
6
|
export interface CheckboxProps extends SystemProps, ThemingProps<'Checkbox'> {
|
|
7
7
|
checked?: boolean;
|
|
8
|
-
colorScheme?: 'blue' | '
|
|
8
|
+
colorScheme?: 'blue' | 'prussian';
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
icon?: IconProp;
|
|
11
11
|
iconChecked?: IconProp;
|
|
@@ -2,7 +2,7 @@ import { ChangeEventHandler, FocusEventHandler } from '../core';
|
|
|
2
2
|
import { SystemProps } from '../system';
|
|
3
3
|
import { ThemingProps } from '../theme';
|
|
4
4
|
export interface CheckboxGroupProps extends SystemProps, ThemingProps<'Checkbox'> {
|
|
5
|
-
colorScheme?: 'blue' | '
|
|
5
|
+
colorScheme?: 'blue' | 'prussian';
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
name?: string;
|
|
8
8
|
onBlur?: FocusEventHandler;
|
package/core/globalStyle.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare type GlobalStyleProps = {
|
|
2
|
+
globalStyle?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import("styled-components").GlobalStyleComponent<GlobalStyleProps, import("styled-components").DefaultTheme>;
|
|
2
5
|
export default _default;
|
package/core/globalStyle.js
CHANGED
|
@@ -38,13 +38,17 @@ var styled_components_1 = require("styled-components");
|
|
|
38
38
|
var foundations_1 = __importDefault(require("../theme/foundations"));
|
|
39
39
|
var styles_1 = require("../styles");
|
|
40
40
|
var utils_1 = require("../utils");
|
|
41
|
-
exports.default = styled_components_1.createGlobalStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n\n\t:root {\n\t\t", "\n\n\t\t--vui-colors-disabled-bg: var(--vui-colors-grey-10);\n\t\t--vui-colors-disabled-border: var(--vui-colors-grey-50);\n\t\t--vui-colors-disabled-font: var(--vui-colors-grey-50);\n\t}\n\n\t* {\n\t\t--x-ring-color: var(--vui-colors-blue-50);\n\t\t--x-shadow: 0 0 0 0 transparent;\n\t}\n\n\
|
|
41
|
+
exports.default = styled_components_1.createGlobalStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n\n\t:root {\n\t\t", "\n\n\t\t--vui-colors-disabled-bg: var(--vui-colors-grey-10);\n\t\t--vui-colors-disabled-border: var(--vui-colors-grey-50);\n\t\t--vui-colors-disabled-font: var(--vui-colors-grey-50);\n\t}\n\n\t* {\n\t\t--x-ring-color: var(--vui-colors-blue-50);\n\t\t--x-shadow: 0 0 0 0 transparent;\n\t}\n\n\t", "\n\n\t@keyframes vui-bounce {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeDown {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeIn {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeLeft {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeOut {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeRight {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeUp {\n\t\t", "\n\t}\n\n\t@keyframes vui-pulse {\n\t\t", "\n\t}\n\n\t@keyframes vui-spin {\n\t\t", "\n\t}\n"], ["\n\t", "\n\n\t:root {\n\t\t", "\n\n\t\t--vui-colors-disabled-bg: var(--vui-colors-grey-10);\n\t\t--vui-colors-disabled-border: var(--vui-colors-grey-50);\n\t\t--vui-colors-disabled-font: var(--vui-colors-grey-50);\n\t}\n\n\t* {\n\t\t--x-ring-color: var(--vui-colors-blue-50);\n\t\t--x-shadow: 0 0 0 0 transparent;\n\t}\n\n\t",
|
|
42
|
+
"\n\n\t@keyframes vui-bounce {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeDown {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeIn {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeLeft {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeOut {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeRight {\n\t\t", "\n\t}\n\n\t@keyframes vui-fadeUp {\n\t\t", "\n\t}\n\n\t@keyframes vui-pulse {\n\t\t", "\n\t}\n\n\t@keyframes vui-spin {\n\t\t", "\n\t}\n"
|
|
42
43
|
/** Recursively maps through all theme styles and generates a set of CSS properties */
|
|
43
|
-
])), styles_1.fontFaces, generateCSSVariables,
|
|
44
|
+
])), styles_1.fontFaces, generateCSSVariables, function (p) {
|
|
45
|
+
return p.globalStyle &&
|
|
46
|
+
"\n\t\tbody {\n\t\t\tcolor: var(--vui-colors-prussian-80);\n\t\t\tfont-family: var(--vui-fonts-avenir);\n\t\t\tfont-size: var(--vui-fontSizes-md);\n\t\t}\n\t";
|
|
47
|
+
}, styles_1.bounce, styles_1.fadeDown, styles_1.fadeIn, styles_1.fadeLeft, styles_1.fadeOut, styles_1.fadeRight, styles_1.fadeUp, styles_1.pulse, styles_1.spin);
|
|
44
48
|
/** Recursively maps through all theme styles and generates a set of CSS properties */
|
|
45
49
|
function generateCSSVariables() {
|
|
46
50
|
function computeStyle(name, value) {
|
|
47
|
-
if (!utils_1.
|
|
51
|
+
if (!utils_1.isObject(value))
|
|
48
52
|
return name + ": " + (typeof value === 'string' ? value : value + "px") + ";\n";
|
|
49
53
|
return Object.entries(value).reduce(function (str, _a) {
|
|
50
54
|
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
package/core/index.d.ts
CHANGED
|
@@ -3,4 +3,6 @@ export * from './types';
|
|
|
3
3
|
export * from './utils';
|
|
4
4
|
export { default as GlobalStyle } from './globalStyle';
|
|
5
5
|
export { default as ResetCSS } from './resetCSS';
|
|
6
|
+
export { default as styled } from './styled';
|
|
7
|
+
export { default as v } from './v';
|
|
6
8
|
export { default as VuiProvider } from './vuiProvider';
|
package/core/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.VuiProvider = exports.ResetCSS = exports.GlobalStyle = void 0;
|
|
16
|
+
exports.VuiProvider = exports.v = exports.styled = exports.ResetCSS = exports.GlobalStyle = void 0;
|
|
17
17
|
__exportStar(require("./consts"), exports);
|
|
18
18
|
__exportStar(require("./types"), exports);
|
|
19
19
|
__exportStar(require("./utils"), exports);
|
|
@@ -21,5 +21,9 @@ var globalStyle_1 = require("./globalStyle");
|
|
|
21
21
|
Object.defineProperty(exports, "GlobalStyle", { enumerable: true, get: function () { return __importDefault(globalStyle_1).default; } });
|
|
22
22
|
var resetCSS_1 = require("./resetCSS");
|
|
23
23
|
Object.defineProperty(exports, "ResetCSS", { enumerable: true, get: function () { return __importDefault(resetCSS_1).default; } });
|
|
24
|
+
var styled_1 = require("./styled");
|
|
25
|
+
Object.defineProperty(exports, "styled", { enumerable: true, get: function () { return __importDefault(styled_1).default; } });
|
|
26
|
+
var v_1 = require("./v");
|
|
27
|
+
Object.defineProperty(exports, "v", { enumerable: true, get: function () { return __importDefault(v_1).default; } });
|
|
24
28
|
var vuiProvider_1 = require("./vuiProvider");
|
|
25
29
|
Object.defineProperty(exports, "VuiProvider", { enumerable: true, get: function () { return __importDefault(vuiProvider_1).default; } });
|
package/core/styled.d.ts
ADDED
package/core/styled.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
4
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
5
|
+
return cooked;
|
|
6
|
+
};
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
27
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
28
|
+
if (!m) return o;
|
|
29
|
+
var i = m.call(o), r, ar = [], e;
|
|
30
|
+
try {
|
|
31
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
32
|
+
}
|
|
33
|
+
catch (error) { e = { error: error }; }
|
|
34
|
+
finally {
|
|
35
|
+
try {
|
|
36
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
37
|
+
}
|
|
38
|
+
finally { if (e) throw e.error; }
|
|
39
|
+
}
|
|
40
|
+
return ar;
|
|
41
|
+
};
|
|
42
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
43
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
44
|
+
to[j] = from[i];
|
|
45
|
+
return to;
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
49
|
+
var utils_1 = require("./utils");
|
|
50
|
+
var system_1 = require("../system");
|
|
51
|
+
function createStyled(generator) {
|
|
52
|
+
var config = generator ? utils_1.forwardPropConfig(generator) : {};
|
|
53
|
+
var styled = (function (component) {
|
|
54
|
+
var baseStyled = config ? styled_components_1.default(component).withConfig(config) : styled_components_1.default(component);
|
|
55
|
+
return getCreateStyle(baseStyled, styled_components_1.css, generator);
|
|
56
|
+
});
|
|
57
|
+
Object.keys(styled_components_1.default).forEach(function (key) {
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
styled[key] = styled(key);
|
|
60
|
+
});
|
|
61
|
+
return styled;
|
|
62
|
+
}
|
|
63
|
+
function getCreateStyle(baseCreateStyle, css, generator) {
|
|
64
|
+
var createStyle = function () {
|
|
65
|
+
var args = [];
|
|
66
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
67
|
+
args[_i] = arguments[_i];
|
|
68
|
+
}
|
|
69
|
+
return baseCreateStyle(templateObject_1 || (templateObject_1 = __makeTemplateObject(["", "", ""], ["", "", ""])), css.apply(void 0, __spreadArray([], __read(args))), generator);
|
|
70
|
+
};
|
|
71
|
+
createStyle.attrs = function (attrs) {
|
|
72
|
+
return getCreateStyle(baseCreateStyle.attrs(attrs), css, generator);
|
|
73
|
+
};
|
|
74
|
+
createStyle.withConfig = function (config) {
|
|
75
|
+
return getCreateStyle(baseCreateStyle.withConfig(config), css, generator);
|
|
76
|
+
};
|
|
77
|
+
return createStyle;
|
|
78
|
+
}
|
|
79
|
+
exports.default = createStyled(system_1.system);
|
|
80
|
+
var templateObject_1;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentPropsWithRef, ElementType, PropsWithoutRef, PropsWithChildren, ReactElement } from 'react';
|
|
2
2
|
/** Merges component/element base props and custom props */
|
|
3
|
-
export declare type PropsOf<C extends
|
|
3
|
+
export declare type PropsOf<C extends ElementType, Props = {}> = RightJoinProps<ComponentPropsWithoutRef<C>, Props>;
|
|
4
4
|
/** Merges component/element base props and custom props including ref */
|
|
5
|
-
export declare type RefPropsOf<C extends
|
|
5
|
+
export declare type RefPropsOf<C extends ElementType, Props = {}> = RightJoinProps<ComponentPropsWithRef<C>, Props>;
|
|
6
6
|
/** Merges props definitions, overriding source keys */
|
|
7
|
-
export declare type RightJoinProps<SourceProps, OverrideProps> =
|
|
7
|
+
export declare type RightJoinProps<SourceProps, OverrideProps> = Omit<SourceProps, keyof OverrideProps> & OverrideProps;
|
|
8
8
|
/** VUI component interface, which allows element props inference and extension, 'as' and 'ref' */
|
|
9
|
-
export interface VuiComponent<C extends
|
|
10
|
-
<AsC extends
|
|
9
|
+
export interface VuiComponent<C extends ElementType, Props = {}> {
|
|
10
|
+
<AsC extends ElementType>(props: PropsWithChildren<RefPropsOf<AsC, PropsOf<C, Props>>> & {
|
|
11
11
|
as: AsC;
|
|
12
|
-
}):
|
|
13
|
-
(props: RefPropsOf<C, Props>):
|
|
12
|
+
}): ReactElement<any, any> | null;
|
|
13
|
+
(props: RefPropsOf<C, Props>): ReactElement<any, any> | null;
|
|
14
14
|
defaultProps?: Partial<PropsOf<C, Props>>;
|
|
15
15
|
displayName?: string;
|
|
16
16
|
}
|
|
17
17
|
/** Config for VUI component creator helper, which allows toggling memoization and 'areEqual' function */
|
|
18
|
-
export interface VuiComponentConfig<C extends
|
|
18
|
+
export interface VuiComponentConfig<C extends ElementType, Props = {}> {
|
|
19
19
|
isMemo?: boolean;
|
|
20
|
-
memoCompare?: (prevProps: Readonly<
|
|
20
|
+
memoCompare?: (prevProps: Readonly<PropsWithChildren<PropsWithoutRef<PropsOf<C, Props>>>>, nextProps: Readonly<PropsWithChildren<PropsWithoutRef<PropsOf<C, Props>>>>) => boolean;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Simpler VUI component interface, which allows element props inference and extension
|
|
24
24
|
* Does not support 'as' or 'ref'
|
|
25
25
|
*/
|
|
26
|
-
export interface VC<C extends
|
|
27
|
-
(props: PropsOf<C, Props>):
|
|
26
|
+
export interface VC<C extends ElementType, Props = {}> {
|
|
27
|
+
(props: PropsOf<C, Props>): ReactElement<any, any> | null;
|
|
28
28
|
defaultProps?: Partial<PropsOf<C, Props>>;
|
|
29
29
|
displayName?: string;
|
|
30
30
|
}
|