@mittwald/flow-react-components 0.2.0-alpha.356 → 0.2.0-alpha.357

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 (21) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/assets/doc-properties.json +1929 -1929
  3. package/dist/js/components/src/components/PasswordCreationField/lib/generatePasswordCreationFieldValidation.mjs +18 -0
  4. package/dist/js/components/src/components/PasswordCreationField/lib/generatePasswordCreationFieldValidation.mjs.map +1 -0
  5. package/dist/js/components/src/integrations/react-hook-form/components/ActionGroupWrapper/SubmitButtonStateProvider.mjs +7 -1
  6. package/dist/js/components/src/integrations/react-hook-form/components/ActionGroupWrapper/SubmitButtonStateProvider.mjs.map +1 -1
  7. package/dist/js/components/src/integrations/react-hook-form/components/Field/Field.mjs +1 -12
  8. package/dist/js/components/src/integrations/react-hook-form/components/Field/Field.mjs.map +1 -1
  9. package/dist/js/default.mjs +1 -0
  10. package/dist/js/default.mjs.map +1 -1
  11. package/dist/js/flr-universal.mjs +1 -0
  12. package/dist/js/flr-universal.mjs.map +1 -1
  13. package/dist/types/components/PasswordCreationField/index.d.ts +1 -0
  14. package/dist/types/components/PasswordCreationField/index.d.ts.map +1 -1
  15. package/dist/types/components/PasswordCreationField/lib/generatePasswordCreationFieldValidation.d.ts +3 -0
  16. package/dist/types/components/PasswordCreationField/lib/generatePasswordCreationFieldValidation.d.ts.map +1 -0
  17. package/dist/types/components/PasswordCreationField/stories/Default.stories.d.ts.map +1 -1
  18. package/dist/types/integrations/react-hook-form/components/ActionGroupWrapper/SubmitButtonStateProvider.d.ts +2 -2
  19. package/dist/types/integrations/react-hook-form/components/ActionGroupWrapper/SubmitButtonStateProvider.d.ts.map +1 -1
  20. package/dist/types/integrations/react-hook-form/components/Field/Field.d.ts.map +1 -1
  21. package/package.json +4 -4
@@ -0,0 +1,18 @@
1
+ "use client"
2
+ /* */
3
+ import { defaultPasswordCreationPolicy } from '../defaultPasswordCreationPolicy.mjs';
4
+ import { isPromise } from 'remeda';
5
+
6
+ const generatePasswordCreationFieldValidation = (validationPolicy = defaultPasswordCreationPolicy) => async (value) => {
7
+ if (!value) {
8
+ return true;
9
+ }
10
+ const validationResult = validationPolicy.validate(value);
11
+ if (isPromise(validationResult.isValid)) {
12
+ return await validationResult.isValid;
13
+ }
14
+ return validationResult.isValid;
15
+ };
16
+
17
+ export { generatePasswordCreationFieldValidation };
18
+ //# sourceMappingURL=generatePasswordCreationFieldValidation.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatePasswordCreationFieldValidation.mjs","sources":["../../../../../../../src/components/PasswordCreationField/lib/generatePasswordCreationFieldValidation.ts"],"sourcesContent":["import type { Policy } from \"@mittwald/password-tools-js/policy\";\nimport { defaultPasswordCreationPolicy } from \"@/components/PasswordCreationField/defaultPasswordCreationPolicy\";\nimport { isPromise } from \"remeda\";\n\nexport const generatePasswordCreationFieldValidation =\n (validationPolicy: Policy = defaultPasswordCreationPolicy) =>\n async (value: string) => {\n if (!value) {\n return true;\n }\n\n const validationResult = validationPolicy.validate(value);\n\n if (isPromise(validationResult.isValid)) {\n return await validationResult.isValid;\n }\n\n return validationResult.isValid;\n };\n"],"names":[],"mappings":";;;AAIO,MAAM,uCACX,GAAA,CAAC,gBAA2B,GAAA,6BAAA,KAC5B,OAAO,KAAkB,KAAA;AACvB,EAAA,IAAI,CAAC,KAAO,EAAA;AACV,IAAO,OAAA,IAAA;AAAA;AAGT,EAAM,MAAA,gBAAA,GAAmB,gBAAiB,CAAA,QAAA,CAAS,KAAK,CAAA;AAExD,EAAI,IAAA,SAAA,CAAU,gBAAiB,CAAA,OAAO,CAAG,EAAA;AACvC,IAAA,OAAO,MAAM,gBAAiB,CAAA,OAAA;AAAA;AAGhC,EAAA,OAAO,gBAAiB,CAAA,OAAA;AAC1B;;;;"}
@@ -18,7 +18,13 @@ const ActionStateContextWrapper = (props) => {
18
18
  );
19
19
  setHasSucceeded(isSubmitted && isSubmitSuccessful);
20
20
  setIsStarted(isSubmitting && isAsyncSubmit.current);
21
- }, [form.formState, isAsyncSubmit.current]);
21
+ }, [
22
+ form.formState.isSubmitted,
23
+ form.formState.isSubmitting,
24
+ form.formState.isSubmitSuccessful,
25
+ form.formState.errors,
26
+ isAsyncSubmit.current
27
+ ]);
22
28
  return /* @__PURE__ */ jsx(
23
29
  ActionStateContext,
24
30
  {
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitButtonStateProvider.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/ActionGroupWrapper/SubmitButtonStateProvider.tsx"],"sourcesContent":["import type { FC, MutableRefObject, PropsWithChildren } from \"react\";\nimport { useEffect, useState } from \"react\";\nimport { ActionStateContext } from \"@/components/Action/ActionStateContext\";\nimport { useFormContext } from \"@/integrations/react-hook-form/components/context/formContext\";\n\ninterface Props extends PropsWithChildren {\n isAsyncSubmit: MutableRefObject<boolean>;\n}\n\nconst ActionStateContextWrapper: FC<Props> = (props) => {\n const { children, isAsyncSubmit } = props;\n\n const form = useFormContext().form;\n\n const [submitErrors, setSubmitErrors] = useState<unknown>(undefined);\n const [hasSucceeded, setHasSucceeded] = useState(false);\n const [isStarted, setIsStarted] = useState(false);\n\n useEffect(() => {\n /**\n * The mapping into sepearte states inside this effect is required, because\n * otherwise the reset() function of RHF does not work as expected\n * (subsequent resets not working, default values are not correctly re-used,\n * ...).\n *\n * A side note: This only happens if 'isSubmitted' and/or 'isSubmitting' are\n * extracted from the form state.\n */\n const { isSubmitted, isSubmitting, isSubmitSuccessful, errors } =\n form.formState;\n\n setSubmitErrors(\n isSubmitted && errors && Object.entries(errors).length > 0\n ? errors\n : undefined,\n );\n setHasSucceeded(isSubmitted && isSubmitSuccessful);\n setIsStarted(isSubmitting && isAsyncSubmit.current);\n }, [form.formState, isAsyncSubmit.current]);\n\n return (\n <ActionStateContext\n isStarted={isStarted}\n hasFailedWithError={submitErrors}\n hasSucceeded={hasSucceeded}\n >\n {children}\n </ActionStateContext>\n );\n};\n\nexport const SubmitButtonStateProvider: FC<Props> = (props) => {\n const { children, isAsyncSubmit } = props;\n\n return (\n <ActionStateContextWrapper isAsyncSubmit={isAsyncSubmit}>\n {children}\n </ActionStateContextWrapper>\n );\n};\n"],"names":[],"mappings":";;;;;AASA,MAAM,yBAAA,GAAuC,CAAC,KAAU,KAAA;AACtD,EAAM,MAAA,EAAE,QAAU,EAAA,aAAA,EAAkB,GAAA,KAAA;AAEpC,EAAM,MAAA,IAAA,GAAO,gBAAiB,CAAA,IAAA;AAE9B,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAkB,MAAS,CAAA;AACnE,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAS,KAAK,CAAA;AACtD,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA;AAEhD,EAAA,SAAA,CAAU,MAAM;AAUd,IAAA,MAAM,EAAE,WAAa,EAAA,YAAA,EAAc,kBAAoB,EAAA,MAAA,KACrD,IAAK,CAAA,SAAA;AAEP,IAAA,eAAA;AAAA,MACE,WAAA,IAAe,UAAU,MAAO,CAAA,OAAA,CAAQ,MAAM,CAAE,CAAA,MAAA,GAAS,IACrD,MACA,GAAA;AAAA,KACN;AACA,IAAA,eAAA,CAAgB,eAAe,kBAAkB,CAAA;AACjD,IAAa,YAAA,CAAA,YAAA,IAAgB,cAAc,OAAO,CAAA;AAAA,KACjD,CAAC,IAAA,CAAK,SAAW,EAAA,aAAA,CAAc,OAAO,CAAC,CAAA;AAE1C,EACE,uBAAA,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,SAAA;AAAA,MACA,kBAAoB,EAAA,YAAA;AAAA,MACpB,YAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAA;AAEa,MAAA,yBAAA,GAAuC,CAAC,KAAU,KAAA;AAC7D,EAAM,MAAA,EAAE,QAAU,EAAA,aAAA,EAAkB,GAAA,KAAA;AAEpC,EACE,uBAAA,GAAA,CAAC,yBAA0B,EAAA,EAAA,aAAA,EACxB,QACH,EAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"SubmitButtonStateProvider.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/ActionGroupWrapper/SubmitButtonStateProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, RefObject } from \"react\";\nimport { useEffect, useState } from \"react\";\nimport { ActionStateContext } from \"@/components/Action/ActionStateContext\";\nimport { useFormContext } from \"@/integrations/react-hook-form/components/context/formContext\";\n\ninterface Props extends PropsWithChildren {\n isAsyncSubmit: RefObject<boolean>;\n}\n\nconst ActionStateContextWrapper: FC<Props> = (props) => {\n const { children, isAsyncSubmit } = props;\n\n const form = useFormContext().form;\n\n const [submitErrors, setSubmitErrors] = useState<unknown>(undefined);\n const [hasSucceeded, setHasSucceeded] = useState(false);\n const [isStarted, setIsStarted] = useState(false);\n\n useEffect(() => {\n /**\n * The mapping into sepearte states inside this effect is required, because\n * otherwise the reset() function of RHF does not work as expected\n * (subsequent resets not working, default values are not correctly re-used,\n * ...).\n *\n * A side note: This only happens if 'isSubmitted' and/or 'isSubmitting' are\n * extracted from the form state.\n */\n const { isSubmitted, isSubmitting, isSubmitSuccessful, errors } =\n form.formState;\n\n setSubmitErrors(\n isSubmitted && errors && Object.entries(errors).length > 0\n ? errors\n : undefined,\n );\n setHasSucceeded(isSubmitted && isSubmitSuccessful);\n setIsStarted(isSubmitting && isAsyncSubmit.current);\n }, [\n form.formState.isSubmitted,\n form.formState.isSubmitting,\n form.formState.isSubmitSuccessful,\n form.formState.errors,\n isAsyncSubmit.current,\n ]);\n\n return (\n <ActionStateContext\n isStarted={isStarted}\n hasFailedWithError={submitErrors}\n hasSucceeded={hasSucceeded}\n >\n {children}\n </ActionStateContext>\n );\n};\n\nexport const SubmitButtonStateProvider: FC<Props> = (props) => {\n const { children, isAsyncSubmit } = props;\n\n return (\n <ActionStateContextWrapper isA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AAE,QAAU,EAAA,aAAA,EAAkB,GAAA,KAAA;AAEpC,EACE,uBAAA,GAAA,CAAC,yBAA0B,EAAA,EAAA,aAAA,EACxB,QACH,EAAA,CAAA;AAEJ;;;;"}
@@ -56,18 +56,7 @@ function Field(props) {
56
56
  isSelected: value
57
57
  },
58
58
  Slider: fieldProps,
59
- PasswordCreationField: {
60
- ...fieldProps,
61
- onValidationResult: ({ isValid }) => {
62
- if (isValid) {
63
- formContext.form.clearErrors(name);
64
- } else {
65
- formContext.form.setError(name, {
66
- message: "displayedByCreationField"
67
- });
68
- }
69
- }
70
- },
59
+ PasswordCreationField: fieldProps,
71
60
  DatePicker: fieldProps,
72
61
  DateRangePicker: fieldProps,
73
62
  TimeField: fieldProps,
@@ -1 +1 @@
1
- {"version":3,"file":"Field.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import { useFormContext } from \"@/integrations/react-hook-form/components/context/formContext\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithChildren } from \"react\";\nimport {\n useController,\n type ControllerProps,\n type FieldValues,\n type UseFormReturn,\n} from \"react-hook-form\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\n\nexport interface FieldProps<T extends FieldValues>\n extends Omit<ControllerProps<T>, \"render\">,\n PropsWithChildren {}\n\nexport function Field<T extends FieldValues>(props: FieldProps<T>) {\n const { children, name, defaultValue, ...rest } = props;\n\n const controller = useController(props);\n const formContext = useFormContext<T>();\n const value = controller.field.value;\n\n const fieldProps = {\n ...controller.field,\n name,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n validationBehavior: \"aria\" as const,\n defaultValue,\n isInvalid: controller.fieldState.invalid,\n children: dynamic((p) => {\n if (controller.fieldState.invalid) {\n return (\n <>\n {p.children}\n <FieldErrorView>\n {controller.fieldState.error?.message}\n </FieldErrorView>\n </>\n );\n }\n\n return p.children;\n }),\n };\n\n const { value: ignoredValue, ...fieldPropsWithoutValue } = fieldProps;\n\n const propsContext: PropsContext = {\n SearchField: fieldProps,\n TextField: fieldProps,\n TextArea: fieldProps,\n\n Checkbox: {\n ...fieldProps,\n isSelected: value,\n },\n CheckboxGroup: fieldProps,\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: {\n ...fieldProps,\n onValidationResult: ({ isValid }) => {\n if (isValid) {\n formContext.form.clearErrors(name);\n } else {\n formContext.form.setError(name, {\n message: \"displayedByCreationField\",\n });\n }\n },\n },\n DatePicker: fieldProps,\n DateRangePicker: fieldProps,\n TimeField: fieldProps,\n SegmentedControl: fieldProps,\n Select: {\n ...fieldProps,\n selectedKey: value,\n },\n ComboBox: {\n ...fieldPropsWithoutValue,\n selectedKey: value,\n },\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[controller.fieldState, controller.field, value]}\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"],"names":[],"mappings":";;;;;;;;;;AAgBO,SAAS,MAA6B,KAAsB,EAAA;AACjE,EAAA,MAAM,EAAE,QAAU,EAAA,IAAA,EAAM,YAAc,EAAA,GAAG,MAAS,GAAA,KAAA;AAElD,EAAM,MAAA,UAAA,GAAa,cAAc,KAAK,CAAA;AACtC,EAAA,MAAM,cAAc,cAAkB,EAAA;AACtC,EAAM,MAAA,KAAA,GAAQ,WAAW,KAAM,CAAA,KAAA;AAE/B,EAAA,MAAM,UAAa,GAAA;AAAA,IACjB,GAAG,UAAW,CAAA,KAAA;AAAA,IACd,IAAA;AAAA,IACA,MAAM,WAAY,CAAA,EAAA;AAAA,IAClB,UAAY,EAA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KAAA;AACnC,QAAA,IAAI,OAAS,EAAA;AACX,UAAY,WAAA,CAAA,IAAA,CAAK,YAAY,IAAI,CAAA;AAAA,SAC5B,MAAA;AACL,UAAY,WAAA,CAAA,IAAA,CAAK,SAAS,IAAM,EAAA;AAAA,YAC9B,OAAS,EAAA;AAAA,WACV,CAAA;AAAA;AACH;AACF,KACF;AAAA,IACA,UAAY,EAAA,UAAA;AAAA,IACZ,eAAiB,EAAA,UAAA;AAAA,IACjB,SAAW,EAAA,UAAA;AAAA,IACX,gBAAkB,EAAA,UAAA;AAAA,IAClB,MAAQ,EAAA;AAAA,MACN,GAAG,UAAA;AAAA,MACH,WAAa,EAAA;AAAA,KACf;AAAA,IACA,QAAU,EAAA;AAAA,MACR,GAAG,sBAAA;AAAA,MACH,WAAa,EAAA;AAAA;AACf,GACF;AAEA,EACE,uBAAA,GAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,YAAA;AAAA,MACP,cAAc,CAAC,UAAA,CAAW,UAAY,EAAA,UAAA,CAAW,OAAO,KAAK,CAAA;AAAA,MAE5D;AAAA;AAAA,GACH;AAEJ;AAEa,MAAA,UAAA,GAAa,CACxB,WACoB,KAAA;;;;"}
1
+ {"version":3,"file":"Field.mjs","sources":["../../../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import { useFormContext } from \"@/integrations/react-hook-form/components/context/formContext\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport type { PropsWithChildren } from \"react\";\nimport {\n useController,\n type ControllerProps,\n type FieldValues,\n type UseFormReturn,\n} from \"react-hook-form\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\n\nexport interface FieldProps<T extends FieldValues>\n extends Omit<ControllerProps<T>, \"render\">,\n PropsWithChildren {}\n\nexport function Field<T extends FieldValues>(props: FieldProps<T>) {\n const { children, name, defaultValue, ...rest } = props;\n\n const controller = useController(props);\n const formContext = useFormContext<T>();\n const value = controller.field.value;\n\n const fieldProps = {\n ...controller.field,\n name,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n validationBehavior: \"aria\" as const,\n defaultValue,\n isInvalid: controller.fieldState.invalid,\n children: dynamic((p) => {\n if (controller.fieldState.invalid) {\n return (\n <>\n {p.children}\n <FieldErrorView>\n {controller.fieldState.error?.message}\n </FieldErrorView>\n </>\n );\n }\n\n return p.children;\n }),\n };\n\n const { value: ignoredValue, ...fieldPropsWithoutValue } = fieldProps;\n\n const propsContext: PropsContext = {\n SearchField: fieldProps,\n TextField: fieldProps,\n TextArea: fieldProps,\n\n Checkbox: {\n ...fieldProps,\n isSelected: value,\n },\n CheckboxGroup: fieldProps,\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 ...fieldPropsWithoutValue,\n selectedKey: value,\n },\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[controller.fieldState, controller.field, value]}\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"],"names":[],"mappings":";;;;;;;;;;AAgBO,SAAS,MAA6B,KAAsB,EAAA;AACjE,EAAA,MAAM,EAAE,QAAU,EAAA,IAAA,EAAM,YAAc,EAAA,GAAG,MAAS,GAAA,KAAA;AAElD,EAAM,MAAA,UAAA,GAAa,cAAc,KAAK,CAAA;AACtC,EAAA,MAAM,cAAc,cAAkB,EAAA;AACtC,EAAM,MAAA,KAAA,G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G,UAAA;AAAA,MACH,UAAY,EAAA;AAAA,KACd;AAAA,IACA,MAAQ,EAAA,UAAA;AAAA,IACR,qBAAuB,EAAA,UAAA;AAAA,IACvB,UAAY,EAAA,UAAA;AAAA,IACZ,eAAiB,EAAA,UAAA;AAAA,IACjB,SAAW,EAAA,UAAA;AAAA,IACX,gBAAkB,EAAA,UAAA;AAAA,IAClB,MAAQ,EAAA;AAAA,MACN,GAAG,UAAA;AAAA,MACH,WAAa,EAAA;AAAA,KACf;AAAA,IACA,QAAU,EAAA;AAAA,MACR,GAAG,sBAAA;AAAA,MACH,WAAa,EAAA;AAAA;AACf,GACF;AAEA,EACE,uBAAA,GAAA;AAAA,IAAC,oBAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,YAAA;AAAA,MACP,cAAc,CAAC,UAAA,CAAW,UAAY,EAAA,UAAA,CAAW,OAAO,KAAK,CAAA;AAAA,MAE5D;AAAA;AAAA,GACH;AAEJ;AAEa,MAAA,UAAA,GAAa,CACxB,WACoB,KAAA;;;;"}
@@ -212,6 +212,7 @@ export { OverlayContent } from './components/src/components/Overlay/components/O
212
212
  export { DialogTrigger } from './components/src/components/OverlayTrigger/components/DialogTrigger/DialogTrigger.mjs';
213
213
  export { MenuTrigger } from './components/src/components/OverlayTrigger/components/MenuTrigger/MenuTrigger.mjs';
214
214
  export { OverlayTrigger } from './components/src/components/OverlayTrigger/OverlayTrigger.mjs';
215
+ export { generatePasswordCreationFieldValidation } from './components/src/components/PasswordCreationField/lib/generatePasswordCreationFieldValidation.mjs';
215
216
  export { PasswordCreationField } from './components/src/components/PasswordCreationField/PasswordCreationField.mjs';
216
217
  export { PopoverTrigger } from './components/src/components/Popover/components/PopoverTrigger/PopoverTrigger.mjs';
217
218
  export { PopoverContent } from './components/src/components/Popover/components/PopoverContent/PopoverContent.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"default.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"default.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -194,6 +194,7 @@ export { OverlayController } from './components/src/lib/controller/overlay/Overl
194
194
  export { useOverlayController } from './components/src/lib/controller/overlay/useOverlayController.mjs';
195
195
  import './components/src/lib/controller/overlay/context.mjs';
196
196
  import './components/src/components/OverlayTrigger/components/MenuTrigger/MenuTrigger.mjs';
197
+ import './components/src/components/PasswordCreationField/defaultPasswordCreationPolicy.mjs';
197
198
  import './components/src/components/PasswordCreationField/PasswordCreationField.mjs';
198
199
  export { PopoverTrigger } from './components/src/components/Popover/components/PopoverTrigger/PopoverTrigger.mjs';
199
200
  export { Popover } from './components/src/components/Popover/Popover.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"flr-universal.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"flr-universal.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ export * from './lib/generatePasswordCreationFieldValidation';
1
2
  export * from './view';
2
3
  export { type PasswordCreationFieldProps, PasswordCreationField, } from './PasswordCreationField';
3
4
  export { default } from './PasswordCreationField';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/PasswordCreationField/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AAEvB,OAAO,EACL,KAAK,0BAA0B,EAC/B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/PasswordCreationField/index.ts"],"names":[],"mappings":"AAAA,cAAc,gFAAgF,CAAC;AAC/F,cAAc,QAAQ,CAAC;AAEvB,OAAO,EACL,KAAK,0BAA0B,EAC/B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Policy } from '@mittwald/password-tools-js/policy';
2
+ export declare const generatePasswordCreationFieldValidation: (validationPolicy?: Policy) => (value: string) => Promise<boolean>;
3
+ //# sourceMappingURL=generatePasswordCreationFieldValidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generatePasswordCreationFieldValidation.d.ts","sourceRoot":"","sources":["../../../../../src/components/PasswordCreationField/lib/generatePasswordCreationFieldValidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAIjE,eAAO,MAAM,uCAAuC,GACjD,mBAAkB,MAAsC,MAClD,OAAO,MAAM,qBAYnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Default.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/PasswordCreationField/stories/Default.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAyDjD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,qBAAqB,CAoB5C,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpD,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAAsC,CAAC;AAE9D,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAW/B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KA4BtB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAW5B,CAAC"}
1
+ {"version":3,"file":"Default.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/PasswordCreationField/stories/Default.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAEL,qBAAqB,EACtB,MAAM,UAAU,CAAC;AAyDlB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,qBAAqB,CAoB5C,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpD,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAAsC,CAAC;AAE9D,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAW/B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAmCtB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAW5B,CAAC"}
@@ -1,6 +1,6 @@
1
- import { FC, MutableRefObject, PropsWithChildren } from 'react';
1
+ import { FC, PropsWithChildren, RefObject } from 'react';
2
2
  interface Props extends PropsWithChildren {
3
- isAsyncSubmit: MutableRefObject<boolean>;
3
+ isAsyncSubmit: RefObject<boolean>;
4
4
  }
5
5
  export declare const SubmitButtonStateProvider: FC<Props>;
6
6
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitButtonStateProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/ActionGroupWrapper/SubmitButtonStateProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKrE,UAAU,KAAM,SAAQ,iBAAiB;IACvC,aAAa,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;CAC1C;AA4CD,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,KAAK,CAQ/C,CAAC"}
1
+ {"version":3,"file":"SubmitButtonStateProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/ActionGroupWrapper/SubmitButtonStateProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAK9D,UAAU,KAAM,SAAQ,iBAAiB;IACvC,aAAa,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CACnC;AAkDD,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,KAAK,CAQ/C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,WAAW,CAC/C,SAAQ,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EACxC,iBAAiB;CAAG;AAExB,wBAAgB,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,2CA0FhE;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,WAAW,EAC9C,aAAa,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAC1D,OAAO,KAAK,CAAC,CAAC,CAAU,CAAC;AAE5B,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AAGzB,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,WAAW,CAC/C,SAAQ,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EACxC,iBAAiB;CAAG;AAExB,wBAAgB,KAAK,CAAC,CAAC,SAAS,WAAW,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,2CA+EhE;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,WAAW,EAC9C,aAAa,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAC1D,OAAO,KAAK,CAAC,CAAC,CAAU,CAAC;AAE5B,eAAe,KAAK,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.2.0-alpha.356",
3
+ "version": "0.2.0-alpha.357",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -58,7 +58,7 @@
58
58
  "@chakra-ui/live-region": "^2.1.0",
59
59
  "@internationalized/string-compiler": "^3.2.6",
60
60
  "@mittwald/password-tools-js": "^2.1.6",
61
- "@mittwald/react-tunnel": "0.2.0-alpha.356",
61
+ "@mittwald/react-tunnel": "0.2.0-alpha.357",
62
62
  "@mittwald/react-use-promise": "^3.0.4",
63
63
  "@react-aria/form": "^3.0.18",
64
64
  "@react-aria/utils": "^3.29.1",
@@ -99,7 +99,7 @@
99
99
  "@faker-js/faker": "^9.9.0",
100
100
  "@internationalized/date": "^3.8.2",
101
101
  "@mittwald/flow-core": "",
102
- "@mittwald/flow-design-tokens": "0.2.0-alpha.356",
102
+ "@mittwald/flow-design-tokens": "0.2.0-alpha.357",
103
103
  "@mittwald/react-use-promise": "^3.0.4",
104
104
  "@mittwald/remote-dom-react": "1.2.2-mittwald.3",
105
105
  "@mittwald/typescript-config": "",
@@ -172,5 +172,5 @@
172
172
  "optional": true
173
173
  }
174
174
  },
175
- "gitHead": "378b3156a96cd1ae6896c70dbfb4ed9073dd5eab"
175
+ "gitHead": "4ba205bb5adab5c157c0e8c8b2b45f6a8d213d38"
176
176
  }