@dpa-id-components/dpa-shared-components 22.0.0-next.2 → 22.0.0-next.4

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.
@@ -21,9 +21,9 @@ type __VLS_Slots = {} & {
21
21
  default?: (props: typeof __VLS_16) => any;
22
22
  };
23
23
  declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
24
- "list-item-click": (value: string, shouldCloseMenu: boolean) => any;
24
+ "list-item-click": (value: string) => any;
25
25
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
26
- "onList-item-click"?: ((value: string, shouldCloseMenu: boolean) => any) | undefined;
26
+ "onList-item-click"?: ((value: string) => any) | undefined;
27
27
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
28
28
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
29
  declare const _default: typeof __VLS_export;
@@ -34,7 +34,11 @@ declare function toggle(): void;
34
34
  declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
35
35
  open: typeof open;
36
36
  close: typeof close;
37
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
37
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
38
+ toggle: (isOpen: boolean) => any;
39
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
40
+ onToggle?: ((isOpen: boolean) => any) | undefined;
41
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
38
42
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
39
43
  declare const _default: typeof __VLS_export;
40
44
  export default _default;
@@ -2,7 +2,7 @@ type __VLS_Slots = {
2
2
  /**
3
3
  * Label content.
4
4
  */
5
- default?: () => any;
5
+ default: () => any;
6
6
  };
7
7
  type __VLS_Props = {
8
8
  id?: string;
@@ -2181,7 +2181,7 @@ var On = /* @__PURE__ */ e(Tn, [["render", Dn]]), kn = { class: "sr-only" }, An
2181
2181
  "py-3": e.checkboxSize === "md"
2182
2182
  }, e.overrideClasses, t.$attrs.class)),
2183
2183
  tabindex: "0",
2184
- onClick: n[1] ||= fe((n) => t.$emit("list-item-click", e.value, !0), ["prevent", "stop"])
2184
+ onClick: n[1] ||= fe((n) => t.$emit("list-item-click", e.value), ["prevent", "stop"])
2185
2185
  }, [
2186
2186
  e.checkBoxMenu ? (j(), s(wn, {
2187
2187
  key: 0,
@@ -2189,7 +2189,7 @@ var On = /* @__PURE__ */ e(Tn, [["render", Dn]]), kn = { class: "sr-only" }, An
2189
2189
  "model-value": e.isChecked,
2190
2190
  disabled: e.disabled,
2191
2191
  size: e.checkboxSize,
2192
- onClick: n[0] ||= fe((n) => t.$emit("list-item-click", e.value, !1), ["stop"])
2192
+ onClick: n[0] ||= fe((n) => t.$emit("list-item-click", e.value), ["stop"])
2193
2193
  }, {
2194
2194
  default: q(() => [u("span", kn, [L(t.$slots, "default")])]),
2195
2195
  _: 3
@@ -4158,7 +4158,7 @@ function Ar(e, t, n) {
4158
4158
  });
4159
4159
  }
4160
4160
  //#endregion
4161
- //#region node_modules/.pnpm/@vueuse+core@14.3.0_vue@3.5.33_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
4161
+ //#region node_modules/.pnpm/@vueuse+core@14.3.0_vue@3.5.34_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
4162
4162
  var jr = yr ? window : void 0;
4163
4163
  yr && window.document, yr && window.navigator, yr && window.location;
4164
4164
  function Mr(e) {
@@ -5184,7 +5184,7 @@ function Ia(e, t) {
5184
5184
  delete e[t];
5185
5185
  }
5186
5186
  //#endregion
5187
- //#region node_modules/.pnpm/@floating-ui+vue@1.1.11_vue@3.5.33_typescript@6.0.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.mjs
5187
+ //#region node_modules/.pnpm/@floating-ui+vue@1.1.11_vue@3.5.34_typescript@6.0.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.mjs
5188
5188
  function La(e) {
5189
5189
  return typeof e == "object" && !!e && "$el" in e;
5190
5190
  }
@@ -8170,7 +8170,7 @@ var cl = class e extends rl {
8170
8170
  }
8171
8171
  };
8172
8172
  //#endregion
8173
- //#region node_modules/.pnpm/@vuepic+vue-datepicker@12.1.0_vue@3.5.33_typescript@6.0.3_/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js
8173
+ //#region node_modules/.pnpm/@vuepic+vue-datepicker@12.1.0_vue@3.5.34_typescript@6.0.3_/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js
8174
8174
  function ll() {
8175
8175
  return y("svg", {
8176
8176
  xmlns: "http://www.w3.org/2000/svg",
@@ -14495,8 +14495,9 @@ var Pf = /* @__PURE__ */ e(Mf, [["render", Nf]]), Ff = /* @__PURE__ */ h({
14495
14495
  },
14496
14496
  placement: { default: "bottom-start" }
14497
14497
  },
14498
- setup(e, { expose: t }) {
14499
- let n = G("reference"), r = G("floating"), i = F(e.initiallyOpen), { floatingStyles: o, update: s } = Ua(n, r, {
14498
+ emits: ["toggle"],
14499
+ setup(e, { expose: t, emit: n }) {
14500
+ let r = n, i = G("reference"), o = G("floating"), { floatingStyles: s, update: c } = Ua(i, o, {
14500
14501
  placement: e.placement,
14501
14502
  middleware: [
14502
14503
  Da(4),
@@ -14504,41 +14505,46 @@ var Pf = /* @__PURE__ */ e(Mf, [["render", Nf]]), Ff = /* @__PURE__ */ h({
14504
14505
  Oa()
14505
14506
  ],
14506
14507
  whileElementsMounted: Ea
14508
+ }), d = F(e.initiallyOpen);
14509
+ ce(d, (e) => {
14510
+ r("toggle", e);
14507
14511
  });
14508
- function c() {
14509
- i.value = !0;
14512
+ function f() {
14513
+ d.value = !0;
14510
14514
  }
14511
- function d() {
14512
- i.value = !1;
14515
+ function m() {
14516
+ d.value = !1;
14513
14517
  }
14514
- function f() {
14515
- i.value = !i.value;
14518
+ function h() {
14519
+ d.value = !d.value;
14516
14520
  }
14517
14521
  return t({
14518
- open: c,
14519
- close: d
14520
- }), (t, m) => ue((j(), l("div", {
14522
+ open: f,
14523
+ close: m
14524
+ }), (t, n) => ue((j(), l("div", {
14521
14525
  ref_key: "reference",
14522
- ref: n,
14526
+ ref: i,
14523
14527
  class: "w-fit",
14524
- onClick: m[0] ||= (...e) => H(s) && H(s)(...e)
14528
+ onClick: n[0] ||= (...e) => H(c) && H(c)(...e)
14525
14529
  }, [L(t.$slots, "button", D(v({
14526
- open: c,
14527
- close: d,
14528
- toggle: f,
14529
- isOpen: i.value
14530
+ open: f,
14531
+ close: m,
14532
+ toggle: h,
14533
+ isOpen: d.value
14530
14534
  })), void 0, !0), p(a, { name: e.animate ? "fade-up" : "none" }, {
14531
14535
  default: q(() => [ue(u("div", {
14532
14536
  ref_key: "floating",
14533
- ref: r,
14534
- style: O(H(o)),
14537
+ ref: o,
14538
+ style: O(H(s)),
14535
14539
  class: "z-10 w-fit rounded-sm bg-neutral [text-align:initial] [--transition-close-duration:100ms] [--transition-duration:200ms]",
14536
14540
  "data-side": e.placement
14537
- }, [L(t.$slots, "default", D(v({ close: d })), void 0, !0)], 12, Rf), [[se, i.value]])]),
14541
+ }, [L(t.$slots, "default", D(v({ close: m })), void 0, !0)], 12, Rf), [[se, d.value]])]),
14538
14542
  _: 3
14539
- }, 8, ["name"])])), [[H(Lf), d]]);
14543
+ }, 8, ["name"])])), [[H(Lf), () => {
14544
+ d.value && m();
14545
+ }]]);
14540
14546
  }
14541
- }), [["__scopeId", "data-v-24e7c3cc"]]), Bf = { class: "flex items-center gap-2" }, Vf = { class: "block w-max max-w-full divide-y overflow-hidden rounded-sm text-base/6 shadow-lg focus:outline-hidden sm:text-sm/5" }, Hf = {
14547
+ }), [["__scopeId", "data-v-0d999552"]]), Bf = { class: "flex items-center gap-2" }, Vf = { class: "block w-max max-w-full divide-y overflow-hidden rounded-sm text-base/6 shadow-lg focus:outline-hidden sm:text-sm/5" }, Hf = {
14542
14548
  key: 0,
14543
14549
  class: "flex items-center gap-2 rounded-t-sm px-4 py-2 text-neutral-primary [&:has(>input:focus-visible)]:focus-outline [&:has(>input:focus-visible)]:-outline-offset-2"
14544
14550
  }, Uf = ["placeholder"], Wf = {
@@ -14630,17 +14636,16 @@ var Pf = /* @__PURE__ */ e(Mf, [["render", Nf]]), Ff = /* @__PURE__ */ h({
14630
14636
  return (t, i) => (j(), s(zf, {
14631
14637
  "initially-open": e.isOpen,
14632
14638
  animate: e.animate,
14633
- placement: e.floatingUiPlacement
14639
+ placement: e.floatingUiPlacement,
14640
+ onToggle: i[2] ||= (e) => e ? t.$emit("open") : t.$emit("close")
14634
14641
  }, {
14635
- button: q(({ toggle: n, isOpen: r }) => [p(fn, {
14636
- class: E(["w-full justify-between", { "border-neutral-subtle": r }]),
14642
+ button: q(({ toggle: t, isOpen: n }) => [p(fn, {
14643
+ class: E(["w-full justify-between", { "border-neutral-subtle": n }]),
14637
14644
  appearance: e.active ? "primary" : e.buttonAppearance,
14638
14645
  disabled: e.disabled,
14639
14646
  size: e.filterButtonSize,
14640
14647
  "data-testid": "menu-button",
14641
- onClick: (e) => {
14642
- n(), r ? t.$emit("close") : t.$emit("open");
14643
- }
14648
+ onClick: t
14644
14649
  }, {
14645
14650
  default: q(() => [u("div", Bf, [e.iconLeft ? (j(), s(Te, {
14646
14651
  key: 0,
@@ -14658,7 +14663,7 @@ var Pf = /* @__PURE__ */ e(Mf, [["render", Nf]]), Ff = /* @__PURE__ */ h({
14658
14663
  "size",
14659
14664
  "onClick"
14660
14665
  ])]),
14661
- default: q(({ close: a }) => [u("div", Vf, [
14666
+ default: q(() => [u("div", Vf, [
14662
14667
  e.hasSearch ? (j(), l("div", Hf, [p(Te, {
14663
14668
  class: "shrink-0 text-neutral-emphasis",
14664
14669
  name: "search",
@@ -14694,9 +14699,7 @@ var Pf = /* @__PURE__ */ e(Mf, [["render", Nf]]), Ff = /* @__PURE__ */ h({
14694
14699
  "checkbox-appearance": e.checkboxAppearance,
14695
14700
  class: E(["hover:bg-neutral-whisper focus:bg-neutral-faint", { "border-t": t.hasDividerAbove }]),
14696
14701
  "data-testid": `menu-option-button-${n}`,
14697
- onListItemClick: (e, n) => {
14698
- g(t), n && a();
14699
- }
14702
+ onListItemClick: (e) => g(t)
14700
14703
  }, {
14701
14704
  default: q(() => [f(z(t.label), 1)]),
14702
14705
  _: 2
@@ -14721,7 +14724,9 @@ var Pf = /* @__PURE__ */ e(Mf, [["render", Nf]]), Ff = /* @__PURE__ */ h({
14721
14724
  "icon-name": "reset",
14722
14725
  size: "xs",
14723
14726
  "data-testid": "menu-search-reset-button",
14724
- onClick: i[1] ||= (e) => t.$emit("reset")
14727
+ onClick: i[1] ||= (e) => {
14728
+ r.value = "", t.$emit("reset");
14729
+ }
14725
14730
  }, {
14726
14731
  default: q(() => [p(Te, { name: "reset" }), f(" " + z(e.resetLabel), 1)]),
14727
14732
  _: 1
@@ -14862,7 +14867,7 @@ var Pf = /* @__PURE__ */ e(Mf, [["render", Nf]]), Ff = /* @__PURE__ */ h({
14862
14867
  default: q(() => [ue(u("input", w({
14863
14868
  id: r.value,
14864
14869
  "onUpdate:modelValue": i[0] ||= (e) => t.value = e,
14865
- class: ["inline-flex aspect-square appearance-none items-center justify-center rounded-full border-2 bg-neutral align-middle transition-colors after:size-2 after:rounded-full checked:after:content-[''] not-read-only:enabled:cursor-pointer disabled:border-neutral-muted disabled:text-neutral-soft disabled:checked:after:bg-neutral-muted", {
14870
+ class: ["inline-flex aspect-square appearance-none items-center justify-center rounded-full border-2 bg-neutral align-middle transition-colors after:size-2 after:rounded-full checked:after:content-[''] enabled:cursor-pointer disabled:border-neutral-muted disabled:text-neutral-soft disabled:checked:after:bg-neutral-muted", {
14866
14871
  "size-4": e.size === "sm",
14867
14872
  "size-5": e.size === "md",
14868
14873
  "border-primary checked:after:bg-primary enabled:hover:border-primary-hover": e.appearance === "primary",
@@ -15398,7 +15403,7 @@ var Pf = /* @__PURE__ */ e(Mf, [["render", Nf]]), Ff = /* @__PURE__ */ h({
15398
15403
  "target"
15399
15404
  ]));
15400
15405
  }
15401
- }), Ep = { class: "relative" }, Dp = ["id"], Op = /* @__PURE__ */ h({
15406
+ }), Ep = ["id"], Dp = /* @__PURE__ */ h({
15402
15407
  inheritAttrs: !1,
15403
15408
  __name: "UiToggleButton",
15404
15409
  props: /* @__PURE__ */ C({
@@ -15421,37 +15426,28 @@ var Pf = /* @__PURE__ */ e(Mf, [["render", Nf]]), Ff = /* @__PURE__ */ h({
15421
15426
  }, {
15422
15427
  default: q(() => [
15423
15428
  e.labelPosition === "left" ? L(n.$slots, "default", { key: 0 }) : c("", !0),
15424
- u("div", Ep, [
15425
- ue(u("input", w({
15426
- id: r.value,
15427
- "onUpdate:modelValue": i[0] ||= (e) => t.value = e,
15428
- type: "checkbox",
15429
- "data-testid": "toggleButton",
15430
- role: "switch",
15431
- class: "sr-only"
15432
- }, {
15433
- ...n.$attrs,
15434
- class: null
15435
- }), null, 16, Dp), [[re, t.value]]),
15436
- u("div", { class: E(["line rounded-full shadow-inner transition-opacity duration-200 ease-in-out", {
15437
- "bg-secondary opacity-50": t.value,
15438
- "bg-neutral-faint": !t.value,
15439
- "h-3 w-6": e.size === "sm",
15440
- "h-4 w-10": e.size === "lg"
15441
- }]) }, null, 2),
15442
- u("div", { class: E([{
15443
- "translate-x-full bg-secondary": t.value,
15444
- "bg-neutral-muted": !t.value,
15445
- "-top-0.5 size-4": e.size === "sm",
15446
- "-top-1 size-6": e.size === "lg"
15447
- }, "dot absolute -left-1 rounded-full shadow-sm transition-transform duration-200 ease-in-out"]) }, null, 2)
15448
- ]),
15429
+ ue(u("input", w({
15430
+ id: r.value,
15431
+ "onUpdate:modelValue": i[0] ||= (e) => t.value = e,
15432
+ class: ["relative appearance-none rounded-full shadow-inner transition-opacity duration-200 ease-in-out after:absolute after:-left-1 after:block after:rounded-full after:shadow-sm after:transition-transform after:duration-200 after:ease-in-out after:content-[''] enabled:cursor-pointer", {
15433
+ "bg-secondary-emphasis after:translate-x-full after:bg-secondary": t.value,
15434
+ "bg-neutral-faint after:bg-neutral-muted": !t.value,
15435
+ "h-3 w-6 after:-top-0.5 after:size-4": e.size === "sm",
15436
+ "h-4 w-10 after:-top-1 after:size-6": e.size === "lg"
15437
+ }],
15438
+ type: "checkbox",
15439
+ role: "switch",
15440
+ "data-testid": "toggleButton"
15441
+ }, {
15442
+ ...n.$attrs,
15443
+ class: null
15444
+ }), null, 16, Ep), [[re, t.value]]),
15449
15445
  e.labelPosition === "right" ? L(n.$slots, "default", { key: 1 }) : c("", !0)
15450
15446
  ]),
15451
15447
  _: 3
15452
15448
  }, 8, ["for", "class"]));
15453
15449
  }
15454
- }), kp = ["data-placement"], Ap = /* @__PURE__ */ h({
15450
+ }), Op = ["data-placement"], kp = /* @__PURE__ */ h({
15455
15451
  inheritAttrs: !1,
15456
15452
  __name: "UiTooltip",
15457
15453
  props: {
@@ -15525,17 +15521,17 @@ var Pf = /* @__PURE__ */ e(Mf, [["render", Nf]]), Ff = /* @__PURE__ */ h({
15525
15521
  "leave-active-class",
15526
15522
  "leave-to-class",
15527
15523
  "enter-from-class"
15528
- ])], 12, kp)], 8, ["disabled"]))], 2));
15524
+ ])], 12, Op)], 8, ["disabled"]))], 2));
15529
15525
  }
15530
- }), jp = {
15526
+ }), Ap = {
15531
15527
  sm: "40rem",
15532
15528
  md: "48rem",
15533
15529
  lg: "64rem",
15534
15530
  xl: "80rem",
15535
15531
  "2xl": "96rem"
15536
15532
  };
15537
- function Mp() {
15538
- let e = Vr(jp).current();
15533
+ function jp() {
15534
+ let e = Vr(Ap).current();
15539
15535
  return {
15540
15536
  currentBreakpoint: e,
15541
15537
  sm: o(() => e.value.includes("sm")),
@@ -15546,4 +15542,4 @@ function Mp() {
15546
15542
  };
15547
15543
  }
15548
15544
  //#endregion
15549
- export { Ie as DpaMediaItem, Le as UiBadge, fn as UiButton, gn as UiButtonGroup, bn as UiCard, Mn as UiCheckBoxGroup, wn as UiCheckbox, Nn as UiChip, In as UiCollapseNavigation, gr as UiColorPicker, uf as UiDatePicker, hf as UiDialog, _f as UiFilterBadge, bf as UiFilterButton, Te as UiIcon, Sf as UiIconButton, Ef as UiInfoContent, Af as UiInput, xn as UiLabel, On as UiList, jn as UiListItem, Ff as UiMediaTypeIcon, qf as UiMenu, Jf as UiMenuItem, Yf as UiMenuList, Zf as UiOverlay, ep as UiOverlayMenu, zf as UiPopover, rp as UiRadioButton, ip as UiRadioInputGroup, up as UiSearchBar, mp as UiSearchInput, hp as UiSection, gp as UiSectionDivider, yp as UiSelect, bp as UiSkeletonBox, Sp as UiSnackbar, wp as UiSpinner, Tp as UiTextButton, Op as UiToggleButton, Ap as UiTooltip, un as cn, Mp as useBreakpoints, Lf as vClickAway };
15545
+ export { Ie as DpaMediaItem, Le as UiBadge, fn as UiButton, gn as UiButtonGroup, bn as UiCard, Mn as UiCheckBoxGroup, wn as UiCheckbox, Nn as UiChip, In as UiCollapseNavigation, gr as UiColorPicker, uf as UiDatePicker, hf as UiDialog, _f as UiFilterBadge, bf as UiFilterButton, Te as UiIcon, Sf as UiIconButton, Ef as UiInfoContent, Af as UiInput, xn as UiLabel, On as UiList, jn as UiListItem, Ff as UiMediaTypeIcon, qf as UiMenu, Jf as UiMenuItem, Yf as UiMenuList, Zf as UiOverlay, ep as UiOverlayMenu, zf as UiPopover, rp as UiRadioButton, ip as UiRadioInputGroup, up as UiSearchBar, mp as UiSearchInput, hp as UiSection, gp as UiSectionDivider, yp as UiSelect, bp as UiSkeletonBox, Sp as UiSnackbar, wp as UiSpinner, Tp as UiTextButton, Dp as UiToggleButton, kp as UiTooltip, un as cn, jp as useBreakpoints, Lf as vClickAway };
@@ -1,11 +1,15 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3-vite";
1
+ import type {
2
+ ComponentPropsAndSlots,
3
+ Meta,
4
+ StoryObj,
5
+ } from "@storybook/vue3-vite";
2
6
  import { ref } from "vue";
3
7
 
4
8
  import UiButton from "../UiButton/UiButton.vue";
5
9
 
6
10
  import UiButtonGroup from "./UiButtonGroup.vue";
7
11
 
8
- type PropsAndStoryProps = InstanceType<typeof UiButtonGroup> & {
12
+ type PropsAndCustomArgs = ComponentPropsAndSlots<typeof UiButtonGroup> & {
9
13
  activeButton: number;
10
14
  };
11
15
 
@@ -15,14 +19,14 @@ const meta = {
15
19
  activeButton: { control: "number" },
16
20
  },
17
21
  args: {
18
- activeButton: 0,
22
+ activeButton: 1,
19
23
  },
20
24
  title: "Ui/UiButtonGroup",
21
25
  component: UiButtonGroup,
22
- } satisfies Meta<PropsAndStoryProps>;
26
+ } satisfies Meta<PropsAndCustomArgs>;
23
27
 
24
28
  export default meta;
25
- type Story = StoryObj<PropsAndStoryProps>;
29
+ type Story = StoryObj<PropsAndCustomArgs>;
26
30
 
27
31
  export const Default: Story = {
28
32
  render: (args) => ({
@@ -46,7 +50,4 @@ export const Default: Story = {
46
50
  </UiButtonGroup>
47
51
  `,
48
52
  }),
49
- args: {
50
- activeButton: 1,
51
- },
52
53
  };
@@ -1,19 +1,28 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3-vite";
1
+ import type {
2
+ ComponentPropsAndSlots,
3
+ Meta,
4
+ StoryObj,
5
+ } from "@storybook/vue3-vite";
2
6
  import { ref } from "vue";
3
7
 
4
8
  import UiCheckbox from "./UiCheckbox.vue";
5
9
 
10
+ type PropsAndCustomArgs = ComponentPropsAndSlots<typeof UiCheckbox> & {
11
+ name?: string;
12
+ disabled?: boolean;
13
+ };
14
+
6
15
  const meta = {
7
16
  title: "forms/UiCheckbox",
8
17
  component: UiCheckbox,
9
18
  argTypes: {
10
19
  // Attributes
11
- // @ts-ignore Storybook doesn't know that **any** component can receive arbitrary attributes and enforces this on the type level.
20
+ name: { control: "text" },
12
21
  disabled: { control: "boolean" },
13
22
  },
14
23
  args: {
15
24
  // Attributes
16
- // @ts-ignore Storybook doesn't know that **any** component can receive arbitrary attributes and enforces this on the type level.
25
+ name: "name",
17
26
  disabled: false,
18
27
 
19
28
  // Props
@@ -24,10 +33,10 @@ const meta = {
24
33
  default: "Checkbox",
25
34
  errors: "",
26
35
  },
27
- } satisfies Meta<typeof UiCheckbox>;
36
+ } satisfies Meta<PropsAndCustomArgs>;
28
37
 
29
38
  export default meta;
30
- type Story = StoryObj<typeof meta>;
39
+ type Story = StoryObj<PropsAndCustomArgs>;
31
40
 
32
41
  export const Default: Story = {
33
42
  render: (args) => ({
@@ -1,9 +1,13 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3-vite";
1
+ import type {
2
+ ComponentPropsAndSlots,
3
+ Meta,
4
+ StoryObj,
5
+ } from "@storybook/vue3-vite";
2
6
 
3
7
  import { icons } from "./icons.ts";
4
8
  import UiIcon from "./UiIcon.vue";
5
9
 
6
- type PropsAndStoryProps = InstanceType<typeof UiIcon> & {
10
+ type PropsAndCustomArgs = ComponentPropsAndSlots<typeof UiIcon> & {
7
11
  outline: boolean;
8
12
  };
9
13
 
@@ -18,10 +22,10 @@ const meta = {
18
22
  argTypes: {
19
23
  outline: { control: "boolean" },
20
24
  },
21
- } satisfies Meta<PropsAndStoryProps>;
25
+ } satisfies Meta<PropsAndCustomArgs>;
22
26
 
23
27
  export default meta;
24
- type Story = StoryObj<typeof meta>;
28
+ type Story = StoryObj<PropsAndCustomArgs>;
25
29
 
26
30
  export const Default: Story = {
27
31
  render: (args) => ({
@@ -1,14 +1,24 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3-vite";
1
+ import type {
2
+ ComponentPropsAndSlots,
3
+ Meta,
4
+ StoryObj,
5
+ } from "@storybook/vue3-vite";
2
6
  import { action } from "storybook/actions";
3
7
 
4
8
  import UiInput from "./UiInput.vue";
5
9
 
10
+ type PropsAndCustomArgs = ComponentPropsAndSlots<typeof UiInput> & {
11
+ name?: string;
12
+ placeholder?: string;
13
+ disabled?: boolean;
14
+ readonly?: boolean;
15
+ };
16
+
6
17
  const meta = {
7
18
  title: "forms/UiInput",
8
19
  component: UiInput,
9
20
  args: {
10
21
  // Attributes
11
- // @ts-ignore Storybook doesn't know that **any** component can receive arbitrary attributes and enforces this on the type level.
12
22
  name: "name",
13
23
  disabled: false,
14
24
  readonly: false,
@@ -24,8 +34,8 @@ const meta = {
24
34
  },
25
35
  argTypes: {
26
36
  // Attributes
27
- // @ts-ignore Storybook doesn't know that **any** component can receive arbitrary attributes and enforces this on the type level.
28
37
  name: { control: "text" },
38
+ placeholder: { control: "text" },
29
39
  disabled: { control: "boolean" },
30
40
  readonly: { control: "boolean" },
31
41
  },
@@ -53,17 +63,16 @@ const meta = {
53
63
  update: action("update:modelValue"),
54
64
  },
55
65
  }),
56
- } satisfies Meta<typeof UiInput>;
66
+ } satisfies Meta<PropsAndCustomArgs>;
57
67
 
58
68
  export default meta;
59
- type Story = StoryObj<typeof meta>;
69
+ type Story = StoryObj<PropsAndCustomArgs>;
60
70
 
61
71
  export const Default: Story = {};
62
72
 
63
73
  export const Placeholder: Story = {
64
74
  args: {
65
75
  // Attributes
66
- // @ts-ignore
67
76
  placeholder: "Some placeholder text",
68
77
 
69
78
  // Slots
@@ -13,7 +13,7 @@
13
13
  )
14
14
  "
15
15
  tabindex="0"
16
- @click.prevent.stop="$emit('list-item-click', value, true)"
16
+ @click.prevent.stop="$emit('list-item-click', value)"
17
17
  >
18
18
  <UiCheckbox
19
19
  v-if="checkBoxMenu"
@@ -21,7 +21,7 @@
21
21
  :model-value="isChecked"
22
22
  :disabled="disabled"
23
23
  :size="checkboxSize"
24
- @click.stop="$emit('list-item-click', value, false)"
24
+ @click.stop="$emit('list-item-click', value)"
25
25
  >
26
26
  <span class="sr-only"><slot /></span>
27
27
  </UiCheckbox>
@@ -85,6 +85,6 @@ const {
85
85
  }>();
86
86
 
87
87
  defineEmits<{
88
- "list-item-click": [value: string, shouldCloseMenu: boolean];
88
+ "list-item-click": [value: string];
89
89
  }>();
90
90
  </script>
@@ -1,9 +1,13 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3-vite";
1
+ import type {
2
+ ComponentPropsAndSlots,
3
+ Meta,
4
+ StoryObj,
5
+ } from "@storybook/vue3-vite";
2
6
 
3
7
  import { icons } from "./icons.ts";
4
8
  import UiMediaTypeIcon from "./UiMediaTypeIcon.vue";
5
9
 
6
- type PropsAndStoryProps = InstanceType<typeof UiMediaTypeIcon> & {
10
+ type PropsAndCustomArgs = ComponentPropsAndSlots<typeof UiMediaTypeIcon> & {
7
11
  outline: boolean;
8
12
  };
9
13
 
@@ -18,10 +22,10 @@ const meta = {
18
22
  argTypes: {
19
23
  outline: { control: "boolean" },
20
24
  },
21
- } satisfies Meta<PropsAndStoryProps>;
25
+ } satisfies Meta<PropsAndCustomArgs>;
22
26
 
23
27
  export default meta;
24
- type Story = StoryObj<typeof meta>;
28
+ type Story = StoryObj<PropsAndCustomArgs>;
25
29
 
26
30
  export const Default: Story = {
27
31
  render: (args) => ({
@@ -301,7 +301,7 @@ describe("UiMenu", () => {
301
301
 
302
302
  await items[0].trigger("click");
303
303
  expect(wrapper.find('[data-testid="menu-option-list"]').isVisible()).toBe(
304
- false,
304
+ true,
305
305
  );
306
306
  });
307
307
  });