@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
package/dist/ui/Switch/Switch.js
CHANGED
|
@@ -10,7 +10,7 @@ export const Switch = React.forwardRef(function Switch(props, ref) {
|
|
|
10
10
|
const isControlled = checked !== undefined;
|
|
11
11
|
const [model, setModel] = React.useState(Boolean(checked));
|
|
12
12
|
const value = isControlled ? checked : model;
|
|
13
|
-
const {
|
|
13
|
+
const { spacingValue } = useTheme();
|
|
14
14
|
const styles = useStyles();
|
|
15
15
|
const uniqId = useId();
|
|
16
16
|
id = id || `switch--${uniqId}`;
|
|
@@ -38,5 +38,5 @@ export const Switch = React.forwardRef(function Switch(props, ref) {
|
|
|
38
38
|
};
|
|
39
39
|
const Toggle = (_jsx(TamaguiSwitch, { id: id, ref: ref, borderWidth: 1, checked: value, onCheckedChange: onChange, style: switchButtonStyles, disabled: disabled, ...switchProps, children: _jsx(TamaguiSwitch.Thumb, { animation: "quicker", style: switchThumbStyles }) }));
|
|
40
40
|
const ToggleWithLabel = (_jsxs(_Fragment, { children: [_jsx(Label, { unstyled: true, htmlFor: id, width: '100%', children: _jsxs(Box, { tag: "switch", style: styles.switch, children: [Toggle, label && (_jsx(Typography, { htmlFor: id, style: switchLabelStyles, children: label }))] }) }), (error ?? success) && _jsx(FormControlCaption, { error: error, success: success })] }));
|
|
41
|
-
return (_jsx(Box, { tag: "switch", gap: error || success ?
|
|
41
|
+
return (_jsx(Box, { tag: "switch", gap: error || success ? spacingValue('050') : 0, style: styles.switchContainer, children: !label ? Toggle : ToggleWithLabel }));
|
|
42
42
|
});
|
|
@@ -16,15 +16,15 @@ declare const _default: {
|
|
|
16
16
|
switch: {
|
|
17
17
|
display: "flex";
|
|
18
18
|
flexDirection: "row";
|
|
19
|
-
gap:
|
|
20
|
-
paddingRight:
|
|
19
|
+
gap: string | number;
|
|
20
|
+
paddingRight: string | number;
|
|
21
21
|
};
|
|
22
22
|
switchButton: {
|
|
23
23
|
borderColor: string;
|
|
24
24
|
backgroundColor: string;
|
|
25
25
|
cursor: "pointer";
|
|
26
26
|
padding: number;
|
|
27
|
-
minHeight:
|
|
27
|
+
minHeight: string | number;
|
|
28
28
|
marginTop: string;
|
|
29
29
|
marginBottom: string;
|
|
30
30
|
};
|
|
@@ -3,15 +3,15 @@ export declare const useStyles: () => {
|
|
|
3
3
|
switch: {
|
|
4
4
|
display: "flex";
|
|
5
5
|
flexDirection: "row";
|
|
6
|
-
gap:
|
|
7
|
-
paddingRight:
|
|
6
|
+
gap: string | number;
|
|
7
|
+
paddingRight: string | number;
|
|
8
8
|
};
|
|
9
9
|
switchButton: {
|
|
10
10
|
borderColor: string;
|
|
11
11
|
backgroundColor: string;
|
|
12
12
|
cursor: "pointer";
|
|
13
13
|
padding: number;
|
|
14
|
-
minHeight:
|
|
14
|
+
minHeight: string | number;
|
|
15
15
|
marginTop: string;
|
|
16
16
|
marginBottom: string;
|
|
17
17
|
};
|
|
@@ -12,7 +12,7 @@ declare const _default: {
|
|
|
12
12
|
minHeight: number;
|
|
13
13
|
display: "flex";
|
|
14
14
|
flexDirection: "column";
|
|
15
|
-
gap:
|
|
15
|
+
gap: string | number;
|
|
16
16
|
};
|
|
17
17
|
tabs: {
|
|
18
18
|
flex: number;
|
|
@@ -20,9 +20,9 @@ declare const _default: {
|
|
|
20
20
|
flexDirection: "column";
|
|
21
21
|
};
|
|
22
22
|
tabsList: {
|
|
23
|
-
borderBottomLeftRadius:
|
|
24
|
-
borderBottomRightRadius:
|
|
25
|
-
gap:
|
|
23
|
+
borderBottomLeftRadius: string | number;
|
|
24
|
+
borderBottomRightRadius: string | number;
|
|
25
|
+
gap: string | number;
|
|
26
26
|
boxSizing: "border-box";
|
|
27
27
|
borderColor: string;
|
|
28
28
|
borderBottomWidth: number;
|
|
@@ -33,8 +33,8 @@ declare const _default: {
|
|
|
33
33
|
appearance: "none";
|
|
34
34
|
backgroundColor: "transparent";
|
|
35
35
|
cursor: "pointer";
|
|
36
|
-
paddingTop:
|
|
37
|
-
paddingBottom:
|
|
36
|
+
paddingTop: string | number;
|
|
37
|
+
paddingBottom: string | number;
|
|
38
38
|
paddingLeft: number;
|
|
39
39
|
paddingRight: number;
|
|
40
40
|
boxSizing: "border-box";
|
|
@@ -43,7 +43,7 @@ declare const _default: {
|
|
|
43
43
|
borderBottomColor: "transparent";
|
|
44
44
|
display: "flex";
|
|
45
45
|
alignItems: "center";
|
|
46
|
-
gap:
|
|
46
|
+
gap: string | number;
|
|
47
47
|
};
|
|
48
48
|
tabsTabActive: {
|
|
49
49
|
borderBottomColor: string;
|
|
@@ -62,11 +62,11 @@ declare const _default: {
|
|
|
62
62
|
transitionProperty: "all";
|
|
63
63
|
transitionDuration: "0.1s";
|
|
64
64
|
transitionTimingFunction: "ease-in-out";
|
|
65
|
-
gap:
|
|
66
|
-
paddingTop:
|
|
67
|
-
paddingBottom:
|
|
68
|
-
paddingLeft:
|
|
69
|
-
paddingRight:
|
|
65
|
+
gap: string | number;
|
|
66
|
+
paddingTop: string | number;
|
|
67
|
+
paddingBottom: string | number;
|
|
68
|
+
paddingLeft: string | number;
|
|
69
|
+
paddingRight: string | number;
|
|
70
70
|
borderRadius: import("@alveole/theme").Radius;
|
|
71
71
|
};
|
|
72
72
|
tabIcon: {
|
|
@@ -4,7 +4,7 @@ export declare const useStyles: () => {
|
|
|
4
4
|
minHeight: number;
|
|
5
5
|
display: "flex";
|
|
6
6
|
flexDirection: "column";
|
|
7
|
-
gap:
|
|
7
|
+
gap: string | number;
|
|
8
8
|
};
|
|
9
9
|
tabs: {
|
|
10
10
|
flex: number;
|
|
@@ -12,9 +12,9 @@ export declare const useStyles: () => {
|
|
|
12
12
|
flexDirection: "column";
|
|
13
13
|
};
|
|
14
14
|
tabsList: {
|
|
15
|
-
borderBottomLeftRadius:
|
|
16
|
-
borderBottomRightRadius:
|
|
17
|
-
gap:
|
|
15
|
+
borderBottomLeftRadius: string | number;
|
|
16
|
+
borderBottomRightRadius: string | number;
|
|
17
|
+
gap: string | number;
|
|
18
18
|
boxSizing: "border-box";
|
|
19
19
|
borderColor: string;
|
|
20
20
|
borderBottomWidth: number;
|
|
@@ -25,8 +25,8 @@ export declare const useStyles: () => {
|
|
|
25
25
|
appearance: "none";
|
|
26
26
|
backgroundColor: "transparent";
|
|
27
27
|
cursor: "pointer";
|
|
28
|
-
paddingTop:
|
|
29
|
-
paddingBottom:
|
|
28
|
+
paddingTop: string | number;
|
|
29
|
+
paddingBottom: string | number;
|
|
30
30
|
paddingLeft: number;
|
|
31
31
|
paddingRight: number;
|
|
32
32
|
boxSizing: "border-box";
|
|
@@ -35,7 +35,7 @@ export declare const useStyles: () => {
|
|
|
35
35
|
borderBottomColor: "transparent";
|
|
36
36
|
display: "flex";
|
|
37
37
|
alignItems: "center";
|
|
38
|
-
gap:
|
|
38
|
+
gap: string | number;
|
|
39
39
|
};
|
|
40
40
|
tabsTabActive: {
|
|
41
41
|
borderBottomColor: string;
|
|
@@ -54,11 +54,11 @@ export declare const useStyles: () => {
|
|
|
54
54
|
transitionProperty: "all";
|
|
55
55
|
transitionDuration: "0.1s";
|
|
56
56
|
transitionTimingFunction: "ease-in-out";
|
|
57
|
-
gap:
|
|
58
|
-
paddingTop:
|
|
59
|
-
paddingBottom:
|
|
60
|
-
paddingLeft:
|
|
61
|
-
paddingRight:
|
|
57
|
+
gap: string | number;
|
|
58
|
+
paddingTop: string | number;
|
|
59
|
+
paddingBottom: string | number;
|
|
60
|
+
paddingLeft: string | number;
|
|
61
|
+
paddingRight: string | number;
|
|
62
62
|
borderRadius: import("@alveole/theme").Radius;
|
|
63
63
|
};
|
|
64
64
|
tabIcon: {
|
package/dist/ui/Tag/Tag.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../src/ui/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../src/ui/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI7C,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAC7C,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,OAAO,QAAQ,sBAsBlC,CAAC"}
|
|
@@ -26,8 +26,8 @@ declare const _default: {
|
|
|
26
26
|
letterSpacing: 0;
|
|
27
27
|
fontFamily: string;
|
|
28
28
|
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
29
|
-
paddingLeft:
|
|
30
|
-
paddingRight:
|
|
29
|
+
paddingLeft: string | number;
|
|
30
|
+
paddingRight: string | number;
|
|
31
31
|
paddingTop: number;
|
|
32
32
|
paddingBottom: number;
|
|
33
33
|
};
|
|
@@ -37,10 +37,10 @@ declare const _default: {
|
|
|
37
37
|
letterSpacing: 0;
|
|
38
38
|
fontFamily: string;
|
|
39
39
|
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
40
|
-
paddingLeft:
|
|
41
|
-
paddingRight:
|
|
42
|
-
paddingTop:
|
|
43
|
-
paddingBottom:
|
|
40
|
+
paddingLeft: string | number;
|
|
41
|
+
paddingRight: string | number;
|
|
42
|
+
paddingTop: string | number;
|
|
43
|
+
paddingBottom: string | number;
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
46
|
};
|
|
@@ -19,8 +19,8 @@ export declare const useStyles: () => {
|
|
|
19
19
|
letterSpacing: 0;
|
|
20
20
|
fontFamily: string;
|
|
21
21
|
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
22
|
-
paddingLeft:
|
|
23
|
-
paddingRight:
|
|
22
|
+
paddingLeft: string | number;
|
|
23
|
+
paddingRight: string | number;
|
|
24
24
|
paddingTop: number;
|
|
25
25
|
paddingBottom: number;
|
|
26
26
|
};
|
|
@@ -30,10 +30,10 @@ export declare const useStyles: () => {
|
|
|
30
30
|
letterSpacing: 0;
|
|
31
31
|
fontFamily: string;
|
|
32
32
|
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
33
|
-
paddingLeft:
|
|
34
|
-
paddingRight:
|
|
35
|
-
paddingTop:
|
|
36
|
-
paddingBottom:
|
|
33
|
+
paddingLeft: string | number;
|
|
34
|
+
paddingRight: string | number;
|
|
35
|
+
paddingTop: string | number;
|
|
36
|
+
paddingBottom: string | number;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
//# sourceMappingURL=Tag.styles.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FormControlCaptionProps, FormControlHintProps, FormControlLabelProps } from '@alveole/components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type TimeInputProps = FormControlLabelProps & FormControlHintProps & FormControlCaptionProps & {
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
onBlur?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const TimeInput: React.ForwardRefExoticComponent<{
|
|
10
|
+
label: string;
|
|
11
|
+
labelRight?: React.ReactNode;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
} & FormControlCaptionProps & FormControlHintProps & {
|
|
14
|
+
value?: string;
|
|
15
|
+
onChange?: (value: string) => void;
|
|
16
|
+
onBlur?: () => void;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
} & React.RefAttributes<any>>;
|
|
19
|
+
//# sourceMappingURL=TimeInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeInput.d.ts","sourceRoot":"","sources":["../../../src/ui/TimeInput/TimeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EAGtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,cAAc,GAAG,qBAAqB,GAChD,oBAAoB,GACpB,uBAAuB,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ,eAAO,MAAM,SAAS;;;;;YANV,MAAM;eACH,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;aACzB,MAAM,IAAI;eACR,OAAO;6BA4DpB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl, FormControlCaption, FormControlHint, FormControlLabel, InputHeading, TextInput, } from '@alveole/components';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export const TimeInput = React.forwardRef(function TimeInput({ label, labelRight, hint, error, success, value, onChange, onBlur, disabled }, ref) {
|
|
5
|
+
const [localValue, setLocalValue] = React.useState(value ?? '');
|
|
6
|
+
React.useEffect(() => {
|
|
7
|
+
setLocalValue(value ?? '');
|
|
8
|
+
}, [value]);
|
|
9
|
+
const handleChangeText = (text) => {
|
|
10
|
+
const digits = text.replace(/\D/g, '').slice(0, 4);
|
|
11
|
+
let formatted;
|
|
12
|
+
if (digits.length === 1 && parseInt(digits) >= 3) {
|
|
13
|
+
// Premier chiffre ≥ 3 : les heures ne peuvent pas dépasser 23, donc on préfixe '0'
|
|
14
|
+
formatted = `0${digits}:`;
|
|
15
|
+
}
|
|
16
|
+
else if (digits.length <= 2) {
|
|
17
|
+
formatted = digits;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
formatted = `${digits.slice(0, 2)}:${digits.slice(2)}`;
|
|
21
|
+
}
|
|
22
|
+
setLocalValue(formatted);
|
|
23
|
+
if (digits.length === 0 || digits.length === 4) {
|
|
24
|
+
onChange?.(formatted);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const handleBlur = () => {
|
|
28
|
+
onChange?.(localValue);
|
|
29
|
+
onBlur?.();
|
|
30
|
+
};
|
|
31
|
+
return (_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: "HH:MM", value: localValue, onChangeText: handleChangeText, onBlur: handleBlur, disabled: disabled, keyboardType: "number-pad", maxLength: 5 }), (error || success) && _jsx(FormControlCaption, { error: error, success: success })] }));
|
|
32
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
tags: "ui"[];
|
|
4
|
+
experimental: false;
|
|
5
|
+
shortDescription: string;
|
|
6
|
+
description: string;
|
|
7
|
+
component: import("react").ForwardRefExoticComponent<{
|
|
8
|
+
label: string;
|
|
9
|
+
labelRight?: React.ReactNode;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
} & import("..").FormControlCaptionProps & import("..").FormControlHintProps & {
|
|
12
|
+
value?: string;
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
onBlur?: () => void;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
} & import("react").RefAttributes<any>>;
|
|
17
|
+
styleFn: () => {
|
|
18
|
+
timeInput: {};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
22
|
+
export declare const Default: () => import("react").JSX.Element;
|
|
23
|
+
export declare const States: () => import("react").JSX.Element;
|
|
24
|
+
export * as Sources from './TimeInput.stories.sources';
|
|
25
|
+
//# sourceMappingURL=TimeInput.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeInput.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/TimeInput/TimeInput.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAMA,wBAiBkB;AAElB,eAAO,MAAM,OAAO,mCAcnB,CAAC;AAEF,eAAO,MAAM,MAAM,mCAclB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '../../core';
|
|
3
|
+
import { Grid } from '../Grid';
|
|
4
|
+
import { TimeInput } from './TimeInput';
|
|
5
|
+
import { useStyles } from './TimeInput.styles';
|
|
6
|
+
export default {
|
|
7
|
+
title: 'TimeInput',
|
|
8
|
+
tags: ['ui'],
|
|
9
|
+
experimental: false,
|
|
10
|
+
shortDescription: "Saisie d'une heure d'horloge au format HH:MM (ex. 09:30 pour 9h30 du matin).",
|
|
11
|
+
description: `Saisie d'une **heure d'horloge** au format HH:MM (ex. \`09:30\` pour 9h30 du matin).
|
|
12
|
+
|
|
13
|
+
À ne pas confondre avec **DurationInput**, qui représente une **durée écoulée** (ex. \`06:15\` pour 6 heures 15 minutes).
|
|
14
|
+
|
|
15
|
+
| | TimeInput |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Sémantique | Heure du jour |
|
|
18
|
+
| Exemple | \`09:30\` (9h30 le matin) |
|
|
19
|
+
| Heures valides | 00–23 |
|
|
20
|
+
| HTML web | \`<input type="time">\` |`,
|
|
21
|
+
component: TimeInput,
|
|
22
|
+
styleFn: useStyles,
|
|
23
|
+
};
|
|
24
|
+
export const Default = () => (_jsx(Box, { width: "100%", p: 8, children: _jsxs(Grid, { gap: 8, children: [_jsx(Grid.Column, { size: { mobile: 12, desktop: 4 }, children: _jsx(TimeInput, { label: "Heure" }) }), _jsx(Grid.Column, { size: { mobile: 12, desktop: 4 }, children: _jsx(TimeInput, { label: "Heure", value: "09:30" }) }), _jsx(Grid.Column, { size: { mobile: 12, desktop: 4 }, children: _jsx(TimeInput, { label: "Heure", value: "14:00", hint: "Heure de d\u00E9but de mission" }) })] }) }));
|
|
25
|
+
export const States = () => (_jsx(Box, { width: "100%", p: 8, children: _jsxs(Grid, { gap: 8, children: [_jsx(Grid.Column, { size: { mobile: 12, desktop: 4 }, children: _jsx(TimeInput, { label: "Erreur", value: "25:70", error: "Heure invalide (00:00\u201323:59)" }) }), _jsx(Grid.Column, { size: { mobile: 12, desktop: 4 }, children: _jsx(TimeInput, { label: "Succ\u00E8s", value: "09:30", success: "Enregistr\u00E9" }) }), _jsx(Grid.Column, { size: { mobile: 12, desktop: 4 }, children: _jsx(TimeInput, { label: "D\u00E9sactiv\u00E9", value: "09:30", disabled: true }) })] }) }));
|
|
26
|
+
export * as Sources from './TimeInput.stories.sources';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const Default: () => string;
|
|
2
|
+
export declare const States: () => string;
|
|
3
|
+
export declare const storySources: {
|
|
4
|
+
readonly Default: () => string;
|
|
5
|
+
readonly States: () => string;
|
|
6
|
+
};
|
|
7
|
+
export type StorySourceName = keyof typeof storySources;
|
|
8
|
+
//# sourceMappingURL=TimeInput.stories.sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeInput.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/TimeInput/TimeInput.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAAqhB,CAAC;AAE1iB,eAAO,MAAM,MAAM,cAA8kB,CAAC;AAElmB,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This file is generated. Do not edit manually.
|
|
2
|
+
// Source: src/ui/TimeInput/TimeInput.stories.tsx
|
|
3
|
+
export const Default = () => "export const Default = () => (\n <Box width=\"100%\" p={8}>\n <Grid gap={8}>\n <Grid.Column size={{ mobile: 12, desktop: 4 }}>\n <TimeInput label=\"Heure\" />\n </Grid.Column>\n <Grid.Column size={{ mobile: 12, desktop: 4 }}>\n <TimeInput label=\"Heure\" value=\"09:30\" />\n </Grid.Column>\n <Grid.Column size={{ mobile: 12, desktop: 4 }}>\n <TimeInput label=\"Heure\" value=\"14:00\" hint=\"Heure de début de mission\" />\n </Grid.Column>\n </Grid>\n </Box>\n);";
|
|
4
|
+
export const States = () => "export const States = () => (\n <Box width=\"100%\" p={8}>\n <Grid gap={8}>\n <Grid.Column size={{ mobile: 12, desktop: 4 }}>\n <TimeInput label=\"Erreur\" value=\"25:70\" error=\"Heure invalide (00:00–23:59)\" />\n </Grid.Column>\n <Grid.Column size={{ mobile: 12, desktop: 4 }}>\n <TimeInput label=\"Succès\" value=\"09:30\" success=\"Enregistré\" />\n </Grid.Column>\n <Grid.Column size={{ mobile: 12, desktop: 4 }}>\n <TimeInput label=\"Désactivé\" value=\"09:30\" disabled />\n </Grid.Column>\n </Grid>\n </Box>\n);";
|
|
5
|
+
export const storySources = {
|
|
6
|
+
Default,
|
|
7
|
+
States,
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeInput.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/TimeInput/TimeInput.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;CAEnB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const TimeInput: React.ForwardRefExoticComponent<{
|
|
3
|
+
label: string;
|
|
4
|
+
labelRight?: React.ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
} & import("@alveole/components").FormControlCaptionProps & import("@alveole/components").FormControlHintProps & {
|
|
7
|
+
value?: string;
|
|
8
|
+
onChange?: (value: string) => void;
|
|
9
|
+
onBlur?: () => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
12
|
+
//# sourceMappingURL=TimeInput.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeInput.web.d.ts","sourceRoot":"","sources":["../../../src/ui/TimeInput/TimeInput.web.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,SAAS;;;;;;;;;0CAmBpB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FormControl, FormControlCaption, FormControlDateInput, FormControlHint, FormControlLabel, InputHeading, } from '@alveole/components';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useStyles } from './TimeInput.styles';
|
|
5
|
+
export const TimeInput = React.forwardRef(function TimeInput(props, ref) {
|
|
6
|
+
const { label, labelRight, hint, disabled, error, success } = props;
|
|
7
|
+
const styles = useStyles();
|
|
8
|
+
return (_jsxs(FormControl, { style: styles.timeInput, 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(FormControlDateInput, { ref: ref, ...props, type: "time" }), (error || success) && _jsx(FormControlCaption, { error: error, success: success })] }));
|
|
9
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/TimeInput/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TimeInput';
|
|
@@ -5,6 +5,7 @@ declare const _default: {
|
|
|
5
5
|
experimental: false;
|
|
6
6
|
figmaURL: string;
|
|
7
7
|
description: string;
|
|
8
|
+
shortDescription: string;
|
|
8
9
|
component: typeof Toast;
|
|
9
10
|
styleFn: () => {
|
|
10
11
|
container: {
|
|
@@ -13,7 +14,7 @@ declare const _default: {
|
|
|
13
14
|
borderRadius: import("@alveole/theme").Radius;
|
|
14
15
|
display: "flex";
|
|
15
16
|
flexDirection: "row";
|
|
16
|
-
gap:
|
|
17
|
+
gap: string | number;
|
|
17
18
|
overflow: "hidden";
|
|
18
19
|
padding: number;
|
|
19
20
|
} | {
|
|
@@ -30,7 +31,7 @@ declare const _default: {
|
|
|
30
31
|
borderRadius: import("@alveole/theme").Radius;
|
|
31
32
|
display: "flex";
|
|
32
33
|
flexDirection: "row";
|
|
33
|
-
gap:
|
|
34
|
+
gap: string | number;
|
|
34
35
|
overflow: "hidden";
|
|
35
36
|
padding: number;
|
|
36
37
|
} | {
|
|
@@ -40,7 +41,7 @@ declare const _default: {
|
|
|
40
41
|
borderRadius: import("@alveole/theme").Radius;
|
|
41
42
|
display: "flex";
|
|
42
43
|
flexDirection: "row";
|
|
43
|
-
gap:
|
|
44
|
+
gap: string | number;
|
|
44
45
|
overflow: "hidden";
|
|
45
46
|
padding: number;
|
|
46
47
|
};
|
|
@@ -48,8 +49,8 @@ declare const _default: {
|
|
|
48
49
|
display: "flex";
|
|
49
50
|
flex: number;
|
|
50
51
|
flexDirection: "column";
|
|
51
|
-
gap:
|
|
52
|
-
padding:
|
|
52
|
+
gap: string | number;
|
|
53
|
+
padding: string | number;
|
|
53
54
|
};
|
|
54
55
|
titleContainer: {
|
|
55
56
|
display: "flex";
|
|
@@ -70,10 +71,10 @@ declare const _default: {
|
|
|
70
71
|
alignSelf: "stretch";
|
|
71
72
|
justifyContent: "flex-start";
|
|
72
73
|
alignItems: "center";
|
|
73
|
-
paddingLeft:
|
|
74
|
-
paddingRight:
|
|
75
|
-
paddingTop:
|
|
76
|
-
paddingBottom:
|
|
74
|
+
paddingLeft: string | number;
|
|
75
|
+
paddingRight: string | number;
|
|
76
|
+
paddingTop: string | number;
|
|
77
|
+
paddingBottom: string | number;
|
|
77
78
|
};
|
|
78
79
|
iconBlockDefault: {
|
|
79
80
|
backgroundColor: string;
|
|
@@ -101,6 +102,29 @@ declare const _default: {
|
|
|
101
102
|
};
|
|
102
103
|
};
|
|
103
104
|
export default _default;
|
|
105
|
+
/**
|
|
106
|
+
* Le fichier `_layout.tsx` doit inclure la balise `<Toasts>` pour fonctionner.
|
|
107
|
+
*
|
|
108
|
+
* ```tsx
|
|
109
|
+
* import { Toasts } from '@alveole/components';
|
|
110
|
+
* import { ThemeProvider } from '@alveole/theme';
|
|
111
|
+
* import { Stack } from 'expo-router';
|
|
112
|
+
* import { TamaguiProvider } from 'tamagui';
|
|
113
|
+
* import { tamaguiConfig } from '../tamagui.config';
|
|
114
|
+
*
|
|
115
|
+
* export default function RootLayout() {
|
|
116
|
+
* return (
|
|
117
|
+
* <TamaguiProvider config={tamaguiConfig} defaultTheme="light">
|
|
118
|
+
* <ThemeProvider loader={false}>
|
|
119
|
+
* <Toasts>
|
|
120
|
+
* <Stack screenOptions={{ headerShown: false }} />
|
|
121
|
+
* </Toasts>
|
|
122
|
+
* </ThemeProvider>
|
|
123
|
+
* </TamaguiProvider>
|
|
124
|
+
* );
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
104
128
|
export declare const All: () => import("react").JSX.Element;
|
|
105
129
|
export declare const PreviewInfo: () => import("react").JSX.Element;
|
|
106
130
|
export declare const PreviewSuccess: () => import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Toast/Toast.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"Toast.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Toast/Toast.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM3C,wBASkB;AAElB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,GAAG,mCA+Bf,CAAC;AAEF,eAAO,MAAM,WAAW,mCAEvB,CAAC;AAEF,eAAO,MAAM,cAAc,mCAE1B,CAAC;AAEF,eAAO,MAAM,YAAY,mCAExB,CAAC;AAEF,eAAO,MAAM,cAAc,mCAE1B,CAAC;AAEF,eAAO,MAAM,cAAc,mCAE1B,CAAC;AAEF,eAAO,MAAM,0BAA0B,mCAA2E,CAAC;AAEnH,eAAO,MAAM,6BAA6B,mCAEzC,CAAC;AAEF,eAAO,MAAM,WAAW,mCAOvB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from '@alveole/components';
|
|
3
|
-
import { Box
|
|
3
|
+
import { Box } from '../../core';
|
|
4
4
|
import { Toast, ToastView } from './Toast';
|
|
5
5
|
import { useStyles } from './Toast.styles';
|
|
6
6
|
import { defaultDuration } from './ToastBridge';
|
|
@@ -11,10 +11,34 @@ export default {
|
|
|
11
11
|
tags: ['ui'],
|
|
12
12
|
experimental: false,
|
|
13
13
|
figmaURL: 'https://www.figma.com/design/xJz8Z6vfrnZPKTtRbuT2W8/Alveole---Composants?node-id=2084-1372',
|
|
14
|
-
description: `Toaster Tamagui. Contient le provider global et le hook useToast
|
|
14
|
+
description: `Toaster Tamagui. Contient le provider global et le hook \`useToast\`. Par défaut un toast reste affiché pendant ${defaultDuration / 1000} secondes`,
|
|
15
|
+
shortDescription: 'Toaster Tamagui. Fournit le provider global et le hook useToast.',
|
|
15
16
|
component: Toast,
|
|
16
17
|
styleFn: useStyles,
|
|
17
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* Le fichier `_layout.tsx` doit inclure la balise `<Toasts>` pour fonctionner.
|
|
21
|
+
*
|
|
22
|
+
* ```tsx
|
|
23
|
+
* import { Toasts } from '@alveole/components';
|
|
24
|
+
* import { ThemeProvider } from '@alveole/theme';
|
|
25
|
+
* import { Stack } from 'expo-router';
|
|
26
|
+
* import { TamaguiProvider } from 'tamagui';
|
|
27
|
+
* import { tamaguiConfig } from '../tamagui.config';
|
|
28
|
+
*
|
|
29
|
+
* export default function RootLayout() {
|
|
30
|
+
* return (
|
|
31
|
+
* <TamaguiProvider config={tamaguiConfig} defaultTheme="light">
|
|
32
|
+
* <ThemeProvider loader={false}>
|
|
33
|
+
* <Toasts>
|
|
34
|
+
* <Stack screenOptions={{ headerShown: false }} />
|
|
35
|
+
* </Toasts>
|
|
36
|
+
* </ThemeProvider>
|
|
37
|
+
* </TamaguiProvider>
|
|
38
|
+
* );
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
18
42
|
export const All = () => {
|
|
19
43
|
const toast = useToast();
|
|
20
44
|
const defaultToast = () => toast.present('Default', 'Message');
|
|
@@ -28,26 +52,7 @@ export const All = () => {
|
|
|
28
52
|
const withoutMessageToast = () => toast.present('Sans message');
|
|
29
53
|
const withoutMessageToastError = () => toast.present('Sans message', undefined, { variant: 'error' });
|
|
30
54
|
const withCustomIcon = () => toast.present('Avec icon custom', undefined, { icon: 'Worm' });
|
|
31
|
-
return (
|
|
32
|
-
import { Toasts } from '@alveole/components';
|
|
33
|
-
import { ThemeProvider } from '@alveole/theme';
|
|
34
|
-
import { Stack } from 'expo-router';
|
|
35
|
-
import React from 'react';
|
|
36
|
-
import { TamaguiProvider } from 'tamagui';
|
|
37
|
-
import { tamaguiConfig } from '../tamagui.config';
|
|
38
|
-
|
|
39
|
-
export default function RootLayout() {
|
|
40
|
-
return (
|
|
41
|
-
<TamaguiProvider config={tamaguiConfig} defaultTheme="light">
|
|
42
|
-
<ThemeProvider loader={false}>
|
|
43
|
-
<Toasts>
|
|
44
|
-
<Stack screenOptions={{ headerShown: false }} />
|
|
45
|
-
</Toasts>
|
|
46
|
-
</ThemeProvider>
|
|
47
|
-
</TamaguiProvider>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
` })] })] }));
|
|
55
|
+
return (_jsx(Box, { display: "flex", flexDirection: "column", gap: 8, children: _jsxs(Box, { display: "flex", flexDirection: "row", gap: 4, flexWrap: "wrap", children: [_jsx(Button, { title: "Default toast", variant: "secondary", onPress: defaultToast }), _jsx(Button, { title: "Success toast", variant: "secondary", onPress: successToast }), _jsx(Button, { title: "Error toast", variant: "secondary", onPress: errorToast }), _jsx(Button, { title: "Info toast", variant: "secondary", onPress: infoToast }), _jsx(Button, { title: "Warning toast", variant: "secondary", onPress: warningToast }), _jsx(Button, { title: "Message long", variant: "secondary", onPress: infoToastMultiLine }), _jsx(Button, { title: "Without message toast", variant: "secondary", onPress: withoutMessageToast }), _jsx(Button, { title: "Without message toast error", variant: "secondary", onPress: withoutMessageToastError }), _jsx(Button, { title: "WithCustomIcon", variant: "secondary", onPress: withCustomIcon })] }) }));
|
|
51
56
|
};
|
|
52
57
|
export const PreviewInfo = () => (_jsx(ToastView, { variant: "info", title: "Information", message: "Description additionnelle du toast." }));
|
|
53
58
|
export const PreviewSuccess = () => (_jsx(ToastView, { variant: "success", title: "Succ\u00E8s", message: "Description additionnelle du toast." }));
|
|
@@ -19,4 +19,5 @@ export declare const storySources: {
|
|
|
19
19
|
readonly ToastsTypes: () => string;
|
|
20
20
|
};
|
|
21
21
|
export type StorySourceName = keyof typeof storySources;
|
|
22
|
+
export declare const storyDescriptions: Partial<Record<StorySourceName, string>>;
|
|
22
23
|
//# sourceMappingURL=Toast.stories.sources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Toast/Toast.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"Toast.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Toast/Toast.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG,cAAm8D,CAAC;AAEp9D,eAAO,MAAM,WAAW,cAAyJ,CAAC;AAElL,eAAO,MAAM,cAAc,cAA0J,CAAC;AAEtL,eAAO,MAAM,YAAY,cAAsJ,CAAC;AAEhL,eAAO,MAAM,cAAc,cAA2J,CAAC;AAEvL,eAAO,MAAM,cAAc,cAA6J,CAAC;AAEzL,eAAO,MAAM,0BAA0B,cAAkI,CAAC;AAE1K,eAAO,MAAM,6BAA6B,cAAgJ,CAAC;AAE3L,eAAO,MAAM,WAAW,cAA0Q,CAAC;AAEnS,eAAO,MAAM,YAAY;;;;;;;;;;CAUf,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"}
|