@viglet/viglet-design-system 2026.3.3 → 2026.3.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.
- package/README.md +68 -12
- package/dist/bento/bento-panel.d.ts +35 -0
- package/dist/bento/bento-panel.d.ts.map +1 -0
- package/dist/bento/index.d.ts +1 -0
- package/dist/bento/index.d.ts.map +1 -1
- package/dist/bento.cjs +1 -1
- package/dist/bento.es.js +43 -31
- package/dist/{breadcrumb.context-h2A2IEJ_.js → breadcrumb.context-CGqjI0-U.js} +175 -189
- 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/router/internal.sidebar.d.ts +12 -1
- package/dist/components/router/internal.sidebar.d.ts.map +1 -1
- package/dist/components/router/sub.page.d.ts +16 -0
- package/dist/components/router/sub.page.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.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/exports.json +3 -1
- package/dist/floating-formulas-bg.cjs +1 -1
- package/dist/floating-formulas-bg.es.js +1 -0
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.es.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +2 -1
- package/dist/preset.css +42 -22
- package/dist/router.cjs +1 -1
- package/dist/router.es.js +293 -266
- package/dist/viglet-design-system.css +1 -1
- package/dist/vite/boot-loader.d.ts +7 -3
- package/dist/vite/boot-loader.d.ts.map +1 -1
- package/package.json +1 -1
- package/scripts/check-duplicates.mjs +18 -7
- package/dist/breadcrumb.context-CTnZ4rD0.cjs +0 -1
package/README.md
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
# Viglet Design System
|
|
2
2
|
|
|
3
|
-
Shared component library, design tokens, hooks, utilities, and i18n for
|
|
3
|
+
Shared component library, design tokens, hooks, utilities, and i18n for the six
|
|
4
|
+
applications that install it: the Turing, Dumont and Shio consoles,
|
|
5
|
+
the Cloud Console, the Cloud Home, and Schools. `consumers.json` is the list,
|
|
6
|
+
and it is what the guards read.
|
|
4
7
|
|
|
5
8
|
**[Browse the component catalogue](https://openviglet.github.io/viglet-design-system/)** — every
|
|
6
9
|
component, its variants and its props, rebuilt on each commit to `2026.3`. Look
|
|
7
10
|
there before writing a component: the catalogue is the answer to "does this
|
|
8
11
|
already exist".
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
[`consumers.json`](consumers.json) rather than remembered:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
checks widen with it.
|
|
13
|
+
The six applications that install this package are the consumers it holds itself
|
|
14
|
+
to, declared in [`consumers.json`](consumers.json) rather than remembered: each
|
|
15
|
+
entry names its framework, its chrome, the accent it renders with and the
|
|
16
|
+
subpaths it takes, and CI refuses prose that names a subset as though it were
|
|
17
|
+
the whole set. A seventh is one entry there, and the checks widen with it.
|
|
18
|
+
|
|
19
|
+
Three are Vite consoles (Turing, Shio, Dumont), one is a Vite platform home
|
|
20
|
+
(the Cloud Home), and two are Next applications (the Cloud Console and Schools).
|
|
21
|
+
The split matters: a Next consumer takes no `./router` and no `./vite`.
|
|
15
22
|
|
|
16
23
|
## Installation
|
|
17
24
|
|
|
@@ -22,8 +29,10 @@ pnpm add @viglet/viglet-design-system
|
|
|
22
29
|
## Trying a change in a product before publishing
|
|
23
30
|
|
|
24
31
|
A change here is a change to shared chrome, so the question is always what it
|
|
25
|
-
does to Shio, Turing
|
|
26
|
-
publish.
|
|
32
|
+
does to Shio, Turing, Dumont, the Cloud Console, the Cloud Home and Schools —
|
|
33
|
+
and the answer should not require a publish. `use:local` walks a products root,
|
|
34
|
+
so it reaches the first three; the other three are checked out elsewhere and
|
|
35
|
+
`npm pack` into them is the loop until that changes (VDS73). From this checkout:
|
|
27
36
|
|
|
28
37
|
```bash
|
|
29
38
|
pnpm use:local # build, then push dist into every 2026.3 product on disk
|
|
@@ -180,6 +189,42 @@ function App() {
|
|
|
180
189
|
}
|
|
181
190
|
```
|
|
182
191
|
|
|
192
|
+
`ThemeProvider` is a thin wrapper over [`next-themes`](https://github.com/pacocoursey/next-themes),
|
|
193
|
+
which is a peer dependency. Three consequences worth knowing:
|
|
194
|
+
|
|
195
|
+
- **It renders on a server.** No `localStorage` is read during render, so a
|
|
196
|
+
server-rendered or React Server Components consumer can mount it.
|
|
197
|
+
- **There is one theme source.** This package's `Toaster` reads `next-themes`
|
|
198
|
+
directly, so mounting both used to run two theme systems writing the class
|
|
199
|
+
from two storage keys. It no longer does.
|
|
200
|
+
- **You can skip it.** A consumer that mounts `next-themes`'s own provider gets
|
|
201
|
+
the same result, and `useTheme` from here reads that one — useful when a
|
|
202
|
+
framework already sets the theme up for you.
|
|
203
|
+
|
|
204
|
+
`useTheme()` returns `{ theme, setTheme }`, where `theme` is the *setting*
|
|
205
|
+
(`"light" | "dark" | "system"`) rather than the resolved colour.
|
|
206
|
+
|
|
207
|
+
### React Server Components
|
|
208
|
+
|
|
209
|
+
The published entries carry a `"use client"` directive where they need one, so a
|
|
210
|
+
Next App Router server component can import this package without adding a
|
|
211
|
+
directive of its own:
|
|
212
|
+
|
|
213
|
+
| Entry | |
|
|
214
|
+
|---|---|
|
|
215
|
+
| `.`, `./bento`, `./router`, `./floating-formulas-bg`, `./i18n` | client — they reach React state, context or a browser API |
|
|
216
|
+
| `./assets`, `./vite` | server-renderable — logo data, and a build-time Vite plugin |
|
|
217
|
+
|
|
218
|
+
`./i18n` is the one worth pointing at: it looks pure, and it pulls
|
|
219
|
+
`i18next-browser-languagedetector`. `./assets` staying unmarked is deliberate —
|
|
220
|
+
a server component can read a product logo without a client boundary.
|
|
221
|
+
|
|
222
|
+
**The directive is not the whole story for a Next consumer.** `./router` and
|
|
223
|
+
`./bento` import `react-router-dom` (see the peer note further down), which an
|
|
224
|
+
App Router application does not use. Being marked client makes them *compile*
|
|
225
|
+
under RSC; it does not make them route. Today a Next consumer takes the root
|
|
226
|
+
entry, `./assets`, `./floating-formulas-bg` and the styles.
|
|
227
|
+
|
|
183
228
|
### 4. Setup Axios CSRF protection
|
|
184
229
|
|
|
185
230
|
```ts
|
|
@@ -233,7 +278,7 @@ before reaching for `PageHeader`, `GridList` or `InternalSidebar`.
|
|
|
233
278
|
|
|
234
279
|
### Two eras, and which one a new page should use
|
|
235
280
|
|
|
236
|
-
This package exports two complete page vocabularies. The **console era** is what
|
|
281
|
+
This package exports two complete page vocabularies. The **console era** is what the consoles ship on today; the **[bento layer](#the-bento-layer)** is the current one, and Turing has cut over to it. Every console-era export is marked `@deprecated` in its own types, so an editor strikes it through and offers the swap.
|
|
237
282
|
|
|
238
283
|
Nothing is being removed. No product has started cutting over, and a removal will get its own roadmap line rather than arriving as a side effect of this notice — so existing pages keep working and need no rush.
|
|
239
284
|
|
|
@@ -379,7 +424,15 @@ Base translations (EN/PT) for common UI strings: buttons, form labels, dialog te
|
|
|
379
424
|
|
|
380
425
|
Turing grew a second era of chrome — the frosted tile, the airy hero, the
|
|
381
426
|
mosaic — inside one product while this package sat next to it exporting console
|
|
382
|
-
chrome. It
|
|
427
|
+
chrome. It lives here now: the components, their stylesheet, their strings and
|
|
428
|
+
their suites. Turing consumes them through one-line re-exports at the paths its
|
|
429
|
+
pages already imported, so a product adopting the layer writes the imports above
|
|
430
|
+
rather than a second copy.
|
|
431
|
+
|
|
432
|
+
What stayed behind is the product's, deliberately: commercial chrome (activation,
|
|
433
|
+
quota, the first-run tour) and navigation data. `BentoListPage` takes a `layout`
|
|
434
|
+
object rather than fetching one, because where a layout is stored is the
|
|
435
|
+
product's business — its API, its cache, its mutation library.
|
|
383
436
|
|
|
384
437
|
It is a separate entry point, so a console still on the first era carries none
|
|
385
438
|
of it:
|
|
@@ -426,7 +479,8 @@ turning into `any` in your editor.
|
|
|
426
479
|
That last check found a real one. `"type": "module"` makes Node read any `.js`
|
|
427
480
|
as ESM, and the CommonJS entries were named `<entry>.cjs.js`, so every
|
|
428
481
|
`require()` of this package failed. They are `<entry>.cjs` now. No product met
|
|
429
|
-
it, because
|
|
482
|
+
it, because every consumer — the Vite ones through their bundler, the Next ones
|
|
483
|
+
through the App Router — takes the `import` condition.
|
|
430
484
|
|
|
431
485
|
**`./bento` requires `react-router-dom`.** The package declares that peer
|
|
432
486
|
optional because the root entry does not need it — only `./router` and `./bento`
|
|
@@ -446,7 +500,9 @@ put that offer in every console.
|
|
|
446
500
|
|
|
447
501
|
## Contributing
|
|
448
502
|
|
|
449
|
-
The package manager is pnpm, matching the Shio, Turing
|
|
503
|
+
The package manager here is pnpm, matching the Shio, Turing, Dumont, Cloud Home
|
|
504
|
+
and Schools workspaces. The Cloud Console installs with npm, which is a fact
|
|
505
|
+
about that repository and not about this one.
|
|
450
506
|
|
|
451
507
|
```bash
|
|
452
508
|
pnpm install
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface BentoPanelProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** Applied to the frosted container itself — margins, `overflow-hidden`, a width. */
|
|
5
|
+
className?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Applied to the inner content wrapper, which carries **no padding of its own**.
|
|
8
|
+
*
|
|
9
|
+
* A panel holds arbitrary content and the right inset depends on what that content is: a table
|
|
10
|
+
* wants `p-0` so its rows reach the edge, a toolbar wants `py-2 px-4`, a message wants `p-8`.
|
|
11
|
+
* Guessing one here would mean every second call site overriding it, and an override that has to
|
|
12
|
+
* beat a default is the class list nobody can read.
|
|
13
|
+
*/
|
|
14
|
+
contentClassName?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A frosted container with **no heading** — the shape the bento vocabulary was missing.
|
|
18
|
+
*
|
|
19
|
+
* `BentoTile` is a clickable tile, `BentoSection` is a heading plus a grid, `BentoFormSection` is
|
|
20
|
+
* a titled form group. None of them is "a frosted box with arbitrary content in it", so every
|
|
21
|
+
* consumer that needed one hand-rolled `bento-glass rounded-2xl border` at the call site — and the
|
|
22
|
+
* moment two of them picked different radii the product was inconsistent for a reason invisible in
|
|
23
|
+
* any diff.
|
|
24
|
+
*
|
|
25
|
+
* It is a distinct component rather than a `title`-less `BentoSection` because the absence of a
|
|
26
|
+
* heading is the point. A stats strip, a toolbar, a listing and a 404 message all sit under a hero
|
|
27
|
+
* that already names the page; a heading on any of them is noise, and `BentoSection` without a
|
|
28
|
+
* title would still render its `header` element and put an empty entry in the document outline.
|
|
29
|
+
*
|
|
30
|
+
* The surface is `BentoSaveBar`'s, deliberately: that bar is the other frosted container with no
|
|
31
|
+
* heading in this layer, and two things doing the same job should not drift apart. `bento-glass`
|
|
32
|
+
* already carries the border and the blur, so this adds only the radius and the shadow.
|
|
33
|
+
*/
|
|
34
|
+
export declare function BentoPanel({ children, className, contentClassName }: Readonly<BentoPanelProps>): import("react").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=bento-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bento-panel.d.ts","sourceRoot":"","sources":["../../src/bento/bento-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,QAAQ,CAAC,eAAe,CAAC,+BAM9F"}
|
package/dist/bento/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export { BentoHeroIconPicker, type BentoHeroIconPickerProps } from './bento-hero
|
|
|
40
40
|
export { BentoInlineEdit, type BentoInlineEditProps } from './bento-inline-edit';
|
|
41
41
|
export { BentoFormHero, type BentoFormHeroProps } from './bento-form-hero';
|
|
42
42
|
export { BentoFormSection, type BentoFormSectionProps } from './bento-form-section';
|
|
43
|
+
export { BentoPanel, type BentoPanelProps } from './bento-panel';
|
|
43
44
|
export { BentoBackToTop } from './bento-back-to-top';
|
|
44
45
|
export { BentoCommandPalette, type BentoCommandPaletteProps } from './bento-command-palette';
|
|
45
46
|
export { BentoShortcutsDialog, type BentoShortcutsDialogProps } from './bento-shortcuts-dialog';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bento/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,EAAE,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACrI,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,mBAAmB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,aAAa,EACb,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,KAAK,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,KAAK,aAAa,EAClB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bento/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,EAAE,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACrI,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,aAAa,EAClB,KAAK,mBAAmB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,aAAa,EACb,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC9F,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,KAAK,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,KAAK,aAAa,EAClB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,KAAK,SAAS,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC"}
|
package/dist/bento.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./badge-locale-sIsBdP_e.cjs"),t=require("./user.context-r50nSWER.cjs"),n=require("./loading-provider-1mgM91iY.cjs");let r=require("react"),i=require("react/jsx-runtime"),a=require("@tabler/icons-react"),o=require("react-i18next"),s=require("@iconify/react"),c=require("react-router-dom"),l=require("@dnd-kit/core"),u=require("@dnd-kit/sortable"),d=require("@dnd-kit/utilities"),f=require("sonner");var p={default:``,destructive:`bento-item-danger`};function m({actions:t,triggerLabel:n}){let{t:r}=(0,o.useTranslation)();return t.length===0?null:(0,i.jsxs)(e.f,{children:[(0,i.jsx)(e.E,{asChild:!0,children:(0,i.jsx)(`button`,{type:`button`,"aria-label":n??r(`forms.formActions.moreActions`,{defaultValue:`More actions`}),className:`bento-tile-clickable inline-flex h-9 w-9 items-center justify-center rounded-full border border-border/60 bg-card/60 text-muted-foreground backdrop-blur transition-colors duration-200 hover:text-foreground`,children:(0,i.jsx)(a.IconDotsVertical,{size:18})})}),(0,i.jsx)(e.m,{align:`end`,sideOffset:8,className:`bento-dropdown min-w-44 p-1.5`,children:t.map(t=>{let n=t.icon,r=p[t.tone??`default`];return(0,i.jsxs)(e.g,{onSelect:t.onSelect,disabled:t.disabled,className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2 ${r}`,children:[(0,i.jsx)(n,{size:16}),t.label]},t.label)})})]})}var h={blue:`bento-tone-blue`,indigo:`bento-tone-indigo`,violet:`bento-tone-violet`,emerald:`bento-tone-emerald`,amber:`bento-tone-amber`,rose:`bento-tone-rose`,slate:`bento-tone-slate`},g=Object.keys(h);function _(e){return`bento-chip ${h[e]??h.slate}`}function v({to:e,icon:t,tone:n,label:r,count:a,span:o}){let s=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`span`,{className:`grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${_(n)}`,children:(0,i.jsx)(t,{size:18})}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`text-3xl font-semibold tabular-nums tracking-tight`,children:a}),(0,i.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:r})]})]}),l=`bento-tile bento-glass group relative flex flex-col justify-between overflow-hidden p-4 ${o}${e?` bento-tile-clickable`:``}`;return e?(0,i.jsx)(c.Link,{to:e,className:l,children:s}):(0,i.jsx)(`div`,{className:l,children:s})}function y({icon:t=a.IconSparkles,tone:n=`indigo`,title:r,description:o,action:s,align:c=`center`,className:l}){let u=_(n),d=c===`center`;return(0,i.jsxs)(`div`,{className:e.U(`bento-tile bento-glass flex flex-col gap-3 rounded-3xl p-8`,d?`items-center text-center`:`items-start text-left`,l),children:[(0,i.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${u} text-white shadow-md`,children:(0,i.jsx)(t,{size:24})}),(0,i.jsx)(`div`,{className:`text-lg font-semibold tracking-tight`,children:r}),o&&(0,i.jsx)(`p`,{className:e.U(`max-w-md text-sm text-muted-foreground`,d&&`mx-auto`),children:o}),s&&(0,i.jsx)(`div`,{className:e.U(`mt-1`,d&&`mx-auto`),children:s})]})}function b({to:e,children:t}){return(0,i.jsxs)(c.Link,{to:e,className:`inline-flex items-center gap-1 hover:text-foreground`,children:[(0,i.jsx)(a.IconArrowLeft,{size:14,"aria-hidden":!0}),t]})}function x({eyebrow:e,backTo:t,backLabel:n,title:r,subtitle:a,leading:o,trailing:s}){let c=e??(t==null?null:(0,i.jsx)(b,{to:t,children:n}));return(0,i.jsx)(`header`,{className:`bento-shell-header mb-6 flex flex-col items-start gap-3 md:mb-10`,children:(0,i.jsxs)(`div`,{className:`flex w-full items-start gap-4`,children:[o&&(0,i.jsx)(`div`,{className:`shrink-0`,children:o}),(0,i.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1`,children:[c&&(0,i.jsx)(`span`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:c}),(0,i.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight md:text-4xl`,children:r}),a&&(0,i.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:a})]}),s&&(0,i.jsx)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:s})]})})}function S({value:e,onChange:n,onClear:c,defaultIcon:l,tone:u,title:d,description:f,readOnly:p=!1}){let{t:m}=(0,o.useTranslation)(),[h,g]=(0,r.useState)(!1);return p?(0,i.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${_(u)} text-white shadow-md`,children:e?(0,i.jsx)(s.Icon,{icon:e,className:`size-6 text-white`}):(0,i.jsx)(l,{size:24})}):(0,i.jsxs)(`div`,{className:`group relative`,children:[(0,i.jsxs)(`button`,{type:`button`,onClick:()=>g(!0),"aria-label":m(`forms.iconPicker.chooseAnIcon`),className:`group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${_(u)} text-white shadow-md outline-none transition-all duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] hover:scale-105 focus-visible:ring-2 focus-visible:ring-ring active:scale-95`,children:[e?(0,i.jsx)(s.Icon,{icon:e,className:`size-6 text-white`}):(0,i.jsx)(l,{size:24}),(0,i.jsx)(`span`,{className:`pointer-events-none absolute inset-0 grid place-items-center bg-black/40 opacity-0 transition-opacity duration-200 group-hover/icon:opacity-100`,children:(0,i.jsx)(a.IconPalette,{className:`size-5 text-white`})})]}),e&&c&&(0,i.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},"aria-label":m(`forms.common.remove`),title:m(`forms.common.remove`),className:`absolute -right-1.5 -top-1.5 grid h-5 w-5 cursor-pointer place-items-center rounded-full border border-border/60 bg-card/90 text-foreground opacity-0 shadow-md backdrop-blur transition-opacity duration-200 bento-clear focus-visible:opacity-100 group-hover:opacity-100`,children:(0,i.jsx)(a.IconX,{size:12})}),(0,i.jsx)(t.s,{open:h,onOpenChange:g,value:e,onSelect:n,onClear:c,title:d,description:f})]})}function C({value:t,onSave:n,multiline:a=!1,placeholder:s,className:c=``,ariaLabel:l,autoFocus:u=!1,readOnly:d=!1,commitOnChange:f=!1}){let{t:p}=(0,o.useTranslation)(),[m,h]=(0,r.useState)(u),[g,_]=(0,r.useState)(t),[v,y]=(0,r.useState)(!1),b=(0,r.useRef)(null),[x,S]=(0,r.useState)(t);!m&&t!==x&&(S(t),_(t)),(0,r.useEffect)(()=>{m&&b.current&&(b.current.focus(),b.current.select())},[m]);async function C(){let e=g.trim();if(e===t){h(!1);return}if(!e&&!s){_(t),h(!1);return}y(!0);try{await n(e)}catch{_(t)}finally{y(!1),h(!1)}}function w(){_(t),h(!1)}function T(e){_(e),f&&n(e)}let E=!t;if(d)return(0,i.jsx)(`span`,{className:`block w-full ${c}`,"aria-label":l,children:t||(0,i.jsx)(`span`,{className:`text-muted-foreground/80`,children:s??`—`})});let D=`w-full bg-transparent outline-none border-b transition-colors duration-200 ${c}`,O=`${D} cursor-text rounded-sm ${E?`border-dashed border-border/70 hover:border-foreground/40`:`border-transparent hover:border-border/60 focus-visible:border-border/80`} ${v?`opacity-60`:``}`,k=`${D} bento-editing`;if(!m)return(0,i.jsx)(`button`,{type:`button`,onClick:()=>h(!0),className:`${O} text-left`,"aria-label":l??p(`forms.formActions.edit`),disabled:v,children:t||(0,i.jsx)(`span`,{className:`text-muted-foreground/80`,children:s??`—`})});function A(e){if(e.key===`Escape`){e.preventDefault(),w();return}e.key===`Enter`&&(!a||e.metaKey||e.ctrlKey)&&(e.preventDefault(),C())}return a?(0,i.jsx)(`textarea`,{ref:b,value:g,onChange:e=>T(e.target.value),onBlur:C,onKeyDown:A,placeholder:s,"aria-label":l,rows:3,className:`${k} resize-none py-0.5 leading-snug`}):(0,i.jsx)(e.l,{ref:b,value:g,onChange:e=>T(e.target.value),onBlur:C,onKeyDown:A,placeholder:s,"aria-label":l,className:`${k} h-auto px-0 py-0 shadow-none focus-visible:ring-0`})}function w({titleMissing:e,dirty:t,className:n}){let{t:r}=(0,o.useTranslation)();if(!e&&!t)return null;let s=`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium normal-case leading-none tracking-normal`;return e?(0,i.jsxs)(`span`,{className:`${s} bento-status bento-status-error ${n??``}`,children:[(0,i.jsx)(a.IconAlertTriangle,{className:`size-3`}),r(`bento.saveBar.titleRequired`,{defaultValue:`Title required`})]}):(0,i.jsxs)(`span`,{className:`${s} bento-status bento-status-warn ${n??``}`,children:[(0,i.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse`}),r(`bento.saveBar.unsaved`,{defaultValue:`Unsaved changes`})]})}function T(e){(0,r.useEffect)(()=>{let t=e.current;if(!t)return;let n=document.documentElement,r=0,i=()=>{r=0;let e=t.getBoundingClientRect().top,i=Math.max(0,Math.min(1,(160-e)/80));n.style.setProperty(`--bento-fade`,String(i)),n.classList.toggle(`bento-fade-half`,i>.5)},a=()=>{r||=requestAnimationFrame(i)};return i(),window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a),()=>{r&&cancelAnimationFrame(r),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a),n.style.removeProperty(`--bento-fade`),n.classList.remove(`bento-fade-half`)}},[e])}function E(e,t){let n={};for(let r of Object.keys(e))Object.assign(n,{[r]:t[r]});return n}function D({entity:t,isNew:s,headlineFallback:l,eyebrow:u,listRoute:d,icon:p,tone:h,formId:g,feature:_,hasStatus:v=!1,hideIcon:y=!1,readOnly:D=!1,autosaveOnly:O=!1,badge:k,notice:A,onUpdate:j,onDelete:M,extraActions:N,children:P}){let{t:F}=(0,o.useTranslation)(),I=(0,c.useNavigate)(),[L,R]=(0,r.useState)(!1),[z,B]=(0,r.useState)({isDirty:!1,isSubmitting:!1}),V=(0,r.useRef)(null);T(V);let H={title:t.title??``,description:t.description??``,icon:t.icon??null,enabled:t.enabled??1},[U,W]=(0,r.useState)(H),[G,K]=(0,r.useState)(H);(H.title!==G.title||H.description!==G.description||H.icon!==G.icon||H.enabled!==G.enabled)&&(K(H),W(H));async function q(e){if(W(t=>({...t,...e})),s||!j)return;let n=e.title??U.title;try{await j({...t,...e}),f.toast.success(F(`forms.common.updated`,{name:n,feature:_}))}catch(t){console.error(`Failed to update entity field`,t),W(t=>({...t,...E(e,H)})),f.toast.error(F(`forms.common.notUpdated`,{name:H.title||n,feature:_}))}}async function J(){if(M){try{await M()?(f.toast.success(F(`forms.common.deleted`,{name:U.title,feature:_})),I(d)):f.toast.error(F(`forms.common.notDeleted`,{name:U.title,feature:_}))}catch(e){console.error(`Failed to delete entity`,e),f.toast.error(F(`forms.common.notDeleted`,{name:U.title,feature:_}))}R(!1)}}let Y=U.enabled===1,ee=!D,te=!(O&&!s),X=!U.title.trim(),ne=!s&&!z.isDirty,re=X||ne,Z=[...N??[],...M&&!D?[{label:F(`forms.formActions.delete`),icon:a.IconTrash,tone:`destructive`,onSelect:()=>R(!0)}]:[]];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x,{eyebrow:(0,i.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,i.jsx)(b,{to:d,children:u}),!D&&(0,i.jsx)(w,{titleMissing:X,dirty:s||z.isDirty})]}),leading:(0,i.jsx)(S,{value:U.icon,onChange:e=>q({icon:e}),onClear:()=>q({icon:null}),defaultIcon:p,tone:h,title:U.title,description:U.description,readOnly:D||y}),title:(0,i.jsx)(C,{value:U.title,onSave:e=>q({title:e}),placeholder:l,className:`text-3xl font-semibold tracking-tight md:text-4xl`,ariaLabel:F(`forms.common.title`),autoFocus:s,commitOnChange:s,readOnly:D}),subtitle:(0,i.jsx)(C,{value:U.description,onSave:e=>q({description:e}),multiline:!0,placeholder:F(`forms.common.description`),className:`max-w-2xl text-sm text-muted-foreground`,ariaLabel:F(`forms.common.description`),commitOnChange:s,readOnly:D}),trailing:(0,i.jsxs)(i.Fragment,{children:[ee&&(0,i.jsxs)(`div`,{className:`bento-fade-out flex shrink-0 items-center gap-2`,children:[te&&(0,i.jsxs)(e.u,{type:`submit`,form:g,size:`sm`,loading:z.isSubmitting,disabled:re,children:[(0,i.jsx)(a.IconDeviceFloppy,{className:`size-4`}),F(`forms.formActions.saveChanges`)]}),(0,i.jsxs)(e.u,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>I(d),children:[(0,i.jsx)(a.IconX,{className:`size-4`}),F(`forms.formActions.cancel`)]})]}),k,v&&(D?(0,i.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider ${Y?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground`}`,children:[(0,i.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${Y?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),Y?F(`common.active`,{defaultValue:`Active`}):F(`common.idle`,{defaultValue:`Idle`})]}):(0,i.jsxs)(`button`,{type:`button`,onClick:()=>q({enabled:+!Y}),"aria-label":F(`forms.common.enabled`),title:F(Y?`common.activeToggleHint`:`common.idleToggleHint`),className:`bento-tile-clickable flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider transition-colors duration-200 ${Y?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground hover:bg-muted/80`}`,children:[(0,i.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${Y?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),Y?F(`common.active`,{defaultValue:`Active`}):F(`common.idle`,{defaultValue:`Idle`})]})),!s&&Z.length>0&&(0,i.jsx)(m,{actions:Z})]})}),(0,i.jsx)(`div`,{ref:V,"aria-hidden":!0,className:`h-px`}),A,!s&&M&&(0,i.jsx)(n.i,{feature:_,name:U.title,onDelete:J,open:L,setOpen:R,trigger:(0,i.jsx)(`span`,{className:`hidden`,"aria-hidden":!0})}),P({staged:U,onStateChange:B})]})}var O={LARGE:`col-span-2 row-span-2 md:col-span-2 md:row-span-2 lg:col-span-2 lg:row-span-2`,MEDIUM:`col-span-2 row-span-1 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1`,SMALL:`col-span-1 row-span-1`},k={SMALL:`MEDIUM`,MEDIUM:`LARGE`,LARGE:`SMALL`};function A(e,t,n){if(!n||n.length===0)return e.map((e,n)=>({item:e,key:t(e),emphasis:n===0?`LARGE`:`MEDIUM`}));let r=new Map,i=new Map;for(let e of n)r.set(e.itemId,e.displayOrder),i.set(e.itemId,e.emphasis);return e.map((e,n)=>({item:e,key:t(e),idx:n})).sort((e,t)=>{let n=r.has(e.key)?r.get(e.key):2**53-1,i=r.has(t.key)?r.get(t.key):2**53-1;return n===i?e.idx-t.idx:n-i}).map(({item:e,key:t})=>({item:e,key:t,emphasis:i.get(t)??`MEDIUM`}))}function j(e){return e.map((e,t)=>({itemId:e.key,emphasis:e.emphasis,displayOrder:t}))}function M({to:e,emphasis:t,featured:n,defaultIcon:r,icon:a,tone:l=`indigo`,title:u,description:d,meta:f,enabled:p,hasStatus:m=!1,viewTransitionName:h}){let{t:g}=(0,o.useTranslation)(),v=_(l),y=t??(n?`LARGE`:`MEDIUM`),b=y===`LARGE`,x=y===`SMALL`,S=O[y],C=p===1,w=b?`p-6 md:p-7`:x?`p-4`:`p-5`,T=b?`h-14 w-14`:x?`h-8 w-8`:`h-9 w-9`,E=b?28:x?16:18,D=b?`text-xl md:text-2xl`:x?`text-sm`:`text-base md:text-lg`;return(0,i.jsxs)(c.Link,{to:e,className:`bento-tile bento-tile-clickable bento-glass group relative flex flex-col ${b?`gap-5`:`gap-4`} overflow-hidden ${w} ${S}`,style:h?{viewTransitionName:h}:void 0,children:[b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${v} opacity-40 blur-2xl dark:opacity-50`}),(0,i.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${v} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`})]}),(0,i.jsxs)(`div`,{className:`relative z-1 flex items-center justify-between`,children:[(0,i.jsx)(`span`,{className:`grid place-items-center rounded-2xl ${v} text-white shadow-md ${T}`,children:a?(0,i.jsx)(s.Icon,{icon:a,className:b?`size-7 text-white`:`size-4.5 text-white`}):(0,i.jsx)(r,{size:E})}),m&&(0,i.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wider ${C?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground`}`,children:[(0,i.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${C?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),C?g(`common.active`,{defaultValue:`Active`}):g(`common.idle`,{defaultValue:`Idle`})]})]}),(0,i.jsxs)(`div`,{className:`relative z-1`,children:[(0,i.jsx)(`div`,{className:`font-semibold tracking-tight ${D}`,children:u}),!x&&f&&(0,i.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:f}),!x&&d&&(0,i.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:d})]})]})}var N=`bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6`;function P({items:e,error:s,tryAgainUrl:c,listId:l,eyebrow:u,backTo:d,backLabel:f,heroIcon:p,title:m,subtitle:h,tone:g=`indigo`,headerAction:v,newRoute:y,newLabel:b,newSubtitle:S,hideNew:C=!1,itemKey:w,renderTile:T,emptyTitle:E,emptyDescription:D,layout:O}){let{t:k}=(0,o.useTranslation)(),j=_(g),[M,N]=(0,r.useState)(!1),P=(0,r.useMemo)(()=>A(e??[],w,O?.data?.entries),[e,w,O?.data?.entries]),F=!!l&&!!O&&(e?.length??0)>0;return(0,i.jsxs)(n.t,{checkIsNotUndefined:e,error:s??null,tryAgainUrl:c,children:[(0,i.jsx)(x,{eyebrow:u,backTo:d,backLabel:f,leading:(0,i.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${j} text-white shadow-md`,children:(0,i.jsx)(p,{size:24})}),title:m,subtitle:h}),(v||F&&!M)&&(0,i.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[v,F&&!M&&(0,i.jsxs)(t.c,{variant:`outline`,size:`sm`,onClick:()=>N(!0),className:`ml-auto gap-2`,children:[(0,i.jsx)(a.IconAdjustmentsHorizontal,{size:16}),k(`bento.layout.customize`,{defaultValue:`Customize layout`})]})]}),M&&l&&O?(0,i.jsx)(L,{layout:O,resolved:P,canEditGlobal:O?.data?.canEditGlobal??!1,isCustomized:O?.data?.source===`USER`,renderTile:T,chip:j,hideNew:C,newRoute:y,newLabel:b,newSubtitle:S,onClose:()=>N(!1)}):(0,i.jsx)(I,{resolved:P,renderTile:T,chip:j,hideNew:C,newRoute:y,newLabel:b,newSubtitle:S,isEmpty:e?.length===0,emptyTitle:E,emptyDescription:D})]})}function F({items:e,error:t,tryAgainUrl:r,tone:a=`indigo`,newRoute:o,newLabel:s,newSubtitle:c,hideNew:l=!1,itemKey:u,renderTile:d,emptyTitle:f,emptyDescription:p}){let m=_(a);return(0,i.jsx)(n.t,{checkIsNotUndefined:e,error:t??null,tryAgainUrl:r,children:(0,i.jsxs)(`div`,{className:N,children:[!l&&o&&s?(0,i.jsx)(V,{route:o,label:s,subtitle:c,chip:m}):null,(e??[]).map(e=>(0,i.jsx)(`span`,{className:`contents`,children:d(e)},u(e))),e?.length===0&&(0,i.jsx)(H,{title:f,description:p})]})})}function I({resolved:t,renderTile:n,chip:r,hideNew:a,newRoute:o,newLabel:s,newSubtitle:c,isEmpty:l,emptyTitle:u,emptyDescription:d}){let f=t.some(e=>e.emphasis===`SMALL`);return(0,i.jsxs)(`div`,{className:e.U(N,f&&`grid-flow-dense`),children:[!a&&(0,i.jsx)(V,{route:o,label:s,subtitle:c,chip:r}),t.map(({item:e,key:t,emphasis:r})=>(0,i.jsx)(`span`,{className:`contents`,children:n(e,r)},t)),l&&(0,i.jsx)(H,{title:u,description:d})]})}function L({layout:n,resolved:s,canEditGlobal:c,isCustomized:d,renderTile:f,chip:p,hideNew:m,newRoute:h,newLabel:g,newSubtitle:_,onClose:v}){let{t:y}=(0,o.useTranslation)(),[b,x]=(0,r.useState)(s),S=n.saving??!1,[C,w]=(0,r.useState)(!1),T=e=>async()=>{if(e){w(!1);try{await e(),v()}catch(e){console.error(`Failed to save the bento layout`,e),w(!0)}}},E=(0,l.useSensors)((0,l.useSensor)(l.PointerSensor,{activationConstraint:{distance:8}}),(0,l.useSensor)(l.KeyboardSensor));function D(e){let{active:t,over:n}=e;!n||t.id===n.id||x(e=>{let r=e.findIndex(e=>e.key===t.id),i=e.findIndex(e=>e.key===n.id);return r<0||i<0?e:(0,u.arrayMove)(e,r,i)})}function O(e,t){x(n=>n.map(n=>n.key===e?{...n,emphasis:t}:n))}let k=(0,r.useMemo)(()=>j(b),[b]),A=b.some(e=>e.emphasis===`SMALL`);return(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2 rounded-2xl border border-border/60 bg-card/40 p-3 backdrop-blur-md`,children:[(0,i.jsx)(`span`,{className:`mr-auto text-sm text-muted-foreground`,children:y(`bento.layout.editHint`,{defaultValue:`Drag tiles to reorder · tap the size button to resize`})}),d&&n.onReset&&(0,i.jsxs)(t.c,{variant:`ghost`,size:`sm`,className:`gap-2`,disabled:S,onClick:T(n.onReset),children:[(0,i.jsx)(a.IconArrowBackUp,{size:16}),y(`bento.layout.reset`,{defaultValue:`Reset to default`})]}),c&&n.onSaveGlobal&&(0,i.jsxs)(t.c,{variant:`outline`,size:`sm`,className:`gap-2`,disabled:S,onClick:T(()=>n.onSaveGlobal?.(k)),children:[(0,i.jsx)(a.IconUsers,{size:16}),y(`bento.layout.saveGlobal`,{defaultValue:`Set as default for everyone`})]}),(0,i.jsxs)(t.c,{variant:`ghost`,size:`sm`,className:`gap-2`,disabled:S,onClick:v,children:[(0,i.jsx)(a.IconX,{size:16}),y(`common.cancel`,{defaultValue:`Cancel`})]}),(0,i.jsxs)(t.c,{size:`sm`,className:`gap-2`,disabled:S,onClick:T(()=>n.onSave(k)),children:[(0,i.jsx)(a.IconDeviceFloppy,{size:16}),y(`bento.layout.save`,{defaultValue:`Save layout`})]}),C&&(0,i.jsx)(`p`,{role:`alert`,className:`w-full text-sm text-destructive`,children:y(`bento.layout.saveFailed`,{defaultValue:`The layout could not be saved. Nothing has changed — try again.`})})]}),(0,i.jsx)(l.DndContext,{sensors:E,collisionDetection:l.closestCenter,onDragEnd:D,children:(0,i.jsx)(u.SortableContext,{items:b.map(e=>e.key),strategy:u.rectSortingStrategy,children:(0,i.jsxs)(`div`,{className:e.U(N,A&&`grid-flow-dense`),children:[!m&&(0,i.jsx)(V,{route:h,label:g,subtitle:_,chip:p}),b.map(({item:e,key:t,emphasis:n})=>(0,i.jsx)(B,{id:t,emphasis:n,onSetEmphasis:e=>O(t,e),children:f(e,n)},t))]})})})]})}var R=[`SMALL`,`MEDIUM`,`LARGE`],z={SMALL:{key:`bento.layout.size.small`,def:`Small`},MEDIUM:{key:`bento.layout.size.medium`,def:`Medium`},LARGE:{key:`bento.layout.size.large`,def:`Large`}};function B({id:t,emphasis:n,onSetEmphasis:r,children:s}){let{t:c}=(0,o.useTranslation)(),{attributes:l,listeners:f,setNodeRef:p,transform:m,transition:h,isDragging:g}=(0,u.useSortable)({id:t}),_={transform:d.CSS.Translate.toString(m),transition:h,opacity:g?.6:1,zIndex:g?50:void 0};return(0,i.jsxs)(`div`,{ref:p,style:_,className:e.U(`relative h-full`,O[n]),children:[(0,i.jsx)(`div`,{className:`pointer-events-none h-full select-none [&>*]:h-full [&>*]:w-full`,children:s}),(0,i.jsxs)(`div`,{className:`absolute right-2 top-2 z-10 flex items-center gap-1`,children:[(0,i.jsx)(`div`,{role:`group`,"aria-label":c(`bento.layout.sizeGroup`,{defaultValue:`Tile size`}),className:`flex items-center gap-0.5 rounded-full border border-border/60 bg-background/80 p-0.5 shadow-sm backdrop-blur`,children:R.map(t=>{let a=t===n,o=c(z[t].key,{defaultValue:z[t].def});return(0,i.jsx)(`button`,{type:`button`,onClick:()=>r(t),"aria-pressed":a,"aria-label":o,title:o,className:e.U(`grid h-6 w-6 place-items-center rounded-full text-[11px] font-semibold uppercase transition-colors`,a?`bg-primary text-primary-foreground shadow`:`text-muted-foreground hover:bg-muted`),children:o.charAt(0)},t)})}),(0,i.jsx)(`button`,{type:`button`,...l,...f,"aria-label":c(`bento.layout.dragToReorder`,{defaultValue:`Drag to reorder`}),className:`grid h-7 w-7 cursor-grab place-items-center rounded-full border border-border/60 bg-background/80 shadow-sm backdrop-blur hover:bg-background active:cursor-grabbing`,children:(0,i.jsx)(a.IconGripVertical,{size:14,className:`text-muted-foreground`})})]})]})}function V({route:e,label:t,subtitle:n,chip:r}){let{t:s}=(0,o.useTranslation)();return(0,i.jsxs)(c.Link,{to:e,className:`bento-tile bento-tile-clickable col-span-2 row-span-1 flex flex-col gap-3 rounded-3xl border-2 border-dashed border-border/60 bg-card/30 p-5 backdrop-blur-md bento-new-tile hover:bg-card/50 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,i.jsx)(`span`,{className:`bento-pulse grid h-10 w-10 place-items-center rounded-2xl ${r} text-white shadow-md`,children:(0,i.jsx)(a.IconPlus,{size:20})}),(0,i.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:s(`forms.formActions.new`,{defaultValue:`New`})})]}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`text-base font-semibold tracking-tight md:text-lg`,children:(0,i.jsx)(`span`,{className:`${r} bg-clip-text text-transparent`,children:t})}),n&&(0,i.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n})]})]})}function H({title:e,description:t}){return(0,i.jsx)(y,{icon:a.IconSparkles,title:e,description:t,align:`start`,className:`col-span-2 row-span-2 justify-end md:col-span-4`})}function U({title:t,badges:n,actions:r,onCancel:s,loading:c,disabled:l,dirty:u,titleMissing:d}){let{t:f}=(0,o.useTranslation)();return(0,i.jsxs)(`div`,{className:`bento-glass flex items-center justify-between gap-4 rounded-2xl px-4 py-3 shadow-md backdrop-blur-xl`,children:[(0,i.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[t&&(0,i.jsx)(`p`,{className:`truncate text-base font-semibold tracking-tight md:text-lg`,children:t}),(0,i.jsx)(w,{titleMissing:d,dirty:u}),n&&(0,i.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:n})]}),(0,i.jsx)(`div`,{className:`flex shrink-0 gap-2`,children:r??(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(e.u,{type:`submit`,size:`sm`,loading:c,disabled:l,children:[(0,i.jsx)(a.IconDeviceFloppy,{className:`size-4`}),f(`forms.formActions.saveChanges`)]}),s&&(0,i.jsxs)(e.u,{type:`button`,variant:`outline`,size:`sm`,onClick:s,children:[(0,i.jsx)(a.IconX,{className:`size-4`}),f(`forms.formActions.cancel`)]})]})})]})}function W({children:e}){return(0,i.jsx)(`span`,{className:`rounded-full border border-border/60 bg-card/50 px-2 py-0.5 text-[10px] uppercase tracking-wider text-muted-foreground backdrop-blur`,children:e})}U.Badge=W;function G(e){let t=(0,r.useRef)(null);return T(t),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{ref:t,"aria-hidden":!0,className:`h-px`}),(0,i.jsx)(`div`,{"aria-hidden":!0,className:`bento-save-bar-spacer`}),(0,i.jsx)(`div`,{className:`bento-fade-in fixed inset-x-0 top-20 z-20 mx-auto w-full max-w-7xl px-4 md:px-8`,children:(0,i.jsx)(U,{...e})})]})}function K({eyebrow:t,backTo:n,backLabel:r,leading:s,title:c,subtitle:l,trailing:u,onCancel:d,actions:f,loading:p,dirty:m,titleMissing:h,saveDisabled:g,stickyTitle:_,stickyBadges:v}){let{t:y}=(0,o.useTranslation)(),S=g??(!!h||!m);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x,{eyebrow:n===void 0?t:(0,i.jsx)(b,{to:n,children:r}),leading:s,title:c,subtitle:l,trailing:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{className:`bento-fade-out flex shrink-0 items-center gap-2`,children:f??(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(e.u,{type:`submit`,size:`sm`,loading:p,disabled:S,children:[(0,i.jsx)(a.IconDeviceFloppy,{className:`size-4`}),y(`forms.formActions.saveChanges`)]}),(0,i.jsxs)(e.u,{type:`button`,variant:`outline`,size:`sm`,onClick:d,children:[(0,i.jsx)(a.IconX,{className:`size-4`}),y(`forms.formActions.cancel`)]})]})}),u]})}),(0,i.jsx)(G,{title:_,badges:v,actions:f,onCancel:d,loading:p,disabled:S,dirty:m,titleMissing:h})]})}function q({icon:e,tone:t,title:n,description:r,children:a,trailing:o,as:s=`h2`}){return(0,i.jsxs)(`section`,{className:`bento-tile bento-glass relative flex flex-col gap-5 overflow-hidden rounded-3xl p-5 md:p-6`,children:[(0,i.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,i.jsx)(`span`,{className:`grid h-10 w-10 place-items-center rounded-2xl text-white shadow-md ${_(t)}`,children:(0,i.jsx)(e,{size:20})}),(0,i.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,i.jsx)(s,{className:`text-base font-semibold tracking-tight md:text-lg`,children:n}),r&&(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r})]})]}),o&&(0,i.jsx)(`div`,{className:`shrink-0`,children:o})]}),(0,i.jsx)(`div`,{className:`flex flex-col gap-5`,children:a})]})}var J=480;function Y(e){return window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)}function ee(){return window.scrollY>J}function te(){let e=(0,r.useSyncExternalStore)(Y,ee,()=>!1);return(0,i.jsx)(`button`,{type:`button`,"aria-label":`Back to top`,tabIndex:e?0:-1,onClick:()=>window.scrollTo({top:0,behavior:`smooth`}),className:`fixed bottom-6 right-6 z-40 grid h-11 w-11 place-items-center rounded-full border border-border/60 bg-card/80 text-foreground shadow-lg backdrop-blur-xl transition-all duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] hover:-translate-y-0.5 hover:shadow-xl active:scale-95 ${e?`translate-y-0 scale-100 opacity-100`:`pointer-events-none translate-y-4 scale-90 opacity-0`}`,children:(0,i.jsx)(a.IconArrowUp,{size:18})})}function X(e){return e.bentoRoute??e.fallbackRoute}function ne({open:t,onOpenChange:n,items:s}){let{t:l}=(0,o.useTranslation)(),u=(0,c.useNavigate)(),[d,f]=(0,r.useState)(``),[p,m]=(0,r.useState)(0),h=(0,r.useRef)(null),g=(0,r.useMemo)(()=>{let e=d.trim().toLowerCase(),t=s.map(e=>({item:e,label:l(e.titleKey),description:l(e.descriptionKey)}));if(!e)return t;let n=[],r=[];for(let i of t)i.label.toLowerCase().includes(e)?n.push(i):i.description.toLowerCase().includes(e)&&r.push(i);return[...n,...r]},[s,d,l]),[_,v]=(0,r.useState)(t);t!==_&&(v(t),t&&(f(``),m(0)));let y=g.length===0?0:g.length-1;p>y&&m(y),(0,r.useEffect)(()=>{(h.current?.querySelector(`[data-index="${p}"]`))?.scrollIntoView({block:`nearest`})},[p]);function b(e){n(!1),u(X(e))}function x(e){if(e.key===`ArrowDown`)e.preventDefault(),m(e=>g.length===0?0:(e+1)%g.length);else if(e.key===`ArrowUp`)e.preventDefault(),m(e=>g.length===0?0:(e-1+g.length)%g.length);else if(e.key===`Enter`){e.preventDefault();let t=g[p];t&&b(t.item)}}return(0,i.jsx)(e.D,{open:t,onOpenChange:n,children:(0,i.jsxs)(e.k,{showCloseButton:!1,className:`top-[15%] max-w-xl translate-y-0 gap-0 overflow-hidden p-0`,onKeyDown:x,children:[(0,i.jsx)(e.F,{className:`sr-only`,children:l(`bento.palette.title`,{defaultValue:`Command palette`})}),(0,i.jsx)(e.A,{className:`sr-only`,children:l(`bento.palette.description`,{defaultValue:`Search and jump to any area`})}),(0,i.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border/60 px-4`,children:[(0,i.jsx)(a.IconSearch,{size:18,className:`shrink-0 text-muted-foreground`}),(0,i.jsx)(`input`,{autoFocus:!0,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":`bento-palette-list`,"aria-activedescendant":g[p]?`bento-palette-opt-${p}`:void 0,value:d,onChange:e=>f(e.target.value),placeholder:l(`bento.palette.placeholder`,{defaultValue:`Search areas…`}),className:`h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,i.jsxs)(`div`,{ref:h,id:`bento-palette-list`,role:`listbox`,"aria-label":l(`bento.palette.title`,{defaultValue:`Command palette`}),className:`max-h-80 overflow-y-auto p-2`,children:[g.length===0&&(0,i.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:l(`bento.palette.noResults`,{defaultValue:`No matches`})}),g.map(({item:e,label:t},n)=>{let r=!e.bentoRoute,o=n===p,s=e.icon;return(0,i.jsxs)(`button`,{type:`button`,id:`bento-palette-opt-${n}`,"data-index":n,role:`option`,"aria-selected":o?`true`:`false`,onMouseEnter:()=>m(n),onClick:()=>b(e),className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${o?`bg-accent text-accent-foreground`:`text-foreground`}`,children:[(0,i.jsx)(s,{size:18,className:`shrink-0 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`flex-1 truncate`,children:t}),r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.IconExternalLink,{"aria-hidden":!0,size:15,className:`shrink-0 text-muted-foreground/70`}),(0,i.jsx)(`span`,{className:`sr-only`,children:l(`bento.palette.opensConsole`,{defaultValue:`Opens in console`})})]}):o&&(0,i.jsx)(a.IconArrowRight,{"aria-hidden":!0,size:15,className:`shrink-0 text-muted-foreground`})]},e.id)})]})]})})}function re({open:t,onOpenChange:n,isMac:r}){let{t:s}=(0,o.useTranslation)(),c=r?`⌘`:`Ctrl`,l=[{heading:s(`bento.shortcuts.global`,{defaultValue:`Global`}),rows:[{keys:[c,`K`],label:s(`bento.palette.open`,{defaultValue:`Open command palette`})},{keys:[`?`],label:s(`bento.shortcuts.openGuide`,{defaultValue:`Show keyboard shortcuts`})}]},{heading:s(`bento.shortcuts.palette`,{defaultValue:`Command palette`}),rows:[{keys:[`↑`,`↓`],label:s(`bento.shortcuts.navigate`,{defaultValue:`Move between results`})},{keys:[`↵`],label:s(`bento.shortcuts.openSelected`,{defaultValue:`Open the selected area`})},{keys:[`Esc`],label:s(`bento.shortcuts.dismiss`,{defaultValue:`Close the palette or a dialog`})}]}];return(0,i.jsx)(e.D,{open:t,onOpenChange:n,children:(0,i.jsxs)(e.k,{className:`max-w-md`,children:[(0,i.jsxs)(e.M,{children:[(0,i.jsxs)(e.F,{className:`flex items-center gap-2`,children:[(0,i.jsx)(a.IconKeyboard,{size:20,className:`bento-accent-icon`}),s(`bento.shortcuts.title`,{defaultValue:`Keyboard shortcuts`})]}),(0,i.jsx)(e.A,{children:s(`bento.shortcuts.description`,{defaultValue:`Move around Turing without leaving the keyboard.`})})]}),(0,i.jsx)(`div`,{className:`flex flex-col gap-5`,children:l.map(e=>(0,i.jsxs)(`section`,{children:[(0,i.jsx)(`h3`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e.heading}),(0,i.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.rows.map(e=>(0,i.jsxs)(`li`,{className:`flex items-center justify-between gap-4`,children:[(0,i.jsx)(`span`,{className:`text-sm text-foreground`,children:e.label}),(0,i.jsx)(`span`,{className:`flex shrink-0 items-center gap-1`,children:e.keys.map(e=>(0,i.jsx)(`kbd`,{className:`inline-flex min-w-6 items-center justify-center rounded-md border border-border/60 bg-muted px-1.5 py-0.5 text-[11px] font-medium tracking-wide`,children:e},e))})]},e.label))})]},e.heading))})]})})}function Z(e,t){return e===t||e.startsWith(`${t}/`)}function ie(e,t){return t.section.areaRoute&&Z(e,t.section.areaRoute)?!0:t.items.some(t=>t.bentoRoute&&Z(e,t.bentoRoute))}function ae({groups:t,homeRoute:n,homeAliases:s,homeLabel:l}){let{t:u}=(0,o.useTranslation)(),{pathname:d}=(0,c.useLocation)(),f=(0,r.useMemo)(()=>t.filter(e=>e.section.areaRoute),[t]),p=d===n||(s?.includes(d)??!1);return(0,i.jsx)(e.o,{delayDuration:200,children:(0,i.jsxs)(`nav`,{"aria-label":u(`bento.nav.label`,{defaultValue:`Primary`}),className:`fixed inset-y-0 left-0 z-40 hidden w-16 flex-col items-center gap-1 overflow-y-auto overflow-x-hidden border-r border-border/40 bg-background/55 pt-20 pb-4 backdrop-blur-xl backdrop-saturate-150 md:flex`,children:[(0,i.jsx)(oe,{to:n,icon:a.IconHome,label:l??u(`home.title`,{defaultValue:`Home`}),active:p}),f.length>0&&(0,i.jsx)(`span`,{"aria-hidden":!0,className:`my-1 h-px w-6 bg-border/60`}),f.map(e=>(0,i.jsx)(oe,{to:e.section.areaRoute,icon:e.section.icon,label:u(e.section.labelKey),active:ie(d,e)},e.section.id))]})})}function oe({to:t,icon:n,label:r,active:a}){return(0,i.jsxs)(e.i,{children:[(0,i.jsx)(e.s,{asChild:!0,children:(0,i.jsx)(c.Link,{to:t,"aria-label":r,"aria-current":a?`page`:void 0,className:`bento-tile-clickable grid h-11 w-11 shrink-0 place-items-center rounded-2xl border transition-colors duration-200 ${a?`bento-rail-active`:`border-transparent text-muted-foreground hover:border-border/60 hover:bg-card/60 hover:text-foreground`}`,children:(0,i.jsx)(n,{size:20})})}),(0,i.jsx)(e.a,{side:`right`,children:r})]})}function se({accountRoute:n,logoutUrl:r,organizationsRoute:s,tenantAdminRoute:l,onOpenShortcuts:u,onReplayTour:d}){let{user:f,status:p}=t.n(),{t:m}=(0,o.useTranslation)(),h=(0,c.useNavigate)(),g=`${f.firstName??``} ${f.lastName??``}`.trim()||f.username||``;return p===`loading`?(0,i.jsx)(`div`,{className:`h-9 w-9 rounded-full bg-muted/40`,"aria-hidden":!0}):(0,i.jsxs)(e.f,{children:[(0,i.jsx)(e.E,{asChild:!0,children:(0,i.jsx)(`button`,{type:`button`,title:g||f.username,className:`bento-tile-clickable cursor-pointer rounded-full p-0.5 ring-1 ring-border/60 outline-none transition-shadow duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] bento-ring hover:ring-2 focus-visible:ring-2 focus-visible:ring-ring`,children:(0,i.jsx)(t.r,{givenName:f.firstName,familyName:f.lastName,name:g||f.username,src:f.avatarUrl||void 0,alt:f.username})})}),(0,i.jsxs)(e.m,{align:`end`,sideOffset:10,className:`bento-dropdown min-w-64 p-2`,children:[(0,i.jsx)(e._,{className:`p-0 font-normal`,children:(0,i.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl px-2 py-2 text-left text-sm`,children:[(0,i.jsx)(`span`,{className:`rounded-full p-0.5 ring-1 ring-border/60`,children:(0,i.jsx)(t.r,{givenName:f.firstName,familyName:f.lastName,name:g||f.username,src:f.avatarUrl||void 0,alt:f.username})}),(0,i.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[g&&(0,i.jsx)(`span`,{className:`truncate font-medium`,children:g}),f.email&&(0,i.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:f.email})]})]})}),(0,i.jsx)(e.x,{className:`my-1.5 bg-border/50`}),(0,i.jsxs)(e.h,{children:[(0,i.jsxs)(e.g,{onSelect:()=>h(n),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(a.IconUserCircle,{size:18}),m(`nav.account`)]}),s&&(0,i.jsxs)(e.g,{onSelect:()=>h(s),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(a.IconBuildingCommunity,{size:18}),m(`nav.organizations`,{defaultValue:`Organizations`})]}),l&&(0,i.jsxs)(e.g,{onSelect:()=>h(l),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(a.IconBuildingSkyscraper,{size:18}),m(`nav.tenantAdmin`,{defaultValue:`Tenant administration`})]})]}),(u||d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.x,{className:`my-1.5 bg-border/50`}),(0,i.jsxs)(e.h,{children:[d&&(0,i.jsxs)(e.g,{onSelect:()=>d(),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(a.IconSparkles,{size:18}),m(`bento.tour.replay`,{defaultValue:`Take the tour`})]}),u&&(0,i.jsxs)(e.g,{onSelect:()=>u(),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(a.IconKeyboard,{size:18}),m(`bento.shortcuts.title`,{defaultValue:`Keyboard shortcuts`})]})]})]}),(0,i.jsx)(e.x,{className:`my-1.5 bg-border/50`}),(0,i.jsxs)(e.g,{onSelect:()=>{globalThis.location.href=r},className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2 bento-item-danger`,children:[(0,i.jsx)(a.IconLogout,{size:18}),m(`nav.logOut`)]})]})]})}var Q=(0,r.createContext)(`console`);function ce({chrome:e,children:t}){return(0,i.jsx)(Q.Provider,{value:e,children:t})}function le(){return(0,r.useContext)(Q)}var ue={blue:`blue`,violet:`violet`,emerald:`emerald`,amber:`amber`,rose:`rose`,slate:`slate`,cyan:`blue`,orange:`amber`};function $({variant:e=`blue`,defaultOpen:n,className:a,children:o}){let s=(0,r.useContext)(Q),c,l;return s===`bento`&&r.Children.forEach(o,e=>{if(!(0,r.isValidElement)(e))return;let{type:n}=e;n===t.o.Header||n===t.o.StaticHeader?c=e.props:n===t.o.Content&&(l=e.props.children)}),s===`bento`&&c?(0,i.jsx)(q,{icon:c.icon,tone:ue[e]??`blue`,title:c.title,description:c.description,children:l}):(0,i.jsx)(t.o,{variant:e,defaultOpen:n,className:a,children:o})}$.Header=t.o.Header,$.StaticHeader=t.o.StaticHeader,$.Content=t.o.Content;var de=`bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6`;function fe({eyebrow:e,title:t,description:n,titleHref:r,children:o,gridClassName:s=de}){let l=(0,i.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight md:text-2xl`,children:t});return(0,i.jsxs)(`section`,{className:`mb-8 md:mb-10`,children:[(0,i.jsxs)(`header`,{className:`bento-shell-header mb-4 flex flex-col gap-0.5`,children:[e&&(0,i.jsx)(`span`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:e}),r?(0,i.jsxs)(c.Link,{to:r,className:`group inline-flex w-fit items-center gap-1 text-foreground transition-colors hover:text-primary`,children:[l,(0,i.jsx)(a.IconChevronRight,{size:20,className:`text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1`})]}):l,n&&(0,i.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:n})]}),(0,i.jsx)(`div`,{className:s,children:o})]})}function pe({to:e,onClick:t,disabled:n=!1,disabledHint:r,icon:o,tone:s,eyebrow:l,title:u,span:d,featured:f=!1,children:p}){let m=!n&&!!(e||t),h=f?`h-14 w-14 rounded-2xl`:`h-9 w-9 rounded-2xl`,g=f?28:18,v=f?`text-xl font-semibold tracking-tight md:text-2xl`:`text-base font-semibold tracking-tight md:text-lg`,y=(0,i.jsxs)(i.Fragment,{children:[f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${_(s)} opacity-40 blur-2xl dark:opacity-50`}),(0,i.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${_(s)} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`})]}),(0,i.jsxs)(`div`,{className:`relative z-1 flex items-center justify-between`,children:[(0,i.jsx)(`span`,{className:`grid place-items-center ${_(s)} text-white shadow-md ${h}`,children:(0,i.jsx)(o,{size:g})}),m&&(0,i.jsx)(a.IconChevronRight,{size:f?18:16,className:`text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1`})]}),(0,i.jsxs)(`div`,{className:`relative z-1`,children:[(0,i.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:l}),(0,i.jsx)(`div`,{className:`mt-0.5 ${v}`,children:u}),p&&(0,i.jsx)(`div`,{className:`mt-2`,children:p})]})]}),b=`bento-tile bento-glass group relative flex flex-col ${f?`gap-5`:`gap-4`} overflow-hidden text-left ${f?`p-6 md:p-7`:`p-5`} ${d}${m?` bento-tile-clickable`:``}${n?` cursor-not-allowed opacity-60`:``}`;return n?(0,i.jsx)(`div`,{className:b,"aria-disabled":`true`,title:r,children:y}):e?(0,i.jsx)(c.Link,{to:e,className:b,children:y}):t?(0,i.jsx)(`button`,{type:`button`,onClick:t,className:`${b} w-full`,children:y}):(0,i.jsx)(`div`,{className:b,children:y})}exports.AdaptiveSectionCard=$,exports.BENTO_EMPHASIS_NEXT=k,exports.BENTO_EMPHASIS_SPAN=O,exports.BENTO_TONES=g,exports.BENTO_TONE_CLASS=h,exports.BentoActionsMenu=m,exports.BentoBackLink=b,exports.BentoBackToTop=te,exports.BentoCommandPalette=ne,exports.BentoCountTile=v,exports.BentoEmptyState=y,exports.BentoEntityShell=D,exports.BentoEntityTile=M,exports.BentoFormHero=K,exports.BentoFormSection=q,exports.BentoHero=x,exports.BentoHeroIconPicker=S,exports.BentoInlineEdit=C,exports.BentoListPage=P,exports.BentoNavRail=ae,exports.BentoSaveBar=U,exports.BentoScrollSaveBar=G,exports.BentoSection=fe,exports.BentoShortcutsDialog=re,exports.BentoStatusMarker=w,exports.BentoTile=pe,exports.BentoTileGrid=F,exports.BentoUserMenu=se,exports.SectionCardChromeProvider=ce,exports.bentoChipClass=_,exports.bentoNavTarget=X,exports.resolveBentoLayout=A,exports.toBentoLayoutEntries=j,exports.useBentoScrollFade=T,exports.useSectionChrome=le;
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./badge-locale-sIsBdP_e.cjs"),t=require("./user.context-r50nSWER.cjs"),n=require("./loading-provider-1mgM91iY.cjs");let r=require("react"),i=require("react/jsx-runtime"),a=require("@tabler/icons-react"),o=require("react-i18next"),s=require("@iconify/react"),c=require("react-router-dom"),l=require("@dnd-kit/core"),u=require("@dnd-kit/sortable"),d=require("@dnd-kit/utilities"),f=require("sonner");var p={default:``,destructive:`bento-item-danger`};function m({actions:t,triggerLabel:n}){let{t:r}=(0,o.useTranslation)();return t.length===0?null:(0,i.jsxs)(e.f,{children:[(0,i.jsx)(e.E,{asChild:!0,children:(0,i.jsx)(`button`,{type:`button`,"aria-label":n??r(`forms.formActions.moreActions`,{defaultValue:`More actions`}),className:`bento-tile-clickable inline-flex h-9 w-9 items-center justify-center rounded-full border border-border/60 bg-card/60 text-muted-foreground backdrop-blur transition-colors duration-200 hover:text-foreground`,children:(0,i.jsx)(a.IconDotsVertical,{size:18})})}),(0,i.jsx)(e.m,{align:`end`,sideOffset:8,className:`bento-dropdown min-w-44 p-1.5`,children:t.map(t=>{let n=t.icon,r=p[t.tone??`default`];return(0,i.jsxs)(e.g,{onSelect:t.onSelect,disabled:t.disabled,className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2 ${r}`,children:[(0,i.jsx)(n,{size:16}),t.label]},t.label)})})]})}var h={blue:`bento-tone-blue`,indigo:`bento-tone-indigo`,violet:`bento-tone-violet`,emerald:`bento-tone-emerald`,amber:`bento-tone-amber`,rose:`bento-tone-rose`,slate:`bento-tone-slate`},g=Object.keys(h);function _(e){return`bento-chip ${h[e]??h.slate}`}function v({to:e,icon:t,tone:n,label:r,count:a,span:o}){let s=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`span`,{className:`grid h-9 w-9 place-items-center rounded-2xl text-white shadow-md ${_(n)}`,children:(0,i.jsx)(t,{size:18})}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`text-3xl font-semibold tabular-nums tracking-tight`,children:a}),(0,i.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:r})]})]}),l=`bento-tile bento-glass group relative flex flex-col justify-between overflow-hidden p-4 ${o}${e?` bento-tile-clickable`:``}`;return e?(0,i.jsx)(c.Link,{to:e,className:l,children:s}):(0,i.jsx)(`div`,{className:l,children:s})}function y({icon:t=a.IconSparkles,tone:n=`indigo`,title:r,description:o,action:s,align:c=`center`,className:l}){let u=_(n),d=c===`center`;return(0,i.jsxs)(`div`,{className:e.U(`bento-tile bento-glass flex flex-col gap-3 rounded-3xl p-8`,d?`items-center text-center`:`items-start text-left`,l),children:[(0,i.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${u} text-white shadow-md`,children:(0,i.jsx)(t,{size:24})}),(0,i.jsx)(`div`,{className:`text-lg font-semibold tracking-tight`,children:r}),o&&(0,i.jsx)(`p`,{className:e.U(`max-w-md text-sm text-muted-foreground`,d&&`mx-auto`),children:o}),s&&(0,i.jsx)(`div`,{className:e.U(`mt-1`,d&&`mx-auto`),children:s})]})}function b({to:e,children:t}){return(0,i.jsxs)(c.Link,{to:e,className:`inline-flex items-center gap-1 hover:text-foreground`,children:[(0,i.jsx)(a.IconArrowLeft,{size:14,"aria-hidden":!0}),t]})}function x({eyebrow:e,backTo:t,backLabel:n,title:r,subtitle:a,leading:o,trailing:s}){let c=e??(t==null?null:(0,i.jsx)(b,{to:t,children:n}));return(0,i.jsx)(`header`,{className:`bento-shell-header mb-6 flex flex-col items-start gap-3 md:mb-10`,children:(0,i.jsxs)(`div`,{className:`flex w-full items-start gap-4`,children:[o&&(0,i.jsx)(`div`,{className:`shrink-0`,children:o}),(0,i.jsxs)(`div`,{className:`flex flex-1 flex-col gap-1`,children:[c&&(0,i.jsx)(`span`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:c}),(0,i.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight md:text-4xl`,children:r}),a&&(0,i.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:a})]}),s&&(0,i.jsx)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:s})]})})}function S({value:e,onChange:n,onClear:c,defaultIcon:l,tone:u,title:d,description:f,readOnly:p=!1}){let{t:m}=(0,o.useTranslation)(),[h,g]=(0,r.useState)(!1);return p?(0,i.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${_(u)} text-white shadow-md`,children:e?(0,i.jsx)(s.Icon,{icon:e,className:`size-6 text-white`}):(0,i.jsx)(l,{size:24})}):(0,i.jsxs)(`div`,{className:`group relative`,children:[(0,i.jsxs)(`button`,{type:`button`,onClick:()=>g(!0),"aria-label":m(`forms.iconPicker.chooseAnIcon`),className:`group/icon relative grid h-12 w-12 cursor-pointer place-items-center overflow-hidden rounded-2xl ${_(u)} text-white shadow-md outline-none transition-all duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] hover:scale-105 focus-visible:ring-2 focus-visible:ring-ring active:scale-95`,children:[e?(0,i.jsx)(s.Icon,{icon:e,className:`size-6 text-white`}):(0,i.jsx)(l,{size:24}),(0,i.jsx)(`span`,{className:`pointer-events-none absolute inset-0 grid place-items-center bg-black/40 opacity-0 transition-opacity duration-200 group-hover/icon:opacity-100`,children:(0,i.jsx)(a.IconPalette,{className:`size-5 text-white`})})]}),e&&c&&(0,i.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c()},"aria-label":m(`forms.common.remove`),title:m(`forms.common.remove`),className:`absolute -right-1.5 -top-1.5 grid h-5 w-5 cursor-pointer place-items-center rounded-full border border-border/60 bg-card/90 text-foreground opacity-0 shadow-md backdrop-blur transition-opacity duration-200 bento-clear focus-visible:opacity-100 group-hover:opacity-100`,children:(0,i.jsx)(a.IconX,{size:12})}),(0,i.jsx)(t.s,{open:h,onOpenChange:g,value:e,onSelect:n,onClear:c,title:d,description:f})]})}function C({value:t,onSave:n,multiline:a=!1,placeholder:s,className:c=``,ariaLabel:l,autoFocus:u=!1,readOnly:d=!1,commitOnChange:f=!1}){let{t:p}=(0,o.useTranslation)(),[m,h]=(0,r.useState)(u),[g,_]=(0,r.useState)(t),[v,y]=(0,r.useState)(!1),b=(0,r.useRef)(null),[x,S]=(0,r.useState)(t);!m&&t!==x&&(S(t),_(t)),(0,r.useEffect)(()=>{m&&b.current&&(b.current.focus(),b.current.select())},[m]);async function C(){let e=g.trim();if(e===t){h(!1);return}if(!e&&!s){_(t),h(!1);return}y(!0);try{await n(e)}catch{_(t)}finally{y(!1),h(!1)}}function w(){_(t),h(!1)}function T(e){_(e),f&&n(e)}let E=!t;if(d)return(0,i.jsx)(`span`,{className:`block w-full ${c}`,"aria-label":l,children:t||(0,i.jsx)(`span`,{className:`text-muted-foreground/80`,children:s??`—`})});let D=`w-full bg-transparent outline-none border-b transition-colors duration-200 ${c}`,O=`${D} cursor-text rounded-sm ${E?`border-dashed border-border/70 hover:border-foreground/40`:`border-transparent hover:border-border/60 focus-visible:border-border/80`} ${v?`opacity-60`:``}`,k=`${D} bento-editing`;if(!m)return(0,i.jsx)(`button`,{type:`button`,onClick:()=>h(!0),className:`${O} text-left`,"aria-label":l??p(`forms.formActions.edit`),disabled:v,children:t||(0,i.jsx)(`span`,{className:`text-muted-foreground/80`,children:s??`—`})});function A(e){if(e.key===`Escape`){e.preventDefault(),w();return}e.key===`Enter`&&(!a||e.metaKey||e.ctrlKey)&&(e.preventDefault(),C())}return a?(0,i.jsx)(`textarea`,{ref:b,value:g,onChange:e=>T(e.target.value),onBlur:C,onKeyDown:A,placeholder:s,"aria-label":l,rows:3,className:`${k} resize-none py-0.5 leading-snug`}):(0,i.jsx)(e.l,{ref:b,value:g,onChange:e=>T(e.target.value),onBlur:C,onKeyDown:A,placeholder:s,"aria-label":l,className:`${k} h-auto px-0 py-0 shadow-none focus-visible:ring-0`})}function w({titleMissing:e,dirty:t,className:n}){let{t:r}=(0,o.useTranslation)();if(!e&&!t)return null;let s=`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-medium normal-case leading-none tracking-normal`;return e?(0,i.jsxs)(`span`,{className:`${s} bento-status bento-status-error ${n??``}`,children:[(0,i.jsx)(a.IconAlertTriangle,{className:`size-3`}),r(`bento.saveBar.titleRequired`,{defaultValue:`Title required`})]}):(0,i.jsxs)(`span`,{className:`${s} bento-status bento-status-warn ${n??``}`,children:[(0,i.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bento-status-dot bento-pulse`}),r(`bento.saveBar.unsaved`,{defaultValue:`Unsaved changes`})]})}function T(e){(0,r.useEffect)(()=>{let t=e.current;if(!t)return;let n=document.documentElement,r=0,i=()=>{r=0;let e=t.getBoundingClientRect().top,i=Math.max(0,Math.min(1,(160-e)/80));n.style.setProperty(`--bento-fade`,String(i)),n.classList.toggle(`bento-fade-half`,i>.5)},a=()=>{r||=requestAnimationFrame(i)};return i(),window.addEventListener(`scroll`,a,{passive:!0}),window.addEventListener(`resize`,a),()=>{r&&cancelAnimationFrame(r),window.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a),n.style.removeProperty(`--bento-fade`),n.classList.remove(`bento-fade-half`)}},[e])}function E(e,t){let n={};for(let r of Object.keys(e))Object.assign(n,{[r]:t[r]});return n}function D({entity:t,isNew:s,headlineFallback:l,eyebrow:u,listRoute:d,icon:p,tone:h,formId:g,feature:_,hasStatus:v=!1,hideIcon:y=!1,readOnly:D=!1,autosaveOnly:O=!1,badge:k,notice:A,onUpdate:j,onDelete:M,extraActions:N,children:P}){let{t:F}=(0,o.useTranslation)(),I=(0,c.useNavigate)(),[L,R]=(0,r.useState)(!1),[z,B]=(0,r.useState)({isDirty:!1,isSubmitting:!1}),V=(0,r.useRef)(null);T(V);let H={title:t.title??``,description:t.description??``,icon:t.icon??null,enabled:t.enabled??1},[U,W]=(0,r.useState)(H),[G,K]=(0,r.useState)(H);(H.title!==G.title||H.description!==G.description||H.icon!==G.icon||H.enabled!==G.enabled)&&(K(H),W(H));async function q(e){if(W(t=>({...t,...e})),s||!j)return;let n=e.title??U.title;try{await j({...t,...e}),f.toast.success(F(`forms.common.updated`,{name:n,feature:_}))}catch(t){console.error(`Failed to update entity field`,t),W(t=>({...t,...E(e,H)})),f.toast.error(F(`forms.common.notUpdated`,{name:H.title||n,feature:_}))}}async function ee(){if(M){try{await M()?(f.toast.success(F(`forms.common.deleted`,{name:U.title,feature:_})),I(d)):f.toast.error(F(`forms.common.notDeleted`,{name:U.title,feature:_}))}catch(e){console.error(`Failed to delete entity`,e),f.toast.error(F(`forms.common.notDeleted`,{name:U.title,feature:_}))}R(!1)}}let J=U.enabled===1,te=!D,ne=!(O&&!s),Y=!U.title.trim(),X=!s&&!z.isDirty,re=Y||X,Z=[...N??[],...M&&!D?[{label:F(`forms.formActions.delete`),icon:a.IconTrash,tone:`destructive`,onSelect:()=>R(!0)}]:[]];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x,{eyebrow:(0,i.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,i.jsx)(b,{to:d,children:u}),!D&&(0,i.jsx)(w,{titleMissing:Y,dirty:s||z.isDirty})]}),leading:(0,i.jsx)(S,{value:U.icon,onChange:e=>q({icon:e}),onClear:()=>q({icon:null}),defaultIcon:p,tone:h,title:U.title,description:U.description,readOnly:D||y}),title:(0,i.jsx)(C,{value:U.title,onSave:e=>q({title:e}),placeholder:l,className:`text-3xl font-semibold tracking-tight md:text-4xl`,ariaLabel:F(`forms.common.title`),autoFocus:s,commitOnChange:s,readOnly:D}),subtitle:(0,i.jsx)(C,{value:U.description,onSave:e=>q({description:e}),multiline:!0,placeholder:F(`forms.common.description`),className:`max-w-2xl text-sm text-muted-foreground`,ariaLabel:F(`forms.common.description`),commitOnChange:s,readOnly:D}),trailing:(0,i.jsxs)(i.Fragment,{children:[te&&(0,i.jsxs)(`div`,{className:`bento-fade-out flex shrink-0 items-center gap-2`,children:[ne&&(0,i.jsxs)(e.u,{type:`submit`,form:g,size:`sm`,loading:z.isSubmitting,disabled:re,children:[(0,i.jsx)(a.IconDeviceFloppy,{className:`size-4`}),F(`forms.formActions.saveChanges`)]}),(0,i.jsxs)(e.u,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>I(d),children:[(0,i.jsx)(a.IconX,{className:`size-4`}),F(`forms.formActions.cancel`)]})]}),k,v&&(D?(0,i.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider ${J?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground`}`,children:[(0,i.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${J?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),J?F(`common.active`,{defaultValue:`Active`}):F(`common.idle`,{defaultValue:`Idle`})]}):(0,i.jsxs)(`button`,{type:`button`,onClick:()=>q({enabled:+!J}),"aria-label":F(`forms.common.enabled`),title:F(J?`common.activeToggleHint`:`common.idleToggleHint`),className:`bento-tile-clickable flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-wider transition-colors duration-200 ${J?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground hover:bg-muted/80`}`,children:[(0,i.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${J?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),J?F(`common.active`,{defaultValue:`Active`}):F(`common.idle`,{defaultValue:`Idle`})]})),!s&&Z.length>0&&(0,i.jsx)(m,{actions:Z})]})}),(0,i.jsx)(`div`,{ref:V,"aria-hidden":!0,className:`h-px`}),A,!s&&M&&(0,i.jsx)(n.i,{feature:_,name:U.title,onDelete:ee,open:L,setOpen:R,trigger:(0,i.jsx)(`span`,{className:`hidden`,"aria-hidden":!0})}),P({staged:U,onStateChange:B})]})}var O={LARGE:`col-span-2 row-span-2 md:col-span-2 md:row-span-2 lg:col-span-2 lg:row-span-2`,MEDIUM:`col-span-2 row-span-1 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1`,SMALL:`col-span-1 row-span-1`},k={SMALL:`MEDIUM`,MEDIUM:`LARGE`,LARGE:`SMALL`};function A(e,t,n){if(!n||n.length===0)return e.map((e,n)=>({item:e,key:t(e),emphasis:n===0?`LARGE`:`MEDIUM`}));let r=new Map,i=new Map;for(let e of n)r.set(e.itemId,e.displayOrder),i.set(e.itemId,e.emphasis);return e.map((e,n)=>({item:e,key:t(e),idx:n})).sort((e,t)=>{let n=r.has(e.key)?r.get(e.key):2**53-1,i=r.has(t.key)?r.get(t.key):2**53-1;return n===i?e.idx-t.idx:n-i}).map(({item:e,key:t})=>({item:e,key:t,emphasis:i.get(t)??`MEDIUM`}))}function j(e){return e.map((e,t)=>({itemId:e.key,emphasis:e.emphasis,displayOrder:t}))}function M({to:e,emphasis:t,featured:n,defaultIcon:r,icon:a,tone:l=`indigo`,title:u,description:d,meta:f,enabled:p,hasStatus:m=!1,viewTransitionName:h}){let{t:g}=(0,o.useTranslation)(),v=_(l),y=t??(n?`LARGE`:`MEDIUM`),b=y===`LARGE`,x=y===`SMALL`,S=O[y],C=p===1,w=b?`p-6 md:p-7`:x?`p-4`:`p-5`,T=b?`h-14 w-14`:x?`h-8 w-8`:`h-9 w-9`,E=b?28:x?16:18,D=b?`text-xl md:text-2xl`:x?`text-sm`:`text-base md:text-lg`;return(0,i.jsxs)(c.Link,{to:e,className:`bento-tile bento-tile-clickable bento-glass group relative flex flex-col ${b?`gap-5`:`gap-4`} overflow-hidden ${w} ${S}`,style:h?{viewTransitionName:h}:void 0,children:[b&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${v} opacity-40 blur-2xl dark:opacity-50`}),(0,i.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${v} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`})]}),(0,i.jsxs)(`div`,{className:`relative z-1 flex items-center justify-between`,children:[(0,i.jsx)(`span`,{className:`grid place-items-center rounded-2xl ${v} text-white shadow-md ${T}`,children:a?(0,i.jsx)(s.Icon,{icon:a,className:b?`size-7 text-white`:`size-4.5 text-white`}):(0,i.jsx)(r,{size:E})}),m&&(0,i.jsxs)(`span`,{className:`flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-wider ${C?`bento-status bento-status-on`:`border-border bg-muted text-muted-foreground`}`,children:[(0,i.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${C?`bento-status-dot bento-pulse`:`bg-muted-foreground/60`}`}),C?g(`common.active`,{defaultValue:`Active`}):g(`common.idle`,{defaultValue:`Idle`})]})]}),(0,i.jsxs)(`div`,{className:`relative z-1`,children:[(0,i.jsx)(`div`,{className:`font-semibold tracking-tight ${D}`,children:u}),!x&&f&&(0,i.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:f}),!x&&d&&(0,i.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:d})]})]})}var N=`bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6`;function P({items:e,error:s,tryAgainUrl:c,listId:l,eyebrow:u,backTo:d,backLabel:f,heroIcon:p,title:m,subtitle:h,tone:g=`indigo`,headerAction:v,newRoute:y,newLabel:b,newSubtitle:S,hideNew:C=!1,itemKey:w,renderTile:T,emptyTitle:E,emptyDescription:D,layout:O}){let{t:k}=(0,o.useTranslation)(),j=_(g),[M,N]=(0,r.useState)(!1),P=(0,r.useMemo)(()=>A(e??[],w,O?.data?.entries),[e,w,O?.data?.entries]),F=!!l&&!!O&&(e?.length??0)>0;return(0,i.jsxs)(n.t,{checkIsNotUndefined:e,error:s??null,tryAgainUrl:c,children:[(0,i.jsx)(x,{eyebrow:u,backTo:d,backLabel:f,leading:(0,i.jsx)(`span`,{className:`grid h-12 w-12 place-items-center rounded-2xl ${j} text-white shadow-md`,children:(0,i.jsx)(p,{size:24})}),title:m,subtitle:h}),(v||F&&!M)&&(0,i.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[v,F&&!M&&(0,i.jsxs)(t.c,{variant:`outline`,size:`sm`,onClick:()=>N(!0),className:`ml-auto gap-2`,children:[(0,i.jsx)(a.IconAdjustmentsHorizontal,{size:16}),k(`bento.layout.customize`,{defaultValue:`Customize layout`})]})]}),M&&l&&O?(0,i.jsx)(L,{layout:O,resolved:P,canEditGlobal:O?.data?.canEditGlobal??!1,isCustomized:O?.data?.source===`USER`,renderTile:T,chip:j,hideNew:C,newRoute:y,newLabel:b,newSubtitle:S,onClose:()=>N(!1)}):(0,i.jsx)(I,{resolved:P,renderTile:T,chip:j,hideNew:C,newRoute:y,newLabel:b,newSubtitle:S,isEmpty:e?.length===0,emptyTitle:E,emptyDescription:D})]})}function F({items:e,error:t,tryAgainUrl:r,tone:a=`indigo`,newRoute:o,newLabel:s,newSubtitle:c,hideNew:l=!1,itemKey:u,renderTile:d,emptyTitle:f,emptyDescription:p}){let m=_(a);return(0,i.jsx)(n.t,{checkIsNotUndefined:e,error:t??null,tryAgainUrl:r,children:(0,i.jsxs)(`div`,{className:N,children:[!l&&o&&s?(0,i.jsx)(V,{route:o,label:s,subtitle:c,chip:m}):null,(e??[]).map(e=>(0,i.jsx)(`span`,{className:`contents`,children:d(e)},u(e))),e?.length===0&&(0,i.jsx)(H,{title:f,description:p})]})})}function I({resolved:t,renderTile:n,chip:r,hideNew:a,newRoute:o,newLabel:s,newSubtitle:c,isEmpty:l,emptyTitle:u,emptyDescription:d}){let f=t.some(e=>e.emphasis===`SMALL`);return(0,i.jsxs)(`div`,{className:e.U(N,f&&`grid-flow-dense`),children:[!a&&(0,i.jsx)(V,{route:o,label:s,subtitle:c,chip:r}),t.map(({item:e,key:t,emphasis:r})=>(0,i.jsx)(`span`,{className:`contents`,children:n(e,r)},t)),l&&(0,i.jsx)(H,{title:u,description:d})]})}function L({layout:n,resolved:s,canEditGlobal:c,isCustomized:d,renderTile:f,chip:p,hideNew:m,newRoute:h,newLabel:g,newSubtitle:_,onClose:v}){let{t:y}=(0,o.useTranslation)(),[b,x]=(0,r.useState)(s),S=n.saving??!1,[C,w]=(0,r.useState)(!1),T=e=>async()=>{if(e){w(!1);try{await e(),v()}catch(e){console.error(`Failed to save the bento layout`,e),w(!0)}}},E=(0,l.useSensors)((0,l.useSensor)(l.PointerSensor,{activationConstraint:{distance:8}}),(0,l.useSensor)(l.KeyboardSensor));function D(e){let{active:t,over:n}=e;!n||t.id===n.id||x(e=>{let r=e.findIndex(e=>e.key===t.id),i=e.findIndex(e=>e.key===n.id);return r<0||i<0?e:(0,u.arrayMove)(e,r,i)})}function O(e,t){x(n=>n.map(n=>n.key===e?{...n,emphasis:t}:n))}let k=(0,r.useMemo)(()=>j(b),[b]),A=b.some(e=>e.emphasis===`SMALL`);return(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2 rounded-2xl border border-border/60 bg-card/40 p-3 backdrop-blur-md`,children:[(0,i.jsx)(`span`,{className:`mr-auto text-sm text-muted-foreground`,children:y(`bento.layout.editHint`,{defaultValue:`Drag tiles to reorder · tap the size button to resize`})}),d&&n.onReset&&(0,i.jsxs)(t.c,{variant:`ghost`,size:`sm`,className:`gap-2`,disabled:S,onClick:T(n.onReset),children:[(0,i.jsx)(a.IconArrowBackUp,{size:16}),y(`bento.layout.reset`,{defaultValue:`Reset to default`})]}),c&&n.onSaveGlobal&&(0,i.jsxs)(t.c,{variant:`outline`,size:`sm`,className:`gap-2`,disabled:S,onClick:T(()=>n.onSaveGlobal?.(k)),children:[(0,i.jsx)(a.IconUsers,{size:16}),y(`bento.layout.saveGlobal`,{defaultValue:`Set as default for everyone`})]}),(0,i.jsxs)(t.c,{variant:`ghost`,size:`sm`,className:`gap-2`,disabled:S,onClick:v,children:[(0,i.jsx)(a.IconX,{size:16}),y(`common.cancel`,{defaultValue:`Cancel`})]}),(0,i.jsxs)(t.c,{size:`sm`,className:`gap-2`,disabled:S,onClick:T(()=>n.onSave(k)),children:[(0,i.jsx)(a.IconDeviceFloppy,{size:16}),y(`bento.layout.save`,{defaultValue:`Save layout`})]}),C&&(0,i.jsx)(`p`,{role:`alert`,className:`w-full text-sm text-destructive`,children:y(`bento.layout.saveFailed`,{defaultValue:`The layout could not be saved. Nothing has changed — try again.`})})]}),(0,i.jsx)(l.DndContext,{sensors:E,collisionDetection:l.closestCenter,onDragEnd:D,children:(0,i.jsx)(u.SortableContext,{items:b.map(e=>e.key),strategy:u.rectSortingStrategy,children:(0,i.jsxs)(`div`,{className:e.U(N,A&&`grid-flow-dense`),children:[!m&&(0,i.jsx)(V,{route:h,label:g,subtitle:_,chip:p}),b.map(({item:e,key:t,emphasis:n})=>(0,i.jsx)(B,{id:t,emphasis:n,onSetEmphasis:e=>O(t,e),children:f(e,n)},t))]})})})]})}var R=[`SMALL`,`MEDIUM`,`LARGE`],z={SMALL:{key:`bento.layout.size.small`,def:`Small`},MEDIUM:{key:`bento.layout.size.medium`,def:`Medium`},LARGE:{key:`bento.layout.size.large`,def:`Large`}};function B({id:t,emphasis:n,onSetEmphasis:r,children:s}){let{t:c}=(0,o.useTranslation)(),{attributes:l,listeners:f,setNodeRef:p,transform:m,transition:h,isDragging:g}=(0,u.useSortable)({id:t}),_={transform:d.CSS.Translate.toString(m),transition:h,opacity:g?.6:1,zIndex:g?50:void 0};return(0,i.jsxs)(`div`,{ref:p,style:_,className:e.U(`relative h-full`,O[n]),children:[(0,i.jsx)(`div`,{className:`pointer-events-none h-full select-none [&>*]:h-full [&>*]:w-full`,children:s}),(0,i.jsxs)(`div`,{className:`absolute right-2 top-2 z-10 flex items-center gap-1`,children:[(0,i.jsx)(`div`,{role:`group`,"aria-label":c(`bento.layout.sizeGroup`,{defaultValue:`Tile size`}),className:`flex items-center gap-0.5 rounded-full border border-border/60 bg-background/80 p-0.5 shadow-sm backdrop-blur`,children:R.map(t=>{let a=t===n,o=c(z[t].key,{defaultValue:z[t].def});return(0,i.jsx)(`button`,{type:`button`,onClick:()=>r(t),"aria-pressed":a,"aria-label":o,title:o,className:e.U(`grid h-6 w-6 place-items-center rounded-full text-[11px] font-semibold uppercase transition-colors`,a?`bg-primary text-primary-foreground shadow`:`text-muted-foreground hover:bg-muted`),children:o.charAt(0)},t)})}),(0,i.jsx)(`button`,{type:`button`,...l,...f,"aria-label":c(`bento.layout.dragToReorder`,{defaultValue:`Drag to reorder`}),className:`grid h-7 w-7 cursor-grab place-items-center rounded-full border border-border/60 bg-background/80 shadow-sm backdrop-blur hover:bg-background active:cursor-grabbing`,children:(0,i.jsx)(a.IconGripVertical,{size:14,className:`text-muted-foreground`})})]})]})}function V({route:e,label:t,subtitle:n,chip:r}){let{t:s}=(0,o.useTranslation)();return(0,i.jsxs)(c.Link,{to:e,className:`bento-tile bento-tile-clickable col-span-2 row-span-1 flex flex-col gap-3 rounded-3xl border-2 border-dashed border-border/60 bg-card/30 p-5 backdrop-blur-md bento-new-tile hover:bg-card/50 md:col-span-2 md:row-span-1 lg:col-span-2 lg:row-span-1`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,i.jsx)(`span`,{className:`bento-pulse grid h-10 w-10 place-items-center rounded-2xl ${r} text-white shadow-md`,children:(0,i.jsx)(a.IconPlus,{size:20})}),(0,i.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:s(`forms.formActions.new`,{defaultValue:`New`})})]}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`text-base font-semibold tracking-tight md:text-lg`,children:(0,i.jsx)(`span`,{className:`${r} bg-clip-text text-transparent`,children:t})}),n&&(0,i.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n})]})]})}function H({title:e,description:t}){return(0,i.jsx)(y,{icon:a.IconSparkles,title:e,description:t,align:`start`,className:`col-span-2 row-span-2 justify-end md:col-span-4`})}function U({title:t,badges:n,actions:r,onCancel:s,loading:c,disabled:l,dirty:u,titleMissing:d}){let{t:f}=(0,o.useTranslation)();return(0,i.jsxs)(`div`,{className:`bento-glass flex items-center justify-between gap-4 rounded-2xl px-4 py-3 shadow-md backdrop-blur-xl`,children:[(0,i.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[t&&(0,i.jsx)(`p`,{className:`truncate text-base font-semibold tracking-tight md:text-lg`,children:t}),(0,i.jsx)(w,{titleMissing:d,dirty:u}),n&&(0,i.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:n})]}),(0,i.jsx)(`div`,{className:`flex shrink-0 gap-2`,children:r??(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(e.u,{type:`submit`,size:`sm`,loading:c,disabled:l,children:[(0,i.jsx)(a.IconDeviceFloppy,{className:`size-4`}),f(`forms.formActions.saveChanges`)]}),s&&(0,i.jsxs)(e.u,{type:`button`,variant:`outline`,size:`sm`,onClick:s,children:[(0,i.jsx)(a.IconX,{className:`size-4`}),f(`forms.formActions.cancel`)]})]})})]})}function W({children:e}){return(0,i.jsx)(`span`,{className:`rounded-full border border-border/60 bg-card/50 px-2 py-0.5 text-[10px] uppercase tracking-wider text-muted-foreground backdrop-blur`,children:e})}U.Badge=W;function G(e){let t=(0,r.useRef)(null);return T(t),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{ref:t,"aria-hidden":!0,className:`h-px`}),(0,i.jsx)(`div`,{"aria-hidden":!0,className:`bento-save-bar-spacer`}),(0,i.jsx)(`div`,{className:`bento-fade-in fixed inset-x-0 top-20 z-20 mx-auto w-full max-w-7xl px-4 md:px-8`,children:(0,i.jsx)(U,{...e})})]})}function K({eyebrow:t,backTo:n,backLabel:r,leading:s,title:c,subtitle:l,trailing:u,onCancel:d,actions:f,loading:p,dirty:m,titleMissing:h,saveDisabled:g,stickyTitle:_,stickyBadges:v}){let{t:y}=(0,o.useTranslation)(),S=g??(!!h||!m);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(x,{eyebrow:n===void 0?t:(0,i.jsx)(b,{to:n,children:r}),leading:s,title:c,subtitle:l,trailing:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{className:`bento-fade-out flex shrink-0 items-center gap-2`,children:f??(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(e.u,{type:`submit`,size:`sm`,loading:p,disabled:S,children:[(0,i.jsx)(a.IconDeviceFloppy,{className:`size-4`}),y(`forms.formActions.saveChanges`)]}),(0,i.jsxs)(e.u,{type:`button`,variant:`outline`,size:`sm`,onClick:d,children:[(0,i.jsx)(a.IconX,{className:`size-4`}),y(`forms.formActions.cancel`)]})]})}),u]})}),(0,i.jsx)(G,{title:_,badges:v,actions:f,onCancel:d,loading:p,disabled:S,dirty:m,titleMissing:h})]})}function q({icon:e,tone:t,title:n,description:r,children:a,trailing:o,as:s=`h2`}){return(0,i.jsxs)(`section`,{className:`bento-tile bento-glass relative flex flex-col gap-5 overflow-hidden rounded-3xl p-5 md:p-6`,children:[(0,i.jsxs)(`header`,{className:`flex items-start justify-between gap-3`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,i.jsx)(`span`,{className:`grid h-10 w-10 place-items-center rounded-2xl text-white shadow-md ${_(t)}`,children:(0,i.jsx)(e,{size:20})}),(0,i.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,i.jsx)(s,{className:`text-base font-semibold tracking-tight md:text-lg`,children:n}),r&&(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r})]})]}),o&&(0,i.jsx)(`div`,{className:`shrink-0`,children:o})]}),(0,i.jsx)(`div`,{className:`flex flex-col gap-5`,children:a})]})}function ee({children:t,className:n,contentClassName:r}){return(0,i.jsx)(`div`,{className:e.U(`bento-glass rounded-2xl shadow-md`,n),children:(0,i.jsx)(`div`,{className:r,children:t})})}var J=480;function te(e){return window.addEventListener(`scroll`,e,{passive:!0}),()=>window.removeEventListener(`scroll`,e)}function ne(){return window.scrollY>J}function Y(){let e=(0,r.useSyncExternalStore)(te,ne,()=>!1);return(0,i.jsx)(`button`,{type:`button`,"aria-label":`Back to top`,tabIndex:e?0:-1,onClick:()=>window.scrollTo({top:0,behavior:`smooth`}),className:`fixed bottom-6 right-6 z-40 grid h-11 w-11 place-items-center rounded-full border border-border/60 bg-card/80 text-foreground shadow-lg backdrop-blur-xl transition-all duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] hover:-translate-y-0.5 hover:shadow-xl active:scale-95 ${e?`translate-y-0 scale-100 opacity-100`:`pointer-events-none translate-y-4 scale-90 opacity-0`}`,children:(0,i.jsx)(a.IconArrowUp,{size:18})})}function X(e){return e.bentoRoute??e.fallbackRoute}function re({open:t,onOpenChange:n,items:s}){let{t:l}=(0,o.useTranslation)(),u=(0,c.useNavigate)(),[d,f]=(0,r.useState)(``),[p,m]=(0,r.useState)(0),h=(0,r.useRef)(null),g=(0,r.useMemo)(()=>{let e=d.trim().toLowerCase(),t=s.map(e=>({item:e,label:l(e.titleKey),description:l(e.descriptionKey)}));if(!e)return t;let n=[],r=[];for(let i of t)i.label.toLowerCase().includes(e)?n.push(i):i.description.toLowerCase().includes(e)&&r.push(i);return[...n,...r]},[s,d,l]),[_,v]=(0,r.useState)(t);t!==_&&(v(t),t&&(f(``),m(0)));let y=g.length===0?0:g.length-1;p>y&&m(y),(0,r.useEffect)(()=>{(h.current?.querySelector(`[data-index="${p}"]`))?.scrollIntoView({block:`nearest`})},[p]);function b(e){n(!1),u(X(e))}function x(e){if(e.key===`ArrowDown`)e.preventDefault(),m(e=>g.length===0?0:(e+1)%g.length);else if(e.key===`ArrowUp`)e.preventDefault(),m(e=>g.length===0?0:(e-1+g.length)%g.length);else if(e.key===`Enter`){e.preventDefault();let t=g[p];t&&b(t.item)}}return(0,i.jsx)(e.D,{open:t,onOpenChange:n,children:(0,i.jsxs)(e.k,{showCloseButton:!1,className:`top-[15%] max-w-xl translate-y-0 gap-0 overflow-hidden p-0`,onKeyDown:x,children:[(0,i.jsx)(e.F,{className:`sr-only`,children:l(`bento.palette.title`,{defaultValue:`Command palette`})}),(0,i.jsx)(e.A,{className:`sr-only`,children:l(`bento.palette.description`,{defaultValue:`Search and jump to any area`})}),(0,i.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border/60 px-4`,children:[(0,i.jsx)(a.IconSearch,{size:18,className:`shrink-0 text-muted-foreground`}),(0,i.jsx)(`input`,{autoFocus:!0,type:`text`,role:`combobox`,"aria-expanded":`true`,"aria-controls":`bento-palette-list`,"aria-activedescendant":g[p]?`bento-palette-opt-${p}`:void 0,value:d,onChange:e=>f(e.target.value),placeholder:l(`bento.palette.placeholder`,{defaultValue:`Search areas…`}),className:`h-12 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground`})]}),(0,i.jsxs)(`div`,{ref:h,id:`bento-palette-list`,role:`listbox`,"aria-label":l(`bento.palette.title`,{defaultValue:`Command palette`}),className:`max-h-80 overflow-y-auto p-2`,children:[g.length===0&&(0,i.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:l(`bento.palette.noResults`,{defaultValue:`No matches`})}),g.map(({item:e,label:t},n)=>{let r=!e.bentoRoute,o=n===p,s=e.icon;return(0,i.jsxs)(`button`,{type:`button`,id:`bento-palette-opt-${n}`,"data-index":n,role:`option`,"aria-selected":o?`true`:`false`,onMouseEnter:()=>m(n),onClick:()=>b(e),className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${o?`bg-accent text-accent-foreground`:`text-foreground`}`,children:[(0,i.jsx)(s,{size:18,className:`shrink-0 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`flex-1 truncate`,children:t}),r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.IconExternalLink,{"aria-hidden":!0,size:15,className:`shrink-0 text-muted-foreground/70`}),(0,i.jsx)(`span`,{className:`sr-only`,children:l(`bento.palette.opensConsole`,{defaultValue:`Opens in console`})})]}):o&&(0,i.jsx)(a.IconArrowRight,{"aria-hidden":!0,size:15,className:`shrink-0 text-muted-foreground`})]},e.id)})]})]})})}function Z({open:t,onOpenChange:n,isMac:r}){let{t:s}=(0,o.useTranslation)(),c=r?`⌘`:`Ctrl`,l=[{heading:s(`bento.shortcuts.global`,{defaultValue:`Global`}),rows:[{keys:[c,`K`],label:s(`bento.palette.open`,{defaultValue:`Open command palette`})},{keys:[`?`],label:s(`bento.shortcuts.openGuide`,{defaultValue:`Show keyboard shortcuts`})}]},{heading:s(`bento.shortcuts.palette`,{defaultValue:`Command palette`}),rows:[{keys:[`↑`,`↓`],label:s(`bento.shortcuts.navigate`,{defaultValue:`Move between results`})},{keys:[`↵`],label:s(`bento.shortcuts.openSelected`,{defaultValue:`Open the selected area`})},{keys:[`Esc`],label:s(`bento.shortcuts.dismiss`,{defaultValue:`Close the palette or a dialog`})}]}];return(0,i.jsx)(e.D,{open:t,onOpenChange:n,children:(0,i.jsxs)(e.k,{className:`max-w-md`,children:[(0,i.jsxs)(e.M,{children:[(0,i.jsxs)(e.F,{className:`flex items-center gap-2`,children:[(0,i.jsx)(a.IconKeyboard,{size:20,className:`bento-accent-icon`}),s(`bento.shortcuts.title`,{defaultValue:`Keyboard shortcuts`})]}),(0,i.jsx)(e.A,{children:s(`bento.shortcuts.description`,{defaultValue:`Move around Turing without leaving the keyboard.`})})]}),(0,i.jsx)(`div`,{className:`flex flex-col gap-5`,children:l.map(e=>(0,i.jsxs)(`section`,{children:[(0,i.jsx)(`h3`,{className:`mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground`,children:e.heading}),(0,i.jsx)(`ul`,{className:`flex flex-col gap-1.5`,children:e.rows.map(e=>(0,i.jsxs)(`li`,{className:`flex items-center justify-between gap-4`,children:[(0,i.jsx)(`span`,{className:`text-sm text-foreground`,children:e.label}),(0,i.jsx)(`span`,{className:`flex shrink-0 items-center gap-1`,children:e.keys.map(e=>(0,i.jsx)(`kbd`,{className:`inline-flex min-w-6 items-center justify-center rounded-md border border-border/60 bg-muted px-1.5 py-0.5 text-[11px] font-medium tracking-wide`,children:e},e))})]},e.label))})]},e.heading))})]})})}function ie(e,t){return e===t||e.startsWith(`${t}/`)}function ae(e,t){return t.section.areaRoute&&ie(e,t.section.areaRoute)?!0:t.items.some(t=>t.bentoRoute&&ie(e,t.bentoRoute))}function oe({groups:t,homeRoute:n,homeAliases:s,homeLabel:l}){let{t:u}=(0,o.useTranslation)(),{pathname:d}=(0,c.useLocation)(),f=(0,r.useMemo)(()=>t.filter(e=>e.section.areaRoute),[t]),p=d===n||(s?.includes(d)??!1);return(0,i.jsx)(e.o,{delayDuration:200,children:(0,i.jsxs)(`nav`,{"aria-label":u(`bento.nav.label`,{defaultValue:`Primary`}),className:`fixed inset-y-0 left-0 z-40 hidden w-16 flex-col items-center gap-1 overflow-y-auto overflow-x-hidden border-r border-border/40 bg-background/55 pt-20 pb-4 backdrop-blur-xl backdrop-saturate-150 md:flex`,children:[(0,i.jsx)(se,{to:n,icon:a.IconHome,label:l??u(`home.title`,{defaultValue:`Home`}),active:p}),f.length>0&&(0,i.jsx)(`span`,{"aria-hidden":!0,className:`my-1 h-px w-6 bg-border/60`}),f.map(e=>(0,i.jsx)(se,{to:e.section.areaRoute,icon:e.section.icon,label:u(e.section.labelKey),active:ae(d,e)},e.section.id))]})})}function se({to:t,icon:n,label:r,active:a}){return(0,i.jsxs)(e.i,{children:[(0,i.jsx)(e.s,{asChild:!0,children:(0,i.jsx)(c.Link,{to:t,"aria-label":r,"aria-current":a?`page`:void 0,className:`bento-tile-clickable grid h-11 w-11 shrink-0 place-items-center rounded-2xl border transition-colors duration-200 ${a?`bento-rail-active`:`border-transparent text-muted-foreground hover:border-border/60 hover:bg-card/60 hover:text-foreground`}`,children:(0,i.jsx)(n,{size:20})})}),(0,i.jsx)(e.a,{side:`right`,children:r})]})}function ce({accountRoute:n,logoutUrl:r,organizationsRoute:s,tenantAdminRoute:l,onOpenShortcuts:u,onReplayTour:d}){let{user:f,status:p}=t.n(),{t:m}=(0,o.useTranslation)(),h=(0,c.useNavigate)(),g=`${f.firstName??``} ${f.lastName??``}`.trim()||f.username||``;return p===`loading`?(0,i.jsx)(`div`,{className:`h-9 w-9 rounded-full bg-muted/40`,"aria-hidden":!0}):(0,i.jsxs)(e.f,{children:[(0,i.jsx)(e.E,{asChild:!0,children:(0,i.jsx)(`button`,{type:`button`,title:g||f.username,className:`bento-tile-clickable cursor-pointer rounded-full p-0.5 ring-1 ring-border/60 outline-none transition-shadow duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] bento-ring hover:ring-2 focus-visible:ring-2 focus-visible:ring-ring`,children:(0,i.jsx)(t.r,{givenName:f.firstName,familyName:f.lastName,name:g||f.username,src:f.avatarUrl||void 0,alt:f.username})})}),(0,i.jsxs)(e.m,{align:`end`,sideOffset:10,className:`bento-dropdown min-w-64 p-2`,children:[(0,i.jsx)(e._,{className:`p-0 font-normal`,children:(0,i.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl px-2 py-2 text-left text-sm`,children:[(0,i.jsx)(`span`,{className:`rounded-full p-0.5 ring-1 ring-border/60`,children:(0,i.jsx)(t.r,{givenName:f.firstName,familyName:f.lastName,name:g||f.username,src:f.avatarUrl||void 0,alt:f.username})}),(0,i.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[g&&(0,i.jsx)(`span`,{className:`truncate font-medium`,children:g}),f.email&&(0,i.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:f.email})]})]})}),(0,i.jsx)(e.x,{className:`my-1.5 bg-border/50`}),(0,i.jsxs)(e.h,{children:[(0,i.jsxs)(e.g,{onSelect:()=>h(n),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(a.IconUserCircle,{size:18}),m(`nav.account`)]}),s&&(0,i.jsxs)(e.g,{onSelect:()=>h(s),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(a.IconBuildingCommunity,{size:18}),m(`nav.organizations`,{defaultValue:`Organizations`})]}),l&&(0,i.jsxs)(e.g,{onSelect:()=>h(l),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(a.IconBuildingSkyscraper,{size:18}),m(`nav.tenantAdmin`,{defaultValue:`Tenant administration`})]})]}),(u||d)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.x,{className:`my-1.5 bg-border/50`}),(0,i.jsxs)(e.h,{children:[d&&(0,i.jsxs)(e.g,{onSelect:()=>d(),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(a.IconSparkles,{size:18}),m(`bento.tour.replay`,{defaultValue:`Take the tour`})]}),u&&(0,i.jsxs)(e.g,{onSelect:()=>u(),className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2`,children:[(0,i.jsx)(a.IconKeyboard,{size:18}),m(`bento.shortcuts.title`,{defaultValue:`Keyboard shortcuts`})]})]})]}),(0,i.jsx)(e.x,{className:`my-1.5 bg-border/50`}),(0,i.jsxs)(e.g,{onSelect:()=>{globalThis.location.href=r},className:`bento-dropdown-item cursor-pointer gap-2 px-3 py-2 bento-item-danger`,children:[(0,i.jsx)(a.IconLogout,{size:18}),m(`nav.logOut`)]})]})]})}var Q=(0,r.createContext)(`console`);function le({chrome:e,children:t}){return(0,i.jsx)(Q.Provider,{value:e,children:t})}function ue(){return(0,r.useContext)(Q)}var de={blue:`blue`,violet:`violet`,emerald:`emerald`,amber:`amber`,rose:`rose`,slate:`slate`,cyan:`blue`,orange:`amber`};function $({variant:e=`blue`,defaultOpen:n,className:a,children:o}){let s=(0,r.useContext)(Q),c,l;return s===`bento`&&r.Children.forEach(o,e=>{if(!(0,r.isValidElement)(e))return;let{type:n}=e;n===t.o.Header||n===t.o.StaticHeader?c=e.props:n===t.o.Content&&(l=e.props.children)}),s===`bento`&&c?(0,i.jsx)(q,{icon:c.icon,tone:de[e]??`blue`,title:c.title,description:c.description,children:l}):(0,i.jsx)(t.o,{variant:e,defaultOpen:n,className:a,children:o})}$.Header=t.o.Header,$.StaticHeader=t.o.StaticHeader,$.Content=t.o.Content;var fe=`bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6`;function pe({eyebrow:e,title:t,description:n,titleHref:r,children:o,gridClassName:s=fe}){let l=(0,i.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight md:text-2xl`,children:t});return(0,i.jsxs)(`section`,{className:`mb-8 md:mb-10`,children:[(0,i.jsxs)(`header`,{className:`bento-shell-header mb-4 flex flex-col gap-0.5`,children:[e&&(0,i.jsx)(`span`,{className:`text-xs uppercase tracking-[0.18em] text-muted-foreground`,children:e}),r?(0,i.jsxs)(c.Link,{to:r,className:`group inline-flex w-fit items-center gap-1 text-foreground transition-colors hover:text-primary`,children:[l,(0,i.jsx)(a.IconChevronRight,{size:20,className:`text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1`})]}):l,n&&(0,i.jsx)(`p`,{className:`max-w-2xl text-sm text-muted-foreground`,children:n})]}),(0,i.jsx)(`div`,{className:s,children:o})]})}function me({to:e,onClick:t,disabled:n=!1,disabledHint:r,icon:o,tone:s,eyebrow:l,title:u,span:d,featured:f=!1,children:p}){let m=!n&&!!(e||t),h=f?`h-14 w-14 rounded-2xl`:`h-9 w-9 rounded-2xl`,g=f?28:18,v=f?`text-xl font-semibold tracking-tight md:text-2xl`:`text-base font-semibold tracking-tight md:text-lg`,y=(0,i.jsxs)(i.Fragment,{children:[f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute -bottom-10 -right-10 h-64 w-64 rounded-full ${_(s)} opacity-40 blur-2xl dark:opacity-50`}),(0,i.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute right-12 top-1/3 h-32 w-32 rounded-full ${_(s)} bento-chip-tr opacity-20 blur-2xl dark:opacity-30`})]}),(0,i.jsxs)(`div`,{className:`relative z-1 flex items-center justify-between`,children:[(0,i.jsx)(`span`,{className:`grid place-items-center ${_(s)} text-white shadow-md ${h}`,children:(0,i.jsx)(o,{size:g})}),m&&(0,i.jsx)(a.IconChevronRight,{size:f?18:16,className:`text-muted-foreground transition-transform duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] group-hover:translate-x-1`})]}),(0,i.jsxs)(`div`,{className:`relative z-1`,children:[(0,i.jsx)(`div`,{className:`text-[11px] uppercase tracking-wider text-muted-foreground`,children:l}),(0,i.jsx)(`div`,{className:`mt-0.5 ${v}`,children:u}),p&&(0,i.jsx)(`div`,{className:`mt-2`,children:p})]})]}),b=`bento-tile bento-glass group relative flex flex-col ${f?`gap-5`:`gap-4`} overflow-hidden text-left ${f?`p-6 md:p-7`:`p-5`} ${d}${m?` bento-tile-clickable`:``}${n?` cursor-not-allowed opacity-60`:``}`;return n?(0,i.jsx)(`div`,{className:b,"aria-disabled":`true`,title:r,children:y}):e?(0,i.jsx)(c.Link,{to:e,className:b,children:y}):t?(0,i.jsx)(`button`,{type:`button`,onClick:t,className:`${b} w-full`,children:y}):(0,i.jsx)(`div`,{className:b,children:y})}exports.AdaptiveSectionCard=$,exports.BENTO_EMPHASIS_NEXT=k,exports.BENTO_EMPHASIS_SPAN=O,exports.BENTO_TONES=g,exports.BENTO_TONE_CLASS=h,exports.BentoActionsMenu=m,exports.BentoBackLink=b,exports.BentoBackToTop=Y,exports.BentoCommandPalette=re,exports.BentoCountTile=v,exports.BentoEmptyState=y,exports.BentoEntityShell=D,exports.BentoEntityTile=M,exports.BentoFormHero=K,exports.BentoFormSection=q,exports.BentoHero=x,exports.BentoHeroIconPicker=S,exports.BentoInlineEdit=C,exports.BentoListPage=P,exports.BentoNavRail=oe,exports.BentoPanel=ee,exports.BentoSaveBar=U,exports.BentoScrollSaveBar=G,exports.BentoSection=pe,exports.BentoShortcutsDialog=Z,exports.BentoStatusMarker=w,exports.BentoTile=me,exports.BentoTileGrid=F,exports.BentoUserMenu=ce,exports.SectionCardChromeProvider=le,exports.bentoChipClass=_,exports.bentoNavTarget=X,exports.resolveBentoLayout=A,exports.toBentoLayoutEntries=j,exports.useBentoScrollFade=T,exports.useSectionChrome=ue;
|
package/dist/bento.es.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { A as e, D as t, E as n, F as r, M as i, U as a, _ as o, a as s, f as c, g as l, h as u, i as d, k as f, l as p, m, o as h, s as g, u as _, x as v } from "./badge-locale-BxI9TwkE.js";
|
|
2
3
|
import { c as y, l as b, n as x, o as S, r as C, s as w } from "./user.context-kPAqKN4o.js";
|
|
3
4
|
import { i as T, t as E } from "./loading-provider-CMnOuvdR.js";
|
|
@@ -1011,16 +1012,27 @@ function ot({ icon: e, tone: t, title: n, description: r, children: i, trailing:
|
|
|
1011
1012
|
});
|
|
1012
1013
|
}
|
|
1013
1014
|
//#endregion
|
|
1015
|
+
//#region src/bento/bento-panel.tsx
|
|
1016
|
+
function st({ children: e, className: t, contentClassName: n }) {
|
|
1017
|
+
return /* @__PURE__ */ I("div", {
|
|
1018
|
+
className: a("bento-glass rounded-2xl shadow-md", t),
|
|
1019
|
+
children: /* @__PURE__ */ I("div", {
|
|
1020
|
+
className: n,
|
|
1021
|
+
children: e
|
|
1022
|
+
})
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
//#endregion
|
|
1014
1026
|
//#region src/bento/bento-back-to-top.tsx
|
|
1015
|
-
var
|
|
1016
|
-
function
|
|
1027
|
+
var ct = 480;
|
|
1028
|
+
function lt(e) {
|
|
1017
1029
|
return window.addEventListener("scroll", e, { passive: !0 }), () => window.removeEventListener("scroll", e);
|
|
1018
1030
|
}
|
|
1019
|
-
function lt() {
|
|
1020
|
-
return window.scrollY > st;
|
|
1021
|
-
}
|
|
1022
1031
|
function ut() {
|
|
1023
|
-
|
|
1032
|
+
return window.scrollY > ct;
|
|
1033
|
+
}
|
|
1034
|
+
function dt() {
|
|
1035
|
+
let e = ee(lt, ut, () => !1);
|
|
1024
1036
|
return /* @__PURE__ */ I("button", {
|
|
1025
1037
|
type: "button",
|
|
1026
1038
|
"aria-label": "Back to top",
|
|
@@ -1035,12 +1047,12 @@ function ut() {
|
|
|
1035
1047
|
}
|
|
1036
1048
|
//#endregion
|
|
1037
1049
|
//#region src/bento/bento-nav.ts
|
|
1038
|
-
function
|
|
1050
|
+
function ft(e) {
|
|
1039
1051
|
return e.bentoRoute ?? e.fallbackRoute;
|
|
1040
1052
|
}
|
|
1041
1053
|
//#endregion
|
|
1042
1054
|
//#region src/bento/bento-command-palette.tsx
|
|
1043
|
-
function
|
|
1055
|
+
function pt({ open: n, onOpenChange: i, items: a }) {
|
|
1044
1056
|
let { t: o } = G(), s = J(), [c, l] = P(""), [u, d] = P(0), p = N(null), m = M(() => {
|
|
1045
1057
|
let e = c.trim().toLowerCase(), t = a.map((e) => ({
|
|
1046
1058
|
item: e,
|
|
@@ -1062,7 +1074,7 @@ function ft({ open: n, onOpenChange: i, items: a }) {
|
|
|
1062
1074
|
(p.current?.querySelector(`[data-index="${u}"]`))?.scrollIntoView({ block: "nearest" });
|
|
1063
1075
|
}, [u]);
|
|
1064
1076
|
function v(e) {
|
|
1065
|
-
i(!1), s(
|
|
1077
|
+
i(!1), s(ft(e));
|
|
1066
1078
|
}
|
|
1067
1079
|
function y(e) {
|
|
1068
1080
|
if (e.key === "ArrowDown") e.preventDefault(), d((e) => m.length === 0 ? 0 : (e + 1) % m.length);
|
|
@@ -1158,7 +1170,7 @@ function ft({ open: n, onOpenChange: i, items: a }) {
|
|
|
1158
1170
|
}
|
|
1159
1171
|
//#endregion
|
|
1160
1172
|
//#region src/bento/bento-shortcuts-dialog.tsx
|
|
1161
|
-
function
|
|
1173
|
+
function mt({ open: n, onOpenChange: a, isMac: o }) {
|
|
1162
1174
|
let { t: s } = G(), c = o ? "⌘" : "Ctrl", l = [{
|
|
1163
1175
|
heading: s("bento.shortcuts.global", { defaultValue: "Global" }),
|
|
1164
1176
|
rows: [{
|
|
@@ -1223,13 +1235,13 @@ function pt({ open: n, onOpenChange: a, isMac: o }) {
|
|
|
1223
1235
|
}
|
|
1224
1236
|
//#endregion
|
|
1225
1237
|
//#region src/bento/bento-nav-rail.tsx
|
|
1226
|
-
function
|
|
1238
|
+
function ht(e, t) {
|
|
1227
1239
|
return e === t || e.startsWith(`${t}/`);
|
|
1228
1240
|
}
|
|
1229
|
-
function
|
|
1230
|
-
return t.section.areaRoute &&
|
|
1241
|
+
function gt(e, t) {
|
|
1242
|
+
return t.section.areaRoute && ht(e, t.section.areaRoute) ? !0 : t.items.some((t) => t.bentoRoute && ht(e, t.bentoRoute));
|
|
1231
1243
|
}
|
|
1232
|
-
function
|
|
1244
|
+
function _t({ groups: e, homeRoute: t, homeAliases: n, homeLabel: r }) {
|
|
1233
1245
|
let { t: i } = G(), { pathname: a } = ve(), o = M(() => e.filter((e) => e.section.areaRoute), [e]), s = a === t || (n?.includes(a) ?? !1);
|
|
1234
1246
|
return /* @__PURE__ */ I(h, {
|
|
1235
1247
|
delayDuration: 200,
|
|
@@ -1237,7 +1249,7 @@ function gt({ groups: e, homeRoute: t, homeAliases: n, homeLabel: r }) {
|
|
|
1237
1249
|
"aria-label": i("bento.nav.label", { defaultValue: "Primary" }),
|
|
1238
1250
|
className: "fixed inset-y-0 left-0 z-40 hidden w-16 flex-col items-center gap-1 overflow-y-auto overflow-x-hidden border-r border-border/40 bg-background/55 pt-20 pb-4 backdrop-blur-xl backdrop-saturate-150 md:flex",
|
|
1239
1251
|
children: [
|
|
1240
|
-
/* @__PURE__ */ I(
|
|
1252
|
+
/* @__PURE__ */ I(vt, {
|
|
1241
1253
|
to: t,
|
|
1242
1254
|
icon: le,
|
|
1243
1255
|
label: r ?? i("home.title", { defaultValue: "Home" }),
|
|
@@ -1247,17 +1259,17 @@ function gt({ groups: e, homeRoute: t, homeAliases: n, homeLabel: r }) {
|
|
|
1247
1259
|
"aria-hidden": !0,
|
|
1248
1260
|
className: "my-1 h-px w-6 bg-border/60"
|
|
1249
1261
|
}),
|
|
1250
|
-
o.map((e) => /* @__PURE__ */ I(
|
|
1262
|
+
o.map((e) => /* @__PURE__ */ I(vt, {
|
|
1251
1263
|
to: e.section.areaRoute,
|
|
1252
1264
|
icon: e.section.icon,
|
|
1253
1265
|
label: i(e.section.labelKey),
|
|
1254
|
-
active:
|
|
1266
|
+
active: gt(a, e)
|
|
1255
1267
|
}, e.section.id))
|
|
1256
1268
|
]
|
|
1257
1269
|
})
|
|
1258
1270
|
});
|
|
1259
1271
|
}
|
|
1260
|
-
function
|
|
1272
|
+
function vt({ to: e, icon: t, label: n, active: r }) {
|
|
1261
1273
|
return /* @__PURE__ */ L(d, { children: [/* @__PURE__ */ I(g, {
|
|
1262
1274
|
asChild: !0,
|
|
1263
1275
|
children: /* @__PURE__ */ I(q, {
|
|
@@ -1274,7 +1286,7 @@ function _t({ to: e, icon: t, label: n, active: r }) {
|
|
|
1274
1286
|
}
|
|
1275
1287
|
//#endregion
|
|
1276
1288
|
//#region src/bento/bento-user-menu.tsx
|
|
1277
|
-
function
|
|
1289
|
+
function yt({ accountRoute: e, logoutUrl: t, organizationsRoute: r, tenantAdminRoute: i, onOpenShortcuts: a, onReplayTour: s }) {
|
|
1278
1290
|
let { user: d, status: f } = x(), { t: p } = G(), h = J(), g = `${d.firstName ?? ""} ${d.lastName ?? ""}`.trim() || d.username || "";
|
|
1279
1291
|
return f === "loading" ? /* @__PURE__ */ I("div", {
|
|
1280
1292
|
className: "h-9 w-9 rounded-full bg-muted/40",
|
|
@@ -1363,17 +1375,17 @@ function vt({ accountRoute: e, logoutUrl: t, organizationsRoute: r, tenantAdminR
|
|
|
1363
1375
|
}
|
|
1364
1376
|
//#endregion
|
|
1365
1377
|
//#region src/bento/bento-section-chrome.tsx
|
|
1366
|
-
var
|
|
1367
|
-
function
|
|
1368
|
-
return /* @__PURE__ */ I(
|
|
1378
|
+
var bt = O("console");
|
|
1379
|
+
function xt({ chrome: e, children: t }) {
|
|
1380
|
+
return /* @__PURE__ */ I(bt.Provider, {
|
|
1369
1381
|
value: e,
|
|
1370
1382
|
children: t
|
|
1371
1383
|
});
|
|
1372
1384
|
}
|
|
1373
|
-
function
|
|
1374
|
-
return A(
|
|
1385
|
+
function St() {
|
|
1386
|
+
return A(bt);
|
|
1375
1387
|
}
|
|
1376
|
-
var
|
|
1388
|
+
var Ct = {
|
|
1377
1389
|
blue: "blue",
|
|
1378
1390
|
violet: "violet",
|
|
1379
1391
|
emerald: "emerald",
|
|
@@ -1384,14 +1396,14 @@ var St = {
|
|
|
1384
1396
|
orange: "amber"
|
|
1385
1397
|
};
|
|
1386
1398
|
function $({ variant: e = "blue", defaultOpen: t, className: n, children: r }) {
|
|
1387
|
-
let i = A(
|
|
1399
|
+
let i = A(bt), a, o;
|
|
1388
1400
|
return i === "bento" && D.forEach(r, (e) => {
|
|
1389
1401
|
if (!k(e)) return;
|
|
1390
1402
|
let { type: t } = e;
|
|
1391
1403
|
t === w.Header || t === w.StaticHeader ? a = e.props : t === w.Content && (o = e.props.children);
|
|
1392
1404
|
}), i === "bento" && a ? /* @__PURE__ */ I(ot, {
|
|
1393
1405
|
icon: a.icon,
|
|
1394
|
-
tone:
|
|
1406
|
+
tone: Ct[e] ?? "blue",
|
|
1395
1407
|
title: a.title,
|
|
1396
1408
|
description: a.description,
|
|
1397
1409
|
children: o
|
|
@@ -1405,8 +1417,8 @@ function $({ variant: e = "blue", defaultOpen: t, className: n, children: r }) {
|
|
|
1405
1417
|
$.Header = w.Header, $.StaticHeader = w.StaticHeader, $.Content = w.Content;
|
|
1406
1418
|
//#endregion
|
|
1407
1419
|
//#region src/bento/bento-section.tsx
|
|
1408
|
-
var
|
|
1409
|
-
function
|
|
1420
|
+
var wt = "bento-grid grid auto-rows-[minmax(140px,auto)] grid-cols-2 gap-4 md:grid-cols-4 md:gap-5 lg:grid-cols-6";
|
|
1421
|
+
function Tt({ eyebrow: e, title: t, description: n, titleHref: r, children: i, gridClassName: a = wt }) {
|
|
1410
1422
|
let o = /* @__PURE__ */ I("h2", {
|
|
1411
1423
|
className: "text-xl font-semibold tracking-tight md:text-2xl",
|
|
1412
1424
|
children: t
|
|
@@ -1441,7 +1453,7 @@ function wt({ eyebrow: e, title: t, description: n, titleHref: r, children: i, g
|
|
|
1441
1453
|
}
|
|
1442
1454
|
//#endregion
|
|
1443
1455
|
//#region src/bento/bento-tile.tsx
|
|
1444
|
-
function
|
|
1456
|
+
function Et({ to: e, onClick: t, disabled: n = !1, disabledHint: r, icon: i, tone: a, eyebrow: o, title: s, span: c, featured: l = !1, children: u }) {
|
|
1445
1457
|
let d = !n && !!(e || t), f = l ? "h-14 w-14 rounded-2xl" : "h-9 w-9 rounded-2xl", p = l ? 28 : 18, m = l ? "text-xl font-semibold tracking-tight md:text-2xl" : "text-base font-semibold tracking-tight md:text-lg", h = /* @__PURE__ */ L(F, { children: [
|
|
1446
1458
|
l && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
|
|
1447
1459
|
"aria-hidden": !0,
|
|
@@ -1498,4 +1510,4 @@ function Tt({ to: e, onClick: t, disabled: n = !1, disabledHint: r, icon: i, ton
|
|
|
1498
1510
|
});
|
|
1499
1511
|
}
|
|
1500
1512
|
//#endregion
|
|
1501
|
-
export { $ as AdaptiveSectionCard, He as BENTO_EMPHASIS_NEXT, Ve as BENTO_EMPHASIS_SPAN, Me as BENTO_TONES, Y as BENTO_TONE_CLASS, je as BentoActionsMenu, Z as BentoBackLink,
|
|
1513
|
+
export { $ as AdaptiveSectionCard, He as BENTO_EMPHASIS_NEXT, Ve as BENTO_EMPHASIS_SPAN, Me as BENTO_TONES, Y as BENTO_TONE_CLASS, je as BentoActionsMenu, Z as BentoBackLink, dt as BentoBackToTop, pt as BentoCommandPalette, Ne as BentoCountTile, Pe as BentoEmptyState, Be as BentoEntityShell, Ge as BentoEntityTile, at as BentoFormHero, ot as BentoFormSection, Q as BentoHero, Fe as BentoHeroIconPicker, Ie as BentoInlineEdit, qe as BentoListPage, _t as BentoNavRail, st as BentoPanel, nt as BentoSaveBar, it as BentoScrollSaveBar, Tt as BentoSection, mt as BentoShortcutsDialog, Le as BentoStatusMarker, Et as BentoTile, Je as BentoTileGrid, yt as BentoUserMenu, xt as SectionCardChromeProvider, X as bentoChipClass, ft as bentoNavTarget, Ue as resolveBentoLayout, We as toBentoLayoutEntries, Re as useBentoScrollFade, St as useSectionChrome };
|