@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,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,120 @@
1
+ // Button component mixins and private styles
2
+ // This file contains mixins for button variants, sizes, and internal utilities
3
+
4
+ @use '../../variables/variables' as vars;
5
+
6
+ // Base button mixin with common styles
7
+ @mixin button-base {
8
+ display: inline-flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ border: var(--borderWidth-1, 1px) solid transparent;
12
+ border-radius: var(--borderRadius-md, 0.375rem);
13
+ font-family: var(--fontFamily-sans, system-ui, -apple-system, sans-serif);
14
+ font-weight: var(--fontWeight-medium, 500);
15
+ line-height: var(--lineHeight-tight, 1.25);
16
+ text-decoration: none;
17
+ cursor: pointer;
18
+ transition: all 0.15s ease-in-out;
19
+ user-select: none;
20
+ white-space: nowrap;
21
+
22
+ &:focus {
23
+ outline: 2px solid var(--color-brand-primary-500, #f97316);
24
+ outline-offset: 2px;
25
+ }
26
+
27
+ &:disabled,
28
+ &[aria-disabled="true"] {
29
+ opacity: 0.5;
30
+ cursor: not-allowed;
31
+ pointer-events: none;
32
+ }
33
+ }
34
+
35
+ // Button variant mixin
36
+ @mixin button-variant($bg-color, $text-color, $border-color: transparent, $hover-bg: null, $hover-border: null) {
37
+ background-color: $bg-color;
38
+ color: $text-color;
39
+ border-color: $border-color;
40
+
41
+ @if $hover-bg {
42
+ &:hover:not(:disabled, [aria-disabled="true"]) {
43
+ background-color: $hover-bg;
44
+
45
+ @if $hover-border {
46
+ border-color: $hover-border;
47
+ }
48
+ }
49
+ }
50
+
51
+ &:active:not(:disabled, [aria-disabled="true"]) {
52
+ transform: translateY(1px);
53
+ }
54
+ }
55
+
56
+ // Button size mixin
57
+ @mixin button-size($padding-y, $padding-x, $font-size, $min-height: null) {
58
+ padding: $padding-y $padding-x;
59
+ font-size: $font-size;
60
+
61
+ @if $min-height {
62
+ min-height: $min-height;
63
+ }
64
+ }
65
+
66
+ // Icon spacing
67
+ @mixin button-icon-spacing($gap: var(--spacing-2, 0.5rem)) {
68
+ gap: $gap;
69
+
70
+ .ivds-button__icon {
71
+ display: inline-flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ flex-shrink: 0;
75
+ }
76
+ }
77
+
78
+ // Loading state
79
+ @mixin button-loading {
80
+ position: relative;
81
+ color: transparent !important;
82
+
83
+ &::after {
84
+ content: '';
85
+ position: absolute;
86
+ top: 50%;
87
+ left: 50%;
88
+ transform: translate(-50%, -50%);
89
+ width: 16px;
90
+ height: 16px;
91
+ border: 2px solid currentcolor;
92
+ border-radius: 50%;
93
+ border-top-color: transparent;
94
+ animation: ivds-button-spin 0.8s linear infinite;
95
+ }
96
+ }
97
+
98
+ // Keyframes for loading animation
99
+ @keyframes ivds-button-spin {
100
+ to {
101
+ transform: translate(-50%, -50%) rotate(360deg);
102
+ }
103
+ }
104
+
105
+ // Full width button mixin
106
+ @mixin button-full-width {
107
+ width: 100%;
108
+ justify-content: center;
109
+ }
110
+
111
+ // Icon-only button mixin
112
+ @mixin button-icon-only($size: 44px) {
113
+ width: $size;
114
+ height: $size;
115
+ padding: 0;
116
+
117
+ .ivds-button__icon {
118
+ margin: 0;
119
+ }
120
+ }
@@ -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,208 @@
1
+ // Checkbox component mixins and private styles
2
+ // This file contains mixins for checkbox variants, sizes, states, and internal utilities
3
+
4
+ @use '../../variables/variables' as vars;
5
+
6
+ // Base checkbox mixin with common styles
7
+ @mixin checkbox-base {
8
+ position: relative;
9
+ display: inline-flex;
10
+ align-items: flex-start;
11
+ cursor: pointer;
12
+ user-select: none;
13
+
14
+ &:hover .ivds-checkbox__box {
15
+ border-color: var(--color-brand-primary-400, #fb923c);
16
+ }
17
+ }
18
+
19
+ // Hidden input mixin
20
+ @mixin checkbox-input {
21
+ position: absolute;
22
+ opacity: 0;
23
+ width: 1px;
24
+ height: 1px;
25
+ margin: 0;
26
+ padding: 0;
27
+ border: 0;
28
+ clip: rect(0, 0, 0, 0);
29
+ overflow: hidden;
30
+ }
31
+
32
+ // Checkbox box mixin
33
+ @mixin checkbox-box($size: 18px, $border-radius: var(--borderRadius-sm, 0.125rem)) {
34
+ position: relative;
35
+ display: flex;
36
+ align-items: center;
37
+ justify-content: center;
38
+ width: $size;
39
+ height: $size;
40
+ min-width: $size;
41
+ border: var(--borderWidth-1, 1px) solid var(--color-semantic-neutral-300, #cbd5e1);
42
+ border-radius: $border-radius;
43
+ background-color: var(--color-semantic-neutral-50, #f8fafc);
44
+ transition: all 0.15s ease-in-out;
45
+
46
+ &::after {
47
+ content: '';
48
+ position: absolute;
49
+ width: 10px;
50
+ height: 6px;
51
+ border: 2px solid transparent;
52
+ border-top: none;
53
+ border-right: none;
54
+ transform: rotate(-45deg) scale(0);
55
+ transition: transform 0.15s ease-in-out;
56
+ }
57
+ }
58
+
59
+ // Checkbox label mixin
60
+ @mixin checkbox-label($font-size: var(--fontSize-base, 1rem), $gap: var(--spacing-3, 0.75rem)) {
61
+ margin-left: $gap;
62
+ font-size: $font-size;
63
+ color: var(--color-semantic-neutral-900, #0f172a);
64
+ line-height: var(--lineHeight-normal, 1.5);
65
+ }
66
+
67
+ // Checkbox checked state mixin
68
+ @mixin checkbox-checked($bg-color: var(--color-brand-primary-500, #f97316), $border-color: var(--color-brand-primary-500, #f97316)) {
69
+ background-color: $bg-color;
70
+ border-color: $border-color;
71
+
72
+ &::after {
73
+ border-color: var(--color-semantic-neutral-50, #f8fafc);
74
+ transform: rotate(-45deg) scale(1);
75
+ }
76
+ }
77
+
78
+ // Checkbox focus state mixin
79
+ @mixin checkbox-focus {
80
+ outline: 2px solid var(--color-brand-primary-500, #f97316);
81
+ outline-offset: 2px;
82
+ }
83
+
84
+ // Checkbox disabled state mixin
85
+ @mixin checkbox-disabled {
86
+ cursor: not-allowed;
87
+ opacity: 0.6;
88
+
89
+ .ivds-checkbox__box {
90
+ background-color: var(--color-semantic-neutral-100, #f1f5f9);
91
+ border-color: var(--color-semantic-neutral-200, #e2e8f0);
92
+ cursor: not-allowed;
93
+ }
94
+
95
+ .ivds-checkbox__label {
96
+ color: var(--color-semantic-neutral-500, #64748b);
97
+ cursor: not-allowed;
98
+ }
99
+ }
100
+
101
+ // Checkbox indeterminate state mixin
102
+ @mixin checkbox-indeterminate($bg-color: var(--color-brand-primary-500, #f97316)) {
103
+ background-color: $bg-color;
104
+ border-color: $bg-color;
105
+
106
+ &::after {
107
+ content: '';
108
+ width: 8px;
109
+ height: 2px;
110
+ border: none;
111
+ background-color: var(--color-semantic-neutral-50, #f8fafc);
112
+ transform: none;
113
+ border-radius: 1px;
114
+ }
115
+ }
116
+
117
+ // Checkbox error state mixin
118
+ @mixin checkbox-error {
119
+ .ivds-checkbox__box {
120
+ border-color: var(--color-semantic-error-500, #ef4444);
121
+ }
122
+
123
+ &:hover .ivds-checkbox__box {
124
+ border-color: var(--color-semantic-error-600, #dc2626);
125
+ }
126
+
127
+ .ivds-checkbox__input:checked + .ivds-checkbox__box {
128
+ background-color: var(--color-semantic-error-500, #ef4444);
129
+ border-color: var(--color-semantic-error-500, #ef4444);
130
+ }
131
+
132
+ .ivds-checkbox__input:focus + .ivds-checkbox__box {
133
+ outline-color: var(--color-semantic-error-500, #ef4444);
134
+ }
135
+ }
136
+
137
+ // Checkbox success state mixin
138
+ @mixin checkbox-success {
139
+ .ivds-checkbox__box {
140
+ border-color: var(--color-semantic-success-500, #10b981);
141
+ }
142
+
143
+ &:hover .ivds-checkbox__box {
144
+ border-color: var(--color-semantic-success-600, #059669);
145
+ }
146
+
147
+ .ivds-checkbox__input:checked + .ivds-checkbox__box {
148
+ background-color: var(--color-semantic-success-500, #10b981);
149
+ border-color: var(--color-semantic-success-500, #10b981);
150
+ }
151
+
152
+ .ivds-checkbox__input:focus + .ivds-checkbox__box {
153
+ outline-color: var(--color-semantic-success-500, #10b981);
154
+ }
155
+ }
156
+
157
+ // Checkbox size variants
158
+ @mixin checkbox-small {
159
+ .ivds-checkbox__box {
160
+ @include checkbox-box(14px);
161
+
162
+ &::after {
163
+ width: 7px;
164
+ height: 4px;
165
+ }
166
+ }
167
+
168
+ .ivds-checkbox__label {
169
+ @include checkbox-label(var(--fontSize-sm, 0.875rem), var(--spacing-2, 0.5rem));
170
+ }
171
+ }
172
+
173
+ @mixin checkbox-large {
174
+ .ivds-checkbox__box {
175
+ @include checkbox-box(22px);
176
+
177
+ &::after {
178
+ width: 12px;
179
+ height: 8px;
180
+ }
181
+ }
182
+
183
+ .ivds-checkbox__label {
184
+ @include checkbox-label(var(--fontSize-lg, 1.125rem), var(--spacing-4, 1rem));
185
+ }
186
+ }
187
+
188
+ // Checkbox group mixin
189
+ @mixin checkbox-group($gap: var(--spacing-3, 0.75rem)) {
190
+ display: flex;
191
+ flex-direction: column;
192
+ gap: $gap;
193
+
194
+ &--horizontal {
195
+ flex-direction: row;
196
+ flex-wrap: wrap;
197
+ gap: var(--spacing-6, 1.5rem);
198
+ }
199
+ }
200
+
201
+ // Checkbox description mixin
202
+ @mixin checkbox-description {
203
+ margin-top: var(--spacing-1, 0.25rem);
204
+ margin-left: calc(18px + var(--spacing-3, 0.75rem));
205
+ font-size: var(--fontSize-sm, 0.875rem);
206
+ color: var(--color-semantic-neutral-600, #4b5563);
207
+ line-height: var(--lineHeight-relaxed, 1.625);
208
+ }