@deepgram/styles 0.0.1 → 0.0.4

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/README.md CHANGED
@@ -19,13 +19,13 @@ yarn add @deepgram/styles
19
19
  Import the pre-built, minified CSS in your application:
20
20
 
21
21
  ```javascript
22
- import '@deepgram/styles';
22
+ import "@deepgram/styles";
23
23
  ```
24
24
 
25
25
  Or in HTML:
26
26
 
27
27
  ```html
28
- <link rel="stylesheet" href="node_modules/@deepgram/styles/dist/deepgram.css">
28
+ <link rel="stylesheet" href="node_modules/@deepgram/styles/dist/deepgram.css" />
29
29
  ```
30
30
 
31
31
  ### Expanded CSS (Non-minified)
@@ -33,7 +33,7 @@ Or in HTML:
33
33
  For development or easier debugging:
34
34
 
35
35
  ```javascript
36
- import '@deepgram/styles/expanded';
36
+ import "@deepgram/styles/expanded";
37
37
  ```
38
38
 
39
39
  ### Using with Tailwind CSS
@@ -42,12 +42,12 @@ If you're using Tailwind CSS in your project, you can extend your configuration
42
42
 
43
43
  ```javascript
44
44
  // tailwind.config.js
45
- const deepgramConfig = require('@deepgram/styles/tailwind-config');
45
+ const deepgramConfig = require("@deepgram/styles/tailwind-config");
46
46
 
47
47
  module.exports = {
48
48
  presets: [deepgramConfig],
49
49
  content: [
50
- './src/**/*.{html,js,ts,jsx,tsx}',
50
+ "./src/**/*.{html,js,ts,jsx,tsx}",
51
51
  // your content paths
52
52
  ],
53
53
  // your customizations
@@ -59,70 +59,475 @@ module.exports = {
59
59
  To customize and build the styles yourself:
60
60
 
61
61
  ```css
62
- @import '@deepgram/styles/source';
62
+ @import "@deepgram/styles/source";
63
63
  ```
64
64
 
65
+ ## Configuration
66
+
67
+ ### Base Font Size
68
+
69
+ The entire design system is based on `rem` units, which scale relative to the root font size. By default, the base font size is set to `16px`. You can customize this by setting the CSS variable `--dg-base-font-size` in your application:
70
+
71
+ ```css
72
+ :root {
73
+ --dg-base-font-size: 18px; /* Increase base size to 18px */
74
+ }
75
+ ```
76
+
77
+ Or target a specific element:
78
+
79
+ ```css
80
+ .my-app {
81
+ --dg-base-font-size: 14px; /* Decrease base size to 14px */
82
+ }
83
+ ```
84
+
85
+ This approach allows for:
86
+
87
+ - **Accessibility**: Users can adjust font sizes in their browser, and all components scale proportionally
88
+ - **Responsive Design**: Change the base font size at different breakpoints for better mobile/desktop experiences
89
+ - **Consistency**: All spacing, sizing, and typography scale together
90
+
91
+ Example for responsive font sizing:
92
+
93
+ ```css
94
+ :root {
95
+ --dg-base-font-size: 14px; /* Smaller on mobile */
96
+ }
97
+
98
+ @media (min-width: 768px) {
99
+ :root {
100
+ --dg-base-font-size: 16px; /* Standard on desktop */
101
+ }
102
+ }
103
+ ```
104
+
105
+ **Note**: The CSS variable defines the base font size, but all measurements internally use `rem` units, ensuring everything scales proportionally when you change this value.
106
+
107
+ ### Brand Colors
108
+
109
+ The design system uses two primary brand colors that can be customized by setting CSS variables `--dg-primary` and `--dg-secondary` in your application. The gradient borders and glow effects automatically derive from these colors, so you only need to set two variables:
110
+
111
+ ```css
112
+ :root {
113
+ --dg-primary: #ff6b35; /* Custom orange */
114
+ --dg-secondary: #4ecdc4; /* Custom teal */
115
+ }
116
+ ```
117
+
118
+ Or target a specific element:
119
+
120
+ ```css
121
+ .my-custom-section {
122
+ --dg-primary: #9b59b6; /* Custom purple */
123
+ --dg-secondary: #3498db; /* Custom blue */
124
+ }
125
+ ```
126
+
127
+ This allows you to:
128
+
129
+ - **Brand Consistency**: Easily apply your brand colors across all Deepgram components
130
+ - **Theme Variations**: Create different themes or color schemes for different sections
131
+ - **Quick Customization**: Override brand colors without rebuilding or forking the library
132
+ - **Automatic Gradients**: Gradient borders and glow effects automatically use your custom colors
133
+
134
+ Example for multiple themes:
135
+
136
+ ```css
137
+ /* Default Deepgram theme */
138
+ :root {
139
+ --dg-primary: #13ef95; /* Deepgram green */
140
+ --dg-secondary: #149afb; /* Deepgram blue */
141
+ }
142
+
143
+ /* Purple theme - gradient will be blue to purple */
144
+ .theme-purple {
145
+ --dg-primary: #a855f7; /* Purple */
146
+ --dg-secondary: #ec4899; /* Pink */
147
+ }
148
+
149
+ /* Ocean theme - gradient will be teal to cyan */
150
+ .theme-ocean {
151
+ --dg-primary: #16a085; /* Teal */
152
+ --dg-secondary: #3498db; /* Ocean Blue */
153
+ }
154
+
155
+ /* Sunset theme - gradient will be orange to golden */
156
+ .theme-sunset {
157
+ --dg-primary: #ff6b35; /* Orange */
158
+ --dg-secondary: #f7931e; /* Golden */
159
+ }
160
+ ```
161
+
162
+ **Note**: These colors are used throughout the component library for buttons, links, highlights, gradient borders (secondary → primary), glow effects, and other interactive elements. The primary button's gradient border animates from `--dg-secondary` to `--dg-primary`, creating a cohesive brand experience.
163
+
65
164
  ## Available Components
66
165
 
67
- The library provides a comprehensive set of Tailwind-based components:
166
+ The library provides a comprehensive set of Tailwind-based components following BEM methodology:
167
+
168
+ ### Buttons
169
+
170
+ - `.dg-btn` - Base button component
171
+ - `.dg-btn--primary` - Primary action button with gradient border
172
+ - `.dg-btn--secondary` - Secondary action button
173
+ - `.dg-btn--ghost` - Transparent button with border
174
+ - `.dg-btn--danger-ghost` - Destructive action button
175
+ - `.dg-btn--icon-only` - Icon-only button
176
+ - `.dg-btn--sm` - Small button variant
177
+ - `.dg-btn--collapse` - Responsive mobile-adaptive button
178
+
179
+ ### Cards
180
+
181
+ - `.dg-card` - Flexible card container
182
+ - `.dg-card--compact` - Card with reduced padding
183
+ - `.dg-card--spacious` - Card with increased padding
184
+ - `.dg-card--bordered` - Card with enhanced border
185
+ - `.dg-card--structured` - Card optimized for image/header/body/footer layout
186
+ - `.dg-card__image` - Card image container
187
+ - `.dg-card__image--small` - Small height (7.5rem)
188
+ - `.dg-card__image--medium` - Medium height (10rem)
189
+ - `.dg-card__image--large` - Large height (15rem)
190
+ - `.dg-card__image--aspect-4-3` - Responsive 4:3 aspect ratio
191
+ - `.dg-card__icon` - Card icon container (for Font Awesome icons)
192
+ - `.dg-card__icon--left` - Left-aligned icon (default)
193
+ - `.dg-card__icon--center` - Center-aligned icon
194
+ - `.dg-card__icon--right` - Right-aligned icon
195
+ - `.dg-card__header` - Card header section
196
+ - `.dg-card__body` - Card body content section
197
+ - `.dg-card__footer` - Card footer actions section
198
+ - `.dg-card__footer--bordered` - Footer with top border
68
199
 
69
200
  ### Layout
70
- - `.dg-app-header` - Application header with navigation
71
- - `.dg-hero` - Hero section for main content
72
- - `.dg-two-column-layout` - Responsive two-column grid
73
- - `.dg-container` - Centered content container
74
- - `.dg-grid-{2,3,4}` - Responsive grid layouts
75
-
76
- ### Components
77
- - `.dg-panel` - Content panel with border
78
- - `.dg-panel-elevated` - Panel with shadow
79
- - `.dg-card` - Interactive card component
80
- - `.dg-selection-list` - Vertical selection list
81
- - `.dg-selection-item` - Selectable list item
82
- - `.dg-drop-zone` - File drop zone
83
- - `.dg-result-display` - Content display area
84
201
 
85
- ### Buttons
86
- - `.dg-button-primary` - Primary action button
87
- - `.dg-button-secondary` - Secondary action button
88
- - `.dg-button-outline` - Outline button
202
+ - `.dg-section` - Reusable content section
203
+ - `.dg-section--compact` - Section with reduced spacing
204
+ - `.dg-section--spacious` - Section with increased spacing
205
+ - `.dg-section--bordered` - Section with border and background
206
+ - `.dg-section--elevated` - Section with shadow
207
+ - `.dg-section--fieldset` - Fieldset-style section with legend
208
+ - `.dg-constrain-width` - Constrained width container (60rem max)
209
+ - `.dg-center-h` - Center content horizontally
210
+ - `.dg-grid-mobile-stack` - Responsive grid that stacks on mobile
211
+ - `.dg-action-group` - Action button group
212
+
213
+ #### Multi-Column Layouts
214
+
215
+ - `.dg-layout-three-column` - Full-height three-column layout with header
216
+ - `.dg-layout-three-column__header` - Fixed header section with dark theme
217
+ - `.dg-layout-three-column__header-container` - Header inner container (max-width constrained)
218
+ - `.dg-layout-three-column__header-logo` - Logo image in header
219
+ - `.dg-layout-three-column__header-actions` - Header action buttons container
220
+ - `.dg-layout-three-column__header-button` - Icon button in header
221
+ - `.dg-layout-three-column__header-profile` - Profile link wrapper
222
+ - `.dg-layout-three-column__header-avatar` - Profile avatar image
223
+ - `.dg-layout-three-column__main` - Main three-column container
224
+ - `.dg-layout-three-column__left-main-wrapper` - Wrapper for left sidebar and main content
225
+ - `.dg-layout-three-column__sidebar-left` - Left sidebar (256px on xl screens)
226
+ - `.dg-layout-three-column__content` - Main content area (flexible width)
227
+ - `.dg-layout-three-column__sidebar-right` - Right sidebar (384px on lg+ screens)
228
+
229
+ ### Hero & Typography
230
+
231
+ - `.dg-hero` - Hero section container
232
+ - `.dg-hero__content` - Hero content wrapper
233
+ - `.dg-hero__announcement` - Hero announcement banner
234
+ - `.dg-hero__body` - Hero body text
235
+ - `.dg-hero__actions` - Hero action buttons
236
+ - `.dg-hero-title` - Large gradient hero title
237
+ - `.dg-section-heading` - Section heading
238
+ - `.dg-card-heading` - Card heading
239
+ - `.dg-item-title` - Item title
240
+ - `.dg-prose` - Prose text with typography
241
+ - `.dg-prose--large` - Larger prose text
242
+ - `.dg-prose--small` - Smaller prose text
243
+ - `.dg-prose--block` - Full width prose
89
244
 
90
245
  ### Forms
91
- - `.dg-input` - Text input field
92
- - `.dg-textarea` - Multi-line text area
93
- - `.dg-select` - Select dropdown
94
- - `.dg-checkbox` - Checkbox input
246
+
247
+ - `.dg-input` - Base text input field
248
+ - Focus state with primary color border
249
+ - Disabled state with reduced opacity
250
+ - `.dg-input--inline` - Input with minimum width (12.5rem) for inline forms
251
+ - `.dg-input--full` - Override for specific width control
252
+ - `.dg-textarea` - Multi-line text input
253
+ - `.dg-checkbox` - Custom styled checkbox
254
+ - Animated checkmark on selection
255
+ - Focus state for keyboard navigation
256
+ - `.dg-checkbox-label` - Checkbox label wrapper
257
+ - Hover states for better UX
258
+ - Supports inline links
259
+ - `.dg-checkbox-description` - Container for checkbox with description text
260
+ - `.dg-checkbox-group` - Container for multiple checkboxes
261
+ - `.dg-form-field` - Form field container (label + input + helper)
262
+ - Full width on mobile, max-w-md (28rem) on desktop
263
+ - `.dg-form-field--full` - Override to make form field full width on all screens
264
+ - `.dg-form-field--error` - Error validation state (cascades to children)
265
+ - `.dg-form-field--success` - Success validation state (cascades to children)
266
+ - `.dg-form-label` - Form field label
267
+ - `.dg-form-helper` - Helper or validation message text
268
+ - `.dg-form-error` - **Deprecated:** Use `.dg-form-helper` with `.dg-form-field--error` instead
269
+ - `.dg-drag-drop-zone` - File upload drag-and-drop area
270
+ - Dashed border indicator
271
+ - Hover and drag-over states
272
+ - Icon, text, and hint sections
273
+
274
+ ### Code & Status
275
+
276
+ - `.dg-code-block` - Code block container
277
+ - `.dg-code-block--compact` - Compact code block
278
+ - `.dg-code-block--tall` - Tall code block
279
+ - `.dg-code-block--no-scroll` - Code block without scrolling
280
+ - `.dg-status` - Status message
281
+ - `.dg-status--info` - Info status
282
+ - `.dg-status--success` - Success status
283
+ - `.dg-status--warning` - Warning status
284
+ - `.dg-status--error` - Error status
285
+ - `.dg-status--primary` - Primary status
286
+ - `.dg-status--secondary` - Secondary status
287
+ - `.dg-spinner` - Loading spinner animation
288
+ - `.dg-modal-overlay` - Modal overlay backdrop
289
+ - `.dg-modal-content` - Modal content container
290
+
291
+ ### Newsletter Components
292
+
293
+ - `.dg-newsletter-container` - Newsletter container with standard spacing
294
+ - `.dg-newsletter-container--compact` - Newsletter container with compact spacing
295
+ - `.dg-newsletter-form` - Newsletter form with standard spacing
296
+ - `.dg-newsletter-form--compact` - Newsletter form with compact spacing
297
+ - `.dg-newsletter-form--inline` - Inline newsletter form (responsive)
298
+ - `.dg-newsletter-header` - Newsletter header section (responsive flex layout)
299
+ - `.dg-newsletter-header__content` - Newsletter header content area
300
+ - `.dg-newsletter-header__actions` - Newsletter header actions area
301
+ - `.dg-logo-container` - Centered logo container
302
+ - `.dg-logo` - Logo image styling
303
+ - `.dg-social-links` - Social links container
304
+ - `.dg-social-link` - Individual social link with hover effect
305
+
306
+ ### Typography Utilities
307
+
308
+ - `.dg-text-tagline` - Centered tagline text (small, muted)
309
+ - `.dg-text-subtitle` - Subtitle text (small, muted)
310
+ - `.dg-text-heading` - Standard heading text
311
+ - `.dg-text-heading--with-margin` - Heading with bottom margin
312
+ - `.dg-text-legal` - Legal/fine print text (small, centered)
313
+
314
+ ### Links
315
+
316
+ - `.dg-link` - Primary link with opacity hover effect
95
317
 
96
318
  ### Utilities
97
- - `.dg-badge-{success,warning,error,info}` - Status badges
98
- - `.dg-spinner` - Loading spinner
99
- - `.dg-divider` - Section divider
100
- - `.text-gradient` - Text with gradient effect
101
- - `.scrollbar-thin` - Thin scrollbar styling
102
319
 
103
- ## Theme Colors
320
+ - `.dg-footer` - Page footer
321
+ - `.dg-text-center` - Center text alignment
322
+ - `.dg-text-danger` - Danger/error text color
323
+ - `.dg-text-success` - Success text color
324
+ - `.dg-text-warning` - Warning text color
325
+ - `.dg-text-primary` - Primary brand color text
326
+ - `.dg-text-secondary` - Secondary brand color text
327
+ - `.dg-text-muted` - Muted text color
328
+ - `.dg-text-fog` - Fog (light gray) text color
329
+ - `.dg-text-white` - White text color
104
330
 
105
- The library includes Deepgram brand colors:
331
+ ## Component Examples
106
332
 
107
- - **Primary**: Spring Green (#13ef93)
108
- - **Accent**: Lavender Blue (#5c68d4)
109
- - **Dark Mode**: Professional dark theme
110
- - **Light Mode**: Clean light theme (toggle with `.light-mode` class on body)
333
+ ### Structured Card with Image
111
334
 
112
- ## Dark/Light Mode
335
+ ```html
336
+ <div class="dg-card dg-card--structured">
337
+ <div class="dg-card__image dg-card__image--medium">
338
+ <img src="image.jpg" alt="Description" />
339
+ </div>
340
+ <div class="dg-card__header">
341
+ <h3 class="dg-card-heading">Card Title</h3>
342
+ </div>
343
+ <div class="dg-card__body">
344
+ <p class="dg-prose">Card body content goes here.</p>
345
+ </div>
346
+ <div class="dg-card__footer">
347
+ <button class="dg-btn dg-btn--primary">Action</button>
348
+ </div>
349
+ </div>
350
+ ```
113
351
 
114
- Dark mode is the default. To enable light mode:
352
+ ### Structured Card with Icon
115
353
 
116
- ```javascript
117
- document.body.classList.add('light-mode');
354
+ ```html
355
+ <div class="dg-card dg-card--structured">
356
+ <div class="dg-card__icon dg-card__icon--left">
357
+ <i class="fas fa-rocket"></i>
358
+ </div>
359
+ <div class="dg-card__header">
360
+ <h3 class="dg-card-heading">Feature Title</h3>
361
+ </div>
362
+ <div class="dg-card__body">
363
+ <p class="dg-prose">Feature description goes here.</p>
364
+ </div>
365
+ <div class="dg-card__footer">
366
+ <button class="dg-btn dg-btn--primary">Learn More</button>
367
+ </div>
368
+ </div>
118
369
  ```
119
370
 
120
- To toggle:
371
+ Icon alignment options: `--left` (default), `--center`, `--right`
121
372
 
122
- ```javascript
123
- document.body.classList.toggle('light-mode');
373
+ ### Button Group
374
+
375
+ ```html
376
+ <div class="dg-action-group">
377
+ <button class="dg-btn dg-btn--ghost">Cancel</button>
378
+ <button class="dg-btn dg-btn--primary">Confirm</button>
379
+ </div>
124
380
  ```
125
381
 
382
+ ### Hero Section
383
+
384
+ ```html
385
+ <section class="dg-hero">
386
+ <div class="dg-hero__content">
387
+ <h1 class="dg-hero-title">Your Hero Title</h1>
388
+ <p class="dg-hero__body">Your hero description text.</p>
389
+ <div class="dg-hero__actions">
390
+ <button class="dg-btn dg-btn--primary">Get Started</button>
391
+ <button class="dg-btn dg-btn--ghost">Learn More</button>
392
+ </div>
393
+ </div>
394
+ </section>
395
+ ```
396
+
397
+ ### Form Input with Label
398
+
399
+ ```html
400
+ <div class="dg-form-field">
401
+ <label for="email" class="dg-form-label">Email Address</label>
402
+ <input type="email" id="email" name="email" placeholder="you@example.com" class="dg-input" />
403
+ <p class="dg-form-helper">We'll never share your email.</p>
404
+ </div>
405
+ ```
406
+
407
+ ### Form Input with Error
408
+
409
+ ```html
410
+ <div class="dg-form-field dg-form-field--error">
411
+ <label for="email" class="dg-form-label">Email Address</label>
412
+ <input type="email" id="email" name="email" placeholder="you@example.com" class="dg-input" />
413
+ <p class="dg-form-helper">Please enter a valid email address.</p>
414
+ </div>
415
+ ```
416
+
417
+ ### Form Input with Success
418
+
419
+ ```html
420
+ <div class="dg-form-field dg-form-field--success">
421
+ <label for="email" class="dg-form-label">Email Address</label>
422
+ <input type="email" id="email" name="email" value="user@example.com" class="dg-input" />
423
+ <p class="dg-form-helper">Email address is valid.</p>
424
+ </div>
425
+ ```
426
+
427
+ ### Checkbox
428
+
429
+ ```html
430
+ <label class="dg-checkbox-label">
431
+ <input type="checkbox" name="agree" class="dg-checkbox" />
432
+ <span>I agree to the terms and conditions</span>
433
+ </label>
434
+ ```
435
+
436
+ ### Checkbox with Link
437
+
438
+ ```html
439
+ <label class="dg-checkbox-label">
440
+ <input type="checkbox" name="privacy" class="dg-checkbox" />
441
+ <span>I've read the <a href="/privacy" class="dg-link">Privacy Policy</a></span>
442
+ </label>
443
+ ```
444
+
445
+ ### Checkbox with Description
446
+
447
+ ```html
448
+ <label class="dg-checkbox-label">
449
+ <input type="checkbox" name="notifications" class="dg-checkbox" />
450
+ <div class="dg-checkbox-description">
451
+ <span>Enable email notifications</span>
452
+ <span class="dg-form-helper">Get notified about updates and announcements</span>
453
+ </div>
454
+ </label>
455
+ ```
456
+
457
+ ### Newsletter Signup Form
458
+
459
+ ```html
460
+ <section class="dg-section dg-section--bordered">
461
+ <div class="dg-newsletter-container--compact">
462
+ <h3 class="dg-text-heading">Subscribe to our newsletter</h3>
463
+ <p class="dg-text-subtitle">Get the latest news and updates delivered to your inbox.</p>
464
+ <form class="dg-newsletter-form--compact">
465
+ <input type="email" placeholder="Enter your email" required class="dg-input" name="email" />
466
+ <button type="submit" class="dg-btn dg-btn--primary">Subscribe</button>
467
+ </form>
468
+ </div>
469
+ </section>
470
+ ```
471
+
472
+ ### File Upload Zone
473
+
474
+ ```html
475
+ <div class="dg-drag-drop-zone">
476
+ <input type="file" id="file-upload" name="file" class="dg-drag-drop-zone__input" />
477
+ <div class="dg-drag-drop-zone__icon fas fa-upload"></div>
478
+ <div class="dg-drag-drop-zone__text">Drop file here or click to browse</div>
479
+ <div class="dg-drag-drop-zone__hint">MP3, WAV, M4A up to 500MB</div>
480
+ </div>
481
+ ```
482
+
483
+ ### Three-Column Layout
484
+
485
+ ```html
486
+ <div class="dg-layout-three-column">
487
+ <header class="dg-layout-three-column__header">
488
+ <div class="dg-layout-three-column__header-container">
489
+ <img src="logo.svg" alt="Company" class="dg-layout-three-column__header-logo" />
490
+ <div class="dg-layout-three-column__header-actions">
491
+ <button type="button" class="dg-layout-three-column__header-button">
492
+ <span class="dg-sr-only">Notifications</span>
493
+ <!-- Icon SVG -->
494
+ </button>
495
+ <a href="#" class="dg-layout-three-column__header-profile">
496
+ <span class="dg-sr-only">Profile</span>
497
+ <img src="avatar.jpg" alt="" class="dg-layout-three-column__header-avatar" />
498
+ </a>
499
+ </div>
500
+ </div>
501
+ </header>
502
+
503
+ <div class="dg-layout-three-column__main">
504
+ <div class="dg-layout-three-column__left-main-wrapper">
505
+ <div class="dg-layout-three-column__sidebar-left">
506
+ <!-- Left sidebar content (navigation, filters, etc.) -->
507
+ </div>
508
+ <div class="dg-layout-three-column__content">
509
+ <!-- Main content area -->
510
+ </div>
511
+ </div>
512
+ <div class="dg-layout-three-column__sidebar-right">
513
+ <!-- Right sidebar content (notifications, info, etc.) -->
514
+ </div>
515
+ </div>
516
+ </div>
517
+ ```
518
+
519
+ ## Theme Colors
520
+
521
+ The library includes Deepgram brand colors:
522
+
523
+ - **Primary**: Spring Green (#13ef93)
524
+ - **Secondary**: Blue (#149afb)
525
+ - **Success**: Green (#12b76a)
526
+ - **Warning**: Yellow (#fec84b)
527
+ - **Danger**: Red (#f04438)
528
+ - **Dark Background**: Charcoal (#1a1a1f)
529
+ - **Borders**: Pebble (#4e4e52)
530
+
126
531
  ## Responsive Design
127
532
 
128
533
  All components are mobile-first and responsive:
@@ -144,4 +549,3 @@ MIT
144
549
  ## Contributing
145
550
 
146
551
  See the [main repository](https://github.com/deepgram/starter-uis) for contribution guidelines.
147
-