@mks2508/mks-ui 0.5.1 → 0.5.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.
Files changed (72) hide show
  1. package/dist/react-ui/index.js +8 -1
  2. package/dist/react-ui/primitives/index.js +5 -0
  3. package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts +103 -0
  4. package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts.map +1 -0
  5. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts +10 -0
  6. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts.map +1 -0
  7. package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.js +59 -0
  8. package/dist/react-ui/primitives/waapi/Gooey/GooeyFilter.d.ts +7 -0
  9. package/dist/react-ui/primitives/waapi/Gooey/GooeyFilter.d.ts.map +1 -0
  10. package/dist/react-ui/primitives/waapi/Gooey/GooeyFilter.js +78 -0
  11. package/dist/react-ui/primitives/waapi/Gooey/MorphPath.d.ts +7 -0
  12. package/dist/react-ui/primitives/waapi/Gooey/MorphPath.d.ts.map +1 -0
  13. package/dist/react-ui/primitives/waapi/Gooey/MorphPath.js +51 -0
  14. package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.d.ts +87 -0
  15. package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.d.ts.map +1 -0
  16. package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.js +177 -0
  17. package/dist/react-ui/primitives/waapi/Gooey/index.d.ts +28 -0
  18. package/dist/react-ui/primitives/waapi/Gooey/index.d.ts.map +1 -0
  19. package/dist/react-ui/primitives/waapi/Gooey/index.js +5 -0
  20. package/dist/react-ui/primitives/waapi/Gooey/useMorphPath.d.ts +7 -0
  21. package/dist/react-ui/primitives/waapi/Gooey/useMorphPath.d.ts.map +1 -0
  22. package/dist/react-ui/primitives/waapi/Gooey/useMorphPath.js +47 -0
  23. package/dist/react-ui/primitives/waapi/index.d.ts +2 -0
  24. package/dist/react-ui/primitives/waapi/index.d.ts.map +1 -1
  25. package/dist/react-ui/primitives/waapi/index.js +6 -0
  26. package/dist/react-ui/ui/DataCard/DataCard.styles.d.ts +26 -16
  27. package/dist/react-ui/ui/DataCard/DataCard.styles.d.ts.map +1 -1
  28. package/dist/react-ui/ui/DataCard/DataCard.styles.js +36 -74
  29. package/dist/react-ui/ui/DataCard/DataCard.types.d.ts +50 -70
  30. package/dist/react-ui/ui/DataCard/DataCard.types.d.ts.map +1 -1
  31. package/dist/react-ui/ui/DataCard/index.d.ts +24 -93
  32. package/dist/react-ui/ui/DataCard/index.d.ts.map +1 -1
  33. package/dist/react-ui/ui/DataCard/index.js +76 -118
  34. package/dist/react-ui/ui/DynamicToggle/DynamicToggle-Cm6-VceQ.css +304 -0
  35. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.css +303 -0
  36. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.js +0 -0
  37. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts +35 -0
  38. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts.map +1 -0
  39. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.js +67 -0
  40. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts +138 -0
  41. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts.map +1 -0
  42. package/dist/react-ui/ui/DynamicToggle/index.d.ts +31 -0
  43. package/dist/react-ui/ui/DynamicToggle/index.d.ts.map +1 -0
  44. package/dist/react-ui/ui/DynamicToggle/index.js +188 -0
  45. package/dist/react-ui/ui/Switch/index.js +1 -1
  46. package/dist/react-ui/ui/index.d.ts +1 -0
  47. package/dist/react-ui/ui/index.d.ts.map +1 -1
  48. package/dist/react-ui/ui/index.js +2 -0
  49. package/package.json +2 -2
  50. package/src/css.d.ts +1 -0
  51. package/src/react-ui/primitives/waapi/Gooey/Gooey.types.ts +123 -0
  52. package/src/react-ui/primitives/waapi/Gooey/GooeyCanvas.tsx +80 -0
  53. package/src/react-ui/primitives/waapi/Gooey/GooeyFilter.tsx +77 -0
  54. package/src/react-ui/primitives/waapi/Gooey/MorphPath.tsx +58 -0
  55. package/src/react-ui/primitives/waapi/Gooey/gooey-utils.ts +244 -0
  56. package/src/react-ui/primitives/waapi/Gooey/index.ts +50 -0
  57. package/src/react-ui/primitives/waapi/Gooey/useMorphPath.ts +48 -0
  58. package/src/react-ui/primitives/waapi/index.ts +23 -0
  59. package/src/react-ui/ui/DataCard/DataCard.styles.ts +45 -101
  60. package/src/react-ui/ui/DataCard/DataCard.types.ts +52 -73
  61. package/src/react-ui/ui/DataCard/index.tsx +118 -184
  62. package/src/react-ui/ui/DynamicToggle/DynamicToggle.css +303 -0
  63. package/src/react-ui/ui/DynamicToggle/DynamicToggle.styles.ts +85 -0
  64. package/src/react-ui/ui/DynamicToggle/DynamicToggle.types.ts +174 -0
  65. package/src/react-ui/ui/DynamicToggle/index.tsx +294 -0
  66. package/src/react-ui/ui/DynamicToggle/prototype-v7.html +615 -0
  67. package/src/react-ui/ui/DynamicToggle/prototype.html +419 -0
  68. package/src/react-ui/ui/Switch/index.tsx +1 -1
  69. package/src/react-ui/ui/index.ts +3 -0
  70. /package/dist/react-ui/blocks/Terminal/panel/{terminal-filter-dropdown.module-CNVWCefU.css → terminal-filter-dropdown.module-C6oDcFBS.css} +0 -0
  71. /package/dist/react-ui/blocks/Terminal/panel/{terminal-session-tabs.module-cmyJ11jP.css → terminal-session-tabs.module-D_-sgyza.css} +0 -0
  72. /package/dist/react-ui/components/MorphingPopover/{morphing-popover.module-BycNI8nU.css → morphing-popover.module-B1ftlaYj.css} +0 -0
@@ -1,127 +1,58 @@
1
- import * as React from 'react';
2
1
  import { dataCardVariants } from './DataCard.styles';
3
2
  import type { SlotOverrides } from '../../../core/types';
4
- import type { IDataCardProps, IDataCardValueProps, IDataCardLabelProps, IDataCardToggleProps, IDataCardActionsProps, IDataCardBracketProps, IDataCardState, DataCardSlot } from './DataCard.types';
5
- /**
6
- * Context type for DataCard state management.
7
- */
3
+ import type { IDataCardProps, IDataCardValueProps, IDataCardLabelProps, IDataCardToggleProps, IDataCardActionsProps, IDataCardBracketProps, IDataCardConfig, DataCardSlot } from './DataCard.types';
8
4
  type DataCardContextType = {
9
- /** Current variant of: card. */
10
5
  variant: IDataCardProps['variant'];
11
- /** Current size of: card. */
12
6
  size: IDataCardProps['size'];
13
- /** Whether card is disabled. */
14
7
  disabled: boolean;
15
- /** Whether glass effect is enabled. */
16
8
  glass: boolean;
17
- /** Slot overrides from parent. */
9
+ config?: IDataCardConfig;
18
10
  slots?: SlotOverrides<DataCardSlot>;
19
- /** Update interaction state. */
20
- setState: React.Dispatch<React.SetStateAction<IDataCardState>>;
21
11
  };
22
12
  declare const useDataCard: () => DataCardContextType;
23
13
  /**
24
- * DataCard comprehensive showcase component demonstrating mks-ui patterns.
25
- *
26
- * Features:
27
- * - Slot overrides for customization
28
- * - State-based styling (hover, pressed, disabled)
29
- * - CVA variants (size, color variant)
30
- * - asChild composition pattern
31
- * - Motion/animation integration
32
- * - Custom render functions
33
- * - Form field integration
34
- * - Icon composition
35
- * - Glassmorphism effects
14
+ * Root card container with glassmorphism, corner brackets, and state tracking.
36
15
  *
37
- * @example
38
- * ```tsx
39
- * <DataCard variant="accent" size="default">
40
- * <DataCardValue number={1234} />
41
- * <DataCardToggle />
42
- * </DataCard>
43
- * ```
16
+ * @param props - {@link IDataCardProps}
17
+ * @returns A motion.div card with context provider
44
18
  */
45
- declare function DataCard({ variant, size, disabled, glass, showBrackets, className, style, slots, config, children, ...props }: IDataCardProps): import("react/jsx-runtime").JSX.Element;
19
+ declare function DataCard({ variant, size, disabled, glass, showBrackets, className, style, slots, config, children, }: IDataCardProps): import("react/jsx-runtime").JSX.Element;
46
20
  /**
47
- * DataCardValue displays animated number with CountingNumber.
21
+ * Animated number display with optional label and unit.
48
22
  *
49
- * @example
50
- * ```tsx
51
- * <DataCardValue
52
- * number={1234}
53
- * label="Active Users"
54
- * unit="users"
55
- * />
56
- * ```
23
+ * @param props - {@link IDataCardValueProps}
24
+ * @returns Animated number with CountingNumber primitive
57
25
  */
58
26
  declare function DataCardValue({ number, label, unit, decimalPlaces, padStart, }: IDataCardValueProps): import("react/jsx-runtime").JSX.Element;
59
27
  /**
60
- * DataCardLabel displays title and description.
28
+ * Title + description label.
61
29
  *
62
- * @example
63
- * ```tsx
64
- * <DataCardLabel
65
- * title="Revenue"
66
- * description="This month"
67
- * />
68
- * ```
30
+ * @param props - {@link IDataCardLabelProps}
31
+ * @returns Title and optional description text
69
32
  */
70
33
  declare function DataCardLabel({ title, description, className, ...props }: IDataCardLabelProps): import("react/jsx-runtime").JSX.Element;
71
34
  /**
72
- * DataCardToggle interactive switch element.
35
+ * Switch toggle control inside a DataCard.
73
36
  *
74
- * Uses asChild pattern for composition with Switch component.
75
- *
76
- * @example
77
- * ```tsx
78
- * <DataCardToggle
79
- * checked={enabled}
80
- * onCheckedChange={setEnabled}
81
- * label="Enable notifications"
82
- * checkedIcon={<BellIcon />}
83
- * uncheckedIcon={<BellOffIcon />}
84
- * />
85
- * ```
37
+ * @param props - {@link IDataCardToggleProps}
38
+ * @returns Label + Switch toggle
86
39
  */
87
- declare function DataCardToggle({ checked, onCheckedChange, checkedIcon, uncheckedIcon, label, }: IDataCardToggleProps): import("react/jsx-runtime").JSX.Element;
40
+ declare function DataCardToggle({ checked, onCheckedChange, label, }: IDataCardToggleProps): import("react/jsx-runtime").JSX.Element;
88
41
  /**
89
- * DataCardActions container for action buttons.
42
+ * Action button container.
90
43
  *
91
- * @example
92
- * ```tsx
93
- * <DataCardActions align="end">
94
- * <Button size="sm">Edit</Button>
95
- * <Button size="sm" variant="ghost">Delete</Button>
96
- * </DataCardActions>
97
- * ```
44
+ * @param props - {@link IDataCardActionsProps}
45
+ * @returns Flex container for action buttons
98
46
  */
99
47
  declare function DataCardActions({ align, className, children, ...props }: IDataCardActionsProps): import("react/jsx-runtime").JSX.Element;
100
48
  /**
101
- * DataCardBracket — decorative corner bracket.
102
- *
103
- * Wraps CornerBracket with motion animations.
104
- *
105
- * @example
106
- * ```tsx
107
- * <DataCardBracket position="tl" variant="accent" />
108
- * ```
109
- */
110
- declare function DataCardBracket({ position, variant, className, }: IDataCardBracketProps): import("react/jsx-runtime").JSX.Element;
111
- /**
112
- * Hook to access DataCard context.
113
- * Must be used within DataCard provider.
114
- *
115
- * @returns The current DataCard context
49
+ * Decorative corner bracket. Rendered directly via CornerBracket
50
+ * (no wrapper div — the SVG positions itself via absolute positioning).
116
51
  *
117
- * @example
118
- * ```tsx
119
- * function MyComponent() {
120
- * const { variant, size, disabled } = useDataCard();
121
- * return <div>Current variant: {variant}</div>;
122
- * }
123
- * ```
52
+ * @param props - {@link IDataCardBracketProps}
53
+ * @returns CornerBracket SVG at the specified corner
124
54
  */
55
+ declare function DataCardBracket({ position, variant, }: IDataCardBracketProps): import("react/jsx-runtime").JSX.Element;
125
56
  export { useDataCard };
126
57
  export { DataCard, DataCardValue, DataCardLabel, DataCardToggle, DataCardActions, DataCardBracket, dataCardVariants, };
127
58
  export type { IDataCardProps, IDataCardValueProps, IDataCardLabelProps, IDataCardToggleProps, IDataCardActionsProps, IDataCardBracketProps, IDataCardState, IDataCardConfig, DataCardVariant, DataCardSize, DataCardSlot, } from './DataCard.types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/DataCard/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,EAAE,gBAAgB,EAAwD,MAAM,mBAAmB,CAAC;AAC3G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACb,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,KAAK,mBAAmB,GAAG;IACzB,gCAAgC;IAChC,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACnC,6BAA6B;IAC7B,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC7B,gCAAgC;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,kCAAkC;IAClC,KAAK,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACpC,gCAAgC;IAChC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;CAChE,CAAC;AAEF,QAAA,MAAyB,WAAW,2BACsB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,iBAAS,QAAQ,CAAC,EAChB,OAAmB,EACnB,IAAgB,EAChB,QAAgB,EAChB,KAAY,EACZ,YAAmB,EACnB,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,2CA0EhB;AAED;;;;;;;;;;;GAWG;AACH,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,KAAK,EACL,IAAI,EACJ,aAAiB,EACjB,QAAgB,GACjB,EAAE,mBAAmB,2CA+BrB;AAED;;;;;;;;;;GAUG;AACH,iBAAS,aAAa,CAAC,EACrB,KAAK,EACL,WAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EAAE,mBAAmB,2CAqBrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,cAAc,CAAC,EACtB,OAAO,EACP,eAAe,EACf,WAAW,EACX,aAAa,EACb,KAAK,GACN,EAAE,oBAAoB,2CAqBtB;AAED;;;;;;;;;;GAUG;AACH,iBAAS,eAAe,CAAC,EACvB,KAAa,EACb,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,qBAAqB,2CAoBvB;AAED;;;;;;;;;GASG;AACH,iBAAS,eAAe,CAAC,EACvB,QAAQ,EACR,OAAmB,EACnB,SAAS,GACV,EAAE,qBAAqB,2CAkBvB;AAED;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,OAAO,EACL,QAAQ,EACR,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,GACjB,CAAC;AAGF,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,EACZ,YAAY,GACb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/DataCard/index.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAE,gBAAgB,EAAmC,MAAM,mBAAmB,CAAC;AACtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EAErB,eAAe,EACf,YAAY,EACb,MAAM,kBAAkB,CAAC;AAM1B,KAAK,mBAAmB,GAAG;IACzB,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACnC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;CACrC,CAAC;AAEF,QAAA,MAAyB,WAAW,2BACsB,CAAC;AAM3D;;;;;GAKG;AACH,iBAAS,QAAQ,CAAC,EAChB,OAAmB,EACnB,IAAgB,EAChB,QAAgB,EAChB,KAAY,EACZ,YAAmB,EACnB,SAAS,EACT,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,GACT,EAAE,cAAc,2CAgDhB;AAMD;;;;;GAKG;AACH,iBAAS,aAAa,CAAC,EACrB,MAAM,EACN,KAAK,EACL,IAAI,EACJ,aAAiB,EACjB,QAAgB,GACjB,EAAE,mBAAmB,2CA8BrB;AAMD;;;;;GAKG;AACH,iBAAS,aAAa,CAAC,EACrB,KAAK,EACL,WAAW,EACX,SAAS,EACT,GAAG,KAAK,EACT,EAAE,mBAAmB,2CAarB;AAMD;;;;;GAKG;AACH,iBAAS,cAAc,CAAC,EACtB,OAAO,EACP,eAAe,EACf,KAAK,GACN,EAAE,oBAAoB,2CAgBtB;AAMD;;;;;GAKG;AACH,iBAAS,eAAe,CAAC,EACvB,KAAa,EACb,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,qBAAqB,2CAoBvB;AAMD;;;;;;GAMG;AACH,iBAAS,eAAe,CAAC,EACvB,QAAQ,EACR,OAAmB,GACpB,EAAE,qBAAqB,2CAiBvB;AAMD,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB,OAAO,EACL,QAAQ,EACR,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,eAAe,EACf,gBAAgB,GACjB,CAAC;AAEF,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,eAAe,EACf,eAAe,EACf,YAAY,EACZ,YAAY,GACb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
@@ -5,63 +5,58 @@ import { CountingNumber } from "../../primitives/CountingNumber/index.js";
5
5
  import { getStrictContext } from "../../lib/get-strict-context.js";
6
6
  import { Switch, SwitchThumb } from "../Switch/index.js";
7
7
  import { CornerBracket } from "../CornerBracket/index.js";
8
- import { dataCardStateStyles, dataCardStyles, dataCardVariants } from "./DataCard.styles.js";
8
+ import { dataCardStyles, dataCardVariants } from "./DataCard.styles.js";
9
9
  import * as React$1 from "react";
10
10
  import { motion } from "motion/react";
11
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
12
 
13
13
  //#region src/react-ui/ui/DataCard/index.tsx
14
- const [DataCardProvider, useDataCard] = getStrictContext("DataCardContext");
15
14
  /**
16
- * DataCard — comprehensive showcase component demonstrating mks-ui patterns.
15
+ * DataCard — glassmorphism dashboard metric card.
16
+ *
17
+ * Features: animated numbers, corner brackets, toggle, size/variant CVA,
18
+ * state-based styling, slot overrides, config for animation tuning.
17
19
  *
18
- * Features:
19
- * - Slot overrides for customization
20
- * - State-based styling (hover, pressed, disabled)
21
- * - CVA variants (size, color variant)
22
- * - asChild composition pattern
23
- * - Motion/animation integration
24
- * - Custom render functions
25
- * - Form field integration
26
- * - Icon composition
27
- * - Glassmorphism effects
20
+ * @module @mks2508/mks-ui/react/ui/DataCard
28
21
  *
29
22
  * @example
30
23
  * ```tsx
31
24
  * <DataCard variant="accent" size="default">
32
- * <DataCardValue number={1234} />
33
- * <DataCardToggle />
25
+ * <DataCardLabel title="Revenue" description="This month" />
26
+ * <DataCardValue number={45678} unit="$" />
34
27
  * </DataCard>
35
28
  * ```
36
29
  */
37
- function DataCard({ variant = "default", size = "default", disabled = false, glass = true, showBrackets = true, className, style, slots, config, children, ...props }) {
30
+ const [DataCardProvider, useDataCard] = getStrictContext("DataCardContext");
31
+ /**
32
+ * Root card container with glassmorphism, corner brackets, and state tracking.
33
+ *
34
+ * @param props - {@link IDataCardProps}
35
+ * @returns A motion.div card with context provider
36
+ */
37
+ function DataCard({ variant = "default", size = "default", disabled = false, glass = true, showBrackets = true, className, style, slots, config, children }) {
38
38
  const [state, setState] = React$1.useState({
39
39
  hovered: false,
40
40
  pressed: false,
41
- disabled: disabled ?? false
41
+ disabled
42
42
  });
43
43
  const contextValue = React$1.useMemo(() => ({
44
44
  variant,
45
45
  size,
46
- disabled: disabled ?? false,
46
+ disabled,
47
47
  glass,
48
- slots,
49
- setState
48
+ config,
49
+ slots
50
50
  }), [
51
51
  variant,
52
52
  size,
53
53
  disabled,
54
54
  glass,
55
+ config,
55
56
  slots
56
57
  ]);
57
- const computedClassName = React$1.useMemo(() => {
58
- if (typeof className === "function") return className(state);
59
- return className;
60
- }, [className, state]);
61
- const computedStyle = React$1.useMemo(() => {
62
- if (typeof style === "function") return style(state);
63
- return style;
64
- }, [style, state]);
58
+ const computedClassName = typeof className === "function" ? className(state) : className;
59
+ const computedStyle = typeof style === "function" ? style(state) : style;
65
60
  return /* @__PURE__ */ jsx(DataCardProvider, {
66
61
  value: contextValue,
67
62
  children: /* @__PURE__ */ jsxs(motion.div, {
@@ -74,29 +69,28 @@ function DataCard({ variant = "default", size = "default", disabled = false, gla
74
69
  variant,
75
70
  size,
76
71
  glass
77
- }), slots?.root, computedClassName, state.hovered && dataCardStateStyles.hovered, state.pressed && dataCardStateStyles.pressed, disabled && dataCardStateStyles.disabled),
72
+ }), disabled && "opacity-50 pointer-events-none", slots?.root, computedClassName),
78
73
  style: computedStyle,
79
- onHoverStart: () => setState((prev) => ({
80
- ...prev,
74
+ onHoverStart: () => setState((p) => ({
75
+ ...p,
81
76
  hovered: true
82
77
  })),
83
- onHoverEnd: () => setState((prev) => ({
84
- ...prev,
78
+ onHoverEnd: () => setState((p) => ({
79
+ ...p,
85
80
  hovered: false
86
81
  })),
87
- onTapStart: () => setState((prev) => ({
88
- ...prev,
82
+ onTapStart: () => setState((p) => ({
83
+ ...p,
89
84
  pressed: true
90
85
  })),
91
- onTap: () => setState((prev) => ({
92
- ...prev,
86
+ onTap: () => setState((p) => ({
87
+ ...p,
93
88
  pressed: false
94
89
  })),
95
- onTapCancel: () => setState((prev) => ({
96
- ...prev,
90
+ onTapCancel: () => setState((p) => ({
91
+ ...p,
97
92
  pressed: false
98
93
  })),
99
- ...props,
100
94
  children: [showBrackets && /* @__PURE__ */ jsxs(Fragment, { children: [
101
95
  /* @__PURE__ */ jsx(DataCardBracket, {
102
96
  position: "tl",
@@ -119,22 +113,19 @@ function DataCard({ variant = "default", size = "default", disabled = false, gla
119
113
  });
120
114
  }
121
115
  /**
122
- * DataCardValue displays animated number with CountingNumber.
116
+ * Animated number display with optional label and unit.
123
117
  *
124
- * @example
125
- * ```tsx
126
- * <DataCardValue
127
- * number={1234}
128
- * label="Active Users"
129
- * unit="users"
130
- * />
131
- * ```
118
+ * @param props - {@link IDataCardValueProps}
119
+ * @returns Animated number with CountingNumber primitive
132
120
  */
133
121
  function DataCardValue({ number, label, unit, decimalPlaces = 0, padStart = false }) {
134
- const { variant, size } = useDataCard();
122
+ const { size, config, slots } = useDataCard();
123
+ const stiffness = config?.counterStiffness ?? 90;
124
+ const damping = config?.counterDamping ?? 10;
125
+ const sizeClass = size === "compact" ? "text-3xl font-bold" : size === "spacious" ? "text-5xl font-bold" : "text-4xl font-bold";
135
126
  return /* @__PURE__ */ jsxs("div", {
136
127
  "data-slot": "data-card-value",
137
- className: cn(dataCardStyles.value),
128
+ className: cn(dataCardStyles.value, slots?.value),
138
129
  children: [
139
130
  label && /* @__PURE__ */ jsx("span", {
140
131
  className: "text-muted-foreground text-xs uppercase tracking-wider font-mono",
@@ -145,10 +136,10 @@ function DataCardValue({ number, label, unit, decimalPlaces = 0, padStart = fals
145
136
  decimalPlaces,
146
137
  padStart,
147
138
  transition: {
148
- stiffness: variant === "accent" ? 150 : 90,
149
- damping: variant === "accent" ? 20 : 10
139
+ stiffness,
140
+ damping
150
141
  },
151
- className: size === "compact" ? "text-3xl font-bold" : size === "spacious" ? "text-5xl font-bold" : "text-4xl font-bold"
142
+ className: sizeClass
152
143
  }),
153
144
  unit && /* @__PURE__ */ jsx("span", {
154
145
  className: "text-muted-foreground text-lg ml-1",
@@ -158,15 +149,10 @@ function DataCardValue({ number, label, unit, decimalPlaces = 0, padStart = fals
158
149
  });
159
150
  }
160
151
  /**
161
- * DataCardLabel displays title and description.
152
+ * Title + description label.
162
153
  *
163
- * @example
164
- * ```tsx
165
- * <DataCardLabel
166
- * title="Revenue"
167
- * description="This month"
168
- * />
169
- * ```
154
+ * @param props - {@link IDataCardLabelProps}
155
+ * @returns Title and optional description text
170
156
  */
171
157
  function DataCardLabel({ title, description, className, ...props }) {
172
158
  const { slots } = useDataCard();
@@ -184,60 +170,36 @@ function DataCardLabel({ title, description, className, ...props }) {
184
170
  });
185
171
  }
186
172
  /**
187
- * DataCardToggle interactive switch element.
173
+ * Switch toggle control inside a DataCard.
188
174
  *
189
- * Uses asChild pattern for composition with Switch component.
190
- *
191
- * @example
192
- * ```tsx
193
- * <DataCardToggle
194
- * checked={enabled}
195
- * onCheckedChange={setEnabled}
196
- * label="Enable notifications"
197
- * checkedIcon={<BellIcon />}
198
- * uncheckedIcon={<BellOffIcon />}
199
- * />
200
- * ```
175
+ * @param props - {@link IDataCardToggleProps}
176
+ * @returns Label + Switch toggle
201
177
  */
202
- function DataCardToggle({ checked, onCheckedChange, checkedIcon, uncheckedIcon, label }) {
203
- const { disabled, variant, size, glass, slots } = useDataCard();
178
+ function DataCardToggle({ checked, onCheckedChange, label }) {
179
+ const { disabled, slots } = useDataCard();
204
180
  return /* @__PURE__ */ jsxs("div", {
205
181
  "data-slot": "data-card-toggle",
206
182
  className: cn(dataCardStyles.toggle, slots?.toggle),
207
183
  children: [label && /* @__PURE__ */ jsx("span", {
208
184
  className: "text-sm text-muted-foreground",
209
185
  children: label
210
- }), /* @__PURE__ */ jsxs(Switch, {
186
+ }), /* @__PURE__ */ jsx(Switch, {
211
187
  checked,
212
188
  onCheckedChange,
213
189
  disabled,
214
- children: [
215
- /* @__PURE__ */ jsx(SwitchThumb, {}),
216
- checkedIcon && /* @__PURE__ */ jsx("div", {
217
- className: "text-primary",
218
- children: checkedIcon
219
- }),
220
- !checkedIcon && /* @__PURE__ */ jsx("div", {
221
- className: "text-muted-foreground",
222
- children: uncheckedIcon
223
- })
224
- ]
190
+ nativeButton: true,
191
+ children: /* @__PURE__ */ jsx(SwitchThumb, {})
225
192
  })]
226
193
  });
227
194
  }
228
195
  /**
229
- * DataCardActions container for action buttons.
196
+ * Action button container.
230
197
  *
231
- * @example
232
- * ```tsx
233
- * <DataCardActions align="end">
234
- * <Button size="sm">Edit</Button>
235
- * <Button size="sm" variant="ghost">Delete</Button>
236
- * </DataCardActions>
237
- * ```
198
+ * @param props - {@link IDataCardActionsProps}
199
+ * @returns Flex container for action buttons
238
200
  */
239
201
  function DataCardActions({ align = "end", className, children, ...props }) {
240
- const { variant, size, glass, slots } = useDataCard();
202
+ const { slots } = useDataCard();
241
203
  return /* @__PURE__ */ jsx("div", {
242
204
  "data-slot": "data-card-actions",
243
205
  "data-align": align,
@@ -247,28 +209,24 @@ function DataCardActions({ align = "end", className, children, ...props }) {
247
209
  });
248
210
  }
249
211
  /**
250
- * DataCardBracket — decorative corner bracket.
212
+ * Decorative corner bracket. Rendered directly via CornerBracket
213
+ * (no wrapper div — the SVG positions itself via absolute positioning).
251
214
  *
252
- * Wraps CornerBracket with motion animations.
253
- *
254
- * @example
255
- * ```tsx
256
- * <DataCardBracket position="tl" variant="accent" />
257
- * ```
215
+ * @param props - {@link IDataCardBracketProps}
216
+ * @returns CornerBracket SVG at the specified corner
258
217
  */
259
- function DataCardBracket({ position, variant = "default", className }) {
260
- const { size, glass, slots } = useDataCard();
261
- return /* @__PURE__ */ jsx("div", {
262
- className: cn(dataCardStyles.bracket, slots?.bracket, className),
263
- children: /* @__PURE__ */ jsx(CornerBracket, {
264
- position,
265
- variant,
266
- size: {
267
- compact: 16,
268
- default: 20,
269
- spacious: 24
270
- }[size ?? "default"]
271
- })
218
+ function DataCardBracket({ position, variant = "default" }) {
219
+ const { size, config } = useDataCard();
220
+ const animate = config?.animateBrackets ?? true;
221
+ return /* @__PURE__ */ jsx(CornerBracket, {
222
+ position,
223
+ variant,
224
+ size: {
225
+ compact: 16,
226
+ default: 20,
227
+ spacious: 24
228
+ }[size ?? "default"],
229
+ className: cn(animate && "opacity-60 group-hover/data-card:opacity-100 transition-opacity", !animate && "opacity-50")
272
230
  });
273
231
  }
274
232