@mittwald/flow-react-components 0.2.0-alpha.83 → 0.2.0-alpha.84

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.
@@ -22,7 +22,7 @@ import { IconPlus } from '../Icon/components/icons/IconPlus.mjs';
22
22
  const NumberField = flowComponent(
23
23
  "NumberField",
24
24
  (props) => {
25
- const { children, className, ref, ...rest } = props;
25
+ const { children, className, ref, isWheelDisabled = true, ...rest } = props;
26
26
  const rootClassName = clsx(formFieldStyles.formField, className);
27
27
  const propsContext = {
28
28
  Label: {
@@ -36,41 +36,49 @@ const NumberField = flowComponent(
36
36
  className: formFieldStyles.customFieldError
37
37
  }
38
38
  };
39
- return /* @__PURE__ */ jsx(ClearPropsContext, { children: /* @__PURE__ */ jsxs(Aria.NumberField, { ...rest, className: rootClassName, children: [
40
- /* @__PURE__ */ jsxs(Aria.Group, { className: styles.group, children: [
41
- /* @__PURE__ */ jsxs(
42
- Button,
43
- {
44
- ariaSlot: "decrement",
45
- className: styles.decrementButton,
46
- size: "s",
47
- variant: "plain",
48
- color: "secondary",
49
- children: [
50
- /* @__PURE__ */ jsx(IconChevronDown, {}),
51
- /* @__PURE__ */ jsx(IconMinus, { className: styles.coarsePointerIcon })
52
- ]
53
- }
54
- ),
55
- /* @__PURE__ */ jsx(Aria.Input, { className: styles.input, ref }),
56
- /* @__PURE__ */ jsxs(
57
- Button,
58
- {
59
- ariaSlot: "increment",
60
- className: styles.incrementButton,
61
- size: "s",
62
- variant: "plain",
63
- color: "secondary",
64
- children: [
65
- /* @__PURE__ */ jsx(IconChevronUp, {}),
66
- /* @__PURE__ */ jsx(IconPlus, { className: styles.coarsePointerIcon })
67
- ]
68
- }
69
- )
70
- ] }),
71
- /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, children }),
72
- /* @__PURE__ */ jsx(FieldError, { className: formFieldStyles.fieldError })
73
- ] }) });
39
+ return /* @__PURE__ */ jsx(ClearPropsContext, { children: /* @__PURE__ */ jsxs(
40
+ Aria.NumberField,
41
+ {
42
+ isWheelDisabled,
43
+ ...rest,
44
+ className: rootClassName,
45
+ children: [
46
+ /* @__PURE__ */ jsxs(Aria.Group, { className: styles.group, children: [
47
+ /* @__PURE__ */ jsxs(
48
+ Button,
49
+ {
50
+ ariaSlot: "decrement",
51
+ className: styles.decrementButton,
52
+ size: "s",
53
+ variant: "plain",
54
+ color: "secondary",
55
+ children: [
56
+ /* @__PURE__ */ jsx(IconChevronDown, {}),
57
+ /* @__PURE__ */ jsx(IconMinus, { className: styles.coarsePointerIcon })
58
+ ]
59
+ }
60
+ ),
61
+ /* @__PURE__ */ jsx(Aria.Input, { className: styles.input, ref }),
62
+ /* @__PURE__ */ jsxs(
63
+ Button,
64
+ {
65
+ ariaSlot: "increment",
66
+ className: styles.incrementButton,
67
+ size: "s",
68
+ variant: "plain",
69
+ color: "secondary",
70
+ children: [
71
+ /* @__PURE__ */ jsx(IconChevronUp, {}),
72
+ /* @__PURE__ */ jsx(IconPlus, { className: styles.coarsePointerIcon })
73
+ ]
74
+ }
75
+ )
76
+ ] }),
77
+ /* @__PURE__ */ jsx(PropsContextProvider, { props: propsContext, children }),
78
+ /* @__PURE__ */ jsx(FieldError, { className: formFieldStyles.fieldError })
79
+ ]
80
+ }
81
+ ) });
74
82
  }
75
83
  );
76
84
 
@@ -1 +1 @@
1
- {"version":3,"file":"NumberField.mjs","sources":["../../../../src/components/NumberField/NumberField.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport formFieldStyles from \"../FormField/FormField.module.scss\";\nimport styles from \"./NumberField.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport ClearPropsContext from \"@/components/ClearPropsContext/ClearPropsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { FieldError } from \"@/components/FieldError\";\nimport { Button } from \"@/components/Button\";\nimport {\n IconChevronDown,\n IconChevronUp,\n IconMinus,\n IconPlus,\n} from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\n\nexport interface NumberFieldProps\n extends PropsWithChildren<Omit<Aria.NumberFieldProps, \"children\">>,\n FlowComponentProps {}\n\n/**\n * @flr-generate all\n * @flr-clear-props-context\n */\nexport const NumberField = flowComponent<\"NumberField\", HTMLInputElement>(\n \"NumberField\",\n (props) => {\n const { children, className, ref, ...rest } = props;\n\n const rootClassName = clsx(formFieldStyles.formField, className);\n\n const propsContext: PropsContext = {\n Label: {\n className: formFieldStyles.label,\n optional: !props.isRequired,\n },\n FieldDescription: {\n className: formFieldStyles.fieldDescription,\n },\n FieldError: {\n className: formFieldStyles.customFieldError,\n },\n };\n\n return (\n <ClearPropsContext>\n <Aria.NumberField {...rest} className={rootClassName}>\n <Aria.Group className={styles.group}>\n <Button\n ariaSlot=\"decrement\"\n className={styles.decrementButton}\n size=\"s\"\n variant=\"plain\"\n color=\"secondary\"\n >\n <IconChevronDown />\n <IconMinus className={styles.coarsePointerIcon} />\n </Button>\n <Aria.Input className={styles.input} ref={ref} />\n <Button\n ariaSlot=\"increment\"\n className={styles.incrementButton}\n size=\"s\"\n variant=\"plain\"\n color=\"secondary\"\n >\n <IconChevronUp />\n <IconPlus className={styles.coarsePointerIcon} />\n </Button>\n </Aria.Group>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n <FieldError className={formFieldStyles.fieldError} />\n </Aria.NumberField>\n </ClearPropsContext>\n );\n },\n);\n\nexport default NumberField;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AA4BO,MAAM,WAAc,GAAA,aAAA;AAAA,EACzB,aAAA;AAAA,EACA,CAAC,KAAU,KAAA;AACT,IAAA,MAAM,EAAE,QAAU,EAAA,SAAA,EAAW,GAAK,EAAA,GAAG,MAAS,GAAA,KAAA;AAE9C,IAAA,MAAM,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OAAA;AAAA,YACR,KAAM,EAAA,WAAA;AAAA,YAEN,QAAA,EAAA;AAAA,8BAAA,GAAA,CAAC,aAAc,EAAA,EAAA,CAAA;AAAA,8BACd,GAAA,CAAA,QAAA,EAAA,EAAS,SAAW,EAAA,MAAA,CAAO,iBAAmB,EAAA;AAAA;AAAA;AAAA;AACjD,OACF,EAAA,CAAA;AAAA,sBACC,GAAA,CAAA,oBAAA,EAAA,EAAqB,KAAO,EAAA,YAAA,EAC1B,QACH,EAAA,CAAA;AAAA,sBACC,GAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,eAAA,CAAgB,UAAY,EAAA;AAAA,KAAA,EACrD,CACF,EAAA,CAAA;AAAA;AAGN;;;;"}
1
+ {"version":3,"file":"NumberField.mjs","sources":["../../../../src/components/NumberField/NumberField.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport React from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport formFieldStyles from \"../FormField/FormField.module.scss\";\nimport styles from \"./NumberField.module.scss\";\nimport clsx from \"clsx\";\nimport type { PropsContext } from \"@/lib/propsContext\";\nimport ClearPropsContext from \"@/components/ClearPropsContext/ClearPropsContext\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport { FieldError } from \"@/components/FieldError\";\nimport { Button } from \"@/components/Button\";\nimport {\n IconChevronDown,\n IconChevronUp,\n IconMinus,\n IconPlus,\n} from \"@/components/Icon/components/icons\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\n\nexport interface NumberFieldProps\n extends PropsWithChildren<Omit<Aria.NumberFieldProps, \"children\">>,\n FlowComponentProps {}\n\n/**\n * @flr-generate all\n * @flr-clear-props-context\n */\nexport const NumberField = flowComponent<\"NumberField\", HTMLInputElement>(\n \"NumberField\",\n (props) => {\n const { children, className, ref, isWheelDisabled = true, ...rest } = props;\n\n const rootClassName = clsx(formFieldStyles.formField, className);\n\n const propsContext: PropsContext = {\n Label: {\n className: formFieldStyles.label,\n optional: !props.isRequired,\n },\n FieldDescription: {\n className: formFieldStyles.fieldDescription,\n },\n FieldError: {\n className: formFieldStyles.customFieldError,\n },\n };\n\n return (\n <ClearPropsContext>\n <Aria.NumberField\n isWheelDisabled={isWheelDisabled}\n {...rest}\n className={rootClassName}\n >\n <Aria.Group className={styles.group}>\n <Button\n ariaSlot=\"decrement\"\n className={styles.decrementButton}\n size=\"s\"\n variant=\"plain\"\n color=\"secondary\"\n >\n <IconChevronDown />\n <IconMinus className={styles.coarsePointerIcon} />\n </Button>\n <Aria.Input className={styles.input} ref={ref} />\n <Button\n ariaSlot=\"increment\"\n className={styles.incrementButton}\n size=\"s\"\n variant=\"plain\"\n color=\"secondary\"\n >\n <IconChevronUp />\n <IconPlus className={styles.coarsePointerIcon} />\n </Button>\n </Aria.Group>\n <PropsContextProvider props={propsContext}>\n {children}\n </PropsContextProvider>\n <FieldError className={formFieldStyles.fieldError} />\n </Aria.NumberField>\n </ClearPropsContext>\n );\n },\n);\n\nexport default NumberField;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AA4BO,MAAM,WAAc,GAAA,aAAA;AAAA,EACzB,aAAA;AAAA,EACA,CAAC,KAAU,KAAA;AACT,IAAM,MAAA,EAAE,UAAU,SAAW,EAAA,GAAA,EAAK,kBAAkB,IAAM,EAAA,GAAG,MAAS,GAAA,KAAA;AAEtE,IAAA,MAAM,aAAgB,GAAA,IAAA,CAAK,eAAgB,CAAA,SAAA,EAAW,SAAS,CAAA;AAE/D,IAAA,MAAM,YAA6B,GAAA;AAAA,MACjC,KAAO,EAAA;AAAA,QACL,WAAW,eAAgB,CAAA,KAAA;AAAA,QAC3B,QAAA,EAAU,CAAC,KAAM,CAAA;AAAA,OACnB;AAAA,MACA,gBAAkB,EAAA;AAAA,QAChB,WAAW,eAAgB,CAAA;AAAA,OAC7B;AAAA,MACA,UAAY,EAAA;AAAA,QACV,WAAW,eAAgB,CAAA;AAA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B,KAAO,EAAA,YAAA,EAC1B,QACH,EAAA,CAAA;AAAA,0BACC,GAAA,CAAA,UAAA,EAAA,EAAW,SAAW,EAAA,eAAA,CAAgB,UAAY,EAAA;AAAA;AAAA;AAAA,KAEvD,EAAA,CAAA;AAAA;AAGN;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../src/components/NumberField/NumberField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAe9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,MAAM,WAAW,gBACf,SAAQ,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC,EAChE,kBAAkB;CAAG;AAEzB;;;GAGG;AACH,eAAO,MAAM,WAAW,mFAsDvB,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../src/components/NumberField/NumberField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAe9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,MAAM,WAAW,gBACf,SAAQ,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC,EAChE,kBAAkB;CAAG;AAEzB;;;GAGG;AACH,eAAO,MAAM,WAAW,mFA0DvB,CAAC;AAEF,eAAe,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.2.0-alpha.83",
3
+ "version": "0.2.0-alpha.84",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -52,7 +52,7 @@
52
52
  "dependencies": {
53
53
  "@chakra-ui/live-region": "^2.1.0",
54
54
  "@internationalized/string-compiler": "^3.2.6",
55
- "@mittwald/react-tunnel": "0.2.0-alpha.83",
55
+ "@mittwald/react-tunnel": "0.2.0-alpha.84",
56
56
  "@mittwald/react-use-promise": "^2.6.0",
57
57
  "@react-aria/form": "^3.0.12",
58
58
  "@react-aria/utils": "^3.27.0",
@@ -91,7 +91,7 @@
91
91
  "@faker-js/faker": "^9.5.0",
92
92
  "@internationalized/date": "^3.7.0",
93
93
  "@mfalkenberg/remote-dom-react": "^1.2.2",
94
- "@mittwald/flow-design-tokens": "0.2.0-alpha.83",
94
+ "@mittwald/flow-design-tokens": "0.2.0-alpha.84",
95
95
  "@mittwald/react-use-promise": "^2.6.0",
96
96
  "@mittwald/typescript-config": "",
97
97
  "@nx/storybook": "^20.4.5",
@@ -168,5 +168,5 @@
168
168
  "optional": true
169
169
  }
170
170
  },
171
- "gitHead": "7e5e63d05b21b737008eda838cbfb93e2d80ea3d"
171
+ "gitHead": "35c4cb5ae49bcb37c70657be58358ef5a380eb47"
172
172
  }