From 326163c1769227a62c319a5d76ae09df7f77e173 Mon Sep 17 00:00:00 2001 From: benprosen Date: Mon, 28 Oct 2024 13:04:11 -0500 Subject: [PATCH] chore(Badge): Add story for Badge about adding Icon to a badge (#1517) * chore(Badge): Add story for Badge about adding Icon to a badge * StyleIcon -> WithIcon * Add more examples --- ...add-badge-icon-story_2024-10-02-21-08.json | 10 +++ packages/core/src/Badge/Badge.stories.tsx | 27 +++++++ .../Banner/__snapshots__/Banner.spec.tsx.snap | 81 ------------------- 3 files changed, 37 insertions(+), 81 deletions(-) create mode 100644 common/changes/pcln-design-system/chore-add-badge-icon-story_2024-10-02-21-08.json diff --git a/common/changes/pcln-design-system/chore-add-badge-icon-story_2024-10-02-21-08.json b/common/changes/pcln-design-system/chore-add-badge-icon-story_2024-10-02-21-08.json new file mode 100644 index 0000000000..5cf7b12634 --- /dev/null +++ b/common/changes/pcln-design-system/chore-add-badge-icon-story_2024-10-02-21-08.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "pcln-design-system", + "comment": "Adds story to Badge about Icon styling", + "type": "none" + } + ], + "packageName": "pcln-design-system" +} \ No newline at end of file diff --git a/packages/core/src/Badge/Badge.stories.tsx b/packages/core/src/Badge/Badge.stories.tsx index 2b1a546179..765e0bbafa 100644 --- a/packages/core/src/Badge/Badge.stories.tsx +++ b/packages/core/src/Badge/Badge.stories.tsx @@ -1,7 +1,9 @@ import React from 'react' import styled from 'styled-components' +import { Trophy } from 'pcln-icons' import { Grid } from '../Grid/Grid' import { Text } from '../Text/Text' +import { Flex } from '../Flex/Flex' import { colorSchemeNames } from '../storybook/args' import { textTransformValues } from '../utils/attrs/typographyAttrs' import { Badge, sizes, type BadgeProps } from './Badge' @@ -103,3 +105,28 @@ const ColorSchemesTemplate = (args) => { } export const ColorSchemes = ColorSchemesTemplate.bind({}) ColorSchemesTemplate.args = {} + +export const WithIcon = () => { + return ( + <> + + + + Badge + + + + + + Badge + + + + + + Badge + + + + ) +} diff --git a/packages/core/src/Banner/__snapshots__/Banner.spec.tsx.snap b/packages/core/src/Banner/__snapshots__/Banner.spec.tsx.snap index 882dfd4180..5dc0652dfa 100644 --- a/packages/core/src/Banner/__snapshots__/Banner.spec.tsx.snap +++ b/packages/core/src/Banner/__snapshots__/Banner.spec.tsx.snap @@ -297,87 +297,6 @@ exports[`Banner renders with blue bg 1`] = ` `; -exports[`Banner renders with custom iconName and size 1`] = ` -.c0 { - background-color: #0a0; - color: #fff; - text-align: left; -} - -.c4 { - text-align: left; - width: 100%; -} - -.c2 { - -webkit-flex: none; - -ms-flex: none; - flex: none; - line-height: 1; - margin-top: -2px; - margin-right: 8px; - width: 24px; -} - -.c3 { - outline: none; -} - -.c1 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - -ms-flex-pack: justify; - justify-content: space-between; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; -} - -.c5 { - font-size: 14px; -} - -
-
- - - -
- -
-
-
-`; - exports[`Banner renders with green bg 1`] = ` .c2 { -webkit-flex: none;