bh 6.1.4 → 6.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -0
  3. data/README.md +103 -15
  4. data/app/javascript/bh/bookmark_controller.js +97 -0
  5. data/app/javascript/bh/clear_controller.js +22 -0
  6. data/app/javascript/bh/combobox/menu.js +93 -0
  7. data/app/javascript/bh/combobox_controller.js +82 -0
  8. data/app/javascript/bh/confirm.js +100 -0
  9. data/app/javascript/bh/density_controller.js +21 -0
  10. data/app/javascript/bh/deselect_controller.js +37 -0
  11. data/app/javascript/bh/flash.js +35 -0
  12. data/app/javascript/bh/limit_controller.js +23 -0
  13. data/app/javascript/bh/map/loader.js +20 -0
  14. data/app/javascript/bh/map_controller.js +88 -0
  15. data/app/javascript/bh/otp/slots.js +27 -0
  16. data/app/javascript/bh/otp_controller.js +98 -0
  17. data/app/javascript/bh/phone_controller.js +89 -0
  18. data/app/javascript/bh/placeholder_controller.js +28 -0
  19. data/app/javascript/bh/relative_time_controller.js +45 -0
  20. data/app/javascript/bh/require_controller.js +18 -0
  21. data/app/javascript/bh/reveal_controller.js +16 -0
  22. data/app/javascript/bh/scheme_controller.js +99 -0
  23. data/app/javascript/bh/search_controller.js +78 -0
  24. data/app/javascript/bh/shortcuts_controller.js +42 -0
  25. data/app/javascript/bh/sortable_controller.js +84 -0
  26. data/app/javascript/bh/thread_controller.js +47 -0
  27. data/app/javascript/bh/timezone_controller.js +27 -0
  28. data/app/javascript/bh/toast_controller.js +35 -0
  29. data/app/javascript/bh/tooltip_controller.js +23 -0
  30. data/app/javascript/bh/written.js +20 -0
  31. data/app/javascript/bh/written_controller.js +28 -0
  32. data/app/javascript/bh.js +60 -0
  33. data/app/stylesheets/bh/base.css +27 -0
  34. data/app/stylesheets/bh/chat.css +77 -0
  35. data/app/stylesheets/bh/flow.css +94 -0
  36. data/app/stylesheets/bh/map.css +3 -0
  37. data/app/stylesheets/bh/pin.css +34 -0
  38. data/app/stylesheets/bh/search.css +60 -0
  39. data/app/stylesheets/bh/shell.css +202 -0
  40. data/app/stylesheets/bh/table.css +130 -0
  41. data/app/stylesheets/bh/values.css +41 -0
  42. data/app/stylesheets/bh.css +13 -0
  43. data/app/stylesheets/theme/bootstrap.css +10 -0
  44. data/app/stylesheets/theme/dawn.css +189 -0
  45. data/app/stylesheets/theme/dracula.css +189 -0
  46. data/app/stylesheets/theme/gruvbox.css +189 -0
  47. data/app/stylesheets/theme/monokai.css +190 -0
  48. data/app/stylesheets/theme/nord.css +189 -0
  49. data/app/stylesheets/theme/one_dark.css +189 -0
  50. data/app/stylesheets/theme/solarized.css +188 -0
  51. data/app/stylesheets/theme/tokyo_night.css +189 -0
  52. data/build.mjs +21 -0
  53. data/config/locales/bh.en.yml +13 -0
  54. data/lib/bh/engine.rb +21 -6
  55. data/lib/bh/form_builder/comboboxes.rb +38 -0
  56. data/lib/bh/form_builder/controls.rb +67 -0
  57. data/lib/bh/form_builder/pins.rb +30 -0
  58. data/lib/bh/form_builder.rb +96 -0
  59. data/lib/bh/helpers/chats/asides.rb +49 -0
  60. data/lib/bh/helpers/chats/asks.rb +41 -0
  61. data/lib/bh/helpers/chats.rb +42 -0
  62. data/lib/bh/helpers/dialogs.rb +47 -0
  63. data/lib/bh/helpers/flows.rb +49 -0
  64. data/lib/bh/helpers/heads.rb +27 -0
  65. data/lib/bh/helpers/notices.rb +55 -0
  66. data/lib/bh/helpers.rb +12 -0
  67. data/lib/bh/message.rb +11 -0
  68. data/lib/bh/version.rb +2 -3
  69. data/lib/bh.rb +8 -6
  70. data/package.json +20 -0
  71. data/public/bh/css/bh.css +1 -0
  72. data/public/bh/js/bh.js +152 -0
  73. data/public/bh/theme/bootstrap.css +10 -0
  74. data/public/bh/theme/dawn.css +189 -0
  75. data/public/bh/theme/dracula.css +189 -0
  76. data/public/bh/theme/gruvbox.css +189 -0
  77. data/public/bh/theme/monokai.css +190 -0
  78. data/public/bh/theme/nord.css +189 -0
  79. data/public/bh/theme/one_dark.css +189 -0
  80. data/public/bh/theme/solarized.css +188 -0
  81. data/public/bh/theme/tokyo_night.css +189 -0
  82. data/vendor/bootstrap.bundle.min.js +9 -0
  83. data/vendor/bootstrap.min.css +2 -0
  84. metadata +119 -23
  85. data/.gitignore +0 -23
  86. data/.rspec +0 -3
  87. data/.travis.yml +0 -15
  88. data/.yardopts +0 -3
  89. data/Gemfile +0 -4
  90. data/app/assets/stylesheets/bh.css +0 -29
  91. data/app/javascript/controllers/bh/theme_controller.js +0 -16
  92. data/app/javascript/controllers/phone_controller.js +0 -33
  93. data/app/javascript/controllers/require_controller.js +0 -20
  94. data/app/javascript/controllers/submit_controller.js +0 -24
  95. data/app/views/bh/_grid.html.erb +0 -6
  96. data/app/views/bh/_table.html.erb +0 -44
  97. data/bh.gemspec +0 -19
  98. data/lib/bh/bootstrap_helpers.rb +0 -137
@@ -0,0 +1,34 @@
1
+ /* The field a 6-digit code is typed into: one real field, drawn by Bootstrap as six slots.
2
+ `pin_field` draws the markup and the `otp` controller draws the slots. */
3
+
4
+ /* Bootstrap's OTP container is a flex row, so it has to be told to center where its card is
5
+ centered and to let the message drop onto a line of its own under the slots. `min-width: 0`,
6
+ or the grid item will not shrink below the width its slots come to, which is the whole
7
+ row hanging off the side of the card before the slots are asked to fit. */
8
+ .otp { justify-content: center; flex-wrap: wrap; min-width: 0 }
9
+ /* Six slots at a fixed width plus the five gaps between them come to 328 pixels, and a
10
+ phone's card holds 327 — so the last slot sat outside it. Sized off the row instead, they
11
+ share whatever there is and never exceed the width they were drawn at. */
12
+ .otp-slots { display: flex; justify-content: center; width: 100% }
13
+ .otp-slot { flex: 1 1 0; min-width: 0; max-width: var(--bs-otp-size) }
14
+ .otp .invalid-feedback { order: 1; flex-basis: 100%; margin-top: 0.5rem }
15
+
16
+ /* .form-control.is-invalid would outrank .otp-input on specificity and draw one red box
17
+ across all six slots; the field takes no such class, and Bootstrap reddens the slots
18
+ themselves from the container. */
19
+ .otp .otp-input.is-invalid { border: 0; box-shadow: none }
20
+
21
+ /* Bootstrap builds the six slots in JavaScript, so one box is what the server can send and
22
+ what the reader sees until they land. Held back for that moment — but on a class the
23
+ controller itself sets, so a controller that never runs leaves a field somebody can still
24
+ type a code into rather than an invisible one. */
25
+ .otp-drawing:not(.otp-rendered) .otp-input { visibility: hidden }
26
+
27
+ /* Bootstrap lays the real field transparently over the slots, so an autofilled one painted
28
+ yellow paints over them. The text stays invisible, and the fill is deferred by longer than
29
+ anybody's session rather than overridden, which is the only thing that holds it off. */
30
+ .otp-input:-webkit-autofill,
31
+ .otp-input:-webkit-autofill:focus {
32
+ -webkit-text-fill-color: transparent;
33
+ transition: background-color 0s 600000s;
34
+ }
@@ -0,0 +1,60 @@
1
+ /* The search and its filters take the width the breadcrumb and the buttons
2
+ leave, and give it back as the viewport narrows: the box shrinks to a floor
3
+ that still shows a word, and below 768px the row is allowed to wrap. */
4
+ .recourse-search { flex: 1 1 auto; max-width: 48rem; }
5
+ /* The box grows and the filters do not, so the field someone types into is the
6
+ widest thing in the row on a large viewport. A toggle is `width: 100%`, which
7
+ as a flex item would otherwise mean the whole form. */
8
+ .recourse-search-box { flex: 2 1 16rem; min-width: 8rem; }
9
+
10
+ .recourse-search .combobox-toggle { flex: 0 1 10rem; }
11
+ /* The per-page switch is a word in the sentence beside it rather than a control
12
+ next to one, so it takes the line's height and not `.btn`'s own minimum —
13
+ which would leave the row under every table taller than the words in it. */
14
+ .recourse-limit { min-height: 0; }
15
+ /* The bookmark square is an icon in a row of text, not a control in a form, so it
16
+ takes the line's height too: `.btn`'s minimum made every row with one taller
17
+ than the rows without. */
18
+ .recourse-bookmark { min-height: 0; }
19
+ /* Stacked, each control is a row of its own rather than a fragment of one:
20
+ there is no second control beside it to share the line with. */
21
+ @media (width < 768px) {
22
+ /* The room the breadcrumb leaves, and never more: a form sized by its content
23
+ widened with the words a picked option put on a toggle, and wrapped under
24
+ the crumbs. A basis of nothing and leave to shrink hold it in its row. */
25
+ .recourse-search { flex: 1 1 0; min-width: 0; max-width: none; }
26
+ .recourse-search-box,
27
+ .recourse-search .combobox-toggle { flex: 1 1 100%; min-width: 0; }
28
+ /* Safari zooms in on a field whose text is under 16px, an absolute figure: the
29
+ small controls are 14px, and so is the body on a phone, so the controls say
30
+ 16px themselves and focusing one moves nothing. */
31
+ .recourse-search .form-control { font-size: 16px; }
32
+ /* A page under a record has a trail two or three crumbs long, and what sat beside
33
+ the trail — the search, its filters, a button — was squeezed into what those
34
+ left: `Filter by na`. Under such a trail each takes a row of its own, the form
35
+ the whole width and every control in it a row in turn, and the margin that set
36
+ a button apart from the trail goes, there being no trail beside it. An index at
37
+ the top keeps its form beside its one crumb, where it fits. */
38
+ .recourse-trailed > :not(nav) { flex: 0 0 100%; margin-inline-start: 0; }
39
+ }
40
+
41
+ /* The button that empties a combobox search sits inside the field it clears. */
42
+ .combobox-search { position: relative; }
43
+ .combobox-search-input { padding-inline-end: 2rem; }
44
+ /* `:not(.d-none)`, because v6's display utilities carry no `!important` and
45
+ this rule is later in the cascade: a plain `display` here would beat the
46
+ `.d-none` the button is hidden with, and show an X over an empty field. */
47
+ .combobox-search-clear:not(.d-none) { display: flex; }
48
+ .combobox-search-clear {
49
+ position: absolute;
50
+ inset-block-start: 50%;
51
+ inset-inline-end: calc(var(--bs-menu-padding-x) + .35rem);
52
+ transform: translateY(-50%);
53
+ padding: .15rem;
54
+ border: 0;
55
+ border-radius: var(--bs-radius-5);
56
+ background: transparent;
57
+ color: var(--bs-fg-2);
58
+ line-height: 1;
59
+ }
60
+ .combobox-search-clear:hover { background-color: var(--bs-bg-1); color: var(--bs-fg-body); }
@@ -0,0 +1,202 @@
1
+ /* A crumb that is not a link keeps its resting colors under the cursor.
2
+ Bootstrap lights every .breadcrumb-link on hover, which on a <span>
3
+ promises a click that goes nowhere — and the element is the whole
4
+ discriminator, since a crumb that links is an <a>. Redefining the hover
5
+ tokens, rather than out-cascading the hover rule, leaves Bootstrap's own
6
+ selector in charge and the active crumb its own resting color. */
7
+ span.breadcrumb-link {
8
+ --bs-breadcrumb-link-hover-color: var(--bs-breadcrumb-link-color);
9
+ --bs-breadcrumb-link-hover-bg: transparent;
10
+ }
11
+ span.breadcrumb-link.active {
12
+ --bs-breadcrumb-link-hover-color: var(--bs-breadcrumb-link-active-color);
13
+ }
14
+
15
+ /* Nothing here is meant to be wider than the window: the one thing that is, a
16
+ table, scrolls inside its own wrapper. Safari lays a stacked table's hidden
17
+ header row out at its full width all the same, and a page that can be
18
+ scrolled to it is a page Safari zooms out of and draws the navbar short on.
19
+ `clip` on the shell rather than `hidden`: a `hidden` axis turns the other into
20
+ `auto`, and the body then cut off whatever hung below it — a filter's menu, on a
21
+ page whose table had no rows to be taller than the menu. `clip` leaves the
22
+ other axis alone. */
23
+ html { overflow-x: hidden; }
24
+ .recourse-shell { overflow-x: clip; }
25
+
26
+ /* A finger does not hover. The tint a pointer leaves on the row under it, or on
27
+ the link under it, would stay on whatever was last touched — or land on whatever
28
+ the redrawn page put under the finger — so a touch screen gets none. */
29
+ @media (hover: none) {
30
+ .table-hover > tbody > tr:hover > * {
31
+ --bs-table-color-state: initial;
32
+ --bs-table-bg-state: initial;
33
+ }
34
+ .nav-link:hover:not(.active) { background-color: transparent; }
35
+ }
36
+
37
+ /* The navbar stacks over the content: a menu opened from a filter drops over the
38
+ first rows of the table rather than under them. */
39
+ .recourse-shell > nav { position: relative; z-index: 1; }
40
+
41
+ /* A focus ring is drawn outside the link it rings, so the link after it paints its own
42
+ background over the half that overlaps — which is how a ring ends up behind the tint
43
+ of the row below it. Lifting the focused link above its siblings keeps the ring whole. */
44
+ .nav-link:focus-visible { position: relative; z-index: 1; }
45
+
46
+ /* The shell is three things — the sidebar, the navbar, the content — written in
47
+ the order a phone reads them: a row of icons at the very top, the trail and the
48
+ search under it, the page under that, scrolling as one. From the width the
49
+ sidebar becomes a column at, a grid seats them the other way round. The navbar
50
+ runs across the top, the sidebar takes the column under it and the content the
51
+ rest, the shell is exactly the viewport, and `main` is the only thing in it that
52
+ scrolls — so the navbar and the sidebar stay where they are however far down the
53
+ table a reader is. `minmax(0, 1fr)` is what lets the second row be shorter than
54
+ what is in it; a `1fr` alone is as tall as its content, and the page would scroll
55
+ after all.
56
+ The sidebar deliberately does not scroll. A window dragged shorter than the
57
+ sidebar itself is the one case the viewport cannot hold, and there the sidebar
58
+ is allowed to spill past the shell and let the browser scroll the page — which is
59
+ what a reader expects of something taller than the screen. Were it to scroll on
60
+ its own instead, the same overflow would be hidden inside it and the page would
61
+ look whole while its foot was unreachable. */
62
+ @media (width >= 768px) {
63
+ .recourse-shell {
64
+ display: grid;
65
+ grid-template-columns: auto minmax(0, 1fr);
66
+ grid-template-rows: auto minmax(0, 1fr);
67
+ grid-template-areas: 'nav nav' 'aside main';
68
+ height: 100dvh;
69
+ }
70
+ .recourse-shell > nav { grid-area: nav; }
71
+ .recourse-sidebar { grid-area: aside; }
72
+ .recourse-shell > main { grid-area: main; overflow-y: auto; }
73
+ }
74
+
75
+ /* The sidebar rules off the navbar below it while it is the band at the top of a
76
+ phone, and off the content beside it once it is a column. v6 generates no
77
+ responsive border utilities, so the switch is written out. */
78
+ .recourse-sidebar {
79
+ border-block-end: var(--bs-border-width) solid var(--bs-border-color);
80
+ }
81
+ @media (width >= 768px) {
82
+ .recourse-sidebar {
83
+ border-block-end: 0;
84
+ border-inline-end: var(--bs-border-width) solid var(--bs-border-color);
85
+ }
86
+ }
87
+
88
+ /* Held Option marks the letter each sidebar link answers to. Marked rather than
89
+ bracketed: '[C]ontacts' would shift the whole sidebar two characters wide the
90
+ moment the key went down. Swap the two rules below for the bracketed form. */
91
+ .recourse-keys .recourse-key {
92
+ font-weight: var(--bs-font-weight-semibold);
93
+ text-decoration: underline;
94
+ text-underline-offset: 2px;
95
+ }
96
+ /* .recourse-keys .recourse-key::before { content: '['; }
97
+ .recourse-keys .recourse-key::after { content: ']'; } */
98
+
99
+ /* The foot of the sidebar holds the scheme toggle and the way out side by side,
100
+ each centered in its own half of the row: the toggle alone is in the middle, and
101
+ the two together are at a quarter and at three quarters. Each control sits in
102
+ a wrapper — the toggle's own, the form `button_to` draws — and the wrapper is
103
+ the half, so a button is only as wide as its icon and so is its hover. */
104
+ .recourse-foot { display: flex; }
105
+ .recourse-foot > * { flex: 1 1 0; display: flex; justify-content: center; }
106
+ .recourse-foot .nav-link { border-radius: var(--bs-radius-5); }
107
+ /* A hand cursor alone says little on an icon: a tint under it says it is a control.
108
+ Only where something can hover: a finger's tap leaves `:hover` set until the next
109
+ tap elsewhere, and a tint that stays reads as a button stuck down. */
110
+ @media (hover: hover) {
111
+ .recourse-foot .nav-link:hover { background-color: var(--bs-bg-1); color: var(--bs-fg-body); }
112
+ }
113
+
114
+ /* `.nav-item` ships `flex: auto`: in a row every entry would take an equal share
115
+ of the width and in a full-height column an equal share of the height, and the
116
+ foot's auto margin would never have anything left to push against. Every item is
117
+ its own size instead, in both directions. */
118
+ .recourse-sidebar .nav-item { flex: 0 0 auto; }
119
+
120
+ /* On a phone the sidebar is one row of icons across the top, centered, each entry
121
+ with less room around it than a column gives — a dozen have to fit — and wrapping
122
+ to a second line only where a host has more than a screen's width of them. */
123
+ @media (width < 768px) {
124
+ .recourse-sidebar .nav { justify-content: center; --bs-nav-link-padding-x: .5rem; }
125
+ }
126
+
127
+ /* The foot sits at the bottom of the sidebar and stretches across it while the
128
+ sidebar is a column, and is simply the last item of the row while it is not
129
+ — the query matches the `md:` the sidebar's own classes use. */
130
+ @media (width >= 768px) {
131
+ /* A floor rather than a height, and never wrapped. `.nav` ships `flex-wrap:
132
+ wrap`, and a column that may wrap, whose items are pinned to their own height
133
+ above, and which is told exactly how tall to be has one way to place a link
134
+ that does not fit: a second column. Which is what a short window used to draw.
135
+ The floor lets it be taller than the space it was given. */
136
+ .recourse-sidebar .nav { min-height: 100%; flex-wrap: nowrap; }
137
+ /* And it rides at the foot of the screen, which the auto margin alone is
138
+ enough to do: the nav's floor is the sidebar's full height, so while the
139
+ links leave room the margin takes all of it and the foot sits on the fold,
140
+ rising with it as the window is shortened. Once the links fill the nav there
141
+ is no room left to take, and the foot comes to rest immediately below the
142
+ last of them and goes under the fold with it, to be scrolled to.
143
+ Deliberately not sticky. Sticking it to the bottom of the viewport would lift
144
+ it off that resting place and hold it over the links it had passed — which is
145
+ what the background color was for, masking whichever one it covered. Both go
146
+ together: nothing is painted over, so nothing needs painting out. */
147
+ .recourse-sidebar .recourse-foot {
148
+ margin-block-start: auto;
149
+ align-self: stretch;
150
+ }
151
+ }
152
+
153
+ /* A phone reads the chrome as pictures. A sidebar entry is its icon, a crumb its
154
+ icon, a tab its icon and its figure — `17` rather than `17 franchises` — and the
155
+ foot's controls their icons, so the sidebar is one row of squares and the trail
156
+ leaves the search its room. The words are there all the same, read but not seen
157
+ the way Bootstrap's `.visually-hidden` does it, and the arrows at the foot put
158
+ them back: the cookie they write has the server draw the shell `.recourse-expanded`,
159
+ and then none of this applies. A tab or a crumb with no icon keeps its word at
160
+ every width, there being nothing else to stand for it.
161
+ The same hiding, at every width, for the foot's words once the sidebar is a
162
+ column: there is room for an icon and not for a word beside it. */
163
+ .recourse-foot-word { margin-inline-start: .4em; }
164
+ @media (width < 768px) {
165
+ .recourse-shell:not(.recourse-expanded) :is(.recourse-nav-word, .recourse-crumb-word,
166
+ .recourse-tab-word, .recourse-foot-word) {
167
+ position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
168
+ overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
169
+ }
170
+ }
171
+ @media (width >= 768px) {
172
+ .recourse-foot-word {
173
+ position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
174
+ overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
175
+ }
176
+ /* Nothing to expand: a column has its words already. */
177
+ .recourse-density { display: none; }
178
+ }
179
+
180
+ /* The arrows say where a tap goes, like the moon: parting, with `Expand`, while
181
+ the chrome is icons; meeting, with `Compact`, once the words are out. Both faces
182
+ are drawn and the shell's class picks, so the button needs no script to redraw. */
183
+ .recourse-density-expanded { display: none; }
184
+ .recourse-expanded .recourse-density-compact { display: none; }
185
+ .recourse-expanded .recourse-density-expanded { display: inline; }
186
+
187
+ /* The toggle draws both icons and shows the one that names where a click
188
+ would go: a moon on a light page, a sun on a dark one. Three states rather than
189
+ two, because a page nobody has chosen for carries no attribute at all, and the
190
+ media query is then the only thing that knows which mode it is in. Both are
191
+ declared at every step rather than one left to its default, so that no state
192
+ can end up hiding the pair and leaving a button with nothing in it. */
193
+ .recourse-scheme-light { display: inline; }
194
+ .recourse-scheme-dark { display: none; }
195
+ @media (prefers-color-scheme: dark) {
196
+ :root:not([data-bs-theme='light']) .recourse-scheme-light { display: none; }
197
+ :root:not([data-bs-theme='light']) .recourse-scheme-dark { display: inline; }
198
+ }
199
+ :root[data-bs-theme='light'] .recourse-scheme-light { display: inline; }
200
+ :root[data-bs-theme='light'] .recourse-scheme-dark { display: none; }
201
+ :root[data-bs-theme='dark'] .recourse-scheme-light { display: none; }
202
+ :root[data-bs-theme='dark'] .recourse-scheme-dark { display: inline; }
@@ -0,0 +1,130 @@
1
+ /* An action column is as wide as a row is tall — an icon in a square — and a
2
+ counter column starts at the same square, widening only when a figure like
3
+ 38,405 needs the room: a table laying out to 100% reads the width as a
4
+ preference, never crushes content into it, and hands what these cells do
5
+ not use to the columns carrying text. Not while the table is stacked, where
6
+ every cell is a block and a square one is a squashed one — the query
7
+ matches `.sm:table-stacked`'s. */
8
+ @container (width >= 576px) {
9
+ .recourse-actions, .recourse-counter {
10
+ width: calc(1em * var(--bs-body-line-height) + 2 * var(--bs-table-cell-padding-y));
11
+ white-space: nowrap;
12
+ text-align: center;
13
+ }
14
+ }
15
+
16
+ /* Stacked, a cell reads as one line — `Estimate hi: 600`, the heading semibold
17
+ and the value after it — where Bootstrap puts the heading on a line of its own
18
+ and leaves the row's first cell with no heading at all, bold in its place: a
19
+ status opening a row would be a bare badge. Every cell is headed here. And a
20
+ value with no space in it — an address, a token — breaks rather than widening
21
+ the row past the phone. */
22
+ @container (width < 576px) {
23
+ .sm\:table-stacked > tbody > tr > td[data-cell]::before {
24
+ content: attr(data-cell) ': ';
25
+ display: inline;
26
+ font-weight: var(--bs-font-weight-semibold);
27
+ }
28
+ .sm\:table-stacked > tbody > tr > td:first-child { font-weight: inherit; }
29
+ /* A counter's heading goes inside its link, so the whole `Franchises: 21` is
30
+ one thing to tap; the cell's own heading steps aside for it. */
31
+ .sm\:table-stacked > tbody > tr > td.recourse-counter::before { content: none; }
32
+ .sm\:table-stacked > tbody > tr > td.recourse-counter > [data-cell]::before {
33
+ content: attr(data-cell) ': ';
34
+ font-weight: var(--bs-font-weight-semibold);
35
+ }
36
+ .sm\:table-stacked > tbody > tr > td:not(:first-child) + td::before { margin-block-start: 0; }
37
+ .sm\:table-stacked > tbody > tr > td { overflow-wrap: anywhere; }
38
+ }
39
+
40
+ /* A counter says what it counts in one of two ways, and the table's own width is
41
+ what picks: the icon and a bare figure where the column is a square, the
42
+ counted model's words where there is room to read them. Bootstrap's `xl`, so
43
+ words arrive on a wide monitor and nowhere narrower — the width above is a
44
+ preference a table never crushes content into, so the column simply widens to
45
+ take them. Against `.table-responsive` like every query here, which is the
46
+ table's width rather than the window's: a sidebar takes a few hundred pixels
47
+ the window knows nothing about. */
48
+ .recourse-counter-word { display: none; }
49
+ @container (width >= 1280px) {
50
+ .recourse-counter-icon, .recourse-counter-figure { display: none; }
51
+ .recourse-counter-word { display: inline; }
52
+ }
53
+
54
+ /* A row the viewer has kept, and the only report a click ever gets, so it has to
55
+ be seen. A twelfth of the primary mixed into the page rather than
56
+ `--bs-primary-bg-subtle`: that token is a fixed step of the ramp, far enough
57
+ from the page on a low-contrast palette to cost the text a point of contrast
58
+ it has not got — mixing into the page keeps the tint the same distance from it
59
+ whatever the palette. A background rather than `.table-active`, which sets the
60
+ very variable `.table-hover` sets and would read as the row under the cursor,
61
+ and lose its tint the moment it became one; a background lets the hover shadow
62
+ lay over it. */
63
+ .table > tbody > .recourse-kept > * {
64
+ background-color: color-mix(in srgb, var(--bs-primary-fg) 12%, var(--bs-bg-body));
65
+ }
66
+
67
+ /* The row a write just landed on, tinted for as long as the message saying so
68
+ stands. On the cells rather than on the row, like the kept tint beside it: the
69
+ table collapses its borders, so the cells are what paint, and one tint across
70
+ all of them is what reads as a single row — where anything drawn per cell reads
71
+ as a box around each of them instead.
72
+ A background rather than a border. A border on a collapsing table is a width
73
+ the table then measures around, and taking it away again leaves the line it
74
+ drew sitting between two rows that no longer want one.
75
+ Mixed into the page exactly as the kept tint below is, and never
76
+ `--bs-success-bg-subtle`: that token is `light-dark(--bs-green-100,
77
+ --bs-green-900)`, and a palette builds those steps by mixing toward white or
78
+ black rather than toward the page — so how far it lands from the page is the
79
+ palette's business and not ours. Mixing here keeps it the same distance on all
80
+ nine. The success family rather than the primary one is what tells it apart
81
+ from the kept tint it may land on top of: a different hue reads as a different
82
+ thing, where a second shade of the primary would read as more of the same. */
83
+ .table > tbody > .recourse-written > *,
84
+ .table > tbody > .recourse-written-out > * {
85
+ --recourse-written: color-mix(in srgb, var(--bs-success-fg) 12%, var(--bs-bg-body));
86
+ }
87
+ .table > tbody > .recourse-written > * {
88
+ background-color: var(--recourse-written);
89
+ }
90
+ /* Let go of over the second the toast beside it takes to fade, and started by the
91
+ same event. The class above comes off as this one goes on, so the animation is
92
+ the only thing painting the row while it runs and nothing paints it afterwards
93
+ — which hands a kept row back its own tint rather than leaving it wearing this
94
+ one. */
95
+ .table > tbody > .recourse-written-out > * {
96
+ animation: recourse-written-out 1s linear;
97
+ }
98
+ @keyframes recourse-written-out {
99
+ from { background-color: var(--recourse-written); }
100
+ to { background-color: var(--bs-bg-body); }
101
+ }
102
+ /* The tint itself is not motion; only its going is. */
103
+ @media (prefers-reduced-motion: reduce) {
104
+ .table > tbody > .recourse-written-out > * { animation: none; }
105
+ }
106
+
107
+ /* The grip a row of an arranged table is taken hold of by. The cursor is the whole of
108
+ the affordance — the icon says what it is and the pointer says it can be picked up —
109
+ and `grabbing` while it is held, which is what tells a drag from a click that has not
110
+ moved yet. `touch-action: none` on this square alone: a phone scrolls the page by
111
+ dragging anywhere on a table, and only the grip is taken away from that. */
112
+ .recourse-handle {
113
+ cursor: grab;
114
+ touch-action: none;
115
+ }
116
+ .recourse-handle:active { cursor: grabbing; }
117
+
118
+ /* The space the row will land in, which Sortable leaves standing where it would go.
119
+ The same tint a kept row wears, mixed into the page the same way and for the same
120
+ reason: a fixed step of the ramp lands a different distance from the page on every
121
+ palette. On the cells rather than the row, since the table collapses its borders and
122
+ the cells are what paint. */
123
+ .table > tbody > tr.sortable-ghost > * {
124
+ background-color: color-mix(in srgb, var(--bs-primary-fg) 12%, var(--bs-bg-body));
125
+ }
126
+
127
+ /* And the row itself while it is off the ground. Sortable fades it to 0.8; a row under
128
+ the cursor reads as lifted from the tint standing where it left, so nothing here has
129
+ to make it translucent as well. */
130
+ .table > tbody > tr.sortable-drag { opacity: 1; }
@@ -0,0 +1,41 @@
1
+ /* One rule per row of the show page, so a value and its heading read as one thing
2
+ and the next pair as another. On the cells rather than between them: a column's
3
+ gutter is padding inside it, so two side by side draw one unbroken line.
4
+ Every row reserves the width a rule takes, in `transparent`, and the show page
5
+ only colors it in — which is what leaves a field at exactly the height of the
6
+ value it edits, row after row down two pages. */
7
+ .recourse-row {
8
+ border-block-end: var(--bs-border-width) solid transparent;
9
+ }
10
+ .recourse-values > .recourse-row {
11
+ border-block-end-color: var(--bs-border-color);
12
+ }
13
+ /* And a value stands as tall as the control that edits it, so a row on one page
14
+ is a row of the same height on the other. Bootstrap gives
15
+ `.form-control-plaintext` a control's padding and line height but no minimum,
16
+ and an icon or a badge is shorter than a box. */
17
+ .recourse-values .form-control-plaintext {
18
+ min-height: var(--bs-control-min-height);
19
+ }
20
+ /* The reveal is a word beside a value rather than a control beside it, so it takes
21
+ the line's height and not `.btn-sm`'s minimum — which would leave a masked row
22
+ taller than the field that edits the same attribute. */
23
+ .form-control-plaintext .btn {
24
+ min-height: 0;
25
+ }
26
+
27
+ /* A payload in a block of its own, bounded so it scrolls rather than grows. `pre`
28
+ for the indentation that makes JSON readable, but wrapping rather than running
29
+ off to the side: a flex item's automatic minimum size is the min-content width
30
+ of whatever is inside it, and `overflow` on this box does not lower it — so one
31
+ unbroken 4,000-character token became the width of the value's column, then of
32
+ `main`, which then wrapped below the sidebar it belongs beside. `pre-wrap` keeps
33
+ the indentation and takes the wrapping, and `anywhere` is what lowers
34
+ min-content, which `break-word` in its place would not. */
35
+ .recourse-payload {
36
+ max-height: 12rem;
37
+ margin-block-end: 0;
38
+ overflow: auto;
39
+ white-space: pre-wrap;
40
+ overflow-wrap: anywhere;
41
+ }
@@ -0,0 +1,13 @@
1
+ /* Everything a page built on Bootstrap 6 is styled by, in one file: Bootstrap as upstream
2
+ ships it, and then this gem's own rules, each in a file named for what it draws.
3
+ Built by esbuild into /css/bh.css; the imports are the reading order. */
4
+ @import '../../vendor/bootstrap.min.css';
5
+ @import 'bh/base.css';
6
+ @import 'bh/shell.css';
7
+ @import 'bh/table.css';
8
+ @import 'bh/map.css';
9
+ @import 'bh/search.css';
10
+ @import 'bh/values.css';
11
+ @import 'bh/chat.css';
12
+ @import 'bh/pin.css';
13
+ @import 'bh/flow.css';
@@ -0,0 +1,10 @@
1
+ /* Bootstrap's own palette, and the only file here that declares nothing.
2
+
3
+ The eight beside it work by overriding upstream's `:root`, so having upstream's
4
+ palette back is a matter of dropping their block rather than of writing one — and
5
+ swapping this link in is how a toggle drops it. Linking no palette at all and linking
6
+ this one are the same look by two routes.
7
+
8
+ It is named so the toggle can reach it. A reader who rotates through nine palettes
9
+ and never finds the one the pages started in has been shown a door with no handle
10
+ on the inside. */