@abstraks-dev/ui-library 1.0.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.
- package/LICENSE +21 -0
- package/README.md +708 -0
- package/dist/__tests__/Anchor.test.js +145 -0
- package/dist/__tests__/ArrowRight.test.js +91 -0
- package/dist/__tests__/Avatar.test.js +123 -0
- package/dist/__tests__/Button.test.js +82 -0
- package/dist/__tests__/Card.test.js +198 -0
- package/dist/__tests__/CheckCircle.test.js +98 -0
- package/dist/__tests__/Checkbox.test.js +161 -0
- package/dist/__tests__/ChevronDown.test.js +73 -0
- package/dist/__tests__/Close.test.js +98 -0
- package/dist/__tests__/EditSquare.test.js +99 -0
- package/dist/__tests__/Error.test.js +74 -0
- package/dist/__tests__/Footer.test.js +66 -0
- package/dist/__tests__/Heading.test.js +227 -0
- package/dist/__tests__/Hero.test.js +74 -0
- package/dist/__tests__/Label.test.js +123 -0
- package/dist/__tests__/Loader.test.js +115 -0
- package/dist/__tests__/MenuHover.test.js +137 -0
- package/dist/__tests__/Paragraph.test.js +93 -0
- package/dist/__tests__/PlusCircle.test.js +99 -0
- package/dist/__tests__/Radio.test.js +153 -0
- package/dist/__tests__/Select.test.js +187 -0
- package/dist/__tests__/Tabs.test.js +162 -0
- package/dist/__tests__/TextArea.test.js +127 -0
- package/dist/__tests__/TextInput.test.js +181 -0
- package/dist/__tests__/Toggle.test.js +120 -0
- package/dist/__tests__/TrashX.test.js +99 -0
- package/dist/__tests__/useHeadingAccessibility.test.js +144 -0
- package/dist/components/Anchor.js +131 -0
- package/dist/components/Animation.js +129 -0
- package/dist/components/AnimationGroup.js +207 -0
- package/dist/components/AnimationToggle.js +216 -0
- package/dist/components/Avatar.js +153 -0
- package/dist/components/Button.js +218 -0
- package/dist/components/Card.js +222 -0
- package/dist/components/Checkbox.js +305 -0
- package/dist/components/Crud.js +564 -0
- package/dist/components/DragAndDrop.js +337 -0
- package/dist/components/Error.js +206 -0
- package/dist/components/Footer.js +99 -0
- package/dist/components/Form.js +412 -0
- package/dist/components/Header.js +372 -0
- package/dist/components/Heading.js +134 -0
- package/dist/components/Hero.js +181 -0
- package/dist/components/Label.js +256 -0
- package/dist/components/Loader.js +302 -0
- package/dist/components/MenuHover.js +114 -0
- package/dist/components/Paragraph.js +128 -0
- package/dist/components/Prompt.js +61 -0
- package/dist/components/Radio.js +254 -0
- package/dist/components/Select.js +422 -0
- package/dist/components/SideMenu.js +313 -0
- package/dist/components/Tabs.js +297 -0
- package/dist/components/TextArea.js +370 -0
- package/dist/components/TextInput.js +286 -0
- package/dist/components/Toggle.js +186 -0
- package/dist/components/crudFiles/CrudEditBase.js +150 -0
- package/dist/components/crudFiles/CrudViewBase.js +39 -0
- package/dist/components/crudFiles/crudDevelopment.js +118 -0
- package/dist/components/crudFiles/crudEditHandlers.js +50 -0
- package/dist/constants/animation.js +30 -0
- package/dist/icons/ArrowIcon.js +32 -0
- package/dist/icons/ArrowRight.js +33 -0
- package/dist/icons/CheckCircle.js +33 -0
- package/dist/icons/ChevronDown.js +28 -0
- package/dist/icons/Close.js +33 -0
- package/dist/icons/EditSquare.js +33 -0
- package/dist/icons/Ellipses.js +34 -0
- package/dist/icons/Hamburger.js +39 -0
- package/dist/icons/LoadingSpinner.js +42 -0
- package/dist/icons/PlusCircle.js +33 -0
- package/dist/icons/SaveIcon.js +32 -0
- package/dist/icons/TrashX.js +33 -0
- package/dist/icons/__tests__/CheckCircle.test.js +9 -0
- package/dist/icons/__tests__/ChevronDown.test.js +9 -0
- package/dist/icons/__tests__/Close.test.js +9 -0
- package/dist/icons/__tests__/EditSquare.test.js +9 -0
- package/dist/icons/__tests__/PlusCircle.test.js +9 -0
- package/dist/icons/__tests__/TrashX.test.js +9 -0
- package/dist/icons/index.js +89 -0
- package/dist/index.js +332 -0
- package/dist/setupTests.js +3 -0
- package/dist/styles/_variables.scss +286 -0
- package/dist/styles/anchor.scss +40 -0
- package/dist/styles/animation-accessibility.scss +96 -0
- package/dist/styles/animation-toggle.scss +233 -0
- package/dist/styles/animation.scss +3781 -0
- package/dist/styles/avatar.scss +285 -0
- package/dist/styles/button.scss +430 -0
- package/dist/styles/card.scss +210 -0
- package/dist/styles/checkbox.scss +160 -0
- package/dist/styles/crud.scss +474 -0
- package/dist/styles/dragAndDrop.scss +312 -0
- package/dist/styles/error.scss +232 -0
- package/dist/styles/footer.scss +58 -0
- package/dist/styles/form.scss +420 -0
- package/dist/styles/grid.scss +29 -0
- package/dist/styles/header.scss +276 -0
- package/dist/styles/heading.scss +118 -0
- package/dist/styles/hero.scss +185 -0
- package/dist/styles/htmlElements.scss +20 -0
- package/dist/styles/image.scss +9 -0
- package/dist/styles/label.scss +340 -0
- package/dist/styles/list-item.scss +5 -0
- package/dist/styles/loader.scss +354 -0
- package/dist/styles/logo.scss +19 -0
- package/dist/styles/main.css +9056 -0
- package/dist/styles/main.css.map +1 -0
- package/dist/styles/main.scss +0 -0
- package/dist/styles/menu-hover.scss +30 -0
- package/dist/styles/paragraph.scss +88 -0
- package/dist/styles/prompt.scss +51 -0
- package/dist/styles/radio.scss +202 -0
- package/dist/styles/select.scss +363 -0
- package/dist/styles/side-menu.scss +334 -0
- package/dist/styles/tabs.scss +540 -0
- package/dist/styles/text-area.scss +388 -0
- package/dist/styles/text-input.scss +171 -0
- package/dist/styles/toggle.scss +0 -0
- package/dist/styles/unordered-list.scss +8 -0
- package/dist/utils/ScrollHandler.js +30 -0
- package/dist/utils/accessibility.js +128 -0
- package/dist/utils/heroUtils.js +316 -0
- package/dist/utils/index.js +104 -0
- package/dist/utils/inputValidation.js +29 -0
- package/dist/utils/keyboardNavigation.js +536 -0
- package/dist/utils/labelUtils.js +708 -0
- package/dist/utils/loaderUtils.js +387 -0
- package/dist/utils/menuUtils.js +575 -0
- package/dist/utils/useHeadingAccessibility.js +298 -0
- package/dist/utils/useRadioGroup.js +260 -0
- package/dist/utils/useSelectAccessibility.js +426 -0
- package/dist/utils/useTabsAccessibility.js +278 -0
- package/dist/utils/useTextAreaAccessibility.js +255 -0
- package/dist/utils/useTextInputAccessibility.js +295 -0
- package/dist/utils/useTypographyAccessibility.js +168 -0
- package/dist/utils/useWindowSize.js +32 -0
- package/dist/utils/utils/ScrollHandler.js +26 -0
- package/dist/utils/utils/accessibility.js +133 -0
- package/dist/utils/utils/heroUtils.js +348 -0
- package/dist/utils/utils/index.js +9 -0
- package/dist/utils/utils/inputValidation.js +22 -0
- package/dist/utils/utils/keyboardNavigation.js +664 -0
- package/dist/utils/utils/labelUtils.js +772 -0
- package/dist/utils/utils/loaderUtils.js +436 -0
- package/dist/utils/utils/menuUtils.js +651 -0
- package/dist/utils/utils/useHeadingAccessibility.js +334 -0
- package/dist/utils/utils/useRadioGroup.js +311 -0
- package/dist/utils/utils/useSelectAccessibility.js +498 -0
- package/dist/utils/utils/useTabsAccessibility.js +316 -0
- package/dist/utils/utils/useTextAreaAccessibility.js +303 -0
- package/dist/utils/utils/useTextInputAccessibility.js +338 -0
- package/dist/utils/utils/useTypographyAccessibility.js +180 -0
- package/dist/utils/utils/useWindowSize.js +26 -0
- package/dist/utils/utils/validation.js +131 -0
- package/dist/utils/validation.js +139 -0
- package/package.json +90 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
@use 'variables' as *;
|
|
2
|
+
|
|
3
|
+
/* Base heading styles */
|
|
4
|
+
h1,
|
|
5
|
+
h2,
|
|
6
|
+
h3,
|
|
7
|
+
h4,
|
|
8
|
+
h5,
|
|
9
|
+
h6,
|
|
10
|
+
.h1,
|
|
11
|
+
.h2,
|
|
12
|
+
.h3,
|
|
13
|
+
.h4,
|
|
14
|
+
.h5,
|
|
15
|
+
.h6 {
|
|
16
|
+
font-family: $font-family-body;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
line-height: $line-height-tight;
|
|
19
|
+
color: $color-font-body;
|
|
20
|
+
margin: 0 0 1rem 0;
|
|
21
|
+
|
|
22
|
+
/* Ensure headings are accessible in high contrast mode */
|
|
23
|
+
@media (prefers-contrast: high) {
|
|
24
|
+
color: currentColor;
|
|
25
|
+
font-weight: 700;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Respect user's motion preferences */
|
|
29
|
+
@media (prefers-reduced-motion: reduce) {
|
|
30
|
+
transition: none;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Base font sizes */
|
|
35
|
+
.h1 {
|
|
36
|
+
font-size: $font-size-xl; /* Mobile first approach */
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.h2 {
|
|
40
|
+
font-size: $font-size-lg;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.h3 {
|
|
44
|
+
font-size: $font-size-base;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.h4 {
|
|
48
|
+
font-size: $font-size-sm;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.h5 {
|
|
52
|
+
font-size: $font-size-sm;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.h6 {
|
|
56
|
+
font-size: $font-size-xs;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Responsive typography scaling */
|
|
60
|
+
@media #{$medium} {
|
|
61
|
+
.h1 {
|
|
62
|
+
font-size: $heading-two; /* Scale up on tablets */
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.h2 {
|
|
66
|
+
font-size: $heading-three;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.h3 {
|
|
70
|
+
font-size: $heading-four;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.h4 {
|
|
74
|
+
font-size: $font-size-base;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.h5 {
|
|
78
|
+
font-size: $font-size-sm;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@media #{$large} {
|
|
83
|
+
.h1 {
|
|
84
|
+
font-size: $heading-one; /* Full size on desktop */
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.h2 {
|
|
88
|
+
font-size: $heading-two;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.h3 {
|
|
92
|
+
font-size: $heading-three;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.h4 {
|
|
96
|
+
font-size: $heading-four;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.h5 {
|
|
100
|
+
font-size: $heading-five;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.h6 {
|
|
104
|
+
font-size: $heading-six;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@media #{$xlarge} {
|
|
109
|
+
.h1 {
|
|
110
|
+
font-size: calc(#{$heading-one} * 1.1); /* Slightly larger on XL screens */
|
|
111
|
+
line-height: 1.1;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.h2 {
|
|
115
|
+
font-size: calc(#{$heading-two} * 1.05);
|
|
116
|
+
line-height: 1.2;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
@use 'variables' as *;
|
|
2
|
+
|
|
3
|
+
html,
|
|
4
|
+
body,
|
|
5
|
+
.root,
|
|
6
|
+
#root {
|
|
7
|
+
height: 100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.sb-show-main.sb-main-padded {
|
|
11
|
+
padding: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Hero wrapper - main container
|
|
15
|
+
.hero-wrapper {
|
|
16
|
+
position: relative;
|
|
17
|
+
height: 100vh;
|
|
18
|
+
min-height: 400px;
|
|
19
|
+
background-position: center;
|
|
20
|
+
background-repeat: no-repeat;
|
|
21
|
+
background-size: cover;
|
|
22
|
+
background-attachment: fixed;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
|
|
28
|
+
// Responsive height adjustments
|
|
29
|
+
@media #{$medium} {
|
|
30
|
+
min-height: 500px;
|
|
31
|
+
background-attachment: scroll; // Better performance on mobile
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media #{$large} {
|
|
35
|
+
min-height: 600px;
|
|
36
|
+
background-attachment: fixed;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media #{$xlarge} {
|
|
40
|
+
min-height: 70vh;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Overlay variants
|
|
44
|
+
&.hero--overlay-light::before {
|
|
45
|
+
content: '';
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 0;
|
|
48
|
+
left: 0;
|
|
49
|
+
right: 0;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
background: rgba(0, 0, 0, 0.2);
|
|
52
|
+
z-index: $z-index-base;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&.hero--overlay-medium::before {
|
|
56
|
+
content: '';
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
right: 0;
|
|
61
|
+
bottom: 0;
|
|
62
|
+
background: rgba(0, 0, 0, 0.4);
|
|
63
|
+
z-index: $z-index-base;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.hero--overlay-dark::before {
|
|
67
|
+
content: '';
|
|
68
|
+
position: absolute;
|
|
69
|
+
top: 0;
|
|
70
|
+
left: 0;
|
|
71
|
+
right: 0;
|
|
72
|
+
bottom: 0;
|
|
73
|
+
background: rgba(0, 0, 0, 0.6);
|
|
74
|
+
z-index: $z-index-base;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// High contrast mode support
|
|
78
|
+
@media (prefers-contrast: high) {
|
|
79
|
+
&::before {
|
|
80
|
+
background: rgba(0, 0, 0, 0.8) !important;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Reduced motion support
|
|
85
|
+
@media (prefers-reduced-motion: reduce) {
|
|
86
|
+
background-attachment: scroll !important;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Hero content container
|
|
91
|
+
.hero {
|
|
92
|
+
position: relative;
|
|
93
|
+
z-index: calc(#{$z-index-base} + 1);
|
|
94
|
+
width: 100%;
|
|
95
|
+
max-width: 1200px;
|
|
96
|
+
padding: 2rem 1rem;
|
|
97
|
+
text-align: center;
|
|
98
|
+
color: $color-white;
|
|
99
|
+
|
|
100
|
+
@media #{$medium} {
|
|
101
|
+
padding: 3rem 2rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media #{$large} {
|
|
105
|
+
padding: 4rem 3rem;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@media #{$xlarge} {
|
|
109
|
+
padding: 5rem 4rem;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Typography enhancements
|
|
113
|
+
h1,
|
|
114
|
+
h2,
|
|
115
|
+
h3,
|
|
116
|
+
h4,
|
|
117
|
+
h5,
|
|
118
|
+
h6 {
|
|
119
|
+
margin-bottom: 1rem;
|
|
120
|
+
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
|
|
121
|
+
|
|
122
|
+
@media #{$medium} {
|
|
123
|
+
margin-bottom: 1.5rem;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
p {
|
|
128
|
+
font-size: 1.1rem;
|
|
129
|
+
line-height: 1.6;
|
|
130
|
+
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
|
|
131
|
+
|
|
132
|
+
@media #{$medium} {
|
|
133
|
+
font-size: 1.25rem;
|
|
134
|
+
line-height: 1.7;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@media #{$large} {
|
|
138
|
+
font-size: 1.375rem;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Focus indicators for accessibility
|
|
143
|
+
&:focus-visible {
|
|
144
|
+
outline: 3px solid $color-primary;
|
|
145
|
+
outline-offset: 2px;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// High contrast mode adjustments
|
|
149
|
+
@media (prefers-contrast: high) {
|
|
150
|
+
h1,
|
|
151
|
+
h2,
|
|
152
|
+
h3,
|
|
153
|
+
h4,
|
|
154
|
+
h5,
|
|
155
|
+
h6,
|
|
156
|
+
p {
|
|
157
|
+
text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Overlay element (when using hasOverlay prop)
|
|
163
|
+
.hero__overlay {
|
|
164
|
+
position: absolute;
|
|
165
|
+
top: 0;
|
|
166
|
+
left: 0;
|
|
167
|
+
right: 0;
|
|
168
|
+
bottom: 0;
|
|
169
|
+
background: rgba(0, 0, 0, 0.4);
|
|
170
|
+
z-index: $z-index-base;
|
|
171
|
+
pointer-events: none;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Screen reader only content
|
|
175
|
+
.sr-only {
|
|
176
|
+
position: absolute !important;
|
|
177
|
+
width: 1px !important;
|
|
178
|
+
height: 1px !important;
|
|
179
|
+
padding: 0 !important;
|
|
180
|
+
margin: -1px !important;
|
|
181
|
+
overflow: hidden !important;
|
|
182
|
+
clip: rect(0, 0, 0, 0) !important;
|
|
183
|
+
white-space: nowrap !important;
|
|
184
|
+
border: 0 !important;
|
|
185
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@use 'variables' as *;
|
|
2
|
+
|
|
3
|
+
body {
|
|
4
|
+
font-family: 'Lato', sans-serif;
|
|
5
|
+
color: $color-font-body;
|
|
6
|
+
|
|
7
|
+
// Scroll lock utility class
|
|
8
|
+
&.scroll-locked {
|
|
9
|
+
overflow: hidden !important;
|
|
10
|
+
// Additional styles for scroll lock state
|
|
11
|
+
position: relative;
|
|
12
|
+
|
|
13
|
+
// Handle iOS devices that might need position fixed
|
|
14
|
+
@media (max-width: 768px) {
|
|
15
|
+
position: fixed;
|
|
16
|
+
width: 100%;
|
|
17
|
+
top: 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
@use 'variables' as *;
|
|
2
|
+
|
|
3
|
+
// Label wrapper container
|
|
4
|
+
.label-wrapper {
|
|
5
|
+
width: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
margin-bottom: 1rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Base label styles
|
|
12
|
+
.label {
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: flex-start;
|
|
15
|
+
gap: 0.25rem;
|
|
16
|
+
color: $color-font-body;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
transition: color 0.2s ease;
|
|
19
|
+
|
|
20
|
+
// Size variants
|
|
21
|
+
&--small {
|
|
22
|
+
font-size: 0.875rem;
|
|
23
|
+
line-height: 1.25rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&--medium {
|
|
27
|
+
font-size: 1rem;
|
|
28
|
+
line-height: 1.5rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&--large {
|
|
32
|
+
font-size: 1.125rem;
|
|
33
|
+
line-height: 1.75rem;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Weight variants
|
|
37
|
+
&--light {
|
|
38
|
+
font-weight: 300;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--normal {
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&--medium {
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&--bold {
|
|
50
|
+
font-weight: 600;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// State variants
|
|
54
|
+
&--disabled {
|
|
55
|
+
color: rgba($color-font-body, 0.5);
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--required {
|
|
60
|
+
.label__text::after {
|
|
61
|
+
content: '';
|
|
62
|
+
margin-left: 0.125rem;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&--error {
|
|
67
|
+
color: $color-error;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&--success {
|
|
71
|
+
color: $color-success;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&--warning {
|
|
75
|
+
color: $color-warning;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Responsive typography
|
|
79
|
+
@media #{$medium} {
|
|
80
|
+
&--small {
|
|
81
|
+
font-size: 0.875rem;
|
|
82
|
+
line-height: 1.375rem;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&--medium {
|
|
86
|
+
font-size: 1rem;
|
|
87
|
+
line-height: 1.625rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&--large {
|
|
91
|
+
font-size: 1.25rem;
|
|
92
|
+
line-height: 2rem;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@media #{$large} {
|
|
97
|
+
&--small {
|
|
98
|
+
font-size: 1rem;
|
|
99
|
+
line-height: 1.5rem;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&--medium {
|
|
103
|
+
font-size: 1.125rem;
|
|
104
|
+
line-height: 1.75rem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&--large {
|
|
108
|
+
font-size: 1.375rem;
|
|
109
|
+
line-height: 2.25rem;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@media #{$xlarge} {
|
|
114
|
+
gap: 0.375rem;
|
|
115
|
+
|
|
116
|
+
&--small {
|
|
117
|
+
font-size: 1rem;
|
|
118
|
+
line-height: 1.625rem;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&--medium {
|
|
122
|
+
font-size: 1.25rem;
|
|
123
|
+
line-height: 2rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&--large {
|
|
127
|
+
font-size: 1.5rem;
|
|
128
|
+
line-height: 2.5rem;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Focus styles for accessibility
|
|
133
|
+
&:focus-visible {
|
|
134
|
+
outline: 2px solid $color-primary;
|
|
135
|
+
outline-offset: 2px;
|
|
136
|
+
border-radius: 2px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// High contrast mode support
|
|
140
|
+
@media (prefers-contrast: high) {
|
|
141
|
+
&--error {
|
|
142
|
+
color: #ff0000;
|
|
143
|
+
font-weight: 600;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&--success {
|
|
147
|
+
color: #008000;
|
|
148
|
+
font-weight: 600;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&--warning {
|
|
152
|
+
color: #ff6600;
|
|
153
|
+
font-weight: 600;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&--disabled {
|
|
157
|
+
color: #808080;
|
|
158
|
+
text-decoration: line-through;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Reduced motion support
|
|
163
|
+
@media (prefers-reduced-motion: reduce) {
|
|
164
|
+
transition: none;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Label text content
|
|
169
|
+
.label__text {
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
gap: 0.25rem;
|
|
173
|
+
flex: 1;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Required indicator
|
|
177
|
+
.label__required {
|
|
178
|
+
color: $color-error;
|
|
179
|
+
font-weight: bold;
|
|
180
|
+
margin-left: 0.25rem;
|
|
181
|
+
|
|
182
|
+
// Ensure good contrast in high contrast mode
|
|
183
|
+
@media (prefers-contrast: high) {
|
|
184
|
+
color: #ff0000;
|
|
185
|
+
font-size: 1.1em;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Required text indicator
|
|
190
|
+
.label__required-text {
|
|
191
|
+
color: rgba($color-font-body, 0.7);
|
|
192
|
+
font-size: 0.875em;
|
|
193
|
+
font-style: italic;
|
|
194
|
+
margin-left: 0.5rem;
|
|
195
|
+
|
|
196
|
+
@media (prefers-contrast: high) {
|
|
197
|
+
color: $color-font-body;
|
|
198
|
+
font-weight: 500;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Help text
|
|
203
|
+
.label__help {
|
|
204
|
+
margin-top: 0.25rem;
|
|
205
|
+
font-size: 0.875rem;
|
|
206
|
+
line-height: 1.25rem;
|
|
207
|
+
color: rgba($color-font-body, 0.7);
|
|
208
|
+
|
|
209
|
+
@media #{$medium} {
|
|
210
|
+
font-size: 0.875rem;
|
|
211
|
+
line-height: 1.375rem;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@media #{$large} {
|
|
215
|
+
font-size: 1rem;
|
|
216
|
+
line-height: 1.5rem;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@media #{$xlarge} {
|
|
220
|
+
margin-top: 0.375rem;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// High contrast adjustments
|
|
224
|
+
@media (prefers-contrast: high) {
|
|
225
|
+
color: $color-font-body;
|
|
226
|
+
font-weight: 400;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Validation messages
|
|
231
|
+
.label__message {
|
|
232
|
+
margin-top: 0.25rem;
|
|
233
|
+
font-size: 0.875rem;
|
|
234
|
+
line-height: 1.25rem;
|
|
235
|
+
font-weight: 500;
|
|
236
|
+
display: flex;
|
|
237
|
+
align-items: flex-start;
|
|
238
|
+
gap: 0.25rem;
|
|
239
|
+
|
|
240
|
+
&--error {
|
|
241
|
+
color: $color-error;
|
|
242
|
+
|
|
243
|
+
&::before {
|
|
244
|
+
content: '⚠';
|
|
245
|
+
flex-shrink: 0;
|
|
246
|
+
margin-top: 0.125rem;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
&--success {
|
|
251
|
+
color: $color-success;
|
|
252
|
+
|
|
253
|
+
&::before {
|
|
254
|
+
content: '✓';
|
|
255
|
+
flex-shrink: 0;
|
|
256
|
+
margin-top: 0.125rem;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
&--warning {
|
|
261
|
+
color: $color-warning;
|
|
262
|
+
|
|
263
|
+
&::before {
|
|
264
|
+
content: '⚠';
|
|
265
|
+
flex-shrink: 0;
|
|
266
|
+
margin-top: 0.125rem;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Responsive typography
|
|
271
|
+
@media #{$medium} {
|
|
272
|
+
font-size: 0.875rem;
|
|
273
|
+
line-height: 1.375rem;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
@media #{$large} {
|
|
277
|
+
font-size: 1rem;
|
|
278
|
+
line-height: 1.5rem;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
@media #{$xlarge} {
|
|
282
|
+
margin-top: 0.375rem;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// High contrast mode adjustments
|
|
286
|
+
@media (prefers-contrast: high) {
|
|
287
|
+
font-weight: 600;
|
|
288
|
+
|
|
289
|
+
&--error {
|
|
290
|
+
color: #ff0000;
|
|
291
|
+
background: rgba(255, 0, 0, 0.1);
|
|
292
|
+
padding: 0.25rem;
|
|
293
|
+
border-radius: 2px;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
&--success {
|
|
297
|
+
color: #008000;
|
|
298
|
+
background: rgba(0, 128, 0, 0.1);
|
|
299
|
+
padding: 0.25rem;
|
|
300
|
+
border-radius: 2px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
&--warning {
|
|
304
|
+
color: #ff6600;
|
|
305
|
+
background: rgba(255, 102, 0, 0.1);
|
|
306
|
+
padding: 0.25rem;
|
|
307
|
+
border-radius: 2px;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Animation for live regions
|
|
312
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
313
|
+
animation: fadeIn 0.3s ease-in-out;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Fade in animation for validation messages
|
|
318
|
+
@keyframes fadeIn {
|
|
319
|
+
from {
|
|
320
|
+
opacity: 0;
|
|
321
|
+
transform: translateY(-0.25rem);
|
|
322
|
+
}
|
|
323
|
+
to {
|
|
324
|
+
opacity: 1;
|
|
325
|
+
transform: translateY(0);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// Screen reader only content
|
|
330
|
+
.sr-only {
|
|
331
|
+
position: absolute !important;
|
|
332
|
+
width: 1px !important;
|
|
333
|
+
height: 1px !important;
|
|
334
|
+
padding: 0 !important;
|
|
335
|
+
margin: -1px !important;
|
|
336
|
+
overflow: hidden !important;
|
|
337
|
+
clip: rect(0, 0, 0, 0) !important;
|
|
338
|
+
white-space: nowrap !important;
|
|
339
|
+
border: 0 !important;
|
|
340
|
+
}
|