@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,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" | "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,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" | "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,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,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>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# @dpa-id-components/UiTextButton
|
|
2
|
-
|
|
3
|
-
## Installation
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
yarn add @dpa-id-components/UiTextButton
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Usage
|
|
10
|
-
|
|
11
|
-
```html
|
|
12
|
-
<!-- SomeComponent.vue using UiTextButton -->
|
|
13
|
-
<template>
|
|
14
|
-
<UiTextButton>Link</UiTextButton>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script setup lang="ts">
|
|
18
|
-
import UiTextButton from "@dpa-id-components/UiSnackbar";
|
|
19
|
-
</script>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## API
|
|
23
|
-
|
|
24
|
-
### Props
|
|
25
|
-
|
|
26
|
-
| Name | Type | Default | Description |
|
|
27
|
-
|-------------|------------------------------------------|-------------|-------------------------------------------------------------------------------------|
|
|
28
|
-
| color? | "blue" | "gray"; | "blue" | The text color |
|
|
29
|
-
| href? | string; | undefined | The link target, if set the component will render as <a> tag |
|
|
30
|
-
| iconLeft? | `UiIconName` | undefined | The name of the icon that should be rendered left of the link text |
|
|
31
|
-
| iconRight? | `UiIconName` | undefined | The name of the icon that should be rendered right of the link text |
|
|
32
|
-
| placement? | "onsurface" | "oncanvas"; | "onsurface" | The 'placement' of the link. Renders a higher contrast version if "oncanvas" is set |
|
|
33
|
-
| size? | "xsmall" | "small" | "medium"; | "medium" | The text size of the link, also affects icons size. |
|
|
34
|
-
| weight? | "regular" | "semibold"; | "regular" | The font weight of the link. |
|
|
35
|
-
| linkTarget? | string; | "_self" | Used to modify the a tag's target property if href is set. |
|
|
36
|
-
|
|
37
|
-
### Slots
|
|
38
|
-
|
|
39
|
-
| Name | Description |
|
|
40
|
-
| --------- | ---------------------------------------- |
|
|
41
|
-
| `default` | Default slot for text of the text button |
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
:is="tagName"
|
|
4
|
-
:href="href"
|
|
5
|
-
:class="classNames"
|
|
6
|
-
class="inline-flex items-center"
|
|
7
|
-
:target="target"
|
|
8
|
-
>
|
|
9
|
-
<UiIcon
|
|
10
|
-
v-if="iconLeft"
|
|
11
|
-
:class="iconLeftMarginClass"
|
|
12
|
-
:name="iconLeft"
|
|
13
|
-
:size="iconSize"
|
|
14
|
-
/>
|
|
15
|
-
<slot />
|
|
16
|
-
<UiIcon
|
|
17
|
-
v-if="iconRight"
|
|
18
|
-
:class="iconRightMarginClass"
|
|
19
|
-
:name="iconRight"
|
|
20
|
-
:size="iconSize"
|
|
21
|
-
/>
|
|
22
|
-
</component>
|
|
23
|
-
</template>
|
|
24
|
-
<script lang="ts">
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated
|
|
27
|
-
* Please replace with your own component
|
|
28
|
-
*/
|
|
29
|
-
export default {
|
|
30
|
-
name: "UiTextButton",
|
|
31
|
-
setup() {
|
|
32
|
-
onMounted(() => {
|
|
33
|
-
if (window.location.origin.includes("local")) {
|
|
34
|
-
// eslint-disable-next-line no-console
|
|
35
|
-
console.warn(
|
|
36
|
-
"Component is deprecated. It will be removed in a future update.",
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
</script>
|
|
43
|
-
<script setup lang="ts">
|
|
44
|
-
import { computed, onMounted } from "vue";
|
|
45
|
-
|
|
46
|
-
import UiIcon, { type UiIconName } from "../UiIcon/UiIcon.vue";
|
|
47
|
-
|
|
48
|
-
const props = withDefaults(
|
|
49
|
-
defineProps<{
|
|
50
|
-
color?: "blue" | "gray";
|
|
51
|
-
href?: string;
|
|
52
|
-
iconLeft?: UiIconName;
|
|
53
|
-
iconRight?: UiIconName;
|
|
54
|
-
placement?: "onsurface" | "oncanvas";
|
|
55
|
-
size?: "xsmall" | "small" | "medium";
|
|
56
|
-
weight?: "regular" | "semibold";
|
|
57
|
-
linkTarget?: string;
|
|
58
|
-
}>(),
|
|
59
|
-
{
|
|
60
|
-
color: "blue",
|
|
61
|
-
href: undefined,
|
|
62
|
-
iconLeft: undefined,
|
|
63
|
-
iconRight: undefined,
|
|
64
|
-
placement: "onsurface",
|
|
65
|
-
size: "medium",
|
|
66
|
-
weight: "regular",
|
|
67
|
-
linkTarget: "_self",
|
|
68
|
-
},
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const tagName = computed((): string => {
|
|
72
|
-
if (props.href?.length) {
|
|
73
|
-
return "a";
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return "button";
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
const target = computed((): string => {
|
|
80
|
-
if (props.href?.length) {
|
|
81
|
-
return props.linkTarget;
|
|
82
|
-
}
|
|
83
|
-
return "";
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
const weightClassName = computed((): string => {
|
|
87
|
-
let fontClass, hoverClass;
|
|
88
|
-
|
|
89
|
-
if (props.weight === "regular") {
|
|
90
|
-
fontClass = "font-normal";
|
|
91
|
-
hoverClass = "hover:underline";
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (props.weight === "semibold") {
|
|
95
|
-
fontClass = "font-semibold rounded-lg";
|
|
96
|
-
|
|
97
|
-
if (props.placement === "onsurface") {
|
|
98
|
-
hoverClass = "hover:bg-neutral-whisper";
|
|
99
|
-
} else if (props.placement === "oncanvas") {
|
|
100
|
-
hoverClass = "hover:bg-neutral-pale";
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return `${fontClass} ${hoverClass}`;
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
const paddingClass = computed((): string => {
|
|
108
|
-
if (props.weight === "semibold") {
|
|
109
|
-
if (props.size === "medium") {
|
|
110
|
-
return "px-2 -mx-2";
|
|
111
|
-
} else if (props.size === "small" || props.size === "xsmall") {
|
|
112
|
-
return "px-1 -mx-1";
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return "";
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
const textClassName = computed((): string => {
|
|
119
|
-
if (props.size === "xsmall") {
|
|
120
|
-
return "text-xs";
|
|
121
|
-
} else if (props.size === "small") {
|
|
122
|
-
return "text-sm";
|
|
123
|
-
} else {
|
|
124
|
-
return "text-base";
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
const colorClass = computed((): string => {
|
|
129
|
-
if (props.color === "blue") {
|
|
130
|
-
return "text-primary";
|
|
131
|
-
} else if (props.color === "gray") {
|
|
132
|
-
if (props.placement === "onsurface") {
|
|
133
|
-
return "text-neutral-subtle";
|
|
134
|
-
} else if (props.placement === "oncanvas") {
|
|
135
|
-
return "text-neutral-emphasis";
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return "";
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
const iconSize = computed((): "sm" | "md" => {
|
|
142
|
-
if (props.size === "xsmall") {
|
|
143
|
-
return "sm";
|
|
144
|
-
} else {
|
|
145
|
-
return "md";
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
const iconLeftMarginClass = computed((): string => {
|
|
150
|
-
if (props.size === "xsmall") {
|
|
151
|
-
return "mr-1";
|
|
152
|
-
} else {
|
|
153
|
-
return "mr-2";
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
const iconRightMarginClass = computed((): string => {
|
|
158
|
-
if (props.size === "xsmall") {
|
|
159
|
-
return "ml-1";
|
|
160
|
-
} else {
|
|
161
|
-
return "ml-2";
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
const classNames = computed((): string[] => {
|
|
166
|
-
return [
|
|
167
|
-
paddingClass.value,
|
|
168
|
-
textClassName.value,
|
|
169
|
-
weightClassName.value,
|
|
170
|
-
colorClass.value,
|
|
171
|
-
];
|
|
172
|
-
});
|
|
173
|
-
</script>
|