athena-ui-js 1.3.0 → 2.0.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 +100 -54
- package/docs/migration-2.0.md +83 -0
- package/docs/styling.md +86 -0
- package/package.json +108 -25
- package/src/athena-ui.js +54 -97
- package/src/chart.js +6 -0
- package/src/classic.js +11 -0
- package/src/components.js +6 -0
- package/src/controls.js +8 -0
- package/src/csv.js +6 -0
- package/src/dialog.js +7 -0
- package/src/dom.js +6 -0
- package/src/feedback.js +6 -0
- package/src/format.js +6 -0
- package/src/forms.js +7 -0
- package/src/i18n.js +6 -0
- package/src/inputs.js +9 -0
- package/src/libs/config/config.js +1 -9
- package/src/libs/core/controls.js +6 -14
- package/src/libs/core/cookies.js +55 -0
- package/src/libs/core/i18n.js +40 -6
- package/src/libs/core/validation.js +2 -2
- package/src/libs/hephaestus/LayoutGenerator/basicLayoutGenerator.js +9 -1
- package/src/libs/hephaestus/MenuGenerator/menuGenerator.js +16 -4
- package/src/libs/hephaestus/auth/session.js +1 -1
- package/src/libs/hephaestus/dialogGenerator/dialogGenerator.js +25 -17
- package/src/libs/hephaestus/formGenerator/changePasswordFormGenerator.js +4 -4
- package/src/libs/hephaestus/formGenerator/formUtils.js +0 -4
- package/src/libs/hephaestus/formGenerator/loginFormGenerator.js +2 -3
- package/src/libs/hephaestus/formGenerator/registrationFormGenerator.js +3 -3
- package/src/libs/hephaestus/hephaestus.js +0 -10
- package/src/libs/hephaestus/inputGenerator/dropZoneGenerator.js +1 -1
- package/src/libs/hephaestus/modalGenerator/modalGenerator.js +13 -6
- package/src/libs/hephaestus/navigationGenerator/navigationGenerator.js +20 -24
- package/src/menu.js +6 -0
- package/src/navigation.js +6 -0
- package/src/res/themes/default/style.css +97 -100
- package/src/res/themes/tokens.css +96 -0
- package/src/router.js +6 -0
- package/src/sanitize.js +6 -0
- package/src/session.js +8 -0
- package/src/table.js +6 -0
- package/src/testing.js +11 -1
- package/src/theme.js +7 -0
- package/src/validation.js +6 -0
- package/types/athena-ui.d.ts +96 -0
- package/types/chart.d.ts +1 -0
- package/types/classic.d.ts +1 -0
- package/types/components.d.ts +1 -0
- package/types/controls.d.ts +3 -0
- package/types/csv.d.ts +1 -0
- package/types/dialog.d.ts +2 -0
- package/types/dom.d.ts +1 -0
- package/types/feedback.d.ts +1 -0
- package/types/format.d.ts +1 -0
- package/types/forms.d.ts +2 -0
- package/types/i18n.d.ts +1 -0
- package/types/inputs.d.ts +4 -0
- package/types/libs/config/config.d.ts +96 -0
- package/types/libs/config/hooks.d.ts +8 -0
- package/types/libs/core/combobox.d.ts +10 -0
- package/types/libs/core/controls.d.ts +28 -0
- package/types/libs/core/cookies.d.ts +27 -0
- package/types/libs/core/csv.d.ts +12 -0
- package/types/libs/core/dateRange.d.ts +72 -0
- package/types/libs/core/dom.d.ts +65 -0
- package/types/libs/core/elementGenerator.d.ts +30 -0
- package/types/libs/core/errors.d.ts +29 -0
- package/types/libs/core/focus.d.ts +6 -0
- package/types/libs/core/format.d.ts +21 -0
- package/types/libs/core/hungarianControls.d.ts +2 -0
- package/types/libs/core/i18n.d.ts +17 -0
- package/types/libs/core/pagination.d.ts +5 -0
- package/types/libs/core/sanitize.d.ts +6 -0
- package/types/libs/core/tableMath.d.ts +26 -0
- package/types/libs/core/theme.d.ts +39 -0
- package/types/libs/core/validation.d.ts +56 -0
- package/types/libs/hephaestus/LayoutGenerator/basicLayoutGenerator.d.ts +10 -0
- package/types/libs/hephaestus/LayoutGenerator/footerContentGenerator.d.ts +4 -0
- package/types/libs/hephaestus/LayoutGenerator/headerContentGenerator.d.ts +20 -0
- package/types/libs/hephaestus/LayoutGenerator/wrapperContentGenerator.d.ts +1 -0
- package/types/libs/hephaestus/MenuGenerator/basicMenuGenerator.d.ts +14 -0
- package/types/libs/hephaestus/MenuGenerator/menuGenerator.d.ts +65 -0
- package/types/libs/hephaestus/auth/authState.d.ts +26 -0
- package/types/libs/hephaestus/auth/session.d.ts +26 -0
- package/types/libs/hephaestus/chartGenerator/chartGenerator.d.ts +91 -0
- package/types/libs/hephaestus/componentGenerator/componentGenerator.d.ts +222 -0
- package/types/libs/hephaestus/componentGenerator/themePicker.d.ts +24 -0
- package/types/libs/hephaestus/dialogGenerator/dialogGenerator.d.ts +120 -0
- package/types/libs/hephaestus/feedbackGenerator/feedbackGenerator.d.ts +86 -0
- package/types/libs/hephaestus/formGenerator/authForms.d.ts +122 -0
- package/types/libs/hephaestus/formGenerator/changePasswordFormGenerator.d.ts +6 -0
- package/types/libs/hephaestus/formGenerator/formBuilder.d.ts +113 -0
- package/types/libs/hephaestus/formGenerator/formUtils.d.ts +8 -0
- package/types/libs/hephaestus/formGenerator/loginFormGenerator.d.ts +11 -0
- package/types/libs/hephaestus/formGenerator/lostPasswordFormGenerator.d.ts +4 -0
- package/types/libs/hephaestus/formGenerator/registrationFormGenerator.d.ts +7 -0
- package/types/libs/hephaestus/hephaestus.d.ts +3 -0
- package/types/libs/hephaestus/inputGenerator/dropZoneGenerator.d.ts +48 -0
- package/types/libs/hephaestus/inputGenerator/inputGenerator.d.ts +185 -0
- package/types/libs/hephaestus/inputGenerator/richTextGenerator.d.ts +49 -0
- package/types/libs/hephaestus/modalGenerator/modalGenerator.d.ts +2 -0
- package/types/libs/hephaestus/navigationGenerator/navigationGenerator.d.ts +150 -0
- package/types/libs/hephaestus/router/matchRoute.d.ts +12 -0
- package/types/libs/hephaestus/router/router.d.ts +67 -0
- package/types/libs/hephaestus/tableGenerator/tableGenerator.d.ts +120 -0
- package/types/menu.d.ts +1 -0
- package/types/navigation.d.ts +1 -0
- package/types/res/themes/themes.d.ts +7 -0
- package/types/router.d.ts +1 -0
- package/types/sanitize.d.ts +1 -0
- package/types/session.d.ts +3 -0
- package/types/table.d.ts +1 -0
- package/types/testing.d.ts +27 -0
- package/types/theme-boot.d.ts +0 -0
- package/types/theme.d.ts +2 -0
- package/types/validation.d.ts +1 -0
- package/src/libs/crypto-js/LICENSE +0 -24
- package/src/libs/crypto-js/crypto-js.js +0 -6657
- package/src/libs/js-cookie/LICENSE +0 -21
- package/src/libs/js-cookie/src/api.mjs +0 -103
- package/src/libs/js-cookie/src/assign.mjs +0 -10
- package/src/libs/js-cookie/src/converter.mjs +0 -14
- package/src/libs/libs.js +0 -13
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
/* Default Athena UI Theme
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
--athena-line: #ccc;
|
|
11
|
-
--athena-surface: #f2f2f2;
|
|
12
|
-
--athena-surface-alt: #fafafa;
|
|
13
|
-
--athena-hover: #e8f0fe;
|
|
14
|
-
--athena-overlay: rgb(0 0 0 / 40%);
|
|
15
|
-
--athena-accent: #2f6db5;
|
|
16
|
-
--athena-accent-fg: #fff;
|
|
17
|
-
--athena-danger: #c0392b;
|
|
18
|
-
--athena-success: #1e8449;
|
|
19
|
-
--athena-warning: #9a6700;
|
|
20
|
-
--athena-info: #2471a3;
|
|
21
|
-
--athena-radius: 6px;
|
|
22
|
-
--athena-shadow: 0 4px 14px rgb(0 0 0 / 18%);
|
|
23
|
-
--grid-gap: 16px;
|
|
24
|
-
}
|
|
1
|
+
/* Default Athena UI Theme
|
|
2
|
+
|
|
3
|
+
Every rule of Athena UI is in the cascade layer "athena". CSS that is not in a layer (the normal CSS of an application) beats it whatever the
|
|
4
|
+
specificity, so overriding a style never needs a more specific selector. The design tokens (colours, radius, spacing, focus ring, dialog widths,
|
|
5
|
+
row height) are in tokens.css, which this file imports into the same layer. See docs/styling.md for the classes and variables of every component. */
|
|
6
|
+
|
|
7
|
+
@import url("../tokens.css") layer(athena);
|
|
8
|
+
|
|
9
|
+
@layer athena {
|
|
25
10
|
|
|
26
11
|
body {
|
|
27
12
|
background-color: var(--athena-bg);
|
|
@@ -37,7 +22,7 @@ select,
|
|
|
37
22
|
textarea {
|
|
38
23
|
background-color: var(--athena-bg);
|
|
39
24
|
color: var(--athena-fg);
|
|
40
|
-
border:
|
|
25
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
41
26
|
border-radius: 3px;
|
|
42
27
|
padding: 4px 6px;
|
|
43
28
|
font: inherit;
|
|
@@ -104,7 +89,7 @@ textarea {
|
|
|
104
89
|
color: var(--athena-fg);
|
|
105
90
|
margin: auto;
|
|
106
91
|
padding: 20px;
|
|
107
|
-
border:
|
|
92
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
108
93
|
width: 80%;
|
|
109
94
|
}
|
|
110
95
|
|
|
@@ -194,19 +179,19 @@ textarea {
|
|
|
194
179
|
.athena-form {
|
|
195
180
|
display: flex;
|
|
196
181
|
flex-direction: column;
|
|
197
|
-
gap:
|
|
182
|
+
gap: var(--athena-space-3);
|
|
198
183
|
max-width: 480px;
|
|
199
184
|
}
|
|
200
185
|
|
|
201
186
|
.form-actions {
|
|
202
187
|
display: flex;
|
|
203
|
-
gap:
|
|
188
|
+
gap: var(--athena-space-2);
|
|
204
189
|
}
|
|
205
190
|
|
|
206
191
|
.field {
|
|
207
192
|
display: flex;
|
|
208
193
|
flex-direction: column;
|
|
209
|
-
gap:
|
|
194
|
+
gap: var(--athena-space-1);
|
|
210
195
|
}
|
|
211
196
|
|
|
212
197
|
.field-label,
|
|
@@ -239,7 +224,7 @@ textarea {
|
|
|
239
224
|
}
|
|
240
225
|
|
|
241
226
|
.field-group {
|
|
242
|
-
border:
|
|
227
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
243
228
|
border-radius: var(--athena-radius);
|
|
244
229
|
padding: 6px 10px;
|
|
245
230
|
}
|
|
@@ -345,7 +330,7 @@ textarea {
|
|
|
345
330
|
display: flex;
|
|
346
331
|
align-items: flex-start;
|
|
347
332
|
justify-content: space-between;
|
|
348
|
-
gap:
|
|
333
|
+
gap: var(--athena-space-3);
|
|
349
334
|
padding: 10px 14px;
|
|
350
335
|
border: 1px solid var(--alert-color, var(--athena-info));
|
|
351
336
|
border-left-width: 5px;
|
|
@@ -391,7 +376,7 @@ textarea {
|
|
|
391
376
|
z-index: 2000;
|
|
392
377
|
display: flex;
|
|
393
378
|
flex-direction: column;
|
|
394
|
-
gap:
|
|
379
|
+
gap: var(--athena-space-2);
|
|
395
380
|
width: min(360px, calc(100vw - 32px));
|
|
396
381
|
}
|
|
397
382
|
|
|
@@ -403,7 +388,7 @@ textarea {
|
|
|
403
388
|
height: 10px;
|
|
404
389
|
border-radius: 5px;
|
|
405
390
|
background-color: var(--athena-surface);
|
|
406
|
-
border:
|
|
391
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
407
392
|
overflow: hidden;
|
|
408
393
|
}
|
|
409
394
|
|
|
@@ -445,24 +430,33 @@ textarea {
|
|
|
445
430
|
margin-bottom: 2px;
|
|
446
431
|
}
|
|
447
432
|
|
|
448
|
-
/* Dialog
|
|
433
|
+
/* Dialog: the native <dialog> element, opened with showModal() */
|
|
434
|
+
|
|
435
|
+
dialog.dialog {
|
|
436
|
+
width: min(var(--dialog-width, var(--athena-dialog-medium)), 92%);
|
|
437
|
+
max-width: none;
|
|
438
|
+
padding: 0;
|
|
439
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
440
|
+
border-radius: var(--athena-radius);
|
|
441
|
+
background-color: var(--athena-bg);
|
|
442
|
+
color: var(--athena-fg);
|
|
443
|
+
box-shadow: var(--athena-shadow);
|
|
444
|
+
}
|
|
449
445
|
|
|
450
|
-
.dialog
|
|
451
|
-
|
|
452
|
-
padding-top: 12vh;
|
|
446
|
+
dialog.dialog::backdrop {
|
|
447
|
+
background-color: var(--athena-overlay);
|
|
453
448
|
}
|
|
454
449
|
|
|
455
|
-
|
|
450
|
+
/* The content fills the dialog up to its edge, so a click on the backdrop is a click on the dialog element itself */
|
|
451
|
+
.dialog-inner {
|
|
456
452
|
position: relative;
|
|
457
|
-
|
|
458
|
-
border-radius: var(--athena-radius);
|
|
459
|
-
box-shadow: var(--athena-shadow);
|
|
453
|
+
padding: 20px;
|
|
460
454
|
}
|
|
461
455
|
|
|
462
|
-
.dialog-small { --dialog-width:
|
|
463
|
-
.dialog-medium { --dialog-width:
|
|
464
|
-
.dialog-large { --dialog-width:
|
|
465
|
-
.dialog-full { --dialog-width: 100%; min-height: calc(100vh -
|
|
456
|
+
.dialog-small { --dialog-width: var(--athena-dialog-small); }
|
|
457
|
+
.dialog-medium { --dialog-width: var(--athena-dialog-medium); }
|
|
458
|
+
.dialog-large { --dialog-width: var(--athena-dialog-large); }
|
|
459
|
+
.dialog-full { --dialog-width: 100%; min-height: calc(100vh - 40px); }
|
|
466
460
|
|
|
467
461
|
.dialog-title {
|
|
468
462
|
margin: 0 28px 12px 0;
|
|
@@ -482,13 +476,13 @@ textarea {
|
|
|
482
476
|
.dialog-body {
|
|
483
477
|
display: flex;
|
|
484
478
|
flex-direction: column;
|
|
485
|
-
gap:
|
|
479
|
+
gap: var(--athena-space-2);
|
|
486
480
|
}
|
|
487
481
|
|
|
488
482
|
.dialog-footer {
|
|
489
483
|
display: flex;
|
|
490
484
|
justify-content: flex-end;
|
|
491
|
-
gap:
|
|
485
|
+
gap: var(--athena-space-2);
|
|
492
486
|
margin-top: 16px;
|
|
493
487
|
}
|
|
494
488
|
|
|
@@ -497,7 +491,7 @@ textarea {
|
|
|
497
491
|
.tab-list {
|
|
498
492
|
display: flex;
|
|
499
493
|
flex-wrap: wrap;
|
|
500
|
-
border-bottom:
|
|
494
|
+
border-bottom: var(--athena-border-width) solid var(--athena-line);
|
|
501
495
|
}
|
|
502
496
|
|
|
503
497
|
.tab {
|
|
@@ -543,14 +537,14 @@ textarea {
|
|
|
543
537
|
.pagination {
|
|
544
538
|
display: flex;
|
|
545
539
|
flex-wrap: wrap;
|
|
546
|
-
gap:
|
|
540
|
+
gap: var(--athena-space-1);
|
|
547
541
|
align-items: center;
|
|
548
542
|
}
|
|
549
543
|
|
|
550
544
|
.page-button {
|
|
551
545
|
min-width: 32px;
|
|
552
546
|
padding: 4px 8px;
|
|
553
|
-
border:
|
|
547
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
554
548
|
border-radius: 4px;
|
|
555
549
|
background-color: var(--athena-bg);
|
|
556
550
|
color: var(--athena-fg);
|
|
@@ -568,42 +562,43 @@ textarea {
|
|
|
568
562
|
color: var(--athena-accent-fg);
|
|
569
563
|
}
|
|
570
564
|
|
|
571
|
-
/* Accordion */
|
|
565
|
+
/* Accordion: <details> and <summary> */
|
|
572
566
|
|
|
573
567
|
.accordion-item {
|
|
574
|
-
border:
|
|
568
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
575
569
|
}
|
|
576
570
|
|
|
577
571
|
.accordion-item + .accordion-item {
|
|
578
572
|
border-top: 0;
|
|
579
573
|
}
|
|
580
574
|
|
|
581
|
-
.accordion-title {
|
|
582
|
-
margin: 0;
|
|
583
|
-
font-size: 1em;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
575
|
.accordion-header {
|
|
587
576
|
display: flex;
|
|
588
577
|
justify-content: space-between;
|
|
589
578
|
align-items: center;
|
|
590
|
-
width: 100%;
|
|
591
579
|
padding: 10px 14px;
|
|
592
|
-
border: 0;
|
|
593
580
|
background-color: var(--athena-surface);
|
|
594
581
|
color: var(--athena-fg);
|
|
595
|
-
|
|
596
|
-
text-align: left;
|
|
582
|
+
list-style: none;
|
|
597
583
|
cursor: pointer;
|
|
598
584
|
}
|
|
599
585
|
|
|
586
|
+
.accordion-header::-webkit-details-marker {
|
|
587
|
+
display: none;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.accordion-header:focus-visible {
|
|
591
|
+
outline: var(--athena-focus-width) solid var(--athena-focus, var(--athena-accent));
|
|
592
|
+
outline-offset: -2px;
|
|
593
|
+
}
|
|
594
|
+
|
|
600
595
|
.accordion-icon::before {
|
|
601
596
|
content: "▾";
|
|
602
597
|
display: inline-block;
|
|
603
598
|
transition: transform 0.15s;
|
|
604
599
|
}
|
|
605
600
|
|
|
606
|
-
.accordion-open > .accordion-
|
|
601
|
+
.accordion-item[open] > .accordion-header .accordion-icon::before,
|
|
607
602
|
.sidebar-parent[aria-expanded="true"] .accordion-icon::before {
|
|
608
603
|
transform: rotate(180deg);
|
|
609
604
|
}
|
|
@@ -627,7 +622,7 @@ textarea {
|
|
|
627
622
|
margin-top: 4px;
|
|
628
623
|
padding: 4px 0;
|
|
629
624
|
background-color: var(--athena-bg);
|
|
630
|
-
border:
|
|
625
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
631
626
|
border-radius: var(--athena-radius);
|
|
632
627
|
box-shadow: var(--athena-shadow);
|
|
633
628
|
}
|
|
@@ -691,7 +686,7 @@ textarea {
|
|
|
691
686
|
.sidebar-link {
|
|
692
687
|
display: flex;
|
|
693
688
|
align-items: center;
|
|
694
|
-
gap:
|
|
689
|
+
gap: var(--athena-space-2);
|
|
695
690
|
width: 100%;
|
|
696
691
|
padding: 8px 12px;
|
|
697
692
|
border: 0;
|
|
@@ -721,7 +716,7 @@ textarea {
|
|
|
721
716
|
/* Cards, sections, grid */
|
|
722
717
|
|
|
723
718
|
.card {
|
|
724
|
-
border:
|
|
719
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
725
720
|
border-radius: var(--athena-radius);
|
|
726
721
|
background-color: var(--athena-bg);
|
|
727
722
|
overflow: hidden;
|
|
@@ -743,7 +738,7 @@ textarea {
|
|
|
743
738
|
|
|
744
739
|
.card-footer {
|
|
745
740
|
padding: 10px 14px;
|
|
746
|
-
border-top:
|
|
741
|
+
border-top: var(--athena-border-width) solid var(--athena-line);
|
|
747
742
|
background-color: var(--athena-surface-alt);
|
|
748
743
|
}
|
|
749
744
|
|
|
@@ -763,7 +758,7 @@ textarea {
|
|
|
763
758
|
font-weight: 600;
|
|
764
759
|
background-color: var(--athena-surface);
|
|
765
760
|
color: var(--athena-fg);
|
|
766
|
-
border:
|
|
761
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
767
762
|
}
|
|
768
763
|
|
|
769
764
|
.badge-pill {
|
|
@@ -828,7 +823,7 @@ textarea {
|
|
|
828
823
|
|
|
829
824
|
.stat {
|
|
830
825
|
padding: 14px;
|
|
831
|
-
border:
|
|
826
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
832
827
|
border-radius: var(--athena-radius);
|
|
833
828
|
background-color: var(--athena-bg);
|
|
834
829
|
}
|
|
@@ -896,12 +891,12 @@ textarea {
|
|
|
896
891
|
display: flex;
|
|
897
892
|
flex-wrap: wrap;
|
|
898
893
|
align-items: center;
|
|
899
|
-
gap:
|
|
894
|
+
gap: var(--athena-space-1);
|
|
900
895
|
}
|
|
901
896
|
|
|
902
897
|
.combobox-multiple {
|
|
903
898
|
padding: 2px 4px;
|
|
904
|
-
border:
|
|
899
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
905
900
|
border-radius: 3px;
|
|
906
901
|
background-color: var(--athena-bg);
|
|
907
902
|
}
|
|
@@ -923,7 +918,7 @@ textarea {
|
|
|
923
918
|
.chip {
|
|
924
919
|
display: inline-flex;
|
|
925
920
|
align-items: center;
|
|
926
|
-
gap:
|
|
921
|
+
gap: var(--athena-space-1);
|
|
927
922
|
padding: 1px 4px 1px 8px;
|
|
928
923
|
border-radius: 999px;
|
|
929
924
|
background-color: var(--athena-accent);
|
|
@@ -952,7 +947,7 @@ textarea {
|
|
|
952
947
|
padding: 4px 0;
|
|
953
948
|
list-style: none;
|
|
954
949
|
background-color: var(--athena-bg);
|
|
955
|
-
border:
|
|
950
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
956
951
|
border-radius: var(--athena-radius);
|
|
957
952
|
box-shadow: var(--athena-shadow);
|
|
958
953
|
}
|
|
@@ -1035,7 +1030,7 @@ textarea {
|
|
|
1035
1030
|
|
|
1036
1031
|
.stepper-steps {
|
|
1037
1032
|
display: flex;
|
|
1038
|
-
gap:
|
|
1033
|
+
gap: var(--athena-space-2);
|
|
1039
1034
|
padding: 0;
|
|
1040
1035
|
margin: 0 0 16px;
|
|
1041
1036
|
list-style: none;
|
|
@@ -1094,7 +1089,7 @@ textarea {
|
|
|
1094
1089
|
|
|
1095
1090
|
.athena-table th,
|
|
1096
1091
|
.athena-table td {
|
|
1097
|
-
border:
|
|
1092
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
1098
1093
|
padding: 6px 10px;
|
|
1099
1094
|
text-align: left;
|
|
1100
1095
|
}
|
|
@@ -1174,7 +1169,7 @@ textarea {
|
|
|
1174
1169
|
.athena-table td.athena-align-right { text-align: right; }
|
|
1175
1170
|
|
|
1176
1171
|
.athena-table tr:focus-visible {
|
|
1177
|
-
outline:
|
|
1172
|
+
outline: var(--athena-focus-width) solid var(--athena-focus, currentColor);
|
|
1178
1173
|
outline-offset: -2px;
|
|
1179
1174
|
}
|
|
1180
1175
|
|
|
@@ -1291,7 +1286,7 @@ textarea {
|
|
|
1291
1286
|
padding: 4px 0;
|
|
1292
1287
|
list-style: none;
|
|
1293
1288
|
background-color: var(--athena-bg);
|
|
1294
|
-
border:
|
|
1289
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
1295
1290
|
border-radius: var(--athena-radius);
|
|
1296
1291
|
box-shadow: var(--athena-shadow);
|
|
1297
1292
|
}
|
|
@@ -1350,7 +1345,7 @@ textarea {
|
|
|
1350
1345
|
|
|
1351
1346
|
.athena-table-scroll {
|
|
1352
1347
|
overflow: auto;
|
|
1353
|
-
border:
|
|
1348
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
1354
1349
|
}
|
|
1355
1350
|
|
|
1356
1351
|
.athena-table-virtual {
|
|
@@ -1365,17 +1360,17 @@ textarea {
|
|
|
1365
1360
|
}
|
|
1366
1361
|
|
|
1367
1362
|
.athena-table-virtual tbody tr:not(.athena-table-spacer) {
|
|
1368
|
-
height: var(--row-height,
|
|
1363
|
+
height: var(--row-height, var(--athena-row-height));
|
|
1369
1364
|
}
|
|
1370
1365
|
|
|
1371
1366
|
/* The window of rows is computed from a fixed row height, so every row has to be exactly that high. */
|
|
1372
1367
|
/* The doubled class beats a general `.athena-table td` padding of the application. */
|
|
1373
1368
|
.athena-table.athena-table-virtual td {
|
|
1374
1369
|
box-sizing: border-box;
|
|
1375
|
-
height: var(--row-height,
|
|
1370
|
+
height: var(--row-height, var(--athena-row-height));
|
|
1376
1371
|
padding-top: 0;
|
|
1377
1372
|
padding-bottom: 0;
|
|
1378
|
-
line-height: calc(var(--row-height,
|
|
1373
|
+
line-height: calc(var(--row-height, var(--athena-row-height)) - 2px);
|
|
1379
1374
|
white-space: nowrap;
|
|
1380
1375
|
overflow: hidden;
|
|
1381
1376
|
text-overflow: ellipsis;
|
|
@@ -1403,7 +1398,7 @@ textarea {
|
|
|
1403
1398
|
/* Rich text editor */
|
|
1404
1399
|
|
|
1405
1400
|
.richtext {
|
|
1406
|
-
border:
|
|
1401
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
1407
1402
|
border-radius: var(--athena-radius);
|
|
1408
1403
|
background-color: var(--athena-bg);
|
|
1409
1404
|
}
|
|
@@ -1418,7 +1413,7 @@ textarea {
|
|
|
1418
1413
|
align-items: center;
|
|
1419
1414
|
gap: 2px;
|
|
1420
1415
|
padding: 4px;
|
|
1421
|
-
border-bottom:
|
|
1416
|
+
border-bottom: var(--athena-border-width) solid var(--athena-line);
|
|
1422
1417
|
background-color: var(--athena-surface);
|
|
1423
1418
|
border-radius: var(--athena-radius) var(--athena-radius) 0 0;
|
|
1424
1419
|
}
|
|
@@ -1525,7 +1520,7 @@ textarea {
|
|
|
1525
1520
|
.theme-picker {
|
|
1526
1521
|
display: flex;
|
|
1527
1522
|
flex-direction: column;
|
|
1528
|
-
gap:
|
|
1523
|
+
gap: var(--athena-space-4);
|
|
1529
1524
|
}
|
|
1530
1525
|
|
|
1531
1526
|
.theme-picker-group {
|
|
@@ -1537,16 +1532,16 @@ textarea {
|
|
|
1537
1532
|
.theme-picker-options {
|
|
1538
1533
|
display: flex;
|
|
1539
1534
|
flex-wrap: wrap;
|
|
1540
|
-
gap:
|
|
1535
|
+
gap: var(--athena-space-3);
|
|
1541
1536
|
}
|
|
1542
1537
|
|
|
1543
1538
|
.theme-picker-option {
|
|
1544
1539
|
display: flex;
|
|
1545
1540
|
flex-direction: column;
|
|
1546
|
-
gap:
|
|
1541
|
+
gap: var(--athena-space-1);
|
|
1547
1542
|
min-width: 140px;
|
|
1548
1543
|
padding: 8px;
|
|
1549
|
-
border:
|
|
1544
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
1550
1545
|
border-radius: var(--athena-radius);
|
|
1551
1546
|
cursor: pointer;
|
|
1552
1547
|
}
|
|
@@ -1557,7 +1552,7 @@ textarea {
|
|
|
1557
1552
|
}
|
|
1558
1553
|
|
|
1559
1554
|
.theme-picker-option:has(input:focus-visible) {
|
|
1560
|
-
outline:
|
|
1555
|
+
outline: var(--athena-focus-width) solid var(--athena-focus, var(--athena-accent));
|
|
1561
1556
|
outline-offset: 2px;
|
|
1562
1557
|
}
|
|
1563
1558
|
|
|
@@ -1574,7 +1569,7 @@ textarea {
|
|
|
1574
1569
|
|
|
1575
1570
|
.theme-preview {
|
|
1576
1571
|
display: block;
|
|
1577
|
-
border:
|
|
1572
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
1578
1573
|
border-radius: 4px;
|
|
1579
1574
|
overflow: hidden;
|
|
1580
1575
|
background: var(--athena-bg);
|
|
@@ -1705,7 +1700,7 @@ textarea {
|
|
|
1705
1700
|
}
|
|
1706
1701
|
|
|
1707
1702
|
.athena-chart [tabindex]:focus-visible {
|
|
1708
|
-
outline:
|
|
1703
|
+
outline: var(--athena-focus-width) solid var(--athena-focus, currentColor);
|
|
1709
1704
|
outline-offset: 2px;
|
|
1710
1705
|
}
|
|
1711
1706
|
|
|
@@ -1775,7 +1770,7 @@ textarea {
|
|
|
1775
1770
|
}
|
|
1776
1771
|
|
|
1777
1772
|
.athena-menu .menu-control:focus-visible {
|
|
1778
|
-
outline:
|
|
1773
|
+
outline: var(--athena-focus-width) solid var(--athena-focus, var(--athena-accent));
|
|
1779
1774
|
outline-offset: -2px;
|
|
1780
1775
|
}
|
|
1781
1776
|
|
|
@@ -1827,7 +1822,7 @@ textarea {
|
|
|
1827
1822
|
list-style: none;
|
|
1828
1823
|
background: var(--athena-bg);
|
|
1829
1824
|
color: var(--athena-fg);
|
|
1830
|
-
border:
|
|
1825
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
1831
1826
|
border-radius: var(--athena-radius);
|
|
1832
1827
|
box-shadow: var(--athena-shadow);
|
|
1833
1828
|
}
|
|
@@ -1854,7 +1849,7 @@ textarea {
|
|
|
1854
1849
|
z-index: 30;
|
|
1855
1850
|
inset: auto 0 0;
|
|
1856
1851
|
background: var(--athena-bg);
|
|
1857
|
-
border-top:
|
|
1852
|
+
border-top: var(--athena-border-width) solid var(--athena-line);
|
|
1858
1853
|
}
|
|
1859
1854
|
|
|
1860
1855
|
.athena-menu-bottom-tabs .athena-menu-list {
|
|
@@ -1893,7 +1888,7 @@ textarea {
|
|
|
1893
1888
|
z-index: 30;
|
|
1894
1889
|
inset: auto 0 0;
|
|
1895
1890
|
background: var(--athena-bg);
|
|
1896
|
-
border-top:
|
|
1891
|
+
border-top: var(--athena-border-width) solid var(--athena-line);
|
|
1897
1892
|
}
|
|
1898
1893
|
|
|
1899
1894
|
.athena-menu-responsive .athena-menu-list {
|
|
@@ -1997,7 +1992,7 @@ textarea {
|
|
|
1997
1992
|
}
|
|
1998
1993
|
|
|
1999
1994
|
.athena-chart .chart-hit:focus-visible {
|
|
2000
|
-
outline:
|
|
1995
|
+
outline: var(--athena-focus-width) solid var(--athena-focus, var(--athena-accent));
|
|
2001
1996
|
outline-offset: 2px;
|
|
2002
1997
|
}
|
|
2003
1998
|
|
|
@@ -2028,7 +2023,7 @@ textarea {
|
|
|
2028
2023
|
flex-wrap: wrap;
|
|
2029
2024
|
align-items: flex-start;
|
|
2030
2025
|
justify-content: space-between;
|
|
2031
|
-
gap:
|
|
2026
|
+
gap: var(--athena-space-3);
|
|
2032
2027
|
}
|
|
2033
2028
|
|
|
2034
2029
|
.page-title {
|
|
@@ -2043,12 +2038,12 @@ textarea {
|
|
|
2043
2038
|
.page-actions {
|
|
2044
2039
|
display: flex;
|
|
2045
2040
|
flex-wrap: wrap;
|
|
2046
|
-
gap:
|
|
2041
|
+
gap: var(--athena-space-2);
|
|
2047
2042
|
}
|
|
2048
2043
|
|
|
2049
2044
|
.facts {
|
|
2050
2045
|
display: grid;
|
|
2051
|
-
gap:
|
|
2046
|
+
gap: var(--athena-space-2);
|
|
2052
2047
|
margin: 0;
|
|
2053
2048
|
}
|
|
2054
2049
|
|
|
@@ -2069,7 +2064,7 @@ textarea {
|
|
|
2069
2064
|
|
|
2070
2065
|
.facts-inline .fact {
|
|
2071
2066
|
flex-direction: row;
|
|
2072
|
-
gap:
|
|
2067
|
+
gap: var(--athena-space-3);
|
|
2073
2068
|
}
|
|
2074
2069
|
|
|
2075
2070
|
.facts-inline dt {
|
|
@@ -2081,7 +2076,7 @@ textarea {
|
|
|
2081
2076
|
display: flex;
|
|
2082
2077
|
flex-direction: column;
|
|
2083
2078
|
align-items: center;
|
|
2084
|
-
gap:
|
|
2079
|
+
gap: var(--athena-space-2);
|
|
2085
2080
|
padding: 32px 16px;
|
|
2086
2081
|
text-align: center;
|
|
2087
2082
|
color: var(--athena-muted);
|
|
@@ -2107,7 +2102,7 @@ textarea {
|
|
|
2107
2102
|
display: flex;
|
|
2108
2103
|
align-items: center;
|
|
2109
2104
|
justify-content: center;
|
|
2110
|
-
gap:
|
|
2105
|
+
gap: var(--athena-space-2);
|
|
2111
2106
|
padding: 24px;
|
|
2112
2107
|
color: var(--athena-muted);
|
|
2113
2108
|
}
|
|
@@ -2128,3 +2123,5 @@ textarea {
|
|
|
2128
2123
|
.stat.is-ok .stat-value { color: var(--athena-success); }
|
|
2129
2124
|
.stat.is-warn .stat-value { color: var(--athena-warning); }
|
|
2130
2125
|
.stat.is-bad .stat-value { color: var(--athena-danger); }
|
|
2126
|
+
|
|
2127
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/* Athena UI design tokens
|
|
2
|
+
|
|
3
|
+
Every visual decision of Athena UI is one of these custom properties, so an application restyles it by setting them, never by overriding a component:
|
|
4
|
+
|
|
5
|
+
:root { --athena-accent: #8e44ad; --athena-radius: 2px; }
|
|
6
|
+
|
|
7
|
+
This file is imported into the cascade layer "athena" by default/style.css, so a :root rule of the application (not in a layer) wins.
|
|
8
|
+
|
|
9
|
+
Colours come in a light and a dark set. Without the attribute data-mode on <html> the page follows the system (prefers-color-scheme); with
|
|
10
|
+
createThemeManager (or theme-boot.js) the person can choose light, dark or "like the system", and a named theme (appearance.css) can replace the
|
|
11
|
+
colours. */
|
|
12
|
+
|
|
13
|
+
:root {
|
|
14
|
+
/* colours */
|
|
15
|
+
--athena-bg: #fff;
|
|
16
|
+
--athena-fg: #1a1a1a;
|
|
17
|
+
--athena-muted: #666;
|
|
18
|
+
--athena-border: #000;
|
|
19
|
+
--athena-line: #ccc;
|
|
20
|
+
--athena-surface: #f2f2f2;
|
|
21
|
+
--athena-surface-alt: #fafafa;
|
|
22
|
+
--athena-hover: #e8f0fe;
|
|
23
|
+
--athena-overlay: rgb(0 0 0 / 40%);
|
|
24
|
+
--athena-accent: #2f6db5;
|
|
25
|
+
--athena-accent-fg: #fff;
|
|
26
|
+
--athena-focus: #1b4f8f;
|
|
27
|
+
--athena-danger: #c0392b;
|
|
28
|
+
--athena-success: #1e8449;
|
|
29
|
+
--athena-warning: #9a6700;
|
|
30
|
+
--athena-info: #2471a3;
|
|
31
|
+
--athena-shadow: 0 4px 14px rgb(0 0 0 / 18%);
|
|
32
|
+
|
|
33
|
+
/* shape and spacing */
|
|
34
|
+
--athena-radius: 6px;
|
|
35
|
+
--athena-border-width: 1px;
|
|
36
|
+
--athena-space-1: 4px;
|
|
37
|
+
--athena-space-2: 8px;
|
|
38
|
+
--athena-space-3: 12px;
|
|
39
|
+
--athena-space-4: 16px;
|
|
40
|
+
--grid-gap: 16px;
|
|
41
|
+
|
|
42
|
+
/* focus ring: the colour is --athena-focus */
|
|
43
|
+
--athena-focus-width: 2px;
|
|
44
|
+
|
|
45
|
+
/* components */
|
|
46
|
+
--athena-dialog-small: 360px;
|
|
47
|
+
--athena-dialog-medium: 480px;
|
|
48
|
+
--athena-dialog-large: 720px;
|
|
49
|
+
--athena-row-height: 36px; /* rows of a virtual table; generateTable({ virtual: { rowHeight } }) sets --row-height on the table */
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* The dark colours: chosen with data-mode="dark" ... */
|
|
53
|
+
:root[data-mode="dark"] {
|
|
54
|
+
color-scheme: dark;
|
|
55
|
+
--athena-bg: #16181d;
|
|
56
|
+
--athena-fg: #e6e8eb;
|
|
57
|
+
--athena-muted: #9aa3ad;
|
|
58
|
+
--athena-border: #3a3f47;
|
|
59
|
+
--athena-line: #3a3f47;
|
|
60
|
+
--athena-surface: #23272e;
|
|
61
|
+
--athena-surface-alt: #1c1f25;
|
|
62
|
+
--athena-hover: #2b3340;
|
|
63
|
+
--athena-overlay: rgb(0 0 0 / 65%);
|
|
64
|
+
--athena-accent: #5b9bd5;
|
|
65
|
+
--athena-accent-fg: #0b1118;
|
|
66
|
+
--athena-focus: #8cc0ee;
|
|
67
|
+
--athena-danger: #ef6b5e;
|
|
68
|
+
--athena-success: #4cc38a;
|
|
69
|
+
--athena-warning: #e0b04a;
|
|
70
|
+
--athena-info: #5b9bd5;
|
|
71
|
+
--athena-shadow: 0 4px 14px rgb(0 0 0 / 55%);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* ... or, when nothing was chosen, by the system */
|
|
75
|
+
@media (prefers-color-scheme: dark) {
|
|
76
|
+
:root:not([data-mode]) {
|
|
77
|
+
color-scheme: dark;
|
|
78
|
+
--athena-bg: #16181d;
|
|
79
|
+
--athena-fg: #e6e8eb;
|
|
80
|
+
--athena-muted: #9aa3ad;
|
|
81
|
+
--athena-border: #3a3f47;
|
|
82
|
+
--athena-line: #3a3f47;
|
|
83
|
+
--athena-surface: #23272e;
|
|
84
|
+
--athena-surface-alt: #1c1f25;
|
|
85
|
+
--athena-hover: #2b3340;
|
|
86
|
+
--athena-overlay: rgb(0 0 0 / 65%);
|
|
87
|
+
--athena-accent: #5b9bd5;
|
|
88
|
+
--athena-accent-fg: #0b1118;
|
|
89
|
+
--athena-focus: #8cc0ee;
|
|
90
|
+
--athena-danger: #ef6b5e;
|
|
91
|
+
--athena-success: #4cc38a;
|
|
92
|
+
--athena-warning: #e0b04a;
|
|
93
|
+
--athena-info: #5b9bd5;
|
|
94
|
+
--athena-shadow: 0 4px 14px rgb(0 0 0 / 55%);
|
|
95
|
+
}
|
|
96
|
+
}
|
package/src/router.js
ADDED
package/src/sanitize.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//sanitize entry of Athena UI: sanitizeHtml, htmlToText, isSafeUrl
|
|
2
|
+
//Import only what you use: `import { generateTable } from "athena-ui-js/sanitize"`.
|
|
3
|
+
//LICENCE: MIT
|
|
4
|
+
//Repository: https://github.com/csabatibortoth/athena-ui
|
|
5
|
+
|
|
6
|
+
export * from "./libs/core/sanitize.js";
|
package/src/session.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//session entry of Athena UI: the session cookie, createAuthState, Cookies
|
|
2
|
+
//Import only what you use: `import { generateTable } from "athena-ui-js/session"`.
|
|
3
|
+
//LICENCE: MIT
|
|
4
|
+
//Repository: https://github.com/csabatibortoth/athena-ui
|
|
5
|
+
|
|
6
|
+
export * from "./libs/hephaestus/auth/session.js";
|
|
7
|
+
export * from "./libs/hephaestus/auth/authState.js";
|
|
8
|
+
export * from "./libs/core/cookies.js";
|
package/src/table.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//table entry of Athena UI: generateTable (rows from memory or a data source, virtual scrolling)
|
|
2
|
+
//Import only what you use: `import { generateTable } from "athena-ui-js/table"`.
|
|
3
|
+
//LICENCE: MIT
|
|
4
|
+
//Repository: https://github.com/csabatibortoth/athena-ui
|
|
5
|
+
|
|
6
|
+
export * from "./libs/hephaestus/tableGenerator/tableGenerator.js";
|