@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,183 @@
1
+ import { LitElement, css, html, nothing } from "lit";
2
+ import { property } from "lit/decorators.js";
3
+ import { define } from "./define.js";
4
+ import "./ok-qr.js";
5
+ var __defProp = Object.defineProperty;
6
+ var __decorateClass = (decorators, target, key, kind) => {
7
+ var result = void 0;
8
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9
+ if (decorator = decorators[i])
10
+ result = decorator(target, key, result) || result;
11
+ if (result) __defProp(target, key, result);
12
+ return result;
13
+ };
14
+ const DEFAULT_LABELS = {
15
+ empty: "No receipt data.",
16
+ phone: "Tel.",
17
+ receipt: "Receipt",
18
+ servedBy: "Served by",
19
+ customer: "Customer",
20
+ item: "Item",
21
+ amount: "Amount",
22
+ noLines: "— No lines —",
23
+ subtotal: "Subtotal",
24
+ total: "TOTAL",
25
+ change: "Change"
26
+ };
27
+ class OkReceipt extends LitElement {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.qrSize = 120;
31
+ this.labels = {};
32
+ }
33
+ static {
34
+ this.styles = css`
35
+ :host {
36
+ /* Ancho de papel térmico estándar (80mm). Overridable vía --receipt-width. */
37
+ --w: var(--receipt-width, 80mm);
38
+ display: block;
39
+ width: 100%;
40
+ }
41
+ .paper {
42
+ box-sizing: border-box;
43
+ width: var(--w);
44
+ max-width: 100%;
45
+ margin: 0 auto;
46
+ padding: 4mm 3mm;
47
+ background: #fff;
48
+ color: #000;
49
+ /* Monospace = look de tiquet; tabular para alinear importes. */
50
+ font-family: 'Roboto Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
51
+ font-size: 11px;
52
+ line-height: 1.45;
53
+ font-variant-numeric: tabular-nums;
54
+ }
55
+ .center { text-align: center; }
56
+ .biz-logo { max-width: 60%; max-height: 22mm; margin: 0 auto 2mm; display: block; }
57
+ .biz-name { font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
58
+ .biz-meta { font-size: 10px; }
59
+ .sep { border: none; border-top: 1px dashed #000; margin: 2mm 0; }
60
+ .meta {
61
+ display: flex; justify-content: space-between; gap: .5rem;
62
+ font-size: 10px;
63
+ }
64
+ table { width: 100%; border-collapse: collapse; }
65
+ th, td { padding: .3mm 0; vertical-align: top; }
66
+ thead th { font-size: 9px; text-transform: uppercase; text-align: left; border-bottom: 1px solid #000; }
67
+ th.num, td.num { text-align: right; white-space: nowrap; }
68
+ .line-name { word-break: break-word; }
69
+ .line-note { font-size: 9px; padding-left: 2mm; opacity: .8; }
70
+ .qty-price { font-size: 9px; opacity: .85; }
71
+ .totals { width: 100%; }
72
+ .totals td { padding: .2mm 0; }
73
+ .totals td.num { text-align: right; white-space: nowrap; }
74
+ .grand td { font-size: 14px; font-weight: 700; padding-top: 1mm; }
75
+ .pay td { font-size: 10px; }
76
+ .footer { font-size: 10px; white-space: pre-line; }
77
+ .qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 1mm; margin-top: 2mm; }
78
+ .qr-note { font-size: 8px; text-align: center; word-break: break-word; }
79
+ .empty { padding: 4mm; text-align: center; color: #888; font-style: italic; }
80
+ `;
81
+ }
82
+ get t() {
83
+ return { ...DEFAULT_LABELS, ...this.labels };
84
+ }
85
+ cur() {
86
+ return this.receipt?.currency ?? "€";
87
+ }
88
+ money(n) {
89
+ return `${Number(n ?? 0).toFixed(2)} ${this.cur()}`;
90
+ }
91
+ render() {
92
+ const r = this.receipt;
93
+ if (!r) return html`<div class="paper empty">${this.t.empty}</div>`;
94
+ return html`<div class="paper" part="paper">
95
+ ${this.renderHeader(r)}
96
+ <hr class="sep" />
97
+ ${this.renderMeta(r)}
98
+ <hr class="sep" />
99
+ ${this.renderLines(r)}
100
+ <hr class="sep" />
101
+ ${this.renderTotals(r)}
102
+ ${r.footer ? html`<hr class="sep" /><div class="center footer">${r.footer}</div>` : nothing}
103
+ ${this.renderQr(r)}
104
+ </div>`;
105
+ }
106
+ renderHeader(r) {
107
+ const b = r.business ?? { name: "" };
108
+ return html`<div class="center">
109
+ ${b.logo_url ? html`<img class="biz-logo" src=${b.logo_url} alt=${b.name || "logo"} />` : html`<slot name="logo"></slot>`}
110
+ <div class="biz-name">${b.name}</div>
111
+ ${b.address ? html`<div class="biz-meta">${b.address}</div>` : nothing}
112
+ ${b.tax_id ? html`<div class="biz-meta">${b.tax_id}</div>` : nothing}
113
+ ${b.phone ? html`<div class="biz-meta">${this.t.phone} ${b.phone}</div>` : nothing}
114
+ </div>`;
115
+ }
116
+ renderMeta(r) {
117
+ return html`<div class="meta">
118
+ <span>${this.t.receipt}: <strong>${r.number}</strong></span>
119
+ ${r.datetime ? html`<span>${r.datetime}</span>` : nothing}
120
+ </div>
121
+ ${r.cashier || r.customer ? html`<div class="meta">
122
+ ${r.cashier ? html`<span>${this.t.servedBy}: ${r.cashier}</span>` : html`<span></span>`}
123
+ ${r.customer ? html`<span>${this.t.customer}: ${r.customer}</span>` : nothing}
124
+ </div>` : nothing}`;
125
+ }
126
+ renderLines(r) {
127
+ const lines = r.lines ?? [];
128
+ if (!lines.length) return html`<div class="center biz-meta">${this.t.noLines}</div>`;
129
+ return html`<table>
130
+ <thead>
131
+ <tr><th>${this.t.item}</th><th class="num">${this.t.amount}</th></tr>
132
+ </thead>
133
+ <tbody>
134
+ ${lines.map(
135
+ (l) => html`<tr>
136
+ <td class="line-name">
137
+ <div>${l.name}</div>
138
+ <div class="qty-price">${l.qty} × ${this.money(l.unit_price)}</div>
139
+ ${l.note ? html`<div class="line-note">${l.note}</div>` : nothing}
140
+ </td>
141
+ <td class="num">${this.money(l.total)}</td>
142
+ </tr>`
143
+ )}
144
+ </tbody>
145
+ </table>`;
146
+ }
147
+ renderTotals(r) {
148
+ const taxes = r.taxes ?? [];
149
+ return html`<table class="totals">
150
+ ${r.subtotal != null ? html`<tr><td>${this.t.subtotal}</td><td class="num">${this.money(r.subtotal)}</td></tr>` : nothing}
151
+ ${taxes.map(
152
+ (t) => html`<tr><td>${t.label}</td><td class="num">${this.money(t.amount)}</td></tr>`
153
+ )}
154
+ <tr class="grand"><td>${this.t.total}</td><td class="num">${this.money(r.total)}</td></tr>
155
+ ${r.payment ? html`<tr class="pay"><td>${r.payment.method}</td><td class="num">${this.money(
156
+ r.payment.paid ?? r.total
157
+ )}</td></tr>
158
+ ${r.payment.change != null ? html`<tr class="pay"><td>${this.t.change}</td><td class="num">${this.money(
159
+ r.payment.change
160
+ )}</td></tr>` : nothing}` : nothing}
161
+ </table>`;
162
+ }
163
+ renderQr(r) {
164
+ if (!r.qr) return nothing;
165
+ return html`<div class="qr-wrap">
166
+ <ok-qr .value=${r.qr} .size=${this.qrSize} ec="M" color="#000" background="#fff"></ok-qr>
167
+ ${r.qr_note ? html`<div class="qr-note">${r.qr_note}</div>` : nothing}
168
+ </div>`;
169
+ }
170
+ }
171
+ __decorateClass([
172
+ property({ attribute: false })
173
+ ], OkReceipt.prototype, "receipt");
174
+ __decorateClass([
175
+ property({ type: Number, attribute: "qr-size" })
176
+ ], OkReceipt.prototype, "qrSize");
177
+ __decorateClass([
178
+ property({ attribute: false })
179
+ ], OkReceipt.prototype, "labels");
180
+ define("ok-receipt", OkReceipt);
181
+ export {
182
+ OkReceipt
183
+ };
@@ -0,0 +1,94 @@
1
+ import { LitElement, css, html } from "lit";
2
+ import { property } 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 OkReveal extends LitElement {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.variant = "up";
17
+ this.delay = 0;
18
+ this.once = true;
19
+ }
20
+ static {
21
+ this.styles = css`
22
+ :host {
23
+ display: block;
24
+ width: 100%;
25
+ }
26
+ .r {
27
+ height: 100%;
28
+ opacity: 0;
29
+ transform: translateY(18px);
30
+ transition:
31
+ opacity var(--ok-reveal-duration, 0.65s) cubic-bezier(0.22, 0.7, 0.2, 1) var(--ok-reveal-delay, 0ms),
32
+ transform var(--ok-reveal-duration, 0.65s) cubic-bezier(0.22, 0.7, 0.2, 1) var(--ok-reveal-delay, 0ms);
33
+ will-change: opacity, transform;
34
+ }
35
+ :host([variant='fade']) .r { transform: none; }
36
+ :host([variant='scale']) .r { transform: scale(0.95); }
37
+ :host([variant='left']) .r { transform: translateX(-28px); }
38
+ :host([variant='right']) .r { transform: translateX(28px); }
39
+ :host(.ok-in) .r {
40
+ opacity: 1;
41
+ transform: none;
42
+ }
43
+ @media (prefers-reduced-motion: reduce) {
44
+ .r {
45
+ opacity: 1 !important;
46
+ transform: none !important;
47
+ transition: none !important;
48
+ }
49
+ }
50
+ `;
51
+ }
52
+ connectedCallback() {
53
+ super.connectedCallback();
54
+ this.style.setProperty("--ok-reveal-delay", `${this.delay}ms`);
55
+ if (typeof IntersectionObserver === "undefined") {
56
+ this.classList.add("ok-in");
57
+ return;
58
+ }
59
+ this._io = new IntersectionObserver(
60
+ (entries) => {
61
+ for (const e of entries) {
62
+ if (e.isIntersecting) {
63
+ this.classList.add("ok-in");
64
+ if (this.once) this._io?.disconnect();
65
+ } else if (!this.once) {
66
+ this.classList.remove("ok-in");
67
+ }
68
+ }
69
+ },
70
+ { threshold: 0.12, rootMargin: "0px 0px -8% 0px" }
71
+ );
72
+ this._io.observe(this);
73
+ }
74
+ disconnectedCallback() {
75
+ super.disconnectedCallback();
76
+ this._io?.disconnect();
77
+ }
78
+ render() {
79
+ return html`<div class="r"><slot></slot></div>`;
80
+ }
81
+ }
82
+ __decorateClass([
83
+ property({ reflect: true })
84
+ ], OkReveal.prototype, "variant");
85
+ __decorateClass([
86
+ property({ type: Number })
87
+ ], OkReveal.prototype, "delay");
88
+ __decorateClass([
89
+ property({ type: Boolean })
90
+ ], OkReveal.prototype, "once");
91
+ define("ok-reveal", OkReveal);
92
+ export {
93
+ OkReveal
94
+ };