aural-ui 2.0.4 → 2.0.7

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.
@@ -26,6 +26,10 @@ const meta: Meta<typeof Button> = {
26
26
  control: { type: "select" },
27
27
  options: ["sm", "md", "lg"],
28
28
  },
29
+ noise: {
30
+ control: { type: "select" },
31
+ options: ["none", "low", "medium", "strong"],
32
+ },
29
33
  isDisabled: {
30
34
  control: { type: "boolean" },
31
35
  },
@@ -46,6 +50,7 @@ export const Primary: Story = {
46
50
  variant: "primary",
47
51
  children: "Primary Button",
48
52
  size: "md",
53
+ noise: "medium",
49
54
  },
50
55
  }
51
56
 
@@ -54,6 +59,7 @@ export const Secondary: Story = {
54
59
  variant: "secondary",
55
60
  children: "Secondary Button",
56
61
  size: "md",
62
+ noise: "medium",
57
63
  },
58
64
  }
59
65
 
@@ -62,6 +68,7 @@ export const Outline: Story = {
62
68
  variant: "outline",
63
69
  children: "Outline Button",
64
70
  size: "md",
71
+ noise: "none",
65
72
  },
66
73
  }
67
74
 
@@ -70,6 +77,7 @@ export const Text: Story = {
70
77
  variant: "text",
71
78
  children: "Text Button",
72
79
  size: "md",
80
+ noise: "none",
73
81
  },
74
82
  }
75
83
 
@@ -81,42 +89,104 @@ export const Disabled: Story = {
81
89
  },
82
90
  }
83
91
 
92
+ export const NoiseVariations: Story = {
93
+ render: () => (
94
+ <div className="flex flex-col gap-6 rounded p-8">
95
+ <div className="flex gap-4">
96
+ <Button noise="none">No Noise</Button>
97
+ <Button noise="low">Low Noise</Button>
98
+ <Button noise="medium">Medium Noise</Button>
99
+ <Button noise="strong">Strong Noise</Button>
100
+ </div>
101
+ <div className="flex gap-4">
102
+ <Button variant="secondary" noise="none">
103
+ No Noise
104
+ </Button>
105
+ <Button variant="secondary" noise="low">
106
+ Low Noise
107
+ </Button>
108
+ <Button variant="secondary" noise="medium">
109
+ Medium Noise
110
+ </Button>
111
+ <Button variant="secondary" noise="strong">
112
+ Strong Noise
113
+ </Button>
114
+ </div>
115
+ </div>
116
+ ),
117
+ }
118
+
119
+ export const AllVariants: Story = {
120
+ render: () => (
121
+ <div className="flex flex-col gap-6 rounded p-8">
122
+ <div className="flex gap-4">
123
+ <Button variant="primary" noise="medium">
124
+ Primary
125
+ </Button>
126
+ <Button variant="secondary" noise="medium">
127
+ Secondary
128
+ </Button>
129
+ <Button variant="outline" noise="none">
130
+ Outline
131
+ </Button>
132
+ <Button variant="text" noise="none">
133
+ Text
134
+ </Button>
135
+ </div>
136
+ <div className="flex gap-4">
137
+ <Button variant="primary" noise="strong" size="sm">
138
+ Small
139
+ </Button>
140
+ <Button variant="primary" noise="medium" size="md">
141
+ Medium
142
+ </Button>
143
+ <Button variant="primary" noise="low" size="lg">
144
+ Large
145
+ </Button>
146
+ </div>
147
+ </div>
148
+ ),
149
+ }
150
+
84
151
  export const WithToolTip: Story = {
85
152
  render: () => (
86
153
  <div className="flex gap-6 rounded p-8">
87
154
  <Button
88
- tooltip="Primary Variant"
155
+ tooltip="Primary Variant with Medium Noise"
89
156
  tooltipContentProps={{
90
157
  align: "center",
91
158
  side: "top",
92
159
  sideOffset: 10,
93
160
  }}
161
+ noise="medium"
94
162
  >
95
163
  Primary
96
164
  </Button>
97
165
  <Button
98
166
  variant="secondary"
99
- tooltip="Secondary Variant"
167
+ tooltip="Secondary Variant with Low Noise"
100
168
  tooltipContentProps={{
101
169
  align: "center",
102
170
  side: "bottom",
103
171
  sideOffset: 10,
104
172
  }}
173
+ noise="low"
105
174
  >
106
175
  Secondary
107
176
  </Button>
108
177
  <Button
109
178
  variant="outline"
110
- tooltip="Outline Variant"
179
+ tooltip="Outline Variant with No Noise"
111
180
  tooltipContentProps={{
112
181
  align: "center",
113
182
  side: "top",
114
183
  sideOffset: 10,
115
184
  }}
185
+ noise="none"
116
186
  >
117
187
  Outline
118
188
  </Button>
119
- <Button variant="text" tooltip="Text Variant">
189
+ <Button variant="text" tooltip="Text Variant" noise="none">
120
190
  Text
121
191
  </Button>
122
192
  </div>
@@ -18,6 +18,12 @@ export const buttonVariants = cva(
18
18
  text: "bg-transparent text-fm-secondary-800",
19
19
  default: "",
20
20
  },
21
+ noise: {
22
+ none: "",
23
+ low: "",
24
+ medium: "",
25
+ strong: "",
26
+ },
21
27
  disabled: {
22
28
  true: "cursor-not-allowed",
23
29
  false: "cursor-pointer",
@@ -36,13 +42,19 @@ export const innerButtonVariants = cva(
36
42
  variants: {
37
43
  variant: {
38
44
  primary:
39
- "shadow-[0_0_1.5rem_var(--color-fm-primary-400)_inset] group-active:translate-y-0 [--gradientSizeX:50%] [--gradientSizeY:150%] [--gradientPositionY:100%] group-hover:[--gradientSizeX:40%] group-hover:[--gradientSizeY:110%] group-hover:[--gradientPositionY:50%] [background-image:var(--button-fm-noise),_radial-gradient(ellipse_var(--gradientSizeX)_var(--gradientSizeY)_at_50%_var(--gradientPositionY),_var(--color-fm-primary-600),_var(--color-fm-secondary-300)),_linear-gradient(_to_top,_color-mix(in_srgb,var(--color-fm-primary-600)_50%,_transparent),_color-mix(in_srgb,var(--color-fm-primary-200)_50%,_transparent))] bg-cover bg-center [background-blend-mode:color-dodge,multiply,darken] duration-300 bg-repeat-x bg-auto bg-center bg-origin-border",
45
+ "shadow-[0_0_1.5rem_var(--color-fm-primary-400)_inset] group-active:translate-y-0 [--gradientSizeX:50%] [--gradientSizeY:150%] [--gradientPositionY:100%] group-hover:[--gradientSizeX:40%] group-hover:[--gradientSizeY:110%] group-hover:[--gradientPositionY:50%] bg-cover bg-center [background-blend-mode:color-dodge,multiply,darken] duration-300 bg-repeat-x bg-auto bg-center bg-origin-border",
40
46
  secondary:
41
- "group-active:translate-y-0 bg-fm-button-fill-secondary [background-image:var(--button-fm-noise)] bg-repeat-x bg-auto bg-center bg-origin-border",
47
+ "group-active:translate-y-0 bg-fm-button-fill-secondary bg-repeat-x bg-auto bg-center bg-origin-border",
42
48
  outline:
43
49
  "border-[length:var(--stroke-fm-sm)] border-fm-divider-contrast !translate-y-0",
44
50
  text: "",
45
51
  },
52
+ noise: {
53
+ none: "",
54
+ low: "[background-image:var(--button-fm-noise-low)]",
55
+ medium: "[background-image:var(--button-fm-noise)]",
56
+ strong: "[background-image:var(--button-fm-noise-strong)]",
57
+ },
46
58
  disabled: {
47
59
  default: "",
48
60
  primary:
@@ -59,10 +71,46 @@ export const innerButtonVariants = cva(
59
71
  lg: "py-fm-2xl px-fm-5xl text-fm-xl -translate-y-1.5",
60
72
  },
61
73
  },
74
+ compoundVariants: [
75
+ {
76
+ variant: "primary",
77
+ noise: "low",
78
+ className:
79
+ "[background-image:var(--button-fm-noise-low),_radial-gradient(ellipse_var(--gradientSizeX)_var(--gradientSizeY)_at_50%_var(--gradientPositionY),_var(--color-fm-primary-600),_var(--color-fm-secondary-300)),_linear-gradient(_to_top,_color-mix(in_srgb,var(--color-fm-primary-600)_50%,_transparent),_color-mix(in_srgb,var(--color-fm-primary-200)_50%,_transparent))]",
80
+ },
81
+ {
82
+ variant: "primary",
83
+ noise: "medium",
84
+ className:
85
+ "[background-image:var(--button-fm-noise),_radial-gradient(ellipse_var(--gradientSizeX)_var(--gradientSizeY)_at_50%_var(--gradientPositionY),_var(--color-fm-primary-600),_var(--color-fm-secondary-300)),_linear-gradient(_to_top,_color-mix(in_srgb,var(--color-fm-primary-600)_50%,_transparent),_color-mix(in_srgb,var(--color-fm-primary-200)_50%,_transparent))]",
86
+ },
87
+ {
88
+ variant: "primary",
89
+ noise: "strong",
90
+ className:
91
+ "[background-image:var(--button-fm-noise-strong),_radial-gradient(ellipse_var(--gradientSizeX)_var(--gradientSizeY)_at_50%_var(--gradientPositionY),_var(--color-fm-primary-600),_var(--color-fm-secondary-300)),_linear-gradient(_to_top,_color-mix(in_srgb,var(--color-fm-primary-600)_50%,_transparent),_color-mix(in_srgb,var(--color-fm-primary-200)_50%,_transparent))]",
92
+ },
93
+ {
94
+ variant: "secondary",
95
+ noise: "low",
96
+ className: "[background-image:var(--button-fm-noise-low)]",
97
+ },
98
+ {
99
+ variant: "secondary",
100
+ noise: "medium",
101
+ className: "[background-image:var(--button-fm-noise)]",
102
+ },
103
+ {
104
+ variant: "secondary",
105
+ noise: "strong",
106
+ className: "[background-image:var(--button-fm-noise-strong)]",
107
+ },
108
+ ],
62
109
  defaultVariants: {
63
110
  variant: "primary",
64
111
  disabled: "default",
65
112
  size: "md",
113
+ noise: "medium",
66
114
  },
67
115
  }
68
116
  )
@@ -77,6 +125,7 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
77
125
  isDisabled?: boolean
78
126
  size?: "sm" | "md" | "lg"
79
127
  variant?: "primary" | "secondary" | "outline" | "text"
128
+ noise?: "none" | "low" | "medium" | "strong"
80
129
  }
81
130
 
82
131
  export const RawButton = forwardRef<HTMLButtonElement, ButtonProps>(
@@ -84,6 +133,7 @@ export const RawButton = forwardRef<HTMLButtonElement, ButtonProps>(
84
133
  {
85
134
  variant = "primary",
86
135
  size = "md",
136
+ noise = "medium",
87
137
  children,
88
138
  className = "",
89
139
  innerClassName = "",
@@ -146,6 +196,7 @@ export const RawButton = forwardRef<HTMLButtonElement, ButtonProps>(
146
196
  variant: isDisabled ? "text" : variant,
147
197
  disabled: isDisabled ? variant : "default",
148
198
  size,
199
+ noise: isDisabled ? "none" : noise,
149
200
  }),
150
201
  innerClassName
151
202
  )}