@dpa-id-components/dpa-shared-components 22.0.0-next.12 → 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.
- package/dist/assets/icons/bot.vue.d.ts +3 -0
- package/dist/bot-C103nFwL.js +19 -0
- package/dist/components/UiCheckbox/UiCheckbox.vue.d.ts +1 -1
- package/dist/components/UiFilterButton/UiFilterButton.vue.d.ts +1 -1
- package/dist/components/UiIcon/icons.d.ts +1 -0
- package/dist/components/UiInput/UiInput.vue.d.ts +1 -1
- package/dist/components/UiMenu/UiMenu.vue.d.ts +2 -2
- package/dist/components/UiMenu/UiMenuItem.vue.d.ts +1 -1
- package/dist/components/index.d.ts +1 -9
- package/dist/dpa-shared-components.js +1956 -2222
- package/dist/src/assets/icons/bot.vue +14 -0
- package/dist/src/components/UiButtonGroup/UiButtonGroup.vue +1 -1
- package/dist/src/components/UiDatePicker/UiDatePicker.vue +1 -4
- package/dist/src/components/UiDialog/UiDialog.vue +7 -4
- package/dist/src/components/UiIcon/icons.ts +1 -0
- package/dist/src/components/UiIconButton/UiIconButton.vue +1 -2
- package/dist/src/components/UiListItem/README.md +13 -12
- package/dist/src/components/UiListItem/UiListItem.stories.ts +0 -26
- package/dist/src/components/UiListItem/UiListItem.vue +1 -1
- package/dist/src/components/UiMenu/UiMenu.stories.ts +0 -1
- package/dist/src/components/UiMenu/UiMenu.vue +3 -4
- package/dist/src/components/index.ts +0 -16
- package/dist/style.css +2 -2
- package/package.json +11 -11
- package/src/assets/icons/bot.vue +14 -0
- package/src/components/UiButtonGroup/UiButtonGroup.vue +1 -1
- package/src/components/UiDatePicker/UiDatePicker.vue +1 -4
- package/src/components/UiDialog/UiDialog.vue +7 -4
- package/src/components/UiIcon/icons.ts +1 -0
- package/src/components/UiIconButton/UiIconButton.vue +1 -2
- package/src/components/UiListItem/README.md +13 -12
- package/src/components/UiListItem/UiListItem.vue +1 -1
- package/src/components/UiMenu/UiMenu.vue +3 -4
- package/dist/components/DpaMediaItem/DpaMediaItem.vue.d.ts +0 -43
- package/dist/components/UiCard/UiCard.vue.d.ts +0 -7
- package/dist/components/UiCheckBoxGroup/UiCheckBoxGroup.vue.d.ts +0 -33
- package/dist/components/UiCollapseNavigation/UiCollapseNavigation.vue.d.ts +0 -28
- package/dist/components/UiOverlay/UiOverlay.vue.d.ts +0 -18
- package/dist/components/UiOverlayMenu/UiOverlayMenu.vue.d.ts +0 -24
- package/dist/components/UiSection/UiSection.vue.d.ts +0 -29
- package/dist/components/UiSectionDivider/UiSectionDivider.vue.d.ts +0 -16
- package/dist/src/components/DpaMediaItem/DpaMediaItem.spec.ts +0 -123
- package/dist/src/components/DpaMediaItem/DpaMediaItem.stories.ts +0 -140
- package/dist/src/components/DpaMediaItem/DpaMediaItem.vue +0 -146
- package/dist/src/components/DpaMediaItem/README.md +0 -42
- package/dist/src/components/UiCard/README.md +0 -32
- package/dist/src/components/UiCard/UiCard.spec.ts +0 -16
- package/dist/src/components/UiCard/UiCard.stories.ts +0 -30
- package/dist/src/components/UiCard/UiCard.vue +0 -28
- package/dist/src/components/UiCheckBoxGroup/README.md +0 -35
- package/dist/src/components/UiCheckBoxGroup/UiCheckBoxGroup.spec.ts +0 -70
- package/dist/src/components/UiCheckBoxGroup/UiCheckBoxGroup.stories.ts +0 -59
- package/dist/src/components/UiCheckBoxGroup/UiCheckBoxGroup.vue +0 -106
- package/dist/src/components/UiCollapseNavigation/README.md +0 -37
- package/dist/src/components/UiCollapseNavigation/UiCollapseNavigation.spec.ts +0 -21
- package/dist/src/components/UiCollapseNavigation/UiCollapseNavigation.stories.ts +0 -67
- package/dist/src/components/UiCollapseNavigation/UiCollapseNavigation.vue +0 -79
- package/dist/src/components/UiOverlay/README.md +0 -38
- package/dist/src/components/UiOverlay/UiOverlay.spec.ts +0 -16
- package/dist/src/components/UiOverlay/UiOverlay.stories.ts +0 -22
- package/dist/src/components/UiOverlay/UiOverlay.vue +0 -36
- package/dist/src/components/UiOverlayMenu/README.md +0 -40
- package/dist/src/components/UiOverlayMenu/UiOverlayMenu.spec.ts +0 -33
- package/dist/src/components/UiOverlayMenu/UiOverlayMenu.stories.ts +0 -40
- package/dist/src/components/UiOverlayMenu/UiOverlayMenu.vue +0 -51
- package/dist/src/components/UiSection/README.md +0 -33
- package/dist/src/components/UiSection/UiSection.spec.ts +0 -49
- package/dist/src/components/UiSection/UiSection.stories.ts +0 -61
- package/dist/src/components/UiSection/UiSection.vue +0 -63
- package/dist/src/components/UiSectionDivider/README.md +0 -29
- package/dist/src/components/UiSectionDivider/UiSectionDivider.spec.ts +0 -19
- package/dist/src/components/UiSectionDivider/UiSectionDivider.stories.ts +0 -49
- package/dist/src/components/UiSectionDivider/UiSectionDivider.vue +0 -44
- package/src/components/DpaMediaItem/DpaMediaItem.vue +0 -146
- package/src/components/DpaMediaItem/README.md +0 -42
- package/src/components/UiCard/README.md +0 -32
- package/src/components/UiCard/UiCard.vue +0 -28
- package/src/components/UiCheckBoxGroup/README.md +0 -35
- package/src/components/UiCheckBoxGroup/UiCheckBoxGroup.vue +0 -106
- package/src/components/UiCollapseNavigation/README.md +0 -37
- package/src/components/UiCollapseNavigation/UiCollapseNavigation.vue +0 -79
- package/src/components/UiOverlay/README.md +0 -38
- package/src/components/UiOverlay/UiOverlay.vue +0 -36
- package/src/components/UiOverlayMenu/README.md +0 -40
- package/src/components/UiOverlayMenu/UiOverlayMenu.vue +0 -51
- package/src/components/UiSection/README.md +0 -33
- package/src/components/UiSection/UiSection.vue +0 -63
- package/src/components/UiSectionDivider/README.md +0 -29
- package/src/components/UiSectionDivider/UiSectionDivider.vue +0 -44
|
@@ -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,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" | "small"` | `"wide"` | Determines the spread of the section content. |
|
|
25
|
-
| `verticalPadding` | `"small" | "large" | "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 |
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { mount } from "@vue/test-utils";
|
|
2
|
-
import { describe, expect, test } from "vitest";
|
|
3
|
-
|
|
4
|
-
import UiSection from "./UiSection.vue";
|
|
5
|
-
|
|
6
|
-
describe("UiSection", () => {
|
|
7
|
-
const wrapper = mount(UiSection, {
|
|
8
|
-
slots: {
|
|
9
|
-
default: "Slot text",
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
test("renders with slot content", () => {
|
|
14
|
-
const inner = wrapper.find('[data-testid="inner"]');
|
|
15
|
-
|
|
16
|
-
expect(inner.text()).toBe("Slot text");
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
test("renders with border classes", async () => {
|
|
20
|
-
await wrapper.setProps({
|
|
21
|
-
borderTop: true,
|
|
22
|
-
borderBottom: true,
|
|
23
|
-
});
|
|
24
|
-
expect(wrapper.classes("border-t")).toBe(true);
|
|
25
|
-
expect(wrapper.classes("border-b")).toBe(true);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
test("renders with padding classes", async () => {
|
|
29
|
-
await wrapper.setProps({
|
|
30
|
-
verticalPadding: "small",
|
|
31
|
-
});
|
|
32
|
-
const inner = wrapper.find('[data-testid="inner"]');
|
|
33
|
-
|
|
34
|
-
expect(inner.classes("lg:py-12")).toBe(true);
|
|
35
|
-
expect(inner.classes("pt-8")).toBe(true);
|
|
36
|
-
expect(inner.classes("pb-12")).toBe(true);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
test("renders with size classes", async () => {
|
|
40
|
-
await wrapper.setProps({
|
|
41
|
-
size: "small",
|
|
42
|
-
});
|
|
43
|
-
const inner = wrapper.find('[data-testid="inner"]');
|
|
44
|
-
|
|
45
|
-
expect(inner.classes("w-full")).toBe(true);
|
|
46
|
-
expect(inner.classes("lg:mx-auto")).toBe(true);
|
|
47
|
-
expect(inner.classes("lg:w-2/3")).toBe(true);
|
|
48
|
-
});
|
|
49
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/vue3-vite";
|
|
2
|
-
|
|
3
|
-
import UiSection from "./UiSection.vue";
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "Ui/UiSection",
|
|
7
|
-
component: UiSection,
|
|
8
|
-
argTypes: {
|
|
9
|
-
size: {
|
|
10
|
-
control: "select",
|
|
11
|
-
options: ["wide", "small"],
|
|
12
|
-
},
|
|
13
|
-
verticalPadding: {
|
|
14
|
-
control: "select",
|
|
15
|
-
options: ["small", "large", "none"],
|
|
16
|
-
},
|
|
17
|
-
borderTop: {
|
|
18
|
-
control: "boolean",
|
|
19
|
-
},
|
|
20
|
-
borderBottom: {
|
|
21
|
-
control: "boolean",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
args: {
|
|
25
|
-
size: "small",
|
|
26
|
-
verticalPadding: "large",
|
|
27
|
-
borderTop: false,
|
|
28
|
-
borderBottom: false,
|
|
29
|
-
},
|
|
30
|
-
parameters: {
|
|
31
|
-
backgrounds: { default: "gray-100" },
|
|
32
|
-
},
|
|
33
|
-
tags: ["deprecated"],
|
|
34
|
-
} satisfies Meta<typeof UiSection>;
|
|
35
|
-
|
|
36
|
-
export default meta;
|
|
37
|
-
type Story = StoryObj<typeof meta>;
|
|
38
|
-
|
|
39
|
-
export const Default: Story = {
|
|
40
|
-
render: (args) => ({
|
|
41
|
-
setup() {
|
|
42
|
-
return { args };
|
|
43
|
-
},
|
|
44
|
-
components: { UiSection },
|
|
45
|
-
template: "<UiSection v-bind='args'>Slot</UiSection>",
|
|
46
|
-
}),
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const Multiple: Story = {
|
|
50
|
-
render: (args) => ({
|
|
51
|
-
setup() {
|
|
52
|
-
return { args };
|
|
53
|
-
},
|
|
54
|
-
components: { UiSection },
|
|
55
|
-
template:
|
|
56
|
-
"<UiSection v-bind='args'>Slot1</UiSection>" +
|
|
57
|
-
"<UiSection v-bind='args'>Slot2</UiSection>" +
|
|
58
|
-
"<UiSection v-bind='args'>Slot3</UiSection>" +
|
|
59
|
-
"<UiSection v-bind='args'>Slot4</UiSection>",
|
|
60
|
-
}),
|
|
61
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section :class="borderClass" class="w-full border-neutral-pale bg-neutral">
|
|
3
|
-
<div
|
|
4
|
-
:class="[sizeClasses[size], paddingClasses[verticalPadding]]"
|
|
5
|
-
data-testid="inner"
|
|
6
|
-
>
|
|
7
|
-
<slot></slot>
|
|
8
|
-
</div>
|
|
9
|
-
</section>
|
|
10
|
-
</template>
|
|
11
|
-
<script lang="ts">
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated
|
|
14
|
-
* Please replace with your own component
|
|
15
|
-
*/
|
|
16
|
-
export default {
|
|
17
|
-
name: "UiSection",
|
|
18
|
-
};
|
|
19
|
-
</script>
|
|
20
|
-
<script setup lang="ts">
|
|
21
|
-
import { computed, onMounted } from "vue";
|
|
22
|
-
|
|
23
|
-
const props = withDefaults(
|
|
24
|
-
defineProps<{
|
|
25
|
-
size?: "wide" | "small";
|
|
26
|
-
verticalPadding?: "small" | "large" | "none";
|
|
27
|
-
borderTop?: boolean;
|
|
28
|
-
borderBottom?: boolean;
|
|
29
|
-
}>(),
|
|
30
|
-
{
|
|
31
|
-
size: "wide",
|
|
32
|
-
verticalPadding: "large",
|
|
33
|
-
borderTop: false,
|
|
34
|
-
borderBottom: false,
|
|
35
|
-
},
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
const sizeClasses: Record<string, string> = {
|
|
39
|
-
wide: "w-full md:px-28 text-neutral-primary lg:flex",
|
|
40
|
-
small: "w-full lg:mx-auto lg:w-2/3",
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const paddingClasses: Record<string, string> = {
|
|
44
|
-
small: "lg:py-12 pt-8 pb-12",
|
|
45
|
-
large: "py-24",
|
|
46
|
-
none: "py-0",
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const borderClass = computed(() => {
|
|
50
|
-
const borderTopClass = props.borderTop ? "border-t" : "";
|
|
51
|
-
const borderBottomClass = props.borderBottom ? "border-b" : "";
|
|
52
|
-
return `${borderTopClass} ${borderBottomClass}`;
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
onMounted(() => {
|
|
56
|
-
if (window.location.origin.includes("local")) {
|
|
57
|
-
// eslint-disable-next-line no-console
|
|
58
|
-
console.warn(
|
|
59
|
-
"Component is deprecated. It will be removed in a future update.",
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
</script>
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# @deprecated
|
|
2
|
-
Component will be removed in a future update
|
|
3
|
-
# @dpa-shared-components/UiSectionDivider
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
```html
|
|
8
|
-
<!-- SomeComponent.vue using UiSectionDivider -->
|
|
9
|
-
<template>
|
|
10
|
-
<UiSectionDivider></UiSectionDivider>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
import {UiSectionDivider} 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` | `"large" | "small"` | `"large"` | Determines the height. |
|
|
25
|
-
| `customClasses` | `String` | `""` | Custom class string. |
|
|
26
|
-
|
|
27
|
-
### Slots
|
|
28
|
-
|
|
29
|
-
This component has no slot
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { mount } from "@vue/test-utils";
|
|
2
|
-
import { describe, expect, test } from "vitest";
|
|
3
|
-
|
|
4
|
-
import UiSectionDivider from "./UiSectionDivider.vue";
|
|
5
|
-
|
|
6
|
-
describe("UiSectionDivider", () => {
|
|
7
|
-
const wrapper = mount(UiSectionDivider);
|
|
8
|
-
|
|
9
|
-
test("renders default size class", () => {
|
|
10
|
-
expect(wrapper.classes("h-4")).toBe(true);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
test("renders small size class", async () => {
|
|
14
|
-
await wrapper.setProps({
|
|
15
|
-
size: "small",
|
|
16
|
-
});
|
|
17
|
-
expect(wrapper.classes("h-px")).toBe(true);
|
|
18
|
-
});
|
|
19
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/vue3-vite";
|
|
2
|
-
|
|
3
|
-
import UiSection from "../UiSection/UiSection.vue";
|
|
4
|
-
|
|
5
|
-
import UiSectionDivider from "./UiSectionDivider.vue";
|
|
6
|
-
|
|
7
|
-
const meta = {
|
|
8
|
-
title: "Ui/UiSectionDivider",
|
|
9
|
-
component: UiSectionDivider,
|
|
10
|
-
subcomponents: { UiSection },
|
|
11
|
-
argTypes: {
|
|
12
|
-
size: {
|
|
13
|
-
control: "select",
|
|
14
|
-
options: ["large", "small"],
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
args: {
|
|
18
|
-
size: "large",
|
|
19
|
-
},
|
|
20
|
-
tags: ["deprecated"],
|
|
21
|
-
} satisfies Meta<typeof UiSectionDivider>;
|
|
22
|
-
|
|
23
|
-
export default meta;
|
|
24
|
-
type Story = StoryObj<typeof meta>;
|
|
25
|
-
|
|
26
|
-
export const Default: Story = {
|
|
27
|
-
render: (args) => ({
|
|
28
|
-
setup() {
|
|
29
|
-
return { args };
|
|
30
|
-
},
|
|
31
|
-
components: { UiSectionDivider },
|
|
32
|
-
template: "<UiSectionDivider v-bind='args'>Slot</UiSectionDivider>",
|
|
33
|
-
}),
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const WithSection: Story = {
|
|
37
|
-
render: (args) => ({
|
|
38
|
-
setup() {
|
|
39
|
-
return { args };
|
|
40
|
-
},
|
|
41
|
-
components: { UiSectionDivider, UiSection },
|
|
42
|
-
template:
|
|
43
|
-
"<UiSection>Section 1</UiSection>" +
|
|
44
|
-
"<UiSectionDivider v-bind='args'></UiSectionDivider>" +
|
|
45
|
-
"<UiSection>Section 2</UiSection>" +
|
|
46
|
-
"<UiSectionDivider v-bind='args'>Slot4</UiSectionDivider>" +
|
|
47
|
-
"<UiSection>Section 3</UiSection>",
|
|
48
|
-
}),
|
|
49
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="[sizeClass, customClasses]" class="bg-neutral-whisper" />
|
|
3
|
-
</template>
|
|
4
|
-
<script lang="ts">
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated
|
|
7
|
-
* Please replace with your own component
|
|
8
|
-
*/
|
|
9
|
-
export default {
|
|
10
|
-
name: "UiSectionDivider",
|
|
11
|
-
};
|
|
12
|
-
</script>
|
|
13
|
-
<script lang="ts" setup>
|
|
14
|
-
import { computed, onMounted } from "vue";
|
|
15
|
-
|
|
16
|
-
const props = withDefaults(
|
|
17
|
-
defineProps<{
|
|
18
|
-
size?: "small" | "large";
|
|
19
|
-
customClasses?: string[] | string;
|
|
20
|
-
}>(),
|
|
21
|
-
{
|
|
22
|
-
customClasses: "",
|
|
23
|
-
size: "large",
|
|
24
|
-
},
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
const sizeClasses: Record<string, string> = {
|
|
28
|
-
small: "h-px",
|
|
29
|
-
large: "h-4",
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const sizeClass = computed(() => {
|
|
33
|
-
return sizeClasses[props.size];
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
onMounted(() => {
|
|
37
|
-
if (window.location.origin.includes("local")) {
|
|
38
|
-
// eslint-disable-next-line no-console
|
|
39
|
-
console.warn(
|
|
40
|
-
"Component is deprecated. It will be removed in a future update.",
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
</script>
|