@nordcode/ui 1.0.12 → 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,25 +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
125
  block-size: 100%;
124
- }
125
-
126
- :where(body) {
126
+ color: var(--color-text-base);
127
+ background-color: var(--color-surface-muted);
127
128
  font-family: var(--font-family-default);
129
+ line-height: var(--line-height-base);
128
130
  font-weight: var(--font-weight-default);
129
131
  font-size-adjust: from-font;
130
- line-height: var(--line-height-base);
131
- color: var(--color-text-base);
132
- background-color: var(--color-surface-muted);
133
- min-block-size: 100vh;
132
+ interpolate-size: allow-keywords;
133
+ font-kerning: normal;
134
+ -moz-osx-font-smoothing: grayscale;
135
+ -webkit-font-smoothing: antialiased;
134
136
  }
135
137
 
136
- :where(body, h1, h2, h3, h4, p, figure, blockquote, dl, dd) {
137
- margin: 0;
138
+ :where(body) {
139
+ min-block-size: 100vh;
138
140
  }
139
141
 
140
142
  :where(ul[role="list"], ol[role="list"]) {
@@ -161,13 +163,17 @@
161
163
  }
162
164
 
163
165
  :where(figure) {
164
- flex-direction: column;
166
+ grid-template-rows: 1fr auto;
167
+ place-content: center;
165
168
  gap: 0;
166
- display: flex;
169
+ display: grid;
167
170
  }
168
171
 
169
- :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)) {
170
173
  cursor: pointer;
174
+ }
175
+
176
+ :where(a[href], area, button, input, label[for], select, summary, textarea, [tabindex]:not([tabindex*="-"])) {
171
177
  touch-action: manipulation;
172
178
  -webkit-tap-highlight-color: transparent;
173
179
  }
@@ -184,19 +190,10 @@
184
190
  letter-spacing: inherit;
185
191
  }
186
192
 
187
- :where(label:not(class) + input, label:not(class) + select, label:not(class) + textarea) {
188
- display: block;
189
- }
190
-
191
- :where(p, summary) {
192
- max-inline-size: var(--measure-base);
193
- font-size: inherit;
194
- line-height: var(--line-height-base);
195
- margin: 0;
196
- }
197
-
198
193
  :where(p) {
194
+ text-wrap: balance;
199
195
  text-wrap: pretty;
196
+ max-inline-size: var(--measure-base);
200
197
  }
201
198
 
202
199
  :where(html):has(dialog:modal) {
@@ -206,6 +203,12 @@
206
203
  }
207
204
 
208
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
+
209
212
  :where(dt) {
210
213
  font-weight: var(--font-weight-active);
211
214
  color: var(--color-text-base);
@@ -275,9 +278,6 @@
275
278
  }
276
279
 
277
280
  :where(figcaption) {
278
- font-family: var(--font-family-sans);
279
- font-weight: var(--font-weight-default);
280
- line-height: var(--line-height-base);
281
281
  color: var(--color-surface-subtle);
282
282
  background-color: var(--color-text-base);
283
283
  padding: .3lh 1ch;
@@ -286,33 +286,26 @@
286
286
 
287
287
  :where(details) {
288
288
  --p-x-details: 2ch;
289
- --p-y-details: .75lh;
290
- background-color: var(--color-surface-subtle);
289
+ --p-y-details: .8lh;
290
+ background-color: var(--color-surface-muted);
291
291
  border-radius: var(--border-radius-medium);
292
292
  border: var(--border-width-thin) solid var(--color-border-base);
293
- inline-size: 100%;
294
- }
295
-
296
- :where(details) > * {
297
- padding-inline: var(--p-x-details);
298
- }
299
-
300
- :where(details) > :last-child {
301
- padding-block-end: var(--p-y-details);
302
- }
303
-
304
- :where(details) > summary::-webkit-details-marker {
305
- display: none;
293
+ padding: var(--p-y-details) var(--p-x-details);
306
294
  }
307
295
 
308
296
  :where(details) > summary {
309
- cursor: pointer;
310
297
  color: var(--color-text-base);
311
- inline-size: 100%;
312
- font-weight: var(--font-weight-strong);
313
- padding-inline: var(--p-x-details);
314
- padding-block: var(--p-y-details);
315
- 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);
316
309
  }
317
310
 
318
311
  .note, blockquote {
@@ -359,9 +352,10 @@
359
352
  }
360
353
 
361
354
  :where(hr) {
362
- border-top: var(--border-width-medium) solid var(--color-border-base);
363
- block-size: 0;
364
355
  inline-size: 100%;
356
+ block-size: var(--border-width-medium);
357
+ background: var(--color-border-base);
358
+ border-block-start: 0;
365
359
  }
366
360
 
367
361
  :where(h1, h2, h3, h4, h5, h6) {
@@ -443,6 +437,11 @@
443
437
  font-weight: var(--font-weight-default);
444
438
  }
445
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
+
446
445
  :where([aria-disabled="true"], .disabled, :disabled) {
447
446
  color: inherit;
448
447
  opacity: 1;
@@ -607,8 +606,12 @@
607
606
  padding-inline-start: 2ch;
608
607
  }
609
608
 
610
- :where(li + li), :where(li > :is(ul, ol)) {
611
- 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;
612
615
  }
613
616
  }
614
617
 
@@ -666,7 +669,7 @@
666
669
  }
667
670
 
668
671
  :where(.nc-flow) > * + * {
669
- margin-block-start: var(--flow-gap, .6lh);
672
+ margin-block-start: var(--flow-gap, .8lh);
670
673
  }
671
674
 
672
675
  :where(.nc-flow) > * {
@@ -678,16 +681,11 @@
678
681
  --flow-gap: 1.3lh;
679
682
  }
680
683
 
681
- :where(.nc-flow) > :is(h1, h2, h3, h4, h5, h6) + p {
682
- --flow-gap: .5lh;
683
- }
684
-
685
- :where(.nc-flow) > p + p {
686
- --flow-gap: .8lh;
684
+ :where(.nc-flow) > :is(h1, h2, h3, h4, h5, h6) + :not([class]) {
685
+ --flow-gap: .3lh;
687
686
  }
688
687
 
689
688
  :where(.nc-flow) > figure {
690
- margin-block: 1lh;
691
689
  margin-inline: 0;
692
690
  }
693
691
 
@@ -1666,12 +1664,12 @@
1666
1664
  }
1667
1665
 
1668
1666
  :where(legend:not([class]), .nc-legend) + * {
1669
- margin-block-start: var(--nc-legend-spacing, .75lh);
1667
+ margin-block-start: var(--nc-legend-spacing, .8lh);
1670
1668
  }
1671
1669
 
1672
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) {
1673
- --nc-legend-spacing: 0;
1674
- margin-block-end: .6lh;
1671
+ --nc-legend-spacing: .125lh;
1672
+ margin-block-end: .5lh;
1675
1673
  }
1676
1674
  }
1677
1675
 
@@ -1756,7 +1754,7 @@
1756
1754
  }
1757
1755
 
1758
1756
  :where(.nc-icon)[data-size="inline"] {
1759
- --icon-size: .75lh;
1757
+ --icon-size: .8lh;
1760
1758
  }
1761
1759
 
1762
1760
  :where(.nc-icon)[data-size="button"] {
@@ -1789,7 +1787,6 @@
1789
1787
  font-weight: var(--font-weight-active);
1790
1788
  color: var(--color-text-base);
1791
1789
  font-size: inherit;
1792
- cursor: pointer;
1793
1790
  align-items: center;
1794
1791
  gap: .15lh;
1795
1792
  display: inline-flex;
@@ -1859,9 +1856,12 @@
1859
1856
 
1860
1857
  :where(textarea:not([class]), .nc-textarea) {
1861
1858
  min-block-size: calc(5lh + 2 * var(--_input-padding-block));
1859
+ max-block-size: 80svh;
1862
1860
  min-inline-size: var(--input-inline-size, 100%);
1863
1861
  max-inline-size: 100%;
1864
1862
  padding-block: var(--_input-padding-block);
1863
+ resize: block;
1864
+ field-sizing: content;
1865
1865
  }
1866
1866
 
1867
1867
  :where(input[type="checkbox"]:not([class]), input[type="radio"]:not([class]), .nc-input-checkbox, .nc-input-radio, .nc-input-switch) {
@@ -1869,14 +1869,12 @@
1869
1869
  border: var(--_input-border);
1870
1870
  --current-background: var(--_input-background);
1871
1871
  background: var(--current-background);
1872
- cursor: pointer;
1873
1872
  block-size: 1lh;
1874
1873
  inline-size: 1lh;
1875
1874
  transition: var(--transition-duration-short) background var(--ease-2);
1876
1875
  box-shadow: var(--_input-box-shadow);
1877
1876
  justify-content: center;
1878
1877
  align-items: center;
1879
- margin: 0;
1880
1878
  padding: 0;
1881
1879
  display: inline-flex;
1882
1880
  }
@@ -1952,12 +1950,12 @@
1952
1950
 
1953
1951
  :where(input[type="range"], .nc-input-range)::-webkit-slider-thumb {
1954
1952
  appearance: none;
1953
+ inline-size: calc(var(--button-height-base) * .7);
1954
+ block-size: calc(var(--button-height-base) * .7);
1955
1955
  border-radius: var(--_input-border-radius);
1956
1956
  border: var(--_input-border);
1957
1957
  border-color: var(--color-text-base);
1958
1958
  background-color: var(--color-text-base);
1959
- block-size: 1lh;
1960
- inline-size: 1lh;
1961
1959
  box-shadow: var(--shadow-near);
1962
1960
  cursor: pointer;
1963
1961
  }
@@ -1969,12 +1967,12 @@
1969
1967
 
1970
1968
  :where(input[type="range"], .nc-input-range)::-moz-range-thumb {
1971
1969
  appearance: none;
1970
+ inline-size: calc(var(--button-height-base) * .7);
1971
+ block-size: calc(var(--button-height-base) * .7);
1972
1972
  border-radius: var(--_input-border-radius);
1973
1973
  border: var(--_input-border);
1974
1974
  border-color: var(--color-text-base);
1975
1975
  background-color: var(--color-text-base);
1976
- block-size: 1lh;
1977
- inline-size: 1lh;
1978
1976
  box-shadow: var(--shadow-near);
1979
1977
  cursor: pointer;
1980
1978
  }
@@ -1988,7 +1986,7 @@
1988
1986
  --_tag-select-checked-text-color: var(--tag-select-checked-text-color, var(--color-brand-primary-contrast));
1989
1987
  --_tag-select-checked-surface-color: var(--tag-select-checked-surface-color, var(--color-brand-primary-base));
1990
1988
  --_tag-select-border-radius: var(--tag-select-border-radius, var(--_input-border-radius));
1991
- --nc-legend-spacing: .25lh;
1989
+ --nc-legend-spacing: .3lh;
1992
1990
  }
1993
1991
 
1994
1992
  :where(.nc-tag-select-field):focus-within:has(:focus-visible) {
@@ -2029,13 +2027,12 @@
2029
2027
  max-inline-size: var(--input-field-max-inline-size);
2030
2028
  grid-template-columns: minmax(0, 1fr);
2031
2029
  place-items: start;
2032
- gap: .25lh;
2030
+ gap: .3lh;
2033
2031
  display: grid;
2034
2032
  }
2035
2033
 
2036
2034
  :where(.nc-input-field) > label, :where(.nc-input-field) > .nc-stack {
2037
- line-height: var(--line-height-small);
2038
- gap: .125lh;
2035
+ gap: .15lh;
2039
2036
  }
2040
2037
 
2041
2038
  :where(.nc-input-field) > .nc-cluster {
@@ -2103,7 +2100,7 @@
2103
2100
  --_segmented-control-border-radius: var(--segmented-control-border-radius, var(--_input-border-radius));
2104
2101
  --_segmented-control-checked-text-color: var(--segmented-control-checked-text-color, var(--color-brand-primary-contrast));
2105
2102
  --_segmented-control-checked-surface-color: var(--segmented-control-checked-surface-color, var(--color-brand-primary-base));
2106
- --nc-legend-spacing: .25lh;
2103
+ --nc-legend-spacing: .3lh;
2107
2104
  container: segmented-control / inline-size;
2108
2105
  }
2109
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.12",
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;