@pibit.ai/cure-design-system 0.6.13 → 0.6.15

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.
@@ -0,0 +1,36 @@
1
+ import { default as React } from 'react';
2
+ export type ExpandableRightDrawerState = "hidden" | "normal" | "expanded";
3
+ export interface ExpandableRightDrawerProps {
4
+ /** Current state: hidden (no space), normal (sidebar width), expanded (wide). */
5
+ state: ExpandableRightDrawerState;
6
+ onClose: () => void;
7
+ /** Optional custom header. When not provided, default header with title/subtitle and actions is used. */
8
+ header?: React.ReactNode;
9
+ /** Used by default header. */
10
+ title?: string;
11
+ /** Used by default header. */
12
+ subtitle?: string;
13
+ /** Content; only rendered when state is not "hidden" (lazy). */
14
+ children: React.ReactNode;
15
+ /** Width in pixels for normal state. Default 512 (32rem). */
16
+ normalWidth?: number;
17
+ /** Width when expanded. Default `calc(100vw - 140px)`. */
18
+ maxWidth?: string;
19
+ /** Controlled drawer width. When provided, it is used for the normal state. */
20
+ width?: number | string;
21
+ /** Minimum drawer width while visible. */
22
+ minWidth?: number;
23
+ /** Maximum width allowed while dragging. */
24
+ maxResizableWidth?: number;
25
+ /** Called while the user drags the drawer resize handle. */
26
+ onWidthChange?: (width: number) => void;
27
+ /** Callback when expand/collapse is toggled. When provided, default header shows expand/minimize button. */
28
+ onExpandedChange?: (expanded: boolean) => void;
29
+ /** Extra actions rendered in the default header before expand/close controls. */
30
+ headerActions?: React.ReactNode;
31
+ className?: string;
32
+ headerClassName?: string;
33
+ bodyClassName?: string;
34
+ }
35
+ export declare const ExpandableRightDrawer: React.FC<ExpandableRightDrawerProps>;
36
+ //# sourceMappingURL=expandable-drawer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expandable-drawer.d.ts","sourceRoot":"","sources":["../../../src/patterns/expandable-drawer/expandable-drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAQlE,MAAM,MAAM,0BAA0B,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAM1E,MAAM,WAAW,0BAA0B;IACzC,iFAAiF;IACjF,KAAK,EAAE,0BAA0B,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,yGAAyG;IACzG,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,4GAA4G;IAC5G,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,iFAAiF;IACjF,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAsKtE,CAAC"}
@@ -0,0 +1,120 @@
1
+ import { jsx as t, jsxs as i } from "react/jsx-runtime";
2
+ import { Minimize01 as H, Expand01 as K, X as F } from "@untitledui/icons";
3
+ import { useState as U, useId as Y, useRef as G, useEffect as J } from "react";
4
+ import { motion as Q } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
5
+ const Z = 512, W = "calc(100vw - 140px)", C = { type: "tween", duration: 0.3, ease: "easeInOut" }, se = ({
6
+ state: o,
7
+ onClose: h,
8
+ header: n,
9
+ title: I = "",
10
+ subtitle: y,
11
+ children: z,
12
+ normalWidth: g = Z,
13
+ maxWidth: D = W,
14
+ width: k,
15
+ minWidth: a = 480,
16
+ maxResizableWidth: R,
17
+ onWidthChange: r,
18
+ onExpandedChange: c,
19
+ headerActions: M,
20
+ className: P = "",
21
+ headerClassName: S = "",
22
+ bodyClassName: E = ""
23
+ }) => {
24
+ const [v, V] = U(!1), u = o !== "hidden";
25
+ u && !v && V(!0);
26
+ const w = c !== void 0, m = o === "expanded", l = o === "hidden" ? 0 : o === "expanded" ? D : k ?? g, f = Math.max(R ?? Number.POSITIVE_INFINITY, a), b = o === "normal" && u && typeof l == "number" && r !== void 0, p = (e) => Math.min(Math.max(e, a), f), L = Y(), s = G(null);
27
+ J(() => () => {
28
+ var e;
29
+ return (e = s.current) == null ? void 0 : e.call(s);
30
+ }, []);
31
+ const T = (e) => {
32
+ if (!b || typeof l != "number") return;
33
+ e.preventDefault(), e.stopPropagation();
34
+ const d = e.clientX, $ = l, O = document.body.style.cursor, q = document.body.style.userSelect;
35
+ document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
36
+ const N = (B) => {
37
+ r == null || r(p($ + d - B.clientX));
38
+ }, x = () => {
39
+ document.body.style.cursor = O, document.body.style.userSelect = q, window.removeEventListener("pointermove", N), window.removeEventListener("pointerup", x), s.current = null;
40
+ };
41
+ s.current = x, window.addEventListener("pointermove", N), window.addEventListener("pointerup", x);
42
+ }, X = (e) => {
43
+ if (!b || typeof l != "number") return;
44
+ const d = e.shiftKey ? 50 : 16;
45
+ e.key === "ArrowLeft" && (e.preventDefault(), r == null || r(p(l + d))), e.key === "ArrowRight" && (e.preventDefault(), r == null || r(p(l - d)));
46
+ }, _ = {
47
+ backgroundImage: "linear-gradient(90deg, rgba(6, 132, 240, 0.1) 0%, rgba(6, 132, 240, 0.1) 100%), linear-gradient(0deg, rgba(255, 255, 255, 0) 60.66%, rgba(255, 255, 255, 0.5) 100%), linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.3) 100%)"
48
+ }, j = `flex items-center justify-between pl-6 pr-2 border-b border-secondary gap-2 py-4 ${S}`, A = `flex min-h-0 flex-1 flex-col overflow-y-auto pb-3 ${E} ${n ? "" : "px-5"}`;
49
+ return /* @__PURE__ */ t(
50
+ Q.div,
51
+ {
52
+ className: `relative flex flex-col flex-shrink-0 overflow-hidden min-w-0 h-[calc(98vh-85px)] z-1000 ${P}`,
53
+ initial: !1,
54
+ animate: {
55
+ width: l,
56
+ minWidth: o === "hidden" ? 0 : a || void 0
57
+ },
58
+ transition: C,
59
+ children: u && /* @__PURE__ */ i(
60
+ "div",
61
+ {
62
+ className: "h-full w-full min-w-0 flex flex-col rounded-2xl border-l border-t border-b border-white backdrop-blur-[3px] p-2",
63
+ style: _,
64
+ children: [
65
+ b && /* @__PURE__ */ t(
66
+ "div",
67
+ {
68
+ role: "separator",
69
+ "aria-label": "Resize drawer",
70
+ "aria-orientation": "vertical",
71
+ "aria-valuemin": a,
72
+ "aria-valuemax": Number.isFinite(f) ? f : void 0,
73
+ "aria-valuenow": typeof l == "number" ? Math.round(l) : void 0,
74
+ tabIndex: 0,
75
+ onPointerDown: T,
76
+ onKeyDown: X,
77
+ className: "absolute left-0 top-0 z-10 h-full w-2 -translate-x-1 cursor-col-resize touch-none focus-visible:outline-none"
78
+ }
79
+ ),
80
+ /* @__PURE__ */ i("div", { className: "h-full w-full bg-white rounded-lg overflow-hidden flex flex-col min-w-0", children: [
81
+ n ?? /* @__PURE__ */ i("header", { className: j, children: [
82
+ /* @__PURE__ */ i("div", { className: `flex-1 flex flex-col gap-0 min-w-0 ${w ? "pr-2" : "pr-16"}`, children: [
83
+ /* @__PURE__ */ t("h2", { id: L, className: "text-lg font-semibold leading-7 text-[#06060a] truncate", children: I }),
84
+ y && /* @__PURE__ */ t("p", { className: "text-sm text-secondary truncate", children: y })
85
+ ] }),
86
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
87
+ M,
88
+ w && /* @__PURE__ */ t(
89
+ "button",
90
+ {
91
+ type: "button",
92
+ onClick: () => c == null ? void 0 : c(!m),
93
+ className: "flex items-center justify-center p-2 rounded-lg hover:bg-primary_hover transition-colors cursor-pointer",
94
+ "aria-label": m ? "Collapse sidebar" : "Expand sidebar",
95
+ children: m ? /* @__PURE__ */ t(H, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 }) : /* @__PURE__ */ t(K, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 })
96
+ }
97
+ ),
98
+ /* @__PURE__ */ t(
99
+ "button",
100
+ {
101
+ type: "button",
102
+ onClick: h,
103
+ className: "flex items-center justify-center p-2 rounded-lg hover:bg-primary_hover transition-colors cursor-pointer",
104
+ "aria-label": "Close",
105
+ children: /* @__PURE__ */ t(F, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 })
106
+ }
107
+ )
108
+ ] })
109
+ ] }),
110
+ /* @__PURE__ */ t("main", { className: A, children: v ? z : null })
111
+ ] })
112
+ ]
113
+ }
114
+ )
115
+ }
116
+ );
117
+ };
118
+ export {
119
+ se as ExpandableRightDrawer
120
+ };
@@ -0,0 +1,2 @@
1
+ export { ExpandableRightDrawer, type ExpandableRightDrawerProps, type ExpandableRightDrawerState, } from './expandable-drawer';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/expandable-drawer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,GAChC,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Tabs, TabList, Tab, TabPanel, type TabListComponentProps, type TabComponentProps } from './tabs';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/tabs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,MAAM,QAAQ,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { TabListProps as AriaTabListProps, TabProps as AriaTabProps, TabRenderProps as AriaTabRenderProps, TabPanel as AriaTabPanel, Tabs as AriaTabs } from 'react-aria-components';
3
+ type Orientation = "horizontal" | "vertical";
4
+ type HorizontalTypes = "button-brand" | "button-gray" | "button-border" | "button-minimal" | "underline" | "button-curved";
5
+ type VerticalTypes = "button-brand" | "button-gray" | "button-border" | "button-minimal" | "line";
6
+ type TabTypeColors<T> = T extends "horizontal" ? HorizontalTypes : VerticalTypes;
7
+ declare const sizes: Record<"xs" | "sm" | "md", Partial<Record<HorizontalTypes | VerticalTypes, string>>>;
8
+ export interface TabListComponentProps<T extends object, K extends Orientation> extends AriaTabListProps<T> {
9
+ /** The size of the tab list. */
10
+ size?: keyof typeof sizes;
11
+ /** The type of the tab list. */
12
+ type?: TabTypeColors<K>;
13
+ /** The orientation of the tab list. */
14
+ orientation?: K;
15
+ /** The items of the tab list. */
16
+ items: T[];
17
+ /** Whether the tab list is full width. */
18
+ fullWidth?: boolean;
19
+ }
20
+ export declare const TabList: <T extends Orientation>({ size, type, orientation: orientationProp, fullWidth, className, children, items, ...otherProps }: TabListComponentProps<TabComponentProps, T>) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const TabPanel: (props: ComponentPropsWithRef<typeof AriaTabPanel>) => import("react/jsx-runtime").JSX.Element;
22
+ export interface TabComponentProps extends AriaTabProps {
23
+ /** The label of the tab. */
24
+ label?: ReactNode;
25
+ /** The children of the tab. */
26
+ children?: ReactNode | ((props: AriaTabRenderProps) => ReactNode);
27
+ /** The badge displayed next to the label. */
28
+ badge?: number | string;
29
+ /** The badge displayed before the label. */
30
+ leadingBadge?: number | string;
31
+ /** The class name for the badge. */
32
+ badgeClassName?: string;
33
+ }
34
+ export declare const Tab: (props: TabComponentProps) => import("react/jsx-runtime").JSX.Element;
35
+ export declare const Tabs: {
36
+ ({ className, ...props }: ComponentPropsWithRef<typeof AriaTabs>): import("react/jsx-runtime").JSX.Element;
37
+ Panel: (props: ComponentPropsWithRef<typeof AriaTabPanel>) => import("react/jsx-runtime").JSX.Element;
38
+ List: <T extends Orientation>({ size, type, orientation: orientationProp, fullWidth, className, children, items, ...otherProps }: TabListComponentProps<TabComponentProps, T>) => import("react/jsx-runtime").JSX.Element;
39
+ Item: (props: TabComponentProps) => import("react/jsx-runtime").JSX.Element;
40
+ };
41
+ export {};
42
+ //# sourceMappingURL=tabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/patterns/tabs/tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,QAAQ,IAAI,YAAY,EACxB,cAAc,IAAI,kBAAkB,EACrC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,QAAQ,IAAI,YAAY,EACxB,IAAI,IAAI,QAAQ,EAGjB,MAAM,uBAAuB,CAAC;AAY/B,KAAK,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;AAG7C,KAAK,eAAe,GAChB,cAAc,GACd,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,WAAW,GACX,eAAe,CAAC;AACpB,KAAK,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,eAAe,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAClG,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,GAAG,eAAe,GAAG,aAAa,CAAC;AAsDjF,QAAA,MAAM,KAAK,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,GAAG,aAAa,EAAE,MAAM,CAAC,CAAC,CA2B/F,CAAC;AA0CF,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,WAAW,CAAE,SAAQ,gBAAgB,CAAC,CAAC,CAAC;IACzG,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,OAAO,KAAK,CAAC;IAC1B,gCAAgC;IAChC,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACxB,uCAAuC;IACvC,WAAW,CAAC,EAAE,CAAC,CAAC;IAChB,iCAAiC;IACjC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAYD,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,WAAW,EAAE,oGAS5C,qBAAqB,CAAC,iBAAiB,EAAE,CAAC,CAAC,4CAoC7C,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,qBAAqB,CAAC,OAAO,YAAY,CAAC,4CAYzE,CAAC;AAEF,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,4BAA4B;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAC,CAAC;IAClE,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,oCAAoC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,GAAG,GAAI,OAAO,iBAAiB,4CA8C3C,CAAC;AAEF,eAAO,MAAM,IAAI;8BAA6B,qBAAqB,CAAC,OAAO,QAAQ,CAAC;mBA3EpD,qBAAqB,CAAC,OAAO,YAAY,CAAC;WA/ClD,CAAC,SAAS,WAAW,sGAS1C,qBAAqB,CAAC,iBAAiB,EAAE,CAAC,CAAC;kBAiEnB,iBAAiB;CAgE3C,CAAC"}
@@ -0,0 +1,217 @@
1
+ import { jsx as b, jsxs as h } from "react/jsx-runtime";
2
+ import { createContext as _, useContext as v, Fragment as T } from "react";
3
+ import { Tabs as w, useSlottedContext as z, TabsContext as N, TabList as C, Tab as B, TabPanel as L } from "react-aria-components";
4
+ import { cx as e } from "../../utils/cn.js";
5
+ import { Badge as p } from "../../primitives/badge/badge.js";
6
+ const P = ({ isFocusVisible: t, isSelected: n, isHovered: o, isDisabled: a }) => ({
7
+ "button-brand": e(
8
+ "outline-focus-ring",
9
+ t && "outline-2 -outline-offset-2",
10
+ n && "bg-brand-primary_alt text-[var(--color-brand-600)]",
11
+ o && "text-[var(--color-brand-600)]"
12
+ ),
13
+ "button-gray": e(
14
+ "outline-focus-ring",
15
+ o && "bg-primary_hover text-secondary",
16
+ t && "outline-2 -outline-offset-2",
17
+ n && "bg-active text-secondary"
18
+ ),
19
+ "button-border": e(
20
+ "outline-focus-ring",
21
+ (n || o) && "bg-primary_alt text-secondary shadow-sm",
22
+ t && "outline-2 -outline-offset-2"
23
+ ),
24
+ "button-minimal": e(
25
+ "rounded-lg outline-focus-ring",
26
+ o && "text-secondary",
27
+ t && "outline-2 -outline-offset-2",
28
+ n && "bg-primary_alt text-secondary shadow-xs ring-1 ring-primary ring-inset"
29
+ ),
30
+ underline: e(
31
+ "rounded-none outline-focus-ring",
32
+ n && "border-b-2 border-[var(--color-brand-600)] text-[var(--color-brand-600)]",
33
+ o && "text-[var(--color-brand-600)] border-transparent",
34
+ !a && "hover:border-[var(--color-brand-600)] hover:text-[var(--color-brand-600)]",
35
+ t && "outline-2 -outline-offset-2"
36
+ ),
37
+ line: e(
38
+ "rounded-none border-l-2 border-transparent outline-focus-ring",
39
+ n && "border-fg-brand-primary_alt text-brand-secondary",
40
+ o && "text-brand-secondary",
41
+ t && "outline-2 -outline-offset-2"
42
+ ),
43
+ "button-curved": e(
44
+ "rounded-none rounded-t-xl outline-focus-ring relative text-xs font-medium transition-all duration-200 ease-out",
45
+ "before:absolute before:-left-3 before:bottom-0 before:size-3 before:rounded-br-lg before:transition-shadow before:duration-200 before:ease-out",
46
+ "after:absolute after:-right-3 after:bottom-0 after:size-3 after:rounded-bl-lg after:transition-shadow after:duration-200 after:ease-out",
47
+ t && "outline-2 -outline-offset-2",
48
+ n && "bg-primary text-brand-tertiary z-10 font-semibold",
49
+ n && "before:shadow-[4px_4px_0_0_var(--color-bg-primary)]",
50
+ n && "after:shadow-[-4px_4px_0_0_var(--color-bg-primary)]",
51
+ !n && "before:shadow-[4px_4px_0_0_transparent] after:shadow-[-4px_4px_0_0_transparent]",
52
+ !n && !a && o && "bg-primary_hover text-primary"
53
+ )
54
+ }), j = {
55
+ xs: {
56
+ "button-brand": "text-xs font-semibold px-2",
57
+ "button-gray": "text-xs font-semibold px-2",
58
+ "button-border": "text-xs font-semibold px-2",
59
+ "button-minimal": "text-xs font-semibold px-2",
60
+ underline: "text-xs font-semibold px-1.5 pt-0",
61
+ line: "text-xs font-semibold pl-2.5 pr-2.5"
62
+ },
63
+ sm: {
64
+ "button-brand": "text-sm font-semibold py-2 px-3",
65
+ "button-gray": "text-sm font-semibold py-2 px-3",
66
+ "button-border": "text-sm font-semibold py-2 px-3",
67
+ "button-minimal": "text-sm font-semibold py-2 px-3",
68
+ underline: "text-sm font-semibold px-1 pb-2.5 pt-0",
69
+ line: "text-sm font-semibold pl-2.5 pr-3 py-0.5",
70
+ "button-curved": "py-2 px-4"
71
+ },
72
+ md: {
73
+ "button-brand": "text-md font-semibold py-2.5 px-3",
74
+ "button-gray": "text-md font-semibold py-2.5 px-3",
75
+ "button-border": "text-md font-semibold py-2.5 px-3",
76
+ "button-minimal": "text-md font-semibold py-2.5 px-3",
77
+ underline: "text-md font-semibold px-1 pb-2.5 pt-0",
78
+ line: "text-md font-semibold pr-3.5 pl-3 py-1",
79
+ "button-curved": "py-2.5 px-5"
80
+ }
81
+ }, $ = ({ size: t, fullWidth: n }) => ({
82
+ "button-brand": "gap-1",
83
+ "button-gray": "gap-1",
84
+ "button-border": e(
85
+ "gap-1 rounded-[10px] bg-secondary_alt p-1 ring-1 ring-secondary ring-inset",
86
+ t === "md" && "rounded-xl p-1.5"
87
+ ),
88
+ "button-minimal": "gap-0.5 rounded-lg bg-secondary_alt ring-1 ring-inset ring-secondary",
89
+ underline: e("gap-3", n && "w-full gap-4"),
90
+ line: "gap-2",
91
+ "button-curved": "gap-0"
92
+ });
93
+ function I(t) {
94
+ return t.some((n) => {
95
+ if (!("badge" in n)) return !1;
96
+ const o = n.badge;
97
+ return o != null && String(o).length > 0;
98
+ });
99
+ }
100
+ const k = {
101
+ xs: "!min-h-8",
102
+ sm: "!min-h-9",
103
+ md: "!min-h-10"
104
+ }, g = ({ isSelected: t, isHovered: n }) => ({
105
+ "button-brand": t || n ? "brand" : "gray",
106
+ "button-gray": "gray",
107
+ "button-border": "gray",
108
+ "button-minimal": "gray",
109
+ underline: t || n ? "brand" : "gray",
110
+ line: t || n ? "brand" : "gray",
111
+ "button-curved": "gray"
112
+ }), c = _({
113
+ size: "sm",
114
+ type: "button-brand",
115
+ reserveBadgeSlot: !1
116
+ }), A = ({
117
+ size: t = "sm",
118
+ type: n = "button-brand",
119
+ orientation: o,
120
+ fullWidth: a,
121
+ className: d,
122
+ children: m,
123
+ items: u,
124
+ ...r
125
+ }) => {
126
+ const i = z(N), s = o ?? (i == null ? void 0 : i.orientation) ?? "horizontal", l = s === "horizontal" && n === "underline" && I(u);
127
+ return /* @__PURE__ */ b(c.Provider, { value: { size: t, type: n, orientation: s, fullWidth: a, reserveBadgeSlot: l }, children: /* @__PURE__ */ b(
128
+ C,
129
+ {
130
+ ...r,
131
+ items: u,
132
+ className: (f) => e(
133
+ "group flex",
134
+ $({
135
+ size: t,
136
+ fullWidth: a
137
+ })[n],
138
+ s === "vertical" && "w-max flex-col",
139
+ // Only horizontal tabs with underline type have bottom border
140
+ s === "horizontal" && n === "underline" && "relative before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-border-secondary",
141
+ typeof d == "function" ? d(f) : d
142
+ ),
143
+ children: m ?? ((f) => /* @__PURE__ */ b(y, { ...f, children: f.children }))
144
+ }
145
+ ) });
146
+ }, M = (t) => /* @__PURE__ */ b(
147
+ L,
148
+ {
149
+ ...t,
150
+ className: (n) => e(
151
+ "outline-focus-ring focus-visible:outline-2 focus-visible:outline-offset-2",
152
+ typeof t.className == "function" ? t.className(n) : t.className
153
+ )
154
+ }
155
+ ), y = (t) => {
156
+ const { label: n, children: o, badge: a, leadingBadge: d, badgeClassName: m, ...u } = t, { size: r = "sm", type: i = "button-brand", fullWidth: s } = v(c);
157
+ return /* @__PURE__ */ b(
158
+ B,
159
+ {
160
+ ...u,
161
+ className: (l) => e(
162
+ "z-10 flex h-max cursor-pointer items-center justify-center gap-1 rounded-md whitespace-nowrap text-secondary transition duration-100 ease-linear",
163
+ "group-orientation-vertical:justify-start",
164
+ s && "w-full flex-1",
165
+ k[r],
166
+ j[r][i],
167
+ P(l)[i],
168
+ typeof t.className == "function" ? t.className(l) : t.className
169
+ ),
170
+ children: (l) => /* @__PURE__ */ h(T, { children: [
171
+ d && /* @__PURE__ */ b(
172
+ p,
173
+ {
174
+ size: r === "xs" ? "sm" : r,
175
+ type: "pill-color",
176
+ color: g(l)[i],
177
+ className: e("hidden transition-inherit-all md:flex", r === "sm" && "-my-px", m),
178
+ children: d
179
+ }
180
+ ),
181
+ typeof o == "function" ? o(l) : o || n,
182
+ a && /* @__PURE__ */ b(
183
+ p,
184
+ {
185
+ size: r === "xs" ? "sm" : r,
186
+ type: "pill-color",
187
+ color: g(l)[i],
188
+ className: e("hidden transition-inherit-all md:flex", r === "sm" && "-my-px"),
189
+ children: a
190
+ }
191
+ )
192
+ ] })
193
+ }
194
+ );
195
+ }, x = ({ className: t, ...n }) => /* @__PURE__ */ b(
196
+ w,
197
+ {
198
+ keyboardActivation: "manual",
199
+ ...n,
200
+ className: (o) => e(
201
+ // RAC marks the root `data-focus-visible` whenever anything inside it has keyboard focus, and the
202
+ // design system's global `[data-focus-visible]` outline would ring the whole tab section.
203
+ // The focused tab or control draws its own ring.
204
+ "flex w-full flex-col outline-hidden",
205
+ typeof t == "function" ? t(o) : t
206
+ )
207
+ }
208
+ );
209
+ x.Panel = M;
210
+ x.List = A;
211
+ x.Item = y;
212
+ export {
213
+ y as Tab,
214
+ A as TabList,
215
+ M as TabPanel,
216
+ x as Tabs
217
+ };