@apolitical/component-library 2.1.1-beta.0 → 2.1.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 (45) hide show
  1. package/banners/banner-section/banner-section.d.ts +1 -1
  2. package/banners/index.d.ts +0 -1
  3. package/banners/marketing-block/index.d.ts +1 -1
  4. package/context/global/global.providers.d.ts +2 -1
  5. package/form/components/form/components/fields/checkbox/checkbox.d.ts +5 -0
  6. package/form/components/form/components/fields/dropdown-menu/dropdown-menu.d.ts +1 -1
  7. package/form/components/form/components/fields/input/input.d.ts +5 -0
  8. package/form/components/form/form.types.d.ts +11 -0
  9. package/form/components/index.d.ts +0 -1
  10. package/general/image-container/image-container.d.ts +12 -0
  11. package/general/image-container/index.d.ts +1 -0
  12. package/general/index.d.ts +2 -0
  13. package/general/return-to-nav-button/index.d.ts +1 -0
  14. package/general/return-to-nav-button/return-to-nav-button.d.ts +9 -0
  15. package/index.js +20 -26
  16. package/index.mjs +5715 -6743
  17. package/layout/content-layout/columns/columns.d.ts +1 -1
  18. package/package.json +1 -3
  19. package/sections/full-width-section/full-width-section.d.ts +1 -6
  20. package/style.css +1 -1
  21. package/styles/base/_accessibility.scss +1 -4
  22. package/styles/base/_layout.scss +0 -4
  23. package/styles/base/_table.scss +0 -2
  24. package/styles/base/_text.scss +1 -1
  25. package/styles/base/_titles.scss +0 -10
  26. package/styles/base/form/_checkbox.scss +53 -0
  27. package/styles/base/form/_index.scss +1 -1
  28. package/styles/functions/_maps.scss +2 -18
  29. package/styles/mixins/_accessibility.scss +6 -0
  30. package/styles/mixins/_index.scss +2 -2
  31. package/styles/variables/colors/theme/_banners.scss +0 -3
  32. package/styles/variables/colors/theme/_form.scss +5 -3
  33. package/styles/variables/colors/theme/_general.scss +5 -0
  34. package/styles/variables/colors/theme/_index.scss +2 -2
  35. package/styles/variables/colors/theme/_pages.scss +0 -2
  36. package/styles/variables/colors/theme/_user.scss +0 -1
  37. package/user/index.d.ts +0 -1
  38. package/banners/banner/banner.d.ts +0 -11
  39. package/banners/banner/index.d.ts +0 -1
  40. package/form/components/toggle/index.d.ts +0 -1
  41. package/form/components/toggle/toggle.d.ts +0 -26
  42. package/styles/variables/colors/theme/_sections.scss +0 -7
  43. package/testing/__mocks__/tabbable.d.ts +0 -2
  44. package/user/directory/directory.d.ts +0 -18
  45. package/user/directory/index.d.ts +0 -1
@@ -28,9 +28,6 @@
28
28
  }
29
29
 
30
30
  .hidden {
31
- width: 0;
32
- height: 0;
33
- display: block;
34
- overflow: hidden;
31
+ @include hidden-element;
35
32
  }
36
33
  }
@@ -5,10 +5,6 @@
5
5
  display: none;
6
6
  }
7
7
 
8
- .center {
9
- text-align: center;
10
- }
11
-
12
8
  .content-slim {
13
9
  max-width: px-to-rem($content-slim-width);
14
10
  margin-left: auto;
@@ -16,8 +16,6 @@ $table: (
16
16
  px-to-rem(get-map($table, 'margin-bottom')) auto;
17
17
  border-collapse: separate;
18
18
  border-spacing: 0;
19
- display: table;
20
- overflow-x: auto;
21
19
 
22
20
  &,
23
21
  p,
@@ -25,7 +25,7 @@ $sup: (
25
25
  'font-size': 10,
26
26
  );
27
27
  $standard-text-elements: p, li, dt, dd;
28
- $special-text-elements: h1, h2, h3, h4, h5, h6, a, small;
28
+ $special-text-elements: h1, h2, h3, h4, h5, h6, a;
29
29
 
30
30
  @layer base {
31
31
  p,
@@ -45,7 +45,6 @@ $h3: (
45
45
  'line-height': 28,
46
46
  'line-height_md': 32,
47
47
  'margin-top': 60,
48
- 'margin-top_sibling': 32,
49
48
  'margin-bottom': 20,
50
49
  );
51
50
  $h4: (
@@ -175,15 +174,6 @@ $count-icon: (
175
174
  font-weight: 900;
176
175
  line-height: px-to-rem(get-map($h3, 'line-height'));
177
176
 
178
- h1 + &,
179
- h2 + &,
180
- h3 + &,
181
- h4 + &,
182
- h5 + &,
183
- h6 + & {
184
- margin-top: px-to-rem(get-map($h3, 'margin-top_sibling'));
185
- }
186
-
187
177
  @include breakpoint('min-width', 'md') {
188
178
  font-size: px-to-rem(get-map($h3, 'font-size_md'));
189
179
  line-height: px-to-rem(get-map($h3, 'line-height_md'));
@@ -0,0 +1,53 @@
1
+ @import '@/styles/functions', '@/styles/mixins', '@/styles/variables';
2
+
3
+ $pretty-checkbox: (
4
+ 'width': 24,
5
+ 'border': 1,
6
+ 'border-radius': 4,
7
+ 'tick-width': 11,
8
+ 'tick-height': 8,
9
+ 'top': 4,
10
+ 'margin-top': -4,
11
+ 'margin-left': -5.5,
12
+ );
13
+
14
+ @layer components {
15
+ .pretty-checkbox {
16
+ width: px-to-rem(get-map($pretty-checkbox, 'width'));
17
+ height: px-to-rem(get-map($pretty-checkbox, 'width'));
18
+ position: absolute;
19
+ top: px-to-rem(get-map($pretty-checkbox, 'top'));
20
+ left: 0;
21
+ border: px-to-rem(get-map($pretty-checkbox, 'border')) solid
22
+ get-map($theme, 'form_field_border');
23
+ border-radius: px-to-rem(get-map($pretty-checkbox, 'border-radius'));
24
+ box-sizing: border-box;
25
+ outline: none;
26
+ z-index: 10;
27
+
28
+ input:focus + &,
29
+ button:focus & {
30
+ box-shadow: $outline get-map($theme, 'default_focus');
31
+ }
32
+
33
+ input:checked + &,
34
+ .selected & {
35
+ background: get-map($theme, 'form_checkbox_bg');
36
+ border-color: get-map($theme, 'form_checkbox_border');
37
+
38
+ &::before {
39
+ @include image('icons/tick.svg', true);
40
+
41
+ content: '';
42
+ width: px-to-rem(get-map($pretty-checkbox, 'tick-width'));
43
+ height: px-to-rem(get-map($pretty-checkbox, 'tick-height'));
44
+ background: get-map($theme, 'form_checkbox_icon');
45
+ position: absolute;
46
+ top: 50%;
47
+ left: 50%;
48
+ margin-top: px-to-rem(get-map($pretty-checkbox, 'margin-top'));
49
+ margin-left: px-to-rem(get-map($pretty-checkbox, 'margin-left'));
50
+ }
51
+ }
52
+ }
53
+ }
@@ -1 +1 @@
1
- @import 'fields', 'form', 'labels', 'search-button';
1
+ @import 'checkbox', 'fields', 'form', 'labels', 'search-button';
@@ -2,26 +2,10 @@
2
2
  @use 'sass:map';
3
3
  @use 'sass:meta';
4
4
 
5
- @function get-map($map, $key, $children: ()) {
5
+ @function get-map($map, $key) {
6
6
  @if meta.variable-exists('map') and meta.type-of($map) == map {
7
7
  @if map.has-key($map, $key) {
8
- @if length($children) > 0 {
9
- $map: map.get($map, $key);
10
-
11
- @if length($children) == 1 {
12
- @return map.get($map, $children);
13
- } @else {
14
- $new-list: ();
15
- @for $i from 1 through length($children) {
16
- @if $i != 1 {
17
- $new-list: list.append($new-list, list.nth($children, $i), 'space');
18
- }
19
- }
20
- @return get-map($map, list.nth($children, 1), $new-list);
21
- }
22
- } @else {
23
- @return map.get($map, $key);
24
- }
8
+ @return map.get($map, $key);
25
9
  } @else {
26
10
  @error "ERROR: the key `#{$key}` does not exist in map.";
27
11
  }
@@ -0,0 +1,6 @@
1
+ @mixin hidden-element() {
2
+ width: 0;
3
+ height: 0;
4
+ display: block;
5
+ overflow: hidden;
6
+ }
@@ -1,2 +1,2 @@
1
- @import 'animations', 'backgrounds', 'breakpoints', 'browsers', 'containers', 'queries',
2
- 'selectors', 'styles', 'transitions';
1
+ @import 'accessibility', 'animations', 'backgrounds', 'breakpoints', 'browsers',
2
+ 'containers', 'queries', 'selectors', 'styles', 'transitions';
@@ -3,13 +3,10 @@
3
3
 
4
4
  $c: $default-colors;
5
5
  $banners: (
6
- banner_bg: get-map($c, 'n100'),
7
6
  banner-section: get-map($c, 'white'),
8
7
  banner-section_light: get-map($c, 'n700'),
9
8
  banner-section_bg: get-map($c, 'b700'),
10
9
  banner-section_light_bg: get-map($c, 'white'),
11
- banner-section_gradient_bg:
12
- linear-gradient(135deg, get-map($c, 'b700') 0%, get-map($c, 'g300') 100%),
13
10
  banner-section_overlay: get-map($c, 'n900'),
14
11
  banner-section_eyebrow: get-map($c, 'y300'),
15
12
  banner-section_light_eyebrow: get-map($c, 'b700'),
@@ -3,6 +3,11 @@
3
3
 
4
4
  $c: $default-colors;
5
5
  $form: (
6
+ dropdown_menu_border_top: get-map($c, 'n500'),
7
+ dropdown_action_bar_color: get-map($c, 'n600'),
8
+ dropdown_action_bar_button_color: get-map($c, 'n700'),
9
+ dropdown_action_bar_button_color_active_focus_hover: get-map($c, 'b700'),
10
+ dropdown_action_bar_button_color_active_focus_hover_override: get-map($c, 'white'),
6
11
  invite_form_border_focus: get-map($c, 'b500'),
7
12
  invite_form_shadow: get-map($c, 'b100'),
8
13
  invite_form_remove_email_button: get-map($c, 'n700'),
@@ -22,7 +27,4 @@ $form: (
22
27
  search_search-button_active_bg: get-map($c, 'white'),
23
28
  show_password: get-map($c, 'n600'),
24
29
  signup_form_error: get-map($c, 'error600'),
25
- toggle_bg: get-map($c, 'n100'),
26
- toggle_on_bg: get-map($c, 'b700'),
27
- toggle_switch_bg: get-map($c, 'white'),
28
30
  );
@@ -4,6 +4,11 @@
4
4
 
5
5
  $c: $default-colors;
6
6
  $general: (
7
+ image_container_bg: get-map($c, 'n50'),
8
+ image_container_bg_empty: get-map($c, 'white'),
9
+ return_to_nav_box_shadow: get-map($c, 'black'),
10
+ return_to_nav_bg_focus_active: get-map($c, 'white'),
11
+ return_to_nav_bg_before_after: get-map($c, 'b700'),
7
12
  tooltip: get-map($c, 'white'),
8
13
  tooltip_bg: color.adjust(get-map($c, 'n900'), $alpha: -0.1),
9
14
  );
@@ -1,8 +1,8 @@
1
1
  @import './../../../functions';
2
2
  @import 'banners', 'base', 'cards', 'communities', 'discussion', 'form', 'general',
3
- 'layout', 'loaders', 'modals', 'navigation', 'pages', 'sections', 'text', 'user';
3
+ 'layout', 'loaders', 'modals', 'navigation', 'pages', 'text', 'user';
4
4
 
5
5
  $theme: merge-maps(
6
6
  $banners $base $cards $communities $discussion $form $general $layout $loaders $modals
7
- $navigation $pages $sections $text $user
7
+ $navigation $pages $text $user
8
8
  );
@@ -3,8 +3,6 @@
3
3
 
4
4
  $c: $default-colors;
5
5
  $pages: (
6
- general-website-pages_subtitle: get-map($c, 'n700'),
7
- general-website-pages_subtitle_link: get-map($c, 'n600'),
8
6
  not-found_title: get-map($c, 'y300'),
9
7
  not-found_subtitle: get-map($c, 'white'),
10
8
  not-found_appended_bg: get-map($c, 'white'),
@@ -9,7 +9,6 @@ $user: (
9
9
  contributor_border: get-map($c, 'white'),
10
10
  contributor_inner-border: get-map($c, 'n200'),
11
11
  contributor_label: get-map($c, 'n600'),
12
- directory_hover_image: rgb(57 45 135 / 40%),
13
12
  member_highlighted_name: get-map($c, 'p500'),
14
13
  member_additional-content: get-map($c, 'n700'),
15
14
  member_small: get-map($c, 'n700'),
package/user/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from './contributors';
2
- export * from './directory';
3
2
  export * from './member';
4
3
  export * from './profile-picture';
@@ -1,11 +0,0 @@
1
- import { ResponsiveImageType } from '../../general';
2
- export interface BannerSectionType {
3
- /** Additional className */
4
- className?: string;
5
- /** The image to display */
6
- image?: string | ResponsiveImageType;
7
- /** Optional data test ID */
8
- testId?: string;
9
- }
10
- declare const Banner: ({ className, image, ...props }: BannerSectionType) => import("react/jsx-runtime").JSX.Element | null;
11
- export default Banner;
@@ -1 +0,0 @@
1
- export { default as Banner } from './banner';
@@ -1 +0,0 @@
1
- export { default as Toggle } from './toggle';
@@ -1,26 +0,0 @@
1
- interface Props {
2
- /** The ID of the toggle */
3
- id?: string;
4
- /** The label to show next to the toggle */
5
- label: string;
6
- /** The options for the toggle */
7
- options: {
8
- /** The text for the option, used for screen readers */
9
- label: string;
10
- /** The value for the option */
11
- value: boolean | string;
12
- }[];
13
- /** The initial value of the toggle */
14
- initialValue?: boolean | string;
15
- /** Functions to call when something changes */
16
- functions: {
17
- /** Callback function to run when the toggle is clicked */
18
- onChange: (value: boolean | string) => void;
19
- };
20
- /** Whether the toggle is disabled */
21
- isDisabled?: boolean;
22
- /** Additional class names */
23
- className?: string;
24
- }
25
- declare const Toggle: ({ id, label, options, initialValue, functions: { onChange }, isDisabled, className, }: Props) => import("react/jsx-runtime").JSX.Element;
26
- export default Toggle;
@@ -1,7 +0,0 @@
1
- @import './../colors';
2
- @import './../../../functions';
3
-
4
- $c: $default-colors;
5
- $sections: (
6
- full-width-section_light_bg: get-map($c, 'n50'),
7
- );
@@ -1,2 +0,0 @@
1
- export = tabbable;
2
- declare const tabbable: any;
@@ -1,18 +0,0 @@
1
- interface IDirectoryMember {
2
- /** The member's name */
3
- fullName: string;
4
- /** The member's job title */
5
- jobTitle: string;
6
- /** The organisation the member works for */
7
- organisation?: string;
8
- /** The member's profile picture */
9
- photo?: string;
10
- /** The member's profile text */
11
- text: string;
12
- }
13
- interface Props {
14
- /** The members to show */
15
- members: IDirectoryMember[];
16
- }
17
- declare const Directory: ({ members }: Props) => import("react/jsx-runtime").JSX.Element;
18
- export default Directory;
@@ -1 +0,0 @@
1
- export { default as Directory } from './directory';