@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/switch/theme.js
CHANGED
|
@@ -1,109 +1,87 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function sizeLg(
|
|
4
|
-
var
|
|
3
|
+
function sizeLg() {
|
|
4
|
+
var container = {};
|
|
5
5
|
var button = {
|
|
6
|
-
fontSize: 'md'
|
|
6
|
+
fontSize: 'md',
|
|
7
|
+
minW: 50,
|
|
8
|
+
thumb: {
|
|
9
|
+
h: 24,
|
|
10
|
+
w: 24
|
|
11
|
+
},
|
|
12
|
+
track: {
|
|
13
|
+
h: 28
|
|
14
|
+
}
|
|
7
15
|
};
|
|
8
16
|
var label = {
|
|
9
17
|
size: 'lg'
|
|
10
18
|
};
|
|
11
|
-
|
|
12
|
-
h: 24,
|
|
13
|
-
w: 24
|
|
14
|
-
};
|
|
15
|
-
var track = {
|
|
16
|
-
h: 28,
|
|
17
|
-
minW: 50
|
|
18
|
-
};
|
|
19
|
-
if (variant === 'thin') {
|
|
20
|
-
track.h = 18;
|
|
21
|
-
track.minW = 40;
|
|
22
|
-
}
|
|
23
|
-
return { button: button, label: label, thumb: thumb, track: track };
|
|
19
|
+
return { container: container, button: button, label: label };
|
|
24
20
|
}
|
|
25
|
-
function sizeMd(
|
|
26
|
-
var
|
|
21
|
+
function sizeMd() {
|
|
22
|
+
var container = {};
|
|
27
23
|
var button = {
|
|
28
|
-
fontSize: 'sm'
|
|
24
|
+
fontSize: 'sm',
|
|
25
|
+
minW: 42,
|
|
26
|
+
thumb: {
|
|
27
|
+
h: 20,
|
|
28
|
+
w: 20
|
|
29
|
+
},
|
|
30
|
+
track: {
|
|
31
|
+
h: 24
|
|
32
|
+
}
|
|
29
33
|
};
|
|
30
34
|
var label = {
|
|
31
35
|
size: 'md'
|
|
32
36
|
};
|
|
33
|
-
|
|
34
|
-
h: 20,
|
|
35
|
-
w: 20
|
|
36
|
-
};
|
|
37
|
-
var track = {
|
|
38
|
-
h: 24,
|
|
39
|
-
minW: 42
|
|
40
|
-
};
|
|
41
|
-
if (variant === 'thin') {
|
|
42
|
-
track.h = 14;
|
|
43
|
-
track.minW = 32;
|
|
44
|
-
}
|
|
45
|
-
return { button: button, label: label, thumb: thumb, track: track };
|
|
37
|
+
return { container: container, button: button, label: label };
|
|
46
38
|
}
|
|
47
|
-
function sizeSm(
|
|
48
|
-
var
|
|
39
|
+
function sizeSm() {
|
|
40
|
+
var container = {};
|
|
49
41
|
var button = {
|
|
50
|
-
fontSize: 'xs'
|
|
42
|
+
fontSize: 'xs',
|
|
43
|
+
minW: 34,
|
|
44
|
+
thumb: {
|
|
45
|
+
h: 16,
|
|
46
|
+
w: 16
|
|
47
|
+
},
|
|
48
|
+
track: {
|
|
49
|
+
h: 20
|
|
50
|
+
}
|
|
51
51
|
};
|
|
52
52
|
var label = {
|
|
53
53
|
size: 'sm'
|
|
54
54
|
};
|
|
55
|
-
|
|
56
|
-
h: 16,
|
|
57
|
-
w: 16
|
|
58
|
-
};
|
|
59
|
-
var track = {
|
|
60
|
-
h: 20,
|
|
61
|
-
minW: 34
|
|
62
|
-
};
|
|
63
|
-
if (variant === 'thin') {
|
|
64
|
-
track.h = 10;
|
|
65
|
-
track.minW = 24;
|
|
66
|
-
}
|
|
67
|
-
return { button: button, label: label, thumb: thumb, track: track };
|
|
55
|
+
return { container: container, button: button, label: label };
|
|
68
56
|
}
|
|
69
57
|
function variantContained(props) {
|
|
70
58
|
var c = props.colorScheme;
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
bg: 'white',
|
|
84
|
-
borderColor: c + ".80",
|
|
85
|
-
borderWidth: 1,
|
|
86
|
-
ring: 3
|
|
87
|
-
};
|
|
88
|
-
var track = {
|
|
89
|
-
bg: c + ".80"
|
|
90
|
-
};
|
|
91
|
-
return { thumb: thumb, track: track };
|
|
59
|
+
var container = {};
|
|
60
|
+
var button = {
|
|
61
|
+
thumb: {
|
|
62
|
+
bg: 'white'
|
|
63
|
+
},
|
|
64
|
+
track: {
|
|
65
|
+
bg: c + ".80",
|
|
66
|
+
ring: 3
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var label = {};
|
|
70
|
+
return { container: container, button: button, label: label };
|
|
92
71
|
}
|
|
93
72
|
var defaultProps = {
|
|
94
73
|
colorScheme: 'blue',
|
|
95
74
|
size: 'md',
|
|
96
75
|
variant: 'contained'
|
|
97
76
|
};
|
|
98
|
-
var parts = ['container', 'button', 'label'
|
|
77
|
+
var parts = ['container', 'button', 'label'];
|
|
99
78
|
var sizes = {
|
|
100
79
|
sm: sizeSm,
|
|
101
80
|
md: sizeMd,
|
|
102
81
|
lg: sizeLg
|
|
103
82
|
};
|
|
104
83
|
var variants = {
|
|
105
|
-
contained: variantContained
|
|
106
|
-
thin: variantThin
|
|
84
|
+
contained: variantContained
|
|
107
85
|
};
|
|
108
86
|
exports.default = {
|
|
109
87
|
defaultProps: defaultProps,
|
package/system/borders.d.ts
CHANGED
|
@@ -77,7 +77,7 @@ export interface BorderStyleProps {
|
|
|
77
77
|
borderStyle?: BorderStyleProp;
|
|
78
78
|
hoverBorderStyle?: BorderStyleProp;
|
|
79
79
|
}
|
|
80
|
-
declare type BorderRadiusProp = SystemProp<RadiusGetter, VuiTheme>;
|
|
80
|
+
export declare type BorderRadiusProp = SystemProp<RadiusGetter, VuiTheme>;
|
|
81
81
|
export interface BorderRadiusProps {
|
|
82
82
|
borderRadius?: BorderRadiusProp;
|
|
83
83
|
hoverBorderRadius?: BorderRadiusProp;
|
|
@@ -129,6 +129,7 @@ export interface RingProps {
|
|
|
129
129
|
focusRing?: RingProp;
|
|
130
130
|
focusVisibleRing?: RingProp;
|
|
131
131
|
focusWithinRing?: RingProp;
|
|
132
|
+
hoverRing?: RingProp;
|
|
132
133
|
}
|
|
133
134
|
declare type RingColorProp = SystemProp<ColorGetter, VuiTheme>;
|
|
134
135
|
export interface RingColorProps {
|
|
@@ -136,6 +137,7 @@ export interface RingColorProps {
|
|
|
136
137
|
focusRingColor?: RingColorProp;
|
|
137
138
|
focusVisibleRingColor?: RingColorProp;
|
|
138
139
|
focusWithinRingColor?: RingColorProp;
|
|
140
|
+
hoverRingColor?: RingColorProp;
|
|
139
141
|
}
|
|
140
142
|
export interface BordersProps extends BorderProps, BorderTopProps, BorderRightProps, BorderBottomProps, BorderLeftProps, BorderColorProps, BorderTopColorProps, BorderRightColorProps, BorderBottomColorProps, BorderLeftColorProps, BorderWidthProps, BorderTopWidthProps, BorderRightWidthProps, BorderBottomWidthProps, BorderLeftWidthProps, BorderStyleProps, BorderRadiusProps, OutlineProps, OutlineColorProps, OutlineWidthProps, OutlineStyleProps, DivideXProps, DivideYProps, DivideXReverseProps, DivideYReverseProps, DivideColorProps, DivideStyleProps, RingProps, RingColorProps {
|
|
141
143
|
}
|
package/system/custom.d.ts
CHANGED
|
@@ -1,14 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
maxLines?: number;
|
|
1
|
+
import { BorderRadiusProp } from './borders';
|
|
2
|
+
export interface BorderRadiusBottomProps {
|
|
3
|
+
borderRadiusBottom?: BorderRadiusProp;
|
|
5
4
|
}
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
5
|
+
export declare const borderRadiusBottom: import("@xstyled/system").StyleGenerator;
|
|
6
|
+
export interface BorderRadiusLeftProps {
|
|
7
|
+
borderRadiusLeft?: BorderRadiusProp;
|
|
8
|
+
}
|
|
9
|
+
export declare const borderRadiusLeft: import("@xstyled/system").StyleGenerator;
|
|
10
|
+
export interface BorderRadiusRightProps {
|
|
11
|
+
borderRadiusRight?: BorderRadiusProp;
|
|
12
|
+
}
|
|
13
|
+
export declare const borderRadiusRight: import("@xstyled/system").StyleGenerator;
|
|
14
|
+
export interface BorderRadiusTopProps {
|
|
15
|
+
borderRadiusTop?: BorderRadiusProp;
|
|
16
|
+
}
|
|
17
|
+
export declare const borderRadiusTop: import("@xstyled/system").StyleGenerator;
|
|
9
18
|
export interface IsTruncatedProps {
|
|
10
19
|
isTruncated?: boolean;
|
|
11
20
|
}
|
|
21
|
+
/** Provides styling to truncate single-line text. */
|
|
22
|
+
export declare const isTruncated: import("@xstyled/system").StyleGenerator;
|
|
23
|
+
export interface MaxLinesProps {
|
|
24
|
+
maxLines?: number;
|
|
25
|
+
}
|
|
26
|
+
/** Provides styling to truncate multi-line text. */
|
|
27
|
+
export declare const maxLines: import("@xstyled/system").StyleGenerator;
|
|
12
28
|
export declare type WordBreakProps = {
|
|
13
29
|
wordBreak?: 'normal' | 'break-all' | 'keep-all' | 'break-word';
|
|
14
30
|
};
|
|
31
|
+
export declare const wordBreak: import("@xstyled/system").StyleGenerator;
|
package/system/custom.js
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wordBreak = exports.isTruncated = exports.
|
|
3
|
+
exports.wordBreak = exports.maxLines = exports.isTruncated = exports.borderRadiusTop = exports.borderRadiusRight = exports.borderRadiusLeft = exports.borderRadiusBottom = void 0;
|
|
4
4
|
var system_1 = require("@xstyled/system");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
cssProperty:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
exports.borderRadiusBottom = system_1.style({
|
|
6
|
+
prop: 'borderRadiusBottom',
|
|
7
|
+
themeGet: system_1.getRadius,
|
|
8
|
+
cssProperty: ['borderBottomLeftRadius', 'borderBottomRightRadius']
|
|
9
|
+
});
|
|
10
|
+
exports.borderRadiusLeft = system_1.style({
|
|
11
|
+
prop: 'borderRadiusLeft',
|
|
12
|
+
themeGet: system_1.getRadius,
|
|
13
|
+
cssProperty: ['borderBottomLeftRadius', 'borderTopLeftRadius']
|
|
14
|
+
});
|
|
15
|
+
exports.borderRadiusRight = system_1.style({
|
|
16
|
+
prop: 'borderRadiusRight',
|
|
17
|
+
themeGet: system_1.getRadius,
|
|
18
|
+
cssProperty: ['borderBottomRightRadius', 'borderTopRightRadius']
|
|
19
|
+
});
|
|
20
|
+
exports.borderRadiusTop = system_1.style({
|
|
21
|
+
prop: 'borderRadiusTop',
|
|
22
|
+
themeGet: system_1.getRadius,
|
|
23
|
+
cssProperty: ['borderTopLeftRadius', 'borderTopRightRadius']
|
|
17
24
|
});
|
|
18
25
|
/** Provides styling to truncate single-line text. */
|
|
19
26
|
exports.isTruncated = system_1.style({
|
|
@@ -27,6 +34,19 @@ exports.isTruncated = system_1.style({
|
|
|
27
34
|
},
|
|
28
35
|
states: {}
|
|
29
36
|
});
|
|
37
|
+
/** Provides styling to truncate multi-line text. */
|
|
38
|
+
exports.maxLines = system_1.style({
|
|
39
|
+
prop: 'maxLines',
|
|
40
|
+
cssProperty: function (value) {
|
|
41
|
+
return {
|
|
42
|
+
display: '-webkit-box',
|
|
43
|
+
overflow: 'hidden',
|
|
44
|
+
'-webkit-line-clamp': "" + value,
|
|
45
|
+
'-webkit-box-orient': 'vertical'
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
states: {}
|
|
49
|
+
});
|
|
30
50
|
exports.wordBreak = system_1.style({
|
|
31
51
|
prop: 'wordBreak'
|
|
32
52
|
});
|
package/system/system.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import { BordersProps } from './borders';
|
|
|
4
4
|
import { EffectsProps } from './effects';
|
|
5
5
|
import { FlexboxesProps } from './flexboxes';
|
|
6
6
|
import { InteractivityProps } from './interactivity';
|
|
7
|
-
import { IsTruncatedProps, MaxLinesProps, WordBreakProps } from './custom';
|
|
7
|
+
import { BorderRadiusBottomProps, BorderRadiusLeftProps, BorderRadiusRightProps, BorderRadiusTopProps, IsTruncatedProps, MaxLinesProps, WordBreakProps } from './custom';
|
|
8
8
|
import { LayoutProps } from './layout';
|
|
9
9
|
import { SizingProps } from './sizing';
|
|
10
10
|
import { SpaceProps } from './space';
|
|
11
11
|
import { TransformsProps } from './transforms';
|
|
12
12
|
import { TransitionsProps } from './transitions';
|
|
13
13
|
import { TypographyProps } from './typography';
|
|
14
|
-
export interface SystemProps extends AnimationsProps, BackgroundColorProps, BordersProps, EffectsProps, FlexboxesProps, InteractivityProps, IsTruncatedProps, LayoutProps, MaxLinesProps, SizingProps, SpaceProps, TransformsProps, TransitionsProps, TypographyProps, WordBreakProps {
|
|
14
|
+
export interface SystemProps extends AnimationsProps, BackgroundColorProps, BordersProps, BorderRadiusBottomProps, BorderRadiusLeftProps, BorderRadiusRightProps, BorderRadiusTopProps, EffectsProps, FlexboxesProps, InteractivityProps, IsTruncatedProps, LayoutProps, MaxLinesProps, SizingProps, SpaceProps, TransformsProps, TransitionsProps, TypographyProps, WordBreakProps {
|
|
15
15
|
}
|
|
16
16
|
declare const _default: import("@xstyled/system").StyleGenerator;
|
|
17
17
|
export default _default;
|
package/system/system.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var system_1 = require("@xstyled/system");
|
|
4
4
|
var custom_1 = require("./custom");
|
|
5
|
-
exports.default = system_1.compose(system_1.animation, system_1.backgroundColor, system_1.borders, system_1.color, system_1.effects, system_1.flexboxes, system_1.interactivity, custom_1.isTruncated, system_1.layout, custom_1.maxLines, system_1.sizing, system_1.space, system_1.transforms, system_1.transitions, system_1.typography, custom_1.wordBreak);
|
|
5
|
+
exports.default = system_1.compose(system_1.animation, system_1.backgroundColor, system_1.borders, custom_1.borderRadiusBottom, custom_1.borderRadiusLeft, custom_1.borderRadiusRight, custom_1.borderRadiusTop, system_1.color, system_1.effects, system_1.flexboxes, system_1.interactivity, custom_1.isTruncated, system_1.layout, custom_1.maxLines, system_1.sizing, system_1.space, system_1.transforms, system_1.transitions, system_1.typography, custom_1.wordBreak);
|
package/t/t.types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactText } from 'react';
|
|
1
2
|
import { SystemProps, TypographyProps } from '../system';
|
|
2
3
|
import { ThemingProps } from '../theme';
|
|
3
4
|
export interface TProps extends SystemProps, ThemingProps<'T'> {
|
|
@@ -5,6 +6,6 @@ export interface TProps extends SystemProps, ThemingProps<'T'> {
|
|
|
5
6
|
casing?: TypographyProps['textTransform'];
|
|
6
7
|
centerV?: boolean;
|
|
7
8
|
decoration?: TypographyProps['textDecoration'];
|
|
8
|
-
text?:
|
|
9
|
+
text?: ReactText;
|
|
9
10
|
weight?: TypographyProps['fontWeight'];
|
|
10
11
|
}
|
package/tag/context.d.ts
ADDED
package/tag/context.js
ADDED
|
@@ -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.useTag = exports.TagProvider = void 0;
|
|
20
|
+
var core_1 = require("../core");
|
|
21
|
+
var _a = __read(core_1.createContext({ isOptional: true }), 2), TagProvider = _a[0], useTag = _a[1];
|
|
22
|
+
exports.TagProvider = TagProvider;
|
|
23
|
+
exports.useTag = useTag;
|
package/tag/index.d.ts
ADDED
package/tag/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.default = void 0;
|
|
17
|
+
__exportStar(require("./context"), exports);
|
|
18
|
+
__exportStar(require("./tag"), exports);
|
|
19
|
+
__exportStar(require("./tag.types"), exports);
|
|
20
|
+
__exportStar(require("./tagIcon"), exports);
|
|
21
|
+
__exportStar(require("./tagText"), exports);
|
|
22
|
+
var tag_1 = require("./tag");
|
|
23
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(tag_1).default; } });
|
package/tag/tag.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TagProps } from './tag.types';
|
|
2
|
+
import TagIcon from './tagIcon';
|
|
3
|
+
import TagText from './tagText';
|
|
4
|
+
import { VuiComponent } from '../core';
|
|
5
|
+
import { SystemProps } from '../system';
|
|
6
|
+
export declare const TagBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SystemProps, never>;
|
|
7
|
+
export declare const Tag: VuiComponent<"span", TagProps> & {
|
|
8
|
+
Icon: typeof TagIcon;
|
|
9
|
+
Text: typeof TagText;
|
|
10
|
+
};
|
|
11
|
+
export default Tag;
|
package/tag/tag.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __assign = (this && this.__assign) || function () {
|
|
7
|
+
__assign = Object.assign || function(t) {
|
|
8
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
+
s = arguments[i];
|
|
10
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
+
t[p] = s[p];
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
+
var t = {};
|
|
38
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
+
t[p] = s[p];
|
|
40
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
+
t[p[i]] = s[p[i]];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.Tag = exports.TagBase = void 0;
|
|
52
|
+
var react_1 = __importStar(require("react"));
|
|
53
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
54
|
+
var context_1 = require("./context");
|
|
55
|
+
var tagIcon_1 = __importDefault(require("./tagIcon"));
|
|
56
|
+
var tagText_1 = __importDefault(require("./tagText"));
|
|
57
|
+
var core_1 = require("../core");
|
|
58
|
+
var system_1 = require("../system");
|
|
59
|
+
var utils_1 = require("../utils");
|
|
60
|
+
exports.TagBase = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\tline-height: normal;\n\tposition: relative;\n\twidth: fit-content;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t}\n\n\t", "\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\tline-height: normal;\n\tposition: relative;\n\twidth: fit-content;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t}\n\n\t", "\n"])), system_1.system);
|
|
61
|
+
exports.Tag = core_1.vui(function (props, ref) {
|
|
62
|
+
var casing = props.casing, children = props.children, className = props.className, colorScheme = props.colorScheme, icon = props.icon, iconLeft = props.iconLeft, iconRight = props.iconRight, isFullWidth = props.isFullWidth, _a = props.isInteractive, isInteractive = _a === void 0 ? props.onClick !== undefined : _a, isRound = props.isRound, _b = props.isTruncated, isTruncated = _b === void 0 ? true : _b, itemLeft = props.itemLeft, itemRight = props.itemRight, size = props.size, text = props.text, variant = props.variant, weight = props.weight, rest = __rest(props, ["casing", "children", "className", "colorScheme", "icon", "iconLeft", "iconRight", "isFullWidth", "isInteractive", "isRound", "isTruncated", "itemLeft", "itemRight", "size", "text", "variant", "weight"]);
|
|
63
|
+
var styles = core_1.useStyleConfig('Tag', props);
|
|
64
|
+
var _c = styles.container, activeBg = _c.activeBg, h = _c.h, hoverBg = _c.hoverBg, _d = _c.spaceX, spaceXBase = _d === void 0 ? 0 : _d, tagStyles = __rest(_c, ["activeBg", "h", "hoverBg", "spaceX"]);
|
|
65
|
+
var context = react_1.useMemo(function () { return utils_1.filterUndefined({ colorScheme: colorScheme, size: size, variant: variant }); }, [colorScheme, size, variant]);
|
|
66
|
+
var spaceX = spaceXBase / 8;
|
|
67
|
+
var spaceXText = (spaceXBase + 4) / 8;
|
|
68
|
+
var pl = icon || itemLeft || iconLeft ? spaceX : spaceXText;
|
|
69
|
+
var pr = icon || itemRight || iconRight ? spaceX : spaceXText;
|
|
70
|
+
var interactiveProps = isInteractive
|
|
71
|
+
? {
|
|
72
|
+
cursor: 'pointer',
|
|
73
|
+
hoverBg: hoverBg,
|
|
74
|
+
activeBg: activeBg,
|
|
75
|
+
focusRing: 3,
|
|
76
|
+
tabIndex: 0,
|
|
77
|
+
userSelect: 'none'
|
|
78
|
+
}
|
|
79
|
+
: {};
|
|
80
|
+
var aliasedProps = utils_1.filterUndefined({
|
|
81
|
+
borderRadius: isRound ? h / 2 : undefined,
|
|
82
|
+
fontWeight: weight,
|
|
83
|
+
textTransform: casing,
|
|
84
|
+
w: isFullWidth ? '100%' : undefined
|
|
85
|
+
});
|
|
86
|
+
return (react_1.default.createElement(context_1.TagProvider, { value: context },
|
|
87
|
+
react_1.default.createElement(exports.TagBase, __assign({ borderRadius: "md", className: utils_1.cs('vui-tag', className), fontWeight: "medium", h: h, pl: pl, pr: pr, ref: ref, transitionDuration: "fast" }, tagStyles, interactiveProps, aliasedProps, rest),
|
|
88
|
+
utils_1.isString(icon) ? react_1.default.createElement(tagIcon_1.default, { name: icon }) : icon,
|
|
89
|
+
!icon && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
90
|
+
itemLeft,
|
|
91
|
+
utils_1.isString(iconLeft) ? react_1.default.createElement(tagIcon_1.default, { mr: spaceX, name: iconLeft }) : iconLeft, children !== null && children !== void 0 ? children : (utils_1.isReactText(text) ? react_1.default.createElement(tagText_1.default, __assign({}, { isTruncated: isTruncated, text: text })) : text),
|
|
92
|
+
utils_1.isString(iconRight) ? react_1.default.createElement(tagIcon_1.default, { ml: spaceX, name: iconRight }) : iconRight,
|
|
93
|
+
itemRight)))));
|
|
94
|
+
});
|
|
95
|
+
exports.Tag.displayName = 'Tag';
|
|
96
|
+
exports.Tag.Icon = tagIcon_1.default;
|
|
97
|
+
exports.Tag.Text = tagText_1.default;
|
|
98
|
+
exports.default = exports.Tag;
|
|
99
|
+
var templateObject_1;
|
|
@@ -2,19 +2,18 @@
|
|
|
2
2
|
import { IconProp } from '../icon';
|
|
3
3
|
import { SystemProps, TypographyProps } from '../system';
|
|
4
4
|
import { ThemingProps } from '../theme';
|
|
5
|
-
|
|
5
|
+
import { AnyElement } from '../utils';
|
|
6
|
+
export interface TagProps extends SystemProps, ThemingProps<'Tag'> {
|
|
6
7
|
casing?: TypographyProps['textTransform'];
|
|
7
8
|
colorScheme?: 'blue' | 'green' | 'grey' | 'prussian' | 'red' | 'yellow';
|
|
8
|
-
icon?: IconProp;
|
|
9
|
-
iconLeft?: IconProp;
|
|
10
|
-
iconRight?: IconProp;
|
|
11
|
-
isElevated?: boolean;
|
|
9
|
+
icon?: IconProp | AnyElement;
|
|
10
|
+
iconLeft?: IconProp | AnyElement;
|
|
11
|
+
iconRight?: IconProp | AnyElement;
|
|
12
12
|
isFullWidth?: boolean;
|
|
13
13
|
isInteractive?: boolean;
|
|
14
14
|
isRound?: boolean;
|
|
15
|
-
isSplit?: boolean;
|
|
16
15
|
itemLeft?: React.ReactNode;
|
|
17
16
|
itemRight?: React.ReactNode;
|
|
18
|
-
text?:
|
|
17
|
+
text?: React.ReactNode;
|
|
19
18
|
weight?: TypographyProps['fontWeight'];
|
|
20
19
|
}
|
package/tag/tag.types.js
ADDED
package/tag/tagIcon.d.ts
ADDED
|
@@ -14,17 +14,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.TagIcon = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
19
|
var context_1 = require("./context");
|
|
20
20
|
var core_1 = require("../core");
|
|
21
|
-
var
|
|
22
|
-
exports.
|
|
21
|
+
var icon_1 = __importDefault(require("../icon"));
|
|
22
|
+
exports.TagIcon = core_1.vui(function (props, ref) {
|
|
23
23
|
var _a;
|
|
24
|
-
var
|
|
25
|
-
var mergedProps = __assign(__assign({},
|
|
26
|
-
var styles = core_1.useStyleConfig('
|
|
27
|
-
return react_1.default.createElement(
|
|
24
|
+
var tagProps = (_a = context_1.useTag()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
+
var mergedProps = __assign(__assign({}, tagProps), props);
|
|
26
|
+
var styles = core_1.useStyleConfig('Tag', mergedProps);
|
|
27
|
+
return react_1.default.createElement(icon_1.default, __assign({ className: "vui-tagIcon", ref: ref }, styles.icon, props));
|
|
28
28
|
});
|
|
29
|
-
exports.
|
|
30
|
-
exports.default = exports.
|
|
29
|
+
exports.TagIcon.displayName = 'TagIcon';
|
|
30
|
+
exports.default = exports.TagIcon;
|
package/tag/tagText.d.ts
ADDED
package/tag/tagText.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.TagText = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var context_1 = require("./context");
|
|
20
|
+
var core_1 = require("../core");
|
|
21
|
+
var t_1 = __importDefault(require("../t"));
|
|
22
|
+
exports.TagText = core_1.vui(function (props, ref) {
|
|
23
|
+
var _a;
|
|
24
|
+
var tagProps = (_a = context_1.useTag()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
+
var mergedProps = __assign(__assign({}, tagProps), props);
|
|
26
|
+
var styles = core_1.useStyleConfig('Tag', mergedProps);
|
|
27
|
+
return react_1.default.createElement(t_1.default, __assign({ className: "vui-tagText", fontSize: "inherit", ref: ref }, styles.text, props));
|
|
28
|
+
});
|
|
29
|
+
exports.TagText.displayName = 'TagText';
|
|
30
|
+
exports.default = exports.TagText;
|