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.
Files changed (124) hide show
  1. package/README.md +100 -54
  2. package/docs/migration-2.0.md +83 -0
  3. package/docs/styling.md +86 -0
  4. package/package.json +108 -25
  5. package/src/athena-ui.js +54 -97
  6. package/src/chart.js +6 -0
  7. package/src/classic.js +11 -0
  8. package/src/components.js +6 -0
  9. package/src/controls.js +8 -0
  10. package/src/csv.js +6 -0
  11. package/src/dialog.js +7 -0
  12. package/src/dom.js +6 -0
  13. package/src/feedback.js +6 -0
  14. package/src/format.js +6 -0
  15. package/src/forms.js +7 -0
  16. package/src/i18n.js +6 -0
  17. package/src/inputs.js +9 -0
  18. package/src/libs/config/config.js +1 -9
  19. package/src/libs/core/controls.js +6 -14
  20. package/src/libs/core/cookies.js +55 -0
  21. package/src/libs/core/i18n.js +40 -6
  22. package/src/libs/core/validation.js +2 -2
  23. package/src/libs/hephaestus/LayoutGenerator/basicLayoutGenerator.js +9 -1
  24. package/src/libs/hephaestus/MenuGenerator/menuGenerator.js +16 -4
  25. package/src/libs/hephaestus/auth/session.js +1 -1
  26. package/src/libs/hephaestus/dialogGenerator/dialogGenerator.js +25 -17
  27. package/src/libs/hephaestus/formGenerator/changePasswordFormGenerator.js +4 -4
  28. package/src/libs/hephaestus/formGenerator/formUtils.js +0 -4
  29. package/src/libs/hephaestus/formGenerator/loginFormGenerator.js +2 -3
  30. package/src/libs/hephaestus/formGenerator/registrationFormGenerator.js +3 -3
  31. package/src/libs/hephaestus/hephaestus.js +0 -10
  32. package/src/libs/hephaestus/inputGenerator/dropZoneGenerator.js +1 -1
  33. package/src/libs/hephaestus/modalGenerator/modalGenerator.js +13 -6
  34. package/src/libs/hephaestus/navigationGenerator/navigationGenerator.js +20 -24
  35. package/src/menu.js +6 -0
  36. package/src/navigation.js +6 -0
  37. package/src/res/themes/default/style.css +97 -100
  38. package/src/res/themes/tokens.css +96 -0
  39. package/src/router.js +6 -0
  40. package/src/sanitize.js +6 -0
  41. package/src/session.js +8 -0
  42. package/src/table.js +6 -0
  43. package/src/testing.js +11 -1
  44. package/src/theme.js +7 -0
  45. package/src/validation.js +6 -0
  46. package/types/athena-ui.d.ts +96 -0
  47. package/types/chart.d.ts +1 -0
  48. package/types/classic.d.ts +1 -0
  49. package/types/components.d.ts +1 -0
  50. package/types/controls.d.ts +3 -0
  51. package/types/csv.d.ts +1 -0
  52. package/types/dialog.d.ts +2 -0
  53. package/types/dom.d.ts +1 -0
  54. package/types/feedback.d.ts +1 -0
  55. package/types/format.d.ts +1 -0
  56. package/types/forms.d.ts +2 -0
  57. package/types/i18n.d.ts +1 -0
  58. package/types/inputs.d.ts +4 -0
  59. package/types/libs/config/config.d.ts +96 -0
  60. package/types/libs/config/hooks.d.ts +8 -0
  61. package/types/libs/core/combobox.d.ts +10 -0
  62. package/types/libs/core/controls.d.ts +28 -0
  63. package/types/libs/core/cookies.d.ts +27 -0
  64. package/types/libs/core/csv.d.ts +12 -0
  65. package/types/libs/core/dateRange.d.ts +72 -0
  66. package/types/libs/core/dom.d.ts +65 -0
  67. package/types/libs/core/elementGenerator.d.ts +30 -0
  68. package/types/libs/core/errors.d.ts +29 -0
  69. package/types/libs/core/focus.d.ts +6 -0
  70. package/types/libs/core/format.d.ts +21 -0
  71. package/types/libs/core/hungarianControls.d.ts +2 -0
  72. package/types/libs/core/i18n.d.ts +17 -0
  73. package/types/libs/core/pagination.d.ts +5 -0
  74. package/types/libs/core/sanitize.d.ts +6 -0
  75. package/types/libs/core/tableMath.d.ts +26 -0
  76. package/types/libs/core/theme.d.ts +39 -0
  77. package/types/libs/core/validation.d.ts +56 -0
  78. package/types/libs/hephaestus/LayoutGenerator/basicLayoutGenerator.d.ts +10 -0
  79. package/types/libs/hephaestus/LayoutGenerator/footerContentGenerator.d.ts +4 -0
  80. package/types/libs/hephaestus/LayoutGenerator/headerContentGenerator.d.ts +20 -0
  81. package/types/libs/hephaestus/LayoutGenerator/wrapperContentGenerator.d.ts +1 -0
  82. package/types/libs/hephaestus/MenuGenerator/basicMenuGenerator.d.ts +14 -0
  83. package/types/libs/hephaestus/MenuGenerator/menuGenerator.d.ts +65 -0
  84. package/types/libs/hephaestus/auth/authState.d.ts +26 -0
  85. package/types/libs/hephaestus/auth/session.d.ts +26 -0
  86. package/types/libs/hephaestus/chartGenerator/chartGenerator.d.ts +91 -0
  87. package/types/libs/hephaestus/componentGenerator/componentGenerator.d.ts +222 -0
  88. package/types/libs/hephaestus/componentGenerator/themePicker.d.ts +24 -0
  89. package/types/libs/hephaestus/dialogGenerator/dialogGenerator.d.ts +120 -0
  90. package/types/libs/hephaestus/feedbackGenerator/feedbackGenerator.d.ts +86 -0
  91. package/types/libs/hephaestus/formGenerator/authForms.d.ts +122 -0
  92. package/types/libs/hephaestus/formGenerator/changePasswordFormGenerator.d.ts +6 -0
  93. package/types/libs/hephaestus/formGenerator/formBuilder.d.ts +113 -0
  94. package/types/libs/hephaestus/formGenerator/formUtils.d.ts +8 -0
  95. package/types/libs/hephaestus/formGenerator/loginFormGenerator.d.ts +11 -0
  96. package/types/libs/hephaestus/formGenerator/lostPasswordFormGenerator.d.ts +4 -0
  97. package/types/libs/hephaestus/formGenerator/registrationFormGenerator.d.ts +7 -0
  98. package/types/libs/hephaestus/hephaestus.d.ts +3 -0
  99. package/types/libs/hephaestus/inputGenerator/dropZoneGenerator.d.ts +48 -0
  100. package/types/libs/hephaestus/inputGenerator/inputGenerator.d.ts +185 -0
  101. package/types/libs/hephaestus/inputGenerator/richTextGenerator.d.ts +49 -0
  102. package/types/libs/hephaestus/modalGenerator/modalGenerator.d.ts +2 -0
  103. package/types/libs/hephaestus/navigationGenerator/navigationGenerator.d.ts +150 -0
  104. package/types/libs/hephaestus/router/matchRoute.d.ts +12 -0
  105. package/types/libs/hephaestus/router/router.d.ts +67 -0
  106. package/types/libs/hephaestus/tableGenerator/tableGenerator.d.ts +120 -0
  107. package/types/menu.d.ts +1 -0
  108. package/types/navigation.d.ts +1 -0
  109. package/types/res/themes/themes.d.ts +7 -0
  110. package/types/router.d.ts +1 -0
  111. package/types/sanitize.d.ts +1 -0
  112. package/types/session.d.ts +3 -0
  113. package/types/table.d.ts +1 -0
  114. package/types/testing.d.ts +27 -0
  115. package/types/theme-boot.d.ts +0 -0
  116. package/types/theme.d.ts +2 -0
  117. package/types/validation.d.ts +1 -0
  118. package/src/libs/crypto-js/LICENSE +0 -24
  119. package/src/libs/crypto-js/crypto-js.js +0 -6657
  120. package/src/libs/js-cookie/LICENSE +0 -21
  121. package/src/libs/js-cookie/src/api.mjs +0 -103
  122. package/src/libs/js-cookie/src/assign.mjs +0 -10
  123. package/src/libs/js-cookie/src/converter.mjs +0 -14
  124. package/src/libs/libs.js +0 -13
@@ -1,27 +1,12 @@
1
- /* Default Athena UI Theme */
2
-
3
- /* Colors and sizes. The dark theme only overrides these. */
4
-
5
- :root {
6
- --athena-bg: #fff;
7
- --athena-fg: #1a1a1a;
8
- --athena-muted: #666;
9
- --athena-border: #000;
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: 1px solid var(--athena-line);
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: 1px solid var(--athena-line);
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: 12px;
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: 8px;
188
+ gap: var(--athena-space-2);
204
189
  }
205
190
 
206
191
  .field {
207
192
  display: flex;
208
193
  flex-direction: column;
209
- gap: 4px;
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: 1px solid var(--athena-line);
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: 12px;
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: 8px;
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: 1px solid var(--athena-line);
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 (built on .modal) */
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-backdrop {
451
- display: block; /* shown by the class, not by an inline style (CSP) */
452
- padding-top: 12vh;
446
+ dialog.dialog::backdrop {
447
+ background-color: var(--athena-overlay);
453
448
  }
454
449
 
455
- .dialog {
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
- width: min(var(--dialog-width, 480px), 92%);
458
- border-radius: var(--athena-radius);
459
- box-shadow: var(--athena-shadow);
453
+ padding: 20px;
460
454
  }
461
455
 
462
- .dialog-small { --dialog-width: 360px; }
463
- .dialog-medium { --dialog-width: 480px; }
464
- .dialog-large { --dialog-width: 720px; }
465
- .dialog-full { --dialog-width: 100%; min-height: calc(100vh - 12vh - 40px); }
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: 8px;
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: 8px;
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: 1px solid var(--athena-line);
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: 4px;
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: 1px solid var(--athena-line);
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: 1px solid var(--athena-line);
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
- font: inherit;
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-title .accordion-icon::before,
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: 1px solid var(--athena-line);
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: 8px;
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: 1px solid var(--athena-line);
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: 1px solid var(--athena-line);
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: 1px solid var(--athena-line);
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: 1px solid var(--athena-line);
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: 4px;
894
+ gap: var(--athena-space-1);
900
895
  }
901
896
 
902
897
  .combobox-multiple {
903
898
  padding: 2px 4px;
904
- border: 1px solid var(--athena-line);
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: 4px;
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: 1px solid var(--athena-line);
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: 8px;
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: 1px solid var(--athena-line);
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: 2px solid var(--athena-focus, currentColor);
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: 1px solid var(--athena-line);
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: 1px solid var(--athena-line);
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, 36px);
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, 36px);
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, 36px) - 2px);
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: 1px solid var(--athena-line);
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: 1px solid var(--athena-line);
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: 16px;
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: 12px;
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: 4px;
1541
+ gap: var(--athena-space-1);
1547
1542
  min-width: 140px;
1548
1543
  padding: 8px;
1549
- border: 1px solid var(--athena-line);
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: 2px solid var(--athena-focus, var(--athena-accent));
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: 1px solid var(--athena-line);
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: 2px solid var(--athena-focus, currentColor);
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: 2px solid var(--athena-focus, var(--athena-accent));
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: 1px solid var(--athena-line);
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: 1px solid var(--athena-line);
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: 1px solid var(--athena-line);
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: 2px solid var(--athena-focus, var(--athena-accent));
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: 12px;
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: 8px;
2041
+ gap: var(--athena-space-2);
2047
2042
  }
2048
2043
 
2049
2044
  .facts {
2050
2045
  display: grid;
2051
- gap: 8px;
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: 12px;
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: 8px;
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: 8px;
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
@@ -0,0 +1,6 @@
1
+ //router entry of Athena UI: createRouter
2
+ //Import only what you use: `import { generateTable } from "athena-ui-js/router"`.
3
+ //LICENCE: MIT
4
+ //Repository: https://github.com/csabatibortoth/athena-ui
5
+
6
+ export * from "./libs/hephaestus/router/router.js";
@@ -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";