@cboxdk/cbox-ui 0.11.0 → 0.11.2

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 CHANGED
@@ -430,6 +430,37 @@ The phone has its own chrome (the approved V6 design):
430
430
  the Assistant SDK's element, as on a desktop.
431
431
  - **Palette:** a near full-screen sheet with Cancel (see the palette below).
432
432
 
433
+ **Sheets behave like iOS sheets.** The grab handle and the header drag the sheet; the content
434
+ drags it too when scrolled to its top (down) or while the sheet can still grow (up). A sheet
435
+ that fits its content opens at most about half way and grows to 92% when there is more; a tall
436
+ sheet (Help, create, an environment list) opens at 90% and rests at half the screen too. Pulled
437
+ well down or flicked down, it closes; a tap on the scrim closes it. Each sheet has one scroller,
438
+ its body. While a sheet, the palette or Help is open the page behind does not scroll (iOS
439
+ included); the page's scroll position is kept. Fields are 16px on a phone, so iOS does not zoom
440
+ into them, and the chrome does not double-tap zoom (pinch-zoom stays). While the on-screen
441
+ keyboard is up, sheets sit above it and the tab bar steps aside.
442
+
443
+ **One title.** The top bar shows the area's name large. A page heading that says the same is
444
+ hidden on the phone and kept for screen readers: `PageHeader` does it by itself (string titles);
445
+ an app's own heading opts in with `data-cbx-page-title`, e.g.
446
+ `<h1 data-cbx-page-title>Status pages</h1>`. `useShellPageTitle()` gives the top bar's title on
447
+ the phone (`null` elsewhere) for a header the app lays out itself.
448
+
449
+ **The app's viewport meta tag.** The shell does not rewrite the host page's `<head>`. Every app
450
+ that renders `CboxShell` needs:
451
+
452
+ ```html
453
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, interactive-widget=resizes-content">
454
+ ```
455
+
456
+ `viewport-fit=cover` gives the tab bar and sheets the safe-area insets of the home indicator;
457
+ `interactive-widget=resizes-content` makes Android shrink the page for the keyboard (iOS ignores
458
+ it; the shell measures the keyboard itself). Do not add `maximum-scale=1` or
459
+ `user-scalable=no`: pinch-zoom is an accessibility need, and the 16px fields already stop the
460
+ zoom on focus. An app's own fields on the phone should be 16px or more too (the shell sets 16px
461
+ on fields inside the page; an app that styles its fields in a later cascade layer keeps its
462
+ own size).
463
+
433
464
  Environments say whether they are live: `ContextItem.live` (else `testData` true is not live,
434
465
  else `tone: 'production'` is live; with neither the banner never shows). The shell never guesses
435
466
  from the name. `group` and `description` list them under headings with a second line; `tone`
package/dist/index.d.ts CHANGED
@@ -726,6 +726,13 @@ declare function useShellCreate(): {
726
726
  } | null;
727
727
  /** Help for a page's own `?` button, or `null` outside the shell. */
728
728
  declare function useShellHelp(): Pick<ShellApi, 'toggleHelp' | 'openArticle' | 'ask'> | null;
729
+ /**
730
+ * The title the phone's top bar shows large (the current area's name), or `null` on a desktop and
731
+ * outside the shell. A page heading that says the same is hidden on the phone (shown to screen
732
+ * readers), so the title is not there twice: `PageHeader` does this itself; any other heading
733
+ * opts in with `data-cbx-page-title`.
734
+ */
735
+ declare function useShellPageTitle(): string | null;
729
736
 
730
737
  type CboxShellProps = {
731
738
  /** The shared `shell` prop. */
@@ -1688,4 +1695,4 @@ declare function Sparkline({ values, color, width, height }: {
1688
1695
  height?: number;
1689
1696
  }): react_jsx_runtime.JSX.Element | null;
1690
1697
 
1691
- export { APP_HUES, AppContent, type AppKey, AppShell, CHART_PALETTE, CboxAppCatalog, type CboxAppCatalogProps, CboxAppIcon, type CboxAppIconProps, type CboxAppKey, type CboxAppLink, CboxBrand, type CboxBrandProps, type CboxIdContextValue, CboxIdProvider, CboxKnownApp, CboxLocalizationProvider, type CboxNotificationPreviewItem, type CboxNotificationsState, type CboxOrganization, CboxServiceMark, type CboxServiceMarkProps, CboxShell, type CboxShellProps, CboxSurfaces, type CboxSurfacesProps, type CboxTranslationValues, type CboxTranslator, type CboxUser, Combobox, type ComboboxAvatar, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type ContextItem, type ContextLevel, type ContextTone, CreateField, CreateForm, CreateRefField, CreateSubmit, DataPanel, EmptyState, Heading, type HelpArticle, type HelpState, type HelpStore, type InboxState, type InferUrlState, KeyValue, KeyValueList, type ListPage, type NavArea, type NavPage, PageHeader, type PageIntent, PageShell, type PageTabSpec, PageTabs, type PageTabsProps, type PageWidth, type PaletteAction, type PaletteRecord, PanelBody, type RealtimeState, type RealtimeStatus, RowLink, type RowLinkProps, SHELL_ICONS, SectionHeader, type Shell, type ShellAccount, type Link as ShellActionLink, type ShellApp, type ShellBanner, type ShellCatalogState, type ShellCreatable, type ShellCreate, type ShellCreateForm, type ShellCreated, type ShellHelp, type ShellHelpArticle, type ShellIcon, type ShellLinkComponent, type ShellNavigate, type ShellNotifications, type ShellOption, type ShellPreferenceChange, type ShellPreferences, type ShellRecordSearch, type ShellRenderCreate, type ShellTheme, Sparkline, StatTile, StatusPill, type SupportUpdate, type SurfaceArgs, type SurfaceConfig, type SurfaceController, type SurfaceId, type SwitchBody, type Transport, type UrlField, type UrlSchema, applyTheme, buildUrlSearch, cn, contextTrail, createHelpStore, defineUrlSchema, environmentFor, groupItems, hueFor, initialsOf, interpolate, isLive, pageIntent, parseListPage, parseShellCatalog, parseUrlSearch, quickEnvironments, settingsHref, switchBody, switchPayload, themeBootScript, urlBoolean, urlEnum, urlNumber, urlString, urlStringArray, useCboxId, useCboxIdOptional, useCboxLocalization, useCboxSurfaces, useCboxSurfacesOptional, useKnownAppCatalog, useShellCreate, useShellHelp, withQuery };
1698
+ export { APP_HUES, AppContent, type AppKey, AppShell, CHART_PALETTE, CboxAppCatalog, type CboxAppCatalogProps, CboxAppIcon, type CboxAppIconProps, type CboxAppKey, type CboxAppLink, CboxBrand, type CboxBrandProps, type CboxIdContextValue, CboxIdProvider, CboxKnownApp, CboxLocalizationProvider, type CboxNotificationPreviewItem, type CboxNotificationsState, type CboxOrganization, CboxServiceMark, type CboxServiceMarkProps, CboxShell, type CboxShellProps, CboxSurfaces, type CboxSurfacesProps, type CboxTranslationValues, type CboxTranslator, type CboxUser, Combobox, type ComboboxAvatar, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type ContextItem, type ContextLevel, type ContextTone, CreateField, CreateForm, CreateRefField, CreateSubmit, DataPanel, EmptyState, Heading, type HelpArticle, type HelpState, type HelpStore, type InboxState, type InferUrlState, KeyValue, KeyValueList, type ListPage, type NavArea, type NavPage, PageHeader, type PageIntent, PageShell, type PageTabSpec, PageTabs, type PageTabsProps, type PageWidth, type PaletteAction, type PaletteRecord, PanelBody, type RealtimeState, type RealtimeStatus, RowLink, type RowLinkProps, SHELL_ICONS, SectionHeader, type Shell, type ShellAccount, type Link as ShellActionLink, type ShellApp, type ShellBanner, type ShellCatalogState, type ShellCreatable, type ShellCreate, type ShellCreateForm, type ShellCreated, type ShellHelp, type ShellHelpArticle, type ShellIcon, type ShellLinkComponent, type ShellNavigate, type ShellNotifications, type ShellOption, type ShellPreferenceChange, type ShellPreferences, type ShellRecordSearch, type ShellRenderCreate, type ShellTheme, Sparkline, StatTile, StatusPill, type SupportUpdate, type SurfaceArgs, type SurfaceConfig, type SurfaceController, type SurfaceId, type SwitchBody, type Transport, type UrlField, type UrlSchema, applyTheme, buildUrlSearch, cn, contextTrail, createHelpStore, defineUrlSchema, environmentFor, groupItems, hueFor, initialsOf, interpolate, isLive, pageIntent, parseListPage, parseShellCatalog, parseUrlSearch, quickEnvironments, settingsHref, switchBody, switchPayload, themeBootScript, urlBoolean, urlEnum, urlNumber, urlString, urlStringArray, useCboxId, useCboxIdOptional, useCboxLocalization, useCboxSurfaces, useCboxSurfacesOptional, useKnownAppCatalog, useShellCreate, useShellHelp, useShellPageTitle, withQuery };