elbe-ui 0.2.34 → 0.2.41

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 CHANGED
@@ -28,3 +28,9 @@ so far, it has been optimized for React. It provides a variety of Widgets and th
28
28
  # contribute
29
29
 
30
30
  as of now, this is mainly a personal project for different stuff I built. So things might be a little rough around the edges. If you find any issues or want to help make elbe better, I'd love to hear from you :)
31
+
32
+ ## publish
33
+
34
+ 1. increment `version` number in `package.json`
35
+ 2. run `bun run build`
36
+ 3. run `npm publish`
package/dist/bit/bit.d.ts CHANGED
@@ -4,7 +4,10 @@ export interface BitUseInterface<C, T> {
4
4
  signal: Signal<BitState<T>>;
5
5
  ctrl: C;
6
6
  map: <D>(m: TriMap<T, D>) => D | preact.JSX.Element;
7
- onData: (f: (d: T) => any) => any;
7
+ onData: <D>(f: (d: T) => any, { onLoading, onError, }?: {
8
+ onLoading?: () => any;
9
+ onError?: (e: string) => any;
10
+ }) => any;
8
11
  }
9
12
  interface BitData<C, T> {
10
13
  ctrl: C;
package/dist/bit/bit.js CHANGED
@@ -8,6 +8,7 @@ const signals_1 = require("@preact/signals");
8
8
  const preact_1 = require("preact");
9
9
  const hooks_1 = require("preact/hooks");
10
10
  const error_view_1 = require("../ui/components/error_view");
11
+ const flex_1 = require("../ui/components/layout/flex");
11
12
  const spinner_1 = require("../ui/components/spinner");
12
13
  function makeBit(name) {
13
14
  const c = (0, preact_1.createContext)(null);
@@ -48,7 +49,8 @@ function useBit(context) {
48
49
  const v = state.value;
49
50
  function map(m) {
50
51
  if (v.loading)
51
- return (m.onLoading || (() => (0, jsx_runtime_1.jsx)(spinner_1.Spinner, {})))();
52
+ return (m.onLoading ||
53
+ (() => ((0, jsx_runtime_1.jsx)(flex_1.Column, { cross: "center", children: (0, jsx_runtime_1.jsx)(spinner_1.Spinner, {}) }))))();
52
54
  if (v.error)
53
55
  return (m.onError ||
54
56
  ((e) => (0, jsx_runtime_1.jsx)(error_view_1.ErrorView, { error: e, retry: ctrl.reload ?? null })))(v.error);
@@ -64,7 +66,7 @@ function useBit(context) {
64
66
  * @param f the builder function
65
67
  * @returns the built component
66
68
  */
67
- onData: (f) => map({ onData: f }),
69
+ onData: (f, { onLoading, onError, } = {}) => map({ onData: f, onLoading: onLoading, onError: onError }),
68
70
  };
69
71
  }
70
72
  catch (e) {
@@ -78,6 +80,3 @@ function useBit(context) {
78
80
  };
79
81
  }
80
82
  }
81
- function BitSpinner({ name }) {
82
- return (0, jsx_runtime_1.jsx)(spinner_1.Spinner, {});
83
- }
package/dist/elbe.css CHANGED
@@ -3,183 +3,200 @@
3
3
  - sass style/elbe.scss dist/elbe.css
4
4
  */
5
5
  @import url("https://fonts.googleapis.com/css2?display=swap&family=Space+Mono:ital,wght@0,400;0,700;1,400;1,700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Calistoga&family=Noto+Color+Emoji");
6
- /* ========= SPACING ========= */
7
- .padded,
8
- .card,
9
- button,
10
- .toast,
11
- select,
12
- input[type=text],
13
- input[type=number],
14
- input[type=password],
15
- input[type=email],
16
- input[type=date],
17
- input[type=time],
18
- textarea {
19
- padding: var(--g-padding);
6
+ :root {
7
+ --g-size: 1rem;
8
+ --g-radius: 0.75rem;
9
+ --g-padding: 1rem;
10
+ --g-border-width: 0.125rem;
11
+ --c-context-back: #ffffff;
12
+ --c-context-front: #000;
13
+ --c-context-border: #000;
14
+ line-height: 1.3;
15
+ color: #222;
16
+ background-color: #ffffff;
17
+ font-synthesis: none;
18
+ text-rendering: optimizeLegibility;
19
+ -webkit-font-smoothing: antialiased;
20
+ -moz-osx-font-smoothing: grayscale;
21
+ -webkit-text-size-adjust: 100%;
22
+ box-sizing: border-box;
23
+ font-size: 1rem;
24
+ border-collapse: separate;
25
+ font-family: "Inter", sans-serif;
20
26
  }
21
27
 
22
- .padding-none {
23
- padding: 0rem;
28
+ *,
29
+ *:before,
30
+ *:after {
31
+ box-sizing: inherit;
32
+ font-size: inherit;
33
+ font-family: inherit;
34
+ font-weight: inherit;
35
+ border-color: inherit;
24
36
  }
25
37
 
26
- .margined {
27
- margin: var(--g-padding);
38
+ body,
39
+ #app {
40
+ margin: 0;
41
+ display: block;
42
+ min-height: 100vh;
43
+ background-color: white;
28
44
  }
29
45
 
30
- .margined-none {
46
+ .elbe {
47
+ /* ========= SPACING ========= */
48
+ /* ========= ELEMENT_STYLE ========= */
49
+ /* ========= CARD ========= */
50
+ /* ========= UTIL ========= */
51
+ /* ========= MARKUP ========= */
52
+ /* ========= ANIMATIONS ========= */
53
+ /* ========== GAP =========== */
54
+ /* ========== EXPAND =========== */
55
+ /* ========== ALIGN =========== */
56
+ /* ========== JUSTIFY =========== */
57
+ /* ========== RESPONSIVE =========== */
58
+ }
59
+ .elbe .padded,
60
+ .elbe .card,
61
+ .elbe .toast,
62
+ .elbe input[type=text],
63
+ .elbe input[type=number],
64
+ .elbe input[type=password],
65
+ .elbe input[type=email],
66
+ .elbe input[type=date],
67
+ .elbe input[type=time],
68
+ .elbe textarea,
69
+ .elbe select,
70
+ .elbe button {
71
+ padding: var(--g-padding);
72
+ }
73
+ .elbe .padding-none {
74
+ padding: 0rem;
75
+ }
76
+ .elbe .margined {
77
+ margin: var(--g-padding);
78
+ }
79
+ .elbe .margined-none {
31
80
  margin: 0rem;
32
81
  }
33
-
34
- /* ========= ELEMENT_STYLE ========= */
35
- .sharp {
82
+ .elbe .sharp {
36
83
  border-radius: 0;
37
84
  }
38
-
39
- .rounded,
40
- .card,
41
- button,
42
- .toast,
43
- select,
44
- input[type=text],
45
- input[type=number],
46
- input[type=password],
47
- input[type=email],
48
- input[type=date],
49
- input[type=time],
50
- textarea {
85
+ .elbe .rounded,
86
+ .elbe .card,
87
+ .elbe .toast,
88
+ .elbe input[type=text],
89
+ .elbe input[type=number],
90
+ .elbe input[type=password],
91
+ .elbe input[type=email],
92
+ .elbe input[type=date],
93
+ .elbe input[type=time],
94
+ .elbe textarea,
95
+ .elbe select,
96
+ .elbe button {
51
97
  border-radius: var(--g-radius);
52
98
  border-color: inherit;
53
99
  overflow: hidden;
54
100
  }
55
-
56
- .round {
101
+ .elbe .round {
57
102
  border-radius: 50%;
58
103
  }
59
-
60
- img.round,
61
- img.rounded {
104
+ .elbe img.round,
105
+ .elbe img.rounded {
62
106
  object-fit: cover;
63
107
  }
64
-
65
- .borderless {
108
+ .elbe .borderless {
66
109
  border: none;
67
110
  }
68
-
69
- .raised, .toast {
111
+ .elbe .raised, .elbe .toast {
70
112
  box-shadow: 0 0.1rem 1rem rgba(0, 0, 0, 0.2);
71
113
  }
72
-
73
- .scrollbars-none {
114
+ .elbe .scrollbars-none {
74
115
  scrollbar-width: none;
75
116
  -ms-overflow-style: none;
76
117
  }
77
- .scrollbars-none::-webkit-scrollbar {
118
+ .elbe .scrollbars-none::-webkit-scrollbar {
78
119
  display: none;
79
120
  }
80
-
81
- .pointer {
121
+ .elbe .pointer {
82
122
  cursor: pointer;
83
123
  }
84
-
85
- .text-centered {
124
+ .elbe .text-centered {
86
125
  text-align: center;
87
126
  }
88
-
89
- .text-start {
127
+ .elbe .text-start {
90
128
  text-align: start;
91
129
  }
92
-
93
- .text-end {
130
+ .elbe .text-end {
94
131
  text-align: end;
95
132
  }
96
-
97
- body:has(dialog[open=""]) {
133
+ .elbe body:has(dialog[open=""]) {
98
134
  overflow: hidden;
99
135
  }
100
-
101
- .transparent {
136
+ .elbe .transparent {
102
137
  background-color: transparent;
103
138
  }
104
-
105
- .disabled {
139
+ .elbe .disabled {
106
140
  cursor: not-allowed;
107
141
  }
108
-
109
- /* ========= CARD ========= */
110
- .box, .header, .base-limited,
111
- .card,
112
- button,
113
- .toast,
114
- select,
115
- input[type=text],
116
- input[type=number],
117
- input[type=password],
118
- input[type=email],
119
- input[type=date],
120
- input[type=time],
121
- textarea {
142
+ .elbe .box, .elbe .header, .elbe .base-limited,
143
+ .elbe .card,
144
+ .elbe .toast,
145
+ .elbe input[type=text],
146
+ .elbe input[type=number],
147
+ .elbe input[type=password],
148
+ .elbe input[type=email],
149
+ .elbe input[type=date],
150
+ .elbe input[type=time],
151
+ .elbe textarea,
152
+ .elbe select,
153
+ .elbe button {
122
154
  border-style: solid;
123
155
  border-width: var(--g-border-width);
124
156
  }
125
-
126
- /* ========= UTIL ========= */
127
- .action {
157
+ .elbe .action {
128
158
  cursor: pointer;
129
159
  }
130
-
131
- .base-limited {
160
+ .elbe .base-limited {
132
161
  max-width: 700px;
133
162
  width: 100%;
134
163
  margin: 0 auto;
135
164
  }
136
-
137
- /* ========= MARKUP ========= */
138
- i,
139
- .i {
165
+ .elbe i,
166
+ .elbe .i {
140
167
  font-style: italic;
141
168
  }
142
-
143
- b,
144
- .b,
145
- button,
146
- .toast {
169
+ .elbe b,
170
+ .elbe .b,
171
+ .elbe .toast,
172
+ .elbe button {
147
173
  font-weight: bold;
148
174
  }
149
-
150
- .u {
175
+ .elbe .u {
151
176
  text-decoration: underline;
152
177
  }
153
-
154
- .ni {
178
+ .elbe .ni {
155
179
  font-style: normal;
156
180
  }
157
-
158
- .nb {
181
+ .elbe .nb {
159
182
  font-weight: normal;
160
183
  }
161
-
162
- .nu {
184
+ .elbe .nu {
163
185
  text-decoration: none;
164
186
  }
165
-
166
- .striked {
187
+ .elbe .striked {
167
188
  text-decoration: line-through;
168
189
  }
169
-
170
- .code {
190
+ .elbe .code {
171
191
  font-family: monospace;
172
192
  white-space: pre-wrap;
173
193
  }
174
-
175
- /* ========= ANIMATIONS ========= */
176
- .rotate {
194
+ .elbe .rotate {
177
195
  display: flex;
178
196
  align-items: center;
179
197
  justify-content: center;
180
198
  animation: rotation 1.5s infinite linear;
181
199
  }
182
-
183
200
  @keyframes rotation {
184
201
  from {
185
202
  transform: rotate(0deg);
@@ -188,195 +205,152 @@ button,
188
205
  transform: rotate(359deg);
189
206
  }
190
207
  }
191
- .column, dialog,
192
- .row,
193
- button,
194
- .header,
195
- .row-resp {
208
+ .elbe .column, .elbe dialog,
209
+ .elbe .row,
210
+ .elbe .header,
211
+ .elbe button,
212
+ .elbe .row-resp {
196
213
  display: flex;
197
214
  justify-content: start;
198
215
  align-items: stretch;
199
216
  gap: 1rem;
200
217
  }
201
-
202
- .column, dialog {
218
+ .elbe .column, .elbe dialog {
203
219
  flex-direction: column;
204
220
  }
205
-
206
- .row, button, .header {
221
+ .elbe .row, .elbe .header, .elbe button {
207
222
  flex-direction: row;
208
223
  align-items: center;
209
224
  }
210
-
211
- .centered {
225
+ .elbe .centered {
212
226
  display: flex;
213
227
  align-items: center;
214
228
  justify-content: center;
215
229
  }
216
-
217
- /* ========== GAP =========== */
218
- .gap-none {
230
+ .elbe .gap-none {
219
231
  gap: 0;
220
232
  }
221
-
222
- .gap-quarter {
233
+ .elbe .gap-quarter {
223
234
  gap: 0.25rem;
224
235
  }
225
-
226
- .gap-half {
236
+ .elbe .gap-half {
227
237
  gap: 0.5rem;
228
238
  }
229
-
230
- .gap-one {
239
+ .elbe .gap-one {
231
240
  gap: 1rem;
232
241
  }
233
-
234
- .gap-double {
242
+ .elbe .gap-double {
235
243
  gap: 2rem;
236
244
  }
237
-
238
- .gap-triple {
245
+ .elbe .gap-triple {
239
246
  gap: 3rem;
240
247
  }
241
-
242
- /* ========== EXPAND =========== */
243
- .flex-none {
248
+ .elbe .flex-none {
244
249
  flex: 0 0 auto;
245
250
  }
246
-
247
- .flex-1 {
251
+ .elbe .flex-1 {
248
252
  flex: 1 1 0%;
249
253
  }
250
-
251
- .flex-2 {
254
+ .elbe .flex-2 {
252
255
  flex: 2 2 0%;
253
256
  }
254
-
255
- .flex-3 {
257
+ .elbe .flex-3 {
256
258
  flex: 3 3 0%;
257
259
  }
258
-
259
- .flex-4 {
260
+ .elbe .flex-4 {
260
261
  flex: 4 4 0%;
261
262
  }
262
-
263
- .flex-5 {
263
+ .elbe .flex-5 {
264
264
  flex: 5 5 0%;
265
265
  }
266
-
267
- .flex-6 {
266
+ .elbe .flex-6 {
268
267
  flex: 6 6 0%;
269
268
  }
270
-
271
- .flex-7 {
269
+ .elbe .flex-7 {
272
270
  flex: 7 7 0%;
273
271
  }
274
-
275
- .flex-8 {
272
+ .elbe .flex-8 {
276
273
  flex: 8 8 0%;
277
274
  }
278
-
279
- .flex-9 {
275
+ .elbe .flex-9 {
280
276
  flex: 9 9 0%;
281
277
  }
282
-
283
- .flex-10 {
278
+ .elbe .flex-10 {
284
279
  flex: 10 10 0%;
285
280
  }
286
-
287
- .flex-11 {
281
+ .elbe .flex-11 {
288
282
  flex: 11 11 0%;
289
283
  }
290
-
291
- .flex-12 {
284
+ .elbe .flex-12 {
292
285
  flex: 12 12 0%;
293
286
  }
294
-
295
- /* ========== ALIGN =========== */
296
- .cross-start {
287
+ .elbe .cross-start {
297
288
  align-items: flex-start;
298
289
  }
299
-
300
- .cross-center, dialog {
290
+ .elbe .cross-center, .elbe dialog {
301
291
  align-items: center;
302
292
  }
303
-
304
- .cross-end {
293
+ .elbe .cross-end {
305
294
  align-items: flex-end;
306
295
  }
307
-
308
- .cross-stretch {
296
+ .elbe .cross-stretch {
309
297
  align-items: stretch;
310
298
  }
311
-
312
- .cross-baseline {
299
+ .elbe .cross-baseline {
313
300
  align-items: baseline;
314
301
  }
315
-
316
- /* ========== JUSTIFY =========== */
317
- .main-start {
302
+ .elbe .main-start {
318
303
  justify-content: flex-start;
319
304
  }
320
-
321
- .main-center, dialog {
305
+ .elbe .main-center, .elbe dialog {
322
306
  justify-content: center;
323
307
  }
324
-
325
- .main-end {
308
+ .elbe .main-end {
326
309
  justify-content: flex-end;
327
310
  }
328
-
329
- .main-between {
311
+ .elbe .main-between {
330
312
  justify-content: space-between;
331
313
  }
332
-
333
- .main-around {
314
+ .elbe .main-around {
334
315
  justify-content: space-around;
335
316
  }
336
-
337
- .main-evenly {
317
+ .elbe .main-evenly {
338
318
  justify-content: space-evenly;
339
319
  }
340
-
341
- /* ========== RESPONSIVE =========== */
342
320
  @media (max-width: 700px) {
343
- .row-resp {
321
+ .elbe .row-resp {
344
322
  flex-direction: column;
345
323
  }
346
- .if-wide {
324
+ .elbe .if-wide {
347
325
  display: none;
348
326
  }
349
327
  }
350
328
  @media (min-width: 700px) {
351
- .if-narrow {
329
+ .elbe .if-narrow {
352
330
  display: none;
353
331
  }
354
332
  }
355
- .wrap {
333
+ .elbe .wrap {
356
334
  flex-wrap: wrap;
357
335
  }
358
-
359
- .c_from_context, input[type=text],
360
- input[type=number],
361
- input[type=password],
362
- input[type=email],
363
- input[type=date],
364
- input[type=time],
365
- textarea, select {
336
+ .elbe .c_from_context, .elbe input[type=text],
337
+ .elbe input[type=number],
338
+ .elbe input[type=password],
339
+ .elbe input[type=email],
340
+ .elbe input[type=date],
341
+ .elbe input[type=time],
342
+ .elbe textarea, .elbe select {
366
343
  background-color: var(--c-context-back);
367
344
  color: var(--c-context-front);
368
345
  border: var(--g-border-width) solid var(--c-context-border);
369
346
  }
370
-
371
- .borderless {
347
+ .elbe .borderless {
372
348
  border: none;
373
349
  }
374
-
375
- .bordered {
350
+ .elbe .bordered {
376
351
  border: var(--g-border-width) solid var(--c-context-border);
377
352
  }
378
-
379
- button {
353
+ .elbe button {
380
354
  justify-content: center;
381
355
  padding: 0.25rem 0.75rem;
382
356
  gap: 0.5rem;
@@ -400,34 +374,21 @@ button {
400
374
  }
401
375
  }*/
402
376
  }
403
- button:not(.dummy_class_001) {
377
+ .elbe button:not(.dummy_class_001) {
404
378
  border: none;
405
379
  }
406
-
407
- .icon {
380
+ .elbe .icon {
408
381
  aspect-ratio: 1;
409
382
  border-radius: 25%;
410
383
  object-fit: cover;
411
384
  }
412
-
413
- .toast {
414
- position: fixed;
415
- bottom: 1rem;
416
- right: 1rem;
417
- z-index: 200;
418
- left: 50%;
419
- width: min(40rem, 90%);
420
- transform: translateX(-50%);
421
- }
422
-
423
- select {
385
+ .elbe select {
424
386
  padding: 0 0.75rem;
425
387
  height: 3rem;
426
388
  min-width: 12rem;
427
389
  width: 100%;
428
390
  }
429
-
430
- dialog {
391
+ .elbe dialog {
431
392
  z-index: 100;
432
393
  position: fixed;
433
394
  top: 0;
@@ -440,30 +401,27 @@ dialog {
440
401
  transition: background-color 0.3s ease-in-out;
441
402
  transition: backdrop-filter 0.3s ease-in-out;
442
403
  }
443
- dialog > * {
404
+ .elbe dialog > * {
444
405
  display: none;
445
406
  }
446
- dialog[open=""] {
407
+ .elbe dialog[open=""] {
447
408
  background-color: rgba(0, 0, 0, 0.2);
448
409
  backdrop-filter: blur(5px);
449
410
  pointer-events: all;
450
411
  }
451
- dialog[open=""] > * {
412
+ .elbe dialog[open=""] > * {
452
413
  display: unset;
453
414
  }
454
-
455
- .expandable {
415
+ .elbe .expandable {
456
416
  max-height: 0px;
457
417
  transition: max-height 0.25s ease-out;
458
418
  overflow: hidden;
459
419
  }
460
-
461
- .expandable:has(*) {
420
+ .elbe .expandable:has(*) {
462
421
  max-height: 500px;
463
422
  transition: max-height 0.25s ease-in;
464
423
  }
465
-
466
- .header {
424
+ .elbe .header {
467
425
  width: 100%;
468
426
  position: fixed;
469
427
  left: 0;
@@ -484,46 +442,43 @@ dialog[open=""] > * {
484
442
  justify-content: space-between;
485
443
  align-items: center;
486
444
  }
487
-
488
- input[type=text],
489
- input[type=number],
490
- input[type=password],
491
- input[type=email],
492
- input[type=date],
493
- input[type=time],
494
- textarea {
445
+ .elbe input[type=text],
446
+ .elbe input[type=number],
447
+ .elbe input[type=password],
448
+ .elbe input[type=email],
449
+ .elbe input[type=date],
450
+ .elbe input[type=time],
451
+ .elbe textarea {
495
452
  padding: 0 0.75rem;
496
453
  height: 3rem;
497
454
  min-width: 12rem;
498
455
  width: 100%;
499
456
  }
500
-
501
- textarea {
457
+ .elbe textarea {
502
458
  height: 6rem;
503
459
  padding: 0.6rem 0.75rem;
504
460
  resize: vertical;
505
461
  min-height: 3rem;
506
462
  }
507
-
508
- input[type=range] {
463
+ .elbe input[type=range] {
509
464
  -webkit-appearance: none;
510
465
  appearance: none;
511
466
  background: transparent;
512
467
  cursor: pointer;
513
468
  width: 15rem;
514
469
  }
515
- input[type=range]::-moz-range-track {
470
+ .elbe input[type=range]::-moz-range-track {
516
471
  background-color: var(--c-context-border);
517
472
  border-radius: 100px;
518
473
  border: none;
519
474
  height: 0.5rem;
520
475
  }
521
- input[type=range]::-webkit-slider-runnable-track {
476
+ .elbe input[type=range]::-webkit-slider-runnable-track {
522
477
  border-radius: 100px;
523
478
  border: none;
524
479
  height: 0.5rem;
525
480
  }
526
- input[type=range]::-webkit-slider-thumb {
481
+ .elbe input[type=range]::-webkit-slider-thumb {
527
482
  border: none;
528
483
  -webkit-appearance: none;
529
484
  appearance: none;
@@ -532,8 +487,7 @@ input[type=range]::-webkit-slider-thumb {
532
487
  height: 1.2rem;
533
488
  width: 1.2rem;
534
489
  }
535
-
536
- input[type=checkbox] {
490
+ .elbe input[type=checkbox] {
537
491
  -webkit-appearance: none;
538
492
  appearance: none;
539
493
  margin: 0;
@@ -548,8 +502,7 @@ input[type=checkbox] {
548
502
  place-content: center;
549
503
  outline: none;
550
504
  }
551
-
552
- input[type=checkbox]::before {
505
+ .elbe input[type=checkbox]::before {
553
506
  content: "";
554
507
  width: 0.95rem;
555
508
  height: 0.75rem;
@@ -558,64 +511,31 @@ input[type=checkbox]::before {
558
511
  transform-origin: center;
559
512
  transition: 0.2s all ease-in-out;
560
513
  }
561
-
562
- input[type=checkbox]:checked {
514
+ .elbe input[type=checkbox]:checked {
563
515
  border-color: var(--c-accent);
564
516
  background: color-mix(in srgb, var(--c-accent) 20%, transparent);
565
517
  }
566
- input[type=checkbox]:checked::before {
518
+ .elbe input[type=checkbox]:checked::before {
567
519
  transform: scale(1);
568
520
  background-color: var(--c-accent);
569
521
  }
570
-
571
- input[type=checkbox]:focus {
522
+ .elbe input[type=checkbox]:focus {
572
523
  outline: max(2px, 0.15em) solid var(--c-accent);
573
524
  outline-offset: 0;
574
525
  }
575
-
576
- input[type=checkbox]:not(:checked):disabled {
526
+ .elbe input[type=checkbox]:not(:checked):disabled {
577
527
  cursor: not-allowed;
578
528
  border: 0.16em solid var(--c-context-border);
579
529
  }
580
530
 
581
- :root {
582
- --g-size: 1rem;
583
- --g-radius: 0.75rem;
584
- --g-padding: 1rem;
585
- --g-border-width: 0.125rem;
586
- --c-context-back: #ffffff;
587
- --c-context-front: #000;
588
- --c-context-border: #000;
589
- line-height: 1.3;
590
- color: #222;
591
- background-color: #ffffff;
592
- font-synthesis: none;
593
- text-rendering: optimizeLegibility;
594
- -webkit-font-smoothing: antialiased;
595
- -moz-osx-font-smoothing: grayscale;
596
- -webkit-text-size-adjust: 100%;
597
- box-sizing: border-box;
598
- font-size: 1rem;
599
- border-collapse: separate;
600
- font-family: "Inter", sans-serif;
601
- }
602
-
603
- *,
604
- *:before,
605
- *:after {
606
- box-sizing: inherit;
607
- font-size: inherit;
608
- font-family: inherit;
609
- font-weight: inherit;
610
- border-color: inherit;
611
- }
612
-
613
- body,
614
- #app {
615
- margin: 0;
616
- display: block;
617
- min-height: 100vh;
618
- background-color: white;
531
+ .toast {
532
+ position: fixed;
533
+ bottom: 1rem;
534
+ right: 1rem;
535
+ z-index: 200;
536
+ left: 50%;
537
+ width: min(40rem, 90%);
538
+ transform: translateX(-50%);
619
539
  }
620
540
 
621
541
  /*# sourceMappingURL=elbe.css.map */
package/dist/elbe.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../style/elbe.scss","../style/_base.scss","../style/_flex.scss","../style/_components.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;AAOQ;ACPR;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAIF;AAEA;EACE;;;AAEF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAEE;EACA;EACA;;;AAEF;EACE;;;AAGF;AAAA;EAEE;;;AAGF;EACE;;;AAEF;EACE;;;AAGF;EACE;EACA;;A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AA;AAAA;AAAA;;AAJA;EACE;;;AAoBJ;EACE;EACA;EACA;;;AAGF;EAIE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAGF;EAGE;EACA;EACA;EACA;;;AAGF;EAKE;EAEA;EACA;EACA;EACA;EACA;EAEA;EAEA;EAEA;EAEA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;;AACA;EACE;;;AAKN;EACE;EACA;EACA;;;AAGF;EACE;EACA;;;AAGF;EAGC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACC;EAGD;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;;;AAKD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAWE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAGF;EAEE;EACA;EACA;;AAGF;EAGE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAOJ;EACE;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EAEA;EACA;EACA;;;AAIF;EACE;EACA;;AACA;EACE;EACA;;;AAMJ;EACE;EACA;;;AAGF;EACE;EACA;;;AH5PF;EACE;EACA;EACA;EACA;EAEA;EACA;EACA;EAGA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;;;AAGF;AAAA;AAAA;EAGE;EACA;EACA;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;EACA;EACA","file":"elbe.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../style/elbe.scss","../style/_base.scss","../style/_flex.scss","../style/_components.scss"],"names":[],"mappings":"AAAA;AAAA;AAAA;AAAA;AAOQ;AAMR;EACE;EACA;EACA;EACA;EAEA;EACA;EACA;EAGA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;;;AAGF;AAAA;AAAA;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F;EACE;;AAEF;EACE;;AAEF;EACE;;AAEF;EACE;;AAEF;EACE;;AAKF;EACE;IACE;;EAEF;IACE;;;AAIJ;EACE;IACE;;;AAIJ;EACE;;AClHF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EACE;EACA;EACA;;AAGF;EACE;;AAGF;EACE;;AAIF;EAIE;EACA;EACA;EACA;EACA;EACA;EACA;AAMA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAJA;EACE;;AAoBJ;EACE;EACA;EACA;;AAGF;EAGE;EACA;EACA;EACA;;AAGF;EAKE;EAEA;EACA;EACA;EACA;EACA;EAEA;EAEA;EAEA;EAEA;EACA;;AAEA;EACE;;AAGF;EACE;EACA;EACA;;AACA;EACE;;AAKN;EACE;EACA;EACA;;AAGF;EACE;EACA;;AAGF;EAGC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACC;EAGD;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;;AAKD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAWE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;;AAGF;EAEE;EACA;EACA;;AAGF;EAGE;EACA;EACA;EACA;EACA;EACA;EACA;;AAOJ;EACE;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;;AAGF;EACE;EACA;EACA;EACA;EAEA;EACA;EACA;;AAIF;EACE;EACA;;AACA;EACE;EACA;;AAMJ;EACE;EACA;;AAGF;EACE;EACA;;;AHxLF;EAIE;EACA;EACA;EACA;EACA;EACA;EACA","file":"elbe.css"}
@@ -42,7 +42,7 @@ export type ColorThemeSeed = ColorSeedColors & {
42
42
  flat: SeedFlatSelector;
43
43
  };
44
44
  };
45
- declare class RGBAColor {
45
+ export declare class RGBAColor {
46
46
  r: number;
47
47
  g: number;
48
48
  b: number;
@@ -52,7 +52,7 @@ declare class RGBAColor {
52
52
  get isDark(): boolean;
53
53
  get luminance(): number;
54
54
  get hex(): string;
55
- static _fromHex(hex: string | null): RGBAColor;
55
+ static fromHex(hex: string | null): RGBAColor;
56
56
  desaturated(f?: number): RGBAColor;
57
57
  withAlpha(a: number): RGBAColor;
58
58
  inter(other: RGBAColor, factor: number): RGBAColor;
@@ -139,4 +139,3 @@ export declare class ColorTheme {
139
139
  asCss(): string;
140
140
  static generate(seed?: Partial<ColorThemeSeed>): ColorTheme;
141
141
  }
142
- export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ColorTheme = exports.ModeColor = exports.SchemeColor = exports.KindColor = exports.MannerColor = exports.StateColor = exports.LayerColor = exports.colors = exports.cLayers = exports.cStates = exports.cManners = exports.cKinds = exports.cSchemes = exports.cModes = void 0;
3
+ exports.ColorTheme = exports.ModeColor = exports.SchemeColor = exports.KindColor = exports.MannerColor = exports.StateColor = exports.LayerColor = exports.colors = exports.RGBAColor = exports.cLayers = exports.cStates = exports.cManners = exports.cKinds = exports.cSchemes = exports.cModes = void 0;
4
4
  const colors_convert_1 = require("colors-convert");
5
5
  const util_1 = require("../util/util");
6
6
  const color_theme_1 = require("./color_theme");
@@ -48,7 +48,7 @@ class RGBAColor {
48
48
  .padStart(2, "0");
49
49
  return `#${c.join("")}${a}`;
50
50
  }
51
- static _fromHex(hex) {
51
+ static fromHex(hex) {
52
52
  if (!hex)
53
53
  return new RGBAColor(0, 0, 0, 0);
54
54
  const c = hex.replace("#", "").padEnd(6, "0").padEnd(8, "f").toLowerCase();
@@ -88,6 +88,7 @@ class RGBAColor {
88
88
  return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
89
89
  }
90
90
  }
91
+ exports.RGBAColor = RGBAColor;
91
92
  exports.colors = {
92
93
  transparent: new RGBAColor(0, 0, 0, 0),
93
94
  white: new RGBAColor(255, 255, 255, 1),
@@ -128,9 +129,9 @@ class LayerColor extends RGBAColor {
128
129
  }
129
130
  static fromHex(back, front, border) {
130
131
  if (front === undefined && border === undefined) {
131
- return LayerColor.fromBack(RGBAColor._fromHex(back));
132
+ return LayerColor.fromBack(RGBAColor.fromHex(back));
132
133
  }
133
- return new LayerColor(RGBAColor._fromHex(back), RGBAColor._fromHex(front ?? null), RGBAColor._fromHex(border ?? null));
134
+ return new LayerColor(RGBAColor.fromHex(back), RGBAColor.fromHex(front ?? null), RGBAColor.fromHex(border ?? null));
134
135
  }
135
136
  static fromBack(back, c) {
136
137
  const front = back.isDark ? exports.colors.white : exports.colors.black;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elbe-ui",
3
- "version": "0.2.34",
3
+ "version": "0.2.41",
4
4
  "author": "Robin Naumann",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,7 +20,7 @@
20
20
  "scripts": {
21
21
  "build:ts": "tsc",
22
22
  "build:dts": "tsc --declaration",
23
- "build:css": "sass --quiet-deps style/elbe.scss dist/elbe.css",
23
+ "build:css": "sass -q style/elbe.scss dist/elbe.css",
24
24
  "build": "rm -rf ./dist && bun run build:ts && bun run build:dts && bun run build:css"
25
25
  },
26
26
  "devDependencies": {