@nexxtmove/ui 1.0.6 → 1.0.8

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
@@ -66,21 +66,27 @@ declare const __VLS_component_16: DefineComponent<NexxtStepperHeaderProps, {}, {
66
66
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
67
67
 
68
68
  declare const __VLS_component_17: DefineComponent<__VLS_PublicProps_9, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
69
- "update:modelValue": (value: string) => any;
69
+ "update:modelValue": (value: boolean) => any;
70
70
  }, string, PublicProps, Readonly<__VLS_PublicProps_9> & Readonly<{
71
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
72
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
73
+
74
+ declare const __VLS_component_18: DefineComponent<__VLS_PublicProps_10, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
75
+ "update:modelValue": (value: string) => any;
76
+ }, string, PublicProps, Readonly<__VLS_PublicProps_10> & Readonly<{
71
77
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
72
78
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
73
79
 
74
- declare const __VLS_component_18: DefineComponent<NexxtToastProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
80
+ declare const __VLS_component_19: DefineComponent<NexxtToastProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
75
81
  dismiss: () => any;
76
82
  }, string, PublicProps, Readonly<NexxtToastProps> & Readonly<{
77
83
  onDismiss?: (() => any) | undefined;
78
84
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
79
85
 
80
- declare const __VLS_component_19: DefineComponent<NexxtTooltip_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<NexxtTooltip_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
81
-
82
86
  declare const __VLS_component_2: DefineComponent<NexxtButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<NexxtButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
83
87
 
88
+ declare const __VLS_component_20: DefineComponent<NexxtTooltip_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<NexxtTooltip_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
89
+
84
90
  declare const __VLS_component_3: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
85
91
 
86
92
  declare const __VLS_component_4: DefineComponent<NexxtChipProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<NexxtChipProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
@@ -404,16 +410,18 @@ declare type __VLS_Props = {
404
410
  delay?: number;
405
411
  };
406
412
 
407
- declare type __VLS_Props_10 = NexxtTabbedContent_2;
413
+ declare type __VLS_Props_10 = NexxtSwitchProps;
414
+
415
+ declare type __VLS_Props_11 = NexxtTabbedContent_2;
408
416
 
409
- declare type __VLS_Props_11 = NexxtTabs_2;
417
+ declare type __VLS_Props_12 = NexxtTabs_2;
410
418
 
411
- declare type __VLS_Props_12 = {
419
+ declare type __VLS_Props_13 = {
412
420
  event: TimelineEvent;
413
421
  splitView?: boolean;
414
422
  };
415
423
 
416
- declare type __VLS_Props_13 = {
424
+ declare type __VLS_Props_14 = {
417
425
  phase: TimelinePhase;
418
426
  /** Index within the filtered phases array (used to determine phase direction/date). */
419
427
  index: number;
@@ -444,9 +452,13 @@ declare type __VLS_PublicProps = {
444
452
  } & __VLS_Props_2;
445
453
 
446
454
  declare type __VLS_PublicProps_10 = {
447
- modelValue?: typeof selected['value'];
455
+ modelValue?: string;
448
456
  } & __VLS_Props_11;
449
457
 
458
+ declare type __VLS_PublicProps_11 = {
459
+ modelValue?: typeof selected['value'];
460
+ } & __VLS_Props_12;
461
+
450
462
  declare type __VLS_PublicProps_2 = {
451
463
  modelValue?: boolean;
452
464
  } & __VLS_Props_3;
@@ -477,7 +489,7 @@ declare type __VLS_PublicProps_8 = {
477
489
  } & __VLS_Props_9;
478
490
 
479
491
  declare type __VLS_PublicProps_9 = {
480
- modelValue?: string;
492
+ modelValue?: boolean;
481
493
  } & __VLS_Props_10;
482
494
 
483
495
  declare function __VLS_template(): {
@@ -521,6 +533,7 @@ declare function __VLS_template_12(): {
521
533
  declare function __VLS_template_13(): {
522
534
  attrs: Partial<{}>;
523
535
  slots: {
536
+ header?(_: {}): any;
524
537
  default?(_: {}): any;
525
538
  footer?(_: {}): any;
526
539
  };
@@ -556,13 +569,23 @@ declare function __VLS_template_16(): {
556
569
  };
557
570
 
558
571
  declare function __VLS_template_17(): {
572
+ attrs: Partial<{}>;
573
+ slots: {
574
+ default?(_: {}): any;
575
+ default?(_: {}): any;
576
+ };
577
+ refs: {};
578
+ rootEl: any;
579
+ };
580
+
581
+ declare function __VLS_template_18(): {
559
582
  attrs: Partial<{}>;
560
583
  slots: Partial<Record<string, (_: {}) => any>>;
561
584
  refs: {};
562
585
  rootEl: HTMLDivElement;
563
586
  };
564
587
 
565
- declare function __VLS_template_18(): {
588
+ declare function __VLS_template_19(): {
566
589
  attrs: Partial<{}>;
567
590
  slots: {
568
591
  default?(_: {}): any;
@@ -571,23 +594,23 @@ declare function __VLS_template_18(): {
571
594
  rootEl: HTMLDivElement;
572
595
  };
573
596
 
574
- declare function __VLS_template_19(): {
597
+ declare function __VLS_template_2(): {
575
598
  attrs: Partial<{}>;
576
599
  slots: {
577
600
  default?(_: {}): any;
578
- tooltip?(_: {}): any;
579
601
  };
580
602
  refs: {};
581
- rootEl: any;
603
+ rootEl: HTMLButtonElement;
582
604
  };
583
605
 
584
- declare function __VLS_template_2(): {
606
+ declare function __VLS_template_20(): {
585
607
  attrs: Partial<{}>;
586
608
  slots: {
587
609
  default?(_: {}): any;
610
+ tooltip?(_: {}): any;
588
611
  };
589
612
  refs: {};
590
- rootEl: HTMLButtonElement;
613
+ rootEl: any;
591
614
  };
592
615
 
593
616
  declare function __VLS_template_3(): {
@@ -917,6 +940,8 @@ declare type __VLS_TemplateResult_19 = ReturnType<typeof __VLS_template_19>;
917
940
 
918
941
  declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
919
942
 
943
+ declare type __VLS_TemplateResult_20 = ReturnType<typeof __VLS_template_20>;
944
+
920
945
  declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
921
946
 
922
947
  declare type __VLS_TemplateResult_4 = ReturnType<typeof __VLS_template_4>;
@@ -1003,6 +1028,12 @@ declare type __VLS_WithTemplateSlots_2<T, S> = T & {
1003
1028
  };
1004
1029
  };
1005
1030
 
1031
+ declare type __VLS_WithTemplateSlots_20<T, S> = T & {
1032
+ new (): {
1033
+ $slots: S;
1034
+ };
1035
+ };
1036
+
1006
1037
  declare type __VLS_WithTemplateSlots_3<T, S> = T & {
1007
1038
  new (): {
1008
1039
  $slots: S;
@@ -1768,7 +1799,16 @@ declare interface NexxtStepperHeaderProps {
1768
1799
  backButtonAction: InstanceType<typeof NexxtHeader>['backButtonAction'];
1769
1800
  }
1770
1801
 
1771
- export declare const NexxtTabbedContent: __VLS_WithTemplateSlots_17<typeof __VLS_component_17, __VLS_TemplateResult_17["slots"]>;
1802
+ export declare const NexxtSwitch: __VLS_WithTemplateSlots_17<typeof __VLS_component_17, __VLS_TemplateResult_17["slots"]>;
1803
+
1804
+ declare interface NexxtSwitchProps {
1805
+ labelPosition?: 'before' | 'after';
1806
+ color?: SwitchColor;
1807
+ iconOn?: IconName;
1808
+ iconOff?: IconName;
1809
+ }
1810
+
1811
+ export declare const NexxtTabbedContent: __VLS_WithTemplateSlots_18<typeof __VLS_component_18, __VLS_TemplateResult_18["slots"]>;
1772
1812
 
1773
1813
  declare interface NexxtTabbedContent_2 {
1774
1814
  tabs: InstanceType<typeof NexxtTabs>['tabs'];
@@ -1814,9 +1854,9 @@ declare interface NexxtTableProps<TKey extends string = string, TRow extends Rec
1814
1854
  loading?: boolean;
1815
1855
  }
1816
1856
 
1817
- export declare const NexxtTabs: DefineComponent<__VLS_PublicProps_10, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1857
+ export declare const NexxtTabs: DefineComponent<__VLS_PublicProps_11, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1818
1858
  "update:modelValue": (value: string) => any;
1819
- }, string, PublicProps, Readonly<__VLS_PublicProps_10> & Readonly<{
1859
+ }, string, PublicProps, Readonly<__VLS_PublicProps_11> & Readonly<{
1820
1860
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
1821
1861
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
1822
1862
  containerRef: HTMLDivElement;
@@ -1827,13 +1867,13 @@ declare interface NexxtTabs_2 {
1827
1867
  tablistLabel?: string;
1828
1868
  }
1829
1869
 
1830
- export declare const NexxtTimelineEvent: DefineComponent<__VLS_Props_12, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_12> & Readonly<{}>, {
1870
+ export declare const NexxtTimelineEvent: DefineComponent<__VLS_Props_13, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_13> & Readonly<{}>, {
1831
1871
  splitView: boolean;
1832
1872
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
1833
1873
 
1834
- export declare const NexxtTimelinePhaseblock: DefineComponent<__VLS_Props_13, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_13> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
1874
+ export declare const NexxtTimelinePhaseblock: DefineComponent<__VLS_Props_14, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_14> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
1835
1875
 
1836
- export declare const NexxtToast: __VLS_WithTemplateSlots_18<typeof __VLS_component_18, __VLS_TemplateResult_18["slots"]>;
1876
+ export declare const NexxtToast: __VLS_WithTemplateSlots_19<typeof __VLS_component_19, __VLS_TemplateResult_19["slots"]>;
1837
1877
 
1838
1878
  export declare const NexxtToaster: DefineComponent<NexxtToasterProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1839
1879
  dismiss: (id: string) => any;
@@ -1854,7 +1894,7 @@ declare interface NexxtToastProps {
1854
1894
  autoClose?: number;
1855
1895
  }
1856
1896
 
1857
- export declare const NexxtTooltip: __VLS_WithTemplateSlots_19<typeof __VLS_component_19, __VLS_TemplateResult_19["slots"]>;
1897
+ export declare const NexxtTooltip: __VLS_WithTemplateSlots_20<typeof __VLS_component_20, __VLS_TemplateResult_20["slots"]>;
1858
1898
 
1859
1899
  declare interface NexxtTooltip_2 {
1860
1900
  delay?: number;
@@ -1910,6 +1950,8 @@ export declare const SOURCE_MAP: {
1910
1950
  readonly dossier_data: "Dossier Data";
1911
1951
  };
1912
1952
 
1953
+ declare type SwitchColor = 'blue' | 'green';
1954
+
1913
1955
  declare interface TableColumn<K extends string = string> {
1914
1956
  key: K;
1915
1957
  label: string;
package/dist/index.js CHANGED
@@ -6359,19 +6359,23 @@ var ls = /* @__PURE__ */ g({
6359
6359
  onEscapeKeyDown: s[2] ||= (t) => !e.dismissible && t.preventDefault()
6360
6360
  }, {
6361
6361
  default: F(() => [
6362
- e.title || n.value ? (D(), u("div", Ws, [d("div", null, [e.title ? (D(), c(N(pe), {
6363
- key: 0,
6364
- class: "heading-2"
6365
- }, {
6366
- default: F(() => [m(M(e.title), 1)]),
6367
- _: 1
6368
- })) : l("", !0), n.value ? (D(), c(N(le), {
6369
- key: 1,
6370
- class: "small-normal"
6371
- }, {
6372
- default: F(() => [m(M(n.value), 1)]),
6373
- _: 1
6374
- })) : l("", !0)]), e.showClose ? (D(), c(N(se), {
6362
+ e.title || n.value || o.$slots.header ? (D(), u("div", Ws, [d("div", null, [
6363
+ e.title ? (D(), c(N(pe), {
6364
+ key: 0,
6365
+ class: "heading-2"
6366
+ }, {
6367
+ default: F(() => [m(M(e.title), 1)]),
6368
+ _: 1
6369
+ })) : l("", !0),
6370
+ n.value ? (D(), c(N(le), {
6371
+ key: 1,
6372
+ class: "small-normal"
6373
+ }, {
6374
+ default: F(() => [m(M(n.value), 1)]),
6375
+ _: 1
6376
+ })) : l("", !0),
6377
+ A(o.$slots, "header")
6378
+ ]), e.showClose ? (D(), c(N(se), {
6375
6379
  key: 0,
6376
6380
  class: "ml-4 shrink-0 cursor-pointer rounded p-1 focus-visible:outline-2"
6377
6381
  }, {
@@ -7169,12 +7173,50 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7169
7173
  "back-button-text"
7170
7174
  ]));
7171
7175
  }
7172
- }), kl = ["aria-label"], Al = [
7176
+ }), kl = { class: "inline-flex cursor-pointer items-center gap-2" }, Al = { class: "relative inline-block h-8 w-15" }, jl = /* @__PURE__ */ g({
7177
+ name: "NexxtSwitch",
7178
+ inheritAttrs: !1,
7179
+ __name: "Switch",
7180
+ props: /* @__PURE__ */ b({
7181
+ labelPosition: { default: "after" },
7182
+ color: { default: "blue" },
7183
+ iconOn: {},
7184
+ iconOff: {}
7185
+ }, {
7186
+ modelValue: { type: Boolean },
7187
+ modelModifiers: {}
7188
+ }),
7189
+ emits: ["update:modelValue"],
7190
+ setup(e) {
7191
+ let t = P(e, "modelValue"), n = {
7192
+ blue: "border-cornflower-blue-500 bg-cornflower-blue-500",
7193
+ green: "border-green-400 bg-green-400"
7194
+ };
7195
+ return (r, i) => (D(), u("label", kl, [
7196
+ e.labelPosition === "before" ? A(r.$slots, "default", { key: 0 }) : l("", !0),
7197
+ d("span", Al, [oe(d("input", x(r.$attrs, {
7198
+ type: "checkbox",
7199
+ class: "peer sr-only",
7200
+ "onUpdate:modelValue": i[0] ||= (e) => t.value = e
7201
+ }), null, 16), [[ne, t.value]]), d("span", { class: C(["absolute inset-0 overflow-hidden rounded-[30px] border transition-colors duration-200", t.value ? n[e.color] : "border-gray-500 bg-gray-200"]) }, [d("span", { class: C(["absolute top-0.75 left-0.75 h-6 w-6 rounded-full bg-white transition-transform duration-400", t.value && "translate-x-7"]) }, null, 2), d("span", { class: C(["absolute top-0.75 left-0.75 flex h-6 w-6 items-center justify-center rounded-full bg-white transition-transform duration-300", t.value && "translate-x-7"]) }, [t.value && e.iconOn ? (D(), c(z, {
7202
+ key: 0,
7203
+ name: e.iconOn,
7204
+ type: "solid",
7205
+ class: "text-xs text-gray-600"
7206
+ }, null, 8, ["name"])) : !t.value && e.iconOff ? (D(), c(z, {
7207
+ key: 1,
7208
+ name: e.iconOff,
7209
+ class: "text-xs text-gray-600"
7210
+ }, null, 8, ["name"])) : l("", !0)], 2)], 2)]),
7211
+ e.labelPosition === "after" ? A(r.$slots, "default", { key: 1 }) : l("", !0)
7212
+ ]));
7213
+ }
7214
+ }), Ml = ["aria-label"], Nl = [
7173
7215
  "aria-selected",
7174
7216
  "tabindex",
7175
7217
  "onClick",
7176
7218
  "onKeydown"
7177
- ], jl = /* @__PURE__ */ g({
7219
+ ], Pl = /* @__PURE__ */ g({
7178
7220
  name: "NexxtTabs",
7179
7221
  __name: "Tabs",
7180
7222
  props: /* @__PURE__ */ b({
@@ -7234,7 +7276,7 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7234
7276
  class: C(["relative h-9 cursor-pointer rounded-full px-4 text-sm text-gray-950 transition-none", n.value === e ? "z-10" : "z-30"]),
7235
7277
  onClick: (t) => n.value = e,
7236
7278
  onKeydown: (e) => f(e, t)
7237
- }, M(e), 43, Al))), 128)),
7279
+ }, M(e), 43, Nl))), 128)),
7238
7280
  d("div", {
7239
7281
  "aria-hidden": "true",
7240
7282
  class: C(["pointer-events-none absolute inset-0 z-20 flex", c.value ? "transition-[clip-path] duration-500 ease-[cubic-bezier(0.34,1.2,0.64,1)]" : ""]),
@@ -7243,9 +7285,9 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7243
7285
  key: e,
7244
7286
  class: "flex h-9 items-center rounded-full px-4 text-sm text-white"
7245
7287
  }, M(e), 1))), 128))], 6)
7246
- ], 8, kl));
7288
+ ], 8, Ml));
7247
7289
  }
7248
- }), Ml = { class: "flex flex-col items-center" }, Nl = { class: "relative w-full overflow-hidden" }, Pl = ["aria-labelledby"], Fl = /* @__PURE__ */ g({
7290
+ }), Fl = { class: "flex flex-col items-center" }, Il = { class: "relative w-full overflow-hidden" }, Ll = ["aria-labelledby"], Rl = /* @__PURE__ */ g({
7249
7291
  name: "NexxtTabbedContent",
7250
7292
  __name: "TabbedContent",
7251
7293
  props: /* @__PURE__ */ b({
@@ -7270,7 +7312,7 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7270
7312
  enterFromClass: r.value === "forward" ? "-translate-x-10 opacity-0" : "translate-x-10 opacity-0",
7271
7313
  leaveToClass: r.value === "forward" ? "translate-x-10 opacity-0" : "-translate-x-10 opacity-0"
7272
7314
  } : { mode: "out-in" });
7273
- return (t, r) => (D(), u("div", Ml, [h(jl, {
7315
+ return (t, r) => (D(), u("div", Fl, [h(Pl, {
7274
7316
  tabs: e.tabs,
7275
7317
  modelValue: n.value,
7276
7318
  "onUpdate:modelValue": r[0] ||= (e) => n.value = e,
@@ -7280,49 +7322,49 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7280
7322
  "tabs",
7281
7323
  "modelValue",
7282
7324
  "tablist-label"
7283
- ]), d("div", Nl, [h(a, w(v(c.value)), {
7325
+ ]), d("div", Il, [h(a, w(v(c.value)), {
7284
7326
  default: F(() => [(D(), u("div", {
7285
7327
  key: n.value,
7286
7328
  role: "tabpanel",
7287
7329
  "aria-labelledby": o(n.value),
7288
7330
  class: "w-full"
7289
- }, [A(t.$slots, i(n.value))], 8, Pl))]),
7331
+ }, [A(t.$slots, i(n.value))], 8, Ll))]),
7290
7332
  _: 3
7291
7333
  }, 16)])]));
7292
7334
  }
7293
- }), Il = { class: "flex flex-col gap-3" }, Ll = ["aria-colcount", "aria-rowcount"], Rl = { class: "sticky top-0 z-10 mb-0.5" }, zl = { key: 0 }, Bl = {
7335
+ }), zl = { class: "flex flex-col gap-3" }, Bl = ["aria-colcount", "aria-rowcount"], Vl = { class: "sticky top-0 z-10 mb-0.5" }, Hl = { key: 0 }, Ul = {
7294
7336
  key: 0,
7295
7337
  class: "flex items-center justify-center px-2 py-3",
7296
7338
  role: "columnheader",
7297
7339
  "aria-colindex": "1"
7298
- }, Vl = [
7340
+ }, Wl = [
7299
7341
  "aria-colindex",
7300
7342
  "aria-sort",
7301
7343
  "tabindex",
7302
7344
  "onClick",
7303
7345
  "onKeydown"
7304
- ], Hl = {
7346
+ ], Gl = {
7305
7347
  role: "rowgroup",
7306
7348
  class: "relative"
7307
- }, Ul = [
7349
+ }, Kl = [
7308
7350
  "aria-rowindex",
7309
7351
  "aria-selected",
7310
7352
  "onClick",
7311
7353
  "onKeydown"
7312
- ], Wl = {
7354
+ ], ql = {
7313
7355
  key: 0,
7314
7356
  class: "flex items-center justify-center px-2 py-4",
7315
7357
  role: "gridcell",
7316
7358
  "aria-colindex": 1
7317
- }, Gl = ["aria-colindex"], Kl = {
7359
+ }, Jl = ["aria-colindex"], Yl = {
7318
7360
  key: 0,
7319
7361
  class: "px-4 py-8 text-center text-sm text-slate-400",
7320
7362
  role: "row"
7321
- }, ql = {
7363
+ }, Xl = {
7322
7364
  key: 0,
7323
7365
  "data-testid": "loading-overlay",
7324
7366
  class: "absolute inset-0 flex items-center justify-center rounded-md bg-white/40 backdrop-blur-sm"
7325
- }, Jl = /* @__PURE__ */ g({
7367
+ }, Zl = /* @__PURE__ */ g({
7326
7368
  name: "NexxtTable",
7327
7369
  __name: "Table",
7328
7370
  props: /* @__PURE__ */ b({
@@ -7372,17 +7414,17 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7372
7414
  }, te = (e, t) => e[t], ne = (e) => `cell-${e}`, re = (e, t) => {
7373
7415
  e.key === "ArrowDown" ? (e.preventDefault(), _.value[Math.min(t + 1, i.rows.length - 1)]?.focus()) : e.key === "ArrowUp" && (e.preventDefault(), _.value[Math.max(t - 1, 0)]?.focus());
7374
7416
  };
7375
- return (t, n) => (D(), u("div", Il, [d("div", {
7417
+ return (t, n) => (D(), u("div", zl, [d("div", {
7376
7418
  role: "grid",
7377
7419
  "aria-colcount": e.columns.length + +!!e.selectable,
7378
7420
  "aria-rowcount": e.rows.length + 1,
7379
7421
  class: "min-w-full"
7380
- }, [d("div", Rl, [t.$slots.toolbar ? (D(), u("div", zl, [A(t.$slots, "toolbar")])) : l("", !0), d("div", {
7422
+ }, [d("div", Vl, [t.$slots.toolbar ? (D(), u("div", Hl, [A(t.$slots, "toolbar")])) : l("", !0), d("div", {
7381
7423
  class: "grid rounded-md bg-gray-50",
7382
7424
  style: T({ gridTemplateColumns: E.value }),
7383
7425
  role: "row",
7384
7426
  "aria-rowindex": "1"
7385
- }, [e.selectable ? (D(), u("div", Bl, [e.selectionMode === "multiple" ? (D(), c(Si, {
7427
+ }, [e.selectable ? (D(), u("div", Ul, [e.selectionMode === "multiple" ? (D(), c(Si, {
7386
7428
  key: 0,
7387
7429
  "model-value": v.value,
7388
7430
  indeterminate: y.value,
@@ -7401,7 +7443,7 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7401
7443
  key: 0,
7402
7444
  name: p.value === t.key ? g.value === "asc" ? "angle-down" : "angle-up" : "angles-up-down",
7403
7445
  class: C(["shrink-0 text-xs", p.value === t.key ? "text-cornflower-blue-600" : "text-slate-400"])
7404
- }, null, 8, ["name", "class"])) : l("", !0)], 42, Vl))), 128))], 4)]), d("div", Hl, [
7446
+ }, null, 8, ["name", "class"])) : l("", !0)], 42, Wl))), 128))], 4)]), d("div", Gl, [
7405
7447
  (D(!0), u(r, null, k(e.rows, (n, i) => (D(), u("div", {
7406
7448
  key: i,
7407
7449
  ref_for: !0,
@@ -7420,7 +7462,7 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7420
7462
  tabindex: "0",
7421
7463
  onClick: (e) => j(e, i),
7422
7464
  onKeydown: (e) => re(e, i)
7423
- }, [e.selectable ? (D(), u("div", Wl, [h(Si, {
7465
+ }, [e.selectable ? (D(), u("div", ql, [h(Si, {
7424
7466
  "model-value": b(n),
7425
7467
  "aria-label": `Select row ${i + 1}`,
7426
7468
  "onUpdate:modelValue": (e) => S(n)
@@ -7436,30 +7478,30 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7436
7478
  }, [A(t.$slots, ne(r.key), {
7437
7479
  row: n,
7438
7480
  value: te(n, r.key)
7439
- }, () => [m(M(te(n, r.key)), 1)])], 8, Gl))), 128))], 46, Ul))), 128)),
7440
- e.rows.length ? l("", !0) : (D(), u("div", Kl, [A(t.$slots, "empty", {}, () => [n[0] ||= m("Geen data beschikbaar", -1)])])),
7481
+ }, () => [m(M(te(n, r.key)), 1)])], 8, Jl))), 128))], 46, Kl))), 128)),
7482
+ e.rows.length ? l("", !0) : (D(), u("div", Yl, [A(t.$slots, "empty", {}, () => [n[0] ||= m("Geen data beschikbaar", -1)])])),
7441
7483
  h(a, {
7442
7484
  "enter-active-class": "transition-opacity duration-200",
7443
7485
  "leave-active-class": "transition-opacity duration-200",
7444
7486
  "enter-from-class": "opacity-0",
7445
7487
  "leave-to-class": "opacity-0"
7446
7488
  }, {
7447
- default: F(() => [e.loading ? (D(), u("div", ql, [A(t.$slots, "loading", {}, () => [h(z, {
7489
+ default: F(() => [e.loading ? (D(), u("div", Xl, [A(t.$slots, "loading", {}, () => [h(z, {
7448
7490
  name: "spinner-third",
7449
7491
  class: "fa-spin text-3xl text-purple-500"
7450
7492
  })])])) : l("", !0)]),
7451
7493
  _: 3
7452
7494
  })
7453
- ])], 8, Ll)]));
7495
+ ])], 8, Bl)]));
7454
7496
  }
7455
- }), Yl = [
7497
+ }), Ql = [
7456
7498
  "data-event-source",
7457
7499
  "data-event-date",
7458
7500
  "date-event-type"
7459
- ], Xl = { class: "heading-3" }, Zl = ["href"], Ql = { class: "truncate group-hover:underline" }, $l = {
7501
+ ], $l = { class: "heading-3" }, eu = ["href"], tu = { class: "truncate group-hover:underline" }, nu = {
7460
7502
  key: 1,
7461
7503
  class: "mt-1 text-sm text-gray-500"
7462
- }, eu = /* @__PURE__ */ g({
7504
+ }, ru = /* @__PURE__ */ g({
7463
7505
  name: "NexxtTimelineEvent",
7464
7506
  __name: "TimelineEvent",
7465
7507
  props: {
@@ -7497,20 +7539,20 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7497
7539
  name: n.value.icon,
7498
7540
  class: "flex h-6 w-6 text-xl text-white"
7499
7541
  }, null, 8, ["name"])], 2), d("div", { class: C(["flex w-full flex-col gap-2 rounded-xl border border-gray-200 p-8", { "max-w-lg": e.splitView }]) }, [
7500
- d("span", Xl, M(n.value.label), 1),
7542
+ d("span", $l, M(n.value.label), 1),
7501
7543
  e.event.url ? (D(), u("a", {
7502
7544
  key: 0,
7503
7545
  href: e.event.url,
7504
7546
  target: "_blank",
7505
7547
  class: "group mt-1 flex justify-between gap-2 text-sm text-cornflower-blue-500 hover:text-cornflower-blue-600"
7506
- }, [d("span", Ql, M(e.event.description || e.event.url), 1), h(z, {
7548
+ }, [d("span", tu, M(e.event.description || e.event.url), 1), h(z, {
7507
7549
  name: "external-link",
7508
7550
  class: "ml-1 h-4 w-4 text-gray-950"
7509
- })], 8, Zl)) : l("", !0),
7510
- e.event.request_reason ? (D(), u("span", $l, " Reden: " + M(e.event.request_reason), 1)) : l("", !0)
7511
- ], 2)], 2)], 10, Yl));
7551
+ })], 8, eu)) : l("", !0),
7552
+ e.event.request_reason ? (D(), u("span", nu, " Reden: " + M(e.event.request_reason), 1)) : l("", !0)
7553
+ ], 2)], 2)], 10, Ql));
7512
7554
  }
7513
- }), tu = /* @__PURE__ */ g({
7555
+ }), iu = /* @__PURE__ */ g({
7514
7556
  name: "NexxtTooltip",
7515
7557
  __name: "Tooltip",
7516
7558
  props: {
@@ -7553,13 +7595,13 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7553
7595
  _: 3
7554
7596
  }));
7555
7597
  }
7556
- }), nu = ["data-phase"], ru = {
7598
+ }), au = ["data-phase"], ou = {
7557
7599
  key: 0,
7558
7600
  class: "relative z-10"
7559
- }, iu = { class: "flex items-center justify-between px-4 py-2" }, au = { class: "flex gap-1" }, ou = { class: "flex gap-1" }, su = { class: "text-sm font-semibold tracking-wider uppercase" }, cu = { class: "mt-2 font-medium text-xs text-gray-500" }, lu = {
7601
+ }, su = { class: "flex items-center justify-between px-4 py-2" }, cu = { class: "flex gap-1" }, lu = { class: "flex gap-1" }, uu = { class: "text-sm font-semibold tracking-wider uppercase" }, du = { class: "mt-2 font-medium text-xs text-gray-500" }, fu = {
7560
7602
  key: 1,
7561
7603
  class: "h-1"
7562
- }, uu = /* @__PURE__ */ g({
7604
+ }, pu = /* @__PURE__ */ g({
7563
7605
  name: "NexxtTimelinePhaseblock",
7564
7606
  __name: "TimelinePhaseblock",
7565
7607
  props: {
@@ -7595,14 +7637,14 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7595
7637
  class: "relative z-10 flex flex-col gap-16",
7596
7638
  "data-phase": e.phase.phase.value
7597
7639
  }, [
7598
- e.index === 0 && e.isSplitView ? (D(), u("div", ru, [d("div", iu, [d("span", au, [i[1] ||= m(" Outbound ", -1), h(tu, null, {
7640
+ e.index === 0 && e.isSplitView ? (D(), u("div", ou, [d("div", su, [d("span", cu, [i[1] ||= m(" Outbound ", -1), h(iu, null, {
7599
7641
  tooltip: F(() => [...i[0] ||= [d("span", { class: "text-sm" }, "Vanuit Nexxtmove", -1)]]),
7600
7642
  default: F(() => [h(z, {
7601
7643
  name: "circle-info",
7602
7644
  class: "h-4 w-4 text-xs text-gray-600"
7603
7645
  })]),
7604
7646
  _: 1
7605
- })]), d("span", ou, [i[3] ||= m(" Inbound ", -1), h(tu, { "as-child": "" }, {
7647
+ })]), d("span", lu, [i[3] ||= m(" Inbound ", -1), h(iu, { "as-child": "" }, {
7606
7648
  tooltip: F(() => [...i[2] ||= [d("span", { class: "text-sm" }, "Vanuit relatie", -1)]]),
7607
7649
  default: F(() => [h(z, {
7608
7650
  name: "circle-info",
@@ -7615,7 +7657,7 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7615
7657
  key: 1,
7616
7658
  class: C(["absolute right-5 bottom-0 w-0 border-l", [N(ds)[e.phase.phase.value].color, e.index === 0 ? "top-10" : "top-0"]])
7617
7659
  }, null, 2)) : l("", !0),
7618
- (D(!0), u(r, null, k(e.phase.events, (t) => (D(), c(eu, {
7660
+ (D(!0), u(r, null, k(e.phase.events, (t) => (D(), c(ru, {
7619
7661
  key: t.id,
7620
7662
  event: t,
7621
7663
  "split-view": e.isSplitView
@@ -7624,36 +7666,36 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7624
7666
  key: 2,
7625
7667
  class: C(["relative flex flex-col items-center pt-8 pb-24 text-center", { "pl-16": !e.isSplitView }])
7626
7668
  }, [
7627
- d("div", { class: C(["flex items-center gap-2 rounded-full px-12 py-4", [N(ds)[e.phase.phase.value].bgColor, N(ds)[e.phase.phase.value].textColor]]) }, [d("span", su, M(N(ds)[e.phase.phase.value].label), 1), o() ? (D(), c(z, {
7669
+ d("div", { class: C(["flex items-center gap-2 rounded-full px-12 py-4", [N(ds)[e.phase.phase.value].bgColor, N(ds)[e.phase.phase.value].textColor]]) }, [d("span", uu, M(N(ds)[e.phase.phase.value].label), 1), o() ? (D(), c(z, {
7628
7670
  key: 0,
7629
7671
  name: o() === "up" ? "arrow-up" : "arrow-down",
7630
7672
  class: "h-4 w-4 text-white"
7631
7673
  }, null, 8, ["name"])) : l("", !0)], 2),
7632
- d("span", cu, M(a()), 1),
7674
+ d("span", du, M(a()), 1),
7633
7675
  e.isSplitView ? (D(), u("div", {
7634
7676
  key: 0,
7635
7677
  class: C(["mt-4 h-px w-[75%]", N(ds)[e.phase.phase.value].bgColor])
7636
7678
  }, null, 2)) : l("", !0),
7637
- e.isLast ? l("", !0) : (D(), u("div", lu)),
7679
+ e.isLast ? l("", !0) : (D(), u("div", fu)),
7638
7680
  d("div", { class: C(["absolute top-0 bottom-0 left-5 w-px bg-linear-to-b", n.value]) }, null, 2),
7639
7681
  e.isSplitView ? (D(), u("div", {
7640
7682
  key: 2,
7641
7683
  class: C(["absolute top-0 right-5 bottom-0 w-px bg-linear-to-b", n.value])
7642
7684
  }, null, 2)) : l("", !0)
7643
7685
  ], 2))
7644
- ], 8, nu));
7686
+ ], 8, au));
7645
7687
  }
7646
- }), du = ["role", "aria-live"], fu = { class: "flex min-w-0 flex-1 flex-col gap-0.5 pt-0.5" }, pu = {
7688
+ }), mu = ["role", "aria-live"], hu = { class: "flex min-w-0 flex-1 flex-col gap-0.5 pt-0.5" }, gu = {
7647
7689
  key: 1,
7648
7690
  class: "body-normal"
7649
- }, mu = ["aria-label"], hu = {
7691
+ }, _u = ["aria-label"], vu = {
7650
7692
  key: 0,
7651
7693
  class: "absolute inset-0 -rotate-90 text-gray-400",
7652
7694
  viewBox: "0 0 24 24",
7653
7695
  width: "32",
7654
7696
  height: "32",
7655
7697
  "aria-hidden": "true"
7656
- }, gu = 56.55, _u = /* @__PURE__ */ Wo(/* @__PURE__ */ g({
7698
+ }, yu = 56.55, bu = /* @__PURE__ */ Wo(/* @__PURE__ */ g({
7657
7699
  name: "NexxtToast",
7658
7700
  __name: "Toast",
7659
7701
  props: {
@@ -7668,7 +7710,7 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7668
7710
  },
7669
7711
  emits: ["dismiss"],
7670
7712
  setup(e, { emit: t }) {
7671
- te((e) => ({ v3e3d3e68: gu }));
7713
+ te((e) => ({ v3e3d3e68: yu }));
7672
7714
  let n = {
7673
7715
  info: {
7674
7716
  icon: "info",
@@ -7716,12 +7758,12 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7716
7758
  name: a.value.icon,
7717
7759
  class: "text-xl"
7718
7760
  }, null, 8, ["name"])], 2),
7719
- d("div", fu, [
7761
+ d("div", hu, [
7720
7762
  e.title ? (D(), u("p", {
7721
7763
  key: 0,
7722
7764
  class: C(["heading-4", a.value.titleColor])
7723
7765
  }, M(e.title), 3)) : l("", !0),
7724
- e.message ? (D(), u("p", pu, M(e.message), 1)) : l("", !0),
7766
+ e.message ? (D(), u("p", gu, M(e.message), 1)) : l("", !0),
7725
7767
  A(t.$slots, "default", {}, void 0, !0)
7726
7768
  ]),
7727
7769
  e.dismissible ? (D(), u("button", {
@@ -7730,7 +7772,7 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7730
7772
  class: "relative flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center focus:outline-none",
7731
7773
  "aria-label": e.autoClose ? `Sluiten (verdwijnt automatisch na ${e.autoClose / 1e3} seconden)` : "Sluiten",
7732
7774
  onClick: n[0] ||= (e) => r("dismiss")
7733
- }, [e.autoClose ? (D(), u("svg", hu, [d("circle", {
7775
+ }, [e.autoClose ? (D(), u("svg", vu, [d("circle", {
7734
7776
  cx: "12",
7735
7777
  cy: "12",
7736
7778
  r: "9",
@@ -7738,7 +7780,7 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7738
7780
  stroke: "currentColor",
7739
7781
  "stroke-width": "1.2",
7740
7782
  "stroke-linecap": "round",
7741
- "stroke-dasharray": gu,
7783
+ "stroke-dasharray": yu,
7742
7784
  class: "timer-circle",
7743
7785
  style: T({
7744
7786
  animationDuration: `${e.autoClose}ms`,
@@ -7747,10 +7789,10 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7747
7789
  }, null, 4)])) : l("", !0), h(z, {
7748
7790
  name: "xmark",
7749
7791
  class: "text-sm"
7750
- })], 8, mu)) : l("", !0)
7751
- ], 42, du));
7792
+ })], 8, _u)) : l("", !0)
7793
+ ], 42, mu));
7752
7794
  }
7753
- }), [["__scopeId", "data-v-89269eaa"]]), vu = /* @__PURE__ */ g({
7795
+ }), [["__scopeId", "data-v-89269eaa"]]), xu = /* @__PURE__ */ g({
7754
7796
  name: "NexxtToaster",
7755
7797
  __name: "Toaster",
7756
7798
  props: {
@@ -7783,7 +7825,7 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7783
7825
  default: F(() => [(D(!0), u(r, null, k(e.toasts, (e) => (D(), u("div", {
7784
7826
  key: e.id,
7785
7827
  class: "pointer-events-auto"
7786
- }, [h(_u, x({ ref_for: !0 }, e, { onDismiss: (t) => n("dismiss", e.id) }), null, 16, ["onDismiss"])]))), 128))]),
7828
+ }, [h(bu, x({ ref_for: !0 }, e, { onDismiss: (t) => n("dismiss", e.id) }), null, 16, ["onDismiss"])]))), 128))]),
7787
7829
  _: 1
7788
7830
  }, 8, [
7789
7831
  "class",
@@ -7793,4 +7835,4 @@ var ll = { render: cl }, ul = { class: "flex items-center justify-end self-stret
7793
7835
  }
7794
7836
  });
7795
7837
  //#endregion
7796
- export { xt as NexxtAnimatedNumber, Ct as NexxtAnnouncement, Ot as NexxtAvatar, At as NexxtButton, _i as NexxtCalendar, bi as NexxtCard, Si as NexxtCheckbox, Ci as NexxtChip, Uo as NexxtCombobox, Vo as NexxtComboboxPanel, Xo as NexxtContactInfoCard, ls as NexxtCountrySelect, hs as NexxtCustomerJourneyTile, gs as NexxtDatePicker, ws as NexxtDoughnutChart, Os as NexxtDropdownButton, yo as NexxtFloatingPanel, js as NexxtHeader, z as NexxtIcon, Ns as NexxtInfoBlock, Oo as NexxtInputField, Hs as NexxtInputSelect, Ks as NexxtModal, qs as NexxtPagination, Zs as NexxtPresenceIndicator, oc as NexxtProgressBar, _c as NexxtPropertyCard, fc as NexxtPropertyListing, Ec as NexxtSelect, Mc as NexxtSidebarMenuItem, Pc as NexxtSkeleton, Rc as NexxtSkeletonPropertyCard, Vc as NexxtSocialIcons, Gc as NexxtSocialMediaCustomTemplate, el as NexxtSocialMediaTemplate, ml as NexxtSocialMediaType, Dl as NexxtSource, Dt as NexxtSquircle, Ol as NexxtStepperHeader, Fl as NexxtTabbedContent, Jl as NexxtTable, jl as NexxtTabs, eu as NexxtTimelineEvent, uu as NexxtTimelinePhaseblock, _u as NexxtToast, vu as NexxtToaster, tu as NexxtTooltip, wl as SOURCE_MAP };
7838
+ export { xt as NexxtAnimatedNumber, Ct as NexxtAnnouncement, Ot as NexxtAvatar, At as NexxtButton, _i as NexxtCalendar, bi as NexxtCard, Si as NexxtCheckbox, Ci as NexxtChip, Uo as NexxtCombobox, Vo as NexxtComboboxPanel, Xo as NexxtContactInfoCard, ls as NexxtCountrySelect, hs as NexxtCustomerJourneyTile, gs as NexxtDatePicker, ws as NexxtDoughnutChart, Os as NexxtDropdownButton, yo as NexxtFloatingPanel, js as NexxtHeader, z as NexxtIcon, Ns as NexxtInfoBlock, Oo as NexxtInputField, Hs as NexxtInputSelect, Ks as NexxtModal, qs as NexxtPagination, Zs as NexxtPresenceIndicator, oc as NexxtProgressBar, _c as NexxtPropertyCard, fc as NexxtPropertyListing, Ec as NexxtSelect, Mc as NexxtSidebarMenuItem, Pc as NexxtSkeleton, Rc as NexxtSkeletonPropertyCard, Vc as NexxtSocialIcons, Gc as NexxtSocialMediaCustomTemplate, el as NexxtSocialMediaTemplate, ml as NexxtSocialMediaType, Dl as NexxtSource, Dt as NexxtSquircle, Ol as NexxtStepperHeader, jl as NexxtSwitch, Rl as NexxtTabbedContent, Zl as NexxtTable, Pl as NexxtTabs, ru as NexxtTimelineEvent, pu as NexxtTimelinePhaseblock, bu as NexxtToast, xu as NexxtToaster, iu as NexxtTooltip, wl as SOURCE_MAP };
package/dist/nuxt.js CHANGED
@@ -42976,6 +42976,7 @@ var Vw, Hw, Uw, Ww, Gw, Kw = t((() => {
42976
42976
  NexxtSource: "components/Source/Source.vue",
42977
42977
  NexxtSquircle: "components/Squircle/Squircle.vue",
42978
42978
  NexxtStepperHeader: "components/StepperHeader/StepperHeader.vue",
42979
+ NexxtSwitch: "components/Switch/Switch.vue",
42979
42980
  NexxtTabbedContent: "components/TabbedContent/TabbedContent.vue",
42980
42981
  NexxtTable: "components/Table/Table.vue",
42981
42982
  NexxtTabs: "components/Tabs/Tabs.vue",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nexxtmove/ui",
3
3
  "type": "module",
4
- "version": "1.0.6",
4
+ "version": "1.0.8",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -85,7 +85,7 @@ const sizeClass = {
85
85
  @escape-key-down="!dismissible && $event.preventDefault()"
86
86
  >
87
87
  <div
88
- v-if="title || description"
88
+ v-if="title || description || $slots.header"
89
89
  class="flex items-start justify-between border-b border-gray-200 px-6 py-5"
90
90
  >
91
91
  <div>
@@ -93,6 +93,7 @@ const sizeClass = {
93
93
  <DialogDescription v-if="description" class="small-normal">
94
94
  {{ description }}
95
95
  </DialogDescription>
96
+ <slot name="header" />
96
97
  </div>
97
98
  <DialogClose
98
99
  v-if="showClose"
@@ -0,0 +1,59 @@
1
+ <script lang="ts" setup>
2
+ import type { IconName } from '@awesome.me/kit-37b149f3ef/icons'
3
+ import Icon from '../Icon/Icon.vue'
4
+
5
+ type SwitchColor = 'blue' | 'green'
6
+
7
+ interface NexxtSwitchProps {
8
+ labelPosition?: 'before' | 'after'
9
+ color?: SwitchColor
10
+ iconOn?: IconName
11
+ iconOff?: IconName
12
+ }
13
+
14
+ defineOptions({
15
+ name: 'NexxtSwitch',
16
+ inheritAttrs: false,
17
+ })
18
+
19
+ const { labelPosition = 'after', color = 'blue', iconOn, iconOff } = defineProps<NexxtSwitchProps>()
20
+
21
+ const model = defineModel<boolean>()
22
+
23
+ const checkedColorClasses: Record<SwitchColor, string> = {
24
+ blue: 'border-cornflower-blue-500 bg-cornflower-blue-500',
25
+ green: 'border-green-400 bg-green-400',
26
+ }
27
+ </script>
28
+
29
+ <template>
30
+ <label class="inline-flex cursor-pointer items-center gap-2">
31
+ <slot v-if="labelPosition === 'before'" />
32
+ <span class="relative inline-block h-8 w-15">
33
+ <input v-bind="$attrs" type="checkbox" class="peer sr-only" v-model="model" />
34
+ <span
35
+ :class="[
36
+ 'absolute inset-0 overflow-hidden rounded-[30px] border transition-colors duration-200',
37
+ model ? checkedColorClasses[color] : 'border-gray-500 bg-gray-200',
38
+ ]"
39
+ >
40
+ <span
41
+ :class="[
42
+ 'absolute top-0.75 left-0.75 h-6 w-6 rounded-full bg-white transition-transform duration-400',
43
+ model && 'translate-x-7',
44
+ ]"
45
+ />
46
+ <span
47
+ :class="[
48
+ 'absolute top-0.75 left-0.75 flex h-6 w-6 items-center justify-center rounded-full bg-white transition-transform duration-300',
49
+ model && 'translate-x-7',
50
+ ]"
51
+ >
52
+ <Icon v-if="model && iconOn" :name="iconOn" type="solid" class="text-xs text-gray-600" />
53
+ <Icon v-else-if="!model && iconOff" :name="iconOff" class="text-xs text-gray-600" />
54
+ </span>
55
+ </span>
56
+ </span>
57
+ <slot v-if="labelPosition === 'after'" />
58
+ </label>
59
+ </template>
@@ -38,6 +38,7 @@
38
38
  "NexxtSource": "components/Source/Source.vue",
39
39
  "NexxtSquircle": "components/Squircle/Squircle.vue",
40
40
  "NexxtStepperHeader": "components/StepperHeader/StepperHeader.vue",
41
+ "NexxtSwitch": "components/Switch/Switch.vue",
41
42
  "NexxtTabbedContent": "components/TabbedContent/TabbedContent.vue",
42
43
  "NexxtTable": "components/Table/Table.vue",
43
44
  "NexxtTabs": "components/Tabs/Tabs.vue",
package/src/index.ts CHANGED
@@ -38,6 +38,7 @@ export { default as NexxtSocialMediaType } from './components/SocialMediaType/So
38
38
  export { default as NexxtSource, SOURCE_MAP } from './components/Source/Source.vue'
39
39
  export { default as NexxtSquircle } from './components/Squircle/Squircle.vue'
40
40
  export { default as NexxtStepperHeader } from './components/StepperHeader/StepperHeader.vue'
41
+ export { default as NexxtSwitch } from './components/Switch/Switch.vue'
41
42
  export { default as NexxtTabbedContent } from './components/TabbedContent/TabbedContent.vue'
42
43
  export { default as NexxtTable } from './components/Table/Table.vue'
43
44
  export { default as NexxtTabs } from './components/Tabs/Tabs.vue'