allaw-ui 5.4.1 → 5.4.3
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.
- package/dist/components/atoms/buttons/ActionButton.d.ts +1 -1
- package/dist/components/atoms/buttons/ActionButton.js +2 -2
- package/dist/components/molecules/proSwitch/ProSwitchModal.js +0 -2
- package/package.json +12 -19
- package/dist/components/atoms/buttons/ActionButton.stories.d.ts +0 -110
- package/dist/components/atoms/buttons/ActionButton.stories.js +0 -171
- package/dist/components/atoms/buttons/ActionCircleButton.stories.d.ts +0 -35
- package/dist/components/atoms/buttons/ActionCircleButton.stories.js +0 -54
- package/dist/components/atoms/buttons/AgendaSlot.stories.d.ts +0 -41
- package/dist/components/atoms/buttons/AgendaSlot.stories.js +0 -77
- package/dist/components/atoms/buttons/FavoriteToggle.stories.d.ts +0 -23
- package/dist/components/atoms/buttons/FavoriteToggle.stories.js +0 -61
- package/dist/components/atoms/buttons/FilterButton.stories.d.ts +0 -36
- package/dist/components/atoms/buttons/FilterButton.stories.js +0 -56
- package/dist/components/atoms/buttons/FilterButtonPrimary.stories.d.ts +0 -7
- package/dist/components/atoms/buttons/FilterButtonPrimary.stories.js +0 -26
- package/dist/components/atoms/buttons/GhostButton.stories.d.ts +0 -79
- package/dist/components/atoms/buttons/GhostButton.stories.js +0 -95
- package/dist/components/atoms/buttons/IconButton.stories.d.ts +0 -51
- package/dist/components/atoms/buttons/IconButton.stories.js +0 -100
- package/dist/components/atoms/buttons/InboxButton.stories.d.ts +0 -68
- package/dist/components/atoms/buttons/InboxButton.stories.js +0 -143
- package/dist/components/atoms/buttons/OAuthProviderButton.stories.d.ts +0 -67
- package/dist/components/atoms/buttons/OAuthProviderButton.stories.js +0 -168
- package/dist/components/atoms/buttons/PendingDocuments.stories.d.ts +0 -52
- package/dist/components/atoms/buttons/PendingDocuments.stories.js +0 -67
- package/dist/components/atoms/buttons/PrimaryButton.stories.d.ts +0 -121
- package/dist/components/atoms/buttons/PrimaryButton.stories.js +0 -187
- package/dist/components/atoms/buttons/SecondaryButton.stories.d.ts +0 -97
- package/dist/components/atoms/buttons/SecondaryButton.stories.js +0 -177
- package/dist/components/atoms/buttons/TabNavigation.stories.d.ts +0 -81
- package/dist/components/atoms/buttons/TabNavigation.stories.js +0 -178
- package/dist/components/atoms/buttons/TertiaryButton.stories.d.ts +0 -70
- package/dist/components/atoms/buttons/TertiaryButton.stories.js +0 -128
- package/dist/components/atoms/checkboxes/Checkbox.stories.d.ts +0 -77
- package/dist/components/atoms/checkboxes/Checkbox.stories.js +0 -123
- package/dist/components/atoms/datepickers/Datepicker.stories.d.ts +0 -167
- package/dist/components/atoms/datepickers/Datepicker.stories.js +0 -113
- package/dist/components/atoms/featureCard/featureCard.stories.d.ts +0 -21
- package/dist/components/atoms/featureCard/featureCard.stories.js +0 -101
- package/dist/components/atoms/filter/Filter.stories.d.ts +0 -9
- package/dist/components/atoms/filter/Filter.stories.js +0 -77
- package/dist/components/atoms/filters/SingleFilter.stories.d.ts +0 -10
- package/dist/components/atoms/filters/SingleFilter.stories.js +0 -84
- package/dist/components/atoms/inputs/Input.stories.d.ts +0 -85
- package/dist/components/atoms/inputs/Input.stories.js +0 -169
- package/dist/components/atoms/inputs/SearchBar.stories.d.ts +0 -142
- package/dist/components/atoms/inputs/SearchBar.stories.js +0 -197
- package/dist/components/atoms/inputs/TextArea.stories.d.ts +0 -95
- package/dist/components/atoms/inputs/TextArea.stories.js +0 -141
- package/dist/components/atoms/inputs/VerificationCodeInput.stories.d.ts +0 -81
- package/dist/components/atoms/inputs/VerificationCodeInput.stories.js +0 -89
- package/dist/components/atoms/progressBars/ProgressBar.stories.d.ts +0 -83
- package/dist/components/atoms/progressBars/ProgressBar.stories.js +0 -88
- package/dist/components/atoms/radios/RadioButton.stories.d.ts +0 -38
- package/dist/components/atoms/radios/RadioButton.stories.js +0 -87
- package/dist/components/atoms/radios/SelectCard.stories.d.ts +0 -92
- package/dist/components/atoms/radios/SelectCard.stories.js +0 -192
- package/dist/components/atoms/selects/ComboBox.stories.d.ts +0 -116
- package/dist/components/atoms/selects/ComboBox.stories.js +0 -136
- package/dist/components/atoms/selects/Select.stories.d.ts +0 -133
- package/dist/components/atoms/selects/Select.stories.js +0 -299
- package/dist/components/atoms/selects/SelectableListItem.stories.d.ts +0 -33
- package/dist/components/atoms/selects/SelectableListItem.stories.js +0 -53
- package/dist/components/atoms/tags/AppointementStatusTag.stories.d.ts +0 -17
- package/dist/components/atoms/tags/AppointementStatusTag.stories.js +0 -70
- package/dist/components/atoms/tags/FolderStatusTag.stories.d.ts +0 -28
- package/dist/components/atoms/tags/FolderStatusTag.stories.js +0 -51
- package/dist/components/atoms/tags/InlineTag.stories.d.ts +0 -109
- package/dist/components/atoms/tags/InlineTag.stories.js +0 -159
- package/dist/components/atoms/tags/OtherStatusTag.stories.d.ts +0 -99
- package/dist/components/atoms/tags/OtherStatusTag.stories.js +0 -160
- package/dist/components/atoms/typography/CardDate.stories.d.ts +0 -119
- package/dist/components/atoms/typography/CardDate.stories.js +0 -103
- package/dist/components/atoms/typography/Heading.stories.d.ts +0 -79
- package/dist/components/atoms/typography/Heading.stories.js +0 -150
- package/dist/components/atoms/typography/Link.stories.d.ts +0 -72
- package/dist/components/atoms/typography/Link.stories.js +0 -164
- package/dist/components/atoms/typography/Paragraph.stories.d.ts +0 -56
- package/dist/components/atoms/typography/Paragraph.stories.js +0 -97
- package/dist/components/atoms/typography/SmallTitle.stories.d.ts +0 -42
- package/dist/components/atoms/typography/SmallTitle.stories.js +0 -72
- package/dist/components/atoms/typography/Subtitle.stories.d.ts +0 -40
- package/dist/components/atoms/typography/Subtitle.stories.js +0 -60
- package/dist/components/atoms/typography/TinyInfo.stories.d.ts +0 -58
- package/dist/components/atoms/typography/TinyInfo.stories.js +0 -117
- package/dist/components/atoms/uiVariables/AnimatedBorder.stories.d.ts +0 -17
- package/dist/components/atoms/uiVariables/AnimatedBorder.stories.js +0 -20
- package/dist/components/atoms/uiVariables/BorderRadius.stories.d.ts +0 -18
- package/dist/components/atoms/uiVariables/BorderRadius.stories.js +0 -34
- package/dist/components/atoms/uiVariables/Shadows.stories.d.ts +0 -18
- package/dist/components/atoms/uiVariables/Shadows.stories.js +0 -34
- package/dist/components/atoms/uiVariables/Strokes.stories.d.ts +0 -18
- package/dist/components/atoms/uiVariables/Strokes.stories.js +0 -34
- package/dist/components/molecules/AiText/aiText.stories.d.ts +0 -43
- package/dist/components/molecules/AiText/aiText.stories.js +0 -216
- package/dist/components/molecules/DataStepper/Stepper.stories.d.ts +0 -8
- package/dist/components/molecules/DataStepper/Stepper.stories.js +0 -248
- package/dist/components/molecules/appointmentCard/AppointmentCard.stories.d.ts +0 -37
- package/dist/components/molecules/appointmentCard/AppointmentCard.stories.js +0 -106
- package/dist/components/molecules/appointmentSlot/AppointmentSlot.stories.d.ts +0 -95
- package/dist/components/molecules/appointmentSlot/AppointmentSlot.stories.js +0 -204
- package/dist/components/molecules/banner/Banner.stories.d.ts +0 -31
- package/dist/components/molecules/banner/Banner.stories.js +0 -123
- package/dist/components/molecules/billingCount/BillingCount.stories.d.ts +0 -22
- package/dist/components/molecules/billingCount/BillingCount.stories.js +0 -49
- package/dist/components/molecules/blogCard/BlogCard.stories.d.ts +0 -10
- package/dist/components/molecules/blogCard/BlogCard.stories.js +0 -33
- package/dist/components/molecules/blogFooter/BlogFooter.stories.d.ts +0 -60
- package/dist/components/molecules/blogFooter/BlogFooter.stories.js +0 -67
- package/dist/components/molecules/blogHeader/BlogHeader.stories.d.ts +0 -49
- package/dist/components/molecules/blogHeader/BlogHeader.stories.js +0 -63
- package/dist/components/molecules/blogText/BlogText.stories.d.ts +0 -31
- package/dist/components/molecules/blogText/BlogText.stories.js +0 -51
- package/dist/components/molecules/blogTextImageBlock/BlogTextImageBlock.stories.d.ts +0 -37
- package/dist/components/molecules/blogTextImageBlock/BlogTextImageBlock.stories.js +0 -58
- package/dist/components/molecules/brands/Brands.stories.d.ts +0 -8
- package/dist/components/molecules/brands/Brands.stories.js +0 -66
- package/dist/components/molecules/breadcrumb/Breadcrumb.stories.d.ts +0 -24
- package/dist/components/molecules/breadcrumb/Breadcrumb.stories.js +0 -54
- package/dist/components/molecules/caseCard/CaseCard.stories.d.ts +0 -114
- package/dist/components/molecules/caseCard/CaseCard.stories.js +0 -200
- package/dist/components/molecules/caseCardCompact/CaseCardCompact.stories.d.ts +0 -11
- package/dist/components/molecules/caseCardCompact/CaseCardCompact.stories.js +0 -59
- package/dist/components/molecules/caseLinkCard/CaseCardLink.stories.d.ts +0 -9
- package/dist/components/molecules/caseLinkCard/CaseCardLink.stories.js +0 -37
- package/dist/components/molecules/checkboxForm/CheckboxForm.stories.d.ts +0 -94
- package/dist/components/molecules/checkboxForm/CheckboxForm.stories.js +0 -157
- package/dist/components/molecules/checkboxForm/ColoredCheckbox.stories.d.ts +0 -108
- package/dist/components/molecules/checkboxForm/ColoredCheckbox.stories.js +0 -141
- package/dist/components/molecules/clientLinkCard/ClientLinkCard.stories.d.ts +0 -11
- package/dist/components/molecules/clientLinkCard/ClientLinkCard.stories.js +0 -59
- package/dist/components/molecules/contactCard/ContactCard.stories.d.ts +0 -69
- package/dist/components/molecules/contactCard/ContactCard.stories.js +0 -84
- package/dist/components/molecules/contactCard/ContactCardEdit.stories.d.ts +0 -88
- package/dist/components/molecules/contactCard/ContactCardEdit.stories.js +0 -106
- package/dist/components/molecules/contactCard/DetailedContactCard.stories.d.ts +0 -94
- package/dist/components/molecules/contactCard/DetailedContactCard.stories.js +0 -83
- package/dist/components/molecules/datepickerForm/DatepickerForm.stories.d.ts +0 -291
- package/dist/components/molecules/datepickerForm/DatepickerForm.stories.js +0 -185
- package/dist/components/molecules/documentCard/DocumentCard.stories.d.ts +0 -72
- package/dist/components/molecules/documentCard/DocumentCard.stories.js +0 -108
- package/dist/components/molecules/employeeCard/EmployeeCard.stories.d.ts +0 -74
- package/dist/components/molecules/employeeCard/EmployeeCard.stories.js +0 -65
- package/dist/components/molecules/emptyMessage/EmptyMessage.stories.d.ts +0 -75
- package/dist/components/molecules/emptyMessage/EmptyMessage.stories.js +0 -115
- package/dist/components/molecules/entityAdminCard/entityAdminCard.stories.d.ts +0 -10
- package/dist/components/molecules/entityAdminCard/entityAdminCard.stories.js +0 -50
- package/dist/components/molecules/entityCard/EntityCard.stories.d.ts +0 -22
- package/dist/components/molecules/entityCard/EntityCard.stories.js +0 -63
- package/dist/components/molecules/featureGrid/FeatureGrid.stories.d.ts +0 -7
- package/dist/components/molecules/featureGrid/FeatureGrid.stories.js +0 -97
- package/dist/components/molecules/fileCard/FileCard.stories.d.ts +0 -42
- package/dist/components/molecules/fileCard/FileCard.stories.js +0 -185
- package/dist/components/molecules/fileUploader/FileUploader.stories.d.ts +0 -120
- package/dist/components/molecules/fileUploader/FileUploader.stories.js +0 -269
- package/dist/components/molecules/flexContent/FlexContent.stories.d.ts +0 -9
- package/dist/components/molecules/flexContent/FlexContent.stories.js +0 -47
- package/dist/components/molecules/frameCTA/FrameCTA.stories.d.ts +0 -8
- package/dist/components/molecules/frameCTA/FrameCTA.stories.js +0 -58
- package/dist/components/molecules/heroSection/HeroSection.stories.d.ts +0 -46
- package/dist/components/molecules/heroSection/HeroSection.stories.js +0 -100
- package/dist/components/molecules/loadingBox/LoadingBox.stories.d.ts +0 -54
- package/dist/components/molecules/loadingBox/LoadingBox.stories.js +0 -128
- package/dist/components/molecules/modal/Modal.stories.d.ts +0 -128
- package/dist/components/molecules/modal/Modal.stories.js +0 -373
- package/dist/components/molecules/notification/Notification.stories.d.ts +0 -377
- package/dist/components/molecules/notification/Notification.stories.js +0 -205
- package/dist/components/molecules/pagination/Pagination.stories.d.ts +0 -44
- package/dist/components/molecules/pagination/Pagination.stories.js +0 -59
- package/dist/components/molecules/proCard/ProCard.stories.d.ts +0 -49
- package/dist/components/molecules/proCard/ProCard.stories.js +0 -69
- package/dist/components/molecules/proSwitch/AvatarBubble.stories.d.ts +0 -112
- package/dist/components/molecules/proSwitch/AvatarBubble.stories.js +0 -255
- package/dist/components/molecules/proSwitch/AvatarToggleGroup.stories.d.ts +0 -88
- package/dist/components/molecules/proSwitch/AvatarToggleGroup.stories.js +0 -328
- package/dist/components/molecules/proSwitch/ProSwitch.stories.d.ts +0 -9
- package/dist/components/molecules/proSwitch/ProSwitch.stories.js +0 -152
- package/dist/components/molecules/proSwitch/ProSwitchModal.stories.d.ts +0 -62
- package/dist/components/molecules/proSwitch/ProSwitchModal.stories.js +0 -269
- package/dist/components/molecules/questionAnswer/QuestionAnswer.stories.d.ts +0 -17
- package/dist/components/molecules/questionAnswer/QuestionAnswer.stories.js +0 -48
- package/dist/components/molecules/radioForm/RadioForm.stories.d.ts +0 -37
- package/dist/components/molecules/radioForm/RadioForm.stories.js +0 -75
- package/dist/components/molecules/rangeSlider/RangeSlider.stories.d.ts +0 -96
- package/dist/components/molecules/rangeSlider/RangeSlider.stories.js +0 -162
- package/dist/components/molecules/section/Section.stories.d.ts +0 -42
- package/dist/components/molecules/section/Section.stories.js +0 -162
- package/dist/components/molecules/segmentedControl/segmentedControl.stories.d.ts +0 -70
- package/dist/components/molecules/segmentedControl/segmentedControl.stories.js +0 -185
- package/dist/components/molecules/selectForm/SelectForm.stories.d.ts +0 -79
- package/dist/components/molecules/selectForm/SelectForm.stories.js +0 -113
- package/dist/components/molecules/stepper/Stepper.stories.d.ts +0 -62
- package/dist/components/molecules/stepper/Stepper.stories.js +0 -215
- package/dist/stories/Header.d.ts +0 -13
- package/dist/stories/Header.js +0 -20
- package/dist/stories/Header.stories.d.ts +0 -18
- package/dist/stories/Header.stories.js +0 -26
- package/dist/stories/Page.d.ts +0 -3
- package/dist/stories/Page.js +0 -37
- package/dist/stories/Page.stories.d.ts +0 -12
- package/dist/stories/Page.stories.js +0 -76
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import React, { useState } from "react";
|
|
13
|
-
import SelectForm from "./SelectForm";
|
|
14
|
-
import "../../../styles/global.css";
|
|
15
|
-
export default {
|
|
16
|
-
title: "Components/Molecules/SelectForm",
|
|
17
|
-
component: SelectForm,
|
|
18
|
-
tags: ["autodocs"],
|
|
19
|
-
argTypes: {
|
|
20
|
-
label: { control: "text" },
|
|
21
|
-
isRequired: { control: "boolean" },
|
|
22
|
-
options: { control: "object" },
|
|
23
|
-
isMultiple: { control: "boolean" },
|
|
24
|
-
maxItems: {
|
|
25
|
-
control: {
|
|
26
|
-
type: "number",
|
|
27
|
-
min: 1,
|
|
28
|
-
},
|
|
29
|
-
if: { arg: "isMultiple", truthy: true },
|
|
30
|
-
},
|
|
31
|
-
width: {
|
|
32
|
-
control: {
|
|
33
|
-
type: "number",
|
|
34
|
-
min: 1,
|
|
35
|
-
max: 100,
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
selectedItem: { control: "text" },
|
|
39
|
-
variant: {
|
|
40
|
-
control: {
|
|
41
|
-
type: "select",
|
|
42
|
-
options: ["bold", "semiBold", "medium"],
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
color: {
|
|
46
|
-
control: {
|
|
47
|
-
type: "select",
|
|
48
|
-
options: [
|
|
49
|
-
"bleu-allaw",
|
|
50
|
-
"mid-grey",
|
|
51
|
-
"dark-grey",
|
|
52
|
-
"noir",
|
|
53
|
-
"pure-white",
|
|
54
|
-
"grey-venom",
|
|
55
|
-
"venom-grey-dark",
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
isPrefilled: {
|
|
60
|
-
control: "boolean",
|
|
61
|
-
description: "Affiche une bordure bleue pour indiquer un champ pré-rempli",
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
var Template = function (args) {
|
|
66
|
-
var _a = useState(args.selectedItem), selectedOption = _a[0], setSelectedOption = _a[1];
|
|
67
|
-
var handleChange = function (newOption) {
|
|
68
|
-
setSelectedOption(newOption);
|
|
69
|
-
console.log("Selected option:", newOption);
|
|
70
|
-
};
|
|
71
|
-
return (React.createElement(SelectForm, __assign({}, args, { selectedItem: selectedOption, onChange: handleChange })));
|
|
72
|
-
};
|
|
73
|
-
export var Default = Template.bind({});
|
|
74
|
-
Default.args = {
|
|
75
|
-
label: "Délais de préavis (en jours ouvrés) avant la date de rendez-vous",
|
|
76
|
-
isRequired: true,
|
|
77
|
-
options: [
|
|
78
|
-
{ label: "24h", value: "24h" },
|
|
79
|
-
{ label: "48h", value: "48h" },
|
|
80
|
-
{ label: "72h", value: "72h" },
|
|
81
|
-
{ label: "1 semaine", value: "1week" },
|
|
82
|
-
{ label: "2 semaines", value: "2weeks" },
|
|
83
|
-
],
|
|
84
|
-
isMultiple: false,
|
|
85
|
-
width: 100,
|
|
86
|
-
selectedItem: "",
|
|
87
|
-
variant: "medium",
|
|
88
|
-
color: "noir",
|
|
89
|
-
isPrefilled: false,
|
|
90
|
-
};
|
|
91
|
-
export var Multiple = Template.bind({});
|
|
92
|
-
Multiple.args = {
|
|
93
|
-
label: "Sélectionnez vos domaines d'expertise",
|
|
94
|
-
isRequired: false,
|
|
95
|
-
options: [
|
|
96
|
-
{ label: "Droit des affaires", value: "business" },
|
|
97
|
-
{ label: "Droit immobilier", value: "real_estate" },
|
|
98
|
-
{ label: "Droit du travail", value: "labor" },
|
|
99
|
-
{ label: "Droit de la famille", value: "family" },
|
|
100
|
-
],
|
|
101
|
-
isMultiple: true,
|
|
102
|
-
width: 100,
|
|
103
|
-
selectedItem: [],
|
|
104
|
-
maxItems: 3,
|
|
105
|
-
};
|
|
106
|
-
export var CustomWidth = Template.bind({});
|
|
107
|
-
CustomWidth.args = __assign(__assign({}, Default.args), { width: 50 });
|
|
108
|
-
export var WithSelectedItem = Template.bind({});
|
|
109
|
-
WithSelectedItem.args = __assign(__assign({}, Default.args), { selectedItem: "48h" });
|
|
110
|
-
export var Prefilled = Template.bind({});
|
|
111
|
-
Prefilled.args = __assign(__assign({}, Default.args), { selectedItem: "72h", isPrefilled: true });
|
|
112
|
-
export var PrefilledEmpty = Template.bind({});
|
|
113
|
-
PrefilledEmpty.args = __assign(__assign({}, Default.args), { selectedItem: "", isPrefilled: true, placeHolder: "Champ pré-rempli vide..." });
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
declare namespace _default {
|
|
2
|
-
export let title: string;
|
|
3
|
-
export { Stepper as component };
|
|
4
|
-
export let tags: string[];
|
|
5
|
-
export namespace argTypes {
|
|
6
|
-
namespace startIcon {
|
|
7
|
-
namespace control {
|
|
8
|
-
let type: string;
|
|
9
|
-
}
|
|
10
|
-
let description: string;
|
|
11
|
-
}
|
|
12
|
-
namespace endIcon {
|
|
13
|
-
export namespace control_1 {
|
|
14
|
-
let type_1: string;
|
|
15
|
-
export { type_1 as type };
|
|
16
|
-
}
|
|
17
|
-
export { control_1 as control };
|
|
18
|
-
}
|
|
19
|
-
namespace showProgressBar {
|
|
20
|
-
export namespace control_2 {
|
|
21
|
-
let type_2: string;
|
|
22
|
-
export { type_2 as type };
|
|
23
|
-
}
|
|
24
|
-
export { control_2 as control };
|
|
25
|
-
let description_1: string;
|
|
26
|
-
export { description_1 as description };
|
|
27
|
-
}
|
|
28
|
-
namespace verticalOffset {
|
|
29
|
-
export namespace control_3 {
|
|
30
|
-
let type_3: string;
|
|
31
|
-
export { type_3 as type };
|
|
32
|
-
}
|
|
33
|
-
export { control_3 as control };
|
|
34
|
-
let description_2: string;
|
|
35
|
-
export { description_2 as description };
|
|
36
|
-
}
|
|
37
|
-
namespace maxWidth {
|
|
38
|
-
export namespace control_4 {
|
|
39
|
-
let type_4: string;
|
|
40
|
-
export { type_4 as type };
|
|
41
|
-
}
|
|
42
|
-
export { control_4 as control };
|
|
43
|
-
let description_3: string;
|
|
44
|
-
export { description_3 as description };
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
export namespace parameters {
|
|
48
|
-
namespace backgrounds {
|
|
49
|
-
let _default: string;
|
|
50
|
-
export { _default as default };
|
|
51
|
-
export let values: {
|
|
52
|
-
name: string;
|
|
53
|
-
value: string;
|
|
54
|
-
}[];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
export default _default;
|
|
59
|
-
export const Default: any;
|
|
60
|
-
export const WithLargeOffset: any;
|
|
61
|
-
export const WithCustomWidth: any;
|
|
62
|
-
import Stepper from "./Stepper";
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
import React, { useState, useEffect } from "react";
|
|
49
|
-
import { action } from "@storybook/addon-actions";
|
|
50
|
-
import Stepper from "./Stepper";
|
|
51
|
-
import "../../../styles/global.css";
|
|
52
|
-
export default {
|
|
53
|
-
title: "Components/Molecules/Stepper",
|
|
54
|
-
component: Stepper,
|
|
55
|
-
tags: ["autodocs"],
|
|
56
|
-
argTypes: {
|
|
57
|
-
startIcon: {
|
|
58
|
-
control: {
|
|
59
|
-
type: "object",
|
|
60
|
-
},
|
|
61
|
-
description: "Contrôle l'affichage de l'icône de début pour chaque étape",
|
|
62
|
-
},
|
|
63
|
-
endIcon: {
|
|
64
|
-
control: {
|
|
65
|
-
type: "boolean",
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
showProgressBar: {
|
|
69
|
-
control: {
|
|
70
|
-
type: "object",
|
|
71
|
-
},
|
|
72
|
-
description: "Contrôle l'affichage de la barre de progression pour chaque étape",
|
|
73
|
-
},
|
|
74
|
-
verticalOffset: {
|
|
75
|
-
control: {
|
|
76
|
-
type: "object",
|
|
77
|
-
},
|
|
78
|
-
description: "Décalage vertical du stepper (en px) pour éviter les barres de navigation",
|
|
79
|
-
},
|
|
80
|
-
maxWidth: {
|
|
81
|
-
control: {
|
|
82
|
-
type: "number",
|
|
83
|
-
},
|
|
84
|
-
description: "Largeur maximale du stepper en pixels (défaut: 768px)",
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
parameters: {
|
|
88
|
-
backgrounds: {
|
|
89
|
-
default: "light",
|
|
90
|
-
values: [
|
|
91
|
-
{ name: "light", value: "#ffffff" },
|
|
92
|
-
{ name: "grey", value: "#728ea7" },
|
|
93
|
-
{ name: "figma", value: "#404040" },
|
|
94
|
-
{ name: "dark", value: "#171e25" },
|
|
95
|
-
],
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
var Template = function (args) {
|
|
100
|
-
var _a = useState(args.currentStep), step = _a[0], setStep = _a[1];
|
|
101
|
-
var _b = useState(false), showStepper = _b[0], setShowStepper = _b[1];
|
|
102
|
-
useEffect(function () {
|
|
103
|
-
setStep(args.currentStep);
|
|
104
|
-
}, [args.currentStep]);
|
|
105
|
-
var handleOpenStepper = function () {
|
|
106
|
-
setShowStepper(true);
|
|
107
|
-
};
|
|
108
|
-
var handleCloseStepper = function () {
|
|
109
|
-
setShowStepper(false);
|
|
110
|
-
action("Stepper closed")();
|
|
111
|
-
if (args.onClose)
|
|
112
|
-
args.onClose();
|
|
113
|
-
};
|
|
114
|
-
var updatedArgs = __assign(__assign({}, args), { currentStep: step, onClose: handleCloseStepper, primaryButton: args.primaryButton.map(function (button) { return (__assign(__assign({}, button), { onPrimaryButtonClick: function (currentStep) {
|
|
115
|
-
action("Primary button clicked on step ".concat(currentStep))();
|
|
116
|
-
if (currentStep < args.steps) {
|
|
117
|
-
setStep(currentStep + 1);
|
|
118
|
-
}
|
|
119
|
-
} })); }), secondaryButton: args.secondaryButton.map(function (button) { return (__assign(__assign({}, button), { onSecondaryButtonClick: function (currentStep) {
|
|
120
|
-
action("Secondary button clicked on step ".concat(currentStep))();
|
|
121
|
-
if (currentStep > 1) {
|
|
122
|
-
setStep(currentStep - 1);
|
|
123
|
-
}
|
|
124
|
-
} })); }) });
|
|
125
|
-
return (React.createElement("div", null,
|
|
126
|
-
React.createElement("button", { onClick: handleOpenStepper, style: { margin: "20px" } }, "Ouvrir le stepper"),
|
|
127
|
-
showStepper && React.createElement(Stepper, __assign({}, updatedArgs))));
|
|
128
|
-
};
|
|
129
|
-
export var Default = Template.bind({});
|
|
130
|
-
Default.args = {
|
|
131
|
-
steps: 5,
|
|
132
|
-
currentStep: 1,
|
|
133
|
-
verticalOffset: {
|
|
134
|
-
top: 64,
|
|
135
|
-
bottom: 0,
|
|
136
|
-
},
|
|
137
|
-
startIcon: [true, true, true, true, true],
|
|
138
|
-
endIcon: true,
|
|
139
|
-
onClose: function () {
|
|
140
|
-
action("Stepper closed")();
|
|
141
|
-
},
|
|
142
|
-
secondaryButton: [
|
|
143
|
-
{ show: false },
|
|
144
|
-
{
|
|
145
|
-
show: true,
|
|
146
|
-
label: "Autre",
|
|
147
|
-
startIconName: "allaw-icon-add",
|
|
148
|
-
},
|
|
149
|
-
{ show: false },
|
|
150
|
-
{
|
|
151
|
-
show: true,
|
|
152
|
-
label: "Option",
|
|
153
|
-
startIconName: "allaw-icon-settings",
|
|
154
|
-
},
|
|
155
|
-
{ show: false },
|
|
156
|
-
],
|
|
157
|
-
validateStep: function (step) { return __awaiter(void 0, void 0, void 0, function () {
|
|
158
|
-
return __generator(this, function (_a) {
|
|
159
|
-
// Simuler une validation réussie
|
|
160
|
-
return [2 /*return*/, true];
|
|
161
|
-
});
|
|
162
|
-
}); },
|
|
163
|
-
primaryButton: [
|
|
164
|
-
{
|
|
165
|
-
show: true,
|
|
166
|
-
label: "Commencer",
|
|
167
|
-
startIconName: "allaw-icon-arrow-right",
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
show: true,
|
|
171
|
-
label: "Continuer",
|
|
172
|
-
endIconName: "allaw-icon-arrow-right",
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
show: true,
|
|
176
|
-
label: "Suivant",
|
|
177
|
-
endIconName: "allaw-icon-arrow-right",
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
show: true,
|
|
181
|
-
label: "Presque fini",
|
|
182
|
-
endIconName: "allaw-icon-arrow-right",
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
show: true,
|
|
186
|
-
label: "Terminer",
|
|
187
|
-
endIconName: "allaw-icon-check",
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
showProgressBar: [true, true, true, true, true],
|
|
191
|
-
children: [
|
|
192
|
-
React.createElement("div", { className: "stepper-content", key: "step1", style: { display: "flex", flexDirection: "column", gap: "10px" } },
|
|
193
|
-
"Contenu de l'\u00E9tape 1",
|
|
194
|
-
Array(10)
|
|
195
|
-
.fill(null)
|
|
196
|
-
.map(function (_, index) { return (React.createElement("div", { key: index },
|
|
197
|
-
React.createElement("br", null),
|
|
198
|
-
"Ligne ",
|
|
199
|
-
index + 1)); }),
|
|
200
|
-
React.createElement("div", null, "Fin du composant")),
|
|
201
|
-
React.createElement("div", { className: "stepper-content", key: "step2" }, "Contenu de l'\u00E9tape 2"),
|
|
202
|
-
React.createElement("div", { className: "stepper-content", key: "step3" }, "Contenu de l'\u00E9tape 3"),
|
|
203
|
-
React.createElement("div", { className: "stepper-content", key: "step4" }, "Contenu de l'\u00E9tape 4"),
|
|
204
|
-
React.createElement("div", { className: "stepper-content", key: "step5" }, "Contenu de l'\u00E9tape 5"),
|
|
205
|
-
],
|
|
206
|
-
};
|
|
207
|
-
// Ajouter une story avec un offset différent
|
|
208
|
-
export var WithLargeOffset = Template.bind({});
|
|
209
|
-
WithLargeOffset.args = __assign(__assign({}, Default.args), { verticalOffset: {
|
|
210
|
-
top: 120,
|
|
211
|
-
bottom: 80,
|
|
212
|
-
} });
|
|
213
|
-
// Ajouter une story avec une largeur personnalisée
|
|
214
|
-
export var WithCustomWidth = Template.bind({});
|
|
215
|
-
WithCustomWidth.args = __assign(__assign({}, Default.args), { maxWidth: 580 });
|
package/dist/stories/Header.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./header.css";
|
|
3
|
-
type User = {
|
|
4
|
-
name: string;
|
|
5
|
-
};
|
|
6
|
-
export interface HeaderProps {
|
|
7
|
-
user?: User;
|
|
8
|
-
onLogin?: () => void;
|
|
9
|
-
onLogout?: () => void;
|
|
10
|
-
onCreateAccount?: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const Header: ({ user }: HeaderProps) => React.JSX.Element;
|
|
13
|
-
export {};
|
package/dist/stories/Header.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
// import { Button } from './Button';
|
|
3
|
-
import "./header.css";
|
|
4
|
-
export var Header = function (_a) {
|
|
5
|
-
var user = _a.user;
|
|
6
|
-
return (React.createElement("header", null,
|
|
7
|
-
React.createElement("div", { className: "storybook-header" },
|
|
8
|
-
React.createElement("div", null,
|
|
9
|
-
React.createElement("svg", { width: "32", height: "32", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg" },
|
|
10
|
-
React.createElement("g", { fill: "none", fillRule: "evenodd" },
|
|
11
|
-
React.createElement("path", { d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z", fill: "#FFF" }),
|
|
12
|
-
React.createElement("path", { d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z", fill: "#555AB9" }),
|
|
13
|
-
React.createElement("path", { d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z", fill: "#91BAF8" }))),
|
|
14
|
-
React.createElement("h1", null, "Acme")),
|
|
15
|
-
React.createElement("div", null, user ? (React.createElement(React.Fragment, null,
|
|
16
|
-
React.createElement("span", { className: "welcome" },
|
|
17
|
-
"Welcome, ",
|
|
18
|
-
React.createElement("b", null, user.name),
|
|
19
|
-
"!"))) : (React.createElement(React.Fragment, null))))));
|
|
20
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
declare const meta: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: ({ user }: import("./Header").HeaderProps) => import("react").JSX.Element;
|
|
5
|
-
tags: string[];
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: string;
|
|
8
|
-
};
|
|
9
|
-
args: {
|
|
10
|
-
onLogin: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
11
|
-
onLogout: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
12
|
-
onCreateAccount: import("@vitest/spy").Mock<(...args: any[]) => any>;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default meta;
|
|
16
|
-
type Story = StoryObj<typeof meta>;
|
|
17
|
-
export declare const LoggedIn: Story;
|
|
18
|
-
export declare const LoggedOut: Story;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { fn } from '@storybook/test';
|
|
2
|
-
import { Header } from './Header';
|
|
3
|
-
var meta = {
|
|
4
|
-
title: 'Example/Header',
|
|
5
|
-
component: Header,
|
|
6
|
-
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
parameters: {
|
|
9
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
10
|
-
layout: 'fullscreen',
|
|
11
|
-
},
|
|
12
|
-
args: {
|
|
13
|
-
onLogin: fn(),
|
|
14
|
-
onLogout: fn(),
|
|
15
|
-
onCreateAccount: fn(),
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
export default meta;
|
|
19
|
-
export var LoggedIn = {
|
|
20
|
-
args: {
|
|
21
|
-
user: {
|
|
22
|
-
name: 'Jane Doe',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
export var LoggedOut = {};
|
package/dist/stories/Page.d.ts
DELETED
package/dist/stories/Page.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Header } from './Header';
|
|
3
|
-
import './page.css';
|
|
4
|
-
export var Page = function () {
|
|
5
|
-
var _a = React.useState(), user = _a[0], setUser = _a[1];
|
|
6
|
-
return (React.createElement("article", null,
|
|
7
|
-
React.createElement(Header, { user: user, onLogin: function () { return setUser({ name: 'Jane Doe' }); }, onLogout: function () { return setUser(undefined); }, onCreateAccount: function () { return setUser({ name: 'Jane Doe' }); } }),
|
|
8
|
-
React.createElement("section", { className: "storybook-page" },
|
|
9
|
-
React.createElement("h2", null, "Pages in Storybook"),
|
|
10
|
-
React.createElement("p", null,
|
|
11
|
-
"We recommend building UIs with a",
|
|
12
|
-
' ',
|
|
13
|
-
React.createElement("a", { href: "https://componentdriven.org", target: "_blank", rel: "noopener noreferrer" },
|
|
14
|
-
React.createElement("strong", null, "component-driven")),
|
|
15
|
-
' ',
|
|
16
|
-
"process starting with atomic components and ending with pages."),
|
|
17
|
-
React.createElement("p", null, "Render pages with mock data. This makes it easy to build and review page states without needing to navigate to them in your app. Here are some handy patterns for managing page data in Storybook:"),
|
|
18
|
-
React.createElement("ul", null,
|
|
19
|
-
React.createElement("li", null, "Use a higher-level connected component. Storybook helps you compose such data from the \"args\" of child component stories"),
|
|
20
|
-
React.createElement("li", null, "Assemble data in the page component from your services. You can mock these services out using Storybook.")),
|
|
21
|
-
React.createElement("p", null,
|
|
22
|
-
"Get a guided tutorial on component-driven development at",
|
|
23
|
-
' ',
|
|
24
|
-
React.createElement("a", { href: "https://storybook.js.org/tutorials/", target: "_blank", rel: "noopener noreferrer" }, "Storybook tutorials"),
|
|
25
|
-
". Read more in the",
|
|
26
|
-
' ',
|
|
27
|
-
React.createElement("a", { href: "https://storybook.js.org/docs", target: "_blank", rel: "noopener noreferrer" }, "docs"),
|
|
28
|
-
"."),
|
|
29
|
-
React.createElement("div", { className: "tip-wrapper" },
|
|
30
|
-
React.createElement("span", { className: "tip" }, "Tip"),
|
|
31
|
-
" Adjust the width of the canvas with the",
|
|
32
|
-
' ',
|
|
33
|
-
React.createElement("svg", { width: "10", height: "10", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg" },
|
|
34
|
-
React.createElement("g", { fill: "none", fillRule: "evenodd" },
|
|
35
|
-
React.createElement("path", { d: "M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z", id: "a", fill: "#999" }))),
|
|
36
|
-
"Viewports addon in the toolbar"))));
|
|
37
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
declare const meta: {
|
|
3
|
-
title: string;
|
|
4
|
-
component: import("react").FC<{}>;
|
|
5
|
-
parameters: {
|
|
6
|
-
layout: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
export default meta;
|
|
10
|
-
type Story = StoryObj<typeof meta>;
|
|
11
|
-
export declare const LoggedOut: Story;
|
|
12
|
-
export declare const LoggedIn: Story;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { within, userEvent, expect } from '@storybook/test';
|
|
38
|
-
import { Page } from './Page';
|
|
39
|
-
var meta = {
|
|
40
|
-
title: 'Example/Page',
|
|
41
|
-
component: Page,
|
|
42
|
-
parameters: {
|
|
43
|
-
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
44
|
-
layout: 'fullscreen',
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
export default meta;
|
|
48
|
-
export var LoggedOut = {};
|
|
49
|
-
// More on interaction testing: https://storybook.js.org/docs/writing-tests/interaction-testing
|
|
50
|
-
export var LoggedIn = {
|
|
51
|
-
play: function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
52
|
-
var canvas, loginButton, logoutButton;
|
|
53
|
-
var canvasElement = _b.canvasElement;
|
|
54
|
-
return __generator(this, function (_c) {
|
|
55
|
-
switch (_c.label) {
|
|
56
|
-
case 0:
|
|
57
|
-
canvas = within(canvasElement);
|
|
58
|
-
loginButton = canvas.getByRole('button', { name: /Log in/i });
|
|
59
|
-
return [4 /*yield*/, expect(loginButton).toBeInTheDocument()];
|
|
60
|
-
case 1:
|
|
61
|
-
_c.sent();
|
|
62
|
-
return [4 /*yield*/, userEvent.click(loginButton)];
|
|
63
|
-
case 2:
|
|
64
|
-
_c.sent();
|
|
65
|
-
return [4 /*yield*/, expect(loginButton).not.toBeInTheDocument()];
|
|
66
|
-
case 3:
|
|
67
|
-
_c.sent();
|
|
68
|
-
logoutButton = canvas.getByRole('button', { name: /Log out/i });
|
|
69
|
-
return [4 /*yield*/, expect(logoutButton).toBeInTheDocument()];
|
|
70
|
-
case 4:
|
|
71
|
-
_c.sent();
|
|
72
|
-
return [2 /*return*/];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}); },
|
|
76
|
-
};
|