@erplora/outfitkit 0.1.15 → 0.1.16

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 (43) hide show
  1. package/dist/cdn.d.ts +1 -0
  2. package/dist/components/ok-data-table/csv-encoding.d.ts +4 -0
  3. package/dist/components/ok-data-table/csv-encoding.test.d.ts +1 -0
  4. package/dist/components/ok-theme-picker/ok-theme-picker.d.ts +46 -0
  5. package/dist/components/ok-theme-picker/ok-theme-picker.test.d.ts +1 -0
  6. package/dist/index.d.ts +4 -2
  7. package/dist/index.js +4 -0
  8. package/dist/ok-app-launcher.js +1 -1
  9. package/dist/ok-audio.js +1 -1
  10. package/dist/ok-calendar.js +1 -1
  11. package/dist/ok-carousel.js +1 -1
  12. package/dist/ok-chat.js +1 -1
  13. package/dist/ok-combo.js +1 -1
  14. package/dist/ok-command-palette.js +1 -1
  15. package/dist/ok-data-table.js +13 -3
  16. package/dist/ok-date-picker.js +1 -1
  17. package/dist/ok-drawer.js +1 -1
  18. package/dist/ok-dropzone.js +1 -1
  19. package/dist/ok-file-manager.js +1 -1
  20. package/dist/ok-inline-feedback.js +1 -1
  21. package/dist/ok-kpi.js +1 -1
  22. package/dist/ok-lightbox.js +1 -1
  23. package/dist/ok-mail.js +1 -1
  24. package/dist/ok-menubar.js +1 -1
  25. package/dist/ok-notification-center.js +1 -1
  26. package/dist/ok-pdf.js +1 -1
  27. package/dist/ok-pinpad.js +1 -1
  28. package/dist/ok-qty-stepper.js +1 -1
  29. package/dist/ok-scheduler.js +1 -1
  30. package/dist/ok-signature.js +1 -1
  31. package/dist/ok-split-button.js +1 -1
  32. package/dist/ok-stepper.js +1 -1
  33. package/dist/ok-tag-input.js +1 -1
  34. package/dist/ok-theme-picker.js +221 -0
  35. package/dist/ok-tree.js +1 -1
  36. package/dist/ok-video.js +1 -1
  37. package/dist/ok-widget-board.js +1 -1
  38. package/dist/outfitkit.bundle.js +1247 -1041
  39. package/dist/outfitkit.js +1 -0
  40. package/dist/palettes.css +422 -0
  41. package/dist/shared/icons.js +45 -45
  42. package/dist/theme/palettes.test.d.ts +1 -0
  43. package/package.json +4 -1
package/dist/cdn.d.ts CHANGED
@@ -73,6 +73,7 @@ import './components/ok-hover-card/ok-hover-card.js';
73
73
  import './components/ok-notification-center/ok-notification-center.js';
74
74
  import './components/ok-coachmark/ok-coachmark.js';
75
75
  import './components/ok-select-card/ok-select-card.js';
76
+ import './components/ok-theme-picker/ok-theme-picker.js';
76
77
  import './components/ok-error-page/ok-error-page.js';
77
78
  import './components/ok-date-picker/ok-date-picker.js';
78
79
  import './components/ok-time-picker/ok-time-picker.js';
@@ -0,0 +1,4 @@
1
+ /** BOM UTF-8: al frente del export para que Excel detecte la codificación. */
2
+ export declare const CSV_BOM = "\uFEFF";
3
+ /** Bytes de un fichero CSV → texto: UTF-8 estricto con fallback a Windows-1252 (Excel). */
4
+ export declare function decodeCsvBuffer(buf: ArrayBuffer): string;
@@ -0,0 +1,46 @@
1
+ import { LitElement } from 'lit';
2
+ export interface OkThemePickerPalette {
3
+ /** Id de la paleta (valor de `data-ok-palette`; 'erplora' = default sin atributo). */
4
+ id: string;
5
+ /** Nombre visible/accesible. */
6
+ label: string;
7
+ /** Color de marca para el swatch. */
8
+ brand: string;
9
+ }
10
+ /** Paletas canónicas — espejo 1:1 de palettes.css (guard en palettes.test.ts). */
11
+ export declare const DEFAULT_PALETTES: OkThemePickerPalette[];
12
+ /** Único punto que escribe `data-ok-palette`: 'erplora' (o vacío) QUITA el atributo. */
13
+ export declare function applyPalette(root: Element, palette: string): void;
14
+ export type OkThemePickerMode = 'system' | 'light' | 'dark';
15
+ export interface OkThemePickerLabels {
16
+ /** Encabezado de la sección de paletas. */
17
+ palette: string;
18
+ /** Encabezado de la sección de modo. */
19
+ mode: string;
20
+ system: string;
21
+ light: string;
22
+ dark: string;
23
+ }
24
+ export declare class OkThemePicker extends LitElement {
25
+ static styles: import("lit").CSSResult;
26
+ /** Paleta activa ('erplora' = marca por defecto). */
27
+ palette: string;
28
+ /** Modo de color activo. */
29
+ mode: OkThemePickerMode;
30
+ /** Oculta el segmento de modo (para hosts con su propio toggle claro/oscuro). */
31
+ hideMode: boolean;
32
+ /** Paletas a mostrar (default: las canónicas de palettes.css). */
33
+ palettes: OkThemePickerPalette[];
34
+ /** Textos i18n (parcial; se mezclan sobre los defaults en inglés). */
35
+ labels: Partial<OkThemePickerLabels>;
36
+ private get t();
37
+ private emitChange;
38
+ private pickPalette;
39
+ private pickMode;
40
+ render(): unknown;
41
+ }
42
+ declare global {
43
+ interface HTMLElementTagNameMap {
44
+ 'ok-theme-picker': OkThemePicker;
45
+ }
46
+ }
@@ -0,0 +1 @@
1
+ import './ok-theme-picker.js';
package/dist/index.d.ts CHANGED
@@ -51,9 +51,9 @@ export { OkAudio } from './components/ok-audio/ok-audio.js';
51
51
  export { OkVideo } from './components/ok-video/ok-video.js';
52
52
  export { OkPdf } from './components/ok-pdf/ok-pdf.js';
53
53
  export { OkReceipt } from './components/ok-receipt/ok-receipt.js';
54
- export type { ReceiptData, ReceiptLine, ReceiptTax, ReceiptPayment, ReceiptBusiness, } from './components/ok-receipt/ok-receipt.js';
54
+ export type { ReceiptData, ReceiptLine, ReceiptTax, ReceiptPayment, ReceiptBusiness, OkReceiptLabels, } from './components/ok-receipt/ok-receipt.js';
55
55
  export { OkInvoice } from './components/ok-invoice/ok-invoice.js';
56
- export type { InvoiceData, InvoiceParty, InvoiceLine, InvoiceTaxLine, } from './components/ok-invoice/ok-invoice.js';
56
+ export type { InvoiceData, InvoiceParty, InvoiceLine, InvoiceTaxLine, OkInvoiceLabels, } from './components/ok-invoice/ok-invoice.js';
57
57
  export { OkTimeline } from './components/ok-timeline/ok-timeline.js';
58
58
  export type { OkTimelineItem } from './components/ok-timeline/ok-timeline.js';
59
59
  export { OkQtyStepper } from './components/ok-qty-stepper/ok-qty-stepper.js';
@@ -115,6 +115,8 @@ export { OkCoachmark } from './components/ok-coachmark/ok-coachmark.js';
115
115
  export type { OkCoachStep, OkCoachPlacement, OkCoachmarkLabels } from './components/ok-coachmark/ok-coachmark.js';
116
116
  export { OkSelectCard } from './components/ok-select-card/ok-select-card.js';
117
117
  export type { OkSelectCardChangeDetail } from './components/ok-select-card/ok-select-card.js';
118
+ export { OkThemePicker, DEFAULT_PALETTES, applyPalette } from './components/ok-theme-picker/ok-theme-picker.js';
119
+ export type { OkThemePickerPalette, OkThemePickerMode, OkThemePickerLabels, } from './components/ok-theme-picker/ok-theme-picker.js';
118
120
  export { OkErrorPage } from './components/ok-error-page/ok-error-page.js';
119
121
  export type { OkErrorPageVariant, OkErrorPageMode, OkErrorCheckStatus, OkErrorShortcut, OkErrorCheck } from './components/ok-error-page/ok-error-page.js';
120
122
  export { OkDatePicker } from './components/ok-date-picker/ok-date-picker.js';
package/dist/index.js CHANGED
@@ -74,6 +74,7 @@ import { OkHoverCard } from "./ok-hover-card.js";
74
74
  import { OkNotificationCenter } from "./ok-notification-center.js";
75
75
  import { OkCoachmark } from "./ok-coachmark.js";
76
76
  import { OkSelectCard } from "./ok-select-card.js";
77
+ import { DEFAULT_PALETTES, OkThemePicker, applyPalette } from "./ok-theme-picker.js";
77
78
  import { OkErrorPage } from "./ok-error-page.js";
78
79
  import { OkDatePicker } from "./ok-date-picker.js";
79
80
  import { OkTimePicker } from "./ok-time-picker.js";
@@ -96,6 +97,7 @@ import { OkAvatarGroup } from "./ok-avatar-group.js";
96
97
  import { OkOrgChart } from "./ok-org-chart.js";
97
98
  import { OkFileManager } from "./ok-file-manager.js";
98
99
  export {
100
+ DEFAULT_PALETTES,
99
101
  OkAppLauncher,
100
102
  OkAudio,
101
103
  OkAvatar,
@@ -185,6 +187,7 @@ export {
185
187
  OkStore,
186
188
  OkTagInput,
187
189
  OkTestimonial,
190
+ OkThemePicker,
188
191
  OkTimePicker,
189
192
  OkTimeline,
190
193
  OkTree,
@@ -192,6 +195,7 @@ export {
192
195
  OkWidgetBoard,
193
196
  OkWizard,
194
197
  StoreController,
198
+ applyPalette,
195
199
  createStore,
196
200
  store
197
201
  };
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, render, nothing, html } from "lit";
2
2
  import { property, state } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { o as okIcon, A as iconAppsOutline, B as iconCloseOutline } from "./shared/icons.js";
4
+ import { o as okIcon, u as iconAppsOutline, v as iconCloseOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
package/dist/ok-audio.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, state, query } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { J as iconVolumeMuteOutline, K as iconVolumeLowOutline, L as iconVolumeHighOutline, o as okIcon } from "./shared/icons.js";
4
+ import { E as iconVolumeMuteOutline, F as iconVolumeLowOutline, G as iconVolumeHighOutline, o as okIcon } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, state } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { q as iconChevronForwardOutline, z as iconChevronBackOutline } from "./shared/icons.js";
4
+ import { g as iconChevronForwardOutline, t as iconChevronBackOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, state, query } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { z as iconChevronBackOutline, q as iconChevronForwardOutline } from "./shared/icons.js";
4
+ import { t as iconChevronBackOutline, g as iconChevronForwardOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
package/dist/ok-chat.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, query } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { G as iconSend } from "./shared/icons.js";
4
+ import { B as iconSend } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
package/dist/ok-combo.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, state } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { h as iconChevronDownOutline } from "./shared/icons.js";
4
+ import { w as iconChevronDownOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, state, query } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { o as okIcon, Q as iconSearchOutline } from "./shared/icons.js";
4
+ import { o as okIcon, L as iconSearchOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -3,7 +3,17 @@ import { property, state } from "lit/decorators.js";
3
3
  import { repeat } from "lit/directives/repeat.js";
4
4
  import { styleMap } from "lit/directives/style-map.js";
5
5
  import { define } from "./define.js";
6
- import { i as iconCalendarOutline, a as iconEllipsisVertical, o as okIcon, b as iconClose, c as iconChevronBack, d as iconChevronForward, e as iconFileTrayOutline, f as iconSwapVerticalOutline, g as iconChevronUpOutline, h as iconChevronDownOutline } from "./shared/icons.js";
6
+ import { N as iconCalendarOutline, s as iconEllipsisVertical, o as okIcon, m as iconClose, a as iconChevronBack, Q as iconChevronForward, R as iconFileTrayOutline, S as iconSwapVerticalOutline, T as iconChevronUpOutline, w as iconChevronDownOutline } from "./shared/icons.js";
7
+ const CSV_BOM = "\uFEFF";
8
+ function decodeCsvBuffer(buf) {
9
+ let text;
10
+ try {
11
+ text = new TextDecoder("utf-8", { fatal: true }).decode(buf);
12
+ } catch {
13
+ text = new TextDecoder("windows-1252").decode(buf);
14
+ }
15
+ return text.charCodeAt(0) === 65279 ? text.slice(1) : text;
16
+ }
7
17
  var __defProp = Object.defineProperty;
8
18
  var __decorateClass = (decorators, target, key, kind) => {
9
19
  var result = void 0;
@@ -408,7 +418,7 @@ class OkDataTable extends LitElement {
408
418
  const head = cols.map((c) => this.csvEscape(c.key)).join(",");
409
419
  const lines = this.rows.map((r) => cols.map((c) => this.csvEscape(r[c.key])).join(","));
410
420
  const csv = [head, ...lines].join("\r\n");
411
- const blob = new Blob([csv], { type: "text/csv;charset=utf-8" });
421
+ const blob = new Blob([CSV_BOM + csv], { type: "text/csv;charset=utf-8" });
412
422
  const url = URL.createObjectURL(blob);
413
423
  const a = document.createElement("a");
414
424
  a.href = url;
@@ -456,7 +466,7 @@ class OkDataTable extends LitElement {
456
466
  const input = ev.target;
457
467
  const file = input.files?.[0];
458
468
  if (!file) return;
459
- const text = await file.text();
469
+ const text = decodeCsvBuffer(await file.arrayBuffer());
460
470
  const { headers, rows } = this.parseCsv(text);
461
471
  this.emit("csvImport", { headers, rows });
462
472
  this.emit("import", { headers, rows });
@@ -2,7 +2,7 @@ import { LitElement, css, nothing, html } from "lit";
2
2
  import { property, state } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
4
  import { c as computeAnchor } from "./shared/anchor.js";
5
- import { i as iconCalendarOutline, z as iconChevronBackOutline, q as iconChevronForwardOutline } from "./shared/icons.js";
5
+ import { N as iconCalendarOutline, t as iconChevronBackOutline, g as iconChevronForwardOutline } from "./shared/icons.js";
6
6
  var __defProp = Object.defineProperty;
7
7
  var __decorateClass = (decorators, target, key, kind) => {
8
8
  var result = void 0;
package/dist/ok-drawer.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, query } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { o as okIcon, B as iconCloseOutline } from "./shared/icons.js";
4
+ import { o as okIcon, v as iconCloseOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, state, query } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { D as iconCloudUploadOutline, E as iconAlertCircleOutline, F as iconDocumentOutline, B as iconCloseOutline } from "./shared/icons.js";
4
+ import { y as iconCloudUploadOutline, z as iconAlertCircleOutline, A as iconDocumentOutline, v as iconCloseOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, state, query } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { q as iconChevronForwardOutline, o as okIcon, T as iconFolderOpenOutline } from "./shared/icons.js";
4
+ import { g as iconChevronForwardOutline, o as okIcon, P as iconFolderOpenOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, state } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { r as iconInformationCircle, s as iconAlertCircle, t as iconWarning, u as iconCheckmarkCircle, o as okIcon, b as iconClose } from "./shared/icons.js";
4
+ import { h as iconInformationCircle, j as iconAlertCircle, k as iconWarning, l as iconCheckmarkCircle, o as okIcon, m as iconClose } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
package/dist/ok-kpi.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { v as iconTrendingUp, w as iconTrendingDown, x as iconRemove, o as okIcon } from "./shared/icons.js";
4
+ import { n as iconTrendingUp, p as iconTrendingDown, q as iconRemove, o as okIcon } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, render, nothing, html } from "lit";
2
2
  import { property, state } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { M as iconExpandOutline, B as iconCloseOutline, z as iconChevronBackOutline, q as iconChevronForwardOutline, I as iconDownloadOutline, S as iconPlayOutline } from "./shared/icons.js";
4
+ import { H as iconExpandOutline, v as iconCloseOutline, t as iconChevronBackOutline, g as iconChevronForwardOutline, D as iconDownloadOutline, O as iconPlayOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
package/dist/ok-mail.js CHANGED
@@ -2,7 +2,7 @@ import { LitElement, css, nothing, html } from "lit";
2
2
  import { property, state } from "lit/decorators.js";
3
3
  import { repeat } from "lit/directives/repeat.js";
4
4
  import { define } from "./define.js";
5
- import { j as iconCreateOutline, o as okIcon, c as iconChevronBack, k as iconArrowUndoOutline, l as iconArrowRedoOutline, m as iconArchiveOutline, n as iconTrashOutline, p as iconDocumentAttachOutline } from "./shared/icons.js";
5
+ import { i as iconCreateOutline, o as okIcon, a as iconChevronBack, b as iconArrowUndoOutline, c as iconArrowRedoOutline, d as iconArchiveOutline, e as iconTrashOutline, f as iconDocumentAttachOutline } from "./shared/icons.js";
6
6
  var __defProp = Object.defineProperty;
7
7
  var __decorateClass = (decorators, target, key, kind) => {
8
8
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, state } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { o as okIcon, q as iconChevronForwardOutline, H as iconMenuOutline } from "./shared/icons.js";
4
+ import { o as okIcon, g as iconChevronForwardOutline, C as iconMenuOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html, nothing } from "lit";
2
2
  import { property } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { o as okIcon, R as iconNotificationsOffOutline, B as iconCloseOutline } from "./shared/icons.js";
4
+ import { o as okIcon, M as iconNotificationsOffOutline, v as iconCloseOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
package/dist/ok-pdf.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { N as iconOpenOutline, O as iconDocumentTextOutline, I as iconDownloadOutline } from "./shared/icons.js";
4
+ import { I as iconOpenOutline, J as iconDocumentTextOutline, D as iconDownloadOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
package/dist/ok-pinpad.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { C as iconBackspaceOutline, o as okIcon } from "./shared/icons.js";
4
+ import { x as iconBackspaceOutline, o as okIcon } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { x as iconRemove, P as iconAdd } from "./shared/icons.js";
4
+ import { q as iconRemove, K as iconAdd } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, state } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { z as iconChevronBackOutline, q as iconChevronForwardOutline } from "./shared/icons.js";
4
+ import { t as iconChevronBackOutline, g as iconChevronForwardOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, query } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { n as iconTrashOutline, I as iconDownloadOutline } from "./shared/icons.js";
4
+ import { e as iconTrashOutline, D as iconDownloadOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, state } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { o as okIcon, h as iconChevronDownOutline } from "./shared/icons.js";
4
+ import { o as okIcon, w as iconChevronDownOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { y as iconCheckmarkOutline } from "./shared/icons.js";
4
+ import { r as iconCheckmarkOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -1,7 +1,7 @@
1
1
  import { LitElement, css, html } from "lit";
2
2
  import { property, state } from "lit/decorators.js";
3
3
  import { define } from "./define.js";
4
- import { B as iconCloseOutline } from "./shared/icons.js";
4
+ import { v as iconCloseOutline } from "./shared/icons.js";
5
5
  var __defProp = Object.defineProperty;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
7
7
  var result = void 0;
@@ -0,0 +1,221 @@
1
+ import { LitElement, css, nothing, 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_PALETTES = [
14
+ { id: "erplora", label: "ERPlora", brand: "#1496D6" },
15
+ { id: "terracotta", label: "Terracotta", brand: "#E8552A" },
16
+ { id: "corporate", label: "Corporate", brand: "#0F3F9C" },
17
+ { id: "minimal", label: "Minimal", brand: "#111111" },
18
+ { id: "forest", label: "Forest", brand: "#1F542A" },
19
+ { id: "ocean", label: "Ocean", brand: "#008CBD" },
20
+ { id: "violet", label: "Violet", brand: "#742AD9" }
21
+ ];
22
+ function applyPalette(root, palette) {
23
+ if (!palette || palette === "erplora") root.removeAttribute("data-ok-palette");
24
+ else root.setAttribute("data-ok-palette", palette);
25
+ }
26
+ const DEFAULT_LABELS = {
27
+ palette: "Theme palette",
28
+ mode: "Appearance",
29
+ system: "System",
30
+ light: "Light",
31
+ dark: "Dark"
32
+ };
33
+ class OkThemePicker extends LitElement {
34
+ constructor() {
35
+ super(...arguments);
36
+ this.palette = "erplora";
37
+ this.mode = "system";
38
+ this.hideMode = false;
39
+ this.palettes = DEFAULT_PALETTES;
40
+ this.labels = {};
41
+ }
42
+ static {
43
+ this.styles = css`
44
+ :host {
45
+ display: block;
46
+ width: 100%;
47
+ --text: var(--ok-text, var(--ion-text-color, #1a1c20));
48
+ --muted: var(--ok-muted, rgba(var(--ion-text-color-rgb, 26, 28, 32), 0.6));
49
+ --surface: var(--ok-surface, var(--ion-card-background, #fff));
50
+ --border: var(--ok-border, var(--ion-border-color, rgba(26, 28, 32, 0.14)));
51
+ --primary: var(--ok-primary, var(--ion-color-primary, #1496d6));
52
+ --radius: var(--ok-radius, 14px);
53
+ font-family: var(--ok-font, var(--ion-font-family, system-ui, sans-serif));
54
+ color: var(--text);
55
+ }
56
+ .head {
57
+ font-size: 0.8rem;
58
+ font-weight: 600;
59
+ color: var(--muted);
60
+ text-transform: uppercase;
61
+ letter-spacing: 0.04em;
62
+ margin: 0 0 0.6rem;
63
+ }
64
+ .section + .section { margin-top: 1.1rem; }
65
+
66
+ .palettes {
67
+ display: flex;
68
+ flex-wrap: wrap;
69
+ gap: 0.75rem;
70
+ }
71
+ .swatch {
72
+ display: flex;
73
+ flex-direction: column;
74
+ align-items: center;
75
+ gap: 0.35rem;
76
+ padding: 0.5rem 0.4rem 0.4rem;
77
+ min-width: 4.2rem;
78
+ background: transparent;
79
+ border: 1px solid transparent;
80
+ border-radius: var(--radius);
81
+ color: var(--muted);
82
+ font: inherit;
83
+ font-size: 0.75rem;
84
+ cursor: pointer;
85
+ transition: border-color var(--ok-transition, 150ms ease), background-color var(--ok-transition, 150ms ease);
86
+ }
87
+ @media (hover: hover) {
88
+ .swatch:hover { background: color-mix(in oklab, var(--text) 5%, transparent); }
89
+ }
90
+ .swatch[aria-pressed='true'] {
91
+ border-color: var(--primary);
92
+ color: var(--text);
93
+ font-weight: 600;
94
+ }
95
+ .dot {
96
+ width: 1.9rem;
97
+ height: 1.9rem;
98
+ border-radius: 50%;
99
+ border: 1px solid var(--border);
100
+ box-shadow: inset 0 0 0 2px var(--surface);
101
+ }
102
+ .swatch[aria-pressed='true'] .dot {
103
+ outline: 2px solid var(--primary);
104
+ outline-offset: 2px;
105
+ }
106
+
107
+ .modes {
108
+ display: inline-flex;
109
+ gap: 0;
110
+ border: 1px solid var(--border);
111
+ border-radius: var(--ok-radius-pill, 999px);
112
+ padding: 0.2rem;
113
+ background: color-mix(in oklab, var(--text) 4%, transparent);
114
+ }
115
+ .mode {
116
+ border: 0;
117
+ background: transparent;
118
+ color: var(--muted);
119
+ font: inherit;
120
+ font-size: 0.85rem;
121
+ padding: 0.35rem 0.9rem;
122
+ border-radius: var(--ok-radius-pill, 999px);
123
+ cursor: pointer;
124
+ transition: background-color var(--ok-transition, 150ms ease), color var(--ok-transition, 150ms ease);
125
+ }
126
+ .mode[aria-pressed='true'] {
127
+ background: var(--surface);
128
+ color: var(--text);
129
+ font-weight: 600;
130
+ box-shadow: var(--ok-shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.08));
131
+ }
132
+ `;
133
+ }
134
+ get t() {
135
+ return { ...DEFAULT_LABELS, ...this.labels };
136
+ }
137
+ emitChange() {
138
+ this.dispatchEvent(
139
+ new CustomEvent("ok-change", {
140
+ detail: { palette: this.palette, mode: this.mode },
141
+ bubbles: true,
142
+ composed: true
143
+ })
144
+ );
145
+ }
146
+ pickPalette(id) {
147
+ if (id === this.palette) return;
148
+ this.palette = id;
149
+ this.emitChange();
150
+ }
151
+ pickMode(mode) {
152
+ if (mode === this.mode) return;
153
+ this.mode = mode;
154
+ this.emitChange();
155
+ }
156
+ render() {
157
+ const modes = ["system", "light", "dark"];
158
+ return html`
159
+ <div class="section">
160
+ <p class="head">${this.t.palette}</p>
161
+ <div class="palettes" role="group" aria-label=${this.t.palette}>
162
+ ${this.palettes.map(
163
+ (p) => html`
164
+ <button
165
+ class="swatch"
166
+ type="button"
167
+ aria-label=${p.label}
168
+ aria-pressed=${this.palette === p.id ? "true" : "false"}
169
+ @click=${() => this.pickPalette(p.id)}
170
+ >
171
+ <span class="dot" style="background:${p.brand}"></span>
172
+ <span>${p.label}</span>
173
+ </button>
174
+ `
175
+ )}
176
+ </div>
177
+ </div>
178
+ ${this.hideMode ? nothing : html`
179
+ <div class="section">
180
+ <p class="head">${this.t.mode}</p>
181
+ <div class="modes" role="group" aria-label=${this.t.mode}>
182
+ ${modes.map(
183
+ (m) => html`
184
+ <button
185
+ class="mode"
186
+ type="button"
187
+ data-mode=${m}
188
+ aria-pressed=${this.mode === m ? "true" : "false"}
189
+ @click=${() => this.pickMode(m)}
190
+ >
191
+ ${this.t[m]}
192
+ </button>
193
+ `
194
+ )}
195
+ </div>
196
+ </div>
197
+ `}
198
+ `;
199
+ }
200
+ }
201
+ __decorateClass([
202
+ property()
203
+ ], OkThemePicker.prototype, "palette");
204
+ __decorateClass([
205
+ property()
206
+ ], OkThemePicker.prototype, "mode");
207
+ __decorateClass([
208
+ property({ type: Boolean, attribute: "hide-mode" })
209
+ ], OkThemePicker.prototype, "hideMode");
210
+ __decorateClass([
211
+ property({ attribute: false })
212
+ ], OkThemePicker.prototype, "palettes");
213
+ __decorateClass([
214
+ property({ attribute: false })
215
+ ], OkThemePicker.prototype, "labels");
216
+ define("ok-theme-picker", OkThemePicker);
217
+ export {
218
+ DEFAULT_PALETTES,
219
+ OkThemePicker,
220
+ applyPalette
221
+ };