1
1
import * as React from "react"
2
- import { Meta , StoryObj } from "@storybook/react"
3
- import { Box , HStack , Link , VStack } from "@chakra-ui/react"
2
+ import { Args , Meta , StoryObj } from "@storybook/react"
3
+ import { Box , HStack , Link , TagProps , VStack } from "@chakra-ui/react"
4
4
import { TbSquareRoundedNumber8Filled } from "react-icons/tb"
5
- import Tag from "."
5
+ import Tag , { EthTagProps } from "."
6
6
import { MdInfoOutline , MdLanguage } from "react-icons/md"
7
7
8
8
type TagType = typeof Tag
@@ -22,33 +22,44 @@ const statusArray = ["normal", "tag", "success", "error", "warning"] as const
22
22
// "subtle" is default variant
23
23
const variantArray = [ "subtle" , "solid" , "outline" ]
24
24
25
- export const StyleVariantsAndStatuses : Story = {
26
- args : {
27
- label : "Tag Name" ,
28
- } ,
29
- render : ( args ) => (
30
- < >
31
- < Box textAlign = "center" mb = { 8 } >
25
+ const StyleVariantList = ( args : EthTagProps ) => (
26
+ < HStack >
27
+ { statusArray . map ( ( status ) => (
28
+ < VStack key = { status } >
29
+ { variantArray . map ( ( variant ) => (
30
+ < Tag
31
+ key = { variant }
32
+ href = "#"
33
+ status = { status }
34
+ variant = { variant }
35
+ { ...args }
36
+ />
37
+ ) ) }
38
+ </ VStack >
39
+ ) ) }
40
+ </ HStack >
41
+ )
42
+
43
+ export const StyleVariantsBasic : Story = {
44
+ render : ( ) => (
45
+ < VStack spacing = { 8 } >
46
+ < Box textAlign = "center" >
47
+ Click anywhere in the whitespace and then tab to see the button styling
48
+ on `:focus-visible`
49
+ </ Box >
50
+ < StyleVariantList label = "Tag Name" isCloseable />
51
+ </ VStack >
52
+ ) ,
53
+ }
54
+
55
+ export const StyleVariantsAsLinks : Story = {
56
+ render : ( ) => (
57
+ < VStack spacing = { 8 } >
58
+ < Box textAlign = "center" >
32
59
They are all rendered as links to hover, click, and focus
33
60
</ Box >
34
- < HStack >
35
- { statusArray . map ( ( status ) => (
36
- < VStack key = { status } >
37
- { variantArray . map ( ( variant ) => (
38
- < Tag
39
- key = { variant }
40
- as = { Link }
41
- href = "#"
42
- status = { status }
43
- variant = { variant }
44
- isCloseable
45
- { ...args }
46
- />
47
- ) ) }
48
- </ VStack >
49
- ) ) }
50
- </ HStack >
51
- </ >
61
+ < StyleVariantList as = { Link } label = "Tag Name" />
62
+ </ VStack >
52
63
) ,
53
64
}
54
65
0 commit comments