@mks2508/mks-ui 0.6.2 → 0.6.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 +2 -2
- package/dist/react-ui/ui/AlertDialog/index.d.ts.map +1 -1
- package/dist/react-ui/ui/AlertDialog/index.js +27 -24
- package/dist/react-ui/ui/Dialog/index.d.ts +8 -24
- package/dist/react-ui/ui/Dialog/index.d.ts.map +1 -1
- package/dist/react-ui/ui/Dialog/index.js +34 -53
- package/dist/react-ui/ui/index.js +1 -1
- package/package.json +1 -1
package/dist/react-ui/index.js
CHANGED
|
@@ -37,7 +37,7 @@ import { AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogDescript
|
|
|
37
37
|
import { checkboxStyles } from "./ui/Checkbox/Checkbox.styles.js";
|
|
38
38
|
import { Checkbox, CheckboxIndicator, useCheckbox } from "./ui/Checkbox/index.js";
|
|
39
39
|
import { dialogStyles } from "./ui/Dialog/Dialog.styles.js";
|
|
40
|
-
import { Dialog, DialogBackdrop, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogPortal, DialogTitle, DialogTrigger,
|
|
40
|
+
import { Dialog, DialogBackdrop, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogPortal, DialogTitle, DialogTrigger, useDialog } from "./ui/Dialog/index.js";
|
|
41
41
|
import { useDataState } from "./hooks/State/UseDataState.js";
|
|
42
42
|
import { Menu, MenuArrow, MenuCheckboxItem, MenuCheckboxItemIndicator, MenuGroup, MenuGroupLabel, MenuHighlight, MenuHighlightItem, MenuItem, MenuPopup, MenuPortal, MenuPositioner, MenuRadioGroup, MenuRadioItem, MenuRadioItemIndicator, MenuSeparator, MenuShortcut, MenuSubmenu, MenuSubmenuTrigger, MenuTrigger, useMenu, useMenuActiveValue } from "./ui/Menu/index.js";
|
|
43
43
|
import { popoverStyles } from "./ui/Popover/Popover.styles.js";
|
|
@@ -115,4 +115,4 @@ import { HugeIcons } from "./icons/index.js";
|
|
|
115
115
|
import { IconWrapper } from "./lib/icon-wrapper.js";
|
|
116
116
|
import "./lib/index.js";
|
|
117
117
|
|
|
118
|
-
export { ANIMATION_CONFIGS, ANIMATION_DEFAULTS, Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionStyles, AccordionTrigger, ActivityIcon, AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPopup, AlertDialogPortal, AlertDialogStyles, 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, DataCard, DataCardActions, DataCardBracket, DataCardLabel, DataCardToggle, DataCardValue, DeleteIcon, Dialog, DialogBackdrop, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogPortal, DialogTitle, DialogTrigger,
|
|
118
|
+
export { ANIMATION_CONFIGS, ANIMATION_DEFAULTS, Accordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionStyles, AccordionTrigger, ActivityIcon, AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPopup, AlertDialogPortal, AlertDialogStyles, 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, DataCard, DataCardActions, DataCardBracket, DataCardLabel, DataCardToggle, DataCardValue, 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, DynamicToggle, DynamicToggleGroup, DynamicToggleOption, EASINGS, EFFECTS, Edit2, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, GOOEY_DEFAULTS, Globe, GooeyCanvas, GooeyFilter, Highlight, HighlightItem, HomeIcon, HugeIcons, IconWrapper, 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, Morph, MorphPath, MorphingPopover, MorphingPopoverWithTarget, PRESETS, Package, Palette, PlusIcon, Popover, PopoverArrow, PopoverBackdrop, PopoverClose, PopoverDescription, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverTitle, PopoverTrigger, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, RESPONSIVE_CONFIGS, RefreshCw, ReorderRoot as Reorder, Rocket, Save, SearchIcon, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingsIcon, SlidingNumber, SlidingText, Slot, Switch, SwitchIcon, SwitchThumb, TIMING, TRANSFORMS, Tabs, TabsHighlight, TabsHighlightItem, TabsList, TabsPanel, TabsPanels, TabsTab, TerminalIcon, TextFlow, Textarea, Tooltip, TooltipArrow, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipProvider, TooltipTrigger, Trash2, TrendingDownIcon, TrendingUpIcon, Type, Upload, XIcon, accordionVariants, badgeVariants, bracketVariants, buildColorMatrixValues, buildFilterString, buttonStateStyles, buttonVariants, calculateSeparatorCoordination, cardVariants, checkboxStyles, cn, computeBlur, dataCardStyles, dataCardVariants, dialogStyles, dynamicToggleStyles, dynamicToggleVariants, fieldVariants, getResponsiveDuration, getResponsiveStagger, getStrictContext, inputGroupAddonVariants, inputGroupButtonVariants, morphPathDown, morphPathUp, popoverStyles, progressStyles, shouldShowSeparator, switchStyles, tabsIndicatorVariants, tabsListVariants, tabsTabVariants, tooltipStyles, useAccordionItem, useAlertDialog, useAnimationOrchestrator, useAutoHeight, useCSSGridMorph, useCheckbox, useComboboxAnchor, useControlledState, useDataCard, useDataState, useDialog, useDynamicToggle, useElementRegistry, useFLIPAnimation, useFLIPClipPath, useHighlight, useIsInView, useListFormat, useMenu, useMenuActiveValue, useMorph, useMorphContext, useMorphPath, usePopover, usePositionCapture, useProgress, useReorder, useReorderPresence, useSwitch, useTooltip, useViewTransitions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/AlertDialog/index.tsx"],"names":[],"mappings":"AAiEA,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAC;AAM7B,QAAA,MAA4B,cAAc,8BACsB,CAAC;AAMjE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,iBAAS,WAAW,CAAC,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,OAAO,EACf,GAAG,KAAK,EACT,EAAE,iBAAiB,2CAgBnB;AAMD;;;;;;;;;;;;;GAaG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,KAAK,EAAE,MAAM,EACb,GAAG,KAAK,EACT,EAAE,wBAAwB,2CAO1B;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,iBAAiB,CAAC,KAAK,EAAE,uBAAuB,2CAcxD;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,iBAAS,mBAAmB,CAAC,EAC3B,UAAiD,EACjD,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,yBAAyB,2CAqB3B;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,iBAAS,gBAAgB,CAAC,EACxB,IAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAA4D,EAC5D,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/AlertDialog/index.tsx"],"names":[],"mappings":"AAiEA,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,qBAAqB,CAAC;AAM7B,QAAA,MAA4B,cAAc,8BACsB,CAAC;AAMjE;;;;;;;;;;;;;;;;;;;;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AS,EACT,GAAG,KAAK,EACT,EAAE,4BAA4B,2CAY9B;AAMD,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,GACf,CAAC;AAGF,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -177,30 +177,33 @@ function AlertDialogPopup({ from = "top", initialFocus, finalFocus, transition =
|
|
|
177
177
|
}, slots, className, ...props }) {
|
|
178
178
|
const initialRotation = from === "bottom" || from === "left" ? "20deg" : "-20deg";
|
|
179
179
|
const rotateAxis = from === "top" || from === "bottom" ? "rotateX" : "rotateY";
|
|
180
|
-
return /* @__PURE__ */ jsx(AlertDialog.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
180
|
+
return /* @__PURE__ */ jsx(AlertDialog.Viewport, {
|
|
181
|
+
"data-slot": "alert-dialog-viewport",
|
|
182
|
+
children: /* @__PURE__ */ jsx(AlertDialog.Popup, {
|
|
183
|
+
initialFocus,
|
|
184
|
+
finalFocus,
|
|
185
|
+
render: /* @__PURE__ */ jsx(motion.div, {
|
|
186
|
+
"data-slot": "alert-dialog-popup",
|
|
187
|
+
className: cn(AlertDialogStyles.popup, slots?.popup, className),
|
|
188
|
+
initial: {
|
|
189
|
+
opacity: 0,
|
|
190
|
+
filter: "blur(4px)",
|
|
191
|
+
transform: `perspective(500px) ${rotateAxis}(${initialRotation}) scale(0.8)`
|
|
192
|
+
},
|
|
193
|
+
animate: {
|
|
194
|
+
opacity: 1,
|
|
195
|
+
filter: "blur(0px)",
|
|
196
|
+
transform: `perspective(500px) ${rotateAxis}(0deg) scale(1)`
|
|
197
|
+
},
|
|
198
|
+
exit: {
|
|
199
|
+
opacity: 0,
|
|
200
|
+
filter: "blur(4px)",
|
|
201
|
+
transform: `perspective(500px) ${rotateAxis}(${initialRotation}) scale(0.8)`
|
|
202
|
+
},
|
|
203
|
+
transition,
|
|
204
|
+
...props
|
|
205
|
+
}, "alert-dialog-popup")
|
|
206
|
+
})
|
|
204
207
|
});
|
|
205
208
|
}
|
|
206
209
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DialogContextType, IDialogProps, IDialogTriggerProps, IDialogPortalProps,
|
|
1
|
+
import type { DialogContextType, IDialogProps, IDialogTriggerProps, IDialogPortalProps, IDialogBackdropProps, IDialogPopupProps, IDialogCloseProps, IDialogHeaderProps, IDialogFooterProps, IDialogTitleProps, IDialogDescriptionProps } from './Dialog.types';
|
|
2
2
|
declare const useDialog: () => DialogContextType;
|
|
3
3
|
/**
|
|
4
4
|
* Root Dialog component.
|
|
@@ -54,39 +54,23 @@ declare function DialogPortal({ slots: _slots, ...props }: IDialogPortalProps):
|
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
56
|
declare function DialogBackdrop({ slots, className, transition, ...props }: IDialogBackdropProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
-
/**
|
|
58
|
-
* Required viewport wrapper around DialogPopup.
|
|
59
|
-
* Base UI v1.x requires Dialog.Viewport as a direct child of Dialog.Portal
|
|
60
|
-
* and parent of Dialog.Popup.
|
|
61
|
-
*
|
|
62
|
-
* @param props - Viewport props forwarded to Base UI Dialog.Viewport
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* ```tsx
|
|
66
|
-
* <DialogPortal>
|
|
67
|
-
* <DialogBackdrop />
|
|
68
|
-
* <DialogViewport>
|
|
69
|
-
* <DialogPopup>...</DialogPopup>
|
|
70
|
-
* </DialogViewport>
|
|
71
|
-
* </DialogPortal>
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
declare function DialogViewport({ slots, className, ...props }: IDialogViewportProps): import("react/jsx-runtime").JSX.Element;
|
|
75
57
|
/**
|
|
76
58
|
* Main dialog content container with a perspective-flip entrance animation.
|
|
77
59
|
* The `from` prop controls the axis and direction of the 3D rotation.
|
|
78
|
-
*
|
|
60
|
+
*
|
|
61
|
+
* Internally wraps content in `Dialog.Viewport` as required by Base UI v1.x.
|
|
79
62
|
*
|
|
80
63
|
* @param props - Popup props including `from` direction and motion transition overrides
|
|
81
64
|
*
|
|
82
65
|
* @example
|
|
83
66
|
* ```tsx
|
|
84
|
-
* <
|
|
67
|
+
* <DialogPortal>
|
|
68
|
+
* <DialogBackdrop />
|
|
85
69
|
* <DialogPopup from="bottom" className="max-w-md">
|
|
86
70
|
* <DialogTitle>Confirm</DialogTitle>
|
|
87
71
|
* <p>Are you sure?</p>
|
|
88
72
|
* </DialogPopup>
|
|
89
|
-
* </
|
|
73
|
+
* </DialogPortal>
|
|
90
74
|
* ```
|
|
91
75
|
*/
|
|
92
76
|
declare function DialogPopup({ from, initialFocus, finalFocus, slots, className, transition, ...props }: IDialogPopupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -153,7 +137,7 @@ declare function DialogTitle({ slots, className, ...props }: IDialogTitleProps):
|
|
|
153
137
|
* ```
|
|
154
138
|
*/
|
|
155
139
|
declare function DialogDescription({ slots, className, ...props }: IDialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
156
|
-
export { Dialog, DialogPortal,
|
|
157
|
-
export type { IDialogProps, IDialogTriggerProps, IDialogPortalProps,
|
|
140
|
+
export { Dialog, DialogPortal, DialogBackdrop, DialogClose, DialogTrigger, DialogPopup, DialogHeader, DialogFooter, DialogTitle, DialogDescription, useDialog, };
|
|
141
|
+
export type { IDialogProps, IDialogTriggerProps, IDialogPortalProps, IDialogCloseProps, IDialogBackdropProps, IDialogPopupProps, IDialogHeaderProps, IDialogFooterProps, IDialogTitleProps, IDialogDescriptionProps, DialogContextType, DialogFlipDirection, DialogSlot, IDialogConfig, } from './Dialog.types';
|
|
158
142
|
export { dialogStyles } from './Dialog.styles';
|
|
159
143
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/Dialog/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react-ui/ui/Dialog/index.tsx"],"names":[],"mappings":"AA4DA,OAAO,KAAK,EACV,iBAAiB,EAEjB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,gBAAgB,CAAC;AAMxB,QAAA,MAAuB,SAAS,yBACsB,CAAC;AAMvD;;;;;;;;;;;;GAYG;AACH,iBAAS,MAAM,CAAC,KAAK,EAAE,YAAY,2CAkBlC;AAMD;;;;;;;;;;;GAWG;AACH,iBAAS,aAAa,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CAQzE;AAMD;;;;;;;;;;;;;GAaG;AACH,iBAAS,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CAcpE;AAMD;;;;;;;;;;G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d,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -121,44 +121,22 @@ function DialogBackdrop({ slots, className, transition = {
|
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
/**
|
|
124
|
-
* Required viewport wrapper around DialogPopup.
|
|
125
|
-
* Base UI v1.x requires Dialog.Viewport as a direct child of Dialog.Portal
|
|
126
|
-
* and parent of Dialog.Popup.
|
|
127
|
-
*
|
|
128
|
-
* @param props - Viewport props forwarded to Base UI Dialog.Viewport
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* ```tsx
|
|
132
|
-
* <DialogPortal>
|
|
133
|
-
* <DialogBackdrop />
|
|
134
|
-
* <DialogViewport>
|
|
135
|
-
* <DialogPopup>...</DialogPopup>
|
|
136
|
-
* </DialogViewport>
|
|
137
|
-
* </DialogPortal>
|
|
138
|
-
* ```
|
|
139
|
-
*/
|
|
140
|
-
function DialogViewport({ slots, className, ...props }) {
|
|
141
|
-
return /* @__PURE__ */ jsx(Dialog.Viewport, {
|
|
142
|
-
"data-slot": "dialog-viewport",
|
|
143
|
-
className: cn(dialogStyles.viewport, slots?.viewport, className),
|
|
144
|
-
...props
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
124
|
* Main dialog content container with a perspective-flip entrance animation.
|
|
149
125
|
* The `from` prop controls the axis and direction of the 3D rotation.
|
|
150
|
-
*
|
|
126
|
+
*
|
|
127
|
+
* Internally wraps content in `Dialog.Viewport` as required by Base UI v1.x.
|
|
151
128
|
*
|
|
152
129
|
* @param props - Popup props including `from` direction and motion transition overrides
|
|
153
130
|
*
|
|
154
131
|
* @example
|
|
155
132
|
* ```tsx
|
|
156
|
-
* <
|
|
133
|
+
* <DialogPortal>
|
|
134
|
+
* <DialogBackdrop />
|
|
157
135
|
* <DialogPopup from="bottom" className="max-w-md">
|
|
158
136
|
* <DialogTitle>Confirm</DialogTitle>
|
|
159
137
|
* <p>Are you sure?</p>
|
|
160
138
|
* </DialogPopup>
|
|
161
|
-
* </
|
|
139
|
+
* </DialogPortal>
|
|
162
140
|
* ```
|
|
163
141
|
*/
|
|
164
142
|
function DialogPopup({ from = "top", initialFocus, finalFocus, slots, className, transition = {
|
|
@@ -168,31 +146,34 @@ function DialogPopup({ from = "top", initialFocus, finalFocus, slots, className,
|
|
|
168
146
|
}, ...props }) {
|
|
169
147
|
const initialRotation = from === "bottom" || from === "left" ? "20deg" : "-20deg";
|
|
170
148
|
const rotateAxis = from === "top" || from === "bottom" ? "rotateX" : "rotateY";
|
|
171
|
-
return /* @__PURE__ */ jsx(Dialog.Viewport, {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
149
|
+
return /* @__PURE__ */ jsx(Dialog.Viewport, {
|
|
150
|
+
"data-slot": "dialog-viewport",
|
|
151
|
+
children: /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
152
|
+
initialFocus,
|
|
153
|
+
finalFocus,
|
|
154
|
+
render: /* @__PURE__ */ jsx(motion.div, {
|
|
155
|
+
"data-slot": "dialog-popup",
|
|
156
|
+
className: cn(dialogStyles.popup, slots?.popup, className),
|
|
157
|
+
initial: {
|
|
158
|
+
opacity: 0,
|
|
159
|
+
filter: "blur(4px)",
|
|
160
|
+
transform: `perspective(500px) ${rotateAxis}(${initialRotation}) scale(0.8)`
|
|
161
|
+
},
|
|
162
|
+
animate: {
|
|
163
|
+
opacity: 1,
|
|
164
|
+
filter: "blur(0px)",
|
|
165
|
+
transform: `perspective(500px) ${rotateAxis}(0deg) scale(1)`
|
|
166
|
+
},
|
|
167
|
+
exit: {
|
|
168
|
+
opacity: 0,
|
|
169
|
+
filter: "blur(4px)",
|
|
170
|
+
transform: `perspective(500px) ${rotateAxis}(${initialRotation}) scale(0.8)`
|
|
171
|
+
},
|
|
172
|
+
transition,
|
|
173
|
+
...props
|
|
174
|
+
}, "dialog-popup")
|
|
175
|
+
})
|
|
176
|
+
});
|
|
196
177
|
}
|
|
197
178
|
/**
|
|
198
179
|
* Button that closes the dialog when clicked.
|
|
@@ -289,4 +270,4 @@ function DialogDescription({ slots, className, ...props }) {
|
|
|
289
270
|
}
|
|
290
271
|
|
|
291
272
|
//#endregion
|
|
292
|
-
export { Dialog$1 as Dialog, DialogBackdrop, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogPortal, DialogTitle, DialogTrigger,
|
|
273
|
+
export { Dialog$1 as Dialog, DialogBackdrop, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogPortal, DialogTitle, DialogTrigger, useDialog };
|
|
@@ -5,7 +5,7 @@ import { AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogDescript
|
|
|
5
5
|
import { checkboxStyles } from "./Checkbox/Checkbox.styles.js";
|
|
6
6
|
import { Checkbox, CheckboxIndicator, useCheckbox } from "./Checkbox/index.js";
|
|
7
7
|
import { dialogStyles } from "./Dialog/Dialog.styles.js";
|
|
8
|
-
import { Dialog, DialogBackdrop, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogPortal, DialogTitle, DialogTrigger,
|
|
8
|
+
import { Dialog, DialogBackdrop, DialogClose, DialogDescription, DialogFooter, DialogHeader, DialogPopup, DialogPortal, DialogTitle, DialogTrigger, useDialog } from "./Dialog/index.js";
|
|
9
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 "./Menu/index.js";
|
|
10
10
|
import { popoverStyles } from "./Popover/Popover.styles.js";
|
|
11
11
|
import { Popover, PopoverArrow, PopoverBackdrop, PopoverClose, PopoverDescription, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverTitle, PopoverTrigger, usePopover } from "./Popover/index.js";
|