@nordcode/ui 1.0.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 +157 -0
  2. package/LICENSE.md +661 -0
  3. package/README.md +90 -0
  4. package/index.html +1169 -0
  5. package/out/bundle.css +1400 -0
  6. package/out/bundle_configless.css +1135 -0
  7. package/out/colors.css +87 -0
  8. package/out/complete.css +2647 -0
  9. package/out/complete_configless.css +2382 -0
  10. package/package.json +73 -0
  11. package/src/assets/fonts/DMMono-Regular.woff +0 -0
  12. package/src/assets/fonts/DMMono-Regular.woff2 +0 -0
  13. package/src/assets/fonts/fonts.css +7 -0
  14. package/src/assets/icons/ArrowRightSolid.svelte +1 -0
  15. package/src/assets/icons/arrow-right-solid.svg +1 -0
  16. package/src/assets/icons/favicon.png +0 -0
  17. package/src/assets/icons/favicon.svg +8 -0
  18. package/src/assets/logos/nordcode-logo-icon.svg +3 -0
  19. package/src/assets/logos/nordcode-logo.svg +17 -0
  20. package/src/modules/copyButtons/ts/copyButtons.ts +9 -0
  21. package/src/modules/dialogs/svelte/dialog.svelte +27 -0
  22. package/src/modules/dialogs/ts/LICENCE +171 -0
  23. package/src/modules/dialogs/ts/dialogs.ts +111 -0
  24. package/src/modules/notifications/js/notifications.js +294 -0
  25. package/src/modules/notifications/svelte/NotificationCenter.svelte +18 -0
  26. package/src/modules/notifications/svelte/NotificationTemplate.svelte +16 -0
  27. package/src/modules/sectionObserver/ts/sectionOberserver.ts +34 -0
  28. package/src/styles/bundle.css +7 -0
  29. package/src/styles/bundle_configless.css +5 -0
  30. package/src/styles/complete.css +5 -0
  31. package/src/styles/complete_configless.css +5 -0
  32. package/src/styles/components/badges.css +14 -0
  33. package/src/styles/components/breadcrumbs.css +37 -0
  34. package/src/styles/components/bundle.css +12 -0
  35. package/src/styles/components/buttons.css +256 -0
  36. package/src/styles/components/card.css +55 -0
  37. package/src/styles/components/dialogs.css +116 -0
  38. package/src/styles/components/forms.css +47 -0
  39. package/src/styles/components/gallery.css +66 -0
  40. package/src/styles/components/icons.css +60 -0
  41. package/src/styles/components/inputs/base.css +258 -0
  42. package/src/styles/components/inputs/bundle.css +5 -0
  43. package/src/styles/components/inputs/fields.css +79 -0
  44. package/src/styles/components/inputs/segmented.css +123 -0
  45. package/src/styles/components/inputs/switch.css +42 -0
  46. package/src/styles/components/inputs/tag-select.css +44 -0
  47. package/src/styles/components/lists.css +40 -0
  48. package/src/styles/components/notifications.css +137 -0
  49. package/src/styles/components/tables.css +7 -0
  50. package/src/styles/config/bundle.css +2 -0
  51. package/src/styles/config/config.css +828 -0
  52. package/src/styles/config/extras.css +18 -0
  53. package/src/styles/exceptions/bundle.css +3 -0
  54. package/src/styles/exceptions/misc.css +21 -0
  55. package/src/styles/exceptions/spacings.css +15 -0
  56. package/src/styles/exceptions/typography.css +57 -0
  57. package/src/styles/theme/colors.css +178 -0
  58. package/src/styles/theme/colors_processed.css +87 -0
  59. package/src/styles/utils/base.css +406 -0
  60. package/src/styles/utils/bundle.css +6 -0
  61. package/src/styles/utils/easings.css +364 -0
  62. package/src/styles/utils/layouts.css +298 -0
  63. package/src/styles/utils/media.css +55 -0
  64. package/src/styles/utils/reset.css +128 -0
  65. package/src/styles/utils/theme.css +120 -0
  66. package/transform.js +71 -0
@@ -0,0 +1,128 @@
1
+ @layer reset {
2
+ *,
3
+ :after,
4
+ :before {
5
+ box-sizing: border-box;
6
+ accent-color: var(--color-brand-primary-base);
7
+ font-kerning: normal;
8
+ -moz-osx-font-smoothing: grayscale;
9
+ -webkit-font-smoothing: antialiased;
10
+ }
11
+
12
+ :where(:not(dialog)) {
13
+ margin: 0;
14
+ }
15
+
16
+ :where(:not(fieldset, progress, meter)) {
17
+ border-width: 0;
18
+ border-style: solid;
19
+ background-origin: border-box;
20
+ background-repeat: no-repeat;
21
+ }
22
+
23
+ :where(:focus-visible) {
24
+ transition: outline-offset var(--transition-duration-short) var(--ease-2);
25
+ }
26
+
27
+ :where(:focus-visible, :focus) {
28
+ outline: var(--border-width-medium) solid var(--color-brand-primary-base);
29
+ outline-offset: 1ch;
30
+ }
31
+
32
+ :where(:focus:not(:focus-visible)) {
33
+ outline: none;
34
+ }
35
+
36
+ :where(html) {
37
+ inline-size: 100%;
38
+ -moz-text-size-adjust: none;
39
+ -webkit-text-size-adjust: none;
40
+ text-size-adjust: none;
41
+ text-rendering: optimizeSpeed;
42
+ min-block-size: 100vh;
43
+ block-size: 100%;
44
+ }
45
+
46
+ :where(body) {
47
+ font-weight: var(--font-weight-default);
48
+ color: var(--color-text-base);
49
+ background-color: var(--color-surface-muted);
50
+ font-family: var(--font-family-default);
51
+ line-height: var(--line-height-base);
52
+ font-style: normal;
53
+ }
54
+
55
+ /* Remove default margin in favour of better control in authored CSS */
56
+ :where(body, h1, h2, h3, h4, p, figure, blockquote, dl, dd) {
57
+ margin: 0;
58
+ }
59
+
60
+ /* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
61
+ :where(ul[role="list"], ol[role="list"]) {
62
+ list-style: none;
63
+ }
64
+
65
+ /* Balance text wrapping on headings */
66
+ :where(h1, h2, h3, h4) {
67
+ text-wrap: balance;
68
+ }
69
+
70
+ /* A elements that don't have a class get default styles */
71
+ :where(a:not([class])) {
72
+ text-decoration-skip-ink: auto;
73
+ color: currentColor;
74
+ }
75
+
76
+ :where(img, svg, video, canvas, audio, iframe, embed, object) {
77
+ display: block;
78
+ }
79
+
80
+ :where(img, svg, video) {
81
+ max-inline-size: 100%;
82
+ block-size: auto;
83
+ }
84
+
85
+ :where(figure) {
86
+ display: grid;
87
+ gap: 0;
88
+ place-items: center;
89
+ }
90
+
91
+ :where(
92
+ a[href],
93
+ area,
94
+ button,
95
+ input,
96
+ label[for],
97
+ select,
98
+ summary,
99
+ textarea,
100
+ [tabindex]:not([tabindex*="-"])
101
+ ) {
102
+ cursor: pointer;
103
+ touch-action: manipulation;
104
+ -webkit-tap-highlight-color: transparent;
105
+ }
106
+
107
+ :where(input, button, textarea, select),
108
+ :where(input[type="file"])::-webkit-file-upload-button {
109
+ font: inherit;
110
+ color: inherit;
111
+ letter-spacing: inherit;
112
+ }
113
+
114
+ :where(label:not(class) + input, label:not(class) + select, label:not(class) + textarea) {
115
+ display: block;
116
+ }
117
+
118
+ :where(p, summary) {
119
+ max-inline-size: var(--measure-base);
120
+ font-size: inherit;
121
+ line-height: var(--line-height-base);
122
+ margin: 0;
123
+ }
124
+
125
+ :where(p) {
126
+ text-wrap: pretty;
127
+ }
128
+ }
@@ -0,0 +1,120 @@
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
+ }
package/transform.js ADDED
@@ -0,0 +1,71 @@
1
+ import fs from 'node:fs';
2
+ import browserslist from 'browserslist';
3
+ import { browserslistToTargets, bundle } from 'lightningcss';
4
+
5
+ const browserlistTargtsWidelyAvailable = [
6
+ 'Chrome > 0 and last 2.5 years',
7
+ 'ChromeAndroid > 0 and last 2.5 years',
8
+ 'Edge > 0 and last 2.5 years',
9
+ 'Firefox > 0 and last 2.5 years',
10
+ 'FirefoxAndroid > 0 and last 2.5 years',
11
+ 'Safari > 0 and last 2.5 years',
12
+ 'iOS > 0 and last 2.5 years',
13
+ 'not dead',
14
+ ];
15
+
16
+ const targets = browserslistToTargets(browserslist(browserlistTargtsWidelyAvailable));
17
+
18
+ const { code: colors } = bundle({
19
+ // ...
20
+ targets,
21
+ drafts: {
22
+ customMedia: true,
23
+ },
24
+ filename: 'src/styles/theme/colors.css',
25
+ });
26
+
27
+ fs.writeFileSync('out/colors.css', colors);
28
+
29
+ const { code } = bundle({
30
+ // ...
31
+ targets,
32
+ drafts: {
33
+ customMedia: true,
34
+ },
35
+ filename: 'src/styles/bundle.css',
36
+ });
37
+
38
+ fs.writeFileSync('out/bundle.css', code);
39
+
40
+ const { code: bundleConfigless } = bundle({
41
+ // ...
42
+ targets,
43
+ drafts: {
44
+ customMedia: true,
45
+ },
46
+ filename: 'src/styles/bundle_configless.css',
47
+ });
48
+
49
+ fs.writeFileSync('out/bundle_configless.css', bundleConfigless);
50
+
51
+ const { code: codeComplete } = bundle({
52
+ // ...
53
+ targets,
54
+ drafts: {
55
+ customMedia: true,
56
+ },
57
+ filename: 'src/styles/complete.css',
58
+ });
59
+
60
+ fs.writeFileSync('out/complete.css', codeComplete);
61
+
62
+ const { code: codeCompleteConfigless } = bundle({
63
+ // ...
64
+ targets,
65
+ drafts: {
66
+ customMedia: true,
67
+ },
68
+ filename: 'src/styles/complete_configless.css',
69
+ });
70
+
71
+ fs.writeFileSync('out/complete_configless.css', codeCompleteConfigless);