@ivds/core 0.1.1

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 (154) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +215 -0
  3. package/lib/all.css +6802 -0
  4. package/lib/all.min.css +1 -0
  5. package/lib/base/base.css +215 -0
  6. package/lib/base/base.min.css +1 -0
  7. package/lib/components/_breadcrumb-mixins.scss +173 -0
  8. package/lib/components/_button-mixin.scss +120 -0
  9. package/lib/components/_card-mixin.scss +196 -0
  10. package/lib/components/_checkbox-mixin.scss +208 -0
  11. package/lib/components/_footer-mixin.scss +385 -0
  12. package/lib/components/_header-mixin.scss +275 -0
  13. package/lib/components/_navigation-mixins.scss +270 -0
  14. package/lib/components/_notification-mixin.scss +239 -0
  15. package/lib/components/_pagination-mixins.scss +280 -0
  16. package/lib/components/_radio-button-mixin.scss +207 -0
  17. package/lib/components/_tag-mixin.scss +261 -0
  18. package/lib/components/_text-input-mixin.scss +203 -0
  19. package/lib/components/all.css +3005 -0
  20. package/lib/components/all.min.css +1 -0
  21. package/lib/components/breadcrumb/breadcrumb.css +141 -0
  22. package/lib/components/breadcrumb/breadcrumb.min.css +1 -0
  23. package/lib/components/button/button.css +221 -0
  24. package/lib/components/button/button.min.css +1 -0
  25. package/lib/components/card/card.css +236 -0
  26. package/lib/components/card/card.min.css +1 -0
  27. package/lib/components/checkbox/checkbox.css +305 -0
  28. package/lib/components/checkbox/checkbox.min.css +1 -0
  29. package/lib/components/footer/footer.css +466 -0
  30. package/lib/components/footer/footer.min.css +1 -0
  31. package/lib/components/header/header.css +274 -0
  32. package/lib/components/header/header.min.css +1 -0
  33. package/lib/components/navigation/navigation.css +214 -0
  34. package/lib/components/navigation/navigation.min.css +1 -0
  35. package/lib/components/notification/notification.css +253 -0
  36. package/lib/components/notification/notification.min.css +1 -0
  37. package/lib/components/pagination/pagination.css +221 -0
  38. package/lib/components/pagination/pagination.min.css +1 -0
  39. package/lib/components/radio-button/radio-button.css +326 -0
  40. package/lib/components/radio-button/radio-button.min.css +1 -0
  41. package/lib/components/tag/tag.css +367 -0
  42. package/lib/components/tag/tag.min.css +1 -0
  43. package/lib/components/text-input/text-input.css +243 -0
  44. package/lib/components/text-input/text-input.min.css +1 -0
  45. package/lib/icons/icon-arrow-left.css +139 -0
  46. package/lib/icons/icon-arrow-left.min.css +1 -0
  47. package/lib/icons/icon-arrow-right.css +139 -0
  48. package/lib/icons/icon-arrow-right.min.css +1 -0
  49. package/lib/icons/icon-check.css +139 -0
  50. package/lib/icons/icon-check.min.css +1 -0
  51. package/lib/icons/icon-close.css +140 -0
  52. package/lib/icons/icon-close.min.css +1 -0
  53. package/lib/icons/icon-error.css +140 -0
  54. package/lib/icons/icon-error.min.css +1 -0
  55. package/lib/icons/icon-info.css +140 -0
  56. package/lib/icons/icon-info.min.css +1 -0
  57. package/lib/icons/icon-success.css +139 -0
  58. package/lib/icons/icon-success.min.css +1 -0
  59. package/lib/icons/icon-warning.css +139 -0
  60. package/lib/icons/icon-warning.min.css +1 -0
  61. package/lib/icons/icons.css +1158 -0
  62. package/lib/icons/icons.min.css +1 -0
  63. package/lib/utils/_flex.scss +200 -0
  64. package/lib/utils/_grid.scss +211 -0
  65. package/lib/utils/_layout.scss +253 -0
  66. package/lib/utils/_spacing.scss +260 -0
  67. package/lib/utils/_typography.scss +111 -0
  68. package/lib/utils/utils.css +2434 -0
  69. package/lib/utils/utils.min.css +1 -0
  70. package/lib/utils-only.css +2801 -0
  71. package/lib/utils-only.min.css +1 -0
  72. package/lib/variables/variables.css +2 -0
  73. package/lib/variables/variables.min.css +0 -0
  74. package/package.json +194 -0
  75. package/src/__tests__/example.test.scss +12 -0
  76. package/src/accessibility.stories.js +416 -0
  77. package/src/all.scss +9 -0
  78. package/src/base/_layout.scss +97 -0
  79. package/src/base/_reset.scss +85 -0
  80. package/src/base/_typography.scss +105 -0
  81. package/src/base/base.scss +6 -0
  82. package/src/components/all.scss +22 -0
  83. package/src/components/breadcrumb/_breadcrumb-mixins.scss +173 -0
  84. package/src/components/breadcrumb/breadcrumb.scss +68 -0
  85. package/src/components/breadcrumb/breadcrumb.stories.js +483 -0
  86. package/src/components/button/__tests__/button-mixins.test.scss +35 -0
  87. package/src/components/button/_button-mixin.scss +120 -0
  88. package/src/components/button/button.scss +126 -0
  89. package/src/components/button/button.stories.js +364 -0
  90. package/src/components/card/__tests__/card-mixins.test.scss +36 -0
  91. package/src/components/card/_card-mixin.scss +196 -0
  92. package/src/components/card/card.scss +193 -0
  93. package/src/components/card/card.stories.js +635 -0
  94. package/src/components/checkbox/_checkbox-mixin.scss +208 -0
  95. package/src/components/checkbox/checkbox.scss +141 -0
  96. package/src/components/checkbox/checkbox.stories.js +303 -0
  97. package/src/components/footer/_footer-mixin.scss +385 -0
  98. package/src/components/footer/footer.scss +86 -0
  99. package/src/components/footer/footer.stories.js +740 -0
  100. package/src/components/header/_header-mixin.scss +275 -0
  101. package/src/components/header/header.scss +84 -0
  102. package/src/components/header/header.stories.js +450 -0
  103. package/src/components/navigation/_navigation-mixins.scss +270 -0
  104. package/src/components/navigation/navigation.scss +64 -0
  105. package/src/components/navigation/navigation.stories.js +410 -0
  106. package/src/components/notification/_notification-mixin.scss +239 -0
  107. package/src/components/notification/notification.scss +118 -0
  108. package/src/components/notification/notification.stories.js +378 -0
  109. package/src/components/overview.stories.js +473 -0
  110. package/src/components/pagination/_pagination-mixins.scss +280 -0
  111. package/src/components/pagination/pagination.scss +76 -0
  112. package/src/components/pagination/pagination.stories.js +729 -0
  113. package/src/components/radio-button/_radio-button-mixin.scss +207 -0
  114. package/src/components/radio-button/radio-button.scss +178 -0
  115. package/src/components/radio-button/radio-button.stories.js +379 -0
  116. package/src/components/tag/_tag-mixin.scss +261 -0
  117. package/src/components/tag/tag.scss +244 -0
  118. package/src/components/tag/tag.stories.js +482 -0
  119. package/src/components/text-input/_text-input-mixin.scss +203 -0
  120. package/src/components/text-input/text-input.scss +150 -0
  121. package/src/components/text-input/text-input.stories.js +723 -0
  122. package/src/icons/_icon.scss +121 -0
  123. package/src/icons/icon-arrow-left.scss +23 -0
  124. package/src/icons/icon-arrow-right.scss +23 -0
  125. package/src/icons/icon-check.scss +23 -0
  126. package/src/icons/icon-close.scss +24 -0
  127. package/src/icons/icon-error.scss +24 -0
  128. package/src/icons/icon-info.scss +24 -0
  129. package/src/icons/icon-success.scss +23 -0
  130. package/src/icons/icon-warning.scss +23 -0
  131. package/src/icons/icons.scss +12 -0
  132. package/src/icons/icons.stories.js +249 -0
  133. package/src/icons/svg/arrow-left.svg +3 -0
  134. package/src/icons/svg/arrow-right.svg +3 -0
  135. package/src/icons/svg/check.svg +3 -0
  136. package/src/icons/svg/close.svg +4 -0
  137. package/src/icons/svg/error.svg +5 -0
  138. package/src/icons/svg/info.svg +5 -0
  139. package/src/icons/svg/success.svg +4 -0
  140. package/src/icons/svg/warning.svg +5 -0
  141. package/src/utils/__tests__/utilities.test.scss +37 -0
  142. package/src/utils/_flex.scss +200 -0
  143. package/src/utils/_grid.scss +211 -0
  144. package/src/utils/_layout.scss +253 -0
  145. package/src/utils/_spacing.scss +260 -0
  146. package/src/utils/_typography.scss +111 -0
  147. package/src/utils/utils.scss +8 -0
  148. package/src/variables/_borders.scss +15 -0
  149. package/src/variables/_breakpoints.scss +11 -0
  150. package/src/variables/_colors.scss +97 -0
  151. package/src/variables/_shadows.scss +14 -0
  152. package/src/variables/_spacing.scss +24 -0
  153. package/src/variables/_typography.scss +47 -0
  154. package/src/variables/variables.scss +9 -0
@@ -0,0 +1,105 @@
1
+ // Base typography styles for IVDS Core
2
+ // Imports design tokens and sets up foundational text styles
3
+
4
+ @use '../variables/variables' as vars;
5
+
6
+ // Global typography defaults
7
+ body {
8
+ font-family: vars.$fontFamily-primary;
9
+ font-size: vars.$fontSize-base;
10
+ font-weight: vars.$fontWeight-normal;
11
+ line-height: vars.$lineHeight-normal;
12
+ color: vars.$color-semantic-neutral-900;
13
+ -webkit-font-smoothing: antialiased;
14
+ -moz-osx-font-smoothing: grayscale;
15
+ }
16
+
17
+ // Heading defaults
18
+ h1, h2, h3, h4, h5, h6 {
19
+ font-family: vars.$fontFamily-primary;
20
+ font-weight: vars.$fontWeight-semibold;
21
+ line-height: vars.$lineHeight-tight;
22
+ color: vars.$color-semantic-neutral-900;
23
+ margin-bottom: vars.$spacing-4;
24
+ }
25
+
26
+ h1 {
27
+ font-size: vars.$fontSize-4xl;
28
+ }
29
+
30
+ h2 {
31
+ font-size: vars.$fontSize-3xl;
32
+ }
33
+
34
+ h3 {
35
+ font-size: vars.$fontSize-2xl;
36
+ }
37
+
38
+ h4 {
39
+ font-size: vars.$fontSize-xl;
40
+ }
41
+
42
+ h5 {
43
+ font-size: vars.$fontSize-lg;
44
+ }
45
+
46
+ h6 {
47
+ font-size: vars.$fontSize-base;
48
+ }
49
+
50
+ // Paragraph defaults
51
+ p {
52
+ margin-bottom: vars.$spacing-4;
53
+
54
+ &:last-child {
55
+ margin-bottom: 0;
56
+ }
57
+ }
58
+
59
+ // Link defaults
60
+ a {
61
+ color: vars.$color-brand-primary-600;
62
+ text-decoration: underline;
63
+
64
+ &:hover {
65
+ color: vars.$color-brand-primary-700;
66
+ }
67
+
68
+ &:focus {
69
+ outline: 2px solid vars.$color-brand-primary-500;
70
+ outline-offset: 2px;
71
+ }
72
+ }
73
+
74
+ // Code and pre defaults
75
+ code {
76
+ font-family: vars.$fontFamily-secondary;
77
+ font-size: vars.$fontSize-sm;
78
+ background-color: vars.$color-semantic-neutral-100;
79
+ padding: vars.$spacing-1 vars.$spacing-2;
80
+ border-radius: vars.$borderRadius-sm;
81
+ }
82
+
83
+ pre {
84
+ font-family: vars.$fontFamily-secondary;
85
+ font-size: vars.$fontSize-sm;
86
+ background-color: vars.$color-semantic-neutral-100;
87
+ padding: vars.$spacing-4;
88
+ border-radius: vars.$borderRadius-md;
89
+ overflow-x: auto;
90
+
91
+ code {
92
+ background-color: transparent;
93
+ padding: 0;
94
+ }
95
+ }
96
+
97
+ // IVDS scoped typography class
98
+ .ivds-typography {
99
+ font-family: vars.$fontFamily-primary;
100
+ font-size: vars.$fontSize-base;
101
+ line-height: vars.$lineHeight-normal;
102
+ color: vars.$color-semantic-neutral-900;
103
+ -webkit-font-smoothing: antialiased;
104
+ -moz-osx-font-smoothing: grayscale;
105
+ }
@@ -0,0 +1,6 @@
1
+ // Base styles entry point
2
+ // This file imports all base styles for the IVDS Core package
3
+
4
+ @use 'reset';
5
+ @use 'typography';
6
+ @use 'layout';
@@ -0,0 +1,22 @@
1
+ // All components bundle
2
+ // This file imports all component styles for the IVDS Core package
3
+
4
+ // Form components
5
+ @use './button/button.scss';
6
+ @use './text-input/text-input.scss';
7
+ @use './checkbox/checkbox.scss';
8
+ @use './radio-button/radio-button.scss';
9
+
10
+ // Content and layout components
11
+ @use './card/card.scss';
12
+ @use './notification/notification.scss';
13
+ @use './tag/tag.scss';
14
+
15
+ // Navigation components
16
+ @use './breadcrumb/breadcrumb.scss';
17
+ @use './navigation/navigation.scss';
18
+ @use './pagination/pagination.scss';
19
+
20
+ // Structural components
21
+ @use './header/header.scss';
22
+ @use './footer/footer.scss';
@@ -0,0 +1,173 @@
1
+ // Breadcrumb component mixins and private styles
2
+ // This file contains mixins for breadcrumb variants and internal utilities
3
+
4
+ @use '../../variables/variables' as vars;
5
+
6
+ // Base breadcrumb mixin with common styles
7
+ @mixin breadcrumb-base {
8
+ --separator-content: '/';
9
+ --separator-spacing: var(--spacing-2, 0.5rem);
10
+ --link-color: var(--color-brand-primary-500, #f97316);
11
+ --link-color-hover: var(--color-brand-primary-600, #ea580c);
12
+ --current-color: var(--color-semantic-neutral-700, #404040);
13
+ --separator-color: var(--color-semantic-neutral-500, #737373);
14
+
15
+ display: flex;
16
+ align-items: center;
17
+ flex-wrap: wrap;
18
+ font-size: var(--fontSize-sm, 0.875rem);
19
+ line-height: var(--lineHeight-normal, 1.5);
20
+ }
21
+
22
+ // Breadcrumb list mixin
23
+ @mixin breadcrumb-list {
24
+ display: flex;
25
+ align-items: center;
26
+ flex-wrap: wrap;
27
+ margin: 0;
28
+ padding: 0;
29
+ list-style: none;
30
+ gap: 0;
31
+ }
32
+
33
+ // Breadcrumb item mixin
34
+ @mixin breadcrumb-item {
35
+ display: flex;
36
+ align-items: center;
37
+
38
+ &:not(:last-child)::after {
39
+ content: var(--separator-content);
40
+ margin: 0 var(--separator-spacing);
41
+ color: var(--separator-color);
42
+ font-weight: var(--fontWeight-normal, 400);
43
+ user-select: none;
44
+ pointer-events: none;
45
+ }
46
+ }
47
+
48
+ // Breadcrumb link mixin
49
+ @mixin breadcrumb-link {
50
+ color: var(--link-color);
51
+ text-decoration: none;
52
+ transition: all 0.15s ease-in-out;
53
+ border-radius: var(--borderRadius-md, 0.375rem);
54
+ padding: var(--spacing-1, 0.25rem) var(--spacing-2, 0.5rem);
55
+ margin: calc(-1 * var(--spacing-1, 0.25rem)) calc(-1 * var(--spacing-2, 0.5rem));
56
+
57
+ &:hover {
58
+ color: var(--link-color-hover);
59
+ text-decoration: underline;
60
+ background-color: var(--color-brand-primary-50, #fff7ed);
61
+ }
62
+
63
+ &:focus {
64
+ outline: 2px solid var(--color-brand-primary-500, #f97316);
65
+ outline-offset: 2px;
66
+ text-decoration: none;
67
+ }
68
+
69
+ &:active {
70
+ background-color: var(--color-brand-primary-100, #ffedd5);
71
+ }
72
+ }
73
+
74
+ // Current page mixin
75
+ @mixin breadcrumb-current {
76
+ color: var(--current-color);
77
+ font-weight: var(--fontWeight-medium, 500);
78
+ padding: var(--spacing-1, 0.25rem) var(--spacing-2, 0.5rem);
79
+ margin: calc(-1 * var(--spacing-1, 0.25rem)) calc(-1 * var(--spacing-2, 0.5rem));
80
+ }
81
+
82
+ // Breadcrumb separator variants
83
+ @mixin breadcrumb-separator-arrow {
84
+ --separator-content: '→';
85
+ }
86
+
87
+ @mixin breadcrumb-separator-chevron {
88
+ --separator-content: '›';
89
+ }
90
+
91
+ @mixin breadcrumb-separator-bullet {
92
+ --separator-content: '•';
93
+ }
94
+
95
+ // Breadcrumb size variants
96
+ @mixin breadcrumb-small {
97
+ --separator-spacing: var(--spacing-1, 0.25rem);
98
+
99
+ font-size: var(--fontSize-xs, 0.75rem);
100
+ }
101
+
102
+ @mixin breadcrumb-large {
103
+ --separator-spacing: var(--spacing-3, 0.75rem);
104
+
105
+ font-size: var(--fontSize-base, 1rem);
106
+ }
107
+
108
+ // Breadcrumb theme variants
109
+ @mixin breadcrumb-theme-dark {
110
+ --link-color: var(--color-brand-primary-400, #fb923c);
111
+ --link-color-hover: var(--color-brand-primary-300, #fdba74);
112
+ --current-color: var(--color-semantic-neutral-200, #e5e5e5);
113
+ --separator-color: var(--color-semantic-neutral-400, #a3a3a3);
114
+ }
115
+
116
+ @mixin breadcrumb-theme-muted {
117
+ --link-color: var(--color-semantic-neutral-600, #525252);
118
+ --link-color-hover: var(--color-semantic-neutral-700, #404040);
119
+ --current-color: var(--color-semantic-neutral-800, #262626);
120
+ --separator-color: var(--color-semantic-neutral-400, #a3a3a3);
121
+ }
122
+
123
+ // Breadcrumb with icons
124
+ @mixin breadcrumb-with-icons {
125
+ .ivds-breadcrumb__link,
126
+ .ivds-breadcrumb__current {
127
+ display: flex;
128
+ align-items: center;
129
+ gap: var(--spacing-1, 0.25rem);
130
+ }
131
+
132
+ .ivds-breadcrumb__icon {
133
+ width: 1em;
134
+ height: 1em;
135
+ flex-shrink: 0;
136
+ }
137
+ }
138
+
139
+ // Responsive breadcrumb behavior
140
+ @mixin breadcrumb-responsive {
141
+ @media (max-width: 640px) {
142
+ .ivds-breadcrumb__list {
143
+ flex-wrap: wrap;
144
+ }
145
+
146
+ .ivds-breadcrumb__item {
147
+ &:nth-last-child(2)::after {
148
+ content: '...';
149
+ margin: 0 var(--separator-spacing);
150
+ color: var(--separator-color);
151
+ }
152
+
153
+ &:not(:last-child, :nth-last-child(2))::after {
154
+ display: none;
155
+ }
156
+
157
+ &:not(:last-child, :nth-last-child(2)) {
158
+ display: none;
159
+ }
160
+ }
161
+ }
162
+ }
163
+
164
+ // Breadcrumb truncation for long paths
165
+ @mixin breadcrumb-truncate {
166
+ .ivds-breadcrumb__link,
167
+ .ivds-breadcrumb__current {
168
+ max-width: 200px;
169
+ overflow: hidden;
170
+ text-overflow: ellipsis;
171
+ white-space: nowrap;
172
+ }
173
+ }
@@ -0,0 +1,68 @@
1
+ // Breadcrumb component styles
2
+ // Provides styling for the IVDS breadcrumb component following Helsinki Design System patterns
3
+
4
+ @use 'breadcrumb-mixins' as breadcrumb;
5
+
6
+ .ivds-breadcrumb {
7
+ @include breadcrumb.breadcrumb-base;
8
+
9
+ &__list {
10
+ @include breadcrumb.breadcrumb-list;
11
+ }
12
+
13
+ &__item {
14
+ @include breadcrumb.breadcrumb-item;
15
+ }
16
+
17
+ &__link {
18
+ @include breadcrumb.breadcrumb-link;
19
+ }
20
+
21
+ &__current {
22
+ @include breadcrumb.breadcrumb-current;
23
+ }
24
+
25
+ // Size variants
26
+ &--small {
27
+ @include breadcrumb.breadcrumb-small;
28
+ }
29
+
30
+ &--large {
31
+ @include breadcrumb.breadcrumb-large;
32
+ }
33
+
34
+ // Separator variants
35
+ &--separator-arrow {
36
+ @include breadcrumb.breadcrumb-separator-arrow;
37
+ }
38
+
39
+ &--separator-chevron {
40
+ @include breadcrumb.breadcrumb-separator-chevron;
41
+ }
42
+
43
+ &--separator-bullet {
44
+ @include breadcrumb.breadcrumb-separator-bullet;
45
+ }
46
+
47
+ // Theme variants
48
+ &--theme-dark {
49
+ @include breadcrumb.breadcrumb-theme-dark;
50
+ }
51
+
52
+ &--theme-muted {
53
+ @include breadcrumb.breadcrumb-theme-muted;
54
+ }
55
+
56
+ // Feature variants
57
+ &--with-icons {
58
+ @include breadcrumb.breadcrumb-with-icons;
59
+ }
60
+
61
+ &--responsive {
62
+ @include breadcrumb.breadcrumb-responsive;
63
+ }
64
+
65
+ &--truncate {
66
+ @include breadcrumb.breadcrumb-truncate;
67
+ }
68
+ }