@nexdom/uimed-vue 2.0.0-beta.9 → 2.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.
Files changed (220) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +7 -0
  2. package/dist/components/app-bar/app-bar.js +5 -0
  3. package/dist/components/app-bar/app-bar.vue_vue_type_script_setup_true_lang.js +286 -0
  4. package/dist/components/app-bar/types.d.ts +96 -0
  5. package/dist/components/button/button.js +5 -0
  6. package/dist/components/button/button.vue.d.ts +31 -0
  7. package/dist/components/button/button.vue_vue_type_script_setup_true_lang.js +97 -0
  8. package/dist/components/button/types.d.ts +65 -0
  9. package/dist/components/data-sets/data-set/data-set.js +5 -0
  10. package/dist/components/data-sets/data-set/data-set.vue.d.ts +47 -0
  11. package/dist/components/data-sets/data-set/data-set.vue_vue_type_script_setup_true_lang.js +157 -0
  12. package/dist/components/data-sets/data-set/types.d.ts +93 -0
  13. package/dist/components/data-sets/data-set-bar.js +5 -0
  14. package/dist/components/data-sets/data-set-bar.vue_vue_type_script_setup_true_lang.js +99 -0
  15. package/dist/components/data-sets/data-set-item/data-set-item.js +5 -0
  16. package/dist/components/data-sets/data-set-item/data-set-item.vue.d.ts +35 -0
  17. package/dist/components/data-sets/data-set-item/data-set-item.vue_vue_type_script_setup_true_lang.js +57 -0
  18. package/dist/components/data-sets/data-set-item/types.d.ts +42 -0
  19. package/dist/components/details/details.js +5 -0
  20. package/dist/components/details/details.vue.d.ts +28 -0
  21. package/dist/components/details/details.vue_vue_type_script_setup_true_lang.js +56 -0
  22. package/dist/components/details/types.d.ts +29 -0
  23. package/dist/components/dialogs/dialog/dialog-host-key.js +10 -0
  24. package/dist/components/dialogs/dialog/dialog.js +5 -0
  25. package/dist/components/dialogs/dialog/dialog.vue.d.ts +36 -0
  26. package/dist/components/dialogs/dialog/dialog.vue_vue_type_script_setup_true_lang.js +112 -0
  27. package/dist/components/dialogs/dialog/types.d.ts +47 -0
  28. package/dist/components/dialogs/dialog-host.js +5 -0
  29. package/dist/components/dialogs/dialog-host.vue_vue_type_script_setup_true_lang.js +81 -0
  30. package/dist/components/dialogs/toast.js +5 -0
  31. package/dist/components/dialogs/toast.vue_vue_type_script_setup_true_lang.js +35 -0
  32. package/dist/components/footer/footer.js +5 -0
  33. package/dist/components/footer/footer.vue_vue_type_script_setup_true_lang.js +31 -0
  34. package/dist/components/footer/types.d.ts +16 -0
  35. package/dist/components/form/form.js +5 -0
  36. package/dist/components/form/form.vue.d.ts +32 -0
  37. package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js +37 -0
  38. package/dist/components/form/types.d.ts +15 -0
  39. package/dist/components/grid/column/column.js +5 -0
  40. package/dist/components/grid/column/column.vue.d.ts +33 -0
  41. package/dist/components/grid/column/column.vue_vue_type_script_setup_true_lang.js +45 -0
  42. package/dist/components/grid/column/types.d.ts +27 -0
  43. package/dist/components/grid/container/container.js +5 -0
  44. package/dist/components/grid/container/container.vue.d.ts +27 -0
  45. package/dist/components/grid/container/container.vue_vue_type_script_setup_true_lang.js +33 -0
  46. package/dist/components/grid/container/types.d.ts +17 -0
  47. package/dist/components/grid/row/row.js +5 -0
  48. package/dist/components/grid/row/row.vue.d.ts +29 -0
  49. package/dist/components/grid/row/row.vue_vue_type_script_setup_true_lang.js +61 -0
  50. package/dist/components/grid/row/types.d.ts +63 -0
  51. package/dist/components/icon-button/icon-button.js +5 -0
  52. package/dist/components/icon-button/icon-button.vue.d.ts +23 -0
  53. package/dist/components/icon-button/icon-button.vue_vue_type_script_setup_true_lang.js +51 -0
  54. package/dist/components/icon-button/types.d.ts +32 -0
  55. package/dist/components/img/img.js +5 -0
  56. package/dist/components/img/img.vue.d.ts +23 -0
  57. package/dist/components/img/img.vue_vue_type_script_setup_true_lang.js +61 -0
  58. package/dist/components/img/types.d.ts +43 -0
  59. package/dist/components/inputs/autocomplete-field/autocomplete-field.js +5 -0
  60. package/dist/components/inputs/autocomplete-field/autocomplete-field.vue.d.ts +33 -0
  61. package/dist/components/inputs/autocomplete-field/autocomplete-field.vue_vue_type_script_setup_true_lang.js +161 -0
  62. package/dist/components/inputs/autocomplete-field/types.d.ts +84 -0
  63. package/dist/components/inputs/checkbox/checkbox.js +5 -0
  64. package/dist/components/inputs/checkbox/checkbox.vue.d.ts +33 -0
  65. package/dist/components/inputs/checkbox/checkbox.vue_vue_type_script_setup_true_lang.js +71 -0
  66. package/dist/components/inputs/checkbox/types.d.ts +35 -0
  67. package/dist/components/inputs/date-time-field/date-time-field.js +5 -0
  68. package/dist/components/inputs/date-time-field/date-time-field.vue.d.ts +32 -0
  69. package/dist/components/inputs/date-time-field/date-time-field.vue_vue_type_script_setup_true_lang.js +205 -0
  70. package/dist/components/inputs/date-time-field/types.d.ts +84 -0
  71. package/dist/components/inputs/field-loader.js +5 -0
  72. package/dist/components/inputs/field-loader.vue_vue_type_script_setup_true_lang.js +30 -0
  73. package/dist/components/inputs/mask-field/mask-field.js +5 -0
  74. package/dist/components/inputs/mask-field/mask-field.vue.d.ts +32 -0
  75. package/dist/components/inputs/mask-field/mask-field.vue_vue_type_script_setup_true_lang.js +120 -0
  76. package/dist/components/inputs/mask-field/types.d.ts +118 -0
  77. package/dist/components/inputs/text-field/text-field.js +5 -0
  78. package/dist/components/inputs/text-field/text-field.vue.d.ts +30 -0
  79. package/dist/components/inputs/text-field/text-field.vue_vue_type_script_setup_true_lang.js +119 -0
  80. package/dist/components/inputs/text-field/types.d.ts +70 -0
  81. package/dist/components/link/link.js +5 -0
  82. package/dist/components/link/link.vue.d.ts +27 -0
  83. package/dist/components/link/link.vue_vue_type_script_setup_true_lang.js +32 -0
  84. package/dist/components/link/types.d.ts +18 -0
  85. package/dist/components/main/main.js +5 -0
  86. package/dist/components/main/main.vue.d.ts +33 -0
  87. package/dist/components/main/main.vue_vue_type_script_setup_true_lang.js +104 -0
  88. package/dist/components/main/types.d.ts +75 -0
  89. package/dist/components/navigation-menu/navigation-menu.js +5 -0
  90. package/dist/components/navigation-menu/navigation-menu.vue_vue_type_script_setup_true_lang.js +207 -0
  91. package/dist/components/navigation-menu/types.d.ts +62 -0
  92. package/dist/components/page-transition/page-transition.js +5 -0
  93. package/dist/components/page-transition/page-transition.vue.d.ts +40 -0
  94. package/dist/components/page-transition/page-transition.vue_vue_type_script_setup_true_lang.js +27 -0
  95. package/dist/components/page-transition/types.d.ts +18 -0
  96. package/dist/components/sections/section/section.js +5 -0
  97. package/dist/components/sections/section/section.vue.d.ts +28 -0
  98. package/dist/components/sections/section/section.vue_vue_type_script_setup_true_lang.js +108 -0
  99. package/dist/components/sections/section/types.d.ts +80 -0
  100. package/dist/components/sections/section-content/section-content.js +5 -0
  101. package/dist/components/sections/section-content/section-content.vue.d.ts +27 -0
  102. package/dist/components/sections/section-content/section-content.vue_vue_type_script_setup_true_lang.js +16 -0
  103. package/dist/components/skeleton-loader/skeleton-loader.js +5 -0
  104. package/dist/components/skeleton-loader/skeleton-loader.vue_vue_type_script_setup_true_lang.js +65 -0
  105. package/dist/components/table/table.js +5 -0
  106. package/dist/components/table/table.vue.d.ts +19 -0
  107. package/dist/components/table/table.vue_vue_type_script_setup_true_lang.js +84 -0
  108. package/dist/components/table/types.d.ts +51 -0
  109. package/dist/components.d.ts +23 -896
  110. package/dist/components.js +23 -1381
  111. package/dist/composables/alignment/alignment.js +41 -0
  112. package/dist/composables/alignment/types.d.ts +12 -0
  113. package/dist/composables/button/button.js +54 -0
  114. package/dist/composables/colors/constants.js +27 -0
  115. package/dist/composables/colors/types.d.ts +4 -0
  116. package/dist/composables/colors/use-vuetify-background-color.js +16 -0
  117. package/dist/composables/colors/use-vuetify-color.js +11 -0
  118. package/dist/composables/colors/use-vuetify-text-color.js +12 -0
  119. package/dist/composables/data-set/data-set.js +128 -0
  120. package/dist/composables/dialogs/types.d.ts +88 -0
  121. package/dist/composables/dialogs/use-confirm.d.ts +21 -0
  122. package/dist/composables/dialogs/use-confirm.js +55 -0
  123. package/dist/composables/dialogs/use-decorative-timer.js +25 -0
  124. package/dist/composables/dialogs/use-dialog-focus.js +64 -0
  125. package/dist/composables/dialogs/use-dialog-loading.js +13 -0
  126. package/dist/composables/dialogs/use-dialog.d.ts +36 -0
  127. package/dist/{use-dialog-Ck2_ZW7T.js → composables/dialogs/use-dialog.js} +2 -53
  128. package/dist/composables/dialogs/use-run-or-toast.d.ts +27 -0
  129. package/dist/composables/dialogs/use-run-or-toast.js +65 -0
  130. package/dist/composables/dialogs/use-toast.d.ts +25 -0
  131. package/dist/composables/dialogs/use-toast.js +39 -0
  132. package/dist/composables/dimensions/dimensions.js +18 -0
  133. package/dist/composables/inputs/autocomplete-field.js +39 -0
  134. package/dist/composables/inputs/date-time-field.js +109 -0
  135. package/dist/composables/inputs/fields.js +28 -0
  136. package/dist/composables/inputs/mask-field.js +133 -0
  137. package/dist/composables/inputs/rules.js +16 -0
  138. package/dist/composables/inputs/text-field.js +81 -0
  139. package/dist/composables/navigation/types.d.ts +54 -0
  140. package/dist/composables/navigation/use-navigation-rail.js +163 -0
  141. package/dist/composables/navigation/use-navigation-search-shortcut.js +96 -0
  142. package/dist/composables/navigation/use-route-props.js +21 -0
  143. package/dist/composables/navigation/use-unsaved-changes.d.ts +35 -0
  144. package/dist/composables/navigation/use-unsaved-changes.js +88 -0
  145. package/dist/composables/section/section.js +34 -0
  146. package/dist/composables.d.ts +6 -193
  147. package/dist/composables.js +6 -117
  148. package/dist/consts/icons.d.ts +67 -0
  149. package/dist/consts/icons.js +69 -0
  150. package/dist/consts/locale.js +12 -0
  151. package/dist/consts/types.d.ts +12 -0
  152. package/dist/index.d.ts +1 -13
  153. package/dist/index.js +39 -14
  154. package/dist/plugins.d.ts +15 -4
  155. package/dist/plugins.js +54 -3
  156. package/dist/styles/fonts/UnimedSlab-Regular.woff2 +0 -0
  157. package/dist/styles/fonts/fonts.css +5 -0
  158. package/dist/styles/settings.scss +155 -0
  159. package/dist/unit-test.js +11 -7
  160. package/package.json +11 -11
  161. package/skills/uimed-vue/SKILL.md +113 -0
  162. package/skills/uimed-vue/references/api/components/autocomplete-field.md +45 -0
  163. package/skills/uimed-vue/references/api/components/button.md +48 -0
  164. package/skills/uimed-vue/references/api/components/checkbox.md +36 -0
  165. package/skills/uimed-vue/references/api/components/data-sets/data-set-item.md +61 -0
  166. package/skills/uimed-vue/references/api/components/data-sets/data-set.md +67 -0
  167. package/skills/uimed-vue/references/api/components/date-time-field.md +44 -0
  168. package/skills/uimed-vue/references/api/components/details.md +33 -0
  169. package/skills/uimed-vue/references/api/components/dialog.md +70 -0
  170. package/skills/uimed-vue/references/api/components/form.md +43 -0
  171. package/skills/uimed-vue/references/api/components/grid/column.md +41 -0
  172. package/skills/uimed-vue/references/api/components/grid/container.md +32 -0
  173. package/skills/uimed-vue/references/api/components/grid/row.md +37 -0
  174. package/skills/uimed-vue/references/api/components/icon-button.md +37 -0
  175. package/skills/uimed-vue/references/api/components/img.md +34 -0
  176. package/skills/uimed-vue/references/api/components/link.md +31 -0
  177. package/skills/uimed-vue/references/api/components/main.md +174 -0
  178. package/skills/uimed-vue/references/api/components/mask-field.md +60 -0
  179. package/skills/uimed-vue/references/api/components/page-transition.md +37 -0
  180. package/skills/uimed-vue/references/api/components/sections/section-content.md +23 -0
  181. package/skills/uimed-vue/references/api/components/sections/section.md +61 -0
  182. package/skills/uimed-vue/references/api/components/table.md +35 -0
  183. package/skills/uimed-vue/references/api/components/text-field.md +42 -0
  184. package/skills/uimed-vue/references/api/composables/use-confirm.md +96 -0
  185. package/skills/uimed-vue/references/api/composables/use-dialog.md +95 -0
  186. package/skills/uimed-vue/references/api/composables/use-run-or-toast.md +58 -0
  187. package/skills/uimed-vue/references/api/composables/use-toast.md +48 -0
  188. package/skills/uimed-vue/references/api/composables/use-unsaved-changes.md +106 -0
  189. package/skills/uimed-vue/references/api/index.md +1 -0
  190. package/skills/uimed-vue/references/guide/components/autocomplete-field.md +256 -0
  191. package/skills/uimed-vue/references/guide/components/button.md +155 -0
  192. package/skills/uimed-vue/references/guide/components/checkbox.md +113 -0
  193. package/skills/uimed-vue/references/guide/components/data-set.md +370 -0
  194. package/skills/uimed-vue/references/guide/components/date-time-field.md +202 -0
  195. package/skills/uimed-vue/references/guide/components/details.md +76 -0
  196. package/skills/uimed-vue/references/guide/components/dialog.md +269 -0
  197. package/skills/uimed-vue/references/guide/components/form.md +96 -0
  198. package/skills/uimed-vue/references/guide/components/icon-button.md +76 -0
  199. package/skills/uimed-vue/references/guide/components/img.md +128 -0
  200. package/skills/uimed-vue/references/guide/components/layout.md +323 -0
  201. package/skills/uimed-vue/references/guide/components/link.md +47 -0
  202. package/skills/uimed-vue/references/guide/components/main.md +435 -0
  203. package/skills/uimed-vue/references/guide/components/mask-field.md +256 -0
  204. package/skills/uimed-vue/references/guide/components/page-transition.md +111 -0
  205. package/skills/uimed-vue/references/guide/components/section.md +232 -0
  206. package/skills/uimed-vue/references/guide/components/table.md +102 -0
  207. package/skills/uimed-vue/references/guide/components/text-field.md +172 -0
  208. package/skills/uimed-vue/references/guide/composables/use-confirm.md +123 -0
  209. package/skills/uimed-vue/references/guide/composables/use-dialog.md +102 -0
  210. package/skills/uimed-vue/references/guide/composables/use-run-or-toast.md +55 -0
  211. package/skills/uimed-vue/references/guide/composables/use-toast.md +57 -0
  212. package/skills/uimed-vue/references/guide/composables/use-unsaved-changes.md +129 -0
  213. package/skills/uimed-vue/references/guide/getting-started.md +135 -0
  214. package/skills/uimed-vue/references/guide/icons.md +71 -0
  215. package/skills/uimed-vue/references/guide/index.md +51 -0
  216. package/skills/uimed-vue/references/guide/migration-v1-to-v2.md +191 -0
  217. package/skills/uimed-vue/references/guide/unit-testing.md +85 -0
  218. package/AGENTS.md +0 -233
  219. package/CLAUDE.md +0 -1
  220. package/dist/types-HPMP8IrV.d.ts +0 -49
@@ -1,117 +1,6 @@
1
- import { i as useDialog, o as useToast, t as openDialog } from "./use-dialog-Ck2_ZW7T.js";
2
- import { computed, ref } from "vue";
3
- //#region src/composables/dialogs/use-run-or-toast.ts
4
- const { toast } = useToast();
5
- /**
6
- * Generate `run` method and a computed property `isRunning`.
7
- * Calling `run` will reactively update `isRunning`.
8
- *
9
- * @example
10
- * ```ts
11
- * const { run, isRunning } = useRunOrToast();
12
- *
13
- * // Logs: false
14
- * console.log(isRunning.value);
15
- *
16
- * const promise = run(() => someFunction(param1, param2));
17
- *
18
- * // Logs: true
19
- * console.log(isRunning.value);
20
- *
21
- * await promise;
22
- * // Logs: false
23
- * console.log(isRunning.value);
24
- * ```
25
- */
26
- function useRunOrToast() {
27
- const running = ref(false);
28
- const isRunning = computed(() => running.value);
29
- /**
30
- * Receives a function and its parameters, runs it, and if it throws an error, shows a toast with the error message.
31
- * @returns the function returned value or `false` on error
32
- *
33
- * @example
34
- * ```ts
35
- * const { run, isRunning } = useRunOrToast();
36
- *
37
- * // Call like this:
38
- * const someFunctionResult1 = await run(() => someFunction(param1, param2));
39
- *
40
- * // Or this:
41
- * const someFunctionResult2 = await run(someFunction, param1, param2);
42
- * ```
43
- */
44
- async function run(toRun, ...params) {
45
- try {
46
- running.value = true;
47
- return await toRun(...params);
48
- } catch (error) {
49
- if (error instanceof Error) toast({
50
- message: error.message,
51
- color: "danger"
52
- });
53
- else console.error(error);
54
- return false;
55
- } finally {
56
- running.value = false;
57
- }
58
- }
59
- return {
60
- run,
61
- isRunning
62
- };
63
- }
64
- //#endregion
65
- //#region src/composables/dialogs/use-confirm.ts
66
- /**
67
- * Composable which returns a function to run actions only after the user confirms them in a
68
- * dialog, and a computed property `isRunning`.
69
- *
70
- * @example
71
- * ```ts
72
- * const { confirm, isRunning } = useConfirm();
73
- *
74
- * const removed = await confirm(
75
- * { title: "Excluir paciente", message: "Esta ação não pode ser desfeita.", confirmText: "Excluir", color: "danger" },
76
- * () => api.deletePatient(id),
77
- * );
78
- * ```
79
- */
80
- function useConfirm() {
81
- const { run, isRunning } = useRunOrToast();
82
- /**
83
- * Displays a confirmation dialog and, if the user confirms, runs the given function while the
84
- * dialog shows the confirm button loading. If the function throws an error, the dialog closes
85
- * and a toast shows the error message.
86
- * @returns the function returned value, or `false` if the user cancels or the function fails
87
- *
88
- * @example
89
- * ```ts
90
- * const { confirm } = useConfirm();
91
- *
92
- * // Call like this:
93
- * const result1 = await confirm({ message: "Salvar alterações?" }, () => save(form));
94
- *
95
- * // Or this:
96
- * const result2 = await confirm({ message: "Salvar alterações?" }, save, form);
97
- * ```
98
- */
99
- function confirm(options, action, ...params) {
100
- return openDialog({
101
- title: options.title,
102
- message: options.message,
103
- role: "alertdialog",
104
- actions: [{ text: options.cancelText ?? "Cancelar" }, {
105
- text: options.confirmText ?? "Confirmar",
106
- value: "confirm",
107
- color: options.color
108
- }]
109
- }, (value) => value === "confirm" ? run(action, ...params) : false);
110
- }
111
- return {
112
- confirm,
113
- isRunning
114
- };
115
- }
116
- //#endregion
117
- export { useConfirm, useDialog, useRunOrToast, useToast };
1
+ import useToast from "./composables/dialogs/use-toast.js";
2
+ import useDialog from "./composables/dialogs/use-dialog.js";
3
+ import useRunOrToast from "./composables/dialogs/use-run-or-toast.js";
4
+ import useConfirm from "./composables/dialogs/use-confirm.js";
5
+ import useUnsavedChanges from "./composables/navigation/use-unsaved-changes.js";
6
+ export { useConfirm, useDialog, useRunOrToast, useToast, useUnsavedChanges };
@@ -0,0 +1,67 @@
1
+ //#region src/consts/icons.d.ts
2
+ /**
3
+ * SVG path of each icon, by its name, in the order the "Ícones" guide page lists them. The paths
4
+ * come from `@mdi/js`, which exports one constant per icon, so the apps' bundles only take the
5
+ * icons used here.
6
+ *
7
+ * Every name can be passed to the components that accept an icon (e.g. `UIconButton` and the items
8
+ * of the navigation menu). The map is also the set of icon aliases of the underlying components,
9
+ * which draw some icons by name on their own (e.g. `close`, the arrows of the pagination and the
10
+ * checkbox marks): those names must match the aliases exactly, and a component that renders an
11
+ * alias missing here draws an empty icon. The unit tests of `src/consts/icons.ts` check each
12
+ * component that renders one.
13
+ *
14
+ * - The first names describe the icon's drawing. A name ending in `Alternative` is an alternative
15
+ * version of the same drawing (currently, outlined).
16
+ * - The others describe what the components use the icon for.
17
+ *
18
+ * To add an icon, add it here and to the list on the "Ícones" guide page (`docs/guide/icons.md`).
19
+ */
20
+ export declare const icons: {
21
+ home: string;
22
+ homeAlternative: string;
23
+ account: string;
24
+ accountAlternative: string;
25
+ accountGroup: string;
26
+ accountGroupAlternative: string;
27
+ calendar: string;
28
+ calendarAlternative: string;
29
+ clipboardText: string;
30
+ clipboardTextAlternative: string;
31
+ fileDocument: string;
32
+ fileDocumentAlternative: string;
33
+ flask: string;
34
+ flaskAlternative: string;
35
+ folder: string;
36
+ folderAlternative: string;
37
+ chartBox: string;
38
+ chartBoxAlternative: string;
39
+ wallet: string;
40
+ walletAlternative: string;
41
+ cog: string;
42
+ cogAlternative: string;
43
+ stethoscope: string;
44
+ pill: string;
45
+ hospital: string;
46
+ help: string;
47
+ notifications: string;
48
+ menu: string;
49
+ search: string;
50
+ showPassword: string;
51
+ hidePassword: string;
52
+ close: string;
53
+ clear: string;
54
+ dropdown: string;
55
+ subgroup: string;
56
+ expand: string;
57
+ collapse: string;
58
+ prev: string;
59
+ next: string;
60
+ checkboxOn: string;
61
+ checkboxOff: string;
62
+ success: string;
63
+ info: string;
64
+ warning: string;
65
+ error: string;
66
+ };
67
+ //#endregion
@@ -0,0 +1,69 @@
1
+ import { mdiAccount, mdiAccountGroup, mdiAccountGroupOutline, mdiAccountOutline, mdiAlertCircle, mdiBellOutline, mdiCalendar, mdiCalendarOutline, mdiChartBox, mdiChartBoxOutline, mdiCheckCircle, mdiCheckboxBlankOutline, mdiCheckboxMarked, mdiChevronDown, mdiChevronLeft, mdiChevronRight, mdiChevronUp, mdiClipboardText, mdiClipboardTextOutline, mdiClose, mdiCloseCircle, mdiCog, mdiCogOutline, mdiEye, mdiEyeOff, mdiFileDocument, mdiFileDocumentOutline, mdiFlask, mdiFlaskOutline, mdiFolder, mdiFolderOutline, mdiHelpCircleOutline, mdiHome, mdiHomeOutline, mdiHospitalBuilding, mdiInformation, mdiMagnify, mdiMenu, mdiMenuDown, mdiPill, mdiStethoscope, mdiWallet, mdiWalletOutline } from "@mdi/js";
2
+ //#region src/consts/icons.ts
3
+ /**
4
+ * SVG path of each icon, by its name, in the order the "Ícones" guide page lists them. The paths
5
+ * come from `@mdi/js`, which exports one constant per icon, so the apps' bundles only take the
6
+ * icons used here.
7
+ *
8
+ * Every name can be passed to the components that accept an icon (e.g. `UIconButton` and the items
9
+ * of the navigation menu). The map is also the set of icon aliases of the underlying components,
10
+ * which draw some icons by name on their own (e.g. `close`, the arrows of the pagination and the
11
+ * checkbox marks): those names must match the aliases exactly, and a component that renders an
12
+ * alias missing here draws an empty icon. The unit tests of `src/consts/icons.ts` check each
13
+ * component that renders one.
14
+ *
15
+ * - The first names describe the icon's drawing. A name ending in `Alternative` is an alternative
16
+ * version of the same drawing (currently, outlined).
17
+ * - The others describe what the components use the icon for.
18
+ *
19
+ * To add an icon, add it here and to the list on the "Ícones" guide page (`docs/guide/icons.md`).
20
+ */
21
+ const icons = {
22
+ home: mdiHome,
23
+ homeAlternative: mdiHomeOutline,
24
+ account: mdiAccount,
25
+ accountAlternative: mdiAccountOutline,
26
+ accountGroup: mdiAccountGroup,
27
+ accountGroupAlternative: mdiAccountGroupOutline,
28
+ calendar: mdiCalendar,
29
+ calendarAlternative: mdiCalendarOutline,
30
+ clipboardText: mdiClipboardText,
31
+ clipboardTextAlternative: mdiClipboardTextOutline,
32
+ fileDocument: mdiFileDocument,
33
+ fileDocumentAlternative: mdiFileDocumentOutline,
34
+ flask: mdiFlask,
35
+ flaskAlternative: mdiFlaskOutline,
36
+ folder: mdiFolder,
37
+ folderAlternative: mdiFolderOutline,
38
+ chartBox: mdiChartBox,
39
+ chartBoxAlternative: mdiChartBoxOutline,
40
+ wallet: mdiWallet,
41
+ walletAlternative: mdiWalletOutline,
42
+ cog: mdiCog,
43
+ cogAlternative: mdiCogOutline,
44
+ stethoscope: mdiStethoscope,
45
+ pill: mdiPill,
46
+ hospital: mdiHospitalBuilding,
47
+ help: mdiHelpCircleOutline,
48
+ notifications: mdiBellOutline,
49
+ menu: mdiMenu,
50
+ search: mdiMagnify,
51
+ showPassword: mdiEye,
52
+ hidePassword: mdiEyeOff,
53
+ close: mdiClose,
54
+ clear: mdiCloseCircle,
55
+ dropdown: mdiMenuDown,
56
+ subgroup: mdiMenuDown,
57
+ expand: mdiChevronDown,
58
+ collapse: mdiChevronUp,
59
+ prev: mdiChevronLeft,
60
+ next: mdiChevronRight,
61
+ checkboxOn: mdiCheckboxMarked,
62
+ checkboxOff: mdiCheckboxBlankOutline,
63
+ success: mdiCheckCircle,
64
+ info: mdiInformation,
65
+ warning: mdiAlertCircle,
66
+ error: mdiCloseCircle
67
+ };
68
+ //#endregion
69
+ export { icons };
@@ -0,0 +1,12 @@
1
+ import { pt } from "vuetify/locale";
2
+ //#region src/consts/locale.ts
3
+ /**
4
+ * Language of the texts the components generate on their own, such as
5
+ * screen reader announcements and pagination labels. Fixed in pt-BR.
6
+ */
7
+ const localeOptions = {
8
+ locale: "pt-BR",
9
+ messages: { "pt-BR": pt }
10
+ };
11
+ //#endregion
12
+ export { localeOptions };
@@ -0,0 +1,12 @@
1
+ import { icons } from "./icons.js";
2
+ //#region src/consts/types.d.ts
3
+ /**
4
+ * Name of an icon available to the components that accept one (e.g. `UIconButton` and the items
5
+ * of the navigation menu): the content icons, such as `home` and `calendar`, and the icons the
6
+ * components draw on their own, such as `close` and `search`. The full list, with a preview of
7
+ * each icon, is on the "Ícones" guide page.
8
+ *
9
+ * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/icons | Icons Guide}
10
+ */
11
+ export type Icon = keyof typeof icons;
12
+ //#endregion
package/dist/index.d.ts CHANGED
@@ -1,17 +1,5 @@
1
- import "@fontsource/roboto/100.css";
2
- import "@fontsource/roboto/300.css";
3
- import "@fontsource/roboto/400.css";
4
- import "@fontsource/roboto/500.css";
5
- import "@fontsource/roboto/700.css";
6
- import "@fontsource/roboto/900.css";
7
- import "@fontsource/roboto/100-italic.css";
8
- import "@fontsource/roboto/300-italic.css";
9
- import "@fontsource/roboto/400-italic.css";
10
- import "@fontsource/roboto/500-italic.css";
11
- import "@fontsource/roboto/700-italic.css";
12
- import "@fontsource/roboto/900-italic.css";
13
- import "@mdi/font/css/materialdesignicons.css";
14
1
  import "vuetify/styles";
2
+ import "./styles/fonts/fonts.css";
15
3
  import { Plugin } from "vue";
16
4
  //#region src/index.d.ts
17
5
  /**
package/dist/index.js CHANGED
@@ -1,26 +1,51 @@
1
- import "@fontsource/roboto/100.css";
2
- import "@fontsource/roboto/300.css";
3
- import "@fontsource/roboto/400.css";
4
- import "@fontsource/roboto/500.css";
5
- import "@fontsource/roboto/700.css";
6
- import "@fontsource/roboto/900.css";
7
- import "@fontsource/roboto/100-italic.css";
8
- import "@fontsource/roboto/300-italic.css";
9
- import "@fontsource/roboto/400-italic.css";
10
- import "@fontsource/roboto/500-italic.css";
11
- import "@fontsource/roboto/700-italic.css";
12
- import "@fontsource/roboto/900-italic.css";
13
- import "@mdi/font/css/materialdesignicons.css";
1
+ import { icons } from "./consts/icons.js";
2
+ import { localeOptions } from "./consts/locale.js";
14
3
  import "vuetify/styles";
4
+ import "./styles/fonts/fonts.css";
15
5
  import { createVuetify } from "vuetify";
16
6
  import "vue";
7
+ import { mdi } from "vuetify/iconsets/mdi-svg";
17
8
  //#region src/index.ts
18
9
  /**
19
10
  * Create an UIMed-Vue instance to be installed after [createApp](https://vuejs.org/guide/essentials/application.html#the-application-instance).
20
11
  * @returns an instance to be used with [app.use](https://vuejs.org/guide/essentials/application.html#the-application-instance)
21
12
  */
22
13
  function createUimed() {
23
- return createVuetify({ theme: { defaultTheme: "light" } });
14
+ return createVuetify({
15
+ icons: {
16
+ defaultSet: "mdi",
17
+ aliases: icons,
18
+ sets: { mdi }
19
+ },
20
+ locale: localeOptions,
21
+ theme: {
22
+ defaultTheme: "light",
23
+ themes: { light: {
24
+ dark: false,
25
+ colors: {
26
+ background: "#EAEDF0",
27
+ surface: "#FCFCFD",
28
+ primary: "#074D31",
29
+ secondary: "#FCFCFD",
30
+ success: "#A9EFC5",
31
+ warning: "#FFE596",
32
+ error: "#D92D20",
33
+ info: "#9ACBE5",
34
+ "on-primary": "#FCFCFD",
35
+ "primary-text": "#074D31",
36
+ "success-text": "#16783E",
37
+ "info-text": "#277096",
38
+ "warning-text": "#846300",
39
+ "error-text": "#C92A1E",
40
+ link: "#0271AD"
41
+ },
42
+ variables: {
43
+ "border-color": "#D0D5DD",
44
+ "medium-emphasis-opacity": .7
45
+ }
46
+ } }
47
+ }
48
+ });
24
49
  }
25
50
  //#endregion
26
51
  export { createUimed };
package/dist/plugins.d.ts CHANGED
@@ -1,10 +1,21 @@
1
- import vitePluginVuetify from "vite-plugin-vuetify";
2
- import { UserConfig } from "vite-plus";
1
+ import { Plugin, UserConfig } from "vite-plus";
3
2
  //#region src/plugins.d.ts
4
3
  /**
5
- * Vite plugin for UIMed.
4
+ * Vite plugin that compiles the components' styles with the library's font and Sass settings.
5
+ * Required: without it, the components lose the Unimed Slab font. Needs `sass-embedded`, a peer
6
+ * dependency.
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * // vite.config.ts
11
+ * import { vitePluginUimed } from "@nexdom/uimed-vue/plugins";
12
+ *
13
+ * export default defineConfig({
14
+ * plugins: [vue(), vitePluginUimed()],
15
+ * });
16
+ * ```
6
17
  */
7
- export declare function vitePluginUimed(): ReturnType<typeof vitePluginVuetify>;
18
+ export declare function vitePluginUimed(): Plugin[];
8
19
  /**
9
20
  * Vitest Server plugin for UIMed.
10
21
  */
package/dist/plugins.js CHANGED
@@ -1,10 +1,61 @@
1
- import vitePluginVuetify from "vite-plugin-vuetify";
1
+ import { existsSync } from "node:fs";
2
+ import { pathToFileURL } from "node:url";
2
3
  //#region src/plugins.ts
4
+ /** Matches the ids of CSS files, with or without a query */
5
+ const stylesheet = /\.css(?:\?|$)/;
6
+ /** Path of Vuetify's stylesheets folder, inside the `node_modules` folder where it's installed */
7
+ const vuetifyStylesheets = "/node_modules/vuetify/lib/";
3
8
  /**
4
- * Vite plugin for UIMed.
9
+ * Matches the queries that import a stylesheet's file as is (`?raw`) or its URL (`?url`), which
10
+ * Vite doesn't compile. The URL still serves the compiled stylesheet, which Vite loads separately
11
+ */
12
+ const uncompiledStylesheetQuery = /[?&](?:raw|url)\b/;
13
+ /**
14
+ * Vite plugin that compiles the components' styles with the library's font and Sass settings.
15
+ * Required: without it, the components lose the Unimed Slab font. Needs `sass-embedded`, a peer
16
+ * dependency.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * // vite.config.ts
21
+ * import { vitePluginUimed } from "@nexdom/uimed-vue/plugins";
22
+ *
23
+ * export default defineConfig({
24
+ * plugins: [vue(), vitePluginUimed()],
25
+ * });
26
+ * ```
5
27
  */
6
28
  function vitePluginUimed() {
7
- return vitePluginVuetify({ autoImport: false });
29
+ const settings = new URL("./styles/settings.scss", import.meta.url);
30
+ let compiler;
31
+ return [{
32
+ name: "uimed:vuetify-styles",
33
+ enforce: "pre",
34
+ load: {
35
+ filter: { id: {
36
+ include: stylesheet,
37
+ exclude: uncompiledStylesheetQuery
38
+ } },
39
+ async handler(id) {
40
+ const file = id.split("?")[0].replaceAll("\\", "/");
41
+ const folder = file.lastIndexOf(vuetifyStylesheets);
42
+ if (folder === -1) return null;
43
+ const nodeModules = `${file.slice(0, folder)}/node_modules`;
44
+ const source = [".sass", ".scss"].map((extension) => `${file.slice(0, -4)}${extension}`).find((path) => existsSync(path));
45
+ if (!source) return null;
46
+ compiler ??= import("sass-embedded").then((sass) => sass.initAsyncCompiler());
47
+ const sass = await compiler;
48
+ const entry = `@use "${settings.href}";\n@use "${pathToFileURL(source).href}";`;
49
+ const { css } = await sass.compileStringAsync(entry, { loadPaths: [nodeModules] });
50
+ return css;
51
+ }
52
+ },
53
+ async closeBundle() {
54
+ const current = compiler;
55
+ compiler = void 0;
56
+ await (await current)?.dispose();
57
+ }
58
+ }];
8
59
  }
9
60
  /**
10
61
  * Vitest Server plugin for UIMed.
@@ -0,0 +1,5 @@
1
+ @font-face {
2
+ font-family: "Unimed Slab";
3
+ src: url("./UnimedSlab-Regular.woff2");
4
+ font-display: swap;
5
+ }
@@ -0,0 +1,155 @@
1
+ @use "vuetify/settings" with (
2
+ $body-font-family: var(--v-font-body, "Unimed Slab", sans-serif),
3
+ // Unimed Slab's ascent and descent take 1.26em, more than the subtitles' default 1rem line
4
+ // height, which clipped its descenders and accented capitals
5
+ $list-item-subtitle-line-height: normal,
6
+ // The utility classes are a render-blocking stylesheet in the apps, so only the ones the
7
+ // components use are generated. The theme's colors (`primary`, ...) don't come from here, and
8
+ // the palettes are left out: only the shades (black, white and transparent) remain, since
9
+ // Vuetify uses `bg-transparent` itself (e.g. on the navigation drawer's list)
10
+ $colors: (
11
+ "red": (),
12
+ "pink": (),
13
+ "purple": (),
14
+ "deep-purple": (),
15
+ "indigo": (),
16
+ "blue": (),
17
+ "light-blue": (),
18
+ "cyan": (),
19
+ "teal": (),
20
+ "green": (),
21
+ "light-green": (),
22
+ "lime": (),
23
+ "yellow": (),
24
+ "amber": (),
25
+ "orange": (),
26
+ "deep-orange": (),
27
+ "brown": (),
28
+ "blue-grey": (),
29
+ "grey": (),
30
+ ),
31
+ // The utility families the components use, or that Vuetify applies to them (e.g. `rounded-0` on
32
+ // list items), without the breakpoint and print variants, which they don't use. A class from
33
+ // another family needs its key enabled here
34
+ $utilities: (
35
+ "display": (
36
+ responsive: false,
37
+ print: false,
38
+ ),
39
+ "flex": (
40
+ responsive: false,
41
+ ),
42
+ "flex-direction": (
43
+ responsive: false,
44
+ ),
45
+ "flex-wrap": (
46
+ responsive: false,
47
+ ),
48
+ "justify-content": (
49
+ responsive: false,
50
+ ),
51
+ "align-items": (
52
+ responsive: false,
53
+ ),
54
+ "align-content": (
55
+ responsive: false,
56
+ ),
57
+ "margin": (
58
+ responsive: false,
59
+ ),
60
+ "margin-top": (
61
+ responsive: false,
62
+ ),
63
+ "margin-left": (
64
+ responsive: false,
65
+ ),
66
+ "negative-margin-right": (
67
+ responsive: false,
68
+ ),
69
+ "padding": (
70
+ responsive: false,
71
+ ),
72
+ "padding-x": (
73
+ responsive: false,
74
+ ),
75
+ "padding-y": (
76
+ responsive: false,
77
+ ),
78
+ "padding-top": (
79
+ responsive: false,
80
+ ),
81
+ "text-align": (
82
+ responsive: false,
83
+ ),
84
+ "height": (
85
+ responsive: false,
86
+ ),
87
+ "width": (
88
+ responsive: false,
89
+ ),
90
+ "overflow": false,
91
+ "overflow-x": false,
92
+ "overflow-y": false,
93
+ "float": false,
94
+ "float:rtl": false,
95
+ "float:ltr": false,
96
+ "flex-grow": false,
97
+ "flex-shrink": false,
98
+ "justify-items": false,
99
+ "align-self": false,
100
+ "order": false,
101
+ "gap": false,
102
+ "gap-row": false,
103
+ "gap-column": false,
104
+ "margin-x": false,
105
+ "margin-y": false,
106
+ "margin-right": false,
107
+ "margin-bottom": false,
108
+ "margin-start": false,
109
+ "margin-end": false,
110
+ "negative-margin": false,
111
+ "negative-margin-x": false,
112
+ "negative-margin-y": false,
113
+ "negative-margin-top": false,
114
+ "negative-margin-bottom": false,
115
+ "negative-margin-left": false,
116
+ "negative-margin-start": false,
117
+ "negative-margin-end": false,
118
+ "padding-right": false,
119
+ "padding-bottom": false,
120
+ "padding-left": false,
121
+ "padding-start": false,
122
+ "padding-end": false,
123
+ "rounded-top": false,
124
+ "rounded-end": false,
125
+ "rounded-bottom": false,
126
+ "rounded-start": false,
127
+ "rounded-top-start": false,
128
+ "rounded-top-end": false,
129
+ "rounded-bottom-end": false,
130
+ "rounded-bottom-start": false,
131
+ "border-current": false,
132
+ "border-opacity": false,
133
+ "border-top": false,
134
+ "border-end": false,
135
+ "border-bottom": false,
136
+ "border-start": false,
137
+ "border-style": false,
138
+ "white-space": false,
139
+ "overflow-wrap": false,
140
+ "opacity": false,
141
+ "text-overflow": false,
142
+ "typography": false,
143
+ "text-transform": false,
144
+ "font-weight": false,
145
+ "font-italic": false,
146
+ "text-mono": false,
147
+ "position": false,
148
+ "top": false,
149
+ "right": false,
150
+ "bottom": false,
151
+ "left": false,
152
+ "cursor": false,
153
+ "fill-height": false,
154
+ )
155
+ );
package/dist/unit-test.js CHANGED
@@ -1,16 +1,20 @@
1
+ import { __require } from "./_virtual/_rolldown/runtime.js";
2
+ import { icons } from "./consts/icons.js";
3
+ import { localeOptions } from "./consts/locale.js";
1
4
  import { createVuetify } from "vuetify";
5
+ import { mdi } from "vuetify/iconsets/mdi-svg";
2
6
  import * as components from "vuetify/components";
3
7
  import * as directives from "vuetify/directives";
4
- //#region \0rolldown/runtime.js
5
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
6
- if (typeof require !== "undefined") return require.apply(this, arguments);
7
- throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
8
- });
9
- //#endregion
10
8
  //#region src/unit-test.ts
11
9
  const vuetify = createVuetify({
12
10
  components,
13
- directives
11
+ directives,
12
+ icons: {
13
+ defaultSet: "mdi",
14
+ aliases: icons,
15
+ sets: { mdi }
16
+ },
17
+ locale: localeOptions
14
18
  });
15
19
  /**
16
20
  * Vue Test Utils plugin for Uimed.