@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.
@@ -173,6 +173,8 @@ declare class OdyAlert extends OdyElement {
173
173
  * Attributes:
174
174
  * - `bar-color` — CSS colour for the accent bar (default neutral-200).
175
175
  * - `clickable` — adds pointer affordance (emit your own click handling).
176
+ * - `no-bar` — omits the accent bar entirely, rendering a plain bordered
177
+ * container (the default generic card).
176
178
  */
177
179
  declare class OdyCard extends OdyElement {
178
180
  static observedAttributes: string[];
@@ -550,6 +552,48 @@ declare class OdyTwoColumnSecondaryHeader extends OdyElement {
550
552
  protected render(): void;
551
553
  }
552
554
 
555
+ /**
556
+ * `<ody-page-container>` — the standard responsive page wrapper. **Every app
557
+ * settings UI must wrap its content in this element** so the page matches the
558
+ * two canonical iframe widths the settings host renders at: **868px** (narrow)
559
+ * and **1310px** (wide).
560
+ *
561
+ * **Design for 868px first — it is the default.** Optimise every settings
562
+ * layout for the narrow 868px width, then ensure it *also* renders correctly
563
+ * when the host expands it to 1310px. Treat 868px as the baseline that must
564
+ * always look right and progressively enhance for the wider view; never design
565
+ * 1310px-first and let it degrade, and never assume the extra width is present.
566
+ *
567
+ * The container is `width: 100%`, so it simply fills whichever of those two
568
+ * widths the parent iframe gives it; a `max-width` of 1310px caps it (and
569
+ * centres it) if it is ever embedded somewhere wider. Content is **full-bleed**
570
+ * — it spans the container edge-to-edge with no side gutters.
571
+ *
572
+ * It also establishes a CSS **container context** named `ody-page`, so the
573
+ * settings content inside can adapt between the two widths with container
574
+ * queries instead of viewport media queries — base styles target 868px, then
575
+ * enhance for 1310px:
576
+ *
577
+ * ```css
578
+ * .my-settings-grid { grid-template-columns: 1fr; } // default 868px
579
+ * @container ody-page (min-width: 1310px) { // expanded view
580
+ * .my-settings-grid { grid-template-columns: 1fr 1fr; }
581
+ * }
582
+ * ```
583
+ *
584
+ * No attributes — the width is driven entirely by the parent.
585
+ *
586
+ * Example:
587
+ * ```html
588
+ * <ody-page-container>
589
+ * …settings UI…
590
+ * </ody-page-container>
591
+ * ```
592
+ */
593
+ declare class OdyPageContainer extends OdyElement {
594
+ protected render(): void;
595
+ }
596
+
553
597
  /**
554
598
  * `<ody-collapsible-section>` — a titled section that expands/collapses on
555
599
  * header click. Place the expandable body in an `<ody-collapsible-content>`
@@ -1476,4 +1520,4 @@ declare function removePortal(node: Node): void;
1476
1520
  */
1477
1521
  declare function position(anchor: Element, floating: Element, placement?: OdyPlacement, gap?: number): OdyPosition;
1478
1522
 
1479
- export { OdyAccordion, OdyAlert, type OdyAlertVariant, OdyBrandIcon, type OdyBrandIconSize, OdyBreadcrumb, OdyBreadcrumbItem, OdyButton, type OdyButtonAppearance, type OdyButtonSize, type OdyButtonVariant, OdyCard, OdyCheckInStatus, type OdyCheckInStatusValue, OdyCheckbox, OdyCheckboxGroup, type OdyCheckboxGroupSize, type OdyCheckboxOption, type OdyCheckboxSize, OdyCollapsible, OdyCollapsibleCollapsed, OdyCollapsibleContent, OdyCollapsibleSection, OdyCopyButton, type OdyDateDisallowed, OdyDatePicker, type OdyDatePreset, OdyDivider, OdyDropdownMulti, OdyDropdownSingle, OdyElement, OdyEmptyState, type OdyEmptyStateVariant, OdyIcon, type OdyIconData, type OdyIconSize, OdyInlineInput, type OdyInlineInputSize, OdyInlineList, OdyInlineListItem, type OdyInlineListSeparator, OdyInput, type OdyInputSize, type OdyInputState, OdyListItem, OdyLoadingBar, OdyLoadingSpinner, OdyMessage, OdyModal, type OdyModalSize, OdyMoneyInput, type OdyMoneyInputSize, OdyOption, OdyPanel, OdyPercentageInput, type OdyPercentageInputSize, type OdyPlacement, OdyPopover, type OdyPosition, OdyProductIndicator, type OdyProductIndicatorSize, OdyRadioButtonGroup, type OdyRadioButtonGroupSize, type OdyRadioOption, OdySearchInput, type OdySearchInputSize, OdySectionColumnItem, OdySectionColumns, type OdySectionGap, OdySectionRowItem, OdySectionRows, type OdySectionVerticalAlign, OdySelectBase, type OdySelectOption, type OdySortDirection$1 as OdySortDirection, type OdySpinnerSize, OdySplitButton, OdyStat, OdyStatDetail, OdyStatSummary, OdyStatSummaryDetail, type OdyStatTone, OdyStatusDot, type OdyStatusDotColor, type OdyTabDef, OdyTable, type OdyTableAlign, type OdyTableColumn, OdyTableHeader, type OdyTableRow, type OdyTableRowClickDetail, type OdyTableSelectionChangeDetail, type OdyTableSortChangeDetail, type OdySortDirection as OdyTableSortDirection, OdyTabs, type OdyTabsPosition, type OdyTabsSize, OdyTag, type OdyTagColor, type OdyTagSize, type OdyTagVariant, type OdyTermKey, type OdyTerms, OdyToastHost, type OdyToastOptions, type OdyToastVariant, OdyToggleButton, type OdyToggleButtonSize, type OdyToggleOption, OdyTooltip, OdyTwoColumn, OdyTwoColumnMain, OdyTwoColumnSecondary, OdyTwoColumnSecondaryHeader, brandIconNames, brandIconSvg, classes, define, escapeHtml, hasBrandIcon, hasIcon, iconNames, iconSvg, parseOptions, portal, position, registerIcon, registerTranslation, removePortal, renderIconSvg, toast };
1523
+ export { OdyAccordion, OdyAlert, type OdyAlertVariant, OdyBrandIcon, type OdyBrandIconSize, OdyBreadcrumb, OdyBreadcrumbItem, OdyButton, type OdyButtonAppearance, type OdyButtonSize, type OdyButtonVariant, OdyCard, OdyCheckInStatus, type OdyCheckInStatusValue, OdyCheckbox, OdyCheckboxGroup, type OdyCheckboxGroupSize, type OdyCheckboxOption, type OdyCheckboxSize, OdyCollapsible, OdyCollapsibleCollapsed, OdyCollapsibleContent, OdyCollapsibleSection, OdyCopyButton, type OdyDateDisallowed, OdyDatePicker, type OdyDatePreset, OdyDivider, OdyDropdownMulti, OdyDropdownSingle, OdyElement, OdyEmptyState, type OdyEmptyStateVariant, OdyIcon, type OdyIconData, type OdyIconSize, OdyInlineInput, type OdyInlineInputSize, OdyInlineList, OdyInlineListItem, type OdyInlineListSeparator, OdyInput, type OdyInputSize, type OdyInputState, OdyListItem, OdyLoadingBar, OdyLoadingSpinner, OdyMessage, OdyModal, type OdyModalSize, OdyMoneyInput, type OdyMoneyInputSize, OdyOption, OdyPageContainer, OdyPanel, OdyPercentageInput, type OdyPercentageInputSize, type OdyPlacement, OdyPopover, type OdyPosition, OdyProductIndicator, type OdyProductIndicatorSize, OdyRadioButtonGroup, type OdyRadioButtonGroupSize, type OdyRadioOption, OdySearchInput, type OdySearchInputSize, OdySectionColumnItem, OdySectionColumns, type OdySectionGap, OdySectionRowItem, OdySectionRows, type OdySectionVerticalAlign, OdySelectBase, type OdySelectOption, type OdySortDirection$1 as OdySortDirection, type OdySpinnerSize, OdySplitButton, OdyStat, OdyStatDetail, OdyStatSummary, OdyStatSummaryDetail, type OdyStatTone, OdyStatusDot, type OdyStatusDotColor, type OdyTabDef, OdyTable, type OdyTableAlign, type OdyTableColumn, OdyTableHeader, type OdyTableRow, type OdyTableRowClickDetail, type OdyTableSelectionChangeDetail, type OdyTableSortChangeDetail, type OdySortDirection as OdyTableSortDirection, OdyTabs, type OdyTabsPosition, type OdyTabsSize, OdyTag, type OdyTagColor, type OdyTagSize, type OdyTagVariant, type OdyTermKey, type OdyTerms, OdyToastHost, type OdyToastOptions, type OdyToastVariant, OdyToggleButton, type OdyToggleButtonSize, type OdyToggleOption, OdyTooltip, OdyTwoColumn, OdyTwoColumnMain, OdyTwoColumnSecondary, OdyTwoColumnSecondaryHeader, brandIconNames, brandIconSvg, classes, define, escapeHtml, hasBrandIcon, hasIcon, iconNames, iconSvg, parseOptions, portal, position, registerIcon, registerTranslation, removePortal, renderIconSvg, toast };
@@ -173,6 +173,8 @@ declare class OdyAlert extends OdyElement {
173
173
  * Attributes:
174
174
  * - `bar-color` — CSS colour for the accent bar (default neutral-200).
175
175
  * - `clickable` — adds pointer affordance (emit your own click handling).
176
+ * - `no-bar` — omits the accent bar entirely, rendering a plain bordered
177
+ * container (the default generic card).
176
178
  */
177
179
  declare class OdyCard extends OdyElement {
178
180
  static observedAttributes: string[];
@@ -550,6 +552,48 @@ declare class OdyTwoColumnSecondaryHeader extends OdyElement {
550
552
  protected render(): void;
551
553
  }
552
554
 
555
+ /**
556
+ * `<ody-page-container>` — the standard responsive page wrapper. **Every app
557
+ * settings UI must wrap its content in this element** so the page matches the
558
+ * two canonical iframe widths the settings host renders at: **868px** (narrow)
559
+ * and **1310px** (wide).
560
+ *
561
+ * **Design for 868px first — it is the default.** Optimise every settings
562
+ * layout for the narrow 868px width, then ensure it *also* renders correctly
563
+ * when the host expands it to 1310px. Treat 868px as the baseline that must
564
+ * always look right and progressively enhance for the wider view; never design
565
+ * 1310px-first and let it degrade, and never assume the extra width is present.
566
+ *
567
+ * The container is `width: 100%`, so it simply fills whichever of those two
568
+ * widths the parent iframe gives it; a `max-width` of 1310px caps it (and
569
+ * centres it) if it is ever embedded somewhere wider. Content is **full-bleed**
570
+ * — it spans the container edge-to-edge with no side gutters.
571
+ *
572
+ * It also establishes a CSS **container context** named `ody-page`, so the
573
+ * settings content inside can adapt between the two widths with container
574
+ * queries instead of viewport media queries — base styles target 868px, then
575
+ * enhance for 1310px:
576
+ *
577
+ * ```css
578
+ * .my-settings-grid { grid-template-columns: 1fr; } // default 868px
579
+ * @container ody-page (min-width: 1310px) { // expanded view
580
+ * .my-settings-grid { grid-template-columns: 1fr 1fr; }
581
+ * }
582
+ * ```
583
+ *
584
+ * No attributes — the width is driven entirely by the parent.
585
+ *
586
+ * Example:
587
+ * ```html
588
+ * <ody-page-container>
589
+ * …settings UI…
590
+ * </ody-page-container>
591
+ * ```
592
+ */
593
+ declare class OdyPageContainer extends OdyElement {
594
+ protected render(): void;
595
+ }
596
+
553
597
  /**
554
598
  * `<ody-collapsible-section>` — a titled section that expands/collapses on
555
599
  * header click. Place the expandable body in an `<ody-collapsible-content>`
@@ -1476,4 +1520,4 @@ declare function removePortal(node: Node): void;
1476
1520
  */
1477
1521
  declare function position(anchor: Element, floating: Element, placement?: OdyPlacement, gap?: number): OdyPosition;
1478
1522
 
1479
- export { OdyAccordion, OdyAlert, type OdyAlertVariant, OdyBrandIcon, type OdyBrandIconSize, OdyBreadcrumb, OdyBreadcrumbItem, OdyButton, type OdyButtonAppearance, type OdyButtonSize, type OdyButtonVariant, OdyCard, OdyCheckInStatus, type OdyCheckInStatusValue, OdyCheckbox, OdyCheckboxGroup, type OdyCheckboxGroupSize, type OdyCheckboxOption, type OdyCheckboxSize, OdyCollapsible, OdyCollapsibleCollapsed, OdyCollapsibleContent, OdyCollapsibleSection, OdyCopyButton, type OdyDateDisallowed, OdyDatePicker, type OdyDatePreset, OdyDivider, OdyDropdownMulti, OdyDropdownSingle, OdyElement, OdyEmptyState, type OdyEmptyStateVariant, OdyIcon, type OdyIconData, type OdyIconSize, OdyInlineInput, type OdyInlineInputSize, OdyInlineList, OdyInlineListItem, type OdyInlineListSeparator, OdyInput, type OdyInputSize, type OdyInputState, OdyListItem, OdyLoadingBar, OdyLoadingSpinner, OdyMessage, OdyModal, type OdyModalSize, OdyMoneyInput, type OdyMoneyInputSize, OdyOption, OdyPanel, OdyPercentageInput, type OdyPercentageInputSize, type OdyPlacement, OdyPopover, type OdyPosition, OdyProductIndicator, type OdyProductIndicatorSize, OdyRadioButtonGroup, type OdyRadioButtonGroupSize, type OdyRadioOption, OdySearchInput, type OdySearchInputSize, OdySectionColumnItem, OdySectionColumns, type OdySectionGap, OdySectionRowItem, OdySectionRows, type OdySectionVerticalAlign, OdySelectBase, type OdySelectOption, type OdySortDirection$1 as OdySortDirection, type OdySpinnerSize, OdySplitButton, OdyStat, OdyStatDetail, OdyStatSummary, OdyStatSummaryDetail, type OdyStatTone, OdyStatusDot, type OdyStatusDotColor, type OdyTabDef, OdyTable, type OdyTableAlign, type OdyTableColumn, OdyTableHeader, type OdyTableRow, type OdyTableRowClickDetail, type OdyTableSelectionChangeDetail, type OdyTableSortChangeDetail, type OdySortDirection as OdyTableSortDirection, OdyTabs, type OdyTabsPosition, type OdyTabsSize, OdyTag, type OdyTagColor, type OdyTagSize, type OdyTagVariant, type OdyTermKey, type OdyTerms, OdyToastHost, type OdyToastOptions, type OdyToastVariant, OdyToggleButton, type OdyToggleButtonSize, type OdyToggleOption, OdyTooltip, OdyTwoColumn, OdyTwoColumnMain, OdyTwoColumnSecondary, OdyTwoColumnSecondaryHeader, brandIconNames, brandIconSvg, classes, define, escapeHtml, hasBrandIcon, hasIcon, iconNames, iconSvg, parseOptions, portal, position, registerIcon, registerTranslation, removePortal, renderIconSvg, toast };
1523
+ export { OdyAccordion, OdyAlert, type OdyAlertVariant, OdyBrandIcon, type OdyBrandIconSize, OdyBreadcrumb, OdyBreadcrumbItem, OdyButton, type OdyButtonAppearance, type OdyButtonSize, type OdyButtonVariant, OdyCard, OdyCheckInStatus, type OdyCheckInStatusValue, OdyCheckbox, OdyCheckboxGroup, type OdyCheckboxGroupSize, type OdyCheckboxOption, type OdyCheckboxSize, OdyCollapsible, OdyCollapsibleCollapsed, OdyCollapsibleContent, OdyCollapsibleSection, OdyCopyButton, type OdyDateDisallowed, OdyDatePicker, type OdyDatePreset, OdyDivider, OdyDropdownMulti, OdyDropdownSingle, OdyElement, OdyEmptyState, type OdyEmptyStateVariant, OdyIcon, type OdyIconData, type OdyIconSize, OdyInlineInput, type OdyInlineInputSize, OdyInlineList, OdyInlineListItem, type OdyInlineListSeparator, OdyInput, type OdyInputSize, type OdyInputState, OdyListItem, OdyLoadingBar, OdyLoadingSpinner, OdyMessage, OdyModal, type OdyModalSize, OdyMoneyInput, type OdyMoneyInputSize, OdyOption, OdyPageContainer, OdyPanel, OdyPercentageInput, type OdyPercentageInputSize, type OdyPlacement, OdyPopover, type OdyPosition, OdyProductIndicator, type OdyProductIndicatorSize, OdyRadioButtonGroup, type OdyRadioButtonGroupSize, type OdyRadioOption, OdySearchInput, type OdySearchInputSize, OdySectionColumnItem, OdySectionColumns, type OdySectionGap, OdySectionRowItem, OdySectionRows, type OdySectionVerticalAlign, OdySelectBase, type OdySelectOption, type OdySortDirection$1 as OdySortDirection, type OdySpinnerSize, OdySplitButton, OdyStat, OdyStatDetail, OdyStatSummary, OdyStatSummaryDetail, type OdyStatTone, OdyStatusDot, type OdyStatusDotColor, type OdyTabDef, OdyTable, type OdyTableAlign, type OdyTableColumn, OdyTableHeader, type OdyTableRow, type OdyTableRowClickDetail, type OdyTableSelectionChangeDetail, type OdyTableSortChangeDetail, type OdySortDirection as OdyTableSortDirection, OdyTabs, type OdyTabsPosition, type OdyTabsSize, OdyTag, type OdyTagColor, type OdyTagSize, type OdyTagVariant, type OdyTermKey, type OdyTerms, OdyToastHost, type OdyToastOptions, type OdyToastVariant, OdyToggleButton, type OdyToggleButtonSize, type OdyToggleOption, OdyTooltip, OdyTwoColumn, OdyTwoColumnMain, OdyTwoColumnSecondary, OdyTwoColumnSecondaryHeader, brandIconNames, brandIconSvg, classes, define, escapeHtml, hasBrandIcon, hasIcon, iconNames, iconSvg, parseOptions, portal, position, registerIcon, registerTranslation, removePortal, renderIconSvg, toast };
package/dist/ui/index.js CHANGED
@@ -809,13 +809,19 @@ define("ody-alert", OdyAlert);
809
809
 
810
810
  // src/ui/components/card.ts
811
811
  var OdyCard = class extends OdyElement {
812
- static observedAttributes = ["bar-color", "clickable"];
812
+ static observedAttributes = ["bar-color", "clickable", "no-bar"];
813
813
  render() {
814
+ const noBar = this.flag("no-bar");
814
815
  const barColor = this.attr("bar-color");
815
816
  const barStyle = barColor ? ` style="background-color:${this.esc(barColor)}"` : "";
816
- const cls = classes("ody-card__container", this.flag("clickable") && "ody-card--clickable");
817
+ const cls = classes(
818
+ "ody-card__container",
819
+ this.flag("clickable") && "ody-card--clickable",
820
+ noBar && "ody-card--no-bar"
821
+ );
822
+ const bar = noBar ? "" : `<div class="ody-card__container__bar"${barStyle}></div>`;
817
823
  this.mount(
818
- `<div class="${cls}" style="display:flex"><div class="ody-card__container__bar"${barStyle}></div><div class="ody-card__container__content" data-ody-slot></div></div>`
824
+ `<div class="${cls}" style="display:flex">` + bar + `<div class="ody-card__container__content" data-ody-slot></div></div>`
819
825
  );
820
826
  }
821
827
  };
@@ -1258,6 +1264,14 @@ define("ody-two-column-main", OdyTwoColumnMain);
1258
1264
  define("ody-two-column-secondary", OdyTwoColumnSecondary);
1259
1265
  define("ody-two-column-secondary-header", OdyTwoColumnSecondaryHeader);
1260
1266
 
1267
+ // src/ui/components/page-container.ts
1268
+ var OdyPageContainer = class extends OdyElement {
1269
+ render() {
1270
+ this.mount(`<div class="ody-page-container" data-ody-slot></div>`);
1271
+ }
1272
+ };
1273
+ define("ody-page-container", OdyPageContainer);
1274
+
1261
1275
  // src/ui/components/collapsible-section.ts
1262
1276
  var OdyCollapsibleSection = class extends OdyElement {
1263
1277
  static observedAttributes = ["header-text", "secondary-header-text", "icon", "expanded"];
@@ -3842,6 +3856,6 @@ var OdyBrandIcon = class extends OdyElement {
3842
3856
  };
3843
3857
  define("ody-brand-icon", OdyBrandIcon);
3844
3858
 
3845
- export { OdyAccordion, OdyAlert, OdyBrandIcon, OdyBreadcrumb, OdyBreadcrumbItem, OdyButton, OdyCard, OdyCheckInStatus, OdyCheckbox, OdyCheckboxGroup, OdyCollapsible, OdyCollapsibleCollapsed, OdyCollapsibleContent, OdyCollapsibleSection, OdyCopyButton, OdyDatePicker, OdyDivider, OdyDropdownMulti, OdyDropdownSingle, OdyElement, OdyEmptyState, OdyIcon, OdyInlineInput, OdyInlineList, OdyInlineListItem, OdyInput, OdyListItem, OdyLoadingBar, OdyLoadingSpinner, OdyMessage, OdyModal, OdyMoneyInput, OdyOption, OdyPanel, OdyPercentageInput, OdyPopover, OdyProductIndicator, OdyRadioButtonGroup, OdySearchInput, OdySectionColumnItem, OdySectionColumns, OdySectionRowItem, OdySectionRows, OdySelectBase, OdySplitButton, OdyStat, OdyStatDetail, OdyStatSummary, OdyStatSummaryDetail, OdyStatusDot, OdyTable, OdyTableHeader, OdyTabs, OdyTag, OdyToastHost, OdyToggleButton, OdyTooltip, OdyTwoColumn, OdyTwoColumnMain, OdyTwoColumnSecondary, OdyTwoColumnSecondaryHeader, brandIconNames, brandIconSvg, classes, define, escapeHtml, hasBrandIcon, hasIcon, iconNames, iconSvg, parseOptions3 as parseOptions, portal, position, registerIcon, registerTranslation, removePortal, renderIconSvg, toast };
3859
+ export { OdyAccordion, OdyAlert, OdyBrandIcon, OdyBreadcrumb, OdyBreadcrumbItem, OdyButton, OdyCard, OdyCheckInStatus, OdyCheckbox, OdyCheckboxGroup, OdyCollapsible, OdyCollapsibleCollapsed, OdyCollapsibleContent, OdyCollapsibleSection, OdyCopyButton, OdyDatePicker, OdyDivider, OdyDropdownMulti, OdyDropdownSingle, OdyElement, OdyEmptyState, OdyIcon, OdyInlineInput, OdyInlineList, OdyInlineListItem, OdyInput, OdyListItem, OdyLoadingBar, OdyLoadingSpinner, OdyMessage, OdyModal, OdyMoneyInput, OdyOption, OdyPageContainer, OdyPanel, OdyPercentageInput, OdyPopover, OdyProductIndicator, OdyRadioButtonGroup, OdySearchInput, OdySectionColumnItem, OdySectionColumns, OdySectionRowItem, OdySectionRows, OdySelectBase, OdySplitButton, OdyStat, OdyStatDetail, OdyStatSummary, OdyStatSummaryDetail, OdyStatusDot, OdyTable, OdyTableHeader, OdyTabs, OdyTag, OdyToastHost, OdyToggleButton, OdyTooltip, OdyTwoColumn, OdyTwoColumnMain, OdyTwoColumnSecondary, OdyTwoColumnSecondaryHeader, brandIconNames, brandIconSvg, classes, define, escapeHtml, hasBrandIcon, hasIcon, iconNames, iconSvg, parseOptions3 as parseOptions, portal, position, registerIcon, registerTranslation, removePortal, renderIconSvg, toast };
3846
3860
  //# sourceMappingURL=index.js.map
3847
3861
  //# sourceMappingURL=index.js.map