@superdispatch/ui 0.21.13 → 0.21.14

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 +62 -14
  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-types → dist-types}/index.d.ts +14 -2
  7. package/{pkg/dist-web → dist-web}/index.js +64 -17
  8. package/dist-web/index.js.map +1 -0
  9. package/package.json +12 -38
  10. package/.babelrc.js +0 -5
  11. package/.turbo/turbo-version.log +0 -28
  12. package/pkg/README.md +0 -30
  13. package/pkg/dist-node/index.js.map +0 -1
  14. package/pkg/dist-web/index.js.map +0 -1
  15. package/pkg/package.json +0 -39
  16. package/playroom.ts +0 -31
  17. package/src/__tests__/index.spec.ts +0 -134
  18. package/src/adaptive-toolbar/AdaptiveToolbar.stories.tsx +0 -50
  19. package/src/adaptive-toolbar/AdaptiveToolbar.tsx +0 -199
  20. package/src/adaptive-toolbar/__tests__/AdaptiveToolbar.spec.tsx +0 -11
  21. package/src/adaptive-vertical-toolbar/AdaptiveVerticalToolbar.stories.tsx +0 -49
  22. package/src/adaptive-vertical-toolbar/AdaptiveVerticalToolbar.tsx +0 -171
  23. package/src/app-bar/AppBar.stories.tsx +0 -62
  24. package/src/app-bar/AppBarOverrides.ts +0 -9
  25. package/src/app-bar/__tests__/AppBar.spec.tsx +0 -86
  26. package/src/autocomplete/Autocomplete.stories.tsx +0 -76
  27. package/src/autocomplete/AutocompleteOverrides.tsx +0 -58
  28. package/src/autocomplete/__tests__/Autocomplete.spec.tsx +0 -323
  29. package/src/avatar/Avatar.stories.tsx +0 -17
  30. package/src/avatar/AvatarOverrides.ts +0 -24
  31. package/src/avatar/__tests__/Avatar.spec.tsx +0 -71
  32. package/src/avatar-button/AvatarButton.stories.tsx +0 -153
  33. package/src/avatar-button/AvatarButton.tsx +0 -223
  34. package/src/avatar-button/__tests__/AvatarButton.spec.tsx +0 -126
  35. package/src/button/Button.tsx +0 -51
  36. package/src/button/ButtonOverrides.ts +0 -375
  37. package/src/button/__tests__/Button.spec.tsx +0 -599
  38. package/src/card/Card.stories.tsx +0 -39
  39. package/src/card/CardOverrides.ts +0 -9
  40. package/src/card/__tests__/Card.spec.tsx +0 -68
  41. package/src/card-button/CardButton.stories.tsx +0 -36
  42. package/src/card-button/CardButton.tsx +0 -202
  43. package/src/card-button/__tests__/CardButton.spec.tsx +0 -95
  44. package/src/checkbox/CheckboxField.stories.tsx +0 -61
  45. package/src/checkbox/CheckboxField.tsx +0 -56
  46. package/src/checkbox/CheckboxGroudField.tsx +0 -53
  47. package/src/checkbox/CheckboxOverrides.tsx +0 -55
  48. package/src/checkbox/__tests__/Checkbox.spec.tsx +0 -105
  49. package/src/chip/Chip.stories.tsx +0 -26
  50. package/src/chip/ChipOverrides.tsx +0 -111
  51. package/src/chip/__tests__/Chip.spec.tsx +0 -308
  52. package/src/columns/Column.tsx +0 -124
  53. package/src/columns/Columns.stories.tsx +0 -426
  54. package/src/columns/Columns.tsx +0 -76
  55. package/src/description-list/DescriptionList.spec.tsx +0 -137
  56. package/src/description-list/DescriptionList.stories.tsx +0 -148
  57. package/src/description-list/DescriptionList.tsx +0 -170
  58. package/src/dialog/Dialog.playroom.tsx +0 -24
  59. package/src/dialog/Dialog.stories.tsx +0 -60
  60. package/src/dialog/DialogOverrides.ts +0 -39
  61. package/src/dialog/__tests__/Dialog.spec.tsx +0 -219
  62. package/src/drawer/Drawer.playroom.tsx +0 -22
  63. package/src/drawer/Drawer.stories.tsx +0 -194
  64. package/src/drawer/DrawerActions.tsx +0 -69
  65. package/src/drawer/DrawerContent.tsx +0 -30
  66. package/src/drawer/DrawerList.tsx +0 -60
  67. package/src/drawer/DrawerOverrides.ts +0 -19
  68. package/src/drawer/DrawerTitle.tsx +0 -143
  69. package/src/drawer/__tests__/Drawer.spec.tsx +0 -227
  70. package/src/dropdown-button/DropdownButton.stories.tsx +0 -15
  71. package/src/dropdown-button/DropdownButton.tsx +0 -131
  72. package/src/grid/GridStack.tsx +0 -45
  73. package/src/grid/InlineGrid.tsx +0 -56
  74. package/src/icon-button/IconButton.stories.tsx +0 -53
  75. package/src/icon-button/IconButtonOverrides.ts +0 -32
  76. package/src/icon-button/__tests__/IconButton.spec.tsx +0 -124
  77. package/src/index.ts +0 -47
  78. package/src/info-card/InfoCard.stories.tsx +0 -29
  79. package/src/info-card/InfoCard.tsx +0 -95
  80. package/src/info-card/__tests__/InfoCard.spec.tsx +0 -22
  81. package/src/info-tooltip/InfoTooltip.stories.tsx +0 -77
  82. package/src/info-tooltip/InfoTooltip.tsx +0 -72
  83. package/src/info-tooltip/__tests__/InfoTooltip.spec.tsx +0 -166
  84. package/src/inline/Inline.stories.tsx +0 -135
  85. package/src/inline/Inline.tsx +0 -144
  86. package/src/link/Link.stories.tsx +0 -41
  87. package/src/link/LinkOverrides.ts +0 -43
  88. package/src/link/__tests__/Link.spec.tsx +0 -98
  89. package/src/list/ListOverrides.ts +0 -11
  90. package/src/list/__tests__/List.spec.tsx +0 -182
  91. package/src/menu/Menu.stories.tsx +0 -35
  92. package/src/menu/MenuOverrides.ts +0 -17
  93. package/src/menu/__tests__/Menu.spec.tsx +0 -99
  94. package/src/number-field/NumberField.stories.tsx +0 -123
  95. package/src/number-field/NumberField.tsx +0 -98
  96. package/src/overflow-text/OverflowText.stories.tsx +0 -32
  97. package/src/overflow-text/OverflowText.tsx +0 -114
  98. package/src/overflow-text/__tests__/OverflowText.spec.tsx +0 -24
  99. package/src/pagination/Pagination.stories.tsx +0 -36
  100. package/src/pagination/PaginationOverrides.ts +0 -47
  101. package/src/pagination/__tests__/Pagination.spec.tsx +0 -228
  102. package/src/paper/PaperOverrides.ts +0 -10
  103. package/src/paper/__tests__/Paper.spec.tsx +0 -155
  104. package/src/props/AlignProps.ts +0 -22
  105. package/src/props/CollapseProp.ts +0 -13
  106. package/src/props/ResponsiveProp.ts +0 -65
  107. package/src/props/SpaceProp.ts +0 -40
  108. package/src/radio/RadioField.stories.tsx +0 -42
  109. package/src/radio/RadioField.tsx +0 -55
  110. package/src/radio/RadioGroupField.tsx +0 -64
  111. package/src/radio/RadioOverrides.tsx +0 -51
  112. package/src/radio/__tests__/Radio.spec.tsx +0 -90
  113. package/src/responsive/CollapseBreakpoint.ts +0 -21
  114. package/src/responsive/MinBreakpoint.ts +0 -21
  115. package/src/responsive/ResponsiveContext.tsx +0 -57
  116. package/src/snackbar/Snackbar.stories.tsx +0 -196
  117. package/src/snackbar/Snackbar.tsx +0 -83
  118. package/src/snackbar/SnackbarContent.tsx +0 -147
  119. package/src/snackbar/SnackbarOverrides.ts +0 -23
  120. package/src/snackbar/SnackbarStack.tsx +0 -160
  121. package/src/snackbar/__tests__/Snackbar.spec.tsx +0 -196
  122. package/src/stack/Stack.stories.tsx +0 -113
  123. package/src/stack/Stack.tsx +0 -86
  124. package/src/svg-icon/SvgIcon.stories.tsx +0 -29
  125. package/src/svg-icon/SvgIconOverrides.ts +0 -32
  126. package/src/svg-icon/__tests__/SvgIcon.spec.tsx +0 -67
  127. package/src/switch/Switch.stories.tsx +0 -60
  128. package/src/switch/SwitchOverrides.ts +0 -88
  129. package/src/switch/__tests__/Switch.spec.tsx +0 -204
  130. package/src/tabs/Tabs.stories.tsx +0 -40
  131. package/src/tabs/TabsOverrides.ts +0 -45
  132. package/src/tabs/__tests__/Tabs.spec.tsx +0 -226
  133. package/src/tag/Tag.stories.tsx +0 -53
  134. package/src/tag/Tag.tsx +0 -130
  135. package/src/tag/__tests__/Tag.spec.tsx +0 -82
  136. package/src/text-field/TextField.stories.tsx +0 -50
  137. package/src/text-field/TextFieldOverrides.tsx +0 -149
  138. package/src/text-field/__tests__/TextField.spec.tsx +0 -662
  139. package/src/theme/Color.ts +0 -117
  140. package/src/theme/SuperDispatchTheme.ts +0 -3
  141. package/src/theme/ThemeProvider.tsx +0 -179
  142. package/src/theme/__tests__/CssBaseline.spec.tsx +0 -49
  143. package/src/theme/__tests__/ThemeProvider.spec.ts +0 -40
  144. package/src/theme/__tests__/__snapshots__/ThemeProvider.spec.ts.snap +0 -204
  145. package/src/tiles/Tiles.stories.tsx +0 -69
  146. package/src/tiles/Tiles.tsx +0 -163
  147. package/src/tiles/__tests__/Tiles.spec.tsx +0 -221
  148. package/src/toolbar/ToolbarOverrides.ts +0 -14
  149. package/src/toolbar/__tests__/Toolbar.spec.tsx +0 -50
  150. package/src/tooltip/Tooltip.stories.tsx +0 -32
  151. package/src/tooltip/TooltipOverrides.ts +0 -34
  152. package/src/tooltip/__tests__/Tooltip.spec.tsx +0 -182
  153. package/src/typography/Typography.stories.tsx +0 -132
  154. package/src/typography/TypographyOverrides.ts +0 -125
  155. package/src/typography/__tests__/Typography.spec.tsx +0 -253
  156. package/src/utils/ExitTransitionPlaceholder.tsx +0 -22
  157. package/src/utils/ResizeObserver.tsx +0 -28
  158. package/src/utils/VisibilityObserver.tsx +0 -75
  159. package/src/utils/__tests__/ExitTransitionPlaceholder.spec.tsx +0 -34
  160. package/src/utils/isEmptyReactNode.ts +0 -11
  161. package/src/utils/mergeRefs.ts +0 -21
  162. package/src/utils/renderChildren.ts +0 -10
  163. package/src/utils/useUID.ts +0 -9
  164. package/tsconfig.json +0 -19
  165. /package/{pkg/dist-src → dist-src}/adaptive-toolbar/AdaptiveToolbar.js +0 -0
  166. /package/{pkg/dist-src → dist-src}/adaptive-vertical-toolbar/AdaptiveVerticalToolbar.js +0 -0
  167. /package/{pkg/dist-src → dist-src}/app-bar/AppBarOverrides.js +0 -0
  168. /package/{pkg/dist-src → dist-src}/autocomplete/AutocompleteOverrides.js +0 -0
  169. /package/{pkg/dist-src → dist-src}/avatar/AvatarOverrides.js +0 -0
  170. /package/{pkg/dist-src → dist-src}/avatar-button/AvatarButton.js +0 -0
  171. /package/{pkg/dist-src → dist-src}/button/Button.js +0 -0
  172. /package/{pkg/dist-src → dist-src}/button/ButtonOverrides.js +0 -0
  173. /package/{pkg/dist-src → dist-src}/card/CardOverrides.js +0 -0
  174. /package/{pkg/dist-src → dist-src}/card-button/CardButton.js +0 -0
  175. /package/{pkg/dist-src → dist-src}/checkbox/CheckboxField.js +0 -0
  176. /package/{pkg/dist-src → dist-src}/checkbox/CheckboxGroudField.js +0 -0
  177. /package/{pkg/dist-src → dist-src}/checkbox/CheckboxOverrides.js +0 -0
  178. /package/{pkg/dist-src → dist-src}/chip/ChipOverrides.js +0 -0
  179. /package/{pkg/dist-src → dist-src}/columns/Column.js +0 -0
  180. /package/{pkg/dist-src → dist-src}/columns/Columns.js +0 -0
  181. /package/{pkg/dist-src → dist-src}/description-list/DescriptionList.js +0 -0
  182. /package/{pkg/dist-src → dist-src}/dialog/DialogOverrides.js +0 -0
  183. /package/{pkg/dist-src → dist-src}/drawer/DrawerActions.js +0 -0
  184. /package/{pkg/dist-src → dist-src}/drawer/DrawerContent.js +0 -0
  185. /package/{pkg/dist-src → dist-src}/drawer/DrawerList.js +0 -0
  186. /package/{pkg/dist-src → dist-src}/drawer/DrawerOverrides.js +0 -0
  187. /package/{pkg/dist-src → dist-src}/drawer/DrawerTitle.js +0 -0
  188. /package/{pkg/dist-src → dist-src}/dropdown-button/DropdownButton.js +0 -0
  189. /package/{pkg/dist-src → dist-src}/grid/GridStack.js +0 -0
  190. /package/{pkg/dist-src → dist-src}/grid/InlineGrid.js +0 -0
  191. /package/{pkg/dist-src → dist-src}/icon-button/IconButtonOverrides.js +0 -0
  192. /package/{pkg/dist-src → dist-src}/info-card/InfoCard.js +0 -0
  193. /package/{pkg/dist-src → dist-src}/inline/Inline.js +0 -0
  194. /package/{pkg/dist-src → dist-src}/link/LinkOverrides.js +0 -0
  195. /package/{pkg/dist-src → dist-src}/list/ListOverrides.js +0 -0
  196. /package/{pkg/dist-src → dist-src}/menu/MenuOverrides.js +0 -0
  197. /package/{pkg/dist-src → dist-src}/number-field/NumberField.js +0 -0
  198. /package/{pkg/dist-src → dist-src}/overflow-text/OverflowText.js +0 -0
  199. /package/{pkg/dist-src → dist-src}/pagination/PaginationOverrides.js +0 -0
  200. /package/{pkg/dist-src → dist-src}/paper/PaperOverrides.js +0 -0
  201. /package/{pkg/dist-src → dist-src}/props/AlignProps.js +0 -0
  202. /package/{pkg/dist-src → dist-src}/props/CollapseProp.js +0 -0
  203. /package/{pkg/dist-src → dist-src}/props/ResponsiveProp.js +0 -0
  204. /package/{pkg/dist-src → dist-src}/props/SpaceProp.js +0 -0
  205. /package/{pkg/dist-src → dist-src}/radio/RadioField.js +0 -0
  206. /package/{pkg/dist-src → dist-src}/radio/RadioGroupField.js +0 -0
  207. /package/{pkg/dist-src → dist-src}/radio/RadioOverrides.js +0 -0
  208. /package/{pkg/dist-src → dist-src}/responsive/CollapseBreakpoint.js +0 -0
  209. /package/{pkg/dist-src → dist-src}/responsive/MinBreakpoint.js +0 -0
  210. /package/{pkg/dist-src → dist-src}/responsive/ResponsiveContext.js +0 -0
  211. /package/{pkg/dist-src → dist-src}/snackbar/Snackbar.js +0 -0
  212. /package/{pkg/dist-src → dist-src}/snackbar/SnackbarContent.js +0 -0
  213. /package/{pkg/dist-src → dist-src}/snackbar/SnackbarOverrides.js +0 -0
  214. /package/{pkg/dist-src → dist-src}/snackbar/SnackbarStack.js +0 -0
  215. /package/{pkg/dist-src → dist-src}/stack/Stack.js +0 -0
  216. /package/{pkg/dist-src → dist-src}/svg-icon/SvgIconOverrides.js +0 -0
  217. /package/{pkg/dist-src → dist-src}/switch/SwitchOverrides.js +0 -0
  218. /package/{pkg/dist-src → dist-src}/tabs/TabsOverrides.js +0 -0
  219. /package/{pkg/dist-src → dist-src}/tag/Tag.js +0 -0
  220. /package/{pkg/dist-src → dist-src}/text-field/TextFieldOverrides.js +0 -0
  221. /package/{pkg/dist-src → dist-src}/theme/Color.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
package/src/index.ts DELETED
@@ -1,47 +0,0 @@
1
- export * from './adaptive-toolbar/AdaptiveToolbar';
2
- export * from './adaptive-vertical-toolbar/AdaptiveVerticalToolbar';
3
- export * from './avatar-button/AvatarButton';
4
- export * from './button/Button';
5
- export * from './card-button/CardButton';
6
- export * from './checkbox/CheckboxField';
7
- export * from './checkbox/CheckboxGroudField';
8
- export * from './columns/Column';
9
- export * from './columns/Columns';
10
- export * from './description-list/DescriptionList';
11
- export * from './drawer/DrawerActions';
12
- export * from './drawer/DrawerContent';
13
- export * from './drawer/DrawerList';
14
- export * from './drawer/DrawerTitle';
15
- export * from './dropdown-button/DropdownButton';
16
- export * from './grid/GridStack';
17
- export * from './grid/InlineGrid';
18
- export * from './info-card/InfoCard';
19
- export * from './info-tooltip/InfoTooltip';
20
- export * from './inline/Inline';
21
- export * from './number-field/NumberField';
22
- export * from './overflow-text/OverflowText';
23
- export * from './props/AlignProps';
24
- export * from './props/CollapseProp';
25
- export * from './props/ResponsiveProp';
26
- export * from './props/SpaceProp';
27
- export * from './radio/RadioField';
28
- export * from './radio/RadioGroupField';
29
- export * from './responsive/CollapseBreakpoint';
30
- export * from './responsive/MinBreakpoint';
31
- export * from './responsive/ResponsiveContext';
32
- export * from './snackbar/Snackbar';
33
- export * from './snackbar/SnackbarContent';
34
- export * from './snackbar/SnackbarStack';
35
- export * from './stack/Stack';
36
- export * from './tag/Tag';
37
- export * from './theme/Color';
38
- export * from './theme/SuperDispatchTheme';
39
- export * from './theme/ThemeProvider';
40
- export * from './tiles/Tiles';
41
- export * from './utils/ExitTransitionPlaceholder';
42
- export * from './utils/isEmptyReactNode';
43
- export * from './utils/mergeRefs';
44
- export * from './utils/renderChildren';
45
- export * from './utils/ResizeObserver';
46
- export * from './utils/useUID';
47
- export * from './utils/VisibilityObserver';
@@ -1,29 +0,0 @@
1
- import { Typography } from '@material-ui/core';
2
- import { Meta } from '@storybook/react';
3
- import { Button } from '../button/Button';
4
- import { Stack } from '../stack/Stack';
5
- import { InfoCard } from './InfoCard';
6
-
7
- export default { title: 'Surfaces/InfoCard', component: InfoCard } as Meta;
8
-
9
- export const basic = () => (
10
- <InfoCard>
11
- <Stack space="small">
12
- <Typography variant="h3">Title</Typography>
13
- <Typography>Content</Typography>
14
-
15
- <Button>Button</Button>
16
- </Stack>
17
- </InfoCard>
18
- );
19
-
20
- export const large = () => (
21
- <InfoCard size="large">
22
- <Stack space="small">
23
- <Typography variant="h3">Title</Typography>
24
- <Typography>Content</Typography>
25
-
26
- <Button>Button</Button>
27
- </Stack>
28
- </InfoCard>
29
- );
@@ -1,95 +0,0 @@
1
- import {
2
- Card,
3
- CardClassKey,
4
- CardContent,
5
- CardContentProps,
6
- CardProps,
7
- } from '@material-ui/core';
8
- import { CSSProperties, makeStyles } from '@material-ui/styles';
9
- import clsx from 'clsx';
10
- import { forwardRef, ForwardRefExoticComponent, useState } from 'react';
11
- import { SuperDispatchTheme } from '../theme/SuperDispatchTheme';
12
- import { assignRef } from '../utils/mergeRefs';
13
-
14
- export type InfoCardClassKey =
15
- | 'sizeLarge'
16
- | 'content'
17
- | 'fullWidth'
18
- | CardClassKey;
19
-
20
- const useStyles = makeStyles(
21
- (theme: SuperDispatchTheme): Record<InfoCardClassKey, CSSProperties> => ({
22
- root: {
23
- '&$fullWidth': {
24
- borderRadius: 0,
25
- borderLeftWidth: 0,
26
- borderRightWidth: 0,
27
- },
28
- },
29
- fullWidth: {},
30
- sizeLarge: {},
31
- content: {
32
- padding: theme.spacing(2),
33
-
34
- '$sizeLarge > &': {
35
- [theme.breakpoints.up('sm')]: {
36
- padding: theme.spacing(3),
37
- },
38
- },
39
- },
40
- }),
41
- { name: 'SD-InfoCard' },
42
- );
43
-
44
- export interface InfoCardProps extends CardProps {
45
- size?: 'medium' | 'large';
46
- CardContentProps?: CardContentProps;
47
- }
48
-
49
- export const InfoCard: ForwardRefExoticComponent<InfoCardProps> = forwardRef(
50
- (
51
- {
52
- size,
53
- square,
54
- classes,
55
- children,
56
- className,
57
- CardContentProps: cardContentProps = {},
58
- ...props
59
- },
60
- ref,
61
- ) => {
62
- const {
63
- content: contentClassName,
64
- sizeLarge: sizeLargeClassName,
65
- fullWidth: fullWidthClassName,
66
- ...styles
67
- } = useStyles({ classes });
68
- const [rootNode, setRootNode] = useState<HTMLElement | null>(null);
69
-
70
- const clientRect = rootNode?.getBoundingClientRect();
71
- const isFullWidth = clientRect?.width === window.innerWidth;
72
-
73
- return (
74
- <Card
75
- {...props}
76
- ref={(node) => {
77
- assignRef(ref, node);
78
- setRootNode(node as HTMLElement);
79
- }}
80
- classes={styles}
81
- className={clsx(className, {
82
- [sizeLargeClassName]: size === 'large',
83
- [fullWidthClassName]: isFullWidth,
84
- })}
85
- >
86
- <CardContent
87
- {...cardContentProps}
88
- className={clsx(cardContentProps.className, contentClassName)}
89
- >
90
- {children}
91
- </CardContent>
92
- </Card>
93
- );
94
- },
95
- );
@@ -1,22 +0,0 @@
1
- import { renderCSS } from '@superdispatch/ui-testutils';
2
- import { InfoCard } from '../..';
3
-
4
- it('checks component css', () => {
5
- expect(renderCSS(<InfoCard />, ['SD-InfoCard'])).toMatchInlineSnapshot(`
6
- .SD-InfoCard-root.SD-InfoCard-fullWidth {
7
- border-radius: 0;
8
- border-left-width: 0;
9
- border-right-width: 0;
10
- }
11
-
12
- .SD-InfoCard-content {
13
- padding: 16px;
14
- }
15
-
16
- @media (min-width: 600px) {
17
- .SD-InfoCard-sizeLarge > .SD-InfoCard-content {
18
- padding: 24px;
19
- }
20
- }
21
- `);
22
- });
@@ -1,77 +0,0 @@
1
- import { Typography } from '@material-ui/core';
2
- import { Meta } from '@storybook/react';
3
- import { Button } from '../button/Button';
4
- import { InfoTooltip } from './InfoTooltip';
5
-
6
- export default {
7
- title: 'Surfaces/InfoTooltip',
8
- component: InfoTooltip,
9
- } as Meta;
10
-
11
- export const basic = () => (
12
- <InfoTooltip
13
- interactive={true}
14
- iconButtonProps={{
15
- 'aria-label': 'aria label info',
16
- }}
17
- title={
18
- <>
19
- <Typography variant="h3">Title</Typography>
20
- <Typography>Content</Typography>
21
- <Button>Button</Button>
22
- </>
23
- }
24
- />
25
- );
26
-
27
- export const withLabel = () => (
28
- <InfoTooltip
29
- interactive={true}
30
- iconButtonProps={{
31
- 'aria-label': 'aria label info',
32
- }}
33
- title={
34
- <>
35
- <Typography variant="h3">Title</Typography>
36
- <Typography>Content</Typography>
37
- <Button>Button</Button>
38
- </>
39
- }
40
- >
41
- <Typography>Label</Typography>
42
- </InfoTooltip>
43
- );
44
-
45
- export const medium = () => (
46
- <InfoTooltip
47
- interactive={false}
48
- fontSize="medium"
49
- iconButtonProps={{
50
- 'aria-label': 'aria label info',
51
- }}
52
- title={
53
- <>
54
- <Typography variant="h3">Title</Typography>
55
- <Typography>Non-Interactive Content</Typography>
56
- <Button>Button</Button>
57
- </>
58
- }
59
- />
60
- );
61
-
62
- export const large = () => (
63
- <InfoTooltip
64
- interactive={false}
65
- fontSize="large"
66
- iconButtonProps={{
67
- 'aria-label': 'aria label info',
68
- }}
69
- title={
70
- <>
71
- <Typography variant="h3">Title</Typography>
72
- <Typography>Non-Interactive Content</Typography>
73
- <Button>Button</Button>
74
- </>
75
- }
76
- />
77
- );
@@ -1,72 +0,0 @@
1
- import {
2
- IconButton,
3
- IconButtonProps,
4
- Tooltip,
5
- TooltipProps,
6
- Typography,
7
- TypographyProps,
8
- } from '@material-ui/core';
9
- import { Info } from '@material-ui/icons';
10
- import { forwardRef, ForwardRefExoticComponent, ReactNode } from 'react';
11
- import styled from 'styled-components';
12
-
13
- interface InfoTooltipProps extends Omit<TooltipProps, 'title' | 'children'> {
14
- title: NonNullable<ReactNode>;
15
- children?: ReactNode;
16
- iconButtonProps?: IconButtonProps;
17
- fontSize?: 'inherit' | 'default' | 'small' | 'medium' | 'large' | undefined;
18
- TextProps?: TypographyProps;
19
- isOpen?: boolean;
20
- onClose?: () => void;
21
- onClick?: () => void;
22
- }
23
-
24
- const Root = styled.div`
25
- display: flex;
26
- align-items: center;
27
- `;
28
-
29
- export const InfoTooltip: ForwardRefExoticComponent<InfoTooltipProps> =
30
- forwardRef(
31
- (
32
- {
33
- children,
34
- iconButtonProps,
35
- fontSize = 'small',
36
- TextProps,
37
- title,
38
- isOpen,
39
- onClick,
40
- onClose,
41
- ...props
42
- },
43
- ref,
44
- ) => {
45
- const tooltip = (
46
- <Tooltip
47
- open={isOpen}
48
- title={title}
49
- placement="top"
50
- onClose={onClose}
51
- disableFocusListener={true}
52
- disableTouchListener={true}
53
- onClick={onClick}
54
- ref={ref}
55
- {...props}
56
- >
57
- <IconButton {...iconButtonProps} size="small" onMouseOver={onClick}>
58
- <Info color="action" fontSize={fontSize} />
59
- </IconButton>
60
- </Tooltip>
61
- );
62
-
63
- if (!children) return tooltip;
64
-
65
- return (
66
- <Root>
67
- <Typography {...TextProps}>{children}</Typography>
68
- {tooltip}
69
- </Root>
70
- );
71
- },
72
- );
@@ -1,166 +0,0 @@
1
- import { renderCSS } from '@superdispatch/ui-testutils';
2
- import { InfoTooltip } from '../..';
3
-
4
- it('checks component css InfoTooltip', () => {
5
- expect(renderCSS(<InfoTooltip title={<span />} />, ['MuiTooltip']))
6
- .toMatchInlineSnapshot(`
7
- .MuiTooltip-popper {
8
- z-index: 1500;
9
- pointer-events: none;
10
- }
11
-
12
- .MuiTooltip-popperInteractive {
13
- pointer-events: auto;
14
- }
15
-
16
- .MuiTooltip-popperArrow[x-placement*='bottom'] .MuiTooltip-arrow {
17
- top: 0;
18
- left: 0;
19
- margin-top: -0.71em;
20
- margin-left: 4px;
21
- margin-right: 4px;
22
- }
23
-
24
- .MuiTooltip-popperArrow[x-placement*='top'] .MuiTooltip-arrow {
25
- left: 0;
26
- bottom: 0;
27
- margin-left: 4px;
28
- margin-right: 4px;
29
- margin-bottom: -0.71em;
30
- }
31
-
32
- .MuiTooltip-popperArrow[x-placement*='right'] .MuiTooltip-arrow {
33
- left: 0;
34
- width: 0.71em;
35
- height: 1em;
36
- margin-top: 4px;
37
- margin-left: -0.71em;
38
- margin-bottom: 4px;
39
- }
40
-
41
- .MuiTooltip-popperArrow[x-placement*='left'] .MuiTooltip-arrow {
42
- right: 0;
43
- width: 0.71em;
44
- height: 1em;
45
- margin-top: 4px;
46
- margin-right: -0.71em;
47
- margin-bottom: 4px;
48
- }
49
-
50
- .MuiTooltip-popperArrow[x-placement*='left'] .MuiTooltip-arrow::before {
51
- transform-origin: 0 0;
52
- border-top-right-radius: 2px;
53
- }
54
-
55
- .MuiTooltip-popperArrow[x-placement*='right'] .MuiTooltip-arrow::before {
56
- transform-origin: 100% 100%;
57
- border-bottom-left-radius: 2px;
58
- }
59
-
60
- .MuiTooltip-popperArrow[x-placement*='top'] .MuiTooltip-arrow::before {
61
- transform-origin: 100% 0;
62
- border-bottom-right-radius: 2px;
63
- }
64
-
65
- .MuiTooltip-popperArrow[x-placement*='bottom'] .MuiTooltip-arrow::before {
66
- transform-origin: 0 100%;
67
- border-top-left-radius: 2px;
68
- }
69
-
70
- .MuiTooltip-tooltip {
71
- color: Color.White;
72
- padding: 8px 12px;
73
- font-size: 14px;
74
- max-width: 300px;
75
- word-wrap: break-word;
76
- font-family: 'Inter', sans-serif;
77
- font-weight: 400;
78
- line-height: 20px;
79
- border-radius: 4px;
80
- background-color: Color.Dark400;
81
- }
82
-
83
- @media (min-width: 0px) and (max-width: 599.95px) {
84
- .MuiTooltip-tooltip {
85
- font-size: 16px;
86
- line-height: 24px;
87
- }
88
- }
89
-
90
- .MuiTooltip-tooltipArrow {
91
- margin: 0;
92
- position: relative;
93
- }
94
-
95
- .MuiTooltip-arrow {
96
- color: Color.Dark400;
97
- width: 1em;
98
- height: 0.71em;
99
- overflow: hidden;
100
- position: absolute;
101
- font-size: 8px;
102
- box-sizing: border-box;
103
- }
104
-
105
- .MuiTooltip-arrow::before {
106
- width: 100%;
107
- height: 100%;
108
- margin: auto;
109
- content: '';
110
- display: block;
111
- transform: rotate(45deg);
112
- background-color: currentColor;
113
- }
114
-
115
- .MuiTooltip-touch {
116
- padding: 8px 16px;
117
- font-size: 0.875rem;
118
- font-weight: 400;
119
- line-height: 1.14286em;
120
- }
121
-
122
- .MuiTooltip-tooltipPlacementLeft {
123
- margin: 0 24px;
124
- transform-origin: right center;
125
- }
126
-
127
- @media (min-width: 600px) {
128
- .MuiTooltip-tooltipPlacementLeft {
129
- margin: 0 14px;
130
- }
131
- }
132
-
133
- .MuiTooltip-tooltipPlacementRight {
134
- margin: 0 24px;
135
- transform-origin: left center;
136
- }
137
-
138
- @media (min-width: 600px) {
139
- .MuiTooltip-tooltipPlacementRight {
140
- margin: 0 14px;
141
- }
142
- }
143
-
144
- .MuiTooltip-tooltipPlacementTop {
145
- margin: 24px 0;
146
- transform-origin: center bottom;
147
- }
148
-
149
- @media (min-width: 600px) {
150
- .MuiTooltip-tooltipPlacementTop {
151
- margin: 14px 0;
152
- }
153
- }
154
-
155
- .MuiTooltip-tooltipPlacementBottom {
156
- margin: 24px 0;
157
- transform-origin: center top;
158
- }
159
-
160
- @media (min-width: 600px) {
161
- .MuiTooltip-tooltipPlacementBottom {
162
- margin: 14px 0;
163
- }
164
- }
165
- `);
166
- });
@@ -1,135 +0,0 @@
1
- import { Link } from '@material-ui/core';
2
- import { Meta } from '@storybook/react';
3
- import { Empty, Placeholder } from '@superdispatch/ui-docs';
4
- import { Box } from '@superdispatch/ui-lab';
5
- import { Inline } from './Inline';
6
-
7
- export default {
8
- title: 'Layout/Inline',
9
- component: Inline,
10
- decorators: [
11
- (Story) => (
12
- <Box maxWidth="240px">
13
- <Story />
14
- </Box>
15
- ),
16
- ],
17
- parameters: {
18
- componentSubtitle: (
19
- <>
20
- Heavily inspired by the{' '}
21
- <Link href="https://seek-oss.github.io/braid-design-system/components/Inline">
22
- Inline
23
- </Link>{' '}
24
- component from the{' '}
25
- <Link href="https://seek-oss.github.io/braid-design-system">
26
- BRAID Design System
27
- </Link>
28
- .
29
- </>
30
- ),
31
- },
32
- } as Meta;
33
-
34
- export const basic = () => (
35
- <Inline>
36
- <Placeholder width={48} height={48} />
37
- <Placeholder width={48} height={48} />
38
- <Placeholder width={48} height={48} />
39
- <Placeholder width={48} height={48} />
40
- <Placeholder width={48} height={48} />
41
- <Placeholder width={48} height={48} />
42
- <Placeholder width={48} height={48} />
43
- <Placeholder width={48} height={48} />
44
- <Placeholder width={48} height={48} />
45
- <Placeholder width={48} height={48} />
46
- </Inline>
47
- );
48
-
49
- export const emptyElements = () => (
50
- <Inline>
51
- <Empty />
52
- <Placeholder width={48} height={48} />
53
- <Empty />
54
- <Placeholder width={48} height={48} />
55
- <Empty />
56
- <Placeholder width={48} height={48} />
57
- <Empty />
58
- <Placeholder width={48} height={48} />
59
- <Empty />
60
- <Placeholder width={48} height={48} />
61
- </Inline>
62
- );
63
-
64
- export const responsiveSpace = () => (
65
- <Inline space={['xsmall', 'small']}>
66
- <Placeholder width={48} height={48} />
67
- <Placeholder width={48} height={48} />
68
- <Placeholder width={48} height={48} />
69
- <Placeholder width={48} height={48} />
70
- <Placeholder width={48} height={48} />
71
- <Placeholder width={48} height={48} />
72
- <Placeholder width={48} height={48} />
73
- <Placeholder width={48} height={48} />
74
- <Placeholder width={48} height={48} />
75
- <Placeholder width={48} height={48} />
76
- </Inline>
77
- );
78
-
79
- export const horizontalAlignment = () => (
80
- <Inline horizontalAlign="center">
81
- <Placeholder width={48} height={48} />
82
- <Placeholder width={48} height={48} />
83
- <Placeholder width={48} height={48} />
84
- <Placeholder width={48} height={48} />
85
- <Placeholder width={48} height={48} />
86
- <Placeholder width={48} height={48} />
87
- <Placeholder width={48} height={48} />
88
- <Placeholder width={48} height={48} />
89
- <Placeholder width={48} height={48} />
90
- <Placeholder width={48} height={48} />
91
- </Inline>
92
- );
93
-
94
- export const responsiveHorizontalAlignment = () => (
95
- <Inline horizontalAlign={['center', 'left']}>
96
- <Placeholder width={48} height={48} />
97
- <Placeholder width={48} height={48} />
98
- <Placeholder width={48} height={48} />
99
- <Placeholder width={48} height={48} />
100
- <Placeholder width={48} height={48} />
101
- <Placeholder width={48} height={48} />
102
- <Placeholder width={48} height={48} />
103
- <Placeholder width={48} height={48} />
104
- <Placeholder width={48} height={48} />
105
- <Placeholder width={48} height={48} />
106
- </Inline>
107
- );
108
-
109
- export const verticalAlignment = () => (
110
- <Inline verticalAlign="center">
111
- <Placeholder width={48} height={48} />
112
- <Placeholder width={48} height={64} />
113
- <Placeholder width={48} height={24} />
114
- </Inline>
115
- );
116
-
117
- export const responsiveVerticalAlignment = () => (
118
- <Inline verticalAlign={['center', 'bottom']}>
119
- <Placeholder width={48} height={48} />
120
- <Placeholder width={48} height={64} />
121
- <Placeholder width={48} height={24} />
122
- </Inline>
123
- );
124
-
125
- export const noWrap = () => (
126
- <Box maxWidth="240px" overflow="hidden">
127
- <Inline noWrap={true}>
128
- <Placeholder width={48} height={48} />
129
- <Placeholder width={48} height={48} />
130
- <Placeholder width={48} height={48} />
131
- <Placeholder width={48} height={48} />
132
- <Placeholder width={48} height={48} />
133
- </Inline>
134
- </Box>
135
- );