@weni/unnnic-system 3.7.1 → 3.8.2-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 +16 -1
- 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 +2 -2
- package/dist/components/AudioRecorder/AudioPlayer.vue.d.ts +1 -1
- package/dist/components/AudioRecorder/AudioRecorder.vue.d.ts +5 -5
- 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 +1 -1
- 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 +5 -5
- package/dist/components/Card/BlankCard.vue.d.ts +1 -1
- package/dist/components/Card/Card.vue.d.ts +27 -27
- package/dist/components/Card/CardCompany.vue.d.ts +5 -5
- package/dist/components/Card/CardData.vue.d.ts +1 -1
- package/dist/components/Card/CardStatusesContainer.vue.d.ts +5 -5
- package/dist/components/Card/ContentCard.vue.d.ts +3 -3
- package/dist/components/Card/DashCard.vue.d.ts +5 -5
- package/dist/components/Card/DefaultCard.vue.d.ts +1 -1
- package/dist/components/Card/MarketplaceCard.vue.d.ts +2 -2
- package/dist/components/Card/SimpleCard.vue.d.ts +3 -3
- package/dist/components/Card/StatusCard.vue.d.ts +2 -2
- package/dist/components/Card/TitleCard.vue.d.ts +3 -3
- package/dist/components/CardImage/CardImage.vue.d.ts +24 -31
- package/dist/components/CardInformation/CardInformation.vue.d.ts +5 -5
- package/dist/components/CardProject/CardProject.vue.d.ts +3 -3
- package/dist/components/Carousel/Carousel.vue.d.ts +7 -7
- package/dist/components/Carousel/TagCarousel.vue.d.ts +6 -6
- package/dist/components/ChartBar/ChartBar.vue.d.ts +5 -5
- package/dist/components/ChartLine/ChartLine.vue.d.ts +1 -1
- package/dist/components/ChatText/ChatText.vue.d.ts +2 -2
- package/dist/components/ChatsContact/ChatsContact.vue.d.ts +27 -34
- 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 +5 -5
- 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 +2 -2
- package/dist/components/Checkbox/Checkbox.vue.d.ts +19 -26
- 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 +2 -2
- package/dist/components/DataTable/index.vue.d.ts +1 -1
- package/dist/components/DataTable/index.vue.d.ts.map +1 -1
- package/dist/components/DateFilter/DateFilter.vue.d.ts +251 -41
- package/dist/components/DatePicker/DatePicker.vue.d.ts +4 -4
- package/dist/components/Drawer/Drawer.vue.d.ts +4 -4
- package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -1
- 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 +51 -28
- 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 +4 -4
- package/dist/components/Input/BaseInput.vue.d.ts +33 -2
- package/dist/components/Input/BaseInput.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +251 -41
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/Input/TextInput.vue.d.ts +85 -25
- package/dist/components/Input/TextInput.vue.d.ts.map +1 -1
- package/dist/components/InputDatePicker/InputDatePicker.vue.d.ts +257 -47
- package/dist/components/InputNext/InputNext.vue.d.ts +5 -5
- 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 +2 -2
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts +199 -34
- package/dist/components/ModalDialog/ModalDialog.vue.d.ts.map +1 -1
- package/dist/components/ModalNext/ModalNext.vue.d.ts +256 -46
- package/dist/components/ModalUpload/ModalUpload.vue.d.ts +8 -8
- package/dist/components/MoodRating/MoodRating.vue.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.vue.d.ts +20 -14
- package/dist/components/Pagination/Pagination.vue.d.ts +3 -3
- package/dist/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
- package/dist/components/Radio/Radio.vue.d.ts +8 -6
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +113 -60
- package/dist/components/SelectSmart/SelectSmartMultipleHeader.vue.d.ts +5 -5
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +21 -28
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts.map +1 -1
- package/dist/components/SelectTime/index.vue.d.ts +85 -25
- package/dist/components/SkeletonLoading/skeletonTheme.vue.d.ts +1 -1
- package/dist/components/Slider/Slider.vue.d.ts +2 -2
- package/dist/components/StarRating/StarRating.vue.d.ts +1 -1
- package/dist/components/Switch/Switch.vue.d.ts +55 -21
- package/dist/components/Switch/Switch.vue.d.ts.map +1 -1
- package/dist/components/Tab/Tab.vue.d.ts +13 -2
- package/dist/components/TableNext/TableBodyCell.vue.d.ts +2 -2
- package/dist/components/TableNext/TablePagination.vue.d.ts +3 -3
- package/dist/components/TabsExpanded/TabsExpanded.vue.d.ts +1 -1
- package/dist/components/Tag/BrandTag.vue.d.ts +1 -1
- package/dist/components/Tag/DefaultTag.vue.d.ts +1 -1
- package/dist/components/Tag/IndicatorTag.vue.d.ts +2 -2
- package/dist/components/Tag/Tag.vue.d.ts +5 -5
- package/dist/components/TextArea/TextArea.vue.d.ts +66 -30
- 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 +1 -1
- package/dist/components/Tour/Tour.vue.d.ts +3 -3
- package/dist/components/Tour/TourPopover.vue.d.ts +3 -3
- package/dist/components/UploadArea/UploadArea.vue.d.ts +4 -4
- package/dist/components/index.d.ts +3993 -1340
- 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 +40 -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/popover/Popover.vue.d.ts +23 -0
- package/dist/components/ui/popover/Popover.vue.d.ts.map +1 -0
- package/dist/components/ui/popover/PopoverContent.vue.d.ts +28 -0
- package/dist/components/ui/popover/PopoverContent.vue.d.ts.map +1 -0
- package/dist/components/ui/popover/PopoverFooter.vue.d.ts +18 -0
- package/dist/components/ui/popover/PopoverFooter.vue.d.ts.map +1 -0
- package/dist/components/ui/popover/PopoverTrigger.vue.d.ts +19 -0
- package/dist/components/ui/popover/PopoverTrigger.vue.d.ts.map +1 -0
- package/dist/components/ui/popover/index.d.ts +6 -0
- package/dist/components/ui/popover/index.d.ts.map +1 -0
- package/dist/{es-484b4c46.mjs → es-4bdcf86e.mjs} +1 -1
- package/dist/{index-dc007393.mjs → index-0d6fa367.mjs} +18908 -11929
- package/dist/locales/en.json.d.ts +2 -1
- package/dist/locales/es.json.d.ts +2 -1
- package/dist/locales/pt_br.json.d.ts +2 -1
- package/dist/{pt-br-f73c4b3a.mjs → pt-br-51af7f2a.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +197 -172
- package/dist/unnnic.umd.js +56 -50
- 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/SIMPLE_MIGRATION_GUIDE.md +152 -0
- 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__/Version1dot1.spec.js.snap +2 -2
- package/src/components/Button/Button.vue +68 -117
- package/src/components/Button/types.ts +0 -1
- package/src/components/Checkbox/Checkbox.vue +98 -64
- package/src/components/Checkbox/__tests__/Checkbox.spec.js +6 -21
- package/src/components/CheckboxGroup/CheckboxGroup.vue +96 -0
- package/src/components/FormElement/FormElement.vue +63 -93
- package/src/components/Icon.vue +2 -0
- package/src/components/Input/BaseInput.vue +33 -14
- package/src/components/Input/Input.scss +20 -21
- package/src/components/Input/Input.vue +79 -56
- package/src/components/Input/TextInput.vue +80 -68
- 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 +60 -146
- package/src/components/ModalDialog/__tests__/__snapshots__/ModalDialog.spec.js.snap +1 -22
- package/src/components/Popover/__tests__/Popover.spec.js +147 -0
- package/src/components/Popover/__tests__/__snapshots__/Popover.spec.js.snap +8 -0
- package/src/components/Popover/index.vue +146 -0
- package/src/components/Radio/Radio.vue +80 -67
- package/src/components/Radio/__test__/Radio.spec.js +14 -20
- package/src/components/Radio/__test__/__snapshots__/Radio.spec.js.snap +3 -3
- package/src/components/RadioGroup/RadioGroup.vue +142 -0
- package/src/components/Select/SelectOption.vue +65 -0
- package/src/components/Select/__tests__/Select.spec.js +412 -0
- package/src/components/Select/__tests__/SelectItem.spec.js +330 -0
- package/src/components/Select/__tests__/SelectOption.spec.js +174 -0
- package/src/components/Select/__tests__/__snapshots__/Select.spec.js.snap +97 -0
- package/src/components/Select/__tests__/__snapshots__/SelectItem.spec.js.snap +15 -0
- package/src/components/Select/__tests__/__snapshots__/SelectOption.spec.js.snap +25 -0
- package/src/components/Select/index.vue +245 -0
- package/src/components/SelectSmart/SelectSmart.vue +4 -3
- package/src/components/Switch/Switch.vue +123 -96
- 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 +1 -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/TextArea/TextArea.vue +34 -11
- 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 +284 -0
- package/src/components/Toast/__tests__/ToastManager.spec.js +294 -0
- package/src/components/Toast/types.ts +57 -0
- package/src/components/index.ts +61 -9
- 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 +114 -0
- package/src/components/ui/dialog/DialogFooter.vue +46 -0
- package/src/components/ui/dialog/DialogHeader.vue +78 -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/popover/Popover.vue +19 -0
- package/src/components/ui/popover/PopoverContent.vue +109 -0
- package/src/components/ui/popover/PopoverFooter.vue +32 -0
- package/src/components/ui/popover/PopoverTrigger.vue +23 -0
- package/src/components/ui/popover/index.ts +5 -0
- package/src/locales/en.json +2 -1
- package/src/locales/es.json +2 -1
- package/src/locales/pt_br.json +2 -1
- 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/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/Popover.stories.js +396 -0
- package/src/stories/RadioGroup.stories.js +144 -0
- package/src/stories/Select.stories.js +158 -0
- package/src/stories/Switch.stories.js +10 -5
- package/src/stories/Tab.stories.js +11 -4
- package/src/stories/TextArea.stories.js +13 -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/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/index.ts
CHANGED
|
@@ -25,6 +25,7 @@ import cardImage from './CardImage/CardImage.vue';
|
|
|
25
25
|
import cardProject from './CardProject/CardProject.vue';
|
|
26
26
|
import cardInformation from './CardInformation/CardInformation.vue';
|
|
27
27
|
import checkbox from './Checkbox/Checkbox.vue';
|
|
28
|
+
import checkboxGroup from './CheckboxGroup/CheckboxGroup.vue';
|
|
28
29
|
import collapse from './Collapse/Collapse.vue';
|
|
29
30
|
import radio from './Radio/Radio.vue';
|
|
30
31
|
import languageSelect from './Dropdown/LanguageSelect.vue';
|
|
@@ -88,10 +89,23 @@ import ModalDialog from './ModalDialog/ModalDialog.vue';
|
|
|
88
89
|
import Tour from './Tour/Tour.vue';
|
|
89
90
|
import Navigator from './Navigator/index.vue';
|
|
90
91
|
import SelectTime from './SelectTime/index.vue';
|
|
91
|
-
import DataTable from './DataTable/index.vue';
|
|
92
|
-
import Chip from './Chip/Chip.vue';
|
|
93
92
|
import TemplatePreview from './TemplatePreview/TemplatePreview.vue';
|
|
94
93
|
import TemplatePreviewModal from './TemplatePreview/TemplatePreviewModal.vue';
|
|
94
|
+
import DataTable from './DataTable/index.vue';
|
|
95
|
+
import Chip from './Chip/Chip.vue';
|
|
96
|
+
import Toast from './Toast/Toast.vue';
|
|
97
|
+
import { toast } from './Toast/ToastManager';
|
|
98
|
+
import Popover from './ui/popover/Popover.vue';
|
|
99
|
+
import PopoverContent from './ui/popover/PopoverContent.vue';
|
|
100
|
+
import PopoverTrigger from './ui/popover/PopoverTrigger.vue';
|
|
101
|
+
import PopoverFooter from './ui/popover/PopoverFooter.vue';
|
|
102
|
+
import Dialog from './ui/dialog/Dialog.vue';
|
|
103
|
+
import DialogContent from './ui/dialog/DialogContent.vue';
|
|
104
|
+
import DialogFooter from './ui/dialog/DialogFooter.vue';
|
|
105
|
+
import DialogHeader from './ui/dialog/DialogHeader.vue';
|
|
106
|
+
import DialogTitle from './ui/dialog/DialogTitle.vue';
|
|
107
|
+
import DialogTrigger from './ui/dialog/DialogTrigger.vue';
|
|
108
|
+
import DialogClose from './ui/dialog/DialogClose.vue';
|
|
95
109
|
|
|
96
110
|
type VueComponent = Component;
|
|
97
111
|
|
|
@@ -126,6 +140,7 @@ export const components: ComponentsMap = {
|
|
|
126
140
|
unnnicCardProject: cardProject,
|
|
127
141
|
unnnicCardInformation: cardInformation,
|
|
128
142
|
unnnicCheckbox: checkbox,
|
|
143
|
+
unnnicCheckboxGroup: checkboxGroup,
|
|
129
144
|
unnnicCollapse: collapse,
|
|
130
145
|
unnnicRadio: radio,
|
|
131
146
|
unnnicLanguageSelect: languageSelect,
|
|
@@ -194,6 +209,18 @@ export const components: ComponentsMap = {
|
|
|
194
209
|
unnnicTemplatePreviewModal: TemplatePreviewModal,
|
|
195
210
|
unnnicDataTable: DataTable,
|
|
196
211
|
unnnicChip: Chip,
|
|
212
|
+
unnnicToast: Toast,
|
|
213
|
+
unnnicToastManager: toast,
|
|
214
|
+
unnnicPopover: Popover,
|
|
215
|
+
unnnicPopoverContent: PopoverContent,
|
|
216
|
+
unnnicPopoverTrigger: PopoverTrigger,
|
|
217
|
+
unnnicDialog: Dialog,
|
|
218
|
+
unnnicDialogContent: DialogContent,
|
|
219
|
+
unnnicDialogFooter: DialogFooter,
|
|
220
|
+
unnnicDialogHeader: DialogHeader,
|
|
221
|
+
unnnicDialogTitle: DialogTitle,
|
|
222
|
+
unnnicDialogTrigger: DialogTrigger,
|
|
223
|
+
unnnicDialogClose: DialogClose,
|
|
197
224
|
};
|
|
198
225
|
|
|
199
226
|
export const unnnicFontSize = fontSize;
|
|
@@ -223,6 +250,7 @@ export const unnnicCardImage = cardImage as VueComponent;
|
|
|
223
250
|
export const unnnicCardProject = cardProject as VueComponent;
|
|
224
251
|
export const unnnicCardInformation = cardInformation;
|
|
225
252
|
export const unnnicCheckbox = checkbox;
|
|
253
|
+
export const unnnicCheckboxGroup = checkboxGroup;
|
|
226
254
|
export const unnnicCollapse = collapse;
|
|
227
255
|
export const unnnicRadio = radio;
|
|
228
256
|
export const unnniclanguageSelect = languageSelect as VueComponent;
|
|
@@ -245,7 +273,7 @@ export const unnnicAccordion = accordion;
|
|
|
245
273
|
export const unnnicIndicator = indicator;
|
|
246
274
|
export const unnnicSkeletonLoading = skeletonLoading;
|
|
247
275
|
export const unnnicCarousel = carousel;
|
|
248
|
-
export const unnnicLabel = label;
|
|
276
|
+
export const unnnicLabel = label as VueComponent;
|
|
249
277
|
export const unnnicTab = tab;
|
|
250
278
|
export const unnnicTabsExpanded = tabsExpanded;
|
|
251
279
|
export const unnnicBanner = banner;
|
|
@@ -286,14 +314,24 @@ export const unnnicDrawer = Drawer;
|
|
|
286
314
|
export const unnnicTableNext = TableNext;
|
|
287
315
|
export const unnnicTour = Tour;
|
|
288
316
|
export const unnnicNavigator = Navigator;
|
|
289
|
-
export const unnnicDataTable = DataTable as VueComponent;
|
|
290
317
|
export const unnnicSelectTime = SelectTime as VueComponent;
|
|
291
|
-
export const unnnicChip = Chip;
|
|
292
318
|
export const unnnicTemplatePreview = TemplatePreview as VueComponent;
|
|
293
319
|
export const unnnicTemplatePreviewModal = TemplatePreviewModal as VueComponent;
|
|
320
|
+
export const unnnicDataTable = DataTable as VueComponent;
|
|
321
|
+
export const unnnicChip = Chip;
|
|
322
|
+
export const unnnicPopover = Popover;
|
|
323
|
+
export const unnnicPopoverContent = PopoverContent;
|
|
324
|
+
export const unnnicPopoverTrigger = PopoverTrigger;
|
|
325
|
+
export const unnnicPopoverFooter = PopoverFooter;
|
|
326
|
+
export const unnnicDialog = Dialog;
|
|
327
|
+
export const unnnicDialogContent = DialogContent;
|
|
328
|
+
export const unnnicDialogFooter = DialogFooter;
|
|
329
|
+
export const unnnicDialogHeader = DialogHeader;
|
|
330
|
+
export const unnnicDialogTitle = DialogTitle;
|
|
331
|
+
export const unnnicDialogTrigger = DialogTrigger;
|
|
332
|
+
export const unnnicDialogClose = DialogClose;
|
|
294
333
|
|
|
295
334
|
export const UnnnicFontSize = fontSize;
|
|
296
|
-
export const UnnnicFormElement = formElement;
|
|
297
335
|
export const UnnnicInput = input;
|
|
298
336
|
export const UnnnicInputNext = inputNext;
|
|
299
337
|
export const UnnnicInputDatePicker = inputDatePicker;
|
|
@@ -319,6 +357,7 @@ export const UnnnicCardImage = cardImage as VueComponent;
|
|
|
319
357
|
export const UnnnicCardProject = cardProject as VueComponent;
|
|
320
358
|
export const UnnnicCardInformation = cardInformation;
|
|
321
359
|
export const UnnnicCheckbox = checkbox;
|
|
360
|
+
export const UnnnicCheckboxGroup = checkboxGroup;
|
|
322
361
|
export const UnnnicCollapse = collapse;
|
|
323
362
|
export const UnnnicRadio = radio;
|
|
324
363
|
export const UnnniclanguageSelect = languageSelect as VueComponent;
|
|
@@ -341,7 +380,7 @@ export const UnnnicAccordion = accordion;
|
|
|
341
380
|
export const UnnnicIndicator = indicator;
|
|
342
381
|
export const UnnnicSkeletonLoading = skeletonLoading;
|
|
343
382
|
export const UnnnicCarousel = carousel;
|
|
344
|
-
export const UnnnicLabel = label;
|
|
383
|
+
export const UnnnicLabel = label as VueComponent;
|
|
345
384
|
export const UnnnicTab = tab;
|
|
346
385
|
export const UnnnicTabsExpanded = tabsExpanded;
|
|
347
386
|
export const UnnnicBanner = banner;
|
|
@@ -382,8 +421,21 @@ export const UnnnicDrawer = Drawer;
|
|
|
382
421
|
export const UnnnicTableNext = TableNext;
|
|
383
422
|
export const UnnnicTour = Tour;
|
|
384
423
|
export const UnnnicNavigator = Navigator;
|
|
385
|
-
export const UnnnicDataTable = DataTable as VueComponent;
|
|
386
424
|
export const UnnnicSelectTime = SelectTime as VueComponent;
|
|
387
|
-
export const UnnnicChip = Chip;
|
|
388
425
|
export const UnnnicTemplatePreview = TemplatePreview as VueComponent;
|
|
389
426
|
export const UnnnicTemplatePreviewModal = TemplatePreviewModal as VueComponent;
|
|
427
|
+
export const UnnnicDataTable = DataTable as VueComponent;
|
|
428
|
+
export const UnnnicChip = Chip;
|
|
429
|
+
export const UnnnicToast = Toast;
|
|
430
|
+
export const UnnnicToastManager = toast;
|
|
431
|
+
export const UnnnicPopover = Popover;
|
|
432
|
+
export const UnnnicPopoverContent = PopoverContent;
|
|
433
|
+
export const UnnnicPopoverTrigger = PopoverTrigger;
|
|
434
|
+
export const UnnnicPopoverFooter = PopoverFooter;
|
|
435
|
+
export const UnnnicDialog = Dialog;
|
|
436
|
+
export const UnnnicDialogContent = DialogContent;
|
|
437
|
+
export const UnnnicDialogFooter = DialogFooter;
|
|
438
|
+
export const UnnnicDialogHeader = DialogHeader;
|
|
439
|
+
export const UnnnicDialogTitle = DialogTitle;
|
|
440
|
+
export const UnnnicDialogTrigger = DialogTrigger;
|
|
441
|
+
export const UnnnicDialogClose = DialogClose;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogRootEmits, DialogRootProps } from 'reka-ui';
|
|
3
|
+
import { DialogRoot, useForwardPropsEmits } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogRootProps>();
|
|
6
|
+
const emits = defineEmits<DialogRootEmits>();
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DialogRoot v-bind="forwarded">
|
|
13
|
+
<slot />
|
|
14
|
+
</DialogRoot>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogCloseProps } from 'reka-ui';
|
|
3
|
+
import { DialogClose } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogCloseProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DialogClose
|
|
10
|
+
class="unnnic-dialog-close"
|
|
11
|
+
v-bind="props"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</DialogClose>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<style lang="scss" scoped>
|
|
18
|
+
@use '@/assets/scss/unnnic' as *;
|
|
19
|
+
|
|
20
|
+
.unnnic-dialog-close {
|
|
21
|
+
> * {
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
</style>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogContentEmits, DialogContentProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import {
|
|
6
|
+
DialogContent,
|
|
7
|
+
DialogOverlay,
|
|
8
|
+
DialogPortal,
|
|
9
|
+
useForwardPropsEmits,
|
|
10
|
+
} from 'reka-ui';
|
|
11
|
+
import { cn } from '@/lib/utils';
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(
|
|
14
|
+
defineProps<
|
|
15
|
+
DialogContentProps & {
|
|
16
|
+
class?: HTMLAttributes['class'];
|
|
17
|
+
size?: 'small' | 'medium' | 'large';
|
|
18
|
+
}
|
|
19
|
+
>(),
|
|
20
|
+
{
|
|
21
|
+
size: 'medium',
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
|
+
const emits = defineEmits<DialogContentEmits>();
|
|
25
|
+
|
|
26
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
27
|
+
|
|
28
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<DialogPortal>
|
|
33
|
+
<DialogOverlay
|
|
34
|
+
class="unnnic-dialog-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
|
|
35
|
+
/>
|
|
36
|
+
<DialogContent
|
|
37
|
+
v-bind="forwarded"
|
|
38
|
+
:class="
|
|
39
|
+
cn(
|
|
40
|
+
'unnnic-dialog-content',
|
|
41
|
+
`unnnic-dialog-content--size-${props.size}`,
|
|
42
|
+
'duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]',
|
|
43
|
+
|
|
44
|
+
props.class,
|
|
45
|
+
)
|
|
46
|
+
"
|
|
47
|
+
>
|
|
48
|
+
<slot />
|
|
49
|
+
</DialogContent>
|
|
50
|
+
</DialogPortal>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<style lang="scss" scoped>
|
|
54
|
+
@use '@/assets/scss/unnnic' as *;
|
|
55
|
+
|
|
56
|
+
.unnnic-dialog-overlay {
|
|
57
|
+
position: fixed;
|
|
58
|
+
top: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
z-index: 9999;
|
|
61
|
+
|
|
62
|
+
width: 100vw;
|
|
63
|
+
height: 100vh;
|
|
64
|
+
background: rgba(53, 57, 69, 0.5);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.unnnic-dialog-content {
|
|
68
|
+
z-index: 10000;
|
|
69
|
+
|
|
70
|
+
position: fixed;
|
|
71
|
+
top: 50%;
|
|
72
|
+
left: 50%;
|
|
73
|
+
|
|
74
|
+
transform: translate(-50%, -50%);
|
|
75
|
+
|
|
76
|
+
width: 100%;
|
|
77
|
+
max-height: calc(100% - $unnnic-space-20);
|
|
78
|
+
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
|
|
82
|
+
box-shadow: $unnnic-shadow-2;
|
|
83
|
+
border-radius: $unnnic-radius-4;
|
|
84
|
+
background-color: $unnnic-color-bg-base;
|
|
85
|
+
|
|
86
|
+
&--size-small {
|
|
87
|
+
max-width: 360px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&--size-medium {
|
|
91
|
+
max-width: 560px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&--size-large {
|
|
95
|
+
max-width: 800px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
> * {
|
|
99
|
+
&::-webkit-scrollbar {
|
|
100
|
+
width: $unnnic-spacing-inline-nano;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&::-webkit-scrollbar-thumb {
|
|
104
|
+
background: $unnnic-color-neutral-cleanest;
|
|
105
|
+
border-radius: $unnnic-border-radius-pill;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&::-webkit-scrollbar-track {
|
|
109
|
+
background: $unnnic-color-neutral-soft;
|
|
110
|
+
border-radius: $unnnic-border-radius-pill;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(
|
|
6
|
+
defineProps<{ class?: HTMLAttributes['class']; divider?: boolean }>(),
|
|
7
|
+
{
|
|
8
|
+
divider: true,
|
|
9
|
+
},
|
|
10
|
+
);
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<footer
|
|
15
|
+
:class="
|
|
16
|
+
cn(
|
|
17
|
+
'unnnic-dialog-footer',
|
|
18
|
+
{ 'unnnic-dialog-footer--with-divider': props.divider },
|
|
19
|
+
props.class,
|
|
20
|
+
)
|
|
21
|
+
"
|
|
22
|
+
>
|
|
23
|
+
<slot />
|
|
24
|
+
</footer>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
@use '@/assets/scss/unnnic' as *;
|
|
29
|
+
|
|
30
|
+
.unnnic-dialog-footer {
|
|
31
|
+
display: flex;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: $unnnic-space-2;
|
|
35
|
+
|
|
36
|
+
padding: $unnnic-space-6;
|
|
37
|
+
|
|
38
|
+
&--with-divider {
|
|
39
|
+
border-top: 1px solid $unnnic-color-border-soft;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
> * {
|
|
43
|
+
width: 100%;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import { cn } from '@/lib/utils';
|
|
4
|
+
import UnnnicButton from '@/components/Button/Button.vue';
|
|
5
|
+
import DialogClose from './DialogClose.vue';
|
|
6
|
+
import UnnnicIcon, { SchemeColor } from '@/components/Icon.vue';
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<{
|
|
10
|
+
class?: HTMLAttributes['class'];
|
|
11
|
+
divider?: boolean;
|
|
12
|
+
type?: 'default' | 'success' | 'warning' | 'attention';
|
|
13
|
+
closeButton?: boolean;
|
|
14
|
+
}>(),
|
|
15
|
+
{
|
|
16
|
+
divider: true,
|
|
17
|
+
closeButton: true,
|
|
18
|
+
type: 'default',
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const iconsMapper = {
|
|
23
|
+
default: { icon: '', scheme: '' as SchemeColor },
|
|
24
|
+
success: { icon: 'check_circle', scheme: 'aux-green-500' as SchemeColor },
|
|
25
|
+
warning: { icon: 'warning', scheme: 'aux-red-500' as SchemeColor },
|
|
26
|
+
attention: { icon: 'error', scheme: 'aux-yellow-500' as SchemeColor },
|
|
27
|
+
};
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<header
|
|
32
|
+
:class="
|
|
33
|
+
cn(
|
|
34
|
+
'unnnic-dialog-header',
|
|
35
|
+
{ 'unnnic-dialog-header--with-divider': props.divider },
|
|
36
|
+
props.class,
|
|
37
|
+
)
|
|
38
|
+
"
|
|
39
|
+
>
|
|
40
|
+
<UnnnicIcon
|
|
41
|
+
v-if="iconsMapper[props.type]?.icon"
|
|
42
|
+
:icon="iconsMapper[props.type]?.icon"
|
|
43
|
+
:scheme="iconsMapper[props.type]?.scheme"
|
|
44
|
+
size="md"
|
|
45
|
+
/>
|
|
46
|
+
<slot />
|
|
47
|
+
|
|
48
|
+
<DialogClose
|
|
49
|
+
v-if="props.closeButton"
|
|
50
|
+
class="unnnic-dialog-header__close"
|
|
51
|
+
>
|
|
52
|
+
<UnnnicButton
|
|
53
|
+
type="tertiary"
|
|
54
|
+
iconCenter="close"
|
|
55
|
+
/>
|
|
56
|
+
</DialogClose>
|
|
57
|
+
</header>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<style lang="scss" scoped>
|
|
61
|
+
@use '@/assets/scss/unnnic' as *;
|
|
62
|
+
|
|
63
|
+
.unnnic-dialog-header {
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: $unnnic-space-2;
|
|
67
|
+
|
|
68
|
+
padding: $unnnic-space-6;
|
|
69
|
+
|
|
70
|
+
&--with-divider {
|
|
71
|
+
border-bottom: 1px solid $unnnic-color-border-soft;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&__close {
|
|
75
|
+
margin-left: auto;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogTitleProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { DialogTitle, useForwardProps } from 'reka-ui';
|
|
6
|
+
import { cn } from '@/lib/utils';
|
|
7
|
+
|
|
8
|
+
const props = defineProps<
|
|
9
|
+
DialogTitleProps & { class?: HTMLAttributes['class'] }
|
|
10
|
+
>();
|
|
11
|
+
|
|
12
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
13
|
+
|
|
14
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<DialogTitle
|
|
19
|
+
v-bind="forwardedProps"
|
|
20
|
+
:class="cn('unnnic-dialog-title', props.class)"
|
|
21
|
+
>
|
|
22
|
+
<slot />
|
|
23
|
+
</DialogTitle>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<style lang="scss" scoped>
|
|
27
|
+
@use '@/assets/scss/unnnic' as *;
|
|
28
|
+
|
|
29
|
+
.unnnic-dialog-title {
|
|
30
|
+
font: $unnnic-font-display-2;
|
|
31
|
+
color: $unnnic-color-fg-emphasized;
|
|
32
|
+
margin: 0;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogTriggerProps } from 'reka-ui';
|
|
3
|
+
import { DialogTrigger } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogTriggerProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DialogTrigger v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</DialogTrigger>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as Dialog } from './Dialog.vue';
|
|
2
|
+
export { default as DialogClose } from './DialogClose.vue';
|
|
3
|
+
export { default as DialogContent } from './DialogContent.vue';
|
|
4
|
+
export { default as DialogFooter } from './DialogFooter.vue';
|
|
5
|
+
export { default as DialogHeader } from './DialogHeader.vue';
|
|
6
|
+
export { default as DialogTitle } from './DialogTitle.vue';
|
|
7
|
+
export { default as DialogTrigger } from './DialogTrigger.vue';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PopoverRootEmits, PopoverRootProps } from 'reka-ui';
|
|
3
|
+
import { PopoverRoot, useForwardPropsEmits } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
defineOptions({
|
|
6
|
+
name: 'UnnnicPopover',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
const props = defineProps<PopoverRootProps>();
|
|
10
|
+
const emits = defineEmits<PopoverRootEmits>();
|
|
11
|
+
|
|
12
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<PopoverRoot v-bind="forwarded">
|
|
17
|
+
<slot />
|
|
18
|
+
</PopoverRoot>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<PopoverPortal>
|
|
3
|
+
<PopoverContent
|
|
4
|
+
v-bind="{ ...forwarded, ...$attrs }"
|
|
5
|
+
:class="
|
|
6
|
+
cn(
|
|
7
|
+
'unnnic-popover',
|
|
8
|
+
`unnnic-popover--size-${props.size}`,
|
|
9
|
+
'bg-popover text-popover-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
10
|
+
)
|
|
11
|
+
"
|
|
12
|
+
>
|
|
13
|
+
<section :class="`unnnic-popover__content ${props.class || ''}`">
|
|
14
|
+
<component
|
|
15
|
+
:is="child"
|
|
16
|
+
v-for="(child, index) in contentChildren"
|
|
17
|
+
:key="index"
|
|
18
|
+
/>
|
|
19
|
+
</section>
|
|
20
|
+
|
|
21
|
+
<component
|
|
22
|
+
:is="child"
|
|
23
|
+
v-for="(child, index) in footerChildren"
|
|
24
|
+
:key="index"
|
|
25
|
+
/>
|
|
26
|
+
</PopoverContent>
|
|
27
|
+
</PopoverPortal>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup lang="ts">
|
|
31
|
+
import type { PopoverContentEmits, PopoverContentProps } from 'reka-ui';
|
|
32
|
+
import type { HTMLAttributes, VNode } from 'vue';
|
|
33
|
+
import { computed, useSlots } from 'vue';
|
|
34
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
35
|
+
import { PopoverContent, PopoverPortal, useForwardPropsEmits } from 'reka-ui';
|
|
36
|
+
import { cn } from '@/lib/utils';
|
|
37
|
+
|
|
38
|
+
defineOptions({
|
|
39
|
+
inheritAttrs: false,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const props = withDefaults(
|
|
43
|
+
defineProps<
|
|
44
|
+
PopoverContentProps & {
|
|
45
|
+
class?: HTMLAttributes['class'];
|
|
46
|
+
size?: 'small' | 'medium' | 'large';
|
|
47
|
+
}
|
|
48
|
+
>(),
|
|
49
|
+
{
|
|
50
|
+
align: 'center',
|
|
51
|
+
sideOffset: 4,
|
|
52
|
+
size: 'medium',
|
|
53
|
+
class: '',
|
|
54
|
+
},
|
|
55
|
+
);
|
|
56
|
+
const emits = defineEmits<PopoverContentEmits>();
|
|
57
|
+
|
|
58
|
+
const delegatedProps = reactiveOmit(props, 'class', 'size');
|
|
59
|
+
|
|
60
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
61
|
+
|
|
62
|
+
const slots = useSlots();
|
|
63
|
+
|
|
64
|
+
const getComponentName = (vnode: VNode): string | undefined => {
|
|
65
|
+
const componentType = vnode.type as { name?: string; __name?: string };
|
|
66
|
+
return componentType?.name || componentType?.__name;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const contentChildren = computed(() => {
|
|
70
|
+
const defaultSlot = slots.default?.() || [];
|
|
71
|
+
return defaultSlot.filter(
|
|
72
|
+
(vnode: VNode) => getComponentName(vnode) !== 'UnnnicPopoverFooter',
|
|
73
|
+
);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const footerChildren = computed(() => {
|
|
77
|
+
const defaultSlot = slots.default?.() || [];
|
|
78
|
+
return defaultSlot.filter(
|
|
79
|
+
(vnode: VNode) => getComponentName(vnode) === 'UnnnicPopoverFooter',
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<style lang="scss">
|
|
85
|
+
@use '@/assets/scss/unnnic' as *;
|
|
86
|
+
|
|
87
|
+
$popover-space: $unnnic-space-4;
|
|
88
|
+
|
|
89
|
+
.unnnic-popover {
|
|
90
|
+
z-index: 10000;
|
|
91
|
+
|
|
92
|
+
border-radius: $unnnic-radius-2;
|
|
93
|
+
box-shadow: $unnnic-shadow-1;
|
|
94
|
+
|
|
95
|
+
&--size-small {
|
|
96
|
+
width: 240px;
|
|
97
|
+
}
|
|
98
|
+
&--size-medium {
|
|
99
|
+
width: 320px;
|
|
100
|
+
}
|
|
101
|
+
&--size-large {
|
|
102
|
+
width: 400px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&__content {
|
|
106
|
+
padding: $popover-space;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<footer class="unnnic-popover__footer">
|
|
3
|
+
<slot />
|
|
4
|
+
</footer>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script setup lang="ts">
|
|
8
|
+
defineOptions({
|
|
9
|
+
name: 'UnnnicPopoverFooter',
|
|
10
|
+
});
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<style lang="scss">
|
|
14
|
+
@use '@/assets/scss/unnnic' as *;
|
|
15
|
+
|
|
16
|
+
$popover-space: $unnnic-space-4;
|
|
17
|
+
|
|
18
|
+
.unnnic-popover__footer {
|
|
19
|
+
border-top: 1px solid $unnnic-color-border-soft;
|
|
20
|
+
|
|
21
|
+
padding: $popover-space;
|
|
22
|
+
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: $unnnic-space-2;
|
|
27
|
+
|
|
28
|
+
> * {
|
|
29
|
+
width: 100%;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PopoverTriggerProps } from 'reka-ui';
|
|
3
|
+
import { PopoverTrigger } from 'reka-ui';
|
|
4
|
+
|
|
5
|
+
const props = defineProps<PopoverTriggerProps>();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<PopoverTrigger
|
|
10
|
+
v-bind="props"
|
|
11
|
+
class="unnnic-popover-trigger"
|
|
12
|
+
>
|
|
13
|
+
<slot />
|
|
14
|
+
</PopoverTrigger>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<style scoped>
|
|
18
|
+
.unnnic-popover-trigger {
|
|
19
|
+
border: none;
|
|
20
|
+
background: transparent;
|
|
21
|
+
padding: 0;
|
|
22
|
+
}
|
|
23
|
+
</style>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as Popover } from './Popover.vue';
|
|
2
|
+
export { default as PopoverContent } from './PopoverContent.vue';
|
|
3
|
+
export { default as PopoverFooter } from './PopoverFooter.vue';
|
|
4
|
+
export { default as PopoverTrigger } from './PopoverTrigger.vue';
|
|
5
|
+
export { PopoverAnchor } from 'reka-ui';
|
package/src/locales/en.json
CHANGED