@apolitical/component-library 1.9.0 → 1.9.2
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.
- package/4TNE5QTO-80ea09b3.js +987 -0
- package/{4TNE5QTO-128d9bfa.mjs → 4TNE5QTO-a7c3a370.mjs} +3 -4
- package/constants/contact-details.d.ts +8 -0
- package/constants/index.d.ts +1 -0
- package/general/link/link.d.ts +7 -1
- package/index-ad400da7.mjs +23290 -0
- package/index-b0222665.js +101 -0
- package/index.d.ts +0 -1
- package/index.js +1 -1
- package/index.mjs +68 -150
- package/navigation/index.d.ts +1 -0
- package/navigation/language-switcher/index.d.ts +1 -0
- package/navigation/language-switcher/language-switcher.d.ts +37 -0
- package/navigation/language-switcher/language-switcher.helpers.d.ts +2 -0
- package/navigation/language-switcher/language-switcher.mock.d.ts +29 -0
- package/package.json +1 -1
- package/style.css +1 -1
- package/styles/variables/colors/_theme.scss +5 -0
- package/4TNE5QTO-acef2331.js +0 -987
- package/index-6e9a2b8a.js +0 -240
- package/index-cfa68ef5.mjs +0 -47532
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-b0222665.js");require("react");require("react/jsx-runtime");exports.ASSETS_BUCKET=e.ASSETS_BUCKET;exports.ActivitiesFeed=e.ActivitiesFeed;exports.ActivitySection=e.ActivitySection;exports.AddPost=e.AddPost;exports.BannerSection=e.bannerSection;exports.Breadcrumbs=e.Breadcrumbs;exports.Button=e.Button;exports.ButtonWrapper=e.ButtonWrapper;exports.CollapsibleSection=e.CollapsibleSection;exports.Columns=e.Columns;exports.CommunityDetails=e.CommunityDetails;exports.Contributors=e.Contributors;exports.ConversationContext=e.ConversationContext;exports.CookieBanner=e.CookieBanner;exports.DiscussionConversation=e.Conversation;exports.DiscussionForm=e.Form;exports.DiscussionLikes=e.Likes;exports.DiscussionPost=e.Post;exports.DiscussionThread=e.Thread;exports.Divider=e.Divider;exports.DownloadSection=e.DownloadSection;exports.EMAILS=e.EMAILS;exports.EmailHelperTextBox=e.EmailHelperTextBox;exports.EmptyStateBox=e.EmptyStateBox;exports.Filters=e.Filters;exports.Footer=e.Footer;exports.FullWidthSection=e.FullWidthSection;exports.Header=e.Header;exports.HelperTextBox=e.HelperTextBox;exports.HiddenFromScreenReaders=e.HiddenFromScreenReaders;exports.HideShowTextBox=e.HideShowTextBox;exports.HighlightedTextBox=e.HighlightedTextBoxWrapper;exports.IntlProvider=e.IntlProvider;exports.JoinButton=e.JoinButton;exports.LanguageSwitcher=e.LanguageSwitcher;exports.Link=e.Link;exports.LoadMore=e.LoadMore;exports.LoadingBlock=e.loadingBlock;exports.LoadingPlaceholder=e.LoadingPlaceholder;exports.LoadingState=e.LoadingState;exports.Logo=e.Logo;exports.LogoSection=e.LogoSection;exports.MarkdownText=e.MarkdownText;exports.MarketingBox=e.MarketingBlock;exports.Member=e.Member;exports.MembersList=e.MembersList;exports.Modal=e.Modal;exports.MoreMenu=e.MoreMenu;exports.NUMBER_OF_USERS=e.NUMBER_OF_USERS;exports.Overlay=e.Overlay;exports.PageLayout=e.PageLayout;exports.PasswordRules=e.passwordRules;exports.Pill=e.Pill;exports.ProfilePicture=e.ProfilePicture;exports.ProgressBar=e.ProgressBar;exports.Rating=e.Rating;exports.ReactQueryProvider=e.ReactQueryProvider;exports.RepliesFeed=e.RepliesFeed;exports.ResponsesHeading=e.ResponsesHeading;exports.ResponsiveImage=e.ResponsiveImage;exports.SearchForm=e.SearchForm;exports.Span=e.Span;exports.StatusBanner=e.StatusBanner;exports.Tags=e.Tags;exports.Tooltip=e.Tooltip;exports.UserContext=e.UserContext;exports.UserProvider=e.UserProvider;exports.VisuallyHidden=e.VisuallyHidden;exports.addAriaProps=e.addAriaProps;exports.getMember=e.getMember;exports.headerData=e.headerData;exports.mapGetStreamData=e.mapGetSteamData;exports.useEffectAfterMount=e.useEffectAfterMount;exports.useFeatureFlag=e.useFeatureFlag;exports.useScreenWidth=e.useScreenWidth;exports.useScrollListener=e.useScrollListener;exports.useScrollToHash=e.useScrollToHash;
|
package/index.mjs
CHANGED
|
@@ -1,164 +1,82 @@
|
|
|
1
|
-
import { O as
|
|
1
|
+
import { O as t, a5 as i, a7 as r, Y as n, G as d, aB as l, ac as u, ad as c, aL as S, an as g, K as m, aU as B, _ as p, ap as x, Z as L, a0 as P, a1 as M, a2 as T, a4 as h, ae as F, aI as v, Q as C, a8 as D, aM as H, aC as R, aq as E, aJ as y, ar as A, aN as b, H as k, aO as U, aP as f, T as w, L as W, aD as I, af as O, aE as _, at as G, au as J, av as K, aG as N, aK as Q, aQ as V, J as X, aV as j, N as q, ay as z, aF as Y, R as Z, az as $, ao as aa, a9 as sa, aS as ea, aX as oa, aw as ta, aa as ia, X as ra, a6 as na, a3 as da, ag as la, ab as ua, aR as ca, aT as Sa, aH as ga, ah as ma, U as Ba, W as pa, V as xa, aA as La, aW as Pa, as as Ma, ax as Ta, ai as ha, aj as Fa, ak as va, al as Ca, am as Da } from "./index-ad400da7.mjs";
|
|
2
2
|
import "react";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
|
-
import "react-dom";
|
|
5
4
|
export {
|
|
6
|
-
|
|
5
|
+
t as ASSETS_BUCKET,
|
|
7
6
|
i as ActivitiesFeed,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
r as ActivitySection,
|
|
8
|
+
n as AddPost,
|
|
9
|
+
d as BannerSection,
|
|
10
|
+
l as Breadcrumbs,
|
|
12
11
|
u as Button,
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
c as ButtonWrapper,
|
|
13
|
+
S as CollapsibleSection,
|
|
15
14
|
g as Columns,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
m as CommunityDetails,
|
|
16
|
+
B as Contributors,
|
|
17
|
+
p as ConversationContext,
|
|
19
18
|
x as CookieBanner,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
E as
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
w as
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
19
|
+
L as DiscussionConversation,
|
|
20
|
+
P as DiscussionForm,
|
|
21
|
+
M as DiscussionLikes,
|
|
22
|
+
T as DiscussionPost,
|
|
23
|
+
h as DiscussionThread,
|
|
24
|
+
F as Divider,
|
|
25
|
+
v as DownloadSection,
|
|
26
|
+
C as EMAILS,
|
|
27
|
+
D as EmailHelperTextBox,
|
|
28
|
+
H as EmptyStateBox,
|
|
29
|
+
R as Filters,
|
|
30
|
+
E as Footer,
|
|
31
|
+
y as FullWidthSection,
|
|
32
|
+
A as Header,
|
|
33
|
+
b as HelperTextBox,
|
|
34
|
+
k as HiddenFromScreenReaders,
|
|
35
|
+
U as HideShowTextBox,
|
|
36
|
+
f as HighlightedTextBox,
|
|
37
|
+
w as IntlProvider,
|
|
38
|
+
W as JoinButton,
|
|
39
|
+
I as LanguageSwitcher,
|
|
40
|
+
O as Link,
|
|
41
|
+
_ as LoadMore,
|
|
42
|
+
G as LoadingBlock,
|
|
43
|
+
J as LoadingPlaceholder,
|
|
44
|
+
K as LoadingState,
|
|
44
45
|
N as Logo,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
Q as LogoSection,
|
|
47
|
+
V as MarkdownText,
|
|
48
|
+
X as MarketingBox,
|
|
49
|
+
j as Member,
|
|
50
|
+
q as MembersList,
|
|
51
|
+
z as Modal,
|
|
51
52
|
Y as MoreMenu,
|
|
52
53
|
Z as NUMBER_OF_USERS,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
$ as Overlay,
|
|
55
|
+
aa as PageLayout,
|
|
56
|
+
sa as PasswordRules,
|
|
56
57
|
ea as Pill,
|
|
57
|
-
|
|
58
|
+
oa as ProfilePicture,
|
|
58
59
|
ta as ProgressBar,
|
|
59
|
-
|
|
60
|
+
ia as Rating,
|
|
60
61
|
ra as ReactQueryProvider,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
Da as
|
|
81
|
-
Pa as findAllByPlaceholderText,
|
|
82
|
-
Ra as findAllByRole,
|
|
83
|
-
La as findAllByTestId,
|
|
84
|
-
Fa as findAllByText,
|
|
85
|
-
Ea as findAllByTitle,
|
|
86
|
-
Ma as findByAltText,
|
|
87
|
-
va as findByDisplayValue,
|
|
88
|
-
Ha as findByLabelText,
|
|
89
|
-
Ca as findByPlaceholderText,
|
|
90
|
-
ka as findByRole,
|
|
91
|
-
Qa as findByTestId,
|
|
92
|
-
wa as findByText,
|
|
93
|
-
Ia as findByTitle,
|
|
94
|
-
Va as fireEvent,
|
|
95
|
-
Ua as getAllByAltText,
|
|
96
|
-
Wa as getAllByDisplayValue,
|
|
97
|
-
Oa as getAllByLabelText,
|
|
98
|
-
Na as getAllByPlaceholderText,
|
|
99
|
-
_a as getAllByRole,
|
|
100
|
-
Ga as getAllByTestId,
|
|
101
|
-
Ja as getAllByText,
|
|
102
|
-
Ka as getAllByTitle,
|
|
103
|
-
za as getByAltText,
|
|
104
|
-
Xa as getByDisplayValue,
|
|
105
|
-
Ya as getByLabelText,
|
|
106
|
-
Za as getByPlaceholderText,
|
|
107
|
-
ja as getByRole,
|
|
108
|
-
$a as getByTestId,
|
|
109
|
-
ae as getByText,
|
|
110
|
-
ee as getByTitle,
|
|
111
|
-
se as getConfig,
|
|
112
|
-
te as getDefaultNormalizer,
|
|
113
|
-
le as getElementError,
|
|
114
|
-
re as getMember,
|
|
115
|
-
ie as getMultipleElementsFoundError,
|
|
116
|
-
oe as getNodeText,
|
|
117
|
-
ye as getQueriesForElement,
|
|
118
|
-
ne as getRoles,
|
|
119
|
-
be as getSuggestedQuery,
|
|
120
|
-
ue as headerData,
|
|
121
|
-
de as isInaccessible,
|
|
122
|
-
Be as logDOM,
|
|
123
|
-
ge as logRoles,
|
|
124
|
-
Te as makeFindQuery,
|
|
125
|
-
ce as makeGetAllQuery,
|
|
126
|
-
Ae as makeSingleQuery,
|
|
127
|
-
xe as mapGetStreamData,
|
|
128
|
-
pe as prettyDOM,
|
|
129
|
-
me as prettyFormat,
|
|
130
|
-
Se as queries,
|
|
131
|
-
fe as queryAllByAltText,
|
|
132
|
-
qe as queryAllByAttribute,
|
|
133
|
-
he as queryAllByDisplayValue,
|
|
134
|
-
De as queryAllByLabelText,
|
|
135
|
-
Pe as queryAllByPlaceholderText,
|
|
136
|
-
Re as queryAllByRole,
|
|
137
|
-
Le as queryAllByTestId,
|
|
138
|
-
Fe as queryAllByText,
|
|
139
|
-
Ee as queryAllByTitle,
|
|
140
|
-
Me as queryByAltText,
|
|
141
|
-
ve as queryByAttribute,
|
|
142
|
-
He as queryByDisplayValue,
|
|
143
|
-
Ce as queryByLabelText,
|
|
144
|
-
ke as queryByPlaceholderText,
|
|
145
|
-
Qe as queryByRole,
|
|
146
|
-
we as queryByTestId,
|
|
147
|
-
Ie as queryByText,
|
|
148
|
-
Ve as queryByTitle,
|
|
149
|
-
Ue as queryHelpers,
|
|
150
|
-
We as render,
|
|
151
|
-
Oe as renderHook,
|
|
152
|
-
Ne as screen,
|
|
153
|
-
_e as setup,
|
|
154
|
-
Ge as useEffectAfterMount,
|
|
155
|
-
Je as useFeatureFlag,
|
|
156
|
-
Ke as useScreenWidth,
|
|
157
|
-
ze as useScrollListener,
|
|
158
|
-
Xe as useScrollToHash,
|
|
159
|
-
Ye as waitFor,
|
|
160
|
-
Ze as waitForElementToBeRemoved,
|
|
161
|
-
je as within,
|
|
162
|
-
$e as wrapAllByQueryWithSuggestion,
|
|
163
|
-
as as wrapSingleQueryWithSuggestion
|
|
62
|
+
na as RepliesFeed,
|
|
63
|
+
da as ResponsesHeading,
|
|
64
|
+
la as ResponsiveImage,
|
|
65
|
+
ua as SearchForm,
|
|
66
|
+
ca as Span,
|
|
67
|
+
Sa as StatusBanner,
|
|
68
|
+
ga as Tags,
|
|
69
|
+
ma as Tooltip,
|
|
70
|
+
Ba as UserContext,
|
|
71
|
+
pa as UserProvider,
|
|
72
|
+
xa as VisuallyHidden,
|
|
73
|
+
La as addAriaProps,
|
|
74
|
+
Pa as getMember,
|
|
75
|
+
Ma as headerData,
|
|
76
|
+
Ta as mapGetStreamData,
|
|
77
|
+
ha as useEffectAfterMount,
|
|
78
|
+
Fa as useFeatureFlag,
|
|
79
|
+
va as useScreenWidth,
|
|
80
|
+
Ca as useScrollListener,
|
|
81
|
+
Da as useScrollToHash
|
|
164
82
|
};
|
package/navigation/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as LanguageSwitcher } from './language-switcher';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare const supportedLanguages: {
|
|
2
|
+
en: string;
|
|
3
|
+
es: string;
|
|
4
|
+
fr: string;
|
|
5
|
+
pt: string;
|
|
6
|
+
};
|
|
7
|
+
export type LanguageType = keyof typeof supportedLanguages;
|
|
8
|
+
export type UrlPartsType = {
|
|
9
|
+
url: string;
|
|
10
|
+
position: 'before-lang' | 'after-lang';
|
|
11
|
+
}[];
|
|
12
|
+
interface Props {
|
|
13
|
+
/** The language the content is in */
|
|
14
|
+
currentLanguage: LanguageType;
|
|
15
|
+
/** Whether article is the original language or not */
|
|
16
|
+
isOriginalLanguage?: boolean;
|
|
17
|
+
/** Whether article has been translated by a real person or not */
|
|
18
|
+
isHumanTranslation?: boolean;
|
|
19
|
+
/** Which translations are available */
|
|
20
|
+
translations: {
|
|
21
|
+
[key in LanguageType]?: null | {
|
|
22
|
+
post_name?: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/** The function to call when the language is changed */
|
|
26
|
+
onChange?: (language?: LanguageType) => void;
|
|
27
|
+
/** Additional parts of the URL */
|
|
28
|
+
urlParts?: UrlPartsType;
|
|
29
|
+
/** The version of the language switcher to use */
|
|
30
|
+
variant?: 'default' | 'short';
|
|
31
|
+
/** Optional text to show before the language options */
|
|
32
|
+
label?: string;
|
|
33
|
+
/** Additional classes */
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
declare const LanguageSwitcher: ({ currentLanguage, isOriginalLanguage, isHumanTranslation, translations, onChange, urlParts, variant, label, className, }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
37
|
+
export default LanguageSwitcher;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
let currentLanguage: string;
|
|
3
|
+
let isOriginalLanguage: boolean;
|
|
4
|
+
let isHumanTranslation: boolean;
|
|
5
|
+
let urlParts: {
|
|
6
|
+
url: string;
|
|
7
|
+
position: string;
|
|
8
|
+
}[];
|
|
9
|
+
namespace translations {
|
|
10
|
+
let en: null;
|
|
11
|
+
namespace es {
|
|
12
|
+
let canonical_url: string;
|
|
13
|
+
let post_name: string;
|
|
14
|
+
}
|
|
15
|
+
namespace fr {
|
|
16
|
+
let canonical_url_1: string;
|
|
17
|
+
export { canonical_url_1 as canonical_url };
|
|
18
|
+
let post_name_1: string;
|
|
19
|
+
export { post_name_1 as post_name };
|
|
20
|
+
}
|
|
21
|
+
namespace pt {
|
|
22
|
+
let canonical_url_2: string;
|
|
23
|
+
export { canonical_url_2 as canonical_url };
|
|
24
|
+
let post_name_2: string;
|
|
25
|
+
export { post_name_2 as post_name };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export default _default;
|