@loadsmart/loadsmart-ui 5.10.0 → 5.10.1

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 (199) 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/Card/Card.stories.d.ts +1 -1
  8. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  9. package/dist/components/Checkbox/Checkbox.stories.d.ts +1 -1
  10. package/dist/components/Dialog/Dialog.stories.d.ts +1 -1
  11. package/dist/components/DragDropFile/DragDropFile.stories.d.ts +1 -1
  12. package/dist/components/Drawer/Drawer.stories.d.ts +1 -1
  13. package/dist/components/Dropdown/Dropdown.stories.d.ts +1 -1
  14. package/dist/components/EmptyState/EmptyState.stories.d.ts +1 -1
  15. package/dist/components/ErrorMessage/ErrorMessage.stories.d.ts +1 -1
  16. package/dist/components/HighlightMatch/HighlightMatch.stories.d.ts +1 -1
  17. package/dist/components/IconFactory/IconFactory.stories.d.ts +1 -1
  18. package/dist/components/Label/Label.d.ts +2 -2
  19. package/dist/components/Label/Label.stories.d.ts +1 -1
  20. package/dist/components/Layout/Box.d.ts +1 -1
  21. package/dist/components/Layout/Grid.d.ts +1 -1
  22. package/dist/components/Layout/Layout.stories.d.ts +1 -1
  23. package/dist/components/Layout/Sidebar.d.ts +1 -1
  24. package/dist/components/Layout/Switcher.d.ts +1 -1
  25. package/dist/components/Link/Link.stories.d.ts +1 -1
  26. package/dist/components/Link/useSafeLink.d.ts +1 -1
  27. package/dist/components/Loaders/LoadingBar.stories.d.ts +1 -1
  28. package/dist/components/Loaders/LoadingDots.stories.d.ts +1 -1
  29. package/dist/components/Loaders/Spinner.stories.d.ts +1 -1
  30. package/dist/components/Modal/Modal.stories.d.ts +1 -1
  31. package/dist/components/Pagination/Pagination.stories.d.ts +1 -1
  32. package/dist/components/Pagination/Pagination.types.d.ts +2 -2
  33. package/dist/components/Popover/Popover.stories.d.ts +1 -1
  34. package/dist/components/ProgressBar/ProgressBar.stories.d.ts +1 -1
  35. package/dist/components/Radio/Radio.d.ts +1 -1
  36. package/dist/components/Radio/Radio.stories.d.ts +1 -1
  37. package/dist/components/Section/Sections.stories.d.ts +1 -1
  38. package/dist/components/Select/Select.fixtures.d.ts +1 -1
  39. package/dist/components/Select/Select.stories.d.ts +1 -1
  40. package/dist/components/Select/Select.types.d.ts +2 -2
  41. package/dist/components/Select/SelectCreatableOption.d.ts +1 -1
  42. package/dist/components/Select/SelectEmpty.d.ts +1 -1
  43. package/dist/components/Select/components.d.ts +1 -1
  44. package/dist/components/Select/useSelectExternal.d.ts +1 -1
  45. package/dist/components/SideNavigation/SideNavigation.stories.d.ts +1 -1
  46. package/dist/components/Steps/Steps.d.ts +1 -1
  47. package/dist/components/Steps/Steps.stories.d.ts +1 -1
  48. package/dist/components/Steps/StepsStep.d.ts +1 -1
  49. package/dist/components/Switch/Switch.stories.d.ts +1 -1
  50. package/dist/components/Table/Table.stories.d.ts +1 -1
  51. package/dist/components/Table/Table.types.d.ts +3 -4
  52. package/dist/components/Table/TableSortHandle.d.ts +1 -1
  53. package/dist/components/TablePagination/RowsPerPage.d.ts +1 -1
  54. package/dist/components/TablePagination/TablePagination.stories.d.ts +1 -1
  55. package/dist/components/TablePagination/TablePagination.types.d.ts +1 -1
  56. package/dist/components/TablePagination/TablePaginationActions.d.ts +1 -1
  57. package/dist/components/Tag/Tag.stories.d.ts +1 -1
  58. package/dist/components/Text/Text.d.ts +1 -1
  59. package/dist/components/Text/Text.stories.d.ts +1 -1
  60. package/dist/components/TextField/TextField.d.ts +1 -1
  61. package/dist/components/TextField/TextField.stories.d.ts +1 -1
  62. package/dist/components/Textarea/Textarea.d.ts +1 -1
  63. package/dist/components/Textarea/Textarea.stories.d.ts +1 -1
  64. package/dist/components/Toast/Toast.stories.d.ts +1 -1
  65. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +1 -1
  66. package/dist/components/Tooltip/Tooltip.d.ts +3 -2
  67. package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -1
  68. package/dist/hooks/useFocusTrap/useFocusTrap.stories.d.ts +1 -1
  69. package/dist/hooks/useHeightExpansionToggler/useHeightExpansionToggler.d.ts +1 -1
  70. package/dist/index.js +293 -445
  71. package/dist/index.js.map +1 -1
  72. package/dist/styles/activatable.d.ts +1 -1
  73. package/dist/styles/disableable.d.ts +1 -1
  74. package/dist/styles/focusable.d.ts +1 -1
  75. package/dist/styles/hoverable.d.ts +1 -1
  76. package/dist/testing/getInterpolatedStyles/getInterpolatedStyles.d.ts +1 -1
  77. package/dist/testing/index.js.map +1 -1
  78. package/dist/theming/index.d.ts +2 -2
  79. package/dist/theming/index.js.map +1 -1
  80. package/package.json +9 -10
  81. package/src/common/CloseButton/CloseButton.tsx +7 -11
  82. package/src/common/SelectionWrapper.tsx +8 -8
  83. package/src/components/Accordion/Accordion.stories.tsx +1 -1
  84. package/src/components/Accordion/Accordion.tsx +24 -29
  85. package/src/components/Banner/Banner.stories.tsx +1 -1
  86. package/src/components/Banner/Banner.tsx +2 -2
  87. package/src/components/Breadcrumbs/Breadcrumb.tsx +3 -4
  88. package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +1 -1
  89. package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
  90. package/src/components/Button/Button.stories.tsx +1 -1
  91. package/src/components/Button/Button.tsx +17 -20
  92. package/src/components/Calendar/Calendar.tsx +4 -8
  93. package/src/components/Calendar/PickerModeToggle.tsx +3 -6
  94. package/src/components/Calendar/Pickers/DayPicker.tsx +1 -1
  95. package/src/components/Calendar/Pickers/MonthPicker.tsx +1 -1
  96. package/src/components/Calendar/Pickers/PickerButton.tsx +29 -39
  97. package/src/components/Calendar/Pickers/YearPicker.tsx +1 -1
  98. package/src/components/Card/Card.stories.tsx +1 -1
  99. package/src/components/Card/Card.tsx +6 -9
  100. package/src/components/Card/CardTitle.tsx +3 -3
  101. package/src/components/Checkbox/Checkbox.stories.tsx +1 -1
  102. package/src/components/Checkbox/Checkbox.tsx +15 -27
  103. package/src/components/Dialog/Dialog.stories.tsx +1 -1
  104. package/src/components/Dialog/Dialog.tsx +5 -5
  105. package/src/components/DragDropFile/DragDropFile.stories.tsx +1 -1
  106. package/src/components/DragDropFile/styles.tsx +6 -11
  107. package/src/components/Drawer/Drawer.stories.tsx +1 -1
  108. package/src/components/Drawer/Drawer.tsx +6 -6
  109. package/src/components/Dropdown/Dropdown.stories.tsx +1 -1
  110. package/src/components/Dropdown/DropdownMenu.tsx +15 -28
  111. package/src/components/Dropdown/DropdownTrigger.tsx +24 -34
  112. package/src/components/EmptyState/EmptyState.stories.tsx +1 -1
  113. package/src/components/ErrorMessage/ErrorMessage.stories.tsx +1 -1
  114. package/src/components/HighlightMatch/HighlightMatch.stories.tsx +1 -1
  115. package/src/components/HighlightMatch/HighlightMatch.test.tsx +1 -1
  116. package/src/components/HighlightMatch/HighlightMatch.tsx +1 -1
  117. package/src/components/IconFactory/IconFactory.stories.tsx +1 -1
  118. package/src/components/Label/Label.stories.tsx +1 -1
  119. package/src/components/Label/Label.tsx +5 -5
  120. package/src/components/Layout/Box.tsx +1 -1
  121. package/src/components/Layout/Grid.tsx +1 -1
  122. package/src/components/Layout/Layout.stories.tsx +1 -1
  123. package/src/components/Layout/Sidebar.tsx +1 -1
  124. package/src/components/Layout/Switcher.tsx +1 -1
  125. package/src/components/Link/Link.stories.tsx +1 -1
  126. package/src/components/Link/Link.tsx +9 -13
  127. package/src/components/Link/useSafeLink.ts +1 -1
  128. package/src/components/Loaders/LoadingBar.stories.tsx +1 -1
  129. package/src/components/Loaders/LoadingBar.tsx +2 -2
  130. package/src/components/Loaders/LoadingDots.stories.tsx +1 -1
  131. package/src/components/Loaders/Spinner.stories.tsx +1 -1
  132. package/src/components/Modal/Modal.stories.tsx +1 -1
  133. package/src/components/Modal/Modal.tsx +7 -12
  134. package/src/components/Pagination/Pagination.stories.tsx +1 -1
  135. package/src/components/Pagination/Pagination.test.tsx +1 -1
  136. package/src/components/Pagination/Pagination.types.ts +2 -2
  137. package/src/components/Popover/Popover.stories.tsx +1 -1
  138. package/src/components/ProgressBar/ProgressBar.stories.tsx +1 -1
  139. package/src/components/ProgressBar/ProgressBar.tsx +4 -6
  140. package/src/components/Radio/Radio.stories.tsx +1 -1
  141. package/src/components/Radio/Radio.tsx +12 -20
  142. package/src/components/Section/Section.tsx +6 -8
  143. package/src/components/Section/Sections.stories.tsx +1 -1
  144. package/src/components/Select/Select.fixtures.ts +1 -1
  145. package/src/components/Select/Select.stories.tsx +1 -1
  146. package/src/components/Select/Select.types.ts +2 -2
  147. package/src/components/Select/SelectCreatableOption.tsx +1 -1
  148. package/src/components/Select/SelectEmpty.tsx +5 -6
  149. package/src/components/Select/SelectOption.test.tsx +1 -1
  150. package/src/components/Select/SelectTrigger.tsx +6 -11
  151. package/src/components/Select/components.tsx +1 -1
  152. package/src/components/Select/useSelect.ts +1 -1
  153. package/src/components/Select/useSelectExternal.ts +1 -1
  154. package/src/components/SideNavigation/Menu/Menu.test.tsx +1 -1
  155. package/src/components/SideNavigation/Menu/Menu.tsx +3 -3
  156. package/src/components/SideNavigation/Menu/MenuBaseItem.tsx +4 -5
  157. package/src/components/SideNavigation/Menu/MenuExpandable.tsx +2 -3
  158. package/src/components/SideNavigation/SideNavigation.stories.tsx +1 -1
  159. package/src/components/Steps/ProgressSteps/ProgressStep.tsx +31 -39
  160. package/src/components/Steps/Steps.stories.tsx +1 -1
  161. package/src/components/Steps/Steps.tsx +2 -1
  162. package/src/components/Steps/StepsStep.tsx +2 -1
  163. package/src/components/Switch/Switch.stories.tsx +1 -1
  164. package/src/components/Switch/Switch.tsx +6 -18
  165. package/src/components/Table/Table.stories.tsx +1 -1
  166. package/src/components/Table/Table.tsx +2 -2
  167. package/src/components/Table/Table.types.ts +9 -4
  168. package/src/components/Table/TableSortHandle.tsx +1 -1
  169. package/src/components/TablePagination/RowsPerPage.tsx +2 -2
  170. package/src/components/TablePagination/TablePagination.stories.tsx +1 -1
  171. package/src/components/TablePagination/TablePagination.test.tsx +1 -1
  172. package/src/components/TablePagination/TablePagination.types.ts +1 -1
  173. package/src/components/TablePagination/TablePaginationActions.tsx +1 -1
  174. package/src/components/Tabs/Tabs.tsx +26 -32
  175. package/src/components/Tag/Tag.stories.tsx +1 -1
  176. package/src/components/Tag/Tag.tsx +35 -44
  177. package/src/components/Text/Text.stories.tsx +1 -1
  178. package/src/components/Text/Text.tsx +1 -1
  179. package/src/components/TextField/TextField.stories.tsx +1 -1
  180. package/src/components/TextField/TextField.tsx +16 -23
  181. package/src/components/Textarea/Textarea.stories.tsx +1 -1
  182. package/src/components/Textarea/Textarea.tsx +18 -23
  183. package/src/components/Toast/Toast.stories.tsx +1 -1
  184. package/src/components/Toast/Toast.tsx +3 -3
  185. package/src/components/ToggleGroup/Toggle.tsx +7 -7
  186. package/src/components/ToggleGroup/ToggleGroup.stories.tsx +1 -1
  187. package/src/components/Tooltip/Tooltip.stories.tsx +1 -1
  188. package/src/components/Tooltip/Tooltip.tsx +23 -24
  189. package/src/components/TopNavigation/Menu/MenuItemDropdown.tsx +1 -1
  190. package/src/components/TopNavigation/OpenSideNavButton/OpenSideNavButton.tsx +1 -1
  191. package/src/hooks/useFocusTrap/useFocusTrap.stories.tsx +1 -1
  192. package/src/hooks/useHeightExpansionToggler/useHeightExpansionToggler.ts +1 -1
  193. package/src/styles/activatable.tsx +1 -1
  194. package/src/styles/disableable.tsx +1 -1
  195. package/src/styles/focusable.tsx +1 -1
  196. package/src/styles/font.tsx +3 -3
  197. package/src/styles/hoverable.tsx +1 -1
  198. package/src/testing/getInterpolatedStyles/getInterpolatedStyles.ts +1 -1
  199. package/src/theming/index.ts +3 -2
@@ -1,5 +1,5 @@
1
- import { ThemeProps } from 'styled-components';
2
- import ThemeAlice from './themes/alice.theme';
1
+ import type { ThemeProps } from 'styled-components';
2
+ import type ThemeAlice from './themes/alice.theme';
3
3
  export declare type ThemeToken = keyof typeof ThemeAlice;
4
4
  export declare type ThemeTokenValue = string | number;
5
5
  export declare type CustomTheme = Record<ThemeToken, ThemeTokenValue>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/theming/index.ts"],"sourcesContent":["import { ThemeProps } from 'styled-components'\nimport { isFunction } from '@loadsmart/utils-function'\nimport ThemeAlice from './themes/alice.theme'\n\nexport type ThemeToken = keyof typeof ThemeAlice\nexport type ThemeTokenValue = string | number\n\nexport type CustomTheme = Record<ThemeToken, ThemeTokenValue>\nexport type ThemedProps = ThemeProps<CustomTheme>\n\ntype TokenLike<P extends ThemedProps = ThemedProps> = ThemeToken | ((props: P) => ThemeToken)\n\nfunction getTokenFromTheme<P extends ThemedProps>(token: TokenLike<P>, props: P): ThemeTokenValue {\n const tokenName = isFunction(token) ? token(props) : token\n return props.theme[tokenName]\n}\n\n/**\n * Return a design token value for the current theme.\n * @param {string} token - Token whose value should be returned.\n * @param {[ThemedStyledProps]} props - Component props.\n * @returns {ThemeTokenValue} Token value or `undefined` if the token was not found for the current theme.\n */\nexport function getToken<TProps extends ThemedProps>(\n token: TokenLike<TProps>\n): (props: TProps) => ThemeTokenValue\n\nexport function getToken<TProps extends ThemedProps>(\n token: TokenLike<TProps>,\n props: TProps\n): ThemeTokenValue\n\nexport function getToken<TProps extends ThemedProps>(token: any, props?: any): any {\n if (props === undefined) {\n return (props: TProps) => getTokenFromTheme(token, props)\n }\n\n return getTokenFromTheme(token, props)\n}\n\nexport * as Themes from './themes'\n"],"names":["getTokenFromTheme","token","props","tokenName","isFunction","theme","undefined"],"mappings":"0LAYA,SAASA,EAAyCC,EAAqBC,GACrE,MAAMC,EAAYC,aAAWH,GAASA,EAAMC,GAASD,EACrD,OAAOC,EAAMG,MAAMF,8CAkBgCF,EAAYC,GAC/D,YAAcI,IAAVJ,EACMA,GAAkBF,EAAkBC,EAAOC,GAG9CF,EAAkBC,EAAOC"}
1
+ {"version":3,"file":"index.js","sources":["../../src/theming/index.ts"],"sourcesContent":["import { isFunction } from '@loadsmart/utils-function'\n\nimport type { ThemeProps } from 'styled-components'\nimport type ThemeAlice from './themes/alice.theme'\n\nexport type ThemeToken = keyof typeof ThemeAlice\nexport type ThemeTokenValue = string | number\n\nexport type CustomTheme = Record<ThemeToken, ThemeTokenValue>\nexport type ThemedProps = ThemeProps<CustomTheme>\n\ntype TokenLike<P extends ThemedProps = ThemedProps> = ThemeToken | ((props: P) => ThemeToken)\n\nfunction getTokenFromTheme<P extends ThemedProps>(token: TokenLike<P>, props: P): ThemeTokenValue {\n const tokenName = isFunction(token) ? token(props) : token\n return props.theme[tokenName]\n}\n\n/**\n * Return a design token value for the current theme.\n * @param {string} token - Token whose value should be returned.\n * @param {[ThemedStyledProps]} props - Component props.\n * @returns {ThemeTokenValue} Token value or `undefined` if the token was not found for the current theme.\n */\nexport function getToken<TProps extends ThemedProps>(\n token: TokenLike<TProps>\n): (props: TProps) => ThemeTokenValue\n\nexport function getToken<TProps extends ThemedProps>(\n token: TokenLike<TProps>,\n props: TProps\n): ThemeTokenValue\n\nexport function getToken<TProps extends ThemedProps>(token: any, props?: any): any {\n if (props === undefined) {\n return (props: TProps) => getTokenFromTheme(token, props)\n }\n\n return getTokenFromTheme(token, props)\n}\n\nexport * as Themes from './themes'\n"],"names":["getTokenFromTheme","token","props","tokenName","isFunction","theme","undefined"],"mappings":"0LAaA,SAASA,EAAyCC,EAAqBC,GACrE,MAAMC,EAAYC,aAAWH,GAASA,EAAMC,GAASD,EACrD,OAAOC,EAAMG,MAAMF,8CAkBgCF,EAAYC,GAC/D,YAAcI,IAAVJ,EACMA,GAAkBF,EAAkBC,EAAOC,GAG9CF,EAAkBC,EAAOC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loadsmart/loadsmart-ui",
3
- "version": "5.10.0",
3
+ "version": "5.10.1",
4
4
  "description": "Miranda UI, a React UI library",
5
5
  "main": "dist",
6
6
  "files": [
@@ -78,7 +78,7 @@
78
78
  "@babel/preset-typescript": "7.13.0",
79
79
  "@commitlint/cli": "16.0.2",
80
80
  "@commitlint/config-conventional": "16.0.0",
81
- "@loadsmart/stylelint-config": "0.0.3",
81
+ "@loadsmart/stylelint-config": "^1.2.1-beta.1",
82
82
  "@rollup/plugin-babel": "5.3.0",
83
83
  "@rollup/plugin-commonjs": "19.0.0",
84
84
  "@rollup/plugin-json": "4.1.0",
@@ -158,12 +158,7 @@
158
158
  "rollup-plugin-visualizer": "^5.5.2",
159
159
  "semantic-release": "17.4.2",
160
160
  "styled-components": "5.3.0",
161
- "stylelint": "13.13.1",
162
- "stylelint-config-prettier": "8.0.2",
163
- "stylelint-config-rational-order": "0.1.2",
164
- "stylelint-config-recommended": "5.0.0",
165
- "stylelint-no-unsupported-browser-features": "5.0.1",
166
- "stylelint-order": "4.1.0",
161
+ "stylelint": "^13.13.1",
167
162
  "tailwindcss": "npm:@tailwindcss/postcss7-compat",
168
163
  "ts-jest": "26.5.6",
169
164
  "ts-toolbelt": "^9.6.0",
@@ -175,8 +170,8 @@
175
170
  "@testing-library/dom": ">=5.12.0",
176
171
  "@testing-library/react": ">=11.2.6",
177
172
  "prop-types": ">=15.7.2",
178
- "react": ">=17.0.2",
179
- "react-dom": ">=17.0.2",
173
+ "react": ">=16.8.0",
174
+ "react-dom": ">=16.8.0",
180
175
  "styled-components": ">=5.3.0"
181
176
  },
182
177
  "dependencies": {
@@ -191,6 +186,10 @@
191
186
  "lodash.omit": "4.5.0",
192
187
  "lodash.range": "3.2.0"
193
188
  },
189
+ "browserslist": [
190
+ "last 1 chrome version",
191
+ "last 1 firefox version"
192
+ ],
194
193
  "repository": {
195
194
  "type": "git",
196
195
  "url": "https://github.com/loadsmart/miranda.git"
@@ -14,17 +14,6 @@ export interface CloseButtonProps extends ButtonProps {
14
14
  }
15
15
 
16
16
  const Button = styled(BaseButton)`
17
- border: none;
18
- border-radius: ${token('border-radius-circle')};
19
-
20
- color: ${token('color-neutral-darker')};
21
-
22
- background: ${token('color-transparent')};
23
-
24
- padding: ${token('space-xs')};
25
-
26
- font-size: ${token('font-size-3')};
27
-
28
17
  /*
29
18
  * button height is set in the BaseButton component
30
19
  * we set width here to ensure a perfectly rounded button
@@ -34,6 +23,13 @@ const Button = styled(BaseButton)`
34
23
  'button-small-height': whenProps({ scale: 'small' }),
35
24
  'button-large-height': whenProps({ scale: 'large' }),
36
25
  })};
26
+ padding: ${token('space-xs')};
27
+ font-size: ${token('font-size-3')};
28
+ color: ${token('color-neutral-darker')};
29
+ background: ${token('color-transparent')};
30
+
31
+ border: none;
32
+ border-radius: ${token('border-radius-circle')};
37
33
 
38
34
  ${focusable`
39
35
  box-shadow: ${token('button-icon-outline')};
@@ -2,7 +2,7 @@ import React, { LabelHTMLAttributes, ReactNode } from 'react'
2
2
  import clsx from 'clsx'
3
3
  import styled from 'styled-components'
4
4
 
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 font from 'styles/font'
@@ -54,18 +54,11 @@ const Children = styled.span`
54
54
  const StyledLabel = styled.label<SelectionStyleProps>`
55
55
  box-sizing: border-box;
56
56
 
57
- ${transition()}
58
- ${font({
59
- weight: 'checkbox-font-weight',
60
- })}
61
-
62
57
  display: inline-flex;
63
58
  flex-flow: row nowrap;
64
59
  align-items: center;
65
60
  justify-content: flex-start;
66
61
 
67
- cursor: pointer;
68
-
69
62
  font-size: ${conditional({
70
63
  'checkbox-font-size': whenProps({ scale: 'default' }),
71
64
  'checkbox-small-font-size': whenProps({ scale: 'small' }),
@@ -76,6 +69,13 @@ const StyledLabel = styled.label<SelectionStyleProps>`
76
69
  'checkbox-dark-color': whenProps({ scheme: 'dark' }),
77
70
  })};
78
71
 
72
+ cursor: pointer;
73
+
74
+ ${transition()}
75
+ ${font({
76
+ weight: 'checkbox-font-weight',
77
+ })}
78
+
79
79
  ${Children} {
80
80
  margin: 0 ${token('space-xs')};
81
81
  }
@@ -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
  import Accordion from './Accordion'
4
4
  import type { AccordionProps } from './Accordion'
5
5
 
@@ -1,4 +1,5 @@
1
- import React, { Fragment, HTMLAttributes, PropsWithChildren, ReactNode } from 'react'
1
+ import React, { Fragment } from 'react'
2
+ import type { PropsWithChildren, HTMLAttributes, ReactNode } from 'react'
2
3
  import clsx from 'clsx'
3
4
  import styled from 'styled-components'
4
5
  import { identity, isFunction } from '@loadsmart/utils-function'
@@ -30,70 +31,64 @@ const StyledWrapper = styled.article<{ open: boolean }>`
30
31
  `
31
32
 
32
33
  const StyledToggle = styled.button<{ open: boolean }>`
33
- ${font({
34
- height: 'font-height-2',
35
- })}
36
-
37
- ${transition()}
38
-
39
34
  display: flex;
40
35
  flex-direction: row;
41
- justify-content: flex-start;
42
36
  align-items: center;
37
+ justify-content: flex-start;
38
+
39
+ width: 100%;
40
+ padding: ${token('space-s')} ${token('space-m')};
43
41
 
44
42
  font-size: ${token('font-size-3')};
45
43
  font-weight: ${conditional({
46
44
  'font-weight-regular': whenProps({ open: false }),
47
45
  'font-weight-bold': whenProps({ open: true }),
48
46
  })};
49
- text-align: left;
50
-
51
- cursor: pointer;
52
47
 
53
48
  color: ${token('color-neutral-darker')};
54
-
49
+ text-align: left;
50
+ cursor: pointer;
55
51
  background-color: ${token('color-transparent')};
56
- border-radius: ${token('border-radius-s')};
57
52
  border: none;
53
+ border-radius: ${token('border-radius-s')};
58
54
 
59
- padding: ${token('space-s')} ${token('space-m')};
60
-
61
- width: 100%;
62
-
55
+ ${font({
56
+ height: 'font-height-2',
57
+ })}
58
+ ${transition()}
63
59
  ${hoverable`
64
60
  background: ${token('color-neutral-lighter')};
65
61
  `}
66
-
67
62
  ${focusable`
68
63
  box-shadow: ${token('shadow-glow-primary')};
69
64
  `}
70
65
  `
71
66
 
72
67
  const StyledContent = styled.section<{ open: boolean }>`
73
- ${font({
74
- height: 'font-height-2',
75
- weight: 'font-weight-medium',
76
- })}
77
-
78
- padding-left: ${conditional({
68
+ padding-top: ${conditional({
79
69
  '0': whenProps({ open: false }),
80
- 'space-m': whenProps({ open: true }),
70
+ 'space-xl': whenProps({ open: true }),
81
71
  })};
82
72
  padding-right: ${conditional({
83
73
  '0': whenProps({ open: false }),
84
74
  'space-m': whenProps({ open: true }),
85
75
  })};
86
- padding-top: ${conditional({
87
- '0': whenProps({ open: false }),
88
- 'space-xl': whenProps({ open: true }),
89
- })};
90
76
  padding-bottom: ${conditional({
91
77
  '0': whenProps({ open: false }),
92
78
  'space-s': whenProps({ open: true }),
93
79
  })};
80
+ padding-left: ${conditional({
81
+ '0': whenProps({ open: false }),
82
+ 'space-m': whenProps({ open: true }),
83
+ })};
94
84
 
95
85
  overflow-x: hidden;
96
86
  overflow-y: auto;
87
+
88
+ ${font({
89
+ height: 'font-height-2',
90
+ weight: 'font-weight-medium',
91
+ })}
97
92
  `
98
93
 
99
94
  const HiddenInput = styled.input`
@@ -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 Banner, { BannerLarge, BannerAction, BannerActionLarge } from './Banner'
4
4
  import type { BannerProps, BannerActionProps } from './Banner'
5
5
  import { Icon } from 'components/Icon'
@@ -32,15 +32,15 @@ interface VariantProps {
32
32
  }
33
33
 
34
34
  const Description = styled.div`
35
- color: ${token('banner-description-color')};
36
35
  font-size: ${token('banner-font-size')};
37
36
  line-height: ${token('banner-font-height')};
37
+ color: ${token('banner-description-color')};
38
38
  text-align: left;
39
39
  `
40
40
 
41
41
  const Title = styled.div<VariantProps>`
42
- font-weight: ${token('banner-title-font-weight')};
43
42
  font-size: ${token('banner-font-size')};
43
+ font-weight: ${token('banner-title-font-weight')};
44
44
  line-height: ${token('banner-font-height')};
45
45
  text-align: left;
46
46
  `
@@ -31,12 +31,11 @@ const StyledLi = styled.li<BreadcrumbProps>`
31
31
  display: inline-flex;
32
32
  align-items: center;
33
33
 
34
+ font-size: ${token('breadcrumbs-font-size')};
34
35
  font-weight: ${conditional({
35
36
  'breadcrumbs-font-weight': whenProps({ active: false }),
36
37
  'breadcrumbs-font-weight--active': whenProps({ active: true }),
37
38
  })};
38
-
39
- font-size: ${token('breadcrumbs-font-size')};
40
39
  line-height: ${token('breadcrumbs-font-height')};
41
40
 
42
41
  & + & {
@@ -46,9 +45,9 @@ const StyledLi = styled.li<BreadcrumbProps>`
46
45
  &:not(:only-child):not(:last-child)::after {
47
46
  position: absolute;
48
47
  left: calc(100% + 14px);
48
+ font-size: ${token('breadcrumbs-font-size')};
49
49
 
50
50
  font-weight: ${token('font-weight-bold')};
51
- font-size: ${token('breadcrumbs-font-size')};
52
51
 
53
52
  line-height: ${token('breadcrumbs-font-height')};
54
53
 
@@ -68,7 +67,7 @@ function getWrappedLabel(props: Partial<BreadcrumbProps>) {
68
67
  href={url}
69
68
  target="_self"
70
69
  onClick={onClick}
71
- {...(active && {'aria-current': 'page'})}
70
+ {...(active && { 'aria-current': 'page' })}
72
71
  {...rest}
73
72
  >
74
73
  {label}
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import Breadcrumbs, { BreadcrumbsProps } from './Breadcrumbs'
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
  export default {
6
6
  title: 'Components/Breadcrumbs',
@@ -20,9 +20,9 @@ const StyledWrapper = styled.nav`
20
20
  const StyledOl = styled.ol`
21
21
  display: flex;
22
22
  flex-direction: row;
23
- margin: 0;
24
23
 
25
24
  padding: 0;
25
+ margin: 0;
26
26
 
27
27
  list-style: none;
28
28
  `
@@ -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 BackButton from '../../common/BackButton'
4
4
  import Button, { SelectorButton, IconButton, Caret, BaseButton } from './Button'
5
5
  import CloseButton from '../../common/CloseButton'
@@ -68,16 +68,6 @@ const BaseStyledButton = styled.button<{
68
68
  $scale: ButtonProps['scale']
69
69
  $loading?: ButtonProps['loading']
70
70
  }>`
71
- ${transition()}
72
-
73
- ${typography(
74
- conditional({
75
- 'button-md': whenProps({ $scale: 'default' }),
76
- 'button-sm': whenProps({ $scale: 'small' }),
77
- 'button-lg': whenProps({ $scale: 'large' }),
78
- })
79
- )}
80
-
81
71
  box-sizing: border-box;
82
72
 
83
73
  display: inline-flex;
@@ -85,16 +75,6 @@ const BaseStyledButton = styled.button<{
85
75
  align-items: center;
86
76
  justify-content: center;
87
77
 
88
- text-transform: uppercase;
89
- text-align: center;
90
-
91
- cursor: pointer;
92
-
93
- border-radius: ${token('border-radius-s')};
94
- border-width: ${token('border-width-thin')};
95
- border-style: solid;
96
- border-color: ${token('color-neutral-darker')};
97
-
98
78
  height: ${conditional({
99
79
  'button-height': whenProps({ $scale: 'default' }),
100
80
  'button-small-height': whenProps({ $scale: 'small' }),
@@ -102,8 +82,25 @@ const BaseStyledButton = styled.button<{
102
82
  })};
103
83
 
104
84
  padding: 0 8px;
85
+ text-align: center;
86
+ text-transform: uppercase;
87
+
88
+ cursor: pointer;
89
+
90
+ border-color: ${token('color-neutral-darker')};
91
+ border-style: solid;
92
+ border-width: ${token('border-width-thin')};
93
+ border-radius: ${token('border-radius-s')};
105
94
 
106
95
  ${disableable()}
96
+ ${transition()}
97
+ ${typography(
98
+ conditional({
99
+ 'button-md': whenProps({ $scale: 'default' }),
100
+ 'button-sm': whenProps({ $scale: 'small' }),
101
+ 'button-lg': whenProps({ $scale: 'large' }),
102
+ })
103
+ )}
107
104
 
108
105
  ${({ $loading }) => $loading && 'pointer-events: none;'}
109
106
 
@@ -23,23 +23,19 @@ const Container = styled(Stack)`
23
23
  `
24
24
 
25
25
  const BorderlessButton = styled(BaseButton)`
26
- ${typography('body-bold')}
27
- border-color: transparent;
28
- background-color: transparent;
29
-
30
26
  color: ${token('color-neutral')};
31
-
32
- inline-size: 40px;
33
-
34
27
  visibility: ${conditional({
35
28
  visible: whenProps({ 'aria-hidden': false }),
36
29
  hidden: whenProps({ 'aria-hidden': true }),
37
30
  })};
31
+ background-color: transparent;
32
+ border-color: transparent;
33
+ inline-size: 40px;
38
34
 
35
+ ${typography('body-bold')}
39
36
  ${hoverable`
40
37
  color: ${token('color-neutral-dark')};
41
38
  `}
42
-
43
39
  ${focusable`
44
40
  box-shadow: ${token('button-primary-outline')};
45
41
  `}
@@ -12,7 +12,10 @@ import typography from 'styles/typography'
12
12
  import type { ButtonProps } from 'components/Button'
13
13
 
14
14
  const Button = styled(BaseButton)`
15
+ color: ${token('color-neutral-dark')};
15
16
  user-select: none;
17
+ background-color: transparent;
18
+ border-color: transparent;
16
19
 
17
20
  ${typography(
18
21
  conditional({
@@ -20,15 +23,9 @@ const Button = styled(BaseButton)`
20
23
  body: whenProps({ 'aria-expanded': false }),
21
24
  })
22
25
  )};
23
- border-color: transparent;
24
- background-color: transparent;
25
-
26
- color: ${token('color-neutral-dark')};
27
-
28
26
  ${focusable`
29
27
  box-shadow: ${token('button-primary-outline')};
30
28
  `}
31
-
32
29
  ${disableable`
33
30
  pointer-events: none;
34
31
  opacity: 1;
@@ -53,9 +53,9 @@ const Text = styled(DefaultText)`
53
53
 
54
54
  const Grid = styled.div`
55
55
  display: grid;
56
- grid-gap: ${token('space-2xs')};
57
56
  grid-template-rows: 1.25rem repeat(auto-fill, 2.5rem);
58
57
  grid-template-columns: repeat(7, 2.5rem);
58
+ grid-gap: ${token('space-2xs')};
59
59
  `
60
60
 
61
61
  /**
@@ -10,9 +10,9 @@ import type { CalendarMonth, CalendarMonthAlias } from '../Month.helper'
10
10
 
11
11
  const Container = styled.div`
12
12
  display: grid;
13
+ grid-template-columns: repeat(3, 1fr);
13
14
  grid-auto-rows: 3.75rem;
14
15
  grid-gap: ${token('space-2xs')};
15
- grid-template-columns: repeat(3, 1fr);
16
16
  `
17
17
 
18
18
  function getStatus(calendar: useCalendarReturn, month: CalendarMonth) {
@@ -19,20 +19,8 @@ const PickerButton = styled(BaseButton)<{
19
19
  | 'selection'
20
20
  | 'next-month-day'
21
21
  }>`
22
- ${typography(
23
- conditional({
24
- body: whenProps({ $status: ['default', 'faded'] }),
25
- 'body-bold': whenProps({
26
- $status: ['current-day', 'selection-start', 'selection', 'selection-end'],
27
- }),
28
- })
29
- )}
30
-
31
- user-select: none;
32
-
33
22
  height: 100%;
34
-
35
- border-radius: 0;
23
+ padding: ${token('space-xs')} ${token('space-s')};
36
24
 
37
25
  color: ${conditional({
38
26
  'color-neutral-lighter': whenProps({
@@ -42,30 +30,45 @@ const PickerButton = styled(BaseButton)<{
42
30
  'color-neutral-dark': whenProps({ $status: 'next-month-day' }),
43
31
  'color-accent': whenProps({ $status: 'current-day' }),
44
32
  })};
45
-
33
+ visibility: ${conditional({
34
+ visible: whenProps({ 'aria-hidden': false }),
35
+ hidden: whenProps({ 'aria-hidden': true }),
36
+ })};
37
+ user-select: none;
46
38
  background: ${conditional({
47
39
  'color-transparent': whenProps({ $status: ['default', 'faded', 'next-month-day'] }),
48
40
  'color-neutral-darker': whenProps({ $status: ['selection-start', 'selection-end'] }),
49
41
  'color-neutral': whenProps({ $status: 'selection' }),
50
42
  'color-neutral-lightest': whenProps({ $status: 'current-day' }),
51
43
  })};
52
-
53
44
  border-color: ${conditional({
54
45
  'color-transparent': whenProps({ $status: ['default', 'faded', 'next-month-day'] }),
55
46
  'color-neutral-darker': whenProps({ $status: ['selection-start', 'selection-end'] }),
56
47
  'color-neutral': whenProps({ $status: 'selection' }),
57
48
  'color-neutral-light': whenProps({ $status: 'current-day' }),
58
49
  })};
50
+ border-radius: 0;
59
51
 
60
52
  ${conditional({
61
53
  'opacity: 0.4;': whenProps({ $status: 'faded' }),
62
54
  'opacity: 1;': whenProps({ $status: (status) => status !== 'faded' }),
63
55
  })}
64
-
65
- padding: ${token('space-xs')} ${token('space-s')};
66
-
56
+ ${typography(
57
+ conditional({
58
+ body: whenProps({ $status: ['default', 'faded'] }),
59
+ 'body-bold': whenProps({
60
+ $status: ['current-day', 'selection-start', 'selection', 'selection-end'],
61
+ }),
62
+ })
63
+ )}
67
64
  ${hoverable`
68
- border-color: ${token('color-neutral')};
65
+ font-weight: ${token('font-weight-bold')};
66
+ color: ${conditional({
67
+ 'color-neutral-dark': whenProps({ $status: ['default', 'faded'] }),
68
+ 'color-neutral-lightest': whenProps({
69
+ $status: ['selection-start', 'selection', 'selection-end'],
70
+ }),
71
+ })};
69
72
  background-color: ${conditional({
70
73
  'color-transparent': whenProps({ $status: ['default', 'faded', 'next-month-day'] }),
71
74
  'color-neutral-dark': whenProps({
@@ -73,14 +76,7 @@ const PickerButton = styled(BaseButton)<{
73
76
  }),
74
77
  'color-neutral-lightest': whenProps({ $status: 'current-day' }),
75
78
  })};
76
- color: ${conditional({
77
- 'color-neutral-dark': whenProps({ $status: ['default', 'faded'] }),
78
- 'color-neutral-lightest': whenProps({
79
- $status: ['selection-start', 'selection', 'selection-end'],
80
- }),
81
- })};
82
-
83
- font-weight: ${token('font-weight-bold')};
79
+ border-color: ${token('color-neutral')};
84
80
  `}
85
81
 
86
82
  ${focusable`
@@ -89,31 +85,25 @@ const PickerButton = styled(BaseButton)<{
89
85
  `}
90
86
 
91
87
  ${activatable`
92
- border-color: ${token('color-neutral')};
93
- background-color: ${conditional({
94
- 'color-transparent': whenProps({ 'aria-checked': false }),
95
- 'color-neutral': whenProps({ 'aria-checked': true }),
96
- })};
97
88
  color: ${conditional({
98
89
  'color-neutral': whenProps({ 'aria-checked': false }),
99
90
  'color-neutral-white': whenProps({ 'aria-checked': true }),
100
91
  })};
92
+ background-color: ${conditional({
93
+ 'color-transparent': whenProps({ 'aria-checked': false }),
94
+ 'color-neutral': whenProps({ 'aria-checked': true }),
95
+ })};
96
+ border-color: ${token('color-neutral')};
101
97
  `}
102
98
 
103
99
  ${disableable`
100
+ color: ${token('color-neutral-darker')};
104
101
  background-color: ${token('color-transparent')};
105
102
  border-color: ${conditional({
106
103
  'color-neutral-darkest': whenProps({ 'aria-checked': true }),
107
104
  'color-transparent': whenProps({ 'aria-checked': false }),
108
105
  })};
109
-
110
- color: ${token('color-neutral-darker')};
111
106
  `}
112
-
113
- visibility: ${conditional({
114
- visible: whenProps({ 'aria-hidden': false }),
115
- hidden: whenProps({ 'aria-hidden': true }),
116
- })};
117
107
  `
118
108
 
119
109
  export default styled(PickerButton)({})
@@ -9,9 +9,9 @@ import type { useCalendarReturn, CalendarPickerProps } from '../Calendar.types'
9
9
 
10
10
  const Container = styled.div`
11
11
  display: grid;
12
+ grid-template-columns: repeat(4, 1fr);
12
13
  grid-auto-rows: 2.875rem;
13
14
  grid-gap: ${token('space-2xs')};
14
- grid-template-columns: repeat(4, 1fr);
15
15
  `
16
16
 
17
17
  const PickerButton = styled(DefaultPickerButton)`
@@ -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 Card from './Card'
5
5
  import generator from '../../../tests/generator'
@@ -15,10 +15,10 @@ export interface CardProps extends HTMLAttributes<HTMLElement> {
15
15
 
16
16
  const CardSubtitle = styled.div`
17
17
  padding: 0 ${token('card-padding-x')} ${token('card-padding-y')};
18
+ font-size: ${token('card-subtitle-font-size')};
19
+ font-weight: ${token('card-subtitle-font-weight')};
18
20
 
19
21
  color: ${token('card-color')};
20
- font-weight: ${token('card-subtitle-font-weight')};
21
- font-size: ${token('card-subtitle-font-size')};
22
22
  `
23
23
 
24
24
  const CardSeparator = styled.hr`
@@ -35,12 +35,13 @@ const CardBody = styled.div`
35
35
  `
36
36
 
37
37
  const Wrapper = styled.div`
38
- ${font({})}
39
-
40
38
  display: flex;
41
39
  flex-direction: row;
42
-
43
40
  color: ${token('card-color')};
41
+ background: ${token('card-background')};
42
+ border: 1px solid ${token('card-border-color')};
43
+ border-radius: ${token('card-border-radius')};
44
+ ${font({})}
44
45
 
45
46
  ${CardTitleWrapper} + ${CardSubtitle} {
46
47
  margin-top: ${token('space-xs')};
@@ -49,10 +50,6 @@ const Wrapper = styled.div`
49
50
  ${CardTitleWrapper} + ${CardSeparator} {
50
51
  margin-top: ${token('card-padding-y')};
51
52
  }
52
-
53
- border: 1px solid ${token('card-border-color')};
54
- border-radius: ${token('card-border-radius')};
55
- background: ${token('card-background')};
56
53
  `
57
54
 
58
55
  const Container = styled.div<{ flagged: boolean }>`