@mlw-packages/react-components 1.4.6 → 1.4.7

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/index.js DELETED
@@ -1,89 +0,0 @@
1
- "use client";
2
- import './index.css';
3
- "use strict";
4
- var __create = Object.create;
5
- var __defProp = Object.defineProperty;
6
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __export = (target, all) => {
11
- for (var name in all)
12
- __defProp(target, name, { get: all[name], enumerable: true });
13
- };
14
- var __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") {
16
- for (let key of __getOwnPropNames(from))
17
- if (!__hasOwnProp.call(to, key) && key !== except)
18
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
- mod
29
- ));
30
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
31
-
32
- // src/index.ts
33
- var index_exports = {};
34
- __export(index_exports, {
35
- LabelBase: () => LabelBase_default,
36
- useIsMobile: () => useIsMobile
37
- });
38
- module.exports = __toCommonJS(index_exports);
39
-
40
- // src/hooks/use-mobile.tsx
41
- var React = __toESM(require("react"));
42
- var MOBILE_BREAKPOINT = 768;
43
- function useIsMobile() {
44
- const [isMobile, setIsMobile] = React.useState(void 0);
45
- React.useEffect(() => {
46
- const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
47
- const onChange = () => {
48
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
49
- };
50
- mql.addEventListener("change", onChange);
51
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
52
- return () => mql.removeEventListener("change", onChange);
53
- }, []);
54
- return !!isMobile;
55
- }
56
-
57
- // src/components/ui/LabelBase.tsx
58
- var React2 = __toESM(require("react"));
59
- var import_react_label = require("@radix-ui/react-label");
60
- var import_react_slot = require("@radix-ui/react-slot");
61
-
62
- // src/lib/utils.ts
63
- var import_clsx = require("clsx");
64
- var import_tailwind_merge = require("tailwind-merge");
65
- function cn(...inputs) {
66
- return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
67
- }
68
-
69
- // src/components/ui/LabelBase.tsx
70
- var import_jsx_runtime = require("react/jsx-runtime");
71
- var LabelBase = React2.forwardRef(
72
- ({ className, asChild = false, testid = "label-base", ...props }, ref) => {
73
- const Comp = asChild ? import_react_slot.Slot : "label";
74
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_label.Label, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
75
- Comp,
76
- {
77
- ref,
78
- className: cn(
79
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
80
- className
81
- ),
82
- "data-testid": testid,
83
- ...props
84
- }
85
- ) });
86
- }
87
- );
88
- LabelBase.displayName = "LabelBase";
89
- var LabelBase_default = LabelBase;
package/dist/index.mjs DELETED
@@ -1,57 +0,0 @@
1
- "use client";
2
- import './index.css';
3
-
4
- // src/hooks/use-mobile.tsx
5
- import * as React from "react";
6
- var MOBILE_BREAKPOINT = 768;
7
- function useIsMobile() {
8
- const [isMobile, setIsMobile] = React.useState(void 0);
9
- React.useEffect(() => {
10
- const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
11
- const onChange = () => {
12
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
13
- };
14
- mql.addEventListener("change", onChange);
15
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
16
- return () => mql.removeEventListener("change", onChange);
17
- }, []);
18
- return !!isMobile;
19
- }
20
-
21
- // src/components/ui/LabelBase.tsx
22
- import * as React2 from "react";
23
- import { Label as RadixLabel } from "@radix-ui/react-label";
24
- import { Slot } from "@radix-ui/react-slot";
25
-
26
- // src/lib/utils.ts
27
- import { clsx } from "clsx";
28
- import { twMerge } from "tailwind-merge";
29
- function cn(...inputs) {
30
- return twMerge(clsx(inputs));
31
- }
32
-
33
- // src/components/ui/LabelBase.tsx
34
- import { jsx } from "react/jsx-runtime";
35
- var LabelBase = React2.forwardRef(
36
- ({ className, asChild = false, testid = "label-base", ...props }, ref) => {
37
- const Comp = asChild ? Slot : "label";
38
- return /* @__PURE__ */ jsx(RadixLabel, { children: /* @__PURE__ */ jsx(
39
- Comp,
40
- {
41
- ref,
42
- className: cn(
43
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
44
- className
45
- ),
46
- "data-testid": testid,
47
- ...props
48
- }
49
- ) });
50
- }
51
- );
52
- LabelBase.displayName = "LabelBase";
53
- var LabelBase_default = LabelBase;
54
- export {
55
- LabelBase_default as LabelBase,
56
- useIsMobile
57
- };