@weni/unnnic-system 3.10.0 → 3.11.1-alpha.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/CHANGELOG.md +80 -0
- package/dist/assets/tokens/colors.json.d.ts +376 -0
- package/dist/components/Accordion/Accordion.vue.d.ts +1 -1
- package/dist/components/Alert/Alert.vue.d.ts +17 -116
- package/dist/components/Alert/Alert.vue.d.ts.map +1 -1
- package/dist/components/Alert/Version1dot1.vue.d.ts +2 -38
- package/dist/components/Alert/Version1dot1.vue.d.ts.map +1 -1
- package/dist/components/AudioRecorder/AudioHandler.vue.d.ts +111 -20
- package/dist/components/AudioRecorder/AudioPlayer.vue.d.ts +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +223 -41
- package/dist/components/AvatarIcon/AvatarIcon.vue.d.ts +3 -3
- package/dist/components/Banner/Banner.vue.d.ts +1 -1
- package/dist/components/Banner/InfoBanner.vue.d.ts +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.vue.d.ts +1 -1
- package/dist/components/Button/Button.vue.d.ts +3 -3
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/Button/ButtonIcon.vue.d.ts +1 -1
- package/dist/components/Button/types.d.ts +1 -1
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/Card/AccountCard.vue.d.ts +4 -4
- package/dist/components/Card/BlankCard.vue.d.ts +1 -1
- package/dist/components/Card/Card.vue.d.ts +128 -37
- package/dist/components/Card/CardCompany.vue.d.ts +12 -415
- package/dist/components/Card/CardData.vue.d.ts +1 -1
- package/dist/components/Card/CardStatusesContainer.vue.d.ts +114 -23
- package/dist/components/Card/ContentCard.vue.d.ts +2 -2
- package/dist/components/Card/DashCard.vue.d.ts +4 -4
- package/dist/components/Card/MarketplaceCard.vue.d.ts +1 -1
- package/dist/components/Card/SimpleCard.vue.d.ts +112 -21
- package/dist/components/Card/StatusCard.vue.d.ts +1 -1
- package/dist/components/Card/TitleCard.vue.d.ts +112 -21
- package/dist/components/CardImage/CardImage.vue.d.ts +23 -30
- package/dist/components/CardInformation/CardInformation.vue.d.ts +114 -23
- package/dist/components/CardProject/CardProject.vue.d.ts +3 -3
- package/dist/components/Carousel/Carousel.vue.d.ts +14 -417
- package/dist/components/Carousel/TagCarousel.vue.d.ts +13 -416
- package/dist/components/ChartBar/ChartBar.vue.d.ts +120 -29
- package/dist/components/ChartLine/ChartLine.vue.d.ts +110 -19
- package/dist/components/ChatText/ChatText.vue.d.ts +111 -20
- package/dist/components/ChatsContact/ChatsContact.vue.d.ts +22 -447
- package/dist/components/ChatsDashboardTagLive/ChatsDashboardTagLive.vue.d.ts +1 -1
- package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts +1 -1
- package/dist/components/ChatsHeader/ChatsHeader.vue.d.ts.map +1 -1
- package/dist/components/ChatsMessage/ChatsMessage.vue.d.ts +114 -23
- package/dist/components/ChatsMessage/ChatsMessageStatusBackdrop.vue.d.ts +2 -2
- package/dist/components/ChatsNavbar/ChatsNavbar.vue.d.ts +1 -1
- package/dist/components/ChatsUserAvatar/ChatsUserAvatar.vue.d.ts +3 -3
- package/dist/components/Checkbox/Checkbox.vue.d.ts +17 -24
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +28 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts.map +1 -0
- package/dist/components/Comment/Comment.vue.d.ts +1 -1
- package/dist/components/DataArea/DataArea.vue.d.ts +111 -20
- package/dist/components/DataTable/index.vue.d.ts +2 -2
- package/dist/components/DataTable/index.vue.d.ts.map +1 -1
- package/dist/components/DateFilter/DateFilter.vue.d.ts +172 -41
- package/dist/components/DatePicker/DatePicker.vue.d.ts +10 -10
- package/dist/components/Drawer/Drawer.vue.d.ts +35 -207
- package/dist/components/Drawer/Drawer.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +2 -2
- package/dist/components/Dropdown/LanguageSelect.vue.d.ts +3 -3
- package/dist/components/Flag.vue.d.ts +2 -2
- package/dist/components/FormElement/FormElement.vue.d.ts +50 -27
- package/dist/components/FormElement/FormElement.vue.d.ts.map +1 -1
- package/dist/components/Icon.vue.d.ts +1 -1
- package/dist/components/Icon.vue.d.ts.map +1 -1
- package/dist/components/IconLoading/IconLoading.vue.d.ts +1 -1
- package/dist/components/ImportCard/ImportCard.vue.d.ts +10 -10
- package/dist/components/Input/BaseInput.vue.d.ts +11 -2
- package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +171 -40
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +33 -24
- package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
- package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +182 -51
- package/dist/components/InputNext/InputNext.vue.d.ts +3 -3
- package/dist/components/Label/Label.vue.d.ts +9 -15
- package/dist/components/Label/Label.vue.d.ts.map +1 -1
- package/dist/components/Modal/Modal.vue.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +214 -40
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/ModalNext/ModalNext.vue.d.ts +182 -51
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +21 -21
- package/dist/components/MoodRating/MoodRating.vue.d.ts +110 -19
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +26 -14
- package/dist/components/PageHeader/PageHeader.vue.d.ts +28 -0
- package/dist/components/PageHeader/PageHeader.vue.d.ts.map +1 -0
- package/dist/components/PageHeader/index.d.ts +3 -0
- package/dist/components/PageHeader/index.d.ts.map +1 -0
- package/dist/components/PageHeader/types.d.ts +9 -0
- package/dist/components/PageHeader/types.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.vue.d.ts +9 -9
- package/dist/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
- package/dist/components/Radio/Radio.vue.d.ts +10 -6
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +67 -468
- package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +12 -415
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +18 -25
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts.map +1 -1
- package/dist/components/SelectTime/index.vue.d.ts +34 -25
- package/dist/components/SkeletonLoading/skeletonTheme.vue.d.ts +1 -1
- package/dist/components/Slider/Slider.vue.d.ts +111 -20
- package/dist/components/StarRating/StarRating.vue.d.ts +1 -1
- package/dist/components/Switch/Switch.vue.d.ts +56 -22
- package/dist/components/Switch/Switch.vue.d.ts.map +1 -1
- package/dist/components/Tab/Tab.vue.d.ts +122 -20
- package/dist/components/TableNext/TablePagination.vue.d.ts +9 -9
- package/dist/components/TabsExpanded/TabsExpanded.vue.d.ts +1 -1
- package/dist/components/Tag/DefaultTag.vue.d.ts +4 -83
- package/dist/components/Tag/DefaultTag.vue.d.ts.map +1 -1
- package/dist/components/Tag/Tag.vue.d.ts +13 -415
- package/dist/components/Tag/Tag.vue.d.ts.map +1 -1
- package/dist/components/Tag/types.d.ts +18 -0
- package/dist/components/Tag/types.d.ts.map +1 -0
- package/dist/components/TextArea/TextArea.vue.d.ts +78 -33
- package/dist/components/TextArea/TextArea.vue.d.ts.map +1 -1
- package/dist/components/Toast/Toast.vue.d.ts +16 -0
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -0
- package/dist/components/Toast/ToastManager.d.ts +14 -0
- package/dist/components/Toast/ToastManager.d.ts.map +1 -0
- package/dist/components/Toast/types.d.ts +35 -0
- package/dist/components/Toast/types.d.ts.map +1 -0
- package/dist/components/ToolTip/ToolTip.vue.d.ts +110 -19
- package/dist/components/ToolTip/ToolTip.vue.d.ts.map +1 -1
- package/dist/components/Tour/Tour.vue.d.ts +9 -9
- package/dist/components/Tour/TourPopover.vue.d.ts +9 -9
- package/dist/components/UploadArea/UploadArea.vue.d.ts +10 -10
- package/dist/components/index.d.ts +12880 -11199
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/ui/dialog/Dialog.vue.d.ts +23 -0
- package/dist/components/ui/dialog/Dialog.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogClose.vue.d.ts +19 -0
- package/dist/components/ui/dialog/DialogClose.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogContent.vue.d.ts +43 -0
- package/dist/components/ui/dialog/DialogContent.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts +25 -0
- package/dist/components/ui/dialog/DialogFooter.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts +29 -0
- package/dist/components/ui/dialog/DialogHeader.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts +23 -0
- package/dist/components/ui/dialog/DialogTitle.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts +19 -0
- package/dist/components/ui/dialog/DialogTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/dialog/index.d.ts +8 -0
- package/dist/components/ui/dialog/index.d.ts.map +1 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts +35 -0
- package/dist/components/ui/drawer/Drawer.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerClose.vue.d.ts +19 -0
- package/dist/components/ui/drawer/DrawerClose.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts +42 -0
- package/dist/components/ui/drawer/DrawerContent.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts +23 -0
- package/dist/components/ui/drawer/DrawerDescription.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts +22 -0
- package/dist/components/ui/drawer/DrawerFooter.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts +25 -0
- package/dist/components/ui/drawer/DrawerHeader.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts +8 -0
- package/dist/components/ui/drawer/DrawerOverlay.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts +23 -0
- package/dist/components/ui/drawer/DrawerTitle.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts +19 -0
- package/dist/components/ui/drawer/DrawerTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/drawer/index.d.ts +11 -0
- package/dist/components/ui/drawer/index.d.ts.map +1 -0
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +2 -2
- package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +1 -1
- package/dist/components/ui/segmented-control/SegmentedControlList.vue.d.ts +26 -0
- package/dist/components/ui/segmented-control/SegmentedControlList.vue.d.ts.map +1 -0
- package/dist/components/ui/segmented-control/SegmentedControlTrigger.vue.d.ts +24 -0
- package/dist/components/ui/segmented-control/SegmentedControlTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/segmented-control/index.d.ts +5 -0
- package/dist/components/ui/segmented-control/index.d.ts.map +1 -0
- package/dist/components/ui/tabs/TabsTrigger.vue.d.ts.map +1 -1
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts +23 -0
- package/dist/components/ui/tooltip/Tooltip.vue.d.ts.map +1 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts +31 -0
- package/dist/components/ui/tooltip/TooltipContent.vue.d.ts.map +1 -0
- package/dist/components/ui/tooltip/TooltipProvider.vue.d.ts +19 -0
- package/dist/components/ui/tooltip/TooltipProvider.vue.d.ts.map +1 -0
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts +19 -0
- package/dist/components/ui/tooltip/TooltipTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/tooltip/index.d.ts +5 -0
- package/dist/components/ui/tooltip/index.d.ts.map +1 -0
- package/dist/{es-4b899f97.mjs → es-5af54117.mjs} +1 -1
- package/dist/{index-23489897.mjs → index-eb28c19c.mjs} +99655 -96333
- package/dist/{pt-br-5a914a63.mjs → pt-br-e0368966.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +216 -179
- package/dist/unnnic.umd.js +48 -45
- package/dist/utils/call.d.ts +2 -1
- package/dist/utils/call.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/assets/icons/checkbox-checked-disabled.svg +3 -0
- package/src/assets/icons/checkbox-checked.svg +3 -0
- package/src/assets/icons/checkbox-less-disabled.svg +3 -0
- package/src/assets/icons/checkbox-less.svg +3 -0
- package/src/assets/icons/radio-checked.svg +3 -0
- package/src/assets/icons/switch-checked-disabled.svg +3 -0
- package/src/assets/icons/switch-checked.svg +3 -0
- package/src/assets/scss/tailwind.scss +8 -0
- package/src/components/Alert/Alert.vue +26 -135
- package/src/components/Alert/Version1dot1.vue +0 -36
- package/src/components/Alert/__tests__/Alert.spec.js +2 -45
- package/src/components/Alert/__tests__/Version1dot1.spec.js +0 -21
- package/src/components/Alert/__tests__/__snapshots__/Alert.spec.js.snap +11 -7
- package/src/components/Alert/__tests__/__snapshots__/AlertBanner.spec.js.snap +2 -2
- package/src/components/Alert/__tests__/__snapshots__/Version1dot1.spec.js.snap +1 -1
- package/src/components/Button/Button.vue +67 -117
- package/src/components/Button/types.ts +0 -1
- package/src/components/ChatsContact/ChatsContact.vue +10 -6
- package/src/components/Checkbox/Checkbox.vue +117 -65
- package/src/components/Checkbox/__tests__/Checkbox.spec.js +6 -21
- package/src/components/CheckboxGroup/CheckboxGroup.vue +96 -0
- package/src/components/Drawer/Drawer.vue +174 -271
- package/src/components/Drawer/__tests__/Drawer.spec.js +32 -43
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.spec.js.snap +18 -19
- package/src/components/FormElement/FormElement.vue +63 -93
- package/src/components/Icon.vue +2 -0
- package/src/components/Input/BaseInput.vue +12 -12
- package/src/components/Input/Input.scss +19 -20
- package/src/components/Input/Input.vue +60 -55
- package/src/components/Input/TextInput.vue +25 -54
- package/src/components/Input/__test__/Input.spec.js +13 -33
- package/src/components/Input/__test__/TextInput.spec.js +6 -8
- package/src/components/Input/__test__/__snapshots__/Input.spec.js.snap +14 -5
- package/src/components/Input/__test__/__snapshots__/TextInput.spec.js.snap +1 -1
- package/src/components/Label/Label.vue +52 -21
- package/src/components/Label/__tests__/Label.spec.js +1 -1
- package/src/components/Label/__tests__/__snapshots__/Label.spec.js.snap +1 -1
- package/src/components/ModalDialog/ModalDialog.vue +62 -148
- package/src/components/ModalDialog/__tests__/ModalDialog.spec.js +11 -221
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -22
- package/src/components/PageHeader/PageHeader.vue +148 -0
- package/src/components/PageHeader/index.ts +2 -0
- package/src/components/PageHeader/types.ts +10 -0
- package/src/components/Radio/Radio.vue +118 -66
- package/src/components/Radio/__test__/Radio.spec.js +14 -20
- package/src/components/Radio/__test__/__snapshots__/Radio.spec.js.snap +4 -3
- package/src/components/RadioGroup/RadioGroup.vue +142 -0
- package/src/components/SelectSmart/SelectSmart.vue +4 -3
- package/src/components/Switch/Switch.vue +132 -91
- package/src/components/Switch/__tests__/Switch.spec.js +8 -75
- package/src/components/Switch/__tests__/__snapshots__/Switch.spec.js.snap +5 -6
- package/src/components/Tab/Tab.vue +37 -23
- package/src/components/Tab/__test__/__snapshots__/Tab.spec.js.snap +3 -1
- package/src/components/TableNext/__test__/__snapshots__/TableNext.spec.js.snap +2 -2
- package/src/components/TableNext/__test__/__snapshots__/TablePagination.spec.js.snap +2 -2
- package/src/components/Tag/DefaultTag.vue +51 -107
- package/src/components/Tag/Tag.vue +32 -79
- package/src/components/Tag/types.ts +19 -0
- package/src/components/TextArea/TextArea.vue +41 -12
- package/src/components/TextArea/__test__/__snapshots__/TextArea.spec.js.snap +11 -3
- package/src/components/Toast/Toast.vue +246 -0
- package/src/components/Toast/ToastManager.ts +110 -0
- package/src/components/Toast/__tests__/Toast.spec.js +291 -0
- package/src/components/Toast/__tests__/ToastManager.spec.js +294 -0
- package/src/components/Toast/types.ts +57 -0
- package/src/components/ToolTip/ToolTip.vue +41 -188
- package/src/components/ToolTip/__tests__/ToolTip.spec.js +345 -61
- package/src/components/index.ts +88 -5
- package/src/components/ui/dialog/Dialog.vue +15 -0
- package/src/components/ui/dialog/DialogClose.vue +25 -0
- package/src/components/ui/dialog/DialogContent.vue +133 -0
- package/src/components/ui/dialog/DialogFooter.vue +46 -0
- package/src/components/ui/dialog/DialogHeader.vue +79 -0
- package/src/components/ui/dialog/DialogTitle.vue +34 -0
- package/src/components/ui/dialog/DialogTrigger.vue +12 -0
- package/src/components/ui/dialog/index.ts +7 -0
- package/src/components/ui/drawer/Drawer.vue +23 -0
- package/src/components/ui/drawer/DrawerClose.vue +33 -0
- package/src/components/ui/drawer/DrawerContent.vue +98 -0
- package/src/components/ui/drawer/DrawerDescription.vue +36 -0
- package/src/components/ui/drawer/DrawerFooter.vue +34 -0
- package/src/components/ui/drawer/DrawerHeader.vue +53 -0
- package/src/components/ui/drawer/DrawerOverlay.vue +30 -0
- package/src/components/ui/drawer/DrawerTitle.vue +33 -0
- package/src/components/ui/drawer/DrawerTrigger.vue +27 -0
- package/src/components/ui/drawer/index.ts +10 -0
- package/src/components/ui/segmented-control/SegmentedControlList.vue +51 -0
- package/src/components/ui/segmented-control/SegmentedControlTrigger.vue +81 -0
- package/src/components/ui/segmented-control/index.ts +4 -0
- package/src/components/ui/tabs/TabsTrigger.vue +4 -20
- package/src/components/ui/tooltip/Tooltip.vue +15 -0
- package/src/components/ui/tooltip/TooltipContent.vue +73 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +15 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +22 -0
- package/src/components/ui/tooltip/index.ts +4 -0
- package/src/stories/Alert.stories.js +6 -67
- package/src/stories/Button.stories.js +29 -39
- package/src/stories/Checkbox.stories.js +11 -4
- package/src/stories/CheckboxGroup.stories.js +105 -0
- package/src/stories/Dialog.stories.js +832 -0
- package/src/stories/Drawer.stories.js +1 -1
- package/src/stories/DrawerNext.stories.js +610 -0
- package/src/stories/Input.stories.js +71 -76
- package/src/stories/Label.stories.js +7 -0
- package/src/stories/ModalDialog.mdx +3 -0
- package/src/stories/ModalDialog.stories.js +1 -1
- package/src/stories/PageHeader.stories.js +330 -0
- package/src/stories/Radio.stories.js +28 -1
- package/src/stories/RadioGroup.stories.js +144 -0
- package/src/stories/SegmentedControl.stories.js +253 -0
- package/src/stories/Switch.stories.js +10 -5
- package/src/stories/Tab.stories.js +11 -4
- package/src/stories/Tabs.stories.js +1 -1
- package/src/stories/Tag.stories.js +24 -43
- package/src/stories/TextArea.stories.js +14 -2
- package/src/stories/Toast.mdx +123 -0
- package/src/stories/Toast.stories.js +126 -0
- package/src/types/scheme-colors.d.ts +1 -0
- package/src/utils/call.js +46 -18
- package/dist/components/Tag/BrandTag.vue.d.ts +0 -51
- package/dist/components/Tag/BrandTag.vue.d.ts.map +0 -1
- package/dist/components/Tag/IndicatorTag.vue.d.ts +0 -151
- package/dist/components/Tag/IndicatorTag.vue.d.ts.map +0 -1
- package/dist/components/Tag/TagNext.vue.d.ts +0 -24
- package/dist/components/Tag/TagNext.vue.d.ts.map +0 -1
- package/src/components/Alert/AlertBanner.vue +0 -182
- package/src/components/Alert/AlertCaller.vue +0 -49
- package/src/components/Alert/__tests__/AlertBanner.spec.js +0 -89
- package/src/components/Alert/__tests__/AlertCaller.spec.js +0 -98
- package/src/components/Tag/BrandTag.vue +0 -96
- package/src/components/Tag/IndicatorTag.vue +0 -107
- package/src/components/Tag/TagNext.vue +0 -60
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, afterEach, test, vi } from 'vitest';
|
|
2
|
+
|
|
3
|
+
vi.mock('vue', () => ({
|
|
4
|
+
createApp: vi.fn(() => ({
|
|
5
|
+
mount: vi.fn(),
|
|
6
|
+
unmount: vi.fn(),
|
|
7
|
+
})),
|
|
8
|
+
}));
|
|
9
|
+
|
|
10
|
+
vi.mock('../Toast.vue', () => ({
|
|
11
|
+
default: {
|
|
12
|
+
name: 'Toast',
|
|
13
|
+
template: '<div data-testid="toast">Mock Toast</div>',
|
|
14
|
+
},
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
import toastManager, { toast } from '../ToastManager';
|
|
18
|
+
import Toast from '../Toast.vue';
|
|
19
|
+
|
|
20
|
+
describe('ToastManager', () => {
|
|
21
|
+
let mockCreateApp;
|
|
22
|
+
let mockMount;
|
|
23
|
+
let mockUnmount;
|
|
24
|
+
|
|
25
|
+
beforeEach(async () => {
|
|
26
|
+
vi.clearAllMocks();
|
|
27
|
+
|
|
28
|
+
document.body.innerHTML = '';
|
|
29
|
+
|
|
30
|
+
const { createApp } = await import('vue');
|
|
31
|
+
mockCreateApp = createApp;
|
|
32
|
+
mockMount = vi.fn();
|
|
33
|
+
mockUnmount = vi.fn();
|
|
34
|
+
|
|
35
|
+
mockCreateApp.mockReturnValue({
|
|
36
|
+
mount: mockMount,
|
|
37
|
+
unmount: mockUnmount,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
Object.defineProperty(globalThis, 'document', {
|
|
41
|
+
value: {
|
|
42
|
+
...document,
|
|
43
|
+
createElement: vi.fn((tagName) => {
|
|
44
|
+
const element = {
|
|
45
|
+
tagName: tagName.toUpperCase(),
|
|
46
|
+
setAttribute: vi.fn(),
|
|
47
|
+
appendChild: vi.fn(),
|
|
48
|
+
remove: vi.fn(),
|
|
49
|
+
children: [],
|
|
50
|
+
parentNode: null,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
if (tagName === 'div') {
|
|
54
|
+
element.appendChild = vi.fn((child) => {
|
|
55
|
+
child.parentNode = element;
|
|
56
|
+
element.children.push(child);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return element;
|
|
61
|
+
}),
|
|
62
|
+
body: {
|
|
63
|
+
...document.body,
|
|
64
|
+
appendChild: vi.fn(),
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
writable: true,
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
afterEach(() => {
|
|
72
|
+
if (toastManager.toasts) {
|
|
73
|
+
toastManager.toasts.clear();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
document.body.innerHTML = '';
|
|
77
|
+
|
|
78
|
+
vi.clearAllMocks();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
describe('Container Management', () => {
|
|
82
|
+
test('creates container on first toast', () => {
|
|
83
|
+
const createElementSpy = vi.spyOn(document, 'createElement');
|
|
84
|
+
const appendChildSpy = vi.spyOn(document.body, 'appendChild');
|
|
85
|
+
|
|
86
|
+
toastManager.show({ title: 'Test Toast' });
|
|
87
|
+
|
|
88
|
+
expect(createElementSpy).toHaveBeenCalledWith('div');
|
|
89
|
+
expect(appendChildSpy).toHaveBeenCalled();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test('reuses existing container', () => {
|
|
93
|
+
const createElementSpy = vi.spyOn(document, 'createElement');
|
|
94
|
+
|
|
95
|
+
toastManager.show({ title: 'First Toast' });
|
|
96
|
+
const firstCallCount = createElementSpy.mock.calls.length;
|
|
97
|
+
|
|
98
|
+
toastManager.show({ title: 'Second Toast' });
|
|
99
|
+
const secondCallCount = createElementSpy.mock.calls.length;
|
|
100
|
+
|
|
101
|
+
// First toast: container div + wrapper div = 2 calls
|
|
102
|
+
// Second toast: only wrapper div = 1 more call
|
|
103
|
+
// Total: 3 calls (1 container + 2 wrappers)
|
|
104
|
+
expect(secondCallCount).toBe(firstCallCount + 1);
|
|
105
|
+
|
|
106
|
+
expect(createElementSpy).toHaveBeenCalledWith('div');
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
describe('Toast Instance Management', () => {
|
|
111
|
+
test('generates unique IDs for toasts', () => {
|
|
112
|
+
const toast1 = toastManager.show({ title: 'First Toast' });
|
|
113
|
+
const toast2 = toastManager.show({ title: 'Second Toast' });
|
|
114
|
+
|
|
115
|
+
expect(toast1.id).not.toBe(toast2.id);
|
|
116
|
+
expect(toast1.id).toMatch(/^toast-\d+$/);
|
|
117
|
+
expect(toast2.id).toMatch(/^toast-\d+$/);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
test('stores toast instances in map', () => {
|
|
121
|
+
const toast1 = toastManager.show({ title: 'First Toast' });
|
|
122
|
+
const toast2 = toastManager.show({ title: 'Second Toast' });
|
|
123
|
+
|
|
124
|
+
expect(toastManager.toasts.has(toast1.id)).toBe(true);
|
|
125
|
+
expect(toastManager.toasts.has(toast2.id)).toBe(true);
|
|
126
|
+
expect(toastManager.toasts.size).toBe(2);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
test('creates toast with correct props', () => {
|
|
130
|
+
const props = {
|
|
131
|
+
title: 'Test Toast',
|
|
132
|
+
description: 'Test Description',
|
|
133
|
+
type: 'success',
|
|
134
|
+
timeout: 3000,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
toastManager.show(props);
|
|
138
|
+
|
|
139
|
+
expect(mockCreateApp).toHaveBeenCalledWith(
|
|
140
|
+
Toast,
|
|
141
|
+
expect.objectContaining({
|
|
142
|
+
title: 'Test Toast',
|
|
143
|
+
description: 'Test Description',
|
|
144
|
+
type: 'success',
|
|
145
|
+
timeout: 3000,
|
|
146
|
+
onClose: expect.any(Function),
|
|
147
|
+
onDestroy: expect.any(Function),
|
|
148
|
+
}),
|
|
149
|
+
);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
test('mounts toast app to wrapper element', () => {
|
|
153
|
+
toastManager.show({ title: 'Test Toast' });
|
|
154
|
+
|
|
155
|
+
expect(mockMount).toHaveBeenCalled();
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
describe('Toast Close Functionality', () => {
|
|
160
|
+
test('removes toast from map when closed', () => {
|
|
161
|
+
const toastInstance = toastManager.show({ title: 'Test Toast' });
|
|
162
|
+
|
|
163
|
+
expect(toastManager.toasts.has(toastInstance.id)).toBe(true);
|
|
164
|
+
|
|
165
|
+
toastManager.close(toastInstance.id);
|
|
166
|
+
|
|
167
|
+
expect(toastManager.toasts.has(toastInstance.id)).toBe(false);
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
test('handles closing non-existent toast gracefully', () => {
|
|
171
|
+
expect(() => {
|
|
172
|
+
toastManager.close('non-existent-id');
|
|
173
|
+
}).not.toThrow();
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
test('calls close when onClose is triggered', () => {
|
|
177
|
+
const closeSpy = vi.spyOn(toastManager, 'close');
|
|
178
|
+
|
|
179
|
+
toastManager.show({ title: 'Test Toast' });
|
|
180
|
+
|
|
181
|
+
const createAppCall = mockCreateApp.mock.calls[0];
|
|
182
|
+
const props = createAppCall[1];
|
|
183
|
+
const onCloseCallback = props.onClose;
|
|
184
|
+
|
|
185
|
+
onCloseCallback();
|
|
186
|
+
|
|
187
|
+
expect(closeSpy).toHaveBeenCalled();
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
describe('Toast Destroy Functionality', () => {
|
|
192
|
+
test('unmounts app and removes wrapper on destroy', () => {
|
|
193
|
+
toastManager.show({ title: 'Test Toast' });
|
|
194
|
+
|
|
195
|
+
const createAppCall = mockCreateApp.mock.calls[0];
|
|
196
|
+
const props = createAppCall[1];
|
|
197
|
+
const onDestroyCallback = props.onDestroy;
|
|
198
|
+
|
|
199
|
+
onDestroyCallback();
|
|
200
|
+
|
|
201
|
+
expect(mockUnmount).toHaveBeenCalled();
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
test('resolves promise when toast is destroyed', async () => {
|
|
205
|
+
const toastInstance = toastManager.show({ title: 'Test Toast' });
|
|
206
|
+
|
|
207
|
+
const createAppCall = mockCreateApp.mock.calls[0];
|
|
208
|
+
const props = createAppCall[1];
|
|
209
|
+
const onDestroyCallback = props.onDestroy;
|
|
210
|
+
|
|
211
|
+
const promiseResolved = vi.fn();
|
|
212
|
+
toastInstance.promise.then(promiseResolved);
|
|
213
|
+
|
|
214
|
+
onDestroyCallback();
|
|
215
|
+
|
|
216
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
217
|
+
|
|
218
|
+
expect(promiseResolved).toHaveBeenCalled();
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
describe('Toast API', () => {
|
|
223
|
+
beforeEach(() => {
|
|
224
|
+
vi.spyOn(toastManager, 'show').mockReturnValue({
|
|
225
|
+
id: 'mock-id',
|
|
226
|
+
props: {},
|
|
227
|
+
close: vi.fn(),
|
|
228
|
+
promise: Promise.resolve(),
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
test('toast.info creates informational toast', () => {
|
|
233
|
+
toast.info('Info Title', 'Info Description', { timeout: 1000 });
|
|
234
|
+
|
|
235
|
+
expect(toastManager.show).toHaveBeenCalledWith({
|
|
236
|
+
title: 'Info Title',
|
|
237
|
+
description: 'Info Description',
|
|
238
|
+
timeout: 1000,
|
|
239
|
+
type: 'informational',
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
test('toast.success creates success toast', () => {
|
|
244
|
+
toast.success('Success Title', 'Success Description');
|
|
245
|
+
|
|
246
|
+
expect(toastManager.show).toHaveBeenCalledWith({
|
|
247
|
+
title: 'Success Title',
|
|
248
|
+
description: 'Success Description',
|
|
249
|
+
type: 'success',
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
test('toast.attention creates attention toast', () => {
|
|
254
|
+
toast.attention('Attention Title');
|
|
255
|
+
|
|
256
|
+
expect(toastManager.show).toHaveBeenCalledWith({
|
|
257
|
+
title: 'Attention Title',
|
|
258
|
+
type: 'attention',
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
test('toast.error creates error toast', () => {
|
|
263
|
+
toast.error('Error Title', 'Error Description', {
|
|
264
|
+
button: { text: 'Retry', action: vi.fn() },
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
expect(toastManager.show).toHaveBeenCalledWith({
|
|
268
|
+
title: 'Error Title',
|
|
269
|
+
description: 'Error Description',
|
|
270
|
+
button: { text: 'Retry', action: expect.any(Function) },
|
|
271
|
+
type: 'error',
|
|
272
|
+
});
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
test('toast methods return promises', async () => {
|
|
276
|
+
const infoPromise = toast.info('Test');
|
|
277
|
+
const successPromise = toast.success('Test');
|
|
278
|
+
const attentionPromise = toast.attention('Test');
|
|
279
|
+
const errorPromise = toast.error('Test');
|
|
280
|
+
|
|
281
|
+
expect(infoPromise).toBeInstanceOf(Promise);
|
|
282
|
+
expect(successPromise).toBeInstanceOf(Promise);
|
|
283
|
+
expect(attentionPromise).toBeInstanceOf(Promise);
|
|
284
|
+
expect(errorPromise).toBeInstanceOf(Promise);
|
|
285
|
+
|
|
286
|
+
await Promise.all([
|
|
287
|
+
infoPromise,
|
|
288
|
+
successPromise,
|
|
289
|
+
attentionPromise,
|
|
290
|
+
errorPromise,
|
|
291
|
+
]);
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export interface ToastManager {
|
|
2
|
+
show: (props: ToastProps) => ToastInstance;
|
|
3
|
+
close: (id: string) => void;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface ToastButton {
|
|
7
|
+
text: string;
|
|
8
|
+
action: () => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type ToastType = 'informational' | 'attention' | 'success' | 'error';
|
|
12
|
+
|
|
13
|
+
export interface ToastProps extends ToastOptions {
|
|
14
|
+
title: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ToastOptions {
|
|
19
|
+
type?: ToastType;
|
|
20
|
+
button?: ToastButton;
|
|
21
|
+
timeout?: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ToastEmits {
|
|
25
|
+
close: [];
|
|
26
|
+
destroy: [];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ToastInstance {
|
|
30
|
+
id: string;
|
|
31
|
+
props: ToastProps;
|
|
32
|
+
close: () => void;
|
|
33
|
+
promise: Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ToastCall {
|
|
37
|
+
info: (
|
|
38
|
+
title: string,
|
|
39
|
+
description?: string,
|
|
40
|
+
options?: ToastOptions,
|
|
41
|
+
) => Promise<void>;
|
|
42
|
+
success: (
|
|
43
|
+
title: string,
|
|
44
|
+
description?: string,
|
|
45
|
+
options?: ToastOptions,
|
|
46
|
+
) => Promise<void>;
|
|
47
|
+
attention: (
|
|
48
|
+
title: string,
|
|
49
|
+
description?: string,
|
|
50
|
+
options?: ToastOptions,
|
|
51
|
+
) => Promise<void>;
|
|
52
|
+
error: (
|
|
53
|
+
title: string,
|
|
54
|
+
description?: string,
|
|
55
|
+
options?: ToastOptions,
|
|
56
|
+
) => Promise<void>;
|
|
57
|
+
}
|
|
@@ -1,48 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}"
|
|
8
|
-
@mouseover="handleResize"
|
|
9
|
-
>
|
|
10
|
-
<slot />
|
|
11
|
-
<span
|
|
12
|
-
v-show="enabled || forceOpen"
|
|
13
|
-
ref="label"
|
|
14
|
-
:class="['unnnic-tooltip-label', `unnnic-tooltip-label-${side}`]"
|
|
15
|
-
:style="{ maxWidth: maxWidth, left: leftPos, top: topPos }"
|
|
16
|
-
data-testid="tooltip-label"
|
|
2
|
+
<TooltipProvider>
|
|
3
|
+
<Tooltip
|
|
4
|
+
:disabled="!(enabled || forceOpen)"
|
|
5
|
+
:open="forceOpen || undefined"
|
|
6
|
+
data-testid="tooltip-wrapper"
|
|
17
7
|
>
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</template>
|
|
22
|
-
<template
|
|
23
|
-
v-for="(line, index) in text.split('\n')"
|
|
24
|
-
v-else
|
|
25
|
-
:key="index"
|
|
26
|
-
>
|
|
27
|
-
{{ line }}
|
|
28
|
-
<br />
|
|
29
|
-
</template>
|
|
8
|
+
<TooltipTrigger data-testid="tooltip-trigger">
|
|
9
|
+
<slot />
|
|
10
|
+
</TooltipTrigger>
|
|
30
11
|
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
12
|
+
<TooltipContent
|
|
13
|
+
:class="['unnnic-tooltip-label', `unnnic-tooltip-label-${side}`]"
|
|
14
|
+
:style="{ maxWidth: maxWidth }"
|
|
15
|
+
:side="side"
|
|
16
|
+
data-testid="tooltip-content"
|
|
17
|
+
>
|
|
18
|
+
<template v-if="enableHtml">
|
|
19
|
+
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
20
|
+
<section
|
|
21
|
+
v-html="text"
|
|
22
|
+
data-testid="tooltip-html-content"
|
|
23
|
+
></section>
|
|
24
|
+
</template>
|
|
25
|
+
<template
|
|
26
|
+
v-for="(line, index) in text.split('\n')"
|
|
27
|
+
v-else
|
|
28
|
+
:key="index"
|
|
35
29
|
>
|
|
36
|
-
{{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
{{ line }}
|
|
31
|
+
<br />
|
|
32
|
+
</template>
|
|
33
|
+
</TooltipContent>
|
|
34
|
+
</Tooltip>
|
|
35
|
+
</TooltipProvider>
|
|
41
36
|
</template>
|
|
42
37
|
|
|
43
38
|
<script>
|
|
39
|
+
import { Tooltip, TooltipProvider } from '../ui/tooltip';
|
|
40
|
+
import TooltipContent from '../ui/tooltip/TooltipContent.vue';
|
|
41
|
+
import TooltipTrigger from '../ui/tooltip/TooltipTrigger.vue';
|
|
42
|
+
|
|
44
43
|
export default {
|
|
45
44
|
name: 'UnnnicTooltip',
|
|
45
|
+
components: {
|
|
46
|
+
Tooltip,
|
|
47
|
+
TooltipProvider,
|
|
48
|
+
TooltipTrigger,
|
|
49
|
+
TooltipContent,
|
|
50
|
+
},
|
|
46
51
|
props: {
|
|
47
52
|
text: {
|
|
48
53
|
type: String,
|
|
@@ -67,162 +72,10 @@ export default {
|
|
|
67
72
|
type: String,
|
|
68
73
|
default: '',
|
|
69
74
|
},
|
|
70
|
-
shortcutText: {
|
|
71
|
-
type: String,
|
|
72
|
-
default: null,
|
|
73
|
-
},
|
|
74
75
|
enableHtml: {
|
|
75
76
|
type: Boolean,
|
|
76
77
|
default: false,
|
|
77
78
|
},
|
|
78
79
|
},
|
|
79
|
-
data() {
|
|
80
|
-
return {
|
|
81
|
-
topPos: null,
|
|
82
|
-
leftPos: null,
|
|
83
|
-
};
|
|
84
|
-
},
|
|
85
|
-
watch: {
|
|
86
|
-
side() {
|
|
87
|
-
this.getRightPost(this.$refs.tooltip);
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
mounted() {
|
|
91
|
-
this.handleResize();
|
|
92
|
-
|
|
93
|
-
window.addEventListener('scroll', this.handleResize);
|
|
94
|
-
window.addEventListener('resize', this.handleResize);
|
|
95
|
-
},
|
|
96
|
-
unmounted() {
|
|
97
|
-
window.removeEventListener('scroll', this.handleResize);
|
|
98
|
-
window.removeEventListener('resize', this.handleResize);
|
|
99
|
-
},
|
|
100
|
-
methods: {
|
|
101
|
-
handleResize() {
|
|
102
|
-
this.getRightPost(this.$refs.tooltip);
|
|
103
|
-
},
|
|
104
|
-
getRightPost(element) {
|
|
105
|
-
const elementPos = element.getBoundingClientRect();
|
|
106
|
-
|
|
107
|
-
if (element && this.$refs.label) {
|
|
108
|
-
if (this.side === 'right') {
|
|
109
|
-
this.leftPos = `${elementPos.x + elementPos.width + 8}px`;
|
|
110
|
-
this.topPos = `${elementPos.y + elementPos.height / 2 - this.$refs.label.offsetHeight / 2}px`;
|
|
111
|
-
} else if (this.side === 'left') {
|
|
112
|
-
this.leftPos = `${elementPos.x - this.$refs.label.offsetWidth - 8}px`;
|
|
113
|
-
this.topPos = `${elementPos.y + elementPos.height / 2 - this.$refs.label.offsetHeight / 2}px`;
|
|
114
|
-
} else if (this.side === 'top') {
|
|
115
|
-
this.leftPos = `${elementPos.x + elementPos.width / 2 - this.$refs.label.clientWidth / 2}px`;
|
|
116
|
-
this.topPos = `${elementPos.y - this.$refs.label.offsetHeight - 8}px`;
|
|
117
|
-
} else if (this.side === 'bottom') {
|
|
118
|
-
this.leftPos = `${elementPos.x + elementPos.width / 2 - this.$refs.label.clientWidth / 2}px`;
|
|
119
|
-
this.topPos = `${elementPos.y + elementPos.height + 8}px`;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
80
|
};
|
|
125
81
|
</script>
|
|
126
|
-
|
|
127
|
-
<style lang="scss" scoped>
|
|
128
|
-
@use '@/assets/scss/unnnic' as *;
|
|
129
|
-
|
|
130
|
-
.unnnic-tooltip {
|
|
131
|
-
position: relative;
|
|
132
|
-
display: inline-block;
|
|
133
|
-
overflow-wrap: break-word;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.unnnic-tooltip-label {
|
|
137
|
-
z-index: 1;
|
|
138
|
-
visibility: hidden;
|
|
139
|
-
text-align: center;
|
|
140
|
-
position: fixed;
|
|
141
|
-
width: max-content;
|
|
142
|
-
min-width: 2 * $unnnic-font-size;
|
|
143
|
-
box-sizing: border-box;
|
|
144
|
-
width: auto;
|
|
145
|
-
display: flex;
|
|
146
|
-
justify-content: center;
|
|
147
|
-
gap: $unnnic-spacing-xs;
|
|
148
|
-
align-items: center;
|
|
149
|
-
|
|
150
|
-
background-color: $unnnic-color-neutral-black;
|
|
151
|
-
color: $unnnic-color-neutral-snow;
|
|
152
|
-
border-radius: $unnnic-border-radius-sm;
|
|
153
|
-
padding: $unnnic-inset-nano;
|
|
154
|
-
box-shadow: $unnnic-shadow-level-near;
|
|
155
|
-
font-size: $unnnic-font-size-body-md;
|
|
156
|
-
font-family: $unnnic-font-family-secondary;
|
|
157
|
-
font-weight: $unnnic-font-weight-regular;
|
|
158
|
-
line-height: ($unnnic-font-size-body-md + $unnnic-line-height-medium);
|
|
159
|
-
|
|
160
|
-
&::after {
|
|
161
|
-
content: '';
|
|
162
|
-
position: absolute;
|
|
163
|
-
border-width: 5px;
|
|
164
|
-
border-style: solid;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
&-top {
|
|
168
|
-
position: fixed;
|
|
169
|
-
&::after {
|
|
170
|
-
top: 100%;
|
|
171
|
-
left: 50%;
|
|
172
|
-
margin-left: -5px;
|
|
173
|
-
border-color: $unnnic-color-neutral-black transparent transparent
|
|
174
|
-
transparent;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
&-bottom {
|
|
179
|
-
position: fixed;
|
|
180
|
-
&::after {
|
|
181
|
-
bottom: 100%;
|
|
182
|
-
left: 50%;
|
|
183
|
-
margin-left: -5px;
|
|
184
|
-
border-color: transparent transparent $unnnic-color-neutral-black
|
|
185
|
-
transparent;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
&-right {
|
|
189
|
-
position: fixed;
|
|
190
|
-
&::after {
|
|
191
|
-
top: 50%;
|
|
192
|
-
right: 100%;
|
|
193
|
-
margin-top: -5px;
|
|
194
|
-
border-color: transparent $unnnic-color-neutral-black transparent
|
|
195
|
-
transparent;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
&-left {
|
|
199
|
-
position: fixed;
|
|
200
|
-
&::after {
|
|
201
|
-
top: 50%;
|
|
202
|
-
left: 100%;
|
|
203
|
-
margin-top: -5px;
|
|
204
|
-
border-color: transparent transparent transparent
|
|
205
|
-
$unnnic-color-neutral-black;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
&-shortcut {
|
|
210
|
-
background-color: $unnnic-color-neutral-darkest;
|
|
211
|
-
border-radius: $unnnic-border-radius-sm;
|
|
212
|
-
padding: calc($unnnic-inset-nano / 2) $unnnic-inset-nano;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.unnnic-tooltip.force-open {
|
|
217
|
-
.unnnic-tooltip-label {
|
|
218
|
-
visibility: visible;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.unnnic-tooltip:hover {
|
|
223
|
-
.unnnic-tooltip-label {
|
|
224
|
-
visibility: visible;
|
|
225
|
-
width: auto;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
</style>
|