@mittwald/flow-react-components 0.2.0-alpha.514 → 0.2.0-alpha.516

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.
@@ -15,7 +15,7 @@ import { useObjectRef } from '@react-aria/utils';
15
15
  import { useMakeFocusable } from '../../lib/hooks/dom/useMakeFocusable.mjs';
16
16
 
17
17
  const CheckboxGroup = flowComponent("CheckboxGroup", (props) => {
18
- const { children, className, s, m, l, ref, value, ...rest } = props;
18
+ const { children, className, s, m, l, ref, ...rest } = props;
19
19
  const rootClassName = clsx(formFieldStyles.formField, className);
20
20
  const propsContext = {
21
21
  Label: {
@@ -46,9 +46,8 @@ const CheckboxGroup = flowComponent("CheckboxGroup", (props) => {
46
46
  ...rest,
47
47
  className: rootClassName,
48
48
  ref: localCheckboxGroupRef,
49
- value: Array.isArray(value) ? value : void 0,
50
49
  children: [
51
- /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, children: /* @__PURE__ */ jsxs(TunnelProvider, { children: [
50
+ /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, clear: true, children: /* @__PURE__ */ jsxs(TunnelProvider, { children: [
52
51
  children,
53
52
  /* @__PURE__ */ jsx(ColumnLayout, { s, m, l, className: styles.checkboxGroup, children: /* @__PURE__ */ jsx(TunnelExit, { id: "checkboxButtons" }) }),
54
53
  /* @__PURE__ */ jsx(
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxGroup.mjs","sources":["../../../../../../src/components/CheckboxGroup/CheckboxGroup.tsx"],"sourcesContent":["import type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\nimport { ColumnLayout } from \"@/components/ColumnLayout\";\nimport { FieldError } from \"@/components/FieldError\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport clsx from \"clsx\";\nimport type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport formFieldStyles from \"../FormField/FormField.module.scss\";\nimport styles from \"./CheckboxGroup.module.scss\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\n\nexport interface CheckboxGroupProps\n extends PropsWithChildren<Omit<Aria.CheckboxGroupProps, \"children\">>,\n Pick<ColumnLayoutProps, \"s\" | \"m\" | \"l\">,\n FlowComponentProps {}\n\n/** @flr-generate all */\nexport const CheckboxGroup = flowComponent(\"CheckboxGroup\", (props) => {\n const { children, className, s, m, l, ref, value, ...rest } = props;\n\n const rootClassName = clsx(formFieldStyles.formField, className);\n\n const propsContext: PropsContext = {\n Label: {\n className: formFieldStyles.label,\n },\n FieldDescription: {\n className: formFieldStyles.fieldDescription,\n tunnelId: \"fieldDescription\",\n },\n FieldError: {\n className: formFieldStyles.customFieldError,\n tunnelId: \"fieldError\",\n },\n Checkbox: {\n tunnelId: \"checkboxes\",\n className: styles.checkbox,\n },\n CheckboxButton: {\n tunnelId: \"checkboxButtons\",\n className: styles.checkboxButton,\n },\n };\n\n const localCheckboxGroupRef = useObjectRef(ref);\n useMakeFocusable(localCheckboxGroupRef);\n\n return (\n <Aria.CheckboxGroup\n {...rest}\n className={rootClassName}\n ref={localCheckboxGroupRef}\n value={Array.isArray(value) ? value : undefined}\n >\n <PropsContextProvider props={propsContext}>\n <TunnelProvider>\n {children}\n\n <ColumnLayout s={s} m={m} l={l} className={styles.checkboxGroup}>\n <TunnelExit id=\"checkboxButtons\" />\n </ColumnLayout>\n\n <ColumnLayout\n s={s ?? [1]}\n m={m ?? [1]}\n l={l ?? [1]}\n rowGap=\"s\"\n className={styles.checkboxGroup}\n >\n <TunnelExit id=\"checkboxes\" />\n </ColumnLayout>\n\n <TunnelExit id=\"fieldDescription\" />\n <TunnelExit id=\"fieldError\" />\n </TunnelProvider>\n </PropsContextProvider>\n <FieldError className={formFieldStyles.fieldError} />\n </Aria.CheckboxGroup>\n );\n});\n\nexport default CheckboxGroup;\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAsBO,MAAM,aAAgB,GAAA,aAAA,CAAc,eAAiB,EAAA,CAAC,KAAU,KAAA;AACrE,EAAM,MAAA,EAAE,QAAU,EAAA,SAAA,EAAW,CAAG,EAAA,CAAA,EAAG,GAAG,GAAK,EAAA,KAAA,EAAO,GAAG,IAAA,EAAS,GAAA,KAAA;AAE9D,EAAA,MAAM,aAAgB,GAAA,IAAA,CAAK,eAAgB,CAAA,SAAA,EAAW,SAAS,CAAA;AAE/D,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,KAAO,EAAA;AAAA,MACL,WAAW,eAAgB,CAAA;AAAA,KAC7B;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,WAAW,eAAgB,CAAA,gBAAA;AAAA,MAC3B,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,UAAY,EAAA;AAAA,MACV,WAAW,eAAgB,CAAA,gBAAA;AAAA,MAC3B,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,QAAU,EAAA;AAAA,MACR,QAAU,EAAA,YAAA;AAAA,MACV,WAAW,MAAO,CAAA;AAAA,KACpB;AAAA,IACA,cAAgB,EAAA;AAAA,MACd,QAAU,EAAA,iBAAA;AAAA,MACV,WAAW,MAAO,CAAA;AAAA;AACpB,GACF;AAEA,EAAM,MAAA,qBAAA,GAAwB,aAAa,GAAG,CAAA;AAC9C,EAAA,gBAAA,CAAiB,qBAAqB,CAAA;AAEtC,EACE,uBAAA,IAAA;AAAA,IAAC,IAAK,CAAA,aAAA;AAAA,IAAL;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,SAAW,EAAA,aAAA;AAAA,MACX,GAAK,EAAA,qBAAA;AAAA,MACL,KAAO,EAAA,KAAA,CAAM,OAAQ,CAAA,KAAK,IAAI,KAAQ,GAAA,MAAA;AAAA,MAEtC,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,oBAAqB,EAAA,EAAA,KAAA,EAAO,YAC3B,EAAA,QAAA,kBAAA,IAAA,CAAC,cACE,EAAA,EAAA,QAAA,EAAA;AAAA,UAAA,QAAA;AAAA,0BAEA,GAAA,CAAA,YAAA,EAAA,EAAa,CAAM,EAAA,CAAA,EAAM,CAAM,EAAA,SAAA,EAAW,MAAO,CAAA,aAAA,EAChD,QAAC,kBAAA,GAAA,CAAA,UAAA,EAAA,EAAW,EAAG,EAAA,iBAAA,EAAkB,CACnC,EAAA,CAAA;AAAA,0BAEA,GAAA;AAAA,YAAC,YAAA;AAAA,YAAA;AAAA,cACC,CAAA,EAAG,CAAK,IAAA,CAAC,CAAC,CAAA;AAAA,cACV,CAAA,EAAG,CAAK,IAAA,CAAC,CAAC,CAAA;AAAA,cACV,CAAA,EAAG,CAAK,IAAA,CAAC,CAAC,CAAA;AAAA,cACV,MAAO,EAAA,GAAA;AAAA,cACP,WAAW,MAAO,CAAA,aAAA;AAAA,cAElB,QAAA,kBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,EAAA,EAAG,YAAa,EAAA;AAAA;AAAA,WAC9B;AAAA,0BAEA,GAAA,CAAC,UAAW,EAAA,EAAA,EAAA,EAAG,kBAAmB,EAAA,CAAA;AAAA,0BAClC,GAAA,CAAC,UAAW,EAAA,EAAA,EAAA,EAAG,YAAa,EAAA;AAAA,SAAA,EAC9B,CACF,EAAA,CAAA;AAAA,wBACC,GAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,eAAA,CAAgB,UAAY,EAAA;AAAA;AAAA;AAAA,GACrD;AAEJ,CAAC;;;;"}
1
+ {"version":3,"file":"CheckboxGroup.mjs","sources":["../../../../../../src/components/CheckboxGroup/CheckboxGroup.tsx"],"sourcesContent":["import type { ColumnLayoutProps } from \"@/components/ColumnLayout\";\nimport { ColumnLayout } from \"@/components/ColumnLayout\";\nimport { FieldError } from \"@/components/FieldError\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { TunnelExit, TunnelProvider } from \"@mittwald/react-tunnel\";\nimport clsx from \"clsx\";\nimport type { PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport formFieldStyles from \"../FormField/FormField.module.scss\";\nimport styles from \"./CheckboxGroup.module.scss\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useMakeFocusable } from \"@/lib/hooks/dom/useMakeFocusable\";\n\nexport interface CheckboxGroupProps\n extends PropsWithChildren<Omit<Aria.CheckboxGroupProps, \"children\">>,\n Pick<ColumnLayoutProps, \"s\" | \"m\" | \"l\">,\n FlowComponentProps {}\n\n/** @flr-generate all */\nexport const CheckboxGroup = flowComponent(\"CheckboxGroup\", (props) => {\n const { children, className, s, m, l, ref, ...rest } = props;\n\n const rootClassName = clsx(formFieldStyles.formField, className);\n\n const propsContext: PropsContext = {\n Label: {\n className: formFieldStyles.label,\n },\n FieldDescription: {\n className: formFieldStyles.fieldDescription,\n tunnelId: \"fieldDescription\",\n },\n FieldError: {\n className: formFieldStyles.customFieldError,\n tunnelId: \"fieldError\",\n },\n Checkbox: {\n tunnelId: \"checkboxes\",\n className: styles.checkbox,\n },\n CheckboxButton: {\n tunnelId: \"checkboxButtons\",\n className: styles.checkboxButton,\n },\n };\n\n const localCheckboxGroupRef = useObjectRef(ref);\n useMakeFocusable(localCheckboxGroupRef);\n\n return (\n <Aria.CheckboxGroup\n {...rest}\n className={rootClassName}\n ref={localCheckboxGroupRef}\n >\n <PropsContextProvider props={propsContext} clear>\n <TunnelProvider>\n {children}\n\n <ColumnLayout s={s} m={m} l={l} className={styles.checkboxGroup}>\n <TunnelExit id=\"checkboxButtons\" />\n </ColumnLayout>\n\n <ColumnLayout\n s={s ?? [1]}\n m={m ?? [1]}\n l={l ?? [1]}\n rowGap=\"s\"\n className={styles.checkboxGroup}\n >\n <TunnelExit id=\"checkboxes\" />\n </ColumnLayout>\n\n <TunnelExit id=\"fieldDescription\" />\n <TunnelExit id=\"fieldError\" />\n </TunnelProvider>\n </PropsContextProvider>\n <FieldError className={formFieldStyles.fieldError} />\n </Aria.CheckboxGroup>\n );\n});\n\nexport default CheckboxGroup;\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAsBO,MAAM,aAAgB,GAAA,aAAA,CAAc,eAAiB,EAAA,CAAC,KAAU,KAAA;AACrE,EAAM,MAAA,EAAE,UAAU,SAAW,EAAA,CAAA,EAAG,GAAG,CAAG,EAAA,GAAA,EAAK,GAAG,IAAA,EAAS,GAAA,KAAA;AAEvD,EAAA,MAAM,aAAgB,GAAA,IAAA,CAAK,eAAgB,CAAA,SAAA,EAAW,SAAS,CAAA;AAE/D,EAAA,MAAM,YAA6B,GAAA;AAAA,IACjC,KAAO,EAAA;AAAA,MACL,WAAW,eAAgB,CAAA;AAAA,KAC7B;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,WAAW,eAAgB,CAAA,gBAAA;AAAA,MAC3B,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,UAAY,EAAA;AAAA,MACV,WAAW,eAAgB,CAAA,gBAAA;AAAA,MAC3B,QAAU,EAAA;AAAA,KACZ;AAAA,IACA,QAAU,EAAA;AAAA,MACR,QAAU,EAAA,YAAA;AAAA,MACV,WAAW,MAAO,CAAA;AAAA,KACpB;AAAA,IACA,cAAgB,EAAA;AAAA,MACd,QAAU,EAAA,iBAAA;AAAA,MACV,WAAW,MAAO,CAAA;AAAA;AACpB,GACF;AAEA,EAAM,MAAA,qBAAA,GAAwB,aAAa,GAAG,CAAA;AAC9C,EAAA,gBAAA,CAAiB,qBAAqB,CAAA;AAEtC,EACE,uBAAA,IAAA;AAAA,IAAC,IAAK,CAAA,aAAA;AAAA,IAAL;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,SAAW,EAA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...fieldProps,
73
75
  isSelected: value
@@ -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 type ControllerProps,\n type FieldValues,\n useController,\n type UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport { inheritProps } from \"@/lib/propsContext/inherit/types\";\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 stringFormatter = useLocalizedStringFormatter(locales);\n\n const controller = useController({\n ...props,\n rules: {\n ...props.rules,\n minLength:\n typeof rest.rules?.minLength === \"number\"\n ? {\n value: rest.rules.minLength,\n message: stringFormatter.format(\"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(\"maxLength\", {\n number: rest.rules.maxLength,\n }),\n }\n : rest.rules?.maxLength,\n },\n });\n const formContext = useFormContext<T>();\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 fieldProps = {\n ...inheritProps,\n ...controller.field,\n value,\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 MarkdownEditor: fieldProps,\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":";;;;;;;;;;;AAoBO,SAAS,MAA6B,KAAsB,EAAA;AACjE,EAAA,MAAM,EAAE,QAAU,EAAA,IAAA,EAAM,YAAc,EAAA,GAAG,MAAS,GAAA,KAAA;AAElD,EAAM,MAAA,eAAA,GAAkB,4BAA4B,OAAO,CAAA;AAE3D,EAAA,MAAM,aAAa,aAAc,CAAA;AAAA,IAC/B,GAAG,KA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A;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 type ControllerProps,\n type FieldValues,\n useController,\n type UseFormReturn,\n useWatch,\n} from \"react-hook-form\";\nimport FieldErrorView from \"@/views/FieldErrorView\";\nimport { useLocalizedStringFormatter } from \"react-aria\";\nimport locales from \"./locales/*.locale.json\";\nimport { inheritProps } from \"@/lib/propsContext/inherit/types\";\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 stringFormatter = useLocalizedStringFormatter(locales);\n\n const controller = useController({\n ...props,\n rules: {\n ...props.rules,\n minLength:\n typeof rest.rules?.minLength === \"number\"\n ? {\n value: rest.rules.minLength,\n message: stringFormatter.format(\"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(\"maxLength\", {\n number: rest.rules.maxLength,\n }),\n }\n : rest.rules?.maxLength,\n },\n });\n const formContext = useFormContext<T>();\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 fieldProps = {\n ...inheritProps,\n ...controller.field,\n value,\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 MarkdownEditor: 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 ...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":";;;;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AAY,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;;;;"}
@@ -20,16 +20,18 @@ function flowComponent(componentName, ImplementationComponentType, options = {})
20
20
  props
21
21
  );
22
22
  const implementationTypeProps = propsWithContext;
23
- const emptyProps = useMemo(() => ({}), []);
24
- const componentProps = useComponentPropsContext(componentName) ?? emptyProps;
25
- increaseNestingLevel(componentProps);
23
+ const componentProps = useComponentPropsContext(componentName);
24
+ const componentPropsToUse = useMemo(
25
+ () => increaseNestingLevel(componentProps ?? {}),
26
+ [componentProps]
27
+ );
26
28
  ImplementationComponentType.displayName = `FlowComponentImpl(${componentName})`;
27
29
  let element = /* @__PURE__ */ jsx(MemoizedImplementationComponentType, { ...implementationTypeProps });
28
30
  if (isRemoteComponent) {
29
31
  element = /* @__PURE__ */ jsx(
30
32
  ComponentPropsContextProvider,
31
33
  {
32
- componentProps,
34
+ componentProps: componentPropsToUse,
33
35
  levelModel: propsContextLevelMode,
34
36
  children: element
35
37
  }
@@ -38,7 +40,7 @@ function flowComponent(componentName, ImplementationComponentType, options = {})
38
40
  element = /* @__PURE__ */ jsx(
39
41
  ComponentPropsContextProviderView,
40
42
  {
41
- componentProps,
43
+ componentProps: componentPropsToUse,
42
44
  levelModel: propsContextLevelMode,
43
45
  children: element
44
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"flowComponent.mjs","sources":["../../../../../../src/lib/componentFactory/flowComponent.tsx"],"sourcesContent":["import type {\n FlowComponentName,\n FlowComponentProps as FlowComponentPropsOfName,\n} from \"@/components/propTypes\";\nimport type {\n ComponentProps,\n ComponentType,\n ReactElement,\n ReactNode,\n RefAttributes,\n FunctionComponent,\n} from \"react\";\nimport { cloneElement, memo, useMemo } from \"react\";\nimport type { PropsWithTunnel } from \"@/lib/types/props\";\nimport { TunnelEntry } from \"@mittwald/react-tunnel\";\nimport SlotContextProvider from \"@/lib/slotContext/SlotContextProvider\";\nimport { useProps } from \"@/lib/hooks/useProps\";\nimport { useComponentPropsContext } from \"@/lib/propsContext/propsContext\";\nimport { increaseNestingLevel } from \"@/lib/propsContext/nestedPropsContext/lib\";\nimport { ComponentPropsContextProvider } from \"@/components/ComponentPropsContextProvider\";\nimport type { PropsContextLevelMode } from \"@/lib/propsContext/inherit/types\";\nimport ComponentPropsContextProviderView from \"@/views/ComponentPropsContextProviderView\";\n\ntype RefType<T> = T extends RefAttributes<infer R> ? R : undefined;\n\nexport interface FlowComponentProps<R = HTMLDivElement>\n extends PropsWithTunnel,\n RefAttributes<R> {\n wrapWith?: ReactElement;\n}\n\ntype FlowComponentImplementationProps<C extends FlowComponentName> = Omit<\n FlowComponentPropsOfName<C>,\n keyof FlowComponentProps\n> &\n RefAttributes<RefType<FlowComponentPropsOfName<C>>>;\n\ntype FlowComponentImplementationType<C extends FlowComponentName> =\n ComponentType<FlowComponentImplementationProps<C>>;\n\ntype FlowComponentType<C extends FlowComponentName> = FunctionComponent<\n FlowComponentPropsOfName<C> &\n RefAttributes<RefType<FlowComponentPropsOfName<C>>>\n>;\n\ntype FlowComponentProvisionType = \"provider\" | \"ui\";\n\ninterface Options {\n type?: FlowComponentProvisionType;\n isRemoteComponent?: boolean;\n}\n\nexport function flowComponent<C extends FlowComponentName>(\n componentName: C,\n ImplementationComponentType: FlowComponentImplementationType<C>,\n options: Options = {},\n): FlowComponentType<C> {\n type Props = FlowComponentPropsOfName<C> &\n RefAttributes<RefType<FlowComponentPropsOfName<C>>>;\n\n const { type = \"ui\", isRemoteComponent = false } = options;\n\n const propsContextLevelMode: PropsContextLevelMode =\n type === \"ui\" ? \"increment\" : \"keep\";\n\n const MemoizedImplementationComponentType = memo(ImplementationComponentType);\n\n function Component(props: Props) {\n const { tunnelId, wrapWith, ...propsWithContext } = useProps(\n componentName,\n props as FlowComponentPropsOfName<C>,\n ) as FlowComponentProps<RefType<FlowComponentPropsOfName<C>>>;\n\n const implementationTypeProps = propsWithContext as ComponentProps<\n typeof ImplementationComponentType\n >;\n\n const emptyProps = useMemo(() => ({}), []);\n const componentProps =\n useComponentPropsContext(componentName) ?? emptyProps;\n increaseNestingLevel(componentProps);\n\n ImplementationComponentType.displayName = `FlowComponentImpl(${componentName})`;\n\n let element: ReactNode = (\n <MemoizedImplementationComponentType {...implementationTypeProps} />\n );\n\n if (isRemoteComponent) {\n element = (\n <ComponentPropsContextProvider\n componentProps={componentProps}\n levelModel={propsContextLevelMode}\n >\n {element}\n </ComponentPropsContextProvider>\n );\n } else {\n /**\n * In case of a Flow component that does not have a remote counterpart\n * (like the List component), the ComponentPropsContext must be applied on\n * the host side, so that nesting and inheritance is working correctly.\n */\n element = (\n <ComponentPropsContextProviderView\n componentProps={componentProps}\n levelModel={propsContextLevelMode}\n >\n {element}\n </ComponentPropsContextProviderView>\n );\n }\n\n if (\"slot\" in props && !!props.slot && typeof props.slot === \"string\") {\n element = (\n <SlotContextProvider slot={props.slot} component={componentName}>\n {element}\n </SlotContextProvider>\n );\n }\n\n if (wrapWith) {\n element = cloneElement(wrapWith, undefined, element);\n }\n\n if (tunnelId) {\n element = <TunnelEntry id={tunnelId}>{element}</TunnelEntry>;\n }\n return element;\n }\n\n Component.displayName = `FlowComponent(${componentName})`;\n return memo(Component);\n}\n"],"names":[],"mappings":";;;;;;;;;;AA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,IAAA,OAAO,KAAM,CAAA,IAAA,KAAS,QAAU,EAAA;AACrE,MAAA,OAAA,uBACG,mBAAoB,EAAA,EAAA,IAAA,EAAM,MAAM,IAAM,EAAA,SAAA,EAAW,eAC/C,QACH,EAAA,OAAA,EAAA,CAAA;AAAA;AAIJ,IAAA,IAAI,QAAU,EAAA;AACZ,MAAU,OAAA,GAAA,YAAA,CAAa,QAAU,EAAA,MAAA,EAAW,OAAO,CAAA;AAAA;AAGrD,IAAA,IAAI,QAAU,EAAA;AACZ,MAAA,OAAA,mBAAW,GAAA,CAAA,WAAA,EAAA,EAAY,EAAI,EAAA,QAAA,EAAW,QAAQ,EAAA,OAAA,EAAA,CAAA;AAAA;AAEhD,IAAO,OAAA,OAAA;AAAA;AAGT,EAAU,SAAA,CAAA,WAAA,GAAc,iBAAiB,aAAa,CAAA,CAAA,CAAA;AACtD,EAAA,OAAO,KAAK,SAAS,CAAA;AACvB;;;;"}
1
+ {"version":3,"file":"flowComponent.mjs","sources":["../../../../../../src/lib/componentFactory/flowComponent.tsx"],"sourcesContent":["import type {\n FlowComponentName,\n FlowComponentProps as FlowComponentPropsOfName,\n} from \"@/components/propTypes\";\nimport type {\n ComponentProps,\n ComponentType,\n ReactElement,\n ReactNode,\n RefAttributes,\n FunctionComponent,\n} from \"react\";\nimport { cloneElement, memo, useMemo } from \"react\";\nimport type { PropsWithTunnel } from \"@/lib/types/props\";\nimport { TunnelEntry } from \"@mittwald/react-tunnel\";\nimport SlotContextProvider from \"@/lib/slotContext/SlotContextProvider\";\nimport { useProps } from \"@/lib/hooks/useProps\";\nimport { useComponentPropsContext } from \"@/lib/propsContext/propsContext\";\nimport { increaseNestingLevel } from \"@/lib/propsContext/nestedPropsContext/lib\";\nimport { ComponentPropsContextProvider } from \"@/components/ComponentPropsContextProvider\";\nimport type { PropsContextLevelMode } from \"@/lib/propsContext/inherit/types\";\nimport ComponentPropsContextProviderView from \"@/views/ComponentPropsContextProviderView\";\n\ntype RefType<T> = T extends RefAttributes<infer R> ? R : undefined;\n\nexport interface FlowComponentProps<R = HTMLDivElement>\n extends PropsWithTunnel,\n RefAttributes<R> {\n wrapWith?: ReactElement;\n}\n\ntype FlowComponentImplementationProps<C extends FlowComponentName> = Omit<\n FlowComponentPropsOfName<C>,\n keyof FlowComponentProps\n> &\n RefAttributes<RefType<FlowComponentPropsOfName<C>>>;\n\ntype FlowComponentImplementationType<C extends FlowComponentName> =\n ComponentType<FlowComponentImplementationProps<C>>;\n\ntype FlowComponentType<C extends FlowComponentName> = FunctionComponent<\n FlowComponentPropsOfName<C> &\n RefAttributes<RefType<FlowComponentPropsOfName<C>>>\n>;\n\ntype FlowComponentProvisionType = \"provider\" | \"ui\";\n\ninterface Options {\n type?: FlowComponentProvisionType;\n isRemoteComponent?: boolean;\n}\n\nexport function flowComponent<C extends FlowComponentName>(\n componentName: C,\n ImplementationComponentType: FlowComponentImplementationType<C>,\n options: Options = {},\n): FlowComponentType<C> {\n type Props = FlowComponentPropsOfName<C> &\n RefAttributes<RefType<FlowComponentPropsOfName<C>>>;\n\n const { type = \"ui\", isRemoteComponent = false } = options;\n\n const propsContextLevelMode: PropsContextLevelMode =\n type === \"ui\" ? \"increment\" : \"keep\";\n\n const MemoizedImplementationComponentType = memo(ImplementationComponentType);\n\n function Component(props: Props) {\n const { tunnelId, wrapWith, ...propsWithContext } = useProps(\n componentName,\n props as FlowComponentPropsOfName<C>,\n ) as FlowComponentProps<RefType<FlowComponentPropsOfName<C>>>;\n\n const implementationTypeProps = propsWithContext as ComponentProps<\n typeof ImplementationComponentType\n >;\n\n const componentProps = useComponentPropsContext(componentName);\n const componentPropsToUse = useMemo(\n () => increaseNestingLevel(componentProps ?? {}),\n [componentProps],\n );\n\n ImplementationComponentType.displayName = `FlowComponentImpl(${componentName})`;\n\n let element: ReactNode = (\n <MemoizedImplementationComponentType {...implementationTypeProps} />\n );\n\n if (isRemoteComponent) {\n element = (\n <ComponentPropsContextProvider\n componentProps={componentPropsToUse}\n levelModel={propsContextLevelMode}\n >\n {element}\n </ComponentPropsContextProvider>\n );\n } else {\n /**\n * In case of a Flow component that does not have a remote counterpart\n * (like the List component), the ComponentPropsContext must be applied on\n * the host side, so that nesting and inheritance is working correctly.\n */\n element = (\n <ComponentPropsContextProviderView\n componentProps={componentPropsToUse}\n levelModel={propsContextLevelMode}\n >\n {element}\n </ComponentPropsContextProviderView>\n );\n }\n\n if (\"slot\" in props && !!props.slot && typeof props.slot === \"string\") {\n element = (\n <SlotContextProvider slot={props.slot} component={componentName}>\n {element}\n </SlotContextProvider>\n );\n }\n\n if (wrapWith) {\n element = cloneElement(wrapWith, undefined, element);\n }\n\n if (tunnelId) {\n element = <TunnelEntry id={tunnelId}>{element}</TunnelEntry>;\n }\n return element;\n }\n\n Component.displayName = `FlowComponent(${componentName})`;\n return memo(Component);\n}\n"],"names":[],"mappings":";;;;;;;;;;AAoDO,SAAS,aACd,CAAA,aAAA,EACA,2BACA,EAAA,OAAA,GAAmB,EACG,EAAA;AAItB,EAAA,MAAM,EAAE,IAAA,GAAO,IAAM,EAAA,iBAAA,GAAoB,OAAU,GAAA,OAAA;AAEnD,EAAM,MAAA,qBAAA,GACJ,IAAS,KAAA,IAAA,GAAO,WAAc,GAAA,MAAA;AAEhC,EAAM,MAAA,mCAAA,GAAsC,KAAK,2BAA2B,CAAA;AAE5E,EAAA,SAAS,UAAU,KAAc,EAAA;AAC/B,IAAA,MAAM,EAAE,QAAA,EAAU,QAAU,EAAA,GAAG,kBAAqB,GAAA,QAAA;AAAA,MAClD,aAAA;AAAA,MACA;AAAA,KACF;AAEA,IAAA,MAAM,uBAA0B,GAAA,gBAAA;AAIhC,IAAM,MAAA,cAAA,GAAiB,yBAAyB,aAAa,CAAA;AAC7D,IAAA,MAAM,mBAAsB,GAAA,OAAA;AAAA,MAC1B,MAAM,oBAAA,CAAqB,cAAkB,IAAA,EAAE,CAAA;AAAA,MAC/C,CAAC,cAAc;AAAA,KACjB;AAEA,IAA4B,2BAAA,CAAA,WA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= [],
16
16
  levelMode = "reset",
17
- children
17
+ children,
18
+ clear = false
18
19
  } = props;
19
20
  const parentPropsContext = usePropsContext();
20
21
  const readPropsContextLevel = usePropsContextLevel(
@@ -22,11 +23,11 @@ const PropsContextProvider = memo((props) => {
22
23
  );
23
24
  const propsWithParentPropsContext = useMemo(
24
25
  () => mergePropsContext(
25
- parentPropsContext,
26
+ clear ? void 0 : parentPropsContext,
26
27
  providedProps,
27
28
  readPropsContextLevel
28
29
  ),
29
- [parentPropsContext, readPropsContextLevel, ...dependencies]
30
+ [parentPropsContext, clear, readPropsContextLevel, ...dependencies]
30
31
  );
31
32
  return /* @__PURE__ */ jsx(PropsContextLevelProvider, { mode: levelMode, children: /* @__PURE__ */ jsx(Provider, { value: propsWithParentPropsContext, children }) });
32
33
  });
@@ -1 +1 @@
1
- {"version":3,"file":"PropsContextProvider.mjs","sources":["../../../../../../../src/lib/propsContext/components/PropsContextProvider.tsx"],"sourcesContent":["import { usePropsContextLevel } from \"@/lib/propsContext/inherit/propsContextLevel\";\nimport { PropsContextLevelProvider } from \"@/lib/propsContext/inherit/PropsContextLevelProvider\";\nimport type { PropsContextLevelMode } from \"@/lib/propsContext/inherit/types\";\nimport mergePropsContext from \"@/lib/propsContext/mergePropsContext\";\nimport { propsContext, usePropsContext } from \"@/lib/propsContext/propsContext\";\nimport type { PropsContext as PropsContextShape } from \"@/lib/propsContext/types\";\nimport type { DependencyList, FC, PropsWithChildren } from \"react\";\nimport { memo, useMemo } from \"react\";\n\ninterface Props extends PropsWithChildren {\n props: PropsContextShape;\n dependencies?: DependencyList;\n clear?: boolean;\n levelMode?: PropsContextLevelMode;\n}\n\nconst Provider = memo(propsContext.Provider);\nProvider.displayName = \"PropsContextProviderInner\";\n\nexport const PropsContextProvider: FC<Props> = memo((props) => {\n const {\n props: providedProps,\n dependencies = [],\n levelMode = \"reset\",\n children,\n } = props;\n\n const parentPropsContext = usePropsContext();\n\n const readPropsContextLevel = usePropsContextLevel(\n levelMode === \"keep\" ? \"decrement\" : levelMode,\n );\n\n const propsWithParentPropsContext = useMemo(\n () =>\n mergePropsContext(\n parentPropsContext,\n providedProps,\n readPropsContextLevel,\n ),\n [parentPropsContext, readPropsContextLevel, ...dependencies],\n );\n\n return (\n <PropsContextLevelProvider mode={levelMode}>\n <Provider value={propsWithParentPropsContext}>{children}</Provider>\n </PropsContextLevelProvider>\n );\n});\n\nPropsContextProvider.displayName = \"PropsContextProvider\";\n\nexport default PropsContextProvider;\n"],"names":[],"mappings":";;;;;;;AAgBA,MAAM,QAAA,GAAW,IAAK,CAAA,YAAA,CAAa,QAAQ,CAAA;AAC3C,QAAA,CAAS,WAAc,GAAA,2BAAA;AAEV,MAAA,oBAAA,GAAkC,IAAK,CAAA,CAAC,KAAU,KAAA;AAC7D,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,aAAA;AAAA,IACP,eAAe,EAAC;AAAA,IAChB,SAAY,GAAA,OAAA;AAAA,IACZ;AAAA,GACE,GAAA,KAAA;AAEJ,EAAA,MAAM,qBAAqB,eAAgB,EAAA;AAE3C,EAAA,MAAM,qBAAwB,GAAA,oBAAA;AAAA,IAC5B,SAAA,KAAc,SAAS,WAAc,GAAA;AAAA,GACvC;AAEA,EAAA,MAAM,2BAA8B,GAAA,OAAA;AAAA,IAClC,MACE,iBAAA;AAAA,MACE,kBAAA;AAAA,MACA,aAAA;AAAA,MACA;AAAA,KACF;AAAA,IACF,CAAC,kBAAA,EAAoB,qBAAuB,EAAA,GAAG,YAAY;AAAA,GAC7D;AAEA,EACE,uBAAA,GAAA,CAAC,6BAA0B,IAAM,EAAA,SAAA,EAC/B,8BAAC,QAAS,EAAA,EAAA,KAAA,EAAO,2BAA8B,EAAA,QAAA,EAAS,CAC1D,EAAA,CAAA;AAEJ,CAAC;AAED,oBAAA,CAAqB,WAAc,GAAA,sBAAA;;;;"}
1
+ {"version":3,"file":"PropsContextProvider.mjs","sources":["../../../../../../../src/lib/propsContext/components/PropsContextProvider.tsx"],"sourcesContent":["import { usePropsContextLevel } from \"@/lib/propsContext/inherit/propsContextLevel\";\nimport { PropsContextLevelProvider } from \"@/lib/propsContext/inherit/PropsContextLevelProvider\";\nimport type { PropsContextLevelMode } from \"@/lib/propsContext/inherit/types\";\nimport mergePropsContext from \"@/lib/propsContext/mergePropsContext\";\nimport { propsContext, usePropsContext } from \"@/lib/propsContext/propsContext\";\nimport type { PropsContext as PropsContextShape } from \"@/lib/propsContext/types\";\nimport type { DependencyList, FC, PropsWithChildren } from \"react\";\nimport { memo, useMemo } from \"react\";\n\ninterface Props extends PropsWithChildren {\n props: PropsContextShape;\n dependencies?: DependencyList;\n clear?: boolean;\n levelMode?: PropsContextLevelMode;\n}\n\nconst Provider = memo(propsContext.Provider);\nProvider.displayName = \"PropsContextProviderInner\";\n\nexport const PropsContextProvider: FC<Props> = memo((props) => {\n const {\n props: providedProps,\n dependencies = [],\n levelMode = \"reset\",\n children,\n clear = false,\n } = props;\n\n const parentPropsContext = usePropsContext();\n\n const readPropsContextLevel = usePropsContextLevel(\n levelMode === \"keep\" ? \"decrement\" : levelMode,\n );\n\n const propsWithParentPropsContext = useMemo(\n () =>\n mergePropsContext(\n clear ? undefined : parentPropsContext,\n providedProps,\n readPropsContextLevel,\n ),\n [parentPropsContext, clear, readPropsContextLevel, ...dependencies],\n );\n\n return (\n <PropsContextLevelProvider mode={levelMode}>\n <Provider value={propsWithParentPropsContext}>{children}</Provider>\n </PropsContextLevelProvider>\n );\n});\n\nPropsContextProvider.displayName = \"PropsContextProvider\";\n\nexport default PropsContextProvider;\n"],"names":[],"mappings":";;;;;;;AAgBA,MAAM,QAAA,GAAW,IAAK,CAAA,YAAA,CAAa,QAAQ,CAAA;AAC3C,QAAA,CAAS,WAAc,GAAA,2BAAA;AAEV,MAAA,oBAAA,GAAkC,IAAK,CAAA,CAAC,KAAU,KAAA;AAC7D,EAAM,MAAA;AAAA,IACJ,KAAO,EAAA,aAAA;AAAA,IACP,eAAe,EAAC;AAAA,IAChB,SAAY,GAAA,OAAA;AAAA,IACZ,QAAA;AAAA,IACA,KAAQ,GAAA;AAAA,GACN,GAAA,KAAA;AAEJ,EAAA,MAAM,qBAAqB,eAAgB,EAAA;AAE3C,EAAA,MAAM,qBAAwB,GAAA,oBAAA;AAAA,IAC5B,SAAA,KAAc,SAAS,WAAc,GAAA;AAAA,GACvC;AAEA,EAAA,MAAM,2BAA8B,GAAA,OAAA;AAAA,IAClC,MACE,iBAAA;AAAA,MACE,QAAQ,MAAY,GAAA,kBAAA;AAAA,MACpB,aAAA;AAAA,MACA;AAAA,KACF;AAAA,IACF,CAAC,kBAAA,EAAoB,KAAO,EAAA,qBAAA,EAAuB,GAAG,YAAY;AAAA,GACpE;AAEA,EACE,uBAAA,GAAA,CAAC,6BAA0B,IAAM,EAAA,SAAA,EAC/B,8BAAC,QAAS,EAAA,EAAA,KAAA,EAAO,2BAA8B,EAAA,QAAA,EAAS,CAC1D,EAAA,CAAA;AAEJ,CAAC;AAED,oBAAA,CAAqB,WAAc,GAAA,sBAAA;;;;"}
@@ -13,9 +13,10 @@ const getNestingLevel = (props) => {
13
13
  };
14
14
  const increaseNestingLevel = (propsContext) => {
15
15
  const currentNestingLevel = getNestingLevel(propsContext);
16
- Object.assign(propsContext, {
16
+ return {
17
+ ...propsContext,
17
18
  [nestingLevelKey]: currentNestingLevel + 1
18
- });
19
+ };
19
20
  };
20
21
 
21
22
  export { getNestingLevel, increaseNestingLevel, isNestingLevelKey, isNestingProps };
@@ -1 +1 @@
1
- {"version":3,"file":"lib.mjs","sources":["../../../../../../../src/lib/propsContext/nestedPropsContext/lib.ts"],"sourcesContent":["import type { PropsContext } from \"@/lib/propsContext/types\";\nimport {\n nestingLevelKey,\n type NestingLevelProps,\n} from \"@/lib/propsContext/nestedPropsContext/types\";\n\nexport function isNestingProps(\n propsContext: PropsContext,\n): propsContext is NestingLevelProps {\n return (\n nestingLevelKey in propsContext &&\n typeof propsContext[nestingLevelKey] === \"number\"\n );\n}\n\nexport function isNestingLevelKey(key: string) {\n return key === nestingLevelKey;\n}\n\nexport const getNestingLevel = (props: PropsContext) => {\n return isNestingProps(props) ? (props[nestingLevelKey] ?? 0) : 0;\n};\n\nexport const increaseNestingLevel = (propsContext: PropsContext) => {\n const currentNestingLevel = getNestingLevel(propsContext);\n Object.assign(propsContext, {\n [nestingLevelKey]: currentNestingLevel + 1,\n });\n};\n"],"names":[],"mappings":";;AAMO,SAAS,eACd,YACmC,EAAA;AACnC,EAAA,OACE,eAAmB,IAAA,YAAA,IACnB,OAAO,YAAA,CAAa,eAAe,CAAM,KAAA,QAAA;AAE7C;AAEO,SAAS,kBAAkB,GAAa,EAAA;AAC7C,EAAA,OAAO,GAAQ,KAAA,eAAA;AACjB;AAEa,MAAA,eAAA,GAAkB,CAAC,KAAwB,KAAA;AACtD,EAAA,OAAO,eAAe,KAAK,CAAA,GAAK,KAAM,CAAA,eAAe,KAAK,CAAK,GAAA,CAAA;AACjE;AAEa,MAAA,oBAAA,GAAuB,CAAC,YAA+B,KAAA;AAClE,EAAM,MAAA,mBAAA,GAAsB,gBAAgB,YAAY,CAAA;AACxD,EAAA,MAAA,CAAO,OAAO,YAAc,EAAA;AAAA,IAC1B,CAAC,eAAe,GAAG,mBAAsB,GAAA;AAAA,GAC1C,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"lib.mjs","sources":["../../../../../../../src/lib/propsContext/nestedPropsContext/lib.ts"],"sourcesContent":["import type { PropsContext } from \"@/lib/propsContext/types\";\nimport {\n nestingLevelKey,\n type NestingLevelProps,\n} from \"@/lib/propsContext/nestedPropsContext/types\";\n\nexport function isNestingProps(\n propsContext: PropsContext,\n): propsContext is NestingLevelProps {\n return (\n nestingLevelKey in propsContext &&\n typeof propsContext[nestingLevelKey] === \"number\"\n );\n}\n\nexport function isNestingLevelKey(key: string) {\n return key === nestingLevelKey;\n}\n\nexport const getNestingLevel = (props: PropsContext) => {\n return isNestingProps(props) ? (props[nestingLevelKey] ?? 0) : 0;\n};\n\nexport const increaseNestingLevel = (propsContext: PropsContext) => {\n const currentNestingLevel = getNestingLevel(propsContext);\n return {\n ...propsContext,\n [nestingLevelKey]: currentNestingLevel + 1,\n };\n};\n"],"names":[],"mappings":";;AAMO,SAAS,eACd,YACmC,EAAA;AACnC,EAAA,OACE,eAAmB,IAAA,YAAA,IACnB,OAAO,YAAA,CAAa,eAAe,CAAM,KAAA,QAAA;AAE7C;AAEO,SAAS,kBAAkB,GAAa,EAAA;AAC7C,EAAA,OAAO,GAAQ,KAAA,eAAA;AACjB;AAEa,MAAA,eAAA,GAAkB,CAAC,KAAwB,KAAA;AACtD,EAAA,OAAO,eAAe,KAAK,CAAA,GAAK,KAAM,CAAA,eAAe,KAAK,CAAK,GAAA,CAAA;AACjE;AAEa,MAAA,oBAAA,GAAuB,CAAC,YAA+B,KAAA;AAClE,EAAM,MAAA,mBAAA,GAAsB,gBAAgB,YAAY,CAAA;AACxD,EAAO,OAAA;AAAA,IACL,GAAG,YAAA;AAAA,IACH,CAAC,eAAe,GAAG,mBAAsB,GAAA;AAAA,GAC3C;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CheckboxGroup/CheckboxGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAM/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAM9C,MAAM,WAAW,kBACf,SAAQ,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,EAClE,IAAI,CAAC,iBAAiB,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,EACxC,kBAAkB;CAAG;AAEzB,wBAAwB;AACxB,eAAO,MAAM,aAAa,uGA8DxB,CAAC;AAEH,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CheckboxGroup/CheckboxGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAM/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAM9C,MAAM,WAAW,kBACf,SAAQ,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC,EAClE,IAAI,CAAC,iBAAiB,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,EACxC,kBAAkB;CAAG;AAEzB,wBAAwB;AACxB,eAAO,MAAM,aAAa,uGA6DxB,CAAC;AAEH,eAAe,aAAa,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,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAEhB,KAAK,aAAa,EAEnB,MAAM,iBAAiB,CAAC;AAMzB,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,2CAyHhE;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,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAEhB,KAAK,aAAa,EAEnB,MAAM,iBAAiB,CAAC;AAMzB,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,2CA2HhE;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 +1 @@
1
- {"version":3,"file":"flowComponent.d.ts","sourceRoot":"","sources":["../../../../src/lib/componentFactory/flowComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,IAAI,wBAAwB,EAC/C,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAEV,aAAa,EACb,YAAY,EAEZ,aAAa,EACb,iBAAiB,EAClB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAUzD,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS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AEf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAUzD,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;AAEnE,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,cAAc,CACpD,SAAQ,eAAe,EACrB,aAAa,CAAC,CAAC,CAAC;IAClB,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED,KAAK,gCAAgC,CAAC,CAAC,SAAS,iBAAiB,IAAI,IAAI,CACvE,wBAAwB,CAAC,CAAC,CAAC,EAC3B,MAAM,kBAAkB,CACzB,GACC,aAAa,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtD,KAAK,+BAA+B,CAAC,CAAC,SAAS,iBAAiB,IAC9D,aAAa,CAAC,gCAAgC,CAAC,CAAC,CAAC,CAAC,CAAC;AAErD,KAAK,iBAAiB,CAAC,CAAC,SAAS,iBAAiB,IAAI,iBAAiB,CACrE,wBAAwB,CAAC,CAAC,CAAC,GACzB,aAAa,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,CACtD,CAAC;AAEF,KAAK,0BAA0B,GAAG,UAAU,GAAG,IAAI,CAAC;AAEpD,UAAU,OAAO;IACf,IAAI,CAAC,EAAE,0BAA0B,CAAC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,iBAAiB,EACvD,aAAa,EAAE,CAAC,EAChB,2BAA2B,EAAE,+BAA+B,CAAC,CAAC,CAAC,EAC/D,OAAO,GAAE,OAAY,GACpB,iBAAiB,CAAC,CAAC,CAAC,CA8EtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"PropsContextProvider.d.ts","sourceRoot":"","sources":["../../../../../src/lib/propsContext/components/PropsContextProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAG9E,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnE,UAAU,KAAM,SAAQ,iBAAiB;IACvC,KAAK,EAAE,iBAAiB,CAAC;IACzB,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC;AAKD,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,KAAK,CA6BzC,CAAC;AAIH,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"PropsContextProvider.d.ts","sourceRoot":"","sources":["../../../../../src/lib/propsContext/components/PropsContextProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAG9E,OAAO,KAAK,EAAE,YAAY,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGnE,UAAU,KAAM,SAAQ,iBAAiB;IACvC,KAAK,EAAE,iBAAiB,CAAC;IACzB,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC;AAKD,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,KAAK,CA8BzC,CAAC;AAIH,eAAe,oBAAoB,CAAC"}
@@ -3,5 +3,84 @@ import { NestingLevelProps } from './types';
3
3
  export declare function isNestingProps(propsContext: PropsContext): propsContext is NestingLevelProps;
4
4
  export declare function isNestingLevelKey(key: string): key is "___nestingLevel";
5
5
  export declare const getNestingLevel: (props: PropsContext) => number;
6
- export declare const increaseNestingLevel: (propsContext: PropsContext) => void;
6
+ export declare const increaseNestingLevel: (propsContext: PropsContext) => {
7
+ ___nestingLevel: number;
8
+ AccentBox?: import('../types').ComponentPropsContext<"AccentBox"> | undefined;
9
+ Action?: import('../types').ComponentPropsContext<"Action"> | undefined;
10
+ ActionGroup?: import('../types').ComponentPropsContext<"ActionGroup"> | undefined;
11
+ Alert?: import('../types').ComponentPropsContext<"Alert"> | undefined;
12
+ AlertBadge?: import('../types').ComponentPropsContext<"AlertBadge"> | undefined;
13
+ AlertIcon?: import('../types').ComponentPropsContext<"AlertIcon"> | undefined;
14
+ Align?: import('../types').ComponentPropsContext<"Align"> | undefined;
15
+ Avatar?: import('../types').ComponentPropsContext<"Avatar"> | undefined;
16
+ Autocomplete?: import('../types').ComponentPropsContext<"Autocomplete"> | undefined;
17
+ Badge?: import('../types').ComponentPropsContext<"Badge"> | undefined;
18
+ Button?: import('../types').ComponentPropsContext<"Button"> | undefined;
19
+ Checkbox?: import('../types').ComponentPropsContext<"Checkbox"> | undefined;
20
+ CheckboxButton?: import('../types').ComponentPropsContext<"CheckboxButton"> | undefined;
21
+ CheckboxGroup?: import('../types').ComponentPropsContext<"CheckboxGroup"> | undefined;
22
+ ColumnLayout?: import('../types').ComponentPropsContext<"ColumnLayout"> | undefined;
23
+ ComboBox?: import('../types').ComponentPropsContext<"ComboBox"> | undefined;
24
+ Content?: import('../types').ComponentPropsContext<"Content"> | undefined;
25
+ ContextMenu?: import('../types').ComponentPropsContext<"ContextMenu"> | undefined;
26
+ ContextMenuSection?: import('../types').ComponentPropsContext<"ContextMenuSection"> | undefined;
27
+ ContextMenuTrigger?: import('../types').ComponentPropsContext<"ContextMenuTrigger"> | undefined;
28
+ ContextualHelp?: import('../types').ComponentPropsContext<"ContextualHelp"> | undefined;
29
+ ContextualHelpTrigger?: import('../types').ComponentPropsContext<"ContextualHelpTrigger"> | undefined;
30
+ CopyButton?: import('../types').ComponentPropsContext<"CopyButton"> | undefined;
31
+ CounterBadge?: import('../types').ComponentPropsContext<"CounterBadge"> | undefined;
32
+ CountryOptions?: import('../types').ComponentPropsContext<"CountryOptions"> | undefined;
33
+ DatePicker?: import('../types').ComponentPropsContext<"DatePicker"> | undefined;
34
+ DateRangePicker?: import('../types').ComponentPropsContext<"DateRangePicker"> | undefined;
35
+ FieldDescription?: import('../types').ComponentPropsContext<"FieldDescription"> | undefined;
36
+ FieldError?: import('../types').ComponentPropsContext<"FieldError"> | undefined;
37
+ FileCard?: import('../types').ComponentPropsContext<"FileCard"> | undefined;
38
+ FileCardList?: import('../types').ComponentPropsContext<"FileCardList"> | undefined;
39
+ FileField?: import('../types').ComponentPropsContext<"FileField"> | undefined;
40
+ FileDropZone?: import('../types').ComponentPropsContext<"FileDropZone"> | undefined;
41
+ Header?: import('../types').ComponentPropsContext<"Header"> | undefined;
42
+ Heading?: import('../types').ComponentPropsContext<"Heading"> | undefined;
43
+ Icon?: import('../types').ComponentPropsContext<"Icon"> | undefined;
44
+ Image?: import('../types').ComponentPropsContext<"Image"> | undefined;
45
+ Initials?: import('../types').ComponentPropsContext<"Initials"> | undefined;
46
+ Label?: import('../types').ComponentPropsContext<"Label"> | undefined;
47
+ LayoutCard?: import('../types').ComponentPropsContext<"LayoutCard"> | undefined;
48
+ LightBox?: import('../types').ComponentPropsContext<"LightBox"> | undefined;
49
+ Link?: import('../types').ComponentPropsContext<"Link"> | undefined;
50
+ List?: import('../types').ComponentPropsContext<"List"> | undefined;
51
+ ListSummary?: import('../types').ComponentPropsContext<"ListSummary"> | undefined;
52
+ MarkdownEditor?: import('../types').ComponentPropsContext<"MarkdownEditor"> | undefined;
53
+ MenuItem?: import('../types').ComponentPropsContext<"MenuItem"> | undefined;
54
+ MenuTrigger?: import('../types').ComponentPropsContext<"MenuTrigger"> | undefined;
55
+ Message?: import('../types').ComponentPropsContext<"Message"> | undefined;
56
+ MessageThread?: import('../types').ComponentPropsContext<"MessageThread"> | undefined;
57
+ Modal?: import('../types').ComponentPropsContext<"Modal"> | undefined;
58
+ Navigation?: import('../types').ComponentPropsContext<"Navigation"> | undefined;
59
+ NavigationGroup?: import('../types').ComponentPropsContext<"NavigationGroup"> | undefined;
60
+ NumberField?: import('../types').ComponentPropsContext<"NumberField"> | undefined;
61
+ Option?: import('../types').ComponentPropsContext<"Option"> | undefined;
62
+ Options?: import('../types').ComponentPropsContext<"Options"> | undefined;
63
+ Popover?: import('../types').ComponentPropsContext<"Popover"> | undefined;
64
+ PopoverTrigger?: import('../types').ComponentPropsContext<"PopoverTrigger"> | undefined;
65
+ PasswordCreationField?: import('../types').ComponentPropsContext<"PasswordCreationField"> | undefined;
66
+ ProgressBar?: import('../types').ComponentPropsContext<"ProgressBar"> | undefined;
67
+ Radio?: import('../types').ComponentPropsContext<"Radio"> | undefined;
68
+ RadioButton?: import('../types').ComponentPropsContext<"RadioButton"> | undefined;
69
+ RadioGroup?: import('../types').ComponentPropsContext<"RadioGroup"> | undefined;
70
+ SearchField?: import('../types').ComponentPropsContext<"SearchField"> | undefined;
71
+ Section?: import('../types').ComponentPropsContext<"Section"> | undefined;
72
+ Segment?: import('../types').ComponentPropsContext<"Segment"> | undefined;
73
+ SegmentedControl?: import('../types').ComponentPropsContext<"SegmentedControl"> | undefined;
74
+ Select?: import('../types').ComponentPropsContext<"Select"> | undefined;
75
+ Slider?: import('../types').ComponentPropsContext<"Slider"> | undefined;
76
+ Switch?: import('../types').ComponentPropsContext<"Switch"> | undefined;
77
+ Tabs?: import('../types').ComponentPropsContext<"Tabs"> | undefined;
78
+ TabTitle?: import('../types').ComponentPropsContext<"TabTitle"> | undefined;
79
+ Text?: import('../types').ComponentPropsContext<"Text"> | undefined;
80
+ TextArea?: import('../types').ComponentPropsContext<"TextArea"> | undefined;
81
+ TextField?: import('../types').ComponentPropsContext<"TextField"> | undefined;
82
+ TimeField?: import('../types').ComponentPropsContext<"TimeField"> | undefined;
83
+ TestComponent?: import('../types').ComponentPropsContext<"TestComponent"> | undefined;
84
+ ___inherit?: boolean;
85
+ };
7
86
  //# sourceMappingURL=lib.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../../../src/lib/propsContext/nestedPropsContext/lib.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,6CAA6C,CAAC;AAErD,wBAAgB,cAAc,CAC5B,YAAY,EAAE,YAAY,GACzB,YAAY,IAAI,iBAAiB,CAKnC;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,4BAE5C;AAED,eAAO,MAAM,eAAe,GAAI,OAAO,YAAY,WAElD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,cAAc,YAAY,SAK9D,CAAC"}
1
+ {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../../../src/lib/propsContext/nestedPropsContext/lib.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,6CAA6C,CAAC;AAErD,wBAAgB,cAAc,CAC5B,YAAY,EAAE,YAAY,GACzB,YAAY,IAAI,iBAAiB,CAKnC;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,4BAE5C;AAED,eAAO,MAAM,eAAe,GAAI,OAAO,YAAY,WAElD,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,cAAc,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM9D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.2.0-alpha.514",
3
+ "version": "0.2.0-alpha.516",
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
  "dependencies": {
59
59
  "@internationalized/string-compiler": "^3.2.6",
60
60
  "@mittwald/password-tools-js": "3.0.0-alpha.18",
61
- "@mittwald/react-tunnel": "0.2.0-alpha.514",
61
+ "@mittwald/react-tunnel": "0.2.0-alpha.516",
62
62
  "@mittwald/react-use-promise": "^3.0.4",
63
63
  "@react-aria/form": "^3.1.1",
64
64
  "@react-aria/live-announcer": "^3.4.4",
@@ -101,7 +101,7 @@
101
101
  "@faker-js/faker": "^9.9.0",
102
102
  "@internationalized/date": "^3.9.0",
103
103
  "@mittwald/flow-core": "",
104
- "@mittwald/flow-design-tokens": "0.2.0-alpha.514",
104
+ "@mittwald/flow-design-tokens": "0.2.0-alpha.516",
105
105
  "@mittwald/react-use-promise": "^3.0.4",
106
106
  "@mittwald/remote-dom-react": "1.2.2-mittwald.3",
107
107
  "@mittwald/typescript-config": "",
@@ -174,5 +174,5 @@
174
174
  "optional": true
175
175
  }
176
176
  },
177
- "gitHead": "52bb320f607694cfc9c9c09be278fd2cffa2b8f9"
177
+ "gitHead": "2722020f2c6783e726dbc1f687551dc290113e3f"
178
178
  }