@celestia-island/hikari 0.4.4

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 (187) hide show
  1. package/README.md +54 -0
  2. package/package.json +63 -0
  3. package/src/DemoApp.vue +400 -0
  4. package/src/components/HkActionBar.tsx +15 -0
  5. package/src/components/HkAlert.scss +121 -0
  6. package/src/components/HkAlert.tsx +85 -0
  7. package/src/components/HkAvatar.tsx +29 -0
  8. package/src/components/HkBadge.scss +117 -0
  9. package/src/components/HkBadge.tsx +50 -0
  10. package/src/components/HkBreadcrumb.tsx +39 -0
  11. package/src/components/HkButton.scss +128 -0
  12. package/src/components/HkButton.tsx +74 -0
  13. package/src/components/HkCard.scss +49 -0
  14. package/src/components/HkCard.tsx +38 -0
  15. package/src/components/HkCheckbox.scss +102 -0
  16. package/src/components/HkCheckbox.tsx +85 -0
  17. package/src/components/HkCollapse.tsx +48 -0
  18. package/src/components/HkColorPicker.scss +148 -0
  19. package/src/components/HkColorPicker.tsx +204 -0
  20. package/src/components/HkConfirmDialog.scss +12 -0
  21. package/src/components/HkConfirmDialog.tsx +75 -0
  22. package/src/components/HkDateTimePicker.scss +361 -0
  23. package/src/components/HkDateTimePicker.tsx +424 -0
  24. package/src/components/HkDivider.scss +85 -0
  25. package/src/components/HkDivider.tsx +51 -0
  26. package/src/components/HkDraggableGrid.scss +132 -0
  27. package/src/components/HkDraggableGrid.tsx +291 -0
  28. package/src/components/HkDraggableList.scss +110 -0
  29. package/src/components/HkDraggableList.tsx +238 -0
  30. package/src/components/HkDrawer.scss +175 -0
  31. package/src/components/HkDrawer.tsx +171 -0
  32. package/src/components/HkEmptyState.scss +42 -0
  33. package/src/components/HkEmptyState.tsx +41 -0
  34. package/src/components/HkErrorBoundary.scss +64 -0
  35. package/src/components/HkErrorBoundary.tsx +82 -0
  36. package/src/components/HkGaugeRing.scss +4 -0
  37. package/src/components/HkGaugeRing.tsx +130 -0
  38. package/src/components/HkHoverRevealAction.scss +66 -0
  39. package/src/components/HkHoverRevealAction.tsx +77 -0
  40. package/src/components/HkIcon.tsx +43 -0
  41. package/src/components/HkIconButton.tsx +42 -0
  42. package/src/components/HkImageViewer.scss +33 -0
  43. package/src/components/HkImageViewer.tsx +250 -0
  44. package/src/components/HkInput.scss +172 -0
  45. package/src/components/HkInput.tsx +175 -0
  46. package/src/components/HkKbd.tsx +26 -0
  47. package/src/components/HkKeywordSearchModal.scss +148 -0
  48. package/src/components/HkKeywordSearchModal.tsx +308 -0
  49. package/src/components/HkListTransition.scss +131 -0
  50. package/src/components/HkListTransition.tsx +29 -0
  51. package/src/components/HkLocalePickerPopup.tsx +42 -0
  52. package/src/components/HkLogo.scss +36 -0
  53. package/src/components/HkLogo.tsx +93 -0
  54. package/src/components/HkMarkdownRenderer.scss +141 -0
  55. package/src/components/HkMarkdownRenderer.tsx +123 -0
  56. package/src/components/HkMediaControlBar.scss +65 -0
  57. package/src/components/HkMediaControlBar.tsx +115 -0
  58. package/src/components/HkMediaPlayer.scss +29 -0
  59. package/src/components/HkMediaPlayer.tsx +210 -0
  60. package/src/components/HkMediaSlider.scss +54 -0
  61. package/src/components/HkMediaSlider.tsx +81 -0
  62. package/src/components/HkMediaVisualizer.scss +7 -0
  63. package/src/components/HkMediaVisualizer.tsx +119 -0
  64. package/src/components/HkMinimap.scss +76 -0
  65. package/src/components/HkMinimap.tsx +255 -0
  66. package/src/components/HkModal.scss +318 -0
  67. package/src/components/HkModal.tsx +481 -0
  68. package/src/components/HkModalBreadcrumb.scss +55 -0
  69. package/src/components/HkModalBreadcrumb.tsx +113 -0
  70. package/src/components/HkMorphingTabs.scss +141 -0
  71. package/src/components/HkMorphingTabs.tsx +113 -0
  72. package/src/components/HkNavItem.scss +81 -0
  73. package/src/components/HkNavItem.tsx +157 -0
  74. package/src/components/HkNumberInput.scss +154 -0
  75. package/src/components/HkNumberInput.tsx +161 -0
  76. package/src/components/HkPasswordInput.scss +289 -0
  77. package/src/components/HkPasswordInput.tsx +533 -0
  78. package/src/components/HkPhaseTransition.scss +25 -0
  79. package/src/components/HkPhaseTransition.tsx +40 -0
  80. package/src/components/HkPopover.scss +82 -0
  81. package/src/components/HkPopover.tsx +410 -0
  82. package/src/components/HkPopupSelect.scss +136 -0
  83. package/src/components/HkPopupSelect.tsx +199 -0
  84. package/src/components/HkProgressBar.scss +106 -0
  85. package/src/components/HkProgressBar.tsx +61 -0
  86. package/src/components/HkProgressDialog.tsx +67 -0
  87. package/src/components/HkProgressRing.scss +56 -0
  88. package/src/components/HkProgressRing.tsx +82 -0
  89. package/src/components/HkRadio.scss +119 -0
  90. package/src/components/HkRadio.tsx +75 -0
  91. package/src/components/HkRollingNumber.scss +37 -0
  92. package/src/components/HkRollingNumber.tsx +97 -0
  93. package/src/components/HkScrollContainer.scss +101 -0
  94. package/src/components/HkScrollContainer.tsx +362 -0
  95. package/src/components/HkSearchInput.scss +132 -0
  96. package/src/components/HkSearchInput.tsx +117 -0
  97. package/src/components/HkSelect.scss +143 -0
  98. package/src/components/HkSelect.tsx +230 -0
  99. package/src/components/HkSelectionGrid.scss +177 -0
  100. package/src/components/HkSelectionGrid.tsx +99 -0
  101. package/src/components/HkSelectionWaterfall.scss +93 -0
  102. package/src/components/HkSelectionWaterfall.tsx +90 -0
  103. package/src/components/HkSidebar.scss +81 -0
  104. package/src/components/HkSidebar.tsx +45 -0
  105. package/src/components/HkSkeleton.scss +44 -0
  106. package/src/components/HkSkeleton.tsx +30 -0
  107. package/src/components/HkSkeletonList.tsx +35 -0
  108. package/src/components/HkSpinner.scss +67 -0
  109. package/src/components/HkSpinner.tsx +41 -0
  110. package/src/components/HkSplash.scss +60 -0
  111. package/src/components/HkSplash.tsx +40 -0
  112. package/src/components/HkSwitch.scss +157 -0
  113. package/src/components/HkSwitch.tsx +72 -0
  114. package/src/components/HkTable.scss +198 -0
  115. package/src/components/HkTable.tsx +246 -0
  116. package/src/components/HkTabs.scss +109 -0
  117. package/src/components/HkTabs.tsx +111 -0
  118. package/src/components/HkTag.scss +88 -0
  119. package/src/components/HkTag.tsx +44 -0
  120. package/src/components/HkTextarea.scss +72 -0
  121. package/src/components/HkTextarea.tsx +104 -0
  122. package/src/components/HkTimeline.scss +139 -0
  123. package/src/components/HkTimeline.tsx +95 -0
  124. package/src/components/HkToast.scss +168 -0
  125. package/src/components/HkToast.tsx +175 -0
  126. package/src/components/HkTooltip.scss +47 -0
  127. package/src/components/HkTooltip.tsx +108 -0
  128. package/src/components/HkTree.scss +188 -0
  129. package/src/components/HkTree.tsx +217 -0
  130. package/src/components/HkTrendChart.tsx +180 -0
  131. package/src/components/HkWindowedItem.scss +17 -0
  132. package/src/components/HkWindowedItem.tsx +107 -0
  133. package/src/components/HkZoomToolbar.scss +35 -0
  134. package/src/components/HkZoomToolbar.tsx +69 -0
  135. package/src/composables/useBreakpoint.ts +41 -0
  136. package/src/composables/useClipboard.ts +37 -0
  137. package/src/composables/useConfirm.ts +35 -0
  138. package/src/composables/useProgressDialog.ts +52 -0
  139. package/src/composables/useReportedTransition.ts +69 -0
  140. package/src/composables/useScrollWindow.ts +21 -0
  141. package/src/composables/useToast.ts +2 -0
  142. package/src/demo.scss +24 -0
  143. package/src/demo.ts +22 -0
  144. package/src/env.d.ts +6 -0
  145. package/src/i18n/context.ts +89 -0
  146. package/src/i18n/locales/ar/components.json +43 -0
  147. package/src/i18n/locales/ar/components.toml +40 -0
  148. package/src/i18n/locales/de/components.json +43 -0
  149. package/src/i18n/locales/de/components.toml +40 -0
  150. package/src/i18n/locales/en/components.json +43 -0
  151. package/src/i18n/locales/en/components.toml +40 -0
  152. package/src/i18n/locales/es/components.json +43 -0
  153. package/src/i18n/locales/es/components.toml +40 -0
  154. package/src/i18n/locales/fr/components.json +43 -0
  155. package/src/i18n/locales/fr/components.toml +40 -0
  156. package/src/i18n/locales/ja/components.json +43 -0
  157. package/src/i18n/locales/ja/components.toml +40 -0
  158. package/src/i18n/locales/ko/components.json +43 -0
  159. package/src/i18n/locales/ko/components.toml +40 -0
  160. package/src/i18n/locales/pt/components.json +43 -0
  161. package/src/i18n/locales/pt/components.toml +40 -0
  162. package/src/i18n/locales/ru/components.json +43 -0
  163. package/src/i18n/locales/ru/components.toml +40 -0
  164. package/src/i18n/locales/zh-Hans/components.json +43 -0
  165. package/src/i18n/locales/zh-Hans/components.toml +40 -0
  166. package/src/i18n/locales/zh-Hant/components.json +43 -0
  167. package/src/i18n/locales/zh-Hant/components.toml +40 -0
  168. package/src/index.ts +137 -0
  169. package/src/render.ts +18 -0
  170. package/src/runtime/animationBus.ts +278 -0
  171. package/src/runtime/cronBus.ts +25 -0
  172. package/src/runtime/index.ts +12 -0
  173. package/src/runtime/useAsyncData.ts +30 -0
  174. package/src/runtime/useBreakpoint.ts +62 -0
  175. package/src/runtime/useClipboard.ts +37 -0
  176. package/src/runtime/useConfirm.ts +35 -0
  177. package/src/runtime/useOverlay.ts +82 -0
  178. package/src/runtime/usePopupManager.ts +89 -0
  179. package/src/runtime/useToast.ts +140 -0
  180. package/src/styles/index.scss +10 -0
  181. package/src/theme/index.ts +5 -0
  182. package/src/theme/presets.ts +307 -0
  183. package/src/theme/theme.scss +17 -0
  184. package/src/theme/useBackgroundLuminance.ts +145 -0
  185. package/src/theme/useSolarTime.ts +101 -0
  186. package/src/theme/useTheme.ts +141 -0
  187. package/src/tokens.scss +26 -0
@@ -0,0 +1,318 @@
1
+ // HkModal.scss
2
+ // Full-featured modal component with overlay, transitions,
3
+ // header / body / footer slots, windowed mode, and auto-follow.
4
+ //
5
+ // Uses hikari's --hi- design-token CSS custom properties for
6
+ // colors, spacing, and typography. Component-specific overrides
7
+ // use the --hk-modal-* namespace.
8
+
9
+ // ------
10
+ // Root wrapper — positioned via popup-manager z-index
11
+ // ------
12
+
13
+ .hk-modal-root {
14
+ position: fixed;
15
+ inset: 0;
16
+ pointer-events: none;
17
+ }
18
+
19
+ // ------
20
+ // Overlay (backdrop)
21
+ // ------
22
+
23
+ .hk-modal-overlay {
24
+ position: fixed;
25
+ inset: 0;
26
+ background: var(--hk-modal-overlay-bg, rgba(0, 0, 0, 0.45));
27
+ backdrop-filter: var(--hk-modal-overlay-blur, blur(6px));
28
+ pointer-events: auto;
29
+ }
30
+
31
+ .hk-modal-overlay-enter-active {
32
+ transition: opacity var(--hk-modal-duration, 0.3s)
33
+ var(--hk-modal-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
34
+ }
35
+
36
+ .hk-modal-overlay-leave-active {
37
+ transition: opacity var(--hk-modal-duration, 0.3s)
38
+ var(--hk-modal-ease-in, cubic-bezier(0.4, 0, 1, 1));
39
+ }
40
+
41
+ .hk-modal-overlay-enter-from,
42
+ .hk-modal-overlay-leave-to {
43
+ opacity: 0;
44
+ }
45
+
46
+ // ------
47
+ // Content frame
48
+ // ------
49
+
50
+ .hk-modal-content {
51
+ position: fixed;
52
+ top: 50%;
53
+ left: 50%;
54
+ transform: translate(-50%, -50%);
55
+ interpolate-size: allow-keywords;
56
+ width: 100%;
57
+ background: var(--hk-modal-bg, var(--hi-color-surface, rgba(255, 255, 255, 0.95)));
58
+ backdrop-filter: var(--hk-modal-blur, blur(12px));
59
+ border: 1px solid var(--hk-modal-border-color, var(--hi-color-border, rgba(0, 0, 0, 0.08)));
60
+ border-radius: var(--hk-modal-radius, var(--hi-radius-lg, 12px));
61
+ box-shadow:
62
+ 0 16px 48px rgba(0, 0, 0, 0.2),
63
+ 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
64
+ outline: none;
65
+ pointer-events: auto;
66
+ overflow: hidden;
67
+ display: flex;
68
+ flex-direction: column;
69
+ }
70
+
71
+ // ------
72
+ // Content enter/leave transitions
73
+ //
74
+ // Height-clipped reveal: the frame grows from 80% of its
75
+ // natural height to full height while fading in. Content
76
+ // children are pinned at natural size (not squashed) —
77
+ // overflow: hidden on the frame clips the viewport.
78
+ // ------
79
+
80
+ .hk-modal-content-enter-active {
81
+ transition:
82
+ opacity var(--hk-modal-duration, 0.3s)
83
+ var(--hk-modal-ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
84
+ height var(--hk-modal-duration, 0.3s)
85
+ var(--hk-modal-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
86
+ will-change: height, opacity;
87
+ }
88
+
89
+ .hk-modal-content-leave-active {
90
+ transition:
91
+ opacity var(--hk-modal-duration, 0.25s)
92
+ var(--hk-modal-ease-in, cubic-bezier(0.4, 0, 1, 1)),
93
+ height var(--hk-modal-duration, 0.25s)
94
+ var(--hk-modal-ease-in, cubic-bezier(0.4, 0, 1, 1));
95
+ will-change: height, opacity;
96
+ }
97
+
98
+ // Pin children to natural flex-basis during animation so the
99
+ // frame's overflow: hidden does the clipping, not flex-shrink.
100
+ .hk-modal-content-enter-active > *,
101
+ .hk-modal-content-leave-active > * {
102
+ flex: 0 0 auto;
103
+ }
104
+
105
+ .hk-modal-content-enter-from,
106
+ .hk-modal-content-leave-to {
107
+ opacity: 0;
108
+ height: calc-size(auto, size * 0.8);
109
+ }
110
+
111
+ .hk-modal-content-enter-to,
112
+ .hk-modal-content-leave-from {
113
+ opacity: 1;
114
+ height: auto;
115
+ }
116
+
117
+ // ------
118
+ // Header
119
+ // ------
120
+
121
+ .hk-modal-header {
122
+ display: flex;
123
+ align-items: center;
124
+ justify-content: space-between;
125
+ padding: var(--hk-modal-padding-header, 1rem 1.5rem);
126
+ border-bottom: 1px solid
127
+ var(--hk-modal-divider-color, var(--hi-color-border, rgba(0, 0, 0, 0.06)));
128
+ flex-shrink: 0;
129
+ }
130
+
131
+ .hk-modal-title {
132
+ font-size: var(--hk-modal-title-font-size, 1.125rem);
133
+ font-weight: var(--hk-modal-title-font-weight, 700);
134
+ margin: 0;
135
+ color: var(--hk-modal-title-color, var(--hi-color-text-primary, #333));
136
+ white-space: nowrap;
137
+ overflow: hidden;
138
+ text-overflow: ellipsis;
139
+ }
140
+
141
+ .hk-modal-close {
142
+ flex-shrink: 0;
143
+ width: 2rem;
144
+ height: 2rem;
145
+ display: inline-flex;
146
+ align-items: center;
147
+ justify-content: center;
148
+ padding: 0;
149
+ background: transparent;
150
+ border: none;
151
+ border-radius: var(--hi-radius-md, 0.5rem);
152
+ color: var(--hk-modal-close-color, var(--hi-color-text-secondary, #666));
153
+ cursor: pointer;
154
+ transition:
155
+ background 0.15s ease,
156
+ color 0.15s ease;
157
+
158
+ &:hover {
159
+ background: var(
160
+ --hk-modal-close-hover-bg,
161
+ var(--hi-secondary-bg, rgba(0, 0, 0, 0.06))
162
+ );
163
+ color: var(
164
+ --hk-modal-close-hover-color,
165
+ var(--hi-color-text-primary, #333)
166
+ );
167
+ }
168
+
169
+ &:active {
170
+ transform: scale(0.92);
171
+ }
172
+
173
+ &:focus-visible {
174
+ outline: 2px solid var(--hi-color-primary, #ffc0cb);
175
+ outline-offset: 2px;
176
+ }
177
+ }
178
+
179
+ // ------
180
+ // Sub-header (caller-provided slot)
181
+ // ------
182
+
183
+ .hk-modal-subheader {
184
+ padding: var(--hk-modal-padding-subheader, 0.75rem 1.5rem 0.75rem);
185
+ border-bottom: 1px solid
186
+ var(--hk-modal-divider-color, var(--hi-color-border, rgba(0, 0, 0, 0.06)));
187
+ flex-shrink: 0;
188
+ }
189
+
190
+ // ------
191
+ // Body (scroll region)
192
+ // ------
193
+
194
+ .hk-modal-body {
195
+ max-height: 70vh;
196
+ display: flex;
197
+ flex-direction: column;
198
+ overflow: hidden;
199
+ position: relative;
200
+ color: var(--hk-modal-body-color, var(--hi-color-text-primary, #333));
201
+ flex: 1;
202
+ min-height: 0;
203
+ }
204
+
205
+ .hk-modal-body-scroll {
206
+ flex: 1;
207
+ min-height: 0;
208
+ overflow-y: auto;
209
+ overflow-x: hidden;
210
+
211
+ &::-webkit-scrollbar {
212
+ width: 6px;
213
+ }
214
+
215
+ &::-webkit-scrollbar-track {
216
+ background: transparent;
217
+ }
218
+
219
+ &::-webkit-scrollbar-thumb {
220
+ background: var(
221
+ --hk-modal-scrollbar-thumb,
222
+ var(--hi-color-border, rgba(0, 0, 0, 0.12))
223
+ );
224
+ border-radius: 3px;
225
+
226
+ &:hover {
227
+ background: var(
228
+ --hi-color-text-secondary,
229
+ rgba(0, 0, 0, 0.3)
230
+ );
231
+ }
232
+ }
233
+ }
234
+
235
+ .hk-modal-body-inner {
236
+ padding: var(--hk-modal-padding-body, 1.5rem);
237
+ }
238
+
239
+ // ------
240
+ // Auto-follow indicator bar
241
+ // ------
242
+
243
+ .hk-modal-autofollow-bar {
244
+ position: absolute;
245
+ bottom: 0;
246
+ left: 0;
247
+ right: 0;
248
+ display: flex;
249
+ align-items: center;
250
+ justify-content: center;
251
+ gap: 0.25rem;
252
+ padding: 0.375rem 0.75rem;
253
+ background: var(
254
+ --hk-modal-autofollow-bg,
255
+ var(--hi-color-surface, rgba(255, 255, 255, 0.9))
256
+ );
257
+ backdrop-filter: blur(8px);
258
+ border-top: 1px solid
259
+ var(--hk-modal-divider-color, var(--hi-color-border, rgba(0, 0, 0, 0.06)));
260
+ font-size: 0.75rem;
261
+ color: var(--hi-color-text-secondary, #666);
262
+ cursor: pointer;
263
+ user-select: none;
264
+ transition: background 0.15s ease;
265
+
266
+ &:hover {
267
+ background: var(
268
+ --hi-secondary-bg,
269
+ rgba(0, 0, 0, 0.04)
270
+ );
271
+ }
272
+ }
273
+
274
+ // ------
275
+ // Footer
276
+ // ------
277
+
278
+ .hk-modal-footer {
279
+ padding: var(--hk-modal-padding-footer, 0.75rem 1.5rem);
280
+ border-top: 1px solid
281
+ var(--hk-modal-divider-color, var(--hi-color-border, rgba(0, 0, 0, 0.06)));
282
+ display: flex;
283
+ justify-content: flex-end;
284
+ gap: 0.5rem;
285
+ flex-shrink: 0;
286
+ }
287
+
288
+ // ------
289
+ // Responsive — full-screen on narrow viewports
290
+ // ------
291
+
292
+ @media (max-width: 640px) {
293
+ .hk-modal-content {
294
+ max-width: 100% !important;
295
+ border-radius: 0;
296
+ max-height: 100vh;
297
+ top: 0;
298
+ left: 0;
299
+ transform: none;
300
+ width: 100%;
301
+ }
302
+
303
+ .hk-modal-header {
304
+ padding: 0.875rem 1rem;
305
+ }
306
+
307
+ .hk-modal-subheader {
308
+ padding: 0.625rem 1rem 0.625rem;
309
+ }
310
+
311
+ .hk-modal-body-inner {
312
+ padding: 1rem;
313
+ }
314
+
315
+ .hk-modal-footer {
316
+ padding: 0.625rem 1rem;
317
+ }
318
+ }