@openwarelabs/ui 0.2.0 → 0.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.
package/dist/styles.css CHANGED
@@ -254,7 +254,7 @@
254
254
  }
255
255
 
256
256
  :root {
257
- --ow-space-3xs: 3px;
257
+ --ow-space-3xs: 4px;
258
258
  --ow-space-2xs: 4px;
259
259
  --ow-space-xs: 6px;
260
260
  --ow-space-sm: 8px;
@@ -536,6 +536,104 @@
536
536
  }
537
537
  }
538
538
 
539
+ /* components/Text/Text.css */
540
+ /* Text: the type styles from tokens.css as a component, with colours and the sizes the display styles take on phones. */
541
+ .ow-text {
542
+ margin: 0;
543
+ }
544
+
545
+ /* Titles balance their lines; running text avoids a lone last word. */
546
+ .ow-text--hero,
547
+ .ow-text--page-title,
548
+ .ow-text--section-title,
549
+ .ow-text--heading {
550
+ text-wrap: balance;
551
+ }
552
+
553
+ .ow-text--lead,
554
+ .ow-text--prose,
555
+ .ow-text--copy {
556
+ text-wrap: pretty;
557
+ }
558
+
559
+ .ow-text--lead {
560
+ max-width: 560px;
561
+ }
562
+
563
+ .ow-text--overline {
564
+ text-transform: uppercase;
565
+ }
566
+
567
+ .ow-text--code,
568
+ .ow-text--kbd {
569
+ font-variant-ligatures: none;
570
+ }
571
+
572
+ .ow-text--default {
573
+ color: var(--ow-text);
574
+ }
575
+
576
+ .ow-text--soft {
577
+ color: var(--ow-text-soft);
578
+ }
579
+
580
+ .ow-text--muted {
581
+ color: var(--ow-text-muted);
582
+ }
583
+
584
+ .ow-text--primary {
585
+ color: var(--ow-primary-text);
586
+ }
587
+
588
+ .ow-text--danger {
589
+ color: var(--ow-danger-text);
590
+ }
591
+
592
+ .ow-text--success {
593
+ color: var(--ow-success-text);
594
+ }
595
+
596
+ .ow-text--warning {
597
+ color: var(--ow-warning-text);
598
+ }
599
+
600
+ .ow-text--center {
601
+ text-align: center;
602
+ }
603
+
604
+ .ow-text--center.ow-text--lead {
605
+ margin-inline: auto;
606
+ }
607
+
608
+ .ow-text--end {
609
+ text-align: end;
610
+ }
611
+
612
+ .ow-text--truncate {
613
+ overflow: hidden;
614
+ text-overflow: ellipsis;
615
+ white-space: nowrap;
616
+ }
617
+
618
+ /* The display styles on phones, as the Typography page gives them. */
619
+ @media (max-width: 760px) {
620
+ .ow-text--hero {
621
+ font-size: 42px;
622
+ line-height: 1.02;
623
+ }
624
+ .ow-text--page-title {
625
+ font-size: 40px;
626
+ line-height: 1.06;
627
+ }
628
+ .ow-text--section-title {
629
+ font-size: 32px;
630
+ line-height: 1.12;
631
+ }
632
+ .ow-text--heading {
633
+ font-size: 21px;
634
+ }
635
+ }
636
+
539
637
  /* components/Spinner/Spinner.css */
540
638
  /* Spinner: a ring with one coloured quarter, turning. */
541
639
  .ow-spinner {
@@ -1479,19 +1577,22 @@
1479
1577
 
1480
1578
  .ow-option {
1481
1579
  display: flex;
1482
- min-height: 32px;
1580
+ min-height: 36px;
1483
1581
  align-items: flex-start;
1484
1582
  gap: var(--ow-space-sm);
1485
1583
  border-radius: var(--ow-radius-lg);
1486
- padding: var(--ow-space-xs) var(--ow-space-sm);
1584
+ /* 10 + a 16px line + 10: one line sits centred in the 36px row; a description just makes the row taller. */
1585
+ padding: var(--ow-space-md);
1487
1586
  color: var(--ow-text);
1488
1587
  font-size: 14px;
1489
- line-height: 1.1;
1588
+ line-height: 16px;
1490
1589
  text-align: left;
1491
1590
  cursor: pointer;
1492
1591
  }
1493
1592
 
1494
1593
  .ow-listbox--sm .ow-option {
1594
+ min-height: 32px;
1595
+ padding-block: var(--ow-space-sm);
1495
1596
  font-size: 12px;
1496
1597
  }
1497
1598
 
@@ -1512,11 +1613,11 @@
1512
1613
  .ow-option__check {
1513
1614
  display: flex;
1514
1615
  width: 16px;
1616
+ /* As tall as the label's first line, so the tick sits level with it. */
1515
1617
  height: 16px;
1516
1618
  flex-shrink: 0;
1517
1619
  align-items: center;
1518
1620
  justify-content: center;
1519
- padding-top: 2px;
1520
1621
  color: var(--ow-primary-text);
1521
1622
  }
1522
1623
 
@@ -1524,7 +1625,7 @@
1524
1625
  display: grid;
1525
1626
  min-width: 0;
1526
1627
  flex: 1;
1527
- gap: var(--ow-space-3xs);
1628
+ gap: var(--ow-space-2xs);
1528
1629
  }
1529
1630
 
1530
1631
  .ow-option__label {
@@ -1700,12 +1801,13 @@
1700
1801
  cursor: pointer;
1701
1802
  }
1702
1803
 
1804
+ /* Centred on the label's first line, whatever its line height. */
1703
1805
  .ow-check-label .ow-checkbox--md {
1704
- margin-top: 2px;
1806
+ margin-top: calc((1lh - 16px) / 2);
1705
1807
  }
1706
1808
 
1707
1809
  .ow-check-label .ow-checkbox--sm {
1708
- margin-top: 3px;
1810
+ margin-top: calc((1lh - 14px) / 2);
1709
1811
  }
1710
1812
 
1711
1813
  .ow-check-label--disabled {
@@ -1715,7 +1817,7 @@
1715
1817
 
1716
1818
  .ow-check-label__text {
1717
1819
  display: grid;
1718
- gap: var(--ow-space-3xs);
1820
+ gap: var(--ow-space-2xs);
1719
1821
  }
1720
1822
 
1721
1823
  .ow-check-label__description {
@@ -2645,7 +2747,7 @@
2645
2747
  border: 0;
2646
2748
  border-radius: var(--ow-radius-md);
2647
2749
  background: var(--ow-tooltip);
2648
- padding: var(--ow-space-3xs) var(--ow-space-sm);
2750
+ padding: var(--ow-space-2xs) var(--ow-space-sm);
2649
2751
  color: var(--ow-on-tooltip);
2650
2752
  font-family: var(--ow-font-sans);
2651
2753
  font-size: 12px;
@@ -3103,7 +3205,7 @@
3103
3205
  display: grid;
3104
3206
  min-width: 0;
3105
3207
  flex: 1;
3106
- gap: var(--ow-space-3xs);
3208
+ gap: var(--ow-space-2xs);
3107
3209
  padding-top: 5px;
3108
3210
  }
3109
3211
 
@@ -3628,7 +3730,7 @@
3628
3730
  }
3629
3731
 
3630
3732
  .ow-palette__group {
3631
- padding: var(--ow-space-sm) var(--ow-space-sm) var(--ow-space-3xs);
3733
+ padding: var(--ow-space-sm) var(--ow-space-sm) var(--ow-space-2xs);
3632
3734
  color: var(--ow-text-muted);
3633
3735
  font-size: 11px;
3634
3736
  font-weight: var(--ow-weight-control);
@@ -3887,7 +3989,7 @@
3887
3989
  .ow-disclosure__titles {
3888
3990
  display: grid;
3889
3991
  min-width: 0;
3890
- gap: var(--ow-space-3xs);
3992
+ gap: var(--ow-space-2xs);
3891
3993
  }
3892
3994
 
3893
3995
  .ow-disclosure__title {
@@ -4232,7 +4334,7 @@
4232
4334
  display: grid;
4233
4335
  min-width: 0;
4234
4336
  flex: 1 1 160px;
4235
- gap: var(--ow-space-3xs);
4337
+ gap: var(--ow-space-2xs);
4236
4338
  }
4237
4339
 
4238
4340
  .ow-steps__title {
@@ -4381,7 +4483,7 @@
4381
4483
 
4382
4484
  .ow-choice__text {
4383
4485
  display: grid;
4384
- gap: var(--ow-space-3xs);
4486
+ gap: var(--ow-space-2xs);
4385
4487
  }
4386
4488
 
4387
4489
  .ow-choice__title {
@@ -5342,7 +5444,7 @@
5342
5444
  display: grid;
5343
5445
  min-width: 0;
5344
5446
  flex: 1 1 192px;
5345
- gap: var(--ow-space-3xs);
5447
+ gap: var(--ow-space-2xs);
5346
5448
  }
5347
5449
 
5348
5450
  .ow-settings-row__label {
package/dist/tokens.css CHANGED
@@ -254,7 +254,7 @@
254
254
  }
255
255
 
256
256
  :root {
257
- --ow-space-3xs: 3px;
257
+ --ow-space-3xs: 4px;
258
258
  --ow-space-2xs: 4px;
259
259
  --ow-space-xs: 6px;
260
260
  --ow-space-sm: 8px;
package/dist/tokens.json CHANGED
@@ -832,13 +832,13 @@
832
832
  "tokens": [
833
833
  {
834
834
  "name": "ow-space-3xs",
835
- "value": "3px",
836
- "usage": "Gap between a title and its description."
835
+ "value": "4px",
836
+ "usage": "The same as ow-space-2xs, which the library uses; kept so code written for 0.2 keeps working."
837
837
  },
838
838
  {
839
839
  "name": "ow-space-2xs",
840
840
  "value": "4px",
841
- "usage": "Gap between menu items and options; a menu's offset from its trigger."
841
+ "usage": "Gap between a title and its description, and between menu items; a menu's offset from its trigger."
842
842
  },
843
843
  {
844
844
  "name": "ow-space-xs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openwarelabs/ui",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Openware UI: React components and design tokens — midnight and brass, tactile buttons and Inter, in light and dark.",
5
5
  "license": "MIT",
6
6
  "author": "Alexander Silver",