@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.
Files changed (371) hide show
  1. package/dist/index.d.mts +1221 -0
  2. package/dist/index.d.ts +1221 -0
  3. package/dist/index.js +1 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +1 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +33 -10
  8. package/src/common/accordion/NsAccordion.tsx +0 -82
  9. package/src/common/accordion/NsAccordionHeader.tsx +0 -85
  10. package/src/common/accordion/NsAccordionItem.tsx +0 -65
  11. package/src/common/accordion/NsCollapse.tsx +0 -121
  12. package/src/common/accordion/NsToggleSection.tsx +0 -50
  13. package/src/common/accordion/ToggleSection.styled.tsx +0 -32
  14. package/src/common/accordion/colorMap.ts +0 -60
  15. package/src/common/accordion/enums.ts +0 -18
  16. package/src/common/accordion/index.ts +0 -7
  17. package/src/common/accordion/specs/NsAccordion.spec.tsx +0 -183
  18. package/src/common/accordion/specs/NsAccordionHeader.spec.tsx +0 -172
  19. package/src/common/accordion/specs/NsAccordionItem.spec.tsx +0 -79
  20. package/src/common/accordion/specs/NsCollapse.spec.tsx +0 -130
  21. package/src/common/accordion/specs/NsToggleSection.spec.tsx +0 -74
  22. package/src/common/accordion/stories/NsAccordion.stories.tsx +0 -65
  23. package/src/common/accordion/stories/NsAccordionHeader.stories.tsx +0 -44
  24. package/src/common/accordion/stories/NsAccordionItem.stories.tsx +0 -48
  25. package/src/common/accordion/stories/NsCollapse.stories.tsx +0 -53
  26. package/src/common/accordion/stories/NsToggleSection.stories.tsx +0 -27
  27. package/src/common/accordion/stories/data.tsx +0 -145
  28. package/src/common/accordion/types.d.ts +0 -90
  29. package/src/common/alert/Header.tsx +0 -29
  30. package/src/common/alert/NsAlert.spec.tsx +0 -167
  31. package/src/common/alert/NsAlert.stories.tsx +0 -45
  32. package/src/common/alert/NsAlert.styled.tsx +0 -114
  33. package/src/common/alert/NsAlert.tsx +0 -93
  34. package/src/common/alert/index.ts +0 -2
  35. package/src/common/alert/types.d.ts +0 -45
  36. package/src/common/auth-dropdown/NsAuthDropdown.spec.tsx +0 -54
  37. package/src/common/auth-dropdown/NsAuthDropdown.stories.tsx +0 -25
  38. package/src/common/auth-dropdown/NsAuthDropdown.styled.ts +0 -120
  39. package/src/common/auth-dropdown/NsAuthDropdown.tsx +0 -72
  40. package/src/common/auth-dropdown/index.ts +0 -2
  41. package/src/common/auth-dropdown/types.d.ts +0 -11
  42. package/src/common/autocomplete/NsAutocomplete.spec.tsx +0 -91
  43. package/src/common/autocomplete/NsAutocomplete.styled.tsx +0 -24
  44. package/src/common/autocomplete/NsAutocomplete.tsx +0 -225
  45. package/src/common/autocomplete/helper/LineLoader.tsx +0 -38
  46. package/src/common/autocomplete/helper/RecentClearAll.tsx +0 -43
  47. package/src/common/autocomplete/helper/SeeMoreButton.tsx +0 -68
  48. package/src/common/autocomplete/helper/index.ts +0 -4
  49. package/src/common/autocomplete/helper/renderGroupName.tsx +0 -26
  50. package/src/common/autocomplete/index.ts +0 -2
  51. package/src/common/autocomplete/mock/Mock.styled.tsx +0 -23
  52. package/src/common/autocomplete/mock/MockData.ts +0 -89
  53. package/src/common/autocomplete/mock/MockUI.tsx +0 -26
  54. package/src/common/autocomplete/stories/NoCloseAutoComplete.tsx +0 -49
  55. package/src/common/autocomplete/stories/NsAutocomplete.stories.tsx +0 -78
  56. package/src/common/autocomplete/stories/RenderAutoComplete.tsx +0 -60
  57. package/src/common/autocomplete/types.d.ts +0 -67
  58. package/src/common/banner/NsBanner.spec.tsx +0 -28
  59. package/src/common/banner/NsBanner.stories.tsx +0 -47
  60. package/src/common/banner/NsBanner.styled.tsx +0 -24
  61. package/src/common/banner/NsBanner.tsx +0 -32
  62. package/src/common/banner/index.ts +0 -2
  63. package/src/common/banner/types.d.ts +0 -14
  64. package/src/common/brand-components/NsBrand.stories.tsx +0 -26
  65. package/src/common/brand-components/NsBrandComponent.spec.tsx +0 -47
  66. package/src/common/brand-components/NsBrandComponent.tsx +0 -33
  67. package/src/common/brand-components/NsBrandContainer.styled.tsx +0 -10
  68. package/src/common/brand-components/icons/Logo.spec.tsx +0 -84
  69. package/src/common/brand-components/icons/NSLogoHorizontal.tsx +0 -70
  70. package/src/common/brand-components/icons/NSLogoMark.tsx +0 -39
  71. package/src/common/brand-components/icons/NSLogoPoweredBy.tsx +0 -103
  72. package/src/common/brand-components/icons/NSLogoStacked.tsx +0 -57
  73. package/src/common/brand-components/icons/NSWordMark.tsx +0 -60
  74. package/src/common/brand-components/index.ts +0 -2
  75. package/src/common/brand-components/types.d.ts +0 -11
  76. package/src/common/breadcrumb/NsBreadcrumb.spec.tsx +0 -28
  77. package/src/common/breadcrumb/NsBreadcrumb.stories.tsx +0 -39
  78. package/src/common/breadcrumb/NsBreadcrumb.styled.tsx +0 -36
  79. package/src/common/breadcrumb/NsBreadcrumb.tsx +0 -85
  80. package/src/common/breadcrumb/data.ts +0 -10
  81. package/src/common/breadcrumb/index.ts +0 -2
  82. package/src/common/breadcrumb/types.d.ts +0 -14
  83. package/src/common/button/NsButton.spec.tsx +0 -94
  84. package/src/common/button/NsButton.stories.tsx +0 -118
  85. package/src/common/button/NsButton.styled.tsx +0 -57
  86. package/src/common/button/NsButton.tsx +0 -48
  87. package/src/common/button/__snapshots__/NsButton.spec.tsx.snap +0 -120
  88. package/src/common/button/helper.ts +0 -84
  89. package/src/common/button/index.ts +0 -2
  90. package/src/common/button/types.d.ts +0 -26
  91. package/src/common/card/CardButton.tsx +0 -58
  92. package/src/common/card/NsAwardCard.tsx +0 -71
  93. package/src/common/card/NsBgCard.tsx +0 -26
  94. package/src/common/card/NsBrandCard.tsx +0 -88
  95. package/src/common/card/NsBrandLogo.tsx +0 -16
  96. package/src/common/card/NsBrandWrapper.tsx +0 -25
  97. package/src/common/card/NsCheckoutCard.tsx +0 -107
  98. package/src/common/card/NsHeroCardLevel1.tsx +0 -105
  99. package/src/common/card/NsHeroCardLevel2.tsx +0 -95
  100. package/src/common/card/NsIconText.tsx +0 -165
  101. package/src/common/card/NsLargeCard.tsx +0 -108
  102. package/src/common/card/NsMediumCard.tsx +0 -110
  103. package/src/common/card/NsPost.tsx +0 -78
  104. package/src/common/card/NsSmallFullCard.tsx +0 -93
  105. package/src/common/card/NsXLargeCard.tsx +0 -89
  106. package/src/common/card/cardSizes.ts +0 -12
  107. package/src/common/card/fixtures/ImageData1.ts +0 -38
  108. package/src/common/card/fixtures/ImageData2.ts +0 -38
  109. package/src/common/card/index.ts +0 -15
  110. package/src/common/card/specs/BrandLogo.spec.tsx +0 -13
  111. package/src/common/card/specs/NsAwardCard.spec.tsx +0 -29
  112. package/src/common/card/specs/NsBgCard.spec.tsx +0 -23
  113. package/src/common/card/specs/NsBrandCard.spec.tsx +0 -84
  114. package/src/common/card/specs/NsCheckoutCard.spec.tsx +0 -39
  115. package/src/common/card/specs/NsHeroCardLevel1.spec.tsx +0 -39
  116. package/src/common/card/specs/NsHeroCardLevel2.spec.tsx +0 -49
  117. package/src/common/card/specs/NsIconText.spec.tsx +0 -25
  118. package/src/common/card/specs/NsLargeCard.spec.tsx +0 -47
  119. package/src/common/card/specs/NsMediumCard.spec.tsx +0 -51
  120. package/src/common/card/specs/NsPost.spec.tsx +0 -28
  121. package/src/common/card/specs/NsSmallFullCard.spec.tsx +0 -47
  122. package/src/common/card/specs/NsXLargeCard.spec.tsx +0 -47
  123. package/src/common/card/stories/NsAwardCard.stories.tsx +0 -21
  124. package/src/common/card/stories/NsBrandCard.stories.tsx +0 -32
  125. package/src/common/card/stories/NsCheckoutCard.stories.tsx +0 -23
  126. package/src/common/card/stories/NsHeroCardLevel1.stories.tsx +0 -30
  127. package/src/common/card/stories/NsHeroCardLevel2.stories.tsx +0 -29
  128. package/src/common/card/stories/NsIconText.stories.tsx +0 -18
  129. package/src/common/card/stories/NsLargeCard.stories.tsx +0 -32
  130. package/src/common/card/stories/NsMediumCard.stories.tsx +0 -34
  131. package/src/common/card/stories/NsPost.stories.tsx +0 -20
  132. package/src/common/card/stories/NsSmallFullCard.stories.tsx +0 -31
  133. package/src/common/card/stories/NsXLargeCard.stories.tsx +0 -32
  134. package/src/common/card/stories/data.ts +0 -43
  135. package/src/common/card/types.d.ts +0 -25
  136. package/src/common/carousal/CarousalControl.tsx +0 -47
  137. package/src/common/carousal/IconWrapper.tsx +0 -33
  138. package/src/common/carousal/NsCarousal.tsx +0 -65
  139. package/src/common/carousal/NsScrollingCarousal.tsx +0 -60
  140. package/src/common/carousal/RenderBrand.tsx +0 -20
  141. package/src/common/carousal/index.ts +0 -5
  142. package/src/common/carousal/slickSetting.ts +0 -61
  143. package/src/common/carousal/specs/Chevron.spec.tsx +0 -10
  144. package/src/common/carousal/specs/NsCarousal.spec.tsx +0 -112
  145. package/src/common/carousal/specs/NsScrollingCarousal.spec.tsx +0 -63
  146. package/src/common/carousal/specs/RenderBrand.spec.tsx +0 -22
  147. package/src/common/carousal/stories/NsCarousal1.stories.tsx +0 -34
  148. package/src/common/carousal/stories/NsScrollingCarousal.stories.tsx +0 -80
  149. package/src/common/carousal/types.d.ts +0 -23
  150. package/src/common/cart-icon/NsCartIcon.spec.tsx +0 -19
  151. package/src/common/cart-icon/NsCartIcon.stories.tsx +0 -28
  152. package/src/common/cart-icon/NsCartIcon.styled.tsx +0 -15
  153. package/src/common/cart-icon/NsCartIcon.tsx +0 -24
  154. package/src/common/cart-icon/index.ts +0 -2
  155. package/src/common/cart-icon/types.d.ts +0 -8
  156. package/src/common/checkbox/NsCheckbox.spec.tsx +0 -57
  157. package/src/common/checkbox/NsCheckbox.stories.tsx +0 -55
  158. package/src/common/checkbox/NsCheckbox.styled.tsx +0 -55
  159. package/src/common/checkbox/NsCheckbox.tsx +0 -68
  160. package/src/common/checkbox/index.ts +0 -2
  161. package/src/common/checkbox/types.d.ts +0 -20
  162. package/src/common/column-control/NsColumnControl.tsx +0 -64
  163. package/src/common/column-control/NsFlexColumns.tsx +0 -29
  164. package/src/common/column-control/NsGridColumns.tsx +0 -29
  165. package/src/common/column-control/index.ts +0 -4
  166. package/src/common/column-control/specs/NsColumnControl.spec.tsx +0 -24
  167. package/src/common/column-control/specs/NsFlexColumns.spec.tsx +0 -24
  168. package/src/common/column-control/specs/NsGridColumns.spec.tsx +0 -24
  169. package/src/common/column-control/stories/DivArray.stories.tsx +0 -18
  170. package/src/common/column-control/stories/DivArray.tsx +0 -63
  171. package/src/common/column-control/stories/NsColumnControl.stories.tsx +0 -65
  172. package/src/common/column-control/stories/NsFlexColumns.stories.tsx +0 -66
  173. package/src/common/column-control/stories/NsGridColumns.stories.tsx +0 -75
  174. package/src/common/column-control/stories/common.tsx +0 -14
  175. package/src/common/column-control/styled/StyledFlex.tsx +0 -46
  176. package/src/common/column-control/styled/StyledGrid.tsx +0 -41
  177. package/src/common/column-control/styled/common.ts +0 -27
  178. package/src/common/column-control/types.d.ts +0 -46
  179. package/src/common/column-control/utils.ts +0 -66
  180. package/src/common/common.types.d.ts +0 -21
  181. package/src/common/dropdown/NsDropdown.spec.tsx +0 -126
  182. package/src/common/dropdown/NsDropdown.styled.tsx +0 -66
  183. package/src/common/dropdown/NsDropdown.tsx +0 -94
  184. package/src/common/dropdown/NsDropdownOption.tsx +0 -13
  185. package/src/common/dropdown/index.ts +0 -3
  186. package/src/common/dropdown/stories/NsDropdown.stories.tsx +0 -67
  187. package/src/common/dropdown/stories/NsDropdownCountry.stories.tsx +0 -64
  188. package/src/common/dropdown/types.d.ts +0 -23
  189. package/src/common/email-simple/NsEmailSimple.spec.tsx +0 -115
  190. package/src/common/email-simple/NsEmailSimple.stories.tsx +0 -61
  191. package/src/common/email-simple/NsEmailSimple.tsx +0 -72
  192. package/src/common/email-simple/index.ts +0 -2
  193. package/src/common/email-simple/types.d.ts +0 -14
  194. package/src/common/flag/NsFlag.spec.tsx +0 -27
  195. package/src/common/flag/NsFlag.stories.tsx +0 -22
  196. package/src/common/flag/NsFlag.styled.tsx +0 -73
  197. package/src/common/flag/NsFlag.tsx +0 -24
  198. package/src/common/flag/index.ts +0 -2
  199. package/src/common/flag/types.d.ts +0 -16
  200. package/src/common/hooks/index.ts +0 -2
  201. package/src/common/hooks/specs/useWindowSize.spec.tsx +0 -19
  202. package/src/common/hooks/useAccordionMap.tsx +0 -39
  203. package/src/common/hooks/useOnClickOutside.tsx +0 -25
  204. package/src/common/hooks/useWindowSize.tsx +0 -30
  205. package/src/common/icon/NsIcon.spec.tsx +0 -51
  206. package/src/common/icon/NsIcon.stories.tsx +0 -77
  207. package/src/common/icon/NsIcon.styled.tsx +0 -27
  208. package/src/common/icon/NsIcon.tsx +0 -44
  209. package/src/common/icon/NsIconVariants.ts +0 -56
  210. package/src/common/icon/icons/AlertErrorIcon.tsx +0 -48
  211. package/src/common/icon/icons/ArrowDown.tsx +0 -23
  212. package/src/common/icon/icons/ArrowLeft.tsx +0 -38
  213. package/src/common/icon/icons/ArrowRight.tsx +0 -39
  214. package/src/common/icon/icons/ArrowUp.tsx +0 -20
  215. package/src/common/icon/icons/Cart.tsx +0 -23
  216. package/src/common/icon/icons/CartBadge.tsx +0 -47
  217. package/src/common/icon/icons/Check.tsx +0 -30
  218. package/src/common/icon/icons/CheckShield.tsx +0 -24
  219. package/src/common/icon/icons/CheckVerified.tsx +0 -27
  220. package/src/common/icon/icons/ChevronRight.tsx +0 -31
  221. package/src/common/icon/icons/CloseIcon.tsx +0 -27
  222. package/src/common/icon/icons/ErrorIcon.tsx +0 -30
  223. package/src/common/icon/icons/HamburgerIcon.tsx +0 -35
  224. package/src/common/icon/icons/InfoFilled.tsx +0 -21
  225. package/src/common/icon/icons/InfoOutlined.tsx +0 -42
  226. package/src/common/icon/icons/RoundedClose.tsx +0 -31
  227. package/src/common/icon/icons/SearchIcon.tsx +0 -32
  228. package/src/common/icon/icons/SlashIcon.tsx +0 -22
  229. package/src/common/icon/icons/SuccessIcon.tsx +0 -40
  230. package/src/common/icon/icons/TrashIcon.tsx +0 -32
  231. package/src/common/icon/icons/UserIcon.tsx +0 -37
  232. package/src/common/icon/icons/UserOutline.tsx +0 -29
  233. package/src/common/icon/icons/WarningIcon.tsx +0 -48
  234. package/src/common/icon/icons/error.svg +0 -3
  235. package/src/common/icon/icons/home.tsx +0 -19
  236. package/src/common/icon/icons/search.svg +0 -3
  237. package/src/common/icon/icons/success.svg +0 -10
  238. package/src/common/icon/icons/trash.svg +0 -3
  239. package/src/common/icon/index.ts +0 -3
  240. package/src/common/icon/types.d.ts +0 -53
  241. package/src/common/image/BynderMedia.spec.tsx +0 -42
  242. package/src/common/image/BynderMedia.tsx +0 -49
  243. package/src/common/image/NsImage.spec.tsx +0 -60
  244. package/src/common/image/NsImage.stories.tsx +0 -46
  245. package/src/common/image/NsImage.tsx +0 -33
  246. package/src/common/image/NsNextImage.spec.tsx +0 -10
  247. package/src/common/image/NsNextImage.stories.tsx +0 -51
  248. package/src/common/image/NsNextImage.tsx +0 -11
  249. package/src/common/image/bynder-util.spec.ts +0 -187
  250. package/src/common/image/bynder-util.ts +0 -98
  251. package/src/common/image/index.ts +0 -3
  252. package/src/common/image/types.ts +0 -78
  253. package/src/common/index.ts +0 -37
  254. package/src/common/input/InputFieldWrapper.tsx +0 -24
  255. package/src/common/input/InputWrapper.tsx +0 -82
  256. package/src/common/input/NsInputField.spec.tsx +0 -25
  257. package/src/common/input/NsInputField.stories.tsx +0 -61
  258. package/src/common/input/NsInputField.tsx +0 -125
  259. package/src/common/input/getAdornmentProps.tsx +0 -50
  260. package/src/common/input/index.ts +0 -2
  261. package/src/common/input/types.d.ts +0 -45
  262. package/src/common/label/NsLabel.spec.tsx +0 -11
  263. package/src/common/label/NsLabel.stories.tsx +0 -35
  264. package/src/common/label/NsLabel.tsx +0 -43
  265. package/src/common/label/index.ts +0 -2
  266. package/src/common/label/types.d.ts +0 -10
  267. package/src/common/link/NsLink.spec.tsx +0 -106
  268. package/src/common/link/NsLink.stories.tsx +0 -55
  269. package/src/common/link/NsLink.styled.tsx +0 -100
  270. package/src/common/link/NsLink.tsx +0 -122
  271. package/src/common/link/index.ts +0 -2
  272. package/src/common/link/types.d.ts +0 -22
  273. package/src/common/modal/NsModal.spec.tsx +0 -46
  274. package/src/common/modal/NsModal.styled.tsx +0 -28
  275. package/src/common/modal/NsModal.tsx +0 -43
  276. package/src/common/modal/helper-component/NsModalContentBox.tsx +0 -37
  277. package/src/common/modal/helper-component/NsModalDefault.tsx +0 -34
  278. package/src/common/modal/helper-component/NsModalStatus.tsx +0 -17
  279. package/src/common/modal/helper-component/NsModalStatusIcon.tsx +0 -16
  280. package/src/common/modal/helper-component/NsModalTitle.tsx +0 -29
  281. package/src/common/modal/index.ts +0 -2
  282. package/src/common/modal/model/NsModalVariantMap.tsx +0 -24
  283. package/src/common/modal/stories/NsModal.stories.tsx +0 -87
  284. package/src/common/modal/stories/mock.tsx +0 -46
  285. package/src/common/modal/types.ts +0 -57
  286. package/src/common/nav-product-card/NsNavProductCard.spec.tsx +0 -22
  287. package/src/common/nav-product-card/NsNavProductCard.stories.tsx +0 -25
  288. package/src/common/nav-product-card/NsNavProductCard.styled.tsx +0 -24
  289. package/src/common/nav-product-card/NsNavProductCard.tsx +0 -27
  290. package/src/common/nav-product-card/index.ts +0 -2
  291. package/src/common/nav-product-card/types.d.ts +0 -9
  292. package/src/common/nav-tab/NavDrawer.tsx +0 -41
  293. package/src/common/nav-tab/NavTitles.tsx +0 -64
  294. package/src/common/nav-tab/NsNavTab.spec.tsx +0 -64
  295. package/src/common/nav-tab/NsNavTab.stories.tsx +0 -36
  296. package/src/common/nav-tab/NsNavTab.styled.tsx +0 -74
  297. package/src/common/nav-tab/NsNavTab.tsx +0 -43
  298. package/src/common/nav-tab/index.ts +0 -2
  299. package/src/common/nav-tab/types.d.ts +0 -21
  300. package/src/common/progress/NsProgress.spec.tsx +0 -47
  301. package/src/common/progress/NsProgress.stories.tsx +0 -45
  302. package/src/common/progress/NsProgress.styled.tsx +0 -56
  303. package/src/common/progress/NsProgress.tsx +0 -29
  304. package/src/common/progress/index.ts +0 -2
  305. package/src/common/progress/types.d.ts +0 -21
  306. package/src/common/radiogroup/NsRadioGroup.spec.tsx +0 -63
  307. package/src/common/radiogroup/NsRadioGroup.stories.tsx +0 -84
  308. package/src/common/radiogroup/NsRadioGroup.styled.tsx +0 -51
  309. package/src/common/radiogroup/NsRadioGroup.tsx +0 -65
  310. package/src/common/radiogroup/index.ts +0 -2
  311. package/src/common/radiogroup/types.d.ts +0 -19
  312. package/src/common/search-bar/NsSeachBar.spec.tsx +0 -9
  313. package/src/common/search-bar/NsSearchBar.tsx +0 -46
  314. package/src/common/select/DefaultRenderOption.tsx +0 -8
  315. package/src/common/select/NsSelect.styled.tsx +0 -102
  316. package/src/common/select/NsSelect.tsx +0 -166
  317. package/src/common/select/NsSelectOption.tsx +0 -26
  318. package/src/common/select/constant.ts +0 -30
  319. package/src/common/select/index.ts +0 -3
  320. package/src/common/select/specs/NsSelect.spec.tsx +0 -183
  321. package/src/common/select/specs/NsSelectOption.spec.tsx +0 -32
  322. package/src/common/select/stories/NsSelect.stories.tsx +0 -89
  323. package/src/common/select/stories/countries.ts +0 -53
  324. package/src/common/select/types.d.ts +0 -49
  325. package/src/common/spinner/NsSpinner.spec.tsx +0 -21
  326. package/src/common/spinner/NsSpinner.stories.tsx +0 -29
  327. package/src/common/spinner/NsSpinner.styled.tsx +0 -344
  328. package/src/common/spinner/NsSpinner.tsx +0 -15
  329. package/src/common/spinner/icons/Spinner.tsx +0 -163
  330. package/src/common/spinner/index.ts +0 -2
  331. package/src/common/spinner/types.ts +0 -5
  332. package/src/common/table/NsExpandableRow.tsx +0 -62
  333. package/src/common/table/NsTable.spec.tsx +0 -174
  334. package/src/common/table/NsTable.stories.tsx +0 -156
  335. package/src/common/table/NsTable.styled.ts +0 -127
  336. package/src/common/table/NsTable.tsx +0 -150
  337. package/src/common/table/NsTableHeader.tsx +0 -54
  338. package/src/common/table/NsTablePagination.tsx +0 -24
  339. package/src/common/table/helper.ts +0 -33
  340. package/src/common/table/index.ts +0 -2
  341. package/src/common/table/types.d.ts +0 -57
  342. package/src/common/text-strip/NsTextStrip.spec.tsx +0 -27
  343. package/src/common/text-strip/NsTextStrip.stories.tsx +0 -61
  344. package/src/common/text-strip/NsTextStrip.tsx +0 -61
  345. package/src/common/text-strip/index.ts +0 -2
  346. package/src/common/text-strip/types.d.ts +0 -16
  347. package/src/common/toast/Fade.tsx +0 -98
  348. package/src/common/toast/ToastProvider.tsx +0 -88
  349. package/src/common/toast/index.ts +0 -3
  350. package/src/common/toast/shared.ts +0 -124
  351. package/src/common/toast/specs/Toast.spec.tsx +0 -122
  352. package/src/common/toast/stories/Toast.stories.tsx +0 -82
  353. package/src/common/toast/useToast.tsx +0 -65
  354. package/src/common/typography/GlobalFontInter.tsx +0 -15
  355. package/src/common/typography/HtmlTagVariantMap.tsx +0 -24
  356. package/src/common/typography/NsTypography.spec.tsx +0 -37
  357. package/src/common/typography/NsTypography.stories.tsx +0 -27
  358. package/src/common/typography/NsTypography.tsx +0 -44
  359. package/src/common/typography/Typography.styled.tsx +0 -195
  360. package/src/common/typography/__snapshots__/NsTypography.spec.tsx.snap +0 -22
  361. package/src/common/typography/index.ts +0 -3
  362. package/src/common/typography/types.d.ts +0 -37
  363. package/src/common/util.ts +0 -3
  364. package/src/common/utility/Show.tsx +0 -13
  365. package/src/common/utility/index.ts +0 -1
  366. package/src/common/validations/regex.ts +0 -2
  367. package/src/common/videos/NsVideo.spec.tsx +0 -26
  368. package/src/common/videos/NsVideo.stories.tsx +0 -32
  369. package/src/common/videos/NsVideo.tsx +0 -28
  370. package/src/common/videos/index.ts +0 -2
  371. 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 = {};