@protobase/ui 0.19.4 → 0.19.6
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/account/account-section.js +2 -2
- package/dist/account/account-security-page.js +2 -2
- package/dist/account/backup-codes.js +3 -10
- package/dist/account/passkeys-section.js +2 -2
- package/dist/account/password-dialog.js +1 -1
- package/dist/account/sign-in-policy-form.js +2 -2
- package/dist/account/sign-in-policy-page.js +2 -2
- package/dist/account/sign-in-providers-section.js +1 -1
- package/dist/account/staff-sign-in-log.js +3 -3
- package/dist/account/two-factor-setup.js +6 -6
- package/dist/action-card/action-card.js +1 -1
- package/dist/activity-chart/activity-chart.js +2 -2
- package/dist/app/delete/dialogs.js +3 -3
- package/dist/app/displays/display-controls.js +1 -1
- package/dist/app/displays/display-frame.js +1 -1
- package/dist/app/displays/list-cards.js +1 -1
- package/dist/app/displays/list-displays.js +2 -1
- package/dist/app/displays/map-display.js +1 -1
- package/dist/app/displays/record-card.js +1 -1
- package/dist/app/embedded-list/embedded-list.js +2 -2
- package/dist/app/error-banner.js +1 -1
- package/dist/app/field-editor.js +6 -12
- package/dist/app/file-field.js +4 -4
- package/dist/app/filled-fields.js +5 -0
- package/dist/app/gallery/details-open-storage.js +10 -0
- package/dist/app/gallery/gallery-layout.js +3 -1
- package/dist/app/gallery/lightbox.js +107 -61
- package/dist/app/gallery/photo-details.js +1 -1
- package/dist/app/import/convert.js +151 -0
- package/dist/app/import/csv-parser.js +119 -0
- package/dist/app/import/failed-rows.js +21 -0
- package/dist/app/import/import-button.js +31 -0
- package/dist/app/import/import-check-step.js +123 -0
- package/dist/app/import/import-counts.js +19 -0
- package/dist/app/import/import-dialog.js +152 -0
- package/dist/app/import/import-file-step.js +65 -0
- package/dist/app/import/import-mapping-step.js +195 -0
- package/dist/app/import/import-result-step.js +86 -0
- package/dist/app/import/import-select.js +35 -0
- package/dist/app/import/locale-formats.js +15 -0
- package/dist/app/import/lookups.js +48 -0
- package/dist/app/import/mapping.js +78 -0
- package/dist/app/import/parse-worker.d.ts +1 -0
- package/dist/app/import/parse-worker.js +39 -0
- package/dist/app/import/prepare-rows.js +129 -0
- package/dist/app/import/run-import.js +130 -0
- package/dist/app/import/sheet-cell.js +17 -0
- package/dist/app/import/sheet-file.js +58 -0
- package/dist/app/import/sheet-source.js +72 -0
- package/dist/app/import/use-import-flow.js +225 -0
- package/dist/app/import/xlsx-reader.js +43 -0
- package/dist/app/import/xlsx-xml.js +169 -0
- package/dist/app/import/zip-reader.js +72 -0
- package/dist/app/list-page.js +8 -1
- package/dist/app/meta-gate.js +3 -3
- package/dist/app/named-icon.js +9 -1
- package/dist/app/pages/blocks/card-frame.js +4 -4
- package/dist/app/pages/blocks/field.js +2 -5
- package/dist/app/pages/blocks/stat.js +2 -2
- package/dist/app/pages/problem.js +1 -1
- package/dist/app/pages/render-node.js +1 -1
- package/dist/app/record-page.js +13 -4
- package/dist/app/record-row/record-row-body.js +3 -3
- package/dist/app/record-row/saved-record-row.js +1 -1
- package/dist/app/related-section.js +1 -1
- package/dist/app/relation-picker.js +1 -1
- package/dist/app/runtime/runtime-update.js +3 -3
- package/dist/app/saved/saved-list.js +1 -1
- package/dist/app/searches/saved-search-rows.js +2 -2
- package/dist/app/searches/saved-search-section.js +1 -1
- package/dist/app/searches/saved-searches.js +1 -1
- package/dist/app/searches/search-controls.js +2 -2
- package/dist/app/searches/search-name-dialog.js +1 -1
- package/dist/app/searches/update-search-dialog.js +16 -19
- package/dist/app/sensitive-field.js +1 -1
- package/dist/app/source-notice.js +3 -3
- package/dist/app/staff-banner.js +1 -1
- package/dist/app-shell/breadcrumb.js +1 -1
- package/dist/app-shell/global-search.js +1 -1
- package/dist/app-shell/page-header.js +1 -1
- package/dist/app-shell/profile-menu.js +3 -3
- package/dist/app-shell/sidebar-group.js +1 -1
- package/dist/app-shell/sidebar-item.js +1 -1
- package/dist/app-shell/sidebar.js +2 -2
- package/dist/assistant-dock/part-view.js +1 -4
- package/dist/assistant-dock/widget-view.js +1 -4
- package/dist/auth/auth-gate.js +2 -2
- package/dist/auth/auth-layout.js +1 -1
- package/dist/auth/code-form.js +2 -2
- package/dist/auth/first-run-page.js +1 -1
- package/dist/auth/forgot-password-form.js +2 -2
- package/dist/auth/provider-sign-in-page.js +1 -1
- package/dist/auth/reset-password-form.js +3 -3
- package/dist/auth/setup-required-form.js +2 -2
- package/dist/auth/setup-required-page.js +1 -1
- package/dist/auth/sign-in-form.js +5 -5
- package/dist/auth/sign-in-prompt.js +3 -3
- package/dist/auth/sign-up-details-form.js +3 -3
- package/dist/auth/sign-up-email-form.js +4 -4
- package/dist/auth/staff-sign-in-form.js +3 -3
- package/dist/auth/two-factor-form.js +5 -5
- package/dist/chat/chat-message.js +1 -1
- package/dist/chat/chat-thread.js +1 -1
- package/dist/data/api-provider.js +8 -2
- package/dist/data-grid/grid-row.js +1 -1
- package/dist/data-grid/header-menu.js +1 -1
- package/dist/data-grid/row-menu.js +1 -1
- package/dist/filter-panel/facet-combobox.js +1 -1
- package/dist/filter-panel/filter-menu.js +1 -1
- package/dist/filter-panel/filter-panel.js +2 -2
- package/dist/inline-child-table/line-menu.js +1 -1
- package/dist/inline-child-table/line-row.js +4 -4
- package/dist/inline-child-table/number-cell.js +1 -1
- package/dist/inline-child-table/totals-footer.js +2 -2
- package/dist/lib/save-file.js +12 -0
- package/dist/lib/use-focus-trap.js +7 -1
- package/dist/organizations/app-roles-picker.js +1 -1
- package/dist/organizations/invitation-page.js +3 -3
- package/dist/organizations/invitations-page.js +2 -2
- package/dist/organizations/members-page.js +2 -2
- package/dist/organizations/organization-page.js +1 -1
- package/dist/organizations/organizations-page.js +2 -2
- package/dist/package.js +1 -1
- package/dist/plugins/before-sign-in.js +1 -1
- package/dist/plugins/plugin-gate.js +1 -1
- package/dist/plugins/plugin-notice.js +1 -1
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/dialog.js +2 -2
- package/dist/primitives/input.js +1 -1
- package/dist/primitives/menu-select.js +2 -2
- package/dist/primitives/responsive-dialog.js +1 -1
- package/dist/primitives/segmented.js +1 -1
- package/dist/primitives/sheet-swipe.js +5 -0
- package/dist/primitives/sheet.js +40 -12
- package/dist/primitives/textarea.js +1 -1
- package/dist/record-view/action-rail.js +1 -1
- package/dist/record-view/field.js +1 -1
- package/dist/record-view/key-facts.js +29 -0
- package/dist/record-view/record-sidebar.js +2 -2
- package/dist/record-view/section.js +2 -2
- package/dist/record-view/spec-table.js +1 -1
- package/dist/shell/assets/app-DwKzLvfm.js +67 -0
- package/dist/shell/assets/index-CwhnZIJp.css +2 -0
- package/dist/shell/assets/{index-CEvfMgFJ.js → index-Dqgcyg7M.js} +1 -1
- package/dist/shell/assets/{maplibre-D6zfLfTV.js → maplibre-BWjNhvrH.js} +1 -1
- package/dist/shell/assets/parse-worker-BtcY0dQw.js +5 -0
- package/dist/shell/assets/{record-map-B6_rbCcG.js → record-map-m5K2uttt.js} +1 -1
- package/dist/shell/assets/{records-map-bQbuIc13.js → records-map-CA_JG9RR.js} +1 -1
- package/dist/shell/assets/{shared-protobase-ui-8pJgwjfc.js → shared-protobase-ui-BBqKlVLh.js} +1 -1
- package/dist/shell/index.html +4 -4
- package/dist/shell/protobase.shell.json +1 -1
- package/dist/side-panel/side-panel.js +1 -1
- package/dist/step-list/step-list.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme.css +2 -0
- package/dist/toasts/toast.js +2 -2
- package/package.json +4 -4
- package/dist/shell/assets/app-BYFiTXK6.js +0 -66
- package/dist/shell/assets/index-CiGP6kle.css +0 -2
|
@@ -8,12 +8,12 @@ const AccountSection = ({ title, status, description, children }) => /* @__PURE_
|
|
|
8
8
|
/* @__PURE__ */ jsxs("div", {
|
|
9
9
|
className: "flex flex-wrap items-center gap-2",
|
|
10
10
|
children: [/* @__PURE__ */ jsx("h2", {
|
|
11
|
-
className: "text-[
|
|
11
|
+
className: "text-[16px] font-semibold",
|
|
12
12
|
children: title
|
|
13
13
|
}), status]
|
|
14
14
|
}),
|
|
15
15
|
/* @__PURE__ */ jsx("p", {
|
|
16
|
-
className: "mt-1 text-
|
|
16
|
+
className: "mt-1 text-muted-foreground",
|
|
17
17
|
children: description
|
|
18
18
|
}),
|
|
19
19
|
children && /* @__PURE__ */ jsx("div", {
|
|
@@ -69,10 +69,10 @@ const AccountSecurityPage = ({ email }) => {
|
|
|
69
69
|
})
|
|
70
70
|
] }) : error ? /* @__PURE__ */ jsx("p", {
|
|
71
71
|
role: "alert",
|
|
72
|
-
className: "text-
|
|
72
|
+
className: "text-danger-text",
|
|
73
73
|
children: error
|
|
74
74
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
75
|
-
className: "flex items-center gap-2 text-
|
|
75
|
+
className: "flex items-center gap-2 text-muted-foreground",
|
|
76
76
|
children: [/* @__PURE__ */ jsx(Spinner, {}), " Loading"]
|
|
77
77
|
})]
|
|
78
78
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Button } from "../primitives/button.js";
|
|
2
|
+
import { saveFile } from "../lib/save-file.js";
|
|
2
3
|
import { useState } from "react";
|
|
3
4
|
import { Check, Copy, Download } from "lucide-react";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -11,7 +12,7 @@ const BackupCodes = ({ codes }) => {
|
|
|
11
12
|
className: "flex flex-col gap-3",
|
|
12
13
|
children: [/* @__PURE__ */ jsx("ul", {
|
|
13
14
|
"aria-label": "Backup codes",
|
|
14
|
-
className: "grid grid-cols-2 gap-x-4 gap-y-1 rounded-md border bg-surface p-3 font-mono
|
|
15
|
+
className: "grid grid-cols-2 gap-x-4 gap-y-1 rounded-md border bg-surface p-3 font-mono",
|
|
15
16
|
children: codes.map((code) => /* @__PURE__ */ jsx("li", { children: code }, code))
|
|
16
17
|
}), /* @__PURE__ */ jsxs("div", {
|
|
17
18
|
className: "flex flex-wrap gap-2",
|
|
@@ -26,19 +27,11 @@ const BackupCodes = ({ codes }) => {
|
|
|
26
27
|
children: [copied ? /* @__PURE__ */ jsx(Check, { className: "size-3.5 text-success" }) : /* @__PURE__ */ jsx(Copy, { className: "size-3.5" }), copied ? "Copied" : "Copy"]
|
|
27
28
|
}), /* @__PURE__ */ jsxs(Button, {
|
|
28
29
|
size: "sm",
|
|
29
|
-
onClick: () =>
|
|
30
|
+
onClick: () => saveFile(text, "backup-codes.txt"),
|
|
30
31
|
children: [/* @__PURE__ */ jsx(Download, { className: "size-3.5" }), "Download"]
|
|
31
32
|
})]
|
|
32
33
|
})]
|
|
33
34
|
});
|
|
34
35
|
};
|
|
35
|
-
const saveText = (text, name) => {
|
|
36
|
-
const url = URL.createObjectURL(new Blob([text], { type: "text/plain" }));
|
|
37
|
-
Object.assign(document.createElement("a"), {
|
|
38
|
-
href: url,
|
|
39
|
-
download: name
|
|
40
|
-
}).click();
|
|
41
|
-
URL.revokeObjectURL(url);
|
|
42
|
-
};
|
|
43
36
|
//#endregion
|
|
44
37
|
export { BackupCodes };
|
|
@@ -51,7 +51,7 @@ const PasskeysSection = ({ rule, passkeys, onAdd, onRename, onRemove }) => {
|
|
|
51
51
|
/* @__PURE__ */ jsxs("span", {
|
|
52
52
|
className: "min-w-0 flex-1",
|
|
53
53
|
children: [/* @__PURE__ */ jsx("span", {
|
|
54
|
-
className: "block truncate
|
|
54
|
+
className: "block truncate font-medium",
|
|
55
55
|
children: passkey.name ?? "Passkey"
|
|
56
56
|
}), /* @__PURE__ */ jsxs("span", {
|
|
57
57
|
className: "block text-xs text-muted-foreground",
|
|
@@ -110,7 +110,7 @@ const PasskeysSection = ({ rule, passkeys, onAdd, onRename, onRemove }) => {
|
|
|
110
110
|
children: "Save"
|
|
111
111
|
})] }),
|
|
112
112
|
children: [/* @__PURE__ */ jsxs("label", {
|
|
113
|
-
className: "flex flex-col gap-1.5
|
|
113
|
+
className: "flex flex-col gap-1.5 font-medium",
|
|
114
114
|
children: ["Name", /* @__PURE__ */ jsx(Input, {
|
|
115
115
|
autoFocus: true,
|
|
116
116
|
value: name,
|
|
@@ -37,7 +37,7 @@ const PasswordDialog = ({ title, description, confirmLabel, danger, needsPasswor
|
|
|
37
37
|
children: confirmLabel
|
|
38
38
|
})] }),
|
|
39
39
|
children: [needsPassword && /* @__PURE__ */ jsxs("label", {
|
|
40
|
-
className: "flex flex-col gap-1.5
|
|
40
|
+
className: "flex flex-col gap-1.5 font-medium",
|
|
41
41
|
children: ["Your password", /* @__PURE__ */ jsx(Input, {
|
|
42
42
|
type: "password",
|
|
43
43
|
autoComplete: "current-password",
|
|
@@ -59,11 +59,11 @@ const SignInPolicyForm = ({ state, onSave, busy, error, notice }) => {
|
|
|
59
59
|
className: "min-w-0",
|
|
60
60
|
children: [
|
|
61
61
|
/* @__PURE__ */ jsx("h2", {
|
|
62
|
-
className: "
|
|
62
|
+
className: "font-semibold",
|
|
63
63
|
children: row.label
|
|
64
64
|
}),
|
|
65
65
|
/* @__PURE__ */ jsx("p", {
|
|
66
|
-
className: "mt-0.5 text-
|
|
66
|
+
className: "mt-0.5 text-muted-foreground",
|
|
67
67
|
children: row.description
|
|
68
68
|
}),
|
|
69
69
|
note && /* @__PURE__ */ jsx("p", {
|
|
@@ -60,10 +60,10 @@ const SignInPolicyPage = () => {
|
|
|
60
60
|
onSave: (policy) => void save(policy)
|
|
61
61
|
}, state.savedAt ?? "default"), state.operator && /* @__PURE__ */ jsx(StaffSignIns, { operator: state.operator })] }) : error ? /* @__PURE__ */ jsx("p", {
|
|
62
62
|
role: "alert",
|
|
63
|
-
className: "text-
|
|
63
|
+
className: "text-danger-text",
|
|
64
64
|
children: error
|
|
65
65
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
66
|
-
className: "flex items-center gap-2 text-
|
|
66
|
+
className: "flex items-center gap-2 text-muted-foreground",
|
|
67
67
|
children: [/* @__PURE__ */ jsx(Spinner, {}), " Loading"]
|
|
68
68
|
})]
|
|
69
69
|
});
|
|
@@ -32,7 +32,7 @@ const SignInProvidersSection = ({ providers, linked, onConnect, error: returned
|
|
|
32
32
|
children: [
|
|
33
33
|
/* @__PURE__ */ jsx(Link2, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
34
34
|
/* @__PURE__ */ jsx("span", {
|
|
35
|
-
className: "min-w-0 flex-1 truncate
|
|
35
|
+
className: "min-w-0 flex-1 truncate font-medium",
|
|
36
36
|
children: provider.name
|
|
37
37
|
}),
|
|
38
38
|
linked.includes(provider.id) ? /* @__PURE__ */ jsx(Badge, {
|
|
@@ -20,7 +20,7 @@ const StaffSignInLog = ({ signIns, operator, error, now = Date.now() }) => /* @_
|
|
|
20
20
|
children: [
|
|
21
21
|
/* @__PURE__ */ jsx(SectionError, { message: error }),
|
|
22
22
|
signIns && signIns.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
23
|
-
className: "text-
|
|
23
|
+
className: "text-muted-foreground",
|
|
24
24
|
children: "No staff has signed in as anyone yet."
|
|
25
25
|
}),
|
|
26
26
|
signIns && signIns.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
@@ -29,7 +29,7 @@ const StaffSignInLog = ({ signIns, operator, error, now = Date.now() }) => /* @_
|
|
|
29
29
|
className: "flex flex-col gap-1.5 p-3",
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ jsxs("div", {
|
|
32
|
-
className: "flex flex-wrap items-center gap-x-2 gap-y-1
|
|
32
|
+
className: "flex flex-wrap items-center gap-x-2 gap-y-1",
|
|
33
33
|
children: [
|
|
34
34
|
/* @__PURE__ */ jsx("span", {
|
|
35
35
|
className: "font-medium break-all",
|
|
@@ -46,7 +46,7 @@ const StaffSignInLog = ({ signIns, operator, error, now = Date.now() }) => /* @_
|
|
|
46
46
|
]
|
|
47
47
|
}),
|
|
48
48
|
/* @__PURE__ */ jsx("p", {
|
|
49
|
-
className: "
|
|
49
|
+
className: "break-words",
|
|
50
50
|
children: entry.reason
|
|
51
51
|
}),
|
|
52
52
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -65,7 +65,7 @@ const TwoFactorSetup = ({ offerEmailedCodes, needsPassword, onStartApp, onConfir
|
|
|
65
65
|
className: "flex flex-col gap-4",
|
|
66
66
|
children: [
|
|
67
67
|
/* @__PURE__ */ jsx("p", {
|
|
68
|
-
className: "text-
|
|
68
|
+
className: "text-muted-foreground",
|
|
69
69
|
children: "Two-factor authentication is on. Keep these backup codes somewhere safe: each one signs you in once if you lose your phone. They are not shown again."
|
|
70
70
|
}),
|
|
71
71
|
/* @__PURE__ */ jsx(BackupCodes, { codes: step.codes }),
|
|
@@ -85,7 +85,7 @@ const TwoFactorSetup = ({ offerEmailedCodes, needsPassword, onStartApp, onConfir
|
|
|
85
85
|
},
|
|
86
86
|
children: [
|
|
87
87
|
/* @__PURE__ */ jsx("p", {
|
|
88
|
-
className: "text-
|
|
88
|
+
className: "text-muted-foreground",
|
|
89
89
|
children: "Scan this code with your authenticator app, then enter the 6-digit code it shows."
|
|
90
90
|
}),
|
|
91
91
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -96,13 +96,13 @@ const TwoFactorSetup = ({ offerEmailedCodes, needsPassword, onStartApp, onConfir
|
|
|
96
96
|
}), /* @__PURE__ */ jsxs("p", {
|
|
97
97
|
className: "text-center text-xs text-muted-foreground",
|
|
98
98
|
children: ["Can't scan it? Enter this key in the app:", /* @__PURE__ */ jsx("span", {
|
|
99
|
-
className: "mt-1 block break-all font-mono text-
|
|
99
|
+
className: "mt-1 block break-all font-mono text-body text-foreground",
|
|
100
100
|
children: totpKey(step.setup.totpURI)
|
|
101
101
|
})]
|
|
102
102
|
})]
|
|
103
103
|
}),
|
|
104
104
|
/* @__PURE__ */ jsxs("label", {
|
|
105
|
-
className: "flex flex-col gap-1.5
|
|
105
|
+
className: "flex flex-col gap-1.5 font-medium",
|
|
106
106
|
children: ["Code from the app", /* @__PURE__ */ jsx(OtpInput, {
|
|
107
107
|
name: "code",
|
|
108
108
|
required: true,
|
|
@@ -147,7 +147,7 @@ const TwoFactorSetup = ({ offerEmailedCodes, needsPassword, onStartApp, onConfir
|
|
|
147
147
|
onClick: () => setChoice(option.value),
|
|
148
148
|
className: cn("rounded-md border p-3 text-left transition-colors", choice === option.value ? "border-primary bg-primary-soft" : "border-border-strong hover:bg-muted"),
|
|
149
149
|
children: [/* @__PURE__ */ jsx("span", {
|
|
150
|
-
className: "block
|
|
150
|
+
className: "block font-medium",
|
|
151
151
|
children: option.label
|
|
152
152
|
}), /* @__PURE__ */ jsx("span", {
|
|
153
153
|
className: "mt-0.5 block text-xs text-muted-foreground",
|
|
@@ -156,7 +156,7 @@ const TwoFactorSetup = ({ offerEmailedCodes, needsPassword, onStartApp, onConfir
|
|
|
156
156
|
}, option.value))
|
|
157
157
|
}),
|
|
158
158
|
needsPassword && /* @__PURE__ */ jsxs("label", {
|
|
159
|
-
className: "flex flex-col gap-1.5
|
|
159
|
+
className: "flex flex-col gap-1.5 font-medium",
|
|
160
160
|
children: ["Your password", /* @__PURE__ */ jsx(Input, {
|
|
161
161
|
type: "password",
|
|
162
162
|
name: "password",
|
|
@@ -38,7 +38,7 @@ const ActionCard = ({ title, tone = "neutral", badge, note, actions = [], onActi
|
|
|
38
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
|
-
className: "min-w-0 flex-1
|
|
41
|
+
className: "min-w-0 flex-1 font-semibold",
|
|
42
42
|
children: title
|
|
43
43
|
}), badge && /* @__PURE__ */ jsx("span", {
|
|
44
44
|
className: "shrink-0 text-xs font-medium",
|
|
@@ -29,11 +29,11 @@ const ActivityChart = ({ title = "Orders created", noun = "orders", defaultGranu
|
|
|
29
29
|
className: "flex items-baseline gap-2",
|
|
30
30
|
children: [
|
|
31
31
|
/* @__PURE__ */ jsx("h2", {
|
|
32
|
-
className: "
|
|
32
|
+
className: "font-semibold",
|
|
33
33
|
children: title
|
|
34
34
|
}),
|
|
35
35
|
/* @__PURE__ */ jsx("span", {
|
|
36
|
-
className: "
|
|
36
|
+
className: "font-semibold tabular-nums",
|
|
37
37
|
children: formatInt(totalCount(series))
|
|
38
38
|
}),
|
|
39
39
|
/* @__PURE__ */ jsxs("span", {
|
|
@@ -32,10 +32,10 @@ const ConflictDialog = ({ title, changes, busy, onReview, onDeleteAnyway, onCanc
|
|
|
32
32
|
children: "Delete anyway"
|
|
33
33
|
})] }),
|
|
34
34
|
children: changes.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
35
|
-
className: "text-
|
|
35
|
+
className: "text-muted-foreground",
|
|
36
36
|
children: "No visible fields differ; the record was saved again with the same values."
|
|
37
37
|
}) : /* @__PURE__ */ jsx("ul", {
|
|
38
|
-
className: "divide-y rounded-md border
|
|
38
|
+
className: "divide-y rounded-md border",
|
|
39
39
|
children: changes.map((change) => /* @__PURE__ */ jsxs("li", {
|
|
40
40
|
className: "grid grid-cols-[96px_1fr] gap-3 px-3 py-2",
|
|
41
41
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -91,7 +91,7 @@ const BulkDeleteDialog = (props) => {
|
|
|
91
91
|
children: "Done"
|
|
92
92
|
}),
|
|
93
93
|
children: props.failures.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
94
|
-
className: "max-h-48 divide-y overflow-y-auto rounded-md border
|
|
94
|
+
className: "max-h-48 divide-y overflow-y-auto rounded-md border",
|
|
95
95
|
children: props.failures.map((failure) => /* @__PURE__ */ jsxs("li", {
|
|
96
96
|
className: "px-3 py-2",
|
|
97
97
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -54,7 +54,7 @@ const SortMenu = ({ model, view, display, orderBy, onChange, className }) => {
|
|
|
54
54
|
"aria-label": "Sort",
|
|
55
55
|
value: `${current.columnId} ${current.direction}`,
|
|
56
56
|
onChange: (event) => onChange(event.target.value),
|
|
57
|
-
className: cn("h-8 rounded-md border border-border-strong bg-background px-2.5
|
|
57
|
+
className: cn("h-8 rounded-md border border-border-strong bg-background px-2.5 shadow-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20", className),
|
|
58
58
|
children: names.flatMap((name) => directions.map(([direction, word]) => /* @__PURE__ */ jsxs("option", {
|
|
59
59
|
value: `${name} ${direction}`,
|
|
60
60
|
children: [
|
|
@@ -9,7 +9,7 @@ const DisplayState = ({ list, empty, loading, children }) => /* @__PURE__ */ jsx
|
|
|
9
9
|
title: "Could not load rows",
|
|
10
10
|
error: list.error
|
|
11
11
|
}) : list.rows.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
12
|
-
className: "py-8 text-center text-
|
|
12
|
+
className: "py-8 text-center text-muted-foreground",
|
|
13
13
|
children: empty
|
|
14
14
|
}) : children
|
|
15
15
|
});
|
|
@@ -25,7 +25,7 @@ const ListCards = ({ model, view, display, list }) => {
|
|
|
25
25
|
error: list.error
|
|
26
26
|
});
|
|
27
27
|
if (!list.source || list.source.total === 0) return /* @__PURE__ */ jsxs("p", {
|
|
28
|
-
className: "py-8 text-center text-
|
|
28
|
+
className: "py-8 text-center text-muted-foreground",
|
|
29
29
|
children: [
|
|
30
30
|
"No ",
|
|
31
31
|
plural.toLowerCase(),
|
|
@@ -2,6 +2,7 @@ import { recordKey, recordTitleField } from "../../live/model-helpers.js";
|
|
|
2
2
|
import { humanize } from "../../live/naming.js";
|
|
3
3
|
import { displayValue } from "../../live/display-value.js";
|
|
4
4
|
import { photosKey } from "../../live/row-photos.js";
|
|
5
|
+
import { filledFields } from "../filled-fields.js";
|
|
5
6
|
import { encodeKey, tableDisplay } from "@protobase/schema/internal";
|
|
6
7
|
//#region src/app/displays/list-displays.ts
|
|
7
8
|
const displaysOf = (view) => view?.list?.displays ?? [];
|
|
@@ -47,7 +48,7 @@ const cardFields = (model, view, display) => ({
|
|
|
47
48
|
flags: display.flags ?? []
|
|
48
49
|
});
|
|
49
50
|
/** The meta fields a card shows for a row: those with a value, so a listing for rent only shows no purchase price. */
|
|
50
|
-
const filledMeta = (row, meta) =>
|
|
51
|
+
const filledMeta = (row, meta) => filledFields(row.record, meta);
|
|
51
52
|
/** The amount field a card shows for a row: the first with a value, so a listing for rent only shows its rent. */
|
|
52
53
|
const filledAmount = (row, amount) => filledMeta(row, amount)[0];
|
|
53
54
|
/** A card's amount split for drawing: the number with its prefix, such as `€1,450`, apart from its suffix, such as ` /month`. */
|
|
@@ -102,7 +102,7 @@ const MapDisplay = ({ model, view, display, filter, orderBy, fields, at, onMove,
|
|
|
102
102
|
empty && /* @__PURE__ */ jsx("div", {
|
|
103
103
|
className: "pointer-events-none absolute inset-x-3 top-3 z-10 flex justify-center",
|
|
104
104
|
children: /* @__PURE__ */ jsxs("p", {
|
|
105
|
-
className: "pointer-events-auto flex items-center gap-3 rounded-full border border-border bg-background px-4 py-1.5 text-
|
|
105
|
+
className: "pointer-events-auto flex items-center gap-3 rounded-full border border-border bg-background px-4 py-1.5 text-muted-foreground shadow",
|
|
106
106
|
role: "status",
|
|
107
107
|
children: [fitting ? `No ${plural} match.` : `No ${plural} in this part of the map.`, !fitting && /* @__PURE__ */ jsx(Button, {
|
|
108
108
|
size: "sm",
|
|
@@ -141,7 +141,7 @@ const RecordCard = ({ model, view, display, row, swipe = true, mark }) => {
|
|
|
141
141
|
resource: model.name,
|
|
142
142
|
key: row.key
|
|
143
143
|
},
|
|
144
|
-
className: "flex h-full flex-col gap-1.5 rounded-lg border border-border bg-background p-3
|
|
144
|
+
className: "flex h-full flex-col gap-1.5 rounded-lg border border-border bg-background p-3 hover:border-border-strong hover:bg-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30",
|
|
145
145
|
children: [mark && !pictured && /* @__PURE__ */ jsx(Badge, {
|
|
146
146
|
tone: "blue",
|
|
147
147
|
className: "self-start",
|
|
@@ -86,7 +86,7 @@ const EmbeddedList = ({ model, view, filter, sort, columns, limit, display, empt
|
|
|
86
86
|
display
|
|
87
87
|
}),
|
|
88
88
|
onClick: viewAll?.onOpen,
|
|
89
|
-
className: "flex items-center gap-1 self-end
|
|
89
|
+
className: "flex items-center gap-1 self-end font-medium text-primary-text hover:underline",
|
|
90
90
|
children: [viewAll ? viewAll.label : /* @__PURE__ */ jsxs(Fragment$1, { children: ["View all ", /* @__PURE__ */ jsx("span", {
|
|
91
91
|
className: "sr-only",
|
|
92
92
|
children: plural.toLowerCase()
|
|
@@ -102,7 +102,7 @@ const EmbeddedList = ({ model, view, filter, sort, columns, limit, display, empt
|
|
|
102
102
|
});
|
|
103
103
|
if (!source || source.total === 0) {
|
|
104
104
|
const nothing = /* @__PURE__ */ jsx("p", {
|
|
105
|
-
className: "text-
|
|
105
|
+
className: "text-muted-foreground",
|
|
106
106
|
children: empty ?? "Nothing here yet."
|
|
107
107
|
});
|
|
108
108
|
return viewAll && link ? /* @__PURE__ */ jsxs("div", {
|
package/dist/app/error-banner.js
CHANGED
|
@@ -12,7 +12,7 @@ const describe = (error) => {
|
|
|
12
12
|
};
|
|
13
13
|
const ErrorBanner = ({ error, title }) => /* @__PURE__ */ jsxs("div", {
|
|
14
14
|
role: "alert",
|
|
15
|
-
className: "flex gap-2.5 rounded-lg border border-danger/30 bg-danger-soft px-3 py-2 text-
|
|
15
|
+
className: "flex gap-2.5 rounded-lg border border-danger/30 bg-danger-soft px-3 py-2 text-danger-text",
|
|
16
16
|
children: [/* @__PURE__ */ jsx(TriangleAlert, { className: "mt-0.5 size-4 shrink-0" }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
17
17
|
className: "font-medium",
|
|
18
18
|
children: title
|
package/dist/app/field-editor.js
CHANGED
|
@@ -50,7 +50,7 @@ const BuiltInEditor = ({ field, hints, value, stored, relationLabel, relationTo,
|
|
|
50
50
|
})
|
|
51
51
|
});
|
|
52
52
|
if (field.type === "boolean" && locked) return /* @__PURE__ */ jsx("div", {
|
|
53
|
-
className: "py-1.5 text-
|
|
53
|
+
className: "py-1.5 text-muted-foreground",
|
|
54
54
|
children: displayValue(field, stored, hints)
|
|
55
55
|
});
|
|
56
56
|
if (field.type === "boolean") return /* @__PURE__ */ jsx(Switch, {
|
|
@@ -61,7 +61,7 @@ const BuiltInEditor = ({ field, hints, value, stored, relationLabel, relationTo,
|
|
|
61
61
|
if (field.type === "relation") {
|
|
62
62
|
const label = relationLabel ?? String(stored ?? "—");
|
|
63
63
|
return /* @__PURE__ */ jsx("div", {
|
|
64
|
-
className: "py-1.5
|
|
64
|
+
className: "py-1.5",
|
|
65
65
|
children: relationTo ? /* @__PURE__ */ jsx(AppLink, {
|
|
66
66
|
to: relationTo,
|
|
67
67
|
className: "font-medium text-primary-text hover:underline",
|
|
@@ -71,13 +71,13 @@ const BuiltInEditor = ({ field, hints, value, stored, relationLabel, relationTo,
|
|
|
71
71
|
}
|
|
72
72
|
const multiline = Boolean(hints?.multiline) && field.type === "text";
|
|
73
73
|
if (!isEditable(field) || locked) return /* @__PURE__ */ jsx("div", {
|
|
74
|
-
className: cn("py-1.5
|
|
74
|
+
className: cn("py-1.5 tabular-nums", field.type === "decimal" || field.type === "integer" ? "font-medium" : "text-muted-foreground", multiline && "whitespace-pre-line break-words"),
|
|
75
75
|
children: displayValue(field, stored, hints)
|
|
76
76
|
});
|
|
77
77
|
if (field.type === "enum") return /* @__PURE__ */ jsxs("select", {
|
|
78
78
|
value: String(value),
|
|
79
79
|
onChange: (event) => onChange(event.target.value),
|
|
80
|
-
className: "h-8 w-full rounded-md border border-border-strong bg-background px-2
|
|
80
|
+
className: "h-8 w-full rounded-md border border-border-strong bg-background px-2 shadow-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
81
81
|
children: [value === "" && /* @__PURE__ */ jsx("option", {
|
|
82
82
|
value: "",
|
|
83
83
|
children: "Choose..."
|
|
@@ -94,14 +94,8 @@ const BuiltInEditor = ({ field, hints, value, stored, relationLabel, relationTo,
|
|
|
94
94
|
});
|
|
95
95
|
return /* @__PURE__ */ jsx(Input, {
|
|
96
96
|
invalid,
|
|
97
|
-
leading: hints?.prefix ? /* @__PURE__ */ jsx("span", {
|
|
98
|
-
|
|
99
|
-
children: hints.prefix
|
|
100
|
-
}) : void 0,
|
|
101
|
-
trailing: hints?.suffix ? /* @__PURE__ */ jsx("span", {
|
|
102
|
-
className: "text-[13px]",
|
|
103
|
-
children: hints.suffix.trim()
|
|
104
|
-
}) : void 0,
|
|
97
|
+
leading: hints?.prefix ? /* @__PURE__ */ jsx("span", { children: hints.prefix }) : void 0,
|
|
98
|
+
trailing: hints?.suffix ? /* @__PURE__ */ jsx("span", { children: hints.suffix.trim() }) : void 0,
|
|
105
99
|
placeholder,
|
|
106
100
|
className: cn(numeric.has(field.type) && "text-right tabular-nums"),
|
|
107
101
|
value: String(value),
|
package/dist/app/file-field.js
CHANGED
|
@@ -27,11 +27,11 @@ const Thumbnail = ({ value }) => {
|
|
|
27
27
|
const FileSummary = ({ value }) => {
|
|
28
28
|
const shown = fileShown(value);
|
|
29
29
|
if (!shown) return /* @__PURE__ */ jsx("div", {
|
|
30
|
-
className: "py-1.5 text-
|
|
30
|
+
className: "py-1.5 text-muted-foreground",
|
|
31
31
|
children: "—"
|
|
32
32
|
});
|
|
33
33
|
if ("missing" in shown) return /* @__PURE__ */ jsx("div", {
|
|
34
|
-
className: "py-1.5 text-
|
|
34
|
+
className: "py-1.5 text-danger-text",
|
|
35
35
|
children: "The file is missing from storage"
|
|
36
36
|
});
|
|
37
37
|
const url = "url" in shown ? shown.url : void 0;
|
|
@@ -39,7 +39,7 @@ const FileSummary = ({ value }) => {
|
|
|
39
39
|
return /* @__PURE__ */ jsxs("div", {
|
|
40
40
|
className: "flex min-w-0 items-center gap-3 py-1",
|
|
41
41
|
children: [/* @__PURE__ */ jsx(Thumbnail, { value }), /* @__PURE__ */ jsxs("div", {
|
|
42
|
-
className: "min-w-0
|
|
42
|
+
className: "min-w-0",
|
|
43
43
|
children: [url && !url.startsWith("blob:") ? /* @__PURE__ */ jsx("a", {
|
|
44
44
|
href: url,
|
|
45
45
|
target: "_blank",
|
|
@@ -158,7 +158,7 @@ const FileField = ({ field, hints, resource, value, locked, invalid, onChange })
|
|
|
158
158
|
},
|
|
159
159
|
onDragLeave: () => setDragging(false),
|
|
160
160
|
onDrop: drop,
|
|
161
|
-
className: cn("flex items-center gap-3 rounded-md border border-dashed px-3 py-2.5 text-
|
|
161
|
+
className: cn("flex items-center gap-3 rounded-md border border-dashed px-3 py-2.5 text-muted-foreground", dragging ? "border-primary bg-primary/5" : invalid ? "border-danger" : "border-border-strong"),
|
|
162
162
|
children: [
|
|
163
163
|
/* @__PURE__ */ jsx(Upload, { className: "size-4 shrink-0" }),
|
|
164
164
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
//#region src/app/filled-fields.ts
|
|
2
|
+
/** The fields of `names` with a value in `record`: an empty one, null or an empty text, is left out, never shown as `—`. */
|
|
3
|
+
const filledFields = (record, names) => names.filter((name) => record[name] !== null && record[name] !== void 0 && record[name] !== "");
|
|
4
|
+
//#endregion
|
|
5
|
+
export { filledFields };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { guarded } from "../../lib/guarded.js";
|
|
2
|
+
//#region src/app/gallery/details-open-storage.ts
|
|
3
|
+
/** Where this browser remembers whether the lightbox opens with a photo's details shown. */
|
|
4
|
+
const detailsOpenStorageKey = "protobase:lightbox-details";
|
|
5
|
+
/** Whether the lightbox's details were left open in this browser; closed until someone opens them. */
|
|
6
|
+
const readDetailsOpen = (storage) => guarded(() => storage.getItem(detailsOpenStorageKey) === "true", false);
|
|
7
|
+
/** Remembers only open details, so the default (closed) costs no storage. */
|
|
8
|
+
const writeDetailsOpen = (storage, open) => guarded(() => open ? storage.setItem(detailsOpenStorageKey, "true") : storage.removeItem(detailsOpenStorageKey), void 0);
|
|
9
|
+
//#endregion
|
|
10
|
+
export { detailsOpenStorageKey, readDetailsOpen, writeDetailsOpen };
|
|
@@ -15,5 +15,7 @@ const swipeStep = (dx, dy) => Math.abs(dx) < 40 || Math.abs(dx) <= Math.abs(dy)
|
|
|
15
15
|
const keyStep = (key) => key === "ArrowRight" ? 1 : key === "ArrowLeft" ? -1 : 0;
|
|
16
16
|
/** The photo a step from `index` lands on among `count`: it stops at the first and the last rather than wrapping around. */
|
|
17
17
|
const steppedPhoto = (index, by, count) => Math.min(Math.max(index + by, 0), Math.max(count - 1, 0));
|
|
18
|
+
/** Whether a key press toggles a photo's details: `i` alone, without Ctrl, Cmd or Alt, which belong to the browser. */
|
|
19
|
+
const togglesDetails = (event) => event.key === "i" && !event.ctrlKey && !event.metaKey && !event.altKey;
|
|
18
20
|
//#endregion
|
|
19
|
-
export { galleryTiles, keyStep, steppedPhoto, swipeStep };
|
|
21
|
+
export { galleryTiles, keyStep, steppedPhoto, swipeStep, togglesDetails };
|