windly-ui 1.0.9 → 1.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.
Files changed (63) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/Alert.d.vue.ts +18 -0
  3. package/dist/runtime/components/Alert.vue +21 -3
  4. package/dist/runtime/components/Alert.vue.d.ts +18 -0
  5. package/dist/runtime/components/Avatar.d.vue.ts +5 -5
  6. package/dist/runtime/components/Avatar.vue.d.ts +5 -5
  7. package/dist/runtime/components/Badge.d.vue.ts +5 -5
  8. package/dist/runtime/components/Badge.vue.d.ts +5 -5
  9. package/dist/runtime/components/Breadcrumbs.vue +2 -2
  10. package/dist/runtime/components/Button.d.vue.ts +5 -5
  11. package/dist/runtime/components/Button.vue +5 -5
  12. package/dist/runtime/components/Button.vue.d.ts +5 -5
  13. package/dist/runtime/components/Card.d.vue.ts +27 -0
  14. package/dist/runtime/components/Card.vue +12 -8
  15. package/dist/runtime/components/Card.vue.d.ts +27 -0
  16. package/dist/runtime/components/Checkbox.d.vue.ts +14 -5
  17. package/dist/runtime/components/Checkbox.vue +11 -4
  18. package/dist/runtime/components/Checkbox.vue.d.ts +14 -5
  19. package/dist/runtime/components/Chip.d.vue.ts +5 -5
  20. package/dist/runtime/components/Chip.vue.d.ts +5 -5
  21. package/dist/runtime/components/CodeBlock.vue +50 -8
  22. package/dist/runtime/components/Date.d.vue.ts +22 -4
  23. package/dist/runtime/components/Date.vue +39 -15
  24. package/dist/runtime/components/Date.vue.d.ts +22 -4
  25. package/dist/runtime/components/Dialog.d.vue.ts +7 -9
  26. package/dist/runtime/components/Dialog.vue +23 -4
  27. package/dist/runtime/components/Dialog.vue.d.ts +7 -9
  28. package/dist/runtime/components/Divider.vue +1 -1
  29. package/dist/runtime/components/Dropdown.d.vue.ts +2 -2
  30. package/dist/runtime/components/Dropdown.vue +71 -23
  31. package/dist/runtime/components/Dropdown.vue.d.ts +2 -2
  32. package/dist/runtime/components/FileUploader.d.vue.ts +1 -1
  33. package/dist/runtime/components/FileUploader.vue +11 -9
  34. package/dist/runtime/components/FileUploader.vue.d.ts +1 -1
  35. package/dist/runtime/components/Image.d.vue.ts +11 -1
  36. package/dist/runtime/components/Image.vue +15 -0
  37. package/dist/runtime/components/Image.vue.d.ts +11 -1
  38. package/dist/runtime/components/Input.d.vue.ts +5 -1
  39. package/dist/runtime/components/Input.vue +53 -14
  40. package/dist/runtime/components/Input.vue.d.ts +5 -1
  41. package/dist/runtime/components/Radio.d.vue.ts +2 -2
  42. package/dist/runtime/components/Radio.vue +9 -7
  43. package/dist/runtime/components/Radio.vue.d.ts +2 -2
  44. package/dist/runtime/components/ScrollArea.vue +4 -0
  45. package/dist/runtime/components/Select.d.vue.ts +1 -1
  46. package/dist/runtime/components/Select.vue +11 -9
  47. package/dist/runtime/components/Select.vue.d.ts +1 -1
  48. package/dist/runtime/components/Tabs.d.vue.ts +8 -1
  49. package/dist/runtime/components/Tabs.vue +21 -6
  50. package/dist/runtime/components/Tabs.vue.d.ts +8 -1
  51. package/dist/runtime/components/Textarea.d.vue.ts +39 -185
  52. package/dist/runtime/components/Textarea.vue +94 -71
  53. package/dist/runtime/components/Textarea.vue.d.ts +39 -185
  54. package/dist/runtime/components/Toggle.d.vue.ts +9 -3
  55. package/dist/runtime/components/Toggle.vue +70 -122
  56. package/dist/runtime/components/Toggle.vue.d.ts +9 -3
  57. package/dist/runtime/components/Tooltip.vue +3 -0
  58. package/dist/runtime/components/uiProps.d.ts +2 -2
  59. package/dist/runtime/components/uiProps.js +2 -2
  60. package/dist/runtime/components/useUiClasses.d.ts +3 -1
  61. package/dist/runtime/components/useUiClasses.js +7 -5
  62. package/dist/runtime/docs/index.vue +163 -72
  63. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windly-ui",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "builder": {
5
5
  "@nuxt/module-builder": "1.0.2",
6
6
  "unbuild": "3.6.1"
@@ -33,6 +33,14 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
33
33
  type: BooleanConstructor;
34
34
  default: boolean;
35
35
  };
36
+ confirmColor: {
37
+ type: StringConstructor;
38
+ default: string;
39
+ };
40
+ cancelColor: {
41
+ type: StringConstructor;
42
+ default: string;
43
+ };
36
44
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
45
  "update:isOpen": (...args: any[]) => void;
38
46
  confirm: (...args: any[]) => void;
@@ -65,6 +73,14 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
65
73
  type: BooleanConstructor;
66
74
  default: boolean;
67
75
  };
76
+ confirmColor: {
77
+ type: StringConstructor;
78
+ default: string;
79
+ };
80
+ cancelColor: {
81
+ type: StringConstructor;
82
+ default: string;
83
+ };
68
84
  }>> & Readonly<{
69
85
  "onUpdate:isOpen"?: ((...args: any[]) => any) | undefined;
70
86
  onConfirm?: ((...args: any[]) => any) | undefined;
@@ -75,6 +91,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
75
91
  cancelBtnText: string;
76
92
  showConfirmBtn: boolean;
77
93
  showCloseIcon: boolean;
94
+ confirmColor: string;
95
+ cancelColor: string;
78
96
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
79
97
  type __VLS_Slots = {
80
98
  header?: ((props: {}) => any) | undefined;
@@ -31,9 +31,28 @@ const props = defineProps({
31
31
  showCloseIcon: {
32
32
  type: Boolean,
33
33
  default: false
34
+ },
35
+ confirmColor: {
36
+ type: String,
37
+ default: "indigo-400"
38
+ },
39
+ cancelColor: {
40
+ type: String,
41
+ default: "gray-200"
34
42
  }
35
43
  });
36
44
  const attrs = useAttrs();
45
+ const isHex = (val) => val.startsWith("#");
46
+ const cancelBtnClass = computed(() => [
47
+ "mr-2 px-4 py-2 rounded-lg transition",
48
+ isHex(props.cancelColor) ? "text-gray-700 hover:opacity-90" : `bg-${props.cancelColor} text-gray-700 hover:bg-gray-300`
49
+ ]);
50
+ const cancelBtnStyle = computed(() => isHex(props.cancelColor) ? { backgroundColor: props.cancelColor } : {});
51
+ const confirmBtnClass = computed(() => [
52
+ "px-4 py-2 rounded-lg transition text-white",
53
+ isHex(props.confirmColor) ? "hover:opacity-90" : `bg-${props.confirmColor} hover:opacity-90`
54
+ ]);
55
+ const confirmBtnStyle = computed(() => isHex(props.confirmColor) ? { backgroundColor: props.confirmColor } : {});
37
56
  const wrapperClass = computed(() => attrs.class || "");
38
57
  const wrapperStyle = computed(() => attrs.style || {});
39
58
  const dialogAttributes = computed(() => {
@@ -80,12 +99,11 @@ const handleConfirm = () => {
80
99
  <!-- Actions -->
81
100
  <slot name="actions" :confirm="handleConfirm" :cancel="close">
82
101
  <div class="flex justify-end">
83
- <button @click="close" class="mr-2 px-4 py-2 bg-gray-200 text-gray-700 rounded-lg transition hover:bg-gray-300">
102
+ <button @click="close" :class="cancelBtnClass" :style="cancelBtnStyle">
84
103
  {{ cancelBtnText }}
85
104
  </button>
86
105
 
87
- <button v-if="showConfirmBtn" @click="handleConfirm"
88
- class="px-4 py-2 bg-blue-500 text-white rounded-lg transition hover:bg-blue-600">
106
+ <button v-if="showConfirmBtn" @click="handleConfirm" :class="confirmBtnClass" :style="confirmBtnStyle">
89
107
  {{ confirmBtnText }}
90
108
  </button>
91
109
  </div>
@@ -33,6 +33,14 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
33
33
  type: BooleanConstructor;
34
34
  default: boolean;
35
35
  };
36
+ confirmColor: {
37
+ type: StringConstructor;
38
+ default: string;
39
+ };
40
+ cancelColor: {
41
+ type: StringConstructor;
42
+ default: string;
43
+ };
36
44
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
45
  "update:isOpen": (...args: any[]) => void;
38
46
  confirm: (...args: any[]) => void;
@@ -65,6 +73,14 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
65
73
  type: BooleanConstructor;
66
74
  default: boolean;
67
75
  };
76
+ confirmColor: {
77
+ type: StringConstructor;
78
+ default: string;
79
+ };
80
+ cancelColor: {
81
+ type: StringConstructor;
82
+ default: string;
83
+ };
68
84
  }>> & Readonly<{
69
85
  "onUpdate:isOpen"?: ((...args: any[]) => any) | undefined;
70
86
  onConfirm?: ((...args: any[]) => any) | undefined;
@@ -75,6 +91,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
75
91
  cancelBtnText: string;
76
92
  showConfirmBtn: boolean;
77
93
  showCloseIcon: boolean;
94
+ confirmColor: string;
95
+ cancelColor: string;
78
96
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
79
97
  type __VLS_Slots = {
80
98
  header?: ((props: {}) => any) | undefined;
@@ -11,7 +11,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
11
11
  readonly type: StringConstructor;
12
12
  readonly default: "";
13
13
  };
14
- disable: {
14
+ disabled: {
15
15
  readonly type: BooleanConstructor;
16
16
  readonly default: false;
17
17
  };
@@ -21,7 +21,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
21
21
  };
22
22
  color: {
23
23
  readonly type: StringConstructor;
24
- readonly default: "blue-900";
24
+ readonly default: "indigo-400";
25
25
  };
26
26
  rounded: {
27
27
  readonly type: StringConstructor;
@@ -72,7 +72,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
72
72
  readonly type: StringConstructor;
73
73
  readonly default: "";
74
74
  };
75
- disable: {
75
+ disabled: {
76
76
  readonly type: BooleanConstructor;
77
77
  readonly default: false;
78
78
  };
@@ -82,7 +82,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
82
82
  };
83
83
  color: {
84
84
  readonly type: StringConstructor;
85
- readonly default: "blue-900";
85
+ readonly default: "indigo-400";
86
86
  };
87
87
  rounded: {
88
88
  readonly type: StringConstructor;
@@ -121,6 +121,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
121
121
  default: boolean;
122
122
  };
123
123
  }>> & Readonly<{}>, {
124
+ disabled: boolean;
124
125
  image: string;
125
126
  color: string;
126
127
  size: string;
@@ -128,7 +129,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
128
129
  contentClass: string;
129
130
  contentStyle: string;
130
131
  textColor: string;
131
- disable: boolean;
132
132
  loading: boolean;
133
133
  rounded: string;
134
134
  iconSize: string;
@@ -11,7 +11,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
11
11
  readonly type: StringConstructor;
12
12
  readonly default: "";
13
13
  };
14
- disable: {
14
+ disabled: {
15
15
  readonly type: BooleanConstructor;
16
16
  readonly default: false;
17
17
  };
@@ -21,7 +21,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
21
21
  };
22
22
  color: {
23
23
  readonly type: StringConstructor;
24
- readonly default: "blue-900";
24
+ readonly default: "indigo-400";
25
25
  };
26
26
  rounded: {
27
27
  readonly type: StringConstructor;
@@ -72,7 +72,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
72
72
  readonly type: StringConstructor;
73
73
  readonly default: "";
74
74
  };
75
- disable: {
75
+ disabled: {
76
76
  readonly type: BooleanConstructor;
77
77
  readonly default: false;
78
78
  };
@@ -82,7 +82,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
82
82
  };
83
83
  color: {
84
84
  readonly type: StringConstructor;
85
- readonly default: "blue-900";
85
+ readonly default: "indigo-400";
86
86
  };
87
87
  rounded: {
88
88
  readonly type: StringConstructor;
@@ -121,6 +121,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
121
121
  default: boolean;
122
122
  };
123
123
  }>> & Readonly<{}>, {
124
+ disabled: boolean;
124
125
  image: string;
125
126
  color: string;
126
127
  size: string;
@@ -128,7 +129,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
128
129
  contentClass: string;
129
130
  contentStyle: string;
130
131
  textColor: string;
131
- disable: boolean;
132
132
  loading: boolean;
133
133
  rounded: string;
134
134
  iconSize: string;
@@ -15,7 +15,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
15
15
  readonly type: StringConstructor;
16
16
  readonly default: "";
17
17
  };
18
- disable: {
18
+ disabled: {
19
19
  readonly type: BooleanConstructor;
20
20
  readonly default: false;
21
21
  };
@@ -25,7 +25,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
25
25
  };
26
26
  color: {
27
27
  readonly type: StringConstructor;
28
- readonly default: "blue-900";
28
+ readonly default: "indigo-400";
29
29
  };
30
30
  rounded: {
31
31
  readonly type: StringConstructor;
@@ -68,7 +68,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
68
68
  readonly type: StringConstructor;
69
69
  readonly default: "";
70
70
  };
71
- disable: {
71
+ disabled: {
72
72
  readonly type: BooleanConstructor;
73
73
  readonly default: false;
74
74
  };
@@ -78,7 +78,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
78
78
  };
79
79
  color: {
80
80
  readonly type: StringConstructor;
81
- readonly default: "blue-900";
81
+ readonly default: "indigo-400";
82
82
  };
83
83
  rounded: {
84
84
  readonly type: StringConstructor;
@@ -109,6 +109,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
109
109
  default: boolean;
110
110
  };
111
111
  }>> & Readonly<{}>, {
112
+ disabled: boolean;
112
113
  color: string;
113
114
  content: string;
114
115
  size: string;
@@ -118,7 +119,6 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
118
119
  contentClass: string;
119
120
  contentStyle: string;
120
121
  textColor: string;
121
- disable: boolean;
122
122
  loading: boolean;
123
123
  rounded: string;
124
124
  iconSize: string;
@@ -15,7 +15,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
15
15
  readonly type: StringConstructor;
16
16
  readonly default: "";
17
17
  };
18
- disable: {
18
+ disabled: {
19
19
  readonly type: BooleanConstructor;
20
20
  readonly default: false;
21
21
  };
@@ -25,7 +25,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
25
25
  };
26
26
  color: {
27
27
  readonly type: StringConstructor;
28
- readonly default: "blue-900";
28
+ readonly default: "indigo-400";
29
29
  };
30
30
  rounded: {
31
31
  readonly type: StringConstructor;
@@ -68,7 +68,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
68
68
  readonly type: StringConstructor;
69
69
  readonly default: "";
70
70
  };
71
- disable: {
71
+ disabled: {
72
72
  readonly type: BooleanConstructor;
73
73
  readonly default: false;
74
74
  };
@@ -78,7 +78,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
78
78
  };
79
79
  color: {
80
80
  readonly type: StringConstructor;
81
- readonly default: "blue-900";
81
+ readonly default: "indigo-400";
82
82
  };
83
83
  rounded: {
84
84
  readonly type: StringConstructor;
@@ -109,6 +109,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
109
109
  default: boolean;
110
110
  };
111
111
  }>> & Readonly<{}>, {
112
+ disabled: boolean;
112
113
  color: string;
113
114
  content: string;
114
115
  size: string;
@@ -118,7 +119,6 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
118
119
  contentClass: string;
119
120
  contentStyle: string;
120
121
  textColor: string;
121
- disable: boolean;
122
122
  loading: boolean;
123
123
  rounded: string;
124
124
  iconSize: string;
@@ -21,11 +21,11 @@ const props = defineProps({
21
21
  },
22
22
  activeColor: {
23
23
  type: String,
24
- default: "primary"
24
+ default: "indigo-400"
25
25
  },
26
26
  separatorColor: {
27
27
  type: String,
28
- default: "grey-6"
28
+ default: "gray-400"
29
29
  }
30
30
  });
31
31
  const route = useRoute();
@@ -11,7 +11,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
11
11
  readonly type: StringConstructor;
12
12
  readonly default: "";
13
13
  };
14
- disable: {
14
+ disabled: {
15
15
  readonly type: BooleanConstructor;
16
16
  readonly default: false;
17
17
  };
@@ -21,7 +21,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
21
21
  };
22
22
  color: {
23
23
  readonly type: StringConstructor;
24
- readonly default: "blue-900";
24
+ readonly default: "indigo-400";
25
25
  };
26
26
  rounded: {
27
27
  readonly type: StringConstructor;
@@ -102,7 +102,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
102
102
  readonly type: StringConstructor;
103
103
  readonly default: "";
104
104
  };
105
- disable: {
105
+ disabled: {
106
106
  readonly type: BooleanConstructor;
107
107
  readonly default: false;
108
108
  };
@@ -112,7 +112,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
112
112
  };
113
113
  color: {
114
114
  readonly type: StringConstructor;
115
- readonly default: "blue-900";
115
+ readonly default: "indigo-400";
116
116
  };
117
117
  rounded: {
118
118
  readonly type: StringConstructor;
@@ -181,6 +181,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
181
181
  }>> & Readonly<{
182
182
  onClick?: ((...args: any[]) => any) | undefined;
183
183
  }>, {
184
+ disabled: boolean;
184
185
  dense: boolean;
185
186
  label: string;
186
187
  class: string;
@@ -192,7 +193,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
192
193
  contentClass: string;
193
194
  contentStyle: string;
194
195
  textColor: string;
195
- disable: boolean;
196
196
  loading: boolean;
197
197
  rounded: string;
198
198
  iconSize: string;
@@ -26,7 +26,7 @@ const {
26
26
  contentClass,
27
27
  contentStyle,
28
28
  textColor,
29
- disable,
29
+ disabled,
30
30
  loading,
31
31
  color,
32
32
  rounded,
@@ -66,9 +66,9 @@ const computedClass = computed(() => {
66
66
  cls += props.dense ? ` ${paddingClass.dense[size.value]}` : ` ${paddingClass.default[size.value]}`;
67
67
  cls += props.unelevated ? " no-shadow" : " shadow-md";
68
68
  cls += props.stacked ? " flex flex-col items-center justify-center gap-2" : " flex items-center justify-center gap-2";
69
- cls += disable.value ? " opacity-50 cursor-not-allowed" : " cursor-pointer";
69
+ cls += disabled.value ? " opacity-50 cursor-not-allowed" : " cursor-pointer";
70
70
  cls += loading.value ? " opacity-75 cursor-progress" : "";
71
- cls += props.gradient ? ` bg-gradient-to-br from-${color.value} to-${computedColor2.value} hover:bg-gradient-to-tl text-${computedTextColor.value}` : !props.flat && !props.outline ? ` bg-${color.value} hover:bg-${computedColor2.value} text-${computedTextColor.value}` : "";
71
+ cls += props.gradient ? ` bg-gradient-to-br from-${color.value} to-${computedColor2.value} bg-[length:200%_100%] bg-left hover:bg-right text-${computedTextColor.value}` : !props.flat && !props.outline ? ` bg-${color.value} hover:bg-${computedColor2.value} text-${computedTextColor.value}` : "";
72
72
  return cls;
73
73
  });
74
74
  const computedIconClass = computed(() => {
@@ -76,7 +76,7 @@ const computedIconClass = computed(() => {
76
76
  });
77
77
  const computedProps = computed(() => ({
78
78
  class: computedClass.value,
79
- disabled: disable.value || loading.value
79
+ disabled: disabled.value || loading.value
80
80
  }));
81
81
  const computedTextColor = computed(() => {
82
82
  if (textColor.value) {
@@ -99,7 +99,7 @@ const computedColor2 = computed(() => {
99
99
  return color.value;
100
100
  });
101
101
  function onClick() {
102
- if (!loading.value && !disable.value && !props.to) {
102
+ if (!loading.value && !disabled.value && !props.to) {
103
103
  emit("click");
104
104
  }
105
105
  }
@@ -11,7 +11,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
11
11
  readonly type: StringConstructor;
12
12
  readonly default: "";
13
13
  };
14
- disable: {
14
+ disabled: {
15
15
  readonly type: BooleanConstructor;
16
16
  readonly default: false;
17
17
  };
@@ -21,7 +21,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
21
21
  };
22
22
  color: {
23
23
  readonly type: StringConstructor;
24
- readonly default: "blue-900";
24
+ readonly default: "indigo-400";
25
25
  };
26
26
  rounded: {
27
27
  readonly type: StringConstructor;
@@ -102,7 +102,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
102
102
  readonly type: StringConstructor;
103
103
  readonly default: "";
104
104
  };
105
- disable: {
105
+ disabled: {
106
106
  readonly type: BooleanConstructor;
107
107
  readonly default: false;
108
108
  };
@@ -112,7 +112,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
112
112
  };
113
113
  color: {
114
114
  readonly type: StringConstructor;
115
- readonly default: "blue-900";
115
+ readonly default: "indigo-400";
116
116
  };
117
117
  rounded: {
118
118
  readonly type: StringConstructor;
@@ -181,6 +181,7 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
181
181
  }>> & Readonly<{
182
182
  onClick?: ((...args: any[]) => any) | undefined;
183
183
  }>, {
184
+ disabled: boolean;
184
185
  dense: boolean;
185
186
  label: string;
186
187
  class: string;
@@ -192,7 +193,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
192
193
  contentClass: string;
193
194
  contentStyle: string;
194
195
  textColor: string;
195
- disable: boolean;
196
196
  loading: boolean;
197
197
  rounded: string;
198
198
  iconSize: string;
@@ -35,6 +35,18 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
35
35
  type: StringConstructor;
36
36
  default: string;
37
37
  };
38
+ maxHeight: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
42
+ stickyHeader: {
43
+ type: BooleanConstructor;
44
+ default: boolean;
45
+ };
46
+ stickyFooter: {
47
+ type: BooleanConstructor;
48
+ default: boolean;
49
+ };
38
50
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
39
51
  flat: {
40
52
  type: BooleanConstructor;
@@ -64,14 +76,29 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
64
76
  type: StringConstructor;
65
77
  default: string;
66
78
  };
79
+ maxHeight: {
80
+ type: StringConstructor;
81
+ default: string;
82
+ };
83
+ stickyHeader: {
84
+ type: BooleanConstructor;
85
+ default: boolean;
86
+ };
87
+ stickyFooter: {
88
+ type: BooleanConstructor;
89
+ default: boolean;
90
+ };
67
91
  }>> & Readonly<{}>, {
68
92
  dense: boolean;
69
93
  color: string;
70
94
  square: boolean;
71
95
  flat: boolean;
96
+ maxHeight: string;
72
97
  width: string;
73
98
  borderColor: string;
74
99
  bordered: boolean;
100
+ stickyHeader: boolean;
101
+ stickyFooter: boolean;
75
102
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
76
103
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
77
104
  declare const _default: typeof __VLS_export;
@@ -10,7 +10,10 @@ const props = defineProps({
10
10
  bordered: { type: Boolean, default: true },
11
11
  color: { type: String, default: "white" },
12
12
  borderColor: { type: String, default: "gray-200" },
13
- width: { type: String, default: "100%" }
13
+ width: { type: String, default: "100%" },
14
+ maxHeight: { type: String, default: "" },
15
+ stickyHeader: { type: Boolean, default: false },
16
+ stickyFooter: { type: Boolean, default: false }
14
17
  });
15
18
  const isHex = (val) => val.startsWith("#");
16
19
  const cardStyle = computed(() => {
@@ -18,6 +21,9 @@ const cardStyle = computed(() => {
18
21
  width: props.width,
19
22
  maxWidth: "80vw"
20
23
  };
24
+ if (props.maxHeight) {
25
+ style.maxHeight = props.maxHeight;
26
+ }
21
27
  if (isHex(props.color)) {
22
28
  style.backgroundColor = props.color;
23
29
  }
@@ -32,7 +38,8 @@ const cardClass = computed(() => [
32
38
  props.square ? "rounded-none" : "rounded-md",
33
39
  props.bordered ? "border" : "",
34
40
  !isHex(props.borderColor) && props.bordered ? `border-${props.borderColor}` : "",
35
- !isHex(props.color) ? `bg-${props.color}` : ""
41
+ !isHex(props.color) ? `bg-${props.color}` : "",
42
+ props.maxHeight || props.stickyHeader || props.stickyFooter ? "flex flex-col overflow-hidden" : ""
36
43
  ]);
37
44
  const sectionPadding = computed(
38
45
  () => props.dense ? "p-0" : "p-4"
@@ -45,24 +52,21 @@ const sectionPadding = computed(
45
52
  :style="cardStyle"
46
53
  v-bind="$attrs"
47
54
  >
48
- <!-- Header -->
49
55
  <div
50
56
  v-if="$slots.header"
51
- :class="sectionPadding"
57
+ :class="[sectionPadding, 'shrink-0']"
52
58
  class="border-b border-gray-200"
53
59
  >
54
60
  <slot name="header" />
55
61
  </div>
56
62
 
57
- <!-- Content -->
58
- <div :class="sectionPadding">
63
+ <div :class="[sectionPadding, 'flex-1 min-h-0 overflow-y-auto']">
59
64
  <slot />
60
65
  </div>
61
66
 
62
- <!-- Footer -->
63
67
  <div
64
68
  v-if="$slots.footer"
65
- :class="sectionPadding"
69
+ :class="[sectionPadding, 'shrink-0']"
66
70
  class="border-t border-gray-200"
67
71
  >
68
72
  <slot name="footer" />
@@ -35,6 +35,18 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
35
35
  type: StringConstructor;
36
36
  default: string;
37
37
  };
38
+ maxHeight: {
39
+ type: StringConstructor;
40
+ default: string;
41
+ };
42
+ stickyHeader: {
43
+ type: BooleanConstructor;
44
+ default: boolean;
45
+ };
46
+ stickyFooter: {
47
+ type: BooleanConstructor;
48
+ default: boolean;
49
+ };
38
50
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
39
51
  flat: {
40
52
  type: BooleanConstructor;
@@ -64,14 +76,29 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
64
76
  type: StringConstructor;
65
77
  default: string;
66
78
  };
79
+ maxHeight: {
80
+ type: StringConstructor;
81
+ default: string;
82
+ };
83
+ stickyHeader: {
84
+ type: BooleanConstructor;
85
+ default: boolean;
86
+ };
87
+ stickyFooter: {
88
+ type: BooleanConstructor;
89
+ default: boolean;
90
+ };
67
91
  }>> & Readonly<{}>, {
68
92
  dense: boolean;
69
93
  color: string;
70
94
  square: boolean;
71
95
  flat: boolean;
96
+ maxHeight: string;
72
97
  width: string;
73
98
  borderColor: string;
74
99
  bordered: boolean;
100
+ stickyHeader: boolean;
101
+ stickyFooter: boolean;
75
102
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
76
103
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
77
104
  declare const _default: typeof __VLS_export;