@loadsmart/loadsmart-ui 5.10.0 → 5.11.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 (271) hide show
  1. package/dist/common/SelectionWrapper.d.ts +1 -1
  2. package/dist/components/Accordion/Accordion.d.ts +1 -1
  3. package/dist/components/Accordion/Accordion.stories.d.ts +1 -1
  4. package/dist/components/Banner/Banner.stories.d.ts +1 -1
  5. package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +1 -1
  6. package/dist/components/Button/Button.stories.d.ts +1 -1
  7. package/dist/components/Calendar/Calendar.stories.d.ts +2 -7
  8. package/dist/components/Calendar/Date.helper.d.ts +47 -12
  9. package/dist/components/Card/Card.stories.d.ts +1 -1
  10. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  11. package/dist/components/Checkbox/Checkbox.stories.d.ts +1 -1
  12. package/dist/components/Dialog/Dialog.stories.d.ts +1 -1
  13. package/dist/components/DragDropFile/DragDropFile.stories.d.ts +1 -1
  14. package/dist/components/Drawer/Drawer.stories.d.ts +1 -1
  15. package/dist/components/Dropdown/Dropdown.stories.d.ts +5 -2
  16. package/dist/components/EmptyState/EmptyState.stories.d.ts +1 -1
  17. package/dist/components/ErrorMessage/ErrorMessage.stories.d.ts +1 -1
  18. package/dist/components/HighlightMatch/HighlightMatch.stories.d.ts +1 -1
  19. package/dist/components/IconFactory/IconFactory.stories.d.ts +1 -1
  20. package/dist/components/Label/Label.d.ts +2 -2
  21. package/dist/components/Label/Label.stories.d.ts +1 -1
  22. package/dist/components/Layout/Box.d.ts +1 -1
  23. package/dist/components/Layout/Grid.d.ts +1 -1
  24. package/dist/components/Layout/Layout.stories.d.ts +1 -1
  25. package/dist/components/Layout/Sidebar.d.ts +1 -1
  26. package/dist/components/Layout/Switcher.d.ts +1 -1
  27. package/dist/components/Link/Link.stories.d.ts +1 -1
  28. package/dist/components/Link/useSafeLink.d.ts +1 -1
  29. package/dist/components/Loaders/LoadingBar.stories.d.ts +2 -2
  30. package/dist/components/Loaders/LoadingDots.stories.d.ts +1 -1
  31. package/dist/components/Loaders/Spinner.stories.d.ts +1 -1
  32. package/dist/components/Modal/Modal.stories.d.ts +1 -1
  33. package/dist/components/Pagination/Pagination.stories.d.ts +1 -1
  34. package/dist/components/Pagination/Pagination.types.d.ts +2 -2
  35. package/dist/components/Popover/Popover.stories.d.ts +1 -1
  36. package/dist/components/ProgressBar/ProgressBar.stories.d.ts +1 -1
  37. package/dist/components/Radio/Radio.d.ts +1 -1
  38. package/dist/components/Radio/Radio.stories.d.ts +1 -1
  39. package/dist/components/Section/Sections.stories.d.ts +1 -1
  40. package/dist/components/Select/Select.fixtures.d.ts +1 -1
  41. package/dist/components/Select/Select.stories.d.ts +1 -1
  42. package/dist/components/Select/Select.types.d.ts +2 -2
  43. package/dist/components/Select/SelectCreatableOption.d.ts +1 -1
  44. package/dist/components/Select/SelectEmpty.d.ts +1 -1
  45. package/dist/components/Select/components.d.ts +1 -1
  46. package/dist/components/Select/useSelectExternal.d.ts +1 -1
  47. package/dist/components/SideNavigation/SideNavigation.stories.d.ts +1 -1
  48. package/dist/components/Steps/Steps.d.ts +1 -1
  49. package/dist/components/Steps/Steps.stories.d.ts +1 -1
  50. package/dist/components/Steps/StepsStep.d.ts +1 -1
  51. package/dist/components/Switch/Switch.stories.d.ts +1 -1
  52. package/dist/components/Table/Table.stories.d.ts +1 -1
  53. package/dist/components/Table/Table.types.d.ts +3 -4
  54. package/dist/components/Table/TableSortHandle.d.ts +1 -1
  55. package/dist/components/TablePagination/RowsPerPage.d.ts +1 -1
  56. package/dist/components/TablePagination/TablePagination.stories.d.ts +1 -1
  57. package/dist/components/TablePagination/TablePagination.types.d.ts +1 -1
  58. package/dist/components/TablePagination/TablePaginationActions.d.ts +1 -1
  59. package/dist/components/Tag/Tag.stories.d.ts +1 -1
  60. package/dist/components/Text/Text.d.ts +1 -1
  61. package/dist/components/Text/Text.stories.d.ts +1 -1
  62. package/dist/components/TextField/TextField.d.ts +1 -1
  63. package/dist/components/TextField/TextField.stories.d.ts +1 -1
  64. package/dist/components/Textarea/Textarea.d.ts +1 -1
  65. package/dist/components/Textarea/Textarea.stories.d.ts +1 -1
  66. package/dist/components/Toast/Toast.stories.d.ts +1 -1
  67. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +1 -1
  68. package/dist/components/Tooltip/Tooltip.d.ts +3 -2
  69. package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -1
  70. package/dist/hooks/useFocusTrap/useFocusTrap.stories.d.ts +1 -1
  71. package/dist/hooks/useHeightExpansionToggler/useHeightExpansionToggler.d.ts +1 -1
  72. package/dist/index.js +339 -491
  73. package/dist/index.js.map +1 -1
  74. package/dist/styles/activatable.d.ts +1 -1
  75. package/dist/styles/disableable.d.ts +1 -1
  76. package/dist/styles/focusable.d.ts +1 -1
  77. package/dist/styles/hoverable.d.ts +1 -1
  78. package/dist/testing/getInterpolatedStyles/getInterpolatedStyles.d.ts +1 -1
  79. package/dist/testing/index.js.map +1 -1
  80. package/dist/tests/generator.d.ts +35 -0
  81. package/dist/tests/renderer.d.ts +10 -0
  82. package/dist/theming/index.d.ts +2 -2
  83. package/dist/theming/index.js.map +1 -1
  84. package/package.json +9 -10
  85. package/src/common/CloseButton/CloseButton.tsx +7 -11
  86. package/src/common/SelectionWrapper.tsx +8 -8
  87. package/src/components/Accordion/Accordion.stories.tsx +2 -2
  88. package/src/components/Accordion/Accordion.test.tsx +2 -2
  89. package/src/components/Accordion/Accordion.tsx +24 -29
  90. package/src/components/Banner/Banner.stories.tsx +1 -1
  91. package/src/components/Banner/Banner.test.tsx +2 -2
  92. package/src/components/Banner/Banner.tsx +2 -2
  93. package/src/components/Breadcrumbs/Breadbrumbs.test.tsx +2 -2
  94. package/src/components/Breadcrumbs/Breadcrumb.tsx +3 -4
  95. package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +1 -1
  96. package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
  97. package/src/components/Button/Button.stories.tsx +1 -1
  98. package/src/components/Button/Button.test.tsx +2 -2
  99. package/src/components/Button/Button.tsx +17 -20
  100. package/src/components/Calendar/Calendar.stories.tsx +4 -2
  101. package/src/components/Calendar/Calendar.test.tsx +3 -3
  102. package/src/components/Calendar/Calendar.tsx +4 -8
  103. package/src/components/Calendar/Date.helper.test.ts +463 -15
  104. package/src/components/Calendar/Date.helper.ts +106 -45
  105. package/src/components/Calendar/PickerModeToggle.tsx +3 -6
  106. package/src/components/Calendar/Pickers/DayPicker.test.tsx +2 -2
  107. package/src/components/Calendar/Pickers/DayPicker.tsx +1 -1
  108. package/src/components/Calendar/Pickers/MonthPicker.test.tsx +2 -2
  109. package/src/components/Calendar/Pickers/MonthPicker.tsx +1 -1
  110. package/src/components/Calendar/Pickers/PickerButton.tsx +29 -39
  111. package/src/components/Calendar/Pickers/YearPicker.test.tsx +9 -7
  112. package/src/components/Calendar/Pickers/YearPicker.tsx +1 -1
  113. package/src/components/Card/Card.stories.tsx +2 -2
  114. package/src/components/Card/Card.test.tsx +2 -2
  115. package/src/components/Card/Card.tsx +6 -9
  116. package/src/components/Card/CardTitle.tsx +3 -3
  117. package/src/components/Checkbox/Checkbox.stories.tsx +1 -1
  118. package/src/components/Checkbox/Checkbox.test.tsx +2 -2
  119. package/src/components/Checkbox/Checkbox.tsx +15 -27
  120. package/src/components/DatePicker/DatePicker.test.tsx +2 -2
  121. package/src/components/DatePicker/DateRangePicker.stories.tsx +6 -1
  122. package/src/components/DatePicker/DateRangePicker.test.tsx +2 -2
  123. package/src/components/Dialog/Dialog.stories.tsx +1 -1
  124. package/src/components/Dialog/Dialog.test.tsx +2 -2
  125. package/src/components/Dialog/Dialog.tsx +5 -5
  126. package/src/components/DragDropFile/DragDropFile.stories.tsx +1 -1
  127. package/src/components/DragDropFile/components/DropZone.test.tsx +1 -1
  128. package/src/components/DragDropFile/styles.tsx +6 -11
  129. package/src/components/Drawer/Drawer.stories.tsx +1 -1
  130. package/src/components/Drawer/Drawer.test.tsx +1 -1
  131. package/src/components/Drawer/Drawer.tsx +6 -6
  132. package/src/components/Dropdown/Dropdown.stories.tsx +11 -6
  133. package/src/components/Dropdown/Dropdown.test.tsx +14 -16
  134. package/src/components/Dropdown/DropdownMenu.tsx +15 -28
  135. package/src/components/Dropdown/DropdownTrigger.tsx +24 -34
  136. package/src/components/EmptyState/EmptyState.stories.tsx +1 -1
  137. package/src/components/EmptyState/EmptyState.test.tsx +1 -1
  138. package/src/components/ErrorMessage/ErrorMessage.stories.tsx +1 -1
  139. package/src/components/ErrorMessage/ErrorMessage.test.tsx +1 -1
  140. package/src/components/HighlightMatch/HighlightMatch.stories.tsx +1 -1
  141. package/src/components/HighlightMatch/HighlightMatch.test.tsx +2 -2
  142. package/src/components/HighlightMatch/HighlightMatch.tsx +1 -1
  143. package/src/components/IconFactory/IconFactory.stories.tsx +1 -1
  144. package/src/components/IconFactory/IconFactory.test.tsx +2 -2
  145. package/src/components/Label/Label.stories.tsx +1 -1
  146. package/src/components/Label/Label.test.tsx +2 -2
  147. package/src/components/Label/Label.tsx +5 -5
  148. package/src/components/Layout/Box.tsx +1 -1
  149. package/src/components/Layout/Grid.tsx +1 -1
  150. package/src/components/Layout/Layout.stories.tsx +1 -1
  151. package/src/components/Layout/Sidebar.tsx +1 -1
  152. package/src/components/Layout/Switcher.tsx +1 -1
  153. package/src/components/Link/Link.stories.tsx +1 -1
  154. package/src/components/Link/Link.test.tsx +2 -2
  155. package/src/components/Link/Link.tsx +9 -13
  156. package/src/components/Link/useSafeLink.ts +1 -1
  157. package/src/components/Loaders/LoadingBar.stories.tsx +3 -3
  158. package/src/components/Loaders/LoadingBar.test.tsx +1 -1
  159. package/src/components/Loaders/LoadingBar.tsx +2 -2
  160. package/src/components/Loaders/LoadingDots.stories.tsx +1 -1
  161. package/src/components/Loaders/LoadingDots.test.tsx +1 -1
  162. package/src/components/Loaders/Spinner.stories.tsx +1 -1
  163. package/src/components/Loaders/Spinner.test.tsx +2 -2
  164. package/src/components/Modal/Modal.stories.tsx +1 -1
  165. package/src/components/Modal/Modal.test.tsx +2 -2
  166. package/src/components/Modal/Modal.tsx +7 -12
  167. package/src/components/Pagination/Pagination.stories.tsx +1 -1
  168. package/src/components/Pagination/Pagination.test.tsx +2 -2
  169. package/src/components/Pagination/Pagination.types.ts +2 -2
  170. package/src/components/Popover/Popover.stories.tsx +1 -1
  171. package/src/components/Popover/Popover.test.tsx +2 -2
  172. package/src/components/ProgressBar/ProgressBar.stories.tsx +1 -1
  173. package/src/components/ProgressBar/ProgressBar.test.tsx +1 -1
  174. package/src/components/ProgressBar/ProgressBar.tsx +4 -6
  175. package/src/components/Radio/Radio.stories.tsx +1 -1
  176. package/src/components/Radio/Radio.test.tsx +2 -2
  177. package/src/components/Radio/Radio.tsx +12 -20
  178. package/src/components/Section/Section.test.tsx +2 -2
  179. package/src/components/Section/Section.tsx +6 -8
  180. package/src/components/Section/Sections.stories.tsx +2 -2
  181. package/src/components/Select/Select.fixtures.ts +2 -2
  182. package/src/components/Select/Select.stories.tsx +3 -3
  183. package/src/components/Select/Select.test.tsx +12 -5
  184. package/src/components/Select/Select.types.ts +2 -2
  185. package/src/components/Select/SelectCreatableOption.tsx +1 -1
  186. package/src/components/Select/SelectEmpty.tsx +5 -6
  187. package/src/components/Select/SelectOption.test.tsx +1 -1
  188. package/src/components/Select/SelectTrigger.tsx +6 -11
  189. package/src/components/Select/components.tsx +1 -1
  190. package/src/components/Select/useSelect.helpers.test.ts +1 -1
  191. package/src/components/Select/useSelect.ts +1 -1
  192. package/src/components/Select/useSelectExternal.ts +1 -1
  193. package/src/components/SideNavigation/Logo/Logo.test.tsx +2 -2
  194. package/src/components/SideNavigation/Menu/Menu.test.tsx +3 -3
  195. package/src/components/SideNavigation/Menu/Menu.tsx +3 -3
  196. package/src/components/SideNavigation/Menu/MenuBaseItem.tsx +4 -5
  197. package/src/components/SideNavigation/Menu/MenuExpandable.tsx +2 -3
  198. package/src/components/SideNavigation/Separator/Separator.test.tsx +1 -1
  199. package/src/components/SideNavigation/SideNavigation.stories.tsx +1 -1
  200. package/src/components/SideNavigation/SideNavigation.test.tsx +2 -2
  201. package/src/components/Steps/ProgressSteps/ProgressStep.tsx +31 -39
  202. package/src/components/Steps/Steps.fixtures.ts +1 -1
  203. package/src/components/Steps/Steps.stories.tsx +1 -1
  204. package/src/components/Steps/Steps.test.tsx +2 -2
  205. package/src/components/Steps/Steps.tsx +2 -1
  206. package/src/components/Steps/StepsStep.tsx +2 -1
  207. package/src/components/Steps/useStep.test.tsx +1 -1
  208. package/src/components/Switch/Switch.stories.tsx +1 -1
  209. package/src/components/Switch/Switch.test.tsx +1 -1
  210. package/src/components/Switch/Switch.tsx +6 -18
  211. package/src/components/Table/Table.fixtures.ts +1 -1
  212. package/src/components/Table/Table.stories.tsx +1 -1
  213. package/src/components/Table/Table.test.tsx +1 -1
  214. package/src/components/Table/Table.tsx +2 -2
  215. package/src/components/Table/Table.types.ts +9 -4
  216. package/src/components/Table/TableSortHandle.tsx +1 -1
  217. package/src/components/TablePagination/RowsPerPage.tsx +2 -2
  218. package/src/components/TablePagination/TablePagination.stories.tsx +1 -1
  219. package/src/components/TablePagination/TablePagination.test.tsx +2 -2
  220. package/src/components/TablePagination/TablePagination.types.ts +1 -1
  221. package/src/components/TablePagination/TablePaginationActions.tsx +1 -1
  222. package/src/components/Tabs/Tabs.test.tsx +1 -1
  223. package/src/components/Tabs/Tabs.tsx +26 -32
  224. package/src/components/Tag/Tag.stories.tsx +2 -2
  225. package/src/components/Tag/Tag.test.tsx +2 -2
  226. package/src/components/Tag/Tag.tsx +35 -44
  227. package/src/components/Text/Text.stories.tsx +1 -1
  228. package/src/components/Text/Text.test.tsx +2 -2
  229. package/src/components/Text/Text.tsx +1 -1
  230. package/src/components/TextField/TextField.stories.tsx +1 -1
  231. package/src/components/TextField/TextField.test.tsx +1 -1
  232. package/src/components/TextField/TextField.tsx +16 -23
  233. package/src/components/Textarea/Textarea.stories.tsx +1 -1
  234. package/src/components/Textarea/Textarea.test.tsx +1 -1
  235. package/src/components/Textarea/Textarea.tsx +18 -23
  236. package/src/components/Toast/Toast.stories.tsx +1 -1
  237. package/src/components/Toast/Toast.test.tsx +2 -2
  238. package/src/components/Toast/Toast.tsx +3 -3
  239. package/src/components/ToggleGroup/Toggle.test.tsx +2 -2
  240. package/src/components/ToggleGroup/Toggle.tsx +7 -7
  241. package/src/components/ToggleGroup/ToggleGroup.stories.tsx +1 -1
  242. package/src/components/ToggleGroup/ToggleGroup.test.tsx +2 -2
  243. package/src/components/Tooltip/Tooltip.stories.tsx +1 -1
  244. package/src/components/Tooltip/Tooltip.test.tsx +2 -2
  245. package/src/components/Tooltip/Tooltip.tsx +23 -24
  246. package/src/components/TopNavigation/Logo/Logo.test.tsx +2 -2
  247. package/src/components/TopNavigation/Menu/Menu.test.tsx +1 -1
  248. package/src/components/TopNavigation/Menu/MenuItemDropdown.tsx +1 -1
  249. package/src/components/TopNavigation/OpenSideNavButton/OpenSideNavButton.tsx +1 -1
  250. package/src/components/VisuallyHidden/VisuallyHidden.test.tsx +1 -1
  251. package/src/hooks/useClickOutside/useClickOutside.test.tsx +1 -1
  252. package/src/hooks/useDidMount/useDidMount.test.tsx +1 -1
  253. package/src/hooks/useFocusTrap/useFocusTrap.stories.tsx +1 -1
  254. package/src/hooks/useFocusTrap/useFocusTrap.test.tsx +1 -1
  255. package/src/hooks/useFocusWithin/useFocusWithin.test.tsx +1 -1
  256. package/src/hooks/useHeightExpansionToggler/useHeightExpansionToggler.test.tsx +1 -1
  257. package/src/hooks/useHeightExpansionToggler/useHeightExpansionToggler.ts +1 -1
  258. package/src/hooks/useSelectable/SelectableStrategy.test.ts +1 -1
  259. package/src/hooks/useSelectable/useSelectable.test.ts +1 -1
  260. package/src/styles/activatable.tsx +1 -1
  261. package/src/styles/disableable.tsx +1 -1
  262. package/src/styles/focusable.tsx +1 -1
  263. package/src/styles/font.tsx +3 -3
  264. package/src/styles/hoverable.tsx +1 -1
  265. package/src/testing/SelectEvent/SelectEvent.test.tsx +2 -2
  266. package/src/testing/getInterpolatedStyles/getInterpolatedStyles.ts +1 -1
  267. package/src/tests/generator.ts +127 -0
  268. package/src/tests/renderer.tsx +39 -0
  269. package/src/theming/index.ts +3 -2
  270. package/src/tools/conditional.test.ts +1 -1
  271. package/src/utils/toolset/interleave.test.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { Meta } from '@storybook/react/types-6-0'
2
+ import type { Meta } from '@storybook/react/types-6-0'
3
3
 
4
4
  import ErrorMessage, { ErrorMessageProps } from './ErrorMessage'
5
5
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { render, screen } from '@testing-library/react'
3
3
 
4
- import generator from '../../../tests/generator'
4
+ import generator from '../../tests/generator'
5
5
 
6
6
  import ErrorMessage from './ErrorMessage'
7
7
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Story, Meta } from '@storybook/react/types-6-0'
2
+ import type { Story, Meta } from '@storybook/react/types-6-0'
3
3
 
4
4
  import HighlightMatch, { HighlightMatchProps } from './HighlightMatch'
5
5
 
@@ -2,8 +2,8 @@ import React from 'react'
2
2
  import { composeStories } from '@storybook/testing-react'
3
3
 
4
4
  import * as stories from './HighlightMatch.stories'
5
- import renderer, { screen } from '../../../tests/renderer'
6
- import { HighlightMatchProps } from './HighlightMatch'
5
+ import renderer, { screen } from '../../tests/renderer'
6
+ import type { HighlightMatchProps } from './HighlightMatch'
7
7
 
8
8
  const { Playground } = composeStories(stories)
9
9
 
@@ -15,9 +15,9 @@ const HighlightMatchWrapper = styled.span`
15
15
  white-space: pre;
16
16
 
17
17
  mark {
18
+ font-weight: ${token('font-weight-bold')};
18
19
 
19
20
  color: inherit;
20
- font-weight: ${token('font-weight-bold')};
21
21
 
22
22
  background-color: ${token('color-transparent')};
23
23
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Story, Meta } from '@storybook/react/types-6-0'
2
+ import type { Story, Meta } from '@storybook/react/types-6-0'
3
3
  import {
4
4
  Title,
5
5
  Subtitle,
@@ -3,8 +3,8 @@ import { composeStories } from '@storybook/testing-react'
3
3
 
4
4
  import { icons } from './IconFactory.fixtures'
5
5
  import * as stories from './IconFactory.stories'
6
- import generator from '../../../tests/generator'
7
- import renderer, { screen } from '../../../tests/renderer'
6
+ import generator from '../../tests/generator'
7
+ import renderer, { screen } from '../../tests/renderer'
8
8
 
9
9
  import type { IconProps } from './IconFactory'
10
10
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import Label, { LabelProps } from './Label'
3
- import { Meta } from '@storybook/react/types-6-0'
3
+ import type { Meta } from '@storybook/react/types-6-0'
4
4
 
5
5
  export default {
6
6
  title: 'Components/Label',
@@ -3,8 +3,8 @@ import { screen } from '@testing-library/react'
3
3
  import userEvent from '@testing-library/user-event'
4
4
 
5
5
  import Label from './Label'
6
- import generator from '../../../tests/generator'
7
- import renderer from '../../../tests/renderer'
6
+ import generator from '../../tests/generator'
7
+ import renderer from '../../tests/renderer'
8
8
 
9
9
  const setup = ({ ...overrides }) => renderer(<Label {...overrides} />).render()
10
10
 
@@ -1,10 +1,10 @@
1
1
  import React from 'react'
2
- import { LabelHTMLAttributes } from 'react'
2
+ import type { LabelHTMLAttributes } from 'react'
3
3
  import styled from 'styled-components'
4
4
  import clsx from 'clsx'
5
5
  import { isNil } from '@loadsmart/utils-object'
6
6
 
7
- import ColorScheme from 'utils/types/ColorScheme'
7
+ import type ColorScheme from 'utils/types/ColorScheme'
8
8
  import conditional, { whenProps } from 'tools/conditional'
9
9
  import disableable from 'styles/disableable'
10
10
  import ellipsizable from 'styles/ellipsizable'
@@ -56,9 +56,9 @@ const StyledChildren = styled.span<WithAdditionalProps>`
56
56
 
57
57
  const StyledRequired = styled.sup`
58
58
  top: 0;
59
+ font-size: ${token('label-font-size')};
59
60
 
60
61
  color: ${token('label-required-color')};
61
- font-size: ${token('label-font-size')};
62
62
  `
63
63
 
64
64
  const StyledTooltipAnchor = styled.span<WithAdditionalProps>`
@@ -68,13 +68,13 @@ const StyledTooltipAnchor = styled.span<WithAdditionalProps>`
68
68
  width: 16px;
69
69
  height: 16px;
70
70
  margin: 0 0 0 ${token('label-tooltip-margin-left')};
71
+ font-size: ${token('label-tooltip-font-size')};
72
+ font-weight: ${token('label-tooltip-font-weight')};
71
73
 
72
74
  color: ${conditional({
73
75
  'label-tooltip-font-color': whenProps({ scheme: 'light' }),
74
76
  'label-tooltip-dark-font-color': whenProps({ scheme: 'dark' }),
75
77
  })};
76
- font-weight: ${token('label-tooltip-font-weight')};
77
- font-size: ${token('label-tooltip-font-size')};
78
78
 
79
79
  background: ${conditional({
80
80
  'label-tooltip-background-color': whenProps({ scheme: 'light' }),
@@ -3,7 +3,7 @@ import styled from 'styled-components'
3
3
 
4
4
  import { getToken as token } from 'theming'
5
5
  import conditional, { whenProps } from 'tools/conditional'
6
- import { Spacing } from './Layout.types'
6
+ import type { Spacing } from './Layout.types'
7
7
  import { getSpace } from './Layout.utils'
8
8
 
9
9
  import type { HTMLAttributes } from 'react'
@@ -4,7 +4,7 @@ import styled from 'styled-components'
4
4
  import prop from 'tools/prop'
5
5
 
6
6
  import { getSpace } from 'components/Layout/Layout.utils'
7
- import { Spacing } from './Layout.types'
7
+ import type { Spacing } from './Layout.types'
8
8
 
9
9
  import type { HTMLAttributes } from 'react'
10
10
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Meta } from '@storybook/react/types-6-0'
2
+ import type { Meta } from '@storybook/react/types-6-0'
3
3
 
4
4
  import { Layout } from '.'
5
5
 
@@ -4,7 +4,7 @@ import styled from 'styled-components'
4
4
  import conditional, { whenProps } from 'tools/conditional'
5
5
  import prop from 'tools/prop'
6
6
 
7
- import { Spacing } from './Layout.types'
7
+ import type { Spacing } from './Layout.types'
8
8
  import { getSpace } from './Layout.utils'
9
9
 
10
10
  import type { HTMLAttributes } from 'react'
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import styled from 'styled-components'
3
3
  import prop from 'tools/prop'
4
4
 
5
- import { Spacing } from './Layout.types'
5
+ import type { Spacing } from './Layout.types'
6
6
  import { getSpace } from './Layout.utils'
7
7
 
8
8
  import type { HTMLAttributes } from 'react'
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import Link, { LinkProps } from './Link'
3
- import { Meta } from '@storybook/react/types-6-0'
3
+ import type { Meta } from '@storybook/react/types-6-0'
4
4
 
5
5
  export default {
6
6
  title: 'Components/Link',
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { screen } from '@testing-library/react'
3
- import renderer from '../../../tests/renderer'
3
+ import renderer from '../../tests/renderer'
4
4
  import Link from './Link'
5
- import generator from '../../../tests/generator'
5
+ import generator from '../../tests/generator'
6
6
 
7
7
  describe('<Link />', () => {
8
8
  describe('default', () => {
@@ -17,31 +17,27 @@ export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
17
17
  }
18
18
 
19
19
  const StyledBaseAnchor = styled.a`
20
- ${font({
21
- height: 'link-font-height',
22
- weight: 'link-font-weight',
23
- })}
24
- ${transition()}
25
-
26
- ${ellipsizable()}
27
-
28
20
  display: inline-flex;
29
21
  flex-direction: column;
30
22
  align-items: center;
31
23
  justify-content: center;
32
24
 
33
- text-align: center;
25
+ min-height: 24px;
34
26
  font-size: ${token('link-font-size')};
35
27
  color: ${token('color-neutral-darker')};
28
+ text-align: center;
36
29
  text-decoration: none;
37
30
 
38
- min-height: 24px;
39
-
31
+ ${font({
32
+ height: 'link-font-height',
33
+ weight: 'link-font-weight',
34
+ })}
35
+ ${ellipsizable()}
36
+ ${transition()}
40
37
  ${hoverable`
41
38
  text-decoration: underline;
42
39
  font-weight: ${token('link-font-weight--hover')};
43
40
  `}
44
-
45
41
  ${disableable``}
46
42
 
47
43
  ${({ children }) =>
@@ -53,13 +49,13 @@ const StyledBaseAnchor = styled.a`
53
49
  overflow: hidden;
54
50
 
55
51
  font-weight: ${token('link-font-weight--hover')};
52
+ pointer-events: none;
56
53
 
57
54
  visibility: hidden;
58
55
 
59
56
  content: attr(data-text);
60
57
  content: attr(data-text) / '';
61
58
  user-select: none;
62
- pointer-events: none;
63
59
 
64
60
  @media speech {
65
61
  display: none;
@@ -1,4 +1,4 @@
1
- import { AnchorHTMLAttributes } from 'react'
1
+ import type { AnchorHTMLAttributes } from 'react'
2
2
  import { isBlank } from '@loadsmart/utils-string'
3
3
 
4
4
  const INSECURE_HREF = /^javascript:/i
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
- import { Story, Meta } from '@storybook/react/types-6-0'
2
+ import type { Story, Meta } from '@storybook/react/types-6-0'
3
3
  import { Text } from 'components/Text'
4
4
 
5
- import { LoadingBarProps } from './LoadingBar'
5
+ import type { LoadingBarProps } from './LoadingBar'
6
6
 
7
7
  import LoadingBar from './LoadingBar'
8
8
 
@@ -12,7 +12,7 @@ export default {
12
12
  argTypes: {},
13
13
  } as Meta
14
14
 
15
- export const Playground: Story<LoadingBarProps> = (args: LoadingBarProps) => {
15
+ export const Playground: Story<LoadingBarProps> = (args) => {
16
16
  return (
17
17
  <div className="flex flex-col space-y-2">
18
18
  <div className="flex items-center">
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import { composeStories } from '@storybook/testing-react'
3
3
 
4
4
  import * as stories from './LoadingBar.stories'
5
- import renderer, { screen } from '../../../tests/renderer'
5
+ import renderer, { screen } from '../../tests/renderer'
6
6
 
7
7
  import type { LoadingBarProps } from './LoadingBar'
8
8
 
@@ -29,12 +29,12 @@ export const Bar = styled.div<{ width?: number; velocity?: number }>`
29
29
  width: 100%;
30
30
  height: ${token('space-s')};
31
31
 
32
+ content: '';
33
+
32
34
  background-color: ${token('color-primary')};
33
35
 
34
36
  animation: ${loading} ${({ velocity }) => (velocity && velocity > 0 ? velocity : 2.5)}s linear
35
37
  infinite;
36
-
37
- content: '';
38
38
  }
39
39
  `
40
40
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Story, Meta } from '@storybook/react/types-6-0'
2
+ import type { Story, Meta } from '@storybook/react/types-6-0'
3
3
  import { Button } from 'components/Button'
4
4
 
5
5
  import LoadingDots, { LoadingDotsProps } from './LoadingDots'
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import { composeStories } from '@storybook/testing-react'
3
3
 
4
4
  import * as stories from './LoadingDots.stories'
5
- import renderer, { screen } from '../../../tests/renderer'
5
+ import renderer, { screen } from '../../tests/renderer'
6
6
 
7
7
  import type { LoadingDotsProps } from './LoadingDots'
8
8
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Story, Meta } from '@storybook/react/types-6-0'
2
+ import type { Story, Meta } from '@storybook/react/types-6-0'
3
3
 
4
4
  import Spinner, { SpinnerProps } from './Spinner'
5
5
 
@@ -2,8 +2,8 @@ import React from 'react'
2
2
  import { composeStories } from '@storybook/testing-react'
3
3
 
4
4
  import * as stories from './Spinner.stories'
5
- import generator from '../../../tests/generator'
6
- import renderer, { screen } from '../../../tests/renderer'
5
+ import generator from '../../tests/generator'
6
+ import renderer, { screen } from '../../tests/renderer'
7
7
 
8
8
  import type { SpinnerProps } from './Spinner'
9
9
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Meta } from '@storybook/react/types-6-0'
2
+ import type { Meta } from '@storybook/react/types-6-0'
3
3
  import { useArgs } from '@storybook/client-api'
4
4
  import Modal from './Modal'
5
5
  import type { ModalProps } from './Modal'
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
 
3
3
  import Modal from './Modal'
4
- import generator from '../../../tests/generator'
5
- import renderer, { screen, user } from '../../../tests/renderer'
4
+ import generator from '../../tests/generator'
5
+ import renderer, { screen, user } from '../../tests/renderer'
6
6
 
7
7
  const setup = ({ open = false, ...overrides }) =>
8
8
  renderer(<Modal open={open} {...overrides} />).render()
@@ -52,13 +52,13 @@ const ModalWrapper = styled.div<ModalWrapperProps>`
52
52
  `
53
53
 
54
54
  const HeaderWrapper = styled.div`
55
+ box-sizing: content-box;
55
56
  display: flex;
56
57
  align-items: center;
57
58
  justify-content: center;
58
- box-sizing: content-box;
59
59
  height: ${token('space-xl')};
60
- margin-bottom: ${token('space-l')};
61
60
  padding-bottom: ${token('space-s')};
61
+ margin-bottom: ${token('space-l')};
62
62
 
63
63
  border-bottom: 1px solid ${token('color-neutral-light')};
64
64
  `
@@ -71,19 +71,14 @@ const Close = styled(CloseButton).attrs({
71
71
  `
72
72
 
73
73
  const Content = styled.div<ContentProps>`
74
- background: white;
75
- border-radius: ${token('border-radius-s')};
76
- box-shadow: ${token('shadow-modal')};
77
-
74
+ position: relative;
75
+ z-index: ${token('z-index-modal')};
78
76
  padding: ${token('space-xl')};
79
-
80
77
  margin: 0 auto;
81
-
82
- position: relative;
83
-
78
+ background: white;
79
+ border-radius: ${token('border-radius-s')};
84
80
  outline: none;
85
-
86
- z-index: ${token('z-index-modal')};
81
+ box-shadow: ${token('shadow-modal')};
87
82
 
88
83
  ${({ fullscreen }) =>
89
84
  fullscreen &&
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from 'react'
2
2
  import Pagination from './Pagination'
3
- import { Story, Meta } from '@storybook/react/types-6-0'
3
+ import type { Story, Meta } from '@storybook/react/types-6-0'
4
4
 
5
5
  import type { PaginationProps } from './Pagination.types'
6
6
 
@@ -1,10 +1,10 @@
1
1
  import userEvent from '@testing-library/user-event'
2
2
  import React from 'react'
3
3
 
4
- import renderer, { screen, fire } from '../../../tests/renderer'
4
+ import renderer, { screen, fire } from '../../tests/renderer'
5
5
 
6
6
  import Pagination from './Pagination'
7
- import { PaginationProps } from './Pagination.types'
7
+ import type { PaginationProps } from './Pagination.types'
8
8
 
9
9
  describe('Pagination', () => {
10
10
  const setup = (overrides: PaginationProps) => renderer(<Pagination {...overrides} />).render()
@@ -1,6 +1,6 @@
1
- import { HTMLAttributes } from 'react'
1
+ import type { HTMLAttributes } from 'react'
2
2
 
3
- import { ButtonProps } from 'components/Button'
3
+ import type { ButtonProps } from 'components/Button'
4
4
 
5
5
  export type PaginationProps = Omit<HTMLAttributes<HTMLElement>, 'onChange'> & {
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Story, Meta } from '@storybook/react/types-6-0'
2
+ import type { Story, Meta } from '@storybook/react/types-6-0'
3
3
 
4
4
  import Popover from './Popover'
5
5
 
@@ -2,8 +2,8 @@ import React from 'react'
2
2
  import { composeStories } from '@storybook/testing-react'
3
3
 
4
4
  import * as stories from './Popover.stories'
5
- import generator from '../../../tests/generator'
6
- import renderer, { screen } from '../../../tests/renderer'
5
+ import generator from '../../tests/generator'
6
+ import renderer, { screen } from '../../tests/renderer'
7
7
 
8
8
  import type { PopoverProps } from './Popover'
9
9
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import ProgressBar, { ProgressBarProps } from './ProgressBar'
3
- import { Meta } from '@storybook/react/types-6-0'
3
+ import type { Meta } from '@storybook/react/types-6-0'
4
4
  import Status from 'utils/types/Status'
5
5
 
6
6
  export default {
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { screen } from '@testing-library/react'
3
3
 
4
- import renderer from '../../../tests/renderer'
4
+ import renderer from '../../tests/renderer'
5
5
 
6
6
  import { ProgressBar } from './ProgressBar'
7
7
 
@@ -5,19 +5,17 @@ import conditional, { whenProps } from 'tools/conditional'
5
5
  import Status from 'utils/types/Status'
6
6
 
7
7
  const Bar = styled.div<{ rounded: boolean }>`
8
- align-items: center;
8
+ position: relative;
9
9
  display: flex;
10
10
  flex-grow: 0;
11
11
  flex-shrink: 1;
12
-
12
+ align-items: center;
13
13
  justify-content: center;
14
- overflow: hidden;
15
14
  width: 100%;
16
-
17
- position: relative;
18
-
19
15
  height: ${token('progressbar-height')};
20
16
 
17
+ overflow: hidden;
18
+
21
19
  ${({ rounded }) =>
22
20
  rounded &&
23
21
  css`
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import Radio, { RadioProps } from './Radio'
3
- import { Meta } from '@storybook/react/types-6-0'
3
+ import type { Meta } from '@storybook/react/types-6-0'
4
4
 
5
5
  import Status from 'utils/types/Status'
6
6
 
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
 
3
3
  import Radio from './Radio'
4
- import generator from '../../../tests/generator'
5
- import renderer, { fire } from '../../../tests/renderer'
4
+ import generator from '../../tests/generator'
5
+ import renderer, { fire } from '../../tests/renderer'
6
6
 
7
7
  const setup = ({ ...overrides }) => renderer(<Radio {...overrides} />).render()
8
8
 
@@ -2,7 +2,7 @@ import React, { Fragment, InputHTMLAttributes, ReactNode } from 'react'
2
2
  import clsx from 'clsx'
3
3
 
4
4
  import { Icon } from 'components/Icon'
5
- import ColorScheme from 'utils/types/ColorScheme'
5
+ import type ColorScheme from 'utils/types/ColorScheme'
6
6
  import conditional, { whenProps } from 'tools/conditional'
7
7
  import disableable from 'styles/disableable'
8
8
  import focusable from 'styles/focusable'
@@ -21,45 +21,37 @@ export interface RadioProps extends InputHTMLAttributes<HTMLInputElement>, Selec
21
21
  const Check = styled(Icon)<SelectionStyleProps>`
22
22
  position: absolute;
23
23
  top: 50%;
24
-
25
24
  left: 50%;
26
25
 
27
26
  width: 10px;
28
27
  height: 10px;
29
28
 
30
- transform: translate(-50%, -50%);
31
-
32
29
  pointer-events: none;
33
30
 
34
31
  fill: currentColor;
32
+
33
+ transform: translate(-50%, -50%);
35
34
  `
36
35
 
37
36
  const Selector = styled.input<SelectionStyleProps>`
38
- ${transition()}
39
-
40
37
  display: inline-flex;
41
38
  flex-flow: row nowrap;
42
39
  align-items: center;
43
40
 
44
- cursor: pointer;
45
-
46
- appearance: none;
47
-
48
- outline: none;
49
-
50
- color: white;
51
-
52
- height: ${token('radio-small-selector-size')};
53
41
  width: ${token('radio-small-selector-size')};
54
-
55
- border-radius: ${token('radio-selector-border-radius')};
56
- border-width: ${token('button-border-width')};
57
- border-style: solid;
58
-
42
+ height: ${token('radio-small-selector-size')};
43
+ color: white;
44
+ cursor: pointer;
59
45
  background: ${conditional({
60
46
  'radio-selector-background': whenProps({ scheme: 'light' }),
61
47
  'radio-dark-selector-background': whenProps({ scheme: 'dark' }),
62
48
  })};
49
+ appearance: none;
50
+ border-style: solid;
51
+ border-width: ${token('button-border-width')};
52
+ border-radius: ${token('radio-selector-border-radius')};
53
+ outline: none;
54
+ ${transition()}
63
55
 
64
56
  &:not(:checked) {
65
57
  border-color: ${conditional({
@@ -1,7 +1,7 @@
1
1
  import React, { Fragment } from 'react'
2
2
 
3
- import generator from '../../../tests/generator'
4
- import renderer, { screen } from '../../../tests/renderer'
3
+ import generator from '../../tests/generator'
4
+ import renderer, { screen } from '../../tests/renderer'
5
5
 
6
6
  import Section from './Section'
7
7
 
@@ -12,18 +12,16 @@ const StyledSection = styled.section`
12
12
  `
13
13
 
14
14
  const StyledSectionTitle = styled.section`
15
- ${font({
16
- weight: 'font-weight-bold',
17
- height: 'font-height-2',
18
- })}
19
-
15
+ padding: ${token('space-s')} ${token('space-xs')};
16
+ margin-bottom: ${token('space-l')};
20
17
  font-size: ${token('font-size-3')};
21
18
  color: ${token('color-neutral-darker')};
22
-
23
19
  border-bottom: 2px solid ${token('color-neutral-light')};
24
20
 
25
- padding: ${token('space-s')} ${token('space-xs')};
26
- margin-bottom: ${token('space-l')};
21
+ ${font({
22
+ weight: 'font-weight-bold',
23
+ height: 'font-height-2',
24
+ })}
27
25
  `
28
26
 
29
27
  const StyledSpan = styled.span`
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import { Meta } from '@storybook/react/types-6-0'
2
+ import type { Meta } from '@storybook/react/types-6-0'
3
3
  import Section from './Section'
4
4
  import type { SectionProps } from './Section'
5
5
 
6
- import generator from '../../../tests/generator'
6
+ import generator from '../../tests/generator'
7
7
 
8
8
  export default {
9
9
  title: 'Components/Section',