@atlaskit/media-card 77.11.3 → 77.12.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 (93) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/card/card.js +5 -5
  3. package/dist/cjs/card/cardView.js +6 -10
  4. package/dist/cjs/card/inlinePlayerWrapperStyles.js +1 -1
  5. package/dist/cjs/card/media-card-analytics-error-boundary.js +1 -1
  6. package/dist/cjs/card/ui/styles.js +1 -12
  7. package/dist/cjs/card/ui/wrapper/imageContainer.js +52 -0
  8. package/dist/cjs/card/ui/wrapper/index.js +8 -1
  9. package/dist/cjs/card/ui/wrapper/styles.js +1 -1
  10. package/dist/cjs/card/v2/cardV2.js +1 -1
  11. package/dist/cjs/card/v2/cardViewV2.js +12 -17
  12. package/dist/cjs/card/v2/cardviews/cardViewWrapper.js +5 -9
  13. package/dist/cjs/card/v2/fileCard.js +66 -20
  14. package/dist/cjs/card/v2/svgView/helpers.js +16 -0
  15. package/dist/cjs/card/v2/svgView/index.js +12 -0
  16. package/dist/cjs/card/v2/svgView/svgView.js +134 -0
  17. package/dist/cjs/inline/loader.js +1 -1
  18. package/dist/cjs/inline/mediaInlineAnalyticsErrorBoundary.js +11 -11
  19. package/dist/cjs/utils/ufoExperiences.js +1 -1
  20. package/dist/es2019/card/card.js +5 -5
  21. package/dist/es2019/card/cardView.js +8 -12
  22. package/dist/es2019/card/inlinePlayerWrapperStyles.js +12 -12
  23. package/dist/es2019/card/media-card-analytics-error-boundary.js +1 -1
  24. package/dist/es2019/card/ui/styles.js +0 -11
  25. package/dist/es2019/card/ui/wrapper/imageContainer.js +44 -0
  26. package/dist/es2019/card/ui/wrapper/index.js +2 -1
  27. package/dist/es2019/card/ui/wrapper/styles.js +21 -21
  28. package/dist/es2019/card/v2/cardV2.js +1 -1
  29. package/dist/es2019/card/v2/cardViewV2.js +13 -18
  30. package/dist/es2019/card/v2/cardviews/cardViewWrapper.js +6 -10
  31. package/dist/es2019/card/v2/fileCard.js +51 -8
  32. package/dist/es2019/card/v2/svgView/helpers.js +12 -0
  33. package/dist/es2019/card/v2/svgView/index.js +1 -0
  34. package/dist/es2019/card/v2/svgView/svgView.js +113 -0
  35. package/dist/es2019/inline/loader.js +1 -1
  36. package/dist/es2019/inline/mediaInlineAnalyticsErrorBoundary.js +11 -11
  37. package/dist/es2019/utils/ufoExperiences.js +1 -1
  38. package/dist/esm/card/card.js +5 -5
  39. package/dist/esm/card/cardView.js +8 -12
  40. package/dist/esm/card/inlinePlayerWrapperStyles.js +1 -1
  41. package/dist/esm/card/media-card-analytics-error-boundary.js +1 -1
  42. package/dist/esm/card/ui/styles.js +0 -11
  43. package/dist/esm/card/ui/wrapper/imageContainer.js +45 -0
  44. package/dist/esm/card/ui/wrapper/index.js +2 -1
  45. package/dist/esm/card/ui/wrapper/styles.js +1 -1
  46. package/dist/esm/card/v2/cardV2.js +1 -1
  47. package/dist/esm/card/v2/cardViewV2.js +13 -18
  48. package/dist/esm/card/v2/cardviews/cardViewWrapper.js +6 -10
  49. package/dist/esm/card/v2/fileCard.js +66 -20
  50. package/dist/esm/card/v2/svgView/helpers.js +10 -0
  51. package/dist/esm/card/v2/svgView/index.js +1 -0
  52. package/dist/esm/card/v2/svgView/svgView.js +123 -0
  53. package/dist/esm/inline/loader.js +1 -1
  54. package/dist/esm/inline/mediaInlineAnalyticsErrorBoundary.js +11 -11
  55. package/dist/esm/utils/ufoExperiences.js +1 -1
  56. package/dist/types/card/ui/iconWrapper/styles.d.ts +1 -1
  57. package/dist/types/card/ui/styles.d.ts +0 -1
  58. package/dist/types/card/ui/titleBox/styles.d.ts +1 -1
  59. package/dist/types/card/ui/wrapper/imageContainer.d.ts +15 -0
  60. package/dist/types/card/ui/wrapper/index.d.ts +1 -0
  61. package/dist/types/card/v2/svgView/helpers.d.ts +3 -0
  62. package/dist/types/card/v2/svgView/index.d.ts +1 -0
  63. package/dist/types/card/v2/svgView/svgView.d.ts +31 -0
  64. package/dist/types/utils/preventClickThrough.d.ts +1 -1
  65. package/dist/types/utils/viewportDetector.d.ts +1 -1
  66. package/dist/types-ts4.5/card/ui/iconWrapper/styles.d.ts +1 -1
  67. package/dist/types-ts4.5/card/ui/styles.d.ts +0 -1
  68. package/dist/types-ts4.5/card/ui/titleBox/styles.d.ts +1 -1
  69. package/dist/types-ts4.5/card/ui/wrapper/imageContainer.d.ts +15 -0
  70. package/dist/types-ts4.5/card/ui/wrapper/index.d.ts +1 -0
  71. package/dist/types-ts4.5/card/v2/svgView/helpers.d.ts +3 -0
  72. package/dist/types-ts4.5/card/v2/svgView/index.d.ts +1 -0
  73. package/dist/types-ts4.5/card/v2/svgView/svgView.d.ts +31 -0
  74. package/dist/types-ts4.5/utils/preventClickThrough.d.ts +1 -1
  75. package/dist/types-ts4.5/utils/viewportDetector.d.ts +1 -1
  76. package/example-helpers/DelayedRender.tsx +19 -19
  77. package/example-helpers/cardViewWrapper.tsx +18 -22
  78. package/example-helpers/cards.tsx +268 -331
  79. package/example-helpers/developmentUseMessage.tsx +8 -9
  80. package/example-helpers/index.tsx +100 -124
  81. package/example-helpers/selectableCard.tsx +32 -35
  82. package/example-helpers/ssrHelpers.tsx +19 -29
  83. package/example-helpers/styles.ts +73 -73
  84. package/example-helpers/svg-helpers/cardContainer.tsx +24 -0
  85. package/example-helpers/svg-helpers/controls.tsx +21 -0
  86. package/example-helpers/svg-helpers/delayApiResponses.ts +31 -0
  87. package/example-helpers/svg-helpers/dimensionPicker.tsx +116 -0
  88. package/example-helpers/svg-helpers/index.ts +7 -0
  89. package/example-helpers/svg-helpers/svgContainer.tsx +32 -0
  90. package/example-helpers/svg-helpers/toggle.tsx +42 -0
  91. package/example-helpers/svg-helpers/uploader.ts +44 -0
  92. package/package.json +13 -5
  93. package/report.api.md +227 -232
@@ -2,14 +2,13 @@ import React from 'react';
2
2
  import InlineMessage from '@atlaskit/inline-message';
3
3
 
4
4
  const DevelopmentUseMessage: React.FC = () => (
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
6
- <div style={{ textAlign: 'center' }}>
7
- <InlineMessage appearance="warning" title="Development use only">
8
- The purpose of this example is to explore on edge cases for this
9
- component's feature. Some ways of using the component in here might not be
10
- the standard way. It is discouraged to use this code as a base for
11
- consumers.
12
- </InlineMessage>
13
- </div>
5
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
6
+ <div style={{ textAlign: 'center' }}>
7
+ <InlineMessage appearance="warning" title="Development use only">
8
+ The purpose of this example is to explore on edge cases for this component's feature. Some
9
+ ways of using the component in here might not be the standard way. It is discouraged to use
10
+ this code as a base for consumers.
11
+ </InlineMessage>
12
+ </div>
14
13
  );
15
14
  export default DevelopmentUseMessage;
@@ -3,16 +3,14 @@
3
3
  import React, { type PropsWithChildren } from 'react';
4
4
  import { type FileItem, type Identifier } from '@atlaskit/media-client';
5
5
  import {
6
- createPollingMaxAttemptsError,
7
- createRateLimitedError,
8
- createStorybookMediaClientConfig,
9
- enableMediaUfoLogger,
10
- FeatureFlagsWrapper,
6
+ createPollingMaxAttemptsError,
7
+ createRateLimitedError,
8
+ createStorybookMediaClientConfig,
9
+ enableMediaUfoLogger,
10
+ FeatureFlagsWrapper,
11
11
  } from '@atlaskit/media-test-helpers';
12
12
  import CrossIcon from '@atlaskit/icon/glyph/cross';
13
- import FabricAnalyticsListeners, {
14
- type AnalyticsWebClient,
15
- } from '@atlaskit/analytics-listeners';
13
+ import FabricAnalyticsListeners, { type AnalyticsWebClient } from '@atlaskit/analytics-listeners';
16
14
  import { payloadPublisher } from '@atlassian/ufo';
17
15
 
18
16
  import AnnotateIcon from '@atlaskit/icon/glyph/media-services/annotate';
@@ -24,159 +22,137 @@ import DevelopmentUseMessage from './developmentUseMessage';
24
22
  const mediaClientConfig = createStorybookMediaClientConfig();
25
23
 
26
24
  export const clickHandler = (result: CardEvent) => {
27
- result.event.preventDefault();
28
- console.log('click', result.mediaItemDetails);
25
+ result.event.preventDefault();
26
+ console.log('click', result.mediaItemDetails);
29
27
  };
30
28
 
31
29
  export const mouseEnterHandler = (result: CardEvent) => {
32
- result.event.preventDefault();
33
- console.log('mouseEnter', result.mediaItemDetails);
30
+ result.event.preventDefault();
31
+ console.log('mouseEnter', result.mediaItemDetails);
34
32
  };
35
33
 
36
- export const createApiCards = (
37
- appearance: CardAppearance,
38
- identifier: Identifier,
39
- ) => {
40
- // API methods
41
- const apiCards = [
42
- {
43
- title: 'not selectable',
44
- content: (
45
- <Card
46
- mediaClientConfig={mediaClientConfig}
47
- appearance={appearance}
48
- identifier={identifier}
49
- onClick={clickHandler}
50
- onMouseEnter={mouseEnterHandler}
51
- />
52
- ),
53
- },
54
- ];
55
-
56
- const selectableCard = {
57
- title: 'selectable',
58
- content: (
59
- <SelectableCard
60
- mediaClientConfig={mediaClientConfig}
61
- identifier={identifier}
62
- />
63
- ),
64
- };
65
-
66
- if (appearance === 'image') {
67
- return [...apiCards, selectableCard];
68
- }
69
-
70
- return apiCards;
34
+ export const createApiCards = (appearance: CardAppearance, identifier: Identifier) => {
35
+ // API methods
36
+ const apiCards = [
37
+ {
38
+ title: 'not selectable',
39
+ content: (
40
+ <Card
41
+ mediaClientConfig={mediaClientConfig}
42
+ appearance={appearance}
43
+ identifier={identifier}
44
+ onClick={clickHandler}
45
+ onMouseEnter={mouseEnterHandler}
46
+ />
47
+ ),
48
+ },
49
+ ];
50
+
51
+ const selectableCard = {
52
+ title: 'selectable',
53
+ content: <SelectableCard mediaClientConfig={mediaClientConfig} identifier={identifier} />,
54
+ };
55
+
56
+ if (appearance === 'image') {
57
+ return [...apiCards, selectableCard];
58
+ }
59
+
60
+ return apiCards;
71
61
  };
72
62
 
73
63
  export const openAction = {
74
- label: 'Open',
75
- handler: () => {
76
- console.log('open');
77
- },
64
+ label: 'Open',
65
+ handler: () => {
66
+ console.log('open');
67
+ },
78
68
  };
79
69
  export const closeAction = {
80
- label: 'Close',
81
- handler: () => {
82
- console.log('close');
83
- },
70
+ label: 'Close',
71
+ handler: () => {
72
+ console.log('close');
73
+ },
84
74
  };
85
75
  export const deleteAction = {
86
- label: 'Delete',
87
- handler: () => {
88
- console.log('delete');
89
- },
90
- icon: <CrossIcon size="small" label="delete" />,
76
+ label: 'Delete',
77
+ handler: () => {
78
+ console.log('delete');
79
+ },
80
+ icon: <CrossIcon size="small" label="delete" />,
91
81
  };
92
82
 
93
83
  export const annotateCardAction: CardAction = {
94
- label: 'Annotate',
95
- handler: () => {
96
- console.log('annotate');
97
- },
98
- icon: <AnnotateIcon size="small" label="annotate" />,
84
+ label: 'Annotate',
85
+ handler: () => {
86
+ console.log('annotate');
87
+ },
88
+ icon: <AnnotateIcon size="small" label="annotate" />,
99
89
  };
100
90
 
101
- export const actions = [
102
- openAction,
103
- closeAction,
104
- annotateCardAction,
105
- deleteAction,
106
- ];
91
+ export const actions = [openAction, closeAction, annotateCardAction, deleteAction];
107
92
 
108
93
  export const anotherAction: CardAction = {
109
- label: 'Some other action',
110
- handler: (item?: FileItem) => {
111
- console.log('Some other action', item);
112
- },
94
+ label: 'Some other action',
95
+ handler: (item?: FileItem) => {
96
+ console.log('Some other action', item);
97
+ },
113
98
  };
114
99
 
115
100
  export const annotateAction: CardAction = {
116
- label: 'Annotate',
117
- handler: (item?: FileItem) => {
118
- console.log('annotate', item);
119
- },
101
+ label: 'Annotate',
102
+ handler: (item?: FileItem) => {
103
+ console.log('annotate', item);
104
+ },
120
105
  };
121
106
 
122
107
  export const cardsActions = [anotherAction, annotateAction];
123
108
  export const wrongMediaClientConfig = createStorybookMediaClientConfig({
124
- authType: 'client',
109
+ authType: 'client',
125
110
  });
126
111
  export const wrongCollection = 'adfasdf';
127
112
 
128
113
  export type MainWrapperProps = PropsWithChildren<{
129
- developmentOnly?: boolean;
130
- disableFeatureFlagWrapper?: boolean;
114
+ developmentOnly?: boolean;
115
+ disableFeatureFlagWrapper?: boolean;
131
116
  }>;
132
117
 
133
118
  export const MainWrapper = ({
134
- children,
135
- developmentOnly,
136
- disableFeatureFlagWrapper = false,
119
+ children,
120
+ developmentOnly,
121
+ disableFeatureFlagWrapper = false,
137
122
  }: MainWrapperProps) => {
138
- enableMediaUfoLogger(payloadPublisher);
139
- return (
140
- <>
141
- {developmentOnly && <DevelopmentUseMessage />}
142
- {!disableFeatureFlagWrapper ? (
143
- <FeatureFlagsWrapper>{children}</FeatureFlagsWrapper>
144
- ) : (
145
- <>{children}</>
146
- )}
147
- </>
148
- );
123
+ enableMediaUfoLogger(payloadPublisher);
124
+ return (
125
+ <>
126
+ {developmentOnly && <DevelopmentUseMessage />}
127
+ {!disableFeatureFlagWrapper ? (
128
+ <FeatureFlagsWrapper>{children}</FeatureFlagsWrapper>
129
+ ) : (
130
+ <>{children}</>
131
+ )}
132
+ </>
133
+ );
149
134
  };
150
135
 
151
- export const mediaCardErrorState = (
152
- error?: string,
153
- ): MediaCardError | undefined => {
154
- switch (error) {
155
- case 'rateLimitedError':
156
- return new MediaCardError('error-file-state', createRateLimitedError());
157
- case 'pollingMaxAttemptsError':
158
- return new MediaCardError(
159
- 'error-file-state',
160
- createPollingMaxAttemptsError(),
161
- );
162
- case 'uploadError':
163
- return new MediaCardError('upload');
164
- default:
165
- return undefined;
166
- }
136
+ export const mediaCardErrorState = (error?: string): MediaCardError | undefined => {
137
+ switch (error) {
138
+ case 'rateLimitedError':
139
+ return new MediaCardError('error-file-state', createRateLimitedError());
140
+ case 'pollingMaxAttemptsError':
141
+ return new MediaCardError('error-file-state', createPollingMaxAttemptsError());
142
+ case 'uploadError':
143
+ return new MediaCardError('upload');
144
+ default:
145
+ return undefined;
146
+ }
167
147
  };
168
148
 
169
149
  export const SSRAnalyticsWrapper = ({ children }: PropsWithChildren<{}>) => {
170
- const mockClient: AnalyticsWebClient = {
171
- sendUIEvent: (e) => console.debug('UI event', e),
172
- sendOperationalEvent: (e) => console.debug('Operational event', e),
173
- sendTrackEvent: (e) => console.debug('Track event', e),
174
- sendScreenEvent: (e) => console.debug('Screen event', e),
175
- };
176
-
177
- return (
178
- <FabricAnalyticsListeners client={mockClient}>
179
- {children}
180
- </FabricAnalyticsListeners>
181
- );
150
+ const mockClient: AnalyticsWebClient = {
151
+ sendUIEvent: (e) => console.debug('UI event', e),
152
+ sendOperationalEvent: (e) => console.debug('Operational event', e),
153
+ sendTrackEvent: (e) => console.debug('Track event', e),
154
+ sendScreenEvent: (e) => console.debug('Screen event', e),
155
+ };
156
+
157
+ return <FabricAnalyticsListeners client={mockClient}>{children}</FabricAnalyticsListeners>;
182
158
  };
@@ -5,45 +5,42 @@ import { type Identifier } from '@atlaskit/media-client';
5
5
  import { Card } from '../src';
6
6
 
7
7
  export interface SelectableCardProps {
8
- mediaClientConfig: MediaClientConfig;
9
- identifier: Identifier;
8
+ mediaClientConfig: MediaClientConfig;
9
+ identifier: Identifier;
10
10
  }
11
11
 
12
- export class SelectableCard extends Component<
13
- SelectableCardProps,
14
- { selected: boolean }
15
- > {
16
- constructor(props: SelectableCardProps) {
17
- super(props);
18
- this.state = { selected: false };
19
- }
12
+ export class SelectableCard extends Component<SelectableCardProps, { selected: boolean }> {
13
+ constructor(props: SelectableCardProps) {
14
+ super(props);
15
+ this.state = { selected: false };
16
+ }
20
17
 
21
- render() {
22
- const { mediaClientConfig, identifier } = this.props;
23
- const { selected } = this.state;
18
+ render() {
19
+ const { mediaClientConfig, identifier } = this.props;
20
+ const { selected } = this.state;
24
21
 
25
- if (!mediaClientConfig) {
26
- return null;
27
- }
22
+ if (!mediaClientConfig) {
23
+ return null;
24
+ }
28
25
 
29
- return (
30
- <Card
31
- mediaClientConfig={mediaClientConfig}
32
- identifier={identifier}
33
- appearance="image"
34
- selectable={true}
35
- selected={selected}
36
- onClick={this.onClick}
37
- actions={[{ label: 'add', handler: () => {} }]}
38
- />
39
- );
40
- }
26
+ return (
27
+ <Card
28
+ mediaClientConfig={mediaClientConfig}
29
+ identifier={identifier}
30
+ appearance="image"
31
+ selectable={true}
32
+ selected={selected}
33
+ onClick={this.onClick}
34
+ actions={[{ label: 'add', handler: () => {} }]}
35
+ />
36
+ );
37
+ }
41
38
 
42
- private onClick = (): void => {
43
- this.setState((prevState) => {
44
- return {
45
- selected: !prevState.selected,
46
- };
47
- });
48
- };
39
+ private onClick = (): void => {
40
+ this.setState((prevState) => {
41
+ return {
42
+ selected: !prevState.selected,
43
+ };
44
+ });
45
+ };
49
46
  }
@@ -4,40 +4,30 @@ import ReactDOMServer from 'react-dom/server';
4
4
  import { SSRAnalyticsWrapper } from '.';
5
5
 
6
6
  export interface SimulateSsrParams
7
- extends React.DetailedHTMLProps<
8
- React.HTMLAttributes<HTMLDivElement>,
9
- HTMLDivElement
10
- > {
11
- serverPage: React.ReactNode;
12
- hydratePage?: React.ReactNode;
7
+ extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
8
+ serverPage: React.ReactNode;
9
+ hydratePage?: React.ReactNode;
13
10
  }
14
11
 
15
12
  const randomStr = () => Math.random().toString(36).substr(2, 9);
16
13
  const generateSsrPageId = () => `media-ssr-page-${randomStr()}-${randomStr()}`;
17
14
 
18
- export const SimulateSsr = ({
19
- serverPage,
20
- hydratePage,
21
- ...divProps
22
- }: SimulateSsrParams) => {
23
- const id = useMemo(generateSsrPageId, []);
15
+ export const SimulateSsr = ({ serverPage, hydratePage, ...divProps }: SimulateSsrParams) => {
16
+ const id = useMemo(generateSsrPageId, []);
24
17
 
25
- useEffect(() => {
26
- const txt = ReactDOMServer.renderToString(
27
- <SSRAnalyticsWrapper>{serverPage}</SSRAnalyticsWrapper>,
28
- );
29
- const elem = document.querySelector(`#${id}`);
30
- if (elem) {
31
- elem.innerHTML = txt;
32
- if (hydratePage) {
33
- ReactDOM.hydrate(
34
- <SSRAnalyticsWrapper>{hydratePage}</SSRAnalyticsWrapper>,
35
- elem,
36
- );
37
- }
38
- }
39
- }, [id, hydratePage, serverPage]);
18
+ useEffect(() => {
19
+ const txt = ReactDOMServer.renderToString(
20
+ <SSRAnalyticsWrapper>{serverPage}</SSRAnalyticsWrapper>,
21
+ );
22
+ const elem = document.querySelector(`#${id}`);
23
+ if (elem) {
24
+ elem.innerHTML = txt;
25
+ if (hydratePage) {
26
+ ReactDOM.hydrate(<SSRAnalyticsWrapper>{hydratePage}</SSRAnalyticsWrapper>, elem);
27
+ }
28
+ }
29
+ }, [id, hydratePage, serverPage]);
40
30
 
41
- // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
42
- return <div id={id} {...divProps}></div>;
31
+ // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
32
+ return <div id={id} {...divProps}></div>;
43
33
  };
@@ -2,121 +2,121 @@ import { token } from '@atlaskit/tokens';
2
2
  import { css } from '@emotion/react';
3
3
 
4
4
  export const editableCardOptionsStyles = css({
5
- padding: token('space.250', '20px'),
6
- borderBottom: `1px solid ${token('color.border', '#ccc')}`,
7
- maxWidth: '700px',
5
+ padding: token('space.250', '20px'),
6
+ borderBottom: `1px solid ${token('color.border', '#ccc')}`,
7
+ maxWidth: '700px',
8
8
  });
9
9
 
10
10
  export const sliderWrapperStyles = css({
11
- display: 'flex',
12
- width: '50%',
13
- '> *': {
14
- flex: 1,
15
- margin: token('space.100', '8px'),
16
- },
11
+ display: 'flex',
12
+ width: '50%',
13
+ '> *': {
14
+ flex: 1,
15
+ margin: token('space.100', '8px'),
16
+ },
17
17
  });
18
18
 
19
19
  export const editableCardContentStyles = css({
20
- padding: token('space.250', '20px'),
21
- border: '2px dashed',
22
- margin: `${token('space.0', '0px')} ${token('space.150', '12px')} ${token(
23
- 'space.600',
24
- '48px',
25
- )} ${token('space.150', '12px')}`,
26
- overflow: 'hidden',
27
- background: token('color.background.accent.orange.subtlest', 'antiquewhite'),
28
- boxSizing: 'border-box',
20
+ padding: token('space.250', '20px'),
21
+ border: '2px dashed',
22
+ margin: `${token('space.0', '0px')} ${token('space.150', '12px')} ${token(
23
+ 'space.600',
24
+ '48px',
25
+ )} ${token('space.150', '12px')}`,
26
+ overflow: 'hidden',
27
+ background: token('color.background.accent.orange.subtlest', 'antiquewhite'),
28
+ boxSizing: 'border-box',
29
29
  });
30
30
 
31
31
  export const optionsWrapperStyles = css({
32
- display: 'flex',
33
- '> *': {
34
- flex: 1,
35
- margin: token('space.100', '8px'),
36
- },
32
+ display: 'flex',
33
+ '> *': {
34
+ flex: 1,
35
+ margin: token('space.100', '8px'),
36
+ },
37
37
  });
38
38
 
39
39
  export const cardDimensionsWrapperStyles = css({
40
- margin: `${token('space.100', '8px')} ${token('space.100', '8px')} ${token(
41
- 'space.250',
42
- '20px',
43
- )} ${token('space.100', '8px')}`,
44
- display: 'flex',
45
- '> div': {
46
- border: `1px solid ${token('color.border.bold', 'black')}`,
47
- margin: token('space.075', '6px'),
48
- padding: token('space.075', '6px'),
49
- borderRadius: '3px',
50
- },
40
+ margin: `${token('space.100', '8px')} ${token('space.100', '8px')} ${token(
41
+ 'space.250',
42
+ '20px',
43
+ )} ${token('space.100', '8px')}`,
44
+ display: 'flex',
45
+ '> div': {
46
+ border: `1px solid ${token('color.border.bold', 'black')}`,
47
+ margin: token('space.075', '6px'),
48
+ padding: token('space.075', '6px'),
49
+ borderRadius: '3px',
50
+ },
51
51
  });
52
52
 
53
53
  export const flexWrapperStyles = css({
54
- display: 'flex',
54
+ display: 'flex',
55
55
  });
56
56
  export const cardPreviewWrapperStyles = css({
57
- flex: 1,
57
+ flex: 1,
58
58
  });
59
59
 
60
60
  export const cardWrapperStyles = css({
61
- border: `1px solid ${token('color.border.bold', 'black')}`,
62
- padding: token('space.150', '12px'),
63
- margin: token('space.075', '6px'),
64
- flexDirection: 'column',
65
- width: '310px',
66
- height: '280px',
67
- overflow: 'auto',
68
- display: 'inline-block',
61
+ border: `1px solid ${token('color.border.bold', 'black')}`,
62
+ padding: token('space.150', '12px'),
63
+ margin: token('space.075', '6px'),
64
+ flexDirection: 'column',
65
+ width: '310px',
66
+ height: '280px',
67
+ overflow: 'auto',
68
+ display: 'inline-block',
69
69
  });
70
70
 
71
71
  export const cardFlowHeaderStyles = css({
72
- margin: `${token('space.250', '20px')} auto`,
73
- padding: `${token('space.150', '12px')} ${token('space.0', '0px')}`,
72
+ margin: `${token('space.250', '20px')} auto`,
73
+ padding: `${token('space.150', '12px')} ${token('space.0', '0px')}`,
74
74
  });
75
75
 
76
76
  export const externalIdentifierWrapperStyles = css({
77
- display: 'flex',
78
- justifyContent: 'space-around',
79
- margin: `${token('space.0', '0px')} auto`,
80
- h2: {
81
- marginBottom: token('space.150', '12px'),
82
- },
77
+ display: 'flex',
78
+ justifyContent: 'space-around',
79
+ margin: `${token('space.0', '0px')} auto`,
80
+ h2: {
81
+ marginBottom: token('space.150', '12px'),
82
+ },
83
83
  });
84
84
 
85
85
  export const unhandledErrorCardWrapperStyles = css({
86
- padding: token('space.250', '20px'),
87
- '> div:first-child': {
88
- display: 'flex',
89
- marginBottom: token('space.250', '20px'),
90
- },
91
- label: {
92
- marginRight: token('space.250', '20px'),
93
- },
86
+ padding: token('space.250', '20px'),
87
+ '> div:first-child': {
88
+ display: 'flex',
89
+ marginBottom: token('space.250', '20px'),
90
+ },
91
+ label: {
92
+ marginRight: token('space.250', '20px'),
93
+ },
94
94
  });
95
95
 
96
96
  export const inlineCardVideoWrapperItemStyles = css({
97
- padding: token('space.150', '12px'),
98
- border: `1px solid ${token('color.border.bold', 'black')}`,
99
- margin: token('space.150', '12px'),
97
+ padding: token('space.150', '12px'),
98
+ border: `1px solid ${token('color.border.bold', 'black')}`,
99
+ margin: token('space.150', '12px'),
100
100
  });
101
101
 
102
102
  export const mediaViewerExampleColumnStyles = css({
103
- flex: 1,
103
+ flex: 1,
104
104
  });
105
105
 
106
106
  export const mediaViewerExampleWrapperStyles = css({
107
- display: 'flex',
107
+ display: 'flex',
108
108
  });
109
109
 
110
110
  export const mediaInlineWrapperStyles = css({
111
- display: 'flex',
112
- alignItems: 'center',
113
- flexDirection: 'column',
114
- margin: token('space.1000', '80px'),
111
+ display: 'flex',
112
+ alignItems: 'center',
113
+ flexDirection: 'column',
114
+ margin: token('space.1000', '80px'),
115
115
  });
116
116
 
117
117
  export const mediaInlineTableStyles = css({
118
- width: '800px',
119
- 'tr, td': {
120
- border: `1px solid ${token('color.border', '#ddd')}`,
121
- },
118
+ width: '800px',
119
+ 'tr, td': {
120
+ border: `1px solid ${token('color.border', '#ddd')}`,
121
+ },
122
122
  });
@@ -0,0 +1,24 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+
4
+ import { jsx } from '@emotion/react';
5
+
6
+ export const CardBox = ({ title, children }: { title: string; children: React.ReactNode }) => (
7
+ <div style={{ marginBottom: '10px' }}>
8
+ <h3 style={{ textAlign: 'center' }}>{title}</h3>
9
+ {children}
10
+ </div>
11
+ );
12
+
13
+ export const CardRow = ({ children }: { children: React.ReactNode }) => (
14
+ <div
15
+ style={{
16
+ display: 'flex',
17
+ flexWrap: 'wrap',
18
+ gap: '10px',
19
+ marginBottom: '10px',
20
+ }}
21
+ >
22
+ {children}
23
+ </div>
24
+ );