Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(NumberIcon)!: introduce 2.0 component #1891

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat(NumberIcon): remove sm size variant
- also add export and nesting for V2 storybook
booc0mtaco committed Mar 19, 2024
commit 1a472974c1108d523b080757f1e6511f3372d010
8 changes: 0 additions & 8 deletions src/components/NumberIcon/NumberIcon-v2.module.css
Original file line number Diff line number Diff line change
@@ -26,14 +26,6 @@
/**
* Size Variants.
*/
.number-icon--size-sm {
/* Line height set to 1 here since this should only ever be on 1 line and it evens out padding in circle. */
line-height: 1;
height: 1rem;
width: 1rem;
min-width: 1rem;
}

.number-icon--size-md {
height: 1.5rem;
width: 1.5rem;
17 changes: 8 additions & 9 deletions src/components/NumberIcon/NumberIcon-v2.stories.tsx
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import React from 'react';
import { NumberIcon } from './NumberIcon-v2';

export default {
title: 'Components/NumberIcon (v2)',
title: 'Components/V2/NumberIcon',
component: NumberIcon,
parameters: {
badges: ['intro-1.0', 'current-2.0'],
@@ -28,7 +28,6 @@ export const Sizes: Story = {
render: (args) => {
return (
<>
<NumberIcon number={1} size="sm" {...args} />
<NumberIcon number={2} size="md" {...args} />
<NumberIcon number={3} size="lg" {...args} />
</>
@@ -100,16 +99,16 @@ export const DifferentNumbers: Story = {
*/
export const NumberIconList: Story = {
parameters: {
badges: ['intro-1.0', 'implementationExample'],
badges: ['intro-1.0', 'current-2.0', 'implementationExample'],
},
render: () => (
<div className="flex flex-wrap gap-1">
<NumberIcon aria-label="Item 1" number={1} size="sm" />
<NumberIcon aria-label="Item 2" number={2} size="sm" />
<NumberIcon aria-label="Item 3" number={3} size="sm" />
<NumberIcon aria-label="Item 4" number={4} size="sm" />
<NumberIcon aria-label="Item 5" number={5} size="sm" />
<NumberIcon aria-label="Item 6" number={6} size="sm" />
<NumberIcon aria-label="Item 1" number={1} size="md" />
<NumberIcon aria-label="Item 2" number={2} size="md" />
<NumberIcon aria-label="Item 3" number={3} size="md" />
<NumberIcon aria-label="Item 4" number={4} size="md" />
<NumberIcon aria-label="Item 5" number={5} size="md" />
<NumberIcon aria-label="Item 6" number={6} size="md" />
</div>
),
};
2 changes: 1 addition & 1 deletion src/components/NumberIcon/NumberIcon-v2.tsx
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ export interface Props {
*
* **Default is `"lg"`**.
*/
size?: Extract<Size, 'sm' | 'md' | 'lg'>;
size?: Extract<Size, 'md' | 'lg'>;
/**
* Indication of the status of the referenced item
*/
1 change: 1 addition & 0 deletions src/components/NumberIcon/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { NumberIcon as default } from './NumberIcon';
export { NumberIcon as NumberIconV2 } from './NumberIcon-v2';