@overmap-ai/blocks 1.0.31-tailwind-components.18 → 1.0.31-tailwind-components.20

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.
@@ -863,7 +863,7 @@
863
863
  }, [filterFunction, filterValue, values]);
864
864
  return [filteredOptions, filterValue, setFilterValue];
865
865
  }
866
- const useSize = (target) => {
866
+ const useSize$1 = (target) => {
867
867
  const [size2, setSize] = React.useState();
868
868
  React.useLayoutEffect(() => {
869
869
  var _a;
@@ -1334,7 +1334,7 @@
1334
1334
  return !hideLayout && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classVarianceAuthority.cx(className, "flex grow h-full"), ref, ...rest, children });
1335
1335
  })
1336
1336
  );
1337
- const Root$1 = React.memo((props) => {
1337
+ const Root$2 = React.memo((props) => {
1338
1338
  const { children, small = false, hideLayout = false } = props;
1339
1339
  const [showLeftSlideOut, setShowLeftSlideOut] = React.useState(false);
1340
1340
  const [showRightSlideOut, setShowRightSlideOut] = React.useState(false);
@@ -1351,9 +1351,9 @@
1351
1351
  );
1352
1352
  return /* @__PURE__ */ jsxRuntime.jsx(LayoutContext.Provider, { value: contextValue, children });
1353
1353
  });
1354
- Root$1.displayName = "Layout.Root";
1354
+ Root$2.displayName = "Layout.Root";
1355
1355
  function usePointerDownOutside(onPointerDownOutside, ownerElement = globalThis == null ? void 0 : globalThis.document.body) {
1356
- const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside);
1356
+ const handlePointerDownOutside = useCallbackRef$2(onPointerDownOutside);
1357
1357
  const isPointerInsideReactTreeRef = React.useRef(false);
1358
1358
  const handleClickRef = React.useRef(() => {
1359
1359
  });
@@ -1405,7 +1405,7 @@
1405
1405
  target.dispatchEvent(event);
1406
1406
  }
1407
1407
  }
1408
- function useCallbackRef$1(callback) {
1408
+ function useCallbackRef$2(callback) {
1409
1409
  const callbackRef = React.useRef(callback);
1410
1410
  React.useEffect(() => {
1411
1411
  callbackRef.current = callback;
@@ -1689,7 +1689,7 @@
1689
1689
  })
1690
1690
  );
1691
1691
  const Layout = {
1692
- Root: Root$1,
1692
+ Root: Root$2,
1693
1693
  Container,
1694
1694
  SlideOutOverlay,
1695
1695
  LeftSlideOut,
@@ -1699,6 +1699,7 @@
1699
1699
  const linkCva = classVarianceAuthority.cva(["cursor-pointer"], {
1700
1700
  variants: {
1701
1701
  size: {
1702
+ none: ["[font-size:inherit]", "leading-[inherit]"],
1702
1703
  xs: ["text-xs"],
1703
1704
  sm: ["text-sm"],
1704
1705
  md: ["text-base"],
@@ -1726,7 +1727,7 @@
1726
1727
  }
1727
1728
  },
1728
1729
  defaultVariants: {
1729
- size: "xl",
1730
+ size: "none",
1730
1731
  weight: "regular",
1731
1732
  align: "left"
1732
1733
  }
@@ -1735,7 +1736,7 @@
1735
1736
  const providerContext = useProvider();
1736
1737
  const {
1737
1738
  className,
1738
- size: size2 = "md",
1739
+ size: size2,
1739
1740
  weight = "regular",
1740
1741
  align = "left",
1741
1742
  highContrast = false,
@@ -7862,7 +7863,7 @@
7862
7863
  Item: RadioGroupItem,
7863
7864
  Root: RadioGroupRoot
7864
7865
  };
7865
- function createContextScope(scopeName, createContextScopeDeps = []) {
7866
+ function createContextScope$1(scopeName, createContextScopeDeps = []) {
7866
7867
  let defaultContexts = [];
7867
7868
  function createContext3(rootComponentName, defaultContext) {
7868
7869
  const BaseContext = React__namespace.createContext(defaultContext);
@@ -7899,9 +7900,9 @@
7899
7900
  };
7900
7901
  };
7901
7902
  createScope.scopeName = scopeName;
7902
- return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
7903
+ return [createContext3, composeContextScopes$1(createScope, ...createContextScopeDeps)];
7903
7904
  }
7904
- function composeContextScopes(...scopes) {
7905
+ function composeContextScopes$1(...scopes) {
7905
7906
  const baseScope = scopes[0];
7906
7907
  if (scopes.length === 1) return baseScope;
7907
7908
  const createScope = () => {
@@ -7921,7 +7922,7 @@
7921
7922
  createScope.scopeName = baseScope.scopeName;
7922
7923
  return createScope;
7923
7924
  }
7924
- var NODES = [
7925
+ var NODES$1 = [
7925
7926
  "a",
7926
7927
  "button",
7927
7928
  "div",
@@ -7939,7 +7940,7 @@
7939
7940
  "svg",
7940
7941
  "ul"
7941
7942
  ];
7942
- var Primitive = NODES.reduce((primitive, node) => {
7943
+ var Primitive$1 = NODES$1.reduce((primitive, node) => {
7943
7944
  const Node2 = React__namespace.forwardRef((props, forwardedRef) => {
7944
7945
  const { asChild, ...primitiveProps } = props;
7945
7946
  const Comp = asChild ? reactSlot.Slot : node;
@@ -7951,7 +7952,7 @@
7951
7952
  Node2.displayName = `Primitive.${node}`;
7952
7953
  return { ...primitive, [node]: Node2 };
7953
7954
  }, {});
7954
- function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
7955
+ function composeEventHandlers$1(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
7955
7956
  return function handleEvent(event) {
7956
7957
  originalEventHandler == null ? void 0 : originalEventHandler(event);
7957
7958
  if (checkForDefaultPrevented === false || !event.defaultPrevented) {
@@ -7959,18 +7960,18 @@
7959
7960
  }
7960
7961
  };
7961
7962
  }
7962
- function setRef(ref, value) {
7963
+ function setRef$1(ref, value) {
7963
7964
  if (typeof ref === "function") {
7964
7965
  return ref(value);
7965
7966
  } else if (ref !== null && ref !== void 0) {
7966
7967
  ref.current = value;
7967
7968
  }
7968
7969
  }
7969
- function composeRefs(...refs) {
7970
+ function composeRefs$1(...refs) {
7970
7971
  return (node) => {
7971
7972
  let hasCleanup = false;
7972
7973
  const cleanups = refs.map((ref) => {
7973
- const cleanup = setRef(ref, node);
7974
+ const cleanup = setRef$1(ref, node);
7974
7975
  if (!hasCleanup && typeof cleanup == "function") {
7975
7976
  hasCleanup = true;
7976
7977
  }
@@ -7983,19 +7984,19 @@
7983
7984
  if (typeof cleanup == "function") {
7984
7985
  cleanup();
7985
7986
  } else {
7986
- setRef(refs[i], null);
7987
+ setRef$1(refs[i], null);
7987
7988
  }
7988
7989
  }
7989
7990
  };
7990
7991
  }
7991
7992
  };
7992
7993
  }
7993
- function useComposedRefs(...refs) {
7994
- return React__namespace.useCallback(composeRefs(...refs), refs);
7994
+ function useComposedRefs$1(...refs) {
7995
+ return React__namespace.useCallback(composeRefs$1(...refs), refs);
7995
7996
  }
7996
7997
  function createCollection(name) {
7997
7998
  const PROVIDER_NAME = name + "CollectionProvider";
7998
- const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME);
7999
+ const [createCollectionContext, createCollectionScope2] = createContextScope$1(PROVIDER_NAME);
7999
8000
  const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
8000
8001
  PROVIDER_NAME,
8001
8002
  { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
@@ -8012,7 +8013,7 @@
8012
8013
  (props, forwardedRef) => {
8013
8014
  const { scope, children } = props;
8014
8015
  const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
8015
- const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
8016
+ const composedRefs = useComposedRefs$1(forwardedRef, context.collectionRef);
8016
8017
  return /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slot, { ref: composedRefs, children });
8017
8018
  }
8018
8019
  );
@@ -8023,7 +8024,7 @@
8023
8024
  (props, forwardedRef) => {
8024
8025
  const { scope, children, ...itemData } = props;
8025
8026
  const ref = React.useRef(null);
8026
- const composedRefs = useComposedRefs(forwardedRef, ref);
8027
+ const composedRefs = useComposedRefs$1(forwardedRef, ref);
8027
8028
  const context = useCollectionContext(ITEM_SLOT_NAME, scope);
8028
8029
  React.useEffect(() => {
8029
8030
  context.itemMap.set(ref, { ref, ...itemData });
@@ -8053,18 +8054,18 @@
8053
8054
  createCollectionScope2
8054
8055
  ];
8055
8056
  }
8056
- var useLayoutEffect2 = Boolean(globalThis == null ? void 0 : globalThis.document) ? React__namespace.useLayoutEffect : () => {
8057
+ var useLayoutEffect2$1 = Boolean(globalThis == null ? void 0 : globalThis.document) ? React__namespace.useLayoutEffect : () => {
8057
8058
  };
8058
8059
  var useReactId = React__namespace["useId".toString()] || (() => void 0);
8059
8060
  var count = 0;
8060
8061
  function useId(deterministicId) {
8061
8062
  const [id, setId] = React__namespace.useState(useReactId());
8062
- useLayoutEffect2(() => {
8063
+ useLayoutEffect2$1(() => {
8063
8064
  setId((reactId) => reactId ?? String(count++));
8064
8065
  }, [deterministicId]);
8065
8066
  return id ? `radix-${id}` : "";
8066
8067
  }
8067
- function useCallbackRef(callback) {
8068
+ function useCallbackRef$1(callback) {
8068
8069
  const callbackRef = React__namespace.useRef(callback);
8069
8070
  React__namespace.useEffect(() => {
8070
8071
  callbackRef.current = callback;
@@ -8074,16 +8075,16 @@
8074
8075
  return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
8075
8076
  }, []);
8076
8077
  }
8077
- function useControllableState({
8078
+ function useControllableState$1({
8078
8079
  prop,
8079
8080
  defaultProp,
8080
8081
  onChange = () => {
8081
8082
  }
8082
8083
  }) {
8083
- const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
8084
+ const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState$1({ defaultProp, onChange });
8084
8085
  const isControlled = prop !== void 0;
8085
8086
  const value = isControlled ? prop : uncontrolledProp;
8086
- const handleChange = useCallbackRef(onChange);
8087
+ const handleChange = useCallbackRef$1(onChange);
8087
8088
  const setValue = React__namespace.useCallback(
8088
8089
  (nextValue) => {
8089
8090
  if (isControlled) {
@@ -8098,14 +8099,14 @@
8098
8099
  );
8099
8100
  return [value, setValue];
8100
8101
  }
8101
- function useUncontrolledState({
8102
+ function useUncontrolledState$1({
8102
8103
  defaultProp,
8103
8104
  onChange
8104
8105
  }) {
8105
8106
  const uncontrolledState = React__namespace.useState(defaultProp);
8106
8107
  const [value] = uncontrolledState;
8107
8108
  const prevValueRef = React__namespace.useRef(value);
8108
- const handleChange = useCallbackRef(onChange);
8109
+ const handleChange = useCallbackRef$1(onChange);
8109
8110
  React__namespace.useEffect(() => {
8110
8111
  if (prevValueRef.current !== value) {
8111
8112
  handleChange(value);
@@ -8123,7 +8124,7 @@
8123
8124
  var EVENT_OPTIONS = { bubbles: false, cancelable: true };
8124
8125
  var GROUP_NAME = "RovingFocusGroup";
8125
8126
  var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
8126
- var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
8127
+ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope$1(
8127
8128
  GROUP_NAME,
8128
8129
  [createCollectionScope]
8129
8130
  );
@@ -8148,15 +8149,15 @@
8148
8149
  ...groupProps
8149
8150
  } = props;
8150
8151
  const ref = React__namespace.useRef(null);
8151
- const composedRefs = useComposedRefs(forwardedRef, ref);
8152
+ const composedRefs = useComposedRefs$1(forwardedRef, ref);
8152
8153
  const direction = useDirection(dir);
8153
- const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({
8154
+ const [currentTabStopId = null, setCurrentTabStopId] = useControllableState$1({
8154
8155
  prop: currentTabStopIdProp,
8155
8156
  defaultProp: defaultCurrentTabStopId,
8156
8157
  onChange: onCurrentTabStopIdChange
8157
8158
  });
8158
8159
  const [isTabbingBackOut, setIsTabbingBackOut] = React__namespace.useState(false);
8159
- const handleEntryFocus = useCallbackRef(onEntryFocus);
8160
+ const handleEntryFocus = useCallbackRef$1(onEntryFocus);
8160
8161
  const getItems = useCollection(__scopeRovingFocusGroup);
8161
8162
  const isClickFocusRef = React__namespace.useRef(false);
8162
8163
  const [focusableItemsCount, setFocusableItemsCount] = React__namespace.useState(0);
@@ -8189,17 +8190,17 @@
8189
8190
  []
8190
8191
  ),
8191
8192
  children: /* @__PURE__ */ jsxRuntime.jsx(
8192
- Primitive.div,
8193
+ Primitive$1.div,
8193
8194
  {
8194
8195
  tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
8195
8196
  "data-orientation": orientation,
8196
8197
  ...groupProps,
8197
8198
  ref: composedRefs,
8198
8199
  style: { outline: "none", ...props.style },
8199
- onMouseDown: composeEventHandlers(props.onMouseDown, () => {
8200
+ onMouseDown: composeEventHandlers$1(props.onMouseDown, () => {
8200
8201
  isClickFocusRef.current = true;
8201
8202
  }),
8202
- onFocus: composeEventHandlers(props.onFocus, (event) => {
8203
+ onFocus: composeEventHandlers$1(props.onFocus, (event) => {
8203
8204
  const isKeyboardFocus = !isClickFocusRef.current;
8204
8205
  if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
8205
8206
  const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
@@ -8217,7 +8218,7 @@
8217
8218
  }
8218
8219
  isClickFocusRef.current = false;
8219
8220
  }),
8220
- onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
8221
+ onBlur: composeEventHandlers$1(props.onBlur, () => setIsTabbingBackOut(false))
8221
8222
  }
8222
8223
  )
8223
8224
  }
@@ -8253,18 +8254,18 @@
8253
8254
  focusable,
8254
8255
  active,
8255
8256
  children: /* @__PURE__ */ jsxRuntime.jsx(
8256
- Primitive.span,
8257
+ Primitive$1.span,
8257
8258
  {
8258
8259
  tabIndex: isCurrentTabStop ? 0 : -1,
8259
8260
  "data-orientation": context.orientation,
8260
8261
  ...itemProps,
8261
8262
  ref: forwardedRef,
8262
- onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
8263
+ onMouseDown: composeEventHandlers$1(props.onMouseDown, (event) => {
8263
8264
  if (!focusable) event.preventDefault();
8264
8265
  else context.onItemFocus(id);
8265
8266
  }),
8266
- onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
8267
- onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
8267
+ onFocus: composeEventHandlers$1(props.onFocus, () => context.onItemFocus(id)),
8268
+ onKeyDown: composeEventHandlers$1(props.onKeyDown, (event) => {
8268
8269
  if (event.key === "Tab" && event.shiftKey) {
8269
8270
  context.onItemShiftTab();
8270
8271
  return;
@@ -8323,10 +8324,10 @@
8323
8324
  function wrapArray(array, startIndex) {
8324
8325
  return array.map((_, index2) => array[(startIndex + index2) % array.length]);
8325
8326
  }
8326
- var Root = RovingFocusGroup;
8327
+ var Root$1 = RovingFocusGroup;
8327
8328
  var Item = RovingFocusGroupItem;
8328
8329
  var TOGGLE_GROUP_NAME = "ToggleGroup";
8329
- var [createToggleGroupContext, createToggleGroupScope] = createContextScope(TOGGLE_GROUP_NAME, [
8330
+ var [createToggleGroupContext, createToggleGroupScope] = createContextScope$1(TOGGLE_GROUP_NAME, [
8330
8331
  createRovingFocusGroupScope
8331
8332
  ]);
8332
8333
  var useRovingFocusGroupScope = createRovingFocusGroupScope();
@@ -8352,7 +8353,7 @@
8352
8353
  },
8353
8354
  ...toggleGroupSingleProps
8354
8355
  } = props;
8355
- const [value, setValue] = useControllableState({
8356
+ const [value, setValue] = useControllableState$1({
8356
8357
  prop: valueProp,
8357
8358
  defaultProp: defaultValue,
8358
8359
  onChange: onValueChange
@@ -8377,7 +8378,7 @@
8377
8378
  },
8378
8379
  ...toggleGroupMultipleProps
8379
8380
  } = props;
8380
- const [value = [], setValue] = useControllableState({
8381
+ const [value = [], setValue] = useControllableState$1({
8381
8382
  prop: valueProp,
8382
8383
  defaultProp: defaultValue,
8383
8384
  onChange: onValueChange
@@ -8419,16 +8420,16 @@
8419
8420
  const direction = useDirection(dir);
8420
8421
  const commonProps = { role: "group", dir: direction, ...toggleGroupProps };
8421
8422
  return /* @__PURE__ */ jsxRuntime.jsx(ToggleGroupContext, { scope: __scopeToggleGroup, rovingFocus, disabled, children: rovingFocus ? /* @__PURE__ */ jsxRuntime.jsx(
8422
- Root,
8423
+ Root$1,
8423
8424
  {
8424
8425
  asChild: true,
8425
8426
  ...rovingFocusGroupScope,
8426
8427
  orientation,
8427
8428
  dir: direction,
8428
8429
  loop,
8429
- children: /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...commonProps, ref: forwardedRef })
8430
+ children: /* @__PURE__ */ jsxRuntime.jsx(Primitive$1.div, { ...commonProps, ref: forwardedRef })
8430
8431
  }
8431
- ) : /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...commonProps, ref: forwardedRef }) });
8432
+ ) : /* @__PURE__ */ jsxRuntime.jsx(Primitive$1.div, { ...commonProps, ref: forwardedRef }) });
8432
8433
  }
8433
8434
  );
8434
8435
  var ITEM_NAME = "ToggleGroupItem";
@@ -8885,6 +8886,563 @@
8885
8886
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-5 rounded-full border border-2 border-(--base-a12) border-b-transparent animate-spin" });
8886
8887
  });
8887
8888
  Spinner.displayName = "Spinner";
8889
+ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
8890
+ return function handleEvent(event) {
8891
+ originalEventHandler == null ? void 0 : originalEventHandler(event);
8892
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) {
8893
+ return ourEventHandler == null ? void 0 : ourEventHandler(event);
8894
+ }
8895
+ };
8896
+ }
8897
+ function setRef(ref, value) {
8898
+ if (typeof ref === "function") {
8899
+ return ref(value);
8900
+ } else if (ref !== null && ref !== void 0) {
8901
+ ref.current = value;
8902
+ }
8903
+ }
8904
+ function composeRefs(...refs) {
8905
+ return (node) => {
8906
+ let hasCleanup = false;
8907
+ const cleanups = refs.map((ref) => {
8908
+ const cleanup = setRef(ref, node);
8909
+ if (!hasCleanup && typeof cleanup == "function") {
8910
+ hasCleanup = true;
8911
+ }
8912
+ return cleanup;
8913
+ });
8914
+ if (hasCleanup) {
8915
+ return () => {
8916
+ for (let i = 0; i < cleanups.length; i++) {
8917
+ const cleanup = cleanups[i];
8918
+ if (typeof cleanup == "function") {
8919
+ cleanup();
8920
+ } else {
8921
+ setRef(refs[i], null);
8922
+ }
8923
+ }
8924
+ };
8925
+ }
8926
+ };
8927
+ }
8928
+ function useComposedRefs(...refs) {
8929
+ return React__namespace.useCallback(composeRefs(...refs), refs);
8930
+ }
8931
+ function createContextScope(scopeName, createContextScopeDeps = []) {
8932
+ let defaultContexts = [];
8933
+ function createContext3(rootComponentName, defaultContext) {
8934
+ const BaseContext = React__namespace.createContext(defaultContext);
8935
+ const index2 = defaultContexts.length;
8936
+ defaultContexts = [...defaultContexts, defaultContext];
8937
+ const Provider2 = (props) => {
8938
+ var _a;
8939
+ const { scope, children, ...context } = props;
8940
+ const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
8941
+ const value = React__namespace.useMemo(() => context, Object.values(context));
8942
+ return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
8943
+ };
8944
+ Provider2.displayName = rootComponentName + "Provider";
8945
+ function useContext2(consumerName, scope) {
8946
+ var _a;
8947
+ const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
8948
+ const context = React__namespace.useContext(Context);
8949
+ if (context) return context;
8950
+ if (defaultContext !== void 0) return defaultContext;
8951
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
8952
+ }
8953
+ return [Provider2, useContext2];
8954
+ }
8955
+ const createScope = () => {
8956
+ const scopeContexts = defaultContexts.map((defaultContext) => {
8957
+ return React__namespace.createContext(defaultContext);
8958
+ });
8959
+ return function useScope(scope) {
8960
+ const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
8961
+ return React__namespace.useMemo(
8962
+ () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
8963
+ [scope, contexts]
8964
+ );
8965
+ };
8966
+ };
8967
+ createScope.scopeName = scopeName;
8968
+ return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
8969
+ }
8970
+ function composeContextScopes(...scopes) {
8971
+ const baseScope = scopes[0];
8972
+ if (scopes.length === 1) return baseScope;
8973
+ const createScope = () => {
8974
+ const scopeHooks = scopes.map((createScope2) => ({
8975
+ useScope: createScope2(),
8976
+ scopeName: createScope2.scopeName
8977
+ }));
8978
+ return function useComposedScopes(overrideScopes) {
8979
+ const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
8980
+ const scopeProps = useScope(overrideScopes);
8981
+ const currentScope = scopeProps[`__scope${scopeName}`];
8982
+ return { ...nextScopes2, ...currentScope };
8983
+ }, {});
8984
+ return React__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
8985
+ };
8986
+ };
8987
+ createScope.scopeName = baseScope.scopeName;
8988
+ return createScope;
8989
+ }
8990
+ function useCallbackRef(callback) {
8991
+ const callbackRef = React__namespace.useRef(callback);
8992
+ React__namespace.useEffect(() => {
8993
+ callbackRef.current = callback;
8994
+ });
8995
+ return React__namespace.useMemo(() => (...args) => {
8996
+ var _a;
8997
+ return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
8998
+ }, []);
8999
+ }
9000
+ function useControllableState({
9001
+ prop,
9002
+ defaultProp,
9003
+ onChange = () => {
9004
+ }
9005
+ }) {
9006
+ const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
9007
+ const isControlled = prop !== void 0;
9008
+ const value = isControlled ? prop : uncontrolledProp;
9009
+ const handleChange = useCallbackRef(onChange);
9010
+ const setValue = React__namespace.useCallback(
9011
+ (nextValue) => {
9012
+ if (isControlled) {
9013
+ const setter = nextValue;
9014
+ const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
9015
+ if (value2 !== prop) handleChange(value2);
9016
+ } else {
9017
+ setUncontrolledProp(nextValue);
9018
+ }
9019
+ },
9020
+ [isControlled, prop, setUncontrolledProp, handleChange]
9021
+ );
9022
+ return [value, setValue];
9023
+ }
9024
+ function useUncontrolledState({
9025
+ defaultProp,
9026
+ onChange
9027
+ }) {
9028
+ const uncontrolledState = React__namespace.useState(defaultProp);
9029
+ const [value] = uncontrolledState;
9030
+ const prevValueRef = React__namespace.useRef(value);
9031
+ const handleChange = useCallbackRef(onChange);
9032
+ React__namespace.useEffect(() => {
9033
+ if (prevValueRef.current !== value) {
9034
+ handleChange(value);
9035
+ prevValueRef.current = value;
9036
+ }
9037
+ }, [value, prevValueRef, handleChange]);
9038
+ return uncontrolledState;
9039
+ }
9040
+ function usePrevious(value) {
9041
+ const ref = React__namespace.useRef({ value, previous: value });
9042
+ return React__namespace.useMemo(() => {
9043
+ if (ref.current.value !== value) {
9044
+ ref.current.previous = ref.current.value;
9045
+ ref.current.value = value;
9046
+ }
9047
+ return ref.current.previous;
9048
+ }, [value]);
9049
+ }
9050
+ var useLayoutEffect2 = Boolean(globalThis == null ? void 0 : globalThis.document) ? React__namespace.useLayoutEffect : () => {
9051
+ };
9052
+ function useSize(element) {
9053
+ const [size2, setSize] = React__namespace.useState(void 0);
9054
+ useLayoutEffect2(() => {
9055
+ if (element) {
9056
+ setSize({ width: element.offsetWidth, height: element.offsetHeight });
9057
+ const resizeObserver = new ResizeObserver((entries) => {
9058
+ if (!Array.isArray(entries)) {
9059
+ return;
9060
+ }
9061
+ if (!entries.length) {
9062
+ return;
9063
+ }
9064
+ const entry = entries[0];
9065
+ let width;
9066
+ let height;
9067
+ if ("borderBoxSize" in entry) {
9068
+ const borderSizeEntry = entry["borderBoxSize"];
9069
+ const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
9070
+ width = borderSize["inlineSize"];
9071
+ height = borderSize["blockSize"];
9072
+ } else {
9073
+ width = element.offsetWidth;
9074
+ height = element.offsetHeight;
9075
+ }
9076
+ setSize({ width, height });
9077
+ });
9078
+ resizeObserver.observe(element, { box: "border-box" });
9079
+ return () => resizeObserver.unobserve(element);
9080
+ } else {
9081
+ setSize(void 0);
9082
+ }
9083
+ }, [element]);
9084
+ return size2;
9085
+ }
9086
+ var NODES = [
9087
+ "a",
9088
+ "button",
9089
+ "div",
9090
+ "form",
9091
+ "h2",
9092
+ "h3",
9093
+ "img",
9094
+ "input",
9095
+ "label",
9096
+ "li",
9097
+ "nav",
9098
+ "ol",
9099
+ "p",
9100
+ "span",
9101
+ "svg",
9102
+ "ul"
9103
+ ];
9104
+ var Primitive = NODES.reduce((primitive, node) => {
9105
+ const Node2 = React__namespace.forwardRef((props, forwardedRef) => {
9106
+ const { asChild, ...primitiveProps } = props;
9107
+ const Comp = asChild ? reactSlot.Slot : node;
9108
+ if (typeof window !== "undefined") {
9109
+ window[Symbol.for("radix-ui")] = true;
9110
+ }
9111
+ return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
9112
+ });
9113
+ Node2.displayName = `Primitive.${node}`;
9114
+ return { ...primitive, [node]: Node2 };
9115
+ }, {});
9116
+ var SWITCH_NAME = "Switch";
9117
+ var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
9118
+ var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
9119
+ var Switch$1 = React__namespace.forwardRef(
9120
+ (props, forwardedRef) => {
9121
+ const {
9122
+ __scopeSwitch,
9123
+ name,
9124
+ checked: checkedProp,
9125
+ defaultChecked,
9126
+ required,
9127
+ disabled,
9128
+ value = "on",
9129
+ onCheckedChange,
9130
+ form,
9131
+ ...switchProps
9132
+ } = props;
9133
+ const [button, setButton] = React__namespace.useState(null);
9134
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
9135
+ const hasConsumerStoppedPropagationRef = React__namespace.useRef(false);
9136
+ const isFormControl = button ? form || !!button.closest("form") : true;
9137
+ const [checked = false, setChecked] = useControllableState({
9138
+ prop: checkedProp,
9139
+ defaultProp: defaultChecked,
9140
+ onChange: onCheckedChange
9141
+ });
9142
+ return /* @__PURE__ */ jsxRuntime.jsxs(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
9143
+ /* @__PURE__ */ jsxRuntime.jsx(
9144
+ Primitive.button,
9145
+ {
9146
+ type: "button",
9147
+ role: "switch",
9148
+ "aria-checked": checked,
9149
+ "aria-required": required,
9150
+ "data-state": getState(checked),
9151
+ "data-disabled": disabled ? "" : void 0,
9152
+ disabled,
9153
+ value,
9154
+ ...switchProps,
9155
+ ref: composedRefs,
9156
+ onClick: composeEventHandlers(props.onClick, (event) => {
9157
+ setChecked((prevChecked) => !prevChecked);
9158
+ if (isFormControl) {
9159
+ hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
9160
+ if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
9161
+ }
9162
+ })
9163
+ }
9164
+ ),
9165
+ isFormControl && /* @__PURE__ */ jsxRuntime.jsx(
9166
+ BubbleInput,
9167
+ {
9168
+ control: button,
9169
+ bubbles: !hasConsumerStoppedPropagationRef.current,
9170
+ name,
9171
+ value,
9172
+ checked,
9173
+ required,
9174
+ disabled,
9175
+ form,
9176
+ style: { transform: "translateX(-100%)" }
9177
+ }
9178
+ )
9179
+ ] });
9180
+ }
9181
+ );
9182
+ Switch$1.displayName = SWITCH_NAME;
9183
+ var THUMB_NAME = "SwitchThumb";
9184
+ var SwitchThumb$1 = React__namespace.forwardRef(
9185
+ (props, forwardedRef) => {
9186
+ const { __scopeSwitch, ...thumbProps } = props;
9187
+ const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
9188
+ return /* @__PURE__ */ jsxRuntime.jsx(
9189
+ Primitive.span,
9190
+ {
9191
+ "data-state": getState(context.checked),
9192
+ "data-disabled": context.disabled ? "" : void 0,
9193
+ ...thumbProps,
9194
+ ref: forwardedRef
9195
+ }
9196
+ );
9197
+ }
9198
+ );
9199
+ SwitchThumb$1.displayName = THUMB_NAME;
9200
+ var BubbleInput = (props) => {
9201
+ const { control, checked, bubbles = true, ...inputProps } = props;
9202
+ const ref = React__namespace.useRef(null);
9203
+ const prevChecked = usePrevious(checked);
9204
+ const controlSize = useSize(control);
9205
+ React__namespace.useEffect(() => {
9206
+ const input = ref.current;
9207
+ const inputProto = window.HTMLInputElement.prototype;
9208
+ const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
9209
+ const setChecked = descriptor.set;
9210
+ if (prevChecked !== checked && setChecked) {
9211
+ const event = new Event("click", { bubbles });
9212
+ setChecked.call(input, checked);
9213
+ input.dispatchEvent(event);
9214
+ }
9215
+ }, [prevChecked, checked, bubbles]);
9216
+ return /* @__PURE__ */ jsxRuntime.jsx(
9217
+ "input",
9218
+ {
9219
+ type: "checkbox",
9220
+ "aria-hidden": true,
9221
+ defaultChecked: checked,
9222
+ ...inputProps,
9223
+ tabIndex: -1,
9224
+ ref,
9225
+ style: {
9226
+ ...props.style,
9227
+ ...controlSize,
9228
+ position: "absolute",
9229
+ pointerEvents: "none",
9230
+ opacity: 0,
9231
+ margin: 0
9232
+ }
9233
+ }
9234
+ );
9235
+ };
9236
+ function getState(checked) {
9237
+ return checked ? "checked" : "unchecked";
9238
+ }
9239
+ var Root = Switch$1;
9240
+ var Thumb = SwitchThumb$1;
9241
+ const SwitchContext = React.createContext({});
9242
+ const switchRoot = classVarianceAuthority.cva(
9243
+ [
9244
+ "shrink-0",
9245
+ "overflow-hidden",
9246
+ "relative",
9247
+ "outline-none",
9248
+ "rounded-full",
9249
+ "transition-colors",
9250
+ "ring-1",
9251
+ "ring-(--base-a4)",
9252
+ "bg-(--base-4)",
9253
+ "data-[state=checked]:bg-(--accent-track)",
9254
+ "data-[state=checked]:ring-(--accent-track)"
9255
+ ],
9256
+ {
9257
+ variants: {
9258
+ size: {
9259
+ xs: ["h-5", "w-10"],
9260
+ sm: ["h-6", "w-12"],
9261
+ md: ["h-7", "w-14"],
9262
+ lg: ["h-8", "w-16"],
9263
+ xl: ["h-9", "w-[4.5rem]"]
9264
+ }
9265
+ },
9266
+ defaultVariants: {
9267
+ size: "md"
9268
+ }
9269
+ }
9270
+ );
9271
+ const switchThumb = classVarianceAuthority.cva(
9272
+ [
9273
+ "rounded-full",
9274
+ "block",
9275
+ "flex",
9276
+ "items-center",
9277
+ "justify-center",
9278
+ "transition-transform",
9279
+ "data-[state='checked']:translate-x-[100%]",
9280
+ "bg-(--base-contrast)"
9281
+ ],
9282
+ {
9283
+ variants: {
9284
+ size: {
9285
+ xs: ["h-5", "w-5"],
9286
+ sm: ["h-6", "w-6"],
9287
+ md: ["h-7", "w-7"],
9288
+ lg: ["h-8", "w-8"],
9289
+ xl: ["h-9", "w-9"]
9290
+ }
9291
+ },
9292
+ defaultVariants: {
9293
+ size: "md"
9294
+ }
9295
+ }
9296
+ );
9297
+ const SwitchRoot = React.memo(
9298
+ React.forwardRef((props, ref) => {
9299
+ const providerContext = useProvider();
9300
+ const { className, size: size2 = "md", children, accentColor = providerContext.accentColor, ...rest } = props;
9301
+ return /* @__PURE__ */ jsxRuntime.jsx(
9302
+ Root,
9303
+ {
9304
+ className: classVarianceAuthority.cx(className, switchRoot({ size: size2 })),
9305
+ ref,
9306
+ "data-accent-color": accentColor,
9307
+ ...rest,
9308
+ children: /* @__PURE__ */ jsxRuntime.jsx(SwitchContext.Provider, { value: { size: size2 }, children })
9309
+ }
9310
+ );
9311
+ })
9312
+ );
9313
+ const SwitchThumb = React.memo(
9314
+ React.forwardRef((props, ref) => {
9315
+ const { className, ...rest } = props;
9316
+ const { size: size2 } = React.useContext(SwitchContext);
9317
+ return /* @__PURE__ */ jsxRuntime.jsx(Thumb, { className: classVarianceAuthority.cx(className, switchThumb({ size: size2 })), ref, ...rest });
9318
+ })
9319
+ );
9320
+ const Switch = {
9321
+ Root: SwitchRoot,
9322
+ Thumb: SwitchThumb
9323
+ };
9324
+ const TableBody = React.forwardRef((props, ref) => {
9325
+ const { className, ...rest } = props;
9326
+ return /* @__PURE__ */ jsxRuntime.jsx("tbody", { ref, className: classVarianceAuthority.cx(className), ...rest });
9327
+ });
9328
+ TableBody.displayName = "TableBody";
9329
+ const TableContext = React.createContext({});
9330
+ const tableRootCva = classVarianceAuthority.cva(["text-left border-collapse"], {
9331
+ variants: {
9332
+ variant: {
9333
+ ghost: [],
9334
+ surface: ["border-1", "border-(--accent-a6)", "box-border", "overflow-hidden"]
9335
+ },
9336
+ size: {
9337
+ xs: ["text-xs"],
9338
+ sm: ["text-sm"],
9339
+ md: ["text-md"],
9340
+ lg: ["text-lg"],
9341
+ xl: ["text-xl"]
9342
+ }
9343
+ }
9344
+ });
9345
+ const tableCellCva = classVarianceAuthority.cva([], {
9346
+ variants: {
9347
+ variant: {
9348
+ surface: [],
9349
+ ghost: []
9350
+ },
9351
+ cell: {
9352
+ true: [],
9353
+ false: []
9354
+ },
9355
+ size: {
9356
+ xs: ["p-1"],
9357
+ sm: ["p-2"],
9358
+ md: ["p-3"],
9359
+ lg: ["p-4"],
9360
+ xl: ["p-5"]
9361
+ },
9362
+ border: {
9363
+ grid: ["box-border", "border", "border-(--accent-a6)"],
9364
+ row: ["box-border", "border-b", "border-(--accent-a6)"],
9365
+ col: ["box-border", "border-x", "border-(--accent-a6)"],
9366
+ none: []
9367
+ }
9368
+ },
9369
+ compoundVariants: [
9370
+ {
9371
+ variant: "surface",
9372
+ cell: true,
9373
+ className: ["bg-(--accent-a1)"]
9374
+ },
9375
+ {
9376
+ variant: "surface",
9377
+ cell: false,
9378
+ className: ["bg-(--accent-a2)"]
9379
+ }
9380
+ ]
9381
+ });
9382
+ const TableCell = React.forwardRef((props, ref) => {
9383
+ const { className, ...rest } = props;
9384
+ const { size: size2, border, variant } = React.useContext(TableContext);
9385
+ return /* @__PURE__ */ jsxRuntime.jsx("td", { ref, className: classVarianceAuthority.cx(className, tableCellCva({ size: size2, border, cell: true, variant })), ...rest });
9386
+ });
9387
+ TableCell.displayName = "TableCell";
9388
+ const TableColumnHeaderCell = React.forwardRef(
9389
+ (props, ref) => {
9390
+ const { className, ...rest } = props;
9391
+ const { size: size2, border, variant } = React.useContext(TableContext);
9392
+ return /* @__PURE__ */ jsxRuntime.jsx("th", { ref, className: classVarianceAuthority.cx(className, tableCellCva({ size: size2, border, cell: false, variant })), ...rest });
9393
+ }
9394
+ );
9395
+ TableColumnHeaderCell.displayName = "TableColumnHeaderCell";
9396
+ const TableFooter = React.forwardRef((props, ref) => {
9397
+ const { className, ...rest } = props;
9398
+ return /* @__PURE__ */ jsxRuntime.jsx("tfoot", { ref, className: classVarianceAuthority.cx(className), ...rest });
9399
+ });
9400
+ TableFooter.displayName = "TableFooter";
9401
+ const TableHeader = React.forwardRef((props, ref) => {
9402
+ const { className, ...rest } = props;
9403
+ return /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: classVarianceAuthority.cx(className), ...rest });
9404
+ });
9405
+ TableHeader.displayName = "TableHeader";
9406
+ const TableRoot = React.forwardRef((props, ref) => {
9407
+ const providerContext = useProvider();
9408
+ const { children, className, size: size2 = "md", border = "row", accentColor = "base", variant = "ghost", ...rest } = props;
9409
+ return /* @__PURE__ */ jsxRuntime.jsx(
9410
+ "table",
9411
+ {
9412
+ ref,
9413
+ className: classVarianceAuthority.cx(
9414
+ className,
9415
+ tableRootCva({ size: size2, variant }),
9416
+ radiusCva({ radius: providerContext.radius, maxLarge: true })
9417
+ ),
9418
+ "data-accent-color": accentColor,
9419
+ ...rest,
9420
+ children: /* @__PURE__ */ jsxRuntime.jsx(TableContext.Provider, { value: { size: size2, border, variant }, children })
9421
+ }
9422
+ );
9423
+ });
9424
+ TableRoot.displayName = "TableRoot";
9425
+ const TableRow = React.forwardRef((props, ref) => {
9426
+ const { className, ...rest } = props;
9427
+ return /* @__PURE__ */ jsxRuntime.jsx("tr", { ref, className: classVarianceAuthority.cx(className), ...rest });
9428
+ });
9429
+ TableRow.displayName = "TableRow";
9430
+ const TableRowHeaderCell = React.forwardRef((props, ref) => {
9431
+ const { className, ...rest } = props;
9432
+ const { size: size2, border, variant } = React.useContext(TableContext);
9433
+ return /* @__PURE__ */ jsxRuntime.jsx("th", { ref, className: classVarianceAuthority.cx(className, tableCellCva({ size: size2, border, cell: true, variant })), ...rest });
9434
+ });
9435
+ TableRowHeaderCell.displayName = "TableRow";
9436
+ const Table = {
9437
+ Root: TableRoot,
9438
+ Header: TableHeader,
9439
+ Body: TableBody,
9440
+ Footer: TableFooter,
9441
+ Row: TableRow,
9442
+ Cell: TableCell,
9443
+ RowHeaderCell: TableRowHeaderCell,
9444
+ ColumnHeaderCell: TableColumnHeaderCell
9445
+ };
8888
9446
  const TabsListContext = React.createContext({});
8889
9447
  const tabsListCva = classVarianceAuthority.cva(["flex", "border-box", "inset-shadow-[0_-1px_0_0_var(--base-a6)]"], {
8890
9448
  variants: {
@@ -9539,6 +10097,18 @@
9539
10097
  exports2.SlideOutV2 = SlideOutV2;
9540
10098
  exports2.SlideOutV3 = SlideOutV3;
9541
10099
  exports2.Spinner = Spinner;
10100
+ exports2.Switch = Switch;
10101
+ exports2.SwitchRoot = SwitchRoot;
10102
+ exports2.SwitchThumb = SwitchThumb;
10103
+ exports2.Table = Table;
10104
+ exports2.TableBody = TableBody;
10105
+ exports2.TableCell = TableCell;
10106
+ exports2.TableColumnHeaderCell = TableColumnHeaderCell;
10107
+ exports2.TableFooter = TableFooter;
10108
+ exports2.TableHeader = TableHeader;
10109
+ exports2.TableRoot = TableRoot;
10110
+ exports2.TableRow = TableRow;
10111
+ exports2.TableRowHeaderCell = TableRowHeaderCell;
9542
10112
  exports2.Tabs = Tabs;
9543
10113
  exports2.TabsList = TabsList;
9544
10114
  exports2.TabsRoot = TabsRoot;
@@ -9563,7 +10133,7 @@
9563
10133
  exports2.usePagesContext = usePagesContext;
9564
10134
  exports2.useProvider = useProvider;
9565
10135
  exports2.useSelectedIndicatorContext = useSelectedIndicatorContext;
9566
- exports2.useSize = useSize;
10136
+ exports2.useSize = useSize$1;
9567
10137
  exports2.useStopEventPropagation = useStopEventPropagation;
9568
10138
  exports2.useSubContext = useSubContext;
9569
10139
  exports2.useTextFilter = useTextFilter;