@nordcode/ui 1.1.6 → 1.1.7

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/out/bundle.css +150 -79
  3. package/out/bundle_configless.css +150 -79
  4. package/out/colors.css +53 -66
  5. package/out/complete.css +156 -85
  6. package/out/complete_configless.css +156 -85
  7. package/out/src/assets/fonts/DMMono-Regular.woff +0 -0
  8. package/out/src/assets/fonts/DMMono-Regular.woff2 +0 -0
  9. package/out/src/assets/fonts/fonts.css +7 -0
  10. package/out/src/assets/icons/ArrowRightSolid.svelte +1 -0
  11. package/out/src/assets/icons/arrow-right-solid.svg +1 -0
  12. package/out/src/assets/icons/favicon.png +0 -0
  13. package/out/src/assets/icons/favicon.svg +8 -0
  14. package/out/src/assets/logos/nordcode-logo-icon.svg +3 -0
  15. package/out/src/assets/logos/nordcode-logo.svg +17 -0
  16. package/out/src/modules/copyButtons/ts/copyButtons.ts +9 -0
  17. package/out/src/modules/dialogs/svelte/dialog.svelte +27 -0
  18. package/out/src/modules/dialogs/ts/LICENCE +171 -0
  19. package/out/src/modules/dialogs/ts/dialogs.ts +111 -0
  20. package/out/src/modules/notifications/js/notifications.js +294 -0
  21. package/out/src/modules/notifications/svelte/NotificationCenter.svelte +18 -0
  22. package/out/src/modules/notifications/svelte/NotificationTemplate.svelte +16 -0
  23. package/out/src/modules/sectionObserver/ts/sectionOberserver.ts +34 -0
  24. package/out/src/styles/bundle.css +7 -0
  25. package/out/src/styles/bundle_configless.css +5 -0
  26. package/out/src/styles/complete.css +5 -0
  27. package/out/src/styles/complete_configless.css +5 -0
  28. package/out/src/styles/components/alerts.css +20 -0
  29. package/out/src/styles/components/badges.css +14 -0
  30. package/out/src/styles/components/breadcrumbs.css +37 -0
  31. package/out/src/styles/components/bundle.css +13 -0
  32. package/out/src/styles/components/buttons.css +260 -0
  33. package/out/src/styles/components/card.css +55 -0
  34. package/out/src/styles/components/dialogs.css +138 -0
  35. package/out/src/styles/components/forms.css +41 -0
  36. package/out/src/styles/components/gallery.css +66 -0
  37. package/out/src/styles/components/icons.css +60 -0
  38. package/out/src/styles/components/inputs/base.css +249 -0
  39. package/out/src/styles/components/inputs/bundle.css +5 -0
  40. package/out/src/styles/components/inputs/fields.css +76 -0
  41. package/out/src/styles/components/inputs/segmented.css +114 -0
  42. package/out/src/styles/components/inputs/switch.css +42 -0
  43. package/out/src/styles/components/inputs/tag-select.css +41 -0
  44. package/out/src/styles/components/lists.css +40 -0
  45. package/out/src/styles/components/notifications.css +135 -0
  46. package/out/src/styles/components/tables.css +7 -0
  47. package/out/src/styles/config/bundle.css +2 -0
  48. package/out/src/styles/config/config.css +700 -0
  49. package/out/src/styles/config/extras.css +12 -0
  50. package/out/src/styles/exceptions/bundle.css +3 -0
  51. package/out/src/styles/exceptions/misc.css +21 -0
  52. package/out/src/styles/exceptions/spacings.css +15 -0
  53. package/out/src/styles/exceptions/typography.css +57 -0
  54. package/out/src/styles/theme/colors.css +165 -0
  55. package/out/src/styles/theme/colors_processed.css +87 -0
  56. package/out/src/styles/utils/base.css +415 -0
  57. package/out/src/styles/utils/bundle.css +6 -0
  58. package/out/src/styles/utils/easings.css +364 -0
  59. package/out/src/styles/utils/layouts.css +281 -0
  60. package/out/src/styles/utils/media.css +55 -0
  61. package/out/src/styles/utils/reset.css +145 -0
  62. package/out/src/styles/utils/theme.css +125 -0
  63. package/package.json +1 -1
  64. package/src/styles/exceptions/typography.css +15 -0
  65. package/src/styles/utils/base.css +101 -6
  66. package/src/styles/utils/reset.css +4 -6
  67. package/transform.js +11 -23
@@ -0,0 +1,145 @@
1
+ @layer reset {
2
+ *,
3
+ :after,
4
+ :before {
5
+ box-sizing: border-box;
6
+ }
7
+
8
+ :where(:not(dialog)) {
9
+ margin: 0;
10
+ }
11
+
12
+ :where(:not(fieldset, progress, meter)) {
13
+ border-width: 0;
14
+ border-style: solid;
15
+ background-origin: border-box;
16
+ background-repeat: no-repeat;
17
+ }
18
+
19
+ @media (prefers-reduced-motion: no-preference) {
20
+ :where(:focus-visible) {
21
+ transition: outline-offset var(--transition-duration-short) var(--ease-2);
22
+ }
23
+
24
+ :where(:not(:active):focus-visible) {
25
+ transition-duration: var(--transition-duration-base);
26
+ }
27
+ }
28
+
29
+ :where(:not(:active):focus-visible) {
30
+ outline: var(--border-width-medium) solid var(--color-brand-primary-base);
31
+ outline-offset: 1ch;
32
+ }
33
+
34
+ :where(:focus:not(:focus-visible)) {
35
+ outline: none;
36
+ }
37
+
38
+ :where(:root) {
39
+ -moz-text-size-adjust: none;
40
+ -webkit-text-size-adjust: none;
41
+ text-size-adjust: none;
42
+ block-size: 100%;
43
+ color: var(--color-text-base);
44
+ background-color: var(--color-surface-muted);
45
+ font-family: var(--font-family-default);
46
+ line-height: var(--line-height-base);
47
+ font-weight: var(--font-weight-default);
48
+ font-size-adjust: from-font;
49
+
50
+ interpolate-size: allow-keywords;
51
+
52
+ font-kerning: normal;
53
+ -moz-osx-font-smoothing: grayscale;
54
+ -webkit-font-smoothing: antialiased;
55
+ }
56
+
57
+ :where(body) {
58
+ min-block-size: 100vh;
59
+ }
60
+
61
+ /* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
62
+ :where(ul[role="list"], ol[role="list"]) {
63
+ list-style: none;
64
+ }
65
+
66
+ /* Balance text wrapping on headings */
67
+ :where(h1, h2, h3, h4) {
68
+ text-wrap: balance;
69
+ }
70
+
71
+ /* A elements that don't have a class get default styles */
72
+ :where(a:not([class])) {
73
+ text-decoration-skip-ink: auto;
74
+ color: currentColor;
75
+ }
76
+
77
+ :where(img, svg, video, canvas, audio, iframe, embed, object) {
78
+ display: block;
79
+ }
80
+
81
+ :where(img, svg, video) {
82
+ max-inline-size: 100%;
83
+ block-size: auto;
84
+ }
85
+
86
+ :where(figure) {
87
+ display: grid;
88
+ place-content: center;
89
+ grid-template-rows: 1fr auto;
90
+ gap: 0;
91
+ }
92
+
93
+ :where(
94
+ a[href],
95
+ area,
96
+ button,
97
+ input:not(
98
+ [type="text"],
99
+ [type="email"],
100
+ [type="number"],
101
+ [type="password"],
102
+ [type=""],
103
+ [type="tel"],
104
+ [type="url"]
105
+ ),
106
+ label[for],
107
+ select,
108
+ summary,
109
+ [tabindex]:not([tabindex*="-"], pre)
110
+ ) {
111
+ cursor: pointer;
112
+ }
113
+
114
+ :where(
115
+ a[href],
116
+ area,
117
+ button,
118
+ input,
119
+ label[for],
120
+ select,
121
+ summary,
122
+ textarea,
123
+ [tabindex]:not([tabindex*="-"])
124
+ ) {
125
+ touch-action: manipulation;
126
+ -webkit-tap-highlight-color: transparent;
127
+ }
128
+
129
+ :where(input, button, textarea, select),
130
+ :where(input[type="file"])::-webkit-file-upload-button {
131
+ font: inherit;
132
+ color: inherit;
133
+ letter-spacing: inherit;
134
+ }
135
+
136
+ :where(p) {
137
+ text-wrap: pretty;
138
+ max-inline-size: var(--measure-base);
139
+ }
140
+
141
+ :where(html):has(dialog:modal) {
142
+ scrollbar-gutter: stable;
143
+ overflow: hidden;
144
+ }
145
+ }
@@ -0,0 +1,125 @@
1
+ @layer helpers.theme {
2
+ * {
3
+ --text: var(--color-text-muted);
4
+ --color: var(--color-text-muted);
5
+ --surface: transparent;
6
+ --border: var(--color-border-muted);
7
+
8
+ --text-hover: var(--color-text-on-emphasis);
9
+ --color-hover: var(--color-text-on-emphasis);
10
+ --surface-hover: var(--color-surface-emphasis);
11
+ --border-hover: var(--color-border-base);
12
+ }
13
+
14
+ .-primary {
15
+ --text: var(--color-brand-primary-emphasis);
16
+ --color: var(--color-brand-primary-base);
17
+ --surface: var(--color-brand-primary-surface);
18
+ --border: var(--color-brand-primary-base);
19
+
20
+ --text-hover: var(--color-brand-primary-contrast);
21
+ --color-hover: var(--color-brand-primary-contrast);
22
+ --surface-hover: var(--color-brand-primary-base);
23
+ --border-hover: var(--color-brand-primary-base);
24
+ }
25
+
26
+ .-secondary {
27
+ --text: var(--color-brand-secondary-emphasis);
28
+ --color: var(--color-brand-secondary-base);
29
+ --surface: var(--color-brand-secondary-surface);
30
+ --border: var(--color-brand-secondary-base);
31
+
32
+ --text-hover: var(--color-brand-secondary-contrast);
33
+ --color-hover: var(--color-brand-secondary-contrast);
34
+ --surface-hover: var(--color-brand-secondary-base);
35
+ --border-hover: var(--color-brand-secondary-base);
36
+ }
37
+
38
+ .-neutral {
39
+ --text: var(--color-text-muted);
40
+ --color: var(--color-text-muted);
41
+ --surface: transparent;
42
+ --border: var(--color-border-muted);
43
+
44
+ --text-hover: var(--color-text-on-emphasis);
45
+ --color-hover: var(--color-text-on-emphasis);
46
+ --surface-hover: var(--color-surface-emphasis);
47
+ --border-hover: var(--color-border-base);
48
+ }
49
+
50
+ .-muted {
51
+ --text: var(--color-text-muted);
52
+ --color: var(--color-text-muted);
53
+ --surface: transparent;
54
+
55
+ --text-hover: var(--color-text-base);
56
+ --color-hover: var(--color-text-base);
57
+ --surface-hover: var(--color-surface-subtle);
58
+ --border-hover: var(--color-border-base);
59
+ }
60
+
61
+ .-emphasis {
62
+ --text: var(--color-text-on-emphasis);
63
+ --color: var(--color-text-on-emphasis);
64
+ --surface: var(--color-surface-emphasis);
65
+ --border: var(--color-surface-emphasis);
66
+
67
+ --text-hover: var(--color-text-base);
68
+ --color-hover: var(--color-text-base);
69
+ --surface-hover: var(--color-surface-subtle);
70
+ --border-hover: var(--color-border-base);
71
+ }
72
+
73
+ .-info {
74
+ --text: var(--color-status-info-emphasis);
75
+ --color: var(--color-status-info-base);
76
+ --surface: var(--color-status-info-surface);
77
+ --border: var(--color-status-info-base);
78
+
79
+ --text-hover: var(--color-status-info-contrast);
80
+ --color-hover: var(--color-status-info-contrast);
81
+ --surface-hover: var(--color-status-info-base);
82
+ --border-hover: var(--color-status-info-base);
83
+ }
84
+
85
+ .-warning {
86
+ --text: var(--color-status-warning-emphasis);
87
+ --color: var(--color-status-warning-base);
88
+ --surface: var(--color-status-warning-surface);
89
+ --border: var(--color-status-warning-base);
90
+
91
+ --text-hover: var(--color-status-warning-contrast);
92
+ --color-hover: var(--color-status-warning-contrast);
93
+ --surface-hover: var(--color-status-warning-base);
94
+ --border-hover: var(--color-status-warning-base);
95
+ }
96
+
97
+ .-danger {
98
+ --text: var(--color-status-danger-emphasis);
99
+ --color: var(--color-status-danger-base);
100
+ --surface: var(--color-status-danger-surface);
101
+ --border: var(--color-status-danger-base);
102
+
103
+ --text-hover: var(--color-status-danger-contrast);
104
+ --color-hover: var(--color-status-danger-contrast);
105
+ --surface-hover: var(--color-status-danger-base);
106
+ --border-hover: var(--color-status-danger-base);
107
+ }
108
+
109
+ .-success {
110
+ --text: var(--color-status-success-emphasis);
111
+ --color: var(--color-status-success-base);
112
+ --surface: var(--color-status-success-surface);
113
+ --border: var(--color-status-success-base);
114
+
115
+ --text-hover: var(--color-status-success-contrast);
116
+ --color-hover: var(--color-status-success-contrast);
117
+ --surface-hover: var(--color-status-success-base);
118
+ --border-hover: var(--color-status-success-base);
119
+ }
120
+
121
+ .themed {
122
+ background: var(--surface);
123
+ color: var(--text);
124
+ }
125
+ }
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.1.6",
15
+ "version": "1.1.7",
16
16
  "publishConfig": {
17
17
  "access": "public"
18
18
  },
@@ -16,6 +16,21 @@
16
16
  text-transform: capitalize;
17
17
  }
18
18
 
19
+ .centered {
20
+ text-align: center;
21
+ text-wrap: balance;
22
+ }
23
+
24
+ .uppercase {
25
+ text-transform: uppercase;
26
+ --opentype-case: on;
27
+ }
28
+
29
+ .smallcaps {
30
+ font-variant-caps: all-small-caps;
31
+ font-variant-numeric: oldstyle-nums;
32
+ }
33
+
19
34
  .strong {
20
35
  font-weight: var(--font-weight-strong);
21
36
  }
@@ -92,16 +92,17 @@
92
92
  padding: var(--p-y-details) var(--p-x-details);
93
93
  inline-size: 100%;
94
94
 
95
- &>summary {
95
+ & > summary {
96
96
  color: var(--color-text-base);
97
97
  background: var(--color-surface-subtle);
98
98
  font-weight: var(--font-weight-heading);
99
99
  border-radius: var(--b-r-details);
100
100
  padding: var(--p-y-details) var(--p-x-details);
101
- margin: calc(-1 * var(--p-y-details)) calc(-1 * var(--p-x-details) + var(--border-width-thin));
101
+ margin: calc(-1 * var(--p-y-details))
102
+ calc(-1 * var(--p-x-details) + var(--border-width-thin));
102
103
  }
103
104
 
104
- &[open]>summary {
105
+ &[open] > summary {
105
106
  border-end-start-radius: 0;
106
107
  border-end-end-radius: 0;
107
108
  margin-block-end: var(--p-y-details);
@@ -138,9 +139,11 @@
138
139
  margin-block-start: var(--spacing-near);
139
140
  font-size: var(--font-size-base);
140
141
  max-inline-size: max-content;
141
- color: color-mix(in oklch,
142
- currentColor calc(var(--transparency-weaker) * 100%),
143
- transparent);
142
+ color: color-mix(
143
+ in oklch,
144
+ currentColor calc(var(--transparency-weaker) * 100%),
145
+ transparent
146
+ );
144
147
  }
145
148
 
146
149
  & cite:before {
@@ -238,6 +241,9 @@
238
241
 
239
242
  :where(abbr) {
240
243
  text-decoration-color: var(--color-brand-primary-base);
244
+ font-variant-caps: all-small-caps;
245
+ font-variant-numeric: oldstyle-nums;
246
+ font-size: 110%;
241
247
  }
242
248
 
243
249
  :where([aria-disabled="true"], .disabled, :disabled) {
@@ -380,6 +386,10 @@
380
386
  background-color: var(--color-surface-muted);
381
387
  }
382
388
 
389
+ :where(td, math, time[datetime*=":"]) {
390
+ font-variant-numeric: tabular-nums lining-nums slashed-zero;
391
+ }
392
+
383
393
  :target {
384
394
  scroll-margin-block-start: 2ex;
385
395
  }
@@ -412,4 +422,89 @@
412
422
  :where(li > :is(ul, ol)) {
413
423
  margin-block-start: 0.25lh;
414
424
  }
425
+
426
+ @supports (font-variant-position: sub) {
427
+ :where(sub) {
428
+ vertical-align: baseline;
429
+ font-size: 100%;
430
+ line-height: inherit;
431
+ font-variant-position: sub;
432
+ }
433
+ }
434
+ @supports (font-variant-position: super) {
435
+ :where(sup) {
436
+ vertical-align: baseline;
437
+ font-size: 100%;
438
+ line-height: inherit;
439
+ font-variant-position: super;
440
+ }
441
+ }
442
+
443
+ /*
444
+ 11. Quotes
445
+ */
446
+
447
+ :lang(en) > * {
448
+ quotes: "“" "”" "‘" "’";
449
+ }
450
+ :lang(de) > * {
451
+ quotes: "„" "“" "‚" "‘";
452
+ }
453
+
454
+ :where(q::before) {
455
+ content: open-quote;
456
+ }
457
+ :where(q::after) {
458
+ content: close-quote;
459
+ }
460
+
461
+ :where(.quoted p:first-of-type::before) {
462
+ content: "“";
463
+ }
464
+ :where(.quoted p:last-of-type::after) {
465
+ content: "”";
466
+ }
467
+
468
+ :where(.quoted p:first-of-type::before) {
469
+ margin-inline-start: -0.87ch;
470
+ }
471
+ :where(.quoted p) {
472
+ hanging-punctuation: first last;
473
+ }
474
+ @supports (hanging-punctuation: first last) {
475
+ :where(.quoted p:first-of-type::before) {
476
+ margin-inline-start: 0;
477
+ }
478
+ }
479
+
480
+ :where(.prose) {
481
+ hyphens: auto;
482
+ hyphenate-limit-chars: 7 4 3;
483
+ hyphenate-limit-lines: 2;
484
+ hyphenate-limit-zone: 8%;
485
+ hyphenate-limit-last: always;
486
+ text-wrap: pretty;
487
+ }
488
+
489
+ :where(.prose p) {
490
+ text-wrap: pretty;
491
+ font-variant-numeric: oldstyle-nums proportional-nums;
492
+ max-inline-size: var(--measure-base);
493
+ }
494
+
495
+ :where(
496
+ .prose pre,
497
+ .prose code,
498
+ .prose var,
499
+ .prose samp,
500
+ .prose kbd,
501
+ .prose h1,
502
+ .prose h2,
503
+ .prose h3,
504
+ .prose h4,
505
+ .prose h5,
506
+ .prose h6
507
+ ) {
508
+ hyphens: manual;
509
+ }
415
510
  }
@@ -56,6 +56,10 @@
56
56
 
57
57
  :where(body) {
58
58
  min-block-size: 100vh;
59
+
60
+ text-decoration-skip-ink: auto;
61
+ font-optical-sizing: auto;
62
+ font-kerning: normal;
59
63
  }
60
64
 
61
65
  /* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
@@ -70,7 +74,6 @@
70
74
 
71
75
  /* A elements that don't have a class get default styles */
72
76
  :where(a:not([class])) {
73
- text-decoration-skip-ink: auto;
74
77
  color: currentColor;
75
78
  }
76
79
 
@@ -133,11 +136,6 @@
133
136
  letter-spacing: inherit;
134
137
  }
135
138
 
136
- :where(p) {
137
- text-wrap: pretty;
138
- max-inline-size: var(--measure-base);
139
- }
140
-
141
139
  :where(html):has(dialog:modal) {
142
140
  scrollbar-gutter: stable;
143
141
  overflow: hidden;
package/transform.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import fs from 'node:fs';
2
2
  import browserslist from 'browserslist';
3
- import { browserslistToTargets, bundle } from 'lightningcss';
3
+ import { browserslistToTargets, bundle, Features } from 'lightningcss';
4
4
 
5
5
  const browserlistTargtsWidelyAvailable = [
6
6
  'Chrome > 0 and last 2.5 years',
@@ -15,56 +15,44 @@ const browserlistTargtsWidelyAvailable = [
15
15
 
16
16
  const targets = browserslistToTargets(browserslist(browserlistTargtsWidelyAvailable));
17
17
 
18
- const { code: colors } = bundle({
19
- // ...
18
+ const config = {
20
19
  targets,
21
20
  drafts: {
22
21
  customMedia: true,
23
22
  },
23
+ exclude: Features.LightDark
24
+ };
25
+
26
+ const { code: colors } = bundle({
27
+ ...config,
24
28
  filename: 'src/styles/theme/colors.css',
25
29
  });
26
30
 
27
31
  fs.writeFileSync('out/colors.css', colors);
28
32
 
29
33
  const { code } = bundle({
30
- // ...
31
- targets,
32
- drafts: {
33
- customMedia: true,
34
- },
34
+ ...config,
35
35
  filename: 'src/styles/bundle.css',
36
36
  });
37
37
 
38
38
  fs.writeFileSync('out/bundle.css', code);
39
39
 
40
40
  const { code: bundleConfigless } = bundle({
41
- // ...
42
- targets,
43
- drafts: {
44
- customMedia: true,
45
- },
41
+ ...config,
46
42
  filename: 'src/styles/bundle_configless.css',
47
43
  });
48
44
 
49
45
  fs.writeFileSync('out/bundle_configless.css', bundleConfigless);
50
46
 
51
47
  const { code: codeComplete } = bundle({
52
- // ...
53
- targets,
54
- drafts: {
55
- customMedia: true,
56
- },
48
+ ...config,
57
49
  filename: 'src/styles/complete.css',
58
50
  });
59
51
 
60
52
  fs.writeFileSync('out/complete.css', codeComplete);
61
53
 
62
54
  const { code: codeCompleteConfigless } = bundle({
63
- // ...
64
- targets,
65
- drafts: {
66
- customMedia: true,
67
- },
55
+ ...config,
68
56
  filename: 'src/styles/complete_configless.css',
69
57
  });
70
58