moduix 0.11.1 → 0.11.2
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/LICENSE.md +21 -0
- package/README.md +6 -3
- package/package.json +6 -6
- package/dist/_virtual/_rolldown/runtime.cjs +0 -23
- package/dist/components/Accordion/Accordion.cjs +0 -65
- package/dist/components/Accordion/Accordion.module.cjs +0 -12
- package/dist/components/Alert/Alert.cjs +0 -50
- package/dist/components/Alert/Alert.module.cjs +0 -11
- package/dist/components/AlertDialog/AlertDialog.cjs +0 -122
- package/dist/components/AlertDialog/AlertDialog.module.cjs +0 -18
- package/dist/components/AspectRatio/AspectRatio.cjs +0 -24
- package/dist/components/AspectRatio/AspectRatio.module.cjs +0 -5
- package/dist/components/Autocomplete/Autocomplete.cjs +0 -303
- package/dist/components/Autocomplete/Autocomplete.module.cjs +0 -37
- package/dist/components/Avatar/Avatar.cjs +0 -31
- package/dist/components/Avatar/Avatar.module.cjs +0 -9
- package/dist/components/Badge/Badge.cjs +0 -25
- package/dist/components/Badge/Badge.module.cjs +0 -8
- package/dist/components/Bleed/Bleed.cjs +0 -17
- package/dist/components/Bleed/Bleed.module.cjs +0 -5
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +0 -72
- package/dist/components/Breadcrumbs/Breadcrumbs.module.cjs +0 -13
- package/dist/components/Button/Button.cjs +0 -18
- package/dist/components/Button/Button.module.cjs +0 -5
- package/dist/components/Card/Card.cjs +0 -81
- package/dist/components/Card/Card.module.cjs +0 -14
- package/dist/components/Checkbox/Checkbox.cjs +0 -63
- package/dist/components/Checkbox/Checkbox.module.cjs +0 -13
- package/dist/components/CheckboxGroup/CheckboxGroup.cjs +0 -55
- package/dist/components/CheckboxGroup/CheckboxGroup.module.cjs +0 -11
- package/dist/components/CloseButton/CloseButton.cjs +0 -22
- package/dist/components/CloseButton/CloseButton.module.cjs +0 -5
- package/dist/components/Collapsible/Collapsible.cjs +0 -47
- package/dist/components/Collapsible/Collapsible.module.cjs +0 -10
- package/dist/components/Combobox/Combobox.cjs +0 -330
- package/dist/components/Combobox/Combobox.module.cjs +0 -42
- package/dist/components/CommandPalette/CommandPalette.cjs +0 -304
- package/dist/components/CommandPalette/CommandPalette.module.cjs +0 -30
- package/dist/components/Container/Container.cjs +0 -17
- package/dist/components/Container/Container.module.cjs +0 -5
- package/dist/components/ContextMenu/ContextMenu.cjs +0 -241
- package/dist/components/ContextMenu/ContextMenu.module.cjs +0 -33
- package/dist/components/CopyButton/CopyButton.cjs +0 -66
- package/dist/components/CopyButton/CopyButton.module.cjs +0 -5
- package/dist/components/Dialog/Dialog.cjs +0 -136
- package/dist/components/Dialog/Dialog.module.cjs +0 -18
- package/dist/components/Drawer/Drawer.cjs +0 -202
- package/dist/components/Drawer/Drawer.module.cjs +0 -24
- package/dist/components/Empty/Empty.cjs +0 -55
- package/dist/components/Empty/Empty.module.cjs +0 -12
- package/dist/components/Field/Field.cjs +0 -56
- package/dist/components/Field/Field.module.cjs +0 -12
- package/dist/components/Fieldset/Fieldset.cjs +0 -22
- package/dist/components/Fieldset/Fieldset.module.cjs +0 -8
- package/dist/components/Form/Form.cjs +0 -16
- package/dist/components/Form/Form.module.cjs +0 -5
- package/dist/components/Heading/Heading.cjs +0 -25
- package/dist/components/Heading/Heading.module.cjs +0 -5
- package/dist/components/Input/Input.cjs +0 -18
- package/dist/components/Input/Input.module.cjs +0 -5
- package/dist/components/InputGroup/InputGroup.cjs +0 -77
- package/dist/components/InputGroup/InputGroup.module.cjs +0 -11
- package/dist/components/Kbd/Kbd.cjs +0 -23
- package/dist/components/Kbd/Kbd.module.cjs +0 -8
- package/dist/components/Lightbox/Lightbox.cjs +0 -220
- package/dist/components/Lightbox/Lightbox.module.cjs +0 -14
- package/dist/components/List/List.cjs +0 -31
- package/dist/components/List/List.module.cjs +0 -5
- package/dist/components/Menu/Menu.cjs +0 -260
- package/dist/components/Menu/Menu.module.cjs +0 -36
- package/dist/components/Menubar/Menubar.cjs +0 -261
- package/dist/components/Menubar/Menubar.module.cjs +0 -36
- package/dist/components/Meter/Meter.cjs +0 -60
- package/dist/components/Meter/Meter.module.cjs +0 -11
- package/dist/components/NavigationMenu/NavigationMenu.cjs +0 -146
- package/dist/components/NavigationMenu/NavigationMenu.module.cjs +0 -21
- package/dist/components/NumberField/NumberField.cjs +0 -82
- package/dist/components/NumberField/NumberField.module.cjs +0 -13
- package/dist/components/OTPField/OTPField.cjs +0 -41
- package/dist/components/OTPField/OTPField.module.cjs +0 -9
- package/dist/components/Pagination/Pagination.cjs +0 -123
- package/dist/components/Pagination/Pagination.module.cjs +0 -16
- package/dist/components/PasswordInput/PasswordInput.cjs +0 -47
- package/dist/components/PasswordInput/PasswordInput.module.cjs +0 -9
- package/dist/components/Popover/Popover.cjs +0 -146
- package/dist/components/Popover/Popover.module.cjs +0 -22
- package/dist/components/PreviewCard/PreviewCard.cjs +0 -96
- package/dist/components/PreviewCard/PreviewCard.module.cjs +0 -16
- package/dist/components/Progress/Progress.cjs +0 -60
- package/dist/components/Progress/Progress.module.cjs +0 -12
- package/dist/components/Radio/Radio.cjs +0 -78
- package/dist/components/Radio/Radio.module.cjs +0 -14
- package/dist/components/Rating/Rating.cjs +0 -61
- package/dist/components/Rating/Rating.module.cjs +0 -9
- package/dist/components/ScrollArea/ScrollArea.cjs +0 -82
- package/dist/components/ScrollArea/ScrollArea.module.cjs +0 -12
- package/dist/components/Select/Select.cjs +0 -219
- package/dist/components/Select/Select.module.cjs +0 -33
- package/dist/components/Separator/Separator.cjs +0 -16
- package/dist/components/Separator/Separator.module.cjs +0 -5
- package/dist/components/Skeleton/Skeleton.cjs +0 -25
- package/dist/components/Skeleton/Skeleton.module.cjs +0 -5
- package/dist/components/Slider/Slider.cjs +0 -106
- package/dist/components/Slider/Slider.module.cjs +0 -13
- package/dist/components/SnapCarousel/SnapCarousel.cjs +0 -130
- package/dist/components/SnapCarousel/SnapCarousel.module.cjs +0 -13
- package/dist/components/Spinner/Spinner.cjs +0 -30
- package/dist/components/Spinner/Spinner.module.cjs +0 -9
- package/dist/components/SplitButton/SplitButton.cjs +0 -69
- package/dist/components/SplitButton/SplitButton.module.cjs +0 -9
- package/dist/components/Stack/Stack.cjs +0 -27
- package/dist/components/Stack/Stack.module.cjs +0 -5
- package/dist/components/Stepper/Stepper.cjs +0 -138
- package/dist/components/Stepper/Stepper.module.cjs +0 -14
- package/dist/components/Switch/Switch.cjs +0 -43
- package/dist/components/Switch/Switch.module.cjs +0 -10
- package/dist/components/Table/Table.cjs +0 -96
- package/dist/components/Table/Table.module.cjs +0 -18
- package/dist/components/Tabs/Tabs.cjs +0 -70
- package/dist/components/Tabs/Tabs.module.cjs +0 -11
- package/dist/components/Text/Text.cjs +0 -42
- package/dist/components/Text/Text.module.cjs +0 -5
- package/dist/components/Textarea/Textarea.cjs +0 -28
- package/dist/components/Textarea/Textarea.module.cjs +0 -5
- package/dist/components/Toast/Toast.cjs +0 -278
- package/dist/components/Toast/Toast.module.cjs +0 -26
- package/dist/components/Toggle/Toggle.cjs +0 -18
- package/dist/components/Toggle/Toggle.module.cjs +0 -5
- package/dist/components/ToggleGroup/ToggleGroup.cjs +0 -42
- package/dist/components/ToggleGroup/ToggleGroup.module.cjs +0 -8
- package/dist/components/Toolbar/Toolbar.cjs +0 -61
- package/dist/components/Toolbar/Toolbar.module.cjs +0 -12
- package/dist/components/Tooltip/Tooltip.cjs +0 -91
- package/dist/components/Tooltip/Tooltip.module.cjs +0 -15
- package/dist/icons/demo/Icons.cjs +0 -234
- package/dist/icons/ui/Icons.cjs +0 -324
- package/dist/index.cjs +0 -619
- package/dist/index.d.cts +0 -1
- package/dist/reset.cjs +0 -1
- package/dist/reset.d.cts +0 -1
- package/dist/style.cjs +0 -1
- package/dist/style.d.cts +0 -1
- package/dist/utils/mergeClassName.cjs +0 -8
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_Heading_module = require("./Heading.module.cjs");
|
|
3
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
-
let clsx = require("clsx");
|
|
5
|
-
clsx = require_runtime.__toESM(clsx);
|
|
6
|
-
//#region src/components/Heading/Heading.tsx
|
|
7
|
-
const defaultSizeByElement = {
|
|
8
|
-
h1: "2xl",
|
|
9
|
-
h2: "xl",
|
|
10
|
-
h3: "lg",
|
|
11
|
-
h4: "md",
|
|
12
|
-
h5: "sm",
|
|
13
|
-
h6: "xs"
|
|
14
|
-
};
|
|
15
|
-
function Heading({ as = "h1", size, weight = "semibold", className, ...props }) {
|
|
16
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(as, {
|
|
17
|
-
"data-slot": "heading-root",
|
|
18
|
-
"data-size": size ?? defaultSizeByElement[as],
|
|
19
|
-
"data-weight": weight,
|
|
20
|
-
className: (0, clsx.default)(require_Heading_module.default.root, className),
|
|
21
|
-
...props
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
exports.Heading = Heading;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const require_mergeClassName = require("../../utils/mergeClassName.cjs");
|
|
2
|
-
const require_Input_module = require("./Input.module.cjs");
|
|
3
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
-
let react = require("react");
|
|
5
|
-
let _base_ui_react_input = require("@base-ui/react/input");
|
|
6
|
-
//#region src/components/Input/Input.tsx
|
|
7
|
-
const Input = (0, react.forwardRef)(function Input({ className, size = "md", htmlSize, ...props }, ref) {
|
|
8
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_input.Input, {
|
|
9
|
-
ref,
|
|
10
|
-
"data-slot": "input-root",
|
|
11
|
-
"data-size": size,
|
|
12
|
-
className: require_mergeClassName.mergeClassName(className, require_Input_module.default.root),
|
|
13
|
-
size: htmlSize,
|
|
14
|
-
...props
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
//#endregion
|
|
18
|
-
exports.Input = Input;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
const require_mergeClassName = require("../../utils/mergeClassName.cjs");
|
|
2
|
-
const require_Button = require("../Button/Button.cjs");
|
|
3
|
-
const require_Input = require("../Input/Input.cjs");
|
|
4
|
-
const require_InputGroup_module = require("./InputGroup.module.cjs");
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
let clsx = require("clsx");
|
|
7
|
-
let react = require("react");
|
|
8
|
-
//#region src/components/InputGroup/InputGroup.tsx
|
|
9
|
-
const InputGroupSizeContext = (0, react.createContext)("md");
|
|
10
|
-
const InputGroup = (0, react.forwardRef)(function InputGroup({ children, className, onMouseDown, size = "md", ...props }, ref) {
|
|
11
|
-
const handleMouseDown = (event) => {
|
|
12
|
-
onMouseDown?.(event);
|
|
13
|
-
if (event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
|
|
14
|
-
const target = event.target;
|
|
15
|
-
if (!(target instanceof HTMLElement)) return;
|
|
16
|
-
if (target.closest("button, a, input, select, textarea, [role=\"button\"], [role=\"link\"]")) return;
|
|
17
|
-
const input = event.currentTarget.querySelector("[data-slot=\"input-group-input\"]");
|
|
18
|
-
if (!(input instanceof HTMLInputElement) || input.disabled || input.readOnly) return;
|
|
19
|
-
input.focus();
|
|
20
|
-
};
|
|
21
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InputGroupSizeContext.Provider, {
|
|
22
|
-
value: size,
|
|
23
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
24
|
-
ref,
|
|
25
|
-
"data-slot": "input-group-root",
|
|
26
|
-
"data-size": size,
|
|
27
|
-
className: (0, clsx.clsx)(require_InputGroup_module.default.root, className),
|
|
28
|
-
onMouseDown: handleMouseDown,
|
|
29
|
-
...props,
|
|
30
|
-
children
|
|
31
|
-
})
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
const InputGroupInput = (0, react.forwardRef)(function InputGroupInput({ className, size, ...props }, ref) {
|
|
35
|
-
const groupSize = (0, react.useContext)(InputGroupSizeContext);
|
|
36
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Input.Input, {
|
|
37
|
-
ref,
|
|
38
|
-
"data-slot": "input-group-input",
|
|
39
|
-
className: require_mergeClassName.mergeClassName(className, require_InputGroup_module.default.input),
|
|
40
|
-
size: size ?? groupSize,
|
|
41
|
-
...props
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
const InputGroupAddon = (0, react.forwardRef)(function InputGroupAddon({ className, ...props }, ref) {
|
|
45
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
46
|
-
ref,
|
|
47
|
-
"data-slot": "input-group-addon",
|
|
48
|
-
className: (0, clsx.clsx)(require_InputGroup_module.default.addon, className),
|
|
49
|
-
...props
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
const InputGroupText = (0, react.forwardRef)(function InputGroupText({ className, ...props }, ref) {
|
|
53
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
54
|
-
ref,
|
|
55
|
-
"data-slot": "input-group-text",
|
|
56
|
-
className: (0, clsx.clsx)(require_InputGroup_module.default.text, className),
|
|
57
|
-
...props
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
const InputGroupButton = (0, react.forwardRef)(function InputGroupButton({ className, variant = "ghost", size, type = "button", ...props }, ref) {
|
|
61
|
-
const groupSize = (0, react.useContext)(InputGroupSizeContext);
|
|
62
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
|
|
63
|
-
ref,
|
|
64
|
-
"data-slot": "input-group-button",
|
|
65
|
-
className: require_mergeClassName.mergeClassName(className, require_InputGroup_module.default.button),
|
|
66
|
-
variant,
|
|
67
|
-
size: size ?? groupSize,
|
|
68
|
-
type,
|
|
69
|
-
...props
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
//#endregion
|
|
73
|
-
exports.InputGroup = InputGroup;
|
|
74
|
-
exports.InputGroupAddon = InputGroupAddon;
|
|
75
|
-
exports.InputGroupButton = InputGroupButton;
|
|
76
|
-
exports.InputGroupInput = InputGroupInput;
|
|
77
|
-
exports.InputGroupText = InputGroupText;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import './InputGroup.css';
|
|
2
|
-
//#region src/components/InputGroup/InputGroup.module.css
|
|
3
|
-
var InputGroup_module_default = {
|
|
4
|
-
"addon": "jSOrbG_addon",
|
|
5
|
-
"button": "jSOrbG_button",
|
|
6
|
-
"input": "jSOrbG_input",
|
|
7
|
-
"root": "jSOrbG_root",
|
|
8
|
-
"text": "jSOrbG_text"
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
|
-
exports.default = InputGroup_module_default;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_Kbd_module = require("./Kbd.module.cjs");
|
|
3
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
-
let clsx = require("clsx");
|
|
5
|
-
clsx = require_runtime.__toESM(clsx);
|
|
6
|
-
//#region src/components/Kbd/Kbd.tsx
|
|
7
|
-
function Kbd({ className, ...props }) {
|
|
8
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("kbd", {
|
|
9
|
-
"data-slot": "kbd-root",
|
|
10
|
-
className: (0, clsx.default)(require_Kbd_module.default.root, className),
|
|
11
|
-
...props
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
function KbdGroup({ className, ...props }) {
|
|
15
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("kbd", {
|
|
16
|
-
"data-slot": "kbd-group",
|
|
17
|
-
className: (0, clsx.default)(require_Kbd_module.default.group, className),
|
|
18
|
-
...props
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
//#endregion
|
|
22
|
-
exports.Kbd = Kbd;
|
|
23
|
-
exports.KbdGroup = KbdGroup;
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
const require_mergeClassName = require("../../utils/mergeClassName.cjs");
|
|
2
|
-
const require_CloseButton = require("../CloseButton/CloseButton.cjs");
|
|
3
|
-
const require_Lightbox_module = require("./Lightbox.module.cjs");
|
|
4
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
-
let clsx = require("clsx");
|
|
6
|
-
let react = require("react");
|
|
7
|
-
let _base_ui_react_dialog = require("@base-ui/react/dialog");
|
|
8
|
-
//#region src/components/Lightbox/Lightbox.tsx
|
|
9
|
-
const DEFAULT_CLOSE_LABEL = "Close image";
|
|
10
|
-
const createLightboxHandle = _base_ui_react_dialog.Dialog.createHandle;
|
|
11
|
-
const LightboxImageContext = (0, react.createContext)(null);
|
|
12
|
-
const LightboxSetImageContext = (0, react.createContext)(null);
|
|
13
|
-
const isSameImage = (currentImage, nextImage) => {
|
|
14
|
-
return currentImage?.src === nextImage.src && currentImage?.fullSrc === nextImage.fullSrc && currentImage?.alt === nextImage.alt;
|
|
15
|
-
};
|
|
16
|
-
const getGalleryRoot = (rootRef, rootSelector) => {
|
|
17
|
-
return rootRef?.current ?? (rootSelector ? document.querySelector(rootSelector) : null);
|
|
18
|
-
};
|
|
19
|
-
const getGalleryImage = (target, selector) => {
|
|
20
|
-
if (!(target instanceof Element)) return null;
|
|
21
|
-
const matchedNode = target.closest(selector);
|
|
22
|
-
if (!matchedNode) return null;
|
|
23
|
-
const imageNode = matchedNode instanceof HTMLImageElement ? matchedNode : matchedNode.querySelector("img");
|
|
24
|
-
if (!(imageNode instanceof HTMLImageElement)) return null;
|
|
25
|
-
const source = imageNode.dataset.lightboxSrc ?? imageNode.currentSrc ?? imageNode.src;
|
|
26
|
-
if (!source) return null;
|
|
27
|
-
return {
|
|
28
|
-
src: source,
|
|
29
|
-
alt: imageNode.alt
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
function Lightbox(props) {
|
|
33
|
-
const [image, setImage] = (0, react.useState)(null);
|
|
34
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxSetImageContext.Provider, {
|
|
35
|
-
value: setImage,
|
|
36
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxImageContext.Provider, {
|
|
37
|
-
value: image,
|
|
38
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Root, { ...props })
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function LightboxTrigger({ className, render, ...props }) {
|
|
43
|
-
const triggerClassName = render ? className : require_mergeClassName.mergeClassName(className, require_Lightbox_module.default.trigger);
|
|
44
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Trigger, {
|
|
45
|
-
"data-slot": "lightbox-trigger",
|
|
46
|
-
className: triggerClassName,
|
|
47
|
-
render,
|
|
48
|
-
...props
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function LightboxPortal({ className, ...props }) {
|
|
52
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Portal, {
|
|
53
|
-
"data-slot": "lightbox-portal",
|
|
54
|
-
className,
|
|
55
|
-
...props
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
function LightboxBackdrop({ className, ...props }) {
|
|
59
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Backdrop, {
|
|
60
|
-
"data-slot": "lightbox-backdrop",
|
|
61
|
-
className: require_mergeClassName.mergeClassName(className, require_Lightbox_module.default.backdrop),
|
|
62
|
-
...props
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function LightboxViewport({ className, ...props }) {
|
|
66
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Viewport, {
|
|
67
|
-
"data-slot": "lightbox-viewport",
|
|
68
|
-
className: require_mergeClassName.mergeClassName(className, require_Lightbox_module.default.viewport),
|
|
69
|
-
...props
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
function LightboxPopup({ className, ...props }) {
|
|
73
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Popup, {
|
|
74
|
-
"data-slot": "lightbox-popup",
|
|
75
|
-
className: require_mergeClassName.mergeClassName(className, require_Lightbox_module.default.popup),
|
|
76
|
-
...props
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
function LightboxClose({ className, ...props }) {
|
|
80
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Close, {
|
|
81
|
-
"data-slot": "lightbox-close",
|
|
82
|
-
className,
|
|
83
|
-
...props
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
function LightboxCloseButton({ className, children, "aria-label": ariaLabel = DEFAULT_CLOSE_LABEL, render, ...props }) {
|
|
87
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_base_ui_react_dialog.Dialog.Close, {
|
|
88
|
-
"data-slot": "lightbox-close-button",
|
|
89
|
-
render: render ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_CloseButton.CloseButton, {
|
|
90
|
-
"aria-label": ariaLabel,
|
|
91
|
-
children
|
|
92
|
-
}),
|
|
93
|
-
className: require_mergeClassName.mergeClassName(className, require_Lightbox_module.default.closeButton),
|
|
94
|
-
...props
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
function LightboxFrame({ className, ...props }) {
|
|
98
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
99
|
-
"data-slot": "lightbox-frame",
|
|
100
|
-
className: (0, clsx.clsx)(require_Lightbox_module.default.frame, className),
|
|
101
|
-
...props
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
function LightboxImage({ src, fullSrc, alt, className, onClick, ...props }) {
|
|
105
|
-
const setImage = (0, react.useContext)(LightboxSetImageContext);
|
|
106
|
-
const image = {
|
|
107
|
-
src,
|
|
108
|
-
fullSrc,
|
|
109
|
-
alt
|
|
110
|
-
};
|
|
111
|
-
(0, react.useEffect)(() => {
|
|
112
|
-
setImage?.(image);
|
|
113
|
-
return () => {
|
|
114
|
-
setImage?.((currentImage) => isSameImage(currentImage, image) ? null : currentImage);
|
|
115
|
-
};
|
|
116
|
-
}, [
|
|
117
|
-
alt,
|
|
118
|
-
fullSrc,
|
|
119
|
-
setImage,
|
|
120
|
-
src
|
|
121
|
-
]);
|
|
122
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxTrigger, {
|
|
123
|
-
nativeButton: false,
|
|
124
|
-
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
125
|
-
"data-slot": "lightbox-image",
|
|
126
|
-
src,
|
|
127
|
-
alt,
|
|
128
|
-
className: (0, clsx.clsx)(require_Lightbox_module.default.trigger, className),
|
|
129
|
-
"data-lightbox-src": fullSrc,
|
|
130
|
-
onClick: (event) => {
|
|
131
|
-
onClick?.(event);
|
|
132
|
-
if (!event.defaultPrevented) setImage?.(image);
|
|
133
|
-
},
|
|
134
|
-
...props
|
|
135
|
-
})
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
function LightboxContent({ className, showCloseButton = true, closeOnContentClick = true, closeLabel = DEFAULT_CLOSE_LABEL, children, ...props }) {
|
|
139
|
-
const image = (0, react.useContext)(LightboxImageContext);
|
|
140
|
-
const contentChildren = children ?? (image ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
141
|
-
"data-slot": "lightbox-content-image",
|
|
142
|
-
src: image.fullSrc ?? image.src,
|
|
143
|
-
alt: image.alt ?? ""
|
|
144
|
-
}) : null);
|
|
145
|
-
const content = closeOnContentClick ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxClose, {
|
|
146
|
-
className: require_Lightbox_module.default.contentClose,
|
|
147
|
-
nativeButton: false,
|
|
148
|
-
render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {}),
|
|
149
|
-
children: contentChildren
|
|
150
|
-
}) : contentChildren;
|
|
151
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LightboxPortal, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxBackdrop, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LightboxViewport, { children: [showCloseButton ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxCloseButton, { "aria-label": closeLabel }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxPopup, {
|
|
152
|
-
className,
|
|
153
|
-
...props,
|
|
154
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxFrame, { children: content })
|
|
155
|
-
})] })] });
|
|
156
|
-
}
|
|
157
|
-
function LightboxGallery({ selector = "img", rootRef, rootSelector, className, closeLabel, showCloseButton, closeOnContentClick }) {
|
|
158
|
-
const [open, setOpen] = (0, react.useState)(false);
|
|
159
|
-
const [image, setImage] = (0, react.useState)(null);
|
|
160
|
-
(0, react.useEffect)(() => {
|
|
161
|
-
const rootNode = getGalleryRoot(rootRef, rootSelector);
|
|
162
|
-
if (!rootNode) return;
|
|
163
|
-
const handleOpen = (target) => {
|
|
164
|
-
const nextImage = getGalleryImage(target, selector);
|
|
165
|
-
if (!nextImage) return false;
|
|
166
|
-
setImage(nextImage);
|
|
167
|
-
setOpen(true);
|
|
168
|
-
return true;
|
|
169
|
-
};
|
|
170
|
-
const handleClick = (event) => {
|
|
171
|
-
handleOpen(event.target);
|
|
172
|
-
};
|
|
173
|
-
const handleKeyDown = (event) => {
|
|
174
|
-
if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey || event.key !== "Enter" && event.key !== " ") return;
|
|
175
|
-
if (handleOpen(event.target)) event.preventDefault();
|
|
176
|
-
};
|
|
177
|
-
rootNode.addEventListener("click", handleClick);
|
|
178
|
-
rootNode.addEventListener("keydown", handleKeyDown);
|
|
179
|
-
return () => {
|
|
180
|
-
rootNode.removeEventListener("click", handleClick);
|
|
181
|
-
rootNode.removeEventListener("keydown", handleKeyDown);
|
|
182
|
-
};
|
|
183
|
-
}, [
|
|
184
|
-
rootRef,
|
|
185
|
-
rootSelector,
|
|
186
|
-
selector
|
|
187
|
-
]);
|
|
188
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Lightbox, {
|
|
189
|
-
open,
|
|
190
|
-
onOpenChange: setOpen,
|
|
191
|
-
onOpenChangeComplete: (nextOpen) => {
|
|
192
|
-
if (!nextOpen) setImage(null);
|
|
193
|
-
},
|
|
194
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LightboxContent, {
|
|
195
|
-
className,
|
|
196
|
-
closeLabel,
|
|
197
|
-
showCloseButton,
|
|
198
|
-
closeOnContentClick,
|
|
199
|
-
children: image ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
200
|
-
"data-slot": "lightbox-content-image",
|
|
201
|
-
src: image.src,
|
|
202
|
-
alt: image.alt ?? ""
|
|
203
|
-
}) : null
|
|
204
|
-
})
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
//#endregion
|
|
208
|
-
exports.Lightbox = Lightbox;
|
|
209
|
-
exports.LightboxBackdrop = LightboxBackdrop;
|
|
210
|
-
exports.LightboxClose = LightboxClose;
|
|
211
|
-
exports.LightboxCloseButton = LightboxCloseButton;
|
|
212
|
-
exports.LightboxContent = LightboxContent;
|
|
213
|
-
exports.LightboxFrame = LightboxFrame;
|
|
214
|
-
exports.LightboxGallery = LightboxGallery;
|
|
215
|
-
exports.LightboxImage = LightboxImage;
|
|
216
|
-
exports.LightboxPopup = LightboxPopup;
|
|
217
|
-
exports.LightboxPortal = LightboxPortal;
|
|
218
|
-
exports.LightboxTrigger = LightboxTrigger;
|
|
219
|
-
exports.LightboxViewport = LightboxViewport;
|
|
220
|
-
exports.createLightboxHandle = createLightboxHandle;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import './Lightbox.css';
|
|
2
|
-
//#region src/components/Lightbox/Lightbox.module.css
|
|
3
|
-
var Lightbox_module_default = {
|
|
4
|
-
"backdrop": "LTYCWG_backdrop",
|
|
5
|
-
"closeButton": "LTYCWG_closeButton",
|
|
6
|
-
"contentClose": "LTYCWG_contentClose",
|
|
7
|
-
"frame": "LTYCWG_frame",
|
|
8
|
-
"lightbox-image-enter": "LTYCWG_lightbox-image-enter",
|
|
9
|
-
"popup": "LTYCWG_popup",
|
|
10
|
-
"trigger": "LTYCWG_trigger",
|
|
11
|
-
"viewport": "LTYCWG_viewport"
|
|
12
|
-
};
|
|
13
|
-
//#endregion
|
|
14
|
-
exports.default = Lightbox_module_default;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
const require_List_module = require("./List.module.cjs");
|
|
3
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
-
let clsx = require("clsx");
|
|
5
|
-
clsx = require_runtime.__toESM(clsx);
|
|
6
|
-
//#region src/components/List/List.tsx
|
|
7
|
-
function List({ as = "ul", marker, gap = "sm", size = "md", tone = "default", className, role, ...props }) {
|
|
8
|
-
const Component = as;
|
|
9
|
-
const resolvedMarker = marker ?? (as === "ol" ? "decimal" : "disc");
|
|
10
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
|
|
11
|
-
"data-slot": "list-root",
|
|
12
|
-
"data-gap": gap,
|
|
13
|
-
"data-marker": resolvedMarker,
|
|
14
|
-
"data-marker-mode": marker === void 0 ? "auto" : "explicit",
|
|
15
|
-
"data-size": size,
|
|
16
|
-
"data-tone": tone,
|
|
17
|
-
role: role ?? (resolvedMarker === "none" ? "list" : void 0),
|
|
18
|
-
className: (0, clsx.default)(require_List_module.default.root, className),
|
|
19
|
-
...props
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function ListItem({ className, ...props }) {
|
|
23
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
24
|
-
"data-slot": "list-item",
|
|
25
|
-
className,
|
|
26
|
-
...props
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
exports.List = List;
|
|
31
|
-
exports.ListItem = ListItem;
|