@mittwald/flow-react-components 1.6.0 → 1.6.1

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.
Files changed (34) hide show
  1. package/dist/assets/component-index.json +1 -1
  2. package/dist/assets/doc-properties.json +1 -1
  3. package/dist/css/all-layered.css +1 -1
  4. package/dist/css/all.css +1 -1
  5. package/dist/js/_virtual/_30.locale.mjs +4 -0
  6. package/dist/js/_virtual/_36.locale.mjs +2 -0
  7. package/dist/js/packages/components/src/components/Alert/Alert.mjs +10 -6
  8. package/dist/js/packages/components/src/components/Alert/Alert.mjs.map +1 -1
  9. package/dist/js/packages/components/src/components/Alert/Alert.module.mjs +2 -2
  10. package/dist/js/packages/components/src/components/Alert/Alert.module.mjs.map +1 -1
  11. package/dist/js/packages/components/src/components/AlertBadge/AlertBadge.module.mjs.map +1 -1
  12. package/dist/js/packages/components/src/components/FieldError/FieldError.mjs +1 -1
  13. package/dist/js/packages/components/src/components/FieldError/FieldError.mjs.map +1 -1
  14. package/dist/js/packages/components/src/components/Image/Image.module.mjs.map +1 -1
  15. package/dist/js/packages/components/src/components/InlineCode/InlineCode.mjs +5 -3
  16. package/dist/js/packages/components/src/components/InlineCode/InlineCode.mjs.map +1 -1
  17. package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +6 -7
  18. package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
  19. package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs +3 -7
  20. package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs.map +1 -1
  21. package/dist/js/packages/components/src/components/PasswordCreationField/lib/generateValidationTranslation.mjs +16 -1
  22. package/dist/js/packages/components/src/components/PasswordCreationField/lib/generateValidationTranslation.mjs.map +1 -1
  23. package/dist/js/packages/components/src/components/propTypes/index.mjs +1 -0
  24. package/dist/js/packages/components/src/components/propTypes/index.mjs.map +1 -1
  25. package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs +6 -1
  26. package/dist/js/packages/components/src/integrations/react-hook-form/components/Field/Field.mjs.map +1 -1
  27. package/dist/js/packages/components/src/lib/hooks/useFieldComponent.mjs.map +1 -1
  28. package/dist/js/packages/components/src/lib/hooks/useFieldError.mjs +15 -5
  29. package/dist/js/packages/components/src/lib/hooks/useFieldError.mjs.map +1 -1
  30. package/dist/types/components/InlineCode/InlineCode.d.ts +4 -3
  31. package/dist/types/components/propTypes/index.d.ts +2 -0
  32. package/dist/types/lib/hooks/useFieldComponent.d.ts +2 -1
  33. package/dist/types/lib/hooks/useFieldError.d.ts +5 -1
  34. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"Field.mjs","names":["locales","_Fragment"],"sources":["../../../../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import { useFormContext } from \"@/integrations/react-hook-form/components/FormContextProvider/FormContextProvider\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { type PropsWithChildren } from \"react\";\nimport {\n type ControllerProps,\n type FieldValues,\n useController,\n type UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"./locales/*.locale.json\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\nimport { useUpdateFormDefaultValue } from \"@/integrations/react-hook-form/components/Field/hooks/useUpdateFormDefaultValue\";\nimport type {\n FlowComponentName,\n FlowComponentPropName,\n} from \"@/components/propTypes\";\n\ntype DisableableComponentName = {\n [C in FlowComponentName]: \"isDisabled\" extends FlowComponentPropName<C>\n ? C\n : never;\n}[FlowComponentName];\n\nexport interface FieldProps<T extends FieldValues>\n extends Omit<ControllerProps<T>, \"render\">, PropsWithChildren {}\n\nexport function Field<T extends FieldValues>(props: FieldProps<T>) {\n const { children, name, defaultValue, ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(\n locales,\n \"ReactHookForm.Field\",\n );\n\n const controller = useController({\n ...props,\n rules: {\n ...props.rules,\n min:\n typeof rest.rules?.min === \"number\"\n ? {\n value: rest.rules.min,\n message: stringFormatter.format(\"validation.min\", {\n number: rest.rules.min,\n }),\n }\n : rest.rules?.min,\n max:\n typeof rest.rules?.max === \"number\"\n ? {\n value: rest.rules.max,\n message: stringFormatter.format(\"validation.max\", {\n number: rest.rules.max,\n }),\n }\n : rest.rules?.max,\n required:\n typeof rest.rules?.required === \"boolean\"\n ? stringFormatter.format(\"validation.required\")\n : rest.rules?.required,\n pattern:\n rest.rules?.pattern instanceof RegExp\n ? {\n value: rest.rules.pattern,\n message: stringFormatter.format(\"validation.pattern\", {\n pattern: rest.rules.pattern.source,\n }),\n }\n : rest.rules?.pattern,\n minLength:\n typeof rest.rules?.minLength === \"number\"\n ? {\n value: rest.rules.minLength,\n message: stringFormatter.format(\"validation.minLength\", {\n number: rest.rules.minLength,\n }),\n }\n : rest.rules?.minLength,\n maxLength:\n typeof rest.rules?.maxLength === \"number\"\n ? {\n value: rest.rules.maxLength,\n message: stringFormatter.format(\"validation.maxLength\", {\n number: rest.rules.maxLength,\n }),\n }\n : rest.rules?.maxLength,\n },\n });\n const formContext = useFormContext<T>();\n\n useUpdateFormDefaultValue(props, formContext.form);\n\n /**\n * We don't use controller.field.value here, because it doesn't update when\n * the form value is updated outside of this field (e.g. when setting values\n * with form.setValue or resetting the form), and the Field unmounts in\n * between. This is generally a feature of React Hook Form, but this breaks\n * dynamic forms where fields are conditionally rendered.\n *\n * By using formContext.form.watch(name), we ensure that the field value is\n * always in sync with the form state. See:\n * https://react-hook-form.com/api/usecontroller/controller/\n */\n const value =\n useWatch({\n control: formContext.form.control,\n name,\n }) ?? controller.field.value;\n\n const isFieldInvalid = controller.fieldState.invalid;\n\n const { disabled, ...controllerFieldProps } = controller.field;\n\n const fieldProps = {\n ...controllerFieldProps,\n // Dynamic, so a local `isDisabled={false}` cannot enable a field whose\n // value React Hook Form drops on submit\n ...(disabled && {\n isDisabled: dynamic<DisableableComponentName, \"isDisabled\">(() => true),\n }),\n value,\n name,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n isReadOnly: formContext.isReadOnly,\n validationBehavior: \"aria\" as const,\n defaultValue,\n isInvalid: isFieldInvalid,\n children: dynamic((p) => {\n return (\n <>\n {p.children}\n <FieldErrorView>\n {controller.fieldState.error?.message}\n </FieldErrorView>\n </>\n );\n }),\n };\n\n const propsContext: PropsContext = {\n Autocomplete: {\n SearchField: fieldProps,\n TextField: fieldProps,\n },\n SearchField: fieldProps,\n TextField: fieldProps,\n TextArea: fieldProps,\n MarkdownEditor: fieldProps,\n CodeEditor: fieldProps,\n Checkbox: {\n ...fieldProps,\n isSelected: value,\n },\n CheckboxGroup: {\n ...fieldProps,\n },\n CheckboxButton: {\n ...fieldProps,\n isSelected: value,\n },\n FileField: fieldProps,\n FileDropZone: fieldProps,\n NumberField: fieldProps,\n RadioGroup: fieldProps,\n Switch: {\n ...fieldProps,\n isSelected: value,\n },\n Slider: fieldProps,\n PasswordCreationField: fieldProps,\n DatePicker: fieldProps,\n DateRangePicker: fieldProps,\n TimeField: fieldProps,\n SegmentedControl: fieldProps,\n Select: {\n ...fieldProps,\n selectedKey: value,\n },\n ComboBox: {\n ...fieldProps,\n selectedKey: value,\n },\n Rating: fieldProps,\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[\n controller.fieldState,\n controller.field,\n value,\n formContext.isReadOnly,\n ]}\n >\n {children}\n </PropsContextProvider>\n );\n}\n\nexport const typedField = <T extends FieldValues>(\n ignoredForm: UseFormReturn<T> | UseFormReturn<T>[\"control\"],\n): typeof Field<T> => Field;\n\nexport default Field;\n"],"mappings":"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"}
1
+ {"version":3,"file":"Field.mjs","names":["locales","_Fragment"],"sources":["../../../../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import { useFormContext } from \"@/integrations/react-hook-form/components/FormContextProvider/FormContextProvider\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport { type PropsWithChildren } from \"react\";\nimport {\n type ControllerProps,\n type FieldValues,\n useController,\n type UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"./locales/*.locale.json\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\nimport { useUpdateFormDefaultValue } from \"@/integrations/react-hook-form/components/Field/hooks/useUpdateFormDefaultValue\";\nimport type {\n FlowComponentName,\n FlowComponentPropName,\n} from \"@/components/propTypes\";\n\ntype DisableableComponentName = {\n [C in FlowComponentName]: \"isDisabled\" extends FlowComponentPropName<C>\n ? C\n : never;\n}[FlowComponentName];\n\nexport interface FieldProps<T extends FieldValues>\n extends Omit<ControllerProps<T>, \"render\">, PropsWithChildren {}\n\nexport function Field<T extends FieldValues>(props: FieldProps<T>) {\n const { children, name, defaultValue, ...rest } = props;\n\n const stringFormatter = useLocalizedStringFormatter(\n locales,\n \"ReactHookForm.Field\",\n );\n\n const controller = useController({\n ...props,\n rules: {\n ...props.rules,\n min:\n typeof rest.rules?.min === \"number\"\n ? {\n value: rest.rules.min,\n message: stringFormatter.format(\"validation.min\", {\n number: rest.rules.min,\n }),\n }\n : rest.rules?.min,\n max:\n typeof rest.rules?.max === \"number\"\n ? {\n value: rest.rules.max,\n message: stringFormatter.format(\"validation.max\", {\n number: rest.rules.max,\n }),\n }\n : rest.rules?.max,\n required:\n typeof rest.rules?.required === \"boolean\"\n ? stringFormatter.format(\"validation.required\")\n : rest.rules?.required,\n pattern:\n rest.rules?.pattern instanceof RegExp\n ? {\n value: rest.rules.pattern,\n message: stringFormatter.format(\"validation.pattern\", {\n pattern: rest.rules.pattern.source,\n }),\n }\n : rest.rules?.pattern,\n minLength:\n typeof rest.rules?.minLength === \"number\"\n ? {\n value: rest.rules.minLength,\n message: stringFormatter.format(\"validation.minLength\", {\n number: rest.rules.minLength,\n }),\n }\n : rest.rules?.minLength,\n maxLength:\n typeof rest.rules?.maxLength === \"number\"\n ? {\n value: rest.rules.maxLength,\n message: stringFormatter.format(\"validation.maxLength\", {\n number: rest.rules.maxLength,\n }),\n }\n : rest.rules?.maxLength,\n },\n });\n const formContext = useFormContext<T>();\n\n useUpdateFormDefaultValue(props, formContext.form);\n\n /**\n * We don't use controller.field.value here, because it doesn't update when\n * the form value is updated outside of this field (e.g. when setting values\n * with form.setValue or resetting the form), and the Field unmounts in\n * between. This is generally a feature of React Hook Form, but this breaks\n * dynamic forms where fields are conditionally rendered.\n *\n * By using formContext.form.watch(name), we ensure that the field value is\n * always in sync with the form state. See:\n * https://react-hook-form.com/api/usecontroller/controller/\n */\n const value =\n useWatch({\n control: formContext.form.control,\n name,\n }) ?? controller.field.value;\n\n const isFieldInvalid = controller.fieldState.invalid;\n const errorMessage = controller.fieldState.error?.message;\n const fieldError = errorMessage ? (\n <FieldErrorView>{errorMessage}</FieldErrorView>\n ) : isFieldInvalid ? (\n <FieldErrorView isFallback>\n {stringFormatter.format(\"validation.invalid\")}\n </FieldErrorView>\n ) : null;\n\n const { disabled, ...controllerFieldProps } = controller.field;\n\n const fieldProps = {\n ...controllerFieldProps,\n // Dynamic, so a local `isDisabled={false}` cannot enable a field whose\n // value React Hook Form drops on submit\n ...(disabled && {\n isDisabled: dynamic<DisableableComponentName, \"isDisabled\">(() => true),\n }),\n value,\n name,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n isReadOnly: formContext.isReadOnly,\n validationBehavior: \"aria\" as const,\n defaultValue,\n isInvalid: isFieldInvalid,\n children: dynamic((p) => {\n return (\n <>\n {p.children}\n {fieldError}\n </>\n );\n }),\n };\n\n const propsContext: PropsContext = {\n Autocomplete: {\n SearchField: fieldProps,\n TextField: fieldProps,\n },\n SearchField: fieldProps,\n TextField: fieldProps,\n TextArea: fieldProps,\n MarkdownEditor: fieldProps,\n CodeEditor: fieldProps,\n Checkbox: {\n ...fieldProps,\n isSelected: value,\n },\n CheckboxGroup: {\n ...fieldProps,\n },\n CheckboxButton: {\n ...fieldProps,\n isSelected: value,\n },\n FileField: fieldProps,\n FileDropZone: fieldProps,\n NumberField: fieldProps,\n RadioGroup: fieldProps,\n Switch: {\n ...fieldProps,\n isSelected: value,\n },\n Slider: fieldProps,\n PasswordCreationField: fieldProps,\n DatePicker: fieldProps,\n DateRangePicker: fieldProps,\n TimeField: fieldProps,\n SegmentedControl: fieldProps,\n Select: {\n ...fieldProps,\n selectedKey: value,\n },\n ComboBox: {\n ...fieldProps,\n selectedKey: value,\n },\n Rating: fieldProps,\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[\n controller.fieldState,\n controller.field,\n value,\n formContext.isReadOnly,\n ]}\n >\n {children}\n </PropsContextProvider>\n );\n}\n\nexport const typedField = <T extends FieldValues>(\n ignoredForm: UseFormReturn<T> | UseFormReturn<T>[\"control\"],\n): typeof Field<T> => Field;\n\nexport default Field;\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"useFieldComponent.mjs","names":["formFieldStyles"],"sources":["../../../../../../../src/lib/hooks/useFieldComponent.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, useId } from \"react\";\nimport { type PropsContext } from \"@/lib/propsContext\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport { useFieldError } from \"@/lib/hooks/useFieldError\";\nimport { type ClassValue } from \"clsx\";\nimport type { FlowComponentName } from \"@/components/propTypes\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\ninterface FieldComponentProps {\n className?: ClassValue;\n isRequired?: boolean;\n isDisabled?: boolean;\n \"aria-describedby\"?: string;\n}\n\nexport interface UseFieldComponent {\n FieldErrorCaptureContext: FC<PropsWithChildren>;\n FieldErrorView: FC;\n fieldPropsContext: PropsContext;\n /** For the field's outer element. */\n wrapperProps: {\n className: string;\n };\n /**\n * For what assistive technology lands on — the input, or the group of a\n * grouped control. Where the react-aria root forwards `aria-describedby` to\n * its input itself, spread it on the root together with `wrapperProps`.\n * Spread it after `rest`: it already contains the consumer's\n * `aria-describedby`, which `rest` would otherwise put back alone.\n */\n controlProps: {\n \"aria-describedby\"?: string;\n };\n /** The id of the error while one is rendered, without the consumer's ids. */\n renderedFieldErrorId?: string;\n /**\n * Belongs on the field's root element. In an enabled `SkeletonMode` it makes\n * the field `inert`, and `data-skeleton` turns its control into a surface\n * (`formSkeleton` in `@/styles/mixins/formControl`).\n */\n skeletonProps: {\n inert?: true;\n \"data-skeleton\"?: true;\n };\n}\n\n/** Joins id references, dropping empty ones. @internal */\nexport const joinIds = (...ids: (string | false | null | undefined)[]) =>\n ids.filter(Boolean).join(\" \") || undefined;\n\nexport const useFieldComponent = (\n props: FieldComponentProps,\n component: FlowComponentName,\n): UseFieldComponent => {\n const fieldErrorId = useId();\n const { FieldErrorView, FieldErrorCaptureContext, renderedFieldErrorId } =\n useFieldError({\n fieldErrorId,\n component,\n });\n const isSkeleton = useSkeletonMode();\n\n // setting up the props context for all components that\n // are part of a form control\n const fieldPropsContext: PropsContext = {\n Label: {\n className: formFieldStyles.label,\n optional: !props.isRequired,\n isDisabled: !!props.isDisabled,\n },\n FieldDescription: {\n className: formFieldStyles.fieldDescription,\n },\n };\n\n return {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n wrapperProps: {\n className: formFieldStyles.formField,\n },\n controlProps: {\n // Reference the error only while it is rendered – an id that points to\n // nothing fails HTML validators and a11y checks.\n \"aria-describedby\": joinIds(\n renderedFieldErrorId,\n props[\"aria-describedby\"],\n ),\n },\n renderedFieldErrorId,\n skeletonProps: isSkeleton ? { inert: true, \"data-skeleton\": true } : {},\n } as const;\n};\n"],"mappings":";;;;;;;;;AA+CA,IAAa,WAAW,GAAG,QACzB,IAAI,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA;AAEnC,IAAa,qBACX,OACA,cACsB;CACtB,MAAM,eAAe,MAAM;CAC3B,MAAM,EAAE,gBAAgB,0BAA0B,yBAChD,cAAc;EACZ;EACA;CACF,CAAC;CACH,MAAM,aAAa,gBAAgB;CAenC,OAAO;EACL;EACA;EACA,mBAAA;GAbA,OAAO;IACL,WAAWA,yBAAgB;IAC3B,UAAU,CAAC,MAAM;IACjB,YAAY,CAAC,CAAC,MAAM;GACtB;GACA,kBAAkB,EAChB,WAAWA,yBAAgB,iBAC7B;EAMA;EACA,cAAc,EACZ,WAAWA,yBAAgB,UAC7B;EACA,cAAc,EAGZ,oBAAoB,QAClB,sBACA,MAAM,mBACR,EACF;EACA;EACA,eAAe,aAAa;GAAE,OAAO;GAAM,iBAAiB;EAAK,IAAI,CAAC;CACxE;AACF"}
1
+ {"version":3,"file":"useFieldComponent.mjs","names":["formFieldStyles"],"sources":["../../../../../../../src/lib/hooks/useFieldComponent.tsx"],"sourcesContent":["import { type FC, type PropsWithChildren, useId } from \"react\";\nimport { type PropsContext } from \"@/lib/propsContext\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport {\n type FieldErrorViewProps,\n useFieldError,\n} from \"@/lib/hooks/useFieldError\";\nimport { type ClassValue } from \"clsx\";\nimport type { FlowComponentName } from \"@/components/propTypes\";\nimport { useSkeletonMode } from \"@/components/SkeletonMode/skeletonModeContext\";\n\ninterface FieldComponentProps {\n className?: ClassValue;\n isRequired?: boolean;\n isDisabled?: boolean;\n \"aria-describedby\"?: string;\n}\n\nexport interface UseFieldComponent {\n FieldErrorCaptureContext: FC<PropsWithChildren>;\n FieldErrorView: FC<FieldErrorViewProps>;\n fieldPropsContext: PropsContext;\n /** For the field's outer element. */\n wrapperProps: {\n className: string;\n };\n /**\n * For what assistive technology lands on — the input, or the group of a\n * grouped control. Where the react-aria root forwards `aria-describedby` to\n * its input itself, spread it on the root together with `wrapperProps`.\n * Spread it after `rest`: it already contains the consumer's\n * `aria-describedby`, which `rest` would otherwise put back alone.\n */\n controlProps: {\n \"aria-describedby\"?: string;\n };\n /** The id of the error while one is rendered, without the consumer's ids. */\n renderedFieldErrorId?: string;\n /**\n * Belongs on the field's root element. In an enabled `SkeletonMode` it makes\n * the field `inert`, and `data-skeleton` turns its control into a surface\n * (`formSkeleton` in `@/styles/mixins/formControl`).\n */\n skeletonProps: {\n inert?: true;\n \"data-skeleton\"?: true;\n };\n}\n\n/** Joins id references, dropping empty ones. @internal */\nexport const joinIds = (...ids: (string | false | null | undefined)[]) =>\n ids.filter(Boolean).join(\" \") || undefined;\n\nexport const useFieldComponent = (\n props: FieldComponentProps,\n component: FlowComponentName,\n): UseFieldComponent => {\n const fieldErrorId = useId();\n const { FieldErrorView, FieldErrorCaptureContext, renderedFieldErrorId } =\n useFieldError({\n fieldErrorId,\n component,\n });\n const isSkeleton = useSkeletonMode();\n\n // setting up the props context for all components that\n // are part of a form control\n const fieldPropsContext: PropsContext = {\n Label: {\n className: formFieldStyles.label,\n optional: !props.isRequired,\n isDisabled: !!props.isDisabled,\n },\n FieldDescription: {\n className: formFieldStyles.fieldDescription,\n },\n };\n\n return {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n wrapperProps: {\n className: formFieldStyles.formField,\n },\n controlProps: {\n // Reference the error only while it is rendered – an id that points to\n // nothing fails HTML validators and a11y checks.\n \"aria-describedby\": joinIds(\n renderedFieldErrorId,\n props[\"aria-describedby\"],\n ),\n },\n renderedFieldErrorId,\n skeletonProps: isSkeleton ? { inert: true, \"data-skeleton\": true } : {},\n } as const;\n};\n"],"mappings":";;;;;;;;;AAkDA,IAAa,WAAW,GAAG,QACzB,IAAI,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA;AAEnC,IAAa,qBACX,OACA,cACsB;CACtB,MAAM,eAAe,MAAM;CAC3B,MAAM,EAAE,gBAAgB,0BAA0B,yBAChD,cAAc;EACZ;EACA;CACF,CAAC;CACH,MAAM,aAAa,gBAAgB;CAenC,OAAO;EACL;EACA;EACA,mBAAA;GAbA,OAAO;IACL,WAAWA,yBAAgB;IAC3B,UAAU,CAAC,MAAM;IACjB,YAAY,CAAC,CAAC,MAAM;GACtB;GACA,kBAAkB,EAChB,WAAWA,yBAAgB,iBAC7B;EAMA;EACA,cAAc,EACZ,WAAWA,yBAAgB,UAC7B;EACA,cAAc,EAGZ,oBAAoB,QAClB,sBACA,MAAM,mBACR,EACF;EACA;EACA,eAAe,aAAa;GAAE,OAAO;GAAM,iBAAiB;EAAK,IAAI,CAAC;CACxE;AACF"}
@@ -3,6 +3,7 @@
3
3
  import useProps from "./useProps.mjs";
4
4
  import { PropsContextProvider } from "../propsContext/components/PropsContextProvider.mjs";
5
5
  import { ClearPropsContext } from "../propsContext/components/ClearPropsContext.mjs";
6
+ import dynamic from "../propsContext/dynamicProps/dynamic.mjs";
6
7
  import { UiComponentTunnelExit } from "../../components/UiComponentTunnel/UiComponentTunnelExit.mjs";
7
8
  import FormField_module_default from "../../components/FormField/FormField.module.mjs";
8
9
  import { FieldErrorRenderedContext } from "./fieldErrorRenderedContext.mjs";
@@ -12,12 +13,13 @@ import { jsx } from "react/jsx-runtime";
12
13
  var useFieldError = (options) => {
13
14
  const currentTunnelId = useProps("FieldError", {}).tunnel?.id;
14
15
  const tunnelId = options.tunnelId ?? currentTunnelId ?? `${options.fieldErrorId}.fieldError`;
16
+ const fallbackTunnelId = `${tunnelId}.fallback`;
15
17
  const fieldErrorCapturePropsContext = { FieldError: {
16
18
  id: options.fieldErrorId,
17
- tunnel: {
18
- id: tunnelId,
19
+ tunnel: dynamic((props) => ({
20
+ id: props.isFallback ? fallbackTunnelId : tunnelId,
19
21
  component: options.component
20
- },
22
+ })),
21
23
  className: FormField_module_default.fieldError
22
24
  } };
23
25
  const [renderedFieldErrorId, setRenderedFieldErrorId] = useState();
@@ -29,7 +31,7 @@ var useFieldError = (options) => {
29
31
  children: props.children
30
32
  });
31
33
  }, [tunnelId]),
32
- FieldErrorView: useMemo(() => () => {
34
+ FieldErrorView: useMemo(() => ({ withoutFallback }) => {
33
35
  if (currentTunnelId) return null;
34
36
  return /* @__PURE__ */ jsx(FieldErrorRenderedContext, {
35
37
  value: setRenderedFieldErrorId,
@@ -38,12 +40,20 @@ var useFieldError = (options) => {
38
40
  component: options.component,
39
41
  children: (children) => {
40
42
  const childrenArray = React.Children.toArray(children);
41
- return /* @__PURE__ */ jsx(ClearPropsContext, { children: childrenArray[0] });
43
+ return /* @__PURE__ */ jsx(UiComponentTunnelExit, {
44
+ id: fallbackTunnelId,
45
+ component: options.component,
46
+ children: (fallbackChildren) => {
47
+ const fallbackChildrenArray = React.Children.toArray(fallbackChildren);
48
+ return /* @__PURE__ */ jsx(ClearPropsContext, { children: childrenArray[0] ?? (withoutFallback ? null : fallbackChildrenArray[0]) });
49
+ }
50
+ });
42
51
  }
43
52
  })
44
53
  });
45
54
  }, [
46
55
  currentTunnelId,
56
+ fallbackTunnelId,
47
57
  tunnelId,
48
58
  options.component
49
59
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"useFieldError.mjs","names":["formFieldStyles"],"sources":["../../../../../../../src/lib/hooks/useFieldError.tsx"],"sourcesContent":["import React, {\n type FC,\n type PropsWithChildren,\n useMemo,\n useState,\n} from \"react\";\nimport { type PropsContext, PropsContextProvider } from \"@/lib/propsContext\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport ClearPropsContext from \"@/lib/propsContext/components/ClearPropsContext\";\nimport { useProps } from \"@/lib/hooks/useProps\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport type { FlowComponentName } from \"@/components/propTypes\";\nimport { FieldErrorRenderedContext } from \"@/lib/hooks/fieldErrorRenderedContext\";\n\nexport interface UseFieldErrorOptions {\n fieldErrorId: string;\n tunnelId?: string;\n component: FlowComponentName;\n}\n\nexport const useFieldError = (options: UseFieldErrorOptions) => {\n const fieldErrorProps = useProps(\"FieldError\", {});\n const currentTunnelId = fieldErrorProps.tunnel?.id;\n const tunnelId =\n options.tunnelId ?? currentTunnelId ?? `${options.fieldErrorId}.fieldError`;\n\n const fieldErrorCapturePropsContext: PropsContext = {\n FieldError: {\n id: options.fieldErrorId,\n tunnel: { id: tunnelId, component: options.component },\n className: formFieldStyles.fieldError,\n },\n };\n\n const [renderedFieldErrorId, setRenderedFieldErrorId] = useState<string>();\n\n const FieldErrorCaptureContext: FC<PropsWithChildren> = useMemo(\n () => (props) => {\n return (\n <PropsContextProvider\n props={fieldErrorCapturePropsContext}\n dependencies={[tunnelId]}\n >\n {props.children}\n </PropsContextProvider>\n );\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps -- the props context is new each render and only changes with tunnelId\n [tunnelId],\n );\n\n // Keep the component identity stable: a new one per render makes React\n // remount the error on every render of the field (each keystroke).\n const FieldErrorView: FC = useMemo(\n () => () => {\n if (currentTunnelId) {\n return null;\n }\n\n return (\n <FieldErrorRenderedContext value={setRenderedFieldErrorId}>\n <UiComponentTunnelExit id={tunnelId} component={options.component}>\n {(children) => {\n const childrenArray = React.Children.toArray(children);\n return <ClearPropsContext>{childrenArray[0]}</ClearPropsContext>;\n }}\n </UiComponentTunnelExit>\n </FieldErrorRenderedContext>\n );\n },\n [currentTunnelId, tunnelId, options.component],\n );\n\n return {\n FieldErrorCaptureContext,\n FieldErrorView,\n /**\n * The id of the error while one is rendered for this field. A nested field\n * (a `Checkbox` inside a `CheckboxButton`) renders its error at the outer\n * one, so only the outer field ever gets an id here.\n */\n renderedFieldErrorId,\n } as const;\n};\n"],"mappings":";;;;;;;;;;;AAoBA,IAAa,iBAAiB,YAAkC;CAE9D,MAAM,kBADkB,SAAS,cAAc,CAAC,CACxB,CAAA,CAAgB,QAAQ;CAChD,MAAM,WACJ,QAAQ,YAAY,mBAAmB,GAAG,QAAQ,aAAa;CAEjE,MAAM,gCAA8C,EAClD,YAAY;EACV,IAAI,QAAQ;EACZ,QAAQ;GAAE,IAAI;GAAU,WAAW,QAAQ;EAAU;EACrD,WAAWA,yBAAgB;CAC7B,EACF;CAEA,MAAM,CAAC,sBAAsB,2BAA2B,SAAiB;CAuCzE,OAAO;EACL,0BAtCsD,eAC/C,UAAU;GACf,OACE,oBAAC,sBAAD;IACE,OAAO;IACP,cAAc,CAAC,QAAQ;IAEtB,UAAA,MAAM;GACa,CAAA;EAE1B,GAEA,CAAC,QAAQ,CA0BT;EACA,gBAtByB,oBACb;GACV,IAAI,iBACF,OAAO;GAGT,OACE,oBAAC,2BAAD;IAA2B,OAAO;IAChC,UAAA,oBAAC,uBAAD;KAAuB,IAAI;KAAU,WAAW,QAAQ;KACpD,WAAA,aAAa;MACb,MAAM,gBAAgB,MAAM,SAAS,QAAQ,QAAQ;MACrD,OAAO,oBAAC,mBAAD,EAAA,UAAoB,cAAc,GAAsB,CAAA;KACjE;IACqB,CAAA;GACE,CAAA;EAE/B,GACA;GAAC;GAAiB;GAAU,QAAQ;EAAS,CAK7C;;;;;;EAMA;CACF;AACF"}
1
+ {"version":3,"file":"useFieldError.mjs","names":["formFieldStyles"],"sources":["../../../../../../../src/lib/hooks/useFieldError.tsx"],"sourcesContent":["import React, {\n type FC,\n type PropsWithChildren,\n useMemo,\n useState,\n} from \"react\";\nimport {\n dynamic,\n type PropsContext,\n PropsContextProvider,\n} from \"@/lib/propsContext\";\nimport formFieldStyles from \"@/components/FormField/FormField.module.scss\";\nimport ClearPropsContext from \"@/lib/propsContext/components/ClearPropsContext\";\nimport { useProps } from \"@/lib/hooks/useProps\";\nimport { UiComponentTunnelExit } from \"@/components/UiComponentTunnel/UiComponentTunnelExit\";\nimport type { FlowComponentName } from \"@/components/propTypes\";\nimport { FieldErrorRenderedContext } from \"@/lib/hooks/fieldErrorRenderedContext\";\n\nexport interface FieldErrorViewProps {\n /** Holds a fallback error back, e.g. while the field validates on its own. */\n withoutFallback?: boolean;\n}\n\nexport interface UseFieldErrorOptions {\n fieldErrorId: string;\n tunnelId?: string;\n component: FlowComponentName;\n}\n\nexport const useFieldError = (options: UseFieldErrorOptions) => {\n const fieldErrorProps = useProps(\"FieldError\", {});\n const currentTunnelId = fieldErrorProps.tunnel?.id;\n const tunnelId =\n options.tunnelId ?? currentTunnelId ?? `${options.fieldErrorId}.fieldError`;\n const fallbackTunnelId = `${tunnelId}.fallback`;\n\n const fieldErrorCapturePropsContext: PropsContext = {\n FieldError: {\n id: options.fieldErrorId,\n tunnel: dynamic((props) => ({\n id: props.isFallback ? fallbackTunnelId : tunnelId,\n component: options.component,\n })),\n className: formFieldStyles.fieldError,\n },\n };\n\n const [renderedFieldErrorId, setRenderedFieldErrorId] = useState<string>();\n\n const FieldErrorCaptureContext: FC<PropsWithChildren> = useMemo(\n () => (props) => {\n return (\n <PropsContextProvider\n props={fieldErrorCapturePropsContext}\n dependencies={[tunnelId]}\n >\n {props.children}\n </PropsContextProvider>\n );\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps -- the props context is new each render and only changes with tunnelId\n [tunnelId],\n );\n\n // Keep the component identity stable: a new one per render makes React\n // remount the error on every render of the field (each keystroke).\n const FieldErrorView: FC<FieldErrorViewProps> = useMemo(\n () =>\n ({ withoutFallback }) => {\n if (currentTunnelId) {\n return null;\n }\n\n return (\n <FieldErrorRenderedContext value={setRenderedFieldErrorId}>\n <UiComponentTunnelExit id={tunnelId} component={options.component}>\n {(children) => {\n const childrenArray = React.Children.toArray(children);\n return (\n <UiComponentTunnelExit\n id={fallbackTunnelId}\n component={options.component}\n >\n {(fallbackChildren) => {\n const fallbackChildrenArray =\n React.Children.toArray(fallbackChildren);\n return (\n <ClearPropsContext>\n {childrenArray[0] ??\n (withoutFallback ? null : fallbackChildrenArray[0])}\n </ClearPropsContext>\n );\n }}\n </UiComponentTunnelExit>\n );\n }}\n </UiComponentTunnelExit>\n </FieldErrorRenderedContext>\n );\n },\n [currentTunnelId, fallbackTunnelId, tunnelId, options.component],\n );\n\n return {\n FieldErrorCaptureContext,\n FieldErrorView,\n /**\n * The id of the error while one is rendered for this field. A nested field\n * (a `Checkbox` inside a `CheckboxButton`) renders its error at the outer\n * one, so only the outer field ever gets an id here.\n */\n renderedFieldErrorId,\n } as const;\n};\n"],"mappings":";;;;;;;;;;;;AA6BA,IAAa,iBAAiB,YAAkC;CAE9D,MAAM,kBADkB,SAAS,cAAc,CAAC,CACxB,CAAA,CAAgB,QAAQ;CAChD,MAAM,WACJ,QAAQ,YAAY,mBAAmB,GAAG,QAAQ,aAAa;CACjE,MAAM,mBAAmB,GAAG,SAAS;CAErC,MAAM,gCAA8C,EAClD,YAAY;EACV,IAAI,QAAQ;EACZ,QAAQ,SAAS,WAAW;GAC1B,IAAI,MAAM,aAAa,mBAAmB;GAC1C,WAAW,QAAQ;EACrB,EAAE;EACF,WAAWA,yBAAgB;CAC7B,EACF;CAEA,MAAM,CAAC,sBAAsB,2BAA2B,SAAiB;CAwDzE,OAAO;EACL,0BAvDsD,eAC/C,UAAU;GACf,OACE,oBAAC,sBAAD;IACE,OAAO;IACP,cAAc,CAAC,QAAQ;IAEtB,UAAA,MAAM;GACa,CAAA;EAE1B,GAEA,CAAC,QAAQ,CA2CT;EACA,gBAvC8C,eAE3C,EAAE,sBAAsB;GACvB,IAAI,iBACF,OAAO;GAGT,OACE,oBAAC,2BAAD;IAA2B,OAAO;IAChC,UAAA,oBAAC,uBAAD;KAAuB,IAAI;KAAU,WAAW,QAAQ;KACpD,WAAA,aAAa;MACb,MAAM,gBAAgB,MAAM,SAAS,QAAQ,QAAQ;MACrD,OACE,oBAAC,uBAAD;OACE,IAAI;OACJ,WAAW,QAAQ;OAEjB,WAAA,qBAAqB;QACrB,MAAM,wBACJ,MAAM,SAAS,QAAQ,gBAAgB;QACzC,OACE,oBAAC,mBAAD,EAAA,UACG,cAAc,OACZ,kBAAkB,OAAO,sBAAsB,IACjC,CAAA;OAEvB;MACqB,CAAA;KAE3B;IACqB,CAAA;GACE,CAAA;EAE/B,GACF;GAAC;GAAiB;GAAkB;GAAU,QAAQ;EAAS,CAK/D;;;;;;EAMA;CACF;AACF"}
@@ -1,11 +1,12 @@
1
- import { ComponentProps, CSSProperties, FC, PropsWithChildren } from 'react';
1
+ import { ComponentProps, CSSProperties, PropsWithChildren } from 'react';
2
2
  import { AlphaColor } from '../../lib/types/props';
3
- export interface InlineCodeProps extends PropsWithChildren<ComponentProps<"code">> {
3
+ import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
4
+ export interface InlineCodeProps extends PropsWithChildren<ComponentProps<"code">>, FlowComponentProps<HTMLElement> {
4
5
  /** The color schema of the inline code component. @default "default" */
5
6
  color?: "default" | AlphaColor;
6
7
  /** The white-space property of the inline code component. @default undefined */
7
8
  whiteSpace?: CSSProperties["whiteSpace"];
8
9
  }
9
10
  /** @flr-generate all */
10
- export declare const InlineCode: FC<InlineCodeProps>;
11
+ export declare const InlineCode: import('react').FunctionComponent<InlineCodeProps & import('react').RefAttributes<HTMLElement>>;
11
12
  export default InlineCode;
@@ -21,6 +21,7 @@ import { AlertBadgeProps } from '../AlertBadge';
21
21
  import { AlertIconProps } from '../AlertIcon';
22
22
  import { ActionGroupProps } from '../ActionGroup';
23
23
  import { AvatarProps } from '../Avatar';
24
+ import { InlineCodeProps } from '../InlineCode';
24
25
  import { BigNumberProps } from '../BigNumber';
25
26
  import { ActionProps } from '../Action';
26
27
  import { ContextMenuProps, ContextMenuTriggerProps, MenuItemProps } from '../ContextMenu';
@@ -135,6 +136,7 @@ export interface FlowComponentPropsTypes {
135
136
  IllustratedMessage: IllustratedMessageProps;
136
137
  Image: ImageProps;
137
138
  Initials: InitialsProps;
139
+ InlineCode: InlineCodeProps;
138
140
  Label: LabelProps;
139
141
  LayoutCard: LayoutCardProps;
140
142
  LightBox: LightBoxProps;
@@ -1,5 +1,6 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
2
  import { PropsContext } from '../propsContext';
3
+ import { FieldErrorViewProps } from './useFieldError';
3
4
  import { ClassValue } from 'clsx';
4
5
  import { FlowComponentName } from '../../components/propTypes';
5
6
  interface FieldComponentProps {
@@ -10,7 +11,7 @@ interface FieldComponentProps {
10
11
  }
11
12
  export interface UseFieldComponent {
12
13
  FieldErrorCaptureContext: FC<PropsWithChildren>;
13
- FieldErrorView: FC;
14
+ FieldErrorView: FC<FieldErrorViewProps>;
14
15
  fieldPropsContext: PropsContext;
15
16
  /** For the field's outer element. */
16
17
  wrapperProps: {
@@ -1,5 +1,9 @@
1
1
  import { default as React } from 'react';
2
2
  import { FlowComponentName } from '../../components/propTypes';
3
+ export interface FieldErrorViewProps {
4
+ /** Holds a fallback error back, e.g. while the field validates on its own. */
5
+ withoutFallback?: boolean;
6
+ }
3
7
  export interface UseFieldErrorOptions {
4
8
  fieldErrorId: string;
5
9
  tunnelId?: string;
@@ -9,7 +13,7 @@ export declare const useFieldError: (options: UseFieldErrorOptions) => {
9
13
  readonly FieldErrorCaptureContext: React.FC<{
10
14
  children?: React.ReactNode | undefined;
11
15
  }>;
12
- readonly FieldErrorView: React.FC;
16
+ readonly FieldErrorView: React.FC<FieldErrorViewProps>;
13
17
  /**
14
18
  * The id of the error while one is rendered for this field. A nested field
15
19
  * (a `Checkbox` inside a `CheckboxButton`) renders its error at the outer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://flow.mittwald.de",
@@ -84,9 +84,9 @@
84
84
  "@internationalized/string-compiler": "^3.4.1",
85
85
  "@lezer/common": "^1.5.2",
86
86
  "@lezer/highlight": "^1.2.3",
87
- "@mittwald/flow-icons": "^1.6.0",
87
+ "@mittwald/flow-icons": "^1.6.1",
88
88
  "@mittwald/password-tools-js": "^3.0.0",
89
- "@mittwald/react-tunnel": "^1.6.0",
89
+ "@mittwald/react-tunnel": "^1.6.1",
90
90
  "@mittwald/react-use-promise": "^4.2.2",
91
91
  "@react-aria/form": "^3.2.1",
92
92
  "@react-aria/i18n": "^3.13.1",
@@ -139,13 +139,13 @@
139
139
  "@internationalized/date": "^3.12.3",
140
140
  "@lezer/generator": "^1.8.0",
141
141
  "@lezer/lr": "^1.4.10",
142
- "@mittwald/flow-components-base": "1.6.0",
143
- "@mittwald/flow-core": "1.6.0",
144
- "@mittwald/flow-design-tokens": "1.6.0",
145
- "@mittwald/flow-icons-base": "1.6.0",
142
+ "@mittwald/flow-components-base": "1.6.1",
143
+ "@mittwald/flow-core": "1.6.1",
144
+ "@mittwald/flow-design-tokens": "1.6.1",
145
+ "@mittwald/flow-icons-base": "1.6.1",
146
146
  "@mittwald/react-use-promise": "^4.2.2",
147
147
  "@mittwald/remote-dom-react": "1.2.2-mittwald.10",
148
- "@mittwald/typescript-config": "1.6.0",
148
+ "@mittwald/typescript-config": "1.6.1",
149
149
  "@nx/storybook": "^22.7.6",
150
150
  "@storybook/addon-a11y": "^10.5.10",
151
151
  "@storybook/addon-actions": "^9.0.8",
@@ -199,7 +199,7 @@
199
199
  },
200
200
  "peerDependencies": {
201
201
  "@internationalized/date": "^3.12.2",
202
- "@mittwald/flow-icons-pro": "1.6.0",
202
+ "@mittwald/flow-icons-pro": "1.6.1",
203
203
  "@mittwald/react-use-promise": "^4.2.2",
204
204
  "next": "^16.2.3",
205
205
  "react": "^19.2.0",
@@ -223,5 +223,5 @@
223
223
  "browserslist": [
224
224
  "baseline widely available"
225
225
  ],
226
- "gitHead": "44a8962b7f7009c33fd954b837da37148a28ae2f"
226
+ "gitHead": "cc99fc8032c21d61142010074cc51745d3600efd"
227
227
  }