@speles7172/controls 0.5.0 → 0.5.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 (2) hide show
  1. package/dist/styles.css +56 -3
  2. package/package.json +1 -1
package/dist/styles.css CHANGED
@@ -101,10 +101,40 @@
101
101
  color: var(--ctl-text);
102
102
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
103
103
  font-size: var(--ctl-text-base);
104
+ }
105
+
106
+ /*
107
+ * `.ctl` lays nothing out, and that is the whole of the rule.
108
+ *
109
+ * It is documented as the class a host puts on its own element to pick up the
110
+ * tokens — so a host writing `<form class="ctl flex flex-wrap items-end">` is
111
+ * writing utility classes that are also a single class: (0,1,0) against
112
+ * (0,1,0), settled by whichever stylesheet the bundler emitted last. A console
113
+ * imports its CSS from a component, so that is this one, and the form came out
114
+ * a column with its fields pushed to the cross-axis end — `items-end` applying
115
+ * while `flex-wrap` had nothing to wrap.
116
+ *
117
+ * `:where()` alone does not fix that, which is worth writing down because it
118
+ * looks as though it should. It makes the declaration (0,0,0), so a host wins
119
+ * every property it *declares* — and Tailwind's `flex` declares `display` and
120
+ * nothing else. `flex-direction: column` at any specificity still beats the
121
+ * initial `row`, so the form stayed a column until `flex-row` was written out
122
+ * as well. Measured in Chromium against a minified bundle, both ways.
123
+ *
124
+ * So the column moves to the three primitives that are one — `.ctl-select`,
125
+ * `.ctl-field` and `.ctl-kv` — and joins the ones already declaring their own
126
+ * box: `.ctl-page-head` a wrapping row, `.ctl-table-wrap` a block, `.ctl-tabs`
127
+ * a scrolling row, `.ctl-card` a column of its own. Every root is then laid out
128
+ * by its own class at (0,1,0) and `.ctl` is what it says it is: the tokens, the
129
+ * type, and nothing about the shape of somebody else's element.
130
+ *
131
+ * `position: relative` stays, at zero specificity, because it is the one part
132
+ * of the old default a consumer may have anchored something to. Nothing in here
133
+ * needs it: the popover is `position: fixed` (see below) and the one stretched
134
+ * `::after` sits inside `.ctl-card-clickable`, which declares its own.
135
+ */
136
+ :where(.ctl) {
104
137
  position: relative;
105
- display: flex;
106
- flex-direction: column;
107
- gap: var(--ctl-space-1);
108
138
  }
109
139
 
110
140
  .ctl:where([data-ctl-theme="dark"]) {
@@ -176,6 +206,9 @@
176
206
  * otherwise squash it to the width of the word "All".
177
207
  */
178
208
  .ctl-select {
209
+ display: flex;
210
+ flex-direction: column;
211
+ gap: var(--ctl-space-1);
179
212
  min-width: 160px;
180
213
  }
181
214
 
@@ -501,6 +534,8 @@
501
534
  */
502
535
 
503
536
  .ctl-field {
537
+ display: flex;
538
+ flex-direction: column;
504
539
  gap: 6px;
505
540
  }
506
541
 
@@ -569,6 +604,8 @@
569
604
  */
570
605
 
571
606
  .ctl-kv {
607
+ display: flex;
608
+ flex-direction: column;
572
609
  gap: 6px;
573
610
  }
574
611
 
@@ -1164,9 +1201,21 @@
1164
1201
  color: var(--ctl-accent);
1165
1202
  }
1166
1203
 
1204
+ /*
1205
+ * `text-align: start` is stated rather than left to the browser, because a
1206
+ * `rowHeader` column renders `<th scope="row">` — which is what a screen reader
1207
+ * needs to announce a row by the thing that names it — and a `th` defaults to
1208
+ * `center`. `.ctl-th` says `start` and this did not, so the one column naming
1209
+ * each row was the one column not lining up with its own heading, while every
1210
+ * `<td>` beside it started at the edge. It stays above `.ctl-align-*`: those are
1211
+ * a single class too, so a column asking to be end-aligned wins here on source
1212
+ * order — which is why this is a bare `.ctl-td` and not `th.ctl-td`, since
1213
+ * (0,1,1) would outrank them and pin every row header to the start edge.
1214
+ */
1167
1215
  .ctl-td {
1168
1216
  padding: var(--ctl-space-3);
1169
1217
  font-size: var(--ctl-text-base);
1218
+ text-align: start;
1170
1219
  vertical-align: top;
1171
1220
  border-top: 1px solid var(--ctl-border);
1172
1221
  }
@@ -1305,6 +1354,10 @@
1305
1354
  .ctl-skeleton-table {
1306
1355
  display: flex;
1307
1356
  flex-direction: column;
1357
+ /* Stated, not inherited from `.ctl`, which no longer lays anything out. It
1358
+ was 4px before that and the rows closed up by 8px without it — the one
1359
+ thing in this stylesheet that was taking its gap from the root. */
1360
+ gap: var(--ctl-space-1);
1308
1361
  overflow: hidden;
1309
1362
  border: 1px solid var(--ctl-border);
1310
1363
  border-radius: var(--ctl-radius);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speles7172/controls",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Reusable React building blocks — a data table, searchable selects, a date range filter with a Gregorian and Hebrew calendar, a modal, badges and the loading and empty states — over static options or a transport you supply.",
5
5
  "license": "MIT",
6
6
  "type": "module",