@peektravel/app-utilities 0.1.2 → 0.1.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/dist/ui/index.cjs +18 -3
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.cts +45 -1
- package/dist/ui/index.d.ts +45 -1
- package/dist/ui/index.js +18 -4
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/odyssey.css +6 -0
- package/docs/ui.md +53 -2
- package/package.json +1 -1
package/dist/ui/odyssey.css
CHANGED
|
@@ -178,6 +178,7 @@ ody-alert, ody-card, ody-divider, ody-loading-bar { display: block; }
|
|
|
178
178
|
.ody-card__container { min-height: 2rem; color: var(--color-neutral-300); }
|
|
179
179
|
.ody-card__container__bar { background-color: var(--color-neutral-200); width: 4px; border-radius: 16px 0 0 16px; height: auto; }
|
|
180
180
|
.ody-card__container__content { padding: 10px 12px; border-radius: 0 4px 4px 0; border: 1px solid var(--color-neutral-100); border-left: none; width: 100%; }
|
|
181
|
+
.ody-card--no-bar .ody-card__container__content { border-radius: 4px; border-left: 1px solid var(--color-neutral-100); }
|
|
181
182
|
.ody-card--clickable { cursor: pointer; }
|
|
182
183
|
|
|
183
184
|
/* ---- divider ------------------------------------------------------------- */
|
|
@@ -222,6 +223,7 @@ ody-alert, ody-card, ody-divider, ody-loading-bar { display: block; }
|
|
|
222
223
|
ody-list-item, ody-product-indicator, ody-toggle-button, ody-section-columns,
|
|
223
224
|
ody-section-column-item, ody-section-rows, ody-section-row-item, ody-two-column,
|
|
224
225
|
ody-two-column-main, ody-two-column-secondary, ody-two-column-secondary-header,
|
|
226
|
+
ody-page-container,
|
|
225
227
|
ody-collapsible-section, ody-collapsible-collapsed, ody-collapsible-content,
|
|
226
228
|
ody-input, ody-inline-input, ody-search-input, ody-money-input, ody-percentage-input,
|
|
227
229
|
ody-checkbox, ody-radio-button-group, ody-checkbox-group, ody-accordion, ody-collapsible,
|
|
@@ -379,6 +381,10 @@ ody-percentage-input, ody-checkbox, ody-radio-button-group, ody-checkbox-group {
|
|
|
379
381
|
.ody-two-column .ody-two-column__secondary .ody-two-column__secondary__close-button { background: none; border: none; cursor: pointer; color: var(--color-neutral-300); }
|
|
380
382
|
.ody-two-column .ody-two-column__secondary .ody-two-column__secondary__close-button .icon { width: 20px; height: 20px; }
|
|
381
383
|
|
|
384
|
+
/* ===== page-container ===== */
|
|
385
|
+
ody-page-container { display: block; width: 100%; }
|
|
386
|
+
.ody-page-container { width: 100%; max-width: 1310px; margin: 0 auto; container-type: inline-size; container-name: ody-page; }
|
|
387
|
+
|
|
382
388
|
/* ===== collapsible-section ===== */
|
|
383
389
|
.ody-collapsible-section .ody-collapsible-container .ody-collapsible { margin: 0; }
|
|
384
390
|
.ody-collapsible-section .ody-collapsible__header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; width: 100%; background: none; border: none; padding: 0; cursor: pointer; text-align: left; }
|
package/docs/ui.md
CHANGED
|
@@ -161,6 +161,7 @@ function Guests({ columns, rows, onSort }) {
|
|
|
161
161
|
| Empty / error / no-results view | `ody-empty-state` |
|
|
162
162
|
| KPI figures | `ody-stat-summary` + `ody-stat` |
|
|
163
163
|
| Expand/collapse | `ody-accordion`, `ody-collapsible`, `ody-collapsible-section` |
|
|
164
|
+
| Full-page wrapper for an **app settings UI** | `ody-page-container` (required — see below) |
|
|
164
165
|
| Master/detail page layout | `ody-two-column` |
|
|
165
166
|
| Row/column section layout | `ody-section-rows` / `ody-section-columns` |
|
|
166
167
|
| Progress | `ody-loading-bar`, `ody-loading-spinner` |
|
|
@@ -232,13 +233,22 @@ be set on the element object; **Events** bubble and are read via `event.detail`;
|
|
|
232
233
|
```
|
|
233
234
|
|
|
234
235
|
#### `<ody-card>`
|
|
235
|
-
**Use when** grouping content in a bordered container
|
|
236
|
+
**Use when** grouping content in a bordered container. Reach for the plain
|
|
237
|
+
`no-bar` card by default; add a left accent bar only when the bar's colour
|
|
238
|
+
carries meaning (e.g. status).
|
|
236
239
|
**Attributes**
|
|
237
|
-
- `bar
|
|
240
|
+
- `no-bar` — boolean; omits the accent bar, rendering a plain bordered
|
|
241
|
+
container. **This is the default card to use.**
|
|
242
|
+
- `bar-color` — CSS colour for the accent bar (default neutral-200). Ignored
|
|
243
|
+
when `no-bar` is set.
|
|
238
244
|
- `clickable` — boolean; adds pointer affordance (handle `click` yourself).
|
|
239
245
|
**Slots / content** — child nodes are the card content.
|
|
240
246
|
**Example**
|
|
241
247
|
```html
|
|
248
|
+
<!-- Default: plain bordered card -->
|
|
249
|
+
<ody-card no-bar><p>Card body</p></ody-card>
|
|
250
|
+
|
|
251
|
+
<!-- Accent bar when the colour is meaningful -->
|
|
242
252
|
<ody-card bar-color="var(--color-interaction-300)"><p>Card body</p></ody-card>
|
|
243
253
|
```
|
|
244
254
|
|
|
@@ -440,6 +450,47 @@ Extra content (e.g. a tag) is the child content.
|
|
|
440
450
|
</ody-two-column>
|
|
441
451
|
```
|
|
442
452
|
|
|
453
|
+
#### `<ody-page-container>`
|
|
454
|
+
> [!IMPORTANT]
|
|
455
|
+
> **Every app settings UI must wrap its content in `<ody-page-container>`.** It is
|
|
456
|
+
> the standard responsive page wrapper that keeps the settings page sized to the
|
|
457
|
+
> two widths the settings host iframe renders at — **868px** (narrow) and
|
|
458
|
+
> **1310px** (wide).
|
|
459
|
+
>
|
|
460
|
+
> **Design for 868px first — it is the default.** Optimise every settings layout
|
|
461
|
+
> for the narrow 868px width, then make sure it *also* renders correctly when the
|
|
462
|
+
> host expands it to 1310px (e.g. progressively widen or add columns; never
|
|
463
|
+
> assume the extra width is present). Do **not** design 1310px-first and let it
|
|
464
|
+
> degrade — 868px is the baseline that must always look right.
|
|
465
|
+
|
|
466
|
+
**Use when** building the top-level layout of an app settings page (or any
|
|
467
|
+
full-page UI embedded in the settings host).
|
|
468
|
+
The container is `width: 100%`, so it fills whichever of the two widths the
|
|
469
|
+
parent iframe gives it; a `max-width` of `1310px` caps and centres it if it is
|
|
470
|
+
ever embedded somewhere wider. Content is **full-bleed** (edge-to-edge, no side
|
|
471
|
+
gutters). It also establishes a CSS **container context** named `ody-page`, so
|
|
472
|
+
the content inside can adapt between the two widths with container queries
|
|
473
|
+
instead of viewport media queries — treat 868px as the base styles and use a
|
|
474
|
+
container query to *enhance* for the wider view.
|
|
475
|
+
**Attributes** — none; the width is driven entirely by the parent.
|
|
476
|
+
**Slots / content** — child nodes are the page content.
|
|
477
|
+
**Example**
|
|
478
|
+
```html
|
|
479
|
+
<ody-page-container>
|
|
480
|
+
<ody-section-rows gap-size="24">
|
|
481
|
+
…settings UI…
|
|
482
|
+
</ody-section-rows>
|
|
483
|
+
</ody-page-container>
|
|
484
|
+
```
|
|
485
|
+
```css
|
|
486
|
+
/* Base styles target the default 868px width… */
|
|
487
|
+
.my-settings-grid { grid-template-columns: 1fr; }
|
|
488
|
+
/* …then progressively enhance for the expanded 1310px view. */
|
|
489
|
+
@container ody-page (min-width: 1310px) {
|
|
490
|
+
.my-settings-grid { grid-template-columns: 1fr 1fr; }
|
|
491
|
+
}
|
|
492
|
+
```
|
|
493
|
+
|
|
443
494
|
#### `<ody-collapsible-section>` + `<ody-collapsible-collapsed>` + `<ody-collapsible-content>`
|
|
444
495
|
**Use when** a titled section that expands/collapses on header click.
|
|
445
496
|
- `ody-collapsible-section` **Attributes**: `header-text`, `secondary-header-text`, `icon` (icon name), `expanded` (boolean; reflected). **Events**: `expanded` → `{ expanded }`.
|