@veridid/workflow-ui 0.0.0-stage → 0.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/LICENSE +202 -0
- package/README.md +202 -2
- package/build/module/WorkflowFontScaleContext.js +67 -0
- package/build/module/WorkflowFontScaleContext.js.map +1 -0
- package/build/module/adapter/WalletAdapter.js +152 -0
- package/build/module/adapter/WalletAdapter.js.map +1 -0
- package/build/module/components/FallbackVideoPlayer.js +8 -0
- package/build/module/components/FallbackVideoPlayer.js.map +1 -0
- package/build/module/components/FallbackVideoPlayer.native.js +10 -0
- package/build/module/components/FallbackVideoPlayer.native.js.map +1 -0
- package/build/module/components/FallbackVideoPlayer.web.js +35 -0
- package/build/module/components/FallbackVideoPlayer.web.js.map +1 -0
- package/build/module/components/WorkflowButtonLabel.js +32 -0
- package/build/module/components/WorkflowButtonLabel.js.map +1 -0
- package/build/module/components/WorkflowCalendarIcon.js +73 -0
- package/build/module/components/WorkflowCalendarIcon.js.map +1 -0
- package/build/module/components/WorkflowText.js +92 -0
- package/build/module/components/WorkflowText.js.map +1 -0
- package/build/module/content/BadgeContent.js +73 -0
- package/build/module/content/BadgeContent.js.map +1 -0
- package/build/module/content/BarChartContent.js +97 -0
- package/build/module/content/BarChartContent.js.map +1 -0
- package/build/module/content/BarcodeContent.js +78 -0
- package/build/module/content/BarcodeContent.js.map +1 -0
- package/build/module/content/BasicTableContent.js +145 -0
- package/build/module/content/BasicTableContent.js.map +1 -0
- package/build/module/content/ButtonContent.js +130 -0
- package/build/module/content/ButtonContent.js.map +1 -0
- package/build/module/content/CalendarContent.js +173 -0
- package/build/module/content/CalendarContent.js.map +1 -0
- package/build/module/content/CardContent.js +114 -0
- package/build/module/content/CardContent.js.map +1 -0
- package/build/module/content/CarouselContent.js +173 -0
- package/build/module/content/CarouselContent.js.map +1 -0
- package/build/module/content/ChipContent.js +214 -0
- package/build/module/content/ChipContent.js.map +1 -0
- package/build/module/content/ChipRowContent.js +127 -0
- package/build/module/content/ChipRowContent.js.map +1 -0
- package/build/module/content/CredentialOfferContent.js +312 -0
- package/build/module/content/CredentialOfferContent.js.map +1 -0
- package/build/module/content/DialContent.js +101 -0
- package/build/module/content/DialContent.js.map +1 -0
- package/build/module/content/DividerContent.js +26 -0
- package/build/module/content/DividerContent.js.map +1 -0
- package/build/module/content/DonutChartContent.js +118 -0
- package/build/module/content/DonutChartContent.js.map +1 -0
- package/build/module/content/FormContent.js +141 -0
- package/build/module/content/FormContent.js.map +1 -0
- package/build/module/content/FormFieldBridge.js +157 -0
- package/build/module/content/FormFieldBridge.js.map +1 -0
- package/build/module/content/GaugeContent.js +77 -0
- package/build/module/content/GaugeContent.js.map +1 -0
- package/build/module/content/GridLayoutContent.js +227 -0
- package/build/module/content/GridLayoutContent.js.map +1 -0
- package/build/module/content/ImageContent.js +190 -0
- package/build/module/content/ImageContent.js.map +1 -0
- package/build/module/content/ListContent.js +107 -0
- package/build/module/content/ListContent.js.map +1 -0
- package/build/module/content/LocationContent.js +148 -0
- package/build/module/content/LocationContent.js.map +1 -0
- package/build/module/content/MapContent.js +213 -0
- package/build/module/content/MapContent.js.map +1 -0
- package/build/module/content/MultipleChoiceContent.js +91 -0
- package/build/module/content/MultipleChoiceContent.js.map +1 -0
- package/build/module/content/OpenBadgePreviewContent.js +141 -0
- package/build/module/content/OpenBadgePreviewContent.js.map +1 -0
- package/build/module/content/PhotoContent.js +154 -0
- package/build/module/content/PhotoContent.js.map +1 -0
- package/build/module/content/PieChartContent.js +129 -0
- package/build/module/content/PieChartContent.js.map +1 -0
- package/build/module/content/ProofPresentationContent.js +154 -0
- package/build/module/content/ProofPresentationContent.js.map +1 -0
- package/build/module/content/RadioButtonContent.js +136 -0
- package/build/module/content/RadioButtonContent.js.map +1 -0
- package/build/module/content/RowContent.js +539 -0
- package/build/module/content/RowContent.js.map +1 -0
- package/build/module/content/SectionContent.js +123 -0
- package/build/module/content/SectionContent.js.map +1 -0
- package/build/module/content/ShareEntryContent.js +111 -0
- package/build/module/content/ShareEntryContent.js.map +1 -0
- package/build/module/content/SimulatedHint.js +33 -0
- package/build/module/content/SimulatedHint.js.map +1 -0
- package/build/module/content/SliderContent.js +46 -0
- package/build/module/content/SliderContent.js.map +1 -0
- package/build/module/content/SpacerContent.js +21 -0
- package/build/module/content/SpacerContent.js.map +1 -0
- package/build/module/content/SpinnerContent.js +33 -0
- package/build/module/content/SpinnerContent.js.map +1 -0
- package/build/module/content/SubmitButtonContent.js +281 -0
- package/build/module/content/SubmitButtonContent.js.map +1 -0
- package/build/module/content/TextContent.js +127 -0
- package/build/module/content/TextContent.js.map +1 -0
- package/build/module/content/TileContent.js +237 -0
- package/build/module/content/TileContent.js.map +1 -0
- package/build/module/content/TimelineContent.js +120 -0
- package/build/module/content/TimelineContent.js.map +1 -0
- package/build/module/content/TitleContent.js +55 -0
- package/build/module/content/TitleContent.js.map +1 -0
- package/build/module/content/VideoContent.js +142 -0
- package/build/module/content/VideoContent.js.map +1 -0
- package/build/module/content/WebLinkContent.js +95 -0
- package/build/module/content/WebLinkContent.js.map +1 -0
- package/build/module/content/index.js +48 -0
- package/build/module/content/index.js.map +1 -0
- package/build/module/form-fields/CheckboxField.js +47 -0
- package/build/module/form-fields/CheckboxField.js.map +1 -0
- package/build/module/form-fields/DateField.js +8 -0
- package/build/module/form-fields/DateField.js.map +1 -0
- package/build/module/form-fields/DateField.native.js +141 -0
- package/build/module/form-fields/DateField.native.js.map +1 -0
- package/build/module/form-fields/DateField.web.js +45 -0
- package/build/module/form-fields/DateField.web.js.map +1 -0
- package/build/module/form-fields/DropdownField.js +172 -0
- package/build/module/form-fields/DropdownField.js.map +1 -0
- package/build/module/form-fields/MCQField.js +100 -0
- package/build/module/form-fields/MCQField.js.map +1 -0
- package/build/module/form-fields/RadioField.js +56 -0
- package/build/module/form-fields/RadioField.js.map +1 -0
- package/build/module/form-fields/SliderField.js +8 -0
- package/build/module/form-fields/SliderField.js.map +1 -0
- package/build/module/form-fields/SliderField.native.js +77 -0
- package/build/module/form-fields/SliderField.native.js.map +1 -0
- package/build/module/form-fields/SliderField.web.js +82 -0
- package/build/module/form-fields/SliderField.web.js.map +1 -0
- package/build/module/form-fields/SubmitButtonField.js +42 -0
- package/build/module/form-fields/SubmitButtonField.js.map +1 -0
- package/build/module/form-fields/TextField.js +56 -0
- package/build/module/form-fields/TextField.js.map +1 -0
- package/build/module/form-fields/index.js +15 -0
- package/build/module/form-fields/index.js.map +1 -0
- package/build/module/i18n/WorkflowI18n.js +94 -0
- package/build/module/i18n/WorkflowI18n.js.map +1 -0
- package/build/module/icons/WorkflowIcon.js +50 -0
- package/build/module/icons/WorkflowIcon.js.map +1 -0
- package/build/module/imageUriCache.js +25 -0
- package/build/module/imageUriCache.js.map +1 -0
- package/build/module/index.js +49 -0
- package/build/module/index.js.map +1 -0
- package/build/module/modal/WorkflowModal.js +115 -0
- package/build/module/modal/WorkflowModal.js.map +1 -0
- package/build/module/package.json +1 -0
- package/build/module/platform/platformName.js +10 -0
- package/build/module/platform/platformName.js.map +1 -0
- package/build/module/platform/platformName.web.js +5 -0
- package/build/module/platform/platformName.web.js.map +1 -0
- package/build/module/protocol/controlSnapshotStore.js +19 -0
- package/build/module/protocol/controlSnapshotStore.js.map +1 -0
- package/build/module/protocol/useProtocolExchange.js +168 -0
- package/build/module/protocol/useProtocolExchange.js.map +1 -0
- package/build/module/registries/ContentRegistry.js +53 -0
- package/build/module/registries/ContentRegistry.js.map +1 -0
- package/build/module/registries/FormFieldRegistry.js +56 -0
- package/build/module/registries/FormFieldRegistry.js.map +1 -0
- package/build/module/render/NodeBoundary.js +73 -0
- package/build/module/render/NodeBoundary.js.map +1 -0
- package/build/module/render/RenderTree.js +52 -0
- package/build/module/render/RenderTree.js.map +1 -0
- package/build/module/render/WorkflowRenderContext.js +34 -0
- package/build/module/render/WorkflowRenderContext.js.map +1 -0
- package/build/module/render/nodes.js +103 -0
- package/build/module/render/nodes.js.map +1 -0
- package/build/module/responsive/ResponsiveProvider.js +63 -0
- package/build/module/responsive/ResponsiveProvider.js.map +1 -0
- package/build/module/responsive/index.js +4 -0
- package/build/module/responsive/index.js.map +1 -0
- package/build/module/responsive/responsive.js +56 -0
- package/build/module/responsive/responsive.js.map +1 -0
- package/build/module/style/resolveDisplayHintStyle.js +145 -0
- package/build/module/style/resolveDisplayHintStyle.js.map +1 -0
- package/build/module/theme/WorkflowTheme.js +200 -0
- package/build/module/theme/WorkflowTheme.js.map +1 -0
- package/build/module/utils/testable.js +12 -0
- package/build/module/utils/testable.js.map +1 -0
- package/build/typescript/WorkflowFontScaleContext.d.ts +7 -0
- package/build/typescript/WorkflowFontScaleContext.d.ts.map +1 -0
- package/build/typescript/adapter/WalletAdapter.d.ts +145 -0
- package/build/typescript/adapter/WalletAdapter.d.ts.map +1 -0
- package/build/typescript/components/FallbackVideoPlayer.d.ts +6 -0
- package/build/typescript/components/FallbackVideoPlayer.d.ts.map +1 -0
- package/build/typescript/components/FallbackVideoPlayer.native.d.ts +7 -0
- package/build/typescript/components/FallbackVideoPlayer.native.d.ts.map +1 -0
- package/build/typescript/components/FallbackVideoPlayer.web.d.ts +9 -0
- package/build/typescript/components/FallbackVideoPlayer.web.d.ts.map +1 -0
- package/build/typescript/components/WorkflowButtonLabel.d.ts +11 -0
- package/build/typescript/components/WorkflowButtonLabel.d.ts.map +1 -0
- package/build/typescript/components/WorkflowCalendarIcon.d.ts +11 -0
- package/build/typescript/components/WorkflowCalendarIcon.d.ts.map +1 -0
- package/build/typescript/components/WorkflowText.d.ts +13 -0
- package/build/typescript/components/WorkflowText.d.ts.map +1 -0
- package/build/typescript/content/BadgeContent.d.ts +5 -0
- package/build/typescript/content/BadgeContent.d.ts.map +1 -0
- package/build/typescript/content/BarChartContent.d.ts +5 -0
- package/build/typescript/content/BarChartContent.d.ts.map +1 -0
- package/build/typescript/content/BarcodeContent.d.ts +11 -0
- package/build/typescript/content/BarcodeContent.d.ts.map +1 -0
- package/build/typescript/content/BasicTableContent.d.ts +5 -0
- package/build/typescript/content/BasicTableContent.d.ts.map +1 -0
- package/build/typescript/content/ButtonContent.d.ts +5 -0
- package/build/typescript/content/ButtonContent.d.ts.map +1 -0
- package/build/typescript/content/CalendarContent.d.ts +19 -0
- package/build/typescript/content/CalendarContent.d.ts.map +1 -0
- package/build/typescript/content/CardContent.d.ts +5 -0
- package/build/typescript/content/CardContent.d.ts.map +1 -0
- package/build/typescript/content/CarouselContent.d.ts +5 -0
- package/build/typescript/content/CarouselContent.d.ts.map +1 -0
- package/build/typescript/content/ChipContent.d.ts +5 -0
- package/build/typescript/content/ChipContent.d.ts.map +1 -0
- package/build/typescript/content/ChipRowContent.d.ts +8 -0
- package/build/typescript/content/ChipRowContent.d.ts.map +1 -0
- package/build/typescript/content/CredentialOfferContent.d.ts +98 -0
- package/build/typescript/content/CredentialOfferContent.d.ts.map +1 -0
- package/build/typescript/content/DialContent.d.ts +5 -0
- package/build/typescript/content/DialContent.d.ts.map +1 -0
- package/build/typescript/content/DividerContent.d.ts +5 -0
- package/build/typescript/content/DividerContent.d.ts.map +1 -0
- package/build/typescript/content/DonutChartContent.d.ts +5 -0
- package/build/typescript/content/DonutChartContent.d.ts.map +1 -0
- package/build/typescript/content/FormContent.d.ts +19 -0
- package/build/typescript/content/FormContent.d.ts.map +1 -0
- package/build/typescript/content/FormFieldBridge.d.ts +2 -0
- package/build/typescript/content/FormFieldBridge.d.ts.map +1 -0
- package/build/typescript/content/GaugeContent.d.ts +5 -0
- package/build/typescript/content/GaugeContent.d.ts.map +1 -0
- package/build/typescript/content/GridLayoutContent.d.ts +5 -0
- package/build/typescript/content/GridLayoutContent.d.ts.map +1 -0
- package/build/typescript/content/ImageContent.d.ts +5 -0
- package/build/typescript/content/ImageContent.d.ts.map +1 -0
- package/build/typescript/content/ListContent.d.ts +5 -0
- package/build/typescript/content/ListContent.d.ts.map +1 -0
- package/build/typescript/content/LocationContent.d.ts +32 -0
- package/build/typescript/content/LocationContent.d.ts.map +1 -0
- package/build/typescript/content/MapContent.d.ts +11 -0
- package/build/typescript/content/MapContent.d.ts.map +1 -0
- package/build/typescript/content/MultipleChoiceContent.d.ts +5 -0
- package/build/typescript/content/MultipleChoiceContent.d.ts.map +1 -0
- package/build/typescript/content/OpenBadgePreviewContent.d.ts +14 -0
- package/build/typescript/content/OpenBadgePreviewContent.d.ts.map +1 -0
- package/build/typescript/content/PhotoContent.d.ts +57 -0
- package/build/typescript/content/PhotoContent.d.ts.map +1 -0
- package/build/typescript/content/PieChartContent.d.ts +5 -0
- package/build/typescript/content/PieChartContent.d.ts.map +1 -0
- package/build/typescript/content/ProofPresentationContent.d.ts +14 -0
- package/build/typescript/content/ProofPresentationContent.d.ts.map +1 -0
- package/build/typescript/content/RadioButtonContent.d.ts +5 -0
- package/build/typescript/content/RadioButtonContent.d.ts.map +1 -0
- package/build/typescript/content/RowContent.d.ts +5 -0
- package/build/typescript/content/RowContent.d.ts.map +1 -0
- package/build/typescript/content/SectionContent.d.ts +5 -0
- package/build/typescript/content/SectionContent.d.ts.map +1 -0
- package/build/typescript/content/ShareEntryContent.d.ts +15 -0
- package/build/typescript/content/ShareEntryContent.d.ts.map +1 -0
- package/build/typescript/content/SimulatedHint.d.ts +9 -0
- package/build/typescript/content/SimulatedHint.d.ts.map +1 -0
- package/build/typescript/content/SliderContent.d.ts +10 -0
- package/build/typescript/content/SliderContent.d.ts.map +1 -0
- package/build/typescript/content/SpacerContent.d.ts +5 -0
- package/build/typescript/content/SpacerContent.d.ts.map +1 -0
- package/build/typescript/content/SpinnerContent.d.ts +5 -0
- package/build/typescript/content/SpinnerContent.d.ts.map +1 -0
- package/build/typescript/content/SubmitButtonContent.d.ts +9 -0
- package/build/typescript/content/SubmitButtonContent.d.ts.map +1 -0
- package/build/typescript/content/TextContent.d.ts +5 -0
- package/build/typescript/content/TextContent.d.ts.map +1 -0
- package/build/typescript/content/TileContent.d.ts +5 -0
- package/build/typescript/content/TileContent.d.ts.map +1 -0
- package/build/typescript/content/TimelineContent.d.ts +5 -0
- package/build/typescript/content/TimelineContent.d.ts.map +1 -0
- package/build/typescript/content/TitleContent.d.ts +5 -0
- package/build/typescript/content/TitleContent.d.ts.map +1 -0
- package/build/typescript/content/VideoContent.d.ts +10 -0
- package/build/typescript/content/VideoContent.d.ts.map +1 -0
- package/build/typescript/content/WebLinkContent.d.ts +5 -0
- package/build/typescript/content/WebLinkContent.d.ts.map +1 -0
- package/build/typescript/content/index.d.ts +46 -0
- package/build/typescript/content/index.d.ts.map +1 -0
- package/build/typescript/form-fields/CheckboxField.d.ts +5 -0
- package/build/typescript/form-fields/CheckboxField.d.ts.map +1 -0
- package/build/typescript/form-fields/DateField.d.ts +6 -0
- package/build/typescript/form-fields/DateField.d.ts.map +1 -0
- package/build/typescript/form-fields/DateField.native.d.ts +5 -0
- package/build/typescript/form-fields/DateField.native.d.ts.map +1 -0
- package/build/typescript/form-fields/DateField.web.d.ts +9 -0
- package/build/typescript/form-fields/DateField.web.d.ts.map +1 -0
- package/build/typescript/form-fields/DropdownField.d.ts +5 -0
- package/build/typescript/form-fields/DropdownField.d.ts.map +1 -0
- package/build/typescript/form-fields/MCQField.d.ts +5 -0
- package/build/typescript/form-fields/MCQField.d.ts.map +1 -0
- package/build/typescript/form-fields/RadioField.d.ts +5 -0
- package/build/typescript/form-fields/RadioField.d.ts.map +1 -0
- package/build/typescript/form-fields/SliderField.d.ts +6 -0
- package/build/typescript/form-fields/SliderField.d.ts.map +1 -0
- package/build/typescript/form-fields/SliderField.native.d.ts +5 -0
- package/build/typescript/form-fields/SliderField.native.d.ts.map +1 -0
- package/build/typescript/form-fields/SliderField.web.d.ts +11 -0
- package/build/typescript/form-fields/SliderField.web.d.ts.map +1 -0
- package/build/typescript/form-fields/SubmitButtonField.d.ts +5 -0
- package/build/typescript/form-fields/SubmitButtonField.d.ts.map +1 -0
- package/build/typescript/form-fields/TextField.d.ts +5 -0
- package/build/typescript/form-fields/TextField.d.ts.map +1 -0
- package/build/typescript/form-fields/index.d.ts +13 -0
- package/build/typescript/form-fields/index.d.ts.map +1 -0
- package/build/typescript/i18n/WorkflowI18n.d.ts +75 -0
- package/build/typescript/i18n/WorkflowI18n.d.ts.map +1 -0
- package/build/typescript/icons/WorkflowIcon.d.ts +27 -0
- package/build/typescript/icons/WorkflowIcon.d.ts.map +1 -0
- package/build/typescript/imageUriCache.d.ts +7 -0
- package/build/typescript/imageUriCache.d.ts.map +1 -0
- package/build/typescript/index.d.ts +47 -0
- package/build/typescript/index.d.ts.map +1 -0
- package/build/typescript/modal/WorkflowModal.d.ts +33 -0
- package/build/typescript/modal/WorkflowModal.d.ts.map +1 -0
- package/build/typescript/package.json +1 -0
- package/build/typescript/platform/platformName.d.ts +8 -0
- package/build/typescript/platform/platformName.d.ts.map +1 -0
- package/build/typescript/platform/platformName.web.d.ts +3 -0
- package/build/typescript/platform/platformName.web.d.ts.map +1 -0
- package/build/typescript/protocol/controlSnapshotStore.d.ts +12 -0
- package/build/typescript/protocol/controlSnapshotStore.d.ts.map +1 -0
- package/build/typescript/protocol/useProtocolExchange.d.ts +40 -0
- package/build/typescript/protocol/useProtocolExchange.d.ts.map +1 -0
- package/build/typescript/registries/ContentRegistry.d.ts +57 -0
- package/build/typescript/registries/ContentRegistry.d.ts.map +1 -0
- package/build/typescript/registries/FormFieldRegistry.d.ts +37 -0
- package/build/typescript/registries/FormFieldRegistry.d.ts.map +1 -0
- package/build/typescript/render/NodeBoundary.d.ts +25 -0
- package/build/typescript/render/NodeBoundary.d.ts.map +1 -0
- package/build/typescript/render/RenderTree.d.ts +23 -0
- package/build/typescript/render/RenderTree.d.ts.map +1 -0
- package/build/typescript/render/WorkflowRenderContext.d.ts +57 -0
- package/build/typescript/render/WorkflowRenderContext.d.ts.map +1 -0
- package/build/typescript/render/nodes.d.ts +49 -0
- package/build/typescript/render/nodes.d.ts.map +1 -0
- package/build/typescript/responsive/ResponsiveProvider.d.ts +39 -0
- package/build/typescript/responsive/ResponsiveProvider.d.ts.map +1 -0
- package/build/typescript/responsive/index.d.ts +3 -0
- package/build/typescript/responsive/index.d.ts.map +1 -0
- package/build/typescript/responsive/responsive.d.ts +24 -0
- package/build/typescript/responsive/responsive.d.ts.map +1 -0
- package/build/typescript/style/resolveDisplayHintStyle.d.ts +23 -0
- package/build/typescript/style/resolveDisplayHintStyle.d.ts.map +1 -0
- package/build/typescript/theme/WorkflowTheme.d.ts +177 -0
- package/build/typescript/theme/WorkflowTheme.d.ts.map +1 -0
- package/build/typescript/utils/testable.d.ts +8 -0
- package/build/typescript/utils/testable.d.ts.map +1 -0
- package/package.json +101 -3
- package/src/WorkflowFontScaleContext.tsx +74 -0
- package/src/adapter/WalletAdapter.tsx +225 -0
- package/src/components/FallbackVideoPlayer.native.tsx +9 -0
- package/src/components/FallbackVideoPlayer.tsx +5 -0
- package/src/components/FallbackVideoPlayer.web.tsx +24 -0
- package/src/components/WorkflowButtonLabel.tsx +41 -0
- package/src/components/WorkflowCalendarIcon.tsx +52 -0
- package/src/components/WorkflowText.tsx +121 -0
- package/src/content/BadgeContent.tsx +57 -0
- package/src/content/BarChartContent.tsx +76 -0
- package/src/content/BarcodeContent.tsx +59 -0
- package/src/content/BasicTableContent.tsx +139 -0
- package/src/content/ButtonContent.tsx +124 -0
- package/src/content/CalendarContent.tsx +178 -0
- package/src/content/CardContent.tsx +137 -0
- package/src/content/CarouselContent.tsx +197 -0
- package/src/content/ChipContent.tsx +209 -0
- package/src/content/ChipRowContent.tsx +133 -0
- package/src/content/CredentialOfferContent.tsx +229 -0
- package/src/content/DialContent.tsx +96 -0
- package/src/content/DividerContent.tsx +33 -0
- package/src/content/DonutChartContent.tsx +110 -0
- package/src/content/FormContent.tsx +158 -0
- package/src/content/FormFieldBridge.tsx +144 -0
- package/src/content/GaugeContent.tsx +66 -0
- package/src/content/GridLayoutContent.tsx +285 -0
- package/src/content/ImageContent.tsx +222 -0
- package/src/content/ListContent.tsx +98 -0
- package/src/content/LocationContent.tsx +135 -0
- package/src/content/MapContent.tsx +232 -0
- package/src/content/MultipleChoiceContent.tsx +74 -0
- package/src/content/OpenBadgePreviewContent.tsx +93 -0
- package/src/content/PhotoContent.tsx +110 -0
- package/src/content/PieChartContent.tsx +121 -0
- package/src/content/ProofPresentationContent.tsx +127 -0
- package/src/content/RadioButtonContent.tsx +129 -0
- package/src/content/RowContent.tsx +627 -0
- package/src/content/SectionContent.tsx +133 -0
- package/src/content/ShareEntryContent.tsx +109 -0
- package/src/content/SimulatedHint.tsx +20 -0
- package/src/content/SliderContent.tsx +56 -0
- package/src/content/SpacerContent.tsx +15 -0
- package/src/content/SpinnerContent.tsx +24 -0
- package/src/content/SubmitButtonContent.tsx +256 -0
- package/src/content/TextContent.tsx +140 -0
- package/src/content/TileContent.tsx +216 -0
- package/src/content/TimelineContent.tsx +91 -0
- package/src/content/TitleContent.tsx +49 -0
- package/src/content/VideoContent.tsx +131 -0
- package/src/content/WebLinkContent.tsx +87 -0
- package/src/content/index.ts +45 -0
- package/src/form-fields/CheckboxField.tsx +29 -0
- package/src/form-fields/DateField.native.tsx +123 -0
- package/src/form-fields/DateField.tsx +5 -0
- package/src/form-fields/DateField.web.tsx +32 -0
- package/src/form-fields/DropdownField.tsx +137 -0
- package/src/form-fields/MCQField.tsx +68 -0
- package/src/form-fields/RadioField.tsx +53 -0
- package/src/form-fields/SliderField.native.tsx +53 -0
- package/src/form-fields/SliderField.tsx +5 -0
- package/src/form-fields/SliderField.web.tsx +58 -0
- package/src/form-fields/SubmitButtonField.tsx +33 -0
- package/src/form-fields/TextField.tsx +49 -0
- package/src/form-fields/index.ts +12 -0
- package/src/i18n/WorkflowI18n.tsx +100 -0
- package/src/icons/WorkflowIcon.tsx +43 -0
- package/src/imageUriCache.ts +27 -0
- package/src/index.ts +96 -0
- package/src/modal/WorkflowModal.tsx +119 -0
- package/src/platform/platformName.ts +7 -0
- package/src/platform/platformName.web.ts +2 -0
- package/src/protocol/controlSnapshotStore.ts +25 -0
- package/src/protocol/useProtocolExchange.ts +185 -0
- package/src/registries/ContentRegistry.tsx +130 -0
- package/src/registries/FormFieldRegistry.tsx +83 -0
- package/src/render/NodeBoundary.tsx +69 -0
- package/src/render/RenderTree.tsx +63 -0
- package/src/render/WorkflowRenderContext.tsx +71 -0
- package/src/render/nodes.ts +104 -0
- package/src/responsive/ResponsiveProvider.tsx +103 -0
- package/src/responsive/index.ts +7 -0
- package/src/responsive/responsive.ts +67 -0
- package/src/style/resolveDisplayHintStyle.ts +153 -0
- package/src/theme/WorkflowTheme.tsx +162 -0
- package/src/utils/testable.ts +10 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { clampScaled, createTypography } from './responsive.js';
|
|
3
|
+
export interface ResponsiveContext {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
fontScale: number;
|
|
7
|
+
isTablet: boolean;
|
|
8
|
+
isSmall: boolean;
|
|
9
|
+
s: (n: number) => number;
|
|
10
|
+
vs: (n: number) => number;
|
|
11
|
+
ms: (n: number) => number;
|
|
12
|
+
padH: number;
|
|
13
|
+
screenPad: number;
|
|
14
|
+
contentMaxWidth?: number;
|
|
15
|
+
typo: ReturnType<typeof createTypography>;
|
|
16
|
+
clamp: typeof clampScaled;
|
|
17
|
+
baseWidth: number;
|
|
18
|
+
baseHeight: number;
|
|
19
|
+
}
|
|
20
|
+
export type ScreenSize = {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
export type ResponsiveProviderProps = {
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* The screen the controls lay out for. Default: the window. The designer
|
|
28
|
+
* passes its phone frame (e.g. `{ width: 390, height: 844 }`) so sizes and
|
|
29
|
+
* fonts scale like on that phone, not like a 1440px browser window.
|
|
30
|
+
*/
|
|
31
|
+
size?: ScreenSize;
|
|
32
|
+
/** Text scale (default: the system setting). */
|
|
33
|
+
fontScale?: number;
|
|
34
|
+
};
|
|
35
|
+
export declare const ResponsiveProvider: React.FC<ResponsiveProviderProps>;
|
|
36
|
+
export declare const ResponsiveRule: React.FC<ResponsiveProviderProps>;
|
|
37
|
+
export declare function useResponsive(): ResponsiveContext;
|
|
38
|
+
export declare function useDigiCredStyles<T>(factory: (ctx: ResponsiveContext) => T): T;
|
|
39
|
+
//# sourceMappingURL=ResponsiveProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResponsiveProvider.d.ts","sourceRoot":"","sources":["../../../src/responsive/ResponsiveProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAA;AAEjE,OAAO,EAGL,WAAW,EAEX,gBAAgB,EAMjB,MAAM,iBAAc,CAAA;AAErB,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IACxB,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IACzB,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,IAAI,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;IACzC,KAAK,EAAE,OAAO,WAAW,CAAA;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;CACnB;AAqCD,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAE1D,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAGhE,CAAA;AAED,eAAO,MAAM,cAAc,mCAAqB,CAAA;AAEhD,wBAAgB,aAAa,IAAI,iBAAiB,CAOjD;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,CAAC,GAAG,CAAC,CAI9E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/responsive/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,yBAAsB,CAAA;AAClG,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,yBAAsB,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const BASE_WIDTH = 390;
|
|
2
|
+
export declare const BASE_HEIGHT = 844;
|
|
3
|
+
export declare const SCREEN_PAD_BASE = 10;
|
|
4
|
+
export declare function scale(size: number, width: number): number;
|
|
5
|
+
export declare function verticalScale(size: number, height: number): number;
|
|
6
|
+
export declare function moderateScale(size: number, width: number, factor?: number): number;
|
|
7
|
+
export declare function clampScaled(value: number, min: number, max: number): number;
|
|
8
|
+
export declare function horizontalPadding(width: number): number;
|
|
9
|
+
export declare function contentMaxWidth(width: number, height: number): number | undefined;
|
|
10
|
+
export declare function estimateGroupButtonScale(labels: string[], availableWidth: number, fontSize: number, opts?: {
|
|
11
|
+
avgCharWidthRatio?: number;
|
|
12
|
+
minScale?: number;
|
|
13
|
+
}): number;
|
|
14
|
+
export declare function createTypography(ms: (size: number) => number): {
|
|
15
|
+
display: number;
|
|
16
|
+
h1: number;
|
|
17
|
+
h2: number;
|
|
18
|
+
h3: number;
|
|
19
|
+
body: number;
|
|
20
|
+
bodySm: number;
|
|
21
|
+
caption: number;
|
|
22
|
+
micro: number;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=responsive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsive.d.ts","sourceRoot":"","sources":["../../../src/responsive/responsive.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,MAAM,CAAA;AAC7B,eAAO,MAAM,WAAW,MAAM,CAAA;AAC9B,eAAO,MAAM,eAAe,KAAK,CAAA;AAEjC,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,SAAM,GAAG,MAAM,CAE/E;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKjF;AAKD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EAAE,EAChB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GACvD,MAAM,CAcR;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM;;;;;;;;;EAW5D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ViewStyle } from 'react-native';
|
|
2
|
+
type DisplayHintItem = {
|
|
3
|
+
bgColor?: string;
|
|
4
|
+
background?: string;
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
padding?: number | string;
|
|
7
|
+
align?: string;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
export declare function resolveItemBackgroundColor(item: DisplayHintItem): string | undefined;
|
|
11
|
+
export declare function resolveSurfaceBackground(bgColor?: string): string;
|
|
12
|
+
export declare function resolveSurfacePadding(padding?: number | string): number | undefined;
|
|
13
|
+
export declare function resolveAspectRatio(value?: unknown): number | undefined;
|
|
14
|
+
export declare function resolveAlignSelf(align?: string): ViewStyle['alignSelf'] | undefined;
|
|
15
|
+
export declare function resolveItemSurfaceStyle(item: DisplayHintItem): ViewStyle;
|
|
16
|
+
export declare function resolveButtonFillStyle(item: DisplayHintItem, options?: {
|
|
17
|
+
includePadding?: boolean;
|
|
18
|
+
}): ViewStyle;
|
|
19
|
+
export declare function resolveButtonLabelColor(bgColor: string | undefined, fallbackOnFill: string, fallbackOnTransparent: string): string;
|
|
20
|
+
export declare function resolveFilledControlShadow(bgColor?: string): ViewStyle;
|
|
21
|
+
export declare function resolveFrameShadow(enabled?: boolean | string | number): ViewStyle;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=resolveDisplayHintStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveDisplayHintStyle.d.ts","sourceRoot":"","sources":["../../../src/style/resolveDisplayHintStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAEvD,KAAK,eAAe,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,CAAA;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAQpF;AAED,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAKjE;AAED,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CASnF;AAED,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAatE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG,SAAS,CAWnF;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,eAAe,GAAG,SAAS,CAexE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAc/G;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,cAAc,EAAE,MAAM,EACtB,qBAAqB,EAAE,MAAM,GAC5B,MAAM,CAER;AAED,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAqBtE;AAED,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAqBjF"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { ContentProps } from '../registries/ContentRegistry.js';
|
|
3
|
+
export type WorkflowColors = ContentProps['colors'] & {
|
|
4
|
+
/** Screen background behind the items (the designer's phone frame uses it). */
|
|
5
|
+
screenBackground?: string;
|
|
6
|
+
/** Secondary text: descriptions, ids, hints. */
|
|
7
|
+
muted?: string;
|
|
8
|
+
danger?: string;
|
|
9
|
+
success?: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Colours of the credential-offer / proof-presentation cards (from the
|
|
13
|
+
* designer's original preview). Display hints on the item still override them.
|
|
14
|
+
*/
|
|
15
|
+
export type WorkflowCardColors = {
|
|
16
|
+
surface: string;
|
|
17
|
+
border: string;
|
|
18
|
+
text: string;
|
|
19
|
+
mutedId: string;
|
|
20
|
+
offerKicker: string;
|
|
21
|
+
accent: string;
|
|
22
|
+
buttonText: string;
|
|
23
|
+
};
|
|
24
|
+
export type WorkflowTheme = {
|
|
25
|
+
colors: WorkflowColors;
|
|
26
|
+
/**
|
|
27
|
+
* The `styles` prop every control receives (`fieldContainer`, `label`,
|
|
28
|
+
* `input`, `button`, …). These used to be defined separately by each wallet
|
|
29
|
+
* screen that renders workflow items.
|
|
30
|
+
*/
|
|
31
|
+
styles: Record<string, any>;
|
|
32
|
+
card: WorkflowCardColors;
|
|
33
|
+
};
|
|
34
|
+
/** The DigiCred wallet's workflow screen (WorkflowDetails), the reference look. */
|
|
35
|
+
export declare const DEFAULT_WORKFLOW_COLORS: WorkflowColors;
|
|
36
|
+
export declare const DEFAULT_WORKFLOW_CARD_COLORS: WorkflowCardColors;
|
|
37
|
+
/** Host styles from the wallet's WorkflowDetails screen plus the form field styles. */
|
|
38
|
+
export declare const DEFAULT_WORKFLOW_STYLES: {
|
|
39
|
+
fieldContainer: {
|
|
40
|
+
marginBottom: number;
|
|
41
|
+
};
|
|
42
|
+
image: {
|
|
43
|
+
width: "100%";
|
|
44
|
+
height: number;
|
|
45
|
+
marginBottom: number;
|
|
46
|
+
borderRadius: number;
|
|
47
|
+
};
|
|
48
|
+
title: {
|
|
49
|
+
fontSize: number;
|
|
50
|
+
fontWeight: "700";
|
|
51
|
+
marginBottom: number;
|
|
52
|
+
color: string;
|
|
53
|
+
};
|
|
54
|
+
label: {
|
|
55
|
+
fontSize: number;
|
|
56
|
+
fontWeight: "600";
|
|
57
|
+
color: string;
|
|
58
|
+
marginBottom: number;
|
|
59
|
+
};
|
|
60
|
+
formLabel: {
|
|
61
|
+
fontSize: number;
|
|
62
|
+
fontWeight: "600";
|
|
63
|
+
color: string;
|
|
64
|
+
marginBottom: number;
|
|
65
|
+
};
|
|
66
|
+
description: {
|
|
67
|
+
fontSize: number;
|
|
68
|
+
color: string;
|
|
69
|
+
lineHeight: number;
|
|
70
|
+
marginBottom: number;
|
|
71
|
+
};
|
|
72
|
+
button: {
|
|
73
|
+
flexDirection: "row";
|
|
74
|
+
width: "100%";
|
|
75
|
+
alignSelf: "stretch";
|
|
76
|
+
paddingVertical: number;
|
|
77
|
+
paddingHorizontal: number;
|
|
78
|
+
justifyContent: "center";
|
|
79
|
+
alignItems: "center";
|
|
80
|
+
borderRadius: number;
|
|
81
|
+
borderWidth: number;
|
|
82
|
+
minHeight: number;
|
|
83
|
+
};
|
|
84
|
+
buttonText: {
|
|
85
|
+
fontSize: number;
|
|
86
|
+
fontWeight: "700";
|
|
87
|
+
lineHeight: number;
|
|
88
|
+
textAlign: "center";
|
|
89
|
+
color: string;
|
|
90
|
+
};
|
|
91
|
+
input: {
|
|
92
|
+
borderWidth: number;
|
|
93
|
+
borderRadius: number;
|
|
94
|
+
paddingHorizontal: number;
|
|
95
|
+
paddingVertical: number;
|
|
96
|
+
fontSize: number;
|
|
97
|
+
marginTop: number;
|
|
98
|
+
};
|
|
99
|
+
dateButton: {
|
|
100
|
+
borderWidth: number;
|
|
101
|
+
borderRadius: number;
|
|
102
|
+
paddingHorizontal: number;
|
|
103
|
+
paddingVertical: number;
|
|
104
|
+
marginTop: number;
|
|
105
|
+
};
|
|
106
|
+
dropdown: {
|
|
107
|
+
borderWidth: number;
|
|
108
|
+
borderRadius: number;
|
|
109
|
+
paddingHorizontal: number;
|
|
110
|
+
paddingVertical: number;
|
|
111
|
+
marginTop: number;
|
|
112
|
+
flexDirection: "row";
|
|
113
|
+
alignItems: "center";
|
|
114
|
+
};
|
|
115
|
+
checkboxRow: {
|
|
116
|
+
flexDirection: "row";
|
|
117
|
+
alignItems: "center";
|
|
118
|
+
paddingVertical: number;
|
|
119
|
+
};
|
|
120
|
+
checkbox: {
|
|
121
|
+
width: number;
|
|
122
|
+
height: number;
|
|
123
|
+
borderRadius: number;
|
|
124
|
+
borderWidth: number;
|
|
125
|
+
alignItems: "center";
|
|
126
|
+
justifyContent: "center";
|
|
127
|
+
marginRight: number;
|
|
128
|
+
};
|
|
129
|
+
checkboxLabel: {
|
|
130
|
+
fontSize: number;
|
|
131
|
+
flex: number;
|
|
132
|
+
};
|
|
133
|
+
radioRow: {
|
|
134
|
+
flexDirection: "row";
|
|
135
|
+
alignItems: "center";
|
|
136
|
+
paddingVertical: number;
|
|
137
|
+
};
|
|
138
|
+
radioOuter: {
|
|
139
|
+
width: number;
|
|
140
|
+
height: number;
|
|
141
|
+
borderRadius: number;
|
|
142
|
+
borderWidth: number;
|
|
143
|
+
alignItems: "center";
|
|
144
|
+
justifyContent: "center";
|
|
145
|
+
marginRight: number;
|
|
146
|
+
};
|
|
147
|
+
radioInner: {
|
|
148
|
+
width: number;
|
|
149
|
+
height: number;
|
|
150
|
+
borderRadius: number;
|
|
151
|
+
backgroundColor: string;
|
|
152
|
+
};
|
|
153
|
+
radioLabel: {
|
|
154
|
+
fontSize: number;
|
|
155
|
+
flex: number;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
export declare const DEFAULT_WORKFLOW_THEME: WorkflowTheme;
|
|
159
|
+
export type WorkflowThemeOverrides = {
|
|
160
|
+
colors?: Partial<WorkflowColors>;
|
|
161
|
+
styles?: Record<string, any>;
|
|
162
|
+
card?: Partial<WorkflowCardColors>;
|
|
163
|
+
};
|
|
164
|
+
/** Merges overrides into a theme; each style key is merged, not replaced. */
|
|
165
|
+
export declare function mergeWorkflowTheme(base: WorkflowTheme, overrides?: WorkflowThemeOverrides): WorkflowTheme;
|
|
166
|
+
export type WorkflowThemeProviderProps = {
|
|
167
|
+
theme?: WorkflowThemeOverrides;
|
|
168
|
+
children?: ReactNode;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Colours and host styles for every workflow control below it. Overrides are
|
|
172
|
+
* merged onto the enclosing theme (or the wallet defaults). Props passed to a
|
|
173
|
+
* control directly (`colors`, `styles`) still win over the theme.
|
|
174
|
+
*/
|
|
175
|
+
export declare function WorkflowThemeProvider({ theme, children }: WorkflowThemeProviderProps): import("react").JSX.Element;
|
|
176
|
+
export declare const useWorkflowTheme: () => WorkflowTheme;
|
|
177
|
+
//# sourceMappingURL=WorkflowTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowTheme.d.ts","sourceRoot":"","sources":["../../../src/theme/WorkflowTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAA;AAE1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAA+B,CAAA;AAEjE,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG;IACpD,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,cAAc,CAAA;IACtB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,IAAI,EAAE,kBAAkB,CAAA;CACzB,CAAA;AAED,mFAAmF;AACnF,eAAO,MAAM,uBAAuB,EAAE,cAYrC,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,kBAQ1C,CAAA;AAED,uFAAuF;AACvF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDlC,CAAA;AAEF,eAAO,MAAM,sBAAsB,EAAE,aAIpC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAA;CACnC,CAAA;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,sBAAsB,GAAG,aAAa,CAWzG;AAID,MAAM,MAAM,0BAA0B,GAAG;IAAE,KAAK,CAAC,EAAE,sBAAsB,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,CAAA;AAEjG;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,0BAA0B,+BAIpF;AAED,eAAO,MAAM,gBAAgB,QAAO,aAAiD,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test IDs used by the wallet's end-to-end tests. The prefix matches the
|
|
3
|
+
* wallet's existing IDs (bifold's `testIdPrefix`), so moving components here
|
|
4
|
+
* does not break those tests.
|
|
5
|
+
*/
|
|
6
|
+
export declare const testIdPrefix = "com.ariesbifold:id/";
|
|
7
|
+
export declare const testIdWithKey: (key: string) => string;
|
|
8
|
+
//# sourceMappingURL=testable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testable.d.ts","sourceRoot":"","sources":["../../../src/utils/testable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,YAAY,wBAAwB,CAAA;AAEjD,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM,KAAG,MAE3C,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,104 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veridid/workflow-ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React Native components for workflow display hints. Rendered natively by the DigiCred wallet and through react-native-web by the CrMS designer.",
|
|
5
|
+
"files": [
|
|
6
|
+
"build",
|
|
7
|
+
"src",
|
|
8
|
+
"!**/*.test.ts",
|
|
9
|
+
"!**/*.test.tsx"
|
|
10
|
+
],
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"source": "./src/index.ts",
|
|
13
|
+
"main": "./build/module/index.js",
|
|
14
|
+
"module": "./build/module/index.js",
|
|
15
|
+
"types": "./build/typescript/index.d.ts",
|
|
16
|
+
"react-native": "./src/index.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"source": "./src/index.ts",
|
|
20
|
+
"types": "./build/typescript/index.d.ts",
|
|
21
|
+
"react-native": "./src/index.ts",
|
|
22
|
+
"default": "./build/module/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/VeriDID/credo-ts-internal/tree/release/packages/workflow-ui",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/VeriDID/credo-ts-internal",
|
|
33
|
+
"directory": "packages/workflow-ui"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@veridid/workflow-core": "0.1.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@react-native-community/datetimepicker": ">=8.0.0",
|
|
40
|
+
"@react-native-community/slider": ">=5.0.0",
|
|
41
|
+
"react": ">=19.0.0",
|
|
42
|
+
"react-native": ">=0.79.0",
|
|
43
|
+
"react-native-svg": ">=15.0.0",
|
|
44
|
+
"react-native-vector-icons": ">=10.0.0",
|
|
45
|
+
"react-native-web": ">=0.21.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"@react-native-community/datetimepicker": {
|
|
49
|
+
"optional": true
|
|
50
|
+
},
|
|
51
|
+
"@react-native-community/slider": {
|
|
52
|
+
"optional": true
|
|
53
|
+
},
|
|
54
|
+
"react-native": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"react-native-web": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"react-native-builder-bob": {
|
|
62
|
+
"source": "src",
|
|
63
|
+
"output": "build",
|
|
64
|
+
"exclude": "**/*.test.{ts,tsx}",
|
|
65
|
+
"targets": [
|
|
66
|
+
[
|
|
67
|
+
"module",
|
|
68
|
+
{
|
|
69
|
+
"esm": true
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
"typescript",
|
|
74
|
+
{
|
|
75
|
+
"project": "tsconfig.build.json"
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"@react-native-community/datetimepicker": "^8.6.0",
|
|
82
|
+
"@react-native-community/slider": "^5.2.2",
|
|
83
|
+
"@testing-library/react": "^16.3.3",
|
|
84
|
+
"@types/react": "~19.2.18",
|
|
85
|
+
"@types/react-dom": "~19.2.7",
|
|
86
|
+
"@types/react-native-vector-icons": "~6.4.18",
|
|
87
|
+
"jsdom": "^31.0.1",
|
|
88
|
+
"react": "19.2.3",
|
|
89
|
+
"react-dom": "19.2.3",
|
|
90
|
+
"react-native": "0.84.1",
|
|
91
|
+
"react-native-builder-bob": "^0.44.1",
|
|
92
|
+
"react-native-svg": "15.15.4",
|
|
93
|
+
"react-native-vector-icons": "~10.3.0",
|
|
94
|
+
"react-native-web": "0.21.2",
|
|
95
|
+
"rimraf": "^6.1.4",
|
|
96
|
+
"typescript": "~5.9.3"
|
|
97
|
+
},
|
|
98
|
+
"scripts": {
|
|
99
|
+
"build": "bob build",
|
|
100
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
101
|
+
"check:web": "node scripts/check-web-bundle.mjs",
|
|
102
|
+
"clean": "rimraf ./build"
|
|
103
|
+
}
|
|
6
104
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
// Screen-wide registry for "every title on this screen must render at the
|
|
4
|
+
// same font size" (and similarly for other synced text kinds in future).
|
|
5
|
+
// Each sibling group (e.g. one carousel's card/tile titles) registers the
|
|
6
|
+
// smallest scale IT needs to avoid clipping; the screen-wide scale exposed to
|
|
7
|
+
// every WorkflowText is the minimum across all registered groups, so a tight
|
|
8
|
+
// carousel in one section still keeps titles consistent with every other
|
|
9
|
+
// section on the same screen.
|
|
10
|
+
interface WorkflowFontScaleContextValue {
|
|
11
|
+
titleScale: number
|
|
12
|
+
registerTitleGroupScale: (id: string, scale: number) => void
|
|
13
|
+
unregisterTitleGroupScale: (id: string) => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const DEFAULT_VALUE: WorkflowFontScaleContextValue = {
|
|
17
|
+
titleScale: 1,
|
|
18
|
+
registerTitleGroupScale: () => {},
|
|
19
|
+
unregisterTitleGroupScale: () => {},
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const WorkflowFontScaleReactContext = createContext<WorkflowFontScaleContextValue>(DEFAULT_VALUE)
|
|
23
|
+
|
|
24
|
+
export const WorkflowFontScaleProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
|
25
|
+
const scalesRef = useRef<Map<string, number>>(new Map())
|
|
26
|
+
const [titleScale, setTitleScale] = useState(1)
|
|
27
|
+
|
|
28
|
+
const recompute = useCallback(() => {
|
|
29
|
+
const values = Array.from(scalesRef.current.values())
|
|
30
|
+
setTitleScale(values.length > 0 ? Math.min(...values) : 1)
|
|
31
|
+
}, [])
|
|
32
|
+
|
|
33
|
+
const registerTitleGroupScale = useCallback(
|
|
34
|
+
(id: string, scale: number) => {
|
|
35
|
+
if (scalesRef.current.get(id) === scale) return
|
|
36
|
+
scalesRef.current.set(id, scale)
|
|
37
|
+
recompute()
|
|
38
|
+
},
|
|
39
|
+
[recompute]
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
const unregisterTitleGroupScale = useCallback(
|
|
43
|
+
(id: string) => {
|
|
44
|
+
if (!scalesRef.current.has(id)) return
|
|
45
|
+
scalesRef.current.delete(id)
|
|
46
|
+
recompute()
|
|
47
|
+
},
|
|
48
|
+
[recompute]
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
const value = useMemo(
|
|
52
|
+
() => ({ titleScale, registerTitleGroupScale, unregisterTitleGroupScale }),
|
|
53
|
+
[titleScale, registerTitleGroupScale, unregisterTitleGroupScale]
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
return <WorkflowFontScaleReactContext.Provider value={value}>{children}</WorkflowFontScaleReactContext.Provider>
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Read the current screen-wide title scale (1 outside any provider).
|
|
60
|
+
export function useWorkflowTitleScale(): number {
|
|
61
|
+
return useContext(WorkflowFontScaleReactContext).titleScale
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Report the smallest scale a sibling group (e.g. one carousel) needs so its
|
|
65
|
+
// own titles fit on one line. `id` must be stable for the group's lifetime;
|
|
66
|
+
// `scale` may change across renders (e.g. once the carousel measures width).
|
|
67
|
+
export function useRegisterTitleGroupScale(id: string, scale: number): void {
|
|
68
|
+
const { registerTitleGroupScale, unregisterTitleGroupScale } = useContext(WorkflowFontScaleReactContext)
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
registerTitleGroupScale(id, scale)
|
|
72
|
+
return () => unregisterTitleGroupScale(id)
|
|
73
|
+
}, [id, scale, registerTitleGroupScale, unregisterTitleGroupScale])
|
|
74
|
+
}
|