@mittwald/flow-react-components 0.1.0-alpha.24 → 0.1.0-alpha.25

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.
@@ -6,13 +6,13 @@ declare const InlineAlert: FC<InlineAlertProps>;
6
6
  export { InlineAlert }
7
7
  export default InlineAlert;
8
8
 
9
- export declare interface InlineAlertProps extends PropsWithChildren<ComponentProps<"aside">>, PropsWithVariant {
9
+ export declare interface InlineAlertProps extends PropsWithChildren<ComponentProps<"aside">>, PropsWithStatus {
10
10
  }
11
11
 
12
- declare type PropsWithVariant<T extends Variant = Variant, P = unknown> = P & {
13
- variant?: T;
12
+ declare type PropsWithStatus<T extends Status = Status, P = unknown> = P & {
13
+ status?: T;
14
14
  };
15
15
 
16
- declare type Variant = "info" | "success" | "warning" | "danger";
16
+ declare type Status = "info" | "success" | "warning" | "danger";
17
17
 
18
18
  export { }
@@ -5,10 +5,10 @@ import "./propsContext-Dx7WKmmM.js";
5
5
  import { P as c } from "./PropsContextProvider-CEoxD8yK.js";
6
6
  import { u as m } from "./useProps-C7GIMcgB.js";
7
7
  import { c as f } from "./clsx-DB4S2d7J.js";
8
- import { S as p } from "./StatusIcon-BBNE68gH.js";
9
- const d = "flow--inline-alert", u = "flow--inline-alert--content", g = "flow--inline-alert--status-icon", w = "flow--inline-alert--heading", I = "flow--inline-alert--info", N = "flow--inline-alert--warning", h = "flow--inline-alert--danger", A = "flow--inline-alert--success", n = {
10
- inlineAlert: d,
11
- content: u,
8
+ import { S as p } from "./StatusIcon-BVWjvT3I.js";
9
+ const u = "flow--inline-alert", d = "flow--inline-alert--content", g = "flow--inline-alert--status-icon", w = "flow--inline-alert--heading", I = "flow--inline-alert--info", N = "flow--inline-alert--warning", h = "flow--inline-alert--danger", A = "flow--inline-alert--success", n = {
10
+ inlineAlert: u,
11
+ content: d,
12
12
  statusIcon: g,
13
13
  heading: w,
14
14
  info: I,
@@ -18,10 +18,10 @@ const d = "flow--inline-alert", u = "flow--inline-alert--content", g = "flow--in
18
18
  }, y = (s) => {
19
19
  const {
20
20
  children: o,
21
- className: a,
22
- variant: t = "info",
23
- ...l
24
- } = m("InlineAlert", s), i = f(n.inlineAlert, n[t], a), r = {
21
+ className: l,
22
+ status: t = "info",
23
+ ...a
24
+ } = m("InlineAlert", s), i = f(n.inlineAlert, n[t], l), r = {
25
25
  Heading: {
26
26
  className: n.heading,
27
27
  level: 3
@@ -30,7 +30,7 @@ const d = "flow--inline-alert", u = "flow--inline-alert--content", g = "flow--in
30
30
  className: n.content
31
31
  }
32
32
  };
33
- return /* @__PURE__ */ e.createElement("aside", { ...l, className: i }, /* @__PURE__ */ e.createElement(p, { className: n.statusIcon, variant: t }), /* @__PURE__ */ e.createElement(c, { props: r }, o));
33
+ return /* @__PURE__ */ e.createElement("aside", { ...a, className: i }, /* @__PURE__ */ e.createElement(p, { className: n.statusIcon, status: t }), /* @__PURE__ */ e.createElement(c, { props: r }, o));
34
34
  };
35
35
  export {
36
36
  y as InlineAlert,
@@ -1,21 +1,19 @@
1
- import { AriaMenuProps } from 'react-aria';
1
+ import * as Aria from 'react-aria-components';
2
2
  import { ComponentProps } from 'react';
3
- import { ComponentType } from 'react';
4
- import { ItemProps } from 'react-stately';
5
- import { default as React_2 } from 'react';
3
+ import { FC } from 'react';
4
+ import { PropsWithChildren } from 'react';
6
5
 
7
- declare function Navigation<T extends object>(props: NavigationProps<T>): React_2.JSX.Element;
6
+ declare const Navigation: FC<NavigationProps>;
8
7
  export { Navigation }
9
8
  export default Navigation;
10
9
 
11
- export declare const NavigationItem: ComponentType<NavigationItemProps<never>>;
10
+ export declare const NavigationItem: FC<NavigationItemProps>;
12
11
 
13
- export declare interface NavigationItemProps<T = never> extends ItemProps<T> {
12
+ export declare interface NavigationItemProps extends PropsWithChildren<Omit<Aria.LinkProps, "children">> {
14
13
  isCurrent?: boolean;
15
- linkComponent?: ComponentType<Omit<ComponentProps<"a">, "ref">>;
16
14
  }
17
15
 
18
- export declare interface NavigationProps<T = never> extends AriaMenuProps<T> {
16
+ export declare interface NavigationProps extends PropsWithChildren<ComponentProps<"nav">> {
19
17
  className?: string;
20
18
  }
21
19
 
@@ -1,53 +1,41 @@
1
1
  "use client"
2
2
  /* */
3
- import a from "react";
4
- import { useTreeState as p, Item as v } from "react-stately";
3
+ import t from "react";
4
+ import { c as r } from "./clsx-DB4S2d7J.js";
5
5
  import "./propsContext-Dx7WKmmM.js";
6
- import { P as g } from "./PropsContextProvider-CEoxD8yK.js";
6
+ import { P as m } from "./PropsContextProvider-CEoxD8yK.js";
7
7
  import "@react-aria/utils";
8
- import * as l from "remeda";
9
- import { useMenuItem as f, useMenu as I } from "react-aria";
10
- import { c as N } from "./clsx-DB4S2d7J.js";
11
- const x = "flow--navigation", c = {
12
- navigation: x
13
- }, P = "flow--navigation--navigation-item", y = "flow--navigation--navigation-item--icon", k = "flow--navigation--navigation-item--text", r = {
14
- navigationItem: P,
15
- icon: y,
16
- text: k
17
- }, C = (e, n, o) => {
18
- const t = f(e, n, o);
19
- return t.menuItemProps = l.omit(t.menuItemProps, ["role"]), t;
20
- };
21
- function E(e) {
22
- const { item: n, state: o } = e, { isCurrent: t, linkComponent: m = "a" } = n.props, i = a.useRef(null), { menuItemProps: s } = C({ key: n.key }, o, i), u = {
8
+ import * as v from "react-aria-components";
9
+ const g = "flow--navigation", p = {
10
+ navigation: g
11
+ }, w = (a) => {
12
+ const { className: n, children: o, ...e } = a, i = r(p.navigation, n);
13
+ return /* @__PURE__ */ t.createElement("nav", { className: i, role: "navigation", ...e }, /* @__PURE__ */ t.createElement("ul", null, o));
14
+ }, f = "flow--navigation--navigation-item", N = "flow--navigation--navigation-item--icon", x = "flow--navigation--navigation-item--text", s = {
15
+ navigationItem: f,
16
+ icon: N,
17
+ text: x
18
+ }, P = (a) => {
19
+ const { children: n, isCurrent: o, className: e, ...i } = a, c = r(s.navigationItem, e), l = {
23
20
  Text: {
24
- className: r.text
21
+ className: s.text
25
22
  },
26
23
  Icon: {
27
- className: r.icon
24
+ className: s.icon
28
25
  }
29
26
  };
30
- return /* @__PURE__ */ a.createElement("li", { className: r.navigationItem }, /* @__PURE__ */ a.createElement(
31
- m,
27
+ return /* @__PURE__ */ t.createElement("li", null, /* @__PURE__ */ t.createElement(
28
+ v.Link,
32
29
  {
33
- ...s,
34
- ref: i,
35
- "aria-current": t ? "page" : !1
30
+ className: c,
31
+ "aria-current": o ? "page" : !1,
32
+ ...i
36
33
  },
37
- /* @__PURE__ */ a.createElement(g, { props: u }, n.rendered)
34
+ /* @__PURE__ */ t.createElement(m, { props: l }, n)
38
35
  ));
39
- }
40
- const d = (e, n, o) => {
41
- const t = I(e, n, o);
42
- return t.menuProps = l.omit(t.menuProps, ["role"]), t;
43
36
  };
44
- function $(e) {
45
- const { className: n } = e, o = p(e), t = a.useRef(null), { menuProps: m } = d(e, o, t), i = N(c.navigation, n);
46
- return /* @__PURE__ */ a.createElement("nav", { ...m, className: i, ref: t }, /* @__PURE__ */ a.createElement("ul", { className: c.list }, Array.from(o.collection).map((s) => /* @__PURE__ */ a.createElement(E, { state: o, item: s, key: s.key }))));
47
- }
48
- const b = v;
49
37
  export {
50
- $ as Navigation,
51
- b as NavigationItem,
52
- $ as default
38
+ w as Navigation,
39
+ P as NavigationItem,
40
+ w as default
53
41
  };
@@ -0,0 +1,18 @@
1
+ import { FC } from 'react';
2
+ import { PropsWithChildren } from 'react';
3
+
4
+ declare type PropsWithStatus<T extends Status = Status, P = unknown> = P & {
5
+ status?: T;
6
+ };
7
+
8
+ declare type Status = "info" | "success" | "warning" | "danger";
9
+
10
+ declare const StatusBadge: FC<StatusBadgeProps>;
11
+ export { StatusBadge }
12
+ export default StatusBadge;
13
+
14
+ export declare interface StatusBadgeProps extends PropsWithChildren, PropsWithStatus {
15
+ className?: string;
16
+ }
17
+
18
+ export { }
@@ -0,0 +1,21 @@
1
+ "use client"
2
+ /* */
3
+ import t from "react";
4
+ import { c as l } from "./clsx-DB4S2d7J.js";
5
+ import { S as u } from "./StatusIcon-BVWjvT3I.js";
6
+ import { T as d } from "./Text--ofl9X5e.js";
7
+ const g = "flow--status-badge", m = "flow--status-badge--text", f = "flow--status-badge--info", i = "flow--status-badge--success", w = "flow--status-badge--warning", x = "flow--status-badge--danger", s = {
8
+ statusBadge: g,
9
+ text: m,
10
+ info: f,
11
+ success: i,
12
+ warning: w,
13
+ danger: x
14
+ }, E = (e) => {
15
+ const { children: o, className: n, status: a = "info", ...c } = e, r = l(s.statusBadge, s[a], n);
16
+ return /* @__PURE__ */ t.createElement("div", { className: r, ...c }, /* @__PURE__ */ t.createElement(u, { size: "s", className: s.statusIcon, status: a }), /* @__PURE__ */ t.createElement(d, { className: s.text }, o));
17
+ };
18
+ export {
19
+ E as StatusBadge,
20
+ E as default
21
+ };
@@ -26,8 +26,8 @@ const m = {
26
26
  info: e,
27
27
  success: i,
28
28
  warning: u
29
- }, W = (t) => {
30
- const { variant: n = "info", ...o } = t, s = I(m).format(`statusIcon.${n}`), r = g[n];
29
+ }, W = (n) => {
30
+ const { status: t = "info", ...o } = n, s = I(m).format(`statusIcon.${t}`), r = g[t];
31
31
  return /* @__PURE__ */ a.createElement(r, { "aria-label": s, ...o });
32
32
  };
33
33
  export {
@@ -7,19 +7,19 @@ declare interface IconProps extends PropsWithChildren<Omit<SvgAttributeProps, "n
7
7
  size?: "s" | "m" | "l";
8
8
  }
9
9
 
10
- declare type PropsWithVariant<T extends Variant = Variant, P = unknown> = P & {
11
- variant?: T;
10
+ declare type PropsWithStatus<T extends Status = Status, P = unknown> = P & {
11
+ status?: T;
12
12
  };
13
13
 
14
+ declare type Status = "info" | "success" | "warning" | "danger";
15
+
14
16
  declare const StatusIcon: FC<StatusIconProps>;
15
17
  export { StatusIcon }
16
18
  export default StatusIcon;
17
19
 
18
- export declare interface StatusIconProps extends PropsWithVariant, IconProps {
20
+ export declare interface StatusIconProps extends PropsWithStatus, IconProps {
19
21
  }
20
22
 
21
23
  declare type SvgAttributeProps = SVGAttributes<SVGSVGElement>;
22
24
 
23
- declare type Variant = "info" | "success" | "warning" | "danger";
24
-
25
25
  export { }
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
  /* */
3
- import { S as a } from "./StatusIcon-BBNE68gH.js";
3
+ import { S as a } from "./StatusIcon-BVWjvT3I.js";
4
4
  export {
5
5
  a as StatusIcon,
6
6
  a as default