@dloizides/ui-layout 1.30.0 → 1.32.0

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/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## 1.32.0
5
+
6
+ ### Added
7
+
8
+ - `StatusBadge` `icon`: an optional decorative slot before the label. INVOICE-3 "Invoice interface over a user-chosen folder".
9
+ - `StickyPreview`: sticks to the top of the visible viewport; shows its `full` slot, or its `compact` slot once scrolled past, while the on-screen keyboard is open, or on `forceCompact`.
10
+ - `useVisibleViewport`, `isKeyboardOpen`: read the Visual Viewport offset and keyboard state.
11
+
4
12
  ## 1.30.0
5
13
 
6
14
  ### Added
package/dist/index.d.mts CHANGED
@@ -59,11 +59,32 @@ interface StatusBadgeProps {
59
59
  label: string;
60
60
  color: string;
61
61
  backgroundColor: string;
62
+ icon?: React.ReactNode;
62
63
  testID?: string;
63
64
  accessibilityLabel?: string;
64
65
  accessibilityHint?: string;
65
66
  }
66
- declare const StatusBadge: ({ label, color, backgroundColor, testID, accessibilityLabel, accessibilityHint, }: StatusBadgeProps) => React.ReactElement;
67
+ declare const StatusBadge: ({ label, color, backgroundColor, icon, testID, accessibilityLabel, accessibilityHint, }: StatusBadgeProps) => React.ReactElement;
68
+
69
+ interface StickyPreviewProps {
70
+ full: React.ReactNode;
71
+ compact: React.ReactNode;
72
+ forceCompact?: boolean;
73
+ topOffset?: number;
74
+ accessibilityLabel: string;
75
+ testID?: string;
76
+ }
77
+ /** Keeps a preview at the top of the visible viewport, swapping to its compact slot while space is short. */
78
+ declare const StickyPreview: ({ full, compact, forceCompact, topOffset, accessibilityLabel, testID, }: StickyPreviewProps) => React.ReactElement;
79
+
80
+ interface VisibleViewport {
81
+ offsetTop: number;
82
+ keyboardOpen: boolean;
83
+ }
84
+ /** True when the visible height has dropped far enough below the tallest height seen at this width. */
85
+ declare function isKeyboardOpen(visibleHeight: number, tallestHeight: number): boolean;
86
+ /** Tracks the Visual Viewport offset and keyboard state; stays at its initial value where the API is absent. */
87
+ declare function useVisibleViewport(): VisibleViewport;
67
88
 
68
89
  /**
69
90
  * SegmentedControl — a single rounded pill *track* holding N mutually-exclusive segments
@@ -248,6 +269,12 @@ interface DropdownOption<T> {
248
269
  readonly value: T;
249
270
  }
250
271
 
272
+ /** How a dropdown option row marks the currently selected value. */
273
+ declare enum SelectedMarker {
274
+ Bold = "bold",
275
+ AccentCheck = "accent-check"
276
+ }
277
+
251
278
  /**
252
279
  * ModalDropdown — generic dropdown selector (any value type via generics).
253
280
  *
@@ -322,8 +349,10 @@ interface ModalDropdownProps<T> {
322
349
  showHamburger?: boolean;
323
350
  /** Visible, non-focusable heading at the top of the open menu; it also names the menu. */
324
351
  menuHeading?: string;
352
+ /** How the selected option is marked; `AccentCheck` = accent left bar + check. */
353
+ selectedMarker?: SelectedMarker;
325
354
  }
326
- declare const ModalDropdown: <T extends string | number>({ testID, accessibilityLabel, accessibilityHint, value, options, onChange, variant, renderTrigger, optionTestID, menuMinWidth, showCaret, showHamburger, menuHeading, }: ModalDropdownProps<T>) => React.ReactElement;
355
+ declare const ModalDropdown: <T extends string | number>({ testID, accessibilityLabel, accessibilityHint, value, options, onChange, variant, renderTrigger, optionTestID, menuMinWidth, showCaret, showHamburger, menuHeading, selectedMarker, }: ModalDropdownProps<T>) => React.ReactElement;
327
356
 
328
357
  /**
329
358
  * ModalShell — a slide-up full-screen modal with a themed header (title + close button)
@@ -778,6 +807,7 @@ declare function useFocusTrap(containerRef: RefObject<View | null>, enabled: boo
778
807
  declare const LAYOUT_TEST_IDS: {
779
808
  readonly headingText: "heading-text";
780
809
  readonly statusLabel: "status-label";
810
+ readonly stickyPreview: "sticky-preview";
781
811
  readonly upgradePrompt: "upgrade-prompt";
782
812
  readonly upgradePromptCta: "upgrade-prompt-cta";
783
813
  readonly upgradePromptDismiss: "upgrade-prompt-dismiss";
@@ -892,4 +922,4 @@ declare const MIN_TARGET_PX = 44;
892
922
  */
893
923
  declare function isWideWebViewport(width: number, platformOS: string, breakpoint?: number): boolean;
894
924
 
895
- export { API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, BUILD_INFO_PREFIX, BuildInfoFooter, type BuildInfoFooterProps, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, DEFAULT_BILLING_ROUTE, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, Heading, type HeadingLevel, type HeadingProps, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, MIN_TARGET_PX, Modal, ModalDropdown, type ModalDropdownProps, type ModalProps, ModalShell, type ModalShellProps, type ModalSize, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, StatusBadge, type StatusBadgeProps, TYPE_SCALE_BREAKPOINT, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, copyText, formatBuildInfo, formatUrlForDisplay, isWideWebViewport, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap };
925
+ export { API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, BUILD_INFO_PREFIX, BuildInfoFooter, type BuildInfoFooterProps, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, DEFAULT_BILLING_ROUTE, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, Heading, type HeadingLevel, type HeadingProps, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, MIN_TARGET_PX, Modal, ModalDropdown, type ModalDropdownProps, type ModalProps, ModalShell, type ModalShellProps, type ModalSize, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, SelectedMarker, StatusBadge, type StatusBadgeProps, StickyPreview, type StickyPreviewProps, TYPE_SCALE_BREAKPOINT, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, copyText, formatBuildInfo, formatUrlForDisplay, isKeyboardOpen, isWideWebViewport, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useVisibleViewport };
package/dist/index.d.ts CHANGED
@@ -59,11 +59,32 @@ interface StatusBadgeProps {
59
59
  label: string;
60
60
  color: string;
61
61
  backgroundColor: string;
62
+ icon?: React.ReactNode;
62
63
  testID?: string;
63
64
  accessibilityLabel?: string;
64
65
  accessibilityHint?: string;
65
66
  }
66
- declare const StatusBadge: ({ label, color, backgroundColor, testID, accessibilityLabel, accessibilityHint, }: StatusBadgeProps) => React.ReactElement;
67
+ declare const StatusBadge: ({ label, color, backgroundColor, icon, testID, accessibilityLabel, accessibilityHint, }: StatusBadgeProps) => React.ReactElement;
68
+
69
+ interface StickyPreviewProps {
70
+ full: React.ReactNode;
71
+ compact: React.ReactNode;
72
+ forceCompact?: boolean;
73
+ topOffset?: number;
74
+ accessibilityLabel: string;
75
+ testID?: string;
76
+ }
77
+ /** Keeps a preview at the top of the visible viewport, swapping to its compact slot while space is short. */
78
+ declare const StickyPreview: ({ full, compact, forceCompact, topOffset, accessibilityLabel, testID, }: StickyPreviewProps) => React.ReactElement;
79
+
80
+ interface VisibleViewport {
81
+ offsetTop: number;
82
+ keyboardOpen: boolean;
83
+ }
84
+ /** True when the visible height has dropped far enough below the tallest height seen at this width. */
85
+ declare function isKeyboardOpen(visibleHeight: number, tallestHeight: number): boolean;
86
+ /** Tracks the Visual Viewport offset and keyboard state; stays at its initial value where the API is absent. */
87
+ declare function useVisibleViewport(): VisibleViewport;
67
88
 
68
89
  /**
69
90
  * SegmentedControl — a single rounded pill *track* holding N mutually-exclusive segments
@@ -248,6 +269,12 @@ interface DropdownOption<T> {
248
269
  readonly value: T;
249
270
  }
250
271
 
272
+ /** How a dropdown option row marks the currently selected value. */
273
+ declare enum SelectedMarker {
274
+ Bold = "bold",
275
+ AccentCheck = "accent-check"
276
+ }
277
+
251
278
  /**
252
279
  * ModalDropdown — generic dropdown selector (any value type via generics).
253
280
  *
@@ -322,8 +349,10 @@ interface ModalDropdownProps<T> {
322
349
  showHamburger?: boolean;
323
350
  /** Visible, non-focusable heading at the top of the open menu; it also names the menu. */
324
351
  menuHeading?: string;
352
+ /** How the selected option is marked; `AccentCheck` = accent left bar + check. */
353
+ selectedMarker?: SelectedMarker;
325
354
  }
326
- declare const ModalDropdown: <T extends string | number>({ testID, accessibilityLabel, accessibilityHint, value, options, onChange, variant, renderTrigger, optionTestID, menuMinWidth, showCaret, showHamburger, menuHeading, }: ModalDropdownProps<T>) => React.ReactElement;
355
+ declare const ModalDropdown: <T extends string | number>({ testID, accessibilityLabel, accessibilityHint, value, options, onChange, variant, renderTrigger, optionTestID, menuMinWidth, showCaret, showHamburger, menuHeading, selectedMarker, }: ModalDropdownProps<T>) => React.ReactElement;
327
356
 
328
357
  /**
329
358
  * ModalShell — a slide-up full-screen modal with a themed header (title + close button)
@@ -778,6 +807,7 @@ declare function useFocusTrap(containerRef: RefObject<View | null>, enabled: boo
778
807
  declare const LAYOUT_TEST_IDS: {
779
808
  readonly headingText: "heading-text";
780
809
  readonly statusLabel: "status-label";
810
+ readonly stickyPreview: "sticky-preview";
781
811
  readonly upgradePrompt: "upgrade-prompt";
782
812
  readonly upgradePromptCta: "upgrade-prompt-cta";
783
813
  readonly upgradePromptDismiss: "upgrade-prompt-dismiss";
@@ -892,4 +922,4 @@ declare const MIN_TARGET_PX = 44;
892
922
  */
893
923
  declare function isWideWebViewport(width: number, platformOS: string, breakpoint?: number): boolean;
894
924
 
895
- export { API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, BUILD_INFO_PREFIX, BuildInfoFooter, type BuildInfoFooterProps, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, DEFAULT_BILLING_ROUTE, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, Heading, type HeadingLevel, type HeadingProps, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, MIN_TARGET_PX, Modal, ModalDropdown, type ModalDropdownProps, type ModalProps, ModalShell, type ModalShellProps, type ModalSize, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, StatusBadge, type StatusBadgeProps, TYPE_SCALE_BREAKPOINT, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, copyText, formatBuildInfo, formatUrlForDisplay, isWideWebViewport, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap };
925
+ export { API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, BUILD_INFO_PREFIX, BuildInfoFooter, type BuildInfoFooterProps, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, DEFAULT_BILLING_ROUTE, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, Heading, type HeadingLevel, type HeadingProps, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, MIN_TARGET_PX, Modal, ModalDropdown, type ModalDropdownProps, type ModalProps, ModalShell, type ModalShellProps, type ModalSize, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, SelectedMarker, StatusBadge, type StatusBadgeProps, StickyPreview, type StickyPreviewProps, TYPE_SCALE_BREAKPOINT, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, copyText, formatBuildInfo, formatUrlForDisplay, isKeyboardOpen, isWideWebViewport, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useVisibleViewport };