@gravitee/graphene-core 3.3.1 → 3.4.0-feat-add-missing-consumer-icons.74dc4d1
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 +11 -123
- package/dist/CodeEditor-Cnn11Gx1.js +2010 -0
- package/dist/__stories__/fixtures/index.d.ts +1 -1
- package/dist/__stories__/fixtures/index.d.ts.map +1 -1
- package/dist/__stories__/fixtures/navigation.fixture.d.ts +0 -7
- package/dist/__stories__/fixtures/navigation.fixture.d.ts.map +1 -1
- package/dist/code-editor/index.js +1 -1
- package/dist/composed/AppLayout/AppLayout.d.ts +3 -14
- package/dist/composed/AppLayout/AppLayout.d.ts.map +1 -1
- package/dist/composed/AppSidebar/AppSidebar.d.ts +1 -8
- package/dist/composed/AppSidebar/AppSidebar.d.ts.map +1 -1
- package/dist/composed/AppSidebar/SidebarNavigation.d.ts.map +1 -1
- package/dist/composed/AppSidebar/index.d.ts +1 -3
- package/dist/composed/AppSidebar/index.d.ts.map +1 -1
- package/dist/composed/AppSidebar/types.d.ts +1 -10
- package/dist/composed/AppSidebar/types.d.ts.map +1 -1
- package/dist/composed/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/SchemaField.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/fields/object/ObjectField.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/fields/oneOf/OneOfField.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/form-bindings/extractDefaults.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/schema/preprocess/relaxDeprecated.d.ts +5 -7
- package/dist/composed/JsonSchemaForm/schema/preprocess/relaxDeprecated.d.ts.map +1 -1
- package/dist/composed/JsonSchemaForm/utils/schemaShape.d.ts +1 -3
- package/dist/composed/JsonSchemaForm/utils/schemaShape.d.ts.map +1 -1
- package/dist/composed/LayoutSlots/LayoutSlotsContext.d.ts +0 -13
- package/dist/composed/LayoutSlots/LayoutSlotsContext.d.ts.map +1 -1
- package/dist/composed/LayoutSlots/use-layout-config.d.ts +0 -3
- package/dist/composed/LayoutSlots/use-layout-config.d.ts.map +1 -1
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/index.js +2 -2
- package/dist/{icons-YplRdF9A.js → icons-CYo6io01.js} +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9961 -9087
- package/dist/styles/globals.css +1 -1
- package/dist/styles/tailwind-theme.css +0 -2
- package/dist/tokens/component.css +1 -2
- package/package.json +2 -1
- package/snippets/context-sidebar-detail-page.tsx +2 -21
- package/snippets/json-schema-form-simple.tsx +1 -1
- package/snippets/json-schema-form-with-meta.tsx +1 -1
- package/dist/CodeEditor-W9JPCQhc.js +0 -261
- package/dist/CodeEditorField-cwZAv7Ib.js +0 -52
- package/dist/SchemaBanner-lrLehIB4.js +0 -1026
- package/dist/Skeleton-DYPFDpYt.js +0 -1754
- package/dist/composed/AppSidebar/SidebarUpgradeFooter.d.ts +0 -38
- package/dist/composed/AppSidebar/SidebarUpgradeFooter.d.ts.map +0 -1
- package/dist/composed/JsonSchemaForm/conditional/useDependencyBranchSync.d.ts +0 -27
- package/dist/composed/JsonSchemaForm/conditional/useDependencyBranchSync.d.ts.map +0 -1
- package/dist/composed/JsonSchemaForm/fields/resource/ResourceTypeField.d.ts +0 -8
- package/dist/composed/JsonSchemaForm/fields/resource/ResourceTypeField.d.ts.map +0 -1
- package/dist/composed/PageFocused/PageFocused.d.ts +0 -32
- package/dist/composed/PageFocused/PageFocused.d.ts.map +0 -1
- package/dist/composed/PageFocused/index.d.ts +0 -3
- package/dist/composed/PageFocused/index.d.ts.map +0 -1
- package/snippets/creation-wizard-page.tsx +0 -120
package/USAGE_GUIDE.md
CHANGED
|
@@ -141,41 +141,9 @@ 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
|
|
145
145
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
The layout owns both **padding** and **max-width** at the layout level. Page components must not duplicate either — do NOT add `p-6` / `p-*` / `px-*` / `py-*` or `max-w-*` classes on page-level wrapper divs.
|
|
149
|
-
|
|
150
|
-
**Decision rule:**
|
|
151
|
-
|
|
152
|
-
1. Is this a tool/workspace layout (Policy Studio, LLM Studio), observability dashboard, or log/trace explorer? → `useLayoutConfig({ contentVariant: 'full-bleed' })`
|
|
153
|
-
2. Is this a single-column creation/edit form with a back button and a focused workflow (e.g. alert form, plan form, resource wizard, onboarding stepper)? → Wrap content in `<PageFocused>`. Heuristic: if the page has a "← Back" button and its route matches `/new`, `/:id/edit`, or `/:id` under a list page, it's likely a focused form.
|
|
154
|
-
3. Everything else (list pages, detail views, settings, dashboards) → Do nothing. The default centered container handles it.
|
|
155
|
-
|
|
156
|
-
```tsx
|
|
157
|
-
import { PageFocused } from '@gravitee/graphene-core';
|
|
158
|
-
|
|
159
|
-
// Wizard/creation page — focused and centered
|
|
160
|
-
function CreateApiPage() {
|
|
161
|
-
return (
|
|
162
|
-
<PageFocused>
|
|
163
|
-
<StepProgress steps={steps} activeStep={step} />
|
|
164
|
-
<StepContent />
|
|
165
|
-
</PageFocused>
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// Everything else — just render content directly (no padding, no max-width)
|
|
170
|
-
function ApisPage() {
|
|
171
|
-
return (
|
|
172
|
-
<div className="space-y-4">
|
|
173
|
-
<h2>APIs</h2>
|
|
174
|
-
<DataTable ... />
|
|
175
|
-
</div>
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
```
|
|
146
|
+
- Content max width is defined on the theme token `--container-content` (maps to `--content-max-width`). Use the max-width utility Tailwind emits for that token in your setup.
|
|
179
147
|
|
|
180
148
|
## Styling
|
|
181
149
|
|
|
@@ -325,107 +293,27 @@ If you have not migrated to `AppContextBar` yet, keeping the app name as the fir
|
|
|
325
293
|
|
|
326
294
|
**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`.
|
|
327
295
|
|
|
328
|
-
### `contentVariant` — content
|
|
329
|
-
|
|
330
|
-
`AppLayout` accepts `contentVariant` to control content area width and padding:
|
|
331
|
-
|
|
332
|
-
- `"default"` (default) — centered container with standard padding. All standard pages.
|
|
333
|
-
- `"full-bleed"` — no max-width, no padding; content spans edge-to-edge. Tool layouts, observability dashboards, log/trace explorers.
|
|
334
|
-
|
|
335
|
-
```tsx
|
|
336
|
-
// Default — no change needed, AppLayout applies the centered container automatically
|
|
337
|
-
<AppLayout>
|
|
338
|
-
<DetailPage />
|
|
339
|
-
</AppLayout>
|
|
340
|
-
|
|
341
|
-
// Full-bleed — for tool layouts and observability pages
|
|
342
|
-
useLayoutConfig({ contentVariant: 'full-bleed' }, []);
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
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.
|
|
346
|
-
|
|
347
|
-
For creation wizards and steppers, wrap content in `<PageFocused>` inside the default container — see **Layout — content width system** above.
|
|
296
|
+
### `contentVariant` — full-bleed content
|
|
348
297
|
|
|
349
|
-
|
|
298
|
+
`AppLayout` accepts `contentVariant` to control content area padding:
|
|
350
299
|
|
|
351
|
-
|
|
300
|
+
- `"default"` (default) — standard padding on all sides.
|
|
301
|
+
- `"full-bleed"` — no padding; content spans edge-to-edge.
|
|
352
302
|
|
|
353
|
-
|
|
303
|
+
Use `full-bleed` for embedded components that manage their own layout grid (Policy Studio, dashboards, full-screen editors):
|
|
354
304
|
|
|
355
305
|
```tsx
|
|
356
|
-
<AppLayout
|
|
357
|
-
|
|
358
|
-
bannerSticky={slots.bannerSticky}
|
|
359
|
-
contentVariant={slots.contentVariant}
|
|
360
|
-
contextSidebar={slots.contextSidebar}
|
|
361
|
-
/* …other slot props… */
|
|
362
|
-
>
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
Without this wiring, `useLayoutConfig({ banner: … })` calls from consumer modules have no effect.
|
|
366
|
-
|
|
367
|
-
**Usage:**
|
|
368
|
-
|
|
369
|
-
```tsx
|
|
370
|
-
// Direct prop usage
|
|
371
|
-
<AppLayout banner={<DeployStrip />} bannerSticky>
|
|
372
|
-
<DetailPage />
|
|
306
|
+
<AppLayout contentVariant="full-bleed">
|
|
307
|
+
<PolicyStudio {...props} />
|
|
373
308
|
</AppLayout>
|
|
374
|
-
|
|
375
|
-
// Module federation via useLayoutConfig
|
|
376
|
-
useLayoutConfig({
|
|
377
|
-
banner: deployState === 'NEED_REDEPLOY' ? (
|
|
378
|
-
<DeployStrip onDeploy={handleDeploy} isPending={isPending} />
|
|
379
|
-
) : null,
|
|
380
|
-
bannerSticky: true,
|
|
381
|
-
}, [deployState, handleDeploy, isPending]);
|
|
382
309
|
```
|
|
383
310
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
**Migrating inline banners:** If a page currently renders a banner component inline within its page content, move it to `useLayoutConfig`. On unmount or when the status clears, set `banner: null` — `useLayoutConfig` resets owned keys automatically on unmount, so the banner won't linger after navigation.
|
|
387
|
-
|
|
388
|
-
**Accessibility:** Add `role="status"` and a descriptive `aria-label` on the banner's root element so screen readers announce it as a live region:
|
|
389
|
-
|
|
390
|
-
**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:
|
|
311
|
+
With `useLayoutConfig` (module federation), a nested page can set `contentVariant` without affecting other layout slots owned by parent components:
|
|
391
312
|
|
|
392
313
|
```tsx
|
|
393
|
-
|
|
394
|
-
return (
|
|
395
|
-
<div role="status" aria-label="Deployment status" className="flex items-center gap-2 border-b border-border px-5 py-1.5">
|
|
396
|
-
<span className="size-1.5 shrink-0 rounded-full bg-warning" aria-hidden="true" />
|
|
397
|
-
<span className="text-sm text-muted-foreground">Undeployed changes</span>
|
|
398
|
-
<div className="flex-1" />
|
|
399
|
-
<button
|
|
400
|
-
type="button"
|
|
401
|
-
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"
|
|
402
|
-
onClick={onDeploy}
|
|
403
|
-
disabled={isPending}
|
|
404
|
-
>
|
|
405
|
-
{isPending ? 'Deploying…' : 'Deploy API'}
|
|
406
|
-
</button>
|
|
407
|
-
</div>
|
|
408
|
-
);
|
|
409
|
-
}
|
|
314
|
+
useLayoutConfig({ contentVariant: 'full-bleed' }, []);
|
|
410
315
|
```
|
|
411
316
|
|
|
412
|
-
See Storybook **Composed/AppLayout → BannerSlot** for the full interactive example.
|
|
413
|
-
|
|
414
|
-
### Adopting the content width system in consumer modules
|
|
415
|
-
|
|
416
|
-
Follow these steps to apply the layout width system to an existing consumer module:
|
|
417
|
-
|
|
418
|
-
1. **Identify all pages** in your module that render inside `AppLayout`.
|
|
419
|
-
2. **Categorize each page:**
|
|
420
|
-
- **Default** — list pages, detail views, forms, settings, dashboards. No change needed; `AppLayout` applies the centered container automatically.
|
|
421
|
-
- **PageFocused** — single-column creation wizards or steppers with a back button and a focused workflow (e.g. alert form, plan form, resource wizard, onboarding stepper). Wrap content in `<PageFocused>`. Heuristic: if the page has a "← Back" button and its route matches `/new`, `/:id/edit`, or `/:id` under a list page, it's likely a focused form.
|
|
422
|
-
- **Full-bleed** — tool layouts (Policy Studio, LLM Studio), observability dashboards, log/trace explorers. Add `useLayoutConfig({ contentVariant: 'full-bleed' }, [])` if not already set.
|
|
423
|
-
3. **Remove page-level padding** — delete `p-6` and any `p-*`, `px-*`, `py-*` classes from the page's root wrapper `<div>`. The layout already provides content padding via the container. This is the most common change — nearly every page will need it.
|
|
424
|
-
4. **Remove ad-hoc width constraints** — delete any `max-w-*` classes on page-level wrapper divs. The design system owns content width.
|
|
425
|
-
5. **Verify** — resize the browser to confirm content stays centered without clipping on narrow viewports.
|
|
426
|
-
|
|
427
|
-
See `packages/core/snippets/data-table-list-page.tsx` and `creation-wizard-page.tsx` for complete examples.
|
|
428
|
-
|
|
429
317
|
### Data table (entity list pages)
|
|
430
318
|
|
|
431
319
|
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.
|