@protobase/ui 0.14.4 → 0.14.5

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 (55) hide show
  1. package/dist/activity-chart/activity-chart.js +1 -1
  2. package/dist/app/app.d.ts +2 -1
  3. package/dist/app/app.js +10 -3
  4. package/dist/app/displays/display-controls.js +1 -1
  5. package/dist/app/embedded-list/embedded-list.js +35 -27
  6. package/dist/app/index.html +10 -0
  7. package/dist/app/list-page.js +20 -3
  8. package/dist/app/menu-icons.js +2 -1
  9. package/dist/app/named-icon.js +3 -2
  10. package/dist/app/pages/blocks/field.js +2 -2
  11. package/dist/app/pages/blocks/progress.js +1 -1
  12. package/dist/app/pages/blocks/show.js +1 -1
  13. package/dist/app/pages/blocks/stat.js +2 -2
  14. package/dist/app/pages/blocks/table.js +1 -1
  15. package/dist/app/searches/save-search-button.js +44 -0
  16. package/dist/app/searches/saved-search-section.js +97 -0
  17. package/dist/app/searches/saved-search.js +94 -0
  18. package/dist/app/searches/saved-searches.js +107 -0
  19. package/dist/app/searches/search-controls.js +64 -0
  20. package/dist/app/searches/use-filter-chips.js +27 -0
  21. package/dist/app/searches/use-save-search.js +70 -0
  22. package/dist/app/searches/use-saved-searches.js +37 -0
  23. package/dist/app-shell/app-shell.js +3 -2
  24. package/dist/app-shell/drawer.js +1 -1
  25. package/dist/app-shell/logo.js +2 -2
  26. package/dist/app-shell/profile-menu.js +10 -2
  27. package/dist/app-shell/sidebar.js +3 -2
  28. package/dist/app-shell/theme-switch.js +41 -0
  29. package/dist/auth/auth-gate.js +0 -9
  30. package/dist/data-grid/data-grid.js +1 -1
  31. package/dist/live/use-filter-config.js +2 -6
  32. package/dist/live/view-fields.js +8 -1
  33. package/dist/package.js +1 -1
  34. package/dist/primitives/dialog.js +1 -1
  35. package/dist/primitives/responsive-dialog.d.ts +1 -2
  36. package/dist/primitives/responsive-dialog.js +11 -13
  37. package/dist/primitives/segmented.js +6 -2
  38. package/dist/primitives/sheet.js +39 -39
  39. package/dist/shell/assets/app-DxpTYgsV.js +66 -0
  40. package/dist/shell/assets/index-B0V1UXFn.css +2 -0
  41. package/dist/shell/assets/{index-DhgTXlZ3.js → index-C_ilu7LX.js} +1 -1
  42. package/dist/shell/assets/{maplibre-gl-CKQN3M1I.js → maplibre-gl-DPsuz0sk.js} +1 -1
  43. package/dist/shell/assets/{record-map-CzJ60-ux.js → record-map-grRO6rSC.js} +2 -2
  44. package/dist/shell/assets/{records-map-dch_o1ug.js → records-map-DjUTonTE.js} +1 -1
  45. package/dist/shell/assets/{shared-protobase-ui-C-qDEeIK.js → shared-protobase-ui-BkgB1XZX.js} +1 -1
  46. package/dist/shell/index.html +14 -4
  47. package/dist/shell/protobase.shell.json +1 -1
  48. package/dist/styles.css +5 -2
  49. package/dist/theme/theme-preference.js +23 -0
  50. package/dist/theme/theme-provider.js +43 -0
  51. package/dist/theme.css +4 -0
  52. package/dist/tokens.css +2 -0
  53. package/package.json +4 -5
  54. package/dist/shell/assets/app-CyW0VzOi.js +0 -66
  55. package/dist/shell/assets/index-DthLyPYI.css +0 -2
@@ -1,44 +1,44 @@
1
+ import { useFocusTrap } from "../lib/use-focus-trap.js";
2
+ import { useRef } from "react";
1
3
  import { X } from "lucide-react";
2
4
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { Drawer } from "@base-ui/react/drawer";
4
5
  //#region src/primitives/sheet.tsx
5
- const motion = "transition-[transform,opacity] duration-[400ms] ease-[cubic-bezier(0.32,0.72,0,1)] data-swiping:duration-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] motion-reduce:duration-0";
6
- /**
7
- * A panel that rises from the bottom of the screen, for the filter panel and `ResponsiveDialog` on phones. It closes
8
- * when swiped down, on its close button, on a press outside and on Escape, and keeps focus inside while open (Base UI's
9
- * `Drawer`).
10
- */
11
- const Sheet = ({ title, open, onClose, children }) => /* @__PURE__ */ jsx(Drawer.Root, {
12
- open,
13
- onOpenChange: (next) => !next && onClose(),
14
- children: /* @__PURE__ */ jsxs(Drawer.Portal, { children: [/* @__PURE__ */ jsx(Drawer.Backdrop, { className: `fixed inset-0 z-[80] bg-foreground/40 opacity-[calc(1-var(--drawer-swipe-progress))] data-starting-style:opacity-0 data-ending-style:opacity-0 ${motion}` }), /* @__PURE__ */ jsx(Drawer.Viewport, {
15
- className: "fixed inset-0 z-[80] flex items-end",
16
- children: /* @__PURE__ */ jsxs(Drawer.Popup, {
17
- className: `flex max-h-[85vh] w-full flex-col rounded-t-xl border-t bg-background shadow-pop outline-none [transform:translateY(var(--drawer-swipe-movement-y))] data-starting-style:[transform:translateY(100%)] data-ending-style:[transform:translateY(100%)] data-swiping:select-none ${motion}`,
18
- children: [
19
- /* @__PURE__ */ jsx("div", {
20
- className: "flex shrink-0 justify-center pt-2",
21
- "aria-hidden": true,
22
- children: /* @__PURE__ */ jsx("div", { className: "h-1 w-10 rounded-full bg-border-strong" })
23
- }),
24
- /* @__PURE__ */ jsxs("header", {
25
- className: "flex shrink-0 items-center justify-between border-b px-4",
26
- children: [/* @__PURE__ */ jsx(Drawer.Title, {
27
- className: "text-[15px] font-semibold",
28
- children: title
29
- }), /* @__PURE__ */ jsx(Drawer.Close, {
30
- "aria-label": "Close",
31
- className: "-mr-2 inline-flex size-11 items-center justify-center rounded-md text-muted-foreground hover:bg-muted",
32
- children: /* @__PURE__ */ jsx(X, { className: "size-5" })
33
- })]
34
- }),
35
- /* @__PURE__ */ jsx(Drawer.Content, {
36
- className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pb-6",
37
- children
38
- })
39
- ]
40
- })
41
- })] })
42
- });
6
+ /** A panel that rises from the bottom of the screen, for the filter panel on phones. */
7
+ const Sheet = ({ title, open, onClose, children }) => {
8
+ const panel = useRef(null);
9
+ useFocusTrap(panel, open, onClose);
10
+ if (!open) return null;
11
+ return /* @__PURE__ */ jsxs("div", {
12
+ className: "fixed inset-0 z-[80]",
13
+ children: [/* @__PURE__ */ jsx("div", {
14
+ className: "absolute inset-0 bg-backdrop/40",
15
+ onClick: onClose,
16
+ "aria-hidden": true
17
+ }), /* @__PURE__ */ jsxs("div", {
18
+ ref: panel,
19
+ role: "dialog",
20
+ "aria-modal": "true",
21
+ "aria-label": title,
22
+ tabIndex: -1,
23
+ 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
+ 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
+ })]
36
+ }), /* @__PURE__ */ jsx("div", {
37
+ className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pb-6",
38
+ children
39
+ })]
40
+ })]
41
+ });
42
+ };
43
43
  //#endregion
44
44
  export { Sheet };