@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,196 @@
1
+ // Card component mixins and private styles
2
+ // This file contains mixins for card variants, sections, and internal utilities
3
+
4
+ @use '../../variables/variables' as vars;
5
+
6
+ // Base card mixin with common styles
7
+ @mixin card-base {
8
+ display: flex;
9
+ flex-direction: column;
10
+ background-color: var(--color-semantic-neutral-50, #fafafa);
11
+ border-radius: var(--borderRadius-xl, 0.75rem);
12
+ overflow: hidden;
13
+ transition: box-shadow 0.15s ease-in-out, transform 0.15s ease-in-out;
14
+ box-shadow: var(--shadow-sm, 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1));
15
+ }
16
+
17
+ // Card variant mixin
18
+ @mixin card-variant($bg-color, $border-color: null, $shadow: null) {
19
+ background-color: $bg-color;
20
+
21
+ @if $border-color {
22
+ border: var(--borderWidth-1, 1px) solid $border-color;
23
+ }
24
+
25
+ @if $shadow {
26
+ box-shadow: $shadow;
27
+ }
28
+ }
29
+
30
+ // Card section mixin
31
+ @mixin card-section($padding: var(--spacing-6, 1.5rem)) {
32
+ padding: $padding;
33
+ }
34
+
35
+ // Card header mixin
36
+ @mixin card-header($padding: var(--spacing-6, 1.5rem), $border-bottom: true) {
37
+ @include card-section($padding);
38
+
39
+ @if $border-bottom {
40
+ border-bottom: var(--borderWidth-1, 1px) solid var(--color-semantic-neutral-200, #e2e8f0);
41
+ }
42
+ }
43
+
44
+ // Card body mixin
45
+ @mixin card-body($padding: var(--spacing-6, 1.5rem)) {
46
+ @include card-section($padding);
47
+
48
+ flex: 1;
49
+ }
50
+
51
+ // Card footer mixin
52
+ @mixin card-footer($padding: var(--spacing-4, 1rem) var(--spacing-6, 1.5rem), $bg-color: var(--color-semantic-neutral-100, #f1f5f9), $border-top: true) {
53
+ @include card-section($padding);
54
+
55
+ background-color: $bg-color;
56
+
57
+ @if $border-top {
58
+ border-top: var(--borderWidth-1, 1px) solid var(--color-semantic-neutral-200, #e2e8f0);
59
+ }
60
+ }
61
+
62
+ // Card media mixin
63
+ @mixin card-media {
64
+ position: relative;
65
+ overflow: hidden;
66
+
67
+ img,
68
+ video {
69
+ width: 100%;
70
+ height: 100%;
71
+ object-fit: cover;
72
+ display: block;
73
+ }
74
+ }
75
+
76
+ // Card title mixin
77
+ @mixin card-title($font-size: var(--fontSize-lg, 1.125rem), $font-weight: var(--fontWeight-semibold, 600)) {
78
+ margin: 0 0 var(--spacing-2, 0.5rem) 0;
79
+ font-size: $font-size;
80
+ font-weight: $font-weight;
81
+ color: var(--color-semantic-neutral-900, #0f172a);
82
+ line-height: var(--lineHeight-tight, 1.25);
83
+ }
84
+
85
+ // Card subtitle mixin
86
+ @mixin card-subtitle($font-size: var(--fontSize-sm, 0.875rem)) {
87
+ margin: 0 0 var(--spacing-3, 0.75rem) 0;
88
+ font-size: $font-size;
89
+ color: var(--color-semantic-neutral-600, #4b5563);
90
+ line-height: var(--lineHeight-normal, 1.5);
91
+ }
92
+
93
+ // Card content mixin
94
+ @mixin card-content {
95
+ margin: 0;
96
+ color: var(--color-semantic-neutral-700, #334155);
97
+ line-height: var(--lineHeight-relaxed, 1.625);
98
+ }
99
+
100
+ // Card actions mixin
101
+ @mixin card-actions($justify: flex-start, $gap: var(--spacing-3, 0.75rem)) {
102
+ display: flex;
103
+ align-items: center;
104
+ justify-content: $justify;
105
+ gap: $gap;
106
+ margin-top: var(--spacing-4, 1rem);
107
+ }
108
+
109
+ // Card interactive mixin
110
+ @mixin card-interactive {
111
+ cursor: pointer;
112
+
113
+ &:hover {
114
+ transform: translateY(-2px);
115
+ box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05));
116
+ }
117
+
118
+ &:active {
119
+ transform: translateY(0);
120
+ }
121
+
122
+ &:focus {
123
+ outline: 2px solid var(--color-brand-primary-500, #0ea5e9);
124
+ outline-offset: 2px;
125
+ }
126
+ }
127
+
128
+ // Card size variants
129
+ @mixin card-compact {
130
+ .ivds-card__header {
131
+ @include card-header(var(--spacing-4, 1rem));
132
+ }
133
+
134
+ .ivds-card__body {
135
+ @include card-body(var(--spacing-4, 1rem));
136
+ }
137
+
138
+ .ivds-card__footer {
139
+ @include card-footer(var(--spacing-3, 0.75rem) var(--spacing-4, 1rem));
140
+ }
141
+ }
142
+
143
+ @mixin card-spacious {
144
+ .ivds-card__header {
145
+ @include card-header(var(--spacing-8, 2rem));
146
+ }
147
+
148
+ .ivds-card__body {
149
+ @include card-body(var(--spacing-8, 2rem));
150
+ }
151
+
152
+ .ivds-card__footer {
153
+ @include card-footer(var(--spacing-6, 1.5rem) var(--spacing-8, 2rem));
154
+ }
155
+ }
156
+
157
+ // Card horizontal layout mixin
158
+ @mixin card-horizontal {
159
+ flex-direction: row;
160
+
161
+ .ivds-card__media {
162
+ flex-shrink: 0;
163
+ width: 200px;
164
+ }
165
+
166
+ .ivds-card__content-wrapper {
167
+ display: flex;
168
+ flex-direction: column;
169
+ flex: 1;
170
+ }
171
+ }
172
+
173
+ // Card overlay mixin (for media cards)
174
+ @mixin card-overlay {
175
+ position: relative;
176
+
177
+ .ivds-card__overlay {
178
+ position: absolute;
179
+ top: 0;
180
+ left: 0;
181
+ right: 0;
182
+ bottom: 0;
183
+ background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
184
+ display: flex;
185
+ flex-direction: column;
186
+ justify-content: flex-end;
187
+ padding: var(--spacing-6, 1.5rem);
188
+ color: var(--color-semantic-neutral-50, #f8fafc);
189
+
190
+ .ivds-card__title,
191
+ .ivds-card__subtitle,
192
+ .ivds-card__content {
193
+ color: inherit;
194
+ }
195
+ }
196
+ }
@@ -0,0 +1,193 @@
1
+ // Card component styles
2
+ // Provides styling for the IVDS card component with all variants, sections, and states
3
+
4
+ @use '_card-mixin' as card;
5
+
6
+ // Card Base
7
+ .ivds-card {
8
+ @include card.card-base;
9
+ @include card.card-variant(
10
+ var(--color-semantic-neutral-50, #f8fafc),
11
+ var(--color-semantic-neutral-200, #e2e8f0),
12
+ var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05))
13
+ );
14
+
15
+ // Card sections
16
+ &__header {
17
+ @include card.card-header;
18
+ }
19
+
20
+ &__body {
21
+ @include card.card-body;
22
+ }
23
+
24
+ &__footer {
25
+ @include card.card-footer;
26
+ }
27
+
28
+ &__media {
29
+ @include card.card-media;
30
+ }
31
+
32
+ // Card content elements
33
+ &__title {
34
+ @include card.card-title;
35
+ }
36
+
37
+ &__subtitle {
38
+ @include card.card-subtitle;
39
+ }
40
+
41
+ &__content {
42
+ @include card.card-content;
43
+ }
44
+
45
+ &__actions {
46
+ @include card.card-actions;
47
+ }
48
+
49
+ // Content wrapper for horizontal cards
50
+ &__content-wrapper {
51
+ display: flex;
52
+ flex-direction: column;
53
+ flex: 1;
54
+ }
55
+
56
+ // Overlay for media cards
57
+ &__overlay {
58
+ position: absolute;
59
+ top: 0;
60
+ left: 0;
61
+ right: 0;
62
+ bottom: 0;
63
+ background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
64
+ display: flex;
65
+ flex-direction: column;
66
+ justify-content: flex-end;
67
+ padding: var(--spacing-6, 1.5rem);
68
+ color: var(--color-semantic-neutral-50, #f8fafc);
69
+
70
+ .ivds-card__title,
71
+ .ivds-card__subtitle,
72
+ .ivds-card__content {
73
+ color: inherit;
74
+ }
75
+ }
76
+ }
77
+
78
+ // Card Variants
79
+ .ivds-card--flat {
80
+ @include card.card-variant(
81
+ var(--color-semantic-neutral-50, #f8fafc),
82
+ transparent,
83
+ none
84
+ );
85
+ }
86
+
87
+ .ivds-card--bordered {
88
+ @include card.card-variant(
89
+ var(--color-semantic-neutral-50, #f8fafc),
90
+ var(--color-semantic-neutral-300, #cbd5e1),
91
+ none
92
+ );
93
+ }
94
+
95
+ .ivds-card--elevated {
96
+ @include card.card-variant(
97
+ var(--color-semantic-neutral-50, #f8fafc),
98
+ var(--color-semantic-neutral-200, #e2e8f0),
99
+ var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06))
100
+ );
101
+ }
102
+
103
+ .ivds-card--floating {
104
+ @include card.card-variant(
105
+ var(--color-semantic-neutral-50, #f8fafc),
106
+ transparent,
107
+ var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05))
108
+ );
109
+ }
110
+
111
+ // Interactive card
112
+ .ivds-card--interactive {
113
+ @include card.card-interactive;
114
+ }
115
+
116
+ // Card sizes
117
+ .ivds-card--compact {
118
+ @include card.card-compact;
119
+ }
120
+
121
+ .ivds-card--spacious {
122
+ @include card.card-spacious;
123
+ }
124
+
125
+ // Card layouts
126
+ .ivds-card--horizontal {
127
+ @include card.card-horizontal;
128
+ }
129
+
130
+ .ivds-card--overlay {
131
+ @include card.card-overlay;
132
+ }
133
+
134
+ // Card semantic variants
135
+ .ivds-card--success {
136
+ @include card.card-variant(
137
+ var(--color-semantic-success-50, #ecfdf5),
138
+ var(--color-semantic-success-200, #bbf7d0)
139
+ );
140
+
141
+ .ivds-card__title {
142
+ color: var(--color-semantic-success-800, #166534);
143
+ }
144
+
145
+ .ivds-card__content {
146
+ color: var(--color-semantic-success-700, #15803d);
147
+ }
148
+ }
149
+
150
+ .ivds-card--warning {
151
+ @include card.card-variant(
152
+ var(--color-semantic-warning-50, #fffbeb),
153
+ var(--color-semantic-warning-200, #fed7aa)
154
+ );
155
+
156
+ .ivds-card__title {
157
+ color: var(--color-semantic-warning-800, #92400e);
158
+ }
159
+
160
+ .ivds-card__content {
161
+ color: var(--color-semantic-warning-700, #b45309);
162
+ }
163
+ }
164
+
165
+ .ivds-card--error {
166
+ @include card.card-variant(
167
+ var(--color-semantic-error-50, #fef2f2),
168
+ var(--color-semantic-error-200, #fecaca)
169
+ );
170
+
171
+ .ivds-card__title {
172
+ color: var(--color-semantic-error-800, #991b1b);
173
+ }
174
+
175
+ .ivds-card__content {
176
+ color: var(--color-semantic-error-700, #b91c1c);
177
+ }
178
+ }
179
+
180
+ .ivds-card--info {
181
+ @include card.card-variant(
182
+ var(--color-semantic-info-50, #eff6ff),
183
+ var(--color-semantic-info-200, #bfdbfe)
184
+ );
185
+
186
+ .ivds-card__title {
187
+ color: var(--color-semantic-info-800, #1e40af);
188
+ }
189
+
190
+ .ivds-card__content {
191
+ color: var(--color-semantic-info-700, #1d4ed8);
192
+ }
193
+ }