From 864329d3ea9f42efe51bc5e99417a5ad93d98158 Mon Sep 17 00:00:00 2001 From: ferreroltd <73488793+ferreroltd@users.noreply.github.com> Date: Mon, 13 May 2024 19:00:41 +0100 Subject: [PATCH] Feat/story system icons (#2123) --- .changeset/loud-seals-kiss.md | 5 ++ .../src/components/Icon/NewIcons.stories.tsx | 57 ++++++++++--------- 2 files changed, 34 insertions(+), 28 deletions(-) create mode 100644 .changeset/loud-seals-kiss.md diff --git a/.changeset/loud-seals-kiss.md b/.changeset/loud-seals-kiss.md new file mode 100644 index 0000000000..2dd3e6c62e --- /dev/null +++ b/.changeset/loud-seals-kiss.md @@ -0,0 +1,5 @@ +--- +"@kadena/react-ui": patch +--- + +Adds story for new System icons diff --git a/packages/libs/react-ui/src/components/Icon/NewIcons.stories.tsx b/packages/libs/react-ui/src/components/Icon/NewIcons.stories.tsx index fdb3ed93d0..15d2daad95 100644 --- a/packages/libs/react-ui/src/components/Icon/NewIcons.stories.tsx +++ b/packages/libs/react-ui/src/components/Icon/NewIcons.stories.tsx @@ -1,13 +1,14 @@ /* eslint-disable @kadena-dev/no-eslint-disable */ /* eslint-disable @typescript-eslint/naming-convention */ -import * as BranchIcons from '@kadena/react-icons/brand'; -import * as ProductIcons from '@kadena/react-icons/product'; +import * as BrandIcons from '@kadena/react-icons/brand'; +import * as SystemIcons from '@kadena/react-icons/system'; import type { Meta, StoryObj } from '@storybook/react'; import React, { useState } from 'react'; import { useFilter } from 'react-aria'; import { atoms, tokens } from '../../styles'; import { TextField } from '../Form/TextField'; +import { Grid, GridItem } from '../Layout'; const iconColors = { primary: tokens.kda.foundation.color.icon.brand.primary.default, @@ -59,17 +60,13 @@ type Story = StoryObj<{ fontSize: IconSize; fill: IconColor; }>; - -const product = Object.entries(ProductIcons); -const brand = Object.entries(BranchIcons); - -export const Brand: Story = { - name: 'Brand', +const system = Object.entries(SystemIcons); +export const System: Story = { + name: 'New System Icons', args: { - fontSize: 'xxl', fill: 'base', }, - render: ({ fontSize, fill }) => { + render: ({ fill }) => { const { contains } = useFilter({ sensitivity: 'base', usage: 'search' }); const [search, setSearch] = useState(''); return ( @@ -88,34 +85,38 @@ export const Brand: Story = { setSearch(e.target.value); }} /> -
- {brand + {system .filter(([key]) => contains(key.toLowerCase(), search.toLowerCase()), ) .map(([key, Icon]) => ( - + <> + + + {key} + + ))} -
+ ); }, }; -export const Product: Story = { - name: 'Product', +const brand = Object.entries(BrandIcons); +export const Brand: Story = { + name: 'Brand Icons', args: { fontSize: 'xxl', fill: 'base', @@ -147,7 +148,7 @@ export const Product: Story = { gap: 'sm', })} > - {product + {brand .filter(([key]) => contains(key.toLowerCase(), search.toLowerCase()), )