@veracity/vui 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/avatar/avatar.d.ts +2 -2
- package/avatar/avatar.js +9 -29
- package/avatar/avatar.types.d.ts +9 -2
- package/avatar/helpers.d.ts +2 -0
- package/avatar/helpers.js +26 -0
- package/avatar/index.d.ts +1 -1
- package/avatar/index.js +1 -1
- package/avatar/theme.d.ts +1 -0
- package/avatar/theme.js +7 -0
- package/box/box.d.ts +2 -2
- package/box/box.js +9 -8
- package/box/box.types.d.ts +13 -2
- package/box/index.d.ts +1 -1
- package/box/index.js +1 -1
- package/box/theme.d.ts +1 -0
- package/box/theme.js +2 -0
- package/button/button.d.ts +7 -3
- package/button/button.js +24 -14
- package/button/button.types.d.ts +12 -30
- package/button/buttonIcon.d.ts +1 -0
- package/button/buttonIcon.js +3 -5
- package/button/buttonText.d.ts +1 -0
- package/button/buttonText.js +3 -5
- package/button/buttons.js +1 -1
- package/button/index.d.ts +2 -2
- package/button/index.js +3 -3
- package/button/theme.d.ts +1 -0
- package/button/theme.js +5 -3
- package/buttonGroup/buttonGroup.d.ts +5 -2
- package/buttonGroup/buttonGroup.js +12 -8
- package/buttonGroup/buttonGroup.types.d.ts +4 -2
- package/buttonGroup/helpers.d.ts +1 -1
- package/buttonGroup/helpers.js +1 -1
- package/buttonGroup/index.d.ts +1 -1
- package/buttonGroup/index.js +2 -2
- package/card/card.d.ts +4 -0
- package/card/card.js +8 -0
- package/card/card.types.d.ts +3 -2
- package/card/index.d.ts +1 -1
- package/card/index.js +1 -1
- package/card/theme.d.ts +1 -0
- package/card/theme.js +2 -0
- package/checkbox/checkbox.d.ts +5 -4
- package/checkbox/checkbox.js +20 -10
- package/checkbox/checkbox.types.d.ts +21 -4
- package/checkbox/checkboxGroup.d.ts +5 -2
- package/checkbox/checkboxGroup.js +11 -7
- package/checkbox/checkboxGroup.types.d.ts +9 -2
- package/checkbox/index.d.ts +1 -1
- package/checkbox/index.js +2 -2
- package/checkbox/theme.d.ts +1 -0
- package/checkbox/theme.js +2 -0
- package/core/index.d.ts +4 -5
- package/core/index.js +4 -12
- package/core/media.d.ts +38 -0
- package/core/media.js +79 -0
- package/core/styled.d.ts +3 -0
- package/core/styled.js +21 -3
- package/core/theme.d.ts +41 -0
- package/core/theme.js +94 -0
- package/core/vui.d.ts +31 -0
- package/core/vui.js +20 -0
- package/core/vuiProvider/fontFaces.js +4 -0
- package/core/{globalStyle.d.ts → vuiProvider/globalStyle.d.ts} +7 -0
- package/core/{globalStyle.js → vuiProvider/globalStyle.js} +17 -9
- package/core/vuiProvider/index.d.ts +5 -0
- package/{styles → core/vuiProvider}/index.js +8 -2
- package/core/vuiProvider/resetCSS.d.ts +3 -0
- package/core/{resetCSS.js → vuiProvider/resetCSS.js} +2 -1
- package/core/vuiProvider/vuiProvider.d.ts +13 -0
- package/core/{vuiProvider.js → vuiProvider/vuiProvider.js} +4 -1
- package/divider/divider.d.ts +2 -2
- package/divider/divider.js +5 -4
- package/divider/divider.types.d.ts +5 -2
- package/divider/index.d.ts +1 -1
- package/divider/index.js +1 -1
- package/divider/theme.d.ts +1 -0
- package/divider/theme.js +2 -0
- package/footer/consts.d.ts +3 -0
- package/footer/consts.js +3 -0
- package/footer/footer.d.ts +3 -1
- package/footer/footer.js +21 -10
- package/footer/footer.types.d.ts +5 -0
- package/footer/footerColumn.d.ts +122 -121
- package/footer/footerColumn.js +1 -0
- package/footer/footerHeading.d.ts +1 -0
- package/footer/footerHeading.js +1 -0
- package/footer/footerLink.d.ts +1 -0
- package/footer/footerLink.js +1 -0
- package/footer/footerRow.d.ts +1 -0
- package/footer/footerRow.js +1 -0
- package/footer/footerSection.d.ts +1 -0
- package/footer/footerSection.js +2 -1
- package/footer/footerTrademark.d.ts +1 -0
- package/footer/footerTrademark.js +1 -0
- package/footer/index.d.ts +2 -1
- package/footer/index.js +2 -2
- package/footer/theme.d.ts +1 -0
- package/footer/theme.js +2 -0
- package/header/context.d.ts +4 -0
- package/header/context.js +23 -0
- package/header/header.d.ts +34 -0
- package/header/header.js +118 -0
- package/header/header.types.d.ts +84 -0
- package/header/headerContent.d.ts +4 -0
- package/header/headerContent.js +28 -0
- package/header/headerCreateAccount.d.ts +4 -0
- package/header/headerCreateAccount.js +44 -0
- package/header/headerDivider.d.ts +4 -0
- package/header/headerDivider.js +28 -0
- package/header/headerLink.d.ts +4 -0
- package/header/headerLink.js +43 -0
- package/header/headerLinks.d.ts +4 -0
- package/header/headerLinks.js +41 -0
- package/header/headerLogo.d.ts +4 -0
- package/header/headerLogo.js +48 -0
- package/header/headerMobileContent.d.ts +4 -0
- package/header/headerMobileContent.js +30 -0
- package/header/headerMobileToggle.d.ts +4 -0
- package/header/headerMobileToggle.js +34 -0
- package/header/headerNotifications.d.ts +4 -0
- package/header/headerNotifications.js +52 -0
- package/header/headerProfile.d.ts +4 -0
- package/header/headerProfile.js +101 -0
- package/header/headerProfile.types.d.ts +35 -0
- package/header/headerServices.d.ts +4 -0
- package/header/headerServices.js +51 -0
- package/header/headerSignIn.d.ts +4 -0
- package/header/headerSignIn.js +40 -0
- package/header/index.d.ts +17 -0
- package/header/index.js +34 -0
- package/header/loggedInHeader.d.ts +4 -0
- package/header/loggedInHeader.js +53 -0
- package/header/loggedOutHeader.d.ts +4 -0
- package/header/loggedOutHeader.js +54 -0
- package/header/theme.d.ts +32 -0
- package/header/theme.js +52 -0
- package/heading/heading.d.ts +2 -2
- package/heading/heading.js +5 -4
- package/heading/heading.types.d.ts +7 -2
- package/heading/headings.js +1 -1
- package/heading/index.d.ts +1 -1
- package/heading/index.js +2 -2
- package/heading/theme.d.ts +1 -0
- package/heading/theme.js +2 -0
- package/icon/helpers.js +2 -2
- package/icon/icon.d.ts +1 -0
- package/icon/icon.js +2 -2
- package/icon/icon.types.d.ts +7 -4
- package/icon/index.d.ts +1 -1
- package/icon/index.js +1 -1
- package/icon/theme.d.ts +1 -0
- package/icon/theme.js +2 -0
- package/icons/baseIcons/fal/falFileInvoiceDollar.d.ts +3 -0
- package/icons/baseIcons/fal/falFileInvoiceDollar.js +7 -0
- package/icons/baseIcons/icons.d.ts +1 -0
- package/icons/baseIcons/icons.js +5 -3
- package/icons/baseIcons/types.d.ts +1 -1
- package/icons/cache.d.ts +15 -0
- package/icons/{library.js → cache.js} +10 -6
- package/icons/index.d.ts +1 -1
- package/icons/index.js +3 -3
- package/icons/types.d.ts +10 -3
- package/image/image.d.ts +2 -0
- package/image/image.js +11 -2
- package/image/image.types.d.ts +3 -2
- package/image/index.d.ts +1 -1
- package/image/index.js +1 -1
- package/image/theme.d.ts +1 -0
- package/image/theme.js +2 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/input/helpers.d.ts +1 -0
- package/input/helpers.js +1 -0
- package/input/index.d.ts +1 -1
- package/input/index.js +2 -2
- package/input/input.d.ts +7 -3
- package/input/input.js +17 -7
- package/input/input.types.d.ts +33 -4
- package/input/inputIcon.d.ts +1 -0
- package/input/inputIcon.js +2 -1
- package/input/inputInput.d.ts +2 -2
- package/input/inputInput.js +10 -5
- package/input/theme.d.ts +1 -0
- package/input/theme.js +2 -0
- package/link/index.d.ts +1 -1
- package/link/index.js +2 -2
- package/link/link.d.ts +6 -3
- package/link/link.js +15 -9
- package/link/link.types.d.ts +12 -4
- package/link/linkIcon.d.ts +1 -0
- package/link/linkIcon.js +3 -5
- package/link/linkText.d.ts +1 -0
- package/link/linkText.js +3 -5
- package/link/theme.d.ts +6 -0
- package/link/theme.js +9 -1
- package/list/index.d.ts +1 -1
- package/list/index.js +2 -2
- package/list/list.d.ts +3 -3
- package/list/list.js +13 -8
- package/list/list.types.d.ts +29 -8
- package/list/listDivider.d.ts +1 -0
- package/list/listDivider.js +3 -5
- package/list/listHeading.d.ts +1 -0
- package/list/listHeading.js +4 -6
- package/list/listIcon.d.ts +1 -0
- package/list/listIcon.js +3 -5
- package/list/listItem.d.ts +5 -2
- package/list/listItem.js +52 -19
- package/list/listText.d.ts +1 -0
- package/list/listText.js +3 -5
- package/list/theme.d.ts +1 -0
- package/list/theme.js +5 -2
- package/menu/menu.d.ts +1 -0
- package/menu/menu.js +1 -0
- package/menu/menu.types.d.ts +3 -0
- package/menu/menuButton.d.ts +1 -0
- package/menu/menuButton.js +3 -4
- package/menu/menuItem.d.ts +1 -0
- package/menu/menuItem.js +2 -1
- package/menu/menuList.d.ts +1 -0
- package/menu/menuList.js +3 -4
- package/menu/theme.d.ts +16 -2
- package/menu/theme.js +18 -3
- package/notification/index.d.ts +2 -2
- package/notification/index.js +3 -3
- package/notification/notification.d.ts +5 -1
- package/notification/notification.js +12 -27
- package/notification/notification.types.d.ts +10 -2
- package/notification/notificationButton.d.ts +1 -0
- package/notification/notificationButton.js +4 -5
- package/notification/notificationIcon.d.ts +1 -0
- package/notification/notificationIcon.js +7 -7
- package/notification/notificationText.d.ts +1 -0
- package/notification/notificationText.js +3 -5
- package/notification/notificationTitle.d.ts +1 -0
- package/notification/notificationTitle.js +3 -5
- package/notification/theme.d.ts +1 -0
- package/notification/theme.js +2 -0
- package/p/index.d.ts +1 -1
- package/p/index.js +1 -1
- package/p/p.d.ts +2 -2
- package/p/p.js +5 -4
- package/p/p.types.d.ts +7 -2
- package/p/theme.d.ts +1 -0
- package/p/theme.js +2 -0
- package/package.json +1 -1
- package/panel/index.d.ts +1 -1
- package/panel/index.js +1 -1
- package/panel/panel.d.ts +4 -0
- package/panel/panel.js +4 -0
- package/panel/panel.types.d.ts +1 -2
- package/panel/theme.d.ts +1 -0
- package/panel/theme.js +2 -0
- package/popover/consts.d.ts +6 -0
- package/popover/consts.js +42 -0
- package/popover/index.d.ts +2 -1
- package/popover/index.js +4 -2
- package/popover/popover.d.ts +5 -2
- package/popover/popover.js +16 -2
- package/popover/popover.types.d.ts +4 -1
- package/popover/popoverContent.d.ts +2 -1
- package/popover/popoverContent.js +6 -1
- package/popover/popoverStyle.js +9 -0
- package/popover/popoverTrigger.d.ts +4 -0
- package/popover/popoverTrigger.js +4 -0
- package/popover/theme.d.ts +1 -0
- package/popover/theme.js +2 -0
- package/popover/usePopover.d.ts +5 -0
- package/popover/usePopover.js +21 -11
- package/popover/usePopover.types.d.ts +17 -6
- package/radio/index.d.ts +1 -1
- package/radio/index.js +2 -2
- package/radio/radio.d.ts +5 -4
- package/radio/radio.js +20 -10
- package/radio/radio.types.d.ts +19 -4
- package/radio/radioGroup.d.ts +5 -2
- package/radio/radioGroup.js +11 -7
- package/radio/radioGroup.types.d.ts +10 -2
- package/radio/theme.d.ts +1 -0
- package/radio/theme.js +2 -0
- package/skeleton/index.d.ts +1 -1
- package/skeleton/index.js +1 -1
- package/skeleton/skeleton.d.ts +2 -2
- package/skeleton/skeleton.js +4 -3
- package/skeleton/skeleton.types.d.ts +5 -2
- package/skeleton/theme.d.ts +1 -0
- package/skeleton/theme.js +2 -0
- package/spinner/index.d.ts +1 -1
- package/spinner/index.js +1 -1
- package/spinner/spinner.d.ts +6 -2
- package/spinner/spinner.js +12 -5
- package/spinner/spinner.types.d.ts +10 -6
- package/spinner/theme.d.ts +1 -0
- package/spinner/theme.js +2 -0
- package/svg/helpers.d.ts +1 -1
- package/svg/index.d.ts +1 -1
- package/svg/index.js +1 -1
- package/svg/svg.d.ts +6 -1
- package/svg/svg.js +14 -5
- package/svg/svg.types.d.ts +6 -4
- package/switch/context.d.ts +2 -2
- package/switch/index.d.ts +1 -1
- package/switch/index.js +2 -2
- package/switch/switch.d.ts +6 -3
- package/switch/switch.js +15 -12
- package/switch/switch.types.d.ts +37 -4
- package/switch/switchButton.d.ts +5 -5
- package/switch/switchButton.js +34 -26
- package/switch/switchLabel.d.ts +1 -0
- package/switch/switchLabel.js +3 -5
- package/switch/theme.d.ts +1 -0
- package/switch/theme.js +2 -0
- package/system/animations.d.ts +3 -4
- package/system/backgrounds.d.ts +4 -5
- package/system/borders.d.ts +60 -61
- package/system/custom.d.ts +4 -4
- package/system/effects.d.ts +7 -8
- package/system/flexboxGrids.d.ts +5 -6
- package/system/flexboxes.d.ts +28 -29
- package/system/grids.d.ts +25 -26
- package/system/index.d.ts +0 -1
- package/system/index.js +0 -6
- package/system/interactivity.d.ts +11 -12
- package/system/layout.d.ts +31 -32
- package/system/sizing.d.ts +13 -14
- package/system/space.d.ts +37 -38
- package/system/system.d.ts +4 -5
- package/system/system.js +3 -1
- package/system/tables.d.ts +5 -6
- package/system/transforms.d.ts +22 -23
- package/system/transitions.d.ts +11 -12
- package/system/typography.d.ts +33 -34
- package/t/index.d.ts +1 -1
- package/t/index.js +1 -1
- package/t/t.d.ts +2 -2
- package/t/t.js +5 -4
- package/t/t.types.d.ts +8 -2
- package/t/theme.d.ts +1 -0
- package/t/theme.js +2 -0
- package/tag/index.d.ts +1 -1
- package/tag/index.js +2 -2
- package/tag/tag.d.ts +6 -3
- package/tag/tag.js +14 -7
- package/tag/tag.types.d.ts +16 -2
- package/tag/tagButton.d.ts +1 -0
- package/tag/tagButton.js +4 -16
- package/tag/tagIcon.d.ts +1 -0
- package/tag/tagIcon.js +3 -5
- package/tag/tagText.d.ts +1 -0
- package/tag/tagText.js +3 -5
- package/tag/theme.d.ts +1 -0
- package/tag/theme.js +8 -0
- package/textarea/helpers.d.ts +1 -0
- package/textarea/helpers.js +1 -0
- package/textarea/index.d.ts +1 -1
- package/textarea/index.js +1 -1
- package/textarea/textarea.d.ts +5 -3
- package/textarea/textarea.js +23 -10
- package/textarea/textarea.types.d.ts +22 -2
- package/textarea/theme.d.ts +1 -0
- package/textarea/theme.js +2 -0
- package/theme/components.d.ts +76 -2
- package/theme/components.js +38 -36
- package/theme/defaultTheme.d.ts +81 -2
- package/theme/foundations/colors.d.ts +10 -0
- package/theme/foundations/colors.js +8 -2
- package/theme/foundations/index.d.ts +5 -0
- package/theme/foundations/shadows.js +3 -3
- package/theme/foundations/transformers.js +3 -2
- package/theme/index.d.ts +1 -3
- package/theme/index.js +4 -5
- package/theme/types.d.ts +3 -2
- package/utils/assertion.d.ts +5 -5
- package/utils/assertion.js +8 -4
- package/utils/object.d.ts +2 -2
- package/utils/object.js +3 -1
- package/utils/styles.d.ts +2 -2
- package/utils/styles.js +4 -4
- package/utils/types.d.ts +8 -3
- package/core/types/component.d.ts +0 -25
- package/core/types/index.d.ts +0 -2
- package/core/types/index.js +0 -14
- package/core/types/themeGet.d.ts +0 -24
- package/core/utils.d.ts +0 -56
- package/core/utils.js +0 -194
- package/core/vuiProvider.d.ts +0 -20
- package/icons/library.d.ts +0 -11
- package/popover/plugins.d.ts +0 -3
- package/popover/plugins.js +0 -24
- package/styles/fontFaces.js +0 -4
- package/styles/helpers.d.ts +0 -4
- package/styles/helpers.js +0 -8
- package/styles/index.d.ts +0 -3
- /package/{styles → core/vuiProvider}/animations.d.ts +0 -0
- /package/{styles → core/vuiProvider}/animations.js +0 -0
- /package/{styles → core/vuiProvider}/fontFaces.d.ts +0 -0
- /package/{core/types/component.js → header/header.types.js} +0 -0
- /package/{core/types/themeGet.js → header/headerProfile.types.js} +0 -0
- /package/{core/resetCSS.d.ts → popover/popoverStyle.d.ts} +0 -0
package/core/styled.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
2
|
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
4
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
5
4
|
return cooked;
|
|
@@ -50,19 +49,21 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
50
49
|
};
|
|
51
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
51
|
exports.styled = exports.v = exports.css = exports.createGlobalStyle = void 0;
|
|
52
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
53
53
|
var core_1 = require("@xstyled/core");
|
|
54
54
|
var styled_components_1 = require("@xstyled/styled-components");
|
|
55
55
|
var util_1 = require("@xstyled/util");
|
|
56
56
|
var styled_components_2 = __importStar(require("styled-components"));
|
|
57
|
-
var utils_1 = require("./utils");
|
|
58
57
|
var system_1 = require("../system");
|
|
58
|
+
/** Creates enhanced 'styled' function with optional style generators and prop-forwarding safeguard. */
|
|
59
59
|
function createBaseStyled(css, generator) {
|
|
60
|
-
var config = generator ?
|
|
60
|
+
var config = generator ? forwardPropConfig(generator) : {};
|
|
61
61
|
return (function (component) {
|
|
62
62
|
var baseStyled = config ? (0, styled_components_2.default)(component).withConfig(config) : (0, styled_components_2.default)(component);
|
|
63
63
|
return getCreateStyle(baseStyled, css, generator);
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
+
/** Enhances createGlobalStyle function with custom 'css' helper. */
|
|
66
67
|
function createCreateGlobalStyle() {
|
|
67
68
|
var css = createCssFunction();
|
|
68
69
|
return (function () {
|
|
@@ -76,6 +77,7 @@ function createCreateGlobalStyle() {
|
|
|
76
77
|
]);
|
|
77
78
|
});
|
|
78
79
|
}
|
|
80
|
+
/** Enhances styled-components' 'css' function with automatic theming. */
|
|
79
81
|
function createCssFunction() {
|
|
80
82
|
return (function () {
|
|
81
83
|
var args = [];
|
|
@@ -87,6 +89,10 @@ function createCssFunction() {
|
|
|
87
89
|
return flattenedArgs.map(core_1.transform);
|
|
88
90
|
});
|
|
89
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Creates full 'styled' function with properties for components.
|
|
94
|
+
* Includes base version and system version using 'Box' postfix.
|
|
95
|
+
*/
|
|
90
96
|
function createStyled(generator) {
|
|
91
97
|
var css = createCssFunction();
|
|
92
98
|
var styled = createBaseStyled(css);
|
|
@@ -99,6 +105,17 @@ function createStyled(generator) {
|
|
|
99
105
|
});
|
|
100
106
|
return styled;
|
|
101
107
|
}
|
|
108
|
+
/** Provides configuration to the 'styled' function, which filters out xstyled system props. */
|
|
109
|
+
function forwardPropConfig(generator) {
|
|
110
|
+
return {
|
|
111
|
+
shouldForwardProp: function (prop, defaultValidatorFn) {
|
|
112
|
+
if (typeof prop === 'string' && generator.meta.props.includes(prop))
|
|
113
|
+
return false;
|
|
114
|
+
return defaultValidatorFn(prop);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** Extends styled component with a given styles generator (system). */
|
|
102
119
|
function getCreateStyle(baseCreateStyle, css, generator) {
|
|
103
120
|
var createStyle = function () {
|
|
104
121
|
var args = [];
|
|
@@ -119,4 +136,5 @@ exports.createGlobalStyle = createCreateGlobalStyle();
|
|
|
119
136
|
exports.css = createCssFunction();
|
|
120
137
|
exports.v = (0, styled_components_1.createX)(system_1.system);
|
|
121
138
|
exports.styled = createStyled(system_1.system);
|
|
139
|
+
exports.default = exports.styled;
|
|
122
140
|
var templateObject_1;
|
package/core/theme.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IProps, ThemeGetter } from '@xstyled/styled-components';
|
|
2
|
+
import { ThemingProps, VuiTheme, VuiThemeExtensions } from '../theme';
|
|
3
|
+
import { AnyNumber, AnyString, Dict } from '../utils';
|
|
4
|
+
declare type VuiThemeGetter<ThemeKey extends keyof VuiTheme> = ThemeGetter<keyof VuiTheme[ThemeKey] | AnyString | AnyNumber>;
|
|
5
|
+
/** Type of the 'th' theme getter function. */
|
|
6
|
+
export declare type ThemeGet = {
|
|
7
|
+
(path: string, defaultValue?: any): (props: IProps) => any;
|
|
8
|
+
animation: VuiThemeGetter<'animations'>;
|
|
9
|
+
borders: VuiThemeGetter<'borders'>;
|
|
10
|
+
color: VuiThemeGetter<'colors'>;
|
|
11
|
+
duration: VuiThemeGetter<'durations'>;
|
|
12
|
+
font: VuiThemeGetter<'fonts'>;
|
|
13
|
+
fontSize: VuiThemeGetter<'fontSizes'>;
|
|
14
|
+
fontWeight: VuiThemeGetter<'fontWeights'>;
|
|
15
|
+
radius: VuiThemeGetter<'radii'>;
|
|
16
|
+
ringWidth: VuiThemeGetter<'ringWidths'>;
|
|
17
|
+
screen: VuiThemeGetter<'screens'>;
|
|
18
|
+
shadow: VuiThemeGetter<'shadows'>;
|
|
19
|
+
size: VuiThemeGetter<'sizes'>;
|
|
20
|
+
space: VuiThemeGetter<'spaces'>;
|
|
21
|
+
transform: VuiThemeGetter<'transforms'>;
|
|
22
|
+
transition: VuiThemeGetter<'transitions'>;
|
|
23
|
+
zIndex: VuiThemeGetter<'zIndices'>;
|
|
24
|
+
};
|
|
25
|
+
/** Merges provided theme extensions and overrides with default VUI theme. */
|
|
26
|
+
export declare function extendTheme(extensions: VuiThemeExtensions): VuiTheme;
|
|
27
|
+
/** Removes specific theming keys from the given props. */
|
|
28
|
+
export declare function omitThemingProps<T extends ThemingProps>(props: T): Omit<T, "size" | "variant">;
|
|
29
|
+
/** Re-export of xstyled 'th' with custom typing and screen getter. */
|
|
30
|
+
declare const th: ThemeGet;
|
|
31
|
+
export { th };
|
|
32
|
+
/**
|
|
33
|
+
* Combines baseStyle, size and variant styling from a component's theme configuration.
|
|
34
|
+
* @param component - name of any component configured in the theme
|
|
35
|
+
* @param props - props object of the given component
|
|
36
|
+
*/
|
|
37
|
+
export declare function useStyleConfig(component: keyof VuiTheme['components'], props?: any): Dict<any>;
|
|
38
|
+
/** Returns theme value at the given path. */
|
|
39
|
+
export declare function useTh(path: keyof VuiTheme | AnyString, defaultValue?: any): any;
|
|
40
|
+
/** Returns the theme object with extensions. */
|
|
41
|
+
export declare function useTheme(): VuiTheme;
|
package/core/theme.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.useTheme = exports.useTh = exports.useStyleConfig = exports.th = exports.omitThemingProps = exports.extendTheme = void 0;
|
|
29
|
+
var styled_components_1 = require("@xstyled/styled-components");
|
|
30
|
+
var react_1 = require("react");
|
|
31
|
+
var styled_components_2 = require("styled-components");
|
|
32
|
+
var theme_1 = __importDefault(require("../theme"));
|
|
33
|
+
var utils_1 = require("../utils");
|
|
34
|
+
/** Merges provided theme extensions and overrides with default VUI theme. */
|
|
35
|
+
function extendTheme(extensions) {
|
|
36
|
+
return (0, utils_1.merge)(theme_1.default, extensions);
|
|
37
|
+
}
|
|
38
|
+
exports.extendTheme = extendTheme;
|
|
39
|
+
/** Removes specific theming keys from the given props. */
|
|
40
|
+
function omitThemingProps(props) {
|
|
41
|
+
var size = props.size, variant = props.variant, rest = __rest(props, ["size", "variant"]); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
42
|
+
return rest;
|
|
43
|
+
}
|
|
44
|
+
exports.omitThemingProps = omitThemingProps;
|
|
45
|
+
/** Re-export of xstyled 'th' with custom typing and screen getter. */
|
|
46
|
+
var th = styled_components_1.th;
|
|
47
|
+
exports.th = th;
|
|
48
|
+
th.screen = (0, styled_components_1.themeGetter)({
|
|
49
|
+
name: 'screen',
|
|
50
|
+
key: 'screens',
|
|
51
|
+
compose: styled_components_1.getPx
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Combines baseStyle, size and variant styling from a component's theme configuration.
|
|
55
|
+
* @param component - name of any component configured in the theme
|
|
56
|
+
* @param props - props object of the given component
|
|
57
|
+
*/
|
|
58
|
+
function useStyleConfig(component, props) {
|
|
59
|
+
var _a;
|
|
60
|
+
if (props === void 0) { props = {}; }
|
|
61
|
+
var theme = useTheme();
|
|
62
|
+
var _b = (_a = theme === null || theme === void 0 ? void 0 : theme.components[component]) !== null && _a !== void 0 ? _a : {}, baseStyle = _b.baseStyle, defaultProps = _b.defaultProps, _c = _b.parts, parts = _c === void 0 ? [] : _c, sizes = _b.sizes, variants = _b.variants;
|
|
63
|
+
var mergedProps = __assign(__assign({}, defaultProps), props);
|
|
64
|
+
var colorScheme = mergedProps.colorScheme, size = mergedProps.size, variant = mergedProps.variant;
|
|
65
|
+
return (0, react_1.useMemo)(function () {
|
|
66
|
+
var _a, _b, _c;
|
|
67
|
+
var baseStyles = (_a = (0, utils_1.runIfFn)(baseStyle, mergedProps)) !== null && _a !== void 0 ? _a : {};
|
|
68
|
+
var sizeStyles = (_b = (0, utils_1.runIfFn)(sizes === null || sizes === void 0 ? void 0 : sizes[size], mergedProps)) !== null && _b !== void 0 ? _b : {};
|
|
69
|
+
var variantStyles = (_c = (0, utils_1.runIfFn)(variants === null || variants === void 0 ? void 0 : variants[variant], mergedProps)) !== null && _c !== void 0 ? _c : {};
|
|
70
|
+
var styles = {};
|
|
71
|
+
if (parts.length > 0) {
|
|
72
|
+
parts.forEach(function (part) {
|
|
73
|
+
var _a, _b, _c;
|
|
74
|
+
styles[part] = (0, utils_1.merge)((_a = baseStyles[part]) !== null && _a !== void 0 ? _a : {}, (_b = sizeStyles[part]) !== null && _b !== void 0 ? _b : {}, (_c = variantStyles[part]) !== null && _c !== void 0 ? _c : {});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
styles = (0, utils_1.merge)(baseStyles, sizeStyles, variantStyles);
|
|
79
|
+
}
|
|
80
|
+
return styles;
|
|
81
|
+
}, [colorScheme, size, variant]);
|
|
82
|
+
}
|
|
83
|
+
exports.useStyleConfig = useStyleConfig;
|
|
84
|
+
/** Returns theme value at the given path. */
|
|
85
|
+
function useTh(path, defaultValue) {
|
|
86
|
+
var theme = useTheme();
|
|
87
|
+
return th(path, defaultValue)({ theme: theme });
|
|
88
|
+
}
|
|
89
|
+
exports.useTh = useTh;
|
|
90
|
+
/** Returns the theme object with extensions. */
|
|
91
|
+
function useTheme() {
|
|
92
|
+
return (0, styled_components_2.useTheme)();
|
|
93
|
+
}
|
|
94
|
+
exports.useTheme = useTheme;
|
package/core/vui.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { ElementType, PropsWithChildren, PropsWithoutRef, ReactElement } from 'react';
|
|
2
|
+
import { PropsOf, RefPropsOf } from '../utils';
|
|
3
|
+
/**
|
|
4
|
+
* Component creation utility, which combines forwardRef, memo and ensures correct typing with all props included.
|
|
5
|
+
* Config object allows toggling memoization and providing custom 'areEqual' function.
|
|
6
|
+
*/
|
|
7
|
+
export declare function vui<C extends React.ElementType, Props = {}>(component: React.ForwardRefRenderFunction<any, PropsOf<C, Props>>, config?: VuiComponentConfig<C, Props>): VuiComponent<C, Props>;
|
|
8
|
+
/** VUI component type, which allows element props inference and extension, 'as' and 'ref'. */
|
|
9
|
+
export declare type VuiComponent<C extends ElementType, Props = {}> = {
|
|
10
|
+
<AsC extends ElementType>(props: PropsWithChildren<RefPropsOf<AsC, Props>> & {
|
|
11
|
+
as: AsC;
|
|
12
|
+
}): ReactElement<any, any> | null;
|
|
13
|
+
(props: RefPropsOf<C, Props>): ReactElement<any, any> | null;
|
|
14
|
+
defaultProps?: Partial<PropsOf<C, Props>>;
|
|
15
|
+
displayName?: string;
|
|
16
|
+
};
|
|
17
|
+
/** Config for VUI component creator helper, which allows toggling memoization and 'areEqual' function. */
|
|
18
|
+
export declare type VuiComponentConfig<C extends ElementType, Props = {}> = {
|
|
19
|
+
isMemo?: boolean;
|
|
20
|
+
memoCompare?: (prevProps: Readonly<PropsWithChildren<PropsWithoutRef<PropsOf<C, Props>>>>, nextProps: Readonly<PropsWithChildren<PropsWithoutRef<PropsOf<C, Props>>>>) => boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use FC or plain functions instead. If you need typing for HTML attributes of a given element,
|
|
24
|
+
* use PropsOf type, like: type MyBoxProps = PropsOf<'div', MyProps>
|
|
25
|
+
*/
|
|
26
|
+
export declare type VC<C extends ElementType, Props = {}> = {
|
|
27
|
+
(props: PropsOf<C, Props>): ReactElement<any, any> | null;
|
|
28
|
+
defaultProps?: Partial<PropsOf<C, Props>>;
|
|
29
|
+
displayName?: string;
|
|
30
|
+
};
|
|
31
|
+
export default vui;
|
package/core/vui.js
ADDED
|
@@ -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
|
+
exports.vui = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
/**
|
|
9
|
+
* Component creation utility, which combines forwardRef, memo and ensures correct typing with all props included.
|
|
10
|
+
* Config object allows toggling memoization and providing custom 'areEqual' function.
|
|
11
|
+
*/
|
|
12
|
+
function vui(component, config) {
|
|
13
|
+
var _a = config !== null && config !== void 0 ? config : {}, memoCompare = _a.memoCompare, _b = _a.isMemo, isMemo = _b === void 0 ? true : _b;
|
|
14
|
+
if (isMemo) {
|
|
15
|
+
return react_1.default.memo(react_1.default.forwardRef(component), memoCompare);
|
|
16
|
+
}
|
|
17
|
+
return react_1.default.forwardRef(component);
|
|
18
|
+
}
|
|
19
|
+
exports.vui = vui;
|
|
20
|
+
exports.default = vui;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var __1 = require("../");
|
|
4
|
+
exports.default = "\n\t@font-face {\n\t\tfont-family: 'Avenir Next';\n\t\tsrc: url('" + __1.cdnUrl + "/common/fonts/avenir-regular-lat-ext.woff');\n\t\tfont-weight: 400;\n\t}\n\n\t@font-face {\n\t\tfont-family: 'Avenir Next';\n\t\tsrc: url('" + __1.cdnUrl + "/common/fonts/avenir-medium-lat-ext.woff');\n\t\tfont-weight: 500;\n\t}\n\n\t@font-face {\n\t\tfont-family: 'Avenir Next';\n\t\tsrc: url('" + __1.cdnUrl + "/common/fonts/avenir-demi-lat-ext.woff');\n\t\tfont-weight: 600;\n\t}\n\n\t@font-face {\n\t\tfont-family: 'Avenir Next';\n\t\tsrc: url('" + __1.cdnUrl + "/common/fonts/avenir-bold-lat-ext.woff');\n\t\tfont-weight: 700;\n\t}\n";
|
|
@@ -2,4 +2,11 @@ declare type GlobalStyleProps = {
|
|
|
2
2
|
globalStyle?: boolean;
|
|
3
3
|
};
|
|
4
4
|
declare const _default: import("styled-components").GlobalStyleComponent<GlobalStyleProps, import("styled-components").DefaultTheme>;
|
|
5
|
+
/**
|
|
6
|
+
* Provides global styles, such as:
|
|
7
|
+
* - font face definitions
|
|
8
|
+
* - font base styles (color, size, family)
|
|
9
|
+
* - animation keyframes
|
|
10
|
+
* - CSS variables for each theme value
|
|
11
|
+
*/
|
|
5
12
|
export default _default;
|
|
@@ -34,16 +34,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
34
34
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
var foundations_1 = __importDefault(require("
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
var foundations_1 = __importDefault(require("../../theme/foundations"));
|
|
38
|
+
var utils_1 = require("../../utils");
|
|
39
|
+
var styled_1 = require("../styled");
|
|
40
|
+
var animations_1 = require("./animations");
|
|
41
|
+
var fontFaces_1 = __importDefault(require("./fontFaces"));
|
|
42
|
+
/**
|
|
43
|
+
* Provides global styles, such as:
|
|
44
|
+
* - font face definitions
|
|
45
|
+
* - font base styles (color, size, family)
|
|
46
|
+
* - animation keyframes
|
|
47
|
+
* - CSS variables for each theme value
|
|
48
|
+
*/
|
|
49
|
+
exports.default = (0, styled_1.createGlobalStyle)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\t", "\n\n\t:root {\n\t\t", "\n\t}\n\n\t* {\n\t\t--x-ring-color: var(--vui-colors-blue-50);\n\t\t// Fixes a box-shadow issue between some parent and child components\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\t}\n\n\t* {\n\t\t--x-ring-color: var(--vui-colors-blue-50);\n\t\t// Fixes a box-shadow issue between some parent and child components\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"
|
|
50
|
+
/** Recursively maps through all theme styles and generates a set of CSS properties. */
|
|
51
|
+
])), fontFaces_1.default, generateCSSVariables, function (p) {
|
|
44
52
|
return p.globalStyle && (0, styled_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t\t\tbody {\n\t\t\t\tcolor: prussian.80;\n\t\t\t\tfont-family: avenir;\n\t\t\t\tfont-size: md;\n\t\t\t}\n\t\t"], ["\n\t\t\tbody {\n\t\t\t\tcolor: prussian.80;\n\t\t\t\tfont-family: avenir;\n\t\t\t\tfont-size: md;\n\t\t\t}\n\t\t"])));
|
|
45
|
-
},
|
|
46
|
-
/** Recursively maps through all theme styles and generates a set of CSS properties */
|
|
53
|
+
}, animations_1.bounce, animations_1.fadeDown, animations_1.fadeIn, animations_1.fadeLeft, animations_1.fadeOut, animations_1.fadeRight, animations_1.fadeUp, animations_1.pulse, animations_1.spin);
|
|
54
|
+
/** Recursively maps through all theme styles and generates a set of CSS properties. */
|
|
47
55
|
function generateCSSVariables() {
|
|
48
56
|
function computeStyle(name, value) {
|
|
49
57
|
if (!(0, utils_1.isObject)(value))
|
|
@@ -13,8 +13,14 @@ 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.fontFaces = void 0;
|
|
16
|
+
exports.VuiProvider = exports.default = exports.ResetCSS = exports.GlobalStyle = exports.fontFaces = void 0;
|
|
17
17
|
__exportStar(require("./animations"), exports);
|
|
18
|
-
__exportStar(require("./helpers"), exports);
|
|
19
18
|
var fontFaces_1 = require("./fontFaces");
|
|
20
19
|
Object.defineProperty(exports, "fontFaces", { enumerable: true, get: function () { return __importDefault(fontFaces_1).default; } });
|
|
20
|
+
var globalStyle_1 = require("./globalStyle");
|
|
21
|
+
Object.defineProperty(exports, "GlobalStyle", { enumerable: true, get: function () { return __importDefault(globalStyle_1).default; } });
|
|
22
|
+
var resetCSS_1 = require("./resetCSS");
|
|
23
|
+
Object.defineProperty(exports, "ResetCSS", { enumerable: true, get: function () { return __importDefault(resetCSS_1).default; } });
|
|
24
|
+
var vuiProvider_1 = require("./vuiProvider");
|
|
25
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(vuiProvider_1).default; } });
|
|
26
|
+
Object.defineProperty(exports, "VuiProvider", { enumerable: true, get: function () { return __importDefault(vuiProvider_1).default; } });
|
|
@@ -4,6 +4,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
var styled_1 = require("
|
|
7
|
+
var styled_1 = require("../styled");
|
|
8
|
+
/** Set of CSS resets to unify styles across browsers and provide good style defaults. */
|
|
8
9
|
exports.default = (0, styled_1.createGlobalStyle)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\thtml {\n\t\tbox-sizing: border-box;\n\t\tline-height: 1.4;\n\t\t-webkit-text-size-adjust: 100%;\n\t}\n\n\t*, *::before, *::after {\n\t\tborder-style: solid;\n\t\tborder-width: 0;\n\t\tbox-sizing: inherit;\n\t}\n\n\tbody {\n\t\tmargin: 0;\n\t}\n\n\ta {\n\t\tbackground-color: transparent;\n\t\tcolor: inherit;\n\t\ttext-decoration: none;\n\t}\n\n\tabbr[title] {\n\t\tborder-bottom: none;\n\t\ttext-decoration: underline dotted;\n\t}\n\n\tb, strong {\n\t\tfont-weight: bolder;\n\t}\n\n\tbutton {\n\t\tcursor: pointer;\n\t\t-webkit-appearance: button;\n\t}\n\n\tbutton, input, optgroup, select, textarea {\n\t\tfont-family: inherit;\n\t\tfont-size: 100%;\n\t\tmargin: 0;\n\t}\n\n\tbutton, select {\n\t\ttext-transform: none;\n\t}\n\n\tcode, kbd, pre, samp {\n\t\tfont-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;\n\t\tfont-size: 1em;\n\t}\n\n\tdetails {\n\t\tdisplay: block;\n\t}\n\n\tfieldset {\n\t\tpadding: 0.35em 0.75em 0.625em;\n\t}\n\n\th1, h2, h3, h4, h5, h6, p, hr, dl, dd, blockquote, figure, pre {\n\t\tmargin: 0;\n\t}\n\n\th1, h2, h3, h4, h5, h6 {\n\t\tfont-size: inherit;\n\t\tfont-weight: inherit;\n\t}\n\n\thr {\n\t\tcolor: inherit;\n\t\theight: 0;\n\t}\n\n\timg {\n\t\tborder-style: none;\n\t}\n\n\timg, svg, video, canvas, audio, iframe, embed, object {\n\t\tdisplay: block;\n\t}\n\n\tlegend {\n\t\tcolor: inherit;\n\t\tdisplay: table;\n\t\tmax-width: 100%;\n\t\tpadding: 0;\n\t\twhite-space: normal;\n\t}\n\n\tmain {\n\t\tdisplay: block;\n\t}\n\n\tol, ul {\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\tprogress {\n\t\tvertical-align: baseline;\n\t}\n\n\tsummary {\n\t\tdisplay: list-item;\n\t}\n\n\tsmall {\n\t\tfont-size: 80%;\n\t}\n\n\tsub, sup {\n\t\tfont-size: 75%;\n\t\tline-height: 0;\n\t\tposition: relative;\n\t\tvertical-align: baseline;\n\t}\n\n\tsub {\n\t\tbottom: -0.25em;\n\t}\n\n\tsup {\n\t\ttop: -0.5em;\n\t}\n\n\ttable {\n\t\ttext-indent: 0;\n\t\tborder-color: inherit;\n\t}\n\n\ttemplate {\n\t\tdisplay: none;\n\t}\n\n\ttextarea {\n\t\toverflow: auto;\n\t}\n\n\t::-moz-focus-inner {\n\t\tborder-style: none;\n\t\tpadding: 0;\n\t}\n\n\t::-webkit-file-upload-button {\n\t\tfont: inherit;\n\t\t-webkit-appearance: button;\n\t}\n\n\t[type=checkbox], [type=radio] {\n\t\tpadding: 0;\n\t}\n\n\t[type=number]::-webkit-inner-spin-button,\n\t[type=number]::-webkit-outer-spin-button {\n\t\theight: auto;\n\t}\n\n\t[type=search] {\n\t\toutline-offset: -2px;\n\t\t-webkit-appearance: textfield;\n\t}\n\n\t[type=search]::-webkit-search-decoration {\n\t\t-webkit-appearance: none;\n\t}\n\n\t[hidden] {\n\t\tdisplay: none;\n\t}\n"], ["\n\thtml {\n\t\tbox-sizing: border-box;\n\t\tline-height: 1.4;\n\t\t-webkit-text-size-adjust: 100%;\n\t}\n\n\t*, *::before, *::after {\n\t\tborder-style: solid;\n\t\tborder-width: 0;\n\t\tbox-sizing: inherit;\n\t}\n\n\tbody {\n\t\tmargin: 0;\n\t}\n\n\ta {\n\t\tbackground-color: transparent;\n\t\tcolor: inherit;\n\t\ttext-decoration: none;\n\t}\n\n\tabbr[title] {\n\t\tborder-bottom: none;\n\t\ttext-decoration: underline dotted;\n\t}\n\n\tb, strong {\n\t\tfont-weight: bolder;\n\t}\n\n\tbutton {\n\t\tcursor: pointer;\n\t\t-webkit-appearance: button;\n\t}\n\n\tbutton, input, optgroup, select, textarea {\n\t\tfont-family: inherit;\n\t\tfont-size: 100%;\n\t\tmargin: 0;\n\t}\n\n\tbutton, select {\n\t\ttext-transform: none;\n\t}\n\n\tcode, kbd, pre, samp {\n\t\tfont-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;\n\t\tfont-size: 1em;\n\t}\n\n\tdetails {\n\t\tdisplay: block;\n\t}\n\n\tfieldset {\n\t\tpadding: 0.35em 0.75em 0.625em;\n\t}\n\n\th1, h2, h3, h4, h5, h6, p, hr, dl, dd, blockquote, figure, pre {\n\t\tmargin: 0;\n\t}\n\n\th1, h2, h3, h4, h5, h6 {\n\t\tfont-size: inherit;\n\t\tfont-weight: inherit;\n\t}\n\n\thr {\n\t\tcolor: inherit;\n\t\theight: 0;\n\t}\n\n\timg {\n\t\tborder-style: none;\n\t}\n\n\timg, svg, video, canvas, audio, iframe, embed, object {\n\t\tdisplay: block;\n\t}\n\n\tlegend {\n\t\tcolor: inherit;\n\t\tdisplay: table;\n\t\tmax-width: 100%;\n\t\tpadding: 0;\n\t\twhite-space: normal;\n\t}\n\n\tmain {\n\t\tdisplay: block;\n\t}\n\n\tol, ul {\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t}\n\n\tprogress {\n\t\tvertical-align: baseline;\n\t}\n\n\tsummary {\n\t\tdisplay: list-item;\n\t}\n\n\tsmall {\n\t\tfont-size: 80%;\n\t}\n\n\tsub, sup {\n\t\tfont-size: 75%;\n\t\tline-height: 0;\n\t\tposition: relative;\n\t\tvertical-align: baseline;\n\t}\n\n\tsub {\n\t\tbottom: -0.25em;\n\t}\n\n\tsup {\n\t\ttop: -0.5em;\n\t}\n\n\ttable {\n\t\ttext-indent: 0;\n\t\tborder-color: inherit;\n\t}\n\n\ttemplate {\n\t\tdisplay: none;\n\t}\n\n\ttextarea {\n\t\toverflow: auto;\n\t}\n\n\t::-moz-focus-inner {\n\t\tborder-style: none;\n\t\tpadding: 0;\n\t}\n\n\t::-webkit-file-upload-button {\n\t\tfont: inherit;\n\t\t-webkit-appearance: button;\n\t}\n\n\t[type=checkbox], [type=radio] {\n\t\tpadding: 0;\n\t}\n\n\t[type=number]::-webkit-inner-spin-button,\n\t[type=number]::-webkit-outer-spin-button {\n\t\theight: auto;\n\t}\n\n\t[type=search] {\n\t\toutline-offset: -2px;\n\t\t-webkit-appearance: textfield;\n\t}\n\n\t[type=search]::-webkit-search-decoration {\n\t\t-webkit-appearance: none;\n\t}\n\n\t[hidden] {\n\t\tdisplay: none;\n\t}\n"])));
|
|
9
10
|
var templateObject_1;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { VuiTheme } from '../../theme';
|
|
3
|
+
declare type VuiProviderProps = {
|
|
4
|
+
/** Adds basic styles to body @default true */
|
|
5
|
+
globalStyle?: boolean;
|
|
6
|
+
/** Applies custom CSS reset @default true */
|
|
7
|
+
resetCSS?: boolean;
|
|
8
|
+
/** Modified theme config using 'extendTheme' utility */
|
|
9
|
+
theme?: VuiTheme;
|
|
10
|
+
};
|
|
11
|
+
/** Provides theme to all wrapped components and by default includes CSS reset and global styles. */
|
|
12
|
+
declare const VuiProvider: FC<VuiProviderProps>;
|
|
13
|
+
export default VuiProvider;
|
|
@@ -5,14 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var styled_components_1 = require("styled-components");
|
|
8
|
+
var popoverStyle_1 = __importDefault(require("../../popover/popoverStyle"));
|
|
9
|
+
var theme_1 = __importDefault(require("../../theme"));
|
|
8
10
|
var globalStyle_1 = __importDefault(require("./globalStyle"));
|
|
9
11
|
var resetCSS_1 = __importDefault(require("./resetCSS"));
|
|
10
|
-
|
|
12
|
+
/** Provides theme to all wrapped components and by default includes CSS reset and global styles. */
|
|
11
13
|
var VuiProvider = function (_a) {
|
|
12
14
|
var children = _a.children, _b = _a.globalStyle, globalStyle = _b === void 0 ? true : _b, _c = _a.resetCSS, resetCSS = _c === void 0 ? true : _c, _d = _a.theme, theme = _d === void 0 ? theme_1.default : _d;
|
|
13
15
|
return (react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme },
|
|
14
16
|
resetCSS && react_1.default.createElement(resetCSS_1.default, null),
|
|
15
17
|
react_1.default.createElement(globalStyle_1.default, { globalStyle: globalStyle }),
|
|
18
|
+
react_1.default.createElement(popoverStyle_1.default, null),
|
|
16
19
|
children));
|
|
17
20
|
};
|
|
18
21
|
exports.default = VuiProvider;
|
package/divider/divider.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DividerProps } from './divider.types';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
export declare const DividerBase: import("styled-components").StyledComponent<"hr", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
3
|
+
/** Visually separates content with a horizontal or vertical line. */
|
|
4
4
|
export declare const Divider: import("../core").VuiComponent<"hr", DividerProps>;
|
|
5
5
|
export default Divider;
|
package/divider/divider.js
CHANGED
|
@@ -31,11 +31,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.Divider = exports.DividerBase = void 0;
|
|
33
33
|
var react_1 = __importDefault(require("react"));
|
|
34
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
35
34
|
var core_1 = require("../core");
|
|
36
|
-
var system_1 = require("../system");
|
|
37
35
|
var utils_1 = require("../utils");
|
|
38
|
-
exports.DividerBase =
|
|
36
|
+
exports.DividerBase = core_1.styled.hrBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tborder-color: grey.30;\n"], ["\n\tborder-color: grey.30;\n"
|
|
37
|
+
/** Visually separates content with a horizontal or vertical line. */
|
|
38
|
+
])));
|
|
39
|
+
/** Visually separates content with a horizontal or vertical line. */
|
|
39
40
|
exports.Divider = (0, core_1.vui)(function (props, ref) {
|
|
40
41
|
var _a;
|
|
41
42
|
var _b = (0, core_1.omitThemingProps)(props), className = _b.className, isVertical = _b.isVertical, width = _b.width, rest = __rest(_b, ["className", "isVertical", "width"]);
|
|
@@ -46,7 +47,7 @@ exports.Divider = (0, core_1.vui)(function (props, ref) {
|
|
|
46
47
|
var aliasedProps = (0, utils_1.filterUndefined)((_a = {},
|
|
47
48
|
_a[borderWidth] = width !== null && width !== void 0 ? width : 1,
|
|
48
49
|
_a));
|
|
49
|
-
return (react_1.default.createElement(exports.DividerBase, __assign({
|
|
50
|
+
return (react_1.default.createElement(exports.DividerBase, __assign({ className: (0, utils_1.cs)('vui-divider', className), h: height, ref: ref }, styles, aliasedProps, rest)));
|
|
50
51
|
});
|
|
51
52
|
exports.Divider.displayName = 'Divider';
|
|
52
53
|
exports.default = exports.Divider;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { BordersProps, SystemProps } from '../system';
|
|
2
2
|
import { ThemingProps } from '../theme';
|
|
3
|
-
export
|
|
3
|
+
export declare type DividerProps = SystemProps & ThemingProps<'Divider'> & {
|
|
4
|
+
/** Children are disabled for this component. */
|
|
4
5
|
children?: never;
|
|
6
|
+
/** Renders the line vertically using 100% height. */
|
|
5
7
|
isVertical?: boolean;
|
|
8
|
+
/** Defines thickness of the line. */
|
|
6
9
|
width?: BordersProps['borderWidth'];
|
|
7
|
-
}
|
|
10
|
+
};
|
package/divider/index.d.ts
CHANGED
package/divider/index.js
CHANGED
|
@@ -15,6 +15,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.default = void 0;
|
|
17
17
|
__exportStar(require("./divider"), exports);
|
|
18
|
-
__exportStar(require("./divider.types"), exports);
|
|
19
18
|
var divider_1 = require("./divider");
|
|
20
19
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(divider_1).default; } });
|
|
20
|
+
__exportStar(require("./divider.types"), exports);
|
package/divider/theme.d.ts
CHANGED
package/divider/theme.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var baseStyle = {};
|
|
3
4
|
var defaultProps = {};
|
|
4
5
|
var sizes = {};
|
|
5
6
|
var variants = {};
|
|
6
7
|
exports.default = {
|
|
8
|
+
baseStyle: baseStyle,
|
|
7
9
|
defaultProps: defaultProps,
|
|
8
10
|
sizes: sizes,
|
|
9
11
|
variants: variants
|
package/footer/consts.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { FooterColumnsData } from './footer.types';
|
|
|
4
4
|
* Links' url values here are unique references to actual urls in the footerLinks dictionary.
|
|
5
5
|
*/
|
|
6
6
|
export declare const footerColumnsTemplate: FooterColumnsData;
|
|
7
|
+
/** Footer link URLs used in Production environment. */
|
|
7
8
|
export declare const footerLinksProd: {
|
|
8
9
|
readonly aboutVeracity: "https://www.veracity.com/about";
|
|
9
10
|
readonly apiExplorer: "https://developer.veracity.com/api";
|
|
@@ -25,6 +26,7 @@ export declare const footerLinksProd: {
|
|
|
25
26
|
readonly veracityPartnerProgram: "https://www.veracity.com/partner";
|
|
26
27
|
readonly veracityTrustCenter: "https://www.veracity.com/veracity-trust-center";
|
|
27
28
|
};
|
|
29
|
+
/** Footer link URLs used in Staging environment. */
|
|
28
30
|
export declare const footerLinksStag: {
|
|
29
31
|
readonly aboutVeracity: "https://wwwstag.veracity.com/about";
|
|
30
32
|
readonly apiExplorer: "https://developer.veracity.com/api";
|
|
@@ -46,6 +48,7 @@ export declare const footerLinksStag: {
|
|
|
46
48
|
readonly veracityPartnerProgram: "https://wwwstag.veracity.com/partner";
|
|
47
49
|
readonly veracityTrustCenter: "https://www.veracity.com/veracity-trust-center";
|
|
48
50
|
};
|
|
51
|
+
/** Footer link URLs used in Test environment. */
|
|
49
52
|
export declare const footerLinksTest: {
|
|
50
53
|
readonly aboutVeracity: "https://wwwtest.veracity.com/about";
|
|
51
54
|
readonly apiExplorer: "https://developer.veracity.com/api";
|
package/footer/consts.js
CHANGED
|
@@ -64,6 +64,7 @@ exports.footerColumnsTemplate = {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
+
/** Footer link URLs used in Production environment. */
|
|
67
68
|
exports.footerLinksProd = {
|
|
68
69
|
aboutVeracity: 'https://www.veracity.com/about',
|
|
69
70
|
apiExplorer: 'https://developer.veracity.com/api',
|
|
@@ -85,6 +86,7 @@ exports.footerLinksProd = {
|
|
|
85
86
|
veracityPartnerProgram: 'https://www.veracity.com/partner',
|
|
86
87
|
veracityTrustCenter: 'https://www.veracity.com/veracity-trust-center'
|
|
87
88
|
};
|
|
89
|
+
/** Footer link URLs used in Staging environment. */
|
|
88
90
|
exports.footerLinksStag = {
|
|
89
91
|
aboutVeracity: 'https://wwwstag.veracity.com/about',
|
|
90
92
|
apiExplorer: 'https://developer.veracity.com/api',
|
|
@@ -106,6 +108,7 @@ exports.footerLinksStag = {
|
|
|
106
108
|
veracityPartnerProgram: 'https://wwwstag.veracity.com/partner',
|
|
107
109
|
veracityTrustCenter: 'https://www.veracity.com/veracity-trust-center'
|
|
108
110
|
};
|
|
111
|
+
/** Footer link URLs used in Test environment. */
|
|
109
112
|
exports.footerLinksTest = {
|
|
110
113
|
aboutVeracity: 'https://wwwtest.veracity.com/about',
|
|
111
114
|
apiExplorer: 'https://developer.veracity.com/api',
|
package/footer/footer.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ import FooterHeading from './footerHeading';
|
|
|
5
5
|
import FooterLink from './footerLink';
|
|
6
6
|
import FooterRow from './footerRow';
|
|
7
7
|
import FooterSection from './footerSection';
|
|
8
|
-
declare const
|
|
8
|
+
export declare const FooterBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
9
|
+
/** Branded Veracity Footer with trademark and links sections. Controls max-width of the content. */
|
|
10
|
+
export declare const Footer: VuiComponent<"div", FooterProps> & {
|
|
9
11
|
Column: typeof FooterColumn;
|
|
10
12
|
Heading: typeof FooterHeading;
|
|
11
13
|
Link: typeof FooterLink;
|
package/footer/footer.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
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
|
+
};
|
|
2
6
|
var __assign = (this && this.__assign) || function () {
|
|
3
7
|
__assign = Object.assign || function(t) {
|
|
4
8
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -41,19 +45,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
41
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
46
|
};
|
|
43
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.Footer = exports.FooterBase = void 0;
|
|
44
49
|
var react_1 = __importDefault(require("react"));
|
|
45
50
|
var box_1 = require("../box");
|
|
46
51
|
var core_1 = require("../core");
|
|
47
52
|
var divider_1 = require("../divider");
|
|
53
|
+
var utils_1 = require("../utils");
|
|
48
54
|
var footerColumn_1 = __importDefault(require("./footerColumn"));
|
|
49
55
|
var footerHeading_1 = __importDefault(require("./footerHeading"));
|
|
50
56
|
var footerLink_1 = __importDefault(require("./footerLink"));
|
|
51
57
|
var footerRow_1 = __importDefault(require("./footerRow"));
|
|
52
58
|
var footerSection_1 = __importDefault(require("./footerSection"));
|
|
53
59
|
var footerTrademark_1 = __importDefault(require("./footerTrademark"));
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
60
|
+
exports.FooterBase = core_1.styled.divBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tbackground-color: prussian.80;\n\tcolor: white;\n\tpadding: 5 3;\n"], ["\n\tbackground-color: prussian.80;\n\tcolor: white;\n\tpadding: 5 3;\n"
|
|
61
|
+
/** Branded Veracity Footer with trademark and links sections. Controls max-width of the content. */
|
|
62
|
+
])));
|
|
63
|
+
/** Branded Veracity Footer with trademark and links sections. Controls max-width of the content. */
|
|
64
|
+
exports.Footer = (0, core_1.vui)(function (props, ref) {
|
|
65
|
+
var children = props.children, className = props.className, columns = props.columns, rest = __rest(props, ["children", "className", "columns"]);
|
|
66
|
+
return (react_1.default.createElement(exports.FooterBase, __assign({ className: (0, utils_1.cs)('vui-footer', className), ref: ref }, rest),
|
|
57
67
|
react_1.default.createElement(box_1.Box, { column: true, maxW: 1200, mx: "auto", w: "100%" }, children !== null && children !== void 0 ? children : (columns && (react_1.default.createElement(footerRow_1.default, null, Object.entries(columns).map(function (_a) {
|
|
58
68
|
var _b = __read(_a, 2), columnName = _b[0], column = _b[1];
|
|
59
69
|
return (react_1.default.createElement(footerColumn_1.default, { key: columnName }, Object.entries(column).map(function (_a) {
|
|
@@ -65,10 +75,11 @@ var Footer = (0, core_1.vui)(function (props, ref) {
|
|
|
65
75
|
react_1.default.createElement(footerRow_1.default, null,
|
|
66
76
|
react_1.default.createElement(footerTrademark_1.default, null)))));
|
|
67
77
|
});
|
|
68
|
-
Footer.displayName = 'Footer';
|
|
69
|
-
Footer.Column = footerColumn_1.default;
|
|
70
|
-
Footer.Heading = footerHeading_1.default;
|
|
71
|
-
Footer.Link = footerLink_1.default;
|
|
72
|
-
Footer.Row = footerRow_1.default;
|
|
73
|
-
Footer.Section = footerSection_1.default;
|
|
74
|
-
exports.default = Footer;
|
|
78
|
+
exports.Footer.displayName = 'Footer';
|
|
79
|
+
exports.Footer.Column = footerColumn_1.default;
|
|
80
|
+
exports.Footer.Heading = footerHeading_1.default;
|
|
81
|
+
exports.Footer.Link = footerLink_1.default;
|
|
82
|
+
exports.Footer.Row = footerRow_1.default;
|
|
83
|
+
exports.Footer.Section = footerSection_1.default;
|
|
84
|
+
exports.default = exports.Footer;
|
|
85
|
+
var templateObject_1;
|