@dloizides/ui-layout 1.57.0 → 1.58.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/dist/index.mjs CHANGED
@@ -3531,12 +3531,23 @@ var DayBadgeFill = /* @__PURE__ */ ((DayBadgeFill2) => {
3531
3531
  DayBadgeFill2["Tint"] = "tint";
3532
3532
  return DayBadgeFill2;
3533
3533
  })(DayBadgeFill || {});
3534
+
3535
+ // src/DayCard/DayCardLayout.ts
3536
+ var DayCardLayout = /* @__PURE__ */ ((DayCardLayout2) => {
3537
+ DayCardLayout2["Grouped"] = "grouped";
3538
+ DayCardLayout2["Separate"] = "separate";
3539
+ return DayCardLayout2;
3540
+ })(DayCardLayout || {});
3534
3541
  var PILL_RADIUS2 = 999;
3535
3542
  var BADGE_ICON_SIZE = 12;
3543
+ var ITEM_RADIUS = 12;
3544
+ var ITEM_GAP = 8;
3536
3545
  var styles32 = StyleSheet.create({
3537
3546
  body: { borderRadius: 8, borderWidth: 1, overflow: "hidden" },
3538
3547
  count: { borderRadius: PILL_RADIUS2, borderWidth: 1, fontSize: 12, fontWeight: "700", paddingHorizontal: 8 },
3539
3548
  head: { alignItems: "center", flexDirection: "row", flexWrap: "wrap", gap: 8 },
3549
+ item: { borderRadius: ITEM_RADIUS, borderWidth: 1, overflow: "hidden" },
3550
+ items: { gap: ITEM_GAP },
3540
3551
  label: { fontSize: 13, fontWeight: "600" },
3541
3552
  stack: { gap: 6 }
3542
3553
  });
@@ -3549,12 +3560,14 @@ var DayCard = ({
3549
3560
  badgeTone = "warning" /* Warning */,
3550
3561
  badgeFill = "solid" /* Solid */,
3551
3562
  badgeIcon,
3563
+ layout = "grouped" /* Grouped */,
3552
3564
  testID,
3553
3565
  children
3554
3566
  }) => {
3555
3567
  const { theme } = useUi();
3556
3568
  const { colors } = theme;
3557
3569
  const tint = badgeFill === "tint" /* Tint */ ? resolveTintColors(theme, badgeTone) : void 0;
3570
+ const surface = { backgroundColor: colors.surface, borderColor: colors.border };
3558
3571
  const iconInk = tint?.color ?? colors.textSecondary;
3559
3572
  const icon = badgeIcon === void 0 ? void 0 : /* @__PURE__ */ jsx(SvgIcon, { color: iconInk, name: badgeIcon, size: BADGE_ICON_SIZE });
3560
3573
  return /* @__PURE__ */ jsxs(View, { style: styles32.stack, testID, children: [
@@ -3563,7 +3576,7 @@ var DayCard = ({
3563
3576
  /* @__PURE__ */ jsx(StatusBadge, { backgroundColor: tint?.backgroundColor, color: tint?.color, icon, label: badge, testID: testID === void 0 ? void 0 : `${testID}-badge`, tone: badgeTone }),
3564
3577
  /* @__PURE__ */ jsx(Text, { style: [styles32.count, { borderColor: colors.border, color: colors.textSecondary }], children: String(count) })
3565
3578
  ] }),
3566
- /* @__PURE__ */ jsx(View, { style: [styles32.body, { backgroundColor: colors.surface, borderColor: colors.border }], children })
3579
+ layout === "separate" /* Separate */ ? /* @__PURE__ */ jsx(View, { style: styles32.items, children: React16.Children.toArray(children).map((child, index) => /* @__PURE__ */ jsx(View, { style: [styles32.item, surface], testID: testID === void 0 ? void 0 : `${testID}-item-${String(index)}`, children: child }, index)) }) : /* @__PURE__ */ jsx(View, { style: [styles32.body, surface], children })
3567
3580
  ] });
3568
3581
  };
3569
3582
  var styles33 = StyleSheet.create({
@@ -3847,19 +3860,21 @@ var TabPressable = ({ tab, selected, onChange, style, children }) => /* @__PURE_
3847
3860
  children
3848
3861
  }
3849
3862
  );
3850
- var UnderlineTabItem = ({ underline, ...item }) => {
3863
+ var UnderlineTabItem = ({ underline, activeText, ...item }) => {
3851
3864
  const { theme } = useUi();
3865
+ const selectedInk = activeText ?? theme.colors.text;
3852
3866
  return /* @__PURE__ */ jsxs(TabPressable, { ...item, style: [styles43.tab, { borderBottomColor: item.selected ? underline : "transparent" }], children: [
3853
3867
  item.tab.icon ?? null,
3854
- /* @__PURE__ */ jsx(Text, { style: [styles43.label, { color: item.selected ? theme.colors.text : theme.colors.textSecondary }], children: item.tab.label }),
3868
+ /* @__PURE__ */ jsx(Text, { style: [styles43.label, { color: item.selected ? selectedInk : theme.colors.textSecondary }], children: item.tab.label }),
3855
3869
  item.tab.count === void 0 ? null : /* @__PURE__ */ jsx(Text, { style: [styles43.count, { backgroundColor: theme.colors.border, color: theme.colors.text }], children: String(item.tab.count) })
3856
3870
  ] });
3857
3871
  };
3858
- var ChipTabItem = (item) => {
3872
+ var ChipTabItem = ({ activeFill, activeText, ...item }) => {
3859
3873
  const { theme } = useUi();
3860
- const fill = item.selected ? theme.colors.text : "transparent";
3861
- const ink = item.selected ? theme.colors.background : theme.colors.text;
3862
- return /* @__PURE__ */ jsxs(TabPressable, { ...item, style: [styles43.chip, { backgroundColor: fill, borderColor: item.selected ? theme.colors.text : theme.colors.border }], children: [
3874
+ const selectedFill = activeFill ?? theme.colors.text;
3875
+ const fill = item.selected ? selectedFill : "transparent";
3876
+ const ink = item.selected ? activeText ?? theme.colors.background : theme.colors.text;
3877
+ return /* @__PURE__ */ jsxs(TabPressable, { ...item, style: [styles43.chip, { backgroundColor: fill, borderColor: item.selected ? selectedFill : theme.colors.border }], children: [
3863
3878
  /* @__PURE__ */ jsx(Text, { style: [styles43.label, { color: ink }], children: item.tab.label }),
3864
3879
  item.tab.count === void 0 ? null : /* @__PURE__ */ jsx(Text, { style: [styles43.chipCount, { color: ink }], children: String(item.tab.count) })
3865
3880
  ] });
@@ -3880,14 +3895,14 @@ var styles44 = StyleSheet.create({
3880
3895
  chipWrap: { flexWrap: "wrap" },
3881
3896
  strip: { position: "relative", width: "100%" }
3882
3897
  });
3883
- var UnderlineTabs = ({ tabs, activeKey, onChange, accessibilityLabel, accessibilityHint, underlineColor, fadeColor, testID, variant = "underline" /* Underline */, chipOverflow = "scroll" /* Scroll */ }) => {
3898
+ var UnderlineTabs = ({ tabs, activeKey, onChange, accessibilityLabel, accessibilityHint, underlineColor, fadeColor, testID, variant = "underline" /* Underline */, chipOverflow = "scroll" /* Scroll */, activeFillColor, activeTextColor }) => {
3884
3899
  const { theme } = useUi();
3885
3900
  const underline = underlineColor ?? theme.palette.primary[DEFAULT_UNDERLINE_STEP];
3886
3901
  const fade = useEdgeFade();
3887
3902
  const chips = variant === "chips" /* Chips */;
3888
3903
  const items = tabs.map((tab) => {
3889
- const item = { tab, selected: tab.key === activeKey, onChange };
3890
- return chips ? /* @__PURE__ */ jsx(ChipTabItem, { ...item }, tab.key) : /* @__PURE__ */ jsx(UnderlineTabItem, { ...item, underline }, tab.key);
3904
+ const item = { tab, selected: tab.key === activeKey, onChange, activeText: activeTextColor };
3905
+ return chips ? /* @__PURE__ */ jsx(ChipTabItem, { ...item, activeFill: activeFillColor }, tab.key) : /* @__PURE__ */ jsx(UnderlineTabItem, { ...item, underline }, tab.key);
3891
3906
  });
3892
3907
  const stripStyle = chips ? styles44.strip : [styles44.strip, { borderBottomColor: theme.colors.border, borderBottomWidth: 1 }];
3893
3908
  if (chips && chipOverflow === "wrap" /* Wrap */) {
@@ -4115,6 +4130,6 @@ var ListDetailLayout = ({
4115
4130
  return /* @__PURE__ */ jsx(SplitPanes, { end: null, layout: "stack" /* Stack */, start: panes.detail ? detail : list, testID });
4116
4131
  };
4117
4132
 
4118
- export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, AppText, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, Breadcrumb, BuildInfoFooter, COPY_FEEDBACK_MS, ChipOverflow, ConfirmDialog, ConfirmDialogFocus, CopyControl, CopyRowEmphasis, CopyStatus, CopyValueRow, CopyableId, CountBadge, DEFAULT_BILLING_ROUTE, DayBadgeFill, 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, PageHead, RecordActionButton, RecordHeader, RowSelectedStyle, SECTION_INDEX_BREAKPOINT, SECTION_INDEX_WIDTH, ScreenColumn, Section, SectionChips, SectionDensity, SectionIndex, SectionIndexLayout, SectionVariant, SegmentedControl, SegmentedVariant, SelectedMarker, SideSheet, SplitLayout, SplitPanes, StatusBadge, StickyActionBar, StickyPreview, TYPE_SCALE_BREAKPOINT, Tabs, TabsCollapsedTrigger, TabsVariant, 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, resolveTintColors, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
4133
+ export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, AppText, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, Breadcrumb, BuildInfoFooter, COPY_FEEDBACK_MS, ChipOverflow, ConfirmDialog, ConfirmDialogFocus, CopyControl, CopyRowEmphasis, CopyStatus, CopyValueRow, CopyableId, CountBadge, DEFAULT_BILLING_ROUTE, DayBadgeFill, DayCard, DayCardLayout, 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, PageHead, RecordActionButton, RecordHeader, RowSelectedStyle, SECTION_INDEX_BREAKPOINT, SECTION_INDEX_WIDTH, ScreenColumn, Section, SectionChips, SectionDensity, SectionIndex, SectionIndexLayout, SectionVariant, SegmentedControl, SegmentedVariant, SelectedMarker, SideSheet, SplitLayout, SplitPanes, StatusBadge, StickyActionBar, StickyPreview, TYPE_SCALE_BREAKPOINT, Tabs, TabsCollapsedTrigger, TabsVariant, 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, resolveTintColors, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
4119
4134
  //# sourceMappingURL=index.mjs.map
4120
4135
  //# sourceMappingURL=index.mjs.map