@deepgram/styles 0.2.11 → 0.2.13
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 +285 -317
- package/design-system.yaml +3115 -3336
- package/dist/deepgram.css +1 -1
- package/dist/deepgram.expanded.css +741 -880
- package/dist/react/ActionGroup.d.ts +4 -0
- package/dist/react/ActionGroup.js +9 -0
- package/dist/react/Alert.d.ts +34 -0
- package/dist/react/Alert.js +71 -0
- package/dist/react/Btn.d.ts +11 -0
- package/dist/react/Btn.js +16 -0
- package/dist/react/Card.d.ts +26 -0
- package/dist/react/Card.js +51 -0
- package/dist/react/CardHeading.d.ts +4 -0
- package/dist/react/CardHeading.js +9 -0
- package/dist/react/CardHeadings.d.ts +7 -0
- package/dist/react/CardHeadings.js +16 -0
- package/dist/react/Checkbox.d.ts +4 -0
- package/dist/react/Checkbox.js +9 -0
- package/dist/react/CheckboxDescription.d.ts +4 -0
- package/dist/react/CheckboxDescription.js +9 -0
- package/dist/react/CheckboxGroup.d.ts +4 -0
- package/dist/react/CheckboxGroup.js +9 -0
- package/dist/react/CheckboxLabel.d.ts +4 -0
- package/dist/react/CheckboxLabel.js +9 -0
- package/dist/react/CodeBlock.d.ts +7 -0
- package/dist/react/CodeBlock.js +12 -0
- package/dist/react/Columns.d.ts +25 -0
- package/dist/react/Columns.js +44 -0
- package/dist/react/ConstrainWidth.d.ts +4 -0
- package/dist/react/ConstrainWidth.js +9 -0
- package/dist/react/DragDropZone.d.ts +17 -0
- package/dist/react/DragDropZone.js +38 -0
- package/dist/react/Footer.d.ts +10 -0
- package/dist/react/Footer.js +23 -0
- package/dist/react/FormError.d.ts +4 -0
- package/dist/react/FormError.js +9 -0
- package/dist/react/FormField.d.ts +4 -0
- package/dist/react/FormField.js +9 -0
- package/dist/react/FormHelper.d.ts +4 -0
- package/dist/react/FormHelper.js +9 -0
- package/dist/react/FormLabel.d.ts +4 -0
- package/dist/react/FormLabel.js +9 -0
- package/dist/react/GridMobileStack.d.ts +4 -0
- package/dist/react/GridMobileStack.js +9 -0
- package/dist/react/Hero.d.ts +25 -0
- package/dist/react/Hero.js +58 -0
- package/dist/react/Icon.d.ts +5 -0
- package/dist/react/Icon.js +10 -0
- package/dist/react/Input.d.ts +6 -0
- package/dist/react/Input.js +11 -0
- package/dist/react/ItemTitle.d.ts +4 -0
- package/dist/react/ItemTitle.js +9 -0
- package/dist/react/Newsletter.d.ts +8 -0
- package/dist/react/Newsletter.js +17 -0
- package/dist/react/Option.d.ts +4 -0
- package/dist/react/Option.js +9 -0
- package/dist/react/PageHeading.d.ts +10 -0
- package/dist/react/PageHeading.js +23 -0
- package/dist/react/PageHeadings.d.ts +13 -0
- package/dist/react/PageHeadings.js +30 -0
- package/dist/react/Prose.d.ts +6 -0
- package/dist/react/Prose.js +11 -0
- package/dist/react/Radio.d.ts +4 -0
- package/dist/react/Radio.js +9 -0
- package/dist/react/RadioDescription.d.ts +7 -0
- package/dist/react/RadioDescription.js +16 -0
- package/dist/react/RadioGroup.d.ts +4 -0
- package/dist/react/RadioGroup.js +9 -0
- package/dist/react/RadioLabel.d.ts +4 -0
- package/dist/react/RadioLabel.js +9 -0
- package/dist/react/Section.d.ts +9 -0
- package/dist/react/Section.js +14 -0
- package/dist/react/SectionHeading.d.ts +4 -0
- package/dist/react/SectionHeading.js +9 -0
- package/dist/react/Select.d.ts +4 -0
- package/dist/react/Select.js +9 -0
- package/dist/react/Spinner.d.ts +7 -0
- package/dist/react/Spinner.js +16 -0
- package/dist/react/Status.d.ts +12 -0
- package/dist/react/Status.js +17 -0
- package/dist/react/TextUtilities.d.ts +4 -0
- package/dist/react/TextUtilities.js +9 -0
- package/dist/react/Textarea.d.ts +4 -0
- package/dist/react/Textarea.js +9 -0
- package/dist/react/Toggle.d.ts +4 -0
- package/dist/react/Toggle.js +9 -0
- package/dist/react/ToggleGroup.d.ts +4 -0
- package/dist/react/ToggleGroup.js +9 -0
- package/dist/react/ToggleLabel.d.ts +4 -0
- package/dist/react/ToggleLabel.js +9 -0
- package/dist/react/index.d.ts +43 -0
- package/dist/react/index.js +43 -0
- package/dist/utils.d.ts +16 -0
- package/dist/utils.js +50 -0
- package/lib/deepgram.css +531 -486
- package/lib/tailwind-theme.css +0 -1
- package/package.json +17 -2
- package/src/react/ActionGroup.tsx +14 -0
- package/src/react/Alert.tsx +130 -0
- package/src/react/Btn.tsx +28 -0
- package/src/react/Card.tsx +93 -0
- package/src/react/CardHeading.tsx +14 -0
- package/src/react/CardHeadings.tsx +27 -0
- package/src/react/Checkbox.tsx +14 -0
- package/src/react/CheckboxDescription.tsx +14 -0
- package/src/react/CheckboxGroup.tsx +14 -0
- package/src/react/CheckboxLabel.tsx +14 -0
- package/src/react/CodeBlock.tsx +20 -0
- package/src/react/Columns.tsx +82 -0
- package/src/react/ConstrainWidth.tsx +14 -0
- package/src/react/DragDropZone.tsx +68 -0
- package/src/react/Footer.tsx +40 -0
- package/src/react/FormError.tsx +14 -0
- package/src/react/FormField.tsx +14 -0
- package/src/react/FormHelper.tsx +14 -0
- package/src/react/FormLabel.tsx +14 -0
- package/src/react/GridMobileStack.tsx +14 -0
- package/src/react/Hero.tsx +105 -0
- package/src/react/Icon.tsx +16 -0
- package/src/react/Input.tsx +18 -0
- package/src/react/ItemTitle.tsx +14 -0
- package/src/react/Newsletter.tsx +29 -0
- package/src/react/Option.tsx +14 -0
- package/src/react/PageHeading.tsx +40 -0
- package/src/react/PageHeadings.tsx +53 -0
- package/src/react/Prose.tsx +18 -0
- package/src/react/Radio.tsx +14 -0
- package/src/react/RadioDescription.tsx +27 -0
- package/src/react/RadioGroup.tsx +14 -0
- package/src/react/RadioLabel.tsx +14 -0
- package/src/react/Section.tsx +24 -0
- package/src/react/SectionHeading.tsx +14 -0
- package/src/react/Select.tsx +14 -0
- package/src/react/Spinner.tsx +27 -0
- package/src/react/Status.tsx +30 -0
- package/src/react/TextUtilities.tsx +14 -0
- package/src/react/Textarea.tsx +14 -0
- package/src/react/Toggle.tsx +14 -0
- package/src/react/ToggleGroup.tsx +14 -0
- package/src/react/ToggleLabel.tsx +14 -0
- package/src/react/index.ts +43 -0
- package/src/utils.ts +60 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export { Btn, type BtnProps } from './Btn.js';
|
|
2
|
+
export { ActionGroup, type ActionGroupProps } from './ActionGroup.js';
|
|
3
|
+
export { Section, type SectionProps } from './Section.js';
|
|
4
|
+
export { Card, type CardProps, CardImage, type CardImageProps, CardIcon, type CardIconProps, CardHeader, type CardHeaderProps, CardBody, type CardBodyProps, CardFooter, type CardFooterProps } from './Card.js';
|
|
5
|
+
export { CodeBlock, type CodeBlockProps } from './CodeBlock.js';
|
|
6
|
+
export { Hero, type HeroProps, HeroTitle, type HeroTitleProps, HeroContent, type HeroContentProps, HeroAnnouncement, type HeroAnnouncementProps, HeroAnnouncementText, type HeroAnnouncementTextProps, HeroAnnouncementCta, type HeroAnnouncementCtaProps, HeroBody, type HeroBodyProps, HeroActions, type HeroActionsProps } from './Hero.js';
|
|
7
|
+
export { SectionHeading, type SectionHeadingProps } from './SectionHeading.js';
|
|
8
|
+
export { PageHeading, type PageHeadingProps, PageHeadingTitle, type PageHeadingTitleProps, PageHeadingDescription, type PageHeadingDescriptionProps } from './PageHeading.js';
|
|
9
|
+
export { PageHeadings, type PageHeadingsProps, PageHeadingsTitleWrapper, type PageHeadingsTitleWrapperProps, PageHeadingsTitle, type PageHeadingsTitleProps, PageHeadingsActions, type PageHeadingsActionsProps } from './PageHeadings.js';
|
|
10
|
+
export { CardHeading, type CardHeadingProps } from './CardHeading.js';
|
|
11
|
+
export { CardHeadings, type CardHeadingsProps, CardHeadingsTitle, type CardHeadingsTitleProps } from './CardHeadings.js';
|
|
12
|
+
export { ItemTitle, type ItemTitleProps } from './ItemTitle.js';
|
|
13
|
+
export { Prose, type ProseProps } from './Prose.js';
|
|
14
|
+
export { Icon, type IconProps } from './Icon.js';
|
|
15
|
+
export { Input, type InputProps } from './Input.js';
|
|
16
|
+
export { Textarea, type TextareaProps } from './Textarea.js';
|
|
17
|
+
export { Checkbox, type CheckboxProps } from './Checkbox.js';
|
|
18
|
+
export { Select, type SelectProps } from './Select.js';
|
|
19
|
+
export { Option, type OptionProps } from './Option.js';
|
|
20
|
+
export { Radio, type RadioProps } from './Radio.js';
|
|
21
|
+
export { Toggle, type ToggleProps } from './Toggle.js';
|
|
22
|
+
export { CheckboxLabel, type CheckboxLabelProps } from './CheckboxLabel.js';
|
|
23
|
+
export { CheckboxDescription, type CheckboxDescriptionProps } from './CheckboxDescription.js';
|
|
24
|
+
export { CheckboxGroup, type CheckboxGroupProps } from './CheckboxGroup.js';
|
|
25
|
+
export { RadioLabel, type RadioLabelProps } from './RadioLabel.js';
|
|
26
|
+
export { RadioDescription, type RadioDescriptionProps, RadioDescriptionHint, type RadioDescriptionHintProps } from './RadioDescription.js';
|
|
27
|
+
export { RadioGroup, type RadioGroupProps } from './RadioGroup.js';
|
|
28
|
+
export { ToggleLabel, type ToggleLabelProps } from './ToggleLabel.js';
|
|
29
|
+
export { ToggleGroup, type ToggleGroupProps } from './ToggleGroup.js';
|
|
30
|
+
export { FormLabel, type FormLabelProps } from './FormLabel.js';
|
|
31
|
+
export { FormHelper, type FormHelperProps } from './FormHelper.js';
|
|
32
|
+
export { FormError, type FormErrorProps } from './FormError.js';
|
|
33
|
+
export { FormField, type FormFieldProps } from './FormField.js';
|
|
34
|
+
export { DragDropZone, type DragDropZoneProps, DragDropZoneInput, type DragDropZoneInputProps, DragDropZoneIcon, type DragDropZoneIconProps, DragDropZoneText, type DragDropZoneTextProps, DragDropZoneHint, type DragDropZoneHintProps } from './DragDropZone.js';
|
|
35
|
+
export { Status, type StatusProps } from './Status.js';
|
|
36
|
+
export { Spinner, type SpinnerProps, SpinnerTitle, type SpinnerTitleProps } from './Spinner.js';
|
|
37
|
+
export { ConstrainWidth, type ConstrainWidthProps } from './ConstrainWidth.js';
|
|
38
|
+
export { GridMobileStack, type GridMobileStackProps } from './GridMobileStack.js';
|
|
39
|
+
export { Columns, type ColumnsProps, ColumnsWrapper, type ColumnsWrapperProps, ColumnsMobileHeader, type ColumnsMobileHeaderProps, ColumnsSidebarToggle, type ColumnsSidebarToggleProps, ColumnsColumn, type ColumnsColumnProps } from './Columns.js';
|
|
40
|
+
export { Footer, type FooterProps, FooterSocialLinks, type FooterSocialLinksProps, FooterSocialLink, type FooterSocialLinkProps } from './Footer.js';
|
|
41
|
+
export { TextUtilities, type TextUtilitiesProps } from './TextUtilities.js';
|
|
42
|
+
export { Newsletter, type NewsletterProps, NewsletterForm, type NewsletterFormProps } from './Newsletter.js';
|
|
43
|
+
export { Alert, type AlertProps, AlertContent, type AlertContentProps, AlertIcon, type AlertIconProps, AlertBody, type AlertBodyProps, AlertTitle, type AlertTitleProps, AlertDescription, type AlertDescriptionProps, AlertActions, type AlertActionsProps, AlertList, type AlertListProps, AlertDismiss, type AlertDismissProps } from './Alert.js';
|
package/src/utils.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const STORAGE_KEY = 'dg-theme';
|
|
2
|
+
const EVENT_NAME = 'dg-theme-change';
|
|
3
|
+
|
|
4
|
+
type Theme = 'light' | 'dark' | 'system';
|
|
5
|
+
|
|
6
|
+
function applyAndPersist(theme: Theme): void {
|
|
7
|
+
if (theme === 'system') {
|
|
8
|
+
document.documentElement.style.removeProperty('color-scheme');
|
|
9
|
+
} else {
|
|
10
|
+
document.documentElement.style.colorScheme = theme;
|
|
11
|
+
}
|
|
12
|
+
localStorage.setItem(STORAGE_KEY, theme);
|
|
13
|
+
document.dispatchEvent(
|
|
14
|
+
new CustomEvent(EVENT_NAME, { detail: { theme } })
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function setLight(): void {
|
|
19
|
+
applyAndPersist('light');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function setDark(): void {
|
|
23
|
+
applyAndPersist('dark');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function setSystem(): void {
|
|
27
|
+
applyAndPersist('system');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Read the current theme from the `<html>` inline style. */
|
|
31
|
+
export function getTheme(): Theme {
|
|
32
|
+
const value = document.documentElement.style.colorScheme;
|
|
33
|
+
if (value === 'light') return 'light';
|
|
34
|
+
if (value === 'dark') return 'dark';
|
|
35
|
+
return 'system';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Restore the saved theme from localStorage.
|
|
40
|
+
* Call this in an inline `<script>` in `<head>` to prevent FOUC.
|
|
41
|
+
*/
|
|
42
|
+
export function restoreTheme(): void {
|
|
43
|
+
const saved = localStorage.getItem(STORAGE_KEY);
|
|
44
|
+
if (saved === 'light' || saved === 'dark') {
|
|
45
|
+
document.documentElement.style.colorScheme = saved;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Subscribe to theme changes. Returns an unsubscribe function.
|
|
51
|
+
*/
|
|
52
|
+
export function onThemeChange(
|
|
53
|
+
callback: (theme: Theme) => void
|
|
54
|
+
): () => void {
|
|
55
|
+
const handler = (e: Event) => {
|
|
56
|
+
callback((e as CustomEvent<{ theme: Theme }>).detail.theme);
|
|
57
|
+
};
|
|
58
|
+
document.addEventListener(EVENT_NAME, handler);
|
|
59
|
+
return () => document.removeEventListener(EVENT_NAME, handler);
|
|
60
|
+
}
|