@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,275 @@
1
+ // Header component mixins and private styles
2
+ // This file contains mixins for header layout, branding, and responsive behavior
3
+
4
+ @use '../../variables/variables' as vars;
5
+
6
+ // Base header mixin with common layout styles
7
+ @mixin header-base {
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: space-between;
11
+ padding: var(--spacing-4, 1rem) var(--spacing-6, 1.5rem);
12
+ background-color: var(--color-semantic-neutral-25, #fcfcfd);
13
+ border-bottom: var(--borderWidth-1, 1px) solid var(--color-semantic-neutral-200, #e2e8f0);
14
+ min-height: 64px;
15
+
16
+ // Ensure proper z-index for overlays
17
+ position: relative;
18
+ z-index: 10;
19
+ }
20
+
21
+ // Header layout mixin for different arrangements
22
+ @mixin header-layout($justify: space-between, $gap: var(--spacing-6, 1.5rem)) {
23
+ justify-content: $justify;
24
+ gap: $gap;
25
+
26
+ // Responsive behavior
27
+ @media (max-width: 768px) {
28
+ flex-wrap: wrap;
29
+ padding: var(--spacing-3, 0.75rem) var(--spacing-4, 1rem);
30
+ min-height: 56px;
31
+ }
32
+ }
33
+
34
+ // Branding area mixin
35
+ @mixin header-brand($logo-size: 2rem, $text-size: var(--fontSize-lg, 1.125rem)) {
36
+ display: flex;
37
+ align-items: center;
38
+ flex-shrink: 0;
39
+
40
+ &-logo {
41
+ height: $logo-size;
42
+ width: auto;
43
+ margin-right: var(--spacing-3, 0.75rem);
44
+
45
+ @media (max-width: 768px) {
46
+ height: calc(#{$logo-size} * 0.875);
47
+ margin-right: var(--spacing-2, 0.5rem);
48
+ }
49
+ }
50
+
51
+ &-text {
52
+ font-size: $text-size;
53
+ font-weight: var(--fontWeight-bold, 700);
54
+ color: var(--color-semantic-neutral-900, #0f172a);
55
+ text-decoration: none;
56
+ line-height: var(--lineHeight-tight, 1.25);
57
+
58
+ &:hover {
59
+ color: var(--color-brand-primary-600, #ea580c);
60
+ }
61
+
62
+ &:focus {
63
+ outline: 2px solid var(--color-brand-primary-500, #f97316);
64
+ outline-offset: 2px;
65
+ border-radius: var(--borderRadius-sm, 0.25rem);
66
+ }
67
+
68
+ @media (max-width: 768px) {
69
+ font-size: var(--fontSize-base, 1rem);
70
+ }
71
+ }
72
+ }
73
+
74
+ // Navigation area mixin
75
+ @mixin header-nav($gap: var(--spacing-6, 1.5rem)) {
76
+ display: flex;
77
+ align-items: center;
78
+ gap: $gap;
79
+ flex: 1;
80
+ justify-content: center;
81
+
82
+ @media (max-width: 768px) {
83
+ display: none; // Hide on mobile by default
84
+
85
+ &--mobile-visible {
86
+ display: flex;
87
+ flex-basis: 100%;
88
+ order: 3;
89
+ justify-content: flex-start;
90
+ margin-top: var(--spacing-3, 0.75rem);
91
+ padding-top: var(--spacing-3, 0.75rem);
92
+ border-top: var(--borderWidth-1, 1px) solid var(--color-semantic-neutral-200, #e2e8f0);
93
+ gap: var(--spacing-4, 1rem);
94
+ }
95
+ }
96
+
97
+ a {
98
+ color: var(--color-semantic-neutral-700, #374151);
99
+ text-decoration: none;
100
+ font-weight: var(--fontWeight-medium, 500);
101
+ font-size: var(--fontSize-sm, 0.875rem);
102
+ padding: var(--spacing-2, 0.5rem) var(--spacing-3, 0.75rem);
103
+ border-radius: var(--borderRadius-md, 0.375rem);
104
+ transition: all 0.15s ease-in-out;
105
+
106
+ &:hover {
107
+ color: var(--color-brand-primary-600, #ea580c);
108
+ background-color: var(--color-brand-primary-50, #fff7ed);
109
+ }
110
+
111
+ &:focus {
112
+ outline: 2px solid var(--color-brand-primary-500, #f97316);
113
+ outline-offset: 2px;
114
+ }
115
+
116
+ &[aria-current="page"] {
117
+ color: var(--color-brand-primary-600, #ea580c);
118
+ background-color: var(--color-brand-primary-100, #fed7aa);
119
+ font-weight: var(--fontWeight-semibold, 600);
120
+ }
121
+ }
122
+ }
123
+
124
+ // Actions area mixin
125
+ @mixin header-actions($gap: var(--spacing-3, 0.75rem)) {
126
+ display: flex;
127
+ align-items: center;
128
+ gap: $gap;
129
+ flex-shrink: 0;
130
+
131
+ @media (max-width: 768px) {
132
+ gap: var(--spacing-2, 0.5rem);
133
+ }
134
+ }
135
+
136
+ // Sticky header mixin
137
+ @mixin header-sticky($shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05))) {
138
+ position: sticky;
139
+ top: 0;
140
+ z-index: 50;
141
+ box-shadow: $shadow;
142
+ backdrop-filter: blur(8px);
143
+ background-color: rgba(252, 252, 253, 0.95);
144
+
145
+ @supports not (backdrop-filter: blur(8px)) {
146
+ background-color: var(--color-semantic-neutral-25, #fcfcfd);
147
+ }
148
+ }
149
+
150
+ // Header variant for different themes
151
+ @mixin header-theme($bg-color, $border-color, $text-color) {
152
+ background-color: $bg-color;
153
+ border-bottom-color: $border-color;
154
+
155
+ .ivds-header__brand-text {
156
+ color: $text-color;
157
+ }
158
+
159
+ .ivds-header__nav a {
160
+ color: $text-color;
161
+
162
+ &:hover {
163
+ background-color: rgba($text-color, 0.1);
164
+ }
165
+ }
166
+ }
167
+
168
+ // Dark theme header
169
+ @mixin header-dark {
170
+ @include header-theme(
171
+ var(--color-semantic-neutral-900, #0f172a),
172
+ var(--color-semantic-neutral-700, #374151),
173
+ var(--color-semantic-neutral-50, #f8fafc)
174
+ );
175
+ }
176
+
177
+ // Transparent header mixin
178
+ @mixin header-transparent {
179
+ background-color: transparent;
180
+ border-bottom: none;
181
+ backdrop-filter: none;
182
+
183
+ &.ivds-header--sticky {
184
+ background-color: rgba(252, 252, 253, 0.95);
185
+ border-bottom: var(--borderWidth-1, 1px) solid var(--color-semantic-neutral-200, #e2e8f0);
186
+ backdrop-filter: blur(8px);
187
+ }
188
+ }
189
+
190
+ // Compact header mixin for reduced height
191
+ @mixin header-compact {
192
+ padding: var(--spacing-2, 0.5rem) var(--spacing-4, 1rem);
193
+ min-height: 48px;
194
+
195
+ .ivds-header__brand {
196
+ &-logo {
197
+ height: 1.5rem;
198
+ margin-right: var(--spacing-2, 0.5rem);
199
+ }
200
+
201
+ &-text {
202
+ font-size: var(--fontSize-base, 1rem);
203
+ }
204
+ }
205
+
206
+ .ivds-header__nav {
207
+ gap: var(--spacing-4, 1rem);
208
+
209
+ a {
210
+ padding: var(--spacing-1, 0.25rem) var(--spacing-2, 0.5rem);
211
+ font-size: var(--fontSize-xs, 0.75rem);
212
+ }
213
+ }
214
+
215
+ .ivds-header__actions {
216
+ gap: var(--spacing-2, 0.5rem);
217
+ }
218
+ }
219
+
220
+ // Mobile menu toggle mixin
221
+ @mixin header-mobile-toggle {
222
+ display: none;
223
+ background: none;
224
+ border: none;
225
+ padding: var(--spacing-2, 0.5rem);
226
+ cursor: pointer;
227
+ color: var(--color-semantic-neutral-700, #374151);
228
+ border-radius: var(--borderRadius-md, 0.375rem);
229
+
230
+ &:hover {
231
+ background-color: var(--color-semantic-neutral-100, #f3f4f6);
232
+ }
233
+
234
+ &:focus {
235
+ outline: 2px solid var(--color-brand-primary-500, #f97316);
236
+ outline-offset: 2px;
237
+ }
238
+
239
+ @media (max-width: 768px) {
240
+ display: flex;
241
+ align-items: center;
242
+ justify-content: center;
243
+ }
244
+
245
+ svg {
246
+ width: 1.25rem;
247
+ height: 1.25rem;
248
+ }
249
+ }
250
+
251
+ // Responsive container mixin for header content
252
+ @mixin header-container($max-width: 1200px) {
253
+ max-width: $max-width;
254
+ margin: 0 auto;
255
+ width: 100%;
256
+ }
257
+
258
+ // Search integration mixin
259
+ @mixin header-search($flex-basis: 400px) {
260
+ flex: 1;
261
+ max-width: $flex-basis;
262
+ margin: 0 var(--spacing-4, 1rem);
263
+
264
+ @media (max-width: 768px) {
265
+ display: none;
266
+
267
+ &--mobile-visible {
268
+ display: block;
269
+ flex-basis: 100%;
270
+ order: 2;
271
+ margin: var(--spacing-3, 0.75rem) 0 0 0;
272
+ max-width: none;
273
+ }
274
+ }
275
+ }
@@ -0,0 +1,84 @@
1
+ // Header component styles
2
+ // Provides styling for the IVDS header component with layout and branding mixins
3
+
4
+ @use '_header-mixin' as header;
5
+
6
+ .ivds-header {
7
+ @include header.header-base;
8
+ @include header.header-layout;
9
+
10
+ // Brand area
11
+ &__brand {
12
+ @include header.header-brand;
13
+ }
14
+
15
+ // Navigation area
16
+ &__nav {
17
+ @include header.header-nav;
18
+ }
19
+
20
+ // Actions area
21
+ &__actions {
22
+ @include header.header-actions;
23
+ }
24
+
25
+ // Mobile menu toggle button
26
+ &__mobile-toggle {
27
+ @include header.header-mobile-toggle;
28
+ }
29
+
30
+ // Search area
31
+ &__search {
32
+ @include header.header-search;
33
+ }
34
+
35
+ // Container wrapper
36
+ &__container {
37
+ @include header.header-container;
38
+ @include header.header-layout;
39
+ }
40
+
41
+ // Variants
42
+ &--sticky {
43
+ @include header.header-sticky;
44
+ }
45
+
46
+ &--dark {
47
+ @include header.header-dark;
48
+ }
49
+
50
+ &--transparent {
51
+ @include header.header-transparent;
52
+ }
53
+
54
+ &--compact {
55
+ @include header.header-compact;
56
+ }
57
+
58
+ // Responsive navigation visibility
59
+ &--mobile-nav-open {
60
+ .ivds-header__nav {
61
+ @media (max-width: 768px) {
62
+ display: flex;
63
+ flex-basis: 100%;
64
+ order: 3;
65
+ justify-content: flex-start;
66
+ margin-top: var(--spacing-3, 0.75rem);
67
+ padding-top: var(--spacing-3, 0.75rem);
68
+ border-top: var(--borderWidth-1, 1px) solid var(--color-semantic-neutral-200, #e2e8f0);
69
+ gap: var(--spacing-4, 1rem);
70
+ flex-wrap: wrap;
71
+ }
72
+ }
73
+
74
+ .ivds-header__search--mobile-visible {
75
+ @media (max-width: 768px) {
76
+ display: block;
77
+ flex-basis: 100%;
78
+ order: 2;
79
+ margin: var(--spacing-3, 0.75rem) 0 0 0;
80
+ max-width: none;
81
+ }
82
+ }
83
+ }
84
+ }