@nswds/app 1.48.2 → 1.49.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/index.js CHANGED
@@ -32,7 +32,7 @@ import { useCopyToClipboard } from '@uidotdev/usehooks';
32
32
  import { Toaster as Toaster$1, toast } from 'sonner';
33
33
  import * as LabelPrimitive from '@radix-ui/react-label';
34
34
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
35
- import { CircleIcon, ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon, ArrowLeft, ArrowRight, MinusIcon, Layers, Hash } from 'lucide-react';
35
+ import { CircleIcon, ArrowLeft, ArrowRight, MinusIcon, Layers, Hash } from 'lucide-react';
36
36
  import * as TabsPrimitive2 from '@radix-ui/react-tabs';
37
37
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
38
38
  import { Command as Command$1 } from 'cmdk';
@@ -7731,7 +7731,7 @@ function Heading({
7731
7731
 
7732
7732
  // package.json
7733
7733
  var package_default = {
7734
- version: "1.47.0"};
7734
+ version: "1.48.3"};
7735
7735
  function Logo(props) {
7736
7736
  return /* @__PURE__ */ jsxs(Fragment, { children: [
7737
7737
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "NSW Government" }),
@@ -9406,7 +9406,7 @@ function findSpring({ duration = springDefaults.duration, bounce = springDefault
9406
9406
  envelope = (undampedFreq2) => {
9407
9407
  const a = Math.exp(-undampedFreq2 * duration);
9408
9408
  const b = (undampedFreq2 - velocity) * duration + 1;
9409
- return -1e-3 + a * b;
9409
+ return -safeMin + a * b;
9410
9410
  };
9411
9411
  derivative = (undampedFreq2) => {
9412
9412
  const a = Math.exp(-undampedFreq2 * duration);
@@ -12673,7 +12673,7 @@ function animateVariant(visualElement, variant, options = {}) {
12673
12673
  const getAnimation = resolved ? () => Promise.all(animateTarget(visualElement, resolved, options)) : () => Promise.resolve();
12674
12674
  const getChildAnimations = visualElement.variantChildren && visualElement.variantChildren.size ? (forwardDelay = 0) => {
12675
12675
  const { delayChildren = 0, staggerChildren, staggerDirection } = transition;
12676
- return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options);
12676
+ return animateChildren(visualElement, variant, forwardDelay, delayChildren, staggerChildren, staggerDirection, options);
12677
12677
  } : () => Promise.resolve();
12678
12678
  const { when } = transition;
12679
12679
  if (when) {
@@ -12683,15 +12683,20 @@ function animateVariant(visualElement, variant, options = {}) {
12683
12683
  return Promise.all([getAnimation(), getChildAnimations(options.delay)]);
12684
12684
  }
12685
12685
  }
12686
- function animateChildren(visualElement, variant, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {
12686
+ function animateChildren(visualElement, variant, delay2 = 0, delayChildren = 0, staggerChildren = 0, staggerDirection = 1, options) {
12687
12687
  const animations2 = [];
12688
- const maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren;
12689
- const generateStaggerDuration = staggerDirection === 1 ? (i = 0) => i * staggerChildren : (i = 0) => maxStaggerDuration - i * staggerChildren;
12688
+ const numChildren = visualElement.variantChildren.size;
12689
+ const maxStaggerDuration = (numChildren - 1) * staggerChildren;
12690
+ const delayIsFunction = typeof delayChildren === "function";
12691
+ const generateStaggerDuration = delayIsFunction ? (i) => delayChildren(i, numChildren) : (
12692
+ // Support deprecated staggerChildren
12693
+ staggerDirection === 1 ? (i = 0) => i * staggerChildren : (i = 0) => maxStaggerDuration - i * staggerChildren
12694
+ );
12690
12695
  Array.from(visualElement.variantChildren).sort(sortByTreeOrder).forEach((child, i) => {
12691
12696
  child.notify("AnimationStart", variant);
12692
12697
  animations2.push(animateVariant(child, variant, {
12693
12698
  ...options,
12694
- delay: delayChildren + generateStaggerDuration(i)
12699
+ delay: delay2 + (delayIsFunction ? 0 : delayChildren) + generateStaggerDuration(i)
12695
12700
  }).then(() => child.notify("AnimationComplete", variant)));
12696
12701
  });
12697
12702
  return Promise.all(animations2);
@@ -13266,7 +13271,7 @@ function distance2D(a, b) {
13266
13271
 
13267
13272
  // node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs
13268
13273
  var PanSession = class {
13269
- constructor(event, handlers, { transformPagePoint, contextWindow, dragSnapToOrigin = false } = {}) {
13274
+ constructor(event, handlers, { transformPagePoint, contextWindow = window, dragSnapToOrigin = false, distanceThreshold = 3 } = {}) {
13270
13275
  this.startEvent = null;
13271
13276
  this.lastMoveEvent = null;
13272
13277
  this.lastMoveEventInfo = null;
@@ -13277,7 +13282,7 @@ var PanSession = class {
13277
13282
  return;
13278
13283
  const info2 = getPanInfo(this.lastMoveEventInfo, this.history);
13279
13284
  const isPanStarted = this.startEvent !== null;
13280
- const isDistancePastThreshold = distance2D(info2.offset, { x: 0, y: 0 }) >= 3;
13285
+ const isDistancePastThreshold = distance2D(info2.offset, { x: 0, y: 0 }) >= this.distanceThreshold;
13281
13286
  if (!isPanStarted && !isDistancePastThreshold)
13282
13287
  return;
13283
13288
  const { point: point2 } = info2;
@@ -13313,6 +13318,7 @@ var PanSession = class {
13313
13318
  this.dragSnapToOrigin = dragSnapToOrigin;
13314
13319
  this.handlers = handlers;
13315
13320
  this.transformPagePoint = transformPagePoint;
13321
+ this.distanceThreshold = distanceThreshold;
13316
13322
  this.contextWindow = contextWindow || window;
13317
13323
  const info = extractEventInfo(event);
13318
13324
  const initialInfo = transformPoint(info, this.transformPagePoint);
@@ -13474,9 +13480,11 @@ var VisualElementDragControls = class {
13474
13480
  this.constraints = false;
13475
13481
  this.hasMutatedConstraints = false;
13476
13482
  this.elastic = createBox();
13483
+ this.latestPointerEvent = null;
13484
+ this.latestPanInfo = null;
13477
13485
  this.visualElement = visualElement;
13478
13486
  }
13479
- start(originEvent, { snapToCursor = false } = {}) {
13487
+ start(originEvent, { snapToCursor = false, distanceThreshold } = {}) {
13480
13488
  const { presenceContext } = this.visualElement;
13481
13489
  if (presenceContext && presenceContext.isPresent === false)
13482
13490
  return;
@@ -13496,6 +13504,8 @@ var VisualElementDragControls = class {
13496
13504
  if (!this.openDragLock)
13497
13505
  return;
13498
13506
  }
13507
+ this.latestPointerEvent = event;
13508
+ this.latestPanInfo = info;
13499
13509
  this.isDragging = true;
13500
13510
  this.currentDirection = null;
13501
13511
  this.resolveConstraints();
@@ -13525,6 +13535,8 @@ var VisualElementDragControls = class {
13525
13535
  animationState && animationState.setActive("whileDrag", true);
13526
13536
  };
13527
13537
  const onMove = (event, info) => {
13538
+ this.latestPointerEvent = event;
13539
+ this.latestPanInfo = info;
13528
13540
  const { dragPropagation, dragDirectionLock, onDirectionLock, onDrag } = this.getProps();
13529
13541
  if (!dragPropagation && !this.openDragLock)
13530
13542
  return;
@@ -13541,7 +13553,13 @@ var VisualElementDragControls = class {
13541
13553
  this.visualElement.render();
13542
13554
  onDrag && onDrag(event, info);
13543
13555
  };
13544
- const onSessionEnd = (event, info) => this.stop(event, info);
13556
+ const onSessionEnd = (event, info) => {
13557
+ this.latestPointerEvent = event;
13558
+ this.latestPanInfo = info;
13559
+ this.stop(event, info);
13560
+ this.latestPointerEvent = null;
13561
+ this.latestPanInfo = null;
13562
+ };
13545
13563
  const resumeAnimation = () => eachAxis((axis) => this.getAnimationState(axis) === "paused" && this.getAxisMotionValue(axis).animation?.play());
13546
13564
  const { dragSnapToOrigin } = this.getProps();
13547
13565
  this.panSession = new PanSession(originEvent, {
@@ -13553,21 +13571,30 @@ var VisualElementDragControls = class {
13553
13571
  }, {
13554
13572
  transformPagePoint: this.visualElement.getTransformPagePoint(),
13555
13573
  dragSnapToOrigin,
13574
+ distanceThreshold,
13556
13575
  contextWindow: getContextWindow(this.visualElement)
13557
13576
  });
13558
13577
  }
13559
- stop(event, info) {
13578
+ /**
13579
+ * @internal
13580
+ */
13581
+ stop(event, panInfo) {
13582
+ const finalEvent = event || this.latestPointerEvent;
13583
+ const finalPanInfo = panInfo || this.latestPanInfo;
13560
13584
  const isDragging2 = this.isDragging;
13561
13585
  this.cancel();
13562
- if (!isDragging2)
13586
+ if (!isDragging2 || !finalPanInfo || !finalEvent)
13563
13587
  return;
13564
- const { velocity } = info;
13588
+ const { velocity } = finalPanInfo;
13565
13589
  this.startAnimation(velocity);
13566
13590
  const { onDragEnd } = this.getProps();
13567
13591
  if (onDragEnd) {
13568
- frame.postRender(() => onDragEnd(event, info));
13592
+ frame.postRender(() => onDragEnd(finalEvent, finalPanInfo));
13569
13593
  }
13570
13594
  }
13595
+ /**
13596
+ * @internal
13597
+ */
13571
13598
  cancel() {
13572
13599
  this.isDragging = false;
13573
13600
  const { projection, animationState } = this.visualElement;
@@ -13931,6 +13958,7 @@ var correctBoxShadow = {
13931
13958
  };
13932
13959
 
13933
13960
  // node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs
13961
+ var hasTakenAnySnapshot = false;
13934
13962
  var MeasureLayoutWithContext = class extends Component {
13935
13963
  /**
13936
13964
  * This only mounts projection nodes for components that
@@ -13947,7 +13975,9 @@ var MeasureLayoutWithContext = class extends Component {
13947
13975
  if (switchLayoutGroup && switchLayoutGroup.register && layoutId) {
13948
13976
  switchLayoutGroup.register(projection);
13949
13977
  }
13950
- projection.root.didUpdate();
13978
+ if (hasTakenAnySnapshot) {
13979
+ projection.root.didUpdate();
13980
+ }
13951
13981
  projection.addEventListener("animationComplete", () => {
13952
13982
  this.safeToRemove();
13953
13983
  });
@@ -13964,6 +13994,7 @@ var MeasureLayoutWithContext = class extends Component {
13964
13994
  if (!projection)
13965
13995
  return null;
13966
13996
  projection.isPresent = isPresent;
13997
+ hasTakenAnySnapshot = true;
13967
13998
  if (drag2 || prevProps.layoutDependency !== layoutDependency || layoutDependency === void 0 || prevProps.isPresent !== isPresent) {
13968
13999
  projection.willUpdate();
13969
14000
  } else {
@@ -14331,7 +14362,6 @@ function buildProjectionTransform(delta, treeScale, latestTransform) {
14331
14362
  return transform || "none";
14332
14363
  }
14333
14364
  var transformAxes = ["", "X", "Y", "Z"];
14334
- var hiddenVisibility = { visibility: "hidden" };
14335
14365
  var animationTarget = 1e3;
14336
14366
  var id2 = 0;
14337
14367
  function resetDistortingTransform(key, visualElement, values, sharedAnimationValues) {
@@ -14366,6 +14396,7 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
14366
14396
  constructor(latestValues = {}, parent = defaultParent?.()) {
14367
14397
  this.id = id2++;
14368
14398
  this.animationId = 0;
14399
+ this.animationCommitId = 0;
14369
14400
  this.children = /* @__PURE__ */ new Set();
14370
14401
  this.options = {};
14371
14402
  this.isTreeAnimating = false;
@@ -14448,8 +14479,16 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
14448
14479
  }
14449
14480
  if (attachResizeListener) {
14450
14481
  let cancelDelay;
14482
+ let innerWidth = 0;
14451
14483
  const resizeUnblockUpdate = () => this.root.updateBlockedByResize = false;
14484
+ frame.read(() => {
14485
+ innerWidth = window.innerWidth;
14486
+ });
14452
14487
  attachResizeListener(instance, () => {
14488
+ const newInnerWidth = window.innerWidth;
14489
+ if (newInnerWidth === innerWidth)
14490
+ return;
14491
+ innerWidth = newInnerWidth;
14453
14492
  this.root.updateBlockedByResize = true;
14454
14493
  cancelDelay && cancelDelay();
14455
14494
  cancelDelay = delay(resizeUnblockUpdate, 250);
@@ -14574,13 +14613,19 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
14574
14613
  this.nodes.forEach(clearMeasurements);
14575
14614
  return;
14576
14615
  }
14616
+ if (this.animationId <= this.animationCommitId) {
14617
+ this.nodes.forEach(clearIsLayoutDirty);
14618
+ return;
14619
+ }
14620
+ this.animationCommitId = this.animationId;
14577
14621
  if (!this.isUpdating) {
14578
14622
  this.nodes.forEach(clearIsLayoutDirty);
14623
+ } else {
14624
+ this.isUpdating = false;
14625
+ this.nodes.forEach(resetTransformStyle);
14626
+ this.nodes.forEach(updateLayout);
14627
+ this.nodes.forEach(notifyLayoutUpdate);
14579
14628
  }
14580
- this.isUpdating = false;
14581
- this.nodes.forEach(resetTransformStyle);
14582
- this.nodes.forEach(updateLayout);
14583
- this.nodes.forEach(notifyLayoutUpdate);
14584
14629
  this.clearAllSnapshots();
14585
14630
  const now2 = time.now();
14586
14631
  frameData.delta = clamp(0, 1e3 / 60, now2 - frameData.timestamp);
@@ -15127,71 +15172,70 @@ function createProjectionNode2({ attachResizeListener, defaultParent, measureScr
15127
15172
  }
15128
15173
  visualElement.scheduleRender();
15129
15174
  }
15130
- getProjectionStyles(styleProp) {
15175
+ applyProjectionStyles(targetStyle, styleProp) {
15131
15176
  if (!this.instance || this.isSVG)
15132
- return void 0;
15177
+ return;
15133
15178
  if (!this.isVisible) {
15134
- return hiddenVisibility;
15179
+ targetStyle.visibility = "hidden";
15180
+ return;
15135
15181
  }
15136
- const styles4 = {
15137
- visibility: ""
15138
- };
15139
15182
  const transformTemplate = this.getTransformTemplate();
15140
15183
  if (this.needsReset) {
15141
15184
  this.needsReset = false;
15142
- styles4.opacity = "";
15143
- styles4.pointerEvents = resolveMotionValue(styleProp?.pointerEvents) || "";
15144
- styles4.transform = transformTemplate ? transformTemplate(this.latestValues, "") : "none";
15145
- return styles4;
15185
+ targetStyle.visibility = "";
15186
+ targetStyle.opacity = "";
15187
+ targetStyle.pointerEvents = resolveMotionValue(styleProp?.pointerEvents) || "";
15188
+ targetStyle.transform = transformTemplate ? transformTemplate(this.latestValues, "") : "none";
15189
+ return;
15146
15190
  }
15147
15191
  const lead = this.getLead();
15148
15192
  if (!this.projectionDelta || !this.layout || !lead.target) {
15149
- const emptyStyles = {};
15150
15193
  if (this.options.layoutId) {
15151
- emptyStyles.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1;
15152
- emptyStyles.pointerEvents = resolveMotionValue(styleProp?.pointerEvents) || "";
15194
+ targetStyle.opacity = this.latestValues.opacity !== void 0 ? this.latestValues.opacity : 1;
15195
+ targetStyle.pointerEvents = resolveMotionValue(styleProp?.pointerEvents) || "";
15153
15196
  }
15154
15197
  if (this.hasProjected && !hasTransform(this.latestValues)) {
15155
- emptyStyles.transform = transformTemplate ? transformTemplate({}, "") : "none";
15198
+ targetStyle.transform = transformTemplate ? transformTemplate({}, "") : "none";
15156
15199
  this.hasProjected = false;
15157
15200
  }
15158
- return emptyStyles;
15201
+ return;
15159
15202
  }
15203
+ targetStyle.visibility = "";
15160
15204
  const valuesToRender = lead.animationValues || lead.latestValues;
15161
15205
  this.applyTransformsToTarget();
15162
- styles4.transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);
15206
+ let transform = buildProjectionTransform(this.projectionDeltaWithTransform, this.treeScale, valuesToRender);
15163
15207
  if (transformTemplate) {
15164
- styles4.transform = transformTemplate(valuesToRender, styles4.transform);
15208
+ transform = transformTemplate(valuesToRender, transform);
15165
15209
  }
15210
+ targetStyle.transform = transform;
15166
15211
  const { x, y } = this.projectionDelta;
15167
- styles4.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;
15212
+ targetStyle.transformOrigin = `${x.origin * 100}% ${y.origin * 100}% 0`;
15168
15213
  if (lead.animationValues) {
15169
- styles4.opacity = lead === this ? valuesToRender.opacity ?? this.latestValues.opacity ?? 1 : this.preserveOpacity ? this.latestValues.opacity : valuesToRender.opacityExit;
15214
+ targetStyle.opacity = lead === this ? valuesToRender.opacity ?? this.latestValues.opacity ?? 1 : this.preserveOpacity ? this.latestValues.opacity : valuesToRender.opacityExit;
15170
15215
  } else {
15171
- styles4.opacity = lead === this ? valuesToRender.opacity !== void 0 ? valuesToRender.opacity : "" : valuesToRender.opacityExit !== void 0 ? valuesToRender.opacityExit : 0;
15216
+ targetStyle.opacity = lead === this ? valuesToRender.opacity !== void 0 ? valuesToRender.opacity : "" : valuesToRender.opacityExit !== void 0 ? valuesToRender.opacityExit : 0;
15172
15217
  }
15173
15218
  for (const key in scaleCorrectors) {
15174
15219
  if (valuesToRender[key] === void 0)
15175
15220
  continue;
15176
15221
  const { correct, applyTo, isCSSVariable } = scaleCorrectors[key];
15177
- const corrected = styles4.transform === "none" ? valuesToRender[key] : correct(valuesToRender[key], lead);
15222
+ const corrected = transform === "none" ? valuesToRender[key] : correct(valuesToRender[key], lead);
15178
15223
  if (applyTo) {
15179
15224
  const num = applyTo.length;
15180
15225
  for (let i = 0; i < num; i++) {
15181
- styles4[applyTo[i]] = corrected;
15226
+ targetStyle[applyTo[i]] = corrected;
15182
15227
  }
15183
15228
  } else {
15184
15229
  if (isCSSVariable) {
15185
15230
  this.options.visualElement.renderState.vars[key] = corrected;
15186
15231
  } else {
15187
- styles4[key] = corrected;
15232
+ targetStyle[key] = corrected;
15188
15233
  }
15189
15234
  }
15190
15235
  }
15191
15236
  if (this.options.layoutId) {
15192
- styles4.pointerEvents = lead === this ? resolveMotionValue(styleProp?.pointerEvents) || "" : "none";
15237
+ targetStyle.pointerEvents = lead === this ? resolveMotionValue(styleProp?.pointerEvents) || "" : "none";
15193
15238
  }
15194
- return styles4;
15195
15239
  }
15196
15240
  clearSnapshot() {
15197
15241
  this.resumeFrom = this.snapshot = void 0;
@@ -15616,7 +15660,7 @@ function initPrefersReducedMotion() {
15616
15660
  if (window.matchMedia) {
15617
15661
  const motionMediaQuery = window.matchMedia("(prefers-reduced-motion)");
15618
15662
  const setReducedMotionPreferences = () => prefersReducedMotion.current = motionMediaQuery.matches;
15619
- motionMediaQuery.addListener(setReducedMotionPreferences);
15663
+ motionMediaQuery.addEventListener("change", setReducedMotionPreferences);
15620
15664
  setReducedMotionPreferences();
15621
15665
  } else {
15622
15666
  prefersReducedMotion.current = false;
@@ -16040,9 +16084,14 @@ var DOMVisualElement = class extends VisualElement {
16040
16084
 
16041
16085
  // node_modules/framer-motion/dist/es/render/html/utils/render.mjs
16042
16086
  function renderHTML(element, { style, vars }, styleProp, projection) {
16043
- Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));
16044
- for (const key in vars) {
16045
- element.style.setProperty(key, vars[key]);
16087
+ const elementStyle = element.style;
16088
+ let key;
16089
+ for (key in style) {
16090
+ elementStyle[key] = style[key];
16091
+ }
16092
+ projection?.applyProjectionStyles(elementStyle, styleProp);
16093
+ for (key in vars) {
16094
+ elementStyle.setProperty(key, vars[key]);
16046
16095
  }
16047
16096
  }
16048
16097
 
@@ -22334,6 +22383,48 @@ function AlertDialogCancel({
22334
22383
  }
22335
22384
  );
22336
22385
  }
22386
+ var buttonVariants3 = cva(
22387
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive cursor-pointer",
22388
+ {
22389
+ variants: {
22390
+ variant: {
22391
+ default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
22392
+ destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
22393
+ outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
22394
+ secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
22395
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
22396
+ link: "text-primary underline-offset-4 hover:underline"
22397
+ },
22398
+ size: {
22399
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
22400
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
22401
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
22402
+ icon: "size-9"
22403
+ }
22404
+ },
22405
+ defaultVariants: {
22406
+ variant: "default",
22407
+ size: "default"
22408
+ }
22409
+ }
22410
+ );
22411
+ function Button6({
22412
+ className,
22413
+ variant,
22414
+ size,
22415
+ asChild = false,
22416
+ ...props
22417
+ }) {
22418
+ const Comp = asChild ? Slot : "button";
22419
+ return /* @__PURE__ */ jsx(
22420
+ Comp,
22421
+ {
22422
+ "data-slot": "button",
22423
+ className: cn(buttonVariants3({ variant, size, className })),
22424
+ ...props
22425
+ }
22426
+ );
22427
+ }
22337
22428
  function Calendar({
22338
22429
  className,
22339
22430
  classNames,
@@ -22345,7 +22436,6 @@ function Calendar({
22345
22436
  ...props
22346
22437
  }) {
22347
22438
  const defaultClassNames = getDefaultClassNames();
22348
- const buttonColor = "light";
22349
22439
  return /* @__PURE__ */ jsx(
22350
22440
  DayPicker,
22351
22441
  {
@@ -22370,12 +22460,12 @@ function Calendar({
22370
22460
  defaultClassNames.nav
22371
22461
  ),
22372
22462
  button_previous: cn(
22373
- buttonVariants({ variant: buttonVariant }),
22463
+ buttonVariants3({ variant: buttonVariant }),
22374
22464
  "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
22375
22465
  defaultClassNames.button_previous
22376
22466
  ),
22377
22467
  button_next: cn(
22378
- buttonVariants({ variant: buttonVariant }),
22468
+ buttonVariants3({ variant: buttonVariant }),
22379
22469
  "size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",
22380
22470
  defaultClassNames.button_next
22381
22471
  ),
@@ -22434,14 +22524,14 @@ function Calendar({
22434
22524
  },
22435
22525
  Chevron: ({ className: className2, orientation, ...props2 }) => {
22436
22526
  if (orientation === "left") {
22437
- return /* @__PURE__ */ jsx(ChevronLeftIcon, { className: cn("size-4", className2), ...props2 });
22527
+ return /* @__PURE__ */ jsx(Icons.chevron_left, { className: cn("size-4", className2), ...props2 });
22438
22528
  }
22439
22529
  if (orientation === "right") {
22440
- return /* @__PURE__ */ jsx(ChevronRightIcon, { className: cn("size-4", className2), ...props2 });
22530
+ return /* @__PURE__ */ jsx(Icons.chevron_right, { className: cn("size-4", className2), ...props2 });
22441
22531
  }
22442
- return /* @__PURE__ */ jsx(ChevronDownIcon, { className: cn("size-4", className2), ...props2 });
22532
+ return /* @__PURE__ */ jsx(Icons.chevron_down, { className: cn("size-4", className2), ...props2 });
22443
22533
  },
22444
- DayButton: (dayButtonProps) => /* @__PURE__ */ jsx(CalendarDayButton, { ...dayButtonProps, color: buttonColor }),
22534
+ DayButton: CalendarDayButton,
22445
22535
  WeekNumber: ({ children, ...props2 }) => {
22446
22536
  return /* @__PURE__ */ jsx("td", { ...props2, children: /* @__PURE__ */ jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
22447
22537
  },
@@ -22455,8 +22545,6 @@ function CalendarDayButton({
22455
22545
  className,
22456
22546
  day,
22457
22547
  modifiers,
22458
- children,
22459
- color: color2,
22460
22548
  ...props
22461
22549
  }) {
22462
22550
  const defaultClassNames = getDefaultClassNames();
@@ -22465,24 +22553,22 @@ function CalendarDayButton({
22465
22553
  if (modifiers.focused) ref.current?.focus();
22466
22554
  }, [modifiers.focused]);
22467
22555
  return /* @__PURE__ */ jsx(
22468
- Button2,
22556
+ Button6,
22469
22557
  {
22470
22558
  ref,
22471
22559
  variant: "ghost",
22472
22560
  size: "icon",
22473
- color: color2,
22474
22561
  "data-day": day.date.toLocaleDateString(),
22475
22562
  "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
22476
22563
  "data-range-start": modifiers.range_start,
22477
22564
  "data-range-end": modifiers.range_end,
22478
22565
  "data-range-middle": modifiers.range_middle,
22479
22566
  className: cn(
22480
- "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",
22567
+ "data-[selected-single=true]:bg-primary-800 data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[selected-single=true]:text-white [&>span]:text-xs [&>span]:opacity-70",
22481
22568
  defaultClassNames.day,
22482
22569
  className
22483
22570
  ),
22484
- ...props,
22485
- children
22571
+ ...props
22486
22572
  }
22487
22573
  );
22488
22574
  }
@@ -23294,6 +23380,581 @@ function useIsMobile() {
23294
23380
  }, []);
23295
23381
  return !!isMobile;
23296
23382
  }
23383
+ var SIDEBAR_COOKIE_NAME = "sidebar_state";
23384
+ var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
23385
+ var SIDEBAR_WIDTH = "16rem";
23386
+ var SIDEBAR_WIDTH_MOBILE = "18rem";
23387
+ var SIDEBAR_WIDTH_ICON = "3rem";
23388
+ var SIDEBAR_KEYBOARD_SHORTCUT = "b";
23389
+ var SidebarContext = React16.createContext(null);
23390
+ function useSidebar() {
23391
+ const context = React16.useContext(SidebarContext);
23392
+ if (!context) {
23393
+ throw new Error("useSidebar must be used within a SidebarProvider.");
23394
+ }
23395
+ return context;
23396
+ }
23397
+ function SidebarProvider({
23398
+ defaultOpen = true,
23399
+ open: openProp,
23400
+ onOpenChange: setOpenProp,
23401
+ className,
23402
+ style,
23403
+ children,
23404
+ ...props
23405
+ }) {
23406
+ const isMobile = useIsMobile();
23407
+ const [openMobile, setOpenMobile] = React16.useState(false);
23408
+ const [_open, _setOpen] = React16.useState(defaultOpen);
23409
+ const open = openProp ?? _open;
23410
+ const setOpen = React16.useCallback(
23411
+ (value) => {
23412
+ const openState = typeof value === "function" ? value(open) : value;
23413
+ if (setOpenProp) {
23414
+ setOpenProp(openState);
23415
+ } else {
23416
+ _setOpen(openState);
23417
+ }
23418
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
23419
+ },
23420
+ [setOpenProp, open]
23421
+ );
23422
+ const toggleSidebar = React16.useCallback(() => {
23423
+ return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
23424
+ }, [isMobile, setOpen, setOpenMobile]);
23425
+ React16.useEffect(() => {
23426
+ const handleKeyDown = (event) => {
23427
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
23428
+ event.preventDefault();
23429
+ toggleSidebar();
23430
+ }
23431
+ };
23432
+ window.addEventListener("keydown", handleKeyDown);
23433
+ return () => window.removeEventListener("keydown", handleKeyDown);
23434
+ }, [toggleSidebar]);
23435
+ const state = open ? "expanded" : "collapsed";
23436
+ const contextValue = React16.useMemo(
23437
+ () => ({
23438
+ state,
23439
+ open,
23440
+ setOpen,
23441
+ isMobile,
23442
+ openMobile,
23443
+ setOpenMobile,
23444
+ toggleSidebar
23445
+ }),
23446
+ [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
23447
+ );
23448
+ return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx(
23449
+ "div",
23450
+ {
23451
+ "data-slot": "sidebar-wrapper",
23452
+ style: {
23453
+ "--sidebar-width": SIDEBAR_WIDTH,
23454
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
23455
+ ...style
23456
+ },
23457
+ className: cn(
23458
+ "group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
23459
+ className
23460
+ ),
23461
+ ...props,
23462
+ children
23463
+ }
23464
+ ) }) });
23465
+ }
23466
+ function Sidebar({
23467
+ side = "left",
23468
+ variant = "sidebar",
23469
+ collapsible = "offcanvas",
23470
+ className,
23471
+ children,
23472
+ ...props
23473
+ }) {
23474
+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
23475
+ if (collapsible === "none") {
23476
+ return /* @__PURE__ */ jsx(
23477
+ "div",
23478
+ {
23479
+ "data-slot": "sidebar",
23480
+ className: cn(
23481
+ "bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
23482
+ className
23483
+ ),
23484
+ ...props,
23485
+ children
23486
+ }
23487
+ );
23488
+ }
23489
+ if (isMobile) {
23490
+ return /* @__PURE__ */ jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs(
23491
+ SheetContent,
23492
+ {
23493
+ "data-sidebar": "sidebar",
23494
+ "data-slot": "sidebar",
23495
+ "data-mobile": "true",
23496
+ className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
23497
+ style: {
23498
+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE
23499
+ },
23500
+ side,
23501
+ children: [
23502
+ /* @__PURE__ */ jsxs(SheetHeader, { className: "sr-only", children: [
23503
+ /* @__PURE__ */ jsx(SheetTitle, { children: "Sidebar" }),
23504
+ /* @__PURE__ */ jsx(SheetDescription, { children: "Displays the mobile sidebar." })
23505
+ ] }),
23506
+ /* @__PURE__ */ jsx("div", { className: "flex h-full w-full flex-col", children })
23507
+ ]
23508
+ }
23509
+ ) });
23510
+ }
23511
+ return /* @__PURE__ */ jsxs(
23512
+ "div",
23513
+ {
23514
+ className: "group peer text-sidebar-foreground hidden md:block",
23515
+ "data-state": state,
23516
+ "data-collapsible": state === "collapsed" ? collapsible : "",
23517
+ "data-variant": variant,
23518
+ "data-side": side,
23519
+ "data-slot": "sidebar",
23520
+ children: [
23521
+ /* @__PURE__ */ jsx(
23522
+ "div",
23523
+ {
23524
+ "data-slot": "sidebar-gap",
23525
+ className: cn(
23526
+ "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
23527
+ "group-data-[collapsible=offcanvas]:w-0",
23528
+ "group-data-[side=right]:rotate-180",
23529
+ variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
23530
+ )
23531
+ }
23532
+ ),
23533
+ /* @__PURE__ */ jsx(
23534
+ "div",
23535
+ {
23536
+ "data-slot": "sidebar-container",
23537
+ className: cn(
23538
+ "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
23539
+ side === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
23540
+ // Adjust the padding for floating and inset variants.
23541
+ variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
23542
+ className
23543
+ ),
23544
+ ...props,
23545
+ children: /* @__PURE__ */ jsx(
23546
+ "div",
23547
+ {
23548
+ "data-sidebar": "sidebar",
23549
+ "data-slot": "sidebar-inner",
23550
+ className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
23551
+ children
23552
+ }
23553
+ )
23554
+ }
23555
+ )
23556
+ ]
23557
+ }
23558
+ );
23559
+ }
23560
+ function SidebarTrigger({ className, onClick, ...props }) {
23561
+ const { toggleSidebar } = useSidebar();
23562
+ return /* @__PURE__ */ jsxs(
23563
+ Button2,
23564
+ {
23565
+ ...props,
23566
+ "data-sidebar": "trigger",
23567
+ "data-slot": "sidebar-trigger",
23568
+ variant: "ghost",
23569
+ color: "light",
23570
+ size: "icon",
23571
+ className: cn("", className),
23572
+ onClick: (event) => {
23573
+ onClick?.(event);
23574
+ toggleSidebar();
23575
+ },
23576
+ children: [
23577
+ /* @__PURE__ */ jsx(Icons.dock_to_left, {}),
23578
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
23579
+ ]
23580
+ }
23581
+ );
23582
+ }
23583
+ function SidebarRail({ className, ...props }) {
23584
+ const { toggleSidebar } = useSidebar();
23585
+ return /* @__PURE__ */ jsx(
23586
+ "button",
23587
+ {
23588
+ "data-sidebar": "rail",
23589
+ "data-slot": "sidebar-rail",
23590
+ "aria-label": "Toggle Sidebar",
23591
+ tabIndex: -1,
23592
+ onClick: toggleSidebar,
23593
+ title: "Toggle Sidebar",
23594
+ className: cn(
23595
+ "hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex",
23596
+ "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
23597
+ "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
23598
+ "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
23599
+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
23600
+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
23601
+ className
23602
+ ),
23603
+ ...props
23604
+ }
23605
+ );
23606
+ }
23607
+ function SidebarInset({ className, ...props }) {
23608
+ return /* @__PURE__ */ jsx(
23609
+ "main",
23610
+ {
23611
+ "data-slot": "sidebar-inset",
23612
+ className: cn(
23613
+ "bg-background relative flex w-full flex-1 flex-col",
23614
+ "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
23615
+ className
23616
+ ),
23617
+ ...props
23618
+ }
23619
+ );
23620
+ }
23621
+ function SidebarInput({ className, ...props }) {
23622
+ return /* @__PURE__ */ jsx(
23623
+ Input,
23624
+ {
23625
+ "data-slot": "sidebar-input",
23626
+ "data-sidebar": "input",
23627
+ className: cn("bg-background h-8 w-full shadow-none", className),
23628
+ ...props
23629
+ }
23630
+ );
23631
+ }
23632
+ function SidebarHeader({ className, ...props }) {
23633
+ return /* @__PURE__ */ jsx(
23634
+ "div",
23635
+ {
23636
+ "data-slot": "sidebar-header",
23637
+ "data-sidebar": "header",
23638
+ className: cn("flex flex-col gap-2 p-2", className),
23639
+ ...props
23640
+ }
23641
+ );
23642
+ }
23643
+ function SidebarFooter({ className, ...props }) {
23644
+ return /* @__PURE__ */ jsx(
23645
+ "div",
23646
+ {
23647
+ "data-slot": "sidebar-footer",
23648
+ "data-sidebar": "footer",
23649
+ className: cn("flex flex-col gap-2 p-2", className),
23650
+ ...props
23651
+ }
23652
+ );
23653
+ }
23654
+ function SidebarSeparator({ className, ...props }) {
23655
+ return /* @__PURE__ */ jsx(
23656
+ Separator4,
23657
+ {
23658
+ "data-slot": "sidebar-separator",
23659
+ "data-sidebar": "separator",
23660
+ className: cn("bg-sidebar-border mx-2 w-auto", className),
23661
+ ...props
23662
+ }
23663
+ );
23664
+ }
23665
+ function SidebarContent({ className, ...props }) {
23666
+ return /* @__PURE__ */ jsx(
23667
+ "div",
23668
+ {
23669
+ "data-slot": "sidebar-content",
23670
+ "data-sidebar": "content",
23671
+ className: cn(
23672
+ "flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
23673
+ className
23674
+ ),
23675
+ ...props
23676
+ }
23677
+ );
23678
+ }
23679
+ function SidebarGroup({ className, ...props }) {
23680
+ return /* @__PURE__ */ jsx(
23681
+ "div",
23682
+ {
23683
+ "data-slot": "sidebar-group",
23684
+ "data-sidebar": "group",
23685
+ className: cn("relative flex w-full min-w-0 flex-col p-2", className),
23686
+ ...props
23687
+ }
23688
+ );
23689
+ }
23690
+ function SidebarGroupLabel({
23691
+ className,
23692
+ asChild = false,
23693
+ ...props
23694
+ }) {
23695
+ const Comp = asChild ? Slot : "div";
23696
+ return /* @__PURE__ */ jsx(
23697
+ Comp,
23698
+ {
23699
+ "data-slot": "sidebar-group-label",
23700
+ "data-sidebar": "group-label",
23701
+ className: cn(
23702
+ "text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
23703
+ "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
23704
+ className
23705
+ ),
23706
+ ...props
23707
+ }
23708
+ );
23709
+ }
23710
+ function SidebarGroupAction({
23711
+ className,
23712
+ asChild = false,
23713
+ ...props
23714
+ }) {
23715
+ const Comp = asChild ? Slot : "button";
23716
+ return /* @__PURE__ */ jsx(
23717
+ Comp,
23718
+ {
23719
+ "data-slot": "sidebar-group-action",
23720
+ "data-sidebar": "group-action",
23721
+ className: cn(
23722
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
23723
+ // Increases the hit area of the button on mobile.
23724
+ "after:absolute after:-inset-2 md:after:hidden",
23725
+ "group-data-[collapsible=icon]:hidden",
23726
+ className
23727
+ ),
23728
+ ...props
23729
+ }
23730
+ );
23731
+ }
23732
+ function SidebarGroupContent({ className, ...props }) {
23733
+ return /* @__PURE__ */ jsx(
23734
+ "div",
23735
+ {
23736
+ "data-slot": "sidebar-group-content",
23737
+ "data-sidebar": "group-content",
23738
+ className: cn("w-full text-sm", className),
23739
+ ...props
23740
+ }
23741
+ );
23742
+ }
23743
+ function SidebarMenu({ className, ...props }) {
23744
+ return /* @__PURE__ */ jsx(
23745
+ "ul",
23746
+ {
23747
+ "data-slot": "sidebar-menu",
23748
+ "data-sidebar": "menu",
23749
+ className: cn("flex w-full min-w-0 flex-col gap-1", className),
23750
+ ...props
23751
+ }
23752
+ );
23753
+ }
23754
+ function SidebarMenuItem({ className, ...props }) {
23755
+ return /* @__PURE__ */ jsx(
23756
+ "li",
23757
+ {
23758
+ "data-slot": "sidebar-menu-item",
23759
+ "data-sidebar": "menu-item",
23760
+ className: cn("group/menu-item relative", className),
23761
+ ...props
23762
+ }
23763
+ );
23764
+ }
23765
+ var sidebarMenuButtonVariants = cva(
23766
+ "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
23767
+ {
23768
+ variants: {
23769
+ variant: {
23770
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
23771
+ outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
23772
+ },
23773
+ size: {
23774
+ default: "h-8 text-sm",
23775
+ sm: "h-7 text-xs",
23776
+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
23777
+ }
23778
+ },
23779
+ defaultVariants: {
23780
+ variant: "default",
23781
+ size: "default"
23782
+ }
23783
+ }
23784
+ );
23785
+ function SidebarMenuButton({
23786
+ asChild = false,
23787
+ isActive = false,
23788
+ variant = "default",
23789
+ size = "default",
23790
+ tooltip,
23791
+ className,
23792
+ ...props
23793
+ }) {
23794
+ const Comp = asChild ? Slot : "button";
23795
+ const { isMobile, state } = useSidebar();
23796
+ const button = /* @__PURE__ */ jsx(
23797
+ Comp,
23798
+ {
23799
+ "data-slot": "sidebar-menu-button",
23800
+ "data-sidebar": "menu-button",
23801
+ "data-size": size,
23802
+ "data-active": isActive,
23803
+ className: cn(sidebarMenuButtonVariants({ variant, size }), className),
23804
+ ...props
23805
+ }
23806
+ );
23807
+ if (!tooltip) {
23808
+ return button;
23809
+ }
23810
+ if (typeof tooltip === "string") {
23811
+ tooltip = {
23812
+ children: tooltip
23813
+ };
23814
+ }
23815
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
23816
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
23817
+ /* @__PURE__ */ jsx(
23818
+ TooltipContent,
23819
+ {
23820
+ side: "right",
23821
+ align: "center",
23822
+ hidden: state !== "collapsed" || isMobile,
23823
+ ...tooltip
23824
+ }
23825
+ )
23826
+ ] });
23827
+ }
23828
+ function SidebarMenuAction({
23829
+ className,
23830
+ asChild = false,
23831
+ showOnHover = false,
23832
+ ...props
23833
+ }) {
23834
+ const Comp = asChild ? Slot : "button";
23835
+ return /* @__PURE__ */ jsx(
23836
+ Comp,
23837
+ {
23838
+ "data-slot": "sidebar-menu-action",
23839
+ "data-sidebar": "menu-action",
23840
+ className: cn(
23841
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
23842
+ // Increases the hit area of the button on mobile.
23843
+ "after:absolute after:-inset-2 md:after:hidden",
23844
+ "peer-data-[size=sm]/menu-button:top-1",
23845
+ "peer-data-[size=default]/menu-button:top-1.5",
23846
+ "peer-data-[size=lg]/menu-button:top-2.5",
23847
+ "group-data-[collapsible=icon]:hidden",
23848
+ showOnHover && "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
23849
+ className
23850
+ ),
23851
+ ...props
23852
+ }
23853
+ );
23854
+ }
23855
+ function SidebarMenuBadge({ className, ...props }) {
23856
+ return /* @__PURE__ */ jsx(
23857
+ "div",
23858
+ {
23859
+ "data-slot": "sidebar-menu-badge",
23860
+ "data-sidebar": "menu-badge",
23861
+ className: cn(
23862
+ "text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
23863
+ "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
23864
+ "peer-data-[size=sm]/menu-button:top-1",
23865
+ "peer-data-[size=default]/menu-button:top-1.5",
23866
+ "peer-data-[size=lg]/menu-button:top-2.5",
23867
+ "group-data-[collapsible=icon]:hidden",
23868
+ className
23869
+ ),
23870
+ ...props
23871
+ }
23872
+ );
23873
+ }
23874
+ function SidebarMenuSkeleton({
23875
+ className,
23876
+ showIcon = false,
23877
+ ...props
23878
+ }) {
23879
+ const width = React16.useMemo(() => {
23880
+ return `${Math.floor(Math.random() * 40) + 50}%`;
23881
+ }, []);
23882
+ return /* @__PURE__ */ jsxs(
23883
+ "div",
23884
+ {
23885
+ "data-slot": "sidebar-menu-skeleton",
23886
+ "data-sidebar": "menu-skeleton",
23887
+ className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
23888
+ ...props,
23889
+ children: [
23890
+ showIcon && /* @__PURE__ */ jsx(Skeleton, { className: "size-4 rounded-md", "data-sidebar": "menu-skeleton-icon" }),
23891
+ /* @__PURE__ */ jsx(
23892
+ Skeleton,
23893
+ {
23894
+ className: "h-4 max-w-(--skeleton-width) flex-1",
23895
+ "data-sidebar": "menu-skeleton-text",
23896
+ style: {
23897
+ "--skeleton-width": width
23898
+ }
23899
+ }
23900
+ )
23901
+ ]
23902
+ }
23903
+ );
23904
+ }
23905
+ function SidebarMenuSub({ className, ...props }) {
23906
+ return /* @__PURE__ */ jsx(
23907
+ "ul",
23908
+ {
23909
+ "data-slot": "sidebar-menu-sub",
23910
+ "data-sidebar": "menu-sub",
23911
+ className: cn(
23912
+ "border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
23913
+ "group-data-[collapsible=icon]:hidden",
23914
+ className
23915
+ ),
23916
+ ...props
23917
+ }
23918
+ );
23919
+ }
23920
+ function SidebarMenuSubItem({ className, ...props }) {
23921
+ return /* @__PURE__ */ jsx(
23922
+ "li",
23923
+ {
23924
+ "data-slot": "sidebar-menu-sub-item",
23925
+ "data-sidebar": "menu-sub-item",
23926
+ className: cn("group/menu-sub-item relative", className),
23927
+ ...props
23928
+ }
23929
+ );
23930
+ }
23931
+ function SidebarMenuSubButton({
23932
+ asChild = false,
23933
+ size = "md",
23934
+ isActive = false,
23935
+ className,
23936
+ ...props
23937
+ }) {
23938
+ const Comp = asChild ? Slot : "a";
23939
+ return /* @__PURE__ */ jsx(
23940
+ Comp,
23941
+ {
23942
+ "data-slot": "sidebar-menu-sub-button",
23943
+ "data-sidebar": "menu-sub-button",
23944
+ "data-size": size,
23945
+ "data-active": isActive,
23946
+ className: cn(
23947
+ "text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
23948
+ "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
23949
+ size === "sm" && "text-xs",
23950
+ size === "md" && "text-sm",
23951
+ "group-data-[collapsible=icon]:hidden",
23952
+ className
23953
+ ),
23954
+ ...props
23955
+ }
23956
+ );
23957
+ }
23297
23958
  var useIsomorphicLayoutEffect2 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
23298
23959
  function useDisableToc() {
23299
23960
  const { setToc } = useToc();
@@ -23435,6 +24096,6 @@ var languages = [
23435
24096
  "html"
23436
24097
  ];
23437
24098
 
23438
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AreaChart, AspectRatio, AuthLayout, AvailableChartColors, Avatar, AvatarFallback, AvatarImage, Badge, BadgeButton, BarChart, BarList, BaseColorSwatches, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Breadcrumbs, Button2 as Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CategoryBar, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Code, CodeDemo, CodeHighlight, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorCard, ColorSwatches, ColourScale, ComboChart, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Description3 as Description, DescriptionDetails, DescriptionList, DescriptionTerm, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DonutChart, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicFavicon, ErrorMessage, ExpandableSearch, ExpandableSearchField, Field2 as Field, FieldGroup, FieldLabel, Fieldset2 as Fieldset, Footer, FooterAcknowledgement, FooterLegalLinks, FooterSmallPrint, FooterSocialLink, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatToggle, GenerateInterpolatedColors, Header2 as Header, Heading, HoverCard, HoverCardContent, HoverCardTrigger, Icons, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label3 as Label, Legend2 as Legend, LineChart, Link, _List as List, Listbox2 as Listbox, ListboxDescription, ListboxLabel, ListboxOption2 as ListboxOption, Logo, MainNavigation, Masthead, MegaMenu, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MobileHeader, MobileSearch, MultiLevelPushMenu, Navbar, NavbarDivider, NavbarItem, NavbarLabel, NavbarSection, NavbarSpacer, Navigation, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PreWithCopy, PrevNextLinks, PrevNextLinksPageLink, Progress, ProgressBar, ProgressCircle, Prose, RadioGroup2 as RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator4 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, SidebarLink, SidebarNavigation, SiteSearch, Skeleton, Slider, Social, SparkAreaChart, SparkBarChart, SparkLineChart, Spinner, StepIndicator, StepNavigation, Strong, Switch2 as Switch, SwitchField, SwitchGroup, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableOfContents, TableRow, Tabs2 as Tabs, TabsContent, TabsList, TabsTrigger, Text, TextLink, Textarea, ThemeColorPalette, ThemeProvider, ThemeSelector, ThemeSwitcher, Toaster, TocContext, TocProvider, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopLevel, TouchTarget, Tracker, Tooltip5 as TremorTooltip, ViewToggle, aboriginal, addStartStopToColorArray, allPalettes, badgeVariants, brand, buttonVariants, camelCase, chartColors, cn, colorDataArray, colorThemes, colors, constructCategoryColors, createColorArray, createColorData, createFormStore, darkenColor, domToSimple, focusInput, focusRing, generateColorThemes, getColorClassName, getColorValue, getHeadings, getNodeText, getSurroundingColors, getYAxisDomain, hasErrorInput, hasOnlyOneValueForKey, humaniseVariant, interpolateColors, isLightColor, kebabCase, languages, lightenColor, navigationMenuTriggerStyle, oklchConverter, progressBarVariants, renderColorOutput, renderColorOutputToDTFM, semantic, shades, themeIndices, themeTokens, toggleVariants, truncate, useActiveSectionObserver, useDisableToc, useFormField, useIsMobile, useOnWindowResize, usePageHeadings, useSelectorHeight, useToc };
24099
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AreaChart, AspectRatio, AuthLayout, AvailableChartColors, Avatar, AvatarFallback, AvatarImage, Badge, BadgeButton, BarChart, BarList, BaseColorSwatches, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Breadcrumbs, Button2 as Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CategoryBar, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Code, CodeDemo, CodeHighlight, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorCard, ColorSwatches, ColourScale, ComboChart, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Description3 as Description, DescriptionDetails, DescriptionList, DescriptionTerm, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DonutChart, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicFavicon, ErrorMessage, ExpandableSearch, ExpandableSearchField, Field2 as Field, FieldGroup, FieldLabel, Fieldset2 as Fieldset, Footer, FooterAcknowledgement, FooterLegalLinks, FooterSmallPrint, FooterSocialLink, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatToggle, GenerateInterpolatedColors, Header2 as Header, Heading, HoverCard, HoverCardContent, HoverCardTrigger, Icons, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label3 as Label, Legend2 as Legend, LineChart, Link, _List as List, Listbox2 as Listbox, ListboxDescription, ListboxLabel, ListboxOption2 as ListboxOption, Logo, MainNavigation, Masthead, MegaMenu, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, MobileHeader, MobileSearch, MultiLevelPushMenu, Navbar, NavbarDivider, NavbarItem, NavbarLabel, NavbarSection, NavbarSpacer, Navigation, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PreWithCopy, PrevNextLinks, PrevNextLinksPageLink, Progress, ProgressBar, ProgressCircle, Prose, RadioGroup2 as RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator4 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLink, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarNavigation, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiteSearch, Skeleton, Slider, Social, SparkAreaChart, SparkBarChart, SparkLineChart, Spinner, StepIndicator, StepNavigation, Strong, Switch2 as Switch, SwitchField, SwitchGroup, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableOfContents, TableRow, Tabs2 as Tabs, TabsContent, TabsList, TabsTrigger, Text, TextLink, Textarea, ThemeColorPalette, ThemeProvider, ThemeSelector, ThemeSwitcher, Toaster, TocContext, TocProvider, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopLevel, TouchTarget, Tracker, Tooltip5 as TremorTooltip, ViewToggle, aboriginal, addStartStopToColorArray, allPalettes, badgeVariants, brand, buttonVariants, camelCase, chartColors, cn, colorDataArray, colorThemes, colors, constructCategoryColors, createColorArray, createColorData, createFormStore, darkenColor, domToSimple, focusInput, focusRing, generateColorThemes, getColorClassName, getColorValue, getHeadings, getNodeText, getSurroundingColors, getYAxisDomain, hasErrorInput, hasOnlyOneValueForKey, humaniseVariant, interpolateColors, isLightColor, kebabCase, languages, lightenColor, navigationMenuTriggerStyle, oklchConverter, progressBarVariants, renderColorOutput, renderColorOutputToDTFM, semantic, shades, themeIndices, themeTokens, toggleVariants, truncate, useActiveSectionObserver, useDisableToc, useFormField, useIsMobile, useOnWindowResize, usePageHeadings, useSelectorHeight, useSidebar, useToc };
23439
24100
  //# sourceMappingURL=index.js.map
23440
24101
  //# sourceMappingURL=index.js.map