@veracity/vui 0.3.1 → 0.4.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.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 +16 -34
- 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/consts.js +2 -2
- 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/core/vuiProvider/index.js +26 -0
- package/core/{resetCSS.d.ts → vuiProvider/resetCSS.d.ts} +1 -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} +3 -2
- 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 +108 -8
- package/footer/consts.js +21 -9
- 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/helpers.d.ts +2 -3
- package/footer/helpers.js +16 -16
- 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/consts.d.ts +58 -0
- package/header/consts.js +76 -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 +133 -0
- package/header/header.types.d.ts +103 -0
- package/header/headerAccount.d.ts +4 -0
- package/header/headerAccount.js +109 -0
- package/header/headerAccount.types.d.ts +35 -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 +47 -0
- package/header/headerDivider.d.ts +4 -0
- package/header/headerDivider.js +28 -0
- package/header/headerLinkItem.d.ts +4 -0
- package/header/headerLinkItem.js +53 -0
- package/header/headerLinksList.d.ts +4 -0
- package/header/headerLinksList.js +44 -0
- package/header/headerLogo.d.ts +4 -0
- package/header/headerLogo.js +44 -0
- package/header/headerMobileContent.d.ts +4 -0
- package/header/headerMobileContent.js +31 -0
- package/header/headerMobileToggle.d.ts +4 -0
- package/header/headerMobileToggle.js +33 -0
- package/header/headerNotifications.d.ts +4 -0
- package/header/headerNotifications.js +51 -0
- package/header/headerServices.d.ts +4 -0
- package/header/headerServices.js +55 -0
- package/header/headerSignIn.d.ts +4 -0
- package/header/headerSignIn.js +40 -0
- package/header/helpers.d.ts +17 -0
- package/header/helpers.js +66 -0
- package/header/index.d.ts +21 -0
- package/header/index.js +38 -0
- package/header/loggedInHeader.d.ts +4 -0
- package/header/loggedInHeader.js +57 -0
- package/header/loggedOutHeader.d.ts +4 -0
- package/header/loggedOutHeader.js +57 -0
- package/header/theme.d.ts +85 -0
- package/header/theme.js +89 -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/fas/fasCalendarAlt.js +1 -1
- 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 +3 -1
- package/index.js +3 -1
- package/input/consts.js +2 -2
- 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 +36 -7
- 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 +15 -7
- 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 +9 -23
- 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/modal/context.d.ts +4 -0
- package/modal/context.js +23 -0
- package/modal/focusLock.d.ts +9 -0
- package/modal/focusLock.js +47 -0
- package/modal/focusLock.types.d.ts +28 -0
- package/modal/focusLock.types.js +2 -0
- package/modal/index.d.ts +7 -0
- package/modal/index.js +24 -0
- package/modal/modal.d.ts +10 -0
- package/modal/modal.js +109 -0
- package/modal/modal.types.d.ts +40 -0
- package/modal/modal.types.js +2 -0
- package/modal/modalBackdrop.d.ts +4 -0
- package/modal/modalBackdrop.js +38 -0
- package/modal/modalManager.d.ts +12 -0
- package/modal/modalManager.js +33 -0
- package/modal/theme.d.ts +7 -0
- package/modal/theme.js +12 -0
- package/notification/consts.js +2 -2
- 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 +11 -4
- 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 +3 -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 +1 -1
- package/popover/index.js +1 -1
- package/popover/popover.d.ts +6 -2
- package/popover/popover.js +20 -4
- package/popover/popover.types.d.ts +4 -1
- package/popover/popoverContent.d.ts +2 -1
- package/popover/popoverContent.js +6 -1
- 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 +26 -18
- package/popover/usePopover.types.d.ts +17 -6
- package/portal/index.d.ts +3 -0
- package/{styles → portal}/index.js +5 -5
- package/portal/portal.d.ts +5 -0
- package/portal/portal.js +56 -0
- package/portal/portal.types.d.ts +7 -0
- package/portal/portal.types.js +2 -0
- 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 +16 -5
- package/svg/svg.types.d.ts +7 -5
- 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 +19 -6
- 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 +129 -2
- package/theme/components.js +38 -36
- package/theme/defaultTheme.d.ts +134 -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/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/object.d.ts +2 -2
- package/utils/object.js +3 -1
- package/utils/react.d.ts +10 -5
- package/utils/react.js +64 -9
- package/utils/string.d.ts +5 -0
- package/utils/string.js +19 -0
- package/utils/styles.d.ts +2 -2
- package/utils/styles.js +4 -4
- package/utils/types.d.ts +11 -4
- 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/headerAccount.types.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.yellow = exports.red = exports.prussian = exports.pink = exports.grey = exports.green = exports.blue = void 0;
|
|
3
|
+
exports.disabled = exports.yellow = exports.red = exports.prussian = exports.pink = exports.grey = exports.green = exports.blue = void 0;
|
|
4
4
|
exports.blue = {
|
|
5
5
|
10: '#f6fbff',
|
|
6
6
|
20: '#e2f1ff',
|
|
@@ -85,6 +85,11 @@ exports.yellow = {
|
|
|
85
85
|
90: '#b67b08',
|
|
86
86
|
100: '#83591a'
|
|
87
87
|
};
|
|
88
|
+
exports.disabled = {
|
|
89
|
+
bg: exports.grey[10],
|
|
90
|
+
border: exports.grey[50],
|
|
91
|
+
color: exports.grey[50]
|
|
92
|
+
};
|
|
88
93
|
exports.default = {
|
|
89
94
|
blue: exports.blue,
|
|
90
95
|
green: exports.green,
|
|
@@ -92,5 +97,6 @@ exports.default = {
|
|
|
92
97
|
pink: exports.pink,
|
|
93
98
|
prussian: exports.prussian,
|
|
94
99
|
red: exports.red,
|
|
95
|
-
yellow: exports.yellow
|
|
100
|
+
yellow: exports.yellow,
|
|
101
|
+
disabled: exports.disabled
|
|
96
102
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var colors_1 = require("./colors");
|
|
4
3
|
var utils_1 = require("../../utils");
|
|
5
|
-
var
|
|
6
|
-
var
|
|
4
|
+
var colors_1 = require("./colors");
|
|
5
|
+
var greyLight = (0, utils_1.hexToRGBA)(colors_1.grey[80], 0.4);
|
|
6
|
+
var greyDark = (0, utils_1.hexToRGBA)(colors_1.grey[80], 0.6);
|
|
7
7
|
exports.default = {
|
|
8
8
|
'0': "0 0 0 0 #fff",
|
|
9
9
|
'1': "0 2px 5px 0 " + greyLight,
|
|
@@ -19,12 +19,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
var system_1 = require("@xstyled/system");
|
|
20
20
|
exports.default = {
|
|
21
21
|
border: function (value, _a) {
|
|
22
|
+
var _b;
|
|
22
23
|
var props = _a.props;
|
|
23
24
|
if (typeof value === 'number')
|
|
24
25
|
return value + "px solid";
|
|
25
26
|
var values = value.split(' ');
|
|
26
|
-
var
|
|
27
|
-
var colorValue = (0, system_1.getColor)(color)(props);
|
|
27
|
+
var _c = __read(values, 3), width = _c[0], _d = _c[1], style = _d === void 0 ? '' : _d, color = _c[2];
|
|
28
|
+
var colorValue = (_b = (0, system_1.getColor)(color)(props)) !== null && _b !== void 0 ? _b : '';
|
|
28
29
|
return width + " " + style + " " + colorValue;
|
|
29
30
|
},
|
|
30
31
|
space: function (value) {
|
package/theme/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import defaultTheme from './defaultTheme';
|
|
2
1
|
export { default as components } from './components';
|
|
3
|
-
export { default as defaultTheme } from './defaultTheme';
|
|
2
|
+
export { default, default as defaultTheme } from './defaultTheme';
|
|
4
3
|
export { default as foundations } from './foundations';
|
|
5
4
|
export { default as animations } from './foundations/animations';
|
|
6
5
|
export { default as borders } from './foundations/borders';
|
|
@@ -19,4 +18,3 @@ export { default as transforms } from './foundations/transforms';
|
|
|
19
18
|
export { default as transitions } from './foundations/transitions';
|
|
20
19
|
export { default as zIndices } from './foundations/zIndices';
|
|
21
20
|
export * from './types';
|
|
22
|
-
export default defaultTheme;
|
package/theme/index.js
CHANGED
|
@@ -13,12 +13,12 @@ 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.zIndices = exports.transitions = exports.transforms = exports.spaces = exports.sizes = exports.shadows = exports.screens = exports.ringWidths = exports.radii = exports.fontWeights = exports.fontSizes = exports.fonts = exports.durations = exports.colors = exports.borders = exports.animations = exports.foundations = exports.defaultTheme = exports.components = void 0;
|
|
17
|
-
var defaultTheme_1 = __importDefault(require("./defaultTheme"));
|
|
16
|
+
exports.zIndices = exports.transitions = exports.transforms = exports.spaces = exports.sizes = exports.shadows = exports.screens = exports.ringWidths = exports.radii = exports.fontWeights = exports.fontSizes = exports.fonts = exports.durations = exports.colors = exports.borders = exports.animations = exports.foundations = exports.defaultTheme = exports.default = exports.components = void 0;
|
|
18
17
|
var components_1 = require("./components");
|
|
19
18
|
Object.defineProperty(exports, "components", { enumerable: true, get: function () { return __importDefault(components_1).default; } });
|
|
20
|
-
var
|
|
21
|
-
Object.defineProperty(exports, "
|
|
19
|
+
var defaultTheme_1 = require("./defaultTheme");
|
|
20
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(defaultTheme_1).default; } });
|
|
21
|
+
Object.defineProperty(exports, "defaultTheme", { enumerable: true, get: function () { return __importDefault(defaultTheme_1).default; } });
|
|
22
22
|
var foundations_1 = require("./foundations");
|
|
23
23
|
Object.defineProperty(exports, "foundations", { enumerable: true, get: function () { return __importDefault(foundations_1).default; } });
|
|
24
24
|
var animations_1 = require("./foundations/animations");
|
|
@@ -54,4 +54,3 @@ Object.defineProperty(exports, "transitions", { enumerable: true, get: function
|
|
|
54
54
|
var zIndices_1 = require("./foundations/zIndices");
|
|
55
55
|
Object.defineProperty(exports, "zIndices", { enumerable: true, get: function () { return __importDefault(zIndices_1).default; } });
|
|
56
56
|
__exportStar(require("./types"), exports);
|
|
57
|
-
exports.default = defaultTheme_1.default;
|
package/theme/types.d.ts
CHANGED
|
@@ -13,9 +13,10 @@ export declare type VuiThemeDefaults = typeof defaultTheme;
|
|
|
13
13
|
/** Can be extended to add new properties to the theme or override default ones */
|
|
14
14
|
export interface VuiThemeExtensions {
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
/** Defines variant and size types of each component connected to the theme. */
|
|
17
|
+
export declare type ThemingProps<ThemeComponent extends string = string> = {
|
|
17
18
|
variant?: ThemeComponent extends Component ? keyof VuiTheme['components'][ThemeComponent]['variants'] : string;
|
|
18
19
|
size?: ThemeComponent extends keyof VuiTheme['components'] ? keyof VuiTheme['components'][ThemeComponent]['sizes'] : string;
|
|
19
|
-
}
|
|
20
|
+
};
|
|
20
21
|
/** VUI theme definition object, containing default values and extensions */
|
|
21
22
|
export declare type VuiTheme = VuiThemeDefaults & VuiThemeExtensions;
|
package/utils/assertion.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { Dict } from './types';
|
|
3
3
|
/** Is value an array. */
|
|
4
4
|
export declare function isArray<T>(value: any): value is T[];
|
|
@@ -6,9 +6,9 @@ export declare function isArray<T>(value: any): value is T[];
|
|
|
6
6
|
export declare function isFunction<T extends Function = Function>(value: any): value is T;
|
|
7
7
|
/** Is value a number. */
|
|
8
8
|
export declare function isNumber(value: any): value is number;
|
|
9
|
-
/** Is value
|
|
10
|
-
export declare function isObject(value: any): value is
|
|
11
|
-
/** Is value a valid ReactText - string or number */
|
|
9
|
+
/** Is value a regular object (functions, arrays and React elements excluded). */
|
|
10
|
+
export declare function isObject<T = Dict>(value: any): value is T;
|
|
11
|
+
/** Is value a valid ReactText - string or number. */
|
|
12
12
|
export declare function isReactText(value: any): value is React.ReactText;
|
|
13
|
-
/** Is value a string */
|
|
13
|
+
/** Is value a string. */
|
|
14
14
|
export declare function isString(value: any): value is string;
|
package/utils/assertion.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.isString = exports.isReactText = exports.isObject = exports.isNumber = exports.isFunction = exports.isArray = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
4
8
|
/** Is value an array. */
|
|
5
9
|
function isArray(value) {
|
|
6
10
|
return Array.isArray(value);
|
|
@@ -16,17 +20,17 @@ function isNumber(value) {
|
|
|
16
20
|
return typeof value === 'number';
|
|
17
21
|
}
|
|
18
22
|
exports.isNumber = isNumber;
|
|
19
|
-
/** Is value
|
|
23
|
+
/** Is value a regular object (functions, arrays and React elements excluded). */
|
|
20
24
|
function isObject(value) {
|
|
21
|
-
return !!value && typeof value === 'object' && !isFunction(value) && !isArray(value);
|
|
25
|
+
return !!value && typeof value === 'object' && !isFunction(value) && !isArray(value) && !react_1.default.isValidElement(value);
|
|
22
26
|
}
|
|
23
27
|
exports.isObject = isObject;
|
|
24
|
-
/** Is value a valid ReactText - string or number */
|
|
28
|
+
/** Is value a valid ReactText - string or number. */
|
|
25
29
|
function isReactText(value) {
|
|
26
30
|
return isNumber(value) || isString(value);
|
|
27
31
|
}
|
|
28
32
|
exports.isReactText = isReactText;
|
|
29
|
-
/** Is value a string */
|
|
33
|
+
/** Is value a string. */
|
|
30
34
|
function isString(value) {
|
|
31
35
|
return Object.prototype.toString.call(value) === '[object String]';
|
|
32
36
|
}
|
package/utils/index.d.ts
CHANGED
package/utils/index.js
CHANGED
|
@@ -14,5 +14,6 @@ __exportStar(require("./assertion"), exports);
|
|
|
14
14
|
__exportStar(require("./function"), exports);
|
|
15
15
|
__exportStar(require("./object"), exports);
|
|
16
16
|
__exportStar(require("./react"), exports);
|
|
17
|
+
__exportStar(require("./string"), exports);
|
|
17
18
|
__exportStar(require("./styles"), exports);
|
|
18
19
|
__exportStar(require("./types"), exports);
|
package/utils/object.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dict } from './types';
|
|
2
2
|
/** Removes keys from an object if their value is undefined. */
|
|
3
|
-
export declare
|
|
3
|
+
export declare function filterUndefined<T = Dict>(object: T): Partial<T>;
|
|
4
4
|
/**
|
|
5
5
|
* Recursively deep merges two objects in an immutable fashion, following these rules:
|
|
6
6
|
* - Key exists in target and both keys are objects => merge
|
|
@@ -14,4 +14,4 @@ export declare function merge<S1 extends Dict, S2 extends Dict, S3 extends Dict,
|
|
|
14
14
|
/**
|
|
15
15
|
* Returns the items of an object that meet the condition specified in a callback function.
|
|
16
16
|
*/
|
|
17
|
-
export declare function objectFilter<T extends Dict>(object: T, fn: (value: any, key: string, object: T) => boolean):
|
|
17
|
+
export declare function objectFilter<T extends Dict, K extends keyof T>(object: T, fn: (value: any, key: string, object: T) => boolean): Partial<T>;
|
package/utils/object.js
CHANGED
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.objectFilter = exports.merge = exports.filterUndefined = void 0;
|
|
4
4
|
var assertion_1 = require("./assertion");
|
|
5
5
|
/** Removes keys from an object if their value is undefined. */
|
|
6
|
-
|
|
6
|
+
function filterUndefined(object) {
|
|
7
|
+
return objectFilter(object, function (val) { return val !== null && val !== undefined; });
|
|
8
|
+
}
|
|
7
9
|
exports.filterUndefined = filterUndefined;
|
|
8
10
|
function merge() {
|
|
9
11
|
var sources = [];
|
package/utils/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { CreateContextOptions, CreateContextReturn } from './types';
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import { AnyFunction, CreateContextOptions, CreateContextReturn } from './types';
|
|
3
3
|
declare type ReactRef<T> = React.Ref<T> | React.RefObject<T> | React.MutableRefObject<T>;
|
|
4
4
|
/**
|
|
5
5
|
* Assigns given value to the provided ref.
|
|
@@ -10,9 +10,14 @@ export declare function assignRef<T = any>(ref: ReactRef<T> | undefined, value:
|
|
|
10
10
|
export declare function createContext<ContextType>(options?: CreateContextOptions): CreateContextReturn<ContextType>;
|
|
11
11
|
/** Assigns a node to all provided refs. */
|
|
12
12
|
export declare function mergeRefs<T>(...refs: (ReactRef<T> | undefined)[]): (node: T | null) => void;
|
|
13
|
+
/** Returns given callback with a stable reference, but keeps it updated internally. */
|
|
14
|
+
export declare function useCallbackRef<T extends AnyFunction>(callback?: T): T;
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
+
* Triggers given callback when an event happens outside of a given element.
|
|
17
|
+
* Event listeners are attached to the window object.
|
|
18
|
+
* @param ref - element to check click position for
|
|
19
|
+
* @param callback - function triggered on outside click
|
|
20
|
+
* @param events - array of events listened for (default: ['mousedown', 'touchstart'])
|
|
16
21
|
*/
|
|
17
|
-
export declare function
|
|
22
|
+
export declare function useClickOutside(ref: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[], callback?: (event: Event) => void, events?: string[]): void;
|
|
18
23
|
export {};
|
package/utils/react.js
CHANGED
|
@@ -19,8 +19,33 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
19
19
|
__setModuleDefault(result, mod);
|
|
20
20
|
return result;
|
|
21
21
|
};
|
|
22
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
23
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
24
|
+
if (!m) return o;
|
|
25
|
+
var i = m.call(o), r, ar = [], e;
|
|
26
|
+
try {
|
|
27
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
28
|
+
}
|
|
29
|
+
catch (error) { e = { error: error }; }
|
|
30
|
+
finally {
|
|
31
|
+
try {
|
|
32
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
33
|
+
}
|
|
34
|
+
finally { if (e) throw e.error; }
|
|
35
|
+
}
|
|
36
|
+
return ar;
|
|
37
|
+
};
|
|
38
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
+
if (ar || !(i in from)) {
|
|
41
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
+
ar[i] = from[i];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
|
+
};
|
|
22
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.
|
|
48
|
+
exports.useClickOutside = exports.useCallbackRef = exports.mergeRefs = exports.createContext = exports.assignRef = void 0;
|
|
24
49
|
var react_1 = __importStar(require("react"));
|
|
25
50
|
var assertion_1 = require("./assertion");
|
|
26
51
|
/**
|
|
@@ -69,15 +94,45 @@ function mergeRefs() {
|
|
|
69
94
|
};
|
|
70
95
|
}
|
|
71
96
|
exports.mergeRefs = mergeRefs;
|
|
97
|
+
// TODO: Bring it from UI-Utils
|
|
98
|
+
/** Returns given callback with a stable reference, but keeps it updated internally. */
|
|
99
|
+
function useCallbackRef(callback) {
|
|
100
|
+
var ref = (0, react_1.useRef)(callback);
|
|
101
|
+
ref.current = callback;
|
|
102
|
+
return (0, react_1.useCallback)((function () {
|
|
103
|
+
var _a;
|
|
104
|
+
var args = [];
|
|
105
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
106
|
+
args[_i] = arguments[_i];
|
|
107
|
+
}
|
|
108
|
+
return (_a = ref.current) === null || _a === void 0 ? void 0 : _a.call.apply(_a, __spreadArray([ref], __read(args), false));
|
|
109
|
+
}), []);
|
|
110
|
+
}
|
|
111
|
+
exports.useCallbackRef = useCallbackRef;
|
|
112
|
+
var defaultEvents = ['mousedown', 'touchstart'];
|
|
113
|
+
// TODO: Bring it from UI-Utils
|
|
72
114
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
115
|
+
* Triggers given callback when an event happens outside of a given element.
|
|
116
|
+
* Event listeners are attached to the window object.
|
|
117
|
+
* @param ref - element to check click position for
|
|
118
|
+
* @param callback - function triggered on outside click
|
|
119
|
+
* @param events - array of events listened for (default: ['mousedown', 'touchstart'])
|
|
75
120
|
*/
|
|
76
|
-
function
|
|
77
|
-
|
|
121
|
+
function useClickOutside(ref, callback, events) {
|
|
122
|
+
if (events === void 0) { events = defaultEvents; }
|
|
123
|
+
var eventsString = JSON.stringify(events);
|
|
124
|
+
var listener = useCallbackRef(function (ev) {
|
|
125
|
+
var refs = (0, assertion_1.isArray)(ref) ? ref : [ref];
|
|
126
|
+
var target = ev.target;
|
|
127
|
+
var isClickOutside = refs.every(function (ref) { return ref.current && !ref.current.contains(target); });
|
|
128
|
+
isClickOutside && (callback === null || callback === void 0 ? void 0 : callback(ev));
|
|
129
|
+
});
|
|
78
130
|
(0, react_1.useEffect)(function () {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
131
|
+
var events = JSON.parse(eventsString);
|
|
132
|
+
events.forEach(function (event) { return window.addEventListener(event, listener); });
|
|
133
|
+
return function () {
|
|
134
|
+
events.forEach(function (event) { return window.removeEventListener(event, listener); });
|
|
135
|
+
};
|
|
136
|
+
}, [eventsString, ref]);
|
|
82
137
|
}
|
|
83
|
-
exports.
|
|
138
|
+
exports.useClickOutside = useClickOutside;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds loggedIn=1 parameter to the URL if isLoggedIn flag is true, which means the user is logged in.
|
|
3
|
+
* This is supposed to aid login flow when navigating between Veracity applications.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getLoggedInLink(link: string, isLoggedIn?: boolean): string;
|
package/utils/string.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLoggedInLink = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Adds loggedIn=1 parameter to the URL if isLoggedIn flag is true, which means the user is logged in.
|
|
6
|
+
* This is supposed to aid login flow when navigating between Veracity applications.
|
|
7
|
+
*/
|
|
8
|
+
function getLoggedInLink(link, isLoggedIn) {
|
|
9
|
+
try {
|
|
10
|
+
var url = new URL(link);
|
|
11
|
+
if (isLoggedIn)
|
|
12
|
+
url.searchParams.append('loggedin', '1');
|
|
13
|
+
return url.toString();
|
|
14
|
+
}
|
|
15
|
+
catch (_a) {
|
|
16
|
+
return link;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.getLoggedInLink = getLoggedInLink;
|
package/utils/styles.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Concatenates individual className arguments and returns a single string. */
|
|
2
2
|
export declare function cs(...classNames: any[]): string;
|
|
3
|
-
/** Converts hex color value to rgb with optional alpha property */
|
|
4
|
-
export declare function
|
|
3
|
+
/** Converts hex color value to rgb with optional alpha property. */
|
|
4
|
+
export declare function hexToRGBA(hex: string, alpha?: number): string;
|
package/utils/styles.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.hexToRGBA = exports.cs = void 0;
|
|
4
4
|
/** Concatenates individual className arguments and returns a single string. */
|
|
5
5
|
function cs() {
|
|
6
6
|
var classNames = [];
|
|
@@ -10,8 +10,8 @@ function cs() {
|
|
|
10
10
|
return classNames.filter(Boolean).join(' ');
|
|
11
11
|
}
|
|
12
12
|
exports.cs = cs;
|
|
13
|
-
/** Converts hex color value to rgb with optional alpha property */
|
|
14
|
-
function
|
|
13
|
+
/** Converts hex color value to rgb with optional alpha property. */
|
|
14
|
+
function hexToRGBA(hex, alpha) {
|
|
15
15
|
var hexStr = hex;
|
|
16
16
|
if (hexStr.charAt(0) === '#') {
|
|
17
17
|
hexStr = hexStr.slice(1);
|
|
@@ -32,4 +32,4 @@ function hexToRGB(hex, alpha) {
|
|
|
32
32
|
return "rgb(" + r + ", " + g + ", " + b + ")";
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
exports.
|
|
35
|
+
exports.hexToRGBA = hexToRGBA;
|
package/utils/types.d.ts
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import React, { ComponentPropsWithoutRef, ComponentPropsWithRef, ElementType } from 'react';
|
|
2
|
-
|
|
2
|
+
/** Type for a a no-op function stub. */
|
|
3
|
+
export declare type AnyFunction = (...args: any[]) => any;
|
|
4
|
+
/** Type for any number without breaking autocompletion. */
|
|
3
5
|
export declare type AnyNumber = number & {};
|
|
6
|
+
/** Type for any string without breaking autocompletion. */
|
|
4
7
|
export declare type AnyString = string & {};
|
|
5
8
|
/** Type of change event defaulted to input element */
|
|
6
9
|
export declare type ChangeEvent<T = HTMLInputElement> = React.ChangeEvent<T>;
|
|
7
10
|
/** Type of change event handler defaulted to input element */
|
|
8
11
|
export declare type ChangeEventHandler<T = HTMLInputElement> = React.ChangeEventHandler<T>;
|
|
9
|
-
export
|
|
12
|
+
export declare type CreateContextOptions = {
|
|
10
13
|
/** Message displayed when context is used outside of the provider */
|
|
11
14
|
errorMessage?: string;
|
|
12
15
|
/** Accessing context outside of provider won't throw error */
|
|
13
16
|
isOptional?: boolean;
|
|
14
17
|
/** Name of the context */
|
|
15
18
|
name?: string;
|
|
16
|
-
}
|
|
19
|
+
};
|
|
20
|
+
/** Return value of the createContext function. */
|
|
17
21
|
export declare type CreateContextReturn<T> = [React.Provider<T>, () => T];
|
|
22
|
+
/** Basic dictionary typing. */
|
|
18
23
|
export declare type Dict<T = any> = Record<string, T>;
|
|
24
|
+
/** Classic application's environment names. */
|
|
25
|
+
export declare type Environment = 'Prod' | 'Stag' | 'Test';
|
|
19
26
|
/** Type of blur/focus event defaulted to any html element */
|
|
20
27
|
export declare type FocusEvent<T = HTMLElement> = React.FocusEvent<T>;
|
|
21
28
|
/** Type of blur/focus event handler defaulted to any html element */
|
|
@@ -28,11 +35,11 @@ export declare type KeyboardEventHandler<T = HTMLElement> = React.KeyboardEventH
|
|
|
28
35
|
export declare type MouseEvent<T = HTMLElement> = React.MouseEvent<T>;
|
|
29
36
|
/** Type of mouse event handler defaulted to any html element */
|
|
30
37
|
export declare type MouseEventHandler<T = HTMLElement> = React.MouseEventHandler<T>;
|
|
31
|
-
export declare type PropGetter<T extends ElementType, Props = {}> = (props: PropsOf<T, Props>, ref?: React.Ref<any> | React.RefObject<any>) => RefPropsOf<T>;
|
|
32
38
|
/** Merges component/element base props and custom props */
|
|
33
39
|
export declare type PropsOf<C extends ElementType, Props = {}> = RightJoinProps<ComponentPropsWithoutRef<C>, Props>;
|
|
34
40
|
/** Merges component/element base props and custom props including ref */
|
|
35
41
|
export declare type RefPropsOf<C extends ElementType, Props = {}> = RightJoinProps<ComponentPropsWithRef<C>, Props>;
|
|
42
|
+
/** Render props of component's children. */
|
|
36
43
|
export declare type RenderProps<P> = React.ReactNode | ((props: P) => React.ReactNode);
|
|
37
44
|
/** Merges props definitions, overriding source keys */
|
|
38
45
|
export declare type RightJoinProps<SourceProps, OverrideProps> = Omit<SourceProps, keyof OverrideProps> & OverrideProps;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ElementType, PropsWithoutRef, PropsWithChildren, ReactElement } from 'react';
|
|
2
|
-
import { PropsOf, RefPropsOf } from '../../utils';
|
|
3
|
-
/** VUI component interface, which allows element props inference and extension, 'as' and 'ref' */
|
|
4
|
-
export interface VuiComponent<C extends ElementType, Props = {}> {
|
|
5
|
-
<AsC extends ElementType>(props: PropsWithChildren<RefPropsOf<AsC, PropsOf<C, Props>>> & {
|
|
6
|
-
as: AsC;
|
|
7
|
-
}): ReactElement<any, any> | null;
|
|
8
|
-
(props: RefPropsOf<C, Props>): ReactElement<any, any> | null;
|
|
9
|
-
defaultProps?: Partial<PropsOf<C, Props>>;
|
|
10
|
-
displayName?: string;
|
|
11
|
-
}
|
|
12
|
-
/** Config for VUI component creator helper, which allows toggling memoization and 'areEqual' function */
|
|
13
|
-
export interface VuiComponentConfig<C extends ElementType, Props = {}> {
|
|
14
|
-
isMemo?: boolean;
|
|
15
|
-
memoCompare?: (prevProps: Readonly<PropsWithChildren<PropsWithoutRef<PropsOf<C, Props>>>>, nextProps: Readonly<PropsWithChildren<PropsWithoutRef<PropsOf<C, Props>>>>) => boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Simpler VUI component interface, which allows element props inference and extension
|
|
19
|
-
* Does not support 'as' or 'ref'
|
|
20
|
-
*/
|
|
21
|
-
export interface VC<C extends ElementType, Props = {}> {
|
|
22
|
-
(props: PropsOf<C, Props>): ReactElement<any, any> | null;
|
|
23
|
-
defaultProps?: Partial<PropsOf<C, Props>>;
|
|
24
|
-
displayName?: string;
|
|
25
|
-
}
|
package/core/types/index.d.ts
DELETED
package/core/types/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./component"), exports);
|
|
14
|
-
__exportStar(require("./themeGet"), exports);
|
package/core/types/themeGet.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { IProps, ThemeGetter } from '@xstyled/styled-components';
|
|
2
|
-
import { VuiTheme } from '../../theme';
|
|
3
|
-
import { AnyString, AnyNumber } from '../../utils';
|
|
4
|
-
declare type VuiThemeGetter<ThemeKey extends keyof VuiTheme> = ThemeGetter<keyof VuiTheme[ThemeKey] | AnyString | AnyNumber>;
|
|
5
|
-
export interface ThemeGet {
|
|
6
|
-
(path: string, defaultValue?: any): (props: IProps) => any;
|
|
7
|
-
animation: VuiThemeGetter<'animations'>;
|
|
8
|
-
borders: VuiThemeGetter<'borders'>;
|
|
9
|
-
color: VuiThemeGetter<'colors'>;
|
|
10
|
-
duration: VuiThemeGetter<'durations'>;
|
|
11
|
-
font: VuiThemeGetter<'fonts'>;
|
|
12
|
-
fontSize: VuiThemeGetter<'fontSizes'>;
|
|
13
|
-
fontWeight: VuiThemeGetter<'fontWeights'>;
|
|
14
|
-
radius: VuiThemeGetter<'radii'>;
|
|
15
|
-
ringWidth: VuiThemeGetter<'ringWidths'>;
|
|
16
|
-
screen: VuiThemeGetter<'screens'>;
|
|
17
|
-
shadow: VuiThemeGetter<'shadows'>;
|
|
18
|
-
size: VuiThemeGetter<'sizes'>;
|
|
19
|
-
space: VuiThemeGetter<'spaces'>;
|
|
20
|
-
transform: VuiThemeGetter<'transforms'>;
|
|
21
|
-
transition: VuiThemeGetter<'transitions'>;
|
|
22
|
-
zIndex: VuiThemeGetter<'zIndices'>;
|
|
23
|
-
}
|
|
24
|
-
export {};
|
package/core/utils.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { StyleGenerator } from '@xstyled/styled-components';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { StyledProps } from 'styled-components';
|
|
4
|
-
import { ThemeGet, VuiComponent, VuiComponentConfig } from './types';
|
|
5
|
-
import { Screen, ThemingProps, VuiTheme, VuiThemeExtensions } from '../theme';
|
|
6
|
-
import { AnyNumber, AnyString, Dict, PropsOf } from '../utils';
|
|
7
|
-
/** Merges provided theme extensions and overrides with default VUI theme */
|
|
8
|
-
export declare function extendTheme(extensions: VuiThemeExtensions): VuiTheme;
|
|
9
|
-
/**
|
|
10
|
-
* Provides configuration to the 'styled' function, which filters out xstyled system props
|
|
11
|
-
* Return type is cast to {} in order to avoid messing up styled component's actual props definition.
|
|
12
|
-
*/
|
|
13
|
-
export declare function forwardPropConfig(generator: StyleGenerator): {};
|
|
14
|
-
declare type ScreenWidth = Screen | AnyNumber | AnyString;
|
|
15
|
-
/** Returns CSS media string with appropriate min-width and max-width values */
|
|
16
|
-
export declare const mediaBetween: (minWidth: ScreenWidth, maxWidth: ScreenWidth) => (props: StyledProps<unknown>) => string;
|
|
17
|
-
/** Returns CSS media string with appropriate max-width value */
|
|
18
|
-
export declare const mediaDown: (width: ScreenWidth) => (props: StyledProps<unknown>) => string;
|
|
19
|
-
/** Returns CSS media string with appropriate min-width value */
|
|
20
|
-
export declare const mediaUp: (width: ScreenWidth) => (props: StyledProps<unknown>) => string;
|
|
21
|
-
/** Removes specific theming keys from the given props. */
|
|
22
|
-
export declare function omitThemingProps<T extends ThemingProps>(props: T): Omit<T, "size" | "variant">;
|
|
23
|
-
/**
|
|
24
|
-
* Custom validator to prevent certain props from reaching the HTML element.
|
|
25
|
-
* @param props - list of props to filter out
|
|
26
|
-
*/
|
|
27
|
-
export declare function shouldForwardProp(props: string[]): (prop: string | number, defaultValidatorFn: (prop: string | number) => boolean) => boolean;
|
|
28
|
-
/** Re-export of xstyled 'th' with custom typing and screen getter */
|
|
29
|
-
declare const th: ThemeGet;
|
|
30
|
-
export { th };
|
|
31
|
-
/** Returns true of current viewport width is between provided min and max widths */
|
|
32
|
-
export declare function useBetween(minWidth: ScreenWidth, maxWidth: ScreenWidth): boolean;
|
|
33
|
-
/** Returns true of current viewport width is smaller than provided width */
|
|
34
|
-
export declare function useDown(width: ScreenWidth): boolean;
|
|
35
|
-
/** Returns viewport width and provided screen width as a number */
|
|
36
|
-
export declare function useMedia(width: ScreenWidth): {
|
|
37
|
-
value: number;
|
|
38
|
-
viewportWidth: number | null;
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Retrieves and merges size and variant styling from a component's theme configuration.
|
|
42
|
-
* @param component - name of any component configured in the theme
|
|
43
|
-
* @param props - props object of the given component
|
|
44
|
-
*/
|
|
45
|
-
export declare function useStyleConfig(component: keyof VuiTheme['components'], props?: any): Dict<any>;
|
|
46
|
-
/** Returns theme value at the given path */
|
|
47
|
-
export declare function useTh(path: keyof VuiTheme | AnyString, defaultValue?: any): any;
|
|
48
|
-
/** Returns the theme object with extensions */
|
|
49
|
-
export declare function useTheme(): VuiTheme;
|
|
50
|
-
/** Returns true of current viewport width is larger or equal to provided width */
|
|
51
|
-
export declare function useUp(width: ScreenWidth): boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Component creation utility, which combines forwardRef, memo and ensures correct typing with all props included.
|
|
54
|
-
* Config object allows toggling memoization and providing custom 'areEqual' function.
|
|
55
|
-
*/
|
|
56
|
-
export declare function vui<C extends React.ElementType, Props = {}>(component: React.ForwardRefRenderFunction<any, PropsOf<C, Props>>, config?: VuiComponentConfig<C, Props>): VuiComponent<C, Props>;
|