@tarsis/toolkit 0.7.5 → 0.7.7

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.
@@ -1,5 +1,6 @@
1
1
  const require_chunk = require("./chunk-CKQMccvm.cjs");
2
2
  const require_useMergeRefs = require("./useMergeRefs-C_l6omwU.cjs");
3
+ const require_Slot = require("./Slot-SOe-b2n6.cjs");
3
4
  const require_hooks = require("./hooks.cjs");
4
5
  let clsx = require("clsx");
5
6
  clsx = require_chunk.__toESM(clsx, 1);
@@ -151,13 +152,13 @@ var DialogBase = ({ open, onClose, children, className, overlayClassName, style,
151
152
  });
152
153
  };
153
154
  var PopoverBase_module_default = {
154
- popover: "_popover_stzls_1",
155
- "popover-enter": "_popover-enter_stzls_1"
155
+ popover: "_popover_1xbzr_1",
156
+ "popover-enter": "_popover-enter_1xbzr_1"
156
157
  };
157
158
  //#endregion
158
159
  //#region src/components/primitives/PopoverBase/PopoverBase.tsx
159
- var PopoverBase = ({ open, onOpenChange, trigger, children, placement = "bottom", offsetValue = 8, className, style, triggerRef: externalTriggerRef, ...ariaProps }) => {
160
- const { refs, floatingStyles, context } = (0, _floating_ui_react.useFloating)({
160
+ var PopoverBase = ({ open, onOpenChange, trigger, triggerAsChild = false, children, placement = "bottom", offsetValue = 8, className, style, triggerRef: externalTriggerRef, ...ariaProps }) => {
161
+ const { refs, floatingStyles, context, isPositioned } = (0, _floating_ui_react.useFloating)({
161
162
  open,
162
163
  onOpenChange,
163
164
  placement,
@@ -168,20 +169,22 @@ var PopoverBase = ({ open, onOpenChange, trigger, children, placement = "bottom"
168
169
  ],
169
170
  whileElementsMounted: _floating_ui_react.autoUpdate
170
171
  });
171
- const { getReferenceProps, getFloatingProps } = (0, _floating_ui_react.useInteractions)([
172
- (0, _floating_ui_react.useClick)(context),
173
- (0, _floating_ui_react.useDismiss)(context),
174
- (0, _floating_ui_react.useRole)(context)
175
- ]);
172
+ const { getReferenceProps, getFloatingProps } = (0, _floating_ui_react.useInteractions)([(0, _floating_ui_react.useDismiss)(context), (0, _floating_ui_react.useRole)(context)]);
176
173
  const setTriggerRef = (0, react.useCallback)((node) => {
177
174
  refs.setReference(node);
178
175
  }, [refs]);
179
176
  const setFloatingRef = (0, react.useCallback)((node) => {
180
177
  refs.setFloating(node);
181
178
  }, [refs]);
182
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
183
- ref: require_useMergeRefs.useMergeRefs(setTriggerRef, externalTriggerRef ?? null),
184
- ...getReferenceProps(),
179
+ const triggerMergedRef = require_useMergeRefs.useMergeRefs(setTriggerRef, externalTriggerRef ?? null);
180
+ const referenceProps = getReferenceProps();
181
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [triggerAsChild && (0, react.isValidElement)(trigger) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Slot.Slot, {
182
+ ref: triggerMergedRef,
183
+ ...referenceProps,
184
+ children: trigger
185
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
186
+ ref: triggerMergedRef,
187
+ ...referenceProps,
185
188
  style: { display: "inline-flex" },
186
189
  children: trigger
187
190
  }), open && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingPortal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_floating_ui_react.FloatingFocusManager, {
@@ -192,7 +195,8 @@ var PopoverBase = ({ open, onOpenChange, trigger, children, placement = "bottom"
192
195
  className: (0, clsx.default)(PopoverBase_module_default.popover, className),
193
196
  style: {
194
197
  ...floatingStyles,
195
- ...style
198
+ ...style,
199
+ opacity: isPositioned ? 1 : 0
196
200
  },
197
201
  "aria-label": ariaProps["aria-label"],
198
202
  "aria-labelledby": ariaProps["aria-labelledby"],
@@ -1,7 +1,8 @@
1
1
  import { n as useMergeRefs$1 } from "./useMergeRefs-BM2-gSLn.js";
2
+ import { t as Slot } from "./Slot-z71j7q57.js";
2
3
  import { useControllableState, useFormField } from "./hooks.js";
3
4
  import cn from "clsx";
4
- import { createContext, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
5
+ import { createContext, isValidElement, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
5
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
7
  import { FloatingFocusManager, FloatingPortal, autoUpdate, flip, offset, safePolygon, shift, size, useClick, useDismiss, useFloating, useFocus, useHover, useInteractions, useListNavigation, useRole } from "@floating-ui/react";
7
8
  import { createPortal } from "react-dom";
@@ -149,13 +150,13 @@ var DialogBase = ({ open, onClose, children, className, overlayClassName, style,
149
150
  });
150
151
  };
151
152
  var PopoverBase_module_default = {
152
- popover: "_popover_stzls_1",
153
- "popover-enter": "_popover-enter_stzls_1"
153
+ popover: "_popover_1xbzr_1",
154
+ "popover-enter": "_popover-enter_1xbzr_1"
154
155
  };
155
156
  //#endregion
156
157
  //#region src/components/primitives/PopoverBase/PopoverBase.tsx
157
- var PopoverBase = ({ open, onOpenChange, trigger, children, placement = "bottom", offsetValue = 8, className, style, triggerRef: externalTriggerRef, ...ariaProps }) => {
158
- const { refs, floatingStyles, context } = useFloating({
158
+ var PopoverBase = ({ open, onOpenChange, trigger, triggerAsChild = false, children, placement = "bottom", offsetValue = 8, className, style, triggerRef: externalTriggerRef, ...ariaProps }) => {
159
+ const { refs, floatingStyles, context, isPositioned } = useFloating({
159
160
  open,
160
161
  onOpenChange,
161
162
  placement,
@@ -166,20 +167,22 @@ var PopoverBase = ({ open, onOpenChange, trigger, children, placement = "bottom"
166
167
  ],
167
168
  whileElementsMounted: autoUpdate
168
169
  });
169
- const { getReferenceProps, getFloatingProps } = useInteractions([
170
- useClick(context),
171
- useDismiss(context),
172
- useRole(context)
173
- ]);
170
+ const { getReferenceProps, getFloatingProps } = useInteractions([useDismiss(context), useRole(context)]);
174
171
  const setTriggerRef = useCallback((node) => {
175
172
  refs.setReference(node);
176
173
  }, [refs]);
177
174
  const setFloatingRef = useCallback((node) => {
178
175
  refs.setFloating(node);
179
176
  }, [refs]);
180
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
181
- ref: useMergeRefs$1(setTriggerRef, externalTriggerRef ?? null),
182
- ...getReferenceProps(),
177
+ const triggerMergedRef = useMergeRefs$1(setTriggerRef, externalTriggerRef ?? null);
178
+ const referenceProps = getReferenceProps();
179
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [triggerAsChild && isValidElement(trigger) ? /* @__PURE__ */ jsx(Slot, {
180
+ ref: triggerMergedRef,
181
+ ...referenceProps,
182
+ children: trigger
183
+ }) : /* @__PURE__ */ jsx("span", {
184
+ ref: triggerMergedRef,
185
+ ...referenceProps,
183
186
  style: { display: "inline-flex" },
184
187
  children: trigger
185
188
  }), open && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(FloatingFocusManager, {
@@ -190,7 +193,8 @@ var PopoverBase = ({ open, onOpenChange, trigger, children, placement = "bottom"
190
193
  className: cn(PopoverBase_module_default.popover, className),
191
194
  style: {
192
195
  ...floatingStyles,
193
- ...style
196
+ ...style,
197
+ opacity: isPositioned ? 1 : 0
194
198
  },
195
199
  "aria-label": ariaProps["aria-label"],
196
200
  "aria-labelledby": ariaProps["aria-labelledby"],
@@ -4,6 +4,7 @@ type PopoverBaseProps = {
4
4
  open: boolean;
5
5
  onOpenChange: (open: boolean) => void;
6
6
  trigger: ReactNode;
7
+ triggerAsChild?: boolean;
7
8
  children: ReactNode;
8
9
  placement?: Placement;
9
10
  offsetValue?: OffsetOptions;
@@ -13,6 +14,6 @@ type PopoverBaseProps = {
13
14
  'aria-label'?: string;
14
15
  'aria-labelledby'?: string;
15
16
  };
16
- declare const PopoverBase: ({ open, onOpenChange, trigger, children, placement, offsetValue, className, style, triggerRef: externalTriggerRef, ...ariaProps }: PopoverBaseProps) => import("react/jsx-runtime").JSX.Element;
17
+ declare const PopoverBase: ({ open, onOpenChange, trigger, triggerAsChild, children, placement, offsetValue, className, style, triggerRef: externalTriggerRef, ...ariaProps }: PopoverBaseProps) => import("react/jsx-runtime").JSX.Element;
17
18
  export { PopoverBase };
18
19
  export type { PopoverBaseProps };
package/dist/index.cjs CHANGED
@@ -7,7 +7,7 @@ const require_values = require("./values-BqSJ0h9o.cjs");
7
7
  const require_utils = require("./utils-BGgmkNY4.cjs");
8
8
  const require_animation = require("./animation-BauloIgQ.cjs");
9
9
  const require_assets = require("./assets-BMqH4phf.cjs");
10
- const require_SelectBase = require("./SelectBase-CKsJgF0R.cjs");
10
+ const require_SelectBase = require("./SelectBase-BeOZSKl8.cjs");
11
11
  const require_Container = require("./Container-DBXALrl1.cjs");
12
12
  const require_tokens = require("./tokens-Nhzxtwvl.cjs");
13
13
  let clsx = require("clsx");
@@ -759,31 +759,31 @@ var BubblyParticlesButton = () => {
759
759
  });
760
760
  };
761
761
  var BurningButton_module_default = {
762
- root: "_root_3m8e4_1",
763
- button: "_button_3m8e4_11",
764
- p: "_p_3m8e4_24",
765
- text: "_text_3m8e4_24",
766
- rise1: "_rise1_3m8e4_1",
767
- rise2: "_rise2_3m8e4_1",
768
- rise3: "_rise3_3m8e4_1",
769
- rise4: "_rise4_3m8e4_1",
770
- rise5: "_rise5_3m8e4_1",
771
- rise6: "_rise6_3m8e4_1",
772
- rise7: "_rise7_3m8e4_1",
773
- rise8: "_rise8_3m8e4_1",
774
- rise9: "_rise9_3m8e4_1",
775
- rise10: "_rise10_3m8e4_1",
776
- rise11: "_rise11_3m8e4_1",
777
- rise12: "_rise12_3m8e4_1",
778
- rise13: "_rise13_3m8e4_1",
779
- rise14: "_rise14_3m8e4_1",
780
- rise15: "_rise15_3m8e4_1",
781
- rise16: "_rise16_3m8e4_1",
782
- rise17: "_rise17_3m8e4_1",
783
- rise18: "_rise18_3m8e4_1",
784
- rise19: "_rise19_3m8e4_1",
785
- rise20: "_rise20_3m8e4_1",
786
- effects: "_effects_3m8e4_238"
762
+ root: "_root_1ure9_1",
763
+ button: "_button_1ure9_11",
764
+ p: "_p_1ure9_24",
765
+ text: "_text_1ure9_24",
766
+ rise1: "_rise1_1ure9_1",
767
+ rise2: "_rise2_1ure9_1",
768
+ rise3: "_rise3_1ure9_1",
769
+ rise4: "_rise4_1ure9_1",
770
+ rise5: "_rise5_1ure9_1",
771
+ rise6: "_rise6_1ure9_1",
772
+ rise7: "_rise7_1ure9_1",
773
+ rise8: "_rise8_1ure9_1",
774
+ rise9: "_rise9_1ure9_1",
775
+ rise10: "_rise10_1ure9_1",
776
+ rise11: "_rise11_1ure9_1",
777
+ rise12: "_rise12_1ure9_1",
778
+ rise13: "_rise13_1ure9_1",
779
+ rise14: "_rise14_1ure9_1",
780
+ rise15: "_rise15_1ure9_1",
781
+ rise16: "_rise16_1ure9_1",
782
+ rise17: "_rise17_1ure9_1",
783
+ rise18: "_rise18_1ure9_1",
784
+ rise19: "_rise19_1ure9_1",
785
+ rise20: "_rise20_1ure9_1",
786
+ effects: "_effects_1ure9_238"
787
787
  };
788
788
  //#endregion
789
789
  //#region src/components/Buttons/BurningButton/BurningButton.tsx
@@ -3829,10 +3829,10 @@ var NeonButton = ({ className, ...rest }) => {
3829
3829
  });
3830
3830
  };
3831
3831
  var NoisyButton_module_default = {
3832
- root: "_root_1ne5x_2",
3833
- i: "_i_1ne5x_22",
3834
- noise: "_noise_1ne5x_1",
3835
- text: "_text_1ne5x_482"
3832
+ root: "_root_1gvml_2",
3833
+ i: "_i_1gvml_22",
3834
+ noise: "_noise_1gvml_1",
3835
+ text: "_text_1gvml_482"
3836
3836
  };
3837
3837
  //#endregion
3838
3838
  //#region src/components/Buttons/NoisyButton/NoisyButton.tsx
@@ -19468,12 +19468,12 @@ var ScrambledText = ({ children, reveal = false }) => {
19468
19468
  });
19469
19469
  };
19470
19470
  var ScramblingLetters_module_default = {
19471
- root: "_root_1lky6_1",
19472
- line: "_line_1lky6_9",
19473
- word: "_word_1lky6_14",
19474
- link: "_link_1lky6_18",
19475
- letter: "_letter_1lky6_22",
19476
- wobble: "_wobble_1lky6_1"
19471
+ root: "_root_1hoqe_1",
19472
+ line: "_line_1hoqe_9",
19473
+ word: "_word_1hoqe_14",
19474
+ link: "_link_1hoqe_18",
19475
+ letter: "_letter_1hoqe_22",
19476
+ wobble: "_wobble_1hoqe_1"
19477
19477
  };
19478
19478
  //#endregion
19479
19479
  //#region src/components/Texts/ScramblingLetters/ScramblingLetters.tsx
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { C as move, S as times, _ as setLogLevel, a as is, b as storageLogger, c
5
5
  import { _ as chain, a as wait, c as scalePresence, d as distance, f as lerp, g as normalizeError, h as formatTime, i as delay, l as slideDownPresence, m as formatDuration, n as supportsViewTransitions, o as createPresenceVariants, p as lineEq, r as getPath, s as fadePresence, t as startViewTransition, u as slideUpPresence, v as createBoundedMap } from "./utils-Dw5El_3G.js";
6
6
  import { n as easing, r as staggerDelay, t as animationDuration } from "./animation-BFpILbqb.js";
7
7
  import { i as lockAudioAssets, r as iconAssets, t as dockAudioAssets } from "./assets-huTvlamy.js";
8
- import { a as FormField, c as VisuallyHidden, i as DialogBase, n as TooltipBase, o as useFormFieldContext, r as PopoverBase, s as Portal, t as SelectBase } from "./SelectBase-CdQKpIjl.js";
8
+ import { a as FormField, c as VisuallyHidden, i as DialogBase, n as TooltipBase, o as useFormFieldContext, r as PopoverBase, s as Portal, t as SelectBase } from "./SelectBase-CBcSt-zA.js";
9
9
  import { n as Cluster, r as Stack, t as Container } from "./Container-BirkN1fA.js";
10
10
  import { a as getVarName, i as Token, n as validateColorScheme, o as resolveToken, r as springPreset, t as REQUIRED_SEMANTIC_VARS } from "./tokens-CDVSR49D.js";
11
11
  import cn from "clsx";
@@ -751,31 +751,31 @@ var BubblyParticlesButton = () => {
751
751
  });
752
752
  };
753
753
  var BurningButton_module_default = {
754
- root: "_root_820th_1",
755
- button: "_button_820th_11",
756
- p: "_p_820th_24",
757
- text: "_text_820th_24",
758
- rise1: "_rise1_820th_1",
759
- rise2: "_rise2_820th_1",
760
- rise3: "_rise3_820th_1",
761
- rise4: "_rise4_820th_1",
762
- rise5: "_rise5_820th_1",
763
- rise6: "_rise6_820th_1",
764
- rise7: "_rise7_820th_1",
765
- rise8: "_rise8_820th_1",
766
- rise9: "_rise9_820th_1",
767
- rise10: "_rise10_820th_1",
768
- rise11: "_rise11_820th_1",
769
- rise12: "_rise12_820th_1",
770
- rise13: "_rise13_820th_1",
771
- rise14: "_rise14_820th_1",
772
- rise15: "_rise15_820th_1",
773
- rise16: "_rise16_820th_1",
774
- rise17: "_rise17_820th_1",
775
- rise18: "_rise18_820th_1",
776
- rise19: "_rise19_820th_1",
777
- rise20: "_rise20_820th_1",
778
- effects: "_effects_820th_238"
754
+ root: "_root_1qw66_1",
755
+ button: "_button_1qw66_11",
756
+ p: "_p_1qw66_24",
757
+ text: "_text_1qw66_24",
758
+ rise1: "_rise1_1qw66_1",
759
+ rise2: "_rise2_1qw66_1",
760
+ rise3: "_rise3_1qw66_1",
761
+ rise4: "_rise4_1qw66_1",
762
+ rise5: "_rise5_1qw66_1",
763
+ rise6: "_rise6_1qw66_1",
764
+ rise7: "_rise7_1qw66_1",
765
+ rise8: "_rise8_1qw66_1",
766
+ rise9: "_rise9_1qw66_1",
767
+ rise10: "_rise10_1qw66_1",
768
+ rise11: "_rise11_1qw66_1",
769
+ rise12: "_rise12_1qw66_1",
770
+ rise13: "_rise13_1qw66_1",
771
+ rise14: "_rise14_1qw66_1",
772
+ rise15: "_rise15_1qw66_1",
773
+ rise16: "_rise16_1qw66_1",
774
+ rise17: "_rise17_1qw66_1",
775
+ rise18: "_rise18_1qw66_1",
776
+ rise19: "_rise19_1qw66_1",
777
+ rise20: "_rise20_1qw66_1",
778
+ effects: "_effects_1qw66_238"
779
779
  };
780
780
  //#endregion
781
781
  //#region src/components/Buttons/BurningButton/BurningButton.tsx
@@ -3821,10 +3821,10 @@ var NeonButton = ({ className, ...rest }) => {
3821
3821
  });
3822
3822
  };
3823
3823
  var NoisyButton_module_default = {
3824
- root: "_root_19a9r_2",
3825
- i: "_i_19a9r_22",
3826
- noise: "_noise_19a9r_1",
3827
- text: "_text_19a9r_482"
3824
+ root: "_root_1p8x9_2",
3825
+ i: "_i_1p8x9_22",
3826
+ noise: "_noise_1p8x9_1",
3827
+ text: "_text_1p8x9_482"
3828
3828
  };
3829
3829
  //#endregion
3830
3830
  //#region src/components/Buttons/NoisyButton/NoisyButton.tsx
@@ -19460,12 +19460,12 @@ var ScrambledText = ({ children, reveal = false }) => {
19460
19460
  });
19461
19461
  };
19462
19462
  var ScramblingLetters_module_default = {
19463
- root: "_root_1262b_1",
19464
- line: "_line_1262b_9",
19465
- word: "_word_1262b_14",
19466
- link: "_link_1262b_18",
19467
- letter: "_letter_1262b_22",
19468
- wobble: "_wobble_1262b_1"
19463
+ root: "_root_wteo2_1",
19464
+ line: "_line_wteo2_9",
19465
+ word: "_word_wteo2_14",
19466
+ link: "_link_wteo2_18",
19467
+ letter: "_letter_wteo2_22",
19468
+ wobble: "_wobble_wteo2_1"
19469
19469
  };
19470
19470
  //#endregion
19471
19471
  //#region src/components/Texts/ScramblingLetters/ScramblingLetters.tsx
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_Slot = require("./Slot-SOe-b2n6.cjs");
3
- const require_SelectBase = require("./SelectBase-CKsJgF0R.cjs");
3
+ const require_SelectBase = require("./SelectBase-BeOZSKl8.cjs");
4
4
  exports.DialogBase = require_SelectBase.DialogBase;
5
5
  exports.FormField = require_SelectBase.FormField;
6
6
  exports.PopoverBase = require_SelectBase.PopoverBase;
@@ -1,3 +1,3 @@
1
1
  import { n as Slottable, t as Slot } from "./Slot-z71j7q57.js";
2
- import { a as FormField, c as VisuallyHidden, i as DialogBase, n as TooltipBase, o as useFormFieldContext, r as PopoverBase, s as Portal, t as SelectBase } from "./SelectBase-CdQKpIjl.js";
2
+ import { a as FormField, c as VisuallyHidden, i as DialogBase, n as TooltipBase, o as useFormFieldContext, r as PopoverBase, s as Portal, t as SelectBase } from "./SelectBase-CBcSt-zA.js";
3
3
  export { DialogBase, FormField, PopoverBase, Portal, SelectBase, Slot, Slottable, TooltipBase, VisuallyHidden, useFormFieldContext };