reke-ui 0.1.1 → 0.2.0
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 +23 -0
- package/cli/install-skills.mjs +169 -0
- package/custom-elements.json +472 -128
- package/dist/__type-checks__/no-lit-in-public-types.d.ts +2 -0
- package/dist/__type-checks__/no-lit-in-public-types.d.ts.map +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js +9 -0
- package/dist/components/reke-alert/reke-alert.d.ts.map +1 -1
- package/dist/components/reke-alert/reke-alert.js +45 -0
- package/dist/components/reke-alert/reke-alert.styles.d.ts.map +1 -1
- package/dist/components/reke-alert/reke-alert.styles.js +103 -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 +30 -0
- package/dist/components/reke-badge/reke-badge.styles.d.ts.map +1 -1
- package/dist/components/reke-badge/reke-badge.styles.js +92 -0
- package/dist/components/reke-button/reke-button.d.ts.map +1 -1
- package/dist/components/reke-button/reke-button.js +53 -0
- package/dist/components/reke-button/reke-button.styles.d.ts.map +1 -1
- package/dist/components/reke-button/reke-button.styles.js +226 -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 +50 -0
- package/dist/components/reke-card/reke-card.styles.d.ts.map +1 -1
- package/dist/components/reke-card/reke-card.styles.js +147 -0
- package/dist/components/reke-checkbox/reke-checkbox.js +57 -0
- package/dist/components/reke-checkbox/reke-checkbox.styles.d.ts.map +1 -1
- package/dist/components/reke-checkbox/reke-checkbox.styles.js +79 -0
- package/dist/components/reke-chip/reke-chip.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.js +62 -0
- package/dist/components/reke-chip/reke-chip.styles.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.styles.js +128 -0
- package/dist/components/reke-date-range/reke-date-range.d.ts.map +1 -1
- package/dist/components/reke-date-range/reke-date-range.js +326 -0
- package/dist/components/reke-date-range/reke-date-range.styles.d.ts.map +1 -1
- package/dist/components/reke-date-range/reke-date-range.styles.js +335 -0
- package/dist/components/reke-dialog/reke-dialog.d.ts.map +1 -1
- package/dist/components/reke-dialog/reke-dialog.js +77 -0
- package/dist/components/reke-dialog/reke-dialog.styles.d.ts.map +1 -1
- package/dist/components/reke-dialog/reke-dialog.styles.js +132 -0
- package/dist/components/reke-file-upload/reke-file-upload.d.ts.map +1 -1
- package/dist/components/reke-file-upload/reke-file-upload.js +84 -0
- package/dist/components/reke-file-upload/reke-file-upload.styles.js +104 -0
- package/dist/components/reke-input/reke-input.js +54 -0
- package/dist/components/reke-input/reke-input.styles.d.ts.map +1 -1
- package/dist/components/reke-input/reke-input.styles.js +78 -0
- package/dist/components/reke-select/reke-select.d.ts.map +1 -1
- package/dist/components/reke-select/reke-select.js +89 -0
- package/dist/components/reke-select/reke-select.styles.d.ts.map +1 -1
- package/dist/components/reke-select/reke-select.styles.js +120 -0
- package/dist/components/reke-table/reke-table.d.ts +144 -13
- package/dist/components/reke-table/reke-table.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.js +291 -0
- package/dist/components/reke-table/reke-table.styles.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.styles.js +265 -0
- package/dist/components/reke-textarea/reke-textarea.js +54 -0
- package/dist/components/reke-textarea/reke-textarea.styles.js +73 -0
- package/dist/components/reke-toast/reke-toast.d.ts.map +1 -1
- package/dist/components/reke-toast/reke-toast.js +74 -0
- package/dist/components/reke-toast/reke-toast.styles.d.ts.map +1 -1
- package/dist/components/reke-toast/reke-toast.styles.js +183 -0
- package/dist/components/reke-toggle/reke-toggle.js +50 -0
- package/dist/components/reke-toggle/reke-toggle.styles.js +68 -0
- package/dist/components/reke-tooltip/reke-tooltip.js +51 -0
- package/dist/components/reke-tooltip/reke-tooltip.styles.js +64 -0
- package/dist/index.d.ts +23 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -0
- package/dist/node_modules/lit/directives/ref.js +1 -0
- package/dist/node_modules/lit-html/async-directive.js +55 -0
- package/dist/node_modules/lit-html/directive-helpers.js +5 -0
- package/dist/node_modules/lit-html/directive.js +28 -0
- package/dist/node_modules/lit-html/directives/ref.js +30 -0
- package/dist/node_modules/lit-html/lit-html.js +234 -0
- package/dist/react-bridge/table.d.ts +58 -0
- package/dist/react-bridge/table.d.ts.map +1 -0
- package/dist/react-bridge/table.js +115 -0
- package/dist/react.d.ts +12 -26
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +111 -132
- package/dist/shared/base-element.js +14 -0
- package/dist/shared/tailwind-styles.js +6 -0
- package/dist/shared/tailwind.js +4 -0
- package/dist/tokens/reke-tokens.css +70 -0
- package/package.json +43 -23
- package/dist/reke-chip-DexKxhxn.js +0 -3358
- package/dist/reke-ui.js +0 -20
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { tailwindStyles as e } from "../../shared/tailwind-styles.js";
|
|
2
|
+
import { css as t } from "lit";
|
|
3
|
+
//#region src/components/reke-table/reke-table.styles.ts
|
|
4
|
+
var n = [e, t`
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* === Container (wraps toolbar + table + footer) === */
|
|
10
|
+
|
|
11
|
+
.table-container {
|
|
12
|
+
border: 1px solid var(--reke-color-border, #252525);
|
|
13
|
+
border-radius: var(--reke-radius, 4px);
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.table-wrapper {
|
|
18
|
+
overflow-x: auto;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.table {
|
|
22
|
+
width: 100%;
|
|
23
|
+
border-collapse: collapse;
|
|
24
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
25
|
+
font-size: 13px;
|
|
26
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
27
|
+
background: var(--reke-color-surface, #1A1A1A);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* === Toolbar === */
|
|
31
|
+
|
|
32
|
+
.table-toolbar {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 8px;
|
|
36
|
+
padding: 12px 16px;
|
|
37
|
+
border-bottom: 1px solid var(--reke-color-border, #252525);
|
|
38
|
+
background: var(--reke-color-surface, #1A1A1A);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* === Footer === */
|
|
42
|
+
|
|
43
|
+
.table-footer {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: space-between;
|
|
47
|
+
padding: 12px 16px;
|
|
48
|
+
border-top: 1px solid var(--reke-color-border, #252525);
|
|
49
|
+
background: var(--reke-color-surface, #1A1A1A);
|
|
50
|
+
font-size: 12px;
|
|
51
|
+
color: var(--reke-color-text-muted, #525252);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* === Header === */
|
|
55
|
+
|
|
56
|
+
thead {
|
|
57
|
+
background: var(--reke-color-surface, #1A1A1A);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.header-cell {
|
|
61
|
+
padding: 12px 16px;
|
|
62
|
+
font-size: 11px;
|
|
63
|
+
font-weight: 600;
|
|
64
|
+
text-transform: uppercase;
|
|
65
|
+
letter-spacing: 0.05em;
|
|
66
|
+
color: var(--reke-color-text-muted, #525252);
|
|
67
|
+
border-bottom: 1px solid var(--reke-color-border, #252525);
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
user-select: none;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.header-cell--no-sort {
|
|
74
|
+
cursor: default;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.header-cell[data-align='left'] {
|
|
78
|
+
text-align: left;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.header-cell[data-align='center'] {
|
|
82
|
+
text-align: center;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.header-cell[data-align='right'] {
|
|
86
|
+
text-align: right;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.header-cell:hover {
|
|
90
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.header-cell--no-sort:hover {
|
|
94
|
+
color: var(--reke-color-text-muted, #525252);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.header-cell--sorted {
|
|
98
|
+
color: var(--reke-color-primary, #22C55E);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.header-content {
|
|
102
|
+
display: inline-flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
gap: 4px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.sort-indicator {
|
|
108
|
+
font-size: 10px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* === Body === */
|
|
112
|
+
|
|
113
|
+
.row {
|
|
114
|
+
border-bottom: 1px solid var(--reke-color-border, #252525);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.row:last-child {
|
|
118
|
+
border-bottom: none;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.row--expanded {
|
|
122
|
+
border-bottom: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.cell {
|
|
126
|
+
padding: 12px 16px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.cell[data-align='left'] {
|
|
130
|
+
text-align: left;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.cell[data-align='center'] {
|
|
134
|
+
text-align: center;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.cell[data-align='right'] {
|
|
138
|
+
text-align: right;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.cell--empty {
|
|
142
|
+
text-align: center;
|
|
143
|
+
color: var(--reke-color-text-muted, #525252);
|
|
144
|
+
padding: 24px 16px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* === Expand toggle column (opt-in via expandable prop) === */
|
|
148
|
+
|
|
149
|
+
.expand-toggle-header-cell {
|
|
150
|
+
width: 40px;
|
|
151
|
+
padding: 12px 8px;
|
|
152
|
+
border-bottom: 1px solid var(--reke-color-border, #252525);
|
|
153
|
+
background: var(--reke-color-surface, #1A1A1A);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.expand-toggle-cell {
|
|
157
|
+
width: 40px;
|
|
158
|
+
padding: 8px 4px 8px 8px;
|
|
159
|
+
text-align: center;
|
|
160
|
+
vertical-align: middle;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.expand-toggle-button {
|
|
164
|
+
display: inline-flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
justify-content: center;
|
|
167
|
+
width: 24px;
|
|
168
|
+
height: 24px;
|
|
169
|
+
padding: 0;
|
|
170
|
+
background: transparent;
|
|
171
|
+
border: none;
|
|
172
|
+
border-radius: var(--reke-radius, 4px);
|
|
173
|
+
color: var(--reke-color-text-muted, #525252);
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
font: inherit;
|
|
176
|
+
line-height: 1;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.expand-toggle-button:hover {
|
|
180
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
181
|
+
background: color-mix(in srgb, var(--reke-color-surface, #1A1A1A) 75%, var(--reke-color-border, #252525));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.expand-toggle-button:focus-visible {
|
|
185
|
+
outline: 2px solid var(--reke-color-primary, #22C55E);
|
|
186
|
+
outline-offset: 2px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.expand-toggle-chevron {
|
|
190
|
+
display: inline-block;
|
|
191
|
+
font-size: 10px;
|
|
192
|
+
transition: transform 120ms ease;
|
|
193
|
+
transform: rotate(0deg);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.expand-toggle-button--expanded .expand-toggle-chevron {
|
|
197
|
+
transform: rotate(90deg);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.table--dense .expand-toggle-header-cell {
|
|
201
|
+
padding: 8px 6px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.table--dense .expand-toggle-cell {
|
|
205
|
+
padding: 4px 4px 4px 6px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/* === Expanded row === */
|
|
209
|
+
|
|
210
|
+
.expand-row {
|
|
211
|
+
background: var(--reke-color-surface, #1A1A1A);
|
|
212
|
+
border-bottom: 1px solid var(--reke-color-border, #252525);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.expand-row:last-child {
|
|
216
|
+
border-bottom: none;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.expand-content {
|
|
220
|
+
padding: 0 16px 16px 16px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* === Modifiers === */
|
|
224
|
+
|
|
225
|
+
.table--striped .row--even {
|
|
226
|
+
background: color-mix(in srgb, var(--reke-color-surface, #1A1A1A) 85%, var(--reke-color-border, #252525));
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.table--hoverable .row:hover {
|
|
230
|
+
background: color-mix(in srgb, var(--reke-color-surface, #1A1A1A) 75%, var(--reke-color-border, #252525));
|
|
231
|
+
cursor: pointer;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.table--dense .header-cell {
|
|
235
|
+
padding: 8px 12px;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.table--dense .cell {
|
|
239
|
+
padding: 6px 12px;
|
|
240
|
+
font-size: 12px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.table--dense .expand-content {
|
|
244
|
+
padding: 0 12px 12px 12px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.table--bordered .cell,
|
|
248
|
+
.table--bordered .header-cell {
|
|
249
|
+
border-right: 1px solid var(--reke-color-border, #252525);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.table--bordered .cell:last-child,
|
|
253
|
+
.table--bordered .header-cell:last-child {
|
|
254
|
+
border-right: none;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/* === Borderless (for embedding inside cards/containers) === */
|
|
258
|
+
|
|
259
|
+
:host([borderless]) .table-container {
|
|
260
|
+
border: none;
|
|
261
|
+
border-radius: 0;
|
|
262
|
+
}
|
|
263
|
+
`];
|
|
264
|
+
//#endregion
|
|
265
|
+
export { n as styles };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { RekeElement as e } from "../../shared/base-element.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js";
|
|
3
|
+
import { styles as n } from "./reke-textarea.styles.js";
|
|
4
|
+
import { html as r, nothing as i } from "lit";
|
|
5
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
6
|
+
import { classMap as s } from "lit/directives/class-map.js";
|
|
7
|
+
//#region src/components/reke-textarea/reke-textarea.ts
|
|
8
|
+
var c = class extends e {
|
|
9
|
+
constructor(...e) {
|
|
10
|
+
super(...e), this.value = "", this.placeholder = "", this.rows = 4, this.size = "md", this.disabled = !1, this.error = !1, this.label = "";
|
|
11
|
+
}
|
|
12
|
+
static {
|
|
13
|
+
this.styles = n;
|
|
14
|
+
}
|
|
15
|
+
handleInput(e) {
|
|
16
|
+
let t = e.target;
|
|
17
|
+
this.value = t.value, this.emit("reke-input", { value: this.value });
|
|
18
|
+
}
|
|
19
|
+
handleChange() {
|
|
20
|
+
this.emit("reke-change", { value: this.value });
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
let e = {
|
|
24
|
+
textarea: !0,
|
|
25
|
+
[`textarea--${this.size}`]: !0,
|
|
26
|
+
"textarea--error": this.error
|
|
27
|
+
};
|
|
28
|
+
return r`
|
|
29
|
+
${this.label ? r`<label class="label">${this.label}</label>` : i}
|
|
30
|
+
<textarea
|
|
31
|
+
part="textarea"
|
|
32
|
+
class=${s(e)}
|
|
33
|
+
.value=${this.value}
|
|
34
|
+
placeholder=${this.placeholder || i}
|
|
35
|
+
rows=${this.rows}
|
|
36
|
+
?disabled=${this.disabled}
|
|
37
|
+
aria-disabled=${this.disabled}
|
|
38
|
+
aria-invalid=${this.error}
|
|
39
|
+
aria-label=${this.label || i}
|
|
40
|
+
@input=${this.handleInput}
|
|
41
|
+
@change=${this.handleChange}
|
|
42
|
+
></textarea>
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
t([o()], c.prototype, "value", void 0), t([o()], c.prototype, "placeholder", void 0), t([o({ type: Number })], c.prototype, "rows", void 0), t([o({ reflect: !0 })], c.prototype, "size", void 0), t([o({
|
|
47
|
+
type: Boolean,
|
|
48
|
+
reflect: !0
|
|
49
|
+
})], c.prototype, "disabled", void 0), t([o({
|
|
50
|
+
type: Boolean,
|
|
51
|
+
reflect: !0
|
|
52
|
+
})], c.prototype, "error", void 0), t([o()], c.prototype, "label", void 0), c = t([a("reke-textarea")], c);
|
|
53
|
+
//#endregion
|
|
54
|
+
export { c as RekeTextarea };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { tailwindStyles as e } from "../../shared/tailwind-styles.js";
|
|
2
|
+
import { css as t } from "lit";
|
|
3
|
+
//#region src/components/reke-textarea/reke-textarea.styles.ts
|
|
4
|
+
var n = [e, t`
|
|
5
|
+
:host {
|
|
6
|
+
display: inline-block;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host([disabled]) {
|
|
10
|
+
pointer-events: none;
|
|
11
|
+
opacity: 0.5;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.label {
|
|
15
|
+
display: block;
|
|
16
|
+
margin-bottom: var(--reke-space-2xs, 6px);
|
|
17
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
18
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
19
|
+
color: var(--reke-color-text-label, #8A8A8A);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.textarea {
|
|
23
|
+
display: block;
|
|
24
|
+
width: 100%;
|
|
25
|
+
background-color: var(--reke-color-surface, #1A1A1A);
|
|
26
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
27
|
+
border: 1px solid var(--reke-color-border, #252525);
|
|
28
|
+
border-radius: var(--reke-radius, 4px);
|
|
29
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
outline: none;
|
|
32
|
+
transition: border-color 0.15s ease;
|
|
33
|
+
resize: vertical;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.textarea::placeholder {
|
|
37
|
+
color: var(--reke-color-text-muted, #525252);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.textarea:focus-visible {
|
|
41
|
+
border-color: var(--reke-color-primary, #22C55E);
|
|
42
|
+
outline: 2px solid var(--reke-color-primary, #22C55E);
|
|
43
|
+
outline-offset: -1px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.textarea--error {
|
|
47
|
+
border-color: var(--reke-color-danger, #EF4444);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.textarea--error:focus-visible {
|
|
51
|
+
border-color: var(--reke-color-danger, #EF4444);
|
|
52
|
+
outline-color: var(--reke-color-danger, #EF4444);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* === Sizes === */
|
|
56
|
+
|
|
57
|
+
.textarea--sm {
|
|
58
|
+
padding: var(--reke-space-xs, 8px) var(--reke-space-sm, 12px);
|
|
59
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.textarea--md {
|
|
63
|
+
padding: var(--reke-space-sm, 12px) var(--reke-space-md, 16px);
|
|
64
|
+
font-size: var(--reke-font-size-sm, 13px);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.textarea--lg {
|
|
68
|
+
padding: var(--reke-space-md, 16px) var(--reke-space-lg, 20px);
|
|
69
|
+
font-size: var(--reke-font-size-md, 14px);
|
|
70
|
+
}
|
|
71
|
+
`];
|
|
72
|
+
//#endregion
|
|
73
|
+
export { n as styles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-toast.d.ts","sourceRoot":"","sources":["../../../src/components/reke-toast/reke-toast.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AASpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,SAAU,SAAQ,WAAW;IACxC,OAAgB,MAAM,4BAAU;IAGhC,OAAO,EAAE,YAAY,CAAa;IAGlC,OAAO,SAAM;IAEb,4CAA4C;IAE5C,MAAM,SAAM;IAEZ,8DAA8D;IAE9D,QAAQ,SAAK;IAEb,OAAO,CAAC,MAAM,CAA4C;IAEjD,iBAAiB;IAKjB,oBAAoB;IAK7B,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,UAAU;IAOlB,OAAO;IAKP,OAAO,CAAC,YAAY;IAIX,MAAM;
|
|
1
|
+
{"version":3,"file":"reke-toast.d.ts","sourceRoot":"","sources":["../../../src/components/reke-toast/reke-toast.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAG3D,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AASpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,SAAU,SAAQ,WAAW;IACxC,OAAgB,MAAM,4BAAU;IAGhC,OAAO,EAAE,YAAY,CAAa;IAGlC,OAAO,SAAM;IAEb,4CAA4C;IAE5C,MAAM,SAAM;IAEZ,8DAA8D;IAE9D,QAAQ,SAAK;IAEb,OAAO,CAAC,MAAM,CAA4C;IAEjD,iBAAiB;IAKjB,oBAAoB;IAK7B,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,UAAU;IAOlB,OAAO;IAKP,OAAO,CAAC,YAAY;IAIX,MAAM;CAuChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { RekeElement as e } from "../../shared/base-element.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js";
|
|
3
|
+
import { styles as n } from "./reke-toast.styles.js";
|
|
4
|
+
import { html as r, nothing as i } from "lit";
|
|
5
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
6
|
+
import { classMap as s } from "lit/directives/class-map.js";
|
|
7
|
+
//#region src/components/reke-toast/reke-toast.ts
|
|
8
|
+
var c = {
|
|
9
|
+
success: r`<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>`,
|
|
10
|
+
error: r`<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>`,
|
|
11
|
+
warning: r`<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>`,
|
|
12
|
+
info: r`<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>`
|
|
13
|
+
}, l = class extends e {
|
|
14
|
+
constructor(...e) {
|
|
15
|
+
super(...e), this.variant = "success", this.message = "", this.action = "", this.duration = 0;
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this.styles = n;
|
|
19
|
+
}
|
|
20
|
+
connectedCallback() {
|
|
21
|
+
super.connectedCallback(), this.startTimer();
|
|
22
|
+
}
|
|
23
|
+
disconnectedCallback() {
|
|
24
|
+
super.disconnectedCallback(), this.clearTimer();
|
|
25
|
+
}
|
|
26
|
+
startTimer() {
|
|
27
|
+
this.clearTimer(), this.duration > 0 && (this._timer = setTimeout(() => this.dismiss(), this.duration));
|
|
28
|
+
}
|
|
29
|
+
clearTimer() {
|
|
30
|
+
this._timer !== void 0 && (clearTimeout(this._timer), this._timer = void 0);
|
|
31
|
+
}
|
|
32
|
+
dismiss() {
|
|
33
|
+
this.emit("reke-close"), this.remove();
|
|
34
|
+
}
|
|
35
|
+
handleAction() {
|
|
36
|
+
this.emit("reke-action");
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return r`
|
|
40
|
+
<div part="toast" class=${s({
|
|
41
|
+
toast: !0,
|
|
42
|
+
[`toast--${this.variant}`]: !0
|
|
43
|
+
})} role="status">
|
|
44
|
+
<div class="toast__left">
|
|
45
|
+
<span class="toast__icon" aria-hidden="true">
|
|
46
|
+
${c[this.variant]}
|
|
47
|
+
</span>
|
|
48
|
+
<span class="toast__message">${this.message}</span>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="toast__right">
|
|
51
|
+
${this.action ? r`
|
|
52
|
+
<button
|
|
53
|
+
class="toast__action"
|
|
54
|
+
type="button"
|
|
55
|
+
@click=${this.handleAction}
|
|
56
|
+
>
|
|
57
|
+
${this.action}
|
|
58
|
+
</button>
|
|
59
|
+
` : i}
|
|
60
|
+
<button
|
|
61
|
+
class="toast__close"
|
|
62
|
+
@click=${() => this.dismiss()}
|
|
63
|
+
aria-label="Close"
|
|
64
|
+
>
|
|
65
|
+
×
|
|
66
|
+
</button>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
t([o({ reflect: !0 })], l.prototype, "variant", void 0), t([o()], l.prototype, "message", void 0), t([o()], l.prototype, "action", void 0), t([o({ type: Number })], l.prototype, "duration", void 0), l = t([a("reke-toast")], l);
|
|
73
|
+
//#endregion
|
|
74
|
+
export { l as RekeToast };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-toast.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-toast/reke-toast.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"reke-toast.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-toast/reke-toast.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,2BAoLlB,CAAC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { tailwindStyles as e } from "../../shared/tailwind-styles.js";
|
|
2
|
+
import { css as t } from "lit";
|
|
3
|
+
//#region src/components/reke-toast/reke-toast.styles.ts
|
|
4
|
+
var n = [e, t`
|
|
5
|
+
:host {
|
|
6
|
+
display: block;
|
|
7
|
+
animation: toast-in var(--reke-transition-normal, 0.2s ease) both;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@keyframes toast-in {
|
|
11
|
+
from {
|
|
12
|
+
opacity: 0;
|
|
13
|
+
transform: translateY(8px) scale(0.97);
|
|
14
|
+
}
|
|
15
|
+
to {
|
|
16
|
+
opacity: 1;
|
|
17
|
+
transform: translateY(0) scale(1);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.toast {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
gap: var(--reke-space-sm, 12px);
|
|
26
|
+
padding: 12px 14px;
|
|
27
|
+
border-radius: var(--reke-radius, 4px);
|
|
28
|
+
border: 1px solid var(--reke-color-border, #252525);
|
|
29
|
+
background-color: var(--reke-color-surface, #1A1A1A);
|
|
30
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
31
|
+
font-size: var(--reke-font-size-xs, 12px);
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
transition:
|
|
34
|
+
opacity var(--reke-transition-normal, 0.2s ease),
|
|
35
|
+
transform var(--reke-transition-normal, 0.2s ease);
|
|
36
|
+
/* left accent stripe */
|
|
37
|
+
border-left-width: 3px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.toast--error {
|
|
41
|
+
border-left-color: var(--reke-color-danger, #EF4444);
|
|
42
|
+
background-color: color-mix(in srgb, var(--reke-color-danger, #EF4444) 8%, var(--reke-color-surface, #1A1A1A));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.toast--success {
|
|
46
|
+
border-left-color: var(--reke-color-primary, #22C55E);
|
|
47
|
+
background-color: color-mix(in srgb, var(--reke-color-primary, #22C55E) 8%, var(--reke-color-surface, #1A1A1A));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.toast--warning {
|
|
51
|
+
border-left-color: var(--reke-color-warning, #F59E0B);
|
|
52
|
+
background-color: color-mix(in srgb, var(--reke-color-warning, #F59E0B) 8%, var(--reke-color-surface, #1A1A1A));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.toast--info {
|
|
56
|
+
border-left-color: var(--reke-color-secondary, #3B82F6);
|
|
57
|
+
background-color: color-mix(in srgb, var(--reke-color-secondary, #3B82F6) 8%, var(--reke-color-surface, #1A1A1A));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* === Left section === */
|
|
61
|
+
|
|
62
|
+
.toast__left {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
gap: var(--reke-space-sm, 12px);
|
|
66
|
+
min-width: 0;
|
|
67
|
+
flex: 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.toast__icon {
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
width: 16px;
|
|
73
|
+
height: 16px;
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.toast__icon svg {
|
|
80
|
+
width: 16px;
|
|
81
|
+
height: 16px;
|
|
82
|
+
fill: none;
|
|
83
|
+
stroke: currentColor;
|
|
84
|
+
stroke-width: 2;
|
|
85
|
+
stroke-linecap: round;
|
|
86
|
+
stroke-linejoin: round;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.toast--success .toast__icon {
|
|
90
|
+
color: var(--reke-color-primary, #22C55E);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.toast--error .toast__icon {
|
|
94
|
+
color: var(--reke-color-danger, #EF4444);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.toast--warning .toast__icon {
|
|
98
|
+
color: var(--reke-color-warning, #F59E0B);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.toast--info .toast__icon {
|
|
102
|
+
color: var(--reke-color-secondary, #3B82F6);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.toast__message {
|
|
106
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
107
|
+
white-space: nowrap;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
text-overflow: ellipsis;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* === Right section === */
|
|
113
|
+
|
|
114
|
+
.toast__right {
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
gap: var(--reke-space-xs, 8px);
|
|
118
|
+
flex-shrink: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.toast__action {
|
|
122
|
+
background: transparent;
|
|
123
|
+
border: none;
|
|
124
|
+
font-family: var(--reke-font-mono, 'JetBrains Mono', ui-monospace, monospace);
|
|
125
|
+
font-size: var(--reke-font-size-2xs, 11px);
|
|
126
|
+
font-weight: var(--reke-font-weight-medium, 500);
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
padding: 0;
|
|
129
|
+
transition: opacity 0.15s ease;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.toast--error .toast__action {
|
|
133
|
+
color: var(--reke-color-danger, #EF4444);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.toast--success .toast__action {
|
|
137
|
+
color: var(--reke-color-primary, #22C55E);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.toast--warning .toast__action {
|
|
141
|
+
color: var(--reke-color-warning, #F59E0B);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.toast--info .toast__action {
|
|
145
|
+
color: var(--reke-color-secondary, #3B82F6);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.toast__action:hover {
|
|
149
|
+
opacity: 0.8;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.toast__action:focus-visible {
|
|
153
|
+
outline: 2px solid currentColor;
|
|
154
|
+
outline-offset: 2px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.toast__close {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
width: 24px;
|
|
162
|
+
height: 24px;
|
|
163
|
+
background: transparent;
|
|
164
|
+
border: none;
|
|
165
|
+
color: var(--reke-color-text-muted, #525252);
|
|
166
|
+
cursor: pointer;
|
|
167
|
+
padding: 0;
|
|
168
|
+
font-size: 14px;
|
|
169
|
+
line-height: 1;
|
|
170
|
+
transition: color 0.15s ease;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.toast__close:hover {
|
|
174
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.toast__close:focus-visible {
|
|
178
|
+
outline: 2px solid var(--reke-color-primary, #22C55E);
|
|
179
|
+
outline-offset: 2px;
|
|
180
|
+
}
|
|
181
|
+
`];
|
|
182
|
+
//#endregion
|
|
183
|
+
export { n as styles };
|