@avenirs-esr/avenirs-dsav 0.1.108 → 0.1.109

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@avenirs-esr/avenirs-dsav",
3
3
  "type": "module",
4
- "version": "0.1.108",
4
+ "version": "0.1.109",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/avenirs-esr/avenirs-dsav"
@@ -1,7 +1,7 @@
1
1
  @use "sass:map";
2
2
 
3
3
  $spacing: (
4
- none: 0,
4
+ none: 0, /* 0px */
5
5
  xxxs: 0.125rem, /* 2px */
6
6
  xxs: 0.25rem, /* 4px */
7
7
  xs: 0.5rem, /* 8px */
@@ -20,10 +20,6 @@ $spacing: (
20
20
  }
21
21
  }
22
22
 
23
- @function get($key) {
24
- @return map.get($spacing, $key);
25
- }
26
-
27
23
  .line-break {
28
24
  height: var(--spacing-xs);
29
25
  }
@@ -94,11 +94,29 @@
94
94
  font-display: swap;
95
95
  }
96
96
 
97
+ @font-face {
98
+ font-family: 'Open Sans';
99
+ src: url('@/assets/fonts/open-sans/OpenSans-VariableFont.ttf') format('truetype');
100
+ font-style: normal;
101
+ font-weight: 300 800;
102
+ font-display: swap;
103
+ }
104
+
105
+ @font-face {
106
+ font-family: 'Open Sans';
107
+ src: url('@/assets/fonts/open-sans/OpenSans-Italic-VariableFont.ttf') format('truetype');
108
+ font-style: italic;
109
+ font-weight: 300 800;
110
+ font-display: swap;
111
+ }
112
+
97
113
  :root {
98
- --font-family-primary: 'B612', 'arial', sans-serif;
114
+ --font-family-primary: 'Open Sans', 'arial', sans-serif;
99
115
  --font-weight-light: 300;
100
116
  --font-weight-regular: 400;
117
+ --font-weight-semi-bold: 600;
101
118
  --font-weight-bold: 700;
119
+ --font-weight-extra-bold: 800;
102
120
  --font-size-xxs: 0.5rem; /* 8px */
103
121
  --font-size-xs: 0.75rem; /* 12px */
104
122
  --font-size-sm: 0.875rem; /* 14px */
@@ -140,7 +158,7 @@
140
158
 
141
159
  .b1-light {
142
160
  font-family: var(--font-family-primary);
143
- font-weight: var(--font-weight-light);
161
+ font-weight: var(--font-weight-regular);
144
162
  font-size: var(--font-size-md);
145
163
  line-height: var(--line-height-md);
146
164
  letter-spacing: var(--letter-spacing-md);
@@ -150,7 +168,7 @@
150
168
  p,
151
169
  .b1-regular {
152
170
  font-family: var(--font-family-primary);
153
- font-weight: var(--font-weight-regular);
171
+ font-weight: var(--font-weight-semi-bold);
154
172
  font-size: var(--font-size-md);
155
173
  line-height: var(--line-height-md);
156
174
  letter-spacing: var(--letter-spacing-md);
@@ -168,7 +186,7 @@ p,
168
186
 
169
187
  .b2-light {
170
188
  font-family: var(--font-family-primary);
171
- font-weight: var(--font-weight-light);
189
+ font-weight: var(--font-weight-regular);
172
190
  font-size: var(--font-size-sm);
173
191
  line-height: var(--line-height-sm);
174
192
  letter-spacing: var(--letter-spacing-sm);
@@ -177,7 +195,7 @@ p,
177
195
 
178
196
  .b2-regular {
179
197
  font-family: var(--font-family-primary);
180
- font-weight: var(--font-weight-regular);
198
+ font-weight: var(--font-weight-semi-bold);
181
199
  font-size: var(--font-size-sm);
182
200
  line-height: var(--line-height-sm);
183
201
  letter-spacing: var(--letter-spacing-sm);
@@ -195,7 +213,7 @@ p,
195
213
 
196
214
  .caption-light {
197
215
  font-family: var(--font-family-primary);
198
- font-weight: var(--font-weight-light);
216
+ font-weight: var(--font-weight-regular);
199
217
  font-size: var(--font-size-xs);
200
218
  line-height: var(--line-height-xs);
201
219
  letter-spacing: var(--letter-spacing-caption);
@@ -204,7 +222,7 @@ p,
204
222
 
205
223
  .caption-regular {
206
224
  font-family: var(--font-family-primary);
207
- font-weight: var(--font-weight-regular);
225
+ font-weight: var(--font-weight-semi-bold);
208
226
  font-size: var(--font-size-xs);
209
227
  line-height: var(--line-height-xs);
210
228
  letter-spacing: var(--letter-spacing-caption);
@@ -214,7 +232,7 @@ p,
214
232
  h1,
215
233
  .n1 {
216
234
  font-family: var(--font-family-primary);
217
- font-weight: var(--font-weight-light);
235
+ font-weight: var(--font-weight-regular);
218
236
  font-size: var(--font-size-n1);
219
237
  line-height: var(--line-height-n1);
220
238
  color: var(--title);
@@ -223,7 +241,7 @@ h1,
223
241
  h2,
224
242
  .n2 {
225
243
  font-family: var(--font-family-primary);
226
- font-weight: var(--font-weight-light);
244
+ font-weight: var(--font-weight-regular);
227
245
  font-size: var(--font-size-n2);
228
246
  line-height: var(--line-height-n2);
229
247
  color: var(--title);
@@ -232,7 +250,7 @@ h2,
232
250
  h3,
233
251
  .n3 {
234
252
  font-family: var(--font-family-primary);
235
- font-weight: var(--font-weight-regular);
253
+ font-weight: var(--font-weight-semi-bold);
236
254
  font-size: var(--font-size-n3);
237
255
  line-height: var(--line-height-n3);
238
256
  color: var(--title);
@@ -241,7 +259,7 @@ h3,
241
259
  h4,
242
260
  .n4 {
243
261
  font-family: var(--font-family-primary);
244
- font-weight: var(--font-weight-regular);
262
+ font-weight: var(--font-weight-semi-bold);
245
263
  font-size: var(--font-size-n4);
246
264
  line-height: var(--line-height-n4);
247
265
  color: var(--title);
@@ -250,7 +268,7 @@ h4,
250
268
  h5,
251
269
  .n5 {
252
270
  font-family: var(--font-family-primary);
253
- font-weight: var(--font-weight-regular);
271
+ font-weight: var(--font-weight-semi-bold);
254
272
  font-size: var(--font-size-n5);
255
273
  line-height: var(--line-height-n5);
256
274
  color: var(--title);
@@ -276,7 +294,7 @@ h6,
276
294
 
277
295
  .s1-light {
278
296
  font-family: var(--font-family-primary);
279
- font-weight: var(--font-weight-light);
297
+ font-weight: var(--font-weight-regular);
280
298
  font-size: var(--font-size-s1);
281
299
  line-height: var(--line-height-s1);
282
300
  letter-spacing: var(--letter-spacing-s1);
@@ -285,7 +303,7 @@ h6,
285
303
 
286
304
  .s1-regular {
287
305
  font-family: var(--font-family-primary);
288
- font-weight: var(--font-weight-regular);
306
+ font-weight: var(--font-weight-semi-bold);
289
307
  font-size: var(--font-size-s1);
290
308
  line-height: var(--line-height-s1);
291
309
  letter-spacing: var(--letter-spacing-s1);
@@ -303,7 +321,7 @@ h6,
303
321
 
304
322
  .s2-light {
305
323
  font-family: var(--font-family-primary);
306
- font-weight: var(--font-weight-light);
324
+ font-weight: var(--font-weight-regular);
307
325
  font-size: var(--font-size-s2);
308
326
  line-height: var(--line-height-s2);
309
327
  letter-spacing: var(--letter-spacing-s2);
@@ -7,14 +7,12 @@
7
7
  @use './core/spacing' as *;
8
8
  @use './core/radius' as *;
9
9
  @use './core/dimensions' as *;
10
- @use './core/accessibility' as *;
11
10
 
12
11
  // === Settings ===
13
12
  @use './settings/breakpoints' as *;
14
13
 
15
14
  // === Components ===
16
15
  @use './components/icons' as *;
17
- @use './components/grid' as *;
18
16
  @use './components/buttons' as *;
19
17
  @use './components/collapse' as *;
20
18
  @use './components/form' as *;
@@ -28,6 +26,7 @@
28
26
  // === Utilities ===
29
27
  @use './utilities/helpers' as *;
30
28
  @use './utilities/spacing' as *;
29
+ @use './utilities/layout' as *;
31
30
 
32
31
  // === Global ===
33
32
  :root {
@@ -0,0 +1,23 @@
1
+ @use '../core/namespace' as *;
2
+ @use '../settings/breakpoints' as bp;
3
+
4
+ // === Responsive utility mixin ===
5
+ @mixin responsive-utility($class-name, $rules) {
6
+ // Base class
7
+ @include ns($class-name) {
8
+ @each $prop, $value in $rules {
9
+ #{$prop}: #{$value};
10
+ }
11
+ }
12
+
13
+ // Breakpoint-specific classes
14
+ @each $bp-name, $bp-value in bp.$breakpoints {
15
+ @media (min-width: #{$bp-value}) {
16
+ @include ns("#{$class-name}--#{$bp-name}") {
17
+ @each $prop, $value in $rules {
18
+ #{$prop}: #{$value};
19
+ }
20
+ }
21
+ }
22
+ }
23
+ }
@@ -2,70 +2,6 @@
2
2
  @use '../core/spacing' as sp;
3
3
  @use '../core/namespace' as *;
4
4
 
5
- // === Responsive utility mixin ===
6
- @mixin responsive-utility($class-name, $prop, $value) {
7
- // Base class
8
- @include ns($class-name) {
9
- #{$prop}: #{$value};
10
- }
11
-
12
- // Breakpoint-specific classes
13
- @each $bp-name, $bp-value in bp.$breakpoints {
14
- @media (min-width: #{$bp-value}) {
15
- @include ns("#{$class-name}--#{$bp-name}") {
16
- #{$prop}: #{$value};
17
- }
18
- }
19
- }
20
- }
21
-
22
- // === Visibility classes ===
23
- // Ex: .av-hidden / .av-hidden--md / .av-unhidden / .av-unhidden--lg
24
- @include responsive-utility("hidden", display, "none !important");
25
- @include responsive-utility("unhidden", display, "inherit !important");
26
-
27
- // === Gapped layouts ===
28
- // Ex: .av-gap-sm / .av-gap-lg / .av-gap-lg--lg
29
- @each $size, $value in sp.$spacing {
30
- @include responsive-utility("gap-#{$size}", gap, var(--spacing-#{$size}));
31
- }
32
-
33
- // === Flex fill class ===
34
- // Ex: .av-flex-fill / .av-flex-fill--md
35
- @include responsive-utility("flex-fill", flex, "1 1 0%");
36
-
37
- // === Full width/height classes ===
38
- // Ex: .av-w-full / .av-h-full / .av-w-full--lg / .av-h-full--md
39
- @include responsive-utility("w-full", width, 100%);
40
- @include responsive-utility("h-full", height, 100%);
41
-
42
- // === Flex alignment classes ===
43
- // Ex: .av-align-center / .av-align-end
44
- $alignments: (
45
- start: flex-start,
46
- center: center,
47
- end: flex-end,
48
- stretch: stretch,
49
- baseline: baseline
50
- );
51
- @each $alignment, $value in $alignments {
52
- @include responsive-utility("align-#{$alignment}", align-items, $value);
53
- }
54
-
55
- // === Flex justification classes ===
56
- // Ex: .av-justify-center / .av-justify-between
57
- $justifications: (
58
- start: flex-start,
59
- center: center,
60
- end: flex-end,
61
- between: space-between,
62
- around: space-around,
63
- evenly: space-evenly
64
- );
65
- @each $justification, $value in $justifications {
66
- @include responsive-utility("justify-#{$justification}", justify-content, $value);
67
- }
68
-
69
5
  // === No before/after classes ===
70
6
  // Ex: .av-no-before / .av-no-after
71
7
  @include ns("no-after") {
@@ -0,0 +1,317 @@
1
+ # Layout
2
+
3
+ ## ✨ Introduction
4
+
5
+ This file contains layout-related utility classes for managing the overall structure and alignment of elements within the application. These utilities help in creating responsive designs and ensuring consistent spacing and alignment across different components.
6
+
7
+ ## 🏷️ Class patterns
8
+
9
+ | Class pattern | Description | Responsive variants |
10
+ |---------------|-------------|---------------------|
11
+ | `.av-container` | Centers content, sets max-width | `--sm`, `--md`, `--lg`, `--xl` |
12
+ | `.av-container-fluid` | Full-width container, no horizontal padding | None |
13
+ | `.av-row` | `display: flex; flex-direction: row` | `--sm`, `--md`, `--lg`, `--xl` |
14
+ | `.av-col` | `display: flex; flex-direction: column` | `--sm`, `--md`, `--lg`, `--xl` |
15
+ | `.av-wrap` | `flex-wrap: wrap` | `--sm`, `--md`, `--lg`, `--xl` |
16
+ | `.av-nowrap` | `flex-wrap: nowrap` | `--sm`, `--md`, `--lg`, `--xl` |
17
+ | `.av-sr-only` | Hides element visually but keeps it accessible to screen readers | `--sm`, `--md`, `--lg`, `--xl` |
18
+ | `.av-hidden` | `display: none !important` | `--sm`, `--md`, `--lg`, `--xl` |
19
+ | `.av-unhidden` | `display: inherit !important` | `--sm`, `--md`, `--lg`, `--xl` |
20
+ | `.av-gap-{spacing}` | Sets `gap` between flex items | `--sm`, `--md`, `--lg`, `--xl` |
21
+ | `.av-flex-fill` | `flex: 1 1 0%` (grow and fill available space) | `--sm`, `--md`, `--lg`, `--xl` |
22
+ | `.av-w-full` | `width: 100%` | `--sm`, `--md`, `--lg`, `--xl` |
23
+ | `.av-h-full` | `height: 100%` | `--sm`, `--md`, `--lg`, `--xl` |
24
+ | `.av-align-{alignment}` | Sets `align-items`: `start` (`flex-start`), `center`, `end` (`flex-end`), `stretch`, `baseline` | `--sm`, `--md`, `--lg`, `--xl` |
25
+ | `.av-justify-{justification}` | Sets `justify-content`: `start` (`flex-start`), `center`, `end` (`flex-end`), `between` (`space-between`), `around` (`space-around`), `evenly` (`space-evenly`) | `--sm`, `--md`, `--lg`, `--xl` |
26
+
27
+ 📝 Notes:
28
+ - `{spacing}` corresponds to the spacing scale defined in the core: `none`, `xxxs`, `xxs`, `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `4xl`, `5xl`.
29
+ - `{alignment}` options include: `start`, `center`, `end`, `stretch`, `baseline`.
30
+ - `{justification}` options include: `start`, `center`, `end`, `between`, `around`, `evenly`.
31
+
32
+ ## 🎨 Some CSS results
33
+
34
+ ### Containers
35
+
36
+ ```css
37
+ .av-container {
38
+ max-width: 90rem;
39
+ margin-left: auto;
40
+ margin-right: auto;
41
+ padding-left: var(--spacing-sm);
42
+ padding-right: var(--spacing-sm);
43
+ }
44
+
45
+ .av-container-fluid {
46
+ max-width: none;
47
+ padding-left: var(--spacing-none);
48
+ padding-right: var(--spacing-none);
49
+ overflow: hidden;
50
+ }
51
+
52
+ @media (min-width: 36rem) {
53
+ .av-container--sm {
54
+ width: 100%;
55
+ max-width: 36rem;
56
+ margin-left: auto;
57
+ margin-right: auto;
58
+ padding-left: var(--spacing-sm);
59
+ padding-right: var(--spacing-sm);
60
+ }
61
+ }
62
+
63
+ @media (min-width: 48rem) {
64
+ .av-container--md {
65
+ width: 100%;
66
+ max-width: 48rem;
67
+ margin-left: auto;
68
+ margin-right: auto;
69
+ padding-left: var(--spacing-sm);
70
+ padding-right: var(--spacing-sm);
71
+ }
72
+ }
73
+
74
+ @media (min-width: 64rem) {
75
+ .av-container--lg {
76
+ width: 100%;
77
+ max-width: 64rem;
78
+ margin-left: auto;
79
+ margin-right: auto;
80
+ padding-left: var(--spacing-md);
81
+ padding-right: var(--spacing-md);
82
+ }
83
+ }
84
+ ```
85
+
86
+ ### Rows and colums
87
+
88
+ ```css
89
+ .av-row {
90
+ display: flex;
91
+ flex-direction: row;
92
+ }
93
+
94
+ @media (min-width: 36rem) {
95
+ .av-row--sm {
96
+ display: flex;
97
+ flex-direction: row;
98
+ }
99
+ }
100
+
101
+ .av-col {
102
+ display: flex;
103
+ flex-direction: column;
104
+ }
105
+
106
+ @media (min-width: 36rem) {
107
+ .av-col--sm {
108
+ display: flex;
109
+ flex-direction: column;
110
+ }
111
+ }
112
+ ```
113
+
114
+ ### Flex wrap
115
+
116
+ ```css
117
+ .av-wrap {
118
+ flex-wrap: wrap;
119
+ }
120
+
121
+ .av-nowrap {
122
+ flex-wrap: nowrap;
123
+ }
124
+ ```
125
+
126
+ ### Accessibility
127
+
128
+ ```css
129
+ .av-sr-only {
130
+ position: absolute !important;
131
+ width: 1px !important;
132
+ height: 1px !important;
133
+ padding: 0 !important;
134
+ margin: -1px !important;
135
+ overflow: hidden !important;
136
+ clip: rect(0, 0, 0, 0) !important;
137
+ white-space: nowrap !important;
138
+ border: 0 !important;
139
+ }
140
+
141
+ @media (min-width: 36rem) {
142
+ .av-sr-only--sm {
143
+ position: absolute !important;
144
+ width: 1px !important;
145
+ height: 1px !important;
146
+ padding: 0 !important;
147
+ margin: -1px !important;
148
+ overflow: hidden !important;
149
+ clip: rect(0, 0, 0, 0) !important;
150
+ white-space: nowrap !important;
151
+ border: 0 !important;
152
+ }
153
+ }
154
+ ```
155
+
156
+ ### Visibility
157
+
158
+ ```css
159
+ .av-hidden {
160
+ display: none !important;
161
+ }
162
+
163
+ @media (min-width: 36rem) {
164
+ .av-hidden--sm {
165
+ display: none !important;
166
+ }
167
+ }
168
+
169
+ .av-unhidden {
170
+ display: inherit !important;
171
+ }
172
+
173
+ @media (min-width: 36rem) {
174
+ .av-unhidden--sm {
175
+ display: inherit !important;
176
+ }
177
+ }
178
+ ```
179
+
180
+ ### Gapped layouts
181
+
182
+ ```css
183
+ .av-gap-sm {
184
+ gap: var(--spacing-sm);
185
+ }
186
+
187
+ @media (min-width: 48rem) {
188
+ .av-gap-lg--md {
189
+ gap: var(--spacing-lg);
190
+ }
191
+ }
192
+ ```
193
+
194
+ ### Flex fill
195
+
196
+ ```css
197
+ .av-flex-fill {
198
+ flex: 1 1 0%;
199
+ }
200
+
201
+ @media (min-width: 36rem) {
202
+ .av-flex-fill--sm {
203
+ flex: 1 1 0%;
204
+ }
205
+ }
206
+ ```
207
+
208
+ ### Full width and height
209
+
210
+ ```css
211
+ .av-w-full {
212
+ width: 100%;
213
+ }
214
+
215
+ @media (min-width: 36rem) {
216
+ .av-w-full--sm {
217
+ width: 100%;
218
+ }
219
+ }
220
+
221
+ .av-h-full {
222
+ height: 100%;
223
+ }
224
+
225
+ @media (min-width: 36rem) {
226
+ .av-h-full--sm {
227
+ height: 100%;
228
+ }
229
+ }
230
+ ```
231
+
232
+ ### Alignment
233
+
234
+ ```css
235
+ .av-align-start {
236
+ align-items: flex-start;
237
+ }
238
+
239
+ .av-align-center {
240
+ align-items: center;
241
+ }
242
+
243
+ .av-align-end {
244
+ align-items: flex-end;
245
+ }
246
+
247
+ .av-align-stretch {
248
+ align-items: stretch;
249
+ }
250
+
251
+ .av-align-baseline {
252
+ align-items: baseline;
253
+ }
254
+
255
+ @media (min-width: 36rem) {
256
+ .av-align-center--sm {
257
+ align-items: center;
258
+ }
259
+ }
260
+ ```
261
+
262
+ ### Justification
263
+
264
+ ```css
265
+ .av-justify-start {
266
+ justify-content: flex-start;
267
+ }
268
+
269
+ .av-justify-center {
270
+ justify-content: center;
271
+ }
272
+
273
+ .av-justify-end {
274
+ justify-content: flex-end;
275
+ }
276
+
277
+ .av-justify-between {
278
+ justify-content: space-between;
279
+ }
280
+
281
+ .av-justify-around {
282
+ justify-content: space-around;
283
+ }
284
+
285
+ .av-justify-evenly {
286
+ justify-content: space-evenly;
287
+ }
288
+
289
+ @media (min-width: 36rem) {
290
+ .av-justify-center--sm {
291
+ justify-content: center;
292
+ }
293
+ }
294
+ ```
295
+
296
+ ## 💡 Examples of use
297
+
298
+ ```html
299
+ <div class="av-container">
300
+ <!-- Row with medium gap -->
301
+ <div class="av-row av-gap-md">
302
+
303
+ <!-- Column with centered and spaced items -->
304
+ <div class="av-col av-align-center av-justify-between">
305
+ <div>Item 1</div>
306
+ <!-- Visible only on large devices -->
307
+ <div class="av-hidden av-unhidden-lg">Item 2</div>
308
+ </div>
309
+
310
+ <!-- Flexible column filling remaining space -->
311
+ <div class="av-col av-flex-fill">
312
+ <div class="av-w-full av-h-full">Item 3</div>
313
+ </div>
314
+
315
+ </div>
316
+ </div>
317
+ ```