@apolitical/component-library 1.1.4 → 1.2.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 (32) hide show
  1. package/discussion/conversation/conversation.d.ts +13 -0
  2. package/discussion/conversation/index.d.ts +1 -0
  3. package/discussion/discussion.helpers.d.ts +5 -0
  4. package/discussion/form/form.d.ts +3 -3
  5. package/discussion/index.d.ts +2 -0
  6. package/discussion/likes/likes.d.ts +4 -0
  7. package/discussion/post/index.d.ts +1 -0
  8. package/discussion/post/post.d.ts +37 -0
  9. package/general/link/link.d.ts +2 -2
  10. package/index.js +72 -72
  11. package/index.mjs +9923 -9227
  12. package/package.json +1 -1
  13. package/style.css +1 -1
  14. package/styles/base/_index.scss +1 -0
  15. package/styles/base/_table.scss +71 -0
  16. package/styles/variables/colors/_theme.scss +5 -0
  17. package/text/index.d.ts +1 -0
  18. package/text/markdown-text/components/case-study/case-study.d.ts +5 -0
  19. package/text/markdown-text/components/case-study/index.d.ts +1 -0
  20. package/text/markdown-text/components/details/details.d.ts +9 -0
  21. package/text/markdown-text/components/details/index.d.ts +1 -0
  22. package/text/markdown-text/components/div/div.d.ts +6 -0
  23. package/text/markdown-text/components/div/index.d.ts +1 -0
  24. package/text/markdown-text/components/empty-component/empty-component.d.ts +5 -0
  25. package/text/markdown-text/components/empty-component/index.d.ts +1 -0
  26. package/text/markdown-text/components/iframe/iframe.d.ts +8 -0
  27. package/text/markdown-text/components/iframe/index.d.ts +1 -0
  28. package/text/markdown-text/components/index.d.ts +6 -0
  29. package/text/markdown-text/components/link/index.d.ts +1 -0
  30. package/text/markdown-text/components/link/link.d.ts +8 -0
  31. package/text/markdown-text/index.d.ts +1 -0
  32. package/text/markdown-text/markdown-text.d.ts +10 -0
@@ -8,5 +8,6 @@
8
8
  'links',
9
9
  'lists',
10
10
  'overlays',
11
+ 'table',
11
12
  'text',
12
13
  'titles';
@@ -0,0 +1,71 @@
1
+ @use 'sass:map';
2
+ @import './../functions',
3
+ './../variables';
4
+
5
+ $table: ('margin-top': 64, 'margin-bottom': 32, 'padding-vertical': 12, 'padding-horizontal': 20, 'border': 1, 'border-radius': 8);
6
+
7
+ @layer base {
8
+ table {
9
+ width: 100%;
10
+ margin: px-to-rem(map.get($table, 'margin-top')) auto px-to-rem(map.get($table, 'margin-bottom')) auto;
11
+ border-collapse: separate;
12
+ border-spacing: 0;
13
+
14
+ &, p, li { text-align: left; }
15
+ }
16
+
17
+ th, td {
18
+ border: px-to-rem(map.get($table, 'border')) solid map.get($theme, 'table_border');
19
+ vertical-align: top;
20
+ }
21
+
22
+ th, tbody:first-child tr:first-child td {
23
+ background: map.get($theme, 'table_th_bg');
24
+ padding: px-to-rem(map.get($table, 'padding-horizontal'));
25
+ color: map.get($theme, 'table_th');
26
+ font-weight: 600;
27
+ border-right-width: 0;
28
+
29
+ /* Add border radius to the corners of the table, not each cell */
30
+ &:first-child {
31
+ border-top-left-radius: px-to-rem(map.get($table, 'border-radius'));
32
+ }
33
+
34
+ &:last-child {
35
+ border-top-right-radius: px-to-rem(map.get($table, 'border-radius'));
36
+ border-right-width: px-to-rem(map.get($table, 'border'));
37
+ }
38
+ }
39
+
40
+ td {
41
+ padding: px-to-rem(map.get($table, 'padding-vertical')) px-to-rem(map.get($table, 'padding-horizontal'));
42
+ border-top-width: 0;
43
+ border-right-width: 0;
44
+
45
+ /* Prevent borders with double width due to using border-collapse separate */
46
+ &:last-child {
47
+ border-right-width: px-to-rem(map.get($table, 'border'));
48
+ }
49
+ }
50
+
51
+ tr:last-child {
52
+ td {
53
+ &:first-child {
54
+ border-bottom-left-radius: px-to-rem(map.get($table, 'border-radius'));
55
+ }
56
+
57
+ &:last-child {
58
+ border-bottom-right-radius: px-to-rem(map.get($table, 'border-radius'));
59
+ }
60
+ }
61
+ }
62
+
63
+ // Remove the styling if there's only one row as some old articles use tables
64
+ // to display buttons inline
65
+ tr:first-child:last-child {
66
+ td {
67
+ background: none;
68
+ border: none;
69
+ }
70
+ }
71
+ }
@@ -71,6 +71,10 @@ $theme: (
71
71
  form_input_focus_box-shadow: map.get($c, 'b100'),
72
72
  form_search-button_bg: map.get($c, 'n900'),
73
73
 
74
+ table_border: map.get($c, 'n200'),
75
+ table_th: map.get($c, 'white'),
76
+ table_th_bg: map.get($c, 'n600'),
77
+
74
78
  overlay: rgb(21 25 33 / 25%),
75
79
 
76
80
  // Banners
@@ -104,6 +108,7 @@ $theme: (
104
108
  discussion-form_small: map.get($c, 'n700'),
105
109
 
106
110
  discussion-likes: map.get($c, 'n600'),
111
+ discussion-likes_hover_bg: map.get($c, 'b100'),
107
112
  discussion-likes_liked: map.get($c, 'p500'),
108
113
  discussion-likes_liked_bg: map.get($c, 'p500'),
109
114
 
package/text/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export * from './empty-state-box';
4
4
  export * from './helper-text-box';
5
5
  export * from './hide-show-text-box';
6
6
  export * from './highlighted-text-box';
7
+ export * from './markdown-text';
7
8
  export * from './pill';
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare const _default: ({ children }: {
3
+ children?: React.ReactNode | string;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as CaseStudy } from './case-study';
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ /** The content to show */
4
+ children?: React.ReactNode;
5
+ /** The language to use for the text */
6
+ locale?: string;
7
+ }
8
+ declare const DetailsWrapper: ({ locale, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default DetailsWrapper;
@@ -0,0 +1 @@
1
+ export { default as Details } from './details';
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const _default: ({ children, ...props }: {
3
+ children: React.ReactNode | string;
4
+ class?: string | undefined;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as Div } from './div';
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare const _default: () => React.ExoticComponent<{
3
+ children?: React.ReactNode;
4
+ }>;
5
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as EmptyComponent } from './empty-component';
@@ -0,0 +1,8 @@
1
+ interface Props {
2
+ /** The iframe `src` */
3
+ src: string;
4
+ /** The language to use for the text */
5
+ locale?: string;
6
+ }
7
+ declare const IFrameWrapper: ({ locale, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default IFrameWrapper;
@@ -0,0 +1 @@
1
+ export { default as IFrame } from './iframe';
@@ -0,0 +1,6 @@
1
+ export { EmptyComponent } from './empty-component';
2
+ export { CaseStudy } from './case-study';
3
+ export { Details } from './details';
4
+ export { Div } from './div';
5
+ export { IFrame } from './iframe';
6
+ export { Link } from './link';
@@ -0,0 +1 @@
1
+ export { default as Link } from './link';
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ declare const _default: ({ children, ...props }: {
3
+ children: React.ReactNode;
4
+ href?: string | undefined;
5
+ target?: "_blank" | "_self" | "_parent" | "_top" | undefined;
6
+ className?: string | undefined;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as MarkdownText } from './markdown-text';
@@ -0,0 +1,10 @@
1
+ interface Props {
2
+ /** Additional classes */
3
+ className?: string;
4
+ /** The options to pass to the markdown parser */
5
+ options?: any;
6
+ /** The content to be parsed */
7
+ children: string;
8
+ }
9
+ declare const MarkdownText: ({ className, options, children }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export default MarkdownText;