@oztix/roadie-components 2.0.1 → 2.0.2

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 (164) hide show
  1. package/dist/Accordion.d.ts +42 -21
  2. package/dist/Accordion.d.ts.map +1 -0
  3. package/dist/Accordion.js +1 -2
  4. package/dist/Accordion.js.map +1 -1
  5. package/dist/Autocomplete.d.ts +101 -60
  6. package/dist/Autocomplete.d.ts.map +1 -0
  7. package/dist/Autocomplete.js +1 -2
  8. package/dist/Autocomplete.js.map +1 -1
  9. package/dist/Badge.d.ts +27 -16
  10. package/dist/Badge.d.ts.map +1 -0
  11. package/dist/Badge.js +1 -1
  12. package/dist/Badge.js.map +1 -1
  13. package/dist/Breadcrumb.d.ts +45 -23
  14. package/dist/Breadcrumb.d.ts.map +1 -0
  15. package/dist/Breadcrumb.js +1 -1
  16. package/dist/Breadcrumb.js.map +1 -1
  17. package/dist/Button-CDQ6ik0P.js +2 -0
  18. package/dist/Button-CDQ6ik0P.js.map +1 -0
  19. package/dist/Button-DdE0vCfo.js +2 -0
  20. package/dist/Button-DdE0vCfo.js.map +1 -0
  21. package/dist/Button-Dt1TGgrL.d.ts +26 -0
  22. package/dist/Button-Dt1TGgrL.d.ts.map +1 -0
  23. package/dist/Button.d.ts +3 -17
  24. package/dist/Button.js +1 -2
  25. package/dist/Card.d.ts +56 -30
  26. package/dist/Card.d.ts.map +1 -0
  27. package/dist/Card.js +1 -1
  28. package/dist/Card.js.map +1 -1
  29. package/dist/Code.d.ts +19 -13
  30. package/dist/Code.d.ts.map +1 -0
  31. package/dist/Code.js +1 -1
  32. package/dist/Code.js.map +1 -1
  33. package/dist/Combobox.d.ts +111 -63
  34. package/dist/Combobox.d.ts.map +1 -0
  35. package/dist/Combobox.js +1 -2
  36. package/dist/Combobox.js.map +1 -1
  37. package/dist/Field.d.ts +63 -46
  38. package/dist/Field.d.ts.map +1 -0
  39. package/dist/Field.js +1 -2
  40. package/dist/Field.js.map +1 -1
  41. package/dist/Fieldset.d.ts +34 -22
  42. package/dist/Fieldset.d.ts.map +1 -0
  43. package/dist/Fieldset.js +1 -2
  44. package/dist/Fieldset.js.map +1 -1
  45. package/dist/Highlight.d.ts +20 -15
  46. package/dist/Highlight.d.ts.map +1 -0
  47. package/dist/Highlight.js +1 -2
  48. package/dist/Highlight.js.map +1 -1
  49. package/dist/Indicator.d.ts +20 -12
  50. package/dist/Indicator.d.ts.map +1 -0
  51. package/dist/Indicator.js +1 -1
  52. package/dist/Indicator.js.map +1 -1
  53. package/dist/Input.d.ts +22 -14
  54. package/dist/Input.d.ts.map +1 -0
  55. package/dist/Input.js +1 -2
  56. package/dist/Input.js.map +1 -1
  57. package/dist/Label.d.ts +12 -8
  58. package/dist/Label.d.ts.map +1 -0
  59. package/dist/Label.js +1 -1
  60. package/dist/Label.js.map +1 -1
  61. package/dist/LinkButton-9nnOzX_0.js +2 -0
  62. package/dist/LinkButton-9nnOzX_0.js.map +1 -0
  63. package/dist/LinkButton.d.ts +2 -35
  64. package/dist/LinkButton.js +1 -2
  65. package/dist/Mark.d.ts +19 -12
  66. package/dist/Mark.d.ts.map +1 -0
  67. package/dist/Mark.js +1 -1
  68. package/dist/Mark.js.map +1 -1
  69. package/dist/Marquee.d.ts +27 -16
  70. package/dist/Marquee.d.ts.map +1 -0
  71. package/dist/Marquee.js +5 -2
  72. package/dist/Marquee.js.map +1 -1
  73. package/dist/Prose.d.ts +19 -12
  74. package/dist/Prose.d.ts.map +1 -0
  75. package/dist/Prose.js +1 -1
  76. package/dist/Prose.js.map +1 -1
  77. package/dist/RadioGroup.d.ts +62 -38
  78. package/dist/RadioGroup.d.ts.map +1 -0
  79. package/dist/RadioGroup.js +1 -2
  80. package/dist/RadioGroup.js.map +1 -1
  81. package/dist/Select.d.ts +129 -73
  82. package/dist/Select.d.ts.map +1 -0
  83. package/dist/Select.js +1 -2
  84. package/dist/Select.js.map +1 -1
  85. package/dist/Separator.d.ts +17 -12
  86. package/dist/Separator.d.ts.map +1 -0
  87. package/dist/Separator.js +1 -1
  88. package/dist/Separator.js.map +1 -1
  89. package/dist/SpotIllustration.d.ts +71 -50
  90. package/dist/SpotIllustration.d.ts.map +1 -0
  91. package/dist/SpotIllustration.js +1 -2
  92. package/dist/SpotIllustration.js.map +1 -1
  93. package/dist/Steps.d.ts +102 -62
  94. package/dist/Steps.d.ts.map +1 -0
  95. package/dist/Steps.js +1 -2
  96. package/dist/Steps.js.map +1 -1
  97. package/dist/Textarea.d.ts +22 -13
  98. package/dist/Textarea.d.ts.map +1 -0
  99. package/dist/Textarea.js +1 -2
  100. package/dist/Textarea.js.map +1 -1
  101. package/dist/index-0w-ydb3o.d.ts +50 -0
  102. package/dist/index-0w-ydb3o.d.ts.map +1 -0
  103. package/dist/index-C3_4djmE.d.ts +17 -0
  104. package/dist/index-C3_4djmE.d.ts.map +1 -0
  105. package/dist/index.d.ts +47 -49
  106. package/dist/index.d.ts.map +1 -0
  107. package/dist/index.js +23 -23
  108. package/dist/index.js.map +1 -1
  109. package/dist/variants-DTAwzBl3.js +2 -0
  110. package/dist/variants-DTAwzBl3.js.map +1 -0
  111. package/package.json +6 -5
  112. package/dist/Button-fnIVmjIB.d.ts +0 -18
  113. package/dist/Button.js.map +0 -1
  114. package/dist/LinkButton.js.map +0 -1
  115. package/dist/_chunks/chunk-3H22EQQ6.js +0 -2
  116. package/dist/_chunks/chunk-3H22EQQ6.js.map +0 -1
  117. package/dist/_chunks/chunk-42UB7PQB.js +0 -3
  118. package/dist/_chunks/chunk-42UB7PQB.js.map +0 -1
  119. package/dist/_chunks/chunk-4LGCF3SN.js +0 -3
  120. package/dist/_chunks/chunk-4LGCF3SN.js.map +0 -1
  121. package/dist/_chunks/chunk-AFSDN4WI.js +0 -2
  122. package/dist/_chunks/chunk-AFSDN4WI.js.map +0 -1
  123. package/dist/_chunks/chunk-BQEJDV7D.js +0 -3
  124. package/dist/_chunks/chunk-BQEJDV7D.js.map +0 -1
  125. package/dist/_chunks/chunk-DRVUAPKN.js +0 -2
  126. package/dist/_chunks/chunk-DRVUAPKN.js.map +0 -1
  127. package/dist/_chunks/chunk-EKOEXSAP.js +0 -2
  128. package/dist/_chunks/chunk-EKOEXSAP.js.map +0 -1
  129. package/dist/_chunks/chunk-FQNVMKKV.js +0 -7
  130. package/dist/_chunks/chunk-FQNVMKKV.js.map +0 -1
  131. package/dist/_chunks/chunk-IEDKSZAQ.js +0 -3
  132. package/dist/_chunks/chunk-IEDKSZAQ.js.map +0 -1
  133. package/dist/_chunks/chunk-JBHYUOI2.js +0 -3
  134. package/dist/_chunks/chunk-JBHYUOI2.js.map +0 -1
  135. package/dist/_chunks/chunk-JGTZ3GCR.js +0 -2
  136. package/dist/_chunks/chunk-JGTZ3GCR.js.map +0 -1
  137. package/dist/_chunks/chunk-LHNOY24C.js +0 -2
  138. package/dist/_chunks/chunk-LHNOY24C.js.map +0 -1
  139. package/dist/_chunks/chunk-LMV3JECI.js +0 -3
  140. package/dist/_chunks/chunk-LMV3JECI.js.map +0 -1
  141. package/dist/_chunks/chunk-MDRAL676.js +0 -3
  142. package/dist/_chunks/chunk-MDRAL676.js.map +0 -1
  143. package/dist/_chunks/chunk-N2HGY7W7.js +0 -3
  144. package/dist/_chunks/chunk-N2HGY7W7.js.map +0 -1
  145. package/dist/_chunks/chunk-NRVNUMJE.js +0 -2
  146. package/dist/_chunks/chunk-NRVNUMJE.js.map +0 -1
  147. package/dist/_chunks/chunk-OIAETOZT.js +0 -3
  148. package/dist/_chunks/chunk-OIAETOZT.js.map +0 -1
  149. package/dist/_chunks/chunk-OIZX63GZ.js +0 -2
  150. package/dist/_chunks/chunk-OIZX63GZ.js.map +0 -1
  151. package/dist/_chunks/chunk-OPR5JL7N.js +0 -3
  152. package/dist/_chunks/chunk-OPR5JL7N.js.map +0 -1
  153. package/dist/_chunks/chunk-SCS7WZ6Z.js +0 -3
  154. package/dist/_chunks/chunk-SCS7WZ6Z.js.map +0 -1
  155. package/dist/_chunks/chunk-VSKUGXQG.js +0 -3
  156. package/dist/_chunks/chunk-VSKUGXQG.js.map +0 -1
  157. package/dist/_chunks/chunk-WOU2B425.js +0 -3
  158. package/dist/_chunks/chunk-WOU2B425.js.map +0 -1
  159. package/dist/_chunks/chunk-XERFFH3S.js +0 -3
  160. package/dist/_chunks/chunk-XERFFH3S.js.map +0 -1
  161. package/dist/_chunks/chunk-XRFHVFJ5.js +0 -3
  162. package/dist/_chunks/chunk-XRFHVFJ5.js.map +0 -1
  163. package/dist/_chunks/chunk-ZXR32FYA.js +0 -2
  164. package/dist/_chunks/chunk-ZXR32FYA.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,53 +1,45 @@
1
- export { B as Button, a as ButtonProps, b as buttonVariants } from './Button-fnIVmjIB.js';
2
- export { IconButton, IconButtonProps } from './Button.js';
3
- export { LinkButton, LinkButtonProps, LinkIconButton, LinkIconButtonProps } from './LinkButton.js';
4
- export { Code, CodeProps, codeVariants } from './Code.js';
5
- export { Highlight, HighlightProps } from './Highlight.js';
6
- export { Mark, MarkProps, markVariants } from './Mark.js';
7
- export { Prose, ProseProps, proseVariants } from './Prose.js';
8
- export { Accordion, AccordionProps, accordionVariants } from './Accordion.js';
9
- export { Badge, BadgeProps, badgeVariants } from './Badge.js';
10
- export { Breadcrumb, BreadcrumbSeparatorProps } from './Breadcrumb.js';
11
- export { Card, CardProps, cardVariants } from './Card.js';
12
- export { Separator, SeparatorProps, separatorVariants } from './Separator.js';
13
- export { Marquee, MarqueeProps } from './Marquee.js';
14
- export { Steps, StepsItemProps, StepsProps, stepsVariants } from './Steps.js';
15
- export { OptionalIndicator, OptionalIndicatorProps, RequiredIndicator, RequiredIndicatorProps } from './Indicator.js';
16
- export { Label, LabelProps } from './Label.js';
17
- export { Input, InputProps, inputVariants } from './Input.js';
18
- export { Textarea, TextareaProps, textareaVariants } from './Textarea.js';
19
- export { Field, FieldErrorTextProps, FieldHelperTextProps, FieldLabelProps, FieldProps, useFieldContext, useFieldInputProps } from './Field.js';
20
- export { Select, SelectContentProps, SelectErrorTextProps, SelectGroupLabelProps, SelectGroupProps, SelectHelperTextProps, SelectIconProps, SelectItemIndicatorProps, SelectItemProps, SelectItemTextProps, SelectLabelProps, SelectPopupProps, SelectPortalProps, SelectPositionerProps, SelectProps, SelectRootProps, SelectScrollDownArrowProps, SelectScrollUpArrowProps, SelectTriggerVariantProps as SelectTriggerProps, SelectValueProps, selectTriggerVariants } from './Select.js';
21
- export { Combobox, ComboboxClearProps, ComboboxCollectionProps, ComboboxEmptyProps, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabelProps, ComboboxListProps, ComboboxPopupProps, ComboboxPortalProps, ComboboxPositionerProps, ComboboxProps, ComboboxRootProps, ComboboxStatusProps, ComboboxTriggerProps, comboboxInputGroupVariants, useFilter } from './Combobox.js';
22
- export { Autocomplete, AutocompleteClearProps, AutocompleteCollectionProps, AutocompleteEmptyProps, AutocompleteGroupLabelProps, AutocompleteGroupProps, AutocompleteInputGroupProps, AutocompleteInputProps, AutocompleteItemProps, AutocompleteListProps, AutocompletePopupProps, AutocompletePortalProps, AutocompletePositionerProps, AutocompleteProps, AutocompleteRootProps, AutocompleteStatusProps, AutocompleteTriggerProps, AutocompleteValueProps, autocompleteInputGroupVariants, useFilteredItems } from './Autocomplete.js';
23
- export { RadioGroup, RadioGroupErrorTextProps, RadioGroupHelperTextProps, RadioGroupItemProps, RadioGroupLabelProps, RadioGroupProps, radioGroupItemVariants, radioGroupVariants } from './RadioGroup.js';
24
- export { Fieldset, FieldsetErrorTextProps, FieldsetHelperTextProps, FieldsetLegendProps, FieldsetProps } from './Fieldset.js';
25
- import * as react_jsx_runtime from 'react/jsx-runtime';
26
- import * as react from 'react';
27
- export { UseStepsProps, UseStepsReturn, useSteps } from '@ark-ui/react/steps';
28
- export { ComboboxFilter as Filter, ComboboxFilterOptions as FilterOptions } from '@base-ui/react/combobox';
29
- export { getThemeScript } from '@oztix/roadie-core/theme';
30
- import 'class-variance-authority/types';
31
- import '@base-ui/react/button';
32
- import 'class-variance-authority';
33
- import '@base-ui/react/select';
34
- import '@base-ui/react/autocomplete';
35
- import '@base-ui/react/radio';
36
- import '@base-ui/react/radio-group';
1
+ import { Accordion, AccordionProps, accordionVariants } from "./Accordion.js";
2
+ import { Autocomplete, AutocompleteClearProps, AutocompleteCollectionProps, AutocompleteEmptyProps, AutocompleteGroupLabelProps, AutocompleteGroupProps, AutocompleteInputGroupProps, AutocompleteInputProps, AutocompleteItemProps, AutocompleteListProps, AutocompletePopupProps, AutocompletePortalProps, AutocompletePositionerProps, AutocompleteProps, AutocompleteRootProps, AutocompleteStatusProps, AutocompleteTriggerProps, AutocompleteValueProps, autocompleteInputGroupVariants, useFilteredItems } from "./Autocomplete.js";
3
+ import { Badge, BadgeProps, badgeVariants } from "./Badge.js";
4
+ import { Breadcrumb, BreadcrumbSeparatorProps } from "./Breadcrumb.js";
5
+ import { n as ButtonProps, r as buttonVariants, t as Button } from "./Button-Dt1TGgrL.js";
6
+ import { n as IconButtonProps, t as IconButton } from "./index-C3_4djmE.js";
7
+ import { Card, CardProps, cardVariants } from "./Card.js";
8
+ import { Code, CodeProps, codeVariants } from "./Code.js";
9
+ import { Combobox, ComboboxClearProps, ComboboxCollectionProps, ComboboxEmptyProps, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabelProps, ComboboxListProps, ComboboxPopupProps, ComboboxPortalProps, ComboboxPositionerProps, ComboboxProps, ComboboxRootProps, ComboboxStatusProps, ComboboxTriggerProps, Filter as ComboboxFilter, FilterOptions as ComboboxFilterOptions, comboboxInputGroupVariants, useFilter } from "./Combobox.js";
10
+ import { Input, InputProps, inputVariants } from "./Input.js";
11
+ import { Label, LabelProps } from "./Label.js";
12
+ import { Textarea, TextareaProps, textareaVariants } from "./Textarea.js";
13
+ import { Field, FieldErrorTextProps, FieldHelperTextProps, FieldLabelProps, FieldProps, useFieldContext, useFieldInputProps } from "./Field.js";
14
+ import { Fieldset, FieldsetErrorTextProps, FieldsetHelperTextProps, FieldsetLegendProps, FieldsetProps } from "./Fieldset.js";
15
+ import { Mark, MarkProps, markVariants } from "./Mark.js";
16
+ import { Highlight, HighlightProps } from "./Highlight.js";
17
+ import { OptionalIndicator, OptionalIndicatorProps, RequiredIndicator, RequiredIndicatorProps } from "./Indicator.js";
18
+ import { i as LinkButtonProps, n as LinkIconButtonProps, r as LinkButton, t as LinkIconButton } from "./index-0w-ydb3o.js";
19
+ import { Marquee, MarqueeProps } from "./Marquee.js";
20
+ import { Prose, ProseProps, proseVariants } from "./Prose.js";
21
+ import { RadioGroup, RadioGroupErrorTextProps, RadioGroupHelperTextProps, RadioGroupItemProps, RadioGroupLabelProps, RadioGroupProps, radioGroupItemVariants, radioGroupVariants } from "./RadioGroup.js";
22
+ import { Select, SelectContentProps, SelectErrorTextProps, SelectGroupLabelProps, SelectGroupProps, SelectHelperTextProps, SelectIconProps, SelectItemIndicatorProps, SelectItemProps, SelectItemTextProps, SelectLabelProps, SelectPopupProps, SelectPortalProps, SelectPositionerProps, SelectProps, SelectRootProps, SelectScrollDownArrowProps, SelectScrollUpArrowProps, SelectTriggerProps, SelectValueProps, selectTriggerVariants } from "./Select.js";
23
+ import { Separator, SeparatorProps, separatorVariants } from "./Separator.js";
24
+ import { Steps, StepsItemProps, StepsProps, UseStepsProps, UseStepsReturn, stepsVariants, useSteps } from "./Steps.js";
25
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
26
+ import * as React from "react";
27
+ import { getThemeScript } from "@oztix/roadie-core/theme";
37
28
 
29
+ //#region src/providers/ThemeProvider.d.ts
38
30
  interface ThemeContextType {
39
- accentColor: string;
40
- setAccentColor: (color: string) => void;
41
- isDark: boolean;
42
- setDark: (dark: boolean) => void;
31
+ accentColor: string;
32
+ setAccentColor: (color: string) => void;
33
+ isDark: boolean;
34
+ setDark: (dark: boolean) => void;
43
35
  }
44
36
  interface ThemeProviderProps {
45
- children: react.ReactNode;
46
- defaultAccentColor?: string;
47
- /** Initial dark mode state when no stored preference exists (default: false) */
48
- defaultDark?: boolean;
49
- /** Respect prefers-color-scheme when no explicit user choice is stored (default: false) */
50
- followSystem?: boolean;
37
+ children: React.ReactNode;
38
+ defaultAccentColor?: string;
39
+ /** Initial dark mode state when no stored preference exists (default: false) */
40
+ defaultDark?: boolean;
41
+ /** Respect prefers-color-scheme when no explicit user choice is stored (default: false) */
42
+ followSystem?: boolean;
51
43
  }
52
44
  /**
53
45
  * Generate a <style> tag string for server-side rendering.
@@ -55,7 +47,13 @@ interface ThemeProviderProps {
55
47
  * plus hex fallbacks for older browsers.
56
48
  */
57
49
  declare function getAccentStyleTag(accentHex: string, id?: string): Promise<string>;
58
- declare function ThemeProvider({ children, defaultAccentColor, defaultDark, followSystem }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
50
+ declare function ThemeProvider({
51
+ children,
52
+ defaultAccentColor,
53
+ defaultDark,
54
+ followSystem
55
+ }: ThemeProviderProps): _$react_jsx_runtime0.JSX.Element;
59
56
  declare function useTheme(): ThemeContextType;
60
-
61
- export { ThemeProvider, type ThemeProviderProps, getAccentStyleTag, useTheme };
57
+ //#endregion
58
+ export { Accordion, type AccordionProps, Autocomplete, type AutocompleteClearProps, type AutocompleteCollectionProps, type AutocompleteEmptyProps, type AutocompleteGroupLabelProps, type AutocompleteGroupProps, type AutocompleteInputGroupProps, type AutocompleteInputProps, type AutocompleteItemProps, type AutocompleteListProps, type AutocompletePopupProps, type AutocompletePortalProps, type AutocompletePositionerProps, type AutocompleteProps, type AutocompleteRootProps, type AutocompleteStatusProps, type AutocompleteTriggerProps, type AutocompleteValueProps, Badge, type BadgeProps, Breadcrumb, type BreadcrumbSeparatorProps, Button, type ButtonProps, Card, type CardProps, Code, type CodeProps, Combobox, type ComboboxClearProps, type ComboboxCollectionProps, type ComboboxEmptyProps, type ComboboxGroupLabelProps, type ComboboxGroupProps, type ComboboxInputGroupProps, type ComboboxInputProps, type ComboboxItemIndicatorProps, type ComboboxItemProps, type ComboboxLabelProps, type ComboboxListProps, type ComboboxPopupProps, type ComboboxPortalProps, type ComboboxPositionerProps, type ComboboxProps, type ComboboxRootProps, type ComboboxStatusProps, type ComboboxTriggerProps, Field, type FieldErrorTextProps, type FieldHelperTextProps, type FieldLabelProps, type FieldProps, Fieldset, type FieldsetErrorTextProps, type FieldsetHelperTextProps, type FieldsetLegendProps, type FieldsetProps, type ComboboxFilter as Filter, type ComboboxFilterOptions as FilterOptions, Highlight, type HighlightProps, IconButton, type IconButtonProps, Input, type InputProps, Label, type LabelProps, LinkButton, type LinkButtonProps, LinkIconButton, type LinkIconButtonProps, Mark, type MarkProps, Marquee, type MarqueeProps, OptionalIndicator, type OptionalIndicatorProps, Prose, type ProseProps, RadioGroup, type RadioGroupErrorTextProps, type RadioGroupHelperTextProps, type RadioGroupItemProps, type RadioGroupLabelProps, type RadioGroupProps, RequiredIndicator, type RequiredIndicatorProps, Select, type SelectContentProps, type SelectErrorTextProps, type SelectGroupLabelProps, type SelectGroupProps, type SelectHelperTextProps, type SelectIconProps, type SelectItemIndicatorProps, type SelectItemProps, type SelectItemTextProps, type SelectLabelProps, type SelectPopupProps, type SelectPortalProps, type SelectPositionerProps, type SelectProps, type SelectRootProps, type SelectScrollDownArrowProps, type SelectScrollUpArrowProps, type SelectTriggerProps, type SelectValueProps, Separator, type SeparatorProps, Steps, type StepsItemProps, type StepsProps, Textarea, type TextareaProps, ThemeProvider, type ThemeProviderProps, type UseStepsProps, type UseStepsReturn, accordionVariants, autocompleteInputGroupVariants, badgeVariants, buttonVariants, cardVariants, codeVariants, comboboxInputGroupVariants, getAccentStyleTag, getThemeScript, inputVariants, markVariants, proseVariants, radioGroupItemVariants, radioGroupVariants, selectTriggerVariants, separatorVariants, stepsVariants, textareaVariants, useFieldContext, useFieldInputProps, useFilter, useFilteredItems, useSteps, useTheme };
59
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/providers/ThemeProvider.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyBU,gBAAA;EACR,WAAA;EACA,cAAA,GAAiB,KAAA;EACjB,MAAA;EACA,OAAA,GAAU,IAAA;AAAA;AAAA,UAOK,kBAAA;EACf,QAAA,EAAU,KAAA,CAAM,SAAA;EAChB,kBAAA;;EAEA,WAAA;;EAEA,YAAA;AAAA;;;;;;iBAYoB,iBAAA,CACpB,SAAA,UACA,EAAA,YACC,OAAA;AAAA,iBAiEa,aAAA,CAAA;EACd,QAAA;EACA,kBAAA;EACA,WAAA;EACA;AAAA,GACC,kBAAA,GAAkB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAoIL,QAAA,CAAA,GAAQ,gBAAA"}
package/dist/index.js CHANGED
@@ -1,35 +1,35 @@
1
- export{a as Marquee}from'./_chunks/chunk-FQNVMKKV.js';export{b as Prose,a as proseVariants}from'./_chunks/chunk-ZXR32FYA.js';export{c as RadioGroup,b as radioGroupItemVariants,a as radioGroupVariants}from'./_chunks/chunk-XRFHVFJ5.js';export{t as Select,a as selectTriggerVariants}from'./_chunks/chunk-BQEJDV7D.js';export{b as Separator,a as separatorVariants}from'./_chunks/chunk-JGTZ3GCR.js';export{c as Steps,b as stepsVariants,a as useSteps}from'./_chunks/chunk-XERFFH3S.js';export{t as Combobox,b as comboboxInputGroupVariants,a as useFilter}from'./_chunks/chunk-OPR5JL7N.js';export{a as Fieldset}from'./_chunks/chunk-42UB7PQB.js';export{a as Highlight}from'./_chunks/chunk-JBHYUOI2.js';export{b as Mark,a as markVariants}from'./_chunks/chunk-WOU2B425.js';export{a as LinkButton,b as LinkIconButton}from'./_chunks/chunk-3H22EQQ6.js';export{b as Accordion,a as accordionVariants}from'./_chunks/chunk-MDRAL676.js';export{t as Autocomplete,c as autocompleteInputGroupVariants,b as useFilteredItems}from'./_chunks/chunk-SCS7WZ6Z.js';export{c as Field,a as useFieldContext,b as useFieldInputProps}from'./_chunks/chunk-N2HGY7W7.js';export{b as Textarea,a as textareaVariants}from'./_chunks/chunk-OIAETOZT.js';export{b as OptionalIndicator,a as RequiredIndicator}from'./_chunks/chunk-LMV3JECI.js';export{b as Input,a as inputVariants}from'./_chunks/chunk-VSKUGXQG.js';export{a as Label}from'./_chunks/chunk-IEDKSZAQ.js';export{b as Badge,a as badgeVariants}from'./_chunks/chunk-AFSDN4WI.js';export{a as Breadcrumb}from'./_chunks/chunk-EKOEXSAP.js';export{a as IconButton}from'./_chunks/chunk-OIZX63GZ.js';export{b as Button,a as buttonVariants}from'./_chunks/chunk-NRVNUMJE.js';export{b as Card,a as cardVariants}from'./_chunks/chunk-LHNOY24C.js';export{b as Code,a as codeVariants}from'./_chunks/chunk-DRVUAPKN.js';import'./_chunks/chunk-4LGCF3SN.js';import*as t from'react';import {generateAccentScale,generateNeutralScale,getOklchHue,getOklchChroma}from'@oztix/roadie-core/colors';export{getThemeScript}from'@oztix/roadie-core/theme';import {jsx}from'react/jsx-runtime';var Ae="#0091EB",A="theme",$e=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("color","oklch(0 0 0)"),$=t.createContext(void 0);async function Ee(o,y="roadie-accent-theme"){let u=await generateAccentScale(o),l=await generateNeutralScale(o),a=Math.round(await getOklchHue(o)),P=+(await getOklchChroma(o)).toFixed(4),m=u.light.map((e,p)=>`--color-accent-${p}: ${e};`).join(`
2
- `),s=u.dark.map((e,p)=>`--color-accent-${p}: ${e};`).join(`
3
- `),d=l.light.map((e,p)=>`--color-neutral-${p}: ${e};`).join(`
4
- `),x=l.dark.map((e,p)=>`--color-neutral-${p}: ${e};`).join(`
5
- `);return `<style id="${y.replace(/[<>"&]/g,"")}">
1
+ import{n as e,t}from"./Button-CDQ6ik0P.js";import{t as n}from"./Button-DdE0vCfo.js";import{n as r,t as i}from"./LinkButton-9nnOzX_0.js";import{Code as a,codeVariants as o}from"./Code.js";import{Mark as s,markVariants as c}from"./Mark.js";import{Highlight as l}from"./Highlight.js";import{Prose as u,proseVariants as d}from"./Prose.js";import{Accordion as ee,accordionVariants as f}from"./Accordion.js";import{Badge as p,badgeVariants as m}from"./Badge.js";import{Breadcrumb as h}from"./Breadcrumb.js";import{Card as g,cardVariants as _}from"./Card.js";import{Separator as te,separatorVariants as ne}from"./Separator.js";import{Marquee as v}from"./Marquee.js";import{Steps as y,stepsVariants as b,useSteps as x}from"./Steps.js";import{OptionalIndicator as S,RequiredIndicator as C}from"./Indicator.js";import{Label as w}from"./Label.js";import{Input as T,inputVariants as E}from"./Input.js";import{Textarea as D,textareaVariants as O}from"./Textarea.js";import{Field as k,useFieldContext as A,useFieldInputProps as j}from"./Field.js";import{Select as M,selectTriggerVariants as N}from"./Select.js";import{Combobox as P,comboboxInputGroupVariants as F,useFilter as I}from"./Combobox.js";import{Autocomplete as re,autocompleteInputGroupVariants as L,useFilteredItems as R}from"./Autocomplete.js";import{RadioGroup as z,radioGroupItemVariants as B,radioGroupVariants as V}from"./RadioGroup.js";import{Fieldset as H}from"./Fieldset.js";import{jsx as U}from"react/jsx-runtime";import*as W from"react";import{generateAccentScale as G,generateNeutralScale as K,getOklchChroma as q,getOklchHue as J}from"@oztix/roadie-core/colors";import{getThemeScript as Y}from"@oztix/roadie-core/theme";const X=`theme`,ie=typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`color`,`oklch(0 0 0)`),Z=W.createContext(void 0);async function ae(e,t=`roadie-accent-theme`){let n=await G(e),r=await K(e),i=Math.round(await J(e)),a=+(await q(e)).toFixed(4),o=n.light.map((e,t)=>`--color-accent-${t}: ${e};`).join(`
2
+ `),s=n.dark.map((e,t)=>`--color-accent-${t}: ${e};`).join(`
3
+ `),c=r.light.map((e,t)=>`--color-neutral-${t}: ${e};`).join(`
4
+ `),l=r.dark.map((e,t)=>`--color-neutral-${t}: ${e};`).join(`
5
+ `);return`<style id="${t.replace(/[<>"&]/g,``)}">
6
6
  :root {
7
- --accent-hue: ${a};
8
- --accent-chroma: ${P};
9
- ${d}
10
- ${m}
7
+ --accent-hue: ${i};
8
+ --accent-chroma: ${a};
9
+ ${c}
10
+ ${o}
11
11
  }
12
12
  .dark {
13
- ${x}
13
+ ${l}
14
14
  ${s}
15
15
  }
16
- </style>`}function h(o){document.documentElement.classList.toggle("dark",o),document.documentElement.style.colorScheme=o?"dark":"light";}function S(){try{return localStorage.getItem(A)}catch{return null}}function Ve(o){try{localStorage.setItem(A,o?"dark":"light");}catch{}}function Re({children:o,defaultAccentColor:y=Ae,defaultDark:u=false,followSystem:l=false}){let[a,P]=t.useState(y),[m,s]=t.useState(u);t.useEffect(()=>{let r=S();if(r){s(r==="dark");return}if(l){let e=window.matchMedia("(prefers-color-scheme: dark)").matches;s(e),h(e);}else {let e=document.documentElement.classList.contains("dark");s(e);}},[]),t.useEffect(()=>{if(!l)return;let r=window.matchMedia("(prefers-color-scheme: dark)"),e=p=>{S()||(s(p.matches),h(p.matches));};return r.addEventListener("change",e),()=>r.removeEventListener("change",e)},[l]);let d=t.useCallback(r=>{s(r),h(r),Ve(r);},[]);t.useEffect(()=>{let r=false;async function e(){let p=Math.round(await getOklchHue(a)),E=+(await getOklchChroma(a)).toFixed(4);if(r||document.getElementById("roadie-accent-theme")?.textContent?.includes(`--accent-hue: ${p}`))return;let f;if($e)f=`
16
+ </style>`}function Q(e){document.documentElement.classList.toggle(`dark`,e),document.documentElement.style.colorScheme=e?`dark`:`light`}function $(){try{return localStorage.getItem(X)}catch{return null}}function oe(e){try{localStorage.setItem(X,e?`dark`:`light`)}catch{}}function se({children:e,defaultAccentColor:t=`#0091EB`,defaultDark:n=!1,followSystem:r=!1}){let[i,a]=W.useState(t),[o,s]=W.useState(n);W.useEffect(()=>{let e=$();if(e){s(e===`dark`);return}if(r){let e=window.matchMedia(`(prefers-color-scheme: dark)`).matches;s(e),Q(e)}else s(document.documentElement.classList.contains(`dark`))},[]),W.useEffect(()=>{if(!r)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=e=>{$()||(s(e.matches),Q(e.matches))};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[r]);let c=W.useCallback(e=>{s(e),Q(e),oe(e)},[]);W.useEffect(()=>{let e=!1;async function t(){let t=Math.round(await J(i)),n=+(await q(i)).toFixed(4);if(e||document.getElementById(`roadie-accent-theme`)?.textContent?.includes(`--accent-hue: ${t}`))return;let r;if(ie)r=`
17
17
  :root {
18
- --accent-hue: ${p};
19
- --accent-chroma: ${E};
18
+ --accent-hue: ${t};
19
+ --accent-chroma: ${n};
20
20
  }
21
- `;else {let b=await generateAccentScale(a),g=await generateNeutralScale(a);if(r)return;let V=b.light.map((n,c)=>`--color-accent-${c}: ${n};`).join(`
22
- `),R=b.dark.map((n,c)=>`--color-accent-${c}: ${n};`).join(`
23
- `),L=g.light.map((n,c)=>`--color-neutral-${c}: ${n};`).join(`
24
- `),F=g.dark.map((n,c)=>`--color-neutral-${c}: ${n};`).join(`
25
- `);f=`
21
+ `;else{let t=await G(i),n=await K(i);if(e)return;let a=t.light.map((e,t)=>`--color-accent-${t}: ${e};`).join(`
22
+ `),o=t.dark.map((e,t)=>`--color-accent-${t}: ${e};`).join(`
23
+ `);r=`
26
24
  :root {
27
- ${L}
28
- ${V}
25
+ ${n.light.map((e,t)=>`--color-neutral-${t}: ${e};`).join(`
26
+ `)}
27
+ ${a}
29
28
  }
30
29
  .dark {
31
- ${F}
32
- ${R}
30
+ ${n.dark.map((e,t)=>`--color-neutral-${t}: ${e};`).join(`
31
+ `)}
32
+ ${o}
33
33
  }
34
- `;}let i=document.getElementById("roadie-accent-theme");i||(i=document.createElement("style"),i.id="roadie-accent-theme",document.head.appendChild(i)),i.textContent=f;}return e(),()=>{r=true;}},[a]);let x=t.useMemo(()=>({accentColor:a,setAccentColor:P,isDark:m,setDark:d}),[a,m,d]);return jsx($.Provider,{value:x,children:o})}function Le(){let o=t.useContext($);if(!o)throw new Error("useTheme must be used within a ThemeProvider");return o}export{Re as ThemeProvider,Ee as getAccentStyleTag,Le as useTheme};//# sourceMappingURL=index.js.map
34
+ `}let a=document.getElementById(`roadie-accent-theme`);a||(a=document.createElement(`style`),a.id=`roadie-accent-theme`,document.head.appendChild(a)),a.textContent=r}return t(),()=>{e=!0}},[i]);let l=W.useMemo(()=>({accentColor:i,setAccentColor:a,isDark:o,setDark:c}),[i,o,c]);return U(Z.Provider,{value:l,children:e})}function ce(){let e=W.useContext(Z);if(!e)throw Error(`useTheme must be used within a ThemeProvider`);return e}export{ee as Accordion,re as Autocomplete,p as Badge,h as Breadcrumb,t as Button,g as Card,a as Code,P as Combobox,k as Field,H as Fieldset,l as Highlight,n as IconButton,T as Input,w as Label,r as LinkButton,i as LinkIconButton,s as Mark,v as Marquee,S as OptionalIndicator,u as Prose,z as RadioGroup,C as RequiredIndicator,M as Select,te as Separator,y as Steps,D as Textarea,se as ThemeProvider,f as accordionVariants,L as autocompleteInputGroupVariants,m as badgeVariants,e as buttonVariants,_ as cardVariants,o as codeVariants,F as comboboxInputGroupVariants,ae as getAccentStyleTag,Y as getThemeScript,E as inputVariants,c as markVariants,d as proseVariants,B as radioGroupItemVariants,V as radioGroupVariants,N as selectTriggerVariants,ne as separatorVariants,b as stepsVariants,O as textareaVariants,A as useFieldContext,j as useFieldInputProps,I as useFilter,R as useFilteredItems,x as useSteps,ce as useTheme};
35
35
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/providers/ThemeProvider.tsx"],"names":["DEFAULT_ACCENT","THEME_STORAGE_KEY","supportsOklch","ThemeContext","getAccentStyleTag","accentHex","id","result","generateAccentScale","neutral","generateNeutralScale","hue","getOklchHue","chroma","getOklchChroma","accentVars","hex","i","darkAccentVars","neutralVars","darkNeutralVars","applyDark","dark","getStoredTheme","storeTheme","ThemeProvider","children","defaultAccentColor","defaultDark","followSystem","accentColor","setAccentColor","isDark","setIsDarkState","stored","prefersDark","domDark","mq","handler","e","setDark","cancelled","updateAccent","css","style","value","jsx","useTheme","context"],"mappings":"shEAaA,IAAMA,EAAAA,CAAiB,SAAA,CACjBC,CAAAA,CAAoB,QAEpBC,EAAAA,CACJ,OAAO,IAAQ,GAAA,EACf,OAAO,IAAI,QAAA,EAAa,UAAA,EACxB,IAAI,QAAA,CAAS,OAAA,CAAS,cAAc,CAAA,CAahCC,CAAAA,CAAqB,gBACzB,MACF,CAAA,CAoBA,eAAsBC,EAAAA,CACpBC,CAAAA,CACAC,CAAAA,CAAK,qBAAA,CACY,CACjB,IAAMC,CAAAA,CAAS,MAAMC,mBAAAA,CAAoBH,CAAS,EAC5CI,CAAAA,CAAU,MAAMC,qBAAqBL,CAAS,CAAA,CAC9CM,EAAM,IAAA,CAAK,KAAA,CAAM,MAAMC,WAAAA,CAAYP,CAAS,CAAC,CAAA,CAC7CQ,CAAAA,CAAS,CAAA,CAAE,MAAMC,eAAeT,CAAS,CAAA,EAAG,QAAQ,CAAC,CAAA,CAGrDU,EAAaR,CAAAA,CAAO,KAAA,CACvB,IAAI,CAACS,CAAAA,CAAKC,IAAM,CAAA,eAAA,EAAkBA,CAAC,KAAKD,CAAG,CAAA,CAAA,CAAG,EAC9C,IAAA,CAAK;AAAA,IAAA,CAAQ,CAAA,CACVE,CAAAA,CAAiBX,CAAAA,CAAO,IAAA,CAC3B,IAAI,CAACS,CAAAA,CAAKC,CAAAA,GAAM,CAAA,eAAA,EAAkBA,CAAC,CAAA,EAAA,EAAKD,CAAG,CAAA,CAAA,CAAG,EAC9C,IAAA,CAAK;AAAA,IAAA,CAAQ,CAAA,CAEVG,CAAAA,CAAcV,CAAAA,CAAQ,KAAA,CACzB,IAAI,CAACO,CAAAA,CAAKC,CAAAA,GAAM,CAAA,gBAAA,EAAmBA,CAAC,CAAA,EAAA,EAAKD,CAAG,CAAA,CAAA,CAAG,EAC/C,IAAA,CAAK;AAAA,IAAA,CAAQ,CAAA,CACVI,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A,CACT","file":"index.js","sourcesContent":["'use client'\n\nimport * as React from 'react'\n\nimport {\n generateAccentScale,\n generateNeutralScale,\n getOklchChroma,\n getOklchHue\n} from '@oztix/roadie-core/colors'\n\nexport { getThemeScript } from '@oztix/roadie-core/theme'\n\nconst DEFAULT_ACCENT = '#0091EB' // Oztix Blue\nconst THEME_STORAGE_KEY = 'theme'\n\nconst supportsOklch =\n typeof CSS !== 'undefined' &&\n typeof CSS.supports === 'function' &&\n CSS.supports('color', 'oklch(0 0 0)')\n\n// ---------------------------------------------------------------------------\n// Theme context (accent color + dark mode)\n// ---------------------------------------------------------------------------\n\ninterface ThemeContextType {\n accentColor: string\n setAccentColor: (color: string) => void\n isDark: boolean\n setDark: (dark: boolean) => void\n}\n\nconst ThemeContext = React.createContext<ThemeContextType | undefined>(\n undefined\n)\n\nexport interface ThemeProviderProps {\n children: React.ReactNode\n defaultAccentColor?: string\n /** Initial dark mode state when no stored preference exists (default: false) */\n defaultDark?: boolean\n /** Respect prefers-color-scheme when no explicit user choice is stored (default: false) */\n followSystem?: boolean\n}\n\n// ---------------------------------------------------------------------------\n// SSR helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Generate a <style> tag string for server-side rendering.\n * Sets --accent-hue and --accent-chroma for CSS-native theming,\n * plus hex fallbacks for older browsers.\n */\nexport async function getAccentStyleTag(\n accentHex: string,\n id = 'roadie-accent-theme'\n): Promise<string> {\n const result = await generateAccentScale(accentHex)\n const neutral = await generateNeutralScale(accentHex)\n const hue = Math.round(await getOklchHue(accentHex))\n const chroma = +(await getOklchChroma(accentHex)).toFixed(4)\n\n // Hex fallbacks for accent (non-oklch browsers)\n const accentVars = result.light\n .map((hex, i) => `--color-accent-${i}: ${hex};`)\n .join('\\n ')\n const darkAccentVars = result.dark\n .map((hex, i) => `--color-accent-${i}: ${hex};`)\n .join('\\n ')\n // Hex fallbacks for neutral (non-oklch browsers)\n const neutralVars = neutral.light\n .map((hex, i) => `--color-neutral-${i}: ${hex};`)\n .join('\\n ')\n const darkNeutralVars = neutral.dark\n .map((hex, i) => `--color-neutral-${i}: ${hex};`)\n .join('\\n ')\n\n const safeId = id.replace(/[<>\"&]/g, '')\n return `<style id=\"${safeId}\">\n :root {\n --accent-hue: ${hue};\n --accent-chroma: ${chroma};\n ${neutralVars}\n ${accentVars}\n }\n .dark {\n ${darkNeutralVars}\n ${darkAccentVars}\n }\n</style>`\n}\n\n// ---------------------------------------------------------------------------\n// Dark mode helpers\n// ---------------------------------------------------------------------------\n\nfunction applyDark(dark: boolean) {\n document.documentElement.classList.toggle('dark', dark)\n document.documentElement.style.colorScheme = dark ? 'dark' : 'light'\n}\n\nfunction getStoredTheme(): string | null {\n try {\n return localStorage.getItem(THEME_STORAGE_KEY)\n } catch {\n return null\n }\n}\n\nfunction storeTheme(dark: boolean) {\n try {\n localStorage.setItem(THEME_STORAGE_KEY, dark ? 'dark' : 'light')\n } catch {\n // localStorage unavailable\n }\n}\n\n// ---------------------------------------------------------------------------\n// ThemeProvider\n// ---------------------------------------------------------------------------\n\nexport function ThemeProvider({\n children,\n defaultAccentColor = DEFAULT_ACCENT,\n defaultDark = false,\n followSystem = false\n}: ThemeProviderProps) {\n const [accentColor, setAccentColor] = React.useState(defaultAccentColor)\n\n // Initialise dark mode from prop — inline script may have already set .dark\n const [isDark, setIsDarkState] = React.useState(defaultDark)\n\n // Sync with DOM on mount\n React.useEffect(() => {\n const stored = getStoredTheme()\n if (stored) {\n setIsDarkState(stored === 'dark')\n return\n }\n\n // No stored preference — check OS preference or DOM state\n if (followSystem) {\n const prefersDark = window.matchMedia(\n '(prefers-color-scheme: dark)'\n ).matches\n setIsDarkState(prefersDark)\n applyDark(prefersDark)\n } else {\n const domDark = document.documentElement.classList.contains('dark')\n setIsDarkState(domDark)\n }\n }, []) // mount-only: followSystem/defaultDark are expected to be static\n\n // Listen for OS preference changes when followSystem is true\n React.useEffect(() => {\n if (!followSystem) return\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)')\n const handler = (e: MediaQueryListEvent) => {\n // Only follow system if user hasn't explicitly chosen\n if (getStoredTheme()) return\n setIsDarkState(e.matches)\n applyDark(e.matches)\n }\n mq.addEventListener('change', handler)\n return () => mq.removeEventListener('change', handler)\n }, [followSystem])\n\n // Explicit toggle — persists to localStorage and applies to DOM\n const setDark = React.useCallback((dark: boolean) => {\n setIsDarkState(dark)\n applyDark(dark)\n storeTheme(dark)\n }, [])\n\n // Accent color effect — skip if SSR already injected matching values\n React.useEffect(() => {\n let cancelled = false\n\n async function updateAccent() {\n const hue = Math.round(await getOklchHue(accentColor))\n const chroma = +(await getOklchChroma(accentColor)).toFixed(4)\n\n if (cancelled) return\n\n // Skip regeneration if existing style tag already has matching values\n const existing = document.getElementById('roadie-accent-theme')\n if (existing?.textContent?.includes(`--accent-hue: ${hue}`)) {\n return\n }\n\n let css: string\n\n if (supportsOklch) {\n css = `\n :root {\n --accent-hue: ${hue};\n --accent-chroma: ${chroma};\n }\n `\n } else {\n const result = await generateAccentScale(accentColor)\n const neutral = await generateNeutralScale(accentColor)\n\n if (cancelled) return\n\n const accentVars = result.light\n .map((hex, i) => `--color-accent-${i}: ${hex};`)\n .join('\\n')\n const darkAccentVars = result.dark\n .map((hex, i) => `--color-accent-${i}: ${hex};`)\n .join('\\n')\n const neutralVars = neutral.light\n .map((hex, i) => `--color-neutral-${i}: ${hex};`)\n .join('\\n')\n const darkNeutralVars = neutral.dark\n .map((hex, i) => `--color-neutral-${i}: ${hex};`)\n .join('\\n')\n\n css = `\n :root {\n ${neutralVars}\n ${accentVars}\n }\n .dark {\n ${darkNeutralVars}\n ${darkAccentVars}\n }\n `\n }\n\n let style = document.getElementById('roadie-accent-theme')\n if (!style) {\n style = document.createElement('style')\n style.id = 'roadie-accent-theme'\n document.head.appendChild(style)\n }\n style.textContent = css\n }\n\n updateAccent()\n return () => {\n cancelled = true\n }\n }, [accentColor])\n\n const value = React.useMemo(\n () => ({ accentColor, setAccentColor, isDark, setDark }),\n [accentColor, isDark, setDark]\n )\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n}\n\n// ---------------------------------------------------------------------------\n// Hooks\n// ---------------------------------------------------------------------------\n\nexport function useTheme() {\n const context = React.useContext(ThemeContext)\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider')\n }\n return context\n}\n"]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/providers/ThemeProvider.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\n\nimport {\n generateAccentScale,\n generateNeutralScale,\n getOklchChroma,\n getOklchHue\n} from '@oztix/roadie-core/colors'\n\nexport { getThemeScript } from '@oztix/roadie-core/theme'\n\nconst DEFAULT_ACCENT = '#0091EB' // Oztix Blue\nconst THEME_STORAGE_KEY = 'theme'\n\nconst supportsOklch =\n typeof CSS !== 'undefined' &&\n typeof CSS.supports === 'function' &&\n CSS.supports('color', 'oklch(0 0 0)')\n\n// ---------------------------------------------------------------------------\n// Theme context (accent color + dark mode)\n// ---------------------------------------------------------------------------\n\ninterface ThemeContextType {\n accentColor: string\n setAccentColor: (color: string) => void\n isDark: boolean\n setDark: (dark: boolean) => void\n}\n\nconst ThemeContext = React.createContext<ThemeContextType | undefined>(\n undefined\n)\n\nexport interface ThemeProviderProps {\n children: React.ReactNode\n defaultAccentColor?: string\n /** Initial dark mode state when no stored preference exists (default: false) */\n defaultDark?: boolean\n /** Respect prefers-color-scheme when no explicit user choice is stored (default: false) */\n followSystem?: boolean\n}\n\n// ---------------------------------------------------------------------------\n// SSR helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Generate a <style> tag string for server-side rendering.\n * Sets --accent-hue and --accent-chroma for CSS-native theming,\n * plus hex fallbacks for older browsers.\n */\nexport async function getAccentStyleTag(\n accentHex: string,\n id = 'roadie-accent-theme'\n): Promise<string> {\n const result = await generateAccentScale(accentHex)\n const neutral = await generateNeutralScale(accentHex)\n const hue = Math.round(await getOklchHue(accentHex))\n const chroma = +(await getOklchChroma(accentHex)).toFixed(4)\n\n // Hex fallbacks for accent (non-oklch browsers)\n const accentVars = result.light\n .map((hex, i) => `--color-accent-${i}: ${hex};`)\n .join('\\n ')\n const darkAccentVars = result.dark\n .map((hex, i) => `--color-accent-${i}: ${hex};`)\n .join('\\n ')\n // Hex fallbacks for neutral (non-oklch browsers)\n const neutralVars = neutral.light\n .map((hex, i) => `--color-neutral-${i}: ${hex};`)\n .join('\\n ')\n const darkNeutralVars = neutral.dark\n .map((hex, i) => `--color-neutral-${i}: ${hex};`)\n .join('\\n ')\n\n const safeId = id.replace(/[<>\"&]/g, '')\n return `<style id=\"${safeId}\">\n :root {\n --accent-hue: ${hue};\n --accent-chroma: ${chroma};\n ${neutralVars}\n ${accentVars}\n }\n .dark {\n ${darkNeutralVars}\n ${darkAccentVars}\n }\n</style>`\n}\n\n// ---------------------------------------------------------------------------\n// Dark mode helpers\n// ---------------------------------------------------------------------------\n\nfunction applyDark(dark: boolean) {\n document.documentElement.classList.toggle('dark', dark)\n document.documentElement.style.colorScheme = dark ? 'dark' : 'light'\n}\n\nfunction getStoredTheme(): string | null {\n try {\n return localStorage.getItem(THEME_STORAGE_KEY)\n } catch {\n return null\n }\n}\n\nfunction storeTheme(dark: boolean) {\n try {\n localStorage.setItem(THEME_STORAGE_KEY, dark ? 'dark' : 'light')\n } catch {\n // localStorage unavailable\n }\n}\n\n// ---------------------------------------------------------------------------\n// ThemeProvider\n// ---------------------------------------------------------------------------\n\nexport function ThemeProvider({\n children,\n defaultAccentColor = DEFAULT_ACCENT,\n defaultDark = false,\n followSystem = false\n}: ThemeProviderProps) {\n const [accentColor, setAccentColor] = React.useState(defaultAccentColor)\n\n // Initialise dark mode from prop — inline script may have already set .dark\n const [isDark, setIsDarkState] = React.useState(defaultDark)\n\n // Sync with DOM on mount\n React.useEffect(() => {\n const stored = getStoredTheme()\n if (stored) {\n setIsDarkState(stored === 'dark')\n return\n }\n\n // No stored preference — check OS preference or DOM state\n if (followSystem) {\n const prefersDark = window.matchMedia(\n '(prefers-color-scheme: dark)'\n ).matches\n setIsDarkState(prefersDark)\n applyDark(prefersDark)\n } else {\n const domDark = document.documentElement.classList.contains('dark')\n setIsDarkState(domDark)\n }\n }, []) // mount-only: followSystem/defaultDark are expected to be static\n\n // Listen for OS preference changes when followSystem is true\n React.useEffect(() => {\n if (!followSystem) return\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)')\n const handler = (e: MediaQueryListEvent) => {\n // Only follow system if user hasn't explicitly chosen\n if (getStoredTheme()) return\n setIsDarkState(e.matches)\n applyDark(e.matches)\n }\n mq.addEventListener('change', handler)\n return () => mq.removeEventListener('change', handler)\n }, [followSystem])\n\n // Explicit toggle — persists to localStorage and applies to DOM\n const setDark = React.useCallback((dark: boolean) => {\n setIsDarkState(dark)\n applyDark(dark)\n storeTheme(dark)\n }, [])\n\n // Accent color effect — skip if SSR already injected matching values\n React.useEffect(() => {\n let cancelled = false\n\n async function updateAccent() {\n const hue = Math.round(await getOklchHue(accentColor))\n const chroma = +(await getOklchChroma(accentColor)).toFixed(4)\n\n if (cancelled) return\n\n // Skip regeneration if existing style tag already has matching values\n const existing = document.getElementById('roadie-accent-theme')\n if (existing?.textContent?.includes(`--accent-hue: ${hue}`)) {\n return\n }\n\n let css: string\n\n if (supportsOklch) {\n css = `\n :root {\n --accent-hue: ${hue};\n --accent-chroma: ${chroma};\n }\n `\n } else {\n const result = await generateAccentScale(accentColor)\n const neutral = await generateNeutralScale(accentColor)\n\n if (cancelled) return\n\n const accentVars = result.light\n .map((hex, i) => `--color-accent-${i}: ${hex};`)\n .join('\\n')\n const darkAccentVars = result.dark\n .map((hex, i) => `--color-accent-${i}: ${hex};`)\n .join('\\n')\n const neutralVars = neutral.light\n .map((hex, i) => `--color-neutral-${i}: ${hex};`)\n .join('\\n')\n const darkNeutralVars = neutral.dark\n .map((hex, i) => `--color-neutral-${i}: ${hex};`)\n .join('\\n')\n\n css = `\n :root {\n ${neutralVars}\n ${accentVars}\n }\n .dark {\n ${darkNeutralVars}\n ${darkAccentVars}\n }\n `\n }\n\n let style = document.getElementById('roadie-accent-theme')\n if (!style) {\n style = document.createElement('style')\n style.id = 'roadie-accent-theme'\n document.head.appendChild(style)\n }\n style.textContent = css\n }\n\n updateAccent()\n return () => {\n cancelled = true\n }\n }, [accentColor])\n\n const value = React.useMemo(\n () => ({ accentColor, setAccentColor, isDark, setDark }),\n [accentColor, isDark, setDark]\n )\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>\n}\n\n// ---------------------------------------------------------------------------\n// Hooks\n// ---------------------------------------------------------------------------\n\nexport function useTheme() {\n const context = React.useContext(ThemeContext)\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider')\n }\n return context\n}\n"],"mappings":"gpDAaA,MACM,EAAoB,QAEpB,GACJ,OAAO,IAAQ,KACf,OAAO,IAAI,UAAa,YACxB,IAAI,SAAS,QAAS,eAAe,CAajC,EAAe,EAAM,cACzB,IAAA,GACD,CAoBD,eAAsB,GACpB,EACA,EAAK,sBACY,CACjB,IAAM,EAAS,MAAM,EAAoB,EAAU,CAC7C,EAAU,MAAM,EAAqB,EAAU,CAC/C,EAAM,KAAK,MAAM,MAAM,EAAY,EAAU,CAAC,CAC9C,EAAS,EAAE,MAAM,EAAe,EAAU,EAAE,QAAQ,EAAE,CAGtD,EAAa,EAAO,MACvB,KAAK,EAAK,IAAM,kBAAkB,EAAE,IAAI,EAAI,GAAG,CAC/C,KAAK;MAAS,CACX,EAAiB,EAAO,KAC3B,KAAK,EAAK,IAAM,kBAAkB,EAAE,IAAI,EAAI,GAAG,CAC/C,KAAK;MAAS,CAEX,EAAc,EAAQ,MACzB,KAAK,EAAK,IAAM,mBAAmB,EAAE,IAAI,EAAI,GAAG,CAChD,KAAK;MAAS,CACX,EAAkB,EAAQ,KAC7B,KAAK,EAAK,IAAM,mBAAmB,EAAE,IAAI,EAAI,GAAG,CAChD,KAAK;MAAS,CAGjB,MAAO,cADQ,EAAG,QAAQ,UAAW,GAAG,CACZ;;oBAEV,EAAI;uB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2 @@
1
+ const e={neutral:`intent-neutral`,brand:`intent-brand`,"brand-secondary":`intent-brand-secondary`,accent:`intent-accent`,danger:`intent-danger`,success:`intent-success`,warning:`intent-warning`,info:`intent-info`};export{e as t};
2
+ //# sourceMappingURL=variants-DTAwzBl3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants-DTAwzBl3.js","names":[],"sources":["../src/variants.ts"],"sourcesContent":["/**\n * Shared CVA variant maps used across multiple components.\n */\nexport const intentVariants = {\n neutral: 'intent-neutral',\n brand: 'intent-brand',\n 'brand-secondary': 'intent-brand-secondary',\n accent: 'intent-accent',\n danger: 'intent-danger',\n success: 'intent-success',\n warning: 'intent-warning',\n info: 'intent-info'\n} as const\n"],"mappings":"AAGA,MAAa,EAAiB,CAC5B,QAAS,iBACT,MAAO,eACP,kBAAmB,yBACnB,OAAQ,gBACR,OAAQ,gBACR,QAAS,iBACT,QAAS,iBACT,KAAM,cACP"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oztix/roadie-components",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "React components for the Roadie Design System",
5
5
  "type": "module",
6
6
  "repository": {
@@ -36,7 +36,7 @@
36
36
  "react-dom": "^19.0.0"
37
37
  },
38
38
  "dependencies": {
39
- "@oztix/roadie-core": "2.0.0"
39
+ "@oztix/roadie-core": "2.0.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@arethetypeswrong/cli": "0.18.2",
@@ -57,7 +57,7 @@
57
57
  "jsdom": "27.0.1",
58
58
  "size-limit": "12.0.1",
59
59
  "svgo": "4.0.0",
60
- "tsup": "8.5.0",
60
+ "tsdown": "0.21.7",
61
61
  "vitest": "4.0.4"
62
62
  },
63
63
  "author": {
@@ -76,12 +76,13 @@
76
76
  }
77
77
  },
78
78
  "scripts": {
79
- "build": "tsup && pnpm check:dts && pnpm check:exports",
79
+ "build": "tsdown && pnpm check:dts && pnpm check:exports",
80
+ "build:quiet": "tsdown --log-level warn",
80
81
  "check:dts": "! grep -r 'ComponentProps<typeof' dist/*.d.ts dist/**/*.d.ts 2>/dev/null || (echo 'ERROR: dist .d.ts files contain ComponentProps<typeof> — use named prop types instead' && exit 1)",
81
82
  "check:exports": "attw --pack . --profile esm-only",
82
83
  "build:spotillustration": "node scripts/svg-to-spot-illustration.cjs",
83
84
  "clean": "rm -rf node_modules dist",
84
- "dev": "tsup --watch",
85
+ "dev": "tsdown --watch --log-level warn",
85
86
  "test": "vitest run",
86
87
  "test:watch": "vitest",
87
88
  "test:coverage": "vitest run --coverage",
@@ -1,18 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as class_variance_authority_types from 'class-variance-authority/types';
3
- import { RefAttributes } from 'react';
4
- import { Button as Button$1 } from '@base-ui/react/button';
5
- import { VariantProps } from 'class-variance-authority';
6
-
7
- declare const buttonVariants: (props?: ({
8
- intent?: "neutral" | "brand" | "brand-secondary" | "accent" | "danger" | "success" | "warning" | "info" | null | undefined;
9
- emphasis?: "strong" | "normal" | "subtle" | "subtler" | null | undefined;
10
- size?: "xs" | "sm" | "md" | "lg" | "icon-xs" | "icon-sm" | "icon-md" | "icon-lg" | null | undefined;
11
- } & class_variance_authority_types.ClassProp) | undefined) => string;
12
- type ButtonProps = Button$1.Props & RefAttributes<HTMLElement> & VariantProps<typeof buttonVariants>;
13
- declare function Button({ className, intent, emphasis, size, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
14
- declare namespace Button {
15
- var displayName: string;
16
- }
17
-
18
- export { Button as B, type ButtonProps as a, buttonVariants as b };
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"Button.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"LinkButton.js"}
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-NRVNUMJE.js';import {cn}from'@oztix/roadie-core/utils';import {jsx}from'react/jsx-runtime';function p({as:n,className:o,intent:e,emphasis:i,size:s,...a$1}){return jsx(n||"a",{className:cn(a({intent:e,emphasis:i,size:s,className:o})),...a$1})}p.displayName="LinkButton";function r({as:n,className:o,intent:e,emphasis:i,size:s="icon-md",...a$1}){return jsx(n||"a",{className:cn(a({intent:e,emphasis:i,size:s,className:o})),...a$1})}r.displayName="LinkIconButton";export{p as a,r as b};//# sourceMappingURL=chunk-3H22EQQ6.js.map
2
- //# sourceMappingURL=chunk-3H22EQQ6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/LinkButton/LinkButton.tsx","../../src/components/LinkButton/LinkIconButton.tsx"],"names":["LinkButton","as","className","intent","emphasis","size","props","jsx","cn","buttonVariants","LinkIconButton"],"mappings":"kHAkBO,SAASA,CAAAA,CAAwC,CACtD,EAAA,CAAAC,CAAAA,CACA,UAAAC,CAAAA,CACA,MAAA,CAAAC,EACA,QAAA,CAAAC,CAAAA,CACA,KAAAC,CAAAA,CACA,GAAGC,GACL,CAAA,CAAuB,CAErB,OACEC,IAFgBN,CAAAA,EAAM,GAAA,CAErB,CACC,SAAA,CAAWO,EAAAA,CAAGC,EAAe,CAAE,MAAA,CAAAN,CAAAA,CAAQ,QAAA,CAAAC,CAAAA,CAAU,IAAA,CAAAC,EAAM,SAAA,CAAAH,CAAU,CAAC,CAAC,CAAA,CAClE,GAAGI,GAAAA,CACN,CAEJ,CAEAN,CAAAA,CAAW,WAAA,CAAc,YAAA,CCblB,SAASU,CAAAA,CAA4C,CAC1D,EAAA,CAAAT,CAAAA,CACA,SAAA,CAAAC,EACA,MAAA,CAAAC,CAAAA,CACA,SAAAC,CAAAA,CACA,IAAA,CAAAC,EAAO,SAAA,CACP,GAAGC,GACL,CAAA,CAA2B,CAEzB,OACEC,IAFgBN,CAAAA,EAAM,GAAA,CAErB,CACC,SAAA,CAAWO,EAAAA,CAAGC,EAAe,CAAE,MAAA,CAAAN,CAAAA,CAAQ,QAAA,CAAAC,CAAAA,CAAU,IAAA,CAAAC,EAAM,SAAA,CAAAH,CAAU,CAAC,CAAC,CAAA,CAClE,GAAGI,GAAAA,CACN,CAEJ,CAEAI,CAAAA,CAAe,WAAA,CAAc,gBAAA","file":"chunk-3H22EQQ6.js","sourcesContent":["import type { ComponentProps, ElementType } from 'react'\n\nimport type { VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { buttonVariants } from '../Button/Button'\n\ntype LinkButtonSize = 'xs' | 'sm' | 'md' | 'lg'\n\nexport type LinkButtonProps<T extends ElementType = 'a'> = {\n as?: T\n intent?: VariantProps<typeof buttonVariants>['intent']\n emphasis?: VariantProps<typeof buttonVariants>['emphasis']\n size?: LinkButtonSize\n className?: string\n} & Omit<ComponentProps<T>, 'as' | 'intent' | 'emphasis' | 'size' | 'className'>\n\nexport function LinkButton<T extends ElementType = 'a'>({\n as,\n className,\n intent,\n emphasis,\n size,\n ...props\n}: LinkButtonProps<T>) {\n const Component = as || 'a'\n return (\n <Component\n className={cn(buttonVariants({ intent, emphasis, size, className }))}\n {...props}\n />\n )\n}\n\nLinkButton.displayName = 'LinkButton'\n","import type { ComponentProps, ElementType } from 'react'\n\nimport type { VariantProps } from 'class-variance-authority'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { buttonVariants } from '../Button/Button'\n\ntype LinkIconButtonSize = 'icon-xs' | 'icon-sm' | 'icon-md' | 'icon-lg'\n\nexport type LinkIconButtonProps<T extends ElementType = 'a'> = {\n as?: T\n 'aria-label': string\n intent?: VariantProps<typeof buttonVariants>['intent']\n emphasis?: VariantProps<typeof buttonVariants>['emphasis']\n size?: LinkIconButtonSize\n className?: string\n} & Omit<\n ComponentProps<T>,\n 'as' | 'aria-label' | 'intent' | 'emphasis' | 'size' | 'className'\n>\n\nexport function LinkIconButton<T extends ElementType = 'a'>({\n as,\n className,\n intent,\n emphasis,\n size = 'icon-md',\n ...props\n}: LinkIconButtonProps<T>) {\n const Component = as || 'a'\n return (\n <Component\n className={cn(buttonVariants({ intent, emphasis, size, className }))}\n {...props}\n />\n )\n}\n\nLinkIconButton.displayName = 'LinkIconButton'\n"]}
@@ -1,3 +0,0 @@
1
- "use client";
2
- import {createContext,use}from'react';import {cn}from'@oztix/roadie-core/utils';import {jsx}from'react/jsx-runtime';var n=createContext({});function l({className:e,invalid:t,...r}){return jsx(n,{value:{invalid:t},children:jsx("fieldset",{className:cn("m-0 border-none p-0 [&>*+*]:mt-6",e),...r})})}l.displayName="Fieldset";function i({className:e,...t}){return jsx("legend",{className:cn("text-lg font-semibold text-strong",e),...t})}i.displayName="Fieldset.Legend";function d({className:e,...t}){return jsx("p",{className:cn("text-sm text-subtle",e),...t})}d.displayName="Fieldset.HelperText";function p({className:e,...t}){let{invalid:r}=use(n);return r?jsx("p",{role:"alert",className:cn("text-sm text-subtle intent-danger",e),...t}):null}p.displayName="Fieldset.ErrorText";var c=Object.assign(l,{Legend:i,HelperText:d,ErrorText:p});export{c as a};//# sourceMappingURL=chunk-42UB7PQB.js.map
3
- //# sourceMappingURL=chunk-42UB7PQB.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Fieldset/index.tsx"],"names":["FieldsetContext","createContext","FieldsetRoot","className","invalid","props","jsx","cn","FieldsetLegend","FieldsetHelperText","FieldsetErrorText","use","Fieldset"],"mappings":"oHAYA,IAAMA,CAAAA,CAAkBC,cAAoC,EAAE,CAAA,CAQ9D,SAASC,CAAAA,CAAa,CAAE,SAAA,CAAAC,CAAAA,CAAW,QAAAC,CAAAA,CAAS,GAAGC,CAAM,CAAA,CAAsB,CACzE,OACEC,GAAAA,CAACN,CAAAA,CAAA,CAAgB,MAAO,CAAE,OAAA,CAAAI,CAAQ,CAAA,CAChC,QAAA,CAAAE,GAAAA,CAAC,UAAA,CAAA,CACC,SAAA,CAAWC,GAAG,kCAAA,CAAoCJ,CAAS,CAAA,CAC1D,GAAGE,EACN,CAAA,CACF,CAEJ,CAEAH,CAAAA,CAAa,YAAc,UAAA,CAM3B,SAASM,CAAAA,CAAe,CAAE,UAAAL,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAwB,CACpE,OACEC,GAAAA,CAAC,QAAA,CAAA,CACC,SAAA,CAAWC,GAAG,mCAAA,CAAqCJ,CAAS,CAAA,CAC3D,GAAGE,EACN,CAEJ,CAEAG,CAAAA,CAAe,WAAA,CAAc,iBAAA,CAM7B,SAASC,CAAAA,CAAmB,CAAE,UAAAN,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAA4B,CAC5E,OAAOC,GAAAA,CAAC,GAAA,CAAA,CAAE,SAAA,CAAWC,GAAG,qBAAA,CAAuBJ,CAAS,CAAA,CAAI,GAAGE,CAAAA,CAAO,CACxE,CAEAI,CAAAA,CAAmB,YAAc,qBAAA,CAMjC,SAASC,CAAAA,CAAkB,CAAE,UAAAP,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAA2B,CAC1E,GAAM,CAAE,OAAA,CAAAD,CAAQ,CAAA,CAAIO,GAAAA,CAAIX,CAAe,CAAA,CACvC,OAAKI,CAAAA,CAEHE,GAAAA,CAAC,GAAA,CAAA,CACC,IAAA,CAAK,QACL,SAAA,CAAWC,EAAAA,CAAG,mCAAA,CAAqCJ,CAAS,EAC3D,GAAGE,CAAAA,CACN,CAAA,CANmB,IAQvB,CAEAK,CAAAA,CAAkB,WAAA,CAAc,oBAAA,CAIzB,IAAME,EAAW,MAAA,CAAO,MAAA,CAAOV,CAAAA,CAAc,CAClD,OAAQM,CAAAA,CACR,UAAA,CAAYC,CAAAA,CACZ,SAAA,CAAWC,CACb,CAAC","file":"chunk-42UB7PQB.js","sourcesContent":["'use client'\n\nimport { type ComponentProps, createContext, use } from 'react'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\n/* ─── Context ─── */\n\ninterface FieldsetContextValue {\n invalid?: boolean\n}\n\nconst FieldsetContext = createContext<FieldsetContextValue>({})\n\n/* ─── Root ─── */\n\nexport interface FieldsetRootProps extends ComponentProps<'fieldset'> {\n invalid?: boolean\n}\n\nfunction FieldsetRoot({ className, invalid, ...props }: FieldsetRootProps) {\n return (\n <FieldsetContext value={{ invalid }}>\n <fieldset\n className={cn('m-0 border-none p-0 [&>*+*]:mt-6', className)}\n {...props}\n />\n </FieldsetContext>\n )\n}\n\nFieldsetRoot.displayName = 'Fieldset'\n\n/* ─── Legend ─── */\n\nexport interface FieldsetLegendProps extends ComponentProps<'legend'> {}\n\nfunction FieldsetLegend({ className, ...props }: FieldsetLegendProps) {\n return (\n <legend\n className={cn('text-lg font-semibold text-strong', className)}\n {...props}\n />\n )\n}\n\nFieldsetLegend.displayName = 'Fieldset.Legend'\n\n/* ─── Helper text ─── */\n\nexport interface FieldsetHelperTextProps extends ComponentProps<'p'> {}\n\nfunction FieldsetHelperText({ className, ...props }: FieldsetHelperTextProps) {\n return <p className={cn('text-sm text-subtle', className)} {...props} />\n}\n\nFieldsetHelperText.displayName = 'Fieldset.HelperText'\n\n/* ─── Error text ─── */\n\nexport interface FieldsetErrorTextProps extends ComponentProps<'p'> {}\n\nfunction FieldsetErrorText({ className, ...props }: FieldsetErrorTextProps) {\n const { invalid } = use(FieldsetContext)\n if (!invalid) return null\n return (\n <p\n role='alert'\n className={cn('text-sm text-subtle intent-danger', className)}\n {...props}\n />\n )\n}\n\nFieldsetErrorText.displayName = 'Fieldset.ErrorText'\n\n/* ─── Compound export ─── */\n\nexport const Fieldset = Object.assign(FieldsetRoot, {\n Legend: FieldsetLegend,\n HelperText: FieldsetHelperText,\n ErrorText: FieldsetErrorText\n})\n\nexport type FieldsetProps = FieldsetRootProps\n"]}
@@ -1,3 +0,0 @@
1
- "use client";
2
- var n={neutral:"intent-neutral",brand:"intent-brand","brand-secondary":"intent-brand-secondary",accent:"intent-accent",danger:"intent-danger",success:"intent-success",warning:"intent-warning",info:"intent-info"};export{n as a};//# sourceMappingURL=chunk-4LGCF3SN.js.map
3
- //# sourceMappingURL=chunk-4LGCF3SN.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/variants.ts"],"names":["intentVariants"],"mappings":"AAGO,IAAMA,EAAiB,CAC5B,OAAA,CAAS,gBAAA,CACT,KAAA,CAAO,eACP,iBAAA,CAAmB,wBAAA,CACnB,MAAA,CAAQ,eAAA,CACR,OAAQ,eAAA,CACR,OAAA,CAAS,iBACT,OAAA,CAAS,gBAAA,CACT,KAAM,aACR","file":"chunk-4LGCF3SN.js","sourcesContent":["/**\n * Shared CVA variant maps used across multiple components.\n */\nexport const intentVariants = {\n neutral: 'intent-neutral',\n brand: 'intent-brand',\n 'brand-secondary': 'intent-brand-secondary',\n accent: 'intent-accent',\n danger: 'intent-danger',\n success: 'intent-success',\n warning: 'intent-warning',\n info: 'intent-info'\n} as const\n"]}
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-4LGCF3SN.js';import {cva}from'class-variance-authority';import {cn}from'@oztix/roadie-core/utils';import {jsxs,jsx}from'react/jsx-runtime';var d=cva("inline-flex items-center justify-center rounded-full font-semibold whitespace-nowrap gap-1 [&_svg]:size-[1em] [&_svg]:shrink-0",{variants:{intent:a,emphasis:{strong:"emphasis-strong",normal:"emphasis-normal text-subtle",subtle:"emphasis-subtle text-subtle",subtler:"emphasis-subtler text-subtle"},size:{sm:"px-2 py-0.5 text-xs",md:"px-2.5 py-0.5 text-sm"}},defaultVariants:{emphasis:"normal",size:"md"}});function u({className:t,intent:a,emphasis:n,size:r,indicator:i,indicatorPulse:o,children:p,...m}){return jsxs("span",{className:cn(d({intent:a,emphasis:n,size:r,className:t})),...m,children:[i&&jsx("span",{className:cn("size-1.5 shrink-0 rounded-full bg-current",o&&"animate-pulse"),"aria-hidden":"true"}),p]})}u.displayName="Badge";export{d as a,u as b};//# sourceMappingURL=chunk-AFSDN4WI.js.map
2
- //# sourceMappingURL=chunk-AFSDN4WI.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Badge/index.tsx"],"names":["badgeVariants","cva","intentVariants","Badge","className","intent","emphasis","size","indicator","indicatorPulse","children","props","jsxs","cn","jsx"],"mappings":"kKAQO,IAAMA,CAAAA,CAAgBC,GAAAA,CAC3B,gIAAA,CACA,CACE,QAAA,CAAU,CACR,MAAA,CAAQC,CAAAA,CACR,QAAA,CAAU,CACR,MAAA,CAAQ,iBAAA,CACR,OAAQ,6BAAA,CACR,MAAA,CAAQ,6BAAA,CACR,OAAA,CAAS,8BACX,CAAA,CACA,KAAM,CACJ,EAAA,CAAI,qBAAA,CACJ,EAAA,CAAI,uBACN,CACF,EACA,eAAA,CAAiB,CACf,QAAA,CAAU,QAAA,CACV,IAAA,CAAM,IACR,CACF,CACF,EAWO,SAASC,CAAAA,CAAM,CACpB,SAAA,CAAAC,EACA,MAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,UAAAC,CAAAA,CACA,cAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAAe,CACb,OACEC,IAAAA,CAAC,MAAA,CAAA,CACC,SAAA,CAAWC,GAAGb,CAAAA,CAAc,CAAE,MAAA,CAAAK,CAAAA,CAAQ,QAAA,CAAAC,CAAAA,CAAU,KAAAC,CAAAA,CAAM,SAAA,CAAAH,CAAU,CAAC,CAAC,CAAA,CACjE,GAAGO,CAAAA,CAEH,QAAA,CAAA,CAAAH,CAAAA,EACCM,GAAAA,CAAC,MAAA,CAAA,CACC,SAAA,CAAWD,GACT,2CAAA,CACAJ,CAAAA,EAAkB,eACpB,CAAA,CACA,aAAA,CAAY,MAAA,CACd,EAEDC,CAAAA,CAAAA,CACH,CAEJ,CAEAP,CAAAA,CAAM,WAAA,CAAc,OAAA","file":"chunk-AFSDN4WI.js","sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { intentVariants } from '../../variants'\n\nexport const badgeVariants = cva(\n 'inline-flex items-center justify-center rounded-full font-semibold whitespace-nowrap gap-1 [&_svg]:size-[1em] [&_svg]:shrink-0',\n {\n variants: {\n intent: intentVariants,\n emphasis: {\n strong: 'emphasis-strong',\n normal: 'emphasis-normal text-subtle',\n subtle: 'emphasis-subtle text-subtle',\n subtler: 'emphasis-subtler text-subtle'\n },\n size: {\n sm: 'px-2 py-0.5 text-xs',\n md: 'px-2.5 py-0.5 text-sm'\n }\n },\n defaultVariants: {\n emphasis: 'normal',\n size: 'md'\n }\n }\n)\n\nexport interface BadgeProps\n extends ComponentProps<'span'>,\n VariantProps<typeof badgeVariants> {\n /** Show a dot indicator before the text */\n indicator?: boolean\n /** Animate the indicator with a slow pulse */\n indicatorPulse?: boolean\n}\n\nexport function Badge({\n className,\n intent,\n emphasis,\n size,\n indicator,\n indicatorPulse,\n children,\n ...props\n}: BadgeProps) {\n return (\n <span\n className={cn(badgeVariants({ intent, emphasis, size, className }))}\n {...props}\n >\n {indicator && (\n <span\n className={cn(\n 'size-1.5 shrink-0 rounded-full bg-current',\n indicatorPulse && 'animate-pulse'\n )}\n aria-hidden='true'\n />\n )}\n {children}\n </span>\n )\n}\n\nBadge.displayName = 'Badge'\n"]}
@@ -1,3 +0,0 @@
1
- "use client";
2
- import {a as a$1}from'./chunk-N2HGY7W7.js';import {a as a$2,b as b$1}from'./chunk-LMV3JECI.js';import {a}from'./chunk-4LGCF3SN.js';import {createContext,use}from'react';import {Select}from'@base-ui/react/select';import {CaretDownIcon,CaretUpIcon,CheckIcon}from'@phosphor-icons/react';import {cva}from'class-variance-authority';import {cn}from'@oztix/roadie-core/utils';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var c=createContext({}),F=cva("inline-flex w-full items-center justify-between rounded-lg font-sans select-none cursor-pointer text-left data-[popup-open]:bg-[var(--color-accent-2)] data-[popup-open]:border-[var(--color-accent-9)] data-[popup-open]:outline-[length:var(--focus-ring-width)]",{variants:{intent:a,emphasis:{normal:"emphasis-raised border border-normal is-interactive-field",subtle:"bg-subtle text-normal border border-transparent is-interactive-field"},size:{sm:"h-8 px-1.5 text-base",md:"h-10 px-2 text-base",lg:"h-12 px-2 text-base"}},defaultVariants:{emphasis:"normal",size:"md"}});function w({invalid:e,required:t,...i}){let n=a$1(),p=e??n.invalid,a=t??n.required;return jsx(c,{value:{invalid:p,required:a},children:jsx(Select.Root,{...i})})}w.displayName="Select";function N({className:e,intent:t,emphasis:i,size:n,...p}){let a=a$1(),{invalid:y}=use(c),q=!!a.fieldId;return jsx(Select.Trigger,{className:cn(F({intent:t,emphasis:i,size:n,className:e})),...q&&{"aria-labelledby":a.labelId||void 0,"aria-describedby":y?a.errorTextId||void 0:a.helperTextId||void 0,"aria-invalid":y||void 0,"aria-required":a.required||void 0},...p})}N.displayName="Select.Trigger";function A({className:e,...t}){return jsx(Select.Value,{className:cn("truncate data-[placeholder]:text-subtle",e),...t})}A.displayName="Select.Value";function L({className:e,children:t,...i}){return jsx(Select.Icon,{className:cn("duration-moderate ml-2 shrink-0 text-subtle transition-transform data-[popup-open]:rotate-180",e),...i,children:t??jsx(CaretDownIcon,{weight:"bold",className:"size-4"})})}L.displayName="Select.Icon";function d(e){return jsx(Select.Portal,{...e})}d.displayName="Select.Portal";function P({className:e,...t}){return jsx(Select.Positioner,{className:cn("z-50",e),alignItemWithTrigger:false,...t})}P.displayName="Select.Positioner";function x({className:e,...t}){return jsx(Select.Popup,{className:cn("max-h-[var(--available-height)] max-w-[var(--available-width)] min-w-[var(--anchor-width)] overflow-y-auto rounded-xl border border-[var(--intent-border-subtle)] bg-raised p-1 shadow-lg","origin-[var(--transform-origin)] transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0",e),...t})}x.displayName="Select.Popup";function h({className:e,children:t,...i}){let n=typeof t=="string"||typeof t=="number"?jsxs(Fragment,{children:[jsx(f,{children:t}),jsx(b,{})]}):t;return jsx(Select.Item,{className:cn("flex w-full min-w-0 cursor-pointer items-center justify-between gap-2 rounded-lg px-2 py-1.5 text-sm text-normal outline-none select-none","data-[highlighted]:bg-subtle",e),...i,children:n})}h.displayName="Select.Item";function f(e){return jsx(Select.ItemText,{...e})}f.displayName="Select.ItemText";function b({className:e,children:t,...i}){return jsx(Select.ItemIndicator,{className:cn("shrink-0 text-subtle",e),...i,children:t??jsx(CheckIcon,{weight:"bold",className:"size-4"})})}b.displayName="Select.ItemIndicator";function R({className:e,...t}){return jsx(Select.Group,{className:cn("[&+&]:mt-1",e),...t})}R.displayName="Select.Group";function C({className:e,...t}){return jsx(Select.GroupLabel,{className:cn("px-2 py-1.5 text-xs font-medium text-subtle select-none",e),...t})}C.displayName="Select.GroupLabel";function E({className:e,showIndicator:t,children:i,...n}){let{required:p}=use(c);return jsxs(Select.Label,{className:cn("flex items-center gap-1 text-sm font-medium text-normal",e),...n,children:[i,t&&(p?jsxs(Fragment,{children:[" ",jsx(a$2,{})]}):jsxs(Fragment,{children:[" ",jsx(b$1,{})]}))]})}E.displayName="Select.Label";function H({className:e,...t}){return jsx(Select.ScrollUpArrow,{className:cn("flex items-center justify-center py-1 text-subtle",e),...t,children:jsx(CaretUpIcon,{weight:"bold",className:"size-3"})})}H.displayName="Select.ScrollUpArrow";function D({className:e,...t}){return jsx(Select.ScrollDownArrow,{className:cn("flex items-center justify-center py-1 text-subtle",e),...t,children:jsx(CaretDownIcon,{weight:"bold",className:"size-3"})})}D.displayName="Select.ScrollDownArrow";function V({className:e,...t}){return jsx("p",{className:cn("text-sm text-subtle",e),...t})}V.displayName="Select.HelperText";function G({className:e,...t}){let{invalid:i}=use(c);return i?jsx("p",{role:"alert",className:cn("text-sm text-subtle intent-danger",e),...t}):null}G.displayName="Select.ErrorText";function M({children:e,...t}){return jsx(d,{children:jsx(P,{children:jsx(x,{...t,children:e})})})}M.displayName="Select.Content";var _=Object.assign(w,{Trigger:N,Value:A,Icon:L,Portal:d,Positioner:P,Popup:x,Content:M,Item:h,ItemText:f,ItemIndicator:b,Group:R,GroupLabel:C,Label:E,HelperText:V,ErrorText:G,ScrollUpArrow:H,ScrollDownArrow:D});export{F as a,w as b,N as c,A as d,L as e,d as f,P as g,x as h,h as i,f as j,b as k,R as l,C as m,E as n,H as o,D as p,V as q,G as r,M as s,_ as t};//# sourceMappingURL=chunk-BQEJDV7D.js.map
3
- //# sourceMappingURL=chunk-BQEJDV7D.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Select/index.tsx"],"names":["SelectContext","createContext","selectTriggerVariants","cva","intentVariants","SelectRoot","invalid","required","props","fieldContext","useFieldContext","resolvedInvalid","resolvedRequired","jsx","SelectPrimitive","SelectTrigger","className","intent","emphasis","size","use","inField","cn","SelectValue","SelectIcon","children","CaretDownIcon","SelectPortal","SelectPositioner","SelectPopup","SelectItem","content","jsxs","Fragment","SelectItemText","SelectItemIndicator","CheckIcon","SelectGroup","SelectGroupLabel","SelectLabel","showIndicator","RequiredIndicator","OptionalIndicator","SelectScrollUpArrow","CaretUpIcon","SelectScrollDownArrow","SelectHelperText","SelectErrorText","SelectContent","Select"],"mappings":"uaA2BMA,CAAAA,CAAgBC,aAAAA,CAAkC,EAAE,CAAA,CAI7CC,EAAwBC,GAAAA,CACnC,oQAAA,CACA,CACE,QAAA,CAAU,CACR,OAAQC,CAAAA,CACR,QAAA,CAAU,CACR,MAAA,CAAQ,2DAAA,CACR,OACE,sEACJ,CAAA,CACA,KAAM,CACJ,EAAA,CAAI,uBACJ,EAAA,CAAI,qBAAA,CACJ,GAAI,qBACN,CACF,EACA,eAAA,CAAiB,CACf,SAAU,QAAA,CACV,IAAA,CAAM,IACR,CACF,CACF,EASO,SAASC,CAAAA,CAAW,CAAE,OAAA,CAAAC,CAAAA,CAAS,SAAAC,CAAAA,CAAU,GAAGC,CAAM,CAAA,CAAoB,CAC3E,IAAMC,CAAAA,CAAeC,GAAAA,GACfC,CAAAA,CAAkBL,CAAAA,EAAWG,EAAa,OAAA,CAC1CG,CAAAA,CAAmBL,CAAAA,EAAYE,CAAAA,CAAa,SAElD,OACEI,GAAAA,CAACb,EAAA,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ACN,QAAA,CAAUI,CAAAA,CACV,cAAeC,CAAAA,CACf,KAAA,CAAOE,EACP,UAAA,CAAYC,CAAAA,CACZ,MAAOC,CAAAA,CACP,UAAA,CAAYO,EACZ,SAAA,CAAWC,CAAAA,CACX,cAAeJ,CAAAA,CACf,eAAA,CAAiBE,CACnB,CAAC","file":"chunk-BQEJDV7D.js","sourcesContent":["'use client'\n\nimport {\n type ComponentProps,\n type RefAttributes,\n createContext,\n use\n} from 'react'\n\nimport { Select as SelectPrimitive } from '@base-ui/react/select'\nimport { CaretDownIcon, CaretUpIcon, CheckIcon } from '@phosphor-icons/react'\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { intentVariants } from '../../variants'\nimport { useFieldContext } from '../Field'\nimport { OptionalIndicator } from '../Indicator'\nimport { RequiredIndicator } from '../Indicator'\n\n/* ─── Context ─── */\n\ninterface SelectContextValue {\n invalid?: boolean\n required?: boolean\n}\n\nconst SelectContext = createContext<SelectContextValue>({})\n\n/* ─── Trigger variants (matches Input) ─── */\n\nexport const selectTriggerVariants = cva(\n 'inline-flex w-full items-center justify-between rounded-lg font-sans select-none cursor-pointer text-left data-[popup-open]:bg-[var(--color-accent-2)] data-[popup-open]:border-[var(--color-accent-9)] data-[popup-open]:outline-[length:var(--focus-ring-width)]',\n {\n variants: {\n intent: intentVariants,\n emphasis: {\n normal: 'emphasis-raised border border-normal is-interactive-field',\n subtle:\n 'bg-subtle text-normal border border-transparent is-interactive-field'\n },\n size: {\n sm: 'h-8 px-1.5 text-base',\n md: 'h-10 px-2 text-base',\n lg: 'h-12 px-2 text-base'\n }\n },\n defaultVariants: {\n emphasis: 'normal',\n size: 'md'\n }\n }\n)\n\n/* ─── Root ─── */\n\nexport type SelectRootProps = SelectPrimitive.Root.Props<unknown> & {\n invalid?: boolean\n required?: boolean\n}\n\nexport function SelectRoot({ invalid, required, ...props }: SelectRootProps) {\n const fieldContext = useFieldContext()\n const resolvedInvalid = invalid ?? fieldContext.invalid\n const resolvedRequired = required ?? fieldContext.required\n\n return (\n <SelectContext\n value={{ invalid: resolvedInvalid, required: resolvedRequired }}\n >\n <SelectPrimitive.Root {...props} />\n </SelectContext>\n )\n}\n\nSelectRoot.displayName = 'Select'\n\n/* ─── Trigger ─── */\n\nexport type SelectTriggerProps = SelectPrimitive.Trigger.Props &\n RefAttributes<HTMLButtonElement> &\n VariantProps<typeof selectTriggerVariants>\n\nexport function SelectTrigger({\n className,\n intent,\n emphasis,\n size,\n ...props\n}: SelectTriggerProps) {\n const fieldContext = useFieldContext()\n const { invalid } = use(SelectContext)\n const inField = !!fieldContext.fieldId\n\n return (\n <SelectPrimitive.Trigger\n className={cn(\n selectTriggerVariants({ intent, emphasis, size, className })\n )}\n {...(inField && {\n 'aria-labelledby': fieldContext.labelId || undefined,\n 'aria-describedby': invalid\n ? fieldContext.errorTextId || undefined\n : fieldContext.helperTextId || undefined,\n 'aria-invalid': invalid || undefined,\n 'aria-required': fieldContext.required || undefined\n })}\n {...props}\n />\n )\n}\n\nSelectTrigger.displayName = 'Select.Trigger'\n\n/* ─── Value ─── */\n\nexport type SelectValueProps = SelectPrimitive.Value.Props &\n RefAttributes<HTMLSpanElement>\n\nexport function SelectValue({ className, ...props }: SelectValueProps) {\n return (\n <SelectPrimitive.Value\n className={cn('truncate data-[placeholder]:text-subtle', className)}\n {...props}\n />\n )\n}\n\nSelectValue.displayName = 'Select.Value'\n\n/* ─── Icon ─── */\n\nexport type SelectIconProps = SelectPrimitive.Icon.Props &\n RefAttributes<HTMLSpanElement>\n\nexport function SelectIcon({ className, children, ...props }: SelectIconProps) {\n return (\n <SelectPrimitive.Icon\n className={cn(\n 'duration-moderate ml-2 shrink-0 text-subtle transition-transform data-[popup-open]:rotate-180',\n className\n )}\n {...props}\n >\n {children ?? <CaretDownIcon weight='bold' className='size-4' />}\n </SelectPrimitive.Icon>\n )\n}\n\nSelectIcon.displayName = 'Select.Icon'\n\n/* ─── Portal ─── */\n\nexport type SelectPortalProps = SelectPrimitive.Portal.Props &\n RefAttributes<HTMLDivElement>\n\nexport function SelectPortal(props: SelectPortalProps) {\n return <SelectPrimitive.Portal {...props} />\n}\n\nSelectPortal.displayName = 'Select.Portal'\n\n/* ─── Positioner ─── */\n\nexport type SelectPositionerProps = SelectPrimitive.Positioner.Props &\n RefAttributes<HTMLDivElement>\n\nexport function SelectPositioner({\n className,\n ...props\n}: SelectPositionerProps) {\n return (\n <SelectPrimitive.Positioner\n className={cn('z-50', className)}\n alignItemWithTrigger={false}\n {...props}\n />\n )\n}\n\nSelectPositioner.displayName = 'Select.Positioner'\n\n/* ─── Popup (dropdown content) ─── */\n\nexport type SelectPopupProps = SelectPrimitive.Popup.Props &\n RefAttributes<HTMLDivElement>\n\nexport function SelectPopup({ className, ...props }: SelectPopupProps) {\n return (\n <SelectPrimitive.Popup\n className={cn(\n 'max-h-[var(--available-height)] max-w-[var(--available-width)] min-w-[var(--anchor-width)] overflow-y-auto rounded-xl border border-[var(--intent-border-subtle)] bg-raised p-1 shadow-lg',\n 'origin-[var(--transform-origin)] transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0',\n className\n )}\n {...props}\n />\n )\n}\n\nSelectPopup.displayName = 'Select.Popup'\n\n/* ─── Item ─── */\n\nexport type SelectItemProps = SelectPrimitive.Item.Props &\n RefAttributes<HTMLDivElement>\n\nexport function SelectItem({ className, children, ...props }: SelectItemProps) {\n const content =\n typeof children === 'string' || typeof children === 'number' ? (\n <>\n <SelectItemText>{children}</SelectItemText>\n <SelectItemIndicator />\n </>\n ) : (\n children\n )\n\n return (\n <SelectPrimitive.Item\n className={cn(\n 'flex w-full min-w-0 cursor-pointer items-center justify-between gap-2 rounded-lg px-2 py-1.5 text-sm text-normal outline-none select-none',\n 'data-[highlighted]:bg-subtle',\n className\n )}\n {...props}\n >\n {content}\n </SelectPrimitive.Item>\n )\n}\n\nSelectItem.displayName = 'Select.Item'\n\n/* ─── ItemText ─── */\n\nexport type SelectItemTextProps = SelectPrimitive.ItemText.Props &\n RefAttributes<HTMLSpanElement>\n\nexport function SelectItemText(props: SelectItemTextProps) {\n return <SelectPrimitive.ItemText {...props} />\n}\n\nSelectItemText.displayName = 'Select.ItemText'\n\n/* ─── ItemIndicator ─── */\n\nexport type SelectItemIndicatorProps = SelectPrimitive.ItemIndicator.Props &\n RefAttributes<HTMLSpanElement>\n\nexport function SelectItemIndicator({\n className,\n children,\n ...props\n}: SelectItemIndicatorProps) {\n return (\n <SelectPrimitive.ItemIndicator\n className={cn('shrink-0 text-subtle', className)}\n {...props}\n >\n {children ?? <CheckIcon weight='bold' className='size-4' />}\n </SelectPrimitive.ItemIndicator>\n )\n}\n\nSelectItemIndicator.displayName = 'Select.ItemIndicator'\n\n/* ─── Group ─── */\n\nexport type SelectGroupProps = SelectPrimitive.Group.Props &\n RefAttributes<HTMLDivElement>\n\nexport function SelectGroup({ className, ...props }: SelectGroupProps) {\n return (\n <SelectPrimitive.Group className={cn('[&+&]:mt-1', className)} {...props} />\n )\n}\n\nSelectGroup.displayName = 'Select.Group'\n\n/* ─── GroupLabel ─── */\n\nexport type SelectGroupLabelProps = SelectPrimitive.GroupLabel.Props &\n RefAttributes<HTMLDivElement>\n\nexport function SelectGroupLabel({\n className,\n ...props\n}: SelectGroupLabelProps) {\n return (\n <SelectPrimitive.GroupLabel\n className={cn(\n 'px-2 py-1.5 text-xs font-medium text-subtle select-none',\n className\n )}\n {...props}\n />\n )\n}\n\nSelectGroupLabel.displayName = 'Select.GroupLabel'\n\n/* ─── Label ─── */\n\nexport type SelectLabelProps = SelectPrimitive.Label.Props &\n RefAttributes<HTMLDivElement> & {\n showIndicator?: boolean\n }\n\nexport function SelectLabel({\n className,\n showIndicator,\n children,\n ...props\n}: SelectLabelProps) {\n const { required } = use(SelectContext)\n return (\n <SelectPrimitive.Label\n className={cn(\n 'flex items-center gap-1 text-sm font-medium text-normal',\n className\n )}\n {...props}\n >\n {children}\n {showIndicator &&\n (required ? (\n <>\n {' '}\n <RequiredIndicator />\n </>\n ) : (\n <>\n {' '}\n <OptionalIndicator />\n </>\n ))}\n </SelectPrimitive.Label>\n )\n}\n\nSelectLabel.displayName = 'Select.Label'\n\n/* ─── ScrollUpArrow ─── */\n\nexport type SelectScrollUpArrowProps = SelectPrimitive.ScrollUpArrow.Props &\n RefAttributes<HTMLDivElement>\n\nexport function SelectScrollUpArrow({\n className,\n ...props\n}: SelectScrollUpArrowProps) {\n return (\n <SelectPrimitive.ScrollUpArrow\n className={cn(\n 'flex items-center justify-center py-1 text-subtle',\n className\n )}\n {...props}\n >\n <CaretUpIcon weight='bold' className='size-3' />\n </SelectPrimitive.ScrollUpArrow>\n )\n}\n\nSelectScrollUpArrow.displayName = 'Select.ScrollUpArrow'\n\n/* ─── ScrollDownArrow ─── */\n\nexport type SelectScrollDownArrowProps = SelectPrimitive.ScrollDownArrow.Props &\n RefAttributes<HTMLDivElement>\n\nexport function SelectScrollDownArrow({\n className,\n ...props\n}: SelectScrollDownArrowProps) {\n return (\n <SelectPrimitive.ScrollDownArrow\n className={cn(\n 'flex items-center justify-center py-1 text-subtle',\n className\n )}\n {...props}\n >\n <CaretDownIcon weight='bold' className='size-3' />\n </SelectPrimitive.ScrollDownArrow>\n )\n}\n\nSelectScrollDownArrow.displayName = 'Select.ScrollDownArrow'\n\n/* ─── HelperText ─── */\n\nexport interface SelectHelperTextProps extends ComponentProps<'p'> {}\n\nexport function SelectHelperText({\n className,\n ...props\n}: SelectHelperTextProps) {\n return <p className={cn('text-sm text-subtle', className)} {...props} />\n}\n\nSelectHelperText.displayName = 'Select.HelperText'\n\n/* ─── ErrorText ─── */\n\nexport interface SelectErrorTextProps extends ComponentProps<'p'> {}\n\nexport function SelectErrorText({ className, ...props }: SelectErrorTextProps) {\n const { invalid } = use(SelectContext)\n if (!invalid) return null\n return (\n <p\n role='alert'\n className={cn('text-sm text-subtle intent-danger', className)}\n {...props}\n />\n )\n}\n\nSelectErrorText.displayName = 'Select.ErrorText'\n\n/* ─── Content (convenience wrapper) ─── */\n\nexport interface SelectContentProps extends SelectPopupProps {}\n\nexport function SelectContent({ children, ...props }: SelectContentProps) {\n return (\n <SelectPortal>\n <SelectPositioner>\n <SelectPopup {...props}>{children}</SelectPopup>\n </SelectPositioner>\n </SelectPortal>\n )\n}\n\nSelectContent.displayName = 'Select.Content'\n\n/* ─── Compound export ─── */\n\nexport const Select = Object.assign(SelectRoot, {\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Portal: SelectPortal,\n Positioner: SelectPositioner,\n Popup: SelectPopup,\n Content: SelectContent,\n Item: SelectItem,\n ItemText: SelectItemText,\n ItemIndicator: SelectItemIndicator,\n Group: SelectGroup,\n GroupLabel: SelectGroupLabel,\n Label: SelectLabel,\n HelperText: SelectHelperText,\n ErrorText: SelectErrorText,\n ScrollUpArrow: SelectScrollUpArrow,\n ScrollDownArrow: SelectScrollDownArrow\n})\n\nexport type SelectProps = SelectRootProps\nexport type { SelectTriggerProps as SelectTriggerVariantProps }\n"]}
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-4LGCF3SN.js';import {cva}from'class-variance-authority';import {cn}from'@oztix/roadie-core/utils';import {jsx}from'react/jsx-runtime';var p=cva("font-mono rounded-md px-1.5 py-0.5 text-[0.9em]",{variants:{intent:a,emphasis:{normal:"emphasis-normal",strong:"emphasis-strong",subtle:"emphasis-subtle",subtler:"emphasis-subtler"}},defaultVariants:{emphasis:"normal"}});function m({className:e,intent:t,emphasis:r,...s}){return jsx("code",{className:cn(p({intent:t,emphasis:r,className:e})),...s})}m.displayName="Code";export{p as a,m as b};//# sourceMappingURL=chunk-DRVUAPKN.js.map
2
- //# sourceMappingURL=chunk-DRVUAPKN.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Code/index.tsx"],"names":["codeVariants","cva","intentVariants","Code","className","intent","emphasis","props","jsx","cn"],"mappings":"6JAQO,IAAMA,CAAAA,CAAeC,GAAAA,CAC1B,iDAAA,CACA,CACE,QAAA,CAAU,CACR,MAAA,CAAQC,CAAAA,CACR,QAAA,CAAU,CACR,MAAA,CAAQ,iBAAA,CACR,OAAQ,iBAAA,CACR,MAAA,CAAQ,iBAAA,CACR,OAAA,CAAS,kBACX,CACF,CAAA,CACA,eAAA,CAAiB,CACf,SAAU,QACZ,CACF,CACF,EAMO,SAASC,CAAAA,CAAK,CAAE,SAAA,CAAAC,EAAW,MAAA,CAAAC,CAAAA,CAAQ,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAM,CAAA,CAAc,CACzE,OACEC,IAAC,MAAA,CAAA,CACC,SAAA,CAAWC,EAAAA,CAAGT,CAAAA,CAAa,CAAE,MAAA,CAAAK,CAAAA,CAAQ,QAAA,CAAAC,EAAU,SAAA,CAAAF,CAAU,CAAC,CAAC,EAC1D,GAAGG,CAAAA,CACN,CAEJ,CAEAJ,EAAK,WAAA,CAAc,MAAA","file":"chunk-DRVUAPKN.js","sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { intentVariants } from '../../variants'\n\nexport const codeVariants = cva(\n 'font-mono rounded-md px-1.5 py-0.5 text-[0.9em]',\n {\n variants: {\n intent: intentVariants,\n emphasis: {\n normal: 'emphasis-normal',\n strong: 'emphasis-strong',\n subtle: 'emphasis-subtle',\n subtler: 'emphasis-subtler'\n }\n },\n defaultVariants: {\n emphasis: 'normal'\n }\n }\n)\n\nexport interface CodeProps\n extends ComponentProps<'code'>,\n VariantProps<typeof codeVariants> {}\n\nexport function Code({ className, intent, emphasis, ...props }: CodeProps) {\n return (\n <code\n className={cn(codeVariants({ intent, emphasis, className }))}\n {...props}\n />\n )\n}\n\nCode.displayName = 'Code'\n"]}
@@ -1,2 +0,0 @@
1
- import {cn}from'@oztix/roadie-core/utils';import {jsx}from'react/jsx-runtime';function o({className:e,...r}){return jsx("nav",{"aria-label":"Breadcrumb",className:e,...r})}o.displayName="Breadcrumb";function m({className:e,...r}){return jsx("ol",{className:cn("flex items-center gap-2 text-sm",e),...r})}m.displayName="Breadcrumb.List";function s({className:e,...r}){return jsx("li",{className:cn("flex items-center gap-2",e),...r})}s.displayName="Breadcrumb.Item";function p({as:e,className:r,...n}){return jsx(e||"a",{className:cn("text-subtle transition-colors hover:text-normal",r),...n})}p.displayName="Breadcrumb.Link";function c({className:e,children:r="/",...n}){return jsx("span",{role:"presentation",className:cn("text-subtler",e),...n,children:r})}c.displayName="Breadcrumb.Separator";function u({className:e,...r}){return jsx("span",{"aria-current":"page",className:cn("font-medium text-normal",e),...r})}u.displayName="Breadcrumb.Current";var d=Object.assign(o,{List:m,Item:s,Link:p,Separator:c,Current:u});export{d as a};//# sourceMappingURL=chunk-EKOEXSAP.js.map
2
- //# sourceMappingURL=chunk-EKOEXSAP.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Breadcrumb/index.tsx"],"names":["BreadcrumbRoot","className","props","jsx","BreadcrumbList","cn","BreadcrumbItem","BreadcrumbLink","as","BreadcrumbSeparator","children","BreadcrumbCurrent","Breadcrumb"],"mappings":"8EAIA,SAASA,CAAAA,CAAe,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAA0B,CACtE,OAAOC,GAAAA,CAAC,OAAI,YAAA,CAAW,YAAA,CAAa,SAAA,CAAWF,CAAAA,CAAY,GAAGC,CAAAA,CAAO,CACvE,CAEAF,CAAAA,CAAe,WAAA,CAAc,aAE7B,SAASI,CAAAA,CAAe,CAAE,SAAA,CAAAH,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAyB,CACrE,OACEC,GAAAA,CAAC,MACC,SAAA,CAAWE,EAAAA,CAAG,iCAAA,CAAmCJ,CAAS,EACzD,GAAGC,CAAAA,CACN,CAEJ,CAEAE,CAAAA,CAAe,YAAc,iBAAA,CAE7B,SAASE,EAAe,CAAE,S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oztix/roadie-core/utils'\n\nfunction BreadcrumbRoot({ className, ...props }: ComponentProps<'nav'>) {\n return <nav aria-label='Breadcrumb' className={className} {...props} />\n}\n\nBreadcrumbRoot.displayName = 'Breadcrumb'\n\nfunction BreadcrumbList({ className, ...props }: ComponentProps<'ol'>) {\n return (\n <ol\n className={cn('flex items-center gap-2 text-sm', className)}\n {...props}\n />\n )\n}\n\nBreadcrumbList.displayName = 'Breadcrumb.List'\n\nfunction BreadcrumbItem({ className, ...props }: ComponentProps<'li'>) {\n return <li className={cn('flex items-center gap-2', className)} {...props} />\n}\n\nBreadcrumbItem.displayName = 'Breadcrumb.Item'\n\ntype BreadcrumbLinkProps<T extends ElementType = 'a'> = {\n as?: T\n className?: string\n} & Omit<ComponentProps<T>, 'as' | 'className'>\n\nfunction BreadcrumbLink<T extends ElementType = 'a'>({\n as,\n className,\n ...props\n}: BreadcrumbLinkProps<T>) {\n const Component = as || 'a'\n return (\n <Component\n className={cn(\n 'text-subtle transition-colors hover:text-normal',\n className\n )}\n {...props}\n />\n )\n}\n\nBreadcrumbLink.displayName = 'Breadcrumb.Link'\n\ninterface BreadcrumbSeparatorProps extends ComponentProps<'span'> {\n children?: React.ReactNode\n}\n\nfunction BreadcrumbSeparator({\n className,\n children = '/',\n ...props\n}: BreadcrumbSeparatorProps) {\n return (\n <span\n role='presentation'\n className={cn('text-subtler', className)}\n {...props}\n >\n {children}\n </span>\n )\n}\n\nBreadcrumbSeparator.displayName = 'Breadcrumb.Separator'\n\nfunction BreadcrumbCurrent({ className, ...props }: ComponentProps<'span'>) {\n return (\n <span\n aria-current='page'\n className={cn('font-medium text-normal', className)}\n {...props}\n />\n )\n}\n\nBreadcrumbCurrent.displayName = 'Breadcrumb.Current'\n\nexport const Breadcrumb = Object.assign(BreadcrumbRoot, {\n List: BreadcrumbList,\n Item: BreadcrumbItem,\n Link: BreadcrumbLink,\n Separator: BreadcrumbSeparator,\n Current: BreadcrumbCurrent\n})\n\nexport type { BreadcrumbSeparatorProps }\n"]}
@@ -1,7 +0,0 @@
1
- "use client";
2
- import {useRef,useState,useEffect}from'react';import {cn}from'@oztix/roadie-core/utils';import {jsx,jsxs}from'react/jsx-runtime';function T({children:o,speed:l=50,pauseOnHover:d=false,direction:M="normal",gap:c=16,className:P,"aria-label":k,...w}){let u=useRef(null),m=useRef(null),f=useRef(null),[v,D]=useState(0),[p,R]=useState(1);useEffect(()=>{let e=u.current,t=f.current;if(!e||!t)return;let r=()=>{let q=e.clientWidth,y=t.scrollWidth;if(y>0){let E=Math.ceil(q/y)+1;R(E);}};r();let n=new ResizeObserver(r);return n.observe(e),n.observe(t),()=>n.disconnect()},[o,c]),useEffect(()=>{let e=m.current;if(!e)return;let t=()=>{let n=e.scrollWidth/2;n>0&&D(n/l);};t();let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[l,p]);let i=`${c}px`,h=Array.from({length:p},(e,t)=>jsx("div",{className:"flex shrink-0 items-center",style:{gap:i},children:o},t));return jsxs("div",{ref:u,className:cn("relative max-w-full overflow-hidden",P),"aria-label":k,...w,children:[jsx("style",{children:`
3
- @keyframes roadie-marquee {
4
- to { transform: translateX(-50%); }
5
- }
6
- `}),jsx("div",{ref:f,"aria-hidden":"true",style:{position:"absolute",visibility:"hidden",pointerEvents:"none",display:"flex",width:"max-content",height:0,overflow:"hidden",gap:i},children:o}),jsxs("div",{ref:m,style:{display:"flex",width:"max-content",gap:i,animationName:v>0?"roadie-marquee":"none",animationDuration:`${v}s`,animationTimingFunction:"linear",animationIterationCount:"infinite",animationDirection:M,animationPlayState:"running"},onMouseEnter:d?e=>{e.currentTarget.style.animationPlayState="paused";}:void 0,onMouseLeave:d?e=>{e.currentTarget.style.animationPlayState="running";}:void 0,children:[jsx("div",{className:"flex shrink-0 items-center",style:{gap:i},children:h}),jsx("div",{className:"flex shrink-0 items-center",style:{gap:i},"aria-hidden":"true",children:h})]})]})}T.displayName="Marquee";export{T as a};//# sourceMappingURL=chunk-FQNVMKKV.js.map
7
- //# sourceMappingURL=chunk-FQNVMKKV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Marquee/index.tsx"],"names":["Marquee","children","speed","pauseOnHover","direction","gap","className","ariaLabel","props","outerRef","useRef","trackRef","measureRef","duration","setDuration","useState","repeats","setRepeats","useEffect","outer","measure","update","containerWidth","contentWidth","needed","observer","track","updateDuration","halfWidth","gapPx","repeatedChildren","_","i","jsx","jsxs","cn"],"mappings":"iIAmBO,SAASA,CAAAA,CAAQ,CACtB,QAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CAAQ,EAAA,CACR,YAAA,CAAAC,CAAAA,CAAe,KAAA,CACf,UAAAC,CAAAA,CAAY,QAAA,CACZ,GAAA,CAAAC,CAAAA,CAAM,EAAA,CACN,SAAA,CAAAC,CAAAA,CACA,YAAA,CAAcC,CAAAA,CACd,GAAGC,CACL,CAAA,CAAiB,CACf,IAAMC,EAAWC,MAAAA,CAAuB,IAAI,CAAA,CACtCC,CAAAA,CAAWD,MAAAA,CAAuB,IAAI,CAAA,CACtCE,CAAAA,CAAaF,MAAAA,CAAuB,IAAI,CAAA,CACxC,CAACG,CAAAA,CAAUC,CAAW,EAAIC,QAAAA,CAAS,CAAC,CAAA,CACpC,CAACC,CAAAA,CAASC,CAAU,CAAA,CAAIF,QAAAA,CAAS,CAAC,CAAA,CAExCG,SAAAA,CAAU,IAAM,CACd,IAAMC,EAAQV,CAAAA,CAAS,OAAA,CACjBW,CAAAA,CAAUR,CAAAA,CAAW,OAAA,CAC3B,GAAI,CAACO,CAAAA,EAAS,CAACC,CAAAA,CAAS,OAExB,IAAMC,CAAAA,CAAS,IAAM,CACnB,IAAMC,CAAAA,CAAiBH,CAAAA,CAAM,WAAA,CACvBI,CAAAA,CAAeH,CAAAA,CAAQ,WAAA,CAC7B,GAAIG,CAAAA,CAAe,CAAA,CAAG,CAEpB,IAAMC,CAAAA,CAAS,IAAA,CAAK,KAAKF,CAAAA,CAAiBC,CAAY,CAAA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QAAA,CAAAC,EACH,CAAA,CAEAG,GAAAA,CAAC,KAAA,CAAA,CACC,SAAA,CAAU,4BAAA,CACV,KAAA,CAAO,CAAE,GAAA,CAAKJ,CAAM,CAAA,CACpB,aAAA,CAAY,MAAA,CAEX,QAAA,CAAAC,CAAAA,CACH,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAEJ,CAEA9B,CAAAA,CAAQ,WAAA,CAAc,SAAA","file":"chunk-FQNVMKKV.js","sourcesContent":["'use client'\n\nimport { type ComponentProps, useEffect, useRef, useState } from 'react'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nexport interface MarqueeProps extends ComponentProps<'div'> {\n /** Scroll speed in pixels per second. @default 50 */\n speed?: number\n /** Pause animation on hover. @default false */\n pauseOnHover?: boolean\n /** Scroll direction. @default 'normal' */\n direction?: 'normal' | 'reverse'\n /** Gap between items in pixels. @default 16 */\n gap?: number\n /** Accessible label for the marquee region. */\n 'aria-label'?: string\n}\n\nexport function Marquee({\n children,\n speed = 50,\n pauseOnHover = false,\n direction = 'normal',\n gap = 16,\n className,\n 'aria-label': ariaLabel,\n ...props\n}: MarqueeProps) {\n const outerRef = useRef<HTMLDivElement>(null)\n const trackRef = useRef<HTMLDivElement>(null)\n const measureRef = useRef<HTMLDivElement>(null)\n const [duration, setDuration] = useState(0)\n const [repeats, setRepeats] = useState(1)\n\n useEffect(() => {\n const outer = outerRef.current\n const measure = measureRef.current\n if (!outer || !measure) return\n\n const update = () => {\n const containerWidth = outer.clientWidth\n const contentWidth = measure.scrollWidth\n if (contentWidth > 0) {\n // Repeat enough times so one \"set\" is always wider than the container\n const needed = Math.ceil(containerWidth / contentWidth) + 1\n setRepeats(needed)\n }\n }\n\n update()\n\n const observer = new ResizeObserver(update)\n observer.observe(outer)\n observer.observe(measure)\n return () => observer.disconnect()\n }, [children, gap])\n\n useEffect(() => {\n const track = trackRef.current\n if (!track) return\n\n const updateDuration = () => {\n const halfWidth = track.scrollWidth / 2\n if (halfWidth > 0) {\n setDuration(halfWidth / speed)\n }\n }\n\n updateDuration()\n\n const observer = new ResizeObserver(updateDuration)\n observer.observe(track)\n return () => observer.disconnect()\n }, [speed, repeats])\n\n const gapPx = `${gap}px`\n\n const repeatedChildren = Array.from({ length: repeats }, (_, i) => (\n <div key={i} className='flex shrink-0 items-center' style={{ gap: gapPx }}>\n {children}\n </div>\n ))\n\n return (\n <div\n ref={outerRef}\n className={cn('relative max-w-full overflow-hidden', className)}\n aria-label={ariaLabel}\n {...props}\n >\n <style>{`\n @keyframes roadie-marquee {\n to { transform: translateX(-50%); }\n }\n `}</style>\n {/* Hidden measure element to get single-set width */}\n <div\n ref={measureRef}\n aria-hidden='true'\n style={{\n position: 'absolute',\n visibility: 'hidden',\n pointerEvents: 'none',\n display: 'flex',\n width: 'max-content',\n height: 0,\n overflow: 'hidden',\n gap: gapPx\n }}\n >\n {children}\n </div>\n <div\n ref={trackRef}\n style={{\n display: 'flex',\n width: 'max-content',\n gap: gapPx,\n animationName: duration > 0 ? 'roadie-marquee' : 'none',\n animationDuration: `${duration}s`,\n animationTimingFunction: 'linear',\n animationIterationCount: 'infinite',\n animationDirection: direction,\n animationPlayState: 'running'\n }}\n onMouseEnter={\n pauseOnHover\n ? (e) => {\n e.currentTarget.style.animationPlayState = 'paused'\n }\n : undefined\n }\n onMouseLeave={\n pauseOnHover\n ? (e) => {\n e.currentTarget.style.animationPlayState = 'running'\n }\n : undefined\n }\n >\n {/* Set A */}\n <div className='flex shrink-0 items-center' style={{ gap: gapPx }}>\n {repeatedChildren}\n </div>\n {/* Set B (clone for seamless loop) */}\n <div\n className='flex shrink-0 items-center'\n style={{ gap: gapPx }}\n aria-hidden='true'\n >\n {repeatedChildren}\n </div>\n </div>\n </div>\n )\n}\n\nMarquee.displayName = 'Marquee'\n"]}
@@ -1,3 +0,0 @@
1
- "use client";
2
- import {cn}from'@oztix/roadie-core/utils';import {jsx}from'react/jsx-runtime';function r({className:e,...o}){return jsx("label",{className:cn("text-sm font-medium text-normal",e),...o})}r.displayName="Label";export{r as a};//# sourceMappingURL=chunk-IEDKSZAQ.js.map
3
- //# sourceMappingURL=chunk-IEDKSZAQ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/components/Label/index.tsx"],"names":["Label","className","props","jsx","cn"],"mappings":"8EAMO,SAASA,CAAAA,CAAM,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAe,CACzD,OACEC,GAAAA,CAAC,OAAA,CAAA,CACC,SAAA,CAAWC,EAAAA,CAAG,iCAAA,CAAmCH,CAAS,CAAA,CACzD,GAAGC,CAAAA,CACN,CAEJ,CAEAF,CAAAA,CAAM,WAAA,CAAc,OAAA","file":"chunk-IEDKSZAQ.js","sourcesContent":["import type { ComponentProps } from 'react'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nexport interface LabelProps extends ComponentProps<'label'> {}\n\nexport function Label({ className, ...props }: LabelProps) {\n return (\n <label\n className={cn('text-sm font-medium text-normal', className)}\n {...props}\n />\n )\n}\n\nLabel.displayName = 'Label'\n"]}