@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.
Files changed (159) hide show
  1. package/dist/account/account-section.js +2 -2
  2. package/dist/account/account-security-page.js +2 -2
  3. package/dist/account/backup-codes.js +3 -10
  4. package/dist/account/passkeys-section.js +2 -2
  5. package/dist/account/password-dialog.js +1 -1
  6. package/dist/account/sign-in-policy-form.js +2 -2
  7. package/dist/account/sign-in-policy-page.js +2 -2
  8. package/dist/account/sign-in-providers-section.js +1 -1
  9. package/dist/account/staff-sign-in-log.js +3 -3
  10. package/dist/account/two-factor-setup.js +6 -6
  11. package/dist/action-card/action-card.js +1 -1
  12. package/dist/activity-chart/activity-chart.js +2 -2
  13. package/dist/app/delete/dialogs.js +3 -3
  14. package/dist/app/displays/display-controls.js +1 -1
  15. package/dist/app/displays/display-frame.js +1 -1
  16. package/dist/app/displays/list-cards.js +1 -1
  17. package/dist/app/displays/list-displays.js +2 -1
  18. package/dist/app/displays/map-display.js +1 -1
  19. package/dist/app/displays/record-card.js +1 -1
  20. package/dist/app/embedded-list/embedded-list.js +2 -2
  21. package/dist/app/error-banner.js +1 -1
  22. package/dist/app/field-editor.js +6 -12
  23. package/dist/app/file-field.js +4 -4
  24. package/dist/app/filled-fields.js +5 -0
  25. package/dist/app/gallery/details-open-storage.js +10 -0
  26. package/dist/app/gallery/gallery-layout.js +3 -1
  27. package/dist/app/gallery/lightbox.js +107 -61
  28. package/dist/app/gallery/photo-details.js +1 -1
  29. package/dist/app/import/convert.js +151 -0
  30. package/dist/app/import/csv-parser.js +119 -0
  31. package/dist/app/import/failed-rows.js +21 -0
  32. package/dist/app/import/import-button.js +31 -0
  33. package/dist/app/import/import-check-step.js +123 -0
  34. package/dist/app/import/import-counts.js +19 -0
  35. package/dist/app/import/import-dialog.js +152 -0
  36. package/dist/app/import/import-file-step.js +65 -0
  37. package/dist/app/import/import-mapping-step.js +195 -0
  38. package/dist/app/import/import-result-step.js +86 -0
  39. package/dist/app/import/import-select.js +35 -0
  40. package/dist/app/import/locale-formats.js +15 -0
  41. package/dist/app/import/lookups.js +48 -0
  42. package/dist/app/import/mapping.js +78 -0
  43. package/dist/app/import/parse-worker.d.ts +1 -0
  44. package/dist/app/import/parse-worker.js +39 -0
  45. package/dist/app/import/prepare-rows.js +129 -0
  46. package/dist/app/import/run-import.js +130 -0
  47. package/dist/app/import/sheet-cell.js +17 -0
  48. package/dist/app/import/sheet-file.js +58 -0
  49. package/dist/app/import/sheet-source.js +72 -0
  50. package/dist/app/import/use-import-flow.js +225 -0
  51. package/dist/app/import/xlsx-reader.js +43 -0
  52. package/dist/app/import/xlsx-xml.js +169 -0
  53. package/dist/app/import/zip-reader.js +72 -0
  54. package/dist/app/list-page.js +8 -1
  55. package/dist/app/meta-gate.js +3 -3
  56. package/dist/app/named-icon.js +9 -1
  57. package/dist/app/pages/blocks/card-frame.js +4 -4
  58. package/dist/app/pages/blocks/field.js +2 -5
  59. package/dist/app/pages/blocks/stat.js +2 -2
  60. package/dist/app/pages/problem.js +1 -1
  61. package/dist/app/pages/render-node.js +1 -1
  62. package/dist/app/record-page.js +13 -4
  63. package/dist/app/record-row/record-row-body.js +3 -3
  64. package/dist/app/record-row/saved-record-row.js +1 -1
  65. package/dist/app/related-section.js +1 -1
  66. package/dist/app/relation-picker.js +1 -1
  67. package/dist/app/runtime/runtime-update.js +3 -3
  68. package/dist/app/saved/saved-list.js +1 -1
  69. package/dist/app/searches/saved-search-rows.js +2 -2
  70. package/dist/app/searches/saved-search-section.js +1 -1
  71. package/dist/app/searches/saved-searches.js +1 -1
  72. package/dist/app/searches/search-controls.js +2 -2
  73. package/dist/app/searches/search-name-dialog.js +1 -1
  74. package/dist/app/searches/update-search-dialog.js +16 -19
  75. package/dist/app/sensitive-field.js +1 -1
  76. package/dist/app/source-notice.js +3 -3
  77. package/dist/app/staff-banner.js +1 -1
  78. package/dist/app-shell/breadcrumb.js +1 -1
  79. package/dist/app-shell/global-search.js +1 -1
  80. package/dist/app-shell/page-header.js +1 -1
  81. package/dist/app-shell/profile-menu.js +3 -3
  82. package/dist/app-shell/sidebar-group.js +1 -1
  83. package/dist/app-shell/sidebar-item.js +1 -1
  84. package/dist/app-shell/sidebar.js +2 -2
  85. package/dist/assistant-dock/part-view.js +1 -4
  86. package/dist/assistant-dock/widget-view.js +1 -4
  87. package/dist/auth/auth-gate.js +2 -2
  88. package/dist/auth/auth-layout.js +1 -1
  89. package/dist/auth/code-form.js +2 -2
  90. package/dist/auth/first-run-page.js +1 -1
  91. package/dist/auth/forgot-password-form.js +2 -2
  92. package/dist/auth/provider-sign-in-page.js +1 -1
  93. package/dist/auth/reset-password-form.js +3 -3
  94. package/dist/auth/setup-required-form.js +2 -2
  95. package/dist/auth/setup-required-page.js +1 -1
  96. package/dist/auth/sign-in-form.js +5 -5
  97. package/dist/auth/sign-in-prompt.js +3 -3
  98. package/dist/auth/sign-up-details-form.js +3 -3
  99. package/dist/auth/sign-up-email-form.js +4 -4
  100. package/dist/auth/staff-sign-in-form.js +3 -3
  101. package/dist/auth/two-factor-form.js +5 -5
  102. package/dist/chat/chat-message.js +1 -1
  103. package/dist/chat/chat-thread.js +1 -1
  104. package/dist/data/api-provider.js +8 -2
  105. package/dist/data-grid/grid-row.js +1 -1
  106. package/dist/data-grid/header-menu.js +1 -1
  107. package/dist/data-grid/row-menu.js +1 -1
  108. package/dist/filter-panel/facet-combobox.js +1 -1
  109. package/dist/filter-panel/filter-menu.js +1 -1
  110. package/dist/filter-panel/filter-panel.js +2 -2
  111. package/dist/inline-child-table/line-menu.js +1 -1
  112. package/dist/inline-child-table/line-row.js +4 -4
  113. package/dist/inline-child-table/number-cell.js +1 -1
  114. package/dist/inline-child-table/totals-footer.js +2 -2
  115. package/dist/lib/save-file.js +12 -0
  116. package/dist/lib/use-focus-trap.js +7 -1
  117. package/dist/organizations/app-roles-picker.js +1 -1
  118. package/dist/organizations/invitation-page.js +3 -3
  119. package/dist/organizations/invitations-page.js +2 -2
  120. package/dist/organizations/members-page.js +2 -2
  121. package/dist/organizations/organization-page.js +1 -1
  122. package/dist/organizations/organizations-page.js +2 -2
  123. package/dist/package.js +1 -1
  124. package/dist/plugins/before-sign-in.js +1 -1
  125. package/dist/plugins/plugin-gate.js +1 -1
  126. package/dist/plugins/plugin-notice.js +1 -1
  127. package/dist/primitives/button.js +1 -1
  128. package/dist/primitives/dialog.js +2 -2
  129. package/dist/primitives/input.js +1 -1
  130. package/dist/primitives/menu-select.js +2 -2
  131. package/dist/primitives/responsive-dialog.js +1 -1
  132. package/dist/primitives/segmented.js +1 -1
  133. package/dist/primitives/sheet-swipe.js +5 -0
  134. package/dist/primitives/sheet.js +40 -12
  135. package/dist/primitives/textarea.js +1 -1
  136. package/dist/record-view/action-rail.js +1 -1
  137. package/dist/record-view/field.js +1 -1
  138. package/dist/record-view/key-facts.js +29 -0
  139. package/dist/record-view/record-sidebar.js +2 -2
  140. package/dist/record-view/section.js +2 -2
  141. package/dist/record-view/spec-table.js +1 -1
  142. package/dist/shell/assets/app-DwKzLvfm.js +67 -0
  143. package/dist/shell/assets/index-CwhnZIJp.css +2 -0
  144. package/dist/shell/assets/{index-CEvfMgFJ.js → index-Dqgcyg7M.js} +1 -1
  145. package/dist/shell/assets/{maplibre-D6zfLfTV.js → maplibre-BWjNhvrH.js} +1 -1
  146. package/dist/shell/assets/parse-worker-BtcY0dQw.js +5 -0
  147. package/dist/shell/assets/{record-map-B6_rbCcG.js → record-map-m5K2uttt.js} +1 -1
  148. package/dist/shell/assets/{records-map-bQbuIc13.js → records-map-CA_JG9RR.js} +1 -1
  149. package/dist/shell/assets/{shared-protobase-ui-8pJgwjfc.js → shared-protobase-ui-BBqKlVLh.js} +1 -1
  150. package/dist/shell/index.html +4 -4
  151. package/dist/shell/protobase.shell.json +1 -1
  152. package/dist/side-panel/side-panel.js +1 -1
  153. package/dist/step-list/step-list.js +1 -1
  154. package/dist/styles.css +1 -1
  155. package/dist/theme.css +2 -0
  156. package/dist/toasts/toast.js +2 -2
  157. package/package.json +4 -4
  158. package/dist/shell/assets/app-BYFiTXK6.js +0 -66
  159. package/dist/shell/assets/index-CiGP6kle.css +0 -2
@@ -46,7 +46,7 @@ const MenuSelect = ({ value, options, onChange, label }) => {
46
46
  "aria-haspopup": "menu",
47
47
  "aria-expanded": open,
48
48
  onClick: () => setOpen(!open),
49
- className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-border-strong bg-background px-2.5 text-[13px] font-medium shadow-sm transition-colors hover:bg-muted pointer-coarse:h-11",
49
+ className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-border-strong bg-background px-2.5 text-body font-medium shadow-sm transition-colors hover:bg-muted pointer-coarse:h-11",
50
50
  children: [
51
51
  current?.icon && /* @__PURE__ */ jsx(current.icon, { className: "size-3.5" }),
52
52
  current?.label ?? label,
@@ -56,7 +56,7 @@ const MenuSelect = ({ value, options, onChange, label }) => {
56
56
  role: "menu",
57
57
  "aria-label": label,
58
58
  onKeyDown,
59
- className: "absolute right-0 top-full z-30 mt-1 min-w-40 rounded-md border bg-background py-1 text-[13px] shadow-pop",
59
+ className: "absolute right-0 top-full z-30 mt-1 min-w-40 rounded-md border bg-background py-1 text-body shadow-pop",
60
60
  children: options.map((option, index) => /* @__PURE__ */ jsx("li", {
61
61
  role: "none",
62
62
  children: /* @__PURE__ */ jsxs("button", {
@@ -23,7 +23,7 @@ const ResponsiveDialog = ({ title, description, open, onClose, actions, children
23
23
  open: true,
24
24
  onClose,
25
25
  children: /* @__PURE__ */ jsxs("div", {
26
- className: "pt-3 text-[13px]",
26
+ className: "pt-3",
27
27
  children: [
28
28
  description && /* @__PURE__ */ jsx("p", {
29
29
  className: "text-muted-foreground",
@@ -8,7 +8,7 @@ const sizes = {
8
8
  },
9
9
  md: {
10
10
  group: "h-8",
11
- option: "px-3 text-[13px]"
11
+ option: "px-3 text-body"
12
12
  }
13
13
  };
14
14
  const Segmented = ({ value, options, onChange, label, size = "sm", iconOnly = false }) => /* @__PURE__ */ jsx("span", {
@@ -0,0 +1,5 @@
1
+ //#region src/primitives/sheet-swipe.ts
2
+ /** Whether a drag closes a sheet: mostly downwards, by 60 pixels or more. */
3
+ const closesSheet = (dx, dy) => dy >= 60 && dy > Math.abs(dx);
4
+ //#endregion
5
+ export { closesSheet };
@@ -1,13 +1,31 @@
1
1
  import { useFocusTrap } from "../lib/use-focus-trap.js";
2
+ import { closesSheet } from "./sheet-swipe.js";
2
3
  import { useRef } from "react";
3
4
  import { X } from "lucide-react";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  //#region src/primitives/sheet.tsx
6
- /** A panel that rises from the bottom of the screen, for the filter panel on phones. */
7
+ /**
8
+ * A panel that rises from the bottom of the screen, for the filter panel on mobile screens. It closes on Escape, the
9
+ * close button, a press above it and a swipe down on its header. Its content scrolls inside it when taller than the
10
+ * panel, which stops short of the top so the screen behind stays in sight.
11
+ */
7
12
  const Sheet = ({ title, open, onClose, children }) => {
8
13
  const panel = useRef(null);
14
+ const start = useRef(void 0);
9
15
  useFocusTrap(panel, open, onClose);
10
16
  if (!open) return null;
17
+ const down = (event) => {
18
+ if (event.pointerType === "touch") start.current = {
19
+ x: event.clientX,
20
+ y: event.clientY
21
+ };
22
+ };
23
+ const up = (event) => {
24
+ if (!start.current) return;
25
+ const closes = closesSheet(event.clientX - start.current.x, event.clientY - start.current.y);
26
+ start.current = void 0;
27
+ if (closes) onClose();
28
+ };
11
29
  return /* @__PURE__ */ jsxs("div", {
12
30
  className: "fixed inset-0 z-[80]",
13
31
  children: [/* @__PURE__ */ jsx("div", {
@@ -22,17 +40,27 @@ const Sheet = ({ title, open, onClose, children }) => {
22
40
  tabIndex: -1,
23
41
  className: "absolute inset-x-0 bottom-0 flex max-h-[85vh] flex-col rounded-t-xl border-t bg-background shadow-pop outline-none",
24
42
  children: [/* @__PURE__ */ jsxs("header", {
25
- className: "flex shrink-0 items-center justify-between border-b px-4",
26
- children: [/* @__PURE__ */ jsx("h2", {
27
- className: "text-[15px] font-semibold",
28
- children: title
29
- }), /* @__PURE__ */ jsx("button", {
30
- type: "button",
31
- "aria-label": "Close",
32
- onClick: onClose,
33
- className: "-mr-2 inline-flex size-11 items-center justify-center rounded-md text-muted-foreground hover:bg-muted",
34
- children: /* @__PURE__ */ jsx(X, { className: "size-5" })
35
- })]
43
+ className: "relative flex shrink-0 touch-none items-center justify-between border-b px-4",
44
+ onPointerDown: down,
45
+ onPointerUp: up,
46
+ onPointerCancel: () => start.current = void 0,
47
+ children: [
48
+ /* @__PURE__ */ jsx("span", {
49
+ className: "absolute left-1/2 top-1.5 h-1 w-9 -translate-x-1/2 rounded-full bg-border-strong",
50
+ "aria-hidden": true
51
+ }),
52
+ /* @__PURE__ */ jsx("h2", {
53
+ className: "text-[16px] font-semibold",
54
+ children: title
55
+ }),
56
+ /* @__PURE__ */ jsx("button", {
57
+ type: "button",
58
+ "aria-label": "Close",
59
+ onClick: onClose,
60
+ className: "-mr-2 inline-flex size-11 items-center justify-center rounded-md text-muted-foreground hover:bg-muted",
61
+ children: /* @__PURE__ */ jsx(X, { className: "size-5" })
62
+ })
63
+ ]
36
64
  }), /* @__PURE__ */ jsx("div", {
37
65
  className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pb-6",
38
66
  children
@@ -28,7 +28,7 @@ const Textarea = ({ invalid, className, rows = 3, value, ...rest }) => {
28
28
  ref,
29
29
  rows,
30
30
  value,
31
- className: cn("block w-full resize-none overflow-hidden rounded-md border bg-background px-2.5 py-1.5 text-[13px] text-foreground shadow-sm outline-none placeholder:text-faint-foreground focus:border-primary focus:ring-2 focus:ring-primary/20", invalid ? "border-danger" : "border-border-strong", className),
31
+ className: cn("block w-full resize-none overflow-hidden rounded-md border bg-background px-2.5 py-1.5 text-body text-foreground shadow-sm outline-none placeholder:text-faint-foreground focus:border-primary focus:ring-2 focus:ring-primary/20", invalid ? "border-danger" : "border-border-strong", className),
32
32
  ...rest
33
33
  });
34
34
  };
@@ -15,7 +15,7 @@ const ActionRail = ({ actions }) => /* @__PURE__ */ jsxs("div", {
15
15
  className: cn("size-4 shrink-0 md:mt-0.5", tone === "danger" ? "text-danger-text" : "text-muted-foreground"),
16
16
  "aria-hidden": true
17
17
  }), /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", {
18
- className: cn("block text-[13px] font-medium", tone === "danger" ? "text-danger-text" : "text-foreground"),
18
+ className: cn("block 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",
@@ -9,7 +9,7 @@ const Field = ({ label, required, help, example, error, conflict, wide, children
9
9
  /* @__PURE__ */ jsxs("div", {
10
10
  className: "mb-1.5 flex items-center gap-2",
11
11
  children: [/* @__PURE__ */ jsxs("label", {
12
- className: "text-[13px] font-medium text-foreground",
12
+ className: "font-medium text-foreground",
13
13
  children: [label, required && /* @__PURE__ */ jsx("span", {
14
14
  className: "ml-0.5 text-danger-text",
15
15
  "aria-label": "required",
@@ -0,0 +1,29 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ //#region src/record-view/key-facts.tsx
3
+ /**
4
+ * A record's key facts side by side, as the bedrooms, area and energy label of a listing on a real estate site: each
5
+ * value under its icon, or under its label without one, wrapping onto more rows as needed, two to a row on a mobile
6
+ * screen.
7
+ */
8
+ const KeyFacts = ({ facts }) => /* @__PURE__ */ jsx("dl", {
9
+ className: "grid grid-cols-2 gap-x-4 gap-y-5 sm:flex sm:flex-wrap sm:gap-x-10",
10
+ children: facts.map(({ label, value, icon: Icon }) => /* @__PURE__ */ jsxs("div", {
11
+ title: label,
12
+ className: "flex min-w-0 flex-col gap-1.5",
13
+ children: [/* @__PURE__ */ jsx("dt", {
14
+ className: "text-muted-foreground",
15
+ children: Icon ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
16
+ className: "size-5",
17
+ "aria-hidden": true
18
+ }), /* @__PURE__ */ jsx("span", {
19
+ className: "sr-only",
20
+ children: label
21
+ })] }) : label
22
+ }), /* @__PURE__ */ jsx("dd", {
23
+ className: "min-w-0 break-words text-[16px] font-semibold text-foreground",
24
+ children: value
25
+ })]
26
+ }, label))
27
+ });
28
+ //#endregion
29
+ export { KeyFacts };
@@ -2,7 +2,7 @@ import { ChevronRight } from "lucide-react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  //#region src/record-view/record-sidebar.tsx
4
4
  const MetadataList = ({ rows }) => /* @__PURE__ */ jsx("dl", {
5
- className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-[13px]",
5
+ className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-2",
6
6
  children: rows.map((row) => /* @__PURE__ */ jsxs("div", {
7
7
  className: "contents",
8
8
  children: [/* @__PURE__ */ jsx("dt", {
@@ -31,7 +31,7 @@ const RelatedRecords = ({ records, onNavigate }) => /* @__PURE__ */ jsx("ul", {
31
31
  children: record.kind
32
32
  }),
33
33
  /* @__PURE__ */ jsx("span", {
34
- className: "block truncate text-[13px] font-medium text-primary-text",
34
+ className: "block truncate font-medium text-primary-text",
35
35
  children: record.label
36
36
  }),
37
37
  record.meta && /* @__PURE__ */ jsx("span", {
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  /** A titled part of the record page; `actions` sit at the end of the title's line. */
4
4
  const Section = ({ title, help, actions, children }) => {
5
5
  const heading = /* @__PURE__ */ jsx("h2", {
6
- className: "text-[15px] font-semibold text-foreground",
6
+ className: "text-[16px] font-semibold text-foreground",
7
7
  children: title
8
8
  });
9
9
  return /* @__PURE__ */ jsxs("section", {
@@ -14,7 +14,7 @@ const Section = ({ title, help, actions, children }) => {
14
14
  children: [heading, actions]
15
15
  }) : heading,
16
16
  help && /* @__PURE__ */ jsx("p", {
17
- className: "mt-1 max-w-xl text-[13px] leading-relaxed text-muted-foreground",
17
+ className: "mt-1 max-w-xl leading-6 text-muted-foreground",
18
18
  children: help
19
19
  }),
20
20
  /* @__PURE__ */ jsx("div", {
@@ -6,7 +6,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  * site: what a record page's section shows on its read view. A wide row puts its value under the label.
7
7
  */
8
8
  const SpecTable = ({ rows }) => /* @__PURE__ */ jsx("dl", {
9
- className: "border-t border-border text-[13px]",
9
+ className: "border-t border-border",
10
10
  children: rows.map((row) => /* @__PURE__ */ jsxs("div", {
11
11
  className: cn("grid gap-x-4 border-b border-border py-2.5", row.wide ? "grid-cols-1 gap-y-1.5" : "grid-cols-[minmax(0,2fr)_minmax(0,3fr)]"),
12
12
  children: [/* @__PURE__ */ jsxs("dt", {