sonahang-ui 1.0.2 → 1.0.4

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/README.md CHANGED
@@ -86,7 +86,7 @@ Feedback: `Alert`, `Spinner`, `ProgressBar`, `Tooltip`, `Dialog`, `Drawer`
86
86
 
87
87
  Navigation: `Tabs`, `Breadcrumb`, `Pagination`, `Stepper`, `Accordion`
88
88
 
89
- Data display: `Avatar`, `Tag`, `Chip`
89
+ Data display: `Avatar`, `Tag`, `Chip`, `Carousel`
90
90
 
91
91
  Every component, every prop, and every state is documented with live controls
92
92
  in [Storybook](https://github.com/sonangrai/sonahang-ui) — that's the real
@@ -0,0 +1,29 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ import "./Carousel.css";
3
+ export type CarouselProps = {
4
+ children?: ReactNode;
5
+ /** Index of the slide in view — makes the component controlled. */
6
+ index?: number;
7
+ /** Initially visible slide when uncontrolled. Defaults to `0`. */
8
+ defaultIndex?: number;
9
+ /** Fired with the newly visible slide's index. */
10
+ onChange?: (index: number) => void;
11
+ /** Whether the previous/next controls wrap past the ends. Defaults to `true`. */
12
+ loop?: boolean;
13
+ /** Advances on its own until the reader takes over. Defaults to `false`. */
14
+ autoPlay?: boolean;
15
+ /** Milliseconds each slide is shown while auto-rotating. Defaults to `5000`. */
16
+ interval?: number;
17
+ /** Accessible name for the carousel. Worth setting — there's no default. */
18
+ "aria-label"?: string;
19
+ className?: string;
20
+ } & Omit<HTMLAttributes<HTMLElement>, "className" | "onChange">;
21
+ /**
22
+ * Root of the carousel: owns which slide is showing and shares it with
23
+ * `CarouselSlides`, the arrows, and the dots through context.
24
+ *
25
+ * A `section` with `aria-roledescription="carousel"`, per the ARIA carousel
26
+ * pattern — a landmark the reader can jump to, described in the words they'd
27
+ * use for it rather than as an anonymous region.
28
+ */
29
+ export declare function Carousel({ children, index, defaultIndex, onChange, loop, autoPlay, interval, "aria-label": ariaLabel, className, ...props }: CarouselProps): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import type { ButtonHTMLAttributes, ReactNode } from "react";
2
+ import "./Carousel.css";
3
+ export type CarouselControlProps = {
4
+ /** Replaces the default chevron. */
5
+ children?: ReactNode;
6
+ /** Accessible name for the button. */
7
+ "aria-label"?: string;
8
+ className?: string;
9
+ } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className" | "children">;
10
+ type InternalProps = CarouselControlProps & {
11
+ direction: "previous" | "next";
12
+ component: string;
13
+ defaultLabel: string;
14
+ };
15
+ /**
16
+ * Shared body of the two arrows — they differ only in which way they step and
17
+ * which end they run out at.
18
+ */
19
+ export declare function CarouselControl({ direction, component, defaultLabel, children, "aria-label": ariaLabel, className, disabled, onClick, ...props }: InternalProps): import("react").JSX.Element;
20
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { HTMLAttributes } from "react";
2
+ import "./Carousel.css";
3
+ export type CarouselDotsProps = {
4
+ /** Accessible name for the group. Defaults to "Choose slide". */
5
+ "aria-label"?: string;
6
+ /** Names each dot. Defaults to "Slide 1", "Slide 2", … */
7
+ label?: (index: number) => string;
8
+ className?: string;
9
+ } & Omit<HTMLAttributes<HTMLDivElement>, "className">;
10
+ /**
11
+ * One dot per slide, doubling as a position readout and a way to jump.
12
+ *
13
+ * Plain buttons rather than tabs: the slides are groups, not tab panels, and
14
+ * claiming tab semantics here would promise arrow-key behaviour the ARIA
15
+ * carousel pattern doesn't have.
16
+ */
17
+ export declare function CarouselDots({ "aria-label": ariaLabel, label, className, ...props }: CarouselDotsProps): import("react").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ import type { CarouselControlProps } from "./CarouselControl";
2
+ export type CarouselNextProps = CarouselControlProps;
3
+ /** Steps forward one slide. Overlays the right edge of the slides. */
4
+ export declare function CarouselNext(props: CarouselNextProps): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import type { ButtonHTMLAttributes } from "react";
2
+ import "./Carousel.css";
3
+ export type CarouselPlayPauseProps = {
4
+ /** Accessible names for the two states. */
5
+ labels?: {
6
+ play?: string;
7
+ pause?: string;
8
+ };
9
+ className?: string;
10
+ } & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "className" | "children">;
11
+ /**
12
+ * Stops and restarts auto-rotation.
13
+ *
14
+ * Worth rendering whenever `autoPlay` is on: movement nobody asked for is
15
+ * hard to read past, and hovering to pause it isn't available to everyone.
16
+ * Renders nothing when there's no rotation to control.
17
+ */
18
+ export declare function CarouselPlayPause({ labels, className, onClick, ...props }: CarouselPlayPauseProps): import("react").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ import type { CarouselControlProps } from "./CarouselControl";
2
+ export type CarouselPreviousProps = CarouselControlProps;
3
+ /** Steps back one slide. Overlays the left edge of the slides. */
4
+ export declare function CarouselPrevious(props: CarouselPreviousProps): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ import "./Carousel.css";
3
+ export type CarouselSlideProps = {
4
+ children?: ReactNode;
5
+ className?: string;
6
+ } & Omit<HTMLAttributes<HTMLDivElement>, "className">;
7
+ /** A single slide. Must be rendered inside `CarouselSlides`. */
8
+ export declare function CarouselSlide({ children, className, ...props }: CarouselSlideProps): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ import "./Carousel.css";
3
+ export type CarouselSlidesProps = {
4
+ children?: ReactNode;
5
+ className?: string;
6
+ } & Omit<HTMLAttributes<HTMLDivElement>, "className">;
7
+ /**
8
+ * Window onto the slides, and the track that slides beneath it.
9
+ *
10
+ * Slides are declared here but counted by the root, because the arrows and
11
+ * dots sit outside this subtree and still need to know how many there are.
12
+ * Position comes from the same place: a slide can't work out which one it is,
13
+ * so each child is handed its index on the way past.
14
+ */
15
+ export declare function CarouselSlides({ children, className, onKeyDown, ...props }: CarouselSlidesProps): import("react").JSX.Element;
@@ -0,0 +1,44 @@
1
+ export type CarouselContextValue = {
2
+ /** Index of the slide currently in view. */
3
+ index: number;
4
+ /** How many slides `CarouselSlides` is rendering. */
5
+ count: number;
6
+ /** Reported by `CarouselSlides` once it knows how many children it has. */
7
+ setCount: (count: number) => void;
8
+ /**
9
+ * Moves to a slide. `user` navigation also stops auto-rotation for good —
10
+ * once someone takes control, yanking the slide out from under them a few
11
+ * seconds later is hostile.
12
+ */
13
+ goTo: (index: number, source?: "user" | "auto") => void;
14
+ /** Whether the ends wrap around. */
15
+ loop: boolean;
16
+ /** Prefix for the generated slide ids that the dots point at. */
17
+ baseId: string;
18
+ /** Whether the caller asked for auto-rotation at all. */
19
+ autoPlay: boolean;
20
+ /**
21
+ * Whether rotation is *meant* to be running. Deliberately unaffected by the
22
+ * transient pauses (hover, focus, a hidden tab), so the play/pause button
23
+ * doesn't flip its icon as the pointer crosses the carousel.
24
+ */
25
+ isPlaying: boolean;
26
+ /** Starts or stops auto-rotation. */
27
+ togglePlaying: () => void;
28
+ };
29
+ export declare const CarouselContext: import("react").Context<CarouselContextValue | undefined>;
30
+ /** Reads the surrounding `Carousel` context, failing loudly rather than silently. */
31
+ export declare function useCarouselContext(component: string): CarouselContextValue;
32
+ /**
33
+ * Position of the slide being rendered. Supplied by `CarouselSlides`, which is
34
+ * the only part that knows the order — a slide can't count its own siblings.
35
+ */
36
+ export declare const CarouselSlideIndexContext: import("react").Context<number | undefined>;
37
+ export declare function useSlideIndex(component: string): number;
38
+ /** Ids are derived rather than registered, so dot and slide always agree. */
39
+ export declare const slideId: (baseId: string, index: number) => string;
40
+ /**
41
+ * Brings an index into range — wrapping when the carousel loops, clamping when
42
+ * it doesn't. Also guards against a caller passing something out of range.
43
+ */
44
+ export declare function resolveIndex(index: number, count: number, loop: boolean): number;
@@ -0,0 +1,14 @@
1
+ export { Carousel } from "./Carousel";
2
+ export type { CarouselProps } from "./Carousel";
3
+ export { CarouselSlides } from "./CarouselSlides";
4
+ export type { CarouselSlidesProps } from "./CarouselSlides";
5
+ export { CarouselSlide } from "./CarouselSlide";
6
+ export type { CarouselSlideProps } from "./CarouselSlide";
7
+ export { CarouselPrevious } from "./CarouselPrevious";
8
+ export type { CarouselPreviousProps } from "./CarouselPrevious";
9
+ export { CarouselNext } from "./CarouselNext";
10
+ export type { CarouselNextProps } from "./CarouselNext";
11
+ export { CarouselDots } from "./CarouselDots";
12
+ export type { CarouselDotsProps } from "./CarouselDots";
13
+ export { CarouselPlayPause } from "./CarouselPlayPause";
14
+ export type { CarouselPlayPauseProps } from "./CarouselPlayPause";
@@ -0,0 +1,28 @@
1
+ import type { FocusEvent, MouseEvent } from "react";
2
+ export type AutoRotateOptions = {
3
+ /** Whether rotation is meant to be running. */
4
+ enabled: boolean;
5
+ /** Milliseconds between advances. */
6
+ interval: number;
7
+ /** Called on each tick. Read from a ref, so it needn't be stable. */
8
+ onTick: () => void;
9
+ };
10
+ export type AutoRotateResult = {
11
+ /** Handlers the root spreads to suspend rotation while it's being read. */
12
+ pauseProps: {
13
+ onMouseEnter: (event: MouseEvent<HTMLElement>) => void;
14
+ onMouseLeave: (event: MouseEvent<HTMLElement>) => void;
15
+ onFocus: (event: FocusEvent<HTMLElement>) => void;
16
+ onBlur: (event: FocusEvent<HTMLElement>) => void;
17
+ };
18
+ };
19
+ /**
20
+ * Drives auto-rotation, and suspends it whenever moving the slide would be
21
+ * unwelcome: while the pointer rests on the carousel, while focus is inside
22
+ * it, while the tab is in the background, and entirely when the reader has
23
+ * asked for reduced motion.
24
+ *
25
+ * These are all *transient* — they don't change whether rotation is enabled,
26
+ * only whether it's ticking right now.
27
+ */
28
+ export declare function useAutoRotate({ enabled, interval, onTick }: AutoRotateOptions): AutoRotateResult;
@@ -16,12 +16,19 @@ export type TooltipProps = {
16
16
  /** Tip body. Nothing renders when this is empty. */
17
17
  content?: ReactNode;
18
18
  /**
19
- * Which side of the trigger the tip sits on. Defaults to `top`.
19
+ * Which side of the trigger the tip prefers. Defaults to `top`.
20
20
  *
21
- * `auto` measures the trigger against the viewport each time the tip opens
22
- * and picks a side with room for it.
21
+ * The tip is measured against the viewport each time it opens. If the
22
+ * preferred side has no room, it flips to the opposite side, then to
23
+ * whichever side does. `auto` is the same as `top`.
23
24
  */
24
25
  placement?: TooltipPlacement;
26
+ /**
27
+ * Keeps the tip on screen by flipping it to another side and sliding it
28
+ * away from the viewport edge. Defaults to `true`. Turn it off to pin the
29
+ * tip to `placement` exactly.
30
+ */
31
+ avoidCollisions?: boolean;
25
32
  /** Milliseconds to wait before showing on hover. Defaults to 150. */
26
33
  delay?: number;
27
34
  /** Open state — makes the component controlled. */
@@ -41,4 +48,4 @@ export type TooltipProps = {
41
48
  * needs, because it can't be reached by touch and disappears on the way to
42
49
  * anything else. Use it to name an icon button or expand an abbreviation.
43
50
  */
44
- export declare function Tooltip({ children, content, placement, delay, open: controlledOpen, defaultOpen, onOpenChange, disabled, className, ...props }: TooltipProps): import("react").JSX.Element;
51
+ export declare function Tooltip({ children, content, placement, avoidCollisions, delay, open: controlledOpen, defaultOpen, onOpenChange, disabled, className, ...props }: TooltipProps): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
1
  export { Tooltip } from "./Tooltip";
2
2
  export type { TooltipProps } from "./Tooltip";
3
- export { resolveTooltipPlacement } from "./resolveTooltipPlacement";
4
- export type { TooltipPlacement, TooltipSide, TooltipRect, ResolveTooltipPlacementOptions, } from "./resolveTooltipPlacement";
3
+ export { resolveTooltipPlacement, resolveTooltipShift } from "./resolveTooltipPlacement";
4
+ export type { TooltipPlacement, TooltipSide, TooltipRect, ResolveTooltipPlacementOptions, ResolveTooltipShiftOptions, } from "./resolveTooltipPlacement";
@@ -23,17 +23,49 @@ export type ResolveTooltipPlacementOptions = {
23
23
  };
24
24
  /** Separation between trigger and tip. Defaults to 8, matching the CSS. */
25
25
  gap?: number;
26
+ /**
27
+ * The side to keep whenever it fits. Defaults to `top`. When it doesn't,
28
+ * the opposite side is tried next, so a tip that can't go above a trigger
29
+ * goes below it rather than off to one side.
30
+ */
31
+ preferred?: TooltipSide;
32
+ };
33
+ export type ResolveTooltipShiftOptions = {
34
+ /** The side the tip is on — from `resolveTooltipPlacement`. */
35
+ side: TooltipSide;
36
+ trigger: TooltipRect;
37
+ tip: {
38
+ width: number;
39
+ height: number;
40
+ };
41
+ viewport: {
42
+ width: number;
43
+ height: number;
44
+ };
45
+ /** Minimum distance kept between the tip and the viewport edge. Defaults to 8. */
46
+ padding?: number;
26
47
  };
27
48
  /**
28
49
  * Picks the side of the trigger with room for the tip.
29
50
  *
30
- * Returns the first side in preference order that fits. When none do — a
31
- * trigger in a cramped scroll container, say — it returns whichever side
32
- * overflows least, so the tip is still mostly readable.
51
+ * Returns the preferred side if it fits, then its opposite, then the first
52
+ * remaining side that fits. When none do — a trigger in a cramped scroll
53
+ * container, say — it returns whichever side overflows least, so the tip is
54
+ * still mostly readable.
55
+ *
56
+ * This looks at the primary axis only. Keeping the tip inside the viewport
57
+ * along the other axis is `resolveTooltipShift`'s job.
58
+ */
59
+ export declare function resolveTooltipPlacement({ trigger, tip, viewport, gap, preferred, }: ResolveTooltipPlacementOptions): TooltipSide;
60
+ /**
61
+ * How far to slide the tip off-centre so it stays inside the viewport.
62
+ *
63
+ * A `top` or `bottom` tip is centred on its trigger, so a trigger near the
64
+ * left or right edge pushes half of it off screen; the result is a horizontal
65
+ * offset in pixels that pulls it back. For `left` and `right` it's vertical.
33
66
  *
34
- * This looks at the primary axis only: a `top` tip is centred horizontally
35
- * and can still overrun the left or right edge of a narrow viewport. Shifting
36
- * along the cross axis would need the tip to be positioned in JavaScript
37
- * rather than by CSS.
67
+ * When the tip is wider than the viewport, its start edge wins, because that's
68
+ * where reading begins. The shift is capped so the arrow always stays on the
69
+ * tip and keeps pointing at the trigger.
38
70
  */
39
- export declare function resolveTooltipPlacement({ trigger, tip, viewport, gap, }: ResolveTooltipPlacementOptions): TooltipSide;
71
+ export declare function resolveTooltipShift({ side, trigger, tip, viewport, padding, }: ResolveTooltipShiftOptions): number;
package/dist/index.d.ts CHANGED
@@ -54,6 +54,8 @@ export { Breadcrumb, BreadcrumbItem } from './components/Breadcrumb';
54
54
  export type { BreadcrumbProps, BreadcrumbItemProps } from './components/Breadcrumb';
55
55
  export { Tabs, TabList, Tab, TabPanel } from './components/Tabs';
56
56
  export type { TabsProps, TabListProps, TabProps, TabPanelProps, TabsOrientation, TabsActivation, } from './components/Tabs';
57
+ export { Carousel, CarouselSlides, CarouselSlide, CarouselPrevious, CarouselNext, CarouselDots, CarouselPlayPause, } from './components/Carousel';
58
+ export type { CarouselProps, CarouselSlidesProps, CarouselSlideProps, CarouselPreviousProps, CarouselNextProps, CarouselDotsProps, CarouselPlayPauseProps, } from './components/Carousel';
57
59
  export { Skeleton, skeletonVariants, skeletonAnimations } from './components/Skeleton';
58
60
  export type { SkeletonProps, SkeletonVariant, SkeletonAnimation } from './components/Skeleton';
59
61
  export { Spinner, spinnerSizes } from './components/Spinner';
@@ -3,5 +3,5 @@
3
3
  `);for(;t.length>0&&t[0].trim()===``;)t.shift();for(;t.length>0&&t[t.length-1].trim()===``;)t.pop();if(t.length===0)return``;let n=t.filter(e=>e.trim()!==``).map(e=>e.length-e.trimStart().length),r=Math.min(...n);return t.map(e=>e.slice(r)).join(`
4
4
  `)}var te=()=>(0,n.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,"aria-hidden":`true`,children:[(0,n.jsx)(`rect`,{x:`5.75`,y:`5.75`,width:`8`,height:`8`,rx:`1.5`}),(0,n.jsx)(`path`,{d:`M10.5 3.5A1.5 1.5 0 0 0 9 2H3.5A1.5 1.5 0 0 0 2 3.5V9a1.5 1.5 0 0 0 1.5 1.5`})]}),ne=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M3.5 8.5l3 3 6-6.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),re=2e3;function ie({children:e,filename:t,language:i,showLineNumbers:a=!1,wrap:o=!1,copyable:s=!0,copyLabel:c=`Copy code`,maxHeight:l,className:u,...d}){let f=B(e),p=(0,r.useId)(),[m,h]=(0,r.useState)(`idle`),g=(0,r.useRef)(void 0);(0,r.useEffect)(()=>()=>window.clearTimeout(g.current),[]);let _=async()=>{window.clearTimeout(g.current);try{await navigator.clipboard.writeText(f),h(`copied`)}catch{h(`error`)}g.current=window.setTimeout(()=>h(`idle`),re)},v=t??i,y=v!==void 0||s;return(0,n.jsxs)(`div`,{className:[`sh-code-block`,o&&`sh-code-block--wrap`,a&&`sh-code-block--numbered`,u].filter(Boolean).join(` `),...d,children:[y&&(0,n.jsxs)(`div`,{className:`sh-code-block__header`,children:[v!==void 0&&(0,n.jsx)(`span`,{id:p,className:`sh-code-block__filename`,children:v}),s&&(0,n.jsx)(`button`,{type:`button`,className:`sh-code-block__copy`,"aria-label":c,onClick:_,children:m===`copied`?(0,n.jsx)(ne,{}):(0,n.jsx)(te,{})})]}),(0,n.jsx)(`pre`,{className:`sh-code-block__pre`,tabIndex:0,role:v===void 0?void 0:`group`,"aria-labelledby":v===void 0?void 0:p,style:l===void 0?void 0:{maxHeight:l},children:(0,n.jsx)(`code`,{className:[`sh-code-block__code`,i&&`language-${i}`].filter(Boolean).join(` `),children:a?f.split(`
5
5
  `).map((e,t,r)=>(0,n.jsxs)(`span`,{className:`sh-code-block__line`,children:[e,t<r.length-1?`
6
- `:``]},t)):f})}),s&&(0,n.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sh-code-block__status`,children:m===`copied`?`Copied`:m===`error`?`Copy failed`:``})]})}function V(e,t){if(!t)return e;let n=t===!0?typeof document>`u`?null:document.body:t;return n?(0,i.createPortal)(e,n):null}var H=0,U=null;function ae(){if(H===0){let{body:e}=document,t=e.style.overflow,n=e.style.paddingRight,r=window.innerWidth-document.documentElement.clientWidth;if(e.style.overflow=`hidden`,r>0){let t=Number.parseFloat(window.getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${t+r}px`}U=()=>{e.style.overflow=t,e.style.paddingRight=n}}H+=1;let e=!1;return()=>{e||(e=!0,--H,H===0&&(U?.(),U=null))}}function W({open:e,onClose:t,closeOnEscape:n,closeOnBackdropClick:i,initialFocus:a,lockScroll:o}){let s=(0,r.useRef)(null),c=(0,r.useRef)(null),l=(0,r.useId)();return(0,r.useEffect)(()=>{let t=s.current;if(t){if(!e){t.open&&t.close();return}return t.open||t.showModal(),a?.current?.focus(),o?ae():void 0}},[e,o]),(0,r.useEffect)(()=>{let e=s.current;if(!e)return;let r=e=>{e.preventDefault(),n&&t()};return e.addEventListener(`cancel`,r),()=>e.removeEventListener(`cancel`,r)},[n,t]),{titleId:`${l}-title`,descriptionId:`${l}-description`,surfaceProps:{ref:s,onMouseDown:e=>{c.current=e.target},onClick:e=>{i&&c.current===e.currentTarget&&e.target===e.currentTarget&&t()}}}}var oe=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M4.5 4.5l7 7M11.5 4.5l-7 7`,strokeLinecap:`round`})});function se({open:e,onClose:t,title:r,description:i,children:a,footer:o,size:s=`md`,role:c=`dialog`,closeOnEscape:l=!0,closeOnBackdropClick:u=!0,showClose:d=!0,closeLabel:f=`Close`,initialFocus:p,lockScroll:m=!0,portal:h=!1,className:g,..._}){let{titleId:v,descriptionId:y,surfaceProps:b}=W({open:e,onClose:t,closeOnEscape:l,closeOnBackdropClick:u,initialFocus:p,lockScroll:m});return V((0,n.jsxs)(`dialog`,{role:c,"aria-labelledby":v,"aria-describedby":i?y:void 0,className:[`sh-dialog`,`sh-dialog--${s}`,g].filter(Boolean).join(` `),...b,..._,children:[(0,n.jsxs)(`div`,{className:`sh-dialog__header`,children:[(0,n.jsxs)(`div`,{className:`sh-dialog__heading`,children:[(0,n.jsx)(`h2`,{id:v,className:`sh-dialog__title`,children:r}),i&&(0,n.jsx)(`p`,{id:y,className:`sh-dialog__description`,children:i})]}),d&&(0,n.jsx)(`button`,{type:`button`,className:`sh-dialog__close`,"aria-label":f,onClick:t,children:(0,n.jsx)(oe,{})})]}),a!=null&&a!==!1&&(0,n.jsx)(`div`,{className:`sh-dialog__body`,children:a}),o&&(0,n.jsx)(`div`,{className:`sh-dialog__footer`,children:o})]}),h)}var ce=[`sm`,`md`,`lg`,`fullscreen`],le=[`dialog`,`alertdialog`],ue=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M4.5 4.5l7 7M11.5 4.5l-7 7`,strokeLinecap:`round`})});function de({open:e,onClose:t,title:r,description:i,children:a,footer:o,side:s=`right`,size:c=`md`,closeOnEscape:l=!0,closeOnBackdropClick:u=!0,showClose:d=!0,closeLabel:f=`Close`,initialFocus:p,lockScroll:m=!0,portal:h=!1,className:g,..._}){let{titleId:v,descriptionId:y,surfaceProps:b}=W({open:e,onClose:t,closeOnEscape:l,closeOnBackdropClick:u,initialFocus:p,lockScroll:m});return V((0,n.jsxs)(`dialog`,{"aria-labelledby":v,"aria-describedby":i?y:void 0,className:[`sh-drawer`,`sh-drawer--${s}`,`sh-drawer--${c}`,g].filter(Boolean).join(` `),...b,..._,children:[(0,n.jsxs)(`div`,{className:`sh-drawer__header`,children:[(0,n.jsxs)(`div`,{className:`sh-drawer__heading`,children:[(0,n.jsx)(`h2`,{id:v,className:`sh-drawer__title`,children:r}),i&&(0,n.jsx)(`p`,{id:y,className:`sh-drawer__description`,children:i})]}),d&&(0,n.jsx)(`button`,{type:`button`,className:`sh-drawer__close`,"aria-label":f,onClick:t,children:(0,n.jsx)(ue,{})})]}),a!=null&&a!==!1&&(0,n.jsx)(`div`,{className:`sh-drawer__body`,children:a}),o&&(0,n.jsx)(`div`,{className:`sh-drawer__footer`,children:o})]}),h)}var fe=[`left`,`right`,`top`,`bottom`],pe=[`sm`,`md`,`lg`,`full`],G=[`top`,`bottom`,`right`,`left`];function me({trigger:e,tip:t,viewport:n,gap:r=8}){let i={top:e.top,bottom:n.height-e.bottom,left:e.left,right:n.width-e.right},a={top:t.height+r,bottom:t.height+r,left:t.width+r,right:t.width+r};return G.find(e=>i[e]>=a[e])||G.reduce((e,t)=>i[t]-a[t]>i[e]-a[e]?t:e)}var he=typeof window>`u`?r.useEffect:r.useLayoutEffect;function ge({children:e,content:t,placement:i=`top`,delay:a=150,open:o,defaultOpen:s=!1,onOpenChange:c,disabled:l=!1,className:u,...d}){let f=(0,r.useId)(),p=(0,r.useRef)(void 0),m=(0,r.useRef)(null),h=(0,r.useRef)(null),g=(0,r.useRef)(!1),[_,v]=(0,r.useState)(s),y=o!==void 0,b=y?o:_,x=!l&&t!=null&&t!==``,S=()=>{p.current!==void 0&&(window.clearTimeout(p.current),p.current=void 0)},C=(0,r.useCallback)(e=>{y||v(e),c?.(e)},[y,c]),w=()=>{!x||b||g.current||(S(),a>0?p.current=window.setTimeout(()=>C(!0),a):C(!0))},T=()=>{S(),b&&C(!1)};(0,r.useEffect)(()=>S,[]);let[E,D]=(0,r.useState)(`top`),O=i===`auto`,k=O?E:i;if(he(()=>{if(!O||!b||!x)return;let e=()=>{let e=m.current,t=h.current;!e||!t||D(me({trigger:e.getBoundingClientRect(),tip:{width:t.offsetWidth,height:t.offsetHeight},viewport:{width:window.innerWidth,height:window.innerHeight}}))};return e(),window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[O,b,x]),(0,r.useEffect)(()=>{if(!b||!x)return;let e=e=>{e.key===`Escape`&&C(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[b,x,C]),!(0,r.isValidElement)(e))throw Error(`<Tooltip> expects a single element child to describe.`);let A=x?(0,r.cloneElement)(e,{"aria-describedby":[e.props[`aria-describedby`],f].filter(Boolean).join(` `)}):e;return(0,n.jsxs)(`span`,{ref:m,className:[`sh-tooltip`,u].filter(Boolean).join(` `),onMouseEnter:w,onMouseLeave:()=>{g.current=!1,T()},onFocus:w,onBlur:()=>{g.current=!1,T()},onMouseDown:()=>{g.current=!0,T()},...d,children:[A,x&&(0,n.jsx)(`span`,{ref:h,id:f,role:`tooltip`,className:[`sh-tooltip__tip`,`sh-tooltip__tip--${k}`,b&&`sh-tooltip__tip--open`].filter(Boolean).join(` `),children:t})]})}var _e=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M4 6.5 8 10.5l4-4`,strokeLinecap:`round`,strokeLinejoin:`round`})}),ve=e=>`options`in e;function ye({label:e,helperText:t,error:i,options:a,placeholder:o,icon:s,className:c,selectClassName:l,children:u,id:d,required:f,disabled:p,multiple:m,"aria-describedby":h,...g}){let _=(0,r.useId)(),v=d??_,y=`${v}-message`,b=!!i,x=i??t,S=[h,x?y:void 0].filter(Boolean).join(` `)||void 0,C=[`sh-select`,b&&`sh-select--invalid`,p&&`sh-select--disabled`,s&&`sh-select--with-icon`,m&&`sh-select--multiple`,c].filter(Boolean).join(` `),w=e=>(0,n.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value);return(0,n.jsxs)(`div`,{className:C,children:[e&&(0,n.jsxs)(`label`,{className:`sh-select__label`,htmlFor:v,children:[e,f&&(0,n.jsx)(`span`,{className:`sh-select__required`,"aria-hidden":`true`,children:`*`})]}),(0,n.jsxs)(`span`,{className:`sh-select__field`,children:[s&&(0,n.jsx)(`span`,{className:`sh-select__icon`,"aria-hidden":`true`,children:s}),(0,n.jsxs)(`select`,{...g,id:v,className:[`sh-select__control`,l].filter(Boolean).join(` `),required:f,disabled:p,multiple:m,"aria-invalid":b||void 0,"aria-describedby":S,children:[o&&(0,n.jsx)(`option`,{value:``,disabled:!0,children:o}),a?a.map(e=>ve(e)?(0,n.jsx)(`optgroup`,{label:e.label,children:e.options.map(w)},e.label):w(e)):u]}),!m&&(0,n.jsx)(`span`,{className:`sh-select__chevron`,"aria-hidden":`true`,children:(0,n.jsx)(_e,{})})]}),x&&(0,n.jsx)(`span`,{id:y,className:`sh-select__message`,children:x})]})}function be({label:e,helperText:t,error:i,resize:a=`vertical`,className:o,textareaClassName:s,id:c,rows:l=3,required:u,disabled:d,"aria-describedby":f,...p}){let m=(0,r.useId)(),h=c??m,g=`${h}-message`,_=!!i,v=i??t,y=[f,v?g:void 0].filter(Boolean).join(` `)||void 0,b=[`sh-textarea`,_&&`sh-textarea--invalid`,d&&`sh-textarea--disabled`,o].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:b,children:[e&&(0,n.jsxs)(`label`,{className:`sh-textarea__label`,htmlFor:h,children:[e,u&&(0,n.jsx)(`span`,{className:`sh-textarea__required`,"aria-hidden":`true`,children:`*`})]}),(0,n.jsx)(`textarea`,{id:h,className:[`sh-textarea__control`,`sh-textarea__control--resize-${a}`,s].filter(Boolean).join(` `),rows:l,required:u,disabled:d,"aria-invalid":_||void 0,"aria-describedby":y,...p}),v&&(0,n.jsx)(`span`,{id:g,className:`sh-textarea__message`,children:v})]})}var xe=(0,r.createContext)(void 0);function Se({value:e,label:t,indeterminate:i=!1,className:a,inputClassName:o,name:s,checked:c,disabled:l,onChange:u,ref:d,...f}){let p=(0,r.useContext)(xe),m=(0,r.useRef)(null);(0,r.useEffect)(()=>{m.current&&(m.current.indeterminate=i)},[i]);let h=e=>{m.current=e,typeof d==`function`?d(e):d&&(d.current=e)},g=s??p?.name,_=p&&e!==void 0?p.value.includes(e):c,v=l??p?.disabled,y=t=>{p&&e!==void 0&&p.onToggle(e,t.target.checked),u?.(t)},b=[`sh-checkbox`,v&&`sh-checkbox--disabled`,a].filter(Boolean).join(` `);return(0,n.jsxs)(`label`,{className:b,children:[(0,n.jsx)(`input`,{...f,type:`checkbox`,ref:h,className:[`sh-checkbox__input`,o].filter(Boolean).join(` `),name:g,value:e,checked:_,disabled:v,onChange:y}),t&&(0,n.jsx)(`span`,{className:`sh-checkbox__label`,children:t})]})}function Ce({children:e,value:t,defaultValue:i,onChange:a,label:o,helperText:s,error:c,name:l,orientation:u=`vertical`,disabled:d=!1,"aria-label":f,className:p}){let m=(0,r.useId)(),h=(0,r.useId)(),g=(0,r.useId)(),_=l??m,[v,y]=(0,r.useState)(i??[]),b=t!==void 0,x=b?t:v,S=(e,t)=>{let n=t?[...x,e]:x.filter(t=>t!==e);b||y(n),a?.(n)},C=!!c,w=c??s,T=[`sh-checkbox-group`,C&&`sh-checkbox-group--invalid`,p].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:T,children:[o&&(0,n.jsx)(`span`,{className:`sh-checkbox-group__label`,id:h,children:o}),(0,n.jsx)(`div`,{className:`sh-checkbox-group__options sh-checkbox-group__options--${u}`,role:`group`,"aria-label":o?void 0:f,"aria-labelledby":o?h:void 0,"aria-describedby":w?g:void 0,"aria-invalid":C||void 0,children:(0,n.jsx)(xe.Provider,{value:{name:_,value:x,onToggle:S,disabled:d},children:e})}),w&&(0,n.jsx)(`span`,{id:g,className:`sh-checkbox-group__message`,children:w})]})}var we=(0,r.createContext)(void 0);function Te({value:e,label:t,className:i,inputClassName:a,name:o,checked:s,disabled:c,onChange:l,...u}){let d=(0,r.useContext)(we),f=o??d?.name,p=d?d.value===e:s,m=c??d?.disabled,h=t=>{d&&e!==void 0&&d.onSelect(e),l?.(t)},g=[`sh-radio`,m&&`sh-radio--disabled`,i].filter(Boolean).join(` `);return(0,n.jsxs)(`label`,{className:g,children:[(0,n.jsx)(`input`,{type:`radio`,className:[`sh-radio__input`,a].filter(Boolean).join(` `),name:f,value:e,checked:p,disabled:m,onChange:h,...u}),t&&(0,n.jsx)(`span`,{className:`sh-radio__label`,children:t})]})}function Ee({children:e,value:t,defaultValue:i,onChange:a,label:o,helperText:s,error:c,name:l,orientation:u=`vertical`,disabled:d=!1,"aria-label":f,className:p}){let m=(0,r.useId)(),h=(0,r.useId)(),g=(0,r.useId)(),_=l??m,[v,y]=(0,r.useState)(i),b=t!==void 0,x=b?t:v,S=e=>{b||y(e),a?.(e)},C=!!c,w=c??s,T=[`sh-radio-group`,C&&`sh-radio-group--invalid`,p].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:T,children:[o&&(0,n.jsx)(`span`,{className:`sh-radio-group__label`,id:h,children:o}),(0,n.jsx)(`div`,{className:`sh-radio-group__options sh-radio-group__options--${u}`,role:`radiogroup`,"aria-label":o?void 0:f,"aria-labelledby":o?h:void 0,"aria-describedby":w?g:void 0,"aria-invalid":C||void 0,children:(0,n.jsx)(we.Provider,{value:{name:_,value:x,onSelect:S,disabled:d},children:e})}),w&&(0,n.jsx)(`span`,{id:g,className:`sh-radio-group__message`,children:w})]})}var K=(e,t)=>t<e?[]:Array.from({length:t-e+1},(t,n)=>e+n);function De({page:e,count:t,siblingCount:n=1,boundaryCount:r=1}){if(t<=0)return[];let i=K(1,Math.min(r,t)),a=K(Math.max(t-r+1,r+1),t),o=Math.max(Math.min(e-n,t-r-n*2-1),r+2),s=Math.min(Math.max(e+n,r+n*2+2),a.length>0?a[0]-2:t-1);return[...i,...o>r+2?[`ellipsis`]:r+1<t-r?[r+1]:[],...K(o,s),...s<t-r-1?[`ellipsis`]:t-r>r?[t-r]:[],...a]}var Oe=({direction:e})=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:e===`left`?`M10 3.5 5.5 8l4.5 4.5`:`M6 3.5 10.5 8 6 12.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),ke=({direction:e})=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:e===`left`?`M8 3.5 3.5 8 8 12.5M13 3.5 8.5 8l4.5 4.5`:`M8 3.5 12.5 8 8 12.5M3 3.5 7.5 8 3 12.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),Ae={first:`First page`,previous:`Previous page`,next:`Next page`,last:`Last page`,page:e=>`Page ${e}`};function je({count:e,page:t,defaultPage:i=1,onChange:a,siblingCount:o=1,boundaryCount:s=1,showFirstLast:c=!1,hidePrevNext:l=!1,disabled:u=!1,labels:d,"aria-label":f=`Pagination`,className:p,...m}){let[h,g]=(0,r.useState)(i),_=t!==void 0,v=_?t:h,y={...Ae,...d},b=t=>{t<1||t>e||t===v||(_||g(t),a?.(t))},x=De({page:v,count:e,siblingCount:o,boundaryCount:s});if(e<=0)return null;let S=(t,r,i,a)=>(0,n.jsx)(`li`,{className:`sh-pagination__item`,children:(0,n.jsx)(`button`,{type:`button`,className:`sh-pagination__control`,onClick:()=>b(i),disabled:u||i<1||i>e||i===v,"aria-label":r,children:a})},t);return(0,n.jsx)(`nav`,{className:[`sh-pagination`,p].filter(Boolean).join(` `),"aria-label":f,...m,children:(0,n.jsxs)(`ul`,{className:`sh-pagination__list`,children:[c&&S(`first`,y.first,1,(0,n.jsx)(ke,{direction:`left`})),!l&&S(`prev`,y.previous,v-1,(0,n.jsx)(Oe,{direction:`left`})),x.map((e,t)=>e===`ellipsis`?(0,n.jsx)(`li`,{className:`sh-pagination__item`,children:(0,n.jsx)(`span`,{className:`sh-pagination__ellipsis`,"aria-hidden":`true`,children:`…`})},`ellipsis-${t}`):(0,n.jsx)(`li`,{className:`sh-pagination__item`,children:(0,n.jsx)(`button`,{type:`button`,className:[`sh-pagination__page`,e===v&&`sh-pagination__page--current`].filter(Boolean).join(` `),onClick:()=>b(e),disabled:u,"aria-label":y.page(e),"aria-current":e===v?`page`:void 0,children:e})},e)),!l&&S(`next`,y.next,v+1,(0,n.jsx)(Oe,{direction:`right`})),c&&S(`last`,y.last,e,(0,n.jsx)(ke,{direction:`right`}))]})})}var Me=(0,r.createContext)(void 0);function Ne(e){let t=(0,r.useContext)(Me);if(!t)throw Error(`<${e}> must be rendered inside <Accordion>.`);return t}var Pe=(e,t)=>`${e}-trigger-${t}`,Fe=(e,t)=>`${e}-panel-${t}`;function Ie({children:e,type:t=`single`,value:i,defaultValue:a,onChange:o,collapsible:s=!0,headingLevel:c=3,className:l,...u}){let d=(0,r.useId)(),[f,p]=(0,r.useState)(a??[]),m=i!==void 0,h=m?i:f;return(0,n.jsx)(Me.Provider,{value:{value:h,toggle:e=>{let n=h.includes(e),r;r=t===`multiple`?n?h.filter(t=>t!==e):[...h,e]:n?s?[]:h:[e],m||p(r),o?.(r)},baseId:d,headingLevel:c},children:(0,n.jsx)(`div`,{className:[`sh-accordion`,l].filter(Boolean).join(` `),...u,children:e})})}var Le=()=>(0,n.jsx)(`svg`,{className:`sh-accordion__chevron`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M4 6.5 8 10.5l4-4`,strokeLinecap:`round`,strokeLinejoin:`round`})});function Re({value:e,title:t,children:i,disabled:a=!1,className:o,...s}){let{value:c,toggle:l,baseId:u,headingLevel:d}=Ne(`AccordionItem`),f=c.includes(e),p=(0,n.jsxs)(`button`,{type:`button`,id:Pe(u,e),className:`sh-accordion__trigger`,"aria-expanded":f,"aria-controls":Fe(u,e),disabled:a,onClick:()=>l(e),children:[(0,n.jsx)(`span`,{className:`sh-accordion__title`,children:t}),(0,n.jsx)(Le,{})]});return(0,n.jsxs)(`div`,{className:[`sh-accordion__item`,f&&`sh-accordion__item--open`,a&&`sh-accordion__item--disabled`,o].filter(Boolean).join(` `),...s,children:[(0,r.createElement)(`h${d}`,{className:`sh-accordion__heading`},p),(0,n.jsx)(`div`,{id:Fe(u,e),className:`sh-accordion__panel`,role:`region`,"aria-labelledby":Pe(u,e),children:(0,n.jsx)(`div`,{className:`sh-accordion__panel-inner`,children:(0,n.jsx)(`div`,{className:`sh-accordion__content`,children:i})})})]})}var ze=(0,r.createContext)(void 0);function Be(e){let t=(0,r.useContext)(ze);if(!t)throw Error(`<${e}> must be rendered inside <Stepper>.`);return t}function Ve({children:e,activeStep:t=0,orientation:i=`horizontal`,"aria-label":a=`Progress`,className:o,...s}){let c=r.Children.toArray(e).filter(r.isValidElement),l=e=>e<t?`complete`:e===t?`current`:`upcoming`;return(0,n.jsx)(`ol`,{className:[`sh-stepper`,`sh-stepper--${i}`,o].filter(Boolean).join(` `),"aria-label":a,...s,children:c.map((e,t)=>(0,n.jsx)(ze.Provider,{value:{index:t,isLast:t===c.length-1,status:l(t),orientation:i},children:e},e.key??t))})}var He=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M3.5 8.5l3 3 6-6.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),Ue=()=>(0,n.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:[(0,n.jsx)(`path`,{d:`M8 4.5v4.5`,strokeLinecap:`round`}),(0,n.jsx)(`circle`,{cx:`8`,cy:`11.6`,r:`0.9`,fill:`currentColor`,stroke:`none`})]});function We({title:e,description:t,status:r,icon:i,onClick:a,disabled:o=!1,className:s}){let{index:c,isLast:l,status:u,orientation:d}=Be(`Step`),f=r??u,p=i??(f===`complete`?(0,n.jsx)(He,{}):f===`error`?(0,n.jsx)(Ue,{}):c+1),m=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`span`,{className:`sh-step__indicator`,children:p}),(0,n.jsxs)(`span`,{className:`sh-step__text`,children:[(0,n.jsx)(`span`,{className:`sh-step__title`,children:e}),t&&(0,n.jsx)(`span`,{className:`sh-step__description`,children:t})]})]});return(0,n.jsxs)(`li`,{className:[`sh-step`,`sh-step--${f}`,`sh-step--${d}`,l&&`sh-step--last`,s].filter(Boolean).join(` `),children:[a?(0,n.jsx)(`button`,{type:`button`,className:`sh-step__body sh-step__body--interactive`,onClick:a,disabled:o,"aria-current":f===`current`?`step`:void 0,children:m}):(0,n.jsx)(`span`,{className:`sh-step__body`,"aria-current":f===`current`?`step`:void 0,children:m}),!l&&(0,n.jsx)(`span`,{className:`sh-step__connector`,"aria-hidden":`true`})]})}var Ge=(0,r.createContext)(void 0);function Ke(e){let t=(0,r.useContext)(Ge);if(!t)throw Error(`<${e}> must be rendered inside <Breadcrumb>.`);return t}var qe=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:(0,n.jsx)(`path`,{d:`M6 3.5 10.5 8 6 12.5`,strokeLinecap:`round`,strokeLinejoin:`round`})});function Je({children:e,separator:t=(0,n.jsx)(qe,{}),"aria-label":i=`Breadcrumb`,className:a,...o}){let s=r.Children.toArray(e).filter(r.isValidElement);return(0,n.jsx)(`nav`,{className:[`sh-breadcrumb`,a].filter(Boolean).join(` `),"aria-label":i,...o,children:(0,n.jsx)(`ol`,{className:`sh-breadcrumb__list`,children:s.map((e,r)=>(0,n.jsx)(Ge.Provider,{value:{isLast:r===s.length-1,separator:t},children:e},e.key??r))})})}function Ye({children:e,href:t,current:r,className:i,...a}){let{isLast:o,separator:s}=Ke(`BreadcrumbItem`),c=r??o;return(0,n.jsxs)(`li`,{className:[`sh-breadcrumb__item`,i].filter(Boolean).join(` `),children:[c?(0,n.jsx)(`span`,{className:`sh-breadcrumb__current`,"aria-current":`page`,children:e}):t?(0,n.jsx)(`a`,{className:`sh-breadcrumb__link`,href:t,...a,children:e}):(0,n.jsx)(`span`,{className:`sh-breadcrumb__text`,children:e}),!o&&(0,n.jsx)(`span`,{className:`sh-breadcrumb__separator`,"aria-hidden":`true`,children:s})]})}var Xe=(0,r.createContext)(void 0);function q(e){let t=(0,r.useContext)(Xe);if(!t)throw Error(`<${e}> must be rendered inside <Tabs>.`);return t}var Ze=(e,t)=>`${e}-tab-${t}`,Qe=(e,t)=>`${e}-panel-${t}`;function $e({children:e,value:t,defaultValue:i,onChange:a,orientation:o=`horizontal`,activation:s=`automatic`,className:c,...l}){let u=(0,r.useId)(),[d,f]=(0,r.useState)(i),p=t!==void 0,m=p?t:d,h=e=>{p||f(e),a?.(e)},g=[`sh-tabs`,`sh-tabs--${o}`,c].filter(Boolean).join(` `);return(0,n.jsx)(Xe.Provider,{value:{value:m,select:h,baseId:u,orientation:o,activation:s},children:(0,n.jsx)(`div`,{className:g,...l,children:e})})}var et=typeof window>`u`?r.useEffect:r.useLayoutEffect;function tt({children:e,className:t,onKeyDown:i,...a}){let{value:o,orientation:s,activation:c,select:l}=q(`TabList`),u=(0,r.useRef)(null),[d,f]=(0,r.useState)(null),p=s===`vertical`;return et(()=>{let e=u.current;if(!e)return;let t=Array.from(e.querySelectorAll(`[role="tab"]`)).find(e=>e.dataset.value===o);if(!t){f(null);return}let n=()=>{let e=p?t.offsetTop:t.offsetLeft,n=p?t.offsetHeight:t.offsetWidth;f(t=>({offset:e,size:n,animated:t!==null}))};if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[o,p]),(0,n.jsxs)(`div`,{ref:u,className:[`sh-tabs__list`,t].filter(Boolean).join(` `),role:`tablist`,"aria-orientation":s,onKeyDown:e=>{if(i?.(e),e.defaultPrevented||!u.current)return;let t=p?`ArrowDown`:`ArrowRight`;if(![t,p?`ArrowUp`:`ArrowLeft`,`Home`,`End`].includes(e.key))return;let n=Array.from(u.current.querySelectorAll(`[role="tab"]:not([disabled])`));if(n.length===0)return;let r=n.indexOf(document.activeElement),a;a=e.key===`Home`?0:e.key===`End`?n.length-1:r===-1?0:e.key===t?(r+1)%n.length:(r-1+n.length)%n.length;let o=n[a];if(o&&(e.preventDefault(),o.focus(),c===`automatic`)){let e=o.dataset.value;e!==void 0&&l(e)}},...a,children:[e,d&&(0,n.jsx)(`span`,{className:[`sh-tabs__indicator`,d.animated&&`sh-tabs__indicator--animated`].filter(Boolean).join(` `),"aria-hidden":`true`,style:{"--sh-tabs-indicator-offset":`${d.offset}px`,"--sh-tabs-indicator-size":`${d.size}px`}})]})}function nt({value:e,children:t,className:r,disabled:i,onClick:a,...o}){let{value:s,select:c,baseId:l}=q(`Tab`),u=s===e,d=[`sh-tabs__tab`,u&&`sh-tabs__tab--selected`,r].filter(Boolean).join(` `);return(0,n.jsx)(`button`,{type:`button`,role:`tab`,id:Ze(l,e),className:d,"data-value":e,"aria-selected":u,"aria-controls":Qe(l,e),tabIndex:u?0:-1,disabled:i,onClick:t=>{a?.(t),t.defaultPrevented||c(e)},...o,children:t})}function rt({value:e,children:t,keepMounted:r=!1,className:i,...a}){let{value:o,baseId:s}=q(`TabPanel`),c=o===e;return!c&&!r?null:(0,n.jsx)(`div`,{id:Qe(s,e),className:[`sh-tabs__panel`,i].filter(Boolean).join(` `),role:`tabpanel`,"aria-labelledby":Ze(s,e),hidden:!c,tabIndex:0,...a,children:t})}var it=e=>typeof e==`number`?`${e}px`:e;function at({variant:e=`text`,width:t,height:r,lines:i=1,animation:a=`pulse`,className:o,...s}){let c=[`sh-skeleton`,`sh-skeleton--${e}`,`sh-skeleton--${a}`].join(` `),l={width:it(t),height:it(r??(e===`circular`?t:void 0))};return e===`text`&&i>1?(0,n.jsx)(`div`,{className:[`sh-skeleton-lines`,o].filter(Boolean).join(` `),"aria-hidden":`true`,...s,children:Array.from({length:i},(e,t)=>(0,n.jsx)(`span`,{className:c,style:t===i-1?{...l,width:`60%`}:l},t))}):(0,n.jsx)(`span`,{className:[c,o].filter(Boolean).join(` `),style:l,"aria-hidden":`true`,...s})}var ot=[`text`,`rectangular`,`circular`],st=[`pulse`,`wave`,`none`];function ct({size:e=`md`,label:t=`Loading`,showLabel:i=!1,className:a,...o}){let s=(0,r.useId)(),c=[`sh-spinner`,`sh-spinner--${e}`,i&&`sh-spinner--with-label`,a].filter(Boolean).join(` `);return(0,n.jsxs)(`span`,{className:c,role:`status`,"aria-labelledby":s,...o,children:[(0,n.jsx)(`span`,{className:`sh-spinner__ring`,"aria-hidden":`true`}),(0,n.jsx)(`span`,{id:s,className:i?`sh-spinner__label`:`sh-spinner__label--visually-hidden`,children:t})]})}var lt=[`sm`,`md`,`lg`];function ut({value:e,max:t=100,label:i,showValue:a=!1,formatValue:o,size:s=`md`,"aria-label":c,className:l,...u}){let d=(0,r.useId)(),f=e===void 0,p=t>0?t:0,m=f?0:Math.min(Math.max(e,0),p),h=p===0?0:m/p*100,g=o?o(m,p):`${Math.round(h)}%`,_=[`sh-progress`,`sh-progress--${s}`,f&&`sh-progress--indeterminate`,l].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:_,...u,children:[(i||a&&!f)&&(0,n.jsxs)(`span`,{className:`sh-progress__header`,children:[i&&(0,n.jsx)(`span`,{className:`sh-progress__label`,id:d,children:i}),a&&!f&&(0,n.jsx)(`span`,{className:`sh-progress__value`,children:g})]}),(0,n.jsx)(`div`,{className:`sh-progress__track`,role:`progressbar`,"aria-label":i?void 0:c,"aria-labelledby":i?d:void 0,"aria-valuemin":0,"aria-valuemax":p,"aria-valuenow":f?void 0:m,"aria-valuetext":f?void 0:o?g:void 0,children:(0,n.jsx)(`div`,{className:`sh-progress__bar`,style:{"--sh-progress-fill":`${h}%`}})})]})}var dt=[`sm`,`md`,`lg`],ft={success:(0,n.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,"aria-hidden":`true`,children:[(0,n.jsx)(`circle`,{cx:`10`,cy:`10`,r:`7.5`}),(0,n.jsx)(`path`,{d:`M6.75 10.25l2.25 2.25 4.25-4.75`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),info:(0,n.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,"aria-hidden":`true`,children:[(0,n.jsx)(`circle`,{cx:`10`,cy:`10`,r:`7.5`}),(0,n.jsx)(`path`,{d:`M10 9v4.5`,strokeLinecap:`round`}),(0,n.jsx)(`circle`,{cx:`10`,cy:`6.4`,r:`0.9`,fill:`currentColor`,stroke:`none`})]}),warning:(0,n.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,"aria-hidden":`true`,children:[(0,n.jsx)(`path`,{d:`M10 2.8 18 16.5H2L10 2.8Z`,strokeLinejoin:`round`}),(0,n.jsx)(`path`,{d:`M10 8v3.5`,strokeLinecap:`round`}),(0,n.jsx)(`circle`,{cx:`10`,cy:`13.9`,r:`0.9`,fill:`currentColor`,stroke:`none`})]}),error:(0,n.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,"aria-hidden":`true`,children:[(0,n.jsx)(`circle`,{cx:`10`,cy:`10`,r:`7.5`}),(0,n.jsx)(`path`,{d:`M7.5 7.5l5 5M12.5 7.5l-5 5`,strokeLinecap:`round`})]})},pt=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M4.5 4.5l7 7M11.5 4.5l-7 7`,strokeLinecap:`round`})}),mt={success:`status`,info:`status`,warning:`alert`,error:`alert`};function ht({variant:e=`info`,title:t,children:r,icon:i,onDismiss:a,dismissLabel:o=`Dismiss`,role:s,className:c,...l}){let u=[`sh-alert`,`sh-alert--${e}`,c].filter(Boolean).join(` `),d=i===void 0?ft[e]:i;return(0,n.jsxs)(`div`,{className:u,role:s??mt[e],...l,children:[d!==!1&&(0,n.jsx)(`span`,{className:`sh-alert__icon`,children:d}),(0,n.jsxs)(`div`,{className:`sh-alert__content`,children:[t&&(0,n.jsx)(`p`,{className:`sh-alert__title`,children:t}),r&&(0,n.jsx)(`div`,{className:`sh-alert__body`,children:r})]}),a&&(0,n.jsx)(`button`,{type:`button`,className:`sh-alert__dismiss`,onClick:a,"aria-label":o,children:(0,n.jsx)(pt,{})})]})}var gt=[`success`,`info`,`warning`,`error`];function J(e,t){if(!t)return!0;let n=t.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);if(n.length===0)return!0;let r=e.name.toLowerCase(),i=e.type.toLowerCase();return n.some(e=>e.startsWith(`.`)?r.endsWith(e):e.endsWith(`/*`)?i.startsWith(e.slice(0,-1)):i===e)}function _t(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`,`TB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${Math.round(n*10)/10} ${t[r]}`}var vt=()=>(0,n.jsxs)(`svg`,{className:`sh-filedrop__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,n.jsx)(`path`,{d:`M12 16V4m0 0L8 8m4-4 4 4`}),(0,n.jsx)(`path`,{d:`M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3`})]}),yt=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M4.5 4.5l7 7M11.5 4.5l-7 7`,strokeLinecap:`round`})});function bt({label:e,helperText:t,error:i,placeholder:a=`Drag files here, or click to browse`,accept:o,multiple:s=!1,value:c,defaultValue:l,onChange:u,onReject:d,hideFileList:f=!1,disabled:p=!1,name:m,"aria-label":h,className:g,inputClassName:_}){let v=(0,r.useId)(),y=(0,r.useId)(),[b,x]=(0,r.useState)(l??[]),S=c!==void 0,C=S?c:b,[w,T]=(0,r.useState)(!1),E=(0,r.useRef)(0),D=!!i,O=i??t,k=e=>{S||x(e),u?.(e)},A=e=>{let t=e.filter(e=>J(e,o)),n=e.filter(e=>!J(e,o));n.length>0&&d?.(n),t.length!==0&&k(s?[...C,...t]:[t[0]])},j=e=>{A(Array.from(e.target.files??[])),e.target.value=``},M=e=>{p||(e.preventDefault(),E.current+=1,T(!0))},N=e=>{p||e.preventDefault()},P=e=>{p||(e.preventDefault(),--E.current,E.current<=0&&(E.current=0,T(!1)))},F=e=>{p||(e.preventDefault(),E.current=0,T(!1),A(Array.from(e.dataTransfer?.files??[])))},I=e=>{k(C.filter((t,n)=>n!==e))},L=[`sh-filedrop`,D&&`sh-filedrop--invalid`,p&&`sh-filedrop--disabled`,w&&`sh-filedrop--dragging`,g].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:L,children:[e&&(0,n.jsx)(`label`,{className:`sh-filedrop__label`,htmlFor:v,children:e}),(0,n.jsxs)(`label`,{className:`sh-filedrop__dropzone`,onDragEnter:M,onDragOver:N,onDragLeave:P,onDrop:F,children:[(0,n.jsx)(`input`,{id:v,type:`file`,className:[`sh-filedrop__input`,_].filter(Boolean).join(` `),accept:o,multiple:s,disabled:p,name:m,onChange:j,"aria-label":e?void 0:h,"aria-invalid":D||void 0,"aria-describedby":O?y:void 0}),(0,n.jsxs)(`span`,{className:`sh-filedrop__prompt`,"aria-hidden":`true`,children:[(0,n.jsx)(vt,{}),(0,n.jsx)(`span`,{className:`sh-filedrop__placeholder`,children:a}),o&&(0,n.jsx)(`span`,{className:`sh-filedrop__accept`,children:o})]})]}),!f&&C.length>0&&(0,n.jsx)(`ul`,{className:`sh-filedrop__files`,children:C.map((e,t)=>(0,n.jsxs)(`li`,{className:`sh-filedrop__file`,children:[(0,n.jsx)(`span`,{className:`sh-filedrop__file-name`,children:e.name}),(0,n.jsx)(`span`,{className:`sh-filedrop__file-size`,children:_t(e.size)}),(0,n.jsx)(`button`,{type:`button`,className:`sh-filedrop__file-remove`,onClick:()=>I(t),disabled:p,"aria-label":`Remove ${e.name}`,children:(0,n.jsx)(yt,{})})]},`${e.name}-${t}`))}),O&&(0,n.jsx)(`span`,{id:y,className:`sh-filedrop__message`,children:O})]})}function xt({label:e,helperText:t,error:i,value:a,defaultValue:o,onChange:s,min:c=0,max:l=100,step:u=1,showValue:d=!1,formatValue:f,className:p,inputClassName:m,id:h,disabled:g,"aria-describedby":_,...v}){let y=(0,r.useId)(),b=h??y,x=`${b}-message`,[S,C]=(0,r.useState)(o??c),w=a!==void 0,T=w?a:S,E=!!i,D=i??t,O=[_,D?x:void 0].filter(Boolean).join(` `)||void 0,k=e=>{let t=Number(e.target.value);w||C(t),s?.(t)},A=l===c?0:(T-c)/(l-c)*100,j=f?f(T):String(T),M=[`sh-range`,E&&`sh-range--invalid`,g&&`sh-range--disabled`,p].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:M,children:[(e||d)&&(0,n.jsxs)(`span`,{className:`sh-range__header`,children:[e&&(0,n.jsx)(`label`,{className:`sh-range__label`,htmlFor:b,children:e}),d&&(0,n.jsx)(`span`,{className:`sh-range__value`,children:j})]}),(0,n.jsx)(`input`,{...v,type:`range`,id:b,className:[`sh-range__input`,m].filter(Boolean).join(` `),style:{"--sh-range-fill":`${A}%`},min:c,max:l,step:u,value:T,disabled:g,onChange:k,"aria-invalid":E||void 0,"aria-describedby":O,"aria-valuetext":f?j:void 0}),D&&(0,n.jsx)(`span`,{id:x,className:`sh-range__message`,children:D})]})}function St({label:e,helperText:t,error:i,value:a,defaultValue:o,onChange:s,min:c=0,max:l=100,step:u=1,minGap:d=0,showValue:f=!1,formatValue:p,name:m,disabled:h=!1,"aria-label":g,className:_}){let v=(0,r.useId)(),y=(0,r.useId)(),[b,x]=(0,r.useState)(o??[c,l]),S=a!==void 0,[C,w]=S?a:b,T=!!i,E=i??t,D=e=>{S||x(e),s?.(e)},O=e=>{D([Math.min(Number(e.target.value),w-d),w])},k=e=>{D([C,Math.max(Number(e.target.value),C+d)])},A=e=>l===c?0:(e-c)/(l-c)*100,j=A(C),M=A(w),N=e=>p?p(e):String(e),P=C>(c+l)/2,F=[`sh-minmax`,T&&`sh-minmax--invalid`,h&&`sh-minmax--disabled`,P&&`sh-minmax--from-on-top`,_].filter(Boolean).join(` `),I=e?void 0:g,L=t=>e||g?`${e??g} ${t}`:t;return(0,n.jsxs)(`div`,{className:F,style:{"--sh-minmax-from":`${j}%`,"--sh-minmax-to":`${M}%`},children:[(e||f)&&(0,n.jsxs)(`span`,{className:`sh-minmax__header`,children:[e&&(0,n.jsx)(`span`,{className:`sh-minmax__label`,id:v,children:e}),f&&(0,n.jsxs)(`span`,{className:`sh-minmax__value`,children:[N(C),` – `,N(w)]})]}),(0,n.jsxs)(`div`,{className:`sh-minmax__rail`,role:`group`,"aria-label":I,"aria-labelledby":e?v:void 0,"aria-describedby":E?y:void 0,"aria-invalid":T||void 0,children:[(0,n.jsx)(`span`,{className:`sh-minmax__track`,"aria-hidden":`true`,children:(0,n.jsx)(`span`,{className:`sh-minmax__fill`})}),(0,n.jsx)(`input`,{type:`range`,className:`sh-minmax__input sh-minmax__input--from`,name:m?`${m}-min`:void 0,min:c,max:l,step:u,value:C,disabled:h,onChange:O,"aria-label":L(`minimum`),"aria-valuetext":p?N(C):void 0}),(0,n.jsx)(`input`,{type:`range`,className:`sh-minmax__input sh-minmax__input--to`,name:m?`${m}-max`:void 0,min:c,max:l,step:u,value:w,disabled:h,onChange:k,"aria-label":L(`maximum`),"aria-valuetext":p?N(w):void 0})]}),E&&(0,n.jsx)(`span`,{id:y,className:`sh-minmax__message`,children:E})]})}var Ct=(0,r.createContext)(void 0);function wt({value:e,label:t,labelPosition:i,className:a,inputClassName:o,name:s,checked:c,disabled:l,onChange:u,...d}){let f=(0,r.useContext)(Ct),p=s??f?.name,m=f&&e!==void 0?f.value.includes(e):c,h=l??f?.disabled,g=i??f?.labelPosition??`right`,_=t=>{f&&e!==void 0&&f.onToggle(e,t.target.checked),u?.(t)},v=[`sh-switch`,`sh-switch--label-${g}`,h&&`sh-switch--disabled`,a].filter(Boolean).join(` `);return(0,n.jsxs)(`label`,{className:v,children:[(0,n.jsx)(`input`,{...d,type:`checkbox`,role:`switch`,className:[`sh-switch__input`,o].filter(Boolean).join(` `),name:p,value:e,checked:m,disabled:h,onChange:_}),(0,n.jsx)(`span`,{className:`sh-switch__track`,"aria-hidden":`true`,children:(0,n.jsx)(`span`,{className:`sh-switch__thumb`})}),t&&(0,n.jsx)(`span`,{className:`sh-switch__label`,children:t})]})}function Tt({children:e,value:t,defaultValue:i,onChange:a,label:o,helperText:s,error:c,name:l,orientation:u=`vertical`,labelPosition:d,disabled:f=!1,"aria-label":p,className:m}){let h=(0,r.useId)(),g=(0,r.useId)(),_=(0,r.useId)(),v=l??h,[y,b]=(0,r.useState)(i??[]),x=t!==void 0,S=x?t:y,C=(e,t)=>{let n=t?[...S,e]:S.filter(t=>t!==e);x||b(n),a?.(n)},w=!!c,T=c??s,E=[`sh-switch-group`,w&&`sh-switch-group--invalid`,m].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:E,children:[o&&(0,n.jsx)(`span`,{className:`sh-switch-group__label`,id:g,children:o}),(0,n.jsx)(`div`,{className:`sh-switch-group__options sh-switch-group__options--${u}`,role:`group`,"aria-label":o?void 0:p,"aria-labelledby":o?g:void 0,"aria-describedby":T?_:void 0,"aria-invalid":w||void 0,children:(0,n.jsx)(Ct.Provider,{value:{name:v,value:S,onToggle:C,disabled:f,labelPosition:d},children:e})}),T&&(0,n.jsx)(`span`,{id:_,className:`sh-switch-group__message`,children:T})]})}function Et({options:e,value:t,defaultValue:i,onChange:a,label:o,name:s,fullWidth:c=!1,disabled:l=!1,"aria-label":u,className:d}){let f=(0,r.useId)(),p=(0,r.useId)(),m=s??f,[h,g]=(0,r.useState)(i),_=t!==void 0,v=_?t:h,y=e=>{_||g(e),a?.(e)},b=e.findIndex(e=>e.value===v),x=[`sh-segmented`,c&&`sh-segmented--full-width`,l&&`sh-segmented--disabled`,b<0&&`sh-segmented--unselected`,d].filter(Boolean).join(` `),S={"--sh-segmented-count":e.length,"--sh-segmented-index":Math.max(b,0)};return(0,n.jsxs)(`div`,{className:`sh-segmented-field`,children:[o&&(0,n.jsx)(`span`,{className:`sh-segmented__group-label`,id:p,children:o}),(0,n.jsx)(`div`,{className:x,style:S,role:`radiogroup`,"aria-label":o?void 0:u,"aria-labelledby":o?p:void 0,children:e.map(e=>{let t=l||e.disabled;return(0,n.jsxs)(`label`,{className:[`sh-segmented__item`,t&&`sh-segmented__item--disabled`].filter(Boolean).join(` `),children:[(0,n.jsx)(`input`,{className:`sh-segmented__input`,type:`radio`,name:m,value:e.value,checked:v===e.value,disabled:t,onChange:()=>y(e.value)}),(0,n.jsx)(`span`,{className:`sh-segmented__label`,children:e.label})]},e.value)})})]})}var Dt=t({accent:()=>Y,accentFill:()=>Q,colorVar:()=>jt,danger:()=>Z,neutral:()=>X,palette:()=>Ot,paletteVar:()=>$,semanticColors:()=>At}),Y={50:`#f6f0ff`,100:`#ece0ff`,200:`#d9c2ff`,300:`#c19dff`,400:`#a672ff`,500:`#8b47fa`,600:`#7429e0`,700:`#5d1fb8`,800:`#461890`,900:`#331269`,950:`#1f0b40`},X={0:`#ffffff`,50:`#f8f7fa`,100:`#efedf3`,200:`#e2dfe8`,300:`#cac6d3`,400:`#a29cae`,500:`#79728a`,600:`#5a5468`,700:`#423d4d`,800:`#2c2836`,900:`#1a1720`,950:`#0d0b12`},Z={50:`#fef3f2`,100:`#fee4e2`,200:`#fecdca`,300:`#fda29b`,400:`#f97066`,500:`#f04438`,600:`#d92d20`,700:`#b42318`,800:`#912018`,900:`#7a271a`,950:`#55160c`},Ot={accent:Y,neutral:X,danger:Z},Q={bg:Y[700],text:Y[100]},kt={"accent-fill-bg":Q.bg,"accent-fill-text":Q.text},At={light:{"bg-canvas":X[0],"bg-surface":X[50],"bg-subtle":X[100],text:X[900],"text-subtle":X[600],"text-inverse":X[0],border:X[200],"border-strong":X[300],accent:Y[600],"accent-hover":Y[700],"accent-subtle-bg":Y[50],"accent-subtle-text":Y[700],...kt,danger:Z[700],"danger-border":Z[500],scrim:`rgb(0 0 0 / 0.45)`,"accent-tint-1":Y[50],"accent-tint-2":Y[100],"accent-tint-3":Y[200],"accent-tint-4":Y[300],"accent-on-tint":Y[900]},dark:{"bg-canvas":X[950],"bg-surface":X[900],"bg-subtle":X[800],text:X[50],"text-subtle":X[400],"text-inverse":X[950],border:X[700],"border-strong":X[600],accent:Y[400],"accent-hover":Y[300],"accent-subtle-bg":Y[900],"accent-subtle-text":Y[200],...kt,danger:Z[300],"danger-border":Z[400],scrim:`rgb(0 0 0 / 0.65)`,"accent-tint-1":Y[950],"accent-tint-2":Y[900],"accent-tint-3":Y[800],"accent-tint-4":Y[700],"accent-on-tint":Y[100]}};function jt(e){return`var(--color-${e})`}function $(e,t){return`var(--color-${e}-${String(t)})`}exports.Accordion=Ie,exports.AccordionItem=Re,exports.Alert=ht,exports.Avatar=E,exports.AvatarGroup=D,exports.Breadcrumb=Je,exports.BreadcrumbItem=Ye,exports.Button=d,exports.Checkbox=Se,exports.CheckboxGroup=Ce,exports.Chip=b,exports.CodeBlock=ie,exports.Dialog=se,exports.Drawer=de,exports.Dropdown=I,exports.DropdownItem=z,exports.DropdownMenu=R,exports.DropdownSeparator=ee,exports.DropdownTrigger=L,exports.EmptyState=h,exports.FileDrop=bt,exports.Input=k,exports.InputOtp=N,exports.MinMaxSlider=St,exports.Pagination=je,exports.ProgressBar=ut,exports.Radio=Te,exports.RadioGroup=Ee,exports.RangeSlider=xt,exports.SegmentedControl=Et,exports.Select=ye,exports.Skeleton=at,exports.Spinner=ct,exports.Step=We,exports.Stepper=Ve,exports.Switch=wt,exports.SwitchGroup=Tt,exports.Tab=nt,exports.TabList=tt,exports.TabPanel=rt,exports.Tabs=$e,exports.Tag=g,exports.Text=l,exports.Textarea=be,exports.Tooltip=ge,exports.accentFill=Q,exports.alertVariants=gt,exports.avatarSizes=O,exports.buttonClassNames=u,exports.buttonSizes=p,exports.buttonVariants=f,exports.chipActions=S,exports.chipVariants=x,Object.defineProperty(exports,"colorTokens",{enumerable:!0,get:function(){return Dt}}),exports.colorVar=jt,exports.dedentCode=B,exports.dialogRoles=le,exports.dialogSizes=ce,exports.drawerSides=fe,exports.drawerSizes=pe,exports.formatFileSize=_t,exports.getPaginationRange=De,exports.isFileAccepted=J,exports.otpTypes=A,exports.palette=Ot,exports.paletteVar=$,exports.progressBarSizes=dt,exports.resolveTooltipPlacement=me,exports.sanitizeOtpValue=M,exports.semanticColors=At,exports.skeletonAnimations=st,exports.skeletonVariants=ot,exports.spinnerSizes=lt,exports.tagVariants=_,exports.textColors=o,exports.textVariants=a,exports.textWeights=s;
6
+ `:``]},t)):f})}),s&&(0,n.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sh-code-block__status`,children:m===`copied`?`Copied`:m===`error`?`Copy failed`:``})]})}function ae(e,t){if(!t)return e;let n=t===!0?typeof document>`u`?null:document.body:t;return n?(0,i.createPortal)(e,n):null}var V=0,H=null;function oe(){if(V===0){let{body:e}=document,t=e.style.overflow,n=e.style.paddingRight,r=window.innerWidth-document.documentElement.clientWidth;if(e.style.overflow=`hidden`,r>0){let t=Number.parseFloat(window.getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${t+r}px`}H=()=>{e.style.overflow=t,e.style.paddingRight=n}}V+=1;let e=!1;return()=>{e||(e=!0,--V,V===0&&(H?.(),H=null))}}function U({open:e,onClose:t,closeOnEscape:n,closeOnBackdropClick:i,initialFocus:a,lockScroll:o}){let s=(0,r.useRef)(null),c=(0,r.useRef)(null),l=(0,r.useId)();return(0,r.useEffect)(()=>{let t=s.current;if(t){if(!e){t.open&&t.close();return}return t.open||t.showModal(),a?.current?.focus(),o?oe():void 0}},[e,o]),(0,r.useEffect)(()=>{let e=s.current;if(!e)return;let r=e=>{e.preventDefault(),n&&t()};return e.addEventListener(`cancel`,r),()=>e.removeEventListener(`cancel`,r)},[n,t]),{titleId:`${l}-title`,descriptionId:`${l}-description`,surfaceProps:{ref:s,onMouseDown:e=>{c.current=e.target},onClick:e=>{i&&c.current===e.currentTarget&&e.target===e.currentTarget&&t()}}}}var se=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M4.5 4.5l7 7M11.5 4.5l-7 7`,strokeLinecap:`round`})});function ce({open:e,onClose:t,title:r,description:i,children:a,footer:o,size:s=`md`,role:c=`dialog`,closeOnEscape:l=!0,closeOnBackdropClick:u=!0,showClose:d=!0,closeLabel:f=`Close`,initialFocus:p,lockScroll:m=!0,portal:h=!1,className:g,..._}){let{titleId:v,descriptionId:y,surfaceProps:b}=U({open:e,onClose:t,closeOnEscape:l,closeOnBackdropClick:u,initialFocus:p,lockScroll:m});return ae((0,n.jsxs)(`dialog`,{role:c,"aria-labelledby":v,"aria-describedby":i?y:void 0,className:[`sh-dialog`,`sh-dialog--${s}`,g].filter(Boolean).join(` `),...b,..._,children:[(0,n.jsxs)(`div`,{className:`sh-dialog__header`,children:[(0,n.jsxs)(`div`,{className:`sh-dialog__heading`,children:[(0,n.jsx)(`h2`,{id:v,className:`sh-dialog__title`,children:r}),i&&(0,n.jsx)(`p`,{id:y,className:`sh-dialog__description`,children:i})]}),d&&(0,n.jsx)(`button`,{type:`button`,className:`sh-dialog__close`,"aria-label":f,onClick:t,children:(0,n.jsx)(se,{})})]}),a!=null&&a!==!1&&(0,n.jsx)(`div`,{className:`sh-dialog__body`,children:a}),o&&(0,n.jsx)(`div`,{className:`sh-dialog__footer`,children:o})]}),h)}var le=[`sm`,`md`,`lg`,`fullscreen`],ue=[`dialog`,`alertdialog`],de=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M4.5 4.5l7 7M11.5 4.5l-7 7`,strokeLinecap:`round`})});function fe({open:e,onClose:t,title:r,description:i,children:a,footer:o,side:s=`right`,size:c=`md`,closeOnEscape:l=!0,closeOnBackdropClick:u=!0,showClose:d=!0,closeLabel:f=`Close`,initialFocus:p,lockScroll:m=!0,portal:h=!1,className:g,..._}){let{titleId:v,descriptionId:y,surfaceProps:b}=U({open:e,onClose:t,closeOnEscape:l,closeOnBackdropClick:u,initialFocus:p,lockScroll:m});return ae((0,n.jsxs)(`dialog`,{"aria-labelledby":v,"aria-describedby":i?y:void 0,className:[`sh-drawer`,`sh-drawer--${s}`,`sh-drawer--${c}`,g].filter(Boolean).join(` `),...b,..._,children:[(0,n.jsxs)(`div`,{className:`sh-drawer__header`,children:[(0,n.jsxs)(`div`,{className:`sh-drawer__heading`,children:[(0,n.jsx)(`h2`,{id:v,className:`sh-drawer__title`,children:r}),i&&(0,n.jsx)(`p`,{id:y,className:`sh-drawer__description`,children:i})]}),d&&(0,n.jsx)(`button`,{type:`button`,className:`sh-drawer__close`,"aria-label":f,onClick:t,children:(0,n.jsx)(de,{})})]}),a!=null&&a!==!1&&(0,n.jsx)(`div`,{className:`sh-drawer__body`,children:a}),o&&(0,n.jsx)(`div`,{className:`sh-drawer__footer`,children:o})]}),h)}var pe=[`left`,`right`,`top`,`bottom`],me=[`sm`,`md`,`lg`,`full`],he={top:`bottom`,bottom:`top`,left:`right`,right:`left`},ge=[`top`,`bottom`,`right`,`left`],_e=12;function ve({trigger:e,tip:t,viewport:n,gap:r=8,preferred:i=`top`}){let a={top:e.top,bottom:n.height-e.bottom,left:e.left,right:n.width-e.right},o={top:t.height+r,bottom:t.height+r,left:t.width+r,right:t.width+r},s=[i,he[i]];for(let e of ge)s.includes(e)||s.push(e);return s.find(e=>a[e]>=o[e])||s.reduce((e,t)=>a[t]-o[t]>a[e]-o[e]?t:e)}function ye({side:e,trigger:t,tip:n,viewport:r,padding:i=8}){let a=e===`top`||e===`bottom`,o=a?n.width:n.height,s=a?r.width:r.height,c=(a?(t.left+t.right)/2:(t.top+t.bottom)/2)-o/2,l=c+o,u=0;l>s-i&&(u=s-i-l),c+u<i&&(u=i-c);let d=Math.max(0,o/2-_e);return Math.min(d,Math.max(-d,u))}var be=typeof window>`u`?r.useEffect:r.useLayoutEffect;function xe({children:e,content:t,placement:i=`top`,avoidCollisions:a=!0,delay:o=150,open:s,defaultOpen:c=!1,onOpenChange:l,disabled:u=!1,className:d,...f}){let p=(0,r.useId)(),m=(0,r.useRef)(void 0),h=(0,r.useRef)(null),g=(0,r.useRef)(null),_=(0,r.useRef)(!1),[v,y]=(0,r.useState)(c),b=s!==void 0,x=b?s:v,S=!u&&t!=null&&t!==``,C=()=>{m.current!==void 0&&(window.clearTimeout(m.current),m.current=void 0)},w=(0,r.useCallback)(e=>{b||y(e),l?.(e)},[b,l]),T=()=>{!S||x||_.current||(C(),o>0?m.current=window.setTimeout(()=>w(!0),o):w(!0))},E=()=>{C(),x&&w(!1)};(0,r.useEffect)(()=>C,[]);let D=i===`auto`?`top`:i,[O,k]=(0,r.useState)(null),A=a&&O?.preferred===D?O:{side:D,shift:0},j=A.side;if(be(()=>{if(!a||!x||!S)return;let e=()=>{let e=h.current,t=g.current;if(!e||!t)return;let n={width:t.offsetWidth,height:t.offsetHeight};if(n.width===0&&n.height===0)return;let r=e.getBoundingClientRect(),i={width:window.innerWidth,height:window.innerHeight},a=ve({trigger:r,tip:n,viewport:i,preferred:D}),o=ye({side:a,trigger:r,tip:n,viewport:i});k(e=>e?.preferred===D&&e.side===a&&e.shift===o?e:{preferred:D,side:a,shift:o})};return e(),window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[a,D,x,S]),(0,r.useEffect)(()=>{if(!x||!S)return;let e=e=>{e.key===`Escape`&&w(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[x,S,w]),!(0,r.isValidElement)(e))throw Error(`<Tooltip> expects a single element child to describe.`);let M=S?(0,r.cloneElement)(e,{"aria-describedby":[e.props[`aria-describedby`],p].filter(Boolean).join(` `)}):e;return(0,n.jsxs)(`span`,{ref:h,className:[`sh-tooltip`,d].filter(Boolean).join(` `),onMouseEnter:T,onMouseLeave:()=>{_.current=!1,E()},onFocus:T,onBlur:()=>{_.current=!1,E()},onMouseDown:()=>{_.current=!0,E()},...f,children:[M,S&&(0,n.jsx)(`span`,{ref:g,id:p,role:`tooltip`,className:[`sh-tooltip__tip`,`sh-tooltip__tip--${j}`,x&&`sh-tooltip__tip--open`].filter(Boolean).join(` `),style:A.shift?{"--sh-tooltip-shift":`${A.shift}px`}:void 0,children:t})]})}var Se=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M4 6.5 8 10.5l4-4`,strokeLinecap:`round`,strokeLinejoin:`round`})}),Ce=e=>`options`in e;function we({label:e,helperText:t,error:i,options:a,placeholder:o,icon:s,className:c,selectClassName:l,children:u,id:d,required:f,disabled:p,multiple:m,"aria-describedby":h,...g}){let _=(0,r.useId)(),v=d??_,y=`${v}-message`,b=!!i,x=i??t,S=[h,x?y:void 0].filter(Boolean).join(` `)||void 0,C=[`sh-select`,b&&`sh-select--invalid`,p&&`sh-select--disabled`,s&&`sh-select--with-icon`,m&&`sh-select--multiple`,c].filter(Boolean).join(` `),w=e=>(0,n.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value);return(0,n.jsxs)(`div`,{className:C,children:[e&&(0,n.jsxs)(`label`,{className:`sh-select__label`,htmlFor:v,children:[e,f&&(0,n.jsx)(`span`,{className:`sh-select__required`,"aria-hidden":`true`,children:`*`})]}),(0,n.jsxs)(`span`,{className:`sh-select__field`,children:[s&&(0,n.jsx)(`span`,{className:`sh-select__icon`,"aria-hidden":`true`,children:s}),(0,n.jsxs)(`select`,{...g,id:v,className:[`sh-select__control`,l].filter(Boolean).join(` `),required:f,disabled:p,multiple:m,"aria-invalid":b||void 0,"aria-describedby":S,children:[o&&(0,n.jsx)(`option`,{value:``,disabled:!0,children:o}),a?a.map(e=>Ce(e)?(0,n.jsx)(`optgroup`,{label:e.label,children:e.options.map(w)},e.label):w(e)):u]}),!m&&(0,n.jsx)(`span`,{className:`sh-select__chevron`,"aria-hidden":`true`,children:(0,n.jsx)(Se,{})})]}),x&&(0,n.jsx)(`span`,{id:y,className:`sh-select__message`,children:x})]})}function Te({label:e,helperText:t,error:i,resize:a=`vertical`,className:o,textareaClassName:s,id:c,rows:l=3,required:u,disabled:d,"aria-describedby":f,...p}){let m=(0,r.useId)(),h=c??m,g=`${h}-message`,_=!!i,v=i??t,y=[f,v?g:void 0].filter(Boolean).join(` `)||void 0,b=[`sh-textarea`,_&&`sh-textarea--invalid`,d&&`sh-textarea--disabled`,o].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:b,children:[e&&(0,n.jsxs)(`label`,{className:`sh-textarea__label`,htmlFor:h,children:[e,u&&(0,n.jsx)(`span`,{className:`sh-textarea__required`,"aria-hidden":`true`,children:`*`})]}),(0,n.jsx)(`textarea`,{id:h,className:[`sh-textarea__control`,`sh-textarea__control--resize-${a}`,s].filter(Boolean).join(` `),rows:l,required:u,disabled:d,"aria-invalid":_||void 0,"aria-describedby":y,...p}),v&&(0,n.jsx)(`span`,{id:g,className:`sh-textarea__message`,children:v})]})}var Ee=(0,r.createContext)(void 0);function De({value:e,label:t,indeterminate:i=!1,className:a,inputClassName:o,name:s,checked:c,disabled:l,onChange:u,ref:d,...f}){let p=(0,r.useContext)(Ee),m=(0,r.useRef)(null);(0,r.useEffect)(()=>{m.current&&(m.current.indeterminate=i)},[i]);let h=e=>{m.current=e,typeof d==`function`?d(e):d&&(d.current=e)},g=s??p?.name,_=p&&e!==void 0?p.value.includes(e):c,v=l??p?.disabled,y=t=>{p&&e!==void 0&&p.onToggle(e,t.target.checked),u?.(t)},b=[`sh-checkbox`,v&&`sh-checkbox--disabled`,a].filter(Boolean).join(` `);return(0,n.jsxs)(`label`,{className:b,children:[(0,n.jsx)(`input`,{...f,type:`checkbox`,ref:h,className:[`sh-checkbox__input`,o].filter(Boolean).join(` `),name:g,value:e,checked:_,disabled:v,onChange:y}),t&&(0,n.jsx)(`span`,{className:`sh-checkbox__label`,children:t})]})}function Oe({children:e,value:t,defaultValue:i,onChange:a,label:o,helperText:s,error:c,name:l,orientation:u=`vertical`,disabled:d=!1,"aria-label":f,className:p}){let m=(0,r.useId)(),h=(0,r.useId)(),g=(0,r.useId)(),_=l??m,[v,y]=(0,r.useState)(i??[]),b=t!==void 0,x=b?t:v,S=(e,t)=>{let n=t?[...x,e]:x.filter(t=>t!==e);b||y(n),a?.(n)},C=!!c,w=c??s,T=[`sh-checkbox-group`,C&&`sh-checkbox-group--invalid`,p].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:T,children:[o&&(0,n.jsx)(`span`,{className:`sh-checkbox-group__label`,id:h,children:o}),(0,n.jsx)(`div`,{className:`sh-checkbox-group__options sh-checkbox-group__options--${u}`,role:`group`,"aria-label":o?void 0:f,"aria-labelledby":o?h:void 0,"aria-describedby":w?g:void 0,"aria-invalid":C||void 0,children:(0,n.jsx)(Ee.Provider,{value:{name:_,value:x,onToggle:S,disabled:d},children:e})}),w&&(0,n.jsx)(`span`,{id:g,className:`sh-checkbox-group__message`,children:w})]})}var ke=(0,r.createContext)(void 0);function Ae({value:e,label:t,className:i,inputClassName:a,name:o,checked:s,disabled:c,onChange:l,...u}){let d=(0,r.useContext)(ke),f=o??d?.name,p=d?d.value===e:s,m=c??d?.disabled,h=t=>{d&&e!==void 0&&d.onSelect(e),l?.(t)},g=[`sh-radio`,m&&`sh-radio--disabled`,i].filter(Boolean).join(` `);return(0,n.jsxs)(`label`,{className:g,children:[(0,n.jsx)(`input`,{type:`radio`,className:[`sh-radio__input`,a].filter(Boolean).join(` `),name:f,value:e,checked:p,disabled:m,onChange:h,...u}),t&&(0,n.jsx)(`span`,{className:`sh-radio__label`,children:t})]})}function je({children:e,value:t,defaultValue:i,onChange:a,label:o,helperText:s,error:c,name:l,orientation:u=`vertical`,disabled:d=!1,"aria-label":f,className:p}){let m=(0,r.useId)(),h=(0,r.useId)(),g=(0,r.useId)(),_=l??m,[v,y]=(0,r.useState)(i),b=t!==void 0,x=b?t:v,S=e=>{b||y(e),a?.(e)},C=!!c,w=c??s,T=[`sh-radio-group`,C&&`sh-radio-group--invalid`,p].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:T,children:[o&&(0,n.jsx)(`span`,{className:`sh-radio-group__label`,id:h,children:o}),(0,n.jsx)(`div`,{className:`sh-radio-group__options sh-radio-group__options--${u}`,role:`radiogroup`,"aria-label":o?void 0:f,"aria-labelledby":o?h:void 0,"aria-describedby":w?g:void 0,"aria-invalid":C||void 0,children:(0,n.jsx)(ke.Provider,{value:{name:_,value:x,onSelect:S,disabled:d},children:e})}),w&&(0,n.jsx)(`span`,{id:g,className:`sh-radio-group__message`,children:w})]})}var W=(e,t)=>t<e?[]:Array.from({length:t-e+1},(t,n)=>e+n);function G({page:e,count:t,siblingCount:n=1,boundaryCount:r=1}){if(t<=0)return[];let i=W(1,Math.min(r,t)),a=W(Math.max(t-r+1,r+1),t),o=Math.max(Math.min(e-n,t-r-n*2-1),r+2),s=Math.min(Math.max(e+n,r+n*2+2),a.length>0?a[0]-2:t-1);return[...i,...o>r+2?[`ellipsis`]:r+1<t-r?[r+1]:[],...W(o,s),...s<t-r-1?[`ellipsis`]:t-r>r?[t-r]:[],...a]}var Me=({direction:e})=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:e===`left`?`M10 3.5 5.5 8l4.5 4.5`:`M6 3.5 10.5 8 6 12.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),Ne=({direction:e})=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:e===`left`?`M8 3.5 3.5 8 8 12.5M13 3.5 8.5 8l4.5 4.5`:`M8 3.5 12.5 8 8 12.5M3 3.5 7.5 8 3 12.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),Pe={first:`First page`,previous:`Previous page`,next:`Next page`,last:`Last page`,page:e=>`Page ${e}`};function Fe({count:e,page:t,defaultPage:i=1,onChange:a,siblingCount:o=1,boundaryCount:s=1,showFirstLast:c=!1,hidePrevNext:l=!1,disabled:u=!1,labels:d,"aria-label":f=`Pagination`,className:p,...m}){let[h,g]=(0,r.useState)(i),_=t!==void 0,v=_?t:h,y={...Pe,...d},b=t=>{t<1||t>e||t===v||(_||g(t),a?.(t))},x=G({page:v,count:e,siblingCount:o,boundaryCount:s});if(e<=0)return null;let S=(t,r,i,a)=>(0,n.jsx)(`li`,{className:`sh-pagination__item`,children:(0,n.jsx)(`button`,{type:`button`,className:`sh-pagination__control`,onClick:()=>b(i),disabled:u||i<1||i>e||i===v,"aria-label":r,children:a})},t);return(0,n.jsx)(`nav`,{className:[`sh-pagination`,p].filter(Boolean).join(` `),"aria-label":f,...m,children:(0,n.jsxs)(`ul`,{className:`sh-pagination__list`,children:[c&&S(`first`,y.first,1,(0,n.jsx)(Ne,{direction:`left`})),!l&&S(`prev`,y.previous,v-1,(0,n.jsx)(Me,{direction:`left`})),x.map((e,t)=>e===`ellipsis`?(0,n.jsx)(`li`,{className:`sh-pagination__item`,children:(0,n.jsx)(`span`,{className:`sh-pagination__ellipsis`,"aria-hidden":`true`,children:`…`})},`ellipsis-${t}`):(0,n.jsx)(`li`,{className:`sh-pagination__item`,children:(0,n.jsx)(`button`,{type:`button`,className:[`sh-pagination__page`,e===v&&`sh-pagination__page--current`].filter(Boolean).join(` `),onClick:()=>b(e),disabled:u,"aria-label":y.page(e),"aria-current":e===v?`page`:void 0,children:e})},e)),!l&&S(`next`,y.next,v+1,(0,n.jsx)(Me,{direction:`right`})),c&&S(`last`,y.last,e,(0,n.jsx)(Ne,{direction:`right`}))]})})}var Ie=(0,r.createContext)(void 0);function Le(e){let t=(0,r.useContext)(Ie);if(!t)throw Error(`<${e}> must be rendered inside <Accordion>.`);return t}var Re=(e,t)=>`${e}-trigger-${t}`,ze=(e,t)=>`${e}-panel-${t}`;function Be({children:e,type:t=`single`,value:i,defaultValue:a,onChange:o,collapsible:s=!0,headingLevel:c=3,className:l,...u}){let d=(0,r.useId)(),[f,p]=(0,r.useState)(a??[]),m=i!==void 0,h=m?i:f;return(0,n.jsx)(Ie.Provider,{value:{value:h,toggle:e=>{let n=h.includes(e),r;r=t===`multiple`?n?h.filter(t=>t!==e):[...h,e]:n?s?[]:h:[e],m||p(r),o?.(r)},baseId:d,headingLevel:c},children:(0,n.jsx)(`div`,{className:[`sh-accordion`,l].filter(Boolean).join(` `),...u,children:e})})}var Ve=()=>(0,n.jsx)(`svg`,{className:`sh-accordion__chevron`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M4 6.5 8 10.5l4-4`,strokeLinecap:`round`,strokeLinejoin:`round`})});function He({value:e,title:t,children:i,disabled:a=!1,className:o,...s}){let{value:c,toggle:l,baseId:u,headingLevel:d}=Le(`AccordionItem`),f=c.includes(e),p=(0,n.jsxs)(`button`,{type:`button`,id:Re(u,e),className:`sh-accordion__trigger`,"aria-expanded":f,"aria-controls":ze(u,e),disabled:a,onClick:()=>l(e),children:[(0,n.jsx)(`span`,{className:`sh-accordion__title`,children:t}),(0,n.jsx)(Ve,{})]});return(0,n.jsxs)(`div`,{className:[`sh-accordion__item`,f&&`sh-accordion__item--open`,a&&`sh-accordion__item--disabled`,o].filter(Boolean).join(` `),...s,children:[(0,r.createElement)(`h${d}`,{className:`sh-accordion__heading`},p),(0,n.jsx)(`div`,{id:ze(u,e),className:`sh-accordion__panel`,role:`region`,"aria-labelledby":Re(u,e),children:(0,n.jsx)(`div`,{className:`sh-accordion__panel-inner`,children:(0,n.jsx)(`div`,{className:`sh-accordion__content`,children:i})})})]})}var Ue=(0,r.createContext)(void 0);function We(e){let t=(0,r.useContext)(Ue);if(!t)throw Error(`<${e}> must be rendered inside <Stepper>.`);return t}function Ge({children:e,activeStep:t=0,orientation:i=`horizontal`,"aria-label":a=`Progress`,className:o,...s}){let c=r.Children.toArray(e).filter(r.isValidElement),l=e=>e<t?`complete`:e===t?`current`:`upcoming`;return(0,n.jsx)(`ol`,{className:[`sh-stepper`,`sh-stepper--${i}`,o].filter(Boolean).join(` `),"aria-label":a,...s,children:c.map((e,t)=>(0,n.jsx)(Ue.Provider,{value:{index:t,isLast:t===c.length-1,status:l(t),orientation:i},children:e},e.key??t))})}var Ke=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M3.5 8.5l3 3 6-6.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),qe=()=>(0,n.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:[(0,n.jsx)(`path`,{d:`M8 4.5v4.5`,strokeLinecap:`round`}),(0,n.jsx)(`circle`,{cx:`8`,cy:`11.6`,r:`0.9`,fill:`currentColor`,stroke:`none`})]});function Je({title:e,description:t,status:r,icon:i,onClick:a,disabled:o=!1,className:s}){let{index:c,isLast:l,status:u,orientation:d}=We(`Step`),f=r??u,p=i??(f===`complete`?(0,n.jsx)(Ke,{}):f===`error`?(0,n.jsx)(qe,{}):c+1),m=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`span`,{className:`sh-step__indicator`,children:p}),(0,n.jsxs)(`span`,{className:`sh-step__text`,children:[(0,n.jsx)(`span`,{className:`sh-step__title`,children:e}),t&&(0,n.jsx)(`span`,{className:`sh-step__description`,children:t})]})]});return(0,n.jsxs)(`li`,{className:[`sh-step`,`sh-step--${f}`,`sh-step--${d}`,l&&`sh-step--last`,s].filter(Boolean).join(` `),children:[a?(0,n.jsx)(`button`,{type:`button`,className:`sh-step__body sh-step__body--interactive`,onClick:a,disabled:o,"aria-current":f===`current`?`step`:void 0,children:m}):(0,n.jsx)(`span`,{className:`sh-step__body`,"aria-current":f===`current`?`step`:void 0,children:m}),!l&&(0,n.jsx)(`span`,{className:`sh-step__connector`,"aria-hidden":`true`})]})}var Ye=(0,r.createContext)(void 0);function Xe(e){let t=(0,r.useContext)(Ye);if(!t)throw Error(`<${e}> must be rendered inside <Breadcrumb>.`);return t}var Ze=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:(0,n.jsx)(`path`,{d:`M6 3.5 10.5 8 6 12.5`,strokeLinecap:`round`,strokeLinejoin:`round`})});function Qe({children:e,separator:t=(0,n.jsx)(Ze,{}),"aria-label":i=`Breadcrumb`,className:a,...o}){let s=r.Children.toArray(e).filter(r.isValidElement);return(0,n.jsx)(`nav`,{className:[`sh-breadcrumb`,a].filter(Boolean).join(` `),"aria-label":i,...o,children:(0,n.jsx)(`ol`,{className:`sh-breadcrumb__list`,children:s.map((e,r)=>(0,n.jsx)(Ye.Provider,{value:{isLast:r===s.length-1,separator:t},children:e},e.key??r))})})}function $e({children:e,href:t,current:r,className:i,...a}){let{isLast:o,separator:s}=Xe(`BreadcrumbItem`),c=r??o;return(0,n.jsxs)(`li`,{className:[`sh-breadcrumb__item`,i].filter(Boolean).join(` `),children:[c?(0,n.jsx)(`span`,{className:`sh-breadcrumb__current`,"aria-current":`page`,children:e}):t?(0,n.jsx)(`a`,{className:`sh-breadcrumb__link`,href:t,...a,children:e}):(0,n.jsx)(`span`,{className:`sh-breadcrumb__text`,children:e}),!o&&(0,n.jsx)(`span`,{className:`sh-breadcrumb__separator`,"aria-hidden":`true`,children:s})]})}var K=(0,r.createContext)(void 0);function q(e){let t=(0,r.useContext)(K);if(!t)throw Error(`<${e}> must be rendered inside <Tabs>.`);return t}var et=(e,t)=>`${e}-tab-${t}`,tt=(e,t)=>`${e}-panel-${t}`;function nt({children:e,value:t,defaultValue:i,onChange:a,orientation:o=`horizontal`,activation:s=`automatic`,className:c,...l}){let u=(0,r.useId)(),[d,f]=(0,r.useState)(i),p=t!==void 0,m=p?t:d,h=e=>{p||f(e),a?.(e)},g=[`sh-tabs`,`sh-tabs--${o}`,c].filter(Boolean).join(` `);return(0,n.jsx)(K.Provider,{value:{value:m,select:h,baseId:u,orientation:o,activation:s},children:(0,n.jsx)(`div`,{className:g,...l,children:e})})}var rt=typeof window>`u`?r.useEffect:r.useLayoutEffect;function it({children:e,className:t,onKeyDown:i,...a}){let{value:o,orientation:s,activation:c,select:l}=q(`TabList`),u=(0,r.useRef)(null),[d,f]=(0,r.useState)(null),p=s===`vertical`;return rt(()=>{let e=u.current;if(!e)return;let t=Array.from(e.querySelectorAll(`[role="tab"]`)).find(e=>e.dataset.value===o);if(!t){f(null);return}let n=()=>{let e=p?t.offsetTop:t.offsetLeft,n=p?t.offsetHeight:t.offsetWidth;f(t=>({offset:e,size:n,animated:t!==null}))};if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),r.observe(t),()=>r.disconnect()},[o,p]),(0,n.jsxs)(`div`,{ref:u,className:[`sh-tabs__list`,t].filter(Boolean).join(` `),role:`tablist`,"aria-orientation":s,onKeyDown:e=>{if(i?.(e),e.defaultPrevented||!u.current)return;let t=p?`ArrowDown`:`ArrowRight`;if(![t,p?`ArrowUp`:`ArrowLeft`,`Home`,`End`].includes(e.key))return;let n=Array.from(u.current.querySelectorAll(`[role="tab"]:not([disabled])`));if(n.length===0)return;let r=n.indexOf(document.activeElement),a;a=e.key===`Home`?0:e.key===`End`?n.length-1:r===-1?0:e.key===t?(r+1)%n.length:(r-1+n.length)%n.length;let o=n[a];if(o&&(e.preventDefault(),o.focus(),c===`automatic`)){let e=o.dataset.value;e!==void 0&&l(e)}},...a,children:[e,d&&(0,n.jsx)(`span`,{className:[`sh-tabs__indicator`,d.animated&&`sh-tabs__indicator--animated`].filter(Boolean).join(` `),"aria-hidden":`true`,style:{"--sh-tabs-indicator-offset":`${d.offset}px`,"--sh-tabs-indicator-size":`${d.size}px`}})]})}function at({value:e,children:t,className:r,disabled:i,onClick:a,...o}){let{value:s,select:c,baseId:l}=q(`Tab`),u=s===e,d=[`sh-tabs__tab`,u&&`sh-tabs__tab--selected`,r].filter(Boolean).join(` `);return(0,n.jsx)(`button`,{type:`button`,role:`tab`,id:et(l,e),className:d,"data-value":e,"aria-selected":u,"aria-controls":tt(l,e),tabIndex:u?0:-1,disabled:i,onClick:t=>{a?.(t),t.defaultPrevented||c(e)},...o,children:t})}function ot({value:e,children:t,keepMounted:r=!1,className:i,...a}){let{value:o,baseId:s}=q(`TabPanel`),c=o===e;return!c&&!r?null:(0,n.jsx)(`div`,{id:tt(s,e),className:[`sh-tabs__panel`,i].filter(Boolean).join(` `),role:`tabpanel`,"aria-labelledby":et(s,e),hidden:!c,tabIndex:0,...a,children:t})}var st=(0,r.createContext)(void 0);function J(e){let t=(0,r.useContext)(st);if(!t)throw Error(`<${e}> must be rendered inside <Carousel>.`);return t}var ct=(0,r.createContext)(void 0);function lt(e){let t=(0,r.useContext)(ct);if(t===void 0)throw Error(`<${e}> must be rendered inside <CarouselSlides>.`);return t}var ut=(e,t)=>`${e}-slide-${t}`;function dt(e,t,n){return t<=0?0:n?(Math.trunc(e)%t+t)%t:Math.min(Math.max(Math.trunc(e),0),t-1)}var ft=`(prefers-reduced-motion: reduce)`,pt=()=>typeof window<`u`&&typeof window.matchMedia==`function`;function mt(e){if(!pt())return()=>{};let t=window.matchMedia(ft);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}var ht=()=>pt()&&window.matchMedia(ft).matches;function gt(e){return typeof document>`u`?()=>{}:(document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e))}var _t=()=>typeof document<`u`&&document.hidden;function vt({enabled:e,interval:t,onTick:n}){let[i,a]=(0,r.useState)(!1),[o,s]=(0,r.useState)(!1),c=(0,r.useSyncExternalStore)(mt,ht,()=>!1),l=(0,r.useSyncExternalStore)(gt,_t,()=>!1),u=(0,r.useRef)(n);(0,r.useEffect)(()=>{u.current=n});let d=e&&!i&&!o&&!l&&!c;return(0,r.useEffect)(()=>{if(!d)return;let e=setInterval(()=>u.current(),t);return()=>clearInterval(e)},[d,t]),{pauseProps:{onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>s(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||s(!1)}}}}function yt({children:e,index:t,defaultIndex:i=0,onChange:a,loop:o=!0,autoPlay:s=!1,interval:c=5e3,"aria-label":l,className:u,...d}){let f=(0,r.useId)(),[p,m]=(0,r.useState)(i),[h,g]=(0,r.useState)(0),[_,v]=(0,r.useState)(!1),y=t!==void 0,b=y?t:p,x=h>0?dt(b,h,!1):b,S=s&&!_,C=(e,t=`user`)=>{t===`user`&&s&&v(!0);let n=dt(e,h,o);n!==x&&(y||m(n),a?.(n))},{pauseProps:w}=vt({enabled:S&&h>1,interval:c,onTick:()=>C(x+1,`auto`)}),T=[`sh-carousel`,u].filter(Boolean).join(` `);return(0,n.jsx)(st.Provider,{value:{index:x,count:h,setCount:g,goTo:C,loop:o,baseId:f,autoPlay:s,isPlaying:S,togglePlaying:()=>v(e=>!e)},children:(0,n.jsx)(`section`,{className:T,"aria-roledescription":`carousel`,"aria-label":l,...d,onMouseEnter:e=>{d.onMouseEnter?.(e),w.onMouseEnter(e)},onMouseLeave:e=>{d.onMouseLeave?.(e),w.onMouseLeave(e)},onFocus:e=>{d.onFocus?.(e),w.onFocus(e)},onBlur:e=>{d.onBlur?.(e),w.onBlur(e)},children:e})})}var bt=typeof window>`u`?r.useEffect:r.useLayoutEffect;function xt({children:e,className:t,onKeyDown:i,...a}){let{index:o,count:s,setCount:c,goTo:l,isPlaying:u}=J(`CarouselSlides`),d=r.Children.toArray(e);return bt(()=>{c(d.length)},[d.length,c]),(0,n.jsx)(`div`,{className:[`sh-carousel__viewport`,t].filter(Boolean).join(` `),"aria-live":u?`off`:`polite`,"aria-atomic":`false`,tabIndex:0,onKeyDown:e=>{if(i?.(e),e.defaultPrevented||s<=1)return;let t={ArrowLeft:o-1,ArrowRight:o+1,Home:0,End:s-1}[e.key];t!==void 0&&(e.preventDefault(),l(t,`user`))},...a,children:(0,n.jsx)(`div`,{className:`sh-carousel__track`,style:{"--sh-carousel-index":o},children:d.map((e,t)=>(0,n.jsx)(ct.Provider,{value:t,children:e},(0,r.isValidElement)(e)?e.key:t))})})}function St({children:e,className:t,...r}){let{index:i,count:a,baseId:o}=J(`CarouselSlide`),s=lt(`CarouselSlide`),c=s===i,l=[`sh-carousel__slide`,c&&`sh-carousel__slide--current`,t].filter(Boolean).join(` `);return(0,n.jsx)(`div`,{id:ut(o,s),className:l,role:`group`,"aria-roledescription":`slide`,"aria-label":`${s+1} of ${a}`,inert:!c,...r,children:e})}var Ct=({direction:e})=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:e===`left`?`M10 3.5 5.5 8l4.5 4.5`:`M6 3.5 10.5 8 6 12.5`,strokeLinecap:`round`,strokeLinejoin:`round`})});function wt({direction:e,component:t,defaultLabel:r,children:i,"aria-label":a=r,className:o,disabled:s,onClick:c,...l}){let{index:u,count:d,loop:f,goTo:p}=J(t),m=e===`next`,h=!f&&(m?u>=d-1:u<=0),g=[`sh-carousel__control`,`sh-carousel__control--${e}`,o].filter(Boolean).join(` `);return(0,n.jsx)(`button`,{type:`button`,className:g,"aria-label":a,disabled:s||h||d<=1,onClick:e=>{c?.(e),e.defaultPrevented||p(m?u+1:u-1,`user`)},...l,children:i??(0,n.jsx)(Ct,{direction:m?`right`:`left`})})}function Tt(e){return(0,n.jsx)(wt,{direction:`previous`,component:`CarouselPrevious`,defaultLabel:`Previous slide`,...e})}function Et(e){return(0,n.jsx)(wt,{direction:`next`,component:`CarouselNext`,defaultLabel:`Next slide`,...e})}function Dt({"aria-label":e=`Choose slide`,label:t=e=>`Slide ${e+1}`,className:r,...i}){let{index:a,count:o,goTo:s,baseId:c}=J(`CarouselDots`);return o<=1?null:(0,n.jsx)(`div`,{className:[`sh-carousel__dots`,r].filter(Boolean).join(` `),role:`group`,"aria-label":e,...i,children:Array.from({length:o},(e,r)=>{let i=r===a;return(0,n.jsx)(`button`,{type:`button`,className:[`sh-carousel__dot`,i&&`sh-carousel__dot--current`].filter(Boolean).join(` `),"aria-label":t(r),"aria-current":i?`true`:void 0,"aria-controls":ut(c,r),onClick:()=>s(r,`user`)},r)})})}var Ot=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M5.5 3.4a.6.6 0 0 1 .92-.51l6.1 4.1a.6.6 0 0 1 0 1l-6.1 4.1a.6.6 0 0 1-.92-.5Z`})}),kt=()=>(0,n.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,children:[(0,n.jsx)(`rect`,{x:`4`,y:`3`,width:`3`,height:`10`,rx:`1`}),(0,n.jsx)(`rect`,{x:`9`,y:`3`,width:`3`,height:`10`,rx:`1`})]});function At({labels:e,className:t,onClick:r,...i}){let{autoPlay:a,isPlaying:o,togglePlaying:s,count:c}=J(`CarouselPlayPause`);if(!a||c<=1)return null;let l={play:`Start slide rotation`,pause:`Stop slide rotation`,...e};return(0,n.jsx)(`button`,{type:`button`,className:[`sh-carousel__play-pause`,t].filter(Boolean).join(` `),"aria-label":o?l.pause:l.play,onClick:e=>{r?.(e),e.defaultPrevented||s()},...i,children:o?(0,n.jsx)(kt,{}):(0,n.jsx)(Ot,{})})}var jt=e=>typeof e==`number`?`${e}px`:e;function Mt({variant:e=`text`,width:t,height:r,lines:i=1,animation:a=`pulse`,className:o,...s}){let c=[`sh-skeleton`,`sh-skeleton--${e}`,`sh-skeleton--${a}`].join(` `),l={width:jt(t),height:jt(r??(e===`circular`?t:void 0))};return e===`text`&&i>1?(0,n.jsx)(`div`,{className:[`sh-skeleton-lines`,o].filter(Boolean).join(` `),"aria-hidden":`true`,...s,children:Array.from({length:i},(e,t)=>(0,n.jsx)(`span`,{className:c,style:t===i-1?{...l,width:`60%`}:l},t))}):(0,n.jsx)(`span`,{className:[c,o].filter(Boolean).join(` `),style:l,"aria-hidden":`true`,...s})}var Nt=[`text`,`rectangular`,`circular`],Pt=[`pulse`,`wave`,`none`];function Ft({size:e=`md`,label:t=`Loading`,showLabel:i=!1,className:a,...o}){let s=(0,r.useId)(),c=[`sh-spinner`,`sh-spinner--${e}`,i&&`sh-spinner--with-label`,a].filter(Boolean).join(` `);return(0,n.jsxs)(`span`,{className:c,role:`status`,"aria-labelledby":s,...o,children:[(0,n.jsx)(`span`,{className:`sh-spinner__ring`,"aria-hidden":`true`}),(0,n.jsx)(`span`,{id:s,className:i?`sh-spinner__label`:`sh-spinner__label--visually-hidden`,children:t})]})}var It=[`sm`,`md`,`lg`];function Lt({value:e,max:t=100,label:i,showValue:a=!1,formatValue:o,size:s=`md`,"aria-label":c,className:l,...u}){let d=(0,r.useId)(),f=e===void 0,p=t>0?t:0,m=f?0:Math.min(Math.max(e,0),p),h=p===0?0:m/p*100,g=o?o(m,p):`${Math.round(h)}%`,_=[`sh-progress`,`sh-progress--${s}`,f&&`sh-progress--indeterminate`,l].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:_,...u,children:[(i||a&&!f)&&(0,n.jsxs)(`span`,{className:`sh-progress__header`,children:[i&&(0,n.jsx)(`span`,{className:`sh-progress__label`,id:d,children:i}),a&&!f&&(0,n.jsx)(`span`,{className:`sh-progress__value`,children:g})]}),(0,n.jsx)(`div`,{className:`sh-progress__track`,role:`progressbar`,"aria-label":i?void 0:c,"aria-labelledby":i?d:void 0,"aria-valuemin":0,"aria-valuemax":p,"aria-valuenow":f?void 0:m,"aria-valuetext":f?void 0:o?g:void 0,children:(0,n.jsx)(`div`,{className:`sh-progress__bar`,style:{"--sh-progress-fill":`${h}%`}})})]})}var Rt=[`sm`,`md`,`lg`],zt={success:(0,n.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,"aria-hidden":`true`,children:[(0,n.jsx)(`circle`,{cx:`10`,cy:`10`,r:`7.5`}),(0,n.jsx)(`path`,{d:`M6.75 10.25l2.25 2.25 4.25-4.75`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),info:(0,n.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,"aria-hidden":`true`,children:[(0,n.jsx)(`circle`,{cx:`10`,cy:`10`,r:`7.5`}),(0,n.jsx)(`path`,{d:`M10 9v4.5`,strokeLinecap:`round`}),(0,n.jsx)(`circle`,{cx:`10`,cy:`6.4`,r:`0.9`,fill:`currentColor`,stroke:`none`})]}),warning:(0,n.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,"aria-hidden":`true`,children:[(0,n.jsx)(`path`,{d:`M10 2.8 18 16.5H2L10 2.8Z`,strokeLinejoin:`round`}),(0,n.jsx)(`path`,{d:`M10 8v3.5`,strokeLinecap:`round`}),(0,n.jsx)(`circle`,{cx:`10`,cy:`13.9`,r:`0.9`,fill:`currentColor`,stroke:`none`})]}),error:(0,n.jsxs)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,strokeWidth:1.6,"aria-hidden":`true`,children:[(0,n.jsx)(`circle`,{cx:`10`,cy:`10`,r:`7.5`}),(0,n.jsx)(`path`,{d:`M7.5 7.5l5 5M12.5 7.5l-5 5`,strokeLinecap:`round`})]})},Bt=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M4.5 4.5l7 7M11.5 4.5l-7 7`,strokeLinecap:`round`})}),Vt={success:`status`,info:`status`,warning:`alert`,error:`alert`};function Ht({variant:e=`info`,title:t,children:r,icon:i,onDismiss:a,dismissLabel:o=`Dismiss`,role:s,className:c,...l}){let u=[`sh-alert`,`sh-alert--${e}`,c].filter(Boolean).join(` `),d=i===void 0?zt[e]:i;return(0,n.jsxs)(`div`,{className:u,role:s??Vt[e],...l,children:[d!==!1&&(0,n.jsx)(`span`,{className:`sh-alert__icon`,children:d}),(0,n.jsxs)(`div`,{className:`sh-alert__content`,children:[t&&(0,n.jsx)(`p`,{className:`sh-alert__title`,children:t}),r&&(0,n.jsx)(`div`,{className:`sh-alert__body`,children:r})]}),a&&(0,n.jsx)(`button`,{type:`button`,className:`sh-alert__dismiss`,onClick:a,"aria-label":o,children:(0,n.jsx)(Bt,{})})]})}var Ut=[`success`,`info`,`warning`,`error`];function Y(e,t){if(!t)return!0;let n=t.split(`,`).map(e=>e.trim().toLowerCase()).filter(Boolean);if(n.length===0)return!0;let r=e.name.toLowerCase(),i=e.type.toLowerCase();return n.some(e=>e.startsWith(`.`)?r.endsWith(e):e.endsWith(`/*`)?i.startsWith(e.slice(0,-1)):i===e)}function Wt(e){if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`,`TB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${Math.round(n*10)/10} ${t[r]}`}var Gt=()=>(0,n.jsxs)(`svg`,{className:`sh-filedrop__icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,n.jsx)(`path`,{d:`M12 16V4m0 0L8 8m4-4 4 4`}),(0,n.jsx)(`path`,{d:`M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3`})]}),Kt=()=>(0,n.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:1.75,"aria-hidden":`true`,children:(0,n.jsx)(`path`,{d:`M4.5 4.5l7 7M11.5 4.5l-7 7`,strokeLinecap:`round`})});function qt({label:e,helperText:t,error:i,placeholder:a=`Drag files here, or click to browse`,accept:o,multiple:s=!1,value:c,defaultValue:l,onChange:u,onReject:d,hideFileList:f=!1,disabled:p=!1,name:m,"aria-label":h,className:g,inputClassName:_}){let v=(0,r.useId)(),y=(0,r.useId)(),[b,x]=(0,r.useState)(l??[]),S=c!==void 0,C=S?c:b,[w,T]=(0,r.useState)(!1),E=(0,r.useRef)(0),D=!!i,O=i??t,k=e=>{S||x(e),u?.(e)},A=e=>{let t=e.filter(e=>Y(e,o)),n=e.filter(e=>!Y(e,o));n.length>0&&d?.(n),t.length!==0&&k(s?[...C,...t]:[t[0]])},j=e=>{A(Array.from(e.target.files??[])),e.target.value=``},M=e=>{p||(e.preventDefault(),E.current+=1,T(!0))},N=e=>{p||e.preventDefault()},P=e=>{p||(e.preventDefault(),--E.current,E.current<=0&&(E.current=0,T(!1)))},F=e=>{p||(e.preventDefault(),E.current=0,T(!1),A(Array.from(e.dataTransfer?.files??[])))},I=e=>{k(C.filter((t,n)=>n!==e))},L=[`sh-filedrop`,D&&`sh-filedrop--invalid`,p&&`sh-filedrop--disabled`,w&&`sh-filedrop--dragging`,g].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:L,children:[e&&(0,n.jsx)(`label`,{className:`sh-filedrop__label`,htmlFor:v,children:e}),(0,n.jsxs)(`label`,{className:`sh-filedrop__dropzone`,onDragEnter:M,onDragOver:N,onDragLeave:P,onDrop:F,children:[(0,n.jsx)(`input`,{id:v,type:`file`,className:[`sh-filedrop__input`,_].filter(Boolean).join(` `),accept:o,multiple:s,disabled:p,name:m,onChange:j,"aria-label":e?void 0:h,"aria-invalid":D||void 0,"aria-describedby":O?y:void 0}),(0,n.jsxs)(`span`,{className:`sh-filedrop__prompt`,"aria-hidden":`true`,children:[(0,n.jsx)(Gt,{}),(0,n.jsx)(`span`,{className:`sh-filedrop__placeholder`,children:a}),o&&(0,n.jsx)(`span`,{className:`sh-filedrop__accept`,children:o})]})]}),!f&&C.length>0&&(0,n.jsx)(`ul`,{className:`sh-filedrop__files`,children:C.map((e,t)=>(0,n.jsxs)(`li`,{className:`sh-filedrop__file`,children:[(0,n.jsx)(`span`,{className:`sh-filedrop__file-name`,children:e.name}),(0,n.jsx)(`span`,{className:`sh-filedrop__file-size`,children:Wt(e.size)}),(0,n.jsx)(`button`,{type:`button`,className:`sh-filedrop__file-remove`,onClick:()=>I(t),disabled:p,"aria-label":`Remove ${e.name}`,children:(0,n.jsx)(Kt,{})})]},`${e.name}-${t}`))}),O&&(0,n.jsx)(`span`,{id:y,className:`sh-filedrop__message`,children:O})]})}function Jt({label:e,helperText:t,error:i,value:a,defaultValue:o,onChange:s,min:c=0,max:l=100,step:u=1,showValue:d=!1,formatValue:f,className:p,inputClassName:m,id:h,disabled:g,"aria-describedby":_,...v}){let y=(0,r.useId)(),b=h??y,x=`${b}-message`,[S,C]=(0,r.useState)(o??c),w=a!==void 0,T=w?a:S,E=!!i,D=i??t,O=[_,D?x:void 0].filter(Boolean).join(` `)||void 0,k=e=>{let t=Number(e.target.value);w||C(t),s?.(t)},A=l===c?0:(T-c)/(l-c)*100,j=f?f(T):String(T),M=[`sh-range`,E&&`sh-range--invalid`,g&&`sh-range--disabled`,p].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:M,children:[(e||d)&&(0,n.jsxs)(`span`,{className:`sh-range__header`,children:[e&&(0,n.jsx)(`label`,{className:`sh-range__label`,htmlFor:b,children:e}),d&&(0,n.jsx)(`span`,{className:`sh-range__value`,children:j})]}),(0,n.jsx)(`input`,{...v,type:`range`,id:b,className:[`sh-range__input`,m].filter(Boolean).join(` `),style:{"--sh-range-fill":`${A}%`},min:c,max:l,step:u,value:T,disabled:g,onChange:k,"aria-invalid":E||void 0,"aria-describedby":O,"aria-valuetext":f?j:void 0}),D&&(0,n.jsx)(`span`,{id:x,className:`sh-range__message`,children:D})]})}function Yt({label:e,helperText:t,error:i,value:a,defaultValue:o,onChange:s,min:c=0,max:l=100,step:u=1,minGap:d=0,showValue:f=!1,formatValue:p,name:m,disabled:h=!1,"aria-label":g,className:_}){let v=(0,r.useId)(),y=(0,r.useId)(),[b,x]=(0,r.useState)(o??[c,l]),S=a!==void 0,[C,w]=S?a:b,T=!!i,E=i??t,D=e=>{S||x(e),s?.(e)},O=e=>{D([Math.min(Number(e.target.value),w-d),w])},k=e=>{D([C,Math.max(Number(e.target.value),C+d)])},A=e=>l===c?0:(e-c)/(l-c)*100,j=A(C),M=A(w),N=e=>p?p(e):String(e),P=C>(c+l)/2,F=[`sh-minmax`,T&&`sh-minmax--invalid`,h&&`sh-minmax--disabled`,P&&`sh-minmax--from-on-top`,_].filter(Boolean).join(` `),I=e?void 0:g,L=t=>e||g?`${e??g} ${t}`:t;return(0,n.jsxs)(`div`,{className:F,style:{"--sh-minmax-from":`${j}%`,"--sh-minmax-to":`${M}%`},children:[(e||f)&&(0,n.jsxs)(`span`,{className:`sh-minmax__header`,children:[e&&(0,n.jsx)(`span`,{className:`sh-minmax__label`,id:v,children:e}),f&&(0,n.jsxs)(`span`,{className:`sh-minmax__value`,children:[N(C),` – `,N(w)]})]}),(0,n.jsxs)(`div`,{className:`sh-minmax__rail`,role:`group`,"aria-label":I,"aria-labelledby":e?v:void 0,"aria-describedby":E?y:void 0,"aria-invalid":T||void 0,children:[(0,n.jsx)(`span`,{className:`sh-minmax__track`,"aria-hidden":`true`,children:(0,n.jsx)(`span`,{className:`sh-minmax__fill`})}),(0,n.jsx)(`input`,{type:`range`,className:`sh-minmax__input sh-minmax__input--from`,name:m?`${m}-min`:void 0,min:c,max:l,step:u,value:C,disabled:h,onChange:O,"aria-label":L(`minimum`),"aria-valuetext":p?N(C):void 0}),(0,n.jsx)(`input`,{type:`range`,className:`sh-minmax__input sh-minmax__input--to`,name:m?`${m}-max`:void 0,min:c,max:l,step:u,value:w,disabled:h,onChange:k,"aria-label":L(`maximum`),"aria-valuetext":p?N(w):void 0})]}),E&&(0,n.jsx)(`span`,{id:y,className:`sh-minmax__message`,children:E})]})}var Xt=(0,r.createContext)(void 0);function Zt({value:e,label:t,labelPosition:i,className:a,inputClassName:o,name:s,checked:c,disabled:l,onChange:u,...d}){let f=(0,r.useContext)(Xt),p=s??f?.name,m=f&&e!==void 0?f.value.includes(e):c,h=l??f?.disabled,g=i??f?.labelPosition??`right`,_=t=>{f&&e!==void 0&&f.onToggle(e,t.target.checked),u?.(t)},v=[`sh-switch`,`sh-switch--label-${g}`,h&&`sh-switch--disabled`,a].filter(Boolean).join(` `);return(0,n.jsxs)(`label`,{className:v,children:[(0,n.jsx)(`input`,{...d,type:`checkbox`,role:`switch`,className:[`sh-switch__input`,o].filter(Boolean).join(` `),name:p,value:e,checked:m,disabled:h,onChange:_}),(0,n.jsx)(`span`,{className:`sh-switch__track`,"aria-hidden":`true`,children:(0,n.jsx)(`span`,{className:`sh-switch__thumb`})}),t&&(0,n.jsx)(`span`,{className:`sh-switch__label`,children:t})]})}function Qt({children:e,value:t,defaultValue:i,onChange:a,label:o,helperText:s,error:c,name:l,orientation:u=`vertical`,labelPosition:d,disabled:f=!1,"aria-label":p,className:m}){let h=(0,r.useId)(),g=(0,r.useId)(),_=(0,r.useId)(),v=l??h,[y,b]=(0,r.useState)(i??[]),x=t!==void 0,S=x?t:y,C=(e,t)=>{let n=t?[...S,e]:S.filter(t=>t!==e);x||b(n),a?.(n)},w=!!c,T=c??s,E=[`sh-switch-group`,w&&`sh-switch-group--invalid`,m].filter(Boolean).join(` `);return(0,n.jsxs)(`div`,{className:E,children:[o&&(0,n.jsx)(`span`,{className:`sh-switch-group__label`,id:g,children:o}),(0,n.jsx)(`div`,{className:`sh-switch-group__options sh-switch-group__options--${u}`,role:`group`,"aria-label":o?void 0:p,"aria-labelledby":o?g:void 0,"aria-describedby":T?_:void 0,"aria-invalid":w||void 0,children:(0,n.jsx)(Xt.Provider,{value:{name:v,value:S,onToggle:C,disabled:f,labelPosition:d},children:e})}),T&&(0,n.jsx)(`span`,{id:_,className:`sh-switch-group__message`,children:T})]})}function $t({options:e,value:t,defaultValue:i,onChange:a,label:o,name:s,fullWidth:c=!1,disabled:l=!1,"aria-label":u,className:d}){let f=(0,r.useId)(),p=(0,r.useId)(),m=s??f,[h,g]=(0,r.useState)(i),_=t!==void 0,v=_?t:h,y=e=>{_||g(e),a?.(e)},b=e.findIndex(e=>e.value===v),x=[`sh-segmented`,c&&`sh-segmented--full-width`,l&&`sh-segmented--disabled`,b<0&&`sh-segmented--unselected`,d].filter(Boolean).join(` `),S={"--sh-segmented-count":e.length,"--sh-segmented-index":Math.max(b,0)};return(0,n.jsxs)(`div`,{className:`sh-segmented-field`,children:[o&&(0,n.jsx)(`span`,{className:`sh-segmented__group-label`,id:p,children:o}),(0,n.jsx)(`div`,{className:x,style:S,role:`radiogroup`,"aria-label":o?void 0:u,"aria-labelledby":o?p:void 0,children:e.map(e=>{let t=l||e.disabled;return(0,n.jsxs)(`label`,{className:[`sh-segmented__item`,t&&`sh-segmented__item--disabled`].filter(Boolean).join(` `),children:[(0,n.jsx)(`input`,{className:`sh-segmented__input`,type:`radio`,name:m,value:e.value,checked:v===e.value,disabled:t,onChange:()=>y(e.value)}),(0,n.jsx)(`span`,{className:`sh-segmented__label`,children:e.label})]},e.value)})})]})}var en=t({accent:()=>X,accentFill:()=>$,colorVar:()=>an,danger:()=>Q,neutral:()=>Z,palette:()=>tn,paletteVar:()=>on,semanticColors:()=>rn}),X={50:`#f6f0ff`,100:`#ece0ff`,200:`#d9c2ff`,300:`#c19dff`,400:`#a672ff`,500:`#8b47fa`,600:`#7429e0`,700:`#5d1fb8`,800:`#461890`,900:`#331269`,950:`#1f0b40`},Z={0:`#ffffff`,50:`#f8f7fa`,100:`#efedf3`,200:`#e2dfe8`,300:`#cac6d3`,400:`#a29cae`,500:`#79728a`,600:`#5a5468`,700:`#423d4d`,800:`#2c2836`,900:`#1a1720`,950:`#0d0b12`},Q={50:`#fef3f2`,100:`#fee4e2`,200:`#fecdca`,300:`#fda29b`,400:`#f97066`,500:`#f04438`,600:`#d92d20`,700:`#b42318`,800:`#912018`,900:`#7a271a`,950:`#55160c`},tn={accent:X,neutral:Z,danger:Q},$={bg:X[700],text:X[100]},nn={"accent-fill-bg":$.bg,"accent-fill-text":$.text},rn={light:{"bg-canvas":Z[0],"bg-surface":Z[50],"bg-subtle":Z[100],text:Z[900],"text-subtle":Z[600],"text-inverse":Z[0],border:Z[200],"border-strong":Z[300],accent:X[600],"accent-hover":X[700],"accent-subtle-bg":X[50],"accent-subtle-text":X[700],...nn,danger:Q[700],"danger-border":Q[500],scrim:`rgb(0 0 0 / 0.45)`,"accent-tint-1":X[50],"accent-tint-2":X[100],"accent-tint-3":X[200],"accent-tint-4":X[300],"accent-on-tint":X[900]},dark:{"bg-canvas":Z[950],"bg-surface":Z[900],"bg-subtle":Z[800],text:Z[50],"text-subtle":Z[400],"text-inverse":Z[950],border:Z[700],"border-strong":Z[600],accent:X[400],"accent-hover":X[300],"accent-subtle-bg":X[900],"accent-subtle-text":X[200],...nn,danger:Q[300],"danger-border":Q[400],scrim:`rgb(0 0 0 / 0.65)`,"accent-tint-1":X[950],"accent-tint-2":X[900],"accent-tint-3":X[800],"accent-tint-4":X[700],"accent-on-tint":X[100]}};function an(e){return`var(--color-${e})`}function on(e,t){return`var(--color-${e}-${String(t)})`}exports.Accordion=Be,exports.AccordionItem=He,exports.Alert=Ht,exports.Avatar=E,exports.AvatarGroup=D,exports.Breadcrumb=Qe,exports.BreadcrumbItem=$e,exports.Button=d,exports.Carousel=yt,exports.CarouselDots=Dt,exports.CarouselNext=Et,exports.CarouselPlayPause=At,exports.CarouselPrevious=Tt,exports.CarouselSlide=St,exports.CarouselSlides=xt,exports.Checkbox=De,exports.CheckboxGroup=Oe,exports.Chip=b,exports.CodeBlock=ie,exports.Dialog=ce,exports.Drawer=fe,exports.Dropdown=I,exports.DropdownItem=z,exports.DropdownMenu=R,exports.DropdownSeparator=ee,exports.DropdownTrigger=L,exports.EmptyState=h,exports.FileDrop=qt,exports.Input=k,exports.InputOtp=N,exports.MinMaxSlider=Yt,exports.Pagination=Fe,exports.ProgressBar=Lt,exports.Radio=Ae,exports.RadioGroup=je,exports.RangeSlider=Jt,exports.SegmentedControl=$t,exports.Select=we,exports.Skeleton=Mt,exports.Spinner=Ft,exports.Step=Je,exports.Stepper=Ge,exports.Switch=Zt,exports.SwitchGroup=Qt,exports.Tab=at,exports.TabList=it,exports.TabPanel=ot,exports.Tabs=nt,exports.Tag=g,exports.Text=l,exports.Textarea=Te,exports.Tooltip=xe,exports.accentFill=$,exports.alertVariants=Ut,exports.avatarSizes=O,exports.buttonClassNames=u,exports.buttonSizes=p,exports.buttonVariants=f,exports.chipActions=S,exports.chipVariants=x,Object.defineProperty(exports,"colorTokens",{enumerable:!0,get:function(){return en}}),exports.colorVar=an,exports.dedentCode=B,exports.dialogRoles=ue,exports.dialogSizes=le,exports.drawerSides=pe,exports.drawerSizes=me,exports.formatFileSize=Wt,exports.getPaginationRange=G,exports.isFileAccepted=Y,exports.otpTypes=A,exports.palette=tn,exports.paletteVar=on,exports.progressBarSizes=Rt,exports.resolveTooltipPlacement=ve,exports.sanitizeOtpValue=M,exports.semanticColors=rn,exports.skeletonAnimations=Pt,exports.skeletonVariants=Nt,exports.spinnerSizes=It,exports.tagVariants=_,exports.textColors=o,exports.textVariants=a,exports.textWeights=s;
7
7
  //# sourceMappingURL=sonahang-ui.cjs.map