@nuskin/foundation-ui-components 1.33.0-1253-feature.3 → 2.0.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/dist/index.d.mts +1221 -0
- package/dist/index.d.ts +1221 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +33 -10
- package/src/common/accordion/NsAccordion.tsx +0 -82
- package/src/common/accordion/NsAccordionHeader.tsx +0 -85
- package/src/common/accordion/NsAccordionItem.tsx +0 -65
- package/src/common/accordion/NsCollapse.tsx +0 -121
- package/src/common/accordion/NsToggleSection.tsx +0 -50
- package/src/common/accordion/ToggleSection.styled.tsx +0 -32
- package/src/common/accordion/colorMap.ts +0 -60
- package/src/common/accordion/enums.ts +0 -18
- package/src/common/accordion/index.ts +0 -7
- package/src/common/accordion/specs/NsAccordion.spec.tsx +0 -183
- package/src/common/accordion/specs/NsAccordionHeader.spec.tsx +0 -172
- package/src/common/accordion/specs/NsAccordionItem.spec.tsx +0 -79
- package/src/common/accordion/specs/NsCollapse.spec.tsx +0 -130
- package/src/common/accordion/specs/NsToggleSection.spec.tsx +0 -74
- package/src/common/accordion/stories/NsAccordion.stories.tsx +0 -65
- package/src/common/accordion/stories/NsAccordionHeader.stories.tsx +0 -44
- package/src/common/accordion/stories/NsAccordionItem.stories.tsx +0 -48
- package/src/common/accordion/stories/NsCollapse.stories.tsx +0 -53
- package/src/common/accordion/stories/NsToggleSection.stories.tsx +0 -27
- package/src/common/accordion/stories/data.tsx +0 -145
- package/src/common/accordion/types.d.ts +0 -90
- package/src/common/alert/Header.tsx +0 -29
- package/src/common/alert/NsAlert.spec.tsx +0 -167
- package/src/common/alert/NsAlert.stories.tsx +0 -45
- package/src/common/alert/NsAlert.styled.tsx +0 -114
- package/src/common/alert/NsAlert.tsx +0 -93
- package/src/common/alert/index.ts +0 -2
- package/src/common/alert/types.d.ts +0 -45
- package/src/common/auth-dropdown/NsAuthDropdown.spec.tsx +0 -54
- package/src/common/auth-dropdown/NsAuthDropdown.stories.tsx +0 -25
- package/src/common/auth-dropdown/NsAuthDropdown.styled.ts +0 -120
- package/src/common/auth-dropdown/NsAuthDropdown.tsx +0 -72
- package/src/common/auth-dropdown/index.ts +0 -2
- package/src/common/auth-dropdown/types.d.ts +0 -11
- package/src/common/autocomplete/NsAutocomplete.spec.tsx +0 -91
- package/src/common/autocomplete/NsAutocomplete.styled.tsx +0 -24
- package/src/common/autocomplete/NsAutocomplete.tsx +0 -225
- package/src/common/autocomplete/helper/LineLoader.tsx +0 -38
- package/src/common/autocomplete/helper/RecentClearAll.tsx +0 -43
- package/src/common/autocomplete/helper/SeeMoreButton.tsx +0 -68
- package/src/common/autocomplete/helper/index.ts +0 -4
- package/src/common/autocomplete/helper/renderGroupName.tsx +0 -26
- package/src/common/autocomplete/index.ts +0 -2
- package/src/common/autocomplete/mock/Mock.styled.tsx +0 -23
- package/src/common/autocomplete/mock/MockData.ts +0 -89
- package/src/common/autocomplete/mock/MockUI.tsx +0 -26
- package/src/common/autocomplete/stories/NoCloseAutoComplete.tsx +0 -49
- package/src/common/autocomplete/stories/NsAutocomplete.stories.tsx +0 -78
- package/src/common/autocomplete/stories/RenderAutoComplete.tsx +0 -60
- package/src/common/autocomplete/types.d.ts +0 -67
- package/src/common/banner/NsBanner.spec.tsx +0 -28
- package/src/common/banner/NsBanner.stories.tsx +0 -47
- package/src/common/banner/NsBanner.styled.tsx +0 -24
- package/src/common/banner/NsBanner.tsx +0 -32
- package/src/common/banner/index.ts +0 -2
- package/src/common/banner/types.d.ts +0 -14
- package/src/common/brand-components/NsBrand.stories.tsx +0 -26
- package/src/common/brand-components/NsBrandComponent.spec.tsx +0 -47
- package/src/common/brand-components/NsBrandComponent.tsx +0 -33
- package/src/common/brand-components/NsBrandContainer.styled.tsx +0 -10
- package/src/common/brand-components/icons/Logo.spec.tsx +0 -84
- package/src/common/brand-components/icons/NSLogoHorizontal.tsx +0 -70
- package/src/common/brand-components/icons/NSLogoMark.tsx +0 -39
- package/src/common/brand-components/icons/NSLogoPoweredBy.tsx +0 -103
- package/src/common/brand-components/icons/NSLogoStacked.tsx +0 -57
- package/src/common/brand-components/icons/NSWordMark.tsx +0 -60
- package/src/common/brand-components/index.ts +0 -2
- package/src/common/brand-components/types.d.ts +0 -11
- package/src/common/breadcrumb/NsBreadcrumb.spec.tsx +0 -28
- package/src/common/breadcrumb/NsBreadcrumb.stories.tsx +0 -39
- package/src/common/breadcrumb/NsBreadcrumb.styled.tsx +0 -36
- package/src/common/breadcrumb/NsBreadcrumb.tsx +0 -85
- package/src/common/breadcrumb/data.ts +0 -10
- package/src/common/breadcrumb/index.ts +0 -2
- package/src/common/breadcrumb/types.d.ts +0 -14
- package/src/common/button/NsButton.spec.tsx +0 -94
- package/src/common/button/NsButton.stories.tsx +0 -118
- package/src/common/button/NsButton.styled.tsx +0 -57
- package/src/common/button/NsButton.tsx +0 -48
- package/src/common/button/__snapshots__/NsButton.spec.tsx.snap +0 -120
- package/src/common/button/helper.ts +0 -84
- package/src/common/button/index.ts +0 -2
- package/src/common/button/types.d.ts +0 -26
- package/src/common/card/CardButton.tsx +0 -58
- package/src/common/card/NsAwardCard.tsx +0 -71
- package/src/common/card/NsBgCard.tsx +0 -26
- package/src/common/card/NsBrandCard.tsx +0 -88
- package/src/common/card/NsBrandLogo.tsx +0 -16
- package/src/common/card/NsBrandWrapper.tsx +0 -25
- package/src/common/card/NsCheckoutCard.tsx +0 -107
- package/src/common/card/NsHeroCardLevel1.tsx +0 -105
- package/src/common/card/NsHeroCardLevel2.tsx +0 -95
- package/src/common/card/NsIconText.tsx +0 -165
- package/src/common/card/NsLargeCard.tsx +0 -108
- package/src/common/card/NsMediumCard.tsx +0 -110
- package/src/common/card/NsPost.tsx +0 -78
- package/src/common/card/NsSmallFullCard.tsx +0 -93
- package/src/common/card/NsXLargeCard.tsx +0 -89
- package/src/common/card/cardSizes.ts +0 -12
- package/src/common/card/fixtures/ImageData1.ts +0 -38
- package/src/common/card/fixtures/ImageData2.ts +0 -38
- package/src/common/card/index.ts +0 -15
- package/src/common/card/specs/BrandLogo.spec.tsx +0 -13
- package/src/common/card/specs/NsAwardCard.spec.tsx +0 -29
- package/src/common/card/specs/NsBgCard.spec.tsx +0 -23
- package/src/common/card/specs/NsBrandCard.spec.tsx +0 -84
- package/src/common/card/specs/NsCheckoutCard.spec.tsx +0 -39
- package/src/common/card/specs/NsHeroCardLevel1.spec.tsx +0 -39
- package/src/common/card/specs/NsHeroCardLevel2.spec.tsx +0 -49
- package/src/common/card/specs/NsIconText.spec.tsx +0 -25
- package/src/common/card/specs/NsLargeCard.spec.tsx +0 -47
- package/src/common/card/specs/NsMediumCard.spec.tsx +0 -51
- package/src/common/card/specs/NsPost.spec.tsx +0 -28
- package/src/common/card/specs/NsSmallFullCard.spec.tsx +0 -47
- package/src/common/card/specs/NsXLargeCard.spec.tsx +0 -47
- package/src/common/card/stories/NsAwardCard.stories.tsx +0 -21
- package/src/common/card/stories/NsBrandCard.stories.tsx +0 -32
- package/src/common/card/stories/NsCheckoutCard.stories.tsx +0 -23
- package/src/common/card/stories/NsHeroCardLevel1.stories.tsx +0 -30
- package/src/common/card/stories/NsHeroCardLevel2.stories.tsx +0 -29
- package/src/common/card/stories/NsIconText.stories.tsx +0 -18
- package/src/common/card/stories/NsLargeCard.stories.tsx +0 -32
- package/src/common/card/stories/NsMediumCard.stories.tsx +0 -34
- package/src/common/card/stories/NsPost.stories.tsx +0 -20
- package/src/common/card/stories/NsSmallFullCard.stories.tsx +0 -31
- package/src/common/card/stories/NsXLargeCard.stories.tsx +0 -32
- package/src/common/card/stories/data.ts +0 -43
- package/src/common/card/types.d.ts +0 -25
- package/src/common/carousal/CarousalControl.tsx +0 -47
- package/src/common/carousal/IconWrapper.tsx +0 -33
- package/src/common/carousal/NsCarousal.tsx +0 -65
- package/src/common/carousal/NsScrollingCarousal.tsx +0 -60
- package/src/common/carousal/RenderBrand.tsx +0 -20
- package/src/common/carousal/index.ts +0 -5
- package/src/common/carousal/slickSetting.ts +0 -61
- package/src/common/carousal/specs/Chevron.spec.tsx +0 -10
- package/src/common/carousal/specs/NsCarousal.spec.tsx +0 -112
- package/src/common/carousal/specs/NsScrollingCarousal.spec.tsx +0 -63
- package/src/common/carousal/specs/RenderBrand.spec.tsx +0 -22
- package/src/common/carousal/stories/NsCarousal1.stories.tsx +0 -34
- package/src/common/carousal/stories/NsScrollingCarousal.stories.tsx +0 -80
- package/src/common/carousal/types.d.ts +0 -23
- package/src/common/cart-icon/NsCartIcon.spec.tsx +0 -19
- package/src/common/cart-icon/NsCartIcon.stories.tsx +0 -28
- package/src/common/cart-icon/NsCartIcon.styled.tsx +0 -15
- package/src/common/cart-icon/NsCartIcon.tsx +0 -24
- package/src/common/cart-icon/index.ts +0 -2
- package/src/common/cart-icon/types.d.ts +0 -8
- package/src/common/checkbox/NsCheckbox.spec.tsx +0 -57
- package/src/common/checkbox/NsCheckbox.stories.tsx +0 -55
- package/src/common/checkbox/NsCheckbox.styled.tsx +0 -55
- package/src/common/checkbox/NsCheckbox.tsx +0 -68
- package/src/common/checkbox/index.ts +0 -2
- package/src/common/checkbox/types.d.ts +0 -20
- package/src/common/column-control/NsColumnControl.tsx +0 -64
- package/src/common/column-control/NsFlexColumns.tsx +0 -29
- package/src/common/column-control/NsGridColumns.tsx +0 -29
- package/src/common/column-control/index.ts +0 -4
- package/src/common/column-control/specs/NsColumnControl.spec.tsx +0 -24
- package/src/common/column-control/specs/NsFlexColumns.spec.tsx +0 -24
- package/src/common/column-control/specs/NsGridColumns.spec.tsx +0 -24
- package/src/common/column-control/stories/DivArray.stories.tsx +0 -18
- package/src/common/column-control/stories/DivArray.tsx +0 -63
- package/src/common/column-control/stories/NsColumnControl.stories.tsx +0 -65
- package/src/common/column-control/stories/NsFlexColumns.stories.tsx +0 -66
- package/src/common/column-control/stories/NsGridColumns.stories.tsx +0 -75
- package/src/common/column-control/stories/common.tsx +0 -14
- package/src/common/column-control/styled/StyledFlex.tsx +0 -46
- package/src/common/column-control/styled/StyledGrid.tsx +0 -41
- package/src/common/column-control/styled/common.ts +0 -27
- package/src/common/column-control/types.d.ts +0 -46
- package/src/common/column-control/utils.ts +0 -66
- package/src/common/common.types.d.ts +0 -21
- package/src/common/dropdown/NsDropdown.spec.tsx +0 -126
- package/src/common/dropdown/NsDropdown.styled.tsx +0 -66
- package/src/common/dropdown/NsDropdown.tsx +0 -94
- package/src/common/dropdown/NsDropdownOption.tsx +0 -13
- package/src/common/dropdown/index.ts +0 -3
- package/src/common/dropdown/stories/NsDropdown.stories.tsx +0 -67
- package/src/common/dropdown/stories/NsDropdownCountry.stories.tsx +0 -64
- package/src/common/dropdown/types.d.ts +0 -23
- package/src/common/email-simple/NsEmailSimple.spec.tsx +0 -115
- package/src/common/email-simple/NsEmailSimple.stories.tsx +0 -61
- package/src/common/email-simple/NsEmailSimple.tsx +0 -72
- package/src/common/email-simple/index.ts +0 -2
- package/src/common/email-simple/types.d.ts +0 -14
- package/src/common/flag/NsFlag.spec.tsx +0 -27
- package/src/common/flag/NsFlag.stories.tsx +0 -22
- package/src/common/flag/NsFlag.styled.tsx +0 -73
- package/src/common/flag/NsFlag.tsx +0 -24
- package/src/common/flag/index.ts +0 -2
- package/src/common/flag/types.d.ts +0 -16
- package/src/common/hooks/index.ts +0 -2
- package/src/common/hooks/specs/useWindowSize.spec.tsx +0 -19
- package/src/common/hooks/useAccordionMap.tsx +0 -39
- package/src/common/hooks/useOnClickOutside.tsx +0 -25
- package/src/common/hooks/useWindowSize.tsx +0 -30
- package/src/common/icon/NsIcon.spec.tsx +0 -51
- package/src/common/icon/NsIcon.stories.tsx +0 -77
- package/src/common/icon/NsIcon.styled.tsx +0 -27
- package/src/common/icon/NsIcon.tsx +0 -44
- package/src/common/icon/NsIconVariants.ts +0 -56
- package/src/common/icon/icons/AlertErrorIcon.tsx +0 -48
- package/src/common/icon/icons/ArrowDown.tsx +0 -23
- package/src/common/icon/icons/ArrowLeft.tsx +0 -38
- package/src/common/icon/icons/ArrowRight.tsx +0 -39
- package/src/common/icon/icons/ArrowUp.tsx +0 -20
- package/src/common/icon/icons/Cart.tsx +0 -23
- package/src/common/icon/icons/CartBadge.tsx +0 -47
- package/src/common/icon/icons/Check.tsx +0 -30
- package/src/common/icon/icons/CheckShield.tsx +0 -24
- package/src/common/icon/icons/CheckVerified.tsx +0 -27
- package/src/common/icon/icons/ChevronRight.tsx +0 -31
- package/src/common/icon/icons/CloseIcon.tsx +0 -27
- package/src/common/icon/icons/ErrorIcon.tsx +0 -30
- package/src/common/icon/icons/HamburgerIcon.tsx +0 -35
- package/src/common/icon/icons/InfoFilled.tsx +0 -21
- package/src/common/icon/icons/InfoOutlined.tsx +0 -42
- package/src/common/icon/icons/RoundedClose.tsx +0 -31
- package/src/common/icon/icons/SearchIcon.tsx +0 -32
- package/src/common/icon/icons/SlashIcon.tsx +0 -22
- package/src/common/icon/icons/SuccessIcon.tsx +0 -40
- package/src/common/icon/icons/TrashIcon.tsx +0 -32
- package/src/common/icon/icons/UserIcon.tsx +0 -37
- package/src/common/icon/icons/UserOutline.tsx +0 -29
- package/src/common/icon/icons/WarningIcon.tsx +0 -48
- package/src/common/icon/icons/error.svg +0 -3
- package/src/common/icon/icons/home.tsx +0 -19
- package/src/common/icon/icons/search.svg +0 -3
- package/src/common/icon/icons/success.svg +0 -10
- package/src/common/icon/icons/trash.svg +0 -3
- package/src/common/icon/index.ts +0 -3
- package/src/common/icon/types.d.ts +0 -53
- package/src/common/image/BynderMedia.spec.tsx +0 -42
- package/src/common/image/BynderMedia.tsx +0 -49
- package/src/common/image/NsImage.spec.tsx +0 -60
- package/src/common/image/NsImage.stories.tsx +0 -46
- package/src/common/image/NsImage.tsx +0 -33
- package/src/common/image/NsNextImage.spec.tsx +0 -10
- package/src/common/image/NsNextImage.stories.tsx +0 -51
- package/src/common/image/NsNextImage.tsx +0 -11
- package/src/common/image/bynder-util.spec.ts +0 -187
- package/src/common/image/bynder-util.ts +0 -98
- package/src/common/image/index.ts +0 -3
- package/src/common/image/types.ts +0 -78
- package/src/common/index.ts +0 -37
- package/src/common/input/InputFieldWrapper.tsx +0 -24
- package/src/common/input/InputWrapper.tsx +0 -82
- package/src/common/input/NsInputField.spec.tsx +0 -25
- package/src/common/input/NsInputField.stories.tsx +0 -61
- package/src/common/input/NsInputField.tsx +0 -125
- package/src/common/input/getAdornmentProps.tsx +0 -50
- package/src/common/input/index.ts +0 -2
- package/src/common/input/types.d.ts +0 -45
- package/src/common/label/NsLabel.spec.tsx +0 -11
- package/src/common/label/NsLabel.stories.tsx +0 -35
- package/src/common/label/NsLabel.tsx +0 -43
- package/src/common/label/index.ts +0 -2
- package/src/common/label/types.d.ts +0 -10
- package/src/common/link/NsLink.spec.tsx +0 -106
- package/src/common/link/NsLink.stories.tsx +0 -55
- package/src/common/link/NsLink.styled.tsx +0 -100
- package/src/common/link/NsLink.tsx +0 -122
- package/src/common/link/index.ts +0 -2
- package/src/common/link/types.d.ts +0 -22
- package/src/common/modal/NsModal.spec.tsx +0 -46
- package/src/common/modal/NsModal.styled.tsx +0 -28
- package/src/common/modal/NsModal.tsx +0 -43
- package/src/common/modal/helper-component/NsModalContentBox.tsx +0 -37
- package/src/common/modal/helper-component/NsModalDefault.tsx +0 -34
- package/src/common/modal/helper-component/NsModalStatus.tsx +0 -17
- package/src/common/modal/helper-component/NsModalStatusIcon.tsx +0 -16
- package/src/common/modal/helper-component/NsModalTitle.tsx +0 -29
- package/src/common/modal/index.ts +0 -2
- package/src/common/modal/model/NsModalVariantMap.tsx +0 -24
- package/src/common/modal/stories/NsModal.stories.tsx +0 -87
- package/src/common/modal/stories/mock.tsx +0 -46
- package/src/common/modal/types.ts +0 -57
- package/src/common/nav-product-card/NsNavProductCard.spec.tsx +0 -22
- package/src/common/nav-product-card/NsNavProductCard.stories.tsx +0 -25
- package/src/common/nav-product-card/NsNavProductCard.styled.tsx +0 -24
- package/src/common/nav-product-card/NsNavProductCard.tsx +0 -27
- package/src/common/nav-product-card/index.ts +0 -2
- package/src/common/nav-product-card/types.d.ts +0 -9
- package/src/common/nav-tab/NavDrawer.tsx +0 -41
- package/src/common/nav-tab/NavTitles.tsx +0 -64
- package/src/common/nav-tab/NsNavTab.spec.tsx +0 -64
- package/src/common/nav-tab/NsNavTab.stories.tsx +0 -36
- package/src/common/nav-tab/NsNavTab.styled.tsx +0 -74
- package/src/common/nav-tab/NsNavTab.tsx +0 -43
- package/src/common/nav-tab/index.ts +0 -2
- package/src/common/nav-tab/types.d.ts +0 -21
- package/src/common/progress/NsProgress.spec.tsx +0 -47
- package/src/common/progress/NsProgress.stories.tsx +0 -45
- package/src/common/progress/NsProgress.styled.tsx +0 -56
- package/src/common/progress/NsProgress.tsx +0 -29
- package/src/common/progress/index.ts +0 -2
- package/src/common/progress/types.d.ts +0 -21
- package/src/common/radiogroup/NsRadioGroup.spec.tsx +0 -63
- package/src/common/radiogroup/NsRadioGroup.stories.tsx +0 -84
- package/src/common/radiogroup/NsRadioGroup.styled.tsx +0 -51
- package/src/common/radiogroup/NsRadioGroup.tsx +0 -65
- package/src/common/radiogroup/index.ts +0 -2
- package/src/common/radiogroup/types.d.ts +0 -19
- package/src/common/search-bar/NsSeachBar.spec.tsx +0 -9
- package/src/common/search-bar/NsSearchBar.tsx +0 -46
- package/src/common/select/DefaultRenderOption.tsx +0 -8
- package/src/common/select/NsSelect.styled.tsx +0 -102
- package/src/common/select/NsSelect.tsx +0 -166
- package/src/common/select/NsSelectOption.tsx +0 -26
- package/src/common/select/constant.ts +0 -30
- package/src/common/select/index.ts +0 -3
- package/src/common/select/specs/NsSelect.spec.tsx +0 -183
- package/src/common/select/specs/NsSelectOption.spec.tsx +0 -32
- package/src/common/select/stories/NsSelect.stories.tsx +0 -89
- package/src/common/select/stories/countries.ts +0 -53
- package/src/common/select/types.d.ts +0 -49
- package/src/common/spinner/NsSpinner.spec.tsx +0 -21
- package/src/common/spinner/NsSpinner.stories.tsx +0 -29
- package/src/common/spinner/NsSpinner.styled.tsx +0 -344
- package/src/common/spinner/NsSpinner.tsx +0 -15
- package/src/common/spinner/icons/Spinner.tsx +0 -163
- package/src/common/spinner/index.ts +0 -2
- package/src/common/spinner/types.ts +0 -5
- package/src/common/table/NsExpandableRow.tsx +0 -62
- package/src/common/table/NsTable.spec.tsx +0 -174
- package/src/common/table/NsTable.stories.tsx +0 -156
- package/src/common/table/NsTable.styled.ts +0 -127
- package/src/common/table/NsTable.tsx +0 -150
- package/src/common/table/NsTableHeader.tsx +0 -54
- package/src/common/table/NsTablePagination.tsx +0 -24
- package/src/common/table/helper.ts +0 -33
- package/src/common/table/index.ts +0 -2
- package/src/common/table/types.d.ts +0 -57
- package/src/common/text-strip/NsTextStrip.spec.tsx +0 -27
- package/src/common/text-strip/NsTextStrip.stories.tsx +0 -61
- package/src/common/text-strip/NsTextStrip.tsx +0 -61
- package/src/common/text-strip/index.ts +0 -2
- package/src/common/text-strip/types.d.ts +0 -16
- package/src/common/toast/Fade.tsx +0 -98
- package/src/common/toast/ToastProvider.tsx +0 -88
- package/src/common/toast/index.ts +0 -3
- package/src/common/toast/shared.ts +0 -124
- package/src/common/toast/specs/Toast.spec.tsx +0 -122
- package/src/common/toast/stories/Toast.stories.tsx +0 -82
- package/src/common/toast/useToast.tsx +0 -65
- package/src/common/typography/GlobalFontInter.tsx +0 -15
- package/src/common/typography/HtmlTagVariantMap.tsx +0 -24
- package/src/common/typography/NsTypography.spec.tsx +0 -37
- package/src/common/typography/NsTypography.stories.tsx +0 -27
- package/src/common/typography/NsTypography.tsx +0 -44
- package/src/common/typography/Typography.styled.tsx +0 -195
- package/src/common/typography/__snapshots__/NsTypography.spec.tsx.snap +0 -22
- package/src/common/typography/index.ts +0 -3
- package/src/common/typography/types.d.ts +0 -37
- package/src/common/util.ts +0 -3
- package/src/common/utility/Show.tsx +0 -13
- package/src/common/utility/index.ts +0 -1
- package/src/common/validations/regex.ts +0 -2
- package/src/common/videos/NsVideo.spec.tsx +0 -26
- package/src/common/videos/NsVideo.stories.tsx +0 -32
- package/src/common/videos/NsVideo.tsx +0 -28
- package/src/common/videos/index.ts +0 -2
- package/src/common/videos/types.d.ts +0 -9
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { styled } from '@nuskin/foundation-theme';
|
|
2
|
-
|
|
3
|
-
export const ProductCardContainer = styled.div`
|
|
4
|
-
display: flex;
|
|
5
|
-
|
|
6
|
-
img {
|
|
7
|
-
flex: 1 0 0;
|
|
8
|
-
display: block;
|
|
9
|
-
margin-right: 15px;
|
|
10
|
-
max-height: 200px;
|
|
11
|
-
min-height: 100px;
|
|
12
|
-
max-width: 200px;
|
|
13
|
-
min-width: 100px;
|
|
14
|
-
position: unset !important;
|
|
15
|
-
object-fit: contain;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.text-container {
|
|
19
|
-
max-width: 200px;
|
|
20
|
-
min-width: 100px;
|
|
21
|
-
flex: 1 0 0;
|
|
22
|
-
text-align: left;
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement } from 'react';
|
|
2
|
-
|
|
3
|
-
import { NsTypography } from '../';
|
|
4
|
-
import { BynderMedia } from '../image/BynderMedia';
|
|
5
|
-
import { ProductCardContainer } from './NsNavProductCard.styled';
|
|
6
|
-
import { NsNavProductCardProps } from './types.d';
|
|
7
|
-
|
|
8
|
-
export const NsNavProductCard = ({
|
|
9
|
-
productImg,
|
|
10
|
-
productDescription,
|
|
11
|
-
productName,
|
|
12
|
-
className = '',
|
|
13
|
-
}: NsNavProductCardProps): ReactElement => {
|
|
14
|
-
return (
|
|
15
|
-
<ProductCardContainer className={className}>
|
|
16
|
-
<BynderMedia imageDetail={productImg} />
|
|
17
|
-
<div className="text-container">
|
|
18
|
-
<NsTypography variant="h5" color="primary" className="mt-11 mb-3.5 underline-hover" weight="bold">
|
|
19
|
-
{productName}
|
|
20
|
-
</NsTypography>
|
|
21
|
-
<NsTypography variant="body-s" color="primary" weight="light">
|
|
22
|
-
{productDescription}
|
|
23
|
-
</NsTypography>
|
|
24
|
-
</div>
|
|
25
|
-
</ProductCardContainer>
|
|
26
|
-
);
|
|
27
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AdditionalProps } from '../common.types';
|
|
2
|
-
import { BynderImageDataType } from '../image/types';
|
|
3
|
-
|
|
4
|
-
export interface NsNavProductCardProps extends AdditionalProps {
|
|
5
|
-
productImg: BynderImageDataType;
|
|
6
|
-
productName: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
productDescription: string;
|
|
9
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ReactElement,
|
|
3
|
-
ReactNode,
|
|
4
|
-
} from 'react';
|
|
5
|
-
|
|
6
|
-
import { Show } from '../utility';
|
|
7
|
-
import {
|
|
8
|
-
NavDrawerContainer,
|
|
9
|
-
NavDrawerStyled,
|
|
10
|
-
} from './NsNavTab.styled';
|
|
11
|
-
|
|
12
|
-
type NavDrawerProps = {
|
|
13
|
-
active: string | null;
|
|
14
|
-
showDrawer: boolean;
|
|
15
|
-
content: ReactNode;
|
|
16
|
-
};
|
|
17
|
-
export const NavDrawer = ({ active, showDrawer, content }: NavDrawerProps): ReactElement => {
|
|
18
|
-
return (
|
|
19
|
-
<NavDrawerStyled data-testid="nav-drawer-container" className="nav-drawer">
|
|
20
|
-
<Show when={Boolean(active) && showDrawer}>
|
|
21
|
-
<NavDrawerContainer
|
|
22
|
-
data-testid="nav-drawer"
|
|
23
|
-
initial={{
|
|
24
|
-
height: 0,
|
|
25
|
-
}}
|
|
26
|
-
animate={{
|
|
27
|
-
height: 'auto',
|
|
28
|
-
}}
|
|
29
|
-
exit={{
|
|
30
|
-
height: 0,
|
|
31
|
-
}}
|
|
32
|
-
transition={{
|
|
33
|
-
duration: 0.3,
|
|
34
|
-
}}
|
|
35
|
-
>
|
|
36
|
-
<div className="drawer-container">{content}</div>
|
|
37
|
-
</NavDrawerContainer>
|
|
38
|
-
</Show>
|
|
39
|
-
</NavDrawerStyled>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
|
|
3
|
-
import { NavTabs, NsLink, NsTypography } from '../';
|
|
4
|
-
import { Show } from '../utility';
|
|
5
|
-
import { NavTabBox, NavTabUnderLine, NavTitlesBox } from './NsNavTab.styled';
|
|
6
|
-
|
|
7
|
-
type NavTitlesProps = {
|
|
8
|
-
tabs: NavTabs[];
|
|
9
|
-
setActive(_x: string): void;
|
|
10
|
-
active: string | null;
|
|
11
|
-
tabTitleClassName?: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const NavTitles = ({ tabs, setActive, active, tabTitleClassName }: NavTitlesProps): ReactElement => {
|
|
15
|
-
const NavTitleTypography = (tab: NavTabs) => (
|
|
16
|
-
<NsTypography
|
|
17
|
-
variant={tab.textVariant}
|
|
18
|
-
additionalProps={{ ...tab?.liveTag }}
|
|
19
|
-
className={`${tabTitleClassName} ${!active ? 'opacity-8' : ''}`}
|
|
20
|
-
color={tab.tabName === active ? tab.activeColor : tab.color}
|
|
21
|
-
noSpacing
|
|
22
|
-
>
|
|
23
|
-
{tab.tabName}
|
|
24
|
-
</NsTypography>
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<NavTitlesBox className="desktop-nav-titles">
|
|
29
|
-
{tabs?.map((tab) => {
|
|
30
|
-
const handleMouseEnter = () => {
|
|
31
|
-
setActive(tab.tabName);
|
|
32
|
-
};
|
|
33
|
-
return (
|
|
34
|
-
<div
|
|
35
|
-
key={tab?.tabName}
|
|
36
|
-
data-testid={tab?.tabName}
|
|
37
|
-
className="relative cursor-pointer"
|
|
38
|
-
onMouseEnter={handleMouseEnter}
|
|
39
|
-
>
|
|
40
|
-
<NavTabBox
|
|
41
|
-
className="nav-tab-box"
|
|
42
|
-
data-testid={tab.tabName + '-list'}
|
|
43
|
-
transition={{
|
|
44
|
-
duration: 0.3,
|
|
45
|
-
}}
|
|
46
|
-
animate
|
|
47
|
-
>
|
|
48
|
-
{tab?.tabLink ? (
|
|
49
|
-
<NavTitleTypography {...tab}>
|
|
50
|
-
<NsLink href={tab.tabLink} underlineOnHover={false} />
|
|
51
|
-
</NavTitleTypography>
|
|
52
|
-
) : (
|
|
53
|
-
<NavTitleTypography {...tab} />
|
|
54
|
-
)}
|
|
55
|
-
</NavTabBox>
|
|
56
|
-
<Show when={active === tab.tabName}>
|
|
57
|
-
<NavTabUnderLine data-testid="underline" layoutId="underline" color={tab.activeColor} />
|
|
58
|
-
</Show>
|
|
59
|
-
</div>
|
|
60
|
-
);
|
|
61
|
-
})}
|
|
62
|
-
</NavTitlesBox>
|
|
63
|
-
);
|
|
64
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { fireEvent } from '@testing-library/react';
|
|
2
|
-
import { NsNavTabComponent } from './NsNavTab';
|
|
3
|
-
import { NavTabs } from './types';
|
|
4
|
-
import { render } from '@/test-utils/index';
|
|
5
|
-
|
|
6
|
-
const tabs: NavTabs[] = [
|
|
7
|
-
{
|
|
8
|
-
tabName: 'Skin & Beauty',
|
|
9
|
-
tabContent: <>Skin & Beauty</>,
|
|
10
|
-
activeColor: 'success',
|
|
11
|
-
textVariant: 'h5',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
tabName: 'Beauty Devices',
|
|
15
|
-
tabContent: <>Beauty Devices</>,
|
|
16
|
-
color: 'primary',
|
|
17
|
-
activeColor: 'success',
|
|
18
|
-
textVariant: 'h5',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
tabName: 'Product Lines',
|
|
22
|
-
tabContent: <>Product Lines</>,
|
|
23
|
-
color: 'primary',
|
|
24
|
-
activeColor: 'success',
|
|
25
|
-
textVariant: 'h5',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
tabName: 'New & Loved',
|
|
29
|
-
tabContent: <>New & Loved</>,
|
|
30
|
-
color: 'primary',
|
|
31
|
-
activeColor: 'success',
|
|
32
|
-
textVariant: 'h5',
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
describe('Nav Bar Component', () => {
|
|
37
|
-
it('1. should render Nav Bar Component with variant', () => {
|
|
38
|
-
const { container } = render(
|
|
39
|
-
<NsNavTabComponent tabTitleClassName="text-center" className="mb-2" tabs={tabs} />
|
|
40
|
-
);
|
|
41
|
-
const li = container.querySelectorAll('li');
|
|
42
|
-
expect(li.length).toBe(4);
|
|
43
|
-
li.forEach((list, i) => expect(list).toHaveTextContent(tabs[i].tabName));
|
|
44
|
-
expect(container).toBeInTheDocument();
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('2. should open and close the drawer', () => {
|
|
48
|
-
const { container, getByTestId } = render(<NsNavTabComponent showDrawer className="mb-2" tabs={tabs} />);
|
|
49
|
-
const li = container.querySelectorAll('li');
|
|
50
|
-
expect(li.length).toBe(4);
|
|
51
|
-
li.forEach((list, i) => expect(list).toHaveTextContent(tabs[i].tabName));
|
|
52
|
-
expect(container).toBeInTheDocument();
|
|
53
|
-
fireEvent.mouseOver(getByTestId('Skin & Beauty'));
|
|
54
|
-
expect(getByTestId('nav-drawer')).toBeInTheDocument();
|
|
55
|
-
fireEvent.mouseLeave(getByTestId('Skin & Beauty'));
|
|
56
|
-
expect(getByTestId('nav-drawer-container').firstChild).not.toBeInTheDocument();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('3. should show the underline on hover', () => {
|
|
60
|
-
const { getByTestId } = render(<NsNavTabComponent showDrawer={false} className="mb-2" tabs={tabs} />);
|
|
61
|
-
fireEvent.mouseOver(getByTestId('Skin & Beauty'));
|
|
62
|
-
expect(getByTestId('underline')).toBeInTheDocument();
|
|
63
|
-
});
|
|
64
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { StoryObj, Meta } from '@storybook/react';
|
|
2
|
-
import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
|
|
3
|
-
import { NsNavTab } from '.';
|
|
4
|
-
|
|
5
|
-
type ComponentType = typeof NsNavTab;
|
|
6
|
-
type Story = StoryObj<ComponentType>;
|
|
7
|
-
type MetaStory = Meta<ComponentType>;
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: 'Components/Navigation/NsNavTab',
|
|
11
|
-
component: NsNavTab,
|
|
12
|
-
decorators: [withCenterDecorator],
|
|
13
|
-
argTypes: {
|
|
14
|
-
tabs: { control: 'object' },
|
|
15
|
-
},
|
|
16
|
-
args: {
|
|
17
|
-
tabs: [
|
|
18
|
-
{
|
|
19
|
-
tabName: 'Tab One',
|
|
20
|
-
activeColor: 'info',
|
|
21
|
-
color: 'primary',
|
|
22
|
-
tabContent: 'Tab one content',
|
|
23
|
-
textVariant: 'h5',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
tabName: 'Tab Two',
|
|
27
|
-
activeColor: 'info',
|
|
28
|
-
color: 'primary',
|
|
29
|
-
tabContent: 'Tab two content',
|
|
30
|
-
textVariant: 'h5',
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
} as MetaStory;
|
|
35
|
-
|
|
36
|
-
export const NavTab: Story = {};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { FoundationTheme, styled, ColorUtils } from '@nuskin/foundation-theme';
|
|
2
|
-
import { motion } from 'framer-motion';
|
|
3
|
-
|
|
4
|
-
const { paletteColor } = ColorUtils;
|
|
5
|
-
|
|
6
|
-
export const NavTabContainer = styled.div`
|
|
7
|
-
.shadow {
|
|
8
|
-
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.15);
|
|
9
|
-
}
|
|
10
|
-
`;
|
|
11
|
-
|
|
12
|
-
export const NavTabBox = styled(motion.li)`
|
|
13
|
-
margin: 0px 14px;
|
|
14
|
-
align-items: center;
|
|
15
|
-
white-space: normal;
|
|
16
|
-
text-align: center;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
list-style: none;
|
|
19
|
-
position: relative;
|
|
20
|
-
min-width: 60px;
|
|
21
|
-
padding: 8px 4px;
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
export const NavTabUnderLine = styled(motion.div)<{ color?: FoundationTheme.PaletteColors }>`
|
|
25
|
-
width: 100%;
|
|
26
|
-
position: absolute;
|
|
27
|
-
height: 3px;
|
|
28
|
-
background-color: ${({ theme, color }) => paletteColor(color)({ theme })};
|
|
29
|
-
`;
|
|
30
|
-
|
|
31
|
-
export const NavDrawerStyled = styled.div`
|
|
32
|
-
position: absolute;
|
|
33
|
-
left: 0;
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-direction: row;
|
|
36
|
-
justify-content: center;
|
|
37
|
-
align-items: flex-start;
|
|
38
|
-
z-index: 600;
|
|
39
|
-
width: 100%;
|
|
40
|
-
max-height: 590px;
|
|
41
|
-
|
|
42
|
-
background-color: ${paletteColor('primary', 'contrastText')};
|
|
43
|
-
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.15);
|
|
44
|
-
transition: all 0.15s ease-in-out;
|
|
45
|
-
overflow: hidden;
|
|
46
|
-
`;
|
|
47
|
-
|
|
48
|
-
export const NavDrawerContainer = styled(motion.div)`
|
|
49
|
-
::before {
|
|
50
|
-
content: '';
|
|
51
|
-
position: absolute;
|
|
52
|
-
top: -5px;
|
|
53
|
-
width: 100%;
|
|
54
|
-
height: 5px;
|
|
55
|
-
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.15);
|
|
56
|
-
z-index: 1;
|
|
57
|
-
}
|
|
58
|
-
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.15);
|
|
59
|
-
background-color: ${paletteColor('primary', 'contrastText')};
|
|
60
|
-
width: 100%;
|
|
61
|
-
text-align: left;
|
|
62
|
-
max-height: 590px;
|
|
63
|
-
overflow: auto;
|
|
64
|
-
.drawer-container {
|
|
65
|
-
max-width: 1024px;
|
|
66
|
-
margin: 0 auto;
|
|
67
|
-
overflow: hidden;
|
|
68
|
-
}
|
|
69
|
-
`;
|
|
70
|
-
|
|
71
|
-
export const NavTitlesBox = styled.div`
|
|
72
|
-
display: flex;
|
|
73
|
-
height: 39px;
|
|
74
|
-
`;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
ReactElement,
|
|
3
|
-
useCallback,
|
|
4
|
-
useState,
|
|
5
|
-
} from 'react';
|
|
6
|
-
|
|
7
|
-
import { LayoutGroup } from 'framer-motion';
|
|
8
|
-
|
|
9
|
-
import { NavDrawer } from './NavDrawer';
|
|
10
|
-
import { NavTitles } from './NavTitles';
|
|
11
|
-
import { NavTabContainer } from './NsNavTab.styled';
|
|
12
|
-
import { NsNavTabComponentProps } from './types.d';
|
|
13
|
-
|
|
14
|
-
export const NsNavTabComponent = ({
|
|
15
|
-
tabs,
|
|
16
|
-
className,
|
|
17
|
-
tabTitleClassName,
|
|
18
|
-
showDrawer = true,
|
|
19
|
-
}: NsNavTabComponentProps): ReactElement => {
|
|
20
|
-
const [active, setActive] = useState<string | null>(null);
|
|
21
|
-
|
|
22
|
-
const activeTab = tabs?.find((tab) => tab.tabName === active);
|
|
23
|
-
|
|
24
|
-
const handleLeave = useCallback(() => {
|
|
25
|
-
setActive(null);
|
|
26
|
-
}, []);
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<NavTabContainer data-testid="nav-container" className={`${className} ns-nav-tab-component`}>
|
|
30
|
-
<LayoutGroup>
|
|
31
|
-
<div onMouseLeave={handleLeave} data-testid="nav-container-draw" className="p-0 m-0">
|
|
32
|
-
<NavTitles
|
|
33
|
-
tabTitleClassName={tabTitleClassName}
|
|
34
|
-
tabs={tabs}
|
|
35
|
-
active={active}
|
|
36
|
-
setActive={setActive}
|
|
37
|
-
/>
|
|
38
|
-
<NavDrawer active={active} content={activeTab?.tabContent} showDrawer={showDrawer} />
|
|
39
|
-
</div>
|
|
40
|
-
</LayoutGroup>
|
|
41
|
-
</NavTabContainer>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { FoundationTheme } from '@nuskin/foundation-theme';
|
|
3
|
-
import { Variants } from '../typography/types';
|
|
4
|
-
import { AdditionalProps, CslpTag } from '../common.types';
|
|
5
|
-
|
|
6
|
-
export type NavTabs = {
|
|
7
|
-
tabName: string;
|
|
8
|
-
tabLink?: string;
|
|
9
|
-
tabContent?: ReactNode;
|
|
10
|
-
activeColor: FoundationTheme.PaletteColors;
|
|
11
|
-
color?: FoundationTheme.PaletteColors;
|
|
12
|
-
textVariant: Variants;
|
|
13
|
-
liveTag?: CslpTag;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type NsNavTabComponentProps = {
|
|
17
|
-
tabs: NavTabs[];
|
|
18
|
-
className?: string;
|
|
19
|
-
tabTitleClassName?: string;
|
|
20
|
-
showDrawer?: boolean;
|
|
21
|
-
} & AdditionalProps;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import Progress from './NsProgress';
|
|
4
|
-
|
|
5
|
-
describe(' NsProgress Component', () => {
|
|
6
|
-
test('should render Progress bar', () => {
|
|
7
|
-
render(<Progress barColor="primary" value={10}></Progress>);
|
|
8
|
-
|
|
9
|
-
const pbar = screen.getByRole('progressbar');
|
|
10
|
-
|
|
11
|
-
expect(pbar).toBeInTheDocument();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('matches the height of the progress bar to the width of the container', () => {
|
|
15
|
-
// Define the props
|
|
16
|
-
const value = 50;
|
|
17
|
-
|
|
18
|
-
// Render the StyledProgress component with the value prop
|
|
19
|
-
const { container } = render(<Progress barColor="primary" value={value} />);
|
|
20
|
-
|
|
21
|
-
// Get the progress bar element
|
|
22
|
-
const progressBar = container.querySelector('.MuiLinearProgress-bar');
|
|
23
|
-
|
|
24
|
-
// Check if the progress bar element exists
|
|
25
|
-
if (progressBar) {
|
|
26
|
-
// Retrieve the computed width of the container element
|
|
27
|
-
const containerWidth = container.clientWidth;
|
|
28
|
-
|
|
29
|
-
// Retrieve the computed styles of the progress bar
|
|
30
|
-
const progressBarStyle = getComputedStyle(progressBar);
|
|
31
|
-
const progressBarHeight = parseFloat(progressBarStyle.height);
|
|
32
|
-
const progressBarPadding =
|
|
33
|
-
parseFloat(progressBarStyle.paddingTop) + parseFloat(progressBarStyle.paddingBottom);
|
|
34
|
-
const progressBarBorder =
|
|
35
|
-
parseFloat(progressBarStyle.borderTopWidth) + parseFloat(progressBarStyle.borderBottomWidth);
|
|
36
|
-
|
|
37
|
-
// Calculate the expected height of the progress bar
|
|
38
|
-
const expectedHeight = containerWidth - progressBarPadding - progressBarBorder;
|
|
39
|
-
|
|
40
|
-
// Assert that the height of the progress bar matches the width of the container
|
|
41
|
-
expect(progressBarHeight).toBe(expectedHeight);
|
|
42
|
-
} else {
|
|
43
|
-
// Handle the case where the progress bar element is not found
|
|
44
|
-
throw new Error('Progress bar element not found');
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
|
|
3
|
-
import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
|
|
4
|
-
import { PaletteColors } from '@nuskin/foundation-theme';
|
|
5
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
6
|
-
|
|
7
|
-
import NsProgress from './NsProgress';
|
|
8
|
-
|
|
9
|
-
type ComponentType = typeof NsProgress;
|
|
10
|
-
type Story = StoryObj<ComponentType>;
|
|
11
|
-
type MetaStory = Meta<ComponentType>;
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
component: NsProgress,
|
|
15
|
-
title: 'Components/Inputs/NsProgress',
|
|
16
|
-
decorators: [withCenterDecorator],
|
|
17
|
-
argTypes: {
|
|
18
|
-
barColor: {
|
|
19
|
-
control: 'select',
|
|
20
|
-
options: PaletteColors,
|
|
21
|
-
description: 'defines the color for the completed progress',
|
|
22
|
-
},
|
|
23
|
-
height: {
|
|
24
|
-
description: 'height of the bar',
|
|
25
|
-
},
|
|
26
|
-
value: {
|
|
27
|
-
description: 'value of the progress done',
|
|
28
|
-
},
|
|
29
|
-
backgroundColor: {
|
|
30
|
-
control: 'select',
|
|
31
|
-
options: PaletteColors,
|
|
32
|
-
description: 'color of incomplete progress',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
} as MetaStory;
|
|
36
|
-
|
|
37
|
-
export const ProgressBar: Story = {
|
|
38
|
-
args: {
|
|
39
|
-
barColor: 'primary',
|
|
40
|
-
backgroundColor: 'secondary',
|
|
41
|
-
value: 40,
|
|
42
|
-
height: '10px',
|
|
43
|
-
body: (<span>{'% Complete'}</span>) as ReactElement,
|
|
44
|
-
},
|
|
45
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { styled, ColorUtils } from '@nuskin/foundation-theme';
|
|
2
|
-
import { LinearProgress } from '@mui/material';
|
|
3
|
-
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
|
|
4
|
-
import { NsProgressProps } from './types';
|
|
5
|
-
import { NsTypography } from '../typography';
|
|
6
|
-
|
|
7
|
-
const { color, paletteColor } = ColorUtils;
|
|
8
|
-
export const StyledCheckCircle = styled(CheckCircleIcon)`
|
|
9
|
-
color: ${color('neutral', '50')};
|
|
10
|
-
padding-top: 0.6em;
|
|
11
|
-
padding-right: 0.5em;
|
|
12
|
-
justify-self: flex-end;
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
export const ProgressInfo = styled(NsTypography)`
|
|
16
|
-
display: flex;
|
|
17
|
-
justify-content: flex-end;
|
|
18
|
-
font-weight: 700;
|
|
19
|
-
text-transform: uppercase;
|
|
20
|
-
`;
|
|
21
|
-
|
|
22
|
-
export const StyledLinearProgress = styled(LinearProgress)<Omit<NsProgressProps, 'value'>>(
|
|
23
|
-
({ height, backgroundColor, barColor, theme }) => ({
|
|
24
|
-
width: '334px',
|
|
25
|
-
height,
|
|
26
|
-
backgroundColor: paletteColor(backgroundColor)({ theme }),
|
|
27
|
-
borderRadius: '8px',
|
|
28
|
-
display: 'inline-block',
|
|
29
|
-
|
|
30
|
-
'.MuiLinearProgress-bar': {
|
|
31
|
-
backgroundColor: paletteColor(barColor)({ theme }),
|
|
32
|
-
},
|
|
33
|
-
})
|
|
34
|
-
);
|
|
35
|
-
export const StyledProgress = styled('div')`
|
|
36
|
-
display: grid;
|
|
37
|
-
grid-template-rows: 30px 30px;
|
|
38
|
-
.progress-info {
|
|
39
|
-
justify-content: flex-end;
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
}
|
|
43
|
-
.progress-bar {
|
|
44
|
-
display: flex;
|
|
45
|
-
align-items: center;
|
|
46
|
-
.MuiSvgIcon-root {
|
|
47
|
-
padding: 0;
|
|
48
|
-
margin: 0;
|
|
49
|
-
height: 100%;
|
|
50
|
-
position: relative;
|
|
51
|
-
left: -4px;
|
|
52
|
-
scale: 1.3
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement } from 'react';
|
|
2
|
-
|
|
3
|
-
import { ProgressInfo, StyledCheckCircle, StyledLinearProgress, StyledProgress } from './NsProgress.styled';
|
|
4
|
-
import { NsProgressProps } from './types';
|
|
5
|
-
|
|
6
|
-
const NsProgress = (props: NsProgressProps): ReactElement => {
|
|
7
|
-
const { barColor, backgroundColor, height, value, body } = props;
|
|
8
|
-
return (
|
|
9
|
-
<StyledProgress className="ns-progress">
|
|
10
|
-
<ProgressInfo variant="body-xs" className="progress-info">
|
|
11
|
-
{value}
|
|
12
|
-
<span>{body ?? ' % Complete'}</span>
|
|
13
|
-
</ProgressInfo>
|
|
14
|
-
<div className="progress-bar">
|
|
15
|
-
<StyledLinearProgress
|
|
16
|
-
variant="determinate"
|
|
17
|
-
role="progressbar"
|
|
18
|
-
value={value}
|
|
19
|
-
height={height}
|
|
20
|
-
barColor={barColor}
|
|
21
|
-
backgroundColor={backgroundColor}
|
|
22
|
-
/>
|
|
23
|
-
<StyledCheckCircle />
|
|
24
|
-
</div>
|
|
25
|
-
</StyledProgress>
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default NsProgress;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { FoundationTheme } from '@nuskin/foundation-theme';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
declare module '@mui/material/LinearProgress' {
|
|
5
|
-
// eslint-disable-next-line no-unused-vars
|
|
6
|
-
interface LinearProgressPropsColorOverrides {
|
|
7
|
-
neutral: true;
|
|
8
|
-
accentColorA: true;
|
|
9
|
-
accentColorB: true;
|
|
10
|
-
accentColorC: true;
|
|
11
|
-
accentColorD: true;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type NsProgressProps = {
|
|
16
|
-
barColor?: FoundationTheme.PaletteColors;
|
|
17
|
-
backgroundColor?: FoundationTheme.PaletteColors;
|
|
18
|
-
height?: string;
|
|
19
|
-
value: number;
|
|
20
|
-
body?: ReactNode;
|
|
21
|
-
};
|