@dpa-id-components/dpa-shared-components 22.0.0-next.9 → 22.0.1

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 (143) hide show
  1. package/dist/assets/icons/bot.vue.d.ts +3 -0
  2. package/dist/bot-C103nFwL.js +19 -0
  3. package/dist/components/UiCheckbox/UiCheckbox.vue.d.ts +1 -1
  4. package/dist/components/UiIcon/icons.d.ts +1 -0
  5. package/dist/components/UiInput/UiInput.vue.d.ts +1 -1
  6. package/dist/components/UiMenu/UiMenu.vue.d.ts +1 -1
  7. package/dist/components/index.d.ts +1 -18
  8. package/dist/dpa-shared-components.js +3326 -3978
  9. package/dist/eslint.base.config.js +1 -4
  10. package/dist/src/assets/icons/bot.vue +14 -0
  11. package/dist/src/components/UiChip/UiChip.spec.ts +1 -1
  12. package/dist/src/components/UiChip/UiChip.vue +2 -2
  13. package/dist/src/components/UiDatePicker/UiDatePicker.vue +11 -8
  14. package/dist/src/components/UiDialog/UiDialog.vue +10 -7
  15. package/dist/src/components/UiFilterBadge/UiFilterBadge.stories.ts +1 -3
  16. package/dist/src/components/UiIcon/UiIcon.stories.ts +1 -1
  17. package/dist/src/components/UiIcon/icons.ts +1 -0
  18. package/dist/src/components/UiListItem/README.md +13 -12
  19. package/dist/src/components/UiListItem/UiListItem.stories.ts +0 -26
  20. package/dist/src/components/UiListItem/UiListItem.vue +4 -2
  21. package/dist/src/components/UiMediaTypeIcon/UiMediaTypeIcon.stories.ts +1 -1
  22. package/dist/src/components/UiMenu/UiMenu.stories.ts +85 -2
  23. package/dist/src/components/UiMenu/UiMenu.vue +7 -8
  24. package/dist/src/components/UiSelect/UiSelect.vue +1 -1
  25. package/dist/src/components/index.ts +0 -33
  26. package/dist/src/tailwindPreset.css +70 -62
  27. package/dist/style.css +2 -2
  28. package/dist/tailwindPreset.css +70 -62
  29. package/package.json +22 -22
  30. package/src/assets/icons/bot.vue +14 -0
  31. package/src/components/UiChip/UiChip.vue +2 -2
  32. package/src/components/UiDatePicker/UiDatePicker.vue +11 -8
  33. package/src/components/UiDialog/UiDialog.vue +10 -7
  34. package/src/components/UiIcon/icons.ts +1 -0
  35. package/src/components/UiListItem/README.md +13 -12
  36. package/src/components/UiListItem/UiListItem.vue +4 -2
  37. package/src/components/UiMenu/UiMenu.vue +7 -8
  38. package/src/components/UiSelect/UiSelect.vue +1 -1
  39. package/src/tailwindPreset.css +70 -62
  40. package/dist/components/DpaMediaItem/DpaMediaItem.vue.d.ts +0 -43
  41. package/dist/components/UiButtonGroup/UiButtonGroup.vue.d.ts +0 -7
  42. package/dist/components/UiCard/UiCard.vue.d.ts +0 -7
  43. package/dist/components/UiCheckBoxGroup/UiCheckBoxGroup.vue.d.ts +0 -33
  44. package/dist/components/UiCollapseNavigation/UiCollapseNavigation.vue.d.ts +0 -28
  45. package/dist/components/UiFilterButton/UiFilterButton.vue.d.ts +0 -54
  46. package/dist/components/UiIconButton/UiIconButton.vue.d.ts +0 -30
  47. package/dist/components/UiList/UiList.vue.d.ts +0 -7
  48. package/dist/components/UiMenu/UiMenuItem.vue.d.ts +0 -35
  49. package/dist/components/UiMenu/UiMenuList.vue.d.ts +0 -20
  50. package/dist/components/UiOverlay/UiOverlay.vue.d.ts +0 -18
  51. package/dist/components/UiOverlayMenu/UiOverlayMenu.vue.d.ts +0 -24
  52. package/dist/components/UiRadioInputGroup/UiRadioInputGroup.vue.d.ts +0 -35
  53. package/dist/components/UiSection/UiSection.vue.d.ts +0 -29
  54. package/dist/components/UiSectionDivider/UiSectionDivider.vue.d.ts +0 -16
  55. package/dist/components/UiTextButton/UiTextButton.vue.d.ts +0 -42
  56. package/dist/src/components/DpaMediaItem/DpaMediaItem.spec.ts +0 -123
  57. package/dist/src/components/DpaMediaItem/DpaMediaItem.stories.ts +0 -140
  58. package/dist/src/components/DpaMediaItem/DpaMediaItem.vue +0 -146
  59. package/dist/src/components/DpaMediaItem/README.md +0 -42
  60. package/dist/src/components/UiButtonGroup/README.md +0 -29
  61. package/dist/src/components/UiButtonGroup/UiButtonGroup.spec.ts +0 -16
  62. package/dist/src/components/UiButtonGroup/UiButtonGroup.stories.ts +0 -53
  63. package/dist/src/components/UiButtonGroup/UiButtonGroup.vue +0 -29
  64. package/dist/src/components/UiCard/README.md +0 -32
  65. package/dist/src/components/UiCard/UiCard.spec.ts +0 -16
  66. package/dist/src/components/UiCard/UiCard.stories.ts +0 -30
  67. package/dist/src/components/UiCard/UiCard.vue +0 -28
  68. package/dist/src/components/UiCheckBoxGroup/README.md +0 -35
  69. package/dist/src/components/UiCheckBoxGroup/UiCheckBoxGroup.spec.ts +0 -70
  70. package/dist/src/components/UiCheckBoxGroup/UiCheckBoxGroup.stories.ts +0 -59
  71. package/dist/src/components/UiCheckBoxGroup/UiCheckBoxGroup.vue +0 -106
  72. package/dist/src/components/UiCollapseNavigation/README.md +0 -37
  73. package/dist/src/components/UiCollapseNavigation/UiCollapseNavigation.spec.ts +0 -21
  74. package/dist/src/components/UiCollapseNavigation/UiCollapseNavigation.stories.ts +0 -67
  75. package/dist/src/components/UiCollapseNavigation/UiCollapseNavigation.vue +0 -79
  76. package/dist/src/components/UiFilterButton/README.md +0 -37
  77. package/dist/src/components/UiFilterButton/UiFilterButton.spec.ts +0 -79
  78. package/dist/src/components/UiFilterButton/UiFilterButton.stories.ts +0 -90
  79. package/dist/src/components/UiFilterButton/UiFilterButton.vue +0 -170
  80. package/dist/src/components/UiIconButton/README.md +0 -31
  81. package/dist/src/components/UiIconButton/UiIconButton.spec.ts +0 -78
  82. package/dist/src/components/UiIconButton/UiIconButton.stories.ts +0 -65
  83. package/dist/src/components/UiIconButton/UiIconButton.vue +0 -112
  84. package/dist/src/components/UiList/README.md +0 -31
  85. package/dist/src/components/UiList/UiList.spec.ts +0 -23
  86. package/dist/src/components/UiList/UiList.stories.ts +0 -66
  87. package/dist/src/components/UiList/UiList.vue +0 -29
  88. package/dist/src/components/UiMenu/UiMenuItem.vue +0 -71
  89. package/dist/src/components/UiMenu/UiMenuList.vue +0 -40
  90. package/dist/src/components/UiOverlay/README.md +0 -38
  91. package/dist/src/components/UiOverlay/UiOverlay.spec.ts +0 -16
  92. package/dist/src/components/UiOverlay/UiOverlay.stories.ts +0 -22
  93. package/dist/src/components/UiOverlay/UiOverlay.vue +0 -36
  94. package/dist/src/components/UiOverlayMenu/README.md +0 -40
  95. package/dist/src/components/UiOverlayMenu/UiOverlayMenu.spec.ts +0 -33
  96. package/dist/src/components/UiOverlayMenu/UiOverlayMenu.stories.ts +0 -40
  97. package/dist/src/components/UiOverlayMenu/UiOverlayMenu.vue +0 -51
  98. package/dist/src/components/UiRadioInputGroup/README.md +0 -51
  99. package/dist/src/components/UiRadioInputGroup/UiRadioInputGroup.spec.ts +0 -66
  100. package/dist/src/components/UiRadioInputGroup/UiRadioInputGroup.stories.ts +0 -45
  101. package/dist/src/components/UiRadioInputGroup/UiRadioInputGroup.vue +0 -76
  102. package/dist/src/components/UiSection/README.md +0 -33
  103. package/dist/src/components/UiSection/UiSection.spec.ts +0 -49
  104. package/dist/src/components/UiSection/UiSection.stories.ts +0 -61
  105. package/dist/src/components/UiSection/UiSection.vue +0 -63
  106. package/dist/src/components/UiSectionDivider/README.md +0 -29
  107. package/dist/src/components/UiSectionDivider/UiSectionDivider.spec.ts +0 -19
  108. package/dist/src/components/UiSectionDivider/UiSectionDivider.stories.ts +0 -49
  109. package/dist/src/components/UiSectionDivider/UiSectionDivider.vue +0 -44
  110. package/dist/src/components/UiTextButton/README.md +0 -41
  111. package/dist/src/components/UiTextButton/UiTextButton.spec.ts +0 -99
  112. package/dist/src/components/UiTextButton/UiTextButton.stories.ts +0 -62
  113. package/dist/src/components/UiTextButton/UiTextButton.vue +0 -173
  114. package/src/components/DpaMediaItem/DpaMediaItem.vue +0 -146
  115. package/src/components/DpaMediaItem/README.md +0 -42
  116. package/src/components/UiButtonGroup/README.md +0 -29
  117. package/src/components/UiButtonGroup/UiButtonGroup.vue +0 -29
  118. package/src/components/UiCard/README.md +0 -32
  119. package/src/components/UiCard/UiCard.vue +0 -28
  120. package/src/components/UiCheckBoxGroup/README.md +0 -35
  121. package/src/components/UiCheckBoxGroup/UiCheckBoxGroup.vue +0 -106
  122. package/src/components/UiCollapseNavigation/README.md +0 -37
  123. package/src/components/UiCollapseNavigation/UiCollapseNavigation.vue +0 -79
  124. package/src/components/UiFilterButton/README.md +0 -37
  125. package/src/components/UiFilterButton/UiFilterButton.vue +0 -170
  126. package/src/components/UiIconButton/README.md +0 -31
  127. package/src/components/UiIconButton/UiIconButton.vue +0 -112
  128. package/src/components/UiList/README.md +0 -31
  129. package/src/components/UiList/UiList.vue +0 -29
  130. package/src/components/UiMenu/UiMenuItem.vue +0 -71
  131. package/src/components/UiMenu/UiMenuList.vue +0 -40
  132. package/src/components/UiOverlay/README.md +0 -38
  133. package/src/components/UiOverlay/UiOverlay.vue +0 -36
  134. package/src/components/UiOverlayMenu/README.md +0 -40
  135. package/src/components/UiOverlayMenu/UiOverlayMenu.vue +0 -51
  136. package/src/components/UiRadioInputGroup/README.md +0 -51
  137. package/src/components/UiRadioInputGroup/UiRadioInputGroup.vue +0 -76
  138. package/src/components/UiSection/README.md +0 -33
  139. package/src/components/UiSection/UiSection.vue +0 -63
  140. package/src/components/UiSectionDivider/README.md +0 -29
  141. package/src/components/UiSectionDivider/UiSectionDivider.vue +0 -44
  142. package/src/components/UiTextButton/README.md +0 -41
  143. package/src/components/UiTextButton/UiTextButton.vue +0 -173
@@ -1,71 +0,0 @@
1
- <template>
2
- <UiListItem
3
- :selectable="listVariant === 'selectable'"
4
- :check-box-menu="listVariant === 'checkbox'"
5
- :icon-size="iconSize"
6
- :image-shape="imageShape"
7
- :checkbox-size="checkboxSize"
8
- :checkbox-appearance="checkboxAppearance"
9
- :class="cn('hover:bg-neutral-whisper focus:bg-neutral-faint', $props.class)"
10
- v-bind="{
11
- ...(props.option
12
- ? {
13
- selected: props.option.selected,
14
- isChecked: props.option.selected,
15
- imageSrc: props.option.imageSrc,
16
- }
17
- : {}),
18
- }"
19
- >
20
- <slot :option="option" />
21
- </UiListItem>
22
- </template>
23
-
24
- <script lang="ts">
25
- /**
26
- * @deprecated Use `UiListItem` instead.
27
- */
28
- export default {
29
- name: "UiMenuItem",
30
- setup() {
31
- onMounted(() => {
32
- if (window.location.origin.includes("local")) {
33
- // eslint-disable-next-line no-console
34
- console.warn(
35
- "Component is deprecated. It will be removed in a future update.",
36
- );
37
- }
38
- });
39
- },
40
- };
41
- </script>
42
-
43
- <script setup lang="ts" generic="Value">
44
- import { type HTMLAttributes, onMounted } from "vue";
45
-
46
- import { cn } from "../../utils/cn.ts";
47
- import UiListItem from "../UiListItem/UiListItem.vue";
48
-
49
- import type { UiMenuOptionType } from "./UiMenu.vue";
50
-
51
- const props = withDefaults(
52
- defineProps<{
53
- class?: HTMLAttributes["class"];
54
- option?: UiMenuOptionType<Value>;
55
- listVariant?: "checkbox" | "selectable" | "blank";
56
- iconSize?: "sm" | "md" | "lg";
57
- imageShape?: "rounded" | "square";
58
- checkboxSize?: "sm" | "md";
59
- checkboxAppearance?: "primary" | "secondary";
60
- }>(),
61
- {
62
- class: undefined,
63
- option: undefined,
64
- checkboxAppearance: "primary",
65
- checkboxSize: "md",
66
- iconSize: "sm",
67
- imageShape: "square",
68
- listVariant: "blank",
69
- },
70
- );
71
- </script>
@@ -1,40 +0,0 @@
1
- <template>
2
- <ul :class="cn('max-h-80 overflow-y-auto', $props.class)" tabindex="0">
3
- <slot />
4
- </ul>
5
- </template>
6
-
7
- <script lang="ts">
8
- /**
9
- * @deprecated
10
- * Please replace with your own component
11
- */
12
- export default {
13
- name: "UiMenuList",
14
- setup() {
15
- onMounted(() => {
16
- if (window.location.origin.includes("local")) {
17
- // eslint-disable-next-line no-console
18
- console.warn(
19
- "Component is deprecated. It will be removed in a future update.",
20
- );
21
- }
22
- });
23
- },
24
- };
25
- </script>
26
-
27
- <script lang="ts" setup>
28
- import { onMounted } from "vue";
29
-
30
- import { cn } from "../../utils/cn.ts";
31
-
32
- withDefaults(
33
- defineProps<{
34
- class?: string;
35
- }>(),
36
- {
37
- class: undefined,
38
- },
39
- );
40
- </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 = {};
@@ -1,36 +0,0 @@
1
- <template>
2
- <div class="fixed inset-0 z-50 max-h-screen" role="dialog">
3
- <div
4
- class="fixed inset-0 h-screen bg-black opacity-60"
5
- data-testid="background"
6
- style="z-index: -1"
7
- @click="emit('close')"
8
- />
9
- <slot />
10
- </div>
11
- </template>
12
- <script lang="ts">
13
- /**
14
- * @deprecated
15
- * Please replace with your own component
16
- */
17
- export default {
18
- name: "UiOverlay",
19
- };
20
- </script>
21
- <script setup lang="ts">
22
- import { onMounted } from "vue";
23
-
24
- const emit = defineEmits<{
25
- close: [];
26
- }>();
27
-
28
- onMounted(() => {
29
- if (window.location.origin.includes("local")) {
30
- // eslint-disable-next-line no-console
31
- console.warn(
32
- "Component is deprecated. It will be removed in a future update.",
33
- );
34
- }
35
- });
36
- </script>
@@ -1,40 +0,0 @@
1
- # @deprecated
2
- Component will be removed in a future update
3
- # @dpa-shared-components/UiOverlayMenu
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- SomeComponent.vue using UiOverlay -->
9
- <template>
10
- <UiOverlayMenu :is-open="true">
11
- <div class='grid place-items-center'>
12
- <span class='text-neutral'>Here is Content</span>
13
- </div>
14
- </UiOverlayMenu>
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
- | Name | Type | Default | Description |
27
- |----------|-----------|---------|--------------------------------------------|
28
- | `isOpen` | `boolean` | `false` | controls if Overlay Menu is open or closed |
29
-
30
- ### Events
31
-
32
- | Name | Type | Description |
33
- |---------|--------------|---------------------------------------------------|
34
- | `close` | none | Emitted when the clicked outside the Overlay Menu |
35
-
36
- ### Slots
37
-
38
- | Name | Description |
39
- |-----------|---------------------------------------------------|
40
- | `default` | slot for the rendering the overlay menu's content |
@@ -1,33 +0,0 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
-
4
- import { vClickAway } from "../../directives/vClickAway.ts";
5
- import UiButton from "../UiButton/UiButton.vue";
6
-
7
- import UiOverlayMenu from "./UiOverlayMenu.vue";
8
-
9
- document.body.innerHTML = `
10
- <div id="app"></div>
11
- `;
12
- describe("UiOverlayMenu", () => {
13
- const overlayWrapper = mount(UiOverlayMenu, {
14
- attachTo: document.getElementById("app") || "#app",
15
- props: {
16
- isOpen: true,
17
- },
18
- global: {
19
- directives: {
20
- clickAway: vClickAway,
21
- },
22
- },
23
- });
24
-
25
- const buttonWrapper = mount(UiButton, {
26
- attachTo: document.getElementById("app") || "#app",
27
- });
28
-
29
- test("emits correct event when clicked outside of slot content", async () => {
30
- await buttonWrapper.trigger("mousedown");
31
- expect(overlayWrapper.emitted().close).toBeTruthy();
32
- });
33
- });
@@ -1,40 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3-vite";
2
-
3
- import UiList from "../UiList/UiList.vue";
4
- import UiListItem from "../UiListItem/UiListItem.vue";
5
-
6
- import UiOverlayMenu from "./UiOverlayMenu.vue";
7
-
8
- const meta = {
9
- title: "Ui/UiOverlayMenu",
10
- component: UiOverlayMenu,
11
- subcomponents: { UiList, UiListItem },
12
- argTypes: {
13
- isOpen: {
14
- control: "boolean",
15
- },
16
- },
17
- args: {
18
- isOpen: true,
19
- },
20
- render: (args) => ({
21
- setup() {
22
- return { args };
23
- },
24
- components: { UiOverlayMenu, UiList, UiListItem },
25
- template:
26
- "<UiOverlayMenu v-bind='args'>" +
27
- "<UiList>" +
28
- "<UiListItem checkBoxMenu='true'>Test</UiListItem>" +
29
- "<UiListItem checkBoxMenu='true'>Test</UiListItem>" +
30
- "<UiListItem checkBoxMenu='true'>Test</UiListItem>" +
31
- "</UiList>" +
32
- "</UiOverlayMenu>",
33
- }),
34
- tags: ["deprecated"],
35
- } satisfies Meta<typeof UiOverlayMenu>;
36
-
37
- export default meta;
38
- type Story = StoryObj<typeof meta>;
39
-
40
- export const Default: Story = {};
@@ -1,51 +0,0 @@
1
- <template>
2
- <div
3
- v-show="isOpen"
4
- v-click-away="close"
5
- class="relative size-full border-none"
6
- >
7
- <div
8
- class="absolute top-12 right-3 z-10 block border-t bg-neutral px-4 py-3 shadow-lg"
9
- >
10
- <slot />
11
- </div>
12
- </div>
13
- </template>
14
- <script lang="ts">
15
- /**
16
- * @deprecated
17
- * Please replace with your own component
18
- */
19
- export default {
20
- name: "UiOverlayMenu",
21
- };
22
- </script>
23
- <script setup lang="ts">
24
- import { onMounted } from "vue";
25
-
26
- import { vClickAway } from "../../directives/vClickAway.ts";
27
-
28
- withDefaults(
29
- defineProps<{
30
- isOpen?: boolean;
31
- }>(),
32
- {
33
- isOpen: false,
34
- },
35
- );
36
- const emit = defineEmits<{
37
- close: [];
38
- }>();
39
- const close = (): void => {
40
- emit("close");
41
- };
42
-
43
- onMounted(() => {
44
- if (window.location.origin.includes("local")) {
45
- // eslint-disable-next-line no-console
46
- console.warn(
47
- "Component is deprecated. It will be removed in a future update.",
48
- );
49
- }
50
- });
51
- </script>
@@ -1,51 +0,0 @@
1
- # @deprecated
2
- Component will be removed in a future update
3
- # @dpa-id-components/UiRadioInputGroup
4
-
5
- ## Usage
6
-
7
- ```html
8
- <template>
9
- <UiRadioInput
10
- :options="options"
11
- group-name="someName"
12
- v-model="selectedOption"
13
- />
14
- </template>
15
-
16
- <script lang="ts" setup>
17
- import { UiRadioInputGroup } from "@dpa-id-components/dpa-shared-components";
18
-
19
- const selectedOption = ref("first option");
20
- const options = computed(() => {
21
- return [
22
- {
23
- value: "first option",
24
- label: "First option",
25
- selected: selectedOption.value === "first option",
26
- },
27
- {
28
- value: "second option",
29
- label: "Second option",
30
- selected: selectedOption.value === "second option",
31
- },
32
- ];
33
- });
34
- </script>
35
- ```
36
-
37
- ### Props
38
-
39
- | Name | Type | Default | Description |
40
- | ------------ | ---------------------- | -------- | ---------------------------------------------------------------- |
41
- | `options` | `Array` | -- | Array with RadioMenu specific content |
42
- | `groupName` | `String` | -- | common name for Radio Input Group |
43
- | `size` | `String` | `medium` | Sets the `size` attribute of the Radio Inputs |
44
- | `color` | `"blue" &#124; "gray"` | `blue` | Sets the `color` and `background` attributes of the Radio Inputs |
45
- | `disabled` | `Boolean` | `false` | Whether the `Radio Input Group` is disabled |
46
- | `labelClass` | `string` | `` | Custom class for the Radio Label |
47
- | `class` | `string` | `` | Custom class for Wrapper |
48
-
49
- ### Events
50
-
51
- The component uses `v-model` to determine the current selected option, therefor it emits the `update:modelValue` event but it doesn't need to be specified as you should use v-model when used as you can see in the example
@@ -1,66 +0,0 @@
1
- import { mount } from "@vue/test-utils";
2
- import { describe, expect, test } from "vitest";
3
-
4
- import UiRadioInputGroup from "./UiRadioInputGroup.vue";
5
-
6
- describe("UiRadioInputGroup", () => {
7
- test("renders UiRadioInputGroup with props content", () => {
8
- const wrapper = mount(UiRadioInputGroup, {
9
- props: {
10
- options: [
11
- {
12
- label: "default name",
13
- selected: false,
14
- value: "default value",
15
- },
16
- ],
17
- groupName: "Options",
18
- },
19
- });
20
- expect(wrapper.text()).toBe("default name");
21
- });
22
-
23
- test("should click change value", async () => {
24
- const wrapper = mount(UiRadioInputGroup, {
25
- props: {
26
- modelValue: "default value",
27
- "onUpdate:modelValue": (e) => wrapper.setProps({ modelValue: e }),
28
- options: [
29
- {
30
- label: "default name",
31
- selected: true,
32
- value: "default value",
33
- },
34
- {
35
- label: "second option",
36
- selected: false,
37
- value: "second option",
38
- },
39
- ],
40
- groupName: "Options",
41
- },
42
- });
43
-
44
- await wrapper.find("input[value='second option']").setValue(true);
45
- expect(wrapper.props("modelValue")).toBe("second option");
46
- });
47
-
48
- test("renders attributes on correct element", () => {
49
- const wrapper = mount(UiRadioInputGroup, {
50
- props: {
51
- options: [],
52
- groupName: "",
53
- id: "id",
54
- class: "testClass gap-8",
55
- "data-testid": "testId",
56
- },
57
- });
58
-
59
- const root = wrapper.find(":first-child");
60
- expect(root.attributes("id")).toBe("id");
61
- expect(root.element.classList.contains("testClass")).toBe(true);
62
- expect(root.element.classList.contains("gap-4")).toBe(false);
63
- expect(root.element.classList.contains("gap-8")).toBe(true);
64
- expect(root.attributes("data-testid")).toBe("testId");
65
- });
66
- });
@@ -1,45 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3-vite";
2
-
3
- import UiRadioInputGroup from "./UiRadioInputGroup.vue";
4
-
5
- const meta = {
6
- title: "forms/UiRadioButtonGroup",
7
- component: UiRadioInputGroup,
8
- args: {
9
- options: [
10
- {
11
- label: "Option A",
12
- value: "value 1",
13
- selected: true,
14
- },
15
- {
16
- label: "Option B",
17
- value: "value 2",
18
- selected: false,
19
- },
20
- {
21
- label: "Option C",
22
- value: "value 3",
23
- selected: false,
24
- },
25
- ],
26
- appearance: "primary",
27
- size: "md",
28
- direction: "horizontal",
29
- disabled: false,
30
- groupName: "default",
31
- },
32
- render: (args) => ({
33
- setup() {
34
- return { args };
35
- },
36
- components: { UiRadioInputGroup },
37
- template: /*html*/ `<UiRadioInputGroup v-bind="args" />`,
38
- }),
39
- tags: ["deprecated"],
40
- } satisfies Meta<typeof UiRadioInputGroup>;
41
-
42
- export default meta;
43
- type Story = StoryObj<typeof meta>;
44
-
45
- export const Default: Story = {};
@@ -1,76 +0,0 @@
1
- <template>
2
- <ul
3
- :class="[
4
- cn(
5
- 'flex gap-4',
6
- {
7
- 'flex-col': direction === 'vertical',
8
- },
9
- $attrs.class,
10
- ),
11
- ]"
12
- >
13
- <li v-for="option in options" :key="option.value">
14
- <UiRadioButton
15
- v-model="model"
16
- :appearance
17
- :disabled
18
- :size
19
- :name="groupName"
20
- :value="option.value"
21
- >
22
- {{ option.label }}
23
- </UiRadioButton>
24
- </li>
25
- </ul>
26
- </template>
27
-
28
- <script lang="ts">
29
- /**
30
- * @deprecated
31
- * Please replace with your own component
32
- */
33
- export default {
34
- name: "UiRadioInputGroup",
35
- };
36
- </script>
37
-
38
- <script setup lang="ts">
39
- import { onMounted } from "vue";
40
-
41
- import { cn } from "../../utils/cn.ts";
42
- import UiRadioButton from "../UiRadioButton/UiRadioButton.vue";
43
-
44
- export interface UiRadioInputGroupOption {
45
- value: string;
46
- label: string;
47
- /** @deprecated has no effect */
48
- selected?: boolean;
49
- }
50
-
51
- const {
52
- options,
53
- direction = "horizontal",
54
- appearance = "primary",
55
- size = "md",
56
- disabled = false,
57
- } = defineProps<{
58
- options: UiRadioInputGroupOption[];
59
- groupName: string;
60
- disabled?: boolean;
61
- direction?: "horizontal" | "vertical";
62
- appearance?: "primary" | "secondary";
63
- size?: "sm" | "md";
64
- }>();
65
-
66
- const model = defineModel<string>();
67
-
68
- onMounted(() => {
69
- if (window.location.origin.includes("local")) {
70
- // eslint-disable-next-line no-console
71
- console.warn(
72
- "Component is deprecated. It will be removed in a future update.",
73
- );
74
- }
75
- });
76
- </script>
@@ -1,33 +0,0 @@
1
- # @deprecated
2
- Component will be removed in a future update
3
- # @dpa-shared-components/UiSection
4
-
5
- ## Usage
6
-
7
- ```html
8
- <!-- SomeComponent.vue using UiSection -->
9
- <template>
10
- <UiSection size="small" vertical-padding="small" border-top border-bottom>Section Content</UiSection>
11
- </template>
12
-
13
- <script>
14
- import {UiSection} from "@dpa-id-components/dpa-shared-components";
15
- </script>
16
- ```
17
-
18
- ## API
19
-
20
- ### Props
21
-
22
- | Name | Type | Default | Description |
23
- |-------------------|----------------------------------------|-----------|-----------------------------------------------|
24
- | `size` | `"wide" &#124; "small"` | `"wide"` | Determines the spread of the section content. |
25
- | `verticalPadding` | `"small" &#124; "large" &#124; "none"` | `"large"` | Determines the padding of the section. |
26
- | `borderTop` | `Boolean` | `false` | Displays a top border on the section. |
27
- | `BorderBottom` | `Boolean` | `false` | Displays a bottom border on the section. |
28
-
29
- ### Slots
30
-
31
- | Name | Description |
32
- |-----------|----------------------------------------------|
33
- | `default` | slot for the rendering the section's content |