athena-ui-js 1.3.0 → 2.0.1

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 (125) hide show
  1. package/README.md +122 -52
  2. package/docs/migration-2.0.md +83 -0
  3. package/docs/styling.md +86 -0
  4. package/package.json +111 -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/chartGenerator/chartGenerator.js +26 -2
  27. package/src/libs/hephaestus/dialogGenerator/dialogGenerator.js +25 -17
  28. package/src/libs/hephaestus/formGenerator/changePasswordFormGenerator.js +4 -4
  29. package/src/libs/hephaestus/formGenerator/formUtils.js +0 -4
  30. package/src/libs/hephaestus/formGenerator/loginFormGenerator.js +2 -3
  31. package/src/libs/hephaestus/formGenerator/registrationFormGenerator.js +3 -3
  32. package/src/libs/hephaestus/hephaestus.js +0 -10
  33. package/src/libs/hephaestus/inputGenerator/dropZoneGenerator.js +1 -1
  34. package/src/libs/hephaestus/modalGenerator/modalGenerator.js +13 -6
  35. package/src/libs/hephaestus/navigationGenerator/navigationGenerator.js +20 -24
  36. package/src/menu.js +6 -0
  37. package/src/navigation.js +6 -0
  38. package/src/res/themes/default/style.css +97 -100
  39. package/src/res/themes/tokens.css +96 -0
  40. package/src/router.js +6 -0
  41. package/src/sanitize.js +6 -0
  42. package/src/session.js +8 -0
  43. package/src/table.js +6 -0
  44. package/src/testing.js +11 -1
  45. package/src/theme.js +7 -0
  46. package/src/validation.js +6 -0
  47. package/types/athena-ui.d.ts +96 -0
  48. package/types/chart.d.ts +1 -0
  49. package/types/classic.d.ts +1 -0
  50. package/types/components.d.ts +1 -0
  51. package/types/controls.d.ts +3 -0
  52. package/types/csv.d.ts +1 -0
  53. package/types/dialog.d.ts +2 -0
  54. package/types/dom.d.ts +1 -0
  55. package/types/feedback.d.ts +1 -0
  56. package/types/format.d.ts +1 -0
  57. package/types/forms.d.ts +2 -0
  58. package/types/i18n.d.ts +1 -0
  59. package/types/inputs.d.ts +4 -0
  60. package/types/libs/config/config.d.ts +96 -0
  61. package/types/libs/config/hooks.d.ts +8 -0
  62. package/types/libs/core/combobox.d.ts +10 -0
  63. package/types/libs/core/controls.d.ts +28 -0
  64. package/types/libs/core/cookies.d.ts +27 -0
  65. package/types/libs/core/csv.d.ts +12 -0
  66. package/types/libs/core/dateRange.d.ts +72 -0
  67. package/types/libs/core/dom.d.ts +65 -0
  68. package/types/libs/core/elementGenerator.d.ts +30 -0
  69. package/types/libs/core/errors.d.ts +29 -0
  70. package/types/libs/core/focus.d.ts +6 -0
  71. package/types/libs/core/format.d.ts +21 -0
  72. package/types/libs/core/hungarianControls.d.ts +2 -0
  73. package/types/libs/core/i18n.d.ts +17 -0
  74. package/types/libs/core/pagination.d.ts +5 -0
  75. package/types/libs/core/sanitize.d.ts +6 -0
  76. package/types/libs/core/tableMath.d.ts +26 -0
  77. package/types/libs/core/theme.d.ts +39 -0
  78. package/types/libs/core/validation.d.ts +56 -0
  79. package/types/libs/hephaestus/LayoutGenerator/basicLayoutGenerator.d.ts +10 -0
  80. package/types/libs/hephaestus/LayoutGenerator/footerContentGenerator.d.ts +4 -0
  81. package/types/libs/hephaestus/LayoutGenerator/headerContentGenerator.d.ts +20 -0
  82. package/types/libs/hephaestus/LayoutGenerator/wrapperContentGenerator.d.ts +1 -0
  83. package/types/libs/hephaestus/MenuGenerator/basicMenuGenerator.d.ts +14 -0
  84. package/types/libs/hephaestus/MenuGenerator/menuGenerator.d.ts +65 -0
  85. package/types/libs/hephaestus/auth/authState.d.ts +26 -0
  86. package/types/libs/hephaestus/auth/session.d.ts +26 -0
  87. package/types/libs/hephaestus/chartGenerator/chartGenerator.d.ts +93 -0
  88. package/types/libs/hephaestus/componentGenerator/componentGenerator.d.ts +222 -0
  89. package/types/libs/hephaestus/componentGenerator/themePicker.d.ts +24 -0
  90. package/types/libs/hephaestus/dialogGenerator/dialogGenerator.d.ts +120 -0
  91. package/types/libs/hephaestus/feedbackGenerator/feedbackGenerator.d.ts +86 -0
  92. package/types/libs/hephaestus/formGenerator/authForms.d.ts +122 -0
  93. package/types/libs/hephaestus/formGenerator/changePasswordFormGenerator.d.ts +6 -0
  94. package/types/libs/hephaestus/formGenerator/formBuilder.d.ts +113 -0
  95. package/types/libs/hephaestus/formGenerator/formUtils.d.ts +8 -0
  96. package/types/libs/hephaestus/formGenerator/loginFormGenerator.d.ts +11 -0
  97. package/types/libs/hephaestus/formGenerator/lostPasswordFormGenerator.d.ts +4 -0
  98. package/types/libs/hephaestus/formGenerator/registrationFormGenerator.d.ts +7 -0
  99. package/types/libs/hephaestus/hephaestus.d.ts +3 -0
  100. package/types/libs/hephaestus/inputGenerator/dropZoneGenerator.d.ts +48 -0
  101. package/types/libs/hephaestus/inputGenerator/inputGenerator.d.ts +185 -0
  102. package/types/libs/hephaestus/inputGenerator/richTextGenerator.d.ts +49 -0
  103. package/types/libs/hephaestus/modalGenerator/modalGenerator.d.ts +2 -0
  104. package/types/libs/hephaestus/navigationGenerator/navigationGenerator.d.ts +150 -0
  105. package/types/libs/hephaestus/router/matchRoute.d.ts +12 -0
  106. package/types/libs/hephaestus/router/router.d.ts +67 -0
  107. package/types/libs/hephaestus/tableGenerator/tableGenerator.d.ts +120 -0
  108. package/types/menu.d.ts +1 -0
  109. package/types/navigation.d.ts +1 -0
  110. package/types/res/themes/themes.d.ts +7 -0
  111. package/types/router.d.ts +1 -0
  112. package/types/sanitize.d.ts +1 -0
  113. package/types/session.d.ts +3 -0
  114. package/types/table.d.ts +1 -0
  115. package/types/testing.d.ts +27 -0
  116. package/types/theme-boot.d.ts +0 -0
  117. package/types/theme.d.ts +2 -0
  118. package/types/validation.d.ts +1 -0
  119. package/src/libs/crypto-js/LICENSE +0 -24
  120. package/src/libs/crypto-js/crypto-js.js +0 -6657
  121. package/src/libs/js-cookie/LICENSE +0 -21
  122. package/src/libs/js-cookie/src/api.mjs +0 -103
  123. package/src/libs/js-cookie/src/assign.mjs +0 -10
  124. package/src/libs/js-cookie/src/converter.mjs +0 -14
  125. package/src/libs/libs.js +0 -13
package/README.md CHANGED
@@ -1,26 +1,28 @@
1
1
  # Athena UI
2
2
 
3
- A small UI framework for development and education purposes (jQuery is optional). It generates a page
3
+ A small UI framework for development and education purposes. It generates a page
4
4
  layout (header, menu, content wrapper, footer) from a single `init()` call, loads its own libraries
5
5
  and theme, and ships the building blocks of a multipurpose application: forms, tables, charts,
6
6
  feedback, navigation, a router and more.
7
7
 
8
- Current version: **1.3.0**
8
+ Current version: **2.0.1**
9
9
 
10
10
  [Quick start](#usage) · [API](#api) · [Components](#charts) · [Themes](#themes) · [Tests](#tests) · [Release notes](#releases)
11
11
 
12
12
  ## Status
13
13
 
14
- 1.0.0 is the first stable release. From here on the exported API of `src/athena-ui.js` follows
15
- [semantic versioning](https://semver.org/): breaking changes only come with a new major version.
14
+ The exported API of `src/athena-ui.js` follows [semantic versioning](https://semver.org/): breaking changes only come with a new major version.
15
+ **Coming from 1.x? Read [docs/migration-2.0.md](docs/migration-2.0.md)** (no jQuery, no globals, no hashing in the browser, native dialogs, CSS layer).
16
16
  Known limits are listed below, so you can judge whether it fits your project:
17
17
 
18
18
  - Rich text uses the deprecated `document.execCommand`. Content is sanitized in the browser, but sanitize it on the server too.
19
19
  - The session cookie is readable from JavaScript. It is a UI state, not a security boundary: authenticate on the server.
20
20
  - Virtual table rows have to be a fixed height, one line per cell (set it with `virtual.rowHeight`; the CSS variable `--row-height` follows).
21
21
  - Translations: English and Hungarian.
22
- - jQuery is optional since 1.3.0. The older generators (`generateLoginForm`, the layout and the header / footer menu built from `menuItems`) still work, and
23
- they no longer need it. Everything new (`generateMenu`, the sign in forms, dialogs, charts, tables, ...) is plain DOM.
22
+ - Athena UI has **no dependencies**: no jQuery, no bundled library, nothing is loaded at run time, and nothing is put on `window` unless you opt in with
23
+ `athena-ui-js/classic`. The older generators (`generateLoginForm`, the layout and the header / footer menu built from `menuItems`) are plain DOM too.
24
+ - The default theme follows the system's dark mode. Put `data-mode="light"` on `<html>` (or use `createThemeManager`) to choose.
25
+ - Dialogs and the accordion use the native `<dialog>` and `<details>` elements, so they need a browser that supports cascade layers and `<dialog>` (2022 or later). The dropdown still has its own menu.
24
26
 
25
27
  ## Features
26
28
 
@@ -44,34 +46,43 @@ Known limits are listed below, so you can judge whether it fits your project:
44
46
  - Default and dark theme (switchable at runtime), responsive, translations (English, Hungarian), keyboard and ARIA support
45
47
  - Modal open / close helpers
46
48
  - Themes loaded at runtime, custom stylesheets supported
47
- - Written as ES modules, no build step
49
+ - Written as ES modules, no build step, no dependencies, TypeScript definitions, one entry point per component, and a cascade layer so your CSS always wins
50
+ - Content-Security-Policy friendly: no inline script, no inline style, text from data is only ever inserted as text (the browser tests run under a strict policy)
48
51
 
49
52
  ## Requirements
50
53
 
51
- - jQuery is optional (v4.0.0, only if your own code or an older application uses it). Athena UI itself does not need it.
52
- - A browser with ES module support
54
+ - A current browser: ES modules, the native `<dialog>` and `<details>` elements and cascade layers (`@layer`, `@import ... layer()`): Chrome / Edge 99, Safari 15.4, Firefox 97 or later
53
55
  - The page has to be served over HTTP(S). Modules do not load from `file://`.
54
-
55
- Bundled as git submodules (third party):
56
-
57
- | Library | Version | Used for |
58
- | --- | --- | --- |
59
- | [crypto-js](https://github.com/brix/crypto-js) | 4.2.0 | password hashing |
60
- | [js-cookie](https://github.com/js-cookie/js-cookie) | 3.0.8 | cookie handling |
56
+ - Nothing else: Athena UI has no runtime dependencies. (TypeScript is a dev dependency, used to write the type definitions.)
61
57
 
62
58
  ## Installation
63
59
 
64
60
  ```sh
65
- git clone --recurse-submodules https://github.com/csabatibortoth/athena-ui.git
61
+ npm install athena-ui-js
66
62
  ```
67
63
 
68
- In an existing clone, or after updating:
64
+ ```js
65
+ import { init, generateTable } from "athena-ui-js"; // everything
66
+ import { generateTable } from "athena-ui-js/table"; // or only what you use, so the rest is never downloaded
67
+ ```
68
+
69
+ The entry points are `table`, `chart`, `dialog`, `menu`, `navigation`, `forms`, `feedback`, `components`, `inputs`, `router`, `session`, `theme`, `i18n`, `format`,
70
+ `validation`, `sanitize`, `csv`, `dom` and `controls`. TypeScript definitions are included (`types/`, generated from the JSDoc with `npm run types`).
71
+ The package has `"sideEffects"` for `classic.js`, `theme-boot.js` and CSS only, so a bundler drops everything you do not import.
72
+
73
+ Without npm, serve the `src` folder with any static web server and open `index.html` to see the example.
74
+
75
+ ### The demo application
76
+
77
+ `demo/` is a demo and test application: tables with 100,000 rows from a server, a streaming chart, every field type, native dialogs, a menu with groups inside groups, themes
78
+ and modes, and a real sign in, served by a small Node server (no dependencies) under a strict Content-Security-Policy.
69
79
 
70
80
  ```sh
71
- git submodule update --init
81
+ npm run demo # http://localhost:3000
82
+ npm run test:demo # the server, the API and every page in a real browser
72
83
  ```
73
84
 
74
- Serve the `src` folder with any static web server and open `index.html` to see the example.
85
+ GitHub Actions tests it and deploys it to an Azure App Service: [demo/README.md](demo/README.md) has the one-time set up.
75
86
 
76
87
  ## Usage
77
88
 
@@ -104,6 +115,18 @@ Serve the `src` folder with any static web server and open `index.html` to see t
104
115
  `init()` returns a Promise that resolves with the effective configuration once the libraries and
105
116
  the theme are loaded and the layout is generated.
106
117
 
118
+ ### Inside a page: createApp
119
+
120
+ `init()` builds the page layout into the body. `createApp` builds it into an element of your own page, so Athena UI can be one part of a larger one:
121
+
122
+ ```js
123
+ const app = await createApp({ root: "#my-section", config: { generateHeader: false, generateFooter: false } });
124
+ generateTable({ parent: "wrapper", /* ... */ }); // the wrapper of the app is the default parent
125
+ app.destroy();
126
+ ```
127
+
128
+ It takes the options of `init()`. The header and footer follow the settings `generateHeader` and `generateFooter`. The parts have fixed ids, so use one app per page.
129
+
107
130
  ### init options
108
131
 
109
132
  | Option | Description |
@@ -124,7 +147,7 @@ the theme are loaded and the layout is generated.
124
147
  | `header_title_text` | `"Athena UI"` | Title in the header |
125
148
  | `header_img_url` | | Header logo URL |
126
149
  | `copyright` | placeholder text | Footer text, the version is appended |
127
- | `version` | `"1.3.0"` | Version shown in the footer |
150
+ | `version` | `"2.0.1"` | Version shown in the footer |
128
151
  | `bordered` | `true` | Draw a border around the layout blocks |
129
152
  | `generateHeader`, `generateFooter` | `true` | Generate the header / footer block |
130
153
  | `generateHeadercontent`, `generateFooterContent`, `generateWrappercontent` | `true` | Generate the content of the block |
@@ -136,7 +159,6 @@ the theme are loaded and the layout is generated.
136
159
  | `locale` | `"en"` | Language of the generated texts (`en`, `hu`, or your own, see [Translations](#translations)) |
137
160
  | `session_cookie` | `"athena_session"` | Name of the session cookie |
138
161
  | `session_days` | `7` | Lifetime of a remembered session in days |
139
- | `enable_encrypt_password` | `false` | SHA-256 hash the password before it is passed to `login` / `register` |
140
162
  | `customLoader` | | URL of an extra classic script, loaded before the layout is generated |
141
163
  | `container_class`, `header_class`, `header_menu_class`, `wrapper_class`, `footer_class`, `footer_menu_class`, `loginForm_class`, `registrationForm_class`, `lostPasswordForm_class`, `changePasswordForm_class` | | CSS classes of the generated blocks |
142
164
 
@@ -180,12 +202,13 @@ Everything is exported from `athena-ui.js`:
180
202
  | `setTheme({ id })` | Switch the theme at runtime |
181
203
  | `openModal(id)`, `closeModal(id)` | Show / hide a `.modal` element (default id: `myModal`). Elements with the `close` class close their modal. |
182
204
  | `loadScript(src)` | Load a classic script once, returns a Promise |
183
- | `Cookies` | The [js-cookie](https://github.com/js-cookie/js-cookie) API |
205
+ | `Cookies` | `get(name)`, `set(name, value, { expires, path, domain, sameSite, secure })`, `remove(name)`: a small cookie helper (`expires` is days or a Date) |
206
+ | `createApp(options)` | `init` into any element, see [Inside a page](#inside-a-page-createapp) |
184
207
  | `HTMLElementGenerator(options)` | Generates a div, span, p, heading or img and appends it to the element with the id `parent` |
185
208
  | `HTMLControlGenerator(options)`, `HTMLControlGenerator.create(options)`, `HTMLControlGenerator.register(type, factory)` | Generates inputs, selects and lists from an options object. `create` builds without appending and returns the element (a jQuery object when the page has jQuery). `registerHungarianInputControls()` adds the types `hunPIN`, `hunCRID` and `hunTID` |
186
209
 
187
210
  HTMLElementGenerator and HTMLControlGenerator used to be projects of their own. They are part of Athena UI now (the calls and options are the
188
- same, and HTMLControlGenerator no longer needs jQuery); the old repositories are no longer developed.
211
+ same, and HTMLControlGenerator has no jQuery in it); the old repositories are no longer developed.
189
212
 
190
213
  ### Charts
191
214
 
@@ -323,6 +346,10 @@ const saved = await showFormDialog({
323
346
  if (await showConfirm({ title: "Delete host", message: "This cannot be undone.", confirmText: "Delete", danger: true, typeToConfirm: host.name })) { /* ... */ }
324
347
  ```
325
348
 
349
+ A dialog is the native `<dialog>` element opened with `showModal()`: the browser puts it above everything (the top layer), makes the page behind it inert, draws the backdrop
350
+ (`dialog.dialog::backdrop`), and gives the focus back. Style `dialog.dialog` and `.dialog-inner`. In tests under jsdom use `installDom` from `athena-ui-js/testing`
351
+ (it adds `showModal()`), and close a dialog with the `cancel` event, as the browser does for Esc.
352
+
326
353
  Dialogs trap the focus, close with Esc (resolving `null` / `false`) and restore the focus. Text content is
327
354
  never parsed as HTML. `openModal` / `closeModal` got the same focus handling.
328
355
 
@@ -509,24 +536,17 @@ Missing texts fall back to English. See `src/libs/core/i18n.js` for all keys.
509
536
 
510
537
  ### Usage from classic scripts
511
538
 
512
- The same API is available as globals (and as `AthenaUI`), so scripts written for earlier versions
513
- keep working. Load `athena-ui.js` with `type="module"` and call the globals after the DOM is ready:
539
+ The ES module has no side effects. For a page that uses inline handlers or classic scripts there is an opt-in build that puts the whole API on `window`
540
+ (and as `AthenaUI`):
514
541
 
515
542
  ```html
516
- <script>
517
- var appConfig = { header_title_text: "My App", customLoader: "js/app.js" };
518
- </script>
519
- <script type="module" src="athena-ui/src/athena-ui.js"></script>
520
- <script>
521
- $(function () {
522
- init({ theme: { id: 0 } });
523
- });
543
+ <script type="module" src="node_modules/athena-ui-js/src/classic.js"></script>
544
+ <script type="module">
545
+ init({ theme: { id: 0 } }); // globals: init, generateTable, AthenaUI, HTMLControlGenerator, ...
524
546
  </script>
525
547
  ```
526
548
 
527
- The global `appConfig`, `menuItems`, `nav`, `login`, `register` and `lostPassword` are used when the matching `init` option is
528
- not given. `appConfig.athenaUIFolder` is not needed anymore, paths are resolved relative to
529
- `athena-ui.js`.
549
+ The global `appConfig`, `menuItems`, `nav`, `login`, `register` and `lostPassword` are used when the matching `init` option is not given.
530
550
 
531
551
  ### Signing in (recommended)
532
552
 
@@ -548,7 +568,7 @@ generateSignInForm({
548
568
  ```
549
569
 
550
570
  An error with a `fields` object (`{ username: "Already taken" }`) marks those fields as well. The password is sent as typed, over HTTPS: hash it on the server.
551
- Hashing it in the browser (`enable_encrypt_password`) only turns the hash into the password, so that setting is **deprecated** and will be removed in 2.0.
571
+ Hashing it in the browser only turns the hash into the password, so Athena UI 2.0 does not do it any more (the setting `enable_encrypt_password` and crypto-js are gone; the old login, registration and change password forms return the password as typed).
552
572
  `createAuthState` keeps who is signed in **in memory only**: nothing readable is written to a cookie or the storage, the session itself is a server set `HttpOnly` cookie,
553
573
  and the server decides what a person may do. `auth.hasRole(role)`, `auth.onChange(listener)` and `auth.routerRules()` connect it to menus and the router.
554
574
 
@@ -566,6 +586,19 @@ The default theme is in `src/res/themes/default/style.css`; `{ id: 1 }` is a dar
566
586
 
567
587
  Switch themes at runtime with `setTheme({ id: 1 })`.
568
588
 
589
+ ### Styling: the cascade layer, tokens and dark mode
590
+
591
+ All rules of the default theme are in the cascade layer `athena`. CSS that is not in a layer (the normal CSS of your application) beats it **whatever the specificity**, so
592
+ `.my-table td { padding: 2px }` or even `td { padding: 2px }` is enough, with no `!important`. The design tokens are in `src/res/themes/tokens.css` and are the way to
593
+ restyle everything at once:
594
+
595
+ ```css
596
+ :root { --athena-accent: #8e44ad; --athena-radius: 2px; --athena-space-2: 6px; --athena-dialog-medium: 560px; }
597
+ ```
598
+
599
+ The colours come in a light and a dark set. Without the attribute `data-mode` on `<html>` the page follows the system (`prefers-color-scheme`); `data-mode="dark"` or
600
+ `"light"` chooses. [docs/styling.md](docs/styling.md) lists every token and, for every group of rules, the classes and variables it uses (it is generated from the CSS by `npm run docs`).
601
+
569
602
  ### Themes and modes (light / dark / like the system)
570
603
 
571
604
  A second system lets people choose a theme **and** a mode. It is just two attributes on `<html>` that `src/res/themes/appearance.css` reads:
@@ -629,7 +662,7 @@ do not control (a plugin API).
629
662
 
630
663
  Both used to be projects of their own and are part of Athena UI since 1.3.0 (same calls and options, MIT, same author). `HTMLElementGenerator(options)` is in
631
664
  `src/libs/core/elementGenerator.js`, `HTMLControlGenerator(options)` / `.create()` / `.register()` in `src/libs/core/controls.js`; both are exported and global as before.
632
- `HTMLControlGenerator` no longer needs jQuery (`create` returns a jQuery object when the page has jQuery, otherwise the element).
665
+ `HTMLControlGenerator` has no jQuery in it: `create` returns the element (wrap it yourself with `$(...)` if you still need a jQuery object).
633
666
  `registerHungarianInputControls()` adds the `hunPIN`, `hunCRID` and `hunTID` input types of its old addon. The old repositories are no longer developed.
634
667
 
635
668
  ### Parents and handles
@@ -665,28 +698,37 @@ npm run test:browser # the components in headless Chrome
665
698
  The unit tests cover validation, translations, router matching, CSV, pagination, formatting, virtual scrolling math, date ranges and the URL check.
666
699
  The browser tests start a small static server, open `tests/browser/index.html` in headless Chrome, Chromium or Edge and run every
667
700
  component: forms, dialogs, navigation, submenus, inputs, rich text (sanitizing, toolbar, paste), tables (resizing, virtual scrolling), router,
668
- session, themes. Set `CHROME_PATH` if the browser is not found, and `JQUERY_URL` to load jQuery from somewhere else than the CDN
669
- (the machine needs internet access otherwise). `DEBUG=1` prints the browser log when the page does not report results.
701
+ session, themes. Set `CHROME_PATH` if the browser is not found. `DEBUG=1` prints the browser log when the page does not report results.
670
702
 
671
- A test run without jQuery is the default; `WITH_JQUERY=1 npm run test:browser` loads jQuery from its CDN to check that an application that still has it works too.
703
+ - **The page runs under a strict Content-Security-Policy** (`default-src 'none'; script-src 'self'; style-src 'self'`, set by `run.mjs`), and a `securitypolicyviolation` fails the test
704
+ that caused it. That is the guarantee that Athena UI needs no `'unsafe-inline'`. (Three tests that hand the sanitizer hostile markup are let through for the reports Chrome
705
+ makes while it parses an inline handler, a style attribute or a `<style>` element in an inert document.)
706
+ - One test feeds markup to about 40 components and checks that text from data stays text.
707
+ - `WITH_JQUERY=1 npm run test:browser` loads jQuery from its CDN, to check that an application that still has it works too (`JQUERY_URL` for another address).
708
+ - The unit tests also check that `docs/styling.md` is up to date, and that a TypeScript file using the library compiles against `types/` (needs `npm install` for TypeScript).
672
709
 
673
710
  ## Project structure
674
711
 
675
712
  ```
676
713
  src/
677
- athena-ui.js entry point, exports the whole API
714
+ athena-ui.js the whole API as ES module exports (no side effects)
715
+ classic.js opt-in: the whole API on window, for classic scripts
716
+ table.js, dialog.js, ... one entry point per component (athena-ui-js/table, athena-ui-js/dialog, ...)
717
+ theme-boot.js classic script that sets the saved theme and mode before the page is drawn
718
+ testing.js installDom, until, tick for the tests of an application
678
719
  index.html, example.js example page
679
720
  libs/
680
721
  config/ default configuration, application hooks
681
- core/ DOM / focus helpers, validation, translations, CSV, formatting, sanitizer, table math
682
- hephaestus/ script and theme loader, generators (layout, menu, forms, charts, tables, feedback,
683
- dialogs, navigation, components, inputs), router, session
684
- crypto-js/, js-cookie/ submodules (third party)
685
- libs.js classic scripts loaded at runtime (only crypto-js, and only with the deprecated enable_encrypt_password)
686
- res/themes/ default and dark theme, appearance.css (themes and modes)
687
- theme-boot.js classic script that sets the saved theme and mode before the page is drawn
688
- testing.js installDom, until, tick for the tests of an application
689
- tests/ unit tests (Node) and browser tests (headless Chrome)
722
+ core/ DOM / focus helpers, el, validation, translations, CSV, formatting, sanitizer, cookies, theme manager,
723
+ HTMLElementGenerator, HTMLControlGenerator, table math
724
+ hephaestus/ theme loader, generators (layout, menus, forms, charts, tables, feedback, dialogs, navigation,
725
+ components, inputs), router, session, auth state
726
+ res/themes/ tokens.css, default and dark theme, appearance.css (themes and modes)
727
+ types/ TypeScript definitions (npm run types)
728
+ docs/ styling.md (generated), migration-2.0.md
729
+ demo/ the demo and test application (server, API, pages, end to end tests), deployed to Azure by GitHub Actions
730
+ .github/workflows/ ci.yml (tests) and demo-deploy.yml
731
+ tests/ unit tests (Node) and browser tests (headless Chrome, strict CSP)
690
732
  ```
691
733
 
692
734
  ## Authors
@@ -699,6 +741,34 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
699
741
 
700
742
  ## Releases
701
743
 
744
+ ### 2.0.1
745
+ #### Added:
746
+ 1. `demo/`: a demo and test application of Athena UI (tables with 100,000 rows from a server, streaming charts, forms, dialogs, menus, themes, sign in) with a dependency free Node server, and end to end tests that drive a real browser (DevTools protocol) under a strict Content-Security-Policy
747
+ 2. GitHub Actions: `ci.yml` (unit, browser and demo tests on every push and pull request) and `demo-deploy.yml` (tests, builds `demo/dist`, deploys to an Azure App Service, checks the site)
748
+ #### Fixed (found by the end to end tests of the demo):
749
+ 1. A chart that redraws (streaming `push`, zoom) no longer loses the keyboard focus: it moves to the same place in the new SVG
750
+ 2. The series a person hid with the legend stay hidden when the chart redraws (`hiddenSeries` option)
751
+ #### Changed:
752
+ 1. `package-lock.json` is part of the repository (CI uses `npm ci`)
753
+
754
+ ### 2.0.0
755
+ #### Breaking (see [docs/migration-2.0.md](docs/migration-2.0.md)):
756
+ 1. No default export, and nothing on `window` unless you import `athena-ui-js/classic`; `athena-ui.js` has no side effects
757
+ 2. No jQuery anywhere (not a peer dependency any more); `HTMLControlGenerator.create` returns the element
758
+ 3. crypto-js and js-cookie are removed (own `Cookies` helper), and so are `enable_encrypt_password` and the hashing of passwords in the browser
759
+ 4. Nothing is loaded at run time (`libs.js` and `loadLibs` are gone); `customLoader` still loads your own script
760
+ 5. `showDialog` and the other dialogs use a native `<dialog>` (`showModal`), the accordion uses `<details>`: the markup and CSS classes changed
761
+ 6. All default rules are in the cascade layer `athena`, and the default theme follows the system's dark mode
762
+ 7. `package.json` has an `exports` map: deep imports of `src/libs/...` are not possible
763
+ #### Added:
764
+ 1. One entry point per component (`athena-ui-js/table`, `/dialog`, `/menu`, ...), `"sideEffects"` for tree shaking
765
+ 2. TypeScript definitions (`types/`, generated from the JSDoc)
766
+ 3. `createApp({ root })`: the layout into any element
767
+ 4. `tokens.css` (radius, spacing, border, focus ring, dialog widths, row height, colours), a built-in dark mode, `docs/styling.md`
768
+ 5. Plural forms in messages (`Intl.PluralRules`), `{name:number}` and `{name:date}` in `translate`
769
+ 6. The browser tests run under a strict Content-Security-Policy and fail on any violation; one test checks that every component inserts text as text
770
+ 7. `docs/migration-2.0.md`
771
+
702
772
  ### 1.3.0
703
773
  #### Added:
704
774
  1. Dialogs: `showFormDialog` (async save, errors stay in the dialog, `form.setErrors`) and `showConfirm` (`danger`, `typeToConfirm`)
@@ -0,0 +1,83 @@
1
+ # Moving from Athena UI 1.x to 2.0
2
+
3
+ 2.0 is lighter and has no side effects: no jQuery, no globals, no libraries loaded at run time, and everything is in a cascade layer. Most of what you call
4
+ (`generateTable`, `showDialog`, `createRouter`, ...) is the same. This is the list of what is not, in the order you will probably meet it.
5
+
6
+ ## 1. Imports: no default export, no globals
7
+
8
+ `athena-ui.js` is plain ES module exports now. Importing it does not touch the page, and nothing is put on `window`.
9
+
10
+ ```js
11
+ // 1.x
12
+ import AthenaUI, { init } from "athena-ui-js"; // the default export is gone
13
+ window.generateTable(...) // the globals are gone
14
+
15
+ // 2.0
16
+ import { init, generateTable } from "athena-ui-js";
17
+ import { generateTable } from "athena-ui-js/table"; // or only what you use, so the rest is never downloaded
18
+ ```
19
+
20
+ Entry points: `table`, `chart`, `dialog`, `menu`, `navigation`, `forms`, `feedback`, `components`, `inputs`, `router`, `session`, `theme`, `i18n`, `format`,
21
+ `validation`, `sanitize`, `csv`, `dom`, `controls`. Deep imports of files under `src/libs` are not part of the package interface (the `exports` map closes them).
22
+
23
+ **A page that needs the globals** (inline handlers, classic scripts, the `customLoader`) opts in with one line:
24
+
25
+ ```html
26
+ <script type="module" src="node_modules/athena-ui-js/src/classic.js"></script> <!-- window.generateTable, window.AthenaUI, ... -->
27
+ ```
28
+
29
+ ## 2. jQuery is gone
30
+
31
+ Athena UI has no jQuery code, and `jquery` is not a peer dependency any more. The one place where a jQuery object came back to you,
32
+ `HTMLControlGenerator.create(options)`, returns the element now: use `$(HTMLControlGenerator.create(options))` if you still want a jQuery object.
33
+ `HTMLControlGenerator.register(type, factory)`: the factory returns an element.
34
+
35
+ ## 3. crypto-js and js-cookie are gone
36
+
37
+ - **`enable_encrypt_password` is removed.** The login, registration and change password forms return the password as it was typed. Send it over HTTPS and hash
38
+ it on the server (argon2, scrypt, bcrypt). Hashing it in the browser only turns the hash into the password. If your server expects a SHA-256 hash, change
39
+ the server, or hash in your own `login` callback with `crypto.subtle.digest("SHA-256", ...)`.
40
+ - **`Cookies`** is a small helper of our own with `get`, `set` and `remove` (days or a `Date` for `expires`, `path`, `domain`, `sameSite`, `secure`).
41
+ What js-cookie had beyond that (`getJSON`, `withAttributes`, converters) is not there.
42
+ - No script is loaded at run time any more (`libs.js` and `loadLibs` are removed). `customLoader` (your own classic script) still works.
43
+
44
+ ## 4. HTMLElementGenerator and HTMLControlGenerator
45
+
46
+ They are part of Athena UI (`athena-ui-js/controls`) and no longer git submodules. The calls are the same; with the classic build they are globals again.
47
+
48
+ ## 5. Dialogs and the accordion use native elements
49
+
50
+ - `showDialog` (and `confirmDialog`, `promptDialog`, `showConfirm`, `showFormDialog`) opens a real `<dialog>` with `showModal()`. The browser traps the focus, closes
51
+ it with Esc, draws the backdrop and puts it in the top layer. In your CSS, `.dialog-backdrop` and `.modal-content` are gone from these dialogs: style
52
+ `dialog.dialog`, `dialog.dialog::backdrop` and `.dialog-inner`. `handle.backdrop` is the dialog element too. In a test (jsdom) use `installDom` from
53
+ `athena-ui-js/testing`, which gives jsdom `showModal()`; a synthetic Esc key does not close a native dialog, send the `cancel` event instead.
54
+ - `generateAccordion` is `<details>` and `<summary>`: `.accordion-header` is a `<summary>`, there is no `aria-expanded` on a button, `.accordion-open` is the
55
+ `[open]` attribute and `.accordion-title` is gone. `accordion.toggle(index, open)` works as before.
56
+ - The dropdown keeps its own menu (a top-layer `popover` would need anchor positioning, which not every supported browser has yet).
57
+
58
+ ## 6. CSS: a layer, tokens and dark mode
59
+
60
+ - All rules of the default theme are in the cascade layer `athena`, so a plain rule of your application wins without a more specific selector. If you used
61
+ `!important` or a longer selector to beat Athena, you can take it out. If you put Athena's CSS into **your own layer order**, declare `athena` where you want it.
62
+ - The tokens are in `src/res/themes/tokens.css` (radius, spacing, border, focus ring, dialog widths, row height and the colours), see `docs/styling.md` for every
63
+ class and variable. The new tokens are `--athena-focus`, `--athena-focus-width`, `--athena-border-width`, `--athena-space-1` ... `--athena-space-4`,
64
+ `--athena-dialog-small|medium|large` and `--athena-row-height`.
65
+ - **The default theme follows the system now**: on a device that prefers dark colours it is dark unless `data-mode="light"` is on `<html>`. To keep it light
66
+ always, put `data-mode="light"` on `<html>` (or use `createThemeManager`, which does it).
67
+ - `src/res/themes/dark/style.css` (theme `{ id: 1 }`) still works.
68
+
69
+ ## 7. Small things
70
+
71
+ - Messages with plural forms: `validation.minLength`, `validation.maxLength` and `validation.maxFiles` are `{ one, other }` objects in the built-in English texts. A message you
72
+ override with `addMessages` can stay a plain string. `translate` knows `{name:number}` and `{name:date}`, and chooses a plural form by `params.count`.
73
+ - `package.json`: `"sideEffects"` lists only `classic.js`, `theme-boot.js` and CSS, so bundlers can drop what you do not use. TypeScript definitions are in `types/`.
74
+ - The browser tests run under a strict Content-Security-Policy (no inline script, no inline style) and fail on any violation: the library does not need `'unsafe-inline'`.
75
+ - `init()` and `createApp({ root })`: `createApp` builds the layout into an element of your page instead of the body.
76
+
77
+ ## Upgrade in five steps
78
+
79
+ 1. Replace `import AthenaUI from ...` and `window.` calls by named imports, or add the `classic.js` line.
80
+ 2. Remove the jQuery script tag if nothing else of yours needs it.
81
+ 3. Remove `enable_encrypt_password` and make the server hash the password.
82
+ 4. Search your CSS for `.dialog-backdrop`, `.modal-content` (in dialogs) and `.accordion-open`, and for rules that only exist to beat Athena's specificity.
83
+ 5. Run your tests, with a Content-Security-Policy on the page if you can: it tells you what still writes inline styles or scripts.
@@ -0,0 +1,86 @@
1
+ # Styling reference
2
+
3
+ Generated by `npm run docs` from `src/res/themes/default/style.css` and `tokens.css`. Do not edit by hand.
4
+
5
+ All Athena UI rules are in the cascade layer `athena`: a plain rule of your application (not in a layer) always wins, whatever its specificity.
6
+ Start with the tokens, they cover most of what people want to change.
7
+
8
+ ## Tokens
9
+
10
+ | Variable | Default (light) |
11
+ | --- | --- |
12
+ | `--athena-accent` | `#8e44ad` |
13
+ | `--athena-radius` | `2px` |
14
+ | `--athena-bg` | `#fff` |
15
+ | `--athena-fg` | `#1a1a1a` |
16
+ | `--athena-muted` | `#666` |
17
+ | `--athena-border` | `#000` |
18
+ | `--athena-line` | `#ccc` |
19
+ | `--athena-surface` | `#f2f2f2` |
20
+ | `--athena-surface-alt` | `#fafafa` |
21
+ | `--athena-hover` | `#e8f0fe` |
22
+ | `--athena-overlay` | `rgb(0 0 0 / 40%)` |
23
+ | `--athena-accent` | `#2f6db5` |
24
+ | `--athena-accent-fg` | `#fff` |
25
+ | `--athena-focus` | `#1b4f8f` |
26
+ | `--athena-danger` | `#c0392b` |
27
+ | `--athena-success` | `#1e8449` |
28
+ | `--athena-warning` | `#9a6700` |
29
+ | `--athena-info` | `#2471a3` |
30
+ | `--athena-shadow` | `0 4px 14px rgb(0 0 0 / 18%)` |
31
+ | `--athena-radius` | `6px` |
32
+ | `--athena-border-width` | `1px` |
33
+ | `--athena-space-1` | `4px` |
34
+ | `--athena-space-2` | `8px` |
35
+ | `--athena-space-3` | `12px` |
36
+ | `--athena-space-4` | `16px` |
37
+ | `--grid-gap` | `16px` |
38
+ | `--athena-focus-width` | `2px` |
39
+ | `--athena-dialog-small` | `360px` |
40
+ | `--athena-dialog-medium` | `480px` |
41
+ | `--athena-dialog-large` | `720px` |
42
+ | `--athena-row-height` | `36px` |
43
+
44
+ Dark colours: set `data-mode="dark"` on `<html>` (or let `createThemeManager` do it); without the attribute the system decides. Themes: see `appearance.css`.
45
+
46
+ ## Components
47
+
48
+ | Group of rules | Classes | Variables it reads |
49
+ | --- | --- | --- |
50
+ | General | - | `--athena-accent` `--athena-bg` `--athena-border-width` `--athena-fg` `--athena-line` |
51
+ | Header, Wrapper, Footer | `.footer-container` `.header-container` `.wrapper-container` | - |
52
+ | Elements | `.container` `.default-cointainer-bordered` `.menu` | `--athena-border` |
53
+ | Modal (background) | `.modal` `.modal-content` | `--athena-bg` `--athena-border-width` `--athena-fg` `--athena-line` `--athena-overlay` |
54
+ | Modal close button | `.close` | `--athena-fg` `--athena-muted` |
55
+ | Buttons | `.athena-button` `.button-danger` `.button-large` `.button-link` `.button-secondary` `.button-small` | `--athena-accent` `--athena-accent-fg` `--athena-danger` `--athena-fg` `--athena-line` `--athena-radius` `--athena-surface` |
56
+ | Forms | `.athena-form` `.choice` `.choices` `.field` `.field-error` `.field-group` `.field-help` `.field-invalid` `.field-label` `.field-required` `.form-actions` `.form-message` `.form-message-error` `.form-message-success` | `--athena-border-width` `--athena-danger` `--athena-line` `--athena-muted` `--athena-radius` `--athena-space-1` `--athena-space-2` `--athena-space-3` `--athena-success` |
57
+ | Switch: a checkbox drawn as a toggle | `.switch` `.switch-track` | `--athena-accent` `--athena-line` |
58
+ | Spinner, alerts, toasts, progress | `.alert` `.alert-body` `.alert-close` `.alert-error` `.alert-info` `.alert-success` `.alert-warning` `.button-loading` `.progress-bar` `.progress-error` `.progress-fill` `.progress-indeterminate` `.progress-label` `.progress-success` `.progress-warning` `.spinner` `.spinner-large` `.spinner-small` `.toast` `.toast-container` | `--alert-color` `--athena-accent` `--athena-border-width` `--athena-danger` `--athena-fg` `--athena-info` `--athena-line` `--athena-muted` `--athena-radius` `--athena-shadow` `--athena-space-2` `--athena-space-3` `--athena-success` `--athena-surface` `--athena-surface-alt` `--athena-warning` `--progress-color` |
59
+ | Dialog: the native <dialog> element, opened with showModal() | `.dialog` | `--athena-bg` `--athena-border-width` `--athena-dialog-medium` `--athena-fg` `--athena-line` `--athena-overlay` `--athena-radius` `--athena-shadow` `--dialog-width` |
60
+ | The content fills the dialog up to its edge, so a click on the backdrop is a click on the dialog element itself | `.dialog-body` `.dialog-close` `.dialog-footer` `.dialog-full` `.dialog-inner` `.dialog-large` `.dialog-medium` `.dialog-small` `.dialog-title` | `--athena-dialog-large` `--athena-dialog-medium` `--athena-dialog-small` `--athena-muted` `--athena-space-2` |
61
+ | Tabs | `.tab` `.tab-active` `.tab-list` `.tab-panel` | `--athena-accent` `--athena-border-width` `--athena-fg` `--athena-line` |
62
+ | Breadcrumbs, pagination | `.breadcrumb-item` `.breadcrumb-list` `.page-button` `.page-current` `.pagination` | `--athena-accent` `--athena-accent-fg` `--athena-bg` `--athena-border-width` `--athena-fg` `--athena-line` `--athena-muted` `--athena-space-1` |
63
+ | Accordion: <details> and <summary> | `.accordion-header` `.accordion-icon` `.accordion-item` `.accordion-panel` `.sidebar-parent` | `--athena-accent` `--athena-border-width` `--athena-fg` `--athena-focus` `--athena-focus-width` `--athena-line` `--athena-surface` |
64
+ | Dropdown | `.dropdown` `.dropdown-divider` `.dropdown-item` `.dropdown-menu` `.dropdown-right` | `--athena-bg` `--athena-border-width` `--athena-fg` `--athena-hover` `--athena-line` `--athena-radius` `--athena-shadow` |
65
+ | Sidebar | `.accordion-icon` `.sidebar` `.sidebar-link` `.sidebar-list` `.sidebar-parent` `.sidebar-sublist` `.sidebar-toggle` | `--athena-accent` `--athena-accent-fg` `--athena-fg` `--athena-hover` `--athena-space-2` |
66
+ | Cards, sections, grid | `.athena-grid` `.card` `.card-body` `.card-footer` `.card-image` `.card-title` | `--athena-bg` `--athena-border-width` `--athena-line` `--athena-radius` `--athena-surface-alt` `--grid-columns` `--grid-gap` |
67
+ | Badge, avatar, stat | `.avatar` `.avatar-large` `.avatar-small` `.badge` `.badge-error` `.badge-info` `.badge-pill` `.badge-success` `.badge-warning` `.stat` `.stat-bad` `.stat-good` `.stat-label` `.stat-neutral` `.stat-value` | `--athena-accent` `--athena-accent-fg` `--athena-bg` `--athena-border-width` `--athena-danger` `--athena-fg` `--athena-info` `--athena-line` `--athena-muted` `--athena-radius` `--athena-success` `--athena-surface` `--athena-warning` |
68
+ | Tooltip | `.has-tooltip` `.tooltip-text` `.tooltip-wrap` | - |
69
+ | Combobox (autocomplete, multi select) and chips | `.chip` `.chip-remove` `.combobox` `.combobox-active` `.combobox-chips` `.combobox-empty` `.combobox-input` `.combobox-list` `.combobox-multiple` `.combobox-option` `.combobox-selected` | `--athena-accent` `--athena-accent-fg` `--athena-bg` `--athena-border-width` `--athena-hover` `--athena-line` `--athena-muted` `--athena-radius` `--athena-shadow` `--athena-space-1` |
70
+ | File upload | `.dropzone` `.dropzone-disabled` `.dropzone-input` `.dropzone-over` `.file-item` `.file-list` `.file-status` | `--athena-accent` `--athena-hover` `--athena-line` `--athena-muted` `--athena-radius` |
71
+ | Stepper | `.form-actions` `.stepper` `.stepper-current` `.stepper-done` `.stepper-number` `.stepper-step` `.stepper-steps` | `--athena-accent` `--athena-accent-fg` `--athena-fg` `--athena-line` `--athena-muted` `--athena-space-2` `--athena-success` |
72
+ | Tables | `.athena-table` `.athena-table-edit` `.athena-table-filter` `.athena-table-pager` `.athena-table-select` `.athena-table-wrapper` `.clickable` `.editable` `.selected` `.sortable` | `--athena-accent` `--athena-border-width` `--athena-hover` `--athena-line` `--athena-surface` `--athena-surface-alt` |
73
+ | Table options: density, wrapping, alignment | `.athena-align-center` `.athena-align-right` `.athena-table` `.athena-table-compact` `.athena-table-nowrap` `.athena-table-wrap` | `--athena-focus` `--athena-focus-width` |
74
+ | Charts | `.athena-chart` `.chart-axis` `.chart-bar` `.chart-grid` `.chart-legend` `.chart-slice` `.chart-tick` `.chart-title` | `--athena-bg` `--athena-fg` `--athena-line` `--athena-muted` |
75
+ | Responsive | `.athena-form` `.athena-grid` `.file-item` `.file-progress` `.modal` `.modal-content` `.progress-fill` `.progress-indeterminate` `.sidebar` `.sidebar-list` `.sidebar-open` `.sidebar-toggle` `.spinner` `.stepper-title` | - |
76
+ | Menu submenus | `.has-submenu` `.menu-parent` `.submenu` `.submenu-item` | `--athena-bg` `--athena-border-width` `--athena-hover` `--athena-line` `--athena-radius` `--athena-shadow` |
77
+ | Table: resizable columns, virtual scrolling | `.athena-col-resizer` `.athena-table` `.athena-table-resizable` `.athena-table-scroll` `.athena-table-spacer` `.athena-table-virtual` `.resizing` | `--athena-accent` `--athena-border-width` `--athena-line` `--athena-row-height` `--row-height` |
78
+ | Date range | `.daterange` `.daterange-part` | - |
79
+ | Rich text editor | `.richtext` `.rt-bold` `.rt-button` `.rt-disabled` `.rt-editor` `.rt-empty` `.rt-italic` `.rt-separator` `.rt-source-view` `.rt-strike` `.rt-toolbar` `.rt-underline` `.submenu` | `--athena-accent` `--athena-accent-fg` `--athena-bg` `--athena-border-width` `--athena-fg` `--athena-hover` `--athena-line` `--athena-muted` `--athena-radius` `--athena-surface` |
80
+ | Theme picker (generateThemePicker). The preview is drawn with the colours of the theme it shows. | `.theme-picker` `.theme-picker-description` `.theme-picker-group` `.theme-picker-option` `.theme-picker-options` `.theme-preview` `.theme-preview-bar` `.theme-preview-body` `.theme-preview-button` `.theme-preview-line` | `--athena-accent` `--athena-bg` `--athena-border-width` `--athena-fg` `--athena-focus` `--athena-focus-width` `--athena-line` `--athena-muted` `--athena-radius` `--athena-space-1` `--athena-space-3` `--athena-space-4` |
81
+ | Tables with a data source and row actions | `.athena-button` `.athena-chart` `.athena-chart-sparkline` `.athena-table` `.athena-table-actions` `.athena-table-error` `.athena-table-is-loading` `.athena-table-loading` `.athena-visually-hidden` `.chart-area` `.chart-bar` `.chart-data` `.chart-hidden` `.chart-legend-item` `.chart-line` `.chart-point` `.chart-ring` `.chart-slice` `.chart-swatch` `.chart-tooltip` `.chart-tooltip-box` `.chart-tooltip-text` `.is-off` `.is-visible` `.s1` `.s2` `.s3` `.s4` `.s5` `.s6` `.s7` `.s8` | `--athena-bg` `--athena-danger` `--athena-fg` `--athena-focus` `--athena-focus-width` `--athena-muted` `--series-1` `--series-2` `--series-3` `--series-4` `--series-5` `--series-6` `--series-7` `--series-8` |
82
+ | Menu (generateMenu): a bar, or tabs at the bottom of the screen with sheets for the groups | `.athena-menu` `.athena-menu-list` `.has-active` `.is-active` `.menu-avatar` `.menu-control` `.menu-icon` `.menu-item` `.menu-item-end` `.menu-sheet` | `--athena-accent` `--athena-accent-fg` `--athena-bg` `--athena-border-width` `--athena-fg` `--athena-focus` `--athena-focus-width` `--athena-hover` `--athena-line` `--athena-radius` `--athena-shadow` |
83
+ | Tabs at the bottom (layout "responsive" switches to it under 700px) | `.athena-menu-bottom-tabs` `.athena-menu-list` `.athena-menu-responsive` `.menu-control` `.menu-item` `.menu-item-end` `.menu-sheet` | `--athena-bg` `--athena-border-width` `--athena-line` `--athena-radius` |
84
+ | Menu: groups inside groups, and badges | `.athena-menu` `.athena-menu-bottom-tabs` `.athena-menu-responsive` `.athena-table-placeholder` `.athena-table-status` `.menu-badge` `.menu-badge-bad` `.menu-badge-info` `.menu-badge-ok` `.menu-badge-warn` `.menu-caret` `.menu-sheet` `.menu-sheet-nested` | `--athena-accent` `--athena-accent-fg` `--athena-danger` `--athena-info` `--athena-muted` `--athena-success` `--athena-warning` |
85
+ | Charts: pointer layer, zoom | `.athena-chart` `.chart-hit` `.chart-marker` `.chart-reset` `.chart-selection` | `--athena-accent` `--athena-focus` `--athena-focus-width` `--athena-muted` |
86
+ | Page header, facts, empty state, loading, stat tone and note | `.empty-icon` `.empty-message` `.empty-state` `.empty-title` `.fact` `.facts` `.facts-inline` `.is-bad` `.is-ok` `.is-warn` `.loading-state` `.page-actions` `.page-description` `.page-header` `.page-header-row` `.page-title` `.stat` `.stat-note` `.stat-value` | `--athena-danger` `--athena-fg` `--athena-muted` `--athena-space-2` `--athena-space-3` `--athena-success` `--athena-warning` |