ketekny-ui-kit 1.0.25 → 1.0.27

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,7 +1,7 @@
1
1
  {
2
2
  "name": "ketekny-ui-kit",
3
3
  "type": "module",
4
- "version": "1.0.25",
4
+ "version": "1.0.27",
5
5
  "description": "A Vue 3 UI component library with Tailwind CSS styling",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -7,16 +7,20 @@
7
7
  h1, h2, h3, h4{
8
8
  color: theme('colors.primary');
9
9
  font-weight: bold;
10
+ line-height: 1.2;
10
11
  }
11
12
  h1{
12
- font-size: 2.5em;
13
+ font-size: clamp(1.625rem, 4vw + 0.75rem, 2.5rem);
13
14
  }
14
15
 
15
16
  h2{
16
- font-size: 2em;
17
+ font-size: clamp(1.375rem, 3vw + 0.7rem, 2rem);
17
18
  }
18
19
  h3{
19
- font-size: 1.5em;
20
+ font-size: clamp(1.125rem, 2vw + 0.6rem, 1.5rem);
21
+ }
22
+ h4{
23
+ font-size: clamp(1rem, 1.5vw + 0.55rem, 1.25rem);
20
24
  }
21
25
 
22
26
  .group{
@@ -36,4 +40,4 @@ li{
36
40
  @apply p-2 rounded cursor-pointer ;
37
41
 
38
42
  }
39
- }
43
+ }
package/src/ui/kAlert.vue CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  <!-- Alert card -->
8
8
  <div
9
- class="relative w-full max-w-sm p-6 space-y-4 text-center bg-white border shadow-2xl z-5010 rounded-2xl border-primary/20 ring-1 ring-primary/10"
9
+ class="relative w-full max-w-sm p-6 space-y-4 text-center bg-white dark:bg-slate-900 border shadow-2xl z-5010 rounded-2xl border-primary/20 dark:border-slate-700 ring-1 ring-primary/10 dark:ring-slate-700/50"
10
10
  :class="['border-semantic-' + type + '-border']"
11
11
  style="z-index: 5010"
12
12
  >
@@ -29,7 +29,7 @@
29
29
  </div>
30
30
 
31
31
  <!-- Optional message -->
32
- <p v-if="message" class="leading-relaxed text-gray-600 text">
32
+ <p v-if="message" class="leading-relaxed text-gray-600 dark:text-slate-300 text">
33
33
  <span v-html="message" />
34
34
  </p>
35
35
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="['rounded-lg border border-primary/15', disabled ? 'pointer-events-none opacity-60' : '']">
2
+ <div :class="['k-datatable-wrapper rounded-lg border border-primary/15', disabled ? 'pointer-events-none opacity-60' : '']">
3
3
  <EasyDataTable
4
4
  v-bind="$attrs"
5
5
  :headers="headers"
@@ -102,6 +102,15 @@ export default {
102
102
  </script>
103
103
 
104
104
  <style>
105
+ .k-datatable-wrapper {
106
+ overflow-x: auto;
107
+ -webkit-overflow-scrolling: touch;
108
+ }
109
+
110
+ .k-datatable-wrapper .customize-table {
111
+ min-width: 640px;
112
+ }
113
+
105
114
  .customize-table {
106
115
  --easy-table-border: none;
107
116
  --easy-table-row-border: 1px solid #d1d5db;
@@ -143,13 +152,6 @@ export default {
143
152
  --easy-table-loading-mask-background-color: rgba(255, 255, 255, 0.6);
144
153
  }
145
154
 
146
- .customize-table {
147
- --easy-table-border: none;
148
- --easy-table-row-border: 1px solid #d1d5db;
149
- /* ... your other variables ... */
150
- --easy-table-footer-padding: 1rem;
151
- }
152
-
153
155
  /* Target the rows-per-page dropdown */
154
156
  .customize-table .easy-data-table__footer select {
155
157
  background-color: #fff; /* white dropdown background */
@@ -164,4 +166,15 @@ export default {
164
166
  background-color: #fff;
165
167
  color: #1f2937;
166
168
  }
169
+
170
+ @media (max-width: 640px) {
171
+ .k-datatable-wrapper .customize-table {
172
+ --easy-table-header-font-size: 12px;
173
+ --easy-table-header-item-padding: 0.5rem 0.625rem;
174
+ --easy-table-body-row-font-size: 12px;
175
+ --easy-table-body-item-padding: 0.5rem 0.625rem;
176
+ --easy-table-footer-font-size: 12px;
177
+ --easy-table-footer-padding: 0.75rem;
178
+ }
179
+ }
167
180
  </style>
@@ -8,7 +8,7 @@
8
8
  <transition name="dialog">
9
9
  <div
10
10
  ref="dialogPanel"
11
- class="relative bg-white shadow-lg overflow-hidden rounded-2xl flex flex-col max-h-[90vh] m-4"
11
+ class="relative bg-white dark:bg-slate-900 shadow-lg overflow-hidden rounded-2xl flex flex-col max-h-[calc(100dvh-1rem)] sm:max-h-[90vh] m-2 sm:m-4"
12
12
  :class="dialogClasses"
13
13
  :role="'dialog'"
14
14
  :aria-modal="'true'"
@@ -17,8 +17,8 @@
17
17
  v-show="visible"
18
18
  >
19
19
  <!-- Header -->
20
- <div class="flex flex-row items-center p-4 text-white bg-sky-800 shrink-0">
21
- <div :id="titleId" class="text-xl font-semibold !text-white">{{ title }}</div>
20
+ <div class="flex flex-row items-center p-3 text-white bg-sky-800 shrink-0 sm:p-4">
21
+ <div :id="titleId" class="text-base font-semibold !text-white sm:text-xl">{{ title }}</div>
22
22
  <div class="flex-1" />
23
23
  <button
24
24
  type="button"
@@ -36,12 +36,15 @@
36
36
  </div>
37
37
 
38
38
  <!-- Scrollable slot content -->
39
- <div class="flex-1 p-4 overflow-auto bg-secondary">
39
+ <div class="flex-1 p-3 overflow-auto bg-secondary dark:bg-slate-800/60 sm:p-4">
40
40
  <slot></slot>
41
41
  </div>
42
42
 
43
43
  <!-- Footer -->
44
- <div v-if="$slots.footer" class="flex flex-row justify-end gap-2 p-4 shrink-0">
44
+ <div
45
+ v-if="$slots.footer"
46
+ class="flex flex-col-reverse gap-2 p-3 border-t shrink-0 border-slate-100 dark:border-slate-700 sm:flex-row sm:justify-end sm:p-4"
47
+ >
45
48
  <slot name="footer"></slot>
46
49
  </div>
47
50
  </div>
@@ -109,15 +112,15 @@ export default {
109
112
  },
110
113
  computed: {
111
114
  computedWidth() {
112
- return 'w-[600px] max-w-[calc(100vw-2rem)]'
115
+ return 'w-[96vw] sm:w-[600px] max-w-[calc(100vw-1rem)] sm:max-w-[calc(100vw-2rem)]'
113
116
  },
114
117
  dialogClasses() {
115
118
  if (this.width) {
116
- return this.width
119
+ return `${this.width} max-w-[calc(100vw-1rem)] sm:max-w-[calc(100vw-2rem)]`
117
120
  } else if (this.maximized) {
118
- return 'w-[calc(100vw-2rem)] max-w-none h-[90vh]'
121
+ return 'w-[calc(100vw-1rem)] sm:w-[calc(100vw-2rem)] max-w-none h-[calc(100dvh-1rem)] sm:h-[90vh]'
119
122
  } else {
120
- return this.computedWidth + ' max-h-[90vh]'
123
+ return this.computedWidth + ' max-h-[calc(100dvh-1rem)] sm:max-h-[90vh]'
121
124
  }
122
125
  },
123
126
  },
@@ -7,22 +7,24 @@
7
7
  <!-- <div class="fixed inset-0 bg-black bg-opacity-50 backdrop-blur-sm" @click="close"></div> -->
8
8
 
9
9
  <!-- Drawer -->
10
- <div class="fixed top-0 bottom-0 z-50 flex flex-col bg-white shadow-xl w-[400px] transition-all duration-500 " :class="side === 'right' ? 'right-0' : 'left-0'">
10
+ <div
11
+ class="fixed top-0 bottom-0 z-50 flex w-[calc(100vw-1rem)] max-w-full flex-col bg-white shadow-xl transition-all duration-500 dark:bg-slate-900 sm:w-[400px]"
12
+ :class="side === 'right' ? 'right-0' : 'left-0'">
11
13
  <!-- Header -->
12
- <div class="flex items-center justify-between p-4 text-white bg-primary">
13
- <div class="text-lg font-semibold">{{ title }}</div>
14
+ <div class="flex items-center justify-between p-3 text-white bg-primary dark:bg-sky-800 sm:p-4">
15
+ <div class="text-base font-semibold sm:text-lg">{{ title }}</div>
14
16
  <button @click="close" class="text-white hover:text-gray-200">
15
17
  <X class="w-5 h-5" />
16
18
  </button>
17
19
  </div>
18
20
 
19
21
  <!-- Content -->
20
- <div class="flex-1 p-4 overflow-auto bg-secondary">
22
+ <div class="flex-1 p-3 overflow-auto bg-secondary dark:bg-slate-800/60 sm:p-4">
21
23
  <slot></slot>
22
24
  </div>
23
25
 
24
26
  <!-- Footer -->
25
- <div class="p-4 bg-gray-100">
27
+ <div class="p-3 bg-gray-100 border-t border-slate-200 dark:bg-slate-800 dark:border-slate-700 sm:p-4">
26
28
  <slot name="footer"></slot>
27
29
  </div>
28
30
  </div>
package/src/ui/kMenu.vue CHANGED
@@ -24,7 +24,7 @@
24
24
  <div
25
25
  v-if="isOpen"
26
26
  ref="menuPanelRef"
27
- class="z-[9999] overflow-visible border rounded-lg shadow-lg bg-white/95 backdrop-blur-sm border-primary/20 ring-1 ring-primary/10"
27
+ class="z-[9999] overflow-auto border rounded-lg shadow-lg bg-white/95 backdrop-blur-sm border-primary/20 ring-1 ring-primary/10 max-h-[70vh]"
28
28
  :style="panelStyle"
29
29
  role="menu">
30
30
  <span
@@ -153,12 +153,14 @@ export default {
153
153
  const rect = trigger.getBoundingClientRect();
154
154
  const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
155
155
  const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
156
- const panelWidth = this.$refs.menuPanelRef?.offsetWidth || 224;
156
+ const preferredPanelWidth = this.$refs.menuPanelRef?.offsetWidth || 224;
157
157
  const viewportWidth = window.innerWidth;
158
158
  const viewportHeight = window.innerHeight;
159
159
  const pad = 8;
160
160
  const gap = 8;
161
161
  const panelHeight = this.$refs.menuPanelRef?.offsetHeight || 0;
162
+ const maxPanelWidth = Math.max(120, viewportWidth - pad * 2);
163
+ const panelWidth = Math.min(preferredPanelWidth, maxPanelWidth);
162
164
 
163
165
  // bottom-end (default): align panel right edge with trigger right edge, below trigger.
164
166
  const preferredLeft = rect.right + scrollLeft - panelWidth;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="w-full">
3
3
  <div
4
- class="relative w-full overflow-hidden rounded-full bg-slate-200"
4
+ class="relative w-full overflow-hidden rounded-full bg-slate-200 dark:bg-slate-700"
5
5
  :style="{ height: resolvedHeight }"
6
6
  role="progressbar"
7
7
  :aria-valuemin="0"
@@ -15,7 +15,7 @@
15
15
  />
16
16
  <span
17
17
  v-if="showValue"
18
- class="absolute inset-0 flex items-center justify-center text-xs font-semibold text-slate-700"
18
+ class="absolute inset-0 flex items-center justify-center text-xs font-semibold text-slate-700 dark:text-slate-200"
19
19
  >
20
20
  {{ Math.round(percentage) }}%
21
21
  </span>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="inline-flex overflow-hidden border rounded-md border-primary/25" style="width: fit-content;" :aria-disabled="disabled.toString()">
2
+ <div class="k-select-button inline-flex max-w-full overflow-x-auto border rounded-md border-primary/25" :aria-disabled="disabled.toString()">
3
3
 
4
4
  <button
5
5
  v-for="(option, index) in options"
@@ -34,7 +34,7 @@ export default {
34
34
  emits: ["update:modelValue"],
35
35
  computed: {
36
36
  baseClasses() {
37
- return "px-4 py-2 text-sm font-medium border-none focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:ring-inset";
37
+ return "shrink-0 whitespace-nowrap px-3 py-2.5 text-sm font-medium border-none focus:outline-none focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:ring-inset sm:px-4 sm:py-2";
38
38
  },
39
39
  activeClasses() {
40
40
  return "bg-primary text-white";
@@ -68,3 +68,10 @@ export default {
68
68
  },
69
69
  };
70
70
  </script>
71
+
72
+ <style scoped>
73
+ .k-select-button {
74
+ -webkit-overflow-scrolling: touch;
75
+ scrollbar-width: thin;
76
+ }
77
+ </style>
package/src/ui/kTabs.vue CHANGED
@@ -1,11 +1,16 @@
1
1
  <template>
2
- <div class="w-full overflow-hidden bg-white border rounded-md">
3
- <div class="flex">
2
+ <div class="w-full overflow-hidden bg-white border border-slate-200 rounded-md dark:bg-slate-800 dark:border-slate-700">
3
+ <div class="k-tabs-scroll flex overflow-x-auto">
4
4
  <button
5
5
  v-for="tab in tabs"
6
6
  :key="tab.id"
7
7
  @click="selectTab(tab.id)"
8
- :class="['px-8 py-4 text-lg font-medium', modelValue === tab.id ? 'bg-primary text-secondary ' : 'text-gray-500 hover:text-gray-700']"
8
+ :class="[
9
+ 'shrink-0 whitespace-nowrap px-4 py-3 text-sm font-medium sm:px-8 sm:py-4 sm:text-lg',
10
+ modelValue === tab.id
11
+ ? 'bg-primary text-secondary'
12
+ : 'text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-700/50',
13
+ ]"
9
14
  >
10
15
  {{ tab.title }}
11
16
  </button>
@@ -34,3 +39,10 @@ export default {
34
39
  },
35
40
  };
36
41
  </script>
42
+
43
+ <style scoped>
44
+ .k-tabs-scroll {
45
+ -webkit-overflow-scrolling: touch;
46
+ scrollbar-width: thin;
47
+ }
48
+ </style>
package/src/ui/kToast.vue CHANGED
@@ -38,7 +38,7 @@
38
38
  v-if="toast.closable !== false"
39
39
  type="button"
40
40
  @click="remove(toast.id)"
41
- class="absolute text-xl leading-none text-gray-500 rounded-md top-2 right-2 hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-primary"
41
+ class="absolute text-xl leading-none text-gray-500 dark:text-slate-400 rounded-md top-2 right-2 hover:text-primary dark:hover:text-sky-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-primary"
42
42
  :aria-label="`Close ${toast.type} toast`">
43
43
  <X class="w-5 h-5" />
44
44
  </button>
@@ -1,6 +1,6 @@
1
1
  export const INTENT_VARIANT_STYLES = {
2
2
  primary: {
3
- solid: { enabled: "bg-sky-700 hover:bg-sky-600 text-white dark:bg-sky-500 dark:hover:bg-sky-400", disabled: "bg-sky-200 text-sky-900 dark:bg-sky-900/40 dark:text-sky-500" },
3
+ solid: { enabled: "bg-sky-700 hover:bg-sky-600 text-white dark:bg-blue-600 dark:hover:bg-blue-500", disabled: "bg-sky-200 text-sky-900 dark:bg-sky-900/40 dark:text-sky-500" },
4
4
  soft: { enabled: "bg-sky-100 hover:bg-sky-200 text-sky-900 dark:bg-sky-500/25 dark:hover:bg-sky-500/35 dark:text-sky-200 dark:border-sky-400/60", disabled: "bg-sky-100 text-sky-500 dark:bg-sky-900/20 dark:text-sky-600" },
5
5
  outlined: { enabled: "bg-transparent border border-sky-400 text-sky-800 hover:bg-sky-50 dark:border-sky-400 dark:text-sky-300 dark:hover:bg-sky-500/20", disabled: "bg-sky-50 border border-sky-200 text-sky-400 dark:bg-transparent dark:border-sky-800 dark:text-sky-700" },
6
6
  plain: { enabled: "bg-transparent text-sky-800 hover:bg-sky-50 dark:text-sky-300 dark:hover:bg-sky-500/20", disabled: "bg-transparent text-sky-400 dark:text-sky-700" },