@titan-design/react-ui 0.0.2 → 0.1.1
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 +12 -5
- package/src/components/custom/DateTime/DateTime.stories.tsx +180 -0
- package/src/components/custom/DateTime/DateTime.test.tsx +152 -0
- package/src/components/custom/DateTime/DateTime.tsx +235 -0
- package/src/components/custom/DateTime/index.ts +2 -0
- package/src/components/custom/EmptyState/EmptyState.stories.tsx +99 -0
- package/src/components/custom/EmptyState/EmptyState.test.tsx +106 -0
- package/src/components/custom/EmptyState/EmptyState.tsx +68 -0
- package/src/components/custom/EmptyState/index.ts +2 -0
- package/src/components/custom/Metric/Metric.stories.tsx +133 -0
- package/src/components/custom/Metric/Metric.test.tsx +120 -0
- package/src/components/custom/Metric/Metric.tsx +92 -0
- package/src/components/custom/Metric/index.ts +2 -0
- package/src/components/custom/Sidebar/Sidebar.stories.tsx +227 -0
- package/src/components/custom/Sidebar/Sidebar.test.tsx +185 -0
- package/src/components/custom/Sidebar/Sidebar.tsx +257 -0
- package/src/components/custom/Sidebar/index.ts +18 -0
- package/src/components/custom/Table/Table.stories.tsx +481 -0
- package/src/components/custom/Table/Table.test.tsx +531 -0
- package/src/components/custom/Table/Table.tsx +696 -0
- package/src/components/custom/Table/index.ts +22 -0
- package/src/components/custom/Typography/Typography.stories.tsx +153 -0
- package/src/components/custom/Typography/Typography.test.tsx +107 -0
- package/src/components/custom/Typography/Typography.tsx +218 -0
- package/src/components/custom/Typography/index.ts +19 -0
- package/src/components/custom/index.ts +8 -0
- package/src/components/custom/stepper/Stepper.stories.tsx +245 -0
- package/src/components/custom/stepper/Stepper.test.tsx +230 -0
- package/src/components/custom/stepper/Stepper.tsx +250 -0
- package/src/components/custom/stepper/index.ts +10 -0
- package/src/components/index.ts +5 -0
- package/src/components/ui/alert/Alert.stories.tsx +154 -0
- package/src/components/ui/alert/Alert.test.tsx +202 -0
- package/src/components/ui/alert/Alert.tsx +170 -0
- package/src/components/ui/alert/index.ts +8 -0
- package/src/components/ui/autocomplete/Autocomplete.stories.tsx +299 -0
- package/src/components/ui/autocomplete/Autocomplete.test.tsx +247 -0
- package/src/components/ui/autocomplete/Autocomplete.tsx +332 -0
- package/src/components/ui/autocomplete/index.ts +2 -0
- package/src/components/ui/avatar/Avatar.stories.tsx +105 -0
- package/src/components/ui/avatar/Avatar.test.tsx +135 -0
- package/src/components/ui/avatar/Avatar.tsx +168 -0
- package/src/components/ui/avatar/index.ts +2 -0
- package/src/components/ui/badge/Badge.stories.tsx +100 -0
- package/src/components/ui/badge/Badge.test.tsx +86 -0
- package/src/components/ui/badge/Badge.tsx +105 -0
- package/src/components/ui/badge/index.ts +2 -0
- package/src/components/ui/breadcrumbs/Breadcrumbs.stories.tsx +70 -0
- package/src/components/ui/breadcrumbs/Breadcrumbs.test.tsx +156 -0
- package/src/components/ui/breadcrumbs/Breadcrumbs.tsx +127 -0
- package/src/components/ui/breadcrumbs/index.ts +2 -0
- package/src/components/ui/button/Button.stories.tsx +216 -0
- package/src/components/ui/button/Button.test.tsx +132 -0
- package/src/components/ui/button/Button.tsx +242 -0
- package/src/components/ui/button/index.ts +10 -0
- package/src/components/ui/card/Card.stories.tsx +443 -0
- package/src/components/ui/card/Card.test.tsx +265 -0
- package/src/components/ui/card/Card.tsx +380 -0
- package/src/components/ui/card/index.ts +20 -0
- package/src/components/ui/checkbox/Checkbox.stories.tsx +126 -0
- package/src/components/ui/checkbox/Checkbox.test.tsx +152 -0
- package/src/components/ui/checkbox/Checkbox.tsx +163 -0
- package/src/components/ui/checkbox/index.ts +2 -0
- package/src/components/ui/chip/Chip.stories.tsx +112 -0
- package/src/components/ui/chip/Chip.test.tsx +119 -0
- package/src/components/ui/chip/Chip.tsx +151 -0
- package/src/components/ui/chip/index.ts +2 -0
- package/src/components/ui/collapse/Collapse.stories.tsx +313 -0
- package/src/components/ui/collapse/Collapse.test.tsx +298 -0
- package/src/components/ui/collapse/Collapse.tsx +275 -0
- package/src/components/ui/collapse/index.ts +18 -0
- package/src/components/ui/data-row/DataRow.stories.tsx +78 -0
- package/src/components/ui/data-row/DataRow.test.tsx +78 -0
- package/src/components/ui/data-row/DataRow.tsx +29 -0
- package/src/components/ui/data-row/index.ts +2 -0
- package/src/components/ui/divider/Divider.stories.tsx +71 -0
- package/src/components/ui/divider/Divider.test.tsx +55 -0
- package/src/components/ui/divider/Divider.tsx +37 -0
- package/src/components/ui/divider/index.ts +2 -0
- package/src/components/ui/drawer/Drawer.stories.tsx +228 -0
- package/src/components/ui/drawer/Drawer.test.tsx +142 -0
- package/src/components/ui/drawer/Drawer.tsx +228 -0
- package/src/components/ui/drawer/index.ts +9 -0
- package/src/components/ui/form-field/FormField.stories.tsx +260 -0
- package/src/components/ui/form-field/FormField.test.tsx +280 -0
- package/src/components/ui/form-field/FormField.tsx +308 -0
- package/src/components/ui/form-field/index.ts +2 -0
- package/src/components/ui/help-tip/HelpTip.stories.tsx +250 -0
- package/src/components/ui/help-tip/HelpTip.test.tsx +198 -0
- package/src/components/ui/help-tip/HelpTip.tsx +229 -0
- package/src/components/ui/help-tip/index.ts +2 -0
- package/src/components/ui/icon-box/IconBox.stories.tsx +139 -0
- package/src/components/ui/icon-box/IconBox.test.tsx +120 -0
- package/src/components/ui/icon-box/IconBox.tsx +57 -0
- package/src/components/ui/icon-box/index.ts +1 -0
- package/src/components/ui/index.ts +36 -0
- package/src/components/ui/input/Input.stories.tsx +192 -0
- package/src/components/ui/input/Input.test.tsx +86 -0
- package/src/components/ui/input/Input.tsx +273 -0
- package/src/components/ui/input/index.ts +2 -0
- package/src/components/ui/link/Link.stories.tsx +78 -0
- package/src/components/ui/link/Link.test.tsx +94 -0
- package/src/components/ui/link/Link.tsx +86 -0
- package/src/components/ui/link/index.ts +2 -0
- package/src/components/ui/list-item/ListItem.stories.tsx +146 -0
- package/src/components/ui/list-item/ListItem.test.tsx +128 -0
- package/src/components/ui/list-item/ListItem.tsx +89 -0
- package/src/components/ui/list-item/index.ts +14 -0
- package/src/components/ui/menu/Menu.stories.tsx +180 -0
- package/src/components/ui/menu/Menu.test.tsx +353 -0
- package/src/components/ui/menu/Menu.tsx +222 -0
- package/src/components/ui/menu/index.ts +2 -0
- package/src/components/ui/modal/Modal.stories.tsx +350 -0
- package/src/components/ui/modal/Modal.test.tsx +159 -0
- package/src/components/ui/modal/Modal.tsx +254 -0
- package/src/components/ui/modal/index.ts +19 -0
- package/src/components/ui/popover/Popover.stories.tsx +190 -0
- package/src/components/ui/popover/Popover.test.tsx +277 -0
- package/src/components/ui/popover/Popover.tsx +162 -0
- package/src/components/ui/popover/index.ts +2 -0
- package/src/components/ui/progress/Progress.stories.tsx +190 -0
- package/src/components/ui/progress/Progress.test.tsx +181 -0
- package/src/components/ui/progress/Progress.tsx +320 -0
- package/src/components/ui/progress/index.ts +9 -0
- package/src/components/ui/radio/Radio.stories.tsx +199 -0
- package/src/components/ui/radio/Radio.test.tsx +166 -0
- package/src/components/ui/radio/Radio.tsx +200 -0
- package/src/components/ui/radio/index.ts +2 -0
- package/src/components/ui/section/Section.stories.tsx +111 -0
- package/src/components/ui/section/Section.test.tsx +121 -0
- package/src/components/ui/section/Section.tsx +52 -0
- package/src/components/ui/section/index.ts +6 -0
- package/src/components/ui/select/Select.stories.tsx +286 -0
- package/src/components/ui/select/Select.test.tsx +180 -0
- package/src/components/ui/select/Select.tsx +236 -0
- package/src/components/ui/select/index.ts +2 -0
- package/src/components/ui/skeleton/Skeleton.stories.tsx +153 -0
- package/src/components/ui/skeleton/Skeleton.test.tsx +162 -0
- package/src/components/ui/skeleton/Skeleton.tsx +229 -0
- package/src/components/ui/skeleton/index.ts +16 -0
- package/src/components/ui/spinner/Spinner.stories.tsx +67 -0
- package/src/components/ui/spinner/Spinner.test.tsx +67 -0
- package/src/components/ui/spinner/Spinner.tsx +72 -0
- package/src/components/ui/spinner/index.ts +2 -0
- package/src/components/ui/stack/Stack.stories.tsx +127 -0
- package/src/components/ui/stack/Stack.test.tsx +184 -0
- package/src/components/ui/stack/Stack.tsx +76 -0
- package/src/components/ui/stack/index.ts +2 -0
- package/src/components/ui/surface/Surface.stories.tsx +91 -0
- package/src/components/ui/surface/Surface.test.tsx +63 -0
- package/src/components/ui/surface/Surface.tsx +51 -0
- package/src/components/ui/surface/index.ts +1 -0
- package/src/components/ui/switch/Switch.stories.tsx +111 -0
- package/src/components/ui/switch/Switch.test.tsx +112 -0
- package/src/components/ui/switch/Switch.tsx +103 -0
- package/src/components/ui/switch/index.ts +2 -0
- package/src/components/ui/tabs/Tabs.stories.tsx +213 -0
- package/src/components/ui/tabs/Tabs.test.tsx +192 -0
- package/src/components/ui/tabs/Tabs.tsx +253 -0
- package/src/components/ui/tabs/index.ts +16 -0
- package/src/components/ui/toast/Toast.stories.tsx +255 -0
- package/src/components/ui/toast/Toast.test.tsx +207 -0
- package/src/components/ui/toast/Toast.tsx +327 -0
- package/src/components/ui/toast/index.ts +8 -0
- package/src/components/ui/toolbar-button/ToolbarButton.stories.tsx +415 -0
- package/src/components/ui/toolbar-button/ToolbarButton.test.tsx +224 -0
- package/src/components/ui/toolbar-button/ToolbarButton.tsx +307 -0
- package/src/components/ui/toolbar-button/index.ts +7 -0
- package/src/components/ui/tooltip/Tooltip.stories.tsx +126 -0
- package/src/components/ui/tooltip/Tooltip.test.tsx +179 -0
- package/src/components/ui/tooltip/Tooltip.tsx +143 -0
- package/src/components/ui/tooltip/index.ts +2 -0
- package/src/index.ts +10 -0
- package/src/test/setup.ts +19 -0
- package/src/theme/Colors.stories.tsx +258 -0
- package/src/theme/config.ts +193 -0
- package/src/theme/elevation.stories.tsx +346 -0
- package/src/theme/elevation.test.ts +27 -0
- package/src/theme/elevation.ts +567 -0
- package/src/theme/index.ts +39 -0
- package/src/theme/shadows.stories.tsx +523 -0
- package/src/theme/shadows.ts +439 -0
- package/src/theme/tokens/index.ts +2 -0
- package/src/theme/tokens/primitives.ts +354 -0
- package/src/theme/tokens/semantic.ts +381 -0
- package/src/types/jest-axe.d.ts +16 -0
- package/src/types/nativewind.d.ts +54 -0
- package/src/utils/cn.ts +14 -0
- package/src/utils/colors.ts +140 -0
- package/src/utils/form.ts +188 -0
- package/src/utils/index.ts +29 -0
- package/src/utils/useTheme.ts +72 -0
- package/dist/chunk-NA3EES23.mjs.map +0 -1
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import React, { useState, useRef } from 'react'
|
|
2
|
+
import { View, Text, Pressable, Modal, type ViewProps } from 'react-native'
|
|
3
|
+
import { cn } from '../../../utils/cn'
|
|
4
|
+
|
|
5
|
+
export type TooltipPlacement =
|
|
6
|
+
| 'top'
|
|
7
|
+
| 'top-start'
|
|
8
|
+
| 'top-end'
|
|
9
|
+
| 'bottom'
|
|
10
|
+
| 'bottom-start'
|
|
11
|
+
| 'bottom-end'
|
|
12
|
+
| 'left'
|
|
13
|
+
| 'right'
|
|
14
|
+
|
|
15
|
+
export interface TooltipProps extends ViewProps {
|
|
16
|
+
/** Tooltip content */
|
|
17
|
+
label: string
|
|
18
|
+
/** Trigger element */
|
|
19
|
+
children: React.ReactNode
|
|
20
|
+
/** Tooltip placement */
|
|
21
|
+
placement?: TooltipPlacement
|
|
22
|
+
/** Delay before showing (ms) */
|
|
23
|
+
openDelay?: number
|
|
24
|
+
/** Delay before hiding (ms) */
|
|
25
|
+
closeDelay?: number
|
|
26
|
+
/** Whether tooltip has an arrow */
|
|
27
|
+
hasArrow?: boolean
|
|
28
|
+
/** Whether tooltip is disabled */
|
|
29
|
+
isDisabled?: boolean
|
|
30
|
+
/** Additional className for tooltip */
|
|
31
|
+
className?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Tooltip component for showing additional information on hover/press.
|
|
36
|
+
*
|
|
37
|
+
* Note: On native, tooltips appear on long press. On web, they appear on hover.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* <Tooltip label="This is a tooltip">
|
|
41
|
+
* <Button><ButtonText>Hover me</ButtonText></Button>
|
|
42
|
+
* </Tooltip>
|
|
43
|
+
*/
|
|
44
|
+
export function Tooltip({
|
|
45
|
+
label,
|
|
46
|
+
children,
|
|
47
|
+
placement = 'top',
|
|
48
|
+
openDelay = 0,
|
|
49
|
+
closeDelay = 0,
|
|
50
|
+
hasArrow = true,
|
|
51
|
+
isDisabled = false,
|
|
52
|
+
className,
|
|
53
|
+
...props
|
|
54
|
+
}: TooltipProps) {
|
|
55
|
+
const [isVisible, setIsVisible] = useState(false)
|
|
56
|
+
const openTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
|
57
|
+
const closeTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null)
|
|
58
|
+
|
|
59
|
+
const clearTimeouts = () => {
|
|
60
|
+
if (openTimeoutRef.current) clearTimeout(openTimeoutRef.current)
|
|
61
|
+
if (closeTimeoutRef.current) clearTimeout(closeTimeoutRef.current)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const show = () => {
|
|
65
|
+
if (isDisabled) return
|
|
66
|
+
clearTimeouts()
|
|
67
|
+
if (openDelay > 0) {
|
|
68
|
+
openTimeoutRef.current = setTimeout(() => setIsVisible(true), openDelay)
|
|
69
|
+
} else {
|
|
70
|
+
setIsVisible(true)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const hide = () => {
|
|
75
|
+
clearTimeouts()
|
|
76
|
+
if (closeDelay > 0) {
|
|
77
|
+
closeTimeoutRef.current = setTimeout(() => setIsVisible(false), closeDelay)
|
|
78
|
+
} else {
|
|
79
|
+
setIsVisible(false)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Arrow positioning
|
|
84
|
+
const arrowStyles = {
|
|
85
|
+
top: 'bottom-0 left-1/2 -translate-x-1/2 translate-y-full border-l-transparent border-r-transparent border-b-transparent border-t-neutral-800',
|
|
86
|
+
'top-start': 'bottom-0 left-4 translate-y-full border-l-transparent border-r-transparent border-b-transparent border-t-neutral-800',
|
|
87
|
+
'top-end': 'bottom-0 right-4 translate-y-full border-l-transparent border-r-transparent border-b-transparent border-t-neutral-800',
|
|
88
|
+
bottom: 'top-0 left-1/2 -translate-x-1/2 -translate-y-full border-l-transparent border-r-transparent border-t-transparent border-b-neutral-800',
|
|
89
|
+
'bottom-start': 'top-0 left-4 -translate-y-full border-l-transparent border-r-transparent border-t-transparent border-b-neutral-800',
|
|
90
|
+
'bottom-end': 'top-0 right-4 -translate-y-full border-l-transparent border-r-transparent border-t-transparent border-b-neutral-800',
|
|
91
|
+
left: 'right-0 top-1/2 translate-x-full -translate-y-1/2 border-t-transparent border-b-transparent border-r-transparent border-l-neutral-800',
|
|
92
|
+
right: 'left-0 top-1/2 -translate-x-full -translate-y-1/2 border-t-transparent border-b-transparent border-l-transparent border-r-neutral-800',
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Tooltip positioning
|
|
96
|
+
const tooltipPositionStyles = {
|
|
97
|
+
top: 'bottom-full left-1/2 -translate-x-1/2 mb-2',
|
|
98
|
+
'top-start': 'bottom-full left-0 mb-2',
|
|
99
|
+
'top-end': 'bottom-full right-0 mb-2',
|
|
100
|
+
bottom: 'top-full left-1/2 -translate-x-1/2 mt-2',
|
|
101
|
+
'bottom-start': 'top-full left-0 mt-2',
|
|
102
|
+
'bottom-end': 'top-full right-0 mt-2',
|
|
103
|
+
left: 'right-full top-1/2 -translate-y-1/2 mr-2',
|
|
104
|
+
right: 'left-full top-1/2 -translate-y-1/2 ml-2',
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<View className="relative" {...props}>
|
|
109
|
+
<Pressable
|
|
110
|
+
onHoverIn={show}
|
|
111
|
+
onHoverOut={hide}
|
|
112
|
+
onLongPress={show}
|
|
113
|
+
onPressOut={hide}
|
|
114
|
+
delayLongPress={500}
|
|
115
|
+
>
|
|
116
|
+
{children}
|
|
117
|
+
</Pressable>
|
|
118
|
+
|
|
119
|
+
{isVisible && (
|
|
120
|
+
<View
|
|
121
|
+
className={cn(
|
|
122
|
+
'absolute z-50',
|
|
123
|
+
tooltipPositionStyles[placement],
|
|
124
|
+
className
|
|
125
|
+
)}
|
|
126
|
+
pointerEvents="none"
|
|
127
|
+
>
|
|
128
|
+
<View className="bg-neutral-800 px-3 py-2 rounded-md shadow-lg max-w-xs">
|
|
129
|
+
<Text className="text-white text-sm">{label}</Text>
|
|
130
|
+
{hasArrow && (
|
|
131
|
+
<View
|
|
132
|
+
className={cn(
|
|
133
|
+
'absolute w-0 h-0 border-4',
|
|
134
|
+
arrowStyles[placement]
|
|
135
|
+
)}
|
|
136
|
+
/>
|
|
137
|
+
)}
|
|
138
|
+
</View>
|
|
139
|
+
</View>
|
|
140
|
+
)}
|
|
141
|
+
</View>
|
|
142
|
+
)
|
|
143
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="vitest/globals" />
|
|
2
|
+
import '@testing-library/jest-dom'
|
|
3
|
+
import { expect, afterEach } from 'vitest'
|
|
4
|
+
import { cleanup } from '@testing-library/react'
|
|
5
|
+
import { toHaveNoViolations } from 'jest-axe'
|
|
6
|
+
|
|
7
|
+
// Extend Vitest's expect with jest-axe matchers
|
|
8
|
+
expect.extend(toHaveNoViolations)
|
|
9
|
+
|
|
10
|
+
// Cleanup after each test
|
|
11
|
+
afterEach(() => {
|
|
12
|
+
cleanup()
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
// Mock react-native components for web testing
|
|
16
|
+
vi.mock('react-native', async () => {
|
|
17
|
+
const RNW = await vi.importActual('react-native-web')
|
|
18
|
+
return RNW
|
|
19
|
+
})
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
+
import { View, Text } from 'react-native'
|
|
3
|
+
import { primitiveColors, discreteRainbow } from './tokens/primitives'
|
|
4
|
+
import { semanticColorsLight, semanticColorsDark } from './tokens/semantic'
|
|
5
|
+
|
|
6
|
+
const meta: Meta = {
|
|
7
|
+
title: 'Design Tokens/Colors',
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default meta
|
|
12
|
+
|
|
13
|
+
interface ColorSwatchProps {
|
|
14
|
+
name: string
|
|
15
|
+
value: string
|
|
16
|
+
textColor?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function ColorSwatch({ name, value, textColor = '#FFFFFF' }: ColorSwatchProps) {
|
|
20
|
+
const displayValue = value.startsWith('rgba') ? value : value.toUpperCase()
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 12 }}>
|
|
24
|
+
<View
|
|
25
|
+
style={{
|
|
26
|
+
width: 48,
|
|
27
|
+
height: 48,
|
|
28
|
+
borderRadius: 8,
|
|
29
|
+
backgroundColor: value,
|
|
30
|
+
borderWidth: 1,
|
|
31
|
+
borderColor: '#374151',
|
|
32
|
+
}}
|
|
33
|
+
/>
|
|
34
|
+
<View>
|
|
35
|
+
<Text className="font-semibold text-text-primary text-sm">
|
|
36
|
+
{name}
|
|
37
|
+
</Text>
|
|
38
|
+
<Text className="text-text-secondary text-xs">
|
|
39
|
+
{displayValue}
|
|
40
|
+
</Text>
|
|
41
|
+
</View>
|
|
42
|
+
</View>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function ColorScale({ name, colors }: { name: string; colors: Record<string | number, string> }) {
|
|
47
|
+
return (
|
|
48
|
+
<View style={{ marginBottom: 32 }}>
|
|
49
|
+
<Text className="text-lg font-bold text-text-primary mb-3">
|
|
50
|
+
{name}
|
|
51
|
+
</Text>
|
|
52
|
+
<View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 8 }}>
|
|
53
|
+
{Object.entries(colors).map(([shade, color]) => (
|
|
54
|
+
<View key={shade} style={{ alignItems: 'center' }}>
|
|
55
|
+
<View
|
|
56
|
+
style={{
|
|
57
|
+
width: 64,
|
|
58
|
+
height: 64,
|
|
59
|
+
borderRadius: 8,
|
|
60
|
+
backgroundColor: color,
|
|
61
|
+
borderWidth: 1,
|
|
62
|
+
borderColor: '#374151',
|
|
63
|
+
}}
|
|
64
|
+
/>
|
|
65
|
+
<Text className="text-text-secondary text-xs mt-1">
|
|
66
|
+
{shade}
|
|
67
|
+
</Text>
|
|
68
|
+
</View>
|
|
69
|
+
))}
|
|
70
|
+
</View>
|
|
71
|
+
</View>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const PrimitiveColors: StoryObj = {
|
|
76
|
+
render: () => (
|
|
77
|
+
<View style={{ padding: 24 }}>
|
|
78
|
+
<Text className="text-2xl font-bold text-text-primary mb-6">
|
|
79
|
+
Primitive Colors
|
|
80
|
+
</Text>
|
|
81
|
+
<Text className="text-text-secondary mb-6">
|
|
82
|
+
Raw color values. Use semantic tokens instead when building components.
|
|
83
|
+
</Text>
|
|
84
|
+
|
|
85
|
+
<ColorScale name="Orange (Primary Brand)" colors={primitiveColors.accent} />
|
|
86
|
+
<ColorScale name="Steel (Secondary Brand)" colors={primitiveColors.steel} />
|
|
87
|
+
<ColorScale name="Blue" colors={primitiveColors.blue} />
|
|
88
|
+
<ColorScale name="Green" colors={primitiveColors.green} />
|
|
89
|
+
<ColorScale name="Teal (Success)" colors={primitiveColors.teal} />
|
|
90
|
+
<ColorScale name="Red (Error)" colors={primitiveColors.red} />
|
|
91
|
+
<ColorScale name="Sky (Info)" colors={primitiveColors.sky} />
|
|
92
|
+
<ColorScale name="Neutral" colors={primitiveColors.neutral} />
|
|
93
|
+
<ColorScale name="Charcoal (Dark Backgrounds)" colors={primitiveColors.charcoal} />
|
|
94
|
+
</View>
|
|
95
|
+
),
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const BrandColors: StoryObj = {
|
|
99
|
+
render: () => (
|
|
100
|
+
<View style={{ padding: 24 }}>
|
|
101
|
+
<Text className="text-2xl font-bold text-text-primary mb-6">
|
|
102
|
+
Brand Colors
|
|
103
|
+
</Text>
|
|
104
|
+
|
|
105
|
+
<View style={{ gap: 16 }}>
|
|
106
|
+
<ColorSwatch name="brand-primary" value={semanticColorsLight['brand-primary']} />
|
|
107
|
+
<ColorSwatch name="brand-primary-light" value={semanticColorsLight['brand-primary-light']} />
|
|
108
|
+
<ColorSwatch name="brand-primary-dark" value={semanticColorsLight['brand-primary-dark']} />
|
|
109
|
+
<ColorSwatch name="brand-secondary" value={semanticColorsLight['brand-secondary']} />
|
|
110
|
+
<ColorSwatch name="brand-secondary-light" value={semanticColorsLight['brand-secondary-light']} />
|
|
111
|
+
<ColorSwatch name="brand-secondary-dark" value={semanticColorsLight['brand-secondary-dark']} />
|
|
112
|
+
</View>
|
|
113
|
+
</View>
|
|
114
|
+
),
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const StatusColors: StoryObj = {
|
|
118
|
+
render: () => (
|
|
119
|
+
<View style={{ padding: 24 }}>
|
|
120
|
+
<Text className="text-2xl font-bold text-text-primary mb-6">
|
|
121
|
+
Status Colors
|
|
122
|
+
</Text>
|
|
123
|
+
|
|
124
|
+
<View style={{ gap: 16 }}>
|
|
125
|
+
<ColorSwatch name="status-success" value={semanticColorsLight['status-success']} />
|
|
126
|
+
<ColorSwatch name="status-error" value={semanticColorsLight['status-error']} />
|
|
127
|
+
<ColorSwatch name="status-warning" value={semanticColorsLight['status-warning']} />
|
|
128
|
+
<ColorSwatch name="status-info" value={semanticColorsLight['status-info']} />
|
|
129
|
+
</View>
|
|
130
|
+
</View>
|
|
131
|
+
),
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export const TextColors: StoryObj = {
|
|
135
|
+
render: () => (
|
|
136
|
+
<View style={{ padding: 24 }}>
|
|
137
|
+
<Text className="text-2xl font-bold text-text-primary mb-6">
|
|
138
|
+
Text Colors (Dark Mode)
|
|
139
|
+
</Text>
|
|
140
|
+
|
|
141
|
+
<View style={{ gap: 16 }}>
|
|
142
|
+
<ColorSwatch name="text-primary" value={semanticColorsDark['text-primary']} />
|
|
143
|
+
<ColorSwatch name="text-secondary" value={semanticColorsDark['text-secondary']} />
|
|
144
|
+
<ColorSwatch name="text-tertiary" value={semanticColorsDark['text-tertiary']} />
|
|
145
|
+
<ColorSwatch name="text-disabled" value={semanticColorsDark['text-disabled']} />
|
|
146
|
+
<ColorSwatch name="text-link" value={semanticColorsDark['text-link']} />
|
|
147
|
+
</View>
|
|
148
|
+
</View>
|
|
149
|
+
),
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const SurfaceColors: StoryObj = {
|
|
153
|
+
render: () => (
|
|
154
|
+
<View style={{ padding: 24 }}>
|
|
155
|
+
<Text className="text-2xl font-bold text-text-primary mb-6">
|
|
156
|
+
Surface Colors (Dark Mode)
|
|
157
|
+
</Text>
|
|
158
|
+
|
|
159
|
+
<View style={{ gap: 16 }}>
|
|
160
|
+
<ColorSwatch name="surface-base" value={semanticColorsDark['surface-base']} />
|
|
161
|
+
<ColorSwatch name="surface-elevated" value={semanticColorsDark['surface-elevated']} />
|
|
162
|
+
<ColorSwatch name="surface-raised" value={semanticColorsDark['surface-raised']} />
|
|
163
|
+
<ColorSwatch name="surface-input" value={semanticColorsDark['surface-input']} />
|
|
164
|
+
<ColorSwatch name="background-base" value={semanticColorsDark['background-base']} />
|
|
165
|
+
<ColorSwatch name="background-default" value={semanticColorsDark['background-default']} />
|
|
166
|
+
</View>
|
|
167
|
+
</View>
|
|
168
|
+
),
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export const ResultColors: StoryObj = {
|
|
172
|
+
render: () => (
|
|
173
|
+
<View style={{ padding: 24 }}>
|
|
174
|
+
<Text className="text-2xl font-bold text-text-primary mb-6">
|
|
175
|
+
Result/Outcome Colors
|
|
176
|
+
</Text>
|
|
177
|
+
<Text className="text-text-secondary mb-6">
|
|
178
|
+
Colors for indicating positive, negative, or neutral outcomes.
|
|
179
|
+
</Text>
|
|
180
|
+
|
|
181
|
+
<View style={{ gap: 16 }}>
|
|
182
|
+
<ColorSwatch name="result-improve" value={semanticColorsLight['result-improve']} />
|
|
183
|
+
<ColorSwatch name="result-improve-light" value={semanticColorsLight['result-improve-light']} />
|
|
184
|
+
<ColorSwatch name="result-degrade" value={semanticColorsLight['result-degrade']} />
|
|
185
|
+
<ColorSwatch name="result-degrade-light" value={semanticColorsLight['result-degrade-light']} />
|
|
186
|
+
<ColorSwatch name="result-inconclusive" value={semanticColorsLight['result-inconclusive']} />
|
|
187
|
+
<ColorSwatch name="result-inconclusive-light" value={semanticColorsLight['result-inconclusive-light']} />
|
|
188
|
+
<ColorSwatch name="result-neutral" value={semanticColorsLight['result-neutral']} />
|
|
189
|
+
</View>
|
|
190
|
+
</View>
|
|
191
|
+
),
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export const DataVisualizationColors: StoryObj = {
|
|
195
|
+
render: () => (
|
|
196
|
+
<View style={{ padding: 24 }}>
|
|
197
|
+
<Text className="text-2xl font-bold text-text-primary mb-6">
|
|
198
|
+
Data Visualization Colors
|
|
199
|
+
</Text>
|
|
200
|
+
<Text className="text-text-secondary mb-6">
|
|
201
|
+
Colors optimized for charts and data visualization. Based on Paul Tol's color schemes.
|
|
202
|
+
</Text>
|
|
203
|
+
|
|
204
|
+
<View style={{ gap: 16 }}>
|
|
205
|
+
<ColorSwatch name="data-1" value={semanticColorsLight['data-1']} />
|
|
206
|
+
<ColorSwatch name="data-2" value={semanticColorsLight['data-2']} />
|
|
207
|
+
<ColorSwatch name="data-3" value={semanticColorsLight['data-3']} textColor="#000000" />
|
|
208
|
+
<ColorSwatch name="data-4" value={semanticColorsLight['data-4']} />
|
|
209
|
+
<ColorSwatch name="data-5" value={semanticColorsLight['data-5']} />
|
|
210
|
+
<ColorSwatch name="data-6" value={semanticColorsLight['data-6']} />
|
|
211
|
+
<ColorSwatch name="data-7" value={semanticColorsLight['data-7']} textColor="#000000" />
|
|
212
|
+
<ColorSwatch name="data-8" value={semanticColorsLight['data-8']} textColor="#000000" />
|
|
213
|
+
<ColorSwatch name="data-9" value={semanticColorsLight['data-9']} textColor="#000000" />
|
|
214
|
+
<ColorSwatch name="data-10" value={semanticColorsLight['data-10']} />
|
|
215
|
+
</View>
|
|
216
|
+
|
|
217
|
+
<Text className="text-lg font-bold text-text-primary mt-8 mb-3">
|
|
218
|
+
Full Discrete Rainbow Palette
|
|
219
|
+
</Text>
|
|
220
|
+
<View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 4 }}>
|
|
221
|
+
{discreteRainbow.map((color, index) => (
|
|
222
|
+
<View
|
|
223
|
+
key={index}
|
|
224
|
+
style={{
|
|
225
|
+
width: 32,
|
|
226
|
+
height: 32,
|
|
227
|
+
borderRadius: 4,
|
|
228
|
+
backgroundColor: color,
|
|
229
|
+
borderWidth: 1,
|
|
230
|
+
borderColor: '#374151',
|
|
231
|
+
}}
|
|
232
|
+
/>
|
|
233
|
+
))}
|
|
234
|
+
</View>
|
|
235
|
+
</View>
|
|
236
|
+
),
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export const BorderColors: StoryObj = {
|
|
240
|
+
render: () => (
|
|
241
|
+
<View style={{ padding: 24 }}>
|
|
242
|
+
<Text className="text-2xl font-bold text-text-primary mb-6">
|
|
243
|
+
Border Colors (Dark Mode)
|
|
244
|
+
</Text>
|
|
245
|
+
|
|
246
|
+
<View style={{ gap: 16 }}>
|
|
247
|
+
<ColorSwatch name="border-default" value={semanticColorsDark['border-default']} />
|
|
248
|
+
<ColorSwatch name="border-subtle" value={semanticColorsDark['border-subtle']} />
|
|
249
|
+
<ColorSwatch name="border-strong" value={semanticColorsDark['border-strong']} />
|
|
250
|
+
<ColorSwatch name="border-focus" value={semanticColorsDark['border-focus']} />
|
|
251
|
+
<ColorSwatch name="border-input" value={semanticColorsDark['border-input']} />
|
|
252
|
+
<ColorSwatch name="border-input-hover" value={semanticColorsDark['border-input-hover']} />
|
|
253
|
+
<ColorSwatch name="border-input-focus" value={semanticColorsDark['border-input-focus']} />
|
|
254
|
+
<ColorSwatch name="border-input-error" value={semanticColorsDark['border-input-error']} />
|
|
255
|
+
</View>
|
|
256
|
+
</View>
|
|
257
|
+
),
|
|
258
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme Configuration
|
|
3
|
+
*
|
|
4
|
+
* Maps semantic tokens to CSS custom properties for runtime theming.
|
|
5
|
+
* Dark mode is the default theme.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { semanticColorsLight, semanticColorsDark, type ThemeMode } from './tokens/semantic'
|
|
9
|
+
|
|
10
|
+
// CSS custom properties for light mode
|
|
11
|
+
export const lightThemeCSSVars = {
|
|
12
|
+
'--color-brand-primary': semanticColorsLight['brand-primary'],
|
|
13
|
+
'--color-brand-primary-light': semanticColorsLight['brand-primary-light'],
|
|
14
|
+
'--color-brand-primary-dark': semanticColorsLight['brand-primary-dark'],
|
|
15
|
+
'--color-brand-primary-subtle': semanticColorsLight['brand-primary-subtle'],
|
|
16
|
+
'--color-brand-secondary': semanticColorsLight['brand-secondary'],
|
|
17
|
+
'--color-brand-secondary-light': semanticColorsLight['brand-secondary-light'],
|
|
18
|
+
'--color-brand-secondary-dark': semanticColorsLight['brand-secondary-dark'],
|
|
19
|
+
'--color-brand-secondary-subtle': semanticColorsLight['brand-secondary-subtle'],
|
|
20
|
+
|
|
21
|
+
'--color-on-brand-primary': semanticColorsLight['on-brand-primary'],
|
|
22
|
+
'--color-on-brand-secondary': semanticColorsLight['on-brand-secondary'],
|
|
23
|
+
|
|
24
|
+
'--color-status-success': semanticColorsLight['status-success'],
|
|
25
|
+
'--color-status-success-subtle': semanticColorsLight['status-success-subtle'],
|
|
26
|
+
'--color-status-error': semanticColorsLight['status-error'],
|
|
27
|
+
'--color-status-error-subtle': semanticColorsLight['status-error-subtle'],
|
|
28
|
+
'--color-status-warning': semanticColorsLight['status-warning'],
|
|
29
|
+
'--color-status-warning-subtle': semanticColorsLight['status-warning-subtle'],
|
|
30
|
+
'--color-status-info': semanticColorsLight['status-info'],
|
|
31
|
+
'--color-status-info-subtle': semanticColorsLight['status-info-subtle'],
|
|
32
|
+
|
|
33
|
+
'--color-text-primary': semanticColorsLight['text-primary'],
|
|
34
|
+
'--color-text-secondary': semanticColorsLight['text-secondary'],
|
|
35
|
+
'--color-text-tertiary': semanticColorsLight['text-tertiary'],
|
|
36
|
+
'--color-text-disabled': semanticColorsLight['text-disabled'],
|
|
37
|
+
'--color-text-inverse': semanticColorsLight['text-inverse'],
|
|
38
|
+
'--color-text-link': semanticColorsLight['text-link'],
|
|
39
|
+
|
|
40
|
+
'--color-surface-base': semanticColorsLight['surface-base'],
|
|
41
|
+
'--color-surface-elevated': semanticColorsLight['surface-elevated'],
|
|
42
|
+
'--color-surface-raised': semanticColorsLight['surface-raised'],
|
|
43
|
+
|
|
44
|
+
'--color-background-base': semanticColorsLight['background-base'],
|
|
45
|
+
'--color-background-default': semanticColorsLight['background-default'],
|
|
46
|
+
'--color-background-subtle': semanticColorsLight['background-subtle'],
|
|
47
|
+
|
|
48
|
+
'--color-border-default': semanticColorsLight['border-default'],
|
|
49
|
+
'--color-border-subtle': semanticColorsLight['border-subtle'],
|
|
50
|
+
'--color-border-strong': semanticColorsLight['border-strong'],
|
|
51
|
+
'--color-border-focus': semanticColorsLight['border-focus'],
|
|
52
|
+
|
|
53
|
+
'--color-interactive-hover': semanticColorsLight['interactive-hover'],
|
|
54
|
+
'--color-interactive-focus': semanticColorsLight['interactive-focus'],
|
|
55
|
+
'--color-interactive-active': semanticColorsLight['interactive-active'],
|
|
56
|
+
'--color-interactive-selected': semanticColorsLight['interactive-selected'],
|
|
57
|
+
'--color-interactive-disabled': semanticColorsLight['interactive-disabled'],
|
|
58
|
+
|
|
59
|
+
'--color-divider': semanticColorsLight['divider'],
|
|
60
|
+
} as const
|
|
61
|
+
|
|
62
|
+
// CSS custom properties for dark mode (default)
|
|
63
|
+
export const darkThemeCSSVars = {
|
|
64
|
+
'--color-brand-primary': semanticColorsDark['brand-primary'],
|
|
65
|
+
'--color-brand-primary-light': semanticColorsDark['brand-primary-light'],
|
|
66
|
+
'--color-brand-primary-dark': semanticColorsDark['brand-primary-dark'],
|
|
67
|
+
'--color-brand-primary-subtle': semanticColorsDark['brand-primary-subtle'],
|
|
68
|
+
'--color-brand-secondary': semanticColorsDark['brand-secondary'],
|
|
69
|
+
'--color-brand-secondary-light': semanticColorsDark['brand-secondary-light'],
|
|
70
|
+
'--color-brand-secondary-dark': semanticColorsDark['brand-secondary-dark'],
|
|
71
|
+
'--color-brand-secondary-subtle': semanticColorsDark['brand-secondary-subtle'],
|
|
72
|
+
|
|
73
|
+
'--color-on-brand-primary': semanticColorsDark['on-brand-primary'],
|
|
74
|
+
'--color-on-brand-secondary': semanticColorsDark['on-brand-secondary'],
|
|
75
|
+
|
|
76
|
+
'--color-status-success': semanticColorsDark['status-success'],
|
|
77
|
+
'--color-status-success-subtle': semanticColorsDark['status-success-subtle'],
|
|
78
|
+
'--color-status-error': semanticColorsDark['status-error'],
|
|
79
|
+
'--color-status-error-subtle': semanticColorsDark['status-error-subtle'],
|
|
80
|
+
'--color-status-warning': semanticColorsDark['status-warning'],
|
|
81
|
+
'--color-status-warning-subtle': semanticColorsDark['status-warning-subtle'],
|
|
82
|
+
'--color-status-info': semanticColorsDark['status-info'],
|
|
83
|
+
'--color-status-info-subtle': semanticColorsDark['status-info-subtle'],
|
|
84
|
+
|
|
85
|
+
'--color-text-primary': semanticColorsDark['text-primary'],
|
|
86
|
+
'--color-text-secondary': semanticColorsDark['text-secondary'],
|
|
87
|
+
'--color-text-tertiary': semanticColorsDark['text-tertiary'],
|
|
88
|
+
'--color-text-disabled': semanticColorsDark['text-disabled'],
|
|
89
|
+
'--color-text-inverse': semanticColorsDark['text-inverse'],
|
|
90
|
+
'--color-text-link': semanticColorsDark['text-link'],
|
|
91
|
+
|
|
92
|
+
'--color-surface-base': semanticColorsDark['surface-base'],
|
|
93
|
+
'--color-surface-elevated': semanticColorsDark['surface-elevated'],
|
|
94
|
+
'--color-surface-raised': semanticColorsDark['surface-raised'],
|
|
95
|
+
|
|
96
|
+
'--color-background-base': semanticColorsDark['background-base'],
|
|
97
|
+
'--color-background-default': semanticColorsDark['background-default'],
|
|
98
|
+
'--color-background-subtle': semanticColorsDark['background-subtle'],
|
|
99
|
+
|
|
100
|
+
'--color-border-default': semanticColorsDark['border-default'],
|
|
101
|
+
'--color-border-subtle': semanticColorsDark['border-subtle'],
|
|
102
|
+
'--color-border-strong': semanticColorsDark['border-strong'],
|
|
103
|
+
'--color-border-focus': semanticColorsDark['border-focus'],
|
|
104
|
+
|
|
105
|
+
'--color-interactive-hover': semanticColorsDark['interactive-hover'],
|
|
106
|
+
'--color-interactive-focus': semanticColorsDark['interactive-focus'],
|
|
107
|
+
'--color-interactive-active': semanticColorsDark['interactive-active'],
|
|
108
|
+
'--color-interactive-selected': semanticColorsDark['interactive-selected'],
|
|
109
|
+
'--color-interactive-disabled': semanticColorsDark['interactive-disabled'],
|
|
110
|
+
|
|
111
|
+
'--color-divider': semanticColorsDark['divider'],
|
|
112
|
+
} as const
|
|
113
|
+
|
|
114
|
+
// Helper to get CSS vars for a theme mode
|
|
115
|
+
export function getThemeCSSVars(mode: ThemeMode) {
|
|
116
|
+
return mode === 'dark' ? darkThemeCSSVars : lightThemeCSSVars
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Gluestack UI theme configuration
|
|
120
|
+
export const gluestackConfig = {
|
|
121
|
+
tokens: {
|
|
122
|
+
colors: {
|
|
123
|
+
// Map to our semantic colors via CSS vars
|
|
124
|
+
primary500: 'var(--color-brand-primary)',
|
|
125
|
+
primary600: 'var(--color-brand-primary-dark)',
|
|
126
|
+
primary400: 'var(--color-brand-primary-light)',
|
|
127
|
+
|
|
128
|
+
secondary500: 'var(--color-brand-secondary)',
|
|
129
|
+
secondary600: 'var(--color-brand-secondary-dark)',
|
|
130
|
+
secondary400: 'var(--color-brand-secondary-light)',
|
|
131
|
+
|
|
132
|
+
success500: 'var(--color-status-success)',
|
|
133
|
+
error500: 'var(--color-status-error)',
|
|
134
|
+
warning500: 'var(--color-status-warning)',
|
|
135
|
+
info500: 'var(--color-status-info)',
|
|
136
|
+
|
|
137
|
+
textLight: 'var(--color-text-primary)',
|
|
138
|
+
textDark: 'var(--color-text-inverse)',
|
|
139
|
+
|
|
140
|
+
backgroundLight: 'var(--color-background-default)',
|
|
141
|
+
backgroundDark: 'var(--color-surface-base)',
|
|
142
|
+
},
|
|
143
|
+
space: {
|
|
144
|
+
'0': 0,
|
|
145
|
+
'1': 4,
|
|
146
|
+
'2': 8,
|
|
147
|
+
'3': 12,
|
|
148
|
+
'4': 16,
|
|
149
|
+
'5': 20,
|
|
150
|
+
'6': 24,
|
|
151
|
+
'8': 32,
|
|
152
|
+
'10': 40,
|
|
153
|
+
'12': 48,
|
|
154
|
+
'16': 64,
|
|
155
|
+
'20': 80,
|
|
156
|
+
'24': 96,
|
|
157
|
+
},
|
|
158
|
+
radii: {
|
|
159
|
+
none: 0,
|
|
160
|
+
sm: 4,
|
|
161
|
+
md: 8,
|
|
162
|
+
lg: 12,
|
|
163
|
+
xl: 16,
|
|
164
|
+
'2xl': 24,
|
|
165
|
+
full: 9999,
|
|
166
|
+
},
|
|
167
|
+
fontSizes: {
|
|
168
|
+
xs: 12,
|
|
169
|
+
sm: 14,
|
|
170
|
+
md: 16,
|
|
171
|
+
lg: 18,
|
|
172
|
+
xl: 20,
|
|
173
|
+
'2xl': 24,
|
|
174
|
+
'3xl': 30,
|
|
175
|
+
'4xl': 36,
|
|
176
|
+
'5xl': 48,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
aliases: {
|
|
180
|
+
bg: 'backgroundColor',
|
|
181
|
+
p: 'padding',
|
|
182
|
+
px: 'paddingHorizontal',
|
|
183
|
+
py: 'paddingVertical',
|
|
184
|
+
m: 'margin',
|
|
185
|
+
mx: 'marginHorizontal',
|
|
186
|
+
my: 'marginVertical',
|
|
187
|
+
h: 'height',
|
|
188
|
+
w: 'width',
|
|
189
|
+
rounded: 'borderRadius',
|
|
190
|
+
},
|
|
191
|
+
} as const
|
|
192
|
+
|
|
193
|
+
export type ThemeConfig = typeof gluestackConfig
|