@mks2508/mks-ui 0.5.2 → 0.5.7

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 -3
  2. package/dist/react-ui/primitives/index.js +5 -0
  3. package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts +120 -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 +190 -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 +94 -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 +182 -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-DOR3Ld-k.css +376 -0
  35. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.css +376 -0
  36. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.js +0 -0
  37. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts +20 -8
  38. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts.map +1 -1
  39. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.js +55 -27
  40. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts +69 -14
  41. package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts.map +1 -1
  42. package/dist/react-ui/ui/DynamicToggle/index.d.ts +22 -20
  43. package/dist/react-ui/ui/DynamicToggle/index.d.ts.map +1 -1
  44. package/dist/react-ui/ui/DynamicToggle/index.js +133 -96
  45. package/dist/react-ui/ui/Switch/index.js +1 -1
  46. package/dist/react-ui/ui/index.js +2 -2
  47. package/package.json +2 -2
  48. package/src/css.d.ts +1 -0
  49. package/src/react-ui/primitives/waapi/Gooey/Gooey.types.ts +141 -0
  50. package/src/react-ui/primitives/waapi/Gooey/GooeyCanvas.tsx +217 -0
  51. package/src/react-ui/primitives/waapi/Gooey/GooeyFilter.tsx +77 -0
  52. package/src/react-ui/primitives/waapi/Gooey/MorphPath.tsx +58 -0
  53. package/src/react-ui/primitives/waapi/Gooey/gooey-utils.ts +253 -0
  54. package/src/react-ui/primitives/waapi/Gooey/index.ts +50 -0
  55. package/src/react-ui/primitives/waapi/Gooey/useMorphPath.ts +48 -0
  56. package/src/react-ui/primitives/waapi/index.ts +23 -0
  57. package/src/react-ui/ui/DataCard/DataCard.styles.ts +45 -101
  58. package/src/react-ui/ui/DataCard/DataCard.types.ts +52 -73
  59. package/src/react-ui/ui/DataCard/index.tsx +118 -184
  60. package/src/react-ui/ui/DynamicToggle/DynamicToggle.css +320 -94
  61. package/src/react-ui/ui/DynamicToggle/DynamicToggle.styles.ts +60 -40
  62. package/src/react-ui/ui/DynamicToggle/DynamicToggle.types.ts +101 -14
  63. package/src/react-ui/ui/DynamicToggle/index.tsx +172 -96
  64. package/src/react-ui/ui/DynamicToggle/prototype-v7-ios.html +413 -0
  65. package/src/react-ui/ui/DynamicToggle/prototype-v7.html +615 -0
  66. package/src/react-ui/ui/DynamicToggle/prototype-v8-gooey-safari.html +560 -0
  67. package/src/react-ui/ui/DynamicToggle/prototype-v8b-react-structure.html +227 -0
  68. package/src/react-ui/ui/DynamicToggle/prototype.html +419 -0
  69. package/src/react-ui/ui/Switch/index.tsx +1 -1
  70. /package/dist/react-ui/blocks/Terminal/panel/{terminal-filter-dropdown.module-DAcl_XQZ.css → terminal-filter-dropdown.module-C6oDcFBS.css} +0 -0
  71. /package/dist/react-ui/blocks/Terminal/panel/{terminal-session-tabs.module-DNAop5e3.css → terminal-session-tabs.module-D_-sgyza.css} +0 -0
  72. /package/dist/react-ui/components/MorphingPopover/{morphing-popover.module-BJrjXisF.css → morphing-popover.module-B1ftlaYj.css} +0 -0
@@ -114,3 +114,26 @@ export { useMorphContext } from './Morph/MorphContext';
114
114
  export { useFLIPClipPath } from './Morph/techniques/useFLIPClipPath';
115
115
  export { useCSSGridMorph } from './Morph/techniques/useCSSGridMorph';
116
116
  export { useViewTransitions } from './Morph/techniques/useViewTransitions';
117
+
118
+ // ============================================================
119
+ // Gooey — SVG-based shape morphing (filter + parametric path)
120
+ // ============================================================
121
+
122
+ export {
123
+ GooeyFilter,
124
+ GooeyCanvas,
125
+ MorphPath,
126
+ useMorphPath,
127
+ GOOEY_DEFAULTS,
128
+ computeBlur,
129
+ buildColorMatrixValues,
130
+ buildFilterString,
131
+ morphPathDown,
132
+ morphPathUp,
133
+ } from './Gooey';
134
+ export type {
135
+ IGooeyFilterProps,
136
+ IGooeyCanvasProps,
137
+ IMorphPathProps,
138
+ IUseMorphPathOptions,
139
+ } from './Gooey';
@@ -1,122 +1,76 @@
1
+ /**
2
+ * DataCard style slots + CVA variants.
3
+ *
4
+ * Glassmorphism card for dashboard metrics/stats.
5
+ * Uses semantic CSS variables — theme-adaptive.
6
+ *
7
+ * @module @mks2508/mks-ui/react/ui/DataCard
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <DataCard variant="accent" size="default">
12
+ * <DataCardLabel title="Revenue" />
13
+ * <DataCardValue number={45678} unit="$" />
14
+ * </DataCard>
15
+ * ```
16
+ */
17
+
1
18
  import { cva } from 'class-variance-authority';
2
19
  import type { StyleSlots } from '@/core/types';
3
20
 
4
21
  /**
5
- * Visual regions for: DataCard component family.
6
- * Each slot maps to: customizable visual region.
22
+ * Visual slots for DataCard component family.
7
23
  */
8
24
  export type DataCardSlot =
9
- | 'root' // Main card container
10
- | 'bracket' // Corner bracket decoration
11
- | 'header' // Top section with title/description
12
- | 'value' // Animated number display
13
- | 'label' // Text labels
14
- | 'toggle' // Switch/checkbox control
15
- | 'actions' // Action buttons container
16
- | 'footer'; // Bottom section
25
+ | 'root'
26
+ | 'bracket'
27
+ | 'value'
28
+ | 'label'
29
+ | 'toggle'
30
+ | 'actions';
17
31
 
18
32
  /**
19
- * Base style slots for: DataCard.
20
- * Uses glassmorphism pattern from: Synthwave Dark design system.
33
+ * Base style slots for DataCard.
21
34
  */
22
35
  export const dataCardStyles: StyleSlots<DataCardSlot> = {
23
36
  root: 'group/data-card relative isolate rounded-xl transition-all duration-300',
24
-
25
- bracket: 'absolute pointer-events-none transition-opacity duration-300',
26
-
27
- header: 'flex flex-col gap-1.5 px-5 pt-5 pb-2',
28
-
37
+ bracket: 'absolute inset-0 pointer-events-none transition-opacity duration-300',
29
38
  value: 'flex items-baseline gap-1 tabular-nums tracking-tight',
30
-
31
39
  label: 'text-sm font-medium',
32
-
33
40
  toggle: 'flex items-center justify-between gap-3',
34
-
35
41
  actions: 'flex items-center gap-2',
36
-
37
- footer: 'mt-auto px-5 pb-4 pt-2',
38
42
  };
39
43
 
40
44
  /**
41
- * CVA variants for: DataCard root.
42
- * Combines glassmorphism with Synthwave Dark color scheme.
45
+ * CVA variants for DataCard root.
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * <DataCard variant="accent" size="compact" glass>...</DataCard>
50
+ * ```
43
51
  */
44
52
  export const dataCardVariants = cva(dataCardStyles.root, {
45
53
  variants: {
46
- // Size variants - control padding and spacing
54
+ /** Size controls padding */
47
55
  size: {
48
- compact: {
49
- root: 'p-3',
50
- header: 'gap-1 px-3 pt-3 pb-1.5',
51
- footer: 'px-3 pb-1.5 pt-1',
52
- },
53
- default: {
54
- root: 'p-4',
55
- header: 'gap-1.5 px-4 pt-4 pb-2',
56
- footer: 'px-4 pb-2 pt-2',
57
- },
58
- spacious: {
59
- root: 'p-6',
60
- header: 'gap-2 px-6 pt-6 pb-3',
61
- footer: 'px-6 pb-3 pt-2',
62
- },
56
+ compact: 'p-3',
57
+ default: 'p-4',
58
+ spacious: 'p-6',
63
59
  },
64
-
65
- // Visual variants - control colors and borders
60
+ /** Visual variant — colors and borders */
66
61
  variant: {
67
- default: [
68
- 'bg-white/5',
69
- 'backdrop-blur-lg',
70
- 'border border-white/10',
71
- 'hover:bg-white/10',
72
- 'shadow-lg shadow-black/20',
73
- ].join(' '),
74
-
75
- accent: [
76
- 'bg-cyan-500/10',
77
- 'backdrop-blur-lg',
78
- 'border border-cyan-400/30',
79
- 'hover:bg-cyan-500/20',
80
- 'shadow-cyan-500/20 shadow-lg',
81
- ].join(' '),
82
-
83
- success: [
84
- 'bg-emerald-500/10',
85
- 'backdrop-blur-lg',
86
- 'border border-emerald-400/30',
87
- 'hover:bg-emerald-500/20',
88
- 'shadow-emerald-500/20 shadow-lg',
89
- ].join(' '),
90
-
91
- warning: [
92
- 'bg-amber-500/10',
93
- 'backdrop-blur-lg',
94
- 'border border-amber-400/30',
95
- 'hover:bg-amber-500/20',
96
- 'shadow-amber-500/20 shadow-lg',
97
- ].join(' '),
98
-
99
- destructive: [
100
- 'bg-red-500/10',
101
- 'backdrop-blur-lg',
102
- 'border border-red-400/30',
103
- 'hover:bg-red-500/20',
104
- 'shadow-red-500/20 shadow-lg',
105
- ].join(' '),
62
+ default: 'bg-card/80 border border-border/50 shadow-lg shadow-black/10',
63
+ accent: 'bg-accent/20 border border-accent/30 shadow-lg shadow-accent/10',
64
+ success: 'bg-green-500/10 dark:bg-green-400/10 border border-green-500/30 dark:border-green-400/30 shadow-lg shadow-green-500/10',
65
+ warning: 'bg-amber-500/10 dark:bg-amber-400/10 border border-amber-500/30 dark:border-amber-400/30 shadow-lg shadow-amber-500/10',
66
+ destructive: 'bg-destructive/10 border border-destructive/30 shadow-lg shadow-destructive/10',
106
67
  },
107
-
108
- // Glass effect toggle
68
+ /** Glass effect — adds backdrop blur */
109
69
  glass: {
110
- true: [
111
- 'backdrop-blur-lg',
112
- 'bg-white/10',
113
- 'border border-white/20',
114
- 'shadow-xl',
115
- ].join(' '),
70
+ true: 'backdrop-blur-lg',
116
71
  false: '',
117
72
  },
118
73
  },
119
-
120
74
  defaultVariants: {
121
75
  variant: 'default',
122
76
  size: 'default',
@@ -125,7 +79,7 @@ export const dataCardVariants = cva(dataCardStyles.root, {
125
79
  });
126
80
 
127
81
  /**
128
- * CVA variants for bracket visibility animation.
82
+ * Bracket visibility animation CVA.
129
83
  */
130
84
  export const bracketVariants = cva(dataCardStyles.bracket, {
131
85
  variants: {
@@ -138,13 +92,3 @@ export const bracketVariants = cva(dataCardStyles.bracket, {
138
92
  animate: true,
139
93
  },
140
94
  });
141
-
142
- /**
143
- * State-specific styles for DataCard interactions.
144
- */
145
- export const dataCardStateStyles = {
146
- hovered: 'scale-[1.02]',
147
- pressed: 'scale-[0.98]',
148
- disabled: 'opacity-50 pointer-events-none',
149
- };
150
-
@@ -1,49 +1,46 @@
1
+ /**
2
+ * DataCard type definitions.
3
+ *
4
+ * @module @mks2508/mks-ui/react/ui/DataCard
5
+ */
6
+
1
7
  import type { VariantProps } from 'class-variance-authority';
2
- import type { SlotOverrides } from '@/core/types';
8
+ import type { SlotOverrides, IBaseConfig } from '@/core/types';
3
9
  import type { dataCardVariants, DataCardSlot } from './DataCard.styles';
4
10
  export type { DataCardSlot } from './DataCard.styles';
5
11
 
6
- /**
7
- * Available visual variants for DataCard.
8
- * - 'default' - Standard glassmorphism with neutral borders
9
- * - 'accent' - Cyan accent with primary glow
10
- * - 'success' - Green accent for positive data
11
- * - 'warning' - Amber accent for warnings
12
- * - 'destructive' - Red accent for critical data
13
- */
12
+ /** Visual variant names */
14
13
  export type DataCardVariant = 'default' | 'accent' | 'success' | 'warning' | 'destructive';
15
14
 
16
- /**
17
- * Size variants affecting padding and spacing.
18
- * - 'compact' - Dense layout for dashboards
19
- * - 'default' - Standard balanced spacing
20
- * - 'spacious' - More breathing room
21
- */
15
+ /** Size variant names */
22
16
  export type DataCardSize = 'compact' | 'default' | 'spacious';
23
17
 
24
18
  /**
25
19
  * Interaction state for state-based styling.
26
- * Similar to Button's IButtonState pattern.
27
20
  */
28
21
  export interface IDataCardState {
29
- /** Whether card content is hovered. */
22
+ /** Whether card is hovered */
30
23
  hovered: boolean;
31
- /** Whether card is pressed/active. */
24
+ /** Whether card is pressed */
32
25
  pressed: boolean;
33
- /** Whether card is disabled. */
26
+ /** Whether card is disabled */
34
27
  disabled: boolean;
35
28
  }
36
29
 
37
30
  /**
38
31
  * Configuration for DataCard behavior and animation.
39
- * Extends IBaseConfig with card-specific settings.
32
+ *
33
+ * @example
34
+ * ```tsx
35
+ * <DataCard config={{ animateBrackets: true, counterStiffness: 150 }}>...</DataCard>
36
+ * ```
40
37
  */
41
- export interface IDataCardConfig {
42
- /** Enable/disable corner bracket animations. */
38
+ export interface IDataCardConfig extends IBaseConfig {
39
+ /** Enable corner bracket hover animation (default: true) */
43
40
  animateBrackets?: boolean;
44
- /** Spring stiffness for number counter. */
41
+ /** Spring stiffness for CountingNumber (default: 90) */
45
42
  counterStiffness?: number;
46
- /** Spring damping for number counter. */
43
+ /** Spring damping for CountingNumber (default: 10) */
47
44
  counterDamping?: number;
48
45
  }
49
46
 
@@ -53,94 +50,76 @@ export interface IDataCardConfig {
53
50
  * @example
54
51
  * ```tsx
55
52
  * <DataCard variant="accent" size="default">
56
- * <DataCardValue number={1234} />
57
- * <DataCardToggle />
53
+ * <DataCardLabel title="Revenue" description="This month" />
54
+ * <DataCardValue number={45678} unit="$" />
58
55
  * </DataCard>
59
56
  * ```
60
57
  */
61
- export interface IDataCardProps
62
- extends VariantProps<typeof dataCardVariants> {
63
- /** Visual style variant. */
58
+ export interface IDataCardProps extends VariantProps<typeof dataCardVariants> {
59
+ /** Visual style variant */
64
60
  variant?: DataCardVariant;
65
- /** Size variant affecting spacing. */
61
+ /** Size variant affecting spacing */
66
62
  size?: DataCardSize;
67
- /** Whether card is disabled. */
63
+ /** Whether card is disabled */
68
64
  disabled?: boolean;
69
- /** Override classes for card visual regions. */
65
+ /** Override classes per slot */
70
66
  slots?: SlotOverrides<DataCardSlot>;
71
- /** Behavioral and animation configuration. */
67
+ /** Behavior/animation configuration */
72
68
  config?: IDataCardConfig;
73
- /** CSS class or function returning class based on card state. */
69
+ /** CSS class or state-based class function */
74
70
  className?: string | ((state: IDataCardState) => string | undefined);
75
- /** CSS styles or function returning styles based on card state. */
71
+ /** CSS styles or state-based styles function */
76
72
  style?: React.CSSProperties | ((state: IDataCardState) => React.CSSProperties | undefined);
77
- /** Enable glassmorphism effect (default: true). */
73
+ /** Enable glassmorphism blur (default: true) */
78
74
  glass?: boolean;
79
- /** Show corner brackets (default: true). */
75
+ /** Show corner brackets (default: true) */
80
76
  showBrackets?: boolean;
81
- /** Child elements. */
77
+ /** Child elements */
82
78
  children?: React.ReactNode;
83
79
  }
84
80
 
85
- /**
86
- * Props for DataCardValue - displays animated number.
87
- */
81
+ /** Props for DataCardValue */
88
82
  export interface IDataCardValueProps {
89
- /** Target number to animate to. */
83
+ /** Target number to animate to */
90
84
  number: number;
91
- /** Label displayed above: number. */
85
+ /** Label displayed above number */
92
86
  label?: string;
93
- /** Unit/suffix displayed after: number. */
87
+ /** Unit/suffix after number */
94
88
  unit?: string;
95
- /** Decimal places for precision. */
89
+ /** Decimal places (default: 0) */
96
90
  decimalPlaces?: number;
97
- /** Pad number with leading zeros. */
91
+ /** Pad number with leading zeros */
98
92
  padStart?: boolean;
99
93
  }
100
94
 
101
- /**
102
- * Props for DataCardLabel - title/description text.
103
- */
95
+ /** Props for DataCardLabel */
104
96
  export interface IDataCardLabelProps extends React.ComponentProps<'div'> {
105
- /** Primary title text. */
97
+ /** Primary title text */
106
98
  title?: string;
107
- /** Secondary description text. */
99
+ /** Secondary description */
108
100
  description?: string;
109
101
  }
110
102
 
111
- /**
112
- * Props for DataCardToggle - interactive switch element.
113
- */
103
+ /** Props for DataCardToggle */
114
104
  export interface IDataCardToggleProps {
115
- /** Whether toggle is checked. */
105
+ /** Whether toggle is checked */
116
106
  checked?: boolean;
117
- /** Callback when toggle state changes. */
107
+ /** Callback when toggle changes */
118
108
  onCheckedChange?: (checked: boolean) => void;
119
- /** Icon to show when checked (on). */
120
- checkedIcon?: React.ReactNode;
121
- /** Icon to show when unchecked (off). */
122
- uncheckedIcon?: React.ReactNode;
123
- /** Label for: toggle. */
109
+ /** Label for the toggle */
124
110
  label?: string;
125
- /** Override classes for toggle regions. */
126
- slots?: SlotOverrides<DataCardSlot>;
127
111
  }
128
112
 
129
- /**
130
- * Props for DataCardActions - action button container.
131
- */
113
+ /** Props for DataCardActions */
132
114
  export interface IDataCardActionsProps extends React.ComponentProps<'div'> {
133
- /** Alignment of action buttons. */
115
+ /** Button alignment */
134
116
  align?: 'start' | 'center' | 'end';
135
117
  }
136
118
 
137
- /**
138
- * Props for DataCardBracket - decorative corner element.
139
- */
119
+ /** Props for DataCardBracket */
140
120
  export interface IDataCardBracketProps extends React.ComponentProps<'div'> {
141
- /** Position of: bracket. */
121
+ /** Corner position */
142
122
  position: 'tl' | 'tr' | 'bl' | 'br';
143
- /** Optional variant override for: this bracket. */
123
+ /** Variant override */
144
124
  variant?: 'default' | 'accent';
145
125
  }
146
-