@erplora/outfitkit 0.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 (210) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +457 -0
  3. package/dist/base/anchor.d.ts +13 -0
  4. package/dist/base/define.d.ts +1 -0
  5. package/dist/base/relay.d.ts +1 -0
  6. package/dist/cdn.d.ts +96 -0
  7. package/dist/components/ok-app-launcher/ok-app-launcher.d.ts +57 -0
  8. package/dist/components/ok-audio/ok-audio.d.ts +45 -0
  9. package/dist/components/ok-avatar/ok-avatar.d.ts +36 -0
  10. package/dist/components/ok-avatar-group/ok-avatar-group.d.ts +38 -0
  11. package/dist/components/ok-bar-list/ok-bar-list.d.ts +36 -0
  12. package/dist/components/ok-bento/ok-bento.d.ts +17 -0
  13. package/dist/components/ok-bento-item/ok-bento-item.d.ts +34 -0
  14. package/dist/components/ok-calculator/ok-calculator.d.ts +46 -0
  15. package/dist/components/ok-calendar/ok-calendar.d.ts +63 -0
  16. package/dist/components/ok-carousel/ok-carousel.d.ts +48 -0
  17. package/dist/components/ok-chart/ok-chart.d.ts +55 -0
  18. package/dist/components/ok-chat/ok-chat.d.ts +54 -0
  19. package/dist/components/ok-coachmark/ok-coachmark.d.ts +69 -0
  20. package/dist/components/ok-code/ok-code.d.ts +28 -0
  21. package/dist/components/ok-color-picker/ok-color-picker.d.ts +63 -0
  22. package/dist/components/ok-combo/ok-combo.d.ts +46 -0
  23. package/dist/components/ok-command-palette/ok-command-palette.d.ts +72 -0
  24. package/dist/components/ok-contact-form/ok-contact-form.d.ts +54 -0
  25. package/dist/components/ok-cropper/ok-cropper.d.ts +60 -0
  26. package/dist/components/ok-cta-band/ok-cta-band.d.ts +18 -0
  27. package/dist/components/ok-currency/ok-currency.d.ts +31 -0
  28. package/dist/components/ok-data-table/ok-data-table.d.ts +312 -0
  29. package/dist/components/ok-date-picker/ok-date-picker.d.ts +81 -0
  30. package/dist/components/ok-detail-list/ok-detail-list.d.ts +30 -0
  31. package/dist/components/ok-diff/ok-diff.d.ts +38 -0
  32. package/dist/components/ok-donut/ok-donut.d.ts +38 -0
  33. package/dist/components/ok-drawer/ok-drawer.d.ts +56 -0
  34. package/dist/components/ok-dropzone/ok-dropzone.d.ts +48 -0
  35. package/dist/components/ok-empty-state/ok-empty-state.d.ts +16 -0
  36. package/dist/components/ok-error-page/ok-error-page.d.ts +77 -0
  37. package/dist/components/ok-event-card/ok-event-card.d.ts +56 -0
  38. package/dist/components/ok-feature-card/ok-feature-card.d.ts +23 -0
  39. package/dist/components/ok-file-item/ok-file-item.d.ts +31 -0
  40. package/dist/components/ok-file-manager/ok-file-manager.d.ts +145 -0
  41. package/dist/components/ok-footer/ok-footer.d.ts +10 -0
  42. package/dist/components/ok-funnel/ok-funnel.d.ts +31 -0
  43. package/dist/components/ok-gallery/ok-gallery.d.ts +34 -0
  44. package/dist/components/ok-gauge/ok-gauge.d.ts +49 -0
  45. package/dist/components/ok-heatmap/ok-heatmap.d.ts +45 -0
  46. package/dist/components/ok-hero/ok-hero.d.ts +10 -0
  47. package/dist/components/ok-hover-card/ok-hover-card.d.ts +76 -0
  48. package/dist/components/ok-icon-tile/ok-icon-tile.d.ts +24 -0
  49. package/dist/components/ok-image/ok-image.d.ts +56 -0
  50. package/dist/components/ok-inline-feedback/ok-inline-feedback.d.ts +33 -0
  51. package/dist/components/ok-invoice/ok-invoice.d.ts +137 -0
  52. package/dist/components/ok-json-viewer/ok-json-viewer.d.ts +31 -0
  53. package/dist/components/ok-kanban/ok-kanban.d.ts +56 -0
  54. package/dist/components/ok-kbd/ok-kbd.d.ts +21 -0
  55. package/dist/components/ok-keyboard/ok-keyboard.d.ts +35 -0
  56. package/dist/components/ok-kpi/ok-kpi.d.ts +24 -0
  57. package/dist/components/ok-language-select/ok-language-select.d.ts +31 -0
  58. package/dist/components/ok-lightbox/ok-lightbox.d.ts +59 -0
  59. package/dist/components/ok-logo-cloud/ok-logo-cloud.d.ts +14 -0
  60. package/dist/components/ok-loyalty-card/ok-loyalty-card.d.ts +35 -0
  61. package/dist/components/ok-mail/ok-mail.d.ts +117 -0
  62. package/dist/components/ok-menu/ok-menu.d.ts +75 -0
  63. package/dist/components/ok-menubar/ok-menubar.d.ts +75 -0
  64. package/dist/components/ok-navbar/ok-navbar.d.ts +42 -0
  65. package/dist/components/ok-notification-center/ok-notification-center.d.ts +79 -0
  66. package/dist/components/ok-org-chart/ok-org-chart.d.ts +67 -0
  67. package/dist/components/ok-otp/ok-otp.d.ts +31 -0
  68. package/dist/components/ok-page-header/ok-page-header.d.ts +23 -0
  69. package/dist/components/ok-pagination/ok-pagination.d.ts +44 -0
  70. package/dist/components/ok-pdf/ok-pdf.d.ts +32 -0
  71. package/dist/components/ok-phone/ok-phone.d.ts +48 -0
  72. package/dist/components/ok-pinpad/ok-pinpad.d.ts +29 -0
  73. package/dist/components/ok-pricing-card/ok-pricing-card.d.ts +31 -0
  74. package/dist/components/ok-product-card/ok-product-card.d.ts +25 -0
  75. package/dist/components/ok-qr/ok-qr.d.ts +24 -0
  76. package/dist/components/ok-qty-stepper/ok-qty-stepper.d.ts +35 -0
  77. package/dist/components/ok-range-dual/ok-range-dual.d.ts +38 -0
  78. package/dist/components/ok-rating/ok-rating.d.ts +33 -0
  79. package/dist/components/ok-receipt/ok-receipt.d.ts +103 -0
  80. package/dist/components/ok-reveal/ok-reveal.d.ts +21 -0
  81. package/dist/components/ok-rich-text/ok-rich-text.d.ts +46 -0
  82. package/dist/components/ok-scheduler/ok-scheduler.d.ts +74 -0
  83. package/dist/components/ok-select-card/ok-select-card.d.ts +37 -0
  84. package/dist/components/ok-signature/ok-signature.d.ts +55 -0
  85. package/dist/components/ok-skeleton/ok-skeleton.d.ts +40 -0
  86. package/dist/components/ok-sparkline/ok-sparkline.d.ts +27 -0
  87. package/dist/components/ok-split-button/ok-split-button.d.ts +49 -0
  88. package/dist/components/ok-splitter/ok-splitter.d.ts +36 -0
  89. package/dist/components/ok-stat/ok-stat.d.ts +16 -0
  90. package/dist/components/ok-status-dot/ok-status-dot.d.ts +24 -0
  91. package/dist/components/ok-status-pill/ok-status-pill.d.ts +22 -0
  92. package/dist/components/ok-stepper/ok-stepper.d.ts +33 -0
  93. package/dist/components/ok-store/ok-store.d.ts +33 -0
  94. package/dist/components/ok-tag-input/ok-tag-input.d.ts +39 -0
  95. package/dist/components/ok-testimonial/ok-testimonial.d.ts +21 -0
  96. package/dist/components/ok-time-picker/ok-time-picker.d.ts +50 -0
  97. package/dist/components/ok-timeline/ok-timeline.d.ts +33 -0
  98. package/dist/components/ok-tree/ok-tree.d.ts +46 -0
  99. package/dist/components/ok-video/ok-video.d.ts +49 -0
  100. package/dist/components/ok-widget-board/ok-widget-board.d.ts +71 -0
  101. package/dist/components/ok-wizard/ok-wizard.d.ts +30 -0
  102. package/dist/define.js +8 -0
  103. package/dist/erplora.css +112 -0
  104. package/dist/index.d.ts +158 -0
  105. package/dist/index.js +197 -0
  106. package/dist/layout.css +338 -0
  107. package/dist/ok-app-launcher.js +396 -0
  108. package/dist/ok-audio.js +308 -0
  109. package/dist/ok-avatar-group.js +158 -0
  110. package/dist/ok-avatar.js +179 -0
  111. package/dist/ok-bar-list.js +189 -0
  112. package/dist/ok-bento-item.js +168 -0
  113. package/dist/ok-bento.js +63 -0
  114. package/dist/ok-calculator.js +406 -0
  115. package/dist/ok-calendar.js +541 -0
  116. package/dist/ok-carousel.js +352 -0
  117. package/dist/ok-chart.js +325 -0
  118. package/dist/ok-chat.js +320 -0
  119. package/dist/ok-coachmark.js +500 -0
  120. package/dist/ok-code.js +190 -0
  121. package/dist/ok-color-picker.js +569 -0
  122. package/dist/ok-combo.js +294 -0
  123. package/dist/ok-command-palette.js +448 -0
  124. package/dist/ok-contact-form.js +288 -0
  125. package/dist/ok-cropper.js +404 -0
  126. package/dist/ok-cta-band.js +134 -0
  127. package/dist/ok-currency.js +172 -0
  128. package/dist/ok-data-table.js +1281 -0
  129. package/dist/ok-date-picker.js +736 -0
  130. package/dist/ok-detail-list.js +156 -0
  131. package/dist/ok-diff.js +200 -0
  132. package/dist/ok-donut.js +280 -0
  133. package/dist/ok-drawer.js +357 -0
  134. package/dist/ok-dropzone.js +376 -0
  135. package/dist/ok-empty-state.js +104 -0
  136. package/dist/ok-error-page.js +547 -0
  137. package/dist/ok-event-card.js +384 -0
  138. package/dist/ok-feature-card.js +152 -0
  139. package/dist/ok-file-item.js +259 -0
  140. package/dist/ok-file-manager.js +1116 -0
  141. package/dist/ok-footer.js +67 -0
  142. package/dist/ok-funnel.js +181 -0
  143. package/dist/ok-gallery.js +293 -0
  144. package/dist/ok-gauge.js +385 -0
  145. package/dist/ok-heatmap.js +268 -0
  146. package/dist/ok-hero.js +43 -0
  147. package/dist/ok-hover-card.js +480 -0
  148. package/dist/ok-icon-tile.js +123 -0
  149. package/dist/ok-image.js +471 -0
  150. package/dist/ok-inline-feedback.js +221 -0
  151. package/dist/ok-invoice.js +229 -0
  152. package/dist/ok-json-viewer.js +330 -0
  153. package/dist/ok-kanban.js +427 -0
  154. package/dist/ok-kbd.js +159 -0
  155. package/dist/ok-keyboard.js +402 -0
  156. package/dist/ok-kpi.js +147 -0
  157. package/dist/ok-language-select.js +188 -0
  158. package/dist/ok-lightbox.js +490 -0
  159. package/dist/ok-logo-cloud.js +92 -0
  160. package/dist/ok-loyalty-card.js +353 -0
  161. package/dist/ok-mail.js +562 -0
  162. package/dist/ok-menu.js +529 -0
  163. package/dist/ok-menubar.js +628 -0
  164. package/dist/ok-navbar.js +306 -0
  165. package/dist/ok-notification-center.js +545 -0
  166. package/dist/ok-org-chart.js +619 -0
  167. package/dist/ok-otp.js +199 -0
  168. package/dist/ok-page-header.js +202 -0
  169. package/dist/ok-pagination.js +366 -0
  170. package/dist/ok-pdf.js +160 -0
  171. package/dist/ok-phone.js +225 -0
  172. package/dist/ok-pinpad.js +171 -0
  173. package/dist/ok-pricing-card.js +184 -0
  174. package/dist/ok-product-card.js +178 -0
  175. package/dist/ok-qr.js +652 -0
  176. package/dist/ok-qty-stepper.js +212 -0
  177. package/dist/ok-range-dual.js +280 -0
  178. package/dist/ok-rating.js +199 -0
  179. package/dist/ok-receipt.js +183 -0
  180. package/dist/ok-reveal.js +94 -0
  181. package/dist/ok-rich-text.js +538 -0
  182. package/dist/ok-scheduler.js +518 -0
  183. package/dist/ok-select-card.js +231 -0
  184. package/dist/ok-signature.js +267 -0
  185. package/dist/ok-skeleton.js +345 -0
  186. package/dist/ok-sparkline.js +150 -0
  187. package/dist/ok-split-button.js +251 -0
  188. package/dist/ok-splitter.js +289 -0
  189. package/dist/ok-stat.js +77 -0
  190. package/dist/ok-status-dot.js +163 -0
  191. package/dist/ok-status-pill.js +123 -0
  192. package/dist/ok-stepper.js +299 -0
  193. package/dist/ok-store.js +83 -0
  194. package/dist/ok-tag-input.js +358 -0
  195. package/dist/ok-testimonial.js +136 -0
  196. package/dist/ok-time-picker.js +472 -0
  197. package/dist/ok-timeline.js +251 -0
  198. package/dist/ok-tree.js +266 -0
  199. package/dist/ok-video.js +362 -0
  200. package/dist/ok-widget-board.js +265 -0
  201. package/dist/ok-wizard.js +153 -0
  202. package/dist/outfitkit.js +96 -0
  203. package/dist/shared/anchor.js +14 -0
  204. package/dist/store/controller.d.ts +17 -0
  205. package/dist/store/idb.d.ts +16 -0
  206. package/dist/store/store.d.ts +39 -0
  207. package/dist/store-controller.js +31 -0
  208. package/dist/store.js +182 -0
  209. package/dist/theme.example.css +70 -0
  210. package/package.json +147 -0
@@ -0,0 +1,547 @@
1
+ import { LitElement, css, html } from "lit";
2
+ import { property, state } from "lit/decorators.js";
3
+ import { define } from "./define.js";
4
+ var __defProp = Object.defineProperty;
5
+ var __decorateClass = (decorators, target, key, kind) => {
6
+ var result = void 0;
7
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
8
+ if (decorator = decorators[i])
9
+ result = decorator(target, key, result) || result;
10
+ if (result) __defProp(target, key, result);
11
+ return result;
12
+ };
13
+ class OkErrorPage extends LitElement {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.title = "";
17
+ this.variant = "info";
18
+ this.mode = "http";
19
+ this.shortcuts = [];
20
+ this.checks = [];
21
+ this.detailsLabel = "Detalles técnicos";
22
+ this.retryLabel = "Reintentando en";
23
+ this.retrySeconds = 0;
24
+ this.remaining = 0;
25
+ this.initialSeconds = 0;
26
+ }
27
+ static {
28
+ this.styles = css`
29
+ :host {
30
+ display: block;
31
+ width: 100%;
32
+ /* Tokens propios estilo Ionic (overridables): --ok-* → --ion-* → hex. */
33
+ --bg: var(--ok-background-color, var(--ion-background-color, #f6f7f9));
34
+ --surface: var(--ok-surface, var(--ion-card-background, #ffffff));
35
+ --surface-2: var(--ok-surface-2, #f1f2f4);
36
+ --ink: var(--ok-text-color, var(--ion-text-color, #1f2933));
37
+ --ink-2: var(--ok-color-medium-shade, #5b5f66);
38
+ --ink-3: var(--ok-color-medium, var(--ion-color-medium, #92949c));
39
+ --line: var(--ok-border-color, var(--ion-border-color, #e3e5e8));
40
+ --line-2: var(--ok-border-color-shade, #c9ccd1);
41
+ --radius: var(--ok-radius, 12px);
42
+ --radius-pill: var(--ok-radius-pill, 999px);
43
+ --font-mono: var(--ok-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
44
+ --info: var(--ok-color-primary, var(--ion-color-primary, #3880ff));
45
+ --warn: var(--ok-color-warning, var(--ion-color-warning, #ffc409));
46
+ --danger: var(--ok-color-danger, var(--ion-color-danger, #eb445a));
47
+ --ok-leaf: var(--ok-color-success, var(--ion-color-success, #2dd36f));
48
+ /* Acento resuelto por variante (se sobreescribe en :host([variant=…])). */
49
+ --accent: var(--info);
50
+ }
51
+
52
+ :host([variant='warn']) { --accent: var(--warn); }
53
+ :host([variant='danger']) { --accent: var(--danger); }
54
+
55
+ .page {
56
+ position: relative;
57
+ min-height: 100vh;
58
+ min-height: 100dvh;
59
+ display: grid;
60
+ place-items: center;
61
+ padding: 2.5rem 1.25rem;
62
+ background:
63
+ radial-gradient(ellipse 80% 60% at 50% 0%,
64
+ color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%),
65
+ var(--bg);
66
+ color: var(--ink);
67
+ overflow: hidden;
68
+ box-sizing: border-box;
69
+ }
70
+
71
+ /* Rejilla de fondo con máscara radial. */
72
+ .page::before {
73
+ content: '';
74
+ position: absolute;
75
+ inset: 0;
76
+ background-image:
77
+ linear-gradient(to right, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
78
+ linear-gradient(to bottom, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
79
+ background-size: 48px 48px;
80
+ -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black, transparent 80%);
81
+ mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black, transparent 80%);
82
+ pointer-events: none;
83
+ opacity: 0.6;
84
+ }
85
+
86
+ .inner {
87
+ position: relative;
88
+ z-index: 1;
89
+ display: grid;
90
+ gap: 1.25rem;
91
+ text-align: center;
92
+ max-width: 560px;
93
+ width: 100%;
94
+ }
95
+
96
+ /* Ilustración circular. */
97
+ .illu {
98
+ display: grid;
99
+ place-items: center;
100
+ width: 96px;
101
+ height: 96px;
102
+ margin-inline: auto;
103
+ border-radius: 50%;
104
+ background: color-mix(in srgb, var(--accent) 9%, var(--surface));
105
+ color: var(--accent);
106
+ border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
107
+ }
108
+ .illu svg { width: 44px; height: 44px; }
109
+
110
+ .code {
111
+ font-family: var(--font-mono);
112
+ font-size: 0.875rem;
113
+ letter-spacing: 0.12em;
114
+ text-transform: uppercase;
115
+ color: var(--ink-3);
116
+ margin: 0;
117
+ }
118
+
119
+ .title {
120
+ font-size: clamp(1.75rem, 4vw, 2.5rem);
121
+ font-weight: 700;
122
+ line-height: 1.15;
123
+ letter-spacing: -0.01em;
124
+ margin: 0;
125
+ }
126
+
127
+ .msg {
128
+ color: var(--ink-2);
129
+ font-size: 1.0625rem;
130
+ line-height: 1.5;
131
+ margin: 0;
132
+ max-width: 44ch;
133
+ margin-inline: auto;
134
+ }
135
+
136
+ /* Slot de búsqueda (ej. "did you mean" en 404). */
137
+ .search {
138
+ max-width: 380px;
139
+ margin: 0 auto;
140
+ width: 100%;
141
+ }
142
+ .search ::slotted(*) { width: 100%; }
143
+
144
+ /* Chip de reintento con cuenta atrás. */
145
+ .retry {
146
+ display: inline-flex;
147
+ align-items: center;
148
+ gap: 6px;
149
+ justify-self: center;
150
+ padding: 6px 12px;
151
+ border-radius: var(--radius-pill);
152
+ background: color-mix(in srgb, var(--accent) 9%, var(--surface));
153
+ border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
154
+ font-size: 0.875rem;
155
+ color: var(--ink-2);
156
+ }
157
+ .retry-num {
158
+ font-family: var(--font-mono);
159
+ font-weight: 700;
160
+ color: var(--accent);
161
+ min-width: 1.5em;
162
+ text-align: center;
163
+ }
164
+ .retry-bar {
165
+ width: 100%;
166
+ max-width: 240px;
167
+ margin: 0 auto;
168
+ height: 4px;
169
+ border-radius: 2px;
170
+ background: var(--surface-2);
171
+ overflow: hidden;
172
+ }
173
+ .retry-fill {
174
+ height: 100%;
175
+ background: var(--accent);
176
+ transition: width 0.25s linear;
177
+ }
178
+
179
+ /* Grid de tiles de atajo. */
180
+ .shortcuts {
181
+ display: grid;
182
+ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
183
+ gap: 0.5rem;
184
+ max-width: 520px;
185
+ margin: 0 auto;
186
+ width: 100%;
187
+ }
188
+ .shortcut {
189
+ display: flex;
190
+ align-items: center;
191
+ gap: 0.5rem;
192
+ padding: 12px 14px;
193
+ border-radius: var(--radius);
194
+ background: var(--surface);
195
+ border: 1px solid var(--line);
196
+ color: var(--ink);
197
+ text-decoration: none;
198
+ font-size: 0.875rem;
199
+ text-align: left;
200
+ cursor: pointer;
201
+ font-family: inherit;
202
+ transition: border-color 0.15s, background 0.15s, transform 0.15s;
203
+ }
204
+ .shortcut:hover {
205
+ border-color: var(--line-2);
206
+ background: var(--surface-2);
207
+ transform: translateY(-1px);
208
+ }
209
+ .shortcut ion-icon {
210
+ font-size: 18px;
211
+ min-width: 18px;
212
+ color: var(--ink-3);
213
+ flex-shrink: 0;
214
+ }
215
+ .shortcut-body { min-width: 0; }
216
+ .shortcut-title {
217
+ font-weight: 600;
218
+ color: var(--ink);
219
+ display: block;
220
+ line-height: 1.3;
221
+ }
222
+ .shortcut-desc {
223
+ display: block;
224
+ margin-top: 2px;
225
+ font-size: 11px;
226
+ color: var(--ink-3);
227
+ line-height: 1.3;
228
+ }
229
+
230
+ /* Checklist de diagnóstico (modo bootstrap). */
231
+ .diagnosis {
232
+ display: flex;
233
+ flex-direction: column;
234
+ gap: 6px;
235
+ max-width: 480px;
236
+ margin: 0 auto;
237
+ width: 100%;
238
+ list-style: none;
239
+ padding: 0;
240
+ text-align: left;
241
+ }
242
+ .check {
243
+ display: grid;
244
+ grid-template-columns: 20px 1fr auto;
245
+ gap: 12px;
246
+ align-items: center;
247
+ padding: 12px;
248
+ border-radius: var(--radius);
249
+ background: var(--surface);
250
+ border: 1px solid var(--line);
251
+ font-size: 0.875rem;
252
+ color: var(--ink-2);
253
+ }
254
+ .check[data-status='ok'] { border-color: color-mix(in srgb, var(--ok-leaf) 28%, transparent); }
255
+ .check[data-status='fail'] {
256
+ border-color: color-mix(in srgb, var(--danger) 35%, transparent);
257
+ background: color-mix(in srgb, var(--danger) 5%, var(--surface));
258
+ }
259
+ .check[data-status='pending'] { border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
260
+ .check-icon {
261
+ width: 20px;
262
+ height: 20px;
263
+ display: grid;
264
+ place-items: center;
265
+ color: var(--ink-3);
266
+ }
267
+ .check-icon svg { width: 20px; height: 20px; }
268
+ .check[data-status='ok'] .check-icon { color: var(--ok-leaf); }
269
+ .check[data-status='fail'] .check-icon { color: var(--danger); }
270
+ .check[data-status='pending'] .check-icon { color: var(--warn); }
271
+ .check-body { min-width: 0; }
272
+ .check-name { font-weight: 600; font-size: 0.875rem; color: var(--ink); }
273
+ .check-msg { color: var(--ink-3); font-size: 12px; margin-top: 1px; }
274
+ .check-time {
275
+ font-family: var(--font-mono);
276
+ font-size: 11px;
277
+ color: var(--ink-3);
278
+ white-space: nowrap;
279
+ }
280
+
281
+ /* <details> con traza técnica. */
282
+ .details {
283
+ max-width: 540px;
284
+ margin: 0 auto;
285
+ width: 100%;
286
+ text-align: left;
287
+ font-size: 0.875rem;
288
+ color: var(--ink-2);
289
+ }
290
+ .details summary {
291
+ cursor: pointer;
292
+ padding: 8px 12px;
293
+ border-radius: var(--radius);
294
+ background: var(--surface);
295
+ border: 1px solid var(--line);
296
+ color: var(--ink-2);
297
+ font-weight: 500;
298
+ user-select: none;
299
+ list-style: none;
300
+ }
301
+ .details summary::-webkit-details-marker { display: none; }
302
+ .details summary::before {
303
+ content: '\\25B8';
304
+ display: inline-block;
305
+ margin-right: 6px;
306
+ transition: transform 0.15s;
307
+ }
308
+ .details[open] summary::before { transform: rotate(90deg); }
309
+ .details summary:hover { border-color: var(--line-2); }
310
+ .trace {
311
+ margin: 0.5rem 0 0;
312
+ padding: 12px 14px;
313
+ border-radius: var(--radius);
314
+ background: var(--surface);
315
+ border: 1px solid var(--line);
316
+ font-family: var(--font-mono);
317
+ font-size: 11px;
318
+ line-height: 1.5;
319
+ color: var(--ink-2);
320
+ white-space: pre-wrap;
321
+ overflow-x: auto;
322
+ }
323
+
324
+ /* Acciones (slot) — el host mete sus ion-button. */
325
+ .actions {
326
+ display: flex;
327
+ justify-content: center;
328
+ gap: 0.75rem;
329
+ flex-wrap: wrap;
330
+ margin-top: 0.25rem;
331
+ }
332
+ .actions ::slotted(*) { margin: 0; }
333
+
334
+ .meta {
335
+ font-family: var(--font-mono);
336
+ font-size: 12px;
337
+ color: var(--ink-3);
338
+ }
339
+
340
+ @media (max-width: 600px) {
341
+ .illu { width: 72px; height: 72px; }
342
+ .illu svg { width: 36px; height: 36px; }
343
+ .shortcuts { grid-template-columns: 1fr 1fr; }
344
+ }
345
+
346
+ @media (prefers-reduced-motion: reduce) {
347
+ .shortcut, .retry-fill, .details summary::before { transition: none; }
348
+ }
349
+ `;
350
+ }
351
+ connectedCallback() {
352
+ super.connectedCallback();
353
+ this.startCountdown();
354
+ }
355
+ disconnectedCallback() {
356
+ super.disconnectedCallback();
357
+ this.clearTimer();
358
+ }
359
+ updated(changed) {
360
+ if (changed.has("retrySeconds")) {
361
+ this.startCountdown();
362
+ }
363
+ }
364
+ clearTimer() {
365
+ if (this.timer) {
366
+ clearInterval(this.timer);
367
+ this.timer = void 0;
368
+ }
369
+ }
370
+ // Arranca/reinicia la cuenta atrás cuando retrySeconds es positivo.
371
+ startCountdown() {
372
+ this.clearTimer();
373
+ const secs = Number(this.retrySeconds) || 0;
374
+ this.initialSeconds = secs;
375
+ this.remaining = secs;
376
+ if (secs <= 0) return;
377
+ this.timer = setInterval(() => {
378
+ if (this.remaining <= 1) {
379
+ this.remaining = 0;
380
+ this.clearTimer();
381
+ this.dispatchEvent(
382
+ new CustomEvent("ok-retry", { bubbles: true, composed: true })
383
+ );
384
+ return;
385
+ }
386
+ this.remaining -= 1;
387
+ }, 1e3);
388
+ }
389
+ // SVG de check según estado (sin libs de iconos; dibujado a mano).
390
+ checkSvg(status) {
391
+ if (status === "fail") {
392
+ return html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
393
+ stroke-width="2" stroke-linecap="round"><path d="M18 6 6 18M6 6l12 12" /></svg>`;
394
+ }
395
+ if (status === "pending") {
396
+ return html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
397
+ stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="9" />
398
+ <path d="M8 12h.01M12 12h.01M16 12h.01" /></svg>`;
399
+ }
400
+ return html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
401
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5" /></svg>`;
402
+ }
403
+ renderShortcuts() {
404
+ if (!this.shortcuts?.length) return null;
405
+ return html`
406
+ <div class="shortcuts" role="list">
407
+ ${this.shortcuts.map((s) => {
408
+ const body = html`
409
+ ${s.icon ? html`<ion-icon name=${s.icon} aria-hidden="true"></ion-icon>` : null}
410
+ <span class="shortcut-body">
411
+ <span class="shortcut-title">${s.title}</span>
412
+ ${s.desc ? html`<span class="shortcut-desc">${s.desc}</span>` : null}
413
+ </span>
414
+ `;
415
+ return s.href ? html`<a class="shortcut" role="listitem" href=${s.href}>${body}</a>` : html`<button class="shortcut" type="button" role="listitem"
416
+ @click=${() => this.emitShortcut(s)}>${body}</button>`;
417
+ })}
418
+ </div>
419
+ `;
420
+ }
421
+ emitShortcut(shortcut) {
422
+ this.dispatchEvent(
423
+ new CustomEvent("ok-shortcut", {
424
+ detail: { shortcut },
425
+ bubbles: true,
426
+ composed: true
427
+ })
428
+ );
429
+ }
430
+ renderChecks() {
431
+ if (this.mode !== "bootstrap" || !this.checks?.length) return null;
432
+ return html`
433
+ <ul class="diagnosis">
434
+ ${this.checks.map((c) => {
435
+ const status = c.status ?? "ok";
436
+ return html`
437
+ <li class="check" data-status=${status}>
438
+ <span class="check-icon" aria-hidden="true">${this.checkSvg(status)}</span>
439
+ <span class="check-body">
440
+ <span class="check-name">${c.name}</span>
441
+ ${c.message ? html`<span class="check-msg">${c.message}</span>` : null}
442
+ </span>
443
+ ${c.time ? html`<span class="check-time">${c.time}</span>` : null}
444
+ </li>
445
+ `;
446
+ })}
447
+ </ul>
448
+ `;
449
+ }
450
+ renderRetry() {
451
+ if (this.initialSeconds <= 0) return null;
452
+ const pct = this.initialSeconds > 0 ? Math.max(0, this.remaining / this.initialSeconds * 100) : 0;
453
+ return html`
454
+ <div class="retry" role="status" aria-live="polite">
455
+ <span>${this.retryLabel}</span>
456
+ <span class="retry-num">${this.remaining}</span>
457
+ <span>s</span>
458
+ </div>
459
+ <div class="retry-bar" aria-hidden="true">
460
+ <div class="retry-fill" style="width:${pct}%"></div>
461
+ </div>
462
+ `;
463
+ }
464
+ // Ilustración por variante (triángulo de alerta para warn/danger, info en círculo).
465
+ renderIllu() {
466
+ const icon = this.variant === "info" ? html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
467
+ stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
468
+ <circle cx="12" cy="12" r="9" /><path d="M12 11v5M12 7.5h.01" /></svg>` : html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
469
+ stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
470
+ <path d="M10.3 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" />
471
+ <path d="M12 9v4M12 17h.01" /></svg>`;
472
+ return html`<div class="illu" aria-hidden="true">${icon}</div>`;
473
+ }
474
+ render() {
475
+ return html`
476
+ <main class="page" role="main" aria-labelledby="ok-err-title">
477
+ <div class="inner">
478
+ ${this.renderIllu()}
479
+ ${this.code ? html`<p class="code">${this.code}</p>` : null}
480
+ ${this.title ? html`<h1 class="title" id="ok-err-title">${this.title}</h1>` : null}
481
+ ${this.message ? html`<p class="msg">${this.message}</p>` : null}
482
+
483
+ <div class="search"><slot name="search"></slot></div>
484
+
485
+ ${this.renderRetry()}
486
+ ${this.renderChecks()}
487
+
488
+ ${this.trace ? html`
489
+ <details class="details">
490
+ <summary>${this.detailsLabel}</summary>
491
+ <pre class="trace">${this.trace}</pre>
492
+ </details>
493
+ ` : null}
494
+
495
+ ${this.renderShortcuts()}
496
+
497
+ <div class="actions"><slot name="actions"></slot></div>
498
+
499
+ ${this.meta ? html`<p class="meta">${this.meta}</p>` : null}
500
+ </div>
501
+ </main>
502
+ `;
503
+ }
504
+ }
505
+ __decorateClass([
506
+ property()
507
+ ], OkErrorPage.prototype, "code");
508
+ __decorateClass([
509
+ property()
510
+ ], OkErrorPage.prototype, "title");
511
+ __decorateClass([
512
+ property()
513
+ ], OkErrorPage.prototype, "message");
514
+ __decorateClass([
515
+ property({ reflect: true })
516
+ ], OkErrorPage.prototype, "variant");
517
+ __decorateClass([
518
+ property({ reflect: true })
519
+ ], OkErrorPage.prototype, "mode");
520
+ __decorateClass([
521
+ property({ attribute: false })
522
+ ], OkErrorPage.prototype, "shortcuts");
523
+ __decorateClass([
524
+ property({ attribute: false })
525
+ ], OkErrorPage.prototype, "checks");
526
+ __decorateClass([
527
+ property()
528
+ ], OkErrorPage.prototype, "trace");
529
+ __decorateClass([
530
+ property({ attribute: "details-label" })
531
+ ], OkErrorPage.prototype, "detailsLabel");
532
+ __decorateClass([
533
+ property()
534
+ ], OkErrorPage.prototype, "meta");
535
+ __decorateClass([
536
+ property({ attribute: "retry-label" })
537
+ ], OkErrorPage.prototype, "retryLabel");
538
+ __decorateClass([
539
+ property({ type: Number, attribute: "retry-seconds" })
540
+ ], OkErrorPage.prototype, "retrySeconds");
541
+ __decorateClass([
542
+ state()
543
+ ], OkErrorPage.prototype, "remaining");
544
+ define("ok-error-page", OkErrorPage);
545
+ export {
546
+ OkErrorPage
547
+ };