@mittwald/flow-react-components 0.1.0-alpha.49 → 0.1.0-alpha.50
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/{Button-DiHP-IYs.js → Button-DXziN1Zz.js} +3 -3
- package/dist/Button.js +1 -1
- package/dist/ButtonGroup.js +16 -0
- package/dist/Checkbox.js +2 -2
- package/dist/Content.js +1 -1
- package/dist/CopyButton.js +9 -10
- package/dist/FieldDescription.js +2 -2
- package/dist/{FieldError-BmzydlRW.js → FieldError-BqM3R6B8.js} +2 -2
- package/dist/FieldError.js +1 -1
- package/dist/Header.js +1 -1
- package/dist/Heading.js +1 -1
- package/dist/{Icon-hyIHBPMT.js → Icon-CVuHAKTy.js} +1 -1
- package/dist/Icon.js +1 -1
- package/dist/{IconCheck-B_oanaSr.js → IconCheck-BBgaFuso.js} +1 -1
- package/dist/{IconChevronUp-DOOZfR76.js → IconChevronUp-WxE858Is.js} +1 -1
- package/dist/{IconClose-iB7vE9z6.js → IconClose-HOOYba0n.js} +1 -1
- package/dist/{IconCopy-CVV8P-Kn.js → IconCopy-D-X5JJSk.js} +1 -1
- package/dist/{IconDanger-Bq08fgKM.js → IconDanger-BxaqoG1h.js} +1 -1
- package/dist/{IconPlus-ChJLWEqL.js → IconPlus-C_KrGwcv.js} +1 -1
- package/dist/{IconSucceeded-DbgWPDVp.js → IconSucceeded-B0MTWMyT.js} +1 -1
- package/dist/{IconUnchecked-C7a0quEr.js → IconUnchecked-Dh6R-VMa.js} +1 -1
- package/dist/{IconWarning-BYFc8Vv9.js → IconWarning-CwE-4DCj.js} +1 -1
- package/dist/Icons.js +10 -10
- package/dist/Image.js +1 -1
- package/dist/Initials.js +1 -1
- package/dist/InlineAlert.js +2 -2
- package/dist/{Label-696-vpHQ.js → Label-YM0J0DAt.js} +1 -1
- package/dist/Label.js +1 -1
- package/dist/LayoutCard.js +1 -1
- package/dist/Link.js +1 -1
- package/dist/List.js +5 -5
- package/dist/Modal.js +73 -0
- package/dist/Navigation.js +1 -1
- package/dist/NumberField.js +5 -5
- package/dist/RadioGroup.js +3 -3
- package/dist/StatusBadge.js +3 -3
- package/dist/{StatusIcon-BTQPL8cG.js → StatusIcon-D5bsibLX.js} +3 -3
- package/dist/StatusIcon.js +1 -1
- package/dist/Switch.js +4 -4
- package/dist/{Text-DaJ0Ajt9.js → Text-DpogSoua.js} +1 -1
- package/dist/Text.js +1 -1
- package/dist/TextArea.js +1 -1
- package/dist/TextField.js +1 -1
- package/dist/{TextFieldBase-D60i8AOY.js → TextFieldBase-B4BOYXb1.js} +1 -1
- package/dist/Tooltip.js +3 -3
- package/dist/TooltipTrigger-BrP57dnv.js +20 -0
- package/dist/context-BzhxSFz9.js +7 -0
- package/dist/flowComponent-pdauvORb.js +30 -0
- package/dist/styles.css +1 -1
- package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +5 -0
- package/dist/types/components/ButtonGroup/index.d.ts +3 -0
- package/dist/types/components/ButtonGroup/stories/Default.stories.d.ts +10 -0
- package/dist/types/components/Modal/Modal.d.ts +8 -0
- package/dist/types/components/Modal/index.d.ts +4 -0
- package/dist/types/components/Modal/stories/Default.stories.d.ts +9 -0
- package/dist/types/components/Modal/stories/EdgeCases.stories.d.ts +6 -0
- package/dist/types/components/propTypes/index.d.ts +2 -0
- package/dist/types/lib/propsContext/propsContext.d.ts +1 -0
- package/dist/useProps-U3eRrkW6.js +73 -0
- package/package.json +11 -3
- package/dist/Tooltip-Co5h9sSt.js +0 -16
- package/dist/TooltipTrigger-7-ynWHZ9.js +0 -11
- package/dist/TooltipTrigger.js +0 -7
- package/dist/flowComponent-DLzr2Cvi.js +0 -92
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import ButtonGroup from "../ButtonGroup";
|
|
3
|
+
declare const meta: Meta<typeof ButtonGroup>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ButtonGroup>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Danger: Story;
|
|
8
|
+
export declare const Info: Story;
|
|
9
|
+
export declare const AdditionalSecondary: Story;
|
|
10
|
+
export declare const Mobile: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as Aria from "react-aria-components";
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
export interface ModalProps extends Pick<Aria.DialogProps, "children">, Omit<Aria.ModalOverlayProps, "children"> {
|
|
4
|
+
size?: "s" | "m" | "l";
|
|
5
|
+
panel?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const Modal: FC<ModalProps>;
|
|
8
|
+
export default Modal;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Modal from '..';
|
|
3
|
+
declare const meta: Meta<typeof Modal>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Modal>;
|
|
6
|
+
export declare const WithState: Story;
|
|
7
|
+
export declare const WithDialogTrigger: Story;
|
|
8
|
+
export declare const Mobile: Story;
|
|
9
|
+
export declare const Panel: Story;
|
|
@@ -16,9 +16,11 @@ import type { CopyButtonProps } from '../CopyButton';
|
|
|
16
16
|
import type { HeaderProps } from '../Header';
|
|
17
17
|
import type { SwitchProps } from '../Switch';
|
|
18
18
|
import { StatusBadgeProps } from '../StatusBadge';
|
|
19
|
+
import type { ButtonGroupProps } from '../ButtonGroup';
|
|
19
20
|
export * from "./types";
|
|
20
21
|
export interface FlowComponentPropsTypes {
|
|
21
22
|
Button: ButtonProps;
|
|
23
|
+
ButtonGroup: ButtonGroupProps;
|
|
22
24
|
Content: ContentProps;
|
|
23
25
|
CopyButton: CopyButtonProps;
|
|
24
26
|
FieldDescription: FieldDescriptionProps;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const propsContext: import("react").Context<Partial<{
|
|
3
3
|
Button: import('./types').ComponentPropsContext<"Button">;
|
|
4
|
+
ButtonGroup: import('./types').ComponentPropsContext<"ButtonGroup">;
|
|
4
5
|
Content: import('./types').ComponentPropsContext<"Content">;
|
|
5
6
|
CopyButton: import('./types').ComponentPropsContext<"CopyButton">;
|
|
6
7
|
FieldDescription: import('./types').ComponentPropsContext<"FieldDescription">;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
import { mergeProps as s } from "@react-aria/utils";
|
|
4
|
+
import p, { isValidElement as u, useContext as c } from "react";
|
|
5
|
+
import { p as d } from "./propsContext-Dx7WKmmM.js";
|
|
6
|
+
import { pickBy as m } from "remeda";
|
|
7
|
+
import { P as a } from "./PropsContextProvider-B6QiUIPM.js";
|
|
8
|
+
function C(t) {
|
|
9
|
+
return !!t && typeof t == "object" && "__dynamicProp" in t;
|
|
10
|
+
}
|
|
11
|
+
const f = {
|
|
12
|
+
Text: !0,
|
|
13
|
+
Button: !0,
|
|
14
|
+
ButtonGroup: !0,
|
|
15
|
+
CopyButton: !0,
|
|
16
|
+
Header: !0,
|
|
17
|
+
Icon: !0,
|
|
18
|
+
Label: !0,
|
|
19
|
+
Content: !0,
|
|
20
|
+
LayoutCard: !0,
|
|
21
|
+
NavigationItem: !0,
|
|
22
|
+
Heading: !0,
|
|
23
|
+
InlineAlert: !0,
|
|
24
|
+
Link: !0,
|
|
25
|
+
Initials: !0,
|
|
26
|
+
Image: !0,
|
|
27
|
+
FieldError: !0,
|
|
28
|
+
FieldDescription: !0,
|
|
29
|
+
TestComponent: !0,
|
|
30
|
+
Switch: !0,
|
|
31
|
+
StatusBadge: !0
|
|
32
|
+
}, l = Object.keys(
|
|
33
|
+
f
|
|
34
|
+
);
|
|
35
|
+
function i(t) {
|
|
36
|
+
return typeof t == "string" && l.includes(t);
|
|
37
|
+
}
|
|
38
|
+
function y(t) {
|
|
39
|
+
return !i(t);
|
|
40
|
+
}
|
|
41
|
+
const P = (t, r) => {
|
|
42
|
+
const e = {};
|
|
43
|
+
for (const n in t)
|
|
44
|
+
if (y(n)) {
|
|
45
|
+
const o = t[n];
|
|
46
|
+
C(o) ? e[n] = o.__dynamicProp(r) : e[n] = o;
|
|
47
|
+
}
|
|
48
|
+
return e;
|
|
49
|
+
};
|
|
50
|
+
function x(t) {
|
|
51
|
+
return !!t && typeof t == "object" && "children" in t && !!t.children;
|
|
52
|
+
}
|
|
53
|
+
const h = (t) => m(t, (r, e) => i(e)), v = (t, r) => {
|
|
54
|
+
if (!x(r))
|
|
55
|
+
return {};
|
|
56
|
+
const e = r.children;
|
|
57
|
+
if (!Array.isArray(e) && !u(e))
|
|
58
|
+
return {};
|
|
59
|
+
const n = h(t);
|
|
60
|
+
return Object.keys(n).length === 0 ? {} : {
|
|
61
|
+
children: /* @__PURE__ */ p.createElement(a, { props: n }, r.children)
|
|
62
|
+
};
|
|
63
|
+
}, B = (t, r) => {
|
|
64
|
+
const e = c(d)[t], n = e ? P(e, r) : void 0, o = e ? v(e, r) : void 0;
|
|
65
|
+
return s(
|
|
66
|
+
n,
|
|
67
|
+
r,
|
|
68
|
+
o
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
B as u
|
|
73
|
+
};
|
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.50",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"types": "./dist/types/components/Button/index.d.ts",
|
|
15
15
|
"import": "./dist/Button.js"
|
|
16
16
|
},
|
|
17
|
+
"./ButtonGroup": {
|
|
18
|
+
"types": "./dist/types/components/ButtonGroup/index.d.ts",
|
|
19
|
+
"import": "./dist/ButtonGroup.js"
|
|
20
|
+
},
|
|
17
21
|
"./Checkbox": {
|
|
18
22
|
"types": "./dist/types/components/Checkbox/index.d.ts",
|
|
19
23
|
"import": "./dist/Checkbox.js"
|
|
@@ -94,6 +98,10 @@
|
|
|
94
98
|
"types": "./dist/types/components/List/components/ListLoaderAsyncResource.d.ts",
|
|
95
99
|
"import": "./dist/List/ListLoaderAsyncResource.js"
|
|
96
100
|
},
|
|
101
|
+
"./Modal": {
|
|
102
|
+
"types": "./dist/types/components/Modal/index.d.ts",
|
|
103
|
+
"import": "./dist/Modal.js"
|
|
104
|
+
},
|
|
97
105
|
"./Navigation": {
|
|
98
106
|
"types": "./dist/types/components/Navigation/index.d.ts",
|
|
99
107
|
"import": "./dist/Navigation.js"
|
|
@@ -182,7 +190,7 @@
|
|
|
182
190
|
},
|
|
183
191
|
"devDependencies": {
|
|
184
192
|
"@faker-js/faker": "^8.4.1",
|
|
185
|
-
"@mittwald/flow-design-tokens": "^0.1.0-alpha.
|
|
193
|
+
"@mittwald/flow-design-tokens": "^0.1.0-alpha.50",
|
|
186
194
|
"@mittwald/react-use-promise": "^2.3.12",
|
|
187
195
|
"@nx/storybook": "^18.1.1",
|
|
188
196
|
"@storybook/addon-a11y": "^7.6.17",
|
|
@@ -253,5 +261,5 @@
|
|
|
253
261
|
"optional": true
|
|
254
262
|
}
|
|
255
263
|
},
|
|
256
|
-
"gitHead": "
|
|
264
|
+
"gitHead": "1101c1b89d5d2b2ed6c0e3ecab13e98cb4d24647"
|
|
257
265
|
}
|
package/dist/Tooltip-Co5h9sSt.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
/* */
|
|
3
|
-
import * as t from "react-aria-components";
|
|
4
|
-
import o from "react";
|
|
5
|
-
import i from "clsx";
|
|
6
|
-
const m = "flow--tooltip", n = "flow--tooltip--arrow", p = "flow--tooltip--slide", e = {
|
|
7
|
-
tooltip: m,
|
|
8
|
-
arrow: n,
|
|
9
|
-
slide: p
|
|
10
|
-
}, d = (r) => {
|
|
11
|
-
const { children: l, className: s, ...a } = r, c = i(e.tooltip, s);
|
|
12
|
-
return /* @__PURE__ */ o.createElement(t.Tooltip, { ...a, className: c }, /* @__PURE__ */ o.createElement(t.OverlayArrow, { className: e.arrow }, /* @__PURE__ */ o.createElement("svg", { viewBox: "0 0 8 8" }, /* @__PURE__ */ o.createElement("path", { d: "M0 0 L4 4 L8 0" }))), l);
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
d as T
|
|
16
|
-
};
|
package/dist/TooltipTrigger.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
/* */
|
|
3
|
-
import i, { isValidElement as d, useContext as u, createContext as l, useLayoutEffect as a } from "react";
|
|
4
|
-
import { p as m } from "./propsContext-Dx7WKmmM.js";
|
|
5
|
-
import { mergeProps as f } from "@react-aria/utils";
|
|
6
|
-
import { pickBy as C } from "remeda";
|
|
7
|
-
import { P as y } from "./PropsContextProvider-B6QiUIPM.js";
|
|
8
|
-
import "@preact/signals-react";
|
|
9
|
-
import "@preact/signals-react/runtime";
|
|
10
|
-
function x(t) {
|
|
11
|
-
return !!t && typeof t == "object" && "__dynamicProp" in t;
|
|
12
|
-
}
|
|
13
|
-
const P = {
|
|
14
|
-
Text: !0,
|
|
15
|
-
Button: !0,
|
|
16
|
-
CopyButton: !0,
|
|
17
|
-
Header: !0,
|
|
18
|
-
Icon: !0,
|
|
19
|
-
Label: !0,
|
|
20
|
-
Content: !0,
|
|
21
|
-
LayoutCard: !0,
|
|
22
|
-
NavigationItem: !0,
|
|
23
|
-
Heading: !0,
|
|
24
|
-
InlineAlert: !0,
|
|
25
|
-
Link: !0,
|
|
26
|
-
Initials: !0,
|
|
27
|
-
Image: !0,
|
|
28
|
-
FieldError: !0,
|
|
29
|
-
FieldDescription: !0,
|
|
30
|
-
TestComponent: !0,
|
|
31
|
-
Switch: !0,
|
|
32
|
-
StatusBadge: !0
|
|
33
|
-
}, v = Object.keys(
|
|
34
|
-
P
|
|
35
|
-
);
|
|
36
|
-
function s(t) {
|
|
37
|
-
return typeof t == "string" && v.includes(t);
|
|
38
|
-
}
|
|
39
|
-
function h(t) {
|
|
40
|
-
return !s(t);
|
|
41
|
-
}
|
|
42
|
-
const E = (t, r) => {
|
|
43
|
-
const e = {};
|
|
44
|
-
for (const n in t)
|
|
45
|
-
if (h(n)) {
|
|
46
|
-
const o = t[n];
|
|
47
|
-
x(o) ? e[n] = o.__dynamicProp(r) : e[n] = o;
|
|
48
|
-
}
|
|
49
|
-
return e;
|
|
50
|
-
};
|
|
51
|
-
function w(t) {
|
|
52
|
-
return !!t && typeof t == "object" && "children" in t && !!t.children;
|
|
53
|
-
}
|
|
54
|
-
const I = (t) => C(t, (r, e) => s(e)), g = (t, r) => {
|
|
55
|
-
if (!w(r))
|
|
56
|
-
return {};
|
|
57
|
-
const e = r.children;
|
|
58
|
-
if (!Array.isArray(e) && !d(e))
|
|
59
|
-
return {};
|
|
60
|
-
const n = I(t);
|
|
61
|
-
return Object.keys(n).length === 0 ? {} : {
|
|
62
|
-
children: /* @__PURE__ */ i.createElement(y, { props: n }, r.children)
|
|
63
|
-
};
|
|
64
|
-
}, N = (t, r) => {
|
|
65
|
-
const e = u(m)[t], n = e ? E(e, r) : void 0, o = e ? g(e, r) : void 0;
|
|
66
|
-
return f(
|
|
67
|
-
n,
|
|
68
|
-
r,
|
|
69
|
-
o
|
|
70
|
-
);
|
|
71
|
-
}, b = l({}), k = (t) => {
|
|
72
|
-
const { children: r, id: e = "default" } = t, { nodes: n } = u(b);
|
|
73
|
-
return a(() => {
|
|
74
|
-
if (e !== void 0 && r !== n.value[e])
|
|
75
|
-
return n.value = { ...n.value, [e]: r }, () => {
|
|
76
|
-
n.value = { ...n.value, [e]: void 0 };
|
|
77
|
-
};
|
|
78
|
-
}, [r, e, n]), null;
|
|
79
|
-
};
|
|
80
|
-
function A(t, r) {
|
|
81
|
-
return function(n) {
|
|
82
|
-
const o = N(t, n);
|
|
83
|
-
if ("tunnelId" in o) {
|
|
84
|
-
const { tunnelId: c, ...p } = o;
|
|
85
|
-
return /* @__PURE__ */ i.createElement(k, { id: c }, /* @__PURE__ */ i.createElement(r, { ...p }));
|
|
86
|
-
}
|
|
87
|
-
return /* @__PURE__ */ i.createElement(r, { ...o });
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
export {
|
|
91
|
-
A as f
|
|
92
|
-
};
|