@pihanga2/shadcn 0.2.5 → 0.2.7
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/AGENT.building-cards.md +87 -0
- package/AGENT.using-cards.md +47 -0
- package/README.md +7 -1
- package/cards/avatar/avatar.component.d.ts +11 -0
- package/cards/avatar/avatar.component.js +26 -0
- package/cards/avatar/avatar.component.js.map +1 -0
- package/cards/avatar/avatar.types.d.ts +46 -0
- package/cards/avatar/avatar.types.js +7 -0
- package/cards/avatar/avatar.types.js.map +1 -0
- package/cards/avatar/index.d.ts +1 -0
- package/cards/avatar/index.js +12 -0
- package/cards/avatar/index.js.map +1 -0
- package/cards/badge/badge.component.js +4 -4
- package/cards/codeMirror/codeMirror.component.d.ts +4 -0
- package/cards/codeMirror/codeMirror.types.d.ts +83 -0
- package/cards/codeMirror/index.d.ts +1 -0
- package/cards/collapsibleCard/collapsibleCard.component.d.ts +4 -0
- package/cards/collapsibleCard/collapsibleCard.component.js +61 -0
- package/cards/collapsibleCard/collapsibleCard.component.js.map +1 -0
- package/cards/collapsibleCard/collapsibleCard.types.d.ts +91 -0
- package/cards/collapsibleCard/collapsibleCard.types.js +7 -0
- package/cards/collapsibleCard/collapsibleCard.types.js.map +1 -0
- package/cards/collapsibleCard/index.d.ts +1 -0
- package/cards/collapsibleCard/index.js +13 -0
- package/cards/collapsibleCard/index.js.map +1 -0
- package/cards/collapsibleCard.d.ts +1 -0
- package/cards/dataTable/dataTable.component.js +43 -42
- package/cards/dataTable/dataTable.component.js.map +1 -1
- package/cards/dataTable/dataTable.types.d.ts +26 -2
- package/cards/dataTable/dataTable.types.js +1 -0
- package/cards/dataTable/dataTable.types.js.map +1 -1
- package/cards/drawer/drawer.component.d.ts +4 -0
- package/cards/drawer/drawer.component.js +83 -0
- package/cards/drawer/drawer.component.js.map +1 -0
- package/cards/drawer/drawer.types.d.ts +95 -0
- package/cards/drawer/drawer.types.js +11 -0
- package/cards/drawer/drawer.types.js.map +1 -0
- package/cards/drawer/index.d.ts +1 -0
- package/cards/drawer/index.js +13 -0
- package/cards/drawer/index.js.map +1 -0
- package/cards/dropDownMenu/dropdown-menu.ui.js +41 -41
- package/cards/emptyCard/emptyCard.component.d.ts +4 -0
- package/cards/emptyCard/emptyCard.types.d.ts +36 -0
- package/cards/emptyCard/index.d.ts +1 -0
- package/cards/emptyCard.d.ts +1 -7
- package/cards/fileDrop/fileDrop.component.js +1 -1
- package/cards/fileDrop/fileDrop.css +1 -0
- package/cards/flexGrid/flexGrid.types.d.ts +1 -2
- package/cards/flexGrid/flexGrid.types.js.map +1 -1
- package/cards/graphin/eventDispatcher.component.d.ts +3 -1
- package/cards/graphin/graphin.types.d.ts +14 -0
- package/cards/infoCard/index.d.ts +1 -0
- package/cards/infoCard/index.js +12 -0
- package/cards/infoCard/index.js.map +1 -0
- package/cards/infoCard/infoCard.component.d.ts +4 -0
- package/cards/infoCard/infoCard.component.js +55 -0
- package/cards/infoCard/infoCard.component.js.map +1 -0
- package/cards/infoCard/infoCard.types.d.ts +65 -0
- package/cards/infoCard/infoCard.types.js +7 -0
- package/cards/infoCard/infoCard.types.js.map +1 -0
- package/cards/infoCard.d.ts +1 -0
- package/cards/jsonViewer/jsonViewer.component.js +1 -1
- package/cards/jsonViewer/jsonViewer.css +1 -0
- package/cards/list/list.component.js +21 -21
- package/cards/loadingOverlay/loadingOverlay.component.js +1 -1
- package/cards/loadingOverlay/loadingOverlay.css +1 -0
- package/cards/pageWithNavbar/pageWithNavbar.component.js +1 -1
- package/cards/pageWithNavbar/pageWithNavbar.css +1 -0
- package/cards/pageWithNavbarMeta/index.d.ts +1 -0
- package/cards/pageWithNavbarMeta/index.js +118 -0
- package/cards/pageWithNavbarMeta/index.js.map +1 -0
- package/cards/pageWithNavbarMeta/pageWithNavbarMeta.types.d.ts +78 -0
- package/cards/pageWithNavbarMeta/pageWithNavbarMeta.types.js +7 -0
- package/cards/pageWithNavbarMeta/pageWithNavbarMeta.types.js.map +1 -0
- package/cards/pasteTarget/pasteTarget.component.js +1 -1
- package/cards/pasteTarget/pasteTarget.css +1 -0
- package/cards/scrollbarWithAnnotations/index.d.ts +1 -0
- package/cards/scrollbarWithAnnotations/index.js +13 -0
- package/cards/scrollbarWithAnnotations/index.js.map +1 -0
- package/cards/scrollbarWithAnnotations/scrollbarWithAnnotations.component.d.ts +23 -0
- package/cards/scrollbarWithAnnotations/scrollbarWithAnnotations.component.js +78 -0
- package/cards/scrollbarWithAnnotations/scrollbarWithAnnotations.component.js.map +1 -0
- package/cards/scrollbarWithAnnotations/scrollbarWithAnnotations.css +1 -0
- package/cards/scrollbarWithAnnotations/scrollbarWithAnnotations.types.d.ts +123 -0
- package/cards/scrollbarWithAnnotations/scrollbarWithAnnotations.types.js +7 -0
- package/cards/scrollbarWithAnnotations/scrollbarWithAnnotations.types.js.map +1 -0
- package/cards/slider/slider.component.js +67 -48
- package/cards/slider/slider.component.js.map +1 -1
- package/cards/slider/slider.types.d.ts +31 -0
- package/cards/slider/slider.types.js.map +1 -1
- package/cards/stepper/stepper.component.js +1 -1
- package/cards/stepper/stepper.css +1 -0
- package/cards/toggleGroup/toggleGroup.component.js +1 -1
- package/cards/toggleGroup/toggleGroup.component.js.map +1 -1
- package/components/ui/avatar.js +5 -5
- package/components/ui/badge.js +7 -7
- package/components/ui/button.js +6 -6
- package/components/ui/card.js +50 -0
- package/components/ui/card.js.map +1 -0
- package/components/ui/drawer.js +79 -0
- package/components/ui/drawer.js.map +1 -0
- package/components/ui/field.js +16 -16
- package/components/ui/label.js +3 -3
- package/components/ui/separator.js +1 -1
- package/components/ui/toggle-group.js +5 -5
- package/components/ui/toggle.js +2 -2
- package/lib/utils.d.ts +15 -0
- package/lib/utils.js.map +1 -1
- package/package.json +39 -3
- package/pihanga-shadcn.css +0 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DrawerComponent as e } from "./drawer.component.js";
|
|
2
|
+
import { Drawer as t, PI_DRAWER_ACTION as n, PI_DRAWER_CARD as r, onDrawerClosed as i, onDrawerOpenChanged as a, onDrawerOpened as o } from "./drawer.types.js";
|
|
3
|
+
import { actionTypesToEvents as s, registerCardComponent as c } from "@pihanga2/core";
|
|
4
|
+
//#region src/cards/drawer/index.ts
|
|
5
|
+
c({
|
|
6
|
+
name: r,
|
|
7
|
+
component: e,
|
|
8
|
+
events: s(n)
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as Drawer, n as PI_DRAWER_ACTION, r as PI_DRAWER_CARD, i as onDrawerClosed, a as onDrawerOpenChanged, o as onDrawerOpened };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/cards/drawer/index.ts"],"sourcesContent":["import {actionTypesToEvents, registerCardComponent} from \"@pihanga2/core\";\n\nimport {DrawerComponent} from \"./drawer.component\";\nimport {PI_DRAWER_ACTION, PI_DRAWER_CARD} from \"./drawer.types\";\n\nexport * from \"./drawer.types\";\n\nregisterCardComponent({\n name: PI_DRAWER_CARD,\n component: DrawerComponent,\n events: actionTypesToEvents(PI_DRAWER_ACTION),\n});\n"],"mappings":";;;;AAOA,EAAsB;CACpB,MAAM;CACN,WAAW;CACX,QAAQ,EAAoB,CAAgB;AAC9C,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
5
|
+
import { cva as r } from "class-variance-authority";
|
|
6
6
|
import { CheckIcon as i, ChevronRightIcon as a } from "lucide-react";
|
|
7
7
|
import * as o from "@radix-ui/react-dropdown-menu";
|
|
8
8
|
//#region src/cards/dropDownMenu/dropdown-menu.ui.tsx
|
|
9
|
-
var s =
|
|
9
|
+
var s = r(e("relative flex cursor-pointer items-center gap-2 rounded-md align-middle text-sm no-focus-ring transition-bg-ease select-none data-disabled:pointer-events-none data-disabled:opacity-50", "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-subtle-foreground", "text-accent-foreground hover:bg-accent focus:bg-accent focus:text-accent-foreground"), {
|
|
10
10
|
defaultVariants: {
|
|
11
11
|
size: "default",
|
|
12
12
|
variant: "default"
|
|
@@ -21,87 +21,87 @@ var s = t(e("relative flex cursor-pointer items-center gap-2 rounded-md align-mi
|
|
|
21
21
|
none: ""
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
}), c =
|
|
24
|
+
}), c = r(e("mt-1.5 mb-2 cursor-default px-[14px] text-xs font-medium text-muted-foreground select-none"), { variants: { inset: { true: "pl-8" } } });
|
|
25
25
|
function l(e) {
|
|
26
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ t(o.Root, { ...e });
|
|
27
27
|
}
|
|
28
28
|
function u(e) {
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ t(o.Trigger, { ...e });
|
|
30
30
|
}
|
|
31
31
|
function d(e) {
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ t(o.Group, {
|
|
33
33
|
className: "py-1.5",
|
|
34
34
|
...e
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
function f(e) {
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ t(o.Sub, { ...e });
|
|
39
39
|
}
|
|
40
40
|
function p(e) {
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ t(o.RadioGroup, { ...e });
|
|
42
42
|
}
|
|
43
|
-
function m({ children:
|
|
44
|
-
return /* @__PURE__ */
|
|
43
|
+
function m({ children: r, className: i, inset: s, ...c }) {
|
|
44
|
+
return /* @__PURE__ */ n(o.SubTrigger, {
|
|
45
45
|
className: e("mx-1 flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent data-[state=open]:bg-accent", "no-focus-ring", "data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", s && "pl-8", i),
|
|
46
46
|
...c,
|
|
47
|
-
children: [
|
|
47
|
+
children: [r, /* @__PURE__ */ t(a, { className: "ml-auto" })]
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
function h({ className:
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
className: e("z-50 max-w-[100vw] min-w-32 w-max overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-floating data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
50
|
+
function h({ className: n, ...r }) {
|
|
51
|
+
return /* @__PURE__ */ t(o.SubContent, {
|
|
52
|
+
className: e("z-50 max-w-[100vw] min-w-32 w-max overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-floating data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", n),
|
|
53
53
|
...r
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
function g({ className:
|
|
57
|
-
let a = /* @__PURE__ */
|
|
58
|
-
className: e("z-50 max-w-[100vw] min-w-32 w-max overflow-hidden rounded-lg bg-popover p-0 text-sm text-popover-foreground shadow-floating no-focus-ring", "data-[side=bottom]:origin-top data-[side=left]:origin-right data-[side=right]:origin-left data-[side=top]:origin-bottom data-[state=closed]:hidden data-[state=open]:animate-zoom",
|
|
56
|
+
function g({ className: n, portal: r, ...i }) {
|
|
57
|
+
let a = /* @__PURE__ */ t(o.Content, {
|
|
58
|
+
className: e("z-50 max-w-[100vw] min-w-32 w-max overflow-hidden rounded-lg bg-popover p-0 text-sm text-popover-foreground shadow-floating no-focus-ring", "data-[side=bottom]:origin-top data-[side=left]:origin-right data-[side=right]:origin-left data-[side=top]:origin-bottom data-[state=closed]:hidden data-[state=open]:animate-zoom", n),
|
|
59
59
|
sideOffset: 4,
|
|
60
60
|
...i
|
|
61
61
|
});
|
|
62
|
-
return r ? /* @__PURE__ */
|
|
62
|
+
return r ? /* @__PURE__ */ t(o.Portal, { children: a }) : a;
|
|
63
63
|
}
|
|
64
|
-
function _({ className:
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
className: e(s(),
|
|
64
|
+
function _({ className: n, ...r }) {
|
|
65
|
+
return /* @__PURE__ */ t(o.Item, {
|
|
66
|
+
className: e(s(), n),
|
|
67
67
|
...r
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
function v({ children:
|
|
71
|
-
return /* @__PURE__ */
|
|
70
|
+
function v({ children: r, className: a, ...s }) {
|
|
71
|
+
return /* @__PURE__ */ n(o.CheckboxItem, {
|
|
72
72
|
className: e("relative flex items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 no-focus-ring transition-bg-ease select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:size-4", "mx-1 h-[28px] cursor-pointer data-[state=highlighted]:bg-accent data-[state=highlighted]:text-accent-foreground", a),
|
|
73
73
|
...s,
|
|
74
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ t("span", {
|
|
75
75
|
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
76
|
-
children: /* @__PURE__ */
|
|
77
|
-
}),
|
|
76
|
+
children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(i, {}) })
|
|
77
|
+
}), r]
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
function y({ children:
|
|
81
|
-
return /* @__PURE__ */
|
|
80
|
+
function y({ children: r, className: a, hideIcon: s, ...c }) {
|
|
81
|
+
return /* @__PURE__ */ n(o.RadioItem, {
|
|
82
82
|
className: e("relative flex items-center rounded-sm pr-2 pl-8 no-focus-ring transition-bg-ease select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", "mx-1 h-[28px] cursor-pointer gap-2 data-[state=highlighted]:bg-accent data-[state=highlighted]:text-accent-foreground [&_svg]:size-4", a),
|
|
83
83
|
...c,
|
|
84
|
-
children: [!s && /* @__PURE__ */
|
|
84
|
+
children: [!s && /* @__PURE__ */ t("span", {
|
|
85
85
|
className: "absolute left-2 flex size-3.5 items-center justify-center",
|
|
86
|
-
children: /* @__PURE__ */
|
|
87
|
-
}),
|
|
86
|
+
children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(i, {}) })
|
|
87
|
+
}), r]
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
function b({ className:
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
className: e(c({ inset: r }),
|
|
90
|
+
function b({ className: n, inset: r, ...i }) {
|
|
91
|
+
return /* @__PURE__ */ t(o.Label, {
|
|
92
|
+
className: e(c({ inset: r }), n),
|
|
93
93
|
...i
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
function x({ className:
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
className: e("-mx-1 my-1 h-px bg-muted",
|
|
96
|
+
function x({ className: n, ...r }) {
|
|
97
|
+
return /* @__PURE__ */ t(o.Separator, {
|
|
98
|
+
className: e("-mx-1 my-1 h-px bg-muted", n),
|
|
99
99
|
...r
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
function S({ className:
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
className: e("ml-auto text-xs tracking-widest opacity-60",
|
|
102
|
+
function S({ className: n, ...r }) {
|
|
103
|
+
return /* @__PURE__ */ t("span", {
|
|
104
|
+
className: e("ml-auto text-xs tracking-widest opacity-60", n),
|
|
105
105
|
...r
|
|
106
106
|
});
|
|
107
107
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PiCardRef } from '@pihanga2/core';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export declare const EMPTY_CARD = "empty-card";
|
|
4
|
+
export type EmptyCardProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Icon name from the pihanga icon registry.
|
|
7
|
+
* When provided, renders an `EmptyMedia` slot with `variant="icon"`.
|
|
8
|
+
*/
|
|
9
|
+
icon?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Pihanga card reference rendered inside `EmptyContent`.
|
|
12
|
+
* Use this to show a call-to-action button, form, or any other card.
|
|
13
|
+
*/
|
|
14
|
+
content?: PiCardRef;
|
|
15
|
+
/** Additional Tailwind / CSS classes forwarded to the root `Empty` element. */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Inline styles forwarded to the root `Empty` element. */
|
|
18
|
+
style?: React.CSSProperties;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Factory function for declaring an `empty-card` instance.
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* import {registerCard} from "@pihanga2/core";
|
|
25
|
+
* import {EmptyCard} from "@/cards/emptyCard";
|
|
26
|
+
* import {Button} from "@/cards/button";
|
|
27
|
+
*
|
|
28
|
+
* registerCard("myApp/noResults", EmptyCard({
|
|
29
|
+
* icon: "search",
|
|
30
|
+
* content: "myApp/createButton",
|
|
31
|
+
* }));
|
|
32
|
+
*
|
|
33
|
+
* registerCard("myApp/createButton", Button({label: "Create new"}));
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const EmptyCard: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<EmptyCardProps, S, {}>) => import('@pihanga2/core').PiCardDef;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './emptyCard.types';
|
package/cards/emptyCard.d.ts
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
export declare const EmptyCard: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<EmptyProps, S, {}>) => import('@pihanga2/core').PiCardDef;
|
|
4
|
-
export type EmptyProps = {
|
|
5
|
-
style?: React.CSSProperties;
|
|
6
|
-
};
|
|
7
|
-
export declare const EmptyComponent: (props: PiCardProps<EmptyProps>) => React.ReactNode;
|
|
1
|
+
export * from './emptyCard/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pi-file-drop-root label{border:2px dashed #999;flex-grow:1;justify-content:space-between;max-width:100%;display:flex}.pi-file-drop-root .dropzone-msg{cursor:pointer;text-align:center;flex-grow:4;margin:3em 0}.pi-file-drop-root .pi-progress{max-width:100%;padding:1.25em}.pi-file-drop-root .pi-progress-label{font-size:1rem;font-weight:600;line-height:1.5rem}.pi-file-drop -root.pi-progress-container{background-color:#dadfe5;border-radius:4px;height:1rem;display:flex;position:relative;overflow:hidden}.pi-file-drop-root .pi-progress-bar{color:#fff;background-color:#0054a6;flex-direction:column;justify-content:center;display:flex;overflow:hidden}.pi-file-drop-root .pi-progress .label{font-size:1em;display:block}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { PiCardRef } from '@pihanga2/core';
|
|
2
1
|
export declare const FLEX_GRID_CARD = "flex_grid";
|
|
3
2
|
export declare const FlexGrid: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<FlexGridProps, S, {}>) => import('@pihanga2/core').PiCardDef;
|
|
4
3
|
export type FlexGridProps = {
|
|
5
4
|
cards: {
|
|
6
|
-
[name: string]:
|
|
5
|
+
[name: string]: string;
|
|
7
6
|
};
|
|
8
7
|
template: TemplateT;
|
|
9
8
|
height?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flexGrid.types.js","names":[],"sources":["../../../src/cards/flexGrid/flexGrid.types.ts"],"sourcesContent":["import {createCardDeclaration
|
|
1
|
+
{"version":3,"file":"flexGrid.types.js","names":[],"sources":["../../../src/cards/flexGrid/flexGrid.types.ts"],"sourcesContent":["import {createCardDeclaration} from \"@pihanga2/core\";\n\nexport const FLEX_GRID_CARD = \"flex_grid\";\nexport const FlexGrid = createCardDeclaration<FlexGridProps>(FLEX_GRID_CARD);\n\nexport type FlexGridProps = {\n cards: {[name: string]: string}; // anonymous cards are not supported\n template: TemplateT;\n height?: string;\n margin?: string;\n overflow?: string;\n\n style?: {\n root?: React.CSSProperties;\n item?: React.CSSProperties;\n };\n className?: string;\n};\n\n// body {\n// display: grid;\n// grid-template-areas:\n// \"header header header\"\n// \"nav article ads\"\n// \"footer footer footer\";\n// grid-template-rows: 60px 1fr 60px;\n// grid-template-columns: 20% 1fr 15%;\n// grid-gap: 10px;\n// height: 100vh;\n// margin: 0;\n// }\n\n// https://css-tricks.com/snippets/css/complete-guide-grid/\nexport type TemplateT = {\n area?: string[][]; // name of card dict\n rows?: string[]; // grid-template-rows (e.g [\"min-content\", \"1fr\", \"min-content\"])\n columns?: string[]; // grid-template-cols (e.g. [\"1fr\", \"50px\", \"1fr\", \"1fr\"])\n gap?: string;\n};\n"],"mappings":";;AAEA,IAAa,IAAiB,aACjB,IAAW,EAAqC,CAAc"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { GraphinNodeEventContext } from './graphin.types';
|
|
1
|
+
import { GraphinAfterLayoutContext, GraphinNodeEventContext } from './graphin.types';
|
|
2
2
|
export type GraphinEventDispatcherProps = {
|
|
3
|
+
cardName: string;
|
|
3
4
|
onNodeHovered?: (ctx: GraphinNodeEventContext) => void;
|
|
4
5
|
onNodeHoverEnd?: (ctx: GraphinNodeEventContext) => void;
|
|
5
6
|
onNodeClicked?: (ctx: GraphinNodeEventContext) => void;
|
|
6
7
|
onNodeDblClicked?: (ctx: GraphinNodeEventContext) => void;
|
|
8
|
+
onAfterLayout?: (ctx: GraphinAfterLayoutContext) => void;
|
|
7
9
|
};
|
|
8
10
|
export declare function GraphinEventDispatcher(props: GraphinEventDispatcherProps): null;
|
|
@@ -12,6 +12,7 @@ export declare const GRAPHIN_ACTION: {
|
|
|
12
12
|
TOOLTIP_CLOSE: string;
|
|
13
13
|
CONTEXT_MENU_OPEN: string;
|
|
14
14
|
CONTEXT_MENU_CLOSE: string;
|
|
15
|
+
AFTER_LAYOUT: string;
|
|
15
16
|
};
|
|
16
17
|
export declare const onGraphinNodeHovered: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').PiRegister, f: import('@pihanga2/core').ReduceF<S, ReduxAction & {
|
|
17
18
|
cardID: string;
|
|
@@ -37,6 +38,17 @@ export declare const onGraphinContextMenuOpen: <S extends import('@pihanga2/core
|
|
|
37
38
|
export declare const onGraphinContextMenuClose: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').PiRegister, f: import('@pihanga2/core').ReduceF<S, ReduxAction & {
|
|
38
39
|
cardID: string;
|
|
39
40
|
} & GraphinNodeEventContext<Record<string, unknown>>>) => void;
|
|
41
|
+
export declare const onGraphinAfterLayout: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').PiRegister, f: import('@pihanga2/core').ReduceF<S, ReduxAction & {
|
|
42
|
+
cardID: string;
|
|
43
|
+
} & Record<string, unknown> & {
|
|
44
|
+
cardID: string;
|
|
45
|
+
}>) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Payload carried by the `afterlayout` lifecycle event.
|
|
48
|
+
*/
|
|
49
|
+
export type GraphinAfterLayoutContext = Record<string, unknown> & {
|
|
50
|
+
cardID: string;
|
|
51
|
+
};
|
|
40
52
|
/**
|
|
41
53
|
* Payload carried by all node interaction events.
|
|
42
54
|
* Also forwarded as props to tooltip / context-menu `PiCard` content cards
|
|
@@ -594,4 +606,6 @@ export type GraphinEvents = {
|
|
|
594
606
|
onContextMenuOpen: GraphinNodeEventContext;
|
|
595
607
|
/** Fired when the context-menu panel closes */
|
|
596
608
|
onContextMenuClose: GraphinNodeEventContext;
|
|
609
|
+
/** Fired when the G6 layout engine finishes positioning all nodes */
|
|
610
|
+
onAfterLayout: GraphinAfterLayoutContext;
|
|
597
611
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './infoCard.types';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InfoCardComponent as e } from "./infoCard.component.js";
|
|
2
|
+
import { INFO_CARD as t, InfoCard as n } from "./infoCard.types.js";
|
|
3
|
+
import { registerCardComponent as r } from "@pihanga2/core";
|
|
4
|
+
//#region src/cards/infoCard/index.tsx
|
|
5
|
+
r({
|
|
6
|
+
name: t,
|
|
7
|
+
component: e
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as INFO_CARD, n as InfoCard };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/cards/infoCard/index.tsx"],"sourcesContent":["import {registerCardComponent} from \"@pihanga2/core\";\n\nimport {InfoCardComponent} from \"./infoCard.component\";\nimport {INFO_CARD} from \"./infoCard.types\";\n\nexport * from \"./infoCard.types\";\n\nregisterCardComponent({\n name: INFO_CARD,\n component: InfoCardComponent,\n});\n"],"mappings":";;;;AAOA,EAAsB;CACpB,MAAM;CACN,WAAW;AACb,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Card as t, CardAction as n, CardContent as r, CardDescription as i, CardFooter as a, CardTitle as o } from "../../components/ui/card.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Card as s } from "@pihanga2/core";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
//#region src/cards/infoCard/infoCard.component.tsx
|
|
7
|
+
var u = (u) => {
|
|
8
|
+
let { title: d, description: f, actionCard: p, contentCard: m, footerCard: h, className: g, headerClassName: _, titleClassName: v, descriptionClassName: y, actionClassName: b, contentClassName: x, footerClassName: S, style: C, cardName: w } = u, T = d || f || p;
|
|
9
|
+
return /* @__PURE__ */ l(t, {
|
|
10
|
+
className: e("min-w-max", g),
|
|
11
|
+
style: C,
|
|
12
|
+
"data-pihanga": w,
|
|
13
|
+
children: [
|
|
14
|
+
T && /* @__PURE__ */ l("div", {
|
|
15
|
+
"data-slot": "card-header",
|
|
16
|
+
className: e("grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6", "has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", _),
|
|
17
|
+
children: [
|
|
18
|
+
d && /* @__PURE__ */ c(o, {
|
|
19
|
+
className: v,
|
|
20
|
+
children: d
|
|
21
|
+
}),
|
|
22
|
+
f && /* @__PURE__ */ c(i, {
|
|
23
|
+
className: y,
|
|
24
|
+
children: f
|
|
25
|
+
}),
|
|
26
|
+
p && /* @__PURE__ */ c(n, {
|
|
27
|
+
className: b,
|
|
28
|
+
children: /* @__PURE__ */ c(s, {
|
|
29
|
+
cardName: p,
|
|
30
|
+
parentCard: w
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
}),
|
|
35
|
+
m && /* @__PURE__ */ c(r, {
|
|
36
|
+
className: x,
|
|
37
|
+
children: /* @__PURE__ */ c(s, {
|
|
38
|
+
cardName: m,
|
|
39
|
+
parentCard: w
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
h && /* @__PURE__ */ c(a, {
|
|
43
|
+
className: S,
|
|
44
|
+
children: /* @__PURE__ */ c(s, {
|
|
45
|
+
cardName: h,
|
|
46
|
+
parentCard: w
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { u as InfoCardComponent };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=infoCard.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infoCard.component.js","names":[],"sources":["../../../src/cards/infoCard/infoCard.component.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {Card as PiCard, type PiCardProps} from \"@pihanga2/core\";\nimport {cn} from \"@/lib/utils\";\nimport {\n Card,\n CardTitle,\n CardDescription,\n CardAction,\n CardContent,\n CardFooter,\n} from \"@/components/ui/card\";\nimport type {InfoCardProps} from \"./infoCard.types\";\n\nexport const InfoCardComponent = (\n props: PiCardProps<InfoCardProps>,\n): React.ReactNode => {\n const {\n title,\n description,\n actionCard,\n contentCard,\n footerCard,\n className,\n headerClassName,\n titleClassName,\n descriptionClassName,\n actionClassName,\n contentClassName,\n footerClassName,\n style,\n cardName,\n } = props;\n\n const hasHeader = title || description || actionCard;\n\n return (\n <Card\n className={cn(\"min-w-max\", className)}\n style={style}\n data-pihanga={cardName}\n >\n {hasHeader && (\n // Plain <div> instead of shadcn <CardHeader> — avoids @container/card-header\n // (container-type:inline-size) which zeroes out intrinsic inline size and\n // breaks min-w-max on the parent Card. Visual classes are identical.\n <div\n data-slot=\"card-header\"\n className={cn(\n \"grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6\",\n \"has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6\",\n headerClassName,\n )}\n >\n {title && <CardTitle className={titleClassName}>{title}</CardTitle>}\n {description && (\n <CardDescription className={descriptionClassName}>\n {description}\n </CardDescription>\n )}\n {actionCard && (\n <CardAction className={actionClassName}>\n <PiCard cardName={actionCard} parentCard={cardName} />\n </CardAction>\n )}\n </div>\n )}\n {contentCard && (\n <CardContent className={contentClassName}>\n <PiCard cardName={contentCard} parentCard={cardName} />\n </CardContent>\n )}\n {footerCard && (\n <CardFooter className={footerClassName}>\n <PiCard cardName={footerCard} parentCard={cardName} />\n </CardFooter>\n )}\n </Card>\n );\n};\n"],"mappings":";;;;;;AAaA,IAAa,KACX,MACoB;CACpB,IAAM,EACJ,UACA,gBACA,eACA,gBACA,eACA,cACA,oBACA,mBACA,yBACA,oBACA,qBACA,oBACA,UACA,gBACE,GAEE,IAAY,KAAS,KAAe;CAE1C,OACE,kBAAC,GAAD;EACE,WAAW,EAAG,aAAa,CAAS;EAC7B;EACP,gBAAc;YAHhB;GAKG,KAIC,kBAAC,OAAD;IACE,aAAU;IACV,WAAW,EACT,mEACA,qEACA,CACF;cANF;KAQG,KAAS,kBAAC,GAAD;MAAW,WAAW;gBAAiB;KAAiB,CAAA;KACjE,KACC,kBAAC,GAAD;MAAiB,WAAW;gBACzB;KACc,CAAA;KAElB,KACC,kBAAC,GAAD;MAAY,WAAW;gBACrB,kBAAC,GAAD;OAAQ,UAAU;OAAY,YAAY;MAAW,CAAA;KAC3C,CAAA;IAEX;;GAEN,KACC,kBAAC,GAAD;IAAa,WAAW;cACtB,kBAAC,GAAD;KAAQ,UAAU;KAAa,YAAY;IAAW,CAAA;GAC3C,CAAA;GAEd,KACC,kBAAC,GAAD;IAAY,WAAW;cACrB,kBAAC,GAAD;KAAQ,UAAU;KAAY,YAAY;IAAW,CAAA;GAC3C,CAAA;EAEV;;AAEV"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { PiCardRef } from '@pihanga2/core';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export declare const INFO_CARD = "shad/info-card";
|
|
4
|
+
export type InfoCardProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Text rendered inside `CardTitle`.
|
|
7
|
+
* Leave unset to omit the title element entirely.
|
|
8
|
+
*/
|
|
9
|
+
title?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Text rendered inside `CardDescription`.
|
|
12
|
+
* Leave unset to omit the description element entirely.
|
|
13
|
+
*/
|
|
14
|
+
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Pihanga card reference rendered inside the `CardAction` slot.
|
|
17
|
+
* Positioned at the top-right of the header (e.g. a button, badge, or icon).
|
|
18
|
+
*/
|
|
19
|
+
actionCard?: PiCardRef;
|
|
20
|
+
/**
|
|
21
|
+
* Pihanga card reference rendered inside `CardContent`.
|
|
22
|
+
* Main body of the card — use any layout or display card.
|
|
23
|
+
*/
|
|
24
|
+
contentCard?: PiCardRef;
|
|
25
|
+
/**
|
|
26
|
+
* Pihanga card reference rendered inside `CardFooter`.
|
|
27
|
+
* Typically a row of actions or a status line.
|
|
28
|
+
*/
|
|
29
|
+
footerCard?: PiCardRef;
|
|
30
|
+
/** Extra CSS classes applied to the root `<div data-slot="card">`. */
|
|
31
|
+
className?: string;
|
|
32
|
+
/** Extra CSS classes applied to `<div data-slot="card-header">`. */
|
|
33
|
+
headerClassName?: string;
|
|
34
|
+
/** Extra CSS classes applied to `<div data-slot="card-title">`. */
|
|
35
|
+
titleClassName?: string;
|
|
36
|
+
/** Extra CSS classes applied to `<div data-slot="card-description">`. */
|
|
37
|
+
descriptionClassName?: string;
|
|
38
|
+
/** Extra CSS classes applied to `<div data-slot="card-action">`. */
|
|
39
|
+
actionClassName?: string;
|
|
40
|
+
/** Extra CSS classes applied to `<div data-slot="card-content">`. */
|
|
41
|
+
contentClassName?: string;
|
|
42
|
+
/** Extra CSS classes applied to `<div data-slot="card-footer">`. */
|
|
43
|
+
footerClassName?: string;
|
|
44
|
+
/** Inline styles applied to the root card element. */
|
|
45
|
+
style?: React.CSSProperties;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Factory function for declaring a `shad/info-card` instance.
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* import {registerCard} from "@pihanga2/core";
|
|
52
|
+
* import {InfoCard} from "@/cards/infoCard";
|
|
53
|
+
* import {Typography} from "@/cards/typography";
|
|
54
|
+
* import {Button} from "@/cards/button";
|
|
55
|
+
*
|
|
56
|
+
* registerCard("myApp/userCard", InfoCard({
|
|
57
|
+
* title: "John Doe",
|
|
58
|
+
* description: "Software Engineer",
|
|
59
|
+
* actionCard: "myApp/editButton",
|
|
60
|
+
* contentCard: "myApp/userDetails",
|
|
61
|
+
* footerCard: "myApp/userActions",
|
|
62
|
+
* }));
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare const InfoCard: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<InfoCardProps, S, {}>) => import('@pihanga2/core').PiCardDef;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infoCard.types.js","names":[],"sources":["../../../src/cards/infoCard/infoCard.types.ts"],"sourcesContent":["import {createCardDeclaration, type PiCardRef} from \"@pihanga2/core\";\nimport type React from \"react\";\n\nexport const INFO_CARD = \"shad/info-card\";\n\nexport type InfoCardProps = {\n /**\n * Text rendered inside `CardTitle`.\n * Leave unset to omit the title element entirely.\n */\n title?: string;\n\n /**\n * Text rendered inside `CardDescription`.\n * Leave unset to omit the description element entirely.\n */\n description?: string;\n\n /**\n * Pihanga card reference rendered inside the `CardAction` slot.\n * Positioned at the top-right of the header (e.g. a button, badge, or icon).\n */\n actionCard?: PiCardRef;\n\n /**\n * Pihanga card reference rendered inside `CardContent`.\n * Main body of the card — use any layout or display card.\n */\n contentCard?: PiCardRef;\n\n /**\n * Pihanga card reference rendered inside `CardFooter`.\n * Typically a row of actions or a status line.\n */\n footerCard?: PiCardRef;\n\n // ── Per-element className overrides ────────────────────────────────────────\n\n /** Extra CSS classes applied to the root `<div data-slot=\"card\">`. */\n className?: string;\n\n /** Extra CSS classes applied to `<div data-slot=\"card-header\">`. */\n headerClassName?: string;\n\n /** Extra CSS classes applied to `<div data-slot=\"card-title\">`. */\n titleClassName?: string;\n\n /** Extra CSS classes applied to `<div data-slot=\"card-description\">`. */\n descriptionClassName?: string;\n\n /** Extra CSS classes applied to `<div data-slot=\"card-action\">`. */\n actionClassName?: string;\n\n /** Extra CSS classes applied to `<div data-slot=\"card-content\">`. */\n contentClassName?: string;\n\n /** Extra CSS classes applied to `<div data-slot=\"card-footer\">`. */\n footerClassName?: string;\n\n /** Inline styles applied to the root card element. */\n style?: React.CSSProperties;\n};\n\n/**\n * Factory function for declaring a `shad/info-card` instance.\n *\n * ```ts\n * import {registerCard} from \"@pihanga2/core\";\n * import {InfoCard} from \"@/cards/infoCard\";\n * import {Typography} from \"@/cards/typography\";\n * import {Button} from \"@/cards/button\";\n *\n * registerCard(\"myApp/userCard\", InfoCard({\n * title: \"John Doe\",\n * description: \"Software Engineer\",\n * actionCard: \"myApp/editButton\",\n * contentCard: \"myApp/userDetails\",\n * footerCard: \"myApp/userActions\",\n * }));\n * ```\n */\nexport const InfoCard = createCardDeclaration<InfoCardProps>(INFO_CARD);\n"],"mappings":";;AAGA,IAAa,IAAY,kBA8EZ,IAAW,EAAqC,CAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './infoCard/index';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getIconElement as e } from "../icons.js";
|
|
2
|
-
|
|
2
|
+
import './jsonViewer.css';import '../../node_modules/react-json-view-lite/dist/index.css';/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { useCallback as t, useLayoutEffect as n, useRef as r, useState as i } from "react";
|
|
5
5
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.jv-wrapper{position:relative}.jv-copy-btn{z-index:10;width:22px;height:22px;color:hsl(var(--muted-foreground,0 0% 55%));cursor:pointer;opacity:.35;background:0 0;border:1px solid #0000;border-radius:4px;justify-content:center;align-items:center;padding:0;transition:opacity .15s,color .15s,background .15s,border-color .15s;display:inline-flex;position:absolute;top:4px;right:4px}.jv-wrapper:hover .jv-copy-btn,.jv-wrapper:focus-within .jv-copy-btn{opacity:1}.jv-copy-btn:hover{color:hsl(var(--foreground));background:hsl(var(--muted,0 0% 96%));border-color:hsl(var(--border,0 0% 88%))}.jv-copy-btn--done{opacity:1;color:#2e7d32}.dark .jv-copy-btn--done{color:#81c784}.jv-container{white-space:pre-wrap;word-wrap:break-word;color:var(--foreground);background:0 0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,monospace;font-size:12.5px;font-weight:400;line-height:1.55}.jv-basic-child{margin:0;padding:0 0 0 1.1em;display:block;position:relative}.jv-label{color:var(--foreground);margin-right:0;font-weight:400}.jv-clickable-label{color:var(--foreground);cursor:pointer;margin-right:0;font-weight:400}.jv-clickable-label:hover{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.jv-punctuation{color:var(--foreground);font-weight:400}.jv-expand-icon,.jv-collapse-icon{width:1em;color:hsl(var(--muted-foreground,0 0% 55%));-webkit-user-select:none;user-select:none;cursor:pointer;justify-content:center;align-items:center;font-size:.65em;line-height:1;display:inline-flex;position:absolute;top:.775em;left:0;transform:translateY(-50%)}.jv-expand-icon:after{content:"▶"}.jv-collapse-icon:after{content:"▼"}.jv-collapsed-content{cursor:pointer;color:hsl(var(--muted-foreground,0 0% 55%))}.jv-collapsed-content:after{content:" …"}.jv-child-fields-container{border-left:1px solid hsl(var(--border,0 0% 88%));margin:0 0 0 .3em;padding:0 0 0 1.25em}.jv-null,.jv-undefined{color:#c0392b}.jv-string{color:#2e7d32}.jv-number{color:#1565c0}.jv-boolean{color:#00796b}.jv-other{color:var(--foreground)}.dark .jv-string{color:#81c784}.dark .jv-number{color:#64b5f6}.dark .jv-boolean{color:#4db6ac}.dark .jv-null,.dark .jv-undefined{color:#ef9a9a}.dark .jv-child-fields-container{border-left-color:hsl(var(--border,0 0% 25%))}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getIcon as e } from "../icons.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { cn as t } from "../../lib/utils.js";
|
|
3
|
+
import { Avatar as n, AvatarFallback as r, AvatarImage as i } from "../../components/ui/avatar.js";
|
|
4
|
+
import { Badge as a } from "../../components/ui/badge.js";
|
|
5
5
|
import * as o from "react";
|
|
6
6
|
import { Card as s } from "@pihanga2/core";
|
|
7
7
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
@@ -24,14 +24,14 @@ function m(o, u, d) {
|
|
|
24
24
|
if (!o) return null;
|
|
25
25
|
switch (o.type) {
|
|
26
26
|
case "icon": return /* @__PURE__ */ c("span", {
|
|
27
|
-
className:
|
|
27
|
+
className: t("flex shrink-0 items-center [&>svg]:size-4", o.className),
|
|
28
28
|
children: e(o.name)
|
|
29
29
|
});
|
|
30
|
-
case "avatar": return /* @__PURE__ */ l(
|
|
31
|
-
className:
|
|
32
|
-
children: [/* @__PURE__ */ c(
|
|
30
|
+
case "avatar": return /* @__PURE__ */ l(n, {
|
|
31
|
+
className: t(p[u], o.className),
|
|
32
|
+
children: [/* @__PURE__ */ c(i, { src: o.src }), /* @__PURE__ */ c(r, { children: o.fallback ?? "" })]
|
|
33
33
|
});
|
|
34
|
-
case "chip": return /* @__PURE__ */ c(
|
|
34
|
+
case "chip": return /* @__PURE__ */ c(a, {
|
|
35
35
|
variant: "secondary",
|
|
36
36
|
className: o.className,
|
|
37
37
|
children: o.text
|
|
@@ -43,52 +43,52 @@ function m(o, u, d) {
|
|
|
43
43
|
default: return null;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function h({ item: e, size:
|
|
46
|
+
function h({ item: e, size: n, onItemClicked: r, cardName: i }) {
|
|
47
47
|
let [a, s] = o.useState(!1), p = !!e.nested?.length;
|
|
48
48
|
function g() {
|
|
49
49
|
p ? s((e) => !e) : r({ itemID: e.id });
|
|
50
50
|
}
|
|
51
51
|
return /* @__PURE__ */ l("li", { children: [/* @__PURE__ */ l("button", {
|
|
52
52
|
type: "button",
|
|
53
|
-
className:
|
|
53
|
+
className: t("flex w-full items-center rounded-sm outline-none transition-colors", "hover:bg-accent hover:text-accent-foreground", "focus-visible:ring-1 focus-visible:ring-ring", e.isSelected && "bg-accent text-accent-foreground font-medium", d[n], e.className),
|
|
54
54
|
onClick: g,
|
|
55
55
|
"aria-expanded": p ? a : void 0,
|
|
56
56
|
"data-selected": e.isSelected || void 0,
|
|
57
57
|
children: [
|
|
58
|
-
m(e.startDecorator,
|
|
58
|
+
m(e.startDecorator, n, i),
|
|
59
59
|
/* @__PURE__ */ l("span", {
|
|
60
60
|
className: "flex min-w-0 flex-1 flex-col items-start",
|
|
61
61
|
children: [/* @__PURE__ */ c("span", {
|
|
62
62
|
className: "truncate leading-none",
|
|
63
63
|
children: e.title
|
|
64
64
|
}), e.subTitle && /* @__PURE__ */ c("span", {
|
|
65
|
-
className:
|
|
65
|
+
className: t("mt-0.5 truncate text-muted-foreground", f[n]),
|
|
66
66
|
children: e.subTitle
|
|
67
67
|
})]
|
|
68
68
|
}),
|
|
69
|
-
!p && m(e.endDecorator,
|
|
70
|
-
p && /* @__PURE__ */ c(u, { className:
|
|
69
|
+
!p && m(e.endDecorator, n, i),
|
|
70
|
+
p && /* @__PURE__ */ c(u, { className: t("ml-auto size-4 shrink-0 text-muted-foreground transition-transform duration-200", a && "rotate-180") })
|
|
71
71
|
]
|
|
72
72
|
}), p && a && /* @__PURE__ */ c("ul", {
|
|
73
|
-
className:
|
|
74
|
-
children: e.nested.map((e,
|
|
73
|
+
className: t("ml-3 mt-0.5 flex flex-col gap-0.5 border-l border-border pl-2", "list-none p-0", n === "lg" ? "ml-4 pl-3" : "ml-3 pl-2"),
|
|
74
|
+
children: e.nested.map((e, t) => /* @__PURE__ */ c(h, {
|
|
75
75
|
item: e,
|
|
76
|
-
size:
|
|
76
|
+
size: n,
|
|
77
77
|
onItemClicked: r,
|
|
78
78
|
cardName: i
|
|
79
|
-
}, e.id ??
|
|
79
|
+
}, e.id ?? t))
|
|
80
80
|
})] });
|
|
81
81
|
}
|
|
82
82
|
var g = (e) => {
|
|
83
|
-
let { items:
|
|
83
|
+
let { items: n, size: r = "md", marker: i, className: a, style: o, onItemClicked: s, cardName: l } = e, u = {
|
|
84
84
|
...o,
|
|
85
85
|
...i && i !== "none" ? { listStyleType: i } : void 0
|
|
86
86
|
};
|
|
87
87
|
return /* @__PURE__ */ c("ul", {
|
|
88
|
-
className:
|
|
88
|
+
className: t("flex flex-col gap-0.5 p-0", i && i !== "none" ? "list-inside" : "list-none", a),
|
|
89
89
|
style: u,
|
|
90
90
|
"data-pihanga": l,
|
|
91
|
-
children:
|
|
91
|
+
children: n.map((e, t) => /* @__PURE__ */ c(h, {
|
|
92
92
|
item: e,
|
|
93
93
|
size: r,
|
|
94
94
|
onItemClicked: s,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.overlay-wrapper{flex-direction:column;width:100%;min-width:0;display:flex;position:relative}.overlay-wrapper.is-loading.fill-parent{min-height:12rem}.overlay-content{flex-direction:column;flex-grow:1;width:100%;min-width:0;display:flex;position:relative;overflow-y:hidden}.overlay-wrapper.fill-parent .overlay-content{min-height:inherit}.loading-overlay{opacity:0;pointer-events:none;z-index:2;background:oklch(100% 0 0/.7);justify-content:center;align-items:center;transition:opacity .15s;display:flex;position:absolute;inset:0}.overlay-wrapper.viewport-centered .loading-overlay{z-index:50;position:fixed;inset:0}.dark .loading-overlay{background:oklch(14.5% 0 0/.5)}.overlay-wrapper.is-loading .loading-overlay{opacity:1;pointer-events:auto}.loading-overlay__content{color:var(--muted-foreground);align-items:center;gap:.5rem;font-size:.875rem;display:flex}
|
|
@@ -2,7 +2,7 @@ import { SCREEN_SIZE_ORDER as e, SCREEN_SIZE_WIDTHS as t, ScreenSize as n } from
|
|
|
2
2
|
import { getIconElement as r } from "../icons.js";
|
|
3
3
|
import { Button as i } from "../../components/ui/button.js";
|
|
4
4
|
import { Sheet as a, SheetContent as o, SheetTrigger as s } from "../../components/ui/sheet.js";
|
|
5
|
-
|
|
5
|
+
import './pageWithNavbar.css';/* empty css */
|
|
6
6
|
import { useEffect as c, useRef as l, useState as u } from "react";
|
|
7
7
|
import { Card as d } from "@pihanga2/core";
|
|
8
8
|
import f from "clsx";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.window{justify-content:center;width:100%;height:100%;display:flex}.page{flex-direction:column;flex:1;width:100%;height:100%;display:flex}.header{border-bottom:1px solid var(--border);background-color:var(--background);flex-shrink:0;align-items:center;gap:1rem;padding-left:1rem;padding-right:1rem;display:flex}@media (width>=768px){.header{padding-left:1.5rem;padding-right:1.5rem}}.title-section{align-items:center;gap:.5rem;display:inline-flex}.title-section .title-icon{flex-shrink:0;width:1.5rem;height:1.5rem}.title-section .title-text{color:var(--foreground);font-size:1.125rem;font-weight:600;line-height:1.75rem}.nav-md{display:none}@media (width>=768px){.nav-md{flex-direction:row;align-items:center;gap:1.25rem;display:flex}}@media (width>=1024px){.nav-md{gap:1.5rem}}.nav-md .nav-link{color:var(--muted-foreground);padding-left:0;padding-right:0;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.nav-md .nav-link:hover{color:var(--foreground)}.nav-sm{gap:1.5rem;padding:1rem;font-size:1.125rem;font-weight:500;line-height:1.75rem;display:grid}.nav-sm .nav-link{color:var(--muted-foreground);justify-content:flex-start;padding-left:0;padding-right:0;font-size:1.125rem;line-height:1.75rem}.nav-sm .nav-link:hover{color:var(--foreground)}.header-actions{align-items:center;gap:.5rem;margin-left:auto;display:flex}@media (width>=1024px){.header-actions{gap:1rem}}.main{background-color:var(--background);flex:1;min-height:0;padding:.5rem 1rem;overflow-y:auto}@media (width>=768px){.main{padding:1rem 2rem}}.footer{background-color:var(--background);color:var(--muted-foreground);flex-shrink:0;padding:.5rem 1rem}@media (width>=768px){.footer{padding:1rem 2rem}}
|