sprintify-ui 0.12.21 → 0.12.22

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.
@@ -9133,16 +9133,19 @@ const _2 = {
9133
9133
  const w = ["btn"];
9134
9134
  return o.color && (o.color in r ? w.push(r[o.color]) : w.push("hover:enabled:opacity-80")), s.value && w.push((T = on[s.value]) == null ? void 0 : T.buttonClass), l.value && w.push("p-0 aspect-1 justify-center"), Qe(w, o.class);
9135
9135
  }), u = S(() => {
9136
- if (o.color && !(o.color in r)) {
9137
- const w = Sl(o.color);
9138
- return {
9139
- backgroundColor: w.backgroundColor,
9140
- color: w.textColor,
9141
- borderColor: w.borderColor,
9142
- borderWidth: "1px",
9143
- borderStyle: "solid"
9144
- };
9145
- }
9136
+ if (o.color && !(o.color in r))
9137
+ try {
9138
+ const w = Sl(o.color);
9139
+ return {
9140
+ backgroundColor: w.backgroundColor,
9141
+ color: w.textColor,
9142
+ borderColor: w.borderColor,
9143
+ borderWidth: "1px",
9144
+ borderStyle: "solid"
9145
+ };
9146
+ } catch {
9147
+ console.warn(`[BaseButton] "${o.color}" is not a valid color.`);
9148
+ }
9146
9149
  return {};
9147
9150
  }), c = S(() => {
9148
9151
  const w = ["flex items-center w-full"];
@@ -11718,11 +11721,15 @@ const YM = ["src"], GM = ["fill"], JM = ["font-size"], XM = { class: "truncate"
11718
11721
  },
11719
11722
  setup(n) {
11720
11723
  const t = n, e = S(() => {
11721
- const a = Sl(t.color, t.contrast == "high"), u = {
11722
- backgroundColor: a.backgroundColor,
11723
- color: a.textColor
11724
- };
11725
- return t.bordered && (u.borderColor = a.borderColor, u.borderWidth = "1px", u.borderStyle = "solid"), u;
11724
+ try {
11725
+ const a = Sl(t.color, t.contrast == "high"), u = {
11726
+ backgroundColor: a.backgroundColor,
11727
+ color: a.textColor
11728
+ };
11729
+ return t.bordered && (u.borderColor = a.borderColor, u.borderWidth = "1px", u.borderStyle = "solid"), u;
11730
+ } catch {
11731
+ return console.warn(`[BaseBadge] "${t.color}" is not a valid color.`), {};
11732
+ }
11726
11733
  }), r = S(() => Object.keys(on).includes(t.size) ? t.size : "md"), o = mf(), i = S(() => !!o.default), s = S(() => {
11727
11734
  const a = "inline-flex items-center rounded leading-tight", u = {
11728
11735
  xs: "text-[9px]",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.12.21",
3
+ "version": "0.12.22",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "generate-llm-txt": "node scripts/generate-llm-txt.js",
@@ -43,20 +43,25 @@ const props = withDefaults(
43
43
  );
44
44
 
45
45
  const colorStyle = computed((): Record<string, string> => {
46
- const config = getColorConfig(props.color, props.contrast == 'high');
47
-
48
- const styles: Record<string, string> = {
49
- backgroundColor: config.backgroundColor,
50
- color: config.textColor,
51
- };
52
-
53
- if (props.bordered) {
54
- styles.borderColor = config.borderColor;
55
- styles.borderWidth = '1px';
56
- styles.borderStyle = 'solid';
46
+ try {
47
+ const config = getColorConfig(props.color, props.contrast == 'high');
48
+
49
+ const styles: Record<string, string> = {
50
+ backgroundColor: config.backgroundColor,
51
+ color: config.textColor,
52
+ };
53
+
54
+ if (props.bordered) {
55
+ styles.borderColor = config.borderColor;
56
+ styles.borderWidth = '1px';
57
+ styles.borderStyle = 'solid';
58
+ }
59
+
60
+ return styles;
61
+ } catch {
62
+ console.warn(`[BaseBadge] "${props.color}" is not a valid color.`);
63
+ return {};
57
64
  }
58
-
59
- return styles;
60
65
  });
61
66
 
62
67
  const sizeInternal = computed(() => {
@@ -207,15 +207,19 @@ const classes = computed(() => {
207
207
 
208
208
  const styles = computed(() => {
209
209
  if (props.color && !(props.color in colors)) {
210
- const config = getColorConfig(props.color);
211
-
212
- return {
213
- backgroundColor: config.backgroundColor,
214
- color: config.textColor,
215
- borderColor: config.borderColor,
216
- borderWidth: '1px',
217
- borderStyle: 'solid',
218
- };
210
+ try {
211
+ const config = getColorConfig(props.color);
212
+
213
+ return {
214
+ backgroundColor: config.backgroundColor,
215
+ color: config.textColor,
216
+ borderColor: config.borderColor,
217
+ borderWidth: '1px',
218
+ borderStyle: 'solid',
219
+ };
220
+ } catch {
221
+ console.warn(`[BaseButton] "${props.color}" is not a valid color.`);
222
+ }
219
223
  }
220
224
 
221
225
  return {};