@deepgram/styles 0.2.11 → 0.2.12

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.
Files changed (168) hide show
  1. package/design-system.yaml +3098 -3336
  2. package/dist/deepgram.css +1 -1
  3. package/dist/deepgram.expanded.css +665 -883
  4. package/dist/react/ActionGroup.d.ts +4 -0
  5. package/dist/react/ActionGroup.js +9 -0
  6. package/dist/react/Alert.d.ts +34 -0
  7. package/dist/react/Alert.js +71 -0
  8. package/dist/react/Btn.d.ts +11 -0
  9. package/dist/react/Btn.js +16 -0
  10. package/dist/react/BtnCollapse.d.ts +4 -0
  11. package/dist/react/BtnCollapse.js +9 -0
  12. package/dist/react/BtnDangerGhost.d.ts +4 -0
  13. package/dist/react/BtnDangerGhost.js +9 -0
  14. package/dist/react/BtnGhost.d.ts +4 -0
  15. package/dist/react/BtnGhost.js +9 -0
  16. package/dist/react/BtnIcon.d.ts +4 -0
  17. package/dist/react/BtnIcon.js +9 -0
  18. package/dist/react/BtnSecondary.d.ts +4 -0
  19. package/dist/react/BtnSecondary.js +9 -0
  20. package/dist/react/BtnSmall.d.ts +4 -0
  21. package/dist/react/BtnSmall.js +9 -0
  22. package/dist/react/Card.d.ts +26 -0
  23. package/dist/react/Card.js +51 -0
  24. package/dist/react/CardHeading.d.ts +4 -0
  25. package/dist/react/CardHeading.js +9 -0
  26. package/dist/react/CardHeadings.d.ts +7 -0
  27. package/dist/react/CardHeadings.js +16 -0
  28. package/dist/react/Checkbox.d.ts +4 -0
  29. package/dist/react/Checkbox.js +9 -0
  30. package/dist/react/CheckboxDescription.d.ts +4 -0
  31. package/dist/react/CheckboxDescription.js +9 -0
  32. package/dist/react/CheckboxGroup.d.ts +4 -0
  33. package/dist/react/CheckboxGroup.js +9 -0
  34. package/dist/react/CheckboxLabel.d.ts +4 -0
  35. package/dist/react/CheckboxLabel.js +9 -0
  36. package/dist/react/CodeBlock.d.ts +7 -0
  37. package/dist/react/CodeBlock.js +12 -0
  38. package/dist/react/Columns.d.ts +25 -0
  39. package/dist/react/Columns.js +44 -0
  40. package/dist/react/ConstrainWidth.d.ts +4 -0
  41. package/dist/react/ConstrainWidth.js +9 -0
  42. package/dist/react/DragDropZone.d.ts +17 -0
  43. package/dist/react/DragDropZone.js +38 -0
  44. package/dist/react/Footer.d.ts +10 -0
  45. package/dist/react/Footer.js +23 -0
  46. package/dist/react/FormError.d.ts +4 -0
  47. package/dist/react/FormError.js +9 -0
  48. package/dist/react/FormField.d.ts +4 -0
  49. package/dist/react/FormField.js +9 -0
  50. package/dist/react/FormHelper.d.ts +4 -0
  51. package/dist/react/FormHelper.js +9 -0
  52. package/dist/react/FormLabel.d.ts +4 -0
  53. package/dist/react/FormLabel.js +9 -0
  54. package/dist/react/GridMobileStack.d.ts +4 -0
  55. package/dist/react/GridMobileStack.js +9 -0
  56. package/dist/react/Header.d.ts +25 -0
  57. package/dist/react/Header.js +58 -0
  58. package/dist/react/Hero.d.ts +25 -0
  59. package/dist/react/Hero.js +58 -0
  60. package/dist/react/Icon.d.ts +5 -0
  61. package/dist/react/Icon.js +10 -0
  62. package/dist/react/Input.d.ts +6 -0
  63. package/dist/react/Input.js +11 -0
  64. package/dist/react/ItemTitle.d.ts +4 -0
  65. package/dist/react/ItemTitle.js +9 -0
  66. package/dist/react/Link.d.ts +4 -0
  67. package/dist/react/Link.js +9 -0
  68. package/dist/react/Modal.d.ts +8 -0
  69. package/dist/react/Modal.js +17 -0
  70. package/dist/react/Newsletter.d.ts +8 -0
  71. package/dist/react/Newsletter.js +17 -0
  72. package/dist/react/Option.d.ts +4 -0
  73. package/dist/react/Option.js +9 -0
  74. package/dist/react/PageHeading.d.ts +10 -0
  75. package/dist/react/PageHeading.js +23 -0
  76. package/dist/react/PageHeadings.d.ts +13 -0
  77. package/dist/react/PageHeadings.js +30 -0
  78. package/dist/react/Prose.d.ts +6 -0
  79. package/dist/react/Prose.js +11 -0
  80. package/dist/react/Radio.d.ts +4 -0
  81. package/dist/react/Radio.js +9 -0
  82. package/dist/react/RadioDescription.d.ts +7 -0
  83. package/dist/react/RadioDescription.js +16 -0
  84. package/dist/react/RadioGroup.d.ts +4 -0
  85. package/dist/react/RadioGroup.js +9 -0
  86. package/dist/react/RadioLabel.d.ts +4 -0
  87. package/dist/react/RadioLabel.js +9 -0
  88. package/dist/react/Section.d.ts +9 -0
  89. package/dist/react/Section.js +14 -0
  90. package/dist/react/SectionHeading.d.ts +4 -0
  91. package/dist/react/SectionHeading.js +9 -0
  92. package/dist/react/Select.d.ts +4 -0
  93. package/dist/react/Select.js +9 -0
  94. package/dist/react/Spinner.d.ts +7 -0
  95. package/dist/react/Spinner.js +16 -0
  96. package/dist/react/Status.d.ts +12 -0
  97. package/dist/react/Status.js +17 -0
  98. package/dist/react/TextUtilities.d.ts +4 -0
  99. package/dist/react/TextUtilities.js +9 -0
  100. package/dist/react/Textarea.d.ts +4 -0
  101. package/dist/react/Textarea.js +9 -0
  102. package/dist/react/Toggle.d.ts +4 -0
  103. package/dist/react/Toggle.js +9 -0
  104. package/dist/react/ToggleGroup.d.ts +4 -0
  105. package/dist/react/ToggleGroup.js +9 -0
  106. package/dist/react/ToggleLabel.d.ts +4 -0
  107. package/dist/react/ToggleLabel.js +9 -0
  108. package/dist/react/index.d.ts +43 -0
  109. package/dist/react/index.js +43 -0
  110. package/dist/utils.d.ts +16 -0
  111. package/dist/utils.js +50 -0
  112. package/lib/deepgram.css +531 -486
  113. package/lib/tailwind-theme.css +0 -1
  114. package/package.json +17 -2
  115. package/src/react/ActionGroup.tsx +14 -0
  116. package/src/react/Alert.tsx +130 -0
  117. package/src/react/Btn.tsx +28 -0
  118. package/src/react/BtnCollapse.tsx +14 -0
  119. package/src/react/BtnDangerGhost.tsx +14 -0
  120. package/src/react/BtnGhost.tsx +14 -0
  121. package/src/react/BtnIcon.tsx +14 -0
  122. package/src/react/BtnSecondary.tsx +14 -0
  123. package/src/react/BtnSmall.tsx +14 -0
  124. package/src/react/Card.tsx +93 -0
  125. package/src/react/CardHeading.tsx +14 -0
  126. package/src/react/CardHeadings.tsx +27 -0
  127. package/src/react/Checkbox.tsx +14 -0
  128. package/src/react/CheckboxDescription.tsx +14 -0
  129. package/src/react/CheckboxGroup.tsx +14 -0
  130. package/src/react/CheckboxLabel.tsx +14 -0
  131. package/src/react/CodeBlock.tsx +20 -0
  132. package/src/react/Columns.tsx +82 -0
  133. package/src/react/ConstrainWidth.tsx +14 -0
  134. package/src/react/DragDropZone.tsx +68 -0
  135. package/src/react/Footer.tsx +40 -0
  136. package/src/react/FormError.tsx +14 -0
  137. package/src/react/FormField.tsx +14 -0
  138. package/src/react/FormHelper.tsx +14 -0
  139. package/src/react/FormLabel.tsx +14 -0
  140. package/src/react/GridMobileStack.tsx +14 -0
  141. package/src/react/Header.tsx +105 -0
  142. package/src/react/Hero.tsx +105 -0
  143. package/src/react/Icon.tsx +16 -0
  144. package/src/react/Input.tsx +18 -0
  145. package/src/react/ItemTitle.tsx +14 -0
  146. package/src/react/Link.tsx +14 -0
  147. package/src/react/Modal.tsx +29 -0
  148. package/src/react/Newsletter.tsx +29 -0
  149. package/src/react/Option.tsx +14 -0
  150. package/src/react/PageHeading.tsx +40 -0
  151. package/src/react/PageHeadings.tsx +53 -0
  152. package/src/react/Prose.tsx +18 -0
  153. package/src/react/Radio.tsx +14 -0
  154. package/src/react/RadioDescription.tsx +27 -0
  155. package/src/react/RadioGroup.tsx +14 -0
  156. package/src/react/RadioLabel.tsx +14 -0
  157. package/src/react/Section.tsx +24 -0
  158. package/src/react/SectionHeading.tsx +14 -0
  159. package/src/react/Select.tsx +14 -0
  160. package/src/react/Spinner.tsx +27 -0
  161. package/src/react/Status.tsx +30 -0
  162. package/src/react/TextUtilities.tsx +14 -0
  163. package/src/react/Textarea.tsx +14 -0
  164. package/src/react/Toggle.tsx +14 -0
  165. package/src/react/ToggleGroup.tsx +14 -0
  166. package/src/react/ToggleLabel.tsx +14 -0
  167. package/src/react/index.ts +43 -0
  168. package/src/utils.ts +60 -0
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ export const Section = forwardRef(function Section({ compact, spacious, bordered, elevated, fieldset, className, children, ...props }, ref) {
4
+ const cls = [
5
+ 'dg-section',
6
+ compact && 'dg-section--compact',
7
+ spacious && 'dg-section--spacious',
8
+ bordered && 'dg-section--bordered',
9
+ elevated && 'dg-section--elevated',
10
+ fieldset && 'dg-section--fieldset',
11
+ className,
12
+ ].filter(Boolean).join(' ');
13
+ return _jsx("div", { ref: ref, className: cls, ...props, children: children });
14
+ });
@@ -0,0 +1,4 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export interface SectionHeadingProps extends ComponentPropsWithRef<'h2'> {
3
+ }
4
+ export declare const SectionHeading: import("react").ForwardRefExoticComponent<Omit<SectionHeadingProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ export const SectionHeading = forwardRef(function SectionHeading({ className, children, ...props }, ref) {
4
+ const cls = [
5
+ 'dg-section-heading',
6
+ className,
7
+ ].filter(Boolean).join(' ');
8
+ return _jsx("h2", { ref: ref, className: cls, ...props, children: children });
9
+ });
@@ -0,0 +1,4 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export interface SelectProps extends ComponentPropsWithRef<'select'> {
3
+ }
4
+ export declare const Select: import("react").ForwardRefExoticComponent<Omit<SelectProps, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ export const Select = forwardRef(function Select({ className, children, ...props }, ref) {
4
+ const cls = [
5
+ 'dg-select',
6
+ className,
7
+ ].filter(Boolean).join(' ');
8
+ return _jsx("select", { ref: ref, className: cls, ...props, children: children });
9
+ });
@@ -0,0 +1,7 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export interface SpinnerProps extends ComponentPropsWithRef<'div'> {
3
+ }
4
+ export declare const Spinner: import("react").ForwardRefExoticComponent<Omit<SpinnerProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
5
+ export interface SpinnerTitleProps extends ComponentPropsWithRef<'p'> {
6
+ }
7
+ export declare const SpinnerTitle: import("react").ForwardRefExoticComponent<Omit<SpinnerTitleProps, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ export const Spinner = forwardRef(function Spinner({ className, children, ...props }, ref) {
4
+ const cls = [
5
+ 'dg-spinner',
6
+ className,
7
+ ].filter(Boolean).join(' ');
8
+ return _jsx("div", { ref: ref, className: cls, ...props, children: children });
9
+ });
10
+ export const SpinnerTitle = forwardRef(function SpinnerTitle({ className, children, ...props }, ref) {
11
+ const cls = [
12
+ 'dg-spinner__title',
13
+ className,
14
+ ].filter(Boolean).join(' ');
15
+ return _jsx("p", { ref: ref, className: cls, ...props, children: children });
16
+ });
@@ -0,0 +1,12 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export interface StatusProps extends ComponentPropsWithRef<'div'> {
3
+ info?: boolean;
4
+ success?: boolean;
5
+ warning?: boolean;
6
+ error?: boolean;
7
+ primary?: boolean;
8
+ secondary?: boolean;
9
+ withIcon?: boolean;
10
+ compact?: boolean;
11
+ }
12
+ export declare const Status: import("react").ForwardRefExoticComponent<Omit<StatusProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ export const Status = forwardRef(function Status({ info, success, warning, error, primary, secondary, withIcon, compact, className, children, ...props }, ref) {
4
+ const cls = [
5
+ 'dg-status',
6
+ info && 'dg-status--info',
7
+ success && 'dg-status--success',
8
+ warning && 'dg-status--warning',
9
+ error && 'dg-status--error',
10
+ primary && 'dg-status--primary',
11
+ secondary && 'dg-status--secondary',
12
+ withIcon && 'dg-status--with-icon',
13
+ compact && 'dg-status--compact',
14
+ className,
15
+ ].filter(Boolean).join(' ');
16
+ return _jsx("div", { ref: ref, className: cls, ...props, children: children });
17
+ });
@@ -0,0 +1,4 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export interface TextUtilitiesProps extends ComponentPropsWithRef<'div'> {
3
+ }
4
+ export declare const TextUtilities: import("react").ForwardRefExoticComponent<Omit<TextUtilitiesProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ export const TextUtilities = forwardRef(function TextUtilities({ className, children, ...props }, ref) {
4
+ const cls = [
5
+ 'dg-text-utilities',
6
+ className,
7
+ ].filter(Boolean).join(' ');
8
+ return _jsx("div", { ref: ref, className: cls, ...props, children: children });
9
+ });
@@ -0,0 +1,4 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export interface TextareaProps extends ComponentPropsWithRef<'textarea'> {
3
+ }
4
+ export declare const Textarea: import("react").ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ export const Textarea = forwardRef(function Textarea({ className, children, ...props }, ref) {
4
+ const cls = [
5
+ 'dg-textarea',
6
+ className,
7
+ ].filter(Boolean).join(' ');
8
+ return _jsx("textarea", { ref: ref, className: cls, ...props, children: children });
9
+ });
@@ -0,0 +1,4 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export interface ToggleProps extends ComponentPropsWithRef<'input'> {
3
+ }
4
+ export declare const Toggle: import("react").ForwardRefExoticComponent<Omit<ToggleProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ export const Toggle = forwardRef(function Toggle({ className, ...props }, ref) {
4
+ const cls = [
5
+ 'dg-toggle',
6
+ className,
7
+ ].filter(Boolean).join(' ');
8
+ return _jsx("input", { ref: ref, type: "checkbox", className: cls, ...props });
9
+ });
@@ -0,0 +1,4 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export interface ToggleGroupProps extends ComponentPropsWithRef<'div'> {
3
+ }
4
+ export declare const ToggleGroup: import("react").ForwardRefExoticComponent<Omit<ToggleGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ export const ToggleGroup = forwardRef(function ToggleGroup({ className, children, ...props }, ref) {
4
+ const cls = [
5
+ 'dg-toggle-group',
6
+ className,
7
+ ].filter(Boolean).join(' ');
8
+ return _jsx("div", { ref: ref, className: cls, ...props, children: children });
9
+ });
@@ -0,0 +1,4 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export interface ToggleLabelProps extends ComponentPropsWithRef<'label'> {
3
+ }
4
+ export declare const ToggleLabel: import("react").ForwardRefExoticComponent<Omit<ToggleLabelProps, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ export const ToggleLabel = forwardRef(function ToggleLabel({ className, children, ...props }, ref) {
4
+ const cls = [
5
+ 'dg-toggle-label',
6
+ className,
7
+ ].filter(Boolean).join(' ');
8
+ return _jsx("label", { ref: ref, className: cls, ...props, children: children });
9
+ });
@@ -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';
@@ -0,0 +1,43 @@
1
+ export { Btn } from './Btn.js';
2
+ export { ActionGroup } from './ActionGroup.js';
3
+ export { Section } from './Section.js';
4
+ export { Card, CardImage, CardIcon, CardHeader, CardBody, CardFooter } from './Card.js';
5
+ export { CodeBlock } from './CodeBlock.js';
6
+ export { Hero, HeroTitle, HeroContent, HeroAnnouncement, HeroAnnouncementText, HeroAnnouncementCta, HeroBody, HeroActions } from './Hero.js';
7
+ export { SectionHeading } from './SectionHeading.js';
8
+ export { PageHeading, PageHeadingTitle, PageHeadingDescription } from './PageHeading.js';
9
+ export { PageHeadings, PageHeadingsTitleWrapper, PageHeadingsTitle, PageHeadingsActions } from './PageHeadings.js';
10
+ export { CardHeading } from './CardHeading.js';
11
+ export { CardHeadings, CardHeadingsTitle } from './CardHeadings.js';
12
+ export { ItemTitle } from './ItemTitle.js';
13
+ export { Prose } from './Prose.js';
14
+ export { Icon } from './Icon.js';
15
+ export { Input } from './Input.js';
16
+ export { Textarea } from './Textarea.js';
17
+ export { Checkbox } from './Checkbox.js';
18
+ export { Select } from './Select.js';
19
+ export { Option } from './Option.js';
20
+ export { Radio } from './Radio.js';
21
+ export { Toggle } from './Toggle.js';
22
+ export { CheckboxLabel } from './CheckboxLabel.js';
23
+ export { CheckboxDescription } from './CheckboxDescription.js';
24
+ export { CheckboxGroup } from './CheckboxGroup.js';
25
+ export { RadioLabel } from './RadioLabel.js';
26
+ export { RadioDescription, RadioDescriptionHint } from './RadioDescription.js';
27
+ export { RadioGroup } from './RadioGroup.js';
28
+ export { ToggleLabel } from './ToggleLabel.js';
29
+ export { ToggleGroup } from './ToggleGroup.js';
30
+ export { FormLabel } from './FormLabel.js';
31
+ export { FormHelper } from './FormHelper.js';
32
+ export { FormError } from './FormError.js';
33
+ export { FormField } from './FormField.js';
34
+ export { DragDropZone, DragDropZoneInput, DragDropZoneIcon, DragDropZoneText, DragDropZoneHint } from './DragDropZone.js';
35
+ export { Status } from './Status.js';
36
+ export { Spinner, SpinnerTitle } from './Spinner.js';
37
+ export { ConstrainWidth } from './ConstrainWidth.js';
38
+ export { GridMobileStack } from './GridMobileStack.js';
39
+ export { Columns, ColumnsWrapper, ColumnsMobileHeader, ColumnsSidebarToggle, ColumnsColumn } from './Columns.js';
40
+ export { Footer, FooterSocialLinks, FooterSocialLink } from './Footer.js';
41
+ export { TextUtilities } from './TextUtilities.js';
42
+ export { Newsletter, NewsletterForm } from './Newsletter.js';
43
+ export { Alert, AlertContent, AlertIcon, AlertBody, AlertTitle, AlertDescription, AlertActions, AlertList, AlertDismiss } from './Alert.js';
@@ -0,0 +1,16 @@
1
+ type Theme = 'light' | 'dark' | 'system';
2
+ export declare function setLight(): void;
3
+ export declare function setDark(): void;
4
+ export declare function setSystem(): void;
5
+ /** Read the current theme from the `<html>` inline style. */
6
+ export declare function getTheme(): Theme;
7
+ /**
8
+ * Restore the saved theme from localStorage.
9
+ * Call this in an inline `<script>` in `<head>` to prevent FOUC.
10
+ */
11
+ export declare function restoreTheme(): void;
12
+ /**
13
+ * Subscribe to theme changes. Returns an unsubscribe function.
14
+ */
15
+ export declare function onThemeChange(callback: (theme: Theme) => void): () => void;
16
+ export {};
package/dist/utils.js ADDED
@@ -0,0 +1,50 @@
1
+ const STORAGE_KEY = 'dg-theme';
2
+ const EVENT_NAME = 'dg-theme-change';
3
+ function applyAndPersist(theme) {
4
+ if (theme === 'system') {
5
+ document.documentElement.style.removeProperty('color-scheme');
6
+ }
7
+ else {
8
+ document.documentElement.style.colorScheme = theme;
9
+ }
10
+ localStorage.setItem(STORAGE_KEY, theme);
11
+ document.dispatchEvent(new CustomEvent(EVENT_NAME, { detail: { theme } }));
12
+ }
13
+ export function setLight() {
14
+ applyAndPersist('light');
15
+ }
16
+ export function setDark() {
17
+ applyAndPersist('dark');
18
+ }
19
+ export function setSystem() {
20
+ applyAndPersist('system');
21
+ }
22
+ /** Read the current theme from the `<html>` inline style. */
23
+ export function getTheme() {
24
+ const value = document.documentElement.style.colorScheme;
25
+ if (value === 'light')
26
+ return 'light';
27
+ if (value === 'dark')
28
+ return 'dark';
29
+ return 'system';
30
+ }
31
+ /**
32
+ * Restore the saved theme from localStorage.
33
+ * Call this in an inline `<script>` in `<head>` to prevent FOUC.
34
+ */
35
+ export function restoreTheme() {
36
+ const saved = localStorage.getItem(STORAGE_KEY);
37
+ if (saved === 'light' || saved === 'dark') {
38
+ document.documentElement.style.colorScheme = saved;
39
+ }
40
+ }
41
+ /**
42
+ * Subscribe to theme changes. Returns an unsubscribe function.
43
+ */
44
+ export function onThemeChange(callback) {
45
+ const handler = (e) => {
46
+ callback(e.detail.theme);
47
+ };
48
+ document.addEventListener(EVENT_NAME, handler);
49
+ return () => document.removeEventListener(EVENT_NAME, handler);
50
+ }