numori-ui 0.3.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.
Files changed (120) hide show
  1. package/CHANGELOG.md +148 -0
  2. package/README.md +36 -34
  3. package/dist/components/AppShell.js +234 -0
  4. package/dist/components/AppShell.js.map +1 -0
  5. package/dist/components/Banner.js +29 -32
  6. package/dist/components/Banner.js.map +1 -1
  7. package/dist/components/Button.js +10 -19
  8. package/dist/components/Button.js.map +1 -1
  9. package/dist/components/Card.js +15 -9
  10. package/dist/components/Card.js.map +1 -1
  11. package/dist/components/Checkbox.js +13 -9
  12. package/dist/components/Checkbox.js.map +1 -1
  13. package/dist/components/CopyField.js +195 -0
  14. package/dist/components/CopyField.js.map +1 -0
  15. package/dist/components/DescriptionList.js +116 -0
  16. package/dist/components/DescriptionList.js.map +1 -0
  17. package/dist/components/Dropdown.js +10 -3
  18. package/dist/components/Dropdown.js.map +1 -1
  19. package/dist/components/DropdownSubmenu.js +5 -3
  20. package/dist/components/DropdownSubmenu.js.map +1 -1
  21. package/dist/components/EmptyState.js +123 -0
  22. package/dist/components/EmptyState.js.map +1 -0
  23. package/dist/components/FileInput.js +12 -4
  24. package/dist/components/FileInput.js.map +1 -1
  25. package/dist/components/FormField.js +43 -13
  26. package/dist/components/FormField.js.map +1 -1
  27. package/dist/components/IconTile.js +5 -9
  28. package/dist/components/IconTile.js.map +1 -1
  29. package/dist/components/Input.js +21 -7
  30. package/dist/components/Input.js.map +1 -1
  31. package/dist/components/ListMenuItem.js +38 -31
  32. package/dist/components/ListMenuItem.js.map +1 -1
  33. package/dist/components/Numpad.js +4 -4
  34. package/dist/components/Numpad.js.map +1 -1
  35. package/dist/components/PageHeader.js +106 -0
  36. package/dist/components/PageHeader.js.map +1 -0
  37. package/dist/components/Pagination.js +236 -0
  38. package/dist/components/Pagination.js.map +1 -0
  39. package/dist/components/Popup.js +9 -3
  40. package/dist/components/Popup.js.map +1 -1
  41. package/dist/components/Radio.js +2 -7
  42. package/dist/components/Radio.js.map +1 -1
  43. package/dist/components/Segmented.js +109 -27
  44. package/dist/components/Segmented.js.map +1 -1
  45. package/dist/components/Select.js +16 -5
  46. package/dist/components/Select.js.map +1 -1
  47. package/dist/components/Sidebar.js +69 -0
  48. package/dist/components/Sidebar.js.map +1 -0
  49. package/dist/components/SidebarGroup.js +50 -0
  50. package/dist/components/SidebarGroup.js.map +1 -0
  51. package/dist/components/SidebarItem.js +167 -0
  52. package/dist/components/SidebarItem.js.map +1 -0
  53. package/dist/components/StatCard.js +185 -0
  54. package/dist/components/StatCard.js.map +1 -0
  55. package/dist/components/Table.js +306 -0
  56. package/dist/components/Table.js.map +1 -0
  57. package/dist/components/Tabs.js +216 -0
  58. package/dist/components/Tabs.js.map +1 -0
  59. package/dist/components/Toggle.js +11 -2
  60. package/dist/components/Toggle.js.map +1 -1
  61. package/dist/components/index.js +91 -76
  62. package/dist/components/index.js.map +1 -1
  63. package/dist/composables/useMergedClasses.js +52 -0
  64. package/dist/composables/useMergedClasses.js.map +1 -0
  65. package/dist/icons/mdi.js +11 -0
  66. package/dist/icons/mdi.js.map +1 -1
  67. package/dist/index.d.ts +13 -3
  68. package/dist/index.js +47 -37
  69. package/dist/index.js.map +1 -1
  70. package/dist/internal/controlSizes.js +21 -0
  71. package/dist/internal/controlSizes.js.map +1 -0
  72. package/dist/internal/formField.js +26 -0
  73. package/dist/internal/formField.js.map +1 -0
  74. package/dist/internal/menu.js +20 -0
  75. package/dist/internal/menu.js.map +1 -0
  76. package/dist/manifest.js +12 -2
  77. package/dist/manifest.js.map +1 -1
  78. package/package.json +2 -1
  79. package/src/components/AppShell.vue +231 -0
  80. package/src/components/Banner.vue +20 -9
  81. package/src/components/Button.vue +12 -19
  82. package/src/components/Card.vue +11 -12
  83. package/src/components/Checkbox.vue +7 -10
  84. package/src/components/CopyField.vue +178 -0
  85. package/src/components/DescriptionList.vue +114 -0
  86. package/src/components/Dropdown.vue +14 -2
  87. package/src/components/DropdownSubmenu.vue +4 -2
  88. package/src/components/EmptyState.vue +107 -0
  89. package/src/components/FileInput.vue +19 -4
  90. package/src/components/FormField.vue +37 -4
  91. package/src/components/IconTile.vue +4 -9
  92. package/src/components/Input.vue +15 -6
  93. package/src/components/ListMenuItem.vue +21 -5
  94. package/src/components/Numpad.vue +7 -4
  95. package/src/components/PageHeader.vue +102 -0
  96. package/src/components/Pagination.vue +199 -0
  97. package/src/components/Popup.vue +6 -2
  98. package/src/components/Radio.vue +2 -10
  99. package/src/components/Segmented.vue +113 -38
  100. package/src/components/Select.vue +16 -2
  101. package/src/components/Sidebar.vue +61 -0
  102. package/src/components/SidebarGroup.vue +43 -0
  103. package/src/components/SidebarItem.vue +159 -0
  104. package/src/components/StatCard.vue +165 -0
  105. package/src/components/Table.vue +323 -0
  106. package/src/components/Tabs.vue +217 -0
  107. package/src/components/Toggle.vue +5 -0
  108. package/src/components/index.js +36 -11
  109. package/src/composables/useMergedClasses.js +49 -0
  110. package/src/icons/mdi.js +11 -0
  111. package/src/internal/controlSizes.js +17 -0
  112. package/src/internal/formField.js +23 -0
  113. package/src/internal/menu.js +16 -0
  114. package/src/manifest.js +12 -2
  115. package/dist/components/ButtonsGroup.js +0 -153
  116. package/dist/components/ButtonsGroup.js.map +0 -1
  117. package/dist/components/ComparisonTable.js +0 -152
  118. package/dist/components/ComparisonTable.js.map +0 -1
  119. package/src/components/ButtonsGroup.vue +0 -140
  120. package/src/components/ComparisonTable.vue +0 -141
@@ -10,21 +10,23 @@
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'
16
17
  import Breadcrumb from './Breadcrumb.vue'
17
18
  import Button from './Button.vue'
18
- import ButtonsGroup from './ButtonsGroup.vue'
19
19
  import Card from './Card.vue'
20
20
  import Checkbox from './Checkbox.vue'
21
21
  import CodeBlock from './CodeBlock.vue'
22
- import ComparisonTable from './ComparisonTable.vue'
22
+ import CopyField from './CopyField.vue'
23
+ import DescriptionList from './DescriptionList.vue'
23
24
  import Divider from './Divider.vue'
24
25
  import Dropdown from './Dropdown.vue'
25
26
  import DropdownItem from './DropdownItem.vue'
26
27
  import DropdownRow from './DropdownRow.vue'
27
28
  import DropdownSubmenu from './DropdownSubmenu.vue'
29
+ import EmptyState from './EmptyState.vue'
28
30
  import FileInput from './FileInput.vue'
29
31
  import FormField from './FormField.vue'
30
32
  import IconTile from './IconTile.vue'
@@ -34,6 +36,8 @@ import ListMenu from './ListMenu.vue'
34
36
  import ListMenuItem from './ListMenuItem.vue'
35
37
  import Modal from './Modal.vue'
36
38
  import Numpad from './Numpad.vue'
39
+ import PageHeader from './PageHeader.vue'
40
+ import Pagination from './Pagination.vue'
37
41
  import Popup from './Popup.vue'
38
42
  import ProgressBar from './ProgressBar.vue'
39
43
  import Prompt from './Prompt.vue'
@@ -41,9 +45,15 @@ import Radio from './Radio.vue'
41
45
  import SectionHeading from './SectionHeading.vue'
42
46
  import Segmented from './Segmented.vue'
43
47
  import Select from './Select.vue'
48
+ import Sidebar from './Sidebar.vue'
49
+ import SidebarGroup from './SidebarGroup.vue'
50
+ import SidebarItem from './SidebarItem.vue'
44
51
  import Slider from './Slider.vue'
45
52
  import Spinner from './Spinner.vue'
53
+ import StatCard from './StatCard.vue'
46
54
  import Stepper from './Stepper.vue'
55
+ import Table from './Table.vue'
56
+ import Tabs from './Tabs.vue'
47
57
  import ThemeToggle from './ThemeToggle.vue'
48
58
  import Toast from './Toast.vue'
49
59
  import Toggle from './Toggle.vue'
@@ -52,21 +62,23 @@ import Icon from '../icons/Icon.vue'
52
62
 
53
63
  export {
54
64
  Alert as UiAlert,
65
+ AppShell as UiAppShell,
55
66
  Avatar as UiAvatar,
56
67
  Badge as UiBadge,
57
68
  Banner as UiBanner,
58
69
  Breadcrumb as UiBreadcrumb,
59
70
  Button as UiButton,
60
- ButtonsGroup as UiButtonsGroup,
61
71
  Card as UiCard,
62
72
  Checkbox as UiCheckbox,
63
73
  CodeBlock as UiCodeBlock,
64
- ComparisonTable as UiComparisonTable,
74
+ CopyField as UiCopyField,
75
+ DescriptionList as UiDescriptionList,
65
76
  Divider as UiDivider,
66
77
  Dropdown as UiDropdown,
67
78
  DropdownItem as UiDropdownItem,
68
79
  DropdownRow as UiDropdownRow,
69
80
  DropdownSubmenu as UiDropdownSubmenu,
81
+ EmptyState as UiEmptyState,
70
82
  FileInput as UiFileInput,
71
83
  FormField as UiFormField,
72
84
  IconTile as UiIconTile,
@@ -76,6 +88,8 @@ export {
76
88
  ListMenuItem as UiListMenuItem,
77
89
  Modal as UiModal,
78
90
  Numpad as UiNumpad,
91
+ PageHeader as UiPageHeader,
92
+ Pagination as UiPagination,
79
93
  Popup as UiPopup,
80
94
  ProgressBar as UiProgressBar,
81
95
  Prompt as UiPrompt,
@@ -83,9 +97,15 @@ export {
83
97
  SectionHeading as UiSectionHeading,
84
98
  Segmented as UiSegmented,
85
99
  Select as UiSelect,
100
+ Sidebar as UiSidebar,
101
+ SidebarGroup as UiSidebarGroup,
102
+ SidebarItem as UiSidebarItem,
86
103
  Slider as UiSlider,
87
104
  Spinner as UiSpinner,
105
+ StatCard as UiStatCard,
88
106
  Stepper as UiStepper,
107
+ Table as UiTable,
108
+ Tabs as UiTabs,
89
109
  ThemeToggle as UiThemeToggle,
90
110
  Toast as UiToast,
91
111
  Toggle as UiToggle,
@@ -93,28 +113,25 @@ export {
93
113
  Icon as UiIcon,
94
114
  }
95
115
 
96
- /**
97
- * Base-name -> component map, used by the Vue plugin to register everything
98
- * under whatever prefix the host chose.
99
- * @type {Record<string, import('vue').Component>}
100
- */
101
116
  export const components = {
102
117
  Alert,
118
+ AppShell,
103
119
  Avatar,
104
120
  Badge,
105
121
  Banner,
106
122
  Breadcrumb,
107
123
  Button,
108
- ButtonsGroup,
109
124
  Card,
110
125
  Checkbox,
111
126
  CodeBlock,
112
- ComparisonTable,
127
+ CopyField,
128
+ DescriptionList,
113
129
  Divider,
114
130
  Dropdown,
115
131
  DropdownItem,
116
132
  DropdownRow,
117
133
  DropdownSubmenu,
134
+ EmptyState,
118
135
  FileInput,
119
136
  FormField,
120
137
  IconTile,
@@ -124,6 +141,8 @@ export const components = {
124
141
  ListMenuItem,
125
142
  Modal,
126
143
  Numpad,
144
+ PageHeader,
145
+ Pagination,
127
146
  Popup,
128
147
  ProgressBar,
129
148
  Prompt,
@@ -131,9 +150,15 @@ export const components = {
131
150
  SectionHeading,
132
151
  Segmented,
133
152
  Select,
153
+ Sidebar,
154
+ SidebarGroup,
155
+ SidebarItem,
134
156
  Slider,
135
157
  Spinner,
158
+ StatCard,
136
159
  Stepper,
160
+ Table,
161
+ Tabs,
137
162
  ThemeToggle,
138
163
  Toast,
139
164
  Toggle,
@@ -0,0 +1,49 @@
1
+ import { computed, useAttrs, toValue } from 'vue'
2
+ import { twMerge } from 'tailwind-merge'
3
+
4
+ /**
5
+ * useMergedClasses — merge a component's internal Tailwind classes with the
6
+ * caller's `class`, letting the caller win, and split the remaining attributes
7
+ * off for forwarding.
8
+ *
9
+ * This is the shared half of the "external classes override internals" pattern
10
+ * that UiButton, UiCard and UiIconTile all implement identically: bind
11
+ * `mergedClasses` to the root element's `:class`, spread `restAttrs` onto it
12
+ * with `v-bind`, and declare `defineOptions({ inheritAttrs: false })` in the
13
+ * component so Vue does not also apply `class` a second time.
14
+ *
15
+ * `tailwind-merge` resolves conflicts by keeping the last occurrence, and the
16
+ * caller's `class` is always passed last — so `bg-gray-100` from the outside
17
+ * beats a built-in `bg-primary-600` rather than both landing on the element.
18
+ * Passing the internal classes as one space-joined string is equivalent to
19
+ * passing them as separate arguments; twMerge tokenises either the same way.
20
+ *
21
+ * `defineOptions` is a compiler macro and cannot live in a composable, so each
22
+ * consuming SFC still declares `inheritAttrs: false` itself. Everything else —
23
+ * `useAttrs`, the class/rest split, and the merge — lives here.
24
+ *
25
+ * @param {import('vue').MaybeRefOrGetter<string>} internal
26
+ * The component's own classes, as a ref, getter, or plain string. A getter is
27
+ * the safest form when the internal classes are a `computed` declared later
28
+ * in setup, since it defers evaluation past that declaration.
29
+ * @returns {{ mergedClasses: import('vue').ComputedRef<string>, restAttrs: import('vue').ComputedRef<Record<string, unknown>> }}
30
+ * `mergedClasses` for the root `:class`; `restAttrs` (everything except
31
+ * `class`) for `v-bind`.
32
+ *
33
+ * @example
34
+ * defineOptions({ inheritAttrs: false })
35
+ * const internal = computed(() => `inline-flex ${sizeClass.value} ${colorClass.value}`)
36
+ * const { mergedClasses, restAttrs } = useMergedClasses(internal)
37
+ */
38
+ export function useMergedClasses(internal) {
39
+ const attrs = useAttrs()
40
+
41
+ const restAttrs = computed(() => {
42
+ const { class: _class, ...rest } = attrs
43
+ return rest
44
+ })
45
+
46
+ const mergedClasses = computed(() => twMerge(toValue(internal), attrs.class))
47
+
48
+ return { mergedClasses, restAttrs }
49
+ }
package/src/icons/mdi.js CHANGED
@@ -21,10 +21,13 @@ 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",
27
29
  'chevron-down': "M7.41 8.58L12 13.17l4.59-4.59L18 10l-6 6l-6-6z",
30
+ 'chevron-left': "M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z",
28
31
  'chevron-right': "M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z",
29
32
  'chevron-up': "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6z",
30
33
  'close': "M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z",
@@ -37,13 +40,17 @@ export const mdiPaths = {
37
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",
38
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",
39
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",
40
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",
41
45
  'format-italic': "M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z",
42
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",
43
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",
44
50
  'loading': "M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8",
45
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",
46
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",
47
54
  'minus': "M19 13H5v-2h14z",
48
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",
49
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",
@@ -56,6 +63,10 @@ export const mdiPaths = {
56
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",
57
64
  'trash-can': "M9 3v1H4v2h1v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6h1V4h-5V3zm0 5h2v9H9zm4 0h2v9h-2z",
58
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",
59
70
  'view-grid': "M3 11h8V3H3m0 18h8v-8H3m10 8h8v-8h-8m0-10v8h8V3",
60
71
  'view-list': "M9 5v4h12V5M9 19h12v-4H9m0-1h12v-4H9M4 9h4V5H4m0 14h4v-4H4m0-1h4v-4H4z",
61
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,17 @@
1
+ /**
2
+ * Size scale shared by the native checkable inputs (`UiCheckbox`, `UiRadio`).
3
+ *
4
+ * Both render a native `<input>` and size it with the same width/height classes;
5
+ * the map lived duplicated in each. A checkbox and a radio stay separate
6
+ * components because their HTML semantics differ, but their sizing does not.
7
+ *
8
+ * @param {string} size One of `sm` | `md` | `lg`. Anything else falls back to `md`.
9
+ * @returns {string} The width/height utility classes for that size.
10
+ */
11
+ export const CHECKABLE_SIZES = {
12
+ sm: 'w-3.5 h-3.5',
13
+ md: 'w-4 h-4',
14
+ lg: 'w-5 h-5',
15
+ }
16
+
17
+ export const checkableSizeClass = (size) => CHECKABLE_SIZES[size] ?? CHECKABLE_SIZES.md
@@ -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
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Shared chrome for floating menu surfaces.
3
+ *
4
+ * `UiDropdown`, `UiSelect`, `UiPopup` and `UiDropdownSubmenu` are four different
5
+ * takes on "a panel that floats over the page" — they differ in how they are
6
+ * positioned (absolute vs fixed vs teleported) and dismissed, which is why they
7
+ * remain separate components. What they share is the *look* of the panel: the
8
+ * surface colour, border, radius and shadow. That string lived copied verbatim
9
+ * in all four, so a tweak to the shared look meant editing four files and hoping
10
+ * none drifted. It now lives here.
11
+ *
12
+ * Positioning, z-index, padding and `overflow` stay at each call site, since
13
+ * those genuinely differ between the four.
14
+ */
15
+ export const MENU_PANEL_CLASS =
16
+ 'bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg'
package/src/manifest.js CHANGED
@@ -21,21 +21,23 @@ 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',
27
28
  'Breadcrumb',
28
29
  'Button',
29
- 'ButtonsGroup',
30
30
  'Card',
31
31
  'Checkbox',
32
32
  'CodeBlock',
33
- 'ComparisonTable',
33
+ 'CopyField',
34
+ 'DescriptionList',
34
35
  'Divider',
35
36
  'Dropdown',
36
37
  'DropdownItem',
37
38
  'DropdownRow',
38
39
  'DropdownSubmenu',
40
+ 'EmptyState',
39
41
  'FileInput',
40
42
  'FormField',
41
43
  'IconTile',
@@ -45,6 +47,8 @@ export const COMPONENT_NAMES = [
45
47
  'ListMenuItem',
46
48
  'Modal',
47
49
  'Numpad',
50
+ 'PageHeader',
51
+ 'Pagination',
48
52
  'Popup',
49
53
  'ProgressBar',
50
54
  'Prompt',
@@ -52,9 +56,15 @@ export const COMPONENT_NAMES = [
52
56
  'SectionHeading',
53
57
  'Segmented',
54
58
  'Select',
59
+ 'Sidebar',
60
+ 'SidebarGroup',
61
+ 'SidebarItem',
55
62
  'Slider',
56
63
  'Spinner',
64
+ 'StatCard',
57
65
  'Stepper',
66
+ 'Table',
67
+ 'Tabs',
58
68
  'ThemeToggle',
59
69
  'Toast',
60
70
  'Toggle',
@@ -1,153 +0,0 @@
1
- import _sfc_main$1 from "../icons/Icon.js";
2
- import _sfc_main$2 from "./Button.js";
3
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, normalizeClass, openBlock, renderList, toDisplayString, withCtx } from "vue";
4
- //#region src/components/ButtonsGroup.vue
5
- var _hoisted_1 = { key: 1 };
6
- var _sfc_main = {
7
- __name: "ButtonsGroup",
8
- props: {
9
- /**
10
- * Currently selected option value (v-model).
11
- * @type {string | number | boolean}
12
- * @default ''
13
- */
14
- modelValue: {
15
- type: [
16
- String,
17
- Number,
18
- Boolean
19
- ],
20
- default: ""
21
- },
22
- /**
23
- * Array of option objects: `{ value, icon?, label?, title? }`.
24
- * At least `value` is required. Provide `icon` for toolbar mode, `label` for tabs.
25
- * @type {Array<{ value: string|number, icon?: string, label?: string, title?: string }>}
26
- * @required
27
- */
28
- options: {
29
- type: Array,
30
- required: true
31
- },
32
- /**
33
- * Visual style of the group.
34
- * - 'toolbar': compact icon toggles with gray background
35
- * - 'tabs': text-based tabs with lighter background and smaller buttons
36
- * @type {string}
37
- * @default 'toolbar'
38
- * @values 'toolbar' | 'tabs'
39
- */
40
- variant: {
41
- type: String,
42
- default: "toolbar"
43
- },
44
- /**
45
- * Icon size class applied to icons in toolbar mode.
46
- * @type {string}
47
- * @default 'w-5 h-5'
48
- */
49
- iconClass: {
50
- type: String,
51
- default: "w-5 h-5"
52
- },
53
- /**
54
- * Button size for toolbar variant (tabs always use 'xs').
55
- * @type {string}
56
- * @default 'md'
57
- * @values 'xs' | 'sm' | 'md'
58
- */
59
- size: {
60
- type: String,
61
- default: "md"
62
- },
63
- /**
64
- * Full-width mode. Defaults to true for tabs, false for toolbar.
65
- * @type {boolean}
66
- * @default undefined (auto-detected from variant)
67
- */
68
- block: {
69
- type: Boolean,
70
- default: void 0
71
- }
72
- },
73
- emits: ["update:modelValue"],
74
- setup(__props) {
75
- /**
76
- * UiButtonsGroup — Segmented toggle button group for single-select options.
77
- *
78
- * Renders a row of UiButton elements styled as a connected group (toolbar or tabs).
79
- * Only one option can be active at a time (radio-like behavior via v-model).
80
- * Supports icon-only toolbar mode and text-based tab mode with automatic sizing,
81
- * rounding, and active/inactive styling.
82
- *
83
- * @example Toolbar with icons
84
- * <UiButtonsGroup v-model="view" :options="[
85
- * { value: 'grid', icon: 'mdi:view-grid' },
86
- * { value: 'list', icon: 'mdi:view-list' },
87
- * ]" />
88
- *
89
- * @example Tab-style text group
90
- * <UiButtonsGroup v-model="tab" variant="tabs" :options="[
91
- * { value: 'all', label: 'All' },
92
- * { value: 'active', label: 'Active' },
93
- * { value: 'archived', label: 'Archived' },
94
- * ]" />
95
- *
96
- * @emits {string | number | boolean} update:modelValue — Emitted when an option is selected
97
- *
98
- * @see UiButton — Underlying button component used for each option
99
- */
100
- const props = __props;
101
- const isBlock = computed(() => props.block ?? props.variant === "tabs");
102
- const wrapperClass = computed(() => isBlock.value ? "flex items-center rounded-lg" : "inline-flex items-center rounded-lg");
103
- const containerClass = computed(() => props.variant === "tabs" ? "bg-gray-100 dark:bg-gray-800 p-0.5" : "bg-gray-200/50 dark:bg-gray-800");
104
- const buttonSize = computed(() => props.variant === "tabs" ? "xs" : props.size);
105
- const roundingClass = (idx) => {
106
- const last = props.options.length - 1;
107
- const radius = props.variant === "tabs" ? "md" : "lg";
108
- if (props.options.length === 1) return `rounded-${radius}`;
109
- if (idx === 0) return `rounded-l-${radius} rounded-r-none`;
110
- if (idx === last) return `rounded-r-${radius} rounded-l-none`;
111
- return "rounded-none";
112
- };
113
- const activeClass = computed(() => props.variant === "tabs" ? "bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-200 shadow-sm hover:bg-white dark:hover:bg-gray-700" : "bg-white dark:bg-gray-700 text-primary-600 dark:text-primary-400 shadow-sm hover:bg-white dark:hover:bg-gray-700");
114
- const inactiveClass = computed(() => props.variant === "tabs" ? "text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-200/50 dark:hover:bg-gray-700/50" : "text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-300/40 dark:hover:bg-gray-700/50");
115
- return (_ctx, _cache) => {
116
- return openBlock(), createElementBlock("div", {
117
- class: normalizeClass([wrapperClass.value, containerClass.value]),
118
- role: "group"
119
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (opt, idx) => {
120
- return openBlock(), createBlock(_sfc_main$2, {
121
- key: opt.value,
122
- variant: "ghost",
123
- "icon-only": !opt.label,
124
- size: buttonSize.value,
125
- class: normalizeClass([
126
- roundingClass(idx),
127
- __props.modelValue === opt.value ? activeClass.value : inactiveClass.value,
128
- opt.label ? "flex-1" : ""
129
- ]),
130
- title: opt.title || opt.label || "",
131
- onClick: ($event) => _ctx.$emit("update:modelValue", opt.value)
132
- }, {
133
- default: withCtx(() => [opt.icon ? (openBlock(), createBlock(_sfc_main$1, {
134
- key: 0,
135
- name: opt.icon,
136
- class: normalizeClass([__props.iconClass, "block"])
137
- }, null, 8, ["name", "class"])) : createCommentVNode("", true), opt.label ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(opt.label), 1)) : createCommentVNode("", true)]),
138
- _: 2
139
- }, 1032, [
140
- "icon-only",
141
- "size",
142
- "class",
143
- "title",
144
- "onClick"
145
- ]);
146
- }), 128))], 2);
147
- };
148
- }
149
- };
150
- //#endregion
151
- export { _sfc_main as default };
152
-
153
- //# sourceMappingURL=ButtonsGroup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ButtonsGroup.js","names":["$emit"],"sources":["../../src/components/ButtonsGroup.vue"],"sourcesContent":["<template>\n <!-- Segmented button group rendered as a flex row with role=\"group\" -->\n <div :class=\"[wrapperClass, containerClass]\" role=\"group\">\n <UiButton\n v-for=\"(opt, idx) in options\"\n :key=\"opt.value\"\n variant=\"ghost\"\n :icon-only=\"!opt.label\"\n :size=\"buttonSize\"\n :class=\"[\n roundingClass(idx),\n modelValue === opt.value ? activeClass : inactiveClass,\n opt.label ? 'flex-1' : '',\n ]\"\n :title=\"opt.title || opt.label || ''\"\n @click=\"$emit('update:modelValue', opt.value)\"\n >\n <UiIcon v-if=\"opt.icon\" :name=\"opt.icon\" :class=\"iconClass\" class=\"block\" />\n <span v-if=\"opt.label\">{{ opt.label }}</span>\n </UiButton>\n </div>\n</template>\n\n<script setup>\n/**\n * UiButtonsGroup — Segmented toggle button group for single-select options.\n *\n * Renders a row of UiButton elements styled as a connected group (toolbar or tabs).\n * Only one option can be active at a time (radio-like behavior via v-model).\n * Supports icon-only toolbar mode and text-based tab mode with automatic sizing,\n * rounding, and active/inactive styling.\n *\n * @example Toolbar with icons\n * <UiButtonsGroup v-model=\"view\" :options=\"[\n * { value: 'grid', icon: 'mdi:view-grid' },\n * { value: 'list', icon: 'mdi:view-list' },\n * ]\" />\n *\n * @example Tab-style text group\n * <UiButtonsGroup v-model=\"tab\" variant=\"tabs\" :options=\"[\n * { value: 'all', label: 'All' },\n * { value: 'active', label: 'Active' },\n * { value: 'archived', label: 'Archived' },\n * ]\" />\n *\n * @emits {string | number | boolean} update:modelValue — Emitted when an option is selected\n *\n * @see UiButton — Underlying button component used for each option\n */\nimport { computed } from 'vue'\nimport UiButton from './Button.vue'\nimport UiIcon from '../icons/Icon.vue'\nconst props = defineProps({\n /**\n * Currently selected option value (v-model).\n * @type {string | number | boolean}\n * @default ''\n */\n modelValue: { type: [String, Number, Boolean], default: '' },\n\n /**\n * Array of option objects: `{ value, icon?, label?, title? }`.\n * At least `value` is required. Provide `icon` for toolbar mode, `label` for tabs.\n * @type {Array<{ value: string|number, icon?: string, label?: string, title?: string }>}\n * @required\n */\n options: { type: Array, required: true },\n\n /**\n * Visual style of the group.\n * - 'toolbar': compact icon toggles with gray background\n * - 'tabs': text-based tabs with lighter background and smaller buttons\n * @type {string}\n * @default 'toolbar'\n * @values 'toolbar' | 'tabs'\n */\n variant: { type: String, default: 'toolbar' },\n\n /**\n * Icon size class applied to icons in toolbar mode.\n * @type {string}\n * @default 'w-5 h-5'\n */\n iconClass: { type: String, default: 'w-5 h-5' },\n\n /**\n * Button size for toolbar variant (tabs always use 'xs').\n * @type {string}\n * @default 'md'\n * @values 'xs' | 'sm' | 'md'\n */\n size: { type: String, default: 'md' },\n\n /**\n * Full-width mode. Defaults to true for tabs, false for toolbar.\n * @type {boolean}\n * @default undefined (auto-detected from variant)\n */\n block: { type: Boolean, default: undefined },\n})\n\ndefineEmits(['update:modelValue'])\n\n// Block defaults to true for tabs (full-width) and false for toolbar (inline)\nconst isBlock = computed(() => props.block ?? props.variant === 'tabs')\n\nconst wrapperClass = computed(() =>\n isBlock.value ? 'flex items-center rounded-lg' : 'inline-flex items-center rounded-lg',\n)\n\nconst containerClass = computed(() =>\n props.variant === 'tabs'\n ? 'bg-gray-100 dark:bg-gray-800 p-0.5'\n : 'bg-gray-200/50 dark:bg-gray-800',\n)\n\nconst buttonSize = computed(() => (props.variant === 'tabs' ? 'xs' : props.size))\n\n// Apply rounding only to first/last buttons; middle buttons get rounded-none\nconst roundingClass = (idx) => {\n const last = props.options.length - 1\n const radius = props.variant === 'tabs' ? 'md' : 'lg'\n if (props.options.length === 1) return `rounded-${radius}`\n if (idx === 0) return `rounded-l-${radius} rounded-r-none`\n if (idx === last) return `rounded-r-${radius} rounded-l-none`\n return 'rounded-none'\n}\n\nconst activeClass = computed(() =>\n props.variant === 'tabs'\n ? 'bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-200 shadow-sm hover:bg-white dark:hover:bg-gray-700'\n : 'bg-white dark:bg-gray-700 text-primary-600 dark:text-primary-400 shadow-sm hover:bg-white dark:hover:bg-gray-700',\n)\n\nconst inactiveClass = computed(() =>\n props.variant === 'tabs'\n ? 'text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-200/50 dark:hover:bg-gray-700/50'\n : 'text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 hover:bg-gray-300/40 dark:hover:bg-gray-700/50',\n)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDA,MAAM,QAAQ;EAoDd,MAAM,UAAU,eAAe,MAAM,SAAS,MAAM,YAAY,MAAM;EAEtE,MAAM,eAAe,eACnB,QAAQ,QAAQ,iCAAiC,qCACnD;EAEA,MAAM,iBAAiB,eACrB,MAAM,YAAY,SACd,uCACA,iCACN;EAEA,MAAM,aAAa,eAAgB,MAAM,YAAY,SAAS,OAAO,MAAM,IAAK;EAGhF,MAAM,iBAAiB,QAAQ;GAC7B,MAAM,OAAO,MAAM,QAAQ,SAAS;GACpC,MAAM,SAAS,MAAM,YAAY,SAAS,OAAO;GACjD,IAAI,MAAM,QAAQ,WAAW,GAAG,OAAO,WAAW;GAClD,IAAI,QAAQ,GAAG,OAAO,aAAa,OAAO;GAC1C,IAAI,QAAQ,MAAM,OAAO,aAAa,OAAO;GAC7C,OAAO;EACT;EAEA,MAAM,cAAc,eAClB,MAAM,YAAY,SACd,+GACA,kHACN;EAEA,MAAM,gBAAgB,eACpB,MAAM,YAAY,SACd,iIACA,8HACN;;GAxIE,OAAA,UAAA,GAAA,mBAkBM,OAAA;IAlBA,OAAK,eAAA,CAAG,aAAA,OAAc,eAAA,KAAc,CAAA;IAAG,MAAK;GAChD,GAAA,EAAA,UAAA,IAAA,GAAA,mBAgBW,UAAA,MAAA,WAfY,QAAA,UAAb,KAAK,QAAG;IADlB,OAAA,UAAA,GAAA,YAgBW,aAAA;KAdR,KAAK,IAAI;KACV,SAAQ;KACP,aAAS,CAAG,IAAI;KAChB,MAAM,WAAA;KACN,OAAK,eAAA;MAAY,cAAc,GAAG;MAAW,QAAA,eAAe,IAAI,QAAQ,YAAA,QAAc,cAAA;MAAuB,IAAI,QAAK,WAAA;;KAKtH,OAAO,IAAI,SAAS,IAAI,SAAK;KAC7B,UAAK,WAAEA,KAAAA,MAAK,qBAAsB,IAAI,KAAK;;KAE5C,SAAA,cAA4E,CAA9D,IAAI,QAAlB,UAAA,GAAA,YAA4E,aAAA;;MAAnD,MAAM,IAAI;MAAO,OAAK,eAAA,CAAE,QAAA,WAAiB,OAAO,CAAA;KAC7D,GAAA,MAAA,GAAA,CAAA,QAAA,OAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,GAAA,IAAI,SAAhB,UAAA,GAAA,mBAA6C,QAAA,YAAA,gBAAnB,IAAI,KAAK,GAAA,CAAA,KAAA,mBAAA,IAAA,IAAA,CAAA,CAAA"}