@gravitee/graphene-core 2.51.0 → 2.52.0-feat-layout-content-width-tiers.41415b9
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/USAGE_GUIDE.md +130 -11
- package/dist/composed/AppLayout/AppLayout.d.ts +17 -4
- package/dist/composed/AppLayout/AppLayout.d.ts.map +1 -1
- package/dist/composed/LayoutSlots/LayoutSlotsContext.d.ts +11 -1
- package/dist/composed/LayoutSlots/LayoutSlotsContext.d.ts.map +1 -1
- package/dist/composed/LayoutSlots/use-layout-config.d.ts +3 -0
- package/dist/composed/LayoutSlots/use-layout-config.d.ts.map +1 -1
- package/dist/composed/PageContent/PageContent.d.ts +32 -0
- package/dist/composed/PageContent/PageContent.d.ts.map +1 -0
- package/dist/composed/PageContent/index.d.ts +3 -0
- package/dist/composed/PageContent/index.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7243 -7216
- package/dist/lib/view-transitions.d.ts +14 -0
- package/dist/lib/view-transitions.d.ts.map +1 -0
- package/dist/styles/globals.css +1 -1
- package/dist/styles/tailwind-theme.css +2 -0
- package/dist/tokens/component.css +2 -1
- package/package.json +2 -1
- package/snippets/context-sidebar-detail-page.tsx +10 -1
- package/snippets/creation-wizard-page.tsx +121 -0
- package/snippets/data-table-list-page.tsx +5 -0
package/USAGE_GUIDE.md
CHANGED
|
@@ -141,9 +141,47 @@ Scale: `0`, `0.5`, `1`, `1.5`, `2`, `2.5`, `3`, `3.5`, `4`, `5`, `6`, `7`, `8`,
|
|
|
141
141
|
|
|
142
142
|
`rounded-sm`, `rounded-md`, `rounded-lg`, `rounded-xl` (mapped to semantic `--radius`).
|
|
143
143
|
|
|
144
|
-
### Layout
|
|
144
|
+
### Layout — content width system
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
All pages share a single uniform container (100rem / 1600px, centered). No per-page width decisions needed — the container never changes between sibling pages, eliminating layout shifts during navigation.
|
|
147
|
+
|
|
148
|
+
| Layer | Token | Rem | When to use |
|
|
149
|
+
|-------|-------|-----|-------------|
|
|
150
|
+
| Container (default) | `--content-max-width` | `100rem` | Everything. Applied automatically by `AppLayout`. |
|
|
151
|
+
| Full-bleed | N/A | none | Tool layouts (Policy Studio, LLM Studio). Set via `useLayoutConfig({ contentVariant: 'full-bleed' })`. |
|
|
152
|
+
| `<PageFocused>` | `--content-focused-width` | `56rem` | Optional. Creation wizards, steppers, onboarding flows. |
|
|
153
|
+
|
|
154
|
+
**Decision rule:**
|
|
155
|
+
|
|
156
|
+
1. Is this a tool/workspace layout? → `useLayoutConfig({ contentVariant: 'full-bleed' })`
|
|
157
|
+
2. Is this a single-column creation wizard or stepper? → Wrap content in `<PageFocused>`
|
|
158
|
+
3. Everything else → Do nothing. The 100rem centered container handles tables, forms, dashboards, and settings equally.
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
import { PageFocused } from '@gravitee/graphene-core';
|
|
162
|
+
|
|
163
|
+
// Wizard/creation page — focused and centered
|
|
164
|
+
function CreateApiPage() {
|
|
165
|
+
return (
|
|
166
|
+
<PageFocused>
|
|
167
|
+
<StepProgress steps={steps} activeStep={step} />
|
|
168
|
+
<StepContent />
|
|
169
|
+
</PageFocused>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Everything else — just render content directly
|
|
174
|
+
function ApisPage() {
|
|
175
|
+
return (
|
|
176
|
+
<div className="space-y-4">
|
|
177
|
+
<h2>APIs</h2>
|
|
178
|
+
<DataTable ... />
|
|
179
|
+
</div>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
All width values are in `rem` so they scale with user font-size preferences and browser zoom. Do NOT set `max-w-*` classes on page wrappers — the design system handles it via `AppLayout`.
|
|
147
185
|
|
|
148
186
|
## Styling
|
|
149
187
|
|
|
@@ -293,27 +331,108 @@ If you have not migrated to `AppContextBar` yet, keeping the app name as the fir
|
|
|
293
331
|
|
|
294
332
|
**Linear breadcrumbs:** When each step maps to a **path string** and React Router’s `navigate`, use **`buildLinearBreadcrumbs(navigate, segments)`** so `ContentHeader` / `useLayoutConfig` get consistent `BreadcrumbEntry[]` without copying the same `onClick` wiring. If the first crumb is a **custom action** (e.g. “back” that is not `navigate('/path')`), build that entry by hand or mix with `buildLinearBreadcrumbs`—see Storybook **Composed/ContentHeader → Linear breadcrumbs from builder** for the canonical route-based pattern. API edge cases are covered in `packages/core/src/lib/breadcrumbs/buildLinearBreadcrumbs.test.ts`.
|
|
295
333
|
|
|
296
|
-
### `contentVariant` —
|
|
334
|
+
### `contentVariant` — content width tiers
|
|
335
|
+
|
|
336
|
+
`AppLayout` accepts `contentVariant` to control content area width and padding:
|
|
297
337
|
|
|
298
|
-
`
|
|
338
|
+
- `"default"` (default) — `max-w-content` (80rem) with standard padding. Most pages.
|
|
339
|
+
- `"wide"` — `max-w-wide` (100rem) with standard padding. DataTable list pages.
|
|
340
|
+
- `"full-bleed"` — no max-width, no padding; content spans edge-to-edge. Tool layouts and observability pages.
|
|
299
341
|
|
|
300
|
-
|
|
301
|
-
|
|
342
|
+
```tsx
|
|
343
|
+
// Default (80rem) — no change needed, AppLayout applies it automatically
|
|
344
|
+
<AppLayout>
|
|
345
|
+
<DetailPage />
|
|
346
|
+
</AppLayout>
|
|
347
|
+
|
|
348
|
+
// Wide (100rem) — for DataTable list pages, add one line
|
|
349
|
+
useLayoutConfig({ contentVariant: 'wide' }, []);
|
|
350
|
+
|
|
351
|
+
// Full-bleed — for tool layouts and observability pages
|
|
352
|
+
useLayoutConfig({ contentVariant: 'full-bleed' }, []);
|
|
353
|
+
```
|
|
302
354
|
|
|
303
|
-
|
|
355
|
+
With `useLayoutConfig` (module federation), a nested page can set `contentVariant` without affecting other layout slots owned by parent components. Each hook only resets the keys it owns on unmount.
|
|
356
|
+
|
|
357
|
+
#### Artifact-free page transitions
|
|
358
|
+
|
|
359
|
+
When navigating between pages with different `contentVariant` values, wrap the navigation action in `startLayoutTransition` to eliminate visual overlap artifacts during DOM reconciliation:
|
|
304
360
|
|
|
305
361
|
```tsx
|
|
306
|
-
|
|
307
|
-
|
|
362
|
+
import { startLayoutTransition } from '@gravitee/graphene-core';
|
|
363
|
+
|
|
364
|
+
// In your router or navigation handler (called once, not per-page):
|
|
365
|
+
function useAppNavigate() {
|
|
366
|
+
const navigate = useNavigate();
|
|
367
|
+
return useCallback((to: string) => {
|
|
368
|
+
startLayoutTransition(() => navigate(to));
|
|
369
|
+
}, [navigate]);
|
|
370
|
+
}
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
This uses the View Transitions API to capture the old visual state before applying DOM changes, preventing any intermediate "two pages visible" flash. No visible animation is produced; the swap is perceptually instant. Falls back to direct execution in browsers without View Transitions API support.
|
|
374
|
+
|
|
375
|
+
When the user has **Reduce motion** enabled at the OS level (`prefers-reduced-motion: reduce`), view-transition animation duration is `0ms` and navigation is fully instant.
|
|
376
|
+
|
|
377
|
+
### `banner` — full-width status slot
|
|
378
|
+
|
|
379
|
+
`AppLayout` accepts a `banner` prop that renders a full-width region above the padded content wrapper but inside the scroll container. Use it for persistent status indicators with an action (deploy status, environment warnings).
|
|
380
|
+
|
|
381
|
+
```tsx
|
|
382
|
+
// Direct prop usage
|
|
383
|
+
<AppLayout banner={<DeployStrip />} bannerSticky>
|
|
384
|
+
<PageContent />
|
|
308
385
|
</AppLayout>
|
|
386
|
+
|
|
387
|
+
// Module federation via useLayoutConfig
|
|
388
|
+
useLayoutConfig({
|
|
389
|
+
banner: deployState === 'NEED_REDEPLOY' ? (
|
|
390
|
+
<DeployStrip onDeploy={handleDeploy} isPending={isPending} />
|
|
391
|
+
) : null,
|
|
392
|
+
bannerSticky: true,
|
|
393
|
+
}, [deployState, handleDeploy, isPending]);
|
|
309
394
|
```
|
|
310
395
|
|
|
311
|
-
|
|
396
|
+
The banner spans full width regardless of `contentVariant`. When `bannerSticky` is true, it sticks to the top of the scroll area so the action remains reachable while scrolling.
|
|
397
|
+
|
|
398
|
+
**Button hierarchy:** When a banner contains an action button alongside page content that has its own primary buttons, use an outline treatment on the banner button to avoid competing with the page's primary CTA:
|
|
312
399
|
|
|
313
400
|
```tsx
|
|
314
|
-
|
|
401
|
+
function DeployStrip({ onDeploy, isPending }) {
|
|
402
|
+
return (
|
|
403
|
+
<div className="flex items-center gap-2 border-b border-border px-5 py-1.5">
|
|
404
|
+
<span className="size-1.5 shrink-0 rounded-full bg-warning" />
|
|
405
|
+
<span className="text-sm text-muted-foreground">Undeployed changes</span>
|
|
406
|
+
<div className="flex-1" />
|
|
407
|
+
<button
|
|
408
|
+
type="button"
|
|
409
|
+
className="rounded-md border border-warning/25 bg-warning/5 px-2.5 py-0.5 text-sm font-semibold text-warning-foreground transition-colors hover:bg-warning/10 disabled:opacity-50"
|
|
410
|
+
onClick={onDeploy}
|
|
411
|
+
disabled={isPending}
|
|
412
|
+
>
|
|
413
|
+
{isPending ? 'Deploying…' : 'Deploy API'}
|
|
414
|
+
</button>
|
|
415
|
+
</div>
|
|
416
|
+
);
|
|
417
|
+
}
|
|
315
418
|
```
|
|
316
419
|
|
|
420
|
+
See Storybook **Composed/AppLayout → BannerSlot** for the full interactive example.
|
|
421
|
+
|
|
422
|
+
### Adopting content width tiers in consumer modules
|
|
423
|
+
|
|
424
|
+
Follow these steps to apply the layout tier system to an existing consumer module:
|
|
425
|
+
|
|
426
|
+
1. **Identify all pages** in your module that render inside `AppLayout`.
|
|
427
|
+
2. **Categorize each page:**
|
|
428
|
+
- **Default** — detail views, edit forms, overviews, settings, creation wizards. No change needed; `AppLayout` applies `max-w-content` (80rem) automatically.
|
|
429
|
+
- **Wide** — any page whose primary content is a `DataTable`. Add `useLayoutConfig({ contentVariant: 'wide' }, [])` at the top of the component.
|
|
430
|
+
- **Full-bleed** — tool layouts (Policy Studio) or observability pages (dashboards, explorers). Add `useLayoutConfig({ contentVariant: 'full-bleed' }, [])` if not already set.
|
|
431
|
+
3. **Remove ad-hoc width constraints** — delete any `max-w-*` classes on page-level wrapper divs. The design system owns content width.
|
|
432
|
+
4. **Verify** — resize the browser to confirm content centers correctly on wide viewports and doesn't clip on narrow ones.
|
|
433
|
+
|
|
434
|
+
See `packages/core/snippets/data-table-list-page.tsx` for a complete list-page example with `useLayoutConfig`.
|
|
435
|
+
|
|
317
436
|
### Data table (entity list pages)
|
|
318
437
|
|
|
319
438
|
Use `DataTable` for any entity list — whether the data is fetched page-by-page from an API or loaded in full on the client. The component provides sorting, filtering, pagination, column visibility, row selection, and bulk actions through a composable slot API.
|
|
@@ -18,11 +18,24 @@ interface AppLayoutProps {
|
|
|
18
18
|
/** Optional callback when context expansion state changes. */
|
|
19
19
|
readonly onContextExpandedChange?: (expanded: boolean) => void;
|
|
20
20
|
/**
|
|
21
|
-
* Controls content area padding.
|
|
22
|
-
* - `"default"` —
|
|
23
|
-
* - `"full-bleed"` — no padding; content spans edge-to-edge.
|
|
21
|
+
* Controls content area width and padding.
|
|
22
|
+
* - `"default"` — `max-w-content` (100rem) centered with standard padding.
|
|
23
|
+
* - `"full-bleed"` — no max-width, no padding; content spans edge-to-edge.
|
|
24
|
+
*
|
|
25
|
+
* All standard pages use the default container. Wizards can optionally
|
|
26
|
+
* use `<PageFocused>` inside the default container for a narrower focus.
|
|
27
|
+
*
|
|
28
|
+
* @deprecated `"wide"` is accepted for backward compatibility but is equivalent to `"default"`.
|
|
24
29
|
*/
|
|
25
|
-
readonly contentVariant?: 'default' | 'full-bleed';
|
|
30
|
+
readonly contentVariant?: 'default' | 'wide' | 'full-bleed';
|
|
31
|
+
/**
|
|
32
|
+
* Full-width banner rendered above the padded content area.
|
|
33
|
+
* Sits inside the scroll container but outside the content padding wrapper,
|
|
34
|
+
* so it spans edge-to-edge regardless of `contentVariant`.
|
|
35
|
+
*/
|
|
36
|
+
readonly banner?: ReactNode;
|
|
37
|
+
/** When true the banner sticks to the top of the scroll container. Defaults to `false`. */
|
|
38
|
+
readonly bannerSticky?: boolean;
|
|
26
39
|
/**
|
|
27
40
|
* When true the layout spans the full viewport height.
|
|
28
41
|
* Defaults to `true` (sidebar-dominant shell).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppLayout.d.ts","sourceRoot":"","sources":["../../../src/composed/AppLayout/AppLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAA6B,MAAM,OAAO,CAAC;AAGtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAEhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAGhF,UAAU,cAAc;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC;IACpC,6EAA6E;IAC7E,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,CAAC;IAC/B,yBAAyB;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACzC,iEAAiE;IACjE,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,8DAA8D;IAC9D,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/D
|
|
1
|
+
{"version":3,"file":"AppLayout.d.ts","sourceRoot":"","sources":["../../../src/composed/AppLayout/AppLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,SAAS,EAA6B,MAAM,OAAO,CAAC;AAGtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAEhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAGh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
8
|
readonly leading: ReactNode;
|
|
9
9
|
readonly viewMode: 'global' | 'context';
|
|
10
10
|
readonly contextExpanded: boolean;
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* `"default"` — 100rem centered with padding (use for all standard pages).
|
|
13
|
+
* `"full-bleed"` — no max-width, no padding (tool layouts like Policy Studio).
|
|
14
|
+
*
|
|
15
|
+
* @deprecated `"wide"` is accepted for backward compatibility but equivalent to `"default"`.
|
|
16
|
+
*/
|
|
17
|
+
readonly contentVariant: 'default' | 'wide' | 'full-bleed';
|
|
18
|
+
/** Full-width banner rendered above the padded content area (e.g. deploy status, environment warnings). */
|
|
19
|
+
readonly banner: ReactNode;
|
|
20
|
+
/** When true the banner sticks to the top of the scroll container. */
|
|
21
|
+
readonly bannerSticky: boolean;
|
|
12
22
|
}
|
|
13
23
|
interface LayoutSlotsContextValue {
|
|
14
24
|
readonly slots: LayoutSlots;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutSlotsContext.d.ts","sourceRoot":"","sources":["../../../src/composed/LayoutSlots/LayoutSlotsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAA8C,MAAM,OAAO,CAAC;AAClG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAEtF,UAAU,WAAW;IACnB,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,QAAQ,CAAC,cAAc,EAAE,SAAS,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,eAAe,EAAE,CAAC;IACxC,sFAAsF;IACtF,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,SAAS,GAAG,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"LayoutSlotsContext.d.ts","sour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EAAE,SAAS,CAAA;CAAE,+BAwB1E;AAED,iBAAS,cAAc,IAAI,uBAAuB,CAMjD;AAED,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,cAAc,EAAE,CAAC;AAC9D,YAAY,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -7,6 +7,9 @@ import { LayoutSlots } from './LayoutSlotsContext';
|
|
|
7
7
|
* **Resets all slots to defaults on unmount** so stale module content
|
|
8
8
|
* never lingers after navigation.
|
|
9
9
|
*
|
|
10
|
+
* Uses `useLayoutEffect` to apply config synchronously before paint,
|
|
11
|
+
* preventing visible layout shifts during navigation.
|
|
12
|
+
*
|
|
10
13
|
* @param config - Slot values the module wants to own.
|
|
11
14
|
* @param deps - Dependency array that triggers a config re-push
|
|
12
15
|
* (same semantics as `useEffect` deps).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-layout-config.d.ts","sourceRoot":"","sources":["../../../src/composed/LayoutSlots/use-layout-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,sBAAsB,CAAC;AAExE
|
|
1
|
+
{"version":3,"file":"use-layout-config.d.ts","sourceRoot":"","sources":["../../../src/composed/LayoutSlots/use-layout-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,sBAAsB,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,iBAAS,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,GAAE,KAAK,CAAC,cAAmB,QAYrF;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface PageFocusedProps {
|
|
3
|
+
/** Focused content (stepper, creation wizard, onboarding flow). */
|
|
4
|
+
readonly children: ReactNode;
|
|
5
|
+
readonly className?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Constrains and centers page content for focused flows (56rem / 896px).
|
|
9
|
+
*
|
|
10
|
+
* Use for creation wizards, multi-step forms, onboarding sequences, and
|
|
11
|
+
* any task where the user is working through a focused linear flow.
|
|
12
|
+
* The centering signals "you are in a sub-task" and draws the eye inward.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* export function CreateApiWizardPage() {
|
|
17
|
+
* return (
|
|
18
|
+
* <PageFocused>
|
|
19
|
+
* <StepProgress steps={steps} activeStep={step} />
|
|
20
|
+
* <StepContent />
|
|
21
|
+
* </PageFocused>
|
|
22
|
+
* );
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare function PageFocused({ children, className }: PageFocusedProps): import("react").JSX.Element;
|
|
27
|
+
declare namespace PageFocused {
|
|
28
|
+
var displayName: string;
|
|
29
|
+
}
|
|
30
|
+
export { PageFocused };
|
|
31
|
+
export type { PageFocusedProps };
|
|
32
|
+
//# sourceMappingURL=PageContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageContent.d.ts","sourceRoot":"","sources":["../../../src/composed/PageContent/PageContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,UAAU,gBAAgB;IACxB,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,iBAAS,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BAE7D;kBAFQ,WAAW;;;AAMpB,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composed/PageContent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { cn } from './lib/utils';
|
|
2
2
|
export { PortalContainerProvider, usePortalContainer } from './lib/PortalContainerContext';
|
|
3
|
+
export { startLayoutTransition } from './lib/view-transitions';
|
|
3
4
|
export * from './base/Accordion';
|
|
4
5
|
export * from './base/Alert';
|
|
5
6
|
export * from './base/Avatar';
|
|
@@ -62,6 +63,7 @@ export * from './composed/FacetedFilter';
|
|
|
62
63
|
export * from './composed/FileUpload';
|
|
63
64
|
export * from './composed/JsonSchemaForm';
|
|
64
65
|
export * from './composed/LayoutSlots';
|
|
66
|
+
export * from './composed/PageContent';
|
|
65
67
|
export * from './composed/PasswordInput';
|
|
66
68
|
export * from './composed/SelectorDropdown';
|
|
67
69
|
export * from './composed/SidebarMode';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAA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