@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
package/popover/theme.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var baseStyle = {};
|
|
3
4
|
var defaultProps = {};
|
|
4
5
|
var parts = ['content', 'trigger'];
|
|
5
6
|
var sizes = {};
|
|
6
7
|
var variants = {};
|
|
7
8
|
exports.default = {
|
|
9
|
+
baseStyle: baseStyle,
|
|
8
10
|
defaultProps: defaultProps,
|
|
9
11
|
parts: parts,
|
|
10
12
|
sizes: sizes,
|
package/popover/usePopover.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Instance, Props as TippyProps } from 'tippy.js';
|
|
3
3
|
import { UsePopoverProps } from './usePopover.types';
|
|
4
|
+
/**
|
|
5
|
+
* Controls the logic of instantiating and managing a tippy instance.
|
|
6
|
+
* Takes multiple configuration props that control closing, placement or behavior.
|
|
7
|
+
* Exposes functions used for ref callbacks on consuming components, programatic open/close methods and properties.
|
|
8
|
+
*/
|
|
4
9
|
export default function usePopover(props?: UsePopoverProps): {
|
|
5
10
|
close: () => void | undefined;
|
|
6
11
|
instance: Instance<TippyProps> | null;
|
package/popover/usePopover.js
CHANGED
|
@@ -37,49 +37,57 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
37
37
|
}
|
|
38
38
|
return ar;
|
|
39
39
|
};
|
|
40
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
41
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
42
|
+
if (ar || !(i in from)) {
|
|
43
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
44
|
+
ar[i] = from[i];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
48
|
+
};
|
|
40
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
51
|
};
|
|
43
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
var tippy_js_1 = __importDefault(require("tippy.js"));
|
|
45
53
|
var react_1 = require("react");
|
|
54
|
+
var tippy_js_1 = __importDefault(require("tippy.js"));
|
|
46
55
|
var utils_1 = require("../utils");
|
|
47
|
-
var
|
|
56
|
+
var consts_1 = require("./consts");
|
|
57
|
+
/**
|
|
58
|
+
* Controls the logic of instantiating and managing a tippy instance.
|
|
59
|
+
* Takes multiple configuration props that control closing, placement or behavior.
|
|
60
|
+
* Exposes functions used for ref callbacks on consuming components, programatic open/close methods and properties.
|
|
61
|
+
*/
|
|
48
62
|
function usePopover(props) {
|
|
49
63
|
if (props === void 0) { props = {}; }
|
|
50
64
|
var _a = props.closeOnBlur, closeOnBlur = _a === void 0 ? true : _a, _b = props.closeOnEsc, closeOnEsc = _b === void 0 ? true : _b, _c = props.defaultIsOpen, defaultIsOpen = _c === void 0 ? false : _c,
|
|
51
65
|
// disablePortal,
|
|
52
|
-
isOpenProp = props.isOpen,
|
|
53
|
-
// matchWidth,
|
|
54
|
-
offset = props.offset, onClose = props.onClose, onOpen = props.onOpen, options = props.options, _d = props.placement, placement = _d === void 0 ? 'bottom-start' : _d, plugins = props.plugins, _e = props.trigger, trigger = _e === void 0 ? 'click' : _e;
|
|
66
|
+
isOpenProp = props.isOpen, matchWidth = props.matchWidth, offset = props.offset, onCloseProp = props.onClose, onOpenProp = props.onOpen, options = props.options, _d = props.placement, placement = _d === void 0 ? 'bottom-start' : _d, _e = props.trigger, trigger = _e === void 0 ? 'click' : _e;
|
|
55
67
|
var _f = __read((0, react_1.useState)(isOpenProp !== null && isOpenProp !== void 0 ? isOpenProp : defaultIsOpen), 2), isOpen = _f[0], setIsOpen = _f[1];
|
|
56
68
|
var _g = __read((0, react_1.useState)(null), 2), instance = _g[0], setInstance = _g[1];
|
|
57
69
|
var _h = __read((0, react_1.useState)(null), 2), reference = _h[0], setReference = _h[1];
|
|
58
70
|
var _j = __read((0, react_1.useState)(null), 2), popper = _j[0], setPopper = _j[1];
|
|
59
71
|
var close = (0, react_1.useCallback)(function () { return instance === null || instance === void 0 ? void 0 : instance.hide(); }, [instance]);
|
|
60
|
-
var
|
|
61
|
-
var
|
|
72
|
+
var onClose = (0, utils_1.useCallbackRef)(onCloseProp);
|
|
73
|
+
var onOpen = (0, utils_1.useCallbackRef)(onOpenProp);
|
|
62
74
|
var open = (0, react_1.useCallback)(function () { return instance === null || instance === void 0 ? void 0 : instance.show(); }, [instance]);
|
|
63
75
|
var isControlled = isOpenProp !== undefined;
|
|
64
76
|
var tippyOptions = (0, react_1.useMemo)(function () {
|
|
65
|
-
var _a
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
mergedPlugins.push(plugins_1.closeOnEscPlugin);
|
|
69
|
-
return __assign({ arrow: false, duration: [200, 150], hideOnClick: !isControlled ? closeOnBlur : false, interactive: true, offset: offset, onHidden: function (instance) {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
var _c = options !== null && options !== void 0 ? options : {}, optionsOffset = _c.offset, onHidden = _c.onHidden, onHide = _c.onHide, onShow = _c.onShow, _d = _c.plugins, plugins = _d === void 0 ? [] : _d, _e = _c.popperOptions, popperOptions = _e === void 0 ? {} : _e, otherOptions = __rest(_c, ["offset", "onHidden", "onHide", "onShow", "plugins", "popperOptions"]);
|
|
79
|
+
return __assign({ arrow: false, duration: [200, 150], hideOnClick: !isControlled ? closeOnBlur : false, interactive: true, maxWidth: 'none', offset: (_a = optionsOffset !== null && optionsOffset !== void 0 ? optionsOffset : offset) !== null && _a !== void 0 ? _a : [0, 4], onHidden: function (instance) {
|
|
70
80
|
setIsOpen(false);
|
|
71
81
|
onHidden === null || onHidden === void 0 ? void 0 : onHidden(instance);
|
|
72
82
|
}, onHide: function (instance) {
|
|
73
|
-
|
|
74
|
-
(_a = onCloseRef.current) === null || _a === void 0 ? void 0 : _a.call(onCloseRef, instance);
|
|
83
|
+
onClose(instance);
|
|
75
84
|
onHide === null || onHide === void 0 ? void 0 : onHide(instance);
|
|
76
85
|
}, onShow: function (instance) {
|
|
77
|
-
var _a;
|
|
78
86
|
setIsOpen(true);
|
|
79
|
-
(
|
|
87
|
+
onOpen(instance);
|
|
80
88
|
onShow === null || onShow === void 0 ? void 0 : onShow(instance);
|
|
81
|
-
}, placement: placement, plugins:
|
|
82
|
-
}, [closeOnBlur, closeOnEsc, placement, trigger]);
|
|
89
|
+
}, placement: placement, plugins: __spreadArray(__spreadArray([], __read((!isControlled && closeOnEsc ? [consts_1.closeOnEscPlugin] : [])), false), __read(plugins), false), popperOptions: __assign(__assign({}, popperOptions), { modifiers: __spreadArray([__assign(__assign({}, consts_1.matchWidthModifier), { enabled: !!matchWidth })], __read(((_b = popperOptions.modifiers) !== null && _b !== void 0 ? _b : [])), false) }), showOnCreate: defaultIsOpen, trigger: !isControlled ? trigger : 'manual' }, otherOptions);
|
|
90
|
+
}, [closeOnBlur, closeOnEsc, offset, options, placement, trigger]);
|
|
83
91
|
// Create a new Tippy instance
|
|
84
92
|
(0, react_1.useEffect)(function () {
|
|
85
93
|
if (popper !== null && reference !== null) {
|
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
import { Instance, Placement, Props } from 'tippy.js';
|
|
1
|
+
import { Instance, Placement, Props as TippyProps } from 'tippy.js';
|
|
2
2
|
import { AnyString } from '../utils';
|
|
3
3
|
export declare type PopoverTrigger = 'click' | 'focus' | 'focusin' | 'manual' | 'mouseenter';
|
|
4
4
|
export declare type UsePopoverProps = {
|
|
5
|
+
/** Content closes when clicking the trigger or anywhere outside. @default true */
|
|
5
6
|
closeOnBlur?: boolean;
|
|
7
|
+
/** Content closes when pressing 'Escape'. @default true */
|
|
6
8
|
closeOnEsc?: boolean;
|
|
9
|
+
/** Content is opened on first render. Uncontrolled mode. */
|
|
7
10
|
defaultIsOpen?: boolean;
|
|
11
|
+
/** Content is opened/closed by the consumer. Controlled mode. */
|
|
8
12
|
isOpen?: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
/** Sets the content element width to be the same as trigger element. */
|
|
14
|
+
matchWidth?: boolean;
|
|
15
|
+
/** Displaces content from the trigger in pixels. */
|
|
16
|
+
offset?: TippyProps['offset'];
|
|
17
|
+
/** Invoked once content is fully hidden. */
|
|
18
|
+
onClose?: (instance: Instance<TippyProps>) => void;
|
|
19
|
+
/** Invoked once content begins to show. */
|
|
20
|
+
onOpen?: (instance: Instance<TippyProps>) => void;
|
|
21
|
+
/** Object with any Tippy props. */
|
|
22
|
+
options?: Partial<TippyProps>;
|
|
23
|
+
/** Preferred placement of the content. Might be flipped if needs more space. */
|
|
13
24
|
placement?: Placement;
|
|
14
|
-
|
|
25
|
+
/** Determintes the events that cause the content to show. */
|
|
15
26
|
trigger?: PopoverTrigger | AnyString;
|
|
16
27
|
};
|
|
@@ -13,8 +13,8 @@ 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.
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
exports.default = void 0;
|
|
17
|
+
__exportStar(require("./portal"), exports);
|
|
18
|
+
var portal_1 = require("./portal");
|
|
19
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(portal_1).default; } });
|
|
20
|
+
__exportStar(require("./portal.types"), exports);
|
package/portal/portal.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
22
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
23
|
+
if (!m) return o;
|
|
24
|
+
var i = m.call(o), r, ar = [], e;
|
|
25
|
+
try {
|
|
26
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
27
|
+
}
|
|
28
|
+
catch (error) { e = { error: error }; }
|
|
29
|
+
finally {
|
|
30
|
+
try {
|
|
31
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
32
|
+
}
|
|
33
|
+
finally { if (e) throw e.error; }
|
|
34
|
+
}
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.Portal = void 0;
|
|
39
|
+
var react_1 = __importStar(require("react"));
|
|
40
|
+
var react_dom_1 = require("react-dom");
|
|
41
|
+
/** Provided children are portaled to document.body or custom container. */
|
|
42
|
+
var Portal = function (props) {
|
|
43
|
+
var children = props.children, containerRef = props.containerRef, disablePortal = props.disablePortal;
|
|
44
|
+
var _a = __read((0, react_1.useState)(), 2), mountNode = _a[0], setMountNode = _a[1];
|
|
45
|
+
(0, react_1.useEffect)(function () {
|
|
46
|
+
var _a;
|
|
47
|
+
if (!disablePortal) {
|
|
48
|
+
setMountNode((_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) !== null && _a !== void 0 ? _a : document.body);
|
|
49
|
+
}
|
|
50
|
+
}, [disablePortal]);
|
|
51
|
+
if (disablePortal)
|
|
52
|
+
return react_1.default.createElement(react_1.default.Fragment, null, children);
|
|
53
|
+
return mountNode ? (0, react_dom_1.createPortal)(children, mountNode) : react_1.default.createElement(react_1.default.Fragment, null, mountNode);
|
|
54
|
+
};
|
|
55
|
+
exports.Portal = Portal;
|
|
56
|
+
exports.default = exports.Portal;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export declare type PortalProps = {
|
|
3
|
+
/** Ref of a custom container that will be used instead of document.body. */
|
|
4
|
+
containerRef?: RefObject<HTMLElement | null>;
|
|
5
|
+
/** Content will be rendered as usual, without portaling. */
|
|
6
|
+
disablePortal?: boolean;
|
|
7
|
+
};
|
package/radio/index.d.ts
CHANGED
package/radio/index.js
CHANGED
|
@@ -16,8 +16,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.default = void 0;
|
|
17
17
|
__exportStar(require("./context"), exports);
|
|
18
18
|
__exportStar(require("./radio"), exports);
|
|
19
|
+
var radio_1 = require("./radio");
|
|
20
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(radio_1).default; } });
|
|
19
21
|
__exportStar(require("./radio.types"), exports);
|
|
20
22
|
__exportStar(require("./radioGroup"), exports);
|
|
21
23
|
__exportStar(require("./radioGroup.types"), exports);
|
|
22
|
-
var radio_1 = require("./radio");
|
|
23
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(radio_1).default; } });
|
package/radio/radio.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RadioProps, RadioStyleProps } from './radio.types';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
export declare const RadioBase: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, import("..").AnimationProps & import("..").BackgroundColorProps & import("..").BorderProps & import("..").BorderTopProps & import("..").BorderRightProps & import("..").BorderBottomProps & import("..").BorderLeftProps & import("..").BorderColorProps & import("..").BorderTopColorProps & import("..").BorderRightColorProps & import("..").BorderBottomColorProps & import("..").BorderLeftColorProps & import("..").BorderWidthProps & import("..").BorderTopWidthProps & import("..").BorderRightWidthProps & import("..").BorderBottomWidthProps & import("..").BorderLeftWidthProps & import("..").BorderStyleProps & import("..").BorderRadiusProps & import("..").OutlineProps & import("..").OutlineColorProps & import("..").OutlineWidthProps & import("..").OutlineStyleProps & import("..").DivideXProps & import("..").DivideYProps & import("..").DivideXReverseProps & import("..").DivideYReverseProps & import("..").DivideColorProps & import("..").DivideStyleProps & import("..").RingProps & import("..").RingColorProps & import("..").OpacityProps & import("..").BoxShadowProps & import("..").TextShadowProps & import("..").DisplayProps & import("..").AlignItemsProps & import("..").AlignContentProps & import("..").JustifyContentProps & import("..").JustifyItemsProps & import("..").FlexWrapProps & import("..").FlexGrowProps & import("..").FlexShrinkProps & import("..").FlexBasisProps & import("..").FlexDirectionProps & import("..").FlexProps & import("..").JustifySelfProps & import("..").AlignSelfProps & import("..").OrderProps & import("../system/flexboxGrids").RowProps & import("../system/flexboxGrids").ColProps & import("../system/grids").GapProps & import("../system/grids").ColumnGapProps & import("../system/grids").RowGapProps & import("../system/grids").GridColumnProps & import("../system/grids").GridRowProps & import("../system/grids").GridAutoFlowProps & import("../system/grids").GridAutoColumnsProps & import("../system/grids").GridAutoRowsProps & import("../system/grids").GridTemplateColumnsProps & import("../system/grids").GridTemplateRowsProps & import("../system/grids").GridTemplateAreasProps & import("../system/grids").GridAreaProps & import("..").AppearanceProps & import("..").CursorProps & import("..").PointerEventsProps & import("..").ResizeProps & import("..").UserSelectProps & import("..").IsTruncatedProps & import("..").FloatProps & import("..").BoxSizingProps & import("..").OverflowProps & import("..").OverflowXProps & import("..").OverflowYProps & import("..").PositionProps & import("..").ZIndexProps & import("..").TopProps & import("..").RightProps & import("..").BottomProps & import("..").LeftProps & import("..").VisibilityProps & import("..").OverscrollBehaviorProps & import("..").ObjectFitProps & import("..").MaxLinesProps & import("..").WidthProps & import("..").HeightProps & import("..").MaxWidthProps & import("..").MaxHeightProps & import("..").MinWidthProps & import("..").MinHeightProps & import("..").MarginProps & import("..").MarginTopProps & import("..").MarginRightProps & import("..").MarginBottomProps & import("..").MarginLeftProps & import("..").MarginXProps & import("..").MarginYProps & import("..").PaddingProps & import("..").PaddingTopProps & import("..").PaddingRightProps & import("..").PaddingBottomProps & import("..").PaddingLeftProps & import("..").PaddingXProps & import("..").PaddingYProps & import("..").SpaceXProps & import("..").SpaceYProps & import("..").SpaceXReverseProps & import("..").SpaceYReverseProps & import("..").SpaceAroundProps & import("../system/tables").BorderCollapseProps & import("../system/tables").TableLayoutProps & import("..").TransformProps & import("..").TransformOriginProps & import("..").TranslateXProps & import("..").TranslateYProps & import("..").RotateProps & import("..").SkewXProps & import("..").SkewYProps & import("..").ScaleProps & import("..").ScaleXProps & import("..").ScaleYProps & import("..").TransitionProps & import("..").TransitionPropertyProps & import("..").TransitionDurationProps & import("..").TransitionTimingFunctionProps & import("..").TransitionDelayProps & import("..").FontFamilyProps & import("..").FontSizeProps & import("..").FontStyleProps & import("..").FontWeightProps & import("..").LineHeightProps & import("..").ColorProps & import("..").TextTransformProps & import("..").TextDecorationProps & import("..").TextAlignProps & import("..").VerticalAlignProps & import("..").LetterSpacingProps & import("..").WhiteSpaceProps & import("..").TextOverflowProps & import("..").ListStyleTypeProps & import("..").ListStylePositionProps & import("..").WordBreakProps & RadioStyleProps, never>;
|
|
3
|
+
/**
|
|
4
|
+
* Allows selection of a single choice from a set of items. Handles controlled and uncontrolled modes.
|
|
5
|
+
* Uses icons to display itself in different states.
|
|
6
|
+
*/
|
|
6
7
|
export declare const Radio: import("../core").VuiComponent<"span", RadioProps>;
|
|
7
8
|
export default Radio;
|
package/radio/radio.js
CHANGED
|
@@ -64,18 +64,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
64
64
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
65
65
|
};
|
|
66
66
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
-
exports.Radio = exports.
|
|
67
|
+
exports.Radio = exports.RadioBase = void 0;
|
|
68
68
|
var react_1 = __importStar(require("react"));
|
|
69
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
70
|
-
var context_1 = require("./context");
|
|
71
69
|
var core_1 = require("../core");
|
|
72
70
|
var icon_1 = __importDefault(require("../icon"));
|
|
73
|
-
var system_1 = require("../system");
|
|
74
71
|
var t_1 = __importDefault(require("../t"));
|
|
75
72
|
var utils_1 = require("../utils");
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
var context_1 = require("./context");
|
|
74
|
+
var RadioControl = core_1.styled.spanBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tborder-radius: 50%;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\ttransition-duration: fast;\n"], ["\n\tborder-radius: 50%;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\ttransition-duration: fast;\n"])));
|
|
75
|
+
var RadioInput = core_1.styled.input(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tcursor: inherit;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0;\n\topacity: 0;\n\tpadding: 0;\n\tposition: absolute;\n\ttop: 0;\n\twidth: 100%;\n\tz-index: 1;\n"], ["\n\tcursor: inherit;\n\theight: 100%;\n\tleft: 0;\n\tmargin: 0;\n\topacity: 0;\n\tpadding: 0;\n\tposition: absolute;\n\ttop: 0;\n\twidth: 100%;\n\tz-index: 1;\n"])));
|
|
76
|
+
exports.RadioBase = core_1.styled.labelBox(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\twidth: fit-content;\n\n\t&:not([aria-disabled='true']):hover .vui-radioControl {\n\t\tcolor: ", ";\n\t}\n\n\t&[aria-disabled='true'] {\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\n\t\t.vui-radioControl {\n\t\t\tcolor: disabled.color;\n\t\t}\n\t}\n"], ["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\twidth: fit-content;\n\n\t&:not([aria-disabled='true']):hover .vui-radioControl {\n\t\tcolor: ", ";\n\t}\n\n\t&[aria-disabled='true'] {\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\n\t\t.vui-radioControl {\n\t\t\tcolor: disabled.color;\n\t\t}\n\t}\n"
|
|
77
|
+
/**
|
|
78
|
+
* Allows selection of a single choice from a set of items. Handles controlled and uncontrolled modes.
|
|
79
|
+
* Uses icons to display itself in different states.
|
|
80
|
+
*/
|
|
81
|
+
])), function (p) { return core_1.th.color(p.controlHoverColor); });
|
|
82
|
+
/**
|
|
83
|
+
* Allows selection of a single choice from a set of items. Handles controlled and uncontrolled modes.
|
|
84
|
+
* Uses icons to display itself in different states.
|
|
85
|
+
*/
|
|
79
86
|
exports.Radio = (0, core_1.vui)(function (props, ref) {
|
|
80
87
|
var _a, _b;
|
|
81
88
|
var _c = (_a = (0, context_1.useRadioGroup)()) !== null && _a !== void 0 ? _a : {}, groupDefaultValue = _c.defaultValue, groupIsChecked = _c.isChecked, groupOnChange = _c.onChange, groupValue = _c.value, radioGroupProps = __rest(_c, ["defaultValue", "isChecked", "onChange", "value"]);
|
|
@@ -101,9 +108,12 @@ exports.Radio = (0, core_1.vui)(function (props, ref) {
|
|
|
101
108
|
groupOnChange === null || groupOnChange === void 0 ? void 0 : groupOnChange(e);
|
|
102
109
|
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
103
110
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
var aliasedProps = (0, utils_1.filterUndefined)({
|
|
112
|
+
'aria-disabled': disabled
|
|
113
|
+
});
|
|
114
|
+
return (react_1.default.createElement(exports.RadioBase, __assign({ className: (0, utils_1.cs)('vui-radio', className), controlHoverColor: controlHoverColor, ref: ref }, styles.container, aliasedProps, rest),
|
|
115
|
+
react_1.default.createElement(RadioControl, __assign({ className: "vui-radioControl", color: color, focusWithinRing: 3, mr: controlMr }, controlStyles),
|
|
116
|
+
react_1.default.createElement(RadioInput, __assign({ className: "vui-radioInput", onChange: handleOnChange, ref: inputRef, type: "radio" }, { checked: checked, defaultChecked: defaultChecked, disabled: disabled, id: id, name: name, required: required, value: value }, inputProps)),
|
|
107
117
|
react_1.default.createElement(icon_1.default, { className: "vui-radioIcon", h: "100%", name: icon, w: "100%" })), children !== null && children !== void 0 ? children : (label && (react_1.default.createElement(t_1.default, __assign({ className: "vui-radioLabel", lineHeight: "normal" }, styles.label), label)))));
|
|
108
118
|
});
|
|
109
119
|
exports.Radio.displayName = 'Radio';
|
package/radio/radio.types.d.ts
CHANGED
|
@@ -3,22 +3,37 @@ import { IconProp } from '../icon';
|
|
|
3
3
|
import { SystemProps } from '../system';
|
|
4
4
|
import { ThemingProps } from '../theme';
|
|
5
5
|
import { ChangeEventHandler, FocusEventHandler } from '../utils';
|
|
6
|
-
export
|
|
6
|
+
export declare type RadioProps = SystemProps & ThemingProps<'Radio'> & {
|
|
7
|
+
/** Provides value to radio in controlled mode. */
|
|
7
8
|
checked?: boolean;
|
|
9
|
+
/** Available theme colors for this component. @default blue */
|
|
8
10
|
colorScheme?: 'blue' | 'prussian';
|
|
11
|
+
/** Disables radio and related elements with the right styling. */
|
|
9
12
|
disabled?: boolean;
|
|
13
|
+
/** Icon used when not checked. @default cuiRadioSelected */
|
|
10
14
|
icon?: IconProp;
|
|
15
|
+
/** Icon used when checked. @default cuiRadioUnselected */
|
|
11
16
|
iconChecked?: IconProp;
|
|
17
|
+
/** Props object passed to the inner input element. */
|
|
12
18
|
inputProps?: HTMLAttributes<HTMLInputElement>;
|
|
19
|
+
/** Ref passed to the inner input element. */
|
|
13
20
|
inputRef?: React.MutableRefObject<HTMLInputElement | null> | null;
|
|
21
|
+
/** Socket placing text to the left of the checkbox. */
|
|
14
22
|
label?: string;
|
|
23
|
+
/** Passed to the inner input. */
|
|
15
24
|
name?: string;
|
|
25
|
+
/** Passed to the inner input. */
|
|
16
26
|
onBlur?: FocusEventHandler;
|
|
27
|
+
/** Passed to the inner input. */
|
|
17
28
|
onChange?: ChangeEventHandler;
|
|
29
|
+
/** Passed to the inner input. */
|
|
18
30
|
onFocus?: FocusEventHandler;
|
|
31
|
+
/** Passed to the inner input. */
|
|
19
32
|
required?: boolean;
|
|
33
|
+
/** Passed to the inner input. */
|
|
20
34
|
value?: number | string;
|
|
21
|
-
}
|
|
22
|
-
export
|
|
35
|
+
};
|
|
36
|
+
export declare type RadioStyleProps = {
|
|
37
|
+
/** Styles the icon when any part of the radio is hovered. */
|
|
23
38
|
controlHoverColor: string;
|
|
24
|
-
}
|
|
39
|
+
};
|
package/radio/radioGroup.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { RadioGroupProps } from './radioGroup.types';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
export declare const RadioGroupBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
3
|
+
/**
|
|
4
|
+
* Organizes layout and display of multiple radio buttons as a row or column.
|
|
5
|
+
* Exposes some props to the children via context.
|
|
6
|
+
*/
|
|
4
7
|
export declare const RadioGroup: import("../core").VuiComponent<"div", RadioGroupProps>;
|
|
5
8
|
export default RadioGroup;
|
package/radio/radioGroup.js
CHANGED
|
@@ -60,18 +60,22 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
60
60
|
}
|
|
61
61
|
return ar;
|
|
62
62
|
};
|
|
63
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
64
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
65
|
-
};
|
|
66
63
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
64
|
exports.RadioGroup = exports.RadioGroupBase = void 0;
|
|
68
65
|
var react_1 = __importStar(require("react"));
|
|
69
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
70
|
-
var context_1 = require("./context");
|
|
71
66
|
var core_1 = require("../core");
|
|
72
|
-
var system_1 = require("../system");
|
|
73
67
|
var utils_1 = require("../utils");
|
|
74
|
-
|
|
68
|
+
var context_1 = require("./context");
|
|
69
|
+
exports.RadioGroupBase = core_1.styled.divBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\tflex-direction: column;\n"], ["\n\tdisplay: flex;\n\tflex-direction: column;\n"
|
|
70
|
+
/**
|
|
71
|
+
* Organizes layout and display of multiple radio buttons as a row or column.
|
|
72
|
+
* Exposes some props to the children via context.
|
|
73
|
+
*/
|
|
74
|
+
])));
|
|
75
|
+
/**
|
|
76
|
+
* Organizes layout and display of multiple radio buttons as a row or column.
|
|
77
|
+
* Exposes some props to the children via context.
|
|
78
|
+
*/
|
|
75
79
|
exports.RadioGroup = (0, core_1.vui)(function (props, ref) {
|
|
76
80
|
var className = props.className, colorScheme = props.colorScheme, defaultValue = props.defaultValue, disabled = props.disabled, isRow = props.isRow, name = props.name, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, size = props.size, value = props.value, variant = props.variant, rest = __rest(props, ["className", "colorScheme", "defaultValue", "disabled", "isRow", "name", "onBlur", "onChange", "onFocus", "size", "value", "variant"]);
|
|
77
81
|
var _a = __read((0, react_1.useState)(value !== null && value !== void 0 ? value : defaultValue), 2), isChecked = _a[0], setIsChecked = _a[1];
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import { SystemProps } from '../system';
|
|
2
2
|
import { ThemingProps } from '../theme';
|
|
3
3
|
import { ChangeEventHandler, FocusEventHandler } from '../utils';
|
|
4
|
-
export
|
|
4
|
+
export declare type RadioGroupProps = SystemProps & ThemingProps<'Radio'> & {
|
|
5
|
+
/** Available theme colors for this component. */
|
|
5
6
|
colorScheme?: 'blue' | 'prussian';
|
|
7
|
+
/** Passes the prop to each radio. */
|
|
6
8
|
disabled?: boolean;
|
|
9
|
+
/** Displays radio buttons in a row. */
|
|
7
10
|
isRow?: boolean;
|
|
11
|
+
/** Passes the prop to each checkbox. */
|
|
8
12
|
name?: string;
|
|
13
|
+
/** Passes the prop to each checkbox. */
|
|
9
14
|
onBlur?: FocusEventHandler;
|
|
15
|
+
/** Passes the prop to each checkbox. */
|
|
10
16
|
onChange?: ChangeEventHandler;
|
|
17
|
+
/** Passes the prop to each checkbox. */
|
|
11
18
|
onFocus?: FocusEventHandler;
|
|
19
|
+
/** Passes the prop to each checkbox. */
|
|
12
20
|
value?: number | string;
|
|
13
|
-
}
|
|
21
|
+
};
|
package/radio/theme.d.ts
CHANGED
package/radio/theme.js
CHANGED
|
@@ -13,6 +13,7 @@ function variantDefault(props) {
|
|
|
13
13
|
control: control
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
+
var baseStyle = {};
|
|
16
17
|
var defaultProps = {
|
|
17
18
|
colorScheme: 'blue',
|
|
18
19
|
size: 'md',
|
|
@@ -52,6 +53,7 @@ var variants = {
|
|
|
52
53
|
default: variantDefault
|
|
53
54
|
};
|
|
54
55
|
exports.default = {
|
|
56
|
+
baseStyle: baseStyle,
|
|
55
57
|
defaultProps: defaultProps,
|
|
56
58
|
parts: parts,
|
|
57
59
|
sizes: sizes,
|
package/skeleton/index.d.ts
CHANGED
package/skeleton/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("./skeleton"), exports);
|
|
18
|
-
__exportStar(require("./skeleton.types"), exports);
|
|
19
18
|
var skeleton_1 = require("./skeleton");
|
|
20
19
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(skeleton_1).default; } });
|
|
20
|
+
__exportStar(require("./skeleton.types"), exports);
|
package/skeleton/skeleton.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SkeletonProps } from './skeleton.types';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
export declare const SkeletonBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
3
|
+
/** Displays one or more animated skeleton elements to signify loading content. */
|
|
4
4
|
export declare const Skeleton: import("../core").VuiComponent<"div", SkeletonProps>;
|
|
5
5
|
export default Skeleton;
|
package/skeleton/skeleton.js
CHANGED
|
@@ -31,11 +31,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
31
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.Skeleton = exports.SkeletonBase = 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.SkeletonBase =
|
|
36
|
+
exports.SkeletonBase = core_1.styled.divBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tanimation: vui-pulse 1.5s ease-in-out 0.5s infinite;\n"], ["\n\tanimation: vui-pulse 1.5s ease-in-out 0.5s infinite;\n"
|
|
37
|
+
/** Displays one or more animated skeleton elements to signify loading content. */
|
|
38
|
+
])));
|
|
39
|
+
/** Displays one or more animated skeleton elements to signify loading content. */
|
|
39
40
|
exports.Skeleton = (0, core_1.vui)(function (props, ref) {
|
|
40
41
|
var _a = (0, core_1.omitThemingProps)(props), className = _a.className, _b = _a.repeat, repeat = _b === void 0 ? 1 : _b, rest = __rest(_a, ["className", "repeat"]);
|
|
41
42
|
var styles = (0, core_1.useStyleConfig)('Skeleton', props);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { SystemProps } from '../system';
|
|
2
2
|
import { ThemingProps } from '../theme';
|
|
3
|
-
export
|
|
3
|
+
export declare type SkeletonProps = SystemProps & ThemingProps<'Skeleton'> & {
|
|
4
|
+
/** Children are disabled for this component. */
|
|
4
5
|
children?: never;
|
|
6
|
+
/** Available theme colors for this component. @default blue */
|
|
5
7
|
colorScheme?: 'blue' | 'grey';
|
|
8
|
+
/** Displays given amount of skeleton elements. */
|
|
6
9
|
repeat?: number;
|
|
7
|
-
}
|
|
10
|
+
};
|
package/skeleton/theme.d.ts
CHANGED
package/skeleton/theme.js
CHANGED
|
@@ -17,6 +17,7 @@ function variantRectangle(props) {
|
|
|
17
17
|
};
|
|
18
18
|
return styles;
|
|
19
19
|
}
|
|
20
|
+
var baseStyle = {};
|
|
20
21
|
var defaultProps = {
|
|
21
22
|
colorScheme: 'blue',
|
|
22
23
|
size: 'md',
|
|
@@ -41,6 +42,7 @@ var variants = {
|
|
|
41
42
|
rect: variantRectangle
|
|
42
43
|
};
|
|
43
44
|
exports.default = {
|
|
45
|
+
baseStyle: baseStyle,
|
|
44
46
|
defaultProps: defaultProps,
|
|
45
47
|
sizes: sizes,
|
|
46
48
|
variants: variants
|
package/spinner/index.d.ts
CHANGED
package/spinner/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("./spinner"), exports);
|
|
18
|
-
__exportStar(require("./spinner.types"), exports);
|
|
19
18
|
var spinner_1 = require("./spinner");
|
|
20
19
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(spinner_1).default; } });
|
|
20
|
+
__exportStar(require("./spinner.types"), exports);
|
package/spinner/spinner.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const SpinnerCircle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme,
|
|
1
|
+
import { SpinnerProps } from './spinner.types';
|
|
2
|
+
export declare const SpinnerCircle: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
3
|
+
/**
|
|
4
|
+
* Displays a spinning circular element with optional text to signify loading content.
|
|
5
|
+
* Handles different positioning scenarios, speeds and coloring of the circle.
|
|
6
|
+
*/
|
|
3
7
|
export declare const Spinner: import("../core").VuiComponent<"div", SpinnerProps>;
|
|
4
8
|
export default Spinner;
|