@dpa-id-components/dpa-shared-components 23.0.0 → 23.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpa-id-components/dpa-shared-components",
3
- "version": "23.0.0",
3
+ "version": "23.1.0",
4
4
  "license": "ISC",
5
5
  "author": "dpa Deutsche Presse-Agentur GmbH",
6
6
  "description": "Shared Vue component library for dpa projects",
@@ -0,0 +1,13 @@
1
+ # UiTShirtSizeIcon
2
+
3
+ ## Usage
4
+
5
+ ```vue
6
+ <template>
7
+ <UiTShirtSizeIcon name="xl" />
8
+ </template>
9
+
10
+ <script setup>
11
+ import { UiTShirtSizeIcon } from "@dpa-id-components/dpa-shared-components";
12
+ </script>
13
+ ```
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <component
3
+ :is="iconComponent"
4
+ class="inline-flex"
5
+ :class="
6
+ {
7
+ xs: 'size-3',
8
+ sm: 'size-4',
9
+ md: 'size-5',
10
+ lg: 'size-6',
11
+ xl: 'size-10',
12
+ '2xl': 'size-14',
13
+ }[size]
14
+ "
15
+ />
16
+ </template>
17
+
18
+ <script lang="ts">
19
+ export type UiTShirtSizeIconName = keyof typeof icons;
20
+ </script>
21
+
22
+ <script setup lang="ts">
23
+ import { computed, defineAsyncComponent } from "vue";
24
+
25
+ import { icons } from "./icons.ts";
26
+ import UiTShirtSizeIconLoading from "./UiTShirtSizeIconLoading.vue";
27
+
28
+ const { name, size = "lg" } = defineProps<{
29
+ name: UiTShirtSizeIconName;
30
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
31
+ }>();
32
+
33
+ const iconComponent = computed(() =>
34
+ defineAsyncComponent({
35
+ loader: icons[name],
36
+ // Render a substitute element while loading for classes to attach to.
37
+ loadingComponent: UiTShirtSizeIconLoading,
38
+ // Immediately render the loadingComponent so that it can receive classes.
39
+ delay: 0,
40
+ }),
41
+ );
42
+ </script>
@@ -0,0 +1,8 @@
1
+ <template>
2
+ <svg
3
+ width="24"
4
+ height="24"
5
+ viewBox="0 0 24 24"
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ ></svg>
8
+ </template>
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <svg
3
+ width="16"
4
+ height="16"
5
+ viewBox="0 0 16 16"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ >
9
+ <path
10
+ d="M8 0.5C12.1421 0.5 15.5 3.85786 15.5 8C15.5 12.1421 12.1421 15.5 8 15.5C3.85786 15.5 0.5 12.1421 0.5 8C0.5 3.85786 3.85786 0.5 8 0.5Z"
11
+ stroke="currentColor"
12
+ />
13
+ <path
14
+ d="M5.78906 12V4H7.23828V10.7852H10.7617V12H5.78906Z"
15
+ fill="currentColor"
16
+ />
17
+ </svg>
18
+ </template>
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <svg
3
+ width="16"
4
+ height="16"
5
+ viewBox="0 0 16 16"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ >
9
+ <path
10
+ d="M8 0.5C12.1421 0.5 15.5 3.85786 15.5 8C15.5 12.1421 12.1421 15.5 8 15.5C3.85786 15.5 0.5 12.1421 0.5 8C0.5 3.85786 3.85786 0.5 8 0.5Z"
11
+ stroke="currentColor"
12
+ />
13
+ <path
14
+ d="M3.78906 4H5.5625L7.9375 9.79687H8.03125L10.4063 4H12.1797V12H10.7891V6.50391H10.7148L8.50391 11.9766H7.46484L5.25391 6.49219H5.17969V12H3.78906V4Z"
15
+ fill="currentColor"
16
+ />
17
+ </svg>
18
+ </template>
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <svg
3
+ width="16"
4
+ height="16"
5
+ viewBox="0 0 16 16"
6
+ fill="none"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ >
9
+ <path
10
+ d="M8 0.5C12.1421 0.5 15.5 3.85786 15.5 8C15.5 12.1421 12.1421 15.5 8 15.5C3.85786 15.5 0.5 12.1421 0.5 8C0.5 3.85786 3.85786 0.5 8 0.5Z"
11
+ stroke="currentColor"
12
+ />
13
+ <path
14
+ d="M4.76278 4.81818L6.00941 6.92507H6.05771L7.31037 4.81818H8.7864L6.89986 7.90909L8.82866 11H7.32546L6.05771 8.89009H6.00941L4.74165 11H3.2445L5.17933 7.90909L3.28072 4.81818H4.76278ZM9.61346 11V4.81818H10.9205V9.92241H13.5707V11H9.61346Z"
15
+ fill="currentColor"
16
+ />
17
+ </svg>
18
+ </template>
@@ -0,0 +1,5 @@
1
+ export const icons = {
2
+ m: () => import("./icons/m.vue"),
3
+ l: () => import("./icons/l.vue"),
4
+ xl: () => import("./icons/xl.vue"),
5
+ } as const;