reke-ui 0.1.0 → 0.1.2

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 (57) hide show
  1. package/README.md +2 -0
  2. package/custom-elements.json +216 -116
  3. package/dist/components/reke-alert/reke-alert.js +53 -0
  4. package/dist/components/reke-alert/reke-alert.styles.d.ts.map +1 -1
  5. package/dist/components/reke-alert/reke-alert.styles.js +106 -0
  6. package/dist/components/reke-badge/reke-badge.d.ts +4 -2
  7. package/dist/components/reke-badge/reke-badge.d.ts.map +1 -1
  8. package/dist/components/reke-badge/reke-badge.js +44 -0
  9. package/dist/components/reke-badge/reke-badge.styles.d.ts.map +1 -1
  10. package/dist/components/reke-badge/reke-badge.styles.js +95 -0
  11. package/dist/components/reke-button/reke-button.js +64 -0
  12. package/dist/components/reke-button/reke-button.styles.d.ts.map +1 -1
  13. package/dist/components/reke-button/reke-button.styles.js +229 -0
  14. package/dist/components/reke-card/reke-card.d.ts +7 -0
  15. package/dist/components/reke-card/reke-card.d.ts.map +1 -1
  16. package/dist/components/reke-card/reke-card.js +70 -0
  17. package/dist/components/reke-card/reke-card.styles.d.ts.map +1 -1
  18. package/dist/components/reke-card/reke-card.styles.js +150 -0
  19. package/dist/components/reke-checkbox/reke-checkbox.js +64 -0
  20. package/dist/components/reke-checkbox/reke-checkbox.styles.js +81 -0
  21. package/dist/components/reke-chip/reke-chip.js +70 -0
  22. package/dist/components/reke-chip/reke-chip.styles.d.ts.map +1 -1
  23. package/dist/components/reke-chip/reke-chip.styles.js +125 -0
  24. package/dist/components/reke-date-range/reke-date-range.js +346 -0
  25. package/dist/components/reke-date-range/reke-date-range.styles.js +322 -0
  26. package/dist/components/reke-dialog/reke-dialog.js +90 -0
  27. package/dist/components/reke-dialog/reke-dialog.styles.js +134 -0
  28. package/dist/components/reke-file-upload/reke-file-upload.js +108 -0
  29. package/dist/components/reke-file-upload/reke-file-upload.styles.js +107 -0
  30. package/dist/components/reke-input/reke-input.js +73 -0
  31. package/dist/components/reke-input/reke-input.styles.js +80 -0
  32. package/dist/components/reke-select/reke-select.js +112 -0
  33. package/dist/components/reke-select/reke-select.styles.js +122 -0
  34. package/dist/components/reke-table/reke-table.d.ts +21 -1
  35. package/dist/components/reke-table/reke-table.d.ts.map +1 -1
  36. package/dist/components/reke-table/reke-table.js +191 -0
  37. package/dist/components/reke-table/reke-table.styles.js +207 -0
  38. package/dist/components/reke-textarea/reke-textarea.js +73 -0
  39. package/dist/components/reke-textarea/reke-textarea.styles.js +76 -0
  40. package/dist/components/reke-toast/reke-toast.js +92 -0
  41. package/dist/components/reke-toast/reke-toast.styles.d.ts.map +1 -1
  42. package/dist/components/reke-toast/reke-toast.styles.js +182 -0
  43. package/dist/components/reke-toggle/reke-toggle.js +57 -0
  44. package/dist/components/reke-toggle/reke-toggle.styles.js +71 -0
  45. package/dist/components/reke-tooltip/reke-tooltip.js +67 -0
  46. package/dist/components/reke-tooltip/reke-tooltip.styles.js +67 -0
  47. package/dist/index.d.ts +2 -2
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +36 -0
  50. package/dist/react.js +79 -64
  51. package/dist/shared/base-element.js +16 -0
  52. package/dist/shared/tailwind-styles.js +6 -0
  53. package/dist/shared/tailwind.css.js +4 -0
  54. package/dist/tokens/reke-tokens.css +23 -0
  55. package/package.json +6 -4
  56. package/dist/reke-chip-Xb0Y_Cqo.js +0 -3358
  57. package/dist/reke-ui.js +0 -20
@@ -1,3358 +0,0 @@
1
- import { LitElement as re, unsafeCSS as te, css as u, nothing as c, html as l } from "lit";
2
- import { property as i, customElement as b, state as k, query as oe } from "lit/decorators.js";
3
- import { classMap as p } from "lit/directives/class-map.js";
4
- class g extends re {
5
- emit(r, a) {
6
- return this.dispatchEvent(
7
- new CustomEvent(r, {
8
- bubbles: !0,
9
- composed: !0,
10
- cancelable: !0,
11
- detail: a
12
- })
13
- );
14
- }
15
- }
16
- const ae = '@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--spacing:.25rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.static{position:static}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.flex-shrink{flex-shrink:1}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.border{border-style:var(--tw-border-style);border-width:1px}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}', f = te(ae), ie = [
17
- f,
18
- u`
19
- :host {
20
- display: inline-block;
21
- }
22
-
23
- :host([disabled]) {
24
- pointer-events: none;
25
- opacity: 0.5;
26
- }
27
-
28
- .button {
29
- display: inline-flex;
30
- align-items: center;
31
- justify-content: center;
32
- gap: var(--reke-space-xs, 8px);
33
- border: 1px solid transparent;
34
- border-radius: var(--reke-radius, 4px);
35
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
36
- font-weight: var(--reke-font-weight-medium, 500);
37
- cursor: pointer;
38
- transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
39
- text-decoration: none;
40
- line-height: 1;
41
- white-space: nowrap;
42
- box-sizing: border-box;
43
- }
44
-
45
- .button:focus-visible {
46
- outline: 2px solid var(--reke-color-primary, #22C55E);
47
- outline-offset: 2px;
48
- }
49
-
50
- /* === Sizes === */
51
-
52
- .button--xs {
53
- padding: var(--reke-space-2xs, 6px) var(--reke-space-xs, 8px);
54
- font-size: var(--reke-font-size-2xs, 11px);
55
- }
56
-
57
- .button--sm {
58
- padding: var(--reke-space-xs, 8px) var(--reke-space-md, 16px);
59
- font-size: var(--reke-font-size-xs, 12px);
60
- }
61
-
62
- .button--md {
63
- padding: var(--reke-space-sm, 12px) var(--reke-space-xl, 24px);
64
- font-size: var(--reke-font-size-sm, 13px);
65
- }
66
-
67
- .button--lg {
68
- padding: var(--reke-space-md, 16px) var(--reke-space-2xl, 28px);
69
- font-size: var(--reke-font-size-md, 14px);
70
- }
71
-
72
- /* === Variants === */
73
-
74
- .button--primary {
75
- background-color: var(--reke-color-primary, #22C55E);
76
- color: var(--reke-color-on-primary, #0A0A0B);
77
- border-color: var(--reke-color-primary, #22C55E);
78
- }
79
-
80
- .button--primary:hover {
81
- background-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 85%, black);
82
- }
83
-
84
- .button--secondary {
85
- background-color: var(--reke-color-surface, #1A1A1A);
86
- color: var(--reke-color-text, #E5E5E5);
87
- border-color: var(--reke-color-border, #252525);
88
- }
89
-
90
- .button--secondary:hover {
91
- background-color: var(--reke-color-surface-elevated, #151515);
92
- border-color: var(--reke-color-text-muted, #525252);
93
- }
94
-
95
- .button--ghost {
96
- background-color: transparent;
97
- color: var(--reke-color-text-ghost, #737373);
98
- border-color: transparent;
99
- }
100
-
101
- .button--ghost:hover {
102
- background-color: var(--reke-color-surface, #1A1A1A);
103
- color: var(--reke-color-text, #E5E5E5);
104
- }
105
-
106
- .button--danger {
107
- background-color: var(--reke-color-danger, #EF4444);
108
- color: #FFFFFF;
109
- border-color: var(--reke-color-danger, #EF4444);
110
- }
111
-
112
- .button--danger:hover {
113
- background-color: color-mix(in srgb, var(--reke-color-danger, #EF4444) 85%, black);
114
- }
115
-
116
- .button--danger-outline {
117
- background-color: transparent;
118
- color: var(--reke-color-danger, #EF4444);
119
- border-color: var(--reke-color-danger, #EF4444);
120
- }
121
-
122
- .button--danger-outline:hover {
123
- background-color: var(--reke-color-danger, #EF4444);
124
- color: #FFFFFF;
125
- }
126
-
127
- .button--icon-only {
128
- background-color: var(--reke-color-surface, #1A1A1A);
129
- color: var(--reke-color-text, #E5E5E5);
130
- border-color: var(--reke-color-border, #252525);
131
- }
132
-
133
- .button--icon-only:hover {
134
- border-color: var(--reke-color-text-muted, #525252);
135
- }
136
-
137
- .button--icon-only.button--xs {
138
- padding: var(--reke-space-2xs, 6px);
139
- }
140
-
141
- .button--icon-only.button--sm {
142
- padding: var(--reke-space-xs, 8px);
143
- }
144
-
145
- .button--icon-only.button--md {
146
- padding: var(--reke-space-sm, 12px);
147
- }
148
-
149
- .button--icon-only.button--lg {
150
- padding: var(--reke-space-md, 16px);
151
- }
152
-
153
- /* === Loading === */
154
-
155
- .button--loading {
156
- position: relative;
157
- color: transparent !important;
158
- pointer-events: none;
159
- }
160
-
161
- .spinner {
162
- display: none;
163
- }
164
-
165
- .button--loading .spinner {
166
- display: block;
167
- position: absolute;
168
- width: 1em;
169
- height: 1em;
170
- border: 2px solid currentColor;
171
- border-right-color: transparent;
172
- border-radius: 50%;
173
- animation: spin 0.6s linear infinite;
174
- color: inherit;
175
- }
176
-
177
- .button--loading.button--primary .spinner {
178
- color: var(--reke-color-on-primary, #0A0A0B);
179
- }
180
-
181
- .button--loading.button--secondary .spinner,
182
- .button--loading.button--ghost .spinner,
183
- .button--loading.button--icon-only .spinner {
184
- color: var(--reke-color-text, #E5E5E5);
185
- }
186
-
187
- .button--loading.button--danger .spinner {
188
- color: #FFFFFF;
189
- }
190
-
191
- .button--loading.button--danger-outline .spinner {
192
- color: var(--reke-color-danger, #EF4444);
193
- }
194
-
195
- @keyframes spin {
196
- to {
197
- transform: rotate(360deg);
198
- }
199
- }
200
- `
201
- ];
202
- var se = Object.defineProperty, ne = Object.getOwnPropertyDescriptor, J = (e, r, a, o) => {
203
- for (var t = o > 1 ? void 0 : o ? ne(r, a) : r, s = e.length - 1, n; s >= 0; s--)
204
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
205
- return o && t && se(r, a, t), t;
206
- };
207
- let F = class extends g {
208
- constructor() {
209
- super(...arguments), this.variant = "primary", this.size = "md", this.disabled = !1, this.loading = !1;
210
- }
211
- handleClick(e) {
212
- if (this.disabled || this.loading) {
213
- e.preventDefault(), e.stopPropagation();
214
- return;
215
- }
216
- this.emit("reke-click");
217
- }
218
- render() {
219
- const e = {
220
- button: !0,
221
- [`button--${this.variant}`]: !0,
222
- [`button--${this.size}`]: !0,
223
- "button--loading": this.loading
224
- };
225
- return l`
226
- <button
227
- part="button"
228
- class=${p(e)}
229
- ?disabled=${this.disabled}
230
- aria-disabled=${this.disabled || this.loading}
231
- aria-busy=${this.loading}
232
- @click=${this.handleClick}
233
- >
234
- <span class="spinner" aria-hidden="true"></span>
235
- ${this.variant !== "icon-only" ? l`<slot name="prefix"></slot>` : c}
236
- <slot></slot>
237
- ${this.variant !== "icon-only" ? l`<slot name="suffix"></slot>` : c}
238
- </button>
239
- `;
240
- }
241
- };
242
- F.styles = ie;
243
- J([
244
- i({ reflect: !0 })
245
- ], F.prototype, "variant", 2);
246
- J([
247
- i({ reflect: !0 })
248
- ], F.prototype, "size", 2);
249
- J([
250
- i({ type: Boolean, reflect: !0 })
251
- ], F.prototype, "disabled", 2);
252
- J([
253
- i({ type: Boolean, reflect: !0 })
254
- ], F.prototype, "loading", 2);
255
- F = J([
256
- b("reke-button")
257
- ], F);
258
- const le = [
259
- f,
260
- u`
261
- :host {
262
- display: inline-block;
263
- }
264
-
265
- :host([disabled]) {
266
- pointer-events: none;
267
- opacity: 0.5;
268
- }
269
-
270
- .label {
271
- display: block;
272
- margin-bottom: var(--reke-space-2xs, 6px);
273
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
274
- font-size: var(--reke-font-size-xs, 12px);
275
- color: var(--reke-color-text-label, #8A8A8A);
276
- }
277
-
278
- .input {
279
- display: block;
280
- width: 100%;
281
- background-color: var(--reke-color-surface, #1A1A1A);
282
- color: var(--reke-color-text, #E5E5E5);
283
- border: 1px solid var(--reke-color-border, #252525);
284
- border-radius: var(--reke-radius, 4px);
285
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
286
- box-sizing: border-box;
287
- outline: none;
288
- transition: border-color 0.15s ease;
289
- }
290
-
291
- .input::placeholder {
292
- color: var(--reke-color-text-muted, #525252);
293
- }
294
-
295
- .input:focus-visible {
296
- border-color: var(--reke-color-primary, #22C55E);
297
- outline: 2px solid var(--reke-color-primary, #22C55E);
298
- outline-offset: -1px;
299
- }
300
-
301
- .input--error {
302
- border-color: var(--reke-color-danger, #EF4444);
303
- }
304
-
305
- .input--error:focus-visible {
306
- border-color: var(--reke-color-danger, #EF4444);
307
- outline-color: var(--reke-color-danger, #EF4444);
308
- }
309
-
310
- /* === Sizes === */
311
-
312
- .input--xs {
313
- padding: var(--reke-space-2xs, 6px) var(--reke-space-xs, 8px);
314
- font-size: var(--reke-font-size-2xs, 11px);
315
- }
316
-
317
- .input--sm {
318
- padding: var(--reke-space-xs, 8px) var(--reke-space-sm, 12px);
319
- font-size: var(--reke-font-size-xs, 12px);
320
- }
321
-
322
- .input--md {
323
- padding: var(--reke-space-sm, 12px) var(--reke-space-md, 16px);
324
- font-size: var(--reke-font-size-sm, 13px);
325
- }
326
-
327
- .input--lg {
328
- padding: var(--reke-space-md, 16px) var(--reke-space-lg, 20px);
329
- font-size: var(--reke-font-size-md, 14px);
330
- }
331
- `
332
- ];
333
- var ce = Object.defineProperty, de = Object.getOwnPropertyDescriptor, z = (e, r, a, o) => {
334
- for (var t = o > 1 ? void 0 : o ? de(r, a) : r, s = e.length - 1, n; s >= 0; s--)
335
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
336
- return o && t && ce(r, a, t), t;
337
- };
338
- let _ = class extends g {
339
- constructor() {
340
- super(...arguments), this.value = "", this.placeholder = "", this.type = "text", this.size = "md", this.disabled = !1, this.error = !1, this.label = "";
341
- }
342
- handleInput(e) {
343
- const r = e.target;
344
- this.value = r.value, this.emit("reke-input", { value: this.value });
345
- }
346
- handleChange() {
347
- this.emit("reke-change", { value: this.value });
348
- }
349
- render() {
350
- const e = {
351
- input: !0,
352
- [`input--${this.size}`]: !0,
353
- "input--error": this.error
354
- };
355
- return l`
356
- ${this.label ? l`<label class="label">${this.label}</label>` : c}
357
- <input
358
- part="input"
359
- class=${p(e)}
360
- type=${this.type}
361
- .value=${this.value}
362
- placeholder=${this.placeholder || c}
363
- ?disabled=${this.disabled}
364
- aria-disabled=${this.disabled}
365
- aria-invalid=${this.error}
366
- aria-label=${this.label || c}
367
- @input=${this.handleInput}
368
- @change=${this.handleChange}
369
- />
370
- `;
371
- }
372
- };
373
- _.styles = le;
374
- z([
375
- i()
376
- ], _.prototype, "value", 2);
377
- z([
378
- i()
379
- ], _.prototype, "placeholder", 2);
380
- z([
381
- i()
382
- ], _.prototype, "type", 2);
383
- z([
384
- i({ reflect: !0 })
385
- ], _.prototype, "size", 2);
386
- z([
387
- i({ type: Boolean, reflect: !0 })
388
- ], _.prototype, "disabled", 2);
389
- z([
390
- i({ type: Boolean, reflect: !0 })
391
- ], _.prototype, "error", 2);
392
- z([
393
- i()
394
- ], _.prototype, "label", 2);
395
- _ = z([
396
- b("reke-input")
397
- ], _);
398
- const pe = [
399
- f,
400
- u`
401
- :host {
402
- display: inline-block;
403
- }
404
-
405
- :host([disabled]) {
406
- pointer-events: none;
407
- opacity: 0.5;
408
- }
409
-
410
- .label {
411
- display: block;
412
- margin-bottom: var(--reke-space-2xs, 6px);
413
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
414
- font-size: var(--reke-font-size-xs, 12px);
415
- color: var(--reke-color-text-label, #8A8A8A);
416
- }
417
-
418
- .textarea {
419
- display: block;
420
- width: 100%;
421
- background-color: var(--reke-color-surface, #1A1A1A);
422
- color: var(--reke-color-text, #E5E5E5);
423
- border: 1px solid var(--reke-color-border, #252525);
424
- border-radius: var(--reke-radius, 4px);
425
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
426
- box-sizing: border-box;
427
- outline: none;
428
- transition: border-color 0.15s ease;
429
- resize: vertical;
430
- }
431
-
432
- .textarea::placeholder {
433
- color: var(--reke-color-text-muted, #525252);
434
- }
435
-
436
- .textarea:focus-visible {
437
- border-color: var(--reke-color-primary, #22C55E);
438
- outline: 2px solid var(--reke-color-primary, #22C55E);
439
- outline-offset: -1px;
440
- }
441
-
442
- .textarea--error {
443
- border-color: var(--reke-color-danger, #EF4444);
444
- }
445
-
446
- .textarea--error:focus-visible {
447
- border-color: var(--reke-color-danger, #EF4444);
448
- outline-color: var(--reke-color-danger, #EF4444);
449
- }
450
-
451
- /* === Sizes === */
452
-
453
- .textarea--sm {
454
- padding: var(--reke-space-xs, 8px) var(--reke-space-sm, 12px);
455
- font-size: var(--reke-font-size-xs, 12px);
456
- }
457
-
458
- .textarea--md {
459
- padding: var(--reke-space-sm, 12px) var(--reke-space-md, 16px);
460
- font-size: var(--reke-font-size-sm, 13px);
461
- }
462
-
463
- .textarea--lg {
464
- padding: var(--reke-space-md, 16px) var(--reke-space-lg, 20px);
465
- font-size: var(--reke-font-size-md, 14px);
466
- }
467
- `
468
- ];
469
- var he = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, D = (e, r, a, o) => {
470
- for (var t = o > 1 ? void 0 : o ? ue(r, a) : r, s = e.length - 1, n; s >= 0; s--)
471
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
472
- return o && t && he(r, a, t), t;
473
- };
474
- let $ = class extends g {
475
- constructor() {
476
- super(...arguments), this.value = "", this.placeholder = "", this.rows = 4, this.size = "md", this.disabled = !1, this.error = !1, this.label = "";
477
- }
478
- handleInput(e) {
479
- const r = e.target;
480
- this.value = r.value, this.emit("reke-input", { value: this.value });
481
- }
482
- handleChange() {
483
- this.emit("reke-change", { value: this.value });
484
- }
485
- render() {
486
- const e = {
487
- textarea: !0,
488
- [`textarea--${this.size}`]: !0,
489
- "textarea--error": this.error
490
- };
491
- return l`
492
- ${this.label ? l`<label class="label">${this.label}</label>` : c}
493
- <textarea
494
- part="textarea"
495
- class=${p(e)}
496
- .value=${this.value}
497
- placeholder=${this.placeholder || c}
498
- rows=${this.rows}
499
- ?disabled=${this.disabled}
500
- aria-disabled=${this.disabled}
501
- aria-invalid=${this.error}
502
- aria-label=${this.label || c}
503
- @input=${this.handleInput}
504
- @change=${this.handleChange}
505
- ></textarea>
506
- `;
507
- }
508
- };
509
- $.styles = pe;
510
- D([
511
- i()
512
- ], $.prototype, "value", 2);
513
- D([
514
- i()
515
- ], $.prototype, "placeholder", 2);
516
- D([
517
- i({ type: Number })
518
- ], $.prototype, "rows", 2);
519
- D([
520
- i({ reflect: !0 })
521
- ], $.prototype, "size", 2);
522
- D([
523
- i({ type: Boolean, reflect: !0 })
524
- ], $.prototype, "disabled", 2);
525
- D([
526
- i({ type: Boolean, reflect: !0 })
527
- ], $.prototype, "error", 2);
528
- D([
529
- i()
530
- ], $.prototype, "label", 2);
531
- $ = D([
532
- b("reke-textarea")
533
- ], $);
534
- const be = [
535
- f,
536
- u`
537
- :host {
538
- display: inline-flex;
539
- align-items: center;
540
- gap: 8px;
541
- cursor: pointer;
542
- }
543
-
544
- :host([disabled]) {
545
- pointer-events: none;
546
- opacity: 0.5;
547
- }
548
-
549
- .container {
550
- display: inline-flex;
551
- align-items: center;
552
- gap: 8px;
553
- cursor: pointer;
554
- outline: none;
555
- }
556
-
557
- .native-input {
558
- position: absolute;
559
- width: 1px;
560
- height: 1px;
561
- margin: -1px;
562
- padding: 0;
563
- overflow: hidden;
564
- clip: rect(0, 0, 0, 0);
565
- white-space: nowrap;
566
- border: 0;
567
- }
568
-
569
- .box {
570
- display: inline-flex;
571
- align-items: center;
572
- justify-content: center;
573
- width: 16px;
574
- height: 16px;
575
- min-width: 16px;
576
- min-height: 16px;
577
- background-color: var(--reke-color-surface, #1A1A1A);
578
- border: 1px solid var(--reke-color-border, #252525);
579
- border-radius: 3px;
580
- box-sizing: border-box;
581
- transition: background-color 0.15s ease, border-color 0.15s ease;
582
- }
583
-
584
- .box--checked,
585
- .box--indeterminate {
586
- background-color: var(--reke-color-primary, #22C55E);
587
- border-color: var(--reke-color-primary, #22C55E);
588
- }
589
-
590
- .container:focus-visible .box {
591
- outline: 2px solid var(--reke-color-primary, #22C55E);
592
- outline-offset: 2px;
593
- }
594
-
595
- .checkmark,
596
- .indeterminate-mark {
597
- width: 12px;
598
- height: 12px;
599
- color: var(--reke-color-on-primary, #0A0A0B);
600
- }
601
-
602
- .label {
603
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
604
- font-size: var(--reke-font-size-sm, 13px);
605
- color: var(--reke-color-text, #E5E5E5);
606
- user-select: none;
607
- }
608
- `
609
- ];
610
- var ge = Object.defineProperty, fe = Object.getOwnPropertyDescriptor, N = (e, r, a, o) => {
611
- for (var t = o > 1 ? void 0 : o ? fe(r, a) : r, s = e.length - 1, n; s >= 0; s--)
612
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
613
- return o && t && ge(r, a, t), t;
614
- };
615
- let A = class extends g {
616
- constructor() {
617
- super(...arguments), this.checked = !1, this.indeterminate = !1, this.disabled = !1, this.label = "";
618
- }
619
- handleClick() {
620
- this.disabled || (this.checked = !this.checked, this.indeterminate = !1, this.emit("reke-change", { checked: this.checked }));
621
- }
622
- handleKeyDown(e) {
623
- (e.key === " " || e.key === "Enter") && (e.preventDefault(), this.handleClick());
624
- }
625
- render() {
626
- const e = this.indeterminate ? "mixed" : String(this.checked);
627
- return l`
628
- <div
629
- part="container"
630
- class="container"
631
- role="checkbox"
632
- tabindex=${this.disabled ? "-1" : "0"}
633
- aria-checked=${e}
634
- aria-disabled=${this.disabled}
635
- @click=${this.handleClick}
636
- @keydown=${this.handleKeyDown}
637
- >
638
- <span part="box" class="box ${this.checked ? "box--checked" : ""} ${this.indeterminate ? "box--indeterminate" : ""}">
639
- ${this.checked ? l`<svg class="checkmark" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
640
- <path d="M2.5 6L5 8.5L9.5 3.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
641
- </svg>` : c}
642
- ${this.indeterminate && !this.checked ? l`<svg class="indeterminate-mark" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
643
- <path d="M3 6H9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
644
- </svg>` : c}
645
- </span>
646
- ${this.label ? l`<span part="label" class="label">${this.label}</span>` : c}
647
- </div>
648
- `;
649
- }
650
- };
651
- A.styles = be;
652
- N([
653
- i({ type: Boolean, reflect: !0 })
654
- ], A.prototype, "checked", 2);
655
- N([
656
- i({ type: Boolean, reflect: !0 })
657
- ], A.prototype, "indeterminate", 2);
658
- N([
659
- i({ type: Boolean, reflect: !0 })
660
- ], A.prototype, "disabled", 2);
661
- N([
662
- i()
663
- ], A.prototype, "label", 2);
664
- A = N([
665
- b("reke-checkbox")
666
- ], A);
667
- const ve = [
668
- f,
669
- u`
670
- :host {
671
- display: inline-flex;
672
- align-items: center;
673
- gap: 8px;
674
- cursor: pointer;
675
- }
676
-
677
- :host([disabled]) {
678
- pointer-events: none;
679
- opacity: 0.5;
680
- }
681
-
682
- .toggle {
683
- display: inline-flex;
684
- align-items: center;
685
- gap: 8px;
686
- }
687
-
688
- .toggle:focus-visible .track {
689
- outline: 2px solid var(--reke-color-primary, #22C55E);
690
- outline-offset: 2px;
691
- }
692
-
693
- .track {
694
- position: relative;
695
- width: 40px;
696
- height: 22px;
697
- border-radius: 11px;
698
- background-color: var(--reke-color-surface, #1A1A1A);
699
- border: 1px solid var(--reke-color-border, #252525);
700
- box-sizing: border-box;
701
- transition: background-color 0.15s ease, border-color 0.15s ease;
702
- }
703
-
704
- .track--checked {
705
- background-color: var(--reke-color-primary, #22C55E);
706
- border-color: var(--reke-color-primary, #22C55E);
707
- }
708
-
709
- .thumb {
710
- position: absolute;
711
- top: 50%;
712
- left: 2px;
713
- width: 16px;
714
- height: 16px;
715
- border-radius: 50%;
716
- background-color: var(--reke-color-text-muted, #525252);
717
- transform: translateY(-50%);
718
- transition: transform 0.15s ease, background-color 0.15s ease;
719
- }
720
-
721
- .thumb--checked {
722
- background-color: var(--reke-color-on-primary, #0A0A0B);
723
- transform: translateX(18px) translateY(-50%);
724
- }
725
-
726
- .label {
727
- color: var(--reke-color-text, #E5E5E5);
728
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
729
- font-size: var(--reke-font-size-sm, 13px);
730
- }
731
- `
732
- ];
733
- var me = Object.defineProperty, xe = Object.getOwnPropertyDescriptor, W = (e, r, a, o) => {
734
- for (var t = o > 1 ? void 0 : o ? xe(r, a) : r, s = e.length - 1, n; s >= 0; s--)
735
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
736
- return o && t && me(r, a, t), t;
737
- };
738
- let T = class extends g {
739
- constructor() {
740
- super(...arguments), this.checked = !1, this.disabled = !1, this.label = "";
741
- }
742
- toggle() {
743
- this.disabled || (this.checked = !this.checked, this.emit("reke-change", { checked: this.checked }));
744
- }
745
- handleClick() {
746
- this.toggle();
747
- }
748
- handleKeyDown(e) {
749
- (e.key === " " || e.key === "Enter") && (e.preventDefault(), this.toggle());
750
- }
751
- render() {
752
- return l`
753
- <div
754
- class="toggle"
755
- role="switch"
756
- aria-checked=${this.checked}
757
- aria-label=${this.label || c}
758
- tabindex=${this.disabled ? -1 : 0}
759
- @click=${this.handleClick}
760
- @keydown=${this.handleKeyDown}
761
- >
762
- <div part="track" class="track ${this.checked ? "track--checked" : ""}">
763
- <div part="thumb" class="thumb ${this.checked ? "thumb--checked" : ""}"></div>
764
- </div>
765
- ${this.label ? l`<span class="label">${this.label}</span>` : c}
766
- </div>
767
- `;
768
- }
769
- };
770
- T.styles = ve;
771
- W([
772
- i({ type: Boolean, reflect: !0 })
773
- ], T.prototype, "checked", 2);
774
- W([
775
- i({ type: Boolean, reflect: !0 })
776
- ], T.prototype, "disabled", 2);
777
- W([
778
- i()
779
- ], T.prototype, "label", 2);
780
- T = W([
781
- b("reke-toggle")
782
- ], T);
783
- const ye = [
784
- f,
785
- u`
786
- :host {
787
- display: inline-block;
788
- }
789
-
790
- .badge {
791
- display: inline-flex;
792
- align-items: center;
793
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
794
- font-weight: var(--reke-font-weight-medium, 500);
795
- border-radius: 9999px;
796
- border: 1px solid transparent;
797
- line-height: 1;
798
- white-space: nowrap;
799
- box-sizing: border-box;
800
- }
801
-
802
- /* === Sizes === */
803
-
804
- .badge--sm {
805
- padding: 2px 8px;
806
- font-size: 11px;
807
- }
808
-
809
- .badge--md {
810
- padding: 4px 12px;
811
- font-size: 12px;
812
- }
813
-
814
- /* === Variants === */
815
-
816
- .badge--default {
817
- background-color: var(--reke-color-surface, #1A1A1A);
818
- color: var(--reke-color-text, #E5E5E5);
819
- border-color: var(--reke-color-border, #252525);
820
- }
821
-
822
- .badge--primary {
823
- background-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 15%, transparent);
824
- color: var(--reke-color-primary, #22C55E);
825
- border-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 30%, transparent);
826
- }
827
-
828
- .badge--secondary {
829
- background-color: color-mix(in srgb, var(--reke-color-secondary, #3B82F6) 15%, transparent);
830
- color: var(--reke-color-secondary, #3B82F6);
831
- border-color: color-mix(in srgb, var(--reke-color-secondary, #3B82F6) 30%, transparent);
832
- }
833
-
834
- .badge--danger {
835
- background-color: color-mix(in srgb, var(--reke-color-danger, #EF4444) 15%, transparent);
836
- color: var(--reke-color-danger, #EF4444);
837
- border-color: color-mix(in srgb, var(--reke-color-danger, #EF4444) 30%, transparent);
838
- }
839
-
840
- .badge--warning {
841
- background-color: color-mix(in srgb, var(--reke-color-warning, #F59E0B) 15%, transparent);
842
- color: var(--reke-color-warning, #F59E0B);
843
- border-color: color-mix(in srgb, var(--reke-color-warning, #F59E0B) 30%, transparent);
844
- }
845
-
846
- .badge--success {
847
- background-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 15%, transparent);
848
- color: var(--reke-color-primary, #22C55E);
849
- border-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 30%, transparent);
850
- }
851
- `
852
- ];
853
- var ke = Object.defineProperty, we = Object.getOwnPropertyDescriptor, G = (e, r, a, o) => {
854
- for (var t = o > 1 ? void 0 : o ? we(r, a) : r, s = e.length - 1, n; s >= 0; s--)
855
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
856
- return o && t && ke(r, a, t), t;
857
- };
858
- let L = class extends g {
859
- constructor() {
860
- super(...arguments), this.variant = "default", this.size = "md";
861
- }
862
- render() {
863
- const e = {
864
- badge: !0,
865
- [`badge--${this.variant}`]: !0,
866
- [`badge--${this.size}`]: !0
867
- };
868
- return l`
869
- <span part="badge" class=${p(e)}>
870
- <slot></slot>
871
- </span>
872
- `;
873
- }
874
- };
875
- L.styles = ye;
876
- G([
877
- i({ reflect: !0 })
878
- ], L.prototype, "variant", 2);
879
- G([
880
- i({ reflect: !0 })
881
- ], L.prototype, "size", 2);
882
- L = G([
883
- b("reke-badge")
884
- ], L);
885
- const _e = [
886
- f,
887
- u`
888
- :host {
889
- display: block;
890
- }
891
-
892
- .card {
893
- border-radius: var(--reke-radius, 4px);
894
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
895
- overflow: hidden;
896
- }
897
-
898
- /* === Variants === */
899
-
900
- .card--default {
901
- background: var(--reke-color-surface, #1A1A1A);
902
- border: 1px solid var(--reke-color-border, #252525);
903
- }
904
-
905
- .card--elevated {
906
- background: var(--reke-color-surface, #1A1A1A);
907
- border: 1px solid var(--reke-color-border, #252525);
908
- box-shadow: var(--reke-shadow-md, 0 4px 6px rgba(0, 0, 0, 0.3));
909
- }
910
-
911
- .card--outlined {
912
- background: transparent;
913
- border: 1px solid var(--reke-color-border, #252525);
914
- }
915
-
916
- /* === Padding (applied to .card-body) === */
917
-
918
- .card--padding-none .card-body {
919
- padding: 0;
920
- }
921
-
922
- .card--padding-sm .card-body {
923
- padding: 12px;
924
- }
925
-
926
- .card--padding-md .card-body {
927
- padding: 16px;
928
- }
929
-
930
- .card--padding-lg .card-body {
931
- padding: 24px;
932
- }
933
-
934
- /* === Header === */
935
-
936
- .card-header {
937
- border-bottom: 1px solid var(--reke-color-border, #252525);
938
- }
939
-
940
- .card--padding-none .card-header {
941
- padding: 0;
942
- }
943
-
944
- .card--padding-sm .card-header {
945
- padding: 12px;
946
- }
947
-
948
- .card--padding-md .card-header {
949
- padding: 16px;
950
- }
951
-
952
- .card--padding-lg .card-header {
953
- padding: 24px;
954
- }
955
-
956
- /* === Footer === */
957
-
958
- .card-footer {
959
- border-top: 1px solid var(--reke-color-border, #252525);
960
- }
961
-
962
- .card--padding-none .card-footer {
963
- padding: 0;
964
- }
965
-
966
- .card--padding-sm .card-footer {
967
- padding: 12px;
968
- }
969
-
970
- .card--padding-md .card-footer {
971
- padding: 16px;
972
- }
973
-
974
- .card--padding-lg .card-footer {
975
- padding: 24px;
976
- }
977
- `
978
- ];
979
- var $e = Object.defineProperty, Ce = Object.getOwnPropertyDescriptor, K = (e, r, a, o) => {
980
- for (var t = o > 1 ? void 0 : o ? Ce(r, a) : r, s = e.length - 1, n; s >= 0; s--)
981
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
982
- return o && t && $e(r, a, t), t;
983
- };
984
- let O = class extends g {
985
- constructor() {
986
- super(...arguments), this.variant = "default", this.padding = "md", this._hasHeader = !1, this._hasFooter = !1;
987
- }
988
- _onSlotChange(e, r) {
989
- const o = r.target.assignedNodes({ flatten: !0 }).length > 0;
990
- e === "header" ? this._hasHeader = o : this._hasFooter = o;
991
- }
992
- render() {
993
- const e = {
994
- card: !0,
995
- [`card--${this.variant}`]: !0,
996
- [`card--padding-${this.padding}`]: !0
997
- };
998
- return l`
999
- <div class=${p(e)}>
1000
- ${this._hasHeader ? l`
1001
- <div class="card-header">
1002
- <slot name="header" @slotchange=${(r) => this._onSlotChange("header", r)}></slot>
1003
- </div>
1004
- ` : l`<slot name="header" @slotchange=${(r) => this._onSlotChange("header", r)} style="display:none"></slot>`}
1005
- <div class="card-body">
1006
- <slot></slot>
1007
- </div>
1008
- ${this._hasFooter ? l`
1009
- <div class="card-footer">
1010
- <slot name="footer" @slotchange=${(r) => this._onSlotChange("footer", r)}></slot>
1011
- </div>
1012
- ` : l`<slot name="footer" @slotchange=${(r) => this._onSlotChange("footer", r)} style="display:none"></slot>`}
1013
- </div>
1014
- `;
1015
- }
1016
- };
1017
- O.styles = _e;
1018
- K([
1019
- i({ reflect: !0 })
1020
- ], O.prototype, "variant", 2);
1021
- K([
1022
- i({ reflect: !0 })
1023
- ], O.prototype, "padding", 2);
1024
- K([
1025
- k()
1026
- ], O.prototype, "_hasHeader", 2);
1027
- K([
1028
- k()
1029
- ], O.prototype, "_hasFooter", 2);
1030
- O = K([
1031
- b("reke-card")
1032
- ], O);
1033
- const Ee = [
1034
- f,
1035
- u`
1036
- :host {
1037
- display: inline-block;
1038
- position: relative;
1039
- }
1040
-
1041
- .wrapper {
1042
- display: inline-block;
1043
- position: relative;
1044
- }
1045
-
1046
- .tooltip {
1047
- position: absolute;
1048
- z-index: 1000;
1049
- padding: 6px 12px;
1050
- background-color: var(--reke-color-surface-elevated, #151515);
1051
- color: var(--reke-color-text, #E5E5E5);
1052
- border: 1px solid var(--reke-color-border, #252525);
1053
- border-radius: var(--reke-radius, 4px);
1054
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
1055
- font-size: var(--reke-font-size-xs, 12px);
1056
- white-space: nowrap;
1057
- pointer-events: none;
1058
- opacity: 0;
1059
- transition: opacity 0.15s ease;
1060
- }
1061
-
1062
- .tooltip--visible {
1063
- opacity: 1;
1064
- }
1065
-
1066
- .tooltip--top {
1067
- bottom: 100%;
1068
- left: 50%;
1069
- transform: translateX(-50%);
1070
- margin-bottom: 6px;
1071
- }
1072
-
1073
- .tooltip--bottom {
1074
- top: 100%;
1075
- left: 50%;
1076
- transform: translateX(-50%);
1077
- margin-top: 6px;
1078
- }
1079
-
1080
- .tooltip--left {
1081
- right: 100%;
1082
- top: 50%;
1083
- transform: translateY(-50%);
1084
- margin-right: 6px;
1085
- }
1086
-
1087
- .tooltip--right {
1088
- left: 100%;
1089
- top: 50%;
1090
- transform: translateY(-50%);
1091
- margin-left: 6px;
1092
- }
1093
- `
1094
- ];
1095
- var ze = Object.defineProperty, De = Object.getOwnPropertyDescriptor, H = (e, r, a, o) => {
1096
- for (var t = o > 1 ? void 0 : o ? De(r, a) : r, s = e.length - 1, n; s >= 0; s--)
1097
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
1098
- return o && t && ze(r, a, t), t;
1099
- };
1100
- let M = class extends g {
1101
- constructor() {
1102
- super(...arguments), this.text = "", this.position = "top", this.delay = 200, this._visible = !1;
1103
- }
1104
- show() {
1105
- clearTimeout(this._delayTimeout), this._delayTimeout = setTimeout(() => {
1106
- this._visible = !0;
1107
- }, this.delay);
1108
- }
1109
- hide() {
1110
- clearTimeout(this._delayTimeout), this._delayTimeout = setTimeout(() => {
1111
- this._visible = !1;
1112
- }, this.delay);
1113
- }
1114
- disconnectedCallback() {
1115
- super.disconnectedCallback(), clearTimeout(this._delayTimeout);
1116
- }
1117
- render() {
1118
- return l`
1119
- <div
1120
- class="wrapper"
1121
- aria-describedby="tooltip"
1122
- @mouseenter=${this.show}
1123
- @mouseleave=${this.hide}
1124
- @focusin=${this.show}
1125
- @focusout=${this.hide}
1126
- >
1127
- <div
1128
- id="tooltip"
1129
- class="tooltip tooltip--${this.position} ${this._visible ? "tooltip--visible" : ""}"
1130
- role="tooltip"
1131
- >
1132
- ${this.text}
1133
- </div>
1134
- <slot></slot>
1135
- </div>
1136
- `;
1137
- }
1138
- };
1139
- M.styles = Ee;
1140
- H([
1141
- i()
1142
- ], M.prototype, "text", 2);
1143
- H([
1144
- i({ reflect: !0 })
1145
- ], M.prototype, "position", 2);
1146
- H([
1147
- i({ type: Number })
1148
- ], M.prototype, "delay", 2);
1149
- H([
1150
- k()
1151
- ], M.prototype, "_visible", 2);
1152
- M = H([
1153
- b("reke-tooltip")
1154
- ], M);
1155
- const Be = [
1156
- f,
1157
- u`
1158
- :host {
1159
- display: block;
1160
- }
1161
-
1162
- /* === Backdrop === */
1163
-
1164
- .backdrop {
1165
- position: fixed;
1166
- inset: 0;
1167
- background: rgba(0, 0, 0, 0.6);
1168
- display: flex;
1169
- align-items: center;
1170
- justify-content: center;
1171
- z-index: 1000;
1172
- }
1173
-
1174
- .backdrop--drawer {
1175
- align-items: stretch;
1176
- }
1177
-
1178
- .backdrop--right {
1179
- justify-content: flex-end;
1180
- }
1181
-
1182
- .backdrop--left {
1183
- justify-content: flex-start;
1184
- }
1185
-
1186
- /* === Modal === */
1187
-
1188
- .dialog {
1189
- background: var(--reke-color-bg, #0f0f10);
1190
- border: 1px solid var(--reke-color-border, #252525);
1191
- border-radius: var(--reke-radius, 4px);
1192
- min-width: 400px;
1193
- max-width: 560px;
1194
- width: 100%;
1195
- max-height: 80vh;
1196
- overflow-y: auto;
1197
- font-family: var(
1198
- --reke-font-mono,
1199
- 'JetBrains Mono',
1200
- ui-monospace,
1201
- monospace
1202
- );
1203
- }
1204
-
1205
- /* === Drawer === */
1206
-
1207
- .drawer {
1208
- background: var(--reke-color-bg, #0f0f10);
1209
- width: 400px;
1210
- max-width: 90vw;
1211
- height: 100%;
1212
- overflow-y: auto;
1213
- font-family: var(
1214
- --reke-font-mono,
1215
- 'JetBrains Mono',
1216
- ui-monospace,
1217
- monospace
1218
- );
1219
- display: flex;
1220
- flex-direction: column;
1221
- }
1222
-
1223
- .drawer--right {
1224
- border-left: 1px solid var(--reke-color-border, #252525);
1225
- }
1226
-
1227
- .drawer--left {
1228
- border-right: 1px solid var(--reke-color-border, #252525);
1229
- }
1230
-
1231
- /* === Shared parts === */
1232
-
1233
- .dialog-header {
1234
- display: flex;
1235
- justify-content: space-between;
1236
- align-items: center;
1237
- padding: 16px 20px;
1238
- border-bottom: 1px solid var(--reke-color-border, #252525);
1239
- flex-shrink: 0;
1240
- }
1241
-
1242
- .dialog-title {
1243
- margin: 0;
1244
- font-size: var(--reke-font-size-md, 14px);
1245
- font-weight: var(--reke-font-weight-semibold, 600);
1246
- color: var(--reke-color-text, #e5e5e5);
1247
- }
1248
-
1249
- .close-btn {
1250
- background: transparent;
1251
- border: none;
1252
- color: var(--reke-color-text-muted, #525252);
1253
- cursor: pointer;
1254
- font-size: 20px;
1255
- padding: 4px 8px;
1256
- line-height: 1;
1257
- }
1258
-
1259
- .close-btn:hover {
1260
- color: var(--reke-color-text, #e5e5e5);
1261
- }
1262
-
1263
- .close-btn:focus-visible {
1264
- outline: 2px solid var(--reke-color-primary, #22c55e);
1265
- outline-offset: 2px;
1266
- }
1267
-
1268
- .dialog-body {
1269
- padding: 20px;
1270
- flex: 1;
1271
- overflow-y: auto;
1272
- }
1273
-
1274
- .dialog-footer {
1275
- padding: 12px 20px;
1276
- border-top: 1px solid var(--reke-color-border, #252525);
1277
- display: flex;
1278
- justify-content: flex-end;
1279
- gap: 8px;
1280
- flex-shrink: 0;
1281
- }
1282
- `
1283
- ];
1284
- var Fe = Object.defineProperty, Ae = Object.getOwnPropertyDescriptor, I = (e, r, a, o) => {
1285
- for (var t = o > 1 ? void 0 : o ? Ae(r, a) : r, s = e.length - 1, n; s >= 0; s--)
1286
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
1287
- return o && t && Fe(r, a, t), t;
1288
- };
1289
- let P = class extends g {
1290
- constructor() {
1291
- super(...arguments), this.open = !1, this.heading = "", this.variant = "modal", this.position = "right", this._handleKeydown = (e) => {
1292
- e.key === "Escape" && this.open && this.close();
1293
- };
1294
- }
1295
- connectedCallback() {
1296
- super.connectedCallback(), document.addEventListener("keydown", this._handleKeydown);
1297
- }
1298
- disconnectedCallback() {
1299
- super.disconnectedCallback(), document.removeEventListener("keydown", this._handleKeydown);
1300
- }
1301
- show() {
1302
- this.open = !0;
1303
- }
1304
- close() {
1305
- this.open = !1, this.emit("reke-close");
1306
- }
1307
- render() {
1308
- if (!this.open) return c;
1309
- const e = this.variant === "drawer", r = {
1310
- backdrop: !0,
1311
- "backdrop--drawer": e,
1312
- [`backdrop--${this.position}`]: e
1313
- }, a = {
1314
- dialog: !e,
1315
- drawer: e,
1316
- [`drawer--${this.position}`]: e
1317
- };
1318
- return l`
1319
- <div class=${p(r)} @click=${this.close}>
1320
- <div
1321
- class=${p(a)}
1322
- role="dialog"
1323
- aria-modal="true"
1324
- aria-label=${this.heading}
1325
- @click=${(o) => o.stopPropagation()}
1326
- >
1327
- ${this.heading ? l`
1328
- <div class="dialog-header">
1329
- <h2 class="dialog-title">${this.heading}</h2>
1330
- <button
1331
- class="close-btn"
1332
- @click=${this.close}
1333
- aria-label="Close"
1334
- >
1335
- &times;
1336
- </button>
1337
- </div>
1338
- ` : c}
1339
- <div class="dialog-body">
1340
- <slot></slot>
1341
- </div>
1342
- <div class="dialog-footer">
1343
- <slot name="footer"></slot>
1344
- </div>
1345
- </div>
1346
- </div>
1347
- `;
1348
- }
1349
- };
1350
- P.styles = Be;
1351
- I([
1352
- i({ type: Boolean, reflect: !0 })
1353
- ], P.prototype, "open", 2);
1354
- I([
1355
- i()
1356
- ], P.prototype, "heading", 2);
1357
- I([
1358
- i({ reflect: !0 })
1359
- ], P.prototype, "variant", 2);
1360
- I([
1361
- i({ reflect: !0 })
1362
- ], P.prototype, "position", 2);
1363
- P = I([
1364
- b("reke-dialog")
1365
- ], P);
1366
- const Oe = [
1367
- f,
1368
- u`
1369
- :host {
1370
- display: inline-block;
1371
- position: relative;
1372
- }
1373
-
1374
- :host([disabled]) {
1375
- pointer-events: none;
1376
- opacity: 0.5;
1377
- }
1378
-
1379
- .label {
1380
- display: block;
1381
- margin-bottom: var(--reke-space-2xs, 6px);
1382
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
1383
- font-size: var(--reke-font-size-xs, 12px);
1384
- color: var(--reke-color-text-label, #8a8a8a);
1385
- }
1386
-
1387
- .trigger {
1388
- display: flex;
1389
- align-items: center;
1390
- justify-content: space-between;
1391
- width: 100%;
1392
- background-color: var(--reke-color-surface, #1a1a1a);
1393
- color: var(--reke-color-text, #e5e5e5);
1394
- border: 1px solid var(--reke-color-border, #252525);
1395
- border-radius: var(--reke-radius, 4px);
1396
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
1397
- cursor: pointer;
1398
- outline: none;
1399
- box-sizing: border-box;
1400
- transition: border-color 0.15s ease;
1401
- }
1402
-
1403
- .trigger--placeholder {
1404
- color: var(--reke-color-text-muted, #525252);
1405
- }
1406
-
1407
- .trigger__chevron {
1408
- font-size: 8px;
1409
- margin-left: 8px;
1410
- flex-shrink: 0;
1411
- }
1412
-
1413
- /* === Sizes === */
1414
-
1415
- .trigger--sm {
1416
- padding: var(--reke-space-xs, 8px) var(--reke-space-sm, 12px);
1417
- font-size: var(--reke-font-size-xs, 12px);
1418
- }
1419
-
1420
- .trigger--md {
1421
- padding: var(--reke-space-sm, 12px) var(--reke-space-md, 16px);
1422
- font-size: var(--reke-font-size-sm, 13px);
1423
- }
1424
-
1425
- .trigger--lg {
1426
- padding: var(--reke-space-md, 16px) var(--reke-space-lg, 20px);
1427
- font-size: var(--reke-font-size-md, 14px);
1428
- }
1429
-
1430
- .trigger:focus-visible {
1431
- border-color: var(--reke-color-primary, #22c55e);
1432
- outline: 2px solid var(--reke-color-primary, #22c55e);
1433
- outline-offset: -1px;
1434
- }
1435
-
1436
- .trigger--error {
1437
- border-color: var(--reke-color-danger, #ef4444);
1438
- }
1439
-
1440
- .trigger--error:focus-visible {
1441
- border-color: var(--reke-color-danger, #ef4444);
1442
- outline-color: var(--reke-color-danger, #ef4444);
1443
- }
1444
-
1445
- /* === Dropdown === */
1446
-
1447
- .dropdown {
1448
- position: absolute;
1449
- top: 100%;
1450
- left: 0;
1451
- right: 0;
1452
- margin: 0;
1453
- margin-top: 4px;
1454
- padding: 0;
1455
- list-style: none;
1456
- background-color: var(--reke-color-surface, #1a1a1a);
1457
- border: 1px solid var(--reke-color-border, #252525);
1458
- border-radius: var(--reke-radius, 4px);
1459
- max-height: 200px;
1460
- overflow-y: auto;
1461
- z-index: 100;
1462
- }
1463
-
1464
- /* === Option === */
1465
-
1466
- .option {
1467
- padding: var(--reke-space-xs, 8px) var(--reke-space-md, 16px);
1468
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
1469
- font-size: var(--reke-font-size-sm, 13px);
1470
- color: var(--reke-color-text, #e5e5e5);
1471
- cursor: pointer;
1472
- }
1473
-
1474
- .option:hover {
1475
- background-color: var(--reke-color-surface-elevated, #151515);
1476
- }
1477
-
1478
- .option--selected {
1479
- color: var(--reke-color-primary, #22c55e);
1480
- }
1481
- `
1482
- ];
1483
- var Me = Object.defineProperty, Pe = Object.getOwnPropertyDescriptor, E = (e, r, a, o) => {
1484
- for (var t = o > 1 ? void 0 : o ? Pe(r, a) : r, s = e.length - 1, n; s >= 0; s--)
1485
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
1486
- return o && t && Me(r, a, t), t;
1487
- };
1488
- let w = class extends g {
1489
- constructor() {
1490
- super(...arguments), this.value = "", this.placeholder = "Select...", this.options = [], this.disabled = !1, this.error = !1, this.label = "", this.size = "md", this._open = !1, this._boundHandleOutsideClick = this.handleOutsideClick.bind(this), this._boundHandleKeyDown = this.handleKeyDown.bind(this);
1491
- }
1492
- connectedCallback() {
1493
- super.connectedCallback(), document.addEventListener("click", this._boundHandleOutsideClick), document.addEventListener("keydown", this._boundHandleKeyDown);
1494
- }
1495
- disconnectedCallback() {
1496
- super.disconnectedCallback(), document.removeEventListener("click", this._boundHandleOutsideClick), document.removeEventListener("keydown", this._boundHandleKeyDown);
1497
- }
1498
- handleOutsideClick(e) {
1499
- e.composedPath().includes(this) || (this._open = !1);
1500
- }
1501
- handleKeyDown(e) {
1502
- e.key === "Escape" && this._open && (this._open = !1);
1503
- }
1504
- handleTriggerClick() {
1505
- this.disabled || (this._open = !this._open);
1506
- }
1507
- handleOptionClick(e) {
1508
- this.value = e, this._open = !1, this.emit("reke-change", { value: this.value });
1509
- }
1510
- get selectedLabel() {
1511
- return this.options.find((r) => r.value === this.value)?.label;
1512
- }
1513
- render() {
1514
- const e = this.selectedLabel, r = !e, a = {
1515
- trigger: !0,
1516
- [`trigger--${this.size}`]: !0,
1517
- "trigger--error": this.error,
1518
- "trigger--placeholder": r
1519
- };
1520
- return l`
1521
- ${this.label ? l`<label class="label">${this.label}</label>` : c}
1522
- <button
1523
- part="trigger"
1524
- class=${p(a)}
1525
- type="button"
1526
- ?disabled=${this.disabled}
1527
- aria-expanded=${this._open}
1528
- aria-haspopup="listbox"
1529
- aria-label=${this.label || c}
1530
- @click=${this.handleTriggerClick}
1531
- >
1532
- <span class="trigger__text">${e ?? this.placeholder}</span>
1533
- <span class="trigger__chevron" aria-hidden="true">&#9660;</span>
1534
- </button>
1535
- ${this._open ? l`
1536
- <ul
1537
- part="dropdown"
1538
- class="dropdown"
1539
- role="listbox"
1540
- aria-label=${this.label || c}
1541
- >
1542
- ${this.options.map(
1543
- (o) => l`
1544
- <li
1545
- class="option ${o.value === this.value ? "option--selected" : ""}"
1546
- role="option"
1547
- aria-selected=${o.value === this.value}
1548
- @click=${() => this.handleOptionClick(o.value)}
1549
- >
1550
- ${o.label}
1551
- </li>
1552
- `
1553
- )}
1554
- </ul>
1555
- ` : c}
1556
- `;
1557
- }
1558
- };
1559
- w.styles = Oe;
1560
- E([
1561
- i()
1562
- ], w.prototype, "value", 2);
1563
- E([
1564
- i()
1565
- ], w.prototype, "placeholder", 2);
1566
- E([
1567
- i({ attribute: !1 })
1568
- ], w.prototype, "options", 2);
1569
- E([
1570
- i({ type: Boolean, reflect: !0 })
1571
- ], w.prototype, "disabled", 2);
1572
- E([
1573
- i({ type: Boolean, reflect: !0 })
1574
- ], w.prototype, "error", 2);
1575
- E([
1576
- i()
1577
- ], w.prototype, "label", 2);
1578
- E([
1579
- i({ reflect: !0 })
1580
- ], w.prototype, "size", 2);
1581
- E([
1582
- k()
1583
- ], w.prototype, "_open", 2);
1584
- w = E([
1585
- b("reke-select")
1586
- ], w);
1587
- const Se = [
1588
- f,
1589
- u`
1590
- :host {
1591
- display: block;
1592
- }
1593
-
1594
- /* === Container (wraps toolbar + table + footer) === */
1595
-
1596
- .table-container {
1597
- border: 1px solid var(--reke-color-border, #252525);
1598
- border-radius: var(--reke-radius, 4px);
1599
- overflow: hidden;
1600
- }
1601
-
1602
- .table-wrapper {
1603
- overflow-x: auto;
1604
- }
1605
-
1606
- .table {
1607
- width: 100%;
1608
- border-collapse: collapse;
1609
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
1610
- font-size: 13px;
1611
- color: var(--reke-color-text, #E5E5E5);
1612
- background: var(--reke-color-surface, #1A1A1A);
1613
- }
1614
-
1615
- /* === Toolbar === */
1616
-
1617
- .table-toolbar {
1618
- display: flex;
1619
- align-items: center;
1620
- gap: 8px;
1621
- padding: 12px 16px;
1622
- border-bottom: 1px solid var(--reke-color-border, #252525);
1623
- background: var(--reke-color-surface, #1A1A1A);
1624
- }
1625
-
1626
- /* === Footer === */
1627
-
1628
- .table-footer {
1629
- display: flex;
1630
- align-items: center;
1631
- justify-content: space-between;
1632
- padding: 12px 16px;
1633
- border-top: 1px solid var(--reke-color-border, #252525);
1634
- background: var(--reke-color-surface, #1A1A1A);
1635
- font-size: 12px;
1636
- color: var(--reke-color-text-muted, #525252);
1637
- }
1638
-
1639
- /* === Header === */
1640
-
1641
- thead {
1642
- background: var(--reke-color-surface, #1A1A1A);
1643
- }
1644
-
1645
- .header-cell {
1646
- padding: 12px 16px;
1647
- font-size: 11px;
1648
- font-weight: 600;
1649
- text-transform: uppercase;
1650
- letter-spacing: 0.05em;
1651
- color: var(--reke-color-text-muted, #525252);
1652
- border-bottom: 1px solid var(--reke-color-border, #252525);
1653
- cursor: pointer;
1654
- user-select: none;
1655
- white-space: nowrap;
1656
- }
1657
-
1658
- .header-cell--no-sort {
1659
- cursor: default;
1660
- }
1661
-
1662
- .header-cell[data-align='left'] {
1663
- text-align: left;
1664
- }
1665
-
1666
- .header-cell[data-align='center'] {
1667
- text-align: center;
1668
- }
1669
-
1670
- .header-cell[data-align='right'] {
1671
- text-align: right;
1672
- }
1673
-
1674
- .header-cell:hover {
1675
- color: var(--reke-color-text, #E5E5E5);
1676
- }
1677
-
1678
- .header-cell--no-sort:hover {
1679
- color: var(--reke-color-text-muted, #525252);
1680
- }
1681
-
1682
- .header-cell--sorted {
1683
- color: var(--reke-color-primary, #22C55E);
1684
- }
1685
-
1686
- .header-content {
1687
- display: inline-flex;
1688
- align-items: center;
1689
- gap: 4px;
1690
- }
1691
-
1692
- .sort-indicator {
1693
- font-size: 10px;
1694
- }
1695
-
1696
- /* === Body === */
1697
-
1698
- .row {
1699
- border-bottom: 1px solid var(--reke-color-border, #252525);
1700
- }
1701
-
1702
- .row:last-child {
1703
- border-bottom: none;
1704
- }
1705
-
1706
- .row--expanded {
1707
- border-bottom: none;
1708
- }
1709
-
1710
- .cell {
1711
- padding: 12px 16px;
1712
- }
1713
-
1714
- .cell[data-align='left'] {
1715
- text-align: left;
1716
- }
1717
-
1718
- .cell[data-align='center'] {
1719
- text-align: center;
1720
- }
1721
-
1722
- .cell[data-align='right'] {
1723
- text-align: right;
1724
- }
1725
-
1726
- .cell--empty {
1727
- text-align: center;
1728
- color: var(--reke-color-text-muted, #525252);
1729
- padding: 24px 16px;
1730
- }
1731
-
1732
- /* === Expanded row === */
1733
-
1734
- .expand-row {
1735
- background: var(--reke-color-surface, #1A1A1A);
1736
- border-bottom: 1px solid var(--reke-color-border, #252525);
1737
- }
1738
-
1739
- .expand-row:last-child {
1740
- border-bottom: none;
1741
- }
1742
-
1743
- .expand-content {
1744
- padding: 0 16px 16px 16px;
1745
- }
1746
-
1747
- /* === Modifiers === */
1748
-
1749
- .table--striped .row--even {
1750
- background: color-mix(in srgb, var(--reke-color-surface, #1A1A1A) 85%, var(--reke-color-border, #252525));
1751
- }
1752
-
1753
- .table--hoverable .row:hover {
1754
- background: color-mix(in srgb, var(--reke-color-surface, #1A1A1A) 75%, var(--reke-color-border, #252525));
1755
- cursor: pointer;
1756
- }
1757
-
1758
- .table--dense .header-cell {
1759
- padding: 8px 12px;
1760
- }
1761
-
1762
- .table--dense .cell {
1763
- padding: 6px 12px;
1764
- font-size: 12px;
1765
- }
1766
-
1767
- .table--dense .expand-content {
1768
- padding: 0 12px 12px 12px;
1769
- }
1770
-
1771
- .table--bordered .cell,
1772
- .table--bordered .header-cell {
1773
- border-right: 1px solid var(--reke-color-border, #252525);
1774
- }
1775
-
1776
- .table--bordered .cell:last-child,
1777
- .table--bordered .header-cell:last-child {
1778
- border-right: none;
1779
- }
1780
-
1781
- /* === Borderless (for embedding inside cards/containers) === */
1782
-
1783
- :host([borderless]) .table-container {
1784
- border: none;
1785
- border-radius: 0;
1786
- }
1787
- `
1788
- ];
1789
- var je = Object.defineProperty, Re = Object.getOwnPropertyDescriptor, m = (e, r, a, o) => {
1790
- for (var t = o > 1 ? void 0 : o ? Re(r, a) : r, s = e.length - 1, n; s >= 0; s--)
1791
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
1792
- return o && t && je(r, a, t), t;
1793
- };
1794
- let h = class extends g {
1795
- constructor() {
1796
- super(...arguments), this.columns = [], this.rows = [], this.striped = !1, this.dense = !1, this.hoverable = !1, this.bordered = !1, this.borderless = !1, this.sortKey = "", this.sortDirection = "asc", this.expandedRowRender = null, this.expandedRows = /* @__PURE__ */ new Set(), this._hasToolbar = !1, this._hasFooter = !1;
1797
- }
1798
- handleHeaderClick(e) {
1799
- e.sortable !== !1 && (this.sortKey === e.key ? this.sortDirection = this.sortDirection === "asc" ? "desc" : "asc" : (this.sortKey = e.key, this.sortDirection = "asc"), this.emit("reke-sort", { key: this.sortKey, direction: this.sortDirection }));
1800
- }
1801
- handleRowClick(e, r) {
1802
- this.emit("reke-row-click", { row: e, index: r });
1803
- }
1804
- /** Toggle expand state for a row at the given index. */
1805
- toggleExpand(e) {
1806
- const r = new Set(this.expandedRows), a = this.rows[e], o = !r.has(e);
1807
- o ? r.add(e) : r.delete(e), this.expandedRows = r, this.emit("reke-row-expand", { row: a, index: e, expanded: o });
1808
- }
1809
- /** Check whether a row at the given index is currently expanded. */
1810
- isRowExpanded(e) {
1811
- return this.expandedRows.has(e);
1812
- }
1813
- _onToolbarSlotChange(e) {
1814
- const r = e.target;
1815
- this._hasToolbar = r.assignedNodes({ flatten: !0 }).length > 0;
1816
- }
1817
- _onFooterSlotChange(e) {
1818
- const r = e.target;
1819
- this._hasFooter = r.assignedNodes({ flatten: !0 }).length > 0;
1820
- }
1821
- _renderRow(e, r) {
1822
- const a = this.expandedRows.has(r);
1823
- return l`
1824
- <tr
1825
- part="row"
1826
- class="row ${r % 2 === 1 ? "row--even" : ""} ${a ? "row--expanded" : ""}"
1827
- @click=${() => this.handleRowClick(e, r)}
1828
- >
1829
- ${this.columns.map(
1830
- (o) => l`
1831
- <td
1832
- part="cell"
1833
- class="cell"
1834
- data-align=${o.align || "left"}
1835
- >
1836
- ${o.render ? o.render(e[o.key], e, r) : e[o.key] ?? ""}
1837
- </td>
1838
- `
1839
- )}
1840
- </tr>
1841
- ${this.expandedRowRender && a ? l`
1842
- <tr part="expand-row" class="expand-row">
1843
- <td part="expand-content" class="expand-content" colspan=${this.columns.length}>
1844
- ${this.expandedRowRender(e, r)}
1845
- </td>
1846
- </tr>
1847
- ` : c}
1848
- `;
1849
- }
1850
- render() {
1851
- const e = {
1852
- table: !0,
1853
- "table--striped": this.striped,
1854
- "table--dense": this.dense,
1855
- "table--hoverable": this.hoverable,
1856
- "table--bordered": this.bordered
1857
- };
1858
- return l`
1859
- <div class="table-container">
1860
- ${this._hasToolbar ? l`
1861
- <div part="toolbar" class="table-toolbar">
1862
- <slot name="toolbar" @slotchange=${this._onToolbarSlotChange}></slot>
1863
- </div>
1864
- ` : l`<slot name="toolbar" @slotchange=${this._onToolbarSlotChange} style="display:none"></slot>`}
1865
-
1866
- <div class="table-wrapper">
1867
- <table part="table" class=${p(e)} role="table">
1868
- <thead part="header">
1869
- <tr>
1870
- ${this.columns.map(
1871
- (r) => l`
1872
- <th
1873
- part="header-cell"
1874
- class="header-cell ${this.sortKey === r.key ? "header-cell--sorted" : ""} ${r.sortable === !1 ? "header-cell--no-sort" : ""}"
1875
- style=${r.width ? `width: ${r.width}` : ""}
1876
- data-align=${r.align || "left"}
1877
- @click=${() => this.handleHeaderClick(r)}
1878
- >
1879
- <span class="header-content">
1880
- ${r.header}
1881
- ${this.sortKey === r.key ? l`<span class="sort-indicator" aria-hidden="true">${this.sortDirection === "asc" ? "↑" : "↓"}</span>` : c}
1882
- </span>
1883
- </th>
1884
- `
1885
- )}
1886
- </tr>
1887
- </thead>
1888
- <tbody part="body">
1889
- ${this.rows.map((r, a) => this._renderRow(r, a))}
1890
- ${this.rows.length === 0 ? l`
1891
- <tr class="row row--empty">
1892
- <td class="cell cell--empty" colspan=${this.columns.length}>
1893
- <slot name="empty">No data</slot>
1894
- </td>
1895
- </tr>
1896
- ` : c}
1897
- </tbody>
1898
- </table>
1899
- </div>
1900
-
1901
- ${this._hasFooter ? l`
1902
- <div part="footer" class="table-footer">
1903
- <slot name="footer" @slotchange=${this._onFooterSlotChange}></slot>
1904
- </div>
1905
- ` : l`<slot name="footer" @slotchange=${this._onFooterSlotChange} style="display:none"></slot>`}
1906
- </div>
1907
- `;
1908
- }
1909
- };
1910
- h.styles = Se;
1911
- m([
1912
- i({ attribute: !1 })
1913
- ], h.prototype, "columns", 2);
1914
- m([
1915
- i({ attribute: !1 })
1916
- ], h.prototype, "rows", 2);
1917
- m([
1918
- i({ type: Boolean, reflect: !0 })
1919
- ], h.prototype, "striped", 2);
1920
- m([
1921
- i({ type: Boolean, reflect: !0 })
1922
- ], h.prototype, "dense", 2);
1923
- m([
1924
- i({ type: Boolean, reflect: !0 })
1925
- ], h.prototype, "hoverable", 2);
1926
- m([
1927
- i({ type: Boolean, reflect: !0 })
1928
- ], h.prototype, "bordered", 2);
1929
- m([
1930
- i({ type: Boolean, reflect: !0 })
1931
- ], h.prototype, "borderless", 2);
1932
- m([
1933
- i({ reflect: !0, attribute: "sort-key" })
1934
- ], h.prototype, "sortKey", 2);
1935
- m([
1936
- i({ reflect: !0, attribute: "sort-direction" })
1937
- ], h.prototype, "sortDirection", 2);
1938
- m([
1939
- i({ attribute: !1 })
1940
- ], h.prototype, "expandedRowRender", 2);
1941
- m([
1942
- i({ attribute: !1 })
1943
- ], h.prototype, "expandedRows", 2);
1944
- m([
1945
- k()
1946
- ], h.prototype, "_hasToolbar", 2);
1947
- m([
1948
- k()
1949
- ], h.prototype, "_hasFooter", 2);
1950
- h = m([
1951
- b("reke-table")
1952
- ], h);
1953
- const Te = [
1954
- f,
1955
- u`
1956
- :host {
1957
- display: inline-block;
1958
- position: relative;
1959
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
1960
- }
1961
-
1962
- :host([disabled]) {
1963
- pointer-events: none;
1964
- opacity: 0.5;
1965
- }
1966
-
1967
- /* === Label === */
1968
-
1969
- .label {
1970
- display: block;
1971
- margin-bottom: 6px;
1972
- font-size: 12px;
1973
- color: var(--reke-color-text-ghost, #737373);
1974
- transition: color 0.15s ease;
1975
- }
1976
-
1977
- .label--active {
1978
- color: var(--reke-color-primary, #22C55E);
1979
- }
1980
-
1981
- /* === Trigger === */
1982
-
1983
- .trigger {
1984
- display: inline-flex;
1985
- align-items: center;
1986
- gap: 8px;
1987
- padding: 10px 16px;
1988
- background: var(--reke-color-surface, #1A1A1A);
1989
- border: 1px solid var(--reke-color-border, #252525);
1990
- border-radius: var(--reke-radius, 4px);
1991
- color: var(--reke-color-text, #E5E5E5);
1992
- font-family: inherit;
1993
- font-size: 13px;
1994
- cursor: pointer;
1995
- transition: border-color 0.15s ease;
1996
- min-width: 200px;
1997
- box-sizing: border-box;
1998
- }
1999
-
2000
- .trigger:hover {
2001
- border-color: var(--reke-color-text-muted, #525252);
2002
- }
2003
-
2004
- .trigger--open {
2005
- border-color: var(--reke-color-primary, #22C55E);
2006
- }
2007
-
2008
- .trigger--error {
2009
- border-color: var(--reke-color-danger, #EF4444);
2010
- }
2011
-
2012
- .trigger--placeholder {
2013
- color: var(--reke-color-text-muted, #525252);
2014
- }
2015
-
2016
- .trigger__icon {
2017
- display: inline-flex;
2018
- width: 16px;
2019
- height: 16px;
2020
- color: var(--reke-color-text-muted, #525252);
2021
- transition: color 0.15s ease;
2022
- }
2023
-
2024
- .trigger--open .trigger__icon {
2025
- color: var(--reke-color-primary, #22C55E);
2026
- }
2027
-
2028
- .trigger__icon svg {
2029
- width: 16px;
2030
- height: 16px;
2031
- fill: none;
2032
- stroke: currentColor;
2033
- stroke-width: 2;
2034
- stroke-linecap: round;
2035
- stroke-linejoin: round;
2036
- }
2037
-
2038
- .trigger__text {
2039
- flex: 1;
2040
- white-space: nowrap;
2041
- overflow: hidden;
2042
- text-overflow: ellipsis;
2043
- }
2044
-
2045
- .trigger__separator {
2046
- color: var(--reke-color-text-disabled, #3B3B3B);
2047
- }
2048
-
2049
- .trigger__chevron {
2050
- display: inline-flex;
2051
- width: 16px;
2052
- height: 16px;
2053
- color: var(--reke-color-text-muted, #525252);
2054
- transition: transform 0.15s ease, color 0.15s ease;
2055
- }
2056
-
2057
- .trigger--open .trigger__chevron {
2058
- transform: rotate(180deg);
2059
- color: var(--reke-color-primary, #22C55E);
2060
- }
2061
-
2062
- .trigger__chevron svg {
2063
- width: 16px;
2064
- height: 16px;
2065
- fill: none;
2066
- stroke: currentColor;
2067
- stroke-width: 2;
2068
- stroke-linecap: round;
2069
- stroke-linejoin: round;
2070
- }
2071
-
2072
- /* === Calendar dropdown === */
2073
-
2074
- .calendar {
2075
- position: absolute;
2076
- top: 100%;
2077
- left: 0;
2078
- z-index: 50;
2079
- margin-top: 4px;
2080
- padding: 16px;
2081
- background: var(--reke-color-surface, #1A1A1A);
2082
- border: 1px solid var(--reke-color-border, #252525);
2083
- border-radius: 8px;
2084
- box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6);
2085
- min-width: 280px;
2086
- }
2087
-
2088
- /* === Calendar header (month/year + nav) === */
2089
-
2090
- .calendar__header {
2091
- display: flex;
2092
- align-items: center;
2093
- justify-content: space-between;
2094
- margin-bottom: 12px;
2095
- }
2096
-
2097
- .calendar__title {
2098
- font-size: 12px;
2099
- font-weight: 600;
2100
- color: var(--reke-color-text, #E5E5E5);
2101
- }
2102
-
2103
- .calendar__nav {
2104
- display: flex;
2105
- gap: 4px;
2106
- }
2107
-
2108
- .calendar__nav-btn {
2109
- display: inline-flex;
2110
- align-items: center;
2111
- justify-content: center;
2112
- width: 24px;
2113
- height: 24px;
2114
- padding: 0;
2115
- border: none;
2116
- border-radius: var(--reke-radius, 4px);
2117
- background: transparent;
2118
- color: var(--reke-color-text-muted, #525252);
2119
- cursor: pointer;
2120
- font-family: inherit;
2121
- }
2122
-
2123
- .calendar__nav-btn:hover {
2124
- color: var(--reke-color-text, #E5E5E5);
2125
- background: color-mix(in srgb, var(--reke-color-surface, #1A1A1A) 75%, var(--reke-color-border, #252525));
2126
- }
2127
-
2128
- .calendar__nav-btn svg {
2129
- width: 14px;
2130
- height: 14px;
2131
- fill: none;
2132
- stroke: currentColor;
2133
- stroke-width: 2;
2134
- stroke-linecap: round;
2135
- stroke-linejoin: round;
2136
- }
2137
-
2138
- /* === Weekday header === */
2139
-
2140
- .calendar__weekdays {
2141
- display: grid;
2142
- grid-template-columns: repeat(7, 1fr);
2143
- margin-bottom: 4px;
2144
- }
2145
-
2146
- .calendar__weekday {
2147
- text-align: center;
2148
- font-size: 9px;
2149
- font-weight: 600;
2150
- color: var(--reke-color-text-disabled, #3B3B3B);
2151
- padding: 4px 0;
2152
- text-transform: uppercase;
2153
- }
2154
-
2155
- /* === Day grid === */
2156
-
2157
- .calendar__grid {
2158
- display: grid;
2159
- grid-template-columns: repeat(7, 1fr);
2160
- gap: 2px;
2161
- }
2162
-
2163
- .calendar__day {
2164
- display: flex;
2165
- align-items: center;
2166
- justify-content: center;
2167
- height: 28px;
2168
- font-size: 11px;
2169
- border: none;
2170
- border-radius: var(--reke-radius, 4px);
2171
- background: transparent;
2172
- color: var(--reke-color-text, #E5E5E5);
2173
- cursor: pointer;
2174
- padding: 0;
2175
- font-family: inherit;
2176
- transition: background-color 0.1s ease;
2177
- }
2178
-
2179
- .calendar__day:hover {
2180
- background: color-mix(in srgb, var(--reke-color-surface, #1A1A1A) 70%, var(--reke-color-border, #252525));
2181
- }
2182
-
2183
- .calendar__day--other {
2184
- color: var(--reke-color-text-disabled, #3B3B3B);
2185
- }
2186
-
2187
- .calendar__day--today {
2188
- font-weight: 600;
2189
- color: var(--reke-color-primary, #22C55E);
2190
- }
2191
-
2192
- .calendar__day--selected {
2193
- background: var(--reke-color-primary, #22C55E);
2194
- color: var(--reke-color-on-primary, #0A0A0B);
2195
- font-weight: 600;
2196
- border-radius: 14px;
2197
- }
2198
-
2199
- .calendar__day--selected:hover {
2200
- background: color-mix(in srgb, var(--reke-color-primary, #22C55E) 85%, black);
2201
- }
2202
-
2203
- .calendar__day--in-range {
2204
- background: color-mix(in srgb, var(--reke-color-primary, #22C55E) 10%, transparent);
2205
- border-radius: var(--reke-radius, 4px);
2206
- }
2207
-
2208
- .calendar__day--range-start {
2209
- background: var(--reke-color-primary, #22C55E);
2210
- color: var(--reke-color-on-primary, #0A0A0B);
2211
- font-weight: 600;
2212
- border-radius: 14px 4px 4px 14px;
2213
- }
2214
-
2215
- .calendar__day--range-end {
2216
- background: var(--reke-color-primary, #22C55E);
2217
- color: var(--reke-color-on-primary, #0A0A0B);
2218
- font-weight: 600;
2219
- border-radius: 4px 14px 14px 4px;
2220
- }
2221
-
2222
- .calendar__day--range-start.calendar__day--range-end {
2223
- border-radius: 14px;
2224
- }
2225
-
2226
- .calendar__day--disabled {
2227
- color: var(--reke-color-text-disabled, #3B3B3B);
2228
- cursor: default;
2229
- pointer-events: none;
2230
- }
2231
-
2232
- /* === Calendar footer === */
2233
-
2234
- .calendar__footer {
2235
- display: flex;
2236
- justify-content: space-between;
2237
- align-items: center;
2238
- margin-top: 8px;
2239
- padding-top: 8px;
2240
- }
2241
-
2242
- .calendar__action {
2243
- font-family: inherit;
2244
- font-size: 11px;
2245
- font-weight: 600;
2246
- border: none;
2247
- background: none;
2248
- cursor: pointer;
2249
- padding: 0;
2250
- }
2251
-
2252
- .calendar__action--today {
2253
- color: var(--reke-color-primary, #22C55E);
2254
- }
2255
-
2256
- .calendar__action--today:hover {
2257
- text-decoration: underline;
2258
- }
2259
-
2260
- .calendar__action--clear {
2261
- color: var(--reke-color-text-muted, #525252);
2262
- font-weight: 400;
2263
- }
2264
-
2265
- .calendar__action--clear:hover {
2266
- color: var(--reke-color-text, #E5E5E5);
2267
- }
2268
- `
2269
- ];
2270
- var Le = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, v = (e, r, a, o) => {
2271
- for (var t = o > 1 ? void 0 : o ? Ye(r, a) : r, s = e.length - 1, n; s >= 0; s--)
2272
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
2273
- return o && t && Le(r, a, t), t;
2274
- };
2275
- const Je = [
2276
- "Enero",
2277
- "Febrero",
2278
- "Marzo",
2279
- "Abril",
2280
- "Mayo",
2281
- "Junio",
2282
- "Julio",
2283
- "Agosto",
2284
- "Septiembre",
2285
- "Octubre",
2286
- "Noviembre",
2287
- "Diciembre"
2288
- ], Ne = ["Lu", "Ma", "Mi", "Ju", "Vi", "Sa", "Do"];
2289
- function x(e) {
2290
- if (!e) return null;
2291
- const [r, a, o] = e.split("-").map(Number);
2292
- return !r || !a || !o ? null : new Date(r, a - 1, o);
2293
- }
2294
- function B(e) {
2295
- const r = e.getFullYear(), a = String(e.getMonth() + 1).padStart(2, "0"), o = String(e.getDate()).padStart(2, "0");
2296
- return `${r}-${a}-${o}`;
2297
- }
2298
- function q(e) {
2299
- const r = String(e.getDate()).padStart(2, "0"), a = String(e.getMonth() + 1).padStart(2, "0");
2300
- return `${r}/${a}/${e.getFullYear()}`;
2301
- }
2302
- function X(e, r) {
2303
- return e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth() && e.getDate() === r.getDate();
2304
- }
2305
- function Ke(e, r) {
2306
- let o = new Date(e, r, 1).getDay() - 1;
2307
- o < 0 && (o = 6);
2308
- const t = new Date(e, r, 1 - o), s = [];
2309
- for (let n = 0; n < 42; n++) {
2310
- const R = new Date(t.getFullYear(), t.getMonth(), t.getDate() + n);
2311
- s.push({ date: R, day: R.getDate(), otherMonth: R.getMonth() !== r });
2312
- }
2313
- return s;
2314
- }
2315
- let d = class extends g {
2316
- constructor() {
2317
- super(...arguments), this.mode = "range", this.value = "", this.from = "", this.to = "", this.label = "", this.placeholder = "", this.min = "", this.max = "", this.disabled = !1, this.error = !1, this._open = !1, this._viewYear = (/* @__PURE__ */ new Date()).getFullYear(), this._viewMonth = (/* @__PURE__ */ new Date()).getMonth(), this._rangeSelecting = !1, this._boundOutsideClick = this._onOutsideClick.bind(this), this._onKeyDown = (e) => {
2318
- if (e.key === "Escape" && this._open) {
2319
- if (this._rangeSelecting && this.from) {
2320
- this.to = this.from, this._rangeSelecting = !1, this._open = !1, this.emit("reke-change", { from: this.from, to: this.to });
2321
- return;
2322
- }
2323
- this._open = !1, this._rangeSelecting = !1;
2324
- }
2325
- };
2326
- }
2327
- connectedCallback() {
2328
- super.connectedCallback(), document.addEventListener("click", this._boundOutsideClick, !0), document.addEventListener("keydown", this._onKeyDown);
2329
- }
2330
- disconnectedCallback() {
2331
- super.disconnectedCallback(), document.removeEventListener("click", this._boundOutsideClick, !0), document.removeEventListener("keydown", this._onKeyDown);
2332
- }
2333
- _onOutsideClick(e) {
2334
- if (!this._open) return;
2335
- if (!e.composedPath().includes(this)) {
2336
- if (this._rangeSelecting && this.from) {
2337
- this.to = this.from, this._rangeSelecting = !1, this._open = !1, this.emit("reke-change", { from: this.from, to: this.to });
2338
- return;
2339
- }
2340
- this._open = !1, this._rangeSelecting = !1;
2341
- }
2342
- }
2343
- _toggleOpen() {
2344
- if (!this.disabled)
2345
- if (this._open = !this._open, this._open)
2346
- this._syncView();
2347
- else {
2348
- if (this._rangeSelecting && this.from) {
2349
- this.to = this.from, this._rangeSelecting = !1, this.emit("reke-change", { from: this.from, to: this.to });
2350
- return;
2351
- }
2352
- this._rangeSelecting = !1;
2353
- }
2354
- }
2355
- /** Sync calendar view to the current selection. */
2356
- _syncView() {
2357
- let e = null;
2358
- if (this.mode === "single" ? e = x(this.value) : e = x(this.from), e)
2359
- this._viewYear = e.getFullYear(), this._viewMonth = e.getMonth();
2360
- else {
2361
- const r = /* @__PURE__ */ new Date();
2362
- this._viewYear = r.getFullYear(), this._viewMonth = r.getMonth();
2363
- }
2364
- }
2365
- _prevYear() {
2366
- this._viewYear--;
2367
- }
2368
- _nextYear() {
2369
- this._viewYear++;
2370
- }
2371
- _prevMonth() {
2372
- this._viewMonth === 0 ? (this._viewMonth = 11, this._viewYear--) : this._viewMonth--;
2373
- }
2374
- _nextMonth() {
2375
- this._viewMonth === 11 ? (this._viewMonth = 0, this._viewYear++) : this._viewMonth++;
2376
- }
2377
- _isDisabledDate(e) {
2378
- const r = x(this.min), a = x(this.max);
2379
- return !!(r && e < r || a && e > a);
2380
- }
2381
- _selectDay(e) {
2382
- if (!this._isDisabledDate(e.date)) {
2383
- if (this.mode === "single") {
2384
- this.value = B(e.date), this._open = !1, this.emit("reke-change", { value: this.value });
2385
- return;
2386
- }
2387
- if (!this._rangeSelecting)
2388
- this.from = B(e.date), this.to = "", this._rangeSelecting = !0;
2389
- else {
2390
- let r = x(this.from), a = e.date;
2391
- a < r && ([r, a] = [a, r]), this.from = B(r), this.to = B(a), this._rangeSelecting = !1, this._open = !1, this.emit("reke-change", { from: this.from, to: this.to });
2392
- }
2393
- }
2394
- }
2395
- _goToday() {
2396
- const e = /* @__PURE__ */ new Date(), r = B(e);
2397
- if (this._viewYear = e.getFullYear(), this._viewMonth = e.getMonth(), this.mode === "single")
2398
- this.value = r, this._open = !1, this.emit("reke-change", { value: this.value });
2399
- else if (this._rangeSelecting && this.from) {
2400
- let a = x(this.from), o = e;
2401
- o < a && ([a, o] = [o, a]), this.from = B(a), this.to = B(o), this._rangeSelecting = !1, this._open = !1, this.emit("reke-change", { from: this.from, to: this.to });
2402
- } else
2403
- this.from = r, this.to = r, this._rangeSelecting = !1, this._open = !1, this.emit("reke-change", { from: this.from, to: this.to });
2404
- }
2405
- _clear() {
2406
- this.mode === "single" ? (this.value = "", this.emit("reke-change", { value: "" })) : (this.from = "", this.to = "", this._rangeSelecting = !1, this.emit("reke-change", { from: "", to: "" })), this._open = !1;
2407
- }
2408
- _getDayClasses(e) {
2409
- const r = /* @__PURE__ */ new Date(), a = X(e.date, r), o = this._isDisabledDate(e.date);
2410
- if (this.mode === "single") {
2411
- const Z = x(this.value);
2412
- return {
2413
- calendar__day: !0,
2414
- "calendar__day--other": e.otherMonth,
2415
- "calendar__day--today": a,
2416
- "calendar__day--selected": !!Z && X(e.date, Z),
2417
- "calendar__day--disabled": o
2418
- };
2419
- }
2420
- const t = x(this.from), s = x(this.to), n = !!t && X(e.date, t), R = !!s && X(e.date, s), ee = !!t && !!s && e.date > t && e.date < s;
2421
- return {
2422
- calendar__day: !0,
2423
- "calendar__day--other": e.otherMonth,
2424
- "calendar__day--today": a && !n && !R,
2425
- "calendar__day--selected": (this.mode === "range", !1),
2426
- "calendar__day--in-range": ee,
2427
- "calendar__day--range-start": n,
2428
- "calendar__day--range-end": R,
2429
- "calendar__day--disabled": o
2430
- };
2431
- }
2432
- _getDisplayText() {
2433
- if (this.mode === "single") {
2434
- const t = x(this.value);
2435
- return t ? q(t) : this.placeholder || "Seleccionar fecha";
2436
- }
2437
- const e = x(this.from), r = x(this.to);
2438
- if (!e && !r)
2439
- return this.placeholder || "Seleccionar rango";
2440
- const a = e ? q(e) : "—", o = r ? q(r) : "—";
2441
- return l`${a} <span class="trigger__separator">→</span> ${o}`;
2442
- }
2443
- _hasValue() {
2444
- return this.mode === "single" ? !!this.value : !!(this.from || this.to);
2445
- }
2446
- _renderCalendarIcon() {
2447
- return l`
2448
- <span class="trigger__icon" aria-hidden="true">
2449
- <svg viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
2450
- </span>
2451
- `;
2452
- }
2453
- _renderChevron() {
2454
- return l`
2455
- <span class="trigger__chevron" aria-hidden="true">
2456
- <svg viewBox="0 0 24 24"><polyline points="6 9 12 15 18 9"/></svg>
2457
- </span>
2458
- `;
2459
- }
2460
- render() {
2461
- const e = Ke(this._viewYear, this._viewMonth), r = !this._hasValue(), a = `${Je[this._viewMonth]} ${this._viewYear}`, o = {
2462
- trigger: !0,
2463
- "trigger--open": this._open,
2464
- "trigger--error": this.error,
2465
- "trigger--placeholder": r
2466
- }, t = {
2467
- label: !0,
2468
- "label--active": this._open
2469
- };
2470
- return l`
2471
- ${this.label ? l`<span class=${p(t)}>${this.label}</span>` : c}
2472
-
2473
- <button
2474
- part="trigger"
2475
- class=${p(o)}
2476
- type="button"
2477
- @click=${this._toggleOpen}
2478
- aria-haspopup="dialog"
2479
- aria-expanded=${this._open}
2480
- ?disabled=${this.disabled}
2481
- >
2482
- ${this._renderCalendarIcon()}
2483
- <span class="trigger__text">${this._getDisplayText()}</span>
2484
- ${this._renderChevron()}
2485
- </button>
2486
-
2487
- ${this._open ? l`
2488
- <div part="calendar" class="calendar" role="dialog" aria-label="Calendar">
2489
- <div class="calendar__header">
2490
- <span class="calendar__title">${a}</span>
2491
- <div class="calendar__nav">
2492
- <button
2493
- class="calendar__nav-btn"
2494
- type="button"
2495
- @click=${this._prevYear}
2496
- aria-label="Previous year"
2497
- >
2498
- <svg viewBox="0 0 24 24"><polyline points="17 18 11 12 17 6"/><polyline points="11 18 5 12 11 6"/></svg>
2499
- </button>
2500
- <button
2501
- class="calendar__nav-btn"
2502
- type="button"
2503
- @click=${this._prevMonth}
2504
- aria-label="Previous month"
2505
- >
2506
- <svg viewBox="0 0 24 24"><polyline points="15 18 9 12 15 6"/></svg>
2507
- </button>
2508
- <button
2509
- class="calendar__nav-btn"
2510
- type="button"
2511
- @click=${this._nextMonth}
2512
- aria-label="Next month"
2513
- >
2514
- <svg viewBox="0 0 24 24"><polyline points="9 6 15 12 9 18"/></svg>
2515
- </button>
2516
- <button
2517
- class="calendar__nav-btn"
2518
- type="button"
2519
- @click=${this._nextYear}
2520
- aria-label="Next year"
2521
- >
2522
- <svg viewBox="0 0 24 24"><polyline points="7 6 13 12 7 18"/><polyline points="13 6 19 12 13 18"/></svg>
2523
- </button>
2524
- </div>
2525
- </div>
2526
-
2527
- <div class="calendar__weekdays">
2528
- ${Ne.map(
2529
- (s) => l`<span class="calendar__weekday">${s}</span>`
2530
- )}
2531
- </div>
2532
-
2533
- <div class="calendar__grid">
2534
- ${e.map(
2535
- (s) => l`
2536
- <button
2537
- class=${p(this._getDayClasses(s))}
2538
- type="button"
2539
- @click=${() => this._selectDay(s)}
2540
- ?disabled=${this._isDisabledDate(s.date)}
2541
- aria-label="${s.date.toLocaleDateString("es-ES", { day: "numeric", month: "long", year: "numeric" })}"
2542
- >
2543
- ${s.day}
2544
- </button>
2545
- `
2546
- )}
2547
- </div>
2548
-
2549
- <div class="calendar__footer">
2550
- <button class="calendar__action calendar__action--today" type="button" @click=${this._goToday}>
2551
- Hoy
2552
- </button>
2553
- <button class="calendar__action calendar__action--clear" type="button" @click=${this._clear}>
2554
- Limpiar
2555
- </button>
2556
- </div>
2557
- </div>
2558
- ` : c}
2559
- `;
2560
- }
2561
- };
2562
- d.styles = Te;
2563
- v([
2564
- i({ reflect: !0 })
2565
- ], d.prototype, "mode", 2);
2566
- v([
2567
- i()
2568
- ], d.prototype, "value", 2);
2569
- v([
2570
- i()
2571
- ], d.prototype, "from", 2);
2572
- v([
2573
- i()
2574
- ], d.prototype, "to", 2);
2575
- v([
2576
- i()
2577
- ], d.prototype, "label", 2);
2578
- v([
2579
- i()
2580
- ], d.prototype, "placeholder", 2);
2581
- v([
2582
- i()
2583
- ], d.prototype, "min", 2);
2584
- v([
2585
- i()
2586
- ], d.prototype, "max", 2);
2587
- v([
2588
- i({ type: Boolean, reflect: !0 })
2589
- ], d.prototype, "disabled", 2);
2590
- v([
2591
- i({ type: Boolean, reflect: !0 })
2592
- ], d.prototype, "error", 2);
2593
- v([
2594
- k()
2595
- ], d.prototype, "_open", 2);
2596
- v([
2597
- k()
2598
- ], d.prototype, "_viewYear", 2);
2599
- v([
2600
- k()
2601
- ], d.prototype, "_viewMonth", 2);
2602
- v([
2603
- k()
2604
- ], d.prototype, "_rangeSelecting", 2);
2605
- d = v([
2606
- b("reke-date-range")
2607
- ], d);
2608
- const He = [
2609
- f,
2610
- u`
2611
- :host {
2612
- display: block;
2613
- }
2614
-
2615
- :host([disabled]) {
2616
- pointer-events: none;
2617
- opacity: 0.5;
2618
- }
2619
-
2620
- .dropzone {
2621
- display: flex;
2622
- flex-direction: column;
2623
- align-items: center;
2624
- justify-content: center;
2625
- gap: var(--reke-space-sm, 12px);
2626
- padding: var(--reke-space-xl, 24px) var(--reke-space-lg, 20px);
2627
- border-radius: var(--reke-radius, 4px);
2628
- border: 1px dashed var(--reke-color-border, #252525);
2629
- background-color: transparent;
2630
- cursor: pointer;
2631
- transition: border-color 0.2s ease, background-color 0.2s ease;
2632
- text-align: center;
2633
- }
2634
-
2635
- .dropzone:hover {
2636
- border-color: var(--reke-color-text-muted, #525252);
2637
- }
2638
-
2639
- .dropzone--dragging {
2640
- border-color: var(--reke-color-primary, #22c55e);
2641
- background-color: color-mix(in srgb, var(--reke-color-primary, #22c55e) 5%, transparent);
2642
- }
2643
-
2644
- .dropzone--error {
2645
- border-color: var(--reke-color-danger, #ef4444);
2646
- }
2647
-
2648
- .dropzone--compact {
2649
- flex-direction: row;
2650
- padding: var(--reke-space-sm, 12px) var(--reke-space-md, 16px);
2651
- }
2652
-
2653
- .icon {
2654
- width: 36px;
2655
- height: 36px;
2656
- border-radius: 50%;
2657
- background-color: color-mix(in srgb, var(--reke-color-primary, #22c55e) 10%, transparent);
2658
- border: 1px solid color-mix(in srgb, var(--reke-color-primary, #22c55e) 20%, transparent);
2659
- display: flex;
2660
- align-items: center;
2661
- justify-content: center;
2662
- color: var(--reke-color-primary, #22c55e);
2663
- font-size: 16px;
2664
- flex-shrink: 0;
2665
- }
2666
-
2667
- .dropzone--compact .icon {
2668
- width: 28px;
2669
- height: 28px;
2670
- font-size: 14px;
2671
- }
2672
-
2673
- .text {
2674
- display: flex;
2675
- flex-direction: column;
2676
- gap: 2px;
2677
- }
2678
-
2679
- .text__primary {
2680
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
2681
- font-size: var(--reke-font-size-xs, 12px);
2682
- font-weight: var(--reke-font-weight-medium, 500);
2683
- color: var(--reke-color-text, #e5e5e5);
2684
- }
2685
-
2686
- .text__secondary {
2687
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
2688
- font-size: var(--reke-font-size-2xs, 11px);
2689
- color: var(--reke-color-text-disabled, #3b3b3b);
2690
- }
2691
-
2692
- .text__file {
2693
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
2694
- font-size: var(--reke-font-size-xs, 12px);
2695
- font-weight: var(--reke-font-weight-medium, 500);
2696
- color: var(--reke-color-primary, #22c55e);
2697
- }
2698
-
2699
- .text__error {
2700
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
2701
- font-size: var(--reke-font-size-2xs, 11px);
2702
- color: var(--reke-color-danger, #ef4444);
2703
- }
2704
-
2705
- input[type='file'] {
2706
- display: none;
2707
- }
2708
- `
2709
- ];
2710
- var Ie = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, C = (e, r, a, o) => {
2711
- for (var t = o > 1 ? void 0 : o ? Ve(r, a) : r, s = e.length - 1, n; s >= 0; s--)
2712
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
2713
- return o && t && Ie(r, a, t), t;
2714
- };
2715
- let y = class extends g {
2716
- constructor() {
2717
- super(...arguments), this.accept = "", this.hint = "", this.disabled = !1, this.error = !1, this.errorMessage = "", this.compact = !1, this._dragging = !1, this._fileName = "";
2718
- }
2719
- handleClick() {
2720
- this.disabled || this._input.click();
2721
- }
2722
- handleDragOver(e) {
2723
- e.preventDefault(), e.stopPropagation(), this.disabled || (this._dragging = !0);
2724
- }
2725
- handleDragLeave(e) {
2726
- e.preventDefault(), e.stopPropagation(), this._dragging = !1;
2727
- }
2728
- handleDrop(e) {
2729
- if (e.preventDefault(), e.stopPropagation(), this._dragging = !1, this.disabled) return;
2730
- const r = e.dataTransfer?.files[0];
2731
- r && (this._fileName = r.name, this.emit("reke-file-select", { file: r }));
2732
- }
2733
- handleInputChange() {
2734
- const e = this._input.files?.[0];
2735
- e && (this._fileName = e.name, this.emit("reke-file-select", { file: e }));
2736
- }
2737
- /** Clear the selected file programmatically. */
2738
- clear() {
2739
- this._fileName = "", this._input && (this._input.value = ""), this.emit("reke-file-clear");
2740
- }
2741
- render() {
2742
- const e = {
2743
- dropzone: !0,
2744
- "dropzone--dragging": this._dragging,
2745
- "dropzone--error": this.error,
2746
- "dropzone--compact": this.compact
2747
- };
2748
- return l`
2749
- <div
2750
- part="dropzone"
2751
- class=${p(e)}
2752
- @click=${this.handleClick}
2753
- @dragover=${this.handleDragOver}
2754
- @dragleave=${this.handleDragLeave}
2755
- @drop=${this.handleDrop}
2756
- role="button"
2757
- tabindex="0"
2758
- aria-label="Upload file"
2759
- @keydown=${(r) => {
2760
- (r.key === "Enter" || r.key === " ") && (r.preventDefault(), this.handleClick());
2761
- }}
2762
- >
2763
- <div class="icon" aria-hidden="true">&#8593;</div>
2764
- <div class="text">
2765
- ${this._fileName ? l`<span class="text__file">${this._fileName}</span>` : l`<span class="text__primary">
2766
- ${this._dragging ? "drop file here" : "drag or select file"}
2767
- </span>`}
2768
- ${this.error && this.errorMessage ? l`<span class="text__error">${this.errorMessage}</span>` : this.hint ? l`<span class="text__secondary">${this.hint}</span>` : c}
2769
- </div>
2770
- </div>
2771
- <input
2772
- type="file"
2773
- accept=${this.accept || c}
2774
- @change=${this.handleInputChange}
2775
- />
2776
- `;
2777
- }
2778
- };
2779
- y.styles = He;
2780
- C([
2781
- i()
2782
- ], y.prototype, "accept", 2);
2783
- C([
2784
- i()
2785
- ], y.prototype, "hint", 2);
2786
- C([
2787
- i({ type: Boolean, reflect: !0 })
2788
- ], y.prototype, "disabled", 2);
2789
- C([
2790
- i({ type: Boolean, reflect: !0 })
2791
- ], y.prototype, "error", 2);
2792
- C([
2793
- i({ attribute: "error-message" })
2794
- ], y.prototype, "errorMessage", 2);
2795
- C([
2796
- i({ type: Boolean, reflect: !0 })
2797
- ], y.prototype, "compact", 2);
2798
- C([
2799
- k()
2800
- ], y.prototype, "_dragging", 2);
2801
- C([
2802
- k()
2803
- ], y.prototype, "_fileName", 2);
2804
- C([
2805
- oe('input[type="file"]')
2806
- ], y.prototype, "_input", 2);
2807
- y = C([
2808
- b("reke-file-upload")
2809
- ], y);
2810
- const Ue = [
2811
- f,
2812
- u`
2813
- :host {
2814
- display: block;
2815
- }
2816
-
2817
- .alert {
2818
- display: flex;
2819
- align-items: center;
2820
- gap: var(--reke-space-sm, 12px);
2821
- padding: var(--reke-space-md, 16px) var(--reke-space-lg, 20px);
2822
- border-radius: var(--reke-radius, 4px);
2823
- border: 1px solid transparent;
2824
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
2825
- font-size: var(--reke-font-size-sm, 13px);
2826
- line-height: 1.5;
2827
- box-sizing: border-box;
2828
- }
2829
-
2830
- /* === Variants === */
2831
-
2832
- .alert--success {
2833
- background-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 6%, transparent);
2834
- border-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 19%, transparent);
2835
- color: var(--reke-color-primary, #22C55E);
2836
- }
2837
-
2838
- .alert--error {
2839
- background-color: color-mix(in srgb, var(--reke-color-danger, #EF4444) 6%, transparent);
2840
- border-color: color-mix(in srgb, var(--reke-color-danger, #EF4444) 19%, transparent);
2841
- color: var(--reke-color-danger, #EF4444);
2842
- }
2843
-
2844
- .alert--warning {
2845
- background-color: color-mix(in srgb, var(--reke-color-warning, #F59E0B) 6%, transparent);
2846
- border-color: color-mix(in srgb, var(--reke-color-warning, #F59E0B) 19%, transparent);
2847
- color: var(--reke-color-warning, #F59E0B);
2848
- }
2849
-
2850
- .alert--info {
2851
- background-color: color-mix(in srgb, var(--reke-color-secondary, #3B82F6) 6%, transparent);
2852
- border-color: color-mix(in srgb, var(--reke-color-secondary, #3B82F6) 19%, transparent);
2853
- color: var(--reke-color-secondary, #3B82F6);
2854
- }
2855
-
2856
- /* === Content === */
2857
-
2858
- .alert__content {
2859
- flex: 1;
2860
- min-width: 0;
2861
- }
2862
-
2863
- /* === Dismissible === */
2864
-
2865
- .alert__close {
2866
- flex-shrink: 0;
2867
- display: flex;
2868
- align-items: center;
2869
- justify-content: center;
2870
- width: 20px;
2871
- height: 20px;
2872
- background: transparent;
2873
- border: none;
2874
- color: currentColor;
2875
- opacity: 0.5;
2876
- cursor: pointer;
2877
- padding: 0;
2878
- font-size: 16px;
2879
- line-height: 1;
2880
- transition: opacity 0.15s ease;
2881
- }
2882
-
2883
- .alert__close:hover {
2884
- opacity: 1;
2885
- }
2886
-
2887
- .alert__close:focus-visible {
2888
- outline: 2px solid currentColor;
2889
- outline-offset: 2px;
2890
- }
2891
- `
2892
- ];
2893
- var Xe = Object.defineProperty, We = Object.getOwnPropertyDescriptor, Q = (e, r, a, o) => {
2894
- for (var t = o > 1 ? void 0 : o ? We(r, a) : r, s = e.length - 1, n; s >= 0; s--)
2895
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
2896
- return o && t && Xe(r, a, t), t;
2897
- };
2898
- let Y = class extends g {
2899
- constructor() {
2900
- super(...arguments), this.variant = "info", this.dismissible = !1;
2901
- }
2902
- handleClose() {
2903
- this.emit("reke-close"), this.remove();
2904
- }
2905
- render() {
2906
- const e = {
2907
- alert: !0,
2908
- [`alert--${this.variant}`]: !0
2909
- };
2910
- return l`
2911
- <div part="alert" class=${p(e)} role="alert">
2912
- <span class="alert__content">
2913
- <slot></slot>
2914
- </span>
2915
- ${this.dismissible ? l`
2916
- <button
2917
- class="alert__close"
2918
- @click=${this.handleClose}
2919
- aria-label="Close"
2920
- >
2921
- &times;
2922
- </button>
2923
- ` : c}
2924
- </div>
2925
- `;
2926
- }
2927
- };
2928
- Y.styles = Ue;
2929
- Q([
2930
- i({ reflect: !0 })
2931
- ], Y.prototype, "variant", 2);
2932
- Q([
2933
- i({ type: Boolean, reflect: !0 })
2934
- ], Y.prototype, "dismissible", 2);
2935
- Y = Q([
2936
- b("reke-alert")
2937
- ], Y);
2938
- const qe = [
2939
- f,
2940
- u`
2941
- :host {
2942
- display: block;
2943
- }
2944
-
2945
- .toast {
2946
- display: flex;
2947
- align-items: center;
2948
- justify-content: space-between;
2949
- gap: var(--reke-space-sm, 12px);
2950
- padding: var(--reke-space-sm, 14px) var(--reke-space-lg, 20px);
2951
- border-radius: var(--reke-radius, 4px);
2952
- border: 1px solid var(--reke-color-border, #252525);
2953
- background-color: var(--reke-color-surface, #1a1a1a);
2954
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
2955
- font-size: var(--reke-font-size-sm, 13px);
2956
- box-sizing: border-box;
2957
- transition: opacity 0.2s ease, transform 0.2s ease;
2958
- }
2959
-
2960
- .toast--error {
2961
- border-color: color-mix(in srgb, var(--reke-color-danger, #EF4444) 25%, transparent);
2962
- }
2963
-
2964
- .toast--success {
2965
- border-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 25%, transparent);
2966
- }
2967
-
2968
- .toast--warning {
2969
- border-color: color-mix(in srgb, var(--reke-color-warning, #F59E0B) 25%, transparent);
2970
- }
2971
-
2972
- .toast--info {
2973
- border-color: color-mix(in srgb, var(--reke-color-secondary, #3B82F6) 25%, transparent);
2974
- }
2975
-
2976
- /* === Left section === */
2977
-
2978
- .toast__left {
2979
- display: flex;
2980
- align-items: center;
2981
- gap: var(--reke-space-sm, 12px);
2982
- min-width: 0;
2983
- flex: 1;
2984
- }
2985
-
2986
- .toast__icon {
2987
- flex-shrink: 0;
2988
- width: 16px;
2989
- height: 16px;
2990
- display: flex;
2991
- align-items: center;
2992
- justify-content: center;
2993
- }
2994
-
2995
- .toast__icon svg {
2996
- width: 16px;
2997
- height: 16px;
2998
- fill: none;
2999
- stroke: currentColor;
3000
- stroke-width: 2;
3001
- stroke-linecap: round;
3002
- stroke-linejoin: round;
3003
- }
3004
-
3005
- .toast--success .toast__icon {
3006
- color: var(--reke-color-primary, #22C55E);
3007
- }
3008
-
3009
- .toast--error .toast__icon {
3010
- color: var(--reke-color-danger, #EF4444);
3011
- }
3012
-
3013
- .toast--warning .toast__icon {
3014
- color: var(--reke-color-warning, #F59E0B);
3015
- }
3016
-
3017
- .toast--info .toast__icon {
3018
- color: var(--reke-color-secondary, #3B82F6);
3019
- }
3020
-
3021
- .toast__message {
3022
- color: var(--reke-color-text, #e5e5e5);
3023
- white-space: nowrap;
3024
- overflow: hidden;
3025
- text-overflow: ellipsis;
3026
- }
3027
-
3028
- /* === Right section === */
3029
-
3030
- .toast__right {
3031
- display: flex;
3032
- align-items: center;
3033
- gap: var(--reke-space-xs, 8px);
3034
- flex-shrink: 0;
3035
- }
3036
-
3037
- .toast__action {
3038
- background: transparent;
3039
- border: none;
3040
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
3041
- font-size: var(--reke-font-size-2xs, 11px);
3042
- font-weight: var(--reke-font-weight-medium, 500);
3043
- cursor: pointer;
3044
- padding: 0;
3045
- transition: opacity 0.15s ease;
3046
- }
3047
-
3048
- .toast--error .toast__action {
3049
- color: var(--reke-color-danger, #EF4444);
3050
- }
3051
-
3052
- .toast--success .toast__action {
3053
- color: var(--reke-color-primary, #22C55E);
3054
- }
3055
-
3056
- .toast--warning .toast__action {
3057
- color: var(--reke-color-warning, #F59E0B);
3058
- }
3059
-
3060
- .toast--info .toast__action {
3061
- color: var(--reke-color-secondary, #3B82F6);
3062
- }
3063
-
3064
- .toast__action:hover {
3065
- opacity: 0.8;
3066
- }
3067
-
3068
- .toast__action:focus-visible {
3069
- outline: 2px solid currentColor;
3070
- outline-offset: 2px;
3071
- }
3072
-
3073
- .toast__close {
3074
- display: flex;
3075
- align-items: center;
3076
- justify-content: center;
3077
- width: 20px;
3078
- height: 20px;
3079
- background: transparent;
3080
- border: none;
3081
- color: var(--reke-color-text-muted, #525252);
3082
- cursor: pointer;
3083
- padding: 0;
3084
- font-size: 14px;
3085
- line-height: 1;
3086
- transition: color 0.15s ease;
3087
- }
3088
-
3089
- .toast__close:hover {
3090
- color: var(--reke-color-text, #e5e5e5);
3091
- }
3092
-
3093
- .toast__close:focus-visible {
3094
- outline: 2px solid var(--reke-color-primary, #22c55e);
3095
- outline-offset: 2px;
3096
- }
3097
- `
3098
- ];
3099
- var Ge = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, V = (e, r, a, o) => {
3100
- for (var t = o > 1 ? void 0 : o ? Qe(r, a) : r, s = e.length - 1, n; s >= 0; s--)
3101
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
3102
- return o && t && Ge(r, a, t), t;
3103
- };
3104
- const Ze = {
3105
- success: l`<svg viewBox="0 0 24 24"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>`,
3106
- error: l`<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="12"/><line x1="12" y1="16" x2="12.01" y2="16"/></svg>`,
3107
- warning: l`<svg viewBox="0 0 24 24"><path d="M10.29 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"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>`,
3108
- info: l`<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><line x1="12" y1="16" x2="12" y2="12"/><line x1="12" y1="8" x2="12.01" y2="8"/></svg>`
3109
- };
3110
- let S = class extends g {
3111
- constructor() {
3112
- super(...arguments), this.variant = "success", this.message = "", this.action = "", this.duration = 0;
3113
- }
3114
- connectedCallback() {
3115
- super.connectedCallback(), this.startTimer();
3116
- }
3117
- disconnectedCallback() {
3118
- super.disconnectedCallback(), this.clearTimer();
3119
- }
3120
- startTimer() {
3121
- this.clearTimer(), this.duration > 0 && (this._timer = setTimeout(() => this.dismiss(), this.duration));
3122
- }
3123
- clearTimer() {
3124
- this._timer !== void 0 && (clearTimeout(this._timer), this._timer = void 0);
3125
- }
3126
- dismiss() {
3127
- this.emit("reke-close"), this.remove();
3128
- }
3129
- handleAction() {
3130
- this.emit("reke-action");
3131
- }
3132
- render() {
3133
- const e = {
3134
- toast: !0,
3135
- [`toast--${this.variant}`]: !0
3136
- };
3137
- return l`
3138
- <div part="toast" class=${p(e)} role="status">
3139
- <div class="toast__left">
3140
- <span class="toast__icon" aria-hidden="true">
3141
- ${Ze[this.variant]}
3142
- </span>
3143
- <span class="toast__message">${this.message}</span>
3144
- </div>
3145
- <div class="toast__right">
3146
- ${this.action ? l`
3147
- <button
3148
- class="toast__action"
3149
- type="button"
3150
- @click=${this.handleAction}
3151
- >
3152
- ${this.action}
3153
- </button>
3154
- ` : c}
3155
- <button
3156
- class="toast__close"
3157
- @click=${() => this.dismiss()}
3158
- aria-label="Close"
3159
- >
3160
- &times;
3161
- </button>
3162
- </div>
3163
- </div>
3164
- `;
3165
- }
3166
- };
3167
- S.styles = qe;
3168
- V([
3169
- i({ reflect: !0 })
3170
- ], S.prototype, "variant", 2);
3171
- V([
3172
- i()
3173
- ], S.prototype, "message", 2);
3174
- V([
3175
- i()
3176
- ], S.prototype, "action", 2);
3177
- V([
3178
- i({ type: Number })
3179
- ], S.prototype, "duration", 2);
3180
- S = V([
3181
- b("reke-toast")
3182
- ], S);
3183
- const er = [
3184
- f,
3185
- u`
3186
- :host {
3187
- display: inline-block;
3188
- }
3189
-
3190
- :host([disabled]) {
3191
- pointer-events: none;
3192
- opacity: 0.5;
3193
- }
3194
-
3195
- .chip {
3196
- display: inline-flex;
3197
- align-items: center;
3198
- gap: 6px;
3199
- padding: 3px 10px;
3200
- font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
3201
- font-size: var(--reke-font-size-2xs, 11px);
3202
- font-weight: var(--reke-font-weight-medium, 500);
3203
- line-height: 1.4;
3204
- border: 1px solid var(--reke-color-border-subtle, #1F1F1F);
3205
- border-radius: var(--reke-radius, 4px);
3206
- background: transparent;
3207
- color: var(--reke-color-text-muted, #525252);
3208
- cursor: pointer;
3209
- transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
3210
- box-sizing: border-box;
3211
- white-space: nowrap;
3212
- }
3213
-
3214
- .chip:focus-visible {
3215
- outline: 2px solid var(--reke-color-primary, #22C55E);
3216
- outline-offset: 2px;
3217
- }
3218
-
3219
- .chip:hover:not(:disabled) {
3220
- color: var(--reke-color-text, #E5E5E5);
3221
- border-color: var(--reke-color-border, #252525);
3222
- }
3223
-
3224
- /* === Active states by color === */
3225
-
3226
- .chip--primary.chip--active {
3227
- border-color: var(--reke-color-primary, #22C55E);
3228
- background: color-mix(in srgb, var(--reke-color-primary, #22C55E) 10%, black);
3229
- color: var(--reke-color-primary, #22C55E);
3230
- }
3231
-
3232
- .chip--secondary.chip--active {
3233
- border-color: var(--reke-color-secondary, #3B82F6);
3234
- background: color-mix(in srgb, var(--reke-color-secondary, #3B82F6) 10%, black);
3235
- color: var(--reke-color-secondary, #3B82F6);
3236
- }
3237
-
3238
- .chip--danger.chip--active {
3239
- border-color: var(--reke-color-danger, #EF4444);
3240
- background: color-mix(in srgb, var(--reke-color-danger, #EF4444) 10%, black);
3241
- color: var(--reke-color-danger, #EF4444);
3242
- }
3243
-
3244
- .chip--warning.chip--active {
3245
- border-color: var(--reke-color-warning, #F59E0B);
3246
- background: color-mix(in srgb, var(--reke-color-warning, #F59E0B) 10%, black);
3247
- color: var(--reke-color-warning, #F59E0B);
3248
- }
3249
-
3250
- /* === Dismiss button === */
3251
-
3252
- .chip__dismiss {
3253
- display: inline-flex;
3254
- align-items: center;
3255
- justify-content: center;
3256
- width: 12px;
3257
- height: 12px;
3258
- border-radius: 2px;
3259
- cursor: pointer;
3260
- opacity: 0.6;
3261
- transition: opacity 0.15s ease;
3262
- }
3263
-
3264
- .chip__dismiss:hover {
3265
- opacity: 1;
3266
- }
3267
-
3268
- .chip__dismiss svg {
3269
- width: 10px;
3270
- height: 10px;
3271
- stroke: currentColor;
3272
- stroke-width: 2.5;
3273
- stroke-linecap: round;
3274
- fill: none;
3275
- }
3276
- `
3277
- ];
3278
- var rr = Object.defineProperty, tr = Object.getOwnPropertyDescriptor, U = (e, r, a, o) => {
3279
- for (var t = o > 1 ? void 0 : o ? tr(r, a) : r, s = e.length - 1, n; s >= 0; s--)
3280
- (n = e[s]) && (t = (o ? n(r, a, t) : n(t)) || t);
3281
- return o && t && rr(r, a, t), t;
3282
- };
3283
- let j = class extends g {
3284
- constructor() {
3285
- super(...arguments), this.color = "primary", this.active = !1, this.dismissible = !1, this.disabled = !1;
3286
- }
3287
- _handleClick() {
3288
- this.disabled || this.emit("reke-click");
3289
- }
3290
- _handleDismiss(e) {
3291
- e.stopPropagation(), !this.disabled && this.emit("reke-dismiss");
3292
- }
3293
- render() {
3294
- const e = {
3295
- chip: !0,
3296
- [`chip--${this.color}`]: !0,
3297
- "chip--active": this.active
3298
- };
3299
- return l`
3300
- <button
3301
- part="chip"
3302
- class=${p(e)}
3303
- type="button"
3304
- ?disabled=${this.disabled}
3305
- aria-pressed=${this.active}
3306
- @click=${this._handleClick}
3307
- >
3308
- <slot></slot>
3309
- ${this.dismissible ? l`
3310
- <span
3311
- part="dismiss"
3312
- class="chip__dismiss"
3313
- role="button"
3314
- aria-label="Dismiss"
3315
- @click=${this._handleDismiss}
3316
- >
3317
- <svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
3318
- </span>
3319
- ` : c}
3320
- </button>
3321
- `;
3322
- }
3323
- };
3324
- j.styles = er;
3325
- U([
3326
- i({ reflect: !0 })
3327
- ], j.prototype, "color", 2);
3328
- U([
3329
- i({ type: Boolean, reflect: !0 })
3330
- ], j.prototype, "active", 2);
3331
- U([
3332
- i({ type: Boolean, reflect: !0 })
3333
- ], j.prototype, "dismissible", 2);
3334
- U([
3335
- i({ type: Boolean, reflect: !0 })
3336
- ], j.prototype, "disabled", 2);
3337
- j = U([
3338
- b("reke-chip")
3339
- ], j);
3340
- export {
3341
- Y as R,
3342
- L as a,
3343
- F as b,
3344
- O as c,
3345
- A as d,
3346
- j as e,
3347
- d as f,
3348
- P as g,
3349
- g as h,
3350
- y as i,
3351
- _ as j,
3352
- w as k,
3353
- h as l,
3354
- $ as m,
3355
- S as n,
3356
- T as o,
3357
- M as p
3358
- };