sprintify-ui 0.10.66 → 0.10.67

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": "sprintify-ui",
3
- "version": "0.10.66",
3
+ "version": "0.10.67",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "rimraf dist && vue-tsc && vite build",
@@ -94,6 +94,8 @@ export const Sizes = (args) => ({
94
94
  <BaseBadge v-bind="args" :size="size">
95
95
  Administrator
96
96
  </BaseBadge>
97
+ <BaseBadge v-bind="args" :size="size">
98
+ </BaseBadge>
97
99
  </div>
98
100
  `,
99
101
  });
@@ -127,4 +129,4 @@ export const Wrap = (args) => ({
127
129
  </BaseBadge>
128
130
  </div>
129
131
  `,
130
- });
132
+ });
@@ -67,31 +67,52 @@ const sizeInternal = computed(() => {
67
67
  return props.size;
68
68
  });
69
69
 
70
+ const slots = useSlots();
71
+
72
+ const hasDefaultSlot = computed(() => !!(slots.default));
73
+
70
74
  const classes = computed(() => {
71
75
  const base = 'inline-flex items-center rounded leading-tight';
72
- const size = {
73
- xs: 'px-1 py-px text-[9px]',
74
- sm: 'px-1.5 py-px text-[10px]',
75
- md: 'px-1.5 py-0.5 text-xs',
76
- lg: 'px-1.5 py-0.5 text-sm',
77
- xl: 'px-2.5 py-1.5 text-sm',
76
+
77
+ const fontSize = {
78
+ xs: 'text-[9px]',
79
+ sm: 'text-[10px]',
80
+ md: 'text-xs',
81
+ lg: 'text-sm',
82
+ xl: 'text-sm',
83
+ }[sizeInternal.value];
84
+
85
+ const padding = {
86
+ xs: hasDefaultSlot.value ? 'px-1 py-px' : 'p-[3.7px]',
87
+ sm: hasDefaultSlot.value ? 'px-1.5 py-px' : 'p-[3.7px]',
88
+ md: hasDefaultSlot.value ? 'px-1.5 py-0.5' : 'p-1',
89
+ lg: hasDefaultSlot.value ? 'px-1.5 py-0.5' : 'p-1',
90
+ xl: hasDefaultSlot.value ? 'px-2.5 py-1.5' : 'p-1.5',
78
91
  }[sizeInternal.value];
79
92
 
80
93
  const wrap = props.wrap ? '' : 'whitespace-nowrap';
81
94
 
82
- return twMerge(base, wrap, size, props.class);
95
+ return twMerge(base, wrap, fontSize, padding, props.class);
83
96
  })
84
97
 
85
98
  const iconSizeClasses = computed(() => {
86
99
 
87
100
  const size = {
88
- xs: 'h-2 w-2 mr-1',
89
- sm: 'h-2.5 w-2.5 mr-1',
90
- md: 'h-3 w-3 mr-1',
91
- lg: 'h-4 w-4 mr-1',
92
- xl: 'h-5 w-5 mr-1.5',
101
+ xs: 'h-2 w-2',
102
+ sm: 'h-2.5 w-2.5',
103
+ md: 'h-3 w-3',
104
+ lg: 'h-4 w-4',
105
+ xl: 'h-5 w-5',
106
+ }[sizeInternal.value];
107
+
108
+ const margin = {
109
+ xs: hasDefaultSlot.value ? 'mr-1' : '',
110
+ sm: hasDefaultSlot.value ? 'mr-1' : '',
111
+ md: hasDefaultSlot.value ? 'mr-1' : '',
112
+ lg: hasDefaultSlot.value ? 'mr-1' : '',
113
+ xl: hasDefaultSlot.value ? 'mr-1.5' : '',
93
114
  }[sizeInternal.value];
94
115
 
95
- return size;
116
+ return twMerge(size, margin);
96
117
  });
97
118
  </script>