@apolitical/component-library 4.8.7 → 5.0.0

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "4.8.7",
3
+ "version": "5.0.0",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  @use 'sass:meta';
2
2
  @import './../../functions', './../../mixins', './../../variables';
3
- @import './icons', './mixins', './sizes';
3
+ @import './icons', './mixins';
4
4
 
5
5
  @layer base {
6
6
  button,
@@ -8,13 +8,13 @@
8
8
  @include transition(background color border-color text-decoration-color);
9
9
 
10
10
  background: get-map($theme, 'button_primary_bg');
11
- padding: px-to-rem(get-map($medium, 'padding-top'))
12
- px-to-rem(get-map($medium, 'padding-horizontal'))
13
- px-to-rem(get-map($medium, 'padding-bottom'))
14
- px-to-rem(get-map($medium, 'padding-horizontal'));
11
+ padding: px-to-rem(get-map($button-medium, 'padding-top'))
12
+ px-to-rem(get-map($button-medium, 'padding-horizontal'))
13
+ px-to-rem(get-map($button-medium, 'padding-bottom'))
14
+ px-to-rem(get-map($button-medium, 'padding-horizontal'));
15
15
  position: relative;
16
16
  text-align: center;
17
- font-size: px-to-rem(get-map($medium, 'font-size'));
17
+ font-size: px-to-rem(get-map($button-medium, 'font-size'));
18
18
  font-weight: 700;
19
19
  text-decoration: none;
20
20
  border-radius: 360rem; // Completely round corners. This could be any large number but 360 evokes a circle well!
@@ -48,10 +48,10 @@
48
48
  // TODO: remove when we have new styling
49
49
  &.new {
50
50
  background: get-map($theme, 'button_new_primary_bg');
51
- padding: px-to-rem(get-map($medium, 'padding-top_new'))
52
- px-to-rem(get-map($medium, 'padding-horizontal_new'))
53
- px-to-rem(get-map($medium, 'padding-bottom_new'))
54
- px-to-rem(get-map($medium, 'padding-horizontal_new'));
51
+ padding: px-to-rem(get-map($button-medium, 'padding-top_new'))
52
+ px-to-rem(get-map($button-medium, 'padding-horizontal_new'))
53
+ px-to-rem(get-map($button-medium, 'padding-bottom_new'))
54
+ px-to-rem(get-map($button-medium, 'padding-horizontal_new'));
55
55
  color: get-map($theme, 'button_primary');
56
56
 
57
57
  &:hover,
@@ -296,14 +296,14 @@
296
296
  &::before {
297
297
  content: '';
298
298
  background: currentcolor;
299
- width: px-to-rem(get-map($medium, 'icon-width'));
300
- height: px-to-rem(get-map($medium, 'icon-width'));
299
+ width: px-to-rem(get-map($button-medium, 'icon-width'));
300
+ height: px-to-rem(get-map($button-medium, 'icon-width'));
301
301
  display: block;
302
302
  }
303
303
 
304
304
  &.left {
305
305
  &::before {
306
- margin-right: px-to-rem(get-map($medium, 'icon-gutter'));
306
+ margin-right: px-to-rem(get-map($button-medium, 'icon-gutter'));
307
307
  }
308
308
 
309
309
  &.no-text::before {
@@ -313,7 +313,7 @@
313
313
 
314
314
  &.right {
315
315
  &::before {
316
- margin-left: px-to-rem(get-map($medium, 'icon-gutter'));
316
+ margin-left: px-to-rem(get-map($button-medium, 'icon-gutter'));
317
317
  order: 2;
318
318
  }
319
319
 
@@ -1,5 +1,5 @@
1
1
  // The button defaults to the primary variant and medium styling so are not added as classes - they live on the default `button` styling
2
- $large: (
2
+ $button-large: (
3
3
  'font-size': 18,
4
4
  'padding-top': 14,
5
5
  'padding-top_new': 20,
@@ -11,7 +11,7 @@ $large: (
11
11
  'icon-offset': 2,
12
12
  'icon-gutter': 12,
13
13
  );
14
- $medium: (
14
+ $button-medium: (
15
15
  'font-size': 16,
16
16
  'padding-top': 10,
17
17
  'padding-top_new': 14,
@@ -23,7 +23,7 @@ $medium: (
23
23
  'icon-offset': 2,
24
24
  'icon-gutter': 10,
25
25
  );
26
- $small: (
26
+ $button-small: (
27
27
  'font-size': 14,
28
28
  'padding-top': 8,
29
29
  'padding-top_new': 10,
@@ -35,7 +35,7 @@ $small: (
35
35
  'icon-offset': 2,
36
36
  'icon-gutter': 8,
37
37
  );
38
- $sizes: ('large', $large), ('small', $small);
38
+ $sizes: ('large', $button-large), ('small', $button-small);
39
39
  $secondary: (
40
40
  'border': 1,
41
41
  );
@@ -0,0 +1,19 @@
1
+ @use 'sass:map';
2
+ @import './buttons', './logo';
3
+
4
+ // Moved variables here to be able to use them in uis
5
+ $header: (
6
+ 'padding-vertical': 16,
7
+ 'padding-horizontal': 24,
8
+ 'padding-horizontal_md': 40,
9
+ 'border': 1,
10
+ 'gap': 16,
11
+ );
12
+ $base-height: (get-map($header, 'padding-vertical') * 2) +
13
+ (get-map($header, 'border') * 3);
14
+ $header-height: (
15
+ 'height': $base-height + get-map($logo, 'height'),
16
+ 'height_md': $base-height + get-map($button-large, 'font-size') +
17
+ get-map($button-large, 'padding-top') + get-map($button-large, 'padding-bottom'),
18
+ );
19
+ $header: map.merge($header, $header-height);
@@ -1 +1 @@
1
- @import 'common';
1
+ @import 'buttons', 'common', 'header', 'logo';
@@ -0,0 +1,6 @@
1
+ $logo: (
2
+ 'width': 24,
3
+ 'width_881': 156,
4
+ 'height': 32,
5
+ 'height_881': 32,
6
+ );