crystal-neuo 4.0.1 → 4.2.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/crystal-neuo.css +82 -0
- package/package.json +2 -2
package/dist/crystal-neuo.css
CHANGED
|
@@ -1735,6 +1735,78 @@ pre {
|
|
|
1735
1735
|
border-color: var(--state-danger-content);
|
|
1736
1736
|
}
|
|
1737
1737
|
|
|
1738
|
+
/* ============================================================ Input start and end slots
|
|
1739
|
+
Content inside the input's box: a search or currency icon at the start, a
|
|
1740
|
+
reveal or clear button at the end. The group wraps only the input, so a slot
|
|
1741
|
+
centres on the input, never on the label, hint, or message. Each slot in use
|
|
1742
|
+
makes the input reserve one control height on its side, room for one square
|
|
1743
|
+
one inset smaller than the input: a button fills it (corners concentric to
|
|
1744
|
+
the input's), a bare icon sits centred in it. Icons are small (medium at lg). */
|
|
1745
|
+
.cn-input-group {
|
|
1746
|
+
--cn-input-h: var(--size-control-md);
|
|
1747
|
+
--cn-slot-box: calc(var(--cn-input-h) - 2 * var(--space-1));
|
|
1748
|
+
--cn-slot-icon: var(--size-icon-sm);
|
|
1749
|
+
position: relative;
|
|
1750
|
+
display: flex;
|
|
1751
|
+
}
|
|
1752
|
+
.cn-input-group--size-sm {
|
|
1753
|
+
--cn-input-h: var(--size-control-sm);
|
|
1754
|
+
}
|
|
1755
|
+
.cn-input-group--size-lg {
|
|
1756
|
+
--cn-input-h: var(--size-control-lg);
|
|
1757
|
+
--cn-slot-icon: var(--size-icon-md);
|
|
1758
|
+
}
|
|
1759
|
+
.cn-input-group:has(> .cn-input-group__start) > .cn-input {
|
|
1760
|
+
padding-inline-start: var(--cn-input-h);
|
|
1761
|
+
}
|
|
1762
|
+
.cn-input-group:has(> .cn-input-group__end) > .cn-input {
|
|
1763
|
+
padding-inline-end: var(--cn-input-h);
|
|
1764
|
+
}
|
|
1765
|
+
.cn-input-group__start,
|
|
1766
|
+
.cn-input-group__end {
|
|
1767
|
+
position: absolute;
|
|
1768
|
+
inset-block: 0;
|
|
1769
|
+
display: flex;
|
|
1770
|
+
align-items: center;
|
|
1771
|
+
gap: var(--space-1);
|
|
1772
|
+
color: var(--content-secondary);
|
|
1773
|
+
/* clicks on the slot's empty space and on bare icons reach the input */
|
|
1774
|
+
pointer-events: none;
|
|
1775
|
+
}
|
|
1776
|
+
:is(.cn-input-group__start, .cn-input-group__end) > :not(svg) {
|
|
1777
|
+
pointer-events: auto;
|
|
1778
|
+
}
|
|
1779
|
+
.cn-input-group__start {
|
|
1780
|
+
inset-inline-start: var(--space-1);
|
|
1781
|
+
}
|
|
1782
|
+
.cn-input-group__end {
|
|
1783
|
+
inset-inline-end: var(--space-1);
|
|
1784
|
+
}
|
|
1785
|
+
:is(.cn-input-group__start, .cn-input-group__end) > .cn-button {
|
|
1786
|
+
inline-size: var(--cn-slot-box);
|
|
1787
|
+
block-size: var(--cn-slot-box);
|
|
1788
|
+
min-height: 0;
|
|
1789
|
+
min-block-size: 0;
|
|
1790
|
+
padding: 0;
|
|
1791
|
+
border-radius: max(0px, calc(var(--radius-md) - var(--space-1)));
|
|
1792
|
+
}
|
|
1793
|
+
/* the field already draws the box: a ghost button inside it keeps its hover
|
|
1794
|
+
state layer and focus ring but not a second border, and takes the slot's colour */
|
|
1795
|
+
:is(.cn-input-group__start, .cn-input-group__end) > .cn-button--ghost {
|
|
1796
|
+
border-color: transparent;
|
|
1797
|
+
color: inherit;
|
|
1798
|
+
}
|
|
1799
|
+
:is(.cn-input-group__start, .cn-input-group__end) > .cn-button svg,
|
|
1800
|
+
:is(.cn-input-group__start, .cn-input-group__end) > svg {
|
|
1801
|
+
inline-size: var(--cn-slot-icon);
|
|
1802
|
+
block-size: var(--cn-slot-icon);
|
|
1803
|
+
flex: none;
|
|
1804
|
+
}
|
|
1805
|
+
/* a bare icon is decoration, centred where a button would be */
|
|
1806
|
+
:is(.cn-input-group__start, .cn-input-group__end) > svg {
|
|
1807
|
+
margin-inline: calc((var(--cn-slot-box) - var(--cn-slot-icon)) / 2);
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1738
1810
|
/* ============================================================ Select */
|
|
1739
1811
|
.cn-select {
|
|
1740
1812
|
position: relative;
|
|
@@ -2881,6 +2953,16 @@ html:has(dialog.cn-scrim[open]) {
|
|
|
2881
2953
|
.cn-pagination__btn {
|
|
2882
2954
|
min-inline-size: max(44px, var(--size-touch-min));
|
|
2883
2955
|
}
|
|
2956
|
+
/* the input grew, so its end slot and the room it reserves grow with it */
|
|
2957
|
+
.cn-input-group {
|
|
2958
|
+
--cn-input-h: max(44px, var(--size-touch-min), var(--size-control-md));
|
|
2959
|
+
}
|
|
2960
|
+
.cn-input-group--size-sm {
|
|
2961
|
+
--cn-input-h: max(44px, var(--size-touch-min), var(--size-control-sm));
|
|
2962
|
+
}
|
|
2963
|
+
.cn-input-group--size-lg {
|
|
2964
|
+
--cn-input-h: max(44px, var(--size-touch-min), var(--size-control-lg));
|
|
2965
|
+
}
|
|
2884
2966
|
}
|
|
2885
2967
|
|
|
2886
2968
|
/* ============================================================ Forced colors
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crystal-neuo",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.2.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
|
|
41
|
+
"@crystal-neuo/tokens": "4.2.0"
|
|
42
42
|
}
|
|
43
43
|
}
|