@mks2508/mks-ui 0.1.2 → 0.1.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/README.md +96 -60
- package/dist/components/animate-ui/primitives/animate/slot.js +1 -1
- package/dist/components/animate-ui/primitives/base/accordion.js +132 -0
- package/dist/components/animate-ui/primitives/base/alert-dialog.js +132 -0
- package/dist/components/animate-ui/primitives/base/checkbox.js +101 -0
- package/dist/components/animate-ui/primitives/base/dialog.js +132 -0
- package/dist/components/animate-ui/primitives/base/menu.js +266 -0
- package/dist/components/animate-ui/primitives/base/popover.js +109 -0
- package/dist/components/animate-ui/primitives/base/progress.d.ts +14 -14
- package/dist/components/animate-ui/primitives/base/progress.js +63 -0
- package/dist/components/animate-ui/primitives/base/switch.js +1 -1
- package/dist/components/animate-ui/primitives/base/tabs.js +1 -1
- package/dist/components/animate-ui/primitives/base/tooltip.js +116 -0
- package/dist/components/animate-ui/primitives/effects/auto-height.js +1 -1
- package/dist/components/animate-ui/primitives/effects/highlight.js +2 -2
- package/dist/components/animate-ui/primitives/texts/counting-number.js +78 -0
- package/dist/components/ui/accordion.d.ts +9 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +1 -0
- package/dist/components/ui/alert-dialog.d.ts +8 -20
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +1 -99
- package/dist/components/ui/auto-height.d.ts +9 -0
- package/dist/components/ui/auto-height.d.ts.map +1 -0
- package/dist/components/ui/auto-height.js +1 -0
- package/dist/components/ui/badge/badge.styles.d.ts +1 -1
- package/dist/components/ui/button/button.js +1 -1
- package/dist/components/ui/button/button.styles.d.ts +2 -2
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/checkbox.d.ts +9 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +1 -0
- package/dist/components/ui/corner-bracket.d.ts +34 -0
- package/dist/components/ui/corner-bracket.d.ts.map +1 -0
- package/dist/components/ui/{devenv-bracket.js → corner-bracket.js} +13 -9
- package/dist/components/ui/counting-number.d.ts +9 -0
- package/dist/components/ui/counting-number.d.ts.map +1 -0
- package/dist/components/ui/counting-number.js +1 -0
- package/dist/components/ui/dialog.d.ts +9 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +1 -0
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/highlight.d.ts +9 -0
- package/dist/components/ui/highlight.d.ts.map +1 -0
- package/dist/components/ui/highlight.js +1 -0
- package/dist/components/ui/index.d.ts +14 -3
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +32 -9
- package/dist/components/ui/input-group.js +1 -1
- package/dist/components/ui/menu.d.ts +9 -0
- package/dist/components/ui/menu.d.ts.map +1 -0
- package/dist/components/ui/menu.js +1 -0
- package/dist/components/ui/popover.d.ts +9 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +1 -0
- package/dist/components/ui/progress.d.ts +9 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +1 -0
- package/dist/components/ui/slot.d.ts +9 -0
- package/dist/components/ui/slot.d.ts.map +1 -0
- package/dist/components/ui/slot.js +1 -0
- package/dist/components/ui/tooltip.d.ts +9 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +1 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/use-data-state.js +42 -0
- package/dist/hooks/use-is-in-view.js +20 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -7
- package/package.json +4 -8
- package/src/components/ui/accordion.tsx +9 -0
- package/src/components/ui/alert-dialog.tsx +9 -177
- package/src/components/ui/auto-height.tsx +9 -0
- package/src/components/ui/checkbox.tsx +9 -0
- package/src/components/ui/{devenv-bracket.tsx → corner-bracket.tsx} +12 -8
- package/src/components/ui/counting-number.tsx +9 -0
- package/src/components/ui/dialog.tsx +9 -0
- package/src/components/ui/highlight.tsx +9 -0
- package/src/components/ui/index.ts +20 -5
- package/src/components/ui/menu.tsx +9 -0
- package/src/components/ui/popover.tsx +9 -0
- package/src/components/ui/progress.tsx +9 -0
- package/src/components/ui/slot.tsx +9 -0
- package/src/components/ui/tooltip.tsx +9 -0
- package/src/hooks/index.ts +10 -0
- package/src/index.ts +6 -3
- package/dist/components/ui/devenv-bracket.d.ts +0 -30
- package/dist/components/ui/devenv-bracket.d.ts.map +0 -1
- /package/dist/components/ui/morphing-popover/{morphing-popover.module-yxDDcJHZ.css → morphing-popover.module-CE9GIgKo.css} +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover component - Animate UI primitive re-export.
|
|
3
|
+
*
|
|
4
|
+
* Animated popover with arrow and motion transitions.
|
|
5
|
+
*
|
|
6
|
+
* @module @mks2508/mks-ui/components/ui/popover
|
|
7
|
+
*/
|
|
8
|
+
export * from '../../components/animate-ui/primitives/base/popover';
|
|
9
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/ui/popover.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,iDAAiD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Popover, PopoverArrow, PopoverBackdrop, PopoverClose, PopoverDescription, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverTitle, PopoverTrigger, usePopover } from "../animate-ui/primitives/base/popover.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Progress component - Animate UI primitive re-export.
|
|
3
|
+
*
|
|
4
|
+
* Animated progress bar with track and indicator.
|
|
5
|
+
*
|
|
6
|
+
* @module @mks2508/mks-ui/components/ui/progress
|
|
7
|
+
*/
|
|
8
|
+
export * from '../../components/animate-ui/primitives/base/progress';
|
|
9
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/components/ui/progress.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,kDAAkD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, useProgress } from "../animate-ui/primitives/base/progress.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slot component - Animate UI primitive re-export.
|
|
3
|
+
*
|
|
4
|
+
* Motion-enhanced Slot for asChild composition pattern with animations.
|
|
5
|
+
*
|
|
6
|
+
* @module @mks2508/mks-ui/components/ui/slot
|
|
7
|
+
*/
|
|
8
|
+
export * from '../../components/animate-ui/primitives/animate/slot';
|
|
9
|
+
//# sourceMappingURL=slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../../src/components/ui/slot.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,iDAAiD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Slot } from "../animate-ui/primitives/animate/slot.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltip component - Animate UI primitive re-export.
|
|
3
|
+
*
|
|
4
|
+
* Animated tooltip with provider, arrow, and motion transitions.
|
|
5
|
+
*
|
|
6
|
+
* @module @mks2508/mks-ui/components/ui/tooltip
|
|
7
|
+
*/
|
|
8
|
+
export * from '../../components/animate-ui/primitives/base/tooltip';
|
|
9
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/ui/tooltip.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,iDAAiD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { Tooltip, TooltipArrow, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipProvider, TooltipTrigger, useTooltip } from "../animate-ui/primitives/base/tooltip.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom React hooks barrel export.
|
|
3
|
+
*
|
|
4
|
+
* @module @mks2508/mks-ui/hooks
|
|
5
|
+
*/
|
|
6
|
+
export * from './use-auto-height';
|
|
7
|
+
export * from './use-controlled-state';
|
|
8
|
+
export * from './use-data-state';
|
|
9
|
+
export * from './use-is-in-view';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/hooks/use-data-state.tsx
|
|
6
|
+
function parseDatasetValue(value) {
|
|
7
|
+
if (value === null) return null;
|
|
8
|
+
if (value === "" || value === "true") return true;
|
|
9
|
+
if (value === "false") return false;
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
function useDataState(key, forwardedRef, onChange) {
|
|
13
|
+
const localRef = React.useRef(null);
|
|
14
|
+
React.useImperativeHandle(forwardedRef, () => localRef.current);
|
|
15
|
+
const getSnapshot = () => {
|
|
16
|
+
const el = localRef.current;
|
|
17
|
+
return el ? parseDatasetValue(el.getAttribute(`data-${key}`)) : null;
|
|
18
|
+
};
|
|
19
|
+
const subscribe = (callback) => {
|
|
20
|
+
const el = localRef.current;
|
|
21
|
+
if (!el) return () => {};
|
|
22
|
+
const observer = new MutationObserver((records) => {
|
|
23
|
+
for (const record of records) if (record.attributeName === `data-${key}`) {
|
|
24
|
+
callback();
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
observer.observe(el, {
|
|
29
|
+
attributes: true,
|
|
30
|
+
attributeFilter: [`data-${key}`]
|
|
31
|
+
});
|
|
32
|
+
return () => observer.disconnect();
|
|
33
|
+
};
|
|
34
|
+
const value = React.useSyncExternalStore(subscribe, getSnapshot);
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
if (onChange) onChange(value);
|
|
37
|
+
}, [value, onChange]);
|
|
38
|
+
return [value, localRef];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
export { useDataState };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useInView } from "motion/react";
|
|
3
|
+
|
|
4
|
+
//#region src/hooks/use-is-in-view.tsx
|
|
5
|
+
function useIsInView(ref, options = {}) {
|
|
6
|
+
const { inView, inViewOnce = false, inViewMargin = "0px" } = options;
|
|
7
|
+
const localRef = React.useRef(null);
|
|
8
|
+
React.useImperativeHandle(ref, () => localRef.current);
|
|
9
|
+
const inViewResult = useInView(localRef, {
|
|
10
|
+
once: inViewOnce,
|
|
11
|
+
margin: inViewMargin
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
ref: localRef,
|
|
15
|
+
isInView: !inView || inViewResult
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { useIsInView };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @mks2508/mks-ui
|
|
3
3
|
*
|
|
4
|
-
* UI component library - Shadcn/Animate UI based with
|
|
4
|
+
* UI component library - Shadcn/Animate UI based with custom components.
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```tsx
|
|
8
|
-
* import { Button, Card } from '@mks2508/mks-ui';
|
|
9
|
-
* import {
|
|
8
|
+
* import { Button, Card, CornerBracket } from '@mks2508/mks-ui';
|
|
9
|
+
* import { useAutoHeight } from '@mks2508/mks-ui';
|
|
10
10
|
* ```
|
|
11
11
|
*/
|
|
12
12
|
export * from './lib/utils';
|
|
13
13
|
export * from './components/ui';
|
|
14
14
|
export * from './icons';
|
|
15
|
+
export * from './hooks';
|
|
15
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,cAAc,aAAa,CAAC;AAG5B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,cAAc,aAAa,CAAC;AAG5B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { cn } from "./lib/utils.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { AlertDialog,
|
|
2
|
+
import { useControlledState } from "./hooks/use-controlled-state.js";
|
|
3
|
+
import { Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionTrigger, useAccordionItem } from "./components/animate-ui/primitives/base/accordion.js";
|
|
4
|
+
import { AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPopup, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, useAlertDialog } from "./components/animate-ui/primitives/base/alert-dialog.js";
|
|
5
|
+
import { Checkbox, CheckboxIndicator, useCheckbox } from "./components/animate-ui/primitives/base/checkbox.js";
|
|
6
|
+
import { Dialog, DialogBackdrop, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogPortal, DialogTitle, DialogTrigger, useDialog } from "./components/animate-ui/primitives/base/dialog.js";
|
|
7
|
+
import { Highlight, HighlightItem, useHighlight } from "./components/animate-ui/primitives/effects/highlight.js";
|
|
8
|
+
import { useDataState } from "./hooks/use-data-state.js";
|
|
9
|
+
import { Menu, MenuArrow, MenuCheckboxItem, MenuCheckboxItemIndicator, MenuGroup, MenuGroupLabel, MenuHighlight, MenuHighlightItem, MenuItem, MenuPopup, MenuPortal, MenuPositioner, MenuRadioGroup, MenuRadioItem, MenuRadioItemIndicator, MenuSeparator, MenuShortcut, MenuSubmenu, MenuSubmenuTrigger, MenuTrigger, useMenu, useMenuActiveValue } from "./components/animate-ui/primitives/base/menu.js";
|
|
10
|
+
import { Popover, PopoverArrow, PopoverBackdrop, PopoverClose, PopoverDescription, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverTitle, PopoverTrigger, usePopover } from "./components/animate-ui/primitives/base/popover.js";
|
|
11
|
+
import { useIsInView } from "./hooks/use-is-in-view.js";
|
|
12
|
+
import { CountingNumber } from "./components/animate-ui/primitives/texts/counting-number.js";
|
|
13
|
+
import { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, useProgress } from "./components/animate-ui/primitives/base/progress.js";
|
|
14
|
+
import { Switch, SwitchIcon, SwitchThumb, useSwitch } from "./components/animate-ui/primitives/base/switch.js";
|
|
15
|
+
import { useAutoHeight } from "./hooks/use-auto-height.js";
|
|
16
|
+
import { Slot } from "./components/animate-ui/primitives/animate/slot.js";
|
|
17
|
+
import { AutoHeight } from "./components/animate-ui/primitives/effects/auto-height.js";
|
|
18
|
+
import { Tabs, TabsHighlight, TabsHighlightItem, TabsList, TabsPanel, TabsPanels, TabsTab } from "./components/animate-ui/primitives/base/tabs.js";
|
|
19
|
+
import { Tooltip, TooltipArrow, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipProvider, TooltipTrigger, useTooltip } from "./components/animate-ui/primitives/base/tooltip.js";
|
|
5
20
|
import { badgeVariants } from "./components/ui/badge/badge.styles.js";
|
|
6
21
|
import { Badge } from "./components/ui/badge/badge.js";
|
|
22
|
+
import { buttonStateStyles, buttonVariants } from "./components/ui/button/button.styles.js";
|
|
23
|
+
import { Button } from "./components/ui/button/button.js";
|
|
7
24
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants } from "./components/ui/card.js";
|
|
8
25
|
import { Input } from "./components/ui/input.js";
|
|
9
26
|
import { Textarea } from "./components/ui/textarea.js";
|
|
@@ -14,9 +31,7 @@ import { Label } from "./components/ui/label.js";
|
|
|
14
31
|
import { Separator } from "./components/ui/separator.js";
|
|
15
32
|
import { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle } from "./components/ui/field.js";
|
|
16
33
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./components/ui/select.js";
|
|
17
|
-
import {
|
|
18
|
-
import { Tabs, TabsHighlight, TabsHighlightItem, TabsList, TabsPanel, TabsPanels, TabsTab } from "./components/animate-ui/primitives/base/tabs.js";
|
|
19
|
-
import { DevEnvBracket } from "./components/ui/devenv-bracket.js";
|
|
34
|
+
import { CornerBracket } from "./components/ui/corner-bracket.js";
|
|
20
35
|
import { MorphingPopover, MorphingPopoverWithTarget } from "./components/ui/morphing-popover/morphing-popover.js";
|
|
21
36
|
import "./components/ui/index.js";
|
|
22
37
|
import { ActivityIcon } from "./icons/lucide-animated/activity.js";
|
|
@@ -52,5 +67,6 @@ import { Type } from "./icons/lucide-animated/type.js";
|
|
|
52
67
|
import { Upload } from "./icons/lucide-animated/upload.js";
|
|
53
68
|
import { XIcon } from "./icons/lucide-animated/x.js";
|
|
54
69
|
import { HugeIcons } from "./icons/index.js";
|
|
70
|
+
import "./hooks/index.js";
|
|
55
71
|
|
|
56
|
-
export { ActivityIcon, AlertDialog,
|
|
72
|
+
export { Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionTrigger, ActivityIcon, AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPopup, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, ArrowDownToLineIcon, ArrowUpIcon, AutoHeight, Badge, BellElectricIcon, BellIcon, BotIcon, BoxIcon, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Check, Checkbox, CheckboxIndicator, CircleCheckIcon, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, CornerBracket, CountingNumber, DeleteIcon, Dialog, DialogBackdrop, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogPortal, DialogTitle, DialogTrigger, DownloadIcon, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Edit2, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Globe, Highlight, HighlightItem, HomeIcon, HugeIcons, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Label, Layers, LayoutPanelTopIcon, ListIcon, Menu, MenuArrow, MenuCheckboxItem, MenuCheckboxItemIndicator, MenuGroup, MenuGroupLabel, MenuHighlight, MenuHighlightItem, MenuItem, MenuPopup, MenuPortal, MenuPositioner, MenuRadioGroup, MenuRadioItem, MenuRadioItemIndicator, MenuSeparator, MenuShortcut, MenuSubmenu, MenuSubmenuTrigger, MenuTrigger, MorphingPopover, MorphingPopoverWithTarget, Package, Palette, PlusIcon, Popover, PopoverArrow, PopoverBackdrop, PopoverClose, PopoverDescription, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverTitle, PopoverTrigger, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RefreshCw, Rocket, Save, SearchIcon, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingsIcon, Slot, Switch, SwitchIcon, SwitchThumb, Tabs, TabsHighlight, TabsHighlightItem, TabsList, TabsPanel, TabsPanels, TabsTab, TerminalIcon, Textarea, Tooltip, TooltipArrow, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipProvider, TooltipTrigger, Trash2, TrendingDownIcon, TrendingUpIcon, Type, Upload, XIcon, badgeVariants, buttonStateStyles, buttonVariants, cardVariants, cn, useAccordionItem, useAlertDialog, useAutoHeight, useCheckbox, useComboboxAnchor, useControlledState, useDataState, useDialog, useHighlight, useIsInView, useMenu, useMenuActiveValue, usePopover, useProgress, useSwitch, useTooltip };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mks2508/mks-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "UI component library - Shadcn/Animate UI based with DevEnv components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -14,13 +14,9 @@
|
|
|
14
14
|
},
|
|
15
15
|
"./components/*": "./src/components/*.tsx",
|
|
16
16
|
"./components/ui/*": "./src/components/ui/*.tsx",
|
|
17
|
-
"./
|
|
18
|
-
"./
|
|
19
|
-
"./
|
|
20
|
-
"./components/animate-ui/primitives/effects/*": "./src/components/animate-ui/primitives/effects/*.tsx",
|
|
21
|
-
"./components/animate-ui/primitives/texts/*": "./src/components/animate-ui/primitives/texts/*.tsx",
|
|
22
|
-
"./icons/*": "./src/components/icons/*.tsx",
|
|
23
|
-
"./icons/lucide-animated/*": "./src/components/icons/lucide-animated/*.tsx",
|
|
17
|
+
"./icons/*": "./src/icons/*.tsx",
|
|
18
|
+
"./icons/lucide-animated/*": "./src/icons/lucide-animated/*.tsx",
|
|
19
|
+
"./hooks/*": "./src/hooks/*.tsx",
|
|
24
20
|
"./lib/*": "./src/lib/*.ts"
|
|
25
21
|
},
|
|
26
22
|
"files": [
|
|
@@ -1,177 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
|
|
14
|
-
return (
|
|
15
|
-
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
|
|
20
|
-
return (
|
|
21
|
-
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function AlertDialogOverlay({
|
|
26
|
-
className,
|
|
27
|
-
...props
|
|
28
|
-
}: AlertDialogPrimitive.Backdrop.Props) {
|
|
29
|
-
return (
|
|
30
|
-
<AlertDialogPrimitive.Backdrop
|
|
31
|
-
data-slot="alert-dialog-overlay"
|
|
32
|
-
className={cn(
|
|
33
|
-
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",
|
|
34
|
-
className
|
|
35
|
-
)}
|
|
36
|
-
{...props}
|
|
37
|
-
/>
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function AlertDialogContent({
|
|
42
|
-
className,
|
|
43
|
-
size = "default",
|
|
44
|
-
...props
|
|
45
|
-
}: AlertDialogPrimitive.Popup.Props & {
|
|
46
|
-
size?: "default" | "sm"
|
|
47
|
-
}) {
|
|
48
|
-
return (
|
|
49
|
-
<AlertDialogPortal>
|
|
50
|
-
<AlertDialogOverlay />
|
|
51
|
-
<AlertDialogPrimitive.Popup
|
|
52
|
-
data-slot="alert-dialog-content"
|
|
53
|
-
data-size={size}
|
|
54
|
-
className={cn(
|
|
55
|
-
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",
|
|
56
|
-
className
|
|
57
|
-
)}
|
|
58
|
-
{...props}
|
|
59
|
-
/>
|
|
60
|
-
</AlertDialogPortal>
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function AlertDialogHeader({
|
|
65
|
-
className,
|
|
66
|
-
...props
|
|
67
|
-
}: React.ComponentProps<"div">) {
|
|
68
|
-
return (
|
|
69
|
-
<div
|
|
70
|
-
data-slot="alert-dialog-header"
|
|
71
|
-
className={cn("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className)}
|
|
72
|
-
{...props}
|
|
73
|
-
/>
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function AlertDialogFooter({
|
|
78
|
-
className,
|
|
79
|
-
...props
|
|
80
|
-
}: React.ComponentProps<"div">) {
|
|
81
|
-
return (
|
|
82
|
-
<div
|
|
83
|
-
data-slot="alert-dialog-footer"
|
|
84
|
-
className={cn(
|
|
85
|
-
"bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
86
|
-
className
|
|
87
|
-
)}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function AlertDialogMedia({
|
|
94
|
-
className,
|
|
95
|
-
...props
|
|
96
|
-
}: React.ComponentProps<"div">) {
|
|
97
|
-
return (
|
|
98
|
-
<div
|
|
99
|
-
data-slot="alert-dialog-media"
|
|
100
|
-
className={cn("bg-muted mb-2 inline-flex size-10 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6", className)}
|
|
101
|
-
{...props}
|
|
102
|
-
/>
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function AlertDialogTitle({
|
|
107
|
-
className,
|
|
108
|
-
...props
|
|
109
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
110
|
-
return (
|
|
111
|
-
<AlertDialogPrimitive.Title
|
|
112
|
-
data-slot="alert-dialog-title"
|
|
113
|
-
className={cn("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className)}
|
|
114
|
-
{...props}
|
|
115
|
-
/>
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function AlertDialogDescription({
|
|
120
|
-
className,
|
|
121
|
-
...props
|
|
122
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
123
|
-
return (
|
|
124
|
-
<AlertDialogPrimitive.Description
|
|
125
|
-
data-slot="alert-dialog-description"
|
|
126
|
-
className={cn("text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3", className)}
|
|
127
|
-
{...props}
|
|
128
|
-
/>
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function AlertDialogAction({
|
|
133
|
-
className,
|
|
134
|
-
...props
|
|
135
|
-
}: React.ComponentProps<typeof Button>) {
|
|
136
|
-
return (
|
|
137
|
-
<Button
|
|
138
|
-
data-slot="alert-dialog-action"
|
|
139
|
-
className={cn(className)}
|
|
140
|
-
{...props}
|
|
141
|
-
/>
|
|
142
|
-
)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function AlertDialogCancel({
|
|
146
|
-
className,
|
|
147
|
-
variant = "outline",
|
|
148
|
-
children,
|
|
149
|
-
...props
|
|
150
|
-
}: React.ComponentProps<typeof AlertDialogPrimitive.Close> & {
|
|
151
|
-
variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | "success" | "warning"
|
|
152
|
-
}) {
|
|
153
|
-
return (
|
|
154
|
-
<AlertDialogPrimitive.Close
|
|
155
|
-
data-slot="alert-dialog-cancel"
|
|
156
|
-
className={cn(className)}
|
|
157
|
-
{...props}
|
|
158
|
-
>
|
|
159
|
-
<Button variant={variant}>{children || "Cancel"}</Button>
|
|
160
|
-
</AlertDialogPrimitive.Close>
|
|
161
|
-
)
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export {
|
|
165
|
-
AlertDialog,
|
|
166
|
-
AlertDialogAction,
|
|
167
|
-
AlertDialogCancel,
|
|
168
|
-
AlertDialogContent,
|
|
169
|
-
AlertDialogDescription,
|
|
170
|
-
AlertDialogFooter,
|
|
171
|
-
AlertDialogHeader,
|
|
172
|
-
AlertDialogMedia,
|
|
173
|
-
AlertDialogOverlay,
|
|
174
|
-
AlertDialogPortal,
|
|
175
|
-
AlertDialogTitle,
|
|
176
|
-
AlertDialogTrigger,
|
|
177
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* AlertDialog component - Animate UI primitive re-export.
|
|
3
|
+
*
|
|
4
|
+
* Animated alert dialog with backdrop and motion transitions.
|
|
5
|
+
*
|
|
6
|
+
* @module @mks2508/mks-ui/components/ui/alert-dialog
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from '@/components/animate-ui/primitives/base/alert-dialog';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Corner Bracket Component
|
|
3
3
|
*
|
|
4
|
-
* Corner bracket decoration for
|
|
4
|
+
* Corner bracket decoration for industrial/technical styling.
|
|
5
5
|
*
|
|
6
6
|
* @module @mks2508/mks-ui/components/ui
|
|
7
7
|
*/
|
|
@@ -30,7 +30,7 @@ const bracketVariants = cva(
|
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
|
|
33
|
-
export interface
|
|
33
|
+
export interface ICornerBracketProps
|
|
34
34
|
extends Omit<React.SVGProps<SVGSVGElement>, 'variant'>,
|
|
35
35
|
VariantProps<typeof bracketVariants> {
|
|
36
36
|
size?: number;
|
|
@@ -44,24 +44,28 @@ const PATHS = {
|
|
|
44
44
|
} as const;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
47
|
+
* Corner bracket decoration for industrial/technical UI styling.
|
|
48
|
+
*
|
|
49
|
+
* @param position - Corner position: 'tl' (top-left), 'tr' (top-right), 'bl' (bottom-left), 'br' (bottom-right)
|
|
50
|
+
* @param variant - Visual style: 'default' or 'accent'
|
|
51
|
+
* @param size - Bracket size in pixels (default: 20)
|
|
48
52
|
*
|
|
49
53
|
* @example
|
|
50
54
|
* ```tsx
|
|
51
55
|
* <div className="relative p-4">
|
|
52
|
-
* <
|
|
53
|
-
* <
|
|
56
|
+
* <CornerBracket position="tl" />
|
|
57
|
+
* <CornerBracket position="br" />
|
|
54
58
|
* Content here
|
|
55
59
|
* </div>
|
|
56
60
|
* ```
|
|
57
61
|
*/
|
|
58
|
-
export function
|
|
62
|
+
export function CornerBracket({
|
|
59
63
|
className,
|
|
60
64
|
position,
|
|
61
65
|
variant,
|
|
62
66
|
size = 20,
|
|
63
67
|
...props
|
|
64
|
-
}:
|
|
68
|
+
}: ICornerBracketProps) {
|
|
65
69
|
return (
|
|
66
70
|
<svg
|
|
67
71
|
width={size}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CountingNumber component - Animate UI primitive re-export.
|
|
3
|
+
*
|
|
4
|
+
* Animated number display with counting/interpolation effect.
|
|
5
|
+
*
|
|
6
|
+
* @module @mks2508/mks-ui/components/ui/counting-number
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from '@/components/animate-ui/primitives/texts/counting-number';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Highlight effect - Animate UI primitive re-export.
|
|
3
|
+
*
|
|
4
|
+
* Animated highlight effect used by tabs, menus, and other interactive components.
|
|
5
|
+
*
|
|
6
|
+
* @module @mks2508/mks-ui/components/ui/highlight
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from '@/components/animate-ui/primitives/effects/highlight';
|
|
@@ -6,8 +6,25 @@
|
|
|
6
6
|
* @module @mks2508/mks-ui/components/ui
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
//
|
|
9
|
+
// Animate UI base components
|
|
10
|
+
export * from './accordion';
|
|
10
11
|
export * from './alert-dialog';
|
|
12
|
+
export * from './checkbox';
|
|
13
|
+
export * from './dialog';
|
|
14
|
+
export * from './menu';
|
|
15
|
+
export * from './popover';
|
|
16
|
+
export * from './progress';
|
|
17
|
+
export * from './switch';
|
|
18
|
+
export * from './tabs';
|
|
19
|
+
export * from './tooltip';
|
|
20
|
+
|
|
21
|
+
// Animate UI utilities
|
|
22
|
+
export * from './auto-height';
|
|
23
|
+
export * from './counting-number';
|
|
24
|
+
export * from './highlight';
|
|
25
|
+
export * from './slot';
|
|
26
|
+
|
|
27
|
+
// Shadcn base components
|
|
11
28
|
export * from './badge';
|
|
12
29
|
export * from './button';
|
|
13
30
|
export * from './card';
|
|
@@ -19,10 +36,8 @@ export * from './input';
|
|
|
19
36
|
export * from './label';
|
|
20
37
|
export * from './select';
|
|
21
38
|
export * from './separator';
|
|
22
|
-
export * from './switch';
|
|
23
|
-
export * from './tabs';
|
|
24
39
|
export * from './textarea';
|
|
25
40
|
|
|
26
|
-
//
|
|
27
|
-
export * from './
|
|
41
|
+
// Custom components
|
|
42
|
+
export * from './corner-bracket';
|
|
28
43
|
export * from './morphing-popover';
|