File tree Expand file tree Collapse file tree 12 files changed +10
-270
lines changed
wonder-blocks-birthday-picker Expand file tree Collapse file tree 12 files changed +10
-270
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ const parameters: Preview["parameters"] = {
125125 } ,
126126 } ,
127127 viewport : {
128- viewports : wbViewports ,
128+ options : wbViewports ,
129129 } ,
130130} ;
131131
Original file line number Diff line number Diff line change @@ -32,8 +32,10 @@ const meta: Meta<typeof BirthdayPicker> = {
3232 excludeDecorators : true ,
3333 } ,
3434 } ,
35+ } ,
36+ globals : {
3537 viewport : {
36- defaultViewport : "large" ,
38+ value : "large" ,
3739 } ,
3840 } ,
3941 decorators : [ ( Story ) : React . ReactElement => < View > { Story ( ) } </ View > ] ,
@@ -189,8 +191,10 @@ export const BirthdayPickerMobile: StoryComponentType = {
189191 story : "A BirthdayPicker will reflow on small screens to stack controls rather than position them side-by-side." ,
190192 } ,
191193 } ,
194+ } ,
195+ globals : {
192196 viewport : {
193- defaultViewport : "small" ,
197+ value : "small" ,
194198 } ,
195199 } ,
196200} ;
Original file line number Diff line number Diff line change @@ -11,30 +11,6 @@ import type {ModalElement} from "../../packages/wonder-blocks-modal/src/util/typ
1111import { allModes } from "../../.storybook/modes" ;
1212import { reallyLongText } from "../components/text-for-testing" ;
1313
14- const customViewports = {
15- phone : {
16- name : "phone" ,
17- styles : {
18- width : "320px" ,
19- height : "568px" ,
20- } ,
21- } ,
22- tablet : {
23- name : "tablet" ,
24- styles : {
25- width : "640px" ,
26- height : "960px" ,
27- } ,
28- } ,
29- desktop : {
30- name : "desktop" ,
31- styles : {
32- width : "1024px" ,
33- height : "768px" ,
34- } ,
35- } ,
36- } as const ;
37-
3814const DefaultModal = ( ) : ModalElement => (
3915 < DrawerDialog
4016 title = "Single-line title"
@@ -58,10 +34,6 @@ export default {
5834 thunderblocks : allModes . themeThunderBlocks ,
5935 } ,
6036 } ,
61- viewport : {
62- viewports : customViewports ,
63- defaultViewport : "desktop" ,
64- } ,
6537 } ,
6638 tags : [ "!autodocs" ] ,
6739} as Meta < typeof DrawerLauncher > ;
Original file line number Diff line number Diff line change @@ -21,30 +21,6 @@ import {allModes} from "../../.storybook/modes";
2121import TextField from "../../packages/wonder-blocks-form/src/components/text-field" ;
2222import { reallyLongText } from "../components/text-for-testing" ;
2323
24- const customViewports = {
25- phone : {
26- name : "phone" ,
27- styles : {
28- width : "320px" ,
29- height : "568px" ,
30- } ,
31- } ,
32- tablet : {
33- name : "tablet" ,
34- styles : {
35- width : "640px" ,
36- height : "960px" ,
37- } ,
38- } ,
39- desktop : {
40- name : "desktop" ,
41- styles : {
42- width : "1024px" ,
43- height : "768px" ,
44- } ,
45- } ,
46- } as const ;
47-
4824const DefaultModal = ( ) : ModalElement => (
4925 < DrawerDialog
5026 title = "Single-line title"
@@ -119,10 +95,6 @@ import {BodyText} from "@khanacademy/wonder-blocks-typography";
11995 excludeDecorators : true ,
12096 } ,
12197 } ,
122- viewport : {
123- viewports : customViewports ,
124- defaultViewport : "desktop" ,
125- } ,
12698 chromatic : {
12799 modes : {
128100 small : allModes . small ,
Original file line number Diff line number Diff line change @@ -18,30 +18,6 @@ import celebrationBg from "../../static/celebration_bg.svg";
1818import celebrationChest from "../../static/celebration-chest.svg" ;
1919import { longText , reallyLongText } from "../components/text-for-testing" ;
2020
21- const customViewports = {
22- phone : {
23- name : "phone" ,
24- styles : {
25- width : "320px" ,
26- height : "568px" ,
27- } ,
28- } ,
29- tablet : {
30- name : "tablet" ,
31- styles : {
32- width : "640px" ,
33- height : "960px" ,
34- } ,
35- } ,
36- desktop : {
37- name : "desktop" ,
38- styles : {
39- width : "1024px" ,
40- height : "768px" ,
41- } ,
42- } ,
43- } as const ;
44-
4521export default {
4622 title : "Packages / Modal / FlexibleDialog" ,
4723 component : FlexibleDialog ,
@@ -68,10 +44,6 @@ export default {
6844 excludeDecorators : true ,
6945 } ,
7046 } ,
71- viewport : {
72- viewports : customViewports ,
73- defaultViewport : "desktop" ,
74- } ,
7547 chromatic : {
7648 modes : {
7749 small : allModes . small ,
Original file line number Diff line number Diff line change @@ -16,30 +16,6 @@ import ComponentInfo from "../components/component-info";
1616import packageConfig from "../../packages/wonder-blocks-modal/package.json" ;
1717import modalDialogArgtypes from "./modal-dialog.argtypes" ;
1818
19- const customViewports = {
20- phone : {
21- name : "phone" ,
22- styles : {
23- width : "320px" ,
24- height : "568px" ,
25- } ,
26- } ,
27- tablet : {
28- name : "tablet" ,
29- styles : {
30- width : "640px" ,
31- height : "960px" ,
32- } ,
33- } ,
34- desktop : {
35- name : "desktop" ,
36- styles : {
37- width : "1024px" ,
38- height : "768px" ,
39- } ,
40- } ,
41- } as const ;
42-
4319/**
4420 * `ModalDialog` is a component that contains these elements:
4521 * - The visual dialog element itself (`<div role="dialog"/>`)
@@ -76,10 +52,6 @@ export default {
7652 excludeDecorators : true ,
7753 } ,
7854 } ,
79- viewport : {
80- viewports : customViewports ,
81- defaultViewport : "desktop" ,
82- } ,
8355 chromatic : {
8456 // We already have screenshots in one-pane-dialog.stories.tsx
8557 disableSnapshot : true ,
@@ -242,13 +214,6 @@ export const WithLauncher: StoryComponentType = {
242214 </ ModalLauncher >
243215 ) ;
244216 } ,
245- parameters : {
246- chromatic : {
247- // Don't take screenshots of this story since it would only show a
248- // button and not the actual modal.
249- disableSnapshot : true ,
250- } ,
251- } ,
252217} ;
253218
254219const styles = StyleSheet . create ( {
Original file line number Diff line number Diff line change @@ -16,30 +16,6 @@ import packageConfig from "../../packages/wonder-blocks-modal/package.json";
1616
1717import ComponentInfo from "../components/component-info" ;
1818
19- const customViewports = {
20- phone : {
21- name : "phone" ,
22- styles : {
23- width : "320px" ,
24- height : "568px" ,
25- } ,
26- } ,
27- tablet : {
28- name : "tablet" ,
29- styles : {
30- width : "640px" ,
31- height : "960px" ,
32- } ,
33- } ,
34- desktop : {
35- name : "desktop" ,
36- styles : {
37- width : "1024px" ,
38- height : "768px" ,
39- } ,
40- } ,
41- } as const ;
42-
4319const longBody = (
4420 < >
4521 < BodyText >
@@ -127,10 +103,6 @@ export default {
127103 excludeDecorators : true ,
128104 } ,
129105 } ,
130- viewport : {
131- viewports : customViewports ,
132- defaultViewport : "desktop" ,
133- } ,
134106 chromatic : {
135107 // We already have screenshots of other stories in
136108 // one-pane-dialog.stories.tsx
Original file line number Diff line number Diff line change @@ -20,30 +20,6 @@ import packageConfig from "../../packages/wonder-blocks-modal/package.json";
2020import ComponentInfo from "../components/component-info" ;
2121import ModalHeaderArgtypes from "./modal-header.argtypes" ;
2222
23- const customViewports = {
24- phone : {
25- name : "phone" ,
26- styles : {
27- width : "320px" ,
28- height : "568px" ,
29- } ,
30- } ,
31- tablet : {
32- name : "tablet" ,
33- styles : {
34- width : "640px" ,
35- height : "960px" ,
36- } ,
37- } ,
38- desktop : {
39- name : "desktop" ,
40- styles : {
41- width : "1024px" ,
42- height : "768px" ,
43- } ,
44- } ,
45- } as const ;
46-
4723const longBody = (
4824 < >
4925 < BodyText >
@@ -154,10 +130,6 @@ export default {
154130 excludeDecorators : true ,
155131 } ,
156132 } ,
157- viewport : {
158- viewports : customViewports ,
159- defaultViewport : "desktop" ,
160- } ,
161133 chromatic : {
162134 // We already have screenshots of other stories in
163135 // one-pane-dialog.stories.tsx
Original file line number Diff line number Diff line change @@ -28,34 +28,9 @@ import type {ModalElement} from "../../packages/wonder-blocks-modal/src/util/typ
2828import ModalLauncherArgTypes from "./modal-launcher.argtypes" ;
2929
3030import ComponentInfo from "../components/component-info" ;
31- import { allModes } from "../../.storybook/modes" ;
3231import IconButton from "@khanacademy/wonder-blocks-icon-button" ;
3332import { PhosphorIcon } from "@khanacademy/wonder-blocks-icon" ;
3433
35- const customViewports = {
36- phone : {
37- name : "phone" ,
38- styles : {
39- width : "320px" ,
40- height : "568px" ,
41- } ,
42- } ,
43- tablet : {
44- name : "tablet" ,
45- styles : {
46- width : "640px" ,
47- height : "960px" ,
48- } ,
49- } ,
50- desktop : {
51- name : "desktop" ,
52- styles : {
53- width : "1024px" ,
54- height : "768px" ,
55- } ,
56- } ,
57- } as const ;
58-
5934const DefaultModal = ( ) : ModalElement => (
6035 < OnePaneDialog
6136 title = "Single-line title"
@@ -104,15 +79,8 @@ export default {
10479 excludeDecorators : true ,
10580 } ,
10681 } ,
107- viewport : {
108- viewports : customViewports ,
109- defaultViewport : "desktop" ,
110- } ,
11182 chromatic : {
112- modes : {
113- small : allModes . small ,
114- large : allModes . large ,
115- } ,
83+ // All the examples for ModalLauncher are behavior based, not visual.
11684 disableSnapshot : true ,
11785 } ,
11886 } ,
Original file line number Diff line number Diff line change @@ -18,30 +18,6 @@ import ComponentInfo from "../components/component-info";
1818import modalPanelArgtypes from "./modal-panel.argtypes" ;
1919import { allModes } from "../../.storybook/modes" ;
2020
21- const customViewports = {
22- phone : {
23- name : "phone" ,
24- styles : {
25- width : "320px" ,
26- height : "568px" ,
27- } ,
28- } ,
29- tablet : {
30- name : "tablet" ,
31- styles : {
32- width : "640px" ,
33- height : "960px" ,
34- } ,
35- } ,
36- desktop : {
37- name : "desktop" ,
38- styles : {
39- width : "1024px" ,
40- height : "768px" ,
41- } ,
42- } ,
43- } as const ;
44-
4521const longBody = (
4622 < View style = { { gap : sizing . size_160 } } >
4723 < BodyText >
@@ -136,10 +112,6 @@ export default {
136112 excludeDecorators : true ,
137113 } ,
138114 } ,
139- viewport : {
140- viewports : customViewports ,
141- defaultViewport : "desktop" ,
142- } ,
143115 chromatic : {
144116 modes : {
145117 small : allModes . small ,
You can’t perform that action at this time.
0 commit comments