@apolitical/component-library 9.0.0-pla.2 → 9.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.
Files changed (60) hide show
  1. package/accessibility/visually-hidden/visually-hidden.d.ts +1 -1
  2. package/discussion/components/add-post/add-post.d.ts +2 -0
  3. package/discussion/components/post/post.d.ts +2 -1
  4. package/discussion/components/thread/thread.d.ts +1 -1
  5. package/discussion/discussion.helpers.d.ts +1 -1
  6. package/discussion/feeds/replies-feed/components/add-reply-form/add-reply-form.d.ts +1 -1
  7. package/discussion/feeds/replies-feed/components/load-more-replies-button/load-more-replies-button.d.ts +1 -1
  8. package/discussion/feeds/replies-feed/components/reply-item/reply-item.d.ts +1 -1
  9. package/form/components/form/components/fields/input/input.d.ts +1 -1
  10. package/form/components/form/form.types.d.ts +2 -2
  11. package/form/components/rich-text-editor/helpers/transform/transform.d.ts +1 -1
  12. package/form/components/rich-text-editor/hooks/use-positioned-element/use-positioned-element.d.ts +1 -1
  13. package/form/types/signup-form/signup-form.helpers.get-fields.d.ts +7 -2
  14. package/general/buttons/button-wrapper/button-wrapper.d.ts +1 -1
  15. package/general/link/link.d.ts +1 -1
  16. package/general/tooltip/tooltip.d.ts +2 -2
  17. package/helpers/intl.d.ts +2 -3
  18. package/helpers/pass-props-to-children.d.ts +1 -1
  19. package/hooks/use-auto-resize/use-auto-resize.d.ts +2 -2
  20. package/index.js +174 -152
  21. package/index.mjs +16023 -15574
  22. package/layout/page-layout/page-layout.d.ts +1 -1
  23. package/modals/components/modal/modal.d.ts +2 -2
  24. package/modals/components/overlay/overlay.d.ts +1 -1
  25. package/navigation/more-menu/more-menu.d.ts +2 -2
  26. package/navigation/tabs/tabs.d.ts +1 -1
  27. package/package.json +6 -6
  28. package/sections/edit-section/edit-section.d.ts +1 -1
  29. package/sections/full-width-section/full-width-section.d.ts +1 -1
  30. package/style.css +1 -1
  31. package/styles/base/_accessibility.scss +34 -32
  32. package/styles/base/_blockquotes.scss +50 -48
  33. package/styles/base/_fonts.scss +9 -7
  34. package/styles/base/_hr.scss +9 -7
  35. package/styles/base/_layout.scss +24 -22
  36. package/styles/base/_links.scss +18 -14
  37. package/styles/base/_lists.scss +40 -38
  38. package/styles/base/_mentions.scss +11 -9
  39. package/styles/base/_overlays.scss +51 -49
  40. package/styles/base/_svg.scss +4 -2
  41. package/styles/base/_table.scss +58 -56
  42. package/styles/base/_text.scss +110 -108
  43. package/styles/base/_titles.scss +56 -42
  44. package/styles/base/buttons/_button-wrapper.scss +27 -25
  45. package/styles/base/buttons/_buttons.scss +316 -314
  46. package/styles/base/form/_checkbox.scss +33 -31
  47. package/styles/base/form/_fields.scss +57 -55
  48. package/styles/base/form/_form.scss +18 -16
  49. package/styles/base/form/_labels.scss +8 -6
  50. package/styles/base/form/_radio.scss +20 -18
  51. package/styles/base/form/_search-button.scss +21 -19
  52. package/styles/index.scss +1 -1
  53. package/styles/reset/_reset.scss +117 -121
  54. package/styles/uclasses/uclasses.scss +1452 -1450
  55. package/text/helper-text-box/helper-text-box.d.ts +1 -1
  56. package/text/highlighted-text-box/highlighted-text-box.d.ts +1 -1
  57. package/text/icon-bulleted-list/icon-bulleted-list.d.ts +1 -1
  58. package/text/markdown-text/components/div/div.d.ts +1 -1
  59. package/text/markdown-text/components/empty-component/empty-component.d.ts +3 -1
  60. package/text/markdown-text/components/link/link.d.ts +1 -1
@@ -1,46 +1,48 @@
1
1
  @import './../functions', './../mixins', './../variables';
2
2
 
3
3
  @layer base {
4
- a,
5
- button,
6
- label,
7
- input,
8
- textarea,
9
- [role='menu'],
10
- li[tabindex] {
11
- &:focus,
12
- &:focus-visible {
13
- outline: none;
14
- box-shadow: $outline get-map($theme, 'default_focus');
15
- }
4
+ .v1styles {
5
+ a,
6
+ button,
7
+ label,
8
+ input,
9
+ textarea,
10
+ [role='menu'],
11
+ li[tabindex] {
12
+ &:focus,
13
+ &:focus-visible {
14
+ outline: none;
15
+ box-shadow: $outline get-map($theme, 'default_focus');
16
+ }
16
17
 
17
- &:active {
18
- box-shadow: none;
18
+ &:active {
19
+ box-shadow: none;
20
+ }
19
21
  }
20
- }
21
22
 
22
- [role='menu'],
23
- [role='menu'] a,
24
- li[tabindex] {
25
- &:focus,
26
- &:focus-visible {
27
- box-shadow: $outline get-map($theme, 'default_focus') inset;
23
+ [role='menu'],
24
+ [role='menu'] a,
25
+ li[tabindex] {
26
+ &:focus,
27
+ &:focus-visible {
28
+ box-shadow: $outline get-map($theme, 'default_focus') inset;
29
+ }
28
30
  }
29
- }
30
31
 
31
- .hidden {
32
- @include hidden-element;
32
+ .hidden {
33
+ @include hidden-element;
33
34
 
34
- @include amend-selector-path('.hidden', 'button.hidden, .button.hidden') {
35
- &.tertiary:not(.new) {
36
- padding: 0;
35
+ @include amend-selector-path('.hidden', 'button.hidden, .button.hidden') {
36
+ &.tertiary:not(.new) {
37
+ padding: 0;
38
+ }
37
39
  }
38
- }
39
40
 
40
- &.show-on-focus {
41
- &:focus,
42
- &:focus-within {
43
- @include show-hidden-element;
41
+ &.show-on-focus {
42
+ &:focus,
43
+ &:focus-within {
44
+ @include show-hidden-element;
45
+ }
44
46
  }
45
47
  }
46
48
  }
@@ -19,63 +19,65 @@ $blockquote: (
19
19
  );
20
20
 
21
21
  @layer base {
22
- blockquote {
23
- margin: px-to-rem(get-map($blockquote, 'margin-top')) 0
24
- px-to-rem(get-map($blockquote, 'margin-bottom'));
25
- padding: px-to-rem(get-map($blockquote, 'padding-vertical')) 0 0
26
- px-to-rem(get-map($blockquote, 'padding-left'));
27
- font-size: px-to-rem(get-map($blockquote, 'font-size'));
28
- color: get-map($theme, 'blockquote');
29
- font-weight: 700;
30
- font-style: italic;
31
- line-height: px-to-rem(get-map($blockquote, 'line-height'));
32
- border-left: px-to-rem(get-map($blockquote, 'border-width')) solid
33
- get-map($theme, 'blockquote_border');
22
+ .v1styles {
23
+ blockquote {
24
+ margin: px-to-rem(get-map($blockquote, 'margin-top')) 0
25
+ px-to-rem(get-map($blockquote, 'margin-bottom'));
26
+ padding: px-to-rem(get-map($blockquote, 'padding-vertical')) 0 0
27
+ px-to-rem(get-map($blockquote, 'padding-left'));
28
+ font-size: px-to-rem(get-map($blockquote, 'font-size'));
29
+ color: get-map($theme, 'blockquote');
30
+ font-weight: 700;
31
+ font-style: italic;
32
+ line-height: px-to-rem(get-map($blockquote, 'line-height'));
33
+ border-left: px-to-rem(get-map($blockquote, 'border-width')) solid
34
+ get-map($theme, 'blockquote_border');
34
35
 
35
- &.subtle {
36
- font-size: px-to-rem(get-map($blockquote, 'subtle', 'font-size'));
37
- font-weight: normal;
38
- font-style: normal;
39
- border-left-width: px-to-rem(get-map($blockquote, 'subtle', 'border-width'));
40
- border-left-color: get-map($theme, 'blockquote_subtle_border');
36
+ &.subtle {
37
+ font-size: px-to-rem(get-map($blockquote, 'subtle', 'font-size'));
38
+ font-weight: normal;
39
+ font-style: normal;
40
+ border-left-width: px-to-rem(get-map($blockquote, 'subtle', 'border-width'));
41
+ border-left-color: get-map($theme, 'blockquote_subtle_border');
41
42
 
42
- strong {
43
- font-weight: 900;
43
+ strong {
44
+ font-weight: 900;
45
+ }
44
46
  }
45
- }
46
47
 
47
- // When there are multiple blockquotes in a row (e.g. in a rich text editor), remove the margin
48
- // to make it seem like they're part of the same blockquote
49
- &:has(+ blockquote) {
50
- margin-bottom: 0;
51
- }
48
+ // When there are multiple blockquotes in a row (e.g. in a rich text editor), remove the margin
49
+ // to make it seem like they're part of the same blockquote
50
+ &:has(+ blockquote) {
51
+ margin-bottom: 0;
52
+ }
52
53
 
53
- & + blockquote {
54
- margin-top: 0;
55
- }
54
+ & + blockquote {
55
+ margin-top: 0;
56
+ }
56
57
 
57
- p,
58
- span,
59
- strong,
60
- em,
61
- div,
62
- li,
63
- dt,
64
- dd {
65
- font-weight: inherit;
66
- }
58
+ p,
59
+ span,
60
+ strong,
61
+ em,
62
+ div,
63
+ li,
64
+ dt,
65
+ dd {
66
+ font-weight: inherit;
67
+ }
67
68
 
68
- p:last-of-type {
69
- margin-bottom: 0;
70
- }
69
+ p:last-of-type {
70
+ margin-bottom: 0;
71
+ }
71
72
 
72
- @include breakpoint('min-width', 'md') {
73
- margin-top: px-to-rem(get-map($blockquote, 'margin-top_md'));
74
- margin-bottom: px-to-rem(get-map($blockquote, 'margin-bottom_md'));
75
- font-size: px-to-rem(get-map($blockquote, 'font-size_md'));
73
+ @include breakpoint('min-width', 'md') {
74
+ margin-top: px-to-rem(get-map($blockquote, 'margin-top_md'));
75
+ margin-bottom: px-to-rem(get-map($blockquote, 'margin-bottom_md'));
76
+ font-size: px-to-rem(get-map($blockquote, 'font-size_md'));
76
77
 
77
- &.subtle {
78
- font-size: px-to-rem(get-map($blockquote, 'subtle', 'font-size_md'));
78
+ &.subtle {
79
+ font-size: px-to-rem(get-map($blockquote, 'subtle', 'font-size_md'));
80
+ }
79
81
  }
80
82
  }
81
83
  }
@@ -34,12 +34,14 @@ $font-family: (400, normal), (400, italic), (600, normal), (600, italic), (900,
34
34
  @include font-styling($weight, $style);
35
35
  }
36
36
 
37
- body,
38
- button,
39
- input,
40
- textarea {
41
- font-family:
42
- #{$font-name},
43
- sans-serif;
37
+ .v1styles {
38
+ &,
39
+ button,
40
+ input,
41
+ textarea {
42
+ font-family:
43
+ #{$font-name},
44
+ sans-serif;
45
+ }
44
46
  }
45
47
  }
@@ -6,12 +6,14 @@ $hr: (
6
6
  );
7
7
 
8
8
  @layer base {
9
- hr {
10
- width: 100%;
11
- height: px-to-rem(get-map($hr, 'height'));
12
- background: get-map($theme, 'divider');
13
- margin: px-to-rem(get-map($hr, 'margin-vertical')) auto;
14
- border: none;
15
- display: block;
9
+ .v1styles {
10
+ hr {
11
+ width: 100%;
12
+ height: px-to-rem(get-map($hr, 'height'));
13
+ background: get-map($theme, 'divider');
14
+ margin: px-to-rem(get-map($hr, 'margin-vertical')) auto;
15
+ border: none;
16
+ display: block;
17
+ }
16
18
  }
17
19
  }
@@ -1,32 +1,34 @@
1
1
  @import './../functions', './../variables';
2
2
 
3
3
  @layer base {
4
- [hidden] {
5
- display: none;
6
- }
4
+ .v1styles {
5
+ [hidden] {
6
+ display: none;
7
+ }
7
8
 
8
- .center {
9
- text-align: center;
10
- margin-right: auto;
11
- margin-left: auto;
12
- }
9
+ .center {
10
+ text-align: center;
11
+ margin-right: auto;
12
+ margin-left: auto;
13
+ }
13
14
 
14
- .content-default,
15
- .content-slim,
16
- .content-slimmest {
17
- margin-left: auto;
18
- margin-right: auto;
19
- }
15
+ .content-default,
16
+ .content-slim,
17
+ .content-slimmest {
18
+ margin-left: auto;
19
+ margin-right: auto;
20
+ }
20
21
 
21
- .content-default {
22
- max-width: px-to-rem($content-default-width);
23
- }
22
+ .content-default {
23
+ max-width: px-to-rem($content-default-width);
24
+ }
24
25
 
25
- .content-slim {
26
- max-width: px-to-rem($content-slim-width);
27
- }
26
+ .content-slim {
27
+ max-width: px-to-rem($content-slim-width);
28
+ }
28
29
 
29
- .content-slimmest {
30
- max-width: px-to-rem($content-slimmest-width);
30
+ .content-slimmest {
31
+ max-width: px-to-rem($content-slimmest-width);
32
+ }
31
33
  }
32
34
  }
@@ -1,26 +1,30 @@
1
1
  @import './../mixins', './../variables';
2
2
 
3
3
  @layer base {
4
- a,
5
- .url {
6
- color: get-map($theme, 'link');
7
- text-decoration: underline;
8
- font-weight: 900;
9
- }
4
+ .v1styles {
5
+ a,
6
+ .url {
7
+ color: get-map($theme, 'link');
8
+ text-decoration: underline;
9
+ font-weight: 900;
10
+ }
10
11
 
11
- a {
12
- @include transition(color text-decoration-color);
12
+ a {
13
+ @include transition(color text-decoration-color);
13
14
 
14
- &:hover,
15
- &:focus,
16
- &:active {
17
- color: get-map($theme, 'link_hover');
15
+ &:hover,
16
+ &:focus,
17
+ &:active {
18
+ color: get-map($theme, 'link_hover');
19
+ }
18
20
  }
19
21
  }
20
22
  }
21
23
 
22
24
  @layer overrides {
23
- .url {
24
- font-weight: 900;
25
+ .v1styles {
26
+ .url {
27
+ font-weight: 900;
28
+ }
25
29
  }
26
30
  }
@@ -16,57 +16,59 @@ $li: (
16
16
  );
17
17
 
18
18
  @layer base {
19
- ol,
20
- ul {
21
- margin: 0 0 px-to-rem(get-map($ul, 'margin-bottom'));
22
- padding-left: px-to-rem(get-map($ul, 'padding-left'));
23
- display: block;
19
+ .v1styles {
20
+ ol,
21
+ ul {
22
+ margin: 0 0 px-to-rem(get-map($ul, 'margin-bottom'));
23
+ padding-left: px-to-rem(get-map($ul, 'padding-left'));
24
+ display: block;
24
25
 
25
- &.unstyled {
26
- list-style: none;
27
- padding-left: 0;
26
+ &.unstyled {
27
+ list-style: none;
28
+ padding-left: 0;
29
+ }
28
30
  }
29
- }
30
31
 
31
- ul.checkmarks {
32
- list-style: none;
32
+ ul.checkmarks {
33
+ list-style: none;
33
34
 
34
- li {
35
- position: relative;
36
- padding-left: px-to-rem(
37
- get-map($checkmarks, 'width') + get-map($checkmarks, 'margin-right')
38
- );
35
+ li {
36
+ position: relative;
37
+ padding-left: px-to-rem(
38
+ get-map($checkmarks, 'width') + get-map($checkmarks, 'margin-right')
39
+ );
39
40
 
40
- &::before {
41
- @include image('icons/check-inside-circle.svg', true);
41
+ &::before {
42
+ @include image('icons/check-inside-circle.svg', true);
42
43
 
43
- content: '';
44
- width: px-to-rem(get-map($checkmarks, 'width'));
45
- height: px-to-rem(get-map($checkmarks, 'width'));
46
- background: get-map($theme, 'list_checkmarks_bg');
47
- position: absolute;
48
- top: px-to-rem(get-map($checkmarks, 'top'));
49
- left: 0;
44
+ content: '';
45
+ width: px-to-rem(get-map($checkmarks, 'width'));
46
+ height: px-to-rem(get-map($checkmarks, 'width'));
47
+ background: get-map($theme, 'list_checkmarks_bg');
48
+ position: absolute;
49
+ top: px-to-rem(get-map($checkmarks, 'top'));
50
+ left: 0;
51
+ }
50
52
  }
51
53
  }
52
- }
53
-
54
- li {
55
- margin-bottom: px-to-rem(get-map($li, 'margin-bottom'));
56
54
 
57
- .text-small & {
58
- margin-bottom: px-to-rem(get-map($li, 'margin-bottom_sm'));
59
- }
55
+ li {
56
+ margin-bottom: px-to-rem(get-map($li, 'margin-bottom'));
60
57
 
61
- .text-medium & {
62
- margin-bottom: px-to-rem(get-map($li, 'margin-bottom_md'));
63
- }
58
+ .text-small & {
59
+ margin-bottom: px-to-rem(get-map($li, 'margin-bottom_sm'));
60
+ }
64
61
 
65
- &:last-child {
66
- margin-bottom: 0;
62
+ .text-medium & {
63
+ margin-bottom: px-to-rem(get-map($li, 'margin-bottom_md'));
64
+ }
67
65
 
68
- p:last-child {
66
+ &:last-child {
69
67
  margin-bottom: 0;
68
+
69
+ p:last-child {
70
+ margin-bottom: 0;
71
+ }
70
72
  }
71
73
  }
72
74
  }
@@ -7,15 +7,17 @@ $deleted-user: (
7
7
  );
8
8
 
9
9
  @layer base {
10
- .mention {
11
- &.deleted-user {
12
- background: get-map($theme, 'mention_deleted-user_bg');
13
- padding: px-to-rem(get-map($deleted-user, 'padding-vertical'))
14
- px-to-rem(get-map($deleted-user, 'padding-horizontal'));
15
- color: get-map($theme, 'mention_deleted-user');
16
- font-weight: 500;
17
- font-style: italic;
18
- border-radius: px-to-rem(get-map($deleted-user, 'border-radius'));
10
+ .v1styles {
11
+ .mention {
12
+ &.deleted-user {
13
+ background: get-map($theme, 'mention_deleted-user_bg');
14
+ padding: px-to-rem(get-map($deleted-user, 'padding-vertical'))
15
+ px-to-rem(get-map($deleted-user, 'padding-horizontal'));
16
+ color: get-map($theme, 'mention_deleted-user');
17
+ font-weight: 500;
18
+ font-style: italic;
19
+ border-radius: px-to-rem(get-map($deleted-user, 'border-radius'));
20
+ }
19
21
  }
20
22
  }
21
23
  }
@@ -5,65 +5,67 @@ $overlay: (
5
5
  );
6
6
 
7
7
  @layer base {
8
- body.has-overlay {
9
- overflow: hidden;
10
- }
8
+ .v1styles {
9
+ &.has-overlay {
10
+ overflow: hidden;
11
+ }
11
12
 
12
- .overlay {
13
- @include transition(opacity, 0.1s, ease);
13
+ .overlay {
14
+ @include transition(opacity, 0.1s, ease);
14
15
 
15
- width: 0;
16
- height: 0;
17
- background: get-map($theme, 'overlay');
18
- position: fixed;
19
- top: 0;
20
- left: 0;
21
- opacity: 0;
22
- z-index: -1;
23
- box-sizing: border-box;
24
- display: flex;
25
- flex-flow: column;
26
- align-items: center;
27
- overflow: hidden;
16
+ width: 0;
17
+ height: 0;
18
+ background: get-map($theme, 'overlay');
19
+ position: fixed;
20
+ top: 0;
21
+ left: 0;
22
+ opacity: 0;
23
+ z-index: -1;
24
+ box-sizing: border-box;
25
+ display: flex;
26
+ flex-flow: column;
27
+ align-items: center;
28
+ overflow: hidden;
28
29
 
29
- &.open {
30
- width: 100vw;
31
- height: 100vh;
32
- height: 100svh;
33
- opacity: 1;
34
- z-index: 996;
30
+ &.open {
31
+ width: 100vw;
32
+ height: 100vh;
33
+ height: 100svh;
34
+ opacity: 1;
35
+ z-index: 996;
35
36
 
36
- .overlay-close {
37
- display: block;
38
- }
37
+ .overlay-close {
38
+ display: block;
39
+ }
39
40
 
40
- &.in-portal {
41
- z-index: 1000;
41
+ &.in-portal {
42
+ z-index: 1000;
43
+ }
42
44
  }
43
- }
44
45
 
45
- > div,
46
- > section {
47
- width: 100vw;
48
- height: 100vh;
49
- margin-top: auto;
50
- margin-bottom: auto;
51
- overflow: hidden auto;
46
+ > div,
47
+ > section {
48
+ width: 100vw;
49
+ height: 100vh;
50
+ margin-top: auto;
51
+ margin-bottom: auto;
52
+ overflow: hidden auto;
53
+ }
52
54
  }
53
- }
54
55
 
55
- @include breakpoint('min-width', 'sm') {
56
- .overlay {
57
- &.open {
58
- padding: px-to-rem(get-map($overlay, 'padding'));
59
- overflow-y: auto;
60
- }
56
+ @include breakpoint('min-width', 'sm') {
57
+ .overlay {
58
+ &.open {
59
+ padding: px-to-rem(get-map($overlay, 'padding'));
60
+ overflow-y: auto;
61
+ }
61
62
 
62
- > div,
63
- > section {
64
- width: auto;
65
- height: auto;
66
- overflow: unset;
63
+ > div,
64
+ > section {
65
+ width: auto;
66
+ height: auto;
67
+ overflow: unset;
68
+ }
67
69
  }
68
70
  }
69
71
  }
@@ -1,7 +1,9 @@
1
1
  @import './../mixins', './../variables';
2
2
 
3
3
  @layer base {
4
- svg {
5
- color: get-map($default-colors, 'n700');
4
+ .v1styles {
5
+ svg {
6
+ color: get-map($default-colors, 'n700');
7
+ }
6
8
  }
7
9
  }