@alveole/components 0.43.2 → 1.0.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/Alert/Alert.d.ts +11 -0
- package/dist/core/Alert/Alert.d.ts.map +1 -0
- package/dist/core/Alert/Alert.js +4 -0
- package/dist/core/Alert/Alert.web.d.ts +5 -0
- package/dist/core/Alert/Alert.web.d.ts.map +1 -0
- package/dist/core/Alert/Alert.web.js +7 -0
- package/dist/core/Alert/index.d.ts +2 -0
- package/dist/core/Alert/index.d.ts.map +1 -0
- package/dist/core/Alert/index.js +1 -0
- package/dist/core/Form/Form.d.ts +2 -5
- package/dist/core/Form/Form.d.ts.map +1 -1
- package/dist/core/Form/Form.js +3 -24
- package/dist/core/Form/Form.stories.d.ts +0 -7
- package/dist/core/Form/Form.stories.d.ts.map +1 -1
- package/dist/core/Form/Form.stories.js +2 -3
- package/dist/core/Form/Form.stories.sources.d.ts +0 -2
- package/dist/core/Form/Form.stories.sources.d.ts.map +1 -1
- package/dist/core/Form/Form.stories.sources.js +0 -2
- package/dist/core/Form/Form.styles.d.ts +0 -6
- package/dist/core/Form/Form.styles.d.ts.map +1 -1
- package/dist/core/Form/Form.styles.js +0 -6
- package/dist/core/Image/Image.d.ts.map +1 -1
- package/dist/core/Image/Image.js +1 -5
- package/dist/core/Map/Map.web.d.ts.map +1 -1
- package/dist/core/Map/Map.web.js +41 -41
- package/dist/core/Page/Page.d.ts +2 -0
- package/dist/core/Page/Page.d.ts.map +1 -1
- package/dist/core/Page/Page.stories.d.ts +5 -2
- package/dist/core/Page/Page.stories.d.ts.map +1 -1
- package/dist/core/Page/Page.stories.js +13 -14
- package/dist/core/Page/Page.stories.sources.d.ts +10 -4
- package/dist/core/Page/Page.stories.sources.d.ts.map +1 -1
- package/dist/core/Page/Page.stories.sources.js +10 -4
- package/dist/core/Page/PageContentScrollable.d.ts +1 -0
- package/dist/core/Page/PageContentScrollable.d.ts.map +1 -1
- package/dist/core/Page/PageContentScrollable.js +2 -2
- package/dist/core/Page/PageHead.web.d.ts.map +1 -1
- package/dist/core/Page/PageHead.web.js +5 -2
- package/dist/core/Page/PageMetaContext.d.ts +12 -0
- package/dist/core/Page/PageMetaContext.d.ts.map +1 -0
- package/dist/core/Page/PageMetaContext.js +5 -0
- package/dist/core/Page/index.d.ts +2 -0
- package/dist/core/Page/index.d.ts.map +1 -1
- package/dist/core/Page/index.js +2 -0
- package/dist/core/PdfViewer/PdfViewer.js +1 -1
- 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 +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.d.ts.map +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/globals.d.ts +2 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/globals.js +1 -0
- package/dist/pdfjs/pdf.min.mjs +8 -1
- package/dist/pdfjs/pdf.worker.min.mjs +8 -1
- package/dist/stories/index.d.ts +24 -0
- package/dist/stories/index.d.ts.map +1 -1
- package/dist/stories/index.js +24 -0
- package/dist/ui/Accordion/Accordion.d.ts +19 -0
- package/dist/ui/Accordion/Accordion.d.ts.map +1 -0
- package/dist/ui/Accordion/Accordion.js +10 -0
- package/dist/ui/Accordion/Accordion.stories.d.ts +103 -0
- package/dist/ui/Accordion/Accordion.stories.d.ts.map +1 -0
- package/dist/ui/Accordion/Accordion.stories.js +15 -0
- package/dist/ui/Accordion/Accordion.stories.sources.d.ts +6 -0
- package/dist/ui/Accordion/Accordion.stories.sources.d.ts.map +1 -0
- package/dist/ui/Accordion/Accordion.stories.sources.js +6 -0
- package/dist/ui/Accordion/Accordion.styles.d.ts +90 -0
- package/dist/ui/Accordion/Accordion.styles.d.ts.map +1 -0
- package/dist/ui/Accordion/Accordion.styles.js +86 -0
- package/dist/ui/Accordion/AccordionItem.d.ts +14 -0
- package/dist/ui/Accordion/AccordionItem.d.ts.map +1 -0
- package/dist/ui/Accordion/AccordionItem.js +19 -0
- package/dist/ui/Accordion/index.d.ts +4 -0
- package/dist/ui/Accordion/index.d.ts.map +1 -0
- package/dist/ui/Accordion/index.js +5 -0
- package/dist/ui/ActionMenu/ActionMenu.stories.js +1 -1
- package/dist/ui/ActionMenu/ActionMenu.stories.sources.d.ts.map +1 -1
- package/dist/ui/ActionMenu/ActionMenu.stories.sources.js +1 -1
- package/dist/ui/Autocomplete/Autocomplete.d.ts +41 -0
- package/dist/ui/Autocomplete/Autocomplete.d.ts.map +1 -0
- package/dist/ui/Autocomplete/Autocomplete.js +131 -0
- package/dist/ui/Autocomplete/Autocomplete.stories.d.ts +224 -0
- package/dist/ui/Autocomplete/Autocomplete.stories.d.ts.map +1 -0
- package/dist/ui/Autocomplete/Autocomplete.stories.js +56 -0
- package/dist/ui/Autocomplete/Autocomplete.stories.sources.d.ts +14 -0
- package/dist/ui/Autocomplete/Autocomplete.stories.sources.d.ts.map +1 -0
- package/dist/ui/Autocomplete/Autocomplete.stories.sources.js +14 -0
- package/dist/ui/Autocomplete/Autocomplete.styles.d.ts +208 -0
- package/dist/ui/Autocomplete/Autocomplete.styles.d.ts.map +1 -0
- package/dist/ui/Autocomplete/Autocomplete.styles.js +173 -0
- package/dist/ui/Autocomplete/Autocomplete.web.d.ts +28 -0
- package/dist/ui/Autocomplete/Autocomplete.web.d.ts.map +1 -0
- package/dist/ui/Autocomplete/Autocomplete.web.js +112 -0
- package/dist/ui/Autocomplete/AutocompleteChip.d.ts +8 -0
- package/dist/ui/Autocomplete/AutocompleteChip.d.ts.map +1 -0
- package/dist/ui/Autocomplete/AutocompleteChip.js +12 -0
- package/dist/ui/Autocomplete/index.d.ts +3 -0
- package/dist/ui/Autocomplete/index.d.ts.map +1 -0
- package/dist/ui/Autocomplete/index.js +2 -0
- package/dist/ui/AutocompleteAddress/AutocompleteAddress.d.ts +28 -0
- package/dist/ui/AutocompleteAddress/AutocompleteAddress.d.ts.map +1 -0
- package/dist/ui/AutocompleteAddress/AutocompleteAddress.js +20 -0
- package/dist/ui/AutocompleteAddress/AutocompleteAddress.stories.d.ts +13 -0
- package/dist/ui/AutocompleteAddress/AutocompleteAddress.stories.d.ts.map +1 -0
- package/dist/ui/AutocompleteAddress/AutocompleteAddress.stories.js +30 -0
- package/dist/ui/AutocompleteAddress/AutocompleteAddress.stories.sources.d.ts +6 -0
- package/dist/ui/AutocompleteAddress/AutocompleteAddress.stories.sources.d.ts.map +1 -0
- package/dist/ui/AutocompleteAddress/AutocompleteAddress.stories.sources.js +6 -0
- package/dist/ui/AutocompleteAddress/index.d.ts +2 -0
- package/dist/ui/AutocompleteAddress/index.d.ts.map +1 -0
- package/dist/ui/AutocompleteAddress/index.js +1 -0
- package/dist/ui/Avatar/Avatar.stories.d.ts +2 -2
- package/dist/ui/Avatar/Avatar.styles.d.ts +2 -2
- package/dist/ui/Badge/Badge.js +1 -1
- package/dist/ui/Badge/Badge.stories.d.ts +14 -12
- package/dist/ui/Badge/Badge.stories.d.ts.map +1 -1
- package/dist/ui/Badge/Badge.styles.d.ts +14 -12
- package/dist/ui/Badge/Badge.styles.d.ts.map +1 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/ui/Breadcrumbs/Breadcrumbs.stories.d.ts +3 -3
- package/dist/ui/Breadcrumbs/Breadcrumbs.styles.d.ts +3 -3
- package/dist/ui/Button/Button.stories.d.ts +56 -57
- package/dist/ui/Button/Button.stories.d.ts.map +1 -1
- package/dist/ui/Button/Button.styles.d.ts +56 -57
- package/dist/ui/Button/Button.styles.d.ts.map +1 -1
- package/dist/ui/Button/Button.styles.js +0 -1
- package/dist/ui/Button/ButtonIcon.d.ts.map +1 -1
- package/dist/ui/Button/ButtonIcon.js +2 -5
- package/dist/ui/Card/Card.stories.d.ts +3 -3
- package/dist/ui/Card/Card.styles.d.ts +2 -2
- package/dist/ui/Card/CardHeader.styles.d.ts +3 -3
- package/dist/ui/Card/CardSection.styles.d.ts +3 -3
- package/dist/ui/Checkbox/Checkbox.d.ts +19 -0
- package/dist/ui/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/ui/Checkbox/Checkbox.js +17 -0
- package/dist/ui/Checkbox/Checkbox.stories.d.ts +93 -0
- package/dist/ui/Checkbox/Checkbox.stories.d.ts.map +1 -0
- package/dist/ui/Checkbox/Checkbox.stories.js +15 -0
- package/dist/ui/Checkbox/Checkbox.stories.sources.d.ts +8 -0
- package/dist/ui/Checkbox/Checkbox.stories.sources.d.ts.map +1 -0
- package/dist/ui/Checkbox/Checkbox.stories.sources.js +8 -0
- package/dist/ui/Checkbox/Checkbox.styles.d.ts +70 -0
- package/dist/ui/Checkbox/Checkbox.styles.d.ts.map +1 -0
- package/dist/ui/Checkbox/Checkbox.styles.js +62 -0
- package/dist/ui/Checkbox/CheckboxContainer.d.ts +22 -0
- package/dist/ui/Checkbox/CheckboxContainer.d.ts.map +1 -0
- package/dist/ui/Checkbox/CheckboxContainer.js +21 -0
- package/dist/ui/Checkbox/CheckboxIndicator.d.ts +7 -0
- package/dist/ui/Checkbox/CheckboxIndicator.d.ts.map +1 -0
- package/dist/ui/Checkbox/CheckboxIndicator.js +15 -0
- package/dist/ui/Checkbox/CheckboxLabel.d.ts +9 -0
- package/dist/ui/Checkbox/CheckboxLabel.d.ts.map +1 -0
- package/dist/ui/Checkbox/CheckboxLabel.js +15 -0
- package/dist/ui/Checkbox/index.d.ts +5 -0
- package/dist/ui/Checkbox/index.d.ts.map +1 -0
- package/dist/ui/Checkbox/index.js +4 -0
- package/dist/ui/Counter/Counter.d.ts +6 -0
- package/dist/ui/Counter/Counter.d.ts.map +1 -0
- package/dist/ui/Counter/Counter.js +11 -0
- package/dist/ui/Counter/Counter.stories.d.ts +29 -0
- package/dist/ui/Counter/Counter.stories.d.ts.map +1 -0
- package/dist/ui/Counter/Counter.stories.js +15 -0
- package/dist/ui/Counter/Counter.stories.sources.d.ts +6 -0
- package/dist/ui/Counter/Counter.stories.sources.d.ts.map +1 -0
- package/dist/ui/Counter/Counter.stories.sources.js +6 -0
- package/dist/ui/Counter/Counter.styles.d.ts +18 -0
- package/dist/ui/Counter/Counter.styles.d.ts.map +1 -0
- package/dist/ui/Counter/Counter.styles.js +14 -0
- package/dist/ui/Counter/index.d.ts +2 -0
- package/dist/ui/Counter/index.d.ts.map +1 -0
- package/dist/ui/Counter/index.js +1 -0
- package/dist/ui/Divider/Divider.stories.d.ts +1 -1
- package/dist/ui/Divider/Divider.styles.d.ts +1 -1
- package/dist/ui/DocumentViewer/DocumentViewer.d.ts.map +1 -1
- package/dist/ui/DocumentViewer/DocumentViewer.js +1 -3
- package/dist/ui/DocumentViewer/DocumentViewer.stories.d.ts +10 -10
- package/dist/ui/DocumentViewer/DocumentViewer.styles.d.ts +10 -10
- package/dist/ui/DocumentViewer/DocumentViewerPDF.d.ts.map +1 -1
- package/dist/ui/DocumentViewer/DocumentViewerPDF.js +4 -7
- package/dist/ui/DragAndDropFile/DragAndDropFile.d.ts +9 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.d.ts.map +1 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.js +50 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.stories.d.ts +102 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.stories.d.ts.map +1 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.stories.js +17 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.stories.sources.d.ts +10 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.stories.sources.d.ts.map +1 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.stories.sources.js +10 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.styles.d.ts +89 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.styles.d.ts.map +1 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.styles.js +89 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.web.d.ts +4 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.web.d.ts.map +1 -0
- package/dist/ui/DragAndDropFile/DragAndDropFile.web.js +175 -0
- package/dist/ui/DragAndDropFile/index.d.ts +2 -0
- package/dist/ui/DragAndDropFile/index.d.ts.map +1 -0
- package/dist/ui/DragAndDropFile/index.js +1 -0
- package/dist/ui/EmailField/EmailField.d.ts +20 -0
- package/dist/ui/EmailField/EmailField.d.ts.map +1 -0
- package/dist/ui/EmailField/EmailField.js +8 -0
- package/dist/ui/EmailField/EmailField.stories.d.ts +25 -0
- package/dist/ui/EmailField/EmailField.stories.d.ts.map +1 -0
- package/dist/ui/EmailField/EmailField.stories.js +13 -0
- package/dist/ui/EmailField/EmailField.stories.sources.d.ts +6 -0
- package/dist/ui/EmailField/EmailField.stories.sources.d.ts.map +1 -0
- package/dist/ui/EmailField/EmailField.stories.sources.js +6 -0
- package/dist/ui/EmailField/index.d.ts +2 -0
- package/dist/ui/EmailField/index.d.ts.map +1 -0
- package/dist/ui/EmailField/index.js +1 -0
- package/dist/ui/EmailInput/EmailInput.d.ts +16 -0
- package/dist/ui/EmailInput/EmailInput.d.ts.map +1 -0
- package/dist/ui/EmailInput/EmailInput.js +10 -0
- package/dist/ui/EmailInput/EmailInput.stories.d.ts +21 -0
- package/dist/ui/EmailInput/EmailInput.stories.d.ts.map +1 -0
- package/dist/ui/EmailInput/EmailInput.stories.js +13 -0
- package/dist/ui/EmailInput/EmailInput.stories.sources.d.ts +6 -0
- package/dist/ui/EmailInput/EmailInput.stories.sources.d.ts.map +1 -0
- package/dist/ui/EmailInput/EmailInput.stories.sources.js +6 -0
- package/dist/ui/EmailInput/index.d.ts +2 -0
- package/dist/ui/EmailInput/index.d.ts.map +1 -0
- package/dist/ui/EmailInput/index.js +1 -0
- package/dist/ui/EmptyState/EmptyState.stories.d.ts +4 -4
- package/dist/ui/EmptyState/EmptyState.styles.d.ts +4 -4
- package/dist/ui/FileField/FileField.d.ts +5 -0
- package/dist/ui/FileField/FileField.d.ts.map +1 -0
- package/dist/ui/FileField/FileField.js +27 -0
- package/dist/ui/FileField/FileField.stories.d.ts +15 -0
- package/dist/ui/FileField/FileField.stories.d.ts.map +1 -0
- package/dist/ui/FileField/FileField.stories.js +15 -0
- package/dist/ui/FileField/FileField.stories.sources.d.ts +8 -0
- package/dist/ui/FileField/FileField.stories.sources.d.ts.map +1 -0
- package/dist/ui/FileField/FileField.stories.sources.js +8 -0
- package/dist/ui/FileField/FileField.styles.d.ts +4 -0
- package/dist/ui/FileField/FileField.styles.d.ts.map +1 -0
- package/dist/ui/FileField/FileField.styles.js +4 -0
- package/dist/ui/FileField/index.d.ts +2 -0
- package/dist/ui/FileField/index.d.ts.map +1 -0
- package/dist/ui/FileField/index.js +1 -0
- package/dist/ui/FormControl/FormControl.stories.d.ts +17 -17
- package/dist/ui/FormControl/FormControl.stories.js +3 -3
- package/dist/ui/FormControl/FormControl.stories.sources.d.ts.map +1 -1
- package/dist/ui/FormControl/FormControl.stories.sources.js +3 -3
- package/dist/ui/FormControl/FormControl.styles.d.ts +17 -17
- package/dist/ui/FormControl/FormControlFileInput.d.ts.map +1 -1
- package/dist/ui/FormControl/FormControlFileInput.styles.d.ts +6 -6
- package/dist/ui/FormControl/TextInput.d.ts.map +1 -1
- package/dist/ui/Header/Header.stories.d.ts +10 -6
- package/dist/ui/Header/Header.stories.d.ts.map +1 -1
- package/dist/ui/Header/Header.styles.d.ts +10 -6
- package/dist/ui/Header/Header.styles.d.ts.map +1 -1
- package/dist/ui/Header/Header.styles.js +1 -0
- package/dist/ui/InputButtonAdornment/InputButtonAdornment.d.ts +9 -0
- package/dist/ui/InputButtonAdornment/InputButtonAdornment.d.ts.map +1 -0
- package/dist/ui/InputButtonAdornment/InputButtonAdornment.js +13 -0
- package/dist/ui/InputButtonAdornment/InputButtonAdornment.stories.d.ts +23 -0
- package/dist/ui/InputButtonAdornment/InputButtonAdornment.stories.d.ts.map +1 -0
- package/dist/ui/InputButtonAdornment/InputButtonAdornment.stories.js +16 -0
- package/dist/ui/InputButtonAdornment/InputButtonAdornment.stories.sources.d.ts +8 -0
- package/dist/ui/InputButtonAdornment/InputButtonAdornment.stories.sources.d.ts.map +1 -0
- package/dist/ui/InputButtonAdornment/InputButtonAdornment.stories.sources.js +8 -0
- package/dist/ui/InputButtonAdornment/InputButtonAdornment.styles.d.ts +12 -0
- package/dist/ui/InputButtonAdornment/InputButtonAdornment.styles.d.ts.map +1 -0
- package/dist/ui/InputButtonAdornment/InputButtonAdornment.styles.js +12 -0
- package/dist/ui/InputButtonAdornment/index.d.ts +2 -0
- package/dist/ui/InputButtonAdornment/index.d.ts.map +1 -0
- package/dist/ui/InputButtonAdornment/index.js +1 -0
- package/dist/ui/ListItem/ListItem.stories.d.ts +7 -7
- package/dist/ui/ListItem/ListItem.styles.d.ts +7 -7
- package/dist/ui/LucideIcon/LucideIcon.d.ts +3 -1
- package/dist/ui/LucideIcon/LucideIcon.d.ts.map +1 -1
- package/dist/ui/LucideIcon/LucideIcon.js +24 -4
- package/dist/ui/LucideIcon/LucideIcon.props.d.ts +8560 -9
- package/dist/ui/LucideIcon/LucideIcon.props.d.ts.map +1 -1
- package/dist/ui/LucideIcon/LucideIcon.props.js +1 -1
- package/dist/ui/LucideIcon/LucideIcon.stories.d.ts +4280 -4
- package/dist/ui/LucideIcon/LucideIcon.stories.d.ts.map +1 -1
- package/dist/ui/LucideIcon/LucideIcon.stories.js +2 -0
- package/dist/ui/LucideIcon/LucideIcon.stories.sources.d.ts +2 -0
- package/dist/ui/LucideIcon/LucideIcon.stories.sources.d.ts.map +1 -1
- package/dist/ui/LucideIcon/LucideIcon.stories.sources.js +2 -0
- package/dist/ui/NumberField/NumberField.d.ts +14 -0
- package/dist/ui/NumberField/NumberField.d.ts.map +1 -0
- package/dist/ui/NumberField/NumberField.js +13 -0
- package/dist/ui/NumberField/NumberField.stories.d.ts +14 -0
- package/dist/ui/NumberField/NumberField.stories.d.ts.map +1 -0
- package/dist/ui/NumberField/NumberField.stories.js +18 -0
- package/dist/ui/NumberField/NumberField.stories.sources.d.ts +6 -0
- package/dist/ui/NumberField/NumberField.stories.sources.d.ts.map +1 -0
- package/dist/ui/NumberField/NumberField.stories.sources.js +6 -0
- package/dist/ui/NumberField/NumberField.styles.d.ts +4 -0
- package/dist/ui/NumberField/NumberField.styles.d.ts.map +1 -0
- package/dist/ui/NumberField/NumberField.styles.js +4 -0
- package/dist/ui/NumberField/NumberField.web.d.ts +4 -0
- package/dist/ui/NumberField/NumberField.web.d.ts.map +1 -0
- package/dist/ui/NumberField/NumberField.web.js +10 -0
- package/dist/ui/NumberField/NumberFieldControlButton.d.ts +8 -0
- package/dist/ui/NumberField/NumberFieldControlButton.d.ts.map +1 -0
- package/dist/ui/NumberField/NumberFieldControlButton.js +6 -0
- package/dist/ui/NumberField/index.d.ts +2 -0
- package/dist/ui/NumberField/index.d.ts.map +1 -0
- package/dist/ui/NumberField/index.js +1 -0
- package/dist/ui/OtpField/OtpField.d.ts +15 -0
- package/dist/ui/OtpField/OtpField.d.ts.map +1 -0
- package/dist/ui/OtpField/OtpField.js +18 -0
- package/dist/ui/OtpField/OtpField.stories.d.ts +57 -0
- package/dist/ui/OtpField/OtpField.stories.d.ts.map +1 -0
- package/dist/ui/OtpField/OtpField.stories.js +14 -0
- package/dist/ui/OtpField/OtpField.stories.sources.d.ts +6 -0
- package/dist/ui/OtpField/OtpField.stories.sources.d.ts.map +1 -0
- package/dist/ui/OtpField/OtpField.stories.sources.js +6 -0
- package/dist/ui/OtpField/OtpField.styles.d.ts +39 -0
- package/dist/ui/OtpField/OtpField.styles.d.ts.map +1 -0
- package/dist/ui/OtpField/OtpField.styles.js +35 -0
- package/dist/ui/OtpField/index.d.ts +2 -0
- package/dist/ui/OtpField/index.d.ts.map +1 -0
- package/dist/ui/OtpField/index.js +1 -0
- package/dist/ui/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/ui/PageHeader/PageHeader.js +1 -1
- package/dist/ui/PageHeader/PageHeader.stories.d.ts +1 -1
- package/dist/ui/PageHeader/PageHeader.stories.js +1 -1
- package/dist/ui/PageHeader/PageHeader.styles.d.ts +1 -1
- package/dist/ui/PasswordField/PasswordField.d.ts +20 -0
- package/dist/ui/PasswordField/PasswordField.d.ts.map +1 -0
- package/dist/ui/PasswordField/PasswordField.js +10 -0
- package/dist/ui/PasswordField/PasswordField.stories.d.ts +33 -0
- package/dist/ui/PasswordField/PasswordField.stories.d.ts.map +1 -0
- package/dist/ui/PasswordField/PasswordField.stories.js +14 -0
- package/dist/ui/PasswordField/PasswordField.stories.sources.d.ts +6 -0
- package/dist/ui/PasswordField/PasswordField.stories.sources.d.ts.map +1 -0
- package/dist/ui/PasswordField/PasswordField.stories.sources.js +6 -0
- package/dist/ui/PasswordField/PasswordField.styles.d.ts +10 -0
- package/dist/ui/PasswordField/PasswordField.styles.d.ts.map +1 -0
- package/dist/ui/PasswordField/PasswordField.styles.js +10 -0
- package/dist/ui/PasswordField/index.d.ts +2 -0
- package/dist/ui/PasswordField/index.d.ts.map +1 -0
- package/dist/ui/PasswordField/index.js +1 -0
- package/dist/ui/PhoneField/PhoneField.d.ts +20 -0
- package/dist/ui/PhoneField/PhoneField.d.ts.map +1 -0
- package/dist/ui/PhoneField/PhoneField.js +8 -0
- package/dist/ui/PhoneField/PhoneField.stories.d.ts +25 -0
- package/dist/ui/PhoneField/PhoneField.stories.d.ts.map +1 -0
- package/dist/ui/PhoneField/PhoneField.stories.js +13 -0
- package/dist/ui/PhoneField/PhoneField.stories.sources.d.ts +6 -0
- package/dist/ui/PhoneField/PhoneField.stories.sources.d.ts.map +1 -0
- package/dist/ui/PhoneField/PhoneField.stories.sources.js +6 -0
- package/dist/ui/PhoneField/index.d.ts +2 -0
- package/dist/ui/PhoneField/index.d.ts.map +1 -0
- package/dist/ui/PhoneField/index.js +1 -0
- package/dist/ui/PhoneInput/PhoneInput.d.ts +16 -0
- package/dist/ui/PhoneInput/PhoneInput.d.ts.map +1 -0
- package/dist/ui/PhoneInput/PhoneInput.js +7 -0
- package/dist/ui/PhoneInput/PhoneInput.stories.d.ts +21 -0
- package/dist/ui/PhoneInput/PhoneInput.stories.d.ts.map +1 -0
- package/dist/ui/PhoneInput/PhoneInput.stories.js +13 -0
- package/dist/ui/PhoneInput/PhoneInput.stories.sources.d.ts +6 -0
- package/dist/ui/PhoneInput/PhoneInput.stories.sources.d.ts.map +1 -0
- package/dist/ui/PhoneInput/PhoneInput.stories.sources.js +6 -0
- package/dist/ui/PhoneInput/index.d.ts +2 -0
- package/dist/ui/PhoneInput/index.d.ts.map +1 -0
- package/dist/ui/PhoneInput/index.js +1 -0
- package/dist/ui/Popover/Popover.stories.d.ts +6 -6
- package/dist/ui/Popover/Popover.styles.d.ts +6 -6
- package/dist/ui/PriceInput/PriceInput.css +9 -0
- package/dist/ui/PriceInput/PriceInput.d.ts +14 -0
- package/dist/ui/PriceInput/PriceInput.d.ts.map +1 -0
- package/dist/ui/PriceInput/PriceInput.js +16 -0
- package/dist/ui/PriceInput/PriceInput.stories.d.ts +51 -0
- package/dist/ui/PriceInput/PriceInput.stories.d.ts.map +1 -0
- package/dist/ui/PriceInput/PriceInput.stories.js +19 -0
- package/dist/ui/PriceInput/PriceInput.stories.sources.d.ts +6 -0
- package/dist/ui/PriceInput/PriceInput.stories.sources.d.ts.map +1 -0
- package/dist/ui/PriceInput/PriceInput.stories.sources.js +6 -0
- package/dist/ui/PriceInput/PriceInput.styles.d.ts +36 -0
- package/dist/ui/PriceInput/PriceInput.styles.d.ts.map +1 -0
- package/dist/ui/PriceInput/PriceInput.styles.js +32 -0
- package/dist/ui/PriceInput/PriceInput.web.d.ts +8 -0
- package/dist/ui/PriceInput/PriceInput.web.d.ts.map +1 -0
- package/dist/ui/PriceInput/PriceInput.web.js +21 -0
- package/dist/ui/PriceInput/index.d.ts +2 -0
- package/dist/ui/PriceInput/index.d.ts.map +1 -0
- package/dist/ui/PriceInput/index.js +1 -0
- package/dist/ui/ProgressBar/ProgressBar.stories.d.ts +7 -7
- package/dist/ui/ProgressBar/ProgressBar.styles.d.ts +7 -7
- package/dist/ui/ProgressBar/ProgressBarDeterminate.js +1 -1
- package/dist/ui/ProgressBar/ProgressBarIndeterminate.js +1 -1
- package/dist/ui/ProgressBar/ProgressBarLoop.js +1 -1
- package/dist/ui/RadioGroup/RadioGroup.d.ts +21 -0
- package/dist/ui/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/ui/RadioGroup/RadioGroup.js +11 -0
- package/dist/ui/RadioGroup/RadioGroup.stories.d.ts +164 -0
- package/dist/ui/RadioGroup/RadioGroup.stories.d.ts.map +1 -0
- package/dist/ui/RadioGroup/RadioGroup.stories.js +23 -0
- package/dist/ui/RadioGroup/RadioGroup.stories.sources.d.ts +10 -0
- package/dist/ui/RadioGroup/RadioGroup.stories.sources.d.ts.map +1 -0
- package/dist/ui/RadioGroup/RadioGroup.stories.sources.js +10 -0
- package/dist/ui/RadioGroup/RadioGroup.styles.d.ts +140 -0
- package/dist/ui/RadioGroup/RadioGroup.styles.d.ts.map +1 -0
- package/dist/ui/RadioGroup/RadioGroup.styles.js +129 -0
- package/dist/ui/RadioGroup/RadioGroupCard.d.ts +12 -0
- package/dist/ui/RadioGroup/RadioGroupCard.d.ts.map +1 -0
- package/dist/ui/RadioGroup/RadioGroupCard.js +15 -0
- package/dist/ui/RadioGroup/RadioGroupContext.d.ts +8 -0
- package/dist/ui/RadioGroup/RadioGroupContext.d.ts.map +1 -0
- package/dist/ui/RadioGroup/RadioGroupContext.js +3 -0
- package/dist/ui/RadioGroup/RadioGroupItem.d.ts +8 -0
- package/dist/ui/RadioGroup/RadioGroupItem.d.ts.map +1 -0
- package/dist/ui/RadioGroup/RadioGroupItem.js +13 -0
- package/dist/ui/RadioGroup/RadioGroupItem.styles.d.ts +24 -0
- package/dist/ui/RadioGroup/RadioGroupItem.styles.d.ts.map +1 -0
- package/dist/ui/RadioGroup/RadioGroupItem.styles.js +20 -0
- package/dist/ui/RadioGroup/RadioInput.d.ts +7 -0
- package/dist/ui/RadioGroup/RadioInput.d.ts.map +1 -0
- package/dist/ui/RadioGroup/RadioInput.js +13 -0
- package/dist/ui/RadioGroup/index.d.ts +18 -0
- package/dist/ui/RadioGroup/index.d.ts.map +1 -0
- package/dist/ui/RadioGroup/index.js +7 -0
- package/dist/ui/ResourceList/ResourceList.stories.d.ts +2 -2
- package/dist/ui/ResourceList/ResourceList.styles.d.ts +2 -2
- package/dist/ui/Select/NativePicker.d.ts +16 -0
- package/dist/ui/Select/NativePicker.d.ts.map +1 -0
- package/dist/ui/Select/NativePicker.js +20 -0
- package/dist/ui/Select/Select.d.ts +24 -0
- package/dist/ui/Select/Select.d.ts.map +1 -0
- package/dist/ui/Select/Select.js +28 -0
- package/dist/ui/Select/Select.stories.d.ts +80 -0
- package/dist/ui/Select/Select.stories.d.ts.map +1 -0
- package/dist/ui/Select/Select.stories.js +24 -0
- package/dist/ui/Select/Select.stories.sources.d.ts +8 -0
- package/dist/ui/Select/Select.stories.sources.d.ts.map +1 -0
- package/dist/ui/Select/Select.stories.sources.js +8 -0
- package/dist/ui/Select/Select.styles.d.ts +60 -0
- package/dist/ui/Select/Select.styles.d.ts.map +1 -0
- package/dist/ui/Select/Select.styles.js +57 -0
- package/dist/ui/Select/SelectInput.d.ts +11 -0
- package/dist/ui/Select/SelectInput.d.ts.map +1 -0
- package/dist/ui/Select/SelectInput.ios.d.ts +9 -0
- package/dist/ui/Select/SelectInput.ios.d.ts.map +1 -0
- package/dist/ui/Select/SelectInput.ios.js +28 -0
- package/dist/ui/Select/SelectInput.js +6 -0
- package/dist/ui/Select/index.d.ts +7 -0
- package/dist/ui/Select/index.d.ts.map +1 -0
- package/dist/ui/Select/index.js +3 -0
- package/dist/ui/SelectMultiple/SelectMultiple.d.ts +14 -0
- package/dist/ui/SelectMultiple/SelectMultiple.d.ts.map +1 -0
- package/dist/ui/SelectMultiple/SelectMultiple.js +6 -0
- package/dist/ui/SelectMultiple/SelectMultiple.stories.d.ts +77 -0
- package/dist/ui/SelectMultiple/SelectMultiple.stories.d.ts.map +1 -0
- package/dist/ui/SelectMultiple/SelectMultiple.stories.js +25 -0
- package/dist/ui/SelectMultiple/SelectMultiple.stories.sources.d.ts +8 -0
- package/dist/ui/SelectMultiple/SelectMultiple.stories.sources.d.ts.map +1 -0
- package/dist/ui/SelectMultiple/SelectMultiple.stories.sources.js +8 -0
- package/dist/ui/SelectMultiple/SelectMultiple.styles.d.ts +66 -0
- package/dist/ui/SelectMultiple/SelectMultiple.styles.d.ts.map +1 -0
- package/dist/ui/SelectMultiple/SelectMultiple.styles.js +66 -0
- package/dist/ui/SelectMultiple/SelectMultiple.web.d.ts +14 -0
- package/dist/ui/SelectMultiple/SelectMultiple.web.d.ts.map +1 -0
- package/dist/ui/SelectMultiple/SelectMultiple.web.js +49 -0
- package/dist/ui/SelectMultiple/index.d.ts +3 -0
- package/dist/ui/SelectMultiple/index.d.ts.map +1 -0
- package/dist/ui/SelectMultiple/index.js +1 -0
- package/dist/ui/Sidebar/Sidebar.stories.d.ts +19 -19
- package/dist/ui/Sidebar/Sidebar.styles.d.ts +19 -19
- package/dist/ui/Signature/Signature.stories.d.ts +2 -2
- package/dist/ui/Signature/Signature.styles.d.ts +2 -2
- package/dist/ui/Signature/Signature.web.d.ts.map +1 -1
- package/dist/ui/Signature/Signature.web.js +5 -2
- package/dist/ui/Switch/Switch.d.ts +20 -0
- package/dist/ui/Switch/Switch.d.ts.map +1 -0
- package/dist/ui/Switch/Switch.js +42 -0
- package/dist/ui/Switch/Switch.stories.d.ts +73 -0
- package/dist/ui/Switch/Switch.stories.d.ts.map +1 -0
- package/dist/ui/Switch/Switch.stories.js +19 -0
- package/dist/ui/Switch/Switch.stories.sources.d.ts +8 -0
- package/dist/ui/Switch/Switch.stories.sources.d.ts.map +1 -0
- package/dist/ui/Switch/Switch.stories.sources.js +8 -0
- package/dist/ui/Switch/Switch.styles.d.ts +55 -0
- package/dist/ui/Switch/Switch.styles.d.ts.map +1 -0
- package/dist/ui/Switch/Switch.styles.js +51 -0
- package/dist/ui/Switch/index.d.ts +2 -0
- package/dist/ui/Switch/index.d.ts.map +1 -0
- package/dist/ui/Switch/index.js +1 -0
- package/dist/ui/Tabs/Tabs.d.ts.map +1 -1
- package/dist/ui/Tabs/Tabs.js +2 -2
- package/dist/ui/Tabs/Tabs.stories.d.ts +5 -17
- package/dist/ui/Tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/ui/Tabs/Tabs.styles.d.ts +5 -17
- package/dist/ui/Tabs/Tabs.styles.d.ts.map +1 -1
- package/dist/ui/Tabs/Tabs.styles.js +0 -8
- package/dist/ui/Tag/Tag.stories.d.ts +4 -4
- package/dist/ui/Tag/Tag.styles.d.ts +4 -4
- package/dist/ui/TextField/TextField.d.ts +22 -0
- package/dist/ui/TextField/TextField.d.ts.map +1 -0
- package/dist/ui/TextField/TextField.js +14 -0
- package/dist/ui/TextField/TextField.stories.d.ts +29 -0
- package/dist/ui/TextField/TextField.stories.d.ts.map +1 -0
- package/dist/ui/TextField/TextField.stories.js +15 -0
- package/dist/ui/TextField/TextField.stories.sources.d.ts +8 -0
- package/dist/ui/TextField/TextField.stories.sources.d.ts.map +1 -0
- package/dist/ui/TextField/TextField.stories.sources.js +8 -0
- package/dist/ui/TextField/TextField.styles.d.ts +4 -0
- package/dist/ui/TextField/TextField.styles.d.ts.map +1 -0
- package/dist/ui/TextField/TextField.styles.js +4 -0
- package/dist/ui/TextField/index.d.ts +2 -0
- package/dist/ui/TextField/index.d.ts.map +1 -0
- package/dist/ui/TextField/index.js +1 -0
- package/dist/ui/TextInputArray/TextInputArray.d.ts +21 -0
- package/dist/ui/TextInputArray/TextInputArray.d.ts.map +1 -0
- package/dist/ui/TextInputArray/TextInputArray.js +53 -0
- package/dist/ui/TextInputArray/TextInputArray.stories.d.ts +13 -0
- package/dist/ui/TextInputArray/TextInputArray.stories.d.ts.map +1 -0
- package/dist/ui/TextInputArray/TextInputArray.stories.js +24 -0
- package/dist/ui/TextInputArray/TextInputArray.stories.sources.d.ts +8 -0
- package/dist/ui/TextInputArray/TextInputArray.stories.sources.d.ts.map +1 -0
- package/dist/ui/TextInputArray/TextInputArray.stories.sources.js +8 -0
- package/dist/ui/TextInputArray/index.d.ts +2 -0
- package/dist/ui/TextInputArray/index.d.ts.map +1 -0
- package/dist/ui/TextInputArray/index.js +1 -0
- package/dist/ui/TextareaField/TextareaField.d.ts +22 -0
- package/dist/ui/TextareaField/TextareaField.d.ts.map +1 -0
- package/dist/ui/TextareaField/TextareaField.js +8 -0
- package/dist/ui/TextareaField/TextareaField.stories.d.ts +26 -0
- package/dist/ui/TextareaField/TextareaField.stories.d.ts.map +1 -0
- package/dist/ui/TextareaField/TextareaField.stories.js +13 -0
- package/dist/ui/TextareaField/TextareaField.stories.sources.d.ts +6 -0
- package/dist/ui/TextareaField/TextareaField.stories.sources.d.ts.map +1 -0
- package/dist/ui/TextareaField/TextareaField.stories.sources.js +6 -0
- package/dist/ui/TextareaField/index.d.ts +2 -0
- package/dist/ui/TextareaField/index.d.ts.map +1 -0
- package/dist/ui/TextareaField/index.js +1 -0
- package/dist/ui/TextareaInput/TextareaInput.d.ts +25 -0
- package/dist/ui/TextareaInput/TextareaInput.d.ts.map +1 -0
- package/dist/ui/TextareaInput/TextareaInput.js +7 -0
- package/dist/ui/TextareaInput/TextareaInput.stories.d.ts +29 -0
- package/dist/ui/TextareaInput/TextareaInput.stories.d.ts.map +1 -0
- package/dist/ui/TextareaInput/TextareaInput.stories.js +13 -0
- package/dist/ui/TextareaInput/TextareaInput.stories.sources.d.ts +6 -0
- package/dist/ui/TextareaInput/TextareaInput.stories.sources.d.ts.map +1 -0
- package/dist/ui/TextareaInput/TextareaInput.stories.sources.js +6 -0
- package/dist/ui/TextareaInput/index.d.ts +2 -0
- package/dist/ui/TextareaInput/index.d.ts.map +1 -0
- package/dist/ui/TextareaInput/index.js +1 -0
- package/dist/ui/Toast/Toast.d.ts +13 -2
- package/dist/ui/Toast/Toast.d.ts.map +1 -1
- package/dist/ui/Toast/Toast.js +6 -35
- package/dist/ui/Toast/Toast.stories.d.ts +39 -21
- package/dist/ui/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/ui/Toast/Toast.stories.js +12 -3
- package/dist/ui/Toast/Toast.stories.sources.d.ts +16 -0
- package/dist/ui/Toast/Toast.stories.sources.d.ts.map +1 -1
- package/dist/ui/Toast/Toast.stories.sources.js +17 -1
- package/dist/ui/Toast/Toast.styles.d.ts +31 -21
- package/dist/ui/Toast/Toast.styles.d.ts.map +1 -1
- package/dist/ui/Toast/Toast.styles.js +29 -19
- package/dist/ui/Toast/ToastContext.d.ts +1 -1
- package/dist/ui/Toast/ToastContext.d.ts.map +1 -1
- package/dist/ui/Toast/ToastType.d.ts +11 -0
- package/dist/ui/Toast/ToastType.d.ts.map +1 -0
- package/dist/ui/Toast/ToastType.js +46 -0
- package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.stories.d.ts +4 -4
- package/dist/ui/ToolbarBottomNav/ToolbarBottomNav.styles.d.ts +4 -4
- package/dist/ui/ToolbarTop/ToolbarTop.stories.d.ts +3 -3
- package/dist/ui/ToolbarTop/ToolbarTop.styles.d.ts +3 -3
- package/dist/ui/index.d.ts +24 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +24 -0
- package/package.json +37 -26
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Button, ButtonIcon, Divider, FormControl, FormControlCaption, FormControlHint, FormControlLabel, InputHeading, LucideIcon, Typography, } from '@alveole/components';
|
|
3
|
+
import { FlashList } from '@shopify/flash-list';
|
|
4
|
+
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import { KeyboardAvoidingView, Modal, Platform, Pressable, useWindowDimensions } from 'react-native';
|
|
6
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
7
|
+
import { TextField } from '../TextField';
|
|
8
|
+
import { useStyles } from './Autocomplete.styles';
|
|
9
|
+
import { AutocompleteChip } from './AutocompleteChip';
|
|
10
|
+
export const isAutocompleteOptionWithGroup = (option) => {
|
|
11
|
+
return option != null && typeof option === 'object' && 'group' in option && typeof option.group === 'string';
|
|
12
|
+
};
|
|
13
|
+
export const isAutocompleteOptionWithGroupArray = (options) => {
|
|
14
|
+
return options.every(isAutocompleteOptionWithGroup);
|
|
15
|
+
};
|
|
16
|
+
function useDebouncedCallback(cb, delay = 250) {
|
|
17
|
+
const timer = useRef(null);
|
|
18
|
+
return useCallback((...args) => {
|
|
19
|
+
if (timer.current)
|
|
20
|
+
clearTimeout(timer.current);
|
|
21
|
+
timer.current = setTimeout(() => cb(...args), delay);
|
|
22
|
+
}, [cb, delay]);
|
|
23
|
+
}
|
|
24
|
+
export const Autocomplete = (props) => {
|
|
25
|
+
const { value, options, placeholder = 'Sélectionner…', isMulti = true, disabledFilterSearch, disabledSearch, disabled, label, labelRight, hint, error, success, allowEmpty = true, autoFocus = true, onChange, onSearchChange, allowCreate = false, onCreateOption, createOptionLabel = (input) => `Ajouter « ${input} »`, createOptionValue = (input) => input, } = props;
|
|
26
|
+
const styles = useStyles();
|
|
27
|
+
const { top, bottom } = useSafeAreaInsets();
|
|
28
|
+
const [open, setOpen] = useState(false);
|
|
29
|
+
const [query, setQuery] = useState('');
|
|
30
|
+
const [selected, setSelected] = useState(value ?? []);
|
|
31
|
+
const [syncedValueKey, setSyncedValueKey] = useState(() => value?.map(o => o.value).join('|') ?? '');
|
|
32
|
+
const searchRef = React.useRef(null);
|
|
33
|
+
const debouncedOnSearchChange = useDebouncedCallback((text) => onSearchChange?.(text), 500);
|
|
34
|
+
const selectedIndexByValue = useMemo(() => {
|
|
35
|
+
const map = new Map();
|
|
36
|
+
selected.forEach((o, i) => map.set(o.value, i));
|
|
37
|
+
return map;
|
|
38
|
+
}, [selected]);
|
|
39
|
+
const hasExactLabel = useMemo(() => {
|
|
40
|
+
const q = query.trim().toLowerCase();
|
|
41
|
+
if (!q)
|
|
42
|
+
return true;
|
|
43
|
+
return options.some(o => o.label.toLowerCase() === q) || selected.some(o => o.label.toLowerCase() === q);
|
|
44
|
+
}, [options, selected, query]);
|
|
45
|
+
const filteredOptions = useMemo(() => {
|
|
46
|
+
const base = options ?? [];
|
|
47
|
+
const filtered = disabledFilterSearch || query.trim().length === 0
|
|
48
|
+
? base
|
|
49
|
+
: base.filter(o => o.label.toLowerCase().includes(query.toLowerCase()));
|
|
50
|
+
if (isMulti && isAutocompleteOptionWithGroup(filtered[0]))
|
|
51
|
+
return filtered;
|
|
52
|
+
const selInList = filtered.filter(o => selectedIndexByValue.has(o.value));
|
|
53
|
+
const diff = filtered.filter(o => !selectedIndexByValue.has(o.value));
|
|
54
|
+
return [...selInList, ...diff];
|
|
55
|
+
}, [options, query, disabledFilterSearch, selectedIndexByValue, isMulti]);
|
|
56
|
+
const byValue = (arr) => {
|
|
57
|
+
const map = new Map();
|
|
58
|
+
arr.forEach(o => map.set(o.value, o));
|
|
59
|
+
return map;
|
|
60
|
+
};
|
|
61
|
+
const makeMeta = (prev, next) => {
|
|
62
|
+
const prevMap = byValue(prev);
|
|
63
|
+
const nextMap = byValue(next);
|
|
64
|
+
const added = next.filter(o => !prevMap.has(o.value));
|
|
65
|
+
const removed = prev.filter(o => !nextMap.has(o.value));
|
|
66
|
+
const created = added.filter(o => o.__created);
|
|
67
|
+
return { added, removed, created };
|
|
68
|
+
};
|
|
69
|
+
const commit = (next) => {
|
|
70
|
+
setSelected(next);
|
|
71
|
+
const meta = makeMeta(selected, next);
|
|
72
|
+
onChange?.(next, meta);
|
|
73
|
+
};
|
|
74
|
+
const toggleOption = (opt) => {
|
|
75
|
+
if (!isMulti) {
|
|
76
|
+
commit([opt]);
|
|
77
|
+
setOpen(false);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const exists = selectedIndexByValue.has(opt.value);
|
|
81
|
+
const next = exists ? selected.filter(o => o.value !== opt.value) : [...selected, opt];
|
|
82
|
+
commit(next);
|
|
83
|
+
};
|
|
84
|
+
const onPressInput = () => {
|
|
85
|
+
if (disabled)
|
|
86
|
+
return;
|
|
87
|
+
setQuery('');
|
|
88
|
+
setOpen(true);
|
|
89
|
+
if (autoFocus)
|
|
90
|
+
setTimeout(() => searchRef.current?.focus(), 250);
|
|
91
|
+
};
|
|
92
|
+
const handleSearchChange = (text) => {
|
|
93
|
+
setQuery(text);
|
|
94
|
+
debouncedOnSearchChange(text);
|
|
95
|
+
};
|
|
96
|
+
const handleCreateFromQuery = () => {
|
|
97
|
+
const label = query.trim();
|
|
98
|
+
if (!label)
|
|
99
|
+
return;
|
|
100
|
+
const created = {
|
|
101
|
+
value: createOptionValue(label),
|
|
102
|
+
label,
|
|
103
|
+
__created: true,
|
|
104
|
+
};
|
|
105
|
+
const next = isMulti ? [...selected, created] : [created];
|
|
106
|
+
commit(next);
|
|
107
|
+
onCreateOption?.(created);
|
|
108
|
+
if (!isMulti)
|
|
109
|
+
setOpen(false);
|
|
110
|
+
setQuery('');
|
|
111
|
+
};
|
|
112
|
+
const { width } = useWindowDimensions();
|
|
113
|
+
const renderChipConstrained = (opt) => (_jsx(AutocompleteChip, { isMulti: isMulti, label: opt.label, onToggle: () => toggleOption(opt), maxWidth: Math.round(width * 0.65) }, opt.value));
|
|
114
|
+
const currentValueKey = value?.map(o => o.value).join('|') ?? '';
|
|
115
|
+
if (syncedValueKey !== currentValueKey) {
|
|
116
|
+
setSyncedValueKey(currentValueKey);
|
|
117
|
+
setSelected(value ?? []);
|
|
118
|
+
}
|
|
119
|
+
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(Pressable, { onPress: onPressInput, disabled: disabled, style: styles.input, children: _jsxs(Box, { style: styles.inputInner, children: [selected.length === 0 ? (_jsx(Typography, { style: styles.inputPlaceholder, children: placeholder })) : (_jsx(Box, { display: "flex", flexDirection: "row", gap: '050', flexWrap: "wrap", children: selected.map(renderChipConstrained) })), _jsx(LucideIcon, { name: "ChevronDown", size: "sm", style: styles.autocompleteIcon })] }) }), (error || success) && _jsx(FormControlCaption, { error: error, success: success }), _jsx(Modal, { visible: open, animationType: "fade", transparent: true, onRequestClose: () => setOpen(false), children: _jsx(KeyboardAvoidingView, { behavior: Platform.select({ ios: 'padding', android: undefined }), style: { ...styles.modalOverlay, flex: 1, paddingTop: top }, children: _jsxs(Box, { style: { ...styles.modalContent }, children: [_jsxs(Box, { tag: "modal-header", style: styles.modalHeader, children: [_jsx(Typography, { style: styles.nativeLabel, children: label ?? 'Sélection' }), _jsx(Box, { ml: 'auto', mr: "100", children: _jsx(ButtonIcon, { icon: "Check", variant: "primary", onPress: () => setOpen(false) }) })] }), _jsx(Divider, { mt: '050', mb: '050' }), !isMulti && (_jsx(Box, { pl: "100", pr: "100", children: selected.length > 0 && (_jsxs(Box, { mt: 'auto', children: [_jsxs(Box, { display: "flex", pl: '100', flexDirection: "row", gap: '050', children: [_jsx(LucideIcon, { name: "Check", size: "md", style: { margin: 'auto' } }), _jsx(Typography, { mr: 48, mt: 4, style: styles.nativeSimpleValue, children: selected[0]?.label })] }), allowEmpty && (_jsxs(_Fragment, { children: [_jsx(Box, { display: "flex", flexDirection: "row", justify: 'flex-end', mt: '050', children: _jsx(Button, { noPadding: true, title: "Effacer", size: "md", variant: "tertiary", endIcon: 'Trash', onPress: () => commit([]) }) }), disabledSearch && _jsx(Divider, { mt: '050' })] }))] })) })), !disabledSearch && (_jsx(Box, { pl: "100", pr: "100", pb: "100", children: _jsx(TextField, { ref: searchRef, label: "", value: query, onChangeText: handleSearchChange, placeholder: placeholder ?? 'Rechercher…', editable: !disabledFilterSearch }) })), allowCreate && query.trim().length > 0 && !hasExactLabel && (_jsx(Pressable, { onPress: handleCreateFromQuery, style: styles.nativeItem, children: _jsxs(Box, { display: "flex", flexDirection: "row", gap: '050', children: [_jsx(LucideIcon, { name: "Plus", size: "md" }), _jsx(Typography, { style: styles.nativeItemTextNew, children: createOptionLabel(query.trim()) })] }) })), filteredOptions.length === 0 ? (allowCreate && query.trim().length > 0 && !hasExactLabel ? null : (_jsx(Box, { pl: "100", pr: "100", children: _jsx(Typography, { children: "Aucun r\u00E9sultat" }) }))) : (_jsx(FlashList, { data: filteredOptions, keyExtractor: item => item.value, keyboardShouldPersistTaps: "handled", ItemSeparatorComponent: Divider, contentContainerStyle: { paddingBottom: bottom }, renderItem: ({ item, index }) => {
|
|
120
|
+
const isSelected = selectedIndexByValue.has(item.value);
|
|
121
|
+
const prevItem = filteredOptions[index - 1];
|
|
122
|
+
const showGroupHeader = isAutocompleteOptionWithGroup(item) &&
|
|
123
|
+
(!isAutocompleteOptionWithGroup(prevItem) || prevItem.group !== item.group);
|
|
124
|
+
return (_jsxs(_Fragment, { children: [showGroupHeader && _jsx(Typography, { style: styles.groupHeader, children: item.group }), _jsx(Pressable, { onPress: () => toggleOption(item), style: {
|
|
125
|
+
...styles.nativeItem,
|
|
126
|
+
backgroundColor: isSelected
|
|
127
|
+
? styles.nativeItemSelected.backgroundColor
|
|
128
|
+
: styles.nativeItem.backgroundColor,
|
|
129
|
+
}, children: _jsxs(Box, { display: "flex", flexDirection: "row", justify: "space-between", children: [_jsx(Typography, { style: styles.nativeItemText, children: item.label }), isSelected && _jsx(LucideIcon, { name: "Check", size: "sm" })] }) })] }));
|
|
130
|
+
} }))] }) }) })] }));
|
|
131
|
+
};
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AutocompleteProps } from './Autocomplete';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
tags: "ui"[];
|
|
6
|
+
experimental: false;
|
|
7
|
+
description: string;
|
|
8
|
+
component: (props: AutocompleteProps) => React.JSX.Element;
|
|
9
|
+
styleFn: () => {
|
|
10
|
+
select: {
|
|
11
|
+
lineHeight: number;
|
|
12
|
+
width: "100%";
|
|
13
|
+
borderWidth: number;
|
|
14
|
+
backgroundColor: "transparent";
|
|
15
|
+
appearance: "none";
|
|
16
|
+
fontSize: 14;
|
|
17
|
+
letterSpacing: 0;
|
|
18
|
+
fontFamily: string;
|
|
19
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
20
|
+
outline: string;
|
|
21
|
+
paddingTop: number;
|
|
22
|
+
paddingBottom: number;
|
|
23
|
+
color: string;
|
|
24
|
+
};
|
|
25
|
+
inputInner: {
|
|
26
|
+
display: "flex";
|
|
27
|
+
flexDirection: "row";
|
|
28
|
+
gap: import("@alveole/theme").Spacing;
|
|
29
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
30
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
31
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
32
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
33
|
+
borderRadius: number;
|
|
34
|
+
borderWidth: number;
|
|
35
|
+
borderColor: string;
|
|
36
|
+
backgroundColor: "#FFFFFF";
|
|
37
|
+
overflow: "hidden";
|
|
38
|
+
width: "100%";
|
|
39
|
+
};
|
|
40
|
+
inputContainer: {
|
|
41
|
+
width: "100%";
|
|
42
|
+
};
|
|
43
|
+
inputDisabled: {
|
|
44
|
+
borderRadius: number;
|
|
45
|
+
backgroundColor: string;
|
|
46
|
+
};
|
|
47
|
+
control: {
|
|
48
|
+
minHeight: import("@alveole/theme").Spacing;
|
|
49
|
+
flexWrap: "inherit";
|
|
50
|
+
borderColor: string;
|
|
51
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
52
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
53
|
+
borderRadius: number;
|
|
54
|
+
};
|
|
55
|
+
controlDisabled: {
|
|
56
|
+
backgroundColor: string;
|
|
57
|
+
};
|
|
58
|
+
multiValue: {
|
|
59
|
+
borderRadius: import("@alveole/theme").Spacing;
|
|
60
|
+
backgroundColor: string;
|
|
61
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
62
|
+
};
|
|
63
|
+
multiValueDisabled: {
|
|
64
|
+
backgroundColor: "#FFFFFF";
|
|
65
|
+
borderColor: string;
|
|
66
|
+
borderWidth: number;
|
|
67
|
+
borderRadius: import("@alveole/theme").Spacing;
|
|
68
|
+
borderStyle: "solid";
|
|
69
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
70
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
71
|
+
};
|
|
72
|
+
multiValueRemoveHover: {
|
|
73
|
+
backgroundColor: string;
|
|
74
|
+
cursor: "pointer";
|
|
75
|
+
};
|
|
76
|
+
multiValueRemoveDisabled: {
|
|
77
|
+
display: "none";
|
|
78
|
+
};
|
|
79
|
+
dropdownIndicator: {
|
|
80
|
+
color: string;
|
|
81
|
+
padding: import("@alveole/theme").Spacing;
|
|
82
|
+
};
|
|
83
|
+
dropdownIndicatorDisabled: {
|
|
84
|
+
display: "none";
|
|
85
|
+
};
|
|
86
|
+
separatorIndicator: {
|
|
87
|
+
color: string;
|
|
88
|
+
};
|
|
89
|
+
indicatorSeparatorDisabled: {
|
|
90
|
+
display: "none";
|
|
91
|
+
};
|
|
92
|
+
clearIndicator: {
|
|
93
|
+
color: string;
|
|
94
|
+
padding: import("@alveole/theme").Spacing;
|
|
95
|
+
};
|
|
96
|
+
nativeLabel: {
|
|
97
|
+
color: string;
|
|
98
|
+
fontSize: 18 | 20;
|
|
99
|
+
lineHeight: 24 | 28;
|
|
100
|
+
letterSpacing: 0;
|
|
101
|
+
fontFamily: string;
|
|
102
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
103
|
+
};
|
|
104
|
+
nativeValue: {
|
|
105
|
+
color: string;
|
|
106
|
+
fontSize: 14;
|
|
107
|
+
lineHeight: 20;
|
|
108
|
+
letterSpacing: 0;
|
|
109
|
+
fontFamily: string;
|
|
110
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
111
|
+
};
|
|
112
|
+
nativeSimpleValue: {
|
|
113
|
+
color: string;
|
|
114
|
+
fontSize: 14;
|
|
115
|
+
lineHeight: 20;
|
|
116
|
+
letterSpacing: 0;
|
|
117
|
+
fontFamily: string;
|
|
118
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
119
|
+
};
|
|
120
|
+
nativeItem: {
|
|
121
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
122
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
123
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
124
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
125
|
+
backgroundColor: string;
|
|
126
|
+
};
|
|
127
|
+
nativeItemText: {
|
|
128
|
+
color: string;
|
|
129
|
+
fontSize: 14;
|
|
130
|
+
lineHeight: 20;
|
|
131
|
+
letterSpacing: 0;
|
|
132
|
+
fontFamily: string;
|
|
133
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
134
|
+
};
|
|
135
|
+
nativeItemTextNew: {
|
|
136
|
+
color: string;
|
|
137
|
+
fontSize: 14;
|
|
138
|
+
lineHeight: 20;
|
|
139
|
+
letterSpacing: 0;
|
|
140
|
+
fontFamily: string;
|
|
141
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
142
|
+
};
|
|
143
|
+
nativeItemSelected: {
|
|
144
|
+
backgroundColor: string;
|
|
145
|
+
};
|
|
146
|
+
input: {
|
|
147
|
+
display: "flex";
|
|
148
|
+
flexDirection: "row";
|
|
149
|
+
outline: string;
|
|
150
|
+
color: string;
|
|
151
|
+
fontFamily: string;
|
|
152
|
+
fontSize: 14;
|
|
153
|
+
minHeight: number;
|
|
154
|
+
flex: number;
|
|
155
|
+
};
|
|
156
|
+
inputPlaceholder: {
|
|
157
|
+
fontSize: 14;
|
|
158
|
+
lineHeight: 20;
|
|
159
|
+
letterSpacing: 0;
|
|
160
|
+
fontFamily: string;
|
|
161
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
162
|
+
color: string;
|
|
163
|
+
};
|
|
164
|
+
autocompleteIcon: {
|
|
165
|
+
position: "absolute";
|
|
166
|
+
right: import("@alveole/theme").Spacing;
|
|
167
|
+
top: string;
|
|
168
|
+
};
|
|
169
|
+
modalOverlay: {
|
|
170
|
+
flex: number;
|
|
171
|
+
justifyContent: "flex-end";
|
|
172
|
+
backgroundColor: string;
|
|
173
|
+
};
|
|
174
|
+
modalContent: {
|
|
175
|
+
flex: number;
|
|
176
|
+
backgroundColor: "white";
|
|
177
|
+
borderTopLeftRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
178
|
+
borderTopRightRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
179
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
180
|
+
};
|
|
181
|
+
modalHeader: {
|
|
182
|
+
display: "flex";
|
|
183
|
+
flexDirection: "row";
|
|
184
|
+
justifyContent: "space-between";
|
|
185
|
+
alignItems: "center";
|
|
186
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
187
|
+
};
|
|
188
|
+
groupHeader: {
|
|
189
|
+
color: string;
|
|
190
|
+
textTransform: "uppercase";
|
|
191
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
192
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
193
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
194
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
195
|
+
backgroundColor: string;
|
|
196
|
+
fontSize: 12;
|
|
197
|
+
lineHeight: 20;
|
|
198
|
+
letterSpacing: 0;
|
|
199
|
+
fontFamily: string;
|
|
200
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
201
|
+
};
|
|
202
|
+
groupHeading: {
|
|
203
|
+
backgroundColor: string;
|
|
204
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
205
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
206
|
+
color: string;
|
|
207
|
+
textTransform: "uppercase";
|
|
208
|
+
marginBottom: number;
|
|
209
|
+
fontSize: 12;
|
|
210
|
+
lineHeight: 20;
|
|
211
|
+
letterSpacing: 0;
|
|
212
|
+
fontFamily: string;
|
|
213
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
export default _default;
|
|
218
|
+
export declare const Default: () => React.JSX.Element;
|
|
219
|
+
export declare const SingleValue: () => React.JSX.Element;
|
|
220
|
+
export declare const WithSearch: () => React.JSX.Element;
|
|
221
|
+
export declare const WithGroups: () => React.JSX.Element;
|
|
222
|
+
export declare const AllowCreate: () => React.JSX.Element;
|
|
223
|
+
export * as Sources from './Autocomplete.stories.sources';
|
|
224
|
+
//# sourceMappingURL=Autocomplete.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Autocomplete.stories.d.ts","sourceRoot":"","sources":["../../../src/ui/Autocomplete/Autocomplete.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAiE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGlH,wBAOkB;AAUlB,eAAO,MAAM,OAAO,yBAanB,CAAC;AAEF,eAAO,MAAM,WAAW,yBAevB,CAAC;AAEF,eAAO,MAAM,UAAU,yBA0BtB,CAAC;AAEF,eAAO,MAAM,UAAU,yBAmBtB,CAAC;AAEF,eAAO,MAAM,WAAW,yBAcvB,CAAC;AAEF,OAAO,KAAK,OAAO,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { Box } from '../../core';
|
|
4
|
+
import { Autocomplete } from './Autocomplete';
|
|
5
|
+
import { useStyles } from './Autocomplete.styles';
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Autocomplete',
|
|
8
|
+
tags: ['ui'],
|
|
9
|
+
experimental: false,
|
|
10
|
+
description: "Champ de saisie avec autocomplétion. Supporte multi-sélection, groupes, création d'options.",
|
|
11
|
+
component: Autocomplete,
|
|
12
|
+
styleFn: useStyles,
|
|
13
|
+
};
|
|
14
|
+
const BASE_OPTIONS = [
|
|
15
|
+
{ value: '1', label: 'Élément 1' },
|
|
16
|
+
{ value: '2', label: 'Élément 2 — libellé long avec beaucoup de mots' },
|
|
17
|
+
{ value: '3', label: 'Élément 3' },
|
|
18
|
+
{ value: '4', label: 'Élément 4' },
|
|
19
|
+
{ value: '5', label: 'Élément 5' },
|
|
20
|
+
];
|
|
21
|
+
export const Default = () => {
|
|
22
|
+
const [values, setValues] = useState([]);
|
|
23
|
+
return (_jsx(Box, { minH: 300, children: _jsx(Autocomplete, { label: "S\u00E9lection multiple", placeholder: "Rechercher...", options: BASE_OPTIONS, value: values, onChange: setValues }) }));
|
|
24
|
+
};
|
|
25
|
+
export const SingleValue = () => {
|
|
26
|
+
const [values, setValues] = useState([]);
|
|
27
|
+
return (_jsx(Box, { minH: 300, children: _jsx(Autocomplete, { label: "S\u00E9lection unique", placeholder: "Choisir...", isMulti: false, autoFocus: false, options: BASE_OPTIONS, value: values, onChange: setValues }) }));
|
|
28
|
+
};
|
|
29
|
+
export const WithSearch = () => {
|
|
30
|
+
const [values, setValues] = useState([]);
|
|
31
|
+
const [options, setOptions] = useState([]);
|
|
32
|
+
const onSearchChange = search => {
|
|
33
|
+
setOptions(search
|
|
34
|
+
? [
|
|
35
|
+
{ value: `${search}-1`, label: `${search} — résultat 1` },
|
|
36
|
+
{ value: `${search}-2`, label: `${search} — résultat 2` },
|
|
37
|
+
]
|
|
38
|
+
: []);
|
|
39
|
+
};
|
|
40
|
+
return (_jsx(Box, { minH: 300, children: _jsx(Autocomplete, { label: "Recherche dynamique", placeholder: "Saisir pour chercher...", options: options, value: values, onChange: setValues, onSearchChange: onSearchChange, disabledFilterSearch: true }) }));
|
|
41
|
+
};
|
|
42
|
+
export const WithGroups = () => {
|
|
43
|
+
const [values, setValues] = React.useState([]);
|
|
44
|
+
const options = [
|
|
45
|
+
{ value: 'brief-collectif', label: 'Brief collectif', group: 'Coaching' },
|
|
46
|
+
{ value: 'brief-individuel', label: 'Brief individuel', group: 'Coaching' },
|
|
47
|
+
{ value: 'formation-module', label: 'Formation module', group: 'Formation' },
|
|
48
|
+
{ value: 'formation-externe', label: 'Formation externe', group: 'Formation' },
|
|
49
|
+
];
|
|
50
|
+
return (_jsx(Box, { minH: 300, children: _jsx(Autocomplete, { label: "Avec groupes", placeholder: "Choisir...", options: options, value: values, onChange: v => setValues(v) }) }));
|
|
51
|
+
};
|
|
52
|
+
export const AllowCreate = () => {
|
|
53
|
+
const [values, setValues] = useState([]);
|
|
54
|
+
return (_jsx(Box, { minH: 300, children: _jsx(Autocomplete, { label: "Avec cr\u00E9ation", placeholder: "Rechercher ou cr\u00E9er...", allowCreate: true, options: BASE_OPTIONS, value: values, onChange: setValues }) }));
|
|
55
|
+
};
|
|
56
|
+
export * as Sources from './Autocomplete.stories.sources';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const Default: () => string;
|
|
2
|
+
export declare const SingleValue: () => string;
|
|
3
|
+
export declare const WithSearch: () => string;
|
|
4
|
+
export declare const WithGroups: () => string;
|
|
5
|
+
export declare const AllowCreate: () => string;
|
|
6
|
+
export declare const storySources: {
|
|
7
|
+
readonly Default: () => string;
|
|
8
|
+
readonly SingleValue: () => string;
|
|
9
|
+
readonly WithSearch: () => string;
|
|
10
|
+
readonly WithGroups: () => string;
|
|
11
|
+
readonly AllowCreate: () => string;
|
|
12
|
+
};
|
|
13
|
+
export type StorySourceName = keyof typeof storySources;
|
|
14
|
+
//# sourceMappingURL=Autocomplete.stories.sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Autocomplete.stories.sources.d.ts","sourceRoot":"","sources":["../../../src/ui/Autocomplete/Autocomplete.stories.sources.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,cAAsW,CAAC;AAE3X,eAAO,MAAM,WAAW,cAAyZ,CAAC;AAElb,eAAO,MAAM,UAAU,cAA4yB,CAAC;AAEp0B,eAAO,MAAM,UAAU,cAAuxB,CAAC;AAE/yB,eAAO,MAAM,WAAW,cAAmY,CAAC;AAE5Z,eAAO,MAAM,YAAY;;;;;;CAMf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// This file is generated. Do not edit manually.
|
|
2
|
+
// Source: src/ui/Autocomplete/Autocomplete.stories.tsx
|
|
3
|
+
export const Default = () => "export const Default = () => {\n const [values, setValues] = useState<AutocompleteOption[]>([]);\n return (\n <Box minH={300}>\n <Autocomplete\n label=\"Sélection multiple\"\n placeholder=\"Rechercher...\"\n options={BASE_OPTIONS}\n value={values}\n onChange={setValues}\n />\n </Box>\n );\n};";
|
|
4
|
+
export const SingleValue = () => "export const SingleValue = () => {\n const [values, setValues] = useState<AutocompleteOption[]>([]);\n return (\n <Box minH={300}>\n <Autocomplete\n label=\"Sélection unique\"\n placeholder=\"Choisir...\"\n isMulti={false}\n autoFocus={false}\n options={BASE_OPTIONS}\n value={values}\n onChange={setValues}\n />\n </Box>\n );\n};";
|
|
5
|
+
export const WithSearch = () => "export const WithSearch = () => {\n const [values, setValues] = useState<AutocompleteOption[]>([]);\n const [options, setOptions] = useState<AutocompleteOption[]>([]);\n const onSearchChange: AutocompleteProps['onSearchChange'] = search => {\n setOptions(\n search\n ? [\n { value: `${search}-1`, label: `${search} — résultat 1` },\n { value: `${search}-2`, label: `${search} — résultat 2` },\n ]\n : [],\n );\n };\n return (\n <Box minH={300}>\n <Autocomplete\n label=\"Recherche dynamique\"\n placeholder=\"Saisir pour chercher...\"\n options={options}\n value={values}\n onChange={setValues}\n onSearchChange={onSearchChange}\n disabledFilterSearch\n />\n </Box>\n );\n};";
|
|
6
|
+
export const WithGroups = () => "export const WithGroups = () => {\n const [values, setValues] = React.useState<AutocompleteOptionWithGroup[]>([]);\n const options: AutocompleteOptionWithGroup[] = [\n { value: 'brief-collectif', label: 'Brief collectif', group: 'Coaching' },\n { value: 'brief-individuel', label: 'Brief individuel', group: 'Coaching' },\n { value: 'formation-module', label: 'Formation module', group: 'Formation' },\n { value: 'formation-externe', label: 'Formation externe', group: 'Formation' },\n ];\n return (\n <Box minH={300}>\n <Autocomplete\n label=\"Avec groupes\"\n placeholder=\"Choisir...\"\n options={options}\n value={values}\n onChange={v => setValues(v as AutocompleteOptionWithGroup[])}\n />\n </Box>\n );\n};";
|
|
7
|
+
export const AllowCreate = () => "export const AllowCreate = () => {\n const [values, setValues] = useState<AutocompleteOption[]>([]);\n return (\n <Box minH={300}>\n <Autocomplete\n label=\"Avec création\"\n placeholder=\"Rechercher ou créer...\"\n allowCreate\n options={BASE_OPTIONS}\n value={values}\n onChange={setValues}\n />\n </Box>\n );\n};";
|
|
8
|
+
export const storySources = {
|
|
9
|
+
Default,
|
|
10
|
+
SingleValue,
|
|
11
|
+
WithSearch,
|
|
12
|
+
WithGroups,
|
|
13
|
+
AllowCreate,
|
|
14
|
+
};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
export declare const useStyles: () => {
|
|
2
|
+
select: {
|
|
3
|
+
lineHeight: number;
|
|
4
|
+
width: "100%";
|
|
5
|
+
borderWidth: number;
|
|
6
|
+
backgroundColor: "transparent";
|
|
7
|
+
appearance: "none";
|
|
8
|
+
fontSize: 14;
|
|
9
|
+
letterSpacing: 0;
|
|
10
|
+
fontFamily: string;
|
|
11
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
12
|
+
outline: string;
|
|
13
|
+
paddingTop: number;
|
|
14
|
+
paddingBottom: number;
|
|
15
|
+
color: string;
|
|
16
|
+
};
|
|
17
|
+
inputInner: {
|
|
18
|
+
display: "flex";
|
|
19
|
+
flexDirection: "row";
|
|
20
|
+
gap: import("@alveole/theme").Spacing;
|
|
21
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
22
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
23
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
24
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
25
|
+
borderRadius: number;
|
|
26
|
+
borderWidth: number;
|
|
27
|
+
borderColor: string;
|
|
28
|
+
backgroundColor: "#FFFFFF";
|
|
29
|
+
overflow: "hidden";
|
|
30
|
+
width: "100%";
|
|
31
|
+
};
|
|
32
|
+
inputContainer: {
|
|
33
|
+
width: "100%";
|
|
34
|
+
};
|
|
35
|
+
inputDisabled: {
|
|
36
|
+
borderRadius: number;
|
|
37
|
+
backgroundColor: string;
|
|
38
|
+
};
|
|
39
|
+
control: {
|
|
40
|
+
minHeight: import("@alveole/theme").Spacing;
|
|
41
|
+
flexWrap: "inherit";
|
|
42
|
+
borderColor: string;
|
|
43
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
44
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
45
|
+
borderRadius: number;
|
|
46
|
+
};
|
|
47
|
+
controlDisabled: {
|
|
48
|
+
backgroundColor: string;
|
|
49
|
+
};
|
|
50
|
+
multiValue: {
|
|
51
|
+
borderRadius: import("@alveole/theme").Spacing;
|
|
52
|
+
backgroundColor: string;
|
|
53
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
54
|
+
};
|
|
55
|
+
multiValueDisabled: {
|
|
56
|
+
backgroundColor: "#FFFFFF";
|
|
57
|
+
borderColor: string;
|
|
58
|
+
borderWidth: number;
|
|
59
|
+
borderRadius: import("@alveole/theme").Spacing;
|
|
60
|
+
borderStyle: "solid";
|
|
61
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
62
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
63
|
+
};
|
|
64
|
+
multiValueRemoveHover: {
|
|
65
|
+
backgroundColor: string;
|
|
66
|
+
cursor: "pointer";
|
|
67
|
+
};
|
|
68
|
+
multiValueRemoveDisabled: {
|
|
69
|
+
display: "none";
|
|
70
|
+
};
|
|
71
|
+
dropdownIndicator: {
|
|
72
|
+
color: string;
|
|
73
|
+
padding: import("@alveole/theme").Spacing;
|
|
74
|
+
};
|
|
75
|
+
dropdownIndicatorDisabled: {
|
|
76
|
+
display: "none";
|
|
77
|
+
};
|
|
78
|
+
separatorIndicator: {
|
|
79
|
+
color: string;
|
|
80
|
+
};
|
|
81
|
+
indicatorSeparatorDisabled: {
|
|
82
|
+
display: "none";
|
|
83
|
+
};
|
|
84
|
+
clearIndicator: {
|
|
85
|
+
color: string;
|
|
86
|
+
padding: import("@alveole/theme").Spacing;
|
|
87
|
+
};
|
|
88
|
+
nativeLabel: {
|
|
89
|
+
color: string;
|
|
90
|
+
fontSize: 18 | 20;
|
|
91
|
+
lineHeight: 24 | 28;
|
|
92
|
+
letterSpacing: 0;
|
|
93
|
+
fontFamily: string;
|
|
94
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
95
|
+
};
|
|
96
|
+
nativeValue: {
|
|
97
|
+
color: string;
|
|
98
|
+
fontSize: 14;
|
|
99
|
+
lineHeight: 20;
|
|
100
|
+
letterSpacing: 0;
|
|
101
|
+
fontFamily: string;
|
|
102
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
103
|
+
};
|
|
104
|
+
nativeSimpleValue: {
|
|
105
|
+
color: string;
|
|
106
|
+
fontSize: 14;
|
|
107
|
+
lineHeight: 20;
|
|
108
|
+
letterSpacing: 0;
|
|
109
|
+
fontFamily: string;
|
|
110
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
111
|
+
};
|
|
112
|
+
nativeItem: {
|
|
113
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
114
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
115
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
116
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
117
|
+
backgroundColor: string;
|
|
118
|
+
};
|
|
119
|
+
nativeItemText: {
|
|
120
|
+
color: string;
|
|
121
|
+
fontSize: 14;
|
|
122
|
+
lineHeight: 20;
|
|
123
|
+
letterSpacing: 0;
|
|
124
|
+
fontFamily: string;
|
|
125
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
126
|
+
};
|
|
127
|
+
nativeItemTextNew: {
|
|
128
|
+
color: string;
|
|
129
|
+
fontSize: 14;
|
|
130
|
+
lineHeight: 20;
|
|
131
|
+
letterSpacing: 0;
|
|
132
|
+
fontFamily: string;
|
|
133
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
134
|
+
};
|
|
135
|
+
nativeItemSelected: {
|
|
136
|
+
backgroundColor: string;
|
|
137
|
+
};
|
|
138
|
+
input: {
|
|
139
|
+
display: "flex";
|
|
140
|
+
flexDirection: "row";
|
|
141
|
+
outline: string;
|
|
142
|
+
color: string;
|
|
143
|
+
fontFamily: string;
|
|
144
|
+
fontSize: 14;
|
|
145
|
+
minHeight: number;
|
|
146
|
+
flex: number;
|
|
147
|
+
};
|
|
148
|
+
inputPlaceholder: {
|
|
149
|
+
fontSize: 14;
|
|
150
|
+
lineHeight: 20;
|
|
151
|
+
letterSpacing: 0;
|
|
152
|
+
fontFamily: string;
|
|
153
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
154
|
+
color: string;
|
|
155
|
+
};
|
|
156
|
+
autocompleteIcon: {
|
|
157
|
+
position: "absolute";
|
|
158
|
+
right: import("@alveole/theme").Spacing;
|
|
159
|
+
top: string;
|
|
160
|
+
};
|
|
161
|
+
modalOverlay: {
|
|
162
|
+
flex: number;
|
|
163
|
+
justifyContent: "flex-end";
|
|
164
|
+
backgroundColor: string;
|
|
165
|
+
};
|
|
166
|
+
modalContent: {
|
|
167
|
+
flex: number;
|
|
168
|
+
backgroundColor: "white";
|
|
169
|
+
borderTopLeftRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
170
|
+
borderTopRightRadius: import("@alveole/theme/dist/constants/Radius").Radius;
|
|
171
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
172
|
+
};
|
|
173
|
+
modalHeader: {
|
|
174
|
+
display: "flex";
|
|
175
|
+
flexDirection: "row";
|
|
176
|
+
justifyContent: "space-between";
|
|
177
|
+
alignItems: "center";
|
|
178
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
179
|
+
};
|
|
180
|
+
groupHeader: {
|
|
181
|
+
color: string;
|
|
182
|
+
textTransform: "uppercase";
|
|
183
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
184
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
185
|
+
paddingLeft: import("@alveole/theme").Spacing;
|
|
186
|
+
paddingRight: import("@alveole/theme").Spacing;
|
|
187
|
+
backgroundColor: string;
|
|
188
|
+
fontSize: 12;
|
|
189
|
+
lineHeight: 20;
|
|
190
|
+
letterSpacing: 0;
|
|
191
|
+
fontFamily: string;
|
|
192
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
193
|
+
};
|
|
194
|
+
groupHeading: {
|
|
195
|
+
backgroundColor: string;
|
|
196
|
+
paddingTop: import("@alveole/theme").Spacing;
|
|
197
|
+
paddingBottom: import("@alveole/theme").Spacing;
|
|
198
|
+
color: string;
|
|
199
|
+
textTransform: "uppercase";
|
|
200
|
+
marginBottom: number;
|
|
201
|
+
fontSize: 12;
|
|
202
|
+
lineHeight: 20;
|
|
203
|
+
letterSpacing: 0;
|
|
204
|
+
fontFamily: string;
|
|
205
|
+
fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
//# sourceMappingURL=Autocomplete.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Autocomplete.styles.d.ts","sourceRoot":"","sources":["../../../src/ui/Autocomplete/Autocomplete.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2KnB,CAAC"}
|