@apolitical/component-library 3.5.13-ac.8 → 3.5.13-beta.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.
@@ -26,6 +26,12 @@ $title: (
26
26
  'margin-bottom': 16,
27
27
  'margin-bottom_md': 32,
28
28
  );
29
+ $title-new: (
30
+ 'font-size': 38,
31
+ 'font-size_md': 56,
32
+ 'margin-bottom': 32,
33
+ 'margin-bottom_md': 43,
34
+ );
29
35
  $h1: (
30
36
  'font-size': 28,
31
37
  'font-size_md': 40,
@@ -136,7 +142,7 @@ $count-icon: (
136
142
  }
137
143
  }
138
144
 
139
- @mixin title {
145
+ @mixin title($version: 'default') {
140
146
  margin-bottom: px-to-rem(get-map($title, 'margin-bottom'));
141
147
  font-size: px-to-rem(get-map($title, 'font-size'));
142
148
  color: get-map($theme, 'title');
@@ -148,6 +154,20 @@ $count-icon: (
148
154
  font-size: px-to-rem(get-map($title, 'font-size_md'));
149
155
  line-height: px-to-rem(get-map($title, 'line-height_md'));
150
156
  }
157
+
158
+ // TODO: remove the default/new divide when we move to new styling entirely
159
+ @if $version == 'new' {
160
+ margin-bottom: px-to-rem(get-map($title-new, 'margin-bottom'));
161
+ font-size: px-to-rem(get-map($title-new, 'font-size'));
162
+ font-weight: 700;
163
+ line-height: normal;
164
+ letter-spacing: unset;
165
+
166
+ @include breakpoint('min-width', 'md') {
167
+ font-size: px-to-rem(get-map($title-new, 'font-size_md'));
168
+ line-height: normal;
169
+ }
170
+ }
151
171
  }
152
172
 
153
173
  @mixin h1 {
@@ -5,6 +5,8 @@
5
5
  @layer base {
6
6
  button,
7
7
  .button {
8
+ @include transition(background color border-color text-decoration-color);
9
+
8
10
  background: get-map($theme, 'button_primary_bg');
9
11
  padding: px-to-rem(get-map($medium, 'padding-top'))
10
12
  px-to-rem(get-map($medium, 'padding-horizontal'))
@@ -43,6 +45,23 @@
43
45
  background: get-map($theme, 'button_primary_bg_focus');
44
46
  }
45
47
 
48
+ // TODO: remove when we have new styling
49
+ &.new {
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'));
55
+ color: get-map($theme, 'button_primary');
56
+
57
+ &:hover,
58
+ &:focus,
59
+ &:focus-visible,
60
+ &:active {
61
+ background: get-map($theme, 'button_new_primary_bg_hover');
62
+ }
63
+ }
64
+
46
65
  @each $size, $styles in $sizes {
47
66
  &.#{$size} {
48
67
  padding: px-to-rem(get-map($styles, 'padding-top'))
@@ -51,6 +70,14 @@
51
70
  px-to-rem(get-map($styles, 'padding-horizontal'));
52
71
  font-size: px-to-rem(get-map($styles, 'font-size'));
53
72
 
73
+ // TODO: remove `new` styling when we switch to new styling everywhere
74
+ &.new {
75
+ padding: px-to-rem(get-map($styles, 'padding-top_new'))
76
+ px-to-rem(get-map($styles, 'padding-horizontal_new'))
77
+ px-to-rem(get-map($styles, 'padding-bottom_new'))
78
+ px-to-rem(get-map($styles, 'padding-horizontal_new'));
79
+ }
80
+
54
81
  &.icon {
55
82
  margin-top: px-to-rem(get-map($styles, 'icon-offset'));
56
83
 
@@ -91,8 +118,6 @@
91
118
  }
92
119
 
93
120
  &.secondary {
94
- @include transition(background color border-color);
95
-
96
121
  background: get-map($theme, 'button_secondary_bg');
97
122
  border: px-to-rem(get-map($secondary, 'border')) solid
98
123
  get-map($theme, 'button_secondary_border');
@@ -163,17 +188,38 @@
163
188
  border-color: get-map($theme, 'button_secondary_border_disabled');
164
189
  }
165
190
  }
191
+
192
+ // TODO: remove when we have new styling
193
+ &.new {
194
+ border: none;
195
+
196
+ &,
197
+ &:hover,
198
+ &:active,
199
+ &:focus,
200
+ &:focus-visible {
201
+ color: get-map($theme, 'button_new_secondary');
202
+ }
203
+
204
+ &:hover,
205
+ &:active,
206
+ &:focus,
207
+ &:focus-visible {
208
+ background: get-map($theme, 'button_new_secondary_bg_hover');
209
+ }
210
+ }
166
211
  }
167
212
 
168
213
  &.tertiary {
169
- @include transition(color text-decoration-color);
170
-
171
- padding: px-to-rem(get-map($tertiary, 'padding-top'))
172
- px-to-rem(get-map($tertiary, 'padding-horizontal'))
173
- px-to-rem(get-map($tertiary, 'padding-bottom'))
174
- px-to-rem(get-map($tertiary, 'padding-horizontal'));
175
- bottom: px-to-rem(get-map($tertiary, 'padding-top'));
176
- right: px-to-rem(get-map($tertiary, 'padding-horizontal'));
214
+ &:not(.new) {
215
+ padding: px-to-rem(get-map($tertiary, 'padding-top'))
216
+ px-to-rem(get-map($tertiary, 'padding-horizontal'))
217
+ px-to-rem(get-map($tertiary, 'padding-bottom'))
218
+ px-to-rem(get-map($tertiary, 'padding-horizontal'));
219
+ bottom: px-to-rem(get-map($tertiary, 'padding-top'));
220
+ right: px-to-rem(get-map($tertiary, 'padding-horizontal'));
221
+ }
222
+
177
223
  text-decoration: underline;
178
224
  text-decoration-color: transparent;
179
225
 
@@ -226,6 +272,20 @@
226
272
  &.full-width {
227
273
  right: 0;
228
274
  }
275
+
276
+ // TODO: remove when we have new styling
277
+ &.new {
278
+ color: get-map($theme, 'button_new_tertiary');
279
+ text-decoration-color: currentcolor;
280
+
281
+ &:hover,
282
+ &:active,
283
+ &:focus,
284
+ &:focus-visible {
285
+ background: get-map($theme, 'button_new_secondary_bg_hover');
286
+ color: get-map($theme, 'button_new_secondary');
287
+ }
288
+ }
229
289
  }
230
290
 
231
291
  &.icon {
@@ -2,8 +2,11 @@
2
2
  $large: (
3
3
  'font-size': 18,
4
4
  'padding-top': 14,
5
+ 'padding-top_new': 20,
5
6
  'padding-horizontal': 24,
7
+ 'padding-horizontal_new': 113,
6
8
  'padding-bottom': 16,
9
+ 'padding-bottom_new': 24,
7
10
  'icon-width': 18,
8
11
  'icon-offset': 2,
9
12
  'icon-gutter': 12,
@@ -11,8 +14,11 @@ $large: (
11
14
  $medium: (
12
15
  'font-size': 16,
13
16
  'padding-top': 10,
17
+ 'padding-top_new': 14,
14
18
  'padding-horizontal': 24,
19
+ 'padding-horizontal_new': 65,
15
20
  'padding-bottom': 12,
21
+ 'padding-bottom_new': 16,
16
22
  'icon-width': 16,
17
23
  'icon-offset': 2,
18
24
  'icon-gutter': 10,
@@ -20,8 +26,11 @@ $medium: (
20
26
  $small: (
21
27
  'font-size': 14,
22
28
  'padding-top': 8,
29
+ 'padding-top_new': 10,
23
30
  'padding-horizontal': 16,
31
+ 'padding-horizontal_new': 35,
24
32
  'padding-bottom': 10,
33
+ 'padding-bottom_new': 12,
25
34
  'icon-width': 12,
26
35
  'icon-offset': 2,
27
36
  'icon-gutter': 8,
@@ -1,3 +1,4 @@
1
+ @use 'sass:list';
1
2
  @use 'sass:map';
2
3
 
3
4
  $breakpoint-sizes: (
@@ -10,12 +11,21 @@ $breakpoint-sizes: (
10
11
  // This mixin lets us use fast references for common breakpoints, using the map above,
11
12
  // and lets us reference custom breakpoints by passing in a number. It lets us code
12
13
  // breakpoints a bit faster by not having to type out the full media query each time.
13
- @mixin breakpoint($type, $breakpoint) {
14
- @if map-has-key($breakpoint-sizes, $breakpoint) {
15
- $breakpoint: map.get($breakpoint-sizes, $breakpoint);
14
+ @mixin breakpoint($types, $breakpoints) {
15
+ $media: ('only screen');
16
+ @for $i from 1 through length($types) {
17
+ $type: list.nth($types, $i);
18
+ $breakpoint: list.nth($breakpoints, $i);
19
+
20
+ @if map-has-key($breakpoint-sizes, list.nth($breakpoints, $i)) {
21
+ $breakpoint: map.get($breakpoint-sizes, list.nth($breakpoints, $i));
22
+ }
23
+
24
+ $query: 'and (#{$type}: #{$breakpoint}px)';
25
+ $media: list.append($media, $query, $separator: space);
16
26
  }
17
27
 
18
- @media only screen and (#{$type}: #{$breakpoint}px) {
28
+ @media #{$media} {
19
29
  @content;
20
30
  }
21
31
  }
@@ -11,6 +11,7 @@ $default-colors: (
11
11
  'b100': rgb(222 220 250 / 100%),
12
12
  'b200': rgb(197 194 245 / 100%),
13
13
  'b300': rgb(175 171 239 / 100%),
14
+ 'b400': rgb(119 107 224 / 100%),
14
15
  'b500': rgb(124 114 225 / 100%),
15
16
  'b600': rgb(101 89 212 / 100%),
16
17
  'b700': rgb(79 67 186 / 100%),
@@ -33,6 +34,7 @@ $default-colors: (
33
34
  'n700': rgb(64 74 97 / 100%),
34
35
  'n800': rgb(42 49 65 / 100%),
35
36
  'n900': rgb(21 25 33 / 100%),
37
+ 'n1000': rgb(23 23 23 / 100%),
36
38
  'p50': rgb(255 242 255 / 100%),
37
39
  'p100': rgb(238 200 237 / 100%),
38
40
  'p300': rgb(203 130 197 / 100%),
@@ -6,13 +6,16 @@ $banners: (
6
6
  banner_bg: get-map($c, 'n100'),
7
7
  banner-section: get-map($c, 'white'),
8
8
  banner-section_light: get-map($c, 'n700'),
9
+ banner-section_subtle: get-map($c, 'black'),
9
10
  banner-section_bg: get-map($c, 'b700'),
10
11
  banner-section_light_bg: get-map($c, 'white'),
11
12
  banner-section_gradient_bg:
12
13
  linear-gradient(135deg, get-map($c, 'b700') 0%, get-map($c, 'g300') 100%),
14
+ banner-section_subtle_bg: get-map($c, 'white'),
13
15
  banner-section_overlay: get-map($c, 'n900'),
14
16
  banner-section_eyebrow: get-map($c, 'y300'),
15
17
  banner-section_light_eyebrow: get-map($c, 'b700'),
18
+ banner-section_subtle_eyebrow: get-map($c, 'n700'),
16
19
  banner-section_light_title: get-map($c, 'n900'),
17
20
  custom-content-banner: get-map($c, 'n900'),
18
21
  custom-content-banner_bg: get-map($c, 'n50'),
@@ -18,7 +18,9 @@ $base: (
18
18
  link_hover: get-map($c, 'b800'),
19
19
  button_primary: get-map($c, 'white'),
20
20
  button_primary_bg: get-map($c, 'b700'),
21
+ button_new_primary_bg: get-map($c, 'black'),
21
22
  button_primary_bg_hover: get-map($c, 'b500'),
23
+ button_new_primary_bg_hover: get-map($c, 'b400'),
22
24
  button_primary_bg_active: get-map($c, 'b800'),
23
25
  button_primary_bg_focus: get-map($c, 'b600'),
24
26
  button_primary_bg_disabled: get-map($c, 'b700'),
@@ -27,6 +29,7 @@ $base: (
27
29
  button_primary_destructive_bg_hover: get-map($c, 'error700'),
28
30
  button_primary_destructive_box-shadow: get-map($c, 'error50'),
29
31
  button_secondary: get-map($c, 'b700'),
32
+ button_new_secondary: get-map($c, 'black'),
30
33
  button_secondary_focus: get-map($c, 'white'),
31
34
  button_secondary_muted: get-map($c, 'n600'),
32
35
  button_secondary_muted_hover: get-map($c, 'n700'),
@@ -34,6 +37,7 @@ $base: (
34
37
  button_secondary_disabled: get-map($c, 'b700'),
35
38
  button_secondary_bg: get-map($c, 'white'),
36
39
  button_secondary_bg_hover: get-map($c, 'b200'),
40
+ button_new_secondary_bg_hover: get-map($c, 'b200'),
37
41
  button_secondary_bg_focus: get-map($c, 'b600'),
38
42
  button_secondary_bg_active: get-map($c, 'b800'),
39
43
  button_secondary_bg_muted: get-map($c, 'white'),
@@ -47,6 +51,7 @@ $base: (
47
51
  button_secondary_border_disabled: get-map($c, 'b700'),
48
52
  button_secondary_border_destructive: get-map($c, 'error600'),
49
53
  button_tertiary: get-map($c, 'b700'),
54
+ button_new_tertiary: get-map($c, 'white'),
50
55
  button_tertiary_hover: get-map($c, 'b500'),
51
56
  button_tertiary_active: get-map($c, 'b800'),
52
57
  button_tertiary_muted: get-map($c, 'n600'),
@@ -13,8 +13,6 @@ $discussion: (
13
13
  discussion-form_bg: get-map($c, 'b50'),
14
14
  discussion-form_placeholder: get-map($c, 'n500'),
15
15
  discussion-form_small: get-map($c, 'n700'),
16
- discussion-post-border: get-map($c, 'n100'),
17
- discussion-post-hover-shadow: rgb(0 0 0 / 5%),
18
16
  discussion-question_bg: get-map($c, 'sand'),
19
17
  discussion-responses-heading_p: get-map($c, 'n600'),
20
18
  discussion-responses-heading_icon: get-map($c, 'n700'),
@@ -18,6 +18,7 @@ $navigation: (
18
18
  language-switcher_a: get-map($c, 'n900'),
19
19
  language-switcher_a_selected: get-map($c, 'b700'),
20
20
  language-switcher_a_hover: get-map($c, 'b800'),
21
+ logo_monochrome_bg: get-map($c, 'n1000'),
21
22
  more-menu: get-map($c, 'n700'),
22
23
  more-menu_hover_button_bg: get-map($c, 'b100'),
23
24
  more-menu_menu_bg: get-map($c, 'white'),
@@ -3,5 +3,7 @@
3
3
 
4
4
  $c: $default-colors;
5
5
  $sections: (
6
+ full-width-section_dark: get-map($c, 'white'),
6
7
  full-width-section_light_bg: get-map($c, 'n50'),
8
+ full-width-section_dark_bg: get-map($c, 'n1000'),
7
9
  );
@@ -3,6 +3,9 @@
3
3
 
4
4
  $c: $default-colors;
5
5
  $text: (
6
+ buckets_title: get-map($c, 'n1000'),
7
+ buckets_text: get-map($c, 'n600'),
8
+ buckets_hover_text: get-map($c, 'b500'),
6
9
  collapsible-section_bg: get-map($c, 'white'),
7
10
  collapsible-section_border: get-map($c, 'n500'),
8
11
  collapsible-section_icon: get-map($c, 'n900'),
@@ -0,0 +1,21 @@
1
+ interface Props {
2
+ /** The items to show for each bucket */
3
+ items: {
4
+ /** The title of the bucket */
5
+ title: string;
6
+ /** The text to display */
7
+ text: string;
8
+ /** The link to go to */
9
+ link: string;
10
+ /** Additional classes */
11
+ className?: string;
12
+ /** The type of event to send to GTM */
13
+ 'data-gtm-event-context'?: string;
14
+ /** The type of event to send to GTM */
15
+ 'data-gtm-event-type'?: string;
16
+ }[];
17
+ /** Additional classes */
18
+ className?: string;
19
+ }
20
+ declare const Buckets: ({ items, className, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
21
+ export default Buckets;
@@ -0,0 +1 @@
1
+ export { default as Buckets } from './buckets';
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { MarkdownToJSX } from 'markdown-to-jsx';
3
2
  interface Props {
4
3
  /** The language for the box text */
5
4
  locale?: string;
@@ -11,8 +10,7 @@ interface Props {
11
10
  hide?: string | false;
12
11
  /** The content to show when the section is expanded */
13
12
  text: string;
14
- markdownOptions?: MarkdownToJSX.Options;
15
13
  children?: React.ReactNode;
16
14
  }
17
- declare const HideShowTextBox: ({ className, show, hide, text, markdownOptions, children, }: Props) => import("react/jsx-runtime").JSX.Element | null;
15
+ declare const HideShowTextBox: ({ className, show, hide, text, children, }: Props) => import("react/jsx-runtime").JSX.Element | null;
18
16
  export default HideShowTextBox;
package/text/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './buckets';
1
2
  export * from './collapsible-section';
2
3
  export * from './content-type-label';
3
4
  export * from './empty-state-box';
@@ -1,11 +1,16 @@
1
1
  /// <reference types="react" />
2
+ import type { MemberDetailsProps } from '../../user';
2
3
  export type TestimonialBlockProps = {
3
4
  /** The name of the Testimonial's author */
4
5
  author?: string;
5
6
  /** The citation of the Testimonial's author */
6
7
  authorCite?: string;
8
+ /** The details of the member who gave the testimonial; this is rendered as a `Member` component instead of plain text */
9
+ member?: MemberDetailsProps;
7
10
  /** The content to display */
8
11
  content: string;
12
+ /** Additional classes */
13
+ className?: string;
9
14
  };
10
- declare const _default: import("react").MemoExoticComponent<({ author, authorCite, content }: TestimonialBlockProps) => import("react/jsx-runtime").JSX.Element>;
15
+ declare const _default: import("react").MemoExoticComponent<({ author, authorCite, content, member, className, }: TestimonialBlockProps) => import("react/jsx-runtime").JSX.Element>;
11
16
  export default _default;
@@ -4,6 +4,8 @@ export type MemberDetailsProps = {
4
4
  id?: string;
5
5
  /** The user's name */
6
6
  name?: string;
7
+ /** The user's profile URL; we usually get this from the ID, but we won't if `false` is passed in */
8
+ link?: false | string;
7
9
  /** The user's job title */
8
10
  jobTitle?: string;
9
11
  /** The organisation the user works for */
@@ -28,6 +30,11 @@ interface Props {
28
30
  createdAt?: Date | string;
29
31
  didEdit?: boolean;
30
32
  };
33
+ /** Optional styling */
34
+ styling?: {
35
+ /** The size of the component */
36
+ size?: 'medium' | 'large';
37
+ };
31
38
  /** The GTM context to use */
32
39
  gtmContext?: string;
33
40
  /** The GTM event to use */
@@ -37,7 +44,7 @@ interface Props {
37
44
  /** The language to use for the text */
38
45
  locale?: string;
39
46
  }
40
- declare const Member: ({ element, member: memberDetails, additionalContent, gtmContext, gtmType, className, }: Props) => React.DetailedReactHTMLElement<{
47
+ declare const Member: ({ element, member: memberDetails, additionalContent, styling, gtmContext, gtmType, className, }: Props) => React.DetailedReactHTMLElement<{
41
48
  className: string;
42
49
  children: import("react/jsx-runtime").JSX.Element;
43
50
  }, HTMLElement>;