@dloizides/ui-layout 1.48.0 → 1.49.1
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 +3 -0
- package/dist/index.d.mts +84 -1
- package/dist/index.d.ts +84 -1
- package/dist/index.js +192 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +186 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 1.49.1
|
|
6
|
+
- IdChip: `value` may be null or empty; the chip then copies nothing, is disabled and hides the copy glyph (was: copied the placeholder).
|
|
7
|
+
|
|
5
8
|
MODC-1 D-MC-641 "One page layout for all pages", UI-ATOMIC-1.
|
|
6
9
|
|
|
7
10
|
- New organism `SectionIndexLayout`: from `SECTION_INDEX_BREAKPOINT` (1024) an "On this page" index (molecule `SectionIndex`) beside every section stacked, a press scrolls to its section; below it a wrapping row of chips (molecule `SectionChips`) shows one section at a time, the first by default, so nothing is removed. Hit boxes >= 44 px; labels are pre-localized props. Options, defaults keep the plain behaviour: `density` (`SectionDensity` comfortable or dense gaps), `stickyIndex` (web, default false), `chipOverflow` (`ChipOverflow` wrap or scroll).
|
package/dist/index.d.mts
CHANGED
|
@@ -1288,4 +1288,87 @@ interface TimelineProps {
|
|
|
1288
1288
|
/** A vertical rail of entries: time, title and an optional status badge per entry, in the given order. */
|
|
1289
1289
|
declare const Timeline: ({ entries, accessibilityLabel, accessibilityHint, testID }: TimelineProps) => React.ReactElement;
|
|
1290
1290
|
|
|
1291
|
-
|
|
1291
|
+
interface RecordHeaderProps {
|
|
1292
|
+
breadcrumb?: React.ReactNode;
|
|
1293
|
+
title: React.ReactNode;
|
|
1294
|
+
meta?: React.ReactNode;
|
|
1295
|
+
actions?: React.ReactNode;
|
|
1296
|
+
collapseBelow?: number;
|
|
1297
|
+
testID?: string;
|
|
1298
|
+
}
|
|
1299
|
+
/** A record page header: breadcrumb, title and id meta left, record actions top right; stacked on a phone. */
|
|
1300
|
+
declare const RecordHeader: ({ breadcrumb, title, meta, actions, collapseBelow, testID }: RecordHeaderProps) => React.ReactElement;
|
|
1301
|
+
|
|
1302
|
+
interface BreadcrumbItem {
|
|
1303
|
+
key: string;
|
|
1304
|
+
label: string;
|
|
1305
|
+
onPress?: () => void;
|
|
1306
|
+
accessibilityHint?: string;
|
|
1307
|
+
testID?: string;
|
|
1308
|
+
}
|
|
1309
|
+
interface BreadcrumbProps {
|
|
1310
|
+
items: ReadonlyArray<BreadcrumbItem>;
|
|
1311
|
+
accessibilityLabel: string;
|
|
1312
|
+
testID?: string;
|
|
1313
|
+
}
|
|
1314
|
+
/** A compact text trail back to the parent list; a step without onPress is the current place. */
|
|
1315
|
+
declare const Breadcrumb: ({ items, accessibilityLabel, testID }: BreadcrumbProps) => React.ReactElement;
|
|
1316
|
+
|
|
1317
|
+
interface RecordActionButtonProps {
|
|
1318
|
+
label: string;
|
|
1319
|
+
hint: string;
|
|
1320
|
+
testID: string;
|
|
1321
|
+
icon?: React.ReactNode;
|
|
1322
|
+
onPress?: () => void;
|
|
1323
|
+
iconOnly?: boolean;
|
|
1324
|
+
disabledReason?: string;
|
|
1325
|
+
}
|
|
1326
|
+
/** One record action with an icon; icon only when compact, disabled with a reason when it has no onPress. */
|
|
1327
|
+
declare const RecordActionButton: ({ label, hint, testID, icon, onPress, iconOnly, disabledReason }: RecordActionButtonProps) => React.ReactElement;
|
|
1328
|
+
|
|
1329
|
+
/** True when a record header stacks its parts and shows icon-only secondary actions. */
|
|
1330
|
+
declare function isRecordHeaderCompact(width: number, breakpoint?: number): boolean;
|
|
1331
|
+
|
|
1332
|
+
interface IdChipProps {
|
|
1333
|
+
label: string;
|
|
1334
|
+
value: string | null;
|
|
1335
|
+
testID: string;
|
|
1336
|
+
accessibilityLabel: string;
|
|
1337
|
+
accessibilityHint: string;
|
|
1338
|
+
display?: string;
|
|
1339
|
+
valueTestID?: string;
|
|
1340
|
+
writer?: (text: string) => void | Promise<void>;
|
|
1341
|
+
}
|
|
1342
|
+
/** An id chip: label and monospace value inside one box with a copy glyph; pressing it copies the full value */
|
|
1343
|
+
declare const IdChip: ({ label, value, testID, accessibilityLabel, accessibilityHint, display, valueTestID, writer }: IdChipProps) => React.ReactElement;
|
|
1344
|
+
|
|
1345
|
+
interface UnderlineTab {
|
|
1346
|
+
key: string;
|
|
1347
|
+
label: string;
|
|
1348
|
+
count?: number;
|
|
1349
|
+
testID?: string;
|
|
1350
|
+
accessibilityHint?: string;
|
|
1351
|
+
}
|
|
1352
|
+
interface UnderlineTabsProps {
|
|
1353
|
+
tabs: ReadonlyArray<UnderlineTab>;
|
|
1354
|
+
activeKey: string;
|
|
1355
|
+
onChange: (key: string) => void;
|
|
1356
|
+
accessibilityLabel: string;
|
|
1357
|
+
underlineColor?: string;
|
|
1358
|
+
testID?: string;
|
|
1359
|
+
}
|
|
1360
|
+
/** A full-width tab strip with an underline on the selected tab and an optional count per tab. */
|
|
1361
|
+
declare const UnderlineTabs: ({ tabs, activeKey, onChange, accessibilityLabel, underlineColor, testID }: UnderlineTabsProps) => React.ReactElement;
|
|
1362
|
+
|
|
1363
|
+
interface WidgetCardProps {
|
|
1364
|
+
title: string;
|
|
1365
|
+
children: React.ReactNode;
|
|
1366
|
+
icon?: React.ReactNode;
|
|
1367
|
+
headerRight?: React.ReactNode;
|
|
1368
|
+
footer?: React.ReactNode;
|
|
1369
|
+
testID?: string;
|
|
1370
|
+
}
|
|
1371
|
+
/** A titled card for one record or summary block, with an optional header slot and a record action footer. */
|
|
1372
|
+
declare const WidgetCard: ({ title, children, icon, headerRight, footer, testID }: WidgetCardProps) => React.ReactElement;
|
|
1373
|
+
|
|
1374
|
+
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, AppText, type AppTextProps, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, type BottomSheetProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, BuildInfoFooter, type BuildInfoFooterProps, COPY_FEEDBACK_MS, ChipOverflow, ConfirmDialog, ConfirmDialogFocus, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, CountBadge, type CountBadgeProps, DEFAULT_BILLING_ROUTE, DayCard, type DayCardProps, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, FigureStrip, type FigureStripProps, FormDialog, type FormDialogProps, HEADER_STACK_BREAKPOINT, Heading, type HeadingLevel, type HeadingProps, IdChip, type IdChipProps, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListRow, type ListRowProps, type ListRowTone, MIN_TARGET_PX, MODAL_FOOTER_STACK_BELOW, Modal, ModalDropdown, type ModalDropdownProps, type ModalProps, ModalShell, type ModalShellProps, type ModalSize, PageFrame, type PageFrameProps, type PageSize, RecordActionButton, type RecordActionButtonProps, RecordHeader, type RecordHeaderProps, type RowLook, type RowPalette, RowSelectedStyle, type RowState, SECTION_INDEX_BREAKPOINT, type ScaledFrame, ScreenColumn, type ScreenColumnProps, Section, SectionChips, type SectionChipsProps, SectionDensity, SectionIndex, type SectionIndexEntry, SectionIndexLayout, type SectionIndexLayoutProps, type SectionIndexProps, type SectionProps, SectionVariant, SegmentedControl, type SegmentedControlProps, type SegmentedOption, SelectedMarker, SideSheet, type SideSheetProps, SplitLayout, SplitPanes, type SplitPanesProps, StatusBadge, type StatusBadgeProps, StickyPreview, type StickyPreviewProps, TYPE_SCALE_BREAKPOINT, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TextKind, Timeline, type TimelineEntry, type TimelineProps, ToggleSection, type ToggleSectionProps, type ToneColors, TruncatedText, type TruncatedTextProps, type UnderlineTab, UnderlineTabs, type UnderlineTabsProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, WidgetCard, type WidgetCardProps, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isRecordHeaderCompact, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveRowLook, resolveToneColors, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
|
package/dist/index.d.ts
CHANGED
|
@@ -1288,4 +1288,87 @@ interface TimelineProps {
|
|
|
1288
1288
|
/** A vertical rail of entries: time, title and an optional status badge per entry, in the given order. */
|
|
1289
1289
|
declare const Timeline: ({ entries, accessibilityLabel, accessibilityHint, testID }: TimelineProps) => React.ReactElement;
|
|
1290
1290
|
|
|
1291
|
-
|
|
1291
|
+
interface RecordHeaderProps {
|
|
1292
|
+
breadcrumb?: React.ReactNode;
|
|
1293
|
+
title: React.ReactNode;
|
|
1294
|
+
meta?: React.ReactNode;
|
|
1295
|
+
actions?: React.ReactNode;
|
|
1296
|
+
collapseBelow?: number;
|
|
1297
|
+
testID?: string;
|
|
1298
|
+
}
|
|
1299
|
+
/** A record page header: breadcrumb, title and id meta left, record actions top right; stacked on a phone. */
|
|
1300
|
+
declare const RecordHeader: ({ breadcrumb, title, meta, actions, collapseBelow, testID }: RecordHeaderProps) => React.ReactElement;
|
|
1301
|
+
|
|
1302
|
+
interface BreadcrumbItem {
|
|
1303
|
+
key: string;
|
|
1304
|
+
label: string;
|
|
1305
|
+
onPress?: () => void;
|
|
1306
|
+
accessibilityHint?: string;
|
|
1307
|
+
testID?: string;
|
|
1308
|
+
}
|
|
1309
|
+
interface BreadcrumbProps {
|
|
1310
|
+
items: ReadonlyArray<BreadcrumbItem>;
|
|
1311
|
+
accessibilityLabel: string;
|
|
1312
|
+
testID?: string;
|
|
1313
|
+
}
|
|
1314
|
+
/** A compact text trail back to the parent list; a step without onPress is the current place. */
|
|
1315
|
+
declare const Breadcrumb: ({ items, accessibilityLabel, testID }: BreadcrumbProps) => React.ReactElement;
|
|
1316
|
+
|
|
1317
|
+
interface RecordActionButtonProps {
|
|
1318
|
+
label: string;
|
|
1319
|
+
hint: string;
|
|
1320
|
+
testID: string;
|
|
1321
|
+
icon?: React.ReactNode;
|
|
1322
|
+
onPress?: () => void;
|
|
1323
|
+
iconOnly?: boolean;
|
|
1324
|
+
disabledReason?: string;
|
|
1325
|
+
}
|
|
1326
|
+
/** One record action with an icon; icon only when compact, disabled with a reason when it has no onPress. */
|
|
1327
|
+
declare const RecordActionButton: ({ label, hint, testID, icon, onPress, iconOnly, disabledReason }: RecordActionButtonProps) => React.ReactElement;
|
|
1328
|
+
|
|
1329
|
+
/** True when a record header stacks its parts and shows icon-only secondary actions. */
|
|
1330
|
+
declare function isRecordHeaderCompact(width: number, breakpoint?: number): boolean;
|
|
1331
|
+
|
|
1332
|
+
interface IdChipProps {
|
|
1333
|
+
label: string;
|
|
1334
|
+
value: string | null;
|
|
1335
|
+
testID: string;
|
|
1336
|
+
accessibilityLabel: string;
|
|
1337
|
+
accessibilityHint: string;
|
|
1338
|
+
display?: string;
|
|
1339
|
+
valueTestID?: string;
|
|
1340
|
+
writer?: (text: string) => void | Promise<void>;
|
|
1341
|
+
}
|
|
1342
|
+
/** An id chip: label and monospace value inside one box with a copy glyph; pressing it copies the full value */
|
|
1343
|
+
declare const IdChip: ({ label, value, testID, accessibilityLabel, accessibilityHint, display, valueTestID, writer }: IdChipProps) => React.ReactElement;
|
|
1344
|
+
|
|
1345
|
+
interface UnderlineTab {
|
|
1346
|
+
key: string;
|
|
1347
|
+
label: string;
|
|
1348
|
+
count?: number;
|
|
1349
|
+
testID?: string;
|
|
1350
|
+
accessibilityHint?: string;
|
|
1351
|
+
}
|
|
1352
|
+
interface UnderlineTabsProps {
|
|
1353
|
+
tabs: ReadonlyArray<UnderlineTab>;
|
|
1354
|
+
activeKey: string;
|
|
1355
|
+
onChange: (key: string) => void;
|
|
1356
|
+
accessibilityLabel: string;
|
|
1357
|
+
underlineColor?: string;
|
|
1358
|
+
testID?: string;
|
|
1359
|
+
}
|
|
1360
|
+
/** A full-width tab strip with an underline on the selected tab and an optional count per tab. */
|
|
1361
|
+
declare const UnderlineTabs: ({ tabs, activeKey, onChange, accessibilityLabel, underlineColor, testID }: UnderlineTabsProps) => React.ReactElement;
|
|
1362
|
+
|
|
1363
|
+
interface WidgetCardProps {
|
|
1364
|
+
title: string;
|
|
1365
|
+
children: React.ReactNode;
|
|
1366
|
+
icon?: React.ReactNode;
|
|
1367
|
+
headerRight?: React.ReactNode;
|
|
1368
|
+
footer?: React.ReactNode;
|
|
1369
|
+
testID?: string;
|
|
1370
|
+
}
|
|
1371
|
+
/** A titled card for one record or summary block, with an optional header slot and a record action footer. */
|
|
1372
|
+
declare const WidgetCard: ({ title, children, icon, headerRight, footer, testID }: WidgetCardProps) => React.ReactElement;
|
|
1373
|
+
|
|
1374
|
+
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, AppText, type AppTextProps, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, type BottomSheetProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, BuildInfoFooter, type BuildInfoFooterProps, COPY_FEEDBACK_MS, ChipOverflow, ConfirmDialog, ConfirmDialogFocus, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, CountBadge, type CountBadgeProps, DEFAULT_BILLING_ROUTE, DayCard, type DayCardProps, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, FigureStrip, type FigureStripProps, FormDialog, type FormDialogProps, HEADER_STACK_BREAKPOINT, Heading, type HeadingLevel, type HeadingProps, IdChip, type IdChipProps, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListRow, type ListRowProps, type ListRowTone, MIN_TARGET_PX, MODAL_FOOTER_STACK_BELOW, Modal, ModalDropdown, type ModalDropdownProps, type ModalProps, ModalShell, type ModalShellProps, type ModalSize, PageFrame, type PageFrameProps, type PageSize, RecordActionButton, type RecordActionButtonProps, RecordHeader, type RecordHeaderProps, type RowLook, type RowPalette, RowSelectedStyle, type RowState, SECTION_INDEX_BREAKPOINT, type ScaledFrame, ScreenColumn, type ScreenColumnProps, Section, SectionChips, type SectionChipsProps, SectionDensity, SectionIndex, type SectionIndexEntry, SectionIndexLayout, type SectionIndexLayoutProps, type SectionIndexProps, type SectionProps, SectionVariant, SegmentedControl, type SegmentedControlProps, type SegmentedOption, SelectedMarker, SideSheet, type SideSheetProps, SplitLayout, SplitPanes, type SplitPanesProps, StatusBadge, type StatusBadgeProps, StickyPreview, type StickyPreviewProps, TYPE_SCALE_BREAKPOINT, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TextKind, Timeline, type TimelineEntry, type TimelineProps, ToggleSection, type ToggleSectionProps, type ToneColors, TruncatedText, type TruncatedTextProps, type UnderlineTab, UnderlineTabs, type UnderlineTabsProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, WidgetCard, type WidgetCardProps, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isRecordHeaderCompact, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveRowLook, resolveToneColors, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
|
package/dist/index.js
CHANGED
|
@@ -3486,6 +3486,191 @@ var Timeline = ({ entries, accessibilityLabel, accessibilityHint, testID }) => {
|
|
|
3486
3486
|
)) });
|
|
3487
3487
|
};
|
|
3488
3488
|
|
|
3489
|
+
// src/RecordHeader/recordHeaderLayout.ts
|
|
3490
|
+
function isRecordHeaderCompact(width, breakpoint = LAYOUT_COLLAPSE_BREAKPOINT) {
|
|
3491
|
+
return width < breakpoint;
|
|
3492
|
+
}
|
|
3493
|
+
var GAP2 = 8;
|
|
3494
|
+
var WIDE_GAP = 16;
|
|
3495
|
+
var styles35 = reactNative.StyleSheet.create({
|
|
3496
|
+
actions: { alignItems: "center", flexDirection: "row", flexWrap: "wrap", gap: GAP2, justifyContent: "flex-end" },
|
|
3497
|
+
compactActions: { alignItems: "center", flexDirection: "row", flexWrap: "wrap", gap: GAP2 },
|
|
3498
|
+
identity: { flex: 1, gap: GAP2, minWidth: 0 },
|
|
3499
|
+
root: { gap: GAP2 },
|
|
3500
|
+
top: { alignItems: "flex-start", flexDirection: "row", gap: WIDE_GAP }
|
|
3501
|
+
});
|
|
3502
|
+
var RecordHeader = ({ breadcrumb, title, meta, actions, collapseBelow, testID }) => {
|
|
3503
|
+
const compact = isRecordHeaderCompact(reactNative.useWindowDimensions().width, collapseBelow);
|
|
3504
|
+
const actionRow = actions === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: compact ? styles35.compactActions : styles35.actions, children: actions });
|
|
3505
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles35.root, testID, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: compact ? styles35.root : styles35.top, children: [
|
|
3506
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles35.identity, children: [
|
|
3507
|
+
breadcrumb,
|
|
3508
|
+
title,
|
|
3509
|
+
meta
|
|
3510
|
+
] }),
|
|
3511
|
+
actionRow
|
|
3512
|
+
] }) });
|
|
3513
|
+
};
|
|
3514
|
+
var FONT_SIZE = 13;
|
|
3515
|
+
var GAP3 = 6;
|
|
3516
|
+
var SEPARATOR = "\u203A";
|
|
3517
|
+
var BACK = "\u2039";
|
|
3518
|
+
var styles36 = reactNative.StyleSheet.create({
|
|
3519
|
+
link: { justifyContent: "center", minHeight: MIN_TARGET_PX },
|
|
3520
|
+
row: { alignItems: "center", flexDirection: "row", flexWrap: "wrap", gap: GAP3 },
|
|
3521
|
+
text: { fontSize: FONT_SIZE, fontWeight: "500" }
|
|
3522
|
+
});
|
|
3523
|
+
var Breadcrumb = ({ items, accessibilityLabel, testID }) => {
|
|
3524
|
+
const { theme } = uiFeedback.useUi();
|
|
3525
|
+
const muted = { color: theme.colors.textSecondary };
|
|
3526
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { "aria-label": accessibilityLabel, style: styles36.row, testID, children: [
|
|
3527
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { "aria-hidden": true, style: [styles36.text, muted], children: BACK }),
|
|
3528
|
+
items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(React16__default.default.Fragment, { children: [
|
|
3529
|
+
index > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { "aria-hidden": true, style: [styles36.text, muted], children: SEPARATOR }) : null,
|
|
3530
|
+
item.onPress === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles36.text, muted], testID: item.testID, children: item.label }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Pressable, { accessibilityHint: item.accessibilityHint, accessibilityLabel: item.label, accessibilityRole: "link", style: styles36.link, testID: item.testID, onPress: item.onPress, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles36.text, { color: theme.colors.text }], children: item.label }) })
|
|
3531
|
+
] }, item.key))
|
|
3532
|
+
] });
|
|
3533
|
+
};
|
|
3534
|
+
var RADIUS = 8;
|
|
3535
|
+
var PAD_H2 = 12;
|
|
3536
|
+
var GAP4 = 6;
|
|
3537
|
+
var FONT_SIZE2 = 13;
|
|
3538
|
+
var DISABLED_OPACITY2 = 0.55;
|
|
3539
|
+
var styles37 = reactNative.StyleSheet.create({
|
|
3540
|
+
base: { alignItems: "center", borderRadius: RADIUS, borderWidth: 1, flexDirection: "row", gap: GAP4, justifyContent: "center", minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, paddingHorizontal: PAD_H2 },
|
|
3541
|
+
disabled: { borderStyle: "dashed", opacity: DISABLED_OPACITY2 },
|
|
3542
|
+
text: { fontSize: FONT_SIZE2, fontWeight: "600" }
|
|
3543
|
+
});
|
|
3544
|
+
function hasTitle(node) {
|
|
3545
|
+
return typeof node === "object" && node !== null && "setAttribute" in node;
|
|
3546
|
+
}
|
|
3547
|
+
var RecordActionButton = ({ label, hint, testID, icon, onPress, iconOnly = false, disabledReason }) => {
|
|
3548
|
+
const { theme } = uiFeedback.useUi();
|
|
3549
|
+
const ref = React16.useRef(null);
|
|
3550
|
+
const disabled = onPress === void 0;
|
|
3551
|
+
const title = disabled ? disabledReason : void 0;
|
|
3552
|
+
React16.useEffect(() => {
|
|
3553
|
+
const node = ref.current;
|
|
3554
|
+
if (reactNative.Platform.OS === "web" && title !== void 0 && hasTitle(node)) node.setAttribute("title", title);
|
|
3555
|
+
}, [title]);
|
|
3556
|
+
const showLabel = !iconOnly || icon === void 0;
|
|
3557
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3558
|
+
reactNative.Pressable,
|
|
3559
|
+
{
|
|
3560
|
+
ref,
|
|
3561
|
+
accessibilityHint: title ?? hint,
|
|
3562
|
+
accessibilityLabel: label,
|
|
3563
|
+
accessibilityRole: "button",
|
|
3564
|
+
accessibilityState: { disabled },
|
|
3565
|
+
disabled,
|
|
3566
|
+
style: [styles37.base, { backgroundColor: theme.colors.surfaceElevated, borderColor: theme.colors.border }, disabled && styles37.disabled],
|
|
3567
|
+
testID,
|
|
3568
|
+
onPress,
|
|
3569
|
+
children: [
|
|
3570
|
+
icon === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { "aria-hidden": true, children: icon }),
|
|
3571
|
+
showLabel ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles37.text, { color: theme.colors.text }], children: label }) : null
|
|
3572
|
+
]
|
|
3573
|
+
}
|
|
3574
|
+
);
|
|
3575
|
+
};
|
|
3576
|
+
var RADIUS2 = 6;
|
|
3577
|
+
var PAD_H3 = 10;
|
|
3578
|
+
var GAP5 = 6;
|
|
3579
|
+
var FONT_SIZE3 = 12;
|
|
3580
|
+
var COPY_GLYPH = "\u29C9";
|
|
3581
|
+
var COPIED_GLYPH = "\u2713";
|
|
3582
|
+
var MONO = reactNative.Platform.select({ web: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace", default: "monospace" });
|
|
3583
|
+
var styles38 = reactNative.StyleSheet.create({
|
|
3584
|
+
chip: { alignItems: "center", alignSelf: "flex-start", borderRadius: RADIUS2, borderWidth: 1, flexDirection: "row", gap: GAP5, maxWidth: "100%", minHeight: MIN_TARGET_PX, paddingHorizontal: PAD_H3 },
|
|
3585
|
+
text: { flexShrink: 1, fontFamily: MONO, fontSize: FONT_SIZE3 }
|
|
3586
|
+
});
|
|
3587
|
+
var IdChip = ({ label, value, testID, accessibilityLabel, accessibilityHint, display, valueTestID, writer }) => {
|
|
3588
|
+
const { theme } = uiFeedback.useUi();
|
|
3589
|
+
const copyable = value !== null && value !== "";
|
|
3590
|
+
const { status, copy } = useCopyToClipboard(value ?? "", writer);
|
|
3591
|
+
const ink = { color: theme.colors.text };
|
|
3592
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3593
|
+
reactNative.Pressable,
|
|
3594
|
+
{
|
|
3595
|
+
accessibilityHint,
|
|
3596
|
+
accessibilityLabel,
|
|
3597
|
+
accessibilityRole: "button",
|
|
3598
|
+
accessibilityState: { disabled: !copyable },
|
|
3599
|
+
disabled: !copyable,
|
|
3600
|
+
style: [styles38.chip, { backgroundColor: theme.colors.surfaceElevated, borderColor: theme.colors.border }],
|
|
3601
|
+
testID,
|
|
3602
|
+
onPress: copyable ? copy : void 0,
|
|
3603
|
+
children: [
|
|
3604
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles38.text, { color: theme.colors.textSecondary }], children: label }),
|
|
3605
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [styles38.text, ink], testID: valueTestID, children: display ?? value }),
|
|
3606
|
+
copyable ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { "aria-hidden": true, style: [styles38.text, ink], testID: `${testID}-glyph`, children: status === "copied" /* Copied */ ? COPIED_GLYPH : COPY_GLYPH }) : null
|
|
3607
|
+
]
|
|
3608
|
+
}
|
|
3609
|
+
);
|
|
3610
|
+
};
|
|
3611
|
+
var UNDERLINE = 3;
|
|
3612
|
+
var PAD_H4 = 12;
|
|
3613
|
+
var GAP6 = 6;
|
|
3614
|
+
var FONT_SIZE4 = 14;
|
|
3615
|
+
var COUNT_FONT = 12;
|
|
3616
|
+
var COUNT_MIN = 22;
|
|
3617
|
+
var COUNT_PAD = 6;
|
|
3618
|
+
var PILL = 999;
|
|
3619
|
+
var DEFAULT_UNDERLINE_STEP = "700";
|
|
3620
|
+
var styles39 = reactNative.StyleSheet.create({
|
|
3621
|
+
count: { borderRadius: PILL, fontSize: COUNT_FONT, fontWeight: "700", minWidth: COUNT_MIN, paddingHorizontal: COUNT_PAD, textAlign: "center" },
|
|
3622
|
+
label: { fontSize: FONT_SIZE4, fontWeight: "600" },
|
|
3623
|
+
strip: { borderBottomWidth: 1, width: "100%" },
|
|
3624
|
+
tab: { alignItems: "center", borderBottomWidth: UNDERLINE, flexDirection: "row", gap: GAP6, justifyContent: "center", minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, paddingHorizontal: PAD_H4 }
|
|
3625
|
+
});
|
|
3626
|
+
var UnderlineTabs = ({ tabs, activeKey, onChange, accessibilityLabel, underlineColor, testID }) => {
|
|
3627
|
+
const { theme } = uiFeedback.useUi();
|
|
3628
|
+
const underline = underlineColor ?? theme.palette.primary[DEFAULT_UNDERLINE_STEP];
|
|
3629
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles39.strip, { borderBottomColor: theme.colors.border }], testID, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { horizontal: true, accessibilityRole: "tablist", "aria-label": accessibilityLabel, showsHorizontalScrollIndicator: false, children: tabs.map((tab) => {
|
|
3630
|
+
const selected = tab.key === activeKey;
|
|
3631
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3632
|
+
reactNative.Pressable,
|
|
3633
|
+
{
|
|
3634
|
+
accessibilityHint: tab.accessibilityHint,
|
|
3635
|
+
accessibilityLabel: tab.label,
|
|
3636
|
+
accessibilityRole: "tab",
|
|
3637
|
+
accessibilityState: { selected },
|
|
3638
|
+
"aria-selected": selected,
|
|
3639
|
+
style: [styles39.tab, { borderBottomColor: selected ? underline : "transparent" }],
|
|
3640
|
+
testID: tab.testID,
|
|
3641
|
+
onPress: () => onChange(tab.key),
|
|
3642
|
+
children: [
|
|
3643
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles39.label, { color: selected ? theme.colors.text : theme.colors.textSecondary }], children: tab.label }),
|
|
3644
|
+
tab.count === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles39.count, { backgroundColor: theme.colors.border, color: theme.colors.text }], children: String(tab.count) })
|
|
3645
|
+
]
|
|
3646
|
+
},
|
|
3647
|
+
tab.key
|
|
3648
|
+
);
|
|
3649
|
+
}) }) });
|
|
3650
|
+
};
|
|
3651
|
+
var RADIUS3 = 12;
|
|
3652
|
+
var PAD = 16;
|
|
3653
|
+
var GAP7 = 8;
|
|
3654
|
+
var TITLE_FONT = 15;
|
|
3655
|
+
var styles40 = reactNative.StyleSheet.create({
|
|
3656
|
+
card: { borderRadius: RADIUS3, borderWidth: 1, gap: GAP7, minWidth: 0, padding: PAD },
|
|
3657
|
+
footer: { borderRadius: GAP7, borderWidth: 1, gap: GAP7, padding: PAD / 2 + GAP7 / 2 },
|
|
3658
|
+
head: { alignItems: "center", flexDirection: "row", gap: GAP7 },
|
|
3659
|
+
title: { flex: 1, fontSize: TITLE_FONT, fontWeight: "700" }
|
|
3660
|
+
});
|
|
3661
|
+
var WidgetCard = ({ title, children, icon, headerRight, footer, testID }) => {
|
|
3662
|
+
const { theme } = uiFeedback.useUi();
|
|
3663
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles40.card, { backgroundColor: theme.colors.surfaceElevated, borderColor: theme.colors.border }], testID, children: [
|
|
3664
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles40.head, children: [
|
|
3665
|
+
icon === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { "aria-hidden": true, children: icon }),
|
|
3666
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [styles40.title, { color: theme.colors.text }], children: title }),
|
|
3667
|
+
headerRight
|
|
3668
|
+
] }),
|
|
3669
|
+
children,
|
|
3670
|
+
footer === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles40.footer, { backgroundColor: theme.colors.background, borderColor: theme.colors.border }], children: footer })
|
|
3671
|
+
] });
|
|
3672
|
+
};
|
|
3673
|
+
|
|
3489
3674
|
exports.A4_PAGE = A4_PAGE;
|
|
3490
3675
|
exports.API_COMMIT_SEPARATOR = API_COMMIT_SEPARATOR;
|
|
3491
3676
|
exports.Accordion = Accordion;
|
|
@@ -3494,6 +3679,7 @@ exports.AppText = AppText;
|
|
|
3494
3679
|
exports.BUILD_INFO_PREFIX = BUILD_INFO_PREFIX;
|
|
3495
3680
|
exports.BadgeTone = BadgeTone;
|
|
3496
3681
|
exports.BottomSheet = BottomSheet;
|
|
3682
|
+
exports.Breadcrumb = Breadcrumb;
|
|
3497
3683
|
exports.BuildInfoFooter = BuildInfoFooter;
|
|
3498
3684
|
exports.COPY_FEEDBACK_MS = COPY_FEEDBACK_MS;
|
|
3499
3685
|
exports.ChipOverflow = ChipOverflow;
|
|
@@ -3510,6 +3696,7 @@ exports.FigureStrip = FigureStrip;
|
|
|
3510
3696
|
exports.FormDialog = FormDialog;
|
|
3511
3697
|
exports.HEADER_STACK_BREAKPOINT = HEADER_STACK_BREAKPOINT;
|
|
3512
3698
|
exports.Heading = Heading;
|
|
3699
|
+
exports.IdChip = IdChip;
|
|
3513
3700
|
exports.LAYOUT_COLLAPSE_BREAKPOINT = LAYOUT_COLLAPSE_BREAKPOINT;
|
|
3514
3701
|
exports.LAYOUT_I18N = LAYOUT_I18N;
|
|
3515
3702
|
exports.LAYOUT_TEST_IDS = LAYOUT_TEST_IDS;
|
|
@@ -3520,6 +3707,8 @@ exports.Modal = Modal;
|
|
|
3520
3707
|
exports.ModalDropdown = ModalDropdown;
|
|
3521
3708
|
exports.ModalShell = ModalShell;
|
|
3522
3709
|
exports.PageFrame = PageFrame;
|
|
3710
|
+
exports.RecordActionButton = RecordActionButton;
|
|
3711
|
+
exports.RecordHeader = RecordHeader;
|
|
3523
3712
|
exports.RowSelectedStyle = RowSelectedStyle;
|
|
3524
3713
|
exports.SECTION_INDEX_BREAKPOINT = SECTION_INDEX_BREAKPOINT;
|
|
3525
3714
|
exports.ScreenColumn = ScreenColumn;
|
|
@@ -3543,7 +3732,9 @@ exports.TextKind = TextKind;
|
|
|
3543
3732
|
exports.Timeline = Timeline;
|
|
3544
3733
|
exports.ToggleSection = ToggleSection;
|
|
3545
3734
|
exports.TruncatedText = TruncatedText;
|
|
3735
|
+
exports.UnderlineTabs = UnderlineTabs;
|
|
3546
3736
|
exports.UpgradePrompt = UpgradePrompt;
|
|
3737
|
+
exports.WidgetCard = WidgetCard;
|
|
3547
3738
|
exports.copyText = copyText;
|
|
3548
3739
|
exports.figureCell = figureCell;
|
|
3549
3740
|
exports.formatBuildInfo = formatBuildInfo;
|
|
@@ -3551,6 +3742,7 @@ exports.formatCount = formatCount;
|
|
|
3551
3742
|
exports.formatUrlForDisplay = formatUrlForDisplay;
|
|
3552
3743
|
exports.isKeyboardOpen = isKeyboardOpen;
|
|
3553
3744
|
exports.isModalFooterStacked = isModalFooterStacked;
|
|
3745
|
+
exports.isRecordHeaderCompact = isRecordHeaderCompact;
|
|
3554
3746
|
exports.isSplitSideBySide = isSplitSideBySide;
|
|
3555
3747
|
exports.isWideWebViewport = isWideWebViewport;
|
|
3556
3748
|
exports.pageScale = pageScale;
|