@dloizides/ui-feedback 1.24.0 → 1.26.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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.26.0
4
+
5
+ - `LocalModelGate` + `useLocalModel(model)` (INV-EXTRACT-1 W9): shows its children once a `@dloizides/text-generation` local model is ready, else the offer, download percent, failure retry or blocked reason; labels, test ids and the card/text/button slots come from the app.
6
+
3
7
  ## 1.24.0
4
8
 
5
9
  - `UiThemeOverride({ map, children })` (INV-EXTRACT-1 W4, D-EXTRACT-2): re-provides the surrounding UI context with its theme passed through `map`; translate and navigate are kept. Generic over the host's theme type. Showcase story `src/showcase/UiThemeOverride.showcase.tsx`.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
- import React, { Component, ReactNode, ErrorInfo } from 'react';
1
+ import React, { Component, ReactNode, ErrorInfo, ComponentType, ReactElement } from 'react';
2
2
  import { StyleProp, ViewStyle } from 'react-native';
3
+ import { LocalModel, LocalModelBlock, LocalModelState } from '@dloizides/text-generation';
3
4
 
4
5
  /**
5
6
  * The minimal theme surface the feedback components read. Each consuming app's
@@ -131,6 +132,13 @@ interface ErrorStateProps {
131
132
  }
132
133
  declare const ErrorState: ({ message, onRetry, testID, title, icon, secondaryAction, error, }: ErrorStateProps) => React.ReactElement;
133
134
 
135
+ interface ErrorNoticeProps {
136
+ children: React.ReactNode;
137
+ testID?: string;
138
+ }
139
+ /** A bordered box in the theme's error colours that announces its lines politely; the caller supplies the lines. */
140
+ declare const ErrorNotice: ({ children, testID }: ErrorNoticeProps) => React.ReactElement;
141
+
134
142
  /**
135
143
  * EmptyListState - empty-collection message with an optional call-to-action.
136
144
  *
@@ -683,4 +691,51 @@ declare function LiveRunCard(props: LiveRunCardProps): React.ReactElement;
683
691
  /** The theme colour for a step or group state; falls back to primary/text when a semantic scale is absent. */
684
692
  declare function runToneColor(theme: FeedbackTheme, state: RunStepState): string;
685
693
 
686
- export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, type DoneSummary, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorReferenceRow, type ErrorReferenceRowProps, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackThemeSemanticText, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, type FlatRunStep, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, type LiveRunCardLabels, type LiveRunCardProps, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type RunGroup, type RunStep, type RunStepState, type StepSplit, type ToastActionSpec, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, UiThemeOverride, type UiThemeOverrideProps, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackThemeSemanticText as UiThemeSemanticText, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, barFraction, clampPercent, copyText, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useFeedbackUi as useUi };
694
+ interface LocalModelGateLabels {
695
+ blocked: (block: LocalModelBlock | null) => string;
696
+ title: string;
697
+ offerBody: string;
698
+ consent: string;
699
+ consentHint: string;
700
+ loading: (percent: string) => string;
701
+ failed: string;
702
+ retry: string;
703
+ }
704
+ interface LocalModelGateTestIds {
705
+ blocked: string;
706
+ offer: string;
707
+ loading: string;
708
+ failed: string;
709
+ consent: string;
710
+ }
711
+ interface LocalModelGateSlots {
712
+ Card: ComponentType<{
713
+ testID: string;
714
+ children: ReactNode;
715
+ }>;
716
+ Text: ComponentType<{
717
+ heading?: boolean;
718
+ children: string;
719
+ }>;
720
+ Button: ComponentType<{
721
+ label: string;
722
+ hint: string;
723
+ testID: string;
724
+ onPress: () => void;
725
+ }>;
726
+ }
727
+ interface LocalModelGateProps {
728
+ model: LocalModel;
729
+ labels: LocalModelGateLabels;
730
+ testIds: LocalModelGateTestIds;
731
+ slots: LocalModelGateSlots;
732
+ children: ReactElement;
733
+ }
734
+
735
+ /** Shows its children only once the local model is ready; before that it offers the download or says why it cannot run. */
736
+ declare const LocalModelGate: ({ model, labels, testIds, slots, children, }: LocalModelGateProps) => React.ReactElement | null;
737
+
738
+ /** Follows a local model and checks the browser on first use. */
739
+ declare function useLocalModel(model: LocalModel): LocalModelState;
740
+
741
+ export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, type DoneSummary, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorNotice, type ErrorNoticeProps, ErrorReferenceRow, type ErrorReferenceRowProps, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackThemeSemanticText, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, type FlatRunStep, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, type LiveRunCardLabels, type LiveRunCardProps, LoadingFallback, type LoadingFallbackProps, LocalModelGate, type LocalModelGateLabels, type LocalModelGateProps, type LocalModelGateSlots, type LocalModelGateTestIds, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type RunGroup, type RunStep, type RunStepState, type StepSplit, type ToastActionSpec, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, UiThemeOverride, type UiThemeOverrideProps, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackThemeSemanticText as UiThemeSemanticText, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, barFraction, clampPercent, copyText, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useLocalModel, useFeedbackUi as useUi };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import React, { Component, ReactNode, ErrorInfo } from 'react';
1
+ import React, { Component, ReactNode, ErrorInfo, ComponentType, ReactElement } from 'react';
2
2
  import { StyleProp, ViewStyle } from 'react-native';
3
+ import { LocalModel, LocalModelBlock, LocalModelState } from '@dloizides/text-generation';
3
4
 
4
5
  /**
5
6
  * The minimal theme surface the feedback components read. Each consuming app's
@@ -131,6 +132,13 @@ interface ErrorStateProps {
131
132
  }
132
133
  declare const ErrorState: ({ message, onRetry, testID, title, icon, secondaryAction, error, }: ErrorStateProps) => React.ReactElement;
133
134
 
135
+ interface ErrorNoticeProps {
136
+ children: React.ReactNode;
137
+ testID?: string;
138
+ }
139
+ /** A bordered box in the theme's error colours that announces its lines politely; the caller supplies the lines. */
140
+ declare const ErrorNotice: ({ children, testID }: ErrorNoticeProps) => React.ReactElement;
141
+
134
142
  /**
135
143
  * EmptyListState - empty-collection message with an optional call-to-action.
136
144
  *
@@ -683,4 +691,51 @@ declare function LiveRunCard(props: LiveRunCardProps): React.ReactElement;
683
691
  /** The theme colour for a step or group state; falls back to primary/text when a semantic scale is absent. */
684
692
  declare function runToneColor(theme: FeedbackTheme, state: RunStepState): string;
685
693
 
686
- export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, type DoneSummary, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorReferenceRow, type ErrorReferenceRowProps, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackThemeSemanticText, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, type FlatRunStep, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, type LiveRunCardLabels, type LiveRunCardProps, LoadingFallback, type LoadingFallbackProps, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type RunGroup, type RunStep, type RunStepState, type StepSplit, type ToastActionSpec, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, UiThemeOverride, type UiThemeOverrideProps, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackThemeSemanticText as UiThemeSemanticText, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, barFraction, clampPercent, copyText, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useFeedbackUi as useUi };
694
+ interface LocalModelGateLabels {
695
+ blocked: (block: LocalModelBlock | null) => string;
696
+ title: string;
697
+ offerBody: string;
698
+ consent: string;
699
+ consentHint: string;
700
+ loading: (percent: string) => string;
701
+ failed: string;
702
+ retry: string;
703
+ }
704
+ interface LocalModelGateTestIds {
705
+ blocked: string;
706
+ offer: string;
707
+ loading: string;
708
+ failed: string;
709
+ consent: string;
710
+ }
711
+ interface LocalModelGateSlots {
712
+ Card: ComponentType<{
713
+ testID: string;
714
+ children: ReactNode;
715
+ }>;
716
+ Text: ComponentType<{
717
+ heading?: boolean;
718
+ children: string;
719
+ }>;
720
+ Button: ComponentType<{
721
+ label: string;
722
+ hint: string;
723
+ testID: string;
724
+ onPress: () => void;
725
+ }>;
726
+ }
727
+ interface LocalModelGateProps {
728
+ model: LocalModel;
729
+ labels: LocalModelGateLabels;
730
+ testIds: LocalModelGateTestIds;
731
+ slots: LocalModelGateSlots;
732
+ children: ReactElement;
733
+ }
734
+
735
+ /** Shows its children only once the local model is ready; before that it offers the download or says why it cannot run. */
736
+ declare const LocalModelGate: ({ model, labels, testIds, slots, children, }: LocalModelGateProps) => React.ReactElement | null;
737
+
738
+ /** Follows a local model and checks the browser on first use. */
739
+ declare function useLocalModel(model: LocalModel): LocalModelState;
740
+
741
+ export { AppErrorBoundary, type AppErrorBoundaryProps, AsyncSurface, type AsyncSurfaceProps, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, DEFAULT_ERROR_BOUNDARY_LABELS, DISABLED_OPACITY, type DoneSummary, EmptyListState, type EmptyListStateProps, type ErrorBoundaryLabels, type ErrorFallbackState, ErrorNotice, type ErrorNoticeProps, ErrorReferenceRow, type ErrorReferenceRowProps, ErrorState, type ErrorStateAction, type ErrorStateProps, FEEDBACK_TEST_IDS, type FeedbackColorScale, type FeedbackNavigate, type FeedbackTheme, type FeedbackThemeColors, type FeedbackThemePalette, type FeedbackThemeSemantic, type FeedbackThemeSemanticText, type FeedbackTranslate, FeedbackUiProvider, type FeedbackUiProviderProps, type FeedbackUiValue, type FlatRunStep, LIVE_RUN_CARD_COMPACT_MAX_PX, LiveRunCard, type LiveRunCardLabels, type LiveRunCardProps, LoadingFallback, type LoadingFallbackProps, LocalModelGate, type LocalModelGateLabels, type LocalModelGateProps, type LocalModelGateSlots, type LocalModelGateTestIds, MODAL_OVERLAY_COLOR, PageSkeleton, type PageSkeletonProps, ProgressBar, type ProgressBarProps, type RunGroup, type RunStep, type RunStepState, type StepSplit, type ToastActionSpec, type ToastBus, ToastHost, type ToastHostProps, type ToastInput, type ToastPush, type ToastType, type FeedbackColorScale as UiColorScale, type FeedbackNavigate as UiNavigate, FeedbackUiProvider as UiProvider, type FeedbackUiProviderProps as UiProviderProps, type FeedbackTheme as UiTheme, type FeedbackThemeColors as UiThemeColors, UiThemeOverride, type UiThemeOverrideProps, type FeedbackThemePalette as UiThemePalette, type FeedbackThemeSemantic as UiThemeSemantic, type FeedbackThemeSemanticText as UiThemeSemanticText, type FeedbackTranslate as UiTranslate, type FeedbackUiValue as UiValue, WARMING_QUIET_PERIOD_MS, type WarmingInfo, WarmingOverlay, type WarmingOverlayLabels, type WarmingOverlayProps, type WarmingSnapshot, barFraction, clampPercent, copyText, createToastBus, defaultGroupId, getWarmingSnapshot, mergeRunSteps, notifyWarming, progressPercent, readTraceId, runToneColor, settleWarming, splitShorterSteps, subscribeWarming, summariseDoneGroups, useCopyToClipboard, useFeedbackUi, useLocalModel, useFeedbackUi as useUi };