@mittwald/flow-react-components 0.1.0-alpha.100 → 0.1.0-alpha.101

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.
@@ -0,0 +1,7 @@
1
+ import { ComponentProps, FC, PropsWithChildren } from 'react';
2
+
3
+ export interface AccordionProps extends PropsWithChildren<ComponentProps<"div">> {
4
+ defaultExpanded?: boolean;
5
+ }
6
+ export declare const Accordion: FC<AccordionProps>;
7
+ export default Accordion;
@@ -0,0 +1,4 @@
1
+ import { Accordion } from './Accordion';
2
+
3
+ export { Accordion, type AccordionProps } from './Accordion';
4
+ export default Accordion;
@@ -0,0 +1,9 @@
1
+ import { Accordion } from '..';
2
+ import { Meta, StoryObj } from '@storybook/react';
3
+
4
+ declare const meta: Meta<typeof Accordion>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof Accordion>;
7
+ export declare const Default: Story;
8
+ export declare const DefaultExpanded: Story;
9
+ export declare const WithLabel: Story;
@@ -0,0 +1,7 @@
1
+ import { Accordion } from '..';
2
+ import { Meta, StoryObj } from '@storybook/react';
3
+
4
+ declare const meta: Meta<typeof Accordion>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof Accordion>;
7
+ export declare const LongHeading: Story;
@@ -1,6 +1,7 @@
1
1
  import { ComponentProps, FC, PropsWithChildren } from 'react';
2
2
 
3
3
  export interface NavigationGroupProps extends PropsWithChildren<ComponentProps<"section">> {
4
+ collapsable?: boolean;
4
5
  }
5
6
  export declare const NavigationGroup: FC<NavigationGroupProps>;
6
7
  export default NavigationGroup;
@@ -7,3 +7,4 @@ type Story = StoryObj<typeof Navigation>;
7
7
  export declare const Default: Story;
8
8
  export declare const WithIcons: Story;
9
9
  export declare const WithGroups: Story;
10
+ export declare const WithCollapsableGroups: Story;
package/package.json CHANGED
@@ -1,19 +1,23 @@
1
1
  {
2
2
  "name": "@mittwald/flow-react-components",
3
- "version": "0.1.0-alpha.100",
3
+ "version": "0.1.0-alpha.101",
4
4
  "type": "module",
5
5
  "description": "A React implementation of Flow, mittwald’s design system",
6
6
  "homepage": "https://mittwald.github.io/flow",
7
7
  "repository": "https://github.com/mittwald/flow",
8
8
  "exports": {
9
- "./Avatar": {
10
- "types": "./dist/types/components/Avatar/index.d.ts",
11
- "import": "./dist/Avatar.js"
9
+ "./Accordion": {
10
+ "types": "./dist/types/components/Accordion/index.d.ts",
11
+ "import": "./dist/Accordion.js"
12
12
  },
13
13
  "./Action": {
14
14
  "types": "./dist/types/components/Action/index.d.ts",
15
15
  "import": "./dist/Action.js"
16
16
  },
17
+ "./Avatar": {
18
+ "types": "./dist/types/components/Avatar/index.d.ts",
19
+ "import": "./dist/Avatar.js"
20
+ },
17
21
  "./Button": {
18
22
  "types": "./dist/types/components/Button/index.d.ts",
19
23
  "import": "./dist/Button.js"
@@ -247,7 +251,7 @@
247
251
  },
248
252
  "dependencies": {
249
253
  "@chakra-ui/live-region": "^2.1.0",
250
- "@mittwald/react-tunnel": "^0.1.0-alpha.100",
254
+ "@mittwald/react-tunnel": "^0.1.0-alpha.101",
251
255
  "@mittwald/react-use-promise": "^2.3.13",
252
256
  "@react-aria/utils": "^3.24.0",
253
257
  "@react-types/shared": "^3.23.0",
@@ -271,7 +275,7 @@
271
275
  },
272
276
  "devDependencies": {
273
277
  "@faker-js/faker": "^8.4.1",
274
- "@mittwald/flow-design-tokens": "^0.1.0-alpha.100",
278
+ "@mittwald/flow-design-tokens": "^0.1.0-alpha.101",
275
279
  "@mittwald/react-use-promise": "^2.3.13",
276
280
  "@nx/storybook": "^18.3.4",
277
281
  "@storybook/addon-a11y": "^8.0.9",
@@ -321,7 +325,7 @@
321
325
  "tsx": "^4.8.2",
322
326
  "typescript": "^5.4.5",
323
327
  "typescript-plugin-css-modules": "^5.1.0",
324
- "vite": "^5.2.10",
328
+ "vite": "^5.2.11",
325
329
  "vite-plugin-banner": "^0.7.1",
326
330
  "vite-plugin-checker": "^0.6.4",
327
331
  "vite-plugin-dts": "^3.9.0",
@@ -347,5 +351,5 @@
347
351
  "optional": true
348
352
  }
349
353
  },
350
- "gitHead": "bd90d9d7734379653a36fbcffbbef208650c1d43"
354
+ "gitHead": "92754d0112a4d6f8afeb84b322c44f44d50bb91a"
351
355
  }
@@ -1,116 +0,0 @@
1
- "use client"
2
- /* */
3
- import o, { useEffect as S } from "react";
4
- import * as x from "react-aria-components";
5
- import F from "clsx";
6
- import { C as E } from "./ClearPropsContext-CeCMjUK9.js";
7
- import { P as y } from "./PropsContextProvider-DZvwqHLP.js";
8
- import "@react-aria/utils";
9
- import "./propsContext-CauylOgH.js";
10
- import "remeda";
11
- import "@tabler/icons-react";
12
- import "./Icon-DXXYYNLl.js";
13
- import { I as C, a as I } from "./IconSucceeded-DQfjj1t4.js";
14
- import { W as N } from "./Wrap-DGT1h1o3.js";
15
- import { T as h } from "./Text-DdC3zDyH.js";
16
- import { f as A } from "./flowComponent-CEBe_ATh.js";
17
- import { L as D } from "./LoadingSpinner-BmvbSvoO.js";
18
- import { useLocalizedStringFormatter as T } from "react-aria";
19
- import { useLiveRegion as z } from "@chakra-ui/live-region";
20
- const B = "flow--button", L = "flow--button--content", k = "flow--button--state-icon", R = "flow--button--avatar", K = "flow--button--icon", U = "flow--button--text", W = "flow--button--is-succeeded", $ = "flow--button--is-failed", j = "flow--button--is-pending", q = "flow--button--plain", G = "flow--button--primary", H = "flow--button--solid", J = "flow--button--aria-disabled", M = "flow--button--accent", O = "flow--button--danger", Q = "flow--button--secondary", V = "flow--button--soft", X = "flow--button--inverse", t = {
21
- button: B,
22
- content: L,
23
- stateIcon: k,
24
- avatar: R,
25
- icon: K,
26
- text: U,
27
- isSucceeded: W,
28
- isFailed: $,
29
- isPending: j,
30
- plain: q,
31
- "size-s": "flow--button--size-s",
32
- primary: G,
33
- solid: H,
34
- ariaDisabled: J,
35
- accent: M,
36
- danger: O,
37
- secondary: Q,
38
- soft: V,
39
- inverse: X
40
- }, Y = {
41
- "de-DE": {
42
- "action.isFailed": "Fehlgeschlagen",
43
- "action.isPending": "Ausstehend...",
44
- "action.isSucceeded": "Erfolgreich"
45
- },
46
- "en-EN": {
47
- "action.isFailed": "Failed",
48
- "action.isPending": "Pending...",
49
- "action.isSucceeded": "Succeeded"
50
- }
51
- }, Z = (e, c = {}) => {
52
- const i = T(Y), {
53
- isPendingText: a = i.format("action.isPending"),
54
- isSucceededText: r = i.format("action.isSucceeded"),
55
- isFailedText: s = i.format("action.isFailed")
56
- } = c, n = z({
57
- "aria-live": "polite",
58
- "aria-atomic": !1,
59
- "aria-relevant": "text additions",
60
- role: "status"
61
- });
62
- S(() => {
63
- e === "isPending" ? n.speak(a) : e === "isSucceeded" ? n.speak(r) : e === "isFailed" && n.speak(s);
64
- }, [e]);
65
- }, _ = (e) => ((e.isPending || e.isSucceeded || e.isFailed || e["aria-disabled"]) && (e = { ...e }, e.onPress = void 0, e.onPressStart = void 0, e.onPressEnd = void 0, e.onPressChange = void 0, e.onPressUp = void 0, e.onKeyDown = void 0, e.onKeyUp = void 0), e), ve = A("Button", (e) => {
66
- e = _(e);
67
- const {
68
- color: c = "primary",
69
- variant: i = "solid",
70
- children: a,
71
- className: r,
72
- size: s = "m",
73
- isPending: n,
74
- isSucceeded: d,
75
- isFailed: l,
76
- "aria-disabled": f,
77
- ref: u,
78
- inverse: b,
79
- ...g
80
- } = e, v = F(
81
- t.button,
82
- n && t.isPending,
83
- d && t.isSucceeded,
84
- l && t.isFailed,
85
- b && t.inverse,
86
- t[`size-${s}`],
87
- t[c],
88
- t[i],
89
- r,
90
- /**
91
- * Workaround warning: The Aria.Button does not support "aria-disabled" by
92
- * now, so this Button will be visually disabled via CSS.
93
- */
94
- f && t.ariaDisabled
95
- );
96
- Z(
97
- n ? "isPending" : d ? "isSucceeded" : l ? "isFailed" : "isIdle"
98
- );
99
- const P = {
100
- Icon: {
101
- className: t.icon,
102
- "aria-hidden": !0,
103
- size: s
104
- },
105
- Text: {
106
- className: t.text
107
- },
108
- Avatar: {
109
- className: t.avatar
110
- }
111
- }, m = d ? C : l ? I : n ? D : void 0, w = m && /* @__PURE__ */ o.createElement(m, { size: s, className: t.stateIcon }), p = typeof a == "string";
112
- return /* @__PURE__ */ o.createElement(E, null, /* @__PURE__ */ o.createElement(x.Button, { className: v, ref: u, ...g }, /* @__PURE__ */ o.createElement(y, { props: P }, /* @__PURE__ */ o.createElement("span", { className: t.content }, /* @__PURE__ */ o.createElement(N, { if: p }, /* @__PURE__ */ o.createElement(h, null, a)))), w));
113
- });
114
- export {
115
- ve as B
116
- };