crystal-neuo 4.0.1 → 4.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.
@@ -1672,6 +1672,14 @@ pre {
1672
1672
  font-weight: var(--weight-medium);
1673
1673
  color: var(--state-danger-content);
1674
1674
  }
1675
+ /* A row of fields: bottoms line up, so an unlabelled control (button, switch,
1676
+ bare select) sits level with the inputs, not with their labels. */
1677
+ .cn-field-row {
1678
+ display: flex;
1679
+ flex-wrap: wrap;
1680
+ align-items: end;
1681
+ gap: var(--space-3);
1682
+ }
1675
1683
 
1676
1684
  .cn-input,
1677
1685
  .cn-textarea,
@@ -1735,6 +1743,78 @@ pre {
1735
1743
  border-color: var(--state-danger-content);
1736
1744
  }
1737
1745
 
1746
+ /* ============================================================ Input start and end slots
1747
+ Content inside the input's box: a search or currency icon at the start, a
1748
+ reveal or clear button at the end. The group wraps only the input, so a slot
1749
+ centres on the input, never on the label, hint, or message. Each slot in use
1750
+ makes the input reserve one control height on its side, room for one square
1751
+ one inset smaller than the input: a button fills it (corners concentric to
1752
+ the input's), a bare icon sits centred in it. Icons are small (medium at lg). */
1753
+ .cn-input-group {
1754
+ --cn-input-h: var(--size-control-md);
1755
+ --cn-slot-box: calc(var(--cn-input-h) - 2 * var(--space-1));
1756
+ --cn-slot-icon: var(--size-icon-sm);
1757
+ position: relative;
1758
+ display: flex;
1759
+ }
1760
+ .cn-input-group--size-sm {
1761
+ --cn-input-h: var(--size-control-sm);
1762
+ }
1763
+ .cn-input-group--size-lg {
1764
+ --cn-input-h: var(--size-control-lg);
1765
+ --cn-slot-icon: var(--size-icon-md);
1766
+ }
1767
+ .cn-input-group:has(> .cn-input-group__start) > .cn-input {
1768
+ padding-inline-start: var(--cn-input-h);
1769
+ }
1770
+ .cn-input-group:has(> .cn-input-group__end) > .cn-input {
1771
+ padding-inline-end: var(--cn-input-h);
1772
+ }
1773
+ .cn-input-group__start,
1774
+ .cn-input-group__end {
1775
+ position: absolute;
1776
+ inset-block: 0;
1777
+ display: flex;
1778
+ align-items: center;
1779
+ gap: var(--space-1);
1780
+ color: var(--content-secondary);
1781
+ /* clicks on the slot's empty space and on bare icons reach the input */
1782
+ pointer-events: none;
1783
+ }
1784
+ :is(.cn-input-group__start, .cn-input-group__end) > :not(svg) {
1785
+ pointer-events: auto;
1786
+ }
1787
+ .cn-input-group__start {
1788
+ inset-inline-start: var(--space-1);
1789
+ }
1790
+ .cn-input-group__end {
1791
+ inset-inline-end: var(--space-1);
1792
+ }
1793
+ :is(.cn-input-group__start, .cn-input-group__end) > .cn-button {
1794
+ inline-size: var(--cn-slot-box);
1795
+ block-size: var(--cn-slot-box);
1796
+ min-height: 0;
1797
+ min-block-size: 0;
1798
+ padding: 0;
1799
+ border-radius: max(0px, calc(var(--radius-md) - var(--space-1)));
1800
+ }
1801
+ /* the field already draws the box: a ghost button inside it keeps its hover
1802
+ state layer and focus ring but not a second border, and takes the slot's colour */
1803
+ :is(.cn-input-group__start, .cn-input-group__end) > .cn-button--ghost {
1804
+ border-color: transparent;
1805
+ color: inherit;
1806
+ }
1807
+ :is(.cn-input-group__start, .cn-input-group__end) > .cn-button svg,
1808
+ :is(.cn-input-group__start, .cn-input-group__end) > svg {
1809
+ inline-size: var(--cn-slot-icon);
1810
+ block-size: var(--cn-slot-icon);
1811
+ flex: none;
1812
+ }
1813
+ /* a bare icon is decoration, centred where a button would be */
1814
+ :is(.cn-input-group__start, .cn-input-group__end) > svg {
1815
+ margin-inline: calc((var(--cn-slot-box) - var(--cn-slot-icon)) / 2);
1816
+ }
1817
+
1738
1818
  /* ============================================================ Select */
1739
1819
  .cn-select {
1740
1820
  position: relative;
@@ -2881,6 +2961,16 @@ html:has(dialog.cn-scrim[open]) {
2881
2961
  .cn-pagination__btn {
2882
2962
  min-inline-size: max(44px, var(--size-touch-min));
2883
2963
  }
2964
+ /* the input grew, so its end slot and the room it reserves grow with it */
2965
+ .cn-input-group {
2966
+ --cn-input-h: max(44px, var(--size-touch-min), var(--size-control-md));
2967
+ }
2968
+ .cn-input-group--size-sm {
2969
+ --cn-input-h: max(44px, var(--size-touch-min), var(--size-control-sm));
2970
+ }
2971
+ .cn-input-group--size-lg {
2972
+ --cn-input-h: max(44px, var(--size-touch-min), var(--size-control-lg));
2973
+ }
2884
2974
  }
2885
2975
 
2886
2976
  /* ============================================================ Forced colors
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crystal-neuo",
3
- "version": "4.0.1",
3
+ "version": "4.3.0",
4
4
  "description": "Crystal Neuo: the stylesheet, the runtime, and the migration codemods, in one install.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,6 +38,6 @@
38
38
  "build": "mkdir -p dist && cp ../css/dist/crystal-neuo.css dist/"
39
39
  },
40
40
  "dependencies": {
41
- "@crystal-neuo/tokens": "4.0.1"
41
+ "@crystal-neuo/tokens": "4.3.0"
42
42
  }
43
43
  }