@campxdev/react-native-blueprint 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/LICENSE +20 -0
- package/README.md +358 -0
- package/lib/module/app/_layout.js +23 -0
- package/lib/module/app/_layout.js.map +1 -0
- package/lib/module/assets/icons/weather_icons/drizzle.png +0 -0
- package/lib/module/assets/icons/weather_icons/foggy.png +0 -0
- package/lib/module/assets/icons/weather_icons/freezing_rain.png +0 -0
- package/lib/module/assets/icons/weather_icons/partly_cloudy.png +0 -0
- package/lib/module/assets/icons/weather_icons/rainy.png +0 -0
- package/lib/module/assets/icons/weather_icons/showers.png +0 -0
- package/lib/module/assets/icons/weather_icons/sunny_weather.png +0 -0
- package/lib/module/assets/icons/weather_icons/thunderstorm.png +0 -0
- package/lib/module/assets/icons/weather_icons/thunderstorm_hail.png +0 -0
- package/lib/module/components/theme-config.js +265 -0
- package/lib/module/components/theme-config.js.map +1 -0
- package/lib/module/components/ui/Accordion.js +228 -0
- package/lib/module/components/ui/Accordion.js.map +1 -0
- package/lib/module/components/ui/Alert-Dialog.js +266 -0
- package/lib/module/components/ui/Alert-Dialog.js.map +1 -0
- package/lib/module/components/ui/Alert.js +107 -0
- package/lib/module/components/ui/Alert.js.map +1 -0
- package/lib/module/components/ui/AppBar.js +403 -0
- package/lib/module/components/ui/AppBar.js.map +1 -0
- package/lib/module/components/ui/Aspect-Ratio.js +27 -0
- package/lib/module/components/ui/Aspect-Ratio.js.map +1 -0
- package/lib/module/components/ui/Avatar.js +97 -0
- package/lib/module/components/ui/Avatar.js.map +1 -0
- package/lib/module/components/ui/Badge.js +127 -0
- package/lib/module/components/ui/Badge.js.map +1 -0
- package/lib/module/components/ui/Bottom-Sheet.js +144 -0
- package/lib/module/components/ui/Bottom-Sheet.js.map +1 -0
- package/lib/module/components/ui/Button.js +88 -0
- package/lib/module/components/ui/Button.js.map +1 -0
- package/lib/module/components/ui/Card.js +176 -0
- package/lib/module/components/ui/Card.js.map +1 -0
- package/lib/module/components/ui/Checkbox.js +65 -0
- package/lib/module/components/ui/Checkbox.js.map +1 -0
- package/lib/module/components/ui/Collapsible.js +42 -0
- package/lib/module/components/ui/Collapsible.js.map +1 -0
- package/lib/module/components/ui/Context-Menu.js +287 -0
- package/lib/module/components/ui/Context-Menu.js.map +1 -0
- package/lib/module/components/ui/Custom-Card.js +202 -0
- package/lib/module/components/ui/Custom-Card.js.map +1 -0
- package/lib/module/components/ui/Dialog.js +202 -0
- package/lib/module/components/ui/Dialog.js.map +1 -0
- package/lib/module/components/ui/Dropdown-Menu.js +421 -0
- package/lib/module/components/ui/Dropdown-Menu.js.map +1 -0
- package/lib/module/components/ui/Floating-Action.js +50 -0
- package/lib/module/components/ui/Floating-Action.js.map +1 -0
- package/lib/module/components/ui/Greeting-Card.js +392 -0
- package/lib/module/components/ui/Greeting-Card.js.map +1 -0
- package/lib/module/components/ui/Hover-Card.js +96 -0
- package/lib/module/components/ui/Hover-Card.js.map +1 -0
- package/lib/module/components/ui/Icon.js +73 -0
- package/lib/module/components/ui/Icon.js.map +1 -0
- package/lib/module/components/ui/Input.js +74 -0
- package/lib/module/components/ui/Input.js.map +1 -0
- package/lib/module/components/ui/Label.js +44 -0
- package/lib/module/components/ui/Label.js.map +1 -0
- package/lib/module/components/ui/Menubar.js +375 -0
- package/lib/module/components/ui/Menubar.js.map +1 -0
- package/lib/module/components/ui/Native-Only-Animated-View.js +41 -0
- package/lib/module/components/ui/Native-Only-Animated-View.js.map +1 -0
- package/lib/module/components/ui/NavBar.js +352 -0
- package/lib/module/components/ui/NavBar.js.map +1 -0
- package/lib/module/components/ui/Popover.js +101 -0
- package/lib/module/components/ui/Popover.js.map +1 -0
- package/lib/module/components/ui/Progress.js +124 -0
- package/lib/module/components/ui/Progress.js.map +1 -0
- package/lib/module/components/ui/Radio-Group.js +75 -0
- package/lib/module/components/ui/Radio-Group.js.map +1 -0
- package/lib/module/components/ui/Select.js +269 -0
- package/lib/module/components/ui/Select.js.map +1 -0
- package/lib/module/components/ui/Separator.js +58 -0
- package/lib/module/components/ui/Separator.js.map +1 -0
- package/lib/module/components/ui/SizedBox.js +101 -0
- package/lib/module/components/ui/SizedBox.js.map +1 -0
- package/lib/module/components/ui/Skeleton.js +57 -0
- package/lib/module/components/ui/Skeleton.js.map +1 -0
- package/lib/module/components/ui/Slider.js +169 -0
- package/lib/module/components/ui/Slider.js.map +1 -0
- package/lib/module/components/ui/Switch.js +55 -0
- package/lib/module/components/ui/Switch.js.map +1 -0
- package/lib/module/components/ui/Table.js +150 -0
- package/lib/module/components/ui/Table.js.map +1 -0
- package/lib/module/components/ui/Tabs.js +106 -0
- package/lib/module/components/ui/Tabs.js.map +1 -0
- package/lib/module/components/ui/Text.js +69 -0
- package/lib/module/components/ui/Text.js.map +1 -0
- package/lib/module/components/ui/Textarea.js +88 -0
- package/lib/module/components/ui/Textarea.js.map +1 -0
- package/lib/module/components/ui/Theme-Toggle.js +156 -0
- package/lib/module/components/ui/Theme-Toggle.js.map +1 -0
- package/lib/module/components/ui/Toast.js +101 -0
- package/lib/module/components/ui/Toast.js.map +1 -0
- package/lib/module/components/ui/Toggle-Group.js +129 -0
- package/lib/module/components/ui/Toggle-Group.js.map +1 -0
- package/lib/module/components/ui/Toggle.js +106 -0
- package/lib/module/components/ui/Toggle.js.map +1 -0
- package/lib/module/components/ui/Tooltip.js +106 -0
- package/lib/module/components/ui/Tooltip.js.map +1 -0
- package/lib/module/components/ui/index.js +45 -0
- package/lib/module/components/ui/index.js.map +1 -0
- package/lib/module/index.js +19 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/lib/ThemeProvider.js +173 -0
- package/lib/module/lib/ThemeProvider.js.map +1 -0
- package/lib/module/lib/cornerRadius.js +164 -0
- package/lib/module/lib/cornerRadius.js.map +1 -0
- package/lib/module/lib/fonts.js +25 -0
- package/lib/module/lib/fonts.js.map +1 -0
- package/lib/module/lib/theme.js +212 -0
- package/lib/module/lib/theme.js.map +1 -0
- package/lib/module/lib/utils.js +137 -0
- package/lib/module/lib/utils.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/package.json +208 -0
- package/src/app/_layout.tsx +25 -0
- package/src/assets/icons/weather_icons/drizzle.png +0 -0
- package/src/assets/icons/weather_icons/foggy.png +0 -0
- package/src/assets/icons/weather_icons/freezing_rain.png +0 -0
- package/src/assets/icons/weather_icons/partly_cloudy.png +0 -0
- package/src/assets/icons/weather_icons/rainy.png +0 -0
- package/src/assets/icons/weather_icons/showers.png +0 -0
- package/src/assets/icons/weather_icons/sunny_weather.png +0 -0
- package/src/assets/icons/weather_icons/thunderstorm.png +0 -0
- package/src/assets/icons/weather_icons/thunderstorm_hail.png +0 -0
- package/src/components/theme-config.ts +331 -0
- package/src/components/ui/Accordion.tsx +253 -0
- package/src/components/ui/Alert-Dialog.tsx +295 -0
- package/src/components/ui/Alert.tsx +137 -0
- package/src/components/ui/AppBar.tsx +551 -0
- package/src/components/ui/Aspect-Ratio.tsx +25 -0
- package/src/components/ui/Avatar.tsx +103 -0
- package/src/components/ui/Badge.tsx +121 -0
- package/src/components/ui/Bottom-Sheet.tsx +224 -0
- package/src/components/ui/Button.tsx +100 -0
- package/src/components/ui/Card.tsx +185 -0
- package/src/components/ui/Checkbox.tsx +81 -0
- package/src/components/ui/Collapsible.tsx +40 -0
- package/src/components/ui/Context-Menu.tsx +407 -0
- package/src/components/ui/Custom-Card.tsx +226 -0
- package/src/components/ui/Dialog.tsx +240 -0
- package/src/components/ui/Dropdown-Menu.tsx +544 -0
- package/src/components/ui/Floating-Action.tsx +54 -0
- package/src/components/ui/Greeting-Card.tsx +471 -0
- package/src/components/ui/Hover-Card.tsx +101 -0
- package/src/components/ui/Icon.tsx +75 -0
- package/src/components/ui/Input.tsx +90 -0
- package/src/components/ui/Label.tsx +48 -0
- package/src/components/ui/Menubar.tsx +509 -0
- package/src/components/ui/Native-Only-Animated-View.tsx +37 -0
- package/src/components/ui/NavBar.tsx +397 -0
- package/src/components/ui/Popover.tsx +110 -0
- package/src/components/ui/Progress.tsx +138 -0
- package/src/components/ui/Radio-Group.tsx +79 -0
- package/src/components/ui/Select.tsx +344 -0
- package/src/components/ui/Separator.tsx +68 -0
- package/src/components/ui/SizedBox.tsx +116 -0
- package/src/components/ui/Skeleton.tsx +55 -0
- package/src/components/ui/Slider.tsx +222 -0
- package/src/components/ui/Switch.tsx +67 -0
- package/src/components/ui/Table.tsx +170 -0
- package/src/components/ui/Tabs.tsx +119 -0
- package/src/components/ui/Text.tsx +73 -0
- package/src/components/ui/Textarea.tsx +93 -0
- package/src/components/ui/Theme-Toggle.tsx +204 -0
- package/src/components/ui/Toast.tsx +127 -0
- package/src/components/ui/Toggle-Group.tsx +160 -0
- package/src/components/ui/Toggle.tsx +122 -0
- package/src/components/ui/Tooltip.tsx +117 -0
- package/src/components/ui/index.ts +42 -0
- package/src/index.tsx +24 -0
- package/src/lib/ThemeProvider.tsx +204 -0
- package/src/lib/cornerRadius.ts +160 -0
- package/src/lib/fonts.ts +28 -0
- package/src/lib/theme.ts +151 -0
- package/src/lib/utils.ts +146 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Icon } from "./Icon.js";
|
|
4
|
+
import { NativeOnlyAnimatedView } from "./Native-Only-Animated-View.js";
|
|
5
|
+
import { TextClassContext } from "./Text.js";
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
|
+
import * as SelectPrimitive from '@rn-primitives/select';
|
|
8
|
+
import { Check, ChevronDown, ChevronDownIcon, ChevronUpIcon } from 'lucide-react-native';
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { Platform, ScrollView, StyleSheet, View } from 'react-native';
|
|
11
|
+
import { cssInterop } from 'nativewind';
|
|
12
|
+
import { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
13
|
+
import { FullWindowOverlay as RNFullWindowOverlay } from 'react-native-screens';
|
|
14
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
cssInterop(View, {
|
|
16
|
+
className: 'style'
|
|
17
|
+
});
|
|
18
|
+
cssInterop(ScrollView, {
|
|
19
|
+
className: 'style'
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Option type for select items
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Root select component for dropdown selection
|
|
28
|
+
*
|
|
29
|
+
* @component
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <Select value={value} onValueChange={setValue}>
|
|
33
|
+
* <SelectTrigger>
|
|
34
|
+
* <SelectValue placeholder="Select an option" />
|
|
35
|
+
* </SelectTrigger>
|
|
36
|
+
* <SelectContent>
|
|
37
|
+
* <SelectItem value="option1">
|
|
38
|
+
* <Text>Option 1</Text>
|
|
39
|
+
* </SelectItem>
|
|
40
|
+
* </SelectContent>
|
|
41
|
+
* </Select>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
const Select = SelectPrimitive.Root;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Groups related select items together
|
|
48
|
+
* @component
|
|
49
|
+
*/
|
|
50
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Displays the selected value or placeholder text
|
|
54
|
+
* @component
|
|
55
|
+
*/
|
|
56
|
+
function SelectValue({
|
|
57
|
+
ref,
|
|
58
|
+
className,
|
|
59
|
+
...props
|
|
60
|
+
}) {
|
|
61
|
+
const {
|
|
62
|
+
value
|
|
63
|
+
} = SelectPrimitive.useRootContext();
|
|
64
|
+
return /*#__PURE__*/_jsx(SelectPrimitive.Value, {
|
|
65
|
+
ref: ref,
|
|
66
|
+
className: cn('text-foreground line-clamp-1 flex flex-row items-center gap-2 text-sm', !value && 'text-muted-foreground', className),
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Trigger button that opens the select dropdown
|
|
73
|
+
* @component
|
|
74
|
+
*/
|
|
75
|
+
function SelectTrigger({
|
|
76
|
+
ref,
|
|
77
|
+
className,
|
|
78
|
+
children,
|
|
79
|
+
size = 'default',
|
|
80
|
+
...props
|
|
81
|
+
}) {
|
|
82
|
+
return /*#__PURE__*/_jsxs(SelectPrimitive.Trigger, {
|
|
83
|
+
ref: ref,
|
|
84
|
+
className: cn('border-input dark:bg-input/30 dark:active:bg-input/50 bg-background flex h-10 flex-row items-center justify-between gap-2 rounded-md border px-3 py-2 shadow-sm shadow-black/5 sm:h-9', Platform.select({
|
|
85
|
+
web: 'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:hover:bg-input/50 w-fit whitespace-nowrap text-sm outline-none transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:shrink-0'
|
|
86
|
+
}), props.disabled && 'opacity-50', size === 'sm' && 'h-8 py-2 sm:py-1.5', className),
|
|
87
|
+
...props,
|
|
88
|
+
children: [/*#__PURE__*/_jsx(_Fragment, {
|
|
89
|
+
children: children
|
|
90
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
91
|
+
as: ChevronDown,
|
|
92
|
+
"aria-hidden": true,
|
|
93
|
+
className: "text-muted-foreground size-4"
|
|
94
|
+
})]
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Full window overlay wrapper for iOS
|
|
100
|
+
*/
|
|
101
|
+
const FullWindowOverlay = Platform.OS === 'ios' ? RNFullWindowOverlay : React.Fragment;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Content container for select items
|
|
105
|
+
* @component
|
|
106
|
+
*/
|
|
107
|
+
function SelectContent({
|
|
108
|
+
className,
|
|
109
|
+
children,
|
|
110
|
+
position = 'popper',
|
|
111
|
+
portalHost,
|
|
112
|
+
...props
|
|
113
|
+
}) {
|
|
114
|
+
return /*#__PURE__*/_jsx(SelectPrimitive.Portal, {
|
|
115
|
+
hostName: portalHost,
|
|
116
|
+
children: /*#__PURE__*/_jsx(FullWindowOverlay, {
|
|
117
|
+
children: /*#__PURE__*/_jsx(SelectPrimitive.Overlay, {
|
|
118
|
+
style: Platform.select({
|
|
119
|
+
native: StyleSheet.absoluteFill
|
|
120
|
+
}),
|
|
121
|
+
children: /*#__PURE__*/_jsx(TextClassContext.Provider, {
|
|
122
|
+
value: "text-popover-foreground",
|
|
123
|
+
children: /*#__PURE__*/_jsx(NativeOnlyAnimatedView, {
|
|
124
|
+
className: "z-50",
|
|
125
|
+
entering: FadeIn,
|
|
126
|
+
exiting: FadeOut,
|
|
127
|
+
children: /*#__PURE__*/_jsxs(SelectPrimitive.Content, {
|
|
128
|
+
className: cn('bg-popover border-border relative z-50 min-w-[8rem] rounded-md border shadow-md shadow-black/5', Platform.select({
|
|
129
|
+
web: cn('animate-in fade-in-0 zoom-in-95 origin-(--radix-select-content-transform-origin) max-h-52 overflow-y-auto overflow-x-hidden', props.side === 'bottom' && 'slide-in-from-top-2', props.side === 'top' && 'slide-in-from-bottom-2'),
|
|
130
|
+
native: 'p-1'
|
|
131
|
+
}), position === 'popper' && Platform.select({
|
|
132
|
+
web: cn(props.side === 'bottom' && 'translate-y-1', props.side === 'top' && '-translate-y-1')
|
|
133
|
+
}), className),
|
|
134
|
+
position: position,
|
|
135
|
+
...props,
|
|
136
|
+
children: [/*#__PURE__*/_jsx(SelectScrollUpButton, {}), /*#__PURE__*/_jsx(SelectPrimitive.Viewport, {
|
|
137
|
+
className: cn('p-1', position === 'popper' && cn('w-full', Platform.select({
|
|
138
|
+
web: 'h-[var(--radix-select-trigger-height)] min-w-[var(--radix-select-trigger-width)]'
|
|
139
|
+
}))),
|
|
140
|
+
children: children
|
|
141
|
+
}), /*#__PURE__*/_jsx(SelectScrollDownButton, {})]
|
|
142
|
+
})
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Label for grouping select items
|
|
152
|
+
* @component
|
|
153
|
+
*/
|
|
154
|
+
function SelectLabel({
|
|
155
|
+
className,
|
|
156
|
+
...props
|
|
157
|
+
}) {
|
|
158
|
+
return /*#__PURE__*/_jsx(SelectPrimitive.Label, {
|
|
159
|
+
className: cn('text-muted-foreground px-2 py-2 text-xs sm:py-1.5', className),
|
|
160
|
+
...props
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Individual selectable item
|
|
166
|
+
* @component
|
|
167
|
+
*/
|
|
168
|
+
function SelectItem({
|
|
169
|
+
className,
|
|
170
|
+
children: _children,
|
|
171
|
+
...props
|
|
172
|
+
}) {
|
|
173
|
+
return /*#__PURE__*/_jsxs(SelectPrimitive.Item, {
|
|
174
|
+
className: cn('active:bg-accent group relative flex w-full flex-row items-center gap-2 rounded-sm py-2 pl-2 pr-8 sm:py-1.5', Platform.select({
|
|
175
|
+
web: 'focus:bg-accent focus:text-accent-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 cursor-default outline-none data-[disabled]:pointer-events-none [&_svg]:pointer-events-none'
|
|
176
|
+
}), props.disabled && 'opacity-50', className),
|
|
177
|
+
...props,
|
|
178
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
179
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
180
|
+
children: /*#__PURE__*/_jsx(SelectPrimitive.ItemIndicator, {
|
|
181
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
182
|
+
as: Check,
|
|
183
|
+
className: "text-muted-foreground size-4 shrink-0"
|
|
184
|
+
})
|
|
185
|
+
})
|
|
186
|
+
}), /*#__PURE__*/_jsx(SelectPrimitive.ItemText, {
|
|
187
|
+
className: "text-foreground group-active:text-accent-foreground select-none text-sm"
|
|
188
|
+
})]
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Visual separator between select items
|
|
194
|
+
* @component
|
|
195
|
+
*/
|
|
196
|
+
function SelectSeparator({
|
|
197
|
+
className,
|
|
198
|
+
...props
|
|
199
|
+
}) {
|
|
200
|
+
return /*#__PURE__*/_jsx(SelectPrimitive.Separator, {
|
|
201
|
+
className: cn('bg-border -mx-1 my-1 h-px', Platform.select({
|
|
202
|
+
web: 'pointer-events-none'
|
|
203
|
+
}), className),
|
|
204
|
+
...props
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @platform Web only
|
|
210
|
+
* Returns null on native platforms
|
|
211
|
+
*/
|
|
212
|
+
function SelectScrollUpButton({
|
|
213
|
+
className,
|
|
214
|
+
...props
|
|
215
|
+
}) {
|
|
216
|
+
if (Platform.OS !== 'web') {
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
return /*#__PURE__*/_jsx(SelectPrimitive.ScrollUpButton, {
|
|
220
|
+
className: cn('flex cursor-default items-center justify-center py-1', className),
|
|
221
|
+
...props,
|
|
222
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
223
|
+
as: ChevronUpIcon,
|
|
224
|
+
className: "size-4"
|
|
225
|
+
})
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @platform Web only
|
|
231
|
+
* Returns null on native platforms
|
|
232
|
+
*/
|
|
233
|
+
function SelectScrollDownButton({
|
|
234
|
+
className,
|
|
235
|
+
...props
|
|
236
|
+
}) {
|
|
237
|
+
if (Platform.OS !== 'web') {
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
return /*#__PURE__*/_jsx(SelectPrimitive.ScrollDownButton, {
|
|
241
|
+
className: cn('flex cursor-default items-center justify-center py-1', className),
|
|
242
|
+
...props,
|
|
243
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
244
|
+
as: ChevronDownIcon,
|
|
245
|
+
className: "size-4"
|
|
246
|
+
})
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @platform Native only
|
|
252
|
+
* Returns the children on the web
|
|
253
|
+
*/
|
|
254
|
+
function NativeSelectScrollView({
|
|
255
|
+
className,
|
|
256
|
+
...props
|
|
257
|
+
}) {
|
|
258
|
+
if (Platform.OS === 'web') {
|
|
259
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
260
|
+
children: props.children
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
return /*#__PURE__*/_jsx(ScrollView, {
|
|
264
|
+
className: cn('max-h-52', className),
|
|
265
|
+
...props
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
export { NativeSelectScrollView, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|
|
269
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Icon","NativeOnlyAnimatedView","TextClassContext","cn","SelectPrimitive","Check","ChevronDown","ChevronDownIcon","ChevronUpIcon","React","Platform","ScrollView","StyleSheet","View","cssInterop","FadeIn","FadeOut","FullWindowOverlay","RNFullWindowOverlay","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","className","Select","Root","SelectGroup","Group","SelectValue","ref","props","value","useRootContext","Value","SelectTrigger","children","size","Trigger","select","web","disabled","as","OS","SelectContent","position","portalHost","Portal","hostName","Overlay","style","native","absoluteFill","Provider","entering","exiting","Content","side","SelectScrollUpButton","Viewport","SelectScrollDownButton","SelectLabel","Label","SelectItem","_children","Item","ItemIndicator","ItemText","SelectSeparator","Separator","ScrollUpButton","ScrollDownButton","NativeSelectScrollView"],"sourceRoot":"../../../../src","sources":["components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IAAA,CAACT,UAAU;IAACc,SAAS,EAAEtB,EAAE,CAAC,UAAU,EAAEsB,SAAS,CAAE;IAAA,GAAKO;EAAK,CAAG,CAAC;AACxE;AAEA,SACEyC,sBAAsB,EACtB/C,MAAM,EACNmB,aAAa,EACbjB,WAAW,EACXoC,UAAU,EACVF,WAAW,EACXD,sBAAsB,EACtBF,oBAAoB,EACpBU,eAAe,EACfjC,aAAa,EACbN,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { cssInterop } from 'nativewind';
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
cssInterop(View, {
|
|
9
|
+
className: 'style'
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Visual divider for separating content sections
|
|
14
|
+
*
|
|
15
|
+
* A thin line that creates visual separation between content areas. Can be oriented
|
|
16
|
+
* horizontally or vertically and supports decorative or semantic roles.
|
|
17
|
+
*
|
|
18
|
+
* @component
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* // Horizontal separator (default)
|
|
22
|
+
* <View>
|
|
23
|
+
* <Text>Section 1</Text>
|
|
24
|
+
* <Separator className="my-4" />
|
|
25
|
+
* <Text>Section 2</Text>
|
|
26
|
+
* </View>
|
|
27
|
+
*
|
|
28
|
+
* // Vertical separator
|
|
29
|
+
* <View className="flex-row items-center gap-4">
|
|
30
|
+
* <Text>Left</Text>
|
|
31
|
+
* <Separator orientation="vertical" className="h-4" />
|
|
32
|
+
* <Text>Right</Text>
|
|
33
|
+
* </View>
|
|
34
|
+
*
|
|
35
|
+
* // Semantic separator for screen readers
|
|
36
|
+
* <Separator decorative={false} />
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @accessibility
|
|
40
|
+
* - Decorative separators (default) have role="none" for screen readers
|
|
41
|
+
* - Non-decorative separators have role="separator" for semantic meaning
|
|
42
|
+
*/
|
|
43
|
+
const Separator = /*#__PURE__*/React.forwardRef(({
|
|
44
|
+
className,
|
|
45
|
+
orientation = 'horizontal',
|
|
46
|
+
decorative = true,
|
|
47
|
+
...props
|
|
48
|
+
}, ref) => {
|
|
49
|
+
return /*#__PURE__*/_jsx(View, {
|
|
50
|
+
role: decorative ? 'none' : 'separator',
|
|
51
|
+
className: cn('shrink-0 bg-border dark:bg-border', orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]', className),
|
|
52
|
+
ref: ref,
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
Separator.displayName = 'Separator';
|
|
57
|
+
export { Separator };
|
|
58
|
+
//# sourceMappingURL=Separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","cssInterop","cn","jsx","_jsx","className","Separator","forwardRef","orientation","decorative","props","ref","role","displayName"],"sourceRoot":"../../../../src","sources":["components/ui/Separator.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,UAAU,QAAQ,YAAY;AACvC,SAASC,EAAE,QAAQ,oBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGrCH,UAAU,CAACD,IAAI,EAAE;EAAEK,SAAS,EAAE;AAAQ,CAAC,CAAC;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,SAAS,gBAAGP,KAAK,CAACQ,UAAU,CAQhC,CACE;EAAEF,SAAS;EAAEG,WAAW,GAAG,YAAY;EAAEC,UAAU,GAAG,IAAI;EAAE,GAAGC;AAAM,CAAC,EACtEC,GAAG,KACA;EACH,oBACEP,IAAA,CAACJ,IAAI;IACHY,IAAI,EAAEH,UAAU,GAAG,MAAM,GAAG,WAAY;IACxCJ,SAAS,EAAEH,EAAE,CACX,mCAAmC,EACnCM,WAAW,KAAK,YAAY,GAAG,gBAAgB,GAAG,gBAAgB,EAClEH,SACF,CAAE;IACFM,GAAG,EAAEA,GAAI;IAAA,GACLD;EAAK,CACV,CAAC;AAEN,CACF,CAAC;AACDJ,SAAS,CAACO,WAAW,GAAG,WAAW;AAEnC,SAASP,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
/**
|
|
7
|
+
* A box with a specified size.
|
|
8
|
+
*
|
|
9
|
+
* If a child is provided, this widget forces its child to have a specific width and/or height.
|
|
10
|
+
* If either the width or height is not specified, this widget will size itself to match the child's size in that dimension.
|
|
11
|
+
*
|
|
12
|
+
* If no child is provided, this widget will size itself to the specified width and height,
|
|
13
|
+
* treating null values as zero.
|
|
14
|
+
*
|
|
15
|
+
* This is similar to Flutter's SizedBox widget and is useful for:
|
|
16
|
+
* - Adding fixed spacing between widgets
|
|
17
|
+
* - Constraining child widget dimensions
|
|
18
|
+
* - Creating empty space
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Create spacing
|
|
22
|
+
* <SizedBox height={16} />
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Constrain child size
|
|
26
|
+
* <SizedBox width={100} height={100}>
|
|
27
|
+
* <Image source={...} />
|
|
28
|
+
* </SizedBox>
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // Create horizontal spacing
|
|
32
|
+
* <View style={{ flexDirection: 'row' }}>
|
|
33
|
+
* <Button />
|
|
34
|
+
* <SizedBox width={12} />
|
|
35
|
+
* <Button />
|
|
36
|
+
* </View>
|
|
37
|
+
*/
|
|
38
|
+
export function SizedBox({
|
|
39
|
+
width,
|
|
40
|
+
height,
|
|
41
|
+
children,
|
|
42
|
+
style
|
|
43
|
+
}) {
|
|
44
|
+
const boxStyle = {
|
|
45
|
+
...(width !== undefined && {
|
|
46
|
+
width
|
|
47
|
+
}),
|
|
48
|
+
...(height !== undefined && {
|
|
49
|
+
height
|
|
50
|
+
}),
|
|
51
|
+
...style
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/_jsx(View, {
|
|
54
|
+
style: boxStyle,
|
|
55
|
+
children: children
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Convenience components for common spacing values
|
|
60
|
+
(function (_SizedBox) {
|
|
61
|
+
function Square({
|
|
62
|
+
size,
|
|
63
|
+
children,
|
|
64
|
+
style
|
|
65
|
+
}) {
|
|
66
|
+
return /*#__PURE__*/_jsx(SizedBox, {
|
|
67
|
+
width: size,
|
|
68
|
+
height: size,
|
|
69
|
+
style: style,
|
|
70
|
+
children: children
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
_SizedBox.Square = Square;
|
|
74
|
+
function Expand({
|
|
75
|
+
children,
|
|
76
|
+
style
|
|
77
|
+
}) {
|
|
78
|
+
const expandStyle = {
|
|
79
|
+
flex: 1
|
|
80
|
+
};
|
|
81
|
+
return /*#__PURE__*/_jsx(View, {
|
|
82
|
+
style: [expandStyle, style],
|
|
83
|
+
children: children
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
_SizedBox.Expand = Expand;
|
|
87
|
+
function Shrink({
|
|
88
|
+
children,
|
|
89
|
+
style
|
|
90
|
+
}) {
|
|
91
|
+
const shrinkStyle = {
|
|
92
|
+
flexShrink: 1
|
|
93
|
+
};
|
|
94
|
+
return /*#__PURE__*/_jsx(View, {
|
|
95
|
+
style: [shrinkStyle, style],
|
|
96
|
+
children: children
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
_SizedBox.Shrink = Shrink;
|
|
100
|
+
})(SizedBox || (SizedBox = {}));
|
|
101
|
+
//# sourceMappingURL=SizedBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","jsx","_jsx","SizedBox","width","height","children","style","boxStyle","undefined","_SizedBox","Square","size","Expand","expandStyle","flex","Shrink","shrinkStyle","flexShrink"],"sourceRoot":"../../../../src","sources":["components/ui/SizedBox.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAwB,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAwBpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,QAAQA,CAAC;EAAEC,KAAK;EAAEC,MAAM;EAAEC,QAAQ;EAAEC;AAAqB,CAAC,EAAE;EAC1E,MAAMC,QAAmB,GAAG;IAC1B,IAAIJ,KAAK,KAAKK,SAAS,IAAI;MAAEL;IAAM,CAAC,CAAC;IACrC,IAAIC,MAAM,KAAKI,SAAS,IAAI;MAAEJ;IAAO,CAAC,CAAC;IACvC,GAAGE;EACL,CAAC;EAED,oBAAOL,IAAA,CAACF,IAAI;IAACO,KAAK,EAAEC,QAAS;IAAAF,QAAA,EAAEA;EAAQ,CAAO,CAAC;AACjD;;AAEA;AAAA,WAAAI,SAAA;EAKS,SAASC,MAAMA,CAAC;IACrBC,IAAI;IACJN,QAAQ;IACRC;EAKF,CAAC,EAAE;IACD,oBACEL,IAAA,CAACC,QAAQ;MAACC,KAAK,EAAEQ,IAAK;MAACP,MAAM,EAAEO,IAAK;MAACL,KAAK,EAAEA,KAAM;MAAAD,QAAA,EAC/CA;IAAQ,CACD,CAAC;EAEf;EAACI,SAAA,CAAAC,MAAA,GAAAA,MAAA;EAKM,SAASE,MAAMA,CAAC;IACrBP,QAAQ;IACRC;EAIF,CAAC,EAAE;IACD,MAAMO,WAAsB,GAAG;MAAEC,IAAI,EAAE;IAAE,CAAC;IAC1C,oBAAOb,IAAA,CAACF,IAAI;MAACO,KAAK,EAAE,CAACO,WAAW,EAAEP,KAAK,CAAE;MAAAD,QAAA,EAAEA;IAAQ,CAAO,CAAC;EAC7D;EAACI,SAAA,CAAAG,MAAA,GAAAA,MAAA;EAKM,SAASG,MAAMA,CAAC;IACrBV,QAAQ;IACRC;EAIF,CAAC,EAAE;IACD,MAAMU,WAAsB,GAAG;MAAEC,UAAU,EAAE;IAAE,CAAC;IAChD,oBAAOhB,IAAA,CAACF,IAAI;MAACO,KAAK,EAAE,CAACU,WAAW,EAAEV,KAAK,CAAE;MAAAD,QAAA,EAAEA;IAAQ,CAAO,CAAC;EAC7D;EAACI,SAAA,CAAAM,MAAA,GAAAA,MAAA;AAAA,GA9Ccb,QAAQ,KAARA,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { cssInterop } from 'nativewind';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
cssInterop(View, {
|
|
8
|
+
className: 'style'
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Skeleton loading placeholder component
|
|
13
|
+
*
|
|
14
|
+
* Displays an animated placeholder during content loading states. Provides visual feedback
|
|
15
|
+
* to users while data is being fetched, improving perceived performance.
|
|
16
|
+
*
|
|
17
|
+
* @component
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* // Text skeleton
|
|
21
|
+
* <Skeleton className="h-4 w-[250px]" />
|
|
22
|
+
*
|
|
23
|
+
* // Avatar skeleton
|
|
24
|
+
* <Skeleton className="h-12 w-12 rounded-full" />
|
|
25
|
+
*
|
|
26
|
+
* // Card skeleton
|
|
27
|
+
* <View className="flex gap-3">
|
|
28
|
+
* <Skeleton className="h-[125px] w-full rounded-xl" />
|
|
29
|
+
* <View className="gap-2">
|
|
30
|
+
* <Skeleton className="h-4 w-full" />
|
|
31
|
+
* <Skeleton className="h-4 w-[80%]" />
|
|
32
|
+
* </View>
|
|
33
|
+
* </View>
|
|
34
|
+
*
|
|
35
|
+
* // List skeleton
|
|
36
|
+
* {[1, 2, 3].map((i) => (
|
|
37
|
+
* <View key={i} className="flex-row items-center gap-4">
|
|
38
|
+
* <Skeleton className="h-12 w-12 rounded-full" />
|
|
39
|
+
* <View className="flex-1 gap-2">
|
|
40
|
+
* <Skeleton className="h-4 w-full" />
|
|
41
|
+
* <Skeleton className="h-4 w-3/4" />
|
|
42
|
+
* </View>
|
|
43
|
+
* </View>
|
|
44
|
+
* ))}
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
function Skeleton({
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
}) {
|
|
51
|
+
return /*#__PURE__*/_jsx(View, {
|
|
52
|
+
className: cn('bg-accent animate-pulse rounded-md', className),
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export { Skeleton };
|
|
57
|
+
//# sourceMappingURL=Skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cn","View","cssInterop","jsx","_jsx","className","Skeleton","props"],"sourceRoot":"../../../../src","sources":["components/ui/Skeleton.tsx"],"mappings":";;AAAA,SAASA,EAAE,QAAQ,oBAAiB;AACpC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,UAAU,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExCF,UAAU,CAACD,IAAI,EAAE;EAAEI,SAAS,EAAE;AAAQ,CAAC,CAAC;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,QAAQA,CAAC;EAChBD,SAAS;EACT,GAAGE;AAC0D,CAAC,EAAE;EAChE,oBACEH,IAAA,CAACH,IAAI;IACHI,SAAS,EAAEL,EAAE,CAAC,oCAAoC,EAAEK,SAAS,CAAE;IAAA,GAC3DE;EAAK,CACV,CAAC;AAEN;AAEA,SAASD,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Platform, View } from 'react-native';
|
|
5
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
6
|
+
import Animated, { runOnJS, useAnimatedStyle, useSharedValue, withSpring } from 'react-native-reanimated';
|
|
7
|
+
import { cn } from "../../lib/utils.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Props for the Slider component
|
|
11
|
+
*
|
|
12
|
+
* @property {number} value - Current slider value
|
|
13
|
+
* @property {function} onValueChange - Callback when value changes
|
|
14
|
+
* @property {number} min - Minimum value (default: 0)
|
|
15
|
+
* @property {number} max - Maximum value (default: 100)
|
|
16
|
+
* @property {number} step - Step increment (default: 1)
|
|
17
|
+
* @property {boolean} disabled - Whether the slider is disabled
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Ref interface for Slider component
|
|
22
|
+
*
|
|
23
|
+
* @property {function} reset - Resets slider to minimum value
|
|
24
|
+
*/
|
|
25
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
|
+
/**
|
|
27
|
+
* Interactive slider component for selecting numeric values
|
|
28
|
+
*
|
|
29
|
+
* Provides smooth gesture-based interaction with spring animations.
|
|
30
|
+
* Supports min/max ranges, step increments, and tap-to-select.
|
|
31
|
+
*
|
|
32
|
+
* @component
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <Slider
|
|
36
|
+
* value={volume}
|
|
37
|
+
* onValueChange={(values) => setVolume(values[0])}
|
|
38
|
+
* min={0}
|
|
39
|
+
* max={100}
|
|
40
|
+
* step={5}
|
|
41
|
+
* />
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @accessibility
|
|
45
|
+
* - Disabled state prevents interaction
|
|
46
|
+
* - Focus visible states on web
|
|
47
|
+
* - Value changes are announced by screen readers
|
|
48
|
+
*/
|
|
49
|
+
const Slider = /*#__PURE__*/React.forwardRef(({
|
|
50
|
+
value,
|
|
51
|
+
onValueChange,
|
|
52
|
+
min = 0,
|
|
53
|
+
max = 100,
|
|
54
|
+
step = 1,
|
|
55
|
+
disabled = false,
|
|
56
|
+
className,
|
|
57
|
+
style,
|
|
58
|
+
...props
|
|
59
|
+
}, ref) => {
|
|
60
|
+
const sliderWidth = useSharedValue(0);
|
|
61
|
+
const translationX = useSharedValue(0);
|
|
62
|
+
const startPosition = useSharedValue(0);
|
|
63
|
+
const [sliderDimensions, setSliderDimensions] = React.useState({
|
|
64
|
+
width: 0,
|
|
65
|
+
x: 0
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// Calculate thumb position from value
|
|
69
|
+
const getThumbPosition = React.useCallback(val => {
|
|
70
|
+
const range = max - min;
|
|
71
|
+
const percentage = (val - min) / range;
|
|
72
|
+
return percentage * sliderDimensions.width;
|
|
73
|
+
}, [max, min, sliderDimensions.width]);
|
|
74
|
+
|
|
75
|
+
// Calculate value from position
|
|
76
|
+
const getValueFromPosition = React.useCallback(position => {
|
|
77
|
+
if (sliderWidth.value === 0) return min;
|
|
78
|
+
const percentage = Math.max(0, Math.min(1, position / sliderWidth.value));
|
|
79
|
+
const range = max - min;
|
|
80
|
+
let newValue = min + percentage * range;
|
|
81
|
+
|
|
82
|
+
// Apply step
|
|
83
|
+
if (step > 0) {
|
|
84
|
+
newValue = Math.round(newValue / step) * step;
|
|
85
|
+
}
|
|
86
|
+
return Math.max(min, Math.min(max, newValue));
|
|
87
|
+
}, [max, min, step, sliderWidth]);
|
|
88
|
+
|
|
89
|
+
// Initialize thumb position based on value
|
|
90
|
+
React.useEffect(() => {
|
|
91
|
+
if (sliderDimensions.width > 0) {
|
|
92
|
+
const newPosition = getThumbPosition(value);
|
|
93
|
+
translationX.value = newPosition;
|
|
94
|
+
}
|
|
95
|
+
}, [value, sliderDimensions.width, getThumbPosition, translationX]);
|
|
96
|
+
|
|
97
|
+
// Expose reset method via ref
|
|
98
|
+
React.useImperativeHandle(ref, () => ({
|
|
99
|
+
reset: () => {
|
|
100
|
+
translationX.value = withSpring(getThumbPosition(min));
|
|
101
|
+
onValueChange?.([min]);
|
|
102
|
+
}
|
|
103
|
+
}));
|
|
104
|
+
const handleValueChange = React.useCallback(newValue => {
|
|
105
|
+
onValueChange?.([newValue]);
|
|
106
|
+
}, [onValueChange]);
|
|
107
|
+
const pan = Gesture.Pan().enabled(!disabled).onBegin(() => {
|
|
108
|
+
startPosition.value = translationX.value;
|
|
109
|
+
}).onUpdate(event => {
|
|
110
|
+
if (sliderWidth.value === 0) return;
|
|
111
|
+
const newPosition = Math.max(0, Math.min(sliderWidth.value, event.translationX + startPosition.value));
|
|
112
|
+
translationX.value = newPosition;
|
|
113
|
+
}).onEnd(() => {
|
|
114
|
+
if (sliderWidth.value === 0) return;
|
|
115
|
+
const newValue = getValueFromPosition(translationX.value);
|
|
116
|
+
translationX.value = withSpring(getThumbPosition(newValue));
|
|
117
|
+
runOnJS(handleValueChange)(newValue);
|
|
118
|
+
});
|
|
119
|
+
const tap = Gesture.Tap().enabled(!disabled).onEnd(event => {
|
|
120
|
+
if (sliderWidth.value === 0) return;
|
|
121
|
+
const newPosition = Math.max(0, Math.min(sliderWidth.value, event.x));
|
|
122
|
+
const newValue = getValueFromPosition(newPosition);
|
|
123
|
+
translationX.value = withSpring(getThumbPosition(newValue));
|
|
124
|
+
runOnJS(handleValueChange)(newValue);
|
|
125
|
+
});
|
|
126
|
+
const composed = Gesture.Race(tap, pan);
|
|
127
|
+
const thumbAnimatedStyle = useAnimatedStyle(() => ({
|
|
128
|
+
transform: [{
|
|
129
|
+
translateX: translationX.value
|
|
130
|
+
}]
|
|
131
|
+
}));
|
|
132
|
+
const rangeAnimatedStyle = useAnimatedStyle(() => ({
|
|
133
|
+
width: translationX.value
|
|
134
|
+
}));
|
|
135
|
+
return /*#__PURE__*/_jsx(View, {
|
|
136
|
+
className: cn('relative flex h-10 w-full flex-row items-center justify-center', disabled && 'opacity-50', className),
|
|
137
|
+
style: style,
|
|
138
|
+
...props,
|
|
139
|
+
children: /*#__PURE__*/_jsx(GestureDetector, {
|
|
140
|
+
gesture: composed,
|
|
141
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
142
|
+
className: "relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
|
|
143
|
+
onLayout: event => {
|
|
144
|
+
const {
|
|
145
|
+
width,
|
|
146
|
+
x
|
|
147
|
+
} = event.nativeEvent.layout;
|
|
148
|
+
sliderWidth.value = width;
|
|
149
|
+
setSliderDimensions({
|
|
150
|
+
width,
|
|
151
|
+
x
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
155
|
+
className: "absolute left-0 h-full rounded-full bg-primary",
|
|
156
|
+
style: rangeAnimatedStyle
|
|
157
|
+
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
158
|
+
className: cn('absolute -top-1.5 size-5 -ml-2.5 rounded-full border-2 border-primary bg-background shadow-sm shadow-black/5', Platform.select({
|
|
159
|
+
web: 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-none focus-visible:ring-[3px] disabled:pointer-events-none'
|
|
160
|
+
})),
|
|
161
|
+
style: thumbAnimatedStyle
|
|
162
|
+
})]
|
|
163
|
+
})
|
|
164
|
+
})
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
Slider.displayName = 'Slider';
|
|
168
|
+
export { Slider };
|
|
169
|
+
//# sourceMappingURL=Slider.js.map
|