@uva-glass/component-library 3.29.0 → 3.30.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/Column-BL3dsYxn.js.map +1 -1
- package/dist/Lexical.prod-UwAbgYpF.js.map +1 -1
- package/dist/LexicalClipboard.prod-DHIGjydG.js.map +1 -1
- package/dist/LexicalLink.prod-Bsa9J7L-.js.map +1 -1
- package/dist/LexicalList.prod-jxGuZd4b.js.map +1 -1
- package/dist/LexicalSelection.prod-xk5MiZnZ.js.map +1 -1
- package/dist/LexicalTable.prod-BSjs04iE.js.map +1 -1
- package/dist/LexicalUtils.prod-cQutjKA3.js.map +1 -1
- package/dist/MultiSelectItem-DbOdEllV.js.map +1 -1
- package/dist/SortableProvider-CwX1lFMa.js.map +1 -1
- package/dist/TablePlugin-NmJsn2fm.js.map +1 -1
- package/dist/__mocks__/svgrMock.js.map +1 -1
- package/dist/{client-EQRlhXX7.js → client-D0KlBcsm.js} +1325 -1325
- package/dist/{client-EQRlhXX7.js.map → client-D0KlBcsm.js.map} +1 -1
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Accordion/Accordion.stories.d.ts +2 -2
- package/dist/components/Accordion/Accordion.stories.js.map +1 -1
- package/dist/components/Accordion/Accordion.test.js +3 -3
- package/dist/components/Accordion/Accordion.test.js.map +1 -1
- package/dist/components/AccordionCard/AccordionCard.js.map +1 -1
- package/dist/components/AccordionCard/AccordionCard.stories.d.ts +1 -1
- package/dist/components/AccordionCard/AccordionCard.stories.js.map +1 -1
- package/dist/components/AccordionCard/AccordionCard.test.js +3 -3
- package/dist/components/AccordionCard/AccordionCard.test.js.map +1 -1
- package/dist/components/ActionList/ActionList.js.map +1 -1
- package/dist/components/ActionList/ActionList.stories.d.ts +1 -1
- package/dist/components/ActionList/ActionList.stories.js.map +1 -1
- package/dist/components/ActionList/ActionList.test.js +3 -3
- package/dist/components/ActionList/ActionList.test.js.map +1 -1
- package/dist/components/AppStatusBar/AppStatusBar.js.map +1 -1
- package/dist/components/AppStatusBar/AppStatusBar.stories.d.ts +1 -1
- package/dist/components/AppStatusBar/AppStatusBar.stories.js.map +1 -1
- package/dist/components/AppStatusBar/AppStatusBar.test.js +2 -2
- package/dist/components/AppStatusBar/AppStatusBar.test.js.map +1 -1
- package/dist/components/Attention/Attention.js.map +1 -1
- package/dist/components/Attention/Attention.stories.d.ts +1 -1
- package/dist/components/Attention/Attention.stories.js.map +1 -1
- package/dist/components/Attention/Attention.test.js +2 -2
- package/dist/components/Attention/Attention.test.js.map +1 -1
- package/dist/components/Backdrop/Backdrop.js.map +1 -1
- package/dist/components/Backdrop/Backdrop.stories.d.ts +1 -1
- package/dist/components/Backdrop/Backdrop.stories.js.map +1 -1
- package/dist/components/Backdrop/Backdrop.test.js +2 -2
- package/dist/components/Backdrop/Backdrop.test.js.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.stories.d.ts +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.stories.js.map +1 -1
- package/dist/components/Buttons/Button.js.map +1 -1
- package/dist/components/Buttons/Button.stories.d.ts +2 -2
- package/dist/components/Buttons/Button.stories.js +8 -8
- package/dist/components/Buttons/Button.stories.js.map +1 -1
- package/dist/components/Buttons/Button.test.js +2 -2
- package/dist/components/Buttons/Button.test.js.map +1 -1
- package/dist/components/Buttons/LinkButton.js.map +1 -1
- package/dist/components/Buttons/LinkButton.stories.d.ts +2 -2
- package/dist/components/Buttons/LinkButton.stories.js +10 -10
- package/dist/components/Buttons/LinkButton.stories.js.map +1 -1
- package/dist/components/Buttons/LinkButton.test.js +2 -2
- package/dist/components/Buttons/LinkButton.test.js.map +1 -1
- package/dist/components/Buttons/MenuButton.js.map +1 -1
- package/dist/components/Buttons/MenuButton.stories.d.ts +3 -3
- package/dist/components/Buttons/MenuButton.stories.js +15 -15
- package/dist/components/Buttons/MenuButton.stories.js.map +1 -1
- package/dist/components/Buttons/MenuButton.test.js +2 -2
- package/dist/components/Buttons/MenuButton.test.js.map +1 -1
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/Card.stories.d.ts +3 -3
- package/dist/components/Card/Card.stories.js.map +1 -1
- package/dist/components/Card/Card.test.js +2 -2
- package/dist/components/Card/Card.test.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.stories.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.stories.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.test.js +3 -3
- package/dist/components/Checkbox/Checkbox.test.js.map +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.js.map +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.d.ts +3 -3
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js.map +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +2 -2
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js.map +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js.map +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.d.ts +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +108 -123
- package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
- package/dist/components/Chip/Chip.js.map +1 -1
- package/dist/components/Chip/Chip.stories.d.ts +2 -2
- package/dist/components/Chip/Chip.stories.js +1 -1
- package/dist/components/Chip/Chip.stories.js.map +1 -1
- package/dist/components/ControlsButton/ControlsButton.js.map +1 -1
- package/dist/components/ControlsButton/ControlsButton.stories.d.ts +1 -1
- package/dist/components/ControlsButton/ControlsButton.stories.js +4 -4
- package/dist/components/ControlsButton/ControlsButton.stories.js.map +1 -1
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/Drawer/Drawer.stories.d.ts +2 -2
- package/dist/components/Drawer/Drawer.stories.js +9 -9
- package/dist/components/Drawer/Drawer.stories.js.map +1 -1
- package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.js.map +1 -1
- package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.stories.d.ts +1 -1
- package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.stories.js.map +1 -1
- package/dist/components/ExpandableInfoPanel/ExpandableInfoPanel.js.map +1 -1
- package/dist/components/ExpandableInfoPanel/ExpandableInfoPanel.stories.d.ts +1 -1
- package/dist/components/ExpandableInfoPanel/ExpandableInfoPanel.stories.js.map +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.js.map +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.stories.d.ts +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.stories.js.map +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.test.js +2 -2
- package/dist/components/FeedbackBar/FeedbackBar.test.js.map +1 -1
- package/dist/components/FeedbackBox/FeedbackBox.js.map +1 -1
- package/dist/components/FeedbackBox/FeedbackBox.stories.d.ts +2 -2
- package/dist/components/FeedbackBox/FeedbackBox.stories.js.map +1 -1
- package/dist/components/FieldHint/FieldHint.js.map +1 -1
- package/dist/components/FieldHint/FieldHint.stories.d.ts +2 -2
- package/dist/components/FieldHint/FieldHint.stories.js.map +1 -1
- package/dist/components/Fieldset/Fieldset.js.map +1 -1
- package/dist/components/Fieldset/Fieldset.stories.d.ts +2 -2
- package/dist/components/Fieldset/Fieldset.stories.js.map +1 -1
- package/dist/components/FormField/FormField.stories.d.ts +1 -1
- package/dist/components/FormField/FormField.stories.js.map +1 -1
- package/dist/components/FormInput/FormInput.js.map +1 -1
- package/dist/components/FormInput/FormInput.stories.d.ts +2 -2
- package/dist/components/FormInput/FormInput.stories.js +1 -1
- package/dist/components/FormInput/FormInput.stories.js.map +1 -1
- package/dist/components/GridRow/GridRow.js.map +1 -1
- package/dist/components/GridRow/GridRow.stories.d.ts +2 -2
- package/dist/components/GridRow/GridRow.stories.js.map +1 -1
- package/dist/components/HorizontalList/HorizontalList.js.map +1 -1
- package/dist/components/HorizontalList/HorizontalList.stories.d.ts +2 -2
- package/dist/components/HorizontalList/HorizontalList.stories.js.map +1 -1
- package/dist/components/Icon/Icon.js.map +1 -1
- package/dist/components/Icon/Icon.stories.d.ts +1 -1
- package/dist/components/Icon/Icon.stories.js.map +1 -1
- package/dist/components/Icon/icons/index.js.map +1 -1
- package/dist/components/IconButton/IconButton.stories.d.ts +1 -1
- package/dist/components/IconButton/IconButton.stories.js +5 -5
- package/dist/components/IconButton/IconButton.stories.js.map +1 -1
- package/dist/components/InfoBanner/InfoBanner.js.map +1 -1
- package/dist/components/InfoBanner/InfoBanner.stories.d.ts +1 -1
- package/dist/components/InfoBanner/InfoBanner.stories.js.map +1 -1
- package/dist/components/InfoMessage/InfoMessage.js.map +1 -1
- package/dist/components/InfoMessage/InfoMessage.stories.d.ts +1 -1
- package/dist/components/InfoMessage/InfoMessage.stories.js.map +1 -1
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/Input/Input.stories.d.ts +4 -4
- package/dist/components/Input/Input.stories.js.map +1 -1
- package/dist/components/InputField/InputField.js.map +1 -1
- package/dist/components/InputField/InputField.stories.d.ts +3 -3
- package/dist/components/InputField/InputField.stories.js +12 -12
- package/dist/components/InputField/InputField.stories.js.map +1 -1
- package/dist/components/Label/Label.js.map +1 -1
- package/dist/components/Label/Label.stories.d.ts +2 -2
- package/dist/components/Label/Label.stories.js.map +1 -1
- package/dist/components/Label/Label.test.js +2 -2
- package/dist/components/Label/Label.test.js.map +1 -1
- package/dist/components/MenuLink/MenuLink.js.map +1 -1
- package/dist/components/MenuLink/MenuLink.stories.d.ts +2 -2
- package/dist/components/MenuLink/MenuLink.stories.js.map +1 -1
- package/dist/components/MetaDataList/MetaDataList.js.map +1 -1
- package/dist/components/MetaDataList/MetaDataList.stories.d.ts +1 -1
- package/dist/components/MetaDataList/MetaDataList.stories.js.map +1 -1
- package/dist/components/ModalDialog/ModalDialog.js.map +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.d.ts +3 -3
- package/dist/components/ModalDialog/ModalDialog.stories.js +8 -8
- package/dist/components/ModalDialog/ModalDialog.stories.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts +3 -3
- package/dist/components/MultiSelect/MultiSelect.stories.js +7 -7
- package/dist/components/MultiSelect/MultiSelect.stories.js.map +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.js.map +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.d.ts +2 -2
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +5 -5
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js.map +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js +2 -2
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js.map +1 -1
- package/dist/components/Notification/Notification.js.map +1 -1
- package/dist/components/Notification/Notification.stories.d.ts +2 -2
- package/dist/components/Notification/Notification.stories.js +3 -3
- package/dist/components/Notification/Notification.stories.js.map +1 -1
- package/dist/components/Notification/Notification.test.js +2 -2
- package/dist/components/Notification/Notification.test.js.map +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.js.map +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.d.ts +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +4 -4
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js.map +1 -1
- package/dist/components/OverlayStepBar/OverlayStepBar.js.map +1 -1
- package/dist/components/OverlayStepBar/OverlayStepBar.stories.d.ts +2 -2
- package/dist/components/OverlayStepBar/OverlayStepBar.stories.js.map +1 -1
- package/dist/components/PageOverlay/PageOverlay.js.map +1 -1
- package/dist/components/PageOverlay/PageOverlay.stories.d.ts +3 -3
- package/dist/components/PageOverlay/PageOverlay.stories.js.map +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js.map +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.d.ts +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.js.map +1 -1
- package/dist/components/Periods/Periods.js.map +1 -1
- package/dist/components/Periods/Periods.stories.d.ts +1 -1
- package/dist/components/Periods/Periods.stories.js.map +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.js.map +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.d.ts +3 -3
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
- package/dist/components/RadioButton/RadioButton.js.map +1 -1
- package/dist/components/RadioButton/RadioButton.stories.d.ts +1 -1
- package/dist/components/RadioButton/RadioButton.stories.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +4 -4
- package/dist/components/RadioGroup/RadioGroup.stories.js.map +1 -1
- package/dist/components/RadioGroup/Radiogroup.test.js +2 -2
- package/dist/components/RadioGroup/Radiogroup.test.js.map +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js.map +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.d.ts +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js.map +1 -1
- package/dist/components/Repeater/Repeater.js.map +1 -1
- package/dist/components/Repeater/Repeater.stories.d.ts +1 -1
- package/dist/components/Repeater/Repeater.stories.js.map +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js.map +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js.map +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
- package/dist/components/RteEditor/Providers/LanguageProvider.js.map +1 -1
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/RteEditor.stories.d.ts +1 -1
- package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
- package/dist/components/RteEditor/UvaTheme/UvaTheme.js.map +1 -1
- package/dist/components/RteEditor/helpers.js.map +1 -1
- package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -1
- package/dist/components/RteEditor/hooks/useFlyout.js.map +1 -1
- package/dist/components/RteEditor/hooks/useTranslation.js.map +1 -1
- package/dist/components/RteEditor/translations.js.map +1 -1
- package/dist/components/SectionNotification/SectionNotification.js.map +1 -1
- package/dist/components/SectionNotification/SectionNotification.stories.d.ts +1 -1
- package/dist/components/SectionNotification/SectionNotification.stories.js.map +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.d.ts +2 -2
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.js.map +1 -1
- package/dist/components/SelectListbox/SelectListbox.js.map +1 -1
- package/dist/components/SelectListbox/SelectProvider.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectButton.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectContainer.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectOption.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectOptionBox.js.map +1 -1
- package/dist/components/Sortable/Sortable.js.map +1 -1
- package/dist/components/Sortable/Sortable.stories.d.ts +3 -3
- package/dist/components/Sortable/Sortable.stories.js +13 -13
- package/dist/components/Sortable/Sortable.stories.js.map +1 -1
- package/dist/components/Sortable/actions.js.map +1 -1
- package/dist/components/Sortable/components/SortableHandle.js.map +1 -1
- package/dist/components/Sortable/components/SortableItem.js.map +1 -1
- package/dist/components/Sortable/sortableReducer.js.map +1 -1
- package/dist/components/Spinner/Spinner.js.map +1 -1
- package/dist/components/Spinner/Spinner.stories.d.ts +1 -1
- package/dist/components/Spinner/Spinner.stories.js.map +1 -1
- package/dist/components/StatusBadge/StatusBadge.stories.d.ts +1 -1
- package/dist/components/StatusBadge/StatusBadge.stories.js.map +1 -1
- package/dist/components/StatusBadge/StatusBadge.test.js +2 -2
- package/dist/components/StatusBadge/StatusBadge.test.js.map +1 -1
- package/dist/components/StatusBadge/StatusBage.js.map +1 -1
- package/dist/components/StatusPill/StatusPill.js.map +1 -1
- package/dist/components/StatusPill/StatusPill.stories.d.ts +1 -1
- package/dist/components/StatusPill/StatusPill.stories.js.map +1 -1
- package/dist/components/TextArea/TextArea.js.map +1 -1
- package/dist/components/TextArea/TextArea.stories.d.ts +1 -1
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.stories.js.map +1 -1
- package/dist/components/TextArea/TextArea.test.js +9 -9
- package/dist/components/TextArea/TextArea.test.js.map +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.js.map +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.d.ts +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +5 -5
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.stories.js.map +1 -1
- package/dist/components/VarIndicator/VarIndicator.js.map +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.d.ts +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.js +4 -4
- package/dist/components/VarIndicator/VarIndicator.stories.js.map +1 -1
- package/dist/components/VarIndicator/VarIndicator.test.js +3 -3
- package/dist/components/VarIndicator/VarIndicator.test.js.map +1 -1
- package/dist/components/hooks/useDebounce.js.map +1 -1
- package/dist/components/hooks/useOnClickOutside.js.map +1 -1
- package/dist/components/hooks/usePositionedFloaters.js.map +1 -1
- package/dist/components/hooks/useResponsive.js.map +1 -1
- package/dist/helpers-DZIm3MiJ.js.map +1 -1
- package/dist/index-BVAvx58-.js +10648 -0
- package/dist/index-BVAvx58-.js.map +1 -0
- package/dist/{index-BqLi4tOb.js → index-DV47hRzi.js} +2891 -2818
- package/dist/index-DV47hRzi.js.map +1 -0
- package/dist/index-Di9WPZUe.js +34752 -0
- package/dist/index-Di9WPZUe.js.map +1 -0
- package/dist/index-DllfJcv4.js.map +1 -1
- package/dist/index-PaHiqSUg.js +3099 -0
- package/dist/index-PaHiqSUg.js.map +1 -0
- package/dist/{react-18-dpbWrd2-.js → react-18-inmoTCp-.js} +2 -2
- package/dist/{react-18-dpbWrd2-.js.map → react-18-inmoTCp-.js.map} +1 -1
- package/dist/{react.esm-CsMDid07.js → react.esm-CFMwGdo5.js} +3 -3
- package/dist/{react.esm-CsMDid07.js.map → react.esm-CFMwGdo5.js.map} +1 -1
- package/dist/setupTests.js +11 -1562
- package/dist/setupTests.js.map +1 -1
- package/dist/storyComponents/ClipboardButton/ClipboardButton.js.map +1 -1
- package/dist/storyComponents/Container/Container.js.map +1 -1
- package/dist/storybook__react.d.js +5345 -5766
- package/dist/storybook__react.d.js.map +1 -1
- package/dist/test-utils-ea_YDVtd.js.map +1 -1
- package/package.json +14 -18
- package/dist/index-BqLi4tOb.js.map +0 -1
- package/dist/index-CUap8sKR.js +0 -2962
- package/dist/index-CUap8sKR.js.map +0 -1
- package/dist/index-DH9Vbk37.js +0 -9507
- package/dist/index-DH9Vbk37.js.map +0 -1
- package/dist/index-Dwqes6RH.js +0 -14758
- package/dist/index-Dwqes6RH.js.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as
|
|
4
|
-
import {
|
|
5
|
-
import { TextArea as
|
|
2
|
+
import "../../index-DV47hRzi.js";
|
|
3
|
+
import { r as o, s as t, f as r } from "../../react.esm-CFMwGdo5.js";
|
|
4
|
+
import { j as c } from "../../index-Di9WPZUe.js";
|
|
5
|
+
import { TextArea as n } from "./TextArea.js";
|
|
6
6
|
describe("TextArea", () => {
|
|
7
7
|
it("should render correctly with label", () => {
|
|
8
|
-
|
|
8
|
+
o(/* @__PURE__ */ a(n, { onChange: jest.fn(), label: "Test Label" })), expect(t.getByText("Test Label")).toBeInTheDocument();
|
|
9
9
|
}), it("should call onChange when text is entered", () => {
|
|
10
10
|
const e = jest.fn();
|
|
11
|
-
|
|
11
|
+
o(/* @__PURE__ */ a(n, { onChange: e }));
|
|
12
12
|
const l = t.getByRole("textbox");
|
|
13
13
|
r.input(l, { target: { value: "Hello" } }), expect(e).toHaveBeenCalledWith("Hello");
|
|
14
14
|
}), it("should update character count", () => {
|
|
15
|
-
|
|
15
|
+
o(/* @__PURE__ */ a(n, { onChange: jest.fn(), label: "Test", maxCharacters: 10 }));
|
|
16
16
|
const e = t.getByRole("textbox");
|
|
17
17
|
r.input(e, { target: { value: "Test" } }), expect(t.getByText("4")).toBeInTheDocument(), expect(t.getByText("/ 10")).toBeInTheDocument();
|
|
18
18
|
}), it("should not exceed max characters limit", async () => {
|
|
19
19
|
const e = jest.fn();
|
|
20
|
-
|
|
20
|
+
o(/* @__PURE__ */ a(n, { onChange: e, maxCharacters: 5 }));
|
|
21
21
|
const l = t.getByRole("textbox");
|
|
22
|
-
await
|
|
22
|
+
await c.type(l, "ExceedsLimit"), expect(e).toHaveBeenCalled(), expect(e.mock.calls[e.mock.calls.length - 1][0].length).toBe(5);
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
//# sourceMappingURL=TextArea.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.test.js","sources":["../../../src/components/TextArea/TextArea.test.tsx"],"sourcesContent":["import '@testing-library/jest-dom';\nimport { render, screen, fireEvent } from '@testing-library/react';\nimport { userEvent } from '
|
|
1
|
+
{"version":3,"file":"TextArea.test.js","sources":["../../../src/components/TextArea/TextArea.test.tsx"],"sourcesContent":["import '@testing-library/jest-dom';\nimport { render, screen, fireEvent } from '@testing-library/react';\nimport { userEvent } from 'storybook/test';\n\nimport { TextArea } from './TextArea';\n\ndescribe('TextArea', () => {\n it('should render correctly with label', () => {\n render(<TextArea onChange={jest.fn()} label=\"Test Label\" />);\n expect(screen.getByText('Test Label')).toBeInTheDocument();\n });\n\n it('should call onChange when text is entered', () => {\n const handleChange = jest.fn();\n render(<TextArea onChange={handleChange} />);\n\n const textarea = screen.getByRole('textbox');\n fireEvent.input(textarea, { target: { value: 'Hello' } });\n expect(handleChange).toHaveBeenCalledWith('Hello');\n });\n\n it('should update character count', () => {\n render(<TextArea onChange={jest.fn()} label=\"Test\" maxCharacters={10} />);\n\n const textarea = screen.getByRole('textbox');\n fireEvent.input(textarea, { target: { value: 'Test' } });\n\n expect(screen.getByText('4')).toBeInTheDocument();\n expect(screen.getByText('/ 10')).toBeInTheDocument();\n });\n\n it('should not exceed max characters limit', async () => {\n const handleChange = jest.fn();\n render(<TextArea onChange={handleChange} maxCharacters={5} />);\n\n const textarea = screen.getByRole('textbox');\n\n await userEvent.type(textarea, 'ExceedsLimit');\n\n expect(handleChange).toHaveBeenCalled();\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n expect(handleChange.mock.calls[handleChange.mock.calls.length - 1][0].length).toBe(5);\n });\n});\n"],"names":["render","jsx","TextArea","screen","handleChange","textarea","fireEvent","userEvent"],"mappings":";;;;;AAMA,SAAS,YAAY,MAAM;AACzB,KAAG,sCAAsC,MAAM;AAC7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Switch.js","sources":["../../../src/components/ToggleSwitch/ToggleSwitch.tsx"],"sourcesContent":["import classNames from 'clsx';\n\nimport type { InputHTMLAttributes, ReactNode } from 'react';\n\nimport styles from './ToggleSwitch.module.css';\n\nexport interface ToggleSwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'style' | 'className'> {\n /** The label for the toggle switch. */\n label: string;\n /** Boolean value if label should be visible. */\n labelVisible?: boolean;\n /** Selection for label placement compared to toggle switch. */\n labelPosition?: 'before' | 'after';\n /** Boolean value to be used if the toggle mutates. If true the toggle is disabled in a loading state. */\n loading?: boolean;\n /** Boolean value if extra gap is needed on left of component. */\n extraLeftGap?: boolean;\n}\n\nfunction ConditionalWrapper({\n condition,\n wrapper,\n children,\n}: {\n condition: boolean;\n wrapper: (children: ReactNode) => ReactNode;\n children: ReactNode;\n}) {\n return condition ? wrapper(children) : children;\n}\n\n/** Represents a component for a toggle switch. */\nexport function ToggleSwitch({\n label,\n labelPosition = 'after',\n labelVisible = true,\n loading = false,\n extraLeftGap,\n ...restProps\n}: ToggleSwitchProps) {\n const labelComponent = (\n <span\n className={classNames(\n { [styles['toggle-switch--visually-hidden']]: !labelVisible },\n { [styles['toggle-switch--disabled-label']]: restProps.disabled }\n )}\n >\n {label}\n </span>\n );\n\n return (\n <ConditionalWrapper\n condition={loading}\n wrapper={(children) => <div className={styles['toggle-switch--loading-cursor']}>{children}</div>}\n >\n <label\n className={classNames(\n styles['toggle-switch'],\n { [styles['toggle-switch--disabled']]: restProps.disabled },\n { [styles['toggle-switch--loading']]: loading },\n { [styles['toggle-switch--extra-left-gap']]: extraLeftGap }\n )}\n >\n {labelPosition === 'before' && labelComponent}\n <input className={styles['toggle-switch--visually-hidden']} {...restProps} type=\"checkbox\" />\n <span className={styles['toggle-switch__visible']} title={!labelVisible ? label : ''} />\n {labelPosition === 'after' && labelComponent}\n </label>\n </ConditionalWrapper>\n );\n}\n"],"names":["ConditionalWrapper","condition","wrapper","children","ToggleSwitch","label","labelPosition","labelVisible","loading","extraLeftGap","restProps","labelComponent","jsx","classNames","styles","jsxs"],"mappings":";;;;;;;;;;;;AAmBA,SAASA,EAAmB;AAAA,EAC1B,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAIG;
|
|
1
|
+
{"version":3,"file":"ToggleSwitch.js","sources":["../../../src/components/ToggleSwitch/ToggleSwitch.tsx"],"sourcesContent":["import classNames from 'clsx';\n\nimport type { InputHTMLAttributes, ReactNode } from 'react';\n\nimport styles from './ToggleSwitch.module.css';\n\nexport interface ToggleSwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'style' | 'className'> {\n /** The label for the toggle switch. */\n label: string;\n /** Boolean value if label should be visible. */\n labelVisible?: boolean;\n /** Selection for label placement compared to toggle switch. */\n labelPosition?: 'before' | 'after';\n /** Boolean value to be used if the toggle mutates. If true the toggle is disabled in a loading state. */\n loading?: boolean;\n /** Boolean value if extra gap is needed on left of component. */\n extraLeftGap?: boolean;\n}\n\nfunction ConditionalWrapper({\n condition,\n wrapper,\n children,\n}: {\n condition: boolean;\n wrapper: (children: ReactNode) => ReactNode;\n children: ReactNode;\n}) {\n return condition ? wrapper(children) : children;\n}\n\n/** Represents a component for a toggle switch. */\nexport function ToggleSwitch({\n label,\n labelPosition = 'after',\n labelVisible = true,\n loading = false,\n extraLeftGap,\n ...restProps\n}: ToggleSwitchProps) {\n const labelComponent = (\n <span\n className={classNames(\n { [styles['toggle-switch--visually-hidden']]: !labelVisible },\n { [styles['toggle-switch--disabled-label']]: restProps.disabled }\n )}\n >\n {label}\n </span>\n );\n\n return (\n <ConditionalWrapper\n condition={loading}\n wrapper={(children) => <div className={styles['toggle-switch--loading-cursor']}>{children}</div>}\n >\n <label\n className={classNames(\n styles['toggle-switch'],\n { [styles['toggle-switch--disabled']]: restProps.disabled },\n { [styles['toggle-switch--loading']]: loading },\n { [styles['toggle-switch--extra-left-gap']]: extraLeftGap }\n )}\n >\n {labelPosition === 'before' && labelComponent}\n <input className={styles['toggle-switch--visually-hidden']} {...restProps} type=\"checkbox\" />\n <span className={styles['toggle-switch__visible']} title={!labelVisible ? label : ''} />\n {labelPosition === 'after' && labelComponent}\n </label>\n </ConditionalWrapper>\n );\n}\n"],"names":["ConditionalWrapper","condition","wrapper","children","ToggleSwitch","label","labelPosition","labelVisible","loading","extraLeftGap","restProps","labelComponent","jsx","classNames","styles","jsxs"],"mappings":";;;;;;;;;;;;AAmBA,SAASA,EAAmB;AAAA,EAC1B,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAIG;AACD,SAAOF,IAAYC,EAAQC,CAAQ,IAAIA;AACzC;AAGO,SAASC,EAAa;AAAA,EAC3B,OAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,cAAAC,IAAe;AAAA,EACf,SAAAC,IAAU;AAAA,EACV,cAAAC;AAAA,EACA,GAAGC;AACL,GAAsB;AACpB,QAAMC,IACJ,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAAA,QACT,EAAE,CAACC,EAAO,gCAAgC,CAAC,GAAG,CAACP,EAAA;AAAA,QAC/C,EAAE,CAACO,EAAO,+BAA+B,CAAC,GAAGJ,EAAU,SAAA;AAAA,MAAS;AAAA,MAGjE,UAAAL;AAAA,IAAA;AAAA,EAAA;AAIL,SACE,gBAAAO;AAAA,IAACZ;AAAA,IAAA;AAAA,MACC,WAAWQ;AAAA,MACX,SAAS,CAACL,MAAa,gBAAAS,EAAC,SAAI,WAAWE,EAAO,+BAA+B,GAAI,UAAAX,GAAS;AAAA,MAE1F,UAAA,gBAAAY;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWF;AAAAA,YACTC,EAAO,eAAe;AAAA,YACtB,EAAE,CAACA,EAAO,yBAAyB,CAAC,GAAGJ,EAAU,SAAA;AAAA,YACjD,EAAE,CAACI,EAAO,wBAAwB,CAAC,GAAGN,EAAA;AAAA,YACtC,EAAE,CAACM,EAAO,+BAA+B,CAAC,GAAGL,EAAA;AAAA,UAAa;AAAA,UAG3D,UAAA;AAAA,YAAAH,MAAkB,YAAYK;AAAA,YAC/B,gBAAAC,EAAC,WAAM,WAAWE,EAAO,gCAAgC,GAAI,GAAGJ,GAAW,MAAK,YAAW;AAAA,YAC3F,gBAAAE,EAAC,QAAA,EAAK,WAAWE,EAAO,wBAAwB,GAAG,OAAQP,IAAuB,KAARF,EAAQ,CAAI;AAAA,YACrFC,MAAkB,WAAWK;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAChC;AAAA,EAAA;AAGN;"}
|
|
@@ -2,4 +2,4 @@ import { Meta } from '@storybook/react';
|
|
|
2
2
|
import { ToggleSwitchProps } from './ToggleSwitch';
|
|
3
3
|
declare const _default: Meta<ToggleSwitchProps>;
|
|
4
4
|
export default _default;
|
|
5
|
-
export declare const ToggleSwitchExample: import('
|
|
5
|
+
export declare const ToggleSwitchExample: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, ToggleSwitchProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { W as l } from "../../index-Di9WPZUe.js";
|
|
3
3
|
import { ToggleSwitch as e } from "./ToggleSwitch.js";
|
|
4
|
-
const
|
|
4
|
+
const a = `
|
|
5
5
|
// Has all InputHTMLAttributes props available except "className" and "style"
|
|
6
6
|
<ToggleSwitch onChange={onChangeFunction} checked={checked} label={label} />
|
|
7
7
|
`, p = {
|
|
@@ -9,13 +9,13 @@ const n = `
|
|
|
9
9
|
component: e,
|
|
10
10
|
parameters: {
|
|
11
11
|
inspectComponent: e,
|
|
12
|
-
codeString:
|
|
12
|
+
codeString: a
|
|
13
13
|
}
|
|
14
|
-
},
|
|
14
|
+
}, n = (t) => /* @__PURE__ */ o(e, { ...t }), s = {
|
|
15
15
|
label: "Toggle switch example",
|
|
16
16
|
labelPosition: "before",
|
|
17
17
|
onChange: l()
|
|
18
|
-
}, c =
|
|
18
|
+
}, c = n.bind({});
|
|
19
19
|
c.args = {
|
|
20
20
|
...s
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleSwitch.stories.js","sources":["../../../src/components/ToggleSwitch/ToggleSwitch.stories.tsx"],"sourcesContent":["import { fn } from '
|
|
1
|
+
{"version":3,"file":"ToggleSwitch.stories.js","sources":["../../../src/components/ToggleSwitch/ToggleSwitch.stories.tsx"],"sourcesContent":["import { fn } from 'storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { ToggleSwitchProps } from './ToggleSwitch';\n\nimport { ToggleSwitch } from './ToggleSwitch';\n\nconst codeString = `\n// Has all InputHTMLAttributes props available except \"className\" and \"style\" \n<ToggleSwitch onChange={onChangeFunction} checked={checked} label={label} />\n`;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/ToggleSwitch',\n component: ToggleSwitch,\n parameters: {\n inspectComponent: ToggleSwitch,\n codeString: codeString,\n },\n} as Meta<ToggleSwitchProps>;\n\nconst Template: StoryFn<ToggleSwitchProps> = (args) => {\n return <ToggleSwitch {...args} />;\n};\n\nconst defaultArgs: Partial<ToggleSwitchProps> = {\n label: 'Toggle switch example',\n labelPosition: 'before',\n onChange: fn(),\n};\n\nexport const ToggleSwitchExample = Template.bind({});\nToggleSwitchExample.args = {\n ...defaultArgs,\n};\n"],"names":["codeString","ToggleSwitch_stories","ToggleSwitch","Template","args","jsx","defaultArgs","fn","ToggleSwitchExample"],"mappings":";;;AAOA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMnBC,IAAe;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EAAA;AAEJ,GAEMG,IAAuC,CAACC,MACrC,gBAAAC,EAACH,GAAA,EAAc,GAAGE,EAAA,CAAM,GAG3BE,IAA0C;AAAA,EAC9C,OAAO;AAAA,EACP,eAAe;AAAA,EACf,UAAUC,EAAA;AACZ,GAEaC,IAAsBL,EAAS,KAAK,CAAA,CAAE;AACnDK,EAAoB,OAAO;AAAA,EACzB,GAAGF;AACL;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { ReactNode } from 'react';\n\nimport styles from './Tooltip.module.css';\n\nexport interface TooltipProps {\n /** The element which triggers the tooltip on hover. */\n element: ReactNode;\n /** The id of the tooltip element. */\n id: string;\n /** The contents of the tooltip. */\n text: string;\n /** The size of the tooltip. */\n size?: 'small' | 'medium' | 'large';\n /** <span style=\"color: red\">**Obsolete**</span>. Used by Lens only, and should be refactored */\n openUnderTrigger?: boolean;\n}\n\n/** Represents a component for a custom tooltip. */\nexport function Tooltip({ element, id, text, size = 'medium', openUnderTrigger = false }: TooltipProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n const tooltipRef = useRef<HTMLSpanElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const [position, setPosition] = useState({ top: 0, left: 0 });\n\n /* eslint-disable @typescript-eslint/no-magic-numbers */\n const topOffset = (size === 'small' && 20) || (size === 'large' && 35) || 27;\n const leftOffset = (size === 'small' && 25) || (size === 'large' && 70) || 47;\n /* eslint-enable @typescript-eslint/no-magic-numbers */\n\n const calculatePosition = useCallback(() => {\n if (containerRef.current && tooltipRef.current) {\n const triggerRect = containerRef.current.getBoundingClientRect();\n const tooltipRect = tooltipRef.current.getBoundingClientRect();\n const scrollY = window.scrollY;\n const scrollX = window.scrollX;\n let top = triggerRect.top + scrollY + topOffset - tooltipRect.height;\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n const left = triggerRect.left + scrollX + leftOffset + (triggerRect.width - tooltipRect.width) / 2;\n\n // Adjust top position to account for page scrolling\n top -= scrollY;\n\n // Position tooltip below if it would be above the viewport\n if (top < 0) {\n top = triggerRect.bottom + scrollY;\n }\n\n setPosition({ top, left });\n }\n }, [leftOffset, topOffset]);\n\n const onKeyUp = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setIsOpen(false);\n }\n },\n [setIsOpen]\n );\n\n function show() {\n setIsOpen(true);\n }\n\n function hide() {\n setIsOpen(false);\n }\n\n function toggle() {\n if (isOpen) setIsOpen(false);\n else setIsOpen(true);\n }\n\n useEffect(() => {\n if (!containerRef.current) return;\n\n const tooltipContainerRef = containerRef.current;\n\n tooltipContainerRef.addEventListener('keyup', onKeyUp, true);\n\n return () => {\n tooltipContainerRef.removeEventListener('keyup', onKeyUp, true);\n };\n }, [onKeyUp]);\n\n useEffect(() => {\n calculatePosition();\n window.addEventListener('resize', calculatePosition);\n return () => {\n window.removeEventListener('resize', calculatePosition);\n };\n }, [calculatePosition]);\n\n useEffect(() => {\n // Recalculate position when isOpen changes\n if (isOpen && !openUnderTrigger) {\n calculatePosition();\n }\n }, [isOpen, openUnderTrigger, calculatePosition]);\n\n return (\n <div\n className={styles['tooltip-container']}\n onBlur={hide}\n onFocus={show}\n onMouseEnter={show}\n onMouseLeave={hide}\n onMouseUp={toggle}\n ref={containerRef}\n role=\"button\"\n tabIndex={-1}\n >\n <div aria-describedby={isOpen ? id : undefined}>{element}</div>\n {isOpen && (\n <span\n ref={tooltipRef}\n className={openUnderTrigger ? styles['tooltip_under-trigger'] : styles[`tooltip_${size}`]}\n id={id}\n role=\"tooltip\"\n style={openUnderTrigger ? {} : { top: position.top, left: position.left }}\n >\n {text}\n </span>\n )}\n </div>\n );\n}\n"],"names":["Tooltip","element","id","text","size","openUnderTrigger","containerRef","useRef","tooltipRef","isOpen","setIsOpen","useState","position","setPosition","topOffset","leftOffset","calculatePosition","useCallback","triggerRect","tooltipRect","scrollY","scrollX","top","left","onKeyUp","event","show","hide","toggle","useEffect","tooltipContainerRef","jsxs","styles","jsx"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport type { ReactNode } from 'react';\n\nimport styles from './Tooltip.module.css';\n\nexport interface TooltipProps {\n /** The element which triggers the tooltip on hover. */\n element: ReactNode;\n /** The id of the tooltip element. */\n id: string;\n /** The contents of the tooltip. */\n text: string;\n /** The size of the tooltip. */\n size?: 'small' | 'medium' | 'large';\n /** <span style=\"color: red\">**Obsolete**</span>. Used by Lens only, and should be refactored */\n openUnderTrigger?: boolean;\n}\n\n/** Represents a component for a custom tooltip. */\nexport function Tooltip({ element, id, text, size = 'medium', openUnderTrigger = false }: TooltipProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n const tooltipRef = useRef<HTMLSpanElement>(null);\n const [isOpen, setIsOpen] = useState(false);\n const [position, setPosition] = useState({ top: 0, left: 0 });\n\n /* eslint-disable @typescript-eslint/no-magic-numbers */\n const topOffset = (size === 'small' && 20) || (size === 'large' && 35) || 27;\n const leftOffset = (size === 'small' && 25) || (size === 'large' && 70) || 47;\n /* eslint-enable @typescript-eslint/no-magic-numbers */\n\n const calculatePosition = useCallback(() => {\n if (containerRef.current && tooltipRef.current) {\n const triggerRect = containerRef.current.getBoundingClientRect();\n const tooltipRect = tooltipRef.current.getBoundingClientRect();\n const scrollY = window.scrollY;\n const scrollX = window.scrollX;\n let top = triggerRect.top + scrollY + topOffset - tooltipRect.height;\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n const left = triggerRect.left + scrollX + leftOffset + (triggerRect.width - tooltipRect.width) / 2;\n\n // Adjust top position to account for page scrolling\n top -= scrollY;\n\n // Position tooltip below if it would be above the viewport\n if (top < 0) {\n top = triggerRect.bottom + scrollY;\n }\n\n setPosition({ top, left });\n }\n }, [leftOffset, topOffset]);\n\n const onKeyUp = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setIsOpen(false);\n }\n },\n [setIsOpen]\n );\n\n function show() {\n setIsOpen(true);\n }\n\n function hide() {\n setIsOpen(false);\n }\n\n function toggle() {\n if (isOpen) setIsOpen(false);\n else setIsOpen(true);\n }\n\n useEffect(() => {\n if (!containerRef.current) return;\n\n const tooltipContainerRef = containerRef.current;\n\n tooltipContainerRef.addEventListener('keyup', onKeyUp, true);\n\n return () => {\n tooltipContainerRef.removeEventListener('keyup', onKeyUp, true);\n };\n }, [onKeyUp]);\n\n useEffect(() => {\n calculatePosition();\n window.addEventListener('resize', calculatePosition);\n return () => {\n window.removeEventListener('resize', calculatePosition);\n };\n }, [calculatePosition]);\n\n useEffect(() => {\n // Recalculate position when isOpen changes\n if (isOpen && !openUnderTrigger) {\n calculatePosition();\n }\n }, [isOpen, openUnderTrigger, calculatePosition]);\n\n return (\n <div\n className={styles['tooltip-container']}\n onBlur={hide}\n onFocus={show}\n onMouseEnter={show}\n onMouseLeave={hide}\n onMouseUp={toggle}\n ref={containerRef}\n role=\"button\"\n tabIndex={-1}\n >\n <div aria-describedby={isOpen ? id : undefined}>{element}</div>\n {isOpen && (\n <span\n ref={tooltipRef}\n className={openUnderTrigger ? styles['tooltip_under-trigger'] : styles[`tooltip_${size}`]}\n id={id}\n role=\"tooltip\"\n style={openUnderTrigger ? {} : { top: position.top, left: position.left }}\n >\n {text}\n </span>\n )}\n </div>\n );\n}\n"],"names":["Tooltip","element","id","text","size","openUnderTrigger","containerRef","useRef","tooltipRef","isOpen","setIsOpen","useState","position","setPosition","topOffset","leftOffset","calculatePosition","useCallback","triggerRect","tooltipRect","scrollY","scrollX","top","left","onKeyUp","event","show","hide","toggle","useEffect","tooltipContainerRef","jsxs","styles","jsx"],"mappings":";;;;;;;;;AAoBO,SAASA,EAAQ,EAAE,SAAAC,GAAS,IAAAC,GAAI,MAAAC,GAAM,MAAAC,IAAO,UAAU,kBAAAC,IAAmB,MAAuB;AACtG,QAAMC,IAAeC,EAAuB,IAAI,GAC1CC,IAAaD,EAAwB,IAAI,GACzC,CAACE,GAAQC,CAA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,EAAU,OACRb,EAAA,GACA,OAAO,iBAAiB,UAAUA,CAAiB,GAC5C,MAAM;AACX,WAAO,oBAAoB,UAAUA,CAAiB;AAAA,EAAA,IAEvD,CAACA,CAAiB,CAAC,GAEtBa,EAAU,MAAM;AAEd,IAAIpB,KAAU,CAACJ,KACbW,EAAA;AAAA,EACF,GACC,CAACP,GAAQJ,GAAkBW,CAAiB,CAAC,GAG9C,gBAAAe;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAO,mBAAmB;AAAA,MACrC,QAAQL;AAAA,MACR,SAASD;AAAA,MACT,cAAcA;AAAA,MACd,cAAcC;AAAA,MACd,WAAWC;AAAA,MACX,KAAKtB;AAAA,MACL,MAAK;AAAA,MACL,UAAU;AAAA,MAEV,UAAA;AAAA,QAAA,gBAAA2B,EAAC,OAAA,EAAI,oBAAkBxB,IAASP,IAAK,QAAY,UAAAD,GAAQ;AAAA,QACxDQ,KACC,gBAAAwB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAKzB;AAAA,YACL,WAAWH,IAAmB2B,EAAO,uBAAuB,IAAIA,EAAO,WAAW5B,CAAI,EAAE;AAAA,YACxF,IAAAF;AAAA,YACA,MAAK;AAAA,YACL,OAAOG,IAAmB,CAAA,IAAK,EAAE,KAAKO,EAAS,KAAK,MAAMA,EAAS,KAAA;AAAA,YAElE,UAAAT;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
|
@@ -2,4 +2,4 @@ import { Meta } from '@storybook/react';
|
|
|
2
2
|
import { TooltipProps } from './Tooltip';
|
|
3
3
|
declare const _default: Meta<TooltipProps>;
|
|
4
4
|
export default _default;
|
|
5
|
-
export declare const TooltipExample: import('
|
|
5
|
+
export declare const TooltipExample: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, TooltipProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.stories.js","sources":["../../../src/components/Tooltip/Tooltip.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { TooltipProps } from './Tooltip';\n\nimport { Tooltip } from './Tooltip';\n\nimport { Container } from 'storyComponents/Container';\n\nconst codeString = '<Tooltip element={element} id={id} text={text} size={size} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Tooltip',\n component: Tooltip,\n argTypes: {\n element: {\n control: 'text',\n },\n // Disable openUnderTrigger controls as this is a Lens specific prop that we should not use in other places.\n // This is still needed until Lens structure is reworked.\n openUnderTrigger: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: Tooltip,\n codeString: codeString,\n },\n} as Meta<TooltipProps>;\n\nconst Template: StoryFn<TooltipProps> = (args) => (\n <Container centerContent>\n <Tooltip {...args} />\n </Container>\n);\n\nexport const TooltipExample = Template.bind({});\nTooltipExample.args = {\n element: 'Tooltip Trigger',\n id: '52fcc9e9',\n text: 'Here is your Tooltip',\n};\n"],"names":["codeString","Tooltip_stories","Tooltip","Template","args","jsx","Container","TooltipExample"],"mappings":";;;AAOA,MAAMA,IAAa,
|
|
1
|
+
{"version":3,"file":"Tooltip.stories.js","sources":["../../../src/components/Tooltip/Tooltip.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { TooltipProps } from './Tooltip';\n\nimport { Tooltip } from './Tooltip';\n\nimport { Container } from 'storyComponents/Container';\n\nconst codeString = '<Tooltip element={element} id={id} text={text} size={size} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Tooltip',\n component: Tooltip,\n argTypes: {\n element: {\n control: 'text',\n },\n // Disable openUnderTrigger controls as this is a Lens specific prop that we should not use in other places.\n // This is still needed until Lens structure is reworked.\n openUnderTrigger: {\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: Tooltip,\n codeString: codeString,\n },\n} as Meta<TooltipProps>;\n\nconst Template: StoryFn<TooltipProps> = (args) => (\n <Container centerContent>\n <Tooltip {...args} />\n </Container>\n);\n\nexport const TooltipExample = Template.bind({});\nTooltipExample.args = {\n element: 'Tooltip Trigger',\n id: '52fcc9e9',\n text: 'Here is your Tooltip',\n};\n"],"names":["codeString","Tooltip_stories","Tooltip","Template","args","jsx","Container","TooltipExample"],"mappings":";;;AAOA,MAAMA,IAAa,iEAGnBC,IAAe;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,IAAA;AAAA;AAAA;AAAA,IAIX,kBAAkB;AAAA,MAChB,OAAO;AAAA,QACL,SAAS;AAAA,MAAA;AAAA,IACX;AAAA,EACF;AAAA,EAEF,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EAAA;AAEJ,GAEMG,IAAkC,CAACC,MACvC,gBAAAC,EAACC,GAAA,EAAU,eAAa,IACtB,UAAA,gBAAAD,EAACH,GAAA,EAAS,GAAGE,EAAA,CAAM,EAAA,CACrB,GAGWG,IAAiBJ,EAAS,KAAK,CAAA,CAAE;AAC9CI,EAAe,OAAO;AAAA,EACpB,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,MAAM;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VarIndicator.js","sources":["../../../src/components/VarIndicator/VarIndicator.tsx"],"sourcesContent":["import clsx from 'clsx';\n\nimport type { IconProps } from 'components/Icon';\n\nimport styles from './VarIndicator.module.css';\n\nimport { Icon } from 'components/Icon';\n\nexport type StatusType = 'DRAFT' | 'REJECTED' | 'SUBMITTED' | 'ACTIVE';\n\nexport interface VarIndicatorProps {\n label: Record<StatusType, string>;\n variant?: StatusType;\n maxSteps?: number;\n currentStep?: number;\n onClick?: () => void;\n}\n\nconst ICON_NAMES = {\n DRAFT: 'CircleLarge',\n REJECTED: 'CircleLarge',\n SUBMITTED: 'CircleLargeDotted',\n ACTIVE: 'SignalActive',\n};\n\nexport const VarIndicator = ({ label, variant = 'DRAFT', maxSteps, currentStep = 1, onClick }: VarIndicatorProps) => (\n <button\n className={clsx(styles['var-indicator__container'], styles[`var-indicator__container--${variant.toLowerCase()}`])}\n onClick={onClick}\n >\n <Icon name={ICON_NAMES[variant] as IconProps['name']} size={16} />\n <span className={styles['var-indicator__label']}>{label[`${variant}`]}</span>\n {maxSteps && maxSteps > 0 && variant === 'SUBMITTED'\n ? Array.from({ length: maxSteps }, (_, idx) => idx + 1).map((step) => (\n <div key={step} className={styles['var-indicator__step-container']}>\n <Icon name={step <= currentStep ? 'CircleSmallFilled' : 'CircleSmall'} />\n </div>\n ))\n : null}\n </button>\n);\n"],"names":["ICON_NAMES","VarIndicator","label","variant","maxSteps","currentStep","onClick","jsxs","clsx","styles","jsx","Icon","idx","step"],"mappings":";;;;;;;;;;;GAkBMA,IAAa;AAAA,EACjB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV,GAEaC,IAAe,CAAC,EAAE,OAAAC,GAAO,SAAAC,IAAU,SAAS,UAAAC,GAAU,aAAAC,IAAc,GAAG,SAAAC,EAAA,MAClF,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAKC,EAAO,0BAA0B,GAAGA,EAAO,6BAA6BN,EAAQ,
|
|
1
|
+
{"version":3,"file":"VarIndicator.js","sources":["../../../src/components/VarIndicator/VarIndicator.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { IconProps } from 'components/Icon';\n\nimport styles from './VarIndicator.module.css';\n\nimport { Icon } from 'components/Icon';\n\nexport type StatusType = 'DRAFT' | 'REJECTED' | 'SUBMITTED' | 'ACTIVE';\n\nexport interface VarIndicatorProps {\n label: Record<StatusType, string>;\n variant?: StatusType;\n maxSteps?: number;\n currentStep?: number;\n onClick?: () => void;\n}\n\nconst ICON_NAMES = {\n DRAFT: 'CircleLarge',\n REJECTED: 'CircleLarge',\n SUBMITTED: 'CircleLargeDotted',\n ACTIVE: 'SignalActive',\n};\n\nexport const VarIndicator = ({ label, variant = 'DRAFT', maxSteps, currentStep = 1, onClick }: VarIndicatorProps) => (\n <button\n className={clsx(styles['var-indicator__container'], styles[`var-indicator__container--${variant.toLowerCase()}`])}\n onClick={onClick}\n >\n <Icon name={ICON_NAMES[variant] as IconProps['name']} size={16} />\n <span className={styles['var-indicator__label']}>{label[`${variant}`]}</span>\n {maxSteps && maxSteps > 0 && variant === 'SUBMITTED'\n ? Array.from({ length: maxSteps }, (_, idx) => idx + 1).map((step) => (\n <div key={step} className={styles['var-indicator__step-container']}>\n <Icon name={step <= currentStep ? 'CircleSmallFilled' : 'CircleSmall'} />\n </div>\n ))\n : null}\n </button>\n);\n"],"names":["ICON_NAMES","VarIndicator","label","variant","maxSteps","currentStep","onClick","jsxs","clsx","styles","jsx","Icon","idx","step"],"mappings":";;;;;;;;;;;GAkBMA,IAAa;AAAA,EACjB,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV,GAEaC,IAAe,CAAC,EAAE,OAAAC,GAAO,SAAAC,IAAU,SAAS,UAAAC,GAAU,aAAAC,IAAc,GAAG,SAAAC,EAAA,MAClF,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAKC,EAAO,0BAA0B,GAAGA,EAAO,6BAA6BN,EAAQ,YAAA,CAAa,EAAE,CAAC;AAAA,IAChH,SAAAG;AAAA,IAEA,UAAA;AAAA,MAAA,gBAAAI,EAACC,KAAK,MAAMX,EAAWG,CAAO,GAAwB,MAAM,IAAI;AAAA,MAChE,gBAAAO,EAAC,QAAA,EAAK,WAAWD,EAAO,sBAAsB,GAAI,UAAAP,EAAM,GAAGC,CAAO,EAAE,EAAA,CAAE;AAAA,MACrEC,KAAYA,IAAW,KAAKD,MAAY,cACrC,MAAM,KAAK,EAAE,QAAQC,EAAA,GAAY,CAAC,GAAGQ,MAAQA,IAAM,CAAC,EAAE,IAAI,CAACC,wBACxD,OAAA,EAAe,WAAWJ,EAAO,+BAA+B,GAC/D,UAAA,gBAAAC,EAACC,GAAA,EAAK,MAAME,KAAQR,IAAc,sBAAsB,cAAA,CAAe,EAAA,GAD/DQ,CAEV,CACD,IACD;AAAA,IAAA;AAAA,EAAA;AACN;"}
|
|
@@ -2,4 +2,4 @@ import { Meta } from '@storybook/react';
|
|
|
2
2
|
import { VarIndicatorProps } from './VarIndicator';
|
|
3
3
|
declare const _default: Meta<VarIndicatorProps>;
|
|
4
4
|
export default _default;
|
|
5
|
-
export declare const VarIndicatorExample: import('
|
|
5
|
+
export declare const VarIndicatorExample: import('storybook/internal/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, VarIndicatorProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { W as o } from "../../index-Di9WPZUe.js";
|
|
3
3
|
import { VarIndicator as t } from "./VarIndicator.js";
|
|
4
|
-
const
|
|
4
|
+
const n = {
|
|
5
5
|
DRAFT: "Concept",
|
|
6
6
|
REJECTED: "Concept",
|
|
7
7
|
SUBMITTED: "Verificatie",
|
|
@@ -15,10 +15,10 @@ const o = {
|
|
|
15
15
|
codeString: a
|
|
16
16
|
}
|
|
17
17
|
}, c = (r) => /* @__PURE__ */ e(t, { ...r }), i = {
|
|
18
|
-
label:
|
|
18
|
+
label: n,
|
|
19
19
|
maxSteps: 3,
|
|
20
20
|
currentStep: 2,
|
|
21
|
-
onClick:
|
|
21
|
+
onClick: o()
|
|
22
22
|
}, s = c.bind({});
|
|
23
23
|
s.args = {
|
|
24
24
|
...i
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VarIndicator.stories.js","sources":["../../../src/components/VarIndicator/VarIndicator.stories.tsx"],"sourcesContent":["import { fn } from '
|
|
1
|
+
{"version":3,"file":"VarIndicator.stories.js","sources":["../../../src/components/VarIndicator/VarIndicator.stories.tsx"],"sourcesContent":["import { fn } from 'storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { VarIndicatorProps } from './VarIndicator';\n\nimport { VarIndicator } from './VarIndicator';\n\nconst LABELS = {\n DRAFT: 'Concept',\n REJECTED: 'Concept',\n SUBMITTED: 'Verificatie',\n ACTIVE: 'Actief',\n};\n\nconst codeString =\n '<VarIndicator label={[string]: [string]} maxSteps={number} currentStep={number} onClick={() => void} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/VarIndicator',\n component: VarIndicator,\n argTypes: {},\n parameters: {\n inspectComponent: VarIndicator,\n codeString: codeString,\n },\n} as Meta<VarIndicatorProps>;\n\nconst Template: StoryFn<VarIndicatorProps> = (args) => <VarIndicator {...args} />;\n\nconst defaultArgs: Partial<VarIndicatorProps> = {\n label: LABELS,\n maxSteps: 3,\n currentStep: 2,\n onClick: fn(),\n};\n\nexport const VarIndicatorExample = Template.bind({});\nVarIndicatorExample.args = {\n ...defaultArgs,\n};\n"],"names":["LABELS","codeString","VarIndicator_stories","VarIndicator","Template","args","jsx","defaultArgs","fn","VarIndicatorExample"],"mappings":";;;AAOA,MAAMA,IAAS;AAAA,EACb,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV,GAEMC,IACJ,2GAGFC,IAAe;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU,CAAA;AAAA,EACV,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EAAA;AAEJ,GAEMG,IAAuC,CAACC,MAAS,gBAAAC,EAACH,GAAA,EAAc,GAAGE,GAAM,GAEzEE,IAA0C;AAAA,EAC9C,OAAOP;AAAA,EACP,UAAU;AAAA,EACV,aAAa;AAAA,EACb,SAASQ,EAAA;AACX,GAEaC,IAAsBL,EAAS,KAAK,CAAA,CAAE;AACnDK,EAAoB,OAAO;AAAA,EACzB,GAAGF;AACL;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { r as l, s as e, w as a } from "../../react.esm-
|
|
4
|
-
import { u as i } from "../../index-
|
|
2
|
+
import "../../index-DV47hRzi.js";
|
|
3
|
+
import { r as l, s as e, w as a } from "../../react.esm-CFMwGdo5.js";
|
|
4
|
+
import { u as i } from "../../index-PaHiqSUg.js";
|
|
5
5
|
import { useState as s } from "react";
|
|
6
6
|
import { VarIndicator as n } from "./VarIndicator.js";
|
|
7
7
|
const o = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VarIndicator.test.js","sources":["../../../src/components/VarIndicator/VarIndicator.test.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-magic-numbers */\nimport '@testing-library/jest-dom';\nimport { render, screen, waitFor } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport { useState } from 'react';\n\nimport { VarIndicator } from './VarIndicator';\n\nconst LABELS = {\n DRAFT: 'Concept',\n REJECTED: 'Concept',\n SUBMITTED: 'Verificatie',\n ACTIVE: 'Actief',\n};\n\njest.mock('components/Icon', () => ({\n Icon: ({ name }: { name: string }) => <svg data-testid={name} />,\n}));\n\nconst TestWrapper = () => {\n const [currentStep, setCurrentStep] = useState(1);\n return (\n // When clicked the onClick callback updates currentStep from 1 to 2.\n <VarIndicator\n label={LABELS}\n variant=\"SUBMITTED\"\n maxSteps={3}\n currentStep={currentStep}\n onClick={() => setCurrentStep(2)}\n />\n );\n};\n\ndescribe('VarIndicator', () => {\n const onClickSpy = jest.fn();\n\n beforeEach(() => {\n onClickSpy.mockClear();\n });\n\n it('should render Concept (DRAFT)', () => {\n render(<VarIndicator label={LABELS} variant=\"DRAFT\" />);\n expect(screen.getByText('Concept')).toBeInTheDocument();\n });\n\n it('should render Concept (REJECTED)', () => {\n render(<VarIndicator label={LABELS} variant=\"REJECTED\" />);\n expect(screen.getByText('Concept')).toBeInTheDocument();\n });\n\n it('should render Concept (ACTIVE)', () => {\n render(<VarIndicator label={LABELS} variant=\"ACTIVE\" />);\n expect(screen.getByText('Actief')).toBeInTheDocument();\n });\n\n it('should render dots (SUBMITTED)', () => {\n render(<VarIndicator label={LABELS} variant=\"SUBMITTED\" maxSteps={3} currentStep={0} />);\n expect(screen.getByText('Verificatie')).toBeInTheDocument();\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(3);\n expect(screen.queryByTestId('CircleSmallFilled')).not.toBeInTheDocument();\n });\n\n it('should render filled dots when currentStep != 0 (SUBMITTED)', () => {\n render(<VarIndicator label={LABELS} variant=\"SUBMITTED\" maxSteps={3} currentStep={1} onClick={onClickSpy} />);\n const verificationButton = screen.getByText('Verificatie');\n expect(verificationButton).toBeInTheDocument();\n expect(screen.getAllByTestId('CircleSmallFilled')).toHaveLength(1);\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(2);\n });\n\n it('should render filled dots currentStep is updated (SUBMITTED)', async () => {\n render(<TestWrapper />);\n expect(screen.getAllByTestId('CircleSmallFilled')).toHaveLength(1);\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(2);\n const verificationButton = screen.getByText('Verificatie');\n await userEvent.click(verificationButton);\n await waitFor(() => {\n expect(screen.getAllByTestId('CircleSmallFilled')).toHaveLength(2);\n });\n await waitFor(() => {\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(1);\n });\n });\n});\n"],"names":["LABELS","name","jsx","TestWrapper","currentStep","setCurrentStep","useState","VarIndicator","onClickSpy","render","screen","verificationButton","userEvent","waitFor"],"mappings":";;;;;;AAQA,MAAMA,IAAS;AAAA,EACb,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV;AAEA,KAAK,KAAK,mBAAmB,OAAO;AAAA,EAClC,MAAM,CAAC,EAAE,MAAAC,
|
|
1
|
+
{"version":3,"file":"VarIndicator.test.js","sources":["../../../src/components/VarIndicator/VarIndicator.test.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-magic-numbers */\nimport '@testing-library/jest-dom';\nimport { render, screen, waitFor } from '@testing-library/react';\nimport userEvent from '@testing-library/user-event';\nimport { useState } from 'react';\n\nimport { VarIndicator } from './VarIndicator';\n\nconst LABELS = {\n DRAFT: 'Concept',\n REJECTED: 'Concept',\n SUBMITTED: 'Verificatie',\n ACTIVE: 'Actief',\n};\n\njest.mock('components/Icon', () => ({\n Icon: ({ name }: { name: string }) => <svg data-testid={name} />,\n}));\n\nconst TestWrapper = () => {\n const [currentStep, setCurrentStep] = useState(1);\n return (\n // When clicked the onClick callback updates currentStep from 1 to 2.\n <VarIndicator\n label={LABELS}\n variant=\"SUBMITTED\"\n maxSteps={3}\n currentStep={currentStep}\n onClick={() => setCurrentStep(2)}\n />\n );\n};\n\ndescribe('VarIndicator', () => {\n const onClickSpy = jest.fn();\n\n beforeEach(() => {\n onClickSpy.mockClear();\n });\n\n it('should render Concept (DRAFT)', () => {\n render(<VarIndicator label={LABELS} variant=\"DRAFT\" />);\n expect(screen.getByText('Concept')).toBeInTheDocument();\n });\n\n it('should render Concept (REJECTED)', () => {\n render(<VarIndicator label={LABELS} variant=\"REJECTED\" />);\n expect(screen.getByText('Concept')).toBeInTheDocument();\n });\n\n it('should render Concept (ACTIVE)', () => {\n render(<VarIndicator label={LABELS} variant=\"ACTIVE\" />);\n expect(screen.getByText('Actief')).toBeInTheDocument();\n });\n\n it('should render dots (SUBMITTED)', () => {\n render(<VarIndicator label={LABELS} variant=\"SUBMITTED\" maxSteps={3} currentStep={0} />);\n expect(screen.getByText('Verificatie')).toBeInTheDocument();\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(3);\n expect(screen.queryByTestId('CircleSmallFilled')).not.toBeInTheDocument();\n });\n\n it('should render filled dots when currentStep != 0 (SUBMITTED)', () => {\n render(<VarIndicator label={LABELS} variant=\"SUBMITTED\" maxSteps={3} currentStep={1} onClick={onClickSpy} />);\n const verificationButton = screen.getByText('Verificatie');\n expect(verificationButton).toBeInTheDocument();\n expect(screen.getAllByTestId('CircleSmallFilled')).toHaveLength(1);\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(2);\n });\n\n it('should render filled dots currentStep is updated (SUBMITTED)', async () => {\n render(<TestWrapper />);\n expect(screen.getAllByTestId('CircleSmallFilled')).toHaveLength(1);\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(2);\n const verificationButton = screen.getByText('Verificatie');\n await userEvent.click(verificationButton);\n await waitFor(() => {\n expect(screen.getAllByTestId('CircleSmallFilled')).toHaveLength(2);\n });\n await waitFor(() => {\n expect(screen.getAllByTestId('CircleSmall')).toHaveLength(1);\n });\n });\n});\n"],"names":["LABELS","name","jsx","TestWrapper","currentStep","setCurrentStep","useState","VarIndicator","onClickSpy","render","screen","verificationButton","userEvent","waitFor"],"mappings":";;;;;;AAQA,MAAMA,IAAS;AAAA,EACb,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW;AAAA,EACX,QAAQ;AACV;AAEA,KAAK,KAAK,mBAAmB,OAAO;AAAA,EAClC,MAAM,CAAC,EAAE,MAAAC,EAAA,MAA6B,gBAAAC,EAAC,OAAA,EAAI,eAAaD,EAAA,CAAM;AAChE,EAAE;AAEF,MAAME,IAAc,MAAM;AACxB,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,CAAC;AAChD;AAAA;AAAA,IAEE,gBAAAJ;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,OAAOP;AAAA,QACP,SAAQ;AAAA,QACR,UAAU;AAAA,QACV,aAAAI;AAAA,QACA,SAAS,MAAMC,EAAe,CAAC;AAAA,MAAA;AAAA,IAAA;AAAA;AAGrC;AAEA,SAAS,gBAAgB,MAAM;AAC7B,QAAMG,IAAa,KAAK,GAAA;AAExB,aAAW,MAAM;AACf,IAAAA,EAAW,UAAA;AAAA,EAAU,CACtB,GAED,GAAG,iCAAiC,MAAM;AACxC,IAAAC,oBAAQF,GAAA,EAAa,OAAOP,GAAQ,SAAQ,SAAQ,CAAE,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a,CAAC,EAAE,aAAa,CAAC;AAC3D,UAAMC,IAAqBD,EAAO,UAAU,aAAa;AACzD,UAAME,EAAU,MAAMD,CAAkB,GACxC,MAAME,EAAQ,MAAM;AAClB,aAAOH,EAAO,eAAe,mBAAmB,CAAC,EAAE,aAAa,CAAC;AAAA,IAAA,CAClE,GACD,MAAMG,EAAQ,MAAM;AAClB,aAAOH,EAAO,eAAe,aAAa,CAAC,EAAE,aAAa,CAAC;AAAA,IAAA,CAC5D;AAAA,EAAA,CACF;AACH,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDebounce.js","sources":["../../../src/components/hooks/useDebounce.ts"],"sourcesContent":["import { useRef, useEffect } from 'react';\n\ntype Timer = ReturnType<typeof setTimeout>;\ntype SomeFunction = (...args: unknown[]) => void;\n\nconst DELAY = 200;\n\nexport function useDebounce<Func extends SomeFunction>(callBack: Func, delay = DELAY) {\n const timer = useRef<Timer>(undefined);\n\n useEffect(() => {\n return () => {\n if (!timer.current) return;\n clearTimeout(timer.current);\n };\n }, []);\n\n const debouncedFunction = ((...args) => {\n const newTimer = setTimeout(() => {\n callBack(...args);\n }, delay);\n clearTimeout(timer.current);\n timer.current = newTimer;\n }) as Func;\n\n return debouncedFunction;\n}\n"],"names":["DELAY","useDebounce","callBack","delay","timer","useRef","useEffect","args","newTimer"],"mappings":";AAKA,MAAMA,IAAQ;
|
|
1
|
+
{"version":3,"file":"useDebounce.js","sources":["../../../src/components/hooks/useDebounce.ts"],"sourcesContent":["import { useRef, useEffect } from 'react';\n\ntype Timer = ReturnType<typeof setTimeout>;\ntype SomeFunction = (...args: unknown[]) => void;\n\nconst DELAY = 200;\n\nexport function useDebounce<Func extends SomeFunction>(callBack: Func, delay = DELAY) {\n const timer = useRef<Timer>(undefined);\n\n useEffect(() => {\n return () => {\n if (!timer.current) return;\n clearTimeout(timer.current);\n };\n }, []);\n\n const debouncedFunction = ((...args) => {\n const newTimer = setTimeout(() => {\n callBack(...args);\n }, delay);\n clearTimeout(timer.current);\n timer.current = newTimer;\n }) as Func;\n\n return debouncedFunction;\n}\n"],"names":["DELAY","useDebounce","callBack","delay","timer","useRef","useEffect","args","newTimer"],"mappings":";AAKA,MAAMA,IAAQ;AAEP,SAASC,EAAuCC,GAAgBC,IAAQH,GAAO;AACpF,QAAMI,IAAQC,EAAc,MAAS;AAErC,SAAAC,EAAU,MACD,MAAM;AACX,IAAKF,EAAM,WACX,aAAaA,EAAM,OAAO;AAAA,EAAA,GAE3B,EAAE,GAEsB,IAAIG,MAAS;AACtC,UAAMC,IAAW,WAAW,MAAM;AAChC,MAAAN,EAAS,GAAGK,CAAI;AAAA,IAAA,GACfJ,CAAK;AACR,iBAAaC,EAAM,OAAO,GAC1BA,EAAM,UAAUI;AAAA,EAAA;AAIpB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOnClickOutside.js","sources":["../../../src/components/hooks/useOnClickOutside.ts"],"sourcesContent":["import { type RefObject, useEffect } from 'react';\n\ntype Handler = (event: MouseEvent | TouchEvent | KeyboardEvent) => void;\n\nexport const useOnClickOutside = <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: Handler): void => {\n useEffect(() => {\n const listener = (\n event:\n | (MouseEvent & { target: HTMLElement | null })\n | (TouchEvent & { target: HTMLElement | null })\n | (KeyboardEvent & { target: HTMLElement | null })\n ): void => {\n if (!ref.current || ref.current.contains(event.target as Node)) {\n return;\n }\n handler(event as MouseEvent | TouchEvent | KeyboardEvent);\n };\n document.addEventListener('mousedown', listener as EventListener);\n document.addEventListener('touchstart', listener as EventListener);\n return () => {\n document.removeEventListener('mousedown', listener as EventListener);\n document.removeEventListener('touchstart', listener as EventListener);\n };\n }, [ref, handler]);\n};\n"],"names":["useOnClickOutside","ref","handler","useEffect","listener","event"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useOnClickOutside.js","sources":["../../../src/components/hooks/useOnClickOutside.ts"],"sourcesContent":["import { type RefObject, useEffect } from 'react';\n\ntype Handler = (event: MouseEvent | TouchEvent | KeyboardEvent) => void;\n\nexport const useOnClickOutside = <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: Handler): void => {\n useEffect(() => {\n const listener = (\n event:\n | (MouseEvent & { target: HTMLElement | null })\n | (TouchEvent & { target: HTMLElement | null })\n | (KeyboardEvent & { target: HTMLElement | null })\n ): void => {\n if (!ref.current || ref.current.contains(event.target as Node)) {\n return;\n }\n handler(event as MouseEvent | TouchEvent | KeyboardEvent);\n };\n document.addEventListener('mousedown', listener as EventListener);\n document.addEventListener('touchstart', listener as EventListener);\n return () => {\n document.removeEventListener('mousedown', listener as EventListener);\n document.removeEventListener('touchstart', listener as EventListener);\n };\n }, [ref, handler]);\n};\n"],"names":["useOnClickOutside","ref","handler","useEffect","listener","event"],"mappings":";AAIO,MAAMA,IAAoB,CAAsCC,GAAmBC,MAA2B;AACnH,EAAAC,EAAU,MAAM;AACd,UAAMC,IAAW,CACfC,MAIS;AACT,MAAI,CAACJ,EAAI,WAAWA,EAAI,QAAQ,SAASI,EAAM,MAAc,KAG7DH,EAAQG,CAAgD;AAAA,IAAA;AAE1D,oBAAS,iBAAiB,aAAaD,CAAyB,GAChE,SAAS,iBAAiB,cAAcA,CAAyB,GAC1D,MAAM;AACX,eAAS,oBAAoB,aAAaA,CAAyB,GACnE,SAAS,oBAAoB,cAAcA,CAAyB;AAAA,IAAA;AAAA,EACtE,GACC,CAACH,GAAKC,CAAO,CAAC;AACnB;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePositionedFloaters.js","sources":["../../../src/components/hooks/usePositionedFloaters.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { useDebounce } from './useDebounce';\n\ninterface positionProps {\n style: {\n style: {\n inset: string;\n };\n };\n status: boolean;\n}\n\ninterface optionProps {\n mouseEvent: 'click' | 'hover';\n position: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';\n offset: number;\n maxFixedHeight?: `${number}${'px' | 'rem'}`;\n horizontalPosition?: 'left' | 'right';\n mobileBreakpoint?: `${number}${'px' | 'rem'}`;\n fullWidth: boolean;\n}\n\nconst BODY_PADDING = 10;\nconst MIN_HEIGHT = 45;\nconst MIN_WIDTH = 300;\nconst DEBOUNCE_DELAY = 0;\nconst MOBILE_BREAKPOINT = 768;\nconst HALF = 2;\n\nexport function usePositionedFloaters<T extends HTMLElement = HTMLElement>(\n positionedElement: T | null,\n referenceElement: T | null,\n options: optionProps\n): positionProps {\n const [status, setStatus] = useState(false);\n const defaultStyle = {\n inset: '0 auto auto 0',\n opacity: 0,\n maxHeight: '100%',\n maxWidth: '100%',\n minWidth: MIN_WIDTH,\n overflowX: 'hidden',\n overflowY: 'auto',\n margin: '0rem',\n };\n\n const [style, setStyle] = useState(defaultStyle);\n\n const sizeToPx = (size: `${number}${'px' | 'rem'}`): number => {\n const rootFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);\n return size.indexOf('rem') !== -1 ? parseFloat(size) * rootFontSize : parseFloat(size);\n };\n\n const setHeight = (refRect: DOMRect, pos: string): number => {\n if (!refRect) return 0;\n\n const _maxHeight =\n pos === 'bottom'\n ? window.innerHeight - refRect.bottom - options.offset - BODY_PADDING\n : refRect.top - options.offset - BODY_PADDING;\n\n return !options.maxFixedHeight || sizeToPx(options.maxFixedHeight) > _maxHeight\n ? _maxHeight\n : sizeToPx(options.maxFixedHeight);\n };\n\n const setWidth = (refRect: DOMRect, pos: string): number => {\n if (!refRect) return 0;\n\n const _availableWidth =\n pos === 'left' ? window.innerWidth - refRect.left - BODY_PADDING : refRect.right - BODY_PADDING;\n\n return _availableWidth <= MIN_WIDTH ? MIN_WIDTH : _availableWidth;\n };\n\n const setLeft = (refRect: DOMRect, posRect: DOMRect, isMobile: boolean) => {\n if (isMobile) {\n return `${refRect.left - Math.abs(posRect.width - refRect.width) / HALF}px`;\n } else {\n return `${refRect.left}px`;\n }\n };\n\n const calcPosition = (): typeof defaultStyle => {\n const positionedRect = (positionedElement as HTMLElement | null)?.getBoundingClientRect();\n const referenceRect = (referenceElement as HTMLElement | null)?.getBoundingClientRect();\n let yPos = 'bottom';\n let xPos = 'left';\n\n const isMobile = window.matchMedia(\n `(max-width: ${options.mobileBreakpoint ? sizeToPx(options.mobileBreakpoint) : MOBILE_BREAKPOINT}px)`\n ).matches;\n\n if (!referenceRect || !positionedRect) {\n return defaultStyle;\n }\n\n if (window.innerHeight - referenceRect.bottom - BODY_PADDING < MIN_HEIGHT) {\n yPos = 'top';\n }\n\n if (\n (window.innerWidth - referenceRect.left - BODY_PADDING < MIN_WIDTH || options.horizontalPosition === 'right') &&\n !isMobile\n ) {\n xPos = 'right';\n }\n\n return {\n inset: `${yPos === 'bottom' ? referenceRect[yPos] + 'px' : 'auto'}\n ${xPos === 'right' ? window.innerWidth - referenceRect[xPos] + 'px' : 'auto'}\n ${yPos === 'top' ? window.innerHeight - referenceRect[yPos] + 'px' : 'auto'}\n ${xPos === 'left' ? setLeft(referenceRect, positionedRect, isMobile) : 'auto'}`,\n maxHeight: `${setHeight(referenceRect, yPos)}px`,\n maxWidth: `${setWidth(referenceRect, xPos)}px`,\n minWidth: options.fullWidth ? referenceRect.width : MIN_WIDTH,\n overflowX: 'hidden',\n overflowY: 'auto',\n opacity: 1,\n margin: `${options.offset}px 0`,\n };\n };\n\n const handleMouseEvent = (): void => {\n setStyle({\n ...style,\n ...calcPosition(),\n });\n setStatus(true);\n };\n\n const updatePosition = (): void => {\n if (status) {\n setStyle({\n ...style,\n ...calcPosition(),\n });\n }\n };\n\n const handleClickOutside = (evt: Event): void => {\n if (\n !referenceElement ||\n (referenceElement as unknown as HTMLElement).contains(evt.target as Node) ||\n !positionedElement ||\n (positionedElement as unknown as HTMLElement).contains(evt.target as Node)\n ) {\n return;\n }\n };\n\n const debouncedUpdatePosition = useDebounce(updatePosition, DEBOUNCE_DELAY);\n\n useEffect(() => {\n if (referenceElement !== null) {\n if (options.mouseEvent === 'click') {\n // eslint-disable-next-line no-extra-semi\n (referenceElement as unknown as HTMLElement).addEventListener('click', handleMouseEvent);\n } else {\n // eslint-disable-next-line no-extra-semi\n (referenceElement as unknown as HTMLElement).addEventListener('mouseenter', handleMouseEvent);\n // eslint-disable-next-line no-extra-semi\n (referenceElement as unknown as HTMLElement).addEventListener('mouseleave', handleClickOutside);\n }\n document.addEventListener('mousedown', handleClickOutside);\n document.addEventListener('touchstart', handleClickOutside);\n window.addEventListener('resize', debouncedUpdatePosition);\n }\n\n return () => {\n if (referenceElement !== null) {\n if (options.mouseEvent === 'click') {\n // eslint-disable-next-line no-extra-semi\n (referenceElement as unknown as HTMLElement).removeEventListener('click', handleMouseEvent);\n } else {\n // eslint-disable-next-line no-extra-semi\n (referenceElement as unknown as HTMLElement).removeEventListener('mouseenter', handleMouseEvent);\n // eslint-disable-next-line no-extra-semi\n (referenceElement as unknown as HTMLElement).removeEventListener('mouseleave', handleClickOutside);\n }\n document.removeEventListener('mousedown', handleClickOutside);\n document.removeEventListener('touchstart', handleClickOutside);\n window.removeEventListener('resize', debouncedUpdatePosition);\n }\n };\n });\n\n return {\n style: {\n style,\n },\n status,\n };\n}\n"],"names":["BODY_PADDING","MIN_HEIGHT","MIN_WIDTH","DEBOUNCE_DELAY","MOBILE_BREAKPOINT","HALF","usePositionedFloaters","positionedElement","referenceElement","options","status","setStatus","useState","defaultStyle","style","setStyle","sizeToPx","size","rootFontSize","setHeight","refRect","pos","_maxHeight","setWidth","_availableWidth","setLeft","posRect","isMobile","calcPosition","positionedRect","referenceRect","yPos","xPos","handleMouseEvent","updatePosition","handleClickOutside","evt","debouncedUpdatePosition","useDebounce","useEffect"],"mappings":";;AAuBA,MAAMA,IAAe,IACfC,IAAa,IACbC,IAAY,KACZC,IAAiB,GACjBC,IAAoB,KACpBC,IAAO;
|
|
1
|
+
{"version":3,"file":"usePositionedFloaters.js","sources":["../../../src/components/hooks/usePositionedFloaters.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { useDebounce } from './useDebounce';\n\ninterface positionProps {\n style: {\n style: {\n inset: string;\n };\n };\n status: boolean;\n}\n\ninterface optionProps {\n mouseEvent: 'click' | 'hover';\n position: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';\n offset: number;\n maxFixedHeight?: `${number}${'px' | 'rem'}`;\n horizontalPosition?: 'left' | 'right';\n mobileBreakpoint?: `${number}${'px' | 'rem'}`;\n fullWidth: boolean;\n}\n\nconst BODY_PADDING = 10;\nconst MIN_HEIGHT = 45;\nconst MIN_WIDTH = 300;\nconst DEBOUNCE_DELAY = 0;\nconst MOBILE_BREAKPOINT = 768;\nconst HALF = 2;\n\nexport function usePositionedFloaters<T extends HTMLElement = HTMLElement>(\n positionedElement: T | null,\n referenceElement: T | null,\n options: optionProps\n): positionProps {\n const [status, setStatus] = useState(false);\n const defaultStyle = {\n inset: '0 auto auto 0',\n opacity: 0,\n maxHeight: '100%',\n maxWidth: '100%',\n minWidth: MIN_WIDTH,\n overflowX: 'hidden',\n overflowY: 'auto',\n margin: '0rem',\n };\n\n const [style, setStyle] = useState(defaultStyle);\n\n const sizeToPx = (size: `${number}${'px' | 'rem'}`): number => {\n const rootFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);\n return size.indexOf('rem') !== -1 ? parseFloat(size) * rootFontSize : parseFloat(size);\n };\n\n const setHeight = (refRect: DOMRect, pos: string): number => {\n if (!refRect) return 0;\n\n const _maxHeight =\n pos === 'bottom'\n ? window.innerHeight - refRect.bottom - options.offset - BODY_PADDING\n : refRect.top - options.offset - BODY_PADDING;\n\n return !options.maxFixedHeight || sizeToPx(options.maxFixedHeight) > _maxHeight\n ? _maxHeight\n : sizeToPx(options.maxFixedHeight);\n };\n\n const setWidth = (refRect: DOMRect, pos: string): number => {\n if (!refRect) return 0;\n\n const _availableWidth =\n pos === 'left' ? window.innerWidth - refRect.left - BODY_PADDING : refRect.right - BODY_PADDING;\n\n return _availableWidth <= MIN_WIDTH ? MIN_WIDTH : _availableWidth;\n };\n\n const setLeft = (refRect: DOMRect, posRect: DOMRect, isMobile: boolean) => {\n if (isMobile) {\n return `${refRect.left - Math.abs(posRect.width - refRect.width) / HALF}px`;\n } else {\n return `${refRect.left}px`;\n }\n };\n\n const calcPosition = (): typeof defaultStyle => {\n const positionedRect = (positionedElement as HTMLElement | null)?.getBoundingClientRect();\n const referenceRect = (referenceElement as HTMLElement | null)?.getBoundingClientRect();\n let yPos = 'bottom';\n let xPos = 'left';\n\n const isMobile = window.matchMedia(\n `(max-width: ${options.mobileBreakpoint ? sizeToPx(options.mobileBreakpoint) : MOBILE_BREAKPOINT}px)`\n ).matches;\n\n if (!referenceRect || !positionedRect) {\n return defaultStyle;\n }\n\n if (window.innerHeight - referenceRect.bottom - BODY_PADDING < MIN_HEIGHT) {\n yPos = 'top';\n }\n\n if (\n (window.innerWidth - referenceRect.left - BODY_PADDING < MIN_WIDTH || options.horizontalPosition === 'right') &&\n !isMobile\n ) {\n xPos = 'right';\n }\n\n return {\n inset: `${yPos === 'bottom' ? referenceRect[yPos] + 'px' : 'auto'}\n ${xPos === 'right' ? window.innerWidth - referenceRect[xPos] + 'px' : 'auto'}\n ${yPos === 'top' ? window.innerHeight - referenceRect[yPos] + 'px' : 'auto'}\n ${xPos === 'left' ? setLeft(referenceRect, positionedRect, isMobile) : 'auto'}`,\n maxHeight: `${setHeight(referenceRect, yPos)}px`,\n maxWidth: `${setWidth(referenceRect, xPos)}px`,\n minWidth: options.fullWidth ? referenceRect.width : MIN_WIDTH,\n overflowX: 'hidden',\n overflowY: 'auto',\n opacity: 1,\n margin: `${options.offset}px 0`,\n };\n };\n\n const handleMouseEvent = (): void => {\n setStyle({\n ...style,\n ...calcPosition(),\n });\n setStatus(true);\n };\n\n const updatePosition = (): void => {\n if (status) {\n setStyle({\n ...style,\n ...calcPosition(),\n });\n }\n };\n\n const handleClickOutside = (evt: Event): void => {\n if (\n !referenceElement ||\n (referenceElement as unknown as HTMLElement).contains(evt.target as Node) ||\n !positionedElement ||\n (positionedElement as unknown as HTMLElement).contains(evt.target as Node)\n ) {\n return;\n }\n };\n\n const debouncedUpdatePosition = useDebounce(updatePosition, DEBOUNCE_DELAY);\n\n useEffect(() => {\n if (referenceElement !== null) {\n if (options.mouseEvent === 'click') {\n // eslint-disable-next-line no-extra-semi\n (referenceElement as unknown as HTMLElement).addEventListener('click', handleMouseEvent);\n } else {\n // eslint-disable-next-line no-extra-semi\n (referenceElement as unknown as HTMLElement).addEventListener('mouseenter', handleMouseEvent);\n // eslint-disable-next-line no-extra-semi\n (referenceElement as unknown as HTMLElement).addEventListener('mouseleave', handleClickOutside);\n }\n document.addEventListener('mousedown', handleClickOutside);\n document.addEventListener('touchstart', handleClickOutside);\n window.addEventListener('resize', debouncedUpdatePosition);\n }\n\n return () => {\n if (referenceElement !== null) {\n if (options.mouseEvent === 'click') {\n // eslint-disable-next-line no-extra-semi\n (referenceElement as unknown as HTMLElement).removeEventListener('click', handleMouseEvent);\n } else {\n // eslint-disable-next-line no-extra-semi\n (referenceElement as unknown as HTMLElement).removeEventListener('mouseenter', handleMouseEvent);\n // eslint-disable-next-line no-extra-semi\n (referenceElement as unknown as HTMLElement).removeEventListener('mouseleave', handleClickOutside);\n }\n document.removeEventListener('mousedown', handleClickOutside);\n document.removeEventListener('touchstart', handleClickOutside);\n window.removeEventListener('resize', debouncedUpdatePosition);\n }\n };\n });\n\n return {\n style: {\n style,\n },\n status,\n };\n}\n"],"names":["BODY_PADDING","MIN_HEIGHT","MIN_WIDTH","DEBOUNCE_DELAY","MOBILE_BREAKPOINT","HALF","usePositionedFloaters","positionedElement","referenceElement","options","status","setStatus","useState","defaultStyle","style","setStyle","sizeToPx","size","rootFontSize","setHeight","refRect","pos","_maxHeight","setWidth","_availableWidth","setLeft","posRect","isMobile","calcPosition","positionedRect","referenceRect","yPos","xPos","handleMouseEvent","updatePosition","handleClickOutside","evt","debouncedUpdatePosition","useDebounce","useEffect"],"mappings":";;AAuBA,MAAMA,IAAe,IACfC,IAAa,IACbC,IAA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B,KACAA,EAA4C,SAAS4B,EAAI,MAAc,KACxE,CAAC7B,KACAA,EAA6C,SAAS6B,EAAI,MAAc;AAAA,EAG3E,GAGIC,IAA0BC,EAAYJ,GAAgB/B,CAAc;AAE1E,SAAAoC,EAAU,OACJ/B,MAAqB,SACnBC,EAAQ,eAAe,UAExBD,EAA4C,iBAAiB,SAASyB,CAAgB,KAGtFzB,EAA4C,iBAAiB,cAAcyB,CAAgB,GAE3FzB,EAA4C,iBAAiB,cAAc2B,CAAkB,IAEhG,SAAS,iBAAiB,aAAaA,CAAkB,GACzD,SAAS,iBAAiB,cAAcA,CAAkB,GAC1D,OAAO,iBAAiB,UAAUE,CAAuB,IAGpD,MAAM;AACX,IAAI7B,MAAqB,SACnBC,EAAQ,eAAe,UAExBD,EAA4C,oBAAoB,SAASyB,CAAgB,KAGzFzB,EAA4C,oBAAoB,cAAcyB,CAAgB,GAE9FzB,EAA4C,oBAAoB,cAAc2B,CAAkB,IAEnG,SAAS,oBAAoB,aAAaA,CAAkB,GAC5D,SAAS,oBAAoB,cAAcA,CAAkB,GAC7D,OAAO,oBAAoB,UAAUE,CAAuB;AAAA,EAC9D,EAEH,GAEM;AAAA,IACL,OAAO;AAAA,MACL,OAAAvB;AAAA,IAAA;AAAA,IAEF,QAAAJ;AAAA,EAAA;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResponsive.js","sources":["../../../src/components/hooks/useResponsive.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst BREAKPOINTS = {\n xs: 375,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1400,\n};\n\ntype BreakpointState = Record<keyof typeof BREAKPOINTS, boolean>;\ntype InitialBreakpoints = keyof typeof BREAKPOINTS | '_initial';\ntype Orientation = 'portrait' | 'landscape' | null;\ntype ResponsiveState = {\n greaterThan: BreakpointState;\n lessThan: BreakpointState;\n orientation: Orientation;\n mediaType: InitialBreakpoints;\n};\n\nexport const useResponsive = (): ResponsiveState => {\n const getMediaQuery = (size: number, greater: boolean): string => {\n return greater ? `(min-width: ${size}px)` : `(max-width: ${size - 1}px)`;\n };\n\n const getMatches = (query: string) => {\n if (typeof window !== 'undefined') {\n return window.matchMedia(query).matches;\n }\n return false;\n };\n\n const createResponsiveObject = () => {\n const initialBreakpointState: BreakpointState = {\n xs: false,\n sm: false,\n md: false,\n lg: false,\n xl: false,\n xxl: false,\n };\n\n const greaterThan = { ...initialBreakpointState };\n const lessThan = { ...initialBreakpointState };\n\n Object.entries(BREAKPOINTS).forEach(([key, size]) => {\n greaterThan[key as keyof typeof BREAKPOINTS] = getMatches(getMediaQuery(size, true));\n lessThan[key as keyof typeof BREAKPOINTS] = getMatches(getMediaQuery(size, false));\n });\n\n const orientation: Orientation = getMatches('(orientation: portrait)')\n ? 'portrait'\n : getMatches('(orientation: landscape)')\n ? 'landscape'\n : null;\n\n const mediaType = (Object.keys(greaterThan).findLast((key) => greaterThan[key as keyof typeof greaterThan]) ||\n '_initial') as InitialBreakpoints;\n\n return { greaterThan, lessThan, orientation, mediaType };\n };\n\n const [responsive, setResponsive] = useState(createResponsiveObject());\n\n useEffect(() => {\n const handleChange = () => setResponsive(createResponsiveObject());\n\n window.addEventListener('resize', handleChange);\n\n return () => window.removeEventListener('resize', handleChange);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return responsive;\n};\n"],"names":["BREAKPOINTS","useResponsive","getMediaQuery","size","greater","getMatches","query","createResponsiveObject","initialBreakpointState","greaterThan","lessThan","key","orientation","mediaType","responsive","setResponsive","useState","useEffect","handleChange"],"mappings":";AAEA,MAAMA,IAAc;AAAA,EAClB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AACP,GAYaC,IAAgB,MAAuB;
|
|
1
|
+
{"version":3,"file":"useResponsive.js","sources":["../../../src/components/hooks/useResponsive.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nconst BREAKPOINTS = {\n xs: 375,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1400,\n};\n\ntype BreakpointState = Record<keyof typeof BREAKPOINTS, boolean>;\ntype InitialBreakpoints = keyof typeof BREAKPOINTS | '_initial';\ntype Orientation = 'portrait' | 'landscape' | null;\ntype ResponsiveState = {\n greaterThan: BreakpointState;\n lessThan: BreakpointState;\n orientation: Orientation;\n mediaType: InitialBreakpoints;\n};\n\nexport const useResponsive = (): ResponsiveState => {\n const getMediaQuery = (size: number, greater: boolean): string => {\n return greater ? `(min-width: ${size}px)` : `(max-width: ${size - 1}px)`;\n };\n\n const getMatches = (query: string) => {\n if (typeof window !== 'undefined') {\n return window.matchMedia(query).matches;\n }\n return false;\n };\n\n const createResponsiveObject = () => {\n const initialBreakpointState: BreakpointState = {\n xs: false,\n sm: false,\n md: false,\n lg: false,\n xl: false,\n xxl: false,\n };\n\n const greaterThan = { ...initialBreakpointState };\n const lessThan = { ...initialBreakpointState };\n\n Object.entries(BREAKPOINTS).forEach(([key, size]) => {\n greaterThan[key as keyof typeof BREAKPOINTS] = getMatches(getMediaQuery(size, true));\n lessThan[key as keyof typeof BREAKPOINTS] = getMatches(getMediaQuery(size, false));\n });\n\n const orientation: Orientation = getMatches('(orientation: portrait)')\n ? 'portrait'\n : getMatches('(orientation: landscape)')\n ? 'landscape'\n : null;\n\n const mediaType = (Object.keys(greaterThan).findLast((key) => greaterThan[key as keyof typeof greaterThan]) ||\n '_initial') as InitialBreakpoints;\n\n return { greaterThan, lessThan, orientation, mediaType };\n };\n\n const [responsive, setResponsive] = useState(createResponsiveObject());\n\n useEffect(() => {\n const handleChange = () => setResponsive(createResponsiveObject());\n\n window.addEventListener('resize', handleChange);\n\n return () => window.removeEventListener('resize', handleChange);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return responsive;\n};\n"],"names":["BREAKPOINTS","useResponsive","getMediaQuery","size","greater","getMatches","query","createResponsiveObject","initialBreakpointState","greaterThan","lessThan","key","orientation","mediaType","responsive","setResponsive","useState","useEffect","handleChange"],"mappings":";AAEA,MAAMA,IAAc;AAAA,EAClB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AACP,GAYaC,IAAgB,MAAuB;AAClD,QAAMC,IAAgB,CAACC,GAAcC,MAC5BA,IAAU,eAAeD,CAAI,QAAQ,eAAeA,IAAO,CAAC,OAG/DE,IAAa,CAACC,MACd,OAAO,SAAW,MACb,OAAO,WAAWA,CAAK,EAAE,UAE3B,IAGHC,IAAyB,MAAM;AACnC,UAAMC,IAA0C;AAAA,MAC9C,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,KAAK;AAAA,IAAA,GAGDC,IAAc,EAAE,GAAGD,EAAA,GACnBE,IAAW,EAAE,GAAGF,EAAA;AAEtB,WAAO,QAAQR,CAAW,EAAE,QAAQ,CAAC,CAACW,GAAKR,CAAI,MAAM;AACnD,MAAAM,EAAYE,CAA+B,IAAIN,EAAWH,EAAcC,GAAM,EAAI,CAAC,GACnFO,EAASC,CAA+B,IAAIN,EAAWH,EAAcC,GAAM,EAAK,CAAC;AAAA,IAAA,CAClF;AAED,UAAMS,IAA2BP,EAAW,yBAAyB,IACjE,aACAA,EAAW,0BAA0B,IACnC,cACA,MAEAQ,IAAa,OAAO,KAAKJ,CAAW,EAAE,SAAS,CAACE,MAAQF,EAAYE,CAA+B,CAAC,KACxG;AAEF,WAAO,EAAE,aAAAF,GAAa,UAAAC,GAAU,aAAAE,GAAa,WAAAC,EAAA;AAAA,EAAU,GAGnD,CAACC,GAAYC,CAAa,IAAIC,EAAST,GAAwB;AAErE,SAAAU,EAAU,MAAM;AACd,UAAMC,IAAe,MAAMH,EAAcR,GAAwB;AAEjE,kBAAO,iBAAiB,UAAUW,CAAY,GAEvC,MAAM,OAAO,oBAAoB,UAAUA,CAAY;AAAA,EAAA,GAE7D,EAAE,GAEEJ;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers-DZIm3MiJ.js","sources":["../node_modules/@lexical/react/LexicalAutoLinkPlugin.prod.mjs","../src/components/RteEditor/Plugins/LinkPlugin/helpers.ts"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{AutoLinkNode as t,$isAutoLinkNode as e,$isLinkNode as n,TOGGLE_LINK_COMMAND as r,$createAutoLinkNode as l}from\"@lexical/link\";import{useLexicalComposerContext as i}from\"@lexical/react/LexicalComposerContext\";import{mergeRegister as o}from\"@lexical/utils\";import{TextNode as s,$getSelection as u,$isRangeSelection as g,COMMAND_PRIORITY_LOW as c,$isTextNode as a,$isElementNode as f,$isLineBreakNode as x,$createTextNode as h,$isNodeSelection as p}from\"lexical\";import{useEffect as d}from\"react\";function m(t,e=(t=>t)){return n=>{const r=t.exec(n);return null===r?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function T(t,e){for(let n=0;n<e.length;n++){const r=e[n](t);if(r)return r}return null}const C=/[.,;\\s]/;function S(t){return C.test(t)}function b(t){return S(t[t.length-1])}function U(t){return S(t[0])}function v(t){let e=t.getPreviousSibling();return f(e)&&(e=e.getLastDescendant()),null===e||x(e)||a(e)&&b(e.getTextContent())}function L(t){let e=t.getNextSibling();return f(e)&&(e=e.getFirstDescendant()),null===e||x(e)||a(e)&&U(e.getTextContent())}function R(t,e,n,r){if(!(t>0?S(n[t-1]):v(r[0])))return!1;return e<n.length?S(n[e]):L(r[r.length-1])}function k(t,e,n){const r=[],l=[],i=[];let o=0,s=0;const u=[...t];for(;u.length>0;){const t=u[0],g=t.getTextContent().length,c=s;s+g<=e?(r.push(t),o+=g):c>=n?i.push(t):l.push(t),s+=g,u.shift()}return[o,r,l,i]}function D(t,e,n,r){const i=l(r.url,r.attributes);if(1===t.length){let l,o=t[0];0===e?[l,o]=o.splitText(n):[,l,o]=o.splitText(e,n);const s=h(r.text);return s.setFormat(l.getFormat()),s.setDetail(l.getDetail()),s.setStyle(l.getStyle()),i.append(s),l.replace(i),o}if(t.length>1){const r=t[0];let l,o=r.getTextContent().length;0===e?l=r:[,l]=r.splitText(e);const s=[];let c;for(let e=1;e<t.length;e++){const r=t[e],l=r.getTextContent().length,i=o;if(i<n)if(o+l<=n)s.push(r);else{const[t,e]=r.splitText(n-i);s.push(t),c=e}o+=l}const f=u(),x=f?f.getNodes().find(a):void 0,d=h(l.getTextContent());return d.setFormat(l.getFormat()),d.setDetail(l.getDetail()),d.setStyle(l.getStyle()),i.append(d,...s),x&&x===l&&(g(f)?d.select(f.anchor.offset,f.focus.offset):p(f)&&d.select(0,d.getTextContent().length)),l.replace(i),c}}function N(t,e,n){const r=t.getChildren(),l=r.length;for(let e=0;e<l;e++){const l=r[e];if(!a(l)||!l.isSimpleText())return I(t),void n(null,t.getURL())}const i=t.getTextContent(),o=T(i,e);if(null===o||o.text!==i)return I(t),void n(null,t.getURL());if(!v(t)||!L(t))return I(t),void n(null,t.getURL());const s=t.getURL();if(s!==o.url&&(t.setURL(o.url),n(o.url,s)),o.attributes){const e=t.getRel();e!==o.attributes.rel&&(t.setRel(o.attributes.rel||null),n(o.attributes.rel||null,e));const r=t.getTarget();r!==o.attributes.target&&(t.setTarget(o.attributes.target||null),n(o.attributes.target||null,r))}}function I(t){const e=t.getChildren();for(let n=e.length-1;n>=0;n--)t.insertAfter(e[n]);return t.remove(),e.map((t=>t.getLatest()))}function P(l,i,f){d((()=>{l.hasNodes([t])||function(t,...e){const n=new URL(\"https://lexical.dev/docs/error\"),r=new URLSearchParams;r.append(\"code\",t);for(const t of e)r.append(\"v\",t);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77);const x=(t,e)=>{f&&f(t,e)};return o(l.registerNodeTransform(s,(t=>{const r=t.getParentOrThrow(),l=t.getPreviousSibling();if(e(r)&&!r.getIsUnlinked())N(r,i,x);else if(!n(r)){if(t.isSimpleText()&&(U(t.getTextContent())||!e(l))){const e=function(t){const e=[t];let n=t.getNextSibling();for(;null!==n&&a(n)&&n.isSimpleText()&&(e.push(n),!/[\\s]/.test(n.getTextContent()));)n=n.getNextSibling();return e}(t);!function(t,e,n){let r=[...t];const l=r.map((t=>t.getTextContent())).join(\"\");let i,o=l,s=0;for(;(i=T(o,e))&&null!==i;){const t=i.index,e=t+i.length;if(R(s+t,s+e,l,r)){const[l,,o,u]=k(r,s+t,s+e),g=D(o,s+t-l,s+e-l,i);r=g?[g,...u]:u,n(i.url,null),s=0}else s+=e;o=o.substring(e)}}(e,i,x)}!function(t,n,r){const l=t.getPreviousSibling(),i=t.getNextSibling(),o=t.getTextContent();var s;!e(l)||l.getIsUnlinked()||U(o)&&(s=o,!(l.isEmailURI()?/^\\.[a-zA-Z]{2,}/.test(s):/^\\.[a-zA-Z0-9]{1,}/.test(s)))||(l.append(t),N(l,n,r),r(null,l.getURL())),!e(i)||i.getIsUnlinked()||b(o)||(I(i),N(i,n,r),r(null,i.getURL()))}(t,i,x)}})),l.registerCommand(r,(t=>{const n=u();if(null!==t||!g(n))return!1;return n.extract().forEach((t=>{const n=t.getParent();if(e(n))return n.setIsUnlinked(!n.getIsUnlinked()),n.markDirty(),!0})),!1}),c))}),[l,i,f])}function w({matchers:t,onChange:e}){const[n]=i();return P(n,t,e),null}export{w as AutoLinkPlugin,m as createLinkMatcherWithRegExp};\n","import { createLinkMatcherWithRegExp } from '@lexical/react/LexicalAutoLinkPlugin';\n\nconst PROTOCOL_REGEX = /^(http|https):\\/\\//;\n\nconst URL_REGEX =\n /(https?:\\/\\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\\/\\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})/;\n\nconst EMAIL_REGEX =\n /(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))/;\n\nconst URL_REGEX_OR_BLANK =\n /^(https?:\\/\\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\\/\\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})?$/;\n\nexport const validateUrl = (url: string): boolean => {\n return url === 'https://' || URL_REGEX.test(url);\n};\n\nexport const validateUrlWithProtocol = (url: string): boolean => {\n return url === 'https://' || URL_REGEX_OR_BLANK.test(url);\n};\n\nexport const MATCHERS = [\n createLinkMatcherWithRegExp(URL_REGEX, (text: string): string => {\n return !PROTOCOL_REGEX.test(text) ? `//${text}` : text;\n }),\n createLinkMatcherWithRegExp(EMAIL_REGEX, (text) => {\n return `mailto:${text}`;\n }),\n];\n\nexport const ensureHttps = (url: string) => {\n if (!/^https?:\\/\\//i.test(url)) {\n return `https://${url}`;\n }\n return url;\n};\n"],"names":["m","t","r","T","C","S","b","U","v","f","x","a","L","R","k","l","i","o","s","u","g","D","h","c","e","d","p","N","I","P","n","w","PROTOCOL_REGEX","URL_REGEX","EMAIL_REGEX","URL_REGEX_OR_BLANK","validateUrl","url","validateUrlWithProtocol","MATCHERS","createLinkMatcherWithReg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EAAG;AAAC,aAAUlB,MAAP,QAAU,CAACmB,EAAEU,CAAC,KAAkBA,EAAE,QAAO,EAAG,QAAS,CAAA7B,MAAG;AAAC,cAAM6B,IAAE7B,EAAE,UAAS;AAAG,YAAGuB,EAAEM,CAAC,EAAE,QAAOA,EAAE,cAAc,CAACA,EAAE,cAAe,CAAA,GAAEA,EAAE,UAAS,GAAG;AAAA,MAAE,CAAC,GAAG;AAAA,IAAE,GAAGP,CAAC,CAAC;AAAA,EAAC,GAAG,CAACR,GAAEC,GAAEP,CAAC,CAAC;AAAC;AAAC,SAASsB,GAAE,EAAC,UAAS,GAAE,UAAS,EAAC,GAAE;AAAC,QAAK,CAAC,CAAC,IAAEf,EAAG;AAAC,SAAOa,EAAE,GAAE,GAAE,CAAC,GAAE;AAAI;ACN1gJ,MAAMG,KAAiB,sBAEjBC,IACJ,qNAEIC,KACJ,uJAEIC,KACJ,wNAEWC,KAAc,CAACC,MACnBA,MAAQ,cAAcJ,EAAU,KAAKI,CAAG,GAGpCC,KAA0B,CAACD,MAC/BA,MAAQ,cAAcF,GAAmB,KAAKE,CAAG,GAG7CE,KAAW;AAAA,EACtBC,EAA4BP,GAAW,CAACQ,MAC9BT,GAAe,KAAKS,CAAI,IAAkBA,IAAd,KAAKA,CAAI,EAC9C;AAAA,EACDD,EAA4BN,IAAa,CAACO,MACjC,UAAUA,CAAI,EACtB;AACH,GAEaC,KAAc,CAACL,MACrB,gBAAgB,KAAKA,CAAG,IAGtBA,IAFE,WAAWA,CAAG;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"helpers-DZIm3MiJ.js","sources":["../node_modules/@lexical/react/LexicalAutoLinkPlugin.prod.mjs","../src/components/RteEditor/Plugins/LinkPlugin/helpers.ts"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{AutoLinkNode as t,$isAutoLinkNode as e,$isLinkNode as n,TOGGLE_LINK_COMMAND as r,$createAutoLinkNode as l}from\"@lexical/link\";import{useLexicalComposerContext as i}from\"@lexical/react/LexicalComposerContext\";import{mergeRegister as o}from\"@lexical/utils\";import{TextNode as s,$getSelection as u,$isRangeSelection as g,COMMAND_PRIORITY_LOW as c,$isTextNode as a,$isElementNode as f,$isLineBreakNode as x,$createTextNode as h,$isNodeSelection as p}from\"lexical\";import{useEffect as d}from\"react\";function m(t,e=(t=>t)){return n=>{const r=t.exec(n);return null===r?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function T(t,e){for(let n=0;n<e.length;n++){const r=e[n](t);if(r)return r}return null}const C=/[.,;\\s]/;function S(t){return C.test(t)}function b(t){return S(t[t.length-1])}function U(t){return S(t[0])}function v(t){let e=t.getPreviousSibling();return f(e)&&(e=e.getLastDescendant()),null===e||x(e)||a(e)&&b(e.getTextContent())}function L(t){let e=t.getNextSibling();return f(e)&&(e=e.getFirstDescendant()),null===e||x(e)||a(e)&&U(e.getTextContent())}function R(t,e,n,r){if(!(t>0?S(n[t-1]):v(r[0])))return!1;return e<n.length?S(n[e]):L(r[r.length-1])}function k(t,e,n){const r=[],l=[],i=[];let o=0,s=0;const u=[...t];for(;u.length>0;){const t=u[0],g=t.getTextContent().length,c=s;s+g<=e?(r.push(t),o+=g):c>=n?i.push(t):l.push(t),s+=g,u.shift()}return[o,r,l,i]}function D(t,e,n,r){const i=l(r.url,r.attributes);if(1===t.length){let l,o=t[0];0===e?[l,o]=o.splitText(n):[,l,o]=o.splitText(e,n);const s=h(r.text);return s.setFormat(l.getFormat()),s.setDetail(l.getDetail()),s.setStyle(l.getStyle()),i.append(s),l.replace(i),o}if(t.length>1){const r=t[0];let l,o=r.getTextContent().length;0===e?l=r:[,l]=r.splitText(e);const s=[];let c;for(let e=1;e<t.length;e++){const r=t[e],l=r.getTextContent().length,i=o;if(i<n)if(o+l<=n)s.push(r);else{const[t,e]=r.splitText(n-i);s.push(t),c=e}o+=l}const f=u(),x=f?f.getNodes().find(a):void 0,d=h(l.getTextContent());return d.setFormat(l.getFormat()),d.setDetail(l.getDetail()),d.setStyle(l.getStyle()),i.append(d,...s),x&&x===l&&(g(f)?d.select(f.anchor.offset,f.focus.offset):p(f)&&d.select(0,d.getTextContent().length)),l.replace(i),c}}function N(t,e,n){const r=t.getChildren(),l=r.length;for(let e=0;e<l;e++){const l=r[e];if(!a(l)||!l.isSimpleText())return I(t),void n(null,t.getURL())}const i=t.getTextContent(),o=T(i,e);if(null===o||o.text!==i)return I(t),void n(null,t.getURL());if(!v(t)||!L(t))return I(t),void n(null,t.getURL());const s=t.getURL();if(s!==o.url&&(t.setURL(o.url),n(o.url,s)),o.attributes){const e=t.getRel();e!==o.attributes.rel&&(t.setRel(o.attributes.rel||null),n(o.attributes.rel||null,e));const r=t.getTarget();r!==o.attributes.target&&(t.setTarget(o.attributes.target||null),n(o.attributes.target||null,r))}}function I(t){const e=t.getChildren();for(let n=e.length-1;n>=0;n--)t.insertAfter(e[n]);return t.remove(),e.map((t=>t.getLatest()))}function P(l,i,f){d((()=>{l.hasNodes([t])||function(t,...e){const n=new URL(\"https://lexical.dev/docs/error\"),r=new URLSearchParams;r.append(\"code\",t);for(const t of e)r.append(\"v\",t);throw n.search=r.toString(),Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(77);const x=(t,e)=>{f&&f(t,e)};return o(l.registerNodeTransform(s,(t=>{const r=t.getParentOrThrow(),l=t.getPreviousSibling();if(e(r)&&!r.getIsUnlinked())N(r,i,x);else if(!n(r)){if(t.isSimpleText()&&(U(t.getTextContent())||!e(l))){const e=function(t){const e=[t];let n=t.getNextSibling();for(;null!==n&&a(n)&&n.isSimpleText()&&(e.push(n),!/[\\s]/.test(n.getTextContent()));)n=n.getNextSibling();return e}(t);!function(t,e,n){let r=[...t];const l=r.map((t=>t.getTextContent())).join(\"\");let i,o=l,s=0;for(;(i=T(o,e))&&null!==i;){const t=i.index,e=t+i.length;if(R(s+t,s+e,l,r)){const[l,,o,u]=k(r,s+t,s+e),g=D(o,s+t-l,s+e-l,i);r=g?[g,...u]:u,n(i.url,null),s=0}else s+=e;o=o.substring(e)}}(e,i,x)}!function(t,n,r){const l=t.getPreviousSibling(),i=t.getNextSibling(),o=t.getTextContent();var s;!e(l)||l.getIsUnlinked()||U(o)&&(s=o,!(l.isEmailURI()?/^\\.[a-zA-Z]{2,}/.test(s):/^\\.[a-zA-Z0-9]{1,}/.test(s)))||(l.append(t),N(l,n,r),r(null,l.getURL())),!e(i)||i.getIsUnlinked()||b(o)||(I(i),N(i,n,r),r(null,i.getURL()))}(t,i,x)}})),l.registerCommand(r,(t=>{const n=u();if(null!==t||!g(n))return!1;return n.extract().forEach((t=>{const n=t.getParent();if(e(n))return n.setIsUnlinked(!n.getIsUnlinked()),n.markDirty(),!0})),!1}),c))}),[l,i,f])}function w({matchers:t,onChange:e}){const[n]=i();return P(n,t,e),null}export{w as AutoLinkPlugin,m as createLinkMatcherWithRegExp};\n","import { createLinkMatcherWithRegExp } from '@lexical/react/LexicalAutoLinkPlugin';\n\nconst PROTOCOL_REGEX = /^(http|https):\\/\\//;\n\nconst URL_REGEX =\n /(https?:\\/\\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\\/\\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})/;\n\nconst EMAIL_REGEX =\n /(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))/;\n\nconst URL_REGEX_OR_BLANK =\n /^(https?:\\/\\/(?:www\\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www\\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\\/\\/(?:www\\.|(?!www))[a-zA-Z0-9]+\\.[^\\s]{2,}|www\\.[a-zA-Z0-9]+\\.[^\\s]{2,})?$/;\n\nexport const validateUrl = (url: string): boolean => {\n return url === 'https://' || URL_REGEX.test(url);\n};\n\nexport const validateUrlWithProtocol = (url: string): boolean => {\n return url === 'https://' || URL_REGEX_OR_BLANK.test(url);\n};\n\nexport const MATCHERS = [\n createLinkMatcherWithRegExp(URL_REGEX, (text: string): string => {\n return !PROTOCOL_REGEX.test(text) ? `//${text}` : text;\n }),\n createLinkMatcherWithRegExp(EMAIL_REGEX, (text) => {\n return `mailto:${text}`;\n }),\n];\n\nexport const ensureHttps = (url: string) => {\n if (!/^https?:\\/\\//i.test(url)) {\n return `https://${url}`;\n }\n return url;\n};\n"],"names":["m","t","r","T","C","S","b","U","v","f","x","a","L","R","k","l","i","o","s","u","g","D","h","c","e","d","p","N","I","P","n","w","PROTOCOL_REGEX","URL_REGEX","EMAIL_REGEX","URL_REGEX_OR_BLANK","validateUrl","url","validateUrlWithProtocol","MATCHERS","createLinkMatcherWithRegExp","text","ensureHttps"],"mappings":";;;;;AAQqf,SAASA,EAAE,GAAE,IAAG,CAAAC,MAAGA,GAAG;AAAC,SAAO,OAAG;AAAC,UAAMC,IAAE,EAAE,KAAK,CAAC;AAAE,WAAcA,MAAP,OAAS,OAAK,EAAC,OAAMA,EAAE,OAAM,QAAOA,EAAE,CAAC,EAAE,QAAO,MAAKA,EAAE,CAAC,GAAE,KAAI,EAAEA,EAAE,CAAC,CAAC,EAAC;AAAA,EAAC;AAAC;AAAC,SAASC,EAAE,GAAE,GAAE;AAAC,WAAQ,IAAE,GAAE,IAAE,EAAE,QAAO,KAAI;A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