@mekari/pixel3-popover 0.0.0

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.
Files changed (53) hide show
  1. package/dist/chunk-2ZUCITXI.mjs +8 -0
  2. package/dist/chunk-3VISLXE6.mjs +94 -0
  3. package/dist/chunk-6AOSFLZR.mjs +55 -0
  4. package/dist/chunk-7E4KFP32.mjs +10045 -0
  5. package/dist/chunk-E2N74NQW.mjs +29 -0
  6. package/dist/chunk-EOUKE4WB.mjs +308 -0
  7. package/dist/chunk-KRK533DP.mjs +25 -0
  8. package/dist/chunk-OBEDLACV.mjs +44 -0
  9. package/dist/chunk-QZ7VFGWC.mjs +6 -0
  10. package/dist/chunk-SMKHJPNG.mjs +55 -0
  11. package/dist/content.d.mts +8 -0
  12. package/dist/content.d.ts +8 -0
  13. package/dist/content.js +233 -0
  14. package/dist/content.mjs +10 -0
  15. package/dist/index.d.mts +11 -0
  16. package/dist/index.d.ts +11 -0
  17. package/dist/index.js +10607 -0
  18. package/dist/index.mjs +30 -0
  19. package/dist/list-item.d.mts +8 -0
  20. package/dist/list-item.d.ts +8 -0
  21. package/dist/list-item.js +10593 -0
  22. package/dist/list-item.mjs +15 -0
  23. package/dist/list.d.mts +5 -0
  24. package/dist/list.d.ts +5 -0
  25. package/dist/list.js +71 -0
  26. package/dist/list.mjs +9 -0
  27. package/dist/metafile-cjs.json +1 -0
  28. package/dist/metafile-esm.json +1 -0
  29. package/dist/modules/popover.context.d.mts +13 -0
  30. package/dist/modules/popover.context.d.ts +13 -0
  31. package/dist/modules/popover.context.js +33 -0
  32. package/dist/modules/popover.context.mjs +9 -0
  33. package/dist/modules/popover.hooks.d.mts +111 -0
  34. package/dist/modules/popover.hooks.d.ts +111 -0
  35. package/dist/modules/popover.hooks.js +337 -0
  36. package/dist/modules/popover.hooks.mjs +18 -0
  37. package/dist/modules/popover.props.d.mts +153 -0
  38. package/dist/modules/popover.props.d.ts +153 -0
  39. package/dist/modules/popover.props.js +121 -0
  40. package/dist/modules/popover.props.mjs +13 -0
  41. package/dist/popover.d.mts +126 -0
  42. package/dist/popover.d.ts +126 -0
  43. package/dist/popover.js +213 -0
  44. package/dist/popover.mjs +10 -0
  45. package/dist/singleton-popover.d.mts +135 -0
  46. package/dist/singleton-popover.d.ts +135 -0
  47. package/dist/singleton-popover.js +197 -0
  48. package/dist/singleton-popover.mjs +10 -0
  49. package/dist/trigger.d.mts +5 -0
  50. package/dist/trigger.d.ts +5 -0
  51. package/dist/trigger.js +115 -0
  52. package/dist/trigger.mjs +9 -0
  53. package/package.json +42 -0
@@ -0,0 +1,115 @@
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 __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/trigger.tsx
22
+ var trigger_exports = {};
23
+ __export(trigger_exports, {
24
+ MpPopoverTrigger: () => MpPopoverTrigger
25
+ });
26
+ module.exports = __toCommonJS(trigger_exports);
27
+ var import_vue3 = require("vue");
28
+ var import_vue4 = require("vue");
29
+
30
+ // src/modules/popover.hooks.ts
31
+ var import_vue = require("vue");
32
+ var import_vue2 = require("@floating-ui/vue");
33
+ var import_pixel3_utils2 = require("@mekari/pixel3-utils");
34
+ var import_recipes = require("@mekari/pixel3-styled-system/recipes");
35
+ var import_patterns = require("@mekari/pixel3-styled-system/patterns");
36
+
37
+ // src/modules/popover.context.ts
38
+ var import_pixel3_utils = require("@mekari/pixel3-utils");
39
+ var [PopoverProvider, usePopoverContext] = (0, import_pixel3_utils.usePixelCreateContext)("PopoverContext");
40
+
41
+ // src/modules/popover.hooks.ts
42
+ function usePopoverTrigger() {
43
+ const {
44
+ isOpen,
45
+ isHovering,
46
+ setHovering,
47
+ onOpenPopover,
48
+ onClosePopover,
49
+ triggerNode,
50
+ rootProps: popoverProps
51
+ } = usePopoverContext();
52
+ const {
53
+ id,
54
+ trigger
55
+ } = popoverProps;
56
+ const getId = (0, import_vue.computed)(() => (id == null ? void 0 : id.value) ? `popover-trigger-${id.value}` : `popover-trigger-${(0, import_pixel3_utils2.useId)(4)}`);
57
+ const rootAttrs = (0, import_vue.computed)(() => {
58
+ return {
59
+ ref: triggerNode,
60
+ "data-pixel-component": "MpPopoverTrigger",
61
+ id: getId.value,
62
+ onClick: () => {
63
+ if (trigger.value === "click") {
64
+ isOpen.value ? onClosePopover() : onOpenPopover();
65
+ }
66
+ },
67
+ onMouseenter: () => {
68
+ if (trigger.value === "hover") {
69
+ setHovering(true);
70
+ setTimeout(() => {
71
+ onOpenPopover();
72
+ }, 300);
73
+ }
74
+ },
75
+ onMouseleave: () => {
76
+ if (trigger.value === "hover") {
77
+ setHovering(false);
78
+ setTimeout(() => {
79
+ if (isHovering.value === false) {
80
+ onClosePopover();
81
+ }
82
+ }, 300);
83
+ }
84
+ }
85
+ };
86
+ });
87
+ return {
88
+ rootAttrs
89
+ };
90
+ }
91
+ __name(usePopoverTrigger, "usePopoverTrigger");
92
+
93
+ // src/trigger.tsx
94
+ var MpPopoverTrigger = (0, import_vue4.defineComponent)({
95
+ name: "MpPopoverTrigger",
96
+ inheritAttrs: false,
97
+ setup(_, {
98
+ slots
99
+ }) {
100
+ const {
101
+ rootAttrs
102
+ } = usePopoverTrigger();
103
+ return () => {
104
+ if (slots.default && slots.default().length > 1) {
105
+ console.error("[MpPopoverTrigger] Only 1 node allowed");
106
+ }
107
+ const clone = (0, import_vue4.cloneVNode)(slots.default()[0], rootAttrs.value);
108
+ return (0, import_vue3.createVNode)(import_vue3.Fragment, null, [clone]);
109
+ };
110
+ }
111
+ });
112
+ // Annotate the CommonJS export names for ESM import in node:
113
+ 0 && (module.exports = {
114
+ MpPopoverTrigger
115
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ MpPopoverTrigger
3
+ } from "./chunk-E2N74NQW.mjs";
4
+ import "./chunk-EOUKE4WB.mjs";
5
+ import "./chunk-2ZUCITXI.mjs";
6
+ import "./chunk-QZ7VFGWC.mjs";
7
+ export {
8
+ MpPopoverTrigger
9
+ };
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@mekari/pixel3-popover",
3
+ "version": "0.0.0",
4
+ "main": "dist/index.js",
5
+ "license": "MIT",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "dependencies": {
10
+ "@floating-ui/vue": "^1.0.2",
11
+ "@mekari/pixel3-styled-system": "0.0.0",
12
+ "@mekari/pixel3-utils": "0.0.0"
13
+ },
14
+ "peerDependencies": {
15
+ "vue": "^3.3.7"
16
+ },
17
+ "devDependencies": {
18
+ "vue": "^3.3.7"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "module": "dist/index.mjs",
24
+ "types": "dist/index.d.ts",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.ts",
28
+ "require": "./dist/index.js",
29
+ "default": "./dist/index.mjs"
30
+ }
31
+ },
32
+ "scripts": {
33
+ "clean": "rimraf dist .turbo",
34
+ "build": "tsup && pnpm build:types",
35
+ "build:fast": "tsup",
36
+ "build:types": "tsup src --dts-only",
37
+ "build:external": "tsup src/index.tsx --external @acme-org/styled-system",
38
+ "types:check": "tsc --noEmit",
39
+ "replace-config": "clean-package",
40
+ "restore-config": "clean-package restore"
41
+ }
42
+ }