@goodhood-web/ui 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +12 -0
- package/.eslintrc.json +25 -0
- package/.storybook/main.ts +31 -0
- package/.storybook/manager-head.html +1 -0
- package/.storybook/manager.ts +7 -0
- package/.storybook/nebenanTheme.ts +17 -0
- package/.storybook/preview.ts +9 -0
- package/.stylelintrc.json +14 -0
- package/README.md +7 -0
- package/__mocks__/svg.js +2 -0
- package/images/favicon.ico +0 -0
- package/images/logo.svg +11 -0
- package/jest.config.ts +16 -0
- package/package.json +1 -1
- package/project.json +88 -0
- package/{index.d.ts → src/index.ts} +25 -1
- package/src/lib/BaseButton/BaseButton.module.scss +11 -0
- package/src/lib/BaseButton/BaseButton.spec.tsx +12 -0
- package/src/lib/BaseButton/BaseButton.stories.tsx +26 -0
- package/src/lib/BaseButton/BaseButton.tsx +39 -0
- package/src/lib/Card/Card.module.scss +15 -0
- package/src/lib/Card/Card.spec.tsx +15 -0
- package/src/lib/Card/Card.stories.tsx +159 -0
- package/src/lib/Card/Card.tsx +31 -0
- package/src/lib/Card/Card.types.ts +12 -0
- package/src/lib/Card/Card.utils.spec.tsx +51 -0
- package/src/lib/Card/Card.utils.ts +23 -0
- package/src/lib/Card/CardBody/CardBody.module.scss +4 -0
- package/src/lib/Card/CardBody/CardBody.spec.tsx +15 -0
- package/src/lib/Card/CardBody/CardBody.stories.tsx +108 -0
- package/src/lib/Card/CardBody/CardBody.tsx +9 -0
- package/src/lib/Card/CardBody/CardBody.types.ts +4 -0
- package/src/lib/Card/CardHeader/CardHeader.module.scss +12 -0
- package/src/lib/Card/CardHeader/CardHeader.spec.tsx +72 -0
- package/src/lib/Card/CardHeader/CardHeader.stories.tsx +77 -0
- package/src/lib/Card/CardHeader/CardHeader.tsx +29 -0
- package/src/lib/Card/CardHeader/CardHeader.type.ts +14 -0
- package/src/lib/ContentCreatorButton/ContentCreatorButton.module.scss +13 -0
- package/src/lib/ContentCreatorButton/ContentCreatorButton.spec.tsx +14 -0
- package/src/lib/ContentCreatorButton/ContentCreatorButton.stories.tsx +29 -0
- package/src/lib/ContentCreatorButton/ContentCreatorButton.tsx +35 -0
- package/{lib/ContentCreatorButton/ContentCreatorButton.types.d.ts → src/lib/ContentCreatorButton/ContentCreatorButton.types.ts} +3 -2
- package/src/lib/Divider/Divider.module.scss +10 -0
- package/src/lib/Divider/Divider.spec.tsx +46 -0
- package/src/lib/Divider/Divider.stories.tsx +35 -0
- package/src/lib/Divider/Divider.tsx +17 -0
- package/src/lib/Divider/Divider.types.ts +6 -0
- package/src/lib/Fieldset/Fieldset.module.scss +3 -0
- package/src/lib/Fieldset/Fieldset.spec.tsx +68 -0
- package/src/lib/Fieldset/Fieldset.stories.tsx +60 -0
- package/src/lib/Fieldset/Fieldset.tsx +28 -0
- package/src/lib/Fieldset/Fieldset.types.ts +7 -0
- package/src/lib/Form/Form.spec.tsx +15 -0
- package/src/lib/Form/Form.stories.tsx +53 -0
- package/src/lib/Form/Form.tsx +14 -0
- package/src/lib/Form/Form.types.ts +11 -0
- package/src/lib/Icon/Icon.module.scss +7 -0
- package/src/lib/Icon/Icon.spec.tsx +28 -0
- package/src/lib/Icon/Icon.stories.tsx +88 -0
- package/src/lib/Icon/Icon.tsx +29 -0
- package/src/lib/Icon/Icon.types.ts +23 -0
- package/src/lib/Icon/icons/24x24/index.ts +89 -0
- package/src/lib/Icon/icons/24x24/svg/arrow_left.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/arrow_right.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/bookmark.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/bookmarked.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/burger_menu.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/camera.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/checkmark.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/checkmark_circle.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/chevron_down.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/chevron_left.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/chevron_right.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/chevron_up.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/comment_bubble.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/cross.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/cross_circle.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/envelope.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/event_calendar.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/external_link.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/eye.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/eye_crossed.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/filter.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/globe.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/heart.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/image.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/loudspeaker.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/marketplace.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/more_dots.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/more_dots_alt.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/mute.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/notification_bell.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/paperclip.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/pencil.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/pin.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/plus.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/plus_circle.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/privacy_lock.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/search.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/share_arrow.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/share_arrow_outline.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/sort.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/thanks.svg +1 -0
- package/src/lib/Icon/icons/24x24/svg/trash_can.svg +1 -0
- package/src/lib/Icon/icons/32x32/index.ts +179 -0
- package/src/lib/Icon/icons/32x32/svg/address_book.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/baby_toy.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/bicycle.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/bookmark.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/books.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/bubble_heart_filled.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/bubble_heart_outline.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/buildings.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/burger_menu.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/business.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/business_profile.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/camera.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/camera_crossed.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/car.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/carrot.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/chat.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/checkmark_circle.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/christmas_tree.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/clipboard.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/clothing.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/cocktail.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/comment_bubble.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/compass.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/computer.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/couch.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/credit_card.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/cross_circle.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/cutlery.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/drill_tool.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/email.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/envelope.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/event_calendar_check.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/event_calendar_date.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/event_calendar_plus.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/exchange.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/eye.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/eye_crossed.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/gift.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/group.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/healthcare.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/heart.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/house.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/image.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/info.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/invite_neighbour.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/key.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/kitchen_pot.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/list.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/log_out.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/loudspeaker.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/map.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/marketplace.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/miscellaneous_other.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/more_dots.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/more_dots_alt.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/music.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/nebenan.de.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/neighbour.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/notification_bell.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/organisation.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/paper_form_empty.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/paper_form_filled.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/paperclip.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/paw.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/pencil.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/pin.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/pins.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/plant.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/plus.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/plus_circle.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/post.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/privacy_lock.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/qr_code.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/search.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/settings_cog.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/shopping_bag.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/shopping_cart.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/special_place.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/suitcase.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/supporter.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/tennis_ball.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/thanks.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/trash_can.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/truck.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/user.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/user_profile.svg +1 -0
- package/src/lib/Icon/icons/32x32/svg/wellness.svg +1 -0
- package/src/lib/Icon/icons/index.ts +9 -0
- package/src/lib/IconButton/IconButton.module.scss +36 -0
- package/src/lib/IconButton/IconButton.spec.tsx +56 -0
- package/src/lib/IconButton/IconButton.stories.tsx +36 -0
- package/src/lib/IconButton/IconButton.tsx +25 -0
- package/{lib/IconButton/IconButton.types.d.ts → src/lib/IconButton/IconButton.types.ts} +10 -10
- package/src/lib/IconButton/utils.ts +6 -0
- package/src/lib/Image/Image.spec.tsx +10 -0
- package/src/lib/Image/Image.tsx +7 -0
- package/src/lib/Image/Image.type.tsx +5 -0
- package/src/lib/LabelPill/LabelPill.module.scss +33 -0
- package/src/lib/LabelPill/LabelPill.spec.tsx +23 -0
- package/src/lib/LabelPill/LabelPill.stories.tsx +31 -0
- package/src/lib/LabelPill/LabelPill.tsx +16 -0
- package/src/lib/LabelPill/LabelPill.types.ts +4 -0
- package/src/lib/Legend/Legend.module.scss +9 -0
- package/src/lib/Legend/Legend.spec.tsx +39 -0
- package/src/lib/Legend/Legend.stories.ts +39 -0
- package/src/lib/Legend/Legend.tsx +19 -0
- package/src/lib/Legend/Legend.types.ts +5 -0
- package/src/lib/MenuItem/MenuItem.module.scss +70 -0
- package/src/lib/MenuItem/MenuItem.spec.tsx +47 -0
- package/src/lib/MenuItem/MenuItem.stories.tsx +97 -0
- package/src/lib/MenuItem/MenuItem.tsx +34 -0
- package/src/lib/MenuItem/MenuItem.types.ts +10 -0
- package/src/lib/NotificationBubble/NotificationBubble.module.scss +30 -0
- package/src/lib/NotificationBubble/NotificationBubble.spec.tsx +36 -0
- package/src/lib/NotificationBubble/NotificationBubble.stories.tsx +56 -0
- package/src/lib/NotificationBubble/NotificationBubble.tsx +34 -0
- package/{lib/NotificationBubble/NotificationBubble.types.d.ts → src/lib/NotificationBubble/NotificationBubble.types.tsx} +3 -2
- package/src/lib/Thumbnail/Thumbnail.module.scss +67 -0
- package/src/lib/Thumbnail/Thumbnail.spec.tsx +51 -0
- package/src/lib/Thumbnail/Thumbnail.stories.tsx +242 -0
- package/src/lib/Thumbnail/Thumbnail.tsx +28 -0
- package/src/lib/Thumbnail/Thumbnail.type.tsx +18 -0
- package/src/lib/Toggle/Toggle.module.scss +53 -0
- package/src/lib/Toggle/Toggle.spec.tsx +23 -0
- package/src/lib/Toggle/Toggle.stories.tsx +38 -0
- package/src/lib/Toggle/Toggle.tsx +32 -0
- package/{lib/Toggle/Toggle.types.d.ts → src/lib/Toggle/Toggle.types.ts} +3 -2
- package/src/lib/ToggleInput/ToggleInput.module.scss +33 -0
- package/src/lib/ToggleInput/ToggleInput.spec.tsx +45 -0
- package/src/lib/ToggleInput/ToggleInput.stories.tsx +62 -0
- package/src/lib/ToggleInput/ToggleInput.tsx +40 -0
- package/{lib/ToggleInput/ToggleInput.types.d.ts → src/lib/ToggleInput/ToggleInput.types.ts} +5 -3
- package/src/lib/Typography/Typography.module.scss +61 -0
- package/src/lib/Typography/Typography.spec.tsx +60 -0
- package/src/lib/Typography/Typography.stories.tsx +45 -0
- package/src/lib/Typography/Typography.tsx +26 -0
- package/src/lib/Typography/Typography.types.ts +28 -0
- package/src/styles/_design-tokens.scss +1 -0
- package/src/styles/_fonts.scss +0 -0
- package/src/styles/_functions.scss +17 -0
- package/src/styles/_mixins.scss +33 -0
- package/src/styles/index.scss +3 -0
- package/src/styles/reset.scss +65 -0
- package/tsconfig.json +24 -0
- package/tsconfig.lib.json +35 -0
- package/tsconfig.spec.json +20 -0
- package/tsconfig.storybook.json +31 -0
- package/vite.config.ts +57 -0
- package/index.js +0 -93
- package/index.mjs +0 -4258
- package/lib/BaseButton/BaseButton.d.ts +0 -11
- package/lib/Card/Card.d.ts +0 -3
- package/lib/Card/Card.types.d.ts +0 -10
- package/lib/Card/Card.utils.d.ts +0 -3
- package/lib/Card/CardBody/CardBody.d.ts +0 -3
- package/lib/Card/CardBody/CardBody.types.d.ts +0 -5
- package/lib/Card/CardHeader/CardHeader.d.ts +0 -3
- package/lib/Card/CardHeader/CardHeader.type.d.ts +0 -10
- package/lib/ContentCreatorButton/ContentCreatorButton.d.ts +0 -3
- package/lib/Divider/Divider.d.ts +0 -3
- package/lib/Divider/Divider.types.d.ts +0 -6
- package/lib/Fieldset/Fieldset.d.ts +0 -3
- package/lib/Fieldset/Fieldset.types.d.ts +0 -8
- package/lib/Form/Form.d.ts +0 -3
- package/lib/Form/Form.types.d.ts +0 -10
- package/lib/Icon/Icon.d.ts +0 -4
- package/lib/Icon/Icon.types.d.ts +0 -18
- package/lib/Icon/icons/24x24/index.d.ts +0 -130
- package/lib/Icon/icons/32x32/index.d.ts +0 -265
- package/lib/Icon/icons/index.d.ts +0 -395
- package/lib/IconButton/IconButton.d.ts +0 -3
- package/lib/IconButton/utils.d.ts +0 -3
- package/lib/Image/Image.d.ts +0 -3
- package/lib/Image/Image.type.d.ts +0 -5
- package/lib/LabelPill/LabelPill.d.ts +0 -3
- package/lib/LabelPill/LabelPill.types.d.ts +0 -4
- package/lib/Legend/Legend.d.ts +0 -3
- package/lib/Legend/Legend.types.d.ts +0 -5
- package/lib/MenuItem/MenuItem.d.ts +0 -3
- package/lib/MenuItem/MenuItem.types.d.ts +0 -9
- package/lib/NotificationBubble/NotificationBubble.d.ts +0 -3
- package/lib/Toggle/Toggle.d.ts +0 -3
- package/lib/ToggleInput/ToggleInput.d.ts +0 -3
- package/lib/Typography/Typography.d.ts +0 -3
- package/lib/Typography/Typography.types.d.ts +0 -8
- package/style.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="none"><path stroke="#201649" stroke-width="1.5" d="M16 14.5a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 0a8 8 0 0 0-8 8v2.114c0 .834.517 1.578 1.316 1.814C10.821 26.87 13.41 27.5 16 27.5s5.18-.629 6.684-1.072c.8-.236 1.316-.98 1.316-1.814V22.5a8 8 0 0 0-8-8Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="none"><path stroke="#201649" stroke-width="1.5" d="M16 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 0c-3.866 0-7 3.5-7 7 0 .263.015 1.523.043 1.779M16 17c3.866 0 6.957 3.5 7 7 .003.263-.015 1.523-.043 1.779m-13.914 0A11.945 11.945 0 0 0 16 28c2.593 0 4.995-.823 6.957-2.221m-13.914 0A11.985 11.985 0 0 1 4 16C4 9.373 9.373 4 16 4s12 5.373 12 12c0 4.034-1.99 7.603-5.043 9.779"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="none"><path stroke="#201649" stroke-linecap="round" stroke-miterlimit="16" stroke-width="1.5" d="M16 25.5S11 21 11 16c0-3.881 3.013-7.461 4.361-8.869a.875.875 0 0 1 1.278 0C17.987 8.54 21 12.12 21 16c0 5-5 9.5-5 9.5Zm0 0c8.398 0 11.725-4.087 11.983-11.529a.926.926 0 0 0-.95-.966c-1.358.038-3.9.22-6.033 1.007M16 25.5c-8.267 0-11.713-4.137-11.983-11.529a.925.925 0 0 1 .95-.966c1.358.038 3.9.22 6.033 1.007"/></svg>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@mixin iconButtonSize($size) {
|
|
2
|
+
width: $size;
|
|
3
|
+
height: $size;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.iconButton {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
border-radius: 50%;
|
|
11
|
+
background: getSemanticColor('primary', 'primary');
|
|
12
|
+
|
|
13
|
+
&:disabled {
|
|
14
|
+
background: getSemanticColor('surface', 'surface');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&:hover {
|
|
18
|
+
background: getSemanticColor('primary', 'primaryVariant');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:active {
|
|
22
|
+
background: getSemanticColor('primary', 'primary');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&--small {
|
|
26
|
+
@include iconButtonSize(40px);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&--medium {
|
|
30
|
+
@include iconButtonSize(48px);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&--large {
|
|
34
|
+
@include iconButtonSize(56px);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
|
|
4
|
+
import IconButton from './IconButton';
|
|
5
|
+
|
|
6
|
+
describe('IconButton', () => {
|
|
7
|
+
it('should render a medium sized icon button by default', () => {
|
|
8
|
+
const { baseElement } = render(
|
|
9
|
+
<IconButton
|
|
10
|
+
icon="pencil"
|
|
11
|
+
ariaLabel="create post"
|
|
12
|
+
onClick={() => {
|
|
13
|
+
// empty body
|
|
14
|
+
}}
|
|
15
|
+
/>,
|
|
16
|
+
);
|
|
17
|
+
const iconButtonEl = baseElement.querySelector('[type=button]');
|
|
18
|
+
|
|
19
|
+
expect(iconButtonEl).toBeInTheDocument();
|
|
20
|
+
expect(iconButtonEl).not.toBeEmptyDOMElement();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should render a empty button if icon and size are incompatible', () => {
|
|
24
|
+
const { baseElement } = render(
|
|
25
|
+
// @ts-expect-error no small icon for address_book
|
|
26
|
+
<IconButton
|
|
27
|
+
size="small"
|
|
28
|
+
icon="address_book"
|
|
29
|
+
onClick={() => {
|
|
30
|
+
// empty body
|
|
31
|
+
}}
|
|
32
|
+
/>,
|
|
33
|
+
);
|
|
34
|
+
const iconButtonEl = baseElement.querySelector('[type=button]');
|
|
35
|
+
|
|
36
|
+
expect(iconButtonEl).toBeInTheDocument();
|
|
37
|
+
expect(iconButtonEl).toBeEmptyDOMElement();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should handle button click', async () => {
|
|
41
|
+
const handleClick = jest.fn();
|
|
42
|
+
|
|
43
|
+
const { baseElement } = render(
|
|
44
|
+
<IconButton
|
|
45
|
+
icon="pencil"
|
|
46
|
+
size="medium"
|
|
47
|
+
onClick={handleClick}
|
|
48
|
+
ariaLabel="create new post"
|
|
49
|
+
/>,
|
|
50
|
+
);
|
|
51
|
+
const iconButtonEl = baseElement.querySelector('[type=button]');
|
|
52
|
+
|
|
53
|
+
await userEvent.click(iconButtonEl as HTMLButtonElement);
|
|
54
|
+
expect(handleClick).toHaveBeenCalled();
|
|
55
|
+
});
|
|
56
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import Icons24 from '../Icon/icons/24x24';
|
|
4
|
+
import Icons32 from '../Icon/icons/32x32';
|
|
5
|
+
|
|
6
|
+
import IconButton from './IconButton';
|
|
7
|
+
|
|
8
|
+
const iconNames24 = Object.keys(Icons24);
|
|
9
|
+
const iconName32 = Object.keys(Icons32);
|
|
10
|
+
const allIconNames = Array.from(new Set([...iconNames24, ...iconName32]));
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof IconButton> = {
|
|
13
|
+
argTypes: {
|
|
14
|
+
icon: {
|
|
15
|
+
control: { type: 'select' },
|
|
16
|
+
options: allIconNames,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
component: IconButton,
|
|
20
|
+
title: 'Components/IconButton',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof IconButton>;
|
|
25
|
+
|
|
26
|
+
export const Primary: Story = {
|
|
27
|
+
args: {
|
|
28
|
+
icon: 'pencil',
|
|
29
|
+
},
|
|
30
|
+
parameters: {
|
|
31
|
+
design: {
|
|
32
|
+
type: 'figma',
|
|
33
|
+
url: 'https://www.figma.com/file/hN7xJ3rRAemUJT9T0uEfUS/Product-Design-System?type=design&node-id=6952-1150&mode=design&t=3J2DmPvWcXt6Hs2q-4',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import BaseButton from '../BaseButton/BaseButton';
|
|
5
|
+
import Icon from '../Icon/Icon';
|
|
6
|
+
|
|
7
|
+
import styles from './IconButton.module.scss';
|
|
8
|
+
import { IconButtonProps } from './IconButton.types';
|
|
9
|
+
import { getIconSize } from './utils';
|
|
10
|
+
|
|
11
|
+
const IconButton = ({ icon, size = 'medium', ...baseButtonProps }: IconButtonProps) => {
|
|
12
|
+
const iconSize = getIconSize(size);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<BaseButton
|
|
16
|
+
{...baseButtonProps}
|
|
17
|
+
className={clsx(styles.iconButton, styles[`iconButton--${size}`])}
|
|
18
|
+
>
|
|
19
|
+
{/* @ts-expect-error Icon validates props */}
|
|
20
|
+
<Icon size={iconSize} name={icon} />
|
|
21
|
+
</BaseButton>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default IconButton;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { BaseButtonProps } from '../BaseButton/BaseButton';
|
|
2
2
|
import { Icon24, Icon32 } from '../Icon/Icon.types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} | {
|
|
6
|
-
|
|
7
|
-
});
|
|
3
|
+
|
|
4
|
+
type BaseIconButtonProps = Omit<BaseButtonProps, 'children' | 'ref' | 'className'> &
|
|
5
|
+
({ ariaLabel: string } | { ariaLabelledBy: string });
|
|
6
|
+
|
|
8
7
|
type IconButtonIcon24Props = {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
icon: Icon24;
|
|
9
|
+
size?: 'small';
|
|
11
10
|
} & BaseIconButtonProps;
|
|
11
|
+
|
|
12
12
|
type IconButtonIcon32Props = {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
icon: Icon32;
|
|
14
|
+
size: 'medium' | 'large';
|
|
15
15
|
} & BaseIconButtonProps;
|
|
16
|
+
|
|
16
17
|
export type IconButtonProps = IconButtonIcon32Props | IconButtonIcon24Props;
|
|
17
|
-
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
|
|
3
|
+
import Image from './Image';
|
|
4
|
+
|
|
5
|
+
describe('Image', () => {
|
|
6
|
+
it('should render successfully', () => {
|
|
7
|
+
const { baseElement } = render(<Image src="" alt="" />);
|
|
8
|
+
expect(baseElement).toBeTruthy();
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.labelPill {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
border-radius: mapGet($tokens, borderRadius, lg);
|
|
6
|
+
background: getSemanticColor('secondary2', 'secondary2');
|
|
7
|
+
|
|
8
|
+
span {
|
|
9
|
+
color: getSemanticColor('secondary2', 'onSecondary2');
|
|
10
|
+
line-height: mapGet($tokens, lineHeight, sm);
|
|
11
|
+
text-align: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&--small {
|
|
15
|
+
height: 20px;
|
|
16
|
+
padding: 0px 8px;
|
|
17
|
+
|
|
18
|
+
span {
|
|
19
|
+
font-size: 10px;
|
|
20
|
+
font-weight: 800;
|
|
21
|
+
text-transform: uppercase;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&--medium {
|
|
26
|
+
padding: 4px 8px;
|
|
27
|
+
|
|
28
|
+
span {
|
|
29
|
+
font-size: 12px;
|
|
30
|
+
font-weight: 700;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
|
|
3
|
+
import LabelPill from './LabelPill';
|
|
4
|
+
|
|
5
|
+
describe('LabelPill', () => {
|
|
6
|
+
it('should render with "small" size', () => {
|
|
7
|
+
const { baseElement } = render(<LabelPill label="New" size="small" />);
|
|
8
|
+
const spanElement = baseElement.querySelector('span.labelPill span');
|
|
9
|
+
|
|
10
|
+
expect(spanElement?.innerHTML).toBe('New');
|
|
11
|
+
|
|
12
|
+
const elementWithClassName = baseElement.querySelector('.labelPill--small');
|
|
13
|
+
|
|
14
|
+
expect(elementWithClassName).not.toBeNull();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('should renders with "medium" size', () => {
|
|
18
|
+
const { baseElement } = render(<LabelPill label="New" size="medium" />);
|
|
19
|
+
const elementWithClassName = baseElement.querySelector('.labelPill--medium');
|
|
20
|
+
|
|
21
|
+
expect(elementWithClassName).not.toBeNull();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import LabelPill from './LabelPill';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof LabelPill> = {
|
|
6
|
+
argTypes: {
|
|
7
|
+
size: {
|
|
8
|
+
control: { type: 'select' },
|
|
9
|
+
options: ['small', 'medium'],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
component: LabelPill,
|
|
13
|
+
title: 'Components/LabelPill',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
type Story = StoryObj<typeof LabelPill>;
|
|
19
|
+
|
|
20
|
+
export const Primary: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
label: 'new',
|
|
23
|
+
size: 'small',
|
|
24
|
+
},
|
|
25
|
+
parameters: {
|
|
26
|
+
design: {
|
|
27
|
+
type: 'figma',
|
|
28
|
+
url: 'https://www.figma.com/file/hN7xJ3rRAemUJT9T0uEfUS/Product-Design-System?node-id=1680%3A6106&mode=dev',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
|
|
3
|
+
import styles from './LabelPill.module.scss';
|
|
4
|
+
import { LabelPillProps } from './LabelPill.types';
|
|
5
|
+
|
|
6
|
+
const LabelPill = ({ label, size }: LabelPillProps) => {
|
|
7
|
+
const pillClass = styles[`labelPill--${size}`];
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<span className={clsx(styles.labelPill, pillClass)}>
|
|
11
|
+
<span>{label}</span>
|
|
12
|
+
</span>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default LabelPill;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
|
|
3
|
+
import Legend from './Legend';
|
|
4
|
+
|
|
5
|
+
describe('Legend', () => {
|
|
6
|
+
it('should render with a headline', () => {
|
|
7
|
+
const { getByText } = render(<Legend headline="Example Headline" />);
|
|
8
|
+
const headlineElement = getByText('Example Headline');
|
|
9
|
+
|
|
10
|
+
expect(headlineElement).toBeInTheDocument();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should render with optional text when provided', () => {
|
|
14
|
+
const testText = 'Additional information';
|
|
15
|
+
const { getByText } = render(
|
|
16
|
+
<Legend headline="Headline" text={testText} />,
|
|
17
|
+
);
|
|
18
|
+
const textElement = getByText(testText);
|
|
19
|
+
|
|
20
|
+
expect(textElement).toBeInTheDocument();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should not render optional text when not provided', () => {
|
|
24
|
+
const { queryByText } = render(<Legend headline="Headline" />);
|
|
25
|
+
const textElement = queryByText('Additional information');
|
|
26
|
+
|
|
27
|
+
expect(textElement).toBeNull();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should apply custom className if provided', () => {
|
|
31
|
+
const customClass = 'custom-legend-class';
|
|
32
|
+
const { container } = render(
|
|
33
|
+
<Legend headline="Headline" className={customClass} />,
|
|
34
|
+
);
|
|
35
|
+
const legendElement = container.firstChild;
|
|
36
|
+
|
|
37
|
+
expect(legendElement).toHaveClass(customClass);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import Legend from './Legend';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Legend> = {
|
|
6
|
+
argTypes: {
|
|
7
|
+
className: {
|
|
8
|
+
control: { type: 'text' },
|
|
9
|
+
description: 'Additional CSS class name',
|
|
10
|
+
},
|
|
11
|
+
headline: {
|
|
12
|
+
control: { type: 'text' },
|
|
13
|
+
description: 'Headline of the legend',
|
|
14
|
+
},
|
|
15
|
+
text: {
|
|
16
|
+
control: { type: 'text' },
|
|
17
|
+
description: 'Text of the legend',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
component: Legend,
|
|
21
|
+
title: 'Components/Legend',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
|
|
26
|
+
type Story = StoryObj<typeof Legend>;
|
|
27
|
+
|
|
28
|
+
export const Primary: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
headline: 'Test Headline',
|
|
31
|
+
text: 'Test Text',
|
|
32
|
+
},
|
|
33
|
+
parameters: {
|
|
34
|
+
design: {
|
|
35
|
+
type: 'figma',
|
|
36
|
+
url: 'https://www.figma.com/file/Q0LB4cf1uDAOQlRv79mj2W/User-Settings?type=design&node-id=5534-27808&mode=design&t=twDm2lPGITVsLdiy-0',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
|
|
3
|
+
import { Typography } from '@goodhood-web/ui';
|
|
4
|
+
|
|
5
|
+
import styles from './Legend.module.scss';
|
|
6
|
+
import { LegendProps } from './Legend.types';
|
|
7
|
+
|
|
8
|
+
const Legend = ({ className, headline, text }: LegendProps) => (
|
|
9
|
+
<legend className={clsx(styles.legend, className)}>
|
|
10
|
+
<Typography type="h5">{headline}</Typography>
|
|
11
|
+
{text && (
|
|
12
|
+
<Typography className={styles.text} type="body-regular" as="p">
|
|
13
|
+
{text}
|
|
14
|
+
</Typography>
|
|
15
|
+
)}
|
|
16
|
+
</legend>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default Legend;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
$color-surface: getSemanticColor('surface', 'surface');
|
|
2
|
+
$color-on-surface: getSemanticColor('surface', 'onSurface');
|
|
3
|
+
$color-on-surface-variant: getSemanticColor('surface', 'onSurfaceVariant');
|
|
4
|
+
$color-surface-container: getSemanticColor('surface', 'surfaceContainer');
|
|
5
|
+
|
|
6
|
+
$color-primary: getSemanticColor('primary', 'primary');
|
|
7
|
+
$color-on-primary-container: getSemanticColor('primary', 'onPrimaryContainer');
|
|
8
|
+
$color-primary-container: getSemanticColor('primary', 'primaryContainer');
|
|
9
|
+
|
|
10
|
+
$border-radius-sm: mapGet($tokens, borderRadius, sm);
|
|
11
|
+
|
|
12
|
+
$spacing-sm: getSpacing('sm');
|
|
13
|
+
|
|
14
|
+
.menuItem {
|
|
15
|
+
display: flex;
|
|
16
|
+
width: 280px;
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
align-items: center;
|
|
19
|
+
padding: 0 $spacing-sm;
|
|
20
|
+
background-color: $color-surface;
|
|
21
|
+
color: $color-on-surface;
|
|
22
|
+
gap: $spacing-sm;
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
|
|
25
|
+
.highlightFrame {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex: 1;
|
|
28
|
+
align-items: center;
|
|
29
|
+
padding: $spacing-sm;
|
|
30
|
+
border-radius: $border-radius-sm;
|
|
31
|
+
gap: $spacing-sm;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rightIcon {
|
|
35
|
+
display: inherit;
|
|
36
|
+
margin-left: auto;
|
|
37
|
+
|
|
38
|
+
svg path {
|
|
39
|
+
stroke: $color-on-surface-variant !important;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
&--selected {
|
|
43
|
+
.highlightFrame {
|
|
44
|
+
background-color: $color-primary-container;
|
|
45
|
+
|
|
46
|
+
svg path {
|
|
47
|
+
stroke: $color-on-primary-container;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
&:hover {
|
|
51
|
+
color: $color-on-primary-container;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
&:not(&--selected) {
|
|
55
|
+
&:active {
|
|
56
|
+
background-color: $color-surface-container;
|
|
57
|
+
}
|
|
58
|
+
&:hover {
|
|
59
|
+
color: $color-on-surface-variant;
|
|
60
|
+
|
|
61
|
+
svg path {
|
|
62
|
+
stroke: $color-on-surface-variant;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.highlightFrame {
|
|
66
|
+
background-color: $color-surface-container;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
2
|
+
|
|
3
|
+
import MenuItem from './MenuItem';
|
|
4
|
+
import { MenuItemProps } from './MenuItem.types';
|
|
5
|
+
|
|
6
|
+
describe('MenuItem Component', () => {
|
|
7
|
+
const defaultProps: MenuItemProps = {
|
|
8
|
+
labelPillText: 'Label',
|
|
9
|
+
leftIcon: null,
|
|
10
|
+
onClick: jest.fn(),
|
|
11
|
+
rightIcon: null,
|
|
12
|
+
text: 'Test Menu Item',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
it('renders with the correct props', () => {
|
|
16
|
+
render(<MenuItem {...defaultProps} />);
|
|
17
|
+
|
|
18
|
+
const textElement = screen.getByText(defaultProps.text);
|
|
19
|
+
const labelPillElement = screen.getByText(defaultProps.labelPillText);
|
|
20
|
+
|
|
21
|
+
expect(textElement).toBeInTheDocument();
|
|
22
|
+
expect(labelPillElement).toBeInTheDocument();
|
|
23
|
+
expect(textElement.textContent).toBe(defaultProps.text);
|
|
24
|
+
expect(labelPillElement.textContent).toBe(defaultProps.labelPillText);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('renders left and right icons when provided', () => {
|
|
28
|
+
const mockLeftIcon = <span>Left Icon</span>;
|
|
29
|
+
const mockRightIcon = <span>Right Icon</span>;
|
|
30
|
+
render(
|
|
31
|
+
<MenuItem {...defaultProps} leftIcon={mockLeftIcon} rightIcon={mockRightIcon} />,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
expect(screen.getByText('Left Icon')).toBeInTheDocument();
|
|
35
|
+
expect(screen.getByText('Right Icon')).toBeInTheDocument();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('calls onClick when clicked', () => {
|
|
39
|
+
render(<MenuItem {...defaultProps} />);
|
|
40
|
+
|
|
41
|
+
const menuItem = screen.getByRole('button');
|
|
42
|
+
|
|
43
|
+
fireEvent.click(menuItem);
|
|
44
|
+
|
|
45
|
+
expect(defaultProps.onClick).toHaveBeenCalledTimes(1);
|
|
46
|
+
});
|
|
47
|
+
});
|