@nordcode/ui 1.1.6 → 1.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/out/bundle.css +99 -16
  3. package/out/bundle_configless.css +99 -16
  4. package/out/complete.css +132 -22
  5. package/out/complete_configless.css +132 -22
  6. package/out/src/assets/fonts/DMMono-Regular.woff +0 -0
  7. package/out/src/assets/fonts/DMMono-Regular.woff2 +0 -0
  8. package/out/src/assets/fonts/fonts.css +7 -0
  9. package/out/src/assets/icons/ArrowRightSolid.svelte +1 -0
  10. package/out/src/assets/icons/arrow-right-solid.svg +1 -0
  11. package/out/src/assets/icons/favicon.png +0 -0
  12. package/out/src/assets/icons/favicon.svg +8 -0
  13. package/out/src/assets/logos/nordcode-logo-icon.svg +3 -0
  14. package/out/src/assets/logos/nordcode-logo.svg +17 -0
  15. package/out/src/modules/copyButtons/ts/copyButtons.ts +9 -0
  16. package/out/src/modules/dialogs/svelte/dialog.svelte +27 -0
  17. package/out/src/modules/dialogs/ts/LICENCE +171 -0
  18. package/out/src/modules/dialogs/ts/dialogs.ts +111 -0
  19. package/out/src/modules/notifications/js/notifications.js +294 -0
  20. package/out/src/modules/notifications/svelte/NotificationCenter.svelte +18 -0
  21. package/out/src/modules/notifications/svelte/NotificationTemplate.svelte +16 -0
  22. package/out/src/modules/sectionObserver/ts/sectionOberserver.ts +34 -0
  23. package/out/src/styles/bundle.css +7 -0
  24. package/out/src/styles/bundle_configless.css +5 -0
  25. package/out/src/styles/complete.css +5 -0
  26. package/out/src/styles/complete_configless.css +5 -0
  27. package/out/src/styles/components/alerts.css +20 -0
  28. package/out/src/styles/components/badges.css +14 -0
  29. package/out/src/styles/components/breadcrumbs.css +37 -0
  30. package/out/src/styles/components/bundle.css +13 -0
  31. package/out/src/styles/components/buttons.css +260 -0
  32. package/out/src/styles/components/card.css +55 -0
  33. package/out/src/styles/components/dialogs.css +138 -0
  34. package/out/src/styles/components/forms.css +41 -0
  35. package/out/src/styles/components/gallery.css +66 -0
  36. package/out/src/styles/components/icons.css +60 -0
  37. package/out/src/styles/components/inputs/base.css +249 -0
  38. package/out/src/styles/components/inputs/bundle.css +5 -0
  39. package/out/src/styles/components/inputs/fields.css +76 -0
  40. package/out/src/styles/components/inputs/segmented.css +114 -0
  41. package/out/src/styles/components/inputs/switch.css +42 -0
  42. package/out/src/styles/components/inputs/tag-select.css +41 -0
  43. package/out/src/styles/components/lists.css +40 -0
  44. package/out/src/styles/components/notifications.css +135 -0
  45. package/out/src/styles/components/tables.css +7 -0
  46. package/out/src/styles/config/bundle.css +2 -0
  47. package/out/src/styles/config/config.css +700 -0
  48. package/out/src/styles/config/extras.css +12 -0
  49. package/out/src/styles/exceptions/bundle.css +3 -0
  50. package/out/src/styles/exceptions/misc.css +21 -0
  51. package/out/src/styles/exceptions/spacings.css +15 -0
  52. package/out/src/styles/exceptions/typography.css +57 -0
  53. package/out/src/styles/theme/colors.css +165 -0
  54. package/out/src/styles/theme/colors_processed.css +87 -0
  55. package/out/src/styles/utils/base.css +415 -0
  56. package/out/src/styles/utils/bundle.css +6 -0
  57. package/out/src/styles/utils/easings.css +364 -0
  58. package/out/src/styles/utils/layouts.css +281 -0
  59. package/out/src/styles/utils/media.css +55 -0
  60. package/out/src/styles/utils/reset.css +145 -0
  61. package/out/src/styles/utils/theme.css +125 -0
  62. package/package.json +1 -1
  63. package/src/styles/components/card.css +29 -0
  64. package/src/styles/exceptions/typography.css +15 -0
  65. package/src/styles/utils/base.css +103 -9
  66. package/src/styles/utils/reset.css +4 -6
@@ -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.2.0",
16
16
  "publishConfig": {
17
17
  "access": "public"
18
18
  },
@@ -52,4 +52,33 @@
52
52
  }
53
53
  }
54
54
  }
55
+
56
+ :where(.nc-clickable-card) {
57
+ cursor: pointer;
58
+ position: relative;
59
+
60
+ &:focus-within,
61
+ &:hover {
62
+ outline: var(--border-width-medium) solid var(--color-brand-primary-base);
63
+ }
64
+
65
+ & a[data-link="main"] {
66
+ text-decoration: none;
67
+
68
+ &:focus-within:focus-visible,
69
+ &:hover {
70
+ outline: none;
71
+ }
72
+
73
+ &:before {
74
+ content: "";
75
+ position: absolute;
76
+ inset: 0;
77
+ }
78
+ }
79
+
80
+ & a[data-link="extra"] {
81
+ position: relative;
82
+ }
83
+ }
55
84
  }
@@ -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
  }
@@ -26,7 +26,7 @@
26
26
  inline-size: 100%;
27
27
  max-inline-size: 100%;
28
28
  align-items: flex-start;
29
- word-break: break-word;
29
+ overflow-wrap: anywhere;
30
30
  container: description-list / inline-size;
31
31
  row-gap: 0.5lh;
32
32
  }
@@ -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) {
@@ -265,8 +271,7 @@
265
271
  tab-size: 4;
266
272
  text-align: left;
267
273
  word-spacing: normal;
268
- word-break: normal;
269
- word-wrap: normal;
274
+ overflow-wrap: normal;
270
275
  font-style: normal;
271
276
  }
272
277
 
@@ -380,6 +385,10 @@
380
385
  background-color: var(--color-surface-muted);
381
386
  }
382
387
 
388
+ :where(td, math, time[datetime*=":"]) {
389
+ font-variant-numeric: tabular-nums lining-nums slashed-zero;
390
+ }
391
+
383
392
  :target {
384
393
  scroll-margin-block-start: 2ex;
385
394
  }
@@ -412,4 +421,89 @@
412
421
  :where(li > :is(ul, ol)) {
413
422
  margin-block-start: 0.25lh;
414
423
  }
424
+
425
+ @supports (font-variant-position: sub) {
426
+ :where(sub) {
427
+ vertical-align: baseline;
428
+ font-size: 100%;
429
+ line-height: inherit;
430
+ font-variant-position: sub;
431
+ }
432
+ }
433
+ @supports (font-variant-position: super) {
434
+ :where(sup) {
435
+ vertical-align: baseline;
436
+ font-size: 100%;
437
+ line-height: inherit;
438
+ font-variant-position: super;
439
+ }
440
+ }
441
+
442
+ /*
443
+ 11. Quotes
444
+ */
445
+
446
+ :lang(en) > * {
447
+ quotes: "“" "”" "‘" "’";
448
+ }
449
+ :lang(de) > * {
450
+ quotes: "„" "“" "‚" "‘";
451
+ }
452
+
453
+ :where(q::before) {
454
+ content: open-quote;
455
+ }
456
+ :where(q::after) {
457
+ content: close-quote;
458
+ }
459
+
460
+ :where(.quoted p:first-of-type::before) {
461
+ content: "“";
462
+ }
463
+ :where(.quoted p:last-of-type::after) {
464
+ content: "”";
465
+ }
466
+
467
+ :where(.quoted p:first-of-type::before) {
468
+ margin-inline-start: -0.87ch;
469
+ }
470
+ :where(.quoted p) {
471
+ hanging-punctuation: first last;
472
+ }
473
+ @supports (hanging-punctuation: first last) {
474
+ :where(.quoted p:first-of-type::before) {
475
+ margin-inline-start: 0;
476
+ }
477
+ }
478
+
479
+ :where(.prose) {
480
+ hyphens: auto;
481
+ hyphenate-limit-chars: 7 4 3;
482
+ hyphenate-limit-lines: 2;
483
+ hyphenate-limit-zone: 8%;
484
+ hyphenate-limit-last: always;
485
+ text-wrap: pretty;
486
+ }
487
+
488
+ :where(.prose p) {
489
+ text-wrap: pretty;
490
+ font-variant-numeric: oldstyle-nums proportional-nums;
491
+ max-inline-size: var(--measure-base);
492
+ }
493
+
494
+ :where(
495
+ .prose pre,
496
+ .prose code,
497
+ .prose var,
498
+ .prose samp,
499
+ .prose kbd,
500
+ .prose h1,
501
+ .prose h2,
502
+ .prose h3,
503
+ .prose h4,
504
+ .prose h5,
505
+ .prose h6
506
+ ) {
507
+ hyphens: manual;
508
+ }
415
509
  }
@@ -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;