@mittwald/flow-react-components 0.1.0-alpha.59 → 0.1.0-alpha.61
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/{Action-SSV77Gfb.js → Action-DT6jWAqa.js} +3 -3
- package/dist/Action.js +1 -1
- package/dist/Avatar.js +27 -22
- package/dist/Breadcrumb.js +3 -3
- package/dist/{Button-DTVMsKTK.js → Button-K1ktUAEv.js} +6 -6
- package/dist/Button.js +1 -1
- package/dist/ButtonGroup.js +3 -3
- package/dist/{Checkbox-gCtHl4pE.js → Checkbox-De7ZNCuQ.js} +4 -4
- package/dist/Checkbox.js +1 -1
- package/dist/{CheckboxButton-CW6TfZFj.js → CheckboxButton-D8M2QcSR.js} +3 -3
- package/dist/CheckboxButton.js +1 -1
- package/dist/CheckboxGroup.js +4 -4
- package/dist/{ClearPropsContext-CD1-9TZA.js → ClearPropsContext-CeCMjUK9.js} +1 -1
- package/dist/Content.js +3 -3
- package/dist/ContextMenu.js +2 -2
- package/dist/{ContextMenuItem-Cc7czdsZ.js → ContextMenuItem-FeOABGAA.js} +6 -6
- package/dist/CopyButton.js +6 -6
- package/dist/FieldDescription.js +4 -4
- package/dist/{FieldError-BDRDWTgn.js → FieldError-D2Xf1SUy.js} +4 -4
- package/dist/FieldError.js +1 -1
- package/dist/Header.js +1 -1
- package/dist/Heading.js +4 -4
- package/dist/{Icon-DK_xMxr-.js → Icon-QRU6ff6c.js} +3 -3
- package/dist/Icon.js +1 -1
- package/dist/{IconCheck-DmRifITa.js → IconCheck-CDLMv3G3.js} +1 -1
- package/dist/{IconCheckboxEmpty-BNFRkCm2.js → IconCheckboxEmpty-K4aq2aRv.js} +1 -1
- package/dist/{IconCheckboxIndeterminate-Bsk1h92j.js → IconCheckboxIndeterminate-DyTX9k0O.js} +1 -1
- package/dist/{IconChevronDown-C3dBD472.js → IconChevronDown-n2DJdnRB.js} +1 -1
- package/dist/{IconChevronRight-T-spe-97.js → IconChevronRight-BOY7IxRM.js} +1 -1
- package/dist/{IconClose-DIMx1m3Z.js → IconClose-DYvIbwoN.js} +1 -1
- package/dist/{IconContextMenu-BF-N2Mtz.js → IconContextMenu-DFvw_d9h.js} +1 -1
- package/dist/{IconCopy-C1rPlvpD.js → IconCopy-CYChwYCx.js} +1 -1
- package/dist/{IconDanger-Dz5HIiAc.js → IconDanger-CP4R6i5T.js} +1 -1
- package/dist/{IconPlus-DXNLmWa2.js → IconPlus-DazBjEoi.js} +1 -1
- package/dist/{IconRadioOn-D9S2_D7W.js → IconRadioOn-BqCA-noy.js} +1 -1
- package/dist/{IconSucceeded-IhwCzdOs.js → IconSucceeded-CHBiied9.js} +1 -1
- package/dist/{IconWarning-BiArksZS.js → IconWarning-DYI5SVhB.js} +1 -1
- package/dist/Icons.js +53 -42
- package/dist/Image.js +3 -3
- package/dist/Initials.js +3 -3
- package/dist/InlineAlert.js +5 -5
- package/dist/{InlineCode-DZzyKdCm.js → InlineCode-CI8164C6.js} +2 -2
- package/dist/InlineCode.js +1 -1
- package/dist/{Label-Bjdbr72t.js → Label-CJOiPsOr.js} +3 -3
- package/dist/Label.js +1 -1
- package/dist/LabeledValue.js +3 -3
- package/dist/LayoutCard.js +1 -1
- package/dist/{Link-DtSY1xrt.js → Link-DWMWhCqU.js} +4 -4
- package/dist/Link.js +1 -1
- package/dist/List.js +10 -10
- package/dist/Modal.js +18 -18
- package/dist/Navigation.js +2 -2
- package/dist/NumberField.js +7 -7
- package/dist/{PropsContextProvider-BsrVIv1a.js → PropsContextProvider-BcOGMJkn.js} +1 -1
- package/dist/RadioGroup.js +57 -37
- package/dist/Section.js +2 -2
- package/dist/StatusBadge.js +5 -5
- package/dist/{StatusIcon-Cfw9kVxt.js → StatusIcon-DHa4uxfZ.js} +4 -4
- package/dist/StatusIcon.js +1 -1
- package/dist/Switch.js +6 -6
- package/dist/{Text-c5-UeE0Y.js → Text-Dd9tXlc8.js} +4 -4
- package/dist/Text.js +1 -1
- package/dist/TextArea.js +3 -3
- package/dist/TextField.js +3 -3
- package/dist/{TextFieldBase-DbGQjntR.js → TextFieldBase-BdkqA5-_.js} +4 -4
- package/dist/{flowComponent-Dv5hKZam.js → flowComponent-C3IF_aaP.js} +2 -2
- package/dist/propsContext-CauylOgH.js +8 -0
- package/dist/styles.css +1 -1
- package/dist/types/components/Avatar/Avatar.d.ts +1 -0
- package/dist/types/components/Icon/components/icons/IconMittwald.d.ts +5 -0
- package/dist/types/components/Icon/components/icons/index.d.ts +1 -0
- package/dist/types/components/Modal/Modal.d.ts +1 -1
- package/dist/types/components/Modal/stories/Default.stories.d.ts +1 -1
- package/dist/types/components/NumberField/stories/Default.stories.d.ts +1 -0
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +1 -0
- package/dist/types/components/RadioGroup/components/SegmentedGroup/SegmentedGroup.d.ts +6 -0
- package/dist/types/components/RadioGroup/components/SegmentedGroup/index.d.ts +4 -0
- package/dist/types/components/RadioGroup/stories/Default.stories.d.ts +2 -0
- package/dist/types/components/StatusBadge/stories/Default.stories.d.ts +1 -0
- package/dist/types/lib/propsContext/propsContext.d.ts +3 -1
- package/dist/{useProps-BEU8ldpP.js → useProps-BiJ72z10.js} +22 -22
- package/package.json +3 -7
- package/dist/SegmentedControlGroup.js +0 -51
- package/dist/propsContext-Dx7WKmmM.js +0 -7
- package/dist/types/components/SegmentedControlGroup/SegmentedControlGroup.d.ts +0 -7
- package/dist/types/components/SegmentedControlGroup/index.d.ts +0 -4
- package/dist/types/components/SegmentedControlGroup/stories/Default.stories.d.ts +0 -9
- package/dist/types/components/SegmentedControlGroup/stories/EdgeCases.stories.d.ts +0 -8
|
@@ -3,6 +3,7 @@ import { FC, PropsWithChildren } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import * as Aria from "react-aria-components";
|
|
5
5
|
export interface RadioGroupProps extends PropsWithChildren<Omit<Aria.RadioGroupProps, "children">>, Pick<ColumnLayoutProps, "s" | "m" | "l"> {
|
|
6
|
+
variant?: "segmented" | "default";
|
|
6
7
|
}
|
|
7
8
|
export declare const RadioGroup: FC<RadioGroupProps>;
|
|
8
9
|
export default RadioGroup;
|
|
@@ -11,3 +11,5 @@ export declare const RadioButtons: Story;
|
|
|
11
11
|
export declare const RadioButtonDisabled: Story;
|
|
12
12
|
export declare const RadioButtonsWithContent: Story;
|
|
13
13
|
export declare const WithFieldError: Story;
|
|
14
|
+
export declare const SegmentedVariant: Story;
|
|
15
|
+
export declare const SegmentedVariantWithFieldError: Story;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { PropsContext } from './types';
|
|
2
|
+
|
|
2
3
|
export declare const propsContext: import('react').Context<Partial<{
|
|
3
4
|
Action: import("@/lib/propsContext/types").ComponentPropsContext<"Action">;
|
|
4
5
|
Avatar: import("@/lib/propsContext/types").ComponentPropsContext<"Avatar">;
|
|
@@ -24,3 +25,4 @@ export declare const propsContext: import('react').Context<Partial<{
|
|
|
24
25
|
Text: import("@/lib/propsContext/types").ComponentPropsContext<"Text">;
|
|
25
26
|
TestComponent: import("@/lib/propsContext/types").ComponentPropsContext<"TestComponent">;
|
|
26
27
|
}>>;
|
|
28
|
+
export declare const useContextProps: () => PropsContext;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
3
|
import { mergeProps as s } from "@react-aria/utils";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { pickBy as
|
|
7
|
-
import { P as
|
|
8
|
-
function
|
|
4
|
+
import { u } from "./propsContext-CauylOgH.js";
|
|
5
|
+
import p, { isValidElement as c } from "react";
|
|
6
|
+
import { pickBy as d } from "remeda";
|
|
7
|
+
import { P as a } from "./PropsContextProvider-BcOGMJkn.js";
|
|
8
|
+
function m(t) {
|
|
9
9
|
return !!t && typeof t == "object" && "__dynamicProp" in t;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const C = {
|
|
12
12
|
Action: !0,
|
|
13
13
|
Avatar: !0,
|
|
14
14
|
Button: !0,
|
|
@@ -32,39 +32,39 @@ const f = {
|
|
|
32
32
|
Switch: !0,
|
|
33
33
|
TestComponent: !0,
|
|
34
34
|
Text: !0
|
|
35
|
-
},
|
|
36
|
-
|
|
35
|
+
}, f = Object.keys(
|
|
36
|
+
C
|
|
37
37
|
);
|
|
38
38
|
function i(t) {
|
|
39
|
-
return typeof t == "string" &&
|
|
39
|
+
return typeof t == "string" && f.includes(t);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function l(t) {
|
|
42
42
|
return !i(t);
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const y = (t, r) => {
|
|
45
45
|
const e = {};
|
|
46
46
|
for (const n in t)
|
|
47
|
-
if (
|
|
47
|
+
if (l(n)) {
|
|
48
48
|
const o = t[n];
|
|
49
|
-
|
|
49
|
+
m(o) && (e[n] = o.__dynamicProp(r));
|
|
50
50
|
}
|
|
51
51
|
return e;
|
|
52
52
|
};
|
|
53
|
-
function
|
|
53
|
+
function P(t) {
|
|
54
54
|
return !!t && typeof t == "object" && "children" in t && !!t.children;
|
|
55
55
|
}
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
56
|
+
const x = (t) => d(t, (r, e) => i(e)), h = (t, r) => {
|
|
57
|
+
if (!P(r))
|
|
58
58
|
return {};
|
|
59
59
|
const e = r.children;
|
|
60
|
-
if (!Array.isArray(e) && !
|
|
60
|
+
if (!Array.isArray(e) && !c(e))
|
|
61
61
|
return {};
|
|
62
|
-
const n =
|
|
62
|
+
const n = x(t);
|
|
63
63
|
return Object.keys(n).length === 0 ? {} : {
|
|
64
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ p.createElement(a, { props: n }, r.children)
|
|
65
65
|
};
|
|
66
|
-
},
|
|
67
|
-
const e =
|
|
66
|
+
}, A = (t, r) => {
|
|
67
|
+
const e = u()[t], n = e ? y(e, r) : void 0, o = e ? h(e, r) : void 0;
|
|
68
68
|
return s(
|
|
69
69
|
e,
|
|
70
70
|
r,
|
|
@@ -73,5 +73,5 @@ const h = (t) => a(t, (r, e) => i(e)), v = (t, r) => {
|
|
|
73
73
|
);
|
|
74
74
|
};
|
|
75
75
|
export {
|
|
76
|
-
|
|
76
|
+
A as u
|
|
77
77
|
};
|
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.61",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -142,10 +142,6 @@
|
|
|
142
142
|
"types": "./dist/types/components/Section/index.d.ts",
|
|
143
143
|
"import": "./dist/Section.js"
|
|
144
144
|
},
|
|
145
|
-
"./SegmentedControlGroup": {
|
|
146
|
-
"types": "./dist/types/components/SegmentedControlGroup/index.d.ts",
|
|
147
|
-
"import": "./dist/SegmentedControlGroup.js"
|
|
148
|
-
},
|
|
149
145
|
"./StatusBadge": {
|
|
150
146
|
"types": "./dist/types/components/StatusBadge/index.d.ts",
|
|
151
147
|
"import": "./dist/StatusBadge.js"
|
|
@@ -221,7 +217,7 @@
|
|
|
221
217
|
},
|
|
222
218
|
"devDependencies": {
|
|
223
219
|
"@faker-js/faker": "^8.4.1",
|
|
224
|
-
"@mittwald/flow-design-tokens": "^0.1.0-alpha.
|
|
220
|
+
"@mittwald/flow-design-tokens": "^0.1.0-alpha.61",
|
|
225
221
|
"@mittwald/react-use-promise": "^2.3.13",
|
|
226
222
|
"@nx/storybook": "^18.2.3",
|
|
227
223
|
"@storybook/addon-a11y": "^8.0.6",
|
|
@@ -291,5 +287,5 @@
|
|
|
291
287
|
"optional": true
|
|
292
288
|
}
|
|
293
289
|
},
|
|
294
|
-
"gitHead": "
|
|
290
|
+
"gitHead": "c2365378111372b948af4a421a4fabd2c6d9090b"
|
|
295
291
|
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
/* */
|
|
3
|
-
import e from "react";
|
|
4
|
-
import * as d from "react-aria-components";
|
|
5
|
-
import p from "clsx";
|
|
6
|
-
import "./propsContext-Dx7WKmmM.js";
|
|
7
|
-
import { P as f } from "./PropsContextProvider-BsrVIv1a.js";
|
|
8
|
-
import "@react-aria/utils";
|
|
9
|
-
import "remeda";
|
|
10
|
-
import { d as g } from "./dynamic-ClpUSmEt.js";
|
|
11
|
-
import { F as u } from "./FieldError-BDRDWTgn.js";
|
|
12
|
-
import { TunnelProvider as E, TunnelExit as o } from "@mittwald/react-tunnel";
|
|
13
|
-
import { s as r } from "./FormField.module-DHK6nIcD.js";
|
|
14
|
-
import "@tabler/icons-react";
|
|
15
|
-
import "html-react-parser";
|
|
16
|
-
import { I as N } from "./IconCheck-DmRifITa.js";
|
|
17
|
-
const k = "flow--segmented-control-group", h = "flow--segmented-control-group--segments", C = "flow--segmented-control-group--segment", F = "flow--segmented-control-group--checkmark", t = {
|
|
18
|
-
segmentedControlGroup: k,
|
|
19
|
-
segments: h,
|
|
20
|
-
segment: C,
|
|
21
|
-
checkmark: F
|
|
22
|
-
}, S = (s) => {
|
|
23
|
-
const { children: n, className: l, ...m } = s, c = p(
|
|
24
|
-
t.segmentedControlGroup,
|
|
25
|
-
r.formField,
|
|
26
|
-
l
|
|
27
|
-
), a = {
|
|
28
|
-
Label: {
|
|
29
|
-
className: r.label,
|
|
30
|
-
tunnelId: "label"
|
|
31
|
-
},
|
|
32
|
-
FieldDescription: {
|
|
33
|
-
className: r.fieldDescription,
|
|
34
|
-
tunnelId: "fieldDescription"
|
|
35
|
-
},
|
|
36
|
-
FieldError: {
|
|
37
|
-
className: r.customFieldError,
|
|
38
|
-
tunnelId: "fieldError"
|
|
39
|
-
},
|
|
40
|
-
Radio: {
|
|
41
|
-
className: t.segment,
|
|
42
|
-
unstyled: !0,
|
|
43
|
-
children: g((i) => /* @__PURE__ */ e.createElement(e.Fragment, null, i.children, /* @__PURE__ */ e.createElement(N, { className: t.checkmark })))
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
return /* @__PURE__ */ e.createElement(d.RadioGroup, { ...m, className: c }, /* @__PURE__ */ e.createElement(f, { props: a }, /* @__PURE__ */ e.createElement(E, null, /* @__PURE__ */ e.createElement(o, { id: "label" }), /* @__PURE__ */ e.createElement("div", { className: t.segments }, n), /* @__PURE__ */ e.createElement(o, { id: "fieldDescription" }), /* @__PURE__ */ e.createElement(o, { id: "fieldError" }))), /* @__PURE__ */ e.createElement(u, { className: r.fieldError }));
|
|
47
|
-
};
|
|
48
|
-
export {
|
|
49
|
-
S as SegmentedControlGroup,
|
|
50
|
-
S as default
|
|
51
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
|
-
import * as Aria from "react-aria-components";
|
|
4
|
-
export interface SegmentedControlGroupProps extends PropsWithChildren<Omit<Aria.RadioGroupProps, "children">> {
|
|
5
|
-
}
|
|
6
|
-
export declare const SegmentedControlGroup: FC<SegmentedControlGroupProps>;
|
|
7
|
-
export default SegmentedControlGroup;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SegmentedControlGroup } from '../index';
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
declare const meta: Meta<typeof SegmentedControlGroup>;
|
|
5
|
-
export default meta;
|
|
6
|
-
type Story = StoryObj<typeof SegmentedControlGroup>;
|
|
7
|
-
export declare const Default: Story;
|
|
8
|
-
export declare const SegmentedControlGroupDisabled: Story;
|
|
9
|
-
export declare const SegmentDisabled: Story;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SegmentedControlGroup } from '../index';
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
declare const meta: Meta<typeof SegmentedControlGroup>;
|
|
5
|
-
export default meta;
|
|
6
|
-
type Story = StoryObj<typeof SegmentedControlGroup>;
|
|
7
|
-
export declare const LongTexts: Story;
|
|
8
|
-
export declare const SmallSpace: Story;
|