numori-ui 0.4.0 → 0.5.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 +66 -0
- package/README.md +18 -19
- package/dist/components/AppShell.js +234 -0
- package/dist/components/AppShell.js.map +1 -0
- package/dist/components/Checkbox.js +11 -2
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/CopyField.js +195 -0
- package/dist/components/CopyField.js.map +1 -0
- package/dist/components/DescriptionList.js +116 -0
- package/dist/components/DescriptionList.js.map +1 -0
- package/dist/components/EmptyState.js +123 -0
- package/dist/components/EmptyState.js.map +1 -0
- package/dist/components/FormField.js +43 -13
- package/dist/components/FormField.js.map +1 -1
- package/dist/components/Input.js +15 -1
- package/dist/components/Input.js.map +1 -1
- package/dist/components/PageHeader.js +106 -0
- package/dist/components/PageHeader.js.map +1 -0
- package/dist/components/Pagination.js +236 -0
- package/dist/components/Pagination.js.map +1 -0
- package/dist/components/Segmented.js +10 -2
- package/dist/components/Segmented.js.map +1 -1
- package/dist/components/Select.js +10 -1
- package/dist/components/Select.js.map +1 -1
- package/dist/components/Sidebar.js +69 -0
- package/dist/components/Sidebar.js.map +1 -0
- package/dist/components/SidebarGroup.js +50 -0
- package/dist/components/SidebarGroup.js.map +1 -0
- package/dist/components/SidebarItem.js +167 -0
- package/dist/components/SidebarItem.js.map +1 -0
- package/dist/components/StatCard.js +185 -0
- package/dist/components/StatCard.js.map +1 -0
- package/dist/components/Table.js +182 -50
- package/dist/components/Table.js.map +1 -1
- package/dist/components/Tabs.js +216 -0
- package/dist/components/Tabs.js.map +1 -0
- package/dist/components/Toggle.js +11 -2
- package/dist/components/Toggle.js.map +1 -1
- package/dist/components/index.js +97 -80
- package/dist/components/index.js.map +1 -1
- package/dist/icons/mdi.js +10 -0
- package/dist/icons/mdi.js.map +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +50 -39
- package/dist/index.js.map +1 -1
- package/dist/internal/formField.js +26 -0
- package/dist/internal/formField.js.map +1 -0
- package/dist/manifest.js +11 -0
- package/dist/manifest.js.map +1 -1
- package/package.json +1 -1
- package/src/components/AppShell.vue +231 -0
- package/src/components/Checkbox.vue +5 -0
- package/src/components/CopyField.vue +178 -0
- package/src/components/DescriptionList.vue +114 -0
- package/src/components/EmptyState.vue +107 -0
- package/src/components/FormField.vue +37 -4
- package/src/components/Input.vue +9 -0
- package/src/components/PageHeader.vue +102 -0
- package/src/components/Pagination.vue +199 -0
- package/src/components/Segmented.vue +5 -0
- package/src/components/Select.vue +5 -0
- package/src/components/Sidebar.vue +61 -0
- package/src/components/SidebarGroup.vue +43 -0
- package/src/components/SidebarItem.vue +159 -0
- package/src/components/StatCard.vue +165 -0
- package/src/components/Table.vue +148 -18
- package/src/components/Tabs.vue +217 -0
- package/src/components/Toggle.vue +5 -0
- package/src/components/index.js +33 -5
- package/src/icons/mdi.js +10 -0
- package/src/internal/formField.js +23 -0
- package/src/manifest.js +11 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div
|
|
4
|
+
role="tablist"
|
|
5
|
+
:aria-label="ariaLabel || undefined"
|
|
6
|
+
:class="listClass"
|
|
7
|
+
@keydown="onKeydown"
|
|
8
|
+
>
|
|
9
|
+
<button
|
|
10
|
+
v-for="(tab, index) in tabs"
|
|
11
|
+
:id="tabId(index)"
|
|
12
|
+
:key="tab.value"
|
|
13
|
+
:ref="(el) => (tabEls[index] = el)"
|
|
14
|
+
type="button"
|
|
15
|
+
role="tab"
|
|
16
|
+
:aria-selected="index === activeIndex ? 'true' : 'false'"
|
|
17
|
+
:aria-controls="panel ? panelId : undefined"
|
|
18
|
+
:tabindex="index === focusIndex ? 0 : -1"
|
|
19
|
+
:disabled="tab.disabled"
|
|
20
|
+
:class="tabClass(index, tab)"
|
|
21
|
+
@click="select(index)"
|
|
22
|
+
>
|
|
23
|
+
<UiIcon v-if="tab.icon" :name="tab.icon" class="size-4 shrink-0" />
|
|
24
|
+
<span>{{ tab.label }}</span>
|
|
25
|
+
<span
|
|
26
|
+
v-if="tab.badge !== undefined && tab.badge !== null && tab.badge !== ''"
|
|
27
|
+
class="inline-flex min-w-5 items-center justify-center rounded-full px-1.5 text-xs font-semibold tabular-nums"
|
|
28
|
+
:class="
|
|
29
|
+
index === activeIndex
|
|
30
|
+
? 'bg-primary-100 text-primary-700 dark:bg-primary-400/20 dark:text-primary-200'
|
|
31
|
+
: 'bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-300'
|
|
32
|
+
"
|
|
33
|
+
>{{ tab.badge }}</span
|
|
34
|
+
>
|
|
35
|
+
</button>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div
|
|
39
|
+
v-if="panel"
|
|
40
|
+
:id="panelId"
|
|
41
|
+
role="tabpanel"
|
|
42
|
+
:aria-labelledby="activeIndex >= 0 ? tabId(activeIndex) : undefined"
|
|
43
|
+
tabindex="0"
|
|
44
|
+
class="focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-primary-500"
|
|
45
|
+
:class="panelClass"
|
|
46
|
+
>
|
|
47
|
+
<slot :active="modelValue" />
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script setup>
|
|
53
|
+
/**
|
|
54
|
+
* UiTabs — an accessible tab list, with an optional panel for the active tab.
|
|
55
|
+
*
|
|
56
|
+
* Implements the WAI-ARIA tabs pattern: `role="tablist"` / `"tab"` /
|
|
57
|
+
* `"tabpanel"`, a single tab stop (roving `tabindex`), and arrow keys, Home and
|
|
58
|
+
* End to move between tabs. Moving with the keyboard selects the tab
|
|
59
|
+
* (automatic activation), skipping disabled tabs.
|
|
60
|
+
*
|
|
61
|
+
* Render the panel through the default slot, which receives the active value.
|
|
62
|
+
* When the content lives elsewhere — a routed `<RouterView>` below the tabs,
|
|
63
|
+
* say — set `:panel="false"` and use the tabs as navigation only.
|
|
64
|
+
*
|
|
65
|
+
* Two looks: `line` (an underline under the active tab, for page sections) and
|
|
66
|
+
* `pill` (a segmented track, for compact switches inside cards).
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* <UiTabs
|
|
70
|
+
* v-model="tab"
|
|
71
|
+
* aria-label="App sections"
|
|
72
|
+
* :tabs="[
|
|
73
|
+
* { value: 'overview', label: 'Overview', icon: 'mdi:view-grid' },
|
|
74
|
+
* { value: 'keys', label: 'Keys', badge: 2 },
|
|
75
|
+
* { value: 'danger', label: 'Danger zone' },
|
|
76
|
+
* ]"
|
|
77
|
+
* >
|
|
78
|
+
* <template #default="{ active }">
|
|
79
|
+
* <OverviewPanel v-if="active === 'overview'" />
|
|
80
|
+
* <KeysPanel v-else-if="active === 'keys'" />
|
|
81
|
+
* </template>
|
|
82
|
+
* </UiTabs>
|
|
83
|
+
*
|
|
84
|
+
* @emits {string} update:modelValue — The selected tab's value.
|
|
85
|
+
*
|
|
86
|
+
* @slot default — Panel content. Scope: `{ active }`.
|
|
87
|
+
*/
|
|
88
|
+
import { computed, nextTick, useId } from 'vue'
|
|
89
|
+
import UiIcon from '../icons/Icon.vue'
|
|
90
|
+
|
|
91
|
+
const props = defineProps({
|
|
92
|
+
/**
|
|
93
|
+
* Value of the active tab.
|
|
94
|
+
* @type {string}
|
|
95
|
+
* @default ''
|
|
96
|
+
*/
|
|
97
|
+
modelValue: { type: String, default: '' },
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Tabs, left to right. Each is `{ value, label, icon?, badge?, disabled? }`.
|
|
101
|
+
* @type {Array<{ value: string, label: string, icon?: string, badge?: string | number, disabled?: boolean }>}
|
|
102
|
+
*/
|
|
103
|
+
tabs: { type: Array, required: true },
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Accessible name of the tab list.
|
|
107
|
+
* @type {string}
|
|
108
|
+
* @default ''
|
|
109
|
+
*/
|
|
110
|
+
ariaLabel: { type: String, default: '' },
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Visual style.
|
|
114
|
+
* @type {string}
|
|
115
|
+
* @default 'line'
|
|
116
|
+
* @values 'line' | 'pill'
|
|
117
|
+
*/
|
|
118
|
+
variant: { type: String, default: 'line' },
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Render a `tabpanel` holding the default slot. Turn off when the tabs only
|
|
122
|
+
* navigate and the content is rendered elsewhere.
|
|
123
|
+
* @type {boolean}
|
|
124
|
+
* @default true
|
|
125
|
+
*/
|
|
126
|
+
panel: { type: Boolean, default: true },
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Classes for the panel.
|
|
130
|
+
* @type {string}
|
|
131
|
+
* @default 'pt-6'
|
|
132
|
+
*/
|
|
133
|
+
panelClass: { type: String, default: 'pt-6' },
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
const emit = defineEmits(['update:modelValue'])
|
|
137
|
+
|
|
138
|
+
const baseId = useId()
|
|
139
|
+
const panelId = `${baseId}-panel`
|
|
140
|
+
const tabId = (index) => `${baseId}-tab-${index}`
|
|
141
|
+
|
|
142
|
+
/** Template refs, written by the function ref on each button. */
|
|
143
|
+
const tabEls = []
|
|
144
|
+
|
|
145
|
+
const activeIndex = computed(() => props.tabs.findIndex((t) => t.value === props.modelValue))
|
|
146
|
+
|
|
147
|
+
/** The tab that holds the single tab stop: the active one, else the first enabled. */
|
|
148
|
+
const focusIndex = computed(() => {
|
|
149
|
+
if (activeIndex.value >= 0 && !props.tabs[activeIndex.value].disabled) return activeIndex.value
|
|
150
|
+
return props.tabs.findIndex((t) => !t.disabled)
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
function select(index) {
|
|
154
|
+
const tab = props.tabs[index]
|
|
155
|
+
if (!tab || tab.disabled) return
|
|
156
|
+
if (tab.value !== props.modelValue) emit('update:modelValue', tab.value)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function step(from, delta) {
|
|
160
|
+
const count = props.tabs.length
|
|
161
|
+
for (let i = 1; i <= count; i++) {
|
|
162
|
+
const next = (from + delta * i + count * i) % count
|
|
163
|
+
if (!props.tabs[next].disabled) return next
|
|
164
|
+
}
|
|
165
|
+
return from
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function onKeydown(event) {
|
|
169
|
+
const current = tabEls.indexOf(event.target)
|
|
170
|
+
if (current < 0) return
|
|
171
|
+
let next = null
|
|
172
|
+
if (event.key === 'ArrowRight' || event.key === 'ArrowDown') next = step(current, 1)
|
|
173
|
+
else if (event.key === 'ArrowLeft' || event.key === 'ArrowUp') next = step(current, -1)
|
|
174
|
+
else if (event.key === 'Home') next = props.tabs.findIndex((t) => !t.disabled)
|
|
175
|
+
else if (event.key === 'End') {
|
|
176
|
+
for (let i = props.tabs.length - 1; i >= 0; i--) {
|
|
177
|
+
if (!props.tabs[i].disabled) {
|
|
178
|
+
next = i
|
|
179
|
+
break
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (next === null || next < 0) return
|
|
184
|
+
event.preventDefault()
|
|
185
|
+
select(next)
|
|
186
|
+
nextTick(() => tabEls[next]?.focus())
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const listClass = computed(() =>
|
|
190
|
+
props.variant === 'pill'
|
|
191
|
+
? 'inline-flex max-w-full gap-1 overflow-x-auto rounded-xl bg-gray-100 p-1 dark:bg-gray-800'
|
|
192
|
+
: 'flex gap-6 overflow-x-auto border-b border-gray-200 dark:border-gray-800',
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
function tabClass(index, tab) {
|
|
196
|
+
const active = index === activeIndex.value
|
|
197
|
+
const base =
|
|
198
|
+
'inline-flex shrink-0 items-center gap-2 text-sm font-medium whitespace-nowrap transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500 disabled:cursor-not-allowed disabled:opacity-40'
|
|
199
|
+
if (props.variant === 'pill') {
|
|
200
|
+
return [
|
|
201
|
+
base,
|
|
202
|
+
'rounded-lg px-3 py-1.5',
|
|
203
|
+
active
|
|
204
|
+
? 'bg-white text-gray-900 shadow-sm dark:bg-gray-900 dark:text-gray-100'
|
|
205
|
+
: 'text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-100',
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
return [
|
|
209
|
+
base,
|
|
210
|
+
'-mb-px border-b-2 px-1 py-3',
|
|
211
|
+
active
|
|
212
|
+
? 'border-primary-500 text-primary-600 dark:border-primary-400 dark:text-primary-300'
|
|
213
|
+
: 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-800 dark:text-gray-400 dark:hover:border-gray-600 dark:hover:text-gray-200',
|
|
214
|
+
tab.disabled ? 'hover:border-transparent' : '',
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
</script>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- Accessible toggle switch rendered as a button with role="switch" -->
|
|
3
3
|
<button
|
|
4
|
+
:id="field?.controlId.value"
|
|
4
5
|
type="button"
|
|
5
6
|
:disabled="disabled"
|
|
7
|
+
:aria-describedby="field?.describedBy.value"
|
|
6
8
|
class="relative inline-flex items-center shrink-0 rounded-full transition-colors"
|
|
7
9
|
:class="[
|
|
8
10
|
sizeClasses.track,
|
|
@@ -40,6 +42,7 @@
|
|
|
40
42
|
* @emits {boolean} update:modelValue — Emitted when the toggle is switched (v-model)
|
|
41
43
|
*/
|
|
42
44
|
import { computed } from 'vue'
|
|
45
|
+
import { useFormField } from '../internal/formField.js'
|
|
43
46
|
const props = defineProps({
|
|
44
47
|
/**
|
|
45
48
|
* Current on/off state (v-model).
|
|
@@ -82,6 +85,8 @@ const props = defineProps({
|
|
|
82
85
|
|
|
83
86
|
const emit = defineEmits(['update:modelValue'])
|
|
84
87
|
|
|
88
|
+
const field = useFormField()
|
|
89
|
+
|
|
85
90
|
// Active color uses different shade intensities per size for visual consistency
|
|
86
91
|
const activeColor = computed(() => {
|
|
87
92
|
if (props.size === 'sm') {
|
package/src/components/index.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* consumers; `scripts/verify.mjs` keeps the two in sync.
|
|
11
11
|
*/
|
|
12
12
|
import Alert from './Alert.vue'
|
|
13
|
+
import AppShell from './AppShell.vue'
|
|
13
14
|
import Avatar from './Avatar.vue'
|
|
14
15
|
import Badge from './Badge.vue'
|
|
15
16
|
import Banner from './Banner.vue'
|
|
@@ -18,11 +19,14 @@ import Button from './Button.vue'
|
|
|
18
19
|
import Card from './Card.vue'
|
|
19
20
|
import Checkbox from './Checkbox.vue'
|
|
20
21
|
import CodeBlock from './CodeBlock.vue'
|
|
22
|
+
import CopyField from './CopyField.vue'
|
|
23
|
+
import DescriptionList from './DescriptionList.vue'
|
|
21
24
|
import Divider from './Divider.vue'
|
|
22
25
|
import Dropdown from './Dropdown.vue'
|
|
23
26
|
import DropdownItem from './DropdownItem.vue'
|
|
24
27
|
import DropdownRow from './DropdownRow.vue'
|
|
25
28
|
import DropdownSubmenu from './DropdownSubmenu.vue'
|
|
29
|
+
import EmptyState from './EmptyState.vue'
|
|
26
30
|
import FileInput from './FileInput.vue'
|
|
27
31
|
import FormField from './FormField.vue'
|
|
28
32
|
import IconTile from './IconTile.vue'
|
|
@@ -32,6 +36,8 @@ import ListMenu from './ListMenu.vue'
|
|
|
32
36
|
import ListMenuItem from './ListMenuItem.vue'
|
|
33
37
|
import Modal from './Modal.vue'
|
|
34
38
|
import Numpad from './Numpad.vue'
|
|
39
|
+
import PageHeader from './PageHeader.vue'
|
|
40
|
+
import Pagination from './Pagination.vue'
|
|
35
41
|
import Popup from './Popup.vue'
|
|
36
42
|
import ProgressBar from './ProgressBar.vue'
|
|
37
43
|
import Prompt from './Prompt.vue'
|
|
@@ -39,10 +45,15 @@ import Radio from './Radio.vue'
|
|
|
39
45
|
import SectionHeading from './SectionHeading.vue'
|
|
40
46
|
import Segmented from './Segmented.vue'
|
|
41
47
|
import Select from './Select.vue'
|
|
48
|
+
import Sidebar from './Sidebar.vue'
|
|
49
|
+
import SidebarGroup from './SidebarGroup.vue'
|
|
50
|
+
import SidebarItem from './SidebarItem.vue'
|
|
42
51
|
import Slider from './Slider.vue'
|
|
43
52
|
import Spinner from './Spinner.vue'
|
|
53
|
+
import StatCard from './StatCard.vue'
|
|
44
54
|
import Stepper from './Stepper.vue'
|
|
45
55
|
import Table from './Table.vue'
|
|
56
|
+
import Tabs from './Tabs.vue'
|
|
46
57
|
import ThemeToggle from './ThemeToggle.vue'
|
|
47
58
|
import Toast from './Toast.vue'
|
|
48
59
|
import Toggle from './Toggle.vue'
|
|
@@ -51,6 +62,7 @@ import Icon from '../icons/Icon.vue'
|
|
|
51
62
|
|
|
52
63
|
export {
|
|
53
64
|
Alert as UiAlert,
|
|
65
|
+
AppShell as UiAppShell,
|
|
54
66
|
Avatar as UiAvatar,
|
|
55
67
|
Badge as UiBadge,
|
|
56
68
|
Banner as UiBanner,
|
|
@@ -59,11 +71,14 @@ export {
|
|
|
59
71
|
Card as UiCard,
|
|
60
72
|
Checkbox as UiCheckbox,
|
|
61
73
|
CodeBlock as UiCodeBlock,
|
|
74
|
+
CopyField as UiCopyField,
|
|
75
|
+
DescriptionList as UiDescriptionList,
|
|
62
76
|
Divider as UiDivider,
|
|
63
77
|
Dropdown as UiDropdown,
|
|
64
78
|
DropdownItem as UiDropdownItem,
|
|
65
79
|
DropdownRow as UiDropdownRow,
|
|
66
80
|
DropdownSubmenu as UiDropdownSubmenu,
|
|
81
|
+
EmptyState as UiEmptyState,
|
|
67
82
|
FileInput as UiFileInput,
|
|
68
83
|
FormField as UiFormField,
|
|
69
84
|
IconTile as UiIconTile,
|
|
@@ -73,6 +88,8 @@ export {
|
|
|
73
88
|
ListMenuItem as UiListMenuItem,
|
|
74
89
|
Modal as UiModal,
|
|
75
90
|
Numpad as UiNumpad,
|
|
91
|
+
PageHeader as UiPageHeader,
|
|
92
|
+
Pagination as UiPagination,
|
|
76
93
|
Popup as UiPopup,
|
|
77
94
|
ProgressBar as UiProgressBar,
|
|
78
95
|
Prompt as UiPrompt,
|
|
@@ -80,10 +97,15 @@ export {
|
|
|
80
97
|
SectionHeading as UiSectionHeading,
|
|
81
98
|
Segmented as UiSegmented,
|
|
82
99
|
Select as UiSelect,
|
|
100
|
+
Sidebar as UiSidebar,
|
|
101
|
+
SidebarGroup as UiSidebarGroup,
|
|
102
|
+
SidebarItem as UiSidebarItem,
|
|
83
103
|
Slider as UiSlider,
|
|
84
104
|
Spinner as UiSpinner,
|
|
105
|
+
StatCard as UiStatCard,
|
|
85
106
|
Stepper as UiStepper,
|
|
86
107
|
Table as UiTable,
|
|
108
|
+
Tabs as UiTabs,
|
|
87
109
|
ThemeToggle as UiThemeToggle,
|
|
88
110
|
Toast as UiToast,
|
|
89
111
|
Toggle as UiToggle,
|
|
@@ -91,13 +113,9 @@ export {
|
|
|
91
113
|
Icon as UiIcon,
|
|
92
114
|
}
|
|
93
115
|
|
|
94
|
-
/**
|
|
95
|
-
* Base-name -> component map, used by the Vue plugin to register everything
|
|
96
|
-
* under whatever prefix the host chose.
|
|
97
|
-
* @type {Record<string, import('vue').Component>}
|
|
98
|
-
*/
|
|
99
116
|
export const components = {
|
|
100
117
|
Alert,
|
|
118
|
+
AppShell,
|
|
101
119
|
Avatar,
|
|
102
120
|
Badge,
|
|
103
121
|
Banner,
|
|
@@ -106,11 +124,14 @@ export const components = {
|
|
|
106
124
|
Card,
|
|
107
125
|
Checkbox,
|
|
108
126
|
CodeBlock,
|
|
127
|
+
CopyField,
|
|
128
|
+
DescriptionList,
|
|
109
129
|
Divider,
|
|
110
130
|
Dropdown,
|
|
111
131
|
DropdownItem,
|
|
112
132
|
DropdownRow,
|
|
113
133
|
DropdownSubmenu,
|
|
134
|
+
EmptyState,
|
|
114
135
|
FileInput,
|
|
115
136
|
FormField,
|
|
116
137
|
IconTile,
|
|
@@ -120,6 +141,8 @@ export const components = {
|
|
|
120
141
|
ListMenuItem,
|
|
121
142
|
Modal,
|
|
122
143
|
Numpad,
|
|
144
|
+
PageHeader,
|
|
145
|
+
Pagination,
|
|
123
146
|
Popup,
|
|
124
147
|
ProgressBar,
|
|
125
148
|
Prompt,
|
|
@@ -127,10 +150,15 @@ export const components = {
|
|
|
127
150
|
SectionHeading,
|
|
128
151
|
Segmented,
|
|
129
152
|
Select,
|
|
153
|
+
Sidebar,
|
|
154
|
+
SidebarGroup,
|
|
155
|
+
SidebarItem,
|
|
130
156
|
Slider,
|
|
131
157
|
Spinner,
|
|
158
|
+
StatCard,
|
|
132
159
|
Stepper,
|
|
133
160
|
Table,
|
|
161
|
+
Tabs,
|
|
134
162
|
ThemeToggle,
|
|
135
163
|
Toast,
|
|
136
164
|
Toggle,
|
package/src/icons/mdi.js
CHANGED
|
@@ -21,6 +21,8 @@ export const mdiPaths = {
|
|
|
21
21
|
'account-group': "M12 5.5A3.5 3.5 0 0 1 15.5 9a3.5 3.5 0 0 1-3.5 3.5A3.5 3.5 0 0 1 8.5 9A3.5 3.5 0 0 1 12 5.5M5 8c.56 0 1.08.15 1.53.42c-.15 1.43.27 2.85 1.13 3.96C7.16 13.34 6.16 14 5 14a3 3 0 0 1-3-3a3 3 0 0 1 3-3m14 0a3 3 0 0 1 3 3a3 3 0 0 1-3 3c-1.16 0-2.16-.66-2.66-1.62a5.54 5.54 0 0 0 1.13-3.96c.45-.27.97-.42 1.53-.42M5.5 18.25c0-2.07 2.91-3.75 6.5-3.75s6.5 1.68 6.5 3.75V20h-13zM0 20v-1.5c0-1.39 1.89-2.56 4.45-2.9c-.59.68-.95 1.62-.95 2.65V20zm24 0h-3.5v-1.75c0-1.03-.36-1.97-.95-2.65c2.56.34 4.45 1.51 4.45 2.9z",
|
|
22
22
|
'alert-circle': "M13 13h-2V7h2m0 10h-2v-2h2M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2",
|
|
23
23
|
'alert-outline': "M12 2L1 21h22M12 6l7.53 13H4.47M11 10v4h2v-4m-2 6v2h2v-2",
|
|
24
|
+
'arrow-down': "M11 4h2v12l5.5-5.5l1.42 1.42L12 19.84l-7.92-7.92L5.5 10.5L11 16z",
|
|
25
|
+
'arrow-up': "M13 20h-2V8l-5.5 5.5l-1.42-1.42L12 4.16l7.92 7.92l-1.42 1.42L13 8z",
|
|
24
26
|
'backspace-outline': "M19 15.59L17.59 17L14 13.41L10.41 17L9 15.59L12.59 12L9 8.41L10.41 7L14 10.59L17.59 7L19 8.41L15.41 12zM22 3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H7c-.69 0-1.23-.36-1.59-.89L0 12l5.41-8.12C5.77 3.35 6.31 3 7 3zm0 2H7l-4.72 7L7 19h15z",
|
|
25
27
|
'check': "M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z",
|
|
26
28
|
'check-circle': "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10s10-4.5 10-10S17.5 2 12 2m-2 15l-5-5l1.41-1.41L10 14.17l7.59-7.59L19 8z",
|
|
@@ -38,13 +40,17 @@ export const mdiPaths = {
|
|
|
38
40
|
'eraser': "m16.24 3.56l4.95 4.94c.78.79.78 2.05 0 2.84L12 20.53a4.01 4.01 0 0 1-5.66 0L2.81 17c-.78-.79-.78-2.05 0-2.84l10.6-10.6c.79-.78 2.05-.78 2.83 0M4.22 15.58l3.54 3.53c.78.79 2.04.79 2.83 0l3.53-3.53l-4.95-4.95z",
|
|
39
41
|
'eye-off-outline': "M2 5.27L3.28 4L20 20.72L18.73 22l-3.08-3.08c-1.15.38-2.37.58-3.65.58c-5 0-9.27-3.11-11-7.5c.69-1.76 1.79-3.31 3.19-4.54zM12 9a3 3 0 0 1 3 3a3 3 0 0 1-.17 1L11 9.17A3 3 0 0 1 12 9m0-4.5c5 0 9.27 3.11 11 7.5a11.8 11.8 0 0 1-4 5.19l-1.42-1.43A9.86 9.86 0 0 0 20.82 12A9.82 9.82 0 0 0 12 6.5c-1.09 0-2.16.18-3.16.5L7.3 5.47c1.44-.62 3.03-.97 4.7-.97M3.18 12A9.82 9.82 0 0 0 12 17.5c.69 0 1.37-.07 2-.21L11.72 15A3.064 3.064 0 0 1 9 12.28L5.6 8.87c-.99.85-1.82 1.91-2.42 3.13",
|
|
40
42
|
'eye-outline': "M12 9a3 3 0 0 1 3 3a3 3 0 0 1-3 3a3 3 0 0 1-3-3a3 3 0 0 1 3-3m0-4.5c5 0 9.27 3.11 11 7.5c-1.73 4.39-6 7.5-11 7.5S2.73 16.39 1 12c1.73-4.39 6-7.5 11-7.5M3.18 12a9.821 9.821 0 0 0 17.64 0a9.821 9.821 0 0 0-17.64 0",
|
|
43
|
+
'file-document-outline': "M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm0 2h7v5h5v11H6zm2 8v2h8v-2zm0 4v2h5v-2z",
|
|
41
44
|
'format-bold': "M13.5 15.5H10v-3h3.5A1.5 1.5 0 0 1 15 14a1.5 1.5 0 0 1-1.5 1.5m-3.5-9h3A1.5 1.5 0 0 1 14.5 8A1.5 1.5 0 0 1 13 9.5h-3m5.6 1.29c.97-.68 1.65-1.79 1.65-2.79c0-2.26-1.75-4-4-4H7v14h7.04c2.1 0 3.71-1.7 3.71-3.79c0-1.52-.86-2.82-2.15-3.42",
|
|
42
45
|
'format-italic': "M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z",
|
|
43
46
|
'format-text': "m18.5 4l1.16 4.35l-.96.26c-.45-.87-.91-1.74-1.44-2.18C16.73 6 16.11 6 15.5 6H13v10.5c0 .5 0 1 .33 1.25c.34.25 1 .25 1.67.25v1H9v-1c.67 0 1.33 0 1.67-.25c.33-.25.33-.75.33-1.25V6H8.5c-.61 0-1.23 0-1.76.43c-.53.44-.99 1.31-1.44 2.18l-.96-.26L5.5 4z",
|
|
47
|
+
'inbox-outline': "M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2M5 19v-2h3.13a4.13 4.13 0 0 0 1.27 2m9.6 0h-4.4a4.13 4.13 0 0 0 1.27-2H19m0-2h-5v1a2 2 0 0 1-4 0v-1H5V5h14Z",
|
|
44
48
|
'information': "M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2",
|
|
49
|
+
'lan-connect': "M4 1c-1.11 0-2 .89-2 2v4c0 1.11.89 2 2 2H1v2h12V9h-3c1.11 0 2-.89 2-2V3c0-1.11-.89-2-2-2zm0 2h6v4H4zM3 13v7h7v-2H5v-5zm11 0c-1.11 0-2 .89-2 2v4c0 1.11.89 2 2 2h-3v2h12v-2h-3c1.11 0 2-.89 2-2v-4c0-1.11-.89-2-2-2zm0 2h6v4h-6z",
|
|
45
50
|
'loading': "M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8",
|
|
46
51
|
'lock': "M12 17a2 2 0 0 0 2-2a2 2 0 0 0-2-2a2 2 0 0 0-2 2a2 2 0 0 0 2 2m6-9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V10a2 2 0 0 1 2-2h1V6a5 5 0 0 1 5-5a5 5 0 0 1 5 5v2zm-6-5a3 3 0 0 0-3 3v2h6V6a3 3 0 0 0-3-3",
|
|
47
52
|
'logout': "m17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5M4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z",
|
|
53
|
+
'menu': "M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z",
|
|
48
54
|
'minus': "M19 13H5v-2h14z",
|
|
49
55
|
'minus-circle-outline': "M12 20c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2M7 13h10v-2H7",
|
|
50
56
|
'note-text-outline': "M15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9zm4 16H5V5h9v5h5m-2 4H7v-2h10m-3 5H7v-2h7",
|
|
@@ -57,6 +63,10 @@ export const mdiPaths = {
|
|
|
57
63
|
'translate': "m12.87 15.07l-2.54-2.51l.03-.03A17.5 17.5 0 0 0 14.07 6H17V4h-7V2H8v2H1v2h11.17C11.5 7.92 10.44 9.75 9 11.35C8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5l3.11 3.11zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2zm-2.62 7l1.62-4.33L19.12 17z",
|
|
58
64
|
'trash-can': "M9 3v1H4v2h1v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6h1V4h-5V3zm0 5h2v9H9zm4 0h2v9h-2z",
|
|
59
65
|
'trash-can-outline': "M9 3v1H4v2h1v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6h1V4h-5V3zM7 6h10v13H7zm2 2v9h2V8zm4 0v9h2V8z",
|
|
66
|
+
'trending-down': "m16 18l2.29-2.29l-4.88-4.88l-4 4L2 7.41L3.41 6l6 6l4-4l6.3 6.29L22 12v6z",
|
|
67
|
+
'trending-neutral': "m22 12l-4-4v3H3v2h15v3z",
|
|
68
|
+
'trending-up': "m16 6l2.29 2.29l-4.88 4.88l-4-4L2 16.59L3.41 18l6-6l4 4l6.3-6.29L22 12V6z",
|
|
69
|
+
'unfold-more-horizontal': "M12 18.17L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15M12 5.83L15.17 9l1.41-1.41L12 3L7.41 7.59L8.83 9z",
|
|
60
70
|
'view-grid': "M3 11h8V3H3m0 18h8v-8H3m10 8h8v-8h-8m0-10v8h8V3",
|
|
61
71
|
'view-list': "M9 5v4h12V5M9 19h12v-4H9m0-1h12v-4H9M4 9h4V5H4m0 14h4v-4H4m0-1h4v-4H4z",
|
|
62
72
|
'weather-night': "m17.75 4.09l-2.53 1.94l.91 3.06l-2.63-1.81l-2.63 1.81l.91-3.06l-2.53-1.94L12.44 4l1.06-3l1.06 3zm3.5 6.91l-1.64 1.25l.59 1.98l-1.7-1.17l-1.7 1.17l.59-1.98L15.75 11l2.06-.05L18.5 9l.69 1.95zm-2.28 4.95c.83-.08 1.72 1.1 1.19 1.85c-.32.45-.66.87-1.08 1.27C15.17 23 8.84 23 4.94 19.07c-3.91-3.9-3.91-10.24 0-14.14c.4-.4.82-.76 1.27-1.08c.75-.53 1.93.36 1.85 1.19c-.27 2.86.69 5.83 2.89 8.02a9.96 9.96 0 0 0 8.02 2.89m-1.64 2.02a12.08 12.08 0 0 1-7.8-3.47c-2.17-2.19-3.33-5-3.49-7.82c-2.81 3.14-2.7 7.96.31 10.98c3.02 3.01 7.84 3.12 10.98.31",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { inject } from 'vue'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Link between UiFormField and the control inside it.
|
|
5
|
+
*
|
|
6
|
+
* UiFormField provides the id its `<label for>` points at, plus the ids of its
|
|
7
|
+
* hint and error text; each form control injects them and sets `id`,
|
|
8
|
+
* `aria-describedby` and `aria-invalid` on its real control element. That is
|
|
9
|
+
* what makes the label, hint and error reach assistive technology.
|
|
10
|
+
*/
|
|
11
|
+
export const FORM_FIELD_KEY = 'numori-ui:form-field'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @returns {null | {
|
|
15
|
+
* controlId: import('vue').ComputedRef<string>,
|
|
16
|
+
* labelId: string,
|
|
17
|
+
* describedBy: import('vue').ComputedRef<string | undefined>,
|
|
18
|
+
* invalid: import('vue').ComputedRef<boolean>,
|
|
19
|
+
* }}
|
|
20
|
+
*/
|
|
21
|
+
export function useFormField() {
|
|
22
|
+
return inject(FORM_FIELD_KEY, null)
|
|
23
|
+
}
|
package/src/manifest.js
CHANGED
|
@@ -21,6 +21,7 @@ export const DEFAULT_PREFIX = 'Ui'
|
|
|
21
21
|
*/
|
|
22
22
|
export const COMPONENT_NAMES = [
|
|
23
23
|
'Alert',
|
|
24
|
+
'AppShell',
|
|
24
25
|
'Avatar',
|
|
25
26
|
'Badge',
|
|
26
27
|
'Banner',
|
|
@@ -29,11 +30,14 @@ export const COMPONENT_NAMES = [
|
|
|
29
30
|
'Card',
|
|
30
31
|
'Checkbox',
|
|
31
32
|
'CodeBlock',
|
|
33
|
+
'CopyField',
|
|
34
|
+
'DescriptionList',
|
|
32
35
|
'Divider',
|
|
33
36
|
'Dropdown',
|
|
34
37
|
'DropdownItem',
|
|
35
38
|
'DropdownRow',
|
|
36
39
|
'DropdownSubmenu',
|
|
40
|
+
'EmptyState',
|
|
37
41
|
'FileInput',
|
|
38
42
|
'FormField',
|
|
39
43
|
'IconTile',
|
|
@@ -43,6 +47,8 @@ export const COMPONENT_NAMES = [
|
|
|
43
47
|
'ListMenuItem',
|
|
44
48
|
'Modal',
|
|
45
49
|
'Numpad',
|
|
50
|
+
'PageHeader',
|
|
51
|
+
'Pagination',
|
|
46
52
|
'Popup',
|
|
47
53
|
'ProgressBar',
|
|
48
54
|
'Prompt',
|
|
@@ -50,10 +56,15 @@ export const COMPONENT_NAMES = [
|
|
|
50
56
|
'SectionHeading',
|
|
51
57
|
'Segmented',
|
|
52
58
|
'Select',
|
|
59
|
+
'Sidebar',
|
|
60
|
+
'SidebarGroup',
|
|
61
|
+
'SidebarItem',
|
|
53
62
|
'Slider',
|
|
54
63
|
'Spinner',
|
|
64
|
+
'StatCard',
|
|
55
65
|
'Stepper',
|
|
56
66
|
'Table',
|
|
67
|
+
'Tabs',
|
|
57
68
|
'ThemeToggle',
|
|
58
69
|
'Toast',
|
|
59
70
|
'Toggle',
|