@autoguru/overdrive 4.43.9-next.0 → 4.43.10-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/dist/components/Actions/Actions.d.ts +3 -3
  2. package/dist/components/Actions/Actions.d.ts.map +1 -1
  3. package/dist/components/Actions/Actions.js +4 -3
  4. package/dist/components/Alert/Alert.d.ts +3 -3
  5. package/dist/components/Alert/Alert.d.ts.map +1 -1
  6. package/dist/components/Alert/Alert.js +11 -11
  7. package/dist/components/Anchor/Anchor.d.ts +4 -3
  8. package/dist/components/Anchor/Anchor.d.ts.map +1 -1
  9. package/dist/components/Anchor/Anchor.js +21 -19
  10. package/dist/components/AutoSuggest/AutoSuggest.js +52 -34
  11. package/dist/components/AutoSuggest/useLayoutSuggestionVisible.js +1 -0
  12. package/dist/components/Badge/Badge.d.ts +13 -2
  13. package/dist/components/Badge/Badge.d.ts.map +1 -1
  14. package/dist/components/Badge/Badge.js +7 -1
  15. package/dist/components/Box/Box.d.ts +7 -0
  16. package/dist/components/Box/Box.d.ts.map +1 -1
  17. package/dist/components/Box/Box.js +11 -2
  18. package/dist/components/Box/newBox/NewBox.d.ts +23 -0
  19. package/dist/components/Box/newBox/NewBox.d.ts.map +1 -1
  20. package/dist/components/Box/newBox/NewBox.js +25 -2
  21. package/dist/components/Box/newBox/useBox.d.ts +24 -0
  22. package/dist/components/Box/newBox/useBox.d.ts.map +1 -1
  23. package/dist/components/Box/newBox/useBox.js +38 -1
  24. package/dist/components/BulletList/Bullet.js +2 -2
  25. package/dist/components/BulletList/BulletList.js +2 -2
  26. package/dist/components/BulletList/context.js +1 -1
  27. package/dist/components/BulletText/BulletText.d.ts.map +1 -1
  28. package/dist/components/BulletText/BulletText.js +13 -12
  29. package/dist/components/Button/Button.css.d.ts +9 -0
  30. package/dist/components/Button/Button.css.d.ts.map +1 -1
  31. package/dist/components/Button/Button.css.js +12 -2
  32. package/dist/components/Button/Button.d.ts +11 -2
  33. package/dist/components/Button/Button.d.ts.map +1 -1
  34. package/dist/components/Button/Button.js +23 -11
  35. package/dist/components/CheckBox/CheckBox.d.ts +4 -0
  36. package/dist/components/CheckBox/CheckBox.d.ts.map +1 -1
  37. package/dist/components/CheckBox/CheckBox.js +4 -4
  38. package/dist/components/ColourInput/ColourInput.d.ts.map +1 -1
  39. package/dist/components/ColourInput/ColourInput.js +10 -9
  40. package/dist/components/Columns/Column.css.js +1 -0
  41. package/dist/components/Columns/Column.js +3 -3
  42. package/dist/components/Columns/ColumnGrid.css.js +1 -1
  43. package/dist/components/Columns/Columns.d.ts +3 -3
  44. package/dist/components/Columns/Columns.d.ts.map +1 -1
  45. package/dist/components/Columns/Columns.js +4 -4
  46. package/dist/components/DateInput/DateInput.js +1 -1
  47. package/dist/components/DatePicker/DatePicker.js +6 -6
  48. package/dist/components/DateTimePicker/CalendarButton.js +1 -1
  49. package/dist/components/DateTimePicker/CalendarGrid.js +10 -10
  50. package/dist/components/DateTimePicker/DateTimePicker.css.js +9 -1
  51. package/dist/components/DateTimePicker/DateTimePicker.d.ts +39 -0
  52. package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
  53. package/dist/components/DateTimePicker/DateTimePicker.js +50 -17
  54. package/dist/components/DividerLine/DividerLine.js +1 -1
  55. package/dist/components/DropDown/DropDown.js +5 -5
  56. package/dist/components/DropDown/DropDownOption.js +4 -4
  57. package/dist/components/DropDown/DropDownOptionsList.js +4 -4
  58. package/dist/components/EditableText/EditableText.d.ts +2 -2
  59. package/dist/components/EditableText/EditableText.d.ts.map +1 -1
  60. package/dist/components/EditableText/EditableText.js +10 -10
  61. package/dist/components/FillHeightBox/FillHeightBox.js +2 -1
  62. package/dist/components/Flyout/Flyout.d.ts +2 -2
  63. package/dist/components/Flyout/Flyout.d.ts.map +1 -1
  64. package/dist/components/Flyout/Flyout.js +3 -3
  65. package/dist/components/Heading/Heading.d.ts +6 -1
  66. package/dist/components/Heading/Heading.d.ts.map +1 -1
  67. package/dist/components/Heading/Heading.js +10 -3
  68. package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.d.ts +2 -2
  69. package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.d.ts.map +1 -1
  70. package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.js +19 -18
  71. package/dist/components/Icon/Icon.js +2 -2
  72. package/dist/components/Image/Image.d.ts +3 -0
  73. package/dist/components/Image/Image.d.ts.map +1 -1
  74. package/dist/components/Image/Image.js +2 -2
  75. package/dist/components/Image/ImageServerProvider.js +7 -2
  76. package/dist/components/Image/ResponsiveImage.d.ts +22 -0
  77. package/dist/components/Image/ResponsiveImage.d.ts.map +1 -1
  78. package/dist/components/Image/ResponsiveImage.js +2 -1
  79. package/dist/components/Image/SimpleImage.d.ts +18 -0
  80. package/dist/components/Image/SimpleImage.d.ts.map +1 -1
  81. package/dist/components/Image/SimpleImage.js +6 -2
  82. package/dist/components/Inline/Inline.d.ts +9 -6
  83. package/dist/components/Inline/Inline.d.ts.map +1 -1
  84. package/dist/components/Inline/Inline.js +53 -46
  85. package/dist/components/IntentStripe/IntentStripe.js +1 -1
  86. package/dist/components/LinearProgressIndicator/LinearProgressIndicator.js +4 -4
  87. package/dist/components/LoadingBox/LoadingBox.js +1 -1
  88. package/dist/components/Meta/Meta.js +3 -3
  89. package/dist/components/MinimalModal/MinimalModal.js +4 -4
  90. package/dist/components/Modal/Modal.js +7 -6
  91. package/dist/components/NumberBubble/NumberBubble.js +2 -2
  92. package/dist/components/NumberInput/NumberInput.js +1 -1
  93. package/dist/components/NumberInput/useNumberInputBehaviours.js +9 -3
  94. package/dist/components/OptionGrid/OptionGrid.css.js +7 -1
  95. package/dist/components/OptionGrid/OptionGrid.d.ts +32 -0
  96. package/dist/components/OptionGrid/OptionGrid.d.ts.map +1 -1
  97. package/dist/components/OptionGrid/OptionGrid.js +26 -12
  98. package/dist/components/OptionList/OptionList.css.js +5 -1
  99. package/dist/components/OptionList/OptionList.d.ts +25 -0
  100. package/dist/components/OptionList/OptionList.d.ts.map +1 -1
  101. package/dist/components/OptionList/OptionList.js +19 -6
  102. package/dist/components/OptionList/OptionListItem.d.ts +10 -0
  103. package/dist/components/OptionList/OptionListItem.d.ts.map +1 -1
  104. package/dist/components/OptionList/OptionListItem.js +16 -9
  105. package/dist/components/OrderedList/OrderedList.css.d.ts +0 -1
  106. package/dist/components/OrderedList/OrderedList.css.d.ts.map +1 -1
  107. package/dist/components/OrderedList/OrderedList.css.js +1 -8
  108. package/dist/components/OrderedList/OrderedList.d.ts +4 -4
  109. package/dist/components/OrderedList/OrderedList.d.ts.map +1 -1
  110. package/dist/components/OrderedList/OrderedList.js +11 -9
  111. package/dist/components/OutsideClick/OutsideClick.js +4 -1
  112. package/dist/components/OverdriveProvider/FallbackProvider.d.ts +3 -0
  113. package/dist/components/OverdriveProvider/FallbackProvider.d.ts.map +1 -1
  114. package/dist/components/OverdriveProvider/FallbackProvider.js +5 -1
  115. package/dist/components/OverdriveProvider/OverdriveProvider.d.ts +5 -0
  116. package/dist/components/OverdriveProvider/OverdriveProvider.d.ts.map +1 -1
  117. package/dist/components/OverdriveProvider/OverdriveProvider.js +10 -6
  118. package/dist/components/OverdriveProvider/ThemeOverrideDebugger.js +7 -7
  119. package/dist/components/OverdriveProvider/index.d.ts +2 -1
  120. package/dist/components/OverdriveProvider/index.d.ts.map +1 -1
  121. package/dist/components/OverdriveProvider/index.js +3 -1
  122. package/dist/components/OverdriveProvider/useColorOverrides.d.ts +1 -0
  123. package/dist/components/OverdriveProvider/useColorOverrides.d.ts.map +1 -1
  124. package/dist/components/OverdriveProvider/useColorOverrides.js +9 -0
  125. package/dist/components/Pagination/Bubble.js +1 -1
  126. package/dist/components/Pagination/Pagination.js +11 -11
  127. package/dist/components/Portal/Portal.js +5 -2
  128. package/dist/components/Positioner/Positioner.js +18 -2
  129. package/dist/components/Positioner/alignment.js +1 -1
  130. package/dist/components/ProgressBar/ProgressBar.js +3 -3
  131. package/dist/components/ProgressBarGroup/ProgressBarGroup.js +5 -5
  132. package/dist/components/ProgressSpinner/ProgressSpinner.js +3 -3
  133. package/dist/components/Radio/Radio.js +4 -4
  134. package/dist/components/Radio/RadioGroup.js +4 -4
  135. package/dist/components/ScrollPane/ScrollPane.js +2 -2
  136. package/dist/components/SearchBar/SearchBar.d.ts +17 -0
  137. package/dist/components/SearchBar/SearchBar.d.ts.map +1 -1
  138. package/dist/components/SearchBar/SearchBar.js +21 -9
  139. package/dist/components/Section/Section.d.ts +3 -3
  140. package/dist/components/Section/Section.d.ts.map +1 -1
  141. package/dist/components/Section/Section.js +4 -3
  142. package/dist/components/SelectInput/SelectInput.js +6 -6
  143. package/dist/components/SimplePagination/SimplePagination.js +6 -6
  144. package/dist/components/SliderProgress/ProgressStep.js +4 -4
  145. package/dist/components/SliderProgress/SliderProgress.js +3 -3
  146. package/dist/components/Stack/Divider.d.ts +3 -0
  147. package/dist/components/Stack/Divider.d.ts.map +1 -0
  148. package/dist/components/Stack/Divider.js +13 -0
  149. package/dist/components/Stack/Stack.d.ts +6 -10
  150. package/dist/components/Stack/Stack.d.ts.map +1 -1
  151. package/dist/components/Stack/Stack.js +28 -28
  152. package/dist/components/StandardModal/StandardModal.d.ts +2 -2
  153. package/dist/components/StandardModal/StandardModal.d.ts.map +1 -1
  154. package/dist/components/StandardModal/StandardModal.js +13 -11
  155. package/dist/components/StarRating/StarRating.js +11 -9
  156. package/dist/components/Stepper/Stepper.js +10 -10
  157. package/dist/components/StickyBox/StickyBox.js +4 -3
  158. package/dist/components/Switch/Switch.d.ts +11 -0
  159. package/dist/components/Switch/Switch.d.ts.map +1 -1
  160. package/dist/components/Switch/Switch.js +10 -5
  161. package/dist/components/Table/Table.css.js +4 -0
  162. package/dist/components/Table/Table.js +9 -3
  163. package/dist/components/Table/TableCell.css.js +5 -0
  164. package/dist/components/Table/TableCell.js +7 -4
  165. package/dist/components/Table/TableHeadCell.js +7 -7
  166. package/dist/components/Table/TableRow.js +2 -2
  167. package/dist/components/Table/TableRowGroup.js +2 -2
  168. package/dist/components/Table/context.js +2 -2
  169. package/dist/components/Tabs/Tab.d.ts +3 -3
  170. package/dist/components/Tabs/Tab.d.ts.map +1 -1
  171. package/dist/components/Tabs/Tab.js +6 -6
  172. package/dist/components/Tabs/TabList.js +10 -10
  173. package/dist/components/Tabs/TabPane.js +1 -1
  174. package/dist/components/Tabs/TabPanes.d.ts +1 -0
  175. package/dist/components/Tabs/TabPanes.d.ts.map +1 -1
  176. package/dist/components/Tabs/TabPanes.js +3 -3
  177. package/dist/components/Tabs/Tabs.js +2 -2
  178. package/dist/components/Text/Text.d.ts +3 -5
  179. package/dist/components/Text/Text.d.ts.map +1 -1
  180. package/dist/components/Text/Text.js +5 -2
  181. package/dist/components/Text/textStyles.d.ts +3 -0
  182. package/dist/components/Text/textStyles.d.ts.map +1 -1
  183. package/dist/components/Text/textStyles.js +5 -0
  184. package/dist/components/TextAreaInput/TextAreaInput.js +1 -1
  185. package/dist/components/TextBubble/TextBubble.d.ts +5 -5
  186. package/dist/components/TextBubble/TextBubble.d.ts.map +1 -1
  187. package/dist/components/TextBubble/TextBubble.js +4 -3
  188. package/dist/components/TextContainer/TextContainer.js +4 -4
  189. package/dist/components/TextInput/TextInput.js +1 -1
  190. package/dist/components/TextLink/TextLink.css.d.ts +0 -1
  191. package/dist/components/TextLink/TextLink.css.d.ts.map +1 -1
  192. package/dist/components/TextLink/TextLink.css.js +0 -5
  193. package/dist/components/TextLink/TextLink.d.ts +7 -8
  194. package/dist/components/TextLink/TextLink.d.ts.map +1 -1
  195. package/dist/components/TextLink/TextLink.js +19 -19
  196. package/dist/components/Toaster/Toast.js +20 -10
  197. package/dist/components/Tooltip/Tooltip.d.ts +25 -5
  198. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  199. package/dist/components/Tooltip/Tooltip.js +61 -82
  200. package/dist/components/Tooltip/index.d.ts +1 -1
  201. package/dist/components/Tooltip/index.d.ts.map +1 -1
  202. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +5 -0
  203. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
  204. package/dist/components/VisuallyHidden/VisuallyHidden.js +6 -1
  205. package/dist/components/private/CheckableBase/CheckableBase.css.js +2 -0
  206. package/dist/components/private/CheckableBase/CheckableBase.js +6 -6
  207. package/dist/components/private/CheckableBase/useCheckableStyles.d.ts +3 -0
  208. package/dist/components/private/CheckableBase/useCheckableStyles.d.ts.map +1 -1
  209. package/dist/components/private/CheckableBase/useCheckableStyles.js +3 -0
  210. package/dist/components/private/InputBase/HintText.js +1 -1
  211. package/dist/components/private/InputBase/NotchedBase.js +7 -7
  212. package/dist/components/private/InputBase/withEnhancedInput.css.js +1 -0
  213. package/dist/components/private/InputBase/withEnhancedInput.d.ts +1 -1
  214. package/dist/components/private/InputBase/withEnhancedInput.d.ts.map +1 -1
  215. package/dist/components/private/InputBase/withEnhancedInput.js +32 -10
  216. package/dist/hooks/index.d.ts +1 -0
  217. package/dist/hooks/index.d.ts.map +1 -1
  218. package/dist/hooks/index.js +1 -0
  219. package/dist/hooks/useAttachedBoxes/useAttachedBoxes.js +2 -1
  220. package/dist/hooks/useDeepCompareMemo/index.d.ts +4 -0
  221. package/dist/hooks/useDeepCompareMemo/index.d.ts.map +1 -1
  222. package/dist/hooks/useDeepCompareMemo/index.js +12 -0
  223. package/dist/hooks/useMedia/useMedia.js +1 -0
  224. package/dist/hooks/useResponsiveValue/useResponsiveValue.js +3 -1
  225. package/dist/hooks/useTooltip/index.d.ts +2 -0
  226. package/dist/hooks/useTooltip/index.d.ts.map +1 -0
  227. package/dist/hooks/useTooltip/index.js +3 -0
  228. package/dist/hooks/useTooltip/useTooltip.d.ts +38 -0
  229. package/dist/hooks/useTooltip/useTooltip.d.ts.map +1 -0
  230. package/dist/hooks/useTooltip/useTooltip.js +125 -0
  231. package/dist/hooks/useWindowHeightFill/useWindowHeightFill.js +1 -0
  232. package/dist/hooks/useWindowScrollLock/index.js +2 -0
  233. package/dist/styles/componentStyles.d.ts +14 -1
  234. package/dist/styles/componentStyles.d.ts.map +1 -1
  235. package/dist/styles/componentStyles.js +17 -3
  236. package/dist/styles/componentStyles.spec.d.ts +2 -0
  237. package/dist/styles/componentStyles.spec.d.ts.map +1 -0
  238. package/dist/styles/componentStyles.spec.js +251 -0
  239. package/dist/styles/elementReset.css.d.ts +1 -0
  240. package/dist/styles/elementReset.css.d.ts.map +1 -1
  241. package/dist/styles/elementReset.css.js +4 -0
  242. package/dist/styles/global/reset.css.js +2 -0
  243. package/dist/styles/layers.css.d.ts +3 -2
  244. package/dist/styles/layers.css.d.ts.map +1 -1
  245. package/dist/styles/layers.css.js +6 -2
  246. package/dist/styles/sprinkles.css.d.ts +11 -11
  247. package/dist/styles/sprinkles.css.d.ts.map +1 -1
  248. package/dist/styles/sprinkles.css.js +39 -14
  249. package/dist/styles/typography.css.d.ts +14 -0
  250. package/dist/styles/typography.css.d.ts.map +1 -1
  251. package/dist/styles/typography.css.js +5 -0
  252. package/dist/styles/vars.css.js +2 -0
  253. package/dist/themes/base/theme.css.js +3 -1
  254. package/dist/themes/base/tokens.d.ts +3 -0
  255. package/dist/themes/base/tokens.d.ts.map +1 -1
  256. package/dist/themes/base/tokens.js +3 -0
  257. package/dist/themes/helpers.d.ts +22 -0
  258. package/dist/themes/helpers.d.ts.map +1 -1
  259. package/dist/themes/helpers.js +24 -0
  260. package/dist/themes/makeTheme.d.ts +3 -0
  261. package/dist/themes/makeTheme.d.ts.map +1 -1
  262. package/dist/themes/makeTheme.js +7 -1
  263. package/dist/themes/theme.css.d.ts +4 -0
  264. package/dist/themes/theme.css.d.ts.map +1 -1
  265. package/dist/themes/theme.css.js +16 -0
  266. package/dist/types/index.d.ts +9 -0
  267. package/dist/types/index.d.ts.map +1 -1
  268. package/dist/utils/css.d.ts +15 -0
  269. package/dist/utils/css.d.ts.map +1 -1
  270. package/dist/utils/css.js +18 -0
  271. package/dist/utils/dataAttrs.d.ts +3 -0
  272. package/dist/utils/dataAttrs.d.ts.map +1 -1
  273. package/dist/utils/dataAttrs.js +3 -0
  274. package/dist/utils/estimateTextWidth.js +3 -2
  275. package/dist/utils/index.d.ts +21 -0
  276. package/dist/utils/index.d.ts.map +1 -1
  277. package/dist/utils/index.js +39 -0
  278. package/dist/utils/number.js +7 -2
  279. package/dist/utils/propGuards.d.ts +14 -0
  280. package/dist/utils/propGuards.d.ts.map +1 -1
  281. package/dist/utils/propGuards.js +14 -0
  282. package/dist/utils/responsiveProps.css.js +1 -1
  283. package/dist/utils/sprinkles.d.ts +18 -0
  284. package/dist/utils/sprinkles.d.ts.map +1 -1
  285. package/dist/utils/sprinkles.js +21 -1
  286. package/package.json +19 -19
@@ -6,16 +6,18 @@ import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
6
6
  __vanilla_filescope__.setFileScope("lib/styles/sprinkles.css.ts", "@autoguru/overdrive");
7
7
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
8
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
+ /* eslint-disable sonarjs/no-duplicate-string */
9
10
  import { createSprinkles, defineProperties } from '@vanilla-extract/sprinkles';
10
11
  import { mapValues } from 'es-toolkit';
11
12
  import { breakpoints } from "../themes/makeTheme.js";
12
13
  import { overdriveTokens as tokens } from "../themes/theme.css.js";
13
14
  import { arrayFromKeys } from "../utils/object.js";
14
- import { cssLayerUtil } from "./layers.css.js";
15
+ import { cssLayerStyleprops } from "./layers.css.js";
15
16
  import { gapVar } from "./vars.css.js";
16
17
  const {
17
18
  space
18
19
  } = tokens;
20
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
19
21
  const {
20
22
  none
21
23
  } = space,
@@ -73,6 +75,8 @@ const gapSizesWithVar = mapValues(space, value => ({
73
75
  },
74
76
  gap: value
75
77
  }));
78
+
79
+ // --- MAPPED COLOURS ---
76
80
  const mappedBackgroundColours = mapValues(backgroundColours, backgroundColor => ({
77
81
  backgroundColor
78
82
  }));
@@ -91,9 +95,22 @@ const mappedBorderTopColours = mapValues(borderColours, borderTopColor => ({
91
95
  const mappedColours = mapValues(colours, color => ({
92
96
  color
93
97
  }));
98
+
99
+ // --- VALUE ARRAYS ---
100
+ // (Useful for Storybook controls, etc.)
101
+ export const valueArrays = {
102
+ borderColors: arrayFromKeys(borderColors),
103
+ gapSizesWithVar: arrayFromKeys(gapSizesWithVar),
104
+ intentBackgroundColoursStandard: arrayFromKeys(intentBackgroundColoursStandard),
105
+ intentBorderColours: arrayFromKeys(intentBorderColours),
106
+ intentForegroundColours: arrayFromKeys(intentForegroundColours)
107
+ };
108
+
109
+ // --- BASE SPRINKLES (NON-RESPONSIVE) ---
94
110
  const baseProperties = defineProperties({
95
- '@layer': cssLayerUtil,
111
+ '@layer': cssLayerStyleprops,
96
112
  properties: {
113
+ // Borders
97
114
  borderBottomColor: borderColors,
98
115
  borderLeftColor: borderColors,
99
116
  borderRightColor: borderColors,
@@ -106,6 +123,7 @@ const baseProperties = defineProperties({
106
123
  borderBottomStyle: ['none', 'solid'],
107
124
  borderRightStyle: ['none', 'solid'],
108
125
  borderTopStyle: ['none', 'solid'],
126
+ // Color
109
127
  color: tokens.color.content,
110
128
  colour: mappedColours,
111
129
  backgroundColor: _objectSpread(_objectSpread({}, tokens.color.surface), {}, {
@@ -113,13 +131,16 @@ const baseProperties = defineProperties({
113
131
  }),
114
132
  backgroundColour: mappedBackgroundColours,
115
133
  opacity: [0, '1', '0'],
134
+ // Typography
116
135
  lineHeight: mapValues(tokens.typography.size, size => size.lineHeight),
117
136
  fontSize: mapValues(tokens.typography.size, size => size.fontSize),
118
137
  fontWeight: tokens.typography.fontWeight,
119
138
  textTransform: ['capitalize', 'lowercase', 'uppercase'],
120
139
  textWrap: ['balance', 'pretty', 'stable', 'nowrap'],
121
140
  wordBreak: ['break-all', 'break-word', 'keep-all'],
141
+ // Shadows
122
142
  boxShadow: tokens.elevation,
143
+ // Misc
123
144
  pointerEvents: ['auto', 'none'],
124
145
  userSelect: ['auto', 'text', 'none'],
125
146
  useVar: {
@@ -145,6 +166,8 @@ const baseProperties = defineProperties({
145
166
  borderStyleTop: ['borderTopStyle']
146
167
  }
147
168
  });
169
+
170
+ // --- RESPONSIVE SPRINKLES ---
148
171
  export const responsiveConditions = {
149
172
  mobile: {},
150
173
  tablet: {
@@ -158,7 +181,7 @@ export const responsiveConditions = {
158
181
  }
159
182
  };
160
183
  const responsiveProperties = defineProperties({
161
- '@layer': cssLayerUtil,
184
+ '@layer': cssLayerStyleprops,
162
185
  conditions: responsiveConditions,
163
186
  defaultCondition: 'mobile',
164
187
  responsiveArray: ['mobile', 'tablet', 'desktop', 'largeDesktop'],
@@ -185,11 +208,13 @@ const responsiveProperties = defineProperties({
185
208
  centre: 'center',
186
209
  right: 'right'
187
210
  },
211
+ // Borders
188
212
  borderRadius: tokens.border.radius,
189
213
  borderLeftWidth: tokens.border.width,
190
214
  borderBottomWidth: tokens.border.width,
191
215
  borderRightWidth: tokens.border.width,
192
216
  borderTopWidth: tokens.border.width,
217
+ // Size
193
218
  height: _objectSpread(_objectSpread({}, spaceWithoutNone), {}, {
194
219
  'fit-content': 'fit-content',
195
220
  'max-content': 'max-content',
@@ -212,25 +237,31 @@ const responsiveProperties = defineProperties({
212
237
  gap: gapSizesWithVar,
213
238
  columnGap: space,
214
239
  rowGap: space,
240
+ // Alignment
215
241
  alignContent: flexAlignmentsWithSpace,
216
242
  alignItems: _objectSpread(_objectSpread({}, flexAlignments), {}, {
217
243
  baseline: 'baseline'
218
244
  }),
219
245
  alignSelf: flexAlignments,
220
246
  justifyContent: _objectSpread({}, flexAlignmentsWithSpace),
247
+ // Flexbox
221
248
  flexDirection: ['row', 'column', 'row-reverse', 'column-reverse'],
222
249
  flexGrow: [0, '0', '1'],
223
250
  flexShrink: [0, '0', '1'],
224
251
  flexWrap: ['nowrap', 'wrap', 'wrap-reverse'],
225
252
  order: [0, '0', '1', '2', '3', '4'],
253
+ // Grid
226
254
  gridAutoColumns: ['auto', '1fr', 'min-content', 'max-content'],
227
255
  gridAutoRows: ['auto', '1fr'],
228
256
  gridAutoFlow: ['row', 'column', 'row dense', 'column dense'],
229
257
  gridColumns: ['1', 'auto'],
258
+ // Note: original had ['1', 'auto'], assuming this is correct
259
+ // Padding
230
260
  paddingBottom: tokens.space,
231
261
  paddingLeft: tokens.space,
232
262
  paddingRight: tokens.space,
233
263
  paddingTop: tokens.space,
264
+ // Margin
234
265
  marginBottom: tokens.space,
235
266
  marginLeft: _objectSpread(_objectSpread({}, tokens.space), {}, {
236
267
  auto: 'auto'
@@ -273,15 +304,9 @@ const responsiveProperties = defineProperties({
273
304
  }
274
305
  });
275
306
  export const sprinkles = createSprinkles(baseProperties, responsiveProperties);
276
- export const valueArrays = {
277
- alignItems: arrayFromKeys(responsiveProperties.styles.alignItems.values),
278
- borderColors: arrayFromKeys(borderColors),
279
- gapSizesWithVar: arrayFromKeys(gapSizesWithVar),
280
- intentBackgroundColoursStandard: arrayFromKeys(intentBackgroundColoursStandard),
281
- intentBorderColours: arrayFromKeys(intentBorderColours),
282
- intentForegroundColours: arrayFromKeys(intentForegroundColours),
283
- justifyContent: arrayFromKeys(responsiveProperties.styles.justifyContent.values),
284
- spaceWithNone: arrayFromKeys(space),
285
- width: arrayFromKeys(responsiveProperties.styles.width.values)
286
- };
307
+
308
+ /**
309
+ * Legacy colours are not a discreet combination of all colours as many typeography colour
310
+ * tokens are overwritten by the intentional colour sets
311
+ */
287
312
  __vanilla_filescope__.endFileScope();
@@ -6,6 +6,10 @@ export declare const sprinklesLegacyText: ((props: {
6
6
  properties: Set<"color">;
7
7
  };
8
8
  export type LegacyTextColours = Parameters<typeof sprinklesLegacyText>[0]['color'];
9
+ /**
10
+ * The global typography style function. Currently responsive values are not supported.
11
+ * To allow for responsive styles, use the `sprinkles` directly.
12
+ */
9
13
  export declare const typographyStyles: import("@vanilla-extract/recipes").RuntimeFn<{
10
14
  as: {
11
15
  label: string;
@@ -51,16 +55,26 @@ export declare const typographyStyles: import("@vanilla-extract/recipes").Runtim
51
55
  }>;
52
56
  export type TypographyVariants = NonNullable<RecipeVariants<typeof typographyStyles>>;
53
57
  export interface TypographyStyleProps {
58
+ /** Aligns text horizontally */
54
59
  align?: Sprinkles['textAlign'];
60
+ /** Forces long words to break */
55
61
  breakWord?: TypographyVariants['breakWord'];
62
+ /** Set the text colour */
56
63
  color?: Sprinkles['color'];
64
+ /** _in transistion_ Prefer `color` */
57
65
  colour?: TypographyVariants['colour'];
66
+ /** @deprecated prefer `textWrap` prop as it supports all wrapping values */
58
67
  noWrap?: TypographyVariants['noWrap'];
68
+ /** Font size of the text */
59
69
  size?: TypographyVariants['size'];
60
70
  strong?: TypographyVariants['strong'];
71
+ /** Applies text capitalisation style */
61
72
  transform?: TypographyVariants['transform'];
73
+ /** The font weight */
62
74
  weight?: TypographyVariants['weight'];
75
+ /** Control the text wrapping */
63
76
  wrap?: Sprinkles['textWrap'];
77
+ /** Control word break during wrapping */
64
78
  wordBreak?: Sprinkles['wordBreak'];
65
79
  }
66
80
  //# sourceMappingURL=typography.css.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typography.css.d.ts","sourceRoot":"","sources":["../../lib/styles/typography.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAQlE,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAY5D,eAAO,MAAM,mBAAmB;;;;CAAw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ACzC,OAAO,mBAAmB,CAC1B,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAEd;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgF3B,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAC3C,cAAc,CAAC,OAAO,gBAAgB,CAAC,CACvC,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACpC,+BAA+B;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAC/B,iCAAiC;IACjC,SAAS,CAAC,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC5C,0BAA0B;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,sCAAsC;IACtC,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,4EAA4E;IAC5E,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,4BAA4B;IAC5B,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,wCAAwC;IACxC,SAAS,CAAC,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC5C,sBAAsB;IACtB,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,gCAAgC;IAChC,IAAI,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;IAC7B,yCAAyC;IACzC,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CACnC"}
@@ -21,6 +21,10 @@ const legacyTextProperties = defineProperties({
21
21
  }
22
22
  });
23
23
  export const sprinklesLegacyText = createSprinkles(legacyTextProperties);
24
+ /**
25
+ * The global typography style function. Currently responsive values are not supported.
26
+ * To allow for responsive styles, use the `sprinkles` directly.
27
+ */
24
28
  export const typographyStyles = recipe({
25
29
  base: {
26
30
  '@layer': {
@@ -46,6 +50,7 @@ export const typographyStyles = recipe({
46
50
  color: mapValues(tokens.color.content, (_, color) => sprinkles({
47
51
  color
48
52
  })),
53
+ // map legacy typography colours to this prop spelling
49
54
  colour: _objectSpread(_objectSpread({}, mapValues(tokens.typography.colour, (_, color) => sprinklesLegacyText({
50
55
  color
51
56
  }))), {}, {
@@ -3,5 +3,7 @@
3
3
  import * as __vanilla_filescope__ from '@vanilla-extract/css/fileScope';
4
4
  __vanilla_filescope__.setFileScope("lib/styles/vars.css.ts", "@autoguru/overdrive");
5
5
  import { createGlobalVar } from '@vanilla-extract/css';
6
+
7
+ // --- CSS variables for export
6
8
  export const gapVar = createGlobalVar('od-var-gap');
7
9
  __vanilla_filescope__.endFileScope();
@@ -5,7 +5,9 @@ __vanilla_filescope__.setFileScope("lib/themes/base/theme.css.ts", "@autoguru/ov
5
5
  import { createTheme, createGlobalTheme } from '@vanilla-extract/css';
6
6
  import { themeTokensWithLayer } from "../makeTheme.js";
7
7
  import { overdriveTokens } from "../theme.css.js";
8
- import { tokens } from "./tokens.js";
8
+ import { tokens } from "./tokens.js"; // global themes -- all themes can be declared here as they do not require exporting
9
9
  export const baseThemeLight = createGlobalTheme(':root, [data-od-theme=base], [data-od-theme=base][data-od-color-mode=light]', overdriveTokens, themeTokensWithLayer(tokens));
10
+
11
+ // base theme
10
12
  export const baseThemeClassName = createTheme(overdriveTokens, themeTokensWithLayer(tokens), 'OD_Base');
11
13
  __vanilla_filescope__.endFileScope();
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Here lie the global tokens for theming Overdrive
3
+ */
1
4
  export declare const tokens: {
2
5
  mode: string;
3
6
  body: {
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../lib/themes/base/tokens.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6QI,CAAC"}
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../lib/themes/base/tokens.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6QI,CAAC"}
@@ -6,6 +6,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
6
6
  import { buildColourGamut } from "../makeTheme.js";
7
7
  import { overdriveTokens } from "../theme.css.js";
8
8
  import { colourMap, colourMapWithoutWhite, secondaryForeground } from "./colours.js";
9
+ /**
10
+ * Here lie the global tokens for theming Overdrive
11
+ */
9
12
  export const tokens = {
10
13
  mode: 'light',
11
14
  body: {
@@ -1,4 +1,26 @@
1
1
  import type { CSSVarFunction } from '@vanilla-extract/private';
2
+ /**
3
+ * Utility type that extracts the raw token type from a vanilla-extract theme contract.
4
+ * This allows you to use the same type structure as the theme contract but with raw values
5
+ * instead of CSS var functions.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { overdriveTokens } from './theme.css';
10
+ *
11
+ * type Tokens = TokensFromContract<typeof overdriveTokens>;
12
+ *
13
+ * // Now you can use this type for your token objects
14
+ * const myTokens: Tokens = {
15
+ * mode: 'light',
16
+ * body: {
17
+ * backgroundColour: '#ffffff',
18
+ * colour: '#000000'
19
+ * }
20
+ * // ... rest of the tokens
21
+ * };
22
+ * ```
23
+ */
2
24
  export type TokensFromContract<T> = {
3
25
  [P in keyof T]: T[P] extends CSSVarFunction ? string : T[P] extends Record<string, unknown> ? TokensFromContract<T[P]> : T[P];
4
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../lib/themes/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAyB/D,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI;KAClC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,cAAc,GACxC,MAAM,GACN,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACxB,CAAC,CAAC,CAAC,CAAC;CACR,CAAC;AAEF,UAAU,iBAAiB;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;IAClC,WAAW,EAAE,OA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
2
2
 
3
3
  import { colord } from 'colord';
4
+
5
+ /**
6
+ * Utility type that extracts the raw token type from a vanilla-extract theme contract.
7
+ * This allows you to use the same type structure as the theme contract but with raw values
8
+ * instead of CSS var functions.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { overdriveTokens } from './theme.css';
13
+ *
14
+ * type Tokens = TokensFromContract<typeof overdriveTokens>;
15
+ *
16
+ * // Now you can use this type for your token objects
17
+ * const myTokens: Tokens = {
18
+ * mode: 'light',
19
+ * body: {
20
+ * backgroundColour: '#ffffff',
21
+ * colour: '#000000'
22
+ * }
23
+ * // ... rest of the tokens
24
+ * };
25
+ * ```
26
+ */
27
+
4
28
  export const shadedColour = _ref => {
5
29
  let {
6
30
  colour,
@@ -1,6 +1,9 @@
1
1
  import type { BreakPoints, ColourMap, FlattenedColours, ThemeTokens } from '.';
2
2
  export declare const breakpoints: BreakPoints;
3
3
  export declare const mediaQuery: Record<import("./types").DeviceSize, string>;
4
+ /**
5
+ * Wraps theme tokens with `theme` CSS layer using the vanilla-extract method
6
+ */
4
7
  export declare const themeTokensWithLayer: (tokens: ThemeTokens) => {
5
8
  mode: string;
6
9
  body: import("./helpers").TokensFromContract<{
@@ -1 +1 @@
1
- {"version":3,"file":"makeTheme.d.ts","sourceRoot":"","sources":["../../lib/themes/makeTheme.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAE/E,eAAO,MAAM,WAAW,EAAE,WAKzB,CAAC;AAEF,eAAO,MAAM,UAAU,8CAGtB,CAAC;AAKF,eAAO,MAAM,oBAAoB,GAAI,QAAQ,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGtD,CAAC;AAEH,eAAO,MAAM,iBAAiB,GAC7B,qBAAoB,WAAyB;;CAG5C,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEjE,eAAO,MAAM,gBAAgB,GAAI,SAAS,SAAS,KAAG,gBAepD,CAAC"}
@@ -8,10 +8,16 @@ import { cssLayerTheme } from "../styles/layers.css.js";
8
8
  export const breakpoints = {
9
9
  mobile: '0px',
10
10
  tablet: '768px',
11
+ // IPad mini width (1024 - 25%)
11
12
  desktop: '1024px',
12
- largeDesktop: '1920px'
13
+ // IPad Pro width (1366 - 25%)
14
+ largeDesktop: '1920px' // 1080p width (1920 - 25%)
13
15
  };
14
16
  export const mediaQuery = mapValues(breakpoints, breakpoint => `screen and (min-width: ${breakpoint})`);
17
+
18
+ /**
19
+ * Wraps theme tokens with `theme` CSS layer using the vanilla-extract method
20
+ */
15
21
  export const themeTokensWithLayer = tokens => _objectSpread({
16
22
  '@layer': cssLayerTheme
17
23
  }, tokens);
@@ -68,6 +68,9 @@ declare const colours: {
68
68
  };
69
69
  };
70
70
  export type Colours = typeof colours;
71
+ /**
72
+ * The global Overdrive tokens generated by the vanilla-extract theme contract
73
+ */
71
74
  export declare const overdriveTokens: {
72
75
  mode: `var(--${string})`;
73
76
  body: {
@@ -461,5 +464,6 @@ export declare const overdriveTokens: {
461
464
  };
462
465
  export { overdriveTokens as themeContractVars };
463
466
  export type ThemeTokens = TokensFromContract<typeof overdriveTokens>;
467
+ /** *Reccomend replace usage*: `container` should be impored from `lib/reset/reset.css` */
464
468
  export declare const container: string;
465
469
  //# sourceMappingURL=theme.css.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.css.d.ts","sourceRoot":"","sources":["../../lib/themes/theme.css.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI3B,CAAC;AAGF,OAAO,EAAE,eAAe,IAAI,iBAAiB,EAAE,CAAC;AAEhD,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,eAAe,CAAC,CAAC;AAErE,0FAA0F;AAC1F,eAAO,MAAM,SAAS,QAKpB,CAAC"}
@@ -78,6 +78,12 @@ const colours = {
78
78
  const coloursWithWhite = _objectSpread(_objectSpread({}, colours), {}, {
79
79
  white: 'color-gamut-white'
80
80
  });
81
+
82
+ /**
83
+ * Overdrive master theme contract is IN TRANSISTION. Where values are present, they create a global CSS var
84
+ * mapping for the corresponding key. Where values are null, these keys are being phased out and do not exist
85
+ * in global CSS vars.
86
+ */
81
87
  const THEME_CONTRACT = {
82
88
  mode: 'mode',
83
89
  body: {
@@ -101,6 +107,7 @@ const THEME_CONTRACT = {
101
107
  '9': 'space-9',
102
108
  none: 'space-none'
103
109
  },
110
+ // new colour token structure 2025
104
111
  color: {
105
112
  gamut: coloursWithWhite,
106
113
  surface: {
@@ -136,6 +143,7 @@ const THEME_CONTRACT = {
136
143
  focusOutline: 'color-interactive-focus-outline'
137
144
  }
138
145
  },
146
+ // existing colours for compatability
139
147
  colours: {
140
148
  gamut: _objectSpread(_objectSpread({}, buildColourGamut(colours)), {}, {
141
149
  white: 'color-gamut-white'
@@ -306,6 +314,7 @@ const THEME_CONTRACT = {
306
314
  lineHeight: 'typography-size-9-line-height'
307
315
  }
308
316
  },
317
+ // phase out: typography specific colours for backwards compatibility
309
318
  colour: {
310
319
  primary: null,
311
320
  brand: null,
@@ -347,8 +356,15 @@ const THEME_CONTRACT = {
347
356
  overlayBg: 'opacity-overlay-bg'
348
357
  }
349
358
  };
359
+
360
+ /**
361
+ * The global Overdrive tokens generated by the vanilla-extract theme contract
362
+ */
350
363
  export const overdriveTokens = createGlobalThemeContract(THEME_CONTRACT, (cssVarName, path) => cssVarName === null ? `od-${path.join('-')}` : `od-${cssVarName}`);
364
+
365
+ // phase out: Export overdriveTokens alias as it's in use by the original themes and components
351
366
  export { overdriveTokens as themeContractVars };
367
+ /** *Reccomend replace usage*: `container` should be impored from `lib/reset/reset.css` */
352
368
  export const container = style({
353
369
  fontFamily: overdriveTokens.typography.fontFamily,
354
370
  fontSize: overdriveTokens.typography.size[4].fontSize,
@@ -1,8 +1,17 @@
1
1
  export interface OdComponent {
2
+ /**
3
+ * Output a data attribute with a component name in the markup, mainly used for the root element of a component
4
+ */
2
5
  odComponent?: string;
3
6
  }
4
7
  export interface TestId {
8
+ /**
9
+ * The test ID will be rendered as a data attribute on the element for e2e testing purposes
10
+ */
5
11
  testId?: string;
6
12
  }
13
+ /**
14
+ * Adds a testId property to the given type
15
+ */
7
16
  export type WithTestId<T = unknown> = T & TestId;
8
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAI3B,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,MAAM;IAItB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAKD,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,GAAG,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,MAAM;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,GAAG,MAAM,CAAC"}
@@ -6,5 +6,20 @@ export type InteractionStyleProps = Partial<Record<SelectorStates, StyleRule>>;
6
6
  export declare const notDisabled = ":not(:disabled,[data-disabled])";
7
7
  export declare const notFocused = ":not(:focus,[data-focus],[data-focused])";
8
8
  export declare const notSelected = ":not(:checked,[data-checked],[data-selected])";
9
+ /**
10
+ * Creates style variants for different interaction states that can be spread
11
+ * within vanilla-extract `style` object.
12
+ *
13
+ * @example
14
+ * const buttonStyle = style({
15
+ * backgroundColor: tokens.colours.background.primary,
16
+ * color: tokens.colours.text.primary,
17
+ * ...interactionStyle({
18
+ * initial: { background: 'white', color: 'black' },
19
+ * hover: { background: 'lightgray' },
20
+ * disabled: { opacity: 0.5 }
21
+ * })
22
+ * });
23
+ */
9
24
  export declare const interactionStyle: (selectors: InteractionStyleProps) => StyleRule;
10
25
  //# sourceMappingURL=css.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../lib/utils/css.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,WAIzC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC9B,aAAa,MAAM,GAAG,IAAI,EAC1B,QAAQ,MAAM,GAAG,IAAI,KACnB,MAQF,CAAC;AAEF,MAAM,MAAM,cAAc,GACvB,MAAM,GACN,QAAQ,GACR,SAAS,GACT,UAAU,GACV,UAAU,GACV,OAAO,GACP,cAAc,GACd,OAAO,GACP,eAAe,GACf,kBAAkB,CAAC;AACtB,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC;AAG/E,eAAO,MAAM,WAAW,oCAAoC,CAAC;AAC7D,eAAO,MAAM,UAAU,6CAA6C,CAAC;AACrE,eAAO,MAAM,WAAW,kDAAkD,CAAC;AAiB3E,eAAO,MAAM,gBAAgB,GAC5B,WAAW,qBAAqB,KAC9B,SAwBF,CAAC"}
1
+ {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../lib/utils/css.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,WAIzC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC9B,aAAa,MAAM,GAAG,IAAI,EAC1B,QAAQ,MAAM,GAAG,IAAI,KACnB,MAQF,CAAC;AAEF,MAAM,MAAM,cAAc,GACvB,MAAM,GACN,QAAQ,GACR,SAAS,GACT,UAAU,GACV,UAAU,GACV,OAAO,GACP,cAAc,GACd,OAAO,GACP,eAAe,GACf,kBAAkB,CAAC;AACtB,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC,CAAC;AAG/E,eAAO,MAAM,WAAW,oCAAoC,CAAC;AAC7D,eAAO,MAAM,UAAU,6CAA6C,CAAC;AACrE,eAAO,MAAM,WAAW,kDAAkD,CAAC;AAE3E;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAC5B,WAAW,qBAAqB,KAC9B,SAwBF,CAAC"}
package/dist/utils/css.js CHANGED
@@ -21,6 +21,22 @@ export const getThemeTokenValue = (themeClass, token) => {
21
21
  export const notDisabled = ':not(:disabled,[data-disabled])';
22
22
  export const notFocused = ':not(:focus,[data-focus],[data-focused])';
23
23
  export const notSelected = ':not(:checked,[data-checked],[data-selected])';
24
+
25
+ /**
26
+ * Creates style variants for different interaction states that can be spread
27
+ * within vanilla-extract `style` object.
28
+ *
29
+ * @example
30
+ * const buttonStyle = style({
31
+ * backgroundColor: tokens.colours.background.primary,
32
+ * color: tokens.colours.text.primary,
33
+ * ...interactionStyle({
34
+ * initial: { background: 'white', color: 'black' },
35
+ * hover: { background: 'lightgray' },
36
+ * disabled: { opacity: 0.5 }
37
+ * })
38
+ * });
39
+ */
24
40
  export const interactionStyle = selectors => {
25
41
  const {
26
42
  base = {}
@@ -39,6 +55,8 @@ export const interactionStyle = selectors => {
39
55
  focusVisible: '&:focus-visible, &[data-focus-visible]',
40
56
  disabled: '&:disabled, &[data-disabled]'
41
57
  };
58
+
59
+ // Add selectors for each interaction state that has styles
42
60
  Object.entries(interactionStyles).forEach(_ref => {
43
61
  let [state, stateStyles] = _ref;
44
62
  if (state in rules && stateStyles) {
@@ -1,6 +1,9 @@
1
1
  export interface DataAttributes {
2
2
  [key: string]: string | boolean | undefined;
3
3
  }
4
+ /**
5
+ * Consistent mapping of props to data attributes
6
+ */
4
7
  export declare function dataAttrs(attrs: DataAttributes): {
5
8
  [key: string]: string;
6
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"dataAttrs.d.ts","sourceRoot":"","sources":["../../lib/utils/dataAttrs.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAC5C;AAKD,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc;;EAW9C"}
1
+ {"version":3,"file":"dataAttrs.d.ts","sourceRoot":"","sources":["../../lib/utils/dataAttrs.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAC5C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc;;EAW9C"}
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
2
 
3
+ /**
4
+ * Consistent mapping of props to data attributes
5
+ */
3
6
  export function dataAttrs(attrs) {
4
7
  return Object.entries(attrs).reduce((acc, _ref) => {
5
8
  let [key, value] = _ref;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
 
3
+ // Estimate input width based on the width of each character in the value prop
3
4
  const narrowChars = /[!"'()*+,./:;<=>?I[\\\]^_`b-vx-z{|}~-]/g;
4
5
  const wideChars = /[\dA-HJ-Z]/g;
5
- const narrowCharWidth = 0.5;
6
- const defaultCharWidth = 0.8;
6
+ const narrowCharWidth = 0.5; // Fraction of ch to assign to narrow characters
7
+ const defaultCharWidth = 0.8; // Fraction of ch to assign to narrow characters
7
8
  export const estimateTextWidth = value => {
8
9
  if (!value) return '0ch';
9
10
  const charWidths = value.split('').map(char => {
@@ -7,15 +7,36 @@ export declare const useUncontrolledState: <T extends unknown>(value: T, onChang
7
7
  export declare const useInputControlledState: <T, H>(incomingValue: T, incomingOnChange?: H) => [T, H];
8
8
  export declare const useId: (idFromProps?: string) => string | null;
9
9
  export declare const setRef: <T>(ref: Ref<T>, value: T) => void;
10
+ /**
11
+ * Used to merge multiple refs into a single ref callback
12
+ * @param refs an array of refs
13
+ */
10
14
  export declare function mergeRefs<T>(refs: Array<Ref<T> | undefined | null>): RefCallback<T>;
11
15
  export declare const isHtmlElement: (element: unknown) => element is Element;
12
16
  export declare const hex2rgba: (c: any, alpha?: string) => string;
13
17
  export declare const ownerDocument: (node?: Node) => Document;
14
18
  export declare const ownerWindow: (node?: Node) => Window;
19
+ /**
20
+ * A method to be used when dealing with callbacks that depend on data, but you don't want to trigger re-renders.
21
+ *
22
+ * @see {@link https://github.com/facebook/react/issues/14099#issuecomment-440013892|facebook/react#14099}
23
+ *
24
+ * @param fn
25
+ */
15
26
  export declare const useEventCallback: <T extends Function>(fn: T) => (...args: any[]) => undefined;
16
27
  export declare const animate: <T extends HTMLElement>(element: T, property: keyof T, to: number, duration?: number) => (() => void) | void;
17
28
  export type Alignment = 'left' | 'right' | 'center';
18
29
  export declare const alignmentToFlexAlignment: (align: Alignment) => Sprinkles["justifyContent"];
30
+ /**
31
+ * A function that returns the first item in the array, if the index exceeds its maximum length
32
+ *
33
+ * @example
34
+ * ```js
35
+ * const sortFlowRingLookup = arrayRingLookup(['asc', 'desc', 'none']);
36
+ *
37
+ * expect(sortFlowRingLookup(4)).toBe('desc');
38
+ * ```
39
+ */
19
40
  export declare const arrayRingLookup: <T extends ArrayLike<unknown>>(collection: T) => (index: any) => unknown;
20
41
  export declare const noop: () => void;
21
42
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAa,MAAM,OAAO,CAAC;AACzD,OAAO,EAEN,SAAS,EAIT,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,eAAO,MAAM,SAAS,SAAgC,CAAC;AAEvD,eAAO,MAAM,sBAAsB,kBAA0C,CAAC;AAG9E,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,OAAO,EACrD,OAAO,CAAC,EACR,WAAW,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,KAC3B,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAMxB,CAAC;AAGF,eAAO,MAAM,uBAAuB,GAAI,CAAC,EAAE,CAAC,EAC3C,eAAe,CAAC,EAChB,mBAAmB,CAAC,KAClB,CAAC,CAAC,EAAE,CAAC,CAWP,CAAC;AAaF,eAAO,MAAM,KAAK,GAAI,cAAc,MAAM,KAAG,MAAM,GAAG,IAkBrD,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO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