@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/link/link.js
CHANGED
|
@@ -50,27 +50,33 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
51
|
exports.Link = exports.LinkBase = void 0;
|
|
52
52
|
var react_1 = __importStar(require("react"));
|
|
53
|
-
var
|
|
53
|
+
var core_1 = require("../core");
|
|
54
|
+
var utils_1 = require("../utils");
|
|
54
55
|
var context_1 = require("./context");
|
|
55
56
|
var linkIcon_1 = __importDefault(require("./linkIcon"));
|
|
56
57
|
var linkText_1 = __importDefault(require("./linkText"));
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
exports.LinkBase = core_1.styled.aBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tborder-radius: sm;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tline-height: normal;\n\toutline: none;\n\ttext-decoration: none;\n\ttransition-duration: instant;\n\twidth: fit-content;\n"], ["\n\talign-items: center;\n\tborder-radius: sm;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tline-height: normal;\n\toutline: none;\n\ttext-decoration: none;\n\ttransition-duration: instant;\n\twidth: fit-content;\n"
|
|
59
|
+
/**
|
|
60
|
+
* Displays a link item. Handles different underline scenarios and opening external links in new tab.
|
|
61
|
+
* Exposes some props to the children via context.
|
|
62
|
+
*/
|
|
63
|
+
])));
|
|
64
|
+
/**
|
|
65
|
+
* Displays a link item. Handles different underline scenarios and opening external links in new tab.
|
|
66
|
+
* Exposes some props to the children via context.
|
|
67
|
+
*/
|
|
61
68
|
exports.Link = (0, core_1.vui)(function (props, ref) {
|
|
62
|
-
var children = props.children, className = props.className, colorScheme = props.colorScheme, decoration = props.decoration,
|
|
69
|
+
var children = props.children, className = props.className, colorScheme = props.colorScheme, decoration = props.decoration, _a = props.hoverDecoration, hoverDecoration = _a === void 0 ? 'underline' : _a, iconLeft = props.iconLeft, iconRight = props.iconRight, isExternal = props.isExternal, isUnderlined = props.isUnderlined, size = props.size, text = props.text, variant = props.variant, weight = props.weight, rest = __rest(props, ["children", "className", "colorScheme", "decoration", "hoverDecoration", "iconLeft", "iconRight", "isExternal", "isUnderlined", "size", "text", "variant", "weight"]);
|
|
63
70
|
var styles = (0, core_1.useStyleConfig)('Link', props);
|
|
64
|
-
var context = (0, react_1.useMemo)(function () { return (0, utils_1.filterUndefined)({ colorScheme: colorScheme,
|
|
71
|
+
var context = (0, react_1.useMemo)(function () { return (0, utils_1.filterUndefined)({ colorScheme: colorScheme, size: size, variant: variant }); }, [colorScheme, size, variant]);
|
|
65
72
|
var aliasedProps = (0, utils_1.filterUndefined)({
|
|
66
73
|
fontWeight: weight,
|
|
67
|
-
hoverTextDecoration: hoverDecoration,
|
|
68
74
|
rel: isExternal ? 'noopener' : undefined,
|
|
69
75
|
target: isExternal ? '_blank' : undefined,
|
|
70
76
|
textDecoration: decoration !== null && decoration !== void 0 ? decoration : (isUnderlined ? 'underline' : undefined)
|
|
71
77
|
});
|
|
72
78
|
return (react_1.default.createElement(context_1.LinkProvider, { value: context },
|
|
73
|
-
react_1.default.createElement(exports.LinkBase, __assign({
|
|
79
|
+
react_1.default.createElement(exports.LinkBase, __assign({ className: (0, utils_1.cs)('vui-link', className), focusRing: 2, hoverTextDecoration: hoverDecoration, ref: ref }, styles.container, aliasedProps, rest),
|
|
74
80
|
(0, utils_1.isString)(iconLeft) ? react_1.default.createElement(linkIcon_1.default, { mr: 1, name: iconLeft }) : iconLeft, children !== null && children !== void 0 ? children : ((0, utils_1.isReactText)(text) ? react_1.default.createElement(linkText_1.default, { text: text }) : text),
|
|
75
81
|
(0, utils_1.isString)(iconRight) ? react_1.default.createElement(linkIcon_1.default, { ml: 1, name: iconRight }) : iconRight)));
|
|
76
82
|
});
|
package/link/link.types.d.ts
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { IconProp } from '../icon';
|
|
2
3
|
import { SystemProps, TypographyProps } from '../system';
|
|
3
4
|
import { ThemingProps } from '../theme';
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
export declare type LinkProps = SystemProps & ThemingProps<'Link'> & {
|
|
6
|
+
/** Available theme colors for this component. @default blue */
|
|
6
7
|
colorScheme?: 'blue' | 'white';
|
|
8
|
+
/** Alias for textDecoration prop. @deprecated */
|
|
7
9
|
decoration?: TypographyProps['textDecoration'];
|
|
8
|
-
|
|
10
|
+
/** Alias for hoverTextDecoration prop. @deprecated */
|
|
9
11
|
hoverDecoration?: TypographyProps['textDecoration'];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
/** Socket displaying an icon on the left. */
|
|
13
|
+
iconLeft?: IconProp | JSX.Element;
|
|
14
|
+
/** Socket displaying an icon on the right. */
|
|
15
|
+
iconRight?: IconProp | JSX.Element;
|
|
16
|
+
/** Opens the link in new tab with appropriate attributes. */
|
|
12
17
|
isExternal?: boolean;
|
|
18
|
+
/** Displays permanent underline. */
|
|
13
19
|
isUnderlined?: boolean;
|
|
14
|
-
text
|
|
20
|
+
/** Socket displaying text within the Link. */
|
|
21
|
+
text?: number | string | JSX.Element;
|
|
22
|
+
/** Alias for fontWeight prop. @deprecated */
|
|
15
23
|
weight?: TypographyProps['fontWeight'];
|
|
16
|
-
}
|
|
24
|
+
};
|
package/link/linkIcon.d.ts
CHANGED
package/link/linkIcon.js
CHANGED
|
@@ -16,14 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.LinkIcon = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var context_1 = require("./context");
|
|
20
19
|
var core_1 = require("../core");
|
|
21
20
|
var icon_1 = __importDefault(require("../icon"));
|
|
21
|
+
var context_1 = require("./context");
|
|
22
|
+
/** Displays an icon within the Link. */
|
|
22
23
|
exports.LinkIcon = (0, core_1.vui)(function (props, ref) {
|
|
23
|
-
var
|
|
24
|
-
var linkProps = (_a = (0, context_1.useLink)()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
-
var mergedProps = __assign(__assign({}, linkProps), props);
|
|
26
|
-
var styles = (0, core_1.useStyleConfig)('Link', mergedProps);
|
|
24
|
+
var styles = (0, core_1.useStyleConfig)('Link', __assign(__assign({}, (0, context_1.useLink)()), props));
|
|
27
25
|
return react_1.default.createElement(icon_1.default, __assign({ className: "vui-linkIcon", ref: ref }, styles.icon, props));
|
|
28
26
|
});
|
|
29
27
|
exports.LinkIcon.displayName = 'LinkIcon';
|
package/link/linkText.d.ts
CHANGED
package/link/linkText.js
CHANGED
|
@@ -16,14 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.LinkText = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var context_1 = require("./context");
|
|
20
19
|
var core_1 = require("../core");
|
|
21
20
|
var t_1 = __importDefault(require("../t"));
|
|
21
|
+
var context_1 = require("./context");
|
|
22
|
+
/** Displays text of the Link. */
|
|
22
23
|
exports.LinkText = (0, core_1.vui)(function (props, ref) {
|
|
23
|
-
var
|
|
24
|
-
var linkProps = (_a = (0, context_1.useLink)()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
-
var mergedProps = __assign(__assign({}, linkProps), props);
|
|
26
|
-
var styles = (0, core_1.useStyleConfig)('Link', mergedProps);
|
|
24
|
+
var styles = (0, core_1.useStyleConfig)('Link', __assign(__assign({}, (0, context_1.useLink)()), props));
|
|
27
25
|
return react_1.default.createElement(t_1.default, __assign({ className: "vui-linkText", fontSize: "inherit", ref: ref }, styles.text, props));
|
|
28
26
|
});
|
|
29
27
|
exports.LinkText.displayName = 'LinkText';
|
package/link/theme.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ declare function variantLight(props: Dict): {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
declare const _default: {
|
|
15
|
+
baseStyle: {};
|
|
15
16
|
defaultProps: {
|
|
16
17
|
colorScheme: string;
|
|
17
18
|
size: string;
|
|
@@ -47,6 +48,11 @@ declare const _default: {
|
|
|
47
48
|
variants: {
|
|
48
49
|
default: typeof variantDefault;
|
|
49
50
|
light: typeof variantLight;
|
|
51
|
+
plain: {
|
|
52
|
+
container: {
|
|
53
|
+
hoverTextDecoration: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
50
56
|
};
|
|
51
57
|
};
|
|
52
58
|
export default _default;
|
package/link/theme.js
CHANGED
|
@@ -20,6 +20,12 @@ function variantLight(props) {
|
|
|
20
20
|
};
|
|
21
21
|
return { container: container };
|
|
22
22
|
}
|
|
23
|
+
var variantPlain = {
|
|
24
|
+
container: {
|
|
25
|
+
hoverTextDecoration: 'none'
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var baseStyle = {};
|
|
23
29
|
var defaultProps = {
|
|
24
30
|
colorScheme: 'blue',
|
|
25
31
|
size: 'md',
|
|
@@ -54,9 +60,11 @@ var sizes = {
|
|
|
54
60
|
};
|
|
55
61
|
var variants = {
|
|
56
62
|
default: variantDefault,
|
|
57
|
-
light: variantLight
|
|
63
|
+
light: variantLight,
|
|
64
|
+
plain: variantPlain
|
|
58
65
|
};
|
|
59
66
|
exports.default = {
|
|
67
|
+
baseStyle: baseStyle,
|
|
60
68
|
defaultProps: defaultProps,
|
|
61
69
|
parts: parts,
|
|
62
70
|
sizes: sizes,
|
package/list/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export * from './context';
|
|
2
2
|
export * from './list';
|
|
3
|
+
export { default } from './list';
|
|
3
4
|
export * from './list.types';
|
|
4
5
|
export * from './listDivider';
|
|
5
6
|
export * from './listHeading';
|
|
6
7
|
export * from './listIcon';
|
|
7
8
|
export * from './listItem';
|
|
8
9
|
export * from './listText';
|
|
9
|
-
export { default } from './list';
|
package/list/index.js
CHANGED
|
@@ -16,11 +16,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.default = void 0;
|
|
17
17
|
__exportStar(require("./context"), exports);
|
|
18
18
|
__exportStar(require("./list"), exports);
|
|
19
|
+
var list_1 = require("./list");
|
|
20
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(list_1).default; } });
|
|
19
21
|
__exportStar(require("./list.types"), exports);
|
|
20
22
|
__exportStar(require("./listDivider"), exports);
|
|
21
23
|
__exportStar(require("./listHeading"), exports);
|
|
22
24
|
__exportStar(require("./listIcon"), exports);
|
|
23
25
|
__exportStar(require("./listItem"), exports);
|
|
24
26
|
__exportStar(require("./listText"), exports);
|
|
25
|
-
var list_1 = require("./list");
|
|
26
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(list_1).default; } });
|
package/list/list.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { VuiComponent } from '../core';
|
|
1
2
|
import { ListProps } from './list.types';
|
|
2
3
|
import ListDivider from './listDivider';
|
|
3
4
|
import ListHeading from './listHeading';
|
|
4
5
|
import ListIcon from './listIcon';
|
|
5
6
|
import ListItem from './listItem';
|
|
6
7
|
import ListText from './listText';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare const ListBase: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, SystemProps, never>;
|
|
8
|
+
export declare const ListBase: import("styled-components").StyledComponent<"ul", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
9
|
+
/** Displays a list of list link items and optional heading. Exposes some props to the children via context. */
|
|
10
10
|
export declare const List: VuiComponent<"ul", ListProps> & {
|
|
11
11
|
Divider: typeof ListDivider;
|
|
12
12
|
Heading: typeof ListHeading;
|
package/list/list.js
CHANGED
|
@@ -50,25 +50,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
51
|
exports.List = exports.ListBase = void 0;
|
|
52
52
|
var react_1 = __importStar(require("react"));
|
|
53
|
-
var
|
|
53
|
+
var core_1 = require("../core");
|
|
54
|
+
var utils_1 = require("../utils");
|
|
54
55
|
var context_1 = require("./context");
|
|
55
56
|
var listDivider_1 = __importDefault(require("./listDivider"));
|
|
56
57
|
var listHeading_1 = __importDefault(require("./listHeading"));
|
|
57
58
|
var listIcon_1 = __importDefault(require("./listIcon"));
|
|
58
59
|
var listItem_1 = __importDefault(require("./listItem"));
|
|
59
60
|
var listText_1 = __importDefault(require("./listText"));
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
exports.ListBase = core_1.styled.ulBox(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""
|
|
62
|
+
/** Displays a list of list link items and optional heading. Exposes some props to the children via context. */
|
|
63
|
+
])));
|
|
64
|
+
/** Displays a list of list link items and optional heading. Exposes some props to the children via context. */
|
|
64
65
|
exports.List = (0, core_1.vui)(function (props, ref) {
|
|
65
|
-
var children = props.children, className = props.className, colorScheme = props.colorScheme, heading = props.heading, isInteractive = props.isInteractive, size = props.size, variant = props.variant, rest = __rest(props, ["children", "className", "colorScheme", "heading", "isInteractive", "size", "variant"]);
|
|
66
|
+
var children = props.children, className = props.className, colorScheme = props.colorScheme, heading = props.heading, isInteractive = props.isInteractive, items = props.items, size = props.size, variant = props.variant, rest = __rest(props, ["children", "className", "colorScheme", "heading", "isInteractive", "items", "size", "variant"]);
|
|
66
67
|
var styles = (0, core_1.useStyleConfig)('List', props);
|
|
67
68
|
var context = (0, react_1.useMemo)(function () { return (0, utils_1.filterUndefined)({ colorScheme: colorScheme, isInteractive: isInteractive, size: size, variant: variant }); }, [colorScheme, isInteractive, size, variant]);
|
|
68
69
|
return (react_1.default.createElement(context_1.ListProvider, { value: context },
|
|
69
70
|
react_1.default.createElement(exports.ListBase, __assign({ className: (0, utils_1.cs)('vui-list', className), ref: ref }, styles.container, rest),
|
|
70
|
-
(0, utils_1.isReactText)(heading) ? react_1.default.createElement(listHeading_1.default, { text: heading }) : heading,
|
|
71
|
-
|
|
71
|
+
(0, utils_1.isReactText)(heading) ? react_1.default.createElement(listHeading_1.default, { text: heading }) : heading, children !== null && children !== void 0 ? children : ((0, utils_1.isArray)(items)
|
|
72
|
+
? items.map(function (_a, index) {
|
|
73
|
+
var key = _a.key, props = __rest(_a, ["key"]);
|
|
74
|
+
return react_1.default.createElement(listItem_1.default, __assign({ key: key !== null && key !== void 0 ? key : index }, props));
|
|
75
|
+
})
|
|
76
|
+
: items))));
|
|
72
77
|
});
|
|
73
78
|
exports.List.displayName = 'List';
|
|
74
79
|
exports.List.Divider = listDivider_1.default;
|
package/list/list.types.d.ts
CHANGED
|
@@ -1,26 +1,47 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IconProp } from '../icon';
|
|
3
|
+
import { LinkProps } from '../link';
|
|
3
4
|
import { SystemProps } from '../system';
|
|
4
5
|
import { ThemingProps } from '../theme';
|
|
5
|
-
import {
|
|
6
|
-
export
|
|
6
|
+
import { PropsOf } from '../utils';
|
|
7
|
+
export declare type ListProps = SystemProps & ThemingProps<'List'> & {
|
|
8
|
+
/** Available theme colors for this component. @default blue */
|
|
7
9
|
colorScheme?: 'blue' | 'grey';
|
|
8
|
-
|
|
10
|
+
/** Socket displaying a heading above the items. */
|
|
9
11
|
heading?: React.ReactNode;
|
|
12
|
+
/** Passed to all nested items to make them interactive. */
|
|
10
13
|
isInteractive?: boolean;
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
/** Socket displaying a list of items. */
|
|
15
|
+
items?: PropsOf<'li', ListItemProps>[] | JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
export declare type ListItemLinkProps = PropsOf<'a', LinkProps> | object;
|
|
18
|
+
export declare type ListItemProps = SystemProps & ThemingProps<'List'> & {
|
|
19
|
+
/** Centers the content vertically and horizontally. @deprecated */
|
|
13
20
|
center?: boolean;
|
|
21
|
+
/** Centers the content horizontally. @deprecated */
|
|
14
22
|
centerH?: boolean;
|
|
23
|
+
/** Centers the content vertically. @deprecated */
|
|
15
24
|
centerV?: boolean;
|
|
25
|
+
/** Available theme colors for this component. */
|
|
16
26
|
colorScheme?: 'blue' | 'grey';
|
|
27
|
+
/** Displays content in a column. @deprecated */
|
|
17
28
|
column?: boolean;
|
|
29
|
+
/** Displays item and its content in disabled state with appropriate styling. */
|
|
18
30
|
disabled?: boolean;
|
|
19
|
-
|
|
20
|
-
|
|
31
|
+
/** Socket displaying an icon on the left. */
|
|
32
|
+
iconLeft?: IconProp | JSX.Element;
|
|
33
|
+
/** Socket displaying an icon on the right. */
|
|
34
|
+
iconRight?: IconProp | JSX.Element;
|
|
35
|
+
/** Makes item clickable and focusable with appropriate styling. */
|
|
21
36
|
isInteractive?: boolean;
|
|
37
|
+
/** Displays item in selected state with appropriate styling. */
|
|
22
38
|
isSelected?: boolean;
|
|
39
|
+
/** Socket displaying a custom item on the left. */
|
|
23
40
|
itemLeft?: React.ReactNode;
|
|
41
|
+
/** Socket displaying a custom item on the right. */
|
|
24
42
|
itemRight?: React.ReactNode;
|
|
43
|
+
/** If provided, content is wrapper with a link and the props are provided to the element. */
|
|
44
|
+
linkProps?: ListItemLinkProps;
|
|
45
|
+
/** Socket displaying text within the item. */
|
|
25
46
|
text?: React.ReactNode;
|
|
26
|
-
}
|
|
47
|
+
};
|
package/list/listDivider.d.ts
CHANGED
package/list/listDivider.js
CHANGED
|
@@ -16,14 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.ListDivider = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var context_1 = require("./context");
|
|
20
19
|
var core_1 = require("../core");
|
|
21
20
|
var divider_1 = __importDefault(require("../divider"));
|
|
21
|
+
var context_1 = require("./context");
|
|
22
|
+
/** Displays a divider line within the List. */
|
|
22
23
|
exports.ListDivider = (0, core_1.vui)(function (props, ref) {
|
|
23
|
-
var
|
|
24
|
-
var listProps = (_a = (0, context_1.useList)()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
-
var mergedProps = __assign(__assign({}, listProps), props);
|
|
26
|
-
var styles = (0, core_1.useStyleConfig)('List', mergedProps);
|
|
24
|
+
var styles = (0, core_1.useStyleConfig)('List', __assign(__assign({}, (0, context_1.useList)()), props));
|
|
27
25
|
return react_1.default.createElement(divider_1.default, __assign({ className: "vui-listDivider", my: 1, ref: ref }, styles.divider, props));
|
|
28
26
|
});
|
|
29
27
|
exports.ListDivider.displayName = 'ListDivider';
|
package/list/listHeading.d.ts
CHANGED
package/list/listHeading.js
CHANGED
|
@@ -16,15 +16,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.ListHeading = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var context_1 = require("./context");
|
|
20
19
|
var core_1 = require("../core");
|
|
21
20
|
var t_1 = require("../t");
|
|
21
|
+
var context_1 = require("./context");
|
|
22
|
+
/** Displays a heading within the List. */
|
|
22
23
|
exports.ListHeading = (0, core_1.vui)(function (props, ref) {
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
var mergedProps = __assign(__assign({}, listProps), props);
|
|
26
|
-
var styles = (0, core_1.useStyleConfig)('List', mergedProps);
|
|
27
|
-
return (react_1.default.createElement(t_1.T, __assign({ className: "vui-listHeading", display: "inline-block", p: 1, ref: ref, weight: "demi" }, styles.heading, props)));
|
|
24
|
+
var styles = (0, core_1.useStyleConfig)('List', __assign(__assign({}, (0, context_1.useList)()), props));
|
|
25
|
+
return (react_1.default.createElement(t_1.T, __assign({ className: "vui-listHeading", display: "inline-block", px: 2, py: 1, ref: ref, weight: "demi" }, styles.heading, props)));
|
|
28
26
|
});
|
|
29
27
|
exports.ListHeading.displayName = 'ListHeading';
|
|
30
28
|
exports.default = exports.ListHeading;
|
package/list/listIcon.d.ts
CHANGED
package/list/listIcon.js
CHANGED
|
@@ -16,14 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.ListIcon = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var context_1 = require("./context");
|
|
20
19
|
var core_1 = require("../core");
|
|
21
20
|
var icon_1 = __importDefault(require("../icon"));
|
|
21
|
+
var context_1 = require("./context");
|
|
22
|
+
/** Displays an icon on the side of the ListItem. */
|
|
22
23
|
exports.ListIcon = (0, core_1.vui)(function (props, ref) {
|
|
23
|
-
var
|
|
24
|
-
var listProps = (_a = (0, context_1.useList)()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
-
var mergedProps = __assign(__assign({}, listProps), props);
|
|
26
|
-
var styles = (0, core_1.useStyleConfig)('List', mergedProps);
|
|
24
|
+
var styles = (0, core_1.useStyleConfig)('List', __assign(__assign({}, (0, context_1.useList)()), props));
|
|
27
25
|
return react_1.default.createElement(icon_1.default, __assign({ className: "vui-listIcon", ref: ref }, styles.icon, props));
|
|
28
26
|
});
|
|
29
27
|
exports.ListIcon.displayName = 'ListIcon';
|
package/list/listItem.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ListItemProps } from './list.types';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
export declare const ListItemBase: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
3
|
+
/**
|
|
4
|
+
* Displays a list item with text and optional icons. Can be shown as interactive or selected.
|
|
5
|
+
* Optionally wraps the content with an <a> element when rendering a link.
|
|
6
|
+
*/
|
|
4
7
|
export declare const ListItem: import("../core").VuiComponent<"li", ListItemProps>;
|
|
5
8
|
export default ListItem;
|
package/list/listItem.js
CHANGED
|
@@ -14,6 +14,25 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
};
|
|
15
15
|
return __assign.apply(this, arguments);
|
|
16
16
|
};
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
17
36
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
37
|
var t = {};
|
|
19
38
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -30,46 +49,60 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
30
49
|
};
|
|
31
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
51
|
exports.ListItem = exports.ListItemBase = void 0;
|
|
33
|
-
var react_1 =
|
|
34
|
-
var
|
|
52
|
+
var react_1 = __importStar(require("react"));
|
|
53
|
+
var core_1 = require("../core");
|
|
54
|
+
var link_1 = __importDefault(require("../link"));
|
|
55
|
+
var utils_1 = require("../utils");
|
|
35
56
|
var context_1 = require("./context");
|
|
36
57
|
var listIcon_1 = __importDefault(require("./listIcon"));
|
|
37
58
|
var listText_1 = __importDefault(require("./listText"));
|
|
38
|
-
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
59
|
+
/** Used as optional content wrapper when list item should be a link. */
|
|
60
|
+
var ListItemLink = (0, core_1.vui)(function (props, ref) { return (react_1.default.createElement(link_1.default, __assign({ borderRadius: "none", h: "100%", px: 2, ref: ref, variant: "plain", w: "100%" }, props))); });
|
|
61
|
+
exports.ListItemBase = core_1.styled.liBox(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\tline-height: normal;\n\toutline: none;\n\ttransition-duration: fast;\n\n\t&[aria-disabled='true'] {\n\t\tbackground-color: disabled.bg;\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\t\tuser-select: none;\n\t}\n"], ["\n\tdisplay: flex;\n\tline-height: normal;\n\toutline: none;\n\ttransition-duration: fast;\n\n\t&[aria-disabled='true'] {\n\t\tbackground-color: disabled.bg;\n\t\tcolor: disabled.color;\n\t\tcursor: not-allowed;\n\t\tuser-select: none;\n\t}\n"
|
|
62
|
+
/**
|
|
63
|
+
* Displays a list item with text and optional icons. Can be shown as interactive or selected.
|
|
64
|
+
* Optionally wraps the content with an <a> element when rendering a link.
|
|
65
|
+
*/
|
|
66
|
+
])));
|
|
67
|
+
/**
|
|
68
|
+
* Displays a list item with text and optional icons. Can be shown as interactive or selected.
|
|
69
|
+
* Optionally wraps the content with an <a> element when rendering a link.
|
|
70
|
+
*/
|
|
42
71
|
exports.ListItem = (0, core_1.vui)(function (props, ref) {
|
|
43
|
-
var
|
|
44
|
-
var mergedProps =
|
|
45
|
-
var children = mergedProps.children, center = mergedProps.center, centerH = mergedProps.centerH, _a = mergedProps.centerV, centerV = _a === void 0 ? true : _a, className = mergedProps.className, column = mergedProps.column, disabled = mergedProps.disabled, iconLeft = mergedProps.iconLeft, iconRight = mergedProps.iconRight, _b = mergedProps.isInteractive, isInteractive = _b === void 0 ? props.onClick !== undefined : _b, isSelected = mergedProps.isSelected, isTruncated = mergedProps.isTruncated, itemLeft = mergedProps.itemLeft, itemRight = mergedProps.itemRight, onClick = mergedProps.onClick, text = mergedProps.text, rest = __rest(mergedProps, ["children", "center", "centerH", "centerV", "className", "column", "disabled", "iconLeft", "iconRight", "isInteractive", "isSelected", "isTruncated", "itemLeft", "itemRight", "onClick", "text"]);
|
|
72
|
+
var mergedProps = __assign(__assign({}, (0, context_1.useList)()), props);
|
|
73
|
+
var children = mergedProps.children, center = mergedProps.center, centerH = mergedProps.centerH, _a = mergedProps.centerV, centerV = _a === void 0 ? true : _a, className = mergedProps.className, column = mergedProps.column, disabled = mergedProps.disabled, iconLeft = mergedProps.iconLeft, iconRight = mergedProps.iconRight, isInteractiveProp = mergedProps.isInteractive, isSelected = mergedProps.isSelected, isTruncated = mergedProps.isTruncated, itemLeft = mergedProps.itemLeft, itemRight = mergedProps.itemRight, linkProps = mergedProps.linkProps, onClick = mergedProps.onClick, text = mergedProps.text, rest = __rest(mergedProps, ["children", "center", "centerH", "centerV", "className", "column", "disabled", "iconLeft", "iconRight", "isInteractive", "isSelected", "isTruncated", "itemLeft", "itemRight", "linkProps", "onClick", "text"]);
|
|
46
74
|
var styles = (0, core_1.useStyleConfig)('List', mergedProps);
|
|
47
|
-
var
|
|
75
|
+
var _b = styles.item, activeBg = _b.activeBg, hoverBg = _b.hoverBg, selectedBg = _b.selectedBg, itemStyles = __rest(_b, ["activeBg", "hoverBg", "selectedBg"]);
|
|
76
|
+
var isLinkItem = linkProps !== undefined;
|
|
77
|
+
var isInteractive = isInteractiveProp || isLinkItem || onClick !== undefined;
|
|
48
78
|
var alignItems = (center || (column ? centerH : centerV)) && 'center';
|
|
49
79
|
var flexDirection = column && 'column';
|
|
50
80
|
var justifyContent = (center || (column ? centerV : centerH)) && 'center';
|
|
81
|
+
var ContentWrapper = isLinkItem ? ListItemLink : react_1.Fragment;
|
|
51
82
|
var interactiveProps = !disabled && isInteractive
|
|
52
83
|
? {
|
|
53
84
|
cursor: 'pointer',
|
|
54
85
|
focusVisibleRing: 2,
|
|
55
86
|
hoverBg: hoverBg,
|
|
56
87
|
activeBg: activeBg,
|
|
57
|
-
tabIndex: 0,
|
|
88
|
+
tabIndex: !isLinkItem ? 0 : undefined,
|
|
58
89
|
userSelect: 'none'
|
|
59
90
|
}
|
|
60
91
|
: {};
|
|
61
92
|
var aliasedProps = (0, utils_1.filterUndefined)({
|
|
62
93
|
alignItems: alignItems,
|
|
63
|
-
bg: isSelected ?
|
|
64
|
-
'
|
|
94
|
+
bg: isSelected ? selectedBg : undefined,
|
|
95
|
+
'aria-disabled': disabled,
|
|
65
96
|
flexDirection: flexDirection,
|
|
66
|
-
justifyContent: justifyContent
|
|
97
|
+
justifyContent: justifyContent,
|
|
98
|
+
px: isLinkItem ? 0 : undefined
|
|
67
99
|
});
|
|
68
|
-
return (react_1.default.createElement(exports.ListItemBase, __assign({ className: (0, utils_1.cs)('vui-listItem', className), onClick: !disabled ? onClick : undefined,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
100
|
+
return (react_1.default.createElement(exports.ListItemBase, __assign({ className: (0, utils_1.cs)('vui-listItem', className), onClick: !disabled ? onClick : undefined, ref: ref }, itemStyles, interactiveProps, aliasedProps, rest),
|
|
101
|
+
react_1.default.createElement(ContentWrapper, __assign({}, linkProps),
|
|
102
|
+
itemLeft,
|
|
103
|
+
(0, utils_1.isString)(iconLeft) ? react_1.default.createElement(listIcon_1.default, { mr: 1, name: iconLeft }) : iconLeft, children !== null && children !== void 0 ? children : ((0, utils_1.isReactText)(text) ? react_1.default.createElement(listText_1.default, __assign({}, { isTruncated: isTruncated, text: text })) : text),
|
|
104
|
+
(0, utils_1.isString)(iconRight) ? react_1.default.createElement(listIcon_1.default, { ml: "auto", name: iconRight }) : iconRight,
|
|
105
|
+
itemRight)));
|
|
73
106
|
});
|
|
74
107
|
exports.ListItem.displayName = 'ListItem';
|
|
75
108
|
exports.default = exports.ListItem;
|
package/list/listText.d.ts
CHANGED
package/list/listText.js
CHANGED
|
@@ -16,14 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.ListText = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var context_1 = require("./context");
|
|
20
19
|
var core_1 = require("../core");
|
|
21
20
|
var t_1 = __importDefault(require("../t"));
|
|
21
|
+
var context_1 = require("./context");
|
|
22
|
+
/** Displays text within the ListItem. */
|
|
22
23
|
exports.ListText = (0, core_1.vui)(function (props, ref) {
|
|
23
|
-
var
|
|
24
|
-
var listProps = (_a = (0, context_1.useList)()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
-
var mergedProps = __assign(__assign({}, listProps), props);
|
|
26
|
-
var styles = (0, core_1.useStyleConfig)('List', mergedProps);
|
|
24
|
+
var styles = (0, core_1.useStyleConfig)('List', __assign(__assign({}, (0, context_1.useList)()), props));
|
|
27
25
|
return react_1.default.createElement(t_1.default, __assign({ className: "vui-listText", fontSize: "inherit", ref: ref }, styles.text, props));
|
|
28
26
|
});
|
|
29
27
|
exports.ListText.displayName = 'ListText';
|
package/list/theme.d.ts
CHANGED
package/list/theme.js
CHANGED
|
@@ -4,11 +4,13 @@ function variantDefault(props) {
|
|
|
4
4
|
var c = props.colorScheme;
|
|
5
5
|
var item = {
|
|
6
6
|
activeBg: c + ".30",
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
hoverBg: c + ".20",
|
|
8
|
+
selectedBg: c + ".10",
|
|
9
|
+
px: 2
|
|
9
10
|
};
|
|
10
11
|
return { item: item };
|
|
11
12
|
}
|
|
13
|
+
var baseStyle = {};
|
|
12
14
|
var defaultProps = {
|
|
13
15
|
colorScheme: 'blue',
|
|
14
16
|
size: 'md',
|
|
@@ -81,6 +83,7 @@ var variants = {
|
|
|
81
83
|
}
|
|
82
84
|
};
|
|
83
85
|
exports.default = {
|
|
86
|
+
baseStyle: baseStyle,
|
|
84
87
|
defaultProps: defaultProps,
|
|
85
88
|
parts: parts,
|
|
86
89
|
sizes: sizes,
|
package/menu/menu.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { MenuProps } from './menu.types';
|
|
3
|
+
/** Wraps Popover component and exposes some props to the children via context. */
|
|
3
4
|
declare function Menu(props: MenuProps): JSX.Element;
|
|
4
5
|
declare namespace Menu {
|
|
5
6
|
var Button: import("..").VuiComponent<"button", import("..").ButtonProps>;
|
package/menu/menu.js
CHANGED
|
@@ -51,6 +51,7 @@ var context_1 = require("./context");
|
|
|
51
51
|
var menuButton_1 = __importDefault(require("./menuButton"));
|
|
52
52
|
var menuItem_1 = __importDefault(require("./menuItem"));
|
|
53
53
|
var menuList_1 = __importDefault(require("./menuList"));
|
|
54
|
+
/** Wraps Popover component and exposes some props to the children via context. */
|
|
54
55
|
function Menu(props) {
|
|
55
56
|
var _a = props.closeOnSelect, closeOnSelect = _a === void 0 ? true : _a, size = props.size, variant = props.variant, rest = __rest(props, ["closeOnSelect", "size", "variant"]);
|
|
56
57
|
var context = (0, react_1.useMemo)(function () { return (0, utils_1.filterUndefined)({ closeOnSelect: closeOnSelect, size: size, variant: variant }); }, [closeOnSelect, size, variant]);
|
package/menu/menu.types.d.ts
CHANGED
|
@@ -3,9 +3,12 @@ import { ListProps } from '../list';
|
|
|
3
3
|
import { PopoverContentProps, PopoverProps } from '../popover';
|
|
4
4
|
import { ThemingProps } from '../theme';
|
|
5
5
|
export declare type MenuListProps = ListProps & {
|
|
6
|
+
/** Props object passed to the inner PopoverContent. */
|
|
6
7
|
contentProps?: PopoverContentProps;
|
|
8
|
+
/** Ref passed to the inner PopoverContent. */
|
|
7
9
|
contentRef?: RefObject<HTMLDivElement>;
|
|
8
10
|
};
|
|
9
11
|
export declare type MenuProps = ThemingProps<'Menu'> & PopoverProps & {
|
|
12
|
+
/** Content closes when clicking on a list item. */
|
|
10
13
|
closeOnSelect?: boolean;
|
|
11
14
|
};
|
package/menu/menuButton.d.ts
CHANGED