@avenue-ticketing/native 0.1.13 → 0.1.14

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.
@@ -1,5 +1,5 @@
1
1
  import { SelectItemProps } from './select-item.js';
2
- import { ReactNode, FC } from 'react';
2
+ import { FC, ReactNode } from 'react';
3
3
  import { C as CommonProps, S as SelectItemType } from './select-shared-Ah_SqhzA.js';
4
4
  import { S as SelectSelection, a as SelectSize } from './select-BJtrES5I.js';
5
5
 
@@ -1,4 +1,4 @@
1
- import { createContext, forwardRef, useContext, useState, useMemo, isValidElement, useEffect } from 'react';
1
+ import { createContext, forwardRef, useState, useContext, useMemo, isValidElement, useEffect } from 'react';
2
2
  import { View, TextInput, Pressable, Text, ScrollView } from 'react-native-css/components';
3
3
  import { useNativeVariable } from 'react-native-css';
4
4
  import { CaretDownIcon } from 'phosphor-react-native/src/icons/CaretDown';
package/dist/popover.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReactNode, FC } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  import { a as SelectSize, b as SelectMobileOptions } from './select-BJtrES5I.js';
3
3
 
4
4
  interface PopoverProps {
package/dist/radio.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ReactNode, FC } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
 
3
3
  declare const RADIO_SIZES: readonly ["sm", "md"];
4
4
  type RadioSize = (typeof RADIO_SIZES)[number];
@@ -30,4 +30,4 @@ interface NativeSelectProps {
30
30
  */
31
31
  declare const NativeSelect: FC<NativeSelectProps>;
32
32
 
33
- export { type InputSize as I, NativeSelect as N, type InputType as a, type NativeSelectProps as b, type NativeSelectOption as c };
33
+ export { type InputSize as I, NativeSelect as N, type InputType as a, type NativeSelectOption as b, type NativeSelectProps as c };
@@ -1,2 +1,2 @@
1
- export { N as NativeSelect, c as NativeSelectOption, b as NativeSelectProps } from './select-native-C3ctbnUG.js';
1
+ export { N as NativeSelect, b as NativeSelectOption, c as NativeSelectProps } from './select-native-D6wLBN5N.js';
2
2
  import 'react';
@@ -1,4 +1,4 @@
1
- import { createContext, forwardRef, useContext, useState, useCallback, useEffect } from 'react';
1
+ import { createContext, forwardRef, useState, useContext, useCallback, useEffect } from 'react';
2
2
  import { StyleSheet, Platform, useColorScheme, Modal, View as View$1, Pressable as Pressable$1 } from 'react-native';
3
3
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
4
  import { View, TextInput, Pressable, Text } from 'react-native-css/components';
package/dist/select.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { SelectItemProps } from './select-item.js';
2
2
  import { ComboBoxProps } from './combobox.js';
3
- import { ReactNode, FC } from 'react';
3
+ import { FC, ReactNode } from 'react';
4
4
  import { C as CommonProps, S as SelectItemType } from './select-shared-Ah_SqhzA.js';
5
5
  import 'react-native';
6
6
  import './select-BJtrES5I.js';
package/dist/select.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createContext, forwardRef, useContext, useState, useRef, useMemo, isValidElement, useEffect } from 'react';
1
+ import { createContext, forwardRef, useState, useContext, useRef, useMemo, isValidElement, useEffect } from 'react';
2
2
  import { View, TextInput, Pressable, Text, ScrollView } from 'react-native-css/components';
3
3
  import { useNativeVariable } from 'react-native-css';
4
4
  import { CaretDownIcon } from 'phosphor-react-native/src/icons/CaretDown';
package/dist/tabs.d.ts CHANGED
@@ -33,6 +33,11 @@ declare const TabList: FC<{
33
33
  * Defaults to `true`. Ignored for button types (`button-pill` always travels).
34
34
  */
35
35
  travel?: boolean;
36
+ /**
37
+ * `button-pill` only — inactive tabs use the same border as Button `secondary`
38
+ * (`border-solid border-primary`). Ignored for every other type. Defaults to `false`.
39
+ */
40
+ stroke?: boolean;
36
41
  fullWidth?: boolean;
37
42
  className?: string;
38
43
  items?: TabItemProps[];
@@ -72,6 +77,11 @@ declare const Tabs: FC<{
72
77
  * Defaults to `true`. Ignored for button types (`button-pill` always travels).
73
78
  */
74
79
  travel?: boolean;
80
+ /**
81
+ * `button-pill` only — inactive tabs use the same border as Button `secondary`
82
+ * (`border-solid border-primary`). Ignored for every other type. Defaults to `false`.
83
+ */
84
+ stroke?: boolean;
75
85
  fullWidth?: boolean;
76
86
  className?: string;
77
87
  items?: TabItemProps[];
package/dist/tabs.js CHANGED
@@ -112,8 +112,10 @@ var tabsStyles = {
112
112
  badgeStacked: "absolute top-0 right-0 z-10 -translate-y-1/2 translate-x-1/2"};
113
113
  function tabNativeItemState(type, selected, options = {}) {
114
114
  const travel = options.travel !== false;
115
+ const stroke = options.stroke === true;
115
116
  if (!selected) {
116
117
  if (type === "underline" || type === "line" || type === "line-stacked") return "border-transparent";
118
+ if (type === "button-pill" && stroke) return "rounded-full border border-solid border-primary";
117
119
  return "";
118
120
  }
119
121
  switch (type) {
@@ -126,7 +128,7 @@ function tabNativeItemState(type, selected, options = {}) {
126
128
  case "button-minimal":
127
129
  return "rounded-lg bg-primary_alt border border-primary";
128
130
  case "button-pill":
129
- return "rounded-full";
131
+ return stroke ? "rounded-full border border-solid border-transparent" : "rounded-full";
130
132
  case "underline":
131
133
  return travel ? "rounded-none border-b-2 border-transparent" : "rounded-none border-b-2 border-fg-brand-primary_alt";
132
134
  case "line":
@@ -140,7 +142,8 @@ function tabNativeItemState(type, selected, options = {}) {
140
142
  }
141
143
  function tabNativeLabelState(type, selected) {
142
144
  if (!selected) {
143
- if (type === "button-brand" || type === "button-pill") return "text-secondary";
145
+ if (type === "button-pill") return "text-primary";
146
+ if (type === "button-brand") return "text-secondary";
144
147
  return "text-quaternary";
145
148
  }
146
149
  switch (type) {
@@ -327,6 +330,7 @@ var TabListContext = createContext({
327
330
  type: "button-brand",
328
331
  color: "brand",
329
332
  travel: true,
333
+ stroke: false,
330
334
  orientation: "horizontal"
331
335
  });
332
336
  var TabsRoot = ({ children, selectedKey, defaultSelectedKey, onSelectionChange, orientation = "horizontal", className }) => {
@@ -342,7 +346,17 @@ var TabsRoot = ({ children, selectedKey, defaultSelectedKey, onSelectionChange,
342
346
  );
343
347
  return /* @__PURE__ */ jsx(TabsContext.Provider, { value, children: /* @__PURE__ */ jsx(View, { className: cx(orientation === "vertical" ? tabsStyles.rootVertical : tabsStyles.root, className), children }) });
344
348
  };
345
- var TabList = ({ children, size = "sm", type = "button-brand", color = "brand", travel = true, fullWidth, className, items }) => {
349
+ var TabList = ({
350
+ children,
351
+ size = "sm",
352
+ type = "button-brand",
353
+ color = "brand",
354
+ travel = true,
355
+ stroke = false,
356
+ fullWidth,
357
+ className,
358
+ items
359
+ }) => {
346
360
  const tabs = useContext(TabsContext);
347
361
  const orientation = tabs?.orientation ?? "horizontal";
348
362
  const isPill = type === "button-pill";
@@ -462,6 +476,7 @@ var TabList = ({ children, size = "sm", type = "button-brand", color = "brand",
462
476
  type,
463
477
  color,
464
478
  travel,
479
+ stroke,
465
480
  fullWidth,
466
481
  orientation,
467
482
  registerTravelLayout: useTravelIndicator ? registerTravelLayout : void 0
@@ -472,7 +487,7 @@ var TabList = ({ children, size = "sm", type = "button-brand", color = "brand",
472
487
  };
473
488
  var Tab = ({ id, label, children, badge, icon: Icon }) => {
474
489
  const tabs = useContext(TabsContext);
475
- const { size, type, color, travel, fullWidth, orientation, registerTravelLayout } = useContext(TabListContext);
490
+ const { size, type, color, travel, stroke, fullWidth, orientation, registerTravelLayout } = useContext(TabListContext);
476
491
  const selected = tabs?.selectedKey === id;
477
492
  const isLineChrome = type === "line" || type === "line-stacked";
478
493
  const isStacked = type === "line-stacked";
@@ -480,10 +495,11 @@ var Tab = ({ id, label, children, badge, icon: Icon }) => {
480
495
  const showPill = type === "underline" || isLineChrome || type === "button-brand" || isPill;
481
496
  const fg = useNativeVariable(selected ? "--color-fg-primary" : "--color-fg-quaternary") ?? "#717680";
482
497
  const brand = useNativeVariable("--color-fg-brand-secondary") ?? "#6941c6";
498
+ const fgPrimary = useNativeVariable("--color-fg-primary") ?? "#181d27";
483
499
  const fgQuaternary = useNativeVariable("--color-fg-quaternary") ?? "#717680";
484
500
  const onBrand = useNativeVariable("--color-text-primary_on-brand") ?? "#ffffff";
485
501
  const fgWhite = useNativeVariable("--color-fg-white") ?? "#ffffff";
486
- const iconColor = isPill ? selected ? color === "primary" ? fgWhite : onBrand : fgQuaternary : selected && (type === "underline" || isLineChrome) ? brand : selected ? fg : fgQuaternary;
502
+ const iconColor = isPill ? selected ? color === "primary" ? fgWhite : onBrand : fgPrimary : selected && (type === "underline" || isLineChrome) ? brand : selected ? fg : fgQuaternary;
487
503
  const onLayout = useCallback(
488
504
  (event) => {
489
505
  if (!registerTravelLayout) return;
@@ -512,7 +528,10 @@ var Tab = ({ id, label, children, badge, icon: Icon }) => {
512
528
  isStacked && tabsStyles.itemStacked,
513
529
  fullWidth && orientation === "vertical" && tabsStyles.itemFull,
514
530
  tabSizes[size][type],
515
- tabNativeItemState(type, selected, { travel: isLineTabType(type) ? travel : void 0 })
531
+ tabNativeItemState(type, selected, {
532
+ travel: isLineTabType(type) ? travel : void 0,
533
+ stroke: isPill ? stroke : void 0
534
+ })
516
535
  ),
517
536
  children: [
518
537
  isStacked && isReactComponent(Icon) && /* @__PURE__ */ jsxs(View, { className: tabsStyles.iconStacked, children: [
package/dist/tabs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../core/src/cx.ts","../../core/src/is-react-component.ts","../../core/src/tabs.ts","../../core/src/badge.ts","../../../native/components/base/badges/badges.tsx","../../../native/components/application/tabs/tabs.tsx"],"names":["jsx","View","jsxs","Pressable","Text"],"mappings":";;;;;;;;;;;;AAEA,IAAM,UAAU,mBAAA,CAAoB;AAAA,EAChC,MAAA,EAAQ;AAAA,IACJ,KAAA,EAAO;AAAA,MACH,MAAM,CAAC,YAAA,EAAc,cAAc,YAAA,EAAc,YAAA,EAAc,cAAc,aAAa;AAAA;AAC9F;AAER,CAAC,CAAA;AAGM,IAAM,EAAA,GAAK,OAAA;AAGX,SAAS,OAAsH,OAAA,EAAe;AACjJ,EAAA,OAAO,OAAA;AACX;;;ACXO,IAAM,mB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AA,CAAO,QAAA,EAAU;AAAA,EACxC,IAAA,EAAM,OAAA;AAAA,EACN,IAAA,EAAM,GAAA;AAAA,EACN,KAAA,EAAO;AACX,CAAC;AAID,IAAM,MAAA,GAAS,WAAW,MAAA,CAAO;AAAA,EAC7B,UAAA,EAAY;AAAA,IACR,QAAA,EAAU;AAAA,GACd;AAAA,EACA,aAAA,EAAe;AAAA,IACX,QAAA,EAAU,UAAA;AAAA,IACV,GAAA,EAAK,CAAA;AAAA,IACL,IAAA,EAAM;AAAA;AAEd,CAAC,CAAA","file":"tabs.js","sourcesContent":["import { extendTailwindMerge } from \"tailwind-merge\";\n\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n text: [\"display-xs\", \"display-sm\", \"display-md\", \"display-lg\", \"display-xl\", \"display-2xl\"],\n },\n },\n});\n\n/** Merge Tailwind / NativeWind class strings. */\nexport const cx = twMerge;\n\n/** Identity helper so Tailwind IntelliSense can sort style maps. */\nexport function sortCx<T extends Record<string, string | number | Record<string, string | number | Record<string, string | number>>>>(classes: T): T {\n return classes;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type React from \"react\";\n\ntype ReactComponent = React.FC<any> | React.ComponentClass<any, any>;\n\nexport const isFunctionComponent = (component: any): component is React.FC<any> => {\n return typeof component === \"function\";\n};\n\nexport const isClassComponent = (component: any): component is React.ComponentClass<any, any> => {\n return typeof component === \"function\" && component.prototype && (!!component.prototype.isReactComponent || !!component.prototype.render);\n};\n\nexport const isForwardRefComponent = (component: any): component is React.ForwardRefExoticComponent<any> => {\n return typeof component === \"object\" && component !== null && component.$$typeof.toString() === \"Symbol(react.forward_ref)\";\n};\n\nexport const isReactComponent = (component: any): component is ReactComponent => {\n return isFunctionComponent(component) || isForwardRefComponent(component) || isClassComponent(component);\n};\n","import { cx } from \"./cx\";\n\n//////////////////////////////////////////////// TYPES\n\nexport const TAB_ORIENTATIONS = [\"horizontal\", \"vertical\"] as const;\nexport type TabOrientation = (typeof TAB_ORIENTATIONS)[number];\n\nexport const TAB_SIZES = [\"sm\", \"md\"] as const;\nexport type TabSize = (typeof TAB_SIZES)[number];\n\nexport const HORIZONTAL_TAB_TYPES = [\n \"button-brand\",\n \"button-gray\",\n \"button-border\",\n \"button-minimal\",\n /** Fully rounded pills with a traveling selected background (web). */\n \"button-pill\",\n \"underline\",\n] as const;\n/** `line` = vertical underline (icon + label in a row). `line-stacked` = same chrome, icon above label. */\nexport const VERTICAL_TAB_TYPES = [\"button-brand\", \"button-gray\", \"button-border\", \"button-minimal\", \"line\", \"line-stacked\"] as const;\nexport type HorizontalTabType = (typeof HORIZONTAL_TAB_TYPES)[number];\nexport type VerticalTabType = (typeof VERTICAL_TAB_TYPES)[number];\nexport type TabType = HorizontalTabType | VerticalTabType;\n\n/** Fill color for `button-pill` only — maps to solid indicator + selected label. */\nexport const PILL_TAB_COLORS = [\"brand\", \"primary\"] as const;\nexport type PillTabColor = (typeof PILL_TAB_COLORS)[number];\n\n/** Underline / vertical line types that support a traveling border indicator. */\nexport function isLineTabType(type: TabType): boolean {\n return type === \"underline\" || type === \"line\" || type === \"line-stacked\";\n}\n\nexport interface TabState {\n isFocusVisible?: boolean;\n isSelected?: boolean;\n isHovered?: boolean;\n isPressed?: boolean;\n}\n\nexport interface TabItemStyleOptions {\n /**\n * Traveling underline/line indicator (`underline` / `line` / `line-stacked`).\n * When true, selected chrome is the shared indicator — tabs keep a transparent border only.\n */\n travel?: boolean;\n}\n\n/** Indicator fill + selected label/icon for `button-pill`. */\nexport const pillTabColorStyles: Record<\n PillTabColor,\n { indicator: string; selected: string; nativeSelected: string; nativeLabel: string }\n> = {\n brand: {\n indicator: \"bg-brand-solid\",\n selected: \"text-primary_on-brand *:data-icon:text-primary_on-brand\",\n nativeSelected: \"rounded-full bg-brand-solid\",\n nativeLabel: \"text-primary_on-brand\",\n },\n primary: {\n indicator: \"bg-primary-solid\",\n selected: \"text-fg-white *:data-icon:text-fg-white\",\n nativeSelected: \"rounded-full bg-primary-solid\",\n nativeLabel: \"text-fg-white\",\n },\n};\n\n//////////////////////////////////////////////// WEB STYLES\n// Exact class fragments from `components/application/tabs/tabs.tsx`.\n\nexport function tabItemStyles(\n { isFocusVisible, isSelected, isHovered, isPressed }: TabState,\n options: TabItemStyleOptions = {},\n): Record<TabType, string> {\n const travel = options.travel !== false;\n\n const lineSelectedText =\n (isSelected || isHovered) && \"text-brand-secondary *:data-icon:text-fg-brand-secondary_hover\";\n /** Static mode: border paints on the tab. Travel mode: border stays transparent (indicator moves). */\n const underlineBorder =\n !travel && (isSelected || isHovered) && \"border-fg-brand-primary_alt\";\n const lineBorder = !travel && (isSelected || isHovered) && \"border-fg-brand-primary_alt\";\n\n return {\n \"button-brand\": cx(\n \"outline-focus-ring text-secondary *:data-icon:text-fg-secondary\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n isHovered && !isSelected && \"bg-secondary_hover\",\n isSelected && \"bg-brand-primary text-primary *:data-icon:text-fg-primary\",\n ),\n \"button-gray\": cx(\n \"outline-focus-ring *:data-icon:text-fg-quaternary\",\n isHovered && \"bg-primary_hover text-secondary *:data-icon:text-fg-secondary_hover\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n isSelected && \"bg-primary_hover text-secondary *:data-icon:text-fg-secondary_hover\",\n ),\n \"button-border\": cx(\n \"outline-focus-ring *:data-icon:text-fg-quaternary\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n (isSelected || isHovered) && \"bg-primary_alt text-secondary shadow-sm *:data-icon:text-fg-secondary_hover\",\n ),\n \"button-minimal\": cx(\n \"rounded-lg outline-focus-ring *:data-icon:text-fg-quaternary\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n (isSelected || isHovered) && \"bg-primary_alt text-secondary shadow-xs ring-1 ring-primary ring-inset *:data-icon:text-fg-secondary_hover\",\n ),\n // Selected fill comes from the clip-path indicator — tab stays transparent.\n // Selected label color is applied in Tab via `pillTabColorStyles` + `color` prop.\n // Light press scale via RAC `isPressed` (data-pressed / :active alone often miss on Tab).\n \"button-pill\": cx(\n \"rounded-full outline-focus-ring text-quaternary *:data-icon:text-fg-quaternary\",\n \"touch-manipulation [-webkit-tap-highlight-color:transparent]\",\n \"scale-100 transition-[color,background-color,transform] duration-150 ease-out\",\n \"motion-reduce:transition-[color,background-color]\",\n isPressed && \"scale-[0.98] duration-100 ease-linear motion-reduce:scale-100\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n isHovered && !isSelected && \"bg-primary_hover text-secondary *:data-icon:text-fg-secondary\",\n ),\n underline: cx(\n \"rounded-none border-b-2 border-transparent outline-focus-ring *:data-icon:text-fg-quaternary\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n lineSelectedText,\n underlineBorder,\n ),\n line: cx(\n \"rounded-none border-l-2 border-transparent outline-focus-ring *:data-icon:text-fg-quaternary\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n lineSelectedText,\n lineBorder,\n ),\n \"line-stacked\": cx(\n \"rounded-none border-l-2 border-transparent outline-focus-ring *:data-icon:text-fg-quaternary\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n lineSelectedText,\n lineBorder,\n ),\n };\n}\n\nexport const tabSizes = {\n sm: {\n base: \"text-sm font-semibold gap-1 *:data-icon:size-4\",\n \"button-brand\": \"py-2 px-2.5\",\n \"button-gray\": \"py-2 px-2.5\",\n \"button-border\": \"py-2 px-2.5\",\n \"button-minimal\": \"py-2 px-2.5\",\n // Match legacy Avenue UI pill: h-9 + px-4.\n \"button-pill\": \"h-9 rounded-full px-4 py-0\",\n underline: \"px-0.5 pb-2.5 pt-0\",\n line: \"pl-2.5 pr-3 py-0.5\",\n // Vertical underline + stacked: pl-5 / pr-3, icon size-5.\n \"line-stacked\": \"gap-1.5 py-2 pr-3 pl-5 text-sm font-medium *:data-icon:size-5\",\n icon: 16,\n },\n md: {\n base: \"text-md font-semibold gap-1.5 *:data-icon:size-5\",\n \"button-brand\": \"py-2.5 px-2.5\",\n \"button-gray\": \"py-2.5 px-2.5\",\n \"button-border\": \"py-2.5 px-2.5\",\n \"button-minimal\": \"py-2.5 px-2.5\",\n \"button-pill\": \"h-10 rounded-full px-4 py-0\",\n underline: \"px-0.5 pb-2.5 pt-0\",\n line: \"pr-3.5 pl-3 py-1\",\n \"line-stacked\": \"gap-1.5 py-2 pr-3 pl-5 text-sm font-medium *:data-icon:size-5\",\n icon: 20,\n },\n} as const;\n\nexport function tabListStyles({ size, fullWidth }: { size?: TabSize; fullWidth?: boolean }): Record<TabType, string> {\n return {\n \"button-brand\": \"gap-1\",\n \"button-gray\": \"gap-1\",\n \"button-border\": cx(\"gap-1 rounded-[10px] bg-secondary_alt p-1 ring-1 ring-secondary ring-inset\", size === \"md\" && \"rounded-xl p-1.5\"),\n \"button-minimal\": \"gap-0.5 rounded-lg bg-secondary_alt ring-1 ring-inset ring-secondary\",\n \"button-pill\": \"relative items-center gap-1\",\n underline: cx(\"gap-3\", fullWidth && \"w-full gap-4\"),\n line: \"gap-2\",\n \"line-stacked\": \"gap-1\",\n };\n}\n\nexport const tabWebStyles = {\n root: \"flex w-full flex-col\",\n /** Vertical orientation: rail beside panel (partners sheets). */\n rootVertical: \"flex-row\",\n list: \"group flex\",\n listVertical: \"w-max flex-col\",\n listUnderlineRule: \"relative before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-border-secondary\",\n panel: \"outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2\",\n item: \"z-10 flex h-max cursor-pointer items-center justify-center gap-2 rounded-md whitespace-nowrap text-quaternary transition duration-100 ease-linear\",\n itemVertical: \"group-orientation-vertical:justify-start\",\n /** Vertical underline with icon above label. */\n itemStacked:\n \"flex-col! w-full items-start justify-start gap-1.5 overflow-visible whitespace-normal [&_svg]:size-5 [&_svg]:shrink-0\",\n itemFull: \"w-full flex-1\",\n label: \"flex items-center gap-1.5\",\n labelLine: \"flex items-center gap-1.5\",\n /** Icon slot wrapper for line-stacked. */\n iconStacked:\n \"relative inline-flex size-5 shrink-0 items-center justify-center overflow-visible [&_svg]:size-5 [&_svg]:shrink-0\",\n labelStacked: \"block min-w-0 w-full text-left leading-snug\",\n badge: \"hidden transition-inherit-all md:flex\",\n badgeSm: \"-my-px\",\n /** line-stacked: same Badge as row tabs, anchored to the icon’s top-right corner. */\n badgeStacked: \"absolute top-0 right-0 z-10 -translate-y-1/2 translate-x-1/2\",\n /**\n * Traveling selected fill for `button-pill` — clipped via `--tab-indicator-start/end`\n * (same technique as legacy Avenue UI tabs). Sits under tab labels (`item` is z-10).\n */\n pillIndicator:\n \"pointer-events-none absolute inset-x-0 top-0 z-0 h-9 rounded-full motion-reduce:transition-none motion-safe:transition-[clip-path] motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0,0.55,0.45,1)]\",\n pillIndicatorMd: \"h-10\",\n /** Horizontal clip-path using CSS vars set by TabList (pill — rounded). */\n pillClipPath:\n \"inset(0 calc(100% - var(--tab-indicator-end, 0px)) 0 var(--tab-indicator-start, 0px) round 9999px)\",\n /** Horizontal clip-path for underline bar (no round). */\n lineClipPathHorizontal:\n \"inset(0 calc(100% - var(--tab-indicator-end, 0px)) 0 var(--tab-indicator-start, 0px))\",\n /** Vertical clip-path (line / line-stacked). */\n lineClipPathVertical:\n \"inset(var(--tab-indicator-start, 0px) 0 calc(100% - var(--tab-indicator-end, 0px)) 0)\",\n /**\n * Horizontal underline bar — bottom of the list.\n * Thickness matches tab `border-b-2` (2px). z-[1] so it sits above the hairline rule.\n */\n underlineIndicator:\n \"bg-fg-brand-primary_alt pointer-events-none absolute inset-x-0 bottom-0 z-[1] h-[2px] motion-reduce:transition-none motion-safe:transition-[clip-path] motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0,0.55,0.45,1)]\",\n /**\n * Vertical line bar — left of the list.\n * Thickness matches tab `border-l-2` (2px).\n */\n lineIndicator:\n \"bg-fg-brand-primary_alt pointer-events-none absolute inset-y-0 left-0 z-[1] w-[2px] motion-reduce:transition-none motion-safe:transition-[clip-path] motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0,0.55,0.45,1)]\",\n} as const;\n\n//////////////////////////////////////////////// NATIVE STYLES\n// Selected chrome only. Skips hover, focus ring, and `md:` badge hiding.\n\nexport const tabsStyles = {\n root: \"w-full flex-col\",\n rootVertical: \"w-full flex-row\",\n list: \"flex-row\",\n listVertical: \"flex-col\",\n listUnderlineRule: \"border-b border-secondary\",\n listButtonBorder: \"gap-1 rounded-[10px] border border-secondary bg-secondary_alt p-1\",\n listButtonBorderMd: \"rounded-xl p-1.5\",\n listButtonMinimal: \"gap-0.5 rounded-lg border border-secondary bg-secondary_alt\",\n item: \"flex-row items-center justify-center gap-2 rounded-md\",\n itemVertical: \"justify-start\",\n itemStacked: \"w-full flex-col items-start justify-start gap-1.5 overflow-visible\",\n itemFull: \"flex-1\",\n label: \"font-semibold text-quaternary\",\n labelRow: \"flex-row items-center gap-1.5\",\n labelStacked: \"w-full min-w-0\",\n iconStacked: \"relative size-5 shrink-0 items-center justify-center overflow-visible\",\n badgeStacked: \"absolute top-0 right-0 z-10 -translate-y-1/2 translate-x-1/2\",\n /** Traveling selected fill for native `button-pill` (positioned by Reanimated). */\n pillIndicator: \"absolute top-0 left-0 z-0 rounded-full\",\n /** Native traveling underline / line bar — 2px to match `border-b-2` / `border-l-2`. */\n underlineIndicator: \"absolute bottom-0 left-0 z-[1] h-[2px] bg-fg-brand-primary_alt\",\n lineIndicator: \"absolute top-0 left-0 z-[1] w-[2px] bg-fg-brand-primary_alt\",\n} as const;\n\nexport function tabNativeItemState(\n type: TabType,\n selected: boolean,\n options: TabItemStyleOptions = {},\n) {\n const travel = options.travel !== false;\n\n if (!selected) {\n if (type === \"underline\" || type === \"line\" || type === \"line-stacked\") return \"border-transparent\";\n return \"\";\n }\n switch (type) {\n case \"button-brand\":\n return \"bg-brand-primary\";\n case \"button-gray\":\n return \"bg-primary_hover\";\n case \"button-border\":\n return \"bg-primary_alt\";\n case \"button-minimal\":\n return \"rounded-lg bg-primary_alt border border-primary\";\n case \"button-pill\":\n // Fill comes from the traveling indicator on native — keep the tab transparent.\n return \"rounded-full\";\n case \"underline\":\n return travel\n ? \"rounded-none border-b-2 border-transparent\"\n : \"rounded-none border-b-2 border-fg-brand-primary_alt\";\n case \"line\":\n case \"line-stacked\":\n return travel\n ? \"rounded-none border-l-2 border-transparent\"\n : \"rounded-none border-l-2 border-fg-brand-primary_alt\";\n default: {\n const _exhaustive: never = type;\n return _exhaustive;\n }\n }\n}\n\n/** Text color only. Borders stay on the tab so the label does not draw a second line. */\nexport function tabNativeLabelState(type: TabType, selected: boolean) {\n if (!selected) {\n if (type === \"button-brand\" || type === \"button-pill\") return \"text-secondary\";\n return \"text-quaternary\";\n }\n switch (type) {\n case \"button-brand\":\n return \"text-primary\";\n case \"button-pill\":\n return pillTabColorStyles.brand.nativeLabel;\n case \"button-gray\":\n case \"button-border\":\n case \"button-minimal\":\n return \"text-secondary\";\n case \"underline\":\n case \"line\":\n case \"line-stacked\":\n return \"text-brand-secondary\";\n default: {\n const _exhaustive: never = type;\n return _exhaustive;\n }\n }\n}\n","import type { FC } from \"react\";\nimport { sortCx } from \"./cx\";\n\n//////////////////////////////////////////////// TYPES\n\nexport const BADGE_SIZES = [\"sm\", \"md\", \"lg\"] as const;\nexport type BadgeSize = (typeof BADGE_SIZES)[number];\n\nexport const BADGE_COLORS = [\n \"gray\",\n \"brand\",\n \"error\",\n \"warning\",\n \"success\",\n \"slate\",\n \"sky\",\n \"blue\",\n \"indigo\",\n \"purple\",\n \"pink\",\n \"orange\",\n] as const;\nexport type BadgeColorName = (typeof BADGE_COLORS)[number];\n\nexport const badgeTypes = {\n pillColor: \"pill-color\",\n badgeColor: \"color\",\n badgeModern: \"modern\",\n} as const;\n\nexport type BadgeTypes = (typeof badgeTypes)[keyof typeof badgeTypes];\n\nexport type ExtractColorKeys<T> = T extends { styles: infer C } ? keyof C : never;\nexport type ExtractBadgeKeys<T> = keyof T;\nexport type BadgeTypeToColorMap<T> = {\n [K in ExtractBadgeKeys<T>]: ExtractColorKeys<T[K]>;\n};\n\n/** Icon component contract for badge addons (web Phosphor / native Phosphor). */\nexport type BadgeIconComponent = FC<{\n className?: string;\n weight?: \"thin\" | \"light\" | \"regular\" | \"bold\" | \"fill\" | \"duotone\";\n size?: number;\n color?: string;\n}>;\n\n//////////////////////////////////////////////// SHARED STYLES\n// Visual contract for web + native. Web focus / hover stay in badgeWebStyles.\n\nexport const badgeFilledColors: Record<\n BadgeColorName,\n { root: string; addon: string; addonButton: string }\n> = {\n gray: {\n root: \"bg-utility-neutral-50 text-utility-neutral-700 ring-utility-neutral-200\",\n addon: \"text-utility-neutral-500\",\n addonButton: \"hover:bg-utility-neutral-100 text-utility-neutral-400 hover:text-utility-neutral-500\",\n },\n brand: {\n root: \"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200\",\n addon: \"text-utility-brand-500\",\n addonButton: \"hover:bg-utility-brand-100 text-utility-brand-400 hover:text-utility-brand-500\",\n },\n error: {\n root: \"bg-utility-red-50 text-utility-red-700 ring-utility-red-200\",\n addon: \"text-utility-red-500\",\n addonButton: \"hover:bg-utility-red-100 text-utility-red-400 hover:text-utility-red-500\",\n },\n warning: {\n root: \"bg-utility-yellow-50 text-utility-yellow-700 ring-utility-yellow-200\",\n addon: \"text-utility-yellow-500\",\n addonButton: \"hover:bg-utility-yellow-100 text-utility-yellow-400 hover:text-utility-yellow-500\",\n },\n success: {\n root: \"bg-utility-green-50 text-utility-green-700 ring-utility-green-200\",\n addon: \"text-utility-green-500\",\n addonButton: \"hover:bg-utility-green-100 text-utility-green-400 hover:text-utility-green-500\",\n },\n slate: {\n root: \"bg-utility-slate-50 text-utility-slate-700 ring-utility-slate-200\",\n addon: \"text-utility-slate-500\",\n addonButton: \"hover:bg-utility-slate-100 text-utility-slate-400 hover:text-utility-slate-500\",\n },\n sky: {\n root: \"bg-utility-sky-50 text-utility-sky-700 ring-utility-sky-200\",\n addon: \"text-utility-sky-500\",\n addonButton: \"hover:bg-utility-sky-100 text-utility-sky-400 hover:text-utility-sky-500\",\n },\n blue: {\n root: \"bg-utility-blue-50 text-utility-blue-700 ring-utility-blue-200\",\n addon: \"text-utility-blue-500\",\n addonButton: \"hover:bg-utility-blue-100 text-utility-blue-400 hover:text-utility-blue-500\",\n },\n indigo: {\n root: \"bg-utility-indigo-50 text-utility-indigo-700 ring-utility-indigo-200\",\n addon: \"text-utility-indigo-500\",\n addonButton: \"hover:bg-utility-indigo-100 text-utility-indigo-400 hover:text-utility-indigo-500\",\n },\n purple: {\n root: \"bg-utility-purple-50 text-utility-purple-700 ring-utility-purple-200\",\n addon: \"text-utility-purple-500\",\n addonButton: \"hover:bg-utility-purple-100 text-utility-purple-400 hover:text-utility-purple-500\",\n },\n pink: {\n root: \"bg-utility-pink-50 text-utility-pink-700 ring-utility-pink-200\",\n addon: \"text-utility-pink-500\",\n addonButton: \"hover:bg-utility-pink-100 text-utility-pink-400 hover:text-utility-pink-500\",\n },\n orange: {\n root: \"bg-utility-orange-50 text-utility-orange-700 ring-utility-orange-200\",\n addon: \"text-utility-orange-500\",\n addonButton: \"hover:bg-utility-orange-100 text-utility-orange-400 hover:text-utility-orange-500\",\n },\n};\n\nconst addonOnlyColors = Object.fromEntries(\n Object.entries(badgeFilledColors).map(([key, value]) => [key, { root: \"\", addon: value.addon }]),\n) as Record<BadgeColorName, { root: string; addon: string }>;\n\n/**\n * Shared layout chrome. Avoid bare `flex` (NativeWind). Web shells prepend `flex`.\n */\nexport const badgeWithPillTypes = {\n [badgeTypes.pillColor]: {\n common: \"size-max flex-row items-center whitespace-nowrap rounded-full ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeColor]: {\n common: \"size-max flex-row items-center whitespace-nowrap rounded-md ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeModern]: {\n common:\n \"size-max flex-row items-center whitespace-nowrap rounded-full ring-1 ring-inset shadow-xs\",\n styles: {\n gray: {\n root: \"bg-primary text-secondary ring-primary\",\n addon: \"text-neutral-500\",\n addonButton:\n \"hover:bg-utility-neutral-100 text-utility-neutral-400 hover:text-utility-neutral-500\",\n },\n },\n },\n} as const;\n\nexport const badgeWithBadgeTypes = {\n [badgeTypes.pillColor]: {\n common: \"size-max flex-row items-center whitespace-nowrap rounded-full ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeColor]: {\n common: \"size-max flex-row items-center whitespace-nowrap rounded-md ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeModern]: {\n common:\n \"size-max flex-row items-center whitespace-nowrap rounded-full ring-1 ring-inset bg-primary text-secondary ring-primary shadow-xs\",\n styles: addonOnlyColors,\n },\n} as const;\n\nexport type BadgeColor<T extends BadgeTypes> = BadgeTypeToColorMap<typeof badgeWithPillTypes>[T];\n\nexport const badgeStyles = sortCx({\n pillSizes: {\n sm: \"py-0.5 px-2 text-xs font-semibold\",\n md: \"py-0.5 px-2.5 text-sm font-semibold\",\n lg: \"py-1 px-3 text-sm font-semibold\",\n },\n badgeSizes: {\n sm: \"py-0.5 px-1.5 text-xs font-semibold\",\n md: \"py-0.5 px-2 text-sm font-semibold\",\n lg: \"py-1 px-2.5 text-sm font-semibold\",\n },\n badgeColorSizes: {\n sm: \"py-0.5 px-1.5 text-xs font-semibold\",\n md: \"py-0.5 px-2 text-sm font-semibold\",\n lg: \"py-1 px-2.5 text-sm font-semibold rounded-lg\",\n },\n pillDotSizes: {\n sm: \"gap-1 py-0.5 pl-1.5 pr-2 text-xs font-semibold\",\n md: \"gap-1.5 py-0.5 pl-2 pr-2.5 text-sm font-semibold\",\n lg: \"gap-1.5 py-1 pl-2.5 pr-3 text-sm font-semibold\",\n },\n badgeDotSizes: {\n sm: \"gap-1 py-0.5 px-1.5 text-xs font-semibold\",\n md: \"gap-1.5 py-0.5 px-2 text-sm font-semibold\",\n lg: \"gap-1.5 py-1 px-2.5 text-sm font-semibold\",\n },\n badgeColorDotSizes: {\n sm: \"gap-1 py-0.5 px-1.5 text-xs font-semibold\",\n md: \"gap-1.5 py-0.5 px-2 text-sm font-semibold\",\n lg: \"gap-1.5 py-1 px-2.5 text-sm font-semibold rounded-lg\",\n },\n icon: \"size-3\",\n});\n\n/** Resolve size class map for plain `Badge` / similar. */\nexport function resolveBadgeSizeClass(type: BadgeTypes, size: BadgeSize): string {\n if (type === badgeTypes.pillColor) return badgeStyles.pillSizes[size];\n if (type === badgeTypes.badgeColor) return badgeStyles.badgeColorSizes[size];\n return badgeStyles.badgeSizes[size];\n}\n\nexport function resolveBadgeDotSizeClass(type: BadgeTypes, size: BadgeSize): string {\n if (type === badgeTypes.pillColor) return badgeStyles.pillDotSizes[size];\n if (type === badgeTypes.badgeColor) return badgeStyles.badgeColorDotSizes[size];\n return badgeStyles.badgeDotSizes[size];\n}\n\nexport const badgeIconSizeMaps = {\n [badgeTypes.pillColor]: {\n sm: { trailing: \"gap-0.5 py-0.5 pl-2 pr-1.5 text-xs font-semibold\", leading: \"gap-0.5 py-0.5 pr-2 pl-1.5 text-xs font-semibold\" },\n md: { trailing: \"gap-1 py-0.5 pl-2.5 pr-2 text-sm font-semibold\", leading: \"gap-1 py-0.5 pr-2.5 pl-2 text-sm font-semibold\" },\n lg: { trailing: \"gap-1 py-1 pl-3 pr-2.5 text-sm font-semibold\", leading: \"gap-1 py-1 pr-3 pl-2.5 text-sm font-semibold\" },\n },\n [badgeTypes.badgeColor]: {\n sm: { trailing: \"gap-0.5 py-0.5 pl-2 pr-1.5 text-xs font-semibold\", leading: \"gap-0.5 py-0.5 pr-2 pl-1.5 text-xs font-semibold\" },\n md: { trailing: \"gap-1 py-0.5 pl-2 pr-1.5 text-sm font-semibold\", leading: \"gap-1 py-0.5 pr-2 pl-1.5 text-sm font-semibold\" },\n lg: {\n trailing: \"gap-1 py-1 pl-2.5 pr-2 text-sm font-semibold rounded-lg\",\n leading: \"gap-1 py-1 pr-2.5 pl-2 text-sm font-semibold rounded-lg\",\n },\n },\n [badgeTypes.badgeModern]: {\n sm: { trailing: \"gap-0.5 py-0.5 pl-2 pr-1.5 text-xs font-semibold\", leading: \"gap-0.5 py-0.5 pr-2 pl-1.5 text-xs font-semibold\" },\n md: { trailing: \"gap-1 py-0.5 pl-2 pr-1.5 text-sm font-semibold\", leading: \"gap-1 py-0.5 pr-2 pl-1.5 text-sm font-semibold\" },\n lg: { trailing: \"gap-1 py-1 pl-2.5 pr-2 text-sm font-semibold\", leading: \"gap-1 py-1 pr-2.5 pl-2 text-sm font-semibold\" },\n },\n} as const;\n\nexport const badgeOnlyIconSizeMaps = {\n [badgeTypes.pillColor]: { sm: \"p-1.25\", md: \"p-1.5\", lg: \"p-2\" },\n [badgeTypes.badgeColor]: { sm: \"p-1.25\", md: \"p-1.5\", lg: \"p-2 rounded-lg\" },\n [badgeTypes.badgeModern]: { sm: \"p-1.25\", md: \"p-1.5\", lg: \"p-2\" },\n} as const;\n\nexport const badgeWithButtonSizeMaps = {\n [badgeTypes.pillColor]: {\n sm: \"gap-0.5 py-0.5 pl-2 pr-0.75 text-xs font-semibold\",\n md: \"gap-0.5 py-0.5 pl-2.5 pr-1 text-sm font-semibold\",\n lg: \"gap-0.5 py-1 pl-3 pr-1.5 text-sm font-semibold\",\n },\n [badgeTypes.badgeColor]: {\n sm: \"gap-0.5 py-0.5 pl-1.5 pr-0.75 text-xs font-semibold\",\n md: \"gap-0.5 py-0.5 pl-2 pr-1 text-sm font-semibold\",\n lg: \"gap-0.5 py-1 pl-2.5 pr-1.5 text-sm font-semibold rounded-lg\",\n },\n [badgeTypes.badgeModern]: {\n sm: \"gap-0.5 py-0.5 pl-1.5 pr-0.75 text-xs font-semibold\",\n md: \"gap-0.5 py-0.5 pl-2 pr-1 text-sm font-semibold\",\n lg: \"gap-0.5 py-1 pl-2.5 pr-1.5 text-sm font-semibold\",\n },\n} as const;\n\nexport const badgeWithMediaSizeMaps = {\n [badgeTypes.pillColor]: {\n sm: \"gap-1 py-0.5 pl-0.75 pr-2 text-xs font-semibold\",\n md: \"gap-1.5 py-0.5 pl-1 pr-2.5 text-sm font-semibold\",\n lg: \"gap-1.5 py-1 pl-1.5 pr-3 text-sm font-semibold\",\n },\n [badgeTypes.badgeColor]: {\n sm: \"gap-1 py-0.5 pl-1 pr-1.5 text-xs font-semibold\",\n md: \"gap-1.5 py-0.5 pl-1.5 pr-2 text-sm font-semibold\",\n lg: \"gap-1.5 py-1 pl-2 pr-2.5 text-sm font-semibold rounded-lg\",\n },\n [badgeTypes.badgeModern]: {\n sm: \"gap-1 py-0.5 pl-1 pr-1.5 text-xs font-semibold\",\n md: \"gap-1.5 py-0.5 pl-1.5 pr-2 text-sm font-semibold\",\n lg: \"gap-1.5 py-1 pl-2 pr-2.5 text-sm font-semibold\",\n },\n} as const;\n\n//////////////////////////////////////////////// WEB-ONLY STYLES\n\n/** Plain focus — dismiss button on BadgeWithButton. */\nexport const badgeWebFocusShadowPlain =\n \"focus-visible:outline-none focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]\";\n\n/** Web needs `display:flex`; shared maps use `flex-row` for NativeWind. */\nexport const badgeWebDisplayFlex = \"flex\";\n\n/**\n * Exact `common` strings from web `badges.tsx` (`flex`, not `flex-row`).\n * Size / color maps are shared (`badgeStyles`, `badgeFilledColors`, …).\n */\nexport const badgeWebWithPillTypes = {\n [badgeTypes.pillColor]: {\n common: \"size-max flex items-center whitespace-nowrap rounded-full ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeColor]: {\n common: \"size-max flex items-center whitespace-nowrap rounded-md ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeModern]: {\n common: \"size-max flex items-center whitespace-nowrap rounded-full ring-1 ring-inset shadow-xs\",\n styles: {\n gray: {\n root: \"bg-primary text-secondary ring-primary\",\n addon: \"text-neutral-500\",\n addonButton: \"hover:bg-utility-neutral-100 text-utility-neutral-400 hover:text-utility-neutral-500\",\n },\n },\n },\n} as const;\n\nexport const badgeWebWithBadgeTypes = {\n [badgeTypes.pillColor]: {\n common: \"size-max flex items-center whitespace-nowrap rounded-full ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeColor]: {\n common: \"size-max flex items-center whitespace-nowrap rounded-md ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeModern]: {\n common: \"size-max flex items-center whitespace-nowrap rounded-full ring-1 ring-inset bg-primary text-secondary ring-primary shadow-xs\",\n styles: addonOnlyColors,\n },\n} as const;\n\nexport const badgeWebButton =\n \"flex cursor-pointer items-center justify-center p-0.5 transition duration-100 ease-linear\";\nexport const badgeWebFlagImage = \"size-4 max-w-none rounded-full\";\n\n/** Typography for native `<Text>` label (size maps put these on the chrome). */\nexport const badgeLabelTextSizes: Record<BadgeSize, string> = {\n sm: \"text-xs font-semibold\",\n md: \"text-sm font-semibold\",\n lg: \"text-sm font-semibold\",\n};\n","import type { FC, ReactNode } from \"react\";\nimport { Image } from \"react-native\";\nimport { Pressable, Text, View } from \"react-native-css/components\";\nimport Svg, { Circle } from \"react-native-svg\";\nimport { XIcon } from \"phosphor-react-native/src/icons/X\";\nimport {\n BADGE_COLORS,\n BADGE_SIZES,\n badgeFilledColors,\n badgeIconSizeMaps,\n badgeLabelTextSizes,\n badgeOnlyIconSizeMaps,\n badgeStyles,\n badgeTypes,\n badgeWithBadgeTypes,\n badgeWithButtonSizeMaps,\n badgeWithMediaSizeMaps,\n badgeWithPillTypes,\n resolveBadgeDotSizeClass,\n resolveBadgeSizeClass,\n type BadgeColor,\n type BadgeColorName,\n type BadgeIconComponent,\n type BadgeSize,\n type BadgeTypeToColorMap,\n type BadgeTypes,\n} from \"@avenue-ticketing/core/badge\";\nimport { cx } from \"@avenue-ticketing/core/cx\";\nimport { styled } from \"nativewind\";\n\nexport type {\n BadgeColor,\n BadgeColorName,\n BadgeIconComponent,\n BadgeSize,\n BadgeTypes,\n};\n\nexport { BADGE_COLORS, BADGE_SIZES, badgeTypes, badgeFilledColors as filledColors };\n\n//////////////////////////////////////////////// TYPES\n\nexport interface BadgeProps<T extends BadgeTypes = BadgeTypes> {\n type?: T;\n size?: BadgeSize;\n color?: BadgeColor<T>;\n children: ReactNode;\n className?: string;\n}\n\nexport interface BadgeWithDotProps<T extends BadgeTypes = BadgeTypes> {\n type?: T;\n size?: BadgeSize;\n color?: BadgeTypeToColorMap<typeof badgeWithBadgeTypes>[T];\n className?: string;\n children: ReactNode;\n}\n\nexport interface BadgeWithIconProps<T extends BadgeTypes = BadgeTypes> {\n type?: T;\n size?: BadgeSize;\n color?: BadgeTypeToColorMap<typeof badgeWithBadgeTypes>[T];\n iconLeading?: BadgeIconComponent;\n iconTrailing?: BadgeIconComponent;\n children: ReactNode;\n className?: string;\n}\n\nexport interface BadgeWithImageProps<T extends BadgeTypes = BadgeTypes> {\n type?: T;\n size?: BadgeSize;\n imgSrc: string;\n color?: BadgeTypeToColorMap<typeof badgeWithPillTypes>[T];\n children: ReactNode;\n className?: string;\n}\n\nexport interface BadgeWithButtonProps<T extends BadgeTypes = BadgeTypes> {\n type?: T;\n size?: BadgeSize;\n icon?: BadgeIconComponent;\n color?: BadgeTypeToColorMap<typeof badgeWithPillTypes>[T];\n children: ReactNode;\n buttonLabel?: string;\n onButtonPress?: () => void;\n className?: string;\n}\n\nexport interface BadgeIconProps<T extends BadgeTypes = BadgeTypes> {\n type?: T;\n size?: BadgeSize;\n icon: BadgeIconComponent;\n color?: BadgeTypeToColorMap<typeof badgeWithPillTypes>[T];\n className?: string;\n}\n\n//////////////////////////////////////////////// HELPERS\n\n/** Lets Tailwind `text-*` set SVG `color` so `fill=\"currentColor\"` matches web. */\nconst StyledSvg = styled(Svg);\n\nconst BadgeDot: FC<{ className?: string }> = ({ className }) => {\n return (\n <StyledSvg width={8} height={8} viewBox=\"0 0 8 8\" className={className}>\n <Circle cx={4} cy={4} r={2.5} fill=\"currentColor\" stroke=\"currentColor\" />\n </StyledSvg>\n );\n};\n\nconst BadgeLabel: FC<{ size: BadgeSize; colorClass: string; children: ReactNode }> = ({\n size,\n colorClass,\n children,\n}) => {\n if (typeof children === \"string\" || typeof children === \"number\") {\n return <Text className={cx(badgeLabelTextSizes[size], colorClass)}>{children}</Text>;\n }\n return <>{children}</>;\n};\n\n//////////////////////////////////////////////// MAIN\n\n/**\n * NativeWind badge — shared Tailwind class maps from `@avenue-ticketing/core/badge`.\n */\nexport const Badge = <T extends BadgeTypes>({\n type = \"pill-color\" as T,\n size = \"md\",\n color = \"gray\" as BadgeColor<T>,\n children,\n className,\n}: BadgeProps<T>) => {\n const colors = badgeWithPillTypes[type];\n const colorRoot = colors.styles[color as keyof typeof colors.styles].root;\n\n return (\n <View className={cx(colors.common, resolveBadgeSizeClass(type, size), colorRoot, className)}>\n <BadgeLabel size={size} colorClass={colorRoot}>\n {children}\n </BadgeLabel>\n </View>\n );\n};\n\nexport const BadgeWithDot = <T extends BadgeTypes>({\n size = \"md\",\n color = \"gray\" as BadgeTypeToColorMap<typeof badgeWithBadgeTypes>[T],\n type = \"pill-color\" as T,\n className,\n children,\n}: BadgeWithDotProps<T>) => {\n const colors = badgeWithBadgeTypes[type];\n const style = colors.styles[color as keyof typeof colors.styles];\n\n return (\n <View className={cx(colors.common, resolveBadgeDotSizeClass(type, size), style.root, className)}>\n <BadgeDot className={style.addon} />\n <BadgeLabel size={size} colorClass={style.root}>\n {children}\n </BadgeLabel>\n </View>\n );\n};\n\nexport const BadgeWithIcon = <T extends BadgeTypes>({\n size = \"md\",\n color = \"gray\" as BadgeTypeToColorMap<typeof badgeWithBadgeTypes>[T],\n type = \"pill-color\" as T,\n iconLeading: IconLeading,\n iconTrailing: IconTrailing,\n children,\n className,\n}: BadgeWithIconProps<T>) => {\n const colors = badgeWithBadgeTypes[type];\n const style = colors.styles[color as keyof typeof colors.styles];\n const icon = IconLeading ? \"leading\" : \"trailing\";\n\n return (\n <View className={cx(colors.common, badgeIconSizeMaps[type][size][icon], style.root, className)}>\n {IconLeading && <IconLeading weight=\"bold\" className={cx(style.addon, badgeStyles.icon)} size={12} />}\n <BadgeLabel size={size} colorClass={style.root}>\n {children}\n </BadgeLabel>\n {IconTrailing && <IconTrailing weight=\"bold\" className={cx(style.addon, badgeStyles.icon)} size={12} />}\n </View>\n );\n};\n\nexport const BadgeWithImage = <T extends BadgeTypes>({\n size = \"md\",\n color = \"gray\" as BadgeTypeToColorMap<typeof badgeWithPillTypes>[T],\n type = \"pill-color\" as T,\n imgSrc,\n children,\n className,\n}: BadgeWithImageProps<T>) => {\n const colors = badgeWithPillTypes[type];\n const colorRoot = colors.styles[color as keyof typeof colors.styles].root;\n\n return (\n <View className={cx(colors.common, badgeWithMediaSizeMaps[type][size], colorRoot, className)}>\n <Image\n source={{ uri: imgSrc }}\n accessibilityLabel=\"Badge image\"\n style={{ width: 16, height: 16, borderRadius: 999 }}\n />\n <BadgeLabel size={size} colorClass={colorRoot}>\n {children}\n </BadgeLabel>\n </View>\n );\n};\n\nexport const BadgeWithButton = <T extends BadgeTypes>({\n size = \"md\",\n color = \"gray\" as BadgeTypeToColorMap<typeof badgeWithPillTypes>[T],\n type = \"pill-color\" as T,\n icon: Icon = XIcon,\n buttonLabel,\n children,\n onButtonPress,\n className,\n}: BadgeWithButtonProps<T>) => {\n const colors = badgeWithPillTypes[type];\n const style = colors.styles[color as keyof typeof colors.styles];\n\n return (\n <View className={cx(colors.common, badgeWithButtonSizeMaps[type][size], style.root, className)}>\n <BadgeLabel size={size} colorClass={style.root}>\n {children}\n </BadgeLabel>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={buttonLabel}\n onPress={onButtonPress}\n className={cx(\n \"items-center justify-center p-0.5\",\n style.addonButton,\n type === badgeTypes.pillColor || type === badgeTypes.badgeModern ? \"rounded-full\" : \"rounded-[3px]\",\n )}\n >\n <Icon weight=\"bold\" className={badgeStyles.icon} size={12} />\n </Pressable>\n </View>\n );\n};\n\nexport const BadgeIcon = <T extends BadgeTypes>({\n size = \"md\",\n color = \"gray\" as BadgeTypeToColorMap<typeof badgeWithPillTypes>[T],\n type = \"pill-color\" as T,\n icon: Icon,\n className,\n}: BadgeIconProps<T>) => {\n const colors = badgeWithPillTypes[type];\n const style = colors.styles[color as keyof typeof colors.styles];\n\n return (\n <View className={cx(colors.common, badgeOnlyIconSizeMaps[type][size], style.root, className)}>\n <Icon weight=\"bold\" className={cx(badgeStyles.icon, style.addon)} size={12} />\n </View>\n );\n};\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type FC,\n type ReactNode,\n} from \"react\";\nimport { ScrollView, StyleSheet, type LayoutChangeEvent } from \"react-native\";\nimport { Pressable, Text, View } from \"react-native-css/components\";\nimport { useNativeVariable } from \"react-native-css\";\nimport Animated, { Easing, useAnimatedStyle, useSharedValue, withTiming } from \"react-native-reanimated\";\nimport { cx } from \"@avenue-ticketing/core/cx\";\nimport { isReactComponent } from \"@avenue-ticketing/core/is-react-component\";\nimport {\n isLineTabType,\n pillTabColorStyles,\n tabListStyles,\n tabNativeItemState,\n tabNativeLabelState,\n tabSizes,\n tabsStyles,\n type PillTabColor,\n type TabOrientation,\n type TabSize,\n type TabType,\n} from \"@avenue-ticketing/core/tabs\";\nimport { Badge } from \"../../base/badges/badges\";\n\nexport type { PillTabColor, TabOrientation, TabSize, TabType };\n\n//////////////////////////////////////////////// SETUP\n\n/** Same easing as web / legacy Avenue UI pill clip-path. */\nconst PILL_EASE = Easing.bezier(0, 0.55, 0.45, 1);\nconst PILL_MS = 300;\n\ntype TabLayout = { x: number; y: number; width: number; height: number };\n\n//////////////////////////////////////////////// CONTEXT\n\ntype TabsContextValue = {\n selectedKey: string | undefined;\n setSelectedKey: (key: string) => void;\n orientation: TabOrientation;\n};\n\nconst TabsContext = createContext<TabsContextValue | undefined>(undefined);\n\ntype TabListContextValue = {\n size: TabSize;\n type: TabType;\n color: PillTabColor;\n travel: boolean;\n fullWidth?: boolean;\n orientation: TabOrientation;\n registerTravelLayout?: (id: string, layout: TabLayout) => void;\n};\n\nconst TabListContext = createContext<TabListContextValue>({\n size: \"sm\",\n type: \"button-brand\",\n color: \"brand\",\n travel: true,\n orientation: \"horizontal\",\n});\n\n//////////////////////////////////////////////// MAIN\n\nexport const TabsRoot: FC<{\n children?: ReactNode;\n selectedKey?: string;\n defaultSelectedKey?: string;\n onSelectionChange?: (key: string) => void;\n orientation?: TabOrientation;\n className?: string;\n}> = ({ children, selectedKey, defaultSelectedKey, onSelectionChange, orientation = \"horizontal\", className }) => {\n const [internal, setInternal] = useState(defaultSelectedKey);\n const current = selectedKey ?? internal;\n const setSelectedKey = (key: string) => {\n if (selectedKey === undefined) setInternal(key);\n onSelectionChange?.(key);\n };\n const value = useMemo(\n () => ({ selectedKey: current, setSelectedKey, orientation }),\n [current, orientation],\n );\n\n return (\n <TabsContext.Provider value={value}>\n <View className={cx(orientation === \"vertical\" ? tabsStyles.rootVertical : tabsStyles.root, className)}>{children}</View>\n </TabsContext.Provider>\n );\n};\n\nexport const TabList: FC<{\n children?: ReactNode;\n size?: TabSize;\n type?: TabType;\n /** `button-pill` only — indicator fill. Ignored for other types. */\n color?: PillTabColor;\n /**\n * Traveling underline / line border for `underline`, `line`, and `line-stacked`.\n * Defaults to `true`. Ignored for button types (`button-pill` always travels).\n */\n travel?: boolean;\n fullWidth?: boolean;\n className?: string;\n items?: TabItemProps[];\n}> = ({ children, size = \"sm\", type = \"button-brand\", color = \"brand\", travel = true, fullWidth, className, items }) => {\n const tabs = useContext(TabsContext);\n const orientation = tabs?.orientation ?? \"horizontal\";\n const isPill = type === \"button-pill\";\n const isLine = isLineTabType(type);\n const isVerticalLine = type === \"line\" || type === \"line-stacked\";\n const useTravelIndicator = isPill || (isLine && travel);\n const selectedKey = tabs?.selectedKey;\n\n const brandSolid = useNativeVariable(\"--color-bg-brand-solid\") ?? \"#7c3aed\";\n const primarySolid = useNativeVariable(\"--color-bg-primary-solid\") ?? \"#171717\";\n const brandLine = useNativeVariable(\"--color-fg-brand-primary_alt\") ?? \"#9e77ed\";\n\n const layoutsRef = useRef<Map<string, TabLayout>>(new Map());\n const hasPlacedRef = useRef(false);\n\n const indicatorX = useSharedValue(0);\n const indicatorY = useSharedValue(0);\n const indicatorW = useSharedValue(0);\n const indicatorH = useSharedValue(0);\n const indicatorOpacity = useSharedValue(0);\n\n const moveIndicator = useCallback(\n (key: string | undefined, animate: boolean) => {\n if (!key) return;\n const layout = layoutsRef.current.get(key);\n if (!layout || layout.width <= 0 || layout.height <= 0) return;\n\n const cfg = { duration: PILL_MS, easing: PILL_EASE };\n\n let nextX = layout.x;\n let nextY = layout.y;\n let nextW = layout.width;\n let nextH = layout.height;\n\n if (isLine && !isPill) {\n if (isVerticalLine) {\n nextX = layout.x;\n nextY = layout.y;\n nextW = 2;\n nextH = layout.height;\n } else {\n nextX = layout.x;\n nextY = layout.y + Math.max(layout.height - 2, 0);\n nextW = layout.width;\n nextH = 2;\n }\n }\n\n if (animate && hasPlacedRef.current) {\n indicatorX.value = withTiming(nextX, cfg);\n indicatorY.value = withTiming(nextY, cfg);\n indicatorW.value = withTiming(nextW, cfg);\n indicatorH.value = withTiming(nextH, cfg);\n } else {\n indicatorX.value = nextX;\n indicatorY.value = nextY;\n indicatorW.value = nextW;\n indicatorH.value = nextH;\n hasPlacedRef.current = true;\n }\n indicatorOpacity.value = 1;\n },\n [indicatorH, indicatorOpacity, indicatorW, indicatorX, indicatorY, isLine, isPill, isVerticalLine],\n );\n\n const registerTravelLayout = useCallback(\n (id: string, layout: TabLayout) => {\n layoutsRef.current.set(id, layout);\n if (id === selectedKey) {\n moveIndicator(id, hasPlacedRef.current);\n }\n },\n [moveIndicator, selectedKey],\n );\n\n useEffect(() => {\n if (!useTravelIndicator) return;\n moveIndicator(selectedKey, true);\n }, [useTravelIndicator, selectedKey, moveIndicator]);\n\n // Plain Animated.View + inline absolute — NativeWind `styled(Animated.View)` drops\n // `position: absolute`, so the indicator joined the flex row and never traveled.\n const indicatorStyle = useAnimatedStyle(() => ({\n opacity: indicatorOpacity.value,\n width: indicatorW.value,\n height: indicatorH.value,\n transform: [{ translateX: indicatorX.value }, { translateY: indicatorY.value }],\n }));\n\n const indicatorColor = isPill\n ? color === \"primary\"\n ? primarySolid\n : brandSolid\n : brandLine;\n\n const travelIndicator = useTravelIndicator ? (\n <Animated.View\n pointerEvents=\"none\"\n style={[\n styles.indicatorBase,\n {\n backgroundColor: indicatorColor,\n borderRadius: isPill ? 9999 : 0,\n zIndex: isPill ? 0 : 1,\n },\n indicatorStyle,\n ]}\n />\n ) : null;\n\n const list = (\n <View\n className={cx(\n orientation === \"vertical\" ? tabsStyles.listVertical : tabsStyles.list,\n type === \"button-border\"\n ? cx(tabsStyles.listButtonBorder, size === \"md\" && tabsStyles.listButtonBorderMd)\n : type === \"button-minimal\"\n ? tabsStyles.listButtonMinimal\n : tabListStyles({ size, fullWidth })[type],\n orientation === \"horizontal\" && type === \"underline\" && \"relative\",\n useTravelIndicator && \"relative\",\n fullWidth && \"w-full\",\n className,\n )}\n style={useTravelIndicator ? styles.listTravel : undefined}\n >\n {orientation === \"horizontal\" && type === \"underline\" && (\n <View className=\"absolute right-0 bottom-0 left-0 h-px bg-border-secondary\" />\n )}\n {isPill && travelIndicator}\n {children ?? items?.map((item) => <Tab key={item.id} {...item} />)}\n {!isPill && travelIndicator}\n </View>\n );\n\n return (\n <TabListContext.Provider\n value={{\n size,\n type,\n color,\n travel,\n fullWidth,\n orientation,\n registerTravelLayout: useTravelIndicator ? registerTravelLayout : undefined,\n }}\n >\n {orientation === \"horizontal\" ? (\n <ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerClassName={fullWidth ? \"grow\" : undefined}>\n {list}\n </ScrollView>\n ) : (\n list\n )}\n </TabListContext.Provider>\n );\n};\n\nexport interface TabItemProps {\n id: string;\n label?: ReactNode;\n children?: ReactNode;\n badge?: number | string;\n icon?: FC<{ size?: number; color?: string }> | ReactNode;\n}\n\nexport const Tab: FC<TabItemProps> = ({ id, label, children, badge, icon: Icon }) => {\n const tabs = useContext(TabsContext);\n const { size, type, color, travel, fullWidth, orientation, registerTravelLayout } = useContext(TabListContext);\n const selected = tabs?.selectedKey === id;\n const isLineChrome = type === \"line\" || type === \"line-stacked\";\n const isStacked = type === \"line-stacked\";\n const isPill = type === \"button-pill\";\n const showPill = type === \"underline\" || isLineChrome || type === \"button-brand\" || isPill;\n const fg = useNativeVariable(selected ? \"--color-fg-primary\" : \"--color-fg-quaternary\") ?? \"#717680\";\n const brand = useNativeVariable(\"--color-fg-brand-secondary\") ?? \"#6941c6\";\n const fgQuaternary = useNativeVariable(\"--color-fg-quaternary\") ?? \"#717680\";\n const onBrand = useNativeVariable(\"--color-text-primary_on-brand\") ?? \"#ffffff\";\n const fgWhite = useNativeVariable(\"--color-fg-white\") ?? \"#ffffff\";\n\n const iconColor = isPill\n ? selected\n ? color === \"primary\"\n ? fgWhite\n : onBrand\n : fgQuaternary\n : selected && (type === \"underline\" || isLineChrome)\n ? brand\n : selected\n ? fg\n : fgQuaternary;\n\n const onLayout = useCallback(\n (event: LayoutChangeEvent) => {\n if (!registerTravelLayout) return;\n const { x, y, width, height } = event.nativeEvent.layout;\n if (width <= 0 || height <= 0) return;\n registerTravelLayout(id, { x, y, width, height });\n },\n [id, registerTravelLayout],\n );\n\n return (\n <Pressable\n accessibilityRole=\"tab\"\n accessibilityState={{ selected }}\n onPress={() => tabs?.setSelectedKey(id)}\n onLayout={onLayout}\n style={({ pressed }) => [\n orientation === \"horizontal\" ? { flexShrink: 0, zIndex: 1 } : { zIndex: 1 },\n isPill && {\n transform: [{ scale: pressed ? 0.98 : 1 }],\n },\n ]}\n className={cx(\n tabsStyles.item,\n orientation === \"vertical\" && tabsStyles.itemVertical,\n isStacked && tabsStyles.itemStacked,\n fullWidth && orientation === \"vertical\" && tabsStyles.itemFull,\n tabSizes[size][type],\n tabNativeItemState(type, selected, { travel: isLineTabType(type) ? travel : undefined }),\n )}\n >\n {isStacked && isReactComponent(Icon) && (\n <View className={tabsStyles.iconStacked}>\n <Icon size={20} color={iconColor} />\n {badge != null && (\n <View className={tabsStyles.badgeStacked}>\n <Badge size=\"sm\" type={showPill ? \"pill-color\" : \"modern\"} color={showPill && selected ? \"brand\" : \"gray\"}>\n {badge}\n </Badge>\n </View>\n )}\n </View>\n )}\n {!isStacked && isReactComponent(Icon) && <Icon size={tabSizes[size].icon} color={iconColor} />}\n <View className={cx(isStacked ? tabsStyles.labelStacked : tabsStyles.labelRow, !isLineChrome && type !== \"underline\" && \"px-0.5\")}>\n <Text\n numberOfLines={isStacked ? 2 : 1}\n className={cx(\n isStacked ? \"text-sm font-medium\" : size === \"sm\" ? \"text-sm font-semibold\" : \"text-md font-semibold\",\n isStacked && \"text-left\",\n isPill && selected\n ? pillTabColorStyles[color].nativeLabel\n : tabNativeLabelState(type, selected),\n )}\n >\n {children || label}\n </Text>\n {!isStacked && badge != null && (\n <Badge size=\"sm\" type={showPill ? \"pill-color\" : \"modern\"} color={showPill && selected ? \"brand\" : \"gray\"}>\n {badge}\n </Badge>\n )}\n </View>\n </Pressable>\n );\n};\n\nexport const TabPanel: FC<{ id: string; children?: ReactNode; className?: string }> = ({ id, children, className }) => {\n const tabs = useContext(TabsContext);\n if (tabs?.selectedKey !== id) return null;\n return <View className={className}>{children}</View>;\n};\n\nexport const Tabs = Object.assign(TabsRoot, {\n List: TabList,\n Item: Tab,\n Panel: TabPanel,\n});\n\n//////////////////////////////////////////////// STYLES\n\nconst styles = StyleSheet.create({\n listTravel: {\n overflow: \"visible\",\n },\n indicatorBase: {\n position: \"absolute\",\n top: 0,\n left: 0,\n },\n});\n"]}
1
+ {"version":3,"sources":["../../core/src/cx.ts","../../core/src/is-react-component.ts","../../core/src/tabs.ts","../../core/src/badge.ts","../../../native/components/base/badges/badges.tsx","../../../native/components/application/tabs/tabs.tsx"],"names":["jsx","View","jsxs","Pressable","Text"],"mappings":";;;;;;;;;;;;AAEA,IAAM,UAAU,mBAAA,CAAoB;AAAA,EAChC,MAAA,EAAQ;AAAA,IACJ,KA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,GAC1B,mBAAA,CAAoB,MAAM,QAAQ;AAAA,eAC5C;AAAA,cAEC,QAAA,EAAA,QAAA,IAAY;AAAA;AAAA,WACjB;AAAA,UACC,CAAC,SAAA,IAAa,KAAA,IAAS,wBACpBJ,GAAAA,CAAC,SAAM,IAAA,EAAK,IAAA,EAAK,IAAA,EAAM,QAAA,GAAW,eAAe,QAAA,EAAU,KAAA,EAAO,YAAY,QAAA,GAAW,OAAA,GAAU,QAC9F,QAAA,EAAA,KAAA,EACL;AAAA,SAAA,EAER;AAAA;AAAA;AAAA,GACJ;AAER;AAEO,IAAM,WAAyE,CAAC,EAAE,EAAA,EAAI,QAAA,EAAU,WAAU,KAAM;AACnH,EAAA,MAAM,IAAA,GAAO,WAAW,WAAW,CAAA;AACnC,EAAA,IAAI,IAAA,EAAM,WAAA,KAAgB,EAAA,EAAI,OAAO,IAAA;AACrC,EAAA,uBAAOA,GAAAA,CAACC,IAAAA,EAAA,EAAK,WAAuB,QAAA,EAAS,CAAA;AACjD;AAEO,IAAM,IAAA,GAAO,MAAA,CAAO,MAAA,CAAO,QAAA,EAAU;AAAA,EACxC,IAAA,EAAM,OAAA;AAAA,EACN,IAAA,EAAM,GAAA;AAAA,EACN,KAAA,EAAO;AACX,CAAC;AAID,IAAM,MAAA,GAAS,WAAW,MAAA,CAAO;AAAA,EAC7B,UAAA,EAAY;AAAA,IACR,QAAA,EAAU;AAAA,GACd;AAAA,EACA,aAAA,EAAe;AAAA,IACX,QAAA,EAAU,UAAA;AAAA,IACV,GAAA,EAAK,CAAA;AAAA,IACL,IAAA,EAAM;AAAA;AAEd,CAAC,CAAA","file":"tabs.js","sourcesContent":["import { extendTailwindMerge } from \"tailwind-merge\";\n\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n text: [\"display-xs\", \"display-sm\", \"display-md\", \"display-lg\", \"display-xl\", \"display-2xl\"],\n },\n },\n});\n\n/** Merge Tailwind / NativeWind class strings. */\nexport const cx = twMerge;\n\n/** Identity helper so Tailwind IntelliSense can sort style maps. */\nexport function sortCx<T extends Record<string, string | number | Record<string, string | number | Record<string, string | number>>>>(classes: T): T {\n return classes;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type React from \"react\";\n\ntype ReactComponent = React.FC<any> | React.ComponentClass<any, any>;\n\nexport const isFunctionComponent = (component: any): component is React.FC<any> => {\n return typeof component === \"function\";\n};\n\nexport const isClassComponent = (component: any): component is React.ComponentClass<any, any> => {\n return typeof component === \"function\" && component.prototype && (!!component.prototype.isReactComponent || !!component.prototype.render);\n};\n\nexport const isForwardRefComponent = (component: any): component is React.ForwardRefExoticComponent<any> => {\n return typeof component === \"object\" && component !== null && component.$$typeof.toString() === \"Symbol(react.forward_ref)\";\n};\n\nexport const isReactComponent = (component: any): component is ReactComponent => {\n return isFunctionComponent(component) || isForwardRefComponent(component) || isClassComponent(component);\n};\n","import { cx } from \"./cx\";\n\n//////////////////////////////////////////////// TYPES\n\nexport const TAB_ORIENTATIONS = [\"horizontal\", \"vertical\"] as const;\nexport type TabOrientation = (typeof TAB_ORIENTATIONS)[number];\n\nexport const TAB_SIZES = [\"sm\", \"md\"] as const;\nexport type TabSize = (typeof TAB_SIZES)[number];\n\nexport const HORIZONTAL_TAB_TYPES = [\n \"button-brand\",\n \"button-gray\",\n \"button-border\",\n \"button-minimal\",\n /** Fully rounded pills with a traveling selected background (web). */\n \"button-pill\",\n \"underline\",\n] as const;\n/** `line` = vertical underline (icon + label in a row). `line-stacked` = same chrome, icon above label. */\nexport const VERTICAL_TAB_TYPES = [\"button-brand\", \"button-gray\", \"button-border\", \"button-minimal\", \"line\", \"line-stacked\"] as const;\nexport type HorizontalTabType = (typeof HORIZONTAL_TAB_TYPES)[number];\nexport type VerticalTabType = (typeof VERTICAL_TAB_TYPES)[number];\nexport type TabType = HorizontalTabType | VerticalTabType;\n\n/** Fill color for `button-pill` only — maps to solid indicator + selected label. */\nexport const PILL_TAB_COLORS = [\"brand\", \"primary\"] as const;\nexport type PillTabColor = (typeof PILL_TAB_COLORS)[number];\n\n/** Underline / vertical line types that support a traveling border indicator. */\nexport function isLineTabType(type: TabType): boolean {\n return type === \"underline\" || type === \"line\" || type === \"line-stacked\";\n}\n\nexport interface TabState {\n isFocusVisible?: boolean;\n isSelected?: boolean;\n isHovered?: boolean;\n isPressed?: boolean;\n}\n\nexport interface TabItemStyleOptions {\n /**\n * Traveling underline/line indicator (`underline` / `line` / `line-stacked`).\n * When true, selected chrome is the shared indicator — tabs keep a transparent border only.\n */\n travel?: boolean;\n /**\n * `button-pill` only — inactive tabs get the same stroke as Button `secondary`\n * (`border-solid border-primary`). Selected stays filled with a transparent border\n * so layout does not shift.\n */\n stroke?: boolean;\n}\n\n/** Indicator fill + selected label/icon for `button-pill`. */\nexport const pillTabColorStyles: Record<\n PillTabColor,\n { indicator: string; selected: string; nativeSelected: string; nativeLabel: string }\n> = {\n brand: {\n indicator: \"bg-brand-solid\",\n selected: \"text-primary_on-brand *:data-icon:text-primary_on-brand\",\n nativeSelected: \"rounded-full bg-brand-solid\",\n nativeLabel: \"text-primary_on-brand\",\n },\n primary: {\n indicator: \"bg-primary-solid\",\n selected: \"text-fg-white *:data-icon:text-fg-white\",\n nativeSelected: \"rounded-full bg-primary-solid\",\n nativeLabel: \"text-fg-white\",\n },\n};\n\n//////////////////////////////////////////////// WEB STYLES\n// Exact class fragments from `components/application/tabs/tabs.tsx`.\n\nexport function tabItemStyles(\n { isFocusVisible, isSelected, isHovered, isPressed }: TabState,\n options: TabItemStyleOptions = {},\n): Record<TabType, string> {\n const travel = options.travel !== false;\n const stroke = options.stroke === true;\n\n const lineSelectedText =\n (isSelected || isHovered) && \"text-brand-secondary *:data-icon:text-fg-brand-secondary_hover\";\n /** Static mode: border paints on the tab. Travel mode: border stays transparent (indicator moves). */\n const underlineBorder =\n !travel && (isSelected || isHovered) && \"border-fg-brand-primary_alt\";\n const lineBorder = !travel && (isSelected || isHovered) && \"border-fg-brand-primary_alt\";\n\n return {\n \"button-brand\": cx(\n \"outline-focus-ring text-secondary *:data-icon:text-fg-secondary\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n isHovered && !isSelected && \"bg-secondary_hover\",\n isSelected && \"bg-brand-primary text-primary *:data-icon:text-fg-primary\",\n ),\n \"button-gray\": cx(\n \"outline-focus-ring *:data-icon:text-fg-quaternary\",\n isHovered && \"bg-primary_hover text-secondary *:data-icon:text-fg-secondary_hover\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n isSelected && \"bg-primary_hover text-secondary *:data-icon:text-fg-secondary_hover\",\n ),\n \"button-border\": cx(\n \"outline-focus-ring *:data-icon:text-fg-quaternary\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n (isSelected || isHovered) && \"bg-primary_alt text-secondary shadow-sm *:data-icon:text-fg-secondary_hover\",\n ),\n \"button-minimal\": cx(\n \"rounded-lg outline-focus-ring *:data-icon:text-fg-quaternary\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n (isSelected || isHovered) && \"bg-primary_alt text-secondary shadow-xs ring-1 ring-primary ring-inset *:data-icon:text-fg-secondary_hover\",\n ),\n // Selected fill comes from the clip-path indicator — tab stays transparent.\n // Selected label color is applied in Tab via `pillTabColorStyles` + `color` prop.\n // Light press scale via RAC `isPressed` (data-pressed / :active alone often miss on Tab).\n \"button-pill\": cx(\n \"rounded-full outline-focus-ring text-primary *:data-icon:text-fg-primary\",\n \"touch-manipulation [-webkit-tap-highlight-color:transparent]\",\n \"scale-100 transition-[color,background-color,border-color,transform] duration-150 ease-out\",\n \"motion-reduce:transition-[color,background-color,border-color]\",\n isPressed && \"scale-[0.98] duration-100 ease-linear motion-reduce:scale-100\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n isHovered && !isSelected && \"bg-primary_hover\",\n // Same stroke as Button secondary — transparent when selected so size stays stable.\n stroke && \"border border-solid\",\n stroke && (isSelected ? \"border-transparent\" : \"border-primary\"),\n ),\n underline: cx(\n \"rounded-none border-b-2 border-transparent outline-focus-ring *:data-icon:text-fg-quaternary\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n lineSelectedText,\n underlineBorder,\n ),\n line: cx(\n \"rounded-none border-l-2 border-transparent outline-focus-ring *:data-icon:text-fg-quaternary\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n lineSelectedText,\n lineBorder,\n ),\n \"line-stacked\": cx(\n \"rounded-none border-l-2 border-transparent outline-focus-ring *:data-icon:text-fg-quaternary\",\n isFocusVisible && \"outline-2 -outline-offset-2\",\n lineSelectedText,\n lineBorder,\n ),\n };\n}\n\nexport const tabSizes = {\n sm: {\n base: \"text-sm font-semibold gap-1 *:data-icon:size-4\",\n \"button-brand\": \"py-2 px-2.5\",\n \"button-gray\": \"py-2 px-2.5\",\n \"button-border\": \"py-2 px-2.5\",\n \"button-minimal\": \"py-2 px-2.5\",\n // Match legacy Avenue UI pill: h-9 + px-4.\n \"button-pill\": \"h-9 rounded-full px-4 py-0\",\n underline: \"px-0.5 pb-2.5 pt-0\",\n line: \"pl-2.5 pr-3 py-0.5\",\n // Vertical underline + stacked: pl-5 / pr-3, icon size-5.\n \"line-stacked\": \"gap-1.5 py-2 pr-3 pl-5 text-sm font-medium *:data-icon:size-5\",\n icon: 16,\n },\n md: {\n base: \"text-md font-semibold gap-1.5 *:data-icon:size-5\",\n \"button-brand\": \"py-2.5 px-2.5\",\n \"button-gray\": \"py-2.5 px-2.5\",\n \"button-border\": \"py-2.5 px-2.5\",\n \"button-minimal\": \"py-2.5 px-2.5\",\n \"button-pill\": \"h-10 rounded-full px-4 py-0\",\n underline: \"px-0.5 pb-2.5 pt-0\",\n line: \"pr-3.5 pl-3 py-1\",\n \"line-stacked\": \"gap-1.5 py-2 pr-3 pl-5 text-sm font-medium *:data-icon:size-5\",\n icon: 20,\n },\n} as const;\n\nexport function tabListStyles({ size, fullWidth }: { size?: TabSize; fullWidth?: boolean }): Record<TabType, string> {\n return {\n \"button-brand\": \"gap-1\",\n \"button-gray\": \"gap-1\",\n \"button-border\": cx(\"gap-1 rounded-[10px] bg-secondary_alt p-1 ring-1 ring-secondary ring-inset\", size === \"md\" && \"rounded-xl p-1.5\"),\n \"button-minimal\": \"gap-0.5 rounded-lg bg-secondary_alt ring-1 ring-inset ring-secondary\",\n \"button-pill\": \"relative items-center gap-1\",\n underline: cx(\"gap-3\", fullWidth && \"w-full gap-4\"),\n line: \"gap-2\",\n \"line-stacked\": \"gap-1\",\n };\n}\n\nexport const tabWebStyles = {\n root: \"flex w-full flex-col\",\n /** Vertical orientation: rail beside panel (partners sheets). */\n rootVertical: \"flex-row\",\n list: \"group flex\",\n listVertical: \"w-max flex-col\",\n listUnderlineRule: \"relative before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-border-secondary\",\n panel: \"outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2\",\n item: \"z-10 flex h-max cursor-pointer items-center justify-center gap-2 rounded-md whitespace-nowrap text-quaternary transition duration-100 ease-linear\",\n itemVertical: \"group-orientation-vertical:justify-start\",\n /** Vertical underline with icon above label. */\n itemStacked:\n \"flex-col! w-full items-start justify-start gap-1.5 overflow-visible whitespace-normal [&_svg]:size-5 [&_svg]:shrink-0\",\n itemFull: \"w-full flex-1\",\n label: \"flex items-center gap-1.5\",\n labelLine: \"flex items-center gap-1.5\",\n /** Icon slot wrapper for line-stacked. */\n iconStacked:\n \"relative inline-flex size-5 shrink-0 items-center justify-center overflow-visible [&_svg]:size-5 [&_svg]:shrink-0\",\n labelStacked: \"block min-w-0 w-full text-left leading-snug\",\n badge: \"hidden transition-inherit-all md:flex\",\n badgeSm: \"-my-px\",\n /** line-stacked: same Badge as row tabs, anchored to the icon’s top-right corner. */\n badgeStacked: \"absolute top-0 right-0 z-10 -translate-y-1/2 translate-x-1/2\",\n /**\n * Clip-path travel — apply only after the first snap so mount/reload does not animate\n * from 0 → selected.\n */\n indicatorTravel:\n \"motion-reduce:transition-none motion-safe:transition-[clip-path] motion-safe:duration-300 motion-safe:ease-[cubic-bezier(0,0.55,0.45,1)]\",\n /**\n * Traveling selected fill for `button-pill` — clipped via `--tab-indicator-start/end`\n * (same technique as legacy Avenue UI tabs). Sits under tab labels (`item` is z-10).\n */\n pillIndicator: \"pointer-events-none absolute inset-x-0 top-0 z-0 h-9 rounded-full\",\n pillIndicatorMd: \"h-10\",\n /** Horizontal clip-path using CSS vars set by TabList (pill — rounded). */\n pillClipPath:\n \"inset(0 calc(100% - var(--tab-indicator-end, 0px)) 0 var(--tab-indicator-start, 0px) round 9999px)\",\n /** Horizontal clip-path for underline bar (no round). */\n lineClipPathHorizontal:\n \"inset(0 calc(100% - var(--tab-indicator-end, 0px)) 0 var(--tab-indicator-start, 0px))\",\n /** Vertical clip-path (line / line-stacked). */\n lineClipPathVertical:\n \"inset(var(--tab-indicator-start, 0px) 0 calc(100% - var(--tab-indicator-end, 0px)) 0)\",\n /**\n * Horizontal underline bar — bottom of the list.\n * Thickness matches tab `border-b-2` (2px). z-[1] so it sits above the hairline rule.\n */\n underlineIndicator: \"bg-fg-brand-primary_alt pointer-events-none absolute inset-x-0 bottom-0 z-[1] h-[2px]\",\n /**\n * Vertical line bar — left of the list.\n * Thickness matches tab `border-l-2` (2px).\n */\n lineIndicator: \"bg-fg-brand-primary_alt pointer-events-none absolute inset-y-0 left-0 z-[1] w-[2px]\",\n} as const;\n\n//////////////////////////////////////////////// NATIVE STYLES\n// Selected chrome only. Skips hover, focus ring, and `md:` badge hiding.\n\nexport const tabsStyles = {\n root: \"w-full flex-col\",\n rootVertical: \"w-full flex-row\",\n list: \"flex-row\",\n listVertical: \"flex-col\",\n listUnderlineRule: \"border-b border-secondary\",\n listButtonBorder: \"gap-1 rounded-[10px] border border-secondary bg-secondary_alt p-1\",\n listButtonBorderMd: \"rounded-xl p-1.5\",\n listButtonMinimal: \"gap-0.5 rounded-lg border border-secondary bg-secondary_alt\",\n item: \"flex-row items-center justify-center gap-2 rounded-md\",\n itemVertical: \"justify-start\",\n itemStacked: \"w-full flex-col items-start justify-start gap-1.5 overflow-visible\",\n itemFull: \"flex-1\",\n label: \"font-semibold text-quaternary\",\n labelRow: \"flex-row items-center gap-1.5\",\n labelStacked: \"w-full min-w-0\",\n iconStacked: \"relative size-5 shrink-0 items-center justify-center overflow-visible\",\n badgeStacked: \"absolute top-0 right-0 z-10 -translate-y-1/2 translate-x-1/2\",\n /** Traveling selected fill for native `button-pill` (positioned by Reanimated). */\n pillIndicator: \"absolute top-0 left-0 z-0 rounded-full\",\n /** Native traveling underline / line bar — 2px to match `border-b-2` / `border-l-2`. */\n underlineIndicator: \"absolute bottom-0 left-0 z-[1] h-[2px] bg-fg-brand-primary_alt\",\n lineIndicator: \"absolute top-0 left-0 z-[1] w-[2px] bg-fg-brand-primary_alt\",\n} as const;\n\nexport function tabNativeItemState(\n type: TabType,\n selected: boolean,\n options: TabItemStyleOptions = {},\n) {\n const travel = options.travel !== false;\n const stroke = options.stroke === true;\n\n if (!selected) {\n if (type === \"underline\" || type === \"line\" || type === \"line-stacked\") return \"border-transparent\";\n if (type === \"button-pill\" && stroke) return \"rounded-full border border-solid border-primary\";\n return \"\";\n }\n switch (type) {\n case \"button-brand\":\n return \"bg-brand-primary\";\n case \"button-gray\":\n return \"bg-primary_hover\";\n case \"button-border\":\n return \"bg-primary_alt\";\n case \"button-minimal\":\n return \"rounded-lg bg-primary_alt border border-primary\";\n case \"button-pill\":\n // Fill comes from the traveling indicator on native — keep the tab transparent.\n return stroke ? \"rounded-full border border-solid border-transparent\" : \"rounded-full\";\n case \"underline\":\n return travel\n ? \"rounded-none border-b-2 border-transparent\"\n : \"rounded-none border-b-2 border-fg-brand-primary_alt\";\n case \"line\":\n case \"line-stacked\":\n return travel\n ? \"rounded-none border-l-2 border-transparent\"\n : \"rounded-none border-l-2 border-fg-brand-primary_alt\";\n default: {\n const _exhaustive: never = type;\n return _exhaustive;\n }\n }\n}\n\n/** Text color only. Borders stay on the tab so the label does not draw a second line. */\nexport function tabNativeLabelState(type: TabType, selected: boolean) {\n if (!selected) {\n if (type === \"button-pill\") return \"text-primary\";\n if (type === \"button-brand\") return \"text-secondary\";\n return \"text-quaternary\";\n }\n switch (type) {\n case \"button-brand\":\n return \"text-primary\";\n case \"button-pill\":\n return pillTabColorStyles.brand.nativeLabel;\n case \"button-gray\":\n case \"button-border\":\n case \"button-minimal\":\n return \"text-secondary\";\n case \"underline\":\n case \"line\":\n case \"line-stacked\":\n return \"text-brand-secondary\";\n default: {\n const _exhaustive: never = type;\n return _exhaustive;\n }\n }\n}\n","import type { FC } from \"react\";\nimport { sortCx } from \"./cx\";\n\n//////////////////////////////////////////////// TYPES\n\nexport const BADGE_SIZES = [\"sm\", \"md\", \"lg\"] as const;\nexport type BadgeSize = (typeof BADGE_SIZES)[number];\n\nexport const BADGE_COLORS = [\n \"gray\",\n \"brand\",\n \"error\",\n \"warning\",\n \"success\",\n \"slate\",\n \"sky\",\n \"blue\",\n \"indigo\",\n \"purple\",\n \"pink\",\n \"orange\",\n] as const;\nexport type BadgeColorName = (typeof BADGE_COLORS)[number];\n\nexport const badgeTypes = {\n pillColor: \"pill-color\",\n badgeColor: \"color\",\n badgeModern: \"modern\",\n} as const;\n\nexport type BadgeTypes = (typeof badgeTypes)[keyof typeof badgeTypes];\n\nexport type ExtractColorKeys<T> = T extends { styles: infer C } ? keyof C : never;\nexport type ExtractBadgeKeys<T> = keyof T;\nexport type BadgeTypeToColorMap<T> = {\n [K in ExtractBadgeKeys<T>]: ExtractColorKeys<T[K]>;\n};\n\n/** Icon component contract for badge addons (web Phosphor / native Phosphor). */\nexport type BadgeIconComponent = FC<{\n className?: string;\n weight?: \"thin\" | \"light\" | \"regular\" | \"bold\" | \"fill\" | \"duotone\";\n size?: number;\n color?: string;\n}>;\n\n//////////////////////////////////////////////// SHARED STYLES\n// Visual contract for web + native. Web focus / hover stay in badgeWebStyles.\n\nexport const badgeFilledColors: Record<\n BadgeColorName,\n { root: string; addon: string; addonButton: string }\n> = {\n gray: {\n root: \"bg-utility-neutral-50 text-utility-neutral-700 ring-utility-neutral-200\",\n addon: \"text-utility-neutral-500\",\n addonButton: \"hover:bg-utility-neutral-100 text-utility-neutral-400 hover:text-utility-neutral-500\",\n },\n brand: {\n root: \"bg-utility-brand-50 text-utility-brand-700 ring-utility-brand-200\",\n addon: \"text-utility-brand-500\",\n addonButton: \"hover:bg-utility-brand-100 text-utility-brand-400 hover:text-utility-brand-500\",\n },\n error: {\n root: \"bg-utility-red-50 text-utility-red-700 ring-utility-red-200\",\n addon: \"text-utility-red-500\",\n addonButton: \"hover:bg-utility-red-100 text-utility-red-400 hover:text-utility-red-500\",\n },\n warning: {\n root: \"bg-utility-yellow-50 text-utility-yellow-700 ring-utility-yellow-200\",\n addon: \"text-utility-yellow-500\",\n addonButton: \"hover:bg-utility-yellow-100 text-utility-yellow-400 hover:text-utility-yellow-500\",\n },\n success: {\n root: \"bg-utility-green-50 text-utility-green-700 ring-utility-green-200\",\n addon: \"text-utility-green-500\",\n addonButton: \"hover:bg-utility-green-100 text-utility-green-400 hover:text-utility-green-500\",\n },\n slate: {\n root: \"bg-utility-slate-50 text-utility-slate-700 ring-utility-slate-200\",\n addon: \"text-utility-slate-500\",\n addonButton: \"hover:bg-utility-slate-100 text-utility-slate-400 hover:text-utility-slate-500\",\n },\n sky: {\n root: \"bg-utility-sky-50 text-utility-sky-700 ring-utility-sky-200\",\n addon: \"text-utility-sky-500\",\n addonButton: \"hover:bg-utility-sky-100 text-utility-sky-400 hover:text-utility-sky-500\",\n },\n blue: {\n root: \"bg-utility-blue-50 text-utility-blue-700 ring-utility-blue-200\",\n addon: \"text-utility-blue-500\",\n addonButton: \"hover:bg-utility-blue-100 text-utility-blue-400 hover:text-utility-blue-500\",\n },\n indigo: {\n root: \"bg-utility-indigo-50 text-utility-indigo-700 ring-utility-indigo-200\",\n addon: \"text-utility-indigo-500\",\n addonButton: \"hover:bg-utility-indigo-100 text-utility-indigo-400 hover:text-utility-indigo-500\",\n },\n purple: {\n root: \"bg-utility-purple-50 text-utility-purple-700 ring-utility-purple-200\",\n addon: \"text-utility-purple-500\",\n addonButton: \"hover:bg-utility-purple-100 text-utility-purple-400 hover:text-utility-purple-500\",\n },\n pink: {\n root: \"bg-utility-pink-50 text-utility-pink-700 ring-utility-pink-200\",\n addon: \"text-utility-pink-500\",\n addonButton: \"hover:bg-utility-pink-100 text-utility-pink-400 hover:text-utility-pink-500\",\n },\n orange: {\n root: \"bg-utility-orange-50 text-utility-orange-700 ring-utility-orange-200\",\n addon: \"text-utility-orange-500\",\n addonButton: \"hover:bg-utility-orange-100 text-utility-orange-400 hover:text-utility-orange-500\",\n },\n};\n\nconst addonOnlyColors = Object.fromEntries(\n Object.entries(badgeFilledColors).map(([key, value]) => [key, { root: \"\", addon: value.addon }]),\n) as Record<BadgeColorName, { root: string; addon: string }>;\n\n/**\n * Shared layout chrome. Avoid bare `flex` (NativeWind). Web shells prepend `flex`.\n */\nexport const badgeWithPillTypes = {\n [badgeTypes.pillColor]: {\n common: \"size-max flex-row items-center whitespace-nowrap rounded-full ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeColor]: {\n common: \"size-max flex-row items-center whitespace-nowrap rounded-md ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeModern]: {\n common:\n \"size-max flex-row items-center whitespace-nowrap rounded-full ring-1 ring-inset shadow-xs\",\n styles: {\n gray: {\n root: \"bg-primary text-secondary ring-primary\",\n addon: \"text-neutral-500\",\n addonButton:\n \"hover:bg-utility-neutral-100 text-utility-neutral-400 hover:text-utility-neutral-500\",\n },\n },\n },\n} as const;\n\nexport const badgeWithBadgeTypes = {\n [badgeTypes.pillColor]: {\n common: \"size-max flex-row items-center whitespace-nowrap rounded-full ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeColor]: {\n common: \"size-max flex-row items-center whitespace-nowrap rounded-md ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeModern]: {\n common:\n \"size-max flex-row items-center whitespace-nowrap rounded-full ring-1 ring-inset bg-primary text-secondary ring-primary shadow-xs\",\n styles: addonOnlyColors,\n },\n} as const;\n\nexport type BadgeColor<T extends BadgeTypes> = BadgeTypeToColorMap<typeof badgeWithPillTypes>[T];\n\nexport const badgeStyles = sortCx({\n pillSizes: {\n sm: \"py-0.5 px-2 text-xs font-semibold\",\n md: \"py-0.5 px-2.5 text-sm font-semibold\",\n lg: \"py-1 px-3 text-sm font-semibold\",\n },\n badgeSizes: {\n sm: \"py-0.5 px-1.5 text-xs font-semibold\",\n md: \"py-0.5 px-2 text-sm font-semibold\",\n lg: \"py-1 px-2.5 text-sm font-semibold\",\n },\n badgeColorSizes: {\n sm: \"py-0.5 px-1.5 text-xs font-semibold\",\n md: \"py-0.5 px-2 text-sm font-semibold\",\n lg: \"py-1 px-2.5 text-sm font-semibold rounded-lg\",\n },\n pillDotSizes: {\n sm: \"gap-1 py-0.5 pl-1.5 pr-2 text-xs font-semibold\",\n md: \"gap-1.5 py-0.5 pl-2 pr-2.5 text-sm font-semibold\",\n lg: \"gap-1.5 py-1 pl-2.5 pr-3 text-sm font-semibold\",\n },\n badgeDotSizes: {\n sm: \"gap-1 py-0.5 px-1.5 text-xs font-semibold\",\n md: \"gap-1.5 py-0.5 px-2 text-sm font-semibold\",\n lg: \"gap-1.5 py-1 px-2.5 text-sm font-semibold\",\n },\n badgeColorDotSizes: {\n sm: \"gap-1 py-0.5 px-1.5 text-xs font-semibold\",\n md: \"gap-1.5 py-0.5 px-2 text-sm font-semibold\",\n lg: \"gap-1.5 py-1 px-2.5 text-sm font-semibold rounded-lg\",\n },\n icon: \"size-3\",\n});\n\n/** Resolve size class map for plain `Badge` / similar. */\nexport function resolveBadgeSizeClass(type: BadgeTypes, size: BadgeSize): string {\n if (type === badgeTypes.pillColor) return badgeStyles.pillSizes[size];\n if (type === badgeTypes.badgeColor) return badgeStyles.badgeColorSizes[size];\n return badgeStyles.badgeSizes[size];\n}\n\nexport function resolveBadgeDotSizeClass(type: BadgeTypes, size: BadgeSize): string {\n if (type === badgeTypes.pillColor) return badgeStyles.pillDotSizes[size];\n if (type === badgeTypes.badgeColor) return badgeStyles.badgeColorDotSizes[size];\n return badgeStyles.badgeDotSizes[size];\n}\n\nexport const badgeIconSizeMaps = {\n [badgeTypes.pillColor]: {\n sm: { trailing: \"gap-0.5 py-0.5 pl-2 pr-1.5 text-xs font-semibold\", leading: \"gap-0.5 py-0.5 pr-2 pl-1.5 text-xs font-semibold\" },\n md: { trailing: \"gap-1 py-0.5 pl-2.5 pr-2 text-sm font-semibold\", leading: \"gap-1 py-0.5 pr-2.5 pl-2 text-sm font-semibold\" },\n lg: { trailing: \"gap-1 py-1 pl-3 pr-2.5 text-sm font-semibold\", leading: \"gap-1 py-1 pr-3 pl-2.5 text-sm font-semibold\" },\n },\n [badgeTypes.badgeColor]: {\n sm: { trailing: \"gap-0.5 py-0.5 pl-2 pr-1.5 text-xs font-semibold\", leading: \"gap-0.5 py-0.5 pr-2 pl-1.5 text-xs font-semibold\" },\n md: { trailing: \"gap-1 py-0.5 pl-2 pr-1.5 text-sm font-semibold\", leading: \"gap-1 py-0.5 pr-2 pl-1.5 text-sm font-semibold\" },\n lg: {\n trailing: \"gap-1 py-1 pl-2.5 pr-2 text-sm font-semibold rounded-lg\",\n leading: \"gap-1 py-1 pr-2.5 pl-2 text-sm font-semibold rounded-lg\",\n },\n },\n [badgeTypes.badgeModern]: {\n sm: { trailing: \"gap-0.5 py-0.5 pl-2 pr-1.5 text-xs font-semibold\", leading: \"gap-0.5 py-0.5 pr-2 pl-1.5 text-xs font-semibold\" },\n md: { trailing: \"gap-1 py-0.5 pl-2 pr-1.5 text-sm font-semibold\", leading: \"gap-1 py-0.5 pr-2 pl-1.5 text-sm font-semibold\" },\n lg: { trailing: \"gap-1 py-1 pl-2.5 pr-2 text-sm font-semibold\", leading: \"gap-1 py-1 pr-2.5 pl-2 text-sm font-semibold\" },\n },\n} as const;\n\nexport const badgeOnlyIconSizeMaps = {\n [badgeTypes.pillColor]: { sm: \"p-1.25\", md: \"p-1.5\", lg: \"p-2\" },\n [badgeTypes.badgeColor]: { sm: \"p-1.25\", md: \"p-1.5\", lg: \"p-2 rounded-lg\" },\n [badgeTypes.badgeModern]: { sm: \"p-1.25\", md: \"p-1.5\", lg: \"p-2\" },\n} as const;\n\nexport const badgeWithButtonSizeMaps = {\n [badgeTypes.pillColor]: {\n sm: \"gap-0.5 py-0.5 pl-2 pr-0.75 text-xs font-semibold\",\n md: \"gap-0.5 py-0.5 pl-2.5 pr-1 text-sm font-semibold\",\n lg: \"gap-0.5 py-1 pl-3 pr-1.5 text-sm font-semibold\",\n },\n [badgeTypes.badgeColor]: {\n sm: \"gap-0.5 py-0.5 pl-1.5 pr-0.75 text-xs font-semibold\",\n md: \"gap-0.5 py-0.5 pl-2 pr-1 text-sm font-semibold\",\n lg: \"gap-0.5 py-1 pl-2.5 pr-1.5 text-sm font-semibold rounded-lg\",\n },\n [badgeTypes.badgeModern]: {\n sm: \"gap-0.5 py-0.5 pl-1.5 pr-0.75 text-xs font-semibold\",\n md: \"gap-0.5 py-0.5 pl-2 pr-1 text-sm font-semibold\",\n lg: \"gap-0.5 py-1 pl-2.5 pr-1.5 text-sm font-semibold\",\n },\n} as const;\n\nexport const badgeWithMediaSizeMaps = {\n [badgeTypes.pillColor]: {\n sm: \"gap-1 py-0.5 pl-0.75 pr-2 text-xs font-semibold\",\n md: \"gap-1.5 py-0.5 pl-1 pr-2.5 text-sm font-semibold\",\n lg: \"gap-1.5 py-1 pl-1.5 pr-3 text-sm font-semibold\",\n },\n [badgeTypes.badgeColor]: {\n sm: \"gap-1 py-0.5 pl-1 pr-1.5 text-xs font-semibold\",\n md: \"gap-1.5 py-0.5 pl-1.5 pr-2 text-sm font-semibold\",\n lg: \"gap-1.5 py-1 pl-2 pr-2.5 text-sm font-semibold rounded-lg\",\n },\n [badgeTypes.badgeModern]: {\n sm: \"gap-1 py-0.5 pl-1 pr-1.5 text-xs font-semibold\",\n md: \"gap-1.5 py-0.5 pl-1.5 pr-2 text-sm font-semibold\",\n lg: \"gap-1.5 py-1 pl-2 pr-2.5 text-sm font-semibold\",\n },\n} as const;\n\n//////////////////////////////////////////////// WEB-ONLY STYLES\n\n/** Plain focus — dismiss button on BadgeWithButton. */\nexport const badgeWebFocusShadowPlain =\n \"focus-visible:outline-none focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]\";\n\n/** Web needs `display:flex`; shared maps use `flex-row` for NativeWind. */\nexport const badgeWebDisplayFlex = \"flex\";\n\n/**\n * Exact `common` strings from web `badges.tsx` (`flex`, not `flex-row`).\n * Size / color maps are shared (`badgeStyles`, `badgeFilledColors`, …).\n */\nexport const badgeWebWithPillTypes = {\n [badgeTypes.pillColor]: {\n common: \"size-max flex items-center whitespace-nowrap rounded-full ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeColor]: {\n common: \"size-max flex items-center whitespace-nowrap rounded-md ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeModern]: {\n common: \"size-max flex items-center whitespace-nowrap rounded-full ring-1 ring-inset shadow-xs\",\n styles: {\n gray: {\n root: \"bg-primary text-secondary ring-primary\",\n addon: \"text-neutral-500\",\n addonButton: \"hover:bg-utility-neutral-100 text-utility-neutral-400 hover:text-utility-neutral-500\",\n },\n },\n },\n} as const;\n\nexport const badgeWebWithBadgeTypes = {\n [badgeTypes.pillColor]: {\n common: \"size-max flex items-center whitespace-nowrap rounded-full ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeColor]: {\n common: \"size-max flex items-center whitespace-nowrap rounded-md ring-1 ring-inset\",\n styles: badgeFilledColors,\n },\n [badgeTypes.badgeModern]: {\n common: \"size-max flex items-center whitespace-nowrap rounded-full ring-1 ring-inset bg-primary text-secondary ring-primary shadow-xs\",\n styles: addonOnlyColors,\n },\n} as const;\n\nexport const badgeWebButton =\n \"flex cursor-pointer items-center justify-center p-0.5 transition duration-100 ease-linear\";\nexport const badgeWebFlagImage = \"size-4 max-w-none rounded-full\";\n\n/** Typography for native `<Text>` label (size maps put these on the chrome). */\nexport const badgeLabelTextSizes: Record<BadgeSize, string> = {\n sm: \"text-xs font-semibold\",\n md: \"text-sm font-semibold\",\n lg: \"text-sm font-semibold\",\n};\n","import type { FC, ReactNode } from \"react\";\nimport { Image } from \"react-native\";\nimport { Pressable, Text, View } from \"react-native-css/components\";\nimport Svg, { Circle } from \"react-native-svg\";\nimport { XIcon } from \"phosphor-react-native/src/icons/X\";\nimport {\n BADGE_COLORS,\n BADGE_SIZES,\n badgeFilledColors,\n badgeIconSizeMaps,\n badgeLabelTextSizes,\n badgeOnlyIconSizeMaps,\n badgeStyles,\n badgeTypes,\n badgeWithBadgeTypes,\n badgeWithButtonSizeMaps,\n badgeWithMediaSizeMaps,\n badgeWithPillTypes,\n resolveBadgeDotSizeClass,\n resolveBadgeSizeClass,\n type BadgeColor,\n type BadgeColorName,\n type BadgeIconComponent,\n type BadgeSize,\n type BadgeTypeToColorMap,\n type BadgeTypes,\n} from \"@avenue-ticketing/core/badge\";\nimport { cx } from \"@avenue-ticketing/core/cx\";\nimport { styled } from \"nativewind\";\n\nexport type {\n BadgeColor,\n BadgeColorName,\n BadgeIconComponent,\n BadgeSize,\n BadgeTypes,\n};\n\nexport { BADGE_COLORS, BADGE_SIZES, badgeTypes, badgeFilledColors as filledColors };\n\n//////////////////////////////////////////////// TYPES\n\nexport interface BadgeProps<T extends BadgeTypes = BadgeTypes> {\n type?: T;\n size?: BadgeSize;\n color?: BadgeColor<T>;\n children: ReactNode;\n className?: string;\n}\n\nexport interface BadgeWithDotProps<T extends BadgeTypes = BadgeTypes> {\n type?: T;\n size?: BadgeSize;\n color?: BadgeTypeToColorMap<typeof badgeWithBadgeTypes>[T];\n className?: string;\n children: ReactNode;\n}\n\nexport interface BadgeWithIconProps<T extends BadgeTypes = BadgeTypes> {\n type?: T;\n size?: BadgeSize;\n color?: BadgeTypeToColorMap<typeof badgeWithBadgeTypes>[T];\n iconLeading?: BadgeIconComponent;\n iconTrailing?: BadgeIconComponent;\n children: ReactNode;\n className?: string;\n}\n\nexport interface BadgeWithImageProps<T extends BadgeTypes = BadgeTypes> {\n type?: T;\n size?: BadgeSize;\n imgSrc: string;\n color?: BadgeTypeToColorMap<typeof badgeWithPillTypes>[T];\n children: ReactNode;\n className?: string;\n}\n\nexport interface BadgeWithButtonProps<T extends BadgeTypes = BadgeTypes> {\n type?: T;\n size?: BadgeSize;\n icon?: BadgeIconComponent;\n color?: BadgeTypeToColorMap<typeof badgeWithPillTypes>[T];\n children: ReactNode;\n buttonLabel?: string;\n onButtonPress?: () => void;\n className?: string;\n}\n\nexport interface BadgeIconProps<T extends BadgeTypes = BadgeTypes> {\n type?: T;\n size?: BadgeSize;\n icon: BadgeIconComponent;\n color?: BadgeTypeToColorMap<typeof badgeWithPillTypes>[T];\n className?: string;\n}\n\n//////////////////////////////////////////////// HELPERS\n\n/** Lets Tailwind `text-*` set SVG `color` so `fill=\"currentColor\"` matches web. */\nconst StyledSvg = styled(Svg);\n\nconst BadgeDot: FC<{ className?: string }> = ({ className }) => {\n return (\n <StyledSvg width={8} height={8} viewBox=\"0 0 8 8\" className={className}>\n <Circle cx={4} cy={4} r={2.5} fill=\"currentColor\" stroke=\"currentColor\" />\n </StyledSvg>\n );\n};\n\nconst BadgeLabel: FC<{ size: BadgeSize; colorClass: string; children: ReactNode }> = ({\n size,\n colorClass,\n children,\n}) => {\n if (typeof children === \"string\" || typeof children === \"number\") {\n return <Text className={cx(badgeLabelTextSizes[size], colorClass)}>{children}</Text>;\n }\n return <>{children}</>;\n};\n\n//////////////////////////////////////////////// MAIN\n\n/**\n * NativeWind badge — shared Tailwind class maps from `@avenue-ticketing/core/badge`.\n */\nexport const Badge = <T extends BadgeTypes>({\n type = \"pill-color\" as T,\n size = \"md\",\n color = \"gray\" as BadgeColor<T>,\n children,\n className,\n}: BadgeProps<T>) => {\n const colors = badgeWithPillTypes[type];\n const colorRoot = colors.styles[color as keyof typeof colors.styles].root;\n\n return (\n <View className={cx(colors.common, resolveBadgeSizeClass(type, size), colorRoot, className)}>\n <BadgeLabel size={size} colorClass={colorRoot}>\n {children}\n </BadgeLabel>\n </View>\n );\n};\n\nexport const BadgeWithDot = <T extends BadgeTypes>({\n size = \"md\",\n color = \"gray\" as BadgeTypeToColorMap<typeof badgeWithBadgeTypes>[T],\n type = \"pill-color\" as T,\n className,\n children,\n}: BadgeWithDotProps<T>) => {\n const colors = badgeWithBadgeTypes[type];\n const style = colors.styles[color as keyof typeof colors.styles];\n\n return (\n <View className={cx(colors.common, resolveBadgeDotSizeClass(type, size), style.root, className)}>\n <BadgeDot className={style.addon} />\n <BadgeLabel size={size} colorClass={style.root}>\n {children}\n </BadgeLabel>\n </View>\n );\n};\n\nexport const BadgeWithIcon = <T extends BadgeTypes>({\n size = \"md\",\n color = \"gray\" as BadgeTypeToColorMap<typeof badgeWithBadgeTypes>[T],\n type = \"pill-color\" as T,\n iconLeading: IconLeading,\n iconTrailing: IconTrailing,\n children,\n className,\n}: BadgeWithIconProps<T>) => {\n const colors = badgeWithBadgeTypes[type];\n const style = colors.styles[color as keyof typeof colors.styles];\n const icon = IconLeading ? \"leading\" : \"trailing\";\n\n return (\n <View className={cx(colors.common, badgeIconSizeMaps[type][size][icon], style.root, className)}>\n {IconLeading && <IconLeading weight=\"bold\" className={cx(style.addon, badgeStyles.icon)} size={12} />}\n <BadgeLabel size={size} colorClass={style.root}>\n {children}\n </BadgeLabel>\n {IconTrailing && <IconTrailing weight=\"bold\" className={cx(style.addon, badgeStyles.icon)} size={12} />}\n </View>\n );\n};\n\nexport const BadgeWithImage = <T extends BadgeTypes>({\n size = \"md\",\n color = \"gray\" as BadgeTypeToColorMap<typeof badgeWithPillTypes>[T],\n type = \"pill-color\" as T,\n imgSrc,\n children,\n className,\n}: BadgeWithImageProps<T>) => {\n const colors = badgeWithPillTypes[type];\n const colorRoot = colors.styles[color as keyof typeof colors.styles].root;\n\n return (\n <View className={cx(colors.common, badgeWithMediaSizeMaps[type][size], colorRoot, className)}>\n <Image\n source={{ uri: imgSrc }}\n accessibilityLabel=\"Badge image\"\n style={{ width: 16, height: 16, borderRadius: 999 }}\n />\n <BadgeLabel size={size} colorClass={colorRoot}>\n {children}\n </BadgeLabel>\n </View>\n );\n};\n\nexport const BadgeWithButton = <T extends BadgeTypes>({\n size = \"md\",\n color = \"gray\" as BadgeTypeToColorMap<typeof badgeWithPillTypes>[T],\n type = \"pill-color\" as T,\n icon: Icon = XIcon,\n buttonLabel,\n children,\n onButtonPress,\n className,\n}: BadgeWithButtonProps<T>) => {\n const colors = badgeWithPillTypes[type];\n const style = colors.styles[color as keyof typeof colors.styles];\n\n return (\n <View className={cx(colors.common, badgeWithButtonSizeMaps[type][size], style.root, className)}>\n <BadgeLabel size={size} colorClass={style.root}>\n {children}\n </BadgeLabel>\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel={buttonLabel}\n onPress={onButtonPress}\n className={cx(\n \"items-center justify-center p-0.5\",\n style.addonButton,\n type === badgeTypes.pillColor || type === badgeTypes.badgeModern ? \"rounded-full\" : \"rounded-[3px]\",\n )}\n >\n <Icon weight=\"bold\" className={badgeStyles.icon} size={12} />\n </Pressable>\n </View>\n );\n};\n\nexport const BadgeIcon = <T extends BadgeTypes>({\n size = \"md\",\n color = \"gray\" as BadgeTypeToColorMap<typeof badgeWithPillTypes>[T],\n type = \"pill-color\" as T,\n icon: Icon,\n className,\n}: BadgeIconProps<T>) => {\n const colors = badgeWithPillTypes[type];\n const style = colors.styles[color as keyof typeof colors.styles];\n\n return (\n <View className={cx(colors.common, badgeOnlyIconSizeMaps[type][size], style.root, className)}>\n <Icon weight=\"bold\" className={cx(badgeStyles.icon, style.addon)} size={12} />\n </View>\n );\n};\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type FC,\n type ReactNode,\n} from \"react\";\nimport { ScrollView, StyleSheet, type LayoutChangeEvent } from \"react-native\";\nimport { Pressable, Text, View } from \"react-native-css/components\";\nimport { useNativeVariable } from \"react-native-css\";\nimport Animated, { Easing, useAnimatedStyle, useSharedValue, withTiming } from \"react-native-reanimated\";\nimport { cx } from \"@avenue-ticketing/core/cx\";\nimport { isReactComponent } from \"@avenue-ticketing/core/is-react-component\";\nimport {\n isLineTabType,\n pillTabColorStyles,\n tabListStyles,\n tabNativeItemState,\n tabNativeLabelState,\n tabSizes,\n tabsStyles,\n type PillTabColor,\n type TabOrientation,\n type TabSize,\n type TabType,\n} from \"@avenue-ticketing/core/tabs\";\nimport { Badge } from \"../../base/badges/badges\";\n\nexport type { PillTabColor, TabOrientation, TabSize, TabType };\n\n//////////////////////////////////////////////// SETUP\n\n/** Same easing as web / legacy Avenue UI pill clip-path. */\nconst PILL_EASE = Easing.bezier(0, 0.55, 0.45, 1);\nconst PILL_MS = 300;\n\ntype TabLayout = { x: number; y: number; width: number; height: number };\n\n//////////////////////////////////////////////// CONTEXT\n\ntype TabsContextValue = {\n selectedKey: string | undefined;\n setSelectedKey: (key: string) => void;\n orientation: TabOrientation;\n};\n\nconst TabsContext = createContext<TabsContextValue | undefined>(undefined);\n\ntype TabListContextValue = {\n size: TabSize;\n type: TabType;\n color: PillTabColor;\n travel: boolean;\n stroke: boolean;\n fullWidth?: boolean;\n orientation: TabOrientation;\n registerTravelLayout?: (id: string, layout: TabLayout) => void;\n};\n\nconst TabListContext = createContext<TabListContextValue>({\n size: \"sm\",\n type: \"button-brand\",\n color: \"brand\",\n travel: true,\n stroke: false,\n orientation: \"horizontal\",\n});\n\n//////////////////////////////////////////////// MAIN\n\nexport const TabsRoot: FC<{\n children?: ReactNode;\n selectedKey?: string;\n defaultSelectedKey?: string;\n onSelectionChange?: (key: string) => void;\n orientation?: TabOrientation;\n className?: string;\n}> = ({ children, selectedKey, defaultSelectedKey, onSelectionChange, orientation = \"horizontal\", className }) => {\n const [internal, setInternal] = useState(defaultSelectedKey);\n const current = selectedKey ?? internal;\n const setSelectedKey = (key: string) => {\n if (selectedKey === undefined) setInternal(key);\n onSelectionChange?.(key);\n };\n const value = useMemo(\n () => ({ selectedKey: current, setSelectedKey, orientation }),\n [current, orientation],\n );\n\n return (\n <TabsContext.Provider value={value}>\n <View className={cx(orientation === \"vertical\" ? tabsStyles.rootVertical : tabsStyles.root, className)}>{children}</View>\n </TabsContext.Provider>\n );\n};\n\nexport const TabList: FC<{\n children?: ReactNode;\n size?: TabSize;\n type?: TabType;\n /** `button-pill` only — indicator fill. Ignored for other types. */\n color?: PillTabColor;\n /**\n * Traveling underline / line border for `underline`, `line`, and `line-stacked`.\n * Defaults to `true`. Ignored for button types (`button-pill` always travels).\n */\n travel?: boolean;\n /**\n * `button-pill` only — inactive tabs use the same border as Button `secondary`\n * (`border-solid border-primary`). Ignored for every other type. Defaults to `false`.\n */\n stroke?: boolean;\n fullWidth?: boolean;\n className?: string;\n items?: TabItemProps[];\n}> = ({\n children,\n size = \"sm\",\n type = \"button-brand\",\n color = \"brand\",\n travel = true,\n stroke = false,\n fullWidth,\n className,\n items,\n}) => {\n const tabs = useContext(TabsContext);\n const orientation = tabs?.orientation ?? \"horizontal\";\n const isPill = type === \"button-pill\";\n const isLine = isLineTabType(type);\n const isVerticalLine = type === \"line\" || type === \"line-stacked\";\n const useTravelIndicator = isPill || (isLine && travel);\n const selectedKey = tabs?.selectedKey;\n\n const brandSolid = useNativeVariable(\"--color-bg-brand-solid\") ?? \"#7c3aed\";\n const primarySolid = useNativeVariable(\"--color-bg-primary-solid\") ?? \"#171717\";\n const brandLine = useNativeVariable(\"--color-fg-brand-primary_alt\") ?? \"#9e77ed\";\n\n const layoutsRef = useRef<Map<string, TabLayout>>(new Map());\n const hasPlacedRef = useRef(false);\n\n const indicatorX = useSharedValue(0);\n const indicatorY = useSharedValue(0);\n const indicatorW = useSharedValue(0);\n const indicatorH = useSharedValue(0);\n const indicatorOpacity = useSharedValue(0);\n\n const moveIndicator = useCallback(\n (key: string | undefined, animate: boolean) => {\n if (!key) return;\n const layout = layoutsRef.current.get(key);\n if (!layout || layout.width <= 0 || layout.height <= 0) return;\n\n const cfg = { duration: PILL_MS, easing: PILL_EASE };\n\n let nextX = layout.x;\n let nextY = layout.y;\n let nextW = layout.width;\n let nextH = layout.height;\n\n if (isLine && !isPill) {\n if (isVerticalLine) {\n nextX = layout.x;\n nextY = layout.y;\n nextW = 2;\n nextH = layout.height;\n } else {\n nextX = layout.x;\n nextY = layout.y + Math.max(layout.height - 2, 0);\n nextW = layout.width;\n nextH = 2;\n }\n }\n\n if (animate && hasPlacedRef.current) {\n indicatorX.value = withTiming(nextX, cfg);\n indicatorY.value = withTiming(nextY, cfg);\n indicatorW.value = withTiming(nextW, cfg);\n indicatorH.value = withTiming(nextH, cfg);\n } else {\n indicatorX.value = nextX;\n indicatorY.value = nextY;\n indicatorW.value = nextW;\n indicatorH.value = nextH;\n hasPlacedRef.current = true;\n }\n indicatorOpacity.value = 1;\n },\n [indicatorH, indicatorOpacity, indicatorW, indicatorX, indicatorY, isLine, isPill, isVerticalLine],\n );\n\n const registerTravelLayout = useCallback(\n (id: string, layout: TabLayout) => {\n layoutsRef.current.set(id, layout);\n if (id === selectedKey) {\n moveIndicator(id, hasPlacedRef.current);\n }\n },\n [moveIndicator, selectedKey],\n );\n\n useEffect(() => {\n if (!useTravelIndicator) return;\n moveIndicator(selectedKey, true);\n }, [useTravelIndicator, selectedKey, moveIndicator]);\n\n // Plain Animated.View + inline absolute — NativeWind `styled(Animated.View)` drops\n // `position: absolute`, so the indicator joined the flex row and never traveled.\n const indicatorStyle = useAnimatedStyle(() => ({\n opacity: indicatorOpacity.value,\n width: indicatorW.value,\n height: indicatorH.value,\n transform: [{ translateX: indicatorX.value }, { translateY: indicatorY.value }],\n }));\n\n const indicatorColor = isPill\n ? color === \"primary\"\n ? primarySolid\n : brandSolid\n : brandLine;\n\n const travelIndicator = useTravelIndicator ? (\n <Animated.View\n pointerEvents=\"none\"\n style={[\n styles.indicatorBase,\n {\n backgroundColor: indicatorColor,\n borderRadius: isPill ? 9999 : 0,\n zIndex: isPill ? 0 : 1,\n },\n indicatorStyle,\n ]}\n />\n ) : null;\n\n const list = (\n <View\n className={cx(\n orientation === \"vertical\" ? tabsStyles.listVertical : tabsStyles.list,\n type === \"button-border\"\n ? cx(tabsStyles.listButtonBorder, size === \"md\" && tabsStyles.listButtonBorderMd)\n : type === \"button-minimal\"\n ? tabsStyles.listButtonMinimal\n : tabListStyles({ size, fullWidth })[type],\n orientation === \"horizontal\" && type === \"underline\" && \"relative\",\n useTravelIndicator && \"relative\",\n fullWidth && \"w-full\",\n className,\n )}\n style={useTravelIndicator ? styles.listTravel : undefined}\n >\n {orientation === \"horizontal\" && type === \"underline\" && (\n <View className=\"absolute right-0 bottom-0 left-0 h-px bg-border-secondary\" />\n )}\n {isPill && travelIndicator}\n {children ?? items?.map((item) => <Tab key={item.id} {...item} />)}\n {!isPill && travelIndicator}\n </View>\n );\n\n return (\n <TabListContext.Provider\n value={{\n size,\n type,\n color,\n travel,\n stroke,\n fullWidth,\n orientation,\n registerTravelLayout: useTravelIndicator ? registerTravelLayout : undefined,\n }}\n >\n {orientation === \"horizontal\" ? (\n <ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerClassName={fullWidth ? \"grow\" : undefined}>\n {list}\n </ScrollView>\n ) : (\n list\n )}\n </TabListContext.Provider>\n );\n};\n\nexport interface TabItemProps {\n id: string;\n label?: ReactNode;\n children?: ReactNode;\n badge?: number | string;\n icon?: FC<{ size?: number; color?: string }> | ReactNode;\n}\n\nexport const Tab: FC<TabItemProps> = ({ id, label, children, badge, icon: Icon }) => {\n const tabs = useContext(TabsContext);\n const { size, type, color, travel, stroke, fullWidth, orientation, registerTravelLayout } =\n useContext(TabListContext);\n const selected = tabs?.selectedKey === id;\n const isLineChrome = type === \"line\" || type === \"line-stacked\";\n const isStacked = type === \"line-stacked\";\n const isPill = type === \"button-pill\";\n const showPill = type === \"underline\" || isLineChrome || type === \"button-brand\" || isPill;\n const fg = useNativeVariable(selected ? \"--color-fg-primary\" : \"--color-fg-quaternary\") ?? \"#717680\";\n const brand = useNativeVariable(\"--color-fg-brand-secondary\") ?? \"#6941c6\";\n const fgPrimary = useNativeVariable(\"--color-fg-primary\") ?? \"#181d27\";\n const fgQuaternary = useNativeVariable(\"--color-fg-quaternary\") ?? \"#717680\";\n const onBrand = useNativeVariable(\"--color-text-primary_on-brand\") ?? \"#ffffff\";\n const fgWhite = useNativeVariable(\"--color-fg-white\") ?? \"#ffffff\";\n\n const iconColor = isPill\n ? selected\n ? color === \"primary\"\n ? fgWhite\n : onBrand\n : fgPrimary\n : selected && (type === \"underline\" || isLineChrome)\n ? brand\n : selected\n ? fg\n : fgQuaternary;\n\n const onLayout = useCallback(\n (event: LayoutChangeEvent) => {\n if (!registerTravelLayout) return;\n const { x, y, width, height } = event.nativeEvent.layout;\n if (width <= 0 || height <= 0) return;\n registerTravelLayout(id, { x, y, width, height });\n },\n [id, registerTravelLayout],\n );\n\n return (\n <Pressable\n accessibilityRole=\"tab\"\n accessibilityState={{ selected }}\n onPress={() => tabs?.setSelectedKey(id)}\n onLayout={onLayout}\n style={({ pressed }) => [\n orientation === \"horizontal\" ? { flexShrink: 0, zIndex: 1 } : { zIndex: 1 },\n isPill && {\n transform: [{ scale: pressed ? 0.98 : 1 }],\n },\n ]}\n className={cx(\n tabsStyles.item,\n orientation === \"vertical\" && tabsStyles.itemVertical,\n isStacked && tabsStyles.itemStacked,\n fullWidth && orientation === \"vertical\" && tabsStyles.itemFull,\n tabSizes[size][type],\n tabNativeItemState(type, selected, {\n travel: isLineTabType(type) ? travel : undefined,\n stroke: isPill ? stroke : undefined,\n }),\n )}\n >\n {isStacked && isReactComponent(Icon) && (\n <View className={tabsStyles.iconStacked}>\n <Icon size={20} color={iconColor} />\n {badge != null && (\n <View className={tabsStyles.badgeStacked}>\n <Badge size=\"sm\" type={showPill ? \"pill-color\" : \"modern\"} color={showPill && selected ? \"brand\" : \"gray\"}>\n {badge}\n </Badge>\n </View>\n )}\n </View>\n )}\n {!isStacked && isReactComponent(Icon) && <Icon size={tabSizes[size].icon} color={iconColor} />}\n <View className={cx(isStacked ? tabsStyles.labelStacked : tabsStyles.labelRow, !isLineChrome && type !== \"underline\" && \"px-0.5\")}>\n <Text\n numberOfLines={isStacked ? 2 : 1}\n className={cx(\n isStacked ? \"text-sm font-medium\" : size === \"sm\" ? \"text-sm font-semibold\" : \"text-md font-semibold\",\n isStacked && \"text-left\",\n isPill && selected\n ? pillTabColorStyles[color].nativeLabel\n : tabNativeLabelState(type, selected),\n )}\n >\n {children || label}\n </Text>\n {!isStacked && badge != null && (\n <Badge size=\"sm\" type={showPill ? \"pill-color\" : \"modern\"} color={showPill && selected ? \"brand\" : \"gray\"}>\n {badge}\n </Badge>\n )}\n </View>\n </Pressable>\n );\n};\n\nexport const TabPanel: FC<{ id: string; children?: ReactNode; className?: string }> = ({ id, children, className }) => {\n const tabs = useContext(TabsContext);\n if (tabs?.selectedKey !== id) return null;\n return <View className={className}>{children}</View>;\n};\n\nexport const Tabs = Object.assign(TabsRoot, {\n List: TabList,\n Item: Tab,\n Panel: TabPanel,\n});\n\n//////////////////////////////////////////////// STYLES\n\nconst styles = StyleSheet.create({\n listTravel: {\n overflow: \"visible\",\n },\n indicatorBase: {\n position: \"absolute\",\n top: 0,\n left: 0,\n },\n});\n"]}
@@ -1,5 +1,5 @@
1
1
  import { SelectItemProps } from './select-item.js';
2
- import { ReactNode, FC } from 'react';
2
+ import { FC, ReactNode } from 'react';
3
3
  import { S as SelectItemType } from './select-shared-Ah_SqhzA.js';
4
4
  import { a as SelectSize, b as SelectMobileOptions } from './select-BJtrES5I.js';
5
5
 
@@ -1,4 +1,4 @@
1
- import { createContext, forwardRef, useContext, useState, useMemo, isValidElement, useEffect } from 'react';
1
+ import { createContext, forwardRef, useState, useContext, useMemo, isValidElement, useEffect } from 'react';
2
2
  import { View, TextInput, Pressable, Text, ScrollView } from 'react-native-css/components';
3
3
  import { useNativeVariable } from 'react-native-css';
4
4
  import { MagnifyingGlassIcon } from 'phosphor-react-native/src/icons/MagnifyingGlass';
@@ -1,4 +1,4 @@
1
- import { ReactNode, FC } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
 
3
3
  declare const TEXTAREA_SIZES: readonly ["sm", "md"];
4
4
  type TextAreaSize = (typeof TEXTAREA_SIZES)[number];