@mks2508/mks-ui 0.5.2 → 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.
- package/dist/react-ui/index.js +8 -3
- package/dist/react-ui/primitives/index.js +5 -0
- package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts +103 -0
- package/dist/react-ui/primitives/waapi/Gooey/Gooey.types.d.ts.map +1 -0
- package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts +10 -0
- package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.d.ts.map +1 -0
- package/dist/react-ui/primitives/waapi/Gooey/GooeyCanvas.js +59 -0
- package/dist/react-ui/primitives/waapi/Gooey/GooeyFilter.d.ts +7 -0
- package/dist/react-ui/primitives/waapi/Gooey/GooeyFilter.d.ts.map +1 -0
- package/dist/react-ui/primitives/waapi/Gooey/GooeyFilter.js +78 -0
- package/dist/react-ui/primitives/waapi/Gooey/MorphPath.d.ts +7 -0
- package/dist/react-ui/primitives/waapi/Gooey/MorphPath.d.ts.map +1 -0
- package/dist/react-ui/primitives/waapi/Gooey/MorphPath.js +51 -0
- package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.d.ts +87 -0
- package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.d.ts.map +1 -0
- package/dist/react-ui/primitives/waapi/Gooey/gooey-utils.js +177 -0
- package/dist/react-ui/primitives/waapi/Gooey/index.d.ts +28 -0
- package/dist/react-ui/primitives/waapi/Gooey/index.d.ts.map +1 -0
- package/dist/react-ui/primitives/waapi/Gooey/index.js +5 -0
- package/dist/react-ui/primitives/waapi/Gooey/useMorphPath.d.ts +7 -0
- package/dist/react-ui/primitives/waapi/Gooey/useMorphPath.d.ts.map +1 -0
- package/dist/react-ui/primitives/waapi/Gooey/useMorphPath.js +47 -0
- package/dist/react-ui/primitives/waapi/index.d.ts +2 -0
- package/dist/react-ui/primitives/waapi/index.d.ts.map +1 -1
- package/dist/react-ui/primitives/waapi/index.js +6 -0
- package/dist/react-ui/ui/DataCard/DataCard.styles.d.ts +26 -16
- package/dist/react-ui/ui/DataCard/DataCard.styles.d.ts.map +1 -1
- package/dist/react-ui/ui/DataCard/DataCard.styles.js +36 -74
- package/dist/react-ui/ui/DataCard/DataCard.types.d.ts +50 -70
- package/dist/react-ui/ui/DataCard/DataCard.types.d.ts.map +1 -1
- package/dist/react-ui/ui/DataCard/index.d.ts +24 -93
- package/dist/react-ui/ui/DataCard/index.d.ts.map +1 -1
- package/dist/react-ui/ui/DataCard/index.js +76 -118
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle-Cm6-VceQ.css +304 -0
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.css +303 -0
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.js +0 -0
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts +20 -8
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.d.ts.map +1 -1
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.styles.js +55 -27
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts +63 -14
- package/dist/react-ui/ui/DynamicToggle/DynamicToggle.types.d.ts.map +1 -1
- package/dist/react-ui/ui/DynamicToggle/index.d.ts +22 -20
- package/dist/react-ui/ui/DynamicToggle/index.d.ts.map +1 -1
- package/dist/react-ui/ui/DynamicToggle/index.js +115 -96
- package/dist/react-ui/ui/Switch/index.js +1 -1
- package/dist/react-ui/ui/index.js +2 -2
- package/package.json +2 -2
- package/src/css.d.ts +1 -0
- package/src/react-ui/primitives/waapi/Gooey/Gooey.types.ts +123 -0
- package/src/react-ui/primitives/waapi/Gooey/GooeyCanvas.tsx +80 -0
- package/src/react-ui/primitives/waapi/Gooey/GooeyFilter.tsx +77 -0
- package/src/react-ui/primitives/waapi/Gooey/MorphPath.tsx +58 -0
- package/src/react-ui/primitives/waapi/Gooey/gooey-utils.ts +244 -0
- package/src/react-ui/primitives/waapi/Gooey/index.ts +50 -0
- package/src/react-ui/primitives/waapi/Gooey/useMorphPath.ts +48 -0
- package/src/react-ui/primitives/waapi/index.ts +23 -0
- package/src/react-ui/ui/DataCard/DataCard.styles.ts +45 -101
- package/src/react-ui/ui/DataCard/DataCard.types.ts +52 -73
- package/src/react-ui/ui/DataCard/index.tsx +118 -184
- package/src/react-ui/ui/DynamicToggle/DynamicToggle.css +244 -91
- package/src/react-ui/ui/DynamicToggle/DynamicToggle.styles.ts +60 -40
- package/src/react-ui/ui/DynamicToggle/DynamicToggle.types.ts +95 -14
- package/src/react-ui/ui/DynamicToggle/index.tsx +150 -96
- package/src/react-ui/ui/DynamicToggle/prototype-v7.html +615 -0
- package/src/react-ui/ui/DynamicToggle/prototype.html +419 -0
- package/src/react-ui/ui/Switch/index.tsx +1 -1
- /package/dist/react-ui/blocks/Terminal/panel/{terminal-filter-dropdown.module-DAcl_XQZ.css → terminal-filter-dropdown.module-C6oDcFBS.css} +0 -0
- /package/dist/react-ui/blocks/Terminal/panel/{terminal-session-tabs.module-DNAop5e3.css → terminal-session-tabs.module-D_-sgyza.css} +0 -0
- /package/dist/react-ui/components/MorphingPopover/{morphing-popover.module-BJrjXisF.css → morphing-popover.module-B1ftlaYj.css} +0 -0
|
@@ -1,39 +1,67 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
|
|
1
3
|
//#region src/react-ui/ui/DynamicToggle/DynamicToggle.styles.ts
|
|
2
4
|
/**
|
|
5
|
+
* DynamicToggle style slots + CVA variants.
|
|
6
|
+
*
|
|
7
|
+
* Layout via Tailwind. State animations via CSS file (`:has()`, `clip-path`).
|
|
8
|
+
* Shape propagated to indicators via `--dt-radius` CSS variable.
|
|
9
|
+
*
|
|
10
|
+
* @module @mks2508/mks-ui/react/ui/DynamicToggle
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
3
13
|
* Default styles for each DynamicToggle slot.
|
|
4
14
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* <DynamicToggle slots={{ root: 'w-72', indicator: 'bg-primary' }}>
|
|
8
|
-
* ...
|
|
9
|
-
* </DynamicToggle>
|
|
10
|
-
* ```
|
|
15
|
+
* Width is set by size variants — required because indicator uses `width: 50%`
|
|
16
|
+
* and clip-path uses container query units. Override: `slots={{ root: 'w-80' }}`.
|
|
11
17
|
*/
|
|
12
18
|
const dynamicToggleStyles = {
|
|
13
|
-
root:
|
|
14
|
-
track:
|
|
15
|
-
option: [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
].join(" "),
|
|
20
|
-
indicator: [
|
|
21
|
-
"absolute w-1/2 left-0 top-0 bottom-0",
|
|
22
|
-
"bg-foreground rounded-full",
|
|
23
|
-
"pointer-events-none z-0"
|
|
24
|
-
].join(" "),
|
|
25
|
-
group: ["relative w-full h-full grid", "border border-transparent"].join(" "),
|
|
19
|
+
root: "relative border p-[2px] select-none",
|
|
20
|
+
track: "relative grid grid-cols-[repeat(4,1fr)] place-items-center w-full h-full",
|
|
21
|
+
option: "inline-grid place-items-center cursor-pointer font-medium z-[2] h-full w-full whitespace-nowrap",
|
|
22
|
+
indicator: "absolute w-1/2 left-0 top-0 bottom-0 bg-foreground rounded-[var(--dt-radius,9999px)] pointer-events-none z-0",
|
|
23
|
+
group: "col-span-2 relative w-full h-full grid grid-cols-2",
|
|
24
|
+
groupIndicator: "absolute left-1/2 top-0 bottom-0 w-1/2 bg-foreground rounded-[var(--dt-radius,9999px)] pointer-events-none z-0",
|
|
26
25
|
groupLabel: [
|
|
27
|
-
"absolute
|
|
28
|
-
"
|
|
26
|
+
"absolute",
|
|
27
|
+
"flex items-center justify-center",
|
|
28
|
+
"text-muted-foreground font-medium whitespace-nowrap",
|
|
29
29
|
"pointer-events-none"
|
|
30
|
-
].join(" "),
|
|
31
|
-
groupIndicator: [
|
|
32
|
-
"absolute left-1/2 top-0 bottom-0",
|
|
33
|
-
"bg-foreground rounded-full",
|
|
34
|
-
"pointer-events-none z-0"
|
|
35
30
|
].join(" ")
|
|
36
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* CVA variants for DynamicToggle root.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <DynamicToggle size="sm" variant="outline" shape="rounded">
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
const dynamicToggleVariants = cva(dynamicToggleStyles.root, {
|
|
41
|
+
variants: {
|
|
42
|
+
variant: {
|
|
43
|
+
default: "bg-card border-border shadow-sm",
|
|
44
|
+
ghost: "bg-transparent border-transparent",
|
|
45
|
+
muted: "bg-muted border-muted",
|
|
46
|
+
outline: "bg-transparent border-border"
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
sm: "h-[30px] w-[210px] text-[10px] [--dt-h:30px]",
|
|
50
|
+
default: "h-[38px] w-[260px] text-xs [--dt-h:38px]",
|
|
51
|
+
lg: "h-[44px] w-80 text-sm [--dt-h:44px]"
|
|
52
|
+
},
|
|
53
|
+
shape: {
|
|
54
|
+
pill: "rounded-full [--dt-radius:9999px]",
|
|
55
|
+
rounded: "rounded-xl [--dt-radius:0.75rem]",
|
|
56
|
+
square: "rounded-md [--dt-radius:0.375rem]"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
defaultVariants: {
|
|
60
|
+
variant: "default",
|
|
61
|
+
size: "default",
|
|
62
|
+
shape: "pill"
|
|
63
|
+
}
|
|
64
|
+
});
|
|
37
65
|
|
|
38
66
|
//#endregion
|
|
39
|
-
export { dynamicToggleStyles };
|
|
67
|
+
export { dynamicToggleStyles, dynamicToggleVariants };
|
|
@@ -1,13 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DynamicToggle type definitions.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Uses hidden
|
|
4
|
+
* CSS-animated toggle where one option expands into sub-options.
|
|
5
|
+
* Uses hidden radios + `:has(:checked)` for zero-JS animation.
|
|
6
|
+
* Optional gooey morph via `GooeyCanvas` or `MorphPath` primitives.
|
|
6
7
|
*
|
|
7
8
|
* @module @mks2508/mks-ui/react/ui/DynamicToggle
|
|
8
9
|
*/
|
|
9
|
-
import type { SlotOverrides } from '../../../core/types';
|
|
10
|
-
import type { DynamicToggleSlot } from './DynamicToggle.styles';
|
|
10
|
+
import type { SlotOverrides, IBaseConfig } from '../../../core/types';
|
|
11
|
+
import type { DynamicToggleSlot, DynamicToggleVariantProps } from './DynamicToggle.styles';
|
|
12
|
+
/** How the group appears when collapsed (standalone option active). */
|
|
13
|
+
export type DynamicToggleCollapsedMode = 'title' | 'opts' | 'title-opts';
|
|
14
|
+
/** Morph technique for the pill↔groupLabel junction. */
|
|
15
|
+
export type DynamicToggleMorphMode = 'none' | 'filter' | 'path';
|
|
16
|
+
/**
|
|
17
|
+
* Configuration for DynamicToggle animation behavior.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <DynamicToggle config={{ morphMode: 'filter', duration: 0.3 }}>
|
|
22
|
+
* ...
|
|
23
|
+
* </DynamicToggle>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export interface IDynamicToggleConfig extends IBaseConfig {
|
|
27
|
+
/** CSS transition duration in seconds (default: 0.22) */
|
|
28
|
+
duration?: number;
|
|
29
|
+
/** Label animation style (default: 'morph') */
|
|
30
|
+
labelAnimation?: 'morph' | 'float' | 'none';
|
|
31
|
+
/** Gooey morph mode for the pill↔groupLabel junction (default: 'none') */
|
|
32
|
+
morphMode?: DynamicToggleMorphMode;
|
|
33
|
+
}
|
|
11
34
|
/**
|
|
12
35
|
* Context shared between DynamicToggle root and its children.
|
|
13
36
|
*/
|
|
@@ -20,30 +43,46 @@ export type DynamicToggleContextType = {
|
|
|
20
43
|
groupName: string;
|
|
21
44
|
/** Whether a group child is active */
|
|
22
45
|
groupActive: boolean;
|
|
46
|
+
/** Whether the toggle is disabled */
|
|
47
|
+
disabled: boolean;
|
|
48
|
+
/** Register group info (called by DynamicToggleGroup on mount) */
|
|
49
|
+
registerGroup: (label: string, values: string[], position: 'top' | 'bottom' | 'hidden', collapsedMode: DynamicToggleCollapsedMode) => void;
|
|
23
50
|
};
|
|
24
51
|
/**
|
|
25
52
|
* Props for the DynamicToggle root container.
|
|
26
53
|
*
|
|
54
|
+
* Supports exactly one `DynamicToggleOption` + one `DynamicToggleGroup`.
|
|
55
|
+
* The group expands into sub-options when one of its children is active.
|
|
56
|
+
*
|
|
27
57
|
* @example
|
|
28
58
|
* ```tsx
|
|
29
|
-
* <DynamicToggle
|
|
59
|
+
* <DynamicToggle
|
|
60
|
+
* value="tree" onValueChange={setVal}
|
|
61
|
+
* size="sm" config={{ morphMode: 'filter' }}
|
|
62
|
+
* >
|
|
30
63
|
* <DynamicToggleOption value="tree">Tree</DynamicToggleOption>
|
|
31
|
-
* <DynamicToggleGroup label="Changes">
|
|
64
|
+
* <DynamicToggleGroup label="Changes" collapsedMode="title">
|
|
32
65
|
* <DynamicToggleOption value="flat">Flat</DynamicToggleOption>
|
|
33
66
|
* <DynamicToggleOption value="grouped">Grouped</DynamicToggleOption>
|
|
34
67
|
* </DynamicToggleGroup>
|
|
35
68
|
* </DynamicToggle>
|
|
36
69
|
* ```
|
|
37
70
|
*/
|
|
38
|
-
export interface IDynamicToggleProps {
|
|
71
|
+
export interface IDynamicToggleProps extends DynamicToggleVariantProps {
|
|
39
72
|
/** Controlled value */
|
|
40
73
|
value?: string;
|
|
41
74
|
/** Uncontrolled default value */
|
|
42
75
|
defaultValue?: string;
|
|
43
76
|
/** Change callback */
|
|
44
77
|
onValueChange?: (value: string) => void;
|
|
78
|
+
/** Disable the entire toggle */
|
|
79
|
+
disabled?: boolean;
|
|
45
80
|
/** Slot class overrides */
|
|
46
81
|
slots?: SlotOverrides<DynamicToggleSlot>;
|
|
82
|
+
/** Animation/behavior configuration */
|
|
83
|
+
config?: IDynamicToggleConfig;
|
|
84
|
+
/** Accessible label for the radio group */
|
|
85
|
+
'aria-label'?: string;
|
|
47
86
|
/** Additional class for the root */
|
|
48
87
|
className?: string;
|
|
49
88
|
/** DynamicToggleOption and DynamicToggleGroup children */
|
|
@@ -67,21 +106,31 @@ export interface IDynamicToggleOptionProps {
|
|
|
67
106
|
}
|
|
68
107
|
/**
|
|
69
108
|
* Props for an expandable group of options.
|
|
70
|
-
*
|
|
71
|
-
* When
|
|
109
|
+
*
|
|
110
|
+
* When none of the group's options are active, shows collapsed content
|
|
111
|
+
* based on `collapsedMode`:
|
|
112
|
+
* - `'title'` — only the group label
|
|
113
|
+
* - `'opts'` — only the combined sub-option text ("Solo · Team")
|
|
114
|
+
* - `'title-opts'` — WIP: currently falls back to 'title' behavior
|
|
115
|
+
*
|
|
116
|
+
* When one is active, expands with a clip-path reveal animation.
|
|
72
117
|
*
|
|
73
118
|
* @example
|
|
74
119
|
* ```tsx
|
|
75
|
-
* <DynamicToggleGroup label="
|
|
76
|
-
* <DynamicToggleOption value="
|
|
77
|
-
* <DynamicToggleOption value="
|
|
120
|
+
* <DynamicToggleGroup label="Premium" collapsedMode="title">
|
|
121
|
+
* <DynamicToggleOption value="solo">Solo</DynamicToggleOption>
|
|
122
|
+
* <DynamicToggleOption value="team">Team</DynamicToggleOption>
|
|
78
123
|
* </DynamicToggleGroup>
|
|
79
124
|
* ```
|
|
80
125
|
*/
|
|
81
126
|
export interface IDynamicToggleGroupProps {
|
|
82
|
-
/** Label shown
|
|
127
|
+
/** Label shown as group title / group label text */
|
|
83
128
|
label: string;
|
|
84
|
-
/**
|
|
129
|
+
/** Group label position relative to the pill (default: 'top') */
|
|
130
|
+
labelPosition?: 'top' | 'bottom' | 'hidden';
|
|
131
|
+
/** How the group appears when collapsed (default: 'title') */
|
|
132
|
+
collapsedMode?: DynamicToggleCollapsedMode;
|
|
133
|
+
/** Exactly 2 DynamicToggleOption children */
|
|
85
134
|
children: React.ReactNode;
|
|
86
135
|
/** Additional class */
|
|
87
136
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicToggle.types.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/DynamicToggle/DynamicToggle.types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"DynamicToggle.types.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/DynamicToggle/DynamicToggle.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAM3F,uEAAuE;AACvE,MAAM,MAAM,0BAA0B,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC;AAEzE,wDAAwD;AACxD,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAMhE;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAqB,SAAQ,WAAW;IACvD,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;IAC5C,0EAA0E;IAC1E,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC;AAMD;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,4BAA4B;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,qCAAqC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,kEAAkE;IAClE,aAAa,EAAE,CACb,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,EACrC,aAAa,EAAE,0BAA0B,KACtC,IAAI,CAAC;CACX,CAAC;AAMF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,mBAAoB,SAAQ,yBAAyB;IACpE,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACzC,uCAAuC;IACvC,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACxC,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,wBAAwB;IACvC,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,aAAa,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC5C,8DAA8D;IAC9D,aAAa,CAAC,EAAE,0BAA0B,CAAC;IAC3C,6CAA6C;IAC7C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './DynamicToggle.css';
|
|
2
|
+
import { dynamicToggleVariants } from './DynamicToggle.styles';
|
|
3
|
+
import type { DynamicToggleContextType, IDynamicToggleProps, IDynamicToggleOptionProps, IDynamicToggleGroupProps } from './DynamicToggle.types';
|
|
4
|
+
declare const useDynamicToggle: () => DynamicToggleContextType;
|
|
2
5
|
/**
|
|
3
|
-
* Root container — pill-shaped toggle
|
|
4
|
-
*
|
|
5
|
-
* @param props - Component props
|
|
6
|
-
* @returns React component
|
|
6
|
+
* Root container — pill-shaped toggle with expanding sub-options and group label.
|
|
7
7
|
*/
|
|
8
|
-
declare function DynamicToggle({ slots, className, children, ...props }: IDynamicToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DynamicToggle({ variant, size, shape, slots, config, disabled, className, children, 'aria-label': ariaLabel, ...props }: IDynamicToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare namespace DynamicToggle {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
9
12
|
/**
|
|
10
|
-
* A single toggle option —
|
|
11
|
-
* Can be used at the top level or inside a DynamicToggleGroup.
|
|
12
|
-
*
|
|
13
|
-
* @param props - Component props
|
|
14
|
-
* @returns React component
|
|
13
|
+
* A single toggle option — hidden radio + visible label.
|
|
15
14
|
*/
|
|
16
15
|
declare function DynamicToggleOption({ value, children, className }: IDynamicToggleOptionProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare namespace DynamicToggleOption {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
17
19
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* @param props - Component props
|
|
22
|
-
* @returns React component
|
|
20
|
+
* Expandable group — registers with root on mount, renders sub-options.
|
|
21
|
+
* The group label is rendered by the root based on registered info.
|
|
23
22
|
*/
|
|
24
|
-
declare function DynamicToggleGroup({ label, children, className }: IDynamicToggleGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
declare function DynamicToggleGroup({ label, labelPosition, collapsedMode, children, className, }: IDynamicToggleGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare namespace DynamicToggleGroup {
|
|
25
|
+
var displayName: string;
|
|
26
|
+
}
|
|
27
|
+
export { DynamicToggle, DynamicToggleOption, DynamicToggleGroup, useDynamicToggle, dynamicToggleVariants, };
|
|
28
|
+
export type { IDynamicToggleProps, IDynamicToggleOptionProps, IDynamicToggleGroupProps, IDynamicToggleConfig, DynamicToggleContextType, DynamicToggleCollapsedMode, DynamicToggleMorphMode, } from './DynamicToggle.types';
|
|
29
|
+
export type { DynamicToggleSlot, DynamicToggleVariantProps } from './DynamicToggle.styles';
|
|
28
30
|
export { dynamicToggleStyles } from './DynamicToggle.styles';
|
|
29
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/DynamicToggle/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/DynamicToggle/index.tsx"],"names":[],"mappings":"AA8BA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAuB,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,KAAK,EACV,wBAAwB,EAExB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAM/B,QAAA,MAA8B,gBAAgB,gCACsB,CAAC;AAuBrE;;GAEG;AACH,iBAAS,aAAa,CAAC,EACrB,OAAO,EACP,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAgB,EAChB,SAAS,EACT,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,GAAG,KAAK,EACT,EAAE,mBAAmB,2CAuFrB;kBAlGQ,aAAa;;;AAwGtB;;GAEG;AACH,iBAAS,mBAAmB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,yBAAyB,2CA2BrF;kBA3BQ,mBAAmB;;;AAiC5B;;;GAGG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,KAAK,EACL,aAAqB,EACrB,aAAuB,EACvB,QAAQ,EACR,SAAS,GACV,EAAE,wBAAwB,2CA0C1B;kBAhDQ,kBAAkB;;;AA2D3B,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,GACtB,CAAC;AAEF,YAAY,EACV,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,123 +1,119 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../lib/utils.js";
|
|
4
|
+
import { GooeyCanvas } from "../../primitives/waapi/Gooey/GooeyCanvas.js";
|
|
4
5
|
import { getStrictContext } from "../../lib/get-strict-context.js";
|
|
5
6
|
import { useControlledState } from "../../hooks/State/UseControlledState.js";
|
|
6
|
-
import
|
|
7
|
+
import "./DynamicToggle.js";
|
|
8
|
+
import { dynamicToggleStyles, dynamicToggleVariants } from "./DynamicToggle.styles.js";
|
|
7
9
|
import * as React$1 from "react";
|
|
8
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
11
|
|
|
10
12
|
//#region src/react-ui/ui/DynamicToggle/index.tsx
|
|
11
13
|
/**
|
|
12
|
-
* DynamicToggle — CSS-animated toggle
|
|
14
|
+
* DynamicToggle — CSS-animated toggle with expanding sub-options and group label.
|
|
13
15
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
16
|
+
* Pure CSS animation via `:has(:checked)` on hidden radio inputs.
|
|
17
|
+
* When the group is active, a group label grows out of the pill.
|
|
18
|
+
* Optional gooey morph via `config.morphMode` for organic junction.
|
|
19
|
+
*
|
|
20
|
+
* Supports exactly 1 `DynamicToggleOption` + 1 `DynamicToggleGroup` (with 2 sub-options).
|
|
17
21
|
*
|
|
18
22
|
* @module @mks2508/mks-ui/react/ui/DynamicToggle
|
|
19
23
|
*
|
|
20
24
|
* @example
|
|
21
25
|
* ```tsx
|
|
22
|
-
* <DynamicToggle value="tree" onValueChange={setVal}>
|
|
26
|
+
* <DynamicToggle value="tree" onValueChange={setVal} size="sm" shape="pill">
|
|
23
27
|
* <DynamicToggleOption value="tree">Tree</DynamicToggleOption>
|
|
24
|
-
* <DynamicToggleGroup label="Changes">
|
|
28
|
+
* <DynamicToggleGroup label="Changes" collapsedMode="title" labelPosition="top">
|
|
25
29
|
* <DynamicToggleOption value="flat">Flat</DynamicToggleOption>
|
|
26
30
|
* <DynamicToggleOption value="grouped">Grouped</DynamicToggleOption>
|
|
27
31
|
* </DynamicToggleGroup>
|
|
28
32
|
* </DynamicToggle>
|
|
29
33
|
* ```
|
|
30
34
|
*/
|
|
31
|
-
const DT_CSS_ID = "mks-dynamic-toggle-css";
|
|
32
|
-
/** Reads the CSS file content at build time via rolldown */
|
|
33
|
-
const DT_CSS = `
|
|
34
|
-
:root{--dt-duration:0.22s;--dt-ease:cubic-bezier(0.22,0.61,0.36,1);--dt-drop-off:0.45}
|
|
35
|
-
[data-slot="dt-track"]{grid-template-columns:repeat(4,1fr)}
|
|
36
|
-
[data-slot="dt-track"]>label:first-of-type,[data-slot="dt-group"]{grid-column:span 2}
|
|
37
|
-
[data-slot="dt-indicator"]{transition:translate var(--dt-duration) var(--dt-ease)}
|
|
38
|
-
[data-slot="dt-track"]:has(>input:checked) [data-slot="dt-indicator"]{translate:0 0}
|
|
39
|
-
[data-slot="dt-track"]:not(:has(>input:checked)) [data-slot="dt-indicator"]{translate:100% 0}
|
|
40
|
-
[data-slot="dt-track"]:has(>input:checked)>label{color:var(--card)}
|
|
41
|
-
[data-slot="dt-track"]:not(:has(>input:checked))>label{color:var(--foreground);opacity:var(--dt-drop-off)}
|
|
42
|
-
[data-slot="dt-group"]{container-type:size;grid-template-columns:1fr 1fr}
|
|
43
|
-
[data-slot="dt-group-label"]{translate:-50% -80%;transition:translate var(--dt-duration) var(--dt-ease),scale var(--dt-duration) var(--dt-ease)}
|
|
44
|
-
[data-slot="dt-group"]:has(input:checked) [data-slot="dt-group-label"]{translate:-50% -250%;scale:0.85}
|
|
45
|
-
[data-slot="dt-group-indicator"]{transition:translate var(--dt-duration) var(--dt-ease),clip-path var(--dt-duration) var(--dt-ease),background var(--dt-duration) var(--dt-ease);clip-path:inset(73cqh calc(50% + 1px) calc(27cqh - 2px) calc(50% - 3px) round 100px);translate:-50% 0;background:var(--foreground)}
|
|
46
|
-
[data-slot="dt-group"]:has(input:checked) [data-slot="dt-group-indicator"]{background:var(--card);clip-path:inset(0 0 0 0 round 100px)}
|
|
47
|
-
[data-slot="dt-group"]:has(input:nth-of-type(1):checked) [data-slot="dt-group-indicator"]{translate:-100% 0}
|
|
48
|
-
[data-slot="dt-group"]:has(input:nth-of-type(2):checked) [data-slot="dt-group-indicator"]{translate:0 0}
|
|
49
|
-
[data-slot="dt-group"] label{color:var(--muted-foreground);transition:color var(--dt-duration) var(--dt-ease),opacity var(--dt-duration) var(--dt-ease)}
|
|
50
|
-
[data-slot="dt-group"] label span{transition:scale var(--dt-duration) var(--dt-ease)}
|
|
51
|
-
[data-slot="dt-track"]:has(>input:checked) [data-slot="dt-group"] label{color:var(--muted-foreground)}
|
|
52
|
-
[data-slot="dt-group"]:has(input:checked) label{color:var(--muted-foreground);opacity:0.75}
|
|
53
|
-
[data-slot="dt-group"]:has(input:nth-of-type(1):checked) label:nth-of-type(1),[data-slot="dt-group"]:has(input:nth-of-type(2):checked) label:nth-of-type(2){color:var(--foreground);opacity:1}
|
|
54
|
-
[data-slot="dt-group"] label:nth-of-type(1) span{scale:0.75;transform-origin:150% 150%}
|
|
55
|
-
[data-slot="dt-group"] label:nth-of-type(2) span{scale:0.75;transform-origin:-65% 150%}
|
|
56
|
-
[data-slot="dt-group"]:has(input:checked) label span{scale:1}
|
|
57
|
-
[data-slot="dt-radio"]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}
|
|
58
|
-
`;
|
|
59
|
-
function useDynamicToggleCSS() {
|
|
60
|
-
React$1.useEffect(() => {
|
|
61
|
-
if (typeof document === "undefined") return;
|
|
62
|
-
if (document.getElementById(DT_CSS_ID)) return;
|
|
63
|
-
const style = document.createElement("style");
|
|
64
|
-
style.id = DT_CSS_ID;
|
|
65
|
-
style.textContent = DT_CSS;
|
|
66
|
-
document.head.appendChild(style);
|
|
67
|
-
}, []);
|
|
68
|
-
}
|
|
69
35
|
const [DynamicToggleProvider, useDynamicToggle] = getStrictContext("DynamicToggleContext");
|
|
36
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? React$1.useLayoutEffect : React$1.useEffect;
|
|
37
|
+
const SIZE_HEIGHT_PX = {
|
|
38
|
+
sm: 30,
|
|
39
|
+
default: 38,
|
|
40
|
+
lg: 44
|
|
41
|
+
};
|
|
70
42
|
/**
|
|
71
|
-
* Root container — pill-shaped toggle
|
|
72
|
-
*
|
|
73
|
-
* @param props - Component props
|
|
74
|
-
* @returns React component
|
|
43
|
+
* Root container — pill-shaped toggle with expanding sub-options and group label.
|
|
75
44
|
*/
|
|
76
|
-
function DynamicToggle({ slots, className, children, ...props }) {
|
|
77
|
-
useDynamicToggleCSS();
|
|
45
|
+
function DynamicToggle({ variant, size, shape, slots, config, disabled = false, className, children, "aria-label": ariaLabel, ...props }) {
|
|
78
46
|
const [value, setValue] = useControlledState({
|
|
79
47
|
value: props.value,
|
|
80
48
|
defaultValue: props.defaultValue ?? "",
|
|
81
49
|
onChange: props.onValueChange
|
|
82
50
|
});
|
|
83
51
|
const groupName = React$1.useId();
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
52
|
+
const [groupLabel, setGroupLabel] = React$1.useState("");
|
|
53
|
+
const [groupValues, setGroupValues] = React$1.useState([]);
|
|
54
|
+
const [groupPosition, setGroupPosition] = React$1.useState("top");
|
|
55
|
+
const [groupCollapsedMode, setGroupCollapsedMode] = React$1.useState("title");
|
|
56
|
+
const registerGroup = React$1.useCallback((label, values, position, collapsedMode) => {
|
|
57
|
+
setGroupLabel(label);
|
|
58
|
+
setGroupValues(values);
|
|
59
|
+
setGroupPosition(position);
|
|
60
|
+
setGroupCollapsedMode(collapsedMode);
|
|
61
|
+
}, []);
|
|
62
|
+
const groupActive = groupValues.includes(value);
|
|
63
|
+
const morphMode = config?.morphMode ?? "none";
|
|
64
|
+
const resolvedVariant = variant ?? "default";
|
|
65
|
+
const effectiveMorphMode = resolvedVariant === "ghost" || resolvedVariant === "outline" ? "none" : morphMode;
|
|
66
|
+
const showGroupLabel = (config?.labelAnimation ?? "morph") !== "none" && groupPosition !== "hidden" && groupLabel;
|
|
67
|
+
const heightPx = SIZE_HEIGHT_PX[size ?? "default"] ?? 32;
|
|
68
|
+
const style = config?.duration ? { "--dt-dur": `${config.duration}s` } : void 0;
|
|
69
|
+
const groupLabelElement = showGroupLabel ? /* @__PURE__ */ jsx("div", {
|
|
70
|
+
"data-slot": "dt-group-label",
|
|
71
|
+
"data-position": groupPosition,
|
|
72
|
+
className: cn(dynamicToggleStyles.groupLabel, slots?.groupLabel),
|
|
73
|
+
children: /* @__PURE__ */ jsx("span", { children: groupLabel || "\xA0" })
|
|
74
|
+
}) : null;
|
|
93
75
|
return /* @__PURE__ */ jsx(DynamicToggleProvider, {
|
|
94
76
|
value: {
|
|
95
77
|
value,
|
|
96
78
|
setValue,
|
|
97
79
|
groupName,
|
|
98
|
-
groupActive
|
|
80
|
+
groupActive,
|
|
81
|
+
disabled,
|
|
82
|
+
registerGroup
|
|
99
83
|
},
|
|
100
|
-
children: /* @__PURE__ */
|
|
84
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
101
85
|
"data-slot": "dt-root",
|
|
86
|
+
"data-morph": effectiveMorphMode !== "none" ? effectiveMorphMode : void 0,
|
|
102
87
|
"data-group-active": groupActive || void 0,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
})
|
|
88
|
+
"data-disabled": disabled || void 0,
|
|
89
|
+
role: "radiogroup",
|
|
90
|
+
"aria-label": ariaLabel,
|
|
91
|
+
style,
|
|
92
|
+
className: cn(dynamicToggleVariants({
|
|
93
|
+
variant,
|
|
94
|
+
size,
|
|
95
|
+
shape
|
|
96
|
+
}), slots?.root, className),
|
|
97
|
+
children: [
|
|
98
|
+
effectiveMorphMode === "filter" && /* @__PURE__ */ jsxs(GooeyCanvas, {
|
|
99
|
+
height: heightPx,
|
|
100
|
+
children: [/* @__PURE__ */ jsx("div", { className: "absolute inset-0 rounded-[inherit] bg-card" }), groupLabelElement]
|
|
101
|
+
}),
|
|
102
|
+
effectiveMorphMode === "path" && groupLabelElement,
|
|
103
|
+
/* @__PURE__ */ jsxs("div", {
|
|
104
|
+
"data-slot": "dt-track",
|
|
105
|
+
className: cn(dynamicToggleStyles.track, slots?.track),
|
|
106
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
107
|
+
"data-slot": "dt-indicator",
|
|
108
|
+
className: cn(dynamicToggleStyles.indicator, slots?.indicator)
|
|
109
|
+
}), children]
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
112
|
})
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
|
-
* A single toggle option —
|
|
117
|
-
* Can be used at the top level or inside a DynamicToggleGroup.
|
|
118
|
-
*
|
|
119
|
-
* @param props - Component props
|
|
120
|
-
* @returns React component
|
|
116
|
+
* A single toggle option — hidden radio + visible label.
|
|
121
117
|
*/
|
|
122
118
|
function DynamicToggleOption({ value, children, className }) {
|
|
123
119
|
const ctx = useDynamicToggle();
|
|
@@ -130,40 +126,63 @@ function DynamicToggleOption({ value, children, className }) {
|
|
|
130
126
|
className: cn(dynamicToggleStyles.option, className),
|
|
131
127
|
children: /* @__PURE__ */ jsx("span", { children })
|
|
132
128
|
}), /* @__PURE__ */ jsx("input", {
|
|
133
|
-
|
|
129
|
+
className: "sr-only",
|
|
134
130
|
type: "radio",
|
|
135
131
|
name: ctx.groupName,
|
|
136
132
|
id,
|
|
137
133
|
value,
|
|
138
134
|
checked: isActive,
|
|
135
|
+
disabled: ctx.disabled,
|
|
139
136
|
onChange: () => ctx.setValue(value)
|
|
140
137
|
})] });
|
|
141
138
|
}
|
|
142
139
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
* @param props - Component props
|
|
147
|
-
* @returns React component
|
|
140
|
+
* Expandable group — registers with root on mount, renders sub-options.
|
|
141
|
+
* The group label is rendered by the root based on registered info.
|
|
148
142
|
*/
|
|
149
|
-
function DynamicToggleGroup({ label, children, className }) {
|
|
143
|
+
function DynamicToggleGroup({ label, labelPosition = "top", collapsedMode = "title", children, className }) {
|
|
144
|
+
const ctx = useDynamicToggle();
|
|
145
|
+
const optsText = React$1.useMemo(() => {
|
|
146
|
+
const labels = [];
|
|
147
|
+
React$1.Children.forEach(children, (child) => {
|
|
148
|
+
if (React$1.isValidElement(child)) {
|
|
149
|
+
const p = child.props;
|
|
150
|
+
if (p.children) labels.push(String(p.children));
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
return labels.join(" · ");
|
|
154
|
+
}, [children]);
|
|
155
|
+
useIsomorphicLayoutEffect(() => {
|
|
156
|
+
const values = [];
|
|
157
|
+
React$1.Children.forEach(children, (child) => {
|
|
158
|
+
if (React$1.isValidElement(child)) {
|
|
159
|
+
const p = child.props;
|
|
160
|
+
if (p.value) values.push(p.value);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
ctx.registerGroup(label, values, labelPosition, collapsedMode);
|
|
164
|
+
}, [
|
|
165
|
+
label,
|
|
166
|
+
labelPosition,
|
|
167
|
+
collapsedMode,
|
|
168
|
+
children,
|
|
169
|
+
ctx.registerGroup
|
|
170
|
+
]);
|
|
150
171
|
return /* @__PURE__ */ jsxs("div", {
|
|
151
172
|
"data-slot": "dt-group",
|
|
173
|
+
"data-collapsed": collapsedMode,
|
|
174
|
+
"data-label": label,
|
|
175
|
+
"data-opts": collapsedMode !== "title" ? optsText : void 0,
|
|
152
176
|
className: cn(dynamicToggleStyles.group, className),
|
|
153
|
-
children: [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
children: label
|
|
158
|
-
}),
|
|
159
|
-
/* @__PURE__ */ jsx("div", {
|
|
160
|
-
"data-slot": "dt-group-indicator",
|
|
161
|
-
className: dynamicToggleStyles.groupIndicator
|
|
162
|
-
}),
|
|
163
|
-
children
|
|
164
|
-
]
|
|
177
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
178
|
+
"data-slot": "dt-group-indicator",
|
|
179
|
+
className: dynamicToggleStyles.groupIndicator
|
|
180
|
+
}), children]
|
|
165
181
|
});
|
|
166
182
|
}
|
|
183
|
+
DynamicToggle.displayName = "DynamicToggle";
|
|
184
|
+
DynamicToggleOption.displayName = "DynamicToggleOption";
|
|
185
|
+
DynamicToggleGroup.displayName = "DynamicToggleGroup";
|
|
167
186
|
|
|
168
187
|
//#endregion
|
|
169
|
-
export { DynamicToggle, DynamicToggleGroup, DynamicToggleOption };
|
|
188
|
+
export { DynamicToggle, DynamicToggleGroup, DynamicToggleOption, useDynamicToggle };
|
|
@@ -39,5 +39,5 @@ import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScro
|
|
|
39
39
|
import { dataCardStyles, dataCardVariants } from "./DataCard/DataCard.styles.js";
|
|
40
40
|
import { DataCard, DataCardActions, DataCardBracket, DataCardLabel, DataCardToggle, DataCardValue, useDataCard } from "./DataCard/index.js";
|
|
41
41
|
import { TextFlow } from "./TextFlow/index.js";
|
|
42
|
-
import { dynamicToggleStyles } from "./DynamicToggle/DynamicToggle.styles.js";
|
|
43
|
-
import { DynamicToggle, DynamicToggleGroup, DynamicToggleOption } from "./DynamicToggle/index.js";
|
|
42
|
+
import { dynamicToggleStyles, dynamicToggleVariants } from "./DynamicToggle/DynamicToggle.styles.js";
|
|
43
|
+
import { DynamicToggle, DynamicToggleGroup, DynamicToggleOption, useDynamicToggle } from "./DynamicToggle/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mks2508/mks-ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "UI component library - Shadcn/Animate UI based with DevEnv components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
],
|
|
50
50
|
"scripts": {
|
|
51
51
|
"dev": "vite",
|
|
52
|
-
"build": "rm -rf dist && bunx rolldown --config rolldown.config.ts && bunx tsc --emitDeclarationOnly && bunx tsc-alias && cp src/index.css dist/index.css",
|
|
52
|
+
"build": "rm -rf dist && bunx rolldown --config rolldown.config.ts && bunx tsc --emitDeclarationOnly && bunx tsc-alias && cp src/index.css dist/index.css && mkdir -p dist/react-ui/ui/DynamicToggle && cp src/react-ui/ui/DynamicToggle/DynamicToggle.css dist/react-ui/ui/DynamicToggle/DynamicToggle.css",
|
|
53
53
|
"typecheck": "bunx tsc --noEmit",
|
|
54
54
|
"lint": "bunx oxlint .",
|
|
55
55
|
"preview": "vite preview",
|
package/src/css.d.ts
CHANGED