reshaped 3.8.4-canary.0 → 3.8.4-canary.1

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.
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.config = void 0;
7
+ exports.default = getConfig;
8
+ const path_1 = __importDefault(require("path"));
9
+ const defaultThemeMediaCSSPath = path_1.default.resolve(__dirname, "../themes/reshaped/media.css");
10
+ // Using [plugin]: { ...options } format here because it's supported by the most frameworks
11
+ // - require('plugin') is not supported by Next
12
+ // - ['plugin', options] is not supported by Vite
13
+ exports.config = {
14
+ plugins: {
15
+ "@csstools/postcss-global-data": {
16
+ files: [defaultThemeMediaCSSPath],
17
+ },
18
+ "postcss-custom-media": {},
19
+ cssnano: { preset: ["default", { calc: false }] },
20
+ },
21
+ };
22
+ function getConfig(options) {
23
+ const { themeMediaCSSPath = defaultThemeMediaCSSPath } = options;
24
+ return {
25
+ plugins: {
26
+ "@csstools/postcss-global-data": {
27
+ files: [themeMediaCSSPath],
28
+ },
29
+ "postcss-custom-media": {},
30
+ cssnano: { preset: ["default", { calc: false }] },
31
+ },
32
+ };
33
+ }
@@ -0,0 +1,28 @@
1
+ export declare const config: {
2
+ plugins: {
3
+ "@csstools/postcss-global-data": {
4
+ files: string[];
5
+ };
6
+ "postcss-custom-media": {};
7
+ cssnano: {
8
+ preset: (string | {
9
+ calc: boolean;
10
+ })[];
11
+ };
12
+ };
13
+ };
14
+ export default function getConfig(options: {
15
+ themeMediaCSSPath?: string;
16
+ }): {
17
+ plugins: {
18
+ "@csstools/postcss-global-data": {
19
+ files: string[];
20
+ };
21
+ "postcss-custom-media": {};
22
+ cssnano: {
23
+ preset: (string | {
24
+ calc: boolean;
25
+ })[];
26
+ };
27
+ };
28
+ };
@@ -39,14 +39,18 @@ const useOnClickOutside = (refs, handler, options) => {
39
39
  if (disabled)
40
40
  return;
41
41
  const handleClick = (event) => {
42
- if (event.button === 2)
42
+ if ("button" in event && event.button === 2)
43
43
  return;
44
44
  if (isMouseDownInsideRef.current)
45
45
  return;
46
46
  handlerRef.current?.(event);
47
47
  };
48
- document.addEventListener("click", handleClick, { passive: true });
49
- return () => document.removeEventListener("click", handleClick);
48
+ document.addEventListener("mouseup", handleClick, { passive: true });
49
+ document.addEventListener("touchend", handleClick, { passive: true });
50
+ return () => {
51
+ document.removeEventListener("mouseup", handleClick);
52
+ document.removeEventListener("touchend", handleClick);
53
+ };
50
54
  // eslint-disable-next-line react-hooks/exhaustive-deps
51
55
  }, [handlerRef, disabled, ...refs]);
52
56
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reshaped",
3
3
  "description": "Professionally crafted design system in React & Figma for building products of any scale and complexity",
4
- "version": "3.8.4-canary.0",
4
+ "version": "3.8.4-canary.1",
5
5
  "license": "MIT",
6
6
  "email": "hello@reshaped.so",
7
7
  "homepage": "https://reshaped.so",
@@ -49,7 +49,8 @@
49
49
  },
50
50
  "./config/postcss": {
51
51
  "types": "./dist/config/postcss.d.ts",
52
- "import": "./dist/config/postcss.js"
52
+ "import": "./dist/config/postcss.js",
53
+ "default": "./dist/config/postcss.cjs"
53
54
  },
54
55
  "./config/tailwind": {
55
56
  "types": "./dist/config/tailwind.d.ts",