@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
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This file is generated. Do not edit manually.
|
|
2
|
+
// Source: src/ui/DateInput/DateInput.stories.tsx
|
|
3
|
+
export const Default = () => "export const Default = () => (\n <Box width={'100%'}>\n <Grid gap={8}>\n <Grid.Column size={{ desktop: 6, mobile: 12 }}>\n <DateInput label=\"Default\" onChange={console.log} />\n </Grid.Column>\n <Grid.Column size={{ desktop: 6, mobile: 12 }}>\n <DateInput label=\"Error\" onChange={console.log} error=\"Une erreur\" />\n </Grid.Column>\n <Grid.Column size={{ desktop: 6, mobile: 12 }}>\n <DateInput label=\"Disabled\" onChange={console.log} disabled />\n </Grid.Column>\n </Grid>\n </Box>\n);";
|
|
4
|
+
export const Types = () => "export const Types = () => {\n const [date, setDate] = React.useState<string>();\n const [datetime, setDatetime] = React.useState<string>();\n\n return (\n <Box width={'100%'}>\n <Grid gap={8}>\n <Grid.Column size={{ desktop: 6, mobile: 12 }}>\n <DateInput value={date} label=\"Date (default)\" onChange={e => setDate(e.toString())} />\n </Grid.Column>\n <Grid.Column size={{ desktop: 6, mobile: 12 }}>\n <DateInput\n value={datetime}\n label=\"Datetime\"\n type=\"datetime\"\n is24Hour\n onChange={e => setDatetime(e.toString())}\n />\n </Grid.Column>\n </Grid>\n </Box>\n );\n};";
|
|
5
|
+
export const storySources = {
|
|
6
|
+
Default,
|
|
7
|
+
Types,
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateInput.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/DateInput/DateInput.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;CAEnB,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<HTMLInputElement>>;
|
|
23
|
+
//# sourceMappingURL=DateInput.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateInput.web.d.ts","sourceRoot":"","sources":["../../../src/ui/DateInput/DateInput.web.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;0CAiBpB,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 './DateInput.styles';
|
|
5
|
+
export const DateInput = React.forwardRef(function DateInput(props, ref) {
|
|
6
|
+
const { label, hint, disabled, error, success } = props;
|
|
7
|
+
const styles = useStyles();
|
|
8
|
+
return (_jsxs(FormControl, { style: styles.dateInput, children: [_jsxs(InputHeading, { children: [label && _jsx(FormControlLabel, { label: label, disabled: disabled, error: error, success: success }), hint && _jsx(FormControlHint, { hint: hint, disabled: disabled })] }), _jsx(FormControlDateInput, { ref: ref, ...props }), (error || success) && _jsx(FormControlCaption, { error: error, success: success })] }));
|
|
9
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const DateFormats: {
|
|
2
|
+
readonly DatetimeFull: "iiii d MMMM yyyy à HH:mm";
|
|
3
|
+
readonly Datetime: "d MMMM yyyy à HH:mm";
|
|
4
|
+
readonly DatetimeShort: "d MMMM à HH:mm";
|
|
5
|
+
readonly Date: "d MMMM yyyy";
|
|
6
|
+
readonly DaySlashShort: "eeee dd/MM/yy";
|
|
7
|
+
readonly DateSlash: "dd/MM/yyyy";
|
|
8
|
+
readonly DateString: "yyyy-MM-dd";
|
|
9
|
+
readonly DateFull: "iiii d MMMM yyyy";
|
|
10
|
+
readonly DateFullAlt: "iii d MMM yyyy";
|
|
11
|
+
readonly DateTimeString: "yyyy-MM-dd'T'HH:mm";
|
|
12
|
+
readonly Time: "HH:mm";
|
|
13
|
+
readonly MonthString: "yyyy-MM";
|
|
14
|
+
readonly MonthAndYear: "MMMM yyyy";
|
|
15
|
+
};
|
|
16
|
+
export type DateFormat = (typeof DateFormats)[keyof typeof DateFormats];
|
|
17
|
+
export declare function displayDate(date: string | Date | undefined, options?: {
|
|
18
|
+
fallback?: string;
|
|
19
|
+
format?: DateFormat;
|
|
20
|
+
capitalize?: boolean;
|
|
21
|
+
}): string;
|
|
22
|
+
export declare function isValidDate(value: unknown): value is string | Date;
|
|
23
|
+
//# sourceMappingURL=dateUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateUtils.d.ts","sourceRoot":"","sources":["../../../src/ui/DateInput/dateUtils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;CAcd,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAExE,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GACzE,MAAM,CAOR;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,GAAG,IAAI,CAclE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { format, isValid, parseISO } from 'date-fns';
|
|
2
|
+
import { fr } from 'date-fns/locale';
|
|
3
|
+
export const DateFormats = {
|
|
4
|
+
DatetimeFull: 'iiii d MMMM yyyy à HH:mm',
|
|
5
|
+
Datetime: 'd MMMM yyyy à HH:mm',
|
|
6
|
+
DatetimeShort: 'd MMMM à HH:mm',
|
|
7
|
+
Date: 'd MMMM yyyy',
|
|
8
|
+
DaySlashShort: 'eeee dd/MM/yy',
|
|
9
|
+
DateSlash: 'dd/MM/yyyy',
|
|
10
|
+
DateString: 'yyyy-MM-dd',
|
|
11
|
+
DateFull: 'iiii d MMMM yyyy',
|
|
12
|
+
DateFullAlt: 'iii d MMM yyyy',
|
|
13
|
+
DateTimeString: "yyyy-MM-dd'T'HH:mm",
|
|
14
|
+
Time: 'HH:mm',
|
|
15
|
+
MonthString: 'yyyy-MM',
|
|
16
|
+
MonthAndYear: 'MMMM yyyy',
|
|
17
|
+
};
|
|
18
|
+
export function displayDate(date, options) {
|
|
19
|
+
const defaultFormat = DateFormats.Date;
|
|
20
|
+
const d = typeof date === 'string' ? parseISO(date) : date;
|
|
21
|
+
if (!d || !isValid(d))
|
|
22
|
+
return options?.fallback ?? '';
|
|
23
|
+
let response = format(d, options?.format ?? defaultFormat, { locale: fr });
|
|
24
|
+
if (options?.capitalize)
|
|
25
|
+
response = response.charAt(0).toUpperCase() + response.slice(1);
|
|
26
|
+
return response;
|
|
27
|
+
}
|
|
28
|
+
export function isValidDate(value) {
|
|
29
|
+
if (typeof value === 'string') {
|
|
30
|
+
const trimmedValue = value.trim();
|
|
31
|
+
if (!trimmedValue)
|
|
32
|
+
return false;
|
|
33
|
+
const isoFormat = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?([+-]\d{2}:\d{2}|Z)?)?$/;
|
|
34
|
+
const partialIsoFormat = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/;
|
|
35
|
+
const standardDateFormat = /^\d{4}-\d{2}-\d{2}$/;
|
|
36
|
+
if (isoFormat.test(trimmedValue))
|
|
37
|
+
return isValid(parseISO(trimmedValue));
|
|
38
|
+
if (partialIsoFormat.test(trimmedValue))
|
|
39
|
+
return isValid(new Date(trimmedValue));
|
|
40
|
+
if (standardDateFormat.test(trimmedValue))
|
|
41
|
+
return isValid(new Date(trimmedValue));
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
if (value instanceof Date)
|
|
45
|
+
return isValid(value);
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/DateInput/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DateInput';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Divider/Divider.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Divider.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Divider/Divider.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,wBASkB;AAElB,eAAO,MAAM,OAAO,mCAAmC,CAAC;AAExD,OAAO,KAAK,OAAO,MAAM,2BAA2B,CAAC"}
|
|
@@ -6,7 +6,8 @@ export default {
|
|
|
6
6
|
tags: ['ui'],
|
|
7
7
|
experimental: false,
|
|
8
8
|
figmaURL: 'https://www.figma.com/design/xJz8Z6vfrnZPKTtRbuT2W8/Composants?node-id=1002-15729',
|
|
9
|
-
description: 'Sérateur. Composant de type Box - Equivalent
|
|
9
|
+
description: 'Sérateur. Composant de type Box - Equivalent `<hr/>`.',
|
|
10
|
+
shortDescription: 'Séparateur horizontal. Équivalent à la balise <hr>.',
|
|
10
11
|
component: Divider,
|
|
11
12
|
styleFn: useStyles,
|
|
12
13
|
};
|
|
@@ -7,7 +7,7 @@ declare const _default: {
|
|
|
7
7
|
component: (props: import("@alveole/components").DocumentViewerProps) => import("react").JSX.Element;
|
|
8
8
|
styleFn: () => {
|
|
9
9
|
toolbar: {
|
|
10
|
-
padding:
|
|
10
|
+
padding: string | number;
|
|
11
11
|
borderColor: string;
|
|
12
12
|
borderWidth: number;
|
|
13
13
|
borderStyle: "solid";
|
|
@@ -16,18 +16,18 @@ declare const _default: {
|
|
|
16
16
|
backgroundColor: string;
|
|
17
17
|
display: "flex";
|
|
18
18
|
flexDirection: "row";
|
|
19
|
-
gap:
|
|
19
|
+
gap: string | number;
|
|
20
20
|
justifyContent: "space-between";
|
|
21
21
|
};
|
|
22
22
|
toolbarAction: {
|
|
23
23
|
display: "flex";
|
|
24
24
|
flexDirection: "row";
|
|
25
|
-
gap:
|
|
25
|
+
gap: string | number;
|
|
26
26
|
justifyContent: "flex-end";
|
|
27
27
|
};
|
|
28
28
|
toolbarTitle: {
|
|
29
29
|
color: string;
|
|
30
|
-
paddingLeft:
|
|
30
|
+
paddingLeft: string | number;
|
|
31
31
|
marginTop: string;
|
|
32
32
|
marginBottom: string;
|
|
33
33
|
userSelect: "none";
|
|
@@ -40,7 +40,7 @@ declare const _default: {
|
|
|
40
40
|
toolbarState: {
|
|
41
41
|
color: string;
|
|
42
42
|
userSelect: "none";
|
|
43
|
-
fontVariant: "tabular-nums"
|
|
43
|
+
fontVariant: "tabular-nums";
|
|
44
44
|
fontSize: 14;
|
|
45
45
|
lineHeight: 20;
|
|
46
46
|
letterSpacing: 0;
|
|
@@ -63,7 +63,7 @@ declare const _default: {
|
|
|
63
63
|
display: "flex";
|
|
64
64
|
flexDirection: "column";
|
|
65
65
|
flex: number;
|
|
66
|
-
padding:
|
|
66
|
+
padding: string | number;
|
|
67
67
|
borderColor: string;
|
|
68
68
|
borderWidth: number;
|
|
69
69
|
borderStyle: "solid";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const useStyles: () => {
|
|
2
2
|
toolbar: {
|
|
3
|
-
padding:
|
|
3
|
+
padding: string | number;
|
|
4
4
|
borderColor: string;
|
|
5
5
|
borderWidth: number;
|
|
6
6
|
borderStyle: "solid";
|
|
@@ -9,18 +9,18 @@ export declare const useStyles: () => {
|
|
|
9
9
|
backgroundColor: string;
|
|
10
10
|
display: "flex";
|
|
11
11
|
flexDirection: "row";
|
|
12
|
-
gap:
|
|
12
|
+
gap: string | number;
|
|
13
13
|
justifyContent: "space-between";
|
|
14
14
|
};
|
|
15
15
|
toolbarAction: {
|
|
16
16
|
display: "flex";
|
|
17
17
|
flexDirection: "row";
|
|
18
|
-
gap:
|
|
18
|
+
gap: string | number;
|
|
19
19
|
justifyContent: "flex-end";
|
|
20
20
|
};
|
|
21
21
|
toolbarTitle: {
|
|
22
22
|
color: string;
|
|
23
|
-
paddingLeft:
|
|
23
|
+
paddingLeft: string | number;
|
|
24
24
|
marginTop: string;
|
|
25
25
|
marginBottom: string;
|
|
26
26
|
userSelect: "none";
|
|
@@ -33,7 +33,7 @@ export declare const useStyles: () => {
|
|
|
33
33
|
toolbarState: {
|
|
34
34
|
color: string;
|
|
35
35
|
userSelect: "none";
|
|
36
|
-
fontVariant: "tabular-nums"
|
|
36
|
+
fontVariant: "tabular-nums";
|
|
37
37
|
fontSize: 14;
|
|
38
38
|
lineHeight: 20;
|
|
39
39
|
letterSpacing: 0;
|
|
@@ -56,7 +56,7 @@ export declare const useStyles: () => {
|
|
|
56
56
|
display: "flex";
|
|
57
57
|
flexDirection: "column";
|
|
58
58
|
flex: number;
|
|
59
|
-
padding:
|
|
59
|
+
padding: string | number;
|
|
60
60
|
borderColor: string;
|
|
61
61
|
borderWidth: number;
|
|
62
62
|
borderStyle: "solid";
|
|
@@ -31,7 +31,7 @@ export const useStyles = makeStyles(({ text, color, spacing, radius, isVariant }
|
|
|
31
31
|
...text['Corps de texte'].SM.Regular,
|
|
32
32
|
color: color.light.text['mention-grey'],
|
|
33
33
|
userSelect: 'none',
|
|
34
|
-
fontVariant:
|
|
34
|
+
fontVariant: 'tabular-nums',
|
|
35
35
|
},
|
|
36
36
|
toolbarDivider: {
|
|
37
37
|
width: 1,
|
|
@@ -10,7 +10,7 @@ declare const _default: {
|
|
|
10
10
|
borderWidth: number;
|
|
11
11
|
borderStyle: "dashed";
|
|
12
12
|
borderColor: string;
|
|
13
|
-
padding:
|
|
13
|
+
padding: string | number;
|
|
14
14
|
borderRadius: number;
|
|
15
15
|
backgroundColor: string;
|
|
16
16
|
cursor: "pointer";
|
|
@@ -37,21 +37,21 @@ declare const _default: {
|
|
|
37
37
|
icon: {
|
|
38
38
|
color: string;
|
|
39
39
|
backgroundColor: string;
|
|
40
|
-
padding:
|
|
40
|
+
padding: string | number;
|
|
41
41
|
borderRadius: number;
|
|
42
42
|
width: import("@alveole/theme").Spacing;
|
|
43
43
|
height: import("@alveole/theme").Spacing;
|
|
44
|
-
marginBottom:
|
|
44
|
+
marginBottom: string | number;
|
|
45
45
|
};
|
|
46
46
|
filesListContainer: {
|
|
47
|
-
marginTop:
|
|
47
|
+
marginTop: string | number;
|
|
48
48
|
};
|
|
49
49
|
filesListHeader: {
|
|
50
50
|
display: "flex";
|
|
51
51
|
flexDirection: "row";
|
|
52
52
|
justifyContent: "space-between";
|
|
53
53
|
alignItems: "center";
|
|
54
|
-
marginBottom:
|
|
54
|
+
marginBottom: string | number;
|
|
55
55
|
};
|
|
56
56
|
filesListTitle: {
|
|
57
57
|
fontWeight: "bold";
|
|
@@ -60,16 +60,16 @@ declare const _default: {
|
|
|
60
60
|
borderWidth: number;
|
|
61
61
|
borderColor: string;
|
|
62
62
|
borderRadius: number;
|
|
63
|
-
padding:
|
|
63
|
+
padding: string | number;
|
|
64
64
|
backgroundColor: string;
|
|
65
65
|
};
|
|
66
66
|
fileItemContainer: {
|
|
67
67
|
display: "flex";
|
|
68
68
|
flexDirection: "row";
|
|
69
69
|
alignItems: "center";
|
|
70
|
-
gap:
|
|
71
|
-
padding:
|
|
72
|
-
marginBottom:
|
|
70
|
+
gap: string | number;
|
|
71
|
+
padding: string | number;
|
|
72
|
+
marginBottom: string | number;
|
|
73
73
|
backgroundColor: string;
|
|
74
74
|
borderRadius: number;
|
|
75
75
|
};
|
|
@@ -83,7 +83,7 @@ declare const _default: {
|
|
|
83
83
|
flex: number;
|
|
84
84
|
display: "flex";
|
|
85
85
|
flexDirection: "column";
|
|
86
|
-
gap:
|
|
86
|
+
gap: string | number;
|
|
87
87
|
};
|
|
88
88
|
fileName: {
|
|
89
89
|
fontWeight: "bold";
|
|
@@ -3,7 +3,7 @@ export declare const useStyles: () => {
|
|
|
3
3
|
borderWidth: number;
|
|
4
4
|
borderStyle: "dashed";
|
|
5
5
|
borderColor: string;
|
|
6
|
-
padding:
|
|
6
|
+
padding: string | number;
|
|
7
7
|
borderRadius: number;
|
|
8
8
|
backgroundColor: string;
|
|
9
9
|
cursor: "pointer";
|
|
@@ -30,21 +30,21 @@ export declare const useStyles: () => {
|
|
|
30
30
|
icon: {
|
|
31
31
|
color: string;
|
|
32
32
|
backgroundColor: string;
|
|
33
|
-
padding:
|
|
33
|
+
padding: string | number;
|
|
34
34
|
borderRadius: number;
|
|
35
35
|
width: import("@alveole/theme").Spacing;
|
|
36
36
|
height: import("@alveole/theme").Spacing;
|
|
37
|
-
marginBottom:
|
|
37
|
+
marginBottom: string | number;
|
|
38
38
|
};
|
|
39
39
|
filesListContainer: {
|
|
40
|
-
marginTop:
|
|
40
|
+
marginTop: string | number;
|
|
41
41
|
};
|
|
42
42
|
filesListHeader: {
|
|
43
43
|
display: "flex";
|
|
44
44
|
flexDirection: "row";
|
|
45
45
|
justifyContent: "space-between";
|
|
46
46
|
alignItems: "center";
|
|
47
|
-
marginBottom:
|
|
47
|
+
marginBottom: string | number;
|
|
48
48
|
};
|
|
49
49
|
filesListTitle: {
|
|
50
50
|
fontWeight: "bold";
|
|
@@ -53,16 +53,16 @@ export declare const useStyles: () => {
|
|
|
53
53
|
borderWidth: number;
|
|
54
54
|
borderColor: string;
|
|
55
55
|
borderRadius: number;
|
|
56
|
-
padding:
|
|
56
|
+
padding: string | number;
|
|
57
57
|
backgroundColor: string;
|
|
58
58
|
};
|
|
59
59
|
fileItemContainer: {
|
|
60
60
|
display: "flex";
|
|
61
61
|
flexDirection: "row";
|
|
62
62
|
alignItems: "center";
|
|
63
|
-
gap:
|
|
64
|
-
padding:
|
|
65
|
-
marginBottom:
|
|
63
|
+
gap: string | number;
|
|
64
|
+
padding: string | number;
|
|
65
|
+
marginBottom: string | number;
|
|
66
66
|
backgroundColor: string;
|
|
67
67
|
borderRadius: number;
|
|
68
68
|
};
|
|
@@ -76,7 +76,7 @@ export declare const useStyles: () => {
|
|
|
76
76
|
flex: number;
|
|
77
77
|
display: "flex";
|
|
78
78
|
flexDirection: "column";
|
|
79
|
-
gap:
|
|
79
|
+
gap: string | number;
|
|
80
80
|
};
|
|
81
81
|
fileName: {
|
|
82
82
|
fontWeight: "bold";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { makeStyles } from '@alveole/theme';
|
|
2
|
-
export const useStyles = makeStyles(({ color, spacing }) => ({
|
|
2
|
+
export const useStyles = makeStyles(({ color, spacing, spacingValue }) => ({
|
|
3
3
|
container: {
|
|
4
4
|
borderWidth: 1,
|
|
5
5
|
borderStyle: 'dashed',
|
|
@@ -33,8 +33,8 @@ export const useStyles = makeStyles(({ color, spacing }) => ({
|
|
|
33
33
|
backgroundColor: color.background['alt-grey'],
|
|
34
34
|
padding: spacing('100'),
|
|
35
35
|
borderRadius: 12,
|
|
36
|
-
width:
|
|
37
|
-
height:
|
|
36
|
+
width: spacingValue('200'),
|
|
37
|
+
height: spacingValue('200'),
|
|
38
38
|
marginBottom: spacing('100'),
|
|
39
39
|
},
|
|
40
40
|
filesListContainer: {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FormControlCaptionProps, FormControlHintProps, FormControlLabelProps } from '@alveole/components';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type DurationInputProps = FormControlLabelProps & FormControlHintProps & FormControlCaptionProps & {
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
onBlur?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const DurationInput: 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=DurationInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DurationInput.d.ts","sourceRoot":"","sources":["../../../src/ui/DurationInput/DurationInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EAEvB,oBAAoB,EAEpB,qBAAqB,EAGtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,GACpD,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,aAAa;;;;;YANd,MAAM;eACH,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;aACzB,MAAM,IAAI;eACR,OAAO;6BAkDpB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 DurationInput = React.forwardRef(function DurationInput({ 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
|
+
const formatted = digits.length <= 2 ? digits : `${digits.slice(0, 2)}:${digits.slice(2)}`;
|
|
12
|
+
setLocalValue(formatted);
|
|
13
|
+
if (digits.length === 0 || digits.length === 4) {
|
|
14
|
+
onChange?.(formatted);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const handleBlur = () => {
|
|
18
|
+
onChange?.(localValue);
|
|
19
|
+
onBlur?.();
|
|
20
|
+
};
|
|
21
|
+
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, inputMode: "numeric", maxLength: 5 }), (error || success) && _jsx(FormControlCaption, { error: error, success: success })] }));
|
|
22
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
};
|
|
19
|
+
export default _default;
|
|
20
|
+
export declare const Default: () => import("react").JSX.Element;
|
|
21
|
+
export declare const States: () => import("react").JSX.Element;
|
|
22
|
+
export * as Sources from './DurationInput.stories.sources';
|
|
23
|
+
//# sourceMappingURL=DurationInput.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DurationInput.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/DurationInput/DurationInput.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAOA,wBAoBkB;AAElB,eAAO,MAAM,OAAO,mCAcnB,CAAC;AAEF,eAAO,MAAM,MAAM,mCAclB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '../../core';
|
|
3
|
+
import { Grid } from '../Grid';
|
|
4
|
+
import { DurationInput } from './DurationInput';
|
|
5
|
+
const useStyles = () => ({});
|
|
6
|
+
export default {
|
|
7
|
+
title: 'DurationInput',
|
|
8
|
+
tags: ['ui'],
|
|
9
|
+
experimental: false,
|
|
10
|
+
shortDescription: "Saisie d'une durée au format HH:MM (ex. 06:15 pour 6 heures 15 minutes).",
|
|
11
|
+
description: `Saisie d'une **durée** au format HH:MM (ex. \`06:15\` pour 6 heures 15 minutes).
|
|
12
|
+
|
|
13
|
+
À ne pas confondre avec **TimeInput**, qui représente une **heure d'horloge** (ex. \`09:30\` du matin).
|
|
14
|
+
|
|
15
|
+
| | DurationInput |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| Sémantique | Durée écoulée |
|
|
18
|
+
| Exemple | \`35:00\` (35h00 de travail) |
|
|
19
|
+
| Heures valides | 00–99 |
|
|
20
|
+
| HTML web | \`<input type="text">\` |
|
|
21
|
+
|
|
22
|
+
> Il n'existe pas de \`<input type="duration">\` en HTML.
|
|
23
|
+
> Voir [whatwg/html#5488](https://github.com/whatwg/html/issues/5488).`,
|
|
24
|
+
component: DurationInput,
|
|
25
|
+
styleFn: useStyles,
|
|
26
|
+
};
|
|
27
|
+
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(DurationInput, { label: "Dur\u00E9e" }) }), _jsx(Grid.Column, { size: { mobile: 12, desktop: 4 }, children: _jsx(DurationInput, { label: "Dur\u00E9e", value: "06:15" }) }), _jsx(Grid.Column, { size: { mobile: 12, desktop: 4 }, children: _jsx(DurationInput, { label: "Dur\u00E9e", value: "01:30", hint: "Temps pass\u00E9 sur le terrain" }) })] }) }));
|
|
28
|
+
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(DurationInput, { label: "Erreur", value: "25:70", error: "Heure invalide (minutes 00\u201359)" }) }), _jsx(Grid.Column, { size: { mobile: 12, desktop: 4 }, children: _jsx(DurationInput, { label: "Succ\u00E8s", value: "06:15", success: "Enregistr\u00E9" }) }), _jsx(Grid.Column, { size: { mobile: 12, desktop: 4 }, children: _jsx(DurationInput, { label: "D\u00E9sactiv\u00E9", value: "06:15", disabled: true }) })] }) }));
|
|
29
|
+
export * as Sources from './DurationInput.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=DurationInput.stories.sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DurationInput.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/DurationInput/DurationInput.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAAkiB,CAAC;AAEvjB,eAAO,MAAM,MAAM,cAA4lB,CAAC;AAEhnB,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/DurationInput/DurationInput.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 <DurationInput label=\"Durée\" />\n </Grid.Column>\n <Grid.Column size={{ mobile: 12, desktop: 4 }}>\n <DurationInput label=\"Durée\" value=\"06:15\" />\n </Grid.Column>\n <Grid.Column size={{ mobile: 12, desktop: 4 }}>\n <DurationInput label=\"Durée\" value=\"01:30\" hint=\"Temps passé sur le terrain\" />\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 <DurationInput label=\"Erreur\" value=\"25:70\" error=\"Heure invalide (minutes 00–59)\" />\n </Grid.Column>\n <Grid.Column size={{ mobile: 12, desktop: 4 }}>\n <DurationInput label=\"Succès\" value=\"06:15\" success=\"Enregistré\" />\n </Grid.Column>\n <Grid.Column size={{ mobile: 12, desktop: 4 }}>\n <DurationInput label=\"Désactivé\" value=\"06:15\" 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":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/DurationInput/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DurationInput';
|
|
@@ -11,18 +11,18 @@ declare const _default: {
|
|
|
11
11
|
flexDirection: "column";
|
|
12
12
|
alignItems: "center";
|
|
13
13
|
justifyContent: "center";
|
|
14
|
-
gap:
|
|
15
|
-
paddingTop:
|
|
16
|
-
paddingBottom:
|
|
17
|
-
paddingLeft:
|
|
18
|
-
paddingRight:
|
|
14
|
+
gap: string | number;
|
|
15
|
+
paddingTop: string | number;
|
|
16
|
+
paddingBottom: string | number;
|
|
17
|
+
paddingLeft: string | number;
|
|
18
|
+
paddingRight: string | number;
|
|
19
19
|
textAlign: "center";
|
|
20
20
|
height: "100%" | undefined;
|
|
21
21
|
width: "100%";
|
|
22
22
|
};
|
|
23
23
|
contenu: {
|
|
24
24
|
display: "flex";
|
|
25
|
-
gap:
|
|
25
|
+
gap: string | number;
|
|
26
26
|
alignItems: "center";
|
|
27
27
|
textAlign: "center";
|
|
28
28
|
flex: number | undefined;
|
|
@@ -36,12 +36,12 @@ declare const _default: {
|
|
|
36
36
|
color: string;
|
|
37
37
|
backgroundColor: string;
|
|
38
38
|
borderRadius: import("@alveole/theme").Radius;
|
|
39
|
-
padding:
|
|
39
|
+
padding: string | number;
|
|
40
40
|
};
|
|
41
41
|
messageEtDescription: {
|
|
42
42
|
display: "flex";
|
|
43
43
|
flexDirection: "column";
|
|
44
|
-
gap:
|
|
44
|
+
gap: string | number;
|
|
45
45
|
width: "100%";
|
|
46
46
|
justifyContent: "center";
|
|
47
47
|
};
|
|
@@ -67,7 +67,7 @@ declare const _default: {
|
|
|
67
67
|
width: "100%" | undefined;
|
|
68
68
|
display: "flex";
|
|
69
69
|
flexDirection: "column";
|
|
70
|
-
gap:
|
|
70
|
+
gap: string | number;
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
73
|
};
|