@titan-design/react-ui 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-NA3EES23.mjs → chunk-MGW37MPO.mjs} +26 -4
- package/dist/chunk-MGW37MPO.mjs.map +1 -0
- package/dist/index.d.mts +115 -2
- package/dist/index.d.ts +115 -2
- package/dist/index.js +262 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +225 -3
- package/dist/index.mjs.map +1 -1
- package/dist/theme/index.d.mts +124 -109
- package/dist/theme/index.d.ts +124 -109
- package/dist/theme/index.js +24 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +1 -1
- package/package.json +3 -1
- package/dist/chunk-NA3EES23.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { semanticColorsDark, getHoverColors, getValidatedElevation, getBaseSurfaceColor, getElevationSurface, getElevationShadow, neumorphicShadows } from './chunk-
|
|
2
|
-
export { buttonSizes, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, discreteRainbow, elevationSystem, getBaseSurfaceColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isDark, lightThemeCSSVars, lighten, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, shadowColors } from './chunk-
|
|
1
|
+
import { semanticColorsDark, getHoverColors, getValidatedElevation, getBaseSurfaceColor, getElevationSurface, getElevationShadow, getGlowShadow, neumorphicShadows } from './chunk-MGW37MPO.mjs';
|
|
2
|
+
export { buttonSizes, componentElevationRanges, createFlatShadow, createPressedHoverShadow, createPressedShadow, createRaisedHoverShadow, createRaisedShadow, darkThemeCSSVars, darken, discreteRainbow, elevationSystem, getBaseSurfaceColor, getDiscreteRainbowColor, getElevationConfig, getElevationShadow, getElevationSurface, getGlowShadow, getHoverColors, getSemanticColors, getThemeCSSVars, getValidatedElevation, gluestackConfig, hexToRgb, hsvToRgb, isDark, lightThemeCSSVars, lighten, neumorphicShadows, primitiveBorderRadius, primitiveBreakpoints, primitiveColors, primitiveShadows, primitiveSpacing, primitiveTypography, primitiveZIndex, rgbToHex, rgbToHsv, semanticColorsDark, semanticColorsLight, semanticTypography, shadowColors } from './chunk-MGW37MPO.mjs';
|
|
3
3
|
import { Pressable, ActivityIndicator, Text, View, TextInput, StyleSheet, Platform, Image, Modal as Modal$1, ScrollView } from 'react-native';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -3431,6 +3431,177 @@ function FormRow({
|
|
|
3431
3431
|
}
|
|
3432
3432
|
);
|
|
3433
3433
|
}
|
|
3434
|
+
var gapClasses = {
|
|
3435
|
+
0: "gap-0",
|
|
3436
|
+
1: "gap-1",
|
|
3437
|
+
2: "gap-2",
|
|
3438
|
+
3: "gap-3",
|
|
3439
|
+
4: "gap-4",
|
|
3440
|
+
5: "gap-5",
|
|
3441
|
+
6: "gap-6",
|
|
3442
|
+
8: "gap-8",
|
|
3443
|
+
10: "gap-10",
|
|
3444
|
+
12: "gap-12"
|
|
3445
|
+
};
|
|
3446
|
+
var alignMap = {
|
|
3447
|
+
start: "items-start",
|
|
3448
|
+
center: "items-center",
|
|
3449
|
+
end: "items-end",
|
|
3450
|
+
stretch: "items-stretch"
|
|
3451
|
+
};
|
|
3452
|
+
var justifyMap = {
|
|
3453
|
+
start: "justify-start",
|
|
3454
|
+
center: "justify-center",
|
|
3455
|
+
end: "justify-end",
|
|
3456
|
+
between: "justify-between",
|
|
3457
|
+
around: "justify-around"
|
|
3458
|
+
};
|
|
3459
|
+
function Stack({
|
|
3460
|
+
gap = 0,
|
|
3461
|
+
align,
|
|
3462
|
+
justify,
|
|
3463
|
+
wrap,
|
|
3464
|
+
className,
|
|
3465
|
+
children,
|
|
3466
|
+
...props
|
|
3467
|
+
}) {
|
|
3468
|
+
return /* @__PURE__ */ jsx(
|
|
3469
|
+
View,
|
|
3470
|
+
{
|
|
3471
|
+
className: cn(
|
|
3472
|
+
"flex",
|
|
3473
|
+
gapClasses[gap],
|
|
3474
|
+
align && alignMap[align],
|
|
3475
|
+
justify && justifyMap[justify],
|
|
3476
|
+
wrap && "flex-wrap",
|
|
3477
|
+
className
|
|
3478
|
+
),
|
|
3479
|
+
...props,
|
|
3480
|
+
children
|
|
3481
|
+
}
|
|
3482
|
+
);
|
|
3483
|
+
}
|
|
3484
|
+
function HStack(props) {
|
|
3485
|
+
return /* @__PURE__ */ jsx(Stack, { ...props, className: cn("flex-row", props.className) });
|
|
3486
|
+
}
|
|
3487
|
+
function VStack(props) {
|
|
3488
|
+
return /* @__PURE__ */ jsx(Stack, { ...props, className: cn("flex-col", props.className) });
|
|
3489
|
+
}
|
|
3490
|
+
function Section({ className, children, ...props }) {
|
|
3491
|
+
return /* @__PURE__ */ jsx(View, { className: cn("mb-6", className), ...props, children });
|
|
3492
|
+
}
|
|
3493
|
+
function SectionHeader({ title, subtitle, trailing, className }) {
|
|
3494
|
+
return /* @__PURE__ */ jsxs(View, { className: cn("flex-row items-center justify-between mb-3 px-1", className), children: [
|
|
3495
|
+
/* @__PURE__ */ jsxs(View, { className: "flex-1", children: [
|
|
3496
|
+
/* @__PURE__ */ jsx(Text, { className: "text-sm font-semibold text-text-secondary uppercase tracking-wider", children: title }),
|
|
3497
|
+
subtitle && /* @__PURE__ */ jsx(Text, { className: "text-xs text-text-tertiary mt-0.5", children: subtitle })
|
|
3498
|
+
] }),
|
|
3499
|
+
trailing && /* @__PURE__ */ jsx(View, { children: trailing })
|
|
3500
|
+
] });
|
|
3501
|
+
}
|
|
3502
|
+
function SectionContent({ className, children, ...props }) {
|
|
3503
|
+
return /* @__PURE__ */ jsx(View, { className: cn(className), ...props, children });
|
|
3504
|
+
}
|
|
3505
|
+
function DataRow({ label, value, valueClassName, className, ...props }) {
|
|
3506
|
+
return /* @__PURE__ */ jsxs(View, { className: cn("flex-row items-center justify-between py-2", className), ...props, children: [
|
|
3507
|
+
/* @__PURE__ */ jsx(Text, { className: "text-sm text-text-secondary", children: label }),
|
|
3508
|
+
typeof value === "string" ? /* @__PURE__ */ jsx(Text, { className: cn("text-sm font-medium text-text-primary", valueClassName), children: value }) : /* @__PURE__ */ jsx(View, { className: cn(valueClassName), children: value })
|
|
3509
|
+
] });
|
|
3510
|
+
}
|
|
3511
|
+
var colorClasses = {
|
|
3512
|
+
primary: { bg: "bg-brand-primary/10", icon: "text-brand-primary" },
|
|
3513
|
+
secondary: { bg: "bg-brand-secondary/10", icon: "text-brand-secondary" },
|
|
3514
|
+
success: { bg: "bg-status-success/10", icon: "text-status-success" },
|
|
3515
|
+
error: { bg: "bg-status-error/10", icon: "text-status-error" },
|
|
3516
|
+
warning: { bg: "bg-status-warning/10", icon: "text-status-warning" },
|
|
3517
|
+
info: { bg: "bg-status-info/10", icon: "text-status-info" },
|
|
3518
|
+
neutral: { bg: "bg-surface-elevated", icon: "text-text-secondary" }
|
|
3519
|
+
};
|
|
3520
|
+
var sizeClasses = {
|
|
3521
|
+
sm: { box: "w-8 h-8 rounded-lg", iconSize: 16 },
|
|
3522
|
+
md: { box: "w-10 h-10 rounded-xl", iconSize: 20 },
|
|
3523
|
+
lg: { box: "w-12 h-12 rounded-xl", iconSize: 24 }
|
|
3524
|
+
};
|
|
3525
|
+
function IconBox({
|
|
3526
|
+
icon: Icon,
|
|
3527
|
+
color = "neutral",
|
|
3528
|
+
size = "md",
|
|
3529
|
+
className,
|
|
3530
|
+
...props
|
|
3531
|
+
}) {
|
|
3532
|
+
const colors = colorClasses[color];
|
|
3533
|
+
const sizes = sizeClasses[size];
|
|
3534
|
+
return /* @__PURE__ */ jsx(
|
|
3535
|
+
View,
|
|
3536
|
+
{
|
|
3537
|
+
className: cn("items-center justify-center", colors.bg, sizes.box, className),
|
|
3538
|
+
...props,
|
|
3539
|
+
children: /* @__PURE__ */ jsx(Icon, { size: sizes.iconSize, className: colors.icon })
|
|
3540
|
+
}
|
|
3541
|
+
);
|
|
3542
|
+
}
|
|
3543
|
+
function Surface({
|
|
3544
|
+
elevation = 0,
|
|
3545
|
+
glowColor,
|
|
3546
|
+
glowIntensity,
|
|
3547
|
+
theme = "dark",
|
|
3548
|
+
className,
|
|
3549
|
+
style,
|
|
3550
|
+
children,
|
|
3551
|
+
...props
|
|
3552
|
+
}) {
|
|
3553
|
+
const baseColor = getBaseSurfaceColor(theme);
|
|
3554
|
+
const surfaceColor = getElevationSurface(baseColor, elevation, theme);
|
|
3555
|
+
const shadowStyle = getElevationShadow(baseColor, elevation, theme);
|
|
3556
|
+
const glowStyle = glowColor ? getGlowShadow(glowColor, glowIntensity) : {};
|
|
3557
|
+
return /* @__PURE__ */ jsx(
|
|
3558
|
+
View,
|
|
3559
|
+
{
|
|
3560
|
+
className: cn("rounded-2xl", className),
|
|
3561
|
+
style: [
|
|
3562
|
+
{ backgroundColor: surfaceColor },
|
|
3563
|
+
shadowStyle,
|
|
3564
|
+
glowStyle,
|
|
3565
|
+
style
|
|
3566
|
+
],
|
|
3567
|
+
...props,
|
|
3568
|
+
children
|
|
3569
|
+
}
|
|
3570
|
+
);
|
|
3571
|
+
}
|
|
3572
|
+
function ListItem({ className, children, onPress, ...props }) {
|
|
3573
|
+
const Container = onPress ? Pressable : View;
|
|
3574
|
+
const containerProps = onPress ? { onPress, ...props } : props;
|
|
3575
|
+
return /* @__PURE__ */ jsx(
|
|
3576
|
+
Container,
|
|
3577
|
+
{
|
|
3578
|
+
className: cn("flex-row items-center py-3 px-4 min-h-[48px]", className),
|
|
3579
|
+
...containerProps,
|
|
3580
|
+
children
|
|
3581
|
+
}
|
|
3582
|
+
);
|
|
3583
|
+
}
|
|
3584
|
+
function ListItemIcon({ icon: Icon, className, ...props }) {
|
|
3585
|
+
return /* @__PURE__ */ jsx(View, { className: cn("mr-3 items-center justify-center", className), ...props, children: /* @__PURE__ */ jsx(Icon, { size: 20, className: "text-text-secondary" }) });
|
|
3586
|
+
}
|
|
3587
|
+
function ListItemContent({ title, subtitle, className, ...props }) {
|
|
3588
|
+
return /* @__PURE__ */ jsxs(View, { className: cn("flex-1 justify-center", className), ...props, children: [
|
|
3589
|
+
/* @__PURE__ */ jsx(Text, { className: "text-sm font-medium text-text-primary", children: title }),
|
|
3590
|
+
subtitle && /* @__PURE__ */ jsx(Text, { className: "text-xs text-text-secondary mt-0.5", children: subtitle })
|
|
3591
|
+
] });
|
|
3592
|
+
}
|
|
3593
|
+
function ListItemTrailing({ className, children, ...props }) {
|
|
3594
|
+
return /* @__PURE__ */ jsx(View, { className: cn("ml-3 items-center justify-center", className), ...props, children });
|
|
3595
|
+
}
|
|
3596
|
+
function ListItemDivider({ inset = true, className, ...props }) {
|
|
3597
|
+
return /* @__PURE__ */ jsx(
|
|
3598
|
+
View,
|
|
3599
|
+
{
|
|
3600
|
+
className: cn("h-px bg-divider", inset ? "ml-14" : "", className),
|
|
3601
|
+
...props
|
|
3602
|
+
}
|
|
3603
|
+
);
|
|
3604
|
+
}
|
|
3434
3605
|
var variantStyles4 = {
|
|
3435
3606
|
h1: "font-heading text-5xl font-bold leading-tight",
|
|
3436
3607
|
h2: "font-heading text-4xl font-bold leading-tight",
|
|
@@ -4259,6 +4430,57 @@ function formatDateTime(value, format = "datetime", isUTC = false, fallback = "-
|
|
|
4259
4430
|
}
|
|
4260
4431
|
return formatDate(value, format, isUTC);
|
|
4261
4432
|
}
|
|
4433
|
+
var sizeConfig2 = {
|
|
4434
|
+
sm: { value: "text-lg font-bold", label: "text-xs", unit: "text-xs" },
|
|
4435
|
+
md: { value: "text-2xl font-bold", label: "text-xs", unit: "text-sm" },
|
|
4436
|
+
lg: { value: "text-4xl font-bold", label: "text-sm", unit: "text-base" }
|
|
4437
|
+
};
|
|
4438
|
+
var trendColors = {
|
|
4439
|
+
up: "text-result-improve",
|
|
4440
|
+
down: "text-result-degrade",
|
|
4441
|
+
neutral: "text-result-inconclusive"
|
|
4442
|
+
};
|
|
4443
|
+
var trendArrows = {
|
|
4444
|
+
up: "\u2191",
|
|
4445
|
+
down: "\u2193",
|
|
4446
|
+
neutral: "\u2192"
|
|
4447
|
+
};
|
|
4448
|
+
function Metric({
|
|
4449
|
+
value,
|
|
4450
|
+
label,
|
|
4451
|
+
unit,
|
|
4452
|
+
trend,
|
|
4453
|
+
size = "md",
|
|
4454
|
+
className,
|
|
4455
|
+
...props
|
|
4456
|
+
}) {
|
|
4457
|
+
const styles2 = sizeConfig2[size];
|
|
4458
|
+
return /* @__PURE__ */ jsxs(View, { className: cn("items-center", className), ...props, children: [
|
|
4459
|
+
/* @__PURE__ */ jsxs(View, { className: "flex-row items-baseline gap-1", children: [
|
|
4460
|
+
/* @__PURE__ */ jsx(Text, { className: cn(styles2.value, "text-text-primary"), children: value }),
|
|
4461
|
+
unit && /* @__PURE__ */ jsx(Text, { className: cn(styles2.unit, "text-text-tertiary"), children: unit }),
|
|
4462
|
+
trend && /* @__PURE__ */ jsx(Text, { className: cn(styles2.unit, trendColors[trend]), children: trendArrows[trend] })
|
|
4463
|
+
] }),
|
|
4464
|
+
/* @__PURE__ */ jsx(Text, { className: cn(styles2.label, "text-text-secondary mt-1"), children: label })
|
|
4465
|
+
] });
|
|
4466
|
+
}
|
|
4467
|
+
function MetricGroup({
|
|
4468
|
+
className,
|
|
4469
|
+
children,
|
|
4470
|
+
...props
|
|
4471
|
+
}) {
|
|
4472
|
+
const items = React24.Children.toArray(children);
|
|
4473
|
+
return /* @__PURE__ */ jsx(View, { className: cn("flex-row items-center", className), ...props, children: items.map((child, i) => /* @__PURE__ */ jsxs(React24.Fragment, { children: [
|
|
4474
|
+
/* @__PURE__ */ jsx(View, { className: "flex-1 items-center", children: child }),
|
|
4475
|
+
i < items.length - 1 && /* @__PURE__ */ jsx(
|
|
4476
|
+
View,
|
|
4477
|
+
{
|
|
4478
|
+
className: "w-px h-8 bg-divider mx-2",
|
|
4479
|
+
testID: "metric-divider"
|
|
4480
|
+
}
|
|
4481
|
+
)
|
|
4482
|
+
] }, i)) });
|
|
4483
|
+
}
|
|
4262
4484
|
|
|
4263
4485
|
// src/utils/colors.ts
|
|
4264
4486
|
function getStatusColor(status) {
|
|
@@ -4407,6 +4629,6 @@ function composeValidators(...validators) {
|
|
|
4407
4629
|
};
|
|
4408
4630
|
}
|
|
4409
4631
|
|
|
4410
|
-
export { Accordion, AccordionButton, AccordionItem, AccordionPanel, Alert, AlertDescription, AlertTitle, Autocomplete, Avatar, AvatarBadge, AvatarGroup, Badge, BadgeText, BreadcrumbItem, Breadcrumbs, Button, ButtonIcon, ButtonSpinner, ButtonText, Caption, Card, CardContent, CardDescription, CardFooter, CardHeader, CardSkeleton, CardTitle, Checkbox, CheckboxGroup, Chip, CircularProgress, Collapse, CollapseButton, CollapseContent, DateTime, Divider, Drawer, DrawerBody, DrawerFooter, DrawerHeader, EmptyState, FormActions, FormField, FormRow, FormSection, Heading, HelpTip, Input, InputGroup, Label, LabelWithHelp, Link, Menu, MenuDivider, MenuGroup, MenuItem, MenuList, MenuTrigger, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalTitle, Overline, Paragraph, PasswordInput, Popover, PopoverCloseButton, PopoverContent, PopoverTrigger, Progress, ProgressSteps, Radio, RadioGroup, Select, Sidebar, SidebarContent, SidebarDivider, SidebarFooter, SidebarHeader, SidebarItem, SidebarSection, Skeleton, SkeletonCard, SkeletonCircle, SkeletonListItem, SkeletonText, Spinner, Step, StepContent, StepIndicator, StepLabel, Stepper, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableBody, TableCell, TableHeader, TableHeaderCell, TablePagination, TableRow, Tabs, Toast, ToastProvider, ToolbarButton, ToolbarButtonGroup, Tooltip, Typography, alpha, cn, composeValidators, createFieldId, formatDateTime, getContrastText, getFieldAriaProps, getFieldValidationProps, getLuminance, getResultColor, getStatusColor, hasMaxLength, hasMinLength, isEmpty, isValidEmail, useTable, useToast, useToolbarButton, validationRules };
|
|
4632
|
+
export { Accordion, AccordionButton, AccordionItem, AccordionPanel, Alert, AlertDescription, AlertTitle, Autocomplete, Avatar, AvatarBadge, AvatarGroup, Badge, BadgeText, BreadcrumbItem, Breadcrumbs, Button, ButtonIcon, ButtonSpinner, ButtonText, Caption, Card, CardContent, CardDescription, CardFooter, CardHeader, CardSkeleton, CardTitle, Checkbox, CheckboxGroup, Chip, CircularProgress, Collapse, CollapseButton, CollapseContent, DataRow, DateTime, Divider, Drawer, DrawerBody, DrawerFooter, DrawerHeader, EmptyState, FormActions, FormField, FormRow, FormSection, HStack, Heading, HelpTip, IconBox, Input, InputGroup, Label, LabelWithHelp, Link, ListItem, ListItemContent, ListItemDivider, ListItemIcon, ListItemTrailing, Menu, MenuDivider, MenuGroup, MenuItem, MenuList, MenuTrigger, Metric, MetricGroup, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalTitle, Overline, Paragraph, PasswordInput, Popover, PopoverCloseButton, PopoverContent, PopoverTrigger, Progress, ProgressSteps, Radio, RadioGroup, Section, SectionContent, SectionHeader, Select, Sidebar, SidebarContent, SidebarDivider, SidebarFooter, SidebarHeader, SidebarItem, SidebarSection, Skeleton, SkeletonCard, SkeletonCircle, SkeletonListItem, SkeletonText, Spinner, Stack, Step, StepContent, StepIndicator, StepLabel, Stepper, Surface, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableBody, TableCell, TableHeader, TableHeaderCell, TablePagination, TableRow, Tabs, Toast, ToastProvider, ToolbarButton, ToolbarButtonGroup, Tooltip, Typography, VStack, alpha, cn, composeValidators, createFieldId, formatDateTime, getContrastText, getFieldAriaProps, getFieldValidationProps, getLuminance, getResultColor, getStatusColor, hasMaxLength, hasMinLength, isEmpty, isValidEmail, useTable, useToast, useToolbarButton, validationRules };
|
|
4411
4633
|
//# sourceMappingURL=index.mjs.map
|
|
4412
4634
|
//# sourceMappingURL=index.mjs.map
|