@superdispatch/ui 0.21.13 → 0.22.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 (234) hide show
  1. package/LICENSE +21 -0
  2. package/{pkg/dist-node → dist-node}/index.js +73 -25
  3. package/dist-node/index.js.map +1 -0
  4. package/{pkg/dist-src → dist-src}/index.js +1 -0
  5. package/dist-src/info-tooltip/InfoTooltip.js +54 -0
  6. package/{pkg/dist-src → dist-src}/theme/Color.js +11 -11
  7. package/{pkg/dist-types → dist-types}/index.d.ts +53 -13
  8. package/{pkg/dist-web → dist-web}/index.js +75 -28
  9. package/dist-web/index.js.map +1 -0
  10. package/package.json +13 -39
  11. package/.babelrc.js +0 -5
  12. package/.turbo/turbo-version.log +0 -28
  13. package/pkg/README.md +0 -30
  14. package/pkg/dist-node/index.js.map +0 -1
  15. package/pkg/dist-web/index.js.map +0 -1
  16. package/pkg/package.json +0 -39
  17. package/playroom.ts +0 -31
  18. package/src/__tests__/index.spec.ts +0 -134
  19. package/src/adaptive-toolbar/AdaptiveToolbar.stories.tsx +0 -50
  20. package/src/adaptive-toolbar/AdaptiveToolbar.tsx +0 -199
  21. package/src/adaptive-toolbar/__tests__/AdaptiveToolbar.spec.tsx +0 -11
  22. package/src/adaptive-vertical-toolbar/AdaptiveVerticalToolbar.stories.tsx +0 -49
  23. package/src/adaptive-vertical-toolbar/AdaptiveVerticalToolbar.tsx +0 -171
  24. package/src/app-bar/AppBar.stories.tsx +0 -62
  25. package/src/app-bar/AppBarOverrides.ts +0 -9
  26. package/src/app-bar/__tests__/AppBar.spec.tsx +0 -86
  27. package/src/autocomplete/Autocomplete.stories.tsx +0 -76
  28. package/src/autocomplete/AutocompleteOverrides.tsx +0 -58
  29. package/src/autocomplete/__tests__/Autocomplete.spec.tsx +0 -323
  30. package/src/avatar/Avatar.stories.tsx +0 -17
  31. package/src/avatar/AvatarOverrides.ts +0 -24
  32. package/src/avatar/__tests__/Avatar.spec.tsx +0 -71
  33. package/src/avatar-button/AvatarButton.stories.tsx +0 -153
  34. package/src/avatar-button/AvatarButton.tsx +0 -223
  35. package/src/avatar-button/__tests__/AvatarButton.spec.tsx +0 -126
  36. package/src/button/Button.tsx +0 -51
  37. package/src/button/ButtonOverrides.ts +0 -375
  38. package/src/button/__tests__/Button.spec.tsx +0 -599
  39. package/src/card/Card.stories.tsx +0 -39
  40. package/src/card/CardOverrides.ts +0 -9
  41. package/src/card/__tests__/Card.spec.tsx +0 -68
  42. package/src/card-button/CardButton.stories.tsx +0 -36
  43. package/src/card-button/CardButton.tsx +0 -202
  44. package/src/card-button/__tests__/CardButton.spec.tsx +0 -95
  45. package/src/checkbox/CheckboxField.stories.tsx +0 -61
  46. package/src/checkbox/CheckboxField.tsx +0 -56
  47. package/src/checkbox/CheckboxGroudField.tsx +0 -53
  48. package/src/checkbox/CheckboxOverrides.tsx +0 -55
  49. package/src/checkbox/__tests__/Checkbox.spec.tsx +0 -105
  50. package/src/chip/Chip.stories.tsx +0 -26
  51. package/src/chip/ChipOverrides.tsx +0 -111
  52. package/src/chip/__tests__/Chip.spec.tsx +0 -308
  53. package/src/columns/Column.tsx +0 -124
  54. package/src/columns/Columns.stories.tsx +0 -426
  55. package/src/columns/Columns.tsx +0 -76
  56. package/src/description-list/DescriptionList.spec.tsx +0 -137
  57. package/src/description-list/DescriptionList.stories.tsx +0 -148
  58. package/src/description-list/DescriptionList.tsx +0 -170
  59. package/src/dialog/Dialog.playroom.tsx +0 -24
  60. package/src/dialog/Dialog.stories.tsx +0 -60
  61. package/src/dialog/DialogOverrides.ts +0 -39
  62. package/src/dialog/__tests__/Dialog.spec.tsx +0 -219
  63. package/src/drawer/Drawer.playroom.tsx +0 -22
  64. package/src/drawer/Drawer.stories.tsx +0 -194
  65. package/src/drawer/DrawerActions.tsx +0 -69
  66. package/src/drawer/DrawerContent.tsx +0 -30
  67. package/src/drawer/DrawerList.tsx +0 -60
  68. package/src/drawer/DrawerOverrides.ts +0 -19
  69. package/src/drawer/DrawerTitle.tsx +0 -143
  70. package/src/drawer/__tests__/Drawer.spec.tsx +0 -227
  71. package/src/dropdown-button/DropdownButton.stories.tsx +0 -15
  72. package/src/dropdown-button/DropdownButton.tsx +0 -131
  73. package/src/grid/GridStack.tsx +0 -45
  74. package/src/grid/InlineGrid.tsx +0 -56
  75. package/src/icon-button/IconButton.stories.tsx +0 -53
  76. package/src/icon-button/IconButtonOverrides.ts +0 -32
  77. package/src/icon-button/__tests__/IconButton.spec.tsx +0 -124
  78. package/src/index.ts +0 -47
  79. package/src/info-card/InfoCard.stories.tsx +0 -29
  80. package/src/info-card/InfoCard.tsx +0 -95
  81. package/src/info-card/__tests__/InfoCard.spec.tsx +0 -22
  82. package/src/info-tooltip/InfoTooltip.stories.tsx +0 -77
  83. package/src/info-tooltip/InfoTooltip.tsx +0 -72
  84. package/src/info-tooltip/__tests__/InfoTooltip.spec.tsx +0 -166
  85. package/src/inline/Inline.stories.tsx +0 -135
  86. package/src/inline/Inline.tsx +0 -144
  87. package/src/link/Link.stories.tsx +0 -41
  88. package/src/link/LinkOverrides.ts +0 -43
  89. package/src/link/__tests__/Link.spec.tsx +0 -98
  90. package/src/list/ListOverrides.ts +0 -11
  91. package/src/list/__tests__/List.spec.tsx +0 -182
  92. package/src/menu/Menu.stories.tsx +0 -35
  93. package/src/menu/MenuOverrides.ts +0 -17
  94. package/src/menu/__tests__/Menu.spec.tsx +0 -99
  95. package/src/number-field/NumberField.stories.tsx +0 -123
  96. package/src/number-field/NumberField.tsx +0 -98
  97. package/src/overflow-text/OverflowText.stories.tsx +0 -32
  98. package/src/overflow-text/OverflowText.tsx +0 -114
  99. package/src/overflow-text/__tests__/OverflowText.spec.tsx +0 -24
  100. package/src/pagination/Pagination.stories.tsx +0 -36
  101. package/src/pagination/PaginationOverrides.ts +0 -47
  102. package/src/pagination/__tests__/Pagination.spec.tsx +0 -228
  103. package/src/paper/PaperOverrides.ts +0 -10
  104. package/src/paper/__tests__/Paper.spec.tsx +0 -155
  105. package/src/props/AlignProps.ts +0 -22
  106. package/src/props/CollapseProp.ts +0 -13
  107. package/src/props/ResponsiveProp.ts +0 -65
  108. package/src/props/SpaceProp.ts +0 -40
  109. package/src/radio/RadioField.stories.tsx +0 -42
  110. package/src/radio/RadioField.tsx +0 -55
  111. package/src/radio/RadioGroupField.tsx +0 -64
  112. package/src/radio/RadioOverrides.tsx +0 -51
  113. package/src/radio/__tests__/Radio.spec.tsx +0 -90
  114. package/src/responsive/CollapseBreakpoint.ts +0 -21
  115. package/src/responsive/MinBreakpoint.ts +0 -21
  116. package/src/responsive/ResponsiveContext.tsx +0 -57
  117. package/src/snackbar/Snackbar.stories.tsx +0 -196
  118. package/src/snackbar/Snackbar.tsx +0 -83
  119. package/src/snackbar/SnackbarContent.tsx +0 -147
  120. package/src/snackbar/SnackbarOverrides.ts +0 -23
  121. package/src/snackbar/SnackbarStack.tsx +0 -160
  122. package/src/snackbar/__tests__/Snackbar.spec.tsx +0 -196
  123. package/src/stack/Stack.stories.tsx +0 -113
  124. package/src/stack/Stack.tsx +0 -86
  125. package/src/svg-icon/SvgIcon.stories.tsx +0 -29
  126. package/src/svg-icon/SvgIconOverrides.ts +0 -32
  127. package/src/svg-icon/__tests__/SvgIcon.spec.tsx +0 -67
  128. package/src/switch/Switch.stories.tsx +0 -60
  129. package/src/switch/SwitchOverrides.ts +0 -88
  130. package/src/switch/__tests__/Switch.spec.tsx +0 -204
  131. package/src/tabs/Tabs.stories.tsx +0 -40
  132. package/src/tabs/TabsOverrides.ts +0 -45
  133. package/src/tabs/__tests__/Tabs.spec.tsx +0 -226
  134. package/src/tag/Tag.stories.tsx +0 -53
  135. package/src/tag/Tag.tsx +0 -130
  136. package/src/tag/__tests__/Tag.spec.tsx +0 -82
  137. package/src/text-field/TextField.stories.tsx +0 -50
  138. package/src/text-field/TextFieldOverrides.tsx +0 -149
  139. package/src/text-field/__tests__/TextField.spec.tsx +0 -662
  140. package/src/theme/Color.ts +0 -117
  141. package/src/theme/SuperDispatchTheme.ts +0 -3
  142. package/src/theme/ThemeProvider.tsx +0 -179
  143. package/src/theme/__tests__/CssBaseline.spec.tsx +0 -49
  144. package/src/theme/__tests__/ThemeProvider.spec.ts +0 -40
  145. package/src/theme/__tests__/__snapshots__/ThemeProvider.spec.ts.snap +0 -204
  146. package/src/tiles/Tiles.stories.tsx +0 -69
  147. package/src/tiles/Tiles.tsx +0 -163
  148. package/src/tiles/__tests__/Tiles.spec.tsx +0 -221
  149. package/src/toolbar/ToolbarOverrides.ts +0 -14
  150. package/src/toolbar/__tests__/Toolbar.spec.tsx +0 -50
  151. package/src/tooltip/Tooltip.stories.tsx +0 -32
  152. package/src/tooltip/TooltipOverrides.ts +0 -34
  153. package/src/tooltip/__tests__/Tooltip.spec.tsx +0 -182
  154. package/src/typography/Typography.stories.tsx +0 -132
  155. package/src/typography/TypographyOverrides.ts +0 -125
  156. package/src/typography/__tests__/Typography.spec.tsx +0 -253
  157. package/src/utils/ExitTransitionPlaceholder.tsx +0 -22
  158. package/src/utils/ResizeObserver.tsx +0 -28
  159. package/src/utils/VisibilityObserver.tsx +0 -75
  160. package/src/utils/__tests__/ExitTransitionPlaceholder.spec.tsx +0 -34
  161. package/src/utils/isEmptyReactNode.ts +0 -11
  162. package/src/utils/mergeRefs.ts +0 -21
  163. package/src/utils/renderChildren.ts +0 -10
  164. package/src/utils/useUID.ts +0 -9
  165. package/tsconfig.json +0 -19
  166. /package/{pkg/dist-src → dist-src}/adaptive-toolbar/AdaptiveToolbar.js +0 -0
  167. /package/{pkg/dist-src → dist-src}/adaptive-vertical-toolbar/AdaptiveVerticalToolbar.js +0 -0
  168. /package/{pkg/dist-src → dist-src}/app-bar/AppBarOverrides.js +0 -0
  169. /package/{pkg/dist-src → dist-src}/autocomplete/AutocompleteOverrides.js +0 -0
  170. /package/{pkg/dist-src → dist-src}/avatar/AvatarOverrides.js +0 -0
  171. /package/{pkg/dist-src → dist-src}/avatar-button/AvatarButton.js +0 -0
  172. /package/{pkg/dist-src → dist-src}/button/Button.js +0 -0
  173. /package/{pkg/dist-src → dist-src}/button/ButtonOverrides.js +0 -0
  174. /package/{pkg/dist-src → dist-src}/card/CardOverrides.js +0 -0
  175. /package/{pkg/dist-src → dist-src}/card-button/CardButton.js +0 -0
  176. /package/{pkg/dist-src → dist-src}/checkbox/CheckboxField.js +0 -0
  177. /package/{pkg/dist-src → dist-src}/checkbox/CheckboxGroudField.js +0 -0
  178. /package/{pkg/dist-src → dist-src}/checkbox/CheckboxOverrides.js +0 -0
  179. /package/{pkg/dist-src → dist-src}/chip/ChipOverrides.js +0 -0
  180. /package/{pkg/dist-src → dist-src}/columns/Column.js +0 -0
  181. /package/{pkg/dist-src → dist-src}/columns/Columns.js +0 -0
  182. /package/{pkg/dist-src → dist-src}/description-list/DescriptionList.js +0 -0
  183. /package/{pkg/dist-src → dist-src}/dialog/DialogOverrides.js +0 -0
  184. /package/{pkg/dist-src → dist-src}/drawer/DrawerActions.js +0 -0
  185. /package/{pkg/dist-src → dist-src}/drawer/DrawerContent.js +0 -0
  186. /package/{pkg/dist-src → dist-src}/drawer/DrawerList.js +0 -0
  187. /package/{pkg/dist-src → dist-src}/drawer/DrawerOverrides.js +0 -0
  188. /package/{pkg/dist-src → dist-src}/drawer/DrawerTitle.js +0 -0
  189. /package/{pkg/dist-src → dist-src}/dropdown-button/DropdownButton.js +0 -0
  190. /package/{pkg/dist-src → dist-src}/grid/GridStack.js +0 -0
  191. /package/{pkg/dist-src → dist-src}/grid/InlineGrid.js +0 -0
  192. /package/{pkg/dist-src → dist-src}/icon-button/IconButtonOverrides.js +0 -0
  193. /package/{pkg/dist-src → dist-src}/info-card/InfoCard.js +0 -0
  194. /package/{pkg/dist-src → dist-src}/inline/Inline.js +0 -0
  195. /package/{pkg/dist-src → dist-src}/link/LinkOverrides.js +0 -0
  196. /package/{pkg/dist-src → dist-src}/list/ListOverrides.js +0 -0
  197. /package/{pkg/dist-src → dist-src}/menu/MenuOverrides.js +0 -0
  198. /package/{pkg/dist-src → dist-src}/number-field/NumberField.js +0 -0
  199. /package/{pkg/dist-src → dist-src}/overflow-text/OverflowText.js +0 -0
  200. /package/{pkg/dist-src → dist-src}/pagination/PaginationOverrides.js +0 -0
  201. /package/{pkg/dist-src → dist-src}/paper/PaperOverrides.js +0 -0
  202. /package/{pkg/dist-src → dist-src}/props/AlignProps.js +0 -0
  203. /package/{pkg/dist-src → dist-src}/props/CollapseProp.js +0 -0
  204. /package/{pkg/dist-src → dist-src}/props/ResponsiveProp.js +0 -0
  205. /package/{pkg/dist-src → dist-src}/props/SpaceProp.js +0 -0
  206. /package/{pkg/dist-src → dist-src}/radio/RadioField.js +0 -0
  207. /package/{pkg/dist-src → dist-src}/radio/RadioGroupField.js +0 -0
  208. /package/{pkg/dist-src → dist-src}/radio/RadioOverrides.js +0 -0
  209. /package/{pkg/dist-src → dist-src}/responsive/CollapseBreakpoint.js +0 -0
  210. /package/{pkg/dist-src → dist-src}/responsive/MinBreakpoint.js +0 -0
  211. /package/{pkg/dist-src → dist-src}/responsive/ResponsiveContext.js +0 -0
  212. /package/{pkg/dist-src → dist-src}/snackbar/Snackbar.js +0 -0
  213. /package/{pkg/dist-src → dist-src}/snackbar/SnackbarContent.js +0 -0
  214. /package/{pkg/dist-src → dist-src}/snackbar/SnackbarOverrides.js +0 -0
  215. /package/{pkg/dist-src → dist-src}/snackbar/SnackbarStack.js +0 -0
  216. /package/{pkg/dist-src → dist-src}/stack/Stack.js +0 -0
  217. /package/{pkg/dist-src → dist-src}/svg-icon/SvgIconOverrides.js +0 -0
  218. /package/{pkg/dist-src → dist-src}/switch/SwitchOverrides.js +0 -0
  219. /package/{pkg/dist-src → dist-src}/tabs/TabsOverrides.js +0 -0
  220. /package/{pkg/dist-src → dist-src}/tag/Tag.js +0 -0
  221. /package/{pkg/dist-src → dist-src}/text-field/TextFieldOverrides.js +0 -0
  222. /package/{pkg/dist-src → dist-src}/theme/SuperDispatchTheme.js +0 -0
  223. /package/{pkg/dist-src → dist-src}/theme/ThemeProvider.js +0 -0
  224. /package/{pkg/dist-src → dist-src}/tiles/Tiles.js +0 -0
  225. /package/{pkg/dist-src → dist-src}/toolbar/ToolbarOverrides.js +0 -0
  226. /package/{pkg/dist-src → dist-src}/tooltip/TooltipOverrides.js +0 -0
  227. /package/{pkg/dist-src → dist-src}/typography/TypographyOverrides.js +0 -0
  228. /package/{pkg/dist-src → dist-src}/utils/ExitTransitionPlaceholder.js +0 -0
  229. /package/{pkg/dist-src → dist-src}/utils/ResizeObserver.js +0 -0
  230. /package/{pkg/dist-src → dist-src}/utils/VisibilityObserver.js +0 -0
  231. /package/{pkg/dist-src → dist-src}/utils/isEmptyReactNode.js +0 -0
  232. /package/{pkg/dist-src → dist-src}/utils/mergeRefs.js +0 -0
  233. /package/{pkg/dist-src → dist-src}/utils/renderChildren.js +0 -0
  234. /package/{pkg/dist-src → dist-src}/utils/useUID.js +0 -0
@@ -1,62 +0,0 @@
1
- import { AppBar, IconButton, Toolbar, Typography } from '@material-ui/core';
2
- import { ArrowBack, Close } from '@material-ui/icons';
3
- import { Meta } from '@storybook/react';
4
- import { PropsLink } from '@superdispatch/ui-docs';
5
- import { Column, Columns } from '..';
6
-
7
- export default {
8
- title: 'Surfaces/AppBar',
9
- parameters: {
10
- componentSubtitle: (
11
- <PropsLink url="https://material-ui.com/api/app-bar/#props" />
12
- ),
13
- },
14
- } as Meta;
15
-
16
- export const basic = () => (
17
- <AppBar>
18
- <Toolbar>
19
- <Columns align="center">
20
- <Column width="content">
21
- <IconButton edge="start" aria-label="back">
22
- <ArrowBack />
23
- </IconButton>
24
- </Column>
25
-
26
- <Column>
27
- <Typography variant="h2">App Bar</Typography>
28
- </Column>
29
-
30
- <Column width="content">
31
- <IconButton edge="end" aria-label="close">
32
- <Close />
33
- </IconButton>
34
- </Column>
35
- </Columns>
36
- </Toolbar>
37
- </AppBar>
38
- );
39
-
40
- export const dense = () => (
41
- <AppBar>
42
- <Toolbar variant="dense">
43
- <Columns align="center">
44
- <Column width="content">
45
- <IconButton edge="start" aria-label="back">
46
- <ArrowBack />
47
- </IconButton>
48
- </Column>
49
-
50
- <Column>
51
- <Typography variant="h2">App Bar</Typography>
52
- </Column>
53
-
54
- <Column width="content">
55
- <IconButton edge="end" aria-label="close">
56
- <Close />
57
- </IconButton>
58
- </Column>
59
- </Columns>
60
- </Toolbar>
61
- </AppBar>
62
- );
@@ -1,9 +0,0 @@
1
- import { SuperDispatchTheme } from '../theme/SuperDispatchTheme';
2
-
3
- export function overrideAppBar(theme: SuperDispatchTheme): void {
4
- theme.props.MuiAppBar = {
5
- elevation: 0,
6
- color: 'inherit',
7
- position: 'static',
8
- };
9
- }
@@ -1,86 +0,0 @@
1
- import { AppBar } from '@material-ui/core';
2
- import { renderCSS, renderTheme } from '@superdispatch/ui-testutils';
3
-
4
- it('checks default props', () => {
5
- const { props } = renderTheme();
6
-
7
- expect(props.MuiAppBar).toMatchInlineSnapshot(`
8
- Object {
9
- "color": "inherit",
10
- "elevation": 0,
11
- "position": "static",
12
- }
13
- `);
14
- });
15
-
16
- it('checks component css', () => {
17
- expect(renderCSS(<AppBar />, ['MuiAppBar'])).toMatchInlineSnapshot(`
18
- .MuiAppBar-root {
19
- width: 100%;
20
- display: flex;
21
- z-index: 1100;
22
- box-sizing: border-box;
23
- flex-shrink: 0;
24
- flex-direction: column;
25
- }
26
-
27
- .MuiAppBar-positionFixed {
28
- top: 0;
29
- left: auto;
30
- right: 0;
31
- position: fixed;
32
- }
33
-
34
- @media print {
35
- .MuiAppBar-positionFixed {
36
- position: absolute;
37
- }
38
- }
39
-
40
- .MuiAppBar-positionAbsolute {
41
- top: 0;
42
- left: auto;
43
- right: 0;
44
- position: absolute;
45
- }
46
-
47
- .MuiAppBar-positionSticky {
48
- top: 0;
49
- left: auto;
50
- right: 0;
51
- position: sticky;
52
- }
53
-
54
- .MuiAppBar-positionStatic {
55
- position: static;
56
- }
57
-
58
- .MuiAppBar-positionRelative {
59
- position: relative;
60
- }
61
-
62
- .MuiAppBar-colorDefault {
63
- color: rgba(0, 0, 0, 0.87);
64
- background-color: #f5f5f5;
65
- }
66
-
67
- .MuiAppBar-colorPrimary {
68
- color: Color.White;
69
- background-color: Color.Blue300;
70
- }
71
-
72
- .MuiAppBar-colorSecondary {
73
- color: Color.White;
74
- background-color: #f50057;
75
- }
76
-
77
- .MuiAppBar-colorInherit {
78
- color: inherit;
79
- }
80
-
81
- .MuiAppBar-colorTransparent {
82
- color: inherit;
83
- background-color: transparent;
84
- }
85
- `);
86
- });
@@ -1,76 +0,0 @@
1
- import { TextField } from '@material-ui/core';
2
- import { Autocomplete } from '@material-ui/lab';
3
- import { Meta } from '@storybook/react';
4
- import { PropsLink } from '@superdispatch/ui-docs';
5
- import { Box } from '@superdispatch/ui-lab';
6
-
7
- export default {
8
- title: 'Inputs/Autocomplete',
9
- decorators: [
10
- (Story) => (
11
- <Box maxWidth="240px">
12
- <Story />
13
- </Box>
14
- ),
15
- ],
16
- parameters: {
17
- componentSubtitle: (
18
- <PropsLink url="https://material-ui.com/api/autocomplete/#props" />
19
- ),
20
- },
21
- } as Meta;
22
-
23
- export const basic = () => (
24
- <Autocomplete
25
- options={['Option 1', 'Option 2']}
26
- renderInput={(params) => (
27
- <TextField {...params} label="Label" helperText="Helper text" />
28
- )}
29
- />
30
- );
31
-
32
- export const error = () => (
33
- <Autocomplete
34
- options={['Option 1', 'Option 2']}
35
- renderInput={(params) => (
36
- <TextField
37
- {...params}
38
- error={true}
39
- label="Label"
40
- helperText="Error text"
41
- />
42
- )}
43
- />
44
- );
45
-
46
- export const disabled = () => (
47
- <Autocomplete
48
- disabled={true}
49
- options={[]}
50
- renderInput={(params) => <TextField {...params} />}
51
- />
52
- );
53
-
54
- export const loading = () => (
55
- <Autocomplete
56
- loading={true}
57
- options={[]}
58
- renderInput={(params) => <TextField {...params} />}
59
- />
60
- );
61
-
62
- export const disableClearable = () => (
63
- <Autocomplete
64
- disableClearable={true}
65
- options={['Option 1', 'Option 2']}
66
- renderInput={(params) => <TextField {...params} />}
67
- />
68
- );
69
-
70
- export const forcePopupIcon = () => (
71
- <Autocomplete
72
- forcePopupIcon={true}
73
- options={['John Doe', 'Richard Roe']}
74
- renderInput={(params) => <TextField {...params} />}
75
- />
76
- );
@@ -1,58 +0,0 @@
1
- import { SvgIcon } from '@material-ui/core';
2
- import { SuperDispatchTheme } from '../theme/SuperDispatchTheme';
3
-
4
- export function overrideAutocomplete(theme: SuperDispatchTheme): void {
5
- const sm = theme.breakpoints.up('sm');
6
-
7
- // Remove `Object.assign` after official release of `Autocomplete`.
8
- Object.assign(theme.props, {
9
- MuiAutocomplete: {
10
- popupIcon: (
11
- <SvgIcon>
12
- <path d="M12 16.5L6 9h12l-6 7.5z" fill="currentColor" />
13
- </SvgIcon>
14
- ),
15
- },
16
- });
17
-
18
- Object.assign(theme.overrides, {
19
- MuiAutocomplete: {
20
- paper: { ...theme.typography.body2 },
21
- tag: {
22
- margin: '4px',
23
- [sm]: { margin: '2px' },
24
- },
25
- endAdornment: {
26
- top: 0,
27
- bottom: 0,
28
- display: 'flex',
29
- alignItems: 'center',
30
- },
31
- popupIndicator: {
32
- '& .MuiSvgIcon-root': {
33
- fontSize: '24px',
34
- [sm]: { fontSize: '16px' },
35
- },
36
- },
37
- inputRoot: {
38
- '&[class*="MuiOutlinedInput-root"]': {
39
- padding: '6px 8px',
40
-
41
- '& $input': {
42
- width: '144px',
43
- padding: '4px',
44
- },
45
-
46
- '& $input:first-child': { paddingLeft: undefined },
47
- '& $endAdornment': { right: '12px' },
48
-
49
- [sm]: {
50
- padding: theme.spacing(0.5, 0.75),
51
- '& $input': { padding: '2px' },
52
- '& $endAdornment': { right: '8px' },
53
- },
54
- },
55
- },
56
- },
57
- });
58
- }
@@ -1,323 +0,0 @@
1
- import { Autocomplete } from '@material-ui/lab';
2
- import { renderCSS, renderTheme } from '@superdispatch/ui-testutils';
3
-
4
- it('checks default props', () => {
5
- const { props } = renderTheme();
6
-
7
- // Remove `any` after official release.
8
- expect((props as any).MuiAutocomplete).toMatchInlineSnapshot(`
9
- Object {
10
- "popupIcon": <WithStyles(ForwardRef(SvgIcon))>
11
- <path
12
- d="M12 16.5L6 9h12l-6 7.5z"
13
- fill="currentColor"
14
- />
15
- </WithStyles(ForwardRef(SvgIcon))>,
16
- }
17
- `);
18
- });
19
-
20
- it('checks component css', () => {
21
- expect(
22
- renderCSS(<Autocomplete options={[]} renderInput={() => <div />} />, [
23
- 'MuiAutocomplete',
24
- ]),
25
- ).toMatchInlineSnapshot(`
26
- .MuiAutocomplete-root.Mui-focused .MuiAutocomplete-clearIndicatorDirty {
27
- visibility: visible;
28
- }
29
-
30
- @media (pointer: fine) {
31
- .MuiAutocomplete-root:hover .MuiAutocomplete-clearIndicatorDirty {
32
- visibility: visible;
33
- }
34
- }
35
-
36
- .MuiAutocomplete-fullWidth {
37
- width: 100%;
38
- }
39
-
40
- .MuiAutocomplete-tag {
41
- margin: 4px;
42
- max-width: calc(100% - 6px);
43
- }
44
-
45
- @media (min-width: 600px) {
46
- .MuiAutocomplete-tag {
47
- margin: 2px;
48
- }
49
- }
50
-
51
- .MuiAutocomplete-tagSizeSmall {
52
- margin: 2px;
53
- max-width: calc(100% - 4px);
54
- }
55
-
56
- .MuiAutocomplete-inputRoot {
57
- flex-wrap: wrap;
58
- }
59
-
60
- .MuiAutocomplete-hasPopupIcon .MuiAutocomplete-inputRoot,
61
- .MuiAutocomplete-hasClearIcon .MuiAutocomplete-inputRoot {
62
- padding-right: 30px;
63
- }
64
-
65
- .MuiAutocomplete-hasPopupIcon.MuiAutocomplete-hasClearIcon
66
- .MuiAutocomplete-inputRoot {
67
- padding-right: 56px;
68
- }
69
-
70
- .MuiAutocomplete-inputRoot .MuiAutocomplete-input {
71
- width: 0;
72
- min-width: 30px;
73
- }
74
-
75
- .MuiAutocomplete-inputRoot[class*='MuiInput-root'] {
76
- padding-bottom: 1px;
77
- }
78
-
79
- .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root'] {
80
- padding: 6px 8px;
81
- }
82
-
83
- .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root'][class*='MuiOutlinedInput-marginDense'] {
84
- padding: 6px;
85
- }
86
-
87
- .MuiAutocomplete-inputRoot[class*='MuiFilledInput-root'] {
88
- padding-top: 19px;
89
- padding-left: 8px;
90
- }
91
-
92
- .MuiAutocomplete-inputRoot[class*='MuiFilledInput-root'][class*='MuiFilledInput-marginDense'] {
93
- padding-bottom: 1px;
94
- }
95
-
96
- .MuiAutocomplete-inputRoot[class*='MuiFilledInput-root'][class*='MuiFilledInput-marginDense']
97
- .MuiAutocomplete-input {
98
- padding: 4.5px 4px;
99
- }
100
-
101
- .MuiAutocomplete-hasPopupIcon
102
- .MuiAutocomplete-inputRoot[class*='MuiFilledInput-root'],
103
- .MuiAutocomplete-hasClearIcon
104
- .MuiAutocomplete-inputRoot[class*='MuiFilledInput-root'] {
105
- padding-right: 39px;
106
- }
107
-
108
- .MuiAutocomplete-hasPopupIcon.MuiAutocomplete-hasClearIcon
109
- .MuiAutocomplete-inputRoot[class*='MuiFilledInput-root'] {
110
- padding-right: 65px;
111
- }
112
-
113
- .MuiAutocomplete-inputRoot[class*='MuiFilledInput-root']
114
- .MuiAutocomplete-input {
115
- padding: 9px 4px;
116
- }
117
-
118
- .MuiAutocomplete-inputRoot[class*='MuiFilledInput-root']
119
- .MuiAutocomplete-endAdornment {
120
- right: 9px;
121
- }
122
-
123
- .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root'][class*='MuiOutlinedInput-marginDense']
124
- .MuiAutocomplete-input {
125
- padding: 4.5px 4px;
126
- }
127
-
128
- .MuiAutocomplete-hasPopupIcon
129
- .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root'],
130
- .MuiAutocomplete-hasClearIcon
131
- .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root'] {
132
- padding-right: 39px;
133
- }
134
-
135
- .MuiAutocomplete-hasPopupIcon.MuiAutocomplete-hasClearIcon
136
- .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root'] {
137
- padding-right: 65px;
138
- }
139
-
140
- .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root']
141
- .MuiAutocomplete-input {
142
- width: 144px;
143
- padding: 4px;
144
- }
145
-
146
- .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root']
147
- .MuiAutocomplete-endAdornment {
148
- right: 12px;
149
- }
150
-
151
- @media (min-width: 600px) {
152
- .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root'] {
153
- padding: 4px 6px;
154
- }
155
-
156
- .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root']
157
- .MuiAutocomplete-input {
158
- padding: 2px;
159
- }
160
-
161
- .MuiAutocomplete-inputRoot[class*='MuiOutlinedInput-root']
162
- .MuiAutocomplete-endAdornment {
163
- right: 8px;
164
- }
165
- }
166
-
167
- .MuiAutocomplete-inputRoot[class*='MuiInput-root'][class*='MuiInput-marginDense']
168
- .MuiAutocomplete-input {
169
- padding: 4px 4px 5px;
170
- }
171
-
172
- .MuiAutocomplete-inputRoot[class*='MuiInput-root'][class*='MuiInput-marginDense']
173
- .MuiAutocomplete-input:first-child {
174
- padding: 3px 0 6px;
175
- }
176
-
177
- .MuiAutocomplete-inputRoot[class*='MuiInput-root'] .MuiAutocomplete-input {
178
- padding: 4px;
179
- }
180
-
181
- .MuiAutocomplete-inputRoot[class*='MuiInput-root']
182
- .MuiAutocomplete-input:first-child {
183
- padding: 6px 0;
184
- }
185
-
186
- .MuiAutocomplete-input {
187
- opacity: 0;
188
- flex-grow: 1;
189
- text-overflow: ellipsis;
190
- }
191
-
192
- .MuiAutocomplete-inputFocused {
193
- opacity: 1;
194
- }
195
-
196
- .MuiAutocomplete-endAdornment {
197
- top: 0;
198
- right: 0;
199
- bottom: 0;
200
- display: flex;
201
- position: absolute;
202
- align-items: center;
203
- }
204
-
205
- .MuiAutocomplete-clearIndicator {
206
- padding: 4px;
207
- visibility: hidden;
208
- margin-right: -2px;
209
- }
210
-
211
- .MuiAutocomplete-popupIndicator {
212
- padding: 2px;
213
- margin-right: -2px;
214
- }
215
-
216
- .MuiAutocomplete-popupIndicator .MuiSvgIcon-root {
217
- font-size: 24px;
218
- }
219
-
220
- @media (min-width: 600px) {
221
- .MuiAutocomplete-popupIndicator .MuiSvgIcon-root {
222
- font-size: 16px;
223
- }
224
- }
225
-
226
- .MuiAutocomplete-popupIndicatorOpen {
227
- transform: rotate(180deg);
228
- }
229
-
230
- .MuiAutocomplete-popper {
231
- z-index: 1300;
232
- }
233
-
234
- .MuiAutocomplete-popperDisablePortal {
235
- position: absolute;
236
- }
237
-
238
- .MuiAutocomplete-paper {
239
- margin: 4px 0;
240
- overflow: hidden;
241
- font-size: 14px;
242
- font-family: 'Inter', sans-serif;
243
- font-weight: 400;
244
- line-height: 20px;
245
- }
246
-
247
- @media (min-width: 0px) and (max-width: 599.95px) {
248
- .MuiAutocomplete-paper {
249
- font-size: 16px;
250
- line-height: 24px;
251
- }
252
- }
253
-
254
- .MuiAutocomplete-listbox {
255
- margin: 0;
256
- padding: 8px 0;
257
- overflow: auto;
258
- list-style: none;
259
- max-height: 40vh;
260
- }
261
-
262
- .MuiAutocomplete-loading {
263
- color: Color.Dark200;
264
- padding: 14px 16px;
265
- }
266
-
267
- .MuiAutocomplete-noOptions {
268
- color: Color.Dark200;
269
- padding: 14px 16px;
270
- }
271
-
272
- .MuiAutocomplete-option {
273
- cursor: pointer;
274
- display: flex;
275
- outline: 0;
276
- box-sizing: border-box;
277
- min-height: 48px;
278
- align-items: center;
279
- padding-top: 6px;
280
- padding-left: 16px;
281
- padding-right: 16px;
282
- padding-bottom: 6px;
283
- justify-content: flex-start;
284
- -webkit-tap-highlight-color: transparent;
285
- }
286
-
287
- @media (min-width: 600px) {
288
- .MuiAutocomplete-option {
289
- min-height: auto;
290
- }
291
- }
292
-
293
- .MuiAutocomplete-option[aria-selected='true'] {
294
- background-color: Color.Silver300;
295
- }
296
-
297
- .MuiAutocomplete-option[data-focus='true'] {
298
- background-color: Color.Silver100;
299
- }
300
-
301
- .MuiAutocomplete-option:active {
302
- background-color: Color.Silver300;
303
- }
304
-
305
- .MuiAutocomplete-option[aria-disabled='true'] {
306
- opacity: 0.38;
307
- pointer-events: none;
308
- }
309
-
310
- .MuiAutocomplete-groupLabel {
311
- top: -8px;
312
- background-color: Color.White;
313
- }
314
-
315
- .MuiAutocomplete-groupUl {
316
- padding: 0;
317
- }
318
-
319
- .MuiAutocomplete-groupUl .MuiAutocomplete-option {
320
- padding-left: 24px;
321
- }
322
- `);
323
- });
@@ -1,17 +0,0 @@
1
- import { Avatar } from '@material-ui/core';
2
- import { PropsLink } from '@superdispatch/ui-docs';
3
-
4
- export default {
5
- title: 'Data Display/Avatar',
6
- parameters: {
7
- componentSubtitle: (
8
- <PropsLink url="https://material-ui.com/api/avatar/#props" />
9
- ),
10
- },
11
- };
12
-
13
- export const basic = () => <Avatar />;
14
- export const text = () => <Avatar>A1</Avatar>;
15
- export const image = () => (
16
- <Avatar src="https://images.unsplash.com/photo-1571816119607-57e48af1caa9?q=80" />
17
- );
@@ -1,24 +0,0 @@
1
- import { Color } from '../theme/Color';
2
- import { SuperDispatchTheme } from '../theme/SuperDispatchTheme';
3
-
4
- export function overrideAvatar(theme: SuperDispatchTheme): void {
5
- theme.overrides.MuiAvatar = {
6
- root: {
7
- ...theme.typography.h5,
8
- textTransform: 'uppercase',
9
-
10
- width: theme.spacing(5),
11
- height: theme.spacing(5),
12
-
13
- [theme.breakpoints.up('sm')]: {
14
- width: theme.spacing(4),
15
- height: theme.spacing(4),
16
- },
17
- },
18
-
19
- colorDefault: {
20
- color: Color.Dark300,
21
- backgroundColor: Color.Silver300,
22
- },
23
- };
24
- }