@nordcode/ui 1.0.11 → 1.1.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.
@@ -26,7 +26,7 @@
26
26
  color-scheme: dark;
27
27
  }
28
28
 
29
- :where(*) {
29
+ :where(:root) {
30
30
  --l-brand-primary: var(--lightningcss-light, var(--l-brand-primary-light)) var(--lightningcss-dark, var(--l-brand-primary-dark));
31
31
  --color-brand-primary-emphasis: var(--lightningcss-light, var(--color-brand-primary-emphasis-light)) var(--lightningcss-dark, var(--color-brand-primary-emphasis-dark));
32
32
  --color-brand-primary-base: var(--lightningcss-light, var(--color-brand-primary-base-light)) var(--lightningcss-dark, var(--color-brand-primary-base-dark));
@@ -86,10 +86,6 @@
86
86
  @layer reset {
87
87
  *, :after, :before {
88
88
  box-sizing: border-box;
89
- accent-color: var(--color-brand-primary-base);
90
- font-kerning: normal;
91
- -moz-osx-font-smoothing: grayscale;
92
- -webkit-font-smoothing: antialiased;
93
89
  }
94
90
 
95
91
  :where(:not(dialog)) {
@@ -103,11 +99,17 @@
103
99
  border-width: 0;
104
100
  }
105
101
 
106
- :where(:focus-visible) {
107
- transition: outline-offset var(--transition-duration-short) var(--ease-2);
102
+ @media (prefers-reduced-motion: no-preference) {
103
+ :where(:focus-visible) {
104
+ transition: outline-offset var(--transition-duration-short) var(--ease-2);
105
+ }
106
+
107
+ :where(:not(:active):focus-visible) {
108
+ transition-duration: var(--transition-duration-base);
109
+ }
108
110
  }
109
111
 
110
- :where(:focus-visible, :focus) {
112
+ :where(:not(:active):focus-visible) {
111
113
  outline: var(--border-width-medium) solid var(--color-brand-primary-base);
112
114
  outline-offset: 1ch;
113
115
  }
@@ -116,28 +118,25 @@
116
118
  outline: none;
117
119
  }
118
120
 
119
- :where(html) {
121
+ :where(:root) {
120
122
  -webkit-text-size-adjust: none;
121
123
  -moz-text-size-adjust: none;
122
124
  text-size-adjust: none;
123
- inline-size: 100%;
124
- text-rendering: optimizeSpeed;
125
125
  block-size: 100%;
126
- min-block-size: 100vh;
127
- }
128
-
129
- :where(body) {
130
- font-weight: var(--font-weight-default);
131
126
  color: var(--color-text-base);
132
127
  background-color: var(--color-surface-muted);
133
128
  font-family: var(--font-family-default);
134
129
  line-height: var(--line-height-base);
135
- min-block-size: 100%;
136
- font-style: normal;
130
+ font-weight: var(--font-weight-default);
131
+ font-size-adjust: from-font;
132
+ interpolate-size: allow-keywords;
133
+ font-kerning: normal;
134
+ -moz-osx-font-smoothing: grayscale;
135
+ -webkit-font-smoothing: antialiased;
137
136
  }
138
137
 
139
- :where(body, h1, h2, h3, h4, p, figure, blockquote, dl, dd) {
140
- margin: 0;
138
+ :where(body) {
139
+ min-block-size: 100vh;
141
140
  }
142
141
 
143
142
  :where(ul[role="list"], ol[role="list"]) {
@@ -164,13 +163,17 @@
164
163
  }
165
164
 
166
165
  :where(figure) {
167
- place-items: center;
166
+ grid-template-rows: 1fr auto;
167
+ place-content: center;
168
168
  gap: 0;
169
169
  display: grid;
170
170
  }
171
171
 
172
- :where(a[href], area, button, input, label[for], select, summary, textarea, [tabindex]:not([tabindex*="-"])) {
172
+ :where(a[href], area, button, input:not([type="text"], [type="email"], [type="number"], [type="password"], [type=""], [type="tel"], [type="url"]), label[for], select, summary, [tabindex]:not([tabindex*="-"], pre)) {
173
173
  cursor: pointer;
174
+ }
175
+
176
+ :where(a[href], area, button, input, label[for], select, summary, textarea, [tabindex]:not([tabindex*="-"])) {
174
177
  touch-action: manipulation;
175
178
  -webkit-tap-highlight-color: transparent;
176
179
  }
@@ -187,19 +190,10 @@
187
190
  letter-spacing: inherit;
188
191
  }
189
192
 
190
- :where(label:not(class) + input, label:not(class) + select, label:not(class) + textarea) {
191
- display: block;
192
- }
193
-
194
- :where(p, summary) {
195
- max-inline-size: var(--measure-base);
196
- font-size: inherit;
197
- line-height: var(--line-height-base);
198
- margin: 0;
199
- }
200
-
201
193
  :where(p) {
194
+ text-wrap: balance;
202
195
  text-wrap: pretty;
196
+ max-inline-size: var(--measure-base);
203
197
  }
204
198
 
205
199
  :where(html):has(dialog:modal) {
@@ -209,6 +203,12 @@
209
203
  }
210
204
 
211
205
  @layer base {
206
+ :where(:root) {
207
+ accent-color: var(--color-brand-primary-base);
208
+ caret-color: var(--color-brand-primary-base);
209
+ scrollbar-color: var(--color-text-subtle) transparent;
210
+ }
211
+
212
212
  :where(dt) {
213
213
  font-weight: var(--font-weight-active);
214
214
  color: var(--color-text-base);
@@ -278,9 +278,6 @@
278
278
  }
279
279
 
280
280
  :where(figcaption) {
281
- font-family: var(--font-family-sans);
282
- font-weight: var(--font-weight-default);
283
- line-height: var(--line-height-base);
284
281
  color: var(--color-surface-subtle);
285
282
  background-color: var(--color-text-base);
286
283
  padding: .3lh 1ch;
@@ -289,33 +286,26 @@
289
286
 
290
287
  :where(details) {
291
288
  --p-x-details: 2ch;
292
- --p-y-details: .75lh;
293
- background-color: var(--color-surface-subtle);
289
+ --p-y-details: .8lh;
290
+ background-color: var(--color-surface-muted);
294
291
  border-radius: var(--border-radius-medium);
295
292
  border: var(--border-width-thin) solid var(--color-border-base);
296
- inline-size: 100%;
297
- }
298
-
299
- :where(details) > * {
300
- padding-inline: var(--p-x-details);
301
- }
302
-
303
- :where(details) > :last-child {
304
- padding-block-end: var(--p-y-details);
305
- }
306
-
307
- :where(details) > summary::-webkit-details-marker {
308
- display: none;
293
+ padding: var(--p-y-details) var(--p-x-details);
309
294
  }
310
295
 
311
296
  :where(details) > summary {
312
- cursor: pointer;
313
297
  color: var(--color-text-base);
314
- inline-size: 100%;
315
- font-weight: var(--font-weight-strong);
316
- padding-inline: var(--p-x-details);
317
- padding-block: var(--p-y-details);
318
- list-style: none;
298
+ background: var(--color-surface-subtle);
299
+ border-radius: var(--border-radius-medium);
300
+ font-weight: var(--font-weight-heading);
301
+ padding: var(--p-y-details) var(--p-x-details);
302
+ margin: calc(-1 * var(--p-y-details)) calc(-1 * var(--p-x-details) + var(--border-width-thin));
303
+ }
304
+
305
+ :where(details)[open] > summary {
306
+ border-end-end-radius: 0;
307
+ border-end-start-radius: 0;
308
+ margin-block-end: var(--p-y-details);
319
309
  }
320
310
 
321
311
  .note, blockquote {
@@ -362,9 +352,10 @@
362
352
  }
363
353
 
364
354
  :where(hr) {
365
- border-top: var(--border-width-medium) solid var(--color-border-base);
366
- block-size: 0;
367
355
  inline-size: 100%;
356
+ block-size: var(--border-width-medium);
357
+ background: var(--color-border-base);
358
+ border-block-start: 0;
368
359
  }
369
360
 
370
361
  :where(h1, h2, h3, h4, h5, h6) {
@@ -446,6 +437,11 @@
446
437
  font-weight: var(--font-weight-default);
447
438
  }
448
439
 
440
+ :where(abbr) {
441
+ -webkit-text-decoration-color: var(--color-brand-primary-base);
442
+ text-decoration-color: var(--color-brand-primary-base);
443
+ }
444
+
449
445
  :where([aria-disabled="true"], .disabled, :disabled) {
450
446
  color: inherit;
451
447
  opacity: 1;
@@ -610,8 +606,12 @@
610
606
  padding-inline-start: 2ch;
611
607
  }
612
608
 
613
- :where(li + li), :where(li > :is(ul, ol)) {
614
- margin-top: .5lh;
609
+ :where(li + li) {
610
+ margin-block-start: .5lh;
611
+ }
612
+
613
+ :where(li > :is(ul, ol)) {
614
+ margin-block-start: .3lh;
615
615
  }
616
616
  }
617
617
 
@@ -669,7 +669,7 @@
669
669
  }
670
670
 
671
671
  :where(.nc-flow) > * + * {
672
- margin-block-start: var(--flow-gap, .6lh);
672
+ margin-block-start: var(--flow-gap, .8lh);
673
673
  }
674
674
 
675
675
  :where(.nc-flow) > * {
@@ -681,16 +681,11 @@
681
681
  --flow-gap: 1.3lh;
682
682
  }
683
683
 
684
- :where(.nc-flow) > :is(h1, h2, h3, h4, h5, h6) + p {
685
- --flow-gap: .5lh;
686
- }
687
-
688
- :where(.nc-flow) > p + p {
689
- --flow-gap: .8lh;
684
+ :where(.nc-flow) > :is(h1, h2, h3, h4, h5, h6) + :not([class]) {
685
+ --flow-gap: .3lh;
690
686
  }
691
687
 
692
688
  :where(.nc-flow) > figure {
693
- margin-block: 1lh;
694
689
  margin-inline: 0;
695
690
  }
696
691
 
@@ -1516,7 +1511,7 @@
1516
1511
  border-radius: var(--_dialog-radius);
1517
1512
  overflow-clip-margin: 1rem;
1518
1513
  pointer-events: all;
1519
- max-block-size: 100dvw;
1514
+ max-block-size: 100dvh;
1520
1515
  margin: auto 0;
1521
1516
  padding: 0;
1522
1517
  display: block;
@@ -1669,12 +1664,12 @@
1669
1664
  }
1670
1665
 
1671
1666
  :where(legend:not([class]), .nc-legend) + * {
1672
- margin-block-start: var(--nc-legend-spacing, .75lh);
1667
+ margin-block-start: var(--nc-legend-spacing, .8lh);
1673
1668
  }
1674
1669
 
1675
1670
  :where(:is(fieldset:not([class]), .nc-fieldset):has(:is(.nc-legend + .nc-hint, legend:not([class]) + .nc-hint)) > :is(legend:not([class]), .nc-legend) + .nc-hint) {
1676
- --nc-legend-spacing: 0;
1677
- margin-block-end: .6lh;
1671
+ --nc-legend-spacing: .125lh;
1672
+ margin-block-end: .5lh;
1678
1673
  }
1679
1674
  }
1680
1675
 
@@ -1759,7 +1754,7 @@
1759
1754
  }
1760
1755
 
1761
1756
  :where(.nc-icon)[data-size="inline"] {
1762
- --icon-size: .75lh;
1757
+ --icon-size: .8lh;
1763
1758
  }
1764
1759
 
1765
1760
  :where(.nc-icon)[data-size="button"] {
@@ -1792,7 +1787,6 @@
1792
1787
  font-weight: var(--font-weight-active);
1793
1788
  color: var(--color-text-base);
1794
1789
  font-size: inherit;
1795
- cursor: pointer;
1796
1790
  align-items: center;
1797
1791
  gap: .15lh;
1798
1792
  display: inline-flex;
@@ -1862,9 +1856,12 @@
1862
1856
 
1863
1857
  :where(textarea:not([class]), .nc-textarea) {
1864
1858
  min-block-size: calc(5lh + 2 * var(--_input-padding-block));
1859
+ max-block-size: 80svh;
1865
1860
  min-inline-size: var(--input-inline-size, 100%);
1866
1861
  max-inline-size: 100%;
1867
1862
  padding-block: var(--_input-padding-block);
1863
+ resize: block;
1864
+ field-sizing: content;
1868
1865
  }
1869
1866
 
1870
1867
  :where(input[type="checkbox"]:not([class]), input[type="radio"]:not([class]), .nc-input-checkbox, .nc-input-radio, .nc-input-switch) {
@@ -1872,14 +1869,12 @@
1872
1869
  border: var(--_input-border);
1873
1870
  --current-background: var(--_input-background);
1874
1871
  background: var(--current-background);
1875
- cursor: pointer;
1876
1872
  block-size: 1lh;
1877
1873
  inline-size: 1lh;
1878
1874
  transition: var(--transition-duration-short) background var(--ease-2);
1879
1875
  box-shadow: var(--_input-box-shadow);
1880
1876
  justify-content: center;
1881
1877
  align-items: center;
1882
- margin: 0;
1883
1878
  padding: 0;
1884
1879
  display: inline-flex;
1885
1880
  }
@@ -1955,12 +1950,12 @@
1955
1950
 
1956
1951
  :where(input[type="range"], .nc-input-range)::-webkit-slider-thumb {
1957
1952
  appearance: none;
1953
+ inline-size: calc(var(--button-height-base) * .7);
1954
+ block-size: calc(var(--button-height-base) * .7);
1958
1955
  border-radius: var(--_input-border-radius);
1959
1956
  border: var(--_input-border);
1960
1957
  border-color: var(--color-text-base);
1961
1958
  background-color: var(--color-text-base);
1962
- block-size: 1lh;
1963
- inline-size: 1lh;
1964
1959
  box-shadow: var(--shadow-near);
1965
1960
  cursor: pointer;
1966
1961
  }
@@ -1972,12 +1967,12 @@
1972
1967
 
1973
1968
  :where(input[type="range"], .nc-input-range)::-moz-range-thumb {
1974
1969
  appearance: none;
1970
+ inline-size: calc(var(--button-height-base) * .7);
1971
+ block-size: calc(var(--button-height-base) * .7);
1975
1972
  border-radius: var(--_input-border-radius);
1976
1973
  border: var(--_input-border);
1977
1974
  border-color: var(--color-text-base);
1978
1975
  background-color: var(--color-text-base);
1979
- block-size: 1lh;
1980
- inline-size: 1lh;
1981
1976
  box-shadow: var(--shadow-near);
1982
1977
  cursor: pointer;
1983
1978
  }
@@ -1991,7 +1986,7 @@
1991
1986
  --_tag-select-checked-text-color: var(--tag-select-checked-text-color, var(--color-brand-primary-contrast));
1992
1987
  --_tag-select-checked-surface-color: var(--tag-select-checked-surface-color, var(--color-brand-primary-base));
1993
1988
  --_tag-select-border-radius: var(--tag-select-border-radius, var(--_input-border-radius));
1994
- --nc-legend-spacing: .25lh;
1989
+ --nc-legend-spacing: .3lh;
1995
1990
  }
1996
1991
 
1997
1992
  :where(.nc-tag-select-field):focus-within:has(:focus-visible) {
@@ -2032,13 +2027,12 @@
2032
2027
  max-inline-size: var(--input-field-max-inline-size);
2033
2028
  grid-template-columns: minmax(0, 1fr);
2034
2029
  place-items: start;
2035
- gap: .25lh;
2030
+ gap: .3lh;
2036
2031
  display: grid;
2037
2032
  }
2038
2033
 
2039
2034
  :where(.nc-input-field) > label, :where(.nc-input-field) > .nc-stack {
2040
- line-height: var(--line-height-small);
2041
- gap: .125lh;
2035
+ gap: .15lh;
2042
2036
  }
2043
2037
 
2044
2038
  :where(.nc-input-field) > .nc-cluster {
@@ -2106,7 +2100,7 @@
2106
2100
  --_segmented-control-border-radius: var(--segmented-control-border-radius, var(--_input-border-radius));
2107
2101
  --_segmented-control-checked-text-color: var(--segmented-control-checked-text-color, var(--color-brand-primary-contrast));
2108
2102
  --_segmented-control-checked-surface-color: var(--segmented-control-checked-surface-color, var(--color-brand-primary-base));
2109
- --nc-legend-spacing: .25lh;
2103
+ --nc-legend-spacing: .3lh;
2110
2104
  container: segmented-control / inline-size;
2111
2105
  }
2112
2106
 
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "type": "git",
13
13
  "url": "https://github.com/nordcode-agency/nordcode/tree/main/packages/ui"
14
14
  },
15
- "version": "1.0.11",
15
+ "version": "1.1.0",
16
16
  "publishConfig": {
17
17
  "access": "public"
18
18
  },
@@ -30,12 +30,12 @@
30
30
  inline-size: 100%;
31
31
 
32
32
  &+* {
33
- margin-block-start: var(--nc-legend-spacing, 0.75lh);
33
+ margin-block-start: var(--nc-legend-spacing, 0.8lh);
34
34
  }
35
35
  }
36
36
 
37
37
  :where(:is(fieldset:not([class]), .nc-fieldset):has( :is(.nc-legend + .nc-hint, legend:not([class]) + .nc-hint)) > :is(legend:not([class]), .nc-legend) + .nc-hint) {
38
- --nc-legend-spacing: 0;
39
- margin-block-end: 0.6lh;
38
+ --nc-legend-spacing: .125lh;
39
+ margin-block-end: 0.5lh;
40
40
  }
41
41
  }
@@ -32,7 +32,7 @@
32
32
  }
33
33
 
34
34
  &[data-size="inline"] {
35
- --icon-size: 0.75lh;
35
+ --icon-size: 0.8lh;
36
36
  }
37
37
 
38
38
  &[data-size="button"] {
@@ -44,7 +44,7 @@
44
44
  }
45
45
  }
46
46
 
47
- :where(button, .nc-button) > .nc-icon {
47
+ :where(button, .nc-button)>.nc-icon {
48
48
  --icon-size: 2ex;
49
49
  }
50
50
 
@@ -6,7 +6,6 @@
6
6
  color: var(--color-text-base);
7
7
  display: inline-flex;
8
8
  font-size: inherit;
9
- cursor: pointer;
10
9
  gap: 0.15lh;
11
10
  align-items: center;
12
11
  }
@@ -131,9 +130,13 @@
131
130
 
132
131
  :where(textarea:not([class]), .nc-textarea) {
133
132
  min-block-size: calc(5lh + 2 * var(--_input-padding-block));
133
+ max-block-size: 80svh;
134
134
  min-inline-size: var(--input-inline-size, 100%);
135
135
  max-inline-size: 100%;
136
136
  padding-block: var(--_input-padding-block);
137
+
138
+ resize: block;
139
+ field-sizing: content;
137
140
  }
138
141
 
139
142
  :where(input[type="checkbox"]:not([class]),
@@ -143,7 +146,6 @@
143
146
  .nc-input-switch) {
144
147
  inline-size: 1lh;
145
148
  block-size: 1lh;
146
- margin: 0;
147
149
  padding: 0;
148
150
  appearance: none;
149
151
  display: inline-flex;
@@ -152,7 +154,6 @@
152
154
  border: var(--_input-border);
153
155
  --current-background: var(--_input-background);
154
156
  background: var(--current-background);
155
- cursor: pointer;
156
157
  transition: var(--transition-duration-short) background var(--ease-2);
157
158
  box-shadow: var(--_input-box-shadow);
158
159
  }
@@ -230,8 +231,8 @@
230
231
  &::-webkit-slider-thumb,
231
232
  &::-moz-range-thumb {
232
233
  appearance: none;
233
- inline-size: 1lh;
234
- block-size: 1lh;
234
+ inline-size: calc(var(--button-height-base) * 0.7);
235
+ block-size: calc(var(--button-height-base) * 0.7);
235
236
  border-radius: var(--_input-border-radius);
236
237
  border: var(--_input-border);
237
238
  border-color: var(--color-text-base);
@@ -1,7 +1,7 @@
1
1
  @layer components.input-fields {
2
2
  :where(.nc-input-field) {
3
3
  display: grid;
4
- gap: 0.25lh;
4
+ gap: 0.3lh;
5
5
  grid-template-columns: minmax(0, 1fr);
6
6
  inline-size: 100%;
7
7
  min-inline-size: var(--input-field-min-inline-size);
@@ -10,8 +10,7 @@
10
10
 
11
11
  &>label,
12
12
  &>.nc-stack {
13
- gap: 0.125lh;
14
- line-height: var(--line-height-small);
13
+ gap: 0.15lh;
15
14
  }
16
15
 
17
16
  &>.nc-cluster {
@@ -9,7 +9,7 @@
9
9
 
10
10
  container: segmented-control / inline-size;
11
11
 
12
- --nc-legend-spacing: 0.25lh;
12
+ --nc-legend-spacing: 0.3lh;
13
13
  }
14
14
 
15
15
  :where(.nc-segmented-control) {
@@ -5,7 +5,7 @@
5
5
  --_tag-select-checked-surface-color: var(--tag-select-checked-surface-color,
6
6
  var(--color-brand-primary-base));
7
7
  --_tag-select-border-radius: var(--tag-select-border-radius, var(--_input-border-radius));
8
- --nc-legend-spacing: 0.25lh;
8
+ --nc-legend-spacing: 0.3lh;
9
9
 
10
10
  &:focus-within:has(:focus-visible) {
11
11
  outline-offset: 1ch;