@ark-ui/react 0.0.0-rc-20221106094212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1735 -0
- package/dist/index.d.ts +612 -0
- package/dist/index.esm.js +1620 -0
- package/package.json +86 -0
|
@@ -0,0 +1,1620 @@
|
|
|
1
|
+
// src/accordion/accordion.tsx
|
|
2
|
+
import { forwardRef } from "@polymorphic-factory/react";
|
|
3
|
+
import { mergeProps } from "@zag-js/react";
|
|
4
|
+
|
|
5
|
+
// src/factory.tsx
|
|
6
|
+
import { polymorphicFactory } from "@polymorphic-factory/react";
|
|
7
|
+
var atlas = polymorphicFactory();
|
|
8
|
+
|
|
9
|
+
// src/split-props.ts
|
|
10
|
+
function splitProps(props, ...keySelections) {
|
|
11
|
+
const rest = { ...props };
|
|
12
|
+
const groups = keySelections.map((keys) => {
|
|
13
|
+
return keys.reduce((previousValue, key) => {
|
|
14
|
+
if (!(key in rest)) {
|
|
15
|
+
return previousValue;
|
|
16
|
+
}
|
|
17
|
+
previousValue[key] = rest[key];
|
|
18
|
+
delete rest[key];
|
|
19
|
+
return previousValue;
|
|
20
|
+
}, {});
|
|
21
|
+
});
|
|
22
|
+
return [...groups, rest];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// src/createContext.ts
|
|
26
|
+
import { createContext as createReactContext, useContext as useReactContext } from "react";
|
|
27
|
+
function getErrorMessage(hook, provider) {
|
|
28
|
+
return `${hook} returned \`undefined\`. Seems you forgot to wrap component within ${provider}`;
|
|
29
|
+
}
|
|
30
|
+
function createContext(options = {}) {
|
|
31
|
+
const {
|
|
32
|
+
name,
|
|
33
|
+
strict = true,
|
|
34
|
+
hookName = "useContext",
|
|
35
|
+
providerName = "Provider",
|
|
36
|
+
errorMessage
|
|
37
|
+
} = options;
|
|
38
|
+
const Context = createReactContext(void 0);
|
|
39
|
+
Context.displayName = name;
|
|
40
|
+
function useContext() {
|
|
41
|
+
const context = useReactContext(Context);
|
|
42
|
+
if (!context && strict) {
|
|
43
|
+
const error = new Error(errorMessage ?? getErrorMessage(hookName, providerName));
|
|
44
|
+
error.name = "ContextError";
|
|
45
|
+
Error.captureStackTrace?.(error, useContext);
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
return context;
|
|
49
|
+
}
|
|
50
|
+
return [Context.Provider, useContext, Context];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// src/accordion/accordion-context.ts
|
|
54
|
+
var [AccordionProvider, useAccordionContext] = createContext({
|
|
55
|
+
name: "AccordionContext",
|
|
56
|
+
hookName: "useAccordionContext",
|
|
57
|
+
providerName: "<AccordionProvider />"
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// src/accordion/use-accordion.ts
|
|
61
|
+
import * as accordion from "@zag-js/accordion";
|
|
62
|
+
import { normalizeProps, useMachine } from "@zag-js/react";
|
|
63
|
+
import { useId } from "react";
|
|
64
|
+
|
|
65
|
+
// src/filter-undefined-entries.tsx
|
|
66
|
+
function filterUndefinedEntries(target) {
|
|
67
|
+
if (!target || typeof target !== "object") {
|
|
68
|
+
return target;
|
|
69
|
+
}
|
|
70
|
+
return Object.fromEntries(
|
|
71
|
+
Object.entries(target).filter(([, value]) => typeof value !== "undefined")
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// src/accordion/use-accordion.ts
|
|
76
|
+
var useAccordion = (props) => {
|
|
77
|
+
const initialContext = filterUndefinedEntries({
|
|
78
|
+
id: useId(),
|
|
79
|
+
...props,
|
|
80
|
+
value: props.value ?? props.defaultValue
|
|
81
|
+
});
|
|
82
|
+
const context = filterUndefinedEntries({
|
|
83
|
+
...initialContext,
|
|
84
|
+
value: props.value
|
|
85
|
+
});
|
|
86
|
+
const [state, send] = useMachine(accordion.machine(initialContext), { context });
|
|
87
|
+
return accordion.connect(state, send, normalizeProps);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// src/accordion/accordion.tsx
|
|
91
|
+
import { jsx } from "react/jsx-runtime";
|
|
92
|
+
var Accordion = forwardRef((props, ref) => {
|
|
93
|
+
const [useAccordionProps, divProps] = splitProps(props, [
|
|
94
|
+
"collapsible",
|
|
95
|
+
"defaultValue",
|
|
96
|
+
"dir",
|
|
97
|
+
"disabled",
|
|
98
|
+
"getRootNode",
|
|
99
|
+
"ids",
|
|
100
|
+
"multiple",
|
|
101
|
+
"onChange",
|
|
102
|
+
"value"
|
|
103
|
+
]);
|
|
104
|
+
const accordion2 = useAccordion(useAccordionProps);
|
|
105
|
+
const mergedProps = mergeProps(accordion2.rootProps, divProps);
|
|
106
|
+
return /* @__PURE__ */ jsx(AccordionProvider, {
|
|
107
|
+
value: accordion2,
|
|
108
|
+
children: /* @__PURE__ */ jsx(atlas.div, {
|
|
109
|
+
...mergedProps,
|
|
110
|
+
ref
|
|
111
|
+
})
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// src/accordion/accordion-button.tsx
|
|
116
|
+
import { forwardRef as forwardRef2 } from "@polymorphic-factory/react";
|
|
117
|
+
import { mergeProps as mergeProps2 } from "@zag-js/react";
|
|
118
|
+
|
|
119
|
+
// src/accordion/accordion-item-context.ts
|
|
120
|
+
var [AccordionItemProvider, useAccordionItemContext] = createContext(
|
|
121
|
+
{
|
|
122
|
+
name: "AccordionItemContext",
|
|
123
|
+
hookName: "useAccordionItemContext",
|
|
124
|
+
providerName: "<AccordionItemProvider />"
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
// src/accordion/accordion-button.tsx
|
|
129
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
130
|
+
var AccordionButton = forwardRef2((props, ref) => {
|
|
131
|
+
const { getTriggerProps } = useAccordionContext();
|
|
132
|
+
const context = useAccordionItemContext();
|
|
133
|
+
const mergedProps = mergeProps2(getTriggerProps(context), props);
|
|
134
|
+
return /* @__PURE__ */ jsx2(atlas.button, {
|
|
135
|
+
...mergedProps,
|
|
136
|
+
ref
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// src/accordion/accordion-icon.tsx
|
|
141
|
+
import { forwardRef as forwardRef3 } from "@polymorphic-factory/react";
|
|
142
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
143
|
+
var AccordionIcon = forwardRef3((props, ref) => {
|
|
144
|
+
return /* @__PURE__ */ jsx3(atlas.div, {
|
|
145
|
+
...props,
|
|
146
|
+
ref
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// src/accordion/accordion-item.tsx
|
|
151
|
+
import { forwardRef as forwardRef4 } from "@polymorphic-factory/react";
|
|
152
|
+
import { mergeProps as mergeProps3 } from "@zag-js/react";
|
|
153
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
154
|
+
var AccordionItem = forwardRef4((props, ref) => {
|
|
155
|
+
const { value, disabled, children, ...rest } = props;
|
|
156
|
+
const { getItemProps, getItemState } = useAccordionContext();
|
|
157
|
+
const itemState = getItemState({ value });
|
|
158
|
+
const mergedProps = mergeProps3(getItemProps({ value, disabled }), rest);
|
|
159
|
+
return /* @__PURE__ */ jsx4(AccordionItemProvider, {
|
|
160
|
+
value: { value, disabled, ...itemState },
|
|
161
|
+
children: /* @__PURE__ */ jsx4(atlas.div, {
|
|
162
|
+
...mergedProps,
|
|
163
|
+
ref,
|
|
164
|
+
children: typeof children === "function" ? children(itemState) : children
|
|
165
|
+
})
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// src/accordion/accordion-panel.tsx
|
|
170
|
+
import { forwardRef as forwardRef5 } from "@polymorphic-factory/react";
|
|
171
|
+
import { mergeProps as mergeProps4 } from "@zag-js/react";
|
|
172
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
173
|
+
var AccordionPanel = forwardRef5((props, ref) => {
|
|
174
|
+
const { getContentProps } = useAccordionContext();
|
|
175
|
+
const context = useAccordionItemContext();
|
|
176
|
+
const mergedProps = mergeProps4(getContentProps(context), props);
|
|
177
|
+
return /* @__PURE__ */ jsx5(atlas.div, {
|
|
178
|
+
...mergedProps,
|
|
179
|
+
ref
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// src/checkbox/checkbox.tsx
|
|
184
|
+
import { forwardRef as forwardRef6 } from "@polymorphic-factory/react";
|
|
185
|
+
import { mergeProps as mergeProps5 } from "@zag-js/react";
|
|
186
|
+
|
|
187
|
+
// src/checkbox/checkbox-context.tsx
|
|
188
|
+
var [CheckboxProvider, useCheckboxContext] = createContext({
|
|
189
|
+
name: "CheckboxContext",
|
|
190
|
+
hookName: "useCheckboxContext",
|
|
191
|
+
providerName: "<CheckboxProvider />"
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
// src/checkbox/use-checkbox.ts
|
|
195
|
+
import * as checkbox from "@zag-js/checkbox";
|
|
196
|
+
import { normalizeProps as normalizeProps2, useMachine as useMachine2 } from "@zag-js/react";
|
|
197
|
+
import { useId as useId2 } from "react";
|
|
198
|
+
var useCheckbox = (props) => {
|
|
199
|
+
const initialContext = filterUndefinedEntries({
|
|
200
|
+
id: useId2(),
|
|
201
|
+
...props,
|
|
202
|
+
value: props.value ?? props.defaultValue
|
|
203
|
+
});
|
|
204
|
+
const context = filterUndefinedEntries({
|
|
205
|
+
...initialContext,
|
|
206
|
+
value: props.value
|
|
207
|
+
});
|
|
208
|
+
const [state, send] = useMachine2(checkbox.machine(initialContext), { context });
|
|
209
|
+
return checkbox.connect(state, send, normalizeProps2);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
// src/checkbox/checkbox.tsx
|
|
213
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
214
|
+
var Checkbox = forwardRef6((props, ref) => {
|
|
215
|
+
const [useCheckboxProps, labelprops] = splitProps(props, [
|
|
216
|
+
"aria-describedby",
|
|
217
|
+
"aria-invalid",
|
|
218
|
+
"aria-label",
|
|
219
|
+
"aria-labelledby",
|
|
220
|
+
"defaultChecked",
|
|
221
|
+
"dir",
|
|
222
|
+
"defaultValue",
|
|
223
|
+
"disabled",
|
|
224
|
+
"focusable",
|
|
225
|
+
"getRootNode",
|
|
226
|
+
"ids",
|
|
227
|
+
"indeterminate",
|
|
228
|
+
"invalid",
|
|
229
|
+
"name",
|
|
230
|
+
"onChange",
|
|
231
|
+
"readonly",
|
|
232
|
+
"required",
|
|
233
|
+
"value"
|
|
234
|
+
]);
|
|
235
|
+
const checkbox2 = useCheckbox(useCheckboxProps);
|
|
236
|
+
const mergedProps = mergeProps5(checkbox2.rootProps, labelprops);
|
|
237
|
+
return /* @__PURE__ */ jsx6(CheckboxProvider, {
|
|
238
|
+
value: checkbox2,
|
|
239
|
+
children: /* @__PURE__ */ jsx6(atlas.label, {
|
|
240
|
+
...mergedProps,
|
|
241
|
+
ref
|
|
242
|
+
})
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
// src/checkbox/checkbox-control.tsx
|
|
247
|
+
import { forwardRef as forwardRef7 } from "@polymorphic-factory/react";
|
|
248
|
+
import { mergeProps as mergeProps6 } from "@zag-js/react";
|
|
249
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
250
|
+
var CheckboxControl = forwardRef7((props, ref) => {
|
|
251
|
+
const { controlProps } = useCheckboxContext();
|
|
252
|
+
const mergedProps = mergeProps6(controlProps, props);
|
|
253
|
+
return /* @__PURE__ */ jsx7(atlas.div, {
|
|
254
|
+
...mergedProps,
|
|
255
|
+
ref
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
// src/checkbox/checkbox-input.tsx
|
|
260
|
+
import { forwardRef as forwardRef8 } from "@polymorphic-factory/react";
|
|
261
|
+
import { mergeProps as mergeProps7 } from "@zag-js/react";
|
|
262
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
263
|
+
var CheckboxInput = forwardRef8((props, ref) => {
|
|
264
|
+
const { inputProps } = useCheckboxContext();
|
|
265
|
+
const mergedProps = mergeProps7(inputProps, props);
|
|
266
|
+
return /* @__PURE__ */ jsx8(atlas.input, {
|
|
267
|
+
...mergedProps,
|
|
268
|
+
ref
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// src/checkbox/checkbox-label.tsx
|
|
273
|
+
import { forwardRef as forwardRef9 } from "@polymorphic-factory/react";
|
|
274
|
+
import { mergeProps as mergeProps8 } from "@zag-js/react";
|
|
275
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
276
|
+
var CheckboxLabel = forwardRef9((props, ref) => {
|
|
277
|
+
const { labelProps } = useCheckboxContext();
|
|
278
|
+
const mergedProps = mergeProps8(labelProps, props);
|
|
279
|
+
return /* @__PURE__ */ jsx9(atlas.label, {
|
|
280
|
+
...mergedProps,
|
|
281
|
+
ref
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
// src/dialog/dialog-context.ts
|
|
286
|
+
var [DialogProvider, useDialogContext] = createContext({
|
|
287
|
+
name: "DialogContext",
|
|
288
|
+
hookName: "useDialogContext",
|
|
289
|
+
providerName: "<DialogProvider />"
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
// src/dialog/use-dialog.ts
|
|
293
|
+
import * as dialog from "@zag-js/dialog";
|
|
294
|
+
import { normalizeProps as normalizeProps3, useMachine as useMachine3 } from "@zag-js/react";
|
|
295
|
+
import { useId as useId3 } from "react";
|
|
296
|
+
var useDialog = (props) => {
|
|
297
|
+
const initialContext = filterUndefinedEntries({
|
|
298
|
+
id: useId3(),
|
|
299
|
+
...props
|
|
300
|
+
});
|
|
301
|
+
const [state, send] = useMachine3(dialog.machine(initialContext), { context: initialContext });
|
|
302
|
+
return dialog.connect(state, send, normalizeProps3);
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
// src/dialog/dialog.tsx
|
|
306
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
307
|
+
var Dialog = (props) => {
|
|
308
|
+
const { children, ...useDialogProps } = props;
|
|
309
|
+
const dialog2 = useDialog(useDialogProps);
|
|
310
|
+
return /* @__PURE__ */ jsx10(DialogProvider, {
|
|
311
|
+
value: dialog2,
|
|
312
|
+
children
|
|
313
|
+
});
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// src/dialog/dialog-backdrop.tsx
|
|
317
|
+
import { forwardRef as forwardRef10 } from "@polymorphic-factory/react";
|
|
318
|
+
import { mergeProps as mergeProps9 } from "@zag-js/react";
|
|
319
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
320
|
+
var DialogBackdrop = forwardRef10((props, ref) => {
|
|
321
|
+
const { backdropProps } = useDialogContext();
|
|
322
|
+
const mergedProps = mergeProps9(backdropProps, props);
|
|
323
|
+
return /* @__PURE__ */ jsx11(atlas.div, {
|
|
324
|
+
...mergedProps,
|
|
325
|
+
ref
|
|
326
|
+
});
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
// src/dialog/dialog-close-button.tsx
|
|
330
|
+
import { forwardRef as forwardRef11 } from "@polymorphic-factory/react";
|
|
331
|
+
import { mergeProps as mergeProps10 } from "@zag-js/react";
|
|
332
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
333
|
+
var DialogCloseButton = forwardRef11((props, ref) => {
|
|
334
|
+
const { closeButtonProps } = useDialogContext();
|
|
335
|
+
const mergedProps = mergeProps10(closeButtonProps, props);
|
|
336
|
+
return /* @__PURE__ */ jsx12(atlas.button, {
|
|
337
|
+
...mergedProps,
|
|
338
|
+
ref
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
// src/dialog/dialog-content.tsx
|
|
343
|
+
import { forwardRef as forwardRef12 } from "@polymorphic-factory/react";
|
|
344
|
+
import { mergeProps as mergeProps11 } from "@zag-js/react";
|
|
345
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
346
|
+
var DialogContent = forwardRef12((props, ref) => {
|
|
347
|
+
const { contentProps } = useDialogContext();
|
|
348
|
+
const mergedProps = mergeProps11(contentProps, props);
|
|
349
|
+
return /* @__PURE__ */ jsx13(atlas.div, {
|
|
350
|
+
...mergedProps,
|
|
351
|
+
ref
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
// src/dialog/dialog-description.tsx
|
|
356
|
+
import { forwardRef as forwardRef13 } from "@polymorphic-factory/react";
|
|
357
|
+
import { mergeProps as mergeProps12 } from "@zag-js/react";
|
|
358
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
359
|
+
var DialogDescription = forwardRef13((props, ref) => {
|
|
360
|
+
const { descriptionProps } = useDialogContext();
|
|
361
|
+
const mergedProps = mergeProps12(descriptionProps, props);
|
|
362
|
+
return /* @__PURE__ */ jsx14(atlas.p, {
|
|
363
|
+
...mergedProps,
|
|
364
|
+
ref
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
// src/dialog/dialog-portal.tsx
|
|
369
|
+
import { Portal } from "@reach/portal";
|
|
370
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
371
|
+
var DialogPortal = (props) => {
|
|
372
|
+
const { isOpen } = useDialogContext();
|
|
373
|
+
return isOpen ? /* @__PURE__ */ jsx15(Portal, {
|
|
374
|
+
type: "atlas-portal",
|
|
375
|
+
...props
|
|
376
|
+
}) : null;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
// src/dialog/dialog-title.tsx
|
|
380
|
+
import { forwardRef as forwardRef14 } from "@polymorphic-factory/react";
|
|
381
|
+
import { mergeProps as mergeProps13 } from "@zag-js/react";
|
|
382
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
383
|
+
var DialogTitle = forwardRef14((props, ref) => {
|
|
384
|
+
const { titleProps } = useDialogContext();
|
|
385
|
+
const mergedProps = mergeProps13(titleProps, props);
|
|
386
|
+
return /* @__PURE__ */ jsx16(atlas.h2, {
|
|
387
|
+
...mergedProps,
|
|
388
|
+
ref
|
|
389
|
+
});
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
// src/dialog/dialog-trigger.tsx
|
|
393
|
+
import { cloneElement } from "react";
|
|
394
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
395
|
+
var DialogTrigger = (props) => {
|
|
396
|
+
const { children } = props;
|
|
397
|
+
const { triggerProps } = useDialogContext();
|
|
398
|
+
return typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx17(atlas.span, {
|
|
399
|
+
...triggerProps,
|
|
400
|
+
children
|
|
401
|
+
}) : cloneElement(children, triggerProps);
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
// src/dialog/dialog-underlay.tsx
|
|
405
|
+
import { forwardRef as forwardRef15 } from "@polymorphic-factory/react";
|
|
406
|
+
import { mergeProps as mergeProps14 } from "@zag-js/react";
|
|
407
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
408
|
+
var DialogUnderlay = forwardRef15((props, ref) => {
|
|
409
|
+
const { underlayProps } = useDialogContext();
|
|
410
|
+
const mergedProps = mergeProps14(underlayProps, props);
|
|
411
|
+
return /* @__PURE__ */ jsx18(atlas.div, {
|
|
412
|
+
...mergedProps,
|
|
413
|
+
ref
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
// src/editable/editable.tsx
|
|
418
|
+
import { forwardRef as forwardRef16 } from "@polymorphic-factory/react";
|
|
419
|
+
import { mergeProps as mergeProps15 } from "@zag-js/react";
|
|
420
|
+
|
|
421
|
+
// src/editable/editable-context.ts
|
|
422
|
+
var [EditableProvider, useEditableContext] = createContext({
|
|
423
|
+
name: "EditableContext",
|
|
424
|
+
hookName: "useEditableContext",
|
|
425
|
+
providerName: "<EditableProvider />"
|
|
426
|
+
});
|
|
427
|
+
|
|
428
|
+
// src/editable/use-editable.ts
|
|
429
|
+
import * as editable from "@zag-js/editable";
|
|
430
|
+
import { normalizeProps as normalizeProps4, useMachine as useMachine4 } from "@zag-js/react";
|
|
431
|
+
import { useId as useId4 } from "react";
|
|
432
|
+
var useEditable = (props) => {
|
|
433
|
+
const initialContext = filterUndefinedEntries({
|
|
434
|
+
id: useId4(),
|
|
435
|
+
...props,
|
|
436
|
+
value: props.value ?? props.defaultValue
|
|
437
|
+
});
|
|
438
|
+
const context = filterUndefinedEntries({
|
|
439
|
+
...initialContext,
|
|
440
|
+
value: props.value
|
|
441
|
+
});
|
|
442
|
+
const [state, send] = useMachine4(editable.machine(initialContext), { context });
|
|
443
|
+
return editable.connect(state, send, normalizeProps4);
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
// src/editable/editable.tsx
|
|
447
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
448
|
+
var Editable = forwardRef16((props, ref) => {
|
|
449
|
+
const [useEditableProps, divProps] = splitProps(props, [
|
|
450
|
+
"activationMode",
|
|
451
|
+
"autoResize",
|
|
452
|
+
"defaultValue",
|
|
453
|
+
"dir",
|
|
454
|
+
"disabled",
|
|
455
|
+
"getRootNode",
|
|
456
|
+
"ids",
|
|
457
|
+
"invalid",
|
|
458
|
+
"maxLength",
|
|
459
|
+
"name",
|
|
460
|
+
"onCancel",
|
|
461
|
+
"onChange",
|
|
462
|
+
"onEdit",
|
|
463
|
+
"onSubmit",
|
|
464
|
+
"placeholder",
|
|
465
|
+
"readonly",
|
|
466
|
+
"selectOnFocus",
|
|
467
|
+
"startWithEditView",
|
|
468
|
+
"submitMode",
|
|
469
|
+
"translations",
|
|
470
|
+
"value"
|
|
471
|
+
]);
|
|
472
|
+
const editable2 = useEditable(useEditableProps);
|
|
473
|
+
const mergedProps = mergeProps15(editable2.rootProps, divProps);
|
|
474
|
+
return /* @__PURE__ */ jsx19(EditableProvider, {
|
|
475
|
+
value: editable2,
|
|
476
|
+
children: /* @__PURE__ */ jsx19(atlas.div, {
|
|
477
|
+
...mergedProps,
|
|
478
|
+
ref
|
|
479
|
+
})
|
|
480
|
+
});
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
// src/editable/editable-area.tsx
|
|
484
|
+
import { forwardRef as forwardRef17 } from "@polymorphic-factory/react";
|
|
485
|
+
import { mergeProps as mergeProps16 } from "@zag-js/react";
|
|
486
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
487
|
+
var EditableArea = forwardRef17((props, ref) => {
|
|
488
|
+
const { areaProps } = useEditableContext();
|
|
489
|
+
const mergedProps = mergeProps16(areaProps, props);
|
|
490
|
+
return /* @__PURE__ */ jsx20(atlas.div, {
|
|
491
|
+
...mergedProps,
|
|
492
|
+
ref
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
// src/editable/editable-cancel-button.tsx
|
|
497
|
+
import { forwardRef as forwardRef18 } from "@polymorphic-factory/react";
|
|
498
|
+
import { mergeProps as mergeProps17 } from "@zag-js/react";
|
|
499
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
500
|
+
var EditableCancelButton = forwardRef18(
|
|
501
|
+
(props, ref) => {
|
|
502
|
+
const { cancelButtonProps } = useEditableContext();
|
|
503
|
+
const mergedProps = mergeProps17(cancelButtonProps, props);
|
|
504
|
+
return /* @__PURE__ */ jsx21(atlas.button, {
|
|
505
|
+
...mergedProps,
|
|
506
|
+
ref
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
);
|
|
510
|
+
|
|
511
|
+
// src/editable/editable-controls.tsx
|
|
512
|
+
import { forwardRef as forwardRef19 } from "@polymorphic-factory/react";
|
|
513
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
514
|
+
var EditableControls = forwardRef19((props, ref) => {
|
|
515
|
+
const { children, ...divProps } = props;
|
|
516
|
+
const api = useEditableContext();
|
|
517
|
+
return /* @__PURE__ */ jsx22(atlas.div, {
|
|
518
|
+
...divProps,
|
|
519
|
+
ref,
|
|
520
|
+
children: children(api)
|
|
521
|
+
});
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
// src/editable/editable-edit-button.tsx
|
|
525
|
+
import { forwardRef as forwardRef20 } from "@polymorphic-factory/react";
|
|
526
|
+
import { mergeProps as mergeProps18 } from "@zag-js/react";
|
|
527
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
528
|
+
var EditableEditButton = forwardRef20((props, ref) => {
|
|
529
|
+
const { editButtonProps } = useEditableContext();
|
|
530
|
+
const mergedProps = mergeProps18(editButtonProps, props);
|
|
531
|
+
return /* @__PURE__ */ jsx23(atlas.button, {
|
|
532
|
+
...mergedProps,
|
|
533
|
+
ref
|
|
534
|
+
});
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
// src/editable/editable-input.tsx
|
|
538
|
+
import { forwardRef as forwardRef21 } from "@polymorphic-factory/react";
|
|
539
|
+
import { mergeProps as mergeProps19 } from "@zag-js/react";
|
|
540
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
541
|
+
var EditableInput = forwardRef21((props, ref) => {
|
|
542
|
+
const { inputProps } = useEditableContext();
|
|
543
|
+
const mergedProps = mergeProps19(inputProps, props);
|
|
544
|
+
return /* @__PURE__ */ jsx24(atlas.input, {
|
|
545
|
+
...mergedProps,
|
|
546
|
+
ref
|
|
547
|
+
});
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
// src/editable/editable-preview.tsx
|
|
551
|
+
import { forwardRef as forwardRef22 } from "@polymorphic-factory/react";
|
|
552
|
+
import { mergeProps as mergeProps20 } from "@zag-js/react";
|
|
553
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
554
|
+
var EditablePreview = forwardRef22((props, ref) => {
|
|
555
|
+
const { previewProps } = useEditableContext();
|
|
556
|
+
const mergedProps = mergeProps20(previewProps, props);
|
|
557
|
+
return /* @__PURE__ */ jsx25(atlas.span, {
|
|
558
|
+
...mergedProps,
|
|
559
|
+
ref
|
|
560
|
+
});
|
|
561
|
+
});
|
|
562
|
+
|
|
563
|
+
// src/editable/editable-submit-button.tsx
|
|
564
|
+
import { forwardRef as forwardRef23 } from "@polymorphic-factory/react";
|
|
565
|
+
import { mergeProps as mergeProps21 } from "@zag-js/react";
|
|
566
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
567
|
+
var EditableSubmitButton = forwardRef23(
|
|
568
|
+
(props, ref) => {
|
|
569
|
+
const { submitButtonProps } = useEditableContext();
|
|
570
|
+
const mergedProps = mergeProps21(submitButtonProps, props);
|
|
571
|
+
return /* @__PURE__ */ jsx26(atlas.button, {
|
|
572
|
+
...mergedProps,
|
|
573
|
+
ref
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
);
|
|
577
|
+
|
|
578
|
+
// src/number-input/number-input.tsx
|
|
579
|
+
import { forwardRef as forwardRef24 } from "@polymorphic-factory/react";
|
|
580
|
+
import { mergeProps as mergeProps22 } from "@zag-js/react";
|
|
581
|
+
|
|
582
|
+
// src/number-input/number-input-context.ts
|
|
583
|
+
var [NumberInputProvider, useNumberInputContext] = createContext({
|
|
584
|
+
name: "NumberInputContext",
|
|
585
|
+
hookName: "useNumberInputContext",
|
|
586
|
+
providerName: "<NumberInputProvider />"
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
// src/number-input/use-number-input.ts
|
|
590
|
+
import * as numberInput from "@zag-js/number-input";
|
|
591
|
+
import { normalizeProps as normalizeProps5, useMachine as useMachine5 } from "@zag-js/react";
|
|
592
|
+
import { useId as useId5 } from "react";
|
|
593
|
+
var useNumberInput = (props) => {
|
|
594
|
+
const initialContext = filterUndefinedEntries({
|
|
595
|
+
id: useId5(),
|
|
596
|
+
...props,
|
|
597
|
+
value: props.value ?? props.defaultValue
|
|
598
|
+
});
|
|
599
|
+
const context = filterUndefinedEntries({
|
|
600
|
+
...initialContext,
|
|
601
|
+
value: props.value
|
|
602
|
+
});
|
|
603
|
+
const [state, send] = useMachine5(numberInput.machine(initialContext), { context });
|
|
604
|
+
return numberInput.connect(state, send, normalizeProps5);
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
// src/number-input/number-input.tsx
|
|
608
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
609
|
+
var NumberInput = forwardRef24((props, ref) => {
|
|
610
|
+
const [useNumberInputProps, divProps] = splitProps(props, [
|
|
611
|
+
"allowMouseWheel",
|
|
612
|
+
"allowOverflow",
|
|
613
|
+
"clampValueOnBlur",
|
|
614
|
+
"defaultValue",
|
|
615
|
+
"dir",
|
|
616
|
+
"disabled",
|
|
617
|
+
"focusInputOnChange",
|
|
618
|
+
"format",
|
|
619
|
+
"getRootNode",
|
|
620
|
+
"ids",
|
|
621
|
+
"inputMode",
|
|
622
|
+
"invalid",
|
|
623
|
+
"max",
|
|
624
|
+
"maxFractionDigits",
|
|
625
|
+
"min",
|
|
626
|
+
"minFractionDigits",
|
|
627
|
+
"name",
|
|
628
|
+
"onBlur",
|
|
629
|
+
"onChange",
|
|
630
|
+
"onFocus",
|
|
631
|
+
"onInvalid",
|
|
632
|
+
"parse",
|
|
633
|
+
"pattern",
|
|
634
|
+
"readonly",
|
|
635
|
+
"spinOnPress",
|
|
636
|
+
"step",
|
|
637
|
+
"translations",
|
|
638
|
+
"validateCharacter",
|
|
639
|
+
"value"
|
|
640
|
+
]);
|
|
641
|
+
const pinInput2 = useNumberInput(useNumberInputProps);
|
|
642
|
+
const mergedProps = mergeProps22(pinInput2.rootProps, divProps);
|
|
643
|
+
return /* @__PURE__ */ jsx27(NumberInputProvider, {
|
|
644
|
+
value: pinInput2,
|
|
645
|
+
children: /* @__PURE__ */ jsx27(atlas.div, {
|
|
646
|
+
...mergedProps,
|
|
647
|
+
ref
|
|
648
|
+
})
|
|
649
|
+
});
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
// src/number-input/number-input-decrement-button.tsx
|
|
653
|
+
import { forwardRef as forwardRef25 } from "@polymorphic-factory/react";
|
|
654
|
+
import { mergeProps as mergeProps23 } from "@zag-js/react";
|
|
655
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
656
|
+
var NumberInputDecrementButton = forwardRef25(
|
|
657
|
+
(props, ref) => {
|
|
658
|
+
const { decrementButtonProps } = useNumberInputContext();
|
|
659
|
+
const mergedProps = mergeProps23(decrementButtonProps, props);
|
|
660
|
+
return /* @__PURE__ */ jsx28(atlas.button, {
|
|
661
|
+
...mergedProps,
|
|
662
|
+
ref
|
|
663
|
+
});
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
|
|
667
|
+
// src/number-input/number-input-field.tsx
|
|
668
|
+
import { forwardRef as forwardRef26 } from "@polymorphic-factory/react";
|
|
669
|
+
import { mergeProps as mergeProps24 } from "@zag-js/react";
|
|
670
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
671
|
+
var NumberInputField = forwardRef26((props, ref) => {
|
|
672
|
+
const { inputProps } = useNumberInputContext();
|
|
673
|
+
const mergedProps = mergeProps24(inputProps, props);
|
|
674
|
+
return /* @__PURE__ */ jsx29(atlas.input, {
|
|
675
|
+
...mergedProps,
|
|
676
|
+
ref
|
|
677
|
+
});
|
|
678
|
+
});
|
|
679
|
+
|
|
680
|
+
// src/number-input/number-input-increment-button.tsx
|
|
681
|
+
import { forwardRef as forwardRef27 } from "@polymorphic-factory/react";
|
|
682
|
+
import { mergeProps as mergeProps25 } from "@zag-js/react";
|
|
683
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
684
|
+
var NumberInputIncrementButton = forwardRef27(
|
|
685
|
+
(props, ref) => {
|
|
686
|
+
const { incrementButtonProps } = useNumberInputContext();
|
|
687
|
+
const mergedProps = mergeProps25(incrementButtonProps, props);
|
|
688
|
+
return /* @__PURE__ */ jsx30(atlas.button, {
|
|
689
|
+
...mergedProps,
|
|
690
|
+
ref
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
);
|
|
694
|
+
|
|
695
|
+
// src/pagination/pagination.tsx
|
|
696
|
+
import { forwardRef as forwardRef28 } from "@polymorphic-factory/react";
|
|
697
|
+
import { mergeProps as mergeProps26 } from "@zag-js/react";
|
|
698
|
+
|
|
699
|
+
// src/run-if-fn.ts
|
|
700
|
+
function runIfFn(valueOrFn, ...args) {
|
|
701
|
+
return typeof valueOrFn === "function" ? valueOrFn(...args) : valueOrFn;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
// src/pagination/pagination-context.ts
|
|
705
|
+
var [PaginationProvider, usePaginationContext] = createContext({
|
|
706
|
+
name: "PaginationContext",
|
|
707
|
+
hookName: "usePaginationContext",
|
|
708
|
+
providerName: "<PaginationProvider />"
|
|
709
|
+
});
|
|
710
|
+
|
|
711
|
+
// src/pagination/use-pagination.ts
|
|
712
|
+
import * as pagination from "@zag-js/pagination";
|
|
713
|
+
import { normalizeProps as normalizeProps6, useMachine as useMachine6 } from "@zag-js/react";
|
|
714
|
+
import { useId as useId6 } from "react";
|
|
715
|
+
var usePagination = (props) => {
|
|
716
|
+
const initialContext = filterUndefinedEntries({
|
|
717
|
+
id: useId6(),
|
|
718
|
+
...props
|
|
719
|
+
});
|
|
720
|
+
const [state, send] = useMachine6(pagination.machine(initialContext), { context: initialContext });
|
|
721
|
+
return pagination.connect(state, send, normalizeProps6);
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
// src/pagination/pagination.tsx
|
|
725
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
726
|
+
var Pagination = forwardRef28((props, ref) => {
|
|
727
|
+
const [paginationProps, { children, ...navProps }] = splitProps(props, [
|
|
728
|
+
"count",
|
|
729
|
+
"dir",
|
|
730
|
+
"getRootNode",
|
|
731
|
+
"ids",
|
|
732
|
+
"onChange",
|
|
733
|
+
"page",
|
|
734
|
+
"pageSize",
|
|
735
|
+
"siblingCount",
|
|
736
|
+
"translations"
|
|
737
|
+
]);
|
|
738
|
+
const pagination2 = usePagination(paginationProps);
|
|
739
|
+
const view = runIfFn(children, pagination2);
|
|
740
|
+
const mergedProps = mergeProps26(pagination2.rootProps, navProps);
|
|
741
|
+
return /* @__PURE__ */ jsx31(PaginationProvider, {
|
|
742
|
+
value: pagination2,
|
|
743
|
+
children: /* @__PURE__ */ jsx31(atlas.nav, {
|
|
744
|
+
...mergedProps,
|
|
745
|
+
ref,
|
|
746
|
+
children: view
|
|
747
|
+
})
|
|
748
|
+
});
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
// src/pagination/pagination-ellipsis.tsx
|
|
752
|
+
import { forwardRef as forwardRef29 } from "@polymorphic-factory/react";
|
|
753
|
+
import { mergeProps as mergeProps27 } from "@zag-js/react";
|
|
754
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
755
|
+
var PaginationEllipsis = forwardRef29((props, ref) => {
|
|
756
|
+
const { getEllipsisProps } = usePaginationContext();
|
|
757
|
+
const [{ index }, spanProps] = splitProps(props, ["index"]);
|
|
758
|
+
const mergedProps = mergeProps27(getEllipsisProps({ index }), spanProps);
|
|
759
|
+
return /* @__PURE__ */ jsx32(atlas.span, {
|
|
760
|
+
...mergedProps,
|
|
761
|
+
ref
|
|
762
|
+
});
|
|
763
|
+
});
|
|
764
|
+
|
|
765
|
+
// src/pagination/pagination-item.tsx
|
|
766
|
+
import { forwardRef as forwardRef30 } from "@polymorphic-factory/react";
|
|
767
|
+
import { mergeProps as mergeProps28 } from "@zag-js/react";
|
|
768
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
769
|
+
var PaginationItem = forwardRef30((props, ref) => {
|
|
770
|
+
const { getItemProps } = usePaginationContext();
|
|
771
|
+
const [{ value }, anchorProps] = splitProps(props, ["value"]);
|
|
772
|
+
const mergedProps = mergeProps28(getItemProps({ type: "page", value }), anchorProps);
|
|
773
|
+
return /* @__PURE__ */ jsx33(atlas.a, {
|
|
774
|
+
href: `#${value}`,
|
|
775
|
+
...mergedProps,
|
|
776
|
+
ref
|
|
777
|
+
});
|
|
778
|
+
});
|
|
779
|
+
|
|
780
|
+
// src/pagination/pagination-next-item.tsx
|
|
781
|
+
import { forwardRef as forwardRef31 } from "@polymorphic-factory/react";
|
|
782
|
+
import { mergeProps as mergeProps29 } from "@zag-js/react";
|
|
783
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
784
|
+
var PaginationNextItem = forwardRef31((props, ref) => {
|
|
785
|
+
const { nextItemProps } = usePaginationContext();
|
|
786
|
+
const mergedProps = mergeProps29(nextItemProps, props);
|
|
787
|
+
return /* @__PURE__ */ jsx34(atlas.a, {
|
|
788
|
+
href: "#next",
|
|
789
|
+
...mergedProps,
|
|
790
|
+
ref
|
|
791
|
+
});
|
|
792
|
+
});
|
|
793
|
+
|
|
794
|
+
// src/pagination/pagination-prev-item.tsx
|
|
795
|
+
import { forwardRef as forwardRef32 } from "@polymorphic-factory/react";
|
|
796
|
+
import { mergeProps as mergeProps30 } from "@zag-js/react";
|
|
797
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
798
|
+
var PaginationPrevItem = forwardRef32((props, ref) => {
|
|
799
|
+
const { prevItemProps } = usePaginationContext();
|
|
800
|
+
const mergedProps = mergeProps30(prevItemProps, props);
|
|
801
|
+
return /* @__PURE__ */ jsx35(atlas.a, {
|
|
802
|
+
href: "#previous",
|
|
803
|
+
...mergedProps,
|
|
804
|
+
ref
|
|
805
|
+
});
|
|
806
|
+
});
|
|
807
|
+
|
|
808
|
+
// src/pin-input/pin-input.tsx
|
|
809
|
+
import { forwardRef as forwardRef33 } from "@polymorphic-factory/react";
|
|
810
|
+
import { mergeProps as mergeProps31 } from "@zag-js/react";
|
|
811
|
+
|
|
812
|
+
// src/pin-input/pin-input-context.ts
|
|
813
|
+
var [PinInputProvider, usePinInputContext] = createContext({
|
|
814
|
+
name: "PinInputContext",
|
|
815
|
+
hookName: "usePinInputContext",
|
|
816
|
+
providerName: "<PinInputProvider />"
|
|
817
|
+
});
|
|
818
|
+
|
|
819
|
+
// src/pin-input/use-pin-input.ts
|
|
820
|
+
import * as pinInput from "@zag-js/pin-input";
|
|
821
|
+
import { normalizeProps as normalizeProps7, useMachine as useMachine7 } from "@zag-js/react";
|
|
822
|
+
import { useId as useId7 } from "react";
|
|
823
|
+
var usePinInput = (props) => {
|
|
824
|
+
const initialContext = filterUndefinedEntries({
|
|
825
|
+
id: useId7(),
|
|
826
|
+
...props,
|
|
827
|
+
value: props.value ?? props.defaultValue ?? []
|
|
828
|
+
});
|
|
829
|
+
const context = filterUndefinedEntries({
|
|
830
|
+
...initialContext,
|
|
831
|
+
value: props.value
|
|
832
|
+
});
|
|
833
|
+
const [state, send] = useMachine7(pinInput.machine(initialContext), { context });
|
|
834
|
+
return pinInput.connect(state, send, normalizeProps7);
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
// src/pin-input/pin-input.tsx
|
|
838
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
839
|
+
var PinInput = forwardRef33((props, ref) => {
|
|
840
|
+
const [usePinInputProps, divProps] = splitProps(props, [
|
|
841
|
+
"autoFocus",
|
|
842
|
+
"blurOnComplete",
|
|
843
|
+
"defaultValue",
|
|
844
|
+
"dir",
|
|
845
|
+
"disabled",
|
|
846
|
+
"getRootNode",
|
|
847
|
+
"ids",
|
|
848
|
+
"invalid",
|
|
849
|
+
"mask",
|
|
850
|
+
"name",
|
|
851
|
+
"onChange",
|
|
852
|
+
"onComplete",
|
|
853
|
+
"onInvalid",
|
|
854
|
+
"otp",
|
|
855
|
+
"pattern",
|
|
856
|
+
"placeholder",
|
|
857
|
+
"translations",
|
|
858
|
+
"type",
|
|
859
|
+
"value"
|
|
860
|
+
]);
|
|
861
|
+
const pinInput2 = usePinInput(usePinInputProps);
|
|
862
|
+
const mergedProps = mergeProps31(pinInput2.rootProps, divProps);
|
|
863
|
+
return /* @__PURE__ */ jsx36(PinInputProvider, {
|
|
864
|
+
value: pinInput2,
|
|
865
|
+
children: /* @__PURE__ */ jsx36(atlas.div, {
|
|
866
|
+
...mergedProps,
|
|
867
|
+
ref
|
|
868
|
+
})
|
|
869
|
+
});
|
|
870
|
+
});
|
|
871
|
+
|
|
872
|
+
// src/pin-input/pin-input-field.tsx
|
|
873
|
+
import { forwardRef as forwardRef34 } from "@polymorphic-factory/react";
|
|
874
|
+
import { mergeProps as mergeProps32 } from "@zag-js/react";
|
|
875
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
876
|
+
var PinInputField = forwardRef34((props, ref) => {
|
|
877
|
+
const { index, ...inputProps } = props;
|
|
878
|
+
const { getInputProps } = usePinInputContext();
|
|
879
|
+
const mergedProps = mergeProps32(getInputProps({ index }), inputProps);
|
|
880
|
+
return /* @__PURE__ */ jsx37(atlas.input, {
|
|
881
|
+
...mergedProps,
|
|
882
|
+
ref
|
|
883
|
+
});
|
|
884
|
+
});
|
|
885
|
+
|
|
886
|
+
// src/popover/popover-context.ts
|
|
887
|
+
var [PopoverProvider, usePopoverContext] = createContext({
|
|
888
|
+
name: "PopoverContext",
|
|
889
|
+
hookName: "usePopoverContext",
|
|
890
|
+
providerName: "<PopoverProvider />"
|
|
891
|
+
});
|
|
892
|
+
|
|
893
|
+
// src/popover/use-popover.ts
|
|
894
|
+
import * as popover from "@zag-js/popover";
|
|
895
|
+
import { normalizeProps as normalizeProps8, useMachine as useMachine8 } from "@zag-js/react";
|
|
896
|
+
import { useId as useId8 } from "react";
|
|
897
|
+
var usePopover = (props) => {
|
|
898
|
+
const initialContext = filterUndefinedEntries({
|
|
899
|
+
id: useId8(),
|
|
900
|
+
...props
|
|
901
|
+
});
|
|
902
|
+
const [state, send] = useMachine8(popover.machine(initialContext), { context: initialContext });
|
|
903
|
+
return popover.connect(state, send, normalizeProps8);
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
// src/popover/popover.tsx
|
|
907
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
908
|
+
var Popover = (props) => {
|
|
909
|
+
const { children, ...usePopoverProps } = props;
|
|
910
|
+
const popover2 = usePopover(usePopoverProps);
|
|
911
|
+
return /* @__PURE__ */ jsx38(PopoverProvider, {
|
|
912
|
+
value: popover2,
|
|
913
|
+
children
|
|
914
|
+
});
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
// src/popover/popover-arrow.tsx
|
|
918
|
+
import { forwardRef as forwardRef35 } from "@polymorphic-factory/react";
|
|
919
|
+
import { mergeProps as mergeProps33 } from "@zag-js/react";
|
|
920
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
921
|
+
var PopoverArrow = forwardRef35((props, ref) => {
|
|
922
|
+
const { arrowProps } = usePopoverContext();
|
|
923
|
+
const mergedProps = mergeProps33(arrowProps, props);
|
|
924
|
+
return /* @__PURE__ */ jsx39(atlas.div, {
|
|
925
|
+
...mergedProps,
|
|
926
|
+
ref
|
|
927
|
+
});
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
// src/popover/popover-close-button.tsx
|
|
931
|
+
import { forwardRef as forwardRef36 } from "@polymorphic-factory/react";
|
|
932
|
+
import { mergeProps as mergeProps34 } from "@zag-js/react";
|
|
933
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
934
|
+
var PopoverCloseButton = forwardRef36((props, ref) => {
|
|
935
|
+
const { closeButtonProps } = usePopoverContext();
|
|
936
|
+
const mergedProps = mergeProps34(closeButtonProps, props);
|
|
937
|
+
return /* @__PURE__ */ jsx40(atlas.button, {
|
|
938
|
+
...mergedProps,
|
|
939
|
+
ref
|
|
940
|
+
});
|
|
941
|
+
});
|
|
942
|
+
|
|
943
|
+
// src/popover/popover-content.tsx
|
|
944
|
+
import { forwardRef as forwardRef37 } from "@polymorphic-factory/react";
|
|
945
|
+
import { mergeProps as mergeProps35 } from "@zag-js/react";
|
|
946
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
947
|
+
var PopoverContent = forwardRef37((props, ref) => {
|
|
948
|
+
const { contentProps } = usePopoverContext();
|
|
949
|
+
const mergedProps = mergeProps35(contentProps, props);
|
|
950
|
+
return /* @__PURE__ */ jsx41(atlas.div, {
|
|
951
|
+
...mergedProps,
|
|
952
|
+
ref
|
|
953
|
+
});
|
|
954
|
+
});
|
|
955
|
+
|
|
956
|
+
// src/popover/popover-description.tsx
|
|
957
|
+
import { forwardRef as forwardRef38 } from "@polymorphic-factory/react";
|
|
958
|
+
import { mergeProps as mergeProps36 } from "@zag-js/react";
|
|
959
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
960
|
+
var PopoverDescription = forwardRef38((props, ref) => {
|
|
961
|
+
const { descriptionProps } = usePopoverContext();
|
|
962
|
+
const mergedProps = mergeProps36(descriptionProps, props);
|
|
963
|
+
return /* @__PURE__ */ jsx42(atlas.div, {
|
|
964
|
+
...mergedProps,
|
|
965
|
+
ref
|
|
966
|
+
});
|
|
967
|
+
});
|
|
968
|
+
|
|
969
|
+
// src/popover/popover-inner-arrow.tsx
|
|
970
|
+
import { forwardRef as forwardRef39 } from "@polymorphic-factory/react";
|
|
971
|
+
import { mergeProps as mergeProps37 } from "@zag-js/react";
|
|
972
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
973
|
+
var PopoverInnerArrow = forwardRef39((props, ref) => {
|
|
974
|
+
const { innerArrowProps } = usePopoverContext();
|
|
975
|
+
const mergedProps = mergeProps37(innerArrowProps, props);
|
|
976
|
+
return /* @__PURE__ */ jsx43(atlas.div, {
|
|
977
|
+
...mergedProps,
|
|
978
|
+
ref
|
|
979
|
+
});
|
|
980
|
+
});
|
|
981
|
+
|
|
982
|
+
// src/popover/popover-positioner.tsx
|
|
983
|
+
import { forwardRef as forwardRef40 } from "@polymorphic-factory/react";
|
|
984
|
+
import { mergeProps as mergeProps38 } from "@zag-js/react";
|
|
985
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
986
|
+
var PopoverPositioner = forwardRef40((props, ref) => {
|
|
987
|
+
const { positionerProps } = usePopoverContext();
|
|
988
|
+
const mergedProps = mergeProps38(positionerProps, props);
|
|
989
|
+
return /* @__PURE__ */ jsx44(atlas.div, {
|
|
990
|
+
...mergedProps,
|
|
991
|
+
ref
|
|
992
|
+
});
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
// src/popover/popover-title.tsx
|
|
996
|
+
import { forwardRef as forwardRef41 } from "@polymorphic-factory/react";
|
|
997
|
+
import { mergeProps as mergeProps39 } from "@zag-js/react";
|
|
998
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
999
|
+
var PopoverTitle = forwardRef41((props, ref) => {
|
|
1000
|
+
const { titleProps } = usePopoverContext();
|
|
1001
|
+
const mergedProps = mergeProps39(titleProps, props);
|
|
1002
|
+
return /* @__PURE__ */ jsx45(atlas.div, {
|
|
1003
|
+
...mergedProps,
|
|
1004
|
+
ref
|
|
1005
|
+
});
|
|
1006
|
+
});
|
|
1007
|
+
|
|
1008
|
+
// src/popover/popover-trigger.tsx
|
|
1009
|
+
import { cloneElement as cloneElement2 } from "react";
|
|
1010
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
1011
|
+
var PopoverTrigger = (props) => {
|
|
1012
|
+
const { children } = props;
|
|
1013
|
+
const { triggerProps } = usePopoverContext();
|
|
1014
|
+
return typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx46(atlas.span, {
|
|
1015
|
+
...triggerProps,
|
|
1016
|
+
children
|
|
1017
|
+
}) : cloneElement2(children, triggerProps);
|
|
1018
|
+
};
|
|
1019
|
+
|
|
1020
|
+
// src/pressable/pressable.tsx
|
|
1021
|
+
import { forwardRef as forwardRef42 } from "@polymorphic-factory/react";
|
|
1022
|
+
import { mergeProps as mergeProps40 } from "@zag-js/react";
|
|
1023
|
+
|
|
1024
|
+
// src/pressable/use-pressable.tsx
|
|
1025
|
+
import * as pressable from "@zag-js/pressable";
|
|
1026
|
+
import { normalizeProps as normalizeProps9, useMachine as useMachine9 } from "@zag-js/react";
|
|
1027
|
+
import { useId as useId9 } from "react";
|
|
1028
|
+
var usePressable = (props) => {
|
|
1029
|
+
const initialContext = filterUndefinedEntries({
|
|
1030
|
+
id: useId9(),
|
|
1031
|
+
...props
|
|
1032
|
+
});
|
|
1033
|
+
const [state, send] = useMachine9(pressable.machine(initialContext), { context: initialContext });
|
|
1034
|
+
return pressable.connect(state, send, normalizeProps9);
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1037
|
+
// src/pressable/pressable.tsx
|
|
1038
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
1039
|
+
var Pressable = forwardRef42((props, ref) => {
|
|
1040
|
+
const [usePressableProps, divProps] = splitProps(props, [
|
|
1041
|
+
"allowTextSelectionOnPress",
|
|
1042
|
+
"cancelOnPointerExit",
|
|
1043
|
+
"dir",
|
|
1044
|
+
"disabled",
|
|
1045
|
+
"getRootNode",
|
|
1046
|
+
"onLongPress",
|
|
1047
|
+
"onPress",
|
|
1048
|
+
"onPressEnd",
|
|
1049
|
+
"onPressStart",
|
|
1050
|
+
"onPressUp",
|
|
1051
|
+
"preventFocusOnPress"
|
|
1052
|
+
]);
|
|
1053
|
+
const { pressableProps } = usePressable(usePressableProps);
|
|
1054
|
+
const mergedProps = mergeProps40(pressableProps, divProps);
|
|
1055
|
+
return /* @__PURE__ */ jsx47(atlas.button, {
|
|
1056
|
+
...mergedProps,
|
|
1057
|
+
ref
|
|
1058
|
+
});
|
|
1059
|
+
});
|
|
1060
|
+
|
|
1061
|
+
// src/radio-group/radio.tsx
|
|
1062
|
+
import { forwardRef as forwardRef43 } from "@polymorphic-factory/react";
|
|
1063
|
+
import { mergeProps as mergeProps41 } from "@zag-js/react";
|
|
1064
|
+
|
|
1065
|
+
// src/radio-group/radio-context.ts
|
|
1066
|
+
var [RadioProvider, useRadioContext] = createContext({
|
|
1067
|
+
name: "RadioContext",
|
|
1068
|
+
hookName: "useRadioContext",
|
|
1069
|
+
providerName: "<RadioProvider />"
|
|
1070
|
+
});
|
|
1071
|
+
|
|
1072
|
+
// src/radio-group/radio-group-context.ts
|
|
1073
|
+
var [RadioGroupProvider, useRadioGroupContext] = createContext({
|
|
1074
|
+
name: "RadioGroupContext",
|
|
1075
|
+
hookName: "useRadioGroupContext",
|
|
1076
|
+
providerName: "<RadioGroupProvider />"
|
|
1077
|
+
});
|
|
1078
|
+
|
|
1079
|
+
// src/radio-group/radio.tsx
|
|
1080
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
1081
|
+
var Radio = forwardRef43((props, ref) => {
|
|
1082
|
+
const { value, disabled, invalid, readonly, ...divProps } = props;
|
|
1083
|
+
const { getItemProps } = useRadioGroupContext();
|
|
1084
|
+
const mergedProps = mergeProps41(getItemProps({ value, disabled }), divProps);
|
|
1085
|
+
return /* @__PURE__ */ jsx48(RadioProvider, {
|
|
1086
|
+
value: { value, disabled, invalid, readonly },
|
|
1087
|
+
children: /* @__PURE__ */ jsx48(atlas.label, {
|
|
1088
|
+
...mergedProps,
|
|
1089
|
+
ref
|
|
1090
|
+
})
|
|
1091
|
+
});
|
|
1092
|
+
});
|
|
1093
|
+
|
|
1094
|
+
// src/radio-group/radio-control.tsx
|
|
1095
|
+
import { forwardRef as forwardRef44 } from "@polymorphic-factory/react";
|
|
1096
|
+
import { mergeProps as mergeProps42 } from "@zag-js/react";
|
|
1097
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
1098
|
+
var RadioControl = forwardRef44((props, ref) => {
|
|
1099
|
+
const { getItemControlProps } = useRadioGroupContext();
|
|
1100
|
+
const context = useRadioContext();
|
|
1101
|
+
const mergedProps = mergeProps42(getItemControlProps(context), props);
|
|
1102
|
+
return /* @__PURE__ */ jsx49(atlas.div, {
|
|
1103
|
+
...mergedProps,
|
|
1104
|
+
ref
|
|
1105
|
+
});
|
|
1106
|
+
});
|
|
1107
|
+
|
|
1108
|
+
// src/radio-group/radio-group.tsx
|
|
1109
|
+
import { forwardRef as forwardRef45 } from "@polymorphic-factory/react";
|
|
1110
|
+
import { mergeProps as mergeProps43 } from "@zag-js/react";
|
|
1111
|
+
|
|
1112
|
+
// src/radio-group/use-radio-group.tsx
|
|
1113
|
+
import * as radio from "@zag-js/radio";
|
|
1114
|
+
import { normalizeProps as normalizeProps10, useMachine as useMachine10 } from "@zag-js/react";
|
|
1115
|
+
import { useId as useId10 } from "react";
|
|
1116
|
+
var useRadioGroup = (props) => {
|
|
1117
|
+
const initialContext = filterUndefinedEntries({
|
|
1118
|
+
id: useId10(),
|
|
1119
|
+
...props,
|
|
1120
|
+
value: props.value ?? props.defaultValue
|
|
1121
|
+
});
|
|
1122
|
+
const context = filterUndefinedEntries({
|
|
1123
|
+
...initialContext,
|
|
1124
|
+
value: props.value
|
|
1125
|
+
});
|
|
1126
|
+
const [state, send] = useMachine10(radio.machine(initialContext), {
|
|
1127
|
+
context
|
|
1128
|
+
});
|
|
1129
|
+
return radio.connect(state, send, normalizeProps10);
|
|
1130
|
+
};
|
|
1131
|
+
|
|
1132
|
+
// src/radio-group/radio-group.tsx
|
|
1133
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
1134
|
+
var RadioGroup = forwardRef45((props, ref) => {
|
|
1135
|
+
const [useRadioGroupProps, divProps] = splitProps(props, [
|
|
1136
|
+
"defaultValue",
|
|
1137
|
+
"dir",
|
|
1138
|
+
"disabled",
|
|
1139
|
+
"getRootNode",
|
|
1140
|
+
"ids",
|
|
1141
|
+
"name",
|
|
1142
|
+
"onChange",
|
|
1143
|
+
"orientation",
|
|
1144
|
+
"readonly",
|
|
1145
|
+
"value"
|
|
1146
|
+
]);
|
|
1147
|
+
const radioGroup = useRadioGroup(useRadioGroupProps);
|
|
1148
|
+
const mergedProps = mergeProps43(radioGroup.rootProps, divProps);
|
|
1149
|
+
return /* @__PURE__ */ jsx50(RadioGroupProvider, {
|
|
1150
|
+
value: radioGroup,
|
|
1151
|
+
children: /* @__PURE__ */ jsx50(atlas.div, {
|
|
1152
|
+
...mergedProps,
|
|
1153
|
+
ref
|
|
1154
|
+
})
|
|
1155
|
+
});
|
|
1156
|
+
});
|
|
1157
|
+
|
|
1158
|
+
// src/radio-group/radio-group-label.tsx
|
|
1159
|
+
import { forwardRef as forwardRef46 } from "@polymorphic-factory/react";
|
|
1160
|
+
import { mergeProps as mergeProps44 } from "@zag-js/react";
|
|
1161
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
1162
|
+
var RadioGroupLabel = forwardRef46((props, ref) => {
|
|
1163
|
+
const { labelProps } = useRadioGroupContext();
|
|
1164
|
+
const mergedProps = mergeProps44(labelProps, props);
|
|
1165
|
+
return /* @__PURE__ */ jsx51(atlas.label, {
|
|
1166
|
+
...mergedProps,
|
|
1167
|
+
ref
|
|
1168
|
+
});
|
|
1169
|
+
});
|
|
1170
|
+
|
|
1171
|
+
// src/radio-group/radio-input.tsx
|
|
1172
|
+
import { forwardRef as forwardRef47 } from "@polymorphic-factory/react";
|
|
1173
|
+
import { mergeProps as mergeProps45 } from "@zag-js/react";
|
|
1174
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
1175
|
+
var RadioInput = forwardRef47((props, ref) => {
|
|
1176
|
+
const { getItemInputProps } = useRadioGroupContext();
|
|
1177
|
+
const context = useRadioContext();
|
|
1178
|
+
const mergedProps = mergeProps45(getItemInputProps(context), props);
|
|
1179
|
+
return /* @__PURE__ */ jsx52(atlas.input, {
|
|
1180
|
+
...mergedProps,
|
|
1181
|
+
ref
|
|
1182
|
+
});
|
|
1183
|
+
});
|
|
1184
|
+
|
|
1185
|
+
// src/radio-group/radio-label.tsx
|
|
1186
|
+
import { forwardRef as forwardRef48 } from "@polymorphic-factory/react";
|
|
1187
|
+
import { mergeProps as mergeProps46 } from "@zag-js/react";
|
|
1188
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
1189
|
+
var RadioLabel = forwardRef48((props, ref) => {
|
|
1190
|
+
const { getItemLabelProps } = useRadioGroupContext();
|
|
1191
|
+
const context = useRadioContext();
|
|
1192
|
+
const mergedProps = mergeProps46(getItemLabelProps(context), props);
|
|
1193
|
+
return /* @__PURE__ */ jsx53(atlas.span, {
|
|
1194
|
+
...mergedProps,
|
|
1195
|
+
ref
|
|
1196
|
+
});
|
|
1197
|
+
});
|
|
1198
|
+
|
|
1199
|
+
// src/rating/rating.tsx
|
|
1200
|
+
import { forwardRef as forwardRef49 } from "@polymorphic-factory/react";
|
|
1201
|
+
import { mergeProps as mergeProps47 } from "@zag-js/react";
|
|
1202
|
+
|
|
1203
|
+
// src/rating/rating-context.ts
|
|
1204
|
+
var [RatingProvider, useRatingContext] = createContext({
|
|
1205
|
+
name: "RatingContext",
|
|
1206
|
+
hookName: "useRatingContext",
|
|
1207
|
+
providerName: "<RatingProvider />"
|
|
1208
|
+
});
|
|
1209
|
+
|
|
1210
|
+
// src/rating/use-rating.tsx
|
|
1211
|
+
import * as rating from "@zag-js/rating";
|
|
1212
|
+
import { normalizeProps as normalizeProps11, useMachine as useMachine11 } from "@zag-js/react";
|
|
1213
|
+
import { useId as useId11 } from "react";
|
|
1214
|
+
var useRating = (props) => {
|
|
1215
|
+
const initialContext = filterUndefinedEntries({
|
|
1216
|
+
id: useId11(),
|
|
1217
|
+
...props,
|
|
1218
|
+
value: props.value ?? props.defaultValue
|
|
1219
|
+
});
|
|
1220
|
+
const context = filterUndefinedEntries({
|
|
1221
|
+
...initialContext,
|
|
1222
|
+
value: props.value
|
|
1223
|
+
});
|
|
1224
|
+
const [state, send] = useMachine11(rating.machine(initialContext), {
|
|
1225
|
+
context
|
|
1226
|
+
});
|
|
1227
|
+
return rating.connect(state, send, normalizeProps11);
|
|
1228
|
+
};
|
|
1229
|
+
|
|
1230
|
+
// src/rating/rating.tsx
|
|
1231
|
+
import { jsx as jsx54, jsxs } from "react/jsx-runtime";
|
|
1232
|
+
var Rating = forwardRef49((props, ref) => {
|
|
1233
|
+
const [useRatingProps, divProps] = splitProps(props, [
|
|
1234
|
+
"allowHalf",
|
|
1235
|
+
"autoFocus",
|
|
1236
|
+
"defaultValue",
|
|
1237
|
+
"dir",
|
|
1238
|
+
"disabled",
|
|
1239
|
+
"getRootNode",
|
|
1240
|
+
"ids",
|
|
1241
|
+
"max",
|
|
1242
|
+
"name",
|
|
1243
|
+
"onChange",
|
|
1244
|
+
"onHover",
|
|
1245
|
+
"readonly",
|
|
1246
|
+
"translations",
|
|
1247
|
+
"value"
|
|
1248
|
+
]);
|
|
1249
|
+
const rating2 = useRating(useRatingProps);
|
|
1250
|
+
const mergedProps = mergeProps47(rating2.rootProps, divProps);
|
|
1251
|
+
return /* @__PURE__ */ jsx54(RatingProvider, {
|
|
1252
|
+
value: rating2,
|
|
1253
|
+
children: /* @__PURE__ */ jsxs(atlas.div, {
|
|
1254
|
+
...mergedProps,
|
|
1255
|
+
children: [
|
|
1256
|
+
props.children,
|
|
1257
|
+
/* @__PURE__ */ jsx54(atlas.input, {
|
|
1258
|
+
...rating2.inputProps,
|
|
1259
|
+
ref
|
|
1260
|
+
})
|
|
1261
|
+
]
|
|
1262
|
+
})
|
|
1263
|
+
});
|
|
1264
|
+
});
|
|
1265
|
+
|
|
1266
|
+
// src/rating/rating-group.tsx
|
|
1267
|
+
import { forwardRef as forwardRef50 } from "@polymorphic-factory/react";
|
|
1268
|
+
import { mergeProps as mergeProps48 } from "@zag-js/react";
|
|
1269
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
1270
|
+
var RatingGroup = forwardRef50((props, ref) => {
|
|
1271
|
+
const { children, ...divProps } = props;
|
|
1272
|
+
const api = useRatingContext();
|
|
1273
|
+
const renderPropResult = typeof children === "function" ? children(api) : children;
|
|
1274
|
+
const mergedProps = mergeProps48(api.itemGroupProps, divProps);
|
|
1275
|
+
return /* @__PURE__ */ jsx55(atlas.div, {
|
|
1276
|
+
...mergedProps,
|
|
1277
|
+
ref,
|
|
1278
|
+
children: renderPropResult
|
|
1279
|
+
});
|
|
1280
|
+
});
|
|
1281
|
+
|
|
1282
|
+
// src/rating/rating-item.tsx
|
|
1283
|
+
import { forwardRef as forwardRef51 } from "@polymorphic-factory/react";
|
|
1284
|
+
import { mergeProps as mergeProps49 } from "@zag-js/react";
|
|
1285
|
+
|
|
1286
|
+
// src/rating/rating-item-context.ts
|
|
1287
|
+
var [RatingItemProvider, useRatingItemContext] = createContext({
|
|
1288
|
+
name: "RatingItemContext",
|
|
1289
|
+
hookName: "useRatingItemContext",
|
|
1290
|
+
providerName: "<RatingItemProvider />"
|
|
1291
|
+
});
|
|
1292
|
+
|
|
1293
|
+
// src/rating/rating-item.tsx
|
|
1294
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
1295
|
+
var RatingItem = forwardRef51((props, ref) => {
|
|
1296
|
+
const { children, index, ...divProps } = props;
|
|
1297
|
+
const { getRatingState, getItemProps } = useRatingContext();
|
|
1298
|
+
const state = getRatingState(index);
|
|
1299
|
+
const icon = typeof children === "function" ? children(state) : children;
|
|
1300
|
+
const mergedProps = mergeProps49(getItemProps({ index }), divProps);
|
|
1301
|
+
return /* @__PURE__ */ jsx56(atlas.span, {
|
|
1302
|
+
...mergedProps,
|
|
1303
|
+
ref,
|
|
1304
|
+
children: /* @__PURE__ */ jsx56(RatingItemProvider, {
|
|
1305
|
+
value: state,
|
|
1306
|
+
children: icon
|
|
1307
|
+
})
|
|
1308
|
+
});
|
|
1309
|
+
});
|
|
1310
|
+
|
|
1311
|
+
// src/rating/rating-label.tsx
|
|
1312
|
+
import { forwardRef as forwardRef52 } from "@polymorphic-factory/react";
|
|
1313
|
+
import { mergeProps as mergeProps50 } from "@zag-js/react";
|
|
1314
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
1315
|
+
var RatingLabel = forwardRef52((props, ref) => {
|
|
1316
|
+
const { labelProps } = useRatingContext();
|
|
1317
|
+
const mergedProps = mergeProps50(labelProps, props);
|
|
1318
|
+
return /* @__PURE__ */ jsx57(atlas.label, {
|
|
1319
|
+
...mergedProps,
|
|
1320
|
+
ref
|
|
1321
|
+
});
|
|
1322
|
+
});
|
|
1323
|
+
|
|
1324
|
+
// src/tabs/tab.tsx
|
|
1325
|
+
import { forwardRef as forwardRef53 } from "@polymorphic-factory/react";
|
|
1326
|
+
import { mergeProps as mergeProps51 } from "@zag-js/react";
|
|
1327
|
+
|
|
1328
|
+
// src/tabs/tabs-context.ts
|
|
1329
|
+
var [TabsProvider, useTabsContext] = createContext({
|
|
1330
|
+
name: "TabsContext",
|
|
1331
|
+
hookName: "useTabsContext",
|
|
1332
|
+
providerName: "<TabsProvider />"
|
|
1333
|
+
});
|
|
1334
|
+
|
|
1335
|
+
// src/tabs/tab.tsx
|
|
1336
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
1337
|
+
var Tab = forwardRef53((props, ref) => {
|
|
1338
|
+
const [tabProps, buttonProps] = splitProps(props, ["disabled", "value"]);
|
|
1339
|
+
const { getTriggerProps } = useTabsContext();
|
|
1340
|
+
const mergedProps = mergeProps51(getTriggerProps(tabProps), buttonProps);
|
|
1341
|
+
return /* @__PURE__ */ jsx58(atlas.button, {
|
|
1342
|
+
...mergedProps,
|
|
1343
|
+
ref
|
|
1344
|
+
});
|
|
1345
|
+
});
|
|
1346
|
+
|
|
1347
|
+
// src/tabs/tab-indicator.tsx
|
|
1348
|
+
import { forwardRef as forwardRef54 } from "@polymorphic-factory/react";
|
|
1349
|
+
import { mergeProps as mergeProps52 } from "@zag-js/react";
|
|
1350
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
1351
|
+
var TabIndicator = forwardRef54((props, ref) => {
|
|
1352
|
+
const { indicatorProps } = useTabsContext();
|
|
1353
|
+
const mergedProps = mergeProps52(indicatorProps, props);
|
|
1354
|
+
return /* @__PURE__ */ jsx59(atlas.div, {
|
|
1355
|
+
...mergedProps,
|
|
1356
|
+
ref
|
|
1357
|
+
});
|
|
1358
|
+
});
|
|
1359
|
+
|
|
1360
|
+
// src/tabs/tab-list.tsx
|
|
1361
|
+
import { forwardRef as forwardRef55 } from "@polymorphic-factory/react";
|
|
1362
|
+
import { mergeProps as mergeProps53 } from "@zag-js/react";
|
|
1363
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
1364
|
+
var TabList = forwardRef55((props, ref) => {
|
|
1365
|
+
const { triggerGroupProps } = useTabsContext();
|
|
1366
|
+
const mergedProps = mergeProps53(triggerGroupProps, props);
|
|
1367
|
+
return /* @__PURE__ */ jsx60(atlas.div, {
|
|
1368
|
+
...mergedProps,
|
|
1369
|
+
ref
|
|
1370
|
+
});
|
|
1371
|
+
});
|
|
1372
|
+
|
|
1373
|
+
// src/tabs/tab-panel.tsx
|
|
1374
|
+
import { forwardRef as forwardRef56 } from "@polymorphic-factory/react";
|
|
1375
|
+
import { mergeProps as mergeProps54 } from "@zag-js/react";
|
|
1376
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
1377
|
+
var TabPanel = forwardRef56((props, ref) => {
|
|
1378
|
+
const [tabContentProps, divProps] = splitProps(props, ["value"]);
|
|
1379
|
+
const { getContentProps } = useTabsContext();
|
|
1380
|
+
const mergedProps = mergeProps54(getContentProps(tabContentProps), divProps);
|
|
1381
|
+
return /* @__PURE__ */ jsx61(atlas.div, {
|
|
1382
|
+
...mergedProps,
|
|
1383
|
+
ref
|
|
1384
|
+
});
|
|
1385
|
+
});
|
|
1386
|
+
|
|
1387
|
+
// src/tabs/tab-panels.tsx
|
|
1388
|
+
import { forwardRef as forwardRef57 } from "@polymorphic-factory/react";
|
|
1389
|
+
import { mergeProps as mergeProps55 } from "@zag-js/react";
|
|
1390
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
1391
|
+
var TabPanels = forwardRef57((props, ref) => {
|
|
1392
|
+
const { contentGroupProps } = useTabsContext();
|
|
1393
|
+
const mergedProps = mergeProps55(contentGroupProps, props);
|
|
1394
|
+
return /* @__PURE__ */ jsx62(atlas.div, {
|
|
1395
|
+
...mergedProps,
|
|
1396
|
+
ref
|
|
1397
|
+
});
|
|
1398
|
+
});
|
|
1399
|
+
|
|
1400
|
+
// src/tabs/tabs.tsx
|
|
1401
|
+
import { forwardRef as forwardRef58 } from "@polymorphic-factory/react";
|
|
1402
|
+
import { mergeProps as mergeProps56 } from "@zag-js/react";
|
|
1403
|
+
|
|
1404
|
+
// src/tabs/use-tabs.ts
|
|
1405
|
+
import { normalizeProps as normalizeProps12, useMachine as useMachine12 } from "@zag-js/react";
|
|
1406
|
+
import * as tabs from "@zag-js/tabs";
|
|
1407
|
+
import { useId as useId12 } from "react";
|
|
1408
|
+
var useTabs = (props) => {
|
|
1409
|
+
const context = { id: useId12(), ...filterUndefinedEntries(props) };
|
|
1410
|
+
const [state, send] = useMachine12(tabs.machine(context), { context });
|
|
1411
|
+
return tabs.connect(state, send, normalizeProps12);
|
|
1412
|
+
};
|
|
1413
|
+
|
|
1414
|
+
// src/tabs/tabs.tsx
|
|
1415
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
1416
|
+
var Tabs = forwardRef58((props, ref) => {
|
|
1417
|
+
const [useTabsProps, divProps] = splitProps(props, [
|
|
1418
|
+
"activationMode",
|
|
1419
|
+
"dir",
|
|
1420
|
+
"getRootNode",
|
|
1421
|
+
"ids",
|
|
1422
|
+
"isIndicatorRendered",
|
|
1423
|
+
"loop",
|
|
1424
|
+
"onChange",
|
|
1425
|
+
"onDelete",
|
|
1426
|
+
"onFocus",
|
|
1427
|
+
"orientation",
|
|
1428
|
+
"translations",
|
|
1429
|
+
"value"
|
|
1430
|
+
]);
|
|
1431
|
+
const tabs2 = useTabs(useTabsProps);
|
|
1432
|
+
const mergedProps = mergeProps56(tabs2.rootProps, divProps);
|
|
1433
|
+
return /* @__PURE__ */ jsx63(TabsProvider, {
|
|
1434
|
+
value: tabs2,
|
|
1435
|
+
children: /* @__PURE__ */ jsx63(atlas.div, {
|
|
1436
|
+
...mergedProps,
|
|
1437
|
+
ref
|
|
1438
|
+
})
|
|
1439
|
+
});
|
|
1440
|
+
});
|
|
1441
|
+
|
|
1442
|
+
// src/tooltip/tooltip-context.tsx
|
|
1443
|
+
var [TooltipProvider, useTooltipContext] = createContext({
|
|
1444
|
+
name: "TooltipContext",
|
|
1445
|
+
hookName: "useTooltipContext",
|
|
1446
|
+
providerName: "<TooltipProvider />"
|
|
1447
|
+
});
|
|
1448
|
+
|
|
1449
|
+
// src/tooltip/use-tooltip.ts
|
|
1450
|
+
import { normalizeProps as normalizeProps13, useMachine as useMachine13 } from "@zag-js/react";
|
|
1451
|
+
import * as tooltip from "@zag-js/tooltip";
|
|
1452
|
+
import { useId as useId13 } from "react";
|
|
1453
|
+
var useTooltip = (props) => {
|
|
1454
|
+
const initialContext = filterUndefinedEntries({
|
|
1455
|
+
id: useId13(),
|
|
1456
|
+
...props
|
|
1457
|
+
});
|
|
1458
|
+
const [state, send] = useMachine13(tooltip.machine(initialContext), { context: initialContext });
|
|
1459
|
+
return tooltip.connect(state, send, normalizeProps13);
|
|
1460
|
+
};
|
|
1461
|
+
|
|
1462
|
+
// src/tooltip/tooltip.tsx
|
|
1463
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
1464
|
+
var Tooltip = (props) => {
|
|
1465
|
+
const { children, ...useTooltipProps } = props;
|
|
1466
|
+
const tooltip2 = useTooltip(useTooltipProps);
|
|
1467
|
+
return /* @__PURE__ */ jsx64(TooltipProvider, {
|
|
1468
|
+
value: tooltip2,
|
|
1469
|
+
children
|
|
1470
|
+
});
|
|
1471
|
+
};
|
|
1472
|
+
|
|
1473
|
+
// src/tooltip/tooltip-arrow.tsx
|
|
1474
|
+
import { forwardRef as forwardRef59 } from "@polymorphic-factory/react";
|
|
1475
|
+
import { mergeProps as mergeProps57 } from "@zag-js/react";
|
|
1476
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
1477
|
+
var TooltipArrow = forwardRef59((props, ref) => {
|
|
1478
|
+
const { arrowProps } = useTooltipContext();
|
|
1479
|
+
const mergedProps = mergeProps57(arrowProps, props);
|
|
1480
|
+
return /* @__PURE__ */ jsx65(atlas.div, {
|
|
1481
|
+
...mergedProps,
|
|
1482
|
+
ref
|
|
1483
|
+
});
|
|
1484
|
+
});
|
|
1485
|
+
|
|
1486
|
+
// src/tooltip/tooltip-content.tsx
|
|
1487
|
+
import { forwardRef as forwardRef60 } from "@polymorphic-factory/react";
|
|
1488
|
+
import { mergeProps as mergeProps58 } from "@zag-js/react";
|
|
1489
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
1490
|
+
var TooltipContent = forwardRef60((props, ref) => {
|
|
1491
|
+
const { contentProps } = useTooltipContext();
|
|
1492
|
+
const mergedProps = mergeProps58(contentProps, props);
|
|
1493
|
+
return /* @__PURE__ */ jsx66(atlas.div, {
|
|
1494
|
+
...mergedProps,
|
|
1495
|
+
ref
|
|
1496
|
+
});
|
|
1497
|
+
});
|
|
1498
|
+
|
|
1499
|
+
// src/tooltip/tooltip-inner-arrow.tsx
|
|
1500
|
+
import { forwardRef as forwardRef61 } from "@polymorphic-factory/react";
|
|
1501
|
+
import { mergeProps as mergeProps59 } from "@zag-js/react";
|
|
1502
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
1503
|
+
var TooltipInnerArrow = forwardRef61((props, ref) => {
|
|
1504
|
+
const { innerArrowProps } = useTooltipContext();
|
|
1505
|
+
const mergedProps = mergeProps59(innerArrowProps, props);
|
|
1506
|
+
return /* @__PURE__ */ jsx67(atlas.div, {
|
|
1507
|
+
...mergedProps,
|
|
1508
|
+
ref
|
|
1509
|
+
});
|
|
1510
|
+
});
|
|
1511
|
+
|
|
1512
|
+
// src/tooltip/tooltip-positioner.tsx
|
|
1513
|
+
import { forwardRef as forwardRef62 } from "@polymorphic-factory/react";
|
|
1514
|
+
import { mergeProps as mergeProps60 } from "@zag-js/react";
|
|
1515
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
1516
|
+
var TooltipPositioner = forwardRef62((props, ref) => {
|
|
1517
|
+
const { positionerProps, isOpen } = useTooltipContext();
|
|
1518
|
+
const mergedProps = mergeProps60(positionerProps, props);
|
|
1519
|
+
return isOpen ? /* @__PURE__ */ jsx68(atlas.div, {
|
|
1520
|
+
...mergedProps,
|
|
1521
|
+
ref
|
|
1522
|
+
}) : null;
|
|
1523
|
+
});
|
|
1524
|
+
|
|
1525
|
+
// src/tooltip/tooltip-trigger.tsx
|
|
1526
|
+
import { cloneElement as cloneElement3 } from "react";
|
|
1527
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
1528
|
+
var TooltipTrigger = (props) => {
|
|
1529
|
+
const { children } = props;
|
|
1530
|
+
const { triggerProps } = useTooltipContext();
|
|
1531
|
+
return typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx69(atlas.span, {
|
|
1532
|
+
...triggerProps,
|
|
1533
|
+
children
|
|
1534
|
+
}) : cloneElement3(children, triggerProps);
|
|
1535
|
+
};
|
|
1536
|
+
export {
|
|
1537
|
+
Accordion,
|
|
1538
|
+
AccordionButton,
|
|
1539
|
+
AccordionIcon,
|
|
1540
|
+
AccordionItem,
|
|
1541
|
+
AccordionPanel,
|
|
1542
|
+
Checkbox,
|
|
1543
|
+
CheckboxControl,
|
|
1544
|
+
CheckboxInput,
|
|
1545
|
+
CheckboxLabel,
|
|
1546
|
+
Dialog,
|
|
1547
|
+
DialogBackdrop,
|
|
1548
|
+
DialogCloseButton,
|
|
1549
|
+
DialogContent,
|
|
1550
|
+
DialogDescription,
|
|
1551
|
+
DialogPortal,
|
|
1552
|
+
DialogTitle,
|
|
1553
|
+
DialogTrigger,
|
|
1554
|
+
DialogUnderlay,
|
|
1555
|
+
Editable,
|
|
1556
|
+
EditableArea,
|
|
1557
|
+
EditableCancelButton,
|
|
1558
|
+
EditableControls,
|
|
1559
|
+
EditableEditButton,
|
|
1560
|
+
EditableInput,
|
|
1561
|
+
EditablePreview,
|
|
1562
|
+
EditableSubmitButton,
|
|
1563
|
+
NumberInput,
|
|
1564
|
+
NumberInputDecrementButton,
|
|
1565
|
+
NumberInputField,
|
|
1566
|
+
NumberInputIncrementButton,
|
|
1567
|
+
Pagination,
|
|
1568
|
+
PaginationEllipsis,
|
|
1569
|
+
PaginationItem,
|
|
1570
|
+
PaginationNextItem,
|
|
1571
|
+
PaginationPrevItem,
|
|
1572
|
+
PaginationProvider,
|
|
1573
|
+
PinInput,
|
|
1574
|
+
PinInputField,
|
|
1575
|
+
Popover,
|
|
1576
|
+
PopoverArrow,
|
|
1577
|
+
PopoverCloseButton,
|
|
1578
|
+
PopoverContent,
|
|
1579
|
+
PopoverDescription,
|
|
1580
|
+
PopoverInnerArrow,
|
|
1581
|
+
PopoverPositioner,
|
|
1582
|
+
PopoverTitle,
|
|
1583
|
+
PopoverTrigger,
|
|
1584
|
+
Pressable,
|
|
1585
|
+
Radio,
|
|
1586
|
+
RadioControl,
|
|
1587
|
+
RadioGroup,
|
|
1588
|
+
RadioGroupLabel,
|
|
1589
|
+
RadioInput,
|
|
1590
|
+
RadioLabel,
|
|
1591
|
+
Rating,
|
|
1592
|
+
RatingGroup,
|
|
1593
|
+
RatingItem,
|
|
1594
|
+
RatingLabel,
|
|
1595
|
+
Tab,
|
|
1596
|
+
TabIndicator,
|
|
1597
|
+
TabList,
|
|
1598
|
+
TabPanel,
|
|
1599
|
+
TabPanels,
|
|
1600
|
+
Tabs,
|
|
1601
|
+
Tooltip,
|
|
1602
|
+
TooltipArrow,
|
|
1603
|
+
TooltipContent,
|
|
1604
|
+
TooltipInnerArrow,
|
|
1605
|
+
TooltipPositioner,
|
|
1606
|
+
TooltipTrigger,
|
|
1607
|
+
useAccordion,
|
|
1608
|
+
useAccordionItemContext,
|
|
1609
|
+
useCheckbox,
|
|
1610
|
+
useEditable,
|
|
1611
|
+
usePagination,
|
|
1612
|
+
usePaginationContext,
|
|
1613
|
+
usePinInput,
|
|
1614
|
+
usePopover,
|
|
1615
|
+
usePressable,
|
|
1616
|
+
useRadioGroup,
|
|
1617
|
+
useRating,
|
|
1618
|
+
useTabs,
|
|
1619
|
+
useTooltip
|
|
1620
|
+
};
|