compostrap 0.0.0-stage → 1.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 (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 +5052 -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 +144 -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 +439 -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 +13034 -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 +171 -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 +174 -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 +128 -0
  191. package/src/scss/theme/_tables.scss +59 -0
  192. package/src/scss/theme/_variables.scss +194 -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
package/docs/auth.md ADDED
@@ -0,0 +1,25 @@
1
+ # Sign-in pages
2
+
3
+ [← Compostrap](../readme.md#documentation)
4
+
5
+ The module `auth` lays out a page outside the administration: the brand and the theme switch above a box in the middle, a footer under it. The box is narrow; `auth-card-split` makes it wide with a visual on the left from large screens (the visual is hidden on smaller ones). A one-time code (the recovery of a password) is typed into the slots of the module [`otp-input`](otp-input.md).
6
+
7
+ ```html
8
+ <body class="auth-page">
9
+ <div class="auth">
10
+ <div class="auth-top"><a class="auth-brand" href="/">Logo Name</a> <div class="auth-actions">(theme switch, language dropdown)</div></div>
11
+ <div class="auth-card auth-card-split">
12
+ <aside class="auth-visual" aria-hidden="true"><i class="bi bi-shield-lock"></i></aside>
13
+ <main class="auth-body">
14
+ <header class="auth-header">
15
+ <h1 class="auth-title">Sign in to your account</h1>
16
+ <p class="auth-subtitle">Enter your email and password to continue.</p>
17
+ </header>
18
+ (form)
19
+ <div class="auth-links"><a href="...">Forgot your password?</a></div>
20
+ </main>
21
+ </div>
22
+ <footer class="auth-footer">&copy; 2026 Name</footer>
23
+ </div>
24
+ </body>
25
+ ```
package/docs/blog.md ADDED
@@ -0,0 +1,85 @@
1
+ # Blog
2
+
3
+ [← Compostrap](../readme.md#documentation)
4
+
5
+ The module `blog` styles a website with a blog, outside the administration: a header with the links of the website, the list of articles with its categories, an article with its text and the comments under it. The page is white, the header and the footer are tinted bars and the boxes (cards of articles, comments, the comment form) are tinted instead of framed (`--blog-page-bg`, `--blog-tint-bg`, `--blog-tint-hover-bg`). The header holds a navbar of Bootstrap, so the links fold into a menu on a phone.
6
+
7
+ ```html
8
+ <body class="blog-page">
9
+ <header class="blog-header">
10
+ <nav class="navbar navbar-expand-lg">
11
+ <div class="container">
12
+ <a class="blog-brand" href="/">Logo <span>Name</span></a>
13
+ <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#blog-menu" aria-controls="blog-menu" aria-expanded="false" aria-label="Menu"><span class="navbar-toggler-icon"></span></button>
14
+ <div class="collapse navbar-collapse" id="blog-menu">
15
+ <ul class="navbar-nav ms-auto"><li class="nav-item"><a class="nav-link active" href="/blog">Blog</a></li></ul>
16
+ <div class="blog-header-actions"><a class="btn btn-primary btn-sm" href="/sign-in">Sign in</a></div>
17
+ </div>
18
+ </div>
19
+ </nav>
20
+ </header>
21
+ <main class="container">…</main>
22
+ <footer class="blog-footer">
23
+ <div class="container">
24
+ <div class="row g-4">
25
+ <div class="col-lg-4">…</div>
26
+ <div class="col-6 col-md-4 col-lg-2"><h2 class="blog-footer-title">Links</h2><ul class="blog-footer-links"><li><a href="/blog">Blog</a></li></ul></div>
27
+ </div>
28
+ </div>
29
+ </footer>
30
+ </body>
31
+ ```
32
+
33
+ **List of articles.**
34
+
35
+ - `.blog-title` is the heading of a page; `.blog-heading` puts a link on its right.
36
+ - `nav.blog-pills` holds the categories as links `.blog-pill`, the chosen one with `active`.
37
+ - `article.blog-featured` is the newest article over the whole row: a picture in `.blog-featured-image` next to `.blog-featured-body`.
38
+ - `article.blog-card` are the other articles, in a Bootstrap grid (`row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4`).
39
+ - `.blog-card-title` holds the link of the whole block (`stretched-link`); other links in the block get `.blog-over`.
40
+ - `.blog-meta` is a line of date, category and comments parted by dots.
41
+ - `.blog-author` is an `avatar` of the theme with the name (`.blog-author-name`).
42
+
43
+ ```html
44
+ <article class="blog-card">
45
+ <div class="blog-card-image"><img src="…" alt="" loading="lazy"></div>
46
+ <div class="blog-meta"><time datetime="2026-11-05">5 days ago</time><a class="blog-over" href="/blog/latte">Latte</a></div>
47
+ <h2 class="blog-card-title"><a class="stretched-link" href="/blog/article">Title</a></h2>
48
+ <p class="blog-card-text">Perex, cut after three lines.</p>
49
+ <div class="blog-card-footer">
50
+ <div class="blog-author"><span class="avatar avatar-sm theme-success">PK</span><span>Petra Králová</span></div>
51
+ <a class="blog-over" href="/blog/article#comments">Comments: 5</a>
52
+ </div>
53
+ </article>
54
+ ```
55
+
56
+ **Article.** `article.blog-article` is a narrow column (`--blog-article-width`, 48rem) with:
57
+
58
+ - `.blog-back`, a link back,
59
+ - `.blog-article-title` and the perex `.blog-article-lead`,
60
+ - `.blog-meta.blog-article-meta` with the author, the date and the category,
61
+ - `.blog-article-image`, the cover (a 21 : 9 cut),
62
+ - `.blog-content`, the text: 16px text with more room between lines, headings, lists, pictures as wide cuts, a quote with a line of the primary color and code blocks on the tint. Links in the text are underlined (the theme draws links without a line, and a color alone does not tell a link from the text); so are the links in `.blog-comment-content`.
63
+
64
+ A highlighted code is written with the text classes of Bootstrap; in a code block they take the colors of the code on nette.org, which can be changed by a variable (each as `r, g, b`):
65
+
66
+ | Class | Part of the code | Variable |
67
+ |-------|------------------|----------|
68
+ | `text-primary` | keyword and tag | `--blog-code-keyword` |
69
+ | `text-primary-emphasis` | name of a function or method | `--blog-code-function` |
70
+ | `text-success` | string | `--blog-code-string` |
71
+ | `text-danger` | number | `--blog-code-number` |
72
+ | `text-warning-emphasis` | variable | `--blog-code-variable` |
73
+ | `text-info-emphasis` | attribute | `--blog-code-attribute` |
74
+ | `text-danger-emphasis` | Latte tag | `--blog-code-macro` |
75
+ | `text-body-secondary` | comment | `--blog-code-comment` |
76
+
77
+ The box of a code is `--blog-code-bg`.
78
+
79
+ **Comments.** `section.blog-comments` with `.blog-comments-title`; a comment is `article.blog-comment` with:
80
+
81
+ - `.blog-comment-head`: the avatar, `.blog-comment-author`, the link of its number and the time,
82
+ - `.blog-comment-content`: the text of a comment, which holds only the message;
83
+ - `.blog-meta.blog-comment-foot`: Reply and, in a comment that answers another one, the link to it as "In reply to".
84
+
85
+ A comment opened by its link (`#comment-2`) is stronger and stays under the sticky header. The form of a new comment stands in `.blog-comment-form` with its title `.blog-comment-form-title` over the box.
package/docs/chart.md ADDED
@@ -0,0 +1,39 @@
1
+ # Charts
2
+
3
+ [← Compostrap](../readme.md#documentation)
4
+
5
+ Charts of [Chart.js](https://www.chartjs.org) written as markup, so a template prints a chart without JavaScript of its own: a `<canvas data-chart>` in a `.chart` box with the data as JSON.
6
+
7
+ - The colors, the font, the grid and the tooltip come from the theme, and the charts are drawn again when the light or dark theme changes.
8
+ - The four categorical colors (`--chart-1` … `--chart-4`: blue, orange, purple, green) are checked for color blindness and contrast on the surfaces of both themes; a series of context takes the gray `--chart-muted`.
9
+ - Two or more series get a legend.
10
+ - A tooltip shows every series at the hovered position.
11
+ - Every chart gets a table of its values for screen readers.
12
+
13
+ ```html
14
+ <div class="chart" style="--chart-height: 16rem">
15
+ <canvas aria-label="Revenue of the last 30 days" data-chart='{
16
+ "type": "area",
17
+ "labels": ["9. 10.", "10. 10.", "11. 10."],
18
+ "series": [{"name": "Revenue", "data": [32400, 30100, 21800]}],
19
+ "format": {"style": "currency", "currency": "USD", "maximumFractionDigits": 0},
20
+ "locale": "en-US"
21
+ }'></canvas>
22
+ </div>
23
+ ```
24
+
25
+ | Type | For |
26
+ |------|-----|
27
+ | `area` | one series over time: a line with a light wash under it |
28
+ | `line` | series over time; `"color": "muted"` makes a series the gray context of the highlighted one |
29
+ | `bar` | columns, e.g. orders per day |
30
+ | `bar-horizontal` | ranked bars of a part-to-whole (the largest first), their values at the ends |
31
+ | `sparkline` | a small trend in a stat tile (`.chart.chart-sparkline`), the last point in the accent |
32
+
33
+ A series takes the next color, or its own `"color": 1`–`4` or `"muted"`; `null` is a missing value. `format` are the options of `Intl.NumberFormat`, `locale` their language (the `lang` of the page by default).
34
+
35
+ ```js
36
+ import { Charts } from 'compostrap/chart'; // needs chart.js
37
+
38
+ Charts.init(); // draws every canvas[data-chart]; call it again (or Charts.init(snippet)) for charts loaded by AJAX
39
+ ```
@@ -0,0 +1,64 @@
1
+ # Datagrid
2
+
3
+ [← Compostrap](../readme.md#documentation)
4
+
5
+ The table of a list with sorting, filters and row actions. The classes are the ones drago-ex/datagrid prints, so its table needs no styles of its own; the module has no JavaScript.
6
+
7
+ - `datagrid-table` is the table. Every row is at least as high as a row with a badge (38px), so lists with only text and lists with badges look the same; a cell that opens something (a number of comments) holds an `a.badge` rather than a button, which would make its row higher. It stands on the surface of its box (no background of its own) and is wrapped in a `table-responsive` with `tabindex="0"`, `role="region"` and an `aria-label`, so it scrolls inside the box on a narrow screen, by the keyboard too.
8
+ - `datagrid-filter-row` is the row of the filters under the column names, with `datagrid-control` fields. The cross that clears an active filter is `datagrid-filter-clear` of [elements](elements.md).
9
+ - `datagrid-control-range` is the field of a filter with a range of dates (a [datepicker](datepicker.md) with `data-bs-selection-mode="multiple-ranged"`); its wrapper keeps room for both dates.
10
+ - `datagrid-switch` on a `form-check form-switch` in a cell is a switch of a state of the row (Published, Active) with the state as its label.
11
+ - `datagrid-state` on a `button.badge.badge-subtle` in a `dropdown` is a state of the row changed by a menu (Published, Draft, Waiting): the badge has a small arrow (`bi-chevron-down`) and opens a `dropdown-menu` with the states, the current one `active` with `aria-current="true"`. The button needs `data-bs-popper-config='{"strategy":"fixed"}'` like the menu of the row actions.
12
+ - `datagrid-toolbar` holds the filters when they stand over the table, each in a `datagrid-filter` with its label.
13
+ - `datagrid-row-clickable` is a row that opens its item by a click.
14
+ - `datagrid-actions` is the narrow column of the row actions: a menu under a button of three dots, or icon buttons.
15
+ - `datagrid-actions-autohide` on a row shows its actions only under the mouse, with the focus inside the row and while their menu is open. A touch screen shows them always.
16
+
17
+ ```html
18
+ <div class="table-responsive" tabindex="0" role="region" aria-label="Articles">
19
+ <table class="table table-sm table-borderless table-hover datagrid-table">
20
+ <thead>
21
+ <tr>
22
+ <th><a href="…">Title &darr;</a></th>
23
+ <th class="text-end">&nbsp;</th>
24
+ </tr>
25
+ <tr class="datagrid-filter-row">
26
+ <th class="p-1"><input type="text" class="form-control form-control-sm datagrid-control" aria-label="Title"></th>
27
+ <th class="p-1"></th>
28
+ </tr>
29
+ </thead>
30
+ <tbody>
31
+ <tr>
32
+ <td>First steps</td>
33
+ <td class="text-end datagrid-actions">
34
+ <div class="dropdown">
35
+ <button type="button" class="btn btn-xs btn-icon btn-text" data-bs-toggle="dropdown" data-bs-popper-config='{"strategy":"fixed"}' aria-expanded="false" aria-label="Actions">
36
+ <i class="bi bi-three-dots-vertical" aria-hidden="true"></i>
37
+ </button>
38
+ <ul class="dropdown-menu dropdown-menu-end">
39
+ <li><a class="dropdown-item" href="…"><i class="bi bi-pencil me-2" aria-hidden="true"></i>Edit</a></li>
40
+ <li><hr class="dropdown-divider"></li>
41
+ <li><a class="dropdown-item text-danger" href="…"><i class="bi bi-trash me-2" aria-hidden="true"></i>Delete</a></li>
42
+ </ul>
43
+ </div>
44
+ </td>
45
+ </tr>
46
+ </tbody>
47
+ </table>
48
+ </div>
49
+ ```
50
+
51
+ The button of the menu has `data-bs-popper-config='{"strategy":"fixed"}'`, or the scrolling wrapper of the table would cut the menu off.
52
+
53
+ Rows chosen by checkboxes and the bar with the actions for them are the module [selection](selection.md). A state of a row (Published, Draft) is a `badge badge-subtle` with a `theme-*` color of the [theme](theme.md); with `datagrid-state` it is changed in place:
54
+
55
+ ```html
56
+ <div class="dropdown">
57
+ <button type="button" class="badge badge-subtle theme-success datagrid-state" data-bs-toggle="dropdown" data-bs-popper-config='{"strategy":"fixed"}' aria-expanded="false" title="Change the state">Published<i class="bi bi-chevron-down" aria-hidden="true"></i></button>
58
+ <ul class="dropdown-menu">
59
+ <li><a class="dropdown-item active" href="…" aria-current="true">Published</a></li>
60
+ <li><a class="dropdown-item" href="…">Draft</a></li>
61
+ <li><a class="dropdown-item" href="…">Waiting</a></li>
62
+ </ul>
63
+ </div>
64
+ ```
@@ -0,0 +1,35 @@
1
+ # Datepicker
2
+
3
+ [← Compostrap](../readme.md#documentation)
4
+
5
+ The calendar of Bootstrap 6: [Vanilla Calendar Pro](https://vanilla-calendar.pro) under an input with `data-bs-toggle="datepicker"`, with the same data attributes as in Bootstrap 6. The value is an ISO date (`2026-11-07`), with a time `2026-11-07 14:30`, which a server reads; `data-bs-date-format="locale"` writes it in the language of the page instead (for display). A choice fires `input` and `change`.
6
+
7
+ ```html
8
+ <input type="text" class="form-control" name="published" data-bs-toggle="datepicker" autocomplete="off">
9
+ <input type="text" class="form-control" data-bs-toggle="datepicker" data-bs-date-min="today" data-bs-locale="cs-CZ">
10
+ <input type="text" class="form-control" data-bs-toggle="datepicker" data-bs-selection-mode="multiple-ranged" data-bs-display-months-count="2">
11
+ <input type="text" class="form-control" data-bs-toggle="datepicker" data-bs-selection-time-mode="24" value="2026-11-07 14:30">
12
+
13
+ <!-- in the page, the value in the hidden input -->
14
+ <div data-bs-toggle="datepicker" data-bs-inline="true"><input type="hidden" name="day"></div>
15
+ ```
16
+
17
+ | Attribute | Value |
18
+ |-----------|-------|
19
+ | `data-bs-date-min`, `data-bs-date-max` | an ISO date or `today` |
20
+ | `data-bs-selection-mode` | `single` (default), `multiple`, `multiple-ranged` |
21
+ | `data-bs-display-months-count` | months side by side |
22
+ | `data-bs-first-weekday` | 1 = Monday (default) |
23
+ | `data-bs-locale` | the language of the month and day names, the `lang` of the page by default |
24
+ | `data-bs-date-format` | `iso` (default) or `locale` |
25
+ | `data-bs-inline` | `true` shows the calendar in the page |
26
+ | `data-bs-selection-time-mode` | `24` or `12`: the hour and the minute under the calendar (fields and sliders); the value gets the time after the date and the calendar stays open after a click on a day |
27
+
28
+ A field that opens the calendar shows a small calendar icon at its end (`$datepicker-icon`, `$datepicker-icon-color`); a field in an `input-group` has none, its icon stands in the group.
29
+
30
+ ```js
31
+ import { Datepicker } from 'compostrap/datepicker'; // needs vanilla-calendar-pro
32
+
33
+ Datepicker.init(); // once; inputs loaded later open their calendar on the first focus
34
+ Datepicker.init({ locale: 'cs-CZ' }); // defaults for all datepickers
35
+ ```
@@ -0,0 +1,81 @@
1
+ # Dialogs
2
+
3
+ [← Compostrap](../readme.md#documentation)
4
+
5
+ The module `dialogs` adds to the modals and offcanvas panels of Bootstrap: `modal-status` is a thin colored line at the top of a modal, `modal-confirm` a narrow centered confirmation or message with a large icon and buttons of the same width. A `theme-*` class of the dialog colors the line and the icon (`theme-danger`, `theme-success`, `theme-info`, `theme-warning`…). `offcanvas-actions` is a bar of form buttons stuck to the bottom of an offcanvas while its content scrolls.
6
+
7
+ ```html
8
+ <div class="modal fade" id="confirm" tabindex="-1" aria-labelledby="confirm-title" aria-hidden="true">
9
+ <div class="modal-dialog modal-dialog-centered modal-confirm theme-danger">
10
+ <div class="modal-content">
11
+ <div class="modal-status"></div>
12
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
13
+ <div class="modal-body">
14
+ <i class="bi bi-exclamation-triangle modal-confirm-icon" aria-hidden="true"></i>
15
+ <h2 class="modal-title" id="confirm-title">Are you sure?</h2>
16
+ <p>Do you really want to delete the item? This cannot be undone.</p>
17
+ </div>
18
+ <div class="modal-footer">
19
+ <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
20
+ <button type="submit" class="btn btn-danger">Delete</button>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ ```
26
+
27
+ **A click outside.** `Dialogs.init()` makes every modal and offcanvas stay open when the user clicks outside of it, so a form in a dialog is not lost by a slip of the mouse; a dialog is closed by its cross, its Cancel button (`data-bs-dismiss`) and Esc. It sets the default `backdrop` option of Bootstrap to `static`, so it also holds for dialogs loaded later (AJAX) or opened from a script; call it before the first dialog is opened. A dialog that should close by a click outside (the search below, which has no button to close it) says so by `data-bs-backdrop="true"`. Without `Dialogs.init()` nothing changes and single dialogs can take `data-bs-backdrop="static"` of Bootstrap.
28
+
29
+ ```javascript
30
+ import { Dialogs } from 'compostrap';
31
+
32
+ Dialogs.init();
33
+
34
+ // Bootstrap imported as a module instead of window.bootstrap
35
+ import { Modal, Offcanvas } from 'bootstrap';
36
+ Dialogs.init({ Modal, Offcanvas });
37
+ ```
38
+
39
+ **Toasts.** The container is a named region (`role="region"`, `aria-label`), so a screen reader finds the messages. `toast-status` is a toast with the message of a state (a flash message: saved, deleted, failed) in the look of the modals: a thin colored line at the top, an icon in the color, a title and a quiet text. A `theme-*` class colors the line and the icon. The toasts stand in a `toast-container` of Bootstrap in a corner of the window and are shown by `bootstrap.Toast`, which also hides them after a while.
40
+
41
+ ```html
42
+ <div class="toast-container position-fixed bottom-0 end-0 p-3" role="region" aria-label="Notifications">
43
+ <div class="toast toast-status theme-success" role="status" aria-live="polite" aria-atomic="true">
44
+ <i class="bi bi-check-circle toast-status-icon" aria-hidden="true"></i>
45
+ <div class="toast-status-body">
46
+ <strong class="toast-status-title">Saved</strong>
47
+ <p>The changes of the article were saved.</p>
48
+ </div>
49
+ <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
50
+ </div>
51
+ </div>
52
+ ```
53
+
54
+ ```javascript
55
+ document.querySelectorAll('.toast-status').forEach((toast) => bootstrap.Toast.getOrCreateInstance(toast).show());
56
+ ```
57
+
58
+ **Search.** `modal-search` is a search of the whole administration as a dialog, opened by a `navbar-icon` button with a magnifier: one large field without a frame at the top (`modal-search-form`, `modal-search-input`) and the results under it (`modal-search-results`) as `list-row` links in groups with a `modal-search-title`; `modal-search-empty` is the text when nothing is found. The results are drawn by the server (or by an own script), compostrap only styles them.
59
+
60
+ ```html
61
+ <button type="button" class="navbar-icon" data-bs-toggle="modal" data-bs-target="#search" aria-label="Search"><i class="bi bi-search" aria-hidden="true"></i><span class="navbar-icon-text d-none d-lg-inline">Search</span></button>
62
+
63
+ <div class="modal fade" id="search" tabindex="-1" aria-label="Search" aria-hidden="true" data-bs-backdrop="true">
64
+ <div class="modal-dialog modal-search">
65
+ <div class="modal-content">
66
+ <form class="modal-search-form" role="search">
67
+ <i class="bi bi-search" aria-hidden="true"></i>
68
+ <input type="search" class="modal-search-input" name="q" placeholder="Search…" aria-label="Search" autocomplete="off">
69
+ <kbd>Esc</kbd>
70
+ </form>
71
+ <div class="modal-search-results">
72
+ <p class="modal-search-title">Articles</p>
73
+ <a class="list-row" href="...">
74
+ <span class="stat-icon theme-primary"><i class="bi bi-journal-text" aria-hidden="true"></i></span>
75
+ <span class="list-row-text">How to write a good article<small>Tips · Draft</small></span>
76
+ </a>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ ```
@@ -0,0 +1,23 @@
1
+ # Dropzone
2
+
3
+ [← Compostrap](../readme.md#documentation)
4
+
5
+ A large area to drop files on or to click. It is a plain file input covering the area, so it stays the input of the form: validation and AJAX forms work as with a normal upload. It has no border; while files are dragged over it, it turns to the primary color.
6
+
7
+ ```html
8
+ <label class="dropzone">
9
+ <input type="file" name="images[]" class="dropzone-input" multiple accept="image/*" data-dropzone-submit>
10
+ <i class="bi bi-cloud-arrow-up dropzone-icon" aria-hidden="true"></i>
11
+ <span class="dropzone-title">Drop images here or <span class="dropzone-link">choose them</span></span>
12
+ <span class="dropzone-hint">JPEG, PNG, GIF or WebP, at most 8 MB each.</span>
13
+ <span class="dropzone-files" data-dropzone-files></span>
14
+ </label>
15
+ ```
16
+
17
+ ```javascript
18
+ import { DropzoneInput } from 'compostrap/dropzone';
19
+
20
+ DropzoneInput.init(); // again after new content is loaded, a dropzone is bound only once
21
+ ```
22
+
23
+ The script highlights the area while files are dragged over it and writes the names of the chosen files into `[data-dropzone-files]`. With `data-dropzone-submit` on the input it submits the form as soon as files are chosen or dropped, so the form needs no upload button. An input with `is-invalid` tints the area red.
@@ -0,0 +1,38 @@
1
+ # Elements
2
+
3
+ [← Compostrap](../readme.md#documentation)
4
+
5
+ The module `elements` holds small pieces of a page: a `status-dot` of a state (`theme-*` colors it, `status-dot-pulse` makes it pulse), stat tiles, list rows, the loading state of a box and the cross that clears an active filter of a datagrid (`datagrid-filter-clear` on a `btn btn-secondary btn-sm` in an `input-group input-group-sm` with the field: a darker gray button with a white cross in both themes).
6
+
7
+ ## Stat tiles
8
+
9
+ A number of an overview with its label and an icon in a `theme-*` color; an `<a>` tile is a link to its page:
10
+
11
+ ```html
12
+ <a href="..." class="stat-tile theme-primary">
13
+ <span class="stat-icon"><i class="bi bi-box-seam"></i></span>
14
+ <span><span class="stat-value">128</span><span class="stat-label">Products</span></span>
15
+ </a>
16
+ ```
17
+
18
+ ## List rows
19
+
20
+ A row of a list in a box, e.g. what waits or the latest items: an optional icon, the text with a small second line, something on the right; no lines between the rows, a quiet tint on hover when the row is a link.
21
+
22
+ ```html
23
+ <a class="list-row" href="...">
24
+ <span class="stat-icon theme-warning"><i class="bi bi-chat-left-text"></i></span>
25
+ <span class="list-row-text">Comments to approve<small>Blog</small></span>
26
+ <span class="badge badge-subtle theme-warning">3</span>
27
+ </a>
28
+ ```
29
+
30
+ ## Loading
31
+
32
+ A box that loads (`content-box`, `card` or any element with `data-loading-area`) gets `aria-busy="true"` while the request runs: its content fades, cannot be clicked, and a small ring turns over it. Remove the attribute when the request ends.
33
+
34
+ ```js
35
+ box.setAttribute('aria-busy', 'true');
36
+ // … the request …
37
+ box.removeAttribute('aria-busy');
38
+ ```
package/docs/empty.md ADDED
@@ -0,0 +1,25 @@
1
+ # Empty states and error pages
2
+
3
+ [← Compostrap](../readme.md#documentation)
4
+
5
+ The module `empty` shows that a list has nothing yet, a search found nothing, a page waits for a choice, or a whole page is an error. Every part is optional: an illustration (`empty-img`) or a small icon (`empty-icon`), the code of an error (`empty-header`), a title, a sentence and buttons. `empty-page` puts it in the middle of a page of its own.
6
+
7
+ ```html
8
+ <div class="empty">
9
+ <div class="empty-img"><!-- an illustration inlined --></div>
10
+ <p class="empty-title">No articles yet</p>
11
+ <p class="empty-subtitle">Write the first article of the blog, it will appear in this list.</p>
12
+ <div class="empty-action"><a class="btn btn-primary" href="...">Add article</a></div>
13
+ </div>
14
+
15
+ <main class="empty-page">
16
+ <div class="empty">
17
+ <div class="empty-img"><!-- not-found.svg --></div>
18
+ <p class="empty-header">404</p>
19
+ <p class="empty-title">Page not found</p>
20
+ <p class="empty-subtitle">The page you are looking for does not exist or has been moved.</p>
21
+ </div>
22
+ </main>
23
+ ```
24
+
25
+ The illustrations are in `compostrap/illustrations/`: `not-found.svg`, `forbidden.svg`, `server-error.svg`, `maintenance.svg` and `empty.svg`. Inlined into the page they take the colors of the theme from the `--cs-illustration-*` tokens (also in the dark theme); as an `<img>` they use their own light colors.
@@ -0,0 +1,23 @@
1
+ # Gallery
2
+
3
+ [← Compostrap](../readme.md#documentation)
4
+
5
+ Square tiles of images in a grid of Bootstrap. The buttons appear over the dimmed image on hover or keyboard focus; on touch screens they stay shown in a column at the right edge. The name sits at the bottom of the image on a dark fade, with the extension as a small label, and gives way to the buttons on hover.
6
+
7
+ ```html
8
+ <div class="row row-cols-2 row-cols-lg-4 g-3">
9
+ <div class="col">
10
+ <figure class="gallery-item">
11
+ <img src="photo.jpg" alt="" loading="lazy">
12
+ <span class="gallery-badge"><span class="badge theme-primary">Main photo</span></span>
13
+ <figcaption class="gallery-caption" title="photo.jpg"><span class="gallery-name">photo</span><span class="gallery-ext">jpg</span></figcaption>
14
+ <div class="gallery-actions">
15
+ <a href="..." class="btn btn-light btn-sm btn-icon" aria-label="Preview" data-tooltip><i class="bi bi-zoom-in"></i></a>
16
+ <a href="..." class="btn btn-danger btn-sm btn-icon" aria-label="Delete" data-tooltip><i class="bi bi-trash"></i></a>
17
+ </div>
18
+ </figure>
19
+ </div>
20
+ </div>
21
+ ```
22
+
23
+ `gallery-thumb` is a small square image for a table row, e.g. the photo of a product in a datagrid. `gallery-actions show` keeps the buttons shown, e.g. for the confirmation of a delete with a `gallery-text` question.
package/docs/layout.md ADDED
@@ -0,0 +1,143 @@
1
+ # Layout
2
+
3
+ [← Compostrap](../readme.md#documentation)
4
+
5
+ ## Page
6
+
7
+ The sidebar runs over the whole height with the brand on top, the navbar sits over the content only, in the color of the page and stuck to the top:
8
+
9
+ ```html
10
+ <div class="d-flex wrapper">
11
+ <nav class="sidebar" id="navigation">
12
+ <div class="sidebar-menu"><div class="sidebar-menu-fixed">
13
+ <a class="sidebar-brand" href="/"><svg>…</svg><span>Compostrap</span></a>
14
+ <div class="scrollbar scrollbar-use-navbar">…menu…</div>
15
+ </div></div>
16
+ </nav>
17
+ <div class="layout-content">
18
+ <header class="navbar navbar-expand-md navbar-content navbar-bar sticky-top">…breadcrumb, icons, user…</header>
19
+ <div class="container-fluid"><main>…</main></div>
20
+ </div>
21
+ </div>
22
+ ```
23
+
24
+
25
+ The layout comes in three combinations of the navbar and the brand of the sidebar, each with the navbar stuck to the top (`sticky-top`) or scrolling away with the page:
26
+
27
+ | Combination | Navbar | Brand |
28
+ |-------------|--------|-------|
29
+ | On the page: the navbar and the brand on the background of the page, the white menu below the brand as a panel with a rounded corner, in line with the first box | `navbar-content` | `sidebar-brand sidebar-brand-page` |
30
+ | The navbar on the page, a white sidebar | `navbar-content` | `sidebar-brand` |
31
+ | A white navbar and a white sidebar; a soft shadow under the navbar when the content scrolls under it | `navbar-content navbar-bar` | `sidebar-brand` |
32
+
33
+ The white navbar can take a color, together with the brand of the sidebar, so one colored strip runs over the top: `navbar-colored` and `sidebar-brand-colored` with a `theme-*` class (`theme-primary`, `theme-success`, `theme-danger`, `theme-info`, or `theme-gray`, a gray between the light secondary and dark). Its text and icons turn light, a status dot gets a light ring, and the nanobar takes the color of the navbar, lightened; the dropdowns in it keep the colors of the page.
34
+
35
+ ```html
36
+ <a class="sidebar-brand sidebar-brand-colored theme-primary" href="/">…</a>
37
+ <header class="navbar navbar-expand-md navbar-content navbar-bar navbar-colored theme-primary sticky-top">…</header>
38
+ ```
39
+
40
+ The demo has a *Customize* panel to try them.
41
+
42
+ Below `md`, where the sidebar is hidden, `navbar-brand-mobile` shows the brand in the navbar (as its first item; only the logo on phones under 360px); the open sidebar covers it with its own brand at the same place.
43
+
44
+ The layout with a navbar over the whole width (`wrapper-navbar-used wrapper-navbar-fixed`, `navbar fixed-top`) works too.
45
+
46
+ ## Sidebar
47
+
48
+ The sidebar is the element `#navigation`, its toggle button is `#sidebar`. On small screens it opens as an overlay over the page and takes the focus; closed, it stands outside the window and is `inert`, so the keyboard and a screen reader skip its links. The backdrop, a click on it, Escape and the focus that leaves it (Tab after its last link) close it, and the toggle reports its state in `aria-expanded`. From the `md` breakpoint up it stays in the layout.
49
+
50
+ | Description | Class |
51
+ |----------------------------------------------------|-----------------------------|
52
+ | Layout without a navbar | `wrapper` |
53
+ | Layout with a navbar | `wrapper-navbar-used` |
54
+ | Layout with a fixed navbar | `wrapper-navbar-fixed` |
55
+ | Rounded top right corner of the sidebar | `sidebar-rounded-top-right` |
56
+ | Fixed menu in the sidebar | `sidebar-menu-fixed` |
57
+ | Toggle visible on small screens (used by `Sidebar`) | `sidebar-toggle` |
58
+ | Toggle visible on all screens | `sidebar-toggle-visible` |
59
+
60
+ ## Sidebar menu
61
+
62
+ `SidebarMenuApp.init()` can be called again after menu items are added. It sets `aria-expanded` and `aria-controls` on submenu links, `aria-current="page"` on the current link, and opens a submenu at once; only its arrow rotates. Set `SidebarMenu.slideDuration = 200` (ms) before `init()` to slide submenus open instead; the slide is skipped when reduced motion is requested.
63
+
64
+ | Description | Class |
65
+ |-------------------------|----------------|
66
+ | Current item | `link-current` |
67
+ | Link with a submenu (without `href`, it becomes a button) | `link-arrow` |
68
+ | Hidden submenu | `list-hidden` |
69
+ | Shaking icon on hover | `bell` |
70
+
71
+ The colors of the menu come from the body color of Bootstrap (titles at 60 %, icons at 60 %, arrows at 85 %), so both themes work without settings; they can be changed by the `--sm-*` CSS variables, the sizes by the Sass variables in `src/scss/_variables.scss`. The pills of the links have `--sm-pill-border-radius`, `--sm-pill-icon-color`, `--sm-pill-link-bg` (the current page) and `--sm-pill-hover-bg` (a hovered link, a bit weaker).
72
+
73
+ ### Compact sidebar
74
+
75
+ From the `md` breakpoint up the sidebar can be narrowed to the icons of the first level (`$sm-compact-width`, 72px); a phone keeps its sliding menu. A button with `data-sidebar-compact` switches the class `sidebar-compact` of `<html>`, keeps its `aria-pressed` in line and remembers the choice in `localStorage` (`sidebar-compact`); it is handled by `Sidebar.init()`. In the compact sidebar:
76
+
77
+ - the brand shows only its logo, a section title becomes a short line, badges and submenus are hidden (a group holding the current page gets its pill);
78
+ - the name of a hovered or focused link is shown next to it in the colors of the tooltip;
79
+ - a link with a submenu opens its links in a menu of the theme next to the icon (the group name over them, the current page marked); it is closed by another click on the icon, a click outside, Esc or a scroll, and works by the keyboard like a dropdown (Enter or Space moves the focus into it, the arrows between the links, Tab leaves it to the next icon).
80
+
81
+ ```html
82
+ <html class="…">
83
+ <head>
84
+ <!-- the remembered compact sidebar before the page is drawn, so the menu does not jump -->
85
+ <script>try { if (localStorage.getItem('sidebar-compact') === '1') document.documentElement.classList.add('sidebar-compact'); } catch (e) { }</script>
86
+ </head>
87
+ …
88
+ <button type="button" class="navbar-icon" data-sidebar-compact aria-pressed="false" aria-label="Compact menu" data-tooltip="bottom">
89
+ <i class="bi bi-layout-sidebar" aria-hidden="true"></i>
90
+ </button>
91
+ ```
92
+
93
+ `Sidebar.setCompact(true|false)` sets it from a script, `Sidebar.isCompact()` tells whether the compact sidebar is shown.
94
+
95
+ ## Navbar
96
+
97
+ Icon buttons on the right of the navbar (module `dashboard`): `navbar-icon` is a quiet square for an icon, an icon with a short text (`navbar-icon-text`, e.g. the code of the language) widens it; tinted on hover and while its dropdown is open. A `status-dot` (module `elements`) marks that something waits; `status-dot-pulse` makes it pulse.
98
+
99
+ ```html
100
+ <button type="button" class="navbar-icon" aria-label="Toggle theme" data-tooltip="bottom" data-theme-switcher
101
+ data-theme-light-icon="bi bi-sun" data-theme-dark-icon="bi bi-moon"><i data-theme-switcher-icon class="bi bi-moon"></i></button>
102
+
103
+ <div class="dropdown">
104
+ <button type="button" class="navbar-icon" data-bs-toggle="dropdown" aria-label="Notifications">
105
+ <i class="bi bi-bell"></i><span class="status-dot status-dot-pulse theme-danger"></span>
106
+ <span class="navbar-icon-text d-none d-lg-inline">Notifications</span>
107
+ </button>
108
+ <ul class="dropdown-menu dropdown-menu-end">…</ul>
109
+ </div>
110
+
111
+ <div class="dropdown">
112
+ <button type="button" class="navbar-icon" data-bs-toggle="dropdown"><i class="bi bi-translate" aria-hidden="true"></i><span class="visually-hidden">Language: </span><span class="navbar-icon-text">EN</span></button>
113
+ <ul class="dropdown-menu dropdown-menu-end">
114
+ <li><a class="dropdown-item" href="...">Čeština</a></li>
115
+ <li><a class="dropdown-item active" href="..." aria-current="true">English</a></li>
116
+ </ul>
117
+ </div>
118
+ ```
119
+
120
+ The user sits in the navbar as `navbar-user`: an `avatar` (initials or a photo in a circle, in a `theme-*` color; `avatar-sm`, `avatar-lg`) with the name and the role, the account in its dropdown.
121
+
122
+ ## Content boxes and the older navbar
123
+
124
+ The navbar `navbar fixed-top` gets the page background, `navbar-nav-breadcrumb` separates its items by an arrow, and `content-box` is a box of the page content on the surface color.
125
+
126
+ ## Datagrid tables
127
+
128
+ A table of a datagrid stands in a `table-responsive`, so it scrolls inside its box on a narrow screen. The wrapper is `<div class="table-responsive" tabindex="0" role="region" aria-label="Articles">` (the name of the table): with `tabindex` the keyboard can scroll it in every browser, the role and the name tell a screen reader what the focused box is. The actions of a row are a menu: three vertical dots open a dropdown with the items, delete last after a divider. The button needs `data-bs-popper-config='{"strategy":"fixed"}'`, or the scrolling wrapper cuts the menu off.
129
+
130
+ ```html
131
+ <td class="text-end">
132
+ <div class="dropdown">
133
+ <button type="button" class="btn btn-xs btn-icon btn-text" data-bs-toggle="dropdown" data-bs-popper-config='{"strategy":"fixed"}' aria-expanded="false" aria-label="Actions"><i class="bi bi-three-dots-vertical" aria-hidden="true"></i></button>
134
+ <ul class="dropdown-menu dropdown-menu-end">
135
+ <li><a class="dropdown-item" href="..."><i class="bi bi-pencil me-2" aria-hidden="true"></i>Edit</a></li>
136
+ <li><hr class="dropdown-divider"></li>
137
+ <li><a class="dropdown-item text-danger" href="..."><i class="bi bi-trash me-2" aria-hidden="true"></i>Delete</a></li>
138
+ </ul>
139
+ </div>
140
+ </td>
141
+ ```
142
+
143
+ A datagrid can also open an item by a click on its row (`datagrid-row-clickable` on the `tr` and `row-click.js` of drago-ex/datagrid; compostrap has no script for it). Use it only with icon buttons as the row actions (`btn btn-xs btn-icon` with a `data-tooltip`), never with the menu of three dots: a click that misses the small button of the menu lands on the row and opens the item instead of the menu.
@@ -0,0 +1,18 @@
1
+ # Lightbox
2
+
3
+ [← Compostrap](../readme.md#documentation)
4
+
5
+ A link with `data-lightbox` opens its image in a full-screen preview on a dark backdrop. Links with the same value form a group: the arrows, the keys ← → and a swipe browse it, a counter shows the position. `data-caption` is the text under the image. It is built on the native `<dialog>`: Esc or a click beside the image closes it and the focus returns to the link. An image linked twice in a group (a big photo over its thumbnails, as on the product detail of the shop) is shown once, at the place of its last link.
6
+
7
+ ```html
8
+ <a href="photo-large.jpg" data-lightbox="gallery" data-caption="photo.jpg">
9
+ <img src="photo-small.jpg" alt="">
10
+ </a>
11
+ ```
12
+
13
+ ```javascript
14
+ import { Lightbox } from 'compostrap/lightbox';
15
+
16
+ Lightbox.init(); // once; links loaded later by AJAX work without a new init
17
+ Lightbox.init({ dialog: 'Náhled obrázku', close: 'Zavřít', previous: 'Předchozí', next: 'Další' }); // translated labels
18
+ ```