@veracity/vui 0.7.0-beta.1 → 0.7.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/button/button.js +1 -1
- package/dist/cjs/button/buttonIcon.d.ts.map +1 -1
- package/dist/cjs/button/buttonIcon.js +15 -2
- package/dist/cjs/button/buttonText.d.ts.map +1 -1
- package/dist/cjs/button/buttonText.js +15 -2
- package/dist/cjs/button/context.d.ts +2 -2
- package/dist/cjs/button/context.d.ts.map +1 -1
- package/dist/cjs/button/context.js +3 -3
- package/dist/cjs/buttonGroup/context.d.ts +2 -2
- package/dist/cjs/buttonGroup/context.d.ts.map +1 -1
- package/dist/cjs/buttonGroup/context.js +3 -3
- package/dist/cjs/checkbox/checkbox.js +1 -1
- package/dist/cjs/checkbox/context.d.ts +2 -2
- package/dist/cjs/checkbox/context.d.ts.map +1 -1
- package/dist/cjs/checkbox/context.js +3 -3
- package/dist/cjs/core/links.d.ts.map +1 -1
- package/dist/cjs/core/links.js +26 -25
- package/dist/cjs/dialog/dialogBody.d.ts.map +1 -1
- package/dist/cjs/dialog/dialogBody.js +13 -1
- package/dist/cjs/dialog/dialogCancelButton.d.ts.map +1 -1
- package/dist/cjs/dialog/dialogCancelButton.js +14 -1
- package/dist/cjs/dialog/dialogCloseButton.d.ts.map +1 -1
- package/dist/cjs/dialog/dialogCloseButton.js +14 -1
- package/dist/cjs/dialog/dialogFooter.d.ts.map +1 -1
- package/dist/cjs/dialog/dialogFooter.js +2 -2
- package/dist/cjs/dialog/dialogHeader.js +2 -2
- package/dist/cjs/dialog/dialogIcon.d.ts.map +1 -1
- package/dist/cjs/dialog/dialogIcon.js +14 -1
- package/dist/cjs/dialog/dialogSubmitButton.d.ts.map +1 -1
- package/dist/cjs/dialog/dialogSubmitButton.js +14 -1
- package/dist/cjs/dialog/dialogTitle.d.ts.map +1 -1
- package/dist/cjs/dialog/dialogTitle.js +14 -1
- package/dist/cjs/footer/footerColumn.d.ts.map +1 -1
- package/dist/cjs/footer/footerColumn.js +3 -2
- package/dist/cjs/footer/footerContent.d.ts.map +1 -1
- package/dist/cjs/footer/footerContent.js +14 -1
- package/dist/cjs/footer/footerHeading.d.ts.map +1 -1
- package/dist/cjs/footer/footerHeading.js +14 -1
- package/dist/cjs/footer/footerLink.d.ts.map +1 -1
- package/dist/cjs/footer/footerLink.js +14 -1
- package/dist/cjs/footer/footerRow.d.ts.map +1 -1
- package/dist/cjs/footer/footerRow.js +14 -1
- package/dist/cjs/footer/footerSection.js +2 -2
- package/dist/cjs/footer/footerTrademark.d.ts.map +1 -1
- package/dist/cjs/footer/footerTrademark.js +3 -2
- package/dist/cjs/header/headerAccount.d.ts.map +1 -1
- package/dist/cjs/header/headerAccount.js +5 -5
- package/dist/cjs/header/headerAccount.types.d.ts +1 -1
- package/dist/cjs/header/headerAccount.types.d.ts.map +1 -1
- package/dist/cjs/header/headerAccountUserInfo.d.ts.map +1 -1
- package/dist/cjs/header/headerAccountUserInfo.js +5 -4
- package/dist/cjs/header/headerContent.d.ts.map +1 -1
- package/dist/cjs/header/headerContent.js +14 -1
- package/dist/cjs/header/headerCreateAccount.d.ts.map +1 -1
- package/dist/cjs/header/headerCreateAccount.js +3 -2
- package/dist/cjs/header/headerDivider.d.ts.map +1 -1
- package/dist/cjs/header/headerDivider.js +14 -1
- package/dist/cjs/header/headerLogo.d.ts.map +1 -1
- package/dist/cjs/header/headerLogo.js +3 -2
- package/dist/cjs/header/headerMainLinks.d.ts.map +1 -1
- package/dist/cjs/header/headerMainLinks.js +3 -2
- package/dist/cjs/header/headerMobileContent.d.ts.map +1 -1
- package/dist/cjs/header/headerMobileContent.js +13 -1
- package/dist/cjs/header/headerMobileToggle.d.ts.map +1 -1
- package/dist/cjs/header/headerMobileToggle.js +13 -1
- package/dist/cjs/header/headerNotifications.d.ts.map +1 -1
- package/dist/cjs/header/headerNotifications.js +3 -2
- package/dist/cjs/header/headerServices.js +2 -2
- package/dist/cjs/header/headerServicesMessage.d.ts.map +1 -1
- package/dist/cjs/header/headerServicesMessage.js +3 -2
- package/dist/cjs/header/headerSignIn.d.ts.map +1 -1
- package/dist/cjs/header/headerSignIn.js +3 -2
- package/dist/cjs/input/context.d.ts +2 -2
- package/dist/cjs/input/context.d.ts.map +1 -1
- package/dist/cjs/input/context.js +3 -3
- package/dist/cjs/input/input.js +1 -1
- package/dist/cjs/input/inputIcon.d.ts.map +1 -1
- package/dist/cjs/input/inputIcon.js +15 -2
- package/dist/cjs/input/inputInput.d.ts.map +1 -1
- package/dist/cjs/input/inputInput.js +14 -2
- package/dist/cjs/link/context.d.ts +2 -2
- package/dist/cjs/link/context.d.ts.map +1 -1
- package/dist/cjs/link/context.js +3 -3
- package/dist/cjs/link/linkIcon.d.ts.map +1 -1
- package/dist/cjs/link/linkIcon.js +15 -2
- package/dist/cjs/link/linkText.d.ts.map +1 -1
- package/dist/cjs/link/linkText.js +15 -2
- package/dist/cjs/list/context.d.ts +2 -2
- package/dist/cjs/list/context.d.ts.map +1 -1
- package/dist/cjs/list/context.js +3 -3
- package/dist/cjs/list/listDivider.d.ts.map +1 -1
- package/dist/cjs/list/listDivider.js +15 -2
- package/dist/cjs/list/listHeading.d.ts.map +1 -1
- package/dist/cjs/list/listHeading.js +15 -2
- package/dist/cjs/list/listIcon.d.ts.map +1 -1
- package/dist/cjs/list/listIcon.js +15 -2
- package/dist/cjs/list/listItem.d.ts.map +1 -1
- package/dist/cjs/list/listItem.js +3 -3
- package/dist/cjs/list/listText.d.ts.map +1 -1
- package/dist/cjs/list/listText.js +15 -2
- package/dist/cjs/menu/menuButton.d.ts.map +1 -1
- package/dist/cjs/menu/menuButton.js +15 -2
- package/dist/cjs/menu/menuItem.d.ts.map +1 -1
- package/dist/cjs/menu/menuItem.js +2 -2
- package/dist/cjs/menu/menuList.d.ts.map +1 -1
- package/dist/cjs/menu/menuList.js +4 -3
- package/dist/cjs/modal/modalBackdrop.d.ts.map +1 -1
- package/dist/cjs/modal/modalBackdrop.js +13 -1
- package/dist/cjs/modal/modalContent.d.ts.map +1 -1
- package/dist/cjs/modal/modalContent.js +13 -1
- package/dist/cjs/notification/context.d.ts +2 -2
- package/dist/cjs/notification/context.d.ts.map +1 -1
- package/dist/cjs/notification/context.js +3 -3
- package/dist/cjs/notification/notificationButton.d.ts.map +1 -1
- package/dist/cjs/notification/notificationButton.js +16 -3
- package/dist/cjs/notification/notificationIcon.d.ts.map +1 -1
- package/dist/cjs/notification/notificationIcon.js +16 -3
- package/dist/cjs/notification/notificationText.d.ts.map +1 -1
- package/dist/cjs/notification/notificationText.js +15 -2
- package/dist/cjs/notification/notificationTitle.d.ts.map +1 -1
- package/dist/cjs/notification/notificationTitle.js +15 -2
- package/dist/cjs/pagination/helpers.d.ts.map +1 -1
- package/dist/cjs/pagination/helpers.js +30 -12
- package/dist/cjs/pagination/paginationButton.d.ts.map +1 -1
- package/dist/cjs/pagination/paginationButton.js +3 -2
- package/dist/cjs/pagination/paginationEllipsis.d.ts.map +1 -1
- package/dist/cjs/pagination/paginationEllipsis.js +3 -2
- package/dist/cjs/pagination/paginationGoToPage.d.ts.map +1 -1
- package/dist/cjs/pagination/paginationGoToPage.js +14 -1
- package/dist/cjs/pagination/paginationNavigation.js +2 -2
- package/dist/cjs/pagination/paginationPrevNext.d.ts.map +1 -1
- package/dist/cjs/pagination/paginationPrevNext.js +3 -2
- package/dist/cjs/pagination/paginationResults.d.ts.map +1 -1
- package/dist/cjs/pagination/paginationResults.js +3 -2
- package/dist/cjs/popover/popoverContent.js +2 -2
- package/dist/cjs/popover/popoverTrigger.js +3 -3
- package/dist/cjs/radio/context.d.ts +2 -2
- package/dist/cjs/radio/context.d.ts.map +1 -1
- package/dist/cjs/radio/context.js +3 -3
- package/dist/cjs/radio/radio.js +1 -1
- package/dist/cjs/spinner/consts.d.ts +0 -12
- package/dist/cjs/spinner/consts.d.ts.map +1 -1
- package/dist/cjs/spinner/consts.js +4 -8
- package/dist/cjs/spinner/spinner.js +2 -2
- package/dist/cjs/switch/context.d.ts +2 -2
- package/dist/cjs/switch/context.d.ts.map +1 -1
- package/dist/cjs/switch/context.js +3 -3
- package/dist/cjs/switch/switchButton.js +2 -2
- package/dist/cjs/switch/switchLabel.d.ts.map +1 -1
- package/dist/cjs/switch/switchLabel.js +15 -2
- package/dist/cjs/tag/context.d.ts +2 -2
- package/dist/cjs/tag/context.d.ts.map +1 -1
- package/dist/cjs/tag/context.js +3 -3
- package/dist/cjs/tag/tagButton.d.ts.map +1 -1
- package/dist/cjs/tag/tagButton.js +16 -3
- package/dist/cjs/tag/tagIcon.d.ts.map +1 -1
- package/dist/cjs/tag/tagIcon.js +15 -2
- package/dist/cjs/tag/tagText.d.ts.map +1 -1
- package/dist/cjs/tag/tagText.js +15 -2
- package/dist/cjs/textarea/textarea.js +1 -1
- package/dist/cjs/utils/react.d.ts +2 -2
- package/dist/cjs/utils/react.d.ts.map +1 -1
- package/dist/cjs/utils/react.js +2 -2
- package/dist/esm/button/button.js +2 -2
- package/dist/esm/button/buttonIcon.d.ts.map +1 -1
- package/dist/esm/button/buttonIcon.js +5 -3
- package/dist/esm/button/buttonText.d.ts.map +1 -1
- package/dist/esm/button/buttonText.js +5 -3
- package/dist/esm/button/context.d.ts +2 -2
- package/dist/esm/button/context.d.ts.map +1 -1
- package/dist/esm/button/context.js +2 -2
- package/dist/esm/buttonGroup/context.d.ts +2 -2
- package/dist/esm/buttonGroup/context.d.ts.map +1 -1
- package/dist/esm/buttonGroup/context.js +2 -2
- package/dist/esm/checkbox/checkbox.js +2 -2
- package/dist/esm/checkbox/context.d.ts +2 -2
- package/dist/esm/checkbox/context.d.ts.map +1 -1
- package/dist/esm/checkbox/context.js +2 -2
- package/dist/esm/core/links.d.ts.map +1 -1
- package/dist/esm/core/links.js +18 -15
- package/dist/esm/dialog/dialogBody.d.ts.map +1 -1
- package/dist/esm/dialog/dialogBody.js +3 -2
- package/dist/esm/dialog/dialogCancelButton.d.ts.map +1 -1
- package/dist/esm/dialog/dialogCancelButton.js +3 -1
- package/dist/esm/dialog/dialogCloseButton.d.ts.map +1 -1
- package/dist/esm/dialog/dialogCloseButton.js +3 -1
- package/dist/esm/dialog/dialogFooter.d.ts.map +1 -1
- package/dist/esm/dialog/dialogFooter.js +3 -3
- package/dist/esm/dialog/dialogHeader.js +3 -3
- package/dist/esm/dialog/dialogIcon.d.ts.map +1 -1
- package/dist/esm/dialog/dialogIcon.js +3 -1
- package/dist/esm/dialog/dialogSubmitButton.d.ts.map +1 -1
- package/dist/esm/dialog/dialogSubmitButton.js +3 -1
- package/dist/esm/dialog/dialogTitle.d.ts.map +1 -1
- package/dist/esm/dialog/dialogTitle.js +3 -1
- package/dist/esm/footer/footerColumn.d.ts.map +1 -1
- package/dist/esm/footer/footerColumn.js +3 -2
- package/dist/esm/footer/footerContent.d.ts.map +1 -1
- package/dist/esm/footer/footerContent.js +3 -1
- package/dist/esm/footer/footerHeading.d.ts.map +1 -1
- package/dist/esm/footer/footerHeading.js +3 -1
- package/dist/esm/footer/footerLink.d.ts.map +1 -1
- package/dist/esm/footer/footerLink.js +3 -1
- package/dist/esm/footer/footerRow.d.ts.map +1 -1
- package/dist/esm/footer/footerRow.js +3 -1
- package/dist/esm/footer/footerSection.js +3 -3
- package/dist/esm/footer/footerTrademark.d.ts.map +1 -1
- package/dist/esm/footer/footerTrademark.js +3 -2
- package/dist/esm/header/headerAccount.d.ts.map +1 -1
- package/dist/esm/header/headerAccount.js +5 -5
- package/dist/esm/header/headerAccount.types.d.ts +1 -1
- package/dist/esm/header/headerAccount.types.d.ts.map +1 -1
- package/dist/esm/header/headerAccountUserInfo.d.ts.map +1 -1
- package/dist/esm/header/headerAccountUserInfo.js +5 -4
- package/dist/esm/header/headerContent.d.ts.map +1 -1
- package/dist/esm/header/headerContent.js +3 -1
- package/dist/esm/header/headerCreateAccount.d.ts.map +1 -1
- package/dist/esm/header/headerCreateAccount.js +3 -2
- package/dist/esm/header/headerDivider.d.ts.map +1 -1
- package/dist/esm/header/headerDivider.js +3 -1
- package/dist/esm/header/headerLogo.d.ts.map +1 -1
- package/dist/esm/header/headerLogo.js +3 -2
- package/dist/esm/header/headerMainLinks.d.ts.map +1 -1
- package/dist/esm/header/headerMainLinks.js +3 -2
- package/dist/esm/header/headerMobileContent.d.ts.map +1 -1
- package/dist/esm/header/headerMobileContent.js +3 -2
- package/dist/esm/header/headerMobileToggle.d.ts.map +1 -1
- package/dist/esm/header/headerMobileToggle.js +3 -2
- package/dist/esm/header/headerNotifications.d.ts.map +1 -1
- package/dist/esm/header/headerNotifications.js +3 -2
- package/dist/esm/header/headerServices.js +2 -2
- package/dist/esm/header/headerServicesMessage.d.ts.map +1 -1
- package/dist/esm/header/headerServicesMessage.js +3 -2
- package/dist/esm/header/headerSignIn.d.ts.map +1 -1
- package/dist/esm/header/headerSignIn.js +3 -2
- package/dist/esm/input/context.d.ts +2 -2
- package/dist/esm/input/context.d.ts.map +1 -1
- package/dist/esm/input/context.js +2 -2
- package/dist/esm/input/input.js +1 -1
- package/dist/esm/input/inputIcon.d.ts.map +1 -1
- package/dist/esm/input/inputIcon.js +5 -3
- package/dist/esm/input/inputInput.d.ts.map +1 -1
- package/dist/esm/input/inputInput.js +5 -4
- package/dist/esm/link/context.d.ts +2 -2
- package/dist/esm/link/context.d.ts.map +1 -1
- package/dist/esm/link/context.js +2 -2
- package/dist/esm/link/linkIcon.d.ts.map +1 -1
- package/dist/esm/link/linkIcon.js +5 -3
- package/dist/esm/link/linkText.d.ts.map +1 -1
- package/dist/esm/link/linkText.js +5 -3
- package/dist/esm/list/context.d.ts +2 -2
- package/dist/esm/list/context.d.ts.map +1 -1
- package/dist/esm/list/context.js +2 -2
- package/dist/esm/list/listDivider.d.ts.map +1 -1
- package/dist/esm/list/listDivider.js +5 -3
- package/dist/esm/list/listHeading.d.ts.map +1 -1
- package/dist/esm/list/listHeading.js +5 -3
- package/dist/esm/list/listIcon.d.ts.map +1 -1
- package/dist/esm/list/listIcon.js +5 -3
- package/dist/esm/list/listItem.d.ts.map +1 -1
- package/dist/esm/list/listItem.js +4 -4
- package/dist/esm/list/listText.d.ts.map +1 -1
- package/dist/esm/list/listText.js +5 -3
- package/dist/esm/menu/menuButton.d.ts.map +1 -1
- package/dist/esm/menu/menuButton.js +4 -2
- package/dist/esm/menu/menuItem.d.ts.map +1 -1
- package/dist/esm/menu/menuItem.js +3 -3
- package/dist/esm/menu/menuList.d.ts.map +1 -1
- package/dist/esm/menu/menuList.js +4 -3
- package/dist/esm/modal/modalBackdrop.d.ts.map +1 -1
- package/dist/esm/modal/modalBackdrop.js +3 -2
- package/dist/esm/modal/modalContent.d.ts.map +1 -1
- package/dist/esm/modal/modalContent.js +3 -2
- package/dist/esm/notification/context.d.ts +2 -2
- package/dist/esm/notification/context.d.ts.map +1 -1
- package/dist/esm/notification/context.js +2 -2
- package/dist/esm/notification/notificationButton.d.ts.map +1 -1
- package/dist/esm/notification/notificationButton.js +6 -4
- package/dist/esm/notification/notificationIcon.d.ts.map +1 -1
- package/dist/esm/notification/notificationIcon.js +6 -4
- package/dist/esm/notification/notificationText.d.ts.map +1 -1
- package/dist/esm/notification/notificationText.js +5 -3
- package/dist/esm/notification/notificationTitle.d.ts.map +1 -1
- package/dist/esm/notification/notificationTitle.js +5 -3
- package/dist/esm/pagination/helpers.d.ts.map +1 -1
- package/dist/esm/pagination/helpers.js +30 -12
- package/dist/esm/pagination/paginationButton.d.ts.map +1 -1
- package/dist/esm/pagination/paginationButton.js +3 -2
- package/dist/esm/pagination/paginationEllipsis.d.ts.map +1 -1
- package/dist/esm/pagination/paginationEllipsis.js +3 -2
- package/dist/esm/pagination/paginationGoToPage.d.ts.map +1 -1
- package/dist/esm/pagination/paginationGoToPage.js +3 -1
- package/dist/esm/pagination/paginationNavigation.js +3 -3
- package/dist/esm/pagination/paginationPrevNext.d.ts.map +1 -1
- package/dist/esm/pagination/paginationPrevNext.js +3 -2
- package/dist/esm/pagination/paginationResults.d.ts.map +1 -1
- package/dist/esm/pagination/paginationResults.js +3 -2
- package/dist/esm/popover/popoverContent.js +3 -3
- package/dist/esm/popover/popoverTrigger.js +4 -4
- package/dist/esm/radio/context.d.ts +2 -2
- package/dist/esm/radio/context.d.ts.map +1 -1
- package/dist/esm/radio/context.js +2 -2
- package/dist/esm/radio/radio.js +2 -2
- package/dist/esm/spinner/consts.d.ts +0 -12
- package/dist/esm/spinner/consts.d.ts.map +1 -1
- package/dist/esm/spinner/consts.js +4 -8
- package/dist/esm/spinner/spinner.js +2 -2
- package/dist/esm/switch/context.d.ts +2 -2
- package/dist/esm/switch/context.d.ts.map +1 -1
- package/dist/esm/switch/context.js +2 -2
- package/dist/esm/switch/switchButton.js +3 -3
- package/dist/esm/switch/switchLabel.d.ts.map +1 -1
- package/dist/esm/switch/switchLabel.js +5 -3
- package/dist/esm/tag/context.d.ts +2 -2
- package/dist/esm/tag/context.d.ts.map +1 -1
- package/dist/esm/tag/context.js +2 -2
- package/dist/esm/tag/tagButton.d.ts.map +1 -1
- package/dist/esm/tag/tagButton.js +6 -4
- package/dist/esm/tag/tagIcon.d.ts.map +1 -1
- package/dist/esm/tag/tagIcon.js +5 -3
- package/dist/esm/tag/tagText.d.ts.map +1 -1
- package/dist/esm/tag/tagText.js +5 -3
- package/dist/esm/textarea/textarea.js +1 -1
- package/dist/esm/utils/react.d.ts +2 -2
- package/dist/esm/utils/react.d.ts.map +1 -1
- package/dist/esm/utils/react.js +2 -2
- package/package.json +1 -1
- package/src/button/button.tsx +2 -2
- package/src/button/buttonIcon.tsx +5 -3
- package/src/button/buttonText.tsx +5 -3
- package/src/button/context.ts +2 -2
- package/src/buttonGroup/context.ts +2 -2
- package/src/checkbox/checkbox.tsx +2 -2
- package/src/checkbox/context.ts +2 -2
- package/src/core/links.tsx +19 -16
- package/src/dialog/dialogBody.tsx +4 -3
- package/src/dialog/dialogCancelButton.tsx +9 -1
- package/src/dialog/dialogCloseButton.tsx +4 -2
- package/src/dialog/dialogFooter.tsx +11 -3
- package/src/dialog/dialogHeader.tsx +3 -3
- package/src/dialog/dialogIcon.tsx +3 -1
- package/src/dialog/dialogSubmitButton.tsx +10 -1
- package/src/dialog/dialogTitle.tsx +3 -1
- package/src/footer/footerColumn.tsx +3 -2
- package/src/footer/footerContent.tsx +12 -1
- package/src/footer/footerHeading.tsx +5 -1
- package/src/footer/footerLink.tsx +11 -1
- package/src/footer/footerRow.tsx +3 -1
- package/src/footer/footerSection.tsx +3 -3
- package/src/footer/footerTrademark.tsx +3 -2
- package/src/header/headerAccount.tsx +11 -4
- package/src/header/headerAccount.types.ts +1 -1
- package/src/header/headerAccountUserInfo.tsx +20 -5
- package/src/header/headerContent.tsx +14 -1
- package/src/header/headerCreateAccount.tsx +3 -2
- package/src/header/headerDivider.tsx +4 -2
- package/src/header/headerLogo.tsx +3 -2
- package/src/header/headerMainLinks.tsx +10 -2
- package/src/header/headerMobileContent.tsx +4 -3
- package/src/header/headerMobileToggle.tsx +4 -3
- package/src/header/headerNotifications.tsx +3 -1
- package/src/header/headerServices.tsx +2 -2
- package/src/header/headerServicesMessage.tsx +10 -2
- package/src/header/headerSignIn.tsx +10 -2
- package/src/input/context.ts +2 -2
- package/src/input/input.tsx +1 -1
- package/src/input/inputIcon.tsx +5 -3
- package/src/input/inputInput.tsx +13 -4
- package/src/link/context.ts +2 -2
- package/src/link/linkIcon.tsx +5 -3
- package/src/link/linkText.tsx +12 -3
- package/src/list/context.ts +2 -2
- package/src/list/listDivider.tsx +5 -3
- package/src/list/listHeading.tsx +6 -4
- package/src/list/listIcon.tsx +5 -3
- package/src/list/listItem.tsx +13 -4
- package/src/list/listText.tsx +5 -3
- package/src/menu/menuButton.tsx +12 -2
- package/src/menu/menuItem.tsx +12 -3
- package/src/menu/menuList.tsx +4 -3
- package/src/modal/modalBackdrop.tsx +3 -2
- package/src/modal/modalContent.tsx +4 -3
- package/src/notification/context.ts +2 -2
- package/src/notification/notificationButton.tsx +7 -5
- package/src/notification/notificationIcon.tsx +7 -5
- package/src/notification/notificationText.tsx +6 -4
- package/src/notification/notificationTitle.tsx +13 -3
- package/src/pagination/helpers.ts +40 -8
- package/src/pagination/paginationButton.tsx +3 -2
- package/src/pagination/paginationEllipsis.tsx +10 -2
- package/src/pagination/paginationGoToPage.tsx +10 -2
- package/src/pagination/paginationNavigation.tsx +3 -3
- package/src/pagination/paginationPrevNext.tsx +3 -2
- package/src/pagination/paginationResults.tsx +3 -2
- package/src/popover/popoverContent.tsx +3 -3
- package/src/popover/popoverTrigger.tsx +4 -4
- package/src/radio/context.ts +2 -2
- package/src/radio/radio.tsx +2 -2
- package/src/spinner/consts.ts +4 -8
- package/src/spinner/spinner.tsx +1 -1
- package/src/switch/context.ts +2 -2
- package/src/switch/switchButton.tsx +3 -3
- package/src/switch/switchLabel.tsx +5 -3
- package/src/tag/context.ts +2 -2
- package/src/tag/tagButton.tsx +7 -5
- package/src/tag/tagIcon.tsx +5 -3
- package/src/tag/tagText.tsx +5 -3
- package/src/textarea/textarea.tsx +1 -1
- package/src/utils/react.ts +12 -3
|
@@ -2,16 +2,18 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import Button, { ButtonProps } from '../button'
|
|
4
4
|
import { useStyleConfig, vui } from '../core'
|
|
5
|
-
import {
|
|
5
|
+
import { cs } from '../utils'
|
|
6
|
+
import { useNotificationContext } from './context'
|
|
6
7
|
|
|
7
8
|
/** Displays an action button within the Notification. */
|
|
8
9
|
export const NotificationButton = vui<'button', ButtonProps>((props, ref) => {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
10
|
+
const { className, ...rest } = props
|
|
11
|
+
const mergedProps = { ...useNotificationContext(), ...props }
|
|
12
|
+
const styles = useStyleConfig('Notification', useNotificationContext())
|
|
11
13
|
|
|
12
14
|
return (
|
|
13
15
|
<Button
|
|
14
|
-
className=
|
|
16
|
+
className={cs('vui-notificationButton', className)}
|
|
15
17
|
colorScheme={mergedProps.colorScheme}
|
|
16
18
|
ml={1}
|
|
17
19
|
mr={-0.5}
|
|
@@ -19,7 +21,7 @@ export const NotificationButton = vui<'button', ButtonProps>((props, ref) => {
|
|
|
19
21
|
size="sm"
|
|
20
22
|
variant="text"
|
|
21
23
|
{...styles.button}
|
|
22
|
-
{...
|
|
24
|
+
{...rest}
|
|
23
25
|
/>
|
|
24
26
|
)
|
|
25
27
|
})
|
|
@@ -2,27 +2,29 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { useStyleConfig, vui } from '../core'
|
|
4
4
|
import Icon, { IconProps } from '../icon'
|
|
5
|
+
import { cs } from '../utils'
|
|
5
6
|
import { notificationStatusMapping } from './consts'
|
|
6
|
-
import {
|
|
7
|
+
import { useNotificationContext } from './context'
|
|
7
8
|
|
|
8
9
|
/** Displays an icon based on the status within the Notification. */
|
|
9
10
|
export const NotificationIcon = vui<'svg', IconProps>((props, ref) => {
|
|
10
|
-
const
|
|
11
|
-
const
|
|
11
|
+
const { className, ...rest } = props
|
|
12
|
+
const mergedProps = { ...useNotificationContext(), ...props }
|
|
13
|
+
const styles = useStyleConfig('Notification', useNotificationContext())
|
|
12
14
|
|
|
13
15
|
const { status = '' } = mergedProps
|
|
14
16
|
const { iconProps } = notificationStatusMapping[status] ?? {}
|
|
15
17
|
|
|
16
18
|
return (
|
|
17
19
|
<Icon
|
|
18
|
-
className=
|
|
20
|
+
className={cs('vui-notificationIcon', className)}
|
|
19
21
|
mr={1}
|
|
20
22
|
my={0.5}
|
|
21
23
|
ref={ref}
|
|
22
24
|
size="md"
|
|
23
25
|
{...styles.icon}
|
|
24
26
|
{...iconProps}
|
|
25
|
-
{...
|
|
27
|
+
{...rest}
|
|
26
28
|
/>
|
|
27
29
|
)
|
|
28
30
|
})
|
|
@@ -2,22 +2,24 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { useStyleConfig, vui } from '../core'
|
|
4
4
|
import T, { TProps } from '../t'
|
|
5
|
-
import {
|
|
5
|
+
import { cs } from '../utils'
|
|
6
|
+
import { useNotificationContext } from './context'
|
|
6
7
|
|
|
7
8
|
/** Displays text within the Notification. */
|
|
8
9
|
export const NotificationText = vui<'p', TProps>((props, ref) => {
|
|
9
|
-
const
|
|
10
|
+
const { className, ...rest } = props
|
|
11
|
+
const styles = useStyleConfig('Notification', useNotificationContext())
|
|
10
12
|
|
|
11
13
|
return (
|
|
12
14
|
<T
|
|
13
|
-
className=
|
|
15
|
+
className={cs('vui-notificationText', className)}
|
|
14
16
|
flex="1"
|
|
15
17
|
lineHeight="24px"
|
|
16
18
|
minW={0}
|
|
17
19
|
py={0.5}
|
|
18
20
|
ref={ref}
|
|
19
21
|
{...styles.text}
|
|
20
|
-
{...
|
|
22
|
+
{...rest}
|
|
21
23
|
/>
|
|
22
24
|
)
|
|
23
25
|
})
|
|
@@ -2,13 +2,23 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { useStyleConfig, vui } from '../core'
|
|
4
4
|
import { H6, HeadingProps } from '../heading'
|
|
5
|
-
import {
|
|
5
|
+
import { cs } from '../utils'
|
|
6
|
+
import { useNotificationContext } from './context'
|
|
6
7
|
|
|
7
8
|
/** Displays a title within the Notification. */
|
|
8
9
|
export const NotificationTitle = vui<'h6', HeadingProps>((props, ref) => {
|
|
9
|
-
const
|
|
10
|
+
const { className, ...rest } = props
|
|
11
|
+
const styles = useStyleConfig('Notification', useNotificationContext())
|
|
10
12
|
|
|
11
|
-
return
|
|
13
|
+
return (
|
|
14
|
+
<H6
|
|
15
|
+
className={cs('vui-notificationTitle', className)}
|
|
16
|
+
display="inline-flex"
|
|
17
|
+
ref={ref}
|
|
18
|
+
{...styles.title}
|
|
19
|
+
{...rest}
|
|
20
|
+
/>
|
|
21
|
+
)
|
|
12
22
|
})
|
|
13
23
|
|
|
14
24
|
NotificationTitle.displayName = 'NotificationTitle'
|
|
@@ -1,20 +1,52 @@
|
|
|
1
1
|
import { PaginationItem } from './pagination.types'
|
|
2
2
|
|
|
3
|
+
const range = (start: number, end: number) => {
|
|
4
|
+
const length = end - start + 1
|
|
5
|
+
return Array.from({ length }, (_, i) => start + i)
|
|
6
|
+
}
|
|
7
|
+
|
|
3
8
|
/** Returns an array describing pagination items, like page buttons, prev/next arrows or ellipsis. */
|
|
4
9
|
export function getPaginationItems(page: number, pageCount: number) {
|
|
5
|
-
const
|
|
10
|
+
const boundaryCount = 1
|
|
11
|
+
const siblingCount = 1
|
|
12
|
+
|
|
13
|
+
const startPages = range(1, Math.min(boundaryCount, pageCount))
|
|
14
|
+
const endPages = range(Math.max(pageCount - boundaryCount + 1, boundaryCount + 1), pageCount)
|
|
15
|
+
|
|
16
|
+
const siblingsStart = Math.max(
|
|
17
|
+
Math.min(page - siblingCount, pageCount - boundaryCount - siblingCount * 2 - 1),
|
|
18
|
+
boundaryCount + 2
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
const siblingsEnd = Math.min(
|
|
22
|
+
Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2),
|
|
23
|
+
endPages.length > 0 ? endPages[0] - 2 : pageCount - 1
|
|
24
|
+
)
|
|
6
25
|
|
|
7
|
-
|
|
26
|
+
const items = [
|
|
27
|
+
'previous',
|
|
28
|
+
...startPages,
|
|
8
29
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
30
|
+
// Start ellipsis
|
|
31
|
+
...(siblingsStart > boundaryCount + 2
|
|
32
|
+
? ['ellipsisStart']
|
|
33
|
+
: boundaryCount + 1 < pageCount - boundaryCount
|
|
34
|
+
? [boundaryCount + 1]
|
|
35
|
+
: []),
|
|
12
36
|
|
|
13
|
-
|
|
37
|
+
// Sibling pages
|
|
38
|
+
...range(siblingsStart, siblingsEnd),
|
|
14
39
|
|
|
15
|
-
|
|
40
|
+
// End ellipsis
|
|
41
|
+
...(siblingsEnd < pageCount - boundaryCount - 1
|
|
42
|
+
? ['ellipsisEnd']
|
|
43
|
+
: pageCount - boundaryCount > boundaryCount
|
|
44
|
+
? [pageCount - boundaryCount]
|
|
45
|
+
: []),
|
|
16
46
|
|
|
17
|
-
|
|
47
|
+
...endPages,
|
|
48
|
+
'next'
|
|
49
|
+
] as PaginationItem[]
|
|
18
50
|
|
|
19
51
|
return items
|
|
20
52
|
}
|
|
@@ -2,12 +2,13 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import Button from '../button'
|
|
4
4
|
import { useStyleConfig, vui } from '../core'
|
|
5
|
+
import { cs } from '../utils'
|
|
5
6
|
import { usePaginationContext } from './context'
|
|
6
7
|
import { PaginationButtonProps } from './pagination.types'
|
|
7
8
|
|
|
8
9
|
/** Displays a page navigation button within the Pagination. */
|
|
9
10
|
export const PaginationButton = vui<'button', PaginationButtonProps>((props, ref) => {
|
|
10
|
-
const { isActive: isActiveProp, page: pageProp, ...rest } = props
|
|
11
|
+
const { className, isActive: isActiveProp, page: pageProp, ...rest } = props
|
|
11
12
|
const { onPageChange, page } = usePaginationContext()
|
|
12
13
|
const styles = useStyleConfig('Pagination', usePaginationContext())
|
|
13
14
|
|
|
@@ -23,7 +24,7 @@ export const PaginationButton = vui<'button', PaginationButtonProps>((props, ref
|
|
|
23
24
|
|
|
24
25
|
return (
|
|
25
26
|
<Button
|
|
26
|
-
className=
|
|
27
|
+
className={cs('vui-paginationButton', className)}
|
|
27
28
|
minW={0}
|
|
28
29
|
onClick={() => onPageChange(pageProp)}
|
|
29
30
|
ref={ref}
|
|
@@ -2,15 +2,23 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import Box, { BoxProps } from '../box'
|
|
4
4
|
import { useStyleConfig, vui } from '../core'
|
|
5
|
+
import { cs } from '../utils'
|
|
5
6
|
import { usePaginationContext } from './context'
|
|
6
7
|
|
|
7
8
|
/** Displays '...' ellipsis for hidden pages. */
|
|
8
9
|
export const PaginationEllipsis = vui<'span', BoxProps>((props, ref) => {
|
|
9
|
-
const { children, ...rest } = props
|
|
10
|
+
const { children, className, ...rest } = props
|
|
10
11
|
const styles = useStyleConfig('Pagination', usePaginationContext())
|
|
11
12
|
|
|
12
13
|
return (
|
|
13
|
-
<Box
|
|
14
|
+
<Box
|
|
15
|
+
alignItems="center"
|
|
16
|
+
className={cs('vui-paginationEllipsis', className)}
|
|
17
|
+
px="10px"
|
|
18
|
+
ref={ref}
|
|
19
|
+
{...styles.ellipsis}
|
|
20
|
+
{...rest}
|
|
21
|
+
>
|
|
14
22
|
{children ?? '...'}
|
|
15
23
|
</Box>
|
|
16
24
|
)
|
|
@@ -4,11 +4,12 @@ import Box, { BoxProps } from '../box'
|
|
|
4
4
|
import { useStyleConfig, vui } from '../core'
|
|
5
5
|
import Input from '../input'
|
|
6
6
|
import T from '../t'
|
|
7
|
-
import { ChangeEvent } from '../utils'
|
|
7
|
+
import { ChangeEvent, cs } from '../utils'
|
|
8
8
|
import { usePaginationContext } from './context'
|
|
9
9
|
|
|
10
10
|
/** Displays a number input, which allows quickly jumping between pages. */
|
|
11
11
|
export const PaginationGoToPage = vui<'div', BoxProps>((props, ref) => {
|
|
12
|
+
const { className, ...rest } = props
|
|
12
13
|
const { onPageChange, pageCount } = usePaginationContext()
|
|
13
14
|
const styles = useStyleConfig('Pagination', usePaginationContext())
|
|
14
15
|
|
|
@@ -20,7 +21,14 @@ export const PaginationGoToPage = vui<'div', BoxProps>((props, ref) => {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
return (
|
|
23
|
-
<Box
|
|
24
|
+
<Box
|
|
25
|
+
centerV
|
|
26
|
+
className={cs('vui-paginationGoToPage', className)}
|
|
27
|
+
lineHeight="normal"
|
|
28
|
+
ref={ref}
|
|
29
|
+
{...styles.goToPage}
|
|
30
|
+
{...rest}
|
|
31
|
+
>
|
|
24
32
|
<T size="sm" weight="medium">
|
|
25
33
|
Go to
|
|
26
34
|
</T>
|
|
@@ -2,7 +2,7 @@ import React, { Fragment } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import Box, { BoxProps } from '../box'
|
|
4
4
|
import { useStyleConfig, vui } from '../core'
|
|
5
|
-
import { isNumber, isString } from '../utils'
|
|
5
|
+
import { cs, isNumber, isString } from '../utils'
|
|
6
6
|
import { usePaginationContext } from './context'
|
|
7
7
|
import PaginationButton from './paginationButton'
|
|
8
8
|
import PaginationEllipsis from './paginationEllipsis'
|
|
@@ -10,12 +10,12 @@ import PaginationPrevNext from './paginationPrevNext'
|
|
|
10
10
|
|
|
11
11
|
/** Displays a set of page navigation buttons. */
|
|
12
12
|
export const PaginationNavigation = vui<'div', BoxProps>((props, ref) => {
|
|
13
|
-
const { children, ...rest } = props
|
|
13
|
+
const { children, className, ...rest } = props
|
|
14
14
|
const { items } = usePaginationContext()
|
|
15
15
|
const styles = useStyleConfig('Pagination', usePaginationContext())
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
|
-
<Box className=
|
|
18
|
+
<Box className={cs('vui-paginationNavigation', className)} gap={1} ref={ref} wrap {...styles.navigation} {...rest}>
|
|
19
19
|
{children ??
|
|
20
20
|
items.map(item => (
|
|
21
21
|
<Fragment key={item}>
|
|
@@ -2,12 +2,13 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import Button from '../button'
|
|
4
4
|
import { useStyleConfig, vui } from '../core'
|
|
5
|
+
import { cs } from '../utils'
|
|
5
6
|
import { usePaginationContext } from './context'
|
|
6
7
|
import { PaginationPrevNextProps } from './pagination.types'
|
|
7
8
|
|
|
8
9
|
/** Displays a page navigation button, which navigates forward or backward. */
|
|
9
10
|
export const PaginationPrevNext = vui<'button', PaginationPrevNextProps>((props, ref) => {
|
|
10
|
-
const { direction, ...rest } = props
|
|
11
|
+
const { className, direction, ...rest } = props
|
|
11
12
|
const { onPageChange, page, pageCount } = usePaginationContext()
|
|
12
13
|
const styles = useStyleConfig('Pagination', usePaginationContext())
|
|
13
14
|
|
|
@@ -21,7 +22,7 @@ export const PaginationPrevNext = vui<'button', PaginationPrevNextProps>((props,
|
|
|
21
22
|
|
|
22
23
|
return (
|
|
23
24
|
<Button
|
|
24
|
-
className=
|
|
25
|
+
className={cs('vui-paginationPrevNext', className)}
|
|
25
26
|
minW={0}
|
|
26
27
|
ref={ref}
|
|
27
28
|
size="sm"
|
|
@@ -2,17 +2,18 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { useStyleConfig, vui } from '../core'
|
|
4
4
|
import T, { TProps } from '../t'
|
|
5
|
+
import { cs } from '../utils'
|
|
5
6
|
import { usePaginationContext } from './context'
|
|
6
7
|
|
|
7
8
|
/** Displays an action button within the Pagination. */
|
|
8
9
|
export const PaginationResults = vui<'span', TProps>((props, ref) => {
|
|
9
|
-
const { children, ...rest } = props
|
|
10
|
+
const { children, className, ...rest } = props
|
|
10
11
|
const { count, rangeEnd, rangeStart } = usePaginationContext()
|
|
11
12
|
const styles = useStyleConfig('Pagination', usePaginationContext())
|
|
12
13
|
|
|
13
14
|
return (
|
|
14
15
|
<T
|
|
15
|
-
className=
|
|
16
|
+
className={cs('vui-paginationResults', className)}
|
|
16
17
|
color="grey.80"
|
|
17
18
|
ref={ref}
|
|
18
19
|
size="sm"
|
|
@@ -2,15 +2,15 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import Box from '../box'
|
|
4
4
|
import { useStyleConfig, vui } from '../core'
|
|
5
|
-
import { mergeRefs } from '../utils'
|
|
5
|
+
import { cs, mergeRefs } from '../utils'
|
|
6
6
|
import { usePopoverContext } from './context'
|
|
7
7
|
import { PopoverContentProps } from './popover.types'
|
|
8
8
|
|
|
9
9
|
/** Displays provided content in an overlaying wrapper. */
|
|
10
10
|
export const PopoverContent = vui<'div', PopoverContentProps>((props, ref) => {
|
|
11
|
+
const { children, className, ...rest } = props
|
|
11
12
|
const popoverProps = usePopoverContext() ?? {}
|
|
12
13
|
const { isLazy, isOpen, setPopper } = popoverProps
|
|
13
|
-
const { children, ...rest } = props
|
|
14
14
|
const styles = useStyleConfig('Popover', { ...popoverProps, ...props })
|
|
15
15
|
|
|
16
16
|
const shouldRenderChildren = isLazy ? isOpen : true
|
|
@@ -22,7 +22,7 @@ export const PopoverContent = vui<'div', PopoverContentProps>((props, ref) => {
|
|
|
22
22
|
bg="white"
|
|
23
23
|
borderRadius="md"
|
|
24
24
|
boxShadow="2"
|
|
25
|
-
className=
|
|
25
|
+
className={cs('vui-popoverContent', className)}
|
|
26
26
|
overflowY="auto"
|
|
27
27
|
ref={mergeRefs(setPopper, ref)}
|
|
28
28
|
{...styles.content}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import React from 'react'
|
|
4
4
|
|
|
5
5
|
import { useStyleConfig, v, vui } from '../core'
|
|
6
|
-
import { mergeRefs, MouseEvent } from '../utils'
|
|
6
|
+
import { cs, mergeRefs, MouseEvent } from '../utils'
|
|
7
7
|
import { usePopoverContext } from './context'
|
|
8
8
|
import { PopoverTriggerProps } from './popover.types'
|
|
9
9
|
|
|
@@ -12,11 +12,11 @@ import { PopoverTriggerProps } from './popover.types'
|
|
|
12
12
|
* Can be rendered as any component using the 'as' prop. By default renders as a plain button.
|
|
13
13
|
*/
|
|
14
14
|
export const PopoverTrigger = vui<'button', PopoverTriggerProps>((props, ref) => {
|
|
15
|
+
// @ts-ignore - TS incorrectly doesn't recognize 'as' prop
|
|
16
|
+
const { as: As, className, onClick: onClickProp, ...rest } = props
|
|
15
17
|
const { setReference, ...popoverProps } = usePopoverContext() ?? {}
|
|
16
18
|
const styles = useStyleConfig('Popover', { ...popoverProps, ...props })
|
|
17
19
|
|
|
18
|
-
// @ts-ignore - TS incorrectly doesn't recognize 'as' prop
|
|
19
|
-
const { as: As, onClick: onClickProp, ...rest } = props
|
|
20
20
|
const Element = As || v.button
|
|
21
21
|
|
|
22
22
|
const onClick = (e: MouseEvent<HTMLButtonElement>) => {
|
|
@@ -27,7 +27,7 @@ export const PopoverTrigger = vui<'button', PopoverTriggerProps>((props, ref) =>
|
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
29
|
<Element
|
|
30
|
-
className=
|
|
30
|
+
className={cs('vui-popoverTrigger', className)}
|
|
31
31
|
onClick={onClick}
|
|
32
32
|
ref={mergeRefs(setReference, ref)}
|
|
33
33
|
{...styles.trigger}
|
package/src/radio/context.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, Dict } from '../utils'
|
|
2
2
|
|
|
3
|
-
const [RadioGroupProvider,
|
|
3
|
+
const [RadioGroupProvider, useRadioGroupContext] = createContext<Dict>({ isOptional: true })
|
|
4
4
|
|
|
5
|
-
export { RadioGroupProvider,
|
|
5
|
+
export { RadioGroupProvider, useRadioGroupContext }
|
package/src/radio/radio.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { omitThemingProps, styled, th, useStyleConfig, vui } from '../core'
|
|
|
4
4
|
import Icon from '../icon'
|
|
5
5
|
import T from '../t'
|
|
6
6
|
import { ChangeEvent, cs, filterUndefined } from '../utils'
|
|
7
|
-
import {
|
|
7
|
+
import { useRadioGroupContext } from './context'
|
|
8
8
|
import { RadioProps, RadioStyleProps } from './radio.types'
|
|
9
9
|
|
|
10
10
|
const RadioControl = styled.spanBox`
|
|
@@ -59,7 +59,7 @@ export const Radio = vui<'span', RadioProps>((props, ref) => {
|
|
|
59
59
|
onChange: groupOnChange,
|
|
60
60
|
value: groupValue,
|
|
61
61
|
...radioGroupProps
|
|
62
|
-
} =
|
|
62
|
+
} = useRadioGroupContext() ?? {}
|
|
63
63
|
const defaultIsChecked = groupIsChecked !== undefined ? groupIsChecked === props.value : undefined
|
|
64
64
|
|
|
65
65
|
const mergedProps = { ...radioGroupProps, ...props }
|
package/src/spinner/consts.ts
CHANGED
|
@@ -2,20 +2,16 @@ import { Dict } from '../utils'
|
|
|
2
2
|
|
|
3
3
|
export const spinnerPositionMapping = {
|
|
4
4
|
bottom: {
|
|
5
|
-
container: { flexDirection: 'column' }
|
|
6
|
-
circle: { mb: 1 }
|
|
5
|
+
container: { flexDirection: 'column' }
|
|
7
6
|
},
|
|
8
7
|
left: {
|
|
9
|
-
container: { flexDirection: 'row-reverse' }
|
|
10
|
-
circle: { ml: 1 }
|
|
8
|
+
container: { flexDirection: 'row-reverse' }
|
|
11
9
|
},
|
|
12
10
|
right: {
|
|
13
|
-
container: { flexDirection: 'row' }
|
|
14
|
-
circle: { mr: 1 }
|
|
11
|
+
container: { flexDirection: 'row' }
|
|
15
12
|
},
|
|
16
13
|
top: {
|
|
17
|
-
container: { flexDirection: 'column-reverse' }
|
|
18
|
-
circle: { mt: 1 }
|
|
14
|
+
container: { flexDirection: 'column-reverse' }
|
|
19
15
|
}
|
|
20
16
|
}
|
|
21
17
|
|
package/src/spinner/spinner.tsx
CHANGED
|
@@ -45,6 +45,7 @@ export const Spinner = vui<'div', SpinnerProps>((props, ref) => {
|
|
|
45
45
|
<Box
|
|
46
46
|
center
|
|
47
47
|
className={cs('vui-spinner', className)}
|
|
48
|
+
gap={1}
|
|
48
49
|
ref={ref}
|
|
49
50
|
transitionDuration="fast"
|
|
50
51
|
{...styles.container}
|
|
@@ -55,7 +56,6 @@ export const Spinner = vui<'div', SpinnerProps>((props, ref) => {
|
|
|
55
56
|
animation={`vui-spin ${speed} linear infinite`}
|
|
56
57
|
className="vui-spinnerCircle"
|
|
57
58
|
{...styles.circle}
|
|
58
|
-
{...positionProps.circle}
|
|
59
59
|
{...circleProps}
|
|
60
60
|
/>
|
|
61
61
|
|
package/src/switch/context.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext } from '../utils'
|
|
2
2
|
import { SwitchContext } from './switch.types'
|
|
3
3
|
|
|
4
|
-
const [SwitchProvider,
|
|
4
|
+
const [SwitchProvider, useSwitchContext] = createContext<SwitchContext>({ isOptional: true })
|
|
5
5
|
|
|
6
|
-
export { SwitchProvider,
|
|
6
|
+
export { SwitchProvider, useSwitchContext }
|
|
@@ -2,7 +2,7 @@ import React, { useEffect, useRef, useState } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { omitThemingProps, styled, useStyleConfig, vui } from '../core'
|
|
4
4
|
import { ChangeEvent, cs, filterUndefined, FocusEvent } from '../utils'
|
|
5
|
-
import {
|
|
5
|
+
import { useSwitchContext } from './context'
|
|
6
6
|
import { SwitchButtonProps } from './switch.types'
|
|
7
7
|
|
|
8
8
|
const SwitchInput = styled.inputBox`
|
|
@@ -64,7 +64,7 @@ export const SwitchButtonBase = styled.spanBox`
|
|
|
64
64
|
* Handles controlled and uncontrolled modes.
|
|
65
65
|
*/
|
|
66
66
|
export const SwitchButton = vui<'span', SwitchButtonProps>((props, ref) => {
|
|
67
|
-
const mergedProps = { ...
|
|
67
|
+
const mergedProps = { ...useSwitchContext(), ...props }
|
|
68
68
|
const {
|
|
69
69
|
checked,
|
|
70
70
|
className,
|
|
@@ -86,7 +86,7 @@ export const SwitchButton = vui<'span', SwitchButtonProps>((props, ref) => {
|
|
|
86
86
|
const { current: isControlled } = useRef(checked !== undefined)
|
|
87
87
|
const [isChecked, setIsChecked] = useState(checked ?? defaultChecked)
|
|
88
88
|
const [isFocused, setIsFocused] = useState(false)
|
|
89
|
-
const styles = useStyleConfig('Switch',
|
|
89
|
+
const styles = useStyleConfig('Switch', useSwitchContext())
|
|
90
90
|
const { thumb: thumbStyles, track: trackStyles, ...buttonStyles } = styles.button
|
|
91
91
|
|
|
92
92
|
useEffect(() => {
|
|
@@ -2,13 +2,15 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { useStyleConfig, vui } from '../core'
|
|
4
4
|
import T, { TProps } from '../t'
|
|
5
|
-
import {
|
|
5
|
+
import { cs } from '../utils'
|
|
6
|
+
import { useSwitchContext } from './context'
|
|
6
7
|
|
|
7
8
|
/** Displays label text within the Switch component. */
|
|
8
9
|
export const SwitchLabel = vui<'span', TProps>((props, ref) => {
|
|
9
|
-
const
|
|
10
|
+
const { className, ...rest } = props
|
|
11
|
+
const styles = useStyleConfig('Switch', useSwitchContext())
|
|
10
12
|
|
|
11
|
-
return <T className=
|
|
13
|
+
return <T className={cs('vui-switchLabel', className)} display="flex" ref={ref} {...styles.label} {...rest} />
|
|
12
14
|
})
|
|
13
15
|
|
|
14
16
|
SwitchLabel.displayName = 'SwitchLabel'
|
package/src/tag/context.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, Dict } from '../utils'
|
|
2
2
|
|
|
3
|
-
const [TagProvider,
|
|
3
|
+
const [TagProvider, useTagContext] = createContext<Dict>({ isOptional: true })
|
|
4
4
|
|
|
5
|
-
export { TagProvider,
|
|
5
|
+
export { TagProvider, useTagContext }
|
package/src/tag/tagButton.tsx
CHANGED
|
@@ -2,17 +2,19 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import Button, { ButtonProps } from '../button'
|
|
4
4
|
import { useStyleConfig, vui } from '../core'
|
|
5
|
-
import {
|
|
5
|
+
import { cs } from '../utils'
|
|
6
|
+
import { useTagContext } from './context'
|
|
6
7
|
|
|
7
8
|
/** Displays a button within the Tag. */
|
|
8
9
|
export const TagButton = vui<'button', ButtonProps>((props, ref) => {
|
|
9
|
-
const
|
|
10
|
-
const
|
|
10
|
+
const { className, ...rest } = props
|
|
11
|
+
const mergedProps = { ...useTagContext(), ...props }
|
|
12
|
+
const styles = useStyleConfig('Tag', useTagContext())
|
|
11
13
|
|
|
12
14
|
return (
|
|
13
15
|
<Button
|
|
14
16
|
borderColor="transparent"
|
|
15
|
-
className=
|
|
17
|
+
className={cs('vui-tagButton', className)}
|
|
16
18
|
colorScheme={mergedProps.colorScheme}
|
|
17
19
|
disabled={mergedProps.disabled}
|
|
18
20
|
hoverBorderColor="transparent"
|
|
@@ -21,7 +23,7 @@ export const TagButton = vui<'button', ButtonProps>((props, ref) => {
|
|
|
21
23
|
ref={ref}
|
|
22
24
|
variant="text"
|
|
23
25
|
{...styles.button}
|
|
24
|
-
{...
|
|
26
|
+
{...rest}
|
|
25
27
|
/>
|
|
26
28
|
)
|
|
27
29
|
})
|
package/src/tag/tagIcon.tsx
CHANGED
|
@@ -2,13 +2,15 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { useStyleConfig, vui } from '../core'
|
|
4
4
|
import Icon, { IconProps } from '../icon'
|
|
5
|
-
import {
|
|
5
|
+
import { cs } from '../utils'
|
|
6
|
+
import { useTagContext } from './context'
|
|
6
7
|
|
|
7
8
|
/** Displays an icon within the Tag. */
|
|
8
9
|
export const TagIcon = vui<'svg', IconProps>((props, ref) => {
|
|
9
|
-
const
|
|
10
|
+
const { className, ...rest } = props
|
|
11
|
+
const styles = useStyleConfig('Tag', useTagContext())
|
|
10
12
|
|
|
11
|
-
return <Icon className=
|
|
13
|
+
return <Icon className={cs('vui-tagIcon', className)} ref={ref} {...styles.icon} {...rest} />
|
|
12
14
|
})
|
|
13
15
|
|
|
14
16
|
TagIcon.displayName = 'TagIcon'
|
package/src/tag/tagText.tsx
CHANGED
|
@@ -2,13 +2,15 @@ import React from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { useStyleConfig, vui } from '../core'
|
|
4
4
|
import T, { TProps } from '../t'
|
|
5
|
-
import {
|
|
5
|
+
import { cs } from '../utils'
|
|
6
|
+
import { useTagContext } from './context'
|
|
6
7
|
|
|
7
8
|
/** Displays text within the Tag. */
|
|
8
9
|
export const TagText = vui<'span', TProps>((props, ref) => {
|
|
9
|
-
const
|
|
10
|
+
const { className, ...rest } = props
|
|
11
|
+
const styles = useStyleConfig('Tag', useTagContext())
|
|
10
12
|
|
|
11
|
-
return <T className=
|
|
13
|
+
return <T className={cs('vui-tagText', className)} fontSize="inherit" ref={ref} {...styles.text} {...rest} />
|
|
12
14
|
})
|
|
13
15
|
|
|
14
16
|
TagText.displayName = 'TagText'
|
|
@@ -116,7 +116,7 @@ export const Textarea = vui<'div', TextareaProps>((props, ref) => {
|
|
|
116
116
|
/>
|
|
117
117
|
|
|
118
118
|
{showCount && (
|
|
119
|
-
<T color="grey.80" position="absolute" right={0} size="sm" top="calc(100% + 1px)">
|
|
119
|
+
<T className="vui-textareaCount" color="grey.80" position="absolute" right={0} size="sm" top="calc(100% + 1px)">
|
|
120
120
|
{count} / {maxLength}
|
|
121
121
|
</T>
|
|
122
122
|
)}
|
package/src/utils/react.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
2
|
|
|
3
|
-
import React, {
|
|
3
|
+
import React, {
|
|
4
|
+
DependencyList,
|
|
5
|
+
Dispatch,
|
|
6
|
+
RefObject,
|
|
7
|
+
SetStateAction,
|
|
8
|
+
useCallback,
|
|
9
|
+
useEffect,
|
|
10
|
+
useRef,
|
|
11
|
+
useState
|
|
12
|
+
} from 'react'
|
|
4
13
|
|
|
5
14
|
import { isArray, isFunction } from './assertion'
|
|
6
15
|
import { runIfFn } from './function'
|
|
@@ -60,12 +69,12 @@ export function mergeRefs<T>(...refs: (ReactRef<T> | undefined)[]) {
|
|
|
60
69
|
|
|
61
70
|
// TODO: Bring it from UI-Utils
|
|
62
71
|
/** Returns given callback with a stable reference, but keeps it updated internally. */
|
|
63
|
-
export function useCallbackRef<T extends AnyFunction>(callback?: T) {
|
|
72
|
+
export function useCallbackRef<T extends AnyFunction>(callback?: T, deps: DependencyList = []) {
|
|
64
73
|
const ref = useRef(callback)
|
|
65
74
|
|
|
66
75
|
ref.current = callback
|
|
67
76
|
|
|
68
|
-
return useCallback(((...args) => ref.current?.(...args)) as T,
|
|
77
|
+
return useCallback(((...args) => ref.current?.(...args)) as T, deps)
|
|
69
78
|
}
|
|
70
79
|
|
|
71
80
|
const defaultEvents = ['mousedown', 'touchstart']
|