@dloizides/ui-layout 1.20.0 → 1.21.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 +28 -0
- package/README.md +3 -2
- package/dist/index.d.mts +45 -3
- package/dist/index.d.ts +45 -3
- package/dist/index.js +42 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.21.0
|
|
4
|
+
|
|
5
|
+
**The collapsed `Tabs` menu can now present as a HAMBURGER (☰) — the universal mobile-nav affordance.**
|
|
6
|
+
|
|
7
|
+
The collapsed organizer nav reads better on a phone as a ☰ hamburger than as a caret field.
|
|
8
|
+
This adds an opt-in so a consumer can choose either presentation; the default is unchanged.
|
|
9
|
+
|
|
10
|
+
- **New opt-in prop `ModalDropdown.showHamburger?: boolean` (default `false`).** When set, the
|
|
11
|
+
DEFAULT trigger renders a ☰ glyph LEADING the active option's label, with the same bordered
|
|
12
|
+
field box, theme tokens and ≥44dp (`MIN_TOUCH_TARGET`) hit target as the caret variant. It
|
|
13
|
+
**takes precedence over `showCaret`** (a hamburger already IS the "this is a menu" cue, so the
|
|
14
|
+
trailing caret would be redundant) and, like `showCaret`, is ignored when a custom `renderTrigger`
|
|
15
|
+
is supplied. The glyph is a font character (U+2630) — no icon package enters this contract-pure
|
|
16
|
+
kit — and its colour comes from `colors.textSecondary` (no raw literals). It is decorative: the
|
|
17
|
+
trigger's `aria-label` still names the control, so screen readers do not announce the glyph.
|
|
18
|
+
- **New exported enum `TabsCollapsedTrigger { Caret, Hamburger }`** + new optional prop
|
|
19
|
+
**`Tabs.collapsedTrigger` / `TabsMenu.collapsedTrigger` (default `Caret`).** Selects how the
|
|
20
|
+
COLLAPSED (mobile) tab menu trigger presents; only affects the collapsed form, the wide pill
|
|
21
|
+
strip is identical either way. Exported as a regular (runtime) enum for the same reason as
|
|
22
|
+
`DropdownVariant` — a `const enum` cannot cross the published-package boundary under
|
|
23
|
+
`isolatedModules`.
|
|
24
|
+
|
|
25
|
+
Backward-compatible: two new optional props + one new enum, all defaulting to the prior behaviour;
|
|
26
|
+
no testID/selector changes. Per-tab E2E selectors (`{idPrefix}-menu` trigger, `{idPrefix}-tab-{key}`
|
|
27
|
+
/ descriptor option testIDs) are untouched. No new i18n keys (the existing `common.tabsMenuHint`
|
|
28
|
+
serves both presentations). Covered by component tests (`ModalDropdown.test.tsx`,
|
|
29
|
+
`Tabs.collapsed.test.tsx`).
|
|
30
|
+
|
|
3
31
|
## 1.20.0
|
|
4
32
|
|
|
5
33
|
**The collapsed `Tabs` menu now READS as a menu — a caret affordance + guaranteed focus.**
|
package/README.md
CHANGED
|
@@ -11,8 +11,9 @@ Read theme + translations from the shared `@dloizides/ui-feedback` context (`use
|
|
|
11
11
|
| `Heading` | Themed section heading text. |
|
|
12
12
|
| `StatusBadge` | Status pill — caller supplies `label`/`color`/`backgroundColor`. |
|
|
13
13
|
| `UpgradePrompt` | Free-tier upgrade nudge; CTA navigates to the billing route via `useUi().navigate`. |
|
|
14
|
-
| `Tabs` | Controlled tabbed section shell. **Responsive**: a horizontal `role=tablist` pill strip on wide web, collapsing to a real mobile MENU (a trigger + vertical section list, via `ModalDropdown`) below `collapseBelow` (default 768) or on native. Per-tab `testID`s survive in both modes. Requires the `common.tabsMenuHint` key. |
|
|
15
|
-
| `
|
|
14
|
+
| `Tabs` | Controlled tabbed section shell. **Responsive**: a horizontal `role=tablist` pill strip on wide web, collapsing to a real mobile MENU (a trigger + vertical section list, via `ModalDropdown`) below `collapseBelow` (default 768) or on native. The collapsed trigger presents as a caret field (default) or a ☰ hamburger via `collapsedTrigger`. Per-tab `testID`s survive in both modes. Requires the `common.tabsMenuHint` key. |
|
|
15
|
+
| `TabsCollapsedTrigger` | Enum (`Caret` / `Hamburger`) selecting how the collapsed `Tabs` menu trigger presents. Defaults to `Caret`. |
|
|
16
|
+
| `ModalDropdown` | Generic dropdown selector. **Responsive by default**: an inline anchored menu on wide/desktop web, a modal on narrow/mobile — override per screen with `variant`. Opt into a menu affordance on the default trigger with `showCaret` (trailing ▾) or `showHamburger` (leading ☰, wins over `showCaret`). |
|
|
16
17
|
| `DropdownVariant` | Enum (`Menu` / `Modal`) to force a `ModalDropdown` rendering variant. |
|
|
17
18
|
| `Accordion` / `AccordionItem` | Themed expand/collapse disclosure group (replaces hand-rolled `<details>`/expanders). Controlled or uncontrolled, single- or multi-open, animated, keyboard + screen-reader accessible. |
|
|
18
19
|
| `useFocusTrap` | Web keyboard focus-trap hook (no-op on native). |
|
package/dist/index.d.mts
CHANGED
|
@@ -106,6 +106,31 @@ interface SegmentedControlProps<V extends string = string> {
|
|
|
106
106
|
*/
|
|
107
107
|
declare function SegmentedControl<V extends string = string>({ options, value, onChange, accessibilityLabel, style, testID, }: SegmentedControlProps<V>): React.ReactElement;
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* How the COLLAPSED (mobile) {@link import('./Tabs').Tabs} menu trigger presents.
|
|
111
|
+
*
|
|
112
|
+
* Below the collapse breakpoint the tab strip becomes a single trigger that opens
|
|
113
|
+
* the vertical section list. This selects that trigger's affordance:
|
|
114
|
+
*
|
|
115
|
+
* - `Caret` — a bordered field showing the active section's label + a rotating ▾
|
|
116
|
+
* caret. The default, so every existing consumer is visually unchanged.
|
|
117
|
+
* - `Hamburger` — a ☰ menu icon (the universal mobile-nav affordance) leading the
|
|
118
|
+
* active section's label. Opt in for a phone-first nav that reads as a menu.
|
|
119
|
+
*
|
|
120
|
+
* Exported as a regular (non-`const`) enum on purpose — the SAME reason as
|
|
121
|
+
* {@link import('../ModalDropdown/DropdownVariant').DropdownVariant}: a `const enum`
|
|
122
|
+
* is inlined at compile time and cannot cross a published-package boundary when the
|
|
123
|
+
* consumer bundles with `isolatedModules` (esbuild / vite / babel — i.e. every app
|
|
124
|
+
* that consumes this package). A regular enum emits a runtime object safe to import
|
|
125
|
+
* and compare in any consumer.
|
|
126
|
+
*/
|
|
127
|
+
declare enum TabsCollapsedTrigger {
|
|
128
|
+
/** Bordered field with the active label + a rotating ▾ caret (default, unchanged). */
|
|
129
|
+
Caret = "caret",
|
|
130
|
+
/** A ☰ hamburger icon leading the active label — the mobile-nav affordance. */
|
|
131
|
+
Hamburger = "hamburger"
|
|
132
|
+
}
|
|
133
|
+
|
|
109
134
|
/**
|
|
110
135
|
* Tabs — a named-section shell for a long dashboard. On WIDE viewports it is a
|
|
111
136
|
* horizontal strip of pill tabs (a single scrollable `nowrap` row) plus the
|
|
@@ -162,6 +187,13 @@ interface TabsProps {
|
|
|
162
187
|
* force the menu, or `0` to keep the row on any web width.
|
|
163
188
|
*/
|
|
164
189
|
collapseBelow?: number;
|
|
190
|
+
/**
|
|
191
|
+
* How the COLLAPSED (mobile) menu trigger presents — a caret field (default) or a
|
|
192
|
+
* ☰ hamburger. See {@link TabsCollapsedTrigger}. Defaults to `Caret`, so existing
|
|
193
|
+
* consumers are unchanged; a phone-first nav opts into `Hamburger`. Only affects the
|
|
194
|
+
* collapsed form — the wide pill strip is identical either way.
|
|
195
|
+
*/
|
|
196
|
+
collapsedTrigger?: TabsCollapsedTrigger;
|
|
165
197
|
/** Style override merged onto the root container. */
|
|
166
198
|
style?: StyleProp<ViewStyle>;
|
|
167
199
|
/** Style override merged onto the tab strip (wide mode only). */
|
|
@@ -175,7 +207,7 @@ interface TabsProps {
|
|
|
175
207
|
* the wide pill strip or — below `collapseBelow` — the mobile menu. Generic-free
|
|
176
208
|
* by design: tab identity is a plain string `key`.
|
|
177
209
|
*/
|
|
178
|
-
declare const Tabs: ({ tabs, activeKey, onChange, accessibilityLabel, children, idPrefix, collapseBelow, style, stripStyle, panelStyle, testID, }: TabsProps) => React.ReactElement;
|
|
210
|
+
declare const Tabs: ({ tabs, activeKey, onChange, accessibilityLabel, children, idPrefix, collapseBelow, collapsedTrigger, style, stripStyle, panelStyle, testID, }: TabsProps) => React.ReactElement;
|
|
179
211
|
|
|
180
212
|
/**
|
|
181
213
|
* UpgradePrompt — shown when a free-tier user hits a feature limit. CTA navigates to the
|
|
@@ -278,8 +310,18 @@ interface ModalDropdownProps<T> {
|
|
|
278
310
|
* its own visuals, affordance included.
|
|
279
311
|
*/
|
|
280
312
|
showCaret?: boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Present the DEFAULT trigger as a HAMBURGER (☰) menu: the universal mobile-nav glyph LEADING the
|
|
315
|
+
* active option's label, with the same bordered field box and ≥44dp hit target. Opt-in and OFF by
|
|
316
|
+
* default. When set it takes precedence over `showCaret` (a hamburger already IS the "this is a
|
|
317
|
+
* menu" cue, so the trailing caret is redundant), and — like `showCaret` — it is ignored when a
|
|
318
|
+
* custom `renderTrigger` is supplied. The glyph is a font character (U+2630), so no icon package
|
|
319
|
+
* enters this contract-pure kit, and it is decorative: the trigger's `aria-label` names the
|
|
320
|
+
* control, so screen readers do not announce it.
|
|
321
|
+
*/
|
|
322
|
+
showHamburger?: boolean;
|
|
281
323
|
}
|
|
282
|
-
declare const ModalDropdown: <T extends string | number>({ testID, accessibilityLabel, accessibilityHint, value, options, onChange, variant, renderTrigger, optionTestID, menuMinWidth, showCaret, }: ModalDropdownProps<T>) => React.ReactElement;
|
|
324
|
+
declare const ModalDropdown: <T extends string | number>({ testID, accessibilityLabel, accessibilityHint, value, options, onChange, variant, renderTrigger, optionTestID, menuMinWidth, showCaret, showHamburger, }: ModalDropdownProps<T>) => React.ReactElement;
|
|
283
325
|
|
|
284
326
|
/**
|
|
285
327
|
* ModalShell — a slide-up full-screen modal with a themed header (title + close button)
|
|
@@ -639,4 +681,4 @@ declare const LAYOUT_I18N: {
|
|
|
639
681
|
readonly copyableIdHint: "common.copyableIdHint";
|
|
640
682
|
};
|
|
641
683
|
|
|
642
|
-
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, COPY_FEEDBACK_MS, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, DEFAULT_BILLING_ROUTE, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, Heading, type HeadingLevel, type HeadingProps, LAYOUT_I18N, LAYOUT_TEST_IDS, ModalDropdown, type ModalDropdownProps, ModalShell, type ModalShellProps, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, StatusBadge, type StatusBadgeProps, type TabDescriptor, Tabs, type TabsProps, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, copyText, formatUrlForDisplay, truncateMiddle, useCopyToClipboard, useFocusTrap };
|
|
684
|
+
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, COPY_FEEDBACK_MS, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, DEFAULT_BILLING_ROUTE, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, Heading, type HeadingLevel, type HeadingProps, LAYOUT_I18N, LAYOUT_TEST_IDS, ModalDropdown, type ModalDropdownProps, ModalShell, type ModalShellProps, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, StatusBadge, type StatusBadgeProps, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, copyText, formatUrlForDisplay, truncateMiddle, useCopyToClipboard, useFocusTrap };
|
package/dist/index.d.ts
CHANGED
|
@@ -106,6 +106,31 @@ interface SegmentedControlProps<V extends string = string> {
|
|
|
106
106
|
*/
|
|
107
107
|
declare function SegmentedControl<V extends string = string>({ options, value, onChange, accessibilityLabel, style, testID, }: SegmentedControlProps<V>): React.ReactElement;
|
|
108
108
|
|
|
109
|
+
/**
|
|
110
|
+
* How the COLLAPSED (mobile) {@link import('./Tabs').Tabs} menu trigger presents.
|
|
111
|
+
*
|
|
112
|
+
* Below the collapse breakpoint the tab strip becomes a single trigger that opens
|
|
113
|
+
* the vertical section list. This selects that trigger's affordance:
|
|
114
|
+
*
|
|
115
|
+
* - `Caret` — a bordered field showing the active section's label + a rotating ▾
|
|
116
|
+
* caret. The default, so every existing consumer is visually unchanged.
|
|
117
|
+
* - `Hamburger` — a ☰ menu icon (the universal mobile-nav affordance) leading the
|
|
118
|
+
* active section's label. Opt in for a phone-first nav that reads as a menu.
|
|
119
|
+
*
|
|
120
|
+
* Exported as a regular (non-`const`) enum on purpose — the SAME reason as
|
|
121
|
+
* {@link import('../ModalDropdown/DropdownVariant').DropdownVariant}: a `const enum`
|
|
122
|
+
* is inlined at compile time and cannot cross a published-package boundary when the
|
|
123
|
+
* consumer bundles with `isolatedModules` (esbuild / vite / babel — i.e. every app
|
|
124
|
+
* that consumes this package). A regular enum emits a runtime object safe to import
|
|
125
|
+
* and compare in any consumer.
|
|
126
|
+
*/
|
|
127
|
+
declare enum TabsCollapsedTrigger {
|
|
128
|
+
/** Bordered field with the active label + a rotating ▾ caret (default, unchanged). */
|
|
129
|
+
Caret = "caret",
|
|
130
|
+
/** A ☰ hamburger icon leading the active label — the mobile-nav affordance. */
|
|
131
|
+
Hamburger = "hamburger"
|
|
132
|
+
}
|
|
133
|
+
|
|
109
134
|
/**
|
|
110
135
|
* Tabs — a named-section shell for a long dashboard. On WIDE viewports it is a
|
|
111
136
|
* horizontal strip of pill tabs (a single scrollable `nowrap` row) plus the
|
|
@@ -162,6 +187,13 @@ interface TabsProps {
|
|
|
162
187
|
* force the menu, or `0` to keep the row on any web width.
|
|
163
188
|
*/
|
|
164
189
|
collapseBelow?: number;
|
|
190
|
+
/**
|
|
191
|
+
* How the COLLAPSED (mobile) menu trigger presents — a caret field (default) or a
|
|
192
|
+
* ☰ hamburger. See {@link TabsCollapsedTrigger}. Defaults to `Caret`, so existing
|
|
193
|
+
* consumers are unchanged; a phone-first nav opts into `Hamburger`. Only affects the
|
|
194
|
+
* collapsed form — the wide pill strip is identical either way.
|
|
195
|
+
*/
|
|
196
|
+
collapsedTrigger?: TabsCollapsedTrigger;
|
|
165
197
|
/** Style override merged onto the root container. */
|
|
166
198
|
style?: StyleProp<ViewStyle>;
|
|
167
199
|
/** Style override merged onto the tab strip (wide mode only). */
|
|
@@ -175,7 +207,7 @@ interface TabsProps {
|
|
|
175
207
|
* the wide pill strip or — below `collapseBelow` — the mobile menu. Generic-free
|
|
176
208
|
* by design: tab identity is a plain string `key`.
|
|
177
209
|
*/
|
|
178
|
-
declare const Tabs: ({ tabs, activeKey, onChange, accessibilityLabel, children, idPrefix, collapseBelow, style, stripStyle, panelStyle, testID, }: TabsProps) => React.ReactElement;
|
|
210
|
+
declare const Tabs: ({ tabs, activeKey, onChange, accessibilityLabel, children, idPrefix, collapseBelow, collapsedTrigger, style, stripStyle, panelStyle, testID, }: TabsProps) => React.ReactElement;
|
|
179
211
|
|
|
180
212
|
/**
|
|
181
213
|
* UpgradePrompt — shown when a free-tier user hits a feature limit. CTA navigates to the
|
|
@@ -278,8 +310,18 @@ interface ModalDropdownProps<T> {
|
|
|
278
310
|
* its own visuals, affordance included.
|
|
279
311
|
*/
|
|
280
312
|
showCaret?: boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Present the DEFAULT trigger as a HAMBURGER (☰) menu: the universal mobile-nav glyph LEADING the
|
|
315
|
+
* active option's label, with the same bordered field box and ≥44dp hit target. Opt-in and OFF by
|
|
316
|
+
* default. When set it takes precedence over `showCaret` (a hamburger already IS the "this is a
|
|
317
|
+
* menu" cue, so the trailing caret is redundant), and — like `showCaret` — it is ignored when a
|
|
318
|
+
* custom `renderTrigger` is supplied. The glyph is a font character (U+2630), so no icon package
|
|
319
|
+
* enters this contract-pure kit, and it is decorative: the trigger's `aria-label` names the
|
|
320
|
+
* control, so screen readers do not announce it.
|
|
321
|
+
*/
|
|
322
|
+
showHamburger?: boolean;
|
|
281
323
|
}
|
|
282
|
-
declare const ModalDropdown: <T extends string | number>({ testID, accessibilityLabel, accessibilityHint, value, options, onChange, variant, renderTrigger, optionTestID, menuMinWidth, showCaret, }: ModalDropdownProps<T>) => React.ReactElement;
|
|
324
|
+
declare const ModalDropdown: <T extends string | number>({ testID, accessibilityLabel, accessibilityHint, value, options, onChange, variant, renderTrigger, optionTestID, menuMinWidth, showCaret, showHamburger, }: ModalDropdownProps<T>) => React.ReactElement;
|
|
283
325
|
|
|
284
326
|
/**
|
|
285
327
|
* ModalShell — a slide-up full-screen modal with a themed header (title + close button)
|
|
@@ -639,4 +681,4 @@ declare const LAYOUT_I18N: {
|
|
|
639
681
|
readonly copyableIdHint: "common.copyableIdHint";
|
|
640
682
|
};
|
|
641
683
|
|
|
642
|
-
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, COPY_FEEDBACK_MS, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, DEFAULT_BILLING_ROUTE, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, Heading, type HeadingLevel, type HeadingProps, LAYOUT_I18N, LAYOUT_TEST_IDS, ModalDropdown, type ModalDropdownProps, ModalShell, type ModalShellProps, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, StatusBadge, type StatusBadgeProps, type TabDescriptor, Tabs, type TabsProps, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, copyText, formatUrlForDisplay, truncateMiddle, useCopyToClipboard, useFocusTrap };
|
|
684
|
+
export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, COPY_FEEDBACK_MS, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, DEFAULT_BILLING_ROUTE, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, Heading, type HeadingLevel, type HeadingProps, LAYOUT_I18N, LAYOUT_TEST_IDS, ModalDropdown, type ModalDropdownProps, ModalShell, type ModalShellProps, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, StatusBadge, type StatusBadgeProps, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, copyText, formatUrlForDisplay, truncateMiddle, useCopyToClipboard, useFocusTrap };
|
package/dist/index.js
CHANGED
|
@@ -236,6 +236,13 @@ function SegmentedControl({
|
|
|
236
236
|
}
|
|
237
237
|
);
|
|
238
238
|
}
|
|
239
|
+
|
|
240
|
+
// src/Tabs/TabsCollapsedTrigger.ts
|
|
241
|
+
var TabsCollapsedTrigger = /* @__PURE__ */ ((TabsCollapsedTrigger2) => {
|
|
242
|
+
TabsCollapsedTrigger2["Caret"] = "caret";
|
|
243
|
+
TabsCollapsedTrigger2["Hamburger"] = "hamburger";
|
|
244
|
+
return TabsCollapsedTrigger2;
|
|
245
|
+
})(TabsCollapsedTrigger || {});
|
|
239
246
|
var FOCUSABLE_SELECTOR = [
|
|
240
247
|
"a[href]",
|
|
241
248
|
"button:not([disabled])",
|
|
@@ -644,6 +651,8 @@ var MIN_TOUCH_TARGET = 44;
|
|
|
644
651
|
var CARET_FONT_SIZE = 12;
|
|
645
652
|
var CARET_GAP = 8;
|
|
646
653
|
var CARET_GLYPH = "\u25BE";
|
|
654
|
+
var HAMBURGER_GLYPH = "\u2630";
|
|
655
|
+
var HAMBURGER_FONT_SIZE = 18;
|
|
647
656
|
var CARET_OPEN_ROTATION = "180deg";
|
|
648
657
|
var CARET_CLOSED_ROTATION = "0deg";
|
|
649
658
|
var styles7 = reactNative.StyleSheet.create({
|
|
@@ -664,10 +673,20 @@ var styles7 = reactNative.StyleSheet.create({
|
|
|
664
673
|
justifyContent: "space-between",
|
|
665
674
|
columnGap: CARET_GAP
|
|
666
675
|
},
|
|
676
|
+
// Hamburger variant: the ☰ glyph LEADS the label (icon-first, like a phone nav button), so the
|
|
677
|
+
// row packs to the start rather than pushing a trailing caret to the far edge. Same tap target.
|
|
678
|
+
containerHamburger: {
|
|
679
|
+
minHeight: MIN_TOUCH_TARGET,
|
|
680
|
+
flexDirection: "row",
|
|
681
|
+
alignItems: "center",
|
|
682
|
+
justifyContent: "flex-start",
|
|
683
|
+
columnGap: CARET_GAP
|
|
684
|
+
},
|
|
667
685
|
selectedText: { fontSize: BODY_FONT_SIZE2 },
|
|
668
|
-
// The label may shrink/ellipsize; the caret never does.
|
|
686
|
+
// The label may shrink/ellipsize; the caret / hamburger glyph never does.
|
|
669
687
|
selectedTextMenu: { flexShrink: 1 },
|
|
670
688
|
caret: { fontSize: CARET_FONT_SIZE, flexShrink: 0 },
|
|
689
|
+
hamburger: { fontSize: HAMBURGER_FONT_SIZE, flexShrink: 0 },
|
|
671
690
|
modalOverlay: {
|
|
672
691
|
flex: 1,
|
|
673
692
|
justifyContent: "center",
|
|
@@ -692,7 +711,8 @@ var ModalDropdown = ({
|
|
|
692
711
|
renderTrigger,
|
|
693
712
|
optionTestID,
|
|
694
713
|
menuMinWidth,
|
|
695
|
-
showCaret = false
|
|
714
|
+
showCaret = false,
|
|
715
|
+
showHamburger = false
|
|
696
716
|
}) => {
|
|
697
717
|
const { theme, t } = uiFeedback.useUi();
|
|
698
718
|
const { colors } = theme;
|
|
@@ -726,13 +746,19 @@ var ModalDropdown = ({
|
|
|
726
746
|
},
|
|
727
747
|
[onChange]
|
|
728
748
|
);
|
|
749
|
+
const isHamburger = showHamburger;
|
|
750
|
+
const isCaret = showCaret && !isHamburger;
|
|
729
751
|
const containerStyle = React9.useMemo(
|
|
730
752
|
() => renderTrigger !== void 0 ? void 0 : [
|
|
731
753
|
styles7.container,
|
|
732
|
-
|
|
754
|
+
isHamburger ? styles7.containerHamburger : isCaret ? styles7.containerMenu : null,
|
|
733
755
|
{ borderColor: colors.border, backgroundColor: colors.surface }
|
|
734
756
|
],
|
|
735
|
-
[colors.border, colors.surface, renderTrigger,
|
|
757
|
+
[colors.border, colors.surface, renderTrigger, isHamburger, isCaret]
|
|
758
|
+
);
|
|
759
|
+
const hamburgerStyle = React9.useMemo(
|
|
760
|
+
() => [styles7.hamburger, { color: colors.textSecondary }],
|
|
761
|
+
[colors.textSecondary]
|
|
736
762
|
);
|
|
737
763
|
const caretStyle = React9.useMemo(
|
|
738
764
|
() => [
|
|
@@ -768,7 +794,10 @@ var ModalDropdown = ({
|
|
|
768
794
|
const keyExtractor = React9.useCallback((item) => String(item.value), []);
|
|
769
795
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: anchorRef, style: anchorStyle, children: [
|
|
770
796
|
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.TouchableOpacity, { ...a11yProps, style: containerStyle, onPress: handleToggle, children: [
|
|
771
|
-
renderTrigger !== void 0 ? renderTrigger({ label: selectedLabel, isOpen }) :
|
|
797
|
+
renderTrigger !== void 0 ? renderTrigger({ label: selectedLabel, isOpen }) : isHamburger ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
798
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: hamburgerStyle, children: HAMBURGER_GLYPH }),
|
|
799
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [styles7.selectedText, styles7.selectedTextMenu, { color: colors.text }], children: selectedLabel })
|
|
800
|
+
] }) : isCaret ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
772
801
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [styles7.selectedText, styles7.selectedTextMenu, { color: colors.text }], children: selectedLabel }),
|
|
773
802
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: caretStyle, children: CARET_GLYPH })
|
|
774
803
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles7.selectedText, { color: colors.text }], children: selectedLabel }),
|
|
@@ -822,7 +851,8 @@ var TabsMenu = ({
|
|
|
822
851
|
onChange,
|
|
823
852
|
accessibilityLabel,
|
|
824
853
|
idPrefix,
|
|
825
|
-
testID
|
|
854
|
+
testID,
|
|
855
|
+
collapsedTrigger = "caret" /* Caret */
|
|
826
856
|
}) => {
|
|
827
857
|
const { t } = uiFeedback.useUi();
|
|
828
858
|
const options = React9.useMemo(
|
|
@@ -836,6 +866,7 @@ var TabsMenu = ({
|
|
|
836
866
|
},
|
|
837
867
|
[tabs, idPrefix]
|
|
838
868
|
);
|
|
869
|
+
const isHamburger = collapsedTrigger === "hamburger" /* Hamburger */;
|
|
839
870
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
840
871
|
ModalDropdown,
|
|
841
872
|
{
|
|
@@ -843,7 +874,8 @@ var TabsMenu = ({
|
|
|
843
874
|
accessibilityLabel,
|
|
844
875
|
optionTestID,
|
|
845
876
|
options,
|
|
846
|
-
showCaret:
|
|
877
|
+
showCaret: !isHamburger,
|
|
878
|
+
showHamburger: isHamburger,
|
|
847
879
|
testID,
|
|
848
880
|
value: activeKey,
|
|
849
881
|
onChange
|
|
@@ -956,6 +988,7 @@ var Tabs = ({
|
|
|
956
988
|
children,
|
|
957
989
|
idPrefix = "tabs",
|
|
958
990
|
collapseBelow = TABS_COLLAPSE_BREAKPOINT,
|
|
991
|
+
collapsedTrigger = "caret" /* Caret */,
|
|
959
992
|
style,
|
|
960
993
|
stripStyle,
|
|
961
994
|
panelStyle,
|
|
@@ -973,6 +1006,7 @@ var Tabs = ({
|
|
|
973
1006
|
{
|
|
974
1007
|
accessibilityLabel,
|
|
975
1008
|
activeKey,
|
|
1009
|
+
collapsedTrigger,
|
|
976
1010
|
idPrefix,
|
|
977
1011
|
tabs,
|
|
978
1012
|
testID: `${idPrefix}-menu`,
|
|
@@ -1715,6 +1749,7 @@ exports.Section = Section;
|
|
|
1715
1749
|
exports.SegmentedControl = SegmentedControl;
|
|
1716
1750
|
exports.StatusBadge = StatusBadge;
|
|
1717
1751
|
exports.Tabs = Tabs;
|
|
1752
|
+
exports.TabsCollapsedTrigger = TabsCollapsedTrigger;
|
|
1718
1753
|
exports.TruncatedText = TruncatedText;
|
|
1719
1754
|
exports.UpgradePrompt = UpgradePrompt;
|
|
1720
1755
|
exports.copyText = copyText;
|