@slotted/styles 0.1.0-beta.33 → 0.1.0-beta.34

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slotted/styles",
3
- "version": "0.1.0-beta.33",
3
+ "version": "0.1.0-beta.34",
4
4
  "description": "Per-family stylesheets of Slotted, bundled by the React and Angular bindings.",
5
5
  "keywords": [
6
6
  "slotted",
@@ -484,6 +484,16 @@
484
484
  }
485
485
  }
486
486
 
487
+ /**
488
+ * A form written around the header, the body and the footer, so Enter in
489
+ * any field and the footer's submit belong to one form. It draws no box:
490
+ * its children are the panel's rows, and every rule of a part is written a
491
+ * second time through it, so the parts keep the panel's inset and rows.
492
+ */
493
+ [data-ui-drawer] > [data-part-panel] > form {
494
+ display: contents;
495
+ }
496
+
487
497
  /* ── Where the panel sits, and where it goes when it leaves ───────────── */
488
498
 
489
499
  [data-ui-drawer][data-side='start'] > [data-part-panel],
@@ -557,6 +567,10 @@
557
567
  border-start-end-radius: var(--slotted-drawer-radius-expanded, 0px);
558
568
  }
559
569
 
570
+ [data-ui-drawer][data-side='bottom'][data-expanded]
571
+ > [data-part-panel]
572
+ > form
573
+ > [data-part-header],
560
574
  [data-ui-drawer][data-side='bottom'][data-expanded] > [data-part-panel] > [data-part-header] {
561
575
  padding-block-start: calc(var(--_padding-block) + env(safe-area-inset-top, 0px));
562
576
  }
@@ -566,14 +580,17 @@
566
580
  * one. `top` needs no such rule: its separator is the fourth row and the
567
581
  * three above it are already where the base puts them.
568
582
  */
583
+ [data-ui-drawer][data-side='bottom'] > [data-part-panel] > form > [data-part-header],
569
584
  [data-ui-drawer][data-side='bottom'] > [data-part-panel] > [data-part-header] {
570
585
  grid-row: 2;
571
586
  }
572
587
 
588
+ [data-ui-drawer][data-side='bottom'] > [data-part-panel] > form > [data-part-body],
573
589
  [data-ui-drawer][data-side='bottom'] > [data-part-panel] > [data-part-body] {
574
590
  grid-row: 3;
575
591
  }
576
592
 
593
+ [data-ui-drawer][data-side='bottom'] > [data-part-panel] > form > [data-part-footer],
577
594
  [data-ui-drawer][data-side='bottom'] > [data-part-panel] > [data-part-footer] {
578
595
  grid-row: 4;
579
596
  }
@@ -678,6 +695,7 @@
678
695
  * sits over its end. The inset is padding inside the scrollport, so the last
679
696
  * line scrolls clear of the indicator rather than stopping under it.
680
697
  */
698
+ [data-ui-drawer][data-side='bottom'] > [data-part-panel] > form > [data-part-body]:last-child,
681
699
  [data-ui-drawer][data-side='bottom'] > [data-part-panel] > [data-part-body]:last-child {
682
700
  padding-block-end: calc(var(--_padding-block) + env(safe-area-inset-bottom, 0px));
683
701
  }
@@ -1090,6 +1108,7 @@
1090
1108
  * consumer can write: a header, a body and a footer draw two rules; a header
1091
1109
  * and a footer alone draw one; and a panel that is only a body draws none.
1092
1110
  */
1111
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-header],
1093
1112
  [data-ui-drawer] > [data-part-panel] > [data-part-header] {
1094
1113
  grid-row: 1;
1095
1114
  display: grid;
@@ -1107,6 +1126,7 @@
1107
1126
  * panel past its own measure, and a panel pinned to an edge then pushes its
1108
1127
  * inner edge across the layer.
1109
1128
  */
1129
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-header] > [data-part-title],
1110
1130
  [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-title] {
1111
1131
  grid-column: 1;
1112
1132
  grid-row: 1;
@@ -1127,24 +1147,34 @@
1127
1147
  }
1128
1148
 
1129
1149
  /* Actions take a column between the words and the close button, on the title's row. */
1150
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-header]:has(> [data-part-actions]),
1130
1151
  [data-ui-drawer] > [data-part-panel] > [data-part-header]:has(> [data-part-actions]) {
1131
1152
  grid-template-columns: minmax(0, 1fr) auto auto;
1132
1153
  }
1133
1154
 
1134
1155
  /* A column gap is drawn beside an empty track too, so a header holds only the
1135
1156
  columns of the parts it has. */
1157
+ [data-ui-drawer]
1158
+ > [data-part-panel]
1159
+ > form
1160
+ > [data-part-header]:has(> [data-part-actions]):not(:has(> [data-part-close])),
1136
1161
  [data-ui-drawer]
1137
1162
  > [data-part-panel]
1138
1163
  > [data-part-header]:has(> [data-part-actions]):not(:has(> [data-part-close])) {
1139
1164
  grid-template-columns: minmax(0, 1fr) auto;
1140
1165
  }
1141
1166
 
1167
+ [data-ui-drawer]
1168
+ > [data-part-panel]
1169
+ > form
1170
+ > [data-part-header]:not(:has(> [data-part-actions], > [data-part-close])),
1142
1171
  [data-ui-drawer]
1143
1172
  > [data-part-panel]
1144
1173
  > [data-part-header]:not(:has(> [data-part-actions], > [data-part-close])) {
1145
1174
  grid-template-columns: minmax(0, 1fr);
1146
1175
  }
1147
1176
 
1177
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-header] > [data-part-actions],
1148
1178
  [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-actions] {
1149
1179
  grid-column: 2;
1150
1180
  grid-row: 1 / span 2;
@@ -1154,6 +1184,7 @@
1154
1184
  gap: var(--slotted-space-2, 0.25rem);
1155
1185
  }
1156
1186
 
1187
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-header] > [data-part-description],
1157
1188
  [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-description] {
1158
1189
  grid-column: 1;
1159
1190
  grid-row: 2;
@@ -1175,6 +1206,7 @@
1175
1206
  * an `icon` box, sized here through the icon token so the box and the
1176
1207
  * formula above read one length.
1177
1208
  */
1209
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-header] > [data-part-close],
1178
1210
  [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-close] {
1179
1211
  --slotted-icon-size: var(--_icon-size);
1180
1212
 
@@ -1207,10 +1239,12 @@
1207
1239
  is the one a mouse sees: a transparent `::before` centerd on the control
1208
1240
  reaches 44 pixels, and the ground and the ring stay square. */
1209
1241
  @media (pointer: coarse) {
1242
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-header] > [data-part-close],
1210
1243
  [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-close] {
1211
1244
  position: relative;
1212
1245
  }
1213
1246
 
1247
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-header] > [data-part-close]::before,
1214
1248
  [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-close]::before {
1215
1249
  content: '';
1216
1250
  inset: min(0px, calc((100% - var(--slotted-target-comfortable, 44px)) / 2));
@@ -1218,6 +1252,11 @@
1218
1252
  }
1219
1253
  }
1220
1254
 
1255
+ [data-ui-drawer]
1256
+ > [data-part-panel]
1257
+ > form
1258
+ > [data-part-header]
1259
+ > [data-part-close]:not(:disabled):hover,
1221
1260
  [data-ui-drawer]
1222
1261
  > [data-part-panel]
1223
1262
  > [data-part-header]
@@ -1229,6 +1268,11 @@
1229
1268
  );
1230
1269
  }
1231
1270
 
1271
+ [data-ui-drawer]
1272
+ > [data-part-panel]
1273
+ > form
1274
+ > [data-part-header]
1275
+ > [data-part-close]:not(:disabled):active,
1232
1276
  [data-ui-drawer]
1233
1277
  > [data-part-panel]
1234
1278
  > [data-part-header]
@@ -1239,6 +1283,11 @@
1239
1283
  );
1240
1284
  }
1241
1285
 
1286
+ [data-ui-drawer]
1287
+ > [data-part-panel]
1288
+ > form
1289
+ > [data-part-header]
1290
+ > [data-part-close]:focus-visible,
1242
1291
  [data-ui-drawer] > [data-part-panel] > [data-part-header] > [data-part-close]:focus-visible {
1243
1292
  outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
1244
1293
  outline-offset: calc(-1 * var(--slotted-focus-ring-offset, 2px));
@@ -1252,6 +1301,7 @@
1252
1301
  * `dismissable-layer` covers the modal case; this covers the other two, where
1253
1302
  * the page behind is not locked at all.
1254
1303
  */
1304
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-body],
1255
1305
  [data-ui-drawer] > [data-part-panel] > [data-part-body] {
1256
1306
  grid-row: 2;
1257
1307
  min-block-size: 0;
@@ -1269,10 +1319,12 @@
1269
1319
  }
1270
1320
 
1271
1321
  /* Content that brings its own inset — a page, a list on the panel's edges. */
1322
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-body][data-inset='none'],
1272
1323
  [data-ui-drawer] > [data-part-panel] > [data-part-body][data-inset='none'] {
1273
1324
  padding: 0;
1274
1325
  }
1275
1326
 
1327
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-body]:not(:first-child),
1276
1328
  [data-ui-drawer] > [data-part-panel] > [data-part-body]:not(:first-child) {
1277
1329
  border-block-start: var(--_rule-size) solid
1278
1330
  var(--slotted-drawer-rule-color, var(--slotted-border-subtle, ButtonBorder));
@@ -1285,6 +1337,7 @@
1285
1337
  * instead, and the header, the close button, Escape and the resizer all stay
1286
1338
  * operable: a loading drawer a reader cannot leave is the worse failure.
1287
1339
  */
1340
+ [data-ui-drawer][data-loading] > [data-part-panel] > form > [data-part-body],
1288
1341
  [data-ui-drawer][data-loading] > [data-part-panel] > [data-part-body] {
1289
1342
  min-block-size: var(--slotted-space-12, 4rem);
1290
1343
  }
@@ -1297,6 +1350,7 @@
1297
1350
  * reason the middle one is bounded — an unbounded panel pushes it past the
1298
1351
  * fold, which is the whole failure the three-row grid exists to prevent.
1299
1352
  */
1353
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-footer],
1300
1354
  [data-ui-drawer] > [data-part-panel] > [data-part-footer] {
1301
1355
  grid-row: 3;
1302
1356
  display: flex;
@@ -1313,6 +1367,7 @@
1313
1367
  }
1314
1368
 
1315
1369
  @media (prefers-reduced-transparency: reduce), (forced-colors: active) {
1370
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-footer],
1316
1371
  [data-ui-drawer] > [data-part-panel] > [data-part-footer] {
1317
1372
  -webkit-backdrop-filter: none;
1318
1373
  backdrop-filter: none;
@@ -1332,12 +1387,14 @@
1332
1387
  * above it and the header already clears it; the body scrolls, so an inset on
1333
1388
  * it would be padding inside a scrollport rather than under it.
1334
1389
  */
1390
+ [data-ui-drawer][data-side='bottom'] > [data-part-panel] > form > [data-part-footer],
1335
1391
  [data-ui-drawer][data-side='bottom'] > [data-part-panel] > [data-part-footer] {
1336
1392
  padding-block-end: calc(
1337
1393
  var(--_footer-padding-block, var(--_padding-block)) + env(safe-area-inset-bottom, 0px)
1338
1394
  );
1339
1395
  }
1340
1396
 
1397
+ [data-ui-drawer] > [data-part-panel] > form > [data-part-footer]:not(:first-child),
1341
1398
  [data-ui-drawer] > [data-part-panel] > [data-part-footer]:not(:first-child) {
1342
1399
  border-block-start: var(--_rule-size) solid
1343
1400
  var(--slotted-drawer-rule-color, var(--slotted-border-subtle, ButtonBorder));
@@ -1451,6 +1508,10 @@
1451
1508
  border-start-end-radius var(--_move);
1452
1509
  }
1453
1510
 
1511
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag]
1512
+ > [data-part-panel]
1513
+ > form
1514
+ > [data-part-footer],
1454
1515
  [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag]
1455
1516
  > [data-part-panel]
1456
1517
  > [data-part-footer] {
@@ -1485,6 +1546,10 @@
1485
1546
  }
1486
1547
 
1487
1548
  /* `size="full"` is the screen: the footer rests at its bottom, in the row that takes what is left. */
1549
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel'][data-size='full']
1550
+ > [data-part-panel]
1551
+ > form
1552
+ > [data-part-footer],
1488
1553
  [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel'][data-size='full']
1489
1554
  > [data-part-panel]
1490
1555
  > [data-part-footer] {
@@ -1507,6 +1572,10 @@
1507
1572
  block-size: 0;
1508
1573
  }
1509
1574
 
1575
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1576
+ > [data-part-panel]
1577
+ > form
1578
+ > [data-part-body],
1510
1579
  [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1511
1580
  > [data-part-panel]
1512
1581
  > [data-part-body] {
@@ -1522,6 +1591,10 @@
1522
1591
  z-index: 2;
1523
1592
  }
1524
1593
 
1594
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1595
+ > [data-part-panel]
1596
+ > form
1597
+ > [data-part-header],
1525
1598
  [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1526
1599
  > [data-part-panel]
1527
1600
  > [data-part-header] {
@@ -1537,6 +1610,10 @@
1537
1610
  * their own, as the footer has: a frosted theme gives them a blur and a
1538
1611
  * lighter fill there.
1539
1612
  */
1613
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1614
+ > [data-part-panel]
1615
+ > form
1616
+ > :is([data-part-resizer], [data-part-header])[data-stuck],
1540
1617
  [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1541
1618
  > [data-part-panel]
1542
1619
  > :is([data-part-resizer], [data-part-header])[data-stuck] {
@@ -1549,6 +1626,10 @@
1549
1626
  }
1550
1627
 
1551
1628
  @media (prefers-reduced-transparency: reduce), (forced-colors: active) {
1629
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1630
+ > [data-part-panel]
1631
+ > form
1632
+ > :is([data-part-resizer], [data-part-header])[data-stuck],
1552
1633
  [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='panel']
1553
1634
  > [data-part-panel]
1554
1635
  > :is([data-part-resizer], [data-part-header])[data-stuck] {
@@ -1573,12 +1654,22 @@
1573
1654
  touch-action: none;
1574
1655
  }
1575
1656
 
1657
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='resizer']
1658
+ > [data-part-panel]
1659
+ > form
1660
+ > [data-part-body],
1576
1661
  [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='resizer']
1577
1662
  > [data-part-panel]
1578
1663
  > [data-part-body] {
1579
1664
  touch-action: pan-y;
1580
1665
  }
1581
1666
 
1667
+ [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='resizer']:not(
1668
+ [data-top-stop]
1669
+ )
1670
+ > [data-part-panel]
1671
+ > form
1672
+ > [data-part-body],
1582
1673
  [data-ui-drawer][data-mode='overlay'][data-side='bottom'][data-drag='resizer']:not(
1583
1674
  [data-top-stop]
1584
1675
  )
package/src/form/form.css CHANGED
@@ -153,15 +153,23 @@
153
153
  }
154
154
 
155
155
  /**
156
- * Two fields written one after the other directly inside the form stand
157
- * apart by a step of the space scale. The root is a block and drew no
158
- * distance at all, so a form written from the minimal example rendered its
159
- * fields touching. A layout the page draws itself — a grid of two columns, a
160
- * stack with its own gap — is not a field, and keeps its own spacing.
156
+ * Two children written one after the other directly inside the form stand
157
+ * apart by a step of the space scale: two fields, a row of fields the page
158
+ * draws itself, a message or a paragraph between them. The root is a block
159
+ * and drew no distance at all, so a form written from the minimal example
160
+ * rendered its fields touching. The aside and the summary keep their own
161
+ * margins, the action row keeps its own step, and a hidden input draws
162
+ * nothing, so it neither takes the gap nor gives it away.
163
+ * shortcut: a hidden input between two children drops the gap between them.
161
164
  */
162
165
  [data-ui-form][data-part-root]
163
- > :is([data-ui-field], [data-ui-field-group])
164
- + :is([data-ui-field], [data-ui-field-group]) {
166
+ > :where(:not([data-ui-form]:is([data-part-aside], [data-part-summary]), [type='hidden']))
167
+ + :where(
168
+ :not(
169
+ [data-ui-form]:is([data-part-aside], [data-part-summary], [data-part-actions]),
170
+ [type='hidden']
171
+ )
172
+ ) {
165
173
  margin-block-start: var(--slotted-form-field-gap, var(--slotted-space-6, 1rem));
166
174
  }
167
175
 
@@ -174,16 +182,11 @@
174
182
  }
175
183
 
176
184
  /**
177
- * One column at a bounded measure: a field never spans a wide page, and the
178
- * summary and the actions end where the fields end.
185
+ * One column at a bounded measure: a field, a row of fields, a message and
186
+ * the summary and the actions end where the fields end. The aside stands
187
+ * outside the column.
179
188
  */
180
- [data-ui-form][data-part-root]
181
- > :is(
182
- [data-ui-field],
183
- [data-ui-field-group],
184
- [data-ui-form][data-part-summary],
185
- [data-ui-form][data-part-actions]
186
- ) {
189
+ [data-ui-form][data-part-root] > :not([data-ui-form][data-part-aside]) {
187
190
  max-inline-size: var(--slotted-form-measure, 40rem);
188
191
  }
189
192