@una-ui/nuxt 0.1.0-beta.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 (56) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +22 -0
  3. package/dist/module.cjs +5 -0
  4. package/dist/module.d.ts +31 -0
  5. package/dist/module.json +8 -0
  6. package/dist/module.mjs +93 -0
  7. package/dist/runtime/components/elements/Accordion.vue +201 -0
  8. package/dist/runtime/components/elements/Alert.vue +138 -0
  9. package/dist/runtime/components/elements/Avatar.vue +80 -0
  10. package/dist/runtime/components/elements/AvatarGroup.vue +27 -0
  11. package/dist/runtime/components/elements/Badge.vue +50 -0
  12. package/dist/runtime/components/elements/Button.vue +94 -0
  13. package/dist/runtime/components/elements/Icon.vue +9 -0
  14. package/dist/runtime/components/elements/Indicator.vue +60 -0
  15. package/dist/runtime/components/forms/FormGroup.vue +141 -0
  16. package/dist/runtime/components/forms/Input.vue +151 -0
  17. package/dist/runtime/components/forms/Switch.vue +117 -0
  18. package/dist/runtime/components/misc/ThemeSwitcher.vue +111 -0
  19. package/dist/runtime/components/slots/AvatarGroupDefault.d.ts +22 -0
  20. package/dist/runtime/components/slots/AvatarGroupDefault.mjs +44 -0
  21. package/dist/runtime/components/slots/FormGroupDefault.d.ts +25 -0
  22. package/dist/runtime/components/slots/FormGroupDefault.mjs +23 -0
  23. package/dist/runtime/composables/themes.d.ts +7 -0
  24. package/dist/runtime/composables/themes.mjs +119 -0
  25. package/dist/runtime/plugins/theme.client.d.ts +5 -0
  26. package/dist/runtime/plugins/theme.client.mjs +28 -0
  27. package/dist/runtime/plugins/theme.server.d.ts +2 -0
  28. package/dist/runtime/plugins/theme.server.mjs +24 -0
  29. package/dist/runtime/types/accordion.d.ts +112 -0
  30. package/dist/runtime/types/accordion.mjs +0 -0
  31. package/dist/runtime/types/alert.d.ts +55 -0
  32. package/dist/runtime/types/alert.mjs +0 -0
  33. package/dist/runtime/types/avatar-group.d.ts +26 -0
  34. package/dist/runtime/types/avatar-group.mjs +0 -0
  35. package/dist/runtime/types/avatar.d.ts +71 -0
  36. package/dist/runtime/types/avatar.mjs +0 -0
  37. package/dist/runtime/types/badge.d.ts +41 -0
  38. package/dist/runtime/types/badge.mjs +0 -0
  39. package/dist/runtime/types/button.d.ts +95 -0
  40. package/dist/runtime/types/button.mjs +0 -0
  41. package/dist/runtime/types/form-group.d.ts +83 -0
  42. package/dist/runtime/types/form-group.mjs +0 -0
  43. package/dist/runtime/types/icon.d.ts +9 -0
  44. package/dist/runtime/types/icon.mjs +0 -0
  45. package/dist/runtime/types/index.d.ts +11 -0
  46. package/dist/runtime/types/index.mjs +11 -0
  47. package/dist/runtime/types/indicator.d.ts +45 -0
  48. package/dist/runtime/types/indicator.mjs +0 -0
  49. package/dist/runtime/types/input.d.ts +91 -0
  50. package/dist/runtime/types/input.mjs +0 -0
  51. package/dist/runtime/types/switch.d.ts +69 -0
  52. package/dist/runtime/types/switch.mjs +0 -0
  53. package/dist/runtime/utils/index.d.ts +19 -0
  54. package/dist/runtime/utils/index.mjs +36 -0
  55. package/dist/types.d.ts +15 -0
  56. package/package.json +58 -0
@@ -0,0 +1,22 @@
1
+ import type { PropType, VNode } from 'vue';
2
+ import type { NAvatarGroupProps } from '../../types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ max: {
5
+ type: NumberConstructor;
6
+ required: true;
7
+ };
8
+ avatar: {
9
+ type: PropType<NAvatarGroupProps>;
10
+ };
11
+ }, (() => null) | (() => (VNode<import("vue").RendererNode, import("vue").RendererElement, {
12
+ [key: string]: any;
13
+ }> | null)[]), unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
14
+ max: {
15
+ type: NumberConstructor;
16
+ required: true;
17
+ };
18
+ avatar: {
19
+ type: PropType<NAvatarGroupProps>;
20
+ };
21
+ }>>, {}, {}>;
22
+ export default _default;
@@ -0,0 +1,44 @@
1
+ import { cloneVNode, computed, defineComponent, h } from "vue";
2
+ import NAvatar from "../elements/Avatar.vue";
3
+ export default defineComponent({
4
+ props: {
5
+ max: {
6
+ type: Number,
7
+ required: true
8
+ },
9
+ avatar: {
10
+ type: Object
11
+ }
12
+ },
13
+ setup(props, { slots }) {
14
+ const children = computed(() => slots.default?.()[0].children);
15
+ if (!children.value)
16
+ return () => null;
17
+ const countChildren = computed(() => children.value?.length);
18
+ const filterChildren = computed(() => {
19
+ if (countChildren.value <= props.max)
20
+ return children.value;
21
+ const childrenCopy = [...children.value];
22
+ childrenCopy.splice(props.max, countChildren.value - props.max);
23
+ return childrenCopy;
24
+ });
25
+ const clones = computed(() => filterChildren.value?.map((node) => {
26
+ const mergeProps = { ...props.avatar, ...node.props };
27
+ return cloneVNode(node, { ...mergeProps, class: "avatar-group-(child margin)" });
28
+ }).reverse());
29
+ const label = computed(() => {
30
+ if (countChildren.value <= props.max)
31
+ return null;
32
+ return h(NAvatar, {
33
+ // TODO: add `more` configuration
34
+ class: "avatar-(soft group-margin)",
35
+ label: `+${countChildren.value - props.max}`,
36
+ una: { avatarLabel: `${props.avatar?.una?.avatarGroupLabel} avatar-group-label` }
37
+ });
38
+ });
39
+ return () => [
40
+ label.value,
41
+ ...clones.value
42
+ ];
43
+ }
44
+ });
@@ -0,0 +1,25 @@
1
+ import type { VNode } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ id: {
4
+ type: StringConstructor;
5
+ required: true;
6
+ };
7
+ status: {
8
+ type: StringConstructor;
9
+ validator: (v: string) => boolean;
10
+ required: false;
11
+ };
12
+ }, (() => null) | (() => VNode<unknown, unknown, {
13
+ [key: string]: any;
14
+ }>[]), unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
15
+ id: {
16
+ type: StringConstructor;
17
+ required: true;
18
+ };
19
+ status: {
20
+ type: StringConstructor;
21
+ validator: (v: string) => boolean;
22
+ required: false;
23
+ };
24
+ }>>, {}, {}>;
25
+ export default _default;
@@ -0,0 +1,23 @@
1
+ import { cloneVNode, computed, defineComponent } from "vue";
2
+ export default defineComponent({
3
+ props: {
4
+ id: {
5
+ type: String,
6
+ required: true
7
+ },
8
+ status: {
9
+ type: String,
10
+ validator: (v) => ["success", "error", "warning", "info"].includes(v),
11
+ required: false
12
+ }
13
+ },
14
+ setup(props, { slots }) {
15
+ const children = computed(() => slots.default?.()[0].children);
16
+ if (!children.value)
17
+ return () => null;
18
+ const clones = computed(() => children.value?.map((node) => {
19
+ return cloneVNode(node, { id: props.id, name: props.id, status: props.status });
20
+ }));
21
+ return () => clones.value;
22
+ }
23
+ });
@@ -0,0 +1,7 @@
1
+ interface Colors {
2
+ [key: string]: string;
3
+ }
4
+ export declare function getColors(color: string, prefix: string): Colors;
5
+ export declare const primaryThemes: [string, Colors][];
6
+ export declare const grayThemes: [string, Colors][];
7
+ export {};
@@ -0,0 +1,119 @@
1
+ import { colors } from "@unocss/preset-mini/colors";
2
+ import { hexToRgb } from "../utils/index.mjs";
3
+ const filteredPrimaryColors = Object.fromEntries(
4
+ Object.entries(colors).filter(([key]) => [
5
+ "blue",
6
+ "cyan",
7
+ "sky",
8
+ "amber",
9
+ "yellow",
10
+ "emerald",
11
+ "lime",
12
+ "orange",
13
+ "purple",
14
+ "indigo",
15
+ "pink",
16
+ "tomato",
17
+ "green",
18
+ "fuchsia",
19
+ "violet",
20
+ "rose",
21
+ "amber",
22
+ "red",
23
+ "teal"
24
+ ].includes(key)).map(([key, value]) => [key, Object.fromEntries(
25
+ Object.entries(value).filter(([key2]) => ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"].includes(key2))
26
+ )])
27
+ );
28
+ filteredPrimaryColors.tomato = {
29
+ 50: "#fdf2f2",
30
+ 100: "#fde8e8",
31
+ 200: "#fbd5d5",
32
+ 300: "#f8b4b4",
33
+ 400: "#f98080",
34
+ 500: "#f05252",
35
+ 600: "#e02424",
36
+ 700: "#c81e1e",
37
+ 800: "#9b1c1c",
38
+ 900: "#771d1d",
39
+ 950: "#3f0708"
40
+ };
41
+ const filteredGrayColors = Object.fromEntries(
42
+ Object.entries(colors).filter(([key]) => ["slate", "gray", "zinc", "neutral", "stone"].includes(key)).map(([key, value]) => [key, Object.fromEntries(
43
+ Object.entries(value).filter(([key2]) => ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"].includes(key2))
44
+ )])
45
+ );
46
+ filteredGrayColors.sage = {
47
+ 50: "#f2f2f2",
48
+ 100: "#e6e6e6",
49
+ 200: "#d9d9d9",
50
+ 300: "#b8b8b8",
51
+ 400: "#939393",
52
+ 500: "#6f6f6f",
53
+ 600: "#4b4b4b",
54
+ 700: "#323232",
55
+ 800: "#1f1f1f",
56
+ 900: "#0b0b0b",
57
+ 950: "#000000"
58
+ };
59
+ filteredGrayColors.ash = {
60
+ 50: "#f9f9f8",
61
+ 100: "#f1f0ee",
62
+ 200: "#dad7d3",
63
+ 300: "#c3beb8",
64
+ 400: "#a9a49e",
65
+ 500: "#908c84",
66
+ 600: "#777168",
67
+ 700: "#5e5950",
68
+ 800: "#45403a",
69
+ 900: "#2c2823",
70
+ 950: "#161511"
71
+ };
72
+ filteredGrayColors.olive = {
73
+ 50: "#fafaf2",
74
+ 100: "#f5f5e6",
75
+ 200: "#ebebd9",
76
+ 300: "#d6d6b8",
77
+ 400: "#b3b393",
78
+ 500: "#8f8f6f",
79
+ 600: "#6b6b4b",
80
+ 700: "#4a4a32",
81
+ 800: "#2a2a1f",
82
+ 900: "#0e0e0b",
83
+ 950: "#000000"
84
+ };
85
+ filteredGrayColors.leaf = {
86
+ 50: "#f2faf2",
87
+ 100: "#e6f5e6",
88
+ 200: "#d9ebd9",
89
+ 300: "#b8d6b8",
90
+ 400: "#93b393",
91
+ 500: "#6f8f6f",
92
+ 600: "#4b6b4b",
93
+ 700: "#326432",
94
+ 800: "#1f2a1f",
95
+ 900: "#0b0e0b",
96
+ 950: "#000000"
97
+ };
98
+ const filteredColors = {
99
+ ...filteredPrimaryColors,
100
+ ...filteredGrayColors
101
+ };
102
+ export function getColors(color, prefix) {
103
+ const colorPalette = filteredColors[color];
104
+ if (!colorPalette)
105
+ throw new Error(`Invalid primary color: ${color}`);
106
+ const colors2 = {};
107
+ colors2[`--una-${prefix}-hex`] = colorPalette[600];
108
+ for (const shade of Object.keys(colorPalette))
109
+ colors2[`--una-${prefix}-${shade}`] = hexToRgb(colorPalette[shade]).join(", ");
110
+ return colors2;
111
+ }
112
+ export const primaryThemes = Object.entries(filteredPrimaryColors).map(([color]) => [
113
+ color,
114
+ getColors(color, "primary")
115
+ ]);
116
+ export const grayThemes = Object.entries(filteredGrayColors).map(([color]) => [
117
+ color,
118
+ getColors(color, "gray")
119
+ ]);
@@ -0,0 +1,5 @@
1
+ export interface ThemeColors {
2
+ [key: string]: string;
3
+ }
4
+ declare const _default: any;
5
+ export default _default;
@@ -0,0 +1,28 @@
1
+ import { useStorage } from "@vueuse/core";
2
+ import { watchEffect } from "vue";
3
+ import { defineNuxtPlugin } from "#app";
4
+ let unaUIStyle;
5
+ export default defineNuxtPlugin(() => {
6
+ const settings = useStorage("una-settings", {
7
+ primaryColors: void 0,
8
+ grayColors: void 0
9
+ // fontSize: 16, TODO: add font size
10
+ // --font-size: ${settings.value.fontSize}px; TODO: add font size
11
+ });
12
+ unaUIStyle = document.createElement("style");
13
+ unaUIStyle.id = "una-ui";
14
+ document.head.appendChild(unaUIStyle);
15
+ const html = document.documentElement;
16
+ html.removeAttribute("style");
17
+ watchEffect(() => {
18
+ const styleTag = document.getElementById("una-ui");
19
+ if (styleTag) {
20
+ styleTag.innerHTML = `
21
+ :root {
22
+ ${Object.entries(settings.value.primaryColors || {}).map(([k, v]) => `${k}: ${v};`).join("\n")}
23
+ ${Object.entries(settings.value.grayColors || {}).map(([k, v]) => `${k}: ${v};`).join("\n")}
24
+ }
25
+ `.replace(/\s*\n+\s*/g, "");
26
+ }
27
+ });
28
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,24 @@
1
+ import { defineNuxtPlugin, useHead } from "#app";
2
+ export default defineNuxtPlugin(() => {
3
+ useHead({
4
+ script: [
5
+ {
6
+ innerHTML: `
7
+ ;(function() {
8
+ const settings = JSON.parse(localStorage.getItem('una-settings'))
9
+ if (!settings) { return }
10
+
11
+ const html = document.documentElement
12
+ ${process.dev ? "console.log({ settings })" : ""}
13
+
14
+ if (settings.primaryColors) {
15
+ Object.entries(settings.primaryColors).map(i => html.style.setProperty(i[0], i[1]))
16
+ }
17
+ if (settings.grayColors) {
18
+ Object.entries(settings.grayColors).map(i => html.style.setProperty(i[0], i[1]))
19
+ }
20
+ })()`.trim().replace(/\s*\n+\s*/g, ";")
21
+ }
22
+ ]
23
+ });
24
+ });
@@ -0,0 +1,112 @@
1
+ import type { NButtonProps } from './button';
2
+ export interface NAccordionProps extends Omit<NButtonProps, 'una'> {
3
+ /**
4
+ * Allows you to add `UnaUI` accordion preset properties,
5
+ * Think of it as a shortcut for adding options or variants to the preset if available.
6
+ *
7
+ * By default, we don't add any options or variants to the accordion,
8
+ * But you can add your own in the configuration file.
9
+ */
10
+ accordion?: string;
11
+ /**
12
+ * Update leading icon when accordion button item is open,
13
+ * Accepts icon name and utility classes
14
+ */
15
+ trailingOpen?: string;
16
+ /**
17
+ * Update leading icon when accordion button item is closed,
18
+ * Accepts icon name and utility classes
19
+ */
20
+ trailingClose?: string;
21
+ /**
22
+ * Allow multiple accordion items to be open at the same time
23
+ *
24
+ * @default false
25
+ */
26
+ multiple?: boolean;
27
+ /**
28
+ * Allow accordion item to be open by default
29
+ *
30
+ * @default false
31
+ */
32
+ defaultOpen?: boolean;
33
+ /**
34
+ * Removes border and divider from accordion
35
+ *
36
+ * @default false
37
+ */
38
+ unstyle?: boolean;
39
+ /**
40
+ * By default, the accordion is unmounted for performance reasons,
41
+ * This means that the accordion will not be rendered until it is opened,
42
+ * If you want to render the accordion when the page loads, you can use the `mounted` prop.
43
+ *
44
+ * @default false
45
+ */
46
+ mounted?: boolean;
47
+ /**
48
+ * List of items to be rendered,
49
+ * It extends the `NButtonProps` interface
50
+ *
51
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/nuxt/src/runtime/types/button.ts
52
+ */
53
+ items: NAccordionItemProps[];
54
+ /**
55
+ * `Unaonfiguration
56
+ *
57
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/accordion.ts
58
+ */
59
+ una?: {
60
+ accordion?: string;
61
+ accordionItem?: string;
62
+ accordionButton?: string;
63
+ accordionPanel?: string;
64
+ accordionLeading?: string;
65
+ accordionTrailing?: string;
66
+ accordionTrailingOpen?: string;
67
+ accordionTrailingClose?: string;
68
+ accordionEnterActive?: string;
69
+ accordionLeaveActive?: string;
70
+ } & NButtonProps['una'];
71
+ }
72
+ export interface NAccordionItemProps extends NButtonProps {
73
+ /**
74
+ * Accordion item content
75
+ */
76
+ content?: string;
77
+ /**
78
+ * Update item leading icon when accordion button item is open,
79
+ * Accepts icon name and utility classes
80
+ *
81
+ * @example
82
+ * trailingOpen='i-heroicons-information-circle text-info'
83
+ */
84
+ trailingOpen?: string;
85
+ /**
86
+ * Update item leading icon when accordion button item is closed,
87
+ * Accepts icon name and utility classes
88
+ *
89
+ * @example
90
+ * trailingClose='i-heroicons-information-circle text-info'
91
+ */
92
+ trailingClose?: string;
93
+ /**
94
+ * Allow accordion item to be open by default
95
+ *
96
+ * @default false
97
+ */
98
+ defaultOpen?: boolean;
99
+ /**
100
+ * Close other accordion items when item is open
101
+ *
102
+ * @default false
103
+ */
104
+ closeOthers?: boolean;
105
+ /**
106
+ * By default, all the accordion item is unmounted for performance reasons,
107
+ * You can use the `mounted` prop to render the accordion specific on item.
108
+ *
109
+ * @default false
110
+ */
111
+ mounted?: boolean;
112
+ }
File without changes
@@ -0,0 +1,55 @@
1
+ export interface NAlertProps {
2
+ /**
3
+ * Allows you to add `UnaUI` alert preset properties,
4
+ * Think of it as a shortcut for adding options or variants to the preset if available.
5
+ *
6
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/alert.ts
7
+ * @example
8
+ * alert="outline-pink"
9
+ */
10
+ alert?: string;
11
+ /**
12
+ * Add icon to the alert,
13
+ * If this is true, the icon will be automatically generated based on the color.
14
+ * Supported colors are `info`, `success`, `warning`, and `error`
15
+ *
16
+ * You can customize the icon by providing the icon that you want.
17
+ *
18
+ * @example
19
+ * icon="i-heroicons-information-circle"
20
+ */
21
+ icon?: string | boolean;
22
+ /**
23
+ * Add a close button to the alert.
24
+ *
25
+ * @default false
26
+ */
27
+ closable?: boolean;
28
+ /**
29
+ * Add a title to the alert.
30
+ */
31
+ title?: string;
32
+ /**
33
+ * Add a description to the alert.
34
+ */
35
+ description?: string;
36
+ /**
37
+ * `Unaguration
38
+ *
39
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/alert.ts
40
+ */
41
+ una?: {
42
+ alert?: string;
43
+ alertTitle?: string;
44
+ alertDescription?: string;
45
+ alertIconBase?: string;
46
+ alertClose?: string;
47
+ alertCloseIconBase?: string;
48
+ alertInnerWrapper?: string;
49
+ alertContentWrapper?: string;
50
+ alertIconWrapper?: string;
51
+ alertCloseWrapper?: string;
52
+ alertCloseInnerWrapper?: string;
53
+ alertCloseIcon?: string;
54
+ };
55
+ }
File without changes
@@ -0,0 +1,26 @@
1
+ import type { NAvatarProps } from './avatar';
2
+ /**
3
+ * This extends the `NAvatarProps` interface.
4
+ *
5
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/nuxt/src/runtime/types/avatar.ts
6
+ */
7
+ export interface NAvatarGroupProps extends Omit<NAvatarProps, 'una'> {
8
+ /**
9
+ * Set the maximum number of avatars to show.
10
+ *
11
+ * @default 3
12
+ */
13
+ max: number;
14
+ /**
15
+ * `Una
16
+ *
17
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/avatar-group.ts
18
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/avatar.ts
19
+ */
20
+ una?: {
21
+ avatarGroup?: string;
22
+ avatarGroupChild?: string;
23
+ avatarGroupMargin?: string;
24
+ avatarGroupLabel?: string;
25
+ } & NAvatarProps['una'];
26
+ }
File without changes
@@ -0,0 +1,71 @@
1
+ export interface NAvatarProps {
2
+ /**
3
+ * Allows you to add `UnaUI` avatar preset properties,
4
+ * Think of it as a shortcut for adding options or variants to the preset if available.
5
+ *
6
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/avatar.ts
7
+ * @example
8
+ * avatar="solid-green"
9
+ */
10
+ avatar?: string;
11
+ /**
12
+ * Add icon instead of image.
13
+ *
14
+ * @example
15
+ * icon="i-heroicons-information-circle"
16
+ */
17
+ icon?: string;
18
+ /**
19
+ * Add a label to the avatar.
20
+ *
21
+ * @example
22
+ * label="PR"
23
+ */
24
+ label?: string;
25
+ /**
26
+ * Add src of the image.
27
+ *
28
+ * @example
29
+ * src="https://i.pravatar.cc/300"
30
+ */
31
+ src?: string;
32
+ /**
33
+ * Add alt of the image.
34
+ *
35
+ * @example
36
+ * alt="Profile"
37
+ */
38
+ alt?: string;
39
+ /**
40
+ * Add fallback of the image.
41
+ *
42
+ * @example
43
+ * fallback="https://i.pravatar.cc/300"
44
+ */
45
+ fallback?: string;
46
+ /**
47
+ * Add a delay before showing the avatar.
48
+ *
49
+ * @default 0
50
+ */
51
+ delay?: number;
52
+ /**
53
+ * Add a skeleton effect to the avatar.
54
+ *
55
+ * @default false
56
+ */
57
+ skeleton?: boolean;
58
+ /**
59
+ * `Unaet configuration
60
+ *
61
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/avatar.ts
62
+ */
63
+ una?: {
64
+ avatar?: string;
65
+ avatarLabel?: string;
66
+ avatarSrc?: string;
67
+ avatarFallback?: string;
68
+ avatarIconBase?: string;
69
+ avatarFallbackIcon?: string;
70
+ };
71
+ }
File without changes
@@ -0,0 +1,41 @@
1
+ export interface NBadgeProps {
2
+ /**
3
+ * Allows you to add `UnaUI` badge preset properties,
4
+ * Think of it as a shortcut for adding options or variants to the preset if available.
5
+ *
6
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/badge.ts
7
+ * @example
8
+ * badge="solid-yellow"
9
+ */
10
+ badge?: string;
11
+ /**
12
+ * Add a label to the badge.
13
+ */
14
+ label?: string;
15
+ /**
16
+ * Display an icon on the left side of the badge,
17
+ * this also allows you to add utility classes to customize icon.
18
+ *
19
+ * @example
20
+ * icon="i-heroicons-information-circle text-green-500 dark:text-green-400 text-2xl"
21
+ */
22
+ icon?: string;
23
+ /**
24
+ * Display `close` icon on the right side of the badge,
25
+ *
26
+ * @default false
27
+ */
28
+ closable?: boolean;
29
+ /**
30
+ * `UnaUI` preset configuration
31
+ *
32
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/badge.ts
33
+ */
34
+ una?: {
35
+ badge?: string;
36
+ badgeIconBase?: string;
37
+ badgeClose?: string;
38
+ badgeCloseIconBase?: string;
39
+ badgeCloseIcon?: string;
40
+ };
41
+ }
File without changes