@dolanske/vui 0.5.0 → 1.0.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/README.md +5 -4
- package/dist/components/Alert/Alert.vue.d.ts +7 -1
- package/dist/components/Avatar/Avatar.vue.d.ts +15 -1
- package/dist/components/Badge/Badge.vue.d.ts +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +1 -1
- package/dist/components/Button/Button.vue.d.ts +5 -15
- package/dist/components/ButtonGroup/ButtonGroup.vue.d.ts +2 -0
- package/dist/components/Calendar/Calendar.vue.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.vue.d.ts +19 -4
- package/dist/components/Dropdown/DropdownTitle.vue.d.ts +5 -1
- package/dist/components/Grid/Grid.vue.d.ts +4 -1
- package/dist/components/Input/Dropzone.vue.d.ts +1 -1
- package/dist/components/Input/Input.vue.d.ts +2 -2
- package/dist/components/Kbd/KbdGroup.vue.d.ts +3 -11
- package/dist/components/Modal/Confirm.vue.d.ts +1 -1
- package/dist/components/Modal/Modal.vue.d.ts +1 -1
- package/dist/components/Pagination/Pagination.vue.d.ts +3 -0
- package/dist/components/Popout/Popout.vue.d.ts +8 -1
- package/dist/components/Progress/Progress.vue.d.ts +2 -0
- package/dist/components/Radio/Radio.vue.d.ts +1 -0
- package/dist/components/Select/Select.vue.d.ts +2 -0
- package/dist/components/Sheet/Sheet.vue.d.ts +3 -0
- package/dist/components/Switch/Switch.vue.d.ts +1 -0
- package/dist/components/Table/index.d.ts +6 -0
- package/dist/components/Table/table.d.ts +1 -1
- package/dist/components/Tabs/Tab.vue.d.ts +16 -3
- package/dist/components/Toast/toast.d.ts +245 -0
- package/dist/index.d.ts +2 -7
- package/dist/shared/helpers.d.ts +9 -0
- package/dist/shared/theme.d.ts +3 -0
- package/dist/style.css +1 -1
- package/dist/vui.js +6418 -6049
- package/package.json +7 -3
- package/src/App.vue +90 -171
- package/src/components/Accordion/accordion.scss +1 -0
- package/src/components/Alert/Alert.vue +11 -5
- package/src/components/Alert/alert.scss +104 -23
- package/src/components/Avatar/Avatar.vue +4 -1
- package/src/components/Avatar/avatar.scss +1 -1
- package/src/components/Badge/Badge.vue +1 -1
- package/src/components/Badge/badge.scss +134 -17
- package/src/components/Breadcrumbs/BreadcrumbItem.vue +2 -2
- package/src/components/Breadcrumbs/Breadcrumbs.vue +1 -2
- package/src/components/Breadcrumbs/breadcrumbs.scss +2 -1
- package/src/components/Button/Button.vue +15 -20
- package/src/components/Button/button.scss +156 -55
- package/src/components/ButtonGroup/ButtonGroup.vue +4 -1
- package/src/components/ButtonGroup/button-group.scss +2 -2
- package/src/components/Calendar/Calendar.vue +4 -1
- package/src/components/Calendar/calendar.scss +25 -2
- package/src/components/Card/Card.vue +2 -2
- package/src/components/Card/card.scss +4 -4
- package/src/components/Checkbox/Checkbox.vue +4 -1
- package/src/components/Checkbox/checkbox.scss +17 -12
- package/src/components/CopyClipboard/CopyClipboard.vue +15 -6
- package/src/components/CopyClipboard/copy-clipboard.scss +10 -2
- package/src/components/Drawer/Drawer.vue +4 -4
- package/src/components/Drawer/drawer.scss +1 -0
- package/src/components/Dropdown/Dropdown.vue +44 -20
- package/src/components/Dropdown/DropdownItem.vue +4 -4
- package/src/components/Dropdown/DropdownTitle.vue +7 -1
- package/src/components/Dropdown/dropdown-item.scss +9 -2
- package/src/components/Dropdown/dropdown.scss +21 -7
- package/src/components/Grid/Grid.vue +21 -1
- package/src/components/Input/Color.vue +26 -0
- package/src/components/Input/Counter.vue +12 -16
- package/src/components/Input/Dropzone.vue +1 -1
- package/src/components/Input/File.vue +1 -1
- package/src/components/Input/Input.vue +8 -6
- package/src/components/Input/Password.vue +1 -13
- package/src/components/Input/Textarea.vue +4 -2
- package/src/components/Input/input.scss +110 -16
- package/src/components/Kbd/KbdGroup.vue +2 -6
- package/src/components/Kbd/kbd.scss +6 -5
- package/src/components/Modal/Confirm.vue +1 -1
- package/src/components/Modal/Modal.vue +23 -15
- package/src/components/Modal/modal.scss +11 -6
- package/src/components/OTP/otp.scss +8 -7
- package/src/components/Pagination/Pagination.vue +6 -3
- package/src/components/Popout/Popout.vue +15 -5
- package/src/components/Popout/popout.scss +8 -1
- package/src/components/Progress/Progress.vue +18 -5
- package/src/components/Progress/progress.scss +7 -1
- package/src/components/Radio/Radio.vue +4 -2
- package/src/components/Radio/radio.scss +18 -8
- package/src/components/Select/Select.vue +49 -18
- package/src/components/Select/select.scss +35 -2
- package/src/components/Sheet/Sheet.vue +8 -2
- package/src/components/Sheet/sheet.scss +9 -0
- package/src/components/Sidebar/Sidebar.vue +24 -11
- package/src/components/Sidebar/sidebar.scss +6 -5
- package/src/components/Spinner/spinner.scss +2 -1
- package/src/components/Switch/Switch.vue +4 -3
- package/src/components/Switch/switch.scss +39 -6
- package/src/components/Table/{Header.vue → Head.vue} +5 -5
- package/src/components/Table/{Table.vue → Root.vue} +2 -2
- package/src/components/Table/SelectRow.vue +2 -1
- package/src/components/Table/index.ts +7 -0
- package/src/components/Table/table.scss +25 -5
- package/src/components/Table/table.ts +7 -3
- package/src/components/Tabs/Tab.vue +7 -9
- package/src/components/Tabs/Tabs.vue +2 -2
- package/src/components/Tabs/tabs.scss +10 -3
- package/src/components/Toast/Toasts.vue +5 -0
- package/src/components/Toast/toast.scss +6 -2
- package/src/components/Toast/toast.ts +7 -0
- package/src/components/Tooltip/Tooltip.vue +9 -9
- package/src/components/Tooltip/tooltip.scss +4 -0
- package/src/examples/ExampleAccordions.vue +58 -0
- package/src/examples/ExampleAlerts.vue +78 -0
- package/src/examples/ExampleAvatars.vue +44 -0
- package/src/examples/ExampleBadges.vue +48 -0
- package/src/examples/ExampleBreadcrumbs.vue +46 -0
- package/src/examples/ExampleButtons.vue +140 -0
- package/src/examples/ExampleCalendars.vue +40 -0
- package/src/examples/ExampleCards.vue +94 -0
- package/src/examples/ExampleCheckboxes.vue +123 -0
- package/src/examples/ExampleCopyClipboard.vue +47 -0
- package/src/examples/ExampleDividers.vue +39 -0
- package/src/examples/ExampleDrawers.vue +67 -0
- package/src/examples/ExampleDropdowns.vue +114 -0
- package/src/examples/ExampleFlexGrid.vue +122 -0
- package/src/examples/ExampleInputs.vue +234 -0
- package/src/examples/ExampleKBD.vue +65 -0
- package/src/examples/ExampleModals.vue +143 -0
- package/src/examples/ExamplePalette.vue +159 -0
- package/src/examples/ExamplePopouts.vue +41 -0
- package/src/examples/ExampleSheets.vue +77 -0
- package/src/examples/ExampleSidebars.vue +270 -0
- package/src/examples/ExampleSkeletons.vue +26 -0
- package/src/examples/ExampleSpinners.vue +78 -0
- package/src/examples/ExampleTables.vue +195 -0
- package/src/examples/ExampleTabs.vue +119 -0
- package/src/examples/ExampleToasts.vue +96 -0
- package/src/examples/ExampleTooltips.vue +70 -0
- package/src/examples/shared/ExampleColor.vue +28 -0
- package/src/index.ts +4 -11
- package/src/internal/Backdrop/backdrop.scss +7 -1
- package/src/shared/helpers.ts +43 -0
- package/src/shared/theme.ts +22 -0
- package/src/style/animation.scss +1 -0
- package/src/style/core.scss +30 -55
- package/src/style/layout.scss +74 -9
- package/src/style/text.scss +18 -0
- package/src/style/theme.scss +195 -0
- package/src/style/tooltip.scss +22 -4
- package/src/style/typography.scss +95 -18
- package/dist/components/Table/Row.vue.d.ts +0 -16
- package/src/components/Table/Row.vue +0 -9
- /package/dist/components/Table/{Header.vue.d.ts → Head.vue.d.ts} +0 -0
- /package/dist/components/Table/{Table.vue.d.ts → Root.vue.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dolanske/vui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"private": false,
|
|
6
|
-
"description": "Brother in Christ there's a new UI library
|
|
6
|
+
"description": "Brother in Christ there's a new UI library",
|
|
7
7
|
"author": "dolanske",
|
|
8
8
|
"license": "GPL-3.0",
|
|
9
9
|
"sass": "src/index.scss",
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"build": "vue-tsc -b && vite build",
|
|
44
44
|
"preview": "vite preview",
|
|
45
45
|
"lint": "eslint .",
|
|
46
|
-
"lint:fix": "eslint . --fix"
|
|
46
|
+
"lint:fix": "eslint . --fix",
|
|
47
|
+
"test": "vitest"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
50
|
"@floating-ui/vue": "^1.1.5",
|
|
@@ -59,10 +60,13 @@
|
|
|
59
60
|
"@antfu/eslint-config": "^3.8.0",
|
|
60
61
|
"@iconify/vue": "^4.1.2",
|
|
61
62
|
"@vitejs/plugin-vue": "^5.1.5",
|
|
63
|
+
"@vue/test-utils": "^2.4.6",
|
|
62
64
|
"eslint": "^9.14.0",
|
|
63
65
|
"eslint-plugin-format": "^0.1.2",
|
|
66
|
+
"jsdom": "^26.0.0",
|
|
64
67
|
"typescript": "^5.6.3",
|
|
65
68
|
"vite": "^5.4.11",
|
|
69
|
+
"vitest": "^2.1.8",
|
|
66
70
|
"vue-tsc": "^2.1.10"
|
|
67
71
|
}
|
|
68
72
|
}
|
package/src/App.vue
CHANGED
|
@@ -1,176 +1,95 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import Divider from './components/Divider/Divider.vue'
|
|
3
|
+
import ExampleAccordions from './examples/ExampleAccordions.vue'
|
|
4
|
+
import ExampleAlerts from './examples/ExampleAlerts.vue'
|
|
5
|
+
import ExampleAvatars from './examples/ExampleAvatars.vue'
|
|
6
|
+
import ExampleBadges from './examples/ExampleBadges.vue'
|
|
7
|
+
import ExampleBreadcrumbs from './examples/ExampleBreadcrumbs.vue'
|
|
8
|
+
import ExampleButtons from './examples/ExampleButtons.vue'
|
|
9
|
+
import ExampleCalendars from './examples/ExampleCalendars.vue'
|
|
10
|
+
import ExampleCards from './examples/ExampleCards.vue'
|
|
11
|
+
import ExampleCheckboxes from './examples/ExampleCheckboxes.vue'
|
|
12
|
+
import ExampleCopyClipboard from './examples/ExampleCopyClipboard.vue'
|
|
13
|
+
import ExampleDividers from './examples/ExampleDividers.vue'
|
|
14
|
+
import ExampleDrawers from './examples/ExampleDrawers.vue'
|
|
15
|
+
import ExampleDropdowns from './examples/ExampleDropdowns.vue'
|
|
16
|
+
import ExampleFlexGrid from './examples/ExampleFlexGrid.vue'
|
|
17
|
+
import ExampleInputs from './examples/ExampleInputs.vue'
|
|
18
|
+
import ExampleKBD from './examples/ExampleKBD.vue'
|
|
19
|
+
import ExampleModals from './examples/ExampleModals.vue'
|
|
20
|
+
import ExamplePalette from './examples/ExamplePalette.vue'
|
|
21
|
+
import ExamplePopouts from './examples/ExamplePopouts.vue'
|
|
22
|
+
import ExampleSheets from './examples/ExampleSheets.vue'
|
|
23
|
+
import ExampleSidebars from './examples/ExampleSidebars.vue'
|
|
24
|
+
import ExampleSkeletons from './examples/ExampleSkeletons.vue'
|
|
25
|
+
import ExampleSpinners from './examples/ExampleSpinners.vue'
|
|
26
|
+
import ExampleTables from './examples/ExampleTables.vue'
|
|
27
|
+
import ExampleTabs from './examples/ExampleTabs.vue'
|
|
28
|
+
import ExampleToasts from './examples/ExampleToasts.vue'
|
|
29
|
+
import ExampleTooltips from './examples/ExampleTooltips.vue'
|
|
15
30
|
</script>
|
|
16
31
|
|
|
17
32
|
<template>
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
</
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<li>3rd level of one-liners : 20 gold coins</li>
|
|
81
|
-
</ul>
|
|
82
|
-
</li>
|
|
83
|
-
</ul>
|
|
84
|
-
</li>
|
|
85
|
-
<li>2nd level of jokes: 10 gold coins</li>
|
|
86
|
-
<li>3rd level of one-liners : 20 gold coins</li>
|
|
87
|
-
</ul>
|
|
88
|
-
<p>As a result, people stopped telling jokes, and the kingdom fell into a gloom. But there was one person who refused to let the king's foolishness get him down: a court jester named Jokester.</p>
|
|
89
|
-
|
|
90
|
-
<figure>
|
|
91
|
-
<img src="https://i.imgur.com/6WQYrfN.jpeg" alt="">
|
|
92
|
-
<figcaption>Woah look at these mountains</figcaption>
|
|
93
|
-
</figure>
|
|
94
|
-
|
|
95
|
-
<h3>Jokester's Revolt</h3>
|
|
96
|
-
<p>Jokester began sneaking into the castle in the middle of the night and leaving jokes all over the place: under the king's pillow, in his soup, even in the royal toilet. The king was furious, but he couldn't seem to stop Jokester.</p>
|
|
97
|
-
<hr>
|
|
98
|
-
<p>And then, one day, the people of the kingdom discovered that the jokes left by Jokester were so funny that they couldn't help but laugh. And once they started laughing, they couldn't stop.</p>
|
|
99
|
-
<ol>
|
|
100
|
-
<li>But the kind was stupid</li>
|
|
101
|
-
<li>He was ratioed 5 times</li>
|
|
102
|
-
</ol>
|
|
103
|
-
<h3>The People's Rebellion</h3>
|
|
104
|
-
<p>The people of the kingdom, feeling uplifted by the laughter, started to tell jokes and puns again, and soon the entire kingdom was in on the joke.</p>
|
|
105
|
-
|
|
106
|
-
<table>
|
|
107
|
-
<thead>
|
|
108
|
-
<tr>
|
|
109
|
-
<th>King's Treasury</th>
|
|
110
|
-
<th>People's happiness</th>
|
|
111
|
-
</tr>
|
|
112
|
-
</thead>
|
|
113
|
-
<tbody>
|
|
114
|
-
<tr>
|
|
115
|
-
<td>Empty</td>
|
|
116
|
-
<td>And then, one day, the people of the kingdom discovered that the jokes left by Jokester were so funny that they couldn't help but laugh. And once they started laughing, they couldn't stop.</td>
|
|
117
|
-
</tr>
|
|
118
|
-
<tr>
|
|
119
|
-
<td>Modest</td>
|
|
120
|
-
<td>Satisfied</td>
|
|
121
|
-
</tr>
|
|
122
|
-
<tr>
|
|
123
|
-
<td>Full</td>
|
|
124
|
-
<td>Ecstatic</td>
|
|
125
|
-
</tr>
|
|
126
|
-
</tbody>
|
|
127
|
-
</table>
|
|
128
|
-
<p>The king, seeing how much happier his subjects were, realized the error of his ways and repealed the joke tax. Jokester was declared a hero, and the kingdom lived happily ever after.</p>
|
|
129
|
-
<p>The moral of the story is: never <code>underestimate</code> the power of a good laugh and always be careful of bad ideas.</p>
|
|
130
|
-
|
|
131
|
-
<pre data-lang="JSON">
|
|
132
|
-
{
|
|
133
|
-
"type": "Feature",
|
|
134
|
-
"properties": {
|
|
135
|
-
"mag": 1.5,
|
|
136
|
-
"place": "77kmNWofSkwentna,Alaska",
|
|
137
|
-
"time": 1668256022741,
|
|
138
|
-
"updated": 1668256203692,
|
|
139
|
-
"tz": null,
|
|
140
|
-
"url": "https://earthquake.usgs.gov/earthquakes/eventpage/ak022eit4nup",
|
|
141
|
-
"detail": "https://earthquake.usgs.gov/earthquakes/feed/v1.0/detail/ak022eit4nup.geojson",
|
|
142
|
-
"felt": null,
|
|
143
|
-
"cdi": null,
|
|
144
|
-
"mmi": null,
|
|
145
|
-
"alert": null,
|
|
146
|
-
"status": "automatic",
|
|
147
|
-
"tsunami": 0,
|
|
148
|
-
"sig": 35,
|
|
149
|
-
"net": "ak",
|
|
150
|
-
"code": "022eit4nup",
|
|
151
|
-
"ids": ",ak022eit4nup,",
|
|
152
|
-
"sources": ",ak,",
|
|
153
|
-
"types": ",origin,phase-data,",
|
|
154
|
-
"nst": null,
|
|
155
|
-
"dmin": null,
|
|
156
|
-
"rms": 0.55,
|
|
157
|
-
"gap": null,
|
|
158
|
-
"magType": "ml",
|
|
159
|
-
"type": "earthquake",
|
|
160
|
-
"title": "M1.5-77kmNWofSkwentna,Alaska"
|
|
161
|
-
},
|
|
162
|
-
"geometry": {
|
|
163
|
-
"type": "Point",
|
|
164
|
-
"coordinates": [
|
|
165
|
-
-152.2722,
|
|
166
|
-
62.5489,
|
|
167
|
-
4.5
|
|
168
|
-
]
|
|
169
|
-
},
|
|
170
|
-
"id": "ak022eit4nup"
|
|
171
|
-
},
|
|
172
|
-
</pre>
|
|
173
|
-
</div>
|
|
174
|
-
</main>
|
|
175
|
-
</div>
|
|
33
|
+
<main vaul-drawer-wrapper>
|
|
34
|
+
<div class="container container-l p-xl">
|
|
35
|
+
<h1 class="mb-l">
|
|
36
|
+
VUI
|
|
37
|
+
</h1>
|
|
38
|
+
<p>The purpose of this page is to showcase and test every single component case</p>
|
|
39
|
+
<Divider :size="64" />
|
|
40
|
+
<ExamplePalette />
|
|
41
|
+
<Divider :size="64" />
|
|
42
|
+
<ExampleButtons />
|
|
43
|
+
<Divider :size="64" />
|
|
44
|
+
<ExampleCalendars />
|
|
45
|
+
<Divider :size="64" />
|
|
46
|
+
<ExampleBadges />
|
|
47
|
+
<Divider :size="64" />
|
|
48
|
+
<ExampleSpinners />
|
|
49
|
+
<Divider :size="64" />
|
|
50
|
+
<ExampleAvatars />
|
|
51
|
+
<Divider :size="64" />
|
|
52
|
+
<ExampleAlerts />
|
|
53
|
+
<Divider :size="64" />
|
|
54
|
+
<ExampleSkeletons />
|
|
55
|
+
<Divider :size="64" />
|
|
56
|
+
<ExampleAccordions />
|
|
57
|
+
<Divider :size="64" />
|
|
58
|
+
<ExampleBreadcrumbs />
|
|
59
|
+
<Divider :size="64" />
|
|
60
|
+
<ExampleCards />
|
|
61
|
+
<Divider :size="64" />
|
|
62
|
+
<ExampleCheckboxes />
|
|
63
|
+
<Divider :size="64" />
|
|
64
|
+
<ExampleCopyClipboard />
|
|
65
|
+
<Divider :size="64" />
|
|
66
|
+
<ExampleTabs />
|
|
67
|
+
<Divider :size="64" />
|
|
68
|
+
<ExampleInputs />
|
|
69
|
+
<Divider :size="64" />
|
|
70
|
+
<ExampleToasts />
|
|
71
|
+
<Divider :size="64" />
|
|
72
|
+
<ExampleTooltips />
|
|
73
|
+
<Divider :size="64" />
|
|
74
|
+
<ExampleSheets />
|
|
75
|
+
<Divider :size="64" />
|
|
76
|
+
<ExampleModals />
|
|
77
|
+
<Divider :size="64" />
|
|
78
|
+
<ExampleDrawers />
|
|
79
|
+
<Divider :size="64" />
|
|
80
|
+
<ExampleKBD />
|
|
81
|
+
<Divider :size="64" />
|
|
82
|
+
<ExamplePopouts />
|
|
83
|
+
<Divider :size="64" />
|
|
84
|
+
<ExampleDividers />
|
|
85
|
+
<Divider :size="64" />
|
|
86
|
+
<ExampleDropdowns />
|
|
87
|
+
<Divider :size="64" />
|
|
88
|
+
<ExampleFlexGrid />
|
|
89
|
+
<Divider :size="64" />
|
|
90
|
+
<ExampleTables />
|
|
91
|
+
<Divider :size="64" />
|
|
92
|
+
<ExampleSidebars />
|
|
93
|
+
</div>
|
|
94
|
+
</main>
|
|
176
95
|
</template>
|
|
@@ -9,19 +9,24 @@ interface Props {
|
|
|
9
9
|
* Override the variant's default icon
|
|
10
10
|
*/
|
|
11
11
|
icon?: string
|
|
12
|
-
|
|
13
12
|
/**
|
|
14
|
-
* Setting a title and description will use slightly different styling other
|
|
13
|
+
* Setting a title and description will use slightly different styling other
|
|
14
|
+
* than slots.
|
|
15
15
|
*/
|
|
16
16
|
title?: string
|
|
17
|
+
/**
|
|
18
|
+
* Use strong color
|
|
19
|
+
*/
|
|
20
|
+
filled?: boolean
|
|
17
21
|
description?: string
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
const {
|
|
21
|
-
icon = 'ph:
|
|
25
|
+
icon = 'ph:chat-teardrop',
|
|
22
26
|
variant = 'neutral',
|
|
23
27
|
title,
|
|
24
28
|
description,
|
|
29
|
+
filled,
|
|
25
30
|
} = defineProps<Props>()
|
|
26
31
|
|
|
27
32
|
const actualIcon = computed(() => {
|
|
@@ -36,9 +41,9 @@ const actualIcon = computed(() => {
|
|
|
36
41
|
</script>
|
|
37
42
|
|
|
38
43
|
<template>
|
|
39
|
-
<div class="vui-alert" :class="[`vui-alert-variant-${variant}`]">
|
|
44
|
+
<div class="vui-alert" :class="[{ filled }, `vui-alert-variant-${variant}`]">
|
|
40
45
|
<Icon v-if="actualIcon" class="vui-alert-icon" :icon="actualIcon" />
|
|
41
|
-
<div v-if="$slots.default" class="vui-alert-content">
|
|
46
|
+
<div v-if="$slots.default && !title" class="vui-alert-content">
|
|
42
47
|
<slot />
|
|
43
48
|
</div>
|
|
44
49
|
<div v-else class="vui-alert-default-content">
|
|
@@ -46,6 +51,7 @@ const actualIcon = computed(() => {
|
|
|
46
51
|
<p v-if="description">
|
|
47
52
|
{{ description }}
|
|
48
53
|
</p>
|
|
54
|
+
<slot v-else-if="$slots.default" />
|
|
49
55
|
</div>
|
|
50
56
|
|
|
51
57
|
<slot name="end" />
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
padding: var(--space-s);
|
|
6
6
|
font-size: var(--font-size-m);
|
|
7
7
|
flex-wrap: nowrap;
|
|
8
|
-
align-items:
|
|
8
|
+
align-items: center;
|
|
9
|
+
border: 1px solid var(--color-border);
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
.vui-alert-icon {
|
|
11
12
|
width: 22px;
|
|
12
13
|
height: 22px;
|
|
13
14
|
}
|
|
@@ -18,63 +19,143 @@
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
.vui-alert-default-content {
|
|
21
|
-
padding-top: 3px;
|
|
22
|
-
|
|
23
22
|
strong {
|
|
24
23
|
display: block;
|
|
25
24
|
font-size: var(--font-size-m);
|
|
26
|
-
|
|
27
|
-
margin-bottom: 6px;
|
|
25
|
+
margin-bottom: 2px;
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
p {
|
|
31
|
-
font-size: var(--font-size-
|
|
29
|
+
font-size: var(--font-size-s);
|
|
32
30
|
color: var(--color-text-light);
|
|
33
|
-
font-weight: 350;
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
33
|
|
|
37
34
|
.vui-alert-content {
|
|
38
35
|
font-size: var(--font-size-m);
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.filled {
|
|
40
|
+
border: none !important;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
&.vui-alert-variant-neutral {
|
|
42
|
-
|
|
44
|
+
.vui-alert-icon path {
|
|
45
|
+
color: var(--color-text-light);
|
|
46
|
+
}
|
|
43
47
|
|
|
44
|
-
|
|
45
|
-
color: var(--color-
|
|
48
|
+
&.filled {
|
|
49
|
+
background-color: var(--color-bg-raised);
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
&.vui-alert-variant-info {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
svg path {
|
|
54
|
+
.vui-alert-icon path {
|
|
53
55
|
color: var(--color-text-blue);
|
|
54
56
|
}
|
|
57
|
+
|
|
58
|
+
&.filled {
|
|
59
|
+
background-color: hsla(from var(--color-bg-blue-lowered) h s l / 0.5);
|
|
60
|
+
}
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
&.vui-alert-variant-success {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
svg path {
|
|
64
|
+
.vui-alert-icon path {
|
|
61
65
|
color: var(--color-text-green);
|
|
62
66
|
}
|
|
67
|
+
|
|
68
|
+
&.filled {
|
|
69
|
+
background-color: hsla(from var(--color-bg-green-lowered) h s l / 0.4);
|
|
70
|
+
}
|
|
63
71
|
}
|
|
64
72
|
|
|
65
73
|
&.vui-alert-variant-warning {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
svg path {
|
|
74
|
+
.vui-alert-icon path {
|
|
69
75
|
color: var(--color-text-yellow);
|
|
70
76
|
}
|
|
77
|
+
|
|
78
|
+
&.filled {
|
|
79
|
+
background-color: hsla(from var(--color-bg-yellow-lowered) h s l / 0.6);
|
|
80
|
+
}
|
|
71
81
|
}
|
|
72
82
|
|
|
73
83
|
&.vui-alert-variant-danger {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
svg path {
|
|
84
|
+
.vui-alert-icon path {
|
|
77
85
|
color: var(--color-text-red);
|
|
78
86
|
}
|
|
87
|
+
|
|
88
|
+
&.filled {
|
|
89
|
+
background-color: hsla(from var(--color-bg-red-lowered) h s l / 0.5);
|
|
90
|
+
}
|
|
79
91
|
}
|
|
80
92
|
}
|
|
93
|
+
|
|
94
|
+
:root.light {
|
|
95
|
+
.vui-alert.filled {
|
|
96
|
+
border: none;
|
|
97
|
+
|
|
98
|
+
&.vui-alert-variant-neutral {
|
|
99
|
+
background-color: var(--color-bg-medium);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.vui-alert-variant-danger {
|
|
103
|
+
background-color: hsla(from var(--color-bg-red-raised) h s l / 0.15);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&.vui-alert-variant-warning {
|
|
107
|
+
background-color: hsla(from var(--color-bg-yellow-raised) h s l / 0.2);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&.vui-alert-variant-success {
|
|
111
|
+
background-color: hsla(from var(--color-bg-green-raised) h s l / 0.15);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.vui-alert-variant-info {
|
|
115
|
+
background-color: hsla(from var(--color-bg-blue-raised) h s l / 0.15);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// .vui-alert.vui-alert-variant-success:not(.filled, .outline) {
|
|
120
|
+
// background-color: hsla(from var(--color-text-green) h s l / 0.15);
|
|
121
|
+
// }
|
|
122
|
+
|
|
123
|
+
// .vui-alert.vui-alert-variant-danger .vui-alert-icon path {
|
|
124
|
+
// color: var(--color-border-red);
|
|
125
|
+
// }
|
|
126
|
+
|
|
127
|
+
// .vui-alert.vui-alert-variant-warning .vui-alert-icon path {
|
|
128
|
+
// color: var(--color-border-yellow);
|
|
129
|
+
// }
|
|
130
|
+
|
|
131
|
+
// .vui-alert.vui-alert-variant-success .vui-alert-icon path {
|
|
132
|
+
// color: var(--color-border-green);
|
|
133
|
+
// }
|
|
134
|
+
|
|
135
|
+
// .vui-alert.vui-alert-variant-info .vui-alert-icon path {
|
|
136
|
+
// color: var(--color-border-blue);
|
|
137
|
+
// }
|
|
138
|
+
|
|
139
|
+
// .vui-alert {
|
|
140
|
+
// &.filled {
|
|
141
|
+
// &.vui-alert-variant-danger .vui-alert-icon path,
|
|
142
|
+
// &.vui-alert-variant-warning .vui-alert-icon path,
|
|
143
|
+
// &.vui-alert-variant-success .vui-alert-icon path,
|
|
144
|
+
// &.vui-alert-variant-info .vui-alert-icon path {
|
|
145
|
+
// color: var(--color-text-light);
|
|
146
|
+
// }
|
|
147
|
+
|
|
148
|
+
// strong,
|
|
149
|
+
// p {
|
|
150
|
+
// color: var(--color-text);
|
|
151
|
+
// }
|
|
152
|
+
// }
|
|
153
|
+
// }
|
|
154
|
+
|
|
155
|
+
// .vui-alert.filled.vui-alert-variant-danger .vui-alert-icon path,
|
|
156
|
+
// .vui-alert.filled.vui-alert-variant-warning .vui-alert-icon path,
|
|
157
|
+
// .vui-alert.filled.vui-alert-variant-success .vui-alert-icon path,
|
|
158
|
+
// .vui-alert.filled.vui-alert-variant-info .vui-alert-icon path {
|
|
159
|
+
// color: var(--color-text-light);
|
|
160
|
+
// }
|
|
161
|
+
}
|