@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 React from 'react';
2
- import { render, fireEvent, screen } from '@/test-utils/index';
3
- import { AccordionContentTypeObject, AccordionItem, AccordionVariant, NsAccordion } from '@/common/index';
4
-
5
- const generateContentArray = (count: number, isDefaultOpen = true) => {
6
- const arr = [] as AccordionItem[];
7
- for (let i = 1; i <= count; i++) {
8
- arr?.push({
9
- title: `Title ${i}`,
10
- content: <div className="p-2">Content {i}</div>,
11
- isDefaultOpen,
12
- type: AccordionContentTypeObject.jsx,
13
- id: `Test ${i}`,
14
- });
15
- }
16
- return arr;
17
- };
18
-
19
- describe('NsAccordion', () => {
20
- const items = generateContentArray(3);
21
- const defaultProps = {
22
- additionalProps: {
23
- testid: 'test-accordion',
24
- },
25
- allowMultipleExpanded: false,
26
- items,
27
- variant: AccordionVariant.Basic,
28
- invert: false,
29
- level: 0,
30
- };
31
-
32
- it('1. renders without error', () => {
33
- const { getByTestId } = render(<NsAccordion {...defaultProps} />);
34
- const accordion = getByTestId(defaultProps.additionalProps.testid);
35
- expect(accordion).toBeInTheDocument();
36
- });
37
-
38
- it(`2. only first section should be visible when allowMultipleExpanded prop is false and multiple items have
39
- isDefaultOpen true`, () => {
40
- const { getAllByText } = render(<NsAccordion {...defaultProps} />);
41
- const [title1, title2, title3] = getAllByText(/Title /i);
42
-
43
- expect(title1.closest('header')).toHaveAttribute('aria-expanded', 'true');
44
- expect(title2.closest('header')).toHaveAttribute('aria-expanded', 'false');
45
- expect(title3.closest('header')).toHaveAttribute('aria-expanded', 'false');
46
- const [c1, c2, c3] = getAllByText(/Content /i);
47
- expect(c1.parentNode).toHaveStyle('opacity: 1');
48
- expect(c2.parentNode).toHaveStyle('opacity: 0');
49
- expect(c3.parentNode).toHaveStyle('opacity: 0');
50
- });
51
-
52
- it(`3. expands second section only when allowMultipleExpanded
53
- prop is false and second title is clicked`, async () => {
54
- const { getAllByText } = render(<NsAccordion {...defaultProps} />);
55
- const [title1, title2, title3] = getAllByText(/Title /i);
56
- const header = title2.closest('header');
57
- expect(header).toHaveAttribute('aria-expanded', 'false');
58
- if (header) {
59
- fireEvent.click(header);
60
- expect(title1.closest('header')).toHaveAttribute('aria-expanded', 'false');
61
- expect(title2.closest('header')).toHaveAttribute('aria-expanded', 'true');
62
- expect(title3.closest('header')).toHaveAttribute('aria-expanded', 'false');
63
- const [c1, c2, c3] = getAllByText(/Content /i);
64
- expect(c1.parentNode).toHaveStyle('opacity: 0');
65
- expect(c2.parentNode).toHaveStyle('opacity: 1');
66
- expect(c3.parentNode).toHaveStyle('opacity: 0');
67
- }
68
- });
69
-
70
- it('4. expands multiple sections by default when allowMultipleExpanded prop is true', () => {
71
- const items = generateContentArray(3);
72
- items[2].isDefaultOpen = false;
73
- const defaultProps = {
74
- allowMultipleExpanded: false,
75
- items,
76
- variant: AccordionVariant.Basic,
77
- level: 0,
78
- invert: false,
79
- };
80
- const { getAllByText } = render(<NsAccordion {...defaultProps} allowMultipleExpanded />);
81
- const accordion = screen.getByTestId('ns-accordion-testid');
82
- expect(accordion).toBeDefined();
83
- const [title1, title2, title3] = getAllByText(/Title /i);
84
-
85
- expect(title1.closest('header')).toHaveAttribute('aria-expanded', 'true');
86
- expect(title2.closest('header')).toHaveAttribute('aria-expanded', 'true');
87
- expect(title3.closest('header')).toHaveAttribute('aria-expanded', 'false');
88
-
89
- const [c1, c2, c3] = getAllByText(/Content /i);
90
- expect(c1.parentNode).toHaveStyle('opacity: 1');
91
- expect(c2.parentNode).toHaveStyle('opacity: 1');
92
- expect(c3.parentNode).toHaveStyle('opacity: 0');
93
-
94
- fireEvent.click(title3);
95
-
96
- expect(title1.closest('header')).toHaveAttribute('aria-expanded', 'true');
97
- expect(title2.closest('header')).toHaveAttribute('aria-expanded', 'true');
98
- expect(title3.closest('header')).toHaveAttribute('aria-expanded', 'true');
99
-
100
- const [c11, c12, c13] = getAllByText(/Content /i);
101
- expect(c11.parentNode).toHaveStyle('opacity: 1');
102
- expect(c12.parentNode).toHaveStyle('opacity: 1');
103
- expect(c13.parentNode).toHaveStyle('opacity: 1');
104
- });
105
- it(`5. closes second section also when allowMultipleExpanded
106
- prop is true and second title is clicked`, async () => {
107
- const items = generateContentArray(3);
108
- const defaultProps = {
109
- additionalProps: {
110
- testid: 'test-accordion',
111
- },
112
- allowMultipleExpanded: true,
113
- items,
114
- variant: AccordionVariant.Basic,
115
- invert: false,
116
- level: 0,
117
- };
118
- const { getAllByText } = render(<NsAccordion {...defaultProps} />);
119
- const [title1, title2, title3] = getAllByText(/Title /i);
120
- const header = title2.closest('header');
121
- expect(header).toHaveAttribute('aria-expanded', 'true');
122
- if (header) {
123
- fireEvent.click(header);
124
- expect(title1.closest('header')).toHaveAttribute('aria-expanded', 'true');
125
- expect(title2.closest('header')).toHaveAttribute('aria-expanded', 'false');
126
- expect(title3.closest('header')).toHaveAttribute('aria-expanded', 'true');
127
-
128
- const [c1, c2, c3] = getAllByText(/Content /i);
129
- expect(c1.parentNode).toHaveStyle('opacity: 1');
130
- expect(c2.parentNode).toHaveStyle('opacity: 0');
131
- expect(c3.parentNode).toHaveStyle('opacity: 1');
132
- }
133
- });
134
- it(`6. closes second section also when allowMultipleExpanded
135
- prop is true and second title is clicked`, async () => {
136
- const items = generateContentArray(3, false);
137
- items[1].isDefaultOpen = true;
138
- const defaultProps = {
139
- additionalProps: {
140
- testid: 'test-accordion',
141
- },
142
- allowMultipleExpanded: false,
143
- items,
144
- variant: AccordionVariant.Compact,
145
- level: 0,
146
- invert: false,
147
- };
148
- const { getAllByText } = render(<NsAccordion {...defaultProps} />);
149
- const [title1, title2, title3] = getAllByText(/Title /i);
150
- const header = title2.closest('header');
151
- expect(header).toHaveAttribute('aria-expanded', 'true');
152
- if (header) {
153
- fireEvent.click(header);
154
- expect(title1.closest('header')).toHaveAttribute('aria-expanded', 'false');
155
- expect(title2.closest('header')).toHaveAttribute('aria-expanded', 'false');
156
- expect(title3.closest('header')).toHaveAttribute('aria-expanded', 'false');
157
- const [c1, c2, c3] = getAllByText(/Content /i);
158
- expect(c1.parentNode).toHaveStyle('opacity: 0');
159
- expect(c2.parentNode).toHaveStyle('opacity: 0');
160
- expect(c3.parentNode).toHaveStyle('opacity: 0');
161
- }
162
- });
163
- it('7. shows end icon only when showEndIconWhenEmpty is true', async () => {
164
- const items = generateContentArray(3, false);
165
- const defaultProps = {
166
- additionalProps: {
167
- testid: 'test-accordion',
168
- },
169
- allowMultipleExpanded: false,
170
- items,
171
- variant: AccordionVariant.Compact,
172
- level: 0,
173
- invert: false,
174
- showEndIconWhenEmpty: true,
175
- };
176
- const { getAllByTestId } = render(<NsAccordion {...defaultProps} />);
177
- const elements = getAllByTestId('arrowDown');
178
-
179
- elements.forEach((element) => {
180
- expect(element).toBeInTheDocument();
181
- });
182
- });
183
- });
@@ -1,172 +0,0 @@
1
- import React from 'react';
2
- import { render, fireEvent } from '@/test-utils/index';
3
- import { NsAccordionHeader, AccordionVariant, NsLink } from '@/common/index';
4
-
5
- const content = [
6
- {
7
- type: 'text',
8
- id: '1',
9
- title: 'title1',
10
- content: (
11
- <div>
12
- <p>1</p>
13
- <p>2</p>
14
- </div>
15
- ),
16
- },
17
- {
18
- type: 'text',
19
- id: '2',
20
- title: <NsLink href={'/test'}>title2</NsLink>,
21
- content: null,
22
- },
23
- {
24
- type: 'text',
25
- id: '3',
26
- title: 'title3',
27
- content: (
28
- <div>
29
- <p>1</p>
30
- <p>2</p>
31
- <p>3</p>
32
- </div>
33
- ),
34
- },
35
- ];
36
-
37
- describe('NsAccordionHeader', () => {
38
- it('1. renders title correctly', () => {
39
- const onClick = jest.fn();
40
- const title = 'Section Header';
41
-
42
- const { getByText } = render(
43
- <NsAccordionHeader
44
- variant={AccordionVariant.Basic}
45
- title={title}
46
- onClick={onClick}
47
- invert={false}
48
- isOpen={true}
49
- content={content}
50
- />
51
- );
52
- const el = getByText(title);
53
- expect(el).toBeInTheDocument();
54
- expect(el.closest('header')).toHaveAttribute('aria-expanded', 'true');
55
- });
56
- it('2. renders title correctly', () => {
57
- const onClick = jest.fn();
58
- const title = 'Section Header';
59
- const { getByText } = render(
60
- <NsAccordionHeader
61
- variant={AccordionVariant.Compact}
62
- title={<span>{title}</span>}
63
- onClick={onClick}
64
- invert={false}
65
- isOpen={false}
66
- content={content}
67
- />
68
- );
69
- const el = getByText(title);
70
- expect(el).toBeInTheDocument();
71
- expect(el.closest('header')).toHaveAttribute('aria-expanded', 'false');
72
- });
73
- it('3. calls onClick handler when clicked', () => {
74
- const onClick = jest.fn();
75
- const { container } = render(
76
- <NsAccordionHeader
77
- variant={AccordionVariant.Basic}
78
- title="Section Header"
79
- onClick={onClick}
80
- invert={false}
81
- isOpen={false}
82
- content={content}
83
- />
84
- );
85
- const header = container.querySelector('header');
86
- if (header) {
87
- fireEvent.click(header);
88
- expect(onClick).toHaveBeenCalledTimes(1);
89
- }
90
- });
91
-
92
- it('4. renders with additional class name', () => {
93
- const additionalClassName = 'custom-class';
94
- const onClick = jest.fn();
95
- const { container } = render(
96
- <NsAccordionHeader
97
- isOpen={false}
98
- variant={AccordionVariant.Basic}
99
- title="Section Header"
100
- additionalProps={{ className: additionalClassName }}
101
- onClick={onClick}
102
- invert={false}
103
- content={content}
104
- />
105
- );
106
- expect(container.querySelector('header')).toHaveClass(`section-header ${additionalClassName}`);
107
- });
108
-
109
- it('5. renders with expanded class when isOpen is true', () => {
110
- const onClick = jest.fn();
111
- const { container } = render(
112
- <NsAccordionHeader
113
- variant={AccordionVariant.Basic}
114
- title="Section Header"
115
- isOpen
116
- onClick={onClick}
117
- invert={false}
118
- content={content}
119
- />
120
- );
121
- expect(container.querySelector('header')).toHaveClass('expanded');
122
- });
123
-
124
- it('6. renders with header icon when showEndIconWhenEmpty is true', () => {
125
- const onClick = jest.fn();
126
- const { getByTestId } = render(
127
- <NsAccordionHeader
128
- variant={AccordionVariant.Basic}
129
- title="Section Header"
130
- onClick={onClick}
131
- invert={false}
132
- isOpen
133
- showEndIconWhenEmpty={true}
134
- content={content}
135
- />
136
- );
137
- // this icon refers to end icon which is either arrowUp or arrowDown
138
- expect(getByTestId('icon')).toBeInTheDocument();
139
- });
140
- it('7. renders with custom start icon', () => {
141
- const onClick = jest.fn();
142
- const { getByTestId } = render(
143
- <NsAccordionHeader
144
- variant={AccordionVariant.Basic}
145
- title="Section Header"
146
- onClick={onClick}
147
- invert={false}
148
- isOpen
149
- startIcon={{ name: 'hamburgerIcon', testId: 'hamburger-test' }}
150
- content={content}
151
- />
152
- );
153
- expect(getByTestId('hamburger-test')).toBeInTheDocument();
154
- });
155
- it('8. does not render start icon, when invalid icon name is passed', () => {
156
- const onClick = jest.fn();
157
- const invalidIconName = 'hambur';
158
- const testId = 'hamburger-test';
159
- const { queryByTestId } = render(
160
- <NsAccordionHeader
161
- variant={AccordionVariant.Basic}
162
- title="Section Header"
163
- onClick={onClick}
164
- invert={false}
165
- isOpen
166
- startIcon={{ name: invalidIconName as any, testId }}
167
- content={content}
168
- />
169
- );
170
- expect(queryByTestId(testId)).toBeNull();
171
- });
172
- });
@@ -1,79 +0,0 @@
1
- import React from 'react';
2
- import { render, fireEvent } from '@/test-utils/index';
3
- import { NsAccordionItem, AccordionVariant } from '@/common/index';
4
-
5
- describe('NsAccordionItem', () => {
6
- const title = 'Accordion Section Title';
7
- const content = 'Accordion Section Content';
8
- const contentElement = <div className="p-2">{content}</div>;
9
- it('1. renders title correctly', () => {
10
- const { getByText } = render(
11
- <NsAccordionItem
12
- type="jsx"
13
- variant={AccordionVariant.Basic}
14
- isOpen={false}
15
- toggleOpen={() => {}}
16
- title={title}
17
- content={contentElement}
18
- isChild={false}
19
- invert={false}
20
- level={1}
21
- />
22
- );
23
- expect(getByText(title)).toBeInTheDocument();
24
- });
25
-
26
- it('2. calls toggleOpen function when clicked on the section header', () => {
27
- const toggleOpen = jest.fn();
28
- const { getByText } = render(
29
- <NsAccordionItem
30
- type="jsx"
31
- variant={AccordionVariant.Basic}
32
- isOpen={false}
33
- toggleOpen={toggleOpen}
34
- title={title}
35
- content={contentElement}
36
- isChild={false}
37
- invert={false}
38
- level={1}
39
- />
40
- );
41
- fireEvent.click(getByText(title));
42
- expect(toggleOpen).toHaveBeenCalledTimes(1);
43
- });
44
-
45
- it('3. renders content when isOpen is true', () => {
46
- const { getByText } = render(
47
- <NsAccordionItem
48
- variant={AccordionVariant.Basic}
49
- isOpen={true}
50
- toggleOpen={() => {}}
51
- title={title}
52
- type="jsx"
53
- content={contentElement}
54
- isChild={false}
55
- invert={false}
56
- level={1}
57
- />
58
- );
59
- expect(getByText(content)).toBeInTheDocument();
60
- });
61
-
62
- it('4. when isOpen is false, renders jsx dom content within container with 0 height', () => {
63
- const { queryByText } = render(
64
- <NsAccordionItem
65
- type="jsx"
66
- variant={AccordionVariant.Basic}
67
- isOpen={false}
68
- toggleOpen={() => {}}
69
- title={title}
70
- content={contentElement}
71
- isChild={false}
72
- invert={false}
73
- level={1}
74
- />
75
- );
76
- const bodyElement = queryByText(content);
77
- expect(bodyElement?.parentNode).toHaveStyle('height:0px;');
78
- });
79
- });
@@ -1,130 +0,0 @@
1
- import { AccordionItem, AccordionVariant, NsCollapse } from '@/common/index';
2
- import { render, screen } from '@/test-utils/index';
3
- import React from 'react';
4
-
5
- import { createAccordionItem3_1 } from '../stories/data';
6
-
7
- describe('NsCollapse', () => {
8
- it('1. renders children when isOpen is true', () => {
9
- const { getByText } = render(
10
- <NsCollapse
11
- isOpen
12
- variant={AccordionVariant.Basic}
13
- content={
14
- <>
15
- <div>Child 1</div>
16
- <div>Child 2</div>
17
- </>
18
- }
19
- type="jsx"
20
- isChild={false}
21
- invert={false}
22
- level={0}
23
- />
24
- );
25
- expect(getByText('Child 1')).toBeInTheDocument();
26
- expect(getByText('Child 2')).toBeInTheDocument();
27
- });
28
- it('2. renders children when isOpen is true and isChild is true', () => {
29
- const content = 'renders children when isOpen is true and isChild is true';
30
- const { getByText } = render(
31
- <NsCollapse
32
- isOpen
33
- type="text"
34
- variant={AccordionVariant.Basic}
35
- content={content}
36
- isChild={true}
37
- invert={false}
38
- level={0}
39
- />
40
- );
41
- expect(getByText(content)).toBeInTheDocument();
42
- });
43
- it('3. renders children when isOpen is true and variant is compact and content is of type accordion', () => {
44
- const accItem = createAccordionItem3_1();
45
- const content = accItem.content as AccordionItem[];
46
- const { getByText } = render(
47
- <NsCollapse
48
- isOpen
49
- variant={AccordionVariant.Compact}
50
- content={content}
51
- type={accItem.type}
52
- isChild={true}
53
- invert={false}
54
- level={0}
55
- />
56
- );
57
- expect(getByText(content[0].title as string)).toBeInTheDocument();
58
- expect(getByText(content[1].title as string)).toBeInTheDocument();
59
- });
60
-
61
- it('4. does not render children when isOpen is false', () => {
62
- const content = '<h2>Lorem ipsum dolor sit amet.</h2>';
63
- render(
64
- <NsCollapse
65
- isOpen={false}
66
- variant={AccordionVariant.Basic}
67
- type="html"
68
- content={content}
69
- isChild={false}
70
- invert={true}
71
- level={0}
72
- />
73
- );
74
- expect(screen.queryByText(content)).toBeNull();
75
- });
76
- it('5. renders html children when isOpen is true', () => {
77
- const content = '<h2>Lorem ipsum dolor sit amet.</h2>';
78
- render(
79
- <NsCollapse
80
- isOpen={true}
81
- variant={AccordionVariant.Compact}
82
- type="html"
83
- content={content}
84
- isChild={false}
85
- invert={true}
86
- level={0}
87
- />
88
- );
89
- expect(screen.queryByText(content)).toBeDefined();
90
- });
91
-
92
- it('6. renders with additional class name', () => {
93
- const additionalClassName = 'custom-class';
94
- const { container } = render(
95
- <NsCollapse
96
- type="jsx"
97
- isOpen
98
- variant={AccordionVariant.Gray}
99
- content={
100
- <>
101
- <div>Child 1</div>
102
- <div>Child 2</div>
103
- </>
104
- }
105
- additionalProps={{ className: additionalClassName }}
106
- isChild={false}
107
- invert={false}
108
- level={7}
109
- />
110
- );
111
- expect(container.querySelector('section')).toHaveClass(`ns-collapse ${additionalClassName}`);
112
- });
113
- it('7. skipping allowMultipleExpanded in child data', () => {
114
- const { content, type } = createAccordionItem3_1();
115
- const additionalClassName = 'custom-class';
116
- const { container } = render(
117
- <NsCollapse
118
- type={type}
119
- isOpen
120
- variant={AccordionVariant.Gray}
121
- content={content}
122
- additionalProps={{ className: additionalClassName }}
123
- isChild={false}
124
- invert={true}
125
- level={7}
126
- />
127
- );
128
- expect(container.querySelector('section')).toHaveClass(`ns-collapse ${additionalClassName}`);
129
- });
130
- });
@@ -1,74 +0,0 @@
1
- import React from 'react';
2
-
3
- import { AccordionVariant, NsToggleSection } from '@/common/index';
4
-
5
- import { render, fireEvent } from '@/test-utils/index';
6
-
7
- describe('NsToggleSection', () => {
8
- const title = 'Toggle Section Title';
9
- const contentText = 'Toggle Section Content';
10
- const content = <div className="p-2">{contentText}</div>;
11
- it('1. renders title correctly', () => {
12
- const { getByText } = render(
13
- <NsToggleSection
14
- variant={AccordionVariant.Basic}
15
- title={title}
16
- content={content}
17
- invert={false}
18
- isChild={false}
19
- type="jsx"
20
- />
21
- );
22
- expect(getByText(title)).toBeInTheDocument();
23
- });
24
- it('2. renders title correctly', () => {
25
- const { getByText } = render(
26
- <NsToggleSection
27
- variant={AccordionVariant.Compact}
28
- title={title}
29
- content={content}
30
- invert={false}
31
- isChild={false}
32
- type="jsx"
33
- />
34
- );
35
- expect(getByText(title)).toBeInTheDocument();
36
- });
37
-
38
- it('2. toggles content visibility when clicked on the section header', () => {
39
- const { getByText, queryByText } = render(
40
- <NsToggleSection
41
- variant={AccordionVariant.Basic}
42
- title={title}
43
- content={content}
44
- invert={false}
45
- isChild={false}
46
- type="jsx"
47
- />
48
- );
49
- const el = queryByText(contentText);
50
- expect(el?.parentNode).toHaveStyle('opacity: 0;');
51
-
52
- fireEvent.click(getByText(title));
53
- expect(el?.parentNode).toHaveStyle('opacity: 1;');
54
-
55
- fireEvent.click(getByText(title));
56
- expect(el?.parentNode).toHaveStyle('opacity: 0;');
57
- });
58
-
59
- it('3. sets defaultOpen prop correctly', () => {
60
- const { getByText } = render(
61
- <NsToggleSection
62
- variant={AccordionVariant.Basic}
63
- title={title}
64
- content={content}
65
- invert={false}
66
- isChild={false}
67
- defaultOpen
68
- type="jsx"
69
- />
70
- );
71
-
72
- expect(getByText(contentText)).toBeInTheDocument();
73
- });
74
- });