@alveole/components 1.0.1 → 1.1.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.
- package/dist/core/A/A.stories.d.ts +1 -0
- package/dist/core/A/A.stories.d.ts.map +1 -1
- package/dist/core/A/A.stories.js +2 -1
- package/dist/core/Box/Box.stories.d.ts +1 -0
- package/dist/core/Box/Box.stories.d.ts.map +1 -1
- package/dist/core/Box/Box.stories.js +2 -1
- package/dist/core/Code/Code.d.ts +5 -0
- package/dist/core/Code/Code.d.ts.map +1 -0
- package/dist/core/Code/Code.js +9 -0
- package/dist/core/Code/Code.stories.d.ts +24 -0
- package/dist/core/Code/Code.stories.d.ts.map +1 -0
- package/dist/core/Code/Code.stories.js +16 -0
- package/dist/core/Code/Code.stories.sources.d.ts +8 -0
- package/dist/core/Code/Code.stories.sources.d.ts.map +1 -0
- package/dist/core/Code/Code.stories.sources.js +8 -0
- package/dist/core/Code/Code.styles.d.ts +13 -0
- package/dist/core/Code/Code.styles.d.ts.map +1 -0
- package/dist/core/Code/Code.styles.js +13 -0
- package/dist/core/Code/index.d.ts +2 -0
- package/dist/core/Code/index.d.ts.map +1 -0
- package/dist/core/Code/index.js +1 -0
- package/dist/core/Form/Form.stories.d.ts +2 -0
- package/dist/core/Form/Form.stories.d.ts.map +1 -1
- package/dist/core/Form/Form.stories.js +4 -3
- package/dist/core/Form/Form.stories.sources.d.ts +1 -0
- package/dist/core/Form/Form.stories.sources.d.ts.map +1 -1
- package/dist/core/Form/Form.stories.sources.js +4 -1
- package/dist/core/Image/Image.stories.d.ts +1 -0
- package/dist/core/Image/Image.stories.d.ts.map +1 -1
- package/dist/core/Image/Image.stories.js +2 -1
- package/dist/core/MarkdownDescription/MarkdownDescription.d.ts +6 -0
- package/dist/core/MarkdownDescription/MarkdownDescription.d.ts.map +1 -0
- package/dist/core/MarkdownDescription/MarkdownDescription.js +59 -0
- package/dist/core/MarkdownDescription/index.d.ts +2 -0
- package/dist/core/MarkdownDescription/index.d.ts.map +1 -0
- package/dist/core/MarkdownDescription/index.js +1 -0
- package/dist/core/Metabase/Metabase.stories.d.ts +1 -1
- package/dist/core/Metabase/Metabase.styles.d.ts +1 -1
- package/dist/core/Page/Page.stories.d.ts +38 -2
- package/dist/core/Page/Page.stories.d.ts.map +1 -1
- package/dist/core/Page/Page.stories.js +38 -26
- package/dist/core/Page/Page.stories.sources.d.ts +1 -0
- package/dist/core/Page/Page.stories.sources.d.ts.map +1 -1
- package/dist/core/Page/Page.stories.sources.js +6 -2
- package/dist/core/Section/Section.stories.d.ts +5 -5
- package/dist/core/Section/Section.stories.js +1 -1
- package/dist/core/Section/Section.stories.sources.d.ts.map +1 -1
- package/dist/core/Section/Section.stories.sources.js +1 -1
- package/dist/core/Section/Section.styles.d.ts +5 -5
- package/dist/core/ThemeProvider/ThemeProvider.stories.d.ts +64 -0
- package/dist/core/ThemeProvider/ThemeProvider.stories.d.ts.map +1 -0
- package/dist/core/ThemeProvider/ThemeProvider.stories.js +109 -0
- package/dist/core/ThemeProvider/ThemeProvider.stories.sources.d.ts +9 -0
- package/dist/core/ThemeProvider/ThemeProvider.stories.sources.d.ts.map +1 -0
- package/dist/core/ThemeProvider/ThemeProvider.stories.sources.js +12 -0
- package/dist/core/Version/Version.stories.d.ts +1 -1
- package/dist/core/Version/Version.styles.d.ts +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/stories/index.d.ts +6 -0
- package/dist/stories/index.d.ts.map +1 -1
- package/dist/stories/index.js +6 -0
- package/dist/type/Story.d.ts +1 -0
- package/dist/type/Story.d.ts.map +1 -1
- package/dist/ui/Accordion/Accordion.stories.d.ts +17 -17
- package/dist/ui/Accordion/Accordion.styles.d.ts +17 -17
- package/dist/ui/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/ui/Autocomplete/Autocomplete.js +1 -1
- package/dist/ui/Autocomplete/Autocomplete.stories.d.ts +28 -28
- package/dist/ui/Autocomplete/Autocomplete.styles.d.ts +28 -28
- package/dist/ui/Autocomplete/Autocomplete.web.d.ts.map +1 -1
- package/dist/ui/Avatar/Avatar.js +5 -5
- package/dist/ui/Badge/Badge.d.ts.map +1 -1
- package/dist/ui/Badge/Badge.stories.d.ts +6 -6
- package/dist/ui/Badge/Badge.styles.d.ts +6 -6
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.d.ts +1 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.styles.d.ts +1 -1
- package/dist/ui/Button/Button.stories.d.ts +26 -24
- package/dist/ui/Button/Button.stories.d.ts.map +1 -1
- package/dist/ui/Button/Button.stories.js +5 -3
- package/dist/ui/Button/Button.stories.sources.d.ts +1 -0
- package/dist/ui/Button/Button.stories.sources.d.ts.map +1 -1
- package/dist/ui/Button/Button.stories.sources.js +6 -2
- package/dist/ui/Button/Button.styles.d.ts +24 -24
- package/dist/ui/Button/Button.styles.js +2 -2
- package/dist/ui/Card/Card.stories.d.ts +4 -3
- package/dist/ui/Card/Card.stories.d.ts.map +1 -1
- package/dist/ui/Card/Card.stories.js +3 -2
- package/dist/ui/Card/Card.stories.sources.d.ts +1 -0
- package/dist/ui/Card/Card.stories.sources.d.ts.map +1 -1
- package/dist/ui/Card/Card.stories.sources.js +4 -1
- package/dist/ui/Card/Card.styles.d.ts +2 -2
- package/dist/ui/Card/CardActions.styles.d.ts +1 -1
- package/dist/ui/Card/CardHeader.styles.d.ts +1 -1
- package/dist/ui/Card/CardSection.styles.d.ts +3 -3
- package/dist/ui/Checkbox/Checkbox.js +2 -2
- package/dist/ui/Checkbox/Checkbox.stories.d.ts +1 -1
- package/dist/ui/Checkbox/Checkbox.styles.d.ts +1 -1
- package/dist/ui/Checkbox/Checkbox.styles.js +7 -7
- package/dist/ui/Counter/Counter.stories.d.ts +2 -2
- package/dist/ui/Counter/Counter.styles.d.ts +2 -2
- package/dist/ui/DateInput/DateInput.d.ts +36 -0
- package/dist/ui/DateInput/DateInput.d.ts.map +1 -0
- package/dist/ui/DateInput/DateInput.ios.d.ts +23 -0
- package/dist/ui/DateInput/DateInput.ios.d.ts.map +1 -0
- package/dist/ui/DateInput/DateInput.ios.js +45 -0
- package/dist/ui/DateInput/DateInput.js +70 -0
- package/dist/ui/DateInput/DateInput.stories.d.ts +36 -0
- package/dist/ui/DateInput/DateInput.stories.d.ts.map +1 -0
- package/dist/ui/DateInput/DateInput.stories.js +21 -0
- package/dist/ui/DateInput/DateInput.stories.sources.d.ts +8 -0
- package/dist/ui/DateInput/DateInput.stories.sources.d.ts.map +1 -0
- package/dist/ui/DateInput/DateInput.stories.sources.js +8 -0
- package/dist/ui/DateInput/DateInput.styles.d.ts +4 -0
- package/dist/ui/DateInput/DateInput.styles.d.ts.map +1 -0
- package/dist/ui/DateInput/DateInput.styles.js +4 -0
- package/dist/ui/DateInput/DateInput.web.d.ts +23 -0
- package/dist/ui/DateInput/DateInput.web.d.ts.map +1 -0
- package/dist/ui/DateInput/DateInput.web.js +9 -0
- package/dist/ui/DateInput/dateUtils.d.ts +23 -0
- package/dist/ui/DateInput/dateUtils.d.ts.map +1 -0
- package/dist/ui/DateInput/dateUtils.js +47 -0
- package/dist/ui/DateInput/index.d.ts +2 -0
- package/dist/ui/DateInput/index.d.ts.map +1 -0
- package/dist/ui/DateInput/index.js +1 -0
- package/dist/ui/Divider/Divider.stories.d.ts +1 -0
- package/dist/ui/Divider/Divider.stories.d.ts.map +1 -1
- package/dist/ui/Divider/Divider.stories.js +2 -1
- package/dist/ui/DocumentViewer/DocumentViewer.stories.d.ts +6 -6
- package/dist/ui/DocumentViewer/DocumentViewer.styles.d.ts +6 -6
- package/dist/ui/DocumentViewer/DocumentViewer.styles.js +1 -1
- package/dist/ui/DragAndDropFile/DragAndDropFile.stories.d.ts +10 -10
- package/dist/ui/DragAndDropFile/DragAndDropFile.styles.d.ts +10 -10
- package/dist/ui/DragAndDropFile/DragAndDropFile.styles.js +3 -3
- package/dist/ui/DurationInput/DurationInput.d.ts +19 -0
- package/dist/ui/DurationInput/DurationInput.d.ts.map +1 -0
- package/dist/ui/DurationInput/DurationInput.js +22 -0
- package/dist/ui/DurationInput/DurationInput.stories.d.ts +23 -0
- package/dist/ui/DurationInput/DurationInput.stories.d.ts.map +1 -0
- package/dist/ui/DurationInput/DurationInput.stories.js +29 -0
- package/dist/ui/DurationInput/DurationInput.stories.sources.d.ts +8 -0
- package/dist/ui/DurationInput/DurationInput.stories.sources.d.ts.map +1 -0
- package/dist/ui/DurationInput/DurationInput.stories.sources.js +8 -0
- package/dist/ui/DurationInput/index.d.ts +2 -0
- package/dist/ui/DurationInput/index.d.ts.map +1 -0
- package/dist/ui/DurationInput/index.js +1 -0
- package/dist/ui/EmptyState/EmptyState.stories.d.ts +9 -9
- package/dist/ui/EmptyState/EmptyState.styles.d.ts +9 -9
- package/dist/ui/FormControl/FormControl.stories.d.ts +17 -17
- package/dist/ui/FormControl/FormControl.styles.d.ts +17 -17
- package/dist/ui/FormControl/FormControlFileInput.styles.d.ts +5 -5
- package/dist/ui/FormControl/TextInput.d.ts.map +1 -1
- package/dist/ui/Grid/Grid.d.ts +17 -0
- package/dist/ui/Grid/Grid.d.ts.map +1 -0
- package/dist/ui/Grid/Grid.js +40 -0
- package/dist/ui/Grid/Grid.stories.d.ts +24 -0
- package/dist/ui/Grid/Grid.stories.d.ts.map +1 -0
- package/dist/ui/Grid/Grid.stories.js +24 -0
- package/dist/ui/Grid/Grid.stories.sources.d.ts +8 -0
- package/dist/ui/Grid/Grid.stories.sources.d.ts.map +1 -0
- package/dist/ui/Grid/Grid.stories.sources.js +8 -0
- package/dist/ui/Grid/Grid.styles.d.ts +10 -0
- package/dist/ui/Grid/Grid.styles.d.ts.map +1 -0
- package/dist/ui/Grid/Grid.styles.js +10 -0
- package/dist/ui/Grid/index.d.ts +2 -0
- package/dist/ui/Grid/index.d.ts.map +1 -0
- package/dist/ui/Grid/index.js +1 -0
- package/dist/ui/Header/Header.stories.d.ts +6 -6
- package/dist/ui/Header/Header.styles.d.ts +6 -6
- package/dist/ui/InputHeading/InputHeading.stories.d.ts +1 -1
- package/dist/ui/InputHeading/InputHeading.styles.d.ts +1 -1
- package/dist/ui/ListItem/ListItem.stories.d.ts +9 -8
- package/dist/ui/ListItem/ListItem.stories.d.ts.map +1 -1
- package/dist/ui/ListItem/ListItem.stories.js +3 -3
- package/dist/ui/ListItem/ListItem.stories.sources.d.ts +1 -0
- package/dist/ui/ListItem/ListItem.stories.sources.d.ts.map +1 -1
- package/dist/ui/ListItem/ListItem.stories.sources.js +4 -1
- package/dist/ui/ListItem/ListItem.styles.d.ts +8 -8
- package/dist/ui/LucideIcon/LucideIcon.props.d.ts +2 -2
- package/dist/ui/LucideIcon/LucideIcon.stories.d.ts +6 -1
- package/dist/ui/LucideIcon/LucideIcon.stories.d.ts.map +1 -1
- package/dist/ui/LucideIcon/LucideIcon.stories.js +8 -4
- package/dist/ui/LucideIcon/LucideIcon.stories.sources.d.ts +1 -0
- package/dist/ui/LucideIcon/LucideIcon.stories.sources.d.ts.map +1 -1
- package/dist/ui/LucideIcon/LucideIcon.stories.sources.js +4 -1
- package/dist/ui/OtpField/OtpField.d.ts.map +1 -1
- package/dist/ui/OtpField/OtpField.stories.d.ts +2 -2
- package/dist/ui/OtpField/OtpField.styles.d.ts +2 -2
- package/dist/ui/OtpField/OtpField.styles.js +3 -3
- package/dist/ui/PageHeader/PageHeader.stories.d.ts +3 -3
- package/dist/ui/PageHeader/PageHeader.styles.d.ts +3 -3
- package/dist/ui/Popover/Popover.js +2 -2
- package/dist/ui/Popover/Popover.stories.d.ts +12 -12
- package/dist/ui/Popover/Popover.styles.d.ts +12 -12
- package/dist/ui/PriceInput/PriceInput.stories.d.ts +1 -1
- package/dist/ui/PriceInput/PriceInput.styles.d.ts +1 -1
- package/dist/ui/ProgressBar/ProgressBar.stories.d.ts +1 -1
- package/dist/ui/ProgressBar/ProgressBar.styles.d.ts +1 -1
- package/dist/ui/RadioGroup/RadioGroup.stories.d.ts +13 -13
- package/dist/ui/RadioGroup/RadioGroup.styles.d.ts +13 -13
- package/dist/ui/RadioGroup/RadioGroup.styles.js +7 -7
- package/dist/ui/RadioGroup/RadioGroupItem.styles.d.ts +1 -1
- package/dist/ui/ResourceList/ResourceList.stories.d.ts +4 -4
- package/dist/ui/ResourceList/ResourceList.styles.d.ts +4 -4
- package/dist/ui/Select/Select.stories.d.ts +7 -7
- package/dist/ui/Select/Select.styles.d.ts +7 -7
- package/dist/ui/SelectMultiple/SelectMultiple.stories.d.ts +9 -9
- package/dist/ui/SelectMultiple/SelectMultiple.styles.d.ts +9 -9
- package/dist/ui/Sidebar/Sidebar.stories.d.ts +51 -31
- package/dist/ui/Sidebar/Sidebar.stories.d.ts.map +1 -1
- package/dist/ui/Sidebar/Sidebar.stories.js +22 -17
- package/dist/ui/Sidebar/Sidebar.stories.sources.d.ts +1 -0
- package/dist/ui/Sidebar/Sidebar.stories.sources.d.ts.map +1 -1
- package/dist/ui/Sidebar/Sidebar.stories.sources.js +4 -1
- package/dist/ui/Sidebar/Sidebar.styles.d.ts +30 -30
- package/dist/ui/Sidebar/Sidebar.styles.js +3 -3
- package/dist/ui/Signature/Signature.js +2 -2
- package/dist/ui/Switch/Switch.js +2 -2
- package/dist/ui/Switch/Switch.stories.d.ts +3 -3
- package/dist/ui/Switch/Switch.styles.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.stories.d.ts +12 -12
- package/dist/ui/Tabs/Tabs.styles.d.ts +12 -12
- package/dist/ui/Tag/Tag.d.ts.map +1 -1
- package/dist/ui/Tag/Tag.stories.d.ts +6 -6
- package/dist/ui/Tag/Tag.styles.d.ts +6 -6
- package/dist/ui/TimeInput/TimeInput.d.ts +19 -0
- package/dist/ui/TimeInput/TimeInput.d.ts.map +1 -0
- package/dist/ui/TimeInput/TimeInput.js +32 -0
- package/dist/ui/TimeInput/TimeInput.stories.d.ts +25 -0
- package/dist/ui/TimeInput/TimeInput.stories.d.ts.map +1 -0
- package/dist/ui/TimeInput/TimeInput.stories.js +26 -0
- package/dist/ui/TimeInput/TimeInput.stories.sources.d.ts +8 -0
- package/dist/ui/TimeInput/TimeInput.stories.sources.d.ts.map +1 -0
- package/dist/ui/TimeInput/TimeInput.stories.sources.js +8 -0
- package/dist/ui/TimeInput/TimeInput.styles.d.ts +4 -0
- package/dist/ui/TimeInput/TimeInput.styles.d.ts.map +1 -0
- package/dist/ui/TimeInput/TimeInput.styles.js +4 -0
- package/dist/ui/TimeInput/TimeInput.web.d.ts +12 -0
- package/dist/ui/TimeInput/TimeInput.web.d.ts.map +1 -0
- package/dist/ui/TimeInput/TimeInput.web.js +9 -0
- package/dist/ui/TimeInput/index.d.ts +2 -0
- package/dist/ui/TimeInput/index.d.ts.map +1 -0
- package/dist/ui/TimeInput/index.js +1 -0
- package/dist/ui/Toast/Toast.stories.d.ts +33 -9
- package/dist/ui/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/ui/Toast/Toast.stories.js +27 -22
- package/dist/ui/Toast/Toast.stories.sources.d.ts +1 -0
- package/dist/ui/Toast/Toast.stories.sources.d.ts.map +1 -1
- package/dist/ui/Toast/Toast.stories.sources.js +4 -1
- package/dist/ui/Toast/Toast.styles.d.ts +9 -9
- package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.stories.d.ts +18 -1
- package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.stories.d.ts.map +1 -1
- package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.stories.js +19 -8
- package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.stories.sources.d.ts +1 -0
- package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.stories.sources.d.ts.map +1 -1
- package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.stories.sources.js +4 -1
- package/dist/ui/ToolbarTop/ToolbarTop.stories.d.ts +14 -10
- package/dist/ui/ToolbarTop/ToolbarTop.stories.d.ts.map +1 -1
- package/dist/ui/ToolbarTop/ToolbarTop.stories.js +5 -2
- package/dist/ui/ToolbarTop/ToolbarTop.stories.sources.d.ts +1 -0
- package/dist/ui/ToolbarTop/ToolbarTop.stories.sources.d.ts.map +1 -1
- package/dist/ui/ToolbarTop/ToolbarTop.stories.sources.js +4 -1
- package/dist/ui/ToolbarTop/ToolbarTop.styles.d.ts +10 -10
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +4 -0
- package/package.json +12 -6
|
@@ -8,7 +8,7 @@ export declare const useStyles: () => {
|
|
|
8
8
|
flexDirection: "row";
|
|
9
9
|
justifyContent: "center";
|
|
10
10
|
alignItems: "center";
|
|
11
|
-
gap:
|
|
11
|
+
gap: string | number;
|
|
12
12
|
transitionProperty: "all";
|
|
13
13
|
transitionDuration: "150ms";
|
|
14
14
|
transitionTimingFunction: "ease";
|
|
@@ -119,45 +119,45 @@ export declare const useStyles: () => {
|
|
|
119
119
|
color: string;
|
|
120
120
|
};
|
|
121
121
|
xsContainer: {
|
|
122
|
-
paddingLeft:
|
|
123
|
-
paddingRight:
|
|
124
|
-
paddingTop:
|
|
125
|
-
paddingBottom:
|
|
122
|
+
paddingLeft: string | number;
|
|
123
|
+
paddingRight: string | number;
|
|
124
|
+
paddingTop: string | number;
|
|
125
|
+
paddingBottom: string | number;
|
|
126
126
|
borderTopLeftRadius: import("@alveole/theme").Radius;
|
|
127
127
|
borderBottomLeftRadius: import("@alveole/theme").Radius;
|
|
128
128
|
borderTopRightRadius: import("@alveole/theme").Radius;
|
|
129
129
|
borderBottomRightRadius: import("@alveole/theme").Radius;
|
|
130
130
|
};
|
|
131
131
|
smContainer: {
|
|
132
|
-
paddingLeft:
|
|
133
|
-
paddingRight:
|
|
134
|
-
paddingTop:
|
|
135
|
-
paddingBottom:
|
|
132
|
+
paddingLeft: string | number;
|
|
133
|
+
paddingRight: string | number;
|
|
134
|
+
paddingTop: string | number;
|
|
135
|
+
paddingBottom: string | number;
|
|
136
136
|
borderTopLeftRadius: import("@alveole/theme").Radius;
|
|
137
137
|
borderBottomLeftRadius: import("@alveole/theme").Radius;
|
|
138
138
|
borderTopRightRadius: import("@alveole/theme").Radius;
|
|
139
139
|
borderBottomRightRadius: import("@alveole/theme").Radius;
|
|
140
140
|
};
|
|
141
141
|
mdContainer: {
|
|
142
|
-
paddingLeft:
|
|
143
|
-
paddingRight:
|
|
142
|
+
paddingLeft: string | number;
|
|
143
|
+
paddingRight: string | number;
|
|
144
144
|
paddingTop: number;
|
|
145
145
|
paddingBottom: number;
|
|
146
146
|
};
|
|
147
147
|
lgContainer: {
|
|
148
|
-
paddingLeft:
|
|
149
|
-
paddingRight:
|
|
150
|
-
paddingTop:
|
|
151
|
-
paddingBottom:
|
|
148
|
+
paddingLeft: string | number;
|
|
149
|
+
paddingRight: string | number;
|
|
150
|
+
paddingTop: string | number;
|
|
151
|
+
paddingBottom: string | number;
|
|
152
152
|
};
|
|
153
153
|
smContainerIconOnly: {
|
|
154
|
-
padding:
|
|
154
|
+
padding: string | number;
|
|
155
155
|
};
|
|
156
156
|
mdContainerIconOnly: {
|
|
157
|
-
padding:
|
|
157
|
+
padding: string | number;
|
|
158
158
|
};
|
|
159
159
|
lgContainerIconOnly: {
|
|
160
|
-
padding:
|
|
160
|
+
padding: string | number;
|
|
161
161
|
};
|
|
162
162
|
xsTitle: {
|
|
163
163
|
readonly fontSize: 12;
|
|
@@ -188,22 +188,22 @@ export declare const useStyles: () => {
|
|
|
188
188
|
readonly fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
189
189
|
};
|
|
190
190
|
smContainerStartIcon: {
|
|
191
|
-
paddingLeft:
|
|
191
|
+
paddingLeft: string | number;
|
|
192
192
|
};
|
|
193
193
|
mdContainerStartIcon: {
|
|
194
|
-
paddingLeft:
|
|
194
|
+
paddingLeft: string | number;
|
|
195
195
|
};
|
|
196
196
|
lgContainerStartIcon: {
|
|
197
|
-
paddingLeft:
|
|
197
|
+
paddingLeft: string | number;
|
|
198
198
|
};
|
|
199
199
|
smContainerEndIcon: {
|
|
200
|
-
paddingRight:
|
|
200
|
+
paddingRight: string | number;
|
|
201
201
|
};
|
|
202
202
|
mdContainerEndIcon: {
|
|
203
|
-
paddingRight:
|
|
203
|
+
paddingRight: string | number;
|
|
204
204
|
};
|
|
205
205
|
lgContainerEndIcon: {
|
|
206
|
-
paddingRight:
|
|
206
|
+
paddingRight: string | number;
|
|
207
207
|
};
|
|
208
208
|
primaryTitleDisabled: {
|
|
209
209
|
cursor: "not-allowed";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { makeStyles } from '@alveole/theme';
|
|
2
|
-
export const useStyles = makeStyles(({ text, color, spacing, radius }) => ({
|
|
2
|
+
export const useStyles = makeStyles(({ text, color, spacing, spacingValue, radius }) => ({
|
|
3
3
|
container: {
|
|
4
4
|
borderTopLeftRadius: radius('md'),
|
|
5
5
|
borderBottomLeftRadius: radius('md'),
|
|
@@ -16,7 +16,7 @@ export const useStyles = makeStyles(({ text, color, spacing, radius }) => ({
|
|
|
16
16
|
},
|
|
17
17
|
buttonLoader: {
|
|
18
18
|
position: 'absolute',
|
|
19
|
-
right:
|
|
19
|
+
right: spacingValue('075'),
|
|
20
20
|
},
|
|
21
21
|
title: {
|
|
22
22
|
cursor: 'pointer',
|
|
@@ -13,14 +13,14 @@ declare const _default: {
|
|
|
13
13
|
cardSection: {
|
|
14
14
|
display: "flex";
|
|
15
15
|
flexDirection: "column";
|
|
16
|
-
gap:
|
|
16
|
+
gap: string | number;
|
|
17
17
|
width: "100%";
|
|
18
18
|
};
|
|
19
19
|
title: {
|
|
20
20
|
display: "flex";
|
|
21
21
|
flexDirection: "row";
|
|
22
22
|
alignItems: "center";
|
|
23
|
-
gap:
|
|
23
|
+
gap: string | number;
|
|
24
24
|
};
|
|
25
25
|
titleIcon: {
|
|
26
26
|
display: "flex";
|
|
@@ -38,7 +38,7 @@ declare const _default: {
|
|
|
38
38
|
display: "flex";
|
|
39
39
|
flexDirection: "row";
|
|
40
40
|
alignItems: "center";
|
|
41
|
-
gap:
|
|
41
|
+
gap: string | number;
|
|
42
42
|
};
|
|
43
43
|
descriptionIcon: {
|
|
44
44
|
display: "flex";
|
|
@@ -64,6 +64,7 @@ export declare const cardSection: () => import("react").JSX.Element;
|
|
|
64
64
|
export declare const cardSectionDisabled: () => import("react").JSX.Element;
|
|
65
65
|
export declare const cardHeader: () => import("react").JSX.Element;
|
|
66
66
|
export declare const cardHeaderDisabled: () => import("react").JSX.Element;
|
|
67
|
+
/** Privilégier l'utilisation de bouton en taille SM, avec le bouton primary toujours à droite. */
|
|
67
68
|
export declare const cardActions: () => import("react").JSX.Element;
|
|
68
69
|
export * as Sources from './Card.stories.sources';
|
|
69
70
|
//# sourceMappingURL=Card.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Card/Card.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAQkB;AAElB,eAAO,MAAM,IAAI,mCAgBhB,CAAC;AAEF,eAAO,MAAM,YAAY,mCA2BxB,CAAC;AAEF,eAAO,MAAM,WAAW,mCASvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,mCAU/B,CAAC;AAEF,eAAO,MAAM,UAAU,mCAgBtB,CAAC;AAEF,eAAO,MAAM,kBAAkB,mCAS9B,CAAC;AAEF,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Card.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Card/Card.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAQkB;AAElB,eAAO,MAAM,IAAI,mCAgBhB,CAAC;AAEF,eAAO,MAAM,YAAY,mCA2BxB,CAAC;AAEF,eAAO,MAAM,WAAW,mCASvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,mCAU/B,CAAC;AAEF,eAAO,MAAM,UAAU,mCAgBtB,CAAC;AAEF,eAAO,MAAM,kBAAkB,mCAS9B,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,WAAW,mCAOvB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box
|
|
2
|
+
import { Box } from '../../core';
|
|
3
3
|
import { Avatar } from '../Avatar';
|
|
4
4
|
import { Button } from '../Button';
|
|
5
5
|
import { LucideIcon } from '../LucideIcon';
|
|
@@ -32,7 +32,8 @@ export const cardHeader = () => {
|
|
|
32
32
|
export const cardHeaderDisabled = () => {
|
|
33
33
|
return (_jsx(Card.Header, { variant: "disabled", titre: "Titre de la carte", sousTitre: "Sous-titre de la carte", image: _jsx(Avatar, { size: "md", fallbackText: "M" }) }));
|
|
34
34
|
};
|
|
35
|
+
/** Privilégier l'utilisation de bouton en taille SM, avec le bouton primary toujours à droite. */
|
|
35
36
|
export const cardActions = () => {
|
|
36
|
-
return (_jsxs(
|
|
37
|
+
return (_jsxs(Card.Actions, { children: [_jsx(Button, { variant: "secondary", title: "Action", size: "sm" }), _jsx(Button, { variant: "primary", title: "Action", size: "sm" })] }));
|
|
37
38
|
};
|
|
38
39
|
export * as Sources from './Card.stories.sources';
|
|
@@ -15,4 +15,5 @@ export declare const storySources: {
|
|
|
15
15
|
readonly cardActions: () => string;
|
|
16
16
|
};
|
|
17
17
|
export type StorySourceName = keyof typeof storySources;
|
|
18
|
+
export declare const storyDescriptions: Partial<Record<StorySourceName, string>>;
|
|
18
19
|
//# sourceMappingURL=Card.stories.sources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Card/Card.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,cAAkqB,CAAC;AAEprB,eAAO,MAAM,YAAY,cAA61B,CAAC;AAEv3B,eAAO,MAAM,WAAW,cAA8O,CAAC;AAEvQ,eAAO,MAAM,mBAAmB,cAAkR,CAAC;AAEnT,eAAO,MAAM,UAAU,cAAye,CAAC;AAEjgB,eAAO,MAAM,kBAAkB,cAAwQ,CAAC;AAExS,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Card.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Card/Card.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,cAAkqB,CAAC;AAEprB,eAAO,MAAM,YAAY,cAA61B,CAAC;AAEv3B,eAAO,MAAM,WAAW,cAA8O,CAAC;AAEvQ,eAAO,MAAM,mBAAmB,cAAkR,CAAC;AAEnT,eAAO,MAAM,UAAU,cAAye,CAAC;AAEjgB,eAAO,MAAM,kBAAkB,cAAwQ,CAAC;AAExS,eAAO,MAAM,WAAW,cAAoP,CAAC;AAE7Q,eAAO,MAAM,YAAY;;;;;;;;CAQf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC;AAExD,eAAO,MAAM,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAEtE,CAAC"}
|
|
@@ -6,7 +6,7 @@ export const cardSection = () => "export const cardSection = () => {\n return (
|
|
|
6
6
|
export const cardSectionDisabled = () => "export const cardSectionDisabled = () => {\n return (\n <Card.Section\n variant=\"disabled\"\n titre=\"Titre de la carte\"\n description=\"Description de la carte\"\n titreIcone=\"Image\"\n descriptionIcone=\"Image\"\n />\n );\n};";
|
|
7
7
|
export const cardHeader = () => "export const cardHeader = () => {\n return (\n <Box display=\"flex\" flexDirection=\"column\" gap=\"100\">\n <Card.Header\n titre=\"Titre de la carte\"\n sousTitre=\"Sous-titre de la carte\"\n image={<Avatar size=\"md\" fallbackText=\"M\" />}\n />\n\n <Card.Header\n titre=\"Titre de la carte\"\n sousTitre=\"Sous-titre de la carte\"\n image={<LucideIcon name=\"Image\" size=\"md\" />}\n />\n </Box>\n );\n};";
|
|
8
8
|
export const cardHeaderDisabled = () => "export const cardHeaderDisabled = () => {\n return (\n <Card.Header\n variant=\"disabled\"\n titre=\"Titre de la carte\"\n sousTitre=\"Sous-titre de la carte\"\n image={<Avatar size=\"md\" fallbackText=\"M\" />}\n />\n );\n};";
|
|
9
|
-
export const cardActions = () => "export const cardActions = () => {\n return (\n <
|
|
9
|
+
export const cardActions = () => "export const cardActions = () => {\n return (\n <Card.Actions>\n <Button variant=\"secondary\" title=\"Action\" size=\"sm\" />\n <Button variant=\"primary\" title=\"Action\" size=\"sm\" />\n </Card.Actions>\n );\n};";
|
|
10
10
|
export const storySources = {
|
|
11
11
|
card,
|
|
12
12
|
cardDisabled,
|
|
@@ -16,3 +16,6 @@ export const storySources = {
|
|
|
16
16
|
cardHeaderDisabled,
|
|
17
17
|
cardActions,
|
|
18
18
|
};
|
|
19
|
+
export const storyDescriptions = {
|
|
20
|
+
cardActions: "Privilégier l'utilisation de bouton en taille SM, avec le bouton primary toujours à droite.",
|
|
21
|
+
};
|
|
@@ -2,8 +2,8 @@ export declare const useStyles: () => {
|
|
|
2
2
|
card: {
|
|
3
3
|
display: "flex";
|
|
4
4
|
width: "100%";
|
|
5
|
-
gap:
|
|
6
|
-
padding:
|
|
5
|
+
gap: string | number;
|
|
6
|
+
padding: string | number;
|
|
7
7
|
backgroundColor: string;
|
|
8
8
|
borderWidth: number;
|
|
9
9
|
borderColor: string;
|
|
@@ -2,14 +2,14 @@ export declare const useStyles: () => {
|
|
|
2
2
|
cardSection: {
|
|
3
3
|
display: "flex";
|
|
4
4
|
flexDirection: "column";
|
|
5
|
-
gap:
|
|
5
|
+
gap: string | number;
|
|
6
6
|
width: "100%";
|
|
7
7
|
};
|
|
8
8
|
title: {
|
|
9
9
|
display: "flex";
|
|
10
10
|
flexDirection: "row";
|
|
11
11
|
alignItems: "center";
|
|
12
|
-
gap:
|
|
12
|
+
gap: string | number;
|
|
13
13
|
};
|
|
14
14
|
titleIcon: {
|
|
15
15
|
display: "flex";
|
|
@@ -27,7 +27,7 @@ export declare const useStyles: () => {
|
|
|
27
27
|
display: "flex";
|
|
28
28
|
flexDirection: "row";
|
|
29
29
|
alignItems: "center";
|
|
30
|
-
gap:
|
|
30
|
+
gap: string | number;
|
|
31
31
|
};
|
|
32
32
|
descriptionIcon: {
|
|
33
33
|
display: "flex";
|
|
@@ -9,9 +9,9 @@ import { CheckboxLabel } from './CheckboxLabel';
|
|
|
9
9
|
export const Checkbox = React.forwardRef(function Checkbox(props, ref) {
|
|
10
10
|
const { variant, label, error, success, disabled, onCheckedChange } = props;
|
|
11
11
|
const baseProps = { variant, label, error, success, disabled, onCheckedChange };
|
|
12
|
-
const {
|
|
12
|
+
const { spacingValue } = useTheme();
|
|
13
13
|
const styles = useStyles();
|
|
14
14
|
const uniqId = useId();
|
|
15
15
|
const id = `checkbox--${variant}--${uniqId}`;
|
|
16
|
-
return (_jsxs(Box, { tag: "check-box-container", gap: error || success ?
|
|
16
|
+
return (_jsxs(Box, { tag: "check-box-container", gap: error || success ? spacingValue('050') : 0, style: styles.checkboxContainer, children: [_jsxs(Box, { tag: "check-box", style: styles.container, children: [_jsx(CheckboxContainer, { id: id, ref: ref, ...props, children: _jsx(CheckboxIndicator, { ...baseProps, indeterminate: props.checked === 'indeterminate' }) }), label && _jsx(CheckboxLabel, { htmlFor: id, ...baseProps })] }), (error ?? success) && _jsx(FormControlCaption, { error: error, success: success })] }));
|
|
17
17
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { makeStyles } from '@alveole/theme';
|
|
2
|
-
export const useStyles = makeStyles(({ text, color, spacing }) => ({
|
|
2
|
+
export const useStyles = makeStyles(({ text, color, spacing, spacingValue }) => ({
|
|
3
3
|
checkboxContainer: {
|
|
4
4
|
display: 'flex',
|
|
5
5
|
flexDirection: 'column',
|
|
@@ -10,15 +10,15 @@ export const useStyles = makeStyles(({ text, color, spacing }) => ({
|
|
|
10
10
|
gap: spacing('050'),
|
|
11
11
|
},
|
|
12
12
|
checkbox: {
|
|
13
|
-
height:
|
|
14
|
-
width:
|
|
13
|
+
height: spacingValue('150'),
|
|
14
|
+
width: spacingValue('150'),
|
|
15
15
|
backgroundColor: 'transparent',
|
|
16
16
|
borderColor: color.light.border['action-high-primary'],
|
|
17
17
|
borderRadius: 6,
|
|
18
18
|
},
|
|
19
19
|
checkboxSm: {
|
|
20
|
-
height:
|
|
21
|
-
width:
|
|
20
|
+
height: spacingValue('100'),
|
|
21
|
+
width: spacingValue('100'),
|
|
22
22
|
borderRadius: 4,
|
|
23
23
|
},
|
|
24
24
|
checkboxDisabled: {
|
|
@@ -32,8 +32,8 @@ export const useStyles = makeStyles(({ text, color, spacing }) => ({
|
|
|
32
32
|
borderColor: color.border['plain-success'],
|
|
33
33
|
},
|
|
34
34
|
indicator: {
|
|
35
|
-
height:
|
|
36
|
-
width:
|
|
35
|
+
height: spacingValue('150'),
|
|
36
|
+
width: spacingValue('150'),
|
|
37
37
|
backgroundColor: color.light.background['action-high-primary'],
|
|
38
38
|
borderRadius: 6,
|
|
39
39
|
},
|
|
@@ -12,8 +12,8 @@ declare const _default: {
|
|
|
12
12
|
letterSpacing: 0;
|
|
13
13
|
fontFamily: string;
|
|
14
14
|
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
15
|
-
paddingRight:
|
|
16
|
-
paddingLeft:
|
|
15
|
+
paddingRight: string | number;
|
|
16
|
+
paddingLeft: string | number;
|
|
17
17
|
backgroundColor: string;
|
|
18
18
|
borderRadius: import("@alveole/theme").Radius;
|
|
19
19
|
};
|
|
@@ -5,8 +5,8 @@ export declare const useStyles: () => {
|
|
|
5
5
|
letterSpacing: 0;
|
|
6
6
|
fontFamily: string;
|
|
7
7
|
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
8
|
-
paddingRight:
|
|
9
|
-
paddingLeft:
|
|
8
|
+
paddingRight: string | number;
|
|
9
|
+
paddingLeft: string | number;
|
|
10
10
|
backgroundColor: string;
|
|
11
11
|
borderRadius: import("@alveole/theme").Radius;
|
|
12
12
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FormControlCaptionProps, FormControlHintProps, FormControlLabelProps, TextInputProps } from '@alveole/components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type MinuteInterval = 1 | 2 | 3 | 4 | 5 | 6 | 10 | 12 | 15 | 20 | 30;
|
|
4
|
+
export type DateInputProps = TextInputProps & FormControlLabelProps & FormControlHintProps & FormControlCaptionProps & {
|
|
5
|
+
type?: 'date' | 'datetime' | 'month';
|
|
6
|
+
display?: 'default' | 'spinner';
|
|
7
|
+
value?: string;
|
|
8
|
+
minimumDate?: Date;
|
|
9
|
+
maximumDate?: Date;
|
|
10
|
+
onChange?: (date: string) => void;
|
|
11
|
+
is24Hour?: boolean;
|
|
12
|
+
minuteInterval?: MinuteInterval;
|
|
13
|
+
};
|
|
14
|
+
export declare const DateInput: React.ForwardRefExoticComponent<Omit<import("react-native").TextInputProps, "style"> & {
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
startAdornment?: React.ReactNode;
|
|
17
|
+
endAdornment?: React.ReactNode;
|
|
18
|
+
openModal?: boolean;
|
|
19
|
+
modalSubmitLabel?: string;
|
|
20
|
+
onModalSubmit?: () => void;
|
|
21
|
+
} & {
|
|
22
|
+
label: string;
|
|
23
|
+
labelRight?: React.ReactNode;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
} & FormControlCaptionProps & FormControlHintProps & {
|
|
26
|
+
type?: "date" | "datetime" | "month";
|
|
27
|
+
display?: "default" | "spinner";
|
|
28
|
+
value?: string;
|
|
29
|
+
minimumDate?: Date;
|
|
30
|
+
maximumDate?: Date;
|
|
31
|
+
onChange?: (date: string) => void;
|
|
32
|
+
is24Hour?: boolean;
|
|
33
|
+
minuteInterval?: MinuteInterval;
|
|
34
|
+
} & React.RefAttributes<any>>;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=DateInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/ui/DateInput/DateInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EAGrB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAyC,MAAM,OAAO,CAAC;AAI9D,KAAK,cAAc,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAErE,MAAM,MAAM,cAAc,GAAG,cAAc,GACzC,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEJ,eAAO,MAAM,SAAS;;;;;;;;;;;;WAVX,MAAM,GAAG,UAAU,GAAG,OAAO;cAC1B,SAAS,GAAG,SAAS;YACvB,MAAM;kBACA,IAAI;kBACJ,IAAI;eACP,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;eACtB,OAAO;qBACD,cAAc;6BA2IjC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const DateInput: React.ForwardRefExoticComponent<Omit<import("react-native").TextInputProps, "style"> & {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
startAdornment?: React.ReactNode;
|
|
5
|
+
endAdornment?: React.ReactNode;
|
|
6
|
+
openModal?: boolean;
|
|
7
|
+
modalSubmitLabel?: string;
|
|
8
|
+
onModalSubmit?: () => void;
|
|
9
|
+
} & {
|
|
10
|
+
label: string;
|
|
11
|
+
labelRight?: React.ReactNode;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
} & import("@alveole/components").FormControlCaptionProps & import("@alveole/components").FormControlHintProps & {
|
|
14
|
+
type?: "date" | "datetime" | "month";
|
|
15
|
+
display?: "default" | "spinner";
|
|
16
|
+
value?: string;
|
|
17
|
+
minimumDate?: Date;
|
|
18
|
+
maximumDate?: Date;
|
|
19
|
+
onChange?: (date: string) => void;
|
|
20
|
+
is24Hour?: boolean;
|
|
21
|
+
minuteInterval?: 1 | 6 | 4 | 12 | 2 | 10 | 3 | 5 | 15 | 20 | 30;
|
|
22
|
+
} & React.RefAttributes<any>>;
|
|
23
|
+
//# sourceMappingURL=DateInput.ios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateInput.ios.d.ts","sourceRoot":"","sources":["../../../src/ui/DateInput/DateInput.ios.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAU3C,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;6BAuGpB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, FormControl, FormControlCaption, FormControlHint, FormControlLabel, InputHeading, TextInput, } from '@alveole/components';
|
|
3
|
+
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
4
|
+
import { toDate } from 'date-fns';
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
|
+
import { Keyboard, Platform } from 'react-native';
|
|
7
|
+
import { FormControlModal } from '../FormControl';
|
|
8
|
+
import { DateFormats, displayDate, isValidDate } from './dateUtils';
|
|
9
|
+
const toDateString = (date, datetime) => displayDate(date, { format: datetime ? DateFormats.DateTimeString : DateFormats.DateString });
|
|
10
|
+
export const DateInput = React.forwardRef(function DateInput(props, ref) {
|
|
11
|
+
const { label, labelRight, hint, error, success, placeholder, disabled, value, type = 'date', maximumDate, minimumDate, minuteInterval = 1, onChange, is24Hour, ...inputProps } = props;
|
|
12
|
+
const [open, setOpen] = React.useState(false);
|
|
13
|
+
const now = new Date();
|
|
14
|
+
const defaultDateString = value ?? toDateString(now, type === 'datetime');
|
|
15
|
+
const [date, setDate] = React.useState(defaultDateString);
|
|
16
|
+
const handleChange = (_event, newDate) => {
|
|
17
|
+
if (isValidDate(newDate)) {
|
|
18
|
+
if (type === 'date')
|
|
19
|
+
setDate(toDateString(newDate));
|
|
20
|
+
else if (type === 'datetime')
|
|
21
|
+
setDate(displayDate(newDate, { format: DateFormats.DateTimeString }));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const handleOpen = useCallback(() => {
|
|
25
|
+
if (!disabled) {
|
|
26
|
+
Keyboard.dismiss();
|
|
27
|
+
setOpen(true);
|
|
28
|
+
}
|
|
29
|
+
}, [disabled]);
|
|
30
|
+
const handleValidate = useCallback(() => {
|
|
31
|
+
if (isValidDate(date))
|
|
32
|
+
onChange?.(date);
|
|
33
|
+
setOpen(false);
|
|
34
|
+
}, [date, onChange]);
|
|
35
|
+
const displayValue = useCallback((currentValue) => {
|
|
36
|
+
if (currentValue) {
|
|
37
|
+
if (type === 'datetime')
|
|
38
|
+
return displayDate(toDate(currentValue), { format: DateFormats.Datetime });
|
|
39
|
+
else
|
|
40
|
+
return displayDate(toDate(currentValue), { format: DateFormats.DateSlash });
|
|
41
|
+
}
|
|
42
|
+
return '';
|
|
43
|
+
}, [type]);
|
|
44
|
+
return (_jsxs(Box, { tag: "date-input", onPress: handleOpen, children: [_jsx(FormControlModal, { open: open, onClose: () => setOpen(false), submitLabel: "Valider", onSubmit: handleValidate, children: _jsx(Box, { style: { marginTop: 'auto' }, children: _jsx(DateTimePicker, { value: toDate(date), mode: type === 'month' ? 'date' : type, locale: 'fr', maximumDate: maximumDate, minimumDate: minimumDate, is24Hour: is24Hour, minuteInterval: minuteInterval, themeVariant: "light", display: Platform.OS === 'ios' ? 'spinner' : 'default', onChange: handleChange }) }) }), _jsxs(FormControl, { children: [_jsxs(InputHeading, { children: [label && (_jsx(FormControlLabel, { labelRight: labelRight, label: label, disabled: disabled, error: error, success: success })), hint && _jsx(FormControlHint, { hint: hint, disabled: disabled })] }), _jsx(TextInput, { ref: ref, placeholder: "JJ/MM/AAAA", value: displayValue(value), ...inputProps, caretHidden: true, inputMode: "none", onPress: handleOpen, readOnly: true }), (error || success) && _jsx(FormControlCaption, { error: error, success: success })] })] }));
|
|
45
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, FormControl, FormControlCaption, FormControlHint, FormControlLabel, InputHeading, TextInput, } from '@alveole/components';
|
|
3
|
+
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
4
|
+
import { getHours, getMinutes, setHours, setMinutes } from 'date-fns';
|
|
5
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
6
|
+
import { Keyboard } from 'react-native';
|
|
7
|
+
import { DateFormats, displayDate, isValidDate } from './dateUtils';
|
|
8
|
+
export const DateInput = React.forwardRef(function DateInput({ label, labelRight, hint, error, success, placeholder, disabled, value, maximumDate, minimumDate, minuteInterval = 1, is24Hour, display, type = 'date', onChange, ...props }, ref) {
|
|
9
|
+
const [showPicker, setShowPicker] = useState(false);
|
|
10
|
+
const [isHours, setIsHours] = useState(false);
|
|
11
|
+
const selectedDate = React.useMemo(() => (value ? new Date(value) : new Date()), [value]);
|
|
12
|
+
const mode = useMemo(() => {
|
|
13
|
+
if (type === 'date')
|
|
14
|
+
return type;
|
|
15
|
+
if (isHours)
|
|
16
|
+
return 'time';
|
|
17
|
+
return 'date';
|
|
18
|
+
}, [isHours, type]);
|
|
19
|
+
const handleChange = (event, date) => {
|
|
20
|
+
if (event.type === 'dismissed') {
|
|
21
|
+
setIsHours(false);
|
|
22
|
+
setShowPicker(false);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (event.type === 'set' && isValidDate(date)) {
|
|
26
|
+
setShowPicker(false);
|
|
27
|
+
if (type === 'datetime' && !isHours) {
|
|
28
|
+
const currentHours = getHours(new Date());
|
|
29
|
+
const currentMinutes = getMinutes(new Date());
|
|
30
|
+
const newDate = displayDate(setMinutes(setHours(date, currentHours), currentMinutes), {
|
|
31
|
+
format: DateFormats.DateTimeString,
|
|
32
|
+
});
|
|
33
|
+
onChange?.(newDate);
|
|
34
|
+
setIsHours(true);
|
|
35
|
+
setShowPicker(true);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
else if (type === 'datetime') {
|
|
39
|
+
const newDate = displayDate(setMinutes(setHours(selectedDate, getHours(date)), getMinutes(date)), {
|
|
40
|
+
format: DateFormats.DateTimeString,
|
|
41
|
+
});
|
|
42
|
+
onChange?.(newDate);
|
|
43
|
+
setIsHours(false);
|
|
44
|
+
setShowPicker(false);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const newDate = displayDate(date, { format: DateFormats.DateString });
|
|
48
|
+
onChange?.(newDate);
|
|
49
|
+
setIsHours(false);
|
|
50
|
+
setShowPicker(false);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const handleOpen = React.useCallback(() => {
|
|
54
|
+
if (!disabled) {
|
|
55
|
+
Keyboard.dismiss();
|
|
56
|
+
setShowPicker(true);
|
|
57
|
+
}
|
|
58
|
+
}, [disabled]);
|
|
59
|
+
const displayValue = useCallback((value) => {
|
|
60
|
+
if (type === 'datetime') {
|
|
61
|
+
if (value == null)
|
|
62
|
+
return 'Sélectionnez une date';
|
|
63
|
+
return displayDate(selectedDate, { format: DateFormats.Datetime });
|
|
64
|
+
}
|
|
65
|
+
if (value == null)
|
|
66
|
+
return 'JJ/MM/AAAA';
|
|
67
|
+
return displayDate(selectedDate, { format: DateFormats.DateSlash });
|
|
68
|
+
}, [selectedDate, type]);
|
|
69
|
+
return (_jsx(Box, { tag: "date-input", onPress: handleOpen, children: _jsxs(FormControl, { children: [_jsxs(InputHeading, { children: [label && (_jsx(FormControlLabel, { labelRight: labelRight, label: label, disabled: disabled, error: error, success: success })), hint && _jsx(FormControlHint, { hint: hint, disabled: disabled })] }), _jsx(TextInput, { ref: ref, placeholder: "JJ/MM/AAAA", value: displayValue(value), ...props, readOnly: true, onPress: handleOpen, caretHidden: true, inputMode: "none" }), showPicker && (_jsx(DateTimePicker, { value: selectedDate, mode: mode, locale: 'fr', display: display ?? 'default', maximumDate: maximumDate, minimumDate: minimumDate, onChange: handleChange, is24Hour: is24Hour, minuteInterval: minuteInterval })), (error || success) && _jsx(FormControlCaption, { error: error, success: success })] }) }));
|
|
70
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
tags: "ui"[];
|
|
5
|
+
experimental: true;
|
|
6
|
+
description: string;
|
|
7
|
+
component: React.ForwardRefExoticComponent<Omit<import("react-native").TextInputProps, "style"> & {
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
startAdornment?: React.ReactNode;
|
|
10
|
+
endAdornment?: React.ReactNode;
|
|
11
|
+
openModal?: boolean;
|
|
12
|
+
modalSubmitLabel?: string;
|
|
13
|
+
onModalSubmit?: () => void;
|
|
14
|
+
} & {
|
|
15
|
+
label: string;
|
|
16
|
+
labelRight?: React.ReactNode;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
} & import("..").FormControlCaptionProps & import("..").FormControlHintProps & {
|
|
19
|
+
type?: "date" | "datetime" | "month";
|
|
20
|
+
display?: "default" | "spinner";
|
|
21
|
+
value?: string;
|
|
22
|
+
minimumDate?: Date;
|
|
23
|
+
maximumDate?: Date;
|
|
24
|
+
onChange?: (date: string) => void;
|
|
25
|
+
is24Hour?: boolean;
|
|
26
|
+
minuteInterval?: 1 | 6 | 4 | 12 | 2 | 10 | 3 | 5 | 15 | 20 | 30;
|
|
27
|
+
} & React.RefAttributes<any>>;
|
|
28
|
+
styleFn: () => {
|
|
29
|
+
dateInput: {};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export default _default;
|
|
33
|
+
export declare const Default: () => React.JSX.Element;
|
|
34
|
+
export declare const Types: () => React.JSX.Element;
|
|
35
|
+
export * as Sources from './DateInput.stories.sources';
|
|
36
|
+
//# sourceMappingURL=DateInput.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateInput.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/DateInput/DateInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAO1B,wBAOkB;AAElB,eAAO,MAAM,OAAO,yBAcnB,CAAC;AAEF,eAAO,MAAM,KAAK,yBAsBjB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Box } from '../../core';
|
|
4
|
+
import { Grid } from '../Grid';
|
|
5
|
+
import { DateInput } from './DateInput';
|
|
6
|
+
import { useStyles } from './DateInput.styles';
|
|
7
|
+
export default {
|
|
8
|
+
title: 'DateInput',
|
|
9
|
+
tags: ['ui'],
|
|
10
|
+
experimental: true,
|
|
11
|
+
description: 'Champs de saisie de date.',
|
|
12
|
+
component: DateInput,
|
|
13
|
+
styleFn: useStyles,
|
|
14
|
+
};
|
|
15
|
+
export const Default = () => (_jsx(Box, { width: '100%', children: _jsxs(Grid, { gap: 8, children: [_jsx(Grid.Column, { size: { desktop: 6, mobile: 12 }, children: _jsx(DateInput, { label: "Default", onChange: console.log }) }), _jsx(Grid.Column, { size: { desktop: 6, mobile: 12 }, children: _jsx(DateInput, { label: "Error", onChange: console.log, error: "Une erreur" }) }), _jsx(Grid.Column, { size: { desktop: 6, mobile: 12 }, children: _jsx(DateInput, { label: "Disabled", onChange: console.log, disabled: true }) })] }) }));
|
|
16
|
+
export const Types = () => {
|
|
17
|
+
const [date, setDate] = React.useState();
|
|
18
|
+
const [datetime, setDatetime] = React.useState();
|
|
19
|
+
return (_jsx(Box, { width: '100%', children: _jsxs(Grid, { gap: 8, children: [_jsx(Grid.Column, { size: { desktop: 6, mobile: 12 }, children: _jsx(DateInput, { value: date, label: "Date (default)", onChange: e => setDate(e.toString()) }) }), _jsx(Grid.Column, { size: { desktop: 6, mobile: 12 }, children: _jsx(DateInput, { value: datetime, label: "Datetime", type: "datetime", is24Hour: true, onChange: e => setDatetime(e.toString()) }) })] }) }));
|
|
20
|
+
};
|
|
21
|
+
export * as Sources from './DateInput.stories.sources';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const Default: () => string;
|
|
2
|
+
export declare const Types: () => string;
|
|
3
|
+
export declare const storySources: {
|
|
4
|
+
readonly Default: () => string;
|
|
5
|
+
readonly Types: () => string;
|
|
6
|
+
};
|
|
7
|
+
export type StorySourceName = keyof typeof storySources;
|
|
8
|
+
//# sourceMappingURL=DateInput.stories.sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateInput.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/DateInput/DateInput.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAAojB,CAAC;AAEzkB,eAAO,MAAM,KAAK,cAAitB,CAAC;AAEpuB,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|