@purpurds/label 8.2.2 → 8.2.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.
- package/dist/LICENSE.txt +76 -4
- package/dist/label.cjs.js +2 -2
- package/dist/label.cjs.js.map +1 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.es.js +111 -103
- package/dist/label.es.js.map +1 -1
- package/package.json +4 -4
package/dist/LICENSE.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Name: @radix-ui/react-compose-refs
|
|
2
|
-
Version: 1.1.
|
|
2
|
+
Version: 1.1.2
|
|
3
3
|
License: MIT
|
|
4
4
|
Private: false
|
|
5
5
|
Repository: git+https://github.com/radix-ui/primitives.git
|
|
@@ -8,29 +8,101 @@ Homepage: https://radix-ui.com/primitives
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
Name: @radix-ui/react-slot
|
|
11
|
-
Version: 1.
|
|
11
|
+
Version: 1.2.3
|
|
12
12
|
License: MIT
|
|
13
13
|
Private: false
|
|
14
14
|
Repository: git+https://github.com/radix-ui/primitives.git
|
|
15
15
|
Homepage: https://radix-ui.com/primitives
|
|
16
|
+
License Copyright:
|
|
17
|
+
===
|
|
18
|
+
|
|
19
|
+
MIT License
|
|
20
|
+
|
|
21
|
+
Copyright (c) 2022 WorkOS
|
|
22
|
+
|
|
23
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
24
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
25
|
+
in the Software without restriction, including without limitation the rights
|
|
26
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
27
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
28
|
+
furnished to do so, subject to the following conditions:
|
|
29
|
+
|
|
30
|
+
The above copyright notice and this permission notice shall be included in all
|
|
31
|
+
copies or substantial portions of the Software.
|
|
32
|
+
|
|
33
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
34
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
35
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
36
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
37
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
38
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
39
|
+
SOFTWARE.
|
|
16
40
|
|
|
17
41
|
---
|
|
18
42
|
|
|
19
43
|
Name: @radix-ui/react-primitive
|
|
20
|
-
Version: 2.
|
|
44
|
+
Version: 2.1.3
|
|
21
45
|
License: MIT
|
|
22
46
|
Private: false
|
|
23
47
|
Repository: git+https://github.com/radix-ui/primitives.git
|
|
24
48
|
Homepage: https://radix-ui.com/primitives
|
|
49
|
+
License Copyright:
|
|
50
|
+
===
|
|
51
|
+
|
|
52
|
+
MIT License
|
|
53
|
+
|
|
54
|
+
Copyright (c) 2022 WorkOS
|
|
55
|
+
|
|
56
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
57
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
58
|
+
in the Software without restriction, including without limitation the rights
|
|
59
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
60
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
61
|
+
furnished to do so, subject to the following conditions:
|
|
62
|
+
|
|
63
|
+
The above copyright notice and this permission notice shall be included in all
|
|
64
|
+
copies or substantial portions of the Software.
|
|
65
|
+
|
|
66
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
67
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
68
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
69
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
70
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
71
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
72
|
+
SOFTWARE.
|
|
25
73
|
|
|
26
74
|
---
|
|
27
75
|
|
|
28
76
|
Name: @radix-ui/react-label
|
|
29
|
-
Version: 2.1.
|
|
77
|
+
Version: 2.1.7
|
|
30
78
|
License: MIT
|
|
31
79
|
Private: false
|
|
32
80
|
Repository: git+https://github.com/radix-ui/primitives.git
|
|
33
81
|
Homepage: https://radix-ui.com/primitives
|
|
82
|
+
License Copyright:
|
|
83
|
+
===
|
|
84
|
+
|
|
85
|
+
MIT License
|
|
86
|
+
|
|
87
|
+
Copyright (c) 2022 WorkOS
|
|
88
|
+
|
|
89
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
90
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
91
|
+
in the Software without restriction, including without limitation the rights
|
|
92
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
93
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
94
|
+
furnished to do so, subject to the following conditions:
|
|
95
|
+
|
|
96
|
+
The above copyright notice and this permission notice shall be included in all
|
|
97
|
+
copies or substantial portions of the Software.
|
|
98
|
+
|
|
99
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
100
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
101
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
102
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
103
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
104
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
105
|
+
SOFTWARE.
|
|
34
106
|
|
|
35
107
|
---
|
|
36
108
|
|
package/dist/label.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),h=require("react");require("react-dom");function S(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const u=S(h);function m(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function _(...e){return n=>{let r=!1;const i=e.map(o=>{const t=m(o,n);return!r&&typeof t=="function"&&(r=!0),t});if(r)return()=>{for(let o=0;o<i.length;o++){const t=i[o];typeof t=="function"?t():m(e[o],null)}}}}function j(e){const n=x(e),r=u.forwardRef((i,o)=>{const{children:t,...l}=i,s=u.Children.toArray(t),a=s.find(R);if(a){const c=a.props.children,g=s.map(b=>b===a?u.Children.count(c)>1?u.Children.only(null):u.isValidElement(c)?c.props.children:null:b);return f.jsx(n,{...l,ref:o,children:u.isValidElement(c)?u.cloneElement(c,void 0,g):null})}return f.jsx(n,{...l,ref:o,children:t})});return r.displayName=`${e}.Slot`,r}function x(e){const n=u.forwardRef((r,i)=>{const{children:o,...t}=r;if(u.isValidElement(o)){const l=E(o),s=w(t,o.props);return o.type!==u.Fragment&&(s.ref=i?_(i,l):l),u.cloneElement(o,s)}return u.Children.count(o)>1?u.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var O=Symbol("radix.slottable");function R(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===O}function w(e,n){const r={...n};for(const i in n){const o=e[i],t=n[i];/^on[A-Z]/.test(i)?o&&t?r[i]=(...s)=>{const a=t(...s);return o(...s),a}:o&&(r[i]=o):i==="style"?r[i]={...o,...t}:i==="className"&&(r[i]=[o,t].filter(Boolean).join(" "))}return{...e,...r}}function E(e){var i,o;let n=(i=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:i.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=n&&"isReactWarning"in n&&n.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var P=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],C=P.reduce((e,n)=>{const r=j(`Primitive.${n}`),i=u.forwardRef((o,t)=>{const{asChild:l,...s}=o,a=l?r:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(a,{...s,ref:t})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{}),N="Label",v=u.forwardRef((e,n)=>f.jsx(C.label,{...e,ref:n,onMouseDown:r=>{var o;r.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));v.displayName=N;var D=v;function A(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/var
|
|
5
|
+
*/var y;function V(){return y||(y=1,(function(e){(function(){var n={}.hasOwnProperty;function r(){for(var t="",l=0;l<arguments.length;l++){var s=arguments[l];s&&(t=o(t,i.call(this,s)))}return t}function i(t){if(typeof t=="string"||typeof t=="number")return this&&this[t]||t;if(typeof t!="object")return"";if(Array.isArray(t))return r.apply(this,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var l="";for(var s in t)n.call(t,s)&&t[s]&&(l=o(l,this&&this[s]||s));return l}function o(t,l){return l?t?t+" "+l:t+l:t}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(p)),p.exports}var $=V();const L=A($),M={"purpur-label":"_purpur-label_1x80u_1","purpur-label--negative":"_purpur-label--negative_1x80u_8","purpur-label--disabled":"_purpur-label--disabled_1x80u_11"},q=L.bind(M),d="purpur-label",I=({children:e,className:n,disabled:r,negative:i=!1,...o})=>{const t=q(n,d,{[`${d}--disabled`]:r,[`${d}--negative`]:i});return f.jsx(D,{className:t,...o,children:e})};exports.Label=I;
|
|
6
6
|
//# sourceMappingURL=label.cjs.js.map
|
package/dist/label.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.cjs.js","sources":["../../../common/temp/node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.1_@types+react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-slot@1.1.2_@types+react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-slot/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-primitive@2.0.2_@types+react-dom@19.0.4_@types+react@19.0.10_react-dom@19.0.0_react@19.0.0/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-label@2.1.2_@types+react-dom@19.0.4_@types+react@19.0.10_react-dom@19.0.0_react@19.0.0/node_modules/@radix-ui/react-label/dist/index.mjs","../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/label.tsx"],"sourcesContent":["// packages/react/compose-refs/src/composeRefs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/slot/src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\nvar Slot = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n});\nSlot.displayName = \"Slot\";\nvar SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n});\nSlotClone.displayName = \"SlotClone\";\nvar Slottable = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n};\nfunction isSlottable(child) {\n return React.isValidElement(child) && child.type === Slottable;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n childPropValue(...args);\n slotPropValue(...args);\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Slot;\nexport {\n Root,\n Slot,\n Slottable\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/primitive/src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// packages/react/label/src/label.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Label\";\nvar Label = React.forwardRef((props, forwardedRef) => {\n return /* @__PURE__ */ jsx(\n Primitive.label,\n {\n ...props,\n ref: forwardedRef,\n onMouseDown: (event) => {\n const target = event.target;\n if (target.closest(\"button, input, select, textarea\")) return;\n props.onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault();\n }\n }\n );\n});\nLabel.displayName = NAME;\nvar Root = Label;\nexport {\n Label,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport * as RadixLabel from \"@radix-ui/react-label\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./label.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-label\";\n\nexport type LabelProps = Omit<BaseProps<\"label\">, \"children\"> & {\n children: ReactNode;\n disabled?: boolean;\n negative?: boolean;\n};\n\nexport const Label = ({\n children,\n className,\n disabled,\n negative = false,\n ...props\n}: LabelProps) => {\n const classes = cx(className, rootClassName, {\n [`${rootClassName}--disabled`]: disabled,\n [`${rootClassName}--negative`]: negative,\n });\n\n return (\n <RadixLabel.Root className={classes} {...props}>\n {children}\n </RadixLabel.Root>\n );\n};\n"],"names":["setRef","ref","value","composeRefs","refs","node","hasCleanup","cleanups","cleanup","Slot","React","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","SlotClone","childrenRef","getElementRef","props2","mergeProps","Slottable","Fragment2","childProps","overrideProps","propName","slotPropValue","childPropValue","args","element","getter","_a","mayWarn","_b","NODES","Primitive","primitive","Node","asChild","primitiveProps","Comp","NAME","Label","event","Root","hasOwn","classNames","classes","i","arg","appendClass","parseValue","key","newClass","module","cx","c","styles","rootClassName","className","disabled","negative","RadixLabel.Root"],"mappings":"ubAEA,SAASA,EAAOC,EAAKC,EAAO,CAC1B,GAAI,OAAOD,GAAQ,WACjB,OAAOA,EAAIC,CAAK,EACPD,GAAQ,OACjBA,EAAI,QAAUC,EAElB,CACA,SAASC,KAAeC,EAAM,CAC5B,OAAQC,GAAS,CACf,IAAIC,EAAa,GACjB,MAAMC,EAAWH,EAAK,IAAKH,GAAQ,CACjC,MAAMO,EAAUR,EAAOC,EAAKI,CAAI,EAChC,MAAI,CAACC,GAAc,OAAOE,GAAW,aACnCF,EAAa,IAERE,CACb,CAAK,EACD,GAAIF,EACF,MAAO,IAAM,CACX,QAAS,EAAI,EAAG,EAAIC,EAAS,OAAQ,IAAK,CACxC,MAAMC,EAAUD,EAAS,CAAC,EACtB,OAAOC,GAAW,WACpBA,EAAS,EAETR,EAAOI,EAAK,CAAC,EAAG,IAAI,CAEhC,CACO,CAEJ,CACH,CC5BA,IAAIK,EAAOC,EAAM,WAAW,CAACC,EAAOC,IAAiB,CACnD,KAAM,CAAE,SAAAC,EAAU,GAAGC,CAAS,EAAKH,EAC7BI,EAAgBL,EAAM,SAAS,QAAQG,CAAQ,EAC/CG,EAAYD,EAAc,KAAKE,CAAW,EAChD,GAAID,EAAW,CACb,MAAME,EAAaF,EAAU,MAAM,SAC7BG,EAAcJ,EAAc,IAAKK,GACjCA,IAAUJ,EACRN,EAAM,SAAS,MAAMQ,CAAU,EAAI,EAAUR,EAAM,SAAS,KAAK,IAAI,EAClEA,EAAM,eAAeQ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,UAAiBR,GAOjB,OAAO,WAAaA,CAEtB,6MCrEMS,EAAKC,EAAE,KAAKC,CAAM,EAElBC,EAAgB,eAQThB,EAAQ,CAAC,CACpB,SAAAnC,EACA,UAAAoD,EACA,SAAAC,EACA,SAAAC,EAAW,GACX,GAAGxD,CACL,IAAkB,CACV,MAAA0C,EAAUQ,EAAGI,EAAWD,EAAe,CAC3C,CAAC,GAAGA,CAAa,YAAY,EAAGE,EAChC,CAAC,GAAGF,CAAa,YAAY,EAAGG,CAAA,CACjC,EAGC,OAAA9C,EAAAA,IAAC+C,EAAA,CAAgB,UAAWf,EAAU,GAAG1C,EACtC,SAAAE,EACH,CAEJ","x_google_ignoreList":[0,1,2,3,4]}
|
|
1
|
+
{"version":3,"file":"label.cjs.js","sources":["../../../common/temp/node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.1.16_react@19.1.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.16_react@19.1.1/node_modules/@radix-ui/react-slot/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.9_@types+react@19.1.16_react-dom@19.1.1_react@19.1.1/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-label@2.1.7_@types+react-dom@19.1.9_@types+react@19.1.16_react-dom@19.1.1_react@19.1.1/node_modules/@radix-ui/react-label/dist/index.mjs","../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/label.tsx"],"sourcesContent":["// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/label.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Label\";\nvar Label = React.forwardRef((props, forwardedRef) => {\n return /* @__PURE__ */ jsx(\n Primitive.label,\n {\n ...props,\n ref: forwardedRef,\n onMouseDown: (event) => {\n const target = event.target;\n if (target.closest(\"button, input, select, textarea\")) return;\n props.onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault();\n }\n }\n );\n});\nLabel.displayName = NAME;\nvar Root = Label;\nexport {\n Label,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport * as RadixLabel from \"@radix-ui/react-label\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./label.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-label\";\n\nexport type LabelProps = Omit<BaseProps<\"label\">, \"children\"> & {\n children: ReactNode;\n disabled?: boolean;\n negative?: boolean;\n};\n\nexport const Label = ({\n children,\n className,\n disabled,\n negative = false,\n ...props\n}: LabelProps) => {\n const classes = cx(className, rootClassName, {\n [`${rootClassName}--disabled`]: disabled,\n [`${rootClassName}--negative`]: negative,\n });\n\n return (\n <RadixLabel.Root className={classes} {...props}>\n {children}\n </RadixLabel.Root>\n );\n};\n"],"names":["setRef","ref","value","composeRefs","refs","node","hasCleanup","cleanups","cleanup","i","createSlot","ownerName","SlotClone","createSlotClone","Slot2","React","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","childrenRef","getElementRef","props2","mergeProps","SLOTTABLE_IDENTIFIER","childProps","overrideProps","propName","slotPropValue","childPropValue","args","result","element","getter","_a","mayWarn","_b","NODES","Primitive","primitive","Slot","Node","asChild","primitiveProps","Comp","NAME","Label","event","Root","hasOwn","classNames","classes","arg","appendClass","parseValue","key","newClass","module","cx","c","styles","rootClassName","className","disabled","negative","RadixLabel.Root"],"mappings":"ubAEA,SAASA,EAAOC,EAAKC,EAAO,CAC1B,GAAI,OAAOD,GAAQ,WACjB,OAAOA,EAAIC,CAAK,EACPD,GAAQ,OACjBA,EAAI,QAAUC,EAElB,CACA,SAASC,KAAeC,EAAM,CAC5B,OAAQC,GAAS,CACf,IAAIC,EAAa,GACjB,MAAMC,EAAWH,EAAK,IAAKH,GAAQ,CACjC,MAAMO,EAAUR,EAAOC,EAAKI,CAAI,EAChC,MAAI,CAACC,GAAc,OAAOE,GAAW,aACnCF,EAAa,IAERE,CACT,CAAC,EACD,GAAIF,EACF,MAAO,IAAM,CACX,QAASG,EAAI,EAAGA,EAAIF,EAAS,OAAQE,IAAK,CACxC,MAAMD,EAAUD,EAASE,CAAC,EACtB,OAAOD,GAAW,WACpBA,EAAO,EAEPR,EAAOI,EAAKK,CAAC,EAAG,IAAI,CA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C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAUxD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,GAAG;IAC9D,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../src/label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAUxD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,GAAG;IAC9D,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,uDAMnB,UAAU,sBAWZ,CAAC"}
|
package/dist/label.es.js
CHANGED
|
@@ -1,65 +1,72 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
function
|
|
5
|
-
if (typeof
|
|
6
|
-
return
|
|
7
|
-
|
|
4
|
+
function b(t, o) {
|
|
5
|
+
if (typeof t == "function")
|
|
6
|
+
return t(o);
|
|
7
|
+
t != null && (t.current = o);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return (
|
|
11
|
-
let
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
return !
|
|
9
|
+
function S(...t) {
|
|
10
|
+
return (o) => {
|
|
11
|
+
let n = !1;
|
|
12
|
+
const i = t.map((r) => {
|
|
13
|
+
const e = b(r, o);
|
|
14
|
+
return !n && typeof e == "function" && (n = !0), e;
|
|
15
15
|
});
|
|
16
|
-
if (
|
|
16
|
+
if (n)
|
|
17
17
|
return () => {
|
|
18
|
-
for (let
|
|
19
|
-
const
|
|
20
|
-
typeof
|
|
18
|
+
for (let r = 0; r < i.length; r++) {
|
|
19
|
+
const e = i[r];
|
|
20
|
+
typeof e == "function" ? e() : b(t[r], null);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
25
|
+
// @__NO_SIDE_EFFECTS__
|
|
26
|
+
function g(t) {
|
|
27
|
+
const o = /* @__PURE__ */ _(t), n = a.forwardRef((i, r) => {
|
|
28
|
+
const { children: e, ...l } = i, s = a.Children.toArray(e), u = s.find(w);
|
|
29
|
+
if (u) {
|
|
30
|
+
const c = u.props.children, v = s.map((m) => m === u ? a.Children.count(c) > 1 ? a.Children.only(null) : a.isValidElement(c) ? c.props.children : null : m);
|
|
31
|
+
return /* @__PURE__ */ f(o, { ...l, ref: r, children: a.isValidElement(c) ? a.cloneElement(c, void 0, v) : null });
|
|
32
|
+
}
|
|
33
|
+
return /* @__PURE__ */ f(o, { ...l, ref: r, children: e });
|
|
34
|
+
});
|
|
35
|
+
return n.displayName = `${t}.Slot`, n;
|
|
36
|
+
}
|
|
37
|
+
// @__NO_SIDE_EFFECTS__
|
|
38
|
+
function _(t) {
|
|
39
|
+
const o = a.forwardRef((n, i) => {
|
|
40
|
+
const { children: r, ...e } = n;
|
|
41
|
+
if (a.isValidElement(r)) {
|
|
42
|
+
const l = C(r), s = x(e, r.props);
|
|
43
|
+
return r.type !== a.Fragment && (s.ref = i ? S(i, l) : l), a.cloneElement(r, s);
|
|
44
|
+
}
|
|
45
|
+
return a.Children.count(r) > 1 ? a.Children.only(null) : null;
|
|
46
|
+
});
|
|
47
|
+
return o.displayName = `${t}.SlotClone`, o;
|
|
48
|
+
}
|
|
49
|
+
var E = Symbol("radix.slottable");
|
|
50
|
+
function w(t) {
|
|
51
|
+
return a.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === E;
|
|
46
52
|
}
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
for (const
|
|
50
|
-
const
|
|
51
|
-
/^on[A-Z]/.test(
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
function x(t, o) {
|
|
54
|
+
const n = { ...o };
|
|
55
|
+
for (const i in o) {
|
|
56
|
+
const r = t[i], e = o[i];
|
|
57
|
+
/^on[A-Z]/.test(i) ? r && e ? n[i] = (...s) => {
|
|
58
|
+
const u = e(...s);
|
|
59
|
+
return r(...s), u;
|
|
60
|
+
} : r && (n[i] = r) : i === "style" ? n[i] = { ...r, ...e } : i === "className" && (n[i] = [r, e].filter(Boolean).join(" "));
|
|
54
61
|
}
|
|
55
|
-
return { ...
|
|
62
|
+
return { ...t, ...n };
|
|
56
63
|
}
|
|
57
|
-
function
|
|
58
|
-
var
|
|
59
|
-
let
|
|
60
|
-
return
|
|
64
|
+
function C(t) {
|
|
65
|
+
var i, r;
|
|
66
|
+
let o = (i = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : i.get, n = o && "isReactWarning" in o && o.isReactWarning;
|
|
67
|
+
return n ? t.ref : (o = (r = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : r.get, n = o && "isReactWarning" in o && o.isReactWarning, n ? t.props.ref : t.props.ref || t.ref);
|
|
61
68
|
}
|
|
62
|
-
var
|
|
69
|
+
var R = [
|
|
63
70
|
"a",
|
|
64
71
|
"button",
|
|
65
72
|
"div",
|
|
@@ -73,89 +80,90 @@ var C = [
|
|
|
73
80
|
"nav",
|
|
74
81
|
"ol",
|
|
75
82
|
"p",
|
|
83
|
+
"select",
|
|
76
84
|
"span",
|
|
77
85
|
"svg",
|
|
78
86
|
"ul"
|
|
79
|
-
],
|
|
80
|
-
const
|
|
81
|
-
const { asChild:
|
|
82
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u
|
|
87
|
+
], N = R.reduce((t, o) => {
|
|
88
|
+
const n = /* @__PURE__ */ g(`Primitive.${o}`), i = a.forwardRef((r, e) => {
|
|
89
|
+
const { asChild: l, ...s } = r, u = l ? n : o;
|
|
90
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(u, { ...s, ref: e });
|
|
83
91
|
});
|
|
84
|
-
return
|
|
85
|
-
}, {}),
|
|
86
|
-
|
|
92
|
+
return i.displayName = `Primitive.${o}`, { ...t, [o]: i };
|
|
93
|
+
}, {}), P = "Label", h = a.forwardRef((t, o) => /* @__PURE__ */ f(
|
|
94
|
+
N.label,
|
|
87
95
|
{
|
|
88
|
-
...
|
|
89
|
-
ref:
|
|
90
|
-
onMouseDown: (
|
|
91
|
-
var
|
|
92
|
-
|
|
96
|
+
...t,
|
|
97
|
+
ref: o,
|
|
98
|
+
onMouseDown: (n) => {
|
|
99
|
+
var r;
|
|
100
|
+
n.target.closest("button, input, select, textarea") || ((r = t.onMouseDown) == null || r.call(t, n), !n.defaultPrevented && n.detail > 1 && n.preventDefault());
|
|
93
101
|
}
|
|
94
102
|
}
|
|
95
103
|
));
|
|
96
|
-
h.displayName =
|
|
97
|
-
var
|
|
98
|
-
function
|
|
99
|
-
return
|
|
104
|
+
h.displayName = P;
|
|
105
|
+
var O = h;
|
|
106
|
+
function j(t) {
|
|
107
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
100
108
|
}
|
|
101
|
-
var
|
|
109
|
+
var p = { exports: {} };
|
|
102
110
|
/*!
|
|
103
111
|
Copyright (c) 2018 Jed Watson.
|
|
104
112
|
Licensed under the MIT License (MIT), see
|
|
105
113
|
http://jedwatson.github.io/classnames
|
|
106
114
|
*/
|
|
107
|
-
var
|
|
108
|
-
function
|
|
109
|
-
return
|
|
115
|
+
var y;
|
|
116
|
+
function D() {
|
|
117
|
+
return y || (y = 1, (function(t) {
|
|
110
118
|
(function() {
|
|
111
|
-
var
|
|
112
|
-
function
|
|
113
|
-
for (var
|
|
114
|
-
var
|
|
115
|
-
|
|
119
|
+
var o = {}.hasOwnProperty;
|
|
120
|
+
function n() {
|
|
121
|
+
for (var e = "", l = 0; l < arguments.length; l++) {
|
|
122
|
+
var s = arguments[l];
|
|
123
|
+
s && (e = r(e, i.call(this, s)));
|
|
116
124
|
}
|
|
117
|
-
return
|
|
125
|
+
return e;
|
|
118
126
|
}
|
|
119
|
-
function
|
|
120
|
-
if (typeof
|
|
121
|
-
return this && this[
|
|
122
|
-
if (typeof
|
|
127
|
+
function i(e) {
|
|
128
|
+
if (typeof e == "string" || typeof e == "number")
|
|
129
|
+
return this && this[e] || e;
|
|
130
|
+
if (typeof e != "object")
|
|
123
131
|
return "";
|
|
124
|
-
if (Array.isArray(
|
|
125
|
-
return
|
|
126
|
-
if (
|
|
127
|
-
return
|
|
132
|
+
if (Array.isArray(e))
|
|
133
|
+
return n.apply(this, e);
|
|
134
|
+
if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
|
|
135
|
+
return e.toString();
|
|
128
136
|
var l = "";
|
|
129
|
-
for (var
|
|
130
|
-
|
|
137
|
+
for (var s in e)
|
|
138
|
+
o.call(e, s) && e[s] && (l = r(l, this && this[s] || s));
|
|
131
139
|
return l;
|
|
132
140
|
}
|
|
133
|
-
function
|
|
134
|
-
return l ?
|
|
141
|
+
function r(e, l) {
|
|
142
|
+
return l ? e ? e + " " + l : e + l : e;
|
|
135
143
|
}
|
|
136
|
-
|
|
144
|
+
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
137
145
|
})();
|
|
138
|
-
}(
|
|
146
|
+
})(p)), p.exports;
|
|
139
147
|
}
|
|
140
|
-
var
|
|
141
|
-
const
|
|
148
|
+
var A = D();
|
|
149
|
+
const V = /* @__PURE__ */ j(A), $ = {
|
|
142
150
|
"purpur-label": "_purpur-label_1x80u_1",
|
|
143
151
|
"purpur-label--negative": "_purpur-label--negative_1x80u_8",
|
|
144
152
|
"purpur-label--disabled": "_purpur-label--disabled_1x80u_11"
|
|
145
|
-
},
|
|
146
|
-
children:
|
|
147
|
-
className:
|
|
148
|
-
disabled:
|
|
149
|
-
negative:
|
|
150
|
-
...
|
|
153
|
+
}, I = V.bind($), d = "purpur-label", B = ({
|
|
154
|
+
children: t,
|
|
155
|
+
className: o,
|
|
156
|
+
disabled: n,
|
|
157
|
+
negative: i = !1,
|
|
158
|
+
...r
|
|
151
159
|
}) => {
|
|
152
|
-
const
|
|
153
|
-
[`${
|
|
154
|
-
[`${
|
|
160
|
+
const e = I(o, d, {
|
|
161
|
+
[`${d}--disabled`]: n,
|
|
162
|
+
[`${d}--negative`]: i
|
|
155
163
|
});
|
|
156
|
-
return /* @__PURE__ */
|
|
164
|
+
return /* @__PURE__ */ f(O, { className: e, ...r, children: t });
|
|
157
165
|
};
|
|
158
166
|
export {
|
|
159
|
-
|
|
167
|
+
B as Label
|
|
160
168
|
};
|
|
161
169
|
//# sourceMappingURL=label.es.js.map
|
package/dist/label.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.es.js","sources":["../../../common/temp/node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.1_@types+react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-slot@1.1.2_@types+react@19.0.10_react@19.0.0/node_modules/@radix-ui/react-slot/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-primitive@2.0.2_@types+react-dom@19.0.4_@types+react@19.0.10_react-dom@19.0.0_react@19.0.0/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-label@2.1.2_@types+react-dom@19.0.4_@types+react@19.0.10_react-dom@19.0.0_react@19.0.0/node_modules/@radix-ui/react-label/dist/index.mjs","../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/label.tsx"],"sourcesContent":["// packages/react/compose-refs/src/composeRefs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/slot/src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\nvar Slot = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n});\nSlot.displayName = \"Slot\";\nvar SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n});\nSlotClone.displayName = \"SlotClone\";\nvar Slottable = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n};\nfunction isSlottable(child) {\n return React.isValidElement(child) && child.type === Slottable;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n childPropValue(...args);\n slotPropValue(...args);\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Slot;\nexport {\n Root,\n Slot,\n Slottable\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/primitive/src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// packages/react/label/src/label.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Label\";\nvar Label = React.forwardRef((props, forwardedRef) => {\n return /* @__PURE__ */ jsx(\n Primitive.label,\n {\n ...props,\n ref: forwardedRef,\n onMouseDown: (event) => {\n const target = event.target;\n if (target.closest(\"button, input, select, textarea\")) return;\n props.onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault();\n }\n }\n );\n});\nLabel.displayName = NAME;\nvar Root = Label;\nexport {\n Label,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport * as RadixLabel from \"@radix-ui/react-label\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./label.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-label\";\n\nexport type LabelProps = Omit<BaseProps<\"label\">, \"children\"> & {\n children: ReactNode;\n disabled?: boolean;\n negative?: boolean;\n};\n\nexport const Label = ({\n children,\n className,\n disabled,\n negative = false,\n ...props\n}: LabelProps) => {\n const classes = cx(className, rootClassName, {\n [`${rootClassName}--disabled`]: disabled,\n [`${rootClassName}--negative`]: negative,\n });\n\n return (\n <RadixLabel.Root className={classes} {...props}>\n {children}\n </RadixLabel.Root>\n );\n};\n"],"names":["setRef","ref","value","composeRefs","refs","node","hasCleanup","cleanups","cleanup","Slot","React","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","SlotClone","childrenRef","getElementRef","props2","mergeProps","Slottable","Fragment2","childProps","overrideProps","propName","slotPropValue","childPropValue","args","element","getter","_a","mayWarn","_b","NODES","Primitive","primitive","Node","asChild","primitiveProps","Comp","NAME","Label","event","Root","hasOwn","classNames","classes","i","arg","appendClass","parseValue","key","newClass","module","cx","c","styles","rootClassName","className","disabled","negative","RadixLabel.Root"],"mappings":";;;AAEA,SAASA,EAAOC,GAAKC,GAAO;AAC1B,MAAI,OAAOD,KAAQ;AACjB,WAAOA,EAAIC,CAAK;AACX,EAAID,KAAQ,SACjBA,EAAI,UAAUC;AAElB;AACA,SAASC,KAAeC,GAAM;AAC5B,SAAO,CAACC,MAAS;AACf,QAAIC,IAAa;AACjB,UAAMC,IAAWH,EAAK,IAAI,CAACH,MAAQ;AACjC,YAAMO,IAAUR,EAAOC,GAAKI,CAAI;AAChC,aAAI,CAACC,KAAc,OAAOE,KAAW,eACnCF,IAAa,KAERE;AAAA,IACb,CAAK;AACD,QAAIF;AACF,aAAO,MAAM;AACX,iBAAS,IAAI,GAAG,IAAIC,EAAS,QAAQ,KAAK;AACxC,gBAAMC,IAAUD,EAAS,CAAC;AAC1B,UAAI,OAAOC,KAAW,aACpBA,EAA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
|
1
|
+
{"version":3,"file":"label.es.js","sources":["../../../common/temp/node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.1.16_react@19.1.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.1.16_react@19.1.1/node_modules/@radix-ui/react-slot/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.1.9_@types+react@19.1.16_react-dom@19.1.1_react@19.1.1/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-label@2.1.7_@types+react-dom@19.1.9_@types+react@19.1.16_react-dom@19.1.1_react@19.1.1/node_modules/@radix-ui/react-label/dist/index.mjs","../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/label.tsx"],"sourcesContent":["// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/label.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NAME = \"Label\";\nvar Label = React.forwardRef((props, forwardedRef) => {\n return /* @__PURE__ */ jsx(\n Primitive.label,\n {\n ...props,\n ref: forwardedRef,\n onMouseDown: (event) => {\n const target = event.target;\n if (target.closest(\"button, input, select, textarea\")) return;\n props.onMouseDown?.(event);\n if (!event.defaultPrevented && event.detail > 1) event.preventDefault();\n }\n }\n );\n});\nLabel.displayName = NAME;\nvar Root = Label;\nexport {\n Label,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport * as RadixLabel from \"@radix-ui/react-label\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./label.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-label\";\n\nexport type LabelProps = Omit<BaseProps<\"label\">, \"children\"> & {\n children: ReactNode;\n disabled?: boolean;\n negative?: boolean;\n};\n\nexport const Label = ({\n children,\n className,\n disabled,\n negative = false,\n ...props\n}: LabelProps) => {\n const classes = cx(className, rootClassName, {\n [`${rootClassName}--disabled`]: disabled,\n [`${rootClassName}--negative`]: negative,\n });\n\n return (\n <RadixLabel.Root className={classes} {...props}>\n {children}\n </RadixLabel.Root>\n );\n};\n"],"names":["setRef","ref","value","composeRefs","refs","node","hasCleanup","cleanups","cleanup","i","createSlot","ownerName","SlotClone","createSlotClone","Slot2","React","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","childrenRef","getElementRef","props2","mergeProps","SLOTTABLE_IDENTIFIER","childProps","overrideProps","propName","slotPropValue","childPropValue","args","result","element","getter","_a","mayWarn","_b","NODES","Primitive","primitive","Slot","Node","asChild","primitiveProps","Comp","NAME","Label","event","Root","hasOwn","classNames","classes","arg","appendClass","parseValue","key","newClass","module","cx","c","styles","rootClassName","className","disabled","negative","RadixLabel.Root"],"mappings":";;;AAEA,SAASA,EAAOC,GAAKC,GAAO;AAC1B,MAAI,OAAOD,KAAQ;AACjB,WAAOA,EAAIC,CAAK;AACX,EAAID,KAAQ,SACjBA,EAAI,UAAUC;AAElB;AACA,SAASC,KAAeC,GAAM;AAC5B,SAAO,CAACC,MAAS;AACf,QAAIC,IAAa;AACjB,UAAMC,IAAWH,EAAK,IAAI,CAACH,MAAQ;AACjC,YAAMO,IAAUR,EAAOC,GAAKI,CAAI;AAChC,aAAI,CAACC,KAAc,OAAOE,KAAW,eACnCF,IAAa,KAERE;AAAA,IACT,CAAC;AACD,QAAIF;AACF,aAAO,MAAM;AACX,iBAASG,IAAI,GAAGA,IAAIF,EAAS,QAAQE,KAAK;AACxC,gBAAMD,IAAUD,EAASE,CAAC;AAC1B,UAAI,OAAOD,KAAW,aACpBA,EAAO,IAEPR,EAAOI,EAAKK,CAAC,GAAG,IAAI;AAAA,QAExB;AAAA,MACF;AAAA,EAEJ;AACF;AAAA;AC3BA,SAASC,EAAWC,GAAW;AAC7B,QAAMC,IAA4B,gBAAAC,EAAgBF,CAAS,GACrDG,IAAQC,EAAM,WAAW,CAACC,GAAOC,MAAiB;AACtD,UAAM,EAAE,UAAAC,GAAU,GAAGC,EAAS,IAAKH,GAC7BI,IAAgBL,EAAM,SAAS,QAAQG,CAAQ,GAC/CG,IAAYD,EAAc,KAAKE,CAAW;AAChD,QAAID,GAAW;AACb,YAAME,IAAaF,EAAU,MAAM,UAC7BG,IAAcJ,EAAc,IAAI,CAACK,MACjCA,MAAUJ,IACRN,EAAM,SAAS,MAAMQ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QA,CAAG;AACpB,iBAAOF,EAAW,MAAM,MAAME,CAAG;AAGlC,YAAIA,EAAI,aAAa,OAAO,UAAU,YAAY,CAACA,EAAI,SAAS,SAAQ,EAAG,SAAS,eAAe;AAClG,iBAAOA,EAAI,SAAQ;AAGpB,YAAID,IAAU;AAEd,iBAASI,KAAOH;AACf,UAAIH,EAAO,KAAKG,GAAKG,CAAG,KAAKH,EAAIG,CAAG,MACnCJ,IAAUE,EAAYF,GAAS,QAAQ,KAAKI,CAAG,KAAKA,CAAG;AAIzD,eAAOJ;AAAA,MACT;AAEC,eAASE,EAAa1D,GAAO6D,GAAU;AACtC,eAAKA,IAID7D,IACIA,IAAQ,MAAM6D,IAGf7D,IAAQ6D,IAPP7D;AAAA,MAQV;AAEC,MAAqC8D,EAAO,WAC3CP,EAAW,UAAUA,GACrBO,YAAiBP,KAOjB,OAAO,aAAaA;AAAA,IAEtB;;;;;;;;GCrEMQ,IAAKC,EAAE,KAAKC,CAAM,GAElBC,IAAgB,gBAQTf,IAAQ,CAAC;AAAA,EACpB,UAAAnC;AAAA,EACA,WAAAmD;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,GAAGvD;AACL,MAAkB;AAChB,QAAM0C,IAAUO,EAAGI,GAAWD,GAAe;AAAA,IAC3C,CAAC,GAAGA,CAAa,YAAY,GAAGE;AAAA,IAChC,CAAC,GAAGF,CAAa,YAAY,GAAGG;AAAA,EAAA,CACjC;AAED,SACE,gBAAA7C,EAAC8C,GAAA,EAAgB,WAAWd,GAAU,GAAG1C,GACtC,UAAAE,GACH;AAEJ;","x_google_ignoreList":[0,1,2,3,4]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpurds/label",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.4",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "./dist/label.cjs.js",
|
|
6
6
|
"types": "./dist/label.d.ts",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@radix-ui/react-label": "~2.1.2",
|
|
19
19
|
"classnames": "~2.5.0",
|
|
20
|
-
"@purpurds/icon": "8.2.
|
|
21
|
-
"@purpurds/tokens": "8.2.
|
|
22
|
-
"@purpurds/common-types": "8.2.
|
|
20
|
+
"@purpurds/icon": "8.2.4",
|
|
21
|
+
"@purpurds/tokens": "8.2.4",
|
|
22
|
+
"@purpurds/common-types": "8.2.4"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@storybook/react-vite": "^9.0.18",
|