@goodhood-web/ui 0.0.4 → 0.0.5

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 (292) hide show
  1. package/{src/index.ts → index.d.ts} +1 -24
  2. package/index.js +48 -0
  3. package/index.mjs +2331 -0
  4. package/lib/BaseButton/BaseButton.d.ts +11 -0
  5. package/lib/Card/Card.d.ts +3 -0
  6. package/lib/Card/Card.types.d.ts +10 -0
  7. package/lib/Card/Card.utils.d.ts +3 -0
  8. package/lib/Card/CardBody/CardBody.d.ts +3 -0
  9. package/lib/Card/CardBody/CardBody.types.d.ts +5 -0
  10. package/lib/Card/CardHeader/CardHeader.d.ts +3 -0
  11. package/lib/Card/CardHeader/CardHeader.type.d.ts +10 -0
  12. package/lib/ContentCreatorButton/ContentCreatorButton.d.ts +3 -0
  13. package/{src/lib/ContentCreatorButton/ContentCreatorButton.types.ts → lib/ContentCreatorButton/ContentCreatorButton.types.d.ts} +2 -3
  14. package/lib/Divider/Divider.d.ts +3 -0
  15. package/lib/Divider/Divider.types.d.ts +6 -0
  16. package/lib/Fieldset/Fieldset.d.ts +3 -0
  17. package/lib/Fieldset/Fieldset.types.d.ts +8 -0
  18. package/lib/Form/Form.d.ts +3 -0
  19. package/lib/Form/Form.types.d.ts +10 -0
  20. package/lib/Icon/Icon.d.ts +4 -0
  21. package/lib/Icon/Icon.types.d.ts +18 -0
  22. package/lib/Icon/icons/24x24/index.d.ts +130 -0
  23. package/lib/Icon/icons/32x32/index.d.ts +265 -0
  24. package/lib/Icon/icons/index.d.ts +395 -0
  25. package/lib/IconButton/IconButton.d.ts +3 -0
  26. package/{src/lib/IconButton/IconButton.types.ts → lib/IconButton/IconButton.types.d.ts} +10 -10
  27. package/lib/IconButton/utils.d.ts +3 -0
  28. package/lib/Image/Image.d.ts +3 -0
  29. package/lib/Image/Image.type.d.ts +5 -0
  30. package/lib/LabelPill/LabelPill.d.ts +3 -0
  31. package/lib/LabelPill/LabelPill.types.d.ts +4 -0
  32. package/lib/Legend/Legend.d.ts +3 -0
  33. package/lib/Legend/Legend.types.d.ts +5 -0
  34. package/lib/MenuItem/MenuItem.d.ts +3 -0
  35. package/lib/MenuItem/MenuItem.types.d.ts +9 -0
  36. package/lib/NotificationBubble/NotificationBubble.d.ts +3 -0
  37. package/{src/lib/NotificationBubble/NotificationBubble.types.tsx → lib/NotificationBubble/NotificationBubble.types.d.ts} +2 -3
  38. package/lib/Thumbnail/Thumbnail.d.ts +3 -0
  39. package/{src/lib/Thumbnail/Thumbnail.type.tsx → lib/Thumbnail/Thumbnail.type.d.ts} +6 -9
  40. package/lib/Toggle/Toggle.d.ts +3 -0
  41. package/{src/lib/Toggle/Toggle.types.ts → lib/Toggle/Toggle.types.d.ts} +2 -3
  42. package/lib/ToggleInput/ToggleInput.d.ts +3 -0
  43. package/{src/lib/ToggleInput/ToggleInput.types.ts → lib/ToggleInput/ToggleInput.types.d.ts} +3 -5
  44. package/lib/Typography/Typography.d.ts +3 -0
  45. package/lib/Typography/Typography.types.d.ts +8 -0
  46. package/package.json +1 -1
  47. package/style.css +1 -0
  48. package/.babelrc +0 -12
  49. package/.eslintrc.json +0 -25
  50. package/.storybook/main.ts +0 -31
  51. package/.storybook/manager-head.html +0 -1
  52. package/.storybook/manager.ts +0 -7
  53. package/.storybook/nebenanTheme.ts +0 -17
  54. package/.storybook/preview.ts +0 -9
  55. package/.stylelintrc.json +0 -14
  56. package/README.md +0 -7
  57. package/__mocks__/svg.js +0 -2
  58. package/images/favicon.ico +0 -0
  59. package/images/logo.svg +0 -11
  60. package/jest.config.ts +0 -16
  61. package/project.json +0 -88
  62. package/src/lib/BaseButton/BaseButton.module.scss +0 -11
  63. package/src/lib/BaseButton/BaseButton.spec.tsx +0 -12
  64. package/src/lib/BaseButton/BaseButton.stories.tsx +0 -26
  65. package/src/lib/BaseButton/BaseButton.tsx +0 -39
  66. package/src/lib/Card/Card.module.scss +0 -15
  67. package/src/lib/Card/Card.spec.tsx +0 -15
  68. package/src/lib/Card/Card.stories.tsx +0 -159
  69. package/src/lib/Card/Card.tsx +0 -31
  70. package/src/lib/Card/Card.types.ts +0 -12
  71. package/src/lib/Card/Card.utils.spec.tsx +0 -51
  72. package/src/lib/Card/Card.utils.ts +0 -23
  73. package/src/lib/Card/CardBody/CardBody.module.scss +0 -4
  74. package/src/lib/Card/CardBody/CardBody.spec.tsx +0 -15
  75. package/src/lib/Card/CardBody/CardBody.stories.tsx +0 -108
  76. package/src/lib/Card/CardBody/CardBody.tsx +0 -9
  77. package/src/lib/Card/CardBody/CardBody.types.ts +0 -4
  78. package/src/lib/Card/CardHeader/CardHeader.module.scss +0 -12
  79. package/src/lib/Card/CardHeader/CardHeader.spec.tsx +0 -72
  80. package/src/lib/Card/CardHeader/CardHeader.stories.tsx +0 -77
  81. package/src/lib/Card/CardHeader/CardHeader.tsx +0 -29
  82. package/src/lib/Card/CardHeader/CardHeader.type.ts +0 -14
  83. package/src/lib/ContentCreatorButton/ContentCreatorButton.module.scss +0 -13
  84. package/src/lib/ContentCreatorButton/ContentCreatorButton.spec.tsx +0 -14
  85. package/src/lib/ContentCreatorButton/ContentCreatorButton.stories.tsx +0 -29
  86. package/src/lib/ContentCreatorButton/ContentCreatorButton.tsx +0 -35
  87. package/src/lib/Divider/Divider.module.scss +0 -10
  88. package/src/lib/Divider/Divider.spec.tsx +0 -46
  89. package/src/lib/Divider/Divider.stories.tsx +0 -35
  90. package/src/lib/Divider/Divider.tsx +0 -17
  91. package/src/lib/Divider/Divider.types.ts +0 -6
  92. package/src/lib/Fieldset/Fieldset.module.scss +0 -3
  93. package/src/lib/Fieldset/Fieldset.spec.tsx +0 -68
  94. package/src/lib/Fieldset/Fieldset.stories.tsx +0 -60
  95. package/src/lib/Fieldset/Fieldset.tsx +0 -28
  96. package/src/lib/Fieldset/Fieldset.types.ts +0 -7
  97. package/src/lib/Form/Form.spec.tsx +0 -15
  98. package/src/lib/Form/Form.stories.tsx +0 -53
  99. package/src/lib/Form/Form.tsx +0 -14
  100. package/src/lib/Form/Form.types.ts +0 -11
  101. package/src/lib/Icon/Icon.module.scss +0 -7
  102. package/src/lib/Icon/Icon.spec.tsx +0 -28
  103. package/src/lib/Icon/Icon.stories.tsx +0 -88
  104. package/src/lib/Icon/Icon.tsx +0 -29
  105. package/src/lib/Icon/Icon.types.ts +0 -23
  106. package/src/lib/Icon/icons/24x24/index.ts +0 -89
  107. package/src/lib/Icon/icons/24x24/svg/arrow_left.svg +0 -1
  108. package/src/lib/Icon/icons/24x24/svg/arrow_right.svg +0 -1
  109. package/src/lib/Icon/icons/24x24/svg/bookmark.svg +0 -1
  110. package/src/lib/Icon/icons/24x24/svg/bookmarked.svg +0 -1
  111. package/src/lib/Icon/icons/24x24/svg/burger_menu.svg +0 -1
  112. package/src/lib/Icon/icons/24x24/svg/camera.svg +0 -1
  113. package/src/lib/Icon/icons/24x24/svg/checkmark.svg +0 -1
  114. package/src/lib/Icon/icons/24x24/svg/checkmark_circle.svg +0 -1
  115. package/src/lib/Icon/icons/24x24/svg/chevron_down.svg +0 -1
  116. package/src/lib/Icon/icons/24x24/svg/chevron_left.svg +0 -1
  117. package/src/lib/Icon/icons/24x24/svg/chevron_right.svg +0 -1
  118. package/src/lib/Icon/icons/24x24/svg/chevron_up.svg +0 -1
  119. package/src/lib/Icon/icons/24x24/svg/comment_bubble.svg +0 -1
  120. package/src/lib/Icon/icons/24x24/svg/cross.svg +0 -1
  121. package/src/lib/Icon/icons/24x24/svg/cross_circle.svg +0 -1
  122. package/src/lib/Icon/icons/24x24/svg/envelope.svg +0 -1
  123. package/src/lib/Icon/icons/24x24/svg/event_calendar.svg +0 -1
  124. package/src/lib/Icon/icons/24x24/svg/external_link.svg +0 -1
  125. package/src/lib/Icon/icons/24x24/svg/eye.svg +0 -1
  126. package/src/lib/Icon/icons/24x24/svg/eye_crossed.svg +0 -1
  127. package/src/lib/Icon/icons/24x24/svg/filter.svg +0 -1
  128. package/src/lib/Icon/icons/24x24/svg/globe.svg +0 -1
  129. package/src/lib/Icon/icons/24x24/svg/heart.svg +0 -1
  130. package/src/lib/Icon/icons/24x24/svg/image.svg +0 -1
  131. package/src/lib/Icon/icons/24x24/svg/loudspeaker.svg +0 -1
  132. package/src/lib/Icon/icons/24x24/svg/marketplace.svg +0 -1
  133. package/src/lib/Icon/icons/24x24/svg/more_dots.svg +0 -1
  134. package/src/lib/Icon/icons/24x24/svg/more_dots_alt.svg +0 -1
  135. package/src/lib/Icon/icons/24x24/svg/mute.svg +0 -1
  136. package/src/lib/Icon/icons/24x24/svg/notification_bell.svg +0 -1
  137. package/src/lib/Icon/icons/24x24/svg/paperclip.svg +0 -1
  138. package/src/lib/Icon/icons/24x24/svg/pencil.svg +0 -1
  139. package/src/lib/Icon/icons/24x24/svg/pin.svg +0 -1
  140. package/src/lib/Icon/icons/24x24/svg/plus.svg +0 -1
  141. package/src/lib/Icon/icons/24x24/svg/plus_circle.svg +0 -1
  142. package/src/lib/Icon/icons/24x24/svg/privacy_lock.svg +0 -1
  143. package/src/lib/Icon/icons/24x24/svg/search.svg +0 -1
  144. package/src/lib/Icon/icons/24x24/svg/share_arrow.svg +0 -1
  145. package/src/lib/Icon/icons/24x24/svg/share_arrow_outline.svg +0 -1
  146. package/src/lib/Icon/icons/24x24/svg/sort.svg +0 -1
  147. package/src/lib/Icon/icons/24x24/svg/thanks.svg +0 -1
  148. package/src/lib/Icon/icons/24x24/svg/trash_can.svg +0 -1
  149. package/src/lib/Icon/icons/32x32/index.ts +0 -179
  150. package/src/lib/Icon/icons/32x32/svg/address_book.svg +0 -1
  151. package/src/lib/Icon/icons/32x32/svg/baby_toy.svg +0 -1
  152. package/src/lib/Icon/icons/32x32/svg/bicycle.svg +0 -1
  153. package/src/lib/Icon/icons/32x32/svg/bookmark.svg +0 -1
  154. package/src/lib/Icon/icons/32x32/svg/books.svg +0 -1
  155. package/src/lib/Icon/icons/32x32/svg/bubble_heart_filled.svg +0 -1
  156. package/src/lib/Icon/icons/32x32/svg/bubble_heart_outline.svg +0 -1
  157. package/src/lib/Icon/icons/32x32/svg/buildings.svg +0 -1
  158. package/src/lib/Icon/icons/32x32/svg/burger_menu.svg +0 -1
  159. package/src/lib/Icon/icons/32x32/svg/business.svg +0 -1
  160. package/src/lib/Icon/icons/32x32/svg/business_profile.svg +0 -1
  161. package/src/lib/Icon/icons/32x32/svg/camera.svg +0 -1
  162. package/src/lib/Icon/icons/32x32/svg/camera_crossed.svg +0 -1
  163. package/src/lib/Icon/icons/32x32/svg/car.svg +0 -1
  164. package/src/lib/Icon/icons/32x32/svg/carrot.svg +0 -1
  165. package/src/lib/Icon/icons/32x32/svg/chat.svg +0 -1
  166. package/src/lib/Icon/icons/32x32/svg/checkmark_circle.svg +0 -1
  167. package/src/lib/Icon/icons/32x32/svg/christmas_tree.svg +0 -1
  168. package/src/lib/Icon/icons/32x32/svg/clipboard.svg +0 -1
  169. package/src/lib/Icon/icons/32x32/svg/clothing.svg +0 -1
  170. package/src/lib/Icon/icons/32x32/svg/cocktail.svg +0 -1
  171. package/src/lib/Icon/icons/32x32/svg/comment_bubble.svg +0 -1
  172. package/src/lib/Icon/icons/32x32/svg/compass.svg +0 -1
  173. package/src/lib/Icon/icons/32x32/svg/computer.svg +0 -1
  174. package/src/lib/Icon/icons/32x32/svg/couch.svg +0 -1
  175. package/src/lib/Icon/icons/32x32/svg/credit_card.svg +0 -1
  176. package/src/lib/Icon/icons/32x32/svg/cross_circle.svg +0 -1
  177. package/src/lib/Icon/icons/32x32/svg/cutlery.svg +0 -1
  178. package/src/lib/Icon/icons/32x32/svg/drill_tool.svg +0 -1
  179. package/src/lib/Icon/icons/32x32/svg/email.svg +0 -1
  180. package/src/lib/Icon/icons/32x32/svg/envelope.svg +0 -1
  181. package/src/lib/Icon/icons/32x32/svg/event_calendar_check.svg +0 -1
  182. package/src/lib/Icon/icons/32x32/svg/event_calendar_date.svg +0 -1
  183. package/src/lib/Icon/icons/32x32/svg/event_calendar_plus.svg +0 -1
  184. package/src/lib/Icon/icons/32x32/svg/exchange.svg +0 -1
  185. package/src/lib/Icon/icons/32x32/svg/eye.svg +0 -1
  186. package/src/lib/Icon/icons/32x32/svg/eye_crossed.svg +0 -1
  187. package/src/lib/Icon/icons/32x32/svg/gift.svg +0 -1
  188. package/src/lib/Icon/icons/32x32/svg/group.svg +0 -1
  189. package/src/lib/Icon/icons/32x32/svg/healthcare.svg +0 -1
  190. package/src/lib/Icon/icons/32x32/svg/heart.svg +0 -1
  191. package/src/lib/Icon/icons/32x32/svg/house.svg +0 -1
  192. package/src/lib/Icon/icons/32x32/svg/image.svg +0 -1
  193. package/src/lib/Icon/icons/32x32/svg/info.svg +0 -1
  194. package/src/lib/Icon/icons/32x32/svg/invite_neighbour.svg +0 -1
  195. package/src/lib/Icon/icons/32x32/svg/key.svg +0 -1
  196. package/src/lib/Icon/icons/32x32/svg/kitchen_pot.svg +0 -1
  197. package/src/lib/Icon/icons/32x32/svg/list.svg +0 -1
  198. package/src/lib/Icon/icons/32x32/svg/log_out.svg +0 -1
  199. package/src/lib/Icon/icons/32x32/svg/loudspeaker.svg +0 -1
  200. package/src/lib/Icon/icons/32x32/svg/map.svg +0 -1
  201. package/src/lib/Icon/icons/32x32/svg/marketplace.svg +0 -1
  202. package/src/lib/Icon/icons/32x32/svg/miscellaneous_other.svg +0 -1
  203. package/src/lib/Icon/icons/32x32/svg/more_dots.svg +0 -1
  204. package/src/lib/Icon/icons/32x32/svg/more_dots_alt.svg +0 -1
  205. package/src/lib/Icon/icons/32x32/svg/music.svg +0 -1
  206. package/src/lib/Icon/icons/32x32/svg/nebenan.de.svg +0 -1
  207. package/src/lib/Icon/icons/32x32/svg/neighbour.svg +0 -1
  208. package/src/lib/Icon/icons/32x32/svg/notification_bell.svg +0 -1
  209. package/src/lib/Icon/icons/32x32/svg/organisation.svg +0 -1
  210. package/src/lib/Icon/icons/32x32/svg/paper_form_empty.svg +0 -1
  211. package/src/lib/Icon/icons/32x32/svg/paper_form_filled.svg +0 -1
  212. package/src/lib/Icon/icons/32x32/svg/paperclip.svg +0 -1
  213. package/src/lib/Icon/icons/32x32/svg/paw.svg +0 -1
  214. package/src/lib/Icon/icons/32x32/svg/pencil.svg +0 -1
  215. package/src/lib/Icon/icons/32x32/svg/pin.svg +0 -1
  216. package/src/lib/Icon/icons/32x32/svg/pins.svg +0 -1
  217. package/src/lib/Icon/icons/32x32/svg/plant.svg +0 -1
  218. package/src/lib/Icon/icons/32x32/svg/plus.svg +0 -1
  219. package/src/lib/Icon/icons/32x32/svg/plus_circle.svg +0 -1
  220. package/src/lib/Icon/icons/32x32/svg/post.svg +0 -1
  221. package/src/lib/Icon/icons/32x32/svg/privacy_lock.svg +0 -1
  222. package/src/lib/Icon/icons/32x32/svg/qr_code.svg +0 -1
  223. package/src/lib/Icon/icons/32x32/svg/search.svg +0 -1
  224. package/src/lib/Icon/icons/32x32/svg/settings_cog.svg +0 -1
  225. package/src/lib/Icon/icons/32x32/svg/shopping_bag.svg +0 -1
  226. package/src/lib/Icon/icons/32x32/svg/shopping_cart.svg +0 -1
  227. package/src/lib/Icon/icons/32x32/svg/special_place.svg +0 -1
  228. package/src/lib/Icon/icons/32x32/svg/suitcase.svg +0 -1
  229. package/src/lib/Icon/icons/32x32/svg/supporter.svg +0 -1
  230. package/src/lib/Icon/icons/32x32/svg/tennis_ball.svg +0 -1
  231. package/src/lib/Icon/icons/32x32/svg/thanks.svg +0 -1
  232. package/src/lib/Icon/icons/32x32/svg/trash_can.svg +0 -1
  233. package/src/lib/Icon/icons/32x32/svg/truck.svg +0 -1
  234. package/src/lib/Icon/icons/32x32/svg/user.svg +0 -1
  235. package/src/lib/Icon/icons/32x32/svg/user_profile.svg +0 -1
  236. package/src/lib/Icon/icons/32x32/svg/wellness.svg +0 -1
  237. package/src/lib/Icon/icons/index.ts +0 -9
  238. package/src/lib/IconButton/IconButton.module.scss +0 -36
  239. package/src/lib/IconButton/IconButton.spec.tsx +0 -56
  240. package/src/lib/IconButton/IconButton.stories.tsx +0 -36
  241. package/src/lib/IconButton/IconButton.tsx +0 -25
  242. package/src/lib/IconButton/utils.ts +0 -6
  243. package/src/lib/Image/Image.spec.tsx +0 -10
  244. package/src/lib/Image/Image.tsx +0 -7
  245. package/src/lib/Image/Image.type.tsx +0 -5
  246. package/src/lib/LabelPill/LabelPill.module.scss +0 -33
  247. package/src/lib/LabelPill/LabelPill.spec.tsx +0 -23
  248. package/src/lib/LabelPill/LabelPill.stories.tsx +0 -31
  249. package/src/lib/LabelPill/LabelPill.tsx +0 -16
  250. package/src/lib/LabelPill/LabelPill.types.ts +0 -4
  251. package/src/lib/Legend/Legend.module.scss +0 -9
  252. package/src/lib/Legend/Legend.spec.tsx +0 -39
  253. package/src/lib/Legend/Legend.stories.ts +0 -39
  254. package/src/lib/Legend/Legend.tsx +0 -19
  255. package/src/lib/Legend/Legend.types.ts +0 -5
  256. package/src/lib/MenuItem/MenuItem.module.scss +0 -70
  257. package/src/lib/MenuItem/MenuItem.spec.tsx +0 -47
  258. package/src/lib/MenuItem/MenuItem.stories.tsx +0 -97
  259. package/src/lib/MenuItem/MenuItem.tsx +0 -34
  260. package/src/lib/MenuItem/MenuItem.types.ts +0 -10
  261. package/src/lib/NotificationBubble/NotificationBubble.module.scss +0 -30
  262. package/src/lib/NotificationBubble/NotificationBubble.spec.tsx +0 -36
  263. package/src/lib/NotificationBubble/NotificationBubble.stories.tsx +0 -56
  264. package/src/lib/NotificationBubble/NotificationBubble.tsx +0 -34
  265. package/src/lib/Thumbnail/Thumbnail.module.scss +0 -67
  266. package/src/lib/Thumbnail/Thumbnail.spec.tsx +0 -51
  267. package/src/lib/Thumbnail/Thumbnail.stories.tsx +0 -242
  268. package/src/lib/Thumbnail/Thumbnail.tsx +0 -28
  269. package/src/lib/Toggle/Toggle.module.scss +0 -53
  270. package/src/lib/Toggle/Toggle.spec.tsx +0 -23
  271. package/src/lib/Toggle/Toggle.stories.tsx +0 -38
  272. package/src/lib/Toggle/Toggle.tsx +0 -32
  273. package/src/lib/ToggleInput/ToggleInput.module.scss +0 -33
  274. package/src/lib/ToggleInput/ToggleInput.spec.tsx +0 -45
  275. package/src/lib/ToggleInput/ToggleInput.stories.tsx +0 -62
  276. package/src/lib/ToggleInput/ToggleInput.tsx +0 -40
  277. package/src/lib/Typography/Typography.module.scss +0 -61
  278. package/src/lib/Typography/Typography.spec.tsx +0 -60
  279. package/src/lib/Typography/Typography.stories.tsx +0 -45
  280. package/src/lib/Typography/Typography.tsx +0 -26
  281. package/src/lib/Typography/Typography.types.ts +0 -28
  282. package/src/styles/_design-tokens.scss +0 -1
  283. package/src/styles/_fonts.scss +0 -0
  284. package/src/styles/_functions.scss +0 -17
  285. package/src/styles/_mixins.scss +0 -33
  286. package/src/styles/index.scss +0 -3
  287. package/src/styles/reset.scss +0 -65
  288. package/tsconfig.json +0 -24
  289. package/tsconfig.lib.json +0 -35
  290. package/tsconfig.spec.json +0 -20
  291. package/tsconfig.storybook.json +0 -31
  292. package/vite.config.ts +0 -57
@@ -1,33 +0,0 @@
1
- .toggleInput {
2
- display: flex;
3
- align-items: center;
4
- padding: getSpacing('sm') getSpacing('lg');
5
- background-color: getSemanticColor('surface', 'surface');
6
- gap: getSpacing('md');
7
-
8
- color: getSemanticColor('surface', 'onSurfaceVariant');
9
- cursor: pointer;
10
- width: 100%;
11
-
12
- svg {
13
- flex-shrink: 0;
14
- }
15
-
16
- .textLabel {
17
- flex-grow: 1;
18
- }
19
-
20
- .switch {
21
- flex-shrink: 0;
22
- }
23
-
24
- &--checked {
25
- color: getSemanticColor('surface', 'onSurface');
26
- }
27
-
28
- &--withBorder {
29
- padding: getSpacing('md') getSpacing('lg');
30
- border-radius: getBorderRadius('lg');
31
- box-shadow: inset 0px 0px 0px 1px getSemanticColor('outline', 'outlineVariant');
32
- }
33
- }
@@ -1,45 +0,0 @@
1
- import { fireEvent, render, screen } from '@testing-library/react';
2
-
3
- import ToggleInput from './ToggleInput';
4
- import { ToggleInputProps } from './ToggleInput.types';
5
-
6
- describe('ToggleInput Component', () => {
7
- const mockProps = {
8
- checked: false,
9
- defaultChecked: false,
10
- disabled: false,
11
- icon: 'notification_bell',
12
- label: 'Test Label',
13
- onChange: jest.fn(),
14
- variant: 'rounded',
15
- } as ToggleInputProps;
16
-
17
- it('renders without crashing', () => {
18
- render(<ToggleInput {...mockProps} />);
19
- });
20
-
21
- it('renders label and icon correctly', () => {
22
- render(<ToggleInput {...mockProps} />);
23
- const labelElement = screen.getByText('Test Label');
24
- const iconElement = screen.getByRole('presentation');
25
-
26
- expect(labelElement).toBeInTheDocument();
27
- expect(iconElement).toBeInTheDocument();
28
- });
29
-
30
- it('calls onChange when the toggle switch is clicked', () => {
31
- render(<ToggleInput {...mockProps} />);
32
- const toggleSwitch = screen.getByTestId('toggle-switch');
33
-
34
- fireEvent.click(toggleSwitch);
35
-
36
- expect(mockProps.onChange).toHaveBeenCalledTimes(1);
37
- });
38
-
39
- it('renders disabled state correctly', () => {
40
- render(<ToggleInput {...mockProps} disabled={true} />);
41
- const toggleSwitch = screen.getByTestId('toggle-switch');
42
-
43
- expect(toggleSwitch).toBeDisabled();
44
- });
45
- });
@@ -1,62 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
- import React, { useState } from 'react';
3
-
4
- import Icons32 from '../Icon/icons/32x32';
5
-
6
- import ToggleInput from './ToggleInput';
7
- import { ToggleInputProps } from './ToggleInput.types';
8
-
9
- const meta: Meta<typeof ToggleInput> = {
10
- argTypes: {
11
- icon: {
12
- control: {
13
- type: 'select',
14
- },
15
- description: 'This will be icon of the toggle input',
16
- options: [undefined, ...Object.keys(Icons32)],
17
- },
18
- label: {
19
- control: {
20
- type: 'text',
21
- },
22
- description: 'This will be text of the toggle input',
23
- },
24
- onChange: { action: 'clicked', description: 'On click event callback' },
25
-
26
- withBorder: {
27
- defaultValue: 'false',
28
- description: 'This will be variant of the toggle input',
29
- },
30
- },
31
- component: ToggleInput,
32
- title: 'Components/ToggleInput',
33
- };
34
-
35
- export default meta;
36
-
37
- type Story = StoryObj<typeof ToggleInput>;
38
-
39
- const WrapperToggle = (props: ToggleInputProps) => {
40
- const [checked, setChecked] = useState(false);
41
-
42
- const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
43
- setChecked(e.target.checked);
44
- };
45
-
46
- return <ToggleInput {...props} checked={checked} onChange={handleChange} />;
47
- };
48
-
49
- export const Primary: Story = {
50
- args: {
51
- icon: 'notification_bell',
52
- label: 'Toggle Input',
53
- withBorder: false,
54
- },
55
- parameters: {
56
- design: {
57
- type: 'figma',
58
- url: 'https://www.figma.com/file/hN7xJ3rRAemUJT9T0uEfUS/Product-Design-System?node-id=181%3A2876&mode=dev',
59
- },
60
- },
61
- render: WrapperToggle,
62
- };
@@ -1,40 +0,0 @@
1
- import clsx from 'clsx';
2
-
3
- import Icon from '../Icon/Icon';
4
- import Toggle from '../Toggle/Toggle';
5
- import Typography from '../Typography/Typography';
6
-
7
- import styles from './ToggleInput.module.scss';
8
- import { ToggleInputProps } from './ToggleInput.types';
9
-
10
- const ToggleInput = ({
11
- checked,
12
- defaultChecked,
13
- disabled,
14
- icon,
15
- label,
16
- onChange,
17
- withBorder,
18
- }: ToggleInputProps) => {
19
- return (
20
- <label
21
- className={clsx(styles.toggleInput, {
22
- [styles[`toggleInput--withBorder`]]: withBorder,
23
- [styles[`toggleInput--checked`]]: checked,
24
- })}
25
- >
26
- {icon && <Icon name={icon} size="32" />}
27
- <Typography type="body-large" className={styles.textLabel}>
28
- {label}
29
- </Typography>
30
- <Toggle
31
- onChange={onChange}
32
- disabled={disabled}
33
- defaultChecked={defaultChecked}
34
- className={styles.switch}
35
- />
36
- </label>
37
- );
38
- };
39
-
40
- export default ToggleInput;
@@ -1,61 +0,0 @@
1
- .h1 {
2
- @include typography('headings', 'H1');
3
- }
4
-
5
- .h2 {
6
- @include typography('headings', 'H2');
7
- }
8
-
9
- .h3 {
10
- @include typography('headings', 'H3');
11
- }
12
-
13
- .h4 {
14
- @include typography('headings', 'H4');
15
- }
16
-
17
- .h5 {
18
- @include typography('headings', 'H5');
19
- }
20
-
21
- .h6 {
22
- @include typography('headings', 'H6');
23
- }
24
-
25
- .h7 {
26
- @include typography('headings', 'H7');
27
- }
28
-
29
- .h8 {
30
- @include typography('headings', 'H8');
31
- }
32
-
33
- // Body
34
- .body-large {
35
- @include typography('body', 'Large');
36
- }
37
-
38
- .body-regular {
39
- @include typography('body', 'Regular');
40
- }
41
-
42
- .body-semibold {
43
- @include typography('body', 'Semibold');
44
- }
45
-
46
- .body-italic {
47
- @include typography('body', 'Italic');
48
- }
49
-
50
- // Detail
51
- .detail-medium {
52
- @include typography('detail', 'Medium');
53
- }
54
-
55
- .detail-bold {
56
- @include typography('detail', 'Bold');
57
- }
58
-
59
- .detail-upper-case {
60
- @include typography('detail', 'Upper Case');
61
- }
@@ -1,60 +0,0 @@
1
- import { render } from '@testing-library/react';
2
-
3
- import Typography from './Typography';
4
- import { TypographyType } from './Typography.types';
5
-
6
- describe('<Typography />', () => {
7
- const types: TypographyType[] = [
8
- 'h1',
9
- 'h2',
10
- 'h3',
11
- 'h4',
12
- 'h5',
13
- 'h6',
14
- 'h7',
15
- 'h8',
16
- 'body-large',
17
- 'body-regular',
18
- 'body-semibold',
19
- 'body-italic',
20
- 'detail-medium',
21
- 'detail-bold',
22
- 'detail-upper-case',
23
- ];
24
-
25
- types.forEach((type) => {
26
- it(`renders correctly for type "${type}"`, () => {
27
- const { getByText } = render(<Typography type={type}>Sample Text</Typography>);
28
- const element = getByText('Sample Text');
29
-
30
- if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(type)) {
31
- expect(element.tagName).toBe(type.toUpperCase());
32
- } else {
33
- expect(element.tagName).toBe('SPAN');
34
- }
35
-
36
- expect(element).toHaveClass(type);
37
- });
38
- });
39
-
40
- it('renders correctly with "as" prop', () => {
41
- const { getByText } = render(
42
- <Typography type="body-large" as="p">
43
- Sample Text
44
- </Typography>,
45
- );
46
- const element = getByText('Sample Text');
47
- expect(element.tagName).toBe('P');
48
- expect(element).toHaveClass('body-large');
49
- });
50
-
51
- it('take a custom classname and adds it properly to the element', () => {
52
- const { getByText } = render(
53
- <Typography type="body-large" className="custom-classname">
54
- Sample Text
55
- </Typography>,
56
- );
57
- const element = getByText('Sample Text');
58
- expect(element).toHaveClass('custom-classname');
59
- });
60
- });
@@ -1,45 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import Typography from './Typography';
4
-
5
- const meta: Meta<typeof Typography> = {
6
- component: Typography,
7
- title: 'Components/Typography',
8
- };
9
- export default meta;
10
- type Story = StoryObj<typeof Typography>;
11
-
12
- export const Heading1: Story = {
13
- args: {
14
- children: 'Heading 1',
15
- type: 'h1',
16
- },
17
- };
18
-
19
- export const Heading2: Story = {
20
- args: {
21
- children: 'Heading 2',
22
- type: 'h2',
23
- },
24
- };
25
-
26
- export const BodyLarge: Story = {
27
- args: {
28
- children: 'Body Large Text',
29
- type: 'body-large',
30
- },
31
- };
32
-
33
- export const BodyRegular: Story = {
34
- args: {
35
- children: 'Body Regular Text',
36
- type: 'body-regular',
37
- },
38
- };
39
-
40
- export const DetailBold: Story = {
41
- args: {
42
- children: 'Detail Bold Text',
43
- type: 'detail-bold',
44
- },
45
- };
@@ -1,26 +0,0 @@
1
- import clsx from 'clsx';
2
- import React, { JSX } from 'react';
3
-
4
- import styles from './Typography.module.scss';
5
- import { TypographyProps, TypographyType } from './Typography.types';
6
-
7
- function deriveTagFromType(type: TypographyType): keyof JSX.IntrinsicElements {
8
- switch (type) {
9
- case 'h1':
10
- case 'h2':
11
- case 'h3':
12
- case 'h4':
13
- case 'h5':
14
- case 'h6':
15
- return type as keyof JSX.IntrinsicElements;
16
- default:
17
- return 'span';
18
- }
19
- }
20
-
21
- function Typography({ as, children, className, type }: TypographyProps) {
22
- const ElementTag = as || deriveTagFromType(type);
23
- return <ElementTag className={clsx(styles[type], className)}>{children}</ElementTag>;
24
- }
25
-
26
- export default Typography;
@@ -1,28 +0,0 @@
1
- import { JSX } from 'react';
2
-
3
- export type TypographyType =
4
- | 'h1'
5
- | 'h2'
6
- | 'h3'
7
- | 'h4'
8
- | 'h5'
9
- | 'h6'
10
- | 'h7'
11
- | 'h8'
12
- | 'body-large'
13
- | 'body-regular'
14
- | 'body-semibold'
15
- | 'body-italic'
16
- | 'detail-medium'
17
- | 'detail-bold'
18
- | 'detail-upper-case';
19
-
20
- export interface TypographyProps {
21
- as?: Extract<
22
- keyof JSX.IntrinsicElements,
23
- 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
24
- >;
25
- children: string;
26
- className?: string;
27
- type: TypographyType;
28
- }
@@ -1 +0,0 @@
1
- @forward '@goodhood/design-tokens/lib/web/index';
File without changes
@@ -1,17 +0,0 @@
1
- @use 'sass:map';
2
-
3
- @function mapGet($map, $keys...) {
4
- @return map.get($map, $keys...);
5
- }
6
-
7
- @function getSemanticColor($color, $shade) {
8
- @return mapGet($tokens, color, semantic, $color, $shade);
9
- }
10
-
11
- @function getSpacing($spacingType) {
12
- @return mapGet($tokens, spacing, $spacingType);
13
- }
14
-
15
- @function getBorderRadius($spacingType) {
16
- @return mapGet($tokens, borderRadius, $spacingType);
17
- }
@@ -1,33 +0,0 @@
1
- @use 'sass:map';
2
-
3
- @mixin spacing($properties, $map: map.get($tokens, 'spacing')) {
4
- // Extract the correct spacing settings;
5
- @each $size, $i in $map {
6
- $value: map.get($tokens, 'spacing', $size);
7
- &-#{$size} {
8
- @each $property in $properties {
9
- #{$property}: #{$value};
10
- }
11
- }
12
- }
13
- }
14
-
15
- @mixin typography($type, $level) {
16
- // Extract the correct typography settings based on the provided type and level
17
- $typo-settings: map.get(map.get($tokens, $type), $level);
18
-
19
- // Ensure the level exists
20
- @if $typo-settings {
21
- margin-bottom: mapGet($typo-settings, 'paragraphSpacing');
22
- font-family: mapGet($typo-settings, 'fontFamily');
23
- font-size: mapGet($typo-settings, 'fontSize');
24
- font-weight: mapGet($typo-settings, 'fontWeight');
25
- letter-spacing: mapGet($typo-settings, 'letterSpacing');
26
- line-height: mapGet($typo-settings, 'lineHeight');
27
- text-decoration: mapGet($typo-settings, 'textDecoration');
28
- text-indent: mapGet($typo-settings, 'paragraphIndent');
29
- text-transform: mapGet($typo-settings, 'textCase');
30
- } @else {
31
- @error "Unknown typography type: #{$type} or level: #{$level}.";
32
- }
33
- }
@@ -1,3 +0,0 @@
1
- @import 'design-tokens';
2
- @import 'mixins';
3
- @import 'functions';
@@ -1,65 +0,0 @@
1
- *, :after, :before {
2
- box-sizing: border-box;
3
- padding: 0;
4
- margin: 0;
5
- }
6
-
7
- [hidden] {
8
- display: none !important;
9
- }
10
-
11
-
12
- input {
13
- border: none;
14
- appearance: none;
15
-
16
- &[type="search"] {
17
- appearance: none;
18
- }
19
-
20
- &[type="file"]::-webkit-file-upload-button {
21
- display: none;
22
- }
23
-
24
- &[type="number"] {
25
- appearance: textfield;
26
-
27
- &::-webkit-inner-spin-button,
28
- &::-webkit-outer-spin-button {
29
- appearance: none;
30
- }
31
- }
32
- }
33
-
34
- select {
35
- border: none;
36
- appearance: none;
37
- background-color: transparent;
38
-
39
- &::-ms-expand {
40
- display: none;
41
- }
42
- }
43
-
44
- textarea {
45
- border: none;
46
- appearance: none;
47
- -ms-overflow-style: none;
48
- resize: vertical;
49
- }
50
-
51
- button {
52
- border: none;
53
- background-color: transparent;
54
- text-align: left;
55
- }
56
-
57
- ul,
58
- ol {
59
- list-style-type: none;
60
- }
61
-
62
- img, svg{
63
- display: block;
64
- max-width: 100%;
65
- }
package/tsconfig.json DELETED
@@ -1,24 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "jsx": "react-jsx",
4
- "allowJs": false,
5
- "esModuleInterop": false,
6
- "allowSyntheticDefaultImports": true,
7
- "strict": true,
8
- "types": ["vite/client"]
9
- },
10
- "files": [],
11
- "include": [],
12
- "references": [
13
- {
14
- "path": "./tsconfig.lib.json"
15
- },
16
- {
17
- "path": "./tsconfig.spec.json"
18
- },
19
- {
20
- "path": "./tsconfig.storybook.json"
21
- }
22
- ],
23
- "extends": "../../tsconfig.base.json"
24
- }
package/tsconfig.lib.json DELETED
@@ -1,35 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist/out-tsc",
5
- "types": ["node", "vite/client"]
6
- },
7
- "files": [
8
- "../../node_modules/@nx/react/typings/cssmodule.d.ts",
9
- "../../node_modules/@nx/react/typings/image.d.ts"
10
- ],
11
- "exclude": [
12
- "jest.config.ts",
13
- "src/**/*.spec.ts",
14
- "src/**/*.test.ts",
15
- "src/**/*.spec.tsx",
16
- "src/**/*.test.tsx",
17
- "src/**/*.spec.js",
18
- "src/**/*.test.js",
19
- "src/**/*.spec.jsx",
20
- "src/**/*.test.jsx",
21
- "**/*.stories.ts",
22
- "**/*.stories.js",
23
- "**/*.stories.jsx",
24
- "**/*.stories.tsx"
25
- ],
26
- "include": [
27
- "vite.config.ts",
28
- "src/**/*.js",
29
- "src/**/*.jsx",
30
- "src/**/*.ts",
31
- "src/**/*.tsx",
32
- "__mocks__/**/*.js",
33
- "__mocks__/**/*.ts"
34
- ]
35
- }
@@ -1,20 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist/out-tsc",
5
- "module": "commonjs",
6
- "types": ["jest", "node", "@testing-library/jest-dom"]
7
- },
8
- "include": [
9
- "jest.config.ts",
10
- "src/**/*.test.ts",
11
- "src/**/*.spec.ts",
12
- "src/**/*.test.tsx",
13
- "src/**/*.spec.tsx",
14
- "src/**/*.test.js",
15
- "src/**/*.spec.js",
16
- "src/**/*.test.jsx",
17
- "src/**/*.spec.jsx",
18
- "src/**/*.d.ts"
19
- ]
20
- }
@@ -1,31 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "emitDecoratorMetadata": true,
5
- "outDir": ""
6
- },
7
- "files": [
8
- "../../node_modules/@nx/react/typings/styled-jsx.d.ts",
9
- "../../node_modules/@nx/react/typings/cssmodule.d.ts",
10
- "../../node_modules/@nx/react/typings/image.d.ts"
11
- ],
12
- "exclude": [
13
- "src/**/*.spec.ts",
14
- "src/**/*.test.ts",
15
- "src/**/*.spec.js",
16
- "src/**/*.test.js",
17
- "src/**/*.spec.tsx",
18
- "src/**/*.test.tsx",
19
- "src/**/*.spec.jsx",
20
- "src/**/*.test.js"
21
- ],
22
- "include": [
23
- "src/**/*.stories.ts",
24
- "src/**/*.stories.js",
25
- "src/**/*.stories.jsx",
26
- "src/**/*.stories.tsx",
27
- "src/**/*.stories.mdx",
28
- ".storybook/*.js",
29
- ".storybook/*.ts"
30
- ]
31
- }