@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.d.mts +205 -126
- package/dist/index.d.ts +205 -126
- package/dist/index.js +302 -255
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +157 -117
- package/dist/index.mjs.map +1 -1
- package/dist/pages.js +2 -1
- package/dist/pages.js.map +1 -1
- package/dist/pages.mjs +2 -1
- package/dist/pages.mjs.map +1 -1
- package/dist/theme/index.d.mts +774 -769
- package/dist/theme/index.d.ts +774 -769
- package/dist/theme/index.js +6 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +7 -2
- package/dist/theme/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/custom/Workout/ExerciseHeading.tsx +5 -3
- package/src/components/custom/Workout/SessionHeader.tsx +11 -12
- package/src/components/custom/Workout/SessionRail.tsx +26 -13
- package/src/components/custom/Workout/SetsRepsLoad.tsx +2 -1
- package/src/components/shell/DashboardShell.tsx +11 -10
- package/src/components/shell/NavItem.tsx +6 -1
- package/src/components/ui/surface/Surface.stories.tsx +50 -1
- package/src/components/ui/surface/Surface.test.tsx +105 -1
- package/src/components/ui/surface/Surface.tsx +69 -19
- package/src/components/ui/surface/SurfaceContext.ts +86 -0
- package/src/components/ui/surface/index.ts +12 -0
- package/src/test/nativewind-stub.ts +13 -0
- package/src/theme/ThemeProvider.test.tsx +24 -0
- package/src/theme/ThemeProvider.tsx +23 -6
package/dist/index.js
CHANGED
|
@@ -4,11 +4,11 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var reactNative = require('react-native');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
|
-
var
|
|
7
|
+
var React25 = require('react');
|
|
8
8
|
|
|
9
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var React25__default = /*#__PURE__*/_interopDefault(React25);
|
|
12
12
|
|
|
13
13
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
14
14
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
@@ -1194,7 +1194,7 @@ var textSizeStyles = {
|
|
|
1194
1194
|
md: "text-sm",
|
|
1195
1195
|
lg: "text-base"
|
|
1196
1196
|
};
|
|
1197
|
-
var Button =
|
|
1197
|
+
var Button = React25.forwardRef(function Button2({
|
|
1198
1198
|
variant = "solid",
|
|
1199
1199
|
size = "md",
|
|
1200
1200
|
color = "primary",
|
|
@@ -1302,7 +1302,7 @@ var variantStyles2 = {
|
|
|
1302
1302
|
error: "border-border-input-error"
|
|
1303
1303
|
}
|
|
1304
1304
|
};
|
|
1305
|
-
var Input =
|
|
1305
|
+
var Input = React25.forwardRef(function Input2({
|
|
1306
1306
|
size = "md",
|
|
1307
1307
|
variant = "outline",
|
|
1308
1308
|
isDisabled = false,
|
|
@@ -1322,7 +1322,7 @@ var Input = React24.forwardRef(function Input2({
|
|
|
1322
1322
|
onBlur,
|
|
1323
1323
|
...props
|
|
1324
1324
|
}, ref) {
|
|
1325
|
-
const [isFocused, setIsFocused] =
|
|
1325
|
+
const [isFocused, setIsFocused] = React25.useState(false);
|
|
1326
1326
|
const handleFocus = (e) => {
|
|
1327
1327
|
setIsFocused(true);
|
|
1328
1328
|
onFocus?.(e);
|
|
@@ -1388,8 +1388,8 @@ var Input = React24.forwardRef(function Input2({
|
|
|
1388
1388
|
function InputGroup({ children, className }) {
|
|
1389
1389
|
return /* @__PURE__ */ jsx(reactNative.View, { className: cn("flex-col gap-4", className), children });
|
|
1390
1390
|
}
|
|
1391
|
-
var PasswordInput =
|
|
1392
|
-
const [isVisible, setIsVisible] =
|
|
1391
|
+
var PasswordInput = React25.forwardRef(function PasswordInput2({ showIcon, hideIcon, ...props }, ref) {
|
|
1392
|
+
const [isVisible, setIsVisible] = React25.useState(false);
|
|
1393
1393
|
const toggleVisibility = () => setIsVisible(!isVisible);
|
|
1394
1394
|
const defaultShowIcon = /* @__PURE__ */ jsxs(reactNative.View, { className: "w-5 h-5 items-center justify-center", children: [
|
|
1395
1395
|
/* @__PURE__ */ jsx(reactNative.View, { className: "w-3 h-3 rounded-full border-2 border-text-secondary" }),
|
|
@@ -2564,6 +2564,40 @@ var audiobookPreset = {
|
|
|
2564
2564
|
},
|
|
2565
2565
|
rootClasses: ["atmosphere-warm", "grain"]
|
|
2566
2566
|
};
|
|
2567
|
+
var SURFACE_LEVEL_TOKEN = {
|
|
2568
|
+
background: "background-base",
|
|
2569
|
+
base: "surface-base",
|
|
2570
|
+
elevated: "surface-elevated",
|
|
2571
|
+
raised: "surface-raised",
|
|
2572
|
+
overlay: "surface-overlay"
|
|
2573
|
+
};
|
|
2574
|
+
var ON_SURFACE_TOKEN = {
|
|
2575
|
+
primary: "text-primary",
|
|
2576
|
+
secondary: "text-secondary",
|
|
2577
|
+
tertiary: "text-tertiary"
|
|
2578
|
+
};
|
|
2579
|
+
var DEFAULT_CONTEXT = { mode: "dark", level: "base" };
|
|
2580
|
+
var SurfaceContext = React25.createContext(DEFAULT_CONTEXT);
|
|
2581
|
+
function useSurface() {
|
|
2582
|
+
return React25.useContext(SurfaceContext);
|
|
2583
|
+
}
|
|
2584
|
+
function useSurfaceMode() {
|
|
2585
|
+
return React25.useContext(SurfaceContext).mode;
|
|
2586
|
+
}
|
|
2587
|
+
function onSurfaceColors(mode) {
|
|
2588
|
+
const c = getSemanticColors(mode);
|
|
2589
|
+
return {
|
|
2590
|
+
primary: c[ON_SURFACE_TOKEN.primary],
|
|
2591
|
+
secondary: c[ON_SURFACE_TOKEN.secondary],
|
|
2592
|
+
tertiary: c[ON_SURFACE_TOKEN.tertiary]
|
|
2593
|
+
};
|
|
2594
|
+
}
|
|
2595
|
+
function useOnSurfaceColor(role = "primary") {
|
|
2596
|
+
return getSemanticColors(useSurfaceMode())[ON_SURFACE_TOKEN[role]];
|
|
2597
|
+
}
|
|
2598
|
+
function surfaceBackground(level, mode) {
|
|
2599
|
+
return getSemanticColors(mode)[SURFACE_LEVEL_TOKEN[level]];
|
|
2600
|
+
}
|
|
2567
2601
|
function getTheme() {
|
|
2568
2602
|
if (typeof document === "undefined") return "dark";
|
|
2569
2603
|
return document.documentElement.classList.contains("light") ? "light" : "dark";
|
|
@@ -2600,7 +2634,7 @@ function getServerSnapshot() {
|
|
|
2600
2634
|
return "dark";
|
|
2601
2635
|
}
|
|
2602
2636
|
function useTheme() {
|
|
2603
|
-
return
|
|
2637
|
+
return React25.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
2604
2638
|
}
|
|
2605
2639
|
|
|
2606
2640
|
// src/components/ui/card/Card.tsx
|
|
@@ -2633,17 +2667,17 @@ function Card({
|
|
|
2633
2667
|
...props
|
|
2634
2668
|
}) {
|
|
2635
2669
|
const isClickable = isInteractive || !!onPress;
|
|
2636
|
-
const [isHovered, setIsHovered] =
|
|
2670
|
+
const [isHovered, setIsHovered] = React25.useState(false);
|
|
2637
2671
|
const theme = useTheme();
|
|
2638
|
-
const elevationLevel =
|
|
2672
|
+
const elevationLevel = React25.useMemo(() => {
|
|
2639
2673
|
const validated = getValidatedElevation("card", elevation);
|
|
2640
2674
|
if (variant === "outline" || variant === "accent" || variant === "subtle") {
|
|
2641
2675
|
return 1;
|
|
2642
2676
|
}
|
|
2643
2677
|
return validated;
|
|
2644
2678
|
}, [variant, elevation]);
|
|
2645
|
-
const baseColor =
|
|
2646
|
-
const surfaceColor =
|
|
2679
|
+
const baseColor = React25.useMemo(() => getBaseSurfaceColor(theme), [theme]);
|
|
2680
|
+
const surfaceColor = React25.useMemo(() => {
|
|
2647
2681
|
if ((variant === "outline" || variant === "accent") && theme === "light") {
|
|
2648
2682
|
return "#FAFAFA";
|
|
2649
2683
|
}
|
|
@@ -2652,7 +2686,7 @@ function Card({
|
|
|
2652
2686
|
}
|
|
2653
2687
|
return getElevationSurface(baseColor, elevationLevel, theme);
|
|
2654
2688
|
}, [baseColor, elevationLevel, theme, variant]);
|
|
2655
|
-
const shadowStyle =
|
|
2689
|
+
const shadowStyle = React25.useMemo(() => {
|
|
2656
2690
|
const shouldHover = isHovered && isClickable;
|
|
2657
2691
|
return getElevationShadow(baseColor, elevationLevel, theme, shouldHover);
|
|
2658
2692
|
}, [baseColor, elevationLevel, theme, isHovered, isClickable]);
|
|
@@ -2683,11 +2717,11 @@ function Card({
|
|
|
2683
2717
|
isLoading && "pointer-events-none animate-pulse",
|
|
2684
2718
|
className
|
|
2685
2719
|
);
|
|
2686
|
-
const accentStyle =
|
|
2720
|
+
const accentStyle = React25.useMemo(() => variant === "accent" ? {
|
|
2687
2721
|
borderLeftWidth: accentWidth ?? 3,
|
|
2688
2722
|
borderLeftColor: accentColor ?? "var(--color-brand-primary)"
|
|
2689
2723
|
} : {}, [variant, accentWidth, accentColor]);
|
|
2690
|
-
const mergedStyle =
|
|
2724
|
+
const mergedStyle = React25.useMemo(() => {
|
|
2691
2725
|
const elevationStyle = {
|
|
2692
2726
|
backgroundColor: bgColor || surfaceColor,
|
|
2693
2727
|
borderRadius: 8,
|
|
@@ -3052,7 +3086,7 @@ function AvatarGroup({
|
|
|
3052
3086
|
size = "md",
|
|
3053
3087
|
className
|
|
3054
3088
|
}) {
|
|
3055
|
-
const childArray =
|
|
3089
|
+
const childArray = React25__default.default.Children.toArray(children);
|
|
3056
3090
|
const visibleChildren = max ? childArray.slice(0, max) : childArray;
|
|
3057
3091
|
const remainingCount = max ? Math.max(0, childArray.length - max) : 0;
|
|
3058
3092
|
return /* @__PURE__ */ jsxs(reactNative.View, { className: cn("flex-row", className), children: [
|
|
@@ -3063,7 +3097,7 @@ function AvatarGroup({
|
|
|
3063
3097
|
"border-2 border-surface-base rounded-full",
|
|
3064
3098
|
index > 0 && "-ml-2"
|
|
3065
3099
|
),
|
|
3066
|
-
children:
|
|
3100
|
+
children: React25__default.default.isValidElement(child) ? React25__default.default.cloneElement(child, { size }) : child
|
|
3067
3101
|
},
|
|
3068
3102
|
index
|
|
3069
3103
|
)),
|
|
@@ -3106,7 +3140,7 @@ var sizeStyles6 = {
|
|
|
3106
3140
|
md: { box: "w-5 h-5", icon: "w-3 h-3", label: "text-base" },
|
|
3107
3141
|
lg: { box: "w-6 h-6", icon: "w-3.5 h-3.5", label: "text-lg" }
|
|
3108
3142
|
};
|
|
3109
|
-
var Checkbox =
|
|
3143
|
+
var Checkbox = React25.forwardRef(function Checkbox2({
|
|
3110
3144
|
isChecked = false,
|
|
3111
3145
|
isIndeterminate = false,
|
|
3112
3146
|
isDisabled = false,
|
|
@@ -3192,7 +3226,7 @@ var sizeStyles7 = {
|
|
|
3192
3226
|
md: { track: "w-10 h-5", thumb: "w-4 h-4", translate: "translate-x-5" },
|
|
3193
3227
|
lg: { track: "w-12 h-6", thumb: "w-5 h-5", translate: "translate-x-6" }
|
|
3194
3228
|
};
|
|
3195
|
-
var Switch =
|
|
3229
|
+
var Switch = React25.forwardRef(function Switch2({
|
|
3196
3230
|
isChecked = false,
|
|
3197
3231
|
isDisabled = false,
|
|
3198
3232
|
size = "md",
|
|
@@ -3251,7 +3285,7 @@ var Switch = React24.forwardRef(function Switch2({
|
|
|
3251
3285
|
}
|
|
3252
3286
|
);
|
|
3253
3287
|
});
|
|
3254
|
-
var ModalContext =
|
|
3288
|
+
var ModalContext = React25.createContext({ size: "md", scrollBehavior: "outside" });
|
|
3255
3289
|
var sizeStyles8 = {
|
|
3256
3290
|
xs: "max-w-xs",
|
|
3257
3291
|
sm: "max-w-sm",
|
|
@@ -3309,7 +3343,7 @@ function Modal({
|
|
|
3309
3343
|
) });
|
|
3310
3344
|
}
|
|
3311
3345
|
function ModalContent({ children, className }) {
|
|
3312
|
-
const { size } =
|
|
3346
|
+
const { size } = React25.useContext(ModalContext);
|
|
3313
3347
|
return /* @__PURE__ */ jsx(
|
|
3314
3348
|
reactNative.Pressable,
|
|
3315
3349
|
{
|
|
@@ -3342,7 +3376,7 @@ function ModalTitle({ children, className }) {
|
|
|
3342
3376
|
);
|
|
3343
3377
|
}
|
|
3344
3378
|
function ModalCloseButton({ className }) {
|
|
3345
|
-
const { onClose } =
|
|
3379
|
+
const { onClose } = React25.useContext(ModalContext);
|
|
3346
3380
|
return /* @__PURE__ */ jsx(
|
|
3347
3381
|
reactNative.Pressable,
|
|
3348
3382
|
{
|
|
@@ -3358,7 +3392,7 @@ function ModalCloseButton({ className }) {
|
|
|
3358
3392
|
);
|
|
3359
3393
|
}
|
|
3360
3394
|
function ModalBody({ children, maxHeight, className }) {
|
|
3361
|
-
const { scrollBehavior } =
|
|
3395
|
+
const { scrollBehavior } = React25.useContext(ModalContext);
|
|
3362
3396
|
if (scrollBehavior === "inside") {
|
|
3363
3397
|
return /* @__PURE__ */ jsx(
|
|
3364
3398
|
reactNative.ScrollView,
|
|
@@ -3494,7 +3528,7 @@ function SkeletonListItem({
|
|
|
3494
3528
|
/* @__PURE__ */ jsx(reactNative.View, { className: "flex-1", children: /* @__PURE__ */ jsx(SkeletonText, { lines, animation }) })
|
|
3495
3529
|
] });
|
|
3496
3530
|
}
|
|
3497
|
-
var TabsContext =
|
|
3531
|
+
var TabsContext = React25.createContext({
|
|
3498
3532
|
activeIndex: 0,
|
|
3499
3533
|
setActiveIndex: () => {
|
|
3500
3534
|
},
|
|
@@ -3511,7 +3545,7 @@ function Tabs({
|
|
|
3511
3545
|
children,
|
|
3512
3546
|
...props
|
|
3513
3547
|
}) {
|
|
3514
|
-
const [internalIndex, setInternalIndex] =
|
|
3548
|
+
const [internalIndex, setInternalIndex] = React25.useState(defaultIndex);
|
|
3515
3549
|
const activeIndex = index ?? internalIndex;
|
|
3516
3550
|
const setActiveIndex = (newIndex) => {
|
|
3517
3551
|
if (index === void 0) {
|
|
@@ -3532,7 +3566,7 @@ function Tabs({
|
|
|
3532
3566
|
) });
|
|
3533
3567
|
}
|
|
3534
3568
|
function TabList({ children, className }) {
|
|
3535
|
-
const { variant, orientation } =
|
|
3569
|
+
const { variant, orientation } = React25.useContext(TabsContext);
|
|
3536
3570
|
const variantStyles5 = {
|
|
3537
3571
|
line: orientation === "horizontal" ? "border-b border-border" : "border-r border-border",
|
|
3538
3572
|
enclosed: "bg-surface-raised rounded-lg p-1",
|
|
@@ -3546,9 +3580,9 @@ function TabList({ children, className }) {
|
|
|
3546
3580
|
variantStyles5[variant],
|
|
3547
3581
|
className
|
|
3548
3582
|
),
|
|
3549
|
-
children:
|
|
3550
|
-
if (
|
|
3551
|
-
return
|
|
3583
|
+
children: React25__default.default.Children.map(children, (child, index) => {
|
|
3584
|
+
if (React25__default.default.isValidElement(child)) {
|
|
3585
|
+
return React25__default.default.cloneElement(child, { index });
|
|
3552
3586
|
}
|
|
3553
3587
|
return child;
|
|
3554
3588
|
})
|
|
@@ -3573,7 +3607,7 @@ function Tab({
|
|
|
3573
3607
|
className,
|
|
3574
3608
|
children
|
|
3575
3609
|
}) {
|
|
3576
|
-
const { activeIndex, setActiveIndex, variant, orientation } =
|
|
3610
|
+
const { activeIndex, setActiveIndex, variant, orientation } = React25.useContext(TabsContext);
|
|
3577
3611
|
const isActive = activeIndex === index;
|
|
3578
3612
|
const baseStyles = "font-medium text-sm transition-colors";
|
|
3579
3613
|
const variantStyles5 = {
|
|
@@ -3618,9 +3652,9 @@ function Tab({
|
|
|
3618
3652
|
);
|
|
3619
3653
|
}
|
|
3620
3654
|
function TabPanels({ children, className }) {
|
|
3621
|
-
const { activeIndex } =
|
|
3622
|
-
return /* @__PURE__ */ jsx(reactNative.View, { className: cn("flex-1", className), children:
|
|
3623
|
-
if (
|
|
3655
|
+
const { activeIndex } = React25.useContext(TabsContext);
|
|
3656
|
+
return /* @__PURE__ */ jsx(reactNative.View, { className: cn("flex-1", className), children: React25__default.default.Children.map(children, (child, index) => {
|
|
3657
|
+
if (React25__default.default.isValidElement(child) && index === activeIndex) {
|
|
3624
3658
|
return child;
|
|
3625
3659
|
}
|
|
3626
3660
|
return null;
|
|
@@ -3803,13 +3837,13 @@ function Tooltip({
|
|
|
3803
3837
|
usePortal: usePortalProp = false,
|
|
3804
3838
|
...props
|
|
3805
3839
|
}) {
|
|
3806
|
-
const [isVisible, setIsVisible] =
|
|
3807
|
-
const [portalPos, setPortalPos] =
|
|
3808
|
-
const openTimeoutRef =
|
|
3809
|
-
const closeTimeoutRef =
|
|
3810
|
-
const triggerRef =
|
|
3840
|
+
const [isVisible, setIsVisible] = React25.useState(false);
|
|
3841
|
+
const [portalPos, setPortalPos] = React25.useState(null);
|
|
3842
|
+
const openTimeoutRef = React25.useRef(null);
|
|
3843
|
+
const closeTimeoutRef = React25.useRef(null);
|
|
3844
|
+
const triggerRef = React25.useRef(null);
|
|
3811
3845
|
const isPortalMode = usePortalProp && reactNative.Platform.OS === "web" && !!createPortal;
|
|
3812
|
-
|
|
3846
|
+
React25.useEffect(() => {
|
|
3813
3847
|
if (!isVisible || !isPortalMode || !triggerRef.current) return;
|
|
3814
3848
|
const node = triggerRef.current;
|
|
3815
3849
|
const id = requestAnimationFrame(() => {
|
|
@@ -3943,7 +3977,7 @@ function Tooltip({
|
|
|
3943
3977
|
)
|
|
3944
3978
|
] });
|
|
3945
3979
|
}
|
|
3946
|
-
var CollapseContext =
|
|
3980
|
+
var CollapseContext = React25.createContext({
|
|
3947
3981
|
isOpen: false,
|
|
3948
3982
|
toggle: () => {
|
|
3949
3983
|
}
|
|
@@ -3956,7 +3990,7 @@ function Collapse({
|
|
|
3956
3990
|
children,
|
|
3957
3991
|
...props
|
|
3958
3992
|
}) {
|
|
3959
|
-
const [internalIsOpen, setInternalIsOpen] =
|
|
3993
|
+
const [internalIsOpen, setInternalIsOpen] = React25.useState(defaultIsOpen);
|
|
3960
3994
|
const isOpen = controlledIsOpen ?? internalIsOpen;
|
|
3961
3995
|
const toggle = () => {
|
|
3962
3996
|
const newState = !isOpen;
|
|
@@ -3968,7 +4002,7 @@ function Collapse({
|
|
|
3968
4002
|
return /* @__PURE__ */ jsx(CollapseContext.Provider, { value: { isOpen, toggle }, children: /* @__PURE__ */ jsx(reactNative.View, { className: cn("w-full", className), ...props, children }) });
|
|
3969
4003
|
}
|
|
3970
4004
|
function CollapseButton({ children, className }) {
|
|
3971
|
-
const { isOpen, toggle } =
|
|
4005
|
+
const { isOpen, toggle } = React25.useContext(CollapseContext);
|
|
3972
4006
|
return /* @__PURE__ */ jsxs(
|
|
3973
4007
|
reactNative.Pressable,
|
|
3974
4008
|
{
|
|
@@ -3988,11 +4022,11 @@ function CollapseButton({ children, className }) {
|
|
|
3988
4022
|
);
|
|
3989
4023
|
}
|
|
3990
4024
|
function CollapseContent({ children, className }) {
|
|
3991
|
-
const { isOpen } =
|
|
4025
|
+
const { isOpen } = React25.useContext(CollapseContext);
|
|
3992
4026
|
if (!isOpen) return null;
|
|
3993
4027
|
return /* @__PURE__ */ jsx(reactNative.View, { className: cn("overflow-hidden", className), children });
|
|
3994
4028
|
}
|
|
3995
|
-
var AccordionContext =
|
|
4029
|
+
var AccordionContext = React25.createContext({
|
|
3996
4030
|
openIndices: /* @__PURE__ */ new Set(),
|
|
3997
4031
|
toggleIndex: () => {
|
|
3998
4032
|
},
|
|
@@ -4005,7 +4039,7 @@ function Accordion({
|
|
|
4005
4039
|
children,
|
|
4006
4040
|
...props
|
|
4007
4041
|
}) {
|
|
4008
|
-
const [openIndices, setOpenIndices] =
|
|
4042
|
+
const [openIndices, setOpenIndices] = React25.useState(new Set(defaultIndex));
|
|
4009
4043
|
const toggleIndex = (index) => {
|
|
4010
4044
|
setOpenIndices((prev) => {
|
|
4011
4045
|
const newSet = new Set(prev);
|
|
@@ -4020,19 +4054,19 @@ function Accordion({
|
|
|
4020
4054
|
return newSet;
|
|
4021
4055
|
});
|
|
4022
4056
|
};
|
|
4023
|
-
return /* @__PURE__ */ jsx(AccordionContext.Provider, { value: { openIndices, toggleIndex, allowMultiple }, children: /* @__PURE__ */ jsx(reactNative.View, { className: cn("w-full divide-y divide-border", className), ...props, children:
|
|
4024
|
-
if (
|
|
4025
|
-
return
|
|
4057
|
+
return /* @__PURE__ */ jsx(AccordionContext.Provider, { value: { openIndices, toggleIndex, allowMultiple }, children: /* @__PURE__ */ jsx(reactNative.View, { className: cn("w-full divide-y divide-border", className), ...props, children: React25__default.default.Children.map(children, (child, index) => {
|
|
4058
|
+
if (React25__default.default.isValidElement(child)) {
|
|
4059
|
+
return React25__default.default.cloneElement(child, { index });
|
|
4026
4060
|
}
|
|
4027
4061
|
return child;
|
|
4028
4062
|
}) }) });
|
|
4029
4063
|
}
|
|
4030
4064
|
function AccordionItem({ index = 0, children, className }) {
|
|
4031
|
-
const { openIndices, toggleIndex } =
|
|
4065
|
+
const { openIndices, toggleIndex } = React25.useContext(AccordionContext);
|
|
4032
4066
|
const isOpen = openIndices.has(index);
|
|
4033
|
-
return /* @__PURE__ */ jsx(reactNative.View, { className, children:
|
|
4034
|
-
if (
|
|
4035
|
-
return
|
|
4067
|
+
return /* @__PURE__ */ jsx(reactNative.View, { className, children: React25__default.default.Children.map(children, (child) => {
|
|
4068
|
+
if (React25__default.default.isValidElement(child)) {
|
|
4069
|
+
return React25__default.default.cloneElement(child, {
|
|
4036
4070
|
isOpen,
|
|
4037
4071
|
onToggle: () => toggleIndex(index)
|
|
4038
4072
|
});
|
|
@@ -4075,7 +4109,7 @@ function Breadcrumbs({
|
|
|
4075
4109
|
children,
|
|
4076
4110
|
...props
|
|
4077
4111
|
}) {
|
|
4078
|
-
const items =
|
|
4112
|
+
const items = React25__default.default.Children.toArray(children);
|
|
4079
4113
|
let displayItems = items;
|
|
4080
4114
|
if (maxItems && items.length > maxItems) {
|
|
4081
4115
|
const firstItem = items[0];
|
|
@@ -4141,7 +4175,7 @@ function BreadcrumbItem({
|
|
|
4141
4175
|
function BreadcrumbEllipsis() {
|
|
4142
4176
|
return /* @__PURE__ */ jsx(reactNative.Text, { className: "text-sm text-text-tertiary", children: "..." });
|
|
4143
4177
|
}
|
|
4144
|
-
var PopoverContext =
|
|
4178
|
+
var PopoverContext = React25.createContext({
|
|
4145
4179
|
isOpen: false,
|
|
4146
4180
|
setIsOpen: () => {
|
|
4147
4181
|
},
|
|
@@ -4163,16 +4197,16 @@ function Popover({
|
|
|
4163
4197
|
children,
|
|
4164
4198
|
...props
|
|
4165
4199
|
}) {
|
|
4166
|
-
const [internalIsOpen, setInternalIsOpen] =
|
|
4200
|
+
const [internalIsOpen, setInternalIsOpen] = React25.useState(false);
|
|
4167
4201
|
const isOpen = controlledIsOpen ?? internalIsOpen;
|
|
4168
|
-
const closeTimerRef =
|
|
4169
|
-
const setIsOpen =
|
|
4202
|
+
const closeTimerRef = React25.useRef(null);
|
|
4203
|
+
const setIsOpen = React25.useCallback((open) => {
|
|
4170
4204
|
if (controlledIsOpen === void 0) {
|
|
4171
4205
|
setInternalIsOpen(open);
|
|
4172
4206
|
}
|
|
4173
4207
|
onOpenChange?.(open);
|
|
4174
4208
|
}, [controlledIsOpen, onOpenChange]);
|
|
4175
|
-
const handleHoverIn =
|
|
4209
|
+
const handleHoverIn = React25.useCallback(() => {
|
|
4176
4210
|
if (triggerMode !== "hover") return;
|
|
4177
4211
|
if (closeTimerRef.current) {
|
|
4178
4212
|
clearTimeout(closeTimerRef.current);
|
|
@@ -4180,7 +4214,7 @@ function Popover({
|
|
|
4180
4214
|
}
|
|
4181
4215
|
setIsOpen(true);
|
|
4182
4216
|
}, [triggerMode, setIsOpen]);
|
|
4183
|
-
const handleHoverOut =
|
|
4217
|
+
const handleHoverOut = React25.useCallback(() => {
|
|
4184
4218
|
if (triggerMode !== "hover") return;
|
|
4185
4219
|
closeTimerRef.current = setTimeout(() => {
|
|
4186
4220
|
setIsOpen(false);
|
|
@@ -4196,7 +4230,7 @@ function Popover({
|
|
|
4196
4230
|
);
|
|
4197
4231
|
}
|
|
4198
4232
|
function PopoverTrigger({ children, className }) {
|
|
4199
|
-
const { isOpen, setIsOpen, triggerMode, handleHoverIn, handleHoverOut } =
|
|
4233
|
+
const { isOpen, setIsOpen, triggerMode, handleHoverIn, handleHoverOut } = React25.useContext(PopoverContext);
|
|
4200
4234
|
const hoverProps = triggerMode === "hover" ? {
|
|
4201
4235
|
onHoverIn: handleHoverIn,
|
|
4202
4236
|
onHoverOut: handleHoverOut,
|
|
@@ -4222,7 +4256,7 @@ var SPACER_STYLES = {
|
|
|
4222
4256
|
right: { top: 0, bottom: 0, left: 0, width: 8, transform: "translateX(-100%)" }
|
|
4223
4257
|
};
|
|
4224
4258
|
function PopoverContent({ children, className }) {
|
|
4225
|
-
const { isOpen, setIsOpen, placement, triggerMode, handleHoverIn, handleHoverOut } =
|
|
4259
|
+
const { isOpen, setIsOpen, placement, triggerMode, handleHoverIn, handleHoverOut } = React25.useContext(PopoverContext);
|
|
4226
4260
|
if (!isOpen) return null;
|
|
4227
4261
|
const placementStyles3 = {
|
|
4228
4262
|
top: "bottom-full left-0 mb-2",
|
|
@@ -4277,7 +4311,7 @@ function PopoverContent({ children, className }) {
|
|
|
4277
4311
|
] });
|
|
4278
4312
|
}
|
|
4279
4313
|
function PopoverCloseButton({ children, className }) {
|
|
4280
|
-
const { setIsOpen } =
|
|
4314
|
+
const { setIsOpen } = React25.useContext(PopoverContext);
|
|
4281
4315
|
return /* @__PURE__ */ jsx(
|
|
4282
4316
|
reactNative.Pressable,
|
|
4283
4317
|
{
|
|
@@ -4289,7 +4323,7 @@ function PopoverCloseButton({ children, className }) {
|
|
|
4289
4323
|
}
|
|
4290
4324
|
);
|
|
4291
4325
|
}
|
|
4292
|
-
var MenuContext =
|
|
4326
|
+
var MenuContext = React25.createContext({
|
|
4293
4327
|
isOpen: false,
|
|
4294
4328
|
setIsOpen: () => {
|
|
4295
4329
|
},
|
|
@@ -4303,7 +4337,7 @@ function Menu({
|
|
|
4303
4337
|
children,
|
|
4304
4338
|
...props
|
|
4305
4339
|
}) {
|
|
4306
|
-
const [internalIsOpen, setInternalIsOpen] =
|
|
4340
|
+
const [internalIsOpen, setInternalIsOpen] = React25.useState(false);
|
|
4307
4341
|
const isOpen = controlledIsOpen ?? internalIsOpen;
|
|
4308
4342
|
const setIsOpen = (open) => {
|
|
4309
4343
|
if (controlledIsOpen === void 0) {
|
|
@@ -4315,7 +4349,7 @@ function Menu({
|
|
|
4315
4349
|
return /* @__PURE__ */ jsx(MenuContext.Provider, { value: { isOpen, setIsOpen, closeMenu }, children: /* @__PURE__ */ jsx(reactNative.View, { className: cn("relative", className), ...props, children }) });
|
|
4316
4350
|
}
|
|
4317
4351
|
function MenuTrigger({ children, className }) {
|
|
4318
|
-
const { isOpen, setIsOpen } =
|
|
4352
|
+
const { isOpen, setIsOpen } = React25.useContext(MenuContext);
|
|
4319
4353
|
return /* @__PURE__ */ jsx(
|
|
4320
4354
|
reactNative.Pressable,
|
|
4321
4355
|
{
|
|
@@ -4328,7 +4362,7 @@ function MenuTrigger({ children, className }) {
|
|
|
4328
4362
|
);
|
|
4329
4363
|
}
|
|
4330
4364
|
function MenuList({ children, className }) {
|
|
4331
|
-
const { isOpen, setIsOpen } =
|
|
4365
|
+
const { isOpen, setIsOpen } = React25.useContext(MenuContext);
|
|
4332
4366
|
if (!isOpen) return null;
|
|
4333
4367
|
return /* @__PURE__ */ jsxs(jsxRuntime.Fragment, { children: [
|
|
4334
4368
|
/* @__PURE__ */ jsx(
|
|
@@ -4362,7 +4396,7 @@ function MenuItem({
|
|
|
4362
4396
|
className,
|
|
4363
4397
|
children
|
|
4364
4398
|
}) {
|
|
4365
|
-
const { closeMenu } =
|
|
4399
|
+
const { closeMenu } = React25.useContext(MenuContext);
|
|
4366
4400
|
const handlePress = () => {
|
|
4367
4401
|
if (isDisabled) return;
|
|
4368
4402
|
onPress?.();
|
|
@@ -4406,7 +4440,7 @@ function MenuGroup({ label, children, className }) {
|
|
|
4406
4440
|
children
|
|
4407
4441
|
] });
|
|
4408
4442
|
}
|
|
4409
|
-
var SelectContext =
|
|
4443
|
+
var SelectContext = React25.createContext({
|
|
4410
4444
|
value: null,
|
|
4411
4445
|
isMulti: false,
|
|
4412
4446
|
isOpen: false,
|
|
@@ -4430,7 +4464,7 @@ function Select({
|
|
|
4430
4464
|
className,
|
|
4431
4465
|
...props
|
|
4432
4466
|
}) {
|
|
4433
|
-
const [isOpen, setIsOpen] =
|
|
4467
|
+
const [isOpen, setIsOpen] = React25.useState(false);
|
|
4434
4468
|
const selectValue = (val) => {
|
|
4435
4469
|
if (isMulti) {
|
|
4436
4470
|
const newValues = values.includes(val) ? values.filter((v) => v !== val) : [...values, val];
|
|
@@ -4533,7 +4567,7 @@ function Select({
|
|
|
4533
4567
|
] }) });
|
|
4534
4568
|
}
|
|
4535
4569
|
function SelectOption({ option }) {
|
|
4536
|
-
const { selectValue, isSelected, isMulti } =
|
|
4570
|
+
const { selectValue, isSelected, isMulti } = React25.useContext(SelectContext);
|
|
4537
4571
|
const selected = isSelected(option.value);
|
|
4538
4572
|
return /* @__PURE__ */ jsxs(
|
|
4539
4573
|
reactNative.Pressable,
|
|
@@ -4564,7 +4598,7 @@ function SelectOption({ option }) {
|
|
|
4564
4598
|
}
|
|
4565
4599
|
);
|
|
4566
4600
|
}
|
|
4567
|
-
var ToolbarButtonContext =
|
|
4601
|
+
var ToolbarButtonContext = React25.createContext({
|
|
4568
4602
|
isOpen: false,
|
|
4569
4603
|
setIsOpen: () => {
|
|
4570
4604
|
}
|
|
@@ -4597,16 +4631,16 @@ function ToolbarButton({
|
|
|
4597
4631
|
children,
|
|
4598
4632
|
...props
|
|
4599
4633
|
}) {
|
|
4600
|
-
const [isOpen, setIsOpen] =
|
|
4601
|
-
const [isHovered, setIsHovered] =
|
|
4602
|
-
const handlePress =
|
|
4634
|
+
const [isOpen, setIsOpen] = React25.useState(false);
|
|
4635
|
+
const [isHovered, setIsHovered] = React25.useState(false);
|
|
4636
|
+
const handlePress = React25.useCallback(() => {
|
|
4603
4637
|
if (isDisabled) return;
|
|
4604
4638
|
if (menuContent) {
|
|
4605
4639
|
setIsOpen((prev) => !prev);
|
|
4606
4640
|
}
|
|
4607
4641
|
onPress?.();
|
|
4608
4642
|
}, [isDisabled, menuContent, onPress]);
|
|
4609
|
-
const handleClose =
|
|
4643
|
+
const handleClose = React25.useCallback(() => {
|
|
4610
4644
|
setIsOpen(false);
|
|
4611
4645
|
}, []);
|
|
4612
4646
|
const selected = isActive === void 0 ? isOpen : isActive;
|
|
@@ -4661,7 +4695,7 @@ function ToolbarButton({
|
|
|
4661
4695
|
}
|
|
4662
4696
|
],
|
|
4663
4697
|
children: [
|
|
4664
|
-
icon && /* @__PURE__ */ jsx(reactNative.View, { className: "w-5 h-5 items-center justify-center", children:
|
|
4698
|
+
icon && /* @__PURE__ */ jsx(reactNative.View, { className: "w-5 h-5 items-center justify-center", children: React25__default.default.isValidElement(icon) ? React25__default.default.cloneElement(icon, {
|
|
4665
4699
|
size: 20,
|
|
4666
4700
|
width: 20,
|
|
4667
4701
|
height: 20,
|
|
@@ -4750,9 +4784,9 @@ function ToolbarButtonGroup({
|
|
|
4750
4784
|
);
|
|
4751
4785
|
}
|
|
4752
4786
|
function useToolbarButton() {
|
|
4753
|
-
return
|
|
4787
|
+
return React25.useContext(ToolbarButtonContext);
|
|
4754
4788
|
}
|
|
4755
|
-
var RadioGroupContext =
|
|
4789
|
+
var RadioGroupContext = React25.createContext(null);
|
|
4756
4790
|
var gapStyles2 = {
|
|
4757
4791
|
sm: "gap-2",
|
|
4758
4792
|
md: "gap-3",
|
|
@@ -4815,7 +4849,7 @@ function Radio({
|
|
|
4815
4849
|
children,
|
|
4816
4850
|
...props
|
|
4817
4851
|
}) {
|
|
4818
|
-
const context =
|
|
4852
|
+
const context = React25.useContext(RadioGroupContext);
|
|
4819
4853
|
if (!context) {
|
|
4820
4854
|
throw new Error("Radio must be used within a RadioGroup");
|
|
4821
4855
|
}
|
|
@@ -5194,7 +5228,7 @@ function ProgressSteps({
|
|
|
5194
5228
|
}) {
|
|
5195
5229
|
const { dot, connector } = stepSizeStyles[size];
|
|
5196
5230
|
return /* @__PURE__ */ jsxs(reactNative.View, { className: cn("w-full", className), ...props, children: [
|
|
5197
|
-
/* @__PURE__ */ jsx(reactNative.View, { className: "flex-row items-center", children: Array.from({ length: totalSteps }).map((_, index) => /* @__PURE__ */ jsxs(
|
|
5231
|
+
/* @__PURE__ */ jsx(reactNative.View, { className: "flex-row items-center", children: Array.from({ length: totalSteps }).map((_, index) => /* @__PURE__ */ jsxs(React25__default.default.Fragment, { children: [
|
|
5198
5232
|
/* @__PURE__ */ jsx(
|
|
5199
5233
|
reactNative.View,
|
|
5200
5234
|
{
|
|
@@ -5229,7 +5263,7 @@ function ProgressSteps({
|
|
|
5229
5263
|
)) })
|
|
5230
5264
|
] });
|
|
5231
5265
|
}
|
|
5232
|
-
var ToastContext =
|
|
5266
|
+
var ToastContext = React25.createContext(null);
|
|
5233
5267
|
var toastIdCounter = 0;
|
|
5234
5268
|
var positionStyles = {
|
|
5235
5269
|
"top": "top-4 left-1/2 -translate-x-1/2",
|
|
@@ -5245,8 +5279,8 @@ function ToastProvider({
|
|
|
5245
5279
|
maxToasts = 5,
|
|
5246
5280
|
children
|
|
5247
5281
|
}) {
|
|
5248
|
-
const [toasts, setToasts] =
|
|
5249
|
-
const addToast =
|
|
5282
|
+
const [toasts, setToasts] = React25.useState([]);
|
|
5283
|
+
const addToast = React25.useCallback((config) => {
|
|
5250
5284
|
const id = `toast-${++toastIdCounter}`;
|
|
5251
5285
|
const newToast = {
|
|
5252
5286
|
id,
|
|
@@ -5261,10 +5295,10 @@ function ToastProvider({
|
|
|
5261
5295
|
});
|
|
5262
5296
|
return id;
|
|
5263
5297
|
}, [defaultDuration, maxToasts]);
|
|
5264
|
-
const removeToast =
|
|
5265
|
-
setToasts((prev) => prev.filter((
|
|
5298
|
+
const removeToast = React25.useCallback((id) => {
|
|
5299
|
+
setToasts((prev) => prev.filter((t16) => t16.id !== id));
|
|
5266
5300
|
}, []);
|
|
5267
|
-
const removeAllToasts =
|
|
5301
|
+
const removeAllToasts = React25.useCallback(() => {
|
|
5268
5302
|
setToasts([]);
|
|
5269
5303
|
}, []);
|
|
5270
5304
|
return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: { toasts, addToast, removeToast, removeAllToasts }, children: [
|
|
@@ -5293,7 +5327,7 @@ function ToastProvider({
|
|
|
5293
5327
|
] });
|
|
5294
5328
|
}
|
|
5295
5329
|
function useToast() {
|
|
5296
|
-
const context =
|
|
5330
|
+
const context = React25.useContext(ToastContext);
|
|
5297
5331
|
if (!context) {
|
|
5298
5332
|
throw new Error("useToast must be used within a ToastProvider");
|
|
5299
5333
|
}
|
|
@@ -5337,7 +5371,7 @@ function ToastItem({
|
|
|
5337
5371
|
onClose
|
|
5338
5372
|
}) {
|
|
5339
5373
|
const { bg, border, icon } = statusStyles[status];
|
|
5340
|
-
|
|
5374
|
+
React25.useEffect(() => {
|
|
5341
5375
|
if (duration > 0) {
|
|
5342
5376
|
const timer = setTimeout(onClose, duration);
|
|
5343
5377
|
return () => clearTimeout(timer);
|
|
@@ -5439,18 +5473,18 @@ function Autocomplete({
|
|
|
5439
5473
|
inputProps,
|
|
5440
5474
|
...props
|
|
5441
5475
|
}) {
|
|
5442
|
-
const [inputValue, setInputValue] =
|
|
5443
|
-
const [isOpen, setIsOpen] =
|
|
5444
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
5445
|
-
const selectedOption =
|
|
5476
|
+
const [inputValue, setInputValue] = React25.useState("");
|
|
5477
|
+
const [isOpen, setIsOpen] = React25.useState(false);
|
|
5478
|
+
const [highlightedIndex, setHighlightedIndex] = React25.useState(-1);
|
|
5479
|
+
const selectedOption = React25.useMemo(
|
|
5446
5480
|
() => options.find((o) => o.value === value),
|
|
5447
5481
|
[options, value]
|
|
5448
5482
|
);
|
|
5449
|
-
const filteredOptions =
|
|
5483
|
+
const filteredOptions = React25.useMemo(() => {
|
|
5450
5484
|
if (inputValue.length < minChars) return [];
|
|
5451
5485
|
return options.filter((option) => filterFn(option, inputValue));
|
|
5452
5486
|
}, [options, inputValue, minChars, filterFn]);
|
|
5453
|
-
const handleInputChange =
|
|
5487
|
+
const handleInputChange = React25.useCallback(
|
|
5454
5488
|
(text) => {
|
|
5455
5489
|
setInputValue(text);
|
|
5456
5490
|
setIsOpen(true);
|
|
@@ -5459,7 +5493,7 @@ function Autocomplete({
|
|
|
5459
5493
|
},
|
|
5460
5494
|
[onInputChange]
|
|
5461
5495
|
);
|
|
5462
|
-
const handleSelectOption =
|
|
5496
|
+
const handleSelectOption = React25.useCallback(
|
|
5463
5497
|
(option) => {
|
|
5464
5498
|
if (option.isDisabled) return;
|
|
5465
5499
|
onChange?.(option.value);
|
|
@@ -5468,18 +5502,18 @@ function Autocomplete({
|
|
|
5468
5502
|
},
|
|
5469
5503
|
[onChange]
|
|
5470
5504
|
);
|
|
5471
|
-
const handleClear =
|
|
5505
|
+
const handleClear = React25.useCallback(() => {
|
|
5472
5506
|
onChange?.(null);
|
|
5473
5507
|
setInputValue("");
|
|
5474
5508
|
setIsOpen(false);
|
|
5475
5509
|
}, [onChange]);
|
|
5476
|
-
const handleFocus =
|
|
5510
|
+
const handleFocus = React25.useCallback(() => {
|
|
5477
5511
|
setIsOpen(true);
|
|
5478
5512
|
if (selectedOption && !inputValue) {
|
|
5479
5513
|
setInputValue(selectedOption.label);
|
|
5480
5514
|
}
|
|
5481
5515
|
}, [selectedOption, inputValue]);
|
|
5482
|
-
const handleBlur =
|
|
5516
|
+
const handleBlur = React25.useCallback(() => {
|
|
5483
5517
|
setTimeout(() => {
|
|
5484
5518
|
setIsOpen(false);
|
|
5485
5519
|
if (selectedOption) {
|
|
@@ -5653,7 +5687,7 @@ function HelpTip({
|
|
|
5653
5687
|
className,
|
|
5654
5688
|
...props
|
|
5655
5689
|
}) {
|
|
5656
|
-
const [internalIsOpen, setInternalIsOpen] =
|
|
5690
|
+
const [internalIsOpen, setInternalIsOpen] = React25.useState(false);
|
|
5657
5691
|
const isOpen = controlledIsOpen ?? internalIsOpen;
|
|
5658
5692
|
const { icon: iconSize, text: textSize } = sizeStyles13[size];
|
|
5659
5693
|
const handlePress = () => {
|
|
@@ -5759,7 +5793,7 @@ function FormField({
|
|
|
5759
5793
|
}) {
|
|
5760
5794
|
const isInvalid = !!errorMessage;
|
|
5761
5795
|
const isHorizontal = orientation === "horizontal";
|
|
5762
|
-
const fieldId =
|
|
5796
|
+
const fieldId = React25__default.default.useId();
|
|
5763
5797
|
const helperId = `${fieldId}-helper`;
|
|
5764
5798
|
const errorId = `${fieldId}-error`;
|
|
5765
5799
|
return /* @__PURE__ */ jsxs(
|
|
@@ -5800,10 +5834,10 @@ function FormField({
|
|
|
5800
5834
|
}
|
|
5801
5835
|
),
|
|
5802
5836
|
/* @__PURE__ */ jsxs(reactNative.View, { className: cn(isHorizontal && "flex-1"), children: [
|
|
5803
|
-
|
|
5804
|
-
if (
|
|
5837
|
+
React25__default.default.Children.map(children, (child) => {
|
|
5838
|
+
if (React25__default.default.isValidElement(child)) {
|
|
5805
5839
|
const childProps = child.props;
|
|
5806
|
-
return
|
|
5840
|
+
return React25__default.default.cloneElement(child, {
|
|
5807
5841
|
accessibilityHint: errorMessage || helperText || childProps.accessibilityHint,
|
|
5808
5842
|
accessibilityState: {
|
|
5809
5843
|
...childProps.accessibilityState,
|
|
@@ -6014,32 +6048,37 @@ function IconBox({
|
|
|
6014
6048
|
}
|
|
6015
6049
|
function Surface({
|
|
6016
6050
|
elevation = 0,
|
|
6051
|
+
level,
|
|
6017
6052
|
glowColor,
|
|
6018
6053
|
glowIntensity,
|
|
6019
|
-
theme
|
|
6054
|
+
theme,
|
|
6055
|
+
rounded,
|
|
6020
6056
|
className,
|
|
6021
6057
|
style,
|
|
6022
6058
|
children,
|
|
6023
6059
|
...props
|
|
6024
6060
|
}) {
|
|
6025
|
-
const
|
|
6026
|
-
const
|
|
6027
|
-
const
|
|
6061
|
+
const inherited = useSurface();
|
|
6062
|
+
const mode = theme ?? inherited.mode;
|
|
6063
|
+
const isPlane = level != null;
|
|
6064
|
+
const baseColor = getBaseSurfaceColor(mode);
|
|
6065
|
+
const backgroundColor = isPlane ? surfaceBackground(level, mode) : getElevationSurface(baseColor, elevation, mode);
|
|
6066
|
+
const shadowStyle = isPlane ? {} : getElevationShadow(baseColor, elevation, mode);
|
|
6028
6067
|
const glowStyle = glowColor ? getGlowShadow(glowColor, glowIntensity) : {};
|
|
6029
|
-
|
|
6068
|
+
const applyRounded = rounded ?? !isPlane;
|
|
6069
|
+
const value = React25.useMemo(
|
|
6070
|
+
() => ({ mode, level: level ?? inherited.level }),
|
|
6071
|
+
[mode, level, inherited.level]
|
|
6072
|
+
);
|
|
6073
|
+
return /* @__PURE__ */ jsx(SurfaceContext.Provider, { value, children: /* @__PURE__ */ jsx(
|
|
6030
6074
|
reactNative.View,
|
|
6031
6075
|
{
|
|
6032
|
-
className: cn("rounded-2xl", className),
|
|
6033
|
-
style: [
|
|
6034
|
-
{ backgroundColor: surfaceColor },
|
|
6035
|
-
shadowStyle,
|
|
6036
|
-
glowStyle,
|
|
6037
|
-
style
|
|
6038
|
-
],
|
|
6076
|
+
className: cn(applyRounded && "rounded-2xl", className),
|
|
6077
|
+
style: [{ backgroundColor }, shadowStyle, glowStyle, style],
|
|
6039
6078
|
...props,
|
|
6040
6079
|
children
|
|
6041
6080
|
}
|
|
6042
|
-
);
|
|
6081
|
+
) });
|
|
6043
6082
|
}
|
|
6044
6083
|
function ListItem({ className, children, onPress, ...props }) {
|
|
6045
6084
|
const Container = onPress ? reactNative.Pressable : reactNative.View;
|
|
@@ -6277,7 +6316,7 @@ function Label(props) {
|
|
|
6277
6316
|
function Overline(props) {
|
|
6278
6317
|
return /* @__PURE__ */ jsx(Typography, { variant: "overline", color: "secondary", ...props });
|
|
6279
6318
|
}
|
|
6280
|
-
var SidebarContext =
|
|
6319
|
+
var SidebarContext = React25.createContext({
|
|
6281
6320
|
isCollapsed: false
|
|
6282
6321
|
});
|
|
6283
6322
|
function Sidebar({
|
|
@@ -6321,7 +6360,7 @@ function SidebarFooter({ children, className }) {
|
|
|
6321
6360
|
return /* @__PURE__ */ jsx(reactNative.View, { className: cn("px-2 py-4 border-t border-border-subtle", className), children });
|
|
6322
6361
|
}
|
|
6323
6362
|
function SidebarSection({ title, children, className }) {
|
|
6324
|
-
const { isCollapsed } =
|
|
6363
|
+
const { isCollapsed } = React25.useContext(SidebarContext);
|
|
6325
6364
|
return /* @__PURE__ */ jsxs(reactNative.View, { className: cn("px-2 py-2", className), children: [
|
|
6326
6365
|
title && !isCollapsed && /* @__PURE__ */ jsx(reactNative.Text, { className: "px-3 py-2 text-xs font-semibold uppercase tracking-wider text-text-tertiary", children: title }),
|
|
6327
6366
|
/* @__PURE__ */ jsx(reactNative.View, { className: "gap-0.5", children })
|
|
@@ -6338,7 +6377,7 @@ function SidebarItem({
|
|
|
6338
6377
|
onPress,
|
|
6339
6378
|
...props
|
|
6340
6379
|
}) {
|
|
6341
|
-
const { isCollapsed, activeItem, onItemSelect } =
|
|
6380
|
+
const { isCollapsed, activeItem, onItemSelect } = React25.useContext(SidebarContext);
|
|
6342
6381
|
const isActive = activeItem === id;
|
|
6343
6382
|
const handlePress = (e) => {
|
|
6344
6383
|
onItemSelect?.(id);
|
|
@@ -6390,7 +6429,7 @@ function SidebarItem({
|
|
|
6390
6429
|
function SidebarDivider({ className }) {
|
|
6391
6430
|
return /* @__PURE__ */ jsx(reactNative.View, { className: cn("h-px mx-4 my-2 bg-border-subtle", className) });
|
|
6392
6431
|
}
|
|
6393
|
-
var TableContext =
|
|
6432
|
+
var TableContext = React25.createContext({
|
|
6394
6433
|
sortDirection: null,
|
|
6395
6434
|
selectedRows: /* @__PURE__ */ new Set(),
|
|
6396
6435
|
selectable: false,
|
|
@@ -6472,7 +6511,7 @@ function TableHeaderCell({
|
|
|
6472
6511
|
onPress,
|
|
6473
6512
|
...props
|
|
6474
6513
|
}) {
|
|
6475
|
-
const { sortColumn, sortDirection, onSort } =
|
|
6514
|
+
const { sortColumn, sortDirection, onSort } = React25.useContext(TableContext);
|
|
6476
6515
|
const isSorted = sortKey && sortColumn === sortKey;
|
|
6477
6516
|
const isSortable = !!sortKey && !!onSort;
|
|
6478
6517
|
const ariaSort = isSorted ? sortDirection === "asc" ? "ascending" : sortDirection === "desc" ? "descending" : "none" : "none";
|
|
@@ -6660,11 +6699,11 @@ function useTable({
|
|
|
6660
6699
|
defaultSortColumn,
|
|
6661
6700
|
defaultSortDirection = null
|
|
6662
6701
|
}) {
|
|
6663
|
-
const [page, setPage] =
|
|
6664
|
-
const [pageSize, setPageSize] =
|
|
6665
|
-
const [sortColumn, setSortColumn] =
|
|
6666
|
-
const [sortDirection, setSortDirection] =
|
|
6667
|
-
const sortedData =
|
|
6702
|
+
const [page, setPage] = React25.useState(0);
|
|
6703
|
+
const [pageSize, setPageSize] = React25.useState(defaultPageSize);
|
|
6704
|
+
const [sortColumn, setSortColumn] = React25.useState(defaultSortColumn);
|
|
6705
|
+
const [sortDirection, setSortDirection] = React25.useState(defaultSortDirection);
|
|
6706
|
+
const sortedData = React25.useMemo(() => {
|
|
6668
6707
|
if (!sortColumn || !sortDirection) return data;
|
|
6669
6708
|
return [...data].sort((a, b) => {
|
|
6670
6709
|
const aVal = a[sortColumn];
|
|
@@ -6676,7 +6715,7 @@ function useTable({
|
|
|
6676
6715
|
return sortDirection === "asc" ? comparison : -comparison;
|
|
6677
6716
|
});
|
|
6678
6717
|
}, [data, sortColumn, sortDirection]);
|
|
6679
|
-
const paginatedData =
|
|
6718
|
+
const paginatedData = React25.useMemo(() => {
|
|
6680
6719
|
const start = page * pageSize;
|
|
6681
6720
|
return sortedData.slice(start, start + pageSize);
|
|
6682
6721
|
}, [sortedData, page, pageSize]);
|
|
@@ -6745,7 +6784,7 @@ function EmptyState({
|
|
|
6745
6784
|
}
|
|
6746
6785
|
);
|
|
6747
6786
|
}
|
|
6748
|
-
var StepperContext =
|
|
6787
|
+
var StepperContext = React25.createContext({
|
|
6749
6788
|
activeStep: 0,
|
|
6750
6789
|
orientation: "horizontal"
|
|
6751
6790
|
});
|
|
@@ -6764,11 +6803,11 @@ function Stepper({
|
|
|
6764
6803
|
className
|
|
6765
6804
|
),
|
|
6766
6805
|
...props,
|
|
6767
|
-
children:
|
|
6768
|
-
if (
|
|
6806
|
+
children: React25__default.default.Children.map(children, (child, index) => {
|
|
6807
|
+
if (React25__default.default.isValidElement(child)) {
|
|
6769
6808
|
return /* @__PURE__ */ jsxs(jsxRuntime.Fragment, { children: [
|
|
6770
|
-
|
|
6771
|
-
index <
|
|
6809
|
+
React25__default.default.cloneElement(child, { index }),
|
|
6810
|
+
index < React25__default.default.Children.count(children) - 1 && /* @__PURE__ */ jsx(StepConnector, { index })
|
|
6772
6811
|
] });
|
|
6773
6812
|
}
|
|
6774
6813
|
return child;
|
|
@@ -6777,7 +6816,7 @@ function Stepper({
|
|
|
6777
6816
|
) });
|
|
6778
6817
|
}
|
|
6779
6818
|
function StepConnector({ index }) {
|
|
6780
|
-
const { activeStep, orientation } =
|
|
6819
|
+
const { activeStep, orientation } = React25.useContext(StepperContext);
|
|
6781
6820
|
const isCompleted = index < activeStep;
|
|
6782
6821
|
if (orientation === "horizontal") {
|
|
6783
6822
|
return /* @__PURE__ */ jsx(
|
|
@@ -6801,7 +6840,7 @@ function StepConnector({ index }) {
|
|
|
6801
6840
|
);
|
|
6802
6841
|
}
|
|
6803
6842
|
function Step({ index = 0, status, className, children }) {
|
|
6804
|
-
const { activeStep, orientation } =
|
|
6843
|
+
const { activeStep, orientation } = React25.useContext(StepperContext);
|
|
6805
6844
|
const derivedStatus = status || (index < activeStep ? "completed" : index === activeStep ? "active" : "upcoming");
|
|
6806
6845
|
return /* @__PURE__ */ jsx(
|
|
6807
6846
|
reactNative.View,
|
|
@@ -6810,9 +6849,9 @@ function Step({ index = 0, status, className, children }) {
|
|
|
6810
6849
|
orientation === "horizontal" ? "items-center" : "flex-row items-start",
|
|
6811
6850
|
className
|
|
6812
6851
|
),
|
|
6813
|
-
children:
|
|
6814
|
-
if (
|
|
6815
|
-
return
|
|
6852
|
+
children: React25__default.default.Children.map(children, (child) => {
|
|
6853
|
+
if (React25__default.default.isValidElement(child)) {
|
|
6854
|
+
return React25__default.default.cloneElement(child, {
|
|
6816
6855
|
status: derivedStatus,
|
|
6817
6856
|
index
|
|
6818
6857
|
});
|
|
@@ -6856,7 +6895,7 @@ function StepIndicator({
|
|
|
6856
6895
|
);
|
|
6857
6896
|
}
|
|
6858
6897
|
function StepLabel({ status = "upcoming", className, children }) {
|
|
6859
|
-
const { orientation } =
|
|
6898
|
+
const { orientation } = React25.useContext(StepperContext);
|
|
6860
6899
|
return /* @__PURE__ */ jsx(
|
|
6861
6900
|
reactNative.Text,
|
|
6862
6901
|
{
|
|
@@ -7015,8 +7054,8 @@ function DateTime({
|
|
|
7015
7054
|
className,
|
|
7016
7055
|
...props
|
|
7017
7056
|
}) {
|
|
7018
|
-
const [now, setNow] =
|
|
7019
|
-
|
|
7057
|
+
const [now, setNow] = React25.useState(() => Date.now());
|
|
7058
|
+
React25.useEffect(() => {
|
|
7020
7059
|
if (!live) return;
|
|
7021
7060
|
const id = setInterval(() => setNow(Date.now()), refreshMs);
|
|
7022
7061
|
return () => clearInterval(id);
|
|
@@ -7050,8 +7089,8 @@ function useTimer(options = {}) {
|
|
|
7050
7089
|
tickMs = 1e3
|
|
7051
7090
|
} = options;
|
|
7052
7091
|
const isControlled = controlledElapsedMs != null;
|
|
7053
|
-
const [internalElapsedMs, setInternalElapsedMs] =
|
|
7054
|
-
|
|
7092
|
+
const [internalElapsedMs, setInternalElapsedMs] = React25.useState(0);
|
|
7093
|
+
React25.useEffect(() => {
|
|
7055
7094
|
if (isControlled || !autoTick || !running) return;
|
|
7056
7095
|
const id = setInterval(() => {
|
|
7057
7096
|
setInternalElapsedMs((prev) => prev + tickMs);
|
|
@@ -7210,8 +7249,8 @@ function MetricGroup({
|
|
|
7210
7249
|
children,
|
|
7211
7250
|
...props
|
|
7212
7251
|
}) {
|
|
7213
|
-
const items =
|
|
7214
|
-
return /* @__PURE__ */ jsx(reactNative.View, { className: cn("flex-row items-center", className), ...props, children: items.map((child, i) => /* @__PURE__ */ jsxs(
|
|
7252
|
+
const items = React25__default.default.Children.toArray(children);
|
|
7253
|
+
return /* @__PURE__ */ jsx(reactNative.View, { className: cn("flex-row items-center", className), ...props, children: items.map((child, i) => /* @__PURE__ */ jsxs(React25__default.default.Fragment, { children: [
|
|
7215
7254
|
/* @__PURE__ */ jsx(reactNative.View, { className: "flex-1 items-center", children: child }),
|
|
7216
7255
|
i < items.length - 1 && /* @__PURE__ */ jsx(
|
|
7217
7256
|
reactNative.View,
|
|
@@ -7243,7 +7282,7 @@ function BaseBadge({
|
|
|
7243
7282
|
children,
|
|
7244
7283
|
...props
|
|
7245
7284
|
}) {
|
|
7246
|
-
const [scaleAnim] =
|
|
7285
|
+
const [scaleAnim] = React25.useState(() => new reactNative.Animated.Value(1));
|
|
7247
7286
|
const config = baseBadgeSizeConfig[size];
|
|
7248
7287
|
const colors = variantColors[variant];
|
|
7249
7288
|
const handlePressIn = () => {
|
|
@@ -7402,9 +7441,9 @@ function PrBadge({
|
|
|
7402
7441
|
...props
|
|
7403
7442
|
}) {
|
|
7404
7443
|
const resolvedLabel = labelProp ?? typeLabels[type];
|
|
7405
|
-
const [scale] =
|
|
7406
|
-
const [opacity] =
|
|
7407
|
-
|
|
7444
|
+
const [scale] = React25.useState(() => new reactNative.Animated.Value(animate ? 0.8 : 1));
|
|
7445
|
+
const [opacity] = React25.useState(() => new reactNative.Animated.Value(animate ? 0 : 1));
|
|
7446
|
+
React25.useEffect(() => {
|
|
7408
7447
|
if (!animate) return;
|
|
7409
7448
|
reactNative.Animated.parallel([
|
|
7410
7449
|
reactNative.Animated.timing(scale, {
|
|
@@ -7975,7 +8014,7 @@ function TempoDisplay({
|
|
|
7975
8014
|
className,
|
|
7976
8015
|
...props
|
|
7977
8016
|
}) {
|
|
7978
|
-
const [showTooltip, setShowTooltip] =
|
|
8017
|
+
const [showTooltip, setShowTooltip] = React25.useState(false);
|
|
7979
8018
|
const [eccentric, pauseBottom, concentric, pauseTop] = roundTempo(tempo);
|
|
7980
8019
|
const isSm = size === "sm";
|
|
7981
8020
|
const fontSize = fontSizeProp ?? (isSm ? 9 : 11);
|
|
@@ -7983,7 +8022,7 @@ function TempoDisplay({
|
|
|
7983
8022
|
const chromePadY = Math.round(fontSize * 0.3);
|
|
7984
8023
|
const chromeRadius = Math.round(fontSize * 0.4);
|
|
7985
8024
|
const labelFont = Math.max(9, Math.round(fontSize * 0.5));
|
|
7986
|
-
const handlePress =
|
|
8025
|
+
const handlePress = React25.useCallback(() => {
|
|
7987
8026
|
if (onPress) {
|
|
7988
8027
|
onPress();
|
|
7989
8028
|
}
|
|
@@ -8250,8 +8289,8 @@ function IntensityBar({
|
|
|
8250
8289
|
const pct2 = Math.round(Math.max(0, level) * 100);
|
|
8251
8290
|
const zone = zoneForPct(pct2);
|
|
8252
8291
|
const atTarget = isAtTarget(pct2, threshold);
|
|
8253
|
-
const [fillAnim] =
|
|
8254
|
-
|
|
8292
|
+
const [fillAnim] = React25.useState(() => new reactNative.Animated.Value(fillLevel));
|
|
8293
|
+
React25.useEffect(() => {
|
|
8255
8294
|
const animation = reactNative.Animated.timing(fillAnim, {
|
|
8256
8295
|
toValue: fillLevel,
|
|
8257
8296
|
duration: 250,
|
|
@@ -8405,8 +8444,8 @@ var textColors = {
|
|
|
8405
8444
|
deload: WORKOUT_PILL_DELOAD
|
|
8406
8445
|
};
|
|
8407
8446
|
function usePulse(enabled) {
|
|
8408
|
-
const [opacity] =
|
|
8409
|
-
|
|
8447
|
+
const [opacity] = React25.useState(() => new reactNative.Animated.Value(1));
|
|
8448
|
+
React25.useEffect(() => {
|
|
8410
8449
|
if (!enabled) {
|
|
8411
8450
|
opacity.setValue(1);
|
|
8412
8451
|
return;
|
|
@@ -8536,8 +8575,8 @@ var PULSE_HALF_MS = 950;
|
|
|
8536
8575
|
var PULSE_MIN_OPACITY = 0.45;
|
|
8537
8576
|
var SEGMENTED_BAR_GAP = 5;
|
|
8538
8577
|
function usePulse2(active) {
|
|
8539
|
-
const [value] =
|
|
8540
|
-
|
|
8578
|
+
const [value] = React25.useState(() => new reactNative.Animated.Value(0));
|
|
8579
|
+
React25.useEffect(() => {
|
|
8541
8580
|
if (!active) return;
|
|
8542
8581
|
const loop = reactNative.Animated.loop(
|
|
8543
8582
|
reactNative.Animated.sequence([
|
|
@@ -8962,8 +9001,8 @@ function getReducedMotionPreference() {
|
|
|
8962
9001
|
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
8963
9002
|
}
|
|
8964
9003
|
function usePrefersReducedMotion() {
|
|
8965
|
-
const [reduced, setReduced] =
|
|
8966
|
-
|
|
9004
|
+
const [reduced, setReduced] = React25.useState(getReducedMotionPreference);
|
|
9005
|
+
React25.useEffect(() => {
|
|
8967
9006
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
8968
9007
|
const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
8969
9008
|
const handler = () => setReduced(mq.matches);
|
|
@@ -8978,8 +9017,8 @@ var ANIMATION_EASING = reactNative.Easing.bezier(0.22, 1, 0.36, 1);
|
|
|
8978
9017
|
var POP_EASING = reactNative.Easing.bezier(0.34, 1.56, 0.64, 1);
|
|
8979
9018
|
function useLiveRepPop(active, liveRepIndex, liveVelocity, isNewPeak) {
|
|
8980
9019
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
8981
|
-
const [liveScale] =
|
|
8982
|
-
|
|
9020
|
+
const [liveScale] = React25.useState(() => new reactNative.Animated.Value(1));
|
|
9021
|
+
React25.useEffect(() => {
|
|
8983
9022
|
if (!active || liveRepIndex == null || liveVelocity == null) return;
|
|
8984
9023
|
if (prefersReducedMotion) {
|
|
8985
9024
|
liveScale.setValue(1);
|
|
@@ -9027,7 +9066,7 @@ function HeroVelocityChart({
|
|
|
9027
9066
|
}) {
|
|
9028
9067
|
const liveVelocity = liveRepIndex != null ? doneVelocities[liveRepIndex] : void 0;
|
|
9029
9068
|
const liveScale = useLiveRepPop(true, liveRepIndex, liveVelocity, isNewPeak);
|
|
9030
|
-
const [plotW, setPlotW] =
|
|
9069
|
+
const [plotW, setPlotW] = React25.useState(0);
|
|
9031
9070
|
const onPlotLayout = (e) => setPlotW(e.nativeEvent.layout.width);
|
|
9032
9071
|
const plotHeight = Math.max(0, height - HERO_LABEL_HEADROOM);
|
|
9033
9072
|
const barHeight = (velocity) => scaleDenom > 0 ? Math.max(HERO_MIN_BAR_HEIGHT, Math.min(1, velocity / scaleDenom) * plotHeight) : HERO_MIN_BAR_HEIGHT;
|
|
@@ -9201,9 +9240,9 @@ function VelocityStrip({
|
|
|
9201
9240
|
return SET_STRIP_VARIABLE_COLOR;
|
|
9202
9241
|
};
|
|
9203
9242
|
const meanZone = hasZones ? classifyBand(meanVelocity, zones)?.label ?? "" : getVelocityZoneName(meanVelocity);
|
|
9204
|
-
const [heightAnim] =
|
|
9205
|
-
const [labelOpacity] =
|
|
9206
|
-
const [infoOpacity] =
|
|
9243
|
+
const [heightAnim] = React25.useState(() => new reactNative.Animated.Value(expanded ? height : 3));
|
|
9244
|
+
const [labelOpacity] = React25.useState(() => new reactNative.Animated.Value(expanded ? 1 : 0));
|
|
9245
|
+
const [infoOpacity] = React25.useState(() => new reactNative.Animated.Value(expanded ? 1 : 0));
|
|
9207
9246
|
const liveVelocity = liveRepIndex != null ? doneVelocities[liveRepIndex] : void 0;
|
|
9208
9247
|
const isNewPeak = liveVelocity != null && maxVelocity > 0 && liveVelocity === maxVelocity;
|
|
9209
9248
|
const liveScale = useLiveRepPop(
|
|
@@ -9212,7 +9251,7 @@ function VelocityStrip({
|
|
|
9212
9251
|
liveVelocity,
|
|
9213
9252
|
isNewPeak
|
|
9214
9253
|
);
|
|
9215
|
-
|
|
9254
|
+
React25.useEffect(() => {
|
|
9216
9255
|
if (variant !== "expanded" || !framed) return;
|
|
9217
9256
|
reactNative.Animated.parallel([
|
|
9218
9257
|
reactNative.Animated.timing(heightAnim, {
|
|
@@ -10359,7 +10398,7 @@ function compactUntil(ms) {
|
|
|
10359
10398
|
return `${Math.round(d / 7)}w`;
|
|
10360
10399
|
}
|
|
10361
10400
|
function ScheduleTiles({ when, now, gap = 1, ...props }) {
|
|
10362
|
-
const [mountNow] =
|
|
10401
|
+
const [mountNow] = React25.useState(() => Date.now());
|
|
10363
10402
|
const reference = now ?? mountNow;
|
|
10364
10403
|
const whenMs = when instanceof Date ? when.getTime() : when;
|
|
10365
10404
|
const soon = whenMs - reference < DAY_MS;
|
|
@@ -10429,7 +10468,8 @@ function ExerciseIndicator({ kind, onPress, className, ...props }) {
|
|
|
10429
10468
|
return chip;
|
|
10430
10469
|
}
|
|
10431
10470
|
function headingLabel(name, sets, reps, load, unit) {
|
|
10432
|
-
|
|
10471
|
+
const loadLabel = typeof load === "number" ? roundWeight(load) : load;
|
|
10472
|
+
return `${name}, ${sets}\xD7${reps} @ ${loadLabel} ${unit}`;
|
|
10433
10473
|
}
|
|
10434
10474
|
function ExerciseHeading({
|
|
10435
10475
|
name,
|
|
@@ -10620,7 +10660,7 @@ function CollapsedCard({
|
|
|
10620
10660
|
totalPlannedSets,
|
|
10621
10661
|
supersetPosition
|
|
10622
10662
|
}) {
|
|
10623
|
-
const [pressed, setPressed] =
|
|
10663
|
+
const [pressed, setPressed] = React25.useState(false);
|
|
10624
10664
|
const completedSets = setVelocities?.length ?? 0;
|
|
10625
10665
|
const remaining = Math.max(0, (totalPlannedSets ?? 0) - completedSets);
|
|
10626
10666
|
const borderRadius = getSupersetBorderRadius(supersetPosition);
|
|
@@ -10852,7 +10892,7 @@ function ExerciseCard({
|
|
|
10852
10892
|
onExpandedChange,
|
|
10853
10893
|
...rest
|
|
10854
10894
|
}) {
|
|
10855
|
-
const [internalExpanded, setInternalExpanded] =
|
|
10895
|
+
const [internalExpanded, setInternalExpanded] = React25.useState(defaultExpanded ?? false);
|
|
10856
10896
|
const isControlled = expanded !== void 0;
|
|
10857
10897
|
const isExpanded = isControlled ? expanded : internalExpanded;
|
|
10858
10898
|
const onToggle = () => {
|
|
@@ -10863,8 +10903,6 @@ function ExerciseCard({
|
|
|
10863
10903
|
if (upcoming) return /* @__PURE__ */ jsx(UpcomingCard, { ...rest, onToggle });
|
|
10864
10904
|
return isExpanded ? /* @__PURE__ */ jsx(ExpandedCard, { ...rest, onToggle }) : /* @__PURE__ */ jsx(CollapsedCard, { ...rest, onToggle });
|
|
10865
10905
|
}
|
|
10866
|
-
var t9 = getSemanticColors("dark");
|
|
10867
|
-
var RAISED = primitiveColors.charcoal[400];
|
|
10868
10906
|
var BAR_HEIGHT = 9;
|
|
10869
10907
|
var BAR_GAP = 3;
|
|
10870
10908
|
function SessionHeader({
|
|
@@ -10882,17 +10920,18 @@ function SessionHeader({
|
|
|
10882
10920
|
}) {
|
|
10883
10921
|
const upcoming = next != null;
|
|
10884
10922
|
const totalSets = plan.reduce((sum, e) => sum + e.sets, 0);
|
|
10923
|
+
const onSurface = onSurfaceColors(useSurfaceMode());
|
|
10885
10924
|
const hasPace = !upcoming && budgetMs != null && elapsedMs != null;
|
|
10886
10925
|
const target = hasPace ? elapsedMs / budgetMs : void 0;
|
|
10887
10926
|
const setsLabel = upcoming ? `${totalSets} sets` : `${Math.floor(setsDone)}/${totalSets} sets`;
|
|
10888
|
-
const setsLabelColor = upcoming ?
|
|
10927
|
+
const setsLabelColor = upcoming ? onSurface.secondary : paceToneColor(paceTone(totalSets > 0 ? setsDone / totalSets : 0, target));
|
|
10889
10928
|
return /* @__PURE__ */ jsxs(
|
|
10890
|
-
|
|
10929
|
+
Surface,
|
|
10891
10930
|
{
|
|
10931
|
+
level: "background",
|
|
10892
10932
|
className,
|
|
10893
10933
|
style: [
|
|
10894
10934
|
{
|
|
10895
|
-
backgroundColor: RAISED,
|
|
10896
10935
|
paddingTop: 11,
|
|
10897
10936
|
paddingRight: 12,
|
|
10898
10937
|
paddingBottom: 12,
|
|
@@ -10913,7 +10952,7 @@ function SessionHeader({
|
|
|
10913
10952
|
lineHeight: 18,
|
|
10914
10953
|
fontWeight: "700",
|
|
10915
10954
|
fontFamily: '"Space Grotesk", sans-serif',
|
|
10916
|
-
color:
|
|
10955
|
+
color: onSurface.primary,
|
|
10917
10956
|
marginBottom: 10
|
|
10918
10957
|
},
|
|
10919
10958
|
testID: "session-rail-title",
|
|
@@ -10969,8 +11008,7 @@ function SessionHeader({
|
|
|
10969
11008
|
}
|
|
10970
11009
|
);
|
|
10971
11010
|
}
|
|
10972
|
-
var
|
|
10973
|
-
var DIVIDER = primitiveColors.charcoal[500];
|
|
11011
|
+
var DIVIDER = primitiveColors.charcoal[300];
|
|
10974
11012
|
var DEFAULT_WIDTH = 246;
|
|
10975
11013
|
function SessionRail({
|
|
10976
11014
|
title,
|
|
@@ -10989,10 +11027,11 @@ function SessionRail({
|
|
|
10989
11027
|
...props
|
|
10990
11028
|
}) {
|
|
10991
11029
|
return /* @__PURE__ */ jsxs(
|
|
10992
|
-
|
|
11030
|
+
Surface,
|
|
10993
11031
|
{
|
|
11032
|
+
level: "elevated",
|
|
10994
11033
|
className,
|
|
10995
|
-
style: [{ width, flexDirection: "column"
|
|
11034
|
+
style: [{ width, flexDirection: "column" }, style],
|
|
10996
11035
|
testID: "session-rail",
|
|
10997
11036
|
...props,
|
|
10998
11037
|
children: [
|
|
@@ -11000,7 +11039,7 @@ function SessionRail({
|
|
|
11000
11039
|
SessionHeader,
|
|
11001
11040
|
{
|
|
11002
11041
|
title,
|
|
11003
|
-
plan: exercises.map((ex) => ({ name: ex.name, sets: ex.summary.sets })),
|
|
11042
|
+
plan: exercises.map((ex) => ({ name: ex.name, sets: ex.plannedSets ?? ex.summary.sets })),
|
|
11004
11043
|
setsDone,
|
|
11005
11044
|
elapsedMs,
|
|
11006
11045
|
budgetMs,
|
|
@@ -11010,9 +11049,10 @@ function SessionRail({
|
|
|
11010
11049
|
}
|
|
11011
11050
|
),
|
|
11012
11051
|
/* @__PURE__ */ jsx(
|
|
11013
|
-
|
|
11052
|
+
Surface,
|
|
11014
11053
|
{
|
|
11015
|
-
|
|
11054
|
+
level: "elevated",
|
|
11055
|
+
style: [{ flex: 1 }, neumorphicShadows.charcoal.pressed.subtle],
|
|
11016
11056
|
testID: "session-rail-list",
|
|
11017
11057
|
children: exercises.map((ex, i) => /* @__PURE__ */ jsx(
|
|
11018
11058
|
reactNative.View,
|
|
@@ -11111,7 +11151,7 @@ function clampProgress(currentWeek, weekCount) {
|
|
|
11111
11151
|
return Math.max(0, Math.min(1, ratio));
|
|
11112
11152
|
}
|
|
11113
11153
|
function MesoSegment({ meso, isActive, onPress }) {
|
|
11114
|
-
const [pressScale] =
|
|
11154
|
+
const [pressScale] = React25.useState(() => new reactNative.Animated.Value(1));
|
|
11115
11155
|
const handlePressIn = () => {
|
|
11116
11156
|
reactNative.Animated.timing(pressScale, {
|
|
11117
11157
|
toValue: 0.98,
|
|
@@ -11308,10 +11348,10 @@ function WeekRow({
|
|
|
11308
11348
|
}
|
|
11309
11349
|
);
|
|
11310
11350
|
}
|
|
11311
|
-
var
|
|
11351
|
+
var t9 = getSemanticColors("dark");
|
|
11312
11352
|
var COLORS = {
|
|
11313
|
-
statusSuccess:
|
|
11314
|
-
brandPrimary:
|
|
11353
|
+
statusSuccess: t9["status-success"],
|
|
11354
|
+
brandPrimary: t9["brand-primary"],
|
|
11315
11355
|
borderDefault: "#1F1F1F",
|
|
11316
11356
|
brandPrimarySubtle: "rgba(255,121,0,0.06)"
|
|
11317
11357
|
};
|
|
@@ -11479,8 +11519,8 @@ function MesoCard({
|
|
|
11479
11519
|
...props
|
|
11480
11520
|
}) {
|
|
11481
11521
|
const isExpandable = onToggle != null;
|
|
11482
|
-
const [highlight] =
|
|
11483
|
-
|
|
11522
|
+
const [highlight] = React25.useState(() => new reactNative.Animated.Value(highlighted ? 1 : 0));
|
|
11523
|
+
React25.useEffect(() => {
|
|
11484
11524
|
const animation = reactNative.Animated.timing(highlight, {
|
|
11485
11525
|
toValue: highlighted ? 1 : 0,
|
|
11486
11526
|
duration: 250,
|
|
@@ -11795,12 +11835,12 @@ function PrHistoryModal({
|
|
|
11795
11835
|
}
|
|
11796
11836
|
);
|
|
11797
11837
|
}
|
|
11798
|
-
var
|
|
11799
|
-
var BRAND_PRIMARY9 =
|
|
11838
|
+
var t10 = getSemanticColors("dark");
|
|
11839
|
+
var BRAND_PRIMARY9 = t10["brand-primary"];
|
|
11800
11840
|
var BRAND_PRIMARY_SUBTLE = "rgba(255,121,0,0.12)";
|
|
11801
|
-
var STATUS_SUCCESS2 =
|
|
11802
|
-
var STATUS_WARNING2 =
|
|
11803
|
-
var STATUS_ERROR2 =
|
|
11841
|
+
var STATUS_SUCCESS2 = t10["status-success"];
|
|
11842
|
+
var STATUS_WARNING2 = t10["status-warning"];
|
|
11843
|
+
var STATUS_ERROR2 = t10["status-error"];
|
|
11804
11844
|
var EMOJI_SETS = {
|
|
11805
11845
|
sleep: ["\u{1F634}", "\u{1F610}", "\u{1F642}", "\u{1F60A}", "\u{1F929}"],
|
|
11806
11846
|
soreness: ["\u{1F635}", "\u{1F623}", "\u{1F610}", "\u{1F642}", "\u{1F4AA}"],
|
|
@@ -11990,13 +12030,13 @@ function ReadinessCheck({
|
|
|
11990
12030
|
)
|
|
11991
12031
|
] }) });
|
|
11992
12032
|
}
|
|
11993
|
-
var
|
|
11994
|
-
var BRAND_PRIMARY10 =
|
|
12033
|
+
var t11 = getSemanticColors("dark");
|
|
12034
|
+
var BRAND_PRIMARY10 = t11["brand-primary"];
|
|
11995
12035
|
var BRAND_PRIMARY_DARK2 = MESO_ACCENT_GRADIENT_DARK;
|
|
11996
12036
|
var BRAND_PRIMARY_LIGHT2 = MESO_ACCENT_GRADIENT_LIGHT;
|
|
11997
|
-
var SUCCESS =
|
|
11998
|
-
var WARNING =
|
|
11999
|
-
var ERROR =
|
|
12037
|
+
var SUCCESS = t11["status-success"];
|
|
12038
|
+
var WARNING = t11["status-warning"];
|
|
12039
|
+
var ERROR = t11["status-error"];
|
|
12000
12040
|
var ACCENT_STOPS2 = [BRAND_PRIMARY_DARK2, BRAND_PRIMARY10, BRAND_PRIMARY_LIGHT2];
|
|
12001
12041
|
var CARD_GRADIENT = `linear-gradient(135deg, ${resolveColor("surface-elevated")} 0%, ${resolveColor("surface-raised")} 100%)`;
|
|
12002
12042
|
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%)";
|
|
@@ -12030,7 +12070,7 @@ function renderCoachingText(text, highlights) {
|
|
|
12030
12070
|
children: part
|
|
12031
12071
|
},
|
|
12032
12072
|
`${part}-${index}`
|
|
12033
|
-
) : /* @__PURE__ */ jsx(
|
|
12073
|
+
) : /* @__PURE__ */ jsx(React25.Fragment, { children: part }, `t-${index}`)
|
|
12034
12074
|
);
|
|
12035
12075
|
}
|
|
12036
12076
|
function StatusPill({ badge }) {
|
|
@@ -12367,8 +12407,8 @@ var ERROR_PILL_BORDER = "rgba(209,67,67,0.20)";
|
|
|
12367
12407
|
var PLOT_LEFT = 26;
|
|
12368
12408
|
var TOOLTIP_WIDTH = 124;
|
|
12369
12409
|
function timeOf(dateStr) {
|
|
12370
|
-
const
|
|
12371
|
-
return Number.isNaN(
|
|
12410
|
+
const t16 = Date.parse(dateStr);
|
|
12411
|
+
return Number.isNaN(t16) ? 0 : t16;
|
|
12372
12412
|
}
|
|
12373
12413
|
function formatValue(value) {
|
|
12374
12414
|
return `${Math.round(value)}`;
|
|
@@ -12496,17 +12536,17 @@ function StrengthTrendChart({
|
|
|
12496
12536
|
className,
|
|
12497
12537
|
...props
|
|
12498
12538
|
}) {
|
|
12499
|
-
const geometry =
|
|
12539
|
+
const geometry = React25.useMemo(
|
|
12500
12540
|
() => buildGeometry(data, projection, mesoBoundaries, width, height),
|
|
12501
12541
|
[data, projection, mesoBoundaries, width, height]
|
|
12502
12542
|
);
|
|
12503
|
-
const trend =
|
|
12543
|
+
const trend = React25.useMemo(
|
|
12504
12544
|
() => computeTrend(data, mesoBoundaries),
|
|
12505
12545
|
[data, mesoBoundaries]
|
|
12506
12546
|
);
|
|
12507
|
-
const [reveal] =
|
|
12508
|
-
const [selected, setSelected] =
|
|
12509
|
-
|
|
12547
|
+
const [reveal] = React25.useState(() => new reactNative.Animated.Value(animateOnMount ? 0 : 1));
|
|
12548
|
+
const [selected, setSelected] = React25.useState(null);
|
|
12549
|
+
React25.useEffect(() => {
|
|
12510
12550
|
if (!animateOnMount) return;
|
|
12511
12551
|
const animation = reactNative.Animated.timing(reveal, {
|
|
12512
12552
|
toValue: 1,
|
|
@@ -12857,10 +12897,10 @@ function StrengthTrendChart({
|
|
|
12857
12897
|
}
|
|
12858
12898
|
);
|
|
12859
12899
|
}
|
|
12860
|
-
var
|
|
12861
|
-
var STATUS_SUCCESS4 =
|
|
12862
|
-
var STATUS_WARNING4 =
|
|
12863
|
-
var STATUS_INFO =
|
|
12900
|
+
var t12 = getSemanticColors("dark");
|
|
12901
|
+
var STATUS_SUCCESS4 = t12["status-success"];
|
|
12902
|
+
var STATUS_WARNING4 = t12["status-warning"];
|
|
12903
|
+
var STATUS_INFO = t12["status-info"];
|
|
12864
12904
|
var DOT_BORDER = "#F3F4F6";
|
|
12865
12905
|
var BAND_FILL = "rgba(46,213,115,0.1)";
|
|
12866
12906
|
var BAND_EDGE = "rgba(46,213,115,0.45)";
|
|
@@ -12903,8 +12943,8 @@ function interpEdge(pixels, x, key) {
|
|
|
12903
12943
|
const a = pixels[i];
|
|
12904
12944
|
const b = pixels[i + 1];
|
|
12905
12945
|
if (x >= a.x && x <= b.x) {
|
|
12906
|
-
const
|
|
12907
|
-
return a[key] +
|
|
12946
|
+
const t16 = b.x === a.x ? 0 : (x - a.x) / (b.x - a.x);
|
|
12947
|
+
return a[key] + t16 * (b[key] - a[key]);
|
|
12908
12948
|
}
|
|
12909
12949
|
}
|
|
12910
12950
|
return pixels[pixels.length - 1][key];
|
|
@@ -12960,12 +13000,12 @@ function CapacityBandChart({
|
|
|
12960
13000
|
className,
|
|
12961
13001
|
...props
|
|
12962
13002
|
}) {
|
|
12963
|
-
const [reveal] =
|
|
12964
|
-
const dotAnims =
|
|
13003
|
+
const [reveal] = React25.useState(() => new reactNative.Animated.Value(0));
|
|
13004
|
+
const dotAnims = React25.useMemo(
|
|
12965
13005
|
() => Array.from({ length: workouts.length }, () => new reactNative.Animated.Value(0)),
|
|
12966
13006
|
[workouts.length]
|
|
12967
13007
|
);
|
|
12968
|
-
|
|
13008
|
+
React25.useEffect(() => {
|
|
12969
13009
|
reveal.setValue(0);
|
|
12970
13010
|
dotAnims.forEach((a) => a.setValue(0));
|
|
12971
13011
|
const draw = reactNative.Animated.timing(reveal, {
|
|
@@ -12988,7 +13028,7 @@ function CapacityBandChart({
|
|
|
12988
13028
|
}, [reveal, dotAnims, band.length, workouts.length]);
|
|
12989
13029
|
const plotWidth = width - PADDING_LEFT - PADDING_RIGHT;
|
|
12990
13030
|
const plotHeight = height - PADDING_TOP - PADDING_BOTTOM;
|
|
12991
|
-
const scale =
|
|
13031
|
+
const scale = React25.useMemo(() => {
|
|
12992
13032
|
const times = band.map((p) => parseTime(p.date));
|
|
12993
13033
|
projection?.withTraining.forEach((p) => times.push(parseTime(p.date)));
|
|
12994
13034
|
projection?.withRest.forEach((p) => times.push(parseTime(p.date)));
|
|
@@ -13234,13 +13274,13 @@ function CapacityBandChart({
|
|
|
13234
13274
|
}
|
|
13235
13275
|
);
|
|
13236
13276
|
}
|
|
13237
|
-
var
|
|
13277
|
+
var t13 = getSemanticColors("dark");
|
|
13238
13278
|
function glowShadow(color) {
|
|
13239
13279
|
return `0 0 5px 1px ${alpha(color, 0.3)}, 0 0 10px 3px ${alpha(color, 0.12)}`;
|
|
13240
13280
|
}
|
|
13241
13281
|
var DEFAULT_TRACK_COLOR = primitiveColors.charcoal[200];
|
|
13242
13282
|
var DEFAULT_MARKER_COLOR2 = primitiveColors.white;
|
|
13243
|
-
var TICK_COLOR =
|
|
13283
|
+
var TICK_COLOR = t13["text-tertiary"];
|
|
13244
13284
|
var ZONE_SIZES = {
|
|
13245
13285
|
default: {
|
|
13246
13286
|
trackHeight: 14,
|
|
@@ -13297,7 +13337,7 @@ function ZoneTrack({
|
|
|
13297
13337
|
const s = ZONE_SIZES[size];
|
|
13298
13338
|
const trackHeight = trackHeightProp ?? s.trackHeight;
|
|
13299
13339
|
const needleOverhang = needleOverhangProp ?? s.needleOverhang;
|
|
13300
|
-
const [trackW, setTrackW] =
|
|
13340
|
+
const [trackW, setTrackW] = React25.useState(0);
|
|
13301
13341
|
const onTrackLayout = (e) => setTrackW(e.nativeEvent.layout.width);
|
|
13302
13342
|
const tickCount = ticks?.length ?? 0;
|
|
13303
13343
|
const tickSpacing = trackW > 0 && tickCount > 0 ? trackW / tickCount : Infinity;
|
|
@@ -13423,7 +13463,7 @@ function ZoneTrack({
|
|
|
13423
13463
|
),
|
|
13424
13464
|
ticks?.map((tick, i) => {
|
|
13425
13465
|
const emphasized = tick.emphasized === true;
|
|
13426
|
-
const lineColor = tick.color ?? (emphasized ?
|
|
13466
|
+
const lineColor = tick.color ?? (emphasized ? t13["brand-primary"] : TICK_COLOR);
|
|
13427
13467
|
const lineWidth = emphasized ? s.tickLineEmphasized : s.tickLineNormal;
|
|
13428
13468
|
return /* @__PURE__ */ jsx(
|
|
13429
13469
|
reactNative.View,
|
|
@@ -13454,7 +13494,7 @@ function ZoneTrack({
|
|
|
13454
13494
|
if (tick.label == null) return null;
|
|
13455
13495
|
const emphasized = tick.emphasized === true;
|
|
13456
13496
|
if (!showTickLabel(i, emphasized)) return null;
|
|
13457
|
-
const labelColor = tick.color ?? (emphasized ?
|
|
13497
|
+
const labelColor = tick.color ?? (emphasized ? t13["brand-primary"] : TICK_COLOR);
|
|
13458
13498
|
const labelNode = /* @__PURE__ */ jsx(
|
|
13459
13499
|
reactNative.Text,
|
|
13460
13500
|
{
|
|
@@ -13640,7 +13680,7 @@ function VolumeLandmarkBar({
|
|
|
13640
13680
|
}
|
|
13641
13681
|
);
|
|
13642
13682
|
}
|
|
13643
|
-
var
|
|
13683
|
+
var t14 = getSemanticColors("dark");
|
|
13644
13684
|
var statusToken = {
|
|
13645
13685
|
productive: "status-success",
|
|
13646
13686
|
threshold: "status-warning",
|
|
@@ -13657,7 +13697,7 @@ var defaultLabel = {
|
|
|
13657
13697
|
stop: "Stop"
|
|
13658
13698
|
};
|
|
13659
13699
|
function statusPillColor(status) {
|
|
13660
|
-
return
|
|
13700
|
+
return t14[statusToken[status]];
|
|
13661
13701
|
}
|
|
13662
13702
|
function StatusPill2({ status, label, className, style, ...props }) {
|
|
13663
13703
|
const color = statusPillColor(status);
|
|
@@ -13690,7 +13730,7 @@ function StatusPill2({ status, label, className, style, ...props }) {
|
|
|
13690
13730
|
}
|
|
13691
13731
|
);
|
|
13692
13732
|
}
|
|
13693
|
-
var
|
|
13733
|
+
var t15 = getSemanticColors("dark");
|
|
13694
13734
|
var categoryToken = {
|
|
13695
13735
|
productive: null,
|
|
13696
13736
|
threshold: "status-warning",
|
|
@@ -13703,7 +13743,7 @@ var floodOpacity = {
|
|
|
13703
13743
|
};
|
|
13704
13744
|
function liveAuraColor(category) {
|
|
13705
13745
|
const token = categoryToken[category];
|
|
13706
|
-
return token ?
|
|
13746
|
+
return token ? t15[token] : null;
|
|
13707
13747
|
}
|
|
13708
13748
|
function LiveAuraFrame({
|
|
13709
13749
|
category,
|
|
@@ -13732,9 +13772,9 @@ function LiveAuraFrame({
|
|
|
13732
13772
|
position: "relative",
|
|
13733
13773
|
overflow: "hidden",
|
|
13734
13774
|
borderRadius: 10,
|
|
13735
|
-
backgroundColor:
|
|
13775
|
+
backgroundColor: t15["background-base"],
|
|
13736
13776
|
borderWidth: 1,
|
|
13737
|
-
borderColor:
|
|
13777
|
+
borderColor: t15["border-default"]
|
|
13738
13778
|
},
|
|
13739
13779
|
style
|
|
13740
13780
|
],
|
|
@@ -13961,28 +14001,28 @@ function Scatter({
|
|
|
13961
14001
|
testID: "scatter-canvas",
|
|
13962
14002
|
style: { position: "absolute", top: 0, left: 0, width, height, overflow: "hidden" },
|
|
13963
14003
|
children: [
|
|
13964
|
-
ticksOf(yd, TICK_COUNT).map((
|
|
13965
|
-
const y = toY(
|
|
14004
|
+
ticksOf(yd, TICK_COUNT).map((t16, i) => {
|
|
14005
|
+
const y = toY(t16);
|
|
13966
14006
|
return /* @__PURE__ */ jsx(
|
|
13967
14007
|
reactNative.View,
|
|
13968
14008
|
{
|
|
13969
14009
|
accessibilityElementsHidden: true,
|
|
13970
14010
|
testID: "scatter-gridline-y",
|
|
13971
14011
|
style: { position: "absolute", left: PLOT_LEFT2, width: innerW, top: y, height: 1, backgroundColor: GRID_LINE2 },
|
|
13972
|
-
children: /* @__PURE__ */ jsx(reactNative.Text, { className: "text-[9px] text-text-tertiary", style: { position: "absolute", left: -PLOT_LEFT2, top: -6, width: PLOT_LEFT2 - 6, textAlign: "right" }, children: formatTick(
|
|
14012
|
+
children: /* @__PURE__ */ jsx(reactNative.Text, { className: "text-[9px] text-text-tertiary", style: { position: "absolute", left: -PLOT_LEFT2, top: -6, width: PLOT_LEFT2 - 6, textAlign: "right" }, children: formatTick(t16) })
|
|
13973
14013
|
},
|
|
13974
14014
|
`y-${i}`
|
|
13975
14015
|
);
|
|
13976
14016
|
}),
|
|
13977
|
-
ticksOf(xd, TICK_COUNT).map((
|
|
13978
|
-
const x = toX(
|
|
14017
|
+
ticksOf(xd, TICK_COUNT).map((t16, i) => {
|
|
14018
|
+
const x = toX(t16);
|
|
13979
14019
|
return /* @__PURE__ */ jsx(
|
|
13980
14020
|
reactNative.View,
|
|
13981
14021
|
{
|
|
13982
14022
|
accessibilityElementsHidden: true,
|
|
13983
14023
|
testID: "scatter-gridline-x",
|
|
13984
14024
|
style: { position: "absolute", top: PLOT_TOP, height: innerH, left: x, width: 1, backgroundColor: GRID_LINE2 },
|
|
13985
|
-
children: /* @__PURE__ */ jsx(reactNative.Text, { className: "text-[9px] text-text-tertiary", style: { position: "absolute", top: innerH + 4, left: -16, width: 32, textAlign: "center" }, children: formatTick(
|
|
14025
|
+
children: /* @__PURE__ */ jsx(reactNative.Text, { className: "text-[9px] text-text-tertiary", style: { position: "absolute", top: innerH + 4, left: -16, width: 32, textAlign: "center" }, children: formatTick(t16) })
|
|
13986
14026
|
},
|
|
13987
14027
|
`x-${i}`
|
|
13988
14028
|
);
|
|
@@ -14117,23 +14157,23 @@ function Gauge2({
|
|
|
14117
14157
|
testID: "gauge",
|
|
14118
14158
|
...props,
|
|
14119
14159
|
children: [
|
|
14120
|
-
ticks.map((
|
|
14160
|
+
ticks.map((t16) => /* @__PURE__ */ jsx(
|
|
14121
14161
|
reactNative.View,
|
|
14122
14162
|
{
|
|
14123
14163
|
accessibilityElementsHidden: true,
|
|
14124
14164
|
testID: "gauge-segment",
|
|
14125
14165
|
style: {
|
|
14126
14166
|
position: "absolute",
|
|
14127
|
-
left:
|
|
14128
|
-
top:
|
|
14167
|
+
left: t16.left - tickThickness / 2,
|
|
14168
|
+
top: t16.top - tickLength / 2,
|
|
14129
14169
|
width: tickThickness,
|
|
14130
14170
|
height: tickLength,
|
|
14131
14171
|
borderRadius: tickThickness / 2,
|
|
14132
|
-
backgroundColor:
|
|
14133
|
-
transform: [{ rotate:
|
|
14172
|
+
backgroundColor: t16.color,
|
|
14173
|
+
transform: [{ rotate: t16.rotate }]
|
|
14134
14174
|
}
|
|
14135
14175
|
},
|
|
14136
|
-
|
|
14176
|
+
t16.key
|
|
14137
14177
|
)),
|
|
14138
14178
|
/* @__PURE__ */ jsxs(reactNative.View, { style: { position: "absolute", top: 0, left: 0, width: size, height: size }, className: "items-center justify-center", children: [
|
|
14139
14179
|
/* @__PURE__ */ jsxs(reactNative.View, { className: "flex-row items-baseline gap-0.5", children: [
|
|
@@ -14304,7 +14344,7 @@ function TopBar({
|
|
|
14304
14344
|
onSelectDevice,
|
|
14305
14345
|
className
|
|
14306
14346
|
}) {
|
|
14307
|
-
const [width, setWidth] =
|
|
14347
|
+
const [width, setWidth] = React25.useState(SUBTITLE_MIN);
|
|
14308
14348
|
const onLayout = (e) => setWidth(e.nativeEvent.layout.width);
|
|
14309
14349
|
const subtitleVisible = showSubtitle ?? width >= SUBTITLE_MIN;
|
|
14310
14350
|
const clockVisible = showClock ?? width >= CLOCK_MIN;
|
|
@@ -14383,7 +14423,8 @@ function NavItem({
|
|
|
14383
14423
|
{
|
|
14384
14424
|
variant: "button",
|
|
14385
14425
|
color: "inherit",
|
|
14386
|
-
|
|
14426
|
+
style: { fontSize: 8.5, lineHeight: 11 },
|
|
14427
|
+
className: cn("font-bold uppercase tracking-[0.4px]", labelColor),
|
|
14387
14428
|
children: label
|
|
14388
14429
|
}
|
|
14389
14430
|
)
|
|
@@ -14448,21 +14489,20 @@ function DashboardShell({
|
|
|
14448
14489
|
children,
|
|
14449
14490
|
className
|
|
14450
14491
|
}) {
|
|
14451
|
-
return
|
|
14452
|
-
|
|
14453
|
-
|
|
14454
|
-
|
|
14455
|
-
|
|
14456
|
-
|
|
14457
|
-
|
|
14458
|
-
|
|
14459
|
-
|
|
14460
|
-
|
|
14461
|
-
}
|
|
14462
|
-
)
|
|
14463
|
-
/* @__PURE__ */ jsx(reactNative.View, { className: "flex-1", children: children ?? /* @__PURE__ */ jsx(ContentPlaceholder, {}) })
|
|
14492
|
+
return (
|
|
14493
|
+
// Column: the TopBar spans the FULL width across the top, and the SideNav sits BELOW it
|
|
14494
|
+
// in the content row (not a full-height left rail). This keeps the brand/status band
|
|
14495
|
+
// unbroken edge-to-edge and lets the nav align under it. The shell is the outermost
|
|
14496
|
+
// Surface — it owns the base plane and seeds the on-surface colour context (mode) for
|
|
14497
|
+
// the whole dashboard tree.
|
|
14498
|
+
/* @__PURE__ */ jsxs(Surface, { level: "base", className: cn("flex-1", className), children: [
|
|
14499
|
+
/* @__PURE__ */ jsx(TopBar, { state, devices, subtitle, onSelectDevice }),
|
|
14500
|
+
/* @__PURE__ */ jsxs(reactNative.View, { className: "flex-1 flex-row", children: [
|
|
14501
|
+
/* @__PURE__ */ jsx(SideNav, { activeKey, items: navItems, liveKey, onNavigate }),
|
|
14502
|
+
/* @__PURE__ */ jsx(reactNative.View, { className: "flex-1", children: children ?? /* @__PURE__ */ jsx(ContentPlaceholder, {}) })
|
|
14503
|
+
] })
|
|
14464
14504
|
] })
|
|
14465
|
-
|
|
14505
|
+
);
|
|
14466
14506
|
}
|
|
14467
14507
|
|
|
14468
14508
|
// src/utils/form.ts
|
|
@@ -14686,6 +14726,7 @@ exports.ReadinessCheck = ReadinessCheck;
|
|
|
14686
14726
|
exports.RestTimer = RestTimer;
|
|
14687
14727
|
exports.SET_STRIP_VARIABLE_COLOR = SET_STRIP_VARIABLE_COLOR;
|
|
14688
14728
|
exports.SET_STRIP_ZONES = SET_STRIP_ZONES;
|
|
14729
|
+
exports.SURFACE_LEVEL_TOKEN = SURFACE_LEVEL_TOKEN;
|
|
14689
14730
|
exports.ScaleIcon = ScaleIcon;
|
|
14690
14731
|
exports.Scatter = Scatter;
|
|
14691
14732
|
exports.ScheduleTiles = ScheduleTiles;
|
|
@@ -14730,6 +14771,7 @@ exports.StepperStep = Step;
|
|
|
14730
14771
|
exports.StrengthTrendChart = StrengthTrendChart;
|
|
14731
14772
|
exports.SupersetWrapper = SupersetWrapper;
|
|
14732
14773
|
exports.Surface = Surface;
|
|
14774
|
+
exports.SurfaceContext = SurfaceContext;
|
|
14733
14775
|
exports.SvgIcon = SvgIcon;
|
|
14734
14776
|
exports.Switch = Switch;
|
|
14735
14777
|
exports.Tab = Tab;
|
|
@@ -14827,6 +14869,7 @@ exports.lighten = lighten;
|
|
|
14827
14869
|
exports.linearGradient = linearGradient;
|
|
14828
14870
|
exports.liveAuraColor = liveAuraColor;
|
|
14829
14871
|
exports.neumorphicShadows = neumorphicShadows;
|
|
14872
|
+
exports.onSurfaceColors = onSurfaceColors;
|
|
14830
14873
|
exports.paceTone = paceTone;
|
|
14831
14874
|
exports.paceToneColor = paceToneColor;
|
|
14832
14875
|
exports.primitiveBorderRadius = primitiveBorderRadius;
|
|
@@ -14851,7 +14894,11 @@ exports.semanticTypography = semanticTypography;
|
|
|
14851
14894
|
exports.sequentialEffort = sequentialEffort;
|
|
14852
14895
|
exports.shadowColors = shadowColors;
|
|
14853
14896
|
exports.statusPillColor = statusPillColor;
|
|
14897
|
+
exports.surfaceBackground = surfaceBackground;
|
|
14854
14898
|
exports.surfaceGradient = surfaceGradient;
|
|
14899
|
+
exports.useOnSurfaceColor = useOnSurfaceColor;
|
|
14900
|
+
exports.useSurface = useSurface;
|
|
14901
|
+
exports.useSurfaceMode = useSurfaceMode;
|
|
14855
14902
|
exports.useTable = useTable;
|
|
14856
14903
|
exports.useTimer = useTimer;
|
|
14857
14904
|
exports.useToast = useToast;
|