@mittwald/flow-react-components 1.5.0-next.17 → 1.5.0-next.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs +2 -1
- package/dist/js/packages/components/src/components/DatePicker/DatePicker.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TimeField/TimeField.mjs +2 -1
- package/dist/js/packages/components/src/components/TimeField/TimeField.mjs.map +1 -1
- package/package.json +9 -9
|
@@ -5,6 +5,7 @@ import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
|
|
|
5
5
|
import { useOverlayController } from "../../lib/controller/overlay/useOverlayController.mjs";
|
|
6
6
|
import { Popover } from "../Popover/Popover.mjs";
|
|
7
7
|
import { useFieldComponent } from "../../lib/hooks/useFieldComponent.mjs";
|
|
8
|
+
import { useControlledHostValueProps } from "../../lib/remote/useControlledHostValueProps.mjs";
|
|
8
9
|
import { DateInput } from "./components/DateInput/DateInput.mjs";
|
|
9
10
|
import { Calendar } from "../Calendar/Calendar.mjs";
|
|
10
11
|
import DatePicker_module_default from "./DatePicker.module.mjs";
|
|
@@ -15,7 +16,7 @@ import * as Aria from "react-aria-components";
|
|
|
15
16
|
//#region src/components/DatePicker/DatePicker.tsx
|
|
16
17
|
/** @flr-generate all */
|
|
17
18
|
var DatePicker = flowComponent("DatePicker", (props) => {
|
|
18
|
-
const { children, className, onChange, ref, ...rest } = props;
|
|
19
|
+
const { children, className, onChange, ref, ...rest } = useControlledHostValueProps(props, null);
|
|
19
20
|
const popoverController = useOverlayController("Popover", { reuseControllerFromContext: false });
|
|
20
21
|
const { FieldErrorView, FieldErrorCaptureContext, wrapperProps, controlProps, fieldPropsContext } = useFieldComponent(props, "DatePicker");
|
|
21
22
|
const rootClassName = clsx(wrapperProps.className, className);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.mjs","names":[],"sources":["../../../../../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { DateInput } from \"./components/DateInput\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { Calendar } from \"@/components/Calendar\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./DatePicker.module.scss\";\n\nexport interface DatePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DatePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const DatePicker = flowComponent(\"DatePicker\", (props) => {\n const { children, className, onChange, ref, ...rest }
|
|
1
|
+
{"version":3,"file":"DatePicker.mjs","names":[],"sources":["../../../../../../../src/components/DatePicker/DatePicker.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport clsx from \"clsx\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport * as Aria from \"react-aria-components\";\nimport { DateInput } from \"./components/DateInput\";\nimport { Popover } from \"@/components/Popover/Popover\";\nimport { useOverlayController } from \"@/lib/controller\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { Calendar } from \"@/components/Calendar\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport styles from \"./DatePicker.module.scss\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\n\nexport interface DatePickerProps<T extends Aria.DateValue = Aria.DateValue>\n extends\n PropsWithChildren<Omit<Aria.DatePickerProps<T>, \"children\" | \"ref\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const DatePicker = flowComponent(\"DatePicker\", (props) => {\n // `null` is what react-aria's date picker state uses for \"no date\"\n const { children, className, onChange, ref, ...rest } =\n useControlledHostValueProps(props, null);\n\n const popoverController = useOverlayController(\"Popover\", {\n reuseControllerFromContext: false,\n });\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n wrapperProps,\n controlProps,\n fieldPropsContext,\n } = useFieldComponent(props, \"DatePicker\");\n\n const rootClassName = clsx(wrapperProps.className, className);\n\n return (\n <Aria.DatePicker\n {...rest}\n {...controlProps}\n className={rootClassName}\n onOpenChange={(v) => popoverController.setOpen(v)}\n isOpen={popoverController.isOpen}\n onChange={(value) => {\n if (onChange) {\n onChange(value);\n }\n popoverController.close();\n }}\n >\n <FieldErrorCaptureContext>\n <DateInput isDisabled={props.isDisabled} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n <Popover\n placement=\"bottom end\"\n isDialogContent\n controller={popoverController}\n >\n <Calendar className={styles.calendar} />\n </Popover>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.DatePicker>\n );\n});\n\nexport default DatePicker;\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,IAAa,aAAa,cAAc,eAAe,UAAU;CAE/D,MAAM,EAAE,UAAU,WAAW,UAAU,KAAK,GAAG,SAC7C,4BAA4B,OAAO,IAAI;CAEzC,MAAM,oBAAoB,qBAAqB,WAAW,EACxD,4BAA4B,MAC9B,CAAC;CACD,MAAM,EACJ,gBACA,0BACA,cACA,cACA,sBACE,kBAAkB,OAAO,YAAY;CAEzC,MAAM,gBAAgB,KAAK,aAAa,WAAW,SAAS;CAE5D,OACE,qBAAC,KAAK,YAAN;EACE,GAAI;EACJ,GAAI;EACJ,WAAW;EACX,eAAe,MAAM,kBAAkB,QAAQ,CAAC;EAChD,QAAQ,kBAAkB;EAC1B,WAAW,UAAU;GACnB,IAAI,UACF,SAAS,KAAK;GAEhB,kBAAkB,MAAM;EAC1B;EAXF,UAAA,CAaE,qBAAC,0BAAD,EAAA,UAAA;GACE,oBAAC,WAAD;IAAW,YAAY,MAAM;IAAiB;GAAM,CAAA;GACpD,oBAAC,sBAAD;IAAsB,OAAO;IAC1B;GACmB,CAAA;GACtB,oBAAC,SAAD;IACE,WAAU;IACV,iBAAA;IACA,YAAY;IAEZ,UAAA,oBAAC,UAAD,EAAU,WAAW,0BAAO,SAAW,CAAA;GAChC,CAAA;EACe,EAAA,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACF;;AAErB,CAAC"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { PropsContextProvider } from "../../lib/propsContext/components/PropsContextProvider.mjs";
|
|
4
4
|
import { flowComponent } from "../../lib/componentFactory/flowComponent.mjs";
|
|
5
5
|
import { useFieldComponent } from "../../lib/hooks/useFieldComponent.mjs";
|
|
6
|
+
import { useControlledHostValueProps } from "../../lib/remote/useControlledHostValueProps.mjs";
|
|
6
7
|
import { DateInput } from "../DateInput/DateInput.mjs";
|
|
7
8
|
import TimeField_module_default from "./TimeField.module.mjs";
|
|
8
9
|
import "react";
|
|
@@ -11,7 +12,7 @@ import * as Aria from "react-aria-components";
|
|
|
11
12
|
//#region src/components/TimeField/TimeField.tsx
|
|
12
13
|
/** @flr-generate all */
|
|
13
14
|
var TimeField = flowComponent("TimeField", (props) => {
|
|
14
|
-
const { children, ref, ...rest } = props;
|
|
15
|
+
const { children, ref, ...rest } = useControlledHostValueProps(props, null);
|
|
15
16
|
const { FieldErrorView, FieldErrorCaptureContext, fieldPropsContext, wrapperProps, controlProps } = useFieldComponent(props, "TimeField");
|
|
16
17
|
return /* @__PURE__ */ jsxs(Aria.TimeField, {
|
|
17
18
|
hourCycle: 24,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeField.mjs","names":[],"sources":["../../../../../../../src/components/TimeField/TimeField.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport styles from \"./TimeField.module.scss\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport DateInput from \"@/components/DateInput\";\n\nexport interface TimeFieldProps<T extends Aria.TimeValue = Aria.TimeValue>\n extends\n PropsWithChildren<Omit<Aria.TimeFieldProps<T>, \"children\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const TimeField = flowComponent(\"TimeField\", (props) => {\n const { children, ref, ...rest } = props;\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n wrapperProps,\n controlProps,\n } = useFieldComponent(props, \"TimeField\");\n\n return (\n <Aria.TimeField\n hourCycle={24}\n {...rest}\n {...wrapperProps}\n {...controlProps}\n >\n <FieldErrorCaptureContext>\n <DateInput className={styles.dateInput} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.TimeField>\n );\n});\n\nexport default TimeField;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeField.mjs","names":[],"sources":["../../../../../../../src/components/TimeField/TimeField.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport {\n flowComponent,\n type FlowComponentProps,\n} from \"@/lib/componentFactory/flowComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport styles from \"./TimeField.module.scss\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport DateInput from \"@/components/DateInput\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\n\nexport interface TimeFieldProps<T extends Aria.TimeValue = Aria.TimeValue>\n extends\n PropsWithChildren<Omit<Aria.TimeFieldProps<T>, \"children\">>,\n FlowComponentProps<HTMLSpanElement> {}\n\n/** @flr-generate all */\nexport const TimeField = flowComponent(\"TimeField\", (props) => {\n // `null` is what react-aria's time field state uses for \"no time\"\n const { children, ref, ...rest } = useControlledHostValueProps(props, null);\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n wrapperProps,\n controlProps,\n } = useFieldComponent(props, \"TimeField\");\n\n return (\n <Aria.TimeField\n hourCycle={24}\n {...rest}\n {...wrapperProps}\n {...controlProps}\n >\n <FieldErrorCaptureContext>\n <DateInput className={styles.dateInput} ref={ref} />\n <PropsContextProvider props={fieldPropsContext}>\n {children}\n </PropsContextProvider>\n </FieldErrorCaptureContext>\n <FieldErrorView />\n </Aria.TimeField>\n );\n});\n\nexport default TimeField;\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAa,YAAY,cAAc,cAAc,UAAU;CAE7D,MAAM,EAAE,UAAU,KAAK,GAAG,SAAS,4BAA4B,OAAO,IAAI;CAE1E,MAAM,EACJ,gBACA,0BACA,mBACA,cACA,iBACE,kBAAkB,OAAO,WAAW;CAExC,OACE,qBAAC,KAAK,WAAN;EACE,WAAW;EACX,GAAI;EACJ,GAAI;EACJ,GAAI;EAJN,UAAA,CAME,qBAAC,0BAAD,EAAA,UAAA,CACE,oBAAC,WAAD;GAAW,WAAW,yBAAO;GAAgB;EAAM,CAAA,GACnD,oBAAC,sBAAD;GAAsB,OAAO;GAC1B;EACmB,CAAA,CACE,EAAA,CAAA,GAC1B,oBAAC,gBAAD,CAAiB,CAAA,CACH;;AAEpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "1.5.0-next.
|
|
3
|
+
"version": "1.5.0-next.19",
|
|
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.5.0-next.
|
|
87
|
+
"@mittwald/flow-icons": "^1.5.0-next.19",
|
|
88
88
|
"@mittwald/password-tools-js": "^3.0.0",
|
|
89
|
-
"@mittwald/react-tunnel": "^1.5.0-next.
|
|
89
|
+
"@mittwald/react-tunnel": "^1.5.0-next.19",
|
|
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,12 +139,12 @@
|
|
|
139
139
|
"@internationalized/date": "^3.12.3",
|
|
140
140
|
"@lezer/generator": "^1.8.0",
|
|
141
141
|
"@lezer/lr": "^1.4.10",
|
|
142
|
-
"@mittwald/flow-core": "1.5.0-next.
|
|
143
|
-
"@mittwald/flow-design-tokens": "1.5.0-next.
|
|
144
|
-
"@mittwald/flow-icons-base": "1.5.0-next.
|
|
142
|
+
"@mittwald/flow-core": "1.5.0-next.19",
|
|
143
|
+
"@mittwald/flow-design-tokens": "1.5.0-next.19",
|
|
144
|
+
"@mittwald/flow-icons-base": "1.5.0-next.19",
|
|
145
145
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
146
146
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
147
|
-
"@mittwald/typescript-config": "1.5.0-next.
|
|
147
|
+
"@mittwald/typescript-config": "1.5.0-next.19",
|
|
148
148
|
"@nx/storybook": "^22.7.6",
|
|
149
149
|
"@storybook/addon-a11y": "^10.5.10",
|
|
150
150
|
"@storybook/addon-actions": "^9.0.8",
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
},
|
|
197
197
|
"peerDependencies": {
|
|
198
198
|
"@internationalized/date": "^3.12.2",
|
|
199
|
-
"@mittwald/flow-icons-pro": "1.5.0-next.
|
|
199
|
+
"@mittwald/flow-icons-pro": "1.5.0-next.19",
|
|
200
200
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
201
201
|
"next": "^16.2.3",
|
|
202
202
|
"react": "^19.2.0",
|
|
@@ -220,5 +220,5 @@
|
|
|
220
220
|
"browserslist": [
|
|
221
221
|
"baseline widely available"
|
|
222
222
|
],
|
|
223
|
-
"gitHead": "
|
|
223
|
+
"gitHead": "13bc59298962dccdbfb3737dbd26caa5da05ac2a"
|
|
224
224
|
}
|