-
)}
- )
-};
-ConfirmationWithCustomFormInside.storyName = 'confirmation with custom form inside';
-
-export const Prompt = () => (
-
- {(apis) => (
- {
- const values = await apis.popup.prompt('Enter name', (api) => (
-
-
-
-
-
-
-
-
- ), { validate: (vals) => ({
- firstName: !vals.firstName && 'First Name is required',
- lastName: !vals.lastName && 'Last Name is required',
- })});
-
- action('Prompt values')(values);
- }}>Click me
- )}
-
-);
+ );
+}
Prompt.storyName = 'prompt';
-export const PromptWithCustomSubmit = () => (
-
- {(apis) => (
- {
- apis.popup.prompt('Username: test Password: test', (api) => (
-
-
-
-
-
-
-
-
- ), {
- validate: (vals) => ({
- username: !vals.username && 'Username is required',
- password: !vals.password && 'Password is required',
- }),
- submit: (vals, api, close) => {
- if (vals.username === 'test' && vals.password === 'test') {
- close();
- action('Prompt values')(vals);
- } else {
- api.setError('password', 'Username or password is invalid');
- }
- },
- });
- }}>Click me
- )}
-
-);
+export const PromptWithCustomSubmit = () => {
+ return (
+
+ {(apis) => (
+ {
+ apis.popup.prompt('Username: test Password: test', (api) => (
+
+
+
+
+
+
+
+
+ ), {
+ validate: (vals) => ({
+ username: !vals.username && 'Username is required',
+ password: !vals.password && 'Password is required',
+ }),
+ submit: (vals, api, close) => {
+ if (vals.username === 'test' && vals.password === 'test') {
+ close();
+ action('Prompt values')(vals);
+ } else {
+ api.setError('password', 'Username or password is invalid');
+ }
+ },
+ });
+ }}>Click me
+ )}
+
+ );
+}
PromptWithCustomSubmit.storyName = 'prompt with custom submit';
-export const PromptWithRedTitleAndIconWithCustomSubmit = () => (
-
- {(apis) => (
- {
- apis.popup.prompt('Username: test Password: test', (api) => (
-
-
-
-
-
-
-
-
- ), {
- validate: (vals) => ({
- username: !vals.username && 'Username is required',
- password: !vals.password && 'Password is required',
- }),
- submit: (vals, api, close) => {
- if (vals.username === 'test' && vals.password === 'test') {
- close();
- action('Prompt values')(vals);
- } else {
- api.setError('password', 'Username or password is invalid');
- }
+export const PromptWithRedTitleAndIconWithCustomSubmit = () => {
+ return (
+
+ {(apis) => (
+ {
+ apis.popup.prompt('Username: test Password: test', (api) => (
+
+
+
+
+
+
+
+
+ ), {
+ validate: (vals) => ({
+ username: !vals.username && 'Username is required',
+ password: !vals.password && 'Password is required',
+ }),
+ submit: (vals, api, close) => {
+ if (vals.username === 'test' && vals.password === 'test') {
+ close();
+ action('Prompt values')(vals);
+ } else {
+ api.setError('password', 'Username or password is invalid');
+ }
+ },
},
- },
- { name: 'argo-icon-warning', color: 'failed' },
- 'red');
- }}>Click me
- )}
-
-);
+ { name: 'argo-icon-warning', color: 'failed' },
+ 'red');
+ }}>Click me
+ )}
+
+ );
+}
PromptWithRedTitleAndIconWithCustomSubmit.storyName = 'prompt with red title and icon, with custom submit';
-export const PromptWithYellowTitleAndIconThreeFieldsAndCustomSubmitVerticalCenterLayoutOfIcon = () => (
-
- {(apis) => (
- {
- apis.popup.prompt('Username: test Password: test', (api) => (
-
-
-
-
-
-
-
-
-
-
- This is an h4 header
- This is a paragraph
- This is another h4 header
- This is a paragraph
-
- ), {
- validate: (vals) => ({
- username: !vals.username && 'Username is required',
- password: !vals.password && 'Password is required',
- }),
- submit: (vals, api, close) => {
- if (vals.username === 'test' && vals.password === 'test') {
- close();
- action('Prompt values')(vals);
- } else {
- api.setError('password', 'Username or password is invalid');
- }
+export const PromptWithYellowTitleAndIconThreeFieldsAndCustomSubmitVerticalCenterLayoutOfIcon = () => {
+ return (
+
+ {(apis) => (
+ {
+ apis.popup.prompt('Username: test Password: test', (api) => (
+
+
+
+
+
+
+
+
+
+
+ This is an h4 header
+ This is a paragraph
+ This is another h4 header
+ This is a paragraph
+
+ ), {
+ validate: (vals) => ({
+ username: !vals.username && 'Username is required',
+ password: !vals.password && 'Password is required',
+ }),
+ submit: (vals, api, close) => {
+ if (vals.username === 'test' && vals.password === 'test') {
+ close();
+ action('Prompt values')(vals);
+ } else {
+ api.setError('password', 'Username or password is invalid');
+ }
+ },
},
- },
- { name: 'argo-icon-workflow', color: 'warning' },
- 'yellow');
- }}>Click me
- )}
-
-);
+ { name: 'argo-icon-workflow', color: 'warning' },
+ 'yellow');
+ }}>Click me
+ )}
+
+ );
+}
PromptWithYellowTitleAndIconThreeFieldsAndCustomSubmitVerticalCenterLayoutOfIcon.storyName = 'prompt with yellow title and icon, three fields and custom submit. Vertical center layout of icon';
-export const PromptWithGreenClockIconAndCustomSubmit = () => (
-
- {(apis) => (
- {
- apis.popup.prompt('Username: test Password: test', (api) => (
-
-
-
-
-
-
-
-
- ), {
- validate: (vals) => ({
- username: !vals.username && 'Username is required',
- password: !vals.password && 'Password is required',
- }),
- submit: (vals, api, close) => {
- if (vals.username === 'test' && vals.password === 'test') {
- close();
- action('Prompt values')(vals);
- } else {
- api.setError('password', 'Username or password is invalid');
- }
+export const PromptWithGreenClockIconAndCustomSubmit = () => {
+ return (
+
+ {(apis) => (
+ {
+ apis.popup.prompt('Username: test Password: test', (api) => (
+
+
+
+
+
+
+
+
+ ), {
+ validate: (vals) => ({
+ username: !vals.username && 'Username is required',
+ password: !vals.password && 'Password is required',
+ }),
+ submit: (vals, api, close) => {
+ if (vals.username === 'test' && vals.password === 'test') {
+ close();
+ action('Prompt values')(vals);
+ } else {
+ api.setError('password', 'Username or password is invalid');
+ }
+ },
},
- },
- { name: 'argo-icon-clock', color: 'success' });
- }}>Click me
- )}
-
-);
+ { name: 'argo-icon-clock', color: 'success' });
+ }}>Click me
+ )}
+
+ );
+}
PromptWithGreenClockIconAndCustomSubmit.storyName = 'prompt with green clock icon and custom submit';
-export const PromptWithJustHeadersAndParagraphs = () => (
-
- {(apis) => (
- {
- const values = await apis.popup.prompt('Enter name', (api) => (
-
-
This is an h4 header
-
This is a paragraph
-
This is another h4 header
-
This is a paragraph
-
- ));
- action('Prompt values')(values);
- }}>Click me
- )}
-
-);
+export const PromptWithJustHeadersAndParagraphs = () => {
+ return (
+
+ {(apis) => (
+ {
+ const values = await apis.popup.prompt('Enter name', (api) => (
+
+
This is an h4 header
+
This is a paragraph
+
This is another h4 header
+
This is a paragraph
+
+ ));
+ action('Prompt values')(values);
+ }}>Click me
+ )}
+
+ );
+}
PromptWithJustHeadersAndParagraphs.storyName = 'prompt with just headers and paragraphs';
-export const PromptWithOnlyParagraphsAdditionalTopPaddingIsOptionalForTheFirstParagraph = () => (
-
- {(apis) => (
- {
- const values = await apis.popup.prompt('Enter name', (api) => (
-
-
This is a paragraph
-
This is another paragraph
-
- ));
- action('Prompt values')(values);
- }}>Click me
- )}
-
-);
+export const PromptWithOnlyParagraphsAdditionalTopPaddingIsOptionalForTheFirstParagraph = () => {
+ return (
+
+ {(apis) => (
+ {
+ const values = await apis.popup.prompt('Enter name', (api) => (
+
+
This is a paragraph
+
This is another paragraph
+
+ ));
+ action('Prompt values')(values);
+ }}>Click me
+ )}
+
+ );
+}
PromptWithOnlyParagraphsAdditionalTopPaddingIsOptionalForTheFirstParagraph.storyName = 'prompt with only paragraphs. Additional top padding is optional for the first paragraph';
-export const PromptWithReactCheckboxThatIsCheckedByDefaultUsernameDefaultSetToAdmin = () => (
-
- {(apis) => (
- {
- const values = await apis.popup.prompt('Setting default values in popup example', (api) => (
-
-
-
-
-
-
-
-
- {' '}
-
-
-
- ), {
- validate: (vals) => ({
- username: !vals.username && 'Username is required',
- password: !vals.password && 'Password is required',
- }),
- submit: (vals, api, close) => {
- if (vals.username === 'admin' && vals.password === 'test') {
- close();
- action('Prompt values')(vals);
- } else {
- api.setError('password', 'Username or password is invalid');
- }
+export const PromptWithReactCheckboxThatIsCheckedByDefaultUsernameDefaultSetToAdmin = () => {
+ return (
+
+ {(apis) => (
+ {
+ const values = await apis.popup.prompt('Setting default values in popup example', (api) => (
+
+
+
+
+
+
+
+
+ {' '}
+
+
+
+ ), {
+ validate: (vals) => ({
+ username: !vals.username && 'Username is required',
+ password: !vals.password && 'Password is required',
+ }),
+ submit: (vals, api, close) => {
+ if (vals.username === 'admin' && vals.password === 'test') {
+ close();
+ action('Prompt values')(vals);
+ } else {
+ api.setError('password', 'Username or password is invalid');
+ }
+ },
},
- },
- undefined,
- undefined,
- { checkboxField: true, username: 'admin' });
- action('Prompt values')(values);
- }}>Click me
- )}
-
-);
+ undefined,
+ undefined,
+ { checkboxField: true, username: 'admin' });
+ action('Prompt values')(values);
+ }}>Click me
+ )}
+
+ );
+}
PromptWithReactCheckboxThatIsCheckedByDefaultUsernameDefaultSetToAdmin.storyName = 'prompt with React Checkbox that is checked by default; Username default set to admin';