@apolitical/component-library 1.4.1-beta.1 → 1.5.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 (36) hide show
  1. package/accessibility/visually-hidden/visually-hidden.d.ts +2 -1
  2. package/discussion/discussion.mock.d.ts +6 -33
  3. package/discussion/index.d.ts +2 -0
  4. package/discussion/post/post.d.ts +9 -1
  5. package/discussion/post/post.mock.d.ts +18 -0
  6. package/discussion/responses-heading/index.d.ts +1 -0
  7. package/discussion/responses-heading/responses-heading.d.ts +10 -0
  8. package/discussion/thread/index.d.ts +1 -0
  9. package/discussion/thread/thread.d.ts +11 -0
  10. package/general/buttons/button-wrapper/button-wrapper.d.ts +1 -0
  11. package/general/divider/divider.d.ts +6 -0
  12. package/general/divider/index.d.ts +1 -0
  13. package/general/index.d.ts +1 -0
  14. package/general/link/link.d.ts +1 -1
  15. package/index.js +45 -49
  16. package/index.mjs +6277 -5989
  17. package/layout/page-layout/page-layout.d.ts +1 -1
  18. package/modals/index.d.ts +1 -0
  19. package/modals/modal/modal.d.ts +19 -2
  20. package/modals/overlay/index.d.ts +2 -0
  21. package/modals/overlay/overlay.d.ts +36 -0
  22. package/modals/overlay/overlay.helpers.d.ts +5 -0
  23. package/navigation/index.d.ts +1 -0
  24. package/navigation/more-menu/index.d.ts +2 -0
  25. package/navigation/more-menu/more-menu.d.ts +37 -0
  26. package/package.json +1 -1
  27. package/style.css +1 -1
  28. package/styles/base/_overlays.scss +41 -7
  29. package/styles/base/buttons/_buttons.scss +6 -4
  30. package/styles/base/buttons/_icons.scss +7 -1
  31. package/styles/variables/colors/_theme.scss +27 -8
  32. package/text/helper-text-box/helper-text-box.d.ts +1 -1
  33. package/text/index.d.ts +1 -1
  34. package/text/status-banner/index.d.ts +1 -0
  35. package/text/{alert/alert.d.ts → status-banner/status-banner.d.ts} +2 -2
  36. package/text/alert/index.d.ts +0 -1
@@ -1,8 +1,13 @@
1
1
  @use 'sass:map';
2
- @import './../mixins',
2
+ @import './../functions',
3
+ './../mixins',
3
4
  './../variables';
4
5
 
6
+ $overlay: ('padding': 48);
7
+
5
8
  @layer base {
9
+ body.has-overlay { overflow: hidden; }
10
+
6
11
  .overlay {
7
12
  @include transition(opacity, 0.1s, ease);
8
13
 
@@ -14,13 +19,42 @@
14
19
  left: 0;
15
20
  opacity: 0;
16
21
  z-index: -1;
22
+ box-sizing: border-box;
23
+ display: flex;
24
+ flex-flow: column;
25
+ align-items: center;
26
+ overflow: hidden;
17
27
 
18
- &.open {
19
- width: 100vw;
20
- height: 100vh;
21
- opacity: 1;
22
- z-index: 998;
23
- }
28
+ &.open {
29
+ width: 100vw;
30
+ height: 100vh;
31
+ opacity: 1;
32
+ z-index: 998;
33
+ }
34
+
35
+ > div, > section {
36
+ width: 100vw;
37
+ height: 100vh;
38
+ margin-top: auto;
39
+ margin-bottom: auto;
40
+ overflow-x: hidden;
41
+ overflow-y: auto;
42
+ }
24
43
 
25
44
  }
45
+
46
+ @include breakpoint('min-width', 'sm') {
47
+ .overlay {
48
+ &.open {
49
+ padding: px-to-rem(map.get($overlay, 'padding'));
50
+ overflow-y: auto;
51
+ }
52
+
53
+ > div, > section {
54
+ width: auto;
55
+ height: auto;
56
+ overflow: unset;
57
+ }
58
+ }
59
+ }
26
60
  }
@@ -96,14 +96,16 @@
96
96
  &.muted {
97
97
  border-color: map.get($theme, 'button_secondary_border_muted');
98
98
 
99
- &, &:hover, &:active, &:focus, &:focus-visible {
99
+ &, &:active {
100
100
  background: map.get($theme, 'button_secondary_bg_muted');
101
101
  color: map.get($theme, 'button_secondary_muted');
102
102
  }
103
103
 
104
- &:hover, &:focus, &:focus-visible {
105
- color: map.get($theme, 'button_secondary_muted_hover');
106
- }
104
+ &:hover, &:focus, &:focus-visible {
105
+ background: map.get($theme, 'button_secondary_bg_muted_hover');
106
+ color: map.get($theme, 'button_secondary_muted_hover');
107
+ border-color: map.get($theme, 'button_secondary_border_muted_hover');
108
+ }
107
109
  }
108
110
 
109
111
  &.disabled {
@@ -14,11 +14,17 @@ $icons: ('arrow_left', (d, d, 3, 8), (d, d, 3, 8), (d, d, 4, 7)),
14
14
  ('arrow-down', (d, d, 4, 10), (d, d, 3, 8), (d, d, 4, d)),
15
15
  ('chevron_left', (16, 16, 4, 8), (14, 14, 3, 8), (14, 14, d, d)),
16
16
  ('chevron_right', (16, 16, 4, 8), (14, 14, 3, 8), (14, 14, d, d)),
17
+ ('close', (48, 48, 0, 0), (32, 32, 0, 0), (24, 24, 0, 0)),
18
+ ('ellipsis', (48, 48, 0, 0), (32, 32, 0, 0), (16, 16, 0, 0)),
19
+ ('flag', (22, 22, 0, 10), (18, 18, 1, d), (d, d, 3, 10)),
17
20
  ('heart', (22, 22, 0, 10), (18, 18, 1, d), (d, d, 3, 10)),
18
21
  ('heart_empty', (22, 22, 0, 10), (18, 18, 1, d), (d, d, 3, 10)),
19
22
  ('navigation_arrow', (d, d, 4, 10), (d, d, d, d), (14, 14, d, 10)),
20
23
  ('pencil', (d, d, d, d), (d, d, d, 11), (d, d, 3, 9)),
24
+ ('pencil-paper', (22, 22, 0, 10), (18, 18, 1, d), (d, d, 3, 10)),
25
+ ('share', (22, 22, 0, 10), (18, 18, 1, d), (d, d, 3, 10)),
21
26
  ('speech-bubble_square_thick', (22, 22, 0, 10), (18, 18, 1, d), (d, d, 3, 10)),
22
27
  ('star', (16, 16, 0, 0), (d, d, 0, 0), (16, 16, 0, 0)),
23
28
  ('star_empty', (16, 16, 0, 0), (d, d, 0, 0), (16, 16, 0, 0)),
24
- ('tick', (14, 11, 8, 10), (14, 11, 5, 8), (9, 7, 6, 6));
29
+ ('tick', (14, 11, 8, 10), (14, 11, 5, 8), (9, 7, 6, 6)),
30
+ ('trash', (22, 22, 0, 10), (18, 18, 1, d), (d, d, 3, 10));
@@ -33,17 +33,19 @@ $theme: (
33
33
  button_secondary: map.get($c, 'b700'),
34
34
  button_secondary_focus: map.get($c, 'white'),
35
35
  button_secondary_muted: map.get($c, 'n600'),
36
- button_secondary_muted_hover: map.get($c, 'b700'),
36
+ button_secondary_muted_hover: map.get($c, 'n700'),
37
37
  button_secondary_disabled: map.get($c, 'b700'),
38
38
  button_secondary_bg: map.get($c, 'white'),
39
39
  button_secondary_bg_hover: map.get($c, 'b200'),
40
40
  button_secondary_bg_focus: map.get($c, 'b600'),
41
41
  button_secondary_bg_active: map.get($c, 'b800'),
42
42
  button_secondary_bg_muted: map.get($c, 'white'),
43
+ button_secondary_bg_muted_hover: map.get($c, 'n200'),
43
44
  button_secondary_bg_disabled: map.get($c, 'white'),
44
45
  button_secondary_border: map.get($c, 'b700'),
45
46
  button_secondary_border_focus: transparent,
46
47
  button_secondary_border_muted: map.get($c, 'n200'),
48
+ button_secondary_border_muted_hover: map.get($c, 'n500'),
47
49
  button_secondary_border_disabled: map.get($c, 'b700'),
48
50
 
49
51
  button_tertiary: map.get($c, 'b700'),
@@ -103,14 +105,21 @@ $theme: (
103
105
  marketing-block_tertiary_bg_2: map.get($c, 'p600'),
104
106
 
105
107
  // Discussion
108
+ discussion-actions: map.get($c, 'n600'),
109
+ discussion-actions_hover_bg: map.get($c, 'b100'),
110
+ discussion-actions_likes_liked: map.get($c, 'p500'),
111
+ discussion-actions_likes_liked_bg: map.get($c, 'p500'),
112
+
106
113
  discussion-form_bg: map.get($c, 'b50'),
107
114
  discussion-form_placeholder: map.get($c, 'n500'),
108
115
  discussion-form_small: map.get($c, 'n700'),
109
116
 
110
- discussion-likes: map.get($c, 'n600'),
111
- discussion-likes_hover_bg: map.get($c, 'b100'),
112
- discussion-likes_liked: map.get($c, 'p500'),
113
- discussion-likes_liked_bg: map.get($c, 'p500'),
117
+ discussion-question_bg: map.get($c, 'sand'),
118
+
119
+ discussion-responses-heading_p: map.get($c, 'n600'),
120
+ discussion-responses-heading_icon: map.get($c, 'n700'),
121
+
122
+ discussion-thread_border: map.get($c, 'n200'),
114
123
 
115
124
  // Form
116
125
  password-rules: map.get($c, 'error600'),
@@ -186,6 +195,8 @@ $theme: (
186
195
  // Modals
187
196
  modal_bg: map.get($c, 'white'),
188
197
  modal_shadow: rgba(42 49 65 / 30%),
198
+ modal_close: map.get($c, 'n700'),
199
+ modal_close_hover_bg: map.get($c, 'b100'),
189
200
 
190
201
  // Navigation
191
202
  filters: map.get($c, 'n700'),
@@ -198,14 +209,16 @@ $theme: (
198
209
  filters_outline: map.get($c, 'n200'),
199
210
  filters_selected_outline: map.get($c, 'g200'),
200
211
 
212
+ more-menu: map.get($c, 'n700'),
213
+ more-menu_hover_button_bg: map.get($c, 'b100'),
214
+ more-menu_menu_bg: map.get($c, 'white'),
215
+ more-menu_menu_shadow: rgba(0 0 0 / 10%),
216
+
201
217
  tags: map.get($c, 'b700'),
202
218
  tags_light: map.get($c, 'p500'),
203
219
 
204
220
 
205
221
  // Text
206
- alert_success: map.get($c, 'success600'),
207
- alert_error: map.get($c, 'error600'),
208
-
209
222
  collapsible-section_bg: map.get($c, 'white'),
210
223
  collapsible-section_border: map.get($c, 'n500'),
211
224
  collapsible-section_icon: map.get($c, 'n900'),
@@ -234,6 +247,12 @@ $theme: (
234
247
  pill: map.get($c, 'n700'),
235
248
  pill_bg: map.get($c, 'y300'),
236
249
 
250
+ status-banner_bg: map.get($c, 'y50'),
251
+ status-banner_success_bg: map.get($c, 'success50'),
252
+ status-banner_success_icon: map.get($c, 'success600'),
253
+ status-banner_error_bg: map.get($c, 'error50'),
254
+ status-banner_error_icon: map.get($c, 'error600'),
255
+
237
256
  // User
238
257
  contributor: map.get($c, 'n700'),
239
258
  contributor_bg: map.get($c, 'white'),
@@ -8,7 +8,7 @@ interface Props {
8
8
  /** The heading to display at the top of the box */
9
9
  heading?: string | false;
10
10
  /** The content to display in the box */
11
- children: React.ReactNode;
11
+ children: React.ReactNode | JSX.Element | string;
12
12
  }
13
13
  declare const HelperTextBox: ({ type, className, heading, children }: Props) => import("react/jsx-runtime").JSX.Element;
14
14
  export default HelperTextBox;
package/text/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from './alert';
2
1
  export * from './collapsible-section';
3
2
  export * from './empty-state-box';
4
3
  export * from './helper-text-box';
@@ -6,3 +5,4 @@ export * from './hide-show-text-box';
6
5
  export * from './highlighted-text-box';
7
6
  export * from './markdown-text';
8
7
  export * from './pill';
8
+ export * from './status-banner';
@@ -0,0 +1 @@
1
+ export { default as StatusBanner } from './status-banner';
@@ -11,7 +11,7 @@ interface Props {
11
11
  /** Test ID for Jest tests */
12
12
  'data-testid'?: string;
13
13
  }
14
- declare const Alert: ({ element, children, className, ...props }: Props) => React.DetailedReactHTMLElement<{
14
+ declare const StatusBanner: ({ element, children, className, ...props }: Props) => React.DetailedReactHTMLElement<{
15
15
  className: string;
16
16
  'aria-live': "assertive";
17
17
  /** Optional ID, for errors */
@@ -19,4 +19,4 @@ declare const Alert: ({ element, children, className, ...props }: Props) => Reac
19
19
  /** Test ID for Jest tests */
20
20
  'data-testid'?: string | undefined;
21
21
  }, HTMLElement>;
22
- export default Alert;
22
+ export default StatusBanner;
@@ -1 +0,0 @@
1
- export { default as Alert } from './alert';