@nexxtmove/ui 0.0.20 → 0.0.22

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/dist/index.d.ts CHANGED
@@ -6,6 +6,12 @@ import { PublicProps } from 'vue';
6
6
 
7
7
  declare const __VLS_component: DefineComponent<NexxtButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<NexxtButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
8
8
 
9
+ declare type __VLS_Props = {
10
+ value: number;
11
+ duration?: number;
12
+ easing?: EasingFunction;
13
+ };
14
+
9
15
  declare function __VLS_template(): {
10
16
  attrs: Partial<{}>;
11
17
  slots: {
@@ -23,8 +29,12 @@ declare type __VLS_WithTemplateSlots<T, S> = T & {
23
29
  };
24
30
  };
25
31
 
32
+ declare type EasingFunction = 'ease-linear' | 'ease-in' | 'ease-out' | 'ease-in-out';
33
+
26
34
  declare type IconType = 'regular' | 'solid' | 'light' | 'duotone' | 'brands';
27
35
 
36
+ export declare const NexxtAnimatedNumber: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
37
+
28
38
  export declare const NexxtButton: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
29
39
 
30
40
  declare interface NexxtButtonProps {
@@ -43,4 +53,13 @@ declare interface NexxtIconProps {
43
53
  type?: IconType;
44
54
  }
45
55
 
56
+ export declare const NexxtProgressBar: DefineComponent<NexxtProgressBarProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<NexxtProgressBarProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
57
+
58
+ declare interface NexxtProgressBarProps {
59
+ steps: number;
60
+ currentStep: number;
61
+ progressLabel?: string;
62
+ stepTitles?: string[];
63
+ }
64
+
46
65
  export { }
package/dist/index.js CHANGED
@@ -1,5 +1,54 @@
1
- import { defineComponent as c, createElementBlock as i, openBlock as a, normalizeClass as n, createBlock as d, createCommentVNode as o, createVNode as l, renderSlot as u, Transition as f, withCtx as m } from "vue";
2
- const s = /* @__PURE__ */ c({
1
+ import { defineComponent as f, ref as T, computed as r, watch as B, createBlock as $, openBlock as a, TransitionGroup as N, withCtx as h, createElementBlock as l, Fragment as p, renderList as w, createVNode as v, Transition as k, toDisplayString as g, normalizeClass as o, createCommentVNode as u, renderSlot as S, watchEffect as j, createElementVNode as d, normalizeStyle as P } from "vue";
2
+ const C = /* @__PURE__ */ f({
3
+ __name: "AnimatedNumber",
4
+ props: {
5
+ value: {},
6
+ duration: { default: 500 },
7
+ easing: { default: "ease-out" }
8
+ },
9
+ setup(e) {
10
+ const t = T("up"), s = r(() => String(e.value).split("")), n = r(() => `duration-${e.duration}`);
11
+ return B(
12
+ () => e.value,
13
+ (i, m) => {
14
+ t.value = i > m ? "up" : "down";
15
+ }
16
+ ), (i, m) => (a(), $(N, {
17
+ tag: "div",
18
+ class: "relative flex shrink-0 items-center tabular-nums",
19
+ "aria-label": e.value,
20
+ "enter-active-class": `transition-all ${n.value} ${e.easing}`,
21
+ "leave-active-class": `absolute transition-all ${n.value} ${e.easing}`,
22
+ "enter-from-class": t.value === "up" ? "translate-y-full opacity-0" : "-translate-y-full opacity-0",
23
+ "leave-to-class": t.value === "up" ? "-translate-y-full opacity-0" : "translate-y-full opacity-0",
24
+ "move-class": "transition-all duration-500 ease-in-out"
25
+ }, {
26
+ default: h(() => [
27
+ (a(!0), l(p, null, w(s.value, (y, c) => (a(), l("div", {
28
+ key: c,
29
+ class: "relative inline-flex h-[1.5em] w-[1ch] items-center justify-center overflow-hidden",
30
+ "aria-hidden": "true"
31
+ }, [
32
+ v(k, {
33
+ "enter-active-class": `transition-transform ${n.value} ${e.easing}`,
34
+ "leave-active-class": `absolute inset-0 transition-transform ${n.value} ${e.easing}`,
35
+ "enter-from-class": t.value === "up" ? "translate-y-full" : "-translate-y-full",
36
+ "leave-to-class": t.value === "up" ? "-translate-y-full" : "translate-y-full"
37
+ }, {
38
+ default: h(() => [
39
+ (a(), l("span", {
40
+ key: y,
41
+ class: "flex h-full w-full items-center justify-center"
42
+ }, g(y), 1))
43
+ ]),
44
+ _: 2
45
+ }, 1032, ["enter-active-class", "leave-active-class", "enter-from-class", "leave-to-class"])
46
+ ]))), 128))
47
+ ]),
48
+ _: 1
49
+ }, 8, ["aria-label", "enter-active-class", "leave-active-class", "enter-from-class", "leave-to-class"]));
50
+ }
51
+ }), b = /* @__PURE__ */ f({
3
52
  name: "NexxtIcon",
4
53
  __name: "Icon",
5
54
  props: {
@@ -7,14 +56,14 @@ const s = /* @__PURE__ */ c({
7
56
  type: { default: "light" }
8
57
  },
9
58
  setup(e) {
10
- return (t, r) => (a(), i("i", {
11
- class: n([`fa-${e.type}`, `fa-${e.name}`, "items-center", "justify-center"])
59
+ return (t, s) => (a(), l("i", {
60
+ class: o([`fa-${e.type}`, `fa-${e.name}`, "items-center", "justify-center"])
12
61
  }, null, 2));
13
62
  }
14
- }), y = ["type", "disabled", "data-variant"], v = {
63
+ }), M = ["type", "disabled", "data-variant"], V = {
15
64
  key: 0,
16
- class: /* @__PURE__ */ n(["absolute inset-0 flex items-center justify-center rounded-lg"])
17
- }, h = /* @__PURE__ */ c({
65
+ class: /* @__PURE__ */ o(["absolute inset-0 flex items-center justify-center rounded-lg"])
66
+ }, q = /* @__PURE__ */ f({
18
67
  name: "NexxtButton",
19
68
  __name: "Button",
20
69
  props: {
@@ -26,10 +75,10 @@ const s = /* @__PURE__ */ c({
26
75
  buttonType: { default: "button" }
27
76
  },
28
77
  setup(e) {
29
- return (t, r) => (a(), i("button", {
78
+ return (t, s) => (a(), l("button", {
30
79
  type: e.buttonType,
31
80
  disabled: e.disabled,
32
- class: n([
81
+ class: o([
33
82
  "button relative flex h-10 cursor-pointer items-center justify-center overflow-hidden rounded-lg transition-colors duration-200 focus-visible:outline-3 disabled:cursor-not-allowed",
34
83
  `button-${e.variant}`,
35
84
  t.$slots.default ?? "w-10",
@@ -38,23 +87,23 @@ const s = /* @__PURE__ */ c({
38
87
  ]),
39
88
  "data-variant": e.variant
40
89
  }, [
41
- e.icon ? (a(), d(s, {
90
+ e.icon ? (a(), $(b, {
42
91
  key: 0,
43
92
  name: e.icon,
44
- class: n(["transition-all duration-200", { "order-last": e.iconRight, "opacity-0": e.loading }])
45
- }, null, 8, ["name", "class"])) : o("", !0),
46
- t.$slots.default ? (a(), i("span", {
93
+ class: o(["transition-all duration-200", { "order-last": e.iconRight, "opacity-0": e.loading }])
94
+ }, null, 8, ["name", "class"])) : u("", !0),
95
+ t.$slots.default ? (a(), l("span", {
47
96
  key: 1,
48
- class: n([
97
+ class: o([
49
98
  "inline-block transition-all duration-200",
50
99
  { "opacity-0": e.loading },
51
100
  e.variant === "link" ? "underline underline-offset-1" : "",
52
101
  e.variant === "link" && !e.loading && !e.disabled ? "hover:underline-offset-2" : ""
53
102
  ])
54
103
  }, [
55
- u(t.$slots, "default")
56
- ], 2)) : o("", !0),
57
- l(f, {
104
+ S(t.$slots, "default")
105
+ ], 2)) : u("", !0),
106
+ v(k, {
58
107
  "enter-active-class": "transition-opacity duration-200",
59
108
  "enter-from-class": "opacity-0",
60
109
  "enter-to-class": "opacity-100",
@@ -62,21 +111,77 @@ const s = /* @__PURE__ */ c({
62
111
  "leave-from-class": "opacity-100",
63
112
  "leave-to-class": "opacity-0"
64
113
  }, {
65
- default: m(() => [
66
- e.loading ? (a(), i("div", v, [
67
- l(s, {
114
+ default: h(() => [
115
+ e.loading ? (a(), l("div", V, [
116
+ v(b, {
68
117
  name: "spinner-third",
69
118
  type: "light",
70
119
  class: "fa-spin absolute text-sm"
71
120
  })
72
- ])) : o("", !0)
121
+ ])) : u("", !0)
73
122
  ]),
74
123
  _: 1
75
124
  })
76
- ], 10, y));
125
+ ], 10, M));
126
+ }
127
+ }), E = { class: "@container flex flex-col gap-2" }, I = { class: "flex items-center justify-between gap-2" }, L = ["aria-label", "aria-valuenow", "aria-valuetext"], z = {
128
+ key: 0,
129
+ class: "flex items-center tabular-nums @md:hidden",
130
+ "aria-hidden": "true"
131
+ }, A = {
132
+ key: 0,
133
+ class: "flex justify-between @max-md:order-first @max-md:justify-center",
134
+ "aria-label": "Progress steps"
135
+ }, D = ["aria-current"], F = /* @__PURE__ */ f({
136
+ name: "NexxtProgressBar",
137
+ __name: "ProgressBar",
138
+ props: {
139
+ steps: {},
140
+ currentStep: {},
141
+ progressLabel: { default: "Voortgang" },
142
+ stepTitles: {}
143
+ },
144
+ setup(e) {
145
+ const t = r(() => Math.min(Math.max(0, e.currentStep), Math.max(0, e.steps - 1))), s = r(() => e.steps > 0 ? t.value + 1 : 0), n = r(() => e.steps <= 1 ? e.steps === 1 ? 100 : 0 : t.value / (e.steps - 1) * 100), i = r(() => !!e.stepTitles?.length);
146
+ return j(() => {
147
+ e.stepTitles && e.stepTitles.length !== e.steps && console.warn(
148
+ `[NexxtProgressBar] The "stepTitles" array length (${e.stepTitles.length}) must match the "steps" prop (${e.steps}).`
149
+ );
150
+ }), (m, y) => (a(), l("div", E, [
151
+ d("div", I, [
152
+ d("div", {
153
+ class: "progress-bar progress-bar-bar h-2 w-full overflow-hidden rounded-full",
154
+ role: "progressbar",
155
+ "aria-label": e.progressLabel,
156
+ "aria-valuemin": "0",
157
+ "aria-valuemax": "100",
158
+ "aria-valuenow": Math.round(n.value),
159
+ "aria-valuetext": i.value && e.stepTitles?.[t.value] ? `Step ${s.value} of ${e.steps}: ${e.stepTitles[t.value]}` : `Step ${s.value} of ${e.steps}`
160
+ }, [
161
+ d("div", {
162
+ class: "progress-bar-progress h-full transition-all duration-500 ease-out",
163
+ style: P({ width: `${n.value}%` }),
164
+ "aria-hidden": !0
165
+ }, null, 4)
166
+ ], 8, L),
167
+ i.value ? (a(), l("div", z, [
168
+ v(C, { value: s.value }, null, 8, ["value"]),
169
+ d("span", null, "/" + g(e.steps), 1)
170
+ ])) : u("", !0)
171
+ ]),
172
+ i.value ? (a(), l("ol", A, [
173
+ (a(!0), l(p, null, w(e.stepTitles, (c, x) => (a(), l("li", {
174
+ key: c,
175
+ class: o(["transition-colors duration-500 @max-md:hidden", x === t.value ? "font-medium text-sapphire-500 @max-md:inline" : ""]),
176
+ "aria-current": x === t.value ? "step" : void 0
177
+ }, g(c), 11, D))), 128))
178
+ ])) : u("", !0)
179
+ ]));
77
180
  }
78
181
  });
79
182
  export {
80
- h as NexxtButton,
81
- s as NexxtIcon
183
+ C as NexxtAnimatedNumber,
184
+ q as NexxtButton,
185
+ b as NexxtIcon,
186
+ F as NexxtProgressBar
82
187
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nexxtmove/ui",
3
3
  "type": "module",
4
- "version": "0.0.20",
4
+ "version": "0.0.22",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -23,11 +23,11 @@
23
23
  "devDependencies": {
24
24
  "@awesome.me/kit-37b149f3ef": "^1.0.4",
25
25
  "@eslint/js": "^9.39.2",
26
- "@storybook/addon-a11y": "^10.2.0",
27
- "@storybook/addon-docs": "^10.2.0",
28
- "@storybook/addon-vitest": "^10.2.0",
29
- "@storybook/builder-vite": "^10.2.0",
30
- "@storybook/vue3-vite": "^10.2.0",
26
+ "@storybook/addon-a11y": "^10.2.3",
27
+ "@storybook/addon-docs": "^10.2.3",
28
+ "@storybook/addon-vitest": "^10.2.3",
29
+ "@storybook/builder-vite": "^10.2.3",
30
+ "@storybook/vue3-vite": "^10.2.3",
31
31
  "@tailwindcss/vite": "^4.1.18",
32
32
  "@types/node": "^25.0.3",
33
33
  "@types/react": "^19.2.8",
@@ -49,12 +49,12 @@
49
49
  "react": "^19.2.3",
50
50
  "react-dom": "^19.2.3",
51
51
  "remark-frontmatter": "^5.0.0",
52
- "storybook": "^10.2.0",
52
+ "storybook": "^10.2.3",
53
53
  "typescript-eslint": "^8.52.0",
54
54
  "vite": "^7.3.0",
55
55
  "vite-plugin-dts": "^4.5.4",
56
56
  "vitest": "^4.0.16",
57
- "eslint-plugin-storybook": "10.2.0"
57
+ "eslint-plugin-storybook": "10.2.3"
58
58
  },
59
59
  "engines": {
60
60
  "node": ">=22.18.0"
@@ -67,7 +67,7 @@
67
67
  "generate:index": "node --experimental-strip-types ./scripts/generate-index.ts",
68
68
  "lint": "eslint .",
69
69
  "lint:fix": "eslint . --fix",
70
- "storybook": "storybook dev -p 6006",
70
+ "storybook": "storybook dev -p 6006 --no-open",
71
71
  "storybook:build": "storybook build"
72
72
  }
73
73
  }
@@ -97,6 +97,10 @@
97
97
  }
98
98
  }
99
99
 
100
+ .progress-bar {
101
+ @apply border-progress-bar-border border border-solid;
102
+ }
103
+
100
104
  .progress-bar-bar {
101
105
  @apply bg-progress-bar-bg-bar;
102
106
  }
@@ -105,8 +109,8 @@
105
109
  @apply bg-progress-bar-bg-progress;
106
110
  }
107
111
 
108
- .progress-nav {
109
- @apply gap-(--progress-nav-gap);
112
+ .header {
113
+ @apply border-b-header-border-bottom h-(--header-height) px-(--header-padding-x) py-(--header-padding-y) gap-(--header-gap) border-b border-solid;
110
114
  }
111
115
 
112
116
  }
@@ -149,6 +149,8 @@
149
149
  --color-button-border-danger-focussed: var(--color-brick-100);
150
150
  --color-progress-bar-bg-progress: var(--color-cornflower-blue-500);
151
151
  --color-progress-bar-bg-bar: var(--color-gray-50);
152
+ --color-progress-bar-border: var(--color-gray-200);
153
+ --color-header-border-bottom: var(--color-gray-200);
152
154
  --text-xs: 0.75rem;
153
155
  --text-base: 1rem;
154
156
  --text-lg: 1.125rem;
@@ -212,7 +214,10 @@
212
214
  --button-padding-link-y: var(--spacing-0\.5);
213
215
  --button-gap: var(--spacing-1);
214
216
  --button-border-radius: var(--radius-lg);
215
- --progress-nav-gap: var(--spacing-3\.5);
217
+ --header-height: var(--spacing-24);
218
+ --header-padding-x: var(--spacing-10);
219
+ --header-padding-y: var(--spacing-6);
220
+ --header-gap: var(--spacing-6);
216
221
  --font-sans: 'Poppins', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
217
222
  --font-serif: 'Playfair Display', ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
218
223
  --font-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;