sprintify-ui 0.6.45 → 0.6.46

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.
@@ -3082,41 +3082,41 @@ const H0 = {
3082
3082
  props: {
3083
3083
  title: { default: void 0 },
3084
3084
  color: { default: "info" },
3085
- icon: { default: "" },
3085
+ icon: { default: void 0 },
3086
3086
  showIcon: { type: Boolean, default: !0 },
3087
3087
  bordered: { type: Boolean, default: !1 },
3088
3088
  class: { default: void 0 }
3089
3089
  },
3090
3090
  setup(n) {
3091
- const t = n, e = L(() => {
3092
- const a = "flex w-full items-start rounded-md p-4 gap-2.5", l = t.showIcon ? "pl-3.5" : "";
3091
+ const t = n, e = L(() => ({
3092
+ info: "heroicons:information-circle-16-solid",
3093
+ success: "heroicons:check-circle-16-solid",
3094
+ danger: "heroicons:exclamation-circle-16-solid",
3095
+ warning: "heroicons:exclamation-triangle-16-solid"
3096
+ })[t.color] ?? null ?? t.icon), r = L(() => {
3097
+ const a = "flex w-full items-start rounded-md p-4 gap-2.5", l = t.showIcon && e.value ? "pl-3.5" : "";
3093
3098
  return It(
3094
3099
  a,
3095
3100
  l,
3096
3101
  t.class
3097
3102
  );
3098
- }), r = L(() => {
3103
+ }), i = L(() => {
3099
3104
  const a = Ma(t.color, !1), l = {
3100
3105
  backgroundColor: a.backgroundColor,
3101
3106
  color: a.textColor
3102
3107
  };
3103
3108
  return t.bordered && (l.borderColor = a.borderColor, l.borderWidth = "1px", l.borderStyle = "solid"), l;
3104
- }), i = L(() => t.icon + " w-4 h-4 mt-px"), o = L(() => ({
3105
- info: "heroicons:information-circle-16-solid",
3106
- success: "heroicons:check-circle-16-solid",
3107
- danger: "heroicons:exclamation-circle-16-solid",
3108
- warning: "heroicons:exclamation-triangle-16-solid"
3109
- })[t.color] ?? null ?? t.icon);
3109
+ }), o = L(() => t.icon + " w-4 h-4 mt-px");
3110
3110
  return (a, l) => {
3111
3111
  const s = tn("BaseIcon");
3112
3112
  return B(), K("div", {
3113
- class: fe(C(e)),
3114
- style: it(C(r))
3113
+ class: fe(C(r)),
3114
+ style: it(C(i))
3115
3115
  }, [
3116
3116
  a.showIcon ? (B(), K("div", H0, [
3117
3117
  we(s, {
3118
- icon: C(o),
3119
- class: fe(C(i))
3118
+ icon: C(e),
3119
+ class: fe(C(o))
3120
3120
  }, null, 8, ["icon", "class"])
3121
3121
  ])) : ke("", !0),
3122
3122
  j("div", null, [
@@ -14,8 +14,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
14
14
  };
15
15
  icon: {
16
16
  type: import("vue").PropType<string>;
17
- required: true;
18
- default: string;
17
+ default: undefined;
19
18
  };
20
19
  showIcon: {
21
20
  type: import("vue").PropType<boolean>;
@@ -41,8 +40,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
41
40
  };
42
41
  icon: {
43
42
  type: import("vue").PropType<string>;
44
- required: true;
45
- default: string;
43
+ default: undefined;
46
44
  };
47
45
  showIcon: {
48
46
  type: import("vue").PropType<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.6.45",
3
+ "version": "0.6.46",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -8,7 +8,7 @@
8
8
  class="shrink-0"
9
9
  >
10
10
  <BaseIcon
11
- :icon="icon"
11
+ :icon="iconInternal"
12
12
  :class="iconClass"
13
13
  />
14
14
  </div>
@@ -42,22 +42,33 @@ defineOptions({
42
42
  const props = withDefaults(defineProps<{
43
43
  title?: string;
44
44
  color: 'info' | 'success' | 'danger' | 'warning' | string;
45
- icon: string;
45
+ icon?: string;
46
46
  showIcon?: boolean;
47
47
  bordered?: boolean;
48
48
  class?: string | string[];
49
49
  }>(), {
50
50
  title: undefined,
51
51
  color: 'info',
52
- icon: '',
52
+ icon: undefined,
53
53
  showIcon: true,
54
54
  bordered: false,
55
55
  class: undefined,
56
56
  });
57
57
 
58
+ const iconInternal = computed(() => {
59
+ const iconName = {
60
+ info: 'heroicons:information-circle-16-solid',
61
+ success: 'heroicons:check-circle-16-solid',
62
+ danger: 'heroicons:exclamation-circle-16-solid',
63
+ warning: 'heroicons:exclamation-triangle-16-solid',
64
+ }[props.color as never] ?? null;
65
+
66
+ return iconName ?? props.icon;
67
+ });
68
+
58
69
  const classes = computed(() => {
59
70
  const base = 'flex w-full items-start rounded-md p-4 gap-2.5';
60
- const iconPadding = props.showIcon ? 'pl-3.5' : '';
71
+ const iconPadding = (props.showIcon && iconInternal.value) ? 'pl-3.5' : '';
61
72
 
62
73
  return twMerge(
63
74
  base,
@@ -87,14 +98,4 @@ const iconClass = computed(() => {
87
98
  return props.icon + ' w-4 h-4 mt-px';
88
99
  });
89
100
 
90
- const icon = computed(() => {
91
- const iconName = {
92
- info: 'heroicons:information-circle-16-solid',
93
- success: 'heroicons:check-circle-16-solid',
94
- danger: 'heroicons:exclamation-circle-16-solid',
95
- warning: 'heroicons:exclamation-triangle-16-solid',
96
- }[props.color as never] ?? null;
97
-
98
- return iconName ?? props.icon;
99
- });
100
101
  </script>