@dpa-id-components/dpa-shared-components 22.0.0-next.13 → 22.0.0-next.14

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.
Files changed (82) hide show
  1. package/dist/components/UiCheckbox/UiCheckbox.vue.d.ts +1 -1
  2. package/dist/components/UiFilterButton/UiFilterButton.vue.d.ts +1 -1
  3. package/dist/components/UiInput/UiInput.vue.d.ts +1 -1
  4. package/dist/components/UiMenu/UiMenu.vue.d.ts +2 -2
  5. package/dist/components/UiMenu/UiMenuItem.vue.d.ts +1 -1
  6. package/dist/components/index.d.ts +1 -9
  7. package/dist/dpa-shared-components.js +1955 -2222
  8. package/dist/src/components/UiButtonGroup/UiButtonGroup.vue +1 -1
  9. package/dist/src/components/UiDatePicker/UiDatePicker.vue +1 -4
  10. package/dist/src/components/UiDialog/UiDialog.vue +7 -4
  11. package/dist/src/components/UiIconButton/UiIconButton.vue +1 -2
  12. package/dist/src/components/UiListItem/README.md +13 -12
  13. package/dist/src/components/UiListItem/UiListItem.stories.ts +0 -26
  14. package/dist/src/components/UiListItem/UiListItem.vue +1 -1
  15. package/dist/src/components/UiMenu/UiMenu.stories.ts +0 -1
  16. package/dist/src/components/UiMenu/UiMenu.vue +3 -4
  17. package/dist/src/components/index.ts +0 -16
  18. package/dist/style.css +2 -2
  19. package/package.json +11 -11
  20. package/src/components/UiButtonGroup/UiButtonGroup.vue +1 -1
  21. package/src/components/UiDatePicker/UiDatePicker.vue +1 -4
  22. package/src/components/UiDialog/UiDialog.vue +7 -4
  23. package/src/components/UiIconButton/UiIconButton.vue +1 -2
  24. package/src/components/UiListItem/README.md +13 -12
  25. package/src/components/UiListItem/UiListItem.vue +1 -1
  26. package/src/components/UiMenu/UiMenu.vue +3 -4
  27. package/dist/components/DpaMediaItem/DpaMediaItem.vue.d.ts +0 -43
  28. package/dist/components/UiCard/UiCard.vue.d.ts +0 -7
  29. package/dist/components/UiCheckBoxGroup/UiCheckBoxGroup.vue.d.ts +0 -33
  30. package/dist/components/UiCollapseNavigation/UiCollapseNavigation.vue.d.ts +0 -28
  31. package/dist/components/UiOverlay/UiOverlay.vue.d.ts +0 -18
  32. package/dist/components/UiOverlayMenu/UiOverlayMenu.vue.d.ts +0 -24
  33. package/dist/components/UiSection/UiSection.vue.d.ts +0 -29
  34. package/dist/components/UiSectionDivider/UiSectionDivider.vue.d.ts +0 -16
  35. package/dist/src/components/DpaMediaItem/DpaMediaItem.spec.ts +0 -123
  36. package/dist/src/components/DpaMediaItem/DpaMediaItem.stories.ts +0 -140
  37. package/dist/src/components/DpaMediaItem/DpaMediaItem.vue +0 -146
  38. package/dist/src/components/DpaMediaItem/README.md +0 -42
  39. package/dist/src/components/UiCard/README.md +0 -32
  40. package/dist/src/components/UiCard/UiCard.spec.ts +0 -16
  41. package/dist/src/components/UiCard/UiCard.stories.ts +0 -30
  42. package/dist/src/components/UiCard/UiCard.vue +0 -28
  43. package/dist/src/components/UiCheckBoxGroup/README.md +0 -35
  44. package/dist/src/components/UiCheckBoxGroup/UiCheckBoxGroup.spec.ts +0 -70
  45. package/dist/src/components/UiCheckBoxGroup/UiCheckBoxGroup.stories.ts +0 -59
  46. package/dist/src/components/UiCheckBoxGroup/UiCheckBoxGroup.vue +0 -106
  47. package/dist/src/components/UiCollapseNavigation/README.md +0 -37
  48. package/dist/src/components/UiCollapseNavigation/UiCollapseNavigation.spec.ts +0 -21
  49. package/dist/src/components/UiCollapseNavigation/UiCollapseNavigation.stories.ts +0 -67
  50. package/dist/src/components/UiCollapseNavigation/UiCollapseNavigation.vue +0 -79
  51. package/dist/src/components/UiOverlay/README.md +0 -38
  52. package/dist/src/components/UiOverlay/UiOverlay.spec.ts +0 -16
  53. package/dist/src/components/UiOverlay/UiOverlay.stories.ts +0 -22
  54. package/dist/src/components/UiOverlay/UiOverlay.vue +0 -36
  55. package/dist/src/components/UiOverlayMenu/README.md +0 -40
  56. package/dist/src/components/UiOverlayMenu/UiOverlayMenu.spec.ts +0 -33
  57. package/dist/src/components/UiOverlayMenu/UiOverlayMenu.stories.ts +0 -40
  58. package/dist/src/components/UiOverlayMenu/UiOverlayMenu.vue +0 -51
  59. package/dist/src/components/UiSection/README.md +0 -33
  60. package/dist/src/components/UiSection/UiSection.spec.ts +0 -49
  61. package/dist/src/components/UiSection/UiSection.stories.ts +0 -61
  62. package/dist/src/components/UiSection/UiSection.vue +0 -63
  63. package/dist/src/components/UiSectionDivider/README.md +0 -29
  64. package/dist/src/components/UiSectionDivider/UiSectionDivider.spec.ts +0 -19
  65. package/dist/src/components/UiSectionDivider/UiSectionDivider.stories.ts +0 -49
  66. package/dist/src/components/UiSectionDivider/UiSectionDivider.vue +0 -44
  67. package/src/components/DpaMediaItem/DpaMediaItem.vue +0 -146
  68. package/src/components/DpaMediaItem/README.md +0 -42
  69. package/src/components/UiCard/README.md +0 -32
  70. package/src/components/UiCard/UiCard.vue +0 -28
  71. package/src/components/UiCheckBoxGroup/README.md +0 -35
  72. package/src/components/UiCheckBoxGroup/UiCheckBoxGroup.vue +0 -106
  73. package/src/components/UiCollapseNavigation/README.md +0 -37
  74. package/src/components/UiCollapseNavigation/UiCollapseNavigation.vue +0 -79
  75. package/src/components/UiOverlay/README.md +0 -38
  76. package/src/components/UiOverlay/UiOverlay.vue +0 -36
  77. package/src/components/UiOverlayMenu/README.md +0 -40
  78. package/src/components/UiOverlayMenu/UiOverlayMenu.vue +0 -51
  79. package/src/components/UiSection/README.md +0 -33
  80. package/src/components/UiSection/UiSection.vue +0 -63
  81. package/src/components/UiSectionDivider/README.md +0 -29
  82. package/src/components/UiSectionDivider/UiSectionDivider.vue +0 -44
@@ -1,32 +0,0 @@
1
- # @deprecated
2
- Component will be removed in a future update
3
- # @dpa-shared-components/UiCard
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- SomeComponent.vue using UiCard -->
9
- <template>
10
- <UiCard>Autor: Max Mustermann (Berlin), +49 30 1234-56478, max.mustermann@dpa.com</UiCard>
11
- </template>
12
-
13
- <script setup lang="ts">
14
- import { UiCard } from "@dpa-id-components/dpa-shared-components";
15
- </script>
16
- ```
17
-
18
- ## API
19
-
20
- ### Props
21
-
22
- This component has no properties
23
-
24
- ### Events
25
-
26
- This component emits no events
27
-
28
- ### Slots
29
-
30
- | Name | Description |
31
- |-----------|--------------------------------------------|
32
- | `default` | Slot for the rendering the cards's content |
@@ -1,16 +0,0 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
-
4
- import UiCard from "./UiCard.vue";
5
-
6
- describe("UiCard", () => {
7
- test("renders Card with default slot content", () => {
8
- const wrapper = mount(UiCard, {
9
- slots: {
10
- default: "Default Slot",
11
- },
12
- });
13
-
14
- expect(wrapper.text()).toBe("Default Slot");
15
- });
16
- });
@@ -1,30 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3-vite";
2
-
3
- import UiCard from "./UiCard.vue";
4
-
5
- const meta = {
6
- title: "UI/UiCard",
7
- tags: ["deprecated"],
8
- component: UiCard,
9
- } satisfies Meta<typeof UiCard>;
10
-
11
- export default meta;
12
- type Story = StoryObj<typeof meta>;
13
-
14
- export const Default: Story = {
15
- render: (args) => ({
16
- components: { UiCard },
17
- setup() {
18
- return { args };
19
- },
20
- template: `
21
- <div class="w-full pt-12 pb-12 lg:mx-auto lg:w-5/6">
22
- <h4 class="text-base mb-4">Kontakte</h4>
23
- <ul class="w-full flex-wrap flex">
24
- <UiCard v-bind="args">Autor: Max Mustermann (Berlin), +49 30 1234-56478, max.mustermann@dpa.com</UiCard>
25
- <UiCard v-bind="args">Autor: Max Mustermann (Berlin), +49 30 1234-56478, max.mustermann@dpa.com</UiCard>
26
- <UiCard v-bind="args">Autor: Max Mustermann (Berlin), +49 30 1234-56478, max.mustermann@dpa.com</UiCard>
27
- </ul>
28
- </div>`,
29
- }),
30
- };
@@ -1,28 +0,0 @@
1
- <template>
2
- <li
3
- class="mb-4 rounded-2xl bg-neutral-whisper px-8 py-4 text-sm font-medium sm:w-full md:mr-7 md:w-[45.5%] lg:mr-8 lg:w-[46.5%]"
4
- >
5
- <slot></slot>
6
- </li>
7
- </template>
8
- <script lang="ts">
9
- import { onMounted } from "vue";
10
-
11
- /**
12
- * @deprecated
13
- * Please replace with your own component
14
- */
15
- export default {
16
- name: "UiCard",
17
- setup() {
18
- onMounted(() => {
19
- if (window.location.origin.includes("local")) {
20
- // eslint-disable-next-line no-console
21
- console.warn(
22
- "Component is deprecated. It will be removed in a future update.",
23
- );
24
- }
25
- });
26
- },
27
- };
28
- </script>
@@ -1,35 +0,0 @@
1
- # @deprecated
2
- Component will be removed in a future update
3
- # @dpa-shared-components/UiCheckBoxGroup
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- SomeComponent.vue using UiCheckBoxGroup -->
9
-
10
- <template>
11
- <UiCheckBoxGroup :item="checkboxes" :first-entry-checks-all="true" @item-checked="handleEvent"
12
- @checked-all="handleEvent" />
13
- </template>
14
-
15
- <script setup lang="ts">
16
- import { UiCheckBoxGroup } from "@dpa-id-components/dpa-shared-components";
17
- </script>
18
-
19
- ```
20
- ### Props
21
-
22
- The "CheckboxItem"-Type is used. Consisting of "name", "isChecked" and "iconName"
23
-
24
- | Name | Type | Default | Description |
25
- |-----------------------|----------------|---------|--------------------------------------------------------------------------------------------------|
26
- | `item` | `CheckboxItem` | `` | Adds the value to the checkbox, consiting of name, isChecked and iconName ("CheckboxItem"-Type) |
27
- | `firstEntryChecksAll` | `Boolean` | `false` | Wether the first item checks all the boxes |
28
-
29
- ### Events
30
-
31
- | Name | Type | Description |
32
- |----------------|------|----------------------------------------------|
33
- | `checked-all` | `boolean` | Emitted when all items are selected |
34
- | `input` | `CheckboxItem[]` | |
35
- | `item-checked` | `CheckboxItem` | Emitted when each individual item is checked |
@@ -1,70 +0,0 @@
1
- import { randomInt } from "node:crypto";
2
-
3
- import { mount } from "@vue/test-utils";
4
- import { describe, expect, test } from "vitest";
5
-
6
- import UiCheckBoxGroup, { type CheckboxItem } from "./UiCheckBoxGroup.vue";
7
-
8
- const entries = [
9
- {
10
- name: "alle wählen",
11
- isChecked: false,
12
- },
13
- {
14
- name: "Wissenschaft",
15
- isChecked: false,
16
- },
17
- {
18
- name: "Kultur",
19
- isChecked: false,
20
- },
21
- {
22
- name: "Sport",
23
- isChecked: false,
24
- },
25
- ] as CheckboxItem[];
26
-
27
- describe("UiCheckBoxGroup", () => {
28
- test("renders menu with prop values", async () => {
29
- const wrapper = mount(UiCheckBoxGroup, {
30
- props: {
31
- item: entries,
32
- },
33
- });
34
-
35
- const listElements = wrapper.findAll("li");
36
-
37
- listElements.forEach((entry) => {
38
- expect(entries.some((item) => entry.text().includes(item.name))).toBe(
39
- true,
40
- );
41
- });
42
- });
43
-
44
- test("emits checked-all when first item is clicked", async () => {
45
- const wrapper = mount(UiCheckBoxGroup, {
46
- props: {
47
- item: entries,
48
- firstEntryChecksAll: true,
49
- },
50
- });
51
-
52
- const firstListElement = wrapper.findAll("li")[0];
53
-
54
- await firstListElement.trigger("click");
55
- expect(wrapper.emitted()).toHaveProperty("checked-all");
56
- });
57
-
58
- test("emits item-checked when one item is clicked", async () => {
59
- const wrapper = mount(UiCheckBoxGroup, {
60
- props: {
61
- item: entries,
62
- },
63
- });
64
-
65
- const randomListElement = wrapper.findAll("li")[randomInt(0, 3)];
66
-
67
- await randomListElement.trigger("click");
68
- expect(wrapper.emitted()).toHaveProperty("item-checked");
69
- });
70
- });
@@ -1,59 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3-vite";
2
-
3
- import UiCheckBoxGroup from "./UiCheckBoxGroup.vue";
4
-
5
- const meta = {
6
- title: "forms/UiCheckboxGroup",
7
- component: UiCheckBoxGroup,
8
- argTypes: {
9
- firstEntryChecksAll: { control: "boolean" },
10
- disabled: { control: "boolean" },
11
- },
12
- args: {
13
- firstEntryChecksAll: true,
14
- disabled: false,
15
- },
16
- tags: ["deprecated"],
17
- } satisfies Meta<typeof UiCheckBoxGroup>;
18
-
19
- export default meta;
20
- type Story = StoryObj<typeof meta>;
21
-
22
- export const Default: Story = {
23
- render: (args) => ({
24
- setup() {
25
- return { args };
26
- },
27
- components: { UiCheckBoxGroup },
28
- template: "<UiCheckBoxGroup v-bind='args'/>",
29
- }),
30
- args: {
31
- item: [
32
- {
33
- name: "alle Ressorts",
34
- isChecked: false,
35
- },
36
- {
37
- name: "Wirtschaft",
38
- isChecked: false,
39
- iconName: "clock",
40
- },
41
- {
42
- name: "Panorama",
43
- isChecked: false,
44
- },
45
- {
46
- name: "Wissenschaft",
47
- isChecked: false,
48
- },
49
- {
50
- name: "Kultur",
51
- isChecked: false,
52
- },
53
- {
54
- name: "Sport",
55
- isChecked: false,
56
- },
57
- ],
58
- },
59
- };
@@ -1,106 +0,0 @@
1
- <template>
2
- <UiList class="grid grid-cols-2 flex-wrap border-none pt-2 lg:flex lg:pt-0">
3
- <UiListItem
4
- v-for="(entry, index) in checkboxItems"
5
- :key="entry.name"
6
- :is-checked="entry.isChecked"
7
- class="flex h-8 items-center border-none py-2 text-sm shadow-none lg:py-3"
8
- check-box-menu
9
- :disabled="disabled"
10
- :icon-name="entry.iconName"
11
- @list-item-click="toggle(index)"
12
- >{{ entry.name }}
13
- </UiListItem>
14
- </UiList>
15
- </template>
16
- <script lang="ts">
17
- /**
18
- * @deprecated
19
- * Please replace with your own component
20
- */
21
- export default {
22
- name: "UiCheckBoxGroup",
23
- };
24
-
25
- export type CheckboxItem = {
26
- name: string;
27
- isChecked: boolean;
28
- iconName?: UiIconName;
29
- };
30
- </script>
31
- <script setup lang="ts">
32
- import { computed, onMounted, ref, watchEffect } from "vue";
33
-
34
- import type { UiIconName } from "../UiIcon/UiIcon.vue";
35
- import UiList from "../UiList/UiList.vue";
36
- import UiListItem from "../UiListItem/UiListItem.vue";
37
-
38
- const emit = defineEmits<{
39
- "checked-all": [boolean];
40
- input: [CheckboxItem[]];
41
- "item-checked": [CheckboxItem];
42
- }>();
43
-
44
- const props = withDefaults(
45
- defineProps<{
46
- item?: CheckboxItem[];
47
- firstEntryChecksAll?: boolean;
48
- disabled?: boolean;
49
- }>(),
50
- {
51
- item: () => [],
52
- firstEntryChecksAll: false,
53
- disabled: false,
54
- },
55
- );
56
-
57
- const checkboxItems = ref<CheckboxItem[]>(props.item);
58
-
59
- watchEffect(() => {
60
- checkboxItems.value = props.item;
61
- });
62
-
63
- const areAllChecked = computed(() => {
64
- const checkboxEntries = checkboxItems.value.slice(1);
65
- return checkboxEntries.every((entry: CheckboxItem) => entry.isChecked);
66
- });
67
-
68
- const toggleAll = () => {
69
- checkboxItems.value = checkboxItems.value.map((entry: CheckboxItem) => {
70
- const isChecked = !checkboxItems.value[0].isChecked;
71
- return {
72
- ...entry,
73
- isChecked,
74
- };
75
- });
76
- emit("checked-all", checkboxItems.value[0].isChecked);
77
- emit("input", checkboxItems.value);
78
- };
79
-
80
- const toggle = (index: number) => {
81
- // With List Item Click we are overriding the normal checkbox `input` event, hence the disabled attribute has no effect
82
- if (props.disabled) {
83
- return;
84
- }
85
- if (index === 0 && props.firstEntryChecksAll) {
86
- toggleAll();
87
- } else {
88
- checkboxItems.value[index].isChecked =
89
- !checkboxItems.value[index].isChecked;
90
- if (props.firstEntryChecksAll) {
91
- checkboxItems.value[0].isChecked = areAllChecked.value;
92
- }
93
- }
94
- emit("item-checked", checkboxItems.value[index]);
95
- emit("input", checkboxItems.value);
96
- };
97
-
98
- onMounted(() => {
99
- if (window.location.origin.includes("local")) {
100
- // eslint-disable-next-line no-console
101
- console.warn(
102
- "Component is deprecated. It will be removed in a future update.",
103
- );
104
- }
105
- });
106
- </script>
@@ -1,37 +0,0 @@
1
- # @deprecated
2
- Component will be removed in a future update
3
- # @dpa-shared-components/UiCollapseNavigation
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- SomeComponent.vue using UiCollapseNavigation -->
9
- <template>
10
- <UiCollapseNavigation headline="Menu eins">
11
- <UiButton> test eins </UiButton>
12
- <UiButton> test zwei </UiButton>
13
- <UiButton> test drei </UiButton>
14
- </UiCollapseNavigation>
15
- </template>
16
-
17
- <script>
18
- import UiCollapseNavigation from "./UiCollapseNavigation.vue";
19
- </script>
20
- ```
21
-
22
- ## API
23
-
24
- ### Props
25
-
26
- | Name | Type | Default | Description |
27
- |-----------------|---------|---------|-----------------------------------|
28
- | `headline` | string | '' | Headline of the menu |
29
- | `borderTop` | boolean | true | Has top border |
30
- | `openAsDefault` | boolean | true | defines default state of the menu |
31
-
32
-
33
- ### Slots
34
-
35
- | Name | Description |
36
- |-----------|----------------------------|
37
- | `default` | slot for the menus content |
@@ -1,21 +0,0 @@
1
- import { shallowMount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
-
4
- import UiCollapseNavigation from "./UiCollapseNavigation.vue";
5
-
6
- describe("UiCollapseNavigation", () => {
7
- test("should toggle the menu when the button is clicked", async () => {
8
- const wrapper = shallowMount(UiCollapseNavigation);
9
- const button = wrapper.findComponent({ name: "UiButton" });
10
-
11
- expect(wrapper.vm.openMenu).toBe(true);
12
-
13
- await button.trigger("click");
14
-
15
- expect(wrapper.vm.openMenu).toBe(false);
16
-
17
- await button.trigger("click");
18
-
19
- expect(wrapper.vm.openMenu).toBe(true);
20
- });
21
- });
@@ -1,67 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3-vite";
2
-
3
- import UiButton from "../UiButton/UiButton.vue";
4
-
5
- import UiCollapseNavigation from "./UiCollapseNavigation.vue";
6
-
7
- const meta = {
8
- title: "Ui/UiCollapseNavigation",
9
- component: UiCollapseNavigation,
10
- argTypes: {
11
- headline: {
12
- control: "text",
13
- },
14
- hasBorderTop: {
15
- control: "boolean",
16
- },
17
- openAsDefault: {
18
- control: "boolean",
19
- },
20
- },
21
- args: {
22
- headline: "Gespeicherte Suchen",
23
- hasBorderTop: true,
24
- openAsDefault: true,
25
- },
26
- tags: ["deprecated"],
27
- } satisfies Meta<typeof UiCollapseNavigation>;
28
-
29
- export default meta;
30
- type Story = StoryObj<typeof meta>;
31
-
32
- export const Default: Story = {
33
- render: (args) => ({
34
- setup() {
35
- return { args };
36
- },
37
- components: { UiCollapseNavigation, UiButton },
38
- template: `
39
- <UiCollapseNavigation v-bind='args' >
40
- <UiButton> test eins </UiButton>
41
- <UiButton> test zwei </UiButton>
42
- <UiButton> test drei </UiButton>
43
- </UiCollapseNavigation>
44
- `,
45
- }),
46
- };
47
-
48
- export const MultipleMenus: Story = {
49
- render: (args) => ({
50
- setup() {
51
- return { args };
52
- },
53
- components: { UiCollapseNavigation, UiButton },
54
- template: `
55
- <UiCollapseNavigation headline="Menu eins">
56
- <UiButton> test eins </UiButton>
57
- <UiButton> test zwei </UiButton>
58
- <UiButton> test drei </UiButton>
59
- </UiCollapseNavigation>
60
- <UiCollapseNavigation headline="Menu zwei">
61
- <UiButton> test vier </UiButton>
62
- <UiButton> test fünf </UiButton>
63
- <UiButton> test sechs </UiButton>
64
- </UiCollapseNavigation>
65
- `,
66
- }),
67
- };
@@ -1,79 +0,0 @@
1
- <template>
2
- <div :class="hasBorderTop ? 'border-t border-t-neutral-faint' : ''" />
3
- <UiButton
4
- appearance="outline-emphasis"
5
- class="flex w-full justify-between border-none"
6
- @click="toggleMenuHandler"
7
- >
8
- <h3
9
- class="text-xs font-semibold tracking-widest text-neutral-subtle uppercase"
10
- >
11
- {{ headline }}
12
- </h3>
13
- <UiIcon
14
- name="chevron-down"
15
- class="rounded-full text-neutral-subtle transition-transform duration-500 hover:bg-neutral-faint"
16
- :class="{ 'rotate-180': openMenu }"
17
- />
18
- </UiButton>
19
- <transition
20
- enter-active-class="duration-200"
21
- enter-from-class="transform -translate-y-[20px] opacity-0"
22
- enter-to-class="transform translate-y-0 opacity-1"
23
- leave-active-class="duration-200"
24
- leave-from-class="transform translate-y-0 opacity-1"
25
- leave-to-class="transform -translate-y-[20px] opacity-0"
26
- >
27
- <div v-if="openMenu">
28
- <slot />
29
- </div>
30
- </transition>
31
- </template>
32
- <script lang="ts">
33
- /**
34
- * @deprecated
35
- * Please replace with your own component
36
- */
37
- export default {
38
- name: "UiCollapseNavigation",
39
- };
40
- </script>
41
- <script setup lang="ts">
42
- import { onMounted, ref, watchEffect } from "vue";
43
-
44
- import UiButton from "../UiButton/UiButton.vue";
45
- import UiIcon from "../UiIcon/UiIcon.vue";
46
-
47
- const props = withDefaults(
48
- defineProps<{
49
- headline?: string;
50
- hasBorderTop?: boolean;
51
- openAsDefault?: boolean;
52
- }>(),
53
- {
54
- headline: "",
55
- hasBorderTop: true,
56
- openAsDefault: true,
57
- },
58
- );
59
-
60
- const openMenu = ref();
61
-
62
- watchEffect(() => {
63
- openMenu.value = props.openAsDefault;
64
- });
65
-
66
- const toggleMenuHandler = () => {
67
- openMenu.value = !openMenu.value;
68
- };
69
-
70
- onMounted(() => {
71
- if (window.location.origin.includes("local")) {
72
- // eslint-disable-next-line no-console
73
- console.warn(
74
- "Component is deprecated. It will be removed in a future update.",
75
- );
76
- }
77
- });
78
- defineExpose({ openMenu });
79
- </script>
@@ -1,38 +0,0 @@
1
- # @deprecated
2
- Component will be removed in a future update
3
- # @dpa-shared-components/UiOverlay
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- SomeComponent.vue using UiOverlay -->
9
- <template>
10
- <UiOverlay>
11
- <div class='grid place-items-center'>
12
- <span class='text-neutral'>Here is a Overlay</span>
13
- </div>
14
- </UiOverlay>
15
- </template>
16
-
17
- <script setup lang="ts">
18
- import {UiOverlay} from "@dpa-id-components/dpa-shared-components";
19
- </script>
20
- ```
21
-
22
- ## API
23
-
24
- ### Props
25
-
26
- This component has no properties
27
-
28
- ### Events
29
-
30
- | Name | Type | Description |
31
- |---------|--------------|------------------------------------|
32
- | `close` | none | Emitted when the Overlay is closed |
33
-
34
- ### Slots
35
-
36
- | Name | Description |
37
- |-----------|----------------------------------------------|
38
- | `default` | slot for the rendering the overlay's content |
@@ -1,16 +0,0 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
-
4
- import UiOverlay from "./UiOverlay.vue";
5
-
6
- describe("UiOverlay", () => {
7
- const wrapper = mount(UiOverlay, {});
8
-
9
- test("emits correct event when clicked", async () => {
10
- const bg = wrapper.find('[data-testid="background"]');
11
-
12
- await bg.trigger("click");
13
- await wrapper.vm.$nextTick();
14
- expect(wrapper.emitted().close).toBeTruthy();
15
- });
16
- });
@@ -1,22 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3-vite";
2
-
3
- import UiOverlay from "./UiOverlay.vue";
4
-
5
- const meta = {
6
- title: "Ui/UiOverlay",
7
- component: UiOverlay,
8
- render: (args) => ({
9
- setup() {
10
- return { args };
11
- },
12
- components: { UiOverlay },
13
- template:
14
- "<UiOverlay v-bind='args'><div class='grid place-items-center'><span class='text-neutral'>Here is a Overlay</span></div></UiOverlay>",
15
- }),
16
- tags: ["deprecated"],
17
- } satisfies Meta<typeof UiOverlay>;
18
-
19
- export default meta;
20
- type Story = StoryObj<typeof meta>;
21
-
22
- export const Default: Story = {};