@radix-ui/react-label 2.0.3-rc.7 → 2.1.0-rc.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/dist/index.d.mts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.js +53 -38
- package/dist/index.js.map +7 -1
- package/dist/index.mjs +27 -31
- package/dist/index.mjs.map +7 -1
- package/package.json +2 -3
- package/dist/index.d.ts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as Radix from
|
|
3
|
-
import { Primitive } from
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as Radix from '@radix-ui/react-primitive';
|
|
3
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
4
|
+
|
|
5
|
+
declare type PrimitiveLabelProps = Radix.ComponentPropsWithoutRef<typeof Primitive.label>;
|
|
6
|
+
interface LabelProps extends PrimitiveLabelProps {
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
9
|
+
declare const Root: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
export { Label, type LabelProps, Root };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as Radix from
|
|
3
|
-
import { Primitive } from
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as Radix from '@radix-ui/react-primitive';
|
|
3
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
4
|
+
|
|
5
|
+
declare type PrimitiveLabelProps = Radix.ComponentPropsWithoutRef<typeof Primitive.label>;
|
|
6
|
+
interface LabelProps extends PrimitiveLabelProps {
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
9
|
+
declare const Root: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
export { Label, type LabelProps, Root };
|
package/dist/index.js
CHANGED
|
@@ -1,41 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
(() => {
|
|
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 __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
12
|
+
}) : x)(function(x) {
|
|
13
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
14
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
15
|
+
});
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
// packages/react/label/src/Label.tsx
|
|
34
|
+
var React = __toESM(__require("react"));
|
|
35
|
+
var import_react_primitive = __require("@radix-ui/react-primitive");
|
|
36
|
+
var import_jsx_runtime = __require("react/jsx-runtime");
|
|
37
|
+
var NAME = "Label";
|
|
38
|
+
var Label = React.forwardRef((props, forwardedRef) => {
|
|
39
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40
|
+
import_react_primitive.Primitive.label,
|
|
41
|
+
{
|
|
42
|
+
...props,
|
|
22
43
|
ref: forwardedRef,
|
|
23
|
-
onMouseDown: (event)=>{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(_props$onMouseDown = props.onMouseDown) === null || _props$onMouseDown === void 0 || _props$onMouseDown.call(props, event); // prevent text selection when double clicking label
|
|
29
|
-
if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
|
|
44
|
+
onMouseDown: (event) => {
|
|
45
|
+
const target = event.target;
|
|
46
|
+
if (target.closest("button, input, select, textarea")) return;
|
|
47
|
+
props.onMouseDown?.(event);
|
|
48
|
+
if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
|
|
30
49
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
Label.displayName = NAME;
|
|
54
|
+
var Root = Label;
|
|
55
|
+
})();
|
|
41
56
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/Label.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Label\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Label';\n\ntype LabelElement = React.ElementRef<typeof Primitive.label>;\ntype PrimitiveLabelProps = Radix.ComponentPropsWithoutRef<typeof Primitive.label>;\ninterface LabelProps extends PrimitiveLabelProps {}\n\nconst Label = React.forwardRef<LabelElement, LabelProps>((props, forwardedRef) => {\n return (\n <Primitive.label\n {...props}\n ref={forwardedRef}\n onMouseDown={(event) => {\n // only prevent text selection if clicking inside the label itself\n const target = event.target as HTMLElement;\n if (target.closest('button, input, select, textarea')) return;\n\n props.onMouseDown?.(event);\n // prevent text selection when double clicking label\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault();\n }}\n />\n );\n});\n\nLabel.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Label;\n\nexport {\n Label,\n //\n Root,\n};\nexport type { LabelProps };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,cAAuB;AACvB,+BAA0B;AAgBtB;AARJ,MAAM,OAAO;AAMb,MAAM,QAAc,iBAAqC,CAAC,OAAO,iBAAiB;AAChF,WACE;AAAA,MAAC,iCAAU;AAAA,MAAV;AAAA,QACE,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,aAAa,CAAC,UAAU;AAEtB,gBAAM,SAAS,MAAM;AACrB,cAAI,OAAO,QAAQ,iCAAiC,EAAG;AAEvD,gBAAM,cAAc,KAAK;AAEzB,cAAI,CAAC,MAAM,oBAAoB,MAAM,SAAS,EAAG,OAAM,eAAe;AAAA,QACxE;AAAA;AAAA,IACF;AAAA,EAEJ,CAAC;AAED,QAAM,cAAc;AAIpB,MAAM,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}));
|
|
23
|
-
});
|
|
24
|
-
/*#__PURE__*/ Object.assign($b73a6c6685e72184$export$b04be29aa201d4f5, {
|
|
25
|
-
displayName: $b73a6c6685e72184$var$NAME
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// packages/react/label/src/Label.tsx
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var NAME = "Label";
|
|
8
|
+
var Label = React.forwardRef((props, forwardedRef) => {
|
|
9
|
+
return /* @__PURE__ */ jsx(
|
|
10
|
+
Primitive.label,
|
|
11
|
+
{
|
|
12
|
+
...props,
|
|
13
|
+
ref: forwardedRef,
|
|
14
|
+
onMouseDown: (event) => {
|
|
15
|
+
const target = event.target;
|
|
16
|
+
if (target.closest("button, input, select, textarea")) return;
|
|
17
|
+
props.onMouseDown?.(event);
|
|
18
|
+
if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
);
|
|
26
22
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
Label.displayName = NAME;
|
|
24
|
+
var Root = Label;
|
|
25
|
+
export {
|
|
26
|
+
Label,
|
|
27
|
+
Root
|
|
28
|
+
};
|
|
33
29
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/Label.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\nimport type * as Radix from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Label\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Label';\n\ntype LabelElement = React.ElementRef<typeof Primitive.label>;\ntype PrimitiveLabelProps = Radix.ComponentPropsWithoutRef<typeof Primitive.label>;\ninterface LabelProps extends PrimitiveLabelProps {}\n\nconst Label = React.forwardRef<LabelElement, LabelProps>((props, forwardedRef) => {\n return (\n <Primitive.label\n {...props}\n ref={forwardedRef}\n onMouseDown={(event) => {\n // only prevent text selection if clicking inside the label itself\n const target = event.target as HTMLElement;\n if (target.closest('button, input, select, textarea')) return;\n\n props.onMouseDown?.(event);\n // prevent text selection when double clicking label\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault();\n }}\n />\n );\n});\n\nLabel.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Label;\n\nexport {\n Label,\n //\n Root,\n};\nexport type { LabelProps };\n"],
|
|
5
|
+
"mappings": ";;;AAAA,YAAY,WAAW;AACvB,SAAS,iBAAiB;AAgBtB;AARJ,IAAM,OAAO;AAMb,IAAM,QAAc,iBAAqC,CAAC,OAAO,iBAAiB;AAChF,SACE;AAAA,IAAC,UAAU;AAAA,IAAV;AAAA,MACE,GAAG;AAAA,MACJ,KAAK;AAAA,MACL,aAAa,CAAC,UAAU;AAEtB,cAAM,SAAS,MAAM;AACrB,YAAI,OAAO,QAAQ,iCAAiC,EAAG;AAEvD,cAAM,cAAc,KAAK;AAEzB,YAAI,CAAC,MAAM,oBAAoB,MAAM,SAAS,EAAG,OAAM,eAAe;AAAA,MACxE;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,MAAM,cAAc;AAIpB,IAAM,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-label",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0-rc.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
"version": "yarn version"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@
|
|
32
|
-
"@radix-ui/react-primitive": "1.0.3"
|
|
31
|
+
"@radix-ui/react-primitive": "1.1.0-rc.2"
|
|
33
32
|
},
|
|
34
33
|
"peerDependencies": {
|
|
35
34
|
"@types/react": "*",
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;AAYA,2BAA2B,MAAM,wBAAwB,CAAC,OAAO,UAAU,KAAK,CAAC,CAAC;AAClF,2BAAqB,SAAQ,mBAAmB;CAAG;AAEnD,OAAA,MAAM,0FAgBJ,CAAC;AAMH,OAAA,MAAM,yFAAY,CAAC","sources":["packages/react/label/src/packages/react/label/src/Label.tsx","packages/react/label/src/packages/react/label/src/index.ts","packages/react/label/src/index.ts"],"sourcesContent":[null,null,"export {\n Label,\n //\n Root,\n} from './Label';\nexport type { LabelProps } from './Label';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|