@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,183 +0,0 @@
|
|
|
1
|
-
import { RenderSelectOptionArgType } from '../types';
|
|
2
|
-
import { fireEvent, render, screen, waitFor } from '@/test-utils/index';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import { NsSelect, NsSelectOption } from '../..';
|
|
6
|
-
|
|
7
|
-
const renderSelectOption = (option: RenderSelectOptionArgType) => {
|
|
8
|
-
return (
|
|
9
|
-
<NsSelectOption
|
|
10
|
-
key={option.value}
|
|
11
|
-
value={option.value}
|
|
12
|
-
index={option.index ?? -1}
|
|
13
|
-
label={option.label}
|
|
14
|
-
onClick={option.onClick}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
const createOptionTestId = (value: string) => `option-${value}`;
|
|
19
|
-
const selectCommonProps = {
|
|
20
|
-
selected: { label: 'Option 1', value: 'Option1', index: 0 },
|
|
21
|
-
options: [
|
|
22
|
-
{ value: 'Option1', label: 'Option 1' },
|
|
23
|
-
{ value: 'Option2', label: 'Option 2' },
|
|
24
|
-
{ value: 'Option3', label: 'Option 3' },
|
|
25
|
-
],
|
|
26
|
-
onSelect: jest.fn(),
|
|
27
|
-
RenderOption: renderSelectOption,
|
|
28
|
-
};
|
|
29
|
-
describe('NsSelect', () => {
|
|
30
|
-
const onSelect = jest.fn();
|
|
31
|
-
const selected = { label: '', value: '' };
|
|
32
|
-
|
|
33
|
-
const options = [
|
|
34
|
-
{ value: 'Option1', label: 'Option 1' },
|
|
35
|
-
{ value: 'Option2', label: 'Option 2' },
|
|
36
|
-
{ value: 'Option3', label: 'Option 3' },
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
it('1. renders the placeholder text when no value is selected', () => {
|
|
40
|
-
render(
|
|
41
|
-
<NsSelect
|
|
42
|
-
placeholder="Select an option"
|
|
43
|
-
selected={selected}
|
|
44
|
-
onSelect={onSelect}
|
|
45
|
-
options={options}
|
|
46
|
-
RenderOption={renderSelectOption}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
expect(screen.getByText('Select an option')).toBeInTheDocument();
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('2. clicking outside the select container closes the dropdown', async () => {
|
|
54
|
-
const { getByTestId, queryByTestId, container } = render(
|
|
55
|
-
<div>
|
|
56
|
-
<button className="extra"></button>
|
|
57
|
-
<NsSelect {...selectCommonProps} />
|
|
58
|
-
</div>
|
|
59
|
-
);
|
|
60
|
-
const selectButton = getByTestId('select-head');
|
|
61
|
-
fireEvent.mouseDown(selectButton);
|
|
62
|
-
const outsideElement = container.querySelector('button.extra');
|
|
63
|
-
if (outsideElement) fireEvent.click(outsideElement);
|
|
64
|
-
// check if the dropdown is closed
|
|
65
|
-
expect(queryByTestId(createOptionTestId(selectCommonProps.options[1].value))).toBeNull();
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('3. renders the selected value label', () => {
|
|
69
|
-
render(<NsSelect {...selectCommonProps} />);
|
|
70
|
-
|
|
71
|
-
expect(screen.getByText(selectCommonProps.selected.label)).toBeInTheDocument();
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it('4. clicking on select button opens the dropdown', () => {
|
|
75
|
-
const { getByTestId, getByText } = render(<NsSelect {...selectCommonProps} />);
|
|
76
|
-
const selectButton = getByTestId('select-head');
|
|
77
|
-
fireEvent.mouseDown(selectButton);
|
|
78
|
-
|
|
79
|
-
// Check if the dropdown is opened (isOpen state is true)
|
|
80
|
-
const dropdownList = getByTestId('select-menu-list');
|
|
81
|
-
expect(dropdownList).toBeInTheDocument();
|
|
82
|
-
|
|
83
|
-
// Check if the options are rendered in the dropdown
|
|
84
|
-
selectCommonProps.options.slice(1).forEach((option) => {
|
|
85
|
-
const optionElement = getByText(option.label);
|
|
86
|
-
expect(optionElement).toBeInTheDocument();
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('5. disabling the select component prevents interaction', () => {
|
|
91
|
-
const { getByTestId, queryByTestId } = render(<NsSelect {...selectCommonProps} disabled />);
|
|
92
|
-
const selectButton = getByTestId('select-head');
|
|
93
|
-
fireEvent.mouseDown(selectButton);
|
|
94
|
-
|
|
95
|
-
// Check if the dropdown does not open (select list is not present)
|
|
96
|
-
const dropdownList = queryByTestId('select-menu-list');
|
|
97
|
-
expect(dropdownList).toBeNull();
|
|
98
|
-
|
|
99
|
-
expect(selectCommonProps.onSelect).not.toHaveBeenCalled();
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it('6. menu closes on mouse leave when closeOnMouseLeave is set to true', async () => {
|
|
103
|
-
const { getByTestId } = render(<NsSelect {...selectCommonProps} closeOnMouseLeave />);
|
|
104
|
-
|
|
105
|
-
const selectHead = getByTestId('select-head');
|
|
106
|
-
fireEvent.mouseDown(selectHead);
|
|
107
|
-
const selectList = screen.queryByTestId('select-menu-list');
|
|
108
|
-
const option1 = screen.queryByTestId(createOptionTestId(selectCommonProps.options[0].value));
|
|
109
|
-
const option2 = screen.queryByTestId(createOptionTestId(selectCommonProps.options[1].value));
|
|
110
|
-
const option3 = screen.queryByTestId(createOptionTestId(selectCommonProps.options[2].value));
|
|
111
|
-
if (selectList) fireEvent.mouseLeave(selectList);
|
|
112
|
-
|
|
113
|
-
await waitFor(() => {
|
|
114
|
-
expect(option1).not.toBeInTheDocument();
|
|
115
|
-
expect(option2).not.toBeInTheDocument();
|
|
116
|
-
expect(option3).not.toBeInTheDocument();
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
it('7. select does not open when disabled', () => {
|
|
121
|
-
render(<NsSelect {...selectCommonProps} disabled />);
|
|
122
|
-
|
|
123
|
-
const selectHead = screen.getByTestId('select-head');
|
|
124
|
-
fireEvent.mouseDown(selectHead);
|
|
125
|
-
|
|
126
|
-
expect(screen.queryByTestId('select-menu-list')).not.toBeInTheDocument();
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it('8. opens the select on "ArrowDown" key press', () => {
|
|
130
|
-
render(<NsSelect {...selectCommonProps} />);
|
|
131
|
-
|
|
132
|
-
const selectHead = screen.getByTestId('select-head');
|
|
133
|
-
fireEvent.mouseDown(selectHead, { key: 'arrowDown' });
|
|
134
|
-
|
|
135
|
-
expect(selectHead).toBeInTheDocument();
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
it('9. selects the next option on arrow right click', () => {
|
|
139
|
-
const { getByTestId, container } = render(<NsSelect {...selectCommonProps} hasArrows />);
|
|
140
|
-
|
|
141
|
-
const selectHead = getByTestId('select-head');
|
|
142
|
-
fireEvent.mouseDown(selectHead);
|
|
143
|
-
|
|
144
|
-
const rightArrow = container.querySelector('.RightArrow');
|
|
145
|
-
if (rightArrow) fireEvent.click(rightArrow);
|
|
146
|
-
|
|
147
|
-
expect(selectCommonProps.onSelect).toHaveBeenCalledWith({ ...selectCommonProps.options[1], index: 1 });
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
it('10. selects the previous option on arrow left click', () => {
|
|
151
|
-
const { getByTestId } = render(<NsSelect {...selectCommonProps} hasArrows reverseArrowControls />);
|
|
152
|
-
|
|
153
|
-
const selectHead = getByTestId('select-head');
|
|
154
|
-
fireEvent.mouseDown(selectHead);
|
|
155
|
-
const option3 = getByTestId(createOptionTestId(selectCommonProps.options[2].value));
|
|
156
|
-
fireEvent.click(option3);
|
|
157
|
-
|
|
158
|
-
const leftArrow = document.getElementsByClassName('LeftArrow')[0];
|
|
159
|
-
fireEvent.click(leftArrow);
|
|
160
|
-
|
|
161
|
-
expect(selectCommonProps.onSelect).toHaveBeenCalledWith({ ...selectCommonProps.options[1], index: 1 });
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
it('11. renders an error message with red styles', () => {
|
|
165
|
-
const errorMessage = 'Invalid value';
|
|
166
|
-
|
|
167
|
-
const { getByText } = render(<NsSelect {...selectCommonProps} hasArrows errorMessage={errorMessage} />);
|
|
168
|
-
|
|
169
|
-
const errorText = getByText(errorMessage);
|
|
170
|
-
expect(errorText).toBeInTheDocument();
|
|
171
|
-
});
|
|
172
|
-
it('12. selecting an option calls the onSelect callback', () => {
|
|
173
|
-
const { getByTestId } = render(<NsSelect {...selectCommonProps} hasArrows />);
|
|
174
|
-
|
|
175
|
-
const selectHead = getByTestId('select-head');
|
|
176
|
-
fireEvent.mouseDown(selectHead);
|
|
177
|
-
|
|
178
|
-
const option1 = getByTestId(createOptionTestId(selectCommonProps.options[2].value));
|
|
179
|
-
fireEvent.click(option1);
|
|
180
|
-
|
|
181
|
-
expect(selectCommonProps.onSelect).toHaveBeenCalledWith({ ...selectCommonProps.options[2], index: 2 });
|
|
182
|
-
});
|
|
183
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { fireEvent, render } from '@/test-utils/index';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import { NsSelectOption } from '../';
|
|
5
|
-
|
|
6
|
-
describe('NsSelectOption', () => {
|
|
7
|
-
it('1. renders NsSelectOption component without errors', () => {
|
|
8
|
-
const value = 'option1';
|
|
9
|
-
const label = 'Option 1';
|
|
10
|
-
const onClick = jest.fn();
|
|
11
|
-
const { getByTestId, getByText } = render(
|
|
12
|
-
<NsSelectOption value={value} label={label} index={1} onClick={onClick} />
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
// Check if the option container element exists
|
|
16
|
-
const optionContainer = getByTestId(`option-${value}`);
|
|
17
|
-
expect(optionContainer).toBeInTheDocument();
|
|
18
|
-
|
|
19
|
-
// Check if the option label is rendered correctly
|
|
20
|
-
const optionLabel = getByText(label);
|
|
21
|
-
expect(optionLabel).toBeInTheDocument();
|
|
22
|
-
});
|
|
23
|
-
it('2. clicking on NsSelectOption selects the option', () => {
|
|
24
|
-
const value = 'option1';
|
|
25
|
-
const label = 'Option 1';
|
|
26
|
-
const onClick = jest.fn();
|
|
27
|
-
const { getByTestId } = render(<NsSelectOption value={value} label={label} onClick={onClick} index={1} />);
|
|
28
|
-
const optionElement = getByTestId(`option-${value}`);
|
|
29
|
-
fireEvent.click(optionElement);
|
|
30
|
-
expect(onClick).toHaveBeenCalled();
|
|
31
|
-
});
|
|
32
|
-
});
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
|
|
4
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
-
|
|
6
|
-
import { NsSelect, NsSelectOption, SelectProps } from '../';
|
|
7
|
-
import { countries } from './countries';
|
|
8
|
-
|
|
9
|
-
type ComponentType = typeof NsSelect;
|
|
10
|
-
type Story = StoryObj<ComponentType>;
|
|
11
|
-
type MetaStory = Meta<ComponentType>;
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
title: 'Components/Inputs/NsSelect',
|
|
15
|
-
decorators: [withCenterDecorator],
|
|
16
|
-
component: NsSelect,
|
|
17
|
-
argTypes: {
|
|
18
|
-
type: { control: 'select', options: ['unfilled', 'outlined'] },
|
|
19
|
-
disabled: { control: 'boolean' },
|
|
20
|
-
selectBorderColor: {
|
|
21
|
-
control: 'select',
|
|
22
|
-
options: ['primary', 'secondary', 'accentColorA', 'accentColorB', 'accentColorC'],
|
|
23
|
-
},
|
|
24
|
-
placeholder: { control: 'text' },
|
|
25
|
-
closeOnMouseLeave: { control: 'boolean' },
|
|
26
|
-
showListDivider: { control: 'boolean' },
|
|
27
|
-
label: { control: 'text' },
|
|
28
|
-
name: { control: 'text' },
|
|
29
|
-
menuProps: { control: 'text' },
|
|
30
|
-
reverseArrowControls: { control: 'boolean' },
|
|
31
|
-
validateOnBlur: { control: 'boolean' },
|
|
32
|
-
autoComplete: { control: 'text' },
|
|
33
|
-
rules: { control: 'array' },
|
|
34
|
-
hasArrows: { control: 'boolean' },
|
|
35
|
-
},
|
|
36
|
-
parameters: {
|
|
37
|
-
options: countries,
|
|
38
|
-
},
|
|
39
|
-
args: {
|
|
40
|
-
type: 'outlined',
|
|
41
|
-
disabled: false,
|
|
42
|
-
selectBorderColor: 'primary',
|
|
43
|
-
closeOnMouseLeave: false,
|
|
44
|
-
showListDivider: true,
|
|
45
|
-
selected: { label: '', value: '', index: 0 },
|
|
46
|
-
label: 'State',
|
|
47
|
-
placeholder: '',
|
|
48
|
-
name: '',
|
|
49
|
-
menuProps: 'auto',
|
|
50
|
-
reverseArrowControls: false,
|
|
51
|
-
validateOnBlur: false,
|
|
52
|
-
autoComplete: '',
|
|
53
|
-
rules: [],
|
|
54
|
-
hasArrows: false,
|
|
55
|
-
},
|
|
56
|
-
} as MetaStory;
|
|
57
|
-
|
|
58
|
-
const AppSelect = (props: SelectProps): ReactElement => {
|
|
59
|
-
const { selected } = props;
|
|
60
|
-
|
|
61
|
-
const [data, setData] = useState(selected);
|
|
62
|
-
const onSelect = (x: any) => {
|
|
63
|
-
setData(x);
|
|
64
|
-
};
|
|
65
|
-
return (
|
|
66
|
-
<NsSelect
|
|
67
|
-
{...props}
|
|
68
|
-
selected={data}
|
|
69
|
-
onSelect={onSelect}
|
|
70
|
-
label={props.label}
|
|
71
|
-
options={props.options}
|
|
72
|
-
RenderOption={(props) => {
|
|
73
|
-
return <NsSelectOption {...props} key={props?.value} onClick={props.onClick} />;
|
|
74
|
-
}}
|
|
75
|
-
/>
|
|
76
|
-
);
|
|
77
|
-
};
|
|
78
|
-
export const Select: Story = {
|
|
79
|
-
render: (args, context) => {
|
|
80
|
-
const options = context.parameters.options;
|
|
81
|
-
return <AppSelect {...args} options={options} />;
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
export const SelectWithArrows: Story = {
|
|
85
|
-
render: (args, context) => {
|
|
86
|
-
const options = context.parameters.options;
|
|
87
|
-
return <AppSelect {...args} options={options} hasArrows />;
|
|
88
|
-
},
|
|
89
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export const countries = [
|
|
2
|
-
{ label: 'Alabama', value: 'AL' },
|
|
3
|
-
{ label: 'Alaska', value: 'AK' },
|
|
4
|
-
{ label: 'Arizona', value: 'AZ' },
|
|
5
|
-
{ label: 'Arkansas', value: 'AR' },
|
|
6
|
-
{ label: 'California', value: 'CA' },
|
|
7
|
-
{ label: 'Colorado', value: 'CO' },
|
|
8
|
-
{ label: 'Connecticut', value: 'CT' },
|
|
9
|
-
{ label: 'Delaware', value: 'DE' },
|
|
10
|
-
{ label: 'District of Columbia', value: 'DC' },
|
|
11
|
-
{ label: 'Florida', value: 'FL' },
|
|
12
|
-
{ label: 'Georgia', value: 'GA' },
|
|
13
|
-
{ label: 'Hawaii', value: 'HI' },
|
|
14
|
-
{ label: 'Idaho', value: 'ID' },
|
|
15
|
-
{ label: 'Illinois', value: 'IL' },
|
|
16
|
-
{ label: 'Indiana', value: 'IN' },
|
|
17
|
-
{ label: 'Iowa', value: 'IA' },
|
|
18
|
-
{ label: 'Kansas', value: 'KA' },
|
|
19
|
-
{ label: 'Kentucky', value: 'KY' },
|
|
20
|
-
{ label: 'Louisiana', value: 'LA' },
|
|
21
|
-
{ label: 'Maine', value: 'ME' },
|
|
22
|
-
{ label: 'Maryland', value: 'MY' },
|
|
23
|
-
{ label: 'Massachusetts', value: 'MA' },
|
|
24
|
-
{ label: 'Michigan', value: 'MC' },
|
|
25
|
-
{ label: 'Minnesota', value: 'MN' },
|
|
26
|
-
{ label: 'Mississippi', value: 'MI' },
|
|
27
|
-
{ label: 'Missouri', value: 'MO' },
|
|
28
|
-
{ label: 'Montana', value: 'MT' },
|
|
29
|
-
{ label: 'Nebraska', value: 'NE' },
|
|
30
|
-
{ label: 'Nevada', value: 'NA' },
|
|
31
|
-
{ label: 'New Hampshire', value: 'NH' },
|
|
32
|
-
{ label: 'New Jersey', value: 'NJ' },
|
|
33
|
-
{ label: 'New Mexico', value: 'NM' },
|
|
34
|
-
{ label: 'New York', value: 'NY' },
|
|
35
|
-
{ label: 'North Carolina', value: 'NC' },
|
|
36
|
-
{ label: 'North Dakota', value: 'CD' },
|
|
37
|
-
{ label: 'Ohio', value: 'OH' },
|
|
38
|
-
{ label: 'Oklahoma', value: 'OK' },
|
|
39
|
-
{ label: 'Oregon', value: 'OR' },
|
|
40
|
-
{ label: 'Pennsylvania', value: 'PA' },
|
|
41
|
-
{ label: 'Rhode Island', value: 'RI' },
|
|
42
|
-
{ label: 'South Carolina', value: 'SC' },
|
|
43
|
-
{ label: 'South Dakota', value: 'SD' },
|
|
44
|
-
{ label: 'Tennessee', value: 'TN' },
|
|
45
|
-
{ label: 'Texas', value: 'TX' },
|
|
46
|
-
{ label: 'Utah', value: 'UT' },
|
|
47
|
-
{ label: 'Vermont', value: 'VT' },
|
|
48
|
-
{ label: 'Virginia', value: 'VA' },
|
|
49
|
-
{ label: 'Washington', value: 'WA' },
|
|
50
|
-
{ label: 'West Virginia', value: 'WV' },
|
|
51
|
-
{ label: 'Wisconsin', value: 'WN' },
|
|
52
|
-
{ label: 'Wyoming', value: 'WY' },
|
|
53
|
-
];
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { FoundationTheme } from '@nuskin/foundation-theme';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
export interface SelectProps {
|
|
5
|
-
selected: LabelValueType;
|
|
6
|
-
onSelect(arg: LabelValueType): void; // eslint-disable-line
|
|
7
|
-
children?: ReactNode | null;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
type?: 'outlined' | 'unfilled';
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
selectBorderColor?: FoundationTheme.PaletteColors;
|
|
12
|
-
closeOnMouseLeave?: boolean;
|
|
13
|
-
showListDivider?: boolean;
|
|
14
|
-
label?: string;
|
|
15
|
-
readOnly?: boolean;
|
|
16
|
-
name?: string;
|
|
17
|
-
errorMessage?: string;
|
|
18
|
-
menuProps?: string | object;
|
|
19
|
-
reverseArrowControls?: boolean;
|
|
20
|
-
validateOnBlur?: boolean;
|
|
21
|
-
autoComplete?: string;
|
|
22
|
-
// eslint-disable-next-line no-undef
|
|
23
|
-
rules?: Array;
|
|
24
|
-
hasArrows?: boolean;
|
|
25
|
-
options: LabelValueType[];
|
|
26
|
-
RenderOption?(x: any): any; // eslint-disable-line
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface SelectOptionProps {
|
|
30
|
-
value: string;
|
|
31
|
-
label: string;
|
|
32
|
-
selected?: LabelValueType;
|
|
33
|
-
index: number;
|
|
34
|
-
onClick: () => void;
|
|
35
|
-
showListDivider?: boolean;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type LabelValueType = {
|
|
39
|
-
label: string;
|
|
40
|
-
value: string;
|
|
41
|
-
id?: string;
|
|
42
|
-
index?: number;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export type RenderSelectOptionArgType = LabelValueType & {
|
|
46
|
-
onClick(): void;
|
|
47
|
-
showListDivider: boolean;
|
|
48
|
-
selected: LabelValueType;
|
|
49
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen } from '@/test-utils/index';
|
|
3
|
-
import NsSpinner from './NsSpinner';
|
|
4
|
-
|
|
5
|
-
describe('NsSpinner', () => {
|
|
6
|
-
test('1.renders spinner', () => {
|
|
7
|
-
const { container } = render(<NsSpinner additionalProps={{ 'data-testid': 'spinner' }} />);
|
|
8
|
-
|
|
9
|
-
expect(screen.getByTestId('spinner')).toBeInTheDocument();
|
|
10
|
-
expect(container.getElementsByTagName('svg')).toHaveLength(1);
|
|
11
|
-
expect(screen.getByTestId('spinner')).toHaveStyle('width:100px');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
test('2.renders spinner with different size', () => {
|
|
15
|
-
render(<NsSpinner size={200} additionalProps={{ 'data-testid': 'spinner' }} />);
|
|
16
|
-
|
|
17
|
-
expect(screen.getByTestId('spinner')).toBeInTheDocument();
|
|
18
|
-
expect(screen.getByTestId('spinner')).toHaveStyle('width:200px');
|
|
19
|
-
expect(screen.getByTestId('spinner')).toHaveStyle('height:200px');
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
|
|
3
|
-
import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
|
|
4
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
-
|
|
6
|
-
import NsSpinner from './NsSpinner';
|
|
7
|
-
|
|
8
|
-
type ComponentType = typeof NsSpinner;
|
|
9
|
-
type Story = StoryObj<ComponentType>;
|
|
10
|
-
type MetaStory = Meta<ComponentType>;
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
title: 'Components/Feedback/NsSpinner',
|
|
14
|
-
component: NsSpinner,
|
|
15
|
-
decorators: [
|
|
16
|
-
(Story): ReactElement => (
|
|
17
|
-
<div className="flex place-content-center">
|
|
18
|
-
<Story />
|
|
19
|
-
</div>
|
|
20
|
-
),
|
|
21
|
-
withCenterDecorator,
|
|
22
|
-
],
|
|
23
|
-
argTypes: {},
|
|
24
|
-
args: {
|
|
25
|
-
size: 200,
|
|
26
|
-
},
|
|
27
|
-
} as MetaStory;
|
|
28
|
-
|
|
29
|
-
export const Spinner: Story = {};
|