reke-ui 0.1.1 → 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.
- package/README.md +2 -0
- package/custom-elements.json +101 -1
- package/dist/components/reke-alert/reke-alert.js +53 -0
- package/dist/components/reke-alert/reke-alert.styles.d.ts.map +1 -1
- package/dist/components/reke-alert/reke-alert.styles.js +106 -0
- package/dist/components/reke-badge/reke-badge.d.ts +4 -2
- package/dist/components/reke-badge/reke-badge.d.ts.map +1 -1
- package/dist/components/reke-badge/reke-badge.js +44 -0
- package/dist/components/reke-badge/reke-badge.styles.d.ts.map +1 -1
- package/dist/components/reke-badge/reke-badge.styles.js +95 -0
- package/dist/components/reke-button/reke-button.js +64 -0
- package/dist/components/reke-button/reke-button.styles.d.ts.map +1 -1
- package/dist/components/reke-button/reke-button.styles.js +229 -0
- package/dist/components/reke-card/reke-card.d.ts +7 -0
- package/dist/components/reke-card/reke-card.d.ts.map +1 -1
- package/dist/components/reke-card/reke-card.js +70 -0
- package/dist/components/reke-card/reke-card.styles.d.ts.map +1 -1
- package/dist/components/reke-card/reke-card.styles.js +150 -0
- package/dist/components/reke-checkbox/reke-checkbox.js +64 -0
- package/dist/components/reke-checkbox/reke-checkbox.styles.js +81 -0
- package/dist/components/reke-chip/reke-chip.js +70 -0
- package/dist/components/reke-chip/reke-chip.styles.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.styles.js +125 -0
- package/dist/components/reke-date-range/reke-date-range.js +346 -0
- package/dist/components/reke-date-range/reke-date-range.styles.js +322 -0
- package/dist/components/reke-dialog/reke-dialog.js +90 -0
- package/dist/components/reke-dialog/reke-dialog.styles.js +134 -0
- package/dist/components/reke-file-upload/reke-file-upload.js +108 -0
- package/dist/components/reke-file-upload/reke-file-upload.styles.js +107 -0
- package/dist/components/reke-input/reke-input.js +73 -0
- package/dist/components/reke-input/reke-input.styles.js +80 -0
- package/dist/components/reke-select/reke-select.js +112 -0
- package/dist/components/reke-select/reke-select.styles.js +122 -0
- package/dist/components/reke-table/reke-table.d.ts +21 -1
- package/dist/components/reke-table/reke-table.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.js +191 -0
- package/dist/components/reke-table/reke-table.styles.js +207 -0
- package/dist/components/reke-textarea/reke-textarea.js +73 -0
- package/dist/components/reke-textarea/reke-textarea.styles.js +76 -0
- package/dist/components/reke-toast/reke-toast.js +92 -0
- package/dist/components/reke-toast/reke-toast.styles.d.ts.map +1 -1
- package/dist/components/reke-toast/reke-toast.styles.js +182 -0
- package/dist/components/reke-toggle/reke-toggle.js +57 -0
- package/dist/components/reke-toggle/reke-toggle.styles.js +71 -0
- package/dist/components/reke-tooltip/reke-tooltip.js +67 -0
- package/dist/components/reke-tooltip/reke-tooltip.styles.js +67 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -0
- package/dist/react.js +79 -64
- package/dist/shared/base-element.js +16 -0
- package/dist/shared/tailwind-styles.js +6 -0
- package/dist/shared/tailwind.css.js +4 -0
- package/dist/tokens/reke-tokens.css +23 -0
- package/package.json +4 -4
- package/dist/reke-chip-DexKxhxn.js +0 -3358
- package/dist/reke-ui.js +0 -20
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A Web Component library built with [Lit 3](https://lit.dev). Ships with dark and light themes. Framework-agnostic — works with Vue, React, Angular, Svelte, or vanilla JS.
|
|
4
4
|
|
|
5
|
+
**[Documentation](https://jreque.github.io/reke-ui/)** · **[Storybook](https://jreque.github.io/reke-ui/storybook/)**
|
|
6
|
+
|
|
5
7
|
## Components
|
|
6
8
|
|
|
7
9
|
| Component | Tag | Description |
|
package/custom-elements.json
CHANGED
|
@@ -195,6 +195,16 @@
|
|
|
195
195
|
"default": "'md'",
|
|
196
196
|
"attribute": "size",
|
|
197
197
|
"reflects": true
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"kind": "field",
|
|
201
|
+
"name": "shape",
|
|
202
|
+
"type": {
|
|
203
|
+
"text": "BadgeShape"
|
|
204
|
+
},
|
|
205
|
+
"default": "'pill'",
|
|
206
|
+
"attribute": "shape",
|
|
207
|
+
"reflects": true
|
|
198
208
|
}
|
|
199
209
|
],
|
|
200
210
|
"attributes": [
|
|
@@ -213,6 +223,14 @@
|
|
|
213
223
|
},
|
|
214
224
|
"default": "'md'",
|
|
215
225
|
"fieldName": "size"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"name": "shape",
|
|
229
|
+
"type": {
|
|
230
|
+
"text": "BadgeShape"
|
|
231
|
+
},
|
|
232
|
+
"default": "'pill'",
|
|
233
|
+
"fieldName": "shape"
|
|
216
234
|
}
|
|
217
235
|
],
|
|
218
236
|
"superclass": {
|
|
@@ -464,6 +482,14 @@
|
|
|
464
482
|
"description": "Card border radius.",
|
|
465
483
|
"name": "--reke-radius",
|
|
466
484
|
"default": "4px"
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"description": "Shadow applied on hover when interactive.",
|
|
488
|
+
"name": "--reke-shadow-lift"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
"description": "Glow shadow for accent=primary on hover.",
|
|
492
|
+
"name": "--reke-shadow-glow-primary"
|
|
467
493
|
}
|
|
468
494
|
],
|
|
469
495
|
"slots": [
|
|
@@ -501,6 +527,28 @@
|
|
|
501
527
|
"attribute": "padding",
|
|
502
528
|
"reflects": true
|
|
503
529
|
},
|
|
530
|
+
{
|
|
531
|
+
"kind": "field",
|
|
532
|
+
"name": "interactive",
|
|
533
|
+
"type": {
|
|
534
|
+
"text": "boolean"
|
|
535
|
+
},
|
|
536
|
+
"default": "false",
|
|
537
|
+
"description": "Enables hover lift + border glow effect.",
|
|
538
|
+
"attribute": "interactive",
|
|
539
|
+
"reflects": true
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"kind": "field",
|
|
543
|
+
"name": "accent",
|
|
544
|
+
"type": {
|
|
545
|
+
"text": "CardAccent"
|
|
546
|
+
},
|
|
547
|
+
"default": "'none'",
|
|
548
|
+
"description": "Accent color shown on hover border (requires interactive=true).",
|
|
549
|
+
"attribute": "accent",
|
|
550
|
+
"reflects": true
|
|
551
|
+
},
|
|
504
552
|
{
|
|
505
553
|
"kind": "field",
|
|
506
554
|
"name": "_hasHeader",
|
|
@@ -555,6 +603,24 @@
|
|
|
555
603
|
},
|
|
556
604
|
"default": "'md'",
|
|
557
605
|
"fieldName": "padding"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"name": "interactive",
|
|
609
|
+
"type": {
|
|
610
|
+
"text": "boolean"
|
|
611
|
+
},
|
|
612
|
+
"default": "false",
|
|
613
|
+
"description": "Enables hover lift + border glow effect.",
|
|
614
|
+
"fieldName": "interactive"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
"name": "accent",
|
|
618
|
+
"type": {
|
|
619
|
+
"text": "CardAccent"
|
|
620
|
+
},
|
|
621
|
+
"default": "'none'",
|
|
622
|
+
"description": "Accent color shown on hover border (requires interactive=true).",
|
|
623
|
+
"fieldName": "accent"
|
|
558
624
|
}
|
|
559
625
|
],
|
|
560
626
|
"superclass": {
|
|
@@ -2392,7 +2458,7 @@
|
|
|
2392
2458
|
"default": "#E5E5E5"
|
|
2393
2459
|
},
|
|
2394
2460
|
{
|
|
2395
|
-
"description": "Header text color.",
|
|
2461
|
+
"description": "Header text color. Props: - `expandedRowRender`: Lit-based expand render. Receives `(row, index)` → TemplateResult. - `expandedRowElement`: Framework-agnostic expand render. Receives `(host, row, index)` — mount any framework. Return cleanup or void.",
|
|
2396
2462
|
"name": "--reke-color-text-muted",
|
|
2397
2463
|
"default": "#525252"
|
|
2398
2464
|
}
|
|
@@ -2549,6 +2615,15 @@
|
|
|
2549
2615
|
"default": "null",
|
|
2550
2616
|
"description": "When set, rows become expandable with a chevron toggle."
|
|
2551
2617
|
},
|
|
2618
|
+
{
|
|
2619
|
+
"kind": "field",
|
|
2620
|
+
"name": "expandedRowElement",
|
|
2621
|
+
"type": {
|
|
2622
|
+
"text": "((host: HTMLElement, row: TableRow, index: number) => (() => void) | void) | null"
|
|
2623
|
+
},
|
|
2624
|
+
"default": "null",
|
|
2625
|
+
"description": "Framework-agnostic alternative to expandedRowRender.\nReceives an HTMLElement host — mount any framework's content into it.\nReturn a cleanup function (called on collapse) or void."
|
|
2626
|
+
},
|
|
2552
2627
|
{
|
|
2553
2628
|
"kind": "field",
|
|
2554
2629
|
"name": "expandedRows",
|
|
@@ -2558,6 +2633,12 @@
|
|
|
2558
2633
|
"default": "new Set()",
|
|
2559
2634
|
"description": "Set of row indices currently expanded."
|
|
2560
2635
|
},
|
|
2636
|
+
{
|
|
2637
|
+
"kind": "field",
|
|
2638
|
+
"name": "_expandCleanups",
|
|
2639
|
+
"privacy": "private",
|
|
2640
|
+
"default": "new Map<number, () => void>()"
|
|
2641
|
+
},
|
|
2561
2642
|
{
|
|
2562
2643
|
"kind": "field",
|
|
2563
2644
|
"name": "_hasToolbar",
|
|
@@ -2683,6 +2764,25 @@
|
|
|
2683
2764
|
}
|
|
2684
2765
|
}
|
|
2685
2766
|
]
|
|
2767
|
+
},
|
|
2768
|
+
{
|
|
2769
|
+
"kind": "method",
|
|
2770
|
+
"name": "_renderExpandedElement",
|
|
2771
|
+
"privacy": "private",
|
|
2772
|
+
"parameters": [
|
|
2773
|
+
{
|
|
2774
|
+
"name": "row",
|
|
2775
|
+
"type": {
|
|
2776
|
+
"text": "TableRow"
|
|
2777
|
+
}
|
|
2778
|
+
},
|
|
2779
|
+
{
|
|
2780
|
+
"name": "i",
|
|
2781
|
+
"type": {
|
|
2782
|
+
"text": "number"
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
]
|
|
2686
2786
|
}
|
|
2687
2787
|
],
|
|
2688
2788
|
"events": [
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { nothing as c, html as p } from "lit";
|
|
2
|
+
import { property as m, customElement as f } from "lit/decorators.js";
|
|
3
|
+
import { classMap as u } from "lit/directives/class-map.js";
|
|
4
|
+
import { RekeElement as h } from "../../shared/base-element.js";
|
|
5
|
+
import { styles as v } from "./reke-alert.styles.js";
|
|
6
|
+
var _ = Object.defineProperty, b = Object.getOwnPropertyDescriptor, n = (r, s, o, l) => {
|
|
7
|
+
for (var e = l > 1 ? void 0 : l ? b(s, o) : s, a = r.length - 1, i; a >= 0; a--)
|
|
8
|
+
(i = r[a]) && (e = (l ? i(s, o, e) : i(e)) || e);
|
|
9
|
+
return l && e && _(s, o, e), e;
|
|
10
|
+
};
|
|
11
|
+
let t = class extends h {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.variant = "info", this.dismissible = !1;
|
|
14
|
+
}
|
|
15
|
+
handleClose() {
|
|
16
|
+
this.emit("reke-close"), this.remove();
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
const r = {
|
|
20
|
+
alert: !0,
|
|
21
|
+
[`alert--${this.variant}`]: !0
|
|
22
|
+
};
|
|
23
|
+
return p`
|
|
24
|
+
<div part="alert" class=${u(r)} role="alert">
|
|
25
|
+
<span class="alert__content">
|
|
26
|
+
<slot></slot>
|
|
27
|
+
</span>
|
|
28
|
+
${this.dismissible ? p`
|
|
29
|
+
<button
|
|
30
|
+
class="alert__close"
|
|
31
|
+
@click=${this.handleClose}
|
|
32
|
+
aria-label="Close"
|
|
33
|
+
>
|
|
34
|
+
×
|
|
35
|
+
</button>
|
|
36
|
+
` : c}
|
|
37
|
+
</div>
|
|
38
|
+
`;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
t.styles = v;
|
|
42
|
+
n([
|
|
43
|
+
m({ reflect: !0 })
|
|
44
|
+
], t.prototype, "variant", 2);
|
|
45
|
+
n([
|
|
46
|
+
m({ type: Boolean, reflect: !0 })
|
|
47
|
+
], t.prototype, "dismissible", 2);
|
|
48
|
+
t = n([
|
|
49
|
+
f("reke-alert")
|
|
50
|
+
], t);
|
|
51
|
+
export {
|
|
52
|
+
t as RekeAlert
|
|
53
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-alert.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-alert/reke-alert.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"reke-alert.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-alert/reke-alert.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,2BAoGlB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { tailwindStyles as r } from "../../shared/tailwind-styles.js";
|
|
2
|
+
import { css as o } from "lit";
|
|
3
|
+
const n = [
|
|
4
|
+
r,
|
|
5
|
+
o`
|
|
6
|
+
:host {
|
|
7
|
+
display: block;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.alert {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: var(--reke-space-sm, 12px);
|
|
14
|
+
padding: 12px var(--reke-space-md, 16px);
|
|
15
|
+
border-radius: var(--reke-radius, 4px);
|
|
16
|
+
border: none;
|
|
17
|
+
border-left: 3px solid;
|
|
18
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
19
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
20
|
+
line-height: 1.5;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* === Variants === */
|
|
25
|
+
|
|
26
|
+
.alert--success {
|
|
27
|
+
background-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 10%, transparent);
|
|
28
|
+
border-color: var(--reke-color-primary, #22C55E);
|
|
29
|
+
color: var(--reke-color-primary, #22C55E);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.alert--error {
|
|
33
|
+
background-color: color-mix(in srgb, var(--reke-color-danger, #EF4444) 10%, transparent);
|
|
34
|
+
border-color: var(--reke-color-danger, #EF4444);
|
|
35
|
+
color: var(--reke-color-danger, #EF4444);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.alert--warning {
|
|
39
|
+
background-color: color-mix(in srgb, var(--reke-color-warning, #F59E0B) 10%, transparent);
|
|
40
|
+
border-color: var(--reke-color-warning, #F59E0B);
|
|
41
|
+
color: var(--reke-color-warning, #F59E0B);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.alert--info {
|
|
45
|
+
background-color: color-mix(in srgb, var(--reke-color-secondary, #3B82F6) 10%, transparent);
|
|
46
|
+
border-color: var(--reke-color-secondary, #3B82F6);
|
|
47
|
+
color: var(--reke-color-secondary, #3B82F6);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* === Content === */
|
|
51
|
+
|
|
52
|
+
.alert__content {
|
|
53
|
+
flex: 1;
|
|
54
|
+
min-width: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* === Dismissible === */
|
|
58
|
+
|
|
59
|
+
.alert__close {
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: center;
|
|
64
|
+
width: 20px;
|
|
65
|
+
height: 20px;
|
|
66
|
+
background: transparent;
|
|
67
|
+
border: none;
|
|
68
|
+
color: currentColor;
|
|
69
|
+
opacity: 0.5;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
padding: 0;
|
|
72
|
+
font-size: 16px;
|
|
73
|
+
line-height: 1;
|
|
74
|
+
transition: opacity 0.15s ease;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.alert__close:hover {
|
|
78
|
+
opacity: 1;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.alert__close:focus-visible {
|
|
82
|
+
outline: 2px solid currentColor;
|
|
83
|
+
outline-offset: 2px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* === Enter animation === */
|
|
87
|
+
|
|
88
|
+
:host {
|
|
89
|
+
animation: alert-in var(--reke-transition-normal, 0.2s ease) both;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@keyframes alert-in {
|
|
93
|
+
from {
|
|
94
|
+
opacity: 0;
|
|
95
|
+
transform: translateY(-4px);
|
|
96
|
+
}
|
|
97
|
+
to {
|
|
98
|
+
opacity: 1;
|
|
99
|
+
transform: translateY(0);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
`
|
|
103
|
+
];
|
|
104
|
+
export {
|
|
105
|
+
n as styles
|
|
106
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RekeElement } from '../../shared/base-element.js';
|
|
2
|
-
export type BadgeVariant = 'default' | 'primary' | 'secondary' | 'danger' | 'warning' | 'success';
|
|
3
|
-
export type BadgeSize = 'sm' | 'md';
|
|
2
|
+
export type BadgeVariant = 'default' | 'primary' | 'secondary' | 'danger' | 'warning' | 'success' | 'outline';
|
|
3
|
+
export type BadgeSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export type BadgeShape = 'pill' | 'square';
|
|
4
5
|
/**
|
|
5
6
|
* @tag reke-badge
|
|
6
7
|
* @summary A badge component for displaying labels, statuses, and counts.
|
|
@@ -19,6 +20,7 @@ export declare class RekeBadge extends RekeElement {
|
|
|
19
20
|
static styles: import("lit").CSSResult[];
|
|
20
21
|
variant: BadgeVariant;
|
|
21
22
|
size: BadgeSize;
|
|
23
|
+
shape: BadgeShape;
|
|
22
24
|
render(): import("lit-html").TemplateResult<1>;
|
|
23
25
|
}
|
|
24
26
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-badge.d.ts","sourceRoot":"","sources":["../../../src/components/reke-badge/reke-badge.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"reke-badge.d.ts","sourceRoot":"","sources":["../../../src/components/reke-badge/reke-badge.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC3C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE3C;;;;;;;;;;;;;GAaG;AACH,qBACa,SAAU,SAAQ,WAAW;IACxC,OAAgB,MAAM,4BAAU;IAGhC,OAAO,EAAE,YAAY,CAAa;IAGlC,IAAI,EAAE,SAAS,CAAQ;IAGvB,KAAK,EAAE,UAAU,CAAU;IAElB,MAAM;CAchB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { html as n } from "lit";
|
|
2
|
+
import { property as m, customElement as u } from "lit/decorators.js";
|
|
3
|
+
import { classMap as f } from "lit/directives/class-map.js";
|
|
4
|
+
import { RekeElement as c } from "../../shared/base-element.js";
|
|
5
|
+
import { styles as h } from "./reke-badge.styles.js";
|
|
6
|
+
var d = Object.defineProperty, v = Object.getOwnPropertyDescriptor, a = (r, s, o, p) => {
|
|
7
|
+
for (var e = p > 1 ? void 0 : p ? v(s, o) : s, l = r.length - 1, i; l >= 0; l--)
|
|
8
|
+
(i = r[l]) && (e = (p ? i(s, o, e) : i(e)) || e);
|
|
9
|
+
return p && e && d(s, o, e), e;
|
|
10
|
+
};
|
|
11
|
+
let t = class extends c {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.variant = "default", this.size = "md", this.shape = "pill";
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
const r = {
|
|
17
|
+
badge: !0,
|
|
18
|
+
[`badge--${this.variant}`]: !0,
|
|
19
|
+
[`badge--${this.size}`]: !0,
|
|
20
|
+
[`badge--${this.shape}`]: !0
|
|
21
|
+
};
|
|
22
|
+
return n`
|
|
23
|
+
<span part="badge" class=${f(r)}>
|
|
24
|
+
<slot></slot>
|
|
25
|
+
</span>
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
t.styles = h;
|
|
30
|
+
a([
|
|
31
|
+
m({ reflect: !0 })
|
|
32
|
+
], t.prototype, "variant", 2);
|
|
33
|
+
a([
|
|
34
|
+
m({ reflect: !0 })
|
|
35
|
+
], t.prototype, "size", 2);
|
|
36
|
+
a([
|
|
37
|
+
m({ reflect: !0 })
|
|
38
|
+
], t.prototype, "shape", 2);
|
|
39
|
+
t = a([
|
|
40
|
+
u("reke-badge")
|
|
41
|
+
], t);
|
|
42
|
+
export {
|
|
43
|
+
t as RekeBadge
|
|
44
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-badge.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-badge/reke-badge.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"reke-badge.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-badge/reke-badge.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,2BAyFlB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { tailwindStyles as r } from "../../shared/tailwind-styles.js";
|
|
2
|
+
import { css as o } from "lit";
|
|
3
|
+
const n = [
|
|
4
|
+
r,
|
|
5
|
+
o`
|
|
6
|
+
:host {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.badge {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
14
|
+
font-weight: var(--reke-font-weight-medium, 500);
|
|
15
|
+
border: 1px solid transparent;
|
|
16
|
+
line-height: 1;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* === Shape === */
|
|
22
|
+
|
|
23
|
+
.badge--pill {
|
|
24
|
+
border-radius: 9999px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.badge--square {
|
|
28
|
+
border-radius: var(--reke-radius, 4px);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* === Sizes === */
|
|
32
|
+
|
|
33
|
+
.badge--sm {
|
|
34
|
+
padding: 2px 8px;
|
|
35
|
+
font-size: 11px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.badge--md {
|
|
39
|
+
padding: 4px 10px;
|
|
40
|
+
font-size: 12px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.badge--lg {
|
|
44
|
+
padding: 5px 14px;
|
|
45
|
+
font-size: 13px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* === Variants === */
|
|
49
|
+
|
|
50
|
+
.badge--default {
|
|
51
|
+
background-color: var(--reke-color-surface, #1A1A1A);
|
|
52
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
53
|
+
border-color: var(--reke-color-border, #252525);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.badge--primary {
|
|
57
|
+
background-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 15%, transparent);
|
|
58
|
+
color: var(--reke-color-primary, #22C55E);
|
|
59
|
+
border-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 30%, transparent);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.badge--secondary {
|
|
63
|
+
background-color: color-mix(in srgb, var(--reke-color-secondary, #3B82F6) 15%, transparent);
|
|
64
|
+
color: var(--reke-color-secondary, #3B82F6);
|
|
65
|
+
border-color: color-mix(in srgb, var(--reke-color-secondary, #3B82F6) 30%, transparent);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.badge--danger {
|
|
69
|
+
background-color: color-mix(in srgb, var(--reke-color-danger, #EF4444) 15%, transparent);
|
|
70
|
+
color: var(--reke-color-danger, #EF4444);
|
|
71
|
+
border-color: color-mix(in srgb, var(--reke-color-danger, #EF4444) 30%, transparent);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.badge--warning {
|
|
75
|
+
background-color: color-mix(in srgb, var(--reke-color-warning, #F59E0B) 15%, transparent);
|
|
76
|
+
color: var(--reke-color-warning, #F59E0B);
|
|
77
|
+
border-color: color-mix(in srgb, var(--reke-color-warning, #F59E0B) 30%, transparent);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.badge--success {
|
|
81
|
+
background-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 15%, transparent);
|
|
82
|
+
color: var(--reke-color-primary, #22C55E);
|
|
83
|
+
border-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 30%, transparent);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.badge--outline {
|
|
87
|
+
background-color: transparent;
|
|
88
|
+
color: var(--reke-color-text-ghost, #737373);
|
|
89
|
+
border-color: var(--reke-color-border, #252525);
|
|
90
|
+
}
|
|
91
|
+
`
|
|
92
|
+
];
|
|
93
|
+
export {
|
|
94
|
+
n as styles
|
|
95
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { nothing as d, html as u } from "lit";
|
|
2
|
+
import { property as a, customElement as c } from "lit/decorators.js";
|
|
3
|
+
import { classMap as h } from "lit/directives/class-map.js";
|
|
4
|
+
import { RekeElement as f } from "../../shared/base-element.js";
|
|
5
|
+
import { styles as m } from "./reke-button.styles.js";
|
|
6
|
+
var b = Object.defineProperty, y = Object.getOwnPropertyDescriptor, r = (t, i, l, o) => {
|
|
7
|
+
for (var e = o > 1 ? void 0 : o ? y(i, l) : i, n = t.length - 1, p; n >= 0; n--)
|
|
8
|
+
(p = t[n]) && (e = (o ? p(i, l, e) : p(e)) || e);
|
|
9
|
+
return o && e && b(i, l, e), e;
|
|
10
|
+
};
|
|
11
|
+
let s = class extends f {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.variant = "primary", this.size = "md", this.disabled = !1, this.loading = !1;
|
|
14
|
+
}
|
|
15
|
+
handleClick(t) {
|
|
16
|
+
if (this.disabled || this.loading) {
|
|
17
|
+
t.preventDefault(), t.stopPropagation();
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
this.emit("reke-click");
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
const t = {
|
|
24
|
+
button: !0,
|
|
25
|
+
[`button--${this.variant}`]: !0,
|
|
26
|
+
[`button--${this.size}`]: !0,
|
|
27
|
+
"button--loading": this.loading
|
|
28
|
+
};
|
|
29
|
+
return u`
|
|
30
|
+
<button
|
|
31
|
+
part="button"
|
|
32
|
+
class=${h(t)}
|
|
33
|
+
?disabled=${this.disabled}
|
|
34
|
+
aria-disabled=${this.disabled || this.loading}
|
|
35
|
+
aria-busy=${this.loading}
|
|
36
|
+
@click=${this.handleClick}
|
|
37
|
+
>
|
|
38
|
+
<span class="spinner" aria-hidden="true"></span>
|
|
39
|
+
${this.variant !== "icon-only" ? u`<slot name="prefix"></slot>` : d}
|
|
40
|
+
<slot></slot>
|
|
41
|
+
${this.variant !== "icon-only" ? u`<slot name="suffix"></slot>` : d}
|
|
42
|
+
</button>
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
s.styles = m;
|
|
47
|
+
r([
|
|
48
|
+
a({ reflect: !0 })
|
|
49
|
+
], s.prototype, "variant", 2);
|
|
50
|
+
r([
|
|
51
|
+
a({ reflect: !0 })
|
|
52
|
+
], s.prototype, "size", 2);
|
|
53
|
+
r([
|
|
54
|
+
a({ type: Boolean, reflect: !0 })
|
|
55
|
+
], s.prototype, "disabled", 2);
|
|
56
|
+
r([
|
|
57
|
+
a({ type: Boolean, reflect: !0 })
|
|
58
|
+
], s.prototype, "loading", 2);
|
|
59
|
+
s = r([
|
|
60
|
+
c("reke-button")
|
|
61
|
+
], s);
|
|
62
|
+
export {
|
|
63
|
+
s as RekeButton
|
|
64
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-button.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-button/reke-button.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"reke-button.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-button/reke-button.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,2BA+NlB,CAAC"}
|