@case-framework/survey-ui 0.8.4 → 0.9.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/README.md CHANGED
@@ -3,6 +3,22 @@
3
3
  Participant-facing React components for rendering and completing CASE surveys.
4
4
  This package intentionally excludes the Survey Editor and Survey Assistant.
5
5
 
6
+ ## Default-item participant localizations
7
+
8
+ The package owns the participant-facing form and choice messages used by its
9
+ default registry. Hosts that compose another registry can reuse the same
10
+ sources instead of copying them:
11
+
12
+ ```ts
13
+ import {
14
+ defaultChoiceItemPlayerLocalizations,
15
+ defaultFormItemPlayerLocalizations,
16
+ } from "@case-framework/survey-ui";
17
+ ```
18
+
19
+ These item sources remain separate from the global player fallback catalog so
20
+ excluding a default registry entry also excludes that entry's messages.
21
+
6
22
  ## Styling in a Tailwind CSS v4 / shadcn host
7
23
 
8
24
  Import the React API normally:
@@ -4,4 +4,5 @@ export { ChoiceItemCore, FormItemCore, InfoItemCore, } from './modules/default-i
4
4
  export { ChoiceItemRenderer, FormItemRenderer, InfoItemRenderer, } from './modules/survey-player/survey-item/survey-item-types/placeholder-item-renderers';
5
5
  export { createSurveyTranslator, mergeSurveyPlayerLocalizationSources, mergeSurveyPlayerLocalizations, } from './modules/survey-player/localization/runtime';
6
6
  export { DEFAULT_SURVEY_PLAYER_LANGUAGE, defaultSurveyPlayerLocalizations, } from './modules/survey-player/localization/default-en';
7
+ export { defaultChoiceItemPlayerLocalizations, defaultFormItemPlayerLocalizations, } from './modules/survey-player/localization/default-item-localizations';
7
8
  export { InfoItemCardField } from './modules/default-item-registry/items/info/player/card-field';
@@ -1,6 +1,6 @@
1
1
  import { SurveyItemCore, SurveyItemPrefill, ResponseSlotDefinition, ResponseValue } from '@case-framework/survey-core';
2
- import { ChoiceItemConfig } from './items/choice/model';
3
- import { FormItemConfig } from './items/form/model';
2
+ import { ChoiceItemConfig } from '@case-framework/survey-items/choice';
3
+ import { FormItemConfig } from '@case-framework/survey-items/form';
4
4
  type InfoItemConfig = Record<string, never>;
5
5
  export declare class InfoItemCore extends SurveyItemCore<"infoItem", InfoItemConfig> {
6
6
  readonly type = "infoItem";
@@ -1,7 +1,7 @@
1
1
  import { ResponseItem, Content } from '@case-framework/survey-core';
2
2
  import { default as React } from 'react';
3
- import { ChoiceMaxSelection } from '../model';
4
- import { FormFieldGroupConfig } from '../../form/model';
3
+ import { ChoiceMaxSelection } from '@case-framework/survey-items/choice';
4
+ import { FormFieldGroupConfig } from '@case-framework/survey-items/form';
5
5
  export interface ChoiceQuestionOptionViewModel {
6
6
  id: string;
7
7
  label: string;
@@ -1,5 +1,5 @@
1
1
  import { ResponseItem, Content } from '@case-framework/survey-core';
2
- import { FormFieldGroupConfig } from '../model';
2
+ import { FormFieldGroupConfig } from '@case-framework/survey-items/form';
3
3
  interface FormItemFieldProps {
4
4
  itemId: string;
5
5
  title?: Content;
@@ -0,0 +1,3 @@
1
+ import { LocalizationCatalog } from '@case-framework/ui-localization';
2
+ export declare const defaultFormItemPlayerLocalizations: LocalizationCatalog;
3
+ export declare const defaultChoiceItemPlayerLocalizations: LocalizationCatalog;