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