@ansh-ui/react 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-RHTLNSVW.cjs → chunk-3SWO2M33.cjs} +7 -7
- package/dist/chunk-3SWO2M33.cjs.map +1 -0
- package/dist/{chunk-HO2YSF5O.js → chunk-742E5FQS.js} +3 -3
- package/dist/chunk-742E5FQS.js.map +1 -0
- package/dist/{chunk-EGG4CP7C.js → chunk-BQJ6H3HC.js} +3 -2
- package/dist/chunk-BQJ6H3HC.js.map +1 -0
- package/dist/{chunk-LDCZQP3R.js → chunk-CWYBOVCZ.js} +3 -3
- package/dist/{chunk-LDCZQP3R.js.map → chunk-CWYBOVCZ.js.map} +1 -1
- package/dist/{chunk-AVPEA5PB.cjs → chunk-IZ6T7LO3.cjs} +4 -4
- package/dist/{chunk-AVPEA5PB.cjs.map → chunk-IZ6T7LO3.cjs.map} +1 -1
- package/dist/{chunk-C32LKF23.cjs → chunk-KTLTYHAT.cjs} +3 -3
- package/dist/chunk-KTLTYHAT.cjs.map +1 -0
- package/dist/{chunk-IBXLC5IE.js → chunk-P5MRISBP.js} +19 -3
- package/dist/chunk-P5MRISBP.js.map +1 -0
- package/dist/{chunk-WGYNCSTP.cjs → chunk-PUW6BTPQ.cjs} +3 -2
- package/dist/chunk-PUW6BTPQ.cjs.map +1 -0
- package/dist/{chunk-T4AK2KLM.js → chunk-PVDQPVYF.js} +3 -3
- package/dist/{chunk-T4AK2KLM.js.map → chunk-PVDQPVYF.js.map} +1 -1
- package/dist/{chunk-6VRF7X5C.cjs → chunk-TEPQGFR4.cjs} +19 -2
- package/dist/chunk-TEPQGFR4.cjs.map +1 -0
- package/dist/{chunk-QO3E7TJS.js → chunk-WNWGYXJY.js} +4 -4
- package/dist/chunk-WNWGYXJY.js.map +1 -0
- package/dist/{chunk-C5JG6TMM.cjs → chunk-YACOHFYJ.cjs} +27 -27
- package/dist/{chunk-C5JG6TMM.cjs.map → chunk-YACOHFYJ.cjs.map} +1 -1
- package/dist/data.d.cts +2 -1
- package/dist/data.d.ts +2 -1
- package/dist/form.cjs +37 -37
- package/dist/form.d.cts +2 -1
- package/dist/form.d.ts +2 -1
- package/dist/form.js +2 -2
- package/dist/index.cjs +641 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +220 -7
- package/dist/index.d.ts +220 -7
- package/dist/index.js +526 -11
- package/dist/index.js.map +1 -1
- package/dist/layout.cjs +13 -13
- package/dist/layout.d.cts +11 -2
- package/dist/layout.d.ts +11 -2
- package/dist/layout.js +1 -1
- package/dist/{motion-CQmCq6_k.d.ts → motion-DoT_sTl1.d.ts} +3 -2
- package/dist/{motion-CSX4g2N8.d.cts → motion-DsQPOsTT.d.cts} +3 -2
- package/dist/motion.cjs +19 -19
- package/dist/motion.d.cts +2 -2
- package/dist/motion.d.ts +2 -2
- package/dist/motion.js +2 -2
- package/dist/navigation.d.cts +3 -2
- package/dist/navigation.d.ts +3 -2
- package/dist/overlay.cjs +16 -16
- package/dist/overlay.d.cts +3 -2
- package/dist/overlay.d.ts +3 -2
- package/dist/overlay.js +2 -2
- package/dist/{position-DVScKcaa.d.cts → position-CW6cGpSF.d.cts} +2 -1
- package/dist/{position-DVScKcaa.d.ts → position-CW6cGpSF.d.ts} +2 -1
- package/dist/primitives.cjs +25 -21
- package/dist/primitives.d.cts +5 -4
- package/dist/primitives.d.ts +5 -4
- package/dist/primitives.js +2 -2
- package/dist/{sidebar-D-PafAXw.d.cts → sidebar-Dyt67t2z.d.cts} +2 -1
- package/dist/{sidebar-D-PafAXw.d.ts → sidebar-Dyt67t2z.d.ts} +2 -1
- package/dist/styles.css +464 -0
- package/dist/{use-observers-B9qtimrk.d.cts → use-observers-DvA7hSz4.d.cts} +10 -1
- package/dist/{use-observers-B9qtimrk.d.ts → use-observers-DvA7hSz4.d.ts} +10 -1
- package/package.json +3 -3
- package/dist/chunk-6VRF7X5C.cjs.map +0 -1
- package/dist/chunk-C32LKF23.cjs.map +0 -1
- package/dist/chunk-EGG4CP7C.js.map +0 -1
- package/dist/chunk-HO2YSF5O.js.map +0 -1
- package/dist/chunk-IBXLC5IE.js.map +0 -1
- package/dist/chunk-QO3E7TJS.js.map +0 -1
- package/dist/chunk-RHTLNSVW.cjs.map +0 -1
- package/dist/chunk-WGYNCSTP.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkKTLTYHAT_cjs = require('./chunk-KTLTYHAT.cjs');
|
|
4
4
|
var chunkXMXECSQO_cjs = require('./chunk-XMXECSQO.cjs');
|
|
5
5
|
var chunkPO5DU3FU_cjs = require('./chunk-PO5DU3FU.cjs');
|
|
6
6
|
var chunkSFU5EPSN_cjs = require('./chunk-SFU5EPSN.cjs');
|
|
@@ -218,7 +218,7 @@ function Popover({
|
|
|
218
218
|
}
|
|
219
219
|
function PopoverTrigger({ asChild = false, children, ...rest }) {
|
|
220
220
|
const { open, setOpen, triggerRef, contentId } = usePopover("PopoverTrigger");
|
|
221
|
-
const Component = asChild ?
|
|
221
|
+
const Component = asChild ? chunkKTLTYHAT_cjs.Slot : "button";
|
|
222
222
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
223
223
|
Component,
|
|
224
224
|
{
|
|
@@ -248,7 +248,7 @@ function PopoverContent({
|
|
|
248
248
|
}) {
|
|
249
249
|
const { open, setOpen, triggerRef, contentId, placement, offset, modal } = usePopover("PopoverContent");
|
|
250
250
|
const contentRef = react.useRef(null);
|
|
251
|
-
const { mounted, state } =
|
|
251
|
+
const { mounted, state } = chunkKTLTYHAT_cjs.usePresence(open, contentRef);
|
|
252
252
|
const position = chunkXMXECSQO_cjs.useAnchoredPosition(triggerRef, contentRef, mounted, {
|
|
253
253
|
placement,
|
|
254
254
|
offset,
|
|
@@ -256,9 +256,9 @@ function PopoverContent({
|
|
|
256
256
|
arrowSize: arrow ? 10 : 0
|
|
257
257
|
});
|
|
258
258
|
chunkXMXECSQO_cjs.useDismiss(contentRef, open, () => setOpen(false), { ignore: [triggerRef] });
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
259
|
+
chunkKTLTYHAT_cjs.useFocusTrap(contentRef, open && modal);
|
|
260
|
+
chunkKTLTYHAT_cjs.useAutoFocus(contentRef, open);
|
|
261
|
+
chunkKTLTYHAT_cjs.useFocusRestore(open);
|
|
262
262
|
if (!mounted) return null;
|
|
263
263
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkXMXECSQO_cjs.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
264
264
|
"div",
|
|
@@ -294,7 +294,7 @@ function HoverCard({
|
|
|
294
294
|
const cardRef = react.useRef(null);
|
|
295
295
|
const timerRef = react.useRef(void 0);
|
|
296
296
|
const id = react.useId();
|
|
297
|
-
const { mounted, state } =
|
|
297
|
+
const { mounted, state } = chunkKTLTYHAT_cjs.usePresence(open, cardRef);
|
|
298
298
|
const position = chunkXMXECSQO_cjs.useAnchoredPosition(triggerRef, cardRef, mounted, { placement, offset: 8 });
|
|
299
299
|
const schedule = (next) => {
|
|
300
300
|
clearTimeout(timerRef.current);
|
|
@@ -352,7 +352,7 @@ function Tooltip({
|
|
|
352
352
|
const tipRef = react.useRef(null);
|
|
353
353
|
const timerRef = react.useRef(void 0);
|
|
354
354
|
const id = react.useId();
|
|
355
|
-
const { mounted, state } =
|
|
355
|
+
const { mounted, state } = chunkKTLTYHAT_cjs.usePresence(open, tipRef);
|
|
356
356
|
const position = chunkXMXECSQO_cjs.useAnchoredPosition(triggerRef, tipRef, mounted, {
|
|
357
357
|
placement,
|
|
358
358
|
offset: 6,
|
|
@@ -391,7 +391,7 @@ function Tooltip({
|
|
|
391
391
|
}, [open, group]);
|
|
392
392
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
393
393
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
394
|
-
|
|
394
|
+
chunkKTLTYHAT_cjs.Slot,
|
|
395
395
|
{
|
|
396
396
|
ref: triggerRef,
|
|
397
397
|
"aria-describedby": open ? id : void 0,
|
|
@@ -444,14 +444,14 @@ function Dialog({
|
|
|
444
444
|
const id = react.useId();
|
|
445
445
|
const titleId = `${id}-title`;
|
|
446
446
|
const descriptionId = `${id}-description`;
|
|
447
|
-
const { mounted, state } =
|
|
447
|
+
const { mounted, state } = chunkKTLTYHAT_cjs.usePresence(open, panelRef);
|
|
448
448
|
const close = react.useCallback(() => {
|
|
449
449
|
if (dismissable) onOpenChange(false);
|
|
450
450
|
}, [dismissable, onOpenChange]);
|
|
451
451
|
chunkXMXECSQO_cjs.useDismiss(panelRef, open, close, { outsidePress: dismissable, escapeKey: dismissable });
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
452
|
+
chunkKTLTYHAT_cjs.useFocusTrap(panelRef, open);
|
|
453
|
+
chunkKTLTYHAT_cjs.useAutoFocus(panelRef, open, initialFocus);
|
|
454
|
+
chunkKTLTYHAT_cjs.useFocusRestore(open);
|
|
455
455
|
chunkXMXECSQO_cjs.useScrollLock(open);
|
|
456
456
|
if (!mounted) return null;
|
|
457
457
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkXMXECSQO_cjs.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ansh-dialog__layer", "data-state": state, children: [
|
|
@@ -516,15 +516,15 @@ function AlertDialog({
|
|
|
516
516
|
const panelRef = react.useRef(null);
|
|
517
517
|
const cancelRef = react.useRef(null);
|
|
518
518
|
const id = react.useId();
|
|
519
|
-
const { mounted, state } =
|
|
519
|
+
const { mounted, state } = chunkKTLTYHAT_cjs.usePresence(open, panelRef);
|
|
520
520
|
const cancel = react.useCallback(() => {
|
|
521
521
|
onCancel?.();
|
|
522
522
|
onOpenChange(false);
|
|
523
523
|
}, [onCancel, onOpenChange]);
|
|
524
524
|
chunkXMXECSQO_cjs.useDismiss(panelRef, open, cancel, { outsidePress: false, escapeKey: true });
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
525
|
+
chunkKTLTYHAT_cjs.useFocusTrap(panelRef, open);
|
|
526
|
+
chunkKTLTYHAT_cjs.useAutoFocus(panelRef, open, cancelRef);
|
|
527
|
+
chunkKTLTYHAT_cjs.useFocusRestore(open);
|
|
528
528
|
chunkXMXECSQO_cjs.useScrollLock(open);
|
|
529
529
|
if (!mounted) return null;
|
|
530
530
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkXMXECSQO_cjs.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ansh-dialog__layer", "data-state": state, children: [
|
|
@@ -629,14 +629,14 @@ function Drawer({
|
|
|
629
629
|
}) {
|
|
630
630
|
const panelRef = react.useRef(null);
|
|
631
631
|
const id = react.useId();
|
|
632
|
-
const { mounted, state } =
|
|
632
|
+
const { mounted, state } = chunkKTLTYHAT_cjs.usePresence(open, panelRef);
|
|
633
633
|
const close = react.useCallback(() => {
|
|
634
634
|
if (dismissable) onOpenChange(false);
|
|
635
635
|
}, [dismissable, onOpenChange]);
|
|
636
636
|
chunkXMXECSQO_cjs.useDismiss(panelRef, open, close, { outsidePress: dismissable && modal, escapeKey: dismissable });
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
637
|
+
chunkKTLTYHAT_cjs.useFocusTrap(panelRef, open && modal);
|
|
638
|
+
chunkKTLTYHAT_cjs.useAutoFocus(panelRef, open);
|
|
639
|
+
chunkKTLTYHAT_cjs.useFocusRestore(open);
|
|
640
640
|
chunkXMXECSQO_cjs.useScrollLock(open && modal);
|
|
641
641
|
if (!mounted) return null;
|
|
642
642
|
const horizontal = side === "left" || side === "right";
|
|
@@ -733,12 +733,12 @@ function DropdownMenu({
|
|
|
733
733
|
const triggerRef = react.useRef(null);
|
|
734
734
|
const menuRef = react.useRef(null);
|
|
735
735
|
const menuId = react.useId();
|
|
736
|
-
const { mounted, state } =
|
|
736
|
+
const { mounted, state } = chunkKTLTYHAT_cjs.usePresence(open, menuRef);
|
|
737
737
|
const position = chunkXMXECSQO_cjs.useAnchoredPosition(triggerRef, menuRef, mounted, { placement, offset: 6 });
|
|
738
738
|
chunkXMXECSQO_cjs.useDismiss(menuRef, open, () => setOpen(false), { ignore: [triggerRef] });
|
|
739
739
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
740
740
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
741
|
-
|
|
741
|
+
chunkKTLTYHAT_cjs.Slot,
|
|
742
742
|
{
|
|
743
743
|
ref: triggerRef,
|
|
744
744
|
"aria-haspopup": "menu",
|
|
@@ -783,7 +783,7 @@ function ContextMenu({
|
|
|
783
783
|
const anchorRef = react.useRef(null);
|
|
784
784
|
const menuId = react.useId();
|
|
785
785
|
const open = point !== null;
|
|
786
|
-
const { mounted, state } =
|
|
786
|
+
const { mounted, state } = chunkKTLTYHAT_cjs.usePresence(open, menuRef);
|
|
787
787
|
const position = chunkXMXECSQO_cjs.useAnchoredPosition(anchorRef, menuRef, mounted, {
|
|
788
788
|
placement: "bottom-start",
|
|
789
789
|
offset: 2
|
|
@@ -1097,7 +1097,7 @@ function Submenu({ ref, entry, active, open, onOpenChange, onHover, onCloseAll }
|
|
|
1097
1097
|
const panelRef = react.useRef(null);
|
|
1098
1098
|
const timerRef = react.useRef(void 0);
|
|
1099
1099
|
const id = react.useId();
|
|
1100
|
-
const { mounted, state } =
|
|
1100
|
+
const { mounted, state } = chunkKTLTYHAT_cjs.usePresence(open, panelRef);
|
|
1101
1101
|
const position = chunkXMXECSQO_cjs.useAnchoredPosition(triggerRef, panelRef, mounted, {
|
|
1102
1102
|
placement: "right-start",
|
|
1103
1103
|
offset: 2
|
|
@@ -1196,5 +1196,5 @@ exports.PopoverTrigger = PopoverTrigger;
|
|
|
1196
1196
|
exports.Tooltip = Tooltip;
|
|
1197
1197
|
exports.TooltipProvider = TooltipProvider;
|
|
1198
1198
|
exports.useCommandShortcut = useCommandShortcut;
|
|
1199
|
-
//# sourceMappingURL=chunk-
|
|
1200
|
-
//# sourceMappingURL=chunk-
|
|
1199
|
+
//# sourceMappingURL=chunk-YACOHFYJ.cjs.map
|
|
1200
|
+
//# sourceMappingURL=chunk-YACOHFYJ.cjs.map
|