@keenthemes/ktui 1.1.0 → 1.1.1

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 (222) hide show
  1. package/README.md +0 -27
  2. package/dist/ktui.js +6790 -14063
  3. package/dist/ktui.min.js +1 -1
  4. package/dist/ktui.min.js.map +1 -1
  5. package/dist/styles.css +1132 -2705
  6. package/lib/cjs/components/datatable/__tests__/pagination-reset.test.js +596 -0
  7. package/lib/cjs/components/datatable/__tests__/pagination-reset.test.js.map +1 -0
  8. package/lib/cjs/components/datatable/__tests__/race-conditions.test.js +548 -0
  9. package/lib/cjs/components/datatable/__tests__/race-conditions.test.js.map +1 -0
  10. package/lib/cjs/components/datatable/__tests__/setup.js +63 -0
  11. package/lib/cjs/components/datatable/__tests__/setup.js.map +1 -0
  12. package/lib/cjs/components/datatable/datatable.js +92 -30
  13. package/lib/cjs/components/datatable/datatable.js.map +1 -1
  14. package/lib/cjs/index.js +1 -10
  15. package/lib/cjs/index.js.map +1 -1
  16. package/lib/esm/components/datatable/__tests__/pagination-reset.test.js +594 -0
  17. package/lib/esm/components/datatable/__tests__/pagination-reset.test.js.map +1 -0
  18. package/lib/esm/components/datatable/__tests__/race-conditions.test.js +546 -0
  19. package/lib/esm/components/datatable/__tests__/race-conditions.test.js.map +1 -0
  20. package/lib/esm/components/datatable/__tests__/setup.js +58 -0
  21. package/lib/esm/components/datatable/__tests__/setup.js.map +1 -0
  22. package/lib/esm/components/datatable/datatable.js +92 -30
  23. package/lib/esm/components/datatable/datatable.js.map +1 -1
  24. package/lib/esm/index.js +0 -7
  25. package/lib/esm/index.js.map +1 -1
  26. package/package.json +7 -9
  27. package/src/components/alert/alert.css +188 -429
  28. package/src/components/datatable/__tests__/pagination-reset.test.ts +657 -0
  29. package/src/components/datatable/__tests__/race-conditions.test.ts +455 -0
  30. package/src/components/datatable/__tests__/setup.ts +67 -0
  31. package/src/components/datatable/datatable.ts +66 -11
  32. package/src/components/input/input.css +0 -1
  33. package/src/components/select/select.css +0 -1
  34. package/src/components/select/variants.css +4 -0
  35. package/src/components/textarea/textarea.css +0 -1
  36. package/src/index.ts +0 -10
  37. package/styles.css +0 -1
  38. package/lib/cjs/components/alert/alert.js +0 -1025
  39. package/lib/cjs/components/alert/alert.js.map +0 -1
  40. package/lib/cjs/components/alert/index.js +0 -20
  41. package/lib/cjs/components/alert/index.js.map +0 -1
  42. package/lib/cjs/components/alert/templates.js +0 -120
  43. package/lib/cjs/components/alert/templates.js.map +0 -1
  44. package/lib/cjs/components/alert/types.js +0 -7
  45. package/lib/cjs/components/alert/types.js.map +0 -1
  46. package/lib/cjs/components/datepicker/config/config.js +0 -42
  47. package/lib/cjs/components/datepicker/config/config.js.map +0 -1
  48. package/lib/cjs/components/datepicker/config/index.js +0 -24
  49. package/lib/cjs/components/datepicker/config/index.js.map +0 -1
  50. package/lib/cjs/components/datepicker/config/interfaces.js +0 -7
  51. package/lib/cjs/components/datepicker/config/interfaces.js.map +0 -1
  52. package/lib/cjs/components/datepicker/config/types.js +0 -7
  53. package/lib/cjs/components/datepicker/config/types.js.map +0 -1
  54. package/lib/cjs/components/datepicker/core/event-manager.js +0 -135
  55. package/lib/cjs/components/datepicker/core/event-manager.js.map +0 -1
  56. package/lib/cjs/components/datepicker/core/focus-manager.js +0 -167
  57. package/lib/cjs/components/datepicker/core/focus-manager.js.map +0 -1
  58. package/lib/cjs/components/datepicker/core/helpers.js +0 -219
  59. package/lib/cjs/components/datepicker/core/helpers.js.map +0 -1
  60. package/lib/cjs/components/datepicker/core/index.js +0 -25
  61. package/lib/cjs/components/datepicker/core/index.js.map +0 -1
  62. package/lib/cjs/components/datepicker/core/unified-state-manager.js +0 -394
  63. package/lib/cjs/components/datepicker/core/unified-state-manager.js.map +0 -1
  64. package/lib/cjs/components/datepicker/datepicker.js +0 -2252
  65. package/lib/cjs/components/datepicker/datepicker.js.map +0 -1
  66. package/lib/cjs/components/datepicker/index.js +0 -24
  67. package/lib/cjs/components/datepicker/index.js.map +0 -1
  68. package/lib/cjs/components/datepicker/ui/index.js +0 -23
  69. package/lib/cjs/components/datepicker/ui/index.js.map +0 -1
  70. package/lib/cjs/components/datepicker/ui/input/dropdown.js +0 -489
  71. package/lib/cjs/components/datepicker/ui/input/dropdown.js.map +0 -1
  72. package/lib/cjs/components/datepicker/ui/input/index.js +0 -23
  73. package/lib/cjs/components/datepicker/ui/input/index.js.map +0 -1
  74. package/lib/cjs/components/datepicker/ui/input/segmented-input.js +0 -640
  75. package/lib/cjs/components/datepicker/ui/input/segmented-input.js.map +0 -1
  76. package/lib/cjs/components/datepicker/ui/renderers/calendar.js +0 -446
  77. package/lib/cjs/components/datepicker/ui/renderers/calendar.js.map +0 -1
  78. package/lib/cjs/components/datepicker/ui/renderers/footer.js +0 -42
  79. package/lib/cjs/components/datepicker/ui/renderers/footer.js.map +0 -1
  80. package/lib/cjs/components/datepicker/ui/renderers/header.js +0 -32
  81. package/lib/cjs/components/datepicker/ui/renderers/header.js.map +0 -1
  82. package/lib/cjs/components/datepicker/ui/renderers/index.js +0 -25
  83. package/lib/cjs/components/datepicker/ui/renderers/index.js.map +0 -1
  84. package/lib/cjs/components/datepicker/ui/renderers/time-picker.js +0 -384
  85. package/lib/cjs/components/datepicker/ui/renderers/time-picker.js.map +0 -1
  86. package/lib/cjs/components/datepicker/ui/templates/index.js +0 -22
  87. package/lib/cjs/components/datepicker/ui/templates/index.js.map +0 -1
  88. package/lib/cjs/components/datepicker/ui/templates/templates.js +0 -253
  89. package/lib/cjs/components/datepicker/ui/templates/templates.js.map +0 -1
  90. package/lib/cjs/components/datepicker/utils/date-formatters.js +0 -88
  91. package/lib/cjs/components/datepicker/utils/date-formatters.js.map +0 -1
  92. package/lib/cjs/components/datepicker/utils/date-utils.js +0 -194
  93. package/lib/cjs/components/datepicker/utils/date-utils.js.map +0 -1
  94. package/lib/cjs/components/datepicker/utils/index.js +0 -24
  95. package/lib/cjs/components/datepicker/utils/index.js.map +0 -1
  96. package/lib/cjs/components/datepicker/utils/time-utils.js +0 -213
  97. package/lib/cjs/components/datepicker/utils/time-utils.js.map +0 -1
  98. package/lib/esm/components/alert/alert.js +0 -1022
  99. package/lib/esm/components/alert/alert.js.map +0 -1
  100. package/lib/esm/components/alert/index.js +0 -4
  101. package/lib/esm/components/alert/index.js.map +0 -1
  102. package/lib/esm/components/alert/templates.js +0 -112
  103. package/lib/esm/components/alert/templates.js.map +0 -1
  104. package/lib/esm/components/alert/types.js +0 -6
  105. package/lib/esm/components/alert/types.js.map +0 -1
  106. package/lib/esm/components/datepicker/config/config.js +0 -39
  107. package/lib/esm/components/datepicker/config/config.js.map +0 -1
  108. package/lib/esm/components/datepicker/config/index.js +0 -8
  109. package/lib/esm/components/datepicker/config/index.js.map +0 -1
  110. package/lib/esm/components/datepicker/config/interfaces.js +0 -6
  111. package/lib/esm/components/datepicker/config/interfaces.js.map +0 -1
  112. package/lib/esm/components/datepicker/config/types.js +0 -6
  113. package/lib/esm/components/datepicker/config/types.js.map +0 -1
  114. package/lib/esm/components/datepicker/core/event-manager.js +0 -133
  115. package/lib/esm/components/datepicker/core/event-manager.js.map +0 -1
  116. package/lib/esm/components/datepicker/core/focus-manager.js +0 -164
  117. package/lib/esm/components/datepicker/core/focus-manager.js.map +0 -1
  118. package/lib/esm/components/datepicker/core/helpers.js +0 -211
  119. package/lib/esm/components/datepicker/core/helpers.js.map +0 -1
  120. package/lib/esm/components/datepicker/core/index.js +0 -9
  121. package/lib/esm/components/datepicker/core/index.js.map +0 -1
  122. package/lib/esm/components/datepicker/core/unified-state-manager.js +0 -391
  123. package/lib/esm/components/datepicker/core/unified-state-manager.js.map +0 -1
  124. package/lib/esm/components/datepicker/datepicker.js +0 -2248
  125. package/lib/esm/components/datepicker/datepicker.js.map +0 -1
  126. package/lib/esm/components/datepicker/index.js +0 -7
  127. package/lib/esm/components/datepicker/index.js.map +0 -1
  128. package/lib/esm/components/datepicker/ui/index.js +0 -7
  129. package/lib/esm/components/datepicker/ui/index.js.map +0 -1
  130. package/lib/esm/components/datepicker/ui/input/dropdown.js +0 -486
  131. package/lib/esm/components/datepicker/ui/input/dropdown.js.map +0 -1
  132. package/lib/esm/components/datepicker/ui/input/index.js +0 -7
  133. package/lib/esm/components/datepicker/ui/input/index.js.map +0 -1
  134. package/lib/esm/components/datepicker/ui/input/segmented-input.js +0 -637
  135. package/lib/esm/components/datepicker/ui/input/segmented-input.js.map +0 -1
  136. package/lib/esm/components/datepicker/ui/renderers/calendar.js +0 -443
  137. package/lib/esm/components/datepicker/ui/renderers/calendar.js.map +0 -1
  138. package/lib/esm/components/datepicker/ui/renderers/footer.js +0 -39
  139. package/lib/esm/components/datepicker/ui/renderers/footer.js.map +0 -1
  140. package/lib/esm/components/datepicker/ui/renderers/header.js +0 -29
  141. package/lib/esm/components/datepicker/ui/renderers/header.js.map +0 -1
  142. package/lib/esm/components/datepicker/ui/renderers/index.js +0 -9
  143. package/lib/esm/components/datepicker/ui/renderers/index.js.map +0 -1
  144. package/lib/esm/components/datepicker/ui/renderers/time-picker.js +0 -381
  145. package/lib/esm/components/datepicker/ui/renderers/time-picker.js.map +0 -1
  146. package/lib/esm/components/datepicker/ui/templates/index.js +0 -6
  147. package/lib/esm/components/datepicker/ui/templates/index.js.map +0 -1
  148. package/lib/esm/components/datepicker/ui/templates/templates.js +0 -242
  149. package/lib/esm/components/datepicker/ui/templates/templates.js.map +0 -1
  150. package/lib/esm/components/datepicker/utils/date-formatters.js +0 -83
  151. package/lib/esm/components/datepicker/utils/date-formatters.js.map +0 -1
  152. package/lib/esm/components/datepicker/utils/date-utils.js +0 -184
  153. package/lib/esm/components/datepicker/utils/date-utils.js.map +0 -1
  154. package/lib/esm/components/datepicker/utils/index.js +0 -8
  155. package/lib/esm/components/datepicker/utils/index.js.map +0 -1
  156. package/lib/esm/components/datepicker/utils/time-utils.js +0 -201
  157. package/lib/esm/components/datepicker/utils/time-utils.js.map +0 -1
  158. package/src/components/alert/alert.ts +0 -990
  159. package/src/components/alert/index.ts +0 -4
  160. package/src/components/alert/templates.ts +0 -110
  161. package/src/components/alert/tests/accessibility/aria-roles.test.ts +0 -19
  162. package/src/components/alert/tests/accessibility/focus-management.test.ts +0 -19
  163. package/src/components/alert/tests/accessibility/keyboard-nav.test.ts +0 -22
  164. package/src/components/alert/tests/actions/confirm-cancel.test.ts +0 -122
  165. package/src/components/alert/tests/actions/input-field.test.ts +0 -180
  166. package/src/components/alert/tests/alert.basic.test.ts +0 -126
  167. package/src/components/alert/tests/alert.config.test.ts +0 -75
  168. package/src/components/alert/tests/alert.templates.test.ts +0 -17
  169. package/src/components/alert/tests/config/attribute-config.test.ts +0 -94
  170. package/src/components/alert/tests/config/json-config.test.ts +0 -119
  171. package/src/components/alert/tests/config/merging.test.ts +0 -89
  172. package/src/components/alert/tests/dismissal/auto-dismiss.test.ts +0 -96
  173. package/src/components/alert/tests/dismissal/escape-key-dismiss.test.ts +0 -105
  174. package/src/components/alert/tests/dismissal/manual-dismiss.test.ts +0 -90
  175. package/src/components/alert/tests/dismissal/outside-click-dismiss.test.ts +0 -91
  176. package/src/components/alert/tests/edge-cases/invalid-config.test.ts +0 -19
  177. package/src/components/alert/tests/edge-cases/multiple-alerts.test.ts +0 -19
  178. package/src/components/alert/tests/rendering/custom-content.test.ts +0 -81
  179. package/src/components/alert/tests/rendering/info-alert.test.ts +0 -84
  180. package/src/components/alert/tests/rendering/success-alert.test.ts +0 -100
  181. package/src/components/alert/tests/templates/default-templates.test.ts +0 -16
  182. package/src/components/alert/tests/templates/user-templates.test.ts +0 -16
  183. package/src/components/alert/types.ts +0 -145
  184. package/src/components/datepicker/__tests__/datepicker-events.test.ts +0 -356
  185. package/src/components/datepicker/__tests__/datepicker-init.test.ts +0 -343
  186. package/src/components/datepicker/__tests__/datepicker-integration.test.ts +0 -435
  187. package/src/components/datepicker/__tests__/datepicker-timezone.test.ts +0 -220
  188. package/src/components/datepicker/__tests__/segmented-input-focus.test.ts +0 -380
  189. package/src/components/datepicker/__tests__/selective-state-updates.test.ts +0 -400
  190. package/src/components/datepicker/__tests__/state-manager.test.ts +0 -421
  191. package/src/components/datepicker/__tests__/time-preservation.test.ts +0 -387
  192. package/src/components/datepicker/config/config.ts +0 -40
  193. package/src/components/datepicker/config/index.ts +0 -8
  194. package/src/components/datepicker/config/interfaces.ts +0 -82
  195. package/src/components/datepicker/config/types.ts +0 -188
  196. package/src/components/datepicker/core/event-manager.ts +0 -159
  197. package/src/components/datepicker/core/focus-manager.ts +0 -201
  198. package/src/components/datepicker/core/helpers.ts +0 -231
  199. package/src/components/datepicker/core/index.ts +0 -9
  200. package/src/components/datepicker/core/unified-state-manager.ts +0 -459
  201. package/src/components/datepicker/datepicker.css +0 -435
  202. package/src/components/datepicker/datepicker.ts +0 -2548
  203. package/src/components/datepicker/index.ts +0 -8
  204. package/src/components/datepicker/ui/index.ts +0 -7
  205. package/src/components/datepicker/ui/input/dropdown.ts +0 -552
  206. package/src/components/datepicker/ui/input/index.ts +0 -7
  207. package/src/components/datepicker/ui/input/segmented-input.ts +0 -638
  208. package/src/components/datepicker/ui/renderers/__tests__/calendar-optimizations.test.ts +0 -611
  209. package/src/components/datepicker/ui/renderers/calendar.ts +0 -530
  210. package/src/components/datepicker/ui/renderers/footer.ts +0 -43
  211. package/src/components/datepicker/ui/renderers/header.ts +0 -33
  212. package/src/components/datepicker/ui/renderers/index.ts +0 -9
  213. package/src/components/datepicker/ui/renderers/time-picker.ts +0 -438
  214. package/src/components/datepicker/ui/templates/index.ts +0 -6
  215. package/src/components/datepicker/ui/templates/templates.ts +0 -306
  216. package/src/components/datepicker/utils/__tests__/date-formatters.test.ts +0 -160
  217. package/src/components/datepicker/utils/__tests__/date-utils-keys.test.ts +0 -86
  218. package/src/components/datepicker/utils/__tests__/date-utils-timezone.test.ts +0 -215
  219. package/src/components/datepicker/utils/date-formatters.ts +0 -85
  220. package/src/components/datepicker/utils/date-utils.ts +0 -172
  221. package/src/components/datepicker/utils/index.ts +0 -8
  222. package/src/components/datepicker/utils/time-utils.ts +0 -221
@@ -3,539 +3,298 @@
3
3
  * Copyright 2025 by Keenthemes Inc
4
4
  */
5
5
 
6
- /* Base Styles */
7
6
  @layer components {
8
- .kt-alert-overlay {
9
- @apply fixed inset-0 z-50 flex items-center justify-center p-4;
10
- @apply bg-black/30 backdrop-blur-sm;
11
- @apply transition-opacity duration-300;
12
- }
13
-
14
- .kt-alert-modal {
15
- @apply relative flex flex-col w-full max-w-md mx-auto;
16
- @apply bg-popover text-popover-foreground rounded-xl;
17
- @apply shadow-md border border-border;
18
- @apply transition-all duration-300 ease-out;
19
- animation: fadeIn 0.3s ease-out, zoomIn 0.3s ease-out;
20
- }
21
-
22
- .kt-alert-container {
23
- @apply relative flex flex-col w-full;
24
- @apply bg-popover text-popover-foreground rounded-xl;
25
- @apply shadow-md border border-border;
26
- @apply transition-all duration-300 ease-out;
27
- animation: fadeIn 0.3s ease-out, zoomIn 0.3s ease-out;
28
- }
29
-
30
- /* Content layout with proper padding */
31
- .kt-alert-modal > *:not(.kt-alert-close-button),
32
- .kt-alert-container > *:not(.kt-alert-close-button) {
33
- @apply px-5;
34
- }
35
-
36
- .kt-alert-modal > *:first-child:not(.kt-alert-close-button),
37
- .kt-alert-container > *:first-child:not(.kt-alert-close-button) {
38
- @apply pt-5;
39
- }
40
-
41
- .kt-alert-modal > *:last-child:not(.kt-alert-close-button),
42
- .kt-alert-container > *:last-child:not(.kt-alert-close-button) {
43
- @apply pb-5;
44
- }
45
-
46
- .kt-alert-icon {
47
- @apply flex-shrink-0 size-16 mx-auto mb-4;
48
- @apply flex items-center justify-center;
49
- @apply rounded-full;
50
- @apply duration-300 delay-100;
51
- animation: fadeIn 0.3s ease-out 0.1s both, zoomInSmall 0.3s ease-out 0.1s both;
7
+ /* Base Alert Container */
8
+ .kt-alert {
9
+ @apply flex items-stretch w-full;
52
10
  }
53
11
 
12
+ /* Alert Title */
54
13
  .kt-alert-title {
55
- @apply text-xl font-semibold text-popover-foreground mb-3 text-center;
56
- @apply leading-tight;
14
+ @apply grow tracking-tight;
57
15
  }
58
16
 
59
- .kt-alert-message {
60
- @apply text-base text-muted-foreground mb-6 text-center;
61
- @apply leading-relaxed;
17
+ /* Alert Toolbar */
18
+ .kt-alert-toolbar {
19
+ @apply flex items-baseline gap-2.5;
62
20
  }
63
21
 
22
+ /* Alert Actions */
64
23
  .kt-alert-actions {
65
- @apply flex items-center justify-center gap-3 mt-6;
66
- }
67
-
68
- .kt-alert-confirm-button {
69
- @apply px-6 py-3 text-sm font-medium rounded-lg;
70
- @apply bg-primary text-primary-foreground;
71
- @apply hover:bg-primary/90 focus:bg-primary/90 active:bg-primary/80;
72
- @apply focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
73
- @apply transition-all duration-200 ease-in-out;
74
- @apply shadow-sm hover:shadow-md;
75
- }
76
-
77
- .kt-alert-cancel-button {
78
- @apply px-6 py-3 text-sm font-medium rounded-lg;
79
- @apply bg-secondary text-secondary-foreground;
80
- @apply hover:bg-secondary/80 focus:bg-secondary/80 active:bg-secondary/70;
81
- @apply focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
82
- @apply transition-all duration-200 ease-in-out;
83
- @apply shadow-sm hover:shadow-md;
84
- }
85
-
86
- .kt-alert-close-button {
87
- @apply absolute top-4 right-4 size-8 rounded-lg;
88
- @apply text-muted-foreground hover:text-popover-foreground;
89
- @apply hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
90
- @apply transition-all duration-200 ease-in-out;
91
- @apply flex items-center justify-center;
92
- }
93
-
94
- .kt-alert-input {
95
- @apply w-full px-4 py-3 text-base;
96
- @apply bg-background border border-input rounded-lg;
97
- @apply focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:border-ring;
98
- @apply transition-all duration-200 ease-in-out;
99
- @apply placeholder:text-muted-foreground;
100
- }
101
-
102
- .kt-alert-input-label {
103
- @apply block text-sm font-medium text-popover-foreground mb-3;
104
- }
105
-
106
- .kt-alert-custom-content {
107
- @apply mt-6;
108
- }
109
-
110
- .kt-alert-loader {
111
- @apply inline-flex items-center justify-center;
112
- @apply size-6;
113
- @apply animate-spin;
114
- }
115
-
116
- .kt-alert-loader::before {
117
- content: '';
118
- @apply size-6 border-2 border-muted border-t-primary rounded-full;
119
- @apply animate-spin;
120
- }
121
-
122
- /* Loading button state */
123
- .kt-alert-confirm-button:disabled {
124
- @apply opacity-75 cursor-not-allowed;
125
- @apply relative;
126
- }
127
-
128
- .kt-alert-confirm-button:disabled::after {
129
- content: '';
130
- @apply absolute inset-0 flex items-center justify-center;
131
- @apply size-4 border-2 border-primary-foreground border-t-transparent rounded-full;
132
- @apply animate-spin;
133
- }
134
- }
135
-
136
- /* Enhanced Input Styling */
137
- @layer components {
138
- /* Text and Textarea inputs */
139
- .kt-alert-input[type="text"],
140
- .kt-alert-input[type="email"],
141
- .kt-alert-input[type="password"],
142
- .kt-alert-input[type="number"],
143
- .kt-alert-input[type="url"],
144
- textarea.kt-alert-input {
145
- @apply w-full px-4 py-3 text-base;
146
- @apply bg-background border border-input rounded-lg;
147
- @apply focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:border-ring;
148
- @apply transition-all duration-200 ease-in-out;
149
- @apply placeholder:text-muted-foreground;
150
- }
151
-
152
- /* Select input */
153
- select.kt-alert-input {
154
- @apply w-full px-4 py-3 text-base;
155
- @apply bg-background border border-input rounded-lg;
156
- @apply focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:border-ring;
157
- @apply transition-all duration-200 ease-in-out;
158
- @apply appearance-none;
159
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
160
- background-repeat: no-repeat;
161
- background-position: right 0.75rem center;
162
- background-size: 16px 12px;
163
- padding-right: 2.5rem;
164
- }
165
-
166
- /* Radio and Checkbox inputs */
167
- .kt-alert-input-label input[type="radio"],
168
- .kt-alert-input-label input[type="checkbox"] {
169
- @apply mr-3 size-4;
170
- @apply text-primary border-input rounded;
171
- @apply focus:ring-ring focus:ring-2;
172
- }
173
-
174
- .kt-alert-input-label label {
175
- @apply flex items-center text-base text-popover-foreground cursor-pointer;
176
- @apply hover:text-popover-foreground transition-colors duration-200;
177
- @apply py-2;
178
- }
179
-
180
- /* Fieldset styling for radio/checkbox groups */
181
- .kt-alert-input-label fieldset {
182
- @apply space-y-2;
24
+ @apply flex items-center gap-2;
183
25
  }
184
26
 
185
- .kt-alert-input-label legend {
186
- @apply text-sm font-medium text-popover-foreground mb-3;
27
+ /* Alert Descriptopn */
28
+ .kt-alert-description {
29
+ @apply text-sm [&_p]:leading-relaxed [&_p]:mb-2;
187
30
  }
188
31
 
189
- /* Validation Error Styling */
190
- .kt-alert-input-error {
191
- @apply mt-2 text-sm text-destructive;
192
- @apply flex items-center gap-2;
193
- @apply duration-200;
194
- animation: fadeIn 0.2s ease-out;
195
- }
32
+ /* Alert Content */
33
+ .kt-alert-content {
34
+ @apply w-full grow space-y-1.5;
196
35
 
197
- .kt-alert-input-error::before {
198
- content: '⚠';
199
- @apply text-destructive;
36
+ .kt-alert-title {
37
+ @apply font-semibold;
38
+ }
200
39
  }
201
40
 
202
- /* Input error state */
203
- .kt-alert-input-error + .kt-alert-input-label .kt-alert-input,
204
- .kt-alert-input-label .kt-alert-input[aria-invalid="true"] {
205
- @apply border-destructive focus-visible:ring-destructive focus-visible:border-destructive;
41
+ .kt-alert-icon {
42
+ @apply shrink-0;
206
43
  }
207
- }
208
44
 
209
- /* Alert Type Variants */
210
- @layer components {
211
- /* Success Alert */
212
- [data-kt-alert-type="success"] {
213
- .kt-alert-icon {
214
- @apply bg-green-100 text-green-600;
215
- }
45
+ /* Alert Close */
46
+ .kt-alert-close {
47
+ @apply shrink-0 size-4 cursor-pointer;
216
48
 
217
- .kt-alert-confirm-button {
218
- @apply bg-green-600 text-white hover:bg-green-700 focus:bg-green-700 active:bg-green-800;
219
- @apply focus-visible:ring-green-500;
49
+ i {
50
+ @apply text-muted-foreground text-xs;
220
51
  }
221
- }
222
52
 
223
- /* Error Alert */
224
- [data-kt-alert-type="error"] {
225
- .kt-alert-icon {
226
- @apply bg-red-100 text-red-600;
53
+ > svg {
54
+ @apply size-4 text-muted-foreground;
227
55
  }
228
56
 
229
- .kt-alert-confirm-button {
230
- @apply bg-red-600 text-white hover:bg-red-700 focus:bg-red-700 active:bg-red-800;
231
- @apply focus-visible:ring-red-500;
57
+ &:focus,
58
+ &:hover {
59
+ i,
60
+ > svg {
61
+ @apply text-foreground;
62
+ }
232
63
  }
233
64
  }
234
65
 
235
- /* Warning Alert */
236
- [data-kt-alert-type="warning"] {
237
- .kt-alert-icon {
238
- @apply bg-yellow-100 text-yellow-600;
66
+ /* Size */
67
+ .kt-alert {
68
+ @apply rounded-lg p-3.5 gap-2.5 text-sm;
69
+
70
+ .kt-alert-icon svg {
71
+ @apply size-5;
239
72
  }
240
73
 
241
- .kt-alert-confirm-button {
242
- @apply bg-yellow-600 text-white hover:bg-yellow-700 focus:bg-yellow-700 active:bg-yellow-800;
243
- @apply focus-visible:ring-yellow-500;
74
+ .kt-alert-toolbar {
75
+ @apply pt-0.25;
244
76
  }
245
77
  }
246
78
 
247
- /* Info Alert */
248
- [data-kt-alert-type="info"] {
249
- .kt-alert-icon {
250
- @apply bg-blue-100 text-blue-600;
251
- }
79
+ .kt-alert-sm {
80
+ @apply rounded-md py-2 px-2.5 gap-1.5 text-xs;
252
81
 
253
- .kt-alert-confirm-button {
254
- @apply bg-blue-600 text-white hover:bg-blue-700 focus:bg-blue-700 active:bg-blue-800;
255
- @apply focus-visible:ring-blue-500;
256
- }
257
- }
82
+ .kt-alert-close {
83
+ @apply size-3.5;
258
84
 
259
- /* Question Alert */
260
- [data-kt-alert-type="question"] {
261
- .kt-alert-icon {
262
- @apply bg-purple-100 text-purple-600;
85
+ > svg {
86
+ @apply size-3.5;
87
+ }
263
88
  }
264
89
 
265
- .kt-alert-confirm-button {
266
- @apply bg-purple-600 text-white hover:bg-purple-700 focus:bg-purple-700 active:bg-purple-800;
267
- @apply focus-visible:ring-purple-500;
90
+ .kt-alert-icon svg {
91
+ @apply size-4;
268
92
  }
269
93
  }
270
- }
271
94
 
272
- /* Alert Positions */
273
- @layer components {
274
- [data-kt-alert-position="top"] {
275
- @apply items-start justify-center;
276
- }
95
+ .kt-alert-lg {
96
+ @apply rounded-md p-4 gap-2.5 text-base;
277
97
 
278
- [data-kt-alert-position="center"] {
279
- @apply items-center justify-center;
280
- }
98
+ .kt-alert-icon svg {
99
+ @apply size-6;
100
+ }
281
101
 
282
- [data-kt-alert-position="bottom"] {
283
- @apply items-end justify-center;
102
+ .kt-alert-toolbar {
103
+ @apply pt-0.75;
104
+ }
284
105
  }
285
106
 
286
- [data-kt-alert-position="top-start"] {
287
- @apply items-start justify-start;
107
+ /* Solid */
108
+ .kt-alert {
109
+ @apply bg-muted text-foreground;
288
110
  }
289
111
 
290
- [data-kt-alert-position="top-end"] {
291
- @apply items-start justify-end;
292
- }
112
+ .kt-alert-primary {
113
+ @apply bg-primary text-primary-foreground;
293
114
 
294
- [data-kt-alert-position="bottom-start"] {
295
- @apply items-end justify-start;
115
+ .kt-alert-close > svg {
116
+ @apply text-primary-foreground;
117
+ }
296
118
  }
297
119
 
298
- [data-kt-alert-position="bottom-end"] {
299
- @apply items-end justify-end;
300
- }
301
- }
120
+ .kt-alert-destructive {
121
+ @apply bg-destructive text-destructive-foreground;
302
122
 
303
- /* State-based Styling */
304
- @layer components {
305
- .kt-alert-modal:focus-within,
306
- .kt-alert-container:focus-within {
307
- @apply ring-2 ring-ring ring-offset-2;
123
+ .kt-alert-close > svg {
124
+ @apply text-destructive-foreground;
125
+ }
308
126
  }
309
127
 
310
- .kt-alert-confirm-button:disabled,
311
- .kt-alert-cancel-button:disabled {
312
- @apply opacity-75 cursor-not-allowed;
313
- }
128
+ .kt-alert-success {
129
+ @apply bg-green-500 text-white;
314
130
 
315
- .kt-alert-input:disabled {
316
- @apply opacity-75 cursor-not-allowed bg-muted;
131
+ .kt-alert-close > svg {
132
+ @apply text-white;
133
+ }
317
134
  }
318
135
 
319
- /* Micro-interactions */
320
- .kt-alert-confirm-button,
321
- .kt-alert-cancel-button {
322
- @apply transform transition-all duration-200 ease-in-out;
323
- }
136
+ .kt-alert-info {
137
+ @apply bg-violet-600 text-white;
324
138
 
325
- .kt-alert-confirm-button:hover,
326
- .kt-alert-cancel-button:hover {
327
- @apply scale-105;
139
+ .kt-alert-close > svg {
140
+ @apply text-white;
141
+ }
328
142
  }
329
143
 
330
- .kt-alert-confirm-button:active,
331
- .kt-alert-cancel-button:active {
332
- @apply scale-95;
333
- }
144
+ .kt-alert-warning {
145
+ @apply bg-yellow-500 text-white;
334
146
 
335
- .kt-alert-close-button {
336
- @apply transform transition-all duration-200 ease-in-out;
147
+ .kt-alert-close > svg {
148
+ @apply text-white;
149
+ }
337
150
  }
338
151
 
339
- .kt-alert-close-button:hover {
340
- @apply scale-110;
341
- }
152
+ .kt-alert-mono {
153
+ @apply bg-mono text-mono-foreground;
342
154
 
343
- /* Focus management */
344
- .kt-alert-modal:focus-visible,
345
- .kt-alert-container:focus-visible {
346
- @apply outline-none;
155
+ .kt-alert-close > svg {
156
+ @apply text-mono-foreground;
157
+ }
347
158
  }
348
159
 
349
- /* Input focus states */
350
- .kt-alert-input:focus {
351
- @apply transform scale-[1.02];
352
- }
353
- }
160
+ /* Mono */
161
+ .kt-alert-mono {
162
+ &.kt-alert-primary {
163
+ .kt-alert-icon {
164
+ @apply text-primary;
165
+ }
166
+ }
354
167
 
355
- /* RTL Support */
356
- @layer components {
357
- [dir='rtl'] {
358
- .kt-alert-close-button {
359
- @apply right-auto left-4;
168
+ &.kt-alert-success {
169
+ .kt-alert-icon {
170
+ @apply text-green-500;
171
+ }
360
172
  }
361
173
 
362
- .kt-alert-actions {
363
- @apply justify-center;
174
+ &.kt-alert-destructive {
175
+ .kt-alert-icon {
176
+ @apply text-destructive;
177
+ }
364
178
  }
365
179
 
366
- select.kt-alert-input {
367
- background-position: left 0.75rem center;
368
- padding-left: 2.5rem;
369
- padding-right: 1rem;
180
+ &.kt-alert-warning {
181
+ .kt-alert-icon {
182
+ @apply text-yellow-500;
183
+ }
370
184
  }
371
185
 
372
- .kt-alert-input-label input[type="radio"],
373
- .kt-alert-input-label input[type="checkbox"] {
374
- @apply mr-0 ml-3;
186
+ &.kt-alert-info {
187
+ .kt-alert-icon {
188
+ @apply text-violet-600;
189
+ }
375
190
  }
376
191
  }
377
- }
378
192
 
379
- /* Dark Mode Styles */
380
- @layer components {
381
- .dark {
382
- .kt-alert-overlay {
383
- @apply bg-black/50;
384
- }
193
+ /* Outline */
194
+ .kt-alert-outline {
195
+ .kt-alert-close {
196
+ @apply shrink-0 size-4 cursor-pointer;
385
197
 
386
- .kt-alert-modal,
387
- .kt-alert-container {
388
- @apply bg-popover text-popover-foreground;
389
- }
198
+ > svg {
199
+ @apply size-4 text-muted-foreground;
200
+ }
390
201
 
391
- .kt-alert-input {
392
- @apply bg-background border-input;
202
+ &:focus,
203
+ &:hover {
204
+ > svg {
205
+ @apply text-foreground;
206
+ }
207
+ }
393
208
  }
394
209
 
395
- select.kt-alert-input {
396
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
397
- }
210
+ @apply border border-border bg-background text-foreground;
398
211
 
399
- /* Dark mode alert type variants */
400
- [data-kt-alert-type="success"] .kt-alert-icon {
401
- @apply bg-green-900/20 text-green-400;
212
+ &.kt-alert-primary {
213
+ @apply border border-border bg-background text-primary;
402
214
  }
403
215
 
404
- [data-kt-alert-type="error"] .kt-alert-icon {
405
- @apply bg-red-900/20 text-red-400;
216
+ &.kt-alert-destructive {
217
+ @apply border border-border bg-background text-destructive;
406
218
  }
407
219
 
408
- [data-kt-alert-type="warning"] .kt-alert-icon {
409
- @apply bg-yellow-900/20 text-yellow-400;
220
+ &.kt-alert-success {
221
+ @apply border border-border bg-background text-green-500;
410
222
  }
411
223
 
412
- [data-kt-alert-type="info"] .kt-alert-icon {
413
- @apply bg-blue-900/20 text-blue-400;
224
+ &.kt-alert-info {
225
+ @apply border border-border bg-background text-violet-600;
414
226
  }
415
227
 
416
- [data-kt-alert-type="question"] .kt-alert-icon {
417
- @apply bg-purple-900/20 text-purple-400;
228
+ &.kt-alert-warning {
229
+ @apply border border-border bg-background text-yellow-500;
418
230
  }
419
- }
420
- }
421
-
422
- /* Custom Variants */
423
- @custom-variant kt-alert-success {
424
- [data-kt-alert-type="success"] {
425
- @slot;
426
- }
427
-
428
- [data-kt-alert-type="success"] & {
429
- @slot;
430
- }
431
- }
432
-
433
- @custom-variant kt-alert-error {
434
- [data-kt-alert-type="error"] {
435
- @slot;
436
- }
437
-
438
- [data-kt-alert-type="error"] & {
439
- @slot;
440
- }
441
- }
442
231
 
443
- @custom-variant kt-alert-warning {
444
- [data-kt-alert-type="warning"] {
445
- @slot;
232
+ &.kt-alert-mono {
233
+ @apply border border-border bg-background text-mono;
234
+ }
446
235
  }
447
236
 
448
- [data-kt-alert-type="warning"] & {
449
- @slot;
450
- }
451
- }
237
+ /* Light */
238
+ .kt-alert-light {
239
+ @apply bg-muted border border-border text-foreground;
452
240
 
453
- @custom-variant kt-alert-info {
454
- [data-kt-alert-type="info"] {
455
- @slot;
456
- }
457
-
458
- [data-kt-alert-type="info"] & {
459
- @slot;
460
- }
461
- }
241
+ .kt-alert-icon > svg {
242
+ @apply text-muted-foreground;
243
+ }
462
244
 
463
- @custom-variant kt-alert-question {
464
- [data-kt-alert-type="question"] {
465
- @slot;
466
- }
245
+ .kt-alert-close {
246
+ @apply shrink-0 size-4 cursor-pointer;
467
247
 
468
- [data-kt-alert-type="question"] & {
469
- @slot;
470
- }
471
- }
248
+ > svg {
249
+ @apply size-4 text-muted-foreground;
250
+ }
472
251
 
473
- @custom-variant kt-alert-modal {
474
- [data-kt-alert][aria-modal="true"] {
475
- @slot;
476
- }
252
+ &:focus,
253
+ &:hover {
254
+ > svg {
255
+ @apply text-foreground;
256
+ }
257
+ }
258
+ }
477
259
 
478
- [data-kt-alert][aria-modal="true"] & {
479
- @slot;
480
- }
481
- }
260
+ &.kt-alert-primary {
261
+ @apply bg-primary/5 border border-primary/10 text-foreground;
482
262
 
483
- @custom-variant kt-alert-non-modal {
484
- [data-kt-alert][aria-modal="false"] {
485
- @slot;
486
- }
263
+ .kt-alert-icon > svg {
264
+ @apply text-primary;
265
+ }
266
+ }
487
267
 
488
- [data-kt-alert][aria-modal="false"] & {
489
- @slot;
490
- }
491
- }
268
+ &.kt-alert-destructive {
269
+ @apply bg-destructive/5 border border-destructive/10 text-foreground;
492
270
 
493
- /* Animation Utilities */
494
- @layer utilities {
495
- .animate-in {
496
- animation-fill-mode: both;
497
- }
271
+ .kt-alert-icon > svg {
272
+ @apply text-destructive;
273
+ }
274
+ }
498
275
 
499
- .fade-in-0 {
500
- animation-name: fadeIn;
501
- }
276
+ &.kt-alert-success {
277
+ @apply bg-green-50 dark:bg-green-950/30 border border-green-200 dark:border-green-950/50 text-foreground;
502
278
 
503
- .zoom-in-95 {
504
- animation-name: zoomIn;
505
- }
279
+ .kt-alert-icon > svg {
280
+ @apply text-green-500;
281
+ }
282
+ }
506
283
 
507
- .zoom-in-50 {
508
- animation-name: zoomInSmall;
509
- }
284
+ &.kt-alert-info {
285
+ @apply bg-violet-50 dark:bg-violet-950/30 border border-violet-200 dark:border-violet-950/50 text-foreground;
510
286
 
511
- @keyframes fadeIn {
512
- from {
513
- opacity: 0;
287
+ .kt-alert-icon > svg {
288
+ @apply text-violet-500;
289
+ }
514
290
  }
515
- to {
516
- opacity: 1;
517
- }
518
- }
519
291
 
520
- @keyframes zoomIn {
521
- from {
522
- opacity: 0;
523
- transform: scale(0.95);
524
- }
525
- to {
526
- opacity: 1;
527
- transform: scale(1);
528
- }
529
- }
292
+ &.kt-alert-warning {
293
+ @apply bg-yellow-50 dark:bg-yellow-950/30 border border-yellow-200 dark:border-yellow-950/50 text-foreground;
530
294
 
531
- @keyframes zoomInSmall {
532
- from {
533
- opacity: 0;
534
- transform: scale(0.5);
535
- }
536
- to {
537
- opacity: 1;
538
- transform: scale(1);
295
+ .kt-alert-icon > svg {
296
+ @apply text-yellow-500;
297
+ }
539
298
  }
540
299
  }
541
300
  }