@protobase/ui 0.12.8 → 0.12.9
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/action-card/action-card.d.ts +3 -1
- package/dist/action-card/action-card.js +4 -4
- package/dist/package.js +1 -1
- package/dist/shell/assets/{app-BFCjH5PZ.js → app-Ds2CYFLS.js} +2 -2
- package/dist/shell/assets/{index-YPieq1OK.js → index-CGPHR8-j.js} +1 -1
- package/dist/shell/assets/{shared-protobase-ui-bPkMP70Y.js → shared-protobase-ui-oolw3GIu.js} +1 -1
- package/dist/shell/index.html +3 -3
- package/dist/shell/protobase.shell.json +1 -1
- package/package.json +4 -4
|
@@ -20,7 +20,9 @@ export type ActionCardProps = {
|
|
|
20
20
|
actions?: CardAction[];
|
|
21
21
|
onAction?: (id: string) => void;
|
|
22
22
|
children?: ReactNode;
|
|
23
|
+
/** Without the bordered card and the title row, for a page that is already framed; the title still labels the section. */
|
|
24
|
+
frameless?: boolean;
|
|
23
25
|
};
|
|
24
26
|
/** A card with a toned title row, any content, a note and buttons: the building block of rich chat messages. */
|
|
25
|
-
export declare const ActionCard: ({ title, tone, badge, note, actions, onAction, children }: ActionCardProps) => import("react").JSX.Element;
|
|
27
|
+
export declare const ActionCard: ({ title, tone, badge, note, actions, onAction, children, frameless }: ActionCardProps) => import("react").JSX.Element;
|
|
26
28
|
//#endregion
|
|
@@ -27,15 +27,15 @@ const frames = {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
/** A card with a toned title row, any content, a note and buttons: the building block of rich chat messages. */
|
|
30
|
-
const ActionCard = ({ title, tone = "neutral", badge, note, actions = [], onAction, children }) => {
|
|
30
|
+
const ActionCard = ({ title, tone = "neutral", badge, note, actions = [], onAction, children, frameless = false }) => {
|
|
31
31
|
const [confirming, setConfirming] = useState();
|
|
32
32
|
const hints = actions.flatMap((action) => action.hint ? [action.hint] : []);
|
|
33
33
|
const click = (action) => action.confirm ? setConfirming(action) : onAction?.(action.id);
|
|
34
34
|
return /* @__PURE__ */ jsxs("section", {
|
|
35
35
|
"aria-label": title,
|
|
36
|
-
className: cn("shrink-0 overflow-hidden rounded-lg border bg-background whitespace-normal text-foreground shadow-sm", frames[tone].border),
|
|
36
|
+
className: frameless ? "whitespace-normal text-foreground" : cn("shrink-0 overflow-hidden rounded-lg border bg-background whitespace-normal text-foreground shadow-sm", frames[tone].border),
|
|
37
37
|
children: [
|
|
38
|
-
/* @__PURE__ */ jsxs("header", {
|
|
38
|
+
!frameless && /* @__PURE__ */ jsxs("header", {
|
|
39
39
|
className: cn("flex items-center gap-2 px-3 py-2", frames[tone].header),
|
|
40
40
|
children: [/* @__PURE__ */ jsx("h3", {
|
|
41
41
|
className: "min-w-0 flex-1 text-[13px] font-semibold",
|
|
@@ -46,7 +46,7 @@ const ActionCard = ({ title, tone = "neutral", badge, note, actions = [], onActi
|
|
|
46
46
|
})]
|
|
47
47
|
}),
|
|
48
48
|
(children || note || actions.length > 0) && /* @__PURE__ */ jsxs("div", {
|
|
49
|
-
className: "space-y-2.5 px-3 py-2.5",
|
|
49
|
+
className: cn("space-y-2.5", !frameless && "px-3 py-2.5"),
|
|
50
50
|
children: [
|
|
51
51
|
children,
|
|
52
52
|
note && /* @__PURE__ */ jsx("p", {
|
package/dist/package.js
CHANGED