@nexdom/uimed-vue 1.0.0-beta.1 → 1.0.0-beta.3

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.
@@ -2,8 +2,74 @@
2
2
  /**
3
3
  * Root component to be placed at the top of the component tree.
4
4
  */
5
+ declare const _default$1: typeof __VLS_export$1;
6
+ declare const __VLS_export$1: __VLS_WithSlots$1<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<{}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, true, {}, any>, {
7
+ default?: (props: {}) => any;
8
+ }>;
9
+ type __VLS_WithSlots$1<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
14
+ //#endregion
15
+ //#region src/components/btn/types.d.ts
16
+ /**
17
+ * Style variation for the {@link Btn} component.
18
+ * {@link btnVariantToVuetifyVariant} for the mapping applied when rendering.
19
+ */
20
+ type BtnVariant = "primary" | "secondary" | "ghost";
21
+ /**
22
+ * Color palette for the {@link Btn} component.
23
+ * {@link btnColorToVuetifyColor} for the mapping applied when rendering.
24
+ */
25
+ type BtnColor = "primary" | "secondary" | "positive" | "informative" | "caution" | "danger";
26
+ /**
27
+ * Props exposed by the {@link Btn} component.
28
+ */
29
+ type BtnProps = {
30
+ /**
31
+ * Applies a distinct style variation to the button.
32
+ * One of `primary`, `secondary`, or `ghost`.
33
+ * @default "primary"
34
+ */
35
+ variant?: BtnVariant;
36
+ /**
37
+ * Applies a color to the button.
38
+ * One of `primary`, `secondary`, `positive`, `informative`, `caution`, or `danger`.
39
+ * @default "primary"
40
+ */
41
+ color?: BtnColor;
42
+ /**
43
+ * Removes the ability to click or target the button.
44
+ * @default false
45
+ */
46
+ disabled?: boolean;
47
+ /**
48
+ * Displays a loading indicator on the button, disabling interaction.
49
+ * @default false
50
+ */
51
+ loading?: boolean;
52
+ };
53
+ //#endregion
54
+ //#region src/components/btn/btn.vue.d.ts
55
+ /**
56
+ * Button component to be used throughout the application.
57
+ *
58
+ * @example
59
+ * ```vue
60
+ * <btn variant="primary" color="danger" @click="onClick">
61
+ * Confirmar
62
+ * </btn>
63
+ * ```
64
+ *
65
+ * @see {@link https://nexdom-healthtech.github.io/uimed-vue/guide/components/btn | Guia do Btn}
66
+ */
5
67
  declare const _default: typeof __VLS_export;
6
- declare const __VLS_export: __VLS_WithSlots<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<{}, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, true, {}, any>, {
68
+ declare const __VLS_export: __VLS_WithSlots<import("vue", { with: { "resolution-mode": "import" } }).DefineComponent<BtnProps, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {
69
+ click: () => any;
70
+ }, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<BtnProps> & Readonly<{
71
+ onClick?: (() => any) | undefined;
72
+ }>, {}, {}, {}, {}, string, import("vue", { with: { "resolution-mode": "import" } }).ComponentProvideOptions, false, {}, any>, {
7
73
  default?: (props: {}) => any;
8
74
  }>;
9
75
  type __VLS_WithSlots<T, S> = T & {
@@ -12,4 +78,4 @@ type __VLS_WithSlots<T, S> = T & {
12
78
  };
13
79
  };
14
80
  //#endregion
15
- export { _default as Root };
81
+ export { _default as Btn, _default$1 as Root };
@@ -1,5 +1,5 @@
1
- import { createBlock, defineComponent, openBlock, renderSlot, unref, withCtx } from "vue";
2
- import { VApp } from "vuetify/components";
1
+ import { computed, createBlock, defineComponent, openBlock, renderSlot, unref, withCtx } from "vue";
2
+ import { VApp, VBtn } from "vuetify/components";
3
3
  //#endregion
4
4
  //#region src/components/root.vue
5
5
  var root_default = /* @__PURE__ */ defineComponent({
@@ -15,4 +15,95 @@ var root_default = /* @__PURE__ */ defineComponent({
15
15
  }
16
16
  });
17
17
  //#endregion
18
- export { root_default as Root };
18
+ //#region src/components/btn/consts.ts
19
+ /**
20
+ * Maps {@link BtnVariant} to the underlying Vuetify `VBtn` `variant` value.
21
+ * Each value is checked against Vuetify's prop type, so a variant renamed or
22
+ * removed by Vuetify fails to type-check here.
23
+ */
24
+ const btnVariantToVuetifyVariant = {
25
+ primary: "elevated",
26
+ secondary: "flat",
27
+ ghost: "outlined"
28
+ };
29
+ /**
30
+ * Resolves a {@link BtnVariant} to its Vuetify `VBtn` `variant` value,
31
+ * defaulting to `primary`'s mapping when `variant` is `undefined` or not a
32
+ * key of {@link btnVariantToVuetifyVariant} (e.g. a value that bypassed
33
+ * {@link BtnVariant}'s type check at the call site).
34
+ */
35
+ function resolveBtnVariant(variant) {
36
+ return btnVariantToVuetifyVariant[variant] ?? btnVariantToVuetifyVariant.primary;
37
+ }
38
+ /**
39
+ * Maps {@link BtnColor} to the underlying Vuetify `VBtn` `color` value.
40
+ * Vuetify types `color` as a bare `string` (it accepts any theme color or
41
+ * CSS color), so this only guarantees every {@link BtnColor} has a mapped
42
+ * value, not that the value is itself a valid Vuetify theme color.
43
+ */
44
+ const btnColorToVuetifyColor = {
45
+ primary: "primary",
46
+ secondary: "secondary",
47
+ positive: "success",
48
+ informative: "info",
49
+ caution: "warning",
50
+ danger: "error"
51
+ };
52
+ /**
53
+ * Resolves a {@link BtnColor} to its Vuetify `VBtn` `color` value,
54
+ * defaulting to `primary`'s mapping when `color` is `undefined` or not a key
55
+ * of {@link btnColorToVuetifyColor} (e.g. a value that bypassed
56
+ * {@link BtnColor}'s type check at the call site).
57
+ */
58
+ function resolveBtnColor(color) {
59
+ return btnColorToVuetifyColor[color] ?? btnColorToVuetifyColor.primary;
60
+ }
61
+ //#endregion
62
+ //#region src/components/btn/btn.vue
63
+ var btn_default = /* @__PURE__ */ defineComponent({
64
+ inheritAttrs: false,
65
+ __name: "btn",
66
+ props: {
67
+ variant: {
68
+ type: String,
69
+ required: false
70
+ },
71
+ color: {
72
+ type: String,
73
+ required: false
74
+ },
75
+ disabled: {
76
+ type: Boolean,
77
+ required: false
78
+ },
79
+ loading: {
80
+ type: Boolean,
81
+ required: false
82
+ }
83
+ },
84
+ emits: ["click"],
85
+ setup(__props, { emit: __emit }) {
86
+ const props = __props;
87
+ const vuetifyVariant = computed(() => resolveBtnVariant(props.variant));
88
+ const vuetifyColor = computed(() => resolveBtnColor(props.color));
89
+ return (_ctx, _cache) => {
90
+ return openBlock(), createBlock(unref(VBtn), {
91
+ variant: vuetifyVariant.value,
92
+ color: vuetifyColor.value,
93
+ disabled: props.disabled,
94
+ loading: props.loading,
95
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
96
+ }, {
97
+ default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
98
+ _: 3
99
+ }, 8, [
100
+ "variant",
101
+ "color",
102
+ "disabled",
103
+ "loading"
104
+ ]);
105
+ };
106
+ }
107
+ });
108
+ //#endregion
109
+ export { btn_default as Btn, root_default as Root };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@nexdom/uimed-vue",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.3",
4
4
  "description": "A ui framework for NEXDOM applications.",
5
5
  "keywords": [
6
6
  "lib",
7
7
  "nexdom",
8
8
  "typescript",
9
- "utils"
9
+ "utils",
10
+ "vue"
10
11
  ],
11
12
  "homepage": "https://nexdom-healthtech.github.io/uimed-vue/",
12
13
  "bugs": {
@@ -36,30 +37,36 @@
36
37
  "build": "vp pack",
37
38
  "dev": "vp pack --watch",
38
39
  "test": "vp test",
40
+ "test:mutations": "stryker run",
39
41
  "check": "vp check",
40
42
  "prepublishOnly": "vpr build",
41
43
  "prepare": "vp config",
42
44
  "depcruise": "depcruise src --output-type err-long",
43
45
  "depcruise:graph": "depcruise src --output-type dot| dot -T svg > dependencygraph.svg",
44
46
  "depcruise:graph:no-tests": "depcruise src --exclude \"__tests__\" --output-type dot | dot -T svg > dependencygraph.no-tests.svg",
45
- "docs:dev": "vitepress dev docs --host"
47
+ "docs:dev": "vitepress dev docs --host --port 5173 --strictPort"
46
48
  },
47
49
  "devDependencies": {
48
50
  "@commitlint/cli": "^21.2.1",
49
51
  "@commitlint/config-conventional": "^21.2.0",
50
52
  "@fontsource/roboto": "^5.3.0",
51
53
  "@mdi/font": "^7.4.47",
54
+ "@playwright/test": "^1.62.1",
55
+ "@stryker-mutator/core": "^10.0.0",
56
+ "@stryker-mutator/vitest-runner": "^10.0.0",
52
57
  "@types/node": "^26.1.2",
53
58
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
54
59
  "@vitejs/plugin-vue": "^6.0.8",
55
60
  "@vitest/coverage-v8": "4.1.10",
56
61
  "@vue/test-utils": "^2.4.11",
57
62
  "bumpp": "^12.1.1",
63
+ "conventional-changelog-conventionalcommits": "^9.3.1",
58
64
  "dependency-cruiser": "^18.1.1",
59
65
  "jsdom": "^30.0.1",
60
66
  "oxc-minify": "^0.143.0",
61
67
  "postcss": "^8.5.25",
62
68
  "resize-observer-polyfill": "^1.5.1",
69
+ "type-fest": "^5.8.0",
63
70
  "typescript": "^6.0.3",
64
71
  "vite-plugin-vuetify": "^2.1.3",
65
72
  "vite-plus": "^0.2.7",
@@ -81,5 +88,23 @@
81
88
  "@commitlint/config-conventional"
82
89
  ]
83
90
  },
91
+ "release": {
92
+ "plugins": [
93
+ [
94
+ "@semantic-release/commit-analyzer",
95
+ {
96
+ "preset": "conventionalcommits"
97
+ }
98
+ ],
99
+ [
100
+ "@semantic-release/release-notes-generator",
101
+ {
102
+ "preset": "conventionalcommits"
103
+ }
104
+ ],
105
+ "@semantic-release/npm",
106
+ "@semantic-release/github"
107
+ ]
108
+ },
84
109
  "packageManager": "pnpm@10.32.0"
85
110
  }