@mittwald/flow-react-components 0.1.0-alpha.44 → 0.1.0-alpha.45
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/Initials.js +8 -8
- package/dist/List.js +18 -18
- package/dist/types/components/Initials/Initials.d.ts +1 -3
- package/dist/types/lib/propsContext/PropsContextProvider.d.ts +1 -1
- package/dist/types/lib/propsContext/index.d.ts +2 -1
- package/dist/types/lib/propsContext/mergePropsContext.d.ts +1 -1
- package/dist/types/lib/propsContext/nestedPropsContext/pickPropsContext.d.ts +1 -2
- package/package.json +2 -2
package/dist/Initials.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import e from "react";
|
|
4
|
+
import c from "clsx";
|
|
5
5
|
import "./PropsContextProvider-C7Evvjhy.js";
|
|
6
6
|
import "@react-aria/utils";
|
|
7
|
-
import { u as
|
|
8
|
-
import { onlyText as
|
|
9
|
-
const
|
|
10
|
-
initials:
|
|
7
|
+
import { u as p } from "./useProps-d5Do2me4.js";
|
|
8
|
+
import { onlyText as f } from "react-children-utilities";
|
|
9
|
+
const u = (i) => i.replace(/[^\p{L}\s]/giu, "").split(" ").map((t) => t.trim()[0]).filter((t) => t !== void 0).map((t) => t.toUpperCase()).slice(0, 2), d = "flow--initials", x = {
|
|
10
|
+
initials: d
|
|
11
11
|
}, v = (i) => {
|
|
12
|
-
const { children: t, className:
|
|
13
|
-
return /* @__PURE__ */
|
|
12
|
+
const { children: t, className: a } = p("Initials", i), s = f(t), n = u(s), o = c(x.initials, a), l = n.map((r, m) => /* @__PURE__ */ e.createElement("span", { key: m }, r));
|
|
13
|
+
return /* @__PURE__ */ e.createElement("div", { "aria-label": s, className: o }, l);
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
16
16
|
v as Initials,
|
package/dist/List.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var n = (i, t, e) => (
|
|
6
|
-
import r, { createContext as
|
|
3
|
+
var V = Object.defineProperty;
|
|
4
|
+
var B = (i, t, e) => t in i ? V(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
5
|
+
var n = (i, t, e) => (B(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
6
|
+
import r, { createContext as U, useContext as $, Suspense as D, createElement as x, useMemo as O, useEffect as I, isValidElement as H } from "react";
|
|
7
7
|
import { useMessageFormatter as j, useLocalizedStringFormatter as q } from "react-aria";
|
|
8
8
|
import { T as J } from "./Text-B5YK5s7t.js";
|
|
9
9
|
import { B as b } from "./Button-FPl3fKiM.js";
|
|
10
10
|
import "@tabler/icons-react";
|
|
11
11
|
import "./Icon-S-6j_Kl3.js";
|
|
12
|
-
import
|
|
12
|
+
import R from "clsx";
|
|
13
13
|
import "html-react-parser";
|
|
14
14
|
import "./PropsContextProvider-C7Evvjhy.js";
|
|
15
15
|
import "@react-aria/utils";
|
|
@@ -25,12 +25,12 @@ import { getAsyncResource as T } from "@mittwald/react-use-promise";
|
|
|
25
25
|
import { deepFind as st, deepForEach as nt } from "react-children-utilities";
|
|
26
26
|
import { I as rt } from "./InlineCode-CVs3jCiw.js";
|
|
27
27
|
import { ListLoaderAsyncResource as ot } from "./List/ListLoaderAsyncResource.js";
|
|
28
|
-
const
|
|
28
|
+
const M = U({}), g = () => $(M).list, lt = (i) => /* @__PURE__ */ r.createElement(r.Fragment, null, i.children()), ct = (i) => {
|
|
29
29
|
const { pageIndex: t } = i;
|
|
30
30
|
return g().loader.useSuspenseHook(t), null;
|
|
31
|
-
}, ut = () => g().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ r.createElement(
|
|
31
|
+
}, ut = () => g().loader.getLoaderInvocationHooks().map((t, e) => /* @__PURE__ */ r.createElement(D, { key: e, fallback: /* @__PURE__ */ r.createElement(ct, { pageIndex: e }) }, /* @__PURE__ */ r.createElement(lt, null, () => {
|
|
32
32
|
t();
|
|
33
|
-
}))),
|
|
33
|
+
}))), A = {
|
|
34
34
|
"de-DE": {
|
|
35
35
|
paginationInfo: "{visibleItemsCount} von insgesamt {totalItemsCount} angezeigt",
|
|
36
36
|
paginationInfoFiltered: "{visibleItemsCount} von insgesamt {filteredItemsCount} (gefiltert aus {totalItemsCount}) angezeigt",
|
|
@@ -42,7 +42,7 @@ const R = B({}), g = () => U(R).list, lt = (i) => /* @__PURE__ */ r.createElemen
|
|
|
42
42
|
showMore: "Show more"
|
|
43
43
|
}
|
|
44
44
|
}, gt = (i) => {
|
|
45
|
-
const t = j(
|
|
45
|
+
const t = j(A), e = g(), a = e.pagination, s = e.isFiltered() && !e.loader.manualFiltering, o = a.getTotalItemsCount(), c = a.getFilteredItemsCount(), l = a.getVisibleItemsCount();
|
|
46
46
|
if (o === 0)
|
|
47
47
|
return null;
|
|
48
48
|
const h = s ? t("paginationInfoFiltered", {
|
|
@@ -89,7 +89,7 @@ const R = B({}), g = () => U(R).list, lt = (i) => /* @__PURE__ */ r.createElemen
|
|
|
89
89
|
filterBar: wt
|
|
90
90
|
}, Ft = (i) => {
|
|
91
91
|
const { className: t } = i;
|
|
92
|
-
return /* @__PURE__ */ r.createElement("div", { className:
|
|
92
|
+
return /* @__PURE__ */ r.createElement("div", { className: R(t, Pt.filterBar) }, /* @__PURE__ */ r.createElement(ft, null), /* @__PURE__ */ r.createElement(vt, null));
|
|
93
93
|
}, Ct = "flow--list", It = "flow--list--filter-bar", Tt = "flow--list--items", Et = "flow--list--pagination-infos", Lt = "flow--list--show-more-button", d = {
|
|
94
94
|
list: Ct,
|
|
95
95
|
filterBar: It,
|
|
@@ -427,7 +427,7 @@ class zt {
|
|
|
427
427
|
);
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
let Vt = class
|
|
430
|
+
let Vt = class N {
|
|
431
431
|
constructor(t) {
|
|
432
432
|
n(this, "filters");
|
|
433
433
|
n(this, "sorting");
|
|
@@ -451,14 +451,14 @@ let Vt = class A {
|
|
|
451
451
|
});
|
|
452
452
|
}
|
|
453
453
|
static useNew(t) {
|
|
454
|
-
return new
|
|
454
|
+
return new N(t);
|
|
455
455
|
}
|
|
456
456
|
isFiltered() {
|
|
457
457
|
return this.filters.some((t) => t.isActive());
|
|
458
458
|
}
|
|
459
459
|
};
|
|
460
460
|
const Bt = (i) => {
|
|
461
|
-
const t = q(
|
|
461
|
+
const t = q(A), e = g(), a = e.loader.useIsLoading(), o = e.pagination.hasNextPage();
|
|
462
462
|
return /* @__PURE__ */ r.createElement(
|
|
463
463
|
b,
|
|
464
464
|
{
|
|
@@ -478,12 +478,12 @@ const Bt = (i) => {
|
|
|
478
478
|
const { children: t } = i;
|
|
479
479
|
return /* @__PURE__ */ r.createElement("div", { className: Ot.listItem }, t);
|
|
480
480
|
}, jt = (i) => {
|
|
481
|
-
const { className: t } = i, a = g().items.entries.map((s) => /* @__PURE__ */ r.createElement(Ht, { key: s.id }, s.render()));
|
|
482
|
-
return /* @__PURE__ */ r.createElement("div", { className:
|
|
483
|
-
},
|
|
481
|
+
const { className: t } = i, a = g().items.entries.map((s) => /* @__PURE__ */ r.createElement(Ht, { key: s.id }, /* @__PURE__ */ r.createElement(D, null, s.render())));
|
|
482
|
+
return /* @__PURE__ */ r.createElement("div", { className: R($t.items, t) }, a);
|
|
483
|
+
}, z = (i, t) => H(i) ? typeof t == "string" ? typeof i.type == "string" ? i.type === t : !1 : i.type === t : !1, p = (i, t) => st(i, (e) => z(e, t)), k = (i, t) => {
|
|
484
484
|
const e = [];
|
|
485
485
|
return nt(i, (a) => {
|
|
486
|
-
|
|
486
|
+
z(a, t) && e.push(a);
|
|
487
487
|
}), e;
|
|
488
488
|
};
|
|
489
489
|
function qt(i) {
|
|
@@ -525,7 +525,7 @@ function ye(i) {
|
|
|
525
525
|
...e
|
|
526
526
|
});
|
|
527
527
|
return /* @__PURE__ */ r.createElement(
|
|
528
|
-
|
|
528
|
+
M.Provider,
|
|
529
529
|
{
|
|
530
530
|
value: {
|
|
531
531
|
list: h
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from "react";
|
|
2
|
-
export interface InitialsProps extends PropsWithChildren
|
|
3
|
-
children: string;
|
|
4
|
-
}> {
|
|
2
|
+
export interface InitialsProps extends PropsWithChildren {
|
|
5
3
|
className?: string;
|
|
6
4
|
}
|
|
7
5
|
export declare const Initials: FC<InitialsProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DependencyList, FC, PropsWithChildren } from "react";
|
|
2
|
-
import { PropsContext as PropsContextShape } from '
|
|
2
|
+
import { PropsContext as PropsContextShape } from './types';
|
|
3
3
|
interface Props extends PropsWithChildren {
|
|
4
4
|
props: PropsContextShape;
|
|
5
5
|
dependencies?: DependencyList;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ClearPropsContext } from './ClearPropsContext';
|
|
2
|
-
export { dynamic } from "./dynamicProps/dynamic";
|
|
3
2
|
export { PropsContextProvider } from "./PropsContextProvider";
|
|
4
3
|
export { useProps } from "./useProps";
|
|
5
4
|
export type { PropsContext } from "./types";
|
|
5
|
+
import { useProps } from "./useProps";
|
|
6
|
+
export default useProps;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { PropsContext } from '
|
|
2
|
-
import { ComponentPropsContext } from '../types';
|
|
1
|
+
import { ComponentPropsContext, PropsContext } from '../types';
|
|
3
2
|
export declare const pickPropsContext: <C extends keyof import('../../../components/propTypes').FlowComponentPropsTypes>(props: ComponentPropsContext<C>) => PropsContext;
|
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.45",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -253,5 +253,5 @@
|
|
|
253
253
|
"optional": true
|
|
254
254
|
}
|
|
255
255
|
},
|
|
256
|
-
"gitHead": "
|
|
256
|
+
"gitHead": "be9d031d09a0fce11fbd3d7258edc95da99f106e"
|
|
257
257
|
}
|