@zag-js/popover 2.0.0-next.3 → 2.0.0-next.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.
@@ -1,10 +1,3 @@
1
- import { PopoverProps } from './popover.types.mjs';
2
- import '@zag-js/core';
3
- import '@zag-js/dismissable';
4
- import '@zag-js/popper';
5
- import '@zag-js/types';
6
-
7
- declare const props: (keyof PopoverProps)[];
8
- declare const splitProps: <Props extends Partial<PopoverProps>>(props: Props) => [Partial<PopoverProps>, Omit<Props, keyof PopoverProps>];
9
-
10
- export { props, splitProps };
1
+ import { PopoverProps } from "./popover.types.mjs";
2
+ export declare const props: (keyof PopoverProps)[];
3
+ export declare const splitProps: <Props extends Partial<PopoverProps>>(props: Props) => [Partial<PopoverProps>, Omit<Props, keyof PopoverProps>];
@@ -1,10 +1,3 @@
1
- import { PopoverProps } from './popover.types.js';
2
- import '@zag-js/core';
3
- import '@zag-js/dismissable';
4
- import '@zag-js/popper';
5
- import '@zag-js/types';
6
-
7
- declare const props: (keyof PopoverProps)[];
8
- declare const splitProps: <Props extends Partial<PopoverProps>>(props: Props) => [Partial<PopoverProps>, Omit<Props, keyof PopoverProps>];
9
-
10
- export { props, splitProps };
1
+ import { PopoverProps } from "./popover.types.js";
2
+ export declare const props: (keyof PopoverProps)[];
3
+ export declare const splitProps: <Props extends Partial<PopoverProps>>(props: Props) => [Partial<PopoverProps>, Omit<Props, keyof PopoverProps>];
@@ -1,61 +1,36 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/popover.props.ts
21
- var popover_props_exports = {};
22
- __export(popover_props_exports, {
23
- props: () => props,
24
- splitProps: () => splitProps
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
25
4
  });
26
- module.exports = __toCommonJS(popover_props_exports);
27
- var import_types = require("@zag-js/types");
28
- var import_utils = require("@zag-js/utils");
29
- var props = (0, import_types.createProps)()([
30
- "autoFocus",
31
- "closeOnEscape",
32
- "closeOnInteractOutside",
33
- "defaultOpen",
34
- "defaultTriggerValue",
35
- "dir",
36
- "getRootNode",
37
- "id",
38
- "ids",
39
- "finalFocusEl",
40
- "initialFocusEl",
41
- "modal",
42
- "onEscapeKeyDown",
43
- "onFocusOutside",
44
- "onInteractOutside",
45
- "onOpenChange",
46
- "onPointerDownOutside",
47
- "onTriggerValueChange",
48
- "onRequestDismiss",
49
- "open",
50
- "persistentElements",
51
- "restoreFocus",
52
- "positioning",
53
- "translations",
54
- "triggerValue"
5
+ let _zag_js_utils = require("@zag-js/utils");
6
+ // src/popover.props.ts
7
+ const props = (0, require("@zag-js/types").createProps)()([
8
+ "autoFocus",
9
+ "closeOnEscape",
10
+ "closeOnInteractOutside",
11
+ "defaultOpen",
12
+ "defaultTriggerValue",
13
+ "dir",
14
+ "getRootNode",
15
+ "id",
16
+ "ids",
17
+ "finalFocusEl",
18
+ "initialFocusEl",
19
+ "modal",
20
+ "onEscapeKeyDown",
21
+ "onFocusOutside",
22
+ "onInteractOutside",
23
+ "onOpenChange",
24
+ "onPointerDownOutside",
25
+ "onTriggerValueChange",
26
+ "onRequestDismiss",
27
+ "open",
28
+ "persistentElements",
29
+ "restoreFocus",
30
+ "positioning",
31
+ "translations",
32
+ "triggerValue"
55
33
  ]);
56
- var splitProps = (0, import_utils.createSplitProps)(props);
57
- // Annotate the CommonJS export names for ESM import in node:
58
- 0 && (module.exports = {
59
- props,
60
- splitProps
61
- });
34
+ const splitProps = (0, _zag_js_utils.createSplitProps)(props);
35
+ exports.props = props;
36
+ exports.splitProps = splitProps;
@@ -1,35 +1,32 @@
1
- // src/popover.props.ts
2
- import { createProps } from "@zag-js/types";
3
1
  import { createSplitProps } from "@zag-js/utils";
4
- var props = createProps()([
5
- "autoFocus",
6
- "closeOnEscape",
7
- "closeOnInteractOutside",
8
- "defaultOpen",
9
- "defaultTriggerValue",
10
- "dir",
11
- "getRootNode",
12
- "id",
13
- "ids",
14
- "finalFocusEl",
15
- "initialFocusEl",
16
- "modal",
17
- "onEscapeKeyDown",
18
- "onFocusOutside",
19
- "onInteractOutside",
20
- "onOpenChange",
21
- "onPointerDownOutside",
22
- "onTriggerValueChange",
23
- "onRequestDismiss",
24
- "open",
25
- "persistentElements",
26
- "restoreFocus",
27
- "positioning",
28
- "translations",
29
- "triggerValue"
2
+ import { createProps } from "@zag-js/types";
3
+ // src/popover.props.ts
4
+ const props = createProps()([
5
+ "autoFocus",
6
+ "closeOnEscape",
7
+ "closeOnInteractOutside",
8
+ "defaultOpen",
9
+ "defaultTriggerValue",
10
+ "dir",
11
+ "getRootNode",
12
+ "id",
13
+ "ids",
14
+ "finalFocusEl",
15
+ "initialFocusEl",
16
+ "modal",
17
+ "onEscapeKeyDown",
18
+ "onFocusOutside",
19
+ "onInteractOutside",
20
+ "onOpenChange",
21
+ "onPointerDownOutside",
22
+ "onTriggerValueChange",
23
+ "onRequestDismiss",
24
+ "open",
25
+ "persistentElements",
26
+ "restoreFocus",
27
+ "positioning",
28
+ "translations",
29
+ "triggerValue"
30
30
  ]);
31
- var splitProps = createSplitProps(props);
32
- export {
33
- props,
34
- splitProps
35
- };
31
+ const splitProps = createSplitProps(props);
32
+ export { props, splitProps };
@@ -0,0 +1,15 @@
1
+ export interface ViewportSize {
2
+ width: number;
3
+ height: number;
4
+ }
5
+ export declare function getViewportSizeStyle(size: ViewportSize | null): {
6
+ "--viewport-width"?: never;
7
+ "--viewport-height"?: never;
8
+ width?: never;
9
+ height?: never;
10
+ } | {
11
+ "--viewport-width": string;
12
+ "--viewport-height": string;
13
+ width: string;
14
+ height: string;
15
+ };
@@ -0,0 +1,15 @@
1
+ export interface ViewportSize {
2
+ width: number;
3
+ height: number;
4
+ }
5
+ export declare function getViewportSizeStyle(size: ViewportSize | null): {
6
+ "--viewport-width"?: never;
7
+ "--viewport-height"?: never;
8
+ width?: never;
9
+ height?: never;
10
+ } | {
11
+ "--viewport-width": string;
12
+ "--viewport-height": string;
13
+ width: string;
14
+ height: string;
15
+ };
@@ -0,0 +1,15 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ // src/popover.style.ts
6
+ function getViewportSizeStyle(size) {
7
+ if (!size) return {};
8
+ return {
9
+ "--viewport-width": `${size.width}px`,
10
+ "--viewport-height": `${size.height}px`,
11
+ width: "var(--viewport-width)",
12
+ height: "var(--viewport-height)"
13
+ };
14
+ }
15
+ exports.getViewportSizeStyle = getViewportSizeStyle;
@@ -0,0 +1,11 @@
1
+ // src/popover.style.ts
2
+ function getViewportSizeStyle(size) {
3
+ if (!size) return {};
4
+ return {
5
+ "--viewport-width": `${size.width}px`,
6
+ "--viewport-height": `${size.height}px`,
7
+ width: "var(--viewport-width)",
8
+ height: "var(--viewport-height)"
9
+ };
10
+ }
11
+ export { getViewportSizeStyle };