@nexdom/uimed-vue 2.0.0-beta.50 → 2.0.0-beta.51

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/AGENTS.md CHANGED
@@ -22,11 +22,11 @@ pnpm add @nexdom/uimed-vue
22
22
  yarn add @nexdom/uimed-vue
23
23
  ```
24
24
 
25
- Peer dependencies (`@mdi/font`, `@nexdom/shared`, `resize-observer-polyfill`, `sass-embedded`, `vite-plus`, `vue`, `vue-component-type-helpers`, `vue-router`, `vuetify`) must be installed alongside it — most package managers install these automatically, but confirm versions match what's declared in `package.json`'s `peerDependencies`.
25
+ Peer dependencies (`@mdi/js`, `@nexdom/shared`, `resize-observer-polyfill`, `sass-embedded`, `vite-plus`, `vue`, `vue-component-type-helpers`, `vue-router`, `vuetify`) must be installed alongside it — most package managers install these automatically, but confirm versions match what's declared in `package.json`'s `peerDependencies`.
26
26
 
27
27
  ### Setup
28
28
 
29
- Add the Vite plugin, which compiles the components' styles with the library's font and Sass settings, and loads the icon font with `font-display`, so it doesn't block rendering while it loads. Without it, components lose the Unimed Slab font:
29
+ Add the Vite plugin, which compiles the components' styles with the library's font and Sass settings. Without it, components lose the Unimed Slab font:
30
30
 
31
31
  ```ts
32
32
  // vite.config.ts
@@ -206,7 +206,10 @@ Use an existing composable (e.g. `use-toast`) as the reference, and deliver in t
206
206
  - Component layout: `src/components/<name>/<name>.vue`, `types.ts` for prop/option types, `__tests__/<name>.test.ts` for unit tests. Components that belong to a group live in the group's folder (e.g. the internal `src/components/dialogs/toast.vue`).
207
207
  - Composables live in a group folder: `src/composables/<group>/<name>.ts`, with `types.ts` and `__tests__/` in the group folder (e.g. `src/composables/dialogs/use-toast.ts`). A composable (`use-*.ts`) must depend on `vue` or `vue-router`, directly or through other modules (enforced by dependency-cruiser's `composables-use-vue` rule).
208
208
  - Library-wide configuration constants that aren't components or composables live in `src/consts/<name>.ts` (e.g. `src/consts/locale.ts`, the language set by `createUimed()` and `vueTestUtilsPluginUimed()`), with their types in `src/consts/types.ts`.
209
- - Components accept icons by name (the `Icon` type in `src/consts/types.ts`), mapped to icon font classes by the internal `icons` object in `src/consts/icons.ts`. To add an icon, add it to that map and to the list on the "Ícones" guide page (`docs/guide/icons.md`), and check that its class exists in the installed icon font: the unit test of `src/consts/icons.ts` checks every class, and the page's E2E spec fails when the page and the map list different icons.
209
+ - Icons are drawn as inline SVGs with the paths of `@mdi/js`, imported one by one so the apps' bundles only take the icons used: there's no icon font, so never use `mdi-*` classes. Every icon is in the internal `icons` map of `src/consts/icons.ts`, and every name in it is public (the `Icon` type in `src/consts/types.ts`):
210
+ - To add an icon, add it to that map and to the list on the "Ícones" guide page (`docs/guide/icons.md`), in the same order, and check that `@mdi/js` exports it: the unit test of `src/consts/icons.ts` checks every path, and the page's E2E spec fails when the page and the map list different icons. Names are camelCase, like the Vuetify aliases they must match (e.g. `checkboxOn`/`checkboxOff`). Reuse an existing name before adding one with the same drawing.
211
+ - Components use the map for their own icons too (`icons.help`, `icons.close`), never `$` aliases nor `mdi-*` strings.
212
+ - The map is also Vuetify's alias set (`createUimed()` and `vueTestUtilsPluginUimed()` pass it as `aliases`), since Vuetify's components draw some icons by alias on their own (e.g. `$clear` in clearable fields, `$prev`/`$next` in the pagination). It only has the aliases the library's components render, so a component that renders a new one (a new Vuetify component or prop) needs it added to the map, named exactly as the alias; without it, the icon is drawn empty, without a warning. Add each state that renders an alias to `src/consts/__tests__/icon-aliases.test.ts`, which fails on icons drawn without a path of `@mdi/js`.
210
213
  - Pure helpers that don't use Vue live in `src/utils/<name>.ts`, with tests in `src/utils/__tests__/`. Generic helpers that any TypeScript project could use (e.g. `isDeepEqual`) belong in `@nexdom/shared` instead.
211
214
  - Public components/composables are re-exported from `src/components/index.ts` and `src/composables/index.ts`. Prop types stay internal (`types.ts` is not re-exported); consumers derive them with `ComponentProps` (see [Usage](#usage)).
212
215
  - Every publicly exported component must use the `U` prefix on its export identifier (e.g., `UButton`, `UMain`), while internal file names and component names remain unprefixed.
@@ -97,46 +97,77 @@ interface Option {
97
97
  //#endregion
98
98
  //#region src/consts/icons.d.ts
99
99
  /**
100
- * Icon font class of each icon available to the components that accept one (e.g. `UIconButton`
101
- * and the items of the navigation menu), by its name, in the order the "Ícones" guide page lists
102
- * them. A name ending in `-alternative` is an alternative version of the same drawing (currently,
103
- * outlined).
100
+ * SVG path of each icon, by its name, in the order the "Ícones" guide page lists them. The paths
101
+ * come from `@mdi/js`, which exports one constant per icon, so the apps' bundles only take the
102
+ * icons used here.
103
+ *
104
+ * Every name can be passed to the components that accept an icon (e.g. `UIconButton` and the items
105
+ * of the navigation menu). The map is also the set of icon aliases of the underlying components,
106
+ * which draw some icons by name on their own (e.g. `close`, the arrows of the pagination and the
107
+ * checkbox marks): those names must match the aliases exactly, and a component that renders an
108
+ * alias missing here draws an empty icon. The unit tests of `src/consts/icons.ts` check each
109
+ * component that renders one.
110
+ *
111
+ * - The first names describe the icon's drawing. A name ending in `Alternative` is an alternative
112
+ * version of the same drawing (currently, outlined).
113
+ * - The others describe what the components use the icon for.
104
114
  *
105
115
  * To add an icon, add it here and to the list on the "Ícones" guide page (`docs/guide/icons.md`).
106
116
  */
107
117
  declare const icons: {
108
118
  home: string;
109
- "home-alternative": string;
119
+ homeAlternative: string;
110
120
  account: string;
111
- "account-alternative": string;
112
- "account-group": string;
113
- "account-group-alternative": string;
121
+ accountAlternative: string;
122
+ accountGroup: string;
123
+ accountGroupAlternative: string;
114
124
  calendar: string;
115
- "calendar-alternative": string;
116
- "clipboard-text": string;
117
- "clipboard-text-alternative": string;
118
- "file-document": string;
119
- "file-document-alternative": string;
125
+ calendarAlternative: string;
126
+ clipboardText: string;
127
+ clipboardTextAlternative: string;
128
+ fileDocument: string;
129
+ fileDocumentAlternative: string;
120
130
  flask: string;
121
- "flask-alternative": string;
131
+ flaskAlternative: string;
122
132
  folder: string;
123
- "folder-alternative": string;
124
- "chart-box": string;
125
- "chart-box-alternative": string;
133
+ folderAlternative: string;
134
+ chartBox: string;
135
+ chartBoxAlternative: string;
126
136
  wallet: string;
127
- "wallet-alternative": string;
137
+ walletAlternative: string;
128
138
  cog: string;
129
- "cog-alternative": string;
139
+ cogAlternative: string;
130
140
  stethoscope: string;
131
141
  pill: string;
132
142
  hospital: string;
143
+ help: string;
144
+ notifications: string;
145
+ menu: string;
146
+ search: string;
147
+ showPassword: string;
148
+ hidePassword: string;
149
+ close: string;
150
+ clear: string;
151
+ dropdown: string;
152
+ subgroup: string;
153
+ expand: string;
154
+ collapse: string;
155
+ prev: string;
156
+ next: string;
157
+ checkboxOn: string;
158
+ checkboxOff: string;
159
+ success: string;
160
+ info: string;
161
+ warning: string;
162
+ error: string;
133
163
  };
134
164
  //#endregion
135
165
  //#region src/consts/types.d.ts
136
166
  /**
137
167
  * Name of an icon available to the components that accept one (e.g. `UIconButton` and the items
138
- * of the navigation menu). The full list, with a preview of each icon, is on the "Ícones" guide
139
- * page.
168
+ * of the navigation menu): the content icons, such as `home` and `calendar`, and the icons the
169
+ * components draw on their own, such as `close` and `search`. The full list, with a preview of
170
+ * each icon, is on the "Ícones" guide page.
140
171
  *
141
172
  * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/icons | Icons Guide}
142
173
  */
@@ -589,8 +620,8 @@ declare const __VLS_export$16: import("vue", { with: { "resolution-mode": "impor
589
620
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
590
621
  }>, {
591
622
  variant: TextFieldVariant;
592
- clearable: boolean;
593
623
  type: TextFieldType;
624
+ clearable: boolean;
594
625
  }, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>;
595
626
  //#endregion
596
627
  //#region src/components/inputs/checkbox/types.d.ts
@@ -1,4 +1,5 @@
1
- import { a as messages, c as colorToVuetifyColor, l as colorToVuetifyTextColor, n as owners$1, r as requests, s as useVuetifyColor } from "./use-dialog-C0sM_bA2.js";
1
+ import { t as icons } from "./icons-H53IqH1s.js";
2
+ import { a as messages, c as colorToVuetifyTextColor, n as owners$1, r as requests, s as colorToVuetifyColor } from "./use-dialog-Bn54H-K3.js";
2
3
  import { useLocale, useMask } from "vuetify";
3
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, inject, isRef, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, onScopeDispose, onUnmounted, openBlock, provide, readonly, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toValue, unref, useId, useModel, useSlots, useTemplateRef, watch, withCtx, withKeys, withModifiers } from "vue";
4
5
  import { pt } from "vuetify/locale";
@@ -269,7 +270,7 @@ var app_bar_default = /* @__PURE__ */ defineComponent({
269
270
  const userAvatarProps = computed(() => {
270
271
  if (props.user.img) return { image: props.user.img };
271
272
  if (userInitials.value) return { text: userInitials.value };
272
- return { icon: "mdi-account-outline" };
273
+ return { icon: icons.accountAlternative };
273
274
  });
274
275
  function isParentOption(option) {
275
276
  return "items" in option;
@@ -287,8 +288,8 @@ var app_bar_default = /* @__PURE__ */ defineComponent({
287
288
  showHelp.value ? (openBlock(), createBlock(unref(VBtn), mergeProps({ key: 0 }, unref(routeProps), {
288
289
  "data-testid": helpBtnDataTestid.value,
289
290
  "aria-label": "Ajuda",
290
- icon: "mdi-help-circle-outline"
291
- }), null, 16, ["data-testid"])) : createCommentVNode("v-if", true),
291
+ icon: unref(icons).help
292
+ }), null, 16, ["data-testid", "icon"])) : createCommentVNode("v-if", true),
292
293
  showNotifications.value ? (openBlock(), createBlock(unref(VMenu), {
293
294
  key: 1,
294
295
  modelValue: notificationsOpen.value,
@@ -306,7 +307,7 @@ var app_bar_default = /* @__PURE__ */ defineComponent({
306
307
  label: unreadLabel.value,
307
308
  color: "error"
308
309
  }, {
309
- default: withCtx(() => [createVNode(unref(VIcon), { icon: "mdi-bell-outline" })]),
310
+ default: withCtx(() => [createVNode(unref(VIcon), { icon: unref(icons).notifications }, null, 8, ["icon"])]),
310
311
  _: 1
311
312
  }, 8, [
312
313
  "model-value",
@@ -454,43 +455,6 @@ var app_bar_default = /* @__PURE__ */ defineComponent({
454
455
  }
455
456
  });
456
457
  //#endregion
457
- //#region src/consts/icons.ts
458
- /**
459
- * Icon font class of each icon available to the components that accept one (e.g. `UIconButton`
460
- * and the items of the navigation menu), by its name, in the order the "Ícones" guide page lists
461
- * them. A name ending in `-alternative` is an alternative version of the same drawing (currently,
462
- * outlined).
463
- *
464
- * To add an icon, add it here and to the list on the "Ícones" guide page (`docs/guide/icons.md`).
465
- */
466
- const icons = {
467
- home: "mdi-home",
468
- "home-alternative": "mdi-home-outline",
469
- account: "mdi-account",
470
- "account-alternative": "mdi-account-outline",
471
- "account-group": "mdi-account-group",
472
- "account-group-alternative": "mdi-account-group-outline",
473
- calendar: "mdi-calendar",
474
- "calendar-alternative": "mdi-calendar-outline",
475
- "clipboard-text": "mdi-clipboard-text",
476
- "clipboard-text-alternative": "mdi-clipboard-text-outline",
477
- "file-document": "mdi-file-document",
478
- "file-document-alternative": "mdi-file-document-outline",
479
- flask: "mdi-flask",
480
- "flask-alternative": "mdi-flask-outline",
481
- folder: "mdi-folder",
482
- "folder-alternative": "mdi-folder-outline",
483
- "chart-box": "mdi-chart-box",
484
- "chart-box-alternative": "mdi-chart-box-outline",
485
- wallet: "mdi-wallet",
486
- "wallet-alternative": "mdi-wallet-outline",
487
- cog: "mdi-cog",
488
- "cog-alternative": "mdi-cog-outline",
489
- stethoscope: "mdi-stethoscope",
490
- pill: "mdi-pill",
491
- hospital: "mdi-hospital-building"
492
- };
493
- //#endregion
494
458
  //#region src/composables/inputs/rules.ts
495
459
  function required(value) {
496
460
  return !isEmpty(value) || "Campo obrigatório";
@@ -578,10 +542,10 @@ function useTextFieldAppendIcon(type, disabled) {
578
542
  toggle();
579
543
  }
580
544
  const iconProps = computed(() => {
581
- if (toValue(type) === "search") return { icon: "mdi-magnify" };
545
+ if (toValue(type) === "search") return { icon: icons.search };
582
546
  if (!isPasswordField.value) return void 0;
583
547
  return {
584
- icon: isPasswordVisible.value ? "mdi-eye-off" : "mdi-eye",
548
+ icon: isPasswordVisible.value ? icons.hidePassword : icons.showPassword,
585
549
  "aria-label": "Mostrar senha",
586
550
  "aria-pressed": isPasswordVisible.value,
587
551
  onClick: toggle,
@@ -994,16 +958,24 @@ var toast_default = /* @__PURE__ */ defineComponent({
994
958
  }, {
995
959
  actions: withCtx(({ props }) => [createVNode(unref(VIconBtn), mergeProps(props, {
996
960
  "aria-label": "Fechar",
997
- icon: "$close",
961
+ icon: unref(icons).close,
998
962
  size: "small",
999
963
  variant: "text"
1000
- }), null, 16)]),
964
+ }), null, 16, ["icon"])]),
1001
965
  _: 1
1002
966
  }, 8, ["modelValue", "content-props"]);
1003
967
  };
1004
968
  }
1005
969
  });
1006
970
  //#endregion
971
+ //#region src/composables/colors/use-vuetify-color.ts
972
+ function useVuetifyColor(color) {
973
+ return computed(() => {
974
+ const colorValue = toValue(color);
975
+ return colorValue ? colorToVuetifyColor[colorValue] : colorToVuetifyColor.primary;
976
+ });
977
+ }
978
+ //#endregion
1007
979
  //#region src/composables/colors/use-vuetify-text-color.ts
1008
980
  /**
1009
981
  * Maps a color to the theme color to use when it's the text color, e.g. in a ghost button, so it
@@ -1,4 +1,4 @@
1
- import { i as useDialog, o as useToast, t as openDialog } from "./use-dialog-C0sM_bA2.js";
1
+ import { i as useDialog, o as useToast, t as openDialog } from "./use-dialog-Bn54H-K3.js";
2
2
  import { computed, onActivated, onDeactivated, onMounted, onUnmounted, ref, toValue, watch } from "vue";
3
3
  import { isDeepEqual } from "@nexdom/shared/utils";
4
4
  import { onBeforeRouteLeave } from "vue-router";
@@ -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 as t };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import "@mdi/font/css/materialdesignicons.css";
2
1
  import "vuetify/styles";
3
2
  import "./styles/fonts/fonts.css";
4
3
  import { Plugin } from "vue";
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
+ import { t as icons } from "./icons-H53IqH1s.js";
1
2
  import { t as localeOptions } from "./locale-CM4o8cD_.js";
2
- import "@mdi/font/css/materialdesignicons.css";
3
3
  import "vuetify/styles";
4
4
  import "./styles/fonts/fonts.css";
5
5
  import { createVuetify } from "vuetify";
6
6
  import "vue";
7
+ import { mdi } from "vuetify/iconsets/mdi-svg";
7
8
  //#region src/index.ts
8
9
  /**
9
10
  * Create an UIMed-Vue instance to be installed after [createApp](https://vuejs.org/guide/essentials/application.html#the-application-instance).
@@ -11,6 +12,11 @@ import "vue";
11
12
  */
12
13
  function createUimed() {
13
14
  return createVuetify({
15
+ icons: {
16
+ defaultSet: "mdi",
17
+ aliases: icons,
18
+ sets: { mdi }
19
+ },
14
20
  locale: localeOptions,
15
21
  theme: {
16
22
  defaultTheme: "light",
package/dist/plugins.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { Plugin, UserConfig } from "vite-plus";
2
2
  //#region src/plugins.d.ts
3
3
  /**
4
- * Vite plugin that compiles the components' styles with the library's font and Sass settings, and
5
- * loads the icon font with `font-display: swap`, so it doesn't block rendering while it loads.
4
+ * Vite plugin that compiles the components' styles with the library's font and Sass settings.
6
5
  * Required: without it, the components lose the Unimed Slab font. Needs `sass-embedded`, a peer
7
6
  * dependency.
8
7
  *
package/dist/plugins.js CHANGED
@@ -10,13 +10,8 @@ const vuetifyStylesheets = "/node_modules/vuetify/lib/";
10
10
  * Vite doesn't compile. The URL still serves the compiled stylesheet, which Vite loads separately
11
11
  */
12
12
  const uncompiledStylesheetQuery = /[?&](?:raw|url)\b/;
13
- /** Matches the ids of the icon font's stylesheet, with or without a query and Windows separators */
14
- const iconFontStylesheet = /[\\/]node_modules[\\/]@mdi[\\/]font[\\/]css[\\/]materialdesignicons\.css(?:\?|$)/;
15
- /** Start of the icon font's `@font-face` rule, the only one in its stylesheet */
16
- const iconFontFace = "@font-face {";
17
13
  /**
18
- * Vite plugin that compiles the components' styles with the library's font and Sass settings, and
19
- * loads the icon font with `font-display: swap`, so it doesn't block rendering while it loads.
14
+ * Vite plugin that compiles the components' styles with the library's font and Sass settings.
20
15
  * Required: without it, the components lose the Unimed Slab font. Needs `sass-embedded`, a peer
21
16
  * dependency.
22
17
  *
@@ -60,18 +55,6 @@ function vitePluginUimed() {
60
55
  compiler = void 0;
61
56
  await (await current)?.dispose();
62
57
  }
63
- }, {
64
- name: "uimed:icon-font",
65
- enforce: "pre",
66
- transform: {
67
- filter: { id: {
68
- include: iconFontStylesheet,
69
- exclude: uncompiledStylesheetQuery
70
- } },
71
- handler(code) {
72
- return code.replace(iconFontFace, `${iconFontFace} font-display: swap;`);
73
- }
74
- }
75
58
  }];
76
59
  }
77
60
  /**
package/dist/unit-test.js CHANGED
@@ -1,5 +1,7 @@
1
+ import { t as icons } from "./icons-H53IqH1s.js";
1
2
  import { t as localeOptions } from "./locale-CM4o8cD_.js";
2
3
  import { createVuetify } from "vuetify";
4
+ import { mdi } from "vuetify/iconsets/mdi-svg";
3
5
  import * as components from "vuetify/components";
4
6
  import * as directives from "vuetify/directives";
5
7
  //#region \0rolldown/runtime.js
@@ -12,6 +14,11 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
12
14
  const vuetify = createVuetify({
13
15
  components,
14
16
  directives,
17
+ icons: {
18
+ defaultSet: "mdi",
19
+ aliases: icons,
20
+ sets: { mdi }
21
+ },
15
22
  locale: localeOptions
16
23
  });
17
24
  /**
@@ -1,12 +1,17 @@
1
- import { computed, ref, toValue } from "vue";
2
- const colorToVuetifyColor = {
3
- primary: "primary",
4
- secondary: "secondary",
1
+ import { t as icons } from "./icons-H53IqH1s.js";
2
+ import { ref } from "vue";
3
+ //#region src/composables/colors/constants.ts
4
+ const feedbackColorToVuetifyColor = {
5
5
  positive: "success",
6
6
  informative: "info",
7
7
  caution: "warning",
8
8
  danger: "error"
9
9
  };
10
+ const colorToVuetifyColor = {
11
+ primary: "primary",
12
+ secondary: "secondary",
13
+ ...feedbackColorToVuetifyColor
14
+ };
10
15
  /**
11
16
  * The theme colors to use when a color is the text color, on the surface or background, instead
12
17
  * of a fill. The fills are too light to reach WCAG AA's contrast as text, so each one has a darker
@@ -21,14 +26,6 @@ const colorToVuetifyTextColor = {
21
26
  danger: "error-text"
22
27
  };
23
28
  //#endregion
24
- //#region src/composables/colors/use-vuetify-color.ts
25
- function useVuetifyColor(color) {
26
- return computed(() => {
27
- const colorValue = toValue(color);
28
- return colorValue ? colorToVuetifyColor[colorValue] : colorToVuetifyColor.primary;
29
- });
30
- }
31
- //#endregion
32
29
  //#region src/composables/dialogs/use-toast.ts
33
30
  const messages = ref([]);
34
31
  /**
@@ -54,12 +51,12 @@ function useToast() {
54
51
  */
55
52
  function toast(options) {
56
53
  const text = options.message;
57
- const color = useVuetifyColor(options.color ?? "informative");
54
+ const color = feedbackColorToVuetifyColor[options.color ?? "informative"];
58
55
  const toastMessage = {
59
56
  text,
60
- color: color.value,
61
- prependIcon: `$${color.value}`,
62
- timerColor: `rgb(var(--v-theme-on-${color.value}))`
57
+ color,
58
+ prependIcon: icons[color],
59
+ timerColor: `rgb(var(--v-theme-on-${color}))`
63
60
  };
64
61
  messages.value.push(toastMessage);
65
62
  }
@@ -135,4 +132,4 @@ function dialog(options) {
135
132
  }, (value) => value);
136
133
  }
137
134
  //#endregion
138
- export { messages as a, colorToVuetifyColor as c, useDialog as i, colorToVuetifyTextColor as l, owners as n, useToast as o, requests as r, useVuetifyColor as s, openDialog as t };
135
+ export { messages as a, colorToVuetifyTextColor as c, useDialog as i, owners as n, useToast as o, requests as r, colorToVuetifyColor as s, openDialog as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexdom/uimed-vue",
3
- "version": "2.0.0-beta.50",
3
+ "version": "2.0.0-beta.51",
4
4
  "description": "A ui framework for NEXDOM applications.",
5
5
  "keywords": [
6
6
  "lib",
@@ -55,7 +55,7 @@
55
55
  "@axe-core/playwright": "^4.13.0",
56
56
  "@commitlint/cli": "^21.2.1",
57
57
  "@commitlint/config-conventional": "^21.2.0",
58
- "@mdi/font": "^7.4.47",
58
+ "@mdi/js": "^7.4.47",
59
59
  "@nexdom/shared": "^2.3.0",
60
60
  "@playwright/test": "^1.62.1",
61
61
  "@sonar/scan": "^5.0.0",
@@ -87,7 +87,7 @@
87
87
  "vuetify": "^4.2.0"
88
88
  },
89
89
  "peerDependencies": {
90
- "@mdi/font": "^7.4.47",
90
+ "@mdi/js": "^7.4.47",
91
91
  "@nexdom/shared": "^2.3.0",
92
92
  "resize-observer-polyfill": "^1.5.1",
93
93
  "sass-embedded": "^1.103.1",