@mittwald/flow-react-components 0.2.0-alpha.112 → 0.2.0-alpha.113

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.
@@ -63,7 +63,8 @@ function Field(props) {
63
63
  DateRangePicker: formControlProps,
64
64
  TimeField: formControlProps,
65
65
  SegmentedControl: formControlProps,
66
- ComboBox: formControlProps
66
+ ComboBox: formControlProps,
67
+ SearchField: formControlProps
67
68
  };
68
69
  return /* @__PURE__ */ jsx(
69
70
  PropsContextProvider,
@@ -1 +1 @@
1
- {"version":3,"file":"Field.mjs","sources":["../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport type {\n ControllerProps,\n FieldValues,\n UseFormReturn,\n} from \"react-hook-form\";\nimport { Controller } from \"react-hook-form\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { useFormContext } from \"@/integrations/react-hook-form/components/context/formContext\";\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, control, ...rest } = props;\n\n const formContext = useFormContext<T>();\n const controlFromContext = formContext.form?.control;\n\n return (\n <Controller\n {...rest}\n control={control ?? controlFromContext}\n render={(renderProps) => {\n const {\n field,\n fieldState: { error, invalid },\n } = renderProps;\n\n const formControlProps = {\n ...field,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n isInvalid: invalid,\n validationBehavior: \"aria\" as const,\n children: dynamic((p) => (\n <>\n {p.children}\n <FieldErrorView>{error?.message}</FieldErrorView>\n </>\n )),\n };\n\n const propsContext: PropsContext = {\n Checkbox: {\n ...formControlProps,\n isSelected: formControlProps.value,\n },\n CheckboxGroup: formControlProps,\n CheckboxButton: {\n ...formControlProps,\n isSelected: formControlProps.value,\n },\n FileField: formControlProps,\n NumberField: formControlProps,\n RadioGroup: formControlProps,\n Switch: {\n ...formControlProps,\n isSelected: formControlProps.value,\n },\n TextArea: formControlProps,\n TextField: formControlProps,\n Select: {\n ...formControlProps,\n selectedKey: formControlProps.value,\n },\n Slider: formControlProps,\n DatePicker: formControlProps,\n DateRangePicker: formControlProps,\n TimeField: formControlProps,\n SegmentedControl: formControlProps,\n ComboBox: formControlProps,\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[renderProps]}\n >\n {children}\n </PropsContextProvider>\n );\n }}\n />\n );\n}\n\nexport const typedField = <T extends FieldValues>(\n ignoredForm: UseFormReturn<T>,\n): typeof Field<T> => Field;\n"],"names":[],"mappings":";;;;;;;;;;AAiBO,SAAS,MAA6B,KAAsB,EAAA;AACjE,EAAA,MAAM,EAAE,QAAA,EAAU,OAAS,EAAA,GAAG,MAAS,GAAA,KAAA;AAEvC,EAAA,MAAM,cAAc,cAAkB,EAAA;AACtC,EAAM,MAAA,kBAAA,GAAqB,YAAY,IAAM,EAAA,OAAA;AAE7C,EACE,uBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,SAAS,OAAW,IAAA,kBAAA;AAAA,MACpB,MAAA,EAAQ,CAAC,WAAgB,KAAA;AACvB,QAAM,MAAA;AAAA,UACJ,KAAA;AAAA,UACA,UAAA,EAAY,EAAE,KAAA,EAAO,OAAQ;AAAA,SAC3B,GAAA,WAAA;AAEJ,QAAA,MAAM,gBAAmB,GAAA;AAAA,UACvB,GAAG,KAAA;AAAA,UACH,MAAM,WAAY,CAAA,EAAA;AAAA,UAClB,UAAY,EAAA,CAAC,CAAC,IAAA,CAAK,KAAO,EAAA,QAAA;AAAA,UAC1B,SAAW,EAAA,OAAA;AAAA,UACX,kBAAoB,EAAA,MAAA;AAAA,UACpB,QAAU,EAAA,OAAA,CAAQ,CAAC,CAAA,qBAEd,IAA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src/integrations/react-hook-form/components/Field/Field.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport type {\n ControllerProps,\n FieldValues,\n UseFormReturn,\n} from \"react-hook-form\";\nimport { Controller } from \"react-hook-form\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport { dynamic, PropsContextProvider } from \"@/lib/propsContext\";\nimport { useFormContext } from \"@/integrations/react-hook-form/components/context/formContext\";\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, control, ...rest } = props;\n\n const formContext = useFormContext<T>();\n const controlFromContext = formContext.form?.control;\n\n return (\n <Controller\n {...rest}\n control={control ?? controlFromContext}\n render={(renderProps) => {\n const {\n field,\n fieldState: { error, invalid },\n } = renderProps;\n\n const formControlProps = {\n ...field,\n form: formContext.id,\n isRequired: !!rest.rules?.required,\n isInvalid: invalid,\n validationBehavior: \"aria\" as const,\n children: dynamic((p) => (\n <>\n {p.children}\n <FieldErrorView>{error?.message}</FieldErrorView>\n </>\n )),\n };\n\n const propsContext: PropsContext = {\n Checkbox: {\n ...formControlProps,\n isSelected: formControlProps.value,\n },\n CheckboxGroup: formControlProps,\n CheckboxButton: {\n ...formControlProps,\n isSelected: formControlProps.value,\n },\n FileField: formControlProps,\n NumberField: formControlProps,\n RadioGroup: formControlProps,\n Switch: {\n ...formControlProps,\n isSelected: formControlProps.value,\n },\n TextArea: formControlProps,\n TextField: formControlProps,\n Select: {\n ...formControlProps,\n selectedKey: formControlProps.value,\n },\n Slider: formControlProps,\n DatePicker: formControlProps,\n DateRangePicker: formControlProps,\n TimeField: formControlProps,\n SegmentedControl: formControlProps,\n ComboBox: formControlProps,\n SearchField: formControlProps,\n };\n\n return (\n <PropsContextProvider\n props={propsContext}\n dependencies={[renderProps]}\n >\n {children}\n </PropsContextProvider>\n );\n }}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GAAG,gBAAA;AAAA,YACH,YAAY,gBAAiB,CAAA;AAAA,WAC/B;AAAA,UACA,SAAW,EAAA,gBAAA;AAAA,UACX,WAAa,EAAA,gBAAA;AAAA,UACb,UAAY,EAAA,gBAAA;AAAA,UACZ,MAAQ,EAAA;AAAA,YACN,GAAG,gBAAA;AAAA,YACH,YAAY,gBAAiB,CAAA;AAAA,WAC/B;AAAA,UACA,QAAU,EAAA,gBAAA;AAAA,UACV,SAAW,EAAA,gBAAA;AAAA,UACX,MAAQ,EAAA;AAAA,YACN,GAAG,gBAAA;AAAA,YACH,aAAa,gBAAiB,CAAA;AAAA,WAChC;AAAA,UACA,MAAQ,EAAA,gBAAA;AAAA,UACR,UAAY,EAAA,gBAAA;AAAA,UACZ,eAAiB,EAAA,gBAAA;AAAA,UACjB,SAAW,EAAA,gBAAA;AAAA,UACX,gBAAkB,EAAA,gBAAA;AAAA,UAClB,QAAU,EAAA,gBAAA;AAAA,UACV,WAAa,EAAA;AAAA,SACf;AAEA,QACE,uBAAA,GAAA;AAAA,UAAC,oBAAA;AAAA,UAAA;AAAA,YACC,KAAO,EAAA,YAAA;AAAA,YACP,YAAA,EAAc,CAAC,WAAW,CAAA;AAAA,YAEzB;AAAA;AAAA,SACH;AAAA;AAEJ;AAAA,GACF;AAEJ;AAEa,MAAA,UAAA,GAAa,CACxB,WACoB,KAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,aAAa,EACd,MAAM,iBAAiB,CAAC;AAOzB,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,2CAwEhE;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,WAAW,EAC9C,aAAa,aAAa,CAAC,CAAC,CAAC,KAC5B,OAAO,KAAK,CAAC,CAAC,CAAU,CAAC"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/react-hook-form/components/Field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,aAAa,EACd,MAAM,iBAAiB,CAAC;AAOzB,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,2CAyEhE;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,WAAW,EAC9C,aAAa,aAAa,CAAC,CAAC,CAAC,KAC5B,OAAO,KAAK,CAAC,CAAC,CAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.2.0-alpha.112",
3
+ "version": "0.2.0-alpha.113",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -53,7 +53,7 @@
53
53
  "dependencies": {
54
54
  "@chakra-ui/live-region": "^2.1.0",
55
55
  "@internationalized/string-compiler": "^3.2.6",
56
- "@mittwald/react-tunnel": "0.2.0-alpha.112",
56
+ "@mittwald/react-tunnel": "0.2.0-alpha.113",
57
57
  "@mittwald/react-use-promise": "^3.0.3",
58
58
  "@react-aria/form": "^3.0.14",
59
59
  "@react-aria/utils": "^3.28.1",
@@ -92,7 +92,7 @@
92
92
  "@faker-js/faker": "^9.6.0",
93
93
  "@internationalized/date": "^3.7.0",
94
94
  "@mfalkenberg/remote-dom-react": "1.2.3",
95
- "@mittwald/flow-design-tokens": "0.2.0-alpha.112",
95
+ "@mittwald/flow-design-tokens": "0.2.0-alpha.113",
96
96
  "@mittwald/react-use-promise": "^2.6.0",
97
97
  "@mittwald/typescript-config": "",
98
98
  "@nx/storybook": "^20.5.0",
@@ -172,5 +172,5 @@
172
172
  "optional": true
173
173
  }
174
174
  },
175
- "gitHead": "b422c13d2bbbafca1cfae36e1e2b6789e73abd6e"
175
+ "gitHead": "735d43c65de5d7cb95d41e0f6f54deae85142ae3"
176
176
  }