@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.
- package/CHANGELOG.md +21 -0
- package/dist/css/FileField.css +1 -0
- package/dist/js/{Accordion-B5k7dJpn.js → Accordion-C1Hd4Yhg.js} +3 -3
- package/dist/js/Accordion.js +1 -1
- package/dist/js/{Action-CiJBykBu.js → Action-CVaW6nwX.js} +1 -1
- package/dist/js/Action.js +1 -1
- package/dist/js/{ActionGroup-DqTdnFoM.js → ActionGroup-CYlqSCcw.js} +1 -1
- package/dist/js/ActionGroup.js +1 -1
- package/dist/js/Alert.js +2 -2
- package/dist/js/AlertBadge.js +3 -3
- package/dist/js/{AlertIcon-4pw8iuBh.js → AlertIcon-x0EkIx02.js} +4 -4
- package/dist/js/AlertIcon.js +1 -1
- package/dist/js/Avatar.js +1 -1
- package/dist/js/{Badge-Bz0TmmU0.js → Badge-DVa8WUgj.js} +4 -4
- package/dist/js/Badge.js +1 -1
- package/dist/js/Breadcrumb.js +2 -2
- package/dist/js/{Button-a4Hq_zmE.js → Button-DE6VQ9dh.js} +5 -5
- package/dist/js/Button.js +1 -1
- package/dist/js/{CalendarHeader-o7J1eLg1.js → CalendarHeader-B2jstCaG.js} +4 -4
- package/dist/js/{Checkbox-B8cVD_TG.js → Checkbox-e462Gcxe.js} +4 -4
- package/dist/js/Checkbox.js +1 -1
- package/dist/js/{CheckboxButton-COo3XHBr.js → CheckboxButton-Dd900jP_.js} +2 -2
- package/dist/js/CheckboxButton.js +1 -1
- package/dist/js/CheckboxGroup.js +3 -3
- package/dist/js/CodeBlock.js +1 -1
- package/dist/js/{Content-ytee2WFF.js → Content-70JqGVUm.js} +1 -1
- package/dist/js/Content.js +1 -1
- package/dist/js/ContextMenu.js +3 -3
- package/dist/js/{ContextMenuTrigger-Ciwiz8WT.js → ContextMenuTrigger-9-ZjcBHX.js} +3 -3
- package/dist/js/ContextualHelp.js +4 -4
- package/dist/js/{CopyButton-rkjTnjDf.js → CopyButton-BFEqZ49C.js} +5 -5
- package/dist/js/CopyButton.js +1 -1
- package/dist/js/CounterBadge.js +1 -1
- package/dist/js/DatePicker.js +7 -7
- package/dist/js/DateRangePicker.js +7 -7
- package/dist/js/{FieldDescription-Cj-qCYxv.js → FieldDescription-B-Ddf78p.js} +2 -2
- package/dist/js/FieldDescription.js +1 -1
- package/dist/js/{FieldError-BZ6oyvAN.js → FieldError-BVaFR2ma.js} +3 -3
- package/dist/js/FieldError.js +1 -1
- package/dist/js/FileField.js +89 -0
- package/dist/js/{Header-Bry5NM9X.js → Header-Br1rkhJ6.js} +1 -1
- package/dist/js/Header.js +1 -1
- package/dist/js/HeaderNavigation.js +1 -1
- package/dist/js/{Heading-pQpU1iQY.js → Heading-CqcX54zX.js} +1 -1
- package/dist/js/Heading.js +1 -1
- package/dist/js/{Icon-C3JkDOTi.js → Icon-BfcwCN3o.js} +1 -1
- package/dist/js/Icon.js +1 -1
- package/dist/js/{IconCalendar-CXEqxrD-.js → IconCalendar-ccWsxuA2.js} +1 -1
- package/dist/js/{IconCheck-B49auJJP.js → IconCheck-9efe3XiC.js} +1 -1
- package/dist/js/{IconCheckboxEmpty-CC7q-vMC.js → IconCheckboxEmpty-Bs0CrP7a.js} +1 -1
- package/dist/js/{IconCheckboxIndeterminate-Bc54gPFD.js → IconCheckboxIndeterminate-3gNSsTqf.js} +1 -1
- package/dist/js/{IconChevronDown-Cr-rCT6d.js → IconChevronDown-CWsSkSGM.js} +1 -1
- package/dist/js/{IconChevronRight-35lfOS6U.js → IconChevronRight-BLOjuhl6.js} +1 -1
- package/dist/js/{IconChevronUp-DI1A2wmc.js → IconChevronUp-CSRcs7AO.js} +1 -1
- package/dist/js/{IconClose-GXU9h7Kw.js → IconClose-B2ipDX0n.js} +1 -1
- package/dist/js/{IconContextMenu-BpfOb36j.js → IconContextMenu-6NUAywWg.js} +1 -1
- package/dist/js/{IconCopy-D3-038qg.js → IconCopy-BOZJbtQQ.js} +1 -1
- package/dist/js/{IconDanger-m38r1QkL.js → IconDanger-Sd6GDwJr.js} +1 -1
- package/dist/js/{IconExternalLink-QotyR7i7.js → IconExternalLink-CVgF9tvS.js} +1 -1
- package/dist/js/{IconInfo-CmzJdfyz.js → IconInfo-DUenEWxh.js} +1 -1
- package/dist/js/{IconPending-CfmgrRZl.js → IconPending-D7nE29ku.js} +1 -1
- package/dist/js/{IconPlus-CYExXr8n.js → IconPlus-B2Z6OcJP.js} +1 -1
- package/dist/js/{IconRadioOn-BQIVoyg4.js → IconRadioOn-D3RQ1Tzv.js} +1 -1
- package/dist/js/{IconSearch-ph_8JDDS.js → IconSearch-DycBMt9i.js} +1 -1
- package/dist/js/{IconSucceeded-BHReEzlW.js → IconSucceeded-BrUEf3-W.js} +1 -1
- package/dist/js/{IconView-BvWozvJX.js → IconView-BJdqngyQ.js} +1 -1
- package/dist/js/{IconWarning-BSzhRWnw.js → IconWarning-BuEvJJgg.js} +1 -1
- package/dist/js/Icons.js +21 -21
- package/dist/js/Image.js +1 -1
- package/dist/js/Initials.js +1 -1
- package/dist/js/{Label-BvdZBeD-.js → Label-BNcY7JBl.js} +1 -1
- package/dist/js/Label.js +1 -1
- package/dist/js/LayoutCard.js +1 -1
- package/dist/js/{Link-tZe6DMG9.js → Link-DBtH1rcE.js} +3 -3
- package/dist/js/Link.js +1 -1
- package/dist/js/List.js +14 -14
- package/dist/js/{LoadingSpinner-CAmMgo37.js → LoadingSpinner-BNwuXpm9.js} +2 -2
- package/dist/js/LoadingSpinner.js +1 -1
- package/dist/js/{MenuItem-DljCXugV.js → MenuItem-DRNpILEl.js} +5 -5
- package/dist/js/MenuItem.js +1 -1
- package/dist/js/Modal.js +6 -6
- package/dist/js/Navigation.js +2 -2
- package/dist/js/Notification.js +5 -5
- package/dist/js/NumberField.js +7 -7
- package/dist/js/{Popover-C4jNPNSb.js → Popover-BJryd_iR.js} +1 -1
- package/dist/js/Popover.js +2 -2
- package/dist/js/RadioGroup.js +4 -4
- package/dist/js/{SearchField-Bg9uM0FY.js → SearchField-8LwOlGa0.js} +6 -6
- package/dist/js/SearchField.js +1 -1
- package/dist/js/{Section-DA5veGmg.js → Section-D1KKijDG.js} +1 -1
- package/dist/js/Section.js +1 -1
- package/dist/js/SegmentedControl.js +4 -4
- package/dist/js/Select.js +5 -5
- package/dist/js/Slider.js +4 -4
- package/dist/js/Switch.js +5 -5
- package/dist/js/Tabs.js +7 -7
- package/dist/js/{Text-CtABaZjp.js → Text-CPD7mr9M.js} +1 -1
- package/dist/js/Text.js +1 -1
- package/dist/js/TextArea.js +2 -2
- package/dist/js/TextField.js +2 -2
- package/dist/js/{TextFieldBase-CjA7G_xB.js → TextFieldBase-CuecrgoE.js} +2 -2
- package/dist/js/TimeField.js +2 -2
- package/dist/js/all.css +1 -1
- package/dist/js/{flowComponent-E-Gp2Toe.js → flowComponent-CdFTojQw.js} +9 -8
- package/dist/js/react-hook-form.js +8 -7
- package/dist/js/types/components/FileField/FileField.d.ts +8 -0
- package/dist/js/types/components/FileField/components/FileInput.d.ts +1 -0
- package/dist/js/types/components/FileField/index.d.ts +3 -0
- package/dist/js/types/components/FileField/stories/Default.stories.d.ts +11 -0
- package/dist/js/types/components/propTypes/index.d.ts +2 -0
- package/dist/js/types/lib/controller/overlay/context.d.ts +1 -0
- package/dist/js/types/lib/propsContext/propsContext.d.ts +2 -0
- package/dist/js/types/lib/slotContext/slotContext.d.ts +1 -0
- 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
|
|
78
|
+
function F(t) {
|
|
78
79
|
return !d(t);
|
|
79
80
|
}
|
|
80
|
-
const
|
|
81
|
+
const A = (t, o) => {
|
|
81
82
|
const r = {};
|
|
82
83
|
for (const e in t)
|
|
83
|
-
if (
|
|
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
|
|
90
|
+
function B(t) {
|
|
90
91
|
return !!t && typeof t == "object" && "children" in t && !!t.children;
|
|
91
92
|
}
|
|
92
|
-
const
|
|
93
|
-
if (!
|
|
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 =
|
|
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 ?
|
|
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
|
|
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
|
|
10
|
-
import { F as A } from "./FieldError-
|
|
11
|
-
import { a as P, A as y } from "./Action-
|
|
12
|
-
const
|
|
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:
|
|
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:
|
|
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,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">;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
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.
|
|
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.
|
|
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": "
|
|
524
|
+
"gitHead": "1dfabddca1406bb7baa5c39e217e81e936288c00"
|
|
518
525
|
}
|