aural-ui 2.1.5 → 2.1.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.
@@ -1,34 +1,117 @@
1
1
  import React from "react"
2
+ import clsx from "clsx"
3
+
4
+ import { cn } from "../../lib/utils"
2
5
 
3
6
  type ThumbnailTagsProps =
4
7
  | {
5
8
  variant: "promotional"
6
9
  text: string
10
+ classNames?: {
11
+ container?: string
12
+ text?: string
13
+ svg?: {
14
+ height?: number
15
+ width?: number
16
+ className?: string
17
+ }
18
+ }
7
19
  }
8
20
  | {
9
21
  variant: "engagement"
10
22
  primaryText: string
11
23
  secondaryText: string
24
+ classNames?: {
25
+ container?: string
26
+ primaryText?: string
27
+ secondaryText?: string
28
+ svg?: {
29
+ height?: number
30
+ width?: number
31
+ className?: string
32
+ }
33
+ }
12
34
  }
13
35
  | {
14
36
  variant: "checked" | "top10" | "completed-series"
37
+ classNames?: {
38
+ container?: string
39
+ svg?: {
40
+ height?: number
41
+ width?: number
42
+ className?: string
43
+ }
44
+ }
45
+ }
46
+ | {
47
+ variant: "ranked"
48
+ text: string
49
+ classNames?: {
50
+ container?: string
51
+ text?: string
52
+ svg?: {
53
+ height?: number
54
+ width?: number
55
+ className?: string
56
+ }
57
+ }
15
58
  }
16
59
 
17
60
  export function ThumbnailTags(props: ThumbnailTagsProps) {
18
- const { variant } = props
61
+ const { variant, classNames } = props
62
+
63
+ if (variant === "ranked") {
64
+ return (
65
+ <div className={cn("flex items-center", classNames?.container)}>
66
+ <p
67
+ //cn intentional not used, as it was breaking text-fm-primary
68
+ className={clsx(
69
+ "bg-fm-primary-500 text-fm-primary text-fm-md font-fm-brand flex px-1 py-0.5 uppercase",
70
+ classNames?.text
71
+ )}
72
+ style={{
73
+ clipPath: "polygon(99.5% 0, 0 0, 0 100%, 99.5% 100%, 100% 50%)",
74
+ }}
75
+ >
76
+ {props.text}
77
+ </p>
78
+ <svg
79
+ width={props.classNames?.svg?.width ?? 13.3}
80
+ height={props.classNames?.svg?.height ?? 25.3}
81
+ viewBox="0 0 11 23"
82
+ fill="none"
83
+ xmlns="http://www.w3.org/2000/svg"
84
+ className={cn("-ml-[4.4px]", props.classNames?.svg?.className)}
85
+ >
86
+ <path
87
+ d="M0.849976 11.5L3.03162 23L4.54529 15.0215L5.50427 21.8496L6.95837 11.5L5.50427 1.15039L4.54529 7.97754L3.03162 0L0.849976 11.5ZM7.47498 11.5L8.20154 20.7002L8.92908 11.5L8.20154 2.2998L7.47498 11.5ZM9.44568 11.5L10.1722 17.25L10.8998 11.5L10.1722 5.75L9.44568 11.5Z"
88
+ fill="#FA2937"
89
+ />
90
+ </svg>
91
+ </div>
92
+ )
93
+ }
94
+
19
95
  if (variant === "promotional") {
20
96
  return (
21
- <div className="flex h-4 w-14 gap-0.5">
22
- <p className="bg-fm-neongreen-500 text-fm-neutral-100 font-fm-brand font-fm-xs text-fm-xs w-11 text-center uppercase">
97
+ <div className={cn("flex h-4 w-14 gap-0.5", classNames?.container)}>
98
+ <p
99
+ //cn intentional not used, as it was breaking text-fm-neutral-100
100
+ className={clsx(
101
+ "bg-fm-neongreen-500 text-fm-neutral-100 font-fm-brand text-fm-xs w-11 text-center uppercase",
102
+ classNames?.text
103
+ )}
104
+ >
23
105
  {props.text}
24
106
  </p>
25
107
 
26
108
  <svg
27
- width="12"
28
- height="16"
109
+ height={props.classNames?.svg?.height ?? 16}
110
+ width={props.classNames?.svg?.width ?? 12}
29
111
  viewBox="0 0 12 16"
30
112
  fill="none"
31
113
  xmlns="http://www.w3.org/2000/svg"
114
+ className={classNames?.svg?.className}
32
115
  >
33
116
  <g clipPath="url(#clip0_3_736)">
34
117
  <rect
@@ -113,26 +196,28 @@ export function ThumbnailTags(props: ThumbnailTagsProps) {
113
196
  </div>
114
197
  )
115
198
  }
199
+
116
200
  if (variant === "checked") {
117
201
  return (
118
202
  <svg
119
- width="29"
120
- height="16"
203
+ width={props.classNames?.svg?.width ?? 29}
204
+ height={props.classNames?.svg?.height ?? 16}
121
205
  viewBox="0 0 29 16"
122
206
  fill="none"
123
207
  xmlns="http://www.w3.org/2000/svg"
208
+ className={classNames?.svg?.className}
124
209
  >
125
210
  <g opacity="0.5">
126
211
  <path
127
212
  fillRule="evenodd"
128
213
  clipRule="evenodd"
129
- d="M12 15.5024C8.08937 15.2353 5 11.9784 5 7.99994C5 4.0215 8.08937 0.764629 12 0.497437promotional5.5024Z"
214
+ d="M12 15.5024C8.08937 15.2353 5 11.9784 5 7.99994C5 4.0215 8.08937 0.764629 12 0.497437V15.5024Z"
130
215
  fill="#004719"
131
216
  />
132
217
  <path
133
218
  fillRule="evenodd"
134
219
  clipRule="evenodd"
135
- d="M4 12.9317C1.71552 12.4529 4.76837e-07 10.4268 4.76837e-07 7.99999C4.76837e-07 5.5732 1.71552 3.5471 4 3.06824promotional2.9317Z"
220
+ d="M4 12.9317C1.71552 12.4529 4.76837e-07 10.4268 4.76837e-07 7.99999C4.76837e-07 5.5732 1.71552 3.5471 4 3.06824V12.9317Z"
136
221
  fill="#004719"
137
222
  />
138
223
  </g>
@@ -149,25 +234,37 @@ export function ThumbnailTags(props: ThumbnailTagsProps) {
149
234
  </svg>
150
235
  )
151
236
  }
237
+
152
238
  if (variant === "engagement") {
153
239
  return (
154
- <div className="flex h-4 w-14 gap-0.5">
240
+ <div className={cn("flex gap-0.5", classNames?.container)}>
155
241
  <div className="bg-fm-primary-400 text-fm-primary font-fm-brand flex uppercase">
156
- <p className="text-fm-sm flex w-9 items-center justify-center px-1">
242
+ <p
243
+ className={cn(
244
+ "text-fm-sm flex w-fit items-center justify-center px-1",
245
+ classNames?.primaryText
246
+ )}
247
+ >
157
248
  {props.primaryText}
158
249
  </p>
159
250
  <div className="flex w-1.5 items-center justify-center">
160
- <span className="rotate-90 text-[5px] leading-none whitespace-nowrap">
251
+ <span
252
+ className={cn(
253
+ "rotate-90 pt-1 text-[6px] leading-none whitespace-nowrap",
254
+ classNames?.secondaryText
255
+ )}
256
+ >
161
257
  {props.secondaryText}
162
258
  </span>
163
259
  </div>
164
260
  </div>
165
261
  <svg
166
- width="9"
167
- height="16"
262
+ width={props.classNames?.svg?.width ?? 9}
263
+ height={props.classNames?.svg?.height ?? 16}
168
264
  viewBox="0 0 9 16"
169
265
  fill="none"
170
266
  xmlns="http://www.w3.org/2000/svg"
267
+ className={classNames?.svg?.className}
171
268
  >
172
269
  <g clipPath="url(#clip0_17092_166916)">
173
270
  <path
@@ -187,15 +284,16 @@ export function ThumbnailTags(props: ThumbnailTagsProps) {
187
284
  </div>
188
285
  )
189
286
  }
190
- //top 10
287
+
191
288
  if (variant === "top10") {
192
289
  return (
193
290
  <svg
194
- width="28"
195
- height="20"
291
+ width={props.classNames?.svg?.width ?? 28}
292
+ height={props.classNames?.svg?.height ?? 20}
196
293
  viewBox="0 0 28 20"
197
294
  fill="none"
198
295
  xmlns="http://www.w3.org/2000/svg"
296
+ className={classNames?.svg?.className}
199
297
  >
200
298
  <g clipPath="url(#clip0_3_790)">
201
299
  <path
@@ -228,15 +326,15 @@ export function ThumbnailTags(props: ThumbnailTagsProps) {
228
326
  )
229
327
  }
230
328
 
231
- // completed series
232
329
  if (variant === "completed-series") {
233
330
  return (
234
331
  <svg
235
- width="136"
236
- height="16"
332
+ width={props.classNames?.svg?.width ?? 136}
333
+ height={props.classNames?.svg?.height ?? 16}
237
334
  viewBox="0 0 136 16"
238
335
  fill="none"
239
336
  xmlns="http://www.w3.org/2000/svg"
337
+ className={classNames?.svg?.className}
240
338
  >
241
339
  <g opacity="0.5">
242
340
  <path
@@ -283,9 +381,15 @@ export function ThumbnailTags(props: ThumbnailTagsProps) {
283
381
  </svg>
284
382
  )
285
383
  }
384
+
286
385
  // Default version
287
386
  return (
288
- <p className="bg-fm-neongreen-500 text-fm-neutral-100 font-fm-brand font-fm-xs text-fm-xs w-11 text-center uppercase">
387
+ <p
388
+ className={cn(
389
+ "bg-fm-neongreen-500 text-fm-neutral-100 font-fm-brand font-fm-xs text-fm-xs w-11 p-1 text-center uppercase",
390
+ classNames?.container
391
+ )}
392
+ >
289
393
  30% off
290
394
  </p>
291
395
  )