@apolitical/component-library 6.0.5 → 6.1.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.
- package/helpers/intl.d.ts +4 -0
- package/index.d.ts +1 -0
- package/index.js +38 -38
- package/index.mjs +3716 -3537
- package/package.json +1 -1
- package/polls/index.d.ts +1 -0
- package/polls/poll/components/index.d.ts +1 -0
- package/polls/poll/components/poll-option/index.d.ts +1 -0
- package/polls/poll/components/poll-option/poll-option.d.ts +18 -0
- package/polls/poll/index.d.ts +3 -0
- package/polls/poll/poll.d.ts +18 -0
- package/polls/poll/poll.enums.d.ts +4 -0
- package/polls/poll/poll.helpers.d.ts +9 -0
- package/polls/poll/poll.mocks.d.ts +58 -0
- package/polls/poll/poll.types.d.ts +10 -0
- package/style.css +1 -1
- package/styles/variables/colors/theme/_index.scss +3 -3
- package/styles/variables/colors/theme/_polls.scss +10 -0
package/package.json
CHANGED
package/polls/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './poll';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './poll-option';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PollOption, type IPollOptionProps } from './poll-option';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IUserContext } from '../../../../context';
|
|
2
|
+
import type { IPollOption } from '../../poll.types';
|
|
3
|
+
export interface IPollOptionProps {
|
|
4
|
+
user: IUserContext;
|
|
5
|
+
option: IPollOption;
|
|
6
|
+
optionIndex: number;
|
|
7
|
+
totalPollVotes?: number;
|
|
8
|
+
allowMultipleVotes?: boolean;
|
|
9
|
+
showResults?: boolean;
|
|
10
|
+
hasVotedOnPoll?: boolean;
|
|
11
|
+
isTabbable?: boolean;
|
|
12
|
+
functions?: {
|
|
13
|
+
createVote: (option: IPollOption) => void;
|
|
14
|
+
setTabbableOption: (index: number) => void;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
declare const PollOption: ({ user, option, optionIndex, totalPollVotes, allowMultipleVotes, showResults, hasVotedOnPoll, isTabbable, functions, }: IPollOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default PollOption;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IPollOption } from './poll.types';
|
|
2
|
+
import { ResultsVisibility } from './poll.enums';
|
|
3
|
+
export interface IPollProps {
|
|
4
|
+
title: string;
|
|
5
|
+
options: IPollOption[];
|
|
6
|
+
settings?: {
|
|
7
|
+
showRemoveVote?: boolean;
|
|
8
|
+
allowMultipleVotes?: boolean;
|
|
9
|
+
hideParticipants?: boolean;
|
|
10
|
+
resultsVisibility?: ResultsVisibility;
|
|
11
|
+
};
|
|
12
|
+
functions: {
|
|
13
|
+
createVote: (optionId: string) => void;
|
|
14
|
+
removeVote: (voteId: string) => void;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
declare const Poll: ({ title, options, settings, functions }: IPollProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export default Poll;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPollOption } from './poll.types';
|
|
2
|
+
export declare const getFirstTabbableOption: (options: IPollOption[], allowMultipleVotes: boolean, userId?: string) => number;
|
|
3
|
+
export declare const getNextOrPrevElementAndIndexWithoutClass: (element: Element | null | undefined, className: string, direction: 'next' | 'prev', currentIndex?: number) => {
|
|
4
|
+
nextElement: null;
|
|
5
|
+
nextIndex: number;
|
|
6
|
+
} | {
|
|
7
|
+
nextElement: Element;
|
|
8
|
+
nextIndex: number;
|
|
9
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export declare const actorMocks: {
|
|
2
|
+
me: {
|
|
3
|
+
created_at: string;
|
|
4
|
+
updated_at: string;
|
|
5
|
+
id: string;
|
|
6
|
+
image: {
|
|
7
|
+
thumbnail: string;
|
|
8
|
+
};
|
|
9
|
+
data: {
|
|
10
|
+
jobTitle: string;
|
|
11
|
+
location: {
|
|
12
|
+
code: string;
|
|
13
|
+
country: string;
|
|
14
|
+
en: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
name: string;
|
|
18
|
+
organization: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
otherUser: {
|
|
22
|
+
created_at: string;
|
|
23
|
+
updated_at: string;
|
|
24
|
+
id: string;
|
|
25
|
+
data: {
|
|
26
|
+
jobTitle: string;
|
|
27
|
+
location: {
|
|
28
|
+
code: string;
|
|
29
|
+
country: string;
|
|
30
|
+
en: string;
|
|
31
|
+
id: string;
|
|
32
|
+
};
|
|
33
|
+
name: string;
|
|
34
|
+
organization: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const loggedInUser: {
|
|
39
|
+
isLoading: boolean;
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
image: {
|
|
43
|
+
thumbnail: string;
|
|
44
|
+
};
|
|
45
|
+
jobTitle: string;
|
|
46
|
+
location: {
|
|
47
|
+
country: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export declare const optionsMock: {
|
|
51
|
+
id: string;
|
|
52
|
+
label: string;
|
|
53
|
+
numVotes: number;
|
|
54
|
+
hasUserVoted: boolean;
|
|
55
|
+
}[];
|
|
56
|
+
export declare const voteMock: {
|
|
57
|
+
id: string;
|
|
58
|
+
};
|