aural-ui 2.1.18 → 2.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ import React from "react"
2
2
  import type { Meta, StoryObj } from "@storybook/react-vite"
3
3
 
4
4
  import { Button } from "."
5
+ import { Tabs, TabsContent, TabsList, TabsTrigger } from "../tabs"
5
6
 
6
7
  const meta: Meta<typeof Button> = {
7
8
  title: "Components/UI/Button",
@@ -20,7 +21,14 @@ const meta: Meta<typeof Button> = {
20
21
  argTypes: {
21
22
  variant: {
22
23
  control: { type: "select" },
23
- options: ["primary", "secondary", "outline", "text"],
24
+ options: [
25
+ "primary",
26
+ "secondary",
27
+ "outline",
28
+ "text",
29
+ "chip",
30
+ "chipActive",
31
+ ],
24
32
  },
25
33
  size: {
26
34
  control: { type: "select" },
@@ -116,6 +124,117 @@ export const NoiseVariations: Story = {
116
124
  ),
117
125
  }
118
126
 
127
+ export const ChipVariants: Story = {
128
+ render: () => (
129
+ <div className="w-full max-w-4xl rounded p-8">
130
+ <Tabs defaultValue="chip" className="w-full">
131
+ <TabsList className="grid w-full grid-cols-2">
132
+ <TabsTrigger value="chip">Chip</TabsTrigger>
133
+ <TabsTrigger value="chipActive">Chip Active</TabsTrigger>
134
+ </TabsList>
135
+ <TabsContent value="chip" className="mt-6">
136
+ <div className="flex flex-col gap-6">
137
+ <div className="flex flex-col gap-4">
138
+ <h3 className="text-lg font-semibold text-white">
139
+ Noise Variations
140
+ </h3>
141
+ <div className="flex gap-4">
142
+ <Button variant="chip" noise="none">
143
+ No Noise
144
+ </Button>
145
+ <Button variant="chip" noise="low">
146
+ Low Noise
147
+ </Button>
148
+ <Button variant="chip" noise="medium">
149
+ Medium Noise
150
+ </Button>
151
+ <Button variant="chip" noise="strong">
152
+ Strong Noise
153
+ </Button>
154
+ </div>
155
+ </div>
156
+ <div className="flex flex-col gap-4">
157
+ <h3 className="text-lg font-semibold text-white">
158
+ Size Variations
159
+ </h3>
160
+ <div className="flex gap-4">
161
+ <Button variant="chip" size="sm" noise="medium">
162
+ Small
163
+ </Button>
164
+ <Button variant="chip" size="md" noise="medium">
165
+ Medium
166
+ </Button>
167
+ <Button variant="chip" size="lg" noise="medium">
168
+ Large
169
+ </Button>
170
+ </div>
171
+ </div>
172
+ <div className="flex flex-col gap-4">
173
+ <h3 className="text-lg font-semibold text-white">
174
+ Disabled State
175
+ </h3>
176
+ <div className="flex gap-4">
177
+ <Button variant="chip" isDisabled>
178
+ Disabled Chip
179
+ </Button>
180
+ </div>
181
+ </div>
182
+ </div>
183
+ </TabsContent>
184
+ <TabsContent value="chipActive" className="mt-6">
185
+ <div className="flex flex-col gap-6">
186
+ <div className="flex flex-col gap-4">
187
+ <h3 className="text-lg font-semibold text-white">
188
+ Noise Variations
189
+ </h3>
190
+ <div className="flex gap-4">
191
+ <Button variant="chipActive" noise="none">
192
+ No Noise
193
+ </Button>
194
+ <Button variant="chipActive" noise="low">
195
+ Low Noise
196
+ </Button>
197
+ <Button variant="chipActive" noise="medium">
198
+ Medium Noise
199
+ </Button>
200
+ <Button variant="chipActive" noise="strong">
201
+ Strong Noise
202
+ </Button>
203
+ </div>
204
+ </div>
205
+ <div className="flex flex-col gap-4">
206
+ <h3 className="text-lg font-semibold text-white">
207
+ Size Variations
208
+ </h3>
209
+ <div className="flex gap-4">
210
+ <Button variant="chipActive" size="sm" noise="medium">
211
+ Small
212
+ </Button>
213
+ <Button variant="chipActive" size="md" noise="medium">
214
+ Medium
215
+ </Button>
216
+ <Button variant="chipActive" size="lg" noise="medium">
217
+ Large
218
+ </Button>
219
+ </div>
220
+ </div>
221
+ <div className="flex flex-col gap-4">
222
+ <h3 className="text-lg font-semibold text-white">
223
+ Disabled State
224
+ </h3>
225
+ <div className="flex gap-4">
226
+ <Button variant="chipActive" isDisabled>
227
+ Disabled Chip Active
228
+ </Button>
229
+ </div>
230
+ </div>
231
+ </div>
232
+ </TabsContent>
233
+ </Tabs>
234
+ </div>
235
+ ),
236
+ }
237
+
119
238
  export const AllVariants: Story = {
120
239
  render: () => (
121
240
  <div className="flex flex-col gap-6 rounded p-8">
@@ -132,6 +251,8 @@ export const AllVariants: Story = {
132
251
  <Button variant="text" noise="none">
133
252
  Text
134
253
  </Button>
254
+ <Button variant="chip">Chip Active Button</Button>
255
+ <Button variant="chipActive">Chip Active Button</Button>
135
256
  </div>
136
257
  <div className="flex gap-4">
137
258
  <Button variant="primary" noise="strong" size="sm">
@@ -16,6 +16,8 @@ export const buttonVariants = cva(
16
16
  "before:absolute before:inset-0 rounded-full before:border-[length:var(--stroke-fm-xsm)] before:border-transparent bg-fm-surface-secondary text-fm-primary",
17
17
  outline: "text-fm-primary",
18
18
  text: "bg-transparent text-fm-secondary-800",
19
+ chip: "text-fm-neutral-800 font-fm-text",
20
+ chipActive: "text-fm-neutral-1100 font-fm-text",
19
21
  default: "",
20
22
  },
21
23
  noise: {
@@ -48,6 +50,9 @@ export const innerButtonVariants = cva(
48
50
  outline:
49
51
  "border-[length:var(--stroke-fm-sm)] border-fm-divider-contrast !translate-y-0",
50
52
  text: "",
53
+ chip: "border border-fm-neutral-300 rounded-md group-hover:[background-image:var(--button-fm-chip-hover)] bg-cover bg-no-repeat !translate-y-0",
54
+ chipActive:
55
+ "group-active:translate-y-0 chip-active-bg border-none rounded-md bg-contain bg-center bg-no-repeat duration-300",
51
56
  },
52
57
  noise: {
53
58
  none: "",
@@ -64,6 +69,9 @@ export const innerButtonVariants = cva(
64
69
  outline:
65
70
  "bg-fm-divider-tertiary [color:var(--color-fm-inactive)] border-[length:var(--stroke-fm-sm)] border-fm-divider-tertiary",
66
71
  text: "bg-fm-divider-tertiary [color:var(--color-fm-inactive)] border-[length:var(--stroke-fm-sm)] border-fm-divider-tertiary",
72
+ chip: "bg-fm-surface-secondary border border-fm-neutral-300 rounded-md !translate-y-0 [color:var(--color-fm-inactive)] font-fm-text",
73
+ chipActive:
74
+ "chip-active-bg border-none rounded-md bg-contain bg-center bg-no-repeat opacity-90 [color:var(--color-fm-inactive)] font-fm-text",
67
75
  },
68
76
  size: {
69
77
  sm: "py-fm-lg px-fm-2xl text-fm-sm -translate-y-1",
@@ -105,6 +113,36 @@ export const innerButtonVariants = cva(
105
113
  noise: "strong",
106
114
  className: "[background-image:var(--button-fm-noise-strong)]",
107
115
  },
116
+ {
117
+ variant: "chip",
118
+ noise: "low",
119
+ className: "[background-image:var(--button-fm-noise-low)]",
120
+ },
121
+ {
122
+ variant: "chip",
123
+ noise: "medium",
124
+ className: "[background-image:var(--button-fm-noise)]",
125
+ },
126
+ {
127
+ variant: "chip",
128
+ noise: "strong",
129
+ className: "[background-image:var(--button-fm-noise-strong)]",
130
+ },
131
+ {
132
+ variant: "chipActive",
133
+ noise: "low",
134
+ className: "[background-image:var(--button-fm-noise-low)]",
135
+ },
136
+ {
137
+ variant: "chipActive",
138
+ noise: "medium",
139
+ className: "[background-image:var(--button-fm-noise)]",
140
+ },
141
+ {
142
+ variant: "chipActive",
143
+ noise: "strong",
144
+ className: "[background-image:var(--button-fm-noise-strong)]",
145
+ },
108
146
  ],
109
147
  defaultVariants: {
110
148
  variant: "primary",
@@ -124,7 +162,7 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
124
162
  innerClassName?: string
125
163
  isDisabled?: boolean
126
164
  size?: "sm" | "md" | "lg"
127
- variant?: "primary" | "secondary" | "outline" | "text"
165
+ variant?: "primary" | "secondary" | "outline" | "text" | "chip" | "chipActive"
128
166
  noise?: "none" | "low" | "medium" | "strong"
129
167
  }
130
168
 
@@ -66,7 +66,7 @@ export const Chip = forwardRef<HTMLButtonElement, ChipProps>(
66
66
  tabIndex={0}
67
67
  ref={ref}
68
68
  className={cn(
69
- "py-fm-lg px-fm-xl font-fm-brand border-fm-divider-contrast ouline-none inline-flex cursor-pointer items-center justify-center gap-1 rounded-full border [font-size:var(--text-fm-sm)] leading-none transition-all select-none focus:outline-none",
69
+ "py-fm-lg px-fm-xl font-fm-brand border-fm-divider-contrast ouline-none text-fm-sm inline-flex cursor-pointer items-center justify-center gap-1 rounded-full border leading-none transition-all select-none focus:outline-none",
70
70
  {
71
71
  "border-fm-divider-contrast bg-fm-surface-contrast hover:bg-fm-surface-contrast/80 text-fm-contrast":
72
72
  selected,