` element.
### Usage
diff --git a/frontend/src/lib/dynamic-components/appLogo/AppLogo.svelte b/frontend/src/lib/dynamic-components/appLogo/AppLogo.svelte
index 64002c7e2..6be371a3f 100644
--- a/frontend/src/lib/dynamic-components/appLogo/AppLogo.svelte
+++ b/frontend/src/lib/dynamic-components/appLogo/AppLogo.svelte
@@ -10,11 +10,10 @@ Logo files for use on a light and a dark background can be defined. If the latte
### Properties
-- `alt`: The `alt` text for the logo image.
-- `inverse`: If `true`, the light and dark versions of the logo will be reversed. Set to `true` if using the logo on a dark background. @default `false`
-- `size`: The size of the logo as one of the predefined sizes 'sm', 'md' or 'lg'. For arbitrary values, you can supply a `class` attribute, such as `class="h-[3.5rem]"`. @default `'md'`
-- `class`: Additional class string to append to the element's default classes.
-- Any valid attributes of the `
` element wrapping the light and dark `
![]()
` elements
+- `alt`: The `alt` text for the logo image. If missing, the publisher name or 'OpenVAA' will be used, depending on the logo shown.
+- `inverse`: If `true`, the light and dark versions of the logo will be reversed. Set to `true` if using the logo on a dark background. Default: `false`
+- `size`: The size of the logo as one of the predefined sizes 'sm', 'md' or 'lg'. For arbitrary values, you can supply a `class` attribute, such as `class="h-[3.5rem]"`. Default: `'md'`
+- Any valid attributes of a `
` element
### Usage
diff --git a/frontend/src/lib/dynamic-components/dataConsent/DataConsent.svelte b/frontend/src/lib/dynamic-components/dataConsent/DataConsent.svelte
index 06aca1b97..cc995a86d 100644
--- a/frontend/src/lib/dynamic-components/dataConsent/DataConsent.svelte
+++ b/frontend/src/lib/dynamic-components/dataConsent/DataConsent.svelte
@@ -8,10 +8,10 @@ Accesses `AppContext` to set and read `userPreferences`.
### Properties
-- `description`: Whether and how to show the data consent description. @default `modal`
- - `none`: Don’t show the description.
- - `inline`: Show the consent description above the buttons.
- - `modal`: Show a button that opens the description in a modal.
+- `description`: Whether and how to show the data consent description. Default: `'modal'`
+ - `'none'`: Don't show the description.
+ - `'inline'`: Show the consent description above the buttons.
+ - `'modal'`: Show a button that opens the description in a modal.
- Any valid attributes of a `
` element.
### Events
diff --git a/frontend/src/lib/dynamic-components/entityCard/EntityCard.svelte b/frontend/src/lib/dynamic-components/entityCard/EntityCard.svelte
index bfb2604ad..02a9f2b02 100644
--- a/frontend/src/lib/dynamic-components/entityCard/EntityCard.svelte
+++ b/frontend/src/lib/dynamic-components/entityCard/EntityCard.svelte
@@ -12,14 +12,14 @@ This is a dynamic component, because it accesses the `dataRoot` and other proper
### Properties
-- `action`: Custom action to take when the card is clicked, defaults to a link to the entity’s `ResultEntity` route. If the card has subentites, the action will only be triggered by clicking the content above them.
-- `entity`: A possibly ranked nakedEntity, e.g. candidate or a party.
-- `variant`: The variant-dependend layout variant. Usually set automatically.
- - `'list'`: In a list of entities. The default.
+- `action`: Custom action to take when the card is clicked, defaults to a link to the entity's `ResultEntity` route. If the card has subentites, the action will only be triggered by clicking the content above them.
+- `entity`: A possibly ranked entity, e.g. candidate or a party.
+- `variant`: The context-dependend layout variant. Usually set automatically. Default: `'list'`
+ - `'list'`: In a list of entities.
- `'details'`: As part of the header of `EntityDetails`.
- - `'subcard'`; In a list of nested nakedEntity cards, e.g., the candidates for a party.
-- `maxSubcards`: The maximum number of sub-entities to show. If there are more a button will be shown for displaying the remaining ones. @default `3`
-- `showElection`: Whether to show the possible nomination’s election and constituency. @default `false`
+ - `'subcard'`: In a list of nested entity cards, e.g., the candidates for a party.
+- `maxSubcards`: The maximum number of sub-entities to show. If there are more a button will be shown for displaying the remaining ones. Default: `3`
+- `showElection`: Whether to show the possible nomination's election and constituency. Default: `false`
- Any valid attributes of an `
` element.
### Tracking events
diff --git a/frontend/src/lib/dynamic-components/entityCard/EntityCardAction.svelte b/frontend/src/lib/dynamic-components/entityCard/EntityCardAction.svelte
index 44f00a43f..62fed30f0 100644
--- a/frontend/src/lib/dynamic-components/entityCard/EntityCardAction.svelte
+++ b/frontend/src/lib/dynamic-components/entityCard/EntityCardAction.svelte
@@ -6,7 +6,7 @@ TODO[Svelte 5]: Maybe convert into `$snippet`.
### Properties
- `action`: The action to take when the part or card is clicked.
-- `shadeOnHover`: Whether to shade the element on hover. Use when applying to subcards or their parent card's header. @default `false`
+- `shadeOnHover`: Whether to shade the element on hover. Use when applying to subcards or their parent card's header. Default: `false`
- Any valid attributes common to HTML elements. Note that these will only be applied if `` is rendered.
### Slots
diff --git a/frontend/src/lib/dynamic-components/entityDetails/EntityChildren.svelte b/frontend/src/lib/dynamic-components/entityDetails/EntityChildren.svelte
index f9d35a0b0..6a22e33f2 100644
--- a/frontend/src/lib/dynamic-components/entityDetails/EntityChildren.svelte
+++ b/frontend/src/lib/dynamic-components/entityDetails/EntityChildren.svelte
@@ -4,9 +4,10 @@ Used to show an entity's children in an `EntityDetails` component.
### Properties
-- `entities`: An array of possibly ranked entities, e.g. a party’s candidates.
-- `entityType`: The type of the entities being displayed. Used to pick correct translations
+- `entities`: An array of possibly ranked entities, e.g. a party's candidates.
+- `entityType`: The type of the entities being displayed. Used to pick correct translations.
- `action`: An optional callback for building the card actions for the child possible entities. If nullish, the default action filled in by `EntityCard` will be used. If `false`, no actions will be added.
+- Any valid attributes of a `` element
### Usage
@@ -19,12 +20,14 @@ Used to show an entity's children in an `EntityDetails` component.
import { getComponentContext } from '$lib/contexts/component';
import { EntityList } from '$lib/dynamic-components/entityList';
import { EntityListControls } from '../entityList';
- import type { EntityType } from '@openvaa/data';
- import type { CardAction, EntityCardProps } from '../entityCard';
+ import type { EntityCardProps } from '../entityCard';
+ import type { EntityChildrenProps } from './EntityChildren.type';
- export let entities: Array
;
- export let entityType: EntityType;
- export let action: ((entity: MaybeWrappedEntityVariant) => CardAction) | false | null | undefined = undefined;
+ type $$Props = EntityChildrenProps;
+
+ export let entities: $$Props['entities'];
+ export let entityType: $$Props['entityType'];
+ export let action: $$Props['action'] = undefined;
////////////////////////////////////////////////////////////////////
// Get contexts
diff --git a/frontend/src/lib/dynamic-components/entityDetails/EntityChildren.type.ts b/frontend/src/lib/dynamic-components/entityDetails/EntityChildren.type.ts
new file mode 100644
index 000000000..b48b291f4
--- /dev/null
+++ b/frontend/src/lib/dynamic-components/entityDetails/EntityChildren.type.ts
@@ -0,0 +1,18 @@
+import type { EntityType } from '@openvaa/data';
+import type { SvelteHTMLElements } from 'svelte/elements';
+import type { CardAction } from '../entityCard';
+
+export type EntityChildrenProps = SvelteHTMLElements['div'] & {
+ /**
+ * An array of possibly ranked entities, e.g. a party's candidates.
+ */
+ entities: Array;
+ /**
+ * The type of the entities being displayed. Used to pick correct translations.
+ */
+ entityType: EntityType;
+ /**
+ * An optional callback for building the card actions for the child possible entities. If nullish, the default action filled in by `EntityCard` will be used. If `false`, no actions will be added.
+ */
+ action?: ((entity: MaybeWrappedEntityVariant) => CardAction) | false | null;
+};
diff --git a/frontend/src/lib/dynamic-components/entityDetails/EntityInfo.svelte b/frontend/src/lib/dynamic-components/entityDetails/EntityInfo.svelte
index 3889983ed..2824a7d75 100644
--- a/frontend/src/lib/dynamic-components/entityDetails/EntityInfo.svelte
+++ b/frontend/src/lib/dynamic-components/entityDetails/EntityInfo.svelte
@@ -9,7 +9,8 @@ This is a dynamic component, because it accesses `appSettings` and `dataRoot` fr
### Properties
- `entity`: A possibly ranked entity, e.g. candidate or a party.
-- `questions`: An array of `info` questions
+- `questions`: An array of `info` questions.
+- Any valid attributes of a `` element
### Settings
@@ -28,7 +29,6 @@ This is a dynamic component, because it accesses `appSettings` and `dataRoot` fr
import {
type AnyEntityVariant,
type AnyNominationVariant,
- type AnyQuestionVariant,
ENTITY_TYPE,
type EntityType,
isObjectType,
@@ -42,10 +42,12 @@ This is a dynamic component, because it accesses `appSettings` and `dataRoot` fr
import { unwrapEntity } from '$lib/utils/entities';
import { sanitizeHtml } from '$lib/utils/sanitize';
import InfoItem from './InfoItem.svelte';
- import type { EntityDetailsProps } from './EntityDetails.type';
+ import type { EntityInfoProps } from './EntityInfo.type';
- export let entity: EntityDetailsProps['entity'];
- export let questions: Array
;
+ type $$Props = EntityInfoProps;
+
+ export let entity: $$Props['entity'];
+ export let questions: $$Props['questions'];
////////////////////////////////////////////////////////////////////
// Get contexts
diff --git a/frontend/src/lib/dynamic-components/entityDetails/EntityInfo.type.ts b/frontend/src/lib/dynamic-components/entityDetails/EntityInfo.type.ts
new file mode 100644
index 000000000..0527f27ca
--- /dev/null
+++ b/frontend/src/lib/dynamic-components/entityDetails/EntityInfo.type.ts
@@ -0,0 +1,14 @@
+import type { AnyQuestionVariant } from '@openvaa/data';
+import type { SvelteHTMLElements } from 'svelte/elements';
+import type { EntityDetailsProps } from './EntityDetails.type';
+
+export type EntityInfoProps = SvelteHTMLElements['div'] & {
+ /**
+ * A possibly ranked entity, e.g. candidate or a party.
+ */
+ entity: EntityDetailsProps['entity'];
+ /**
+ * An array of `info` questions.
+ */
+ questions: Array;
+};
diff --git a/frontend/src/lib/dynamic-components/entityDetails/EntityOpinions.svelte b/frontend/src/lib/dynamic-components/entityDetails/EntityOpinions.svelte
index a029d3be7..9c80eb680 100644
--- a/frontend/src/lib/dynamic-components/entityDetails/EntityOpinions.svelte
+++ b/frontend/src/lib/dynamic-components/entityDetails/EntityOpinions.svelte
@@ -6,7 +6,8 @@ Used to show an entity's answers to `opinion` questions and possibly those of th
- `entity`: A possibly ranked entity, e.g. candidate or a party.
- `questions`: An array of `opinion` questions.
-- `answers`: An optional `AnswerStore` with the Voter’s answers to the questions.
+- `answers`: An optional `AnswerStore` with the Voter's answers to the questions.
+- Any valid attributes of a `` element
### Usage
@@ -21,13 +22,14 @@ Used to show an entity's answers to `opinion` questions and possibly those of th
import { OpinionQuestionInput, QuestionOpenAnswer } from '$lib/components/questions';
import { getAppContext } from '$lib/contexts/app';
import { unwrapEntity } from '$lib/utils/entities';
- import type { AnyEntityVariant, AnyQuestionVariant } from '@openvaa/data';
- import type { AnswerStore } from '$lib/contexts/voter';
- import type { EntityDetailsProps } from './EntityDetails.type';
+ import type { AnyEntityVariant } from '@openvaa/data';
+ import type { EntityOpinionsProps } from './EntityOpinions.type';
- export let entity: EntityDetailsProps['entity'];
- export let questions: Array
;
- export let answers: AnswerStore | undefined = undefined;
+ type $$Props = EntityOpinionsProps;
+
+ export let entity: $$Props['entity'];
+ export let questions: $$Props['questions'];
+ export let answers: $$Props['answers'] = undefined;
////////////////////////////////////////////////////////////////////
// Get contexts
diff --git a/frontend/src/lib/dynamic-components/entityDetails/EntityOpinions.type.ts b/frontend/src/lib/dynamic-components/entityDetails/EntityOpinions.type.ts
new file mode 100644
index 000000000..c96327f1d
--- /dev/null
+++ b/frontend/src/lib/dynamic-components/entityDetails/EntityOpinions.type.ts
@@ -0,0 +1,19 @@
+import type { AnyQuestionVariant } from '@openvaa/data';
+import type { SvelteHTMLElements } from 'svelte/elements';
+import type { AnswerStore } from '$lib/contexts/voter';
+import type { EntityDetailsProps } from './EntityDetails.type';
+
+export type EntityOpinionsProps = SvelteHTMLElements['div'] & {
+ /**
+ * A possibly ranked entity, e.g. candidate or a party.
+ */
+ entity: EntityDetailsProps['entity'];
+ /**
+ * An array of `opinion` questions.
+ */
+ questions: Array;
+ /**
+ * An optional `AnswerStore` with the Voter's answers to the questions.
+ */
+ answers?: AnswerStore;
+};
diff --git a/frontend/src/lib/dynamic-components/entityDetails/InfoItem.svelte b/frontend/src/lib/dynamic-components/entityDetails/InfoItem.svelte
index 38b40ede7..d4797ab50 100644
--- a/frontend/src/lib/dynamic-components/entityDetails/InfoItem.svelte
+++ b/frontend/src/lib/dynamic-components/entityDetails/InfoItem.svelte
@@ -4,8 +4,9 @@ Used to show a label-content pair in a Candidate's basic information.
### Properties
-- `label`: the label of the information
-- `vertical`: layout mode for the item
+- `label`: The label of the information.
+- `vertical`: Layout mode for the item. Default: `false`
+- Any valid attributes of a `` element
### Slots
@@ -21,10 +22,12 @@ Used to show a label-content pair in a Candidate's basic information.
-->
diff --git a/frontend/src/lib/dynamic-components/entityDetails/InfoItem.type.ts b/frontend/src/lib/dynamic-components/entityDetails/InfoItem.type.ts
new file mode 100644
index 000000000..e3248efd0
--- /dev/null
+++ b/frontend/src/lib/dynamic-components/entityDetails/InfoItem.type.ts
@@ -0,0 +1,12 @@
+import type { SvelteHTMLElements } from 'svelte/elements';
+
+export type InfoItemProps = SvelteHTMLElements['div'] & {
+ /**
+ * The label of the information.
+ */
+ label: string;
+ /**
+ * Layout mode for the item. @default false
+ */
+ vertical?: boolean;
+};
diff --git a/frontend/src/lib/dynamic-components/entityDetails/index.ts b/frontend/src/lib/dynamic-components/entityDetails/index.ts
index 92236e8f8..54e046dc1 100644
--- a/frontend/src/lib/dynamic-components/entityDetails/index.ts
+++ b/frontend/src/lib/dynamic-components/entityDetails/index.ts
@@ -1,7 +1,12 @@
export { default as EntityChildren } from './EntityChildren.svelte';
+export * from './EntityChildren.type';
export { default as EntityDetails } from './EntityDetails.svelte';
export * from './EntityDetails.type';
export { default as EntityDetailsDrawer } from './EntityDetailsDrawer.svelte';
export * from './EntityDetailsDrawer.type';
export { default as EntityInfo } from './EntityInfo.svelte';
+export * from './EntityInfo.type';
export { default as EntityOpinions } from './EntityOpinions.svelte';
+export * from './EntityOpinions.type';
+export { default as InfoItem } from './InfoItem.svelte';
+export * from './InfoItem.type';
diff --git a/frontend/src/lib/dynamic-components/entityList/EntityListControls.svelte b/frontend/src/lib/dynamic-components/entityList/EntityListControls.svelte
index a45da8189..3f09f4d2d 100644
--- a/frontend/src/lib/dynamic-components/entityList/EntityListControls.svelte
+++ b/frontend/src/lib/dynamic-components/entityList/EntityListControls.svelte
@@ -7,14 +7,11 @@ TODO: Consider moving the tracking events away from the component and just addin
### Properties
- `entities`: A list of possibly ranked entities, e.g. candidates or a parties.
-- `filterGroup`: The filters applied to the entities
-- `searchProperty`: The property used for the search tool. Default 'name'
+- `filterGroup`: The filters applied to the contents.
+- `searchProperty`: The property used for the search tool. Default: `'name'`
+- `onUpdate`: Callback for when the filters are applied.
- Any valid attributes of a `
` element.
-### Callbacks
-
-- `onUpdate`: Callback for when the filters are applied.
-
### Tracking events
- `filters_reset`
diff --git a/frontend/src/lib/dynamic-components/feedback/Feedback.svelte b/frontend/src/lib/dynamic-components/feedback/Feedback.svelte
index 3eeaad309..96c23a4f0 100644
--- a/frontend/src/lib/dynamic-components/feedback/Feedback.svelte
+++ b/frontend/src/lib/dynamic-components/feedback/Feedback.svelte
@@ -8,14 +8,16 @@ Accesses the `AppContext` and the `FeedbackWriter` api.
### Properties
+- `showActions`: Whether to show the standard action buttons below the feedback form. Default: `true`
+- `variant`: The layout variant of the feedback form. Default: `'default'`
- Any valid attributes of a `