@apipass/design-system 7.4.7 → 8.1.0
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/lib/embedded-styles.js +2 -2
- package/dist/lib/lib.index.cjs +1 -1
- package/dist/lib/lib.index.js +809 -795
- package/dist/lib/lib.index.js.map +1 -1
- package/dist/lib/style.css +1 -1
- package/dist/lib/ui/components/ConfirmDialog/ConfirmDialog.cjs +1 -1
- package/dist/lib/ui/components/ConfirmDialog/ConfirmDialog.cjs.map +1 -1
- package/dist/lib/ui/components/ConfirmDialog/ConfirmDialog.js +27 -25
- package/dist/lib/ui/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
- package/dist/lib/ui/components/DataTable/DataTable.cjs +1 -1
- package/dist/lib/ui/components/DataTable/DataTable.cjs.map +1 -1
- package/dist/lib/ui/components/DataTable/DataTable.js +210 -174
- package/dist/lib/ui/components/DataTable/DataTable.js.map +1 -1
- package/dist/lib/ui/components/FormModal/FormModal.cjs +1 -1
- package/dist/lib/ui/components/FormModal/FormModal.cjs.map +1 -1
- package/dist/lib/ui/components/FormModal/FormModal.js +22 -21
- package/dist/lib/ui/components/FormModal/FormModal.js.map +1 -1
- package/dist/lib/ui/components/LoadingOverlay/LoadingOverlay.cjs +2 -0
- package/dist/lib/ui/components/LoadingOverlay/LoadingOverlay.cjs.map +1 -0
- package/dist/lib/ui/components/LoadingOverlay/LoadingOverlay.js +36 -0
- package/dist/lib/ui/components/LoadingOverlay/LoadingOverlay.js.map +1 -0
- package/dist/lib/ui/components/PageLoadingState/PageLoadingState.cjs +2 -0
- package/dist/lib/ui/components/PageLoadingState/PageLoadingState.cjs.map +1 -0
- package/dist/lib/ui/components/PageLoadingState/PageLoadingState.js +18 -0
- package/dist/lib/ui/components/PageLoadingState/PageLoadingState.js.map +1 -0
- package/dist/lib/ui/hooks/useAnimationFrame.cjs +2 -0
- package/dist/lib/ui/hooks/useAnimationFrame.cjs.map +1 -0
- package/dist/lib/ui/hooks/useAnimationFrame.js +24 -0
- package/dist/lib/ui/hooks/useAnimationFrame.js.map +1 -0
- package/dist/lib/ui/hooks/useLoadingVisibility.cjs +2 -0
- package/dist/lib/ui/hooks/useLoadingVisibility.cjs.map +1 -0
- package/dist/lib/ui/hooks/useLoadingVisibility.js +34 -0
- package/dist/lib/ui/hooks/useLoadingVisibility.js.map +1 -0
- package/dist/lib/ui/hooks/useMediaQuery.cjs +1 -1
- package/dist/lib/ui/hooks/useMediaQuery.cjs.map +1 -1
- package/dist/lib/ui/hooks/useMediaQuery.js +5 -2
- package/dist/lib/ui/hooks/useMediaQuery.js.map +1 -1
- package/dist/lib/ui/primitives/BrandLoader/BrandLoader.cjs +2 -0
- package/dist/lib/ui/primitives/BrandLoader/BrandLoader.cjs.map +1 -0
- package/dist/lib/ui/primitives/BrandLoader/BrandLoader.js +165 -0
- package/dist/lib/ui/primitives/BrandLoader/BrandLoader.js.map +1 -0
- package/dist/lib/ui/primitives/BrandLoader/BrandLoaderProvider.cjs +2 -0
- package/dist/lib/ui/primitives/BrandLoader/BrandLoaderProvider.cjs.map +1 -0
- package/dist/lib/ui/primitives/BrandLoader/BrandLoaderProvider.js +9 -0
- package/dist/lib/ui/primitives/BrandLoader/BrandLoaderProvider.js.map +1 -0
- package/dist/lib/ui/primitives/BrandLoader/brandLoaderSymbolContext.cjs +2 -0
- package/dist/lib/ui/primitives/BrandLoader/brandLoaderSymbolContext.cjs.map +1 -0
- package/dist/lib/ui/primitives/BrandLoader/brandLoaderSymbolContext.js +10 -0
- package/dist/lib/ui/primitives/BrandLoader/brandLoaderSymbolContext.js.map +1 -0
- package/dist/lib/ui/primitives/BrandLoader/brandLoaderVariants.cjs +2 -0
- package/dist/lib/ui/primitives/BrandLoader/brandLoaderVariants.cjs.map +1 -0
- package/dist/lib/ui/primitives/BrandLoader/brandLoaderVariants.js +166 -0
- package/dist/lib/ui/primitives/BrandLoader/brandLoaderVariants.js.map +1 -0
- package/dist/lib/ui/primitives/Button/Button.cjs +1 -1
- package/dist/lib/ui/primitives/Button/Button.cjs.map +1 -1
- package/dist/lib/ui/primitives/Button/Button.js +72 -49
- package/dist/lib/ui/primitives/Button/Button.js.map +1 -1
- package/dist/lib/ui/primitives/DateRangePicker/DateRangePicker.cjs +1 -1
- package/dist/lib/ui/primitives/DateRangePicker/DateRangePicker.cjs.map +1 -1
- package/dist/lib/ui/primitives/DateRangePicker/DateRangePicker.js +235 -229
- package/dist/lib/ui/primitives/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/lib/ui/primitives/DateRangePicker/dateRangePresets.cjs +1 -1
- package/dist/lib/ui/primitives/DateRangePicker/dateRangePresets.cjs.map +1 -1
- package/dist/lib/ui/primitives/DateRangePicker/dateRangePresets.js +26 -21
- package/dist/lib/ui/primitives/DateRangePicker/dateRangePresets.js.map +1 -1
- package/dist/lib/ui/primitives/IconButton/IconButton.cjs +1 -1
- package/dist/lib/ui/primitives/IconButton/IconButton.cjs.map +1 -1
- package/dist/lib/ui/primitives/IconButton/IconButton.js +11 -11
- package/dist/lib/ui/primitives/IconButton/IconButton.js.map +1 -1
- package/dist/lib/ui/primitives/LoadingState/LoadingState.cjs +2 -0
- package/dist/lib/ui/primitives/LoadingState/LoadingState.cjs.map +1 -0
- package/dist/lib/ui/primitives/LoadingState/LoadingState.js +33 -0
- package/dist/lib/ui/primitives/LoadingState/LoadingState.js.map +1 -0
- package/dist/lib/ui/primitives/PermissionGate/PermissionGate.cjs +1 -1
- package/dist/lib/ui/primitives/PermissionGate/PermissionGate.cjs.map +1 -1
- package/dist/lib/ui/primitives/PermissionGate/PermissionGate.js +14 -9
- package/dist/lib/ui/primitives/PermissionGate/PermissionGate.js.map +1 -1
- package/dist/lib/ui/primitives/Tree/Tree.cjs +1 -1
- package/dist/lib/ui/primitives/Tree/Tree.cjs.map +1 -1
- package/dist/lib/ui/primitives/Tree/Tree.js +31 -24
- package/dist/lib/ui/primitives/Tree/Tree.js.map +1 -1
- package/dist/types/ui/components/DataTable/DataTable.d.ts +31 -8
- package/dist/types/ui/components/LoadingOverlay/LoadingOverlay.d.ts +13 -0
- package/dist/types/ui/components/PageLoadingState/PageLoadingState.d.ts +4 -0
- package/dist/types/ui/components/index.d.ts +2 -1
- package/dist/types/ui/hooks/index.d.ts +1 -0
- package/dist/types/ui/hooks/useAnimationFrame.d.ts +3 -0
- package/dist/types/ui/hooks/useLoadingVisibility.d.ts +7 -0
- package/dist/types/ui/primitives/BrandLoader/BrandLoader.d.ts +25 -0
- package/dist/types/ui/primitives/BrandLoader/BrandLoaderProvider.d.ts +7 -0
- package/dist/types/ui/primitives/BrandLoader/brandLoaderSymbolContext.d.ts +3 -0
- package/dist/types/ui/primitives/BrandLoader/brandLoaderVariants.d.ts +33 -0
- package/dist/types/ui/primitives/Button/Button.d.ts +1 -0
- package/dist/types/ui/primitives/DateRangePicker/DateRangePicker.d.ts +3 -2
- package/dist/types/ui/primitives/DateRangePicker/dateRangePresets.d.ts +5 -0
- package/dist/types/ui/primitives/LoadingState/LoadingState.d.ts +10 -0
- package/dist/types/ui/primitives/PermissionGate/PermissionGate.d.ts +16 -6
- package/dist/types/ui/primitives/index.d.ts +2 -0
- package/package.json +4 -2
- package/dist/lib/ui/components/WidgetLoadingState/WidgetLoadingState.cjs +0 -2
- package/dist/lib/ui/components/WidgetLoadingState/WidgetLoadingState.cjs.map +0 -1
- package/dist/lib/ui/components/WidgetLoadingState/WidgetLoadingState.js +0 -27
- package/dist/lib/ui/components/WidgetLoadingState/WidgetLoadingState.js.map +0 -1
- package/dist/types/ui/components/WidgetLoadingState/WidgetLoadingState.d.ts +0 -6
|
@@ -1,54 +1,61 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { clsx as
|
|
3
|
-
import { Tree as
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as C } from "../../../vendor/clsx/dist/clsx.js";
|
|
3
|
+
import { Tree as v, TreeItem as h, Collection as x, TreeItemContent as I, Button as T } from "react-aria-components";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import {
|
|
6
|
-
import { IconChevronRight as
|
|
7
|
-
function
|
|
5
|
+
import { BrandLoader as b } from "../BrandLoader/BrandLoader.js";
|
|
6
|
+
import { IconChevronRight as B } from "../../icons/IconChevronRight.js";
|
|
7
|
+
function N(t) {
|
|
8
8
|
return t.hasChildItems ?? !!(t.children && t.children.length > 0);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function u(t, i) {
|
|
11
|
+
return t.flatMap((n) => [
|
|
12
|
+
...i(n.id) ? [n.id] : [],
|
|
13
|
+
...u(n.children ?? [], i)
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
16
|
+
function O({
|
|
11
17
|
className: t,
|
|
12
18
|
items: i,
|
|
13
|
-
renderItem:
|
|
14
|
-
isNodeLoading:
|
|
19
|
+
renderItem: n,
|
|
20
|
+
isNodeLoading: l,
|
|
15
21
|
onItemAction: c,
|
|
16
|
-
dependencies:
|
|
17
|
-
...
|
|
22
|
+
dependencies: o,
|
|
23
|
+
...p
|
|
18
24
|
}) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
const f = l ? JSON.stringify(u(i, l)) : "", a = [...o ?? [], f];
|
|
26
|
+
function s(e) {
|
|
27
|
+
return /* @__PURE__ */ d(
|
|
28
|
+
h,
|
|
22
29
|
{
|
|
23
30
|
id: e.id,
|
|
24
31
|
textValue: e.label,
|
|
25
|
-
hasChildItems:
|
|
32
|
+
hasChildItems: N(e),
|
|
26
33
|
className: "tree-item",
|
|
27
34
|
onAction: c ? () => c(e) : void 0,
|
|
28
35
|
children: [
|
|
29
|
-
/* @__PURE__ */ r(
|
|
30
|
-
e.children && e.children.length > 0 && /* @__PURE__ */ r(
|
|
31
|
-
((
|
|
36
|
+
/* @__PURE__ */ r(m, { children: n(e) }),
|
|
37
|
+
e.children && e.children.length > 0 && /* @__PURE__ */ r(x, { items: e.children, dependencies: a, children: s }),
|
|
38
|
+
((l == null ? void 0 : l(e.id)) ?? !1) && /* @__PURE__ */ r(h, { id: `${e.id}::loading`, textValue: "Loading", isDisabled: !0, className: "tree-item", children: /* @__PURE__ */ r(m, { children: /* @__PURE__ */ r(b, { "aria-hidden": !0, variant: "pulse", size: "16", tone: "brand" }) }) })
|
|
32
39
|
]
|
|
33
40
|
}
|
|
34
41
|
);
|
|
35
42
|
}
|
|
36
|
-
return /* @__PURE__ */ r(
|
|
43
|
+
return /* @__PURE__ */ r(v, { items: i, className: C(t, "tree"), dependencies: a, ...p, children: s });
|
|
37
44
|
}
|
|
38
|
-
function
|
|
39
|
-
return /* @__PURE__ */ r(
|
|
45
|
+
function m({ children: t }) {
|
|
46
|
+
return /* @__PURE__ */ r(I, { children: ({ hasChildItems: i, level: n }) => /* @__PURE__ */ d(
|
|
40
47
|
"div",
|
|
41
48
|
{
|
|
42
49
|
className: "tree-item-row",
|
|
43
|
-
style: { "--tree-item-depth":
|
|
50
|
+
style: { "--tree-item-depth": n - 1 },
|
|
44
51
|
children: [
|
|
45
|
-
i ? /* @__PURE__ */ r(
|
|
52
|
+
i ? /* @__PURE__ */ r(T, { slot: "chevron", className: "tree-item-chevron", children: /* @__PURE__ */ r(B, { size: "16" }) }) : /* @__PURE__ */ r("span", { className: "tree-item-chevron-spacer", "aria-hidden": "true" }),
|
|
46
53
|
t
|
|
47
54
|
]
|
|
48
55
|
}
|
|
49
56
|
) });
|
|
50
57
|
}
|
|
51
58
|
export {
|
|
52
|
-
|
|
59
|
+
O as Tree
|
|
53
60
|
};
|
|
54
61
|
//# sourceMappingURL=Tree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.js","sources":["../../../../../src/ui/primitives/Tree/Tree.tsx"],"sourcesContent":["import type { CSSProperties, Key, ReactNode } from \"react\";\nimport clsx from \"clsx\";\nimport { IconChevronRight
|
|
1
|
+
{"version":3,"file":"Tree.js","sources":["../../../../../src/ui/primitives/Tree/Tree.tsx"],"sourcesContent":["import type { CSSProperties, Key, ReactNode } from \"react\";\nimport clsx from \"clsx\";\nimport { IconChevronRight } from \"icons\";\nimport { BrandLoader } from \"primitives\";\nimport {\n Button,\n Collection,\n Tree as RACTree,\n TreeItem as RACTreeItem,\n TreeItemContent as RACTreeItemContent,\n type TreeProps as RACTreeProps,\n} from \"react-aria-components\";\nimport \"./tree.css\";\n\nexport interface TreeNode<T = unknown> {\n id: string;\n label: string;\n data?: T;\n /** Signals a node has children before they are fetched, so the chevron renders ahead of a lazy load. */\n hasChildItems?: boolean;\n /** `undefined` = not loaded yet, `[]` = loaded and empty. */\n children?: TreeNode<T>[];\n}\n\nexport type TreeProps<T> = Omit<\n RACTreeProps<TreeNode<T>>,\n \"children\" | \"items\"\n> & {\n items: TreeNode<T>[];\n renderItem: (node: TreeNode<T>) => ReactNode;\n isNodeLoading?: (id: Key) => boolean;\n onItemAction?: (node: TreeNode<T>) => void;\n};\n\nfunction hasExpandableChildren<T>(node: TreeNode<T>): boolean {\n return node.hasChildItems ?? Boolean(node.children && node.children.length > 0);\n}\n\nfunction loadingNodeIdsOf<T>(nodes: TreeNode<T>[], isNodeLoading: (id: Key) => boolean): string[] {\n return nodes.flatMap((node) => [\n ...(isNodeLoading(node.id) ? [node.id] : []),\n ...loadingNodeIdsOf(node.children ?? [], isNodeLoading),\n ]);\n}\n\nexport function Tree<T>({\n className,\n items,\n renderItem,\n isNodeLoading,\n onItemAction,\n dependencies,\n ...props\n}: TreeProps<T>) {\n const loadingNodesSignature = isNodeLoading\n ? JSON.stringify(loadingNodeIdsOf(items, isNodeLoading))\n : \"\";\n const itemDependencies = [...(dependencies ?? []), loadingNodesSignature];\n\n function renderNode(node: TreeNode<T>): ReactNode {\n return (\n <RACTreeItem\n id={node.id}\n textValue={node.label}\n hasChildItems={hasExpandableChildren(node)}\n className=\"tree-item\"\n onAction={onItemAction ? () => onItemAction(node) : undefined}\n >\n <TreeItemContent>{renderItem(node)}</TreeItemContent>\n {node.children && node.children.length > 0 && (\n <Collection items={node.children} dependencies={itemDependencies}>\n {renderNode}\n </Collection>\n )}\n {(isNodeLoading?.(node.id) ?? false) && (\n <RACTreeItem id={`${node.id}::loading`} textValue=\"Loading\" isDisabled className=\"tree-item\">\n <TreeItemContent>\n <BrandLoader aria-hidden variant=\"pulse\" size=\"16\" tone=\"brand\" />\n </TreeItemContent>\n </RACTreeItem>\n )}\n </RACTreeItem>\n );\n }\n\n return (\n <RACTree items={items} className={clsx(className, \"tree\")} dependencies={itemDependencies} {...props}>\n {renderNode}\n </RACTree>\n );\n}\n\ninterface TreeItemContentProps {\n children: ReactNode;\n}\n\nfunction TreeItemContent({ children }: TreeItemContentProps) {\n return (\n <RACTreeItemContent>\n {({ hasChildItems, level }) => (\n <div\n className=\"tree-item-row\"\n style={{ \"--tree-item-depth\": level - 1 } as CSSProperties}\n >\n {hasChildItems ? (\n <Button slot=\"chevron\" className=\"tree-item-chevron\">\n <IconChevronRight size=\"16\" />\n </Button>\n ) : (\n <span className=\"tree-item-chevron-spacer\" aria-hidden=\"true\" />\n )}\n {children}\n </div>\n )}\n </RACTreeItemContent>\n );\n}\n"],"names":["hasExpandableChildren","node","loadingNodeIdsOf","nodes","isNodeLoading","Tree","className","items","renderItem","onItemAction","dependencies","props","loadingNodesSignature","itemDependencies","renderNode","jsxs","RACTreeItem","jsx","TreeItemContent","Collection","BrandLoader","RACTree","clsx","children","RACTreeItemContent","hasChildItems","level","Button","IconChevronRight"],"mappings":";;;;;;AAkCA,SAASA,EAAyBC,GAA4B;AAC5D,SAAOA,EAAK,iBAAiB,GAAQA,EAAK,YAAYA,EAAK,SAAS,SAAS;AAC/E;AAEA,SAASC,EAAoBC,GAAsBC,GAA+C;AAChG,SAAOD,EAAM,QAAQ,CAACF,MAAS;AAAA,IAC7B,GAAIG,EAAcH,EAAK,EAAE,IAAI,CAACA,EAAK,EAAE,IAAI,CAAA;AAAA,IACzC,GAAGC,EAAiBD,EAAK,YAAY,CAAA,GAAIG,CAAa;AAAA,EAAA,CACvD;AACH;AAEO,SAASC,EAAQ;AAAA,EACtB,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAJ;AAAA,EACA,cAAAK;AAAA,EACA,cAAAC;AAAA,EACA,GAAGC;AACL,GAAiB;AACf,QAAMC,IAAwBR,IAC1B,KAAK,UAAUF,EAAiBK,GAAOH,CAAa,CAAC,IACrD,IACES,IAAmB,CAAC,GAAIH,KAAgB,CAAA,GAAKE,CAAqB;AAExE,WAASE,EAAWb,GAA8B;AAChD,WACE,gBAAAc;AAAA,MAACC;AAAAA,MAAA;AAAA,QACC,IAAIf,EAAK;AAAA,QACT,WAAWA,EAAK;AAAA,QAChB,eAAeD,EAAsBC,CAAI;AAAA,QACzC,WAAU;AAAA,QACV,UAAUQ,IAAe,MAAMA,EAAaR,CAAI,IAAI;AAAA,QAEpD,UAAA;AAAA,UAAA,gBAAAgB,EAACC,GAAA,EAAiB,UAAAV,EAAWP,CAAI,EAAA,CAAE;AAAA,UAClCA,EAAK,YAAYA,EAAK,SAAS,SAAS,KACvC,gBAAAgB,EAACE,GAAA,EAAW,OAAOlB,EAAK,UAAU,cAAcY,GAC7C,UAAAC,GACH;AAAA,YAEAV,KAAA,gBAAAA,EAAgBH,EAAK,QAAO,OAC5B,gBAAAgB,EAACD,GAAA,EAAY,IAAI,GAAGf,EAAK,EAAE,aAAa,WAAU,WAAU,YAAU,IAAC,WAAU,aAC/E,UAAA,gBAAAgB,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACG,KAAY,eAAW,IAAC,SAAQ,SAAQ,MAAK,MAAK,MAAK,QAAA,CAAQ,GAClE,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AAEA,SACE,gBAAAH,EAACI,GAAA,EAAQ,OAAAd,GAAc,WAAWe,EAAKhB,GAAW,MAAM,GAAG,cAAcO,GAAmB,GAAGF,GAC5F,UAAAG,EAAA,CACH;AAEJ;AAMA,SAASI,EAAgB,EAAE,UAAAK,KAAkC;AAC3D,2BACGC,GAAA,EACE,UAAA,CAAC,EAAE,eAAAC,GAAe,OAAAC,QACjB,gBAAAX;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,qBAAqBW,IAAQ,EAAA;AAAA,MAErC,UAAA;AAAA,QAAAD,sBACEE,GAAA,EAAO,MAAK,WAAU,WAAU,qBAC/B,UAAA,gBAAAV,EAACW,GAAA,EAAiB,MAAK,KAAA,CAAK,GAC9B,IAEA,gBAAAX,EAAC,UAAK,WAAU,4BAA2B,eAAY,QAAO;AAAA,QAE/DM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAGP;AAEJ;"}
|
|
@@ -14,7 +14,15 @@ export interface Column<T> {
|
|
|
14
14
|
sortValue?: (item: T) => SortableValue;
|
|
15
15
|
}
|
|
16
16
|
type SortableValue = string | number | Date | null | undefined;
|
|
17
|
-
|
|
17
|
+
type RowActionPendingProps = {
|
|
18
|
+
isPending?: false;
|
|
19
|
+
pendingLabel?: string;
|
|
20
|
+
} | {
|
|
21
|
+
isPending: boolean;
|
|
22
|
+
/** Tooltip text shown while `isPending`. */
|
|
23
|
+
pendingLabel: string;
|
|
24
|
+
};
|
|
25
|
+
export type RowActionDef<T> = RowActionPendingProps & {
|
|
18
26
|
/** Unique key for this action. */
|
|
19
27
|
key: string;
|
|
20
28
|
/** aria-label for the button. */
|
|
@@ -27,8 +35,8 @@ export interface RowActionDef<T> {
|
|
|
27
35
|
noAccessLabel?: string;
|
|
28
36
|
/** Called with the row item when the button is pressed. */
|
|
29
37
|
onPress: (item: T) => void;
|
|
30
|
-
}
|
|
31
|
-
|
|
38
|
+
};
|
|
39
|
+
interface DataTableBaseProps<T extends {
|
|
32
40
|
id: string;
|
|
33
41
|
}> {
|
|
34
42
|
columns: Column<T>[];
|
|
@@ -72,22 +80,37 @@ export interface DataTableProps<T extends {
|
|
|
72
80
|
maxHeight?: number | string;
|
|
73
81
|
searchPlaceholder?: string;
|
|
74
82
|
searchKeys?: (keyof T)[];
|
|
75
|
-
isLoading?: boolean;
|
|
76
|
-
loadingMessage?: string;
|
|
77
83
|
emptyMessage?: string;
|
|
78
84
|
previousLabel?: string;
|
|
79
85
|
nextLabel?: string;
|
|
80
86
|
pageSize?: number;
|
|
81
87
|
nestedColumns?: Column<any>[];
|
|
82
|
-
getNestedData?: (item: T) => any[] | Promise<any[]>;
|
|
83
|
-
nestedLoadingMessage?: string;
|
|
84
88
|
nestedEmptyMessage?: string;
|
|
85
89
|
nestedSearchKeys?: (keyof any)[];
|
|
86
90
|
nestedSearchPlaceholder?: string;
|
|
87
91
|
nestedActions?: (item: T) => ReactNode;
|
|
88
92
|
nestedPageSize?: number;
|
|
89
93
|
}
|
|
94
|
+
type DataTableLoadingProps = {
|
|
95
|
+
isLoading?: false;
|
|
96
|
+
isRefreshing?: false;
|
|
97
|
+
loadingMessage?: string;
|
|
98
|
+
} | {
|
|
99
|
+
isLoading?: boolean;
|
|
100
|
+
isRefreshing?: boolean;
|
|
101
|
+
loadingMessage: string;
|
|
102
|
+
};
|
|
103
|
+
type DataTableNestedLoadingProps<T> = {
|
|
104
|
+
getNestedData?: undefined;
|
|
105
|
+
nestedLoadingMessage?: string;
|
|
106
|
+
} | {
|
|
107
|
+
getNestedData: (item: T) => any[] | Promise<any[]>;
|
|
108
|
+
nestedLoadingMessage: string;
|
|
109
|
+
};
|
|
110
|
+
export type DataTableProps<T extends {
|
|
111
|
+
id: string;
|
|
112
|
+
}> = DataTableBaseProps<T> & DataTableLoadingProps & DataTableNestedLoadingProps<T>;
|
|
90
113
|
export declare function DataTable<T extends {
|
|
91
114
|
id: string;
|
|
92
|
-
}>({ columns, data, actions, rowActions, rowActionsLabel, selectable, selectionType, selectedKeys, onSelectionChange, defaultSortDescriptor, sortDescriptor: controlledSortDescriptor, onSortChange, ariaLabel, dense, striped, maxHeight, searchPlaceholder, searchKeys, isLoading, loadingMessage, emptyMessage, previousLabel, nextLabel, pageSize, nestedColumns, getNestedData, nestedLoadingMessage, nestedEmptyMessage, nestedSearchKeys, nestedSearchPlaceholder, nestedActions, nestedPageSize, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
115
|
+
}>({ columns, data, actions, rowActions, rowActionsLabel, selectable, selectionType, selectedKeys, onSelectionChange, defaultSortDescriptor, sortDescriptor: controlledSortDescriptor, onSortChange, ariaLabel, dense, striped, maxHeight, searchPlaceholder, searchKeys, isLoading, isRefreshing, loadingMessage, emptyMessage, previousLabel, nextLabel, pageSize, nestedColumns, getNestedData, nestedLoadingMessage, nestedEmptyMessage, nestedSearchKeys, nestedSearchPlaceholder, nestedActions, nestedPageSize, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
93
116
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type BrandLoaderSize, type BrandLoaderVariant } from "primitives";
|
|
2
|
+
import "./loading-overlay.css";
|
|
3
|
+
export type LoadingOverlayProps = {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
variant?: BrandLoaderVariant;
|
|
8
|
+
size?: BrandLoaderSize;
|
|
9
|
+
delayMs?: number;
|
|
10
|
+
minVisibleMs?: number;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function LoadingOverlay({ isOpen, label, message, variant, size, delayMs, minVisibleMs, className, }: LoadingOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type LoadingStateProps } from "primitives";
|
|
2
|
+
import "./page-loading-state.css";
|
|
3
|
+
export type PageLoadingStateProps = Omit<LoadingStateProps, "size">;
|
|
4
|
+
export declare function PageLoadingState({ className, ...props }: PageLoadingStateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,10 +5,11 @@ export * from "./ConfirmDialog/ConfirmDialog";
|
|
|
5
5
|
export * from "./DataTable/DataTable";
|
|
6
6
|
export * from "./FormModal/FormModal";
|
|
7
7
|
export * from "./KeyValue/KeyValue";
|
|
8
|
+
export * from "./LoadingOverlay/LoadingOverlay";
|
|
8
9
|
export * from "./PageHeader/PageHeader";
|
|
10
|
+
export * from "./PageLoadingState/PageLoadingState";
|
|
9
11
|
export * from "./Sidebar/Sidebar";
|
|
10
12
|
export * from "./Widget/Widget";
|
|
11
13
|
export * from "./WidgetEmptyState/WidgetEmptyState";
|
|
12
14
|
export * from "./WidgetErrorState/WidgetErrorState";
|
|
13
15
|
export * from "./WidgetGrid/WidgetGrid";
|
|
14
|
-
export * from "./WidgetLoadingState/WidgetLoadingState";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type LoadingVisibilityOptions = {
|
|
2
|
+
delayMs?: number;
|
|
3
|
+
minVisibleMs?: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const defaultLoadingDelayMs = 200;
|
|
6
|
+
export declare const defaultLoadingMinVisibleMs = 400;
|
|
7
|
+
export declare function useLoadingVisibility(isLoading: boolean, { delayMs, minVisibleMs, }?: LoadingVisibilityOptions): boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import { type BrandLoaderVariant } from "./brandLoaderVariants";
|
|
3
|
+
import { type BrandLoaderSymbol } from "./brandLoaderSymbolContext";
|
|
4
|
+
import "./brand-loader.css";
|
|
5
|
+
export type { BrandLoaderVariant } from "./brandLoaderVariants";
|
|
6
|
+
export { BrandLoaderProvider, type BrandLoaderProviderProps } from "./BrandLoaderProvider";
|
|
7
|
+
export type { BrandLoaderSymbol } from "./brandLoaderSymbolContext";
|
|
8
|
+
export type BrandLoaderSize = "16" | "24" | "32" | "64";
|
|
9
|
+
export type BrandLoaderTone = "accent" | "brand" | "current";
|
|
10
|
+
type BrandLoaderAccessibilityProps = {
|
|
11
|
+
label: string;
|
|
12
|
+
"aria-hidden"?: false;
|
|
13
|
+
} | {
|
|
14
|
+
label?: undefined;
|
|
15
|
+
"aria-hidden": true;
|
|
16
|
+
};
|
|
17
|
+
export type BrandLoaderProps = Omit<ComponentPropsWithoutRef<"span">, "children" | "aria-hidden"> & BrandLoaderAccessibilityProps & {
|
|
18
|
+
variant?: BrandLoaderVariant;
|
|
19
|
+
size?: BrandLoaderSize;
|
|
20
|
+
tone?: BrandLoaderTone;
|
|
21
|
+
speed?: number;
|
|
22
|
+
isPaused?: boolean;
|
|
23
|
+
symbol?: BrandLoaderSymbol;
|
|
24
|
+
};
|
|
25
|
+
export declare function BrandLoader({ label, "aria-hidden": isDecorative, variant, size, tone, speed, isPaused, symbol, className, ...props }: BrandLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type BrandLoaderSymbol } from "./brandLoaderSymbolContext";
|
|
3
|
+
export type BrandLoaderProviderProps = {
|
|
4
|
+
symbol: BrandLoaderSymbol;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function BrandLoaderProvider({ symbol, children }: BrandLoaderProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type BrandLoaderVariant = "trace" | "bounce" | "assemble" | "comet" | "pulse" | "sweep";
|
|
2
|
+
export type BrandLoaderElements = {
|
|
3
|
+
strokes: SVGGElement;
|
|
4
|
+
slash: SVGPathElement;
|
|
5
|
+
big: SVGPathElement;
|
|
6
|
+
tri: SVGPathElement;
|
|
7
|
+
ball: SVGEllipseElement | null;
|
|
8
|
+
sweepClip: SVGPolygonElement | null;
|
|
9
|
+
sweepEdge: SVGLineElement | null;
|
|
10
|
+
lengths: {
|
|
11
|
+
slash: number;
|
|
12
|
+
big: number;
|
|
13
|
+
tri: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
type BrandLoaderVariantDefinition = {
|
|
17
|
+
period: number;
|
|
18
|
+
render: (progress: number, elements: BrandLoaderElements) => void;
|
|
19
|
+
renderRest: (elements: BrandLoaderElements) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare const brandLoaderViewBox = "-4 -4 48 40";
|
|
22
|
+
export declare const brandLoaderPathLengths: {
|
|
23
|
+
slash: number;
|
|
24
|
+
big: number;
|
|
25
|
+
tri: number;
|
|
26
|
+
};
|
|
27
|
+
export declare const brandLoaderSymbolPaths: {
|
|
28
|
+
slash: string;
|
|
29
|
+
big: string;
|
|
30
|
+
tri: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const brandLoaderVariants: Record<BrandLoaderVariant, BrandLoaderVariantDefinition>;
|
|
33
|
+
export {};
|
|
@@ -18,6 +18,7 @@ export declare const ButtonDanger: React.ForwardRefExoticComponent<Omit<ButtonBa
|
|
|
18
18
|
} & React.RefAttributes<HTMLElement>>;
|
|
19
19
|
type ButtonBaseProps = {
|
|
20
20
|
type?: ComponentPropsWithoutRef<"button">["type"];
|
|
21
|
+
isPending?: boolean;
|
|
21
22
|
size?: "small" | "medium";
|
|
22
23
|
variant?: "primary" | "neutral" | "subtle" | "text" | "danger-primary" | "danger-subtle";
|
|
23
24
|
} & AnchorOrButtonProps;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DateValue } from "@internationalized/date";
|
|
2
|
-
import { type DateRangePresetKey } from "./dateRangePresets";
|
|
2
|
+
import { type DateRangePresetKey, type FirstDayOfWeek } from "./dateRangePresets";
|
|
3
3
|
import "./daterangepicker.css";
|
|
4
4
|
export interface DateRangePreset {
|
|
5
5
|
id: string;
|
|
@@ -38,10 +38,11 @@ export interface DateRangePickerProps {
|
|
|
38
38
|
minValue?: DateValue;
|
|
39
39
|
maxValue?: DateValue;
|
|
40
40
|
timezone?: string;
|
|
41
|
+
firstDayOfWeek?: FirstDayOfWeek;
|
|
41
42
|
isDisabled?: boolean;
|
|
42
43
|
isRequired?: boolean;
|
|
43
44
|
value?: DateRangePickerValue;
|
|
44
45
|
defaultValue?: DateRangePickerValue;
|
|
45
46
|
onChange?: (value: DateRangePickerValue) => void;
|
|
46
47
|
}
|
|
47
|
-
export declare function DateRangePicker({ className, locale: localeProp, label, "aria-label": ariaLabel, description, errorMessage, labels, intervals: intervalsProp, presetKeys, presetLabels, hideTime, minValue, maxValue, timezone: timezoneProp, isDisabled, isRequired, value, defaultValue, onChange, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare function DateRangePicker({ className, locale: localeProp, label, "aria-label": ariaLabel, description, errorMessage, labels, intervals: intervalsProp, presetKeys, presetLabels, hideTime, minValue, maxValue, timezone: timezoneProp, firstDayOfWeek, isDisabled, isRequired, value, defaultValue, onChange, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { DateRangePreset } from "./DateRangePicker";
|
|
2
2
|
export type DateRangePresetKey = "last5m" | "last15m" | "last30m" | "last1h" | "last3h" | "last6h" | "last12h" | "last24h" | "today" | "yesterday" | "last7d" | "last30d" | "thisWeek" | "lastWeek" | "thisMonth" | "lastMonth" | "thisYear" | "lastYear";
|
|
3
3
|
export declare const DATE_RANGE_PRESET_ORDER: DateRangePresetKey[];
|
|
4
|
+
export type FirstDayOfWeek = "sun" | "mon" | "tue" | "wed" | "thu" | "fri" | "sat";
|
|
5
|
+
export declare const DEFAULT_DATE_RANGE_PRESET_TIMEZONE: string;
|
|
6
|
+
export declare const DEFAULT_FIRST_DAY_OF_WEEK: FirstDayOfWeek;
|
|
4
7
|
export interface CreateDateRangePresetsOptions {
|
|
5
8
|
labels: Record<DateRangePresetKey, string>;
|
|
6
9
|
timezone?: string;
|
|
10
|
+
/** @deprecated Sem efeito desde a CONSOLE-1892: o início da semana vem de `firstDayOfWeek`. */
|
|
7
11
|
locale?: string;
|
|
12
|
+
firstDayOfWeek?: FirstDayOfWeek;
|
|
8
13
|
include?: DateRangePresetKey[];
|
|
9
14
|
}
|
|
10
15
|
export declare function createDateRangePresets(options: CreateDateRangePresetsOptions): DateRangePreset[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import { type BrandLoaderSize, type BrandLoaderVariant } from "../BrandLoader/BrandLoader";
|
|
3
|
+
import "./loading-state.css";
|
|
4
|
+
export type LoadingStateProps = ComponentPropsWithoutRef<"div"> & {
|
|
5
|
+
message: string;
|
|
6
|
+
variant?: BrandLoaderVariant;
|
|
7
|
+
size?: BrandLoaderSize;
|
|
8
|
+
delayMs?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function LoadingState({ message, variant, size, delayMs, className, ...props }: LoadingStateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
type PermissionGatePendingProps = {
|
|
3
|
+
isPending?: false;
|
|
4
|
+
pendingLabel?: string;
|
|
5
|
+
} | {
|
|
6
|
+
isPending: boolean;
|
|
7
|
+
/** Tooltip text shown while `isPending`. */
|
|
8
|
+
pendingLabel: string;
|
|
9
|
+
};
|
|
10
|
+
export type PermissionGateProps = PermissionGatePendingProps & {
|
|
3
11
|
/** Whether the current user has permission to perform this action. */
|
|
4
12
|
isAllowed: boolean;
|
|
5
13
|
/** Tooltip text shown when the action is not allowed. */
|
|
6
14
|
noAccessLabel: string;
|
|
7
15
|
/**
|
|
8
|
-
* Either a React element or a render prop that receives `isAllowed`.
|
|
9
|
-
* Use the render prop to avoid repeating the permission check inside the child.
|
|
16
|
+
* Either a React element or a render prop that receives `isAllowed` and `isPending`.
|
|
17
|
+
* Use the render prop to avoid repeating the permission check inside the child, e.g.
|
|
18
|
+
* `{(allowed, pending) => <Button isDisabled={!allowed && !pending} isPending={pending}>…</Button>}`.
|
|
10
19
|
*/
|
|
11
|
-
children: React.ReactElement | ((isAllowed: boolean) => React.ReactElement);
|
|
12
|
-
}
|
|
20
|
+
children: React.ReactElement | ((isAllowed: boolean, isPending: boolean) => React.ReactElement);
|
|
21
|
+
};
|
|
13
22
|
/**
|
|
14
23
|
* Wraps any interactive element with a tooltip that appears when `isAllowed` is false.
|
|
15
24
|
*
|
|
@@ -37,4 +46,5 @@ export interface PermissionGateProps {
|
|
|
37
46
|
* seguro — é onde o `DataTable` põe o gate nas ações de linha. O `Menu` avisa no
|
|
38
47
|
* console em desenvolvimento se o gate aparecer em volta de um item.
|
|
39
48
|
*/
|
|
40
|
-
export declare function PermissionGate({ isAllowed, noAccessLabel, children, }: PermissionGateProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export declare function PermissionGate({ isAllowed, noAccessLabel, isPending, pendingLabel, children, }: PermissionGateProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export {};
|
|
@@ -3,6 +3,7 @@ export * from "./Alert/Alert";
|
|
|
3
3
|
export * from "./CodeBlock/CodeBlock";
|
|
4
4
|
export * from "./CodeEditor/CodeEditor";
|
|
5
5
|
export * from "./Avatar/Avatar";
|
|
6
|
+
export * from "./BrandLoader/BrandLoader";
|
|
6
7
|
export * from "./Button/Button";
|
|
7
8
|
export * from "./Checkbox/Checkbox";
|
|
8
9
|
export * from "./ComboBox/ComboBox";
|
|
@@ -18,6 +19,7 @@ export * from "./Image/Image";
|
|
|
18
19
|
export * from "./Input/Input";
|
|
19
20
|
export * from "./Link/Link";
|
|
20
21
|
export * from "./ListBox/ListBox";
|
|
22
|
+
export * from "./LoadingState/LoadingState";
|
|
21
23
|
export * from "./Logo/Logo";
|
|
22
24
|
export * from "./Menu/Menu";
|
|
23
25
|
export * from "./Navigation/Navigation";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apipass/design-system",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "APIPass React Design System",
|
|
6
6
|
"sideEffects": [
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"build:lib": "tsc -p tsconfig.lib.json && vite build --config vite.lib.config.ts && node scripts/gen-embedded-styles.mjs",
|
|
59
59
|
"app:dev": "vite",
|
|
60
60
|
"app:build": "tsc && vite build",
|
|
61
|
+
"app:test": "vitest run",
|
|
61
62
|
"app:lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
62
63
|
"app:preview": "vite preview",
|
|
63
64
|
"storybook:install": "npm ci",
|
|
@@ -152,6 +153,7 @@
|
|
|
152
153
|
"react-dom": "^18.2.0",
|
|
153
154
|
"storybook": "^10.3.4",
|
|
154
155
|
"typescript": "^5.0.2",
|
|
155
|
-
"vite": "^6.3.5"
|
|
156
|
+
"vite": "^6.3.5",
|
|
157
|
+
"vitest": "^3.2.7"
|
|
156
158
|
}
|
|
157
159
|
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("../../../vendor/clsx/dist/clsx.cjs");;/* empty css */const n=require("../../icons/IconLoader.cjs");function r({message:t,className:s,...i}){return e.jsxs("div",{role:"status","aria-live":"polite",className:a.clsx("widget-loading-state",s),...i,children:[e.jsx(n.IconLoader,{size:"24",className:"widget-loading-state-spinner"}),e.jsx("span",{className:"widget-loading-state-message",children:t})]})}exports.WidgetLoadingState=r;
|
|
2
|
-
//# sourceMappingURL=WidgetLoadingState.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetLoadingState.cjs","sources":["../../../../../src/ui/components/WidgetLoadingState/WidgetLoadingState.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type ComponentPropsWithoutRef } from \"react\";\nimport { IconLoader } from \"icons\";\nimport \"./widget-loading-state.css\";\n\nexport type WidgetLoadingStateProps = ComponentPropsWithoutRef<\"div\"> & {\n message: string;\n};\n\nexport function WidgetLoadingState({\n message,\n className,\n ...props\n}: WidgetLoadingStateProps) {\n return (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className={clsx(\"widget-loading-state\", className)}\n {...props}\n >\n <IconLoader size=\"24\" className=\"widget-loading-state-spinner\" />\n <span className=\"widget-loading-state-message\">{message}</span>\n </div>\n );\n}\n"],"names":["WidgetLoadingState","message","className","props","jsxs","clsx","jsx","IconLoader"],"mappings":"6PASO,SAASA,EAAmB,CACjC,QAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAA4B,CAC1B,OACEC,EAAAA,KAAC,MAAA,CACC,KAAK,SACL,YAAU,SACV,UAAWC,EAAAA,KAAK,uBAAwBH,CAAS,EAChD,GAAGC,EAEJ,SAAA,CAAAG,EAAAA,IAACC,EAAAA,WAAA,CAAW,KAAK,KAAK,UAAU,+BAA+B,EAC/DD,EAAAA,IAAC,OAAA,CAAK,UAAU,+BAAgC,SAAAL,CAAA,CAAQ,CAAA,CAAA,CAAA,CAG9D"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { clsx as o } from "../../../vendor/clsx/dist/clsx.js";
|
|
3
|
-
/* empty css */
|
|
4
|
-
import { IconLoader as r } from "../../icons/IconLoader.js";
|
|
5
|
-
function g({
|
|
6
|
-
message: t,
|
|
7
|
-
className: i,
|
|
8
|
-
...a
|
|
9
|
-
}) {
|
|
10
|
-
return /* @__PURE__ */ s(
|
|
11
|
-
"div",
|
|
12
|
-
{
|
|
13
|
-
role: "status",
|
|
14
|
-
"aria-live": "polite",
|
|
15
|
-
className: o("widget-loading-state", i),
|
|
16
|
-
...a,
|
|
17
|
-
children: [
|
|
18
|
-
/* @__PURE__ */ e(r, { size: "24", className: "widget-loading-state-spinner" }),
|
|
19
|
-
/* @__PURE__ */ e("span", { className: "widget-loading-state-message", children: t })
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
g as WidgetLoadingState
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=WidgetLoadingState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetLoadingState.js","sources":["../../../../../src/ui/components/WidgetLoadingState/WidgetLoadingState.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport { type ComponentPropsWithoutRef } from \"react\";\nimport { IconLoader } from \"icons\";\nimport \"./widget-loading-state.css\";\n\nexport type WidgetLoadingStateProps = ComponentPropsWithoutRef<\"div\"> & {\n message: string;\n};\n\nexport function WidgetLoadingState({\n message,\n className,\n ...props\n}: WidgetLoadingStateProps) {\n return (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className={clsx(\"widget-loading-state\", className)}\n {...props}\n >\n <IconLoader size=\"24\" className=\"widget-loading-state-spinner\" />\n <span className=\"widget-loading-state-message\">{message}</span>\n </div>\n );\n}\n"],"names":["WidgetLoadingState","message","className","props","jsxs","clsx","jsx","IconLoader"],"mappings":";;;;AASO,SAASA,EAAmB;AAAA,EACjC,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GAA4B;AAC1B,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,aAAU;AAAA,MACV,WAAWC,EAAK,wBAAwBH,CAAS;AAAA,MAChD,GAAGC;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAG,EAACC,GAAA,EAAW,MAAK,MAAK,WAAU,gCAA+B;AAAA,QAC/D,gBAAAD,EAAC,QAAA,EAAK,WAAU,gCAAgC,UAAAL,EAAA,CAAQ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG9D;"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
-
import "./widget-loading-state.css";
|
|
3
|
-
export type WidgetLoadingStateProps = ComponentPropsWithoutRef<"div"> & {
|
|
4
|
-
message: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function WidgetLoadingState({ message, className, ...props }: WidgetLoadingStateProps): import("react/jsx-runtime").JSX.Element;
|