athena-ui-js 1.2.0 → 1.3.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 +228 -22
- package/package.json +9 -7
- package/src/athena-ui.js +33 -10
- package/src/libs/config/config.js +8 -1
- package/src/libs/core/controls.js +153 -0
- package/src/libs/core/dateRange.js +121 -0
- package/src/libs/core/dom.js +58 -8
- package/src/libs/{hephaestus/HTMLElementGenerator/src/HTMLElementGenerator.js → core/elementGenerator.js} +23 -21
- package/src/libs/{hephaestus/HTMLElementGenerator/src → core}/errors.js +7 -5
- package/src/libs/core/format.js +51 -0
- package/src/libs/core/hungarianControls.js +41 -0
- package/src/libs/core/i18n.js +64 -0
- package/src/libs/core/theme.js +131 -0
- package/src/libs/hephaestus/LayoutGenerator/basicLayoutGenerator.js +4 -6
- package/src/libs/hephaestus/LayoutGenerator/footerContentGenerator.js +2 -4
- package/src/libs/hephaestus/LayoutGenerator/headerContentGenerator.js +12 -5
- package/src/libs/hephaestus/MenuGenerator/basicMenuGenerator.js +3 -3
- package/src/libs/hephaestus/MenuGenerator/menuGenerator.js +253 -0
- package/src/libs/hephaestus/auth/authState.js +58 -0
- package/src/libs/hephaestus/chartGenerator/chartGenerator.js +519 -87
- package/src/libs/hephaestus/componentGenerator/componentGenerator.js +121 -4
- package/src/libs/hephaestus/componentGenerator/themePicker.js +73 -0
- package/src/libs/hephaestus/dialogGenerator/dialogGenerator.js +88 -8
- package/src/libs/hephaestus/feedbackGenerator/feedbackGenerator.js +21 -0
- package/src/libs/hephaestus/formGenerator/authForms.js +130 -0
- package/src/libs/hephaestus/formGenerator/formUtils.js +10 -9
- package/src/libs/hephaestus/formGenerator/loginFormGenerator.js +9 -9
- package/src/libs/hephaestus/hephaestus.js +7 -2
- package/src/libs/hephaestus/inputGenerator/inputGenerator.js +30 -1
- package/src/libs/hephaestus/modalGenerator/modalGenerator.js +17 -11
- package/src/libs/hephaestus/router/router.js +54 -5
- package/src/libs/hephaestus/tableGenerator/tableGenerator.js +290 -16
- package/src/libs/libs.js +3 -3
- package/src/res/themes/appearance.css +154 -0
- package/src/res/themes/default/style.css +609 -0
- package/src/theme-boot.js +25 -0
- package/src/libs/hephaestus/HTMLControlGenerator/LICENSE +0 -21
- package/src/libs/hephaestus/HTMLControlGenerator/src/HTMLControlGenerator.min.js +0 -5
- package/src/libs/hephaestus/HTMLElementGenerator/LICENSE +0 -21
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/* Athena UI appearance: themes and modes (light / dark).
|
|
2
|
+
|
|
3
|
+
THE CONTRACT
|
|
4
|
+
------------
|
|
5
|
+
createThemeManager() (and theme-boot.js, before the page is drawn) put two attributes on <html>:
|
|
6
|
+
|
|
7
|
+
<html data-theme="athena" data-mode="dark">
|
|
8
|
+
|
|
9
|
+
data-theme is the id of a theme, data-mode is "light" or "dark" (the choice "Like the system" is resolved to one of them).
|
|
10
|
+
A theme is a pair of blocks that set the design tokens below. Nothing else is needed:
|
|
11
|
+
|
|
12
|
+
[data-theme="ocean"][data-mode="light"] { --athena-bg: #f4f9fb; ... }
|
|
13
|
+
[data-theme="ocean"][data-mode="dark"] { --athena-bg: #0b1c24; ... }
|
|
14
|
+
|
|
15
|
+
The selectors also match any other element that has the two attributes, so a preview (generateThemePicker) or one dark panel on a
|
|
16
|
+
light page is just an element with data-theme and data-mode.
|
|
17
|
+
|
|
18
|
+
TOKENS
|
|
19
|
+
------
|
|
20
|
+
--athena-bg / --athena-fg page background and text
|
|
21
|
+
--athena-muted secondary text (keep 4.5 : 1 against --athena-bg)
|
|
22
|
+
--athena-line / --athena-border borders and dividers
|
|
23
|
+
--athena-surface / -alt cards, table heads, striped rows
|
|
24
|
+
--athena-hover hovered and selected rows, menu items
|
|
25
|
+
--athena-overlay the dim layer behind a dialog
|
|
26
|
+
--athena-accent / -fg primary buttons, the active menu item, and the text on them
|
|
27
|
+
--athena-focus outline of the element that has the keyboard focus
|
|
28
|
+
--athena-danger / success / warning / info states
|
|
29
|
+
--athena-shadow elevation of dialogs and menus
|
|
30
|
+
--series-1 ... --series-8 the colours of charts, in a fixed order
|
|
31
|
+
|
|
32
|
+
To use it: load this file after style.css, put the attributes on <html> (theme-boot.js + createThemeManager), and add your own
|
|
33
|
+
themes as more pairs of blocks. Without the script the page follows the system (the media query at the end). */
|
|
34
|
+
|
|
35
|
+
/* ------------------------------------------------------------ Athena */
|
|
36
|
+
|
|
37
|
+
[data-theme="athena"][data-mode="light"] {
|
|
38
|
+
color-scheme: light;
|
|
39
|
+
--athena-bg: #fff;
|
|
40
|
+
--athena-fg: #1a1a1a;
|
|
41
|
+
--athena-muted: #5c5c5c;
|
|
42
|
+
--athena-border: #000;
|
|
43
|
+
--athena-line: #ccc;
|
|
44
|
+
--athena-surface: #f2f2f2;
|
|
45
|
+
--athena-surface-alt: #fafafa;
|
|
46
|
+
--athena-hover: #e8f0fe;
|
|
47
|
+
--athena-overlay: rgb(0 0 0 / 40%);
|
|
48
|
+
--athena-accent: #2f6db5;
|
|
49
|
+
--athena-accent-fg: #fff;
|
|
50
|
+
--athena-focus: #1b4f8f;
|
|
51
|
+
--athena-danger: #c0392b;
|
|
52
|
+
--athena-success: #1e8449;
|
|
53
|
+
--athena-warning: #9a6700;
|
|
54
|
+
--athena-info: #2471a3;
|
|
55
|
+
--athena-shadow: 0 4px 14px rgb(0 0 0 / 18%);
|
|
56
|
+
--series-1: #4e79a7; --series-2: #d9731a; --series-3: #d0393b; --series-4: #3f9a95;
|
|
57
|
+
--series-5: #3f8a3a; --series-6: #a98a00; --series-7: #94598c; --series-8: #5f6878;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[data-theme="athena"][data-mode="dark"] {
|
|
61
|
+
color-scheme: dark;
|
|
62
|
+
--athena-bg: #16181d;
|
|
63
|
+
--athena-fg: #e6e8eb;
|
|
64
|
+
--athena-muted: #9aa3ad;
|
|
65
|
+
--athena-border: #3a3f47;
|
|
66
|
+
--athena-line: #3a3f47;
|
|
67
|
+
--athena-surface: #23272e;
|
|
68
|
+
--athena-surface-alt: #1c1f25;
|
|
69
|
+
--athena-hover: #2b3340;
|
|
70
|
+
--athena-overlay: rgb(0 0 0 / 65%);
|
|
71
|
+
--athena-accent: #5b9bd5;
|
|
72
|
+
--athena-accent-fg: #0b1118;
|
|
73
|
+
--athena-focus: #8cc0ee;
|
|
74
|
+
--athena-danger: #ef6b5e;
|
|
75
|
+
--athena-success: #4cc38a;
|
|
76
|
+
--athena-warning: #e0b04a;
|
|
77
|
+
--athena-info: #5b9bd5;
|
|
78
|
+
--athena-shadow: 0 4px 14px rgb(0 0 0 / 55%);
|
|
79
|
+
--series-1: #6fa3d6; --series-2: #f0a04b; --series-3: #ef7b7d; --series-4: #6fcfc8;
|
|
80
|
+
--series-5: #7bc576; --series-6: #f1d36a; --series-7: #c79bc0; --series-8: #a9b1c0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* ------------------------------------------------------------ High contrast */
|
|
84
|
+
|
|
85
|
+
[data-theme="contrast"][data-mode="light"] {
|
|
86
|
+
color-scheme: light;
|
|
87
|
+
--athena-bg: #fff;
|
|
88
|
+
--athena-fg: #000;
|
|
89
|
+
--athena-muted: #333;
|
|
90
|
+
--athena-border: #000;
|
|
91
|
+
--athena-line: #000;
|
|
92
|
+
--athena-surface: #fff;
|
|
93
|
+
--athena-surface-alt: #f0f0f0;
|
|
94
|
+
--athena-hover: #ffe97a;
|
|
95
|
+
--athena-overlay: rgb(0 0 0 / 70%);
|
|
96
|
+
--athena-accent: #00389a;
|
|
97
|
+
--athena-accent-fg: #fff;
|
|
98
|
+
--athena-focus: #b00020;
|
|
99
|
+
--athena-danger: #a00000;
|
|
100
|
+
--athena-success: #005a1e;
|
|
101
|
+
--athena-warning: #6b4500;
|
|
102
|
+
--athena-info: #00389a;
|
|
103
|
+
--athena-shadow: none;
|
|
104
|
+
--series-1: #00389a; --series-2: #a84300; --series-3: #a00000; --series-4: #006064;
|
|
105
|
+
--series-5: #005a1e; --series-6: #6b4500; --series-7: #6a1b9a; --series-8: #333;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
[data-theme="contrast"][data-mode="dark"] {
|
|
109
|
+
color-scheme: dark;
|
|
110
|
+
--athena-bg: #000;
|
|
111
|
+
--athena-fg: #fff;
|
|
112
|
+
--athena-muted: #d0d0d0;
|
|
113
|
+
--athena-border: #fff;
|
|
114
|
+
--athena-line: #fff;
|
|
115
|
+
--athena-surface: #000;
|
|
116
|
+
--athena-surface-alt: #1a1a1a;
|
|
117
|
+
--athena-hover: #3a3000;
|
|
118
|
+
--athena-overlay: rgb(0 0 0 / 80%);
|
|
119
|
+
--athena-accent: #ffe14d;
|
|
120
|
+
--athena-accent-fg: #000;
|
|
121
|
+
--athena-focus: #ffe14d;
|
|
122
|
+
--athena-danger: #ff8a80;
|
|
123
|
+
--athena-success: #69f0ae;
|
|
124
|
+
--athena-warning: #ffd740;
|
|
125
|
+
--athena-info: #80d8ff;
|
|
126
|
+
--athena-shadow: none;
|
|
127
|
+
--series-1: #80d8ff; --series-2: #ffd740; --series-3: #ff8a80; --series-4: #69f0ae;
|
|
128
|
+
--series-5: #ea80fc; --series-6: #ffab40; --series-7: #b9f6ca; --series-8: #e0e0e0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* ------------------------------------------------------------ Without the script: follow the system */
|
|
132
|
+
|
|
133
|
+
@media (prefers-color-scheme: dark) {
|
|
134
|
+
:root:not([data-mode]) {
|
|
135
|
+
color-scheme: dark;
|
|
136
|
+
--athena-bg: #16181d;
|
|
137
|
+
--athena-fg: #e6e8eb;
|
|
138
|
+
--athena-muted: #9aa3ad;
|
|
139
|
+
--athena-border: #3a3f47;
|
|
140
|
+
--athena-line: #3a3f47;
|
|
141
|
+
--athena-surface: #23272e;
|
|
142
|
+
--athena-surface-alt: #1c1f25;
|
|
143
|
+
--athena-hover: #2b3340;
|
|
144
|
+
--athena-overlay: rgb(0 0 0 / 65%);
|
|
145
|
+
--athena-accent: #5b9bd5;
|
|
146
|
+
--athena-accent-fg: #0b1118;
|
|
147
|
+
--athena-focus: #8cc0ee;
|
|
148
|
+
--athena-danger: #ef6b5e;
|
|
149
|
+
--athena-success: #4cc38a;
|
|
150
|
+
--athena-warning: #e0b04a;
|
|
151
|
+
--athena-info: #5b9bd5;
|
|
152
|
+
--athena-shadow: 0 4px 14px rgb(0 0 0 / 55%);
|
|
153
|
+
}
|
|
154
|
+
}
|