@mittwald/flow-react-components 0.1.0-alpha.312 → 0.1.0-alpha.314

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 (114) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/css/FileField.css +1 -0
  3. package/dist/js/{Accordion-B5k7dJpn.js → Accordion-C1Hd4Yhg.js} +3 -3
  4. package/dist/js/Accordion.js +1 -1
  5. package/dist/js/{Action-CiJBykBu.js → Action-CVaW6nwX.js} +1 -1
  6. package/dist/js/Action.js +1 -1
  7. package/dist/js/{ActionGroup-DqTdnFoM.js → ActionGroup-CYlqSCcw.js} +1 -1
  8. package/dist/js/ActionGroup.js +1 -1
  9. package/dist/js/Alert.js +2 -2
  10. package/dist/js/AlertBadge.js +3 -3
  11. package/dist/js/{AlertIcon-4pw8iuBh.js → AlertIcon-x0EkIx02.js} +4 -4
  12. package/dist/js/AlertIcon.js +1 -1
  13. package/dist/js/Avatar.js +1 -1
  14. package/dist/js/{Badge-Bz0TmmU0.js → Badge-DVa8WUgj.js} +4 -4
  15. package/dist/js/Badge.js +1 -1
  16. package/dist/js/Breadcrumb.js +2 -2
  17. package/dist/js/{Button-a4Hq_zmE.js → Button-DE6VQ9dh.js} +5 -5
  18. package/dist/js/Button.js +1 -1
  19. package/dist/js/{CalendarHeader-o7J1eLg1.js → CalendarHeader-B2jstCaG.js} +4 -4
  20. package/dist/js/{Checkbox-B8cVD_TG.js → Checkbox-e462Gcxe.js} +4 -4
  21. package/dist/js/Checkbox.js +1 -1
  22. package/dist/js/{CheckboxButton-COo3XHBr.js → CheckboxButton-Dd900jP_.js} +2 -2
  23. package/dist/js/CheckboxButton.js +1 -1
  24. package/dist/js/CheckboxGroup.js +3 -3
  25. package/dist/js/CodeBlock.js +1 -1
  26. package/dist/js/{Content-ytee2WFF.js → Content-70JqGVUm.js} +1 -1
  27. package/dist/js/Content.js +1 -1
  28. package/dist/js/ContextMenu.js +3 -3
  29. package/dist/js/{ContextMenuTrigger-Ciwiz8WT.js → ContextMenuTrigger-9-ZjcBHX.js} +3 -3
  30. package/dist/js/ContextualHelp.js +4 -4
  31. package/dist/js/{CopyButton-rkjTnjDf.js → CopyButton-BFEqZ49C.js} +5 -5
  32. package/dist/js/CopyButton.js +1 -1
  33. package/dist/js/CounterBadge.js +1 -1
  34. package/dist/js/DatePicker.js +7 -7
  35. package/dist/js/DateRangePicker.js +7 -7
  36. package/dist/js/{FieldDescription-Cj-qCYxv.js → FieldDescription-B-Ddf78p.js} +2 -2
  37. package/dist/js/FieldDescription.js +1 -1
  38. package/dist/js/{FieldError-BZ6oyvAN.js → FieldError-BVaFR2ma.js} +3 -3
  39. package/dist/js/FieldError.js +1 -1
  40. package/dist/js/FileField.js +89 -0
  41. package/dist/js/{Header-Bry5NM9X.js → Header-Br1rkhJ6.js} +1 -1
  42. package/dist/js/Header.js +1 -1
  43. package/dist/js/HeaderNavigation.js +1 -1
  44. package/dist/js/{Heading-pQpU1iQY.js → Heading-CqcX54zX.js} +1 -1
  45. package/dist/js/Heading.js +1 -1
  46. package/dist/js/{Icon-C3JkDOTi.js → Icon-BfcwCN3o.js} +1 -1
  47. package/dist/js/Icon.js +1 -1
  48. package/dist/js/{IconCalendar-CXEqxrD-.js → IconCalendar-ccWsxuA2.js} +1 -1
  49. package/dist/js/{IconCheck-B49auJJP.js → IconCheck-9efe3XiC.js} +1 -1
  50. package/dist/js/{IconCheckboxEmpty-CC7q-vMC.js → IconCheckboxEmpty-Bs0CrP7a.js} +1 -1
  51. package/dist/js/{IconCheckboxIndeterminate-Bc54gPFD.js → IconCheckboxIndeterminate-3gNSsTqf.js} +1 -1
  52. package/dist/js/{IconChevronDown-Cr-rCT6d.js → IconChevronDown-CWsSkSGM.js} +1 -1
  53. package/dist/js/{IconChevronRight-35lfOS6U.js → IconChevronRight-BLOjuhl6.js} +1 -1
  54. package/dist/js/{IconChevronUp-DI1A2wmc.js → IconChevronUp-CSRcs7AO.js} +1 -1
  55. package/dist/js/{IconClose-GXU9h7Kw.js → IconClose-B2ipDX0n.js} +1 -1
  56. package/dist/js/{IconContextMenu-BpfOb36j.js → IconContextMenu-6NUAywWg.js} +1 -1
  57. package/dist/js/{IconCopy-D3-038qg.js → IconCopy-BOZJbtQQ.js} +1 -1
  58. package/dist/js/{IconDanger-m38r1QkL.js → IconDanger-Sd6GDwJr.js} +1 -1
  59. package/dist/js/{IconExternalLink-QotyR7i7.js → IconExternalLink-CVgF9tvS.js} +1 -1
  60. package/dist/js/{IconInfo-CmzJdfyz.js → IconInfo-DUenEWxh.js} +1 -1
  61. package/dist/js/{IconPending-CfmgrRZl.js → IconPending-D7nE29ku.js} +1 -1
  62. package/dist/js/{IconPlus-CYExXr8n.js → IconPlus-B2Z6OcJP.js} +1 -1
  63. package/dist/js/{IconRadioOn-BQIVoyg4.js → IconRadioOn-D3RQ1Tzv.js} +1 -1
  64. package/dist/js/{IconSearch-ph_8JDDS.js → IconSearch-DycBMt9i.js} +1 -1
  65. package/dist/js/{IconSucceeded-BHReEzlW.js → IconSucceeded-BrUEf3-W.js} +1 -1
  66. package/dist/js/{IconView-BvWozvJX.js → IconView-BJdqngyQ.js} +1 -1
  67. package/dist/js/{IconWarning-BSzhRWnw.js → IconWarning-BuEvJJgg.js} +1 -1
  68. package/dist/js/Icons.js +21 -21
  69. package/dist/js/Image.js +1 -1
  70. package/dist/js/Initials.js +1 -1
  71. package/dist/js/{Label-BvdZBeD-.js → Label-BNcY7JBl.js} +1 -1
  72. package/dist/js/Label.js +1 -1
  73. package/dist/js/LayoutCard.js +1 -1
  74. package/dist/js/{Link-tZe6DMG9.js → Link-DBtH1rcE.js} +3 -3
  75. package/dist/js/Link.js +1 -1
  76. package/dist/js/List.js +14 -14
  77. package/dist/js/{LoadingSpinner-CAmMgo37.js → LoadingSpinner-BNwuXpm9.js} +2 -2
  78. package/dist/js/LoadingSpinner.js +1 -1
  79. package/dist/js/{MenuItem-DljCXugV.js → MenuItem-DRNpILEl.js} +5 -5
  80. package/dist/js/MenuItem.js +1 -1
  81. package/dist/js/Modal.js +6 -6
  82. package/dist/js/Navigation.js +2 -2
  83. package/dist/js/Notification.js +5 -5
  84. package/dist/js/NumberField.js +7 -7
  85. package/dist/js/{Popover-C4jNPNSb.js → Popover-BJryd_iR.js} +1 -1
  86. package/dist/js/Popover.js +2 -2
  87. package/dist/js/RadioGroup.js +4 -4
  88. package/dist/js/{SearchField-Bg9uM0FY.js → SearchField-8LwOlGa0.js} +6 -6
  89. package/dist/js/SearchField.js +1 -1
  90. package/dist/js/{Section-DA5veGmg.js → Section-D1KKijDG.js} +1 -1
  91. package/dist/js/Section.js +1 -1
  92. package/dist/js/SegmentedControl.js +4 -4
  93. package/dist/js/Select.js +5 -5
  94. package/dist/js/Slider.js +4 -4
  95. package/dist/js/Switch.js +5 -5
  96. package/dist/js/Tabs.js +7 -7
  97. package/dist/js/{Text-CtABaZjp.js → Text-CPD7mr9M.js} +1 -1
  98. package/dist/js/Text.js +1 -1
  99. package/dist/js/TextArea.js +2 -2
  100. package/dist/js/TextField.js +2 -2
  101. package/dist/js/{TextFieldBase-CjA7G_xB.js → TextFieldBase-CuecrgoE.js} +2 -2
  102. package/dist/js/TimeField.js +2 -2
  103. package/dist/js/all.css +1 -1
  104. package/dist/js/{flowComponent-E-Gp2Toe.js → flowComponent-CdFTojQw.js} +9 -8
  105. package/dist/js/react-hook-form.js +8 -7
  106. package/dist/js/types/components/FileField/FileField.d.ts +8 -0
  107. package/dist/js/types/components/FileField/components/FileInput.d.ts +1 -0
  108. package/dist/js/types/components/FileField/index.d.ts +3 -0
  109. package/dist/js/types/components/FileField/stories/Default.stories.d.ts +11 -0
  110. package/dist/js/types/components/propTypes/index.d.ts +2 -0
  111. package/dist/js/types/lib/controller/overlay/context.d.ts +1 -0
  112. package/dist/js/types/lib/propsContext/propsContext.d.ts +2 -0
  113. package/dist/js/types/lib/slotContext/slotContext.d.ts +1 -0
  114. package/package.json +11 -4
@@ -31,6 +31,7 @@ const k = {
31
31
  DateRangePicker: !0,
32
32
  FieldDescription: !0,
33
33
  FieldError: !0,
34
+ FileField: !0,
34
35
  Header: !0,
35
36
  Heading: !0,
36
37
  Icon: !0,
@@ -74,33 +75,33 @@ function a(t) {
74
75
  function d(t) {
75
76
  return typeof t == "string" && l.includes(t);
76
77
  }
77
- function A(t) {
78
+ function F(t) {
78
79
  return !d(t);
79
80
  }
80
- const B = (t, o) => {
81
+ const A = (t, o) => {
81
82
  const r = {};
82
83
  for (const e in t)
83
- if (A(e)) {
84
+ if (F(e)) {
84
85
  const n = t[e];
85
86
  a(n) && (r[e] = n.__dynamicProp(o));
86
87
  }
87
88
  return r;
88
89
  };
89
- function w(t) {
90
+ function B(t) {
90
91
  return !!t && typeof t == "object" && "children" in t && !!t.children;
91
92
  }
92
- const F = (t) => v(t, (o, r) => d(r)), I = (t, o) => {
93
- if (!w(o))
93
+ const w = (t) => v(t, (o, r) => d(r)), I = (t, o) => {
94
+ if (!B(o))
94
95
  return {};
95
96
  const r = o.children;
96
97
  if (!Array.isArray(r) && !x(r))
97
98
  return {};
98
- const e = F(t);
99
+ const e = w(t);
99
100
  return Object.keys(e).length === 0 ? {} : {
100
101
  children: /* @__PURE__ */ s.createElement(b, { props: e, mergeInParentContext: !0 }, r)
101
102
  };
102
103
  }, M = (t, o) => {
103
- const e = h()[t], n = e ? B(e, o) : void 0, i = e ? I(e, o) : void 0;
104
+ const e = h()[t], n = e ? A(e, o) : void 0, i = e ? I(e, o) : void 0;
104
105
  return T(
105
106
  e && S(
106
107
  e,
@@ -1,15 +1,15 @@
1
1
  "use client"
2
2
  /* */
3
- import n, { createContext as F, useContext as v, useEffect as S, useRef as k } from "react";
3
+ import n, { createContext as x, useContext as v, useEffect as S, useRef as k } from "react";
4
4
  import { Controller as g, useFormState as h } from "react-hook-form";
5
5
  import "./propsContext-DzAKlmhS.js";
6
6
  import { PropsContextProvider as b } from "./PropsContextProvider.js";
7
7
  import "@react-aria/utils";
8
8
  import "remeda";
9
- import { d as C } from "./dynamic-ClpUSmEt.js";
10
- import { F as A } from "./FieldError-BZ6oyvAN.js";
11
- import { a as P, A as y } from "./Action-CiJBykBu.js";
12
- const E = F({}), V = E.Provider, f = () => v(E);
9
+ import { d as F } from "./dynamic-ClpUSmEt.js";
10
+ import { F as A } from "./FieldError-BVaFR2ma.js";
11
+ import { a as P, A as y } from "./Action-CVaW6nwX.js";
12
+ const C = x({}), V = C.Provider, f = () => v(C);
13
13
  function D(t) {
14
14
  var i;
15
15
  const { children: r, control: o, ...s } = t, l = (i = f().form) == null ? void 0 : i.control;
@@ -28,13 +28,14 @@ function D(t) {
28
28
  isRequired: !!((p = s.rules) != null && p.required),
29
29
  isInvalid: m,
30
30
  validationBehavior: "aria",
31
- children: C((x) => /* @__PURE__ */ n.createElement(n.Fragment, null, x.children, /* @__PURE__ */ n.createElement(A, null, u == null ? void 0 : u.message))),
31
+ children: F((E) => /* @__PURE__ */ n.createElement(n.Fragment, null, E.children, /* @__PURE__ */ n.createElement(A, null, u == null ? void 0 : u.message))),
32
32
  ref: void 0,
33
33
  refProp: c.ref
34
34
  }, d = {
35
35
  Checkbox: e,
36
36
  CheckboxGroup: e,
37
37
  CheckboxButton: e,
38
+ FileField: e,
38
39
  NumberField: e,
39
40
  RadioGroup: e,
40
41
  Switch: e,
@@ -81,7 +82,7 @@ const _ = (t) => D, I = (t) => {
81
82
  }, T = (t) => {
82
83
  const { children: r, isAsyncSubmit: o } = t, s = {
83
84
  ActionGroup: {
84
- children: C((l) => /* @__PURE__ */ n.createElement(R, { isAsyncSubmit: o }, l.children))
85
+ children: F((l) => /* @__PURE__ */ n.createElement(R, { isAsyncSubmit: o }, l.children))
85
86
  }
86
87
  };
87
88
  return /* @__PURE__ */ n.createElement(b, { props: s, mergeInParentContext: !0 }, r);
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren, default as React } from 'react';
2
+ import { FileInputOnChangeHandler } from './components/FileInput';
3
+ import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
4
+ import type * as Aria from "react-aria-components";
5
+ export interface FileFieldProps extends PropsWithChildren, FlowComponentProps, Pick<Aria.InputProps, "accept" | "multiple" | "name">, Pick<Aria.TextFieldProps, "isRequired" | "isInvalid" | "validationBehavior" | "isDisabled"> {
6
+ onChange?: FileInputOnChangeHandler;
7
+ }
8
+ export declare const FileField: React.ForwardRefExoticComponent<FileFieldProps & React.RefAttributes<never>>;
@@ -0,0 +1 @@
1
+ export type FileInputOnChangeHandler = (files: FileList | null) => void;
@@ -0,0 +1,3 @@
1
+ import { FileField } from './FileField';
2
+ export { FileField, type FileFieldProps } from './FileField';
3
+ export default FileField;
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { FileField } from '..';
3
+ declare const meta: Meta<typeof FileField>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof FileField>;
6
+ export declare const Default: Story;
7
+ export declare const WithDescription: Story;
8
+ export declare const WithError: Story;
9
+ export declare const IconButton: Story;
10
+ export declare const WithHandler: Story;
11
+ export declare const WithReactHookForm: Story;
@@ -47,6 +47,7 @@ import { AlertIconProps } from '../AlertIcon';
47
47
  import { ListSummaryProps } from '../List/components/ListSummary/ListSummary';
48
48
  import { SegmentedControlProps } from '../SegmentedControl';
49
49
  import { SegmentProps } from 'src/components/SegmentedControl/components/Segment';
50
+ import { FileFieldProps } from '../FileField';
50
51
  import type * as Aria from "react-aria-components";
51
52
  export * from './types';
52
53
  export interface FlowComponentPropsTypes {
@@ -73,6 +74,7 @@ export interface FlowComponentPropsTypes {
73
74
  DateRangePicker: DateRangePickerProps<Aria.DateValue>;
74
75
  FieldDescription: FieldDescriptionProps;
75
76
  FieldError: FieldErrorProps;
77
+ FileField: FileFieldProps;
76
78
  Header: HeaderProps;
77
79
  Heading: HeadingProps;
78
80
  Icon: IconProps;
@@ -27,6 +27,7 @@ export declare const overlayContext: import('react').Context<Partial<{
27
27
  DateRangePicker: OverlayController | undefined;
28
28
  FieldDescription: OverlayController | undefined;
29
29
  FieldError: OverlayController | undefined;
30
+ FileField: OverlayController | undefined;
30
31
  Header: OverlayController | undefined;
31
32
  Heading: OverlayController | undefined;
32
33
  Icon: OverlayController | undefined;
@@ -23,6 +23,7 @@ export declare const propsContext: import('react').Context<Partial<{
23
23
  DateRangePicker: import('./types').ComponentPropsContext<"DateRangePicker">;
24
24
  FieldDescription: import('./types').ComponentPropsContext<"FieldDescription">;
25
25
  FieldError: import('./types').ComponentPropsContext<"FieldError">;
26
+ FileField: import('./types').ComponentPropsContext<"FileField">;
26
27
  Header: import('./types').ComponentPropsContext<"Header">;
27
28
  Heading: import('./types').ComponentPropsContext<"Heading">;
28
29
  Icon: import('./types').ComponentPropsContext<"Icon">;
@@ -82,6 +83,7 @@ export declare const PropsContextProvider: import('react').Provider<Partial<{
82
83
  DateRangePicker: import('./types').ComponentPropsContext<"DateRangePicker">;
83
84
  FieldDescription: import('./types').ComponentPropsContext<"FieldDescription">;
84
85
  FieldError: import('./types').ComponentPropsContext<"FieldError">;
86
+ FileField: import('./types').ComponentPropsContext<"FileField">;
85
87
  Header: import('./types').ComponentPropsContext<"Header">;
86
88
  Heading: import('./types').ComponentPropsContext<"Heading">;
87
89
  Icon: import('./types').ComponentPropsContext<"Icon">;
@@ -23,6 +23,7 @@ export declare const slotContext: import('react').Context<Partial<{
23
23
  DateRangePicker: string;
24
24
  FieldDescription: string;
25
25
  FieldError: string;
26
+ FileField: string;
26
27
  Header: string;
27
28
  Heading: string;
28
29
  Icon: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.1.0-alpha.312",
3
+ "version": "0.1.0-alpha.314",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
@@ -131,6 +131,11 @@
131
131
  "types": "./dist/js/types/components/FieldError/index.d.ts",
132
132
  "import": "./dist/js/FieldError.js"
133
133
  },
134
+ "./FileField/styles.css": "./dist/css/FileField.css",
135
+ "./FileField": {
136
+ "types": "./dist/js/types/components/FileField/index.d.ts",
137
+ "import": "./dist/js/FileField.js"
138
+ },
134
139
  "./Header/styles.css": "./dist/css/Header.css",
135
140
  "./Header": {
136
141
  "types": "./dist/js/types/components/Header/index.d.ts",
@@ -391,9 +396,11 @@
391
396
  "@chakra-ui/live-region": "^2.1.0",
392
397
  "@internationalized/date": "^3.5.6",
393
398
  "@internationalized/string-compiler": "^3.2.5",
394
- "@mittwald/react-tunnel": "^0.1.0-alpha.312",
399
+ "@mittwald/react-tunnel": "^0.1.0-alpha.314",
395
400
  "@mittwald/react-use-promise": "^2.5.0",
401
+ "@react-aria/form": "^3.0.10",
396
402
  "@react-aria/utils": "^3.25.3",
403
+ "@react-stately/form": "^3.0.6",
397
404
  "@react-types/shared": "^3.25.0",
398
405
  "@tabler/icons-react": "^3.19.0",
399
406
  "@tanstack/react-table": "^8.20.5",
@@ -419,7 +426,7 @@
419
426
  },
420
427
  "devDependencies": {
421
428
  "@faker-js/faker": "^9.0.3",
422
- "@mittwald/flow-design-tokens": "^0.1.0-alpha.312",
429
+ "@mittwald/flow-design-tokens": "^0.1.0-alpha.314",
423
430
  "@mittwald/react-use-promise": "^2.5.0",
424
431
  "@nx/storybook": "^20.0.0",
425
432
  "@storybook/addon-a11y": "^8.3.5",
@@ -514,5 +521,5 @@
514
521
  }
515
522
  }
516
523
  },
517
- "gitHead": "a403e913511d45131266c2ababd62e9768362c59"
524
+ "gitHead": "1dfabddca1406bb7baa5c39e217e81e936288c00"
518
525
  }