@timmbr/ui 1.15.1 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/components/Card/Card.styles.d.ts +1 -1
  2. package/dist/components/Panel/Panel.context.d.ts +17 -0
  3. package/dist/components/Panel/Panel.context.d.ts.map +1 -0
  4. package/dist/components/Panel/Panel.context.js +17 -0
  5. package/dist/components/Panel/Panel.d.ts +4 -0
  6. package/dist/components/Panel/Panel.d.ts.map +1 -0
  7. package/dist/components/Panel/Panel.helpers.d.ts +103 -0
  8. package/dist/components/Panel/Panel.helpers.d.ts.map +1 -0
  9. package/dist/components/Panel/Panel.helpers.js +179 -0
  10. package/dist/components/Panel/Panel.js +174 -0
  11. package/dist/components/Panel/Panel.styles.d.ts +42 -0
  12. package/dist/components/Panel/Panel.styles.d.ts.map +1 -0
  13. package/dist/components/Panel/Panel.styles.js +118 -0
  14. package/dist/components/Panel/Panel.types.d.ts +59 -0
  15. package/dist/components/Panel/Panel.types.d.ts.map +1 -0
  16. package/dist/components/Panel/index.d.ts +7 -0
  17. package/dist/components/Panel/index.d.ts.map +1 -0
  18. package/dist/components/Panel/subcomponents/PanelBody.d.ts +4 -0
  19. package/dist/components/Panel/subcomponents/PanelBody.d.ts.map +1 -0
  20. package/dist/components/Panel/subcomponents/PanelBody.js +58 -0
  21. package/dist/components/Panel/subcomponents/PanelDescription.d.ts +4 -0
  22. package/dist/components/Panel/subcomponents/PanelDescription.d.ts.map +1 -0
  23. package/dist/components/Panel/subcomponents/PanelDescription.js +24 -0
  24. package/dist/components/Panel/subcomponents/PanelFooter.d.ts +4 -0
  25. package/dist/components/Panel/subcomponents/PanelFooter.d.ts.map +1 -0
  26. package/dist/components/Panel/subcomponents/PanelFooter.js +27 -0
  27. package/dist/components/Panel/subcomponents/PanelHeader.d.ts +4 -0
  28. package/dist/components/Panel/subcomponents/PanelHeader.d.ts.map +1 -0
  29. package/dist/components/Panel/subcomponents/PanelHeader.js +101 -0
  30. package/dist/components/Panel/subcomponents/PanelResizeHandle.d.ts +11 -0
  31. package/dist/components/Panel/subcomponents/PanelResizeHandle.d.ts.map +1 -0
  32. package/dist/components/Panel/subcomponents/PanelResizeHandle.js +29 -0
  33. package/dist/components/Panel/subcomponents/PanelTitle.d.ts +4 -0
  34. package/dist/components/Panel/subcomponents/PanelTitle.d.ts.map +1 -0
  35. package/dist/components/Panel/subcomponents/PanelTitle.js +24 -0
  36. package/dist/components/Panel/subcomponents/index.d.ts +6 -0
  37. package/dist/components/Panel/subcomponents/index.d.ts.map +1 -0
  38. package/dist/components/Stepper/Stepper.d.ts +2 -0
  39. package/dist/components/Stepper/Stepper.d.ts.map +1 -1
  40. package/dist/components/Stepper/Stepper.js +77 -63
  41. package/dist/components/Stepper/Stepper.styles.d.ts +9 -0
  42. package/dist/components/Stepper/Stepper.styles.d.ts.map +1 -1
  43. package/dist/components/Stepper/Stepper.styles.js +43 -1
  44. package/dist/components/Stepper/Stepper.types.d.ts +14 -1
  45. package/dist/components/Stepper/Stepper.types.d.ts.map +1 -1
  46. package/dist/components/Stepper/subcomponents/ProgressStepper.d.ts +13 -0
  47. package/dist/components/Stepper/subcomponents/ProgressStepper.d.ts.map +1 -0
  48. package/dist/components/Stepper/subcomponents/ProgressStepper.js +77 -0
  49. package/dist/components/Stepper/subcomponents/index.d.ts +3 -0
  50. package/dist/components/Stepper/subcomponents/index.d.ts.map +1 -0
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +10 -1
  54. package/package.json +3 -3
@@ -0,0 +1,118 @@
1
+ import { cva } from 'class-variance-authority';
2
+
3
+ const panelVariants = cva(
4
+ "relative flex flex-col text-foreground font-sans",
5
+ {
6
+ variants: {
7
+ variant: {
8
+ outline: "border border-grey-200 dark:border-grey-800 bg-card shadow-sm",
9
+ elevated: "border border-transparent bg-card shadow-md",
10
+ subtle: "border border-transparent bg-card",
11
+ ghost: "bg-transparent"
12
+ },
13
+ padding: {
14
+ none: "p-0",
15
+ sm: "p-4",
16
+ default: "p-6",
17
+ lg: "p-8"
18
+ },
19
+ sectioned: {
20
+ true: "p-0",
21
+ false: ""
22
+ },
23
+ placement: {
24
+ inline: "rounded-[4px]",
25
+ left: "rounded-r-[4px] h-full shrink-0",
26
+ right: "rounded-l-[4px] h-full shrink-0"
27
+ }
28
+ },
29
+ defaultVariants: {
30
+ variant: "outline",
31
+ padding: "default",
32
+ sectioned: false,
33
+ placement: "inline"
34
+ }
35
+ }
36
+ );
37
+ const panelSectionPadding = {
38
+ none: "",
39
+ sm: "p-4",
40
+ default: "p-6",
41
+ lg: "p-8"
42
+ };
43
+ const panelSectionFooterPadding = {
44
+ none: "",
45
+ sm: "px-4 py-2",
46
+ default: "px-6 py-3",
47
+ lg: "px-8 py-4"
48
+ };
49
+ const panelHeaderVariants = cva("flex flex-col gap-1.5", {
50
+ variants: {
51
+ sectioned: {
52
+ true: "",
53
+ false: "mb-4"
54
+ },
55
+ divider: {
56
+ true: "border-b border-border",
57
+ false: ""
58
+ }
59
+ },
60
+ compoundVariants: [{ sectioned: false, divider: true, className: "pb-4" }],
61
+ defaultVariants: { sectioned: false, divider: false }
62
+ });
63
+ const panelTitleVariants = cva(
64
+ "text-h6 font-bold text-foreground leading-tight tracking-tight"
65
+ );
66
+ const panelDescriptionVariants = cva(
67
+ "text-body-2 text-muted-foreground leading-relaxed"
68
+ );
69
+ const panelBodyVariants = cva("flex-1 min-h-0", {
70
+ variants: {
71
+ overflow: {
72
+ auto: "overflow-auto",
73
+ hidden: "overflow-hidden",
74
+ visible: "overflow-visible"
75
+ },
76
+ sectioned: {
77
+ true: "",
78
+ false: ""
79
+ }
80
+ },
81
+ defaultVariants: { overflow: "auto", sectioned: false }
82
+ });
83
+ const panelFooterVariants = cva(
84
+ "flex items-center gap-2 border-t border-border",
85
+ {
86
+ variants: {
87
+ sectioned: {
88
+ true: "",
89
+ false: "pt-4 mt-4"
90
+ },
91
+ justify: {
92
+ start: "justify-start",
93
+ between: "justify-between",
94
+ end: "justify-end"
95
+ }
96
+ },
97
+ defaultVariants: { sectioned: false, justify: "between" }
98
+ }
99
+ );
100
+ const panelResizeHandleVariants = cva(
101
+ "absolute z-10 flex items-center justify-center select-none touch-none group transition-colors duration-100 hover:bg-primary/10 active:bg-primary/15",
102
+ {
103
+ variants: {
104
+ direction: {
105
+ left: "left-0 inset-y-0 w-2 cursor-ew-resize",
106
+ right: "right-0 inset-y-0 w-2 cursor-ew-resize",
107
+ bottom: "bottom-0 inset-x-0 h-2 cursor-ns-resize"
108
+ },
109
+ resizing: {
110
+ true: "bg-primary/15",
111
+ false: ""
112
+ }
113
+ },
114
+ defaultVariants: { direction: "left", resizing: false }
115
+ }
116
+ );
117
+
118
+ export { panelBodyVariants, panelDescriptionVariants, panelFooterVariants, panelHeaderVariants, panelResizeHandleVariants, panelSectionFooterPadding, panelSectionPadding, panelTitleVariants, panelVariants };
@@ -0,0 +1,59 @@
1
+ import type * as React from 'react';
2
+ import type { MotionProp } from '../../types/motion';
3
+ import type { PanelVariants, PanelBodyVariants, PanelFooterVariants } from './Panel.styles';
4
+ export interface PanelProps extends React.HTMLAttributes<HTMLDivElement>, Omit<PanelVariants, 'sectioned'> {
5
+ asChild?: boolean;
6
+ /**
7
+ * Distributes padding to PanelHeader / PanelBody / PanelFooter instead of
8
+ * the root, so header and footer dividers run edge to edge.
9
+ */
10
+ sectioned?: boolean;
11
+ /** Enables a drag handle at the panel edge for continuous resize. */
12
+ resizable?: false | 'horizontal' | 'vertical';
13
+ /** Minimum size in px. Defaults: 120 (horizontal) / 80 (vertical). */
14
+ minSize?: number;
15
+ /** Maximum size in px. Defaults: 640 (horizontal) / 480 (vertical). */
16
+ maxSize?: number;
17
+ /** Initial size in px. Defaults: 320 (horizontal) / 240 (vertical). */
18
+ defaultSize?: number;
19
+ /** Called when a drag-resize interaction commits a new size. */
20
+ onResize?: (size: number) => void;
21
+ /** Shows a chevron toggle button in the header to collapse/expand the panel. */
22
+ collapsible?: boolean;
23
+ /** Controlled collapsed state. */
24
+ collapsed?: boolean;
25
+ /** Uncontrolled initial collapsed state. */
26
+ defaultCollapsed?: boolean;
27
+ /** Size in px when collapsed. Defaults to 40 (narrow icon bar). */
28
+ collapsedSize?: number;
29
+ /** Called when the collapsed state changes. */
30
+ onCollapsedChange?: (collapsed: boolean) => void;
31
+ /**
32
+ * When both `resizable` and `collapsible` are set:
33
+ * - Dragging the handle while collapsed auto-expands to `minSize`.
34
+ * - Dragging below `(collapsedSize + minSize) / 2` auto-collapses.
35
+ * Default: `true`.
36
+ */
37
+ snapToCollapse?: boolean;
38
+ motion?: MotionProp;
39
+ }
40
+ export interface PanelHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
41
+ asChild?: boolean;
42
+ /** Renders a divider line below the header (full width in sectioned panels). */
43
+ divider?: boolean;
44
+ /** Content rendered at the trailing end of the header row. */
45
+ actions?: React.ReactNode;
46
+ }
47
+ export interface PanelTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
48
+ asChild?: boolean;
49
+ }
50
+ export interface PanelDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
51
+ asChild?: boolean;
52
+ }
53
+ export interface PanelBodyProps extends React.HTMLAttributes<HTMLDivElement>, Omit<PanelBodyVariants, 'sectioned'> {
54
+ asChild?: boolean;
55
+ }
56
+ export interface PanelFooterProps extends React.HTMLAttributes<HTMLDivElement>, Omit<PanelFooterVariants, 'sectioned'> {
57
+ asChild?: boolean;
58
+ }
59
+ //# sourceMappingURL=Panel.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Panel.types.d.ts","sourceRoot":"","sources":["../../../src/components/Panel/Panel.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAGpB,qEAAqE;IACrE,SAAS,CAAC,EAAE,KAAK,GAAG,YAAY,GAAG,UAAU,CAAC;IAC9C,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAGlC,gFAAgF;IAChF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kCAAkC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAGjD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAGzB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gFAAgF;IAChF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,qBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,cACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,IAAI,CAAC,mBAAmB,EAAE,WAAW,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1,7 @@
1
+ export * from './Panel';
2
+ export * from './Panel.context';
3
+ export * from './Panel.types';
4
+ export * from './Panel.styles';
5
+ export * from './Panel.helpers';
6
+ export * from './subcomponents';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Panel/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import type { PanelBodyProps } from '../Panel.types';
3
+ export declare const PanelBody: React.ForwardRefExoticComponent<PanelBodyProps & React.RefAttributes<HTMLDivElement>>;
4
+ //# sourceMappingURL=PanelBody.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelBody.d.ts","sourceRoot":"","sources":["../../../../src/components/Panel/subcomponents/PanelBody.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,eAAO,MAAM,SAAS,uFAuDrB,CAAC"}
@@ -0,0 +1,58 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import { Slot } from '@radix-ui/react-slot';
5
+ import { cn } from '@timmbr/utils';
6
+ import { AnimatePresence, motion, panelContentFadeVariants } from '@timmbr/motion';
7
+ import { panelBodyVariants, panelSectionPadding } from '../Panel.styles.js';
8
+ import { usePanelContext } from '../Panel.context.js';
9
+
10
+ const PanelBody = React.forwardRef(
11
+ ({ className, asChild = false, overflow = "auto", children, ...props }, ref) => {
12
+ const { sectioned, padding, collapsed, collapsible, shouldAnimate, panelId } = usePanelContext();
13
+ const Comp = asChild ? Slot : "div";
14
+ const bodyClasses = cn(
15
+ panelBodyVariants({ overflow, sectioned }),
16
+ sectioned && panelSectionPadding[padding],
17
+ className
18
+ );
19
+ if (!collapsible) {
20
+ return /* @__PURE__ */ jsx(
21
+ Comp,
22
+ {
23
+ ref,
24
+ id: `panel-body-${panelId}`,
25
+ "data-slot": "panel-body",
26
+ className: bodyClasses,
27
+ ...props,
28
+ children
29
+ }
30
+ );
31
+ }
32
+ return /* @__PURE__ */ jsx(
33
+ Comp,
34
+ {
35
+ ref,
36
+ id: `panel-body-${panelId}`,
37
+ "data-slot": "panel-body",
38
+ className: cn(bodyClasses, "overflow-hidden"),
39
+ ...props,
40
+ children: shouldAnimate ? /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: !collapsed && /* @__PURE__ */ jsx(
41
+ motion.div,
42
+ {
43
+ variants: panelContentFadeVariants,
44
+ initial: "hidden",
45
+ animate: "visible",
46
+ exit: "exit",
47
+ className: "h-full",
48
+ children
49
+ },
50
+ "panel-body-content"
51
+ ) }) : !collapsed && children
52
+ }
53
+ );
54
+ }
55
+ );
56
+ PanelBody.displayName = "PanelBody";
57
+
58
+ export { PanelBody };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import type { PanelDescriptionProps } from '../Panel.types';
3
+ export declare const PanelDescription: React.ForwardRefExoticComponent<PanelDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
4
+ //# sourceMappingURL=PanelDescription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelDescription.d.ts","sourceRoot":"","sources":["../../../../src/components/Panel/subcomponents/PanelDescription.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,gBAAgB,oGAY5B,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import { Slot } from '@radix-ui/react-slot';
5
+ import { cn } from '@timmbr/utils';
6
+ import { panelDescriptionVariants } from '../Panel.styles.js';
7
+
8
+ const PanelDescription = React.forwardRef(
9
+ ({ className, asChild = false, ...props }, ref) => {
10
+ const Comp = asChild ? Slot : "p";
11
+ return /* @__PURE__ */ jsx(
12
+ Comp,
13
+ {
14
+ ref,
15
+ "data-slot": "panel-description",
16
+ className: cn(panelDescriptionVariants(), className),
17
+ ...props
18
+ }
19
+ );
20
+ }
21
+ );
22
+ PanelDescription.displayName = "PanelDescription";
23
+
24
+ export { PanelDescription };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import type { PanelFooterProps } from '../Panel.types';
3
+ export declare const PanelFooter: React.ForwardRefExoticComponent<PanelFooterProps & React.RefAttributes<HTMLDivElement>>;
4
+ //# sourceMappingURL=PanelFooter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelFooter.d.ts","sourceRoot":"","sources":["../../../../src/components/Panel/subcomponents/PanelFooter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,eAAO,MAAM,WAAW,yFA4BvB,CAAC"}
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import { Slot } from '@radix-ui/react-slot';
5
+ import { cn } from '@timmbr/utils';
6
+ import { panelFooterVariants, panelSectionFooterPadding } from '../Panel.styles.js';
7
+ import { usePanelContext } from '../Panel.context.js';
8
+
9
+ const PanelFooter = React.forwardRef(
10
+ ({ className, asChild = false, justify, children, ...props }, ref) => {
11
+ const { sectioned, padding, collapsed, collapsible } = usePanelContext();
12
+ const Comp = asChild ? Slot : "div";
13
+ const footerClasses = cn(
14
+ panelFooterVariants({ sectioned, justify }),
15
+ sectioned && panelSectionFooterPadding[padding],
16
+ className
17
+ );
18
+ if (!collapsible) {
19
+ return /* @__PURE__ */ jsx(Comp, { ref, "data-slot": "panel-footer", className: footerClasses, ...props, children });
20
+ }
21
+ if (collapsed) return null;
22
+ return /* @__PURE__ */ jsx(Comp, { ref, "data-slot": "panel-footer", className: footerClasses, ...props, children });
23
+ }
24
+ );
25
+ PanelFooter.displayName = "PanelFooter";
26
+
27
+ export { PanelFooter };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import type { PanelHeaderProps } from '../Panel.types';
3
+ export declare const PanelHeader: React.ForwardRefExoticComponent<PanelHeaderProps & React.RefAttributes<HTMLDivElement>>;
4
+ //# sourceMappingURL=PanelHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Panel/subcomponents/PanelHeader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,eAAO,MAAM,WAAW,yFAqGvB,CAAC"}
@@ -0,0 +1,101 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import { Slot } from '@radix-ui/react-slot';
5
+ import { cn } from '@timmbr/utils';
6
+ import { motion, transitions } from '@timmbr/motion';
7
+ import { ChevronRight } from '@timmbr/icons';
8
+ import { panelHeaderVariants, panelSectionPadding } from '../Panel.styles.js';
9
+ import { usePanelContext } from '../Panel.context.js';
10
+
11
+ const PanelHeader = React.forwardRef(
12
+ ({ className, asChild = false, divider = false, actions, children, ...props }, ref) => {
13
+ const {
14
+ sectioned,
15
+ padding,
16
+ collapsed,
17
+ collapsible,
18
+ shouldAnimate,
19
+ panelId,
20
+ placement,
21
+ onToggleCollapse
22
+ } = usePanelContext();
23
+ const Comp = asChild ? Slot : "div";
24
+ const rotationDeg = placement === "right" ? collapsed ? 180 : 0 : collapsed ? 0 : 180;
25
+ const collapseButton = collapsible && /* @__PURE__ */ jsxs(
26
+ "button",
27
+ {
28
+ type: "button",
29
+ "aria-expanded": !collapsed,
30
+ "aria-controls": `panel-body-${panelId}`,
31
+ onClick: onToggleCollapse,
32
+ className: "flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",
33
+ "data-slot": "panel-collapse-toggle",
34
+ children: [
35
+ shouldAnimate ? /* @__PURE__ */ jsx(
36
+ motion.span,
37
+ {
38
+ animate: { rotate: rotationDeg },
39
+ transition: transitions.fast,
40
+ style: { display: "flex", alignItems: "center", justifyContent: "center" },
41
+ children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-3.5 w-3.5" })
42
+ }
43
+ ) : /* @__PURE__ */ jsx(
44
+ "span",
45
+ {
46
+ style: {
47
+ display: "flex",
48
+ alignItems: "center",
49
+ justifyContent: "center",
50
+ transform: `rotate(${rotationDeg}deg)`
51
+ },
52
+ children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-3.5 w-3.5" })
53
+ }
54
+ ),
55
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: collapsed ? "Expand panel" : "Collapse panel" })
56
+ ]
57
+ }
58
+ );
59
+ const headerClasses = cn(
60
+ panelHeaderVariants({ sectioned, divider }),
61
+ sectioned && panelSectionPadding[padding],
62
+ sectioned && !divider && "pb-0",
63
+ className
64
+ );
65
+ if (collapsible && collapsed) {
66
+ return /* @__PURE__ */ jsx(
67
+ Comp,
68
+ {
69
+ ref,
70
+ "data-slot": "panel-header",
71
+ className: cn("flex items-center justify-center py-2", className),
72
+ ...props,
73
+ children: collapseButton
74
+ }
75
+ );
76
+ }
77
+ const hasTrailingContent = actions !== void 0 || collapsible;
78
+ if (!hasTrailingContent) {
79
+ return /* @__PURE__ */ jsx(Comp, { ref, "data-slot": "panel-header", className: headerClasses, ...props, children });
80
+ }
81
+ return /* @__PURE__ */ jsxs(
82
+ Comp,
83
+ {
84
+ ref,
85
+ "data-slot": "panel-header",
86
+ className: cn(headerClasses, "flex-row items-start justify-between gap-2"),
87
+ ...props,
88
+ children: [
89
+ /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-col gap-1", "data-slot": "panel-header-text", children }),
90
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-1 -mt-0.5", "data-slot": "panel-header-actions", children: [
91
+ actions,
92
+ collapseButton
93
+ ] })
94
+ ]
95
+ }
96
+ );
97
+ }
98
+ );
99
+ PanelHeader.displayName = "PanelHeader";
100
+
101
+ export { PanelHeader };
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ interface PanelResizeHandleProps {
3
+ direction: 'left' | 'right' | 'bottom';
4
+ isResizing: boolean;
5
+ handleProps: React.HTMLAttributes<HTMLDivElement> & {
6
+ 'data-resizing'?: string;
7
+ };
8
+ }
9
+ export declare function PanelResizeHandle({ direction, isResizing, handleProps }: PanelResizeHandleProps): React.JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=PanelResizeHandle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelResizeHandle.d.ts","sourceRoot":"","sources":["../../../../src/components/Panel/subcomponents/PanelResizeHandle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,sBAAsB;IAC9B,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IACvC,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAClF;AAED,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,sBAAsB,qBAqB/F"}
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { cn } from '@timmbr/utils';
4
+ import { panelResizeHandleVariants } from '../Panel.styles.js';
5
+
6
+ function PanelResizeHandle({ direction, isResizing, handleProps }) {
7
+ const isVertical = direction === "bottom";
8
+ return /* @__PURE__ */ jsx(
9
+ "div",
10
+ {
11
+ "data-slot": "panel-resize-handle",
12
+ className: cn(panelResizeHandleVariants({ direction, resizing: isResizing })),
13
+ ...handleProps,
14
+ children: /* @__PURE__ */ jsx(
15
+ "div",
16
+ {
17
+ "aria-hidden": "true",
18
+ className: cn(
19
+ "flex shrink-0 items-center justify-center gap-0.5 rounded-full opacity-0 group-hover:opacity-100 transition-opacity duration-150",
20
+ isVertical ? "h-1.5 w-10 flex-row" : "h-10 w-1.5 flex-col"
21
+ ),
22
+ children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx("div", { className: "h-1 w-1 shrink-0 rounded-full bg-muted-foreground/50" }, i))
23
+ }
24
+ )
25
+ }
26
+ );
27
+ }
28
+
29
+ export { PanelResizeHandle };
@@ -0,0 +1,4 @@
1
+ import * as React from 'react';
2
+ import type { PanelTitleProps } from '../Panel.types';
3
+ export declare const PanelTitle: React.ForwardRefExoticComponent<PanelTitleProps & React.RefAttributes<HTMLHeadingElement>>;
4
+ //# sourceMappingURL=PanelTitle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelTitle.d.ts","sourceRoot":"","sources":["../../../../src/components/Panel/subcomponents/PanelTitle.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,eAAO,MAAM,UAAU,4FAYtB,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import { Slot } from '@radix-ui/react-slot';
5
+ import { cn } from '@timmbr/utils';
6
+ import { panelTitleVariants } from '../Panel.styles.js';
7
+
8
+ const PanelTitle = React.forwardRef(
9
+ ({ className, asChild = false, ...props }, ref) => {
10
+ const Comp = asChild ? Slot : "h3";
11
+ return /* @__PURE__ */ jsx(
12
+ Comp,
13
+ {
14
+ ref,
15
+ "data-slot": "panel-title",
16
+ className: cn(panelTitleVariants(), className),
17
+ ...props
18
+ }
19
+ );
20
+ }
21
+ );
22
+ PanelTitle.displayName = "PanelTitle";
23
+
24
+ export { PanelTitle };
@@ -0,0 +1,6 @@
1
+ export { PanelHeader } from './PanelHeader';
2
+ export { PanelTitle } from './PanelTitle';
3
+ export { PanelDescription } from './PanelDescription';
4
+ export { PanelBody } from './PanelBody';
5
+ export { PanelFooter } from './PanelFooter';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Panel/subcomponents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
@@ -4,6 +4,8 @@ import type { StepperProps } from './Stepper.types';
4
4
  * Progress through a sequence of steps (order tracking, checkout, onboarding).
5
5
  * Steps before `current` are complete; `status="error"` marks the current
6
6
  * step as failed (e.g. a cancelled order).
7
+ *
8
+ * Use `variant="progress"` for checkout/KYC flows with icons and status badges.
7
9
  */
8
10
  export declare const Stepper: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<HTMLOListElement>>;
9
11
  //# sourceMappingURL=Stepper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/Stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAQ/D;;;;GAIG;AACH,eAAO,MAAM,OAAO,uFA0EnB,CAAC"}
1
+ {"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../src/components/Stepper/Stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,KAAK,EAA+B,YAAY,EAAE,MAAM,iBAAiB,CAAC;AASjF;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,uFAsFnB,CAAC"}