@mittwald/flow-react-components 0.1.0-alpha.40 → 0.1.0-alpha.42
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/Avatar.js +1 -1
- package/dist/{Button-BmQ-57Vz.js → Button-FPl3fKiM.js} +5 -5
- package/dist/Button.js +1 -1
- package/dist/Checkbox.js +3 -3
- package/dist/Content.js +2 -2
- package/dist/CopyButton.js +5 -5
- package/dist/FieldDescription.js +3 -3
- package/dist/{FieldError-h_2c51Ws.js → FieldError-BK5ho6N9.js} +4 -4
- package/dist/FieldError.js +1 -1
- package/dist/Header.js +18 -0
- package/dist/Heading.js +2 -2
- package/dist/{Icon-pvbWA-vL.js → Icon-S-6j_Kl3.js} +2 -2
- package/dist/Icon.js +1 -1
- package/dist/{IconCheck-BhmzlVex.js → IconCheck-1PRSXamm.js} +1 -1
- package/dist/{IconClose-DP0Hbb0w.js → IconClose-D-8Y7fMZ.js} +1 -1
- package/dist/{IconCopy-f1oXwqHF.js → IconCopy-C1yg9WXZ.js} +1 -1
- package/dist/{IconDanger-DxWZvd65.js → IconDanger-Dd6HnAx9.js} +1 -1
- package/dist/{IconPlus-DQBvsCqr.js → IconPlus-C2E1lBEu.js} +1 -1
- package/dist/{IconSucceeded-Df3yoJLr.js → IconSucceeded-BvrlGH02.js} +1 -1
- package/dist/{IconUnchecked-CMZzDHYB.js → IconUnchecked-DuOQbrqC.js} +1 -1
- package/dist/{IconWarning-DhmOwBP9.js → IconWarning-h9MeCuZE.js} +1 -1
- package/dist/Icons.js +9 -9
- package/dist/Image.js +2 -2
- package/dist/Initials.js +2 -2
- package/dist/InlineAlert.js +3 -3
- package/dist/{Label-CoQ5dkQY.js → Label-B8RjhN8C.js} +2 -2
- package/dist/Label.js +1 -1
- package/dist/LabeledValue.js +1 -1
- package/dist/LayoutCard.js +2 -2
- package/dist/Link.js +2 -2
- package/dist/Navigation.js +2 -2
- package/dist/NumberField.js +5 -5
- package/dist/PropsContextProvider-C7Evvjhy.js +43 -0
- package/dist/RadioGroup.js +4 -4
- package/dist/Section.js +22 -11
- package/dist/StatusBadge.js +2 -2
- package/dist/{StatusIcon-BTmOqTZR.js → StatusIcon-ab4wFrRb.js} +4 -4
- package/dist/StatusIcon.js +1 -1
- package/dist/Switch.js +5 -5
- package/dist/{Text-BUVxBLdV.js → Text-B5YK5s7t.js} +2 -2
- package/dist/Text.js +1 -1
- package/dist/TextArea.js +1 -1
- package/dist/TextField.js +1 -1
- package/dist/{TextFieldBase-Ck-WpOdU.js → TextFieldBase-DSF3g83M.js} +2 -2
- package/dist/nextjs/LinkProvider.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/Header/Header.d.ts +6 -0
- package/dist/types/components/Header/index.d.ts +3 -0
- package/dist/types/components/Header/stories/Default.stories.d.ts +6 -0
- package/dist/types/components/Section/stories/Default.stories.d.ts +2 -0
- package/dist/types/components/Section/stories/EdgeCases.stories.d.ts +8 -0
- package/dist/types/components/propTypes/index.d.ts +12 -11
- package/dist/types/lib/propsContext/propsContext.d.ts +10 -10
- package/dist/useProps-d5Do2me4.js +69 -0
- package/package.json +7 -3
- package/dist/PropsContextProvider-C0o9mDtR.js +0 -29
- package/dist/useProps-DWCkDfxd.js +0 -67
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Section from "../Section";
|
|
3
|
+
import { Text } from '../../Text';
|
|
4
|
+
declare const meta: Meta<typeof Section>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type Story = StoryObj<typeof Text>;
|
|
7
|
+
export declare const WithLongHeading: Story;
|
|
8
|
+
export declare const SmallSpace: Story;
|
|
@@ -4,7 +4,7 @@ import type { IconProps } from '../Icon';
|
|
|
4
4
|
import type { LabelProps } from '../Label';
|
|
5
5
|
import type { ContentProps } from '../Content';
|
|
6
6
|
import type { LayoutCardProps } from '../LayoutCard';
|
|
7
|
-
import type { NavigationItemProps
|
|
7
|
+
import type { NavigationItemProps } from '../Navigation';
|
|
8
8
|
import type { LinkProps } from '../Link';
|
|
9
9
|
import type { FieldErrorProps } from '../FieldError';
|
|
10
10
|
import type { FieldDescriptionProps } from '../FieldDescription';
|
|
@@ -13,23 +13,24 @@ import type { HeadingProps } from '../Heading';
|
|
|
13
13
|
import type { InitialsProps } from '../Initials';
|
|
14
14
|
import type { ImageProps } from '../Image';
|
|
15
15
|
import type { CopyButtonProps } from '../CopyButton';
|
|
16
|
+
import { HeaderProps } from '../Header';
|
|
16
17
|
export * from "./types";
|
|
17
18
|
export interface FlowComponentPropsTypes {
|
|
18
|
-
Text: TextProps;
|
|
19
19
|
Button: ButtonProps;
|
|
20
|
+
Content: ContentProps;
|
|
20
21
|
CopyButton: CopyButtonProps;
|
|
22
|
+
FieldDescription: FieldDescriptionProps;
|
|
23
|
+
FieldError: FieldErrorProps;
|
|
24
|
+
Header: HeaderProps;
|
|
25
|
+
Heading: HeadingProps;
|
|
21
26
|
Icon: IconProps;
|
|
27
|
+
Image: ImageProps;
|
|
28
|
+
Initials: InitialsProps;
|
|
29
|
+
InlineAlert: InlineAlertProps;
|
|
22
30
|
Label: LabelProps;
|
|
23
|
-
Content: ContentProps;
|
|
24
31
|
LayoutCard: LayoutCardProps;
|
|
25
|
-
Navigation: NavigationProps;
|
|
26
|
-
NavigationItem: NavigationItemProps;
|
|
27
|
-
Heading: HeadingProps;
|
|
28
|
-
InlineAlert: InlineAlertProps;
|
|
29
32
|
Link: LinkProps;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
FieldError: FieldErrorProps;
|
|
33
|
-
FieldDescription: FieldDescriptionProps;
|
|
33
|
+
NavigationItem: NavigationItemProps;
|
|
34
|
+
Text: TextProps;
|
|
34
35
|
}
|
|
35
36
|
export declare const propsContextSupportingComponents: string[];
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const propsContext: import("react").Context<Partial<{
|
|
3
|
-
Text: import('./types').ComponentPropsContext<"Text">;
|
|
4
3
|
Button: import('./types').ComponentPropsContext<"Button">;
|
|
4
|
+
Content: import('./types').ComponentPropsContext<"Content">;
|
|
5
5
|
CopyButton: import('./types').ComponentPropsContext<"CopyButton">;
|
|
6
|
+
FieldDescription: import('./types').ComponentPropsContext<"FieldDescription">;
|
|
7
|
+
FieldError: import('./types').ComponentPropsContext<"FieldError">;
|
|
8
|
+
Header: import('./types').ComponentPropsContext<"Header">;
|
|
9
|
+
Heading: import('./types').ComponentPropsContext<"Heading">;
|
|
6
10
|
Icon: import('./types').ComponentPropsContext<"Icon">;
|
|
11
|
+
Image: import('./types').ComponentPropsContext<"Image">;
|
|
12
|
+
Initials: import('./types').ComponentPropsContext<"Initials">;
|
|
13
|
+
InlineAlert: import('./types').ComponentPropsContext<"InlineAlert">;
|
|
7
14
|
Label: import('./types').ComponentPropsContext<"Label">;
|
|
8
|
-
Content: import('./types').ComponentPropsContext<"Content">;
|
|
9
15
|
LayoutCard: import('./types').ComponentPropsContext<"LayoutCard">;
|
|
10
|
-
Navigation: import('./types').ComponentPropsContext<"Navigation">;
|
|
11
|
-
NavigationItem: import('./types').ComponentPropsContext<"NavigationItem">;
|
|
12
|
-
Heading: import('./types').ComponentPropsContext<"Heading">;
|
|
13
|
-
InlineAlert: import('./types').ComponentPropsContext<"InlineAlert">;
|
|
14
16
|
Link: import('./types').ComponentPropsContext<"Link">;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
FieldError: import('./types').ComponentPropsContext<"FieldError">;
|
|
18
|
-
FieldDescription: import('./types').ComponentPropsContext<"FieldDescription">;
|
|
17
|
+
NavigationItem: import('./types').ComponentPropsContext<"NavigationItem">;
|
|
18
|
+
Text: import('./types').ComponentPropsContext<"Text">;
|
|
19
19
|
TestComponent: import('./types').ComponentPropsContext<"TestComponent">;
|
|
20
20
|
}>>;
|
|
@@ -0,0 +1,69 @@
|
|
|
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, p as m } from "./PropsContextProvider-C7Evvjhy.js";
|
|
6
|
+
import { pickBy as a } from "remeda";
|
|
7
|
+
function C(t) {
|
|
8
|
+
return !!t && typeof t == "object" && "__dynamicProp" in t;
|
|
9
|
+
}
|
|
10
|
+
const l = {
|
|
11
|
+
Text: !0,
|
|
12
|
+
Button: !0,
|
|
13
|
+
CopyButton: !0,
|
|
14
|
+
Header: !0,
|
|
15
|
+
Icon: !0,
|
|
16
|
+
Label: !0,
|
|
17
|
+
Content: !0,
|
|
18
|
+
LayoutCard: !0,
|
|
19
|
+
NavigationItem: !0,
|
|
20
|
+
Heading: !0,
|
|
21
|
+
InlineAlert: !0,
|
|
22
|
+
Link: !0,
|
|
23
|
+
Initials: !0,
|
|
24
|
+
Image: !0,
|
|
25
|
+
FieldError: !0,
|
|
26
|
+
FieldDescription: !0,
|
|
27
|
+
TestComponent: !0
|
|
28
|
+
}, f = Object.keys(
|
|
29
|
+
l
|
|
30
|
+
);
|
|
31
|
+
function i(t) {
|
|
32
|
+
return typeof t == "string" && f.includes(t);
|
|
33
|
+
}
|
|
34
|
+
function y(t) {
|
|
35
|
+
return !i(t);
|
|
36
|
+
}
|
|
37
|
+
const P = (t, r) => {
|
|
38
|
+
const e = {};
|
|
39
|
+
for (const n in t)
|
|
40
|
+
if (y(n)) {
|
|
41
|
+
const o = t[n];
|
|
42
|
+
C(o) ? e[n] = o.__dynamicProp(r) : e[n] = o;
|
|
43
|
+
}
|
|
44
|
+
return e;
|
|
45
|
+
};
|
|
46
|
+
function x(t) {
|
|
47
|
+
return !!t && typeof t == "object" && "children" in t && !!t.children;
|
|
48
|
+
}
|
|
49
|
+
const h = (t) => a(t, (r, e) => i(e)), v = (t, r) => {
|
|
50
|
+
if (!x(r))
|
|
51
|
+
return {};
|
|
52
|
+
const e = r.children;
|
|
53
|
+
if (!Array.isArray(e) && !u(e))
|
|
54
|
+
return {};
|
|
55
|
+
const n = h(t);
|
|
56
|
+
return Object.keys(n).length === 0 ? {} : {
|
|
57
|
+
children: /* @__PURE__ */ p.createElement(d, { props: n }, r.children)
|
|
58
|
+
};
|
|
59
|
+
}, E = (t, r) => {
|
|
60
|
+
const e = c(m)[t], n = e ? P(e, r) : void 0, o = e ? v(e, r) : void 0;
|
|
61
|
+
return s(
|
|
62
|
+
n,
|
|
63
|
+
r,
|
|
64
|
+
o
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
E as u
|
|
69
|
+
};
|
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.42",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
"types": "./dist/types/components/FieldError/index.d.ts",
|
|
39
39
|
"import": "./dist/FieldError.js"
|
|
40
40
|
},
|
|
41
|
+
"./Header": {
|
|
42
|
+
"types": "./dist/types/components/Header/index.d.ts",
|
|
43
|
+
"import": "./dist/Header.js"
|
|
44
|
+
},
|
|
41
45
|
"./Heading": {
|
|
42
46
|
"types": "./dist/types/components/Heading/index.d.ts",
|
|
43
47
|
"import": "./dist/Heading.js"
|
|
@@ -164,7 +168,7 @@
|
|
|
164
168
|
"remeda": "^1.51.0"
|
|
165
169
|
},
|
|
166
170
|
"devDependencies": {
|
|
167
|
-
"@mittwald/flow-design-tokens": "^0.1.0-alpha.
|
|
171
|
+
"@mittwald/flow-design-tokens": "^0.1.0-alpha.41",
|
|
168
172
|
"@nx/storybook": "^18.1.1",
|
|
169
173
|
"@storybook/addon-a11y": "^7.6.17",
|
|
170
174
|
"@storybook/addon-actions": "^7.6.17",
|
|
@@ -228,5 +232,5 @@
|
|
|
228
232
|
"optional": true
|
|
229
233
|
}
|
|
230
234
|
},
|
|
231
|
-
"gitHead": "
|
|
235
|
+
"gitHead": "835fb2130c3a17de560c02f9c970d1663872eaa1"
|
|
232
236
|
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
/* */
|
|
3
|
-
import c, { createContext as m, useContext as P, useMemo as a } from "react";
|
|
4
|
-
import { mergeProps as d } from "@react-aria/utils";
|
|
5
|
-
const n = m({}), i = (r, t) => {
|
|
6
|
-
const o = Object.keys({
|
|
7
|
-
...r,
|
|
8
|
-
...t
|
|
9
|
-
});
|
|
10
|
-
return Object.fromEntries(
|
|
11
|
-
o.map((e) => [
|
|
12
|
-
e,
|
|
13
|
-
d(
|
|
14
|
-
r[e],
|
|
15
|
-
t[e]
|
|
16
|
-
)
|
|
17
|
-
])
|
|
18
|
-
);
|
|
19
|
-
}, C = (r) => {
|
|
20
|
-
const { props: t, dependencies: o = [], children: e } = r, s = P(n), p = a(
|
|
21
|
-
() => i(s, t),
|
|
22
|
-
[s, ...o]
|
|
23
|
-
);
|
|
24
|
-
return /* @__PURE__ */ c.createElement(n.Provider, { value: p }, e);
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
C as P,
|
|
28
|
-
n as p
|
|
29
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
/* */
|
|
3
|
-
import { mergeProps as p } from "@react-aria/utils";
|
|
4
|
-
import s, { useContext as u } from "react";
|
|
5
|
-
import { P as c, p as d } from "./PropsContextProvider-C0o9mDtR.js";
|
|
6
|
-
import { pickBy as a } from "remeda";
|
|
7
|
-
function m(t) {
|
|
8
|
-
return !!t && typeof t == "object" && "__dynamicProp" in t;
|
|
9
|
-
}
|
|
10
|
-
const C = {
|
|
11
|
-
Text: !0,
|
|
12
|
-
Button: !0,
|
|
13
|
-
CopyButton: !0,
|
|
14
|
-
Icon: !0,
|
|
15
|
-
Label: !0,
|
|
16
|
-
Content: !0,
|
|
17
|
-
LayoutCard: !0,
|
|
18
|
-
Navigation: !0,
|
|
19
|
-
NavigationItem: !0,
|
|
20
|
-
Heading: !0,
|
|
21
|
-
InlineAlert: !0,
|
|
22
|
-
Link: !0,
|
|
23
|
-
Initials: !0,
|
|
24
|
-
Image: !0,
|
|
25
|
-
FieldError: !0,
|
|
26
|
-
FieldDescription: !0,
|
|
27
|
-
TestComponent: !0
|
|
28
|
-
}, f = Object.keys(
|
|
29
|
-
C
|
|
30
|
-
);
|
|
31
|
-
function i(t) {
|
|
32
|
-
return typeof t == "string" && f.includes(t);
|
|
33
|
-
}
|
|
34
|
-
function l(t) {
|
|
35
|
-
return !i(t);
|
|
36
|
-
}
|
|
37
|
-
const y = (t, r) => {
|
|
38
|
-
const e = {};
|
|
39
|
-
for (const n in t)
|
|
40
|
-
if (l(n)) {
|
|
41
|
-
const o = t[n];
|
|
42
|
-
m(o) ? e[n] = o.__dynamicProp(r) : e[n] = o;
|
|
43
|
-
}
|
|
44
|
-
return e;
|
|
45
|
-
};
|
|
46
|
-
function P(t) {
|
|
47
|
-
return !!t && typeof t == "object" && "children" in t && !!t.children;
|
|
48
|
-
}
|
|
49
|
-
const x = (t) => a(t, (r, e) => i(e)), h = (t, r) => {
|
|
50
|
-
const e = {};
|
|
51
|
-
if (!P(r) || typeof r.children != "object")
|
|
52
|
-
return e;
|
|
53
|
-
const n = x(t);
|
|
54
|
-
return {
|
|
55
|
-
children: /* @__PURE__ */ s.createElement(c, { props: n }, r.children)
|
|
56
|
-
};
|
|
57
|
-
}, I = (t, r) => {
|
|
58
|
-
const e = u(d)[t], n = e ? y(e, r) : void 0, o = e ? h(e, r) : void 0;
|
|
59
|
-
return p(
|
|
60
|
-
n,
|
|
61
|
-
r,
|
|
62
|
-
o
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
|
-
export {
|
|
66
|
-
I as u
|
|
67
|
-
};
|