compostrap 0.0.0-stage → 1.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 (198) hide show
  1. package/dist/css/auth.css +166 -0
  2. package/dist/css/blog.css +512 -0
  3. package/dist/css/chart.css +99 -0
  4. package/dist/css/compostrap.css +5047 -0
  5. package/dist/css/dashboard.css +360 -0
  6. package/dist/css/datagrid.css +64 -0
  7. package/dist/css/datepicker.css +514 -0
  8. package/dist/css/dialogs.css +185 -0
  9. package/dist/css/dropzone.css +86 -0
  10. package/dist/css/elements.css +181 -0
  11. package/dist/css/empty.css +94 -0
  12. package/dist/css/gallery.css +122 -0
  13. package/dist/css/lightbox.css +140 -0
  14. package/dist/css/number-input.css +100 -0
  15. package/dist/css/otp-input.css +177 -0
  16. package/dist/css/password-toggle.css +52 -0
  17. package/dist/css/rating.css +95 -0
  18. package/dist/css/selection.css +59 -0
  19. package/dist/css/settings.css +85 -0
  20. package/dist/css/shop.css +1026 -0
  21. package/dist/css/sidebar-menu.css +438 -0
  22. package/dist/css/sidebar.css +95 -0
  23. package/dist/css/spinner.css +102 -0
  24. package/dist/css/strength.css +118 -0
  25. package/dist/css/theme-switcher.css +5 -0
  26. package/dist/css/theme.css +13006 -0
  27. package/dist/css/tooltip.css +158 -0
  28. package/dist/js/chart.js +257 -0
  29. package/dist/js/datepicker.js +82 -0
  30. package/dist/js/dialogs.js +7 -0
  31. package/dist/js/dropzone.js +15 -0
  32. package/dist/js/index.js +24 -0
  33. package/dist/js/lightbox.js +77 -0
  34. package/dist/js/number-input.js +44 -0
  35. package/dist/js/otp-input.js +182 -0
  36. package/dist/js/password-toggle.js +16 -0
  37. package/dist/js/selection.js +32 -0
  38. package/dist/js/sidebar-menu.js +76 -0
  39. package/dist/js/sidebar.js +120 -0
  40. package/dist/js/spinner.js +27 -0
  41. package/dist/js/strength.js +87 -0
  42. package/dist/js/theme-switcher.js +98 -0
  43. package/dist/js/tooltip.js +17 -0
  44. package/docs/auth.md +25 -0
  45. package/docs/blog.md +85 -0
  46. package/docs/chart.md +39 -0
  47. package/docs/datagrid.md +64 -0
  48. package/docs/datepicker.md +35 -0
  49. package/docs/dialogs.md +81 -0
  50. package/docs/dropzone.md +23 -0
  51. package/docs/elements.md +38 -0
  52. package/docs/empty.md +25 -0
  53. package/docs/gallery.md +23 -0
  54. package/docs/layout.md +143 -0
  55. package/docs/lightbox.md +18 -0
  56. package/docs/number-input.md +19 -0
  57. package/docs/otp-input.md +52 -0
  58. package/docs/password-toggle.md +21 -0
  59. package/docs/rating.md +15 -0
  60. package/docs/selection.md +52 -0
  61. package/docs/settings.md +25 -0
  62. package/docs/shop.md +140 -0
  63. package/docs/spinner.md +51 -0
  64. package/docs/strength.md +26 -0
  65. package/docs/theme-switcher.md +60 -0
  66. package/docs/theme.md +100 -0
  67. package/docs/tooltip.md +30 -0
  68. package/license +21 -0
  69. package/package.json +106 -6
  70. package/readme.md +198 -0
  71. package/src/illustrations/empty.svg +15 -0
  72. package/src/illustrations/forbidden.svg +16 -0
  73. package/src/illustrations/maintenance.svg +14 -0
  74. package/src/illustrations/not-found.svg +22 -0
  75. package/src/illustrations/server-error.svg +21 -0
  76. package/src/js/chart.js +359 -0
  77. package/src/js/datepicker.js +154 -0
  78. package/src/js/dialogs.js +25 -0
  79. package/src/js/dropzone.js +35 -0
  80. package/src/js/index.js +29 -0
  81. package/src/js/lightbox.js +165 -0
  82. package/src/js/number-input.js +87 -0
  83. package/src/js/otp-input.js +401 -0
  84. package/src/js/password-toggle.js +45 -0
  85. package/src/js/selection.js +114 -0
  86. package/src/js/sidebar-menu.js +178 -0
  87. package/src/js/sidebar.js +326 -0
  88. package/src/js/spinner.js +76 -0
  89. package/src/js/strength.js +115 -0
  90. package/src/js/theme-switcher.js +197 -0
  91. package/src/js/tooltip.js +46 -0
  92. package/src/scss/_bootstrap.scss +9 -0
  93. package/src/scss/_variables.scss +58 -0
  94. package/src/scss/auth/_index.scss +210 -0
  95. package/src/scss/auth.scss +5 -0
  96. package/src/scss/blog/_article.scss +181 -0
  97. package/src/scss/blog/_comments.scss +108 -0
  98. package/src/scss/blog/_index.scss +18 -0
  99. package/src/scss/blog/_list.scss +246 -0
  100. package/src/scss/blog/_page.scss +138 -0
  101. package/src/scss/blog.scss +5 -0
  102. package/src/scss/chart/_index.scss +114 -0
  103. package/src/scss/chart.scss +5 -0
  104. package/src/scss/compostrap.scss +29 -0
  105. package/src/scss/dashboard/_content.scss +25 -0
  106. package/src/scss/dashboard/_dropdown.scss +71 -0
  107. package/src/scss/dashboard/_index.scss +9 -0
  108. package/src/scss/dashboard/_nanobar.scss +34 -0
  109. package/src/scss/dashboard/_navbar.scss +314 -0
  110. package/src/scss/dashboard/_theme.scss +27 -0
  111. package/src/scss/dashboard.scss +5 -0
  112. package/src/scss/datagrid/_index.scss +111 -0
  113. package/src/scss/datagrid.scss +5 -0
  114. package/src/scss/datepicker/_index.scss +557 -0
  115. package/src/scss/datepicker.scss +5 -0
  116. package/src/scss/dialogs/_index.scss +8 -0
  117. package/src/scss/dialogs/_modal.scss +82 -0
  118. package/src/scss/dialogs/_offcanvas.scss +13 -0
  119. package/src/scss/dialogs/_search.scss +79 -0
  120. package/src/scss/dialogs/_toast.scss +61 -0
  121. package/src/scss/dialogs.scss +5 -0
  122. package/src/scss/dropzone/_index.scss +111 -0
  123. package/src/scss/dropzone.scss +5 -0
  124. package/src/scss/elements/_datagrid-filter.scss +21 -0
  125. package/src/scss/elements/_index.scss +9 -0
  126. package/src/scss/elements/_list-row.scss +40 -0
  127. package/src/scss/elements/_loading.scss +47 -0
  128. package/src/scss/elements/_stat.scss +73 -0
  129. package/src/scss/elements/_status-dot.scss +38 -0
  130. package/src/scss/elements.scss +5 -0
  131. package/src/scss/empty/_index.scss +117 -0
  132. package/src/scss/empty.scss +5 -0
  133. package/src/scss/gallery/_index.scss +162 -0
  134. package/src/scss/gallery.scss +5 -0
  135. package/src/scss/lightbox/_index.scss +164 -0
  136. package/src/scss/lightbox.scss +5 -0
  137. package/src/scss/number-input/_index.scss +143 -0
  138. package/src/scss/number-input.scss +5 -0
  139. package/src/scss/otp-input/_index.scss +214 -0
  140. package/src/scss/otp-input.scss +5 -0
  141. package/src/scss/password-toggle/_index.scss +82 -0
  142. package/src/scss/password-toggle.scss +5 -0
  143. package/src/scss/rating/_index.scss +121 -0
  144. package/src/scss/rating.scss +5 -0
  145. package/src/scss/selection/_index.scss +84 -0
  146. package/src/scss/selection.scss +5 -0
  147. package/src/scss/settings/_index.scss +6 -0
  148. package/src/scss/settings/_nav-list.scss +52 -0
  149. package/src/scss/settings/_setting-row.scss +50 -0
  150. package/src/scss/settings.scss +5 -0
  151. package/src/scss/shop/_bar.scss +64 -0
  152. package/src/scss/shop/_catalog.scss +308 -0
  153. package/src/scss/shop/_checkout.scss +204 -0
  154. package/src/scss/shop/_filters.scss +116 -0
  155. package/src/scss/shop/_hero.scss +130 -0
  156. package/src/scss/shop/_index.scss +22 -0
  157. package/src/scss/shop/_page.scss +154 -0
  158. package/src/scss/shop/_reviews.scss +165 -0
  159. package/src/scss/shop/_stepper.scss +159 -0
  160. package/src/scss/shop.scss +5 -0
  161. package/src/scss/sidebar/_body.scss +8 -0
  162. package/src/scss/sidebar/_index.scss +8 -0
  163. package/src/scss/sidebar/_sidebar.scss +89 -0
  164. package/src/scss/sidebar/_theme.scss +7 -0
  165. package/src/scss/sidebar/_wrapper.scss +17 -0
  166. package/src/scss/sidebar-menu/_compact.scss +173 -0
  167. package/src/scss/sidebar-menu/_index.scss +9 -0
  168. package/src/scss/sidebar-menu/_list.scss +131 -0
  169. package/src/scss/sidebar-menu/_pills.scss +82 -0
  170. package/src/scss/sidebar-menu/_scrollbar.scss +53 -0
  171. package/src/scss/sidebar-menu/_theme.scss +109 -0
  172. package/src/scss/sidebar-menu.scss +5 -0
  173. package/src/scss/sidebar.scss +5 -0
  174. package/src/scss/spinner/_index.scss +130 -0
  175. package/src/scss/spinner.scss +5 -0
  176. package/src/scss/strength/_index.scss +118 -0
  177. package/src/scss/strength.scss +5 -0
  178. package/src/scss/theme/_accordion.scss +20 -0
  179. package/src/scss/theme/_alerts.scss +24 -0
  180. package/src/scss/theme/_avatar.scss +37 -0
  181. package/src/scss/theme/_badges.scss +53 -0
  182. package/src/scss/theme/_base.scss +9 -0
  183. package/src/scss/theme/_breadcrumb.scss +64 -0
  184. package/src/scss/theme/_buttons.scss +200 -0
  185. package/src/scss/theme/_cards.scss +17 -0
  186. package/src/scss/theme/_colors.scss +139 -0
  187. package/src/scss/theme/_forms.scss +175 -0
  188. package/src/scss/theme/_index.scss +18 -0
  189. package/src/scss/theme/_navs.scss +15 -0
  190. package/src/scss/theme/_overlays.scss +114 -0
  191. package/src/scss/theme/_tables.scss +59 -0
  192. package/src/scss/theme/_variables.scss +189 -0
  193. package/src/scss/theme-switcher/_index.scss +9 -0
  194. package/src/scss/theme-switcher.scss +5 -0
  195. package/src/scss/theme.scss +9 -0
  196. package/src/scss/tooltip/_index.scss +177 -0
  197. package/src/scss/tooltip.scss +5 -0
  198. package/README.md +0 -3
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Strength: rates a password while it is typed and shows the level in a meter, with the markup and scoring of the
3
+ * strength component of Bootstrap 6. A meter (.strength or .strength-bar with data-bs-strength) belongs to the password
4
+ * input it stands next to (in the same parent, or in a parent up to three levels, e.g. around a show-password wrapper);
5
+ * a .strength-text next to the meter gets the name of the level. The inputs are found on every keystroke, so forms
6
+ * loaded later (AJAX snippets) need no new init().
7
+ *
8
+ * <input type="password" class="form-control">
9
+ * <div class="strength" data-bs-strength><div class="strength-segment"></div>…</div>
10
+ * <span class="strength-text"></span>
11
+ */
12
+ const levels = ['weak', 'fair', 'good', 'strong'];
13
+ const special = /[!@#$%^&*(),.?":{}|<>]/;
14
+
15
+ export class Strength {
16
+ static options = {
17
+ minLength: 8,
18
+ thresholds: [2, 4, 6],
19
+ messages: { weak: 'Weak', fair: 'Fair', good: 'Good', strong: 'Strong' },
20
+ scorer: null,
21
+ };
22
+
23
+ static _initialized = false;
24
+
25
+ /** Starts rating; the options (messages, minLength, thresholds, scorer) are merged into the defaults. */
26
+ static init(options = {}) {
27
+ this.options = {
28
+ ...this.options,
29
+ ...options,
30
+ messages: { ...this.options.messages, ...options.messages },
31
+ };
32
+ if (this._initialized) {
33
+ return;
34
+ }
35
+
36
+ this._initialized = true;
37
+ const update = (event) => {
38
+ if (event.target instanceof HTMLInputElement && (event.target.type === 'password' || event.target.closest('.password-toggle'))) {
39
+ this.evaluate(event.target);
40
+ }
41
+ };
42
+ document.addEventListener('input', update);
43
+ document.addEventListener('change', update);
44
+ }
45
+
46
+ /** Rates the input and draws its meter; returns the level, or null for an empty password. */
47
+ static evaluate(input) {
48
+ const meter = this._meterOf(input);
49
+ if (!meter) {
50
+ return null;
51
+ }
52
+
53
+ const score = this.score(input.value);
54
+ const level = this._level(score);
55
+ if ((meter.dataset.bsStrength || null) !== level) {
56
+ meter.dataset.bsStrength = level ?? '';
57
+ const index = level ? levels.indexOf(level) : -1;
58
+ meter.querySelectorAll('.strength-segment').forEach((segment, i) => segment.classList.toggle('active', i <= index));
59
+
60
+ const text = meter.parentElement.querySelector(':scope > .strength-text');
61
+ if (text) {
62
+ text.textContent = level ? this.options.messages[level] : '';
63
+ text.dataset.bsStrength = level ?? '';
64
+ }
65
+
66
+ meter.dispatchEvent(new CustomEvent('strengthChange', { bubbles: true, detail: { strength: level, score } }));
67
+ }
68
+
69
+ return level;
70
+ }
71
+
72
+ /** The score of a password: one point for each rule it meets, or the result of the own scorer. */
73
+ static score(password) {
74
+ if (!password) {
75
+ return 0;
76
+ }
77
+
78
+ if (typeof this.options.scorer === 'function') {
79
+ return this.options.scorer(password);
80
+ }
81
+
82
+ const { minLength } = this.options;
83
+ return [
84
+ password.length >= minLength,
85
+ password.length >= minLength + 4,
86
+ /[a-z]/.test(password),
87
+ /[A-Z]/.test(password),
88
+ /\d/.test(password),
89
+ special.test(password),
90
+ new RegExp(`${special.source}.*${special.source}`).test(password),
91
+ password.length >= 16,
92
+ ].filter(Boolean).length;
93
+ }
94
+
95
+ static _level(score) {
96
+ if (score === 0) {
97
+ return null;
98
+ }
99
+
100
+ const [weak, fair, good] = this.options.thresholds;
101
+ return score <= weak ? 'weak' : score <= fair ? 'fair' : score <= good ? 'good' : 'strong';
102
+ }
103
+
104
+ static _meterOf(input) {
105
+ let parent = input.parentElement;
106
+ for (let depth = 0; parent && depth < 3; depth++, parent = parent.parentElement) {
107
+ const meter = parent.querySelector(':scope > [data-bs-strength]');
108
+ if (meter) {
109
+ return meter;
110
+ }
111
+ }
112
+
113
+ return null;
114
+ }
115
+ }
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Theme switcher: the light or dark theme of Bootstrap, or "auto" (the setting of the system, followed when it
3
+ * changes), remembered in localStorage. Without a stored choice the page follows the system (defaultTheme: 'auto').
4
+ * A toggle button ([data-theme-switcher]) switches light ↔ dark; choice buttons
5
+ * ([data-theme-value="light|dark|auto"], e.g. a segmented control in the user menu) set a mode and are marked active,
6
+ * the auto one says in its title which theme the system has now. A choice made in another tab of the browser is
7
+ * taken over. It fires "theme-switcher:change" on window with the theme and the mode.
8
+ */
9
+ const switcherClickHandlers = new WeakMap();
10
+ const modes = ['light', 'dark', 'auto'];
11
+
12
+ export class ThemeSwitcher {
13
+ constructor(options = {}) {
14
+ this.options = {
15
+ selector: '[data-theme-switcher]',
16
+ choiceSelector: '[data-theme-value]',
17
+ storageKey: 'bootstrap-theme',
18
+ defaultTheme: 'auto',
19
+ lightIcon: '',
20
+ darkIcon: '',
21
+ lightLabel: 'Light mode',
22
+ darkLabel: 'Dark mode',
23
+ autoLightTitle: 'System theme: light',
24
+ autoDarkTitle: 'System theme: dark',
25
+ ...options,
26
+ };
27
+ }
28
+
29
+ initialize(root = document) {
30
+ this.root = root;
31
+ this.documentElement = document.documentElement;
32
+ this.switchers = [...root.querySelectorAll(this.options.selector)];
33
+ this.choices = [...root.querySelectorAll(this.options.choiceSelector)];
34
+ this.media = window.matchMedia('(prefers-color-scheme: dark)');
35
+
36
+ this.setTheme(this.getInitialTheme(), false);
37
+
38
+ const listen = (element, handler) => {
39
+ const previousHandler = switcherClickHandlers.get(element);
40
+ if (previousHandler) {
41
+ element.removeEventListener('click', previousHandler);
42
+ }
43
+ element.addEventListener('click', handler);
44
+ switcherClickHandlers.set(element, handler);
45
+ };
46
+ for (const switcher of this.switchers) {
47
+ listen(switcher, () => this.toggle());
48
+ }
49
+ for (const choice of this.choices) {
50
+ listen(choice, () => this.setTheme(choice.dataset.themeValue));
51
+ }
52
+
53
+ // in the auto mode the page follows the system when it switches between light and dark
54
+ if (!this.mediaHandler) {
55
+ this.mediaHandler = () => {
56
+ if (this.mode === 'auto') {
57
+ this.setTheme('auto', false);
58
+ } else {
59
+ this.updateChoices();
60
+ }
61
+ };
62
+ this.media.addEventListener('change', this.mediaHandler);
63
+
64
+ // a choice made in another tab of the browser (the key is null when the whole storage was cleared)
65
+ window.addEventListener('storage', (event) => {
66
+ if (event.key === this.options.storageKey || event.key === null) {
67
+ this.setTheme(this.getInitialTheme(), false);
68
+ }
69
+ });
70
+ }
71
+
72
+ return this;
73
+ }
74
+
75
+ getInitialTheme() {
76
+ let storedTheme;
77
+ try {
78
+ storedTheme = localStorage.getItem(this.options.storageKey);
79
+ } catch {
80
+ // Storage can be unavailable in restricted browser contexts.
81
+ }
82
+
83
+ // nothing chosen yet: the default, which is the theme of the system unless a project sets its own
84
+ return modes.includes(storedTheme) ? storedTheme : this.options.defaultTheme;
85
+ }
86
+
87
+ getSystemTheme() {
88
+ return this.media.matches ? 'dark' : 'light';
89
+ }
90
+
91
+ getCurrentTheme() {
92
+ return this.documentElement.getAttribute('data-bs-theme') === 'dark'
93
+ ? 'dark'
94
+ : 'light';
95
+ }
96
+
97
+ getNextTheme() {
98
+ return this.getCurrentTheme() === 'dark' ? 'light' : 'dark';
99
+ }
100
+
101
+ /**
102
+ * The toggle button: the opposite of the shown theme. When that is the theme of the system, the page goes back
103
+ * to following it ("auto") instead of being pinned, so a later change of the system is not ignored.
104
+ */
105
+ toggle() {
106
+ const next = this.getNextTheme();
107
+ this.setTheme(next === this.getSystemTheme() ? 'auto' : next);
108
+ }
109
+
110
+ /** Sets "light", "dark" or "auto" (the theme of the system). */
111
+ setTheme(mode, persist = true) {
112
+ this.mode = modes.includes(mode) ? mode : 'auto';
113
+ const theme = this.mode === 'auto' ? this.getSystemTheme() : this.mode;
114
+ this.documentElement.setAttribute('data-bs-theme', theme);
115
+
116
+ if (persist) {
117
+ try {
118
+ localStorage.setItem(this.options.storageKey, this.mode);
119
+ } catch {
120
+ // Keep the in-page theme change even when persistence is unavailable.
121
+ }
122
+ }
123
+
124
+ this.updateSwitchers(theme);
125
+ this.updateChoices();
126
+ this.dispatchChange(theme);
127
+ }
128
+
129
+ updateChoices() {
130
+ for (const choice of this.choices) {
131
+ const active = choice.dataset.themeValue === this.mode;
132
+ choice.classList.toggle('active', active);
133
+ choice.setAttribute('aria-pressed', String(active));
134
+
135
+ // the auto choice tells which theme the system has now
136
+ if (choice.dataset.themeValue === 'auto') {
137
+ const system = this.getSystemTheme();
138
+ choice.dataset.themeSystem = system;
139
+ choice.title = this.getOption(choice, system === 'dark' ? 'autoDarkTitle' : 'autoLightTitle');
140
+ }
141
+ }
142
+ }
143
+
144
+ updateSwitchers(theme) {
145
+ const targetTheme = theme === 'dark' ? 'light' : 'dark';
146
+
147
+ for (const switcher of this.switchers) {
148
+ switcher.setAttribute('aria-pressed', String(theme === 'dark'));
149
+ switcher.dataset.theme = theme;
150
+
151
+ this.updateIcon(switcher, targetTheme);
152
+ this.updateLabel(switcher, targetTheme);
153
+ }
154
+ }
155
+
156
+ updateIcon(switcher, targetTheme) {
157
+ const icon = switcher.querySelector('[data-theme-switcher-icon]');
158
+
159
+ if (!icon) {
160
+ return;
161
+ }
162
+
163
+ const iconClass = targetTheme === 'light'
164
+ ? this.getOption(switcher, 'lightIcon')
165
+ : this.getOption(switcher, 'darkIcon');
166
+
167
+ if (iconClass) {
168
+ icon.className = iconClass;
169
+ }
170
+ }
171
+
172
+ updateLabel(switcher, targetTheme) {
173
+ const label = switcher.querySelector('[data-theme-switcher-label]');
174
+
175
+ if (!label) {
176
+ return;
177
+ }
178
+
179
+ label.textContent = targetTheme === 'light'
180
+ ? this.getOption(switcher, 'lightLabel')
181
+ : this.getOption(switcher, 'darkLabel');
182
+ }
183
+
184
+ getOption(switcher, name) {
185
+ const themeName = `theme${name.charAt(0).toUpperCase()}${name.slice(1)}`;
186
+
187
+ return switcher.dataset[themeName]
188
+ || switcher.dataset[name]
189
+ || this.options[name];
190
+ }
191
+
192
+ dispatchChange(theme) {
193
+ window.dispatchEvent(new CustomEvent('theme-switcher:change', {
194
+ detail: { theme, mode: this.mode },
195
+ }));
196
+ }
197
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * CssTooltip: Esc hides the CSS tooltip ([data-tooltip]) that is shown, without moving the mouse or the focus away
3
+ * (WCAG 1.4.13). The tooltip itself needs no script; this only adds the key. The first Esc hides the tooltip and
4
+ * goes no further, so a modal or an offcanvas under it stays open; the next one closes it. The tooltip comes back
5
+ * when the mouse or the focus returns to its element. The key is caught on the document, so content loaded later
6
+ * (AJAX snippets) needs no new init().
7
+ *
8
+ * CssTooltip.init(); // once
9
+ */
10
+ // an element whose tooltip is shown now (a button with an open dropdown shows none)
11
+ const shown = '[data-tooltip]:is(:hover, :focus-visible):not([aria-expanded="true"], [data-tooltip-hidden])';
12
+
13
+ export class CssTooltip {
14
+ static _initialized = false;
15
+
16
+ static init() {
17
+ if (this._initialized) {
18
+ return;
19
+ }
20
+
21
+ this._initialized = true;
22
+ document.addEventListener('keydown', (event) => {
23
+ if (event.key !== 'Escape') {
24
+ return;
25
+ }
26
+
27
+ const elements = document.querySelectorAll(shown);
28
+ if (!elements.length) {
29
+ return;
30
+ }
31
+
32
+ elements.forEach((element) => element.setAttribute('data-tooltip-hidden', ''));
33
+ // the key hid the tooltip: it does not close the dialog under it as well
34
+ event.preventDefault();
35
+ event.stopPropagation();
36
+ }, true);
37
+
38
+ // once neither the mouse nor the focus is on the element, its tooltip may be shown again
39
+ const restore = () => setTimeout(() => {
40
+ document.querySelectorAll('[data-tooltip-hidden]:not(:hover, :focus-visible)')
41
+ .forEach((element) => element.removeAttribute('data-tooltip-hidden'));
42
+ });
43
+ document.addEventListener('mouseout', restore, true);
44
+ document.addEventListener('focusout', restore, true);
45
+ }
46
+ }
@@ -0,0 +1,9 @@
1
+ //
2
+ // Bootstrap 5.3 has no Sass modules, so its functions, variables and mixins are loaded here by @import, once for the
3
+ // whole package, with the variables of the theme first; the modules use them as `@use '../bootstrap' as bs;`
4
+ //
5
+
6
+ @import 'theme/variables';
7
+ @import 'bootstrap/scss/functions';
8
+ @import 'bootstrap/scss/variables';
9
+ @import 'bootstrap/scss/mixins';
@@ -0,0 +1,58 @@
1
+ //
2
+ // settings shared by the modules
3
+ //
4
+
5
+ // icon font of the menu arrows and the breadcrumb separators: Bootstrap Icons
6
+ // (for Font Awesome: 'Font Awesome 7 Free', weight 900, '\f105' and '\f107')
7
+ $icon-font: 'bootstrap-icons' !default;
8
+ $icon-font-weight: 400 !default;
9
+ $icon-chevron-right: '\f285' !default;
10
+ $icon-chevron-down: '\f282' !default;
11
+
12
+ // the eye and the crossed eye of the password toggle
13
+ $icon-eye: '\f341' !default;
14
+ $icon-eye-slash: '\f340' !default;
15
+
16
+ // width of the sidebar and height of the navbar and sidebar brand
17
+ $sm-width: 15rem !default;
18
+ // width of the compact sidebar with the icons only (html.sidebar-compact)
19
+ $sm-compact-width: 4.5rem !default;
20
+ $sm-top: 3.75rem !default;
21
+
22
+ // menu: text, rows of the first level (44px) and of submenus (32px), section titles
23
+ $sm-font-size: .875rem !default;
24
+ $sm-line-height: 1.25rem !default;
25
+ $sm-link-padding-y: .75rem !default;
26
+ $sm-link-padding-x: 1.25rem !default;
27
+ $sm-sublink-padding-y: .375rem !default;
28
+ $sm-sub-indent: 1rem !default;
29
+ $sm-title-font-size: .75rem !default;
30
+ $sm-section-gap: 1rem !default;
31
+
32
+ // menu icons: the column they sit in, the gap to the text and their size
33
+ $sm-icon-width: 1.5rem !default;
34
+ $sm-icon-gap: .625rem !default;
35
+ $sm-icon-size: 1rem !default;
36
+
37
+ // size of the rotating arrows of submenus
38
+ $sm-arrow-size: .5625rem !default;
39
+ // shift of the arrows towards the right edge (into the padding of the link)
40
+ $sm-arrow-shift: .1875rem !default;
41
+ // a thin glyph of 9px looks pale, a stroke of its own color makes it as strong as the text
42
+ $sm-arrow-stroke: .4px !default;
43
+
44
+ // width of the menu scrollbar and height of the nanobar
45
+ $sm-scrollbar: .25rem !default;
46
+ $sm-nanobar: .25rem !default;
47
+
48
+ // the shadow of the surfaces on the page (boxes, cards, the sidebar, tiles, the sign-in box) and the shadow under the
49
+ // white navbar while the content scrolls; none for now, the surfaces part from the page by their color only (to try
50
+ // it with shadows again: 1px 1px 1px rgba(0, 0, 0, .05), 2px 6px 16px -6px rgba(0, 0, 0, .12), right and down only,
51
+ // and 0 8px 12px -8px rgba(0, 0, 0, .12) under the navbar); the theme has the same in $box-shadow-sm
52
+ $soft-shadow: none !default;
53
+
54
+ // a faint line around the boxes of the page (content boxes, cards, the sign-in box, the boxes of the shop); none for
55
+ // now, the user is deciding (the last value tried: 1px solid rgba(var(--bs-body-color-rgb), .07), mixed from the color
56
+ // of the text, so it works in both themes; .06 was too weak, .08 too strong). The theme has the same in $surface-border
57
+ $surface-border: none !default;
58
+ $navbar-scroll-shadow: none !default;
@@ -0,0 +1,210 @@
1
+ //
2
+ // auth: pages outside the administration (sign in, sign up, password recovery), a box in the middle of the page
3
+ //
4
+ // <body class="auth-page">
5
+ // <div class="auth">
6
+ // <div class="auth-top"><a class="auth-brand" href="...">logo Name</a> <div class="auth-actions">theme switch, language dropdown</div></div>
7
+ // <div class="auth-card auth-card-split">
8
+ // <aside class="auth-visual" aria-hidden="true"><i class="bi bi-shield-lock"></i></aside>
9
+ // <main class="auth-body">
10
+ // <header class="auth-header"><h1 class="auth-title">Sign in</h1><p class="auth-subtitle">...</p></header>
11
+ // form
12
+ // <div class="auth-links"><a href="...">Forgot your password?</a></div>
13
+ // </main>
14
+ // </div>
15
+ // <footer class="auth-footer">&copy; 2026 Name</footer>
16
+ // </div>
17
+ // </body>
18
+ //
19
+ // Without `auth-card-split` the box is narrow and has no visual. A one-time code is the module `otp-input`.
20
+ //
21
+
22
+ @use '../bootstrap' as bs;
23
+ @use '../variables' as var;
24
+
25
+ :root,
26
+ [data-bs-theme='light'] {
27
+ --auth-page-bg: color-mix(in srgb, var(--bs-tertiary-bg) 98.4%, #000);
28
+ --auth-card-bg: var(--bs-body-bg);
29
+ --auth-visual-bg: color-mix(in srgb, var(--bs-secondary-bg) 60%, var(--bs-body-bg));
30
+ // the icon is a deeper shade of the same gray (lighter in the dark theme, towards the text)
31
+ --auth-visual-color: color-mix(in srgb, var(--bs-secondary-bg) 70%, var(--bs-body-color));
32
+ --auth-card-width: 26rem;
33
+ --auth-card-split-width: 56rem;
34
+ }
35
+
36
+ // the page is darker than the box, as in the dashboard
37
+ [data-bs-theme='dark'] {
38
+ --auth-page-bg: color-mix(in srgb, var(--bs-body-bg) 55%, #000);
39
+ }
40
+
41
+ .auth-page {
42
+ min-height: 100vh;
43
+ min-height: 100dvh;
44
+ background-color: var(--auth-page-bg);
45
+ }
46
+
47
+ .auth {
48
+ display: flex;
49
+ flex-direction: column;
50
+ justify-content: center;
51
+ width: min(100% - 2rem, var(--auth-card-width));
52
+ min-height: 100vh;
53
+ min-height: 100dvh;
54
+ padding-block: 2rem 1rem;
55
+ margin-inline: auto;
56
+
57
+ &:has(> .auth-card-split) {
58
+ width: min(100% - 2rem, var(--auth-card-split-width));
59
+ }
60
+ }
61
+
62
+ .auth-top {
63
+ display: flex;
64
+ gap: 1rem;
65
+ align-items: center;
66
+ justify-content: space-between;
67
+ margin-bottom: 1rem;
68
+ padding-inline: .25rem;
69
+ }
70
+
71
+ // the buttons on the right of the top row: the theme switch and the language dropdown
72
+ .auth-actions {
73
+ display: flex;
74
+ gap: .25rem;
75
+ align-items: center;
76
+ }
77
+
78
+ .auth-brand {
79
+ display: inline-flex;
80
+ gap: .625rem;
81
+ align-items: center;
82
+ font-size: 1.0625rem;
83
+ font-weight: 600;
84
+ color: var(--bs-emphasis-color);
85
+ text-decoration: none;
86
+
87
+ &:hover {
88
+ color: var(--bs-emphasis-color);
89
+ text-decoration: none;
90
+ }
91
+ }
92
+
93
+ .auth-card {
94
+ overflow: hidden;
95
+ color: var(--bs-body-color);
96
+ background-color: var(--auth-card-bg);
97
+ border: var.$surface-border;
98
+ border-radius: var(--bs-border-radius-lg);
99
+ box-shadow: var.$soft-shadow;
100
+ }
101
+
102
+ .auth-visual {
103
+ display: none;
104
+ align-items: center;
105
+ justify-content: center;
106
+ font-size: 6rem;
107
+ color: var(--auth-visual-color);
108
+ background-color: var(--auth-visual-bg);
109
+ }
110
+
111
+ .auth-body {
112
+ min-width: 0;
113
+ padding: 2rem 1.5rem;
114
+ }
115
+
116
+ .auth-toolbar {
117
+ display: flex;
118
+ gap: .5rem;
119
+ align-items: center;
120
+ justify-content: flex-end;
121
+ margin-bottom: 1.5rem;
122
+ font-size: .875rem;
123
+
124
+ // plain links of the languages; a dropdown (the language menu of the navbar) keeps the look of its own items
125
+ > a {
126
+ color: var(--bs-secondary-color);
127
+
128
+ &:hover,
129
+ &.active {
130
+ color: var(--bs-emphasis-color);
131
+ }
132
+
133
+ &.active {
134
+ font-weight: 600;
135
+ }
136
+ }
137
+ }
138
+
139
+ .auth-header {
140
+ margin-bottom: 1.5rem;
141
+ }
142
+
143
+ .auth-title {
144
+ margin-bottom: 0;
145
+ font-size: 1.25rem;
146
+ font-weight: 600;
147
+ }
148
+
149
+ .auth-subtitle {
150
+ margin: .375rem 0 0;
151
+ color: var(--bs-secondary-color);
152
+ }
153
+
154
+ .auth-links {
155
+ display: flex;
156
+ flex-direction: column;
157
+ gap: .25rem;
158
+ margin-top: 1.25rem;
159
+ font-size: .875rem;
160
+ text-align: center;
161
+ }
162
+
163
+ .auth-footer {
164
+ margin-top: 1rem;
165
+ font-size: .875rem;
166
+ color: var(--bs-secondary-color);
167
+ text-align: center;
168
+ }
169
+
170
+ @include bs.media-breakpoint-up(sm) {
171
+ .auth-body {
172
+ padding: 2.5rem;
173
+ }
174
+ }
175
+
176
+ // the split box: the visual on the left, the form on the right, the form keeps the width of the narrow box
177
+ @include bs.media-breakpoint-up(lg) {
178
+ .auth-card-split {
179
+ display: grid;
180
+ grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
181
+ min-height: 34rem;
182
+
183
+ > .auth-visual {
184
+ display: flex;
185
+ }
186
+
187
+ // the side padding keeps the content 24rem wide in the middle of the column
188
+ > .auth-body {
189
+ display: flex;
190
+ flex-direction: column;
191
+ justify-content: center;
192
+ padding: 3rem max(3rem, (100% - 24rem) / 2);
193
+
194
+ // the free height goes above and below the form; with plain links of the languages (.auth-toolbar) over
195
+ // the form they keep their gap on a tall form
196
+ > .auth-toolbar {
197
+ padding-bottom: 1.5rem;
198
+ margin-bottom: auto;
199
+ }
200
+
201
+ > .auth-header:first-child {
202
+ margin-top: auto;
203
+ }
204
+
205
+ > .auth-links {
206
+ margin-bottom: auto;
207
+ }
208
+ }
209
+ }
210
+ }
@@ -0,0 +1,5 @@
1
+ //
2
+ // auth module of compostrap
3
+ //
4
+
5
+ @use 'auth/index';