@apolitical/component-library 9.0.0-pla.3 → 9.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.
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 -1
  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 +16022 -15568
  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 +18 -16
  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 +6 -4
  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
@@ -10,77 +10,79 @@ $table: (
10
10
  );
11
11
 
12
12
  @layer base {
13
- table {
14
- width: 100%;
15
- margin: px-to-rem(get-map($table, 'margin-top')) auto
16
- px-to-rem(get-map($table, 'margin-bottom'));
17
- border-collapse: separate;
18
- border-spacing: 0;
19
- display: table;
20
- overflow-x: auto;
13
+ .v1styles {
14
+ table {
15
+ width: 100%;
16
+ margin: px-to-rem(get-map($table, 'margin-top')) auto
17
+ px-to-rem(get-map($table, 'margin-bottom'));
18
+ border-collapse: separate;
19
+ border-spacing: 0;
20
+ display: table;
21
+ overflow-x: auto;
21
22
 
22
- &,
23
- p,
24
- li {
25
- text-align: left;
23
+ &,
24
+ p,
25
+ li {
26
+ text-align: left;
27
+ }
26
28
  }
27
- }
28
-
29
- th,
30
- td {
31
- border: px-to-rem(get-map($table, 'border')) solid get-map($theme, 'table_border');
32
- vertical-align: top;
33
- }
34
-
35
- th,
36
- tbody:first-child tr:first-child td {
37
- background: get-map($theme, 'table_th_bg');
38
- padding: px-to-rem(get-map($table, 'padding-horizontal'));
39
- color: get-map($theme, 'table_th');
40
- font-weight: 600;
41
- border-right-width: 0;
42
29
 
43
- /* Add border radius to the corners of the table, not each cell */
44
- &:first-child {
45
- border-top-left-radius: px-to-rem(get-map($table, 'border-radius'));
30
+ th,
31
+ td {
32
+ border: px-to-rem(get-map($table, 'border')) solid get-map($theme, 'table_border');
33
+ vertical-align: top;
46
34
  }
47
35
 
48
- &:last-child {
49
- border-top-right-radius: px-to-rem(get-map($table, 'border-radius'));
50
- border-right-width: px-to-rem(get-map($table, 'border'));
51
- }
52
- }
36
+ th,
37
+ tbody:first-child tr:first-child td {
38
+ background: get-map($theme, 'table_th_bg');
39
+ padding: px-to-rem(get-map($table, 'padding-horizontal'));
40
+ color: get-map($theme, 'table_th');
41
+ font-weight: 600;
42
+ border-right-width: 0;
53
43
 
54
- td {
55
- padding: px-to-rem(get-map($table, 'padding-vertical'))
56
- px-to-rem(get-map($table, 'padding-horizontal'));
57
- border-top-width: 0;
58
- border-right-width: 0;
44
+ /* Add border radius to the corners of the table, not each cell */
45
+ &:first-child {
46
+ border-top-left-radius: px-to-rem(get-map($table, 'border-radius'));
47
+ }
59
48
 
60
- /* Prevent borders with double width due to using border-collapse separate */
61
- &:last-child {
62
- border-right-width: px-to-rem(get-map($table, 'border'));
49
+ &:last-child {
50
+ border-top-right-radius: px-to-rem(get-map($table, 'border-radius'));
51
+ border-right-width: px-to-rem(get-map($table, 'border'));
52
+ }
63
53
  }
64
- }
65
54
 
66
- tr:last-child {
67
55
  td {
68
- &:first-child {
69
- border-bottom-left-radius: px-to-rem(get-map($table, 'border-radius'));
70
- }
56
+ padding: px-to-rem(get-map($table, 'padding-vertical'))
57
+ px-to-rem(get-map($table, 'padding-horizontal'));
58
+ border-top-width: 0;
59
+ border-right-width: 0;
71
60
 
61
+ /* Prevent borders with double width due to using border-collapse separate */
72
62
  &:last-child {
73
- border-bottom-right-radius: px-to-rem(get-map($table, 'border-radius'));
63
+ border-right-width: px-to-rem(get-map($table, 'border'));
74
64
  }
75
65
  }
76
- }
77
66
 
78
- // Remove the styling if there's only one row as some old articles use tables
79
- // to display buttons inline
80
- tr:first-child:last-child {
81
- td {
82
- background: none;
83
- border: none;
67
+ tr:last-child {
68
+ td {
69
+ &:first-child {
70
+ border-bottom-left-radius: px-to-rem(get-map($table, 'border-radius'));
71
+ }
72
+
73
+ &:last-child {
74
+ border-bottom-right-radius: px-to-rem(get-map($table, 'border-radius'));
75
+ }
76
+ }
77
+ }
78
+
79
+ // Remove the styling if there's only one row as some old articles use tables
80
+ // to display buttons inline
81
+ tr:first-child:last-child {
82
+ td {
83
+ background: none;
84
+ border: none;
85
+ }
84
86
  }
85
87
  }
86
88
  }
@@ -28,148 +28,150 @@ $standard-text-elements: p, li, dt, dd, summary;
28
28
  $special-text-elements: h1, h2, h3, h4, h5, h6, a, small, span, label, legend;
29
29
 
30
30
  @layer base {
31
- p,
32
- li,
33
- small {
34
- color: get-map($theme, 'text');
35
- font-weight: 500;
36
-
37
- .error &,
38
- &.error {
39
- color: get-map($theme, 'text_error');
31
+ .v1styles {
32
+ p,
33
+ li,
34
+ small {
35
+ color: get-map($theme, 'text');
36
+ font-weight: 500;
37
+
38
+ .error &,
39
+ &.error {
40
+ color: get-map($theme, 'text_error');
41
+ }
40
42
  }
41
- }
42
43
 
43
- #{$standard-text-elements} {
44
- font-size: px-to-rem(get-map($default, 'font-size'));
45
- line-height: px-to-rem(get-map($default, 'line-height'));
44
+ #{$standard-text-elements} {
45
+ font-size: px-to-rem(get-map($default, 'font-size'));
46
+ line-height: px-to-rem(get-map($default, 'line-height'));
46
47
 
47
- // These have been split out to allow us to overwrite with a direct class on the element.
48
- .text-small & {
49
- font-size: px-to-rem(get-map($small, 'font-size'));
50
- line-height: px-to-rem(get-map($small, 'line-height'));
51
- letter-spacing: px-to-rem(get-map($small, 'letter-spacing'));
52
- }
48
+ // These have been split out to allow us to overwrite with a direct class on the element.
49
+ .text-small & {
50
+ font-size: px-to-rem(get-map($small, 'font-size'));
51
+ line-height: px-to-rem(get-map($small, 'line-height'));
52
+ letter-spacing: px-to-rem(get-map($small, 'letter-spacing'));
53
+ }
53
54
 
54
- .text-medium & {
55
- font-size: px-to-rem(get-map($medium, 'font-size'));
56
- line-height: px-to-rem(get-map($medium, 'line-height'));
57
- }
55
+ .text-medium & {
56
+ font-size: px-to-rem(get-map($medium, 'font-size'));
57
+ line-height: px-to-rem(get-map($medium, 'line-height'));
58
+ }
58
59
 
59
- &.text-small {
60
- font-size: px-to-rem(get-map($small, 'font-size'));
61
- line-height: px-to-rem(get-map($small, 'line-height'));
62
- letter-spacing: px-to-rem(get-map($small, 'letter-spacing'));
63
- }
60
+ &.text-small {
61
+ font-size: px-to-rem(get-map($small, 'font-size'));
62
+ line-height: px-to-rem(get-map($small, 'line-height'));
63
+ letter-spacing: px-to-rem(get-map($small, 'letter-spacing'));
64
+ }
64
65
 
65
- &.text-medium {
66
- font-size: px-to-rem(get-map($medium, 'font-size'));
67
- line-height: px-to-rem(get-map($medium, 'line-height'));
66
+ &.text-medium {
67
+ font-size: px-to-rem(get-map($medium, 'font-size'));
68
+ line-height: px-to-rem(get-map($medium, 'line-height'));
69
+ }
68
70
  }
69
- }
70
71
 
71
- p {
72
- margin-bottom: px-to-rem(get-map($default, 'margin-bottom'));
72
+ p {
73
+ margin-bottom: px-to-rem(get-map($default, 'margin-bottom'));
73
74
 
74
- // These have been split out to allow us to overwrite with a direct class on the element.
75
- .text-small & {
76
- margin-bottom: px-to-rem(get-map($small, 'margin-bottom'));
77
- }
75
+ // These have been split out to allow us to overwrite with a direct class on the element.
76
+ .text-small & {
77
+ margin-bottom: px-to-rem(get-map($small, 'margin-bottom'));
78
+ }
78
79
 
79
- .text-medium & {
80
- margin-bottom: px-to-rem(get-map($medium, 'margin-bottom'));
81
- }
80
+ .text-medium & {
81
+ margin-bottom: px-to-rem(get-map($medium, 'margin-bottom'));
82
+ }
82
83
 
83
- &.text-small {
84
- margin-bottom: px-to-rem(get-map($small, 'margin-bottom'));
85
- }
84
+ &.text-small {
85
+ margin-bottom: px-to-rem(get-map($small, 'margin-bottom'));
86
+ }
86
87
 
87
- &.text-medium {
88
- margin-bottom: px-to-rem(get-map($medium, 'margin-bottom'));
88
+ &.text-medium {
89
+ margin-bottom: px-to-rem(get-map($medium, 'margin-bottom'));
90
+ }
89
91
  }
90
- }
91
92
 
92
- small {
93
- font-size: px-to-rem(get-map($small, 'font-size'));
94
- line-height: px-to-rem(get-map($small, 'line-height'));
93
+ small {
94
+ font-size: px-to-rem(get-map($small, 'font-size'));
95
+ line-height: px-to-rem(get-map($small, 'line-height'));
95
96
 
96
- @include breakpoint('min-width', 'md') {
97
- font-size: px-to-rem(get-map($small, 'font-size_md'));
97
+ @include breakpoint('min-width', 'md') {
98
+ font-size: px-to-rem(get-map($small, 'font-size_md'));
99
+ }
98
100
  }
99
- }
100
-
101
- strong {
102
- font-weight: 900;
103
- }
104
-
105
- em,
106
- i {
107
- font-style: italic;
108
- }
109
-
110
- sup,
111
- sub {
112
- font-size: px-to-rem(get-map($sup, 'font-size'));
113
- line-height: normal;
114
- }
115
101
 
116
- sup {
117
- vertical-align: super;
118
- }
119
-
120
- sub {
121
- vertical-align: sub;
122
- }
123
-
124
- address {
125
- font-style: normal;
126
- }
102
+ strong {
103
+ font-weight: 900;
104
+ }
127
105
 
128
- #{$special-text-elements} {
129
- &.text-small {
130
- font-size: px-to-rem(get-map($small, 'font-size'));
131
- line-height: px-to-rem(get-map($small, 'line-height'));
106
+ em,
107
+ i {
108
+ font-style: italic;
132
109
  }
133
110
 
134
- &.text-medium {
135
- font-size: px-to-rem(get-map($medium, 'font-size'));
136
- line-height: px-to-rem(get-map($medium, 'line-height'));
111
+ sup,
112
+ sub {
113
+ font-size: px-to-rem(get-map($sup, 'font-size'));
114
+ line-height: normal;
137
115
  }
138
- }
139
116
 
140
- @include breakpoint('min-width', 'md') {
141
- #{$standard-text-elements} {
142
- font-size: px-to-rem(get-map($default, 'font-size_md'));
143
- line-height: px-to-rem(get-map($default, 'line-height_md'));
117
+ sup {
118
+ vertical-align: super;
119
+ }
144
120
 
145
- // These have been split out to allow us to overwrite with a direct class on the element.
146
- .text-small & {
147
- font-size: px-to-rem(get-map($small, 'font-size_md'));
148
- }
121
+ sub {
122
+ vertical-align: sub;
123
+ }
149
124
 
150
- .text-medium & {
151
- font-size: px-to-rem(get-map($medium, 'font-size_md'));
152
- line-height: px-to-rem(get-map($medium, 'line-height_md'));
153
- }
125
+ address {
126
+ font-style: normal;
127
+ }
154
128
 
129
+ #{$special-text-elements} {
155
130
  &.text-small {
156
- font-size: px-to-rem(get-map($small, 'font-size_md'));
131
+ font-size: px-to-rem(get-map($small, 'font-size'));
132
+ line-height: px-to-rem(get-map($small, 'line-height'));
157
133
  }
158
134
 
159
135
  &.text-medium {
160
- font-size: px-to-rem(get-map($medium, 'font-size_md'));
161
- line-height: px-to-rem(get-map($medium, 'line-height_md'));
136
+ font-size: px-to-rem(get-map($medium, 'font-size'));
137
+ line-height: px-to-rem(get-map($medium, 'line-height'));
162
138
  }
163
139
  }
164
140
 
165
- #{$special-text-elements} {
166
- &.text-small {
167
- font-size: px-to-rem(get-map($small, 'font-size_md'));
141
+ @include breakpoint('min-width', 'md') {
142
+ #{$standard-text-elements} {
143
+ font-size: px-to-rem(get-map($default, 'font-size_md'));
144
+ line-height: px-to-rem(get-map($default, 'line-height_md'));
145
+
146
+ // These have been split out to allow us to overwrite with a direct class on the element.
147
+ .text-small & {
148
+ font-size: px-to-rem(get-map($small, 'font-size_md'));
149
+ }
150
+
151
+ .text-medium & {
152
+ font-size: px-to-rem(get-map($medium, 'font-size_md'));
153
+ line-height: px-to-rem(get-map($medium, 'line-height_md'));
154
+ }
155
+
156
+ &.text-small {
157
+ font-size: px-to-rem(get-map($small, 'font-size_md'));
158
+ }
159
+
160
+ &.text-medium {
161
+ font-size: px-to-rem(get-map($medium, 'font-size_md'));
162
+ line-height: px-to-rem(get-map($medium, 'line-height_md'));
163
+ }
168
164
  }
169
165
 
170
- &.text-medium {
171
- font-size: px-to-rem(get-map($medium, 'font-size_md'));
172
- line-height: px-to-rem(get-map($medium, 'line-height_md'));
166
+ #{$special-text-elements} {
167
+ &.text-small {
168
+ font-size: px-to-rem(get-map($small, 'font-size_md'));
169
+ }
170
+
171
+ &.text-medium {
172
+ font-size: px-to-rem(get-map($medium, 'font-size_md'));
173
+ line-height: px-to-rem(get-map($medium, 'line-height_md'));
174
+ }
173
175
  }
174
176
  }
175
177
  }
@@ -275,58 +275,72 @@ $count-icon: (
275
275
  }
276
276
 
277
277
  @layer base {
278
- .highlighted-title {
279
- @include highlight;
280
- }
278
+ .v1styles {
279
+ .highlighted-title {
280
+ @include highlight;
281
+ }
281
282
 
282
- .pre-title {
283
- @include pre-title;
284
- }
283
+ .pre-title {
284
+ @include pre-title;
285
+ }
285
286
 
286
- .title {
287
- @include title;
288
- }
287
+ .title {
288
+ @include title;
289
+ }
289
290
 
290
- h1 {
291
- @include h1;
292
- }
291
+ .helper-text-box {
292
+ p {
293
+ font-size: px-to-rem(14);
294
+ line-height: px-to-rem(16);
295
+ }
293
296
 
294
- h2 {
295
- @include h2;
296
- }
297
+ .title {
298
+ font-weight: 900;
299
+ margin-bottom: px-to-rem(8);
300
+ }
301
+ }
297
302
 
298
- h3 {
299
- @include h3;
300
- }
303
+ h1 {
304
+ @include h1;
305
+ }
301
306
 
302
- h4 {
303
- @include h4;
304
- }
307
+ h2 {
308
+ @include h2;
309
+ }
305
310
 
306
- h5 {
307
- @include h5;
308
- }
311
+ h3 {
312
+ @include h3;
313
+ }
309
314
 
310
- h6 {
311
- @include h6;
312
- }
315
+ h4 {
316
+ @include h4;
317
+ }
313
318
 
314
- .subtitle {
315
- @include subtitle;
316
- }
319
+ h5 {
320
+ @include h5;
321
+ }
322
+
323
+ h6 {
324
+ @include h6;
325
+ }
326
+
327
+ .subtitle {
328
+ @include subtitle;
329
+ }
317
330
 
318
- .count {
319
- &::before {
320
- @include image('icons/middot.svg', true);
321
-
322
- content: '';
323
- width: px-to-rem(get-map($count-icon, 'width'));
324
- height: px-to-rem(get-map($count-icon, 'width'));
325
- background: currentcolor;
326
- position: relative;
327
- top: px-to-rem(get-map($count-icon, 'offset'));
328
- margin: 0 px-to-rem(get-map($count-icon, 'margin-horizontal'));
329
- display: inline-block;
331
+ .count {
332
+ &::before {
333
+ @include image('icons/middot.svg', true);
334
+
335
+ content: '';
336
+ width: px-to-rem(get-map($count-icon, 'width'));
337
+ height: px-to-rem(get-map($count-icon, 'width'));
338
+ background: currentcolor;
339
+ position: relative;
340
+ top: px-to-rem(get-map($count-icon, 'offset'));
341
+ margin: 0 px-to-rem(get-map($count-icon, 'margin-horizontal'));
342
+ display: inline-block;
343
+ }
330
344
  }
331
345
  }
332
346
  }
@@ -5,36 +5,38 @@ $button-wrapper-button: (
5
5
  );
6
6
 
7
7
  @layer base {
8
- .button-wrapper {
9
- list-style: none;
10
- margin: 0 auto;
11
- padding: 0;
12
- line-height: normal;
13
- display: flex;
14
- flex-flow: row wrap;
15
- place-content: center;
16
-
17
- li,
18
- > button,
19
- > .button {
20
- margin: 0 px-to-rem(get-map($button-wrapper-button, 'margin'))
21
- px-to-rem(get-map($button-wrapper-button, 'margin'));
22
- }
23
-
24
- li {
8
+ .v1styles {
9
+ .button-wrapper {
10
+ list-style: none;
11
+ margin: 0 auto;
12
+ padding: 0;
25
13
  line-height: normal;
26
14
  display: flex;
27
- align-content: center;
15
+ flex-flow: row wrap;
16
+ place-content: center;
28
17
 
29
- &:last-child {
30
- margin-bottom: px-to-rem(get-map($button-wrapper-button, 'margin'));
18
+ li,
19
+ > button,
20
+ > .button {
21
+ margin: 0 px-to-rem(get-map($button-wrapper-button, 'margin'))
22
+ px-to-rem(get-map($button-wrapper-button, 'margin'));
31
23
  }
32
- }
33
24
 
34
- button,
35
- .button {
36
- margin-top: auto;
37
- margin-bottom: auto;
25
+ li {
26
+ line-height: normal;
27
+ display: flex;
28
+ align-content: center;
29
+
30
+ &:last-child {
31
+ margin-bottom: px-to-rem(get-map($button-wrapper-button, 'margin'));
32
+ }
33
+ }
34
+
35
+ button,
36
+ .button {
37
+ margin-top: auto;
38
+ margin-bottom: auto;
39
+ }
38
40
  }
39
41
  }
40
42
  }