@viglet/viglet-design-system 2026.3.2 → 2026.3.4
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/README.md +334 -8
- package/dist/assets.cjs +1 -0
- package/dist/assets.es.js +2 -0
- package/dist/badge-locale-BxI9TwkE.js +579 -0
- package/dist/badge-locale-sIsBdP_e.cjs +7 -0
- package/dist/bento/bento-actions-menu.d.ts +42 -0
- package/dist/bento/bento-actions-menu.d.ts.map +1 -0
- package/dist/bento/bento-back-to-top.d.ts +11 -0
- package/dist/bento/bento-back-to-top.d.ts.map +1 -0
- package/dist/bento/bento-command-palette.d.ts +28 -0
- package/dist/bento/bento-command-palette.d.ts.map +1 -0
- package/dist/bento/bento-count-tile.d.ts +18 -0
- package/dist/bento/bento-count-tile.d.ts.map +1 -0
- package/dist/bento/bento-empty-state.d.ts +35 -0
- package/dist/bento/bento-empty-state.d.ts.map +1 -0
- package/dist/bento/bento-entity-shell.d.ts +123 -0
- package/dist/bento/bento-entity-shell.d.ts.map +1 -0
- package/dist/bento/bento-entity-tile.d.ts +40 -0
- package/dist/bento/bento-entity-tile.d.ts.map +1 -0
- package/dist/bento/bento-form-hero.d.ts +91 -0
- package/dist/bento/bento-form-hero.d.ts.map +1 -0
- package/dist/bento/bento-form-section.d.ts +31 -0
- package/dist/bento/bento-form-section.d.ts.map +1 -0
- package/dist/bento/bento-hero-icon-picker.d.ts +35 -0
- package/dist/bento/bento-hero-icon-picker.d.ts.map +1 -0
- package/dist/bento/bento-hero.d.ts +62 -0
- package/dist/bento/bento-hero.d.ts.map +1 -0
- package/dist/bento/bento-inline-edit.d.ts +52 -0
- package/dist/bento/bento-inline-edit.d.ts.map +1 -0
- package/dist/bento/bento-layout.d.ts +52 -0
- package/dist/bento/bento-layout.d.ts.map +1 -0
- package/dist/bento/bento-list-page.d.ts +124 -0
- package/dist/bento/bento-list-page.d.ts.map +1 -0
- package/dist/bento/bento-nav-rail.d.ts +32 -0
- package/dist/bento/bento-nav-rail.d.ts.map +1 -0
- package/dist/bento/bento-nav.d.ts +69 -0
- package/dist/bento/bento-nav.d.ts.map +1 -0
- package/dist/bento/bento-save-bar.d.ts +36 -0
- package/dist/bento/bento-save-bar.d.ts.map +1 -0
- package/dist/bento/bento-scroll-fade.d.ts +20 -0
- package/dist/bento/bento-scroll-fade.d.ts.map +1 -0
- package/dist/bento/bento-scroll-save-bar.d.ts +22 -0
- package/dist/bento/bento-scroll-save-bar.d.ts.map +1 -0
- package/dist/bento/bento-section-chrome.d.ts +60 -0
- package/dist/bento/bento-section-chrome.d.ts.map +1 -0
- package/dist/bento/bento-section.d.ts +27 -0
- package/dist/bento/bento-section.d.ts.map +1 -0
- package/dist/bento/bento-shortcuts-dialog.d.ts +15 -0
- package/dist/bento/bento-shortcuts-dialog.d.ts.map +1 -0
- package/dist/bento/bento-status-marker.d.ts +26 -0
- package/dist/bento/bento-status-marker.d.ts.map +1 -0
- package/dist/bento/bento-tile.d.ts +42 -0
- package/dist/bento/bento-tile.d.ts.map +1 -0
- package/dist/bento/bento-tones.d.ts +33 -0
- package/dist/bento/bento-tones.d.ts.map +1 -0
- package/dist/bento/bento-user-menu.d.ts +31 -0
- package/dist/bento/bento-user-menu.d.ts.map +1 -0
- package/dist/bento/index.d.ts +59 -0
- package/dist/bento/index.d.ts.map +1 -0
- package/dist/bento.cjs +1 -0
- package/dist/bento.css +442 -0
- package/dist/bento.es.js +1502 -0
- package/dist/breadcrumb.context-CGqjI0-U.js +914 -0
- package/dist/breadcrumb.context-DYeZEC65.cjs +1 -0
- package/dist/components/app-switcher.d.ts +2 -0
- package/dist/components/app-switcher.d.ts.map +1 -1
- package/dist/components/badge-locale.d.ts.map +1 -1
- package/dist/components/error-boundary.d.ts.map +1 -1
- package/dist/components/language-select.d.ts.map +1 -1
- package/dist/components/router/blank-slate.d.ts +10 -0
- package/dist/components/router/blank-slate.d.ts.map +1 -1
- package/dist/components/router/grid.list.d.ts +13 -0
- package/dist/components/router/grid.list.d.ts.map +1 -1
- package/dist/components/router/internal.sidebar.d.ts +39 -3
- package/dist/components/router/internal.sidebar.d.ts.map +1 -1
- package/dist/components/router/loading-provider.d.ts +6 -1
- package/dist/components/router/loading-provider.d.ts.map +1 -1
- package/dist/components/router/nav-main.d.ts +10 -0
- package/dist/components/router/nav-main.d.ts.map +1 -1
- package/dist/components/router/nav-user.d.ts +13 -0
- package/dist/components/router/nav-user.d.ts.map +1 -1
- package/dist/components/router/page-content.d.ts +10 -0
- package/dist/components/router/page-content.d.ts.map +1 -1
- package/dist/components/router/page-header.d.ts +13 -0
- package/dist/components/router/page-header.d.ts.map +1 -1
- package/dist/components/router/page.d.ts +13 -0
- package/dist/components/router/page.d.ts.map +1 -1
- package/dist/components/router/sticky.page.header.d.ts +14 -0
- package/dist/components/router/sticky.page.header.d.ts.map +1 -1
- package/dist/components/router/sub.page.d.ts +31 -11
- package/dist/components/router/sub.page.d.ts.map +1 -1
- package/dist/components/router/sub.page.header.d.ts +13 -0
- package/dist/components/router/sub.page.header.d.ts.map +1 -1
- package/dist/components/startup-first/startup-first.d.ts.map +1 -1
- package/dist/components/theme-provider.d.ts +37 -2
- package/dist/components/theme-provider.d.ts.map +1 -1
- package/dist/components/ui/floating-formulas-bg.d.ts +8 -1
- package/dist/components/ui/floating-formulas-bg.d.ts.map +1 -1
- package/dist/components/ui/form.d.ts +2 -2
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/gradient-button.d.ts.map +1 -1
- package/dist/components/ui/gradient-switch.d.ts.map +1 -1
- package/dist/components/ui/icon-picker-dialog.d.ts +35 -0
- package/dist/components/ui/icon-picker-dialog.d.ts.map +1 -0
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/section-card.d.ts +3 -3
- package/dist/components/ui/section-card.d.ts.map +1 -1
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/slider.d.ts +1 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/viglet-app-switcher.d.ts +3 -0
- package/dist/components/viglet-app-switcher.d.ts.map +1 -1
- package/dist/contexts/user.context.d.ts +24 -0
- package/dist/contexts/user.context.d.ts.map +1 -1
- package/dist/exports.json +404 -0
- package/dist/floating-formulas-bg.cjs +1 -0
- package/dist/floating-formulas-bg.css +21 -0
- package/dist/floating-formulas-bg.es.js +84 -56
- package/dist/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
- package/dist/fonts/plus-jakarta-sans-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/plus-jakarta-sans-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/plus-jakarta-sans-vietnamese-wght-normal.woff2 +0 -0
- package/dist/fonts.css +126 -0
- package/dist/hooks/use-grid-adapter.d.ts.map +1 -1
- package/dist/hooks/use-mobile.d.ts +10 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-sub-page-breadcrumb.d.ts.map +1 -1
- package/dist/i18n/index.d.ts +136 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/locales/en/bento.json.d.ts +51 -0
- package/dist/i18n/locales/en/common.json.d.ts +7 -1
- package/dist/i18n/locales/en/forms.json.d.ts +15 -1
- package/dist/i18n/locales/en/nav.json.d.ts +3 -1
- package/dist/i18n/locales/pt/bento.json.d.ts +51 -0
- package/dist/i18n/locales/pt/common.json.d.ts +7 -1
- package/dist/i18n/locales/pt/forms.json.d.ts +15 -1
- package/dist/i18n/locales/pt/nav.json.d.ts +3 -1
- package/dist/i18n-DoNdMLEd.cjs +1 -0
- package/dist/{i18n-C94rDRaM.js → i18n-DuNITbWa.js} +155 -27
- package/dist/i18n.cjs +1 -0
- package/dist/i18n.es.js +2 -1
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +493 -750
- package/dist/lib/axios.d.ts.map +1 -1
- package/dist/lib/export-xlsx.d.ts +7 -1
- package/dist/lib/export-xlsx.d.ts.map +1 -1
- package/dist/lib/react-markers.d.ts +17 -0
- package/dist/lib/react-markers.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +22 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/loading-provider-1mgM91iY.cjs +1 -0
- package/dist/loading-provider-CMnOuvdR.js +224 -0
- package/dist/preset.css +103 -3
- package/dist/products-DL_YYXkV.cjs +1 -0
- package/dist/products-Du9KB6Xl.js +9 -0
- package/dist/{rolldown-runtime-CMqjfN_6.cjs → rolldown-runtime-BocRIvOZ.cjs} +1 -1
- package/dist/router.cjs +1 -0
- package/dist/router.es.js +334 -504
- package/dist/user.context-kPAqKN4o.js +512 -0
- package/dist/user.context-r50nSWER.cjs +1 -0
- package/dist/viglet-design-system.css +1 -1
- package/dist/vite/boot-loader.d.ts +21 -7
- package/dist/vite/boot-loader.d.ts.map +1 -1
- package/dist/{vite.cjs.js → vite.cjs} +8 -8
- package/dist/vite.es.js +29 -16
- package/package.json +66 -22
- package/scripts/check-duplicates.mjs +198 -0
- package/dist/breadcrumb.context-C7VCfh49.js +0 -1501
- package/dist/breadcrumb.context-Td6Tjc_z.cjs +0 -7
- package/dist/floating-formulas-bg.cjs.js +0 -1
- package/dist/i18n-DN_2YzjB.cjs +0 -1
- package/dist/i18n.cjs.js +0 -1
- package/dist/index.cjs.js +0 -1
- package/dist/router.cjs.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-actions-menu.d.ts","sourceRoot":"","sources":["../../src/bento/bento-actions-menu.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,aAAa,CAAC;AAExD,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,IAAI,EAAE,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvC;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gDAAgD;IAChD,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAChC,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,QAAQ,CAAC,qBAAqB,CAAC,sCAkC1F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Floating "scroll to top" button — appears with an iOS spring
|
|
3
|
+
* animation once the user has scrolled past the threshold, and
|
|
4
|
+
* smooth-scrolls back to the top on click.
|
|
5
|
+
*
|
|
6
|
+
* Complements the sticky header rather than replacing it: the header
|
|
7
|
+
* keeps navigation/branding always reachable, this button just cuts
|
|
8
|
+
* the long way back when content is heavy.
|
|
9
|
+
*/
|
|
10
|
+
export declare function BentoBackToTop(): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=bento-back-to-top.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-back-to-top.d.ts","sourceRoot":"","sources":["../../src/bento/bento-back-to-top.tsx"],"names":[],"mappings":"AAcA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,gCA6B7B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BentoNavItem } from './bento-nav';
|
|
2
|
+
export interface BentoCommandPaletteProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange: (open: boolean) => void;
|
|
5
|
+
/**
|
|
6
|
+
* The surfaces this reader may jump to, already filtered — the same array the
|
|
7
|
+
* nav rail is given, so `⌘K` and the rail can never disagree about what
|
|
8
|
+
* exists.
|
|
9
|
+
*
|
|
10
|
+
* A product's routes and entity names are the one thing this package must
|
|
11
|
+
* never hold: a palette shipping its own array would offer one console's
|
|
12
|
+
* surfaces inside another's.
|
|
13
|
+
*/
|
|
14
|
+
items: BentoNavItem[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The Bento `⌘K` command palette (T549) — a keyboard-first launcher over
|
|
18
|
+
* every navigable area. Built on the Radix `Dialog` primitive (zero extra
|
|
19
|
+
* deps): a filter box + a flat, arrow-key-navigable result list. Migrated
|
|
20
|
+
* surfaces navigate inside the bento shell; not-yet-migrated areas link out
|
|
21
|
+
* to the console (marked with an external-link glyph) so the palette reaches
|
|
22
|
+
* everything during the migration.
|
|
23
|
+
*
|
|
24
|
+
* Global open/close (⌘K / Ctrl+K) is owned by the parent shell; this
|
|
25
|
+
* component only renders and drives selection while `open`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function BentoCommandPalette({ open, onOpenChange, items }: Readonly<BentoCommandPaletteProps>): import("react").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=bento-command-palette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-command-palette.d.ts","sourceRoot":"","sources":["../../src/bento/bento-command-palette.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;;;;;OAQG;IACH,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,wBAAwB,CAAC,+BAsJpG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { BentoTone } from './bento-tones';
|
|
3
|
+
export interface BentoCountTileProps {
|
|
4
|
+
to?: string;
|
|
5
|
+
icon: ComponentType<{
|
|
6
|
+
size?: number;
|
|
7
|
+
}>;
|
|
8
|
+
tone: BentoTone;
|
|
9
|
+
label: string;
|
|
10
|
+
count: number;
|
|
11
|
+
span: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Compact Bento tile that highlights a single number — typical for
|
|
15
|
+
* counters (e.g., "12 LLMs", "3 MCP servers").
|
|
16
|
+
*/
|
|
17
|
+
export declare function BentoCountTile({ to, icon: Icon, tone, label, count, span, }: Readonly<BentoCountTileProps>): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=bento-count-tile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-count-tile.d.ts","sourceRoot":"","sources":["../../src/bento/bento-count-tile.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,IAAI,EAAE,IAAI,EACV,IAAI,EACJ,KAAK,EACL,KAAK,EACL,IAAI,GACL,EAAE,QAAQ,CAAC,mBAAmB,CAAC,+BAkB/B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Icon as TablerIcon } from '@tabler/icons-react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BentoTone } from './bento-tones';
|
|
4
|
+
export interface BentoEmptyStateProps {
|
|
5
|
+
/** Tonal icon in the leading chip. Defaults to a sparkle. */
|
|
6
|
+
icon?: TablerIcon;
|
|
7
|
+
/** Tone driving the icon chip gradient. Default `indigo`. */
|
|
8
|
+
tone?: BentoTone;
|
|
9
|
+
/** Headline — what's missing, in plain language. */
|
|
10
|
+
title: string;
|
|
11
|
+
/** One-line hint on how to fill it. */
|
|
12
|
+
description?: ReactNode;
|
|
13
|
+
/** Optional call-to-action (a `BentoEntityTile`-style link, a button, …). */
|
|
14
|
+
action?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Content alignment. `center` (default) suits standalone panels — a chart
|
|
17
|
+
* with no data, an analytics tab before the first run. `start` suits an
|
|
18
|
+
* empty cell inside a mosaic (see the list-page `EmptyHintTile`).
|
|
19
|
+
*/
|
|
20
|
+
align?: "center" | "start";
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The one canonical Bento empty-state (T572). Every "nothing here yet" surface
|
|
25
|
+
* — an empty entity list, a chart with no samples, an analytics tab before its
|
|
26
|
+
* first data point — renders this so the void reads the same everywhere: a
|
|
27
|
+
* frosted `bento-glass` panel, a tonal icon chip, a short title, a one-line
|
|
28
|
+
* hint, and an optional CTA. Consistency here is the delight: an empty screen
|
|
29
|
+
* that looks designed rather than broken.
|
|
30
|
+
*
|
|
31
|
+
* The list mosaic's `EmptyHintTile` delegates to this component (wrapping it in
|
|
32
|
+
* the grid span), so lists and standalone panels stay visually identical.
|
|
33
|
+
*/
|
|
34
|
+
export declare function BentoEmptyState({ icon: Icon, tone, title, description, action, align, className, }: Readonly<BentoEmptyStateProps>): import("react").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=bento-empty-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-empty-state.d.ts","sourceRoot":"","sources":["../../src/bento/bento-empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACnC,6DAA6D;IAC7D,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EAAE,IAAmB,EACzB,IAAe,EACf,KAAK,EACL,WAAW,EACX,MAAM,EACN,KAAgB,EAChB,SAAS,GACV,EAAE,QAAQ,CAAC,oBAAoB,CAAC,+BAyBhC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Icon as TablerIcon } from '@tabler/icons-react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BentoActionsMenuItem } from './bento-actions-menu';
|
|
4
|
+
import { BentoTone } from './bento-tones';
|
|
5
|
+
/**
|
|
6
|
+
* The identity fields every Bento entity hero owns: title, description,
|
|
7
|
+
* an optional Iconify icon, and an `enabled` status flag (0/1). These
|
|
8
|
+
* are edited in the hero (inline-edit + icon picker + status pill), not
|
|
9
|
+
* in the form body — the form's own FormFields for these are lifted out.
|
|
10
|
+
*/
|
|
11
|
+
export interface BentoIdentity {
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
icon: string | null;
|
|
15
|
+
/** 0 = idle, 1 = active. Only surfaced as a pill when `hasStatus`. */
|
|
16
|
+
enabled: number;
|
|
17
|
+
}
|
|
18
|
+
/** Form state the render-prop child reports up so the hero can mirror it. */
|
|
19
|
+
export interface BentoShellFormState {
|
|
20
|
+
isDirty: boolean;
|
|
21
|
+
isSubmitting: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Fields the shell reads off the entity to seed the hero identity. `title` /
|
|
25
|
+
* `description` tolerate `null` so entities whose columns are nullable (e.g.
|
|
26
|
+
* Custom Tool) satisfy the constraint without a cast.
|
|
27
|
+
*/
|
|
28
|
+
type BentoEntityLike = {
|
|
29
|
+
id?: string;
|
|
30
|
+
title?: string | null;
|
|
31
|
+
description?: string | null;
|
|
32
|
+
icon?: string | null;
|
|
33
|
+
enabled?: number;
|
|
34
|
+
};
|
|
35
|
+
export interface BentoEntityShellRenderArgs {
|
|
36
|
+
/** Latest hero identity — merged into the form's create/update payload. */
|
|
37
|
+
staged: BentoIdentity;
|
|
38
|
+
/** Form reports dirty/submitting so the hero renders Save/Cancel correctly. */
|
|
39
|
+
onStateChange: (state: BentoShellFormState) => void;
|
|
40
|
+
}
|
|
41
|
+
export interface BentoEntityShellProps<TEntity extends BentoEntityLike> {
|
|
42
|
+
/** The entity being edited. In `isNew` mode pass an empty object. */
|
|
43
|
+
entity: TEntity;
|
|
44
|
+
isNew: boolean;
|
|
45
|
+
/** Placeholder shown in the title inline-edit when empty. */
|
|
46
|
+
headlineFallback: string;
|
|
47
|
+
/** Breadcrumb label above the title — usually the section name. */
|
|
48
|
+
eyebrow: ReactNode;
|
|
49
|
+
/** List route the eyebrow links to and Cancel/Delete navigate back to. */
|
|
50
|
+
listRoute: string;
|
|
51
|
+
/** Default hero icon when no Iconify icon is picked. */
|
|
52
|
+
icon: TablerIcon;
|
|
53
|
+
tone: BentoTone;
|
|
54
|
+
/** DOM id of the `<form>` the hero-anchored Save button submits (`form="…"`). */
|
|
55
|
+
formId: string;
|
|
56
|
+
/** i18n'd feature label used in toasts (e.g. `t("llm.title")`). */
|
|
57
|
+
feature: string;
|
|
58
|
+
/** Render the Active/Idle status pill (driven by `enabled`). */
|
|
59
|
+
hasStatus?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Hide the hero icon picker for entities that have no `icon` field
|
|
62
|
+
* (e.g. API Token, Git). A static default-icon chip renders instead and
|
|
63
|
+
* no `icon` patch is ever emitted.
|
|
64
|
+
*/
|
|
65
|
+
hideIcon?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Read-only mode — used by BYO-infra surfaces for the shared GLOBAL pool
|
|
68
|
+
* (T372) when the caller is not a platform admin. Suppresses inline-edit,
|
|
69
|
+
* the icon picker, the status toggle, the save buttons and destructive
|
|
70
|
+
* actions; identity renders as plain text. Pair with a `notice`.
|
|
71
|
+
*/
|
|
72
|
+
readOnly?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The page has no submittable body form — identity auto-saves on blur and
|
|
75
|
+
* every other action (sub-lists, generate, import) has its own button, so
|
|
76
|
+
* the hero "Save changes" button would be permanently inert. When true it
|
|
77
|
+
* is hidden on existing entities (Cancel/back stays); the new-entity Save
|
|
78
|
+
* still shows because it is what creates the entity. Use for pages like the
|
|
79
|
+
* Thesaurus KB whose only editable fields live in the hero.
|
|
80
|
+
*/
|
|
81
|
+
autosaveOnly?: boolean;
|
|
82
|
+
/** Small chip rendered in the hero trailing slot (e.g. a GLOBAL badge). */
|
|
83
|
+
badge?: ReactNode;
|
|
84
|
+
/** Banner rendered directly under the hero (e.g. a read-only notice). */
|
|
85
|
+
notice?: ReactNode;
|
|
86
|
+
/**
|
|
87
|
+
* Existing-mode immediate save. Receives the entity already merged with
|
|
88
|
+
* the changed identity patch. Omit in new mode (fields stage locally and
|
|
89
|
+
* the form's Save creates the entity).
|
|
90
|
+
*
|
|
91
|
+
* Reject to refuse the edit: the shell shows it optimistically, and puts the
|
|
92
|
+
* fields the patch touched back to the entity's own values when this rejects.
|
|
93
|
+
*/
|
|
94
|
+
onUpdate?: (next: TEntity) => Promise<unknown>;
|
|
95
|
+
/** Delete callback; returns whether the delete succeeded. */
|
|
96
|
+
onDelete?: () => Promise<boolean>;
|
|
97
|
+
/** Extra `⋮` menu actions rendered above the built-in Delete. */
|
|
98
|
+
extraActions?: BentoActionsMenuItem[];
|
|
99
|
+
children: (args: BentoEntityShellRenderArgs) => ReactNode;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The reusable Bento detail scaffold — the lever that makes every remaining
|
|
103
|
+
* CRUD screen a thin config instead of a bespoke ~360-line page (T548).
|
|
104
|
+
*
|
|
105
|
+
* Owns everything the LLM/AI-Agent detail pattern settled on:
|
|
106
|
+
*
|
|
107
|
+
* - **Identity hero** — `BentoInlineEdit` title/description, a
|
|
108
|
+
* `BentoHeroIconPicker`, and (optionally) a clickable Active/Idle pill.
|
|
109
|
+
* - **Two modes** — *existing*: each identity field commits immediately
|
|
110
|
+
* via `onUpdate` (type → blur → saved); *new*: fields stage locally and
|
|
111
|
+
* the form's Save creates the entity (no mutation until Save).
|
|
112
|
+
* - **Scroll-linked hero → sticky-save-bar morph** — a single rAF loop
|
|
113
|
+
* writes `--bento-fade` on `<html>`; the hero's Save/Cancel
|
|
114
|
+
* (`bento-fade-out`) and the form's fixed `BentoSaveBar` (`bento-fade-in`)
|
|
115
|
+
* both interpolate off it with zero React re-renders during scroll.
|
|
116
|
+
* - **Destructive actions** in a `⋮` `BentoActionsMenu`, never the save bar.
|
|
117
|
+
*
|
|
118
|
+
* The form body is a render prop receiving `{ staged, onStateChange }` and
|
|
119
|
+
* wraps the existing react-hook-form fields in `BentoFormSection`s unchanged.
|
|
120
|
+
*/
|
|
121
|
+
export declare function BentoEntityShell<TEntity extends BentoEntityLike>({ entity, isNew, headlineFallback, eyebrow, listRoute, icon, tone, formId, feature, hasStatus, hideIcon, readOnly, autosaveOnly, badge, notice, onUpdate, onDelete, extraActions, children, }: Readonly<BentoEntityShellProps<TEntity>>): import("react").JSX.Element;
|
|
122
|
+
export {};
|
|
123
|
+
//# sourceMappingURL=bento-entity-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-entity-shell.d.ts","sourceRoot":"","sources":["../../src/bento/bento-entity-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG9D,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAMnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;CACjB;AAmBD,6EAA6E;AAC7E,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;;;GAIG;AACH,KAAK,eAAe,GAAG;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,WAAW,0BAA0B;IACzC,2EAA2E;IAC3E,MAAM,EAAE,aAAa,CAAC;IACtB,+EAA+E;IAC/E,aAAa,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,qBAAqB,CAAC,OAAO,SAAS,eAAe;IACpE,qEAAqE;IACrE,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,6DAA6D;IAC7D,gBAAgB,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,OAAO,EAAE,SAAS,CAAC;IACnB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,yEAAyE;IACzE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAClC,iEAAiE;IACjE,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACtC,QAAQ,EAAE,CAAC,IAAI,EAAE,0BAA0B,KAAK,SAAS,CAAC;CAC3D;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,eAAe,EAAE,EAChE,MAAM,EACN,KAAK,EACL,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,OAAO,EACP,SAAiB,EACjB,QAAgB,EAChB,QAAgB,EAChB,YAAoB,EACpB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,QAAQ,GACT,EAAE,QAAQ,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,+BAoQ1C"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Icon as TablerIcon } from '@tabler/icons-react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BentoEmphasis } from './bento-layout';
|
|
4
|
+
import { BentoTone } from './bento-tones';
|
|
5
|
+
export interface BentoEntityTileProps {
|
|
6
|
+
/** Link target for the tile. */
|
|
7
|
+
to: string;
|
|
8
|
+
/**
|
|
9
|
+
* Tile prominence. `LARGE` = 2×2 hero, `MEDIUM` = 2×1 wide (default),
|
|
10
|
+
* `SMALL` = compact 1×1. Takes precedence over the legacy `featured` flag.
|
|
11
|
+
*/
|
|
12
|
+
emphasis?: BentoEmphasis;
|
|
13
|
+
/**
|
|
14
|
+
* Legacy prominence flag (still used by the home + area mosaics): `true` maps
|
|
15
|
+
* to `LARGE`, `false` to `MEDIUM`. Ignored when `emphasis` is set.
|
|
16
|
+
*/
|
|
17
|
+
featured?: boolean;
|
|
18
|
+
/** Default Tabler icon when no Iconify `icon` is set. */
|
|
19
|
+
defaultIcon: TablerIcon;
|
|
20
|
+
/** User-picked Iconify icon name, if any. */
|
|
21
|
+
icon?: string | null;
|
|
22
|
+
tone?: BentoTone;
|
|
23
|
+
title: string;
|
|
24
|
+
description?: string | null;
|
|
25
|
+
/** Optional meta chips/text under the title (e.g. vendor, model name). */
|
|
26
|
+
meta?: ReactNode;
|
|
27
|
+
/** Render the Active/Idle status pill (driven by `enabled`). */
|
|
28
|
+
enabled?: number;
|
|
29
|
+
hasStatus?: boolean;
|
|
30
|
+
/** iOS shared-element transition name (matches the detail page). */
|
|
31
|
+
viewTransitionName?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The common Bento content tile: tonal icon chip + optional status pill +
|
|
35
|
+
* title + description + optional meta row, sized by {@link BentoEmphasis}.
|
|
36
|
+
* Covers the shape shared by the entity lists; entities with a bespoke tile can
|
|
37
|
+
* skip it and pass their own node to {@link BentoListPage}'s `renderTile`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function BentoEntityTile({ to, emphasis, featured, defaultIcon: DefaultIcon, icon, tone, title, description, meta, enabled, hasStatus, viewTransitionName, }: Readonly<BentoEntityTileProps>): import("react").JSX.Element;
|
|
40
|
+
//# sourceMappingURL=bento-entity-tile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-entity-tile.d.ts","sourceRoot":"","sources":["../../src/bento/bento-entity-tile.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,WAAW,oBAAoB;IACnC,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yDAAyD;IACzD,WAAW,EAAE,UAAU,CAAC;IACxB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,0EAA0E;IAC1E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,EAAE,EACF,QAAQ,EACR,QAAQ,EACR,WAAW,EAAE,WAAW,EACxB,IAAI,EACJ,IAAe,EACf,KAAK,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,SAAiB,EACjB,kBAAkB,GACnB,EAAE,QAAQ,CAAC,oBAAoB,CAAC,+BAkDhC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BentoHeroProps } from './bento-hero';
|
|
3
|
+
export interface BentoFormHeroProps extends BentoHeroProps {
|
|
4
|
+
/**
|
|
5
|
+
* Convenience back-link breadcrumb: when set, the hero renders its own
|
|
6
|
+
* `eyebrow` as the shared {@link BentoBackLink} (arrow + label) — the same
|
|
7
|
+
* affordance `BentoEntityShell` and `BentoHero` bake in — so every form page
|
|
8
|
+
* gets a consistent "← back" breadcrumb without hand-assembling it. Overrides
|
|
9
|
+
* `eyebrow`. Pair with {@link backLabel}.
|
|
10
|
+
*/
|
|
11
|
+
backTo?: string;
|
|
12
|
+
/** Text of the {@link backTo} breadcrumb (e.g. the parent entity name). */
|
|
13
|
+
backLabel?: ReactNode;
|
|
14
|
+
/** Cancel / back navigation (both the hero button and the sticky bar). */
|
|
15
|
+
onCancel: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Escape hatch replacing the default `type="submit"` Save + Cancel pair in
|
|
18
|
+
* **both** copies (the hero-anchored fade-out one and the sticky bar), for
|
|
19
|
+
* pages that save *imperatively* via `onClick` instead of a form submit —
|
|
20
|
+
* e.g. the SN custom-facet item editor. Supplying it keeps the morph and the
|
|
21
|
+
* "one component owns both halves" guarantee; `loading`, `saveDisabled`,
|
|
22
|
+
* `dirty` and `titleMissing` then only drive the sticky bar's status marker,
|
|
23
|
+
* since the buttons are yours. Prefer a real `<form>` submit when you can.
|
|
24
|
+
*
|
|
25
|
+
* Never pass a controlled delete dialog here — it would be mounted twice and
|
|
26
|
+
* open two modals at once. Destructive actions belong in {@link trailing}.
|
|
27
|
+
*/
|
|
28
|
+
actions?: ReactNode;
|
|
29
|
+
/** Submit in progress — spins the Save button in both places. */
|
|
30
|
+
loading?: boolean;
|
|
31
|
+
/** Amber "unsaved changes" marker + enables Save. */
|
|
32
|
+
dirty?: boolean;
|
|
33
|
+
/** Red "title required" marker; disables Save (takes precedence over dirty). */
|
|
34
|
+
titleMissing?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Force-disable Save. When omitted, Save is disabled while `titleMissing` or
|
|
37
|
+
* while there is nothing to save (`!dirty`).
|
|
38
|
+
*/
|
|
39
|
+
saveDisabled?: boolean;
|
|
40
|
+
/** Title shown in the fixed sticky bar once the hero scrolls away. */
|
|
41
|
+
stickyTitle?: string;
|
|
42
|
+
/** Badges shown next to the sticky-bar title. */
|
|
43
|
+
stickyBadges?: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The **single drop-in** that gives a Bento form page the exact "hero → sticky
|
|
47
|
+
* save bar" morph the {@link BentoEntityShell} pioneered (the LLM/AI-agent
|
|
48
|
+
* detail look): at the top, Save/Cancel live in the hero and fade + lift away
|
|
49
|
+
* as you scroll; once the hero is gone a fixed frosted save bar fades in below
|
|
50
|
+
* the shell header.
|
|
51
|
+
*
|
|
52
|
+
* Use it for form pages that render their **own** hero and therefore can't use
|
|
53
|
+
* {@link BentoEntityShell} — e.g. the persona editor (a shared form behind a
|
|
54
|
+
* pill tab-bar) or any surface with a custom title/leading. It wraps
|
|
55
|
+
* {@link BentoHero} (injecting the fade-out Save/Cancel into `trailing`,
|
|
56
|
+
* *after* any extra `trailing` you pass such as a status pill or a `⋮`
|
|
57
|
+
* {@link BentoActionsMenu}) and renders the {@link BentoScrollSaveBar} twin — so
|
|
58
|
+
* the two halves can never drift apart or be half-wired.
|
|
59
|
+
*
|
|
60
|
+
* Render it as the first child **inside the `<form>`** it submits — both the
|
|
61
|
+
* hero Save button and the sticky-bar Save button are plain `type="submit"`
|
|
62
|
+
* controls that post the enclosing form, so the hero must live in the form.
|
|
63
|
+
* Pages that save imperatively (no form submit) pass their own
|
|
64
|
+
* {@link BentoFormHeroProps.actions} instead and can live outside a `<form>`.
|
|
65
|
+
*
|
|
66
|
+
* ```tsx
|
|
67
|
+
* <form onSubmit={handleSubmit(onSubmit)}>
|
|
68
|
+
* <BentoFormHero
|
|
69
|
+
* eyebrow={<Link to={listRoute}>{feature}</Link>}
|
|
70
|
+
* leading={<IconChip />}
|
|
71
|
+
* title={watchedTitle}
|
|
72
|
+
* subtitle={description}
|
|
73
|
+
* trailing={!isNew && <BentoActionsMenu actions={[del]} />}
|
|
74
|
+
* onCancel={() => navigate(listRoute)}
|
|
75
|
+
* loading={isSubmitting}
|
|
76
|
+
* titleMissing={!watchedTitle.trim()}
|
|
77
|
+
* dirty={isNew || isDirty}
|
|
78
|
+
* stickyTitle={watchedTitle}
|
|
79
|
+
* />
|
|
80
|
+
* <PillNav /> and the form sections go here
|
|
81
|
+
* </form>
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* Keep destructive actions in the hero `trailing` (`⋮` menu) — never in the
|
|
85
|
+
* save bar, which is Save/Cancel only.
|
|
86
|
+
*
|
|
87
|
+
* @author Alexandre Oliveira
|
|
88
|
+
* @since 2026.3.4
|
|
89
|
+
*/
|
|
90
|
+
export declare function BentoFormHero({ eyebrow, backTo, backLabel, leading, title, subtitle, trailing, onCancel, actions, loading, dirty, titleMissing, saveDisabled, stickyTitle, stickyBadges, }: Readonly<BentoFormHeroProps>): import("react").JSX.Element;
|
|
91
|
+
//# sourceMappingURL=bento-form-hero.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-form-hero.d.ts","sourceRoot":"","sources":["../../src/bento/bento-form-hero.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAG7E,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gFAAgF;IAChF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,MAAM,EACN,SAAS,EACT,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,EACP,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,YAAY,GACb,EAAE,QAAQ,CAAC,kBAAkB,CAAC,+BAwD9B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { BentoTone } from './bento-tones';
|
|
3
|
+
export interface BentoFormSectionProps {
|
|
4
|
+
/**
|
|
5
|
+
* Heading level for the section title. Defaults to `h2`: a form section sits
|
|
6
|
+
* directly under the hero's `h1`, and skipping to `h3` leaves a screen reader
|
|
7
|
+
* with a broken outline. Override when a section nests inside another.
|
|
8
|
+
*/
|
|
9
|
+
as?: "h2" | "h3" | "h4";
|
|
10
|
+
icon: ComponentType<{
|
|
11
|
+
size?: number;
|
|
12
|
+
}>;
|
|
13
|
+
tone: BentoTone;
|
|
14
|
+
title: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
/** Optional trailing slot in the header (badges, status pill, etc.). */
|
|
18
|
+
trailing?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Frosted-glass section wrapper for Bento forms — the form-page
|
|
22
|
+
* counterpart of `BentoTile`. Groups related fields under a tonal
|
|
23
|
+
* icon chip + title + description, with the same iOS-spring entry
|
|
24
|
+
* and `bento-glass` surface used elsewhere in the bento language.
|
|
25
|
+
*
|
|
26
|
+
* Stays content-agnostic: any react-hook-form field combo can sit
|
|
27
|
+
* inside `children`, so existing FormField/Input/Select/Switch
|
|
28
|
+
* components are reused without modification.
|
|
29
|
+
*/
|
|
30
|
+
export declare function BentoFormSection({ icon: Icon, tone, title, description, children, trailing, as: Heading, }: Readonly<BentoFormSectionProps>): import("react").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=bento-form-section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-form-section.d.ts","sourceRoot":"","sources":["../../src/bento/bento-form-section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EAAE,IAAI,EACV,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,EAAE,EAAE,OAAc,GACnB,EAAE,QAAQ,CAAC,qBAAqB,CAAC,+BAoBjC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { BentoTone } from './bento-tones';
|
|
3
|
+
export interface BentoHeroIconPickerProps {
|
|
4
|
+
/** Current Iconify icon string (e.g. "tabler:robot"). When null/undefined, the default icon renders. */
|
|
5
|
+
value?: string | null;
|
|
6
|
+
/** Persist a new icon. */
|
|
7
|
+
onChange: (icon: string) => void;
|
|
8
|
+
/** Optional clear callback. When provided, a hover-revealed × badge appears on the chip when an icon is set. */
|
|
9
|
+
onClear?: () => void;
|
|
10
|
+
/** Default icon when `value` is empty. */
|
|
11
|
+
defaultIcon: ComponentType<{
|
|
12
|
+
size?: number;
|
|
13
|
+
}>;
|
|
14
|
+
/** Tone — drives the chip gradient. */
|
|
15
|
+
tone: BentoTone;
|
|
16
|
+
/** Title of the entity (passed to the dialog for AI suggestions). */
|
|
17
|
+
title?: string;
|
|
18
|
+
/** Description of the entity (passed to the dialog for AI suggestions). */
|
|
19
|
+
description?: string;
|
|
20
|
+
/** Render a static chip (no picker dialog, no hover overlay / clear). */
|
|
21
|
+
readOnly?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Bento-flavoured icon picker. Renders as the leading chip of a
|
|
25
|
+
* `BentoHero` (h-12 w-12 rounded-2xl with the page tone gradient),
|
|
26
|
+
* with a hover overlay that signals it's editable. Click opens the
|
|
27
|
+
* shared icon-picker dialog; a hover-revealed × in the corner clears
|
|
28
|
+
* the current icon without opening the dialog.
|
|
29
|
+
*
|
|
30
|
+
* Designed to be the standard pattern for editable entity icons
|
|
31
|
+
* across all bento detail/header pages — replacing the in-form
|
|
32
|
+
* IconPicker field with a single click target on the page header.
|
|
33
|
+
*/
|
|
34
|
+
export declare function BentoHeroIconPicker({ value, onChange, onClear, defaultIcon: DefaultIcon, tone, title, description, readOnly, }: Readonly<BentoHeroIconPickerProps>): import("react").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=bento-hero-icon-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-hero-icon-picker.d.ts","sourceRoot":"","sources":["../../src/bento/bento-hero-icon-picker.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,WAAW,wBAAwB;IACvC,wGAAwG;IACxG,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,0BAA0B;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,gHAAgH;IAChH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,0CAA0C;IAC1C,WAAW,EAAE,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9C,uCAAuC;IACvC,IAAI,EAAE,SAAS,CAAC;IAChB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAW,EAAE,WAAW,EACxB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,QAAgB,GACjB,EAAE,QAAQ,CAAC,wBAAwB,CAAC,+BAwDpC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Canonical breadcrumb back-link for Bento heroes — a leading
|
|
4
|
+
* `IconArrowLeft` followed by the label, pointing at the parent list/route.
|
|
5
|
+
*
|
|
6
|
+
* Centralised here so the arrow is part of the shared component instead of
|
|
7
|
+
* being re-typed inline on every page (which is how the persona dashboard
|
|
8
|
+
* ended up without it). Use it directly only when the eyebrow needs extra
|
|
9
|
+
* trailing content (e.g. a status marker); otherwise pass
|
|
10
|
+
* {@link BentoHeroProps.backTo} / {@link BentoHeroProps.backLabel} and let
|
|
11
|
+
* {@link BentoHero} render it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function BentoBackLink({ to, children }: Readonly<{
|
|
14
|
+
to: string;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}>): import("react").JSX.Element;
|
|
17
|
+
export interface BentoHeroProps {
|
|
18
|
+
/**
|
|
19
|
+
* Small label above the headline. Typically the parent section
|
|
20
|
+
* name (acts as a breadcrumb back-link). Accepts a `ReactNode` so
|
|
21
|
+
* consumers can pass bespoke content.
|
|
22
|
+
*
|
|
23
|
+
* Prefer {@link BentoHeroProps.backTo} for the common "breadcrumb back to
|
|
24
|
+
* the parent list" case — it renders the canonical leading `IconArrowLeft`
|
|
25
|
+
* so no page can forget it. Pass `eyebrow` only for bespoke content (e.g. a
|
|
26
|
+
* status marker appended after the link, composed with {@link BentoBackLink}).
|
|
27
|
+
* If both are set, `eyebrow` wins.
|
|
28
|
+
*/
|
|
29
|
+
eyebrow?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Convenience for the canonical breadcrumb: renders the eyebrow as a
|
|
32
|
+
* back-link (leading `IconArrowLeft` + {@link BentoHeroProps.backLabel})
|
|
33
|
+
* pointing at this route. Ignored when `eyebrow` is provided.
|
|
34
|
+
*/
|
|
35
|
+
backTo?: string;
|
|
36
|
+
/** Label for the {@link BentoHeroProps.backTo} back-link. */
|
|
37
|
+
backLabel?: ReactNode;
|
|
38
|
+
/** Headline — a greeting, the page title, etc. */
|
|
39
|
+
title: ReactNode;
|
|
40
|
+
/** Sub-line below the title. */
|
|
41
|
+
subtitle?: ReactNode;
|
|
42
|
+
/** Visual badge / logo on the left of the headline. */
|
|
43
|
+
leading?: ReactNode;
|
|
44
|
+
/** Trailing slot — actions, chips, etc. Pushed to the far right. */
|
|
45
|
+
trailing?: ReactNode;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Page-level hero block used at the top of every Bento page.
|
|
49
|
+
*
|
|
50
|
+
* Mirrors the "navigation title" pattern from iOS — large, airy,
|
|
51
|
+
* left-aligned by default, and animates in with the same spring as
|
|
52
|
+
* the rest of the bento shell. Stays outside the bento grid (no
|
|
53
|
+
* frosted-glass surface) so it reads as a section header rather
|
|
54
|
+
* than as a tile.
|
|
55
|
+
*
|
|
56
|
+
* Layout contract: leading + title block always anchor to the start;
|
|
57
|
+
* the optional `trailing` slot is pushed to the far right via
|
|
58
|
+
* `ml-auto` so single-child (no trailing) renders deterministically
|
|
59
|
+
* left-aligned without depending on `justify-content` quirks.
|
|
60
|
+
*/
|
|
61
|
+
export declare function BentoHero({ eyebrow, backTo, backLabel, title, subtitle, leading, trailing, }: Readonly<BentoHeroProps>): import("react").JSX.Element;
|
|
62
|
+
//# sourceMappingURL=bento-hero.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-hero.d.ts","sourceRoot":"","sources":["../../src/bento/bento-hero.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,CAAC,+BAO5F;AAED,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,kDAAkD;IAClD,KAAK,EAAE,SAAS,CAAC;IACjB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,uDAAuD;IACvD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,GACT,EAAE,QAAQ,CAAC,cAAc,CAAC,+BAyB1B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface BentoInlineEditProps {
|
|
2
|
+
/** Current persisted value. */
|
|
3
|
+
value: string;
|
|
4
|
+
/**
|
|
5
|
+
* Called when the user commits a non-empty change. Awaited if a Promise
|
|
6
|
+
* is returned — used to keep the field in "saving" state while the
|
|
7
|
+
* underlying mutation resolves.
|
|
8
|
+
*
|
|
9
|
+
* Reject to refuse the edit: the field returns to `value` and the rejection
|
|
10
|
+
* is not rethrown. Reporting it is yours — you know what failed.
|
|
11
|
+
*/
|
|
12
|
+
onSave: (next: string) => void | Promise<void>;
|
|
13
|
+
/** Multiline mode renders a textarea + Cmd/Ctrl+Enter to save (Enter just adds a line). */
|
|
14
|
+
multiline?: boolean;
|
|
15
|
+
/** Shown when value is empty and the field is not being edited. */
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
/** Class applied to BOTH the display element and the input/textarea — keeps typography consistent so there's no visual jump entering/leaving edit mode. */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Accessible label for the input. */
|
|
20
|
+
ariaLabel?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Start in edit mode on mount — useful for "new entity" flows where
|
|
23
|
+
* the placeholder field needs to be filled before anything else
|
|
24
|
+
* makes sense. The user sees a focused input on landing.
|
|
25
|
+
*/
|
|
26
|
+
autoFocus?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Render as plain, non-editable text — no click-to-edit affordance.
|
|
29
|
+
* Used by read-only surfaces (e.g. the shared GLOBAL BYO-infra pool
|
|
30
|
+
* when the caller is not a platform admin).
|
|
31
|
+
*/
|
|
32
|
+
readOnly?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Push every keystroke up through `onSave` (live), instead of only on
|
|
35
|
+
* blur/Enter. Used by "new entity" flows where the field stages locally
|
|
36
|
+
* (no mutation per keystroke) and downstream gates — e.g. the Save
|
|
37
|
+
* button's `titleMissing` check — must react as the user types. With
|
|
38
|
+
* commit-on-blur, a user who types the name then clicks the (still
|
|
39
|
+
* disabled) Save button never commits, so Save appears stuck disabled.
|
|
40
|
+
*/
|
|
41
|
+
commitOnChange?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Click-to-edit inline text. Reads as plain text until clicked, then
|
|
45
|
+
* swaps to a controlled input/textarea that commits on blur / Enter.
|
|
46
|
+
*
|
|
47
|
+
* Display mode shows a subtle bottom border on hover (the canonical
|
|
48
|
+
* "this is editable" hint). Edit mode keeps the same font size /
|
|
49
|
+
* weight as the display so the text doesn't jump when toggling.
|
|
50
|
+
*/
|
|
51
|
+
export declare function BentoInlineEdit({ value, onSave, multiline, placeholder, className, ariaLabel, autoFocus, readOnly, commitOnChange, }: Readonly<BentoInlineEditProps>): import("react").JSX.Element;
|
|
52
|
+
//# sourceMappingURL=bento-inline-edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-inline-edit.d.ts","sourceRoot":"","sources":["../../src/bento/bento-inline-edit.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,oBAAoB;IACnC,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,2FAA2F;IAC3F,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2JAA2J;IAC3J,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,MAAM,EACN,SAAiB,EACjB,WAAW,EACX,SAAc,EACd,SAAS,EACT,SAAiB,EACjB,QAAgB,EAChB,cAAsB,GACvB,EAAE,QAAQ,CAAC,oBAAoB,CAAC,+BAkKhC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared layout vocabulary for customisable bento lists: the
|
|
3
|
+
* {@link BentoEmphasis} sizes, the persisted layout shape, the emphasis-to-grid-span
|
|
4
|
+
* map, and the pure resolver that turns persisted entries (or the built-in
|
|
5
|
+
* default) into an ordered, sized list.
|
|
6
|
+
*
|
|
7
|
+
* Where the layout is stored is the product's business; resolving it is not.
|
|
8
|
+
* Keeping the resolver pure is what lets a product hand in whatever its own API
|
|
9
|
+
* returned and get back a list it can render, with no DOM and no network.
|
|
10
|
+
*/
|
|
11
|
+
/** How prominent one tile is, decoupled from its position. */
|
|
12
|
+
export type BentoEmphasis = "SMALL" | "MEDIUM" | "LARGE";
|
|
13
|
+
/** Which cascade layer produced the resolved layout. */
|
|
14
|
+
export type BentoLayoutSource = "USER" | "GLOBAL" | "DEFAULT";
|
|
15
|
+
/** One item's persisted placement. */
|
|
16
|
+
export interface BentoLayoutEntry {
|
|
17
|
+
itemId: string;
|
|
18
|
+
emphasis: BentoEmphasis;
|
|
19
|
+
displayOrder: number;
|
|
20
|
+
}
|
|
21
|
+
/** The resolved layout a product's API returns for a list surface. */
|
|
22
|
+
export interface BentoLayoutResponse {
|
|
23
|
+
listId: string;
|
|
24
|
+
source: BentoLayoutSource;
|
|
25
|
+
canEditGlobal: boolean;
|
|
26
|
+
entries: BentoLayoutEntry[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Grid span per emphasis. `LARGE` = the 2×2 hero, `MEDIUM` = the 2×1 wide tile
|
|
30
|
+
* (the non-featured default), `SMALL` = a compact 1×1 that a `grid-flow-dense`
|
|
31
|
+
* pass uses to fill holes.
|
|
32
|
+
*/
|
|
33
|
+
export declare const BENTO_EMPHASIS_SPAN: Record<BentoEmphasis, string>;
|
|
34
|
+
/** Next size when cycling the per-tile emphasis affordance. */
|
|
35
|
+
export declare const BENTO_EMPHASIS_NEXT: Record<BentoEmphasis, BentoEmphasis>;
|
|
36
|
+
/** An item paired with its resolved key + emphasis, in resolved order. */
|
|
37
|
+
export interface ResolvedBentoItem<T> {
|
|
38
|
+
item: T;
|
|
39
|
+
key: string;
|
|
40
|
+
emphasis: BentoEmphasis;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Resolve items into ordered, sized tiles. With no persisted entries this is the
|
|
44
|
+
* built-in default — first item `LARGE`, the rest `MEDIUM`. With entries, order
|
|
45
|
+
* by `displayOrder` (items absent from the layout — e.g. created since it was
|
|
46
|
+
* saved — keep their natural order at the end) and size by the persisted
|
|
47
|
+
* emphasis (absent → `MEDIUM`).
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveBentoLayout<T>(items: T[], itemKey: (item: T) => string, entries: BentoLayoutEntry[] | undefined): ResolvedBentoItem<T>[];
|
|
50
|
+
/** Serialize a resolved list back into persistable entries (order = array index). */
|
|
51
|
+
export declare function toBentoLayoutEntries<T>(resolved: ResolvedBentoItem<T>[]): BentoLayoutEntry[];
|
|
52
|
+
//# sourceMappingURL=bento-layout.d.ts.map
|