@protobase/ui 0.19.1 → 0.19.3
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/app/app.js +2 -0
- package/dist/app/favicon.svg +1 -0
- package/dist/app/gallery/detail-fields.js +12 -0
- package/dist/app/gallery/gallery-layout.js +3 -1
- package/dist/app/gallery/gallery-section.js +7 -4
- package/dist/app/gallery/lightbox.js +38 -44
- package/dist/app/gallery/photo-details.js +21 -28
- package/dist/app/pages/merge-ui.d.ts +1 -1
- package/dist/app/pages/merge-ui.js +5 -3
- package/dist/app/pages/project-ui.d.ts +6 -1
- package/dist/app/pages/record-actions.js +32 -6
- package/dist/app/project-logo.js +17 -0
- package/dist/app/record-mode/record-mode.js +12 -7
- package/dist/app/record-page.js +27 -38
- package/dist/app-shell/app-shell.d.ts +1 -1
- package/dist/app-shell/app-shell.js +3 -2
- package/dist/app-shell/index.d.ts +1 -0
- package/dist/app-shell/logo.d.ts +11 -0
- package/dist/app-shell/logo.js +30 -32
- package/dist/app-shell/sidebar.d.ts +2 -1
- package/dist/app-shell/sidebar.js +3 -3
- package/dist/app-shell/wordmark-path.js +4 -0
- package/dist/auth/auth-layout.d.ts +10 -0
- package/dist/auth/code-form.d.ts +29 -0
- package/dist/auth/resend-code-button.d.ts +11 -0
- package/dist/format/date.js +2 -15
- package/dist/index.d.ts +8 -1
- package/dist/index.js +8 -1
- package/dist/package.js +1 -1
- package/dist/primitives/button.d.ts +11 -0
- package/dist/primitives/input.d.ts +11 -0
- package/dist/primitives/spinner.d.ts +5 -0
- package/dist/record-view/action-rail.js +22 -11
- package/dist/record-view/record-header.js +5 -5
- package/dist/shell/assets/app-ChEqQ9ca.js +66 -0
- package/dist/shell/assets/{index-Bes91xE3.js → index-5frCs7fQ.js} +1 -1
- package/dist/shell/assets/index-D-4IHhqX.css +2 -0
- package/dist/shell/assets/maplibre-D8plsjP2.js +814 -0
- package/dist/shell/assets/{record-map-CY2LFq1z.js → record-map-BDJTOwZo.js} +1 -1
- package/dist/shell/assets/records-map-C-XKw6m1.js +1 -0
- package/dist/shell/assets/shared-protobase-ui-Ceamz_7l.js +1 -0
- package/dist/shell/index.html +5 -4
- package/dist/shell/protobase.shell.json +1 -1
- package/package.json +6 -5
- package/dist/shell/assets/app-DYl-j-Nf.js +0 -66
- package/dist/shell/assets/index-BLnOMDD8.css +0 -2
- package/dist/shell/assets/maplibre-BDe9GhVw.js +0 -814
- package/dist/shell/assets/records-map-B_DHVvmx.js +0 -1
- package/dist/shell/assets/shared-protobase-ui-Bb2W4Il8.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/app-shell/logo.d.ts
|
|
2
|
+
/** The Protobase mark, the Corner: the outlined corner is what an app describes, the solid rest what Protobase runs. */
|
|
3
|
+
export declare const LogoMark: ({ className }: {
|
|
4
|
+
className?: string;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
6
|
+
/** What the logo at the top of the sidebar gets: `compact` when the sidebar shows only icons, and the workspace's name. */
|
|
7
|
+
export type ShellLogoProps = {
|
|
8
|
+
compact: boolean;
|
|
9
|
+
workspace?: string;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
package/dist/app-shell/logo.js
CHANGED
|
@@ -1,46 +1,44 @@
|
|
|
1
1
|
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { wordmarkPath } from "./wordmark-path.js";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
//#region src/app-shell/logo.tsx
|
|
5
|
+
const corner = "fill-[#ff5a1f] dark:fill-[#ff6a33]";
|
|
6
|
+
const solid = "fill-[#14161a] dark:fill-[#f1f0ea]";
|
|
7
|
+
/** The Protobase mark, the Corner: the outlined corner is what an app describes, the solid rest what Protobase runs. */
|
|
4
8
|
const LogoMark = ({ className }) => /* @__PURE__ */ jsxs("svg", {
|
|
5
|
-
viewBox: "0 0
|
|
9
|
+
viewBox: "0 0 32 32",
|
|
6
10
|
className: cn("size-7 shrink-0", className),
|
|
7
11
|
"aria-hidden": true,
|
|
8
|
-
children: [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
strokeWidth: "2",
|
|
28
|
-
strokeLinecap: "round"
|
|
29
|
-
})
|
|
30
|
-
]
|
|
12
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
13
|
+
className: corner,
|
|
14
|
+
fillRule: "evenodd",
|
|
15
|
+
d: "M0 5a5 5 0 0 1 5-5h7a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zM4 5a1 1 0 0 1 1-1h5v6H4z"
|
|
16
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
17
|
+
className: solid,
|
|
18
|
+
d: "M17 0h10a5 5 0 0 1 5 5v22a5 5 0 0 1-5 5H5a5 5 0 0 1-5-5V17h17z"
|
|
19
|
+
})]
|
|
20
|
+
});
|
|
21
|
+
/** The name "protobase", outlined as the brand draws it rather than set in a font. */
|
|
22
|
+
const Wordmark = ({ className }) => /* @__PURE__ */ jsx("svg", {
|
|
23
|
+
viewBox: "54.8 -720 3743.8 925",
|
|
24
|
+
className: cn("h-3.5 w-auto", className),
|
|
25
|
+
role: "img",
|
|
26
|
+
"aria-label": "Protobase",
|
|
27
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
28
|
+
className: solid,
|
|
29
|
+
d: wordmarkPath
|
|
30
|
+
})
|
|
31
31
|
});
|
|
32
|
-
|
|
32
|
+
/** Protobase's logo at the top of the sidebar, the workspace's name under the wordmark, or the mark alone when compact. */
|
|
33
|
+
const Logo = ({ compact, workspace }) => /* @__PURE__ */ jsxs("div", {
|
|
33
34
|
className: "flex items-center gap-2.5 overflow-hidden",
|
|
34
|
-
children: [/* @__PURE__ */ jsx(LogoMark, {}),
|
|
35
|
-
className: "min-w-0 leading-tight",
|
|
36
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
37
|
-
className: "text-[13px] font-semibold tracking-tight",
|
|
38
|
-
children: "Protobase"
|
|
39
|
-
}), workspace && /* @__PURE__ */ jsx("div", {
|
|
35
|
+
children: [/* @__PURE__ */ jsx(LogoMark, {}), !compact && /* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: "flex min-w-0 flex-col gap-0.5 leading-tight",
|
|
37
|
+
children: [/* @__PURE__ */ jsx(Wordmark, { className: "self-start" }), workspace && /* @__PURE__ */ jsx("div", {
|
|
40
38
|
className: "truncate text-[11px] text-muted-foreground",
|
|
41
39
|
children: workspace
|
|
42
40
|
})]
|
|
43
41
|
})]
|
|
44
42
|
});
|
|
45
43
|
//#endregion
|
|
46
|
-
export { Logo, LogoMark };
|
|
44
|
+
export { Logo, LogoMark, Wordmark };
|
|
@@ -10,7 +10,7 @@ import { SidebarGroup } from "./sidebar-group.js";
|
|
|
10
10
|
import { LogIn } from "lucide-react";
|
|
11
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
//#region src/app-shell/sidebar.tsx
|
|
13
|
-
const Sidebar = ({ mode, activeItem, user, workspace, forceExpanded, profileMenuOpen, groups = navGroups, userMenu, onNavigate, onSignOut, signIn, organizations, roles, theme, sticky }) => {
|
|
13
|
+
const Sidebar = ({ mode, activeItem, user, workspace, forceExpanded, profileMenuOpen, groups = navGroups, userMenu, onNavigate, onSignOut, signIn, organizations, roles, theme, sticky, logo: SidebarLogo = Logo }) => {
|
|
14
14
|
const expanding = mode === "icon-expand";
|
|
15
15
|
const expanded = expanding && forceExpanded;
|
|
16
16
|
const inline = isTextMode(mode) || expanding;
|
|
@@ -22,8 +22,8 @@ const Sidebar = ({ mode, activeItem, user, workspace, forceExpanded, profileMenu
|
|
|
22
22
|
children: [
|
|
23
23
|
/* @__PURE__ */ jsx("div", {
|
|
24
24
|
className: cn("flex h-12 shrink-0 items-center px-3.5", mode === "icon-label" && "justify-center px-0"),
|
|
25
|
-
children: /* @__PURE__ */ jsx(
|
|
26
|
-
|
|
25
|
+
children: /* @__PURE__ */ jsx(SidebarLogo, {
|
|
26
|
+
compact: !inline,
|
|
27
27
|
workspace
|
|
28
28
|
})
|
|
29
29
|
}),
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/app-shell/wordmark-path.ts
|
|
2
|
+
const wordmarkPath = "M312.3 9.9Q257 9.9 217.1 -21.1Q177.3 -52.1 168.4 -108.8L181.1 -110.3V205H54.8V-510H176.7V-404.5L168.3 -407Q179.7 -460.8 221.2 -490.4Q262.7 -520 319.8 -520Q376.2 -520 417 -488.4Q457.8 -456.8 479.8 -398.6Q501.8 -340.5 501.8 -259.9Q501.8 -177.6 478.3 -116.8Q454.9 -55.9 412.5 -23Q370.1 9.9 312.3 9.9ZM274.4 -92.6Q320.2 -92.6 345.8 -133.8Q371.4 -175.1 371.4 -256.4Q371.4 -337.7 345.7 -377.6Q320.1 -417.5 274 -417.5Q228.6 -417.5 202.7 -376.4Q176.9 -335.3 176.9 -254Q176.9 -173.3 202.7 -132.9Q228.4 -92.6 274.4 -92.6Z M549.8 0V-510H671.7V-388.3H676.1V0H549.8ZM676.1 -286.5 661.3 -386.2Q677.9 -455.2 711.8 -487.6Q745.7 -520 794.3 -520Q809 -520 818 -516.6V-394.2Q814.2 -395.6 807.1 -396.1Q800 -396.6 789.4 -396.6Q734.6 -396.6 705.3 -370.5Q676.1 -344.4 676.1 -286.5Z M1043.8 10Q974.7 10 922.6 -23.6Q870.6 -57.2 842.1 -117.5Q813.6 -177.8 813.6 -257Q813.6 -336.5 842.2 -395.5Q870.8 -454.5 922.5 -487.2Q974.2 -520 1043.8 -520Q1113.7 -520 1165.4 -487.2Q1217.1 -454.5 1245.6 -395.5Q1274 -336.5 1274 -257Q1274 -177.8 1245.5 -117.5Q1217 -57.2 1165.3 -23.6Q1113.6 10 1043.8 10ZM1043.8 -90.5Q1073.5 -90.5 1095.9 -108.9Q1118.2 -127.3 1130.9 -164.4Q1143.6 -201.5 1143.6 -257.5Q1143.6 -339.8 1116 -379.7Q1088.4 -419.5 1043.8 -419.5Q999.3 -419.5 971.6 -379.5Q944 -339.5 944 -257.5Q944 -201.5 956.7 -164.4Q969.4 -127.3 991.8 -108.9Q1014.3 -90.5 1043.8 -90.5Z M1509 10.2Q1427.2 10.2 1387.6 -29.2Q1348 -68.6 1348 -147.7V-613.8L1474.2 -666.1V-146.7Q1474.2 -118.4 1489.9 -104.3Q1505.6 -90.3 1539.2 -90.3Q1552 -90.3 1562.7 -92.5Q1573.3 -94.8 1582.5 -98.7V-1.9Q1571.6 4 1552 7.1Q1532.4 10.2 1509 10.2ZM1270.1 -411V-510H1580.6V-411H1270.1Z M1810.8 10Q1741.7 10 1689.6 -23.6Q1637.6 -57.2 1609.1 -117.5Q1580.6 -177.8 1580.6 -257Q1580.6 -336.5 1609.2 -395.5Q1637.8 -454.5 1689.5 -487.2Q1741.2 -520 1810.8 -520Q1880.7 -520 1932.4 -487.2Q1984.1 -454.5 2012.6 -395.5Q2041 -336.5 2041 -257Q2041 -177.8 2012.5 -117.5Q1984 -57.2 1932.3 -23.6Q1880.6 10 1810.8 10ZM1810.8 -90.5Q1840.5 -90.5 1862.9 -108.9Q1885.2 -127.3 1897.9 -164.4Q1910.6 -201.5 1910.6 -257.5Q1910.6 -339.8 1883 -379.7Q1855.4 -419.5 1810.8 -419.5Q1766.3 -419.5 1738.6 -379.5Q1711 -339.5 1711 -257.5Q1711 -201.5 1723.7 -164.4Q1736.4 -127.3 1758.8 -108.9Q1781.3 -90.5 1810.8 -90.5Z M2343.3 9.9Q2288 9.9 2247.7 -21.1Q2207.4 -52.1 2198.5 -108.8L2205.8 -110.3V0H2085.8V-720H2212.1V-404.5L2203.7 -407Q2215.1 -460.8 2255.6 -490.4Q2296.2 -520 2351 -520Q2407.3 -520 2448 -488.4Q2488.8 -456.8 2510.8 -398.6Q2532.8 -340.5 2532.8 -259.9Q2532.8 -177.6 2509.3 -116.8Q2485.9 -55.9 2443.5 -23Q2401.1 9.9 2343.3 9.9ZM2305.4 -92.6Q2350.7 -92.6 2376.6 -133.8Q2402.4 -175.1 2402.4 -256.4Q2402.4 -337.7 2376.5 -377.6Q2350.6 -417.5 2305 -417.5Q2260.5 -417.5 2234.2 -376.4Q2207.9 -335.3 2207.9 -254Q2207.9 -173.3 2234.1 -132.9Q2260.3 -92.6 2305.4 -92.6Z M2834 0Q2828 -19.1 2825.7 -41.7Q2823.3 -64.2 2823.3 -91.8H2818.6V-356Q2818.6 -391.9 2803.1 -409.1Q2787.5 -426.3 2756.2 -426.3Q2724.2 -426.3 2706.4 -408.7Q2688.7 -391.2 2686.3 -358.9H2571.2Q2574.6 -429.6 2625.4 -474.8Q2676.1 -520 2763.5 -520Q2850.2 -520 2896.1 -476.5Q2941.9 -432.9 2941.9 -352.2V-91.8Q2941.9 -69.5 2944.7 -46.7Q2947.5 -23.8 2954.1 0H2834ZM2690.6 10Q2631.9 10 2595.4 -26.3Q2558.9 -62.5 2558.9 -124.5Q2558.9 -185 2594.3 -224Q2629.8 -263 2704.5 -287.6L2845.4 -337.4V-248.7L2753.4 -219.3Q2716.5 -206.1 2699.3 -186.6Q2682.2 -167.2 2682.2 -139Q2682.2 -112.4 2697.5 -98.4Q2712.9 -84.3 2739.4 -84.3Q2773.2 -84.3 2795.9 -104.1Q2818.6 -123.9 2818.6 -153.1L2829.9 -85.8Q2812.6 -37.4 2776.8 -13.7Q2741 10 2690.6 10Z M3168 10Q3080.6 10 3030.1 -34.2Q2979.6 -78.4 2974.7 -158.1H3082.4Q3086.3 -120 3108.9 -100.5Q3131.5 -80.9 3169.8 -80.9Q3202 -80.9 3218.9 -93.9Q3235.8 -106.9 3235.8 -131.3Q3235.8 -151.1 3224.3 -165.6Q3212.9 -180.1 3178.9 -195.4L3111.2 -224.8Q3053 -247.7 3023.8 -284.2Q2994.5 -320.8 2994.5 -373.9Q2994.5 -440.1 3040.1 -480Q3085.7 -520 3162.8 -520Q3242.2 -520 3288.4 -480Q3334.6 -440 3339.5 -367.9H3231.8Q3228.6 -399.7 3211.3 -414.4Q3194 -429.1 3164 -429.1Q3136.1 -429.1 3120.5 -417Q3104.8 -405 3104.8 -382.7Q3104.8 -364.2 3117.7 -349.8Q3130.6 -335.5 3162.4 -321.6L3236.6 -289.6Q3288.6 -269.2 3317.4 -229.2Q3346.1 -189.1 3346.1 -136.9Q3346.1 -69 3299.2 -29.5Q3252.3 10 3168 10Z M3587.8 10Q3520 10 3469.2 -23.3Q3418.5 -56.6 3390.5 -116.5Q3362.6 -176.3 3362.6 -255.8Q3362.6 -336.4 3390.9 -395.7Q3419.3 -454.9 3470.7 -487.5Q3522 -520 3591.1 -520Q3656.6 -520 3702.7 -489.8Q3748.8 -459.7 3773.7 -403.1Q3798.6 -346.5 3798.6 -266.5Q3798.6 -253.7 3798 -242.5Q3797.5 -231.3 3795.8 -221.4H3440V-306.9H3709L3681.8 -277.9Q3681.6 -355.2 3657.7 -390.7Q3633.8 -426.3 3589.3 -426.3Q3541.7 -426.3 3515.6 -384Q3489.5 -341.7 3489.5 -255Q3489.5 -168.4 3515 -126.1Q3540.5 -83.7 3590.6 -83.7Q3623.7 -83.7 3644.6 -102Q3665.5 -120.3 3673.8 -156.3H3788.9Q3772.2 -81.6 3721.5 -35.8Q3670.8 10 3587.8 10Z";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { wordmarkPath };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/auth/auth-layout.d.ts
|
|
3
|
+
export type AuthLayoutProps = {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/** The frame of the sign-in and first-run pages: logo, title and a card. */
|
|
9
|
+
export declare const AuthLayout: ({ title, description, children }: AuthLayoutProps) => import("react").JSX.Element;
|
|
10
|
+
//#endregion
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/auth/code-form.d.ts
|
|
3
|
+
export type CodeFormProps = {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
/** Above the code: which address it went to, and how long it works. */
|
|
7
|
+
explanation: ReactNode;
|
|
8
|
+
/** The button that checks the code, which a complete code presses by itself. */
|
|
9
|
+
submitLabel: string;
|
|
10
|
+
/** Called with the code; the page shows `error` when it is not right. */
|
|
11
|
+
onSubmit: (code: string) => void;
|
|
12
|
+
/** Sends a new code to the same address. */
|
|
13
|
+
onResend: () => void;
|
|
14
|
+
/** Back to the step that asked for the address, for another one. */
|
|
15
|
+
onChangeAddress: () => void;
|
|
16
|
+
changeAddressLabel: string;
|
|
17
|
+
busy?: boolean;
|
|
18
|
+
error?: string;
|
|
19
|
+
/** Shown once a new code is on its way. */
|
|
20
|
+
notice?: string;
|
|
21
|
+
/** Seconds before "Send a new code" works, after each code; 30 by default. */
|
|
22
|
+
resendCooldown?: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A step that checks an emailed code on its own: where it went, a box per digit, a new code after a wait, and a way back
|
|
26
|
+
* to another address. Nothing else is asked for until the code is right.
|
|
27
|
+
*/
|
|
28
|
+
export declare const CodeForm: ({ title, description, explanation, submitLabel, onSubmit, onResend, onChangeAddress, changeAddressLabel, busy, error, notice, resendCooldown }: CodeFormProps) => import("react").JSX.Element;
|
|
29
|
+
//#endregion
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/auth/resend-code-button.d.ts
|
|
2
|
+
export type ResendCodeButtonProps = {
|
|
3
|
+
/** Sends a new code; the button waits `cooldown` seconds again after it. */
|
|
4
|
+
onResend: () => void;
|
|
5
|
+
/** Seconds to wait after a code went out before another is asked for; 30 by default. */
|
|
6
|
+
cooldown?: number;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** "Send a new code", counting down first: the screen opens right after a code went out, and so does every resend. */
|
|
10
|
+
export declare const ResendCodeButton: ({ onResend, cooldown, disabled }: ResendCodeButtonProps) => import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
package/dist/format/date.js
CHANGED
|
@@ -19,19 +19,6 @@ const time = new Intl.DateTimeFormat("en-GB", {
|
|
|
19
19
|
const formatDate = (ms) => day.format(ms);
|
|
20
20
|
const formatDayShort = (ms) => dayShort.format(ms);
|
|
21
21
|
const formatDateTime = (ms) => `${day.format(ms)}, ${time.format(ms)}`;
|
|
22
|
-
|
|
23
|
-
const units = [
|
|
24
|
-
["year", 31536e3],
|
|
25
|
-
["month", 2592e3],
|
|
26
|
-
["day", 86400],
|
|
27
|
-
["hour", 3600],
|
|
28
|
-
["minute", 60]
|
|
29
|
-
];
|
|
30
|
-
/** "5 minutes ago", "yesterday", "3 years ago"; `seconds` is how long ago it was. */
|
|
31
|
-
const formatRelativeTime = (seconds) => {
|
|
32
|
-
const [unit, size] = units.find(([, size]) => seconds >= size) ?? ["second", 1];
|
|
33
|
-
if (unit === "second" && seconds < 45) return "just now";
|
|
34
|
-
return relative.format(-Math.floor(seconds / size), unit);
|
|
35
|
-
};
|
|
22
|
+
new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
36
23
|
//#endregion
|
|
37
|
-
export { formatDate, formatDateTime, formatDayShort
|
|
24
|
+
export { formatDate, formatDateTime, formatDayShort };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LogoMark, ShellLogoProps } from "./app-shell/logo.js";
|
|
1
2
|
import { FieldWidget, FieldWidgetEditorProps, FieldWidgetProps } from "./app/field-types/field-widget.js";
|
|
2
3
|
import { ActionContext, ActionHandler, BeforeSignInProps, ProjectUi, definePlugin, defineUi } from "./app/pages/project-ui.js";
|
|
3
4
|
import { PluginInfo, usePlugin } from "./plugins/plugin-context.js";
|
|
@@ -42,4 +43,10 @@ import { Step, StepList, StepState } from "./step-list/step-list.js";
|
|
|
42
43
|
import { DiffView, DiffViewProps } from "./diff-view/diff-view.js";
|
|
43
44
|
import { DiffLine, diffStats, parseDiff } from "./diff-view/diff.js";
|
|
44
45
|
import { CompactTable, CompactTableProps } from "./compact-table/compact-table.js";
|
|
45
|
-
|
|
46
|
+
import { AuthLayout, AuthLayoutProps } from "./auth/auth-layout.js";
|
|
47
|
+
import { CodeForm, CodeFormProps } from "./auth/code-form.js";
|
|
48
|
+
import { ResendCodeButton, ResendCodeButtonProps } from "./auth/resend-code-button.js";
|
|
49
|
+
import { Button, ButtonProps, buttonClass } from "./primitives/button.js";
|
|
50
|
+
import { Input, InputProps } from "./primitives/input.js";
|
|
51
|
+
import { Spinner } from "./primitives/spinner.js";
|
|
52
|
+
export { ActionCard, type ActionCardProps, type ActionContext, type ActionHandler, ApiProvider, type ApiProviderProps, App, AppLink, type AppProps, AssistantDock, type AssistantDockProps, AuthLayout, type AuthLayoutProps, type BackendData, type BackendRefresh, type BeforeSignInProps, Button, type ButtonProps, type CardAction, type CardTone, ChatMessage, ChatThread, type ChatThreadProps, CodeForm, type CodeFormProps, CompactTable, type CompactTableProps, Composer, type ComposerProps, type CurrentAddress, type DiffLine, DiffView, type DiffViewProps, FieldList, type FieldWidget, type FieldWidgetEditorProps, type FieldWidgetProps, Input, type InputProps, type LayoutRecord, type ListAddress, type ListChange, type ListDisplay, type ListDisplayRow, LogoMark, type MetaData, OtpInput, type OtpInputProps, PartView, type PluginInfo, type ProjectUi, type RecordCardProps, RecordLink, ResendCodeButton, type ResendCodeButtonProps, ResponsiveDialog, type ResponsiveDialogProps, type ShellLogoProps, SidePanel, type SidePanelProps, SignInPrompt, type SignInPromptProps, Spinner, type Step, StepList, type StepState, buttonClass, definePlugin, defineUi, diffStats, isConflict, mergeUi, parseDiff, pluginApi, protobaseVersion, uiFromModule, useApiToken, useAppAddress, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useHistogram, useLayoutRecord, useList, useListDisplay, useMeta, usePlugin, useRecord, useResourceClient, useSeries, useUpdateRecord };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { LogoMark } from "./app-shell/logo.js";
|
|
2
|
+
import { Input } from "./primitives/input.js";
|
|
3
|
+
import { Spinner } from "./primitives/spinner.js";
|
|
4
|
+
import { Button, buttonClass } from "./primitives/button.js";
|
|
1
5
|
import { OtpInput } from "./primitives/otp-input.js";
|
|
2
6
|
import { ApiProvider, useClient, useResourceClient } from "./data/api-provider.js";
|
|
7
|
+
import { AuthLayout } from "./auth/auth-layout.js";
|
|
8
|
+
import { ResendCodeButton } from "./auth/resend-code-button.js";
|
|
9
|
+
import { CodeForm } from "./auth/code-form.js";
|
|
3
10
|
import { uiFromModule } from "./app/pages/ui-from-module.js";
|
|
4
11
|
import { mergeUi } from "./app/pages/merge-ui.js";
|
|
5
12
|
import { usePlugin } from "./plugins/plugin-context.js";
|
|
@@ -33,4 +40,4 @@ import { useList } from "./data/use-list.js";
|
|
|
33
40
|
import { isConflict, useUpdateRecord } from "./data/use-update-record.js";
|
|
34
41
|
import { App } from "./app/app.js";
|
|
35
42
|
import { RecordLink } from "./app/displays/record-link.js";
|
|
36
|
-
export { ActionCard, ApiProvider, App, AppLink, AssistantDock, ChatMessage, ChatThread, CompactTable, Composer, DiffView, FieldList, OtpInput, PartView, RecordLink, ResponsiveDialog, SidePanel, SignInPrompt, StepList, definePlugin, defineUi, diffStats, isConflict, mergeUi, parseDiff, pluginApi, protobaseVersion, uiFromModule, useApiToken, useAppAddress, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useHistogram, useLayoutRecord, useList, useListDisplay, useMeta, usePlugin, useRecord, useResourceClient, useSeries, useUpdateRecord };
|
|
43
|
+
export { ActionCard, ApiProvider, App, AppLink, AssistantDock, AuthLayout, Button, ChatMessage, ChatThread, CodeForm, CompactTable, Composer, DiffView, FieldList, Input, LogoMark, OtpInput, PartView, RecordLink, ResendCodeButton, ResponsiveDialog, SidePanel, SignInPrompt, Spinner, StepList, buttonClass, definePlugin, defineUi, diffStats, isConflict, mergeUi, parseDiff, pluginApi, protobaseVersion, uiFromModule, useApiToken, useAppAddress, useAssistant, useAssistantClient, useBackendData, useClient, useFacets, useHistogram, useLayoutRecord, useList, useListDisplay, useMeta, usePlugin, useRecord, useResourceClient, useSeries, useUpdateRecord };
|
package/dist/package.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from "react";
|
|
2
|
+
//#region src/primitives/button.d.ts
|
|
3
|
+
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
4
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
5
|
+
size?: 'sm' | 'md';
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/** A button's classes, for a link that looks like one. */
|
|
9
|
+
export declare const buttonClass: ({ variant, size }?: Pick<ButtonProps, "variant" | "size">) => string;
|
|
10
|
+
export declare const Button: ({ variant, size, loading, className, children, disabled, ...rest }: ButtonProps) => import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode, Ref } from "react";
|
|
2
|
+
//#region src/primitives/input.d.ts
|
|
3
|
+
export type InputProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
4
|
+
ref?: Ref<HTMLInputElement>;
|
|
5
|
+
leading?: ReactNode;
|
|
6
|
+
trailing?: ReactNode;
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
wrapperClassName?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const Input: ({ leading, trailing, invalid, className, wrapperClassName, ...rest }: InputProps) => import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
//#region src/record-view/action-rail.tsx
|
|
4
|
+
const itemClass = "flex min-h-11 items-center gap-2 rounded-md border border-border-strong px-3 text-left hover:bg-surface disabled:cursor-default disabled:opacity-60 md:min-h-0 md:w-full md:items-start md:gap-3 md:rounded-none md:border-0 md:px-4 md:py-3";
|
|
3
5
|
/** Named actions with one-line descriptions; on phones a row of buttons, from `md` a list. */
|
|
4
6
|
const ActionRail = ({ actions }) => /* @__PURE__ */ jsxs("div", {
|
|
5
7
|
className: "overflow-hidden rounded-lg border border-border bg-background",
|
|
@@ -8,20 +10,29 @@ const ActionRail = ({ actions }) => /* @__PURE__ */ jsxs("div", {
|
|
|
8
10
|
children: "Actions"
|
|
9
11
|
}), /* @__PURE__ */ jsx("ul", {
|
|
10
12
|
className: "flex flex-wrap gap-2 p-2 md:block md:divide-y md:divide-border md:p-0",
|
|
11
|
-
children: actions.map(({ name, description, icon: Icon, onRun, blocked, running }) =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
children: [/* @__PURE__ */ jsx(Icon, { className: "size-4 shrink-0 text-muted-foreground md:mt-0.5" }), /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", {
|
|
18
|
-
className: "block text-[13px] font-medium text-foreground",
|
|
13
|
+
children: actions.map(({ name, description, icon: Icon, onRun, blocked, running, tone, render }) => {
|
|
14
|
+
const children = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
15
|
+
className: cn("size-4 shrink-0 md:mt-0.5", tone === "danger" ? "text-danger-text" : "text-muted-foreground"),
|
|
16
|
+
"aria-hidden": true
|
|
17
|
+
}), /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", {
|
|
18
|
+
className: cn("block text-[13px] font-medium", tone === "danger" ? "text-danger-text" : "text-foreground"),
|
|
19
19
|
children: name
|
|
20
20
|
}), description && /* @__PURE__ */ jsx("span", {
|
|
21
21
|
className: "mt-0.5 hidden text-xs leading-snug text-muted-foreground md:block",
|
|
22
22
|
children: description
|
|
23
|
-
})] })]
|
|
24
|
-
|
|
23
|
+
})] })] });
|
|
24
|
+
return /* @__PURE__ */ jsx("li", { children: render ? render({
|
|
25
|
+
className: itemClass,
|
|
26
|
+
children
|
|
27
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
28
|
+
type: "button",
|
|
29
|
+
onClick: onRun,
|
|
30
|
+
disabled: Boolean(blocked) || running,
|
|
31
|
+
title: blocked,
|
|
32
|
+
className: itemClass,
|
|
33
|
+
children
|
|
34
|
+
}) }, name);
|
|
35
|
+
})
|
|
25
36
|
})]
|
|
26
37
|
});
|
|
27
38
|
//#endregion
|
|
@@ -5,21 +5,21 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
const RecordHeader = ({ collection, title, status, lastEditedBy, presence = [], actions }) => /* @__PURE__ */ jsxs("header", {
|
|
6
6
|
className: "flex flex-col gap-4 border-b border-border pb-6 md:flex-row md:items-end md:justify-between md:gap-6",
|
|
7
7
|
children: [/* @__PURE__ */ jsxs("div", { children: [
|
|
8
|
-
/* @__PURE__ */ jsx("p", {
|
|
9
|
-
className: "text-xs text-muted-foreground",
|
|
8
|
+
collection && /* @__PURE__ */ jsx("p", {
|
|
9
|
+
className: "mb-1 text-xs text-muted-foreground",
|
|
10
10
|
children: collection
|
|
11
11
|
}),
|
|
12
12
|
/* @__PURE__ */ jsxs("div", {
|
|
13
|
-
className: "
|
|
13
|
+
className: "flex flex-wrap items-center gap-x-3 gap-y-1",
|
|
14
14
|
children: [/* @__PURE__ */ jsx("h1", {
|
|
15
15
|
className: "text-xl font-semibold tracking-tight text-foreground md:text-2xl",
|
|
16
16
|
children: title
|
|
17
|
-
}), /* @__PURE__ */ jsx(Badge, {
|
|
17
|
+
}), status && /* @__PURE__ */ jsx(Badge, {
|
|
18
18
|
tone: status.tone,
|
|
19
19
|
children: status.label
|
|
20
20
|
})]
|
|
21
21
|
}),
|
|
22
|
-
/* @__PURE__ */ jsx("p", {
|
|
22
|
+
lastEditedBy && /* @__PURE__ */ jsx("p", {
|
|
23
23
|
className: "mt-1.5 text-xs text-muted-foreground",
|
|
24
24
|
children: lastEditedBy.name ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
25
|
"Last edited by ",
|