@protobase/ui 0.3.5 → 0.4.1

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 (84) hide show
  1. package/dist/account/account-pages.js +20 -0
  2. package/dist/account/account-section.js +31 -0
  3. package/dist/account/account-security-page.js +59 -0
  4. package/dist/account/backup-codes.js +44 -0
  5. package/dist/account/passkeys-section.js +141 -0
  6. package/dist/account/password-dialog.js +58 -0
  7. package/dist/account/sign-in-policy-form.js +108 -0
  8. package/dist/account/sign-in-policy-labels.js +76 -0
  9. package/dist/account/sign-in-policy-page.js +72 -0
  10. package/dist/account/staff-sign-in-log.js +62 -0
  11. package/dist/account/totp-qr.js +37 -0
  12. package/dist/account/two-factor-section.js +123 -0
  13. package/dist/account/two-factor-setup.js +188 -0
  14. package/dist/activity-chart/activity-chart.js +1 -1
  15. package/dist/activity-chart/activity-tooltip.js +1 -1
  16. package/dist/app/app.js +35 -14
  17. package/dist/app/assistant-shell.js +1 -1
  18. package/dist/app/create/create-page.js +1 -1
  19. package/dist/app/delete/use-delete-flow.js +1 -1
  20. package/dist/app/error-banner.js +1 -1
  21. package/dist/app/list-page.js +1 -1
  22. package/dist/app/list-search.js +1 -1
  23. package/dist/app/meta-gate.js +1 -1
  24. package/dist/app/pages/blocks/modal-form.js +3 -3
  25. package/dist/app/pages/record-table.js +1 -1
  26. package/dist/app/record-page.js +5 -5
  27. package/dist/app/runtime/runtime-update.js +1 -1
  28. package/dist/app/sensitive-field.js +1 -1
  29. package/dist/app/staff-banner.js +67 -0
  30. package/dist/app/use-record-editor.js +1 -1
  31. package/dist/app-shell/breadcrumb.js +1 -1
  32. package/dist/app-shell/global-search.js +1 -1
  33. package/dist/app-shell/profile-menu.js +1 -1
  34. package/dist/app-shell/sidebar-group.js +1 -1
  35. package/dist/app-shell/top-bar.js +1 -1
  36. package/dist/assistant-dock/assistant-dock.js +1 -1
  37. package/dist/auth/auth-gate.js +42 -4
  38. package/dist/auth/auth-messages.js +48 -0
  39. package/dist/auth/auth-provider.js +40 -14
  40. package/dist/auth/code-input.js +17 -0
  41. package/dist/auth/email-code-form.js +81 -0
  42. package/dist/auth/email-code-page.js +40 -0
  43. package/dist/auth/first-run-page.js +1 -1
  44. package/dist/auth/forgot-password-page.js +1 -1
  45. package/dist/auth/reset-password-page.js +1 -1
  46. package/dist/auth/setup-required-form.js +43 -0
  47. package/dist/auth/setup-required-page.js +51 -0
  48. package/dist/auth/sign-in-form.js +53 -20
  49. package/dist/auth/sign-in-page.js +14 -13
  50. package/dist/auth/staff-link.js +30 -0
  51. package/dist/auth/staff-sign-in-form.js +93 -0
  52. package/dist/auth/staff-sign-in-page.js +41 -0
  53. package/dist/auth/two-factor-form.js +137 -0
  54. package/dist/auth/two-factor-page.js +39 -0
  55. package/dist/auth/user-to-shell.js +5 -2
  56. package/dist/chat/composer.js +1 -1
  57. package/dist/data/api-provider.d.ts +1 -1
  58. package/dist/data/api-provider.js +1 -1
  59. package/dist/data/use-aggregates.js +1 -1
  60. package/dist/data/use-list.js +1 -1
  61. package/dist/data/use-update-record.js +1 -1
  62. package/dist/data-grid/cells.js +3 -3
  63. package/dist/data-grid/grid-header.js +2 -2
  64. package/dist/data-grid/grid-row.js +1 -1
  65. package/dist/data-grid/header-menu.js +1 -1
  66. package/dist/data-grid/row-menu.js +1 -1
  67. package/dist/diff-view/diff-view.js +1 -1
  68. package/dist/filter-panel/active-filter-chips.js +1 -1
  69. package/dist/filter-panel/facet-group.js +1 -1
  70. package/dist/filter-panel/filter-menu.js +1 -1
  71. package/dist/inline-child-table/inline-child-table.js +1 -1
  72. package/dist/inline-child-table/line-menu.js +1 -1
  73. package/dist/inline-child-table/line-row.js +2 -2
  74. package/dist/inline-child-table/totals-footer.js +1 -1
  75. package/dist/live/use-filter-config.js +1 -1
  76. package/dist/primitives/checkbox.js +1 -1
  77. package/dist/primitives/sheet.js +1 -1
  78. package/dist/primitives/spinner.js +1 -1
  79. package/dist/record-view/field.js +1 -1
  80. package/dist/record-view/record-sidebar.js +1 -1
  81. package/dist/side-panel/side-panel.js +1 -1
  82. package/dist/step-list/step-list.js +1 -1
  83. package/dist/toasts/toast.js +1 -1
  84. package/package.json +6 -5
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../lib/cn.js";
2
2
  import { diffStats, parseDiff } from "./diff.js";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
3
  import { FileCode2 } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/diff-view/diff-view.tsx
6
6
  const row = {
7
7
  add: "bg-success-soft text-success-text",
@@ -1,5 +1,5 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
1
  import { Lock, X } from "lucide-react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  //#region src/filter-panel/active-filter-chips.tsx
4
4
  const chipClass = "inline-flex h-6 items-center gap-1 rounded-full border border-primary-border bg-primary-soft pl-2.5 pr-1.5 text-xs font-medium text-primary-text";
5
5
  const ActiveFilterChips = ({ chips, lockedLabels = [], onRemove, onClear, scroll }) => {
@@ -3,8 +3,8 @@ import { formatInt } from "../format/number.js";
3
3
  import { Checkbox } from "../primitives/checkbox.js";
4
4
  import { matchesSearch } from "./filter-state.js";
5
5
  import { useState } from "react";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
6
  import { Search } from "lucide-react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
8
  //#region src/filter-panel/facet-group.tsx
9
9
  const FacetGroup = ({ config, selected, onToggle }) => {
10
10
  const [query, setQuery] = useState("");
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../lib/cn.js";
2
2
  import { useEffect, useRef, useState } from "react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
3
  import { ChevronDown } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/filter-panel/filter-menu.tsx
6
6
  const FilterMenu = ({ label, activeCount, width = 240, defaultOpen = false, children }) => {
7
7
  const [open, setOpen] = useState(defaultOpen);
@@ -4,8 +4,8 @@ import { lineGrid } from "./columns.js";
4
4
  import { LineRow } from "./line-row.js";
5
5
  import { reorder } from "./reorder.js";
6
6
  import { TotalsFooter } from "./totals-footer.js";
7
- import { jsx, jsxs } from "react/jsx-runtime";
8
7
  import { Plus } from "lucide-react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { DndContext, KeyboardSensor, MouseSensor, TouchSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
10
10
  import { SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy } from "@dnd-kit/sortable";
11
11
  //#region src/inline-child-table/inline-child-table.tsx
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../lib/cn.js";
2
2
  import { useEffect, useRef, useState } from "react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
3
  import { MoreHorizontal } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/inline-child-table/line-menu.tsx
6
6
  /** The "..." at the end of a line: the keyboard-and-screen-reader way to reorder, besides the drag handle. */
7
7
  const LineMenu = ({ items, label }) => {
@@ -1,11 +1,11 @@
1
1
  import { cn } from "../lib/cn.js";
2
+ import { formatMoney } from "../format/money.js";
2
3
  import { lineTotalCents } from "../mocks/invoices.js";
3
4
  import { lineGrid } from "./columns.js";
4
- import { formatMoney } from "../format/money.js";
5
5
  import { LineMenu } from "./line-menu.js";
6
6
  import { NumberCell } from "./number-cell.js";
7
- import { jsx, jsxs } from "react/jsx-runtime";
8
7
  import { GripVertical } from "lucide-react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { useSortable } from "@dnd-kit/sortable";
10
10
  //#region src/inline-child-table/line-row.tsx
11
11
  const parseEuros = (text) => Math.round(Number(text.replace(",", ".").replace(/[^0-9.]/g, "")) * 100);
@@ -1,5 +1,5 @@
1
- import { invoiceTotals } from "../mocks/invoices.js";
2
1
  import { formatMoney } from "../format/money.js";
2
+ import { invoiceTotals } from "../mocks/invoices.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/inline-child-table/totals-footer.tsx
5
5
  const TotalsFooter = ({ lines, vatRate }) => {
@@ -1,7 +1,7 @@
1
+ import { formatMoney } from "../format/money.js";
1
2
  import { keys } from "../data/query-keys.js";
2
3
  import { useClient } from "../data/api-provider.js";
3
4
  import { humanize } from "./naming.js";
4
- import { formatMoney } from "../format/money.js";
5
5
  import { stateToText } from "./filter-string.js";
6
6
  import { useHistogram } from "../data/use-aggregates.js";
7
7
  import { fetchLabels } from "./relation-labels.js";
@@ -1,6 +1,6 @@
1
1
  import { cn } from "../lib/cn.js";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import { Check, Minus } from "lucide-react";
3
+ import { jsx } from "react/jsx-runtime";
4
4
  //#region src/primitives/checkbox.tsx
5
5
  const Checkbox = ({ checked, indeterminate, onChange, label, className }) => /* @__PURE__ */ jsx("button", {
6
6
  type: "button",
@@ -1,7 +1,7 @@
1
1
  import { useFocusTrap } from "../lib/use-focus-trap.js";
2
2
  import { useRef } from "react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
3
  import { X } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/primitives/sheet.tsx
6
6
  /** A panel that rises from the bottom of the screen, for the filter panel on phones. */
7
7
  const Sheet = ({ title, open, onClose, children }) => {
@@ -1,6 +1,6 @@
1
1
  import { cn } from "../lib/cn.js";
2
- import { jsx } from "react/jsx-runtime";
3
2
  import { Loader2 } from "lucide-react";
3
+ import { jsx } from "react/jsx-runtime";
4
4
  //#region src/primitives/spinner.tsx
5
5
  const Spinner = ({ className }) => /* @__PURE__ */ jsx(Loader2, {
6
6
  "aria-label": "Loading",
@@ -1,7 +1,7 @@
1
1
  import { Avatar } from "../primitives/avatar.js";
2
2
  import { Button } from "../primitives/button.js";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
3
  import { TriangleAlert } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/record-view/field.tsx
6
6
  const Field = ({ label, required, help, example, error, conflict, children }) => /* @__PURE__ */ jsxs("div", { children: [
7
7
  /* @__PURE__ */ jsxs("div", {
@@ -1,5 +1,5 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
1
  import { ChevronRight } from "lucide-react";
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
5
  className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-[13px]",
@@ -1,8 +1,8 @@
1
1
  import { useIsDesktop } from "../lib/use-media-query.js";
2
2
  import { Button } from "../primitives/button.js";
3
3
  import { useVisualViewport } from "../lib/use-visual-viewport.js";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { X } from "lucide-react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/side-panel/side-panel.tsx
7
7
  /**
8
8
  * A full-height panel beside the page, for the shell's `rightPanel`: a header with a close button, content and a footer.
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../lib/cn.js";
2
2
  import { Spinner } from "../primitives/spinner.js";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
3
  import { Check, Circle, X } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/step-list/step-list.tsx
6
6
  const icons = {
7
7
  pending: /* @__PURE__ */ jsx(Circle, { className: "size-3 text-faint-foreground" }),
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../lib/cn.js";
2
2
  import { Spinner } from "../primitives/spinner.js";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
3
  import { CheckCircle2, X, XCircle } from "lucide-react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/toasts/toast.tsx
6
6
  const icons = {
7
7
  loading: /* @__PURE__ */ jsx(Spinner, { className: "text-primary" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/ui",
3
- "version": "0.3.5",
3
+ "version": "0.4.1",
4
4
  "description": "The Protobase admin app and the React hooks and components for custom UI.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -34,9 +34,9 @@
34
34
  "dependencies": {
35
35
  "@dnd-kit/core": "^6.3.1",
36
36
  "@dnd-kit/sortable": "^10.0.0",
37
- "@protobase/client": "0.3.5",
38
- "@protobase/layout": "0.3.5",
39
- "@protobase/schema": "0.3.5",
37
+ "@protobase/client": "0.4.1",
38
+ "@protobase/layout": "0.4.1",
39
+ "@protobase/schema": "0.4.1",
40
40
  "@tanstack/react-query": "^5.104.1",
41
41
  "@tanstack/react-table": "^9.2.6",
42
42
  "@tanstack/react-virtual": "^3.14.13",
@@ -44,6 +44,7 @@
44
44
  "react": "^19.3.0",
45
45
  "react-dom": "^19.3.0",
46
46
  "recharts": "^3.10.1",
47
- "tailwindcss": "^4.3.3"
47
+ "tailwindcss": "^4.3.3",
48
+ "uqr": "^0.1.3"
48
49
  }
49
50
  }