@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,225 @@
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
+ const DEFAULT_LABELS = {
14
+ country: "Country",
15
+ number: "Phone number"
16
+ };
17
+ const _OkPhone = class _OkPhone2 extends LitElement {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.value = "";
21
+ this.country = "ES";
22
+ this.placeholder = "";
23
+ this.labels = {};
24
+ this.number = "";
25
+ }
26
+ static {
27
+ this.styles = css`
28
+ :host {
29
+ /* Vars overridable (estilo Ionic), default = cadena --ok-* → --ion-* → hex */
30
+ --background: var(--ok-surface, var(--ion-item-background, #ffffff));
31
+ --color: var(--ok-text, var(--ion-text-color, #1c1b17));
32
+ --border-color: var(--ok-border, rgba(var(--ion-text-color-rgb, 28, 27, 23), 0.2));
33
+ --border-radius: var(--ok-radius, var(--ion-border-radius, 8px));
34
+ --primary-color: var(--ok-primary, var(--ion-color-primary, #3880ff));
35
+ --font: var(--ok-font, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
36
+
37
+ /* Ocupa el ancho del contenedor y es responsive. */
38
+ display: block;
39
+ width: 100%;
40
+ color: var(--color);
41
+ font-family: var(--font);
42
+ }
43
+ .label {
44
+ display: block;
45
+ margin: 0 0 0.25rem;
46
+ font-size: 0.85rem;
47
+ color: var(--color);
48
+ }
49
+ /* Selector de país (ancho fijo cómodo) + número (resto del espacio). */
50
+ .row {
51
+ display: flex;
52
+ align-items: stretch;
53
+ gap: 0.5rem;
54
+ width: 100%;
55
+ }
56
+ .country {
57
+ --background: var(--background);
58
+ --color: var(--color);
59
+ --border-color: var(--border-color);
60
+ --border-radius: var(--border-radius);
61
+ flex: 0 0 7.5rem;
62
+ min-width: 0;
63
+ }
64
+ .number {
65
+ --background: var(--background);
66
+ --color: var(--color);
67
+ --border-color: var(--border-color);
68
+ --border-radius: var(--border-radius);
69
+ --highlight-color-focused: var(--primary-color);
70
+ flex: 1 1 auto;
71
+ min-width: 0;
72
+ }
73
+ /* Móvil: apila país sobre número para no comprimir el input. */
74
+ @media (max-width: 480px) {
75
+ .row {
76
+ flex-direction: column;
77
+ }
78
+ .country {
79
+ flex: 0 0 auto;
80
+ width: 100%;
81
+ }
82
+ }
83
+ `;
84
+ }
85
+ static {
86
+ this.DEFAULT_COUNTRIES = [
87
+ { iso: "ES", name: "España", dial: "+34" },
88
+ { iso: "PT", name: "Portugal", dial: "+351" },
89
+ { iso: "FR", name: "Francia", dial: "+33" },
90
+ { iso: "IT", name: "Italia", dial: "+39" },
91
+ { iso: "DE", name: "Alemania", dial: "+49" },
92
+ { iso: "GB", name: "Reino Unido", dial: "+44" },
93
+ { iso: "IE", name: "Irlanda", dial: "+353" },
94
+ { iso: "NL", name: "Países Bajos", dial: "+31" },
95
+ { iso: "BE", name: "Bélgica", dial: "+32" },
96
+ { iso: "US", name: "Estados Unidos", dial: "+1" },
97
+ { iso: "MX", name: "México", dial: "+52" },
98
+ { iso: "AR", name: "Argentina", dial: "+54" },
99
+ { iso: "CO", name: "Colombia", dial: "+57" },
100
+ { iso: "CL", name: "Chile", dial: "+56" }
101
+ ];
102
+ }
103
+ get t() {
104
+ return { ...DEFAULT_LABELS, ...this.labels };
105
+ }
106
+ // Sincroniza el número interno con la prop `value` (filtrando a dígitos).
107
+ willUpdate(changed) {
108
+ if (changed.has("value")) {
109
+ this.number = this.onlyDigits(this.value);
110
+ }
111
+ }
112
+ // Lista efectiva de países.
113
+ get list() {
114
+ return this.countries?.length ? this.countries : _OkPhone2.DEFAULT_COUNTRIES;
115
+ }
116
+ // País actualmente seleccionado (fallback al primero de la lista).
117
+ get current() {
118
+ return this.list.find((c) => c.iso === this.country) ?? this.list[0];
119
+ }
120
+ // Deja sólo dígitos en una cadena.
121
+ onlyDigits(raw) {
122
+ let out = "";
123
+ for (const ch of raw) if (ch >= "0" && ch <= "9") out += ch;
124
+ return out;
125
+ }
126
+ // Convierte un ISO2 a su bandera emoji (Regional Indicator Symbols). Sin assets.
127
+ flag(iso) {
128
+ const code = iso.trim().toUpperCase();
129
+ if (code.length !== 2) return "";
130
+ const base = 127462;
131
+ return String.fromCodePoint(
132
+ base + (code.charCodeAt(0) - 65),
133
+ base + (code.charCodeAt(1) - 65)
134
+ );
135
+ }
136
+ // Calcula el número en formato E.164 (dial + dígitos), o '' si no hay número.
137
+ e164() {
138
+ return this.number ? `${this.current.dial}${this.number}` : "";
139
+ }
140
+ // Emite `ok-change` con el estado actual completo.
141
+ emit() {
142
+ this.dispatchEvent(
143
+ new CustomEvent("ok-change", {
144
+ detail: {
145
+ value: this.number,
146
+ country: this.current.iso,
147
+ dial: this.current.dial,
148
+ e164: this.e164()
149
+ },
150
+ bubbles: true,
151
+ composed: true
152
+ })
153
+ );
154
+ }
155
+ // Cambio de país en el ion-select.
156
+ onCountry(e) {
157
+ const iso = e.detail?.value ?? this.country;
158
+ this.country = iso;
159
+ this.emit();
160
+ }
161
+ // Edición del número: filtra a dígitos y emite.
162
+ onNumber(e) {
163
+ const raw = e.detail?.value ?? "";
164
+ this.number = this.onlyDigits(String(raw));
165
+ this.value = this.number;
166
+ this.emit();
167
+ }
168
+ render() {
169
+ return html`
170
+ ${this.label ? html`<span class="label">${this.label}</span>` : null}
171
+ <div class="row">
172
+ <ion-select
173
+ class="country"
174
+ fill="outline"
175
+ interface="popover"
176
+ aria-label=${this.t.country}
177
+ .value=${this.current.iso}
178
+ @ionChange=${this.onCountry}
179
+ >
180
+ ${this.list.map(
181
+ (c) => html`<ion-select-option value=${c.iso}>
182
+ ${this.flag(c.iso)} ${c.dial}
183
+ </ion-select-option>`
184
+ )}
185
+ </ion-select>
186
+ <ion-input
187
+ class="number"
188
+ type="tel"
189
+ inputmode="tel"
190
+ fill="outline"
191
+ aria-label=${this.t.number}
192
+ placeholder=${this.placeholder}
193
+ .value=${this.number}
194
+ @ionInput=${this.onNumber}
195
+ ></ion-input>
196
+ </div>
197
+ `;
198
+ }
199
+ };
200
+ __decorateClass([
201
+ property()
202
+ ], _OkPhone.prototype, "value");
203
+ __decorateClass([
204
+ property()
205
+ ], _OkPhone.prototype, "country");
206
+ __decorateClass([
207
+ property({ attribute: false })
208
+ ], _OkPhone.prototype, "countries");
209
+ __decorateClass([
210
+ property()
211
+ ], _OkPhone.prototype, "placeholder");
212
+ __decorateClass([
213
+ property()
214
+ ], _OkPhone.prototype, "label");
215
+ __decorateClass([
216
+ property({ attribute: false })
217
+ ], _OkPhone.prototype, "labels");
218
+ __decorateClass([
219
+ state()
220
+ ], _OkPhone.prototype, "number");
221
+ let OkPhone = _OkPhone;
222
+ define("ok-phone", OkPhone);
223
+ export {
224
+ OkPhone
225
+ };
@@ -0,0 +1,171 @@
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
+ const DEFAULT_LABELS = {
14
+ keypad: "Number pad",
15
+ backspace: "Delete"
16
+ };
17
+ class OkPinpad extends LitElement {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.value = "";
21
+ this.masked = false;
22
+ this.labels = {};
23
+ }
24
+ static {
25
+ this.styles = css`
26
+ :host {
27
+ /* Vars overridable (estilo Ionic), default = cadena --ok-* → --ion-* → hex */
28
+ --color: var(--ok-text, var(--ion-text-color, #1c1b17));
29
+ --dot-color: var(--ok-primary, var(--ion-color-primary, #3880ff));
30
+ --display-bg: var(--ok-hover, rgba(var(--ion-text-color-rgb, 28, 27, 23), 0.04));
31
+ --border-radius: var(--ok-radius, 8px);
32
+ --gap: var(--ok-pinpad-gap, 0.6rem);
33
+ --key-size: var(--ok-pinpad-key-size, 4rem);
34
+ --font: var(--ok-font, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
35
+
36
+ display: inline-flex;
37
+ flex-direction: column;
38
+ align-items: stretch;
39
+ gap: var(--gap);
40
+ font-family: var(--font);
41
+ color: var(--color);
42
+ }
43
+ /* Pantalla superior con los dígitos o puntos. */
44
+ .display {
45
+ min-height: 2.25rem;
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: center;
49
+ gap: 0.45rem;
50
+ padding: 0.4rem 0.6rem;
51
+ background: var(--display-bg);
52
+ border-radius: var(--border-radius);
53
+ font-size: 1.5rem;
54
+ font-weight: 600;
55
+ letter-spacing: 0.1em;
56
+ min-width: calc(var(--key-size) * 3 + var(--gap) * 2);
57
+ box-sizing: border-box;
58
+ }
59
+ .display .dot {
60
+ width: 0.7rem;
61
+ height: 0.7rem;
62
+ border-radius: 50%;
63
+ background: var(--dot-color);
64
+ }
65
+ .display .placeholder {
66
+ opacity: 0.4;
67
+ font-weight: 400;
68
+ font-size: 1rem;
69
+ }
70
+ /* Rejilla de teclas 3×4. */
71
+ .grid {
72
+ display: grid;
73
+ grid-template-columns: repeat(3, var(--key-size));
74
+ gap: var(--gap);
75
+ }
76
+ ion-button {
77
+ --border-radius: var(--border-radius);
78
+ width: var(--key-size);
79
+ height: var(--key-size);
80
+ margin: 0;
81
+ font-size: 1.35rem;
82
+ font-weight: 500;
83
+ }
84
+ /* La celda vacía (esquina inferior izquierda) mantiene la rejilla cuadrada. */
85
+ .spacer {
86
+ width: var(--key-size);
87
+ height: var(--key-size);
88
+ }
89
+ `;
90
+ }
91
+ // Textos efectivos: defaults en inglés + overrides del consumidor.
92
+ get t() {
93
+ return { ...DEFAULT_LABELS, ...this.labels };
94
+ }
95
+ // Añade un dígito (respetando `length`) y emite eventos.
96
+ press(digit) {
97
+ if (this.length != null && this.value.length >= this.length) return;
98
+ this.value = this.value + digit;
99
+ this.emitInput();
100
+ if (this.length != null && this.value.length === this.length) {
101
+ this.dispatchEvent(
102
+ new CustomEvent("ok-complete", {
103
+ detail: { value: this.value },
104
+ bubbles: true,
105
+ composed: true
106
+ })
107
+ );
108
+ }
109
+ }
110
+ // Borra el último dígito y emite `ok-input`.
111
+ backspace() {
112
+ if (!this.value) return;
113
+ this.value = this.value.slice(0, -1);
114
+ this.emitInput();
115
+ }
116
+ emitInput() {
117
+ this.dispatchEvent(
118
+ new CustomEvent("ok-input", {
119
+ detail: { value: this.value },
120
+ bubbles: true,
121
+ composed: true
122
+ })
123
+ );
124
+ }
125
+ // Pinta la pantalla: dots si `masked`, dígitos si no, placeholder si vacío.
126
+ renderDisplay() {
127
+ if (!this.value) {
128
+ return html`<span class="placeholder">&mdash;</span>`;
129
+ }
130
+ if (this.masked) {
131
+ return Array.from(this.value, () => html`<span class="dot"></span>`);
132
+ }
133
+ return html`<span>${this.value}</span>`;
134
+ }
135
+ render() {
136
+ const digits = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
137
+ return html`
138
+ <div class="display" role="status" aria-live="polite">${this.renderDisplay()}</div>
139
+ <div class="grid" role="group" aria-label=${this.t.keypad}>
140
+ ${digits.map(
141
+ (d) => html`<ion-button
142
+ fill="outline"
143
+ aria-label=${d}
144
+ @click=${() => this.press(d)}
145
+ >${d}</ion-button>`
146
+ )}
147
+ <span class="spacer" aria-hidden="true"></span>
148
+ <ion-button fill="outline" aria-label="0" @click=${() => this.press("0")}>0</ion-button>
149
+ <ion-button fill="clear" aria-label=${this.t.backspace} @click=${() => this.backspace()}>
150
+ <ion-icon slot="icon-only" name="backspace-outline"></ion-icon>
151
+ </ion-button>
152
+ </div>
153
+ `;
154
+ }
155
+ }
156
+ __decorateClass([
157
+ property({ type: String })
158
+ ], OkPinpad.prototype, "value");
159
+ __decorateClass([
160
+ property({ type: Number })
161
+ ], OkPinpad.prototype, "length");
162
+ __decorateClass([
163
+ property({ type: Boolean })
164
+ ], OkPinpad.prototype, "masked");
165
+ __decorateClass([
166
+ property({ attribute: false })
167
+ ], OkPinpad.prototype, "labels");
168
+ define("ok-pinpad", OkPinpad);
169
+ export {
170
+ OkPinpad
171
+ };
@@ -0,0 +1,184 @@
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
+ const DEFAULT_LABELS = {
14
+ popular: "Popular"
15
+ };
16
+ class OkPricingCard extends LitElement {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.period = "";
20
+ this.features = [];
21
+ this.featured = false;
22
+ this.labels = {};
23
+ }
24
+ static {
25
+ this.styles = css`
26
+ :host {
27
+ display: block;
28
+ width: 100%;
29
+ height: 100%;
30
+ --color: var(--ok-text, var(--ion-text-color, #18181b));
31
+ --muted: var(--ok-muted, rgba(var(--ion-text-color-rgb, 24, 24, 27), 0.62));
32
+ --surface: var(--ok-surface, var(--ion-card-background, var(--ion-background-color, #fff)));
33
+ --border: var(--ok-border, rgba(var(--ion-text-color-rgb, 24, 24, 27), 0.1));
34
+ --radius: var(--ok-radius, 18px);
35
+ --primary: var(--ion-color-primary, #1496d6);
36
+ --success: var(--ion-color-success, #2dd36f);
37
+ font-family: var(--ok-font, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
38
+ }
39
+ .card {
40
+ box-sizing: border-box;
41
+ height: 100%;
42
+ display: flex;
43
+ flex-direction: column;
44
+ padding: clamp(1.4rem, 2.5vw, 2rem);
45
+ color: var(--color);
46
+ background: var(--surface);
47
+ border: 1px solid var(--border);
48
+ border-radius: var(--radius);
49
+ position: relative;
50
+ transition: transform var(--ok-transition, 160ms ease), box-shadow var(--ok-transition, 160ms ease);
51
+ }
52
+ :host([featured]) .card {
53
+ border: 1.5px solid color-mix(in oklab, var(--primary) 70%, transparent);
54
+ box-shadow: 0 24px 60px -30px color-mix(in oklab, var(--primary) 65%, transparent);
55
+ background: linear-gradient(180deg, color-mix(in oklab, var(--primary) 6%, var(--surface)), var(--surface));
56
+ }
57
+ .card:hover { transform: translateY(-4px); }
58
+ .badge {
59
+ position: absolute;
60
+ top: -0.8rem;
61
+ left: 50%;
62
+ transform: translateX(-50%);
63
+ padding: 0.3rem 0.85rem;
64
+ border-radius: 999px;
65
+ font-size: 0.7rem;
66
+ font-weight: 700;
67
+ letter-spacing: 0.03em;
68
+ text-transform: uppercase;
69
+ color: var(--ion-color-primary-contrast, #fff);
70
+ background: var(--primary);
71
+ box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--primary) 80%, transparent);
72
+ white-space: nowrap;
73
+ }
74
+ .name {
75
+ font-size: 0.72rem;
76
+ font-weight: 700;
77
+ letter-spacing: 0.06em;
78
+ text-transform: uppercase;
79
+ color: var(--muted);
80
+ }
81
+ :host([featured]) .name { color: var(--primary); }
82
+ .price {
83
+ display: flex;
84
+ align-items: baseline;
85
+ gap: 0.35rem;
86
+ margin-top: 0.4rem;
87
+ }
88
+ .price .amount {
89
+ font-size: clamp(2rem, 1.4rem + 2vw, 2.6rem);
90
+ font-weight: 700;
91
+ letter-spacing: -0.03em;
92
+ line-height: 1;
93
+ }
94
+ .price .period { font-size: 0.95rem; color: var(--muted); }
95
+ .desc {
96
+ margin-top: 0.6rem;
97
+ color: var(--muted);
98
+ font-size: 0.92rem;
99
+ line-height: 1.5;
100
+ }
101
+ ul {
102
+ list-style: none;
103
+ margin: 1.25rem 0 0;
104
+ padding: 1.25rem 0 0;
105
+ border-top: 1px solid color-mix(in oklab, var(--color) 9%, transparent);
106
+ display: flex;
107
+ flex-direction: column;
108
+ gap: 0.65rem;
109
+ flex: 1;
110
+ }
111
+ li {
112
+ display: flex;
113
+ gap: 0.55rem;
114
+ align-items: flex-start;
115
+ font-size: 0.92rem;
116
+ line-height: 1.4;
117
+ }
118
+ li .check {
119
+ flex: 0 0 auto;
120
+ width: 1.15rem;
121
+ height: 1.15rem;
122
+ margin-top: 0.05rem;
123
+ display: grid;
124
+ place-items: center;
125
+ border-radius: 999px;
126
+ color: var(--success);
127
+ background: color-mix(in oklab, var(--success) 16%, transparent);
128
+ font-size: 0.7rem;
129
+ font-weight: 700;
130
+ }
131
+ .cta { margin-top: 1.4rem; }
132
+ ::slotted([slot='cta']) { width: 100%; }
133
+ `;
134
+ }
135
+ get t() {
136
+ return { ...DEFAULT_LABELS, ...this.labels };
137
+ }
138
+ render() {
139
+ const badgeText = this.badge ?? (this.featured ? this.t.popular : "");
140
+ return html`
141
+ <div class="card">
142
+ ${badgeText ? html`<span class="badge">${badgeText}</span>` : null}
143
+ ${this.name ? html`<div class="name">${this.name}</div>` : null}
144
+ ${this.price ? html`<div class="price">
145
+ <span class="amount">${this.price}</span>
146
+ ${this.period ? html`<span class="period">${this.period}</span>` : null}
147
+ </div>` : null}
148
+ ${this.description ? html`<p class="desc">${this.description}</p>` : null}
149
+ ${this.features.length ? html`<ul>
150
+ ${this.features.map((f) => html`<li><span class="check">✓</span><span>${f}</span></li>`)}
151
+ </ul>` : html`<slot></slot>`}
152
+ <div class="cta"><slot name="cta"></slot></div>
153
+ </div>
154
+ `;
155
+ }
156
+ }
157
+ __decorateClass([
158
+ property()
159
+ ], OkPricingCard.prototype, "name");
160
+ __decorateClass([
161
+ property()
162
+ ], OkPricingCard.prototype, "price");
163
+ __decorateClass([
164
+ property()
165
+ ], OkPricingCard.prototype, "period");
166
+ __decorateClass([
167
+ property()
168
+ ], OkPricingCard.prototype, "description");
169
+ __decorateClass([
170
+ property({ attribute: false })
171
+ ], OkPricingCard.prototype, "features");
172
+ __decorateClass([
173
+ property({ type: Boolean, reflect: true })
174
+ ], OkPricingCard.prototype, "featured");
175
+ __decorateClass([
176
+ property()
177
+ ], OkPricingCard.prototype, "badge");
178
+ __decorateClass([
179
+ property({ attribute: false })
180
+ ], OkPricingCard.prototype, "labels");
181
+ define("ok-pricing-card", OkPricingCard);
182
+ export {
183
+ OkPricingCard
184
+ };