@marktiderman/genesis-ui 2.12.0 → 2.12.2

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 (125) hide show
  1. package/dist/{AppShell-DpQdcLE-.d.ts → AppShell-HCXpi6nv.d.ts} +3 -2
  2. package/dist/chunk-424PT5DM.js +21 -0
  3. package/dist/chunk-424PT5DM.js.map +1 -0
  4. package/dist/chunk-J45FHL7D.js +46 -0
  5. package/dist/chunk-J45FHL7D.js.map +1 -0
  6. package/dist/{chunk-SZMXNC5Q.js → chunk-MLZEKXV2.js} +3 -3
  7. package/dist/{chunk-SZMXNC5Q.js.map → chunk-MLZEKXV2.js.map} +1 -1
  8. package/dist/{chunk-XGG5RUDE.js → chunk-PMCUHSZS.js} +3 -3
  9. package/dist/{chunk-XGG5RUDE.js.map → chunk-PMCUHSZS.js.map} +1 -1
  10. package/dist/{chunk-3TWCZYZY.js → chunk-STZVZUYO.js} +3 -3
  11. package/dist/{chunk-3TWCZYZY.js.map → chunk-STZVZUYO.js.map} +1 -1
  12. package/dist/chunk-WALJMVEF.js +10 -0
  13. package/dist/chunk-WALJMVEF.js.map +1 -0
  14. package/dist/components/data/index.d.ts +7 -6
  15. package/dist/components/data/index.js +14 -13
  16. package/dist/components/data/index.js.map +1 -1
  17. package/dist/components/layout/dashboard-page.js +1 -0
  18. package/dist/components/layout/detail-page.js +1 -0
  19. package/dist/components/layout/form-page.js +1 -0
  20. package/dist/components/layout/index.d.ts +3 -2
  21. package/dist/components/layout/index.js +3 -2
  22. package/dist/components/layout/settings-page.js +1 -0
  23. package/dist/components/patterns/empty-state.js +1 -0
  24. package/dist/components/patterns/form-field.js +1 -0
  25. package/dist/components/patterns/index.js +1 -0
  26. package/dist/components/patterns/page-loading.js +1 -0
  27. package/dist/components/patterns/settings-row.js +1 -0
  28. package/dist/components/patterns/sortable-list.js +1 -0
  29. package/dist/components/patterns/status-badge.js +1 -0
  30. package/dist/components/patterns/toggle-row.js +1 -0
  31. package/dist/components/patterns/user-avatar.js +1 -0
  32. package/dist/components/rich-text/rich-text-editor.js +1 -0
  33. package/dist/components/rich-text/rich-text-editor.js.map +1 -1
  34. package/dist/components/rich-text/rich-text.js +1 -0
  35. package/dist/components/sheet-grid/sheet-grid.js +1 -0
  36. package/dist/components/sheet-grid/sheet-grid.js.map +1 -1
  37. package/dist/components/ui/accessible-icon.js +1 -0
  38. package/dist/components/ui/accordion.js +1 -0
  39. package/dist/components/ui/alert-dialog.js +1 -0
  40. package/dist/components/ui/alert.js +1 -0
  41. package/dist/components/ui/aspect-ratio.js +1 -0
  42. package/dist/components/ui/avatar.js +1 -0
  43. package/dist/components/ui/badge.js +1 -0
  44. package/dist/components/ui/breadcrumb.js +1 -0
  45. package/dist/components/ui/button-group.js +1 -0
  46. package/dist/components/ui/button.js +1 -0
  47. package/dist/components/ui/calendar.js +1 -0
  48. package/dist/components/ui/card.js +1 -0
  49. package/dist/components/ui/carousel.js +1 -0
  50. package/dist/components/ui/chart.js +1 -0
  51. package/dist/components/ui/checkbox.js +1 -0
  52. package/dist/components/ui/collapsible.js +1 -0
  53. package/dist/components/ui/command-palette.js +1 -0
  54. package/dist/components/ui/command.js +1 -0
  55. package/dist/components/ui/context-menu.js +1 -0
  56. package/dist/components/ui/date-picker.js +1 -0
  57. package/dist/components/ui/dialog.js +1 -0
  58. package/dist/components/ui/drawer.js +1 -0
  59. package/dist/components/ui/dropdown-menu.js +1 -0
  60. package/dist/components/ui/hover-card.js +1 -0
  61. package/dist/components/ui/input-group.js +1 -0
  62. package/dist/components/ui/input-otp.js +1 -0
  63. package/dist/components/ui/input.js +1 -0
  64. package/dist/components/ui/kbd.js +1 -0
  65. package/dist/components/ui/label.js +1 -0
  66. package/dist/components/ui/menubar.js +1 -0
  67. package/dist/components/ui/navigation-menu.js +1 -0
  68. package/dist/components/ui/pagination.js +1 -0
  69. package/dist/components/ui/password-toggle-field.js +1 -0
  70. package/dist/components/ui/popover.js +1 -0
  71. package/dist/components/ui/progress.js +1 -0
  72. package/dist/components/ui/radio-group.js +1 -0
  73. package/dist/components/ui/resizable.js +1 -0
  74. package/dist/components/ui/scroll-area.js +1 -0
  75. package/dist/components/ui/select.js +1 -0
  76. package/dist/components/ui/separator.js +1 -0
  77. package/dist/components/ui/sheet.js +1 -0
  78. package/dist/components/ui/skeleton.js +1 -0
  79. package/dist/components/ui/slider.js +1 -0
  80. package/dist/components/ui/sonner.js +1 -0
  81. package/dist/components/ui/spinner.js +1 -0
  82. package/dist/components/ui/switch.js +1 -0
  83. package/dist/components/ui/table.js +1 -0
  84. package/dist/components/ui/tabs.js +1 -0
  85. package/dist/components/ui/textarea.js +1 -0
  86. package/dist/components/ui/toggle-group.js +1 -0
  87. package/dist/components/ui/toggle.js +1 -0
  88. package/dist/components/ui/toolbar.js +1 -0
  89. package/dist/components/ui/tooltip.js +1 -0
  90. package/dist/components/ui/typography.js +1 -0
  91. package/dist/components/ui/visually-hidden.js +1 -0
  92. package/dist/hooks/index.d.ts +3 -3
  93. package/dist/hooks/index.js +4 -3
  94. package/dist/hooks/use-data-filters.d.ts +1 -1
  95. package/dist/hooks/use-data-filters.js +3 -2
  96. package/dist/hooks/use-keyboard-navigation.js +1 -0
  97. package/dist/hooks/use-mobile.js +1 -0
  98. package/dist/hooks/use-prefetch.js +1 -0
  99. package/dist/hooks/use-resource-page.js +1 -0
  100. package/dist/hooks/use-resource-url-state.d.ts +1 -1
  101. package/dist/hooks/use-resource-url-state.js +1 -0
  102. package/dist/hooks/use-saved-views.js +1 -0
  103. package/dist/hooks/use-view-preference.js +1 -0
  104. package/dist/hooks/use-view-settings.js +1 -0
  105. package/dist/index.d.ts +3 -2
  106. package/dist/index.js +360 -2
  107. package/dist/index.js.map +1 -1
  108. package/dist/navigation-vmFJ6r1m.d.ts +90 -0
  109. package/dist/router/react-router.d.ts +1 -1
  110. package/dist/router/react-router.js +1 -0
  111. package/dist/router/react-router.js.map +1 -1
  112. package/dist/router/tanstack-router.d.ts +1 -1
  113. package/dist/router/tanstack-router.js +2 -1
  114. package/dist/router/tanstack-router.js.map +1 -1
  115. package/dist/status-colors.js +2 -0
  116. package/dist/status-colors.js.map +1 -1
  117. package/dist/{use-resource-table-DrTkD5O1.d.ts → use-resource-table-easmRDQI.d.ts} +2 -2
  118. package/dist/utils.js +1 -0
  119. package/package.json +4 -4
  120. package/dist/chunk-7S7LKQBD.js +0 -12
  121. package/dist/chunk-7S7LKQBD.js.map +0 -1
  122. package/dist/chunk-KC43CNMA.js +0 -141
  123. package/dist/chunk-KC43CNMA.js.map +0 -1
  124. package/dist/navigation-By1DrzaM.d.ts +0 -190
  125. package/dist/slots-tR0wf89f.d.ts +0 -60
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { LucideIcon } from 'lucide-react';
4
- import { L as LinkComponent, N as NavigationNode } from './navigation-By1DrzaM.js';
4
+ import { L as LinkComponent } from './navigation-vmFJ6r1m.js';
5
+ import { NavigationNode } from '@marktiderman/genesis-core/navigation';
5
6
 
6
7
  /**
7
8
  * How AppShell shows the current page's child items. Sub-navigation is
@@ -180,7 +181,7 @@ interface AppShellOptions {
180
181
  collapseShortcut?: string | false;
181
182
  /**
182
183
  * Width of the collapsed icon rail in px: `56` (default, as before) or
183
- * `64` (the Breakthrough design).
184
+ * `64` (a wider rail some apps use).
184
185
  */
185
186
  collapsedRailWidth?: 56 | 64;
186
187
  /**
@@ -0,0 +1,21 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+
19
+ export { __export, __reExport };
20
+ //# sourceMappingURL=chunk-424PT5DM.js.map
21
+ //# sourceMappingURL=chunk-424PT5DM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-424PT5DM.js"}
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { useState, useEffect, useCallback } from 'react';
3
+ export { isPathActive, resolveNavigation } from '@marktiderman/genesis-core/navigation';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ // src/navigation.tsx
7
+ var DefaultLink = ({
8
+ href,
9
+ children,
10
+ testID,
11
+ ...rest
12
+ }) => /* @__PURE__ */ jsx("a", { href, "data-testid": testID, ...rest, children });
13
+ var defaultNavigate = (path) => {
14
+ if (typeof window !== "undefined") window.location.assign(path);
15
+ };
16
+ function useBrowserSearchParams() {
17
+ const read = () => new URLSearchParams(
18
+ typeof window !== "undefined" ? window.location.search : ""
19
+ );
20
+ const [searchParams, setLocal] = useState(read);
21
+ useEffect(() => {
22
+ if (typeof window === "undefined") return;
23
+ const onPop = () => setLocal(read());
24
+ window.addEventListener("popstate", onPop);
25
+ return () => window.removeEventListener("popstate", onPop);
26
+ }, []);
27
+ const setSearchParams = useCallback(
28
+ (next, options) => {
29
+ if (typeof window === "undefined") return;
30
+ const qs = next.toString();
31
+ const url = window.location.pathname + (qs ? `?${qs}` : "") + window.location.hash;
32
+ if (options?.replace) {
33
+ window.history.replaceState(window.history.state, "", url);
34
+ } else {
35
+ window.history.pushState(window.history.state, "", url);
36
+ }
37
+ setLocal(new URLSearchParams(next));
38
+ },
39
+ []
40
+ );
41
+ return { searchParams, setSearchParams };
42
+ }
43
+
44
+ export { DefaultLink, defaultNavigate, useBrowserSearchParams };
45
+ //# sourceMappingURL=chunk-J45FHL7D.js.map
46
+ //# sourceMappingURL=chunk-J45FHL7D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/navigation.tsx"],"names":[],"mappings":";;;;;AAmEO,IAAM,cAA6B,CAAC;AAAA,EACzC,IAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,yBACG,GAAA,EAAA,EAAE,IAAA,EAAY,eAAa,MAAA,EAAS,GAAG,MACrC,QAAA,EACH;AA2BK,IAAM,eAAA,GAA8B,CAAC,IAAA,KAAS;AACnD,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,EAAa,MAAA,CAAO,QAAA,CAAS,OAAO,IAAI,CAAA;AAChE;AA4BO,SAAS,sBAAA,GAA8C;AAC5D,EAAA,MAAM,IAAA,GAAO,MACX,IAAI,eAAA;AAAA,IACF,OAAO,MAAA,KAAW,WAAA,GAAc,MAAA,CAAO,SAAS,MAAA,GAAS;AAAA,GAC3D;AAEF,EAAA,MAAM,CAAC,YAAA,EAAc,QAAQ,CAAA,GAAI,SAA0B,IAAI,CAAA;AAE/D,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACnC,IAAA,MAAM,KAAA,GAAQ,MAAM,QAAA,CAAS,IAAA,EAAM,CAAA;AACnC,IAAA,MAAA,CAAO,gBAAA,CAAiB,YAAY,KAAK,CAAA;AACzC,IAAA,OAAO,MAAM,MAAA,CAAO,mBAAA,CAAoB,UAAA,EAAY,KAAK,CAAA;AAAA,EAC3D,CAAA,EAAG,EAAE,CAAA;AAEL,EAAA,MAAM,eAAA,GAAkB,WAAA;AAAA,IACtB,CAAC,MAAM,OAAA,KAAY;AACjB,MAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACnC,MAAA,MAAM,EAAA,GAAK,KAAK,QAAA,EAAS;AACzB,MAAA,MAAM,GAAA,GACJ,MAAA,CAAO,QAAA,CAAS,QAAA,IAAY,EAAA,GAAK,IAAI,EAAE,CAAA,CAAA,GAAK,EAAA,CAAA,GAAM,MAAA,CAAO,QAAA,CAAS,IAAA;AACpE,MAAA,IAAI,SAAS,OAAA,EAAS;AACpB,QAAA,MAAA,CAAO,QAAQ,YAAA,CAAa,MAAA,CAAO,OAAA,CAAQ,KAAA,EAAO,IAAI,GAAG,CAAA;AAAA,MAC3D,CAAA,MAAO;AACL,QAAA,MAAA,CAAO,QAAQ,SAAA,CAAU,MAAA,CAAO,OAAA,CAAQ,KAAA,EAAO,IAAI,GAAG,CAAA;AAAA,MACxD;AACA,MAAA,QAAA,CAAS,IAAI,eAAA,CAAgB,IAAI,CAAC,CAAA;AAAA,IACpC,CAAA;AAAA,IACA;AAAC,GACH;AAEA,EAAA,OAAO,EAAE,cAAc,eAAA,EAAgB;AACzC","file":"chunk-J45FHL7D.js","sourcesContent":["\"use client\";\n\n/**\n * Router-agnostic navigation primitives.\n *\n * genesis-ui does NOT depend on any router. Components that need to render a\n * link or navigate imperatively accept an injectable abstraction defined here,\n * and default to plain browser behavior (`<a>` / `window.location`). Consumers\n * on a router inject an adapter that maps these props to their own `<Link>` /\n * router. Ready-made ones ship on their own subpaths, each with its router as\n * an optional peer: `@marktiderman/genesis-ui/router/react-router` and\n * `@marktiderman/genesis-ui/router/tanstack-router`. Next.js passes\n * `next/link` directly.\n */\nimport {\n useCallback,\n useEffect,\n useState,\n type AnchorHTMLAttributes,\n type ComponentType,\n type ReactNode,\n} from \"react\";\n\n// ---------------------------------------------------------------------------\n// Link abstraction\n// ---------------------------------------------------------------------------\n\n/**\n * Props passed to an injectable link component. The contract is a plain anchor\n * (`href`), so the default works with NO router. A React Router consumer maps\n * `href` → `to`; a Next.js consumer passes `next/link` directly (it already\n * accepts `href`, `className`, `children`).\n *\n * @stability Beta\n */\nexport interface GenesisLinkProps {\n /** Destination path or URL. */\n href: string;\n className?: string;\n onClick?: () => void;\n children?: ReactNode;\n /** Set to \"page\" when the link points at the active route. */\n \"aria-current\"?: AnchorHTMLAttributes<HTMLAnchorElement>[\"aria-current\"];\n /** Accessible name — useful when the visible label is hidden (icon rail). */\n \"aria-label\"?: string;\n /** Native tooltip / title attribute. */\n title?: string;\n /**\n * Stable test/automation selector. {@link DefaultLink} renders it as\n * `data-testid`; injected router adapters (`next/link`, RR `Link`) forward it\n * to the underlying `<a>` too.\n */\n testID?: string;\n}\n\n/**\n * A component that renders a navigable link from {@link GenesisLinkProps}.\n *\n * @stability Beta\n */\nexport type LinkComponent = ComponentType<GenesisLinkProps>;\n\n/**\n * Default link — a plain `<a>`. No router required.\n *\n * @stability Beta\n */\nexport const DefaultLink: LinkComponent = ({\n href,\n children,\n testID,\n ...rest\n}) => (\n <a href={href} data-testid={testID} {...rest}>\n {children}\n </a>\n);\n\nexport {\n isPathActive,\n resolveNavigation,\n type IsPathActiveOptions,\n type NavigationNode,\n type ResolvedNavigation,\n} from \"@marktiderman/genesis-core/navigation\";\n\n// ---------------------------------------------------------------------------\n// Imperative navigation abstraction\n// ---------------------------------------------------------------------------\n\n/**\n * Injectable imperative navigation callback.\n *\n * @stability Beta\n */\nexport type NavigateFn = (path: string) => void;\n\n/**\n * Default navigate — a full-page navigation. No router required.\n *\n * @stability Beta\n */\nexport const defaultNavigate: NavigateFn = (path) => {\n if (typeof window !== \"undefined\") window.location.assign(path);\n};\n\n// ---------------------------------------------------------------------------\n// Search-params abstraction (for URL-synced hooks)\n// ---------------------------------------------------------------------------\n\n/**\n * Minimal, router-agnostic replacement for React Router's `useSearchParams`\n * return shape. Consumers may inject their router's implementation for full\n * SPA integration; otherwise the browser History API is used.\n *\n * @stability Beta\n */\nexport interface SearchParamsAdapter {\n searchParams: URLSearchParams;\n setSearchParams: (\n next: URLSearchParams,\n options?: { replace?: boolean },\n ) => void;\n}\n\n/**\n * Browser-native {@link SearchParamsAdapter} built on the History API. Reads\n * the current query string and writes updates via `pushState`/`replaceState`,\n * staying reactive to `popstate` events. No router required.\n *\n * @stability Beta\n */\nexport function useBrowserSearchParams(): SearchParamsAdapter {\n const read = () =>\n new URLSearchParams(\n typeof window !== \"undefined\" ? window.location.search : \"\",\n );\n\n const [searchParams, setLocal] = useState<URLSearchParams>(read);\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n const onPop = () => setLocal(read());\n window.addEventListener(\"popstate\", onPop);\n return () => window.removeEventListener(\"popstate\", onPop);\n }, []);\n\n const setSearchParams = useCallback<SearchParamsAdapter[\"setSearchParams\"]>(\n (next, options) => {\n if (typeof window === \"undefined\") return;\n const qs = next.toString();\n const url =\n window.location.pathname + (qs ? `?${qs}` : \"\") + window.location.hash;\n if (options?.replace) {\n window.history.replaceState(window.history.state, \"\", url);\n } else {\n window.history.pushState(window.history.state, \"\", url);\n }\n setLocal(new URLSearchParams(next));\n },\n [],\n );\n\n return { searchParams, setSearchParams };\n}\n"]}
@@ -9,7 +9,7 @@ import { Popover, PopoverTrigger, PopoverContent } from './chunk-22XB3Q6H.js';
9
9
  import { Button } from './chunk-NWSCYLPT.js';
10
10
  import { Label } from './chunk-F47U5KNW.js';
11
11
  import { cn } from './chunk-NZ5WBA4R.js';
12
- import { isPathActive, resolveNavigation, DefaultLink } from './chunk-KC43CNMA.js';
12
+ import { isPathActive, resolveNavigation, DefaultLink } from './chunk-J45FHL7D.js';
13
13
  import { createContext, useId, useState, useEffect, useMemo, useCallback, useContext, useRef, useLayoutEffect, useSyncExternalStore } from 'react';
14
14
  import { ListFilter, MoreHorizontal, SlidersHorizontal, Menu, ArrowLeft, X, Sun, Moon, PanelLeft, PanelLeftClose, ChevronRight, ChevronDown } from 'lucide-react';
15
15
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -1855,5 +1855,5 @@ function AppShell({
1855
1855
  }
1856
1856
 
1857
1857
  export { AppShell, AppShellPageHeader, AppShellSubNavEnd, PageHeader, SubNavTabs, useAppShellSubNav };
1858
- //# sourceMappingURL=chunk-SZMXNC5Q.js.map
1859
- //# sourceMappingURL=chunk-SZMXNC5Q.js.map
1858
+ //# sourceMappingURL=chunk-MLZEKXV2.js.map
1859
+ //# sourceMappingURL=chunk-MLZEKXV2.js.map