@dolanske/vui 1.0.1 → 1.0.3
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/LICENSE +673 -673
- package/README.md +42 -42
- package/dist/components/Accordion/Accordion.vue.d.ts +2 -3
- package/dist/components/Accordion/AccordionGroup.vue.d.ts +2 -5
- package/dist/components/Alert/Alert.vue.d.ts +2 -3
- package/dist/components/Avatar/Avatar.vue.d.ts +2 -3
- package/dist/components/Badge/Badge.vue.d.ts +2 -3
- package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +2 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.vue.d.ts +2 -3
- package/dist/components/Button/Button.vue.d.ts +2 -3
- package/dist/components/ButtonGroup/ButtonGroup.vue.d.ts +2 -3
- package/dist/components/Calendar/Calendar.vue.d.ts +6 -6
- package/dist/components/Card/Card.vue.d.ts +3 -4
- package/dist/components/Checkbox/Checkbox.vue.d.ts +6 -7
- package/dist/components/CopyClipboard/CopyClipboard.vue.d.ts +1 -2
- package/dist/components/Divider/Divider.vue.d.ts +2 -3
- package/dist/components/Drawer/Drawer.vue.d.ts +5 -6
- package/dist/components/Dropdown/Dropdown.vue.d.ts +3 -66
- package/dist/components/Dropdown/DropdownItem.vue.d.ts +2 -3
- package/dist/components/Dropdown/DropdownTitle.vue.d.ts +6 -6
- package/dist/components/Flex/Flex.vue.d.ts +2 -3
- package/dist/components/Grid/Grid.vue.d.ts +2 -3
- package/dist/components/Input/Color.vue.d.ts +5 -5
- package/dist/components/Input/Counter.vue.d.ts +5 -5
- package/dist/components/Input/Dropzone.vue.d.ts +10 -95
- package/dist/components/Input/File.vue.d.ts +3 -4
- package/dist/components/Input/Input.vue.d.ts +6 -7
- package/dist/components/Input/Password.vue.d.ts +1 -1
- package/dist/components/Input/Textarea.vue.d.ts +6 -7
- package/dist/components/Kbd/Kbd.vue.d.ts +1 -1
- package/dist/components/Kbd/KbdGroup.vue.d.ts +1 -2
- package/dist/components/Modal/Confirm.vue.d.ts +5 -6
- package/dist/components/Modal/Modal.vue.d.ts +5 -6
- package/dist/components/OTP/OTP.vue.d.ts +6 -7
- package/dist/components/OTP/OTPItem.vue.d.ts +1 -1
- package/dist/components/Pagination/Pagination.vue.d.ts +2 -3
- package/dist/components/Popout/Popout.vue.d.ts +2 -3
- package/dist/components/Progress/Progress.vue.d.ts +5 -5
- package/dist/components/Radio/Radio.vue.d.ts +6 -7
- package/dist/components/Radio/RadioGroup.vue.d.ts +6 -7
- package/dist/components/Select/Select.vue.d.ts +8 -4
- package/dist/components/Sheet/Sheet.vue.d.ts +5 -6
- package/dist/components/Sidebar/Sidebar.vue.d.ts +6 -7
- package/dist/components/Skeleton/Skeleton.vue.d.ts +1 -1
- package/dist/components/Spinner/Spinner.vue.d.ts +1 -1
- package/dist/components/Switch/Switch.vue.d.ts +6 -7
- package/dist/components/Table/Cell.vue.d.ts +2 -5
- package/dist/components/Table/Head.vue.d.ts +2 -3
- package/dist/components/Table/Root.vue.d.ts +2 -3
- package/dist/components/Table/table.d.ts +2 -2
- package/dist/components/Tabs/Tab.vue.d.ts +2 -3
- package/dist/components/Tabs/Tabs.vue.d.ts +6 -7
- package/dist/components/Toast/toast.d.ts +6 -6
- package/dist/components/Tooltip/Tooltip.vue.d.ts +1 -2
- package/dist/internal/Backdrop/Backdrop.vue.d.ts +2 -3
- package/dist/{vui.css → style.css} +1 -1
- package/dist/vui.js +5318 -5449
- package/package.json +72 -72
- package/src/App.vue +95 -95
- package/src/components/Accordion/Accordion.vue +91 -91
- package/src/components/Accordion/AccordionGroup.vue +43 -43
- package/src/components/Accordion/accordion.scss +82 -82
- package/src/components/Alert/Alert.vue +59 -59
- package/src/components/Alert/alert.scss +161 -161
- package/src/components/Avatar/Avatar.vue +53 -53
- package/src/components/Avatar/avatar.scss +52 -52
- package/src/components/Badge/Badge.vue +21 -21
- package/src/components/Badge/badge.scss +206 -206
- package/src/components/Breadcrumbs/BreadcrumbItem.vue +26 -26
- package/src/components/Breadcrumbs/Breadcrumbs.vue +30 -32
- package/src/components/Breadcrumbs/breadcrumbs.scss +31 -31
- package/src/components/Button/Button.vue +85 -85
- package/src/components/Button/button.scss +279 -279
- package/src/components/ButtonGroup/ButtonGroup.vue +28 -28
- package/src/components/ButtonGroup/button-group.scss +51 -51
- package/src/components/Calendar/Calendar.vue +66 -66
- package/src/components/Calendar/calendar.scss +83 -83
- package/src/components/Card/Card.vue +48 -48
- package/src/components/Card/card.scss +53 -53
- package/src/components/Checkbox/Checkbox.vue +54 -54
- package/src/components/Checkbox/checkbox.scss +80 -80
- package/src/components/CopyClipboard/CopyClipboard.vue +91 -91
- package/src/components/CopyClipboard/copy-clipboard.scss +25 -25
- package/src/components/Divider/Divider.vue +44 -44
- package/src/components/Divider/divider.scss +35 -35
- package/src/components/Drawer/Drawer.vue +97 -97
- package/src/components/Drawer/drawer.scss +37 -37
- package/src/components/Dropdown/Dropdown.vue +135 -135
- package/src/components/Dropdown/DropdownItem.vue +33 -33
- package/src/components/Dropdown/DropdownTitle.vue +14 -14
- package/src/components/Dropdown/dropdown-item.scss +84 -84
- package/src/components/Dropdown/dropdown.scss +53 -53
- package/src/components/Flex/Flex.vue +113 -113
- package/src/components/Grid/Grid.vue +80 -80
- package/src/components/Input/Color.vue +26 -26
- package/src/components/Input/Counter.vue +66 -66
- package/src/components/Input/Dropzone.vue +65 -65
- package/src/components/Input/File.vue +15 -15
- package/src/components/Input/Input.vue +123 -123
- package/src/components/Input/Password.vue +35 -35
- package/src/components/Input/Textarea.vue +78 -78
- package/src/components/Input/input.scss +302 -302
- package/src/components/Kbd/Kbd.vue +48 -48
- package/src/components/Kbd/KbdGroup.vue +27 -27
- package/src/components/Kbd/kbd.scss +19 -19
- package/src/components/Modal/Confirm.vue +56 -56
- package/src/components/Modal/Modal.vue +99 -99
- package/src/components/Modal/modal.scss +54 -54
- package/src/components/OTP/OTP.vue +133 -133
- package/src/components/OTP/OTPItem.vue +37 -37
- package/src/components/OTP/otp.scss +84 -84
- package/src/components/Pagination/Pagination.vue +77 -77
- package/src/components/Pagination/pagination.ts +78 -78
- package/src/components/Popout/Popout.vue +52 -52
- package/src/components/Popout/popout.scss +15 -15
- package/src/components/Progress/Progress.vue +103 -103
- package/src/components/Progress/progress.scss +47 -47
- package/src/components/Radio/Radio.vue +38 -38
- package/src/components/Radio/RadioGroup.vue +40 -40
- package/src/components/Radio/radio.scss +78 -78
- package/src/components/Select/Select.vue +211 -211
- package/src/components/Select/select.scss +77 -77
- package/src/components/Sheet/Sheet.vue +98 -98
- package/src/components/Sheet/sheet.scss +69 -69
- package/src/components/Sidebar/Sidebar.vue +115 -115
- package/src/components/Sidebar/sidebar.scss +124 -124
- package/src/components/Skeleton/Skeleton.vue +43 -43
- package/src/components/Skeleton/skeleton.scss +14 -14
- package/src/components/Spinner/Spinner.vue +42 -42
- package/src/components/Spinner/spinner.scss +47 -47
- package/src/components/Switch/Switch.vue +31 -31
- package/src/components/Switch/switch.scss +93 -93
- package/src/components/Table/Cell.vue +23 -23
- package/src/components/Table/Head.vue +59 -59
- package/src/components/Table/Root.vue +66 -66
- package/src/components/Table/SelectAll.vue +23 -23
- package/src/components/Table/SelectRow.vue +30 -30
- package/src/components/Table/index.ts +7 -7
- package/src/components/Table/table.scss +154 -154
- package/src/components/Table/table.ts +248 -248
- package/src/components/Tabs/Tab.vue +25 -25
- package/src/components/Tabs/Tabs.vue +89 -89
- package/src/components/Tabs/tabs.scss +87 -87
- package/src/components/Toast/Toasts.vue +52 -52
- package/src/components/Toast/toast.scss +45 -45
- package/src/components/Toast/toast.ts +75 -75
- package/src/components/Tooltip/Tooltip.vue +86 -86
- package/src/components/Tooltip/tooltip.scss +8 -8
- package/src/examples/ExampleAccordions.vue +58 -58
- package/src/examples/ExampleAlerts.vue +78 -78
- package/src/examples/ExampleAvatars.vue +44 -44
- package/src/examples/ExampleBadges.vue +48 -48
- package/src/examples/ExampleBreadcrumbs.vue +46 -46
- package/src/examples/ExampleButtons.vue +140 -140
- package/src/examples/ExampleCalendars.vue +40 -40
- package/src/examples/ExampleCards.vue +94 -94
- package/src/examples/ExampleCheckboxes.vue +123 -123
- package/src/examples/ExampleCopyClipboard.vue +47 -47
- package/src/examples/ExampleDividers.vue +39 -39
- package/src/examples/ExampleDrawers.vue +67 -67
- package/src/examples/ExampleDropdowns.vue +114 -114
- package/src/examples/ExampleFlexGrid.vue +122 -122
- package/src/examples/ExampleInputs.vue +234 -234
- package/src/examples/ExampleKBD.vue +65 -65
- package/src/examples/ExampleModals.vue +143 -143
- package/src/examples/ExamplePalette.vue +159 -159
- package/src/examples/ExamplePopouts.vue +41 -41
- package/src/examples/ExampleSheets.vue +77 -77
- package/src/examples/ExampleSidebars.vue +270 -270
- package/src/examples/ExampleSkeletons.vue +26 -26
- package/src/examples/ExampleSpinners.vue +78 -78
- package/src/examples/ExampleTables.vue +195 -195
- package/src/examples/ExampleTabs.vue +119 -119
- package/src/examples/ExampleToasts.vue +96 -96
- package/src/examples/ExampleTooltips.vue +70 -70
- package/src/examples/shared/ExampleColor.vue +28 -28
- package/src/index.scss +1 -1
- package/src/index.ts +116 -116
- package/src/internal/Backdrop/Backdrop.vue +22 -22
- package/src/internal/Backdrop/backdrop.scss +34 -34
- package/src/main.ts +5 -5
- package/src/shared/helpers.ts +117 -117
- package/src/shared/theme.ts +22 -22
- package/src/shared/types.ts +29 -29
- package/src/style/animation.scss +22 -22
- package/src/style/core.scss +125 -125
- package/src/style/layout.scss +233 -233
- package/src/style/media-query.scss +29 -29
- package/src/style/reset.scss +135 -135
- package/src/style/text.scss +124 -92
- package/src/style/theme.scss +195 -195
- package/src/style/tooltip.scss +146 -146
- package/src/style/typography.scss +415 -415
- package/src/style/utils.scss +36 -36
package/src/index.ts
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
import Accordion from './components/Accordion/Accordion.vue'
|
|
2
|
-
import AccordionGroup from './components/Accordion/AccordionGroup.vue'
|
|
3
|
-
import Alert from './components/Alert/Alert.vue'
|
|
4
|
-
import Avatar from './components/Avatar/Avatar.vue'
|
|
5
|
-
import Badge from './components/Badge/Badge.vue'
|
|
6
|
-
import BreadcrumbItem from './components/Breadcrumbs/BreadcrumbItem.vue'
|
|
7
|
-
import Breadcrumbs from './components/Breadcrumbs/Breadcrumbs.vue'
|
|
8
|
-
import Button from './components/Button/Button.vue'
|
|
9
|
-
import ButtonGroup from './components/ButtonGroup/ButtonGroup.vue'
|
|
10
|
-
import Calendar from './components/Calendar/Calendar.vue'
|
|
11
|
-
import Card from './components/Card/Card.vue'
|
|
12
|
-
import Checkbox from './components/Checkbox/Checkbox.vue'
|
|
13
|
-
import CopyClipboard from './components/CopyClipboard/CopyClipboard.vue'
|
|
14
|
-
import Divider from './components/Divider/Divider.vue'
|
|
15
|
-
import Drawer from './components/Drawer/Drawer.vue'
|
|
16
|
-
import Dropdown from './components/Dropdown/Dropdown.vue'
|
|
17
|
-
import DropdownItem from './components/Dropdown/DropdownItem.vue'
|
|
18
|
-
import DropdownTitle from './components/Dropdown/DropdownTitle.vue'
|
|
19
|
-
import Flex from './components/Flex/Flex.vue'
|
|
20
|
-
import Grid from './components/Grid/Grid.vue'
|
|
21
|
-
import Color from './components/Input/Color.vue'
|
|
22
|
-
import Counter from './components/Input/Counter.vue'
|
|
23
|
-
import Dropzone from './components/Input/Dropzone.vue'
|
|
24
|
-
import File from './components/Input/File.vue'
|
|
25
|
-
import Input from './components/Input/Input.vue'
|
|
26
|
-
import Password from './components/Input/Password.vue'
|
|
27
|
-
import Textarea from './components/Input/Textarea.vue'
|
|
28
|
-
import Kbd from './components/Kbd/Kbd.vue'
|
|
29
|
-
import KbdGroup from './components/Kbd/KbdGroup.vue'
|
|
30
|
-
import Confirm from './components/Modal/Confirm.vue'
|
|
31
|
-
import Modal from './components/Modal/Modal.vue'
|
|
32
|
-
import OTP from './components/OTP/OTP.vue'
|
|
33
|
-
import OTPItem from './components/OTP/OTPItem.vue'
|
|
34
|
-
import { paginate } from './components/Pagination/pagination'
|
|
35
|
-
import Pagination from './components/Pagination/Pagination.vue'
|
|
36
|
-
import Popout from './components/Popout/Popout.vue'
|
|
37
|
-
import Progress from './components/Progress/Progress.vue'
|
|
38
|
-
import Radio from './components/Radio/Radio.vue'
|
|
39
|
-
import RadioGroup from './components/Radio/RadioGroup.vue'
|
|
40
|
-
import Select from './components/Select/Select.vue'
|
|
41
|
-
import Sheet from './components/Sheet/Sheet.vue'
|
|
42
|
-
import Sidebar from './components/Sidebar/Sidebar.vue'
|
|
43
|
-
import Skeleton from './components/Skeleton/Skeleton.vue'
|
|
44
|
-
import Spinner from './components/Spinner/Spinner.vue'
|
|
45
|
-
import Switch from './components/Switch/Switch.vue'
|
|
46
|
-
import * as Table from './components/Table'
|
|
47
|
-
import { defineTable } from './components/Table/table'
|
|
48
|
-
import Tab from './components/Tabs/Tab.vue'
|
|
49
|
-
import Tabs from './components/Tabs/Tabs.vue'
|
|
50
|
-
import { pushToast, removeToast } from './components/Toast/toast'
|
|
51
|
-
import Toasts from './components/Toast/Toasts.vue'
|
|
52
|
-
import Tooltip from './components/Tooltip/Tooltip.vue'
|
|
53
|
-
import Backdrop from './internal/Backdrop/Backdrop.vue'
|
|
54
|
-
import { searchString } from './shared/helpers'
|
|
55
|
-
import { setColorTheme, theme } from './shared/theme'
|
|
56
|
-
import './index.scss'
|
|
57
|
-
|
|
58
|
-
export {
|
|
59
|
-
Accordion,
|
|
60
|
-
AccordionGroup,
|
|
61
|
-
Alert,
|
|
62
|
-
Avatar,
|
|
63
|
-
Backdrop,
|
|
64
|
-
Badge,
|
|
65
|
-
BreadcrumbItem,
|
|
66
|
-
Breadcrumbs,
|
|
67
|
-
Button,
|
|
68
|
-
ButtonGroup,
|
|
69
|
-
Calendar,
|
|
70
|
-
Card,
|
|
71
|
-
Checkbox,
|
|
72
|
-
Color,
|
|
73
|
-
Confirm,
|
|
74
|
-
CopyClipboard,
|
|
75
|
-
Counter,
|
|
76
|
-
defineTable,
|
|
77
|
-
Divider,
|
|
78
|
-
Drawer,
|
|
79
|
-
Dropdown,
|
|
80
|
-
DropdownItem,
|
|
81
|
-
DropdownTitle,
|
|
82
|
-
Dropzone,
|
|
83
|
-
File,
|
|
84
|
-
Flex,
|
|
85
|
-
Grid,
|
|
86
|
-
Input,
|
|
87
|
-
Kbd,
|
|
88
|
-
KbdGroup,
|
|
89
|
-
Modal,
|
|
90
|
-
OTP,
|
|
91
|
-
OTPItem,
|
|
92
|
-
paginate,
|
|
93
|
-
Pagination,
|
|
94
|
-
Password,
|
|
95
|
-
Popout,
|
|
96
|
-
Progress,
|
|
97
|
-
pushToast,
|
|
98
|
-
Radio,
|
|
99
|
-
RadioGroup,
|
|
100
|
-
removeToast,
|
|
101
|
-
searchString,
|
|
102
|
-
Select,
|
|
103
|
-
setColorTheme,
|
|
104
|
-
Sheet,
|
|
105
|
-
Sidebar,
|
|
106
|
-
Skeleton,
|
|
107
|
-
Spinner,
|
|
108
|
-
Switch,
|
|
109
|
-
Tab,
|
|
110
|
-
Table,
|
|
111
|
-
Tabs,
|
|
112
|
-
Textarea,
|
|
113
|
-
theme,
|
|
114
|
-
Toasts,
|
|
115
|
-
Tooltip,
|
|
116
|
-
}
|
|
1
|
+
import Accordion from './components/Accordion/Accordion.vue'
|
|
2
|
+
import AccordionGroup from './components/Accordion/AccordionGroup.vue'
|
|
3
|
+
import Alert from './components/Alert/Alert.vue'
|
|
4
|
+
import Avatar from './components/Avatar/Avatar.vue'
|
|
5
|
+
import Badge from './components/Badge/Badge.vue'
|
|
6
|
+
import BreadcrumbItem from './components/Breadcrumbs/BreadcrumbItem.vue'
|
|
7
|
+
import Breadcrumbs from './components/Breadcrumbs/Breadcrumbs.vue'
|
|
8
|
+
import Button from './components/Button/Button.vue'
|
|
9
|
+
import ButtonGroup from './components/ButtonGroup/ButtonGroup.vue'
|
|
10
|
+
import Calendar from './components/Calendar/Calendar.vue'
|
|
11
|
+
import Card from './components/Card/Card.vue'
|
|
12
|
+
import Checkbox from './components/Checkbox/Checkbox.vue'
|
|
13
|
+
import CopyClipboard from './components/CopyClipboard/CopyClipboard.vue'
|
|
14
|
+
import Divider from './components/Divider/Divider.vue'
|
|
15
|
+
import Drawer from './components/Drawer/Drawer.vue'
|
|
16
|
+
import Dropdown from './components/Dropdown/Dropdown.vue'
|
|
17
|
+
import DropdownItem from './components/Dropdown/DropdownItem.vue'
|
|
18
|
+
import DropdownTitle from './components/Dropdown/DropdownTitle.vue'
|
|
19
|
+
import Flex from './components/Flex/Flex.vue'
|
|
20
|
+
import Grid from './components/Grid/Grid.vue'
|
|
21
|
+
import Color from './components/Input/Color.vue'
|
|
22
|
+
import Counter from './components/Input/Counter.vue'
|
|
23
|
+
import Dropzone from './components/Input/Dropzone.vue'
|
|
24
|
+
import File from './components/Input/File.vue'
|
|
25
|
+
import Input from './components/Input/Input.vue'
|
|
26
|
+
import Password from './components/Input/Password.vue'
|
|
27
|
+
import Textarea from './components/Input/Textarea.vue'
|
|
28
|
+
import Kbd from './components/Kbd/Kbd.vue'
|
|
29
|
+
import KbdGroup from './components/Kbd/KbdGroup.vue'
|
|
30
|
+
import Confirm from './components/Modal/Confirm.vue'
|
|
31
|
+
import Modal from './components/Modal/Modal.vue'
|
|
32
|
+
import OTP from './components/OTP/OTP.vue'
|
|
33
|
+
import OTPItem from './components/OTP/OTPItem.vue'
|
|
34
|
+
import { paginate } from './components/Pagination/pagination'
|
|
35
|
+
import Pagination from './components/Pagination/Pagination.vue'
|
|
36
|
+
import Popout from './components/Popout/Popout.vue'
|
|
37
|
+
import Progress from './components/Progress/Progress.vue'
|
|
38
|
+
import Radio from './components/Radio/Radio.vue'
|
|
39
|
+
import RadioGroup from './components/Radio/RadioGroup.vue'
|
|
40
|
+
import Select from './components/Select/Select.vue'
|
|
41
|
+
import Sheet from './components/Sheet/Sheet.vue'
|
|
42
|
+
import Sidebar from './components/Sidebar/Sidebar.vue'
|
|
43
|
+
import Skeleton from './components/Skeleton/Skeleton.vue'
|
|
44
|
+
import Spinner from './components/Spinner/Spinner.vue'
|
|
45
|
+
import Switch from './components/Switch/Switch.vue'
|
|
46
|
+
import * as Table from './components/Table'
|
|
47
|
+
import { defineTable } from './components/Table/table'
|
|
48
|
+
import Tab from './components/Tabs/Tab.vue'
|
|
49
|
+
import Tabs from './components/Tabs/Tabs.vue'
|
|
50
|
+
import { pushToast, removeToast } from './components/Toast/toast'
|
|
51
|
+
import Toasts from './components/Toast/Toasts.vue'
|
|
52
|
+
import Tooltip from './components/Tooltip/Tooltip.vue'
|
|
53
|
+
import Backdrop from './internal/Backdrop/Backdrop.vue'
|
|
54
|
+
import { searchString } from './shared/helpers'
|
|
55
|
+
import { setColorTheme, theme } from './shared/theme'
|
|
56
|
+
import './index.scss'
|
|
57
|
+
|
|
58
|
+
export {
|
|
59
|
+
Accordion,
|
|
60
|
+
AccordionGroup,
|
|
61
|
+
Alert,
|
|
62
|
+
Avatar,
|
|
63
|
+
Backdrop,
|
|
64
|
+
Badge,
|
|
65
|
+
BreadcrumbItem,
|
|
66
|
+
Breadcrumbs,
|
|
67
|
+
Button,
|
|
68
|
+
ButtonGroup,
|
|
69
|
+
Calendar,
|
|
70
|
+
Card,
|
|
71
|
+
Checkbox,
|
|
72
|
+
Color,
|
|
73
|
+
Confirm,
|
|
74
|
+
CopyClipboard,
|
|
75
|
+
Counter,
|
|
76
|
+
defineTable,
|
|
77
|
+
Divider,
|
|
78
|
+
Drawer,
|
|
79
|
+
Dropdown,
|
|
80
|
+
DropdownItem,
|
|
81
|
+
DropdownTitle,
|
|
82
|
+
Dropzone,
|
|
83
|
+
File,
|
|
84
|
+
Flex,
|
|
85
|
+
Grid,
|
|
86
|
+
Input,
|
|
87
|
+
Kbd,
|
|
88
|
+
KbdGroup,
|
|
89
|
+
Modal,
|
|
90
|
+
OTP,
|
|
91
|
+
OTPItem,
|
|
92
|
+
paginate,
|
|
93
|
+
Pagination,
|
|
94
|
+
Password,
|
|
95
|
+
Popout,
|
|
96
|
+
Progress,
|
|
97
|
+
pushToast,
|
|
98
|
+
Radio,
|
|
99
|
+
RadioGroup,
|
|
100
|
+
removeToast,
|
|
101
|
+
searchString,
|
|
102
|
+
Select,
|
|
103
|
+
setColorTheme,
|
|
104
|
+
Sheet,
|
|
105
|
+
Sidebar,
|
|
106
|
+
Skeleton,
|
|
107
|
+
Spinner,
|
|
108
|
+
Switch,
|
|
109
|
+
Tab,
|
|
110
|
+
Table,
|
|
111
|
+
Tabs,
|
|
112
|
+
Textarea,
|
|
113
|
+
theme,
|
|
114
|
+
Toasts,
|
|
115
|
+
Tooltip,
|
|
116
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { onMounted } from 'vue'
|
|
3
|
-
import './backdrop.scss'
|
|
4
|
-
|
|
5
|
-
const emits = defineEmits<{
|
|
6
|
-
(e: 'close'): void
|
|
7
|
-
}>()
|
|
8
|
-
|
|
9
|
-
onMounted(() => {
|
|
10
|
-
window.addEventListener('keydown', (e) => {
|
|
11
|
-
if (e.key === 'Escape') {
|
|
12
|
-
emits('close')
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
})
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<template>
|
|
19
|
-
<div class="vui-backdrop" @click.self="emits('close')">
|
|
20
|
-
<slot />
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onMounted } from 'vue'
|
|
3
|
+
import './backdrop.scss'
|
|
4
|
+
|
|
5
|
+
const emits = defineEmits<{
|
|
6
|
+
(e: 'close'): void
|
|
7
|
+
}>()
|
|
8
|
+
|
|
9
|
+
onMounted(() => {
|
|
10
|
+
window.addEventListener('keydown', (e) => {
|
|
11
|
+
if (e.key === 'Escape') {
|
|
12
|
+
emits('close')
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<div class="vui-backdrop" @click.self="emits('close')">
|
|
20
|
+
<slot />
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
--backdrop-offset: 64px;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.vui-backdrop {
|
|
6
|
-
z-index: 1000;
|
|
7
|
-
position: fixed;
|
|
8
|
-
display: block;
|
|
9
|
-
width: 100dvw;
|
|
10
|
-
height: 100dvh;
|
|
11
|
-
top: 0;
|
|
12
|
-
left: 0;
|
|
13
|
-
padding: var(--backdrop-offset);
|
|
14
|
-
overflow-y: auto;
|
|
15
|
-
|
|
16
|
-
&:after {
|
|
17
|
-
content: '';
|
|
18
|
-
position: fixed;
|
|
19
|
-
z-index: -1;
|
|
20
|
-
inset: 0;
|
|
21
|
-
background-color: var(--color-bg-lowered);
|
|
22
|
-
opacity: 0.75;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
html:has(.vui-backdrop) {
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
:root.light {
|
|
31
|
-
.vui-backdrop:after {
|
|
32
|
-
background-color: var(--dark-color-bg);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
1
|
+
:root {
|
|
2
|
+
--backdrop-offset: 64px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.vui-backdrop {
|
|
6
|
+
z-index: 1000;
|
|
7
|
+
position: fixed;
|
|
8
|
+
display: block;
|
|
9
|
+
width: 100dvw;
|
|
10
|
+
height: 100dvh;
|
|
11
|
+
top: 0;
|
|
12
|
+
left: 0;
|
|
13
|
+
padding: var(--backdrop-offset);
|
|
14
|
+
overflow-y: auto;
|
|
15
|
+
|
|
16
|
+
&:after {
|
|
17
|
+
content: '';
|
|
18
|
+
position: fixed;
|
|
19
|
+
z-index: -1;
|
|
20
|
+
inset: 0;
|
|
21
|
+
background-color: var(--color-bg-lowered);
|
|
22
|
+
opacity: 0.75;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
html:has(.vui-backdrop) {
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:root.light {
|
|
31
|
+
.vui-backdrop:after {
|
|
32
|
+
background-color: var(--dark-color-bg);
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/main.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createApp } from 'vue'
|
|
2
|
-
import App from './App.vue'
|
|
3
|
-
import './style/core.scss'
|
|
4
|
-
|
|
5
|
-
createApp(App).mount('#app')
|
|
1
|
+
import { createApp } from 'vue'
|
|
2
|
+
import App from './App.vue'
|
|
3
|
+
import './style/core.scss'
|
|
4
|
+
|
|
5
|
+
createApp(App).mount('#app')
|
package/src/shared/helpers.ts
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
export function createArray(length: number, startOffset: number = 0): number[] {
|
|
2
|
-
return Array
|
|
3
|
-
.from({ length })
|
|
4
|
-
.map((_, index) => startOffset + index)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
// Searches through the input and checkes wether it contains match
|
|
8
|
-
// It searches the input by splitting it by whitespace and matching each
|
|
9
|
-
// word against the string
|
|
10
|
-
export function searchString(match: string | string[], input: string): boolean {
|
|
11
|
-
if (!match)
|
|
12
|
-
return false
|
|
13
|
-
|
|
14
|
-
const joint: string = Array.isArray(match) ? match.join(' ') : match
|
|
15
|
-
|
|
16
|
-
const split = input.trim().split(/\s+/)
|
|
17
|
-
return split.every(s => joint.toLowerCase().includes(s.toLowerCase()))
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export function getMaybeRefLength(value: string | number): number {
|
|
21
|
-
return typeof value === 'number' ? value : value.length
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function isNil(value: any): value is undefined | null {
|
|
25
|
-
return value === undefined || value === null
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Checks wether a color is light or dark, depending on
|
|
30
|
-
*/
|
|
31
|
-
export function calculateColorLightness(r: number, g: number, b: number): 'dark' | 'light' {
|
|
32
|
-
const yiq = (r * 299 + g * 587 + b * 114) / 1000
|
|
33
|
-
return yiq >= 128 ? 'light' : 'dark'
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Convert a CSS rgb string to a tuple of actual r,g,b values
|
|
38
|
-
*
|
|
39
|
-
* 'rgb(12,16,24)' --> [12, 16, 24]
|
|
40
|
-
*/
|
|
41
|
-
export function stringRgbToValues(rgbString: string): [number, number, number] {
|
|
42
|
-
return rgbString.match(/\d+/g)!.map(Number) as any as [number, number, number]
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// export function rgbToHex(r: number, g: number, b: number): string {
|
|
46
|
-
// return `#${[r, g, b].map((x) => {
|
|
47
|
-
// const hex = x.toString(16)
|
|
48
|
-
// return hex.length === 1 ? `0${hex}` : hex
|
|
49
|
-
// }).join('')}`
|
|
50
|
-
// }
|
|
51
|
-
|
|
52
|
-
export function randomMinMax(min: number, max: number): number {
|
|
53
|
-
min = Math.ceil(min)
|
|
54
|
-
max = Math.floor(max)
|
|
55
|
-
return Math.floor(Math.random() * (max - min + 1)) + min
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function delay(amount: number): Promise<any> {
|
|
59
|
-
return new Promise(r => setTimeout(r, amount))
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function setCharAt(str: string, char: string | number, index: number): string {
|
|
63
|
-
if (str.length === 0)
|
|
64
|
-
return char.toString()
|
|
65
|
-
return str.substring(0, index) + char + str.substring(index + 1)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Takes in a value and if it is a number, appends "px" to it, otherwise returns
|
|
70
|
-
* the original value.
|
|
71
|
-
*
|
|
72
|
-
*/
|
|
73
|
-
export function formatUnitValue(value: string | number, unit: string = 'px'): string {
|
|
74
|
-
return typeof value === 'number'
|
|
75
|
-
? `${value}${unit}`
|
|
76
|
-
// If last value of string is NOT a number, do not add "px" at the end
|
|
77
|
-
// eslint-disable-next-line unicorn/prefer-number-properties
|
|
78
|
-
: isNaN(Number(value[value.length - 1]))
|
|
79
|
-
? value
|
|
80
|
-
: `${value}${unit}`
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function clamp(min: number, max: number, value: number): number {
|
|
84
|
-
return Math.min(Math.max(value, min), max)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Checks wether an object is inside of Set, based on comparing values. Not reference
|
|
89
|
-
*
|
|
90
|
-
* @param set The Set
|
|
91
|
-
* @param obj Object which should be in the side
|
|
92
|
-
* @returns If object is inside the set
|
|
93
|
-
*/
|
|
94
|
-
export function isObjectInSet(set: Set<any>, obj: any): boolean {
|
|
95
|
-
for (const item of set) {
|
|
96
|
-
// Check if both have the same number of keys
|
|
97
|
-
if (Object.keys(item).length !== Object.keys(obj).length) {
|
|
98
|
-
continue
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Compare each key-value pair
|
|
102
|
-
let isEqual = true
|
|
103
|
-
|
|
104
|
-
for (const key in item) {
|
|
105
|
-
if (key in item && item[key] !== obj[key]) {
|
|
106
|
-
isEqual = false
|
|
107
|
-
break
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (isEqual) {
|
|
112
|
-
return true
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return false
|
|
117
|
-
}
|
|
1
|
+
export function createArray(length: number, startOffset: number = 0): number[] {
|
|
2
|
+
return Array
|
|
3
|
+
.from({ length })
|
|
4
|
+
.map((_, index) => startOffset + index)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
// Searches through the input and checkes wether it contains match
|
|
8
|
+
// It searches the input by splitting it by whitespace and matching each
|
|
9
|
+
// word against the string
|
|
10
|
+
export function searchString(match: string | string[], input: string): boolean {
|
|
11
|
+
if (!match)
|
|
12
|
+
return false
|
|
13
|
+
|
|
14
|
+
const joint: string = Array.isArray(match) ? match.join(' ') : match
|
|
15
|
+
|
|
16
|
+
const split = input.trim().split(/\s+/)
|
|
17
|
+
return split.every(s => joint.toLowerCase().includes(s.toLowerCase()))
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function getMaybeRefLength(value: string | number): number {
|
|
21
|
+
return typeof value === 'number' ? value : value.length
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function isNil(value: any): value is undefined | null {
|
|
25
|
+
return value === undefined || value === null
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Checks wether a color is light or dark, depending on
|
|
30
|
+
*/
|
|
31
|
+
export function calculateColorLightness(r: number, g: number, b: number): 'dark' | 'light' {
|
|
32
|
+
const yiq = (r * 299 + g * 587 + b * 114) / 1000
|
|
33
|
+
return yiq >= 128 ? 'light' : 'dark'
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Convert a CSS rgb string to a tuple of actual r,g,b values
|
|
38
|
+
*
|
|
39
|
+
* 'rgb(12,16,24)' --> [12, 16, 24]
|
|
40
|
+
*/
|
|
41
|
+
export function stringRgbToValues(rgbString: string): [number, number, number] {
|
|
42
|
+
return rgbString.match(/\d+/g)!.map(Number) as any as [number, number, number]
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// export function rgbToHex(r: number, g: number, b: number): string {
|
|
46
|
+
// return `#${[r, g, b].map((x) => {
|
|
47
|
+
// const hex = x.toString(16)
|
|
48
|
+
// return hex.length === 1 ? `0${hex}` : hex
|
|
49
|
+
// }).join('')}`
|
|
50
|
+
// }
|
|
51
|
+
|
|
52
|
+
export function randomMinMax(min: number, max: number): number {
|
|
53
|
+
min = Math.ceil(min)
|
|
54
|
+
max = Math.floor(max)
|
|
55
|
+
return Math.floor(Math.random() * (max - min + 1)) + min
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function delay(amount: number): Promise<any> {
|
|
59
|
+
return new Promise(r => setTimeout(r, amount))
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function setCharAt(str: string, char: string | number, index: number): string {
|
|
63
|
+
if (str.length === 0)
|
|
64
|
+
return char.toString()
|
|
65
|
+
return str.substring(0, index) + char + str.substring(index + 1)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Takes in a value and if it is a number, appends "px" to it, otherwise returns
|
|
70
|
+
* the original value.
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
export function formatUnitValue(value: string | number, unit: string = 'px'): string {
|
|
74
|
+
return typeof value === 'number'
|
|
75
|
+
? `${value}${unit}`
|
|
76
|
+
// If last value of string is NOT a number, do not add "px" at the end
|
|
77
|
+
// eslint-disable-next-line unicorn/prefer-number-properties
|
|
78
|
+
: isNaN(Number(value[value.length - 1]))
|
|
79
|
+
? value
|
|
80
|
+
: `${value}${unit}`
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function clamp(min: number, max: number, value: number): number {
|
|
84
|
+
return Math.min(Math.max(value, min), max)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Checks wether an object is inside of Set, based on comparing values. Not reference
|
|
89
|
+
*
|
|
90
|
+
* @param set The Set
|
|
91
|
+
* @param obj Object which should be in the side
|
|
92
|
+
* @returns If object is inside the set
|
|
93
|
+
*/
|
|
94
|
+
export function isObjectInSet(set: Set<any>, obj: any): boolean {
|
|
95
|
+
for (const item of set) {
|
|
96
|
+
// Check if both have the same number of keys
|
|
97
|
+
if (Object.keys(item).length !== Object.keys(obj).length) {
|
|
98
|
+
continue
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Compare each key-value pair
|
|
102
|
+
let isEqual = true
|
|
103
|
+
|
|
104
|
+
for (const key in item) {
|
|
105
|
+
if (key in item && item[key] !== obj[key]) {
|
|
106
|
+
isEqual = false
|
|
107
|
+
break
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (isEqual) {
|
|
112
|
+
return true
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return false
|
|
117
|
+
}
|
package/src/shared/theme.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { useColorMode } from '@vueuse/core'
|
|
2
|
-
import { readonly } from 'vue'
|
|
3
|
-
|
|
4
|
-
export type VuiTheme = 'light' | 'dark' | 'auto'
|
|
5
|
-
|
|
6
|
-
const themeImpl = useColorMode({
|
|
7
|
-
modes: {
|
|
8
|
-
dark: 'dark',
|
|
9
|
-
light: 'light',
|
|
10
|
-
// TODO: add black theme
|
|
11
|
-
// TODO: add high contrast light & dark theme
|
|
12
|
-
},
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
export const theme = readonly(themeImpl)
|
|
16
|
-
|
|
17
|
-
export function setColorTheme(newTheme: VuiTheme): void {
|
|
18
|
-
if (newTheme === themeImpl.value)
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
themeImpl.value = newTheme
|
|
22
|
-
}
|
|
1
|
+
import { useColorMode } from '@vueuse/core'
|
|
2
|
+
import { readonly } from 'vue'
|
|
3
|
+
|
|
4
|
+
export type VuiTheme = 'light' | 'dark' | 'auto'
|
|
5
|
+
|
|
6
|
+
const themeImpl = useColorMode({
|
|
7
|
+
modes: {
|
|
8
|
+
dark: 'dark',
|
|
9
|
+
light: 'light',
|
|
10
|
+
// TODO: add black theme
|
|
11
|
+
// TODO: add high contrast light & dark theme
|
|
12
|
+
},
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export const theme = readonly(themeImpl)
|
|
16
|
+
|
|
17
|
+
export function setColorTheme(newTheme: VuiTheme): void {
|
|
18
|
+
if (newTheme === themeImpl.value)
|
|
19
|
+
return
|
|
20
|
+
|
|
21
|
+
themeImpl.value = newTheme
|
|
22
|
+
}
|