@titan-design/react-ui 0.9.1 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { jsx as jsx$1, jsxs as jsxs$1, Fragment } from 'react/jsx-runtime';
2
2
  import { Pressable, ActivityIndicator, Text, View, TextInput, Platform, StyleSheet, Easing, Image, Modal as Modal$1, ScrollView, Animated } from 'react-native';
3
3
  import { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
- import React24, { forwardRef, useState, createContext, useMemo, useContext, useRef, useEffect, useCallback, useSyncExternalStore, Fragment as Fragment$1 } from 'react';
5
+ import React25, { forwardRef, useState, createContext, useContext, useMemo, useRef, useEffect, useCallback, useSyncExternalStore, Fragment as Fragment$1 } from 'react';
6
6
 
7
7
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
8
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
@@ -2558,6 +2558,40 @@ var audiobookPreset = {
2558
2558
  },
2559
2559
  rootClasses: ["atmosphere-warm", "grain"]
2560
2560
  };
2561
+ var SURFACE_LEVEL_TOKEN = {
2562
+ background: "background-base",
2563
+ base: "surface-base",
2564
+ elevated: "surface-elevated",
2565
+ raised: "surface-raised",
2566
+ overlay: "surface-overlay"
2567
+ };
2568
+ var ON_SURFACE_TOKEN = {
2569
+ primary: "text-primary",
2570
+ secondary: "text-secondary",
2571
+ tertiary: "text-tertiary"
2572
+ };
2573
+ var DEFAULT_CONTEXT = { mode: "dark", level: "base" };
2574
+ var SurfaceContext = createContext(DEFAULT_CONTEXT);
2575
+ function useSurface() {
2576
+ return useContext(SurfaceContext);
2577
+ }
2578
+ function useSurfaceMode() {
2579
+ return useContext(SurfaceContext).mode;
2580
+ }
2581
+ function onSurfaceColors(mode) {
2582
+ const c = getSemanticColors(mode);
2583
+ return {
2584
+ primary: c[ON_SURFACE_TOKEN.primary],
2585
+ secondary: c[ON_SURFACE_TOKEN.secondary],
2586
+ tertiary: c[ON_SURFACE_TOKEN.tertiary]
2587
+ };
2588
+ }
2589
+ function useOnSurfaceColor(role = "primary") {
2590
+ return getSemanticColors(useSurfaceMode())[ON_SURFACE_TOKEN[role]];
2591
+ }
2592
+ function surfaceBackground(level, mode) {
2593
+ return getSemanticColors(mode)[SURFACE_LEVEL_TOKEN[level]];
2594
+ }
2561
2595
  function getTheme() {
2562
2596
  if (typeof document === "undefined") return "dark";
2563
2597
  return document.documentElement.classList.contains("light") ? "light" : "dark";
@@ -3046,7 +3080,7 @@ function AvatarGroup({
3046
3080
  size = "md",
3047
3081
  className
3048
3082
  }) {
3049
- const childArray = React24.Children.toArray(children);
3083
+ const childArray = React25.Children.toArray(children);
3050
3084
  const visibleChildren = max ? childArray.slice(0, max) : childArray;
3051
3085
  const remainingCount = max ? Math.max(0, childArray.length - max) : 0;
3052
3086
  return /* @__PURE__ */ jsxs(View, { className: cn("flex-row", className), children: [
@@ -3057,7 +3091,7 @@ function AvatarGroup({
3057
3091
  "border-2 border-surface-base rounded-full",
3058
3092
  index > 0 && "-ml-2"
3059
3093
  ),
3060
- children: React24.isValidElement(child) ? React24.cloneElement(child, { size }) : child
3094
+ children: React25.isValidElement(child) ? React25.cloneElement(child, { size }) : child
3061
3095
  },
3062
3096
  index
3063
3097
  )),
@@ -3540,9 +3574,9 @@ function TabList({ children, className }) {
3540
3574
  variantStyles5[variant],
3541
3575
  className
3542
3576
  ),
3543
- children: React24.Children.map(children, (child, index) => {
3544
- if (React24.isValidElement(child)) {
3545
- return React24.cloneElement(child, { index });
3577
+ children: React25.Children.map(children, (child, index) => {
3578
+ if (React25.isValidElement(child)) {
3579
+ return React25.cloneElement(child, { index });
3546
3580
  }
3547
3581
  return child;
3548
3582
  })
@@ -3613,8 +3647,8 @@ function Tab({
3613
3647
  }
3614
3648
  function TabPanels({ children, className }) {
3615
3649
  const { activeIndex } = useContext(TabsContext);
3616
- return /* @__PURE__ */ jsx(View, { className: cn("flex-1", className), children: React24.Children.map(children, (child, index) => {
3617
- if (React24.isValidElement(child) && index === activeIndex) {
3650
+ return /* @__PURE__ */ jsx(View, { className: cn("flex-1", className), children: React25.Children.map(children, (child, index) => {
3651
+ if (React25.isValidElement(child) && index === activeIndex) {
3618
3652
  return child;
3619
3653
  }
3620
3654
  return null;
@@ -4014,9 +4048,9 @@ function Accordion({
4014
4048
  return newSet;
4015
4049
  });
4016
4050
  };
4017
- return /* @__PURE__ */ jsx(AccordionContext.Provider, { value: { openIndices, toggleIndex, allowMultiple }, children: /* @__PURE__ */ jsx(View, { className: cn("w-full divide-y divide-border", className), ...props, children: React24.Children.map(children, (child, index) => {
4018
- if (React24.isValidElement(child)) {
4019
- return React24.cloneElement(child, { index });
4051
+ return /* @__PURE__ */ jsx(AccordionContext.Provider, { value: { openIndices, toggleIndex, allowMultiple }, children: /* @__PURE__ */ jsx(View, { className: cn("w-full divide-y divide-border", className), ...props, children: React25.Children.map(children, (child, index) => {
4052
+ if (React25.isValidElement(child)) {
4053
+ return React25.cloneElement(child, { index });
4020
4054
  }
4021
4055
  return child;
4022
4056
  }) }) });
@@ -4024,9 +4058,9 @@ function Accordion({
4024
4058
  function AccordionItem({ index = 0, children, className }) {
4025
4059
  const { openIndices, toggleIndex } = useContext(AccordionContext);
4026
4060
  const isOpen = openIndices.has(index);
4027
- return /* @__PURE__ */ jsx(View, { className, children: React24.Children.map(children, (child) => {
4028
- if (React24.isValidElement(child)) {
4029
- return React24.cloneElement(child, {
4061
+ return /* @__PURE__ */ jsx(View, { className, children: React25.Children.map(children, (child) => {
4062
+ if (React25.isValidElement(child)) {
4063
+ return React25.cloneElement(child, {
4030
4064
  isOpen,
4031
4065
  onToggle: () => toggleIndex(index)
4032
4066
  });
@@ -4069,7 +4103,7 @@ function Breadcrumbs({
4069
4103
  children,
4070
4104
  ...props
4071
4105
  }) {
4072
- const items = React24.Children.toArray(children);
4106
+ const items = React25.Children.toArray(children);
4073
4107
  let displayItems = items;
4074
4108
  if (maxItems && items.length > maxItems) {
4075
4109
  const firstItem = items[0];
@@ -4655,7 +4689,7 @@ function ToolbarButton({
4655
4689
  }
4656
4690
  ],
4657
4691
  children: [
4658
- icon && /* @__PURE__ */ jsx(View, { className: "w-5 h-5 items-center justify-center", children: React24.isValidElement(icon) ? React24.cloneElement(icon, {
4692
+ icon && /* @__PURE__ */ jsx(View, { className: "w-5 h-5 items-center justify-center", children: React25.isValidElement(icon) ? React25.cloneElement(icon, {
4659
4693
  size: 20,
4660
4694
  width: 20,
4661
4695
  height: 20,
@@ -5188,7 +5222,7 @@ function ProgressSteps({
5188
5222
  }) {
5189
5223
  const { dot, connector } = stepSizeStyles[size];
5190
5224
  return /* @__PURE__ */ jsxs(View, { className: cn("w-full", className), ...props, children: [
5191
- /* @__PURE__ */ jsx(View, { className: "flex-row items-center", children: Array.from({ length: totalSteps }).map((_, index) => /* @__PURE__ */ jsxs(React24.Fragment, { children: [
5225
+ /* @__PURE__ */ jsx(View, { className: "flex-row items-center", children: Array.from({ length: totalSteps }).map((_, index) => /* @__PURE__ */ jsxs(React25.Fragment, { children: [
5192
5226
  /* @__PURE__ */ jsx(
5193
5227
  View,
5194
5228
  {
@@ -5256,7 +5290,7 @@ function ToastProvider({
5256
5290
  return id;
5257
5291
  }, [defaultDuration, maxToasts]);
5258
5292
  const removeToast = useCallback((id) => {
5259
- setToasts((prev) => prev.filter((t17) => t17.id !== id));
5293
+ setToasts((prev) => prev.filter((t16) => t16.id !== id));
5260
5294
  }, []);
5261
5295
  const removeAllToasts = useCallback(() => {
5262
5296
  setToasts([]);
@@ -5753,7 +5787,7 @@ function FormField({
5753
5787
  }) {
5754
5788
  const isInvalid = !!errorMessage;
5755
5789
  const isHorizontal = orientation === "horizontal";
5756
- const fieldId = React24.useId();
5790
+ const fieldId = React25.useId();
5757
5791
  const helperId = `${fieldId}-helper`;
5758
5792
  const errorId = `${fieldId}-error`;
5759
5793
  return /* @__PURE__ */ jsxs(
@@ -5794,10 +5828,10 @@ function FormField({
5794
5828
  }
5795
5829
  ),
5796
5830
  /* @__PURE__ */ jsxs(View, { className: cn(isHorizontal && "flex-1"), children: [
5797
- React24.Children.map(children, (child) => {
5798
- if (React24.isValidElement(child)) {
5831
+ React25.Children.map(children, (child) => {
5832
+ if (React25.isValidElement(child)) {
5799
5833
  const childProps = child.props;
5800
- return React24.cloneElement(child, {
5834
+ return React25.cloneElement(child, {
5801
5835
  accessibilityHint: errorMessage || helperText || childProps.accessibilityHint,
5802
5836
  accessibilityState: {
5803
5837
  ...childProps.accessibilityState,
@@ -6008,32 +6042,37 @@ function IconBox({
6008
6042
  }
6009
6043
  function Surface({
6010
6044
  elevation = 0,
6045
+ level,
6011
6046
  glowColor,
6012
6047
  glowIntensity,
6013
- theme = "dark",
6048
+ theme,
6049
+ rounded,
6014
6050
  className,
6015
6051
  style,
6016
6052
  children,
6017
6053
  ...props
6018
6054
  }) {
6019
- const baseColor = getBaseSurfaceColor(theme);
6020
- const surfaceColor = getElevationSurface(baseColor, elevation, theme);
6021
- const shadowStyle = getElevationShadow(baseColor, elevation, theme);
6055
+ const inherited = useSurface();
6056
+ const mode = theme ?? inherited.mode;
6057
+ const isPlane = level != null;
6058
+ const baseColor = getBaseSurfaceColor(mode);
6059
+ const backgroundColor = isPlane ? surfaceBackground(level, mode) : getElevationSurface(baseColor, elevation, mode);
6060
+ const shadowStyle = isPlane ? {} : getElevationShadow(baseColor, elevation, mode);
6022
6061
  const glowStyle = glowColor ? getGlowShadow(glowColor, glowIntensity) : {};
6023
- return /* @__PURE__ */ jsx(
6062
+ const applyRounded = rounded ?? !isPlane;
6063
+ const value = useMemo(
6064
+ () => ({ mode, level: level ?? inherited.level }),
6065
+ [mode, level, inherited.level]
6066
+ );
6067
+ return /* @__PURE__ */ jsx(SurfaceContext.Provider, { value, children: /* @__PURE__ */ jsx(
6024
6068
  View,
6025
6069
  {
6026
- className: cn("rounded-2xl", className),
6027
- style: [
6028
- { backgroundColor: surfaceColor },
6029
- shadowStyle,
6030
- glowStyle,
6031
- style
6032
- ],
6070
+ className: cn(applyRounded && "rounded-2xl", className),
6071
+ style: [{ backgroundColor }, shadowStyle, glowStyle, style],
6033
6072
  ...props,
6034
6073
  children
6035
6074
  }
6036
- );
6075
+ ) });
6037
6076
  }
6038
6077
  function ListItem({ className, children, onPress, ...props }) {
6039
6078
  const Container = onPress ? Pressable : View;
@@ -6758,11 +6797,11 @@ function Stepper({
6758
6797
  className
6759
6798
  ),
6760
6799
  ...props,
6761
- children: React24.Children.map(children, (child, index) => {
6762
- if (React24.isValidElement(child)) {
6800
+ children: React25.Children.map(children, (child, index) => {
6801
+ if (React25.isValidElement(child)) {
6763
6802
  return /* @__PURE__ */ jsxs(Fragment, { children: [
6764
- React24.cloneElement(child, { index }),
6765
- index < React24.Children.count(children) - 1 && /* @__PURE__ */ jsx(StepConnector, { index })
6803
+ React25.cloneElement(child, { index }),
6804
+ index < React25.Children.count(children) - 1 && /* @__PURE__ */ jsx(StepConnector, { index })
6766
6805
  ] });
6767
6806
  }
6768
6807
  return child;
@@ -6804,9 +6843,9 @@ function Step({ index = 0, status, className, children }) {
6804
6843
  orientation === "horizontal" ? "items-center" : "flex-row items-start",
6805
6844
  className
6806
6845
  ),
6807
- children: React24.Children.map(children, (child) => {
6808
- if (React24.isValidElement(child)) {
6809
- return React24.cloneElement(child, {
6846
+ children: React25.Children.map(children, (child) => {
6847
+ if (React25.isValidElement(child)) {
6848
+ return React25.cloneElement(child, {
6810
6849
  status: derivedStatus,
6811
6850
  index
6812
6851
  });
@@ -7204,8 +7243,8 @@ function MetricGroup({
7204
7243
  children,
7205
7244
  ...props
7206
7245
  }) {
7207
- const items = React24.Children.toArray(children);
7208
- return /* @__PURE__ */ jsx(View, { className: cn("flex-row items-center", className), ...props, children: items.map((child, i) => /* @__PURE__ */ jsxs(React24.Fragment, { children: [
7246
+ const items = React25.Children.toArray(children);
7247
+ return /* @__PURE__ */ jsx(View, { className: cn("flex-row items-center", className), ...props, children: items.map((child, i) => /* @__PURE__ */ jsxs(React25.Fragment, { children: [
7209
7248
  /* @__PURE__ */ jsx(View, { className: "flex-1 items-center", children: child }),
7210
7249
  i < items.length - 1 && /* @__PURE__ */ jsx(
7211
7250
  View,
@@ -10423,7 +10462,8 @@ function ExerciseIndicator({ kind, onPress, className, ...props }) {
10423
10462
  return chip;
10424
10463
  }
10425
10464
  function headingLabel(name, sets, reps, load, unit) {
10426
- return `${name}, ${sets}\xD7${reps} @ ${roundWeight(load)} ${unit}`;
10465
+ const loadLabel = typeof load === "number" ? roundWeight(load) : load;
10466
+ return `${name}, ${sets}\xD7${reps} @ ${loadLabel} ${unit}`;
10427
10467
  }
10428
10468
  function ExerciseHeading({
10429
10469
  name,
@@ -10857,8 +10897,6 @@ function ExerciseCard({
10857
10897
  if (upcoming) return /* @__PURE__ */ jsx(UpcomingCard, { ...rest, onToggle });
10858
10898
  return isExpanded ? /* @__PURE__ */ jsx(ExpandedCard, { ...rest, onToggle }) : /* @__PURE__ */ jsx(CollapsedCard, { ...rest, onToggle });
10859
10899
  }
10860
- var t9 = getSemanticColors("dark");
10861
- var RAISED = primitiveColors.charcoal[400];
10862
10900
  var BAR_HEIGHT = 9;
10863
10901
  var BAR_GAP = 3;
10864
10902
  function SessionHeader({
@@ -10876,17 +10914,18 @@ function SessionHeader({
10876
10914
  }) {
10877
10915
  const upcoming = next != null;
10878
10916
  const totalSets = plan.reduce((sum, e) => sum + e.sets, 0);
10917
+ const onSurface = onSurfaceColors(useSurfaceMode());
10879
10918
  const hasPace = !upcoming && budgetMs != null && elapsedMs != null;
10880
10919
  const target = hasPace ? elapsedMs / budgetMs : void 0;
10881
10920
  const setsLabel = upcoming ? `${totalSets} sets` : `${Math.floor(setsDone)}/${totalSets} sets`;
10882
- const setsLabelColor = upcoming ? t9["text-secondary"] : paceToneColor(paceTone(totalSets > 0 ? setsDone / totalSets : 0, target));
10921
+ const setsLabelColor = upcoming ? onSurface.secondary : paceToneColor(paceTone(totalSets > 0 ? setsDone / totalSets : 0, target));
10883
10922
  return /* @__PURE__ */ jsxs(
10884
- View,
10923
+ Surface,
10885
10924
  {
10925
+ level: "background",
10886
10926
  className,
10887
10927
  style: [
10888
10928
  {
10889
- backgroundColor: RAISED,
10890
10929
  paddingTop: 11,
10891
10930
  paddingRight: 12,
10892
10931
  paddingBottom: 12,
@@ -10907,7 +10946,7 @@ function SessionHeader({
10907
10946
  lineHeight: 18,
10908
10947
  fontWeight: "700",
10909
10948
  fontFamily: '"Space Grotesk", sans-serif',
10910
- color: t9["text-primary"],
10949
+ color: onSurface.primary,
10911
10950
  marginBottom: 10
10912
10951
  },
10913
10952
  testID: "session-rail-title",
@@ -10963,8 +11002,7 @@ function SessionHeader({
10963
11002
  }
10964
11003
  );
10965
11004
  }
10966
- var INSET = primitiveColors.charcoal[800];
10967
- var DIVIDER = primitiveColors.charcoal[500];
11005
+ var DIVIDER = primitiveColors.charcoal[300];
10968
11006
  var DEFAULT_WIDTH = 246;
10969
11007
  function SessionRail({
10970
11008
  title,
@@ -10983,10 +11021,11 @@ function SessionRail({
10983
11021
  ...props
10984
11022
  }) {
10985
11023
  return /* @__PURE__ */ jsxs(
10986
- View,
11024
+ Surface,
10987
11025
  {
11026
+ level: "elevated",
10988
11027
  className,
10989
- style: [{ width, flexDirection: "column", backgroundColor: INSET }, style],
11028
+ style: [{ width, flexDirection: "column" }, style],
10990
11029
  testID: "session-rail",
10991
11030
  ...props,
10992
11031
  children: [
@@ -10994,7 +11033,7 @@ function SessionRail({
10994
11033
  SessionHeader,
10995
11034
  {
10996
11035
  title,
10997
- plan: exercises.map((ex) => ({ name: ex.name, sets: ex.summary.sets })),
11036
+ plan: exercises.map((ex) => ({ name: ex.name, sets: ex.plannedSets ?? ex.summary.sets })),
10998
11037
  setsDone,
10999
11038
  elapsedMs,
11000
11039
  budgetMs,
@@ -11004,9 +11043,10 @@ function SessionRail({
11004
11043
  }
11005
11044
  ),
11006
11045
  /* @__PURE__ */ jsx(
11007
- View,
11046
+ Surface,
11008
11047
  {
11009
- style: [{ flex: 1, backgroundColor: INSET }, neumorphicShadows.charcoal.pressed.subtle],
11048
+ level: "elevated",
11049
+ style: [{ flex: 1 }, neumorphicShadows.charcoal.pressed.subtle],
11010
11050
  testID: "session-rail-list",
11011
11051
  children: exercises.map((ex, i) => /* @__PURE__ */ jsx(
11012
11052
  View,
@@ -11302,10 +11342,10 @@ function WeekRow({
11302
11342
  }
11303
11343
  );
11304
11344
  }
11305
- var t10 = getSemanticColors("dark");
11345
+ var t9 = getSemanticColors("dark");
11306
11346
  var COLORS = {
11307
- statusSuccess: t10["status-success"],
11308
- brandPrimary: t10["brand-primary"],
11347
+ statusSuccess: t9["status-success"],
11348
+ brandPrimary: t9["brand-primary"],
11309
11349
  borderDefault: "#1F1F1F",
11310
11350
  brandPrimarySubtle: "rgba(255,121,0,0.06)"
11311
11351
  };
@@ -11789,12 +11829,12 @@ function PrHistoryModal({
11789
11829
  }
11790
11830
  );
11791
11831
  }
11792
- var t11 = getSemanticColors("dark");
11793
- var BRAND_PRIMARY9 = t11["brand-primary"];
11832
+ var t10 = getSemanticColors("dark");
11833
+ var BRAND_PRIMARY9 = t10["brand-primary"];
11794
11834
  var BRAND_PRIMARY_SUBTLE = "rgba(255,121,0,0.12)";
11795
- var STATUS_SUCCESS2 = t11["status-success"];
11796
- var STATUS_WARNING2 = t11["status-warning"];
11797
- var STATUS_ERROR2 = t11["status-error"];
11835
+ var STATUS_SUCCESS2 = t10["status-success"];
11836
+ var STATUS_WARNING2 = t10["status-warning"];
11837
+ var STATUS_ERROR2 = t10["status-error"];
11798
11838
  var EMOJI_SETS = {
11799
11839
  sleep: ["\u{1F634}", "\u{1F610}", "\u{1F642}", "\u{1F60A}", "\u{1F929}"],
11800
11840
  soreness: ["\u{1F635}", "\u{1F623}", "\u{1F610}", "\u{1F642}", "\u{1F4AA}"],
@@ -11984,13 +12024,13 @@ function ReadinessCheck({
11984
12024
  )
11985
12025
  ] }) });
11986
12026
  }
11987
- var t12 = getSemanticColors("dark");
11988
- var BRAND_PRIMARY10 = t12["brand-primary"];
12027
+ var t11 = getSemanticColors("dark");
12028
+ var BRAND_PRIMARY10 = t11["brand-primary"];
11989
12029
  var BRAND_PRIMARY_DARK2 = MESO_ACCENT_GRADIENT_DARK;
11990
12030
  var BRAND_PRIMARY_LIGHT2 = MESO_ACCENT_GRADIENT_LIGHT;
11991
- var SUCCESS = t12["status-success"];
11992
- var WARNING = t12["status-warning"];
11993
- var ERROR = t12["status-error"];
12031
+ var SUCCESS = t11["status-success"];
12032
+ var WARNING = t11["status-warning"];
12033
+ var ERROR = t11["status-error"];
11994
12034
  var ACCENT_STOPS2 = [BRAND_PRIMARY_DARK2, BRAND_PRIMARY10, BRAND_PRIMARY_LIGHT2];
11995
12035
  var CARD_GRADIENT = `linear-gradient(135deg, ${resolveColor("surface-elevated")} 0%, ${resolveColor("surface-raised")} 100%)`;
11996
12036
  var GAUGE_GRADIENT = "linear-gradient(90deg, rgba(46,213,115,0.25) 0%, rgba(249,180,21,0.25) 50%, rgba(209,67,67,0.25) 100%)";
@@ -12361,8 +12401,8 @@ var ERROR_PILL_BORDER = "rgba(209,67,67,0.20)";
12361
12401
  var PLOT_LEFT = 26;
12362
12402
  var TOOLTIP_WIDTH = 124;
12363
12403
  function timeOf(dateStr) {
12364
- const t17 = Date.parse(dateStr);
12365
- return Number.isNaN(t17) ? 0 : t17;
12404
+ const t16 = Date.parse(dateStr);
12405
+ return Number.isNaN(t16) ? 0 : t16;
12366
12406
  }
12367
12407
  function formatValue(value) {
12368
12408
  return `${Math.round(value)}`;
@@ -12851,10 +12891,10 @@ function StrengthTrendChart({
12851
12891
  }
12852
12892
  );
12853
12893
  }
12854
- var t13 = getSemanticColors("dark");
12855
- var STATUS_SUCCESS4 = t13["status-success"];
12856
- var STATUS_WARNING4 = t13["status-warning"];
12857
- var STATUS_INFO = t13["status-info"];
12894
+ var t12 = getSemanticColors("dark");
12895
+ var STATUS_SUCCESS4 = t12["status-success"];
12896
+ var STATUS_WARNING4 = t12["status-warning"];
12897
+ var STATUS_INFO = t12["status-info"];
12858
12898
  var DOT_BORDER = "#F3F4F6";
12859
12899
  var BAND_FILL = "rgba(46,213,115,0.1)";
12860
12900
  var BAND_EDGE = "rgba(46,213,115,0.45)";
@@ -12897,8 +12937,8 @@ function interpEdge(pixels, x, key) {
12897
12937
  const a = pixels[i];
12898
12938
  const b = pixels[i + 1];
12899
12939
  if (x >= a.x && x <= b.x) {
12900
- const t17 = b.x === a.x ? 0 : (x - a.x) / (b.x - a.x);
12901
- return a[key] + t17 * (b[key] - a[key]);
12940
+ const t16 = b.x === a.x ? 0 : (x - a.x) / (b.x - a.x);
12941
+ return a[key] + t16 * (b[key] - a[key]);
12902
12942
  }
12903
12943
  }
12904
12944
  return pixels[pixels.length - 1][key];
@@ -13228,13 +13268,13 @@ function CapacityBandChart({
13228
13268
  }
13229
13269
  );
13230
13270
  }
13231
- var t14 = getSemanticColors("dark");
13271
+ var t13 = getSemanticColors("dark");
13232
13272
  function glowShadow(color) {
13233
13273
  return `0 0 5px 1px ${alpha(color, 0.3)}, 0 0 10px 3px ${alpha(color, 0.12)}`;
13234
13274
  }
13235
13275
  var DEFAULT_TRACK_COLOR = primitiveColors.charcoal[200];
13236
13276
  var DEFAULT_MARKER_COLOR2 = primitiveColors.white;
13237
- var TICK_COLOR = t14["text-tertiary"];
13277
+ var TICK_COLOR = t13["text-tertiary"];
13238
13278
  var ZONE_SIZES = {
13239
13279
  default: {
13240
13280
  trackHeight: 14,
@@ -13417,7 +13457,7 @@ function ZoneTrack({
13417
13457
  ),
13418
13458
  ticks?.map((tick, i) => {
13419
13459
  const emphasized = tick.emphasized === true;
13420
- const lineColor = tick.color ?? (emphasized ? t14["brand-primary"] : TICK_COLOR);
13460
+ const lineColor = tick.color ?? (emphasized ? t13["brand-primary"] : TICK_COLOR);
13421
13461
  const lineWidth = emphasized ? s.tickLineEmphasized : s.tickLineNormal;
13422
13462
  return /* @__PURE__ */ jsx(
13423
13463
  View,
@@ -13448,7 +13488,7 @@ function ZoneTrack({
13448
13488
  if (tick.label == null) return null;
13449
13489
  const emphasized = tick.emphasized === true;
13450
13490
  if (!showTickLabel(i, emphasized)) return null;
13451
- const labelColor = tick.color ?? (emphasized ? t14["brand-primary"] : TICK_COLOR);
13491
+ const labelColor = tick.color ?? (emphasized ? t13["brand-primary"] : TICK_COLOR);
13452
13492
  const labelNode = /* @__PURE__ */ jsx(
13453
13493
  Text,
13454
13494
  {
@@ -13634,7 +13674,7 @@ function VolumeLandmarkBar({
13634
13674
  }
13635
13675
  );
13636
13676
  }
13637
- var t15 = getSemanticColors("dark");
13677
+ var t14 = getSemanticColors("dark");
13638
13678
  var statusToken = {
13639
13679
  productive: "status-success",
13640
13680
  threshold: "status-warning",
@@ -13651,7 +13691,7 @@ var defaultLabel = {
13651
13691
  stop: "Stop"
13652
13692
  };
13653
13693
  function statusPillColor(status) {
13654
- return t15[statusToken[status]];
13694
+ return t14[statusToken[status]];
13655
13695
  }
13656
13696
  function StatusPill2({ status, label, className, style, ...props }) {
13657
13697
  const color = statusPillColor(status);
@@ -13684,7 +13724,7 @@ function StatusPill2({ status, label, className, style, ...props }) {
13684
13724
  }
13685
13725
  );
13686
13726
  }
13687
- var t16 = getSemanticColors("dark");
13727
+ var t15 = getSemanticColors("dark");
13688
13728
  var categoryToken = {
13689
13729
  productive: null,
13690
13730
  threshold: "status-warning",
@@ -13697,7 +13737,7 @@ var floodOpacity = {
13697
13737
  };
13698
13738
  function liveAuraColor(category) {
13699
13739
  const token = categoryToken[category];
13700
- return token ? t16[token] : null;
13740
+ return token ? t15[token] : null;
13701
13741
  }
13702
13742
  function LiveAuraFrame({
13703
13743
  category,
@@ -13726,9 +13766,9 @@ function LiveAuraFrame({
13726
13766
  position: "relative",
13727
13767
  overflow: "hidden",
13728
13768
  borderRadius: 10,
13729
- backgroundColor: t16["background-base"],
13769
+ backgroundColor: t15["background-base"],
13730
13770
  borderWidth: 1,
13731
- borderColor: t16["border-default"]
13771
+ borderColor: t15["border-default"]
13732
13772
  },
13733
13773
  style
13734
13774
  ],
@@ -13955,28 +13995,28 @@ function Scatter({
13955
13995
  testID: "scatter-canvas",
13956
13996
  style: { position: "absolute", top: 0, left: 0, width, height, overflow: "hidden" },
13957
13997
  children: [
13958
- ticksOf(yd, TICK_COUNT).map((t17, i) => {
13959
- const y = toY(t17);
13998
+ ticksOf(yd, TICK_COUNT).map((t16, i) => {
13999
+ const y = toY(t16);
13960
14000
  return /* @__PURE__ */ jsx(
13961
14001
  View,
13962
14002
  {
13963
14003
  accessibilityElementsHidden: true,
13964
14004
  testID: "scatter-gridline-y",
13965
14005
  style: { position: "absolute", left: PLOT_LEFT2, width: innerW, top: y, height: 1, backgroundColor: GRID_LINE2 },
13966
- children: /* @__PURE__ */ jsx(Text, { className: "text-[9px] text-text-tertiary", style: { position: "absolute", left: -PLOT_LEFT2, top: -6, width: PLOT_LEFT2 - 6, textAlign: "right" }, children: formatTick(t17) })
14006
+ children: /* @__PURE__ */ jsx(Text, { className: "text-[9px] text-text-tertiary", style: { position: "absolute", left: -PLOT_LEFT2, top: -6, width: PLOT_LEFT2 - 6, textAlign: "right" }, children: formatTick(t16) })
13967
14007
  },
13968
14008
  `y-${i}`
13969
14009
  );
13970
14010
  }),
13971
- ticksOf(xd, TICK_COUNT).map((t17, i) => {
13972
- const x = toX(t17);
14011
+ ticksOf(xd, TICK_COUNT).map((t16, i) => {
14012
+ const x = toX(t16);
13973
14013
  return /* @__PURE__ */ jsx(
13974
14014
  View,
13975
14015
  {
13976
14016
  accessibilityElementsHidden: true,
13977
14017
  testID: "scatter-gridline-x",
13978
14018
  style: { position: "absolute", top: PLOT_TOP, height: innerH, left: x, width: 1, backgroundColor: GRID_LINE2 },
13979
- children: /* @__PURE__ */ jsx(Text, { className: "text-[9px] text-text-tertiary", style: { position: "absolute", top: innerH + 4, left: -16, width: 32, textAlign: "center" }, children: formatTick(t17) })
14019
+ children: /* @__PURE__ */ jsx(Text, { className: "text-[9px] text-text-tertiary", style: { position: "absolute", top: innerH + 4, left: -16, width: 32, textAlign: "center" }, children: formatTick(t16) })
13980
14020
  },
13981
14021
  `x-${i}`
13982
14022
  );
@@ -14111,23 +14151,23 @@ function Gauge2({
14111
14151
  testID: "gauge",
14112
14152
  ...props,
14113
14153
  children: [
14114
- ticks.map((t17) => /* @__PURE__ */ jsx(
14154
+ ticks.map((t16) => /* @__PURE__ */ jsx(
14115
14155
  View,
14116
14156
  {
14117
14157
  accessibilityElementsHidden: true,
14118
14158
  testID: "gauge-segment",
14119
14159
  style: {
14120
14160
  position: "absolute",
14121
- left: t17.left - tickThickness / 2,
14122
- top: t17.top - tickLength / 2,
14161
+ left: t16.left - tickThickness / 2,
14162
+ top: t16.top - tickLength / 2,
14123
14163
  width: tickThickness,
14124
14164
  height: tickLength,
14125
14165
  borderRadius: tickThickness / 2,
14126
- backgroundColor: t17.color,
14127
- transform: [{ rotate: t17.rotate }]
14166
+ backgroundColor: t16.color,
14167
+ transform: [{ rotate: t16.rotate }]
14128
14168
  }
14129
14169
  },
14130
- t17.key
14170
+ t16.key
14131
14171
  )),
14132
14172
  /* @__PURE__ */ jsxs(View, { style: { position: "absolute", top: 0, left: 0, width: size, height: size }, className: "items-center justify-center", children: [
14133
14173
  /* @__PURE__ */ jsxs(View, { className: "flex-row items-baseline gap-0.5", children: [
@@ -14377,7 +14417,8 @@ function NavItem({
14377
14417
  {
14378
14418
  variant: "button",
14379
14419
  color: "inherit",
14380
- className: cn("text-[8.5px] font-bold uppercase tracking-[0.4px]", labelColor),
14420
+ style: { fontSize: 8.5, lineHeight: 11 },
14421
+ className: cn("font-bold uppercase tracking-[0.4px]", labelColor),
14381
14422
  children: label
14382
14423
  }
14383
14424
  )
@@ -14442,21 +14483,20 @@ function DashboardShell({
14442
14483
  children,
14443
14484
  className
14444
14485
  }) {
14445
- return /* @__PURE__ */ jsxs(View, { className: cn("flex-1 flex-row bg-surface-base", className), children: [
14446
- /* @__PURE__ */ jsx(SideNav, { activeKey, items: navItems, liveKey, onNavigate }),
14447
- /* @__PURE__ */ jsxs(View, { className: "flex-1", children: [
14448
- /* @__PURE__ */ jsx(
14449
- TopBar,
14450
- {
14451
- state,
14452
- devices,
14453
- subtitle,
14454
- onSelectDevice
14455
- }
14456
- ),
14457
- /* @__PURE__ */ jsx(View, { className: "flex-1", children: children ?? /* @__PURE__ */ jsx(ContentPlaceholder, {}) })
14486
+ return (
14487
+ // Column: the TopBar spans the FULL width across the top, and the SideNav sits BELOW it
14488
+ // in the content row (not a full-height left rail). This keeps the brand/status band
14489
+ // unbroken edge-to-edge and lets the nav align under it. The shell is the outermost
14490
+ // Surface — it owns the base plane and seeds the on-surface colour context (mode) for
14491
+ // the whole dashboard tree.
14492
+ /* @__PURE__ */ jsxs(Surface, { level: "base", className: cn("flex-1", className), children: [
14493
+ /* @__PURE__ */ jsx(TopBar, { state, devices, subtitle, onSelectDevice }),
14494
+ /* @__PURE__ */ jsxs(View, { className: "flex-1 flex-row", children: [
14495
+ /* @__PURE__ */ jsx(SideNav, { activeKey, items: navItems, liveKey, onNavigate }),
14496
+ /* @__PURE__ */ jsx(View, { className: "flex-1", children: children ?? /* @__PURE__ */ jsx(ContentPlaceholder, {}) })
14497
+ ] })
14458
14498
  ] })
14459
- ] });
14499
+ );
14460
14500
  }
14461
14501
 
14462
14502
  // src/utils/form.ts
@@ -14547,6 +14587,6 @@ function composeValidators(...validators) {
14547
14587
  };
14548
14588
  }
14549
14589
 
14550
- export { Accordion, AccordionButton, AccordionItem, AccordionPanel, ActivityIcon, Alert, AlertDescription, AlertTitle, AlertTriangleIcon, Autocomplete, Avatar, AvatarBadge, AvatarGroup, AwardIcon, Badge, BadgeText, BaseBadge, BluetoothIcon, BrandLockup, BreadcrumbItem, Breadcrumbs, Button, ButtonIcon, ButtonSpinner, ButtonText, CATEGORICAL_CVD_SAFE_MAX, CapacityBandChart, Caption, Card, CardContent, CardDescription, CardFooter, CardHeader, CardSkeleton, CardTitle, Checkbox, CheckboxGroup, Chip, CircleSlashIcon, CircularProgress, CircularTimer, Collapse, CollapseButton, CollapseContent, DashboardShell, DataRow, DateTime, DeviationBar, DeviceIndicator, DeviceMenu, DeviceRow, Divider, Drawer, DrawerBody, DrawerFooter, DrawerHeader, DumbbellIcon, EmptyState, ExerciseCard, ExerciseCardHeading, ExerciseHeading, ExerciseIndicator, FatigueMeter, FormActions, FormField, FormRow, FormSection, Gauge2 as Gauge, HStack, Heading, HelpTip, HistoryIcon, INDICATOR_PRECEDENCE, IconBox, Indicator, InfoIcon, Input, InputBar, InputGroup, IntensityBar, Label, LabelWithHelp, LayersIcon, Link, ListItem, ListItemContent, ListItemDivider, ListItemIcon, ListItemTrailing, LiveAuraFrame, METRIC_FONT, Menu, MenuDivider, MenuGroup, MenuItem, MenuList, MenuTrigger, MesoCard, MesoProgressBar, MesoStatusCard, Metric, MetricCell, MetricGroup, MetricTiles, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalTitle, MuscleGroupChip, NavItem, Overline, Paragraph, PasswordInput, PersonStandingIcon, Pill, PlaceholderStrip, Popover, PopoverCloseButton, PopoverContent, PopoverTrigger, PrBadge, PrHistoryModal, Progress, ProgressSteps, Radio, RadioGroup, ReadinessCheck, RestTimer, SET_STRIP_VARIABLE_COLOR, SET_STRIP_ZONES, ScaleIcon, Scatter, ScheduleTiles, Section, SectionContent, SectionHeader, SegmentedBar, SegmentedProgressBar, Select, SessionHeader, SessionRail, SessionStatePill, SetBar, SetRow, SetStrip, SetTableHeader, SetsRepsLoad, SideNav, Sidebar, SidebarContent, SidebarDivider, SidebarFooter, SidebarHeader, SidebarItem, SidebarSection, Skeleton, SkeletonCard, SkeletonCircle, SkeletonListItem, SkeletonText, Sparkline, Spinner, Stack, StarIcon, StatusDot, StatusPill2 as StatusPill, StepContent, StepIndicator, StepLabel, Stepper, Step as StepperStep, StrengthTrendChart, SupersetWrapper, Surface, SvgIcon, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableBody, TableCell, TableHeader, TableHeaderCell, TablePagination, TableRow, Tabs, TempoDisplay, Tile, TimerReadout, Toast, ToastProvider, ToolbarButton, ToolbarButtonGroup, Tooltip, TopBar, Treemap, TrendingDownIcon, Typography, VStack, VelocityStrip, VoltrasMark, VolumeLandmarkBar, WeekRow, WeightBadge, WorkoutCard, WorkoutPill, ZoneTrack, alpha, applyThemePreset, audiobookPreset, bestTextColor, buttonSizes, calculateMeanVelocity, calculateVelocityLoss, categoricalPalette, cn, componentElevationRanges, composeValidators, createFieldId, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, defaultNavItems, defaultPreset, discreteRainbow, divergingScale, elevationSystem, formatDateTime, formatDuration, formatPrescription, formatSignedPct, formatVelocity, getBaseSurfaceColor, getCategoricalColor, getContrastText, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getFieldAriaProps, getFieldValidationProps, getGlowShadow, getHoverColors, getLuminance, getResultColor, getSemanticColors, getStatusColor, getThemeCSSVars, getValidatedElevation, getVelocityZoneColor, getVelocityZoneName, gluestackConfig, hasMaxLength, hasMinLength, hexToRgb, hsvToRgb, isCssPropertyManifest, isDark, isEmpty, isValidEmail, lightThemeCSSVars, lighten, linearGradient, liveAuraColor, neumorphicShadows, paceTone, paceToneColor, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveRamps, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, resolveColor, resolveIndicator, rgbToHex, rgbToHsv, roundRpe, roundTempo, roundWeight, rpeColor, semanticColorsDark, semanticColorsLight, semanticTypography, sequentialEffort, shadowColors, statusPillColor, surfaceGradient, useTable, useTimer, useToast, useToolbarButton, validateCssPropertyManifest, validationRules, velocityZoneColor };
14590
+ export { Accordion, AccordionButton, AccordionItem, AccordionPanel, ActivityIcon, Alert, AlertDescription, AlertTitle, AlertTriangleIcon, Autocomplete, Avatar, AvatarBadge, AvatarGroup, AwardIcon, Badge, BadgeText, BaseBadge, BluetoothIcon, BrandLockup, BreadcrumbItem, Breadcrumbs, Button, ButtonIcon, ButtonSpinner, ButtonText, CATEGORICAL_CVD_SAFE_MAX, CapacityBandChart, Caption, Card, CardContent, CardDescription, CardFooter, CardHeader, CardSkeleton, CardTitle, Checkbox, CheckboxGroup, Chip, CircleSlashIcon, CircularProgress, CircularTimer, Collapse, CollapseButton, CollapseContent, DashboardShell, DataRow, DateTime, DeviationBar, DeviceIndicator, DeviceMenu, DeviceRow, Divider, Drawer, DrawerBody, DrawerFooter, DrawerHeader, DumbbellIcon, EmptyState, ExerciseCard, ExerciseCardHeading, ExerciseHeading, ExerciseIndicator, FatigueMeter, FormActions, FormField, FormRow, FormSection, Gauge2 as Gauge, HStack, Heading, HelpTip, HistoryIcon, INDICATOR_PRECEDENCE, IconBox, Indicator, InfoIcon, Input, InputBar, InputGroup, IntensityBar, Label, LabelWithHelp, LayersIcon, Link, ListItem, ListItemContent, ListItemDivider, ListItemIcon, ListItemTrailing, LiveAuraFrame, METRIC_FONT, Menu, MenuDivider, MenuGroup, MenuItem, MenuList, MenuTrigger, MesoCard, MesoProgressBar, MesoStatusCard, Metric, MetricCell, MetricGroup, MetricTiles, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalTitle, MuscleGroupChip, NavItem, Overline, Paragraph, PasswordInput, PersonStandingIcon, Pill, PlaceholderStrip, Popover, PopoverCloseButton, PopoverContent, PopoverTrigger, PrBadge, PrHistoryModal, Progress, ProgressSteps, Radio, RadioGroup, ReadinessCheck, RestTimer, SET_STRIP_VARIABLE_COLOR, SET_STRIP_ZONES, SURFACE_LEVEL_TOKEN, ScaleIcon, Scatter, ScheduleTiles, Section, SectionContent, SectionHeader, SegmentedBar, SegmentedProgressBar, Select, SessionHeader, SessionRail, SessionStatePill, SetBar, SetRow, SetStrip, SetTableHeader, SetsRepsLoad, SideNav, Sidebar, SidebarContent, SidebarDivider, SidebarFooter, SidebarHeader, SidebarItem, SidebarSection, Skeleton, SkeletonCard, SkeletonCircle, SkeletonListItem, SkeletonText, Sparkline, Spinner, Stack, StarIcon, StatusDot, StatusPill2 as StatusPill, StepContent, StepIndicator, StepLabel, Stepper, Step as StepperStep, StrengthTrendChart, SupersetWrapper, Surface, SurfaceContext, SvgIcon, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableBody, TableCell, TableHeader, TableHeaderCell, TablePagination, TableRow, Tabs, TempoDisplay, Tile, TimerReadout, Toast, ToastProvider, ToolbarButton, ToolbarButtonGroup, Tooltip, TopBar, Treemap, TrendingDownIcon, Typography, VStack, VelocityStrip, VoltrasMark, VolumeLandmarkBar, WeekRow, WeightBadge, WorkoutCard, WorkoutPill, ZoneTrack, alpha, applyThemePreset, audiobookPreset, bestTextColor, buttonSizes, calculateMeanVelocity, calculateVelocityLoss, categoricalPalette, cn, componentElevationRanges, composeValidators, createFieldId, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, defaultNavItems, defaultPreset, discreteRainbow, divergingScale, elevationSystem, formatDateTime, formatDuration, formatPrescription, formatSignedPct, formatVelocity, getBaseSurfaceColor, getCategoricalColor, getContrastText, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getFieldAriaProps, getFieldValidationProps, getGlowShadow, getHoverColors, getLuminance, getResultColor, getSemanticColors, getStatusColor, getThemeCSSVars, getValidatedElevation, getVelocityZoneColor, getVelocityZoneName, gluestackConfig, hasMaxLength, hasMinLength, hexToRgb, hsvToRgb, isCssPropertyManifest, isDark, isEmpty, isValidEmail, lightThemeCSSVars, lighten, linearGradient, liveAuraColor, neumorphicShadows, onSurfaceColors, paceTone, paceToneColor, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveRamps, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, resolveColor, resolveIndicator, rgbToHex, rgbToHsv, roundRpe, roundTempo, roundWeight, rpeColor, semanticColorsDark, semanticColorsLight, semanticTypography, sequentialEffort, shadowColors, statusPillColor, surfaceBackground, surfaceGradient, useOnSurfaceColor, useSurface, useSurfaceMode, useTable, useTimer, useToast, useToolbarButton, validateCssPropertyManifest, validationRules, velocityZoneColor };
14551
14591
  //# sourceMappingURL=index.mjs.map
14552
14592
  //# sourceMappingURL=index.mjs.map