@automattic/jetpack-components 0.41.1 → 0.42.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 (107) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/components/boost-score-graph/background.tsx +183 -0
  3. package/components/boost-score-graph/day-highlight-plugin.ts +82 -0
  4. package/components/boost-score-graph/get-date-format.ts +59 -0
  5. package/components/boost-score-graph/index.native.js +1 -0
  6. package/components/boost-score-graph/index.tsx +76 -0
  7. package/components/boost-score-graph/style-tooltip.scss +52 -0
  8. package/components/boost-score-graph/style-uplot.scss +5 -0
  9. package/components/boost-score-graph/style.scss +17 -0
  10. package/components/boost-score-graph/tooltip.tsx +87 -0
  11. package/components/boost-score-graph/tooltips-plugin.ts +98 -0
  12. package/components/boost-score-graph/types/declarations.d.ts +4 -0
  13. package/components/boost-score-graph/uplot-line-chart.tsx +193 -0
  14. package/components/boost-score-graph/use-boost-score-transform.ts +36 -0
  15. package/components/boost-score-graph/use-resize.ts +40 -0
  16. package/components/gridicon/index.tsx +13 -0
  17. package/components/{pricing-slider → number-slider}/index.tsx +12 -12
  18. package/components/{pricing-slider → number-slider}/style.scss +8 -8
  19. package/components/{pricing-slider → number-slider}/types.ts +2 -2
  20. package/components/popover/index.tsx +19 -0
  21. package/components/popover/style.scss +25 -0
  22. package/components/product-price/index.tsx +5 -5
  23. package/components/product-price/style.module.scss +8 -1
  24. package/index.ts +3 -1
  25. package/package.json +6 -3
  26. package/.gitattributes +0 -8
  27. package/components/action-button/stories/index.stories.jsx +0 -38
  28. package/components/action-button/test/component.jsx +0 -16
  29. package/components/action-popover/stories/index.stories.jsx +0 -115
  30. package/components/action-popover/stories/styles.module.scss +0 -7
  31. package/components/admin-page/stories/index.stories.tsx +0 -35
  32. package/components/admin-page/stories/style.module.scss +0 -13
  33. package/components/admin-section/stories/index.stories.tsx +0 -60
  34. package/components/alert/stories/index.stories.jsx +0 -24
  35. package/components/automattic-byline-logo/stories/index.stories.tsx +0 -20
  36. package/components/automattic-byline-logo/test/component.tsx +0 -28
  37. package/components/boost-score-bar/stories/index.stories.tsx +0 -39
  38. package/components/boost-score-bar/test/component.tsx +0 -102
  39. package/components/button/stories/index.mdx +0 -90
  40. package/components/button/stories/index.stories.tsx +0 -400
  41. package/components/button/stories/style.module.scss +0 -20
  42. package/components/contextual-upgrade-trigger/stories/index.stories.tsx +0 -25
  43. package/components/decorative-card/stories/index.stories.tsx +0 -18
  44. package/components/dialog/stories/boost.png +0 -0
  45. package/components/dialog/stories/declaration.d.ts +0 -1
  46. package/components/dialog/stories/index.stories.tsx +0 -118
  47. package/components/dialog/stories/js-components.components.dialog.mdx +0 -62
  48. package/components/dialog/stories/js-components.components.dialog.stories.js +0 -37
  49. package/components/dialog/stories/style.module.scss +0 -21
  50. package/components/donut-meter/stories/index.stories.tsx +0 -51
  51. package/components/donut-meter/test/component.tsx +0 -24
  52. package/components/gridicon/stories/index.stories.tsx +0 -18
  53. package/components/icon-tooltip/stories/index.stories.tsx +0 -108
  54. package/components/icon-tooltip/stories/style.scss +0 -36
  55. package/components/icon-tooltip/test/component.tsx +0 -15
  56. package/components/icons/stories/index.stories.tsx +0 -65
  57. package/components/icons/stories/style.module.scss +0 -33
  58. package/components/indeterminate-progress-bar/stories/index.stories.tsx +0 -14
  59. package/components/jetpack-footer/stories/index.stories.tsx +0 -39
  60. package/components/jetpack-footer/test/__snapshots__/component.tsx.snap +0 -186
  61. package/components/jetpack-footer/test/component.tsx +0 -159
  62. package/components/jetpack-logo/stories/index.stories.tsx +0 -20
  63. package/components/jetpack-logo/test/component.tsx +0 -16
  64. package/components/jetpack-search-logo/stories/index.stories.tsx +0 -21
  65. package/components/jetpack-search-logo/test/component.tsx +0 -16
  66. package/components/jetpack-vaultpress-backup-logo/stories/index.stories.tsx +0 -20
  67. package/components/jetpack-vaultpress-backup-logo/test/component.tsx +0 -18
  68. package/components/jetpack-videopress-logo/stories/index.stories.tsx +0 -20
  69. package/components/jetpack-videopress-logo/test/component.tsx +0 -16
  70. package/components/layout/stories/index.stories.tsx +0 -145
  71. package/components/layout/stories/styles.module.scss +0 -22
  72. package/components/loading-placeholder/stories/index.stories.tsx +0 -78
  73. package/components/notice/stories/index.stories.jsx +0 -90
  74. package/components/pricing-card/stories/index.stories.tsx +0 -55
  75. package/components/pricing-card/test/component.tsx +0 -89
  76. package/components/pricing-slider/stories/index.stories.tsx +0 -44
  77. package/components/pricing-slider/test/component.tsx +0 -14
  78. package/components/pricing-table/stories/index.stories.tsx +0 -74
  79. package/components/pricing-table/test/component.tsx +0 -41
  80. package/components/product-offer/stories/index.stories.tsx +0 -104
  81. package/components/product-price/stories/index.stories.tsx +0 -33
  82. package/components/product-price/test/component.tsx +0 -26
  83. package/components/qr-code/stories/index.stories.tsx +0 -32
  84. package/components/record-meter-bar/stories/index.stories.tsx +0 -39
  85. package/components/record-meter-bar/test/component.tsx +0 -52
  86. package/components/spinner/stories/index.stories.jsx +0 -20
  87. package/components/spinner/test/component.jsx +0 -17
  88. package/components/split-button/stories/index.stories.tsx +0 -35
  89. package/components/stat-card/stories/index.mdx +0 -35
  90. package/components/stat-card/stories/index.stories.tsx +0 -41
  91. package/components/stat-card/test/component.tsx +0 -24
  92. package/components/status/stories/index.stories.tsx +0 -44
  93. package/components/terms-of-service/test/index.test.jsx +0 -52
  94. package/components/testimonials/test/component.tsx +0 -103
  95. package/components/text/stories/headings.index.stories.tsx +0 -80
  96. package/components/text/stories/index.mdx +0 -195
  97. package/components/text/stories/index.stories.tsx +0 -69
  98. package/components/text/stories/style.module.scss +0 -64
  99. package/components/text/stories/title.index.stories.tsx +0 -34
  100. package/components/theme-provider/stories/index.stories.tsx +0 -164
  101. package/components/theme-provider/stories/style.module.scss +0 -79
  102. package/components/toggle-control/stories/index.stories.tsx +0 -83
  103. package/components/zendesk-chat/stories/index.stories.tsx +0 -15
  104. package/components/zendesk-chat/test/component.tsx +0 -16
  105. package/lib/locale/test/index.ts +0 -21
  106. package/tools/jp-redirect/test/index.tsx +0 -89
  107. package/tools/pricing-utils/test/index.ts +0 -39
@@ -1,90 +0,0 @@
1
- import { Meta, Story, Canvas } from '@storybook/blocks';
2
- import Button from '../index';
3
- import * as ButtonStories from './index.stories';
4
-
5
- <Meta of={ButtonStories} />
6
-
7
- # Button
8
- This is a component to create buttons and links across Jetpack.
9
-
10
- ## Props
11
-
12
- Below is the current available props for `Button`.
13
-
14
- ### variant
15
-
16
- It accepts 4 variant types: `primary`, `secondary`, `link`, `external-link`.
17
-
18
- <Canvas withSource="open">
19
- <Story id="js-packages-components-button--button-primary" />
20
- <Story id="js-packages-components-button--button-secondary" />
21
- <Story id="js-packages-components-button--button-link" />
22
- <Story id="js-packages-components-button--button-external-link" />
23
- </Canvas>
24
-
25
- ### size
26
-
27
- It accepts 2 size types: `normal` and `small`.
28
-
29
- <Canvas>
30
- <Story id="js-packages-components-button--button-primary" />
31
- <Button size="small">Jetpack Button</Button>
32
- </Canvas>
33
-
34
- ### weight
35
-
36
- It accepts 2 weight types: `bold` and `regular`. `bold` as default.
37
-
38
- ### icon
39
-
40
- It accepts an SVG, Component or string.
41
-
42
- You could use the ones from [@wordpress/icons](https://github.com/WordPress/gutenberg/blob/trunk/packages/icons/src/index.js).
43
-
44
- <Canvas withSource="open">
45
- <Story id="js-packages-components-button--icon" />
46
- </Canvas>
47
-
48
- ### iconSize
49
-
50
- It defines the size of the icon, it needs to be a number.
51
-
52
- ### disabled
53
-
54
- Disables the button removing cursor-pointer effect.
55
-
56
- <Canvas withSource="open">
57
- <Story id="js-packages-components-button--disabled" />
58
- </Canvas>
59
-
60
- ### isDestructive
61
-
62
- Set button on destructive state, which changes the color to red.
63
-
64
- <Canvas withSource="open">
65
- <Story id="js-packages-components-button--destructive" />
66
- </Canvas>
67
-
68
- ### isLoading
69
-
70
- Set button on loading state, which applies a centered spinner.
71
-
72
- <Canvas withSource="open">
73
- <Story id="js-packages-components-button--loading" />
74
- </Canvas>
75
-
76
- ### text
77
-
78
- It applies a text before children, it could be used together or on its own.
79
-
80
- <Canvas>
81
- <Button text="My Text">My Children</Button>
82
- </Canvas>
83
-
84
- ### fullWidth
85
-
86
- Stretches the button to take up the full width of the container.
87
-
88
- <Canvas withSource="open">
89
- <Story id="js-packages-components-button--full-width" />
90
- </Canvas>
@@ -1,400 +0,0 @@
1
- import * as allIcons from '@wordpress/icons';
2
- import Col from '../../layout/col';
3
- import Container from '../../layout/container';
4
- import Text, { H3 } from '../../text';
5
- import Button from '../index';
6
- import styles from './style.module.scss';
7
-
8
- const { Icon: WPIcon, ...icons } = allIcons;
9
- const { check, cloud } = icons;
10
-
11
- const disableVariant = {
12
- variant: {
13
- table: {
14
- disable: true,
15
- },
16
- },
17
- };
18
-
19
- const disableDisabled = {
20
- disabled: {
21
- table: {
22
- disable: true,
23
- },
24
- },
25
- };
26
-
27
- const disableIsDestructive = {
28
- isDestructive: {
29
- table: {
30
- disable: true,
31
- },
32
- },
33
- };
34
-
35
- const disableIsLoading = {
36
- isLoading: {
37
- table: {
38
- disable: true,
39
- },
40
- },
41
- };
42
-
43
- const disableIcon = {
44
- icon: {
45
- table: {
46
- disable: true,
47
- },
48
- },
49
- };
50
-
51
- const disableClassName = {
52
- className: {
53
- table: {
54
- disable: true,
55
- },
56
- },
57
- };
58
-
59
- const disableFullWidth = {
60
- fullWidth: {
61
- table: {
62
- disable: true,
63
- },
64
- },
65
- };
66
-
67
- export default {
68
- title: 'JS Packages/Components/Button',
69
- component: Button,
70
- argTypes: {
71
- variant: {
72
- control: {
73
- type: 'select',
74
- },
75
- options: [ 'primary', 'secondary', 'link', 'tertiary' ],
76
- },
77
- size: {
78
- control: {
79
- type: 'select',
80
- },
81
- options: [ 'normal', 'small' ],
82
- },
83
- weight: {
84
- control: {
85
- type: 'select',
86
- },
87
- options: [ 'bold', 'regular' ],
88
- },
89
- icon: {
90
- control: {
91
- type: 'select',
92
- },
93
- options: [ 'none', ...Object.keys( icons ) ],
94
- },
95
- },
96
- parameters: {
97
- backgrounds: {
98
- default: 'Jetpack Dashboard',
99
- },
100
- },
101
- };
102
-
103
- const DefaultTemplate = args => {
104
- const icon = args?.icon && args?.icon !== 'none' ? <WPIcon icon={ icons[ args.icon ] } /> : null;
105
- return <Button { ...args } icon={ icon } />;
106
- };
107
-
108
- export const _default = DefaultTemplate.bind( {} );
109
- _default.args = {
110
- variant: 'primary',
111
- size: 'normal',
112
- weight: 'bold',
113
- icon: 'cloud',
114
- isExternalLink: false,
115
- isLoading: false,
116
- disabled: false,
117
- isDestructive: false,
118
- fullWidth: false,
119
- children: 'Once upon a time… a button story',
120
- };
121
-
122
- const Template = args => <Button { ...args } />;
123
-
124
- export const ButtonPrimary = Template.bind( {} );
125
- ButtonPrimary.argTypes = {
126
- ...disableVariant,
127
- ...disableDisabled,
128
- ...disableIcon,
129
- ...disableIsLoading,
130
- ...disableIsDestructive,
131
- ...disableFullWidth,
132
- };
133
- ButtonPrimary.args = {
134
- size: 'normal',
135
- children: 'Jetpack Button',
136
- variant: 'primary',
137
- };
138
-
139
- export const ButtonSecondary = Template.bind( {} );
140
- ButtonSecondary.argTypes = {
141
- ...disableVariant,
142
- ...disableDisabled,
143
- ...disableIcon,
144
- ...disableIsLoading,
145
- ...disableIsDestructive,
146
- ...disableClassName,
147
- ...disableFullWidth,
148
- };
149
- ButtonSecondary.args = {
150
- size: 'normal',
151
- children: 'Jetpack Button',
152
- variant: 'secondary',
153
- };
154
-
155
- export const ButtonLink = Template.bind( {} );
156
- ButtonLink.argTypes = {
157
- ...disableVariant,
158
- ...disableDisabled,
159
- ...disableIcon,
160
- ...disableIsLoading,
161
- ...disableIsDestructive,
162
- ...disableClassName,
163
- ...disableFullWidth,
164
- };
165
- ButtonLink.args = {
166
- size: 'normal',
167
- children: 'Jetpack Button',
168
- variant: 'link',
169
- };
170
-
171
- export const ButtonExternalLink = Template.bind( {} );
172
- ButtonExternalLink.argTypes = {
173
- ...disableVariant,
174
- ...disableDisabled,
175
- ...disableIcon,
176
- ...disableIsLoading,
177
- ...disableIsDestructive,
178
- ...disableClassName,
179
- ...disableFullWidth,
180
- };
181
- ButtonExternalLink.args = {
182
- size: 'normal',
183
- children: 'Jetpack Button',
184
- variant: 'external-link',
185
- };
186
-
187
- export const Icon = Template.bind( {} );
188
- Icon.argTypes = {
189
- ...disableIcon,
190
- ...disableDisabled,
191
- ...disableIsLoading,
192
- ...disableIsDestructive,
193
- ...disableClassName,
194
- ...disableFullWidth,
195
- };
196
- Icon.args = {
197
- size: 'normal',
198
- children: 'Jetpack Button',
199
- icon: <WPIcon icon={ check } />,
200
- variant: 'primary',
201
- };
202
-
203
- export const Disabled = Template.bind( {} );
204
- Disabled.argTypes = {
205
- ...disableDisabled,
206
- ...disableIsDestructive,
207
- ...disableIsLoading,
208
- ...disableClassName,
209
- ...disableFullWidth,
210
- ...disableIcon,
211
- };
212
- Disabled.args = {
213
- size: 'normal',
214
- children: 'Jetpack Button',
215
- variant: 'primary',
216
- disabled: true,
217
- };
218
-
219
- export const Destructive = Template.bind( {} );
220
- Destructive.argTypes = {
221
- ...disableIsDestructive,
222
- ...disableIsLoading,
223
- ...disableDisabled,
224
- ...disableClassName,
225
- ...disableFullWidth,
226
- ...disableIcon,
227
- };
228
- Destructive.args = {
229
- size: 'normal',
230
- children: 'Jetpack Button',
231
- variant: 'primary',
232
- isDestructive: true,
233
- };
234
-
235
- export const Loading = Template.bind( {} );
236
- Loading.argTypes = {
237
- ...disableIsDestructive,
238
- ...disableIsLoading,
239
- ...disableDisabled,
240
- ...disableClassName,
241
- ...disableFullWidth,
242
- ...disableIcon,
243
- };
244
- Loading.args = {
245
- size: 'normal',
246
- children: 'Jetpack Button',
247
- variant: 'primary',
248
- isLoading: true,
249
- };
250
-
251
- export const FullWidth = Template.bind( {} );
252
- FullWidth.argTypes = {
253
- ...disableIsDestructive,
254
- ...disableIsLoading,
255
- ...disableDisabled,
256
- ...disableClassName,
257
- ...disableIcon,
258
- };
259
- FullWidth.args = {
260
- size: 'normal',
261
- children: 'Jetpack Button',
262
- variant: 'primary',
263
- fullWidth: true,
264
- };
265
-
266
- export const VariantsAndProps = () => {
267
- const variants = [ 'primary', 'secondary', 'link' ];
268
- return (
269
- <>
270
- <Container>
271
- <Col>
272
- <H3>Variants & Props</H3>
273
- </Col>
274
- <Col>
275
- <Text mb={ 3 }>
276
- The following shows how the properties modify the appearance and/or behavior of the
277
- button, in the different variants. Keep in mind that you cannot combine the variants but
278
- you can combine the props. Use the { '' }
279
- <a href="./?path=/story/js-packages-components-button--default">default story</a> to
280
- play with the combinations.
281
- </Text>
282
- </Col>
283
- </Container>
284
- <Container className={ styles.container } horizontalGap={ 0 }>
285
- <Col
286
- className={ `${ styles[ 'row-instance' ] } ${ styles.header }` }
287
- sm={ 4 }
288
- md={ 2 }
289
- lg={ 3 }
290
- >
291
- <Text size="body-extra-small">props / variants</Text>
292
- </Col>
293
-
294
- <Col sm={ 4 } md={ 2 } lg={ 3 }>
295
- <Text size="body-extra-small" className={ styles.header }>
296
- Primary
297
- </Text>
298
- </Col>
299
-
300
- <Col sm={ 4 } md={ 2 } lg={ 3 }>
301
- <Text size="body-extra-small" className={ styles.header }>
302
- Secondary
303
- </Text>
304
- </Col>
305
-
306
- <Col sm={ 4 } md={ 2 } lg={ 3 }>
307
- <Text size="body-extra-small" className={ styles.header }>
308
- Link
309
- </Text>
310
- </Col>
311
-
312
- <Col className={ styles[ 'row-instance' ] } sm={ 4 } md={ 2 } lg={ 3 }>
313
- <Text size="body-extra-small">no props</Text>
314
- </Col>
315
- { variants.map( variant => (
316
- <Col sm={ 4 } md={ 2 } lg={ 3 }>
317
- <Button { ...ButtonPrimary.args } variant={ variant } />
318
- </Col>
319
- ) ) }
320
-
321
- <Col className={ styles[ 'row-instance' ] } sm={ 4 } md={ 2 } lg={ 3 }>
322
- <Text size="body-extra-small">size: small</Text>
323
- </Col>
324
- { variants.map( variant => (
325
- <Col sm={ 4 } md={ 2 } lg={ 3 }>
326
- <Button { ...ButtonPrimary.args } variant={ variant } size="small" />
327
- </Col>
328
- ) ) }
329
-
330
- <Col className={ styles[ 'row-instance' ] } sm={ 4 } md={ 2 } lg={ 3 }>
331
- <Text size="body-extra-small">weight: regular</Text>
332
- </Col>
333
- { variants.map( variant => (
334
- <Col sm={ 4 } md={ 2 } lg={ 3 }>
335
- <Button { ...ButtonPrimary.args } variant={ variant } weight="regular" />
336
- </Col>
337
- ) ) }
338
-
339
- <Col className={ styles[ 'row-instance' ] } sm={ 4 } md={ 2 } lg={ 3 }>
340
- <Text size="body-extra-small">icon (cloud)</Text>
341
- </Col>
342
- { variants.map( variant => (
343
- <Col sm={ 4 } md={ 2 } lg={ 3 }>
344
- <Button
345
- { ...ButtonPrimary.args }
346
- variant={ variant }
347
- icon={ <WPIcon icon={ cloud } /> }
348
- />
349
- </Col>
350
- ) ) }
351
-
352
- <Col className={ styles[ 'row-instance' ] } sm={ 4 } md={ 2 } lg={ 3 }>
353
- <Text size="body-extra-small">disabled</Text>
354
- </Col>
355
- { variants.map( variant => (
356
- <Col sm={ 4 } md={ 2 } lg={ 3 }>
357
- <Button { ...ButtonPrimary.args } variant={ variant } disabled />
358
- </Col>
359
- ) ) }
360
-
361
- <Col className={ styles[ 'row-instance' ] } sm={ 4 } md={ 2 } lg={ 3 }>
362
- <Text size="body-extra-small">isDestructive</Text>
363
- </Col>
364
- { variants.map( variant => (
365
- <Col sm={ 4 } md={ 2 } lg={ 3 }>
366
- <Button { ...ButtonPrimary.args } variant={ variant } isDestructive />
367
- </Col>
368
- ) ) }
369
-
370
- <Col className={ styles[ 'row-instance' ] } sm={ 4 } md={ 2 } lg={ 3 }>
371
- <Text size="body-extra-small">isExternalLink</Text>
372
- </Col>
373
- { variants.map( variant => (
374
- <Col sm={ 4 } md={ 2 } lg={ 3 }>
375
- <Button { ...ButtonPrimary.args } variant={ variant } isExternalLink />
376
- </Col>
377
- ) ) }
378
-
379
- <Col className={ styles[ 'row-instance' ] } sm={ 4 } md={ 2 } lg={ 3 }>
380
- <Text size="body-extra-small">isLoading</Text>
381
- </Col>
382
- { variants.map( variant => (
383
- <Col sm={ 4 } md={ 2 } lg={ 3 }>
384
- <Button { ...ButtonPrimary.args } variant={ variant } isLoading />
385
- </Col>
386
- ) ) }
387
-
388
- <Col className={ styles[ 'row-instance' ] } sm={ 4 } md={ 2 } lg={ 3 }>
389
- <Text size="body-extra-small">fullWidth</Text>
390
- </Col>
391
- { variants.map( variant => (
392
- <Col sm={ 4 } md={ 2 } lg={ 3 }>
393
- <Button { ...ButtonPrimary.args } variant={ variant } fullWidth />
394
- </Col>
395
- ) ) }
396
- </Container>
397
- </>
398
- );
399
- };
400
- VariantsAndProps.storyName = 'Variants & Props';
@@ -1,20 +0,0 @@
1
- .container {
2
- row-gap: 0;
3
- column-gap: 0;
4
- > div {
5
- border-right: 1px dotted var( --jp-gray-10 );
6
- border-bottom: 1px dotted var( --jp-gray-10 );
7
- padding: calc( var( --spacing-base ) * 4 ) calc( var( --spacing-base ) * 2 );
8
- align-items: center;
9
-
10
- &:nth-child(4n) {
11
- border-right: none;
12
- }
13
- }
14
- }
15
-
16
-
17
- .header {
18
- font-weight: 600;
19
- text-align: center;
20
- }
@@ -1,25 +0,0 @@
1
- import { action } from '@storybook/addon-actions';
2
- import ContextualUpgradeTrigger from '../index';
3
-
4
- export default {
5
- title: 'JS Packages/Components/Contextual Upgrade Trigger',
6
- component: ContextualUpgradeTrigger,
7
- };
8
-
9
- const Template = args => <ContextualUpgradeTrigger { ...args } />;
10
-
11
- const DefaultArgs = {
12
- description: 'Current status of the product (i.e. how many updates per day)',
13
- cta: 'Text action line, recommending the next tier',
14
- onClick: action( 'onClick' ),
15
- };
16
-
17
- export const Default = Template.bind( {} );
18
- Default.args = DefaultArgs;
19
-
20
- export const Link = Template.bind( {} );
21
- Link.args = {
22
- ...DefaultArgs,
23
- onClick: null,
24
- href: 'https://jetpack.com',
25
- };
@@ -1,18 +0,0 @@
1
- import DecorativeCard from '../index';
2
- import type { ComponentStory, ComponentMeta } from '@storybook/react';
3
-
4
- export default {
5
- title: 'JS Packages/Components/Decorative Card',
6
- component: DecorativeCard,
7
- } as ComponentMeta< typeof DecorativeCard >;
8
-
9
- // Export additional stories using pre-defined values
10
- const Template: ComponentStory< typeof DecorativeCard > = args => <DecorativeCard { ...args } />;
11
-
12
- // Export Default story
13
- export const _default = Template.bind( {} );
14
-
15
- export const Unlink = Template.bind( {} );
16
- Unlink.args = {
17
- icon: 'unlink',
18
- };
Binary file
@@ -1 +0,0 @@
1
- declare module '*.png';
@@ -1,118 +0,0 @@
1
- /* eslint-disable react/react-in-jsx-scope */
2
- import React from 'react';
3
- import Dialog from '..';
4
- import ProductOffer from '../../product-offer';
5
- import BoostImage from './boost.png';
6
-
7
- export default {
8
- title: 'JS Packages/Components/Dialog',
9
- component: Dialog,
10
- parameters: {
11
- actions: { argTypesRegex: '^on.*' },
12
- layout: 'centered',
13
- },
14
- argTypes: {
15
- primary: {
16
- table: {
17
- disable: true,
18
- },
19
- },
20
- secondary: {
21
- table: {
22
- disable: true,
23
- },
24
- },
25
- isTwoSections: {
26
- table: {
27
- disable: true,
28
- },
29
- },
30
- },
31
- };
32
-
33
- const Template = args => <Dialog { ...args } />;
34
-
35
- export const JetpackBoost = Template.bind( {} );
36
- JetpackBoost.parameters = {};
37
- JetpackBoost.args = {
38
- primary: (
39
- <ProductOffer
40
- slug="boost"
41
- name="Boost"
42
- title="Jepack Boost"
43
- description="Jetpack Boost gives your site the same performance advantages as the world’s leading websites, no developer required."
44
- features={ [
45
- 'Check your site performance',
46
- 'Enable improvements in one click',
47
- 'Standalone free plugin for those focused on speed',
48
- ] }
49
- pricing={ {
50
- isFree: true,
51
- } }
52
- className={ '' }
53
- isCard={ false }
54
- supportedProducts={ [] }
55
- hasRequiredPlan={ false }
56
- addProductUrl={ '' }
57
- />
58
- ),
59
- secondary: <img src={ BoostImage } alt="Boost" />,
60
- isTwoSections: false,
61
- };
62
-
63
- export const JetpackBackup = Template.bind( {} );
64
- JetpackBackup.parameters = {};
65
- JetpackBackup.args = {
66
- primary: (
67
- <ProductOffer
68
- slug={ 'backup' }
69
- name={ 'Backup' }
70
- title={ 'Jepack Backup' }
71
- description={
72
- 'Never lose a word, image, page, or time worrying about your site with automated backups & one-click restores.'
73
- }
74
- features={ [
75
- 'Real-time cloud backups',
76
- '10GB of backup storage',
77
- '30-day archive & activity log',
78
- 'One-click restores',
79
- ] }
80
- pricing={ {
81
- currency: 'USD',
82
- price: 24.92,
83
- offPrice: 12.42,
84
- } }
85
- isCard={ true }
86
- className={ '' }
87
- supportedProducts={ [] }
88
- hasRequiredPlan={ false }
89
- addProductUrl={ '' }
90
- />
91
- ),
92
- secondary: (
93
- <ProductOffer
94
- name="Security"
95
- title="Security"
96
- description="Comprehensive site security, including Backup, Scan, and Anti-spam."
97
- isBundle={ true }
98
- supportedProducts={ [ 'backup', 'scan', 'anti-spam' ] }
99
- features={ [
100
- 'Real time cloud backups with 10GB storage',
101
- 'Automated real-time malware scan',
102
- 'One click fixes for most threats',
103
- 'Comment & form spam protection',
104
- ] }
105
- pricing={ {
106
- currency: 'USD',
107
- price: 24.92,
108
- offPrice: 12.42,
109
- } }
110
- hasRequiredPlan={ false }
111
- isLoading={ false }
112
- className={ '' }
113
- isCard={ false }
114
- addProductUrl={ '' }
115
- />
116
- ),
117
- isTwoSections: true,
118
- };