@seed-design/lynx-react 0.4.1 → 0.5.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/lib/components/Accordion/Accordion.d.ts +56 -0
- package/lib/components/Accordion/Accordion.d.ts.map +1 -0
- package/lib/components/Accordion/Accordion.jsx +210 -0
- package/lib/components/Accordion/Accordion.namespace.d.ts +2 -0
- package/lib/components/Accordion/Accordion.namespace.d.ts.map +1 -0
- package/lib/components/Accordion/Accordion.namespace.js +17 -0
- package/lib/components/Accordion/index.d.ts +3 -0
- package/lib/components/Accordion/index.d.ts.map +1 -0
- package/lib/components/ActionButton/ActionButton.jsx +6 -6
- package/lib/components/AppBar/AppBar.jsx +1 -1
- package/lib/components/Badge/Badge.jsx +1 -1
- package/lib/components/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/components/BottomSheet/BottomSheet.jsx +6 -3
- package/lib/components/Box/Box.jsx +1 -1
- package/lib/components/Callout/Callout.d.ts +32 -0
- package/lib/components/Callout/Callout.d.ts.map +1 -0
- package/lib/components/Callout/Callout.jsx +113 -0
- package/lib/components/Callout/Callout.namespace.d.ts +2 -0
- package/lib/components/Callout/Callout.namespace.d.ts.map +1 -0
- package/lib/components/Callout/Callout.namespace.js +13 -0
- package/lib/components/Callout/index.d.ts +3 -0
- package/lib/components/Callout/index.d.ts.map +1 -0
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.jsx +36 -5
- package/lib/components/Chip/Chip.d.ts +66 -0
- package/lib/components/Chip/Chip.d.ts.map +1 -0
- package/lib/components/Chip/Chip.jsx +159 -0
- package/lib/components/Chip/Chip.namespace.d.ts +2 -0
- package/lib/components/Chip/Chip.namespace.d.ts.map +1 -0
- package/lib/components/Chip/Chip.namespace.js +16 -0
- package/lib/components/Chip/index.d.ts +3 -0
- package/lib/components/Chip/index.d.ts.map +1 -0
- package/lib/components/Divider/Divider.d.ts +31 -0
- package/lib/components/Divider/Divider.d.ts.map +1 -0
- package/lib/components/Divider/Divider.jsx +26 -0
- package/lib/components/Divider/index.d.ts +2 -0
- package/lib/components/Divider/index.d.ts.map +1 -0
- package/lib/components/Field/Field.jsx +1 -1
- package/lib/components/Icon/Icon.jsx +2 -2
- package/lib/components/ProgressCircle/ProgressCircle.jsx +2 -2
- package/lib/components/RadioGroup/RadioGroup.jsx +2 -2
- package/lib/components/Stack/Stack.jsx +1 -1
- package/lib/components/Switch/Switch.jsx +2 -2
- package/lib/components/Tabs/Tabs.d.ts +59 -0
- package/lib/components/Tabs/Tabs.d.ts.map +1 -0
- package/lib/components/Tabs/Tabs.jsx +406 -0
- package/lib/components/Tabs/Tabs.namespace.d.ts +2 -0
- package/lib/components/Tabs/Tabs.namespace.d.ts.map +1 -0
- package/lib/components/Tabs/Tabs.namespace.js +14 -0
- package/lib/components/Tabs/index.d.ts +3 -0
- package/lib/components/Tabs/index.d.ts.map +1 -0
- package/lib/components/TagGroup/TagGroup.jsx +2 -2
- package/lib/components/Text/Text.jsx +2 -2
- package/lib/components/TextField/TextField.jsx +2 -2
- package/lib/components/index.d.ts +5 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/hooks/useIconColor.d.ts +2 -1
- package/lib/hooks/useIconColor.d.ts.map +1 -1
- package/lib/hooks/useIconColor.js +29 -5
- package/lib/hooks/usePressTap.d.ts.map +1 -1
- package/lib/hooks/usePressTap.js +1 -0
- package/lib/index.js +14 -5
- package/lib/utils/create-slot-recipe-context.jsx +1 -1
- package/package.json +2 -2
- package/src/components/Accordion/Accordion.namespace.ts +22 -0
- package/src/components/Accordion/Accordion.test.tsx +129 -0
- package/src/components/Accordion/Accordion.tsx +453 -0
- package/src/components/Accordion/index.ts +24 -0
- package/src/components/BottomSheet/BottomSheet.test.tsx +24 -0
- package/src/components/BottomSheet/BottomSheet.tsx +14 -2
- package/src/components/Callout/Callout.namespace.ts +14 -0
- package/src/components/Callout/Callout.test.tsx +188 -0
- package/src/components/Callout/Callout.tsx +272 -0
- package/src/components/Callout/index.ts +16 -0
- package/src/components/Checkbox/Checkbox.test.tsx +176 -0
- package/src/components/Checkbox/Checkbox.tsx +36 -2
- package/src/components/Chip/Chip.namespace.ts +20 -0
- package/src/components/Chip/Chip.test.tsx +113 -0
- package/src/components/Chip/Chip.tsx +373 -0
- package/src/components/Chip/index.ts +22 -0
- package/src/components/Divider/Divider.test.tsx +73 -0
- package/src/components/Divider/Divider.tsx +76 -0
- package/src/components/Divider/index.ts +1 -0
- package/src/components/Icon/Icon.test.tsx +129 -0
- package/src/components/Tabs/Tabs.namespace.ts +16 -0
- package/src/components/Tabs/Tabs.test.tsx +181 -0
- package/src/components/Tabs/Tabs.tsx +706 -0
- package/src/components/Tabs/index.ts +2 -0
- package/src/components/index.ts +5 -0
- package/src/hooks/useIconColor.ts +43 -5
- package/src/hooks/usePressTap.test.ts +13 -0
- package/src/hooks/usePressTap.ts +1 -0
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import { useControllableState } from "../../hooks/useControllableState.js";
|
|
2
|
+
import { usePressTap } from "../../hooks/usePressTap.js";
|
|
3
|
+
import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
|
|
4
|
+
import * as React from "@lynx-js/react";
|
|
5
|
+
import clsx from "clsx";
|
|
6
|
+
import { tabs } from "@seed-design/lynx-css/recipes/tabs";
|
|
7
|
+
//#region src/components/Tabs/Tabs.tsx
|
|
8
|
+
var { ClassNamesProvider, useClassNames } = createSlotRecipeContext(tabs);
|
|
9
|
+
function invokeSelectTab(pager, index, smooth) {
|
|
10
|
+
"background only";
|
|
11
|
+
if (!pager || index < 0) return;
|
|
12
|
+
try {
|
|
13
|
+
pager.invoke({
|
|
14
|
+
method: "selectTab",
|
|
15
|
+
params: {
|
|
16
|
+
index,
|
|
17
|
+
smooth
|
|
18
|
+
}
|
|
19
|
+
}).exec();
|
|
20
|
+
} catch {}
|
|
21
|
+
}
|
|
22
|
+
function invokeScrollToOffset(list, offset) {
|
|
23
|
+
"background only";
|
|
24
|
+
if (!list || offset < 0) return;
|
|
25
|
+
try {
|
|
26
|
+
list.invoke({
|
|
27
|
+
method: "scrollTo",
|
|
28
|
+
params: {
|
|
29
|
+
offset,
|
|
30
|
+
smooth: true
|
|
31
|
+
}
|
|
32
|
+
}).exec();
|
|
33
|
+
} catch {}
|
|
34
|
+
}
|
|
35
|
+
function getLayoutRect(event) {
|
|
36
|
+
const width = event.detail?.width ?? event.params?.width;
|
|
37
|
+
const left = event.detail?.left ?? event.params?.left;
|
|
38
|
+
if (!Number.isFinite(width) || !Number.isFinite(left)) return null;
|
|
39
|
+
return {
|
|
40
|
+
width: Math.max(0, width),
|
|
41
|
+
left
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
var TabsContext = React.createContext(null);
|
|
45
|
+
function useTabsContext(consumer) {
|
|
46
|
+
const context = React.useContext(TabsContext);
|
|
47
|
+
if (!context) throw new Error(`<${consumer}/> must be rendered inside <TabsRoot/>.`);
|
|
48
|
+
return context;
|
|
49
|
+
}
|
|
50
|
+
var TabsCarouselContext = React.createContext(null);
|
|
51
|
+
var TabsCarouselCameraContext = React.createContext(null);
|
|
52
|
+
function useTabsCarouselCameraContext() {
|
|
53
|
+
return React.useContext(TabsCarouselCameraContext) ?? false;
|
|
54
|
+
}
|
|
55
|
+
function useTabsCarouselContext(consumer) {
|
|
56
|
+
const context = React.useContext(TabsCarouselContext);
|
|
57
|
+
if (!context) throw new Error(`<${consumer}/> must be rendered inside <TabsCarousel/>.`);
|
|
58
|
+
return context;
|
|
59
|
+
}
|
|
60
|
+
var TabsRoot = React.forwardRef((props, ref) => {
|
|
61
|
+
const [variantProps, otherProps] = tabs.splitVariantProps(props);
|
|
62
|
+
const { children, className, style, value: valueProp, defaultValue, onValueChange, ...nativeProps } = otherProps;
|
|
63
|
+
const classNames = tabs(variantProps);
|
|
64
|
+
const [value, setValueInternal] = useControllableState({
|
|
65
|
+
value: valueProp,
|
|
66
|
+
defaultValue,
|
|
67
|
+
onChange(nextValue) {
|
|
68
|
+
"background only";
|
|
69
|
+
if (nextValue !== void 0) onValueChange?.(nextValue);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const [items, setItems] = React.useState([]);
|
|
73
|
+
const [contentValues, setContentValues] = React.useState([]);
|
|
74
|
+
const [indicatorValue, setIndicatorValue] = React.useState();
|
|
75
|
+
const [triggerRects, setTriggerRects] = React.useState({});
|
|
76
|
+
const [listLeft, setListLeft] = React.useState(0);
|
|
77
|
+
const listRef = React.useRef(null);
|
|
78
|
+
const pagerRef = React.useRef(null);
|
|
79
|
+
const indicatorRef = React.useMainThreadRef(null);
|
|
80
|
+
const pagerValues = React.useMemo(() => contentValues.filter((contentValue) => !items.find((item) => item.value === contentValue)?.disabled), [contentValues, items]);
|
|
81
|
+
const visualValue = indicatorValue ?? value;
|
|
82
|
+
const indicatorIndex = items.findIndex((item) => item.value === visualValue);
|
|
83
|
+
const selectedPagerIndex = value === void 0 ? -1 : pagerValues.indexOf(value);
|
|
84
|
+
const selectedRect = value === void 0 ? void 0 : triggerRects[value];
|
|
85
|
+
const selectedOffset = selectedRect ? Math.max(0, selectedRect.left - listLeft) : null;
|
|
86
|
+
const setListNode = React.useCallback((node) => {
|
|
87
|
+
listRef.current = node;
|
|
88
|
+
if (node && selectedOffset !== null) invokeScrollToOffset(node, selectedOffset);
|
|
89
|
+
}, [selectedOffset]);
|
|
90
|
+
const setPagerNode = React.useCallback((node) => {
|
|
91
|
+
pagerRef.current = node;
|
|
92
|
+
if (node && selectedPagerIndex >= 0) invokeSelectTab(node, selectedPagerIndex, false);
|
|
93
|
+
}, [selectedPagerIndex]);
|
|
94
|
+
const registerTrigger = React.useCallback((triggerValue, disabled) => {
|
|
95
|
+
setItems((current) => {
|
|
96
|
+
if (current.some((item) => item.value === triggerValue)) return current;
|
|
97
|
+
return [...current, {
|
|
98
|
+
value: triggerValue,
|
|
99
|
+
disabled
|
|
100
|
+
}];
|
|
101
|
+
});
|
|
102
|
+
return () => {
|
|
103
|
+
"background only";
|
|
104
|
+
setItems((current) => current.filter((item) => item.value !== triggerValue));
|
|
105
|
+
setTriggerRects((current) => {
|
|
106
|
+
const next = { ...current };
|
|
107
|
+
delete next[triggerValue];
|
|
108
|
+
return next;
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
}, []);
|
|
112
|
+
const registerContent = React.useCallback((contentValue) => {
|
|
113
|
+
setContentValues((current) => current.includes(contentValue) ? current : [...current, contentValue]);
|
|
114
|
+
return () => {
|
|
115
|
+
"background only";
|
|
116
|
+
setContentValues((current) => current.filter((value) => value !== contentValue));
|
|
117
|
+
};
|
|
118
|
+
}, []);
|
|
119
|
+
const updateTriggerDisabled = React.useCallback((triggerValue, disabled) => {
|
|
120
|
+
setItems((current) => current.map((item) => item.value === triggerValue && item.disabled !== disabled ? {
|
|
121
|
+
...item,
|
|
122
|
+
disabled
|
|
123
|
+
} : item));
|
|
124
|
+
}, []);
|
|
125
|
+
const updateTriggerRect = React.useCallback((triggerValue, rect) => {
|
|
126
|
+
setTriggerRects((current) => {
|
|
127
|
+
const previous = current[triggerValue];
|
|
128
|
+
if (previous?.left === rect.left && previous.width === rect.width) return current;
|
|
129
|
+
return {
|
|
130
|
+
...current,
|
|
131
|
+
[triggerValue]: rect
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
}, []);
|
|
135
|
+
const selectValue = React.useCallback((nextValue) => {
|
|
136
|
+
setIndicatorValue(void 0);
|
|
137
|
+
setValueInternal(nextValue);
|
|
138
|
+
}, [setValueInternal]);
|
|
139
|
+
const handlePagerWillChange = React.useCallback((targetIndex) => {
|
|
140
|
+
setIndicatorValue(pagerValues[targetIndex]);
|
|
141
|
+
}, [pagerValues]);
|
|
142
|
+
const handlePagerChange = React.useCallback((targetIndex) => {
|
|
143
|
+
const nextValue = pagerValues[targetIndex];
|
|
144
|
+
if (nextValue === void 0) return;
|
|
145
|
+
setIndicatorValue(void 0);
|
|
146
|
+
setValueInternal(nextValue);
|
|
147
|
+
}, [pagerValues, setValueInternal]);
|
|
148
|
+
React.useEffect(() => {
|
|
149
|
+
"background only";
|
|
150
|
+
if (selectedPagerIndex >= 0) invokeSelectTab(pagerRef.current, selectedPagerIndex, false);
|
|
151
|
+
if (selectedOffset !== null) invokeScrollToOffset(listRef.current, selectedOffset);
|
|
152
|
+
}, [selectedPagerIndex, selectedOffset]);
|
|
153
|
+
const contextValue = React.useMemo(() => ({
|
|
154
|
+
value,
|
|
155
|
+
visualValue,
|
|
156
|
+
variantProps,
|
|
157
|
+
items,
|
|
158
|
+
pagerValues,
|
|
159
|
+
indicatorIndex,
|
|
160
|
+
selectedPagerIndex,
|
|
161
|
+
indicatorRef,
|
|
162
|
+
listLeft,
|
|
163
|
+
triggerRects,
|
|
164
|
+
registerTrigger,
|
|
165
|
+
registerContent,
|
|
166
|
+
updateTriggerDisabled,
|
|
167
|
+
updateTriggerRect,
|
|
168
|
+
setListLeft,
|
|
169
|
+
setListRef: setListNode,
|
|
170
|
+
setPagerRef: setPagerNode,
|
|
171
|
+
selectValue,
|
|
172
|
+
handlePagerWillChange,
|
|
173
|
+
handlePagerChange
|
|
174
|
+
}), [
|
|
175
|
+
value,
|
|
176
|
+
visualValue,
|
|
177
|
+
variantProps,
|
|
178
|
+
items,
|
|
179
|
+
pagerValues,
|
|
180
|
+
indicatorIndex,
|
|
181
|
+
selectedPagerIndex,
|
|
182
|
+
indicatorRef,
|
|
183
|
+
listLeft,
|
|
184
|
+
triggerRects,
|
|
185
|
+
registerTrigger,
|
|
186
|
+
registerContent,
|
|
187
|
+
updateTriggerDisabled,
|
|
188
|
+
updateTriggerRect,
|
|
189
|
+
setListNode,
|
|
190
|
+
setPagerNode,
|
|
191
|
+
selectValue,
|
|
192
|
+
handlePagerWillChange,
|
|
193
|
+
handlePagerChange
|
|
194
|
+
]);
|
|
195
|
+
return <TabsContext.Provider value={contextValue}>
|
|
196
|
+
<ClassNamesProvider value={classNames}>
|
|
197
|
+
<view {...ref ? { ref } : {}} {...nativeProps} className={clsx(classNames.root, className)} style={style}>
|
|
198
|
+
{children}
|
|
199
|
+
</view>
|
|
200
|
+
</ClassNamesProvider>
|
|
201
|
+
</TabsContext.Provider>;
|
|
202
|
+
});
|
|
203
|
+
TabsRoot.displayName = "TabsRoot";
|
|
204
|
+
var TabsList = React.forwardRef((props, ref) => {
|
|
205
|
+
const { children, className, style, ...nativeProps } = props;
|
|
206
|
+
const classNames = useClassNames();
|
|
207
|
+
const { setListLeft, setListRef } = useTabsContext("TabsList");
|
|
208
|
+
const mergedRef = React.useCallback((node) => {
|
|
209
|
+
setListRef(node);
|
|
210
|
+
if (typeof ref === "function") ref(node);
|
|
211
|
+
else if (ref) ref.current = node;
|
|
212
|
+
}, [ref, setListRef]);
|
|
213
|
+
const handleLayoutChange = React.useCallback((...args) => {
|
|
214
|
+
"background only";
|
|
215
|
+
const rect = getLayoutRect(args[0]);
|
|
216
|
+
if (rect) setListLeft(rect.left);
|
|
217
|
+
}, [setListLeft]);
|
|
218
|
+
return <scroll-view ref={mergedRef} {...nativeProps} scroll-orientation="horizontal" scroll-bar-enable={false} bindlayoutchange={handleLayoutChange} accessibility-element={false} accessibility-traits="tabbar" className={clsx(classNames.list, className)} style={style}>
|
|
219
|
+
<view className={classNames.listContent}>{children}</view>
|
|
220
|
+
</scroll-view>;
|
|
221
|
+
});
|
|
222
|
+
TabsList.displayName = "TabsList";
|
|
223
|
+
var TabsTrigger = React.forwardRef((props, ref) => {
|
|
224
|
+
const { children, className, style, value: triggerValue, disabled = false, "accessibility-label": accessibilityLabel, ...nativeProps } = props;
|
|
225
|
+
const context = useTabsContext("TabsTrigger");
|
|
226
|
+
const selected = context.value === triggerValue;
|
|
227
|
+
const visuallySelected = context.visualValue === triggerValue;
|
|
228
|
+
React.useEffect(() => {
|
|
229
|
+
"background only";
|
|
230
|
+
return context.registerTrigger(triggerValue, disabled);
|
|
231
|
+
}, [context.registerTrigger, triggerValue]);
|
|
232
|
+
React.useEffect(() => {
|
|
233
|
+
"background only";
|
|
234
|
+
context.updateTriggerDisabled(triggerValue, disabled);
|
|
235
|
+
}, [
|
|
236
|
+
context.updateTriggerDisabled,
|
|
237
|
+
triggerValue,
|
|
238
|
+
disabled
|
|
239
|
+
]);
|
|
240
|
+
const { pressed: _pressed, ...pressHandlers } = usePressTap({
|
|
241
|
+
disabled,
|
|
242
|
+
onTap: React.useCallback(() => {
|
|
243
|
+
"background only";
|
|
244
|
+
context.selectValue(triggerValue);
|
|
245
|
+
}, [context.selectValue, triggerValue])
|
|
246
|
+
});
|
|
247
|
+
const handleLayoutChange = React.useCallback((...args) => {
|
|
248
|
+
"background only";
|
|
249
|
+
const rect = getLayoutRect(args[0]);
|
|
250
|
+
if (rect) context.updateTriggerRect(triggerValue, rect);
|
|
251
|
+
}, [context.updateTriggerRect, triggerValue]);
|
|
252
|
+
const triggerClasses = tabs({
|
|
253
|
+
...context.variantProps,
|
|
254
|
+
selected: visuallySelected,
|
|
255
|
+
disabled
|
|
256
|
+
});
|
|
257
|
+
const label = typeof children === "string" || typeof children === "number" ? String(children) : void 0;
|
|
258
|
+
return <view {...ref ? { ref } : {}} {...nativeProps} {...pressHandlers} flatten={false} bindlayoutchange={handleLayoutChange} accessibility-element={true} accessibility-role-description="tab" accessibility-label={accessibilityLabel ?? label} accessibility-value={selected ? "selected" : "not selected"} accessibility-traits={disabled ? "disabled" : selected ? "selected" : "button"} className={clsx(triggerClasses.trigger, className)} style={style}>
|
|
259
|
+
<text className={triggerClasses.triggerLabel}>{children}</text>
|
|
260
|
+
</view>;
|
|
261
|
+
});
|
|
262
|
+
TabsTrigger.displayName = "TabsTrigger";
|
|
263
|
+
var TabsIndicator = React.forwardRef((props, ref) => {
|
|
264
|
+
const { className, style, ...nativeProps } = props;
|
|
265
|
+
const classNames = useClassNames();
|
|
266
|
+
const { indicatorRef, items, listLeft, indicatorIndex, triggerRects } = useTabsContext("TabsIndicator");
|
|
267
|
+
const position = indicatorIndex;
|
|
268
|
+
const lowerIndex = Math.max(0, Math.floor(position));
|
|
269
|
+
const upperIndex = Math.min(items.length - 1, Math.ceil(position));
|
|
270
|
+
const progress = Math.max(0, Math.min(1, position - lowerIndex));
|
|
271
|
+
const lowerRect = triggerRects[items[lowerIndex]?.value ?? ""];
|
|
272
|
+
const upperRect = triggerRects[items[upperIndex]?.value ?? ""] ?? lowerRect;
|
|
273
|
+
const x = lowerRect ? lowerRect.left - listLeft + ((upperRect?.left ?? lowerRect.left) - lowerRect.left) * progress : 0;
|
|
274
|
+
const width = lowerRect ? lowerRect.width + ((upperRect?.width ?? lowerRect.width) - lowerRect.width) * progress : 0;
|
|
275
|
+
return <view {...ref ? { ref } : {}} main-thread:ref={indicatorRef} {...nativeProps} accessibility-elements-hidden={true} className={clsx(classNames.indicator, className)} style={{
|
|
276
|
+
"--tabs-indicator-x": `${x}px`,
|
|
277
|
+
"--tabs-indicator-width": `${width}px`,
|
|
278
|
+
...style
|
|
279
|
+
}} />;
|
|
280
|
+
});
|
|
281
|
+
TabsIndicator.displayName = "TabsIndicator";
|
|
282
|
+
var TabsContent = React.forwardRef((props, ref) => {
|
|
283
|
+
const { children, className, style, value: contentValue, ...nativeProps } = props;
|
|
284
|
+
const tabsContext = useTabsContext("TabsContent");
|
|
285
|
+
const inCarousel = useTabsCarouselCameraContext();
|
|
286
|
+
const selected = tabsContext.value === contentValue;
|
|
287
|
+
const disabled = tabsContext.items.find((item) => item.value === contentValue)?.disabled ?? false;
|
|
288
|
+
const contentClasses = tabs({
|
|
289
|
+
...tabsContext.variantProps,
|
|
290
|
+
selected,
|
|
291
|
+
inCarousel
|
|
292
|
+
});
|
|
293
|
+
React.useEffect(() => {
|
|
294
|
+
"background only";
|
|
295
|
+
if (inCarousel) return tabsContext.registerContent(contentValue);
|
|
296
|
+
}, [
|
|
297
|
+
inCarousel,
|
|
298
|
+
tabsContext.registerContent,
|
|
299
|
+
contentValue
|
|
300
|
+
]);
|
|
301
|
+
const content = <view {...ref ? { ref } : {}} {...nativeProps} accessibility-elements-hidden={!selected} accessibility-role-description="tabpanel" accessibility-value={selected ? "selected" : "not selected"} className={clsx(contentClasses.content, className)} style={style}>
|
|
302
|
+
{children}
|
|
303
|
+
</view>;
|
|
304
|
+
if (inCarousel) {
|
|
305
|
+
if (disabled) return null;
|
|
306
|
+
return <viewpager-item>{content}</viewpager-item>;
|
|
307
|
+
}
|
|
308
|
+
return content;
|
|
309
|
+
});
|
|
310
|
+
TabsContent.displayName = "TabsContent";
|
|
311
|
+
var TabsCarousel = React.forwardRef((props, ref) => {
|
|
312
|
+
const { children, className, style, swipeable = false, iosBackGestureEdgeWidth = 32, onSettle, onSwipeStart, onSwipeEnd, ...nativeProps } = props;
|
|
313
|
+
const classNames = useClassNames();
|
|
314
|
+
const contextValue = React.useMemo(() => ({
|
|
315
|
+
swipeable,
|
|
316
|
+
iosBackGestureEdgeWidth,
|
|
317
|
+
onSettle,
|
|
318
|
+
onSwipeStart,
|
|
319
|
+
onSwipeEnd
|
|
320
|
+
}), [
|
|
321
|
+
swipeable,
|
|
322
|
+
iosBackGestureEdgeWidth,
|
|
323
|
+
onSettle,
|
|
324
|
+
onSwipeStart,
|
|
325
|
+
onSwipeEnd
|
|
326
|
+
]);
|
|
327
|
+
return <TabsCarouselContext.Provider value={contextValue}>
|
|
328
|
+
<view {...ref ? { ref } : {}} {...nativeProps} className={clsx(classNames.carousel, className)} style={style}>
|
|
329
|
+
{children}
|
|
330
|
+
</view>
|
|
331
|
+
</TabsCarouselContext.Provider>;
|
|
332
|
+
});
|
|
333
|
+
TabsCarousel.displayName = "TabsCarousel";
|
|
334
|
+
var TabsCarouselCamera = React.forwardRef((props, ref) => {
|
|
335
|
+
const { children, className, style, bindchange, bindwillchange, bindoffsetchange, ...nativeProps } = props;
|
|
336
|
+
const classNames = useClassNames();
|
|
337
|
+
const tabsContext = useTabsContext("TabsCarouselCamera");
|
|
338
|
+
const carouselContext = useTabsCarouselContext("TabsCarouselCamera");
|
|
339
|
+
const swipingRef = React.useRef(false);
|
|
340
|
+
const { indicatorRef, pagerValues, listLeft, triggerRects } = tabsContext;
|
|
341
|
+
const indicatorRects = pagerValues.map((value) => triggerRects[value] ?? null);
|
|
342
|
+
const mergedRef = React.useCallback((node) => {
|
|
343
|
+
tabsContext.setPagerRef(node);
|
|
344
|
+
if (typeof ref === "function") ref(node);
|
|
345
|
+
else if (ref) ref.current = node;
|
|
346
|
+
}, [ref, tabsContext.setPagerRef]);
|
|
347
|
+
const handleWillChange = React.useCallback((event) => {
|
|
348
|
+
"background only";
|
|
349
|
+
bindwillchange?.(event);
|
|
350
|
+
if (event.detail.isDragged) {
|
|
351
|
+
tabsContext.handlePagerWillChange(event.detail.index);
|
|
352
|
+
if (!swipingRef.current) {
|
|
353
|
+
swipingRef.current = true;
|
|
354
|
+
carouselContext.onSwipeStart?.();
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}, [
|
|
358
|
+
bindwillchange,
|
|
359
|
+
carouselContext.onSwipeStart,
|
|
360
|
+
tabsContext.handlePagerWillChange
|
|
361
|
+
]);
|
|
362
|
+
const handleChange = React.useCallback((event) => {
|
|
363
|
+
"background only";
|
|
364
|
+
bindchange?.(event);
|
|
365
|
+
tabsContext.handlePagerChange(event.detail.index);
|
|
366
|
+
carouselContext.onSettle?.();
|
|
367
|
+
if (swipingRef.current || event.detail.isDragged) {
|
|
368
|
+
swipingRef.current = false;
|
|
369
|
+
carouselContext.onSwipeEnd?.();
|
|
370
|
+
}
|
|
371
|
+
}, [
|
|
372
|
+
bindchange,
|
|
373
|
+
carouselContext.onSettle,
|
|
374
|
+
carouselContext.onSwipeEnd,
|
|
375
|
+
tabsContext.handlePagerChange
|
|
376
|
+
]);
|
|
377
|
+
const handleOffsetChange = React.useCallback((event) => {
|
|
378
|
+
"background only";
|
|
379
|
+
bindoffsetchange?.(event);
|
|
380
|
+
}, [bindoffsetchange]);
|
|
381
|
+
function handleIndicatorOffsetChange(event) {
|
|
382
|
+
"main thread";
|
|
383
|
+
const position = Number(event.detail.offset);
|
|
384
|
+
if (!Number.isFinite(position)) return;
|
|
385
|
+
const lowerIndex = Math.max(0, Math.floor(position));
|
|
386
|
+
const upperIndex = Math.min(indicatorRects.length - 1, Math.ceil(position));
|
|
387
|
+
const progress = Math.max(0, Math.min(1, position - lowerIndex));
|
|
388
|
+
const lowerRect = indicatorRects[lowerIndex];
|
|
389
|
+
const upperRect = indicatorRects[upperIndex] ?? lowerRect;
|
|
390
|
+
if (!lowerRect) return;
|
|
391
|
+
const x = lowerRect.left - listLeft + ((upperRect?.left ?? lowerRect.left) - lowerRect.left) * progress;
|
|
392
|
+
const width = lowerRect.width + ((upperRect?.width ?? lowerRect.width) - lowerRect.width) * progress;
|
|
393
|
+
indicatorRef.current?.setStyleProperties({
|
|
394
|
+
"--tabs-indicator-x": `${x}px`,
|
|
395
|
+
"--tabs-indicator-width": `${width}px`
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
return <viewpager ref={mergedRef} {...nativeProps} initial-select-index={Math.max(0, tabsContext.selectedPagerIndex)} enable-scroll={carouselContext.swipeable} ios-gesture-offset={carouselContext.iosBackGestureEdgeWidth} bindwillchange={handleWillChange} bindchange={handleChange} bindoffsetchange={handleOffsetChange} main-thread:bindoffsetchange={handleIndicatorOffsetChange} className={clsx(classNames.carouselCamera, className)} style={style}>
|
|
399
|
+
<TabsCarouselCameraContext.Provider value={true}>
|
|
400
|
+
{children}
|
|
401
|
+
</TabsCarouselCameraContext.Provider>
|
|
402
|
+
</viewpager>;
|
|
403
|
+
});
|
|
404
|
+
TabsCarouselCamera.displayName = "TabsCarouselCamera";
|
|
405
|
+
//#endregion
|
|
406
|
+
export { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { TabsCarousel as Carousel, TabsCarouselCamera as CarouselCamera, TabsContent as Content, TabsIndicator as Indicator, TabsList as List, TabsRoot as Root, TabsTrigger as Trigger, type TabsCarouselCameraProps as CarouselCameraProps, type TabsCarouselProps as CarouselProps, type TabsContentProps as ContentProps, type TabsIndicatorProps as IndicatorProps, type TabsListProps as ListProps, type TabsRootProps as RootProps, type TabsTriggerProps as TriggerProps, } from './Tabs';
|
|
2
|
+
//# sourceMappingURL=Tabs.namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,QAAQ,EACxB,kBAAkB,IAAI,cAAc,EACpC,WAAW,IAAI,OAAO,EACtB,aAAa,IAAI,SAAS,EAC1B,QAAQ,IAAI,IAAI,EAChB,QAAQ,IAAI,IAAI,EAChB,WAAW,IAAI,OAAO,EACtB,KAAK,uBAAuB,IAAI,mBAAmB,EACnD,KAAK,iBAAiB,IAAI,aAAa,EACvC,KAAK,gBAAgB,IAAI,YAAY,EACrC,KAAK,kBAAkB,IAAI,cAAc,EACzC,KAAK,aAAa,IAAI,SAAS,EAC/B,KAAK,aAAa,IAAI,SAAS,EAC/B,KAAK,gBAAgB,IAAI,YAAY,GACtC,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger } from "./Tabs.jsx";
|
|
3
|
+
//#region src/components/Tabs/Tabs.namespace.ts
|
|
4
|
+
var Tabs_namespace_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
Carousel: () => TabsCarousel,
|
|
6
|
+
CarouselCamera: () => TabsCarouselCamera,
|
|
7
|
+
Content: () => TabsContent,
|
|
8
|
+
Indicator: () => TabsIndicator,
|
|
9
|
+
List: () => TabsList,
|
|
10
|
+
Root: () => TabsRoot,
|
|
11
|
+
Trigger: () => TabsTrigger
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Tabs_namespace_exports };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
|
|
2
1
|
import { toArray } from "../../utils/children.js";
|
|
2
|
+
import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
|
|
3
3
|
import { useStyleProps } from "../../utils/styled.js";
|
|
4
4
|
import { splitMultipleVariantsProps } from "../../utils/split-multiple-variants-props.js";
|
|
5
|
-
import clsx from "clsx";
|
|
6
5
|
import * as React from "@lynx-js/react";
|
|
6
|
+
import clsx from "clsx";
|
|
7
7
|
import { tagGroup } from "@seed-design/lynx-css/recipes/tag-group";
|
|
8
8
|
import { tagGroupItem } from "@seed-design/lynx-css/recipes/tag-group-item";
|
|
9
9
|
//#region src/components/TagGroup/TagGroup.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { handleColor, handleFontSize, handleFontWeight, handleLineHeight } from "../../utils/styled.js";
|
|
2
|
-
import { typography } from "@seed-design/lynx-css/vars/component";
|
|
3
|
-
import clsx from "clsx";
|
|
4
2
|
import * as React from "@lynx-js/react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { typography } from "@seed-design/lynx-css/vars/component";
|
|
5
5
|
//#region src/components/Text/Text.tsx
|
|
6
6
|
function capitalize(value) {
|
|
7
7
|
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
@@ -3,9 +3,9 @@ import { InternalIcon } from "../Icon/Icon.jsx";
|
|
|
3
3
|
import { useFieldContext } from "../Field/context.js";
|
|
4
4
|
import { useKeyboardAvoidanceActions } from "../KeyboardAvoidingScrollView/context.js";
|
|
5
5
|
import { NATIVE_TEXT_MAX_LENGTH_UNLIMITED, TextFieldContext } from "./context.js";
|
|
6
|
-
import { textInput } from "@seed-design/lynx-css/vars/component";
|
|
7
|
-
import clsx from "clsx";
|
|
8
6
|
import * as React from "@lynx-js/react";
|
|
7
|
+
import clsx from "clsx";
|
|
8
|
+
import { textInput } from "@seed-design/lynx-css/vars/component";
|
|
9
9
|
import { textInput as textInput$1 } from "@seed-design/lynx-css/recipes/text-input";
|
|
10
10
|
//#region src/components/TextField/TextField.tsx
|
|
11
11
|
var ANDROID_TEXTAREA_DEFAULT_LINE_SPACING = "3.2px";
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
export * from './Accordion';
|
|
1
2
|
export * from './ActionButton';
|
|
2
3
|
export * from './AppBar';
|
|
3
4
|
export * from './Badge';
|
|
4
5
|
export * from './Box';
|
|
5
6
|
export * from './BottomSheet';
|
|
7
|
+
export * from './Callout';
|
|
6
8
|
export * from './Checkbox';
|
|
9
|
+
export * from './Chip';
|
|
10
|
+
export * from './Divider';
|
|
7
11
|
export * from './Field';
|
|
8
12
|
export * from './Icon';
|
|
9
13
|
export * from './KeyboardAvoidingScrollView';
|
|
@@ -11,6 +15,7 @@ export * from './ProgressCircle';
|
|
|
11
15
|
export * from './RadioGroup';
|
|
12
16
|
export * from './Stack';
|
|
13
17
|
export * from './Switch';
|
|
18
|
+
export * from './Tabs';
|
|
14
19
|
export * from './TagGroup';
|
|
15
20
|
export * from './Text';
|
|
16
21
|
export * from './TextField';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
|
|
@@ -5,7 +5,8 @@ export interface UseIconColorOptions {
|
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Lynx `<image>` 의 tint color 를 recipe 의 CSS `color` 로부터 main-thread 에서 읽어
|
|
8
|
-
* `tint-color` attribute 로 mirror. `deps` 가 바뀌면
|
|
8
|
+
* `tint-color` attribute 로 mirror. `deps` 가 바뀌면 native class patch가 반영된
|
|
9
|
+
* 다음 frame에 재동기화하고, UI 표시 이벤트에서는 즉시 동기화.
|
|
9
10
|
*
|
|
10
11
|
* ```tsx
|
|
11
12
|
* const iconColorProps = useIconColor([variant, disabled, loading]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIconColor.d.ts","sourceRoot":"","sources":["../../src/hooks/useIconColor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAOhE,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;CAC3C;
|
|
1
|
+
{"version":3,"file":"useIconColor.d.ts","sourceRoot":"","sources":["../../src/hooks/useIconColor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAOhE,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;CAC3C;AA0DD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,cAAc,EACpB,OAAO,CAAC,EAAE,mBAAmB,GAC5B;IACD,GAAG,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACnC,0BAA0B,EAAE,MAAM,IAAI,CAAC;CACxC,CAmBA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { runOnMainThread, useEffect, useMainThreadRef } from "@lynx-js/react";
|
|
2
2
|
//#region src/hooks/useIconColor.ts
|
|
3
|
-
function
|
|
3
|
+
function syncTintColorOnce(targetRef, sourceRef) {
|
|
4
4
|
"main thread";
|
|
5
5
|
const target = targetRef.current;
|
|
6
6
|
if (!target) return;
|
|
@@ -8,11 +8,31 @@ function syncTintColor(targetRef, sourceRef) {
|
|
|
8
8
|
let color;
|
|
9
9
|
if (typeof source.getComputedStyleProperty === "function") color = source.getComputedStyleProperty("color");
|
|
10
10
|
else if (typeof source.getComputedCssProperty === "function") color = source.getComputedCssProperty("color");
|
|
11
|
-
if (color) target.setAttribute("tint-color", color);
|
|
11
|
+
if (color && target.getAttribute("tint-color") !== color) target.setAttribute("tint-color", color);
|
|
12
|
+
}
|
|
13
|
+
function scheduleTintColorSync(targetRef, sourceRef, frameRef) {
|
|
14
|
+
"main thread";
|
|
15
|
+
if (frameRef.current && typeof cancelAnimationFrame === "function") {
|
|
16
|
+
cancelAnimationFrame(frameRef.current);
|
|
17
|
+
frameRef.current = 0;
|
|
18
|
+
}
|
|
19
|
+
if (typeof requestAnimationFrame === "function") frameRef.current = requestAnimationFrame(() => {
|
|
20
|
+
frameRef.current = 0;
|
|
21
|
+
syncTintColorOnce(targetRef, sourceRef);
|
|
22
|
+
});
|
|
23
|
+
else syncTintColorOnce(targetRef, sourceRef);
|
|
24
|
+
}
|
|
25
|
+
function cancelTintColorSync(frameRef) {
|
|
26
|
+
"main thread";
|
|
27
|
+
if (frameRef.current && typeof cancelAnimationFrame === "function") {
|
|
28
|
+
cancelAnimationFrame(frameRef.current);
|
|
29
|
+
frameRef.current = 0;
|
|
30
|
+
}
|
|
12
31
|
}
|
|
13
32
|
/**
|
|
14
33
|
* Lynx `<image>` 의 tint color 를 recipe 의 CSS `color` 로부터 main-thread 에서 읽어
|
|
15
|
-
* `tint-color` attribute 로 mirror. `deps` 가 바뀌면
|
|
34
|
+
* `tint-color` attribute 로 mirror. `deps` 가 바뀌면 native class patch가 반영된
|
|
35
|
+
* 다음 frame에 재동기화하고, UI 표시 이벤트에서는 즉시 동기화.
|
|
16
36
|
*
|
|
17
37
|
* ```tsx
|
|
18
38
|
* const iconColorProps = useIconColor([variant, disabled, loading]);
|
|
@@ -22,12 +42,16 @@ function syncTintColor(targetRef, sourceRef) {
|
|
|
22
42
|
function useIconColor(deps, options) {
|
|
23
43
|
const ref = useMainThreadRef(null);
|
|
24
44
|
const sourceRef = options?.sourceRef;
|
|
45
|
+
const frameRef = useMainThreadRef(0);
|
|
25
46
|
function syncOnUiAppear() {
|
|
26
47
|
"main thread";
|
|
27
|
-
|
|
48
|
+
syncTintColorOnce(ref, sourceRef);
|
|
28
49
|
}
|
|
29
50
|
useEffect(() => {
|
|
30
|
-
runOnMainThread(
|
|
51
|
+
runOnMainThread(scheduleTintColorSync)(ref, sourceRef, frameRef);
|
|
52
|
+
return () => {
|
|
53
|
+
runOnMainThread(cancelTintColorSync)(frameRef);
|
|
54
|
+
};
|
|
31
55
|
}, deps);
|
|
32
56
|
return {
|
|
33
57
|
ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePressTap.d.ts","sourceRoot":"","sources":["../../src/hooks/usePressTap.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,KAAK,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;AAEzD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,eAAe,CAAC,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,YAAY,CAAC;IACtB,cAAc,EAAE,YAAY,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,YAAY,CAAC;IAC9B,qBAAqB,CAAC,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAC;CAC/D;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"usePressTap.d.ts","sourceRoot":"","sources":["../../src/hooks/usePressTap.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,KAAK,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;AAEzD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,eAAe,CAAC,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,YAAY,CAAC;IACtB,cAAc,EAAE,YAAY,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,eAAe,EAAE,YAAY,CAAC;IAC9B,qBAAqB,CAAC,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAC;CAC/D;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,iBAAiB,CA2B/E"}
|
package/lib/hooks/usePressTap.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { useControllableState } from "./hooks/useControllableState.js";
|
|
1
2
|
import { usePressTap } from "./hooks/usePressTap.js";
|
|
2
3
|
import { createSlotRecipeContext } from "./utils/create-slot-recipe-context.jsx";
|
|
3
|
-
import {
|
|
4
|
+
import { useIconColor } from "./hooks/useIconColor.js";
|
|
4
5
|
import { useSafeArea } from "./hooks/useSafeArea.js";
|
|
6
|
+
import { Icon, PrefixIcon, SuffixIcon } from "./components/Icon/Icon.jsx";
|
|
7
|
+
import { AccordionBody, AccordionContent, AccordionDescription, AccordionHeader, AccordionItem, AccordionPrefix, AccordionRoot, AccordionSuffixIcon, AccordionTitle, AccordionTrigger } from "./components/Accordion/Accordion.jsx";
|
|
8
|
+
import { Accordion_namespace_exports } from "./components/Accordion/Accordion.namespace.js";
|
|
9
|
+
import { capitalize, resolveRecipeToken } from "./utils/resolve-recipe-token.js";
|
|
5
10
|
import { ProgressCircleRange, ProgressCircleRoot } from "./components/ProgressCircle/ProgressCircle.jsx";
|
|
6
11
|
import { ProgressCircle_namespace_exports } from "./components/ProgressCircle/ProgressCircle.namespace.js";
|
|
7
|
-
import { useIconColor } from "./hooks/useIconColor.js";
|
|
8
|
-
import { Icon, PrefixIcon, SuffixIcon } from "./components/Icon/Icon.jsx";
|
|
9
12
|
import { ActionButton } from "./components/ActionButton/ActionButton.jsx";
|
|
10
13
|
import { AppBarIconButton, AppBarLeft, AppBarMain, AppBarRight, AppBarRoot, AppBarSlot, AppBarSubtitle, AppBarTitle } from "./components/AppBar/AppBar.jsx";
|
|
11
14
|
import { AppBar_namespace_exports } from "./components/AppBar/AppBar.namespace.js";
|
|
@@ -13,10 +16,14 @@ import { Badge } from "./components/Badge/Badge.jsx";
|
|
|
13
16
|
import { Box } from "./components/Box/Box.jsx";
|
|
14
17
|
import { BottomSheetBackdrop, BottomSheetBody, BottomSheetContent, BottomSheetDescription, BottomSheetFooter, BottomSheetHandle, BottomSheetHeader, BottomSheetPositioner, BottomSheetRoot, BottomSheetTitle, BottomSheetTrigger } from "./components/BottomSheet/BottomSheet.jsx";
|
|
15
18
|
import { BottomSheet_namespace_exports } from "./components/BottomSheet/BottomSheet.namespace.js";
|
|
16
|
-
import {
|
|
19
|
+
import { CalloutCloseButton, CalloutContent, CalloutDescription, CalloutLink, CalloutRoot, CalloutTitle } from "./components/Callout/Callout.jsx";
|
|
20
|
+
import { Callout_namespace_exports } from "./components/Callout/Callout.namespace.js";
|
|
17
21
|
import { splitMultipleVariantsProps } from "./utils/split-multiple-variants-props.js";
|
|
18
22
|
import { CheckboxControl, CheckboxGroup, CheckboxIndicator, CheckboxLabel, CheckboxRoot } from "./components/Checkbox/Checkbox.jsx";
|
|
19
23
|
import { Checkbox_namespace_exports } from "./components/Checkbox/Checkbox.namespace.js";
|
|
24
|
+
import { ChipButton, ChipLabel, ChipPrefixAvatar, ChipPrefixIcon, ChipRadioItem, ChipRadioRoot, ChipRoot, ChipSuffixIcon, ChipToggle } from "./components/Chip/Chip.jsx";
|
|
25
|
+
import { Chip_namespace_exports } from "./components/Chip/Chip.namespace.js";
|
|
26
|
+
import { Divider } from "./components/Divider/Divider.jsx";
|
|
20
27
|
import { FieldCharacterCount, FieldDescription, FieldErrorMessage, FieldFooter, FieldHeader, FieldIndicatorText, FieldLabel, FieldRequiredIndicator, FieldRoot } from "./components/Field/Field.jsx";
|
|
21
28
|
import { Field_namespace_exports } from "./components/Field/Field.namespace.js";
|
|
22
29
|
import { KeyboardAvoidingScrollView } from "./components/KeyboardAvoidingScrollView/KeyboardAvoidingScrollView.jsx";
|
|
@@ -25,6 +32,8 @@ import { RadioGroup_namespace_exports } from "./components/RadioGroup/RadioGroup
|
|
|
25
32
|
import { HStack, VStack } from "./components/Stack/Stack.jsx";
|
|
26
33
|
import { SwitchControl, SwitchLabel, SwitchRoot, SwitchThumb } from "./components/Switch/Switch.jsx";
|
|
27
34
|
import { Switch_namespace_exports } from "./components/Switch/Switch.namespace.js";
|
|
35
|
+
import { TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger } from "./components/Tabs/Tabs.jsx";
|
|
36
|
+
import { Tabs_namespace_exports } from "./components/Tabs/Tabs.namespace.js";
|
|
28
37
|
import { TagGroupItem, TagGroupItemLabel, TagGroupRoot } from "./components/TagGroup/TagGroup.jsx";
|
|
29
38
|
import { TagGroup_namespace_exports } from "./components/TagGroup/TagGroup.namespace.js";
|
|
30
39
|
import { Text } from "./components/Text/Text.jsx";
|
|
@@ -33,4 +42,4 @@ import { useTextFieldWithGraphemes } from "./components/TextField/useTextFieldWi
|
|
|
33
42
|
import { TextField_namespace_exports } from "./components/TextField/TextField.namespace.js";
|
|
34
43
|
import { getSeedClassName } from "./utils/get-seed-class-name.js";
|
|
35
44
|
import { useSeedClassName } from "./hooks/useSeedClassName.js";
|
|
36
|
-
export { ActionButton, AppBar_namespace_exports as AppBar, AppBarIconButton, AppBarLeft, AppBarMain, AppBarRight, AppBarRoot, AppBarSlot, AppBarSubtitle, AppBarTitle, Badge, BottomSheet_namespace_exports as BottomSheet, BottomSheetBackdrop, BottomSheetBody, BottomSheetContent, BottomSheetDescription, BottomSheetFooter, BottomSheetHandle, BottomSheetHeader, BottomSheetPositioner, BottomSheetRoot, BottomSheetTitle, BottomSheetTrigger, Box, Checkbox_namespace_exports as Checkbox, CheckboxControl, CheckboxGroup, CheckboxIndicator, CheckboxLabel, CheckboxRoot, Field_namespace_exports as Field, FieldCharacterCount, FieldDescription, FieldErrorMessage, FieldFooter, FieldHeader, FieldIndicatorText, FieldLabel, FieldRequiredIndicator, FieldRoot, HStack, Icon, KeyboardAvoidingScrollView, PrefixIcon, ProgressCircle_namespace_exports as ProgressCircle, ProgressCircleRange, ProgressCircleRoot, RadioGroup_namespace_exports as RadioGroup, RadioGroupItem, RadioGroupItemControl, RadioGroupItemIndicator, RadioGroupItemLabel, RadioGroupRoot, SuffixIcon, Switch_namespace_exports as Switch, SwitchControl, SwitchLabel, SwitchRoot, SwitchThumb, TagGroup_namespace_exports as TagGroup, TagGroupItem, TagGroupItemLabel, TagGroupRoot, Text, TextField_namespace_exports as TextField, TextFieldInput, TextFieldPrefixIcon, TextFieldPrefixText, TextFieldRoot, TextFieldSuffixIcon, TextFieldSuffixText, TextFieldTextarea, VStack, capitalize, createSlotRecipeContext, getSeedClassName, resolveRecipeToken, splitMultipleVariantsProps, useControllableState, useIconColor, usePressTap, useSafeArea, useSeedClassName, useTextFieldWithGraphemes };
|
|
45
|
+
export { Accordion_namespace_exports as Accordion, AccordionBody, AccordionContent, AccordionDescription, AccordionHeader, AccordionItem, AccordionPrefix, AccordionRoot, AccordionSuffixIcon, AccordionTitle, AccordionTrigger, ActionButton, AppBar_namespace_exports as AppBar, AppBarIconButton, AppBarLeft, AppBarMain, AppBarRight, AppBarRoot, AppBarSlot, AppBarSubtitle, AppBarTitle, Badge, BottomSheet_namespace_exports as BottomSheet, BottomSheetBackdrop, BottomSheetBody, BottomSheetContent, BottomSheetDescription, BottomSheetFooter, BottomSheetHandle, BottomSheetHeader, BottomSheetPositioner, BottomSheetRoot, BottomSheetTitle, BottomSheetTrigger, Box, Callout_namespace_exports as Callout, CalloutCloseButton, CalloutContent, CalloutDescription, CalloutLink, CalloutRoot, CalloutTitle, Checkbox_namespace_exports as Checkbox, CheckboxControl, CheckboxGroup, CheckboxIndicator, CheckboxLabel, CheckboxRoot, Chip_namespace_exports as Chip, ChipButton, ChipLabel, ChipPrefixAvatar, ChipPrefixIcon, ChipRadioItem, ChipRadioRoot, ChipRoot, ChipSuffixIcon, ChipToggle, Divider, Field_namespace_exports as Field, FieldCharacterCount, FieldDescription, FieldErrorMessage, FieldFooter, FieldHeader, FieldIndicatorText, FieldLabel, FieldRequiredIndicator, FieldRoot, HStack, Icon, KeyboardAvoidingScrollView, PrefixIcon, ProgressCircle_namespace_exports as ProgressCircle, ProgressCircleRange, ProgressCircleRoot, RadioGroup_namespace_exports as RadioGroup, RadioGroupItem, RadioGroupItemControl, RadioGroupItemIndicator, RadioGroupItemLabel, RadioGroupRoot, SuffixIcon, Switch_namespace_exports as Switch, SwitchControl, SwitchLabel, SwitchRoot, SwitchThumb, Tabs_namespace_exports as Tabs, TabsCarousel, TabsCarouselCamera, TabsContent, TabsIndicator, TabsList, TabsRoot, TabsTrigger, TagGroup_namespace_exports as TagGroup, TagGroupItem, TagGroupItemLabel, TagGroupRoot, Text, TextField_namespace_exports as TextField, TextFieldInput, TextFieldPrefixIcon, TextFieldPrefixText, TextFieldRoot, TextFieldSuffixIcon, TextFieldSuffixText, TextFieldTextarea, VStack, capitalize, createSlotRecipeContext, getSeedClassName, resolveRecipeToken, splitMultipleVariantsProps, useControllableState, useIconColor, usePressTap, useSafeArea, useSeedClassName, useTextFieldWithGraphemes };
|