@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
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
.vui-dropdown-item {
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: flex-start;
|
|
5
|
-
width: fit-content;
|
|
6
|
-
gap: var(--space-xs);
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: var(--interactive-el-height);
|
|
9
|
-
border-radius: var(--border-radius-m);
|
|
10
|
-
font-size: var(--font-size-m);
|
|
11
|
-
cursor: default;
|
|
12
|
-
transition: var(--transition-fast);
|
|
13
|
-
padding-inline: var(--space-s);
|
|
14
|
-
white-space: nowrap;
|
|
15
|
-
margin-bottom: 4px;
|
|
16
|
-
|
|
17
|
-
&:last-child {
|
|
18
|
-
margin-bottom: 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&.disabled {
|
|
22
|
-
pointer-events: none;
|
|
23
|
-
|
|
24
|
-
&:hover {
|
|
25
|
-
background-color: transparent;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.vui-dropdown-item-slot,
|
|
29
|
-
.vui-dropdown-item-icon svg path {
|
|
30
|
-
color: var(--color-text-lighter);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.vui-dropdown-item-hint {
|
|
34
|
-
visibility: hidden;
|
|
35
|
-
opacity: 0;
|
|
36
|
-
z-index: -1;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.vui-dropdown-item-icon {
|
|
41
|
-
width: 16px;
|
|
42
|
-
height: 16px;
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
justify-content: center;
|
|
46
|
-
|
|
47
|
-
svg {
|
|
48
|
-
width: 16px;
|
|
49
|
-
height: 16px;
|
|
50
|
-
|
|
51
|
-
path {
|
|
52
|
-
color: var(--color-text-light);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.vui-dropdown-item-hint {
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
gap: 2px;
|
|
61
|
-
margin-left: 8px;
|
|
62
|
-
font-size: 0.9rem;
|
|
63
|
-
// white-space: nowrap;
|
|
64
|
-
color: var(--color-text-lighter);
|
|
65
|
-
|
|
66
|
-
svg {
|
|
67
|
-
color: var(--color-text-lighter);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.vui-dropdown-item-slot {
|
|
72
|
-
flex: 1;
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
justify-content: flex-start;
|
|
76
|
-
color: var(--color-text);
|
|
77
|
-
flex-wrap: nowrap;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
&.selected,
|
|
81
|
-
&:hover {
|
|
82
|
-
background-color: var(--color-button-gray-hover);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
1
|
+
.vui-dropdown-item {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: flex-start;
|
|
5
|
+
width: fit-content;
|
|
6
|
+
gap: var(--space-xs);
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: var(--interactive-el-height);
|
|
9
|
+
border-radius: var(--border-radius-m);
|
|
10
|
+
font-size: var(--font-size-m);
|
|
11
|
+
cursor: default;
|
|
12
|
+
transition: var(--transition-fast);
|
|
13
|
+
padding-inline: var(--space-s);
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
margin-bottom: 4px;
|
|
16
|
+
|
|
17
|
+
&:last-child {
|
|
18
|
+
margin-bottom: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.disabled {
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
background-color: transparent;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.vui-dropdown-item-slot,
|
|
29
|
+
.vui-dropdown-item-icon svg path {
|
|
30
|
+
color: var(--color-text-lighter);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.vui-dropdown-item-hint {
|
|
34
|
+
visibility: hidden;
|
|
35
|
+
opacity: 0;
|
|
36
|
+
z-index: -1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.vui-dropdown-item-icon {
|
|
41
|
+
width: 16px;
|
|
42
|
+
height: 16px;
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
|
|
47
|
+
svg {
|
|
48
|
+
width: 16px;
|
|
49
|
+
height: 16px;
|
|
50
|
+
|
|
51
|
+
path {
|
|
52
|
+
color: var(--color-text-light);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.vui-dropdown-item-hint {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 2px;
|
|
61
|
+
margin-left: 8px;
|
|
62
|
+
font-size: 0.9rem;
|
|
63
|
+
// white-space: nowrap;
|
|
64
|
+
color: var(--color-text-lighter);
|
|
65
|
+
|
|
66
|
+
svg {
|
|
67
|
+
color: var(--color-text-lighter);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.vui-dropdown-item-slot {
|
|
72
|
+
flex: 1;
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: flex-start;
|
|
76
|
+
color: var(--color-text);
|
|
77
|
+
flex-wrap: nowrap;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.selected,
|
|
81
|
+
&:hover {
|
|
82
|
+
background-color: var(--color-button-gray-hover);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
.vui-dropdown-trigger-wrap {
|
|
2
|
-
// width: fit-content;
|
|
3
|
-
position: relative;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.vui-dropdown {
|
|
7
|
-
min-width: 156px;
|
|
8
|
-
border-radius: var(--border-radius-m);
|
|
9
|
-
border: 1px solid var(--color-border);
|
|
10
|
-
padding: 4px;
|
|
11
|
-
overflow-y: auto;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.vui-dropdown-title {
|
|
15
|
-
position: relative;
|
|
16
|
-
display: flex;
|
|
17
|
-
align-items: center;
|
|
18
|
-
justify-content: flex-start;
|
|
19
|
-
padding-block: var(--space-xs);
|
|
20
|
-
padding-inline: calc(var(--space-xs) + 8px);
|
|
21
|
-
font-size: var(--font-size-m);
|
|
22
|
-
border-bottom: 1px solid var(--color-border);
|
|
23
|
-
font-weight: var(--font-weight-semibold);
|
|
24
|
-
margin-inline: -4px;
|
|
25
|
-
margin-top: -4px;
|
|
26
|
-
margin-bottom: 4px;
|
|
27
|
-
gap: var(--space-m);
|
|
28
|
-
justify-content: space-between;
|
|
29
|
-
background-color: var(--color-bg-medium);
|
|
30
|
-
z-index: 50;
|
|
31
|
-
|
|
32
|
-
&.sticky {
|
|
33
|
-
position: sticky;
|
|
34
|
-
top: -4px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&:not(:first-child) {
|
|
38
|
-
margin-top: 4px;
|
|
39
|
-
border-top: 1px solid var(--color-border);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.vui-dropdown-title-end {
|
|
43
|
-
font-size: var(--font-size-s);
|
|
44
|
-
font-weight: 400;
|
|
45
|
-
color: var(--color-text-lighter);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
:root.light {
|
|
50
|
-
.vui-dropdown-title {
|
|
51
|
-
background-color: var(--color-bg);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
.vui-dropdown-trigger-wrap {
|
|
2
|
+
// width: fit-content;
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.vui-dropdown {
|
|
7
|
+
min-width: 156px;
|
|
8
|
+
border-radius: var(--border-radius-m);
|
|
9
|
+
border: 1px solid var(--color-border);
|
|
10
|
+
padding: 4px;
|
|
11
|
+
overflow-y: auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.vui-dropdown-title {
|
|
15
|
+
position: relative;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: flex-start;
|
|
19
|
+
padding-block: var(--space-xs);
|
|
20
|
+
padding-inline: calc(var(--space-xs) + 8px);
|
|
21
|
+
font-size: var(--font-size-m);
|
|
22
|
+
border-bottom: 1px solid var(--color-border);
|
|
23
|
+
font-weight: var(--font-weight-semibold);
|
|
24
|
+
margin-inline: -4px;
|
|
25
|
+
margin-top: -4px;
|
|
26
|
+
margin-bottom: 4px;
|
|
27
|
+
gap: var(--space-m);
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
background-color: var(--color-bg-medium);
|
|
30
|
+
z-index: 50;
|
|
31
|
+
|
|
32
|
+
&.sticky {
|
|
33
|
+
position: sticky;
|
|
34
|
+
top: -4px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:not(:first-child) {
|
|
38
|
+
margin-top: 4px;
|
|
39
|
+
border-top: 1px solid var(--color-border);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.vui-dropdown-title-end {
|
|
43
|
+
font-size: var(--font-size-s);
|
|
44
|
+
font-weight: 400;
|
|
45
|
+
color: var(--color-text-lighter);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:root.light {
|
|
50
|
+
.vui-dropdown-title {
|
|
51
|
+
background-color: var(--color-bg);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Space } from '../../shared/types'
|
|
3
|
-
import { computed } from 'vue'
|
|
4
|
-
import { formatUnitValue } from '../../shared/helpers'
|
|
5
|
-
|
|
6
|
-
export interface FlexProps {
|
|
7
|
-
inline?: boolean
|
|
8
|
-
wrap?: boolean
|
|
9
|
-
wrapReverse?: boolean
|
|
10
|
-
|
|
11
|
-
row?: boolean
|
|
12
|
-
column?: boolean
|
|
13
|
-
rowReverse?: boolean
|
|
14
|
-
columnReverse?: boolean
|
|
15
|
-
|
|
16
|
-
gap?: Space | number
|
|
17
|
-
|
|
18
|
-
// NOTE: Add more if needed
|
|
19
|
-
justifyStart?: boolean
|
|
20
|
-
justifyEnd?: boolean
|
|
21
|
-
justifyCenter?: boolean
|
|
22
|
-
spaceBetween?: boolean
|
|
23
|
-
spaceAround?: boolean
|
|
24
|
-
spaceEvenly?: boolean
|
|
25
|
-
|
|
26
|
-
// NOTE: Add more if needed
|
|
27
|
-
alignCenter?: boolean
|
|
28
|
-
alignStart?: boolean
|
|
29
|
-
alignEnd?: boolean
|
|
30
|
-
alignBaseline?: boolean
|
|
31
|
-
|
|
32
|
-
expand?: boolean
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const props = withDefaults(defineProps<FlexProps>(), {
|
|
36
|
-
// eslint-disable-next-line vue/require-valid-default-prop
|
|
37
|
-
gap: 's',
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
// Flex gap
|
|
41
|
-
const ag = computed(() => typeof props.gap === 'number'
|
|
42
|
-
? formatUnitValue(props.gap)
|
|
43
|
-
: `var(--space-${props.gap})`,
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
// Flex direction
|
|
47
|
-
const ad = computed(() => {
|
|
48
|
-
if (props.row)
|
|
49
|
-
return 'row'
|
|
50
|
-
else if (props.column)
|
|
51
|
-
return 'column'
|
|
52
|
-
else if (props.rowReverse)
|
|
53
|
-
return 'row-reverse'
|
|
54
|
-
else if (props.columnReverse)
|
|
55
|
-
return 'column-reverse'
|
|
56
|
-
else return 'row'
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
// Justify content
|
|
60
|
-
const aj = computed(() => {
|
|
61
|
-
if (props.justifyStart)
|
|
62
|
-
return 'flex-start'
|
|
63
|
-
else if (props.justifyEnd)
|
|
64
|
-
return 'flex-end'
|
|
65
|
-
else if (props.justifyCenter)
|
|
66
|
-
return 'center'
|
|
67
|
-
else if (props.spaceBetween)
|
|
68
|
-
return 'space-between'
|
|
69
|
-
else if (props.spaceEvenly)
|
|
70
|
-
return 'space-evenly'
|
|
71
|
-
else if (props.spaceAround)
|
|
72
|
-
return 'space-around'
|
|
73
|
-
else return 'flex-start'
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
// Align items
|
|
77
|
-
const aA = computed(() => {
|
|
78
|
-
if (props.alignStart)
|
|
79
|
-
return 'flex-start'
|
|
80
|
-
else if (props.alignEnd)
|
|
81
|
-
return 'flex-end'
|
|
82
|
-
else if (props.alignCenter)
|
|
83
|
-
return 'center'
|
|
84
|
-
else if (props.alignBaseline)
|
|
85
|
-
return 'baseline'
|
|
86
|
-
return 'flex-start'
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
const aY = computed(() => props.inline ? 'inline-flex' : 'flex')
|
|
90
|
-
const aW = computed(() => props.wrap
|
|
91
|
-
? 'wrap'
|
|
92
|
-
: props.wrapReverse
|
|
93
|
-
? 'wrap-reverse'
|
|
94
|
-
: 'nowrap')
|
|
95
|
-
|
|
96
|
-
const aH = computed(() => props.expand ? '100%' : 'auto')
|
|
97
|
-
</script>
|
|
98
|
-
|
|
99
|
-
<template>
|
|
100
|
-
<div
|
|
101
|
-
class="vui-flex" :style="{
|
|
102
|
-
display: aY,
|
|
103
|
-
flexWrap: aW,
|
|
104
|
-
flexDirection: ad,
|
|
105
|
-
justifyContent: aj,
|
|
106
|
-
gap: ag,
|
|
107
|
-
alignItems: aA,
|
|
108
|
-
width: aH,
|
|
109
|
-
}"
|
|
110
|
-
>
|
|
111
|
-
<slot />
|
|
112
|
-
</div>
|
|
113
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Space } from '../../shared/types'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import { formatUnitValue } from '../../shared/helpers'
|
|
5
|
+
|
|
6
|
+
export interface FlexProps {
|
|
7
|
+
inline?: boolean
|
|
8
|
+
wrap?: boolean
|
|
9
|
+
wrapReverse?: boolean
|
|
10
|
+
|
|
11
|
+
row?: boolean
|
|
12
|
+
column?: boolean
|
|
13
|
+
rowReverse?: boolean
|
|
14
|
+
columnReverse?: boolean
|
|
15
|
+
|
|
16
|
+
gap?: Space | number
|
|
17
|
+
|
|
18
|
+
// NOTE: Add more if needed
|
|
19
|
+
justifyStart?: boolean
|
|
20
|
+
justifyEnd?: boolean
|
|
21
|
+
justifyCenter?: boolean
|
|
22
|
+
spaceBetween?: boolean
|
|
23
|
+
spaceAround?: boolean
|
|
24
|
+
spaceEvenly?: boolean
|
|
25
|
+
|
|
26
|
+
// NOTE: Add more if needed
|
|
27
|
+
alignCenter?: boolean
|
|
28
|
+
alignStart?: boolean
|
|
29
|
+
alignEnd?: boolean
|
|
30
|
+
alignBaseline?: boolean
|
|
31
|
+
|
|
32
|
+
expand?: boolean
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const props = withDefaults(defineProps<FlexProps>(), {
|
|
36
|
+
// eslint-disable-next-line vue/require-valid-default-prop
|
|
37
|
+
gap: 's',
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
// Flex gap
|
|
41
|
+
const ag = computed(() => typeof props.gap === 'number'
|
|
42
|
+
? formatUnitValue(props.gap)
|
|
43
|
+
: `var(--space-${props.gap})`,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
// Flex direction
|
|
47
|
+
const ad = computed(() => {
|
|
48
|
+
if (props.row)
|
|
49
|
+
return 'row'
|
|
50
|
+
else if (props.column)
|
|
51
|
+
return 'column'
|
|
52
|
+
else if (props.rowReverse)
|
|
53
|
+
return 'row-reverse'
|
|
54
|
+
else if (props.columnReverse)
|
|
55
|
+
return 'column-reverse'
|
|
56
|
+
else return 'row'
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
// Justify content
|
|
60
|
+
const aj = computed(() => {
|
|
61
|
+
if (props.justifyStart)
|
|
62
|
+
return 'flex-start'
|
|
63
|
+
else if (props.justifyEnd)
|
|
64
|
+
return 'flex-end'
|
|
65
|
+
else if (props.justifyCenter)
|
|
66
|
+
return 'center'
|
|
67
|
+
else if (props.spaceBetween)
|
|
68
|
+
return 'space-between'
|
|
69
|
+
else if (props.spaceEvenly)
|
|
70
|
+
return 'space-evenly'
|
|
71
|
+
else if (props.spaceAround)
|
|
72
|
+
return 'space-around'
|
|
73
|
+
else return 'flex-start'
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
// Align items
|
|
77
|
+
const aA = computed(() => {
|
|
78
|
+
if (props.alignStart)
|
|
79
|
+
return 'flex-start'
|
|
80
|
+
else if (props.alignEnd)
|
|
81
|
+
return 'flex-end'
|
|
82
|
+
else if (props.alignCenter)
|
|
83
|
+
return 'center'
|
|
84
|
+
else if (props.alignBaseline)
|
|
85
|
+
return 'baseline'
|
|
86
|
+
return 'flex-start'
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const aY = computed(() => props.inline ? 'inline-flex' : 'flex')
|
|
90
|
+
const aW = computed(() => props.wrap
|
|
91
|
+
? 'wrap'
|
|
92
|
+
: props.wrapReverse
|
|
93
|
+
? 'wrap-reverse'
|
|
94
|
+
: 'nowrap')
|
|
95
|
+
|
|
96
|
+
const aH = computed(() => props.expand ? '100%' : 'auto')
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<template>
|
|
100
|
+
<div
|
|
101
|
+
class="vui-flex" :style="{
|
|
102
|
+
display: aY,
|
|
103
|
+
flexWrap: aW,
|
|
104
|
+
flexDirection: ad,
|
|
105
|
+
justifyContent: aj,
|
|
106
|
+
gap: ag,
|
|
107
|
+
alignItems: aA,
|
|
108
|
+
width: aH,
|
|
109
|
+
}"
|
|
110
|
+
>
|
|
111
|
+
<slot />
|
|
112
|
+
</div>
|
|
113
|
+
</template>
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { Space } from '../../shared/types'
|
|
3
|
-
import { computed } from 'vue'
|
|
4
|
-
import { createArray, formatUnitValue } from '../../shared/helpers'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This component is not meant for complex grids
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
interface Props {
|
|
11
|
-
inline?: boolean
|
|
12
|
-
gap?: Space | number
|
|
13
|
-
rows?: number | string
|
|
14
|
-
columns?: number | string
|
|
15
|
-
// areas?: string[]
|
|
16
|
-
|
|
17
|
-
// NOTE: Add more if needed
|
|
18
|
-
alignCenter?: boolean
|
|
19
|
-
alignStart?: boolean
|
|
20
|
-
alignEnd?: boolean
|
|
21
|
-
alignBaseline?: boolean
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
25
|
-
// eslint-disable-next-line vue/require-valid-default-prop
|
|
26
|
-
gap: 's',
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
const ag = computed(() => typeof props.gap === 'number'
|
|
30
|
-
? formatUnitValue(props.gap)
|
|
31
|
-
: `var(--space-${props.gap})`,
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
const aTC = computed(() => {
|
|
35
|
-
if (typeof props.columns === 'number') {
|
|
36
|
-
return createArray(props.columns)
|
|
37
|
-
.map(() => '1fr')
|
|
38
|
-
.join(' ')
|
|
39
|
-
}
|
|
40
|
-
return props.columns ?? 'none'
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
const aTR = computed(() => {
|
|
44
|
-
if (typeof props.rows === 'number') {
|
|
45
|
-
return createArray(props.rows || 1)
|
|
46
|
-
.map(() => '')
|
|
47
|
-
.join('1fr')
|
|
48
|
-
}
|
|
49
|
-
return props.rows ?? 'none'
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
const aA = computed(() => {
|
|
53
|
-
if (props.alignStart)
|
|
54
|
-
return 'flex-start'
|
|
55
|
-
else if (props.alignEnd)
|
|
56
|
-
return 'flex-end'
|
|
57
|
-
else if (props.alignCenter)
|
|
58
|
-
return 'center'
|
|
59
|
-
else if (props.alignBaseline)
|
|
60
|
-
return 'baseline'
|
|
61
|
-
return 'flex-start'
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
const aD = computed(() => props.inline ? 'inline-grid' : 'grid')
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<template>
|
|
68
|
-
<div
|
|
69
|
-
class="vui-grid" :style="{
|
|
70
|
-
display: aD,
|
|
71
|
-
gap: ag,
|
|
72
|
-
gridTemplateColumns: aTC,
|
|
73
|
-
gridTemplateRows: aTR,
|
|
74
|
-
alignItems: aA,
|
|
75
|
-
|
|
76
|
-
}"
|
|
77
|
-
>
|
|
78
|
-
<slot />
|
|
79
|
-
</div>
|
|
80
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Space } from '../../shared/types'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import { createArray, formatUnitValue } from '../../shared/helpers'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This component is not meant for complex grids
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
inline?: boolean
|
|
12
|
+
gap?: Space | number
|
|
13
|
+
rows?: number | string
|
|
14
|
+
columns?: number | string
|
|
15
|
+
// areas?: string[]
|
|
16
|
+
|
|
17
|
+
// NOTE: Add more if needed
|
|
18
|
+
alignCenter?: boolean
|
|
19
|
+
alignStart?: boolean
|
|
20
|
+
alignEnd?: boolean
|
|
21
|
+
alignBaseline?: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
25
|
+
// eslint-disable-next-line vue/require-valid-default-prop
|
|
26
|
+
gap: 's',
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const ag = computed(() => typeof props.gap === 'number'
|
|
30
|
+
? formatUnitValue(props.gap)
|
|
31
|
+
: `var(--space-${props.gap})`,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
const aTC = computed(() => {
|
|
35
|
+
if (typeof props.columns === 'number') {
|
|
36
|
+
return createArray(props.columns)
|
|
37
|
+
.map(() => '1fr')
|
|
38
|
+
.join(' ')
|
|
39
|
+
}
|
|
40
|
+
return props.columns ?? 'none'
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const aTR = computed(() => {
|
|
44
|
+
if (typeof props.rows === 'number') {
|
|
45
|
+
return createArray(props.rows || 1)
|
|
46
|
+
.map(() => '')
|
|
47
|
+
.join('1fr')
|
|
48
|
+
}
|
|
49
|
+
return props.rows ?? 'none'
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
const aA = computed(() => {
|
|
53
|
+
if (props.alignStart)
|
|
54
|
+
return 'flex-start'
|
|
55
|
+
else if (props.alignEnd)
|
|
56
|
+
return 'flex-end'
|
|
57
|
+
else if (props.alignCenter)
|
|
58
|
+
return 'center'
|
|
59
|
+
else if (props.alignBaseline)
|
|
60
|
+
return 'baseline'
|
|
61
|
+
return 'flex-start'
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const aD = computed(() => props.inline ? 'inline-grid' : 'grid')
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<div
|
|
69
|
+
class="vui-grid" :style="{
|
|
70
|
+
display: aD,
|
|
71
|
+
gap: ag,
|
|
72
|
+
gridTemplateColumns: aTC,
|
|
73
|
+
gridTemplateRows: aTR,
|
|
74
|
+
alignItems: aA,
|
|
75
|
+
|
|
76
|
+
}"
|
|
77
|
+
>
|
|
78
|
+
<slot />
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|