From 9c969e2ec541af59df52a4b81ac663b60bf02940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chy=C5=82a?= Date: Tue, 9 Jul 2024 15:12:55 +0200 Subject: [PATCH] Add adornments to Select input (#820) * Add addorments to Select input * Add changeset * update changeset * Add main start, end adorment * make text full width * Fix empty space * Fix story * Remove box --- .changeset/silent-spies-laugh.md | 5 +++ src/components/Select/Select.stories.tsx | 51 +++++++++++++++++++++++- src/components/Select/Select.tsx | 14 ++++++- 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 .changeset/silent-spies-laugh.md diff --git a/.changeset/silent-spies-laugh.md b/.changeset/silent-spies-laugh.md new file mode 100644 index 00000000..adff0811 --- /dev/null +++ b/.changeset/silent-spies-laugh.md @@ -0,0 +1,5 @@ +--- +"@saleor/macaw-ui": patch +--- + +You can now see start and end adornment in select input options diff --git a/src/components/Select/Select.stories.tsx b/src/components/Select/Select.stories.tsx index 52712f02..a5c6e185 100644 --- a/src/components/Select/Select.stories.tsx +++ b/src/components/Select/Select.stories.tsx @@ -1,5 +1,6 @@ import { Meta, StoryObj } from "@storybook/react"; import { useState } from "react"; +import { Option } from "~/components/BaseSelect"; import { Box } from "../Box"; import { Select } from "."; @@ -41,7 +42,11 @@ const SelectTemplate: Story = { const [value, setValue] = useState(options[0]); return ( - setValue(value as Option)} + /> ); }, }; @@ -155,6 +160,50 @@ export const WithStringValue = () => { ); }; +export const WithStartAdornment = () => { + const [value, setValue] = useState("color-black"); + + return ( +