@dloizides/ui-layout 1.50.1 → 1.51.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 +4 -0
- package/dist/index.d.mts +89 -1
- package/dist/index.d.ts +89 -1
- package/dist/index.js +184 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +176 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3748,7 +3748,182 @@ var WidgetCard = ({ title, children, icon, headerRight, footer, testID }) => {
|
|
|
3748
3748
|
footer === void 0 ? null : /* @__PURE__ */ jsx(View, { style: styles41.footer, children: footer })
|
|
3749
3749
|
] });
|
|
3750
3750
|
};
|
|
3751
|
+
var LEAD_LABEL_SIZE = 14;
|
|
3752
|
+
var AMOUNT_SIZE = 30;
|
|
3753
|
+
var RECIPIENT_SIZE = 15;
|
|
3754
|
+
var LEAD_PAD = 16;
|
|
3755
|
+
var LEAD_RADIUS = 12;
|
|
3756
|
+
var GAP8 = 12;
|
|
3757
|
+
var LEAD_GAP = 4;
|
|
3758
|
+
var LEAD_BORDER = 1.5;
|
|
3759
|
+
var ACCENT_STEP = "500";
|
|
3760
|
+
var styles42 = StyleSheet.create({
|
|
3761
|
+
slip: { gap: GAP8, width: "100%" },
|
|
3762
|
+
lead: { padding: LEAD_PAD, borderRadius: LEAD_RADIUS, borderWidth: LEAD_BORDER, gap: LEAD_GAP },
|
|
3763
|
+
leadLabel: { fontSize: LEAD_LABEL_SIZE },
|
|
3764
|
+
amount: { fontSize: AMOUNT_SIZE, fontWeight: "800" },
|
|
3765
|
+
recipient: { fontSize: RECIPIENT_SIZE },
|
|
3766
|
+
rows: { width: "100%" }
|
|
3767
|
+
});
|
|
3768
|
+
var TransferSlip = ({ leadLabel, amount, recipient, children, footer, testID }) => {
|
|
3769
|
+
const { theme } = useUi();
|
|
3770
|
+
const { colors } = theme;
|
|
3771
|
+
const accent = theme.palette.primary[ACCENT_STEP];
|
|
3772
|
+
return /* @__PURE__ */ jsxs(View, { style: styles42.slip, testID, children: [
|
|
3773
|
+
/* @__PURE__ */ jsxs(View, { style: [styles42.lead, { borderColor: accent, backgroundColor: colors.surface }], testID: `${testID}-lead`, children: [
|
|
3774
|
+
/* @__PURE__ */ jsx(Text, { style: [styles42.leadLabel, { color: colors.textSecondary }], children: leadLabel }),
|
|
3775
|
+
/* @__PURE__ */ jsx(Text, { style: [styles42.amount, { color: colors.text }], testID: `${testID}-amount`, children: amount }),
|
|
3776
|
+
recipient !== void 0 && /* @__PURE__ */ jsx(Text, { style: [styles42.recipient, { color: colors.text }], children: recipient })
|
|
3777
|
+
] }),
|
|
3778
|
+
/* @__PURE__ */ jsx(View, { style: styles42.rows, children }),
|
|
3779
|
+
footer
|
|
3780
|
+
] });
|
|
3781
|
+
};
|
|
3782
|
+
|
|
3783
|
+
// src/TransferSlip/CopyRowEmphasis.ts
|
|
3784
|
+
var CopyRowEmphasis = /* @__PURE__ */ ((CopyRowEmphasis2) => {
|
|
3785
|
+
CopyRowEmphasis2["Inline"] = "inline";
|
|
3786
|
+
CopyRowEmphasis2["Prominent"] = "prominent";
|
|
3787
|
+
return CopyRowEmphasis2;
|
|
3788
|
+
})(CopyRowEmphasis || {});
|
|
3789
|
+
|
|
3790
|
+
// src/TransferSlip/copyActionLabel.ts
|
|
3791
|
+
function copyActionLabel(status, labels) {
|
|
3792
|
+
if (status === "copied" /* Copied */) return labels.copied;
|
|
3793
|
+
if (status === "failed" /* Failed */) return labels.failed;
|
|
3794
|
+
return labels.copy;
|
|
3795
|
+
}
|
|
3796
|
+
var LABEL_SIZE = 13;
|
|
3797
|
+
var VALUE_SIZE = 16;
|
|
3798
|
+
var PROMINENT_SIZE = 20;
|
|
3799
|
+
var ROW_GAP3 = 12;
|
|
3800
|
+
var STACK_GAP = 8;
|
|
3801
|
+
var ROW_PAD = 10;
|
|
3802
|
+
var TEXT_GAP = 2;
|
|
3803
|
+
var MONO_SPACING = 1;
|
|
3804
|
+
var styles43 = StyleSheet.create({
|
|
3805
|
+
inline: { flexDirection: "row", alignItems: "center", gap: ROW_GAP3, paddingVertical: ROW_PAD, borderTopWidth: StyleSheet.hairlineWidth },
|
|
3806
|
+
prominent: { gap: STACK_GAP, paddingVertical: ROW_PAD },
|
|
3807
|
+
text: { flex: 1, minWidth: 0, gap: TEXT_GAP },
|
|
3808
|
+
label: { fontSize: LABEL_SIZE, fontWeight: "600" },
|
|
3809
|
+
value: { fontSize: VALUE_SIZE },
|
|
3810
|
+
big: { fontSize: PROMINENT_SIZE, fontWeight: "700", fontFamily: "monospace", letterSpacing: MONO_SPACING }
|
|
3811
|
+
});
|
|
3812
|
+
var CopyValueRow = ({
|
|
3813
|
+
label,
|
|
3814
|
+
value,
|
|
3815
|
+
labels,
|
|
3816
|
+
emphasis = "inline" /* Inline */,
|
|
3817
|
+
copyValue,
|
|
3818
|
+
monospace = false,
|
|
3819
|
+
writer,
|
|
3820
|
+
testID
|
|
3821
|
+
}) => {
|
|
3822
|
+
const { theme } = useUi();
|
|
3823
|
+
const { colors } = theme;
|
|
3824
|
+
const { status, copy } = useCopyToClipboard(copyValue ?? value, writer);
|
|
3825
|
+
const action = copyActionLabel(status, labels);
|
|
3826
|
+
const prominent = emphasis === "prominent" /* Prominent */;
|
|
3827
|
+
const valueStyle = prominent || monospace ? styles43.big : styles43.value;
|
|
3828
|
+
return /* @__PURE__ */ jsxs(View, { style: prominent ? styles43.prominent : [styles43.inline, { borderTopColor: colors.border }], testID, children: [
|
|
3829
|
+
/* @__PURE__ */ jsxs(View, { style: styles43.text, children: [
|
|
3830
|
+
/* @__PURE__ */ jsx(Text, { style: [styles43.label, { color: colors.textSecondary }], children: label }),
|
|
3831
|
+
/* @__PURE__ */ jsx(Text, { selectable: true, style: [valueStyle, { color: colors.text }], testID: `${testID}-value`, children: value })
|
|
3832
|
+
] }),
|
|
3833
|
+
/* @__PURE__ */ jsx(
|
|
3834
|
+
Button,
|
|
3835
|
+
{
|
|
3836
|
+
accessibilityHint: labels.hint,
|
|
3837
|
+
accessibilityLabel: `${action}: ${label}`,
|
|
3838
|
+
fullWidth: prominent,
|
|
3839
|
+
label: action,
|
|
3840
|
+
size: prominent ? "md" : "sm",
|
|
3841
|
+
testID: `${testID}-copy`,
|
|
3842
|
+
variant: "outline",
|
|
3843
|
+
onPress: copy
|
|
3844
|
+
}
|
|
3845
|
+
)
|
|
3846
|
+
] });
|
|
3847
|
+
};
|
|
3848
|
+
|
|
3849
|
+
// src/TotalsStrip/TotalsTone.ts
|
|
3850
|
+
var TotalsTone = /* @__PURE__ */ ((TotalsTone2) => {
|
|
3851
|
+
TotalsTone2["Neutral"] = "neutral";
|
|
3852
|
+
TotalsTone2["Alert"] = "alert";
|
|
3853
|
+
return TotalsTone2;
|
|
3854
|
+
})(TotalsTone || {});
|
|
3855
|
+
var LABEL_SIZE2 = 13;
|
|
3856
|
+
var VALUE_SIZE2 = 20;
|
|
3857
|
+
var CAPTION_SIZE = 13;
|
|
3858
|
+
var TILE_PAD = 12;
|
|
3859
|
+
var TILE_RADIUS = 10;
|
|
3860
|
+
var TILE_GAP = 2;
|
|
3861
|
+
var ALERT_STEP = "500";
|
|
3862
|
+
var styles44 = StyleSheet.create({
|
|
3863
|
+
tile: { padding: TILE_PAD, borderRadius: TILE_RADIUS, borderWidth: StyleSheet.hairlineWidth, gap: TILE_GAP },
|
|
3864
|
+
label: { fontSize: LABEL_SIZE2, fontWeight: "600" },
|
|
3865
|
+
value: { fontSize: VALUE_SIZE2, fontWeight: "700" },
|
|
3866
|
+
caption: { fontSize: CAPTION_SIZE }
|
|
3867
|
+
});
|
|
3868
|
+
var TotalsStrip = ({ items, breakpoint = LAYOUT_COLLAPSE_BREAKPOINT, testID }) => {
|
|
3869
|
+
const { theme } = useUi();
|
|
3870
|
+
const { colors } = theme;
|
|
3871
|
+
const { width } = useWindowDimensions();
|
|
3872
|
+
const wide = width >= breakpoint;
|
|
3873
|
+
return /* @__PURE__ */ jsx(FigureStrip, { testID, children: items.map((item) => /* @__PURE__ */ jsxs(
|
|
3874
|
+
View,
|
|
3875
|
+
{
|
|
3876
|
+
style: [styles44.tile, figureCell(wide), { borderColor: colors.border, backgroundColor: colors.surfaceElevated }],
|
|
3877
|
+
testID: `${testID}-${item.key}`,
|
|
3878
|
+
children: [
|
|
3879
|
+
/* @__PURE__ */ jsx(Text, { style: [styles44.label, { color: colors.textSecondary }], children: item.label }),
|
|
3880
|
+
/* @__PURE__ */ jsx(
|
|
3881
|
+
Text,
|
|
3882
|
+
{
|
|
3883
|
+
style: [styles44.value, { color: item.tone === "alert" /* Alert */ ? theme.semantic.error[ALERT_STEP] : colors.text }],
|
|
3884
|
+
testID: `${testID}-${item.key}-value`,
|
|
3885
|
+
children: item.value
|
|
3886
|
+
}
|
|
3887
|
+
),
|
|
3888
|
+
item.caption !== void 0 && /* @__PURE__ */ jsx(Text, { style: [styles44.caption, { color: colors.textSecondary }], children: item.caption })
|
|
3889
|
+
]
|
|
3890
|
+
},
|
|
3891
|
+
item.key
|
|
3892
|
+
)) });
|
|
3893
|
+
};
|
|
3894
|
+
|
|
3895
|
+
// src/ListDetailLayout/ListDetailPane.ts
|
|
3896
|
+
var ListDetailPane = /* @__PURE__ */ ((ListDetailPane2) => {
|
|
3897
|
+
ListDetailPane2["List"] = "list";
|
|
3898
|
+
ListDetailPane2["Detail"] = "detail";
|
|
3899
|
+
return ListDetailPane2;
|
|
3900
|
+
})(ListDetailPane || {});
|
|
3901
|
+
|
|
3902
|
+
// src/ListDetailLayout/resolveListDetailPanes.ts
|
|
3903
|
+
function resolveListDetailPanes(wide, narrowPane, hasDetail) {
|
|
3904
|
+
if (wide) return { list: true, detail: true };
|
|
3905
|
+
const detail = narrowPane === "detail" /* Detail */ && hasDetail;
|
|
3906
|
+
return { list: !detail, detail };
|
|
3907
|
+
}
|
|
3908
|
+
var ListDetailLayout = ({
|
|
3909
|
+
list,
|
|
3910
|
+
detail,
|
|
3911
|
+
placeholder,
|
|
3912
|
+
narrowPane = "list" /* List */,
|
|
3913
|
+
breakpoint = LAYOUT_COLLAPSE_BREAKPOINT,
|
|
3914
|
+
listWeight,
|
|
3915
|
+
testID
|
|
3916
|
+
}) => {
|
|
3917
|
+
const { width } = useWindowDimensions();
|
|
3918
|
+
const wide = width >= breakpoint;
|
|
3919
|
+
const hasDetail = detail !== void 0 && detail !== null;
|
|
3920
|
+
const panes = resolveListDetailPanes(wide, narrowPane, hasDetail);
|
|
3921
|
+
if (wide) {
|
|
3922
|
+
return /* @__PURE__ */ jsx(SplitPanes, { end: hasDetail ? detail : placeholder, layout: "side" /* Side */, start: list, startWeight: listWeight, testID });
|
|
3923
|
+
}
|
|
3924
|
+
return /* @__PURE__ */ jsx(SplitPanes, { end: null, layout: "stack" /* Stack */, start: panes.detail ? detail : list, testID });
|
|
3925
|
+
};
|
|
3751
3926
|
|
|
3752
|
-
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, AppText, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, Breadcrumb, BuildInfoFooter, COPY_FEEDBACK_MS, ChipOverflow, ConfirmDialog, ConfirmDialogFocus, CopyStatus, CopyableId, CountBadge, DEFAULT_BILLING_ROUTE, DayCard, DropdownVariant, ELLIPSIS, FigureStrip, FormDialog, HEADER_STACK_BREAKPOINT, Heading, IdChip, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListRow, MIN_TARGET_PX, MODAL_FOOTER_STACK_BELOW, Modal, ModalDropdown, ModalShell, PageFrame, RecordActionButton, RecordHeader, RowSelectedStyle, SECTION_INDEX_BREAKPOINT, ScreenColumn, Section, SectionChips, SectionDensity, SectionIndex, SectionIndexLayout, SectionVariant, SegmentedControl, SelectedMarker, SideSheet, SplitLayout, SplitPanes, StatusBadge, StickyPreview, TYPE_SCALE_BREAKPOINT, Tabs, TabsCollapsedTrigger, TextKind, Timeline, ToggleSection, TruncatedText, UnderlineTabs, UpgradePrompt, WidgetCard, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isRecordHeaderCompact, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveRowLook, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
|
|
3927
|
+
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, AppText, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, Breadcrumb, BuildInfoFooter, COPY_FEEDBACK_MS, ChipOverflow, ConfirmDialog, ConfirmDialogFocus, CopyRowEmphasis, CopyStatus, CopyValueRow, CopyableId, CountBadge, DEFAULT_BILLING_ROUTE, DayCard, DropdownVariant, ELLIPSIS, FigureStrip, FormDialog, HEADER_STACK_BREAKPOINT, Heading, IdChip, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListDetailLayout, ListDetailPane, ListRow, MIN_TARGET_PX, MODAL_FOOTER_STACK_BELOW, Modal, ModalDropdown, ModalShell, PageFrame, RecordActionButton, RecordHeader, RowSelectedStyle, SECTION_INDEX_BREAKPOINT, ScreenColumn, Section, SectionChips, SectionDensity, SectionIndex, SectionIndexLayout, SectionVariant, SegmentedControl, SelectedMarker, SideSheet, SplitLayout, SplitPanes, StatusBadge, StickyPreview, TYPE_SCALE_BREAKPOINT, Tabs, TabsCollapsedTrigger, TextKind, Timeline, ToggleSection, TotalsStrip, TotalsTone, TransferSlip, TruncatedText, UnderlineTabs, UpgradePrompt, WidgetCard, copyActionLabel, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isRecordHeaderCompact, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveListDetailPanes, resolveRowLook, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
|
|
3753
3928
|
//# sourceMappingURL=index.mjs.map
|
|
3754
3929
|
//# sourceMappingURL=index.mjs.map
|