aural-ui 4.2.4 → 4.4.0
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/aspect-ratio/AspectRatio.stories.tsx +4 -4
- package/dist/components/badge/Badge.stories.tsx +3 -3
- package/dist/components/button/Button.stories.tsx +288 -366
- package/dist/components/button/index.tsx +3 -43
- package/dist/components/card/Card.stories.tsx +2 -2
- package/dist/components/card/index.tsx +1 -1
- package/dist/components/clamp-lines/index.tsx +0 -1
- package/dist/components/drawer/index.tsx +1 -1
- package/dist/components/hover-card/HoverCard.stories.tsx +7 -7
- package/dist/components/index.ts +1 -1
- package/dist/components/marquee/Marquee.stories.tsx +2 -6
- package/dist/components/offer-label/OfferLabel.stories.tsx +267 -0
- package/dist/components/offer-label/index.tsx +32 -0
- package/dist/components/offer-label/meta.ts +6 -0
- package/dist/components/otp-inputs/OtpInputs.stories.tsx +1 -1
- package/dist/components/popover/Popover.stories.tsx +1 -1
- package/dist/components/slider/index.tsx +1 -6
- package/dist/components/table/Table.stories.tsx +4 -4
- package/dist/components/toggle/Toggle.stories.tsx +4 -4
- package/dist/components/tooltip/index.tsx +1 -2
- package/dist/components/typography/Typography.stories.tsx +7 -19
- package/dist/components/typography/index.tsx +0 -2
- package/dist/fonts/LabGrotesque-Medium.ttf +0 -0
- package/dist/icons/all-icons.tsx +9 -7
- package/dist/icons/chain-link-icon/ChainLinkIcon.stories.tsx +167 -0
- package/dist/icons/chain-link-icon/index.tsx +30 -0
- package/dist/icons/chain-link-icon/meta.ts +8 -0
- package/dist/icons/clock-icon/ClockIcon.stories.tsx +210 -0
- package/dist/icons/clock-icon/index.tsx +28 -0
- package/dist/icons/clock-icon/meta.ts +8 -0
- package/dist/icons/headphone-icon/HeadphoneIcon.stories.tsx +186 -0
- package/dist/icons/headphone-icon/index.tsx +49 -0
- package/dist/icons/headphone-icon/meta.ts +8 -0
- package/dist/icons/index.ts +5 -1
- package/dist/icons/site-logo-icon/SiteLogoIcon.stories.tsx +3 -3
- package/dist/icons/underline-icon/UnderlineIcon.stories.tsx +238 -0
- package/dist/icons/underline-icon/index.tsx +58 -0
- package/dist/icons/underline-icon/meta.ts +8 -0
- package/dist/index.cjs +86 -86
- package/dist/index.js +86 -86
- package/package.json +5 -5
- package/dist/fonts/LabGrotesqueTRIAL-Bold.otf +0 -0
- package/dist/fonts/LabGrotesqueTRIAL-Light.otf +0 -0
- package/dist/fonts/LabGrotesqueTRIAL-Medium.otf +0 -0
- package/dist/fonts/LabGrotesqueTRIAL-Regular.otf +0 -0
- package/dist/fonts/PPSupplySans-Regular (1).otf +0 -0
- package/dist/fonts/PPSupplySans-Ultralight.otf +0 -0
|
@@ -77,8 +77,9 @@ const meta: Meta<typeof Typography> = {
|
|
|
77
77
|
},
|
|
78
78
|
weight: {
|
|
79
79
|
control: "select",
|
|
80
|
-
options: ["regular", "medium"
|
|
81
|
-
description:
|
|
80
|
+
options: ["regular", "medium"],
|
|
81
|
+
description:
|
|
82
|
+
"Font weight. Lab Grotesque body/caption variants support regular (400) and medium (500) only.",
|
|
82
83
|
},
|
|
83
84
|
align: {
|
|
84
85
|
control: "radio",
|
|
@@ -336,23 +337,10 @@ export const Configurations: Story = {
|
|
|
336
337
|
medium (500)
|
|
337
338
|
</p>
|
|
338
339
|
</div>
|
|
339
|
-
<div className="space-y-2 text-center">
|
|
340
|
-
<Typography variant="body-large" weight="semibold">
|
|
341
|
-
Semibold
|
|
342
|
-
</Typography>
|
|
343
|
-
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
344
|
-
semibold (600)
|
|
345
|
-
</p>
|
|
346
|
-
</div>
|
|
347
|
-
<div className="space-y-2 text-center">
|
|
348
|
-
<Typography variant="body-large" weight="bold">
|
|
349
|
-
Bold
|
|
350
|
-
</Typography>
|
|
351
|
-
<p className="text-fm-secondary font-fm-text text-fm-sm leading-fm-sm">
|
|
352
|
-
bold (700)
|
|
353
|
-
</p>
|
|
354
|
-
</div>
|
|
355
340
|
</div>
|
|
341
|
+
<p className="text-fm-tertiary font-fm-text text-fm-sm leading-fm-sm">
|
|
342
|
+
Body and caption variants support regular and medium only.
|
|
343
|
+
</p>
|
|
356
344
|
</div>
|
|
357
345
|
|
|
358
346
|
{/* Color axis */}
|
|
@@ -514,7 +502,7 @@ export const Configurations: Story = {
|
|
|
514
502
|
docs: {
|
|
515
503
|
description: {
|
|
516
504
|
story:
|
|
517
|
-
"One subsection per configuration axis: weight (regular →
|
|
505
|
+
"One subsection per configuration axis: weight (regular → medium), color (primary → inactive), alignment (left / center / right), text-transform, and line-height override (tight / normal / loose).",
|
|
518
506
|
},
|
|
519
507
|
},
|
|
520
508
|
},
|
|
Binary file
|
package/dist/icons/all-icons.tsx
CHANGED
|
@@ -95,7 +95,7 @@ function InteractiveIcon() {
|
|
|
95
95
|
<IconComponent className="text-fm-primary h-8 w-8" />
|
|
96
96
|
</div>
|
|
97
97
|
<div>
|
|
98
|
-
<DialogTitle className="text-fm-primary text-xl font-
|
|
98
|
+
<DialogTitle className="text-fm-primary text-xl font-medium">
|
|
99
99
|
{iconName}
|
|
100
100
|
</DialogTitle>
|
|
101
101
|
<p className="text-fm-tertiary text-sm">
|
|
@@ -234,7 +234,7 @@ const IconCategory: React.FC<IconCategoryProps> = ({ category, children }) => {
|
|
|
234
234
|
className="h-px flex-1"
|
|
235
235
|
style={{ background: "var(--gradient-fm-stroke-neutral)" }}
|
|
236
236
|
/>
|
|
237
|
-
<h2 className="border-fm-secondary-500/20 bg-fm-secondary-500/10 text-fm-secondary-800 rounded-full border px-4 py-2 text-lg font-
|
|
237
|
+
<h2 className="border-fm-secondary-500/20 bg-fm-secondary-500/10 text-fm-secondary-800 rounded-full border px-4 py-2 text-lg font-medium">
|
|
238
238
|
{category}
|
|
239
239
|
</h2>
|
|
240
240
|
<div
|
|
@@ -271,7 +271,7 @@ const IconGrid: React.FC<IconGridProps> = ({
|
|
|
271
271
|
return (
|
|
272
272
|
<div className="space-y-6">
|
|
273
273
|
<div className="space-y-2">
|
|
274
|
-
<h3 className="text-fm-primary text-2xl font-
|
|
274
|
+
<h3 className="text-fm-primary text-2xl font-medium">{title}</h3>
|
|
275
275
|
{description && (
|
|
276
276
|
<p className="text-fm-secondary text-sm leading-relaxed">
|
|
277
277
|
{description}
|
|
@@ -617,7 +617,9 @@ export const Icons: React.FC = () => {
|
|
|
617
617
|
/>
|
|
618
618
|
<div className="relative mx-auto max-w-7xl px-6 py-16">
|
|
619
619
|
<div className="space-y-6 text-center">
|
|
620
|
-
<h1 className="text-fm-primary text-5xl font-
|
|
620
|
+
<h1 className="text-fm-primary text-5xl font-medium">
|
|
621
|
+
Icon Library
|
|
622
|
+
</h1>
|
|
621
623
|
<p className="text-fm-secondary mx-auto max-w-3xl text-xl leading-relaxed">
|
|
622
624
|
A comprehensive collection of carefully crafted icons built with
|
|
623
625
|
accessibility in mind. Each icon is optimized for clarity and
|
|
@@ -627,21 +629,21 @@ export const Icons: React.FC = () => {
|
|
|
627
629
|
{/* Stats */}
|
|
628
630
|
<div className="flex items-center justify-center gap-8 pt-8">
|
|
629
631
|
<div className="text-center">
|
|
630
|
-
<div className="text-fm-icon-brand-secondary text-3xl font-
|
|
632
|
+
<div className="text-fm-icon-brand-secondary text-3xl font-medium">
|
|
631
633
|
{totalIcons}
|
|
632
634
|
</div>
|
|
633
635
|
<div className="text-fm-tertiary text-sm">Total icons</div>
|
|
634
636
|
</div>
|
|
635
637
|
<div className="bg-fm-divider-secondary h-8 w-px" />
|
|
636
638
|
<div className="text-center">
|
|
637
|
-
<div className="text-fm-info text-3xl font-
|
|
639
|
+
<div className="text-fm-info text-3xl font-medium">
|
|
638
640
|
{categoryCount}
|
|
639
641
|
</div>
|
|
640
642
|
<div className="text-fm-tertiary text-sm">Categories</div>
|
|
641
643
|
</div>
|
|
642
644
|
<div className="bg-fm-divider-secondary h-8 w-px" />
|
|
643
645
|
<div className="text-center">
|
|
644
|
-
<div className="text-fm-positive text-3xl font-
|
|
646
|
+
<div className="text-fm-positive text-3xl font-medium">
|
|
645
647
|
Accessible
|
|
646
648
|
</div>
|
|
647
649
|
<div className="text-fm-tertiary text-sm">Radix UI</div>
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite"
|
|
3
|
+
|
|
4
|
+
import { ArrowRightUpIcon } from "src/ui/icons/arrow-right-up-icon"
|
|
5
|
+
import { CopyIcon } from "src/ui/icons/copy-icon"
|
|
6
|
+
import { GlobeIcon } from "src/ui/icons/globe-icon"
|
|
7
|
+
import { ShareIcon } from "src/ui/icons/share-icon"
|
|
8
|
+
import {
|
|
9
|
+
IconColorVariations,
|
|
10
|
+
IconDefaultCanvas,
|
|
11
|
+
IconPlaygroundCanvas,
|
|
12
|
+
IconSizeVariations,
|
|
13
|
+
IconUsageCanvas,
|
|
14
|
+
IconUsageSection,
|
|
15
|
+
} from "src/ui/story-spec/icons/icon-story-canvas"
|
|
16
|
+
import { AuralIconDocsPage } from "src/ui/story-spec/icons/icon-story-docs-page"
|
|
17
|
+
|
|
18
|
+
import { ChainLinkIcon } from "."
|
|
19
|
+
|
|
20
|
+
const meta: Meta<typeof ChainLinkIcon> = {
|
|
21
|
+
title: "Icons/ChainLinkIcon",
|
|
22
|
+
component: ChainLinkIcon,
|
|
23
|
+
parameters: {
|
|
24
|
+
layout: "fullscreen",
|
|
25
|
+
backgrounds: {
|
|
26
|
+
default: "dark",
|
|
27
|
+
values: [
|
|
28
|
+
{ name: "dark", value: "var(--color-fm-surface-primary)" },
|
|
29
|
+
{ name: "darker", value: "var(--color-fm-neutral-0)" },
|
|
30
|
+
{ name: "light", value: "var(--color-fm-neutral-1100)" },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
docs: {
|
|
34
|
+
page: () => (
|
|
35
|
+
<AuralIconDocsPage
|
|
36
|
+
accentToken="info"
|
|
37
|
+
features={[
|
|
38
|
+
{
|
|
39
|
+
title: "Chain Link Shape",
|
|
40
|
+
description: "Two-link URL indicator",
|
|
41
|
+
},
|
|
42
|
+
{ title: "Scalable", description: "Works at any size" },
|
|
43
|
+
{ title: "Accessible", description: "ARIA-ready by default" },
|
|
44
|
+
]}
|
|
45
|
+
quickStart={{
|
|
46
|
+
codeExample: `import { ChainLinkIcon } from "src/ui/icons/chain-link-icon"
|
|
47
|
+
|
|
48
|
+
function CopyLinkButton() {
|
|
49
|
+
return (
|
|
50
|
+
<button className="flex items-center gap-2">
|
|
51
|
+
<ChainLinkIcon className="h-4 w-4" />
|
|
52
|
+
Copy link
|
|
53
|
+
</button>
|
|
54
|
+
)
|
|
55
|
+
}`,
|
|
56
|
+
livePreview: (
|
|
57
|
+
<button className="bg-fm-surface-secondary border-fm-divider-secondary text-fm-primary font-fm-text flex items-center gap-2 rounded-xl border px-4 py-2.5 text-sm">
|
|
58
|
+
<ChainLinkIcon className="text-fm-icon-active h-4 w-4" />
|
|
59
|
+
Copy link
|
|
60
|
+
</button>
|
|
61
|
+
),
|
|
62
|
+
}}
|
|
63
|
+
relatedIcons={[
|
|
64
|
+
{
|
|
65
|
+
name: "ShareIcon",
|
|
66
|
+
description: "Share content externally",
|
|
67
|
+
icon: ShareIcon,
|
|
68
|
+
accentToken: "info",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "CopyIcon",
|
|
72
|
+
description: "Duplicate to clipboard",
|
|
73
|
+
icon: CopyIcon,
|
|
74
|
+
accentToken: "positive",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "GlobeIcon",
|
|
78
|
+
description: "Web or URL context",
|
|
79
|
+
icon: GlobeIcon,
|
|
80
|
+
accentToken: "warning",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "ArrowRightUpIcon",
|
|
84
|
+
description: "Open in new tab",
|
|
85
|
+
icon: ArrowRightUpIcon,
|
|
86
|
+
accentToken: "negative",
|
|
87
|
+
},
|
|
88
|
+
]}
|
|
89
|
+
/>
|
|
90
|
+
),
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
tags: ["autodocs"],
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export default meta
|
|
97
|
+
type Story = StoryObj<typeof ChainLinkIcon>
|
|
98
|
+
|
|
99
|
+
export const Default: Story = {
|
|
100
|
+
render: (args) => (
|
|
101
|
+
<IconDefaultCanvas>
|
|
102
|
+
<ChainLinkIcon className="text-fm-icon-active h-5 w-5" {...args} />
|
|
103
|
+
</IconDefaultCanvas>
|
|
104
|
+
),
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const SizeVariations: Story = {
|
|
108
|
+
render: () => <IconSizeVariations icon={ChainLinkIcon} />,
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export const ColorVariations: Story = {
|
|
112
|
+
render: () => <IconColorVariations icon={ChainLinkIcon} />,
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const UsageExamples: Story = {
|
|
116
|
+
render: () => (
|
|
117
|
+
<IconUsageCanvas>
|
|
118
|
+
<IconUsageSection title="Copy Link Button">
|
|
119
|
+
<button className="bg-fm-surface-secondary border-fm-divider-secondary text-fm-primary font-fm-text flex items-center gap-2 rounded-xl border px-4 py-2.5 text-sm">
|
|
120
|
+
<ChainLinkIcon className="text-fm-icon-active h-4 w-4" />
|
|
121
|
+
Copy link
|
|
122
|
+
</button>
|
|
123
|
+
</IconUsageSection>
|
|
124
|
+
|
|
125
|
+
<IconUsageSection title="Inline Link Reference">
|
|
126
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary flex w-full max-w-sm items-center gap-3 rounded-xl border p-4">
|
|
127
|
+
<ChainLinkIcon className="text-fm-icon-info h-4 w-4 shrink-0" />
|
|
128
|
+
<span className="text-fm-secondary font-fm-text truncate text-sm">
|
|
129
|
+
https://pocketfm.com/show/audio-drama
|
|
130
|
+
</span>
|
|
131
|
+
</div>
|
|
132
|
+
</IconUsageSection>
|
|
133
|
+
|
|
134
|
+
<IconUsageSection title="Share Row">
|
|
135
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary w-full max-w-sm rounded-xl border p-4">
|
|
136
|
+
<p className="text-fm-secondary font-fm-text mb-3 text-xs tracking-wider uppercase">
|
|
137
|
+
Share via
|
|
138
|
+
</p>
|
|
139
|
+
<div className="flex flex-col gap-3">
|
|
140
|
+
{[
|
|
141
|
+
{ label: "Copy link", icon: ChainLinkIcon },
|
|
142
|
+
{ label: "Share externally", icon: ShareIcon },
|
|
143
|
+
].map(({ label, icon: Icon }) => (
|
|
144
|
+
<button
|
|
145
|
+
key={label}
|
|
146
|
+
className="text-fm-primary font-fm-text flex items-center gap-3 text-sm"
|
|
147
|
+
>
|
|
148
|
+
<span className="bg-fm-surface-tertiary flex h-8 w-8 items-center justify-center rounded-lg">
|
|
149
|
+
<Icon className="text-fm-icon-active h-4 w-4" />
|
|
150
|
+
</span>
|
|
151
|
+
{label}
|
|
152
|
+
</button>
|
|
153
|
+
))}
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</IconUsageSection>
|
|
157
|
+
</IconUsageCanvas>
|
|
158
|
+
),
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export const Playground: Story = {
|
|
162
|
+
render: (args) => (
|
|
163
|
+
<IconPlaygroundCanvas>
|
|
164
|
+
<ChainLinkIcon className="text-fm-icon-active h-6 w-6" {...args} />
|
|
165
|
+
</IconPlaygroundCanvas>
|
|
166
|
+
),
|
|
167
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { AccessibleIcon } from "@radix-ui/react-accessible-icon"
|
|
3
|
+
|
|
4
|
+
export interface IChainLinkIconProps extends React.SVGProps<SVGSVGElement> {
|
|
5
|
+
withAccessibility?: boolean
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const ChainLinkIcon = (props: IChainLinkIconProps) => {
|
|
9
|
+
const { withAccessibility = true, ...svgProps } = props
|
|
10
|
+
|
|
11
|
+
const svg = (
|
|
12
|
+
<svg
|
|
13
|
+
viewBox="0 0 16 16"
|
|
14
|
+
fill="none"
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
stroke="currentColor"
|
|
17
|
+
strokeWidth="1.5"
|
|
18
|
+
strokeLinecap="square"
|
|
19
|
+
{...svgProps}
|
|
20
|
+
>
|
|
21
|
+
<path d="M6.5001 3.68247L7.14443 3.03814C8.75084 1.43172 11.3554 1.43172 12.9618 3.03814C14.5682 4.64456 14.5682 7.24907 12.9618 8.85548L12.316 9.50124M3.68582 6.49674L3.03806 7.1445C1.43165 8.75092 1.43165 11.3554 3.03806 12.9618C4.64448 14.5683 7.24899 14.5683 8.85541 12.9618L9.49843 12.3188M6.33325 9.66666L9.66658 6.33333" />
|
|
22
|
+
</svg>
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
if (withAccessibility) {
|
|
26
|
+
return <AccessibleIcon label="Chain link icon">{svg}</AccessibleIcon>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return svg
|
|
30
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite"
|
|
3
|
+
|
|
4
|
+
import { BackwardTenSecondsIcon } from "src/ui/icons/backward-ten-seconds-icon"
|
|
5
|
+
import { ForwardTenSecondsIcon } from "src/ui/icons/forward-ten-seconds-icon"
|
|
6
|
+
import { NotepadIcon } from "src/ui/icons/notepad-icon"
|
|
7
|
+
import { SpinnerSolidIcon } from "src/ui/icons/spinner-solid-icon"
|
|
8
|
+
import {
|
|
9
|
+
IconColorVariations,
|
|
10
|
+
IconDefaultCanvas,
|
|
11
|
+
IconPlaygroundCanvas,
|
|
12
|
+
IconSizeVariations,
|
|
13
|
+
IconUsageCanvas,
|
|
14
|
+
IconUsageSection,
|
|
15
|
+
} from "src/ui/story-spec/icons/icon-story-canvas"
|
|
16
|
+
import { AuralIconDocsPage } from "src/ui/story-spec/icons/icon-story-docs-page"
|
|
17
|
+
|
|
18
|
+
import { ClockIcon } from "."
|
|
19
|
+
|
|
20
|
+
const meta: Meta<typeof ClockIcon> = {
|
|
21
|
+
title: "Icons/ClockIcon",
|
|
22
|
+
component: ClockIcon,
|
|
23
|
+
parameters: {
|
|
24
|
+
layout: "fullscreen",
|
|
25
|
+
backgrounds: {
|
|
26
|
+
default: "dark",
|
|
27
|
+
values: [
|
|
28
|
+
{ name: "dark", value: "var(--color-fm-surface-primary)" },
|
|
29
|
+
{ name: "darker", value: "var(--color-fm-neutral-0)" },
|
|
30
|
+
{ name: "light", value: "var(--color-fm-neutral-1100)" },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
docs: {
|
|
34
|
+
page: () => (
|
|
35
|
+
<AuralIconDocsPage
|
|
36
|
+
accentToken="info"
|
|
37
|
+
features={[
|
|
38
|
+
{
|
|
39
|
+
title: "Time & Schedule",
|
|
40
|
+
description: "Represents time-based UI",
|
|
41
|
+
},
|
|
42
|
+
{ title: "Compact Shape", description: "Crisp at small sizes" },
|
|
43
|
+
{ title: "Accessible", description: "ARIA-ready by default" },
|
|
44
|
+
]}
|
|
45
|
+
quickStart={{
|
|
46
|
+
codeExample: `import { ClockIcon } from "src/ui/icons/clock-icon"
|
|
47
|
+
|
|
48
|
+
function PublishedAt({ time }: { time: string }) {
|
|
49
|
+
return (
|
|
50
|
+
<span className="flex items-center gap-1.5">
|
|
51
|
+
<ClockIcon className="h-4 w-4 text-fm-icon-inactive" />
|
|
52
|
+
<span className="text-fm-secondary text-sm">{time}</span>
|
|
53
|
+
</span>
|
|
54
|
+
)
|
|
55
|
+
}`,
|
|
56
|
+
livePreview: (
|
|
57
|
+
<span className="flex items-center gap-1.5">
|
|
58
|
+
<ClockIcon className="text-fm-icon-inactive h-4 w-4" />
|
|
59
|
+
<span className="text-fm-secondary font-fm-text text-sm">
|
|
60
|
+
2 hours ago
|
|
61
|
+
</span>
|
|
62
|
+
</span>
|
|
63
|
+
),
|
|
64
|
+
}}
|
|
65
|
+
relatedIcons={[
|
|
66
|
+
{
|
|
67
|
+
name: "BackwardTenSecondsIcon",
|
|
68
|
+
description: "Rewind ten seconds",
|
|
69
|
+
icon: BackwardTenSecondsIcon,
|
|
70
|
+
accentToken: "info",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "ForwardTenSecondsIcon",
|
|
74
|
+
description: "Skip ten seconds ahead",
|
|
75
|
+
icon: ForwardTenSecondsIcon,
|
|
76
|
+
accentToken: "positive",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "SpinnerSolidIcon",
|
|
80
|
+
description: "Loading / waiting state",
|
|
81
|
+
icon: SpinnerSolidIcon,
|
|
82
|
+
accentToken: "warning",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "NotepadIcon",
|
|
86
|
+
description: "Notes and scheduling",
|
|
87
|
+
icon: NotepadIcon,
|
|
88
|
+
accentToken: "negative",
|
|
89
|
+
},
|
|
90
|
+
]}
|
|
91
|
+
/>
|
|
92
|
+
),
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
tags: ["autodocs"],
|
|
96
|
+
argTypes: {
|
|
97
|
+
className: {
|
|
98
|
+
control: "text",
|
|
99
|
+
description: "CSS classes including color token",
|
|
100
|
+
},
|
|
101
|
+
withAccessibility: {
|
|
102
|
+
control: "boolean",
|
|
103
|
+
description: "Wrap with accessibility label",
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default meta
|
|
109
|
+
type Story = StoryObj<typeof ClockIcon>
|
|
110
|
+
|
|
111
|
+
export const Default: Story = {
|
|
112
|
+
args: {
|
|
113
|
+
className: "h-6 w-6 text-fm-icon-active",
|
|
114
|
+
withAccessibility: true,
|
|
115
|
+
},
|
|
116
|
+
render: (args) => (
|
|
117
|
+
<IconDefaultCanvas>
|
|
118
|
+
<ClockIcon {...args} />
|
|
119
|
+
</IconDefaultCanvas>
|
|
120
|
+
),
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const SizeVariations: Story = {
|
|
124
|
+
render: () => <IconSizeVariations icon={ClockIcon} />,
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export const ColorVariations: Story = {
|
|
128
|
+
render: () => <IconColorVariations icon={ClockIcon} />,
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const UsageExamples: Story = {
|
|
132
|
+
render: () => (
|
|
133
|
+
<IconUsageCanvas>
|
|
134
|
+
<IconUsageSection title="Timestamp Label">
|
|
135
|
+
<span className="flex items-center gap-1.5">
|
|
136
|
+
<ClockIcon className="text-fm-icon-inactive h-4 w-4" />
|
|
137
|
+
<span className="text-fm-secondary font-fm-text text-sm">
|
|
138
|
+
2 hours ago
|
|
139
|
+
</span>
|
|
140
|
+
</span>
|
|
141
|
+
</IconUsageSection>
|
|
142
|
+
|
|
143
|
+
<IconUsageSection title="Episode Duration">
|
|
144
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary flex w-full max-w-sm items-center gap-3 rounded-xl border px-4 py-3">
|
|
145
|
+
<div className="bg-fm-surface-primary h-10 w-10 flex-none rounded-lg" />
|
|
146
|
+
<div className="min-w-0 flex-1">
|
|
147
|
+
<p className="text-fm-primary font-fm-text truncate text-sm font-medium">
|
|
148
|
+
The Morning Show
|
|
149
|
+
</p>
|
|
150
|
+
<span className="text-fm-tertiary font-fm-text flex items-center gap-1 text-xs">
|
|
151
|
+
<ClockIcon className="text-fm-icon-inactive h-3 w-3" />
|
|
152
|
+
45 min
|
|
153
|
+
</span>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</IconUsageSection>
|
|
157
|
+
|
|
158
|
+
<IconUsageSection title="Scheduled Release">
|
|
159
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary w-full max-w-sm rounded-xl border px-4 py-3">
|
|
160
|
+
<div className="flex items-center justify-between">
|
|
161
|
+
<span className="text-fm-primary font-fm-text text-sm font-medium">
|
|
162
|
+
Episode 12
|
|
163
|
+
</span>
|
|
164
|
+
<span className="text-fm-icon-info bg-fm-icon-info/10 flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium">
|
|
165
|
+
<ClockIcon className="h-3 w-3" />
|
|
166
|
+
Scheduled
|
|
167
|
+
</span>
|
|
168
|
+
</div>
|
|
169
|
+
<p className="text-fm-tertiary font-fm-text mt-1 text-xs">
|
|
170
|
+
Publishes on May 10 at 9:00 AM
|
|
171
|
+
</p>
|
|
172
|
+
</div>
|
|
173
|
+
</IconUsageSection>
|
|
174
|
+
|
|
175
|
+
<IconUsageSection title="Listening History">
|
|
176
|
+
<div className="border-fm-divider-secondary bg-fm-surface-secondary w-full max-w-sm divide-y rounded-xl border">
|
|
177
|
+
{["Yesterday", "2 days ago", "Last week"].map((time) => (
|
|
178
|
+
<div
|
|
179
|
+
key={time}
|
|
180
|
+
className="flex items-center gap-3 px-4 py-3 first:rounded-t-xl last:rounded-b-xl"
|
|
181
|
+
>
|
|
182
|
+
<div className="bg-fm-surface-primary h-8 w-8 flex-none rounded-lg" />
|
|
183
|
+
<div className="min-w-0 flex-1">
|
|
184
|
+
<p className="text-fm-primary font-fm-text truncate text-sm">
|
|
185
|
+
Episode Title
|
|
186
|
+
</p>
|
|
187
|
+
</div>
|
|
188
|
+
<span className="text-fm-tertiary font-fm-text flex flex-none items-center gap-1 text-xs">
|
|
189
|
+
<ClockIcon className="text-fm-icon-inactive h-3 w-3" />
|
|
190
|
+
{time}
|
|
191
|
+
</span>
|
|
192
|
+
</div>
|
|
193
|
+
))}
|
|
194
|
+
</div>
|
|
195
|
+
</IconUsageSection>
|
|
196
|
+
</IconUsageCanvas>
|
|
197
|
+
),
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export const Playground: Story = {
|
|
201
|
+
args: {
|
|
202
|
+
className: "h-8 w-8 text-fm-icon-active",
|
|
203
|
+
withAccessibility: true,
|
|
204
|
+
},
|
|
205
|
+
render: (args) => (
|
|
206
|
+
<IconPlaygroundCanvas>
|
|
207
|
+
<ClockIcon {...args} />
|
|
208
|
+
</IconPlaygroundCanvas>
|
|
209
|
+
),
|
|
210
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { AccessibleIcon } from "@radix-ui/react-accessible-icon"
|
|
3
|
+
|
|
4
|
+
export interface IClockIconProps extends React.SVGProps<SVGSVGElement> {
|
|
5
|
+
withAccessibility?: boolean
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const ClockIcon = (props: IClockIconProps) => {
|
|
9
|
+
const { withAccessibility = true, ...svgProps } = props
|
|
10
|
+
|
|
11
|
+
const svg = (
|
|
12
|
+
<svg
|
|
13
|
+
viewBox="0 0 11 11"
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
aria-hidden="true"
|
|
17
|
+
{...svgProps}
|
|
18
|
+
>
|
|
19
|
+
<path d="M5.625 3V2.5H4.625V3H5.125H5.625ZM5.125 5.125H4.625V5.33211L4.77145 5.47855L5.125 5.125ZM6.14645 6.85355C6.34171 7.04882 6.65829 7.04882 6.85355 6.85355C7.04882 6.65829 7.04882 6.34171 6.85355 6.14645L6.5 6.5L6.14645 6.85355ZM9.75 5.125H9.25C9.25 7.40317 7.40317 9.25 5.125 9.25V9.75V10.25C7.95546 10.25 10.25 7.95546 10.25 5.125H9.75ZM5.125 9.75V9.25C2.84683 9.25 1 7.40317 1 5.125H0.5H0C0 7.95546 2.29454 10.25 5.125 10.25V9.75ZM0.5 5.125H1C1 2.84683 2.84683 1 5.125 1V0.5V0C2.29454 0 0 2.29454 0 5.125H0.5ZM5.125 0.5V1C7.40317 1 9.25 2.84683 9.25 5.125H9.75H10.25C10.25 2.29454 7.95546 0 5.125 0V0.5ZM5.125 3H4.625V5.125H5.125H5.625V3H5.125ZM5.125 5.125L4.77145 5.47855L6.14645 6.85355L6.5 6.5L6.85355 6.14645L5.47855 4.77145L5.125 5.125Z" />
|
|
20
|
+
</svg>
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
if (withAccessibility) {
|
|
24
|
+
return <AccessibleIcon label="Clock icon">{svg}</AccessibleIcon>
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return svg
|
|
28
|
+
}
|