@clicoh/orion-library 1.2.0-beta.2 → 1.2.0-beta.20
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/assets/css/expresivo.css +968 -0
- package/assets/logos/oculus-icon.svg +1 -0
- package/assets/logos/oculus-logo-sm-dark.svg +1 -0
- package/assets/logos/oculus-logo-sm.svg +1 -0
- package/assets/mascotas/svg/bugi-mascota-01-alerta.svg +39 -0
- package/assets/mascotas/svg/bugi-mascota-02-investigando.svg +36 -0
- package/assets/mascotas/svg/bugi-mascota-05-sorprendido.svg +38 -0
- package/assets/mascotas/svg/oculus-mascota-01-feliz.svg +52 -0
- package/assets/mascotas/svg/oculus-mascota-02-investigando.svg +51 -0
- package/assets/mascotas/svg/oculus-mascota-03-dudando.svg +51 -0
- package/assets/mascotas/svg/oculus-mascota-04-analizando-documento.svg +53 -0
- package/assets/mascotas/svg/oculus-mascota-06-celebrando.svg +54 -0
- package/assets/mascotas/svg/oculus-mascota-07-buscando-rapido.svg +57 -0
- package/assets/mascotas/svg/oculus-mascota-08-satisfecho.svg +55 -0
- package/assets/mascotas/webp/fixi-mascota-01-feliz-sm.webp +0 -0
- package/assets/mascotas/webp/fixi-mascota-02-investigando-sm.webp +0 -0
- package/assets/mascotas/webp/fixi-mascota-03-dudando-sm.webp +0 -0
- package/assets/mascotas/webp/fixi-mascota-04-reparando-sm.webp +0 -0
- package/assets/mascotas/webp/fixi-mascota-05-sorprendido-sm.webp +0 -0
- package/assets/mascotas/webp/fixi-mascota-06-celebrando-sm.webp +0 -0
- package/assets/mascotas/webp/fixi-mascota-07-corriendo-sm.webp +0 -0
- package/dist/components/01-atoms/Button/Button.d.ts +21 -1
- package/dist/components/01-atoms/Button/Button.d.ts.map +1 -1
- package/dist/components/01-atoms/Button/Button.jsx +38 -4
- package/dist/components/01-atoms/Button/Button.jsx.map +1 -1
- package/dist/components/01-atoms/CodeBlock/CodeBlock.d.ts +56 -0
- package/dist/components/01-atoms/CodeBlock/CodeBlock.d.ts.map +1 -0
- package/dist/components/01-atoms/CodeBlock/CodeBlock.jsx +97 -0
- package/dist/components/01-atoms/CodeBlock/CodeBlock.jsx.map +1 -0
- package/dist/components/01-atoms/CodeBlock/index.d.ts +2 -0
- package/dist/components/01-atoms/CodeBlock/index.d.ts.map +1 -0
- package/dist/components/01-atoms/CodeBlock/index.js +2 -0
- package/dist/components/01-atoms/CodeBlock/index.js.map +1 -0
- package/dist/components/01-atoms/Heading/Heading.jsx +1 -1
- package/dist/components/01-atoms/Heading/Heading.jsx.map +1 -1
- package/dist/components/01-atoms/IconButton/IconButton.d.ts +28 -0
- package/dist/components/01-atoms/IconButton/IconButton.d.ts.map +1 -0
- package/dist/components/01-atoms/IconButton/IconButton.jsx +32 -0
- package/dist/components/01-atoms/IconButton/IconButton.jsx.map +1 -0
- package/dist/components/01-atoms/IconButton/index.d.ts +2 -0
- package/dist/components/01-atoms/IconButton/index.d.ts.map +1 -0
- package/dist/components/01-atoms/IconButton/index.js +2 -0
- package/dist/components/01-atoms/IconButton/index.js.map +1 -0
- package/dist/components/01-atoms/Input/Input.d.ts +1 -1
- package/dist/components/01-atoms/Input/Input.d.ts.map +1 -1
- package/dist/components/01-atoms/Input/Input.jsx +13 -9
- package/dist/components/01-atoms/Input/Input.jsx.map +1 -1
- package/dist/components/01-atoms/Input/utils/RenderErrorOrHelperText.d.ts.map +1 -1
- package/dist/components/01-atoms/Input/utils/RenderErrorOrHelperText.jsx +1 -1
- package/dist/components/01-atoms/Input/utils/RenderErrorOrHelperText.jsx.map +1 -1
- package/dist/components/01-atoms/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/01-atoms/MultiSelect/MultiSelect.jsx +2 -1
- package/dist/components/01-atoms/MultiSelect/MultiSelect.jsx.map +1 -1
- package/dist/components/01-atoms/ProgressBar/ProgressBar.d.ts +12 -1
- package/dist/components/01-atoms/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/components/01-atoms/ProgressBar/ProgressBar.jsx +18 -2
- package/dist/components/01-atoms/ProgressBar/ProgressBar.jsx.map +1 -1
- package/dist/components/01-atoms/Select/Select.d.ts +7 -1
- package/dist/components/01-atoms/Select/Select.d.ts.map +1 -1
- package/dist/components/01-atoms/Select/Select.jsx +61 -13
- package/dist/components/01-atoms/Select/Select.jsx.map +1 -1
- package/dist/components/01-atoms/Select/SelectList.d.ts +41 -0
- package/dist/components/01-atoms/Select/SelectList.d.ts.map +1 -0
- package/dist/components/01-atoms/Select/SelectList.jsx +116 -0
- package/dist/components/01-atoms/Select/SelectList.jsx.map +1 -0
- package/dist/components/01-atoms/SmallInput/SmallInput.d.ts.map +1 -1
- package/dist/components/01-atoms/SmallInput/SmallInput.jsx +1 -0
- package/dist/components/01-atoms/SmallInput/SmallInput.jsx.map +1 -1
- package/dist/components/01-atoms/Spinner/Spinner.d.ts +24 -3
- package/dist/components/01-atoms/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/01-atoms/Spinner/Spinner.jsx +30 -4
- package/dist/components/01-atoms/Spinner/Spinner.jsx.map +1 -1
- package/dist/components/01-atoms/Spinner/index.d.ts +1 -0
- package/dist/components/01-atoms/Spinner/index.d.ts.map +1 -1
- package/dist/components/01-atoms/Stat/Stat.d.ts +47 -0
- package/dist/components/01-atoms/Stat/Stat.d.ts.map +1 -0
- package/dist/components/01-atoms/Stat/Stat.jsx +64 -0
- package/dist/components/01-atoms/Stat/Stat.jsx.map +1 -0
- package/dist/components/01-atoms/Stat/index.d.ts +2 -0
- package/dist/components/01-atoms/Stat/index.d.ts.map +1 -0
- package/dist/components/01-atoms/Stat/index.js +2 -0
- package/dist/components/01-atoms/Stat/index.js.map +1 -0
- package/dist/components/01-atoms/Switch/Switch.d.ts +5 -2
- package/dist/components/01-atoms/Switch/Switch.d.ts.map +1 -1
- package/dist/components/01-atoms/Switch/Switch.jsx +15 -12
- package/dist/components/01-atoms/Switch/Switch.jsx.map +1 -1
- package/dist/components/01-atoms/Textarea/Textarea.d.ts +38 -0
- package/dist/components/01-atoms/Textarea/Textarea.d.ts.map +1 -0
- package/dist/components/01-atoms/Textarea/Textarea.jsx +50 -0
- package/dist/components/01-atoms/Textarea/Textarea.jsx.map +1 -0
- package/dist/components/01-atoms/Textarea/index.d.ts +2 -0
- package/dist/components/01-atoms/Textarea/index.d.ts.map +1 -0
- package/dist/components/01-atoms/Textarea/index.js +2 -0
- package/dist/components/01-atoms/Textarea/index.js.map +1 -0
- package/dist/components/01-atoms/Toast/Toast.d.ts.map +1 -1
- package/dist/components/01-atoms/Toast/Toast.jsx +3 -1
- package/dist/components/01-atoms/Toast/Toast.jsx.map +1 -1
- package/dist/components/01-atoms/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/01-atoms/Tooltip/Tooltip.jsx +4 -1
- package/dist/components/01-atoms/Tooltip/Tooltip.jsx.map +1 -1
- package/dist/components/01-atoms/index.d.ts +4 -0
- package/dist/components/01-atoms/index.d.ts.map +1 -1
- package/dist/components/01-atoms/index.js +4 -0
- package/dist/components/01-atoms/index.js.map +1 -1
- package/dist/components/02-molecules/Accordion/Accordion.d.ts +15 -4
- package/dist/components/02-molecules/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/02-molecules/Accordion/Accordion.jsx +20 -6
- package/dist/components/02-molecules/Accordion/Accordion.jsx.map +1 -1
- package/dist/components/02-molecules/Accordion/AccordionContext.d.ts +5 -1
- package/dist/components/02-molecules/Accordion/AccordionContext.d.ts.map +1 -1
- package/dist/components/02-molecules/Accordion/AccordionContext.jsx +7 -6
- package/dist/components/02-molecules/Accordion/AccordionContext.jsx.map +1 -1
- package/dist/components/02-molecules/Accordion/AccordionSection.d.ts +2 -1
- package/dist/components/02-molecules/Accordion/AccordionSection.d.ts.map +1 -1
- package/dist/components/02-molecules/Accordion/AccordionSection.jsx +62 -11
- package/dist/components/02-molecules/Accordion/AccordionSection.jsx.map +1 -1
- package/dist/components/02-molecules/Accordion/index.d.ts +1 -0
- package/dist/components/02-molecules/Accordion/index.d.ts.map +1 -1
- package/dist/components/02-molecules/Accordion/index.js.map +1 -1
- package/dist/components/02-molecules/Autocomplete/Autocomplete.d.ts +4 -1
- package/dist/components/02-molecules/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/02-molecules/Autocomplete/Autocomplete.jsx +34 -15
- package/dist/components/02-molecules/Autocomplete/Autocomplete.jsx.map +1 -1
- package/dist/components/02-molecules/Card/Card.d.ts +74 -0
- package/dist/components/02-molecules/Card/Card.d.ts.map +1 -0
- package/dist/components/02-molecules/Card/Card.jsx +87 -0
- package/dist/components/02-molecules/Card/Card.jsx.map +1 -0
- package/dist/components/02-molecules/Card/index.d.ts +2 -0
- package/dist/components/02-molecules/Card/index.d.ts.map +1 -0
- package/dist/components/02-molecules/Card/index.js +2 -0
- package/dist/components/02-molecules/Card/index.js.map +1 -0
- package/dist/components/02-molecules/DatePicker/DatePicker.d.ts +41 -3
- package/dist/components/02-molecules/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/02-molecules/DatePicker/DatePicker.jsx +190 -34
- package/dist/components/02-molecules/DatePicker/DatePicker.jsx.map +1 -1
- package/dist/components/02-molecules/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/02-molecules/Dropdown/Dropdown.jsx +1 -0
- package/dist/components/02-molecules/Dropdown/Dropdown.jsx.map +1 -1
- package/dist/components/02-molecules/EmptyState/EmptyState.d.ts +52 -0
- package/dist/components/02-molecules/EmptyState/EmptyState.d.ts.map +1 -0
- package/dist/components/02-molecules/EmptyState/EmptyState.jsx +66 -0
- package/dist/components/02-molecules/EmptyState/EmptyState.jsx.map +1 -0
- package/dist/components/02-molecules/EmptyState/index.d.ts +2 -0
- package/dist/components/02-molecules/EmptyState/index.d.ts.map +1 -0
- package/dist/components/02-molecules/EmptyState/index.js +2 -0
- package/dist/components/02-molecules/EmptyState/index.js.map +1 -0
- package/dist/components/02-molecules/Filter/Filter.d.ts +8 -1
- package/dist/components/02-molecules/Filter/Filter.d.ts.map +1 -1
- package/dist/components/02-molecules/Filter/Filter.jsx +35 -11
- package/dist/components/02-molecules/Filter/Filter.jsx.map +1 -1
- package/dist/components/02-molecules/Filter/index.d.ts +1 -0
- package/dist/components/02-molecules/Filter/index.d.ts.map +1 -1
- package/dist/components/02-molecules/Filter/index.js +1 -0
- package/dist/components/02-molecules/Filter/index.js.map +1 -1
- package/dist/components/02-molecules/Filter/types.d.ts +24 -5
- package/dist/components/02-molecules/Filter/types.d.ts.map +1 -1
- package/dist/components/02-molecules/Filter/utils/pruneOrphanValues.d.ts +34 -0
- package/dist/components/02-molecules/Filter/utils/pruneOrphanValues.d.ts.map +1 -0
- package/dist/components/02-molecules/Filter/utils/pruneOrphanValues.js +70 -0
- package/dist/components/02-molecules/Filter/utils/pruneOrphanValues.js.map +1 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewer.d.ts +55 -5
- package/dist/components/02-molecules/ImageViewer/ImageViewer.d.ts.map +1 -1
- package/dist/components/02-molecules/ImageViewer/ImageViewer.jsx +118 -27
- package/dist/components/02-molecules/ImageViewer/ImageViewer.jsx.map +1 -1
- package/dist/components/02-molecules/ImageViewer/ImageViewerImage.d.ts +40 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewerImage.d.ts.map +1 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewerImage.jsx +109 -0
- package/dist/components/02-molecules/ImageViewer/ImageViewerImage.jsx.map +1 -0
- package/dist/components/02-molecules/InlineMessage/InlineMessage.d.ts +15 -1
- package/dist/components/02-molecules/InlineMessage/InlineMessage.d.ts.map +1 -1
- package/dist/components/02-molecules/InlineMessage/InlineMessage.jsx +18 -3
- package/dist/components/02-molecules/InlineMessage/InlineMessage.jsx.map +1 -1
- package/dist/components/02-molecules/Menu/MenuItem.d.ts.map +1 -1
- package/dist/components/02-molecules/Menu/MenuItem.jsx +2 -2
- package/dist/components/02-molecules/Menu/MenuItem.jsx.map +1 -1
- package/dist/components/02-molecules/Menu/MenuList.d.ts.map +1 -1
- package/dist/components/02-molecules/Menu/MenuList.jsx +1 -1
- package/dist/components/02-molecules/Menu/MenuList.jsx.map +1 -1
- package/dist/components/02-molecules/Modal/Modal.d.ts +5 -1
- package/dist/components/02-molecules/Modal/Modal.d.ts.map +1 -1
- package/dist/components/02-molecules/Modal/Modal.jsx +4 -2
- package/dist/components/02-molecules/Modal/Modal.jsx.map +1 -1
- package/dist/components/02-molecules/MultiAutocomplete/MultiAutocomplete.d.ts +80 -0
- package/dist/components/02-molecules/MultiAutocomplete/MultiAutocomplete.d.ts.map +1 -0
- package/dist/components/02-molecules/MultiAutocomplete/MultiAutocomplete.jsx +261 -0
- package/dist/components/02-molecules/MultiAutocomplete/MultiAutocomplete.jsx.map +1 -0
- package/dist/components/02-molecules/MultiAutocomplete/index.d.ts +2 -0
- package/dist/components/02-molecules/MultiAutocomplete/index.d.ts.map +1 -0
- package/dist/components/02-molecules/MultiAutocomplete/index.js +2 -0
- package/dist/components/02-molecules/MultiAutocomplete/index.js.map +1 -0
- package/dist/components/02-molecules/Stepper/Stepper.d.ts +70 -0
- package/dist/components/02-molecules/Stepper/Stepper.d.ts.map +1 -0
- package/dist/components/02-molecules/Stepper/Stepper.jsx +204 -0
- package/dist/components/02-molecules/Stepper/Stepper.jsx.map +1 -0
- package/dist/components/02-molecules/Stepper/index.d.ts +2 -0
- package/dist/components/02-molecules/Stepper/index.d.ts.map +1 -0
- package/dist/components/02-molecules/Stepper/index.js +2 -0
- package/dist/components/02-molecules/Stepper/index.js.map +1 -0
- package/dist/components/02-molecules/Table/Table.d.ts +3 -1
- package/dist/components/02-molecules/Table/Table.d.ts.map +1 -1
- package/dist/components/02-molecules/Table/Table.jsx +6 -5
- package/dist/components/02-molecules/Table/Table.jsx.map +1 -1
- package/dist/components/02-molecules/Timeline/Timeline.d.ts +47 -0
- package/dist/components/02-molecules/Timeline/Timeline.d.ts.map +1 -0
- package/dist/components/02-molecules/Timeline/Timeline.jsx +65 -0
- package/dist/components/02-molecules/Timeline/Timeline.jsx.map +1 -0
- package/dist/components/02-molecules/Timeline/index.d.ts +2 -0
- package/dist/components/02-molecules/Timeline/index.d.ts.map +1 -0
- package/dist/components/02-molecules/Timeline/index.js +2 -0
- package/dist/components/02-molecules/Timeline/index.js.map +1 -0
- package/dist/components/02-molecules/index.d.ts +5 -0
- package/dist/components/02-molecules/index.d.ts.map +1 -1
- package/dist/components/02-molecules/index.js +5 -0
- package/dist/components/02-molecules/index.js.map +1 -1
- package/dist/components/03-organisms/DataTable/DataTable.d.ts +1 -1
- package/dist/components/03-organisms/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/03-organisms/DataTable/DataTable.jsx.map +1 -1
- package/dist/components/03-organisms/Header/Header.d.ts +3 -1
- package/dist/components/03-organisms/Header/Header.d.ts.map +1 -1
- package/dist/components/03-organisms/Header/Header.jsx +4 -5
- package/dist/components/03-organisms/Header/Header.jsx.map +1 -1
- package/dist/components/03-organisms/MapView/MapView.d.ts +14 -3
- package/dist/components/03-organisms/MapView/MapView.d.ts.map +1 -1
- package/dist/components/03-organisms/MapView/MapView.jsx +40 -9
- package/dist/components/03-organisms/MapView/MapView.jsx.map +1 -1
- package/dist/components/03-organisms/ModalMultiple/ModalMultiple.d.ts.map +1 -1
- package/dist/components/03-organisms/ModalMultiple/ModalMultiple.jsx +1 -0
- package/dist/components/03-organisms/ModalMultiple/ModalMultiple.jsx.map +1 -1
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.d.ts +36 -4
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.d.ts.map +1 -1
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.jsx +44 -10
- package/dist/components/04-templates/DashboardTemplate/DashboardTemplate.jsx.map +1 -1
- package/dist/components/04-templates/DashboardTemplate/HeadingWithTitle.d.ts +6 -2
- package/dist/components/04-templates/DashboardTemplate/HeadingWithTitle.d.ts.map +1 -1
- package/dist/components/04-templates/DashboardTemplate/HeadingWithTitle.jsx +7 -3
- package/dist/components/04-templates/DashboardTemplate/HeadingWithTitle.jsx.map +1 -1
- package/dist/components/04-templates/LoginTemplate/LoginForm.d.ts +66 -3
- package/dist/components/04-templates/LoginTemplate/LoginForm.d.ts.map +1 -1
- package/dist/components/04-templates/LoginTemplate/LoginForm.jsx +80 -16
- package/dist/components/04-templates/LoginTemplate/LoginForm.jsx.map +1 -1
- package/dist/components/04-templates/LoginTemplate/LoginTemplate.d.ts +24 -4
- package/dist/components/04-templates/LoginTemplate/LoginTemplate.d.ts.map +1 -1
- package/dist/components/04-templates/LoginTemplate/LoginTemplate.jsx +27 -7
- package/dist/components/04-templates/LoginTemplate/LoginTemplate.jsx.map +1 -1
- package/dist/components/04-templates/LoginTemplate/index.d.ts +1 -0
- package/dist/components/04-templates/LoginTemplate/index.d.ts.map +1 -1
- package/dist/components/04-templates/SideFilterTemplate/SideFilterTemplate.d.ts.map +1 -1
- package/dist/components/04-templates/SideFilterTemplate/SideFilterTemplate.jsx +4 -1
- package/dist/components/04-templates/SideFilterTemplate/SideFilterTemplate.jsx.map +1 -1
- package/dist/hooks/useSegments.d.ts.map +1 -1
- package/dist/hooks/useSegments.js +2 -3
- package/dist/hooks/useSegments.js.map +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useTheme.jsx +1 -0
- package/dist/hooks/useTheme.jsx.map +1 -1
- package/expresivo/ExpBubble/ExpBubble.d.ts +51 -0
- package/expresivo/ExpBubble/ExpBubble.d.ts.map +1 -0
- package/expresivo/ExpBubble/ExpBubble.jsx +74 -0
- package/expresivo/ExpBubble/ExpBubble.jsx.map +1 -0
- package/expresivo/ExpBubble/index.d.ts +3 -0
- package/expresivo/ExpBubble/index.d.ts.map +1 -0
- package/expresivo/ExpBubble/index.js +2 -0
- package/expresivo/ExpBubble/index.js.map +1 -0
- package/expresivo/ExpChip/ExpChip.d.ts +30 -0
- package/expresivo/ExpChip/ExpChip.d.ts.map +1 -0
- package/expresivo/ExpChip/ExpChip.jsx +46 -0
- package/expresivo/ExpChip/ExpChip.jsx.map +1 -0
- package/expresivo/ExpChip/index.d.ts +3 -0
- package/expresivo/ExpChip/index.d.ts.map +1 -0
- package/expresivo/ExpChip/index.js +2 -0
- package/expresivo/ExpChip/index.js.map +1 -0
- package/expresivo/ExpCollapseToggle/ExpCollapseToggle.d.ts +37 -0
- package/expresivo/ExpCollapseToggle/ExpCollapseToggle.d.ts.map +1 -0
- package/expresivo/ExpCollapseToggle/ExpCollapseToggle.jsx +43 -0
- package/expresivo/ExpCollapseToggle/ExpCollapseToggle.jsx.map +1 -0
- package/expresivo/ExpCollapseToggle/index.d.ts +3 -0
- package/expresivo/ExpCollapseToggle/index.d.ts.map +1 -0
- package/expresivo/ExpCollapseToggle/index.js +2 -0
- package/expresivo/ExpCollapseToggle/index.js.map +1 -0
- package/expresivo/ExpEnterIcon/ExpEnterIcon.d.ts +32 -0
- package/expresivo/ExpEnterIcon/ExpEnterIcon.d.ts.map +1 -0
- package/expresivo/ExpEnterIcon/ExpEnterIcon.jsx +32 -0
- package/expresivo/ExpEnterIcon/ExpEnterIcon.jsx.map +1 -0
- package/expresivo/ExpEnterIcon/index.d.ts +3 -0
- package/expresivo/ExpEnterIcon/index.d.ts.map +1 -0
- package/expresivo/ExpEnterIcon/index.js +2 -0
- package/expresivo/ExpEnterIcon/index.js.map +1 -0
- package/expresivo/ExpGrowBar/ExpGrowBar.d.ts +26 -0
- package/expresivo/ExpGrowBar/ExpGrowBar.d.ts.map +1 -0
- package/expresivo/ExpGrowBar/ExpGrowBar.jsx +39 -0
- package/expresivo/ExpGrowBar/ExpGrowBar.jsx.map +1 -0
- package/expresivo/ExpGrowBar/index.d.ts +3 -0
- package/expresivo/ExpGrowBar/index.d.ts.map +1 -0
- package/expresivo/ExpGrowBar/index.js +2 -0
- package/expresivo/ExpGrowBar/index.js.map +1 -0
- package/expresivo/ExpJourneyTrack/ExpJourneyTrack.d.ts +65 -0
- package/expresivo/ExpJourneyTrack/ExpJourneyTrack.d.ts.map +1 -0
- package/expresivo/ExpJourneyTrack/ExpJourneyTrack.jsx +156 -0
- package/expresivo/ExpJourneyTrack/ExpJourneyTrack.jsx.map +1 -0
- package/expresivo/ExpJourneyTrack/index.d.ts +3 -0
- package/expresivo/ExpJourneyTrack/index.d.ts.map +1 -0
- package/expresivo/ExpJourneyTrack/index.js +2 -0
- package/expresivo/ExpJourneyTrack/index.js.map +1 -0
- package/expresivo/ExpKeyButton/ExpKeyButton.d.ts +49 -0
- package/expresivo/ExpKeyButton/ExpKeyButton.d.ts.map +1 -0
- package/expresivo/ExpKeyButton/ExpKeyButton.jsx +60 -0
- package/expresivo/ExpKeyButton/ExpKeyButton.jsx.map +1 -0
- package/expresivo/ExpKeyButton/index.d.ts +3 -0
- package/expresivo/ExpKeyButton/index.d.ts.map +1 -0
- package/expresivo/ExpKeyButton/index.js +2 -0
- package/expresivo/ExpKeyButton/index.js.map +1 -0
- package/expresivo/ExpLensIcon/ExpLensIcon.d.ts +29 -0
- package/expresivo/ExpLensIcon/ExpLensIcon.d.ts.map +1 -0
- package/expresivo/ExpLensIcon/ExpLensIcon.jsx +29 -0
- package/expresivo/ExpLensIcon/ExpLensIcon.jsx.map +1 -0
- package/expresivo/ExpLensIcon/index.d.ts +3 -0
- package/expresivo/ExpLensIcon/index.d.ts.map +1 -0
- package/expresivo/ExpLensIcon/index.js +2 -0
- package/expresivo/ExpLensIcon/index.js.map +1 -0
- package/expresivo/ExpLogo/ExpLogo.d.ts +33 -0
- package/expresivo/ExpLogo/ExpLogo.d.ts.map +1 -0
- package/expresivo/ExpLogo/ExpLogo.jsx +42 -0
- package/expresivo/ExpLogo/ExpLogo.jsx.map +1 -0
- package/expresivo/ExpLogo/catalog.d.ts +17 -0
- package/expresivo/ExpLogo/catalog.d.ts.map +1 -0
- package/expresivo/ExpLogo/catalog.js +11 -0
- package/expresivo/ExpLogo/catalog.js.map +1 -0
- package/expresivo/ExpLogo/index.d.ts +4 -0
- package/expresivo/ExpLogo/index.d.ts.map +1 -0
- package/expresivo/ExpLogo/index.js +2 -0
- package/expresivo/ExpLogo/index.js.map +1 -0
- package/expresivo/ExpMascot/ExpMascot.d.ts +42 -0
- package/expresivo/ExpMascot/ExpMascot.d.ts.map +1 -0
- package/expresivo/ExpMascot/ExpMascot.jsx +46 -0
- package/expresivo/ExpMascot/ExpMascot.jsx.map +1 -0
- package/expresivo/ExpMascot/catalog.d.ts +12 -0
- package/expresivo/ExpMascot/catalog.d.ts.map +1 -0
- package/expresivo/ExpMascot/catalog.js +41 -0
- package/expresivo/ExpMascot/catalog.js.map +1 -0
- package/expresivo/ExpMascot/index.d.ts +4 -0
- package/expresivo/ExpMascot/index.d.ts.map +1 -0
- package/expresivo/ExpMascot/index.js +2 -0
- package/expresivo/ExpMascot/index.js.map +1 -0
- package/expresivo/ExpMedalBadge/ExpMedalBadge.d.ts +29 -0
- package/expresivo/ExpMedalBadge/ExpMedalBadge.d.ts.map +1 -0
- package/expresivo/ExpMedalBadge/ExpMedalBadge.jsx +87 -0
- package/expresivo/ExpMedalBadge/ExpMedalBadge.jsx.map +1 -0
- package/expresivo/ExpMedalBadge/index.d.ts +3 -0
- package/expresivo/ExpMedalBadge/index.d.ts.map +1 -0
- package/expresivo/ExpMedalBadge/index.js +2 -0
- package/expresivo/ExpMedalBadge/index.js.map +1 -0
- package/expresivo/ExpPageHero/ExpPageHero.d.ts +82 -0
- package/expresivo/ExpPageHero/ExpPageHero.d.ts.map +1 -0
- package/expresivo/ExpPageHero/ExpPageHero.jsx +113 -0
- package/expresivo/ExpPageHero/ExpPageHero.jsx.map +1 -0
- package/expresivo/ExpPageHero/index.d.ts +3 -0
- package/expresivo/ExpPageHero/index.d.ts.map +1 -0
- package/expresivo/ExpPageHero/index.js +2 -0
- package/expresivo/ExpPageHero/index.js.map +1 -0
- package/expresivo/ExpPeek/ExpPeek.d.ts +56 -0
- package/expresivo/ExpPeek/ExpPeek.d.ts.map +1 -0
- package/expresivo/ExpPeek/ExpPeek.jsx +131 -0
- package/expresivo/ExpPeek/ExpPeek.jsx.map +1 -0
- package/expresivo/ExpPeek/index.d.ts +3 -0
- package/expresivo/ExpPeek/index.d.ts.map +1 -0
- package/expresivo/ExpPeek/index.js +2 -0
- package/expresivo/ExpPeek/index.js.map +1 -0
- package/expresivo/ExpPillButton/ExpPillButton.d.ts +44 -0
- package/expresivo/ExpPillButton/ExpPillButton.d.ts.map +1 -0
- package/expresivo/ExpPillButton/ExpPillButton.jsx +75 -0
- package/expresivo/ExpPillButton/ExpPillButton.jsx.map +1 -0
- package/expresivo/ExpPillButton/index.d.ts +3 -0
- package/expresivo/ExpPillButton/index.d.ts.map +1 -0
- package/expresivo/ExpPillButton/index.js +2 -0
- package/expresivo/ExpPillButton/index.js.map +1 -0
- package/expresivo/ExpScope/ExpScope.d.ts +63 -0
- package/expresivo/ExpScope/ExpScope.d.ts.map +1 -0
- package/expresivo/ExpScope/ExpScope.jsx +67 -0
- package/expresivo/ExpScope/ExpScope.jsx.map +1 -0
- package/expresivo/ExpScope/index.d.ts +3 -0
- package/expresivo/ExpScope/index.d.ts.map +1 -0
- package/expresivo/ExpScope/index.js +2 -0
- package/expresivo/ExpScope/index.js.map +1 -0
- package/expresivo/ExpScoreRing/ExpScoreRing.d.ts +35 -0
- package/expresivo/ExpScoreRing/ExpScoreRing.d.ts.map +1 -0
- package/expresivo/ExpScoreRing/ExpScoreRing.jsx +67 -0
- package/expresivo/ExpScoreRing/ExpScoreRing.jsx.map +1 -0
- package/expresivo/ExpScoreRing/index.d.ts +3 -0
- package/expresivo/ExpScoreRing/index.d.ts.map +1 -0
- package/expresivo/ExpScoreRing/index.js +2 -0
- package/expresivo/ExpScoreRing/index.js.map +1 -0
- package/expresivo/ExpStepBadge/ExpStepBadge.d.ts +25 -0
- package/expresivo/ExpStepBadge/ExpStepBadge.d.ts.map +1 -0
- package/expresivo/ExpStepBadge/ExpStepBadge.jsx +30 -0
- package/expresivo/ExpStepBadge/ExpStepBadge.jsx.map +1 -0
- package/expresivo/ExpStepBadge/index.d.ts +2 -0
- package/expresivo/ExpStepBadge/index.d.ts.map +1 -0
- package/expresivo/ExpStepBadge/index.js +2 -0
- package/expresivo/ExpStepBadge/index.js.map +1 -0
- package/expresivo/index.d.ts +18 -0
- package/expresivo/index.d.ts.map +1 -0
- package/expresivo/index.js +18 -0
- package/expresivo/index.js.map +1 -0
- package/expresivo/shared/glyphs.d.ts +20 -0
- package/expresivo/shared/glyphs.d.ts.map +1 -0
- package/expresivo/shared/glyphs.jsx +60 -0
- package/expresivo/shared/glyphs.jsx.map +1 -0
- package/package.json +6 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ExpMedalBadgeModifier = 'success' | 'warning' | 'error' | 'info' | 'progress' | 'disabled';
|
|
3
|
+
export type ExpMedalBadgeProps = {
|
|
4
|
+
modifier: ExpMedalBadgeModifier;
|
|
5
|
+
/** One character or a tiny icon inside the medal. */
|
|
6
|
+
glyph?: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
} & Omit<HTMLAttributes<HTMLSpanElement>, 'children'>;
|
|
9
|
+
/**
|
|
10
|
+
* Status badge drawn as an octagonal medal with a ribbon, pinned to a tinted
|
|
11
|
+
* pill. Same status modifiers as the core `Badge`; the label carries the
|
|
12
|
+
* message and the medal only decorates it.
|
|
13
|
+
*
|
|
14
|
+
* Outside an `ExpScope` it falls back to the core `Badge` with the same
|
|
15
|
+
* `modifier`.
|
|
16
|
+
*
|
|
17
|
+
* @component
|
|
18
|
+
* @example
|
|
19
|
+
* <ExpMedalBadge modifier="success" glyph="✓">Passed</ExpMedalBadge>
|
|
20
|
+
*
|
|
21
|
+
* @param {Object} props - The properties of the ExpMedalBadge component.
|
|
22
|
+
* @param {'success' | 'warning' | 'error' | 'info' | 'progress' | 'disabled'} props.modifier - Status color.
|
|
23
|
+
* @param {ReactNode} [props.glyph='•'] - One character or a tiny icon inside the medal.
|
|
24
|
+
* @param {ReactNode} props.children - Label of the status.
|
|
25
|
+
*
|
|
26
|
+
* @returns {ReactNode} The medal badge, or a core `Badge` outside an `ExpScope`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ExpMedalBadge({ modifier, glyph, children, ...restProps }: ExpMedalBadgeProps): ReactNode;
|
|
29
|
+
//# sourceMappingURL=ExpMedalBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpMedalBadge.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpMedalBadge/ExpMedalBadge.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,MAAM,qBAAqB,GAC7B,SAAS,GACT,SAAS,GACT,OAAO,GACP,MAAM,GACN,UAAU,GACV,UAAU,CAAC;AAEf,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,qBAAqB,CAAC;IAChC,qDAAqD;IACrD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,CAAC;AAgDtD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,KAAW,EACX,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,kBAAkB,GAAG,SAAS,CAkDhC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { Badge } from '@clicoh/orion-library';
|
|
4
|
+
import { useExpScope } from '../ExpScope/ExpScope';
|
|
5
|
+
// The ribbon and the pill label use the strong shade: the base `warning`
|
|
6
|
+
// and `success` hues sit below 4.5:1 on their tint.
|
|
7
|
+
const colorMap = {
|
|
8
|
+
success: {
|
|
9
|
+
ring: 'bg-success',
|
|
10
|
+
ribbon: 'bg-success-strong',
|
|
11
|
+
pill: 'border-success bg-success-1 text-success-strong dark:bg-success/16 dark:text-success',
|
|
12
|
+
},
|
|
13
|
+
warning: {
|
|
14
|
+
ring: 'bg-amber',
|
|
15
|
+
ribbon: 'bg-amber-strong',
|
|
16
|
+
pill: 'border-amber bg-warning-1 text-amber-strong dark:bg-warning/16 dark:text-amber',
|
|
17
|
+
},
|
|
18
|
+
error: {
|
|
19
|
+
ring: 'bg-error',
|
|
20
|
+
ribbon: 'bg-error-strong',
|
|
21
|
+
pill: 'border-error bg-error-1 text-error-strong dark:bg-error/16 dark:text-error',
|
|
22
|
+
},
|
|
23
|
+
info: {
|
|
24
|
+
ring: 'bg-info',
|
|
25
|
+
ribbon: 'bg-info-dark-3 dark:bg-info',
|
|
26
|
+
pill: 'border-info bg-info-1 text-info-dark-3 dark:bg-info/16 dark:text-info',
|
|
27
|
+
},
|
|
28
|
+
progress: {
|
|
29
|
+
ring: 'bg-lavender',
|
|
30
|
+
ribbon: 'bg-lavender',
|
|
31
|
+
pill: 'border-lavender bg-lavender-2 text-lavender dark:bg-lavender/18 dark:text-lavender',
|
|
32
|
+
},
|
|
33
|
+
disabled: {
|
|
34
|
+
ring: 'bg-gray-1',
|
|
35
|
+
ribbon: 'bg-gray-1',
|
|
36
|
+
pill: 'border-gray-1 bg-gray-6 text-gray-1 dark:bg-gray-2/16 dark:text-gray-2',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
const glyphColorMap = {
|
|
40
|
+
success: 'text-success',
|
|
41
|
+
warning: 'text-amber',
|
|
42
|
+
error: 'text-error',
|
|
43
|
+
info: 'text-info',
|
|
44
|
+
progress: 'text-lavender',
|
|
45
|
+
disabled: 'text-gray-1 dark:text-gray-2',
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Status badge drawn as an octagonal medal with a ribbon, pinned to a tinted
|
|
49
|
+
* pill. Same status modifiers as the core `Badge`; the label carries the
|
|
50
|
+
* message and the medal only decorates it.
|
|
51
|
+
*
|
|
52
|
+
* Outside an `ExpScope` it falls back to the core `Badge` with the same
|
|
53
|
+
* `modifier`.
|
|
54
|
+
*
|
|
55
|
+
* @component
|
|
56
|
+
* @example
|
|
57
|
+
* <ExpMedalBadge modifier="success" glyph="✓">Passed</ExpMedalBadge>
|
|
58
|
+
*
|
|
59
|
+
* @param {Object} props - The properties of the ExpMedalBadge component.
|
|
60
|
+
* @param {'success' | 'warning' | 'error' | 'info' | 'progress' | 'disabled'} props.modifier - Status color.
|
|
61
|
+
* @param {ReactNode} [props.glyph='•'] - One character or a tiny icon inside the medal.
|
|
62
|
+
* @param {ReactNode} props.children - Label of the status.
|
|
63
|
+
*
|
|
64
|
+
* @returns {ReactNode} The medal badge, or a core `Badge` outside an `ExpScope`.
|
|
65
|
+
*/
|
|
66
|
+
export function ExpMedalBadge({ modifier, glyph = '•', children, ...restProps }) {
|
|
67
|
+
const inScope = useExpScope();
|
|
68
|
+
if (!inScope) {
|
|
69
|
+
return (<Badge {...restProps} modifier={modifier}>
|
|
70
|
+
{children}
|
|
71
|
+
</Badge>);
|
|
72
|
+
}
|
|
73
|
+
const colors = colorMap[modifier];
|
|
74
|
+
return (<span {...restProps} className={clsx('relative inline-flex h-[22px] items-center pl-2.5 whitespace-nowrap', restProps.className)}>
|
|
75
|
+
<span className={clsx('inline-flex h-[18px] items-center rounded-full border pr-2 pl-3.5 text-[11px] leading-4 font-semibold', colors.pill)}>
|
|
76
|
+
{children}
|
|
77
|
+
</span>
|
|
78
|
+
<span aria-hidden="true" className="absolute top-px left-0 size-5">
|
|
79
|
+
<span className={clsx('exp-medal-ribbon absolute top-3 left-[5px] h-[11px] w-2.5', colors.ribbon)}/>
|
|
80
|
+
<span className={clsx('exp-medal-octagon absolute inset-0', colors.ring)}/>
|
|
81
|
+
<span className={clsx('exp-medal-octagon absolute inset-0.5 flex items-center justify-center bg-white text-[10px] leading-none font-extrabold dark:bg-black', glyphColorMap[modifier])}>
|
|
82
|
+
{glyph}
|
|
83
|
+
</span>
|
|
84
|
+
</span>
|
|
85
|
+
</span>);
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=ExpMedalBadge.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpMedalBadge.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpMedalBadge/ExpMedalBadge.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAmBnD,yEAAyE;AACzE,oDAAoD;AACpD,MAAM,QAAQ,GAA+C;IAC3D,OAAO,EAAE;QACP,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,mBAAmB;QAC3B,IAAI,EAAE,sFAAsF;KAC7F;IACD,OAAO,EAAE;QACP,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,iBAAiB;QACzB,IAAI,EAAE,gFAAgF;KACvF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,iBAAiB;QACzB,IAAI,EAAE,4EAA4E;KACnF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,6BAA6B;QACrC,IAAI,EAAE,uEAAuE;KAC9E;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,aAAa;QACrB,IAAI,EAAE,oFAAoF;KAC3F;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,WAAW;QACnB,IAAI,EAAE,wEAAwE;KAC/E;CACF,CAAC;AAEF,MAAM,aAAa,GAA0C;IAC3D,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,eAAe;IACzB,QAAQ,EAAE,8BAA8B;CACzC,CAAC;AAEF;;;;;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 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpMedalBadge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EACV,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expresivo/ExpMedalBadge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import type { ExpMascotName } from '../ExpMascot/catalog';
|
|
3
|
+
export type ExpPageHeroLevel = 'h3' | 'h4' | 'h5';
|
|
4
|
+
export type ExpPageHeroBubble = {
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
text?: ReactNode;
|
|
7
|
+
badge?: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export type ExpPageHeroCollapse = {
|
|
10
|
+
collapsed: boolean;
|
|
11
|
+
onToggle: () => void;
|
|
12
|
+
/** Accessible name while collapsed, such as "Expand header". */
|
|
13
|
+
expandLabel: string;
|
|
14
|
+
/** Accessible name while expanded, such as "Collapse header". */
|
|
15
|
+
collapseLabel: string;
|
|
16
|
+
};
|
|
17
|
+
export type ExpPageHeroProps = {
|
|
18
|
+
title: ReactNode;
|
|
19
|
+
eyebrow?: ReactNode;
|
|
20
|
+
headingLevel?: ExpPageHeroLevel;
|
|
21
|
+
titleAdornment?: ReactNode;
|
|
22
|
+
description?: ReactNode;
|
|
23
|
+
/** Content under the description, such as stat chips or a data line. */
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
actions?: ReactNode;
|
|
26
|
+
mascot?: ExpMascotName;
|
|
27
|
+
bubble?: ExpPageHeroBubble;
|
|
28
|
+
collapse?: ExpPageHeroCollapse;
|
|
29
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children'>;
|
|
30
|
+
/**
|
|
31
|
+
* Page header for the top of a screen, meant for the `heading` slot of
|
|
32
|
+
* `DashboardTemplate`: an eyebrow, the title, a description, optional content
|
|
33
|
+
* under it, and a mascot with a speech bubble on the right.
|
|
34
|
+
*
|
|
35
|
+
* On wide screens it draws a band with a dotted lavender background. With
|
|
36
|
+
* `collapse`, a corner button tucks it down to the title, and the mascot hangs
|
|
37
|
+
* from a thread instead; the consumer keeps the state. On small screens it is
|
|
38
|
+
* a plain title row without eyebrow, mascot or bubble, and `collapse` has no
|
|
39
|
+
* effect.
|
|
40
|
+
*
|
|
41
|
+
* Outside an `ExpScope` it renders the core title row of `DashboardTemplate`:
|
|
42
|
+
* title, adornment, description, children and actions.
|
|
43
|
+
*
|
|
44
|
+
* @component
|
|
45
|
+
* @example
|
|
46
|
+
* <ExpPageHero
|
|
47
|
+
* eyebrow="Case memory"
|
|
48
|
+
* title="Cases"
|
|
49
|
+
* description="Review past diagnoses before starting from scratch."
|
|
50
|
+
* mascot="fixi-02-investigando"
|
|
51
|
+
* bubble={{ title: 'Lead found', text: 'Search by ticket or symptom.' }}
|
|
52
|
+
* />
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Collapsible, with the state kept by the consumer
|
|
56
|
+
* <ExpPageHero
|
|
57
|
+
* title="Cases"
|
|
58
|
+
* mascot="fixi-02-investigando"
|
|
59
|
+
* collapse={{
|
|
60
|
+
* collapsed,
|
|
61
|
+
* onToggle: () => setCollapsed(!collapsed),
|
|
62
|
+
* expandLabel: 'Expand header',
|
|
63
|
+
* collapseLabel: 'Collapse header',
|
|
64
|
+
* }}
|
|
65
|
+
* />
|
|
66
|
+
*
|
|
67
|
+
* @param {Object} props - The properties of the ExpPageHero component.
|
|
68
|
+
* @param {ReactNode} props.title - Page title.
|
|
69
|
+
* @param {ReactNode} [props.eyebrow] - Short uppercase line above the title, only on wide screens.
|
|
70
|
+
* @param {'h3' | 'h4' | 'h5'} [props.headingLevel='h3'] - Heading level of the title.
|
|
71
|
+
* @param {ReactNode} [props.titleAdornment] - Content next to the title, such as a `Badge`.
|
|
72
|
+
* @param {ReactNode} [props.description] - Text under the title; hidden while collapsed.
|
|
73
|
+
* @param {ReactNode} [props.children] - Content under the description, such as stat chips; hidden while collapsed.
|
|
74
|
+
* @param {ReactNode} [props.actions] - Content on the right, such as buttons; it moves under the title on small screens.
|
|
75
|
+
* @param {ExpMascotName} [props.mascot] - Mascot on the right, 104px; 56px and hanging while collapsed.
|
|
76
|
+
* @param {ExpPageHeroBubble} [props.bubble] - Speech bubble next to the mascot: `title`, `text` and `badge`.
|
|
77
|
+
* @param {ExpPageHeroCollapse} [props.collapse] - Makes the header collapsible: `collapsed`, `onToggle`, `expandLabel` and `collapseLabel`.
|
|
78
|
+
*
|
|
79
|
+
* @returns {ReactNode} The page header.
|
|
80
|
+
*/
|
|
81
|
+
export declare function ExpPageHero({ title, eyebrow, headingLevel, titleAdornment, description, children, actions, mascot, bubble, collapse, ...restProps }: ExpPageHeroProps): ReactNode;
|
|
82
|
+
//# sourceMappingURL=ExpPageHero.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpPageHero.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpPageHero/ExpPageHero.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAKnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,CAAC,EAAE,mBAAmB,CAAC;CAChC,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,YAAmB,EACnB,cAAc,EACd,WAAW,EACX,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,gBAAgB,GAAG,SAAS,CAmH9B"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { useId } from 'react';
|
|
4
|
+
import { Heading } from '@clicoh/orion-library';
|
|
5
|
+
import { ExpBubble } from '../ExpBubble/ExpBubble';
|
|
6
|
+
import { ExpCollapseToggle } from '../ExpCollapseToggle/ExpCollapseToggle';
|
|
7
|
+
import { ExpMascot } from '../ExpMascot/ExpMascot';
|
|
8
|
+
import { useExpScopeOptions } from '../ExpScope/ExpScope';
|
|
9
|
+
/**
|
|
10
|
+
* Page header for the top of a screen, meant for the `heading` slot of
|
|
11
|
+
* `DashboardTemplate`: an eyebrow, the title, a description, optional content
|
|
12
|
+
* under it, and a mascot with a speech bubble on the right.
|
|
13
|
+
*
|
|
14
|
+
* On wide screens it draws a band with a dotted lavender background. With
|
|
15
|
+
* `collapse`, a corner button tucks it down to the title, and the mascot hangs
|
|
16
|
+
* from a thread instead; the consumer keeps the state. On small screens it is
|
|
17
|
+
* a plain title row without eyebrow, mascot or bubble, and `collapse` has no
|
|
18
|
+
* effect.
|
|
19
|
+
*
|
|
20
|
+
* Outside an `ExpScope` it renders the core title row of `DashboardTemplate`:
|
|
21
|
+
* title, adornment, description, children and actions.
|
|
22
|
+
*
|
|
23
|
+
* @component
|
|
24
|
+
* @example
|
|
25
|
+
* <ExpPageHero
|
|
26
|
+
* eyebrow="Case memory"
|
|
27
|
+
* title="Cases"
|
|
28
|
+
* description="Review past diagnoses before starting from scratch."
|
|
29
|
+
* mascot="fixi-02-investigando"
|
|
30
|
+
* bubble={{ title: 'Lead found', text: 'Search by ticket or symptom.' }}
|
|
31
|
+
* />
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* // Collapsible, with the state kept by the consumer
|
|
35
|
+
* <ExpPageHero
|
|
36
|
+
* title="Cases"
|
|
37
|
+
* mascot="fixi-02-investigando"
|
|
38
|
+
* collapse={{
|
|
39
|
+
* collapsed,
|
|
40
|
+
* onToggle: () => setCollapsed(!collapsed),
|
|
41
|
+
* expandLabel: 'Expand header',
|
|
42
|
+
* collapseLabel: 'Collapse header',
|
|
43
|
+
* }}
|
|
44
|
+
* />
|
|
45
|
+
*
|
|
46
|
+
* @param {Object} props - The properties of the ExpPageHero component.
|
|
47
|
+
* @param {ReactNode} props.title - Page title.
|
|
48
|
+
* @param {ReactNode} [props.eyebrow] - Short uppercase line above the title, only on wide screens.
|
|
49
|
+
* @param {'h3' | 'h4' | 'h5'} [props.headingLevel='h3'] - Heading level of the title.
|
|
50
|
+
* @param {ReactNode} [props.titleAdornment] - Content next to the title, such as a `Badge`.
|
|
51
|
+
* @param {ReactNode} [props.description] - Text under the title; hidden while collapsed.
|
|
52
|
+
* @param {ReactNode} [props.children] - Content under the description, such as stat chips; hidden while collapsed.
|
|
53
|
+
* @param {ReactNode} [props.actions] - Content on the right, such as buttons; it moves under the title on small screens.
|
|
54
|
+
* @param {ExpMascotName} [props.mascot] - Mascot on the right, 104px; 56px and hanging while collapsed.
|
|
55
|
+
* @param {ExpPageHeroBubble} [props.bubble] - Speech bubble next to the mascot: `title`, `text` and `badge`.
|
|
56
|
+
* @param {ExpPageHeroCollapse} [props.collapse] - Makes the header collapsible: `collapsed`, `onToggle`, `expandLabel` and `collapseLabel`.
|
|
57
|
+
*
|
|
58
|
+
* @returns {ReactNode} The page header.
|
|
59
|
+
*/
|
|
60
|
+
export function ExpPageHero({ title, eyebrow, headingLevel = 'h3', titleAdornment, description, children, actions, mascot, bubble, collapse, ...restProps }) {
|
|
61
|
+
const options = useExpScopeOptions();
|
|
62
|
+
const generatedId = useId();
|
|
63
|
+
const id = restProps.id ?? generatedId;
|
|
64
|
+
const collapsed = !!collapse?.collapsed;
|
|
65
|
+
const hasAside = !!mascot || !!bubble;
|
|
66
|
+
const titleRow = (<div className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1">
|
|
67
|
+
<Heading level={headingLevel}>{title}</Heading>
|
|
68
|
+
{titleAdornment}
|
|
69
|
+
</div>);
|
|
70
|
+
if (!options) {
|
|
71
|
+
return (<div {...restProps} className={clsx('flex flex-col items-start gap-3 sm:flex-row sm:justify-between', restProps.className)}>
|
|
72
|
+
<div className="flex min-w-0 flex-col gap-1">
|
|
73
|
+
{titleRow}
|
|
74
|
+
{!!description && (<div className="text-gray-1 dark:text-gray-2 text-sm">
|
|
75
|
+
{description}
|
|
76
|
+
</div>)}
|
|
77
|
+
{children}
|
|
78
|
+
</div>
|
|
79
|
+
{actions}
|
|
80
|
+
</div>);
|
|
81
|
+
}
|
|
82
|
+
return (<div {...restProps} id={id} data-state={collapsed ? 'collapsed' : 'expanded'} className={clsx('exp-hero relative flex flex-col items-start gap-3 sm:flex-row sm:items-center sm:justify-between lg:gap-6', collapsed
|
|
83
|
+
? 'lg:min-h-[72px] lg:py-3.5 lg:pr-30 lg:pl-6'
|
|
84
|
+
: 'lg:px-8 lg:py-6', !collapsed && !!collapse && !hasAside && 'lg:pr-20', restProps.className)}>
|
|
85
|
+
<div className="flex min-w-0 flex-col items-start gap-1 lg:flex-[1_1_420px]">
|
|
86
|
+
{!!eyebrow && (<p className={clsx('text-lavender dark:text-lavender-dark hidden text-xs leading-4 font-semibold tracking-[0.04em] uppercase', !collapsed && 'lg:block')}>
|
|
87
|
+
<span aria-hidden="true">✦ </span>
|
|
88
|
+
{eyebrow}
|
|
89
|
+
</p>)}
|
|
90
|
+
{titleRow}
|
|
91
|
+
{!!description && (<div className={clsx('text-gray-1 dark:text-gray-2 max-w-[680px] text-sm leading-[22px] text-pretty', collapsed && 'lg:hidden')}>
|
|
92
|
+
{description}
|
|
93
|
+
</div>)}
|
|
94
|
+
{!!children && (<div className={clsx('mt-2 w-full', collapsed && 'lg:hidden')}>
|
|
95
|
+
{children}
|
|
96
|
+
</div>)}
|
|
97
|
+
</div>
|
|
98
|
+
{actions}
|
|
99
|
+
{!!hasAside && (<div className={clsx('hidden shrink-0 items-center gap-4', !collapsed && 'lg:flex', !!collapse && 'lg:mr-7')}>
|
|
100
|
+
{!!bubble && (<ExpBubble tail="right" title={bubble.title} badge={bubble.badge}>
|
|
101
|
+
{bubble.text}
|
|
102
|
+
</ExpBubble>)}
|
|
103
|
+
{!!mascot && <ExpMascot name={mascot} size={104}/>}
|
|
104
|
+
</div>)}
|
|
105
|
+
{!!collapsed && !!mascot && (<span className="absolute top-0 right-18 hidden lg:block">
|
|
106
|
+
<ExpMascot name={mascot} size={56} motion="hang"/>
|
|
107
|
+
</span>)}
|
|
108
|
+
{!!collapse && (<div className="absolute top-5 right-5 hidden lg:block">
|
|
109
|
+
<ExpCollapseToggle collapsed={collapsed} onToggle={collapse.onToggle} expandLabel={collapse.expandLabel} collapseLabel={collapse.collapseLabel} aria-controls={id}/>
|
|
110
|
+
</div>)}
|
|
111
|
+
</div>);
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=ExpPageHero.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpPageHero.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpPageHero/ExpPageHero.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAuC,KAAK,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAiC1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,YAAY,GAAG,IAAI,EACnB,cAAc,EACd,WAAW,EACX,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,EACR,GAAG,SAAS,EACK;IACjB,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,MAAM,WAAW,GAAG,KAAK,EAAE,CAAC;IAC5B,MAAM,EAAE,GAAG,SAAS,CAAC,EAAE,IAAI,WAAW,CAAC;IACvC,MAAM,SAAS,GAAG,CAAC,CAAC,QAAQ,EAAE,SAAS,CA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I,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAG,CACrD;QAAA,EAAE,GAAG,CAAC,CACP,CACD;MAAA,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,MAAM,IAAI,CAC1B,CAAC,IAAI,CAAC,SAAS,CAAC,yCAAyC,CACvD;UAAA,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAClD;QAAA,EAAE,IAAI,CAAC,CACR,CACD;MAAA,CAAC,CAAC,CAAC,QAAQ,IAAI,CACb,CAAC,GAAG,CAAC,SAAS,CAAC,wCAAwC,CACrD;UAAA,CAAC,iBAAiB,CAChB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAC5B,WAAW,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAClC,aAAa,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CACtC,aAAa,CAAC,CAAC,EAAE,CAAC,EAEtB;QAAA,EAAE,GAAG,CAAC,CACP,CACH;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpPageHero/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expresivo/ExpPageHero/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import type { ExpMascotName } from '../ExpMascot/catalog';
|
|
3
|
+
export type ExpPeekProps = {
|
|
4
|
+
/** What the mascots peek from behind, usually a single button. */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Mascots in the order they take turns, as groups of poses. Each turn shows
|
|
8
|
+
* one pose of its group, picked at random, and the order repeats.
|
|
9
|
+
*/
|
|
10
|
+
cast?: readonly (readonly ExpMascotName[])[];
|
|
11
|
+
/** Width and height of the mascot, in pixels. */
|
|
12
|
+
size?: number;
|
|
13
|
+
/** Hides the mascot and stops the turns, for instance while the action runs. */
|
|
14
|
+
paused?: boolean;
|
|
15
|
+
/** How long each mascot stays out, in milliseconds. */
|
|
16
|
+
visibleMs?: number;
|
|
17
|
+
/** Pause between one mascot and the next, in milliseconds. */
|
|
18
|
+
gapMs?: number;
|
|
19
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
20
|
+
/**
|
|
21
|
+
* Wraps a button so the clicOH mascots peek out from behind its edges, one at
|
|
22
|
+
* a time: from the top edge at any point, or from the left or right side, with
|
|
23
|
+
* a random pose and tilt. Each one springs out, stays a few seconds, hides and
|
|
24
|
+
* makes room for the next, in the order of `cast`.
|
|
25
|
+
*
|
|
26
|
+
* The mascot sits behind the wrapped element, which covers its lower part;
|
|
27
|
+
* nothing is clipped, so leave some room around it. It is decorative and
|
|
28
|
+
* never takes clicks. Pause it while the action runs.
|
|
29
|
+
*
|
|
30
|
+
* Shows no mascot with reduced motion, outside an `ExpScope`, or when the
|
|
31
|
+
* scope hides mascots; the wrapped element renders as usual.
|
|
32
|
+
*
|
|
33
|
+
* @component
|
|
34
|
+
* @example
|
|
35
|
+
* <ExpPeek paused={isSending} className="w-full">
|
|
36
|
+
* <Button type="submit" className="w-full">Sign in</Button>
|
|
37
|
+
* </ExpPeek>
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // Only Fixi, bigger and slower
|
|
41
|
+
* <ExpPeek cast={[['fixi-01-feliz', 'fixi-06-celebrando']]} size={56} visibleMs={4000}>
|
|
42
|
+
* <Button>Fix it</Button>
|
|
43
|
+
* </ExpPeek>
|
|
44
|
+
*
|
|
45
|
+
* @param {Object} props - The properties of the ExpPeek component.
|
|
46
|
+
* @param {ReactNode} props.children - What the mascots peek from behind, usually a single button.
|
|
47
|
+
* @param {ExpMascotName[][]} [props.cast] - Mascots in turn order, as groups of poses; each turn picks one pose of its group. Defaults to Oculus searching, Bugi showing up and Fixi fixing.
|
|
48
|
+
* @param {number} [props.size=44] - Width and height of the mascot, in pixels.
|
|
49
|
+
* @param {boolean} [props.paused=false] - Hides the mascot and stops the turns.
|
|
50
|
+
* @param {number} [props.visibleMs=3000] - How long each mascot stays out, in milliseconds.
|
|
51
|
+
* @param {number} [props.gapMs=2000] - Pause between one mascot and the next, in milliseconds.
|
|
52
|
+
*
|
|
53
|
+
* @returns {ReactNode} The wrapped element with the mascots behind it.
|
|
54
|
+
*/
|
|
55
|
+
export declare function ExpPeek({ children, cast, size, paused, visibleMs, gapMs, className, ...restProps }: ExpPeekProps): ReactNode;
|
|
56
|
+
//# sourceMappingURL=ExpPeek.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpPeek.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpPeek/ExpPeek.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAe1D,MAAM,MAAM,YAAY,GAAG;IACzB,kEAAkE;IAClE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,aAAa,EAAE,CAAC,EAAE,CAAC;IAC7C,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAoDrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,IAAiB,EACjB,IAAS,EACT,MAAc,EACd,SAAgB,EAChB,KAAY,EACZ,SAAS,EACT,GAAG,SAAS,EACb,EAAE,YAAY,GAAG,SAAS,CA6D1B"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { useEffect, useState, } from 'react';
|
|
4
|
+
import { ExpMascot } from '../ExpMascot/ExpMascot';
|
|
5
|
+
import { useExpScopeOptions } from '../ExpScope/ExpScope';
|
|
6
|
+
/** Oculus searches, Bugi shows up, Fixi fixes it. */
|
|
7
|
+
const STORY_CAST = [
|
|
8
|
+
[
|
|
9
|
+
'oculus-02-investigando',
|
|
10
|
+
'oculus-07-buscando-rapido',
|
|
11
|
+
'oculus-04-analizando-documento',
|
|
12
|
+
],
|
|
13
|
+
['bugi-01-alerta', 'bugi-05-sorprendido', 'bugi-02-investigando'],
|
|
14
|
+
['fixi-04-reparando', 'fixi-01-feliz', 'fixi-06-celebrando'],
|
|
15
|
+
];
|
|
16
|
+
/** The top edge comes up three times as often as each side. */
|
|
17
|
+
const SPOTS = ['top', 'top', 'top', 'left', 'right'];
|
|
18
|
+
const FIRST_DELAY_MS = 900;
|
|
19
|
+
const RISE_DELAY_MS = 40;
|
|
20
|
+
const HIDE_MS = 420;
|
|
21
|
+
const BOUNCE = 'cubic-bezier(.34,1.56,.64,1)';
|
|
22
|
+
const SINK = 'cubic-bezier(.55,0,.75,.2)';
|
|
23
|
+
function pick(items) {
|
|
24
|
+
return items[Math.floor(Math.random() * items.length)];
|
|
25
|
+
}
|
|
26
|
+
function peekStyle(peek, size, out) {
|
|
27
|
+
const sideways = { top: '50%', marginTop: -size / 2 };
|
|
28
|
+
const place = {
|
|
29
|
+
top: { top: 0, left: `calc(${12 + peek.along * 74}% - ${size / 2}px)` },
|
|
30
|
+
left: { ...sideways, left: 10 },
|
|
31
|
+
right: { ...sideways, right: 10 },
|
|
32
|
+
};
|
|
33
|
+
const outTransform = {
|
|
34
|
+
top: `translateY(-${Math.round(size * 0.68)}px) rotate(${peek.tilt}deg)`,
|
|
35
|
+
left: `translateX(-${size * 0.95}px) rotate(-10deg)`,
|
|
36
|
+
right: `translateX(${size * 0.95}px) rotate(10deg)`,
|
|
37
|
+
};
|
|
38
|
+
return {
|
|
39
|
+
width: size,
|
|
40
|
+
height: size,
|
|
41
|
+
...place[peek.spot],
|
|
42
|
+
transformOrigin: peek.spot === 'top' ? '50% 100%' : '50% 50%',
|
|
43
|
+
transform: out ? outTransform[peek.spot] : 'none',
|
|
44
|
+
opacity: out ? 1 : 0,
|
|
45
|
+
transition: out
|
|
46
|
+
? `transform 520ms ${BOUNCE}, opacity 80ms linear`
|
|
47
|
+
: `transform 360ms ${SINK}, opacity 120ms linear 260ms`,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Wraps a button so the clicOH mascots peek out from behind its edges, one at
|
|
52
|
+
* a time: from the top edge at any point, or from the left or right side, with
|
|
53
|
+
* a random pose and tilt. Each one springs out, stays a few seconds, hides and
|
|
54
|
+
* makes room for the next, in the order of `cast`.
|
|
55
|
+
*
|
|
56
|
+
* The mascot sits behind the wrapped element, which covers its lower part;
|
|
57
|
+
* nothing is clipped, so leave some room around it. It is decorative and
|
|
58
|
+
* never takes clicks. Pause it while the action runs.
|
|
59
|
+
*
|
|
60
|
+
* Shows no mascot with reduced motion, outside an `ExpScope`, or when the
|
|
61
|
+
* scope hides mascots; the wrapped element renders as usual.
|
|
62
|
+
*
|
|
63
|
+
* @component
|
|
64
|
+
* @example
|
|
65
|
+
* <ExpPeek paused={isSending} className="w-full">
|
|
66
|
+
* <Button type="submit" className="w-full">Sign in</Button>
|
|
67
|
+
* </ExpPeek>
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* // Only Fixi, bigger and slower
|
|
71
|
+
* <ExpPeek cast={[['fixi-01-feliz', 'fixi-06-celebrando']]} size={56} visibleMs={4000}>
|
|
72
|
+
* <Button>Fix it</Button>
|
|
73
|
+
* </ExpPeek>
|
|
74
|
+
*
|
|
75
|
+
* @param {Object} props - The properties of the ExpPeek component.
|
|
76
|
+
* @param {ReactNode} props.children - What the mascots peek from behind, usually a single button.
|
|
77
|
+
* @param {ExpMascotName[][]} [props.cast] - Mascots in turn order, as groups of poses; each turn picks one pose of its group. Defaults to Oculus searching, Bugi showing up and Fixi fixing.
|
|
78
|
+
* @param {number} [props.size=44] - Width and height of the mascot, in pixels.
|
|
79
|
+
* @param {boolean} [props.paused=false] - Hides the mascot and stops the turns.
|
|
80
|
+
* @param {number} [props.visibleMs=3000] - How long each mascot stays out, in milliseconds.
|
|
81
|
+
* @param {number} [props.gapMs=2000] - Pause between one mascot and the next, in milliseconds.
|
|
82
|
+
*
|
|
83
|
+
* @returns {ReactNode} The wrapped element with the mascots behind it.
|
|
84
|
+
*/
|
|
85
|
+
export function ExpPeek({ children, cast = STORY_CAST, size = 44, paused = false, visibleMs = 3000, gapMs = 2000, className, ...restProps }) {
|
|
86
|
+
const options = useExpScopeOptions();
|
|
87
|
+
const [peek, setPeek] = useState(null);
|
|
88
|
+
const [out, setOut] = useState(false);
|
|
89
|
+
const active = !!options && options.mascots !== 'hidden' && !paused;
|
|
90
|
+
const castKey = cast.map((group) => group.join(',')).join('|');
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
const groups = castKey
|
|
93
|
+
.split('|')
|
|
94
|
+
.map((group) => group.split(','))
|
|
95
|
+
.filter((group) => group[0] !== '');
|
|
96
|
+
const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
97
|
+
if (!active || reduceMotion || groups.length === 0)
|
|
98
|
+
return;
|
|
99
|
+
let turn = 0;
|
|
100
|
+
const timers = [];
|
|
101
|
+
const later = (run, ms) => {
|
|
102
|
+
timers.push(setTimeout(run, ms));
|
|
103
|
+
};
|
|
104
|
+
const next = () => {
|
|
105
|
+
const group = groups[turn % groups.length];
|
|
106
|
+
turn += 1;
|
|
107
|
+
setPeek({
|
|
108
|
+
turn,
|
|
109
|
+
name: pick(group),
|
|
110
|
+
spot: pick(SPOTS),
|
|
111
|
+
along: Math.random(),
|
|
112
|
+
tilt: Math.round((Math.random() - 0.5) * 24),
|
|
113
|
+
});
|
|
114
|
+
later(() => setOut(true), RISE_DELAY_MS);
|
|
115
|
+
later(() => setOut(false), RISE_DELAY_MS + visibleMs);
|
|
116
|
+
later(next, RISE_DELAY_MS + visibleMs + HIDE_MS + gapMs);
|
|
117
|
+
};
|
|
118
|
+
later(next, FIRST_DELAY_MS);
|
|
119
|
+
return () => {
|
|
120
|
+
timers.forEach(clearTimeout);
|
|
121
|
+
setOut(false);
|
|
122
|
+
};
|
|
123
|
+
}, [active, castKey, visibleMs, gapMs]);
|
|
124
|
+
return (<div {...restProps} className={clsx('relative isolate', className)}>
|
|
125
|
+
{!!peek && (<span key={peek.turn} aria-hidden="true" className="pointer-events-none absolute z-0" style={peekStyle(peek, size, out && active)}>
|
|
126
|
+
<ExpMascot name={peek.name} size={size}/>
|
|
127
|
+
</span>)}
|
|
128
|
+
<div className="relative z-1">{children}</div>
|
|
129
|
+
</div>);
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=ExpPeek.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpPeek.jsx","sourceRoot":"","sources":["../../src/expresivo/ExpPeek/ExpPeek.tsx"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AC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EACzC;QAAA,EAAE,IAAI,CAAC,CACR,CACD;MAAA,CAAC,GAAG,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,EAAE,GAAG,CAC/C;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpPeek/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expresivo/ExpPeek/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ExpPillButtonTone = 'brand' | 'soft';
|
|
3
|
+
export type ExpPillButtonIcon = 'lens' | 'sync' | 'enter' | 'none';
|
|
4
|
+
export type ExpPillButtonProps = {
|
|
5
|
+
tone?: ExpPillButtonTone;
|
|
6
|
+
icon?: ExpPillButtonIcon;
|
|
7
|
+
/** Blocks the button and animates its glyph while the action runs. */
|
|
8
|
+
busy?: boolean;
|
|
9
|
+
/** Label shown while `busy`. Defaults to `children`. */
|
|
10
|
+
busyLabel?: string;
|
|
11
|
+
/** Takes the full width of its container. */
|
|
12
|
+
block?: boolean;
|
|
13
|
+
} & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
14
|
+
/**
|
|
15
|
+
* Light pill-shaped call to action, the same 44px height as the core
|
|
16
|
+
* `Button`. `brand` is a filled lavender pill that turns into the clicOH
|
|
17
|
+
* gradient on hover, with its glyph in a white disc; `soft` is a tinted pill
|
|
18
|
+
* for secondary actions, such as a button inside a field.
|
|
19
|
+
*
|
|
20
|
+
* Outside an `ExpScope` it falls back to the core `Button`: `brand` maps to
|
|
21
|
+
* `principal` and `soft` to `second`.
|
|
22
|
+
*
|
|
23
|
+
* @component
|
|
24
|
+
* @example
|
|
25
|
+
* <ExpPillButton onClick={search}>Search</ExpPillButton>
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* <ExpPillButton tone="soft" icon="sync" busy={isSyncing} busyLabel="Syncing…">
|
|
29
|
+
* Sync
|
|
30
|
+
* </ExpPillButton>
|
|
31
|
+
*
|
|
32
|
+
* @param {Object} props - The properties of the ExpPillButton component.
|
|
33
|
+
* @param {'brand' | 'soft'} [props.tone='brand'] - Filled lavender or tinted.
|
|
34
|
+
* @param {'lens' | 'sync' | 'enter' | 'none'} [props.icon='lens'] - Glyph before the label.
|
|
35
|
+
* @param {boolean} [props.busy=false] - Blocks the button and animates its glyph.
|
|
36
|
+
* @param {string} [props.busyLabel] - Label shown while `busy`.
|
|
37
|
+
* @param {boolean} [props.block=false] - Takes the full width of its container.
|
|
38
|
+
* @param {ReactNode} props.children - Label of the action.
|
|
39
|
+
* @param {ButtonHTMLAttributes<HTMLButtonElement>} restProps - Additional properties for the button element.
|
|
40
|
+
*
|
|
41
|
+
* @returns {ReactNode} The rendered pill, or a core `Button` outside an `ExpScope`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function ExpPillButton({ tone, icon, busy, busyLabel, block, disabled, children, ...restProps }: ExpPillButtonProps): ReactNode;
|
|
44
|
+
//# sourceMappingURL=ExpPillButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpPillButton.d.ts","sourceRoot":"","sources":["../../src/expresivo/ExpPillButton/ExpPillButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAW7D,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,sEAAsE;IACtE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AA+B5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAc,EACd,IAAa,EACb,IAAY,EACZ,SAAS,EACT,KAAa,EACb,QAAgB,EAChB,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,kBAAkB,GAAG,SAAS,CA+DhC"}
|