@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.
- 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/UiIcon/icons.d.ts +1 -0
- package/dist/components/UiInput/UiInput.vue.d.ts +1 -1
- package/dist/components/UiMenu/UiMenu.vue.d.ts +1 -1
- package/dist/components/index.d.ts +1 -18
- package/dist/dpa-shared-components.js +3326 -3978
- package/dist/eslint.base.config.js +1 -4
- package/dist/src/assets/icons/bot.vue +14 -0
- package/dist/src/components/UiChip/UiChip.spec.ts +1 -1
- package/dist/src/components/UiChip/UiChip.vue +2 -2
- package/dist/src/components/UiDatePicker/UiDatePicker.vue +11 -8
- package/dist/src/components/UiDialog/UiDialog.vue +10 -7
- package/dist/src/components/UiFilterBadge/UiFilterBadge.stories.ts +1 -3
- package/dist/src/components/UiIcon/UiIcon.stories.ts +1 -1
- package/dist/src/components/UiIcon/icons.ts +1 -0
- 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 +4 -2
- package/dist/src/components/UiMediaTypeIcon/UiMediaTypeIcon.stories.ts +1 -1
- package/dist/src/components/UiMenu/UiMenu.stories.ts +85 -2
- package/dist/src/components/UiMenu/UiMenu.vue +7 -8
- package/dist/src/components/UiSelect/UiSelect.vue +1 -1
- package/dist/src/components/index.ts +0 -33
- package/dist/src/tailwindPreset.css +70 -62
- package/dist/style.css +2 -2
- package/dist/tailwindPreset.css +70 -62
- package/package.json +22 -22
- package/src/assets/icons/bot.vue +14 -0
- package/src/components/UiChip/UiChip.vue +2 -2
- package/src/components/UiDatePicker/UiDatePicker.vue +11 -8
- package/src/components/UiDialog/UiDialog.vue +10 -7
- package/src/components/UiIcon/icons.ts +1 -0
- package/src/components/UiListItem/README.md +13 -12
- package/src/components/UiListItem/UiListItem.vue +4 -2
- package/src/components/UiMenu/UiMenu.vue +7 -8
- package/src/components/UiSelect/UiSelect.vue +1 -1
- package/src/tailwindPreset.css +70 -62
- package/dist/components/DpaMediaItem/DpaMediaItem.vue.d.ts +0 -43
- package/dist/components/UiButtonGroup/UiButtonGroup.vue.d.ts +0 -7
- 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/UiFilterButton/UiFilterButton.vue.d.ts +0 -54
- package/dist/components/UiIconButton/UiIconButton.vue.d.ts +0 -30
- package/dist/components/UiList/UiList.vue.d.ts +0 -7
- package/dist/components/UiMenu/UiMenuItem.vue.d.ts +0 -35
- package/dist/components/UiMenu/UiMenuList.vue.d.ts +0 -20
- package/dist/components/UiOverlay/UiOverlay.vue.d.ts +0 -18
- package/dist/components/UiOverlayMenu/UiOverlayMenu.vue.d.ts +0 -24
- package/dist/components/UiRadioInputGroup/UiRadioInputGroup.vue.d.ts +0 -35
- package/dist/components/UiSection/UiSection.vue.d.ts +0 -29
- package/dist/components/UiSectionDivider/UiSectionDivider.vue.d.ts +0 -16
- package/dist/components/UiTextButton/UiTextButton.vue.d.ts +0 -42
- 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/UiButtonGroup/README.md +0 -29
- package/dist/src/components/UiButtonGroup/UiButtonGroup.spec.ts +0 -16
- package/dist/src/components/UiButtonGroup/UiButtonGroup.stories.ts +0 -53
- package/dist/src/components/UiButtonGroup/UiButtonGroup.vue +0 -29
- 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/UiFilterButton/README.md +0 -37
- package/dist/src/components/UiFilterButton/UiFilterButton.spec.ts +0 -79
- package/dist/src/components/UiFilterButton/UiFilterButton.stories.ts +0 -90
- package/dist/src/components/UiFilterButton/UiFilterButton.vue +0 -170
- package/dist/src/components/UiIconButton/README.md +0 -31
- package/dist/src/components/UiIconButton/UiIconButton.spec.ts +0 -78
- package/dist/src/components/UiIconButton/UiIconButton.stories.ts +0 -65
- package/dist/src/components/UiIconButton/UiIconButton.vue +0 -112
- package/dist/src/components/UiList/README.md +0 -31
- package/dist/src/components/UiList/UiList.spec.ts +0 -23
- package/dist/src/components/UiList/UiList.stories.ts +0 -66
- package/dist/src/components/UiList/UiList.vue +0 -29
- package/dist/src/components/UiMenu/UiMenuItem.vue +0 -71
- package/dist/src/components/UiMenu/UiMenuList.vue +0 -40
- 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/UiRadioInputGroup/README.md +0 -51
- package/dist/src/components/UiRadioInputGroup/UiRadioInputGroup.spec.ts +0 -66
- package/dist/src/components/UiRadioInputGroup/UiRadioInputGroup.stories.ts +0 -45
- package/dist/src/components/UiRadioInputGroup/UiRadioInputGroup.vue +0 -76
- 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/dist/src/components/UiTextButton/README.md +0 -41
- package/dist/src/components/UiTextButton/UiTextButton.spec.ts +0 -99
- package/dist/src/components/UiTextButton/UiTextButton.stories.ts +0 -62
- package/dist/src/components/UiTextButton/UiTextButton.vue +0 -173
- package/src/components/DpaMediaItem/DpaMediaItem.vue +0 -146
- package/src/components/DpaMediaItem/README.md +0 -42
- package/src/components/UiButtonGroup/README.md +0 -29
- package/src/components/UiButtonGroup/UiButtonGroup.vue +0 -29
- 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/UiFilterButton/README.md +0 -37
- package/src/components/UiFilterButton/UiFilterButton.vue +0 -170
- package/src/components/UiIconButton/README.md +0 -31
- package/src/components/UiIconButton/UiIconButton.vue +0 -112
- package/src/components/UiList/README.md +0 -31
- package/src/components/UiList/UiList.vue +0 -29
- package/src/components/UiMenu/UiMenuItem.vue +0 -71
- package/src/components/UiMenu/UiMenuList.vue +0 -40
- 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/UiRadioInputGroup/README.md +0 -51
- package/src/components/UiRadioInputGroup/UiRadioInputGroup.vue +0 -76
- 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
- package/src/components/UiTextButton/README.md +0 -41
- package/src/components/UiTextButton/UiTextButton.vue +0 -173
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="
|
|
4
|
-
cn(
|
|
5
|
-
'w-full px-3',
|
|
6
|
-
$attrs.class,
|
|
7
|
-
'flex cursor-pointer items-center rounded-full select-none',
|
|
8
|
-
variantClasses,
|
|
9
|
-
buttonWidth === 'full' ? 'w-full' : 'max-w-max',
|
|
10
|
-
props.size === 'xs' ? 'py-0.5' : 'py-1.5',
|
|
11
|
-
)
|
|
12
|
-
"
|
|
13
|
-
@click="onClick"
|
|
14
|
-
>
|
|
15
|
-
<button
|
|
16
|
-
class="w-full rounded-full focus:outline-hidden focus-visible:focus-outline"
|
|
17
|
-
:disabled="disabled"
|
|
18
|
-
type="button"
|
|
19
|
-
data-testid="filter-button"
|
|
20
|
-
>
|
|
21
|
-
<span
|
|
22
|
-
data-testid="filterbutton-title"
|
|
23
|
-
class="flex w-full items-center justify-between text-left text-sm/normal font-medium"
|
|
24
|
-
:class="`${textColorClass} ${props.size === 'xs' ? 'text-xs' : 'text-sm'}`"
|
|
25
|
-
>
|
|
26
|
-
<UiIcon
|
|
27
|
-
v-if="hasIcon && iconLeft"
|
|
28
|
-
:name="iconLeft"
|
|
29
|
-
:size="iconSize"
|
|
30
|
-
class="flex-none"
|
|
31
|
-
:class="
|
|
32
|
-
cn(
|
|
33
|
-
{
|
|
34
|
-
'mr-2': title.length !== 0,
|
|
35
|
-
},
|
|
36
|
-
iconLeftClass,
|
|
37
|
-
)
|
|
38
|
-
"
|
|
39
|
-
/>
|
|
40
|
-
<span class="w-full grow truncate">
|
|
41
|
-
{{ title }}
|
|
42
|
-
</span>
|
|
43
|
-
<UiIcon
|
|
44
|
-
v-if="hasIcon"
|
|
45
|
-
:name="chevronIcon"
|
|
46
|
-
:class="
|
|
47
|
-
cn(
|
|
48
|
-
{
|
|
49
|
-
'origin-center rotate-180': rotateIcon,
|
|
50
|
-
'ml-2': title.length !== 0,
|
|
51
|
-
},
|
|
52
|
-
iconRightClass,
|
|
53
|
-
)
|
|
54
|
-
"
|
|
55
|
-
:size="iconSize"
|
|
56
|
-
class="flex-none"
|
|
57
|
-
/>
|
|
58
|
-
</span>
|
|
59
|
-
</button>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
|
|
63
|
-
<script lang="ts">
|
|
64
|
-
/**
|
|
65
|
-
* @deprecated Use `UiButton` instead
|
|
66
|
-
*/
|
|
67
|
-
export default {
|
|
68
|
-
name: "UiFilterButton",
|
|
69
|
-
};
|
|
70
|
-
</script>
|
|
71
|
-
|
|
72
|
-
<script setup lang="ts">
|
|
73
|
-
import type { ClassValue } from "clsx";
|
|
74
|
-
import { computed } from "vue";
|
|
75
|
-
|
|
76
|
-
import { cn } from "../../utils/cn.ts";
|
|
77
|
-
import UiIcon, { type UiIconName } from "../UiIcon/UiIcon.vue";
|
|
78
|
-
|
|
79
|
-
const emit = defineEmits<{
|
|
80
|
-
click: [];
|
|
81
|
-
}>();
|
|
82
|
-
|
|
83
|
-
const props = withDefaults(
|
|
84
|
-
defineProps<{
|
|
85
|
-
title?: string;
|
|
86
|
-
variant?:
|
|
87
|
-
| "blue-rounded"
|
|
88
|
-
| "white-rounded"
|
|
89
|
-
| "transparent-rounded"
|
|
90
|
-
| "blank"
|
|
91
|
-
| "blue-blank";
|
|
92
|
-
buttonWidth?: "full" | "max";
|
|
93
|
-
chevronIcon?: UiIconName;
|
|
94
|
-
rotateIcon?: boolean;
|
|
95
|
-
iconSize?: "xs" | "sm" | "lg";
|
|
96
|
-
size?: "xs" | "small";
|
|
97
|
-
disabled?: boolean;
|
|
98
|
-
active?: boolean;
|
|
99
|
-
hasIcon?: boolean;
|
|
100
|
-
iconLeft?: UiIconName;
|
|
101
|
-
iconLeftClass?: ClassValue | ClassValue[];
|
|
102
|
-
iconRightClass?: ClassValue | ClassValue[];
|
|
103
|
-
}>(),
|
|
104
|
-
{
|
|
105
|
-
title: "",
|
|
106
|
-
variant: "white-rounded",
|
|
107
|
-
buttonWidth: "max",
|
|
108
|
-
chevronIcon: "chevron-down",
|
|
109
|
-
rotateIcon: false,
|
|
110
|
-
iconSize: "xs",
|
|
111
|
-
size: "small",
|
|
112
|
-
disabled: false,
|
|
113
|
-
active: false,
|
|
114
|
-
hasIcon: true,
|
|
115
|
-
iconLeft: undefined,
|
|
116
|
-
iconLeftClass: undefined,
|
|
117
|
-
iconRightClass: undefined,
|
|
118
|
-
},
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
const variants = {
|
|
122
|
-
"blue-rounded": "bg-primary hover:bg-primary-dark",
|
|
123
|
-
"white-rounded":
|
|
124
|
-
"bg-neutral hover:border-neutral-subtle border border-neutral-soft",
|
|
125
|
-
blank: "bg-transparent hover:bg-neutral-faint",
|
|
126
|
-
"blue-blank": "bg-transparent hover:bg-neutral-faint",
|
|
127
|
-
"transparent-rounded":
|
|
128
|
-
"bg-transparent border border-neutral-soft hover:border-neutral-subtle",
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const textColors = {
|
|
132
|
-
"blue-rounded": "text-neutral",
|
|
133
|
-
"white-rounded": "text-neutral-emphasis hover:text-neutral-primary",
|
|
134
|
-
blank: "text-neutral-emphasis hover:text-neutral-primary",
|
|
135
|
-
"blue-blank": "text-primary hover:text-primary-dark",
|
|
136
|
-
"transparent-rounded": "text-neutral-emphasis",
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const variantClasses = computed(() => {
|
|
140
|
-
if (props.disabled) {
|
|
141
|
-
if (props.variant === "blank") {
|
|
142
|
-
return "border border-transparent";
|
|
143
|
-
}
|
|
144
|
-
return "bg-neutral border border-neutral-soft";
|
|
145
|
-
}
|
|
146
|
-
if (props.active) {
|
|
147
|
-
if (variants[props.variant as keyof typeof variants].includes("border")) {
|
|
148
|
-
return "bg-primary hover:bg-primary-dark border border-primary hover:border-primary-dark";
|
|
149
|
-
}
|
|
150
|
-
return "bg-primary hover:bg-primary-dark";
|
|
151
|
-
}
|
|
152
|
-
return variants[props.variant as keyof typeof variants];
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
const textColorClass = computed(() => {
|
|
156
|
-
if (props.disabled) {
|
|
157
|
-
return "text-neutral-soft";
|
|
158
|
-
}
|
|
159
|
-
if (props.active) {
|
|
160
|
-
return "text-neutral";
|
|
161
|
-
}
|
|
162
|
-
return textColors[props.variant as keyof typeof textColors];
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
const onClick = () => {
|
|
166
|
-
if (!props.disabled) {
|
|
167
|
-
emit("click");
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
</script>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# @dpa-shared-components/UiIconButton
|
|
2
|
-
|
|
3
|
-
## Usage
|
|
4
|
-
|
|
5
|
-
Color is set by text color:
|
|
6
|
-
|
|
7
|
-
```html
|
|
8
|
-
<!-- SomeComponent.vue using UiIconButton -->
|
|
9
|
-
<template>
|
|
10
|
-
<UiIconButtonIcon iconName="alert"></UiIconButtonIcon>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
import { UiIconButton } from "@dpa-id-components/dpa-shared-components";
|
|
15
|
-
</script>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## API
|
|
19
|
-
|
|
20
|
-
### Props
|
|
21
|
-
|
|
22
|
-
| Name | Type | Default | Description |
|
|
23
|
-
|-------------------|------------------------------------------------------|----------|---------------------------------------------------------------------------------------|
|
|
24
|
-
| `iconName` | `UiIconName` | required | Sets the `name`, which determines which svg is used as icon. |
|
|
25
|
-
| `size` | `"small" | "medium" | "large" | "xl"` | `large` | Sets the `size` attribute of the iconButton. |
|
|
26
|
-
| `backgroundColor` | `"blue" | "none" "gray-hover"` | `blue` | Sets the `color` of the button background including hover, active and disable states. |
|
|
27
|
-
| `iconColor` | `"blue" | "white" | "gray` | `white` | Sets the `color` of the button icon including hover, active and disable states. |
|
|
28
|
-
| `disabled` | `boolean` | `false` | Disables the button. |
|
|
29
|
-
| `title` | `string` | `""` | Sets the aria label of the button. |
|
|
30
|
-
|
|
31
|
-
### Slots
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<button
|
|
3
|
-
:disabled="disabled"
|
|
4
|
-
:aria-label="title"
|
|
5
|
-
class="group flex flex-none items-center justify-center rounded-full focus:outline-hidden focus-visible:focus-outline"
|
|
6
|
-
:class="[colorClass, backgroundClass, buttonSizeClass]"
|
|
7
|
-
type="button"
|
|
8
|
-
@click="($event) => emit('click', $event)"
|
|
9
|
-
>
|
|
10
|
-
<UiIcon
|
|
11
|
-
class="flex items-center justify-center"
|
|
12
|
-
:name="iconName"
|
|
13
|
-
:size="iconSize"
|
|
14
|
-
/>
|
|
15
|
-
</button>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script lang="ts">
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated Use `UiButton` instead
|
|
21
|
-
*/
|
|
22
|
-
export default {
|
|
23
|
-
name: "UiIconButton",
|
|
24
|
-
};
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<script lang="ts" setup>
|
|
28
|
-
import { computed, onMounted } from "vue";
|
|
29
|
-
|
|
30
|
-
import UiIcon, { type UiIconName } from "../UiIcon/UiIcon.vue";
|
|
31
|
-
|
|
32
|
-
const emit = defineEmits<{
|
|
33
|
-
click: [MouseEvent];
|
|
34
|
-
}>();
|
|
35
|
-
|
|
36
|
-
const props = withDefaults(
|
|
37
|
-
defineProps<{
|
|
38
|
-
iconName: UiIconName;
|
|
39
|
-
title: string;
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
backgroundColor?: "blue" | "none" | "gray-hover";
|
|
42
|
-
iconColor?: "blue" | "gray" | "white";
|
|
43
|
-
size?: "small" | "medium" | "large" | "xl";
|
|
44
|
-
}>(),
|
|
45
|
-
{
|
|
46
|
-
disabled: false,
|
|
47
|
-
backgroundColor: "blue",
|
|
48
|
-
iconColor: "white",
|
|
49
|
-
size: "small",
|
|
50
|
-
},
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
const backgroundColorVariants = {
|
|
54
|
-
blue: "hover:bg-primary-dark active:bg-primary-dark bg-primary disabled:bg-neutral-faint disabled:hover:bg-none",
|
|
55
|
-
none: "hover:bg-neutral-whisper active:bg-primary disabled:hover:bg-transparent",
|
|
56
|
-
"gray-hover": "hover:bg-neutral-faint disabled:hover:bg-none",
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const iconColorVariants = {
|
|
60
|
-
blue: "text-primary hover:text-primary-dark disabled:text-neutral-soft active:text-neutral",
|
|
61
|
-
gray: "text-neutral-emphasis hover:text-neutral-primary active:text-neutral-primary disabled:text-neutral-soft",
|
|
62
|
-
white: "text-neutral disabled:text-neutral-soft",
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const sizeVariants = {
|
|
66
|
-
small: {
|
|
67
|
-
iconSize: "small",
|
|
68
|
-
buttonSize: "h-6 w-6",
|
|
69
|
-
},
|
|
70
|
-
medium: {
|
|
71
|
-
iconSize: "large",
|
|
72
|
-
buttonSize: "h-8 w-8",
|
|
73
|
-
},
|
|
74
|
-
large: {
|
|
75
|
-
iconSize: "large",
|
|
76
|
-
buttonSize: "h-12 w-12",
|
|
77
|
-
},
|
|
78
|
-
xl: {
|
|
79
|
-
iconSize: "large",
|
|
80
|
-
buttonSize: "h-16 w-16",
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const backgroundClass = computed(() => {
|
|
85
|
-
return backgroundColorVariants[
|
|
86
|
-
props.backgroundColor as keyof typeof backgroundColorVariants
|
|
87
|
-
];
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
const colorClass = computed(() => {
|
|
91
|
-
return iconColorVariants[props.iconColor as keyof typeof iconColorVariants];
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const buttonSizeClass = computed(() => {
|
|
95
|
-
return sizeVariants[props.size as keyof typeof sizeVariants].buttonSize;
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
const iconSize = computed(() => {
|
|
99
|
-
return sizeVariants[props.size as keyof typeof sizeVariants].iconSize as
|
|
100
|
-
| "lg"
|
|
101
|
-
| "sm";
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
onMounted(() => {
|
|
105
|
-
if (window.location.origin.includes("local")) {
|
|
106
|
-
// eslint-disable-next-line no-console
|
|
107
|
-
console.warn(
|
|
108
|
-
"Component is deprecated. It will be removed in a future update.",
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
</script>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# @dpa-shared-components/UiList
|
|
2
|
-
|
|
3
|
-
## Usage
|
|
4
|
-
|
|
5
|
-
```html
|
|
6
|
-
<!-- SomeComponent.vue using UiList -->
|
|
7
|
-
<template>
|
|
8
|
-
<UiList>
|
|
9
|
-
<UiListItem>Item 1</UiListItem>
|
|
10
|
-
<UiListItem>Item 2</UiListItem>
|
|
11
|
-
<UiListItem>Item 3</UiListItem>
|
|
12
|
-
</UiList>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script setup lang="ts">
|
|
16
|
-
import {UiList, UiListItem} from "@dpa-id-components/dpa-shared-components";
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## API
|
|
22
|
-
|
|
23
|
-
### Props
|
|
24
|
-
|
|
25
|
-
This component has no properties.
|
|
26
|
-
|
|
27
|
-
### Slots
|
|
28
|
-
|
|
29
|
-
| Name | Description |
|
|
30
|
-
|-----------|------------------------------------------------------------------|
|
|
31
|
-
| `default` | Slot for the rendering the list's content (probably UiListItems) |
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ul
|
|
3
|
-
class="rounded-sm border text-base/6 shadow-lg focus:outline-hidden sm:text-sm/5"
|
|
4
|
-
>
|
|
5
|
-
<slot />
|
|
6
|
-
</ul>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script lang="ts">
|
|
10
|
-
import { onMounted } from "vue";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated
|
|
14
|
-
* Please replace with your own component
|
|
15
|
-
*/
|
|
16
|
-
export default {
|
|
17
|
-
name: "UiList",
|
|
18
|
-
setup() {
|
|
19
|
-
onMounted(() => {
|
|
20
|
-
if (window.location.origin.includes("local")) {
|
|
21
|
-
// eslint-disable-next-line no-console
|
|
22
|
-
console.warn(
|
|
23
|
-
"Component is deprecated. It will be removed in a future update.",
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
</script>
|
|
@@ -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,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,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>
|