@frequencyads/components 0.1.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/llms.txt ADDED
@@ -0,0 +1,182 @@
1
+ # @frequencyads/components
2
+
3
+ Mantine-based UI component library for Frequency products. Import from `@frequencyads/components`.
4
+ Requires `@frequencyads/brand/mantine` theme via `<MantineProvider theme={frequencyTheme}>`.
5
+
6
+ ## When to use these components
7
+
8
+ ALWAYS prefer these over inline styles, Tailwind, or raw HTML. If a component exists here, use it.
9
+ For anything not listed, use Mantine primitives (Paper, Card, SimpleGrid, Table, Group, Stack, Text, Title, Button, ActionIcon, etc.) — never raw HTML with Tailwind classes.
10
+
11
+ ## Components
12
+
13
+ ### AnimatedCounter
14
+ Scroll-triggered animated number counter. Counts from 0 to target with easing. Auto-formats large numbers with K suffix.
15
+ ```tsx
16
+ import { AnimatedCounter } from '@frequencyads/components';
17
+ <AnimatedCounter value={2500} suffix="+" size="xl" fw={700} />
18
+ <AnimatedCounter value={98.7} suffix="%" decimals={1} duration={3000} />
19
+ <AnimatedCounter value={1250000} prefix="$" abbreviate />
20
+ ```
21
+ Props: value, suffix, prefix, duration (ms), threshold (0-1), abbreviate (K suffix for 1000+), decimals, plus all Mantine TextProps
22
+
23
+ ### ExpandableCard
24
+ Auto-expanding card that reveals more content when scrolled into view. Framer Motion animations with icon badge.
25
+ ```tsx
26
+ import { ExpandableCard } from '@frequencyads/components';
27
+ <ExpandableCard title="Show Management" description="Manage your catalog." expandedContent="Full details here..." icon={IconRadio} color="blue" />
28
+ ```
29
+ Props: title, description, expandedContent (string|ReactNode), icon, color (MantineColor), iconSize, collapsedHeight (px), threshold, delay (ms), expanded (controlled), onExpandedChange
30
+
31
+ ### SplitSection
32
+ Two-column marketing section with heading area (45%) and content area (55%). Supports two-tone titles, badges, CTAs, sticky heading, and reversed layout. Stacks on mobile.
33
+ ```tsx
34
+ import { SplitSection } from '@frequencyads/components';
35
+ <SplitSection preTitle="Complex Campaigns." title="Simplified" titleColor="blue" description="Automate your workflow." stickyHeading>
36
+ <Stack gap="md">{/* cards, grids, etc. */}</Stack>
37
+ </SplitSection>
38
+ <SplitSection badge="New" subtitle="Premium Publisher Network" preTitle="Where Premium Meets" title="Performance" titleColor="violet" actions={<Button>Learn more</Button>}>
39
+ <SimpleGrid cols={2}>{/* feature cards */}</SimpleGrid>
40
+ </SplitSection>
41
+ ```
42
+ Props: badge, badgeColor, subtitle, preTitle, title, titleColor, description, actions (ReactNode), heading (ReactNode — overrides structured props), children, stickyHeading, py, reversed, id, className
43
+
44
+ ### Hero
45
+ Full-screen hero section with logo or gradient text variant, optional video background and waveform.
46
+ ```tsx
47
+ import { Hero } from '@frequencyads/components';
48
+ <Hero variant="logo" tagline="Audio teams use Frequency to work faster." />
49
+ <Hero variant="text" heading="Frequency" gradient="frequencyAlive" shimmer />
50
+ ```
51
+ Props: variant ("logo"|"text"), heading, tagline, logoSrc, gradient (GradientName), shimmer, primaryAction ({label,href}), secondaryAction, backgroundVideoSrc, showWaveform
52
+
53
+ ### AudioPlayer
54
+ Full audio player with play/pause, time display, waveform visualization, volume slider, and download button.
55
+ ```tsx
56
+ import { AudioPlayer } from '@frequencyads/components';
57
+ <AudioPlayer src="/audio/demo.mp3" filename="demo.mp3" />
58
+ ```
59
+ Props: src, filename, playButtonColor, playButtonSize, waveColor, progressColor, waveHeight, barWidth, barGap, showVolume, showDownload
60
+
61
+ ### MiniAudioPlayer
62
+ Compact inline audio player with play button and mini waveform. Three sizes.
63
+ ```tsx
64
+ import { MiniAudioPlayer } from '@frequencyads/components';
65
+ <MiniAudioPlayer audioUrl="/audio/clip.mp3" size="compact" />
66
+ ```
67
+ Props: audioUrl, size ("mini"|"small"|"compact"), waveColor, progressColor, onPlay, onPause
68
+
69
+ ### AudioWaveform
70
+ Standalone mock waveform visualization with seek support. Used internally by AudioPlayer and MiniAudioPlayer.
71
+ ```tsx
72
+ import { AudioWaveform } from '@frequencyads/components';
73
+ <AudioWaveform audioRef={audioRef} onSeek={handleSeek} height={60} />
74
+ ```
75
+ Props: audioRef, currentTime, onSeek, loading, waveColor, progressColor, height, barWidth, barGap
76
+
77
+ ### SpeedDial
78
+ Floating action button that expands to show multiple actions. Like MUI SpeedDial but built with Mantine.
79
+ ```tsx
80
+ import { SpeedDial } from '@frequencyads/components';
81
+ <SpeedDial actions={[{ icon: <IconCopy size={18} />, label: "Copy", onClick: handleCopy }]} direction="up" />
82
+ ```
83
+ Props: actions ({icon,label,onClick}[]), icon, openIcon, direction ("up"|"down"|"left"|"right"), color, size, open, onOpenChange
84
+
85
+ ### PrincipleCard
86
+ Accent-bordered card for displaying design principles, values, or guidelines with optional do/don't hints.
87
+ ```tsx
88
+ import { PrincipleCard } from '@frequencyads/components';
89
+ <PrincipleCard accentColor="#169BDE" title="Clarity Over Complexity" description="Every element should serve a purpose." doHint="Clean layouts" dontHint="Visual clutter" />
90
+ ```
91
+ Props: accentColor, title, description, doHint, dontHint
92
+
93
+ ### DosDonts
94
+ Side-by-side Do/Don't comparison cards with green/red coloring and check/X icons.
95
+ ```tsx
96
+ import { DosDonts } from '@frequencyads/components';
97
+ <DosDonts items={[{ do: "Create better audio ads, faster.", dont: "Leverage our cutting-edge solution..." }]} />
98
+ ```
99
+ Props: items ({do,dont}[])
100
+
101
+ ### HintBadge
102
+ Green "Do" or red "Don't" pill badge. Used inside PrincipleCard but available standalone.
103
+ ```tsx
104
+ import { HintBadge } from '@frequencyads/components';
105
+ <HintBadge variant="do">Clean layouts</HintBadge>
106
+ <HintBadge variant="dont">Visual clutter</HintBadge>
107
+ ```
108
+ Props: variant ("do"|"dont"), children
109
+
110
+ ### ColorSwatch
111
+ Color preview card with hex label and click-to-copy.
112
+ ```tsx
113
+ import { ColorSwatch } from '@frequencyads/components';
114
+ <ColorSwatch name="Blue" hex="#169BDE" label="Primary" />
115
+ ```
116
+ Props: name, hex, label
117
+
118
+ ### ColorPalette
119
+ 10-shade color grid for a single color scale. Click any shade to copy hex.
120
+ ```tsx
121
+ import { ColorPalette } from '@frequencyads/components';
122
+ import { blue } from '@frequencyads/brand/colors';
123
+ <ColorPalette name="blue" shades={[...blue]} mainIndex={5} />
124
+ ```
125
+ Props: name, shades (string[]), mainIndex
126
+
127
+ ### GradientSwatch
128
+ Gradient preview card with CSS string copy.
129
+ ```tsx
130
+ import { GradientSwatch } from '@frequencyads/components';
131
+ import { gradients } from '@frequencyads/brand/colors';
132
+ <GradientSwatch name="Frequency Alive" colors={[gradients.frequencyAlive.from, gradients.frequencyAlive.to]} description="Primary brand gradient" />
133
+ ```
134
+ Props: name, colors ([from,to]), description
135
+
136
+ ### CodeBlock
137
+ Code viewer with filename label and copy button. For displaying code snippets.
138
+ ```tsx
139
+ import { CodeBlock } from '@frequencyads/components';
140
+ <CodeBlock filename="install.sh" code="npm install @frequencyads/brand" height={60} />
141
+ ```
142
+ Props: filename, code, height
143
+
144
+ ### Copyable
145
+ Click-to-copy wrapper. Shows toast notification on copy. Wrap any element.
146
+ ```tsx
147
+ import { Copyable } from '@frequencyads/components';
148
+ <Copyable value="#169BDE"><span>Click me to copy</span></Copyable>
149
+ ```
150
+ Props: value, children
151
+
152
+ ### FadeInSection
153
+ Scroll-triggered fade-in animation wrapper using IntersectionObserver.
154
+ ```tsx
155
+ import { FadeInSection } from '@frequencyads/components';
156
+ <FadeInSection delay={200}><Card>...</Card></FadeInSection>
157
+ ```
158
+ Props: children, delay (ms), threshold (0-1), plus all Mantine BoxProps
159
+
160
+ ### AnimatedWaveform
161
+ SVG waveform with animated gradient bars (Framer Motion). Used as decoration in Hero.
162
+ ```tsx
163
+ import { AnimatedWaveform } from '@frequencyads/components';
164
+ <AnimatedWaveform barCount={140} duration={3} repeatDelay={3} />
165
+ ```
166
+ Props: barCount, duration, repeatDelay
167
+
168
+ ### FrequencyWave
169
+ Canvas-based animated wave decoration with idle/active/pulsing states. Brand gradient colors.
170
+ ```tsx
171
+ import { FrequencyWave } from '@frequencyads/components';
172
+ <FrequencyWave isActive={false} height={60} />
173
+ ```
174
+ Props: isActive, height
175
+
176
+ ### VideoBackground
177
+ Full-bleed video background element. Used internally by Hero.
178
+ ```tsx
179
+ import { VideoBackground } from '@frequencyads/components';
180
+ <VideoBackground src="/video/bg.mp4" opacity={0.3} />
181
+ ```
182
+ Props: src, opacity
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@frequencyads/components",
3
+ "version": "0.1.0",
4
+ "description": "Shared Mantine UI components for Frequency apps",
5
+ "license": "MIT",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.mjs",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.mjs",
13
+ "require": "./dist/index.js"
14
+ }
15
+ },
16
+ "scripts": {
17
+ "build": "tsup src/index.ts --format cjs,esm --dts",
18
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
19
+ "lint": "eslint .",
20
+ "type-check": "tsc --noEmit"
21
+ },
22
+ "peerDependencies": {
23
+ "@mantine/core": "^7",
24
+ "@mantine/hooks": "^7",
25
+ "react": "^19",
26
+ "react-dom": "^19"
27
+ },
28
+ "dependencies": {
29
+ "@frequencyads/brand": "^1.1.0",
30
+ "@tabler/icons-react": "^3",
31
+ "framer-motion": "^11"
32
+ },
33
+ "devDependencies": {
34
+ "@frequencyads/eslint-config": "^0.1.0",
35
+ "@frequencyads/tsconfig": "^0.1.0",
36
+ "@mantine/core": "^7",
37
+ "@mantine/hooks": "^7",
38
+ "@types/react": "^19",
39
+ "postcss-preset-mantine": "^1",
40
+ "postcss-simple-vars": "^7",
41
+ "tsup": "^8",
42
+ "typescript": "^5"
43
+ },
44
+ "files": [
45
+ "dist",
46
+ "llms.txt"
47
+ ],
48
+ "publishConfig": {
49
+ "access": "public"
50
+ }
51
+ }