aural-ui 2.1.21 → 2.1.22
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.
- package/dist/components/drawer/index.tsx +4 -2
- package/dist/components/textarea/index.tsx +5 -4
- package/dist/icons/circular-play-icon/CircularPlayIcon.stories.tsx +525 -0
- package/dist/icons/circular-play-icon/index.tsx +33 -0
- package/dist/icons/circular-play-icon/meta.ts +8 -0
- package/dist/icons/index.ts +2 -0
- package/dist/icons/scroll-down-icon/ScrollDownIcon.stories.tsx +535 -0
- package/dist/icons/scroll-down-icon/index.tsx +32 -0
- package/dist/icons/scroll-down-icon/meta.ts +8 -0
- package/dist/index.cjs +71 -71
- package/dist/index.js +71 -71
- package/package.json +7 -7
|
@@ -126,7 +126,7 @@ const DrawerContent = React.forwardRef<
|
|
|
126
126
|
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg",
|
|
127
127
|
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg",
|
|
128
128
|
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-lg data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
129
|
-
"overflow-
|
|
129
|
+
"overflow-hidden data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-lg data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
130
130
|
className,
|
|
131
131
|
classes?.content
|
|
132
132
|
)}
|
|
@@ -135,7 +135,9 @@ const DrawerContent = React.forwardRef<
|
|
|
135
135
|
{showSwipeButton && (
|
|
136
136
|
<div className="bg-fm-surface-primary mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
|
|
137
137
|
)}
|
|
138
|
-
|
|
138
|
+
<div className="scrollbar-hide flex min-h-0 flex-1 flex-col overflow-auto">
|
|
139
|
+
{children}
|
|
140
|
+
</div>
|
|
139
141
|
</DrawerPrimitive.Content>
|
|
140
142
|
</DrawerPortal>
|
|
141
143
|
)
|
|
@@ -5,6 +5,7 @@ import React, {
|
|
|
5
5
|
RefAttributes,
|
|
6
6
|
useCallback,
|
|
7
7
|
useEffect,
|
|
8
|
+
useId,
|
|
8
9
|
useRef,
|
|
9
10
|
useState,
|
|
10
11
|
} from "react"
|
|
@@ -30,7 +31,7 @@ interface TextAreaBaseProps {
|
|
|
30
31
|
onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void
|
|
31
32
|
onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void
|
|
32
33
|
onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void
|
|
33
|
-
onInput?: (e: React.
|
|
34
|
+
onInput?: (e: React.InputEvent<HTMLTextAreaElement>) => void
|
|
34
35
|
onKeyDown?: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void
|
|
35
36
|
id?: string
|
|
36
37
|
name?: string
|
|
@@ -361,8 +362,8 @@ const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
|
|
|
361
362
|
const [textareaValue, setTextareaValue] = useState(value || "")
|
|
362
363
|
|
|
363
364
|
// Generate unique IDs for accessibility
|
|
364
|
-
const
|
|
365
|
-
|
|
365
|
+
const reactId = useId()
|
|
366
|
+
const textareaId = id || `textarea-${reactId}`
|
|
366
367
|
const helperTextId = helperText ? `${textareaId}-helper` : undefined
|
|
367
368
|
const charCountId = showCharCount ? `${textareaId}-char-count` : undefined
|
|
368
369
|
|
|
@@ -410,7 +411,7 @@ const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
|
|
|
410
411
|
currentLength={currentLength}
|
|
411
412
|
maxLength={maxLength}
|
|
412
413
|
id={charCountId}
|
|
413
|
-
className=
|
|
414
|
+
className="ml-auto"
|
|
414
415
|
/>
|
|
415
416
|
)}
|
|
416
417
|
</div>
|
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite"
|
|
3
|
+
|
|
4
|
+
import { CircularPlayIcon } from "."
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof CircularPlayIcon> = {
|
|
7
|
+
title: "Icons/CircularPlayIcon",
|
|
8
|
+
component: CircularPlayIcon,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "fullscreen",
|
|
11
|
+
backgrounds: {
|
|
12
|
+
default: "dark",
|
|
13
|
+
values: [
|
|
14
|
+
{ name: "dark", value: "#0a0a0a" },
|
|
15
|
+
{ name: "darker", value: "#000000" },
|
|
16
|
+
{ name: "light", value: "#ffffff" },
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
docs: {
|
|
20
|
+
page: () => (
|
|
21
|
+
<>
|
|
22
|
+
<style>
|
|
23
|
+
{`
|
|
24
|
+
.sbdocs-wrapper { padding: 0 !important; max-width: none !important; background: transparent !important; }
|
|
25
|
+
.sbdocs-content { max-width: none !important; padding: 0 !important; margin: 0 !important; background: transparent !important; }
|
|
26
|
+
.docs-story, .sbdocs { background: transparent !important; }
|
|
27
|
+
body, #storybook-docs { background: #0a0a0a !important; }
|
|
28
|
+
.sbdocs-preview { background: transparent !important; border: none !important; }
|
|
29
|
+
.sbdocs-h1, .sbdocs-h2, .sbdocs-h3, .sbdocs-h4, .sbdocs-h5, .sbdocs-h6 { color: white !important; }
|
|
30
|
+
.sbdocs-p, .sbdocs-li { color: rgba(255, 255, 255, 0.7) !important; }
|
|
31
|
+
.sbdocs-code { background: rgba(255, 255, 255, 0.1) !important; color: rgba(168, 85, 247, 1) !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; }
|
|
32
|
+
.sbdocs-pre { background: rgba(0, 0, 0, 0.4) !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; }
|
|
33
|
+
.sbdocs-table { background: rgba(255, 255, 255, 0.05) !important; border: 1px solid rgba(255, 255, 255, 0.1) !important; }
|
|
34
|
+
.sbdocs-table th { background: rgba(255, 255, 255, 0.05) !important; color: white !important; border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important; }
|
|
35
|
+
.sbdocs-table td { color: rgba(255, 255, 255, 0.7) !important; border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important; }
|
|
36
|
+
`}
|
|
37
|
+
</style>
|
|
38
|
+
|
|
39
|
+
<div className="min-h-screen bg-gradient-to-br from-gray-900 via-purple-900/20 to-gray-900">
|
|
40
|
+
<div className="relative overflow-hidden border-b border-white/10 bg-black/20 backdrop-blur-xl">
|
|
41
|
+
<div className="absolute inset-0 bg-gradient-to-r from-purple-500/10 via-transparent to-pink-500/10" />
|
|
42
|
+
<div className="relative !mx-auto max-w-7xl px-6 py-16">
|
|
43
|
+
<div className="!space-y-6 text-center">
|
|
44
|
+
<div className="!mx-auto flex h-24 w-24 items-center justify-center rounded-2xl border border-purple-500/30 bg-gradient-to-br from-purple-500/20 to-pink-500/20">
|
|
45
|
+
<CircularPlayIcon className="h-12 w-12 text-white" />
|
|
46
|
+
</div>
|
|
47
|
+
<h1 className="!text-fm-primary text-5xl font-bold">
|
|
48
|
+
CircularPlayIcon
|
|
49
|
+
</h1>
|
|
50
|
+
<p className="!mx-auto max-w-3xl text-xl leading-relaxed !text-white/70">
|
|
51
|
+
A circular play icon with a filled play triangle inside a
|
|
52
|
+
ring. Ideal for media players, audio controls, and video
|
|
53
|
+
play overlays. Built with accessibility in mind using Radix
|
|
54
|
+
UI's AccessibleIcon wrapper.
|
|
55
|
+
</p>
|
|
56
|
+
<div className="flex items-center justify-center gap-8 pt-8">
|
|
57
|
+
<div className="text-center">
|
|
58
|
+
<div className="text-3xl font-bold text-purple-300">
|
|
59
|
+
Play
|
|
60
|
+
</div>
|
|
61
|
+
<div className="text-sm text-white/60">Media & audio</div>
|
|
62
|
+
</div>
|
|
63
|
+
<div className="h-8 w-px bg-white/20" />
|
|
64
|
+
<div className="text-center">
|
|
65
|
+
<div className="text-3xl font-bold text-pink-300">
|
|
66
|
+
Accessible
|
|
67
|
+
</div>
|
|
68
|
+
<div className="text-sm text-white/60">
|
|
69
|
+
Screen reader friendly
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
<div className="h-8 w-px bg-white/20" />
|
|
73
|
+
<div className="text-center">
|
|
74
|
+
<div className="text-3xl font-bold text-indigo-300">
|
|
75
|
+
Flexible
|
|
76
|
+
</div>
|
|
77
|
+
<div className="text-sm text-white/60">
|
|
78
|
+
Customizable sizing
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<div className="!mx-auto max-w-7xl !space-y-16 px-6 py-12">
|
|
87
|
+
<div className="!space-y-8">
|
|
88
|
+
<h2 className="text-center text-3xl font-bold !text-white">
|
|
89
|
+
Quick Start
|
|
90
|
+
</h2>
|
|
91
|
+
<div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
|
|
92
|
+
<div className="!space-y-4">
|
|
93
|
+
<h3 className="text-xl font-semibold !text-purple-300">
|
|
94
|
+
Basic Usage
|
|
95
|
+
</h3>
|
|
96
|
+
<div className="rounded-lg bg-black/40 p-4">
|
|
97
|
+
<pre className="overflow-x-auto text-sm !text-green-300">
|
|
98
|
+
{`import { CircularPlayIcon } from "@icons/circular-play-icon"
|
|
99
|
+
|
|
100
|
+
function MediaPlayer() {
|
|
101
|
+
return (
|
|
102
|
+
<button className="flex items-center justify-center rounded-full bg-purple-500/20 p-4">
|
|
103
|
+
<CircularPlayIcon className="h-10 w-10 text-white" />
|
|
104
|
+
</button>
|
|
105
|
+
)
|
|
106
|
+
}`}
|
|
107
|
+
</pre>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
<div className="!space-y-4">
|
|
111
|
+
<h3 className="text-xl font-semibold !text-purple-300">
|
|
112
|
+
Live Preview
|
|
113
|
+
</h3>
|
|
114
|
+
<div className="flex h-32 items-center justify-center rounded-lg border border-white/10 bg-white/5">
|
|
115
|
+
<button className="flex h-14 w-14 items-center justify-center rounded-full border border-purple-500/30 bg-purple-500/20 transition-colors hover:bg-purple-500/30">
|
|
116
|
+
<CircularPlayIcon className="h-8 w-8 text-white" />
|
|
117
|
+
</button>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<div className="!space-y-8">
|
|
124
|
+
<h2 className="text-center text-3xl font-bold !text-white">
|
|
125
|
+
Props & Configuration
|
|
126
|
+
</h2>
|
|
127
|
+
<div className="overflow-hidden rounded-lg border border-white/10 bg-white/5">
|
|
128
|
+
<div className="bg-white/5 p-4">
|
|
129
|
+
<h3 className="text-xl font-semibold !text-white">Props</h3>
|
|
130
|
+
</div>
|
|
131
|
+
<table className="!my-0 w-full">
|
|
132
|
+
<thead className="bg-white/5">
|
|
133
|
+
<tr className="border-b border-white/10">
|
|
134
|
+
<th className="px-6 py-4 text-left text-sm font-semibold !text-white">
|
|
135
|
+
Prop
|
|
136
|
+
</th>
|
|
137
|
+
<th className="px-6 py-4 text-left text-sm font-semibold !text-white">
|
|
138
|
+
Type
|
|
139
|
+
</th>
|
|
140
|
+
<th className="px-6 py-4 text-left text-sm font-semibold !text-white">
|
|
141
|
+
Default
|
|
142
|
+
</th>
|
|
143
|
+
<th className="px-6 py-4 text-left text-sm font-semibold !text-white">
|
|
144
|
+
Description
|
|
145
|
+
</th>
|
|
146
|
+
</tr>
|
|
147
|
+
</thead>
|
|
148
|
+
<tbody>
|
|
149
|
+
<tr className="!bg-black/10">
|
|
150
|
+
<td className="px-6 py-4 font-mono text-sm !text-blue-300">
|
|
151
|
+
withAccessibility
|
|
152
|
+
</td>
|
|
153
|
+
<td className="px-6 py-4 text-sm !text-white/70">
|
|
154
|
+
boolean
|
|
155
|
+
</td>
|
|
156
|
+
<td className="px-6 py-4 text-sm !text-white/50">
|
|
157
|
+
true
|
|
158
|
+
</td>
|
|
159
|
+
<td className="px-6 py-4 text-sm !text-white/70">
|
|
160
|
+
Whether to wrap the icon with accessibility feature
|
|
161
|
+
</td>
|
|
162
|
+
</tr>
|
|
163
|
+
<tr className="border-b border-white/5 !bg-black/10">
|
|
164
|
+
<td className="px-6 py-4 font-mono text-sm !text-purple-300">
|
|
165
|
+
width
|
|
166
|
+
</td>
|
|
167
|
+
<td className="px-6 py-4 text-sm !text-white/70">
|
|
168
|
+
number | string
|
|
169
|
+
</td>
|
|
170
|
+
<td className="px-6 py-4 text-sm !text-white/50">48</td>
|
|
171
|
+
<td className="px-6 py-4 text-sm !text-white/70">
|
|
172
|
+
Width of the icon
|
|
173
|
+
</td>
|
|
174
|
+
</tr>
|
|
175
|
+
<tr className="border-b border-white/5 !bg-black/10">
|
|
176
|
+
<td className="px-6 py-4 font-mono text-sm !text-purple-300">
|
|
177
|
+
height
|
|
178
|
+
</td>
|
|
179
|
+
<td className="px-6 py-4 text-sm !text-white/70">
|
|
180
|
+
number | string
|
|
181
|
+
</td>
|
|
182
|
+
<td className="px-6 py-4 text-sm !text-white/50">48</td>
|
|
183
|
+
<td className="px-6 py-4 text-sm !text-white/70">
|
|
184
|
+
Height of the icon
|
|
185
|
+
</td>
|
|
186
|
+
</tr>
|
|
187
|
+
<tr className="border-b border-white/5">
|
|
188
|
+
<td className="px-6 py-4 font-mono text-sm !text-purple-300">
|
|
189
|
+
fill
|
|
190
|
+
</td>
|
|
191
|
+
<td className="px-6 py-4 text-sm !text-white/70">
|
|
192
|
+
string
|
|
193
|
+
</td>
|
|
194
|
+
<td className="px-6 py-4 text-sm !text-white/50">
|
|
195
|
+
white (in SVG)
|
|
196
|
+
</td>
|
|
197
|
+
<td className="px-6 py-4 text-sm !text-white/70">
|
|
198
|
+
Fill color; override with className (e.g. text-white)
|
|
199
|
+
</td>
|
|
200
|
+
</tr>
|
|
201
|
+
<tr className="border-b border-white/5 !bg-black/10">
|
|
202
|
+
<td className="px-6 py-4 font-mono text-sm !text-purple-300">
|
|
203
|
+
className
|
|
204
|
+
</td>
|
|
205
|
+
<td className="px-6 py-4 text-sm !text-white/70">
|
|
206
|
+
string
|
|
207
|
+
</td>
|
|
208
|
+
<td className="px-6 py-4 text-sm !text-white/50">-</td>
|
|
209
|
+
<td className="px-6 py-4 text-sm !text-white/70">
|
|
210
|
+
CSS classes for styling
|
|
211
|
+
</td>
|
|
212
|
+
</tr>
|
|
213
|
+
<tr className="!bg-black/10">
|
|
214
|
+
<td className="px-6 py-4 font-mono text-sm !text-purple-300">
|
|
215
|
+
...svgProps
|
|
216
|
+
</td>
|
|
217
|
+
<td className="px-6 py-4 text-sm !text-white/70">
|
|
218
|
+
SVGProps
|
|
219
|
+
</td>
|
|
220
|
+
<td className="px-6 py-4 text-sm !text-white/50">-</td>
|
|
221
|
+
<td className="px-6 py-4 text-sm !text-white/70">
|
|
222
|
+
All standard SVG element props
|
|
223
|
+
</td>
|
|
224
|
+
</tr>
|
|
225
|
+
</tbody>
|
|
226
|
+
</table>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
|
|
230
|
+
<div className="!space-y-8">
|
|
231
|
+
<h2 className="text-center text-3xl font-bold !text-white">
|
|
232
|
+
Size Variations
|
|
233
|
+
</h2>
|
|
234
|
+
<div className="rounded-lg border border-white/10 bg-white/5 p-8">
|
|
235
|
+
<div className="flex items-end justify-center gap-6 rounded-lg bg-black/20 p-6">
|
|
236
|
+
<div className="text-center">
|
|
237
|
+
<CircularPlayIcon className="!mx-auto mb-2 h-6 w-6 text-white" />
|
|
238
|
+
<span className="text-xs text-white/60">24px</span>
|
|
239
|
+
</div>
|
|
240
|
+
<div className="text-center">
|
|
241
|
+
<CircularPlayIcon className="!mx-auto mb-2 h-8 w-8 text-white" />
|
|
242
|
+
<span className="text-xs text-white/60">32px</span>
|
|
243
|
+
</div>
|
|
244
|
+
<div className="text-center">
|
|
245
|
+
<CircularPlayIcon className="!mx-auto mb-2 h-10 w-10 text-white" />
|
|
246
|
+
<span className="text-xs text-white/60">40px</span>
|
|
247
|
+
</div>
|
|
248
|
+
<div className="text-center">
|
|
249
|
+
<CircularPlayIcon className="!mx-auto mb-2 h-12 w-12 text-white" />
|
|
250
|
+
<span className="text-xs text-white/60">48px</span>
|
|
251
|
+
</div>
|
|
252
|
+
<div className="text-center">
|
|
253
|
+
<CircularPlayIcon className="!mx-auto mb-2 h-16 w-16 text-white" />
|
|
254
|
+
<span className="text-xs text-white/60">64px</span>
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
|
|
260
|
+
<div className="!space-y-8">
|
|
261
|
+
<h2 className="text-center text-3xl font-bold !text-white">
|
|
262
|
+
Usage Examples
|
|
263
|
+
</h2>
|
|
264
|
+
<div className="grid grid-cols-1 gap-8 lg:grid-cols-2">
|
|
265
|
+
<div className="!space-y-4">
|
|
266
|
+
<h3 className="text-lg font-semibold !text-purple-300">
|
|
267
|
+
Media player play button
|
|
268
|
+
</h3>
|
|
269
|
+
<div className="flex items-center gap-4 rounded-lg border border-white/10 bg-white/5 p-4">
|
|
270
|
+
<button className="flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-purple-500/20 transition-colors hover:bg-purple-500/30">
|
|
271
|
+
<CircularPlayIcon className="h-7 w-7 text-white" />
|
|
272
|
+
</button>
|
|
273
|
+
<div className="min-w-0 flex-1">
|
|
274
|
+
<div className="text-sm font-medium text-white">
|
|
275
|
+
Episode title
|
|
276
|
+
</div>
|
|
277
|
+
<div className="text-xs text-white/60">
|
|
278
|
+
0:00 / 24:30
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
</div>
|
|
282
|
+
</div>
|
|
283
|
+
<div className="!space-y-4">
|
|
284
|
+
<h3 className="text-lg font-semibold !text-purple-300">
|
|
285
|
+
Video play overlay
|
|
286
|
+
</h3>
|
|
287
|
+
<div className="relative flex h-32 items-center justify-center overflow-hidden rounded-lg border border-white/10 bg-black/40">
|
|
288
|
+
<div className="absolute inset-0 bg-gradient-to-t from-black/60 to-transparent" />
|
|
289
|
+
<button className="relative flex h-16 w-16 items-center justify-center rounded-full border border-white/30 bg-white/10 backdrop-blur-sm transition-colors hover:bg-white/20">
|
|
290
|
+
<CircularPlayIcon className="h-10 w-10 text-white" />
|
|
291
|
+
</button>
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
<div className="!space-y-8">
|
|
298
|
+
<h2 className="text-center text-3xl font-bold !text-white">
|
|
299
|
+
Accessibility
|
|
300
|
+
</h2>
|
|
301
|
+
<div className="rounded-lg border border-white/10 bg-white/5 p-6">
|
|
302
|
+
<ul className="!space-y-2 text-sm !text-white/70">
|
|
303
|
+
<li>
|
|
304
|
+
Uses Radix UI AccessibleIcon with label "Circular
|
|
305
|
+
play icon"
|
|
306
|
+
</li>
|
|
307
|
+
<li>
|
|
308
|
+
When used in a button, add aria-label e.g.
|
|
309
|
+
"Play" or "Play episode"
|
|
310
|
+
</li>
|
|
311
|
+
<li>
|
|
312
|
+
Ensure sufficient touch target size (e.g. min 44px) for
|
|
313
|
+
the control
|
|
314
|
+
</li>
|
|
315
|
+
</ul>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
|
|
320
|
+
<div className="border-t border-white/10 bg-black/20 backdrop-blur-xl">
|
|
321
|
+
<div className="!mx-auto max-w-7xl px-6 py-8">
|
|
322
|
+
<div className="!space-y-4 text-center">
|
|
323
|
+
<p className="!text-white/60">
|
|
324
|
+
CircularPlayIcon is part of the Aural UI icon library for
|
|
325
|
+
media and playback UIs.
|
|
326
|
+
</p>
|
|
327
|
+
<p className="text-sm !text-white/40">
|
|
328
|
+
Uses Radix UI AccessibleIcon for screen reader
|
|
329
|
+
compatibility.
|
|
330
|
+
</p>
|
|
331
|
+
</div>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
</div>
|
|
335
|
+
</>
|
|
336
|
+
),
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
tags: ["autodocs"],
|
|
340
|
+
argTypes: {
|
|
341
|
+
width: {
|
|
342
|
+
control: { type: "range", min: 8, max: 96, step: 2 },
|
|
343
|
+
description: "Width of the icon in pixels",
|
|
344
|
+
},
|
|
345
|
+
height: {
|
|
346
|
+
control: { type: "range", min: 8, max: 96, step: 2 },
|
|
347
|
+
description: "Height of the icon in pixels",
|
|
348
|
+
},
|
|
349
|
+
withAccessibility: {
|
|
350
|
+
control: "boolean",
|
|
351
|
+
description: "Whether to wrap the icon with accessibility features",
|
|
352
|
+
},
|
|
353
|
+
fill: {
|
|
354
|
+
control: "color",
|
|
355
|
+
description: "Fill color of the icon",
|
|
356
|
+
},
|
|
357
|
+
className: {
|
|
358
|
+
control: "text",
|
|
359
|
+
description: "CSS classes for styling",
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export default meta
|
|
365
|
+
type Story = StoryObj<typeof CircularPlayIcon>
|
|
366
|
+
|
|
367
|
+
const storyParameters = {
|
|
368
|
+
backgrounds: {
|
|
369
|
+
default: "dark",
|
|
370
|
+
values: [
|
|
371
|
+
{ name: "dark", value: "#0a0a0a" },
|
|
372
|
+
{ name: "darker", value: "#000000" },
|
|
373
|
+
],
|
|
374
|
+
},
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export const Default: Story = {
|
|
378
|
+
args: {
|
|
379
|
+
width: 48,
|
|
380
|
+
height: 48,
|
|
381
|
+
className: "text-white",
|
|
382
|
+
withAccessibility: true,
|
|
383
|
+
},
|
|
384
|
+
parameters: storyParameters,
|
|
385
|
+
render: (args) => (
|
|
386
|
+
<div className="flex h-32 min-h-dvh items-center justify-center rounded-lg bg-gradient-to-br from-gray-900 to-gray-800">
|
|
387
|
+
<CircularPlayIcon {...args} />
|
|
388
|
+
</div>
|
|
389
|
+
),
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export const SizeVariations: Story = {
|
|
393
|
+
parameters: {
|
|
394
|
+
...storyParameters,
|
|
395
|
+
docs: {
|
|
396
|
+
description: {
|
|
397
|
+
story:
|
|
398
|
+
"CircularPlayIcon in different sizes for media controls and overlays.",
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
render: () => (
|
|
403
|
+
<div className="flex h-64 min-h-dvh items-center justify-center gap-8 rounded-lg bg-gradient-to-br from-gray-900 to-gray-800 p-8">
|
|
404
|
+
<div className="text-center">
|
|
405
|
+
<CircularPlayIcon className="!mx-auto mb-2 h-6 w-6 text-white" />
|
|
406
|
+
<span className="text-xs text-white/60">24px</span>
|
|
407
|
+
</div>
|
|
408
|
+
<div className="text-center">
|
|
409
|
+
<CircularPlayIcon className="!mx-auto mb-2 h-8 w-8 text-white" />
|
|
410
|
+
<span className="text-xs text-white/60">32px</span>
|
|
411
|
+
</div>
|
|
412
|
+
<div className="text-center">
|
|
413
|
+
<CircularPlayIcon className="!mx-auto mb-2 h-10 w-10 text-white" />
|
|
414
|
+
<span className="text-xs text-white/60">40px</span>
|
|
415
|
+
</div>
|
|
416
|
+
<div className="text-center">
|
|
417
|
+
<CircularPlayIcon className="!mx-auto mb-2 h-12 w-12 text-white" />
|
|
418
|
+
<span className="text-xs text-white/60">48px</span>
|
|
419
|
+
</div>
|
|
420
|
+
<div className="text-center">
|
|
421
|
+
<CircularPlayIcon className="!mx-auto mb-2 h-16 w-16 text-white" />
|
|
422
|
+
<span className="text-xs text-white/60">64px</span>
|
|
423
|
+
</div>
|
|
424
|
+
</div>
|
|
425
|
+
),
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export const ColorVariations: Story = {
|
|
429
|
+
parameters: {
|
|
430
|
+
...storyParameters,
|
|
431
|
+
docs: {
|
|
432
|
+
description: {
|
|
433
|
+
story:
|
|
434
|
+
"CircularPlayIcon with different colors for branding and states.",
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
render: () => (
|
|
439
|
+
<div className="grid min-h-dvh grid-cols-2 items-center justify-center gap-6 rounded-lg bg-gradient-to-br from-gray-900 to-gray-800 p-8 md:grid-cols-4">
|
|
440
|
+
<div className="text-center">
|
|
441
|
+
<div className="!mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg border border-purple-500/30 bg-purple-500/20">
|
|
442
|
+
<CircularPlayIcon className="h-8 w-8 text-white" />
|
|
443
|
+
</div>
|
|
444
|
+
<div className="text-sm font-medium text-white">Primary</div>
|
|
445
|
+
</div>
|
|
446
|
+
<div className="text-center">
|
|
447
|
+
<div className="!mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg border border-pink-500/30 bg-pink-500/20">
|
|
448
|
+
<CircularPlayIcon className="h-8 w-8 text-white" />
|
|
449
|
+
</div>
|
|
450
|
+
<div className="text-sm font-medium text-white">Accent</div>
|
|
451
|
+
</div>
|
|
452
|
+
<div className="text-center">
|
|
453
|
+
<div className="!mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg border border-gray-500/30 bg-gray-500/20">
|
|
454
|
+
<CircularPlayIcon className="h-8 w-8 text-gray-200" />
|
|
455
|
+
</div>
|
|
456
|
+
<div className="text-sm font-medium text-white">Neutral</div>
|
|
457
|
+
</div>
|
|
458
|
+
<div className="text-center">
|
|
459
|
+
<div className="!mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg border border-white/20 bg-white/10">
|
|
460
|
+
<CircularPlayIcon className="h-8 w-8 text-white/90" />
|
|
461
|
+
</div>
|
|
462
|
+
<div className="text-sm font-medium text-white">Overlay</div>
|
|
463
|
+
</div>
|
|
464
|
+
</div>
|
|
465
|
+
),
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export const UsageExamples: Story = {
|
|
469
|
+
parameters: {
|
|
470
|
+
...storyParameters,
|
|
471
|
+
docs: {
|
|
472
|
+
description: {
|
|
473
|
+
story: "Real-world usage: media player and video play overlay.",
|
|
474
|
+
},
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
render: () => (
|
|
478
|
+
<div className="min-h-dvh !space-y-8 rounded-lg bg-gradient-to-br from-gray-900 to-gray-800 p-8">
|
|
479
|
+
<div className="!space-y-2">
|
|
480
|
+
<h3 className="text-sm font-medium text-white">Media player</h3>
|
|
481
|
+
<div className="flex items-center gap-4 rounded-lg border border-white/10 bg-white/5 p-4">
|
|
482
|
+
<button className="flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-purple-500/20 transition-colors hover:bg-purple-500/30">
|
|
483
|
+
<CircularPlayIcon className="h-7 w-7 text-white" />
|
|
484
|
+
</button>
|
|
485
|
+
<div className="min-w-0 flex-1">
|
|
486
|
+
<div className="text-sm font-medium text-white">Episode title</div>
|
|
487
|
+
<div className="text-xs text-white/60">0:00 / 24:30</div>
|
|
488
|
+
</div>
|
|
489
|
+
</div>
|
|
490
|
+
</div>
|
|
491
|
+
<div className="!space-y-2">
|
|
492
|
+
<h3 className="text-sm font-medium text-white">Video play overlay</h3>
|
|
493
|
+
<div className="relative flex h-32 items-center justify-center overflow-hidden rounded-lg border border-white/10 bg-black/40">
|
|
494
|
+
<div className="absolute inset-0 bg-gradient-to-t from-black/60 to-transparent" />
|
|
495
|
+
<button className="relative flex h-16 w-16 items-center justify-center rounded-full border border-white/30 bg-white/10 backdrop-blur-sm transition-colors hover:bg-white/20">
|
|
496
|
+
<CircularPlayIcon className="h-10 w-10 text-white" />
|
|
497
|
+
</button>
|
|
498
|
+
</div>
|
|
499
|
+
</div>
|
|
500
|
+
</div>
|
|
501
|
+
),
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export const Playground: Story = {
|
|
505
|
+
parameters: {
|
|
506
|
+
...storyParameters,
|
|
507
|
+
docs: {
|
|
508
|
+
description: {
|
|
509
|
+
story: "Interactive playground for CircularPlayIcon.",
|
|
510
|
+
},
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
args: {
|
|
514
|
+
width: 48,
|
|
515
|
+
height: 48,
|
|
516
|
+
className: "text-white",
|
|
517
|
+
},
|
|
518
|
+
render: (args) => (
|
|
519
|
+
<div className="flex h-64 min-h-dvh items-center justify-center rounded-lg bg-gradient-to-br from-gray-900 to-gray-800">
|
|
520
|
+
<div className="rounded-lg border border-white/10 bg-white/5 p-8">
|
|
521
|
+
<CircularPlayIcon {...args} />
|
|
522
|
+
</div>
|
|
523
|
+
</div>
|
|
524
|
+
),
|
|
525
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { AccessibleIcon } from "@radix-ui/react-accessible-icon"
|
|
3
|
+
|
|
4
|
+
export const CircularPlayIcon = (
|
|
5
|
+
props: React.SVGProps<SVGSVGElement> & { withAccessibility?: boolean }
|
|
6
|
+
) => {
|
|
7
|
+
const { withAccessibility = true, ...svgProps } = props
|
|
8
|
+
|
|
9
|
+
const svg = (
|
|
10
|
+
<svg
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
width="48"
|
|
13
|
+
height="48"
|
|
14
|
+
viewBox="0 0 48 48"
|
|
15
|
+
fill="none"
|
|
16
|
+
{...svgProps}
|
|
17
|
+
>
|
|
18
|
+
<path d="M20 31.5V16.5L31 24L20 31.5Z" fill="currentColor" />
|
|
19
|
+
<path
|
|
20
|
+
fillRule="evenodd"
|
|
21
|
+
clipRule="evenodd"
|
|
22
|
+
d="M24 7C14.6112 7 7 14.6112 7 24C7 33.3888 14.6112 41 24 41C33.3888 41 41 33.3888 41 24C41 14.6112 33.3888 7 24 7ZM4 24C4 12.9543 12.9543 4 24 4C35.0457 4 44 12.9543 44 24C44 35.0457 35.0457 44 24 44C12.9543 44 4 35.0457 4 24Z"
|
|
23
|
+
fill="currentColor"
|
|
24
|
+
/>
|
|
25
|
+
</svg>
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
if (withAccessibility) {
|
|
29
|
+
return <AccessibleIcon label="Circular play icon">{svg}</AccessibleIcon>
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return svg
|
|
33
|
+
}
|
package/dist/icons/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from "./chevron-double-left-icon"
|
|
|
20
20
|
export * from "./chevron-double-right-icon"
|
|
21
21
|
export * from "./chevron-down-icon"
|
|
22
22
|
export * from "./chevron-left-icon"
|
|
23
|
+
export * from "./circular-play-icon"
|
|
23
24
|
export * from "./chevron-right-icon"
|
|
24
25
|
export * from "./chevron-up-icon"
|
|
25
26
|
export * from "./circle-tick-icon"
|
|
@@ -79,6 +80,7 @@ export * from "./pencil-icon"
|
|
|
79
80
|
export * from "./plus-icon"
|
|
80
81
|
export * from "./pocket-studio-icon"
|
|
81
82
|
export * from "./phone-icon"
|
|
83
|
+
export * from "./scroll-down-icon"
|
|
82
84
|
export * from "./search-icon"
|
|
83
85
|
export * from "./setting-icon"
|
|
84
86
|
export * from "./share-icon"
|