@purpurds/label 8.12.1 → 8.13.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.
- package/dist/LICENSE.txt +3 -3
- package/dist/label.cjs.js +1 -1
- package/dist/label.cjs.js.map +1 -1
- package/dist/label.es.js +43 -52
- package/dist/label.es.js.map +1 -1
- package/package.json +7 -7
package/dist/LICENSE.txt
CHANGED
|
@@ -8,7 +8,7 @@ Homepage: https://radix-ui.com/primitives
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
Name: @radix-ui/react-slot
|
|
11
|
-
Version: 1.2.
|
|
11
|
+
Version: 1.2.3
|
|
12
12
|
License: MIT
|
|
13
13
|
Private: false
|
|
14
14
|
Repository: git+https://github.com/radix-ui/primitives.git
|
|
@@ -41,7 +41,7 @@ SOFTWARE.
|
|
|
41
41
|
---
|
|
42
42
|
|
|
43
43
|
Name: @radix-ui/react-primitive
|
|
44
|
-
Version: 2.1.
|
|
44
|
+
Version: 2.1.3
|
|
45
45
|
License: MIT
|
|
46
46
|
Private: false
|
|
47
47
|
Repository: git+https://github.com/radix-ui/primitives.git
|
|
@@ -74,7 +74,7 @@ SOFTWARE.
|
|
|
74
74
|
---
|
|
75
75
|
|
|
76
76
|
Name: @radix-ui/react-label
|
|
77
|
-
Version: 2.1.
|
|
77
|
+
Version: 2.1.7
|
|
78
78
|
License: MIT
|
|
79
79
|
Private: false
|
|
80
80
|
Repository: git+https://github.com/radix-ui/primitives.git
|
package/dist/label.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),
|
|
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){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=n&&"isReactWarning"in n&&n.isReactWarning;return r?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.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=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(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:{}};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;
|
|
2
2
|
//# 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.2_@types+react@19.2.6_react@19.2.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@19.2.6_react@19.2.1/node_modules/@radix-ui/react-slot/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-primitive@2.1.4_@types+react-dom@19.2.3_@types+react@19.2.6_react-dom@19.2.1_react@19.2.1/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-label@2.1.8_@types+react-dom@19.2.3_@types+react@19.2.6_react-dom@19.2.1_react@19.2.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\";\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nvar use = React[\" use \".trim().toString()];\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\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 let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\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","REACT_LAZY_TYPE","use","React","isPromiseLike","isLazyComponent","element","createSlot","ownerName","SlotClone","createSlotClone","Slot2","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","childrenRef","getElementRef","props2","mergeProps","SLOTTABLE_IDENTIFIER","childProps","overrideProps","propName","slotPropValue","childPropValue","args","result","getter","mayWarn","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,CAExB,CACF,CAEJ,CACF,CC5BA,IAAIC,EAAkB,OAAO,IAAI,YAAY,EACzCC,EAAMC,EAAM,QAAQ,KAAI,EAAG,SAAQ,CAAE,EACzC,SAASC,EAAcX,EAAO,CAC5B,OAAO,OAAOA,GAAU,UAAYA,IAAU,MAAQ,SAAUA,CAClE,CACA,SA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AE,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.2.6_react@19.2.3/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.2.6_react@19.2.3/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.2.3_@types+react@19.2.6_react-dom@19.2.3_react@19.2.3/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.2.3_@types+react@19.2.6_react-dom@19.2.3_react@19.2.3/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","mayWarn","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,CAExB,CACF,CAEJ,CACF,CC3BA,SAASC,EAAWC,EAAW,CAC7B,MAAMC,EAA4BC,EAAgBF,CAAS,EACrDG,EAAQC,EAAM,WAAW,CAACC,EAAOC,IAAiB,CACtD,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,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ACtC,OAAKA,EAID3D,EACIA,EAAQ,IAAM2D,EAGf3D,EAAQ2D,EAPP3D,CAQV,CAEsC4D,EAAO,SAC3CP,EAAW,QAAUA,EACrBO,UAAiBP,GAOjB,OAAO,WAAaA,CAEtB,8MCrEMQ,EAAKC,EAAE,KAAKC,CAAM,EAElBC,EAAgB,eAQTf,EAAQ,CAAC,CACpB,SAAAjC,EACA,UAAAiD,EACA,SAAAC,EACA,SAAAC,EAAW,GACX,GAAGrD,CACL,IAAkB,CAChB,MAAMwC,EAAUO,EAAGI,EAAWD,EAAe,CAC3C,CAAC,GAAGA,CAAa,YAAY,EAAGE,EAChC,CAAC,GAAGF,CAAa,YAAY,EAAGG,CAAA,CACjC,EAED,OACE3C,EAAAA,IAAC4C,EAAA,CAAgB,UAAWd,EAAU,GAAGxC,EACtC,SAAAE,EACH,CAEJ","x_google_ignoreList":[0,1,2,3,4]}
|
package/dist/label.es.js
CHANGED
|
@@ -1,65 +1,56 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
function
|
|
4
|
+
function b(t, n) {
|
|
5
5
|
if (typeof t == "function")
|
|
6
6
|
return t(n);
|
|
7
7
|
t != null && (t.current = n);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function S(...t) {
|
|
10
10
|
return (n) => {
|
|
11
11
|
let r = !1;
|
|
12
12
|
const i = t.map((o) => {
|
|
13
|
-
const e =
|
|
13
|
+
const e = b(o, n);
|
|
14
14
|
return !r && typeof e == "function" && (r = !0), e;
|
|
15
15
|
});
|
|
16
16
|
if (r)
|
|
17
17
|
return () => {
|
|
18
18
|
for (let o = 0; o < i.length; o++) {
|
|
19
19
|
const e = i[o];
|
|
20
|
-
typeof e == "function" ? e() :
|
|
20
|
+
typeof e == "function" ? e() : b(t[o], null);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
var E = Symbol.for("react.lazy"), c = a[" use ".trim().toString()];
|
|
26
|
-
function C(t) {
|
|
27
|
-
return typeof t == "object" && t !== null && "then" in t;
|
|
28
|
-
}
|
|
29
|
-
function v(t) {
|
|
30
|
-
return t != null && typeof t == "object" && "$$typeof" in t && t.$$typeof === E && "_payload" in t && C(t._payload);
|
|
31
|
-
}
|
|
32
25
|
// @__NO_SIDE_EFFECTS__
|
|
33
|
-
function
|
|
34
|
-
const n = /* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
v(e) && typeof c == "function" && (e = c(e._payload));
|
|
37
|
-
const s = a.Children.toArray(e), u = s.find(P);
|
|
26
|
+
function g(t) {
|
|
27
|
+
const n = /* @__PURE__ */ _(t), r = a.forwardRef((i, o) => {
|
|
28
|
+
const { children: e, ...l } = i, s = a.Children.toArray(e), u = s.find(w);
|
|
38
29
|
if (u) {
|
|
39
|
-
const
|
|
40
|
-
return /* @__PURE__ */
|
|
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(n, { ...l, ref: o, children: a.isValidElement(c) ? a.cloneElement(c, void 0, v) : null });
|
|
41
32
|
}
|
|
42
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ f(n, { ...l, ref: o, children: e });
|
|
43
34
|
});
|
|
44
35
|
return r.displayName = `${t}.Slot`, r;
|
|
45
36
|
}
|
|
46
37
|
// @__NO_SIDE_EFFECTS__
|
|
47
|
-
function
|
|
38
|
+
function _(t) {
|
|
48
39
|
const n = a.forwardRef((r, i) => {
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
const l =
|
|
52
|
-
return o.type !== a.Fragment && (s.ref = i ?
|
|
40
|
+
const { children: o, ...e } = r;
|
|
41
|
+
if (a.isValidElement(o)) {
|
|
42
|
+
const l = C(o), s = x(e, o.props);
|
|
43
|
+
return o.type !== a.Fragment && (s.ref = i ? S(i, l) : l), a.cloneElement(o, s);
|
|
53
44
|
}
|
|
54
45
|
return a.Children.count(o) > 1 ? a.Children.only(null) : null;
|
|
55
46
|
});
|
|
56
47
|
return n.displayName = `${t}.SlotClone`, n;
|
|
57
48
|
}
|
|
58
|
-
var
|
|
59
|
-
function
|
|
60
|
-
return a.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId ===
|
|
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;
|
|
61
52
|
}
|
|
62
|
-
function
|
|
53
|
+
function x(t, n) {
|
|
63
54
|
const r = { ...n };
|
|
64
55
|
for (const i in n) {
|
|
65
56
|
const o = t[i], e = n[i];
|
|
@@ -70,11 +61,11 @@ function N(t, n) {
|
|
|
70
61
|
}
|
|
71
62
|
return { ...t, ...r };
|
|
72
63
|
}
|
|
73
|
-
function
|
|
64
|
+
function C(t) {
|
|
74
65
|
let n = Object.getOwnPropertyDescriptor(t.props, "ref")?.get, r = n && "isReactWarning" in n && n.isReactWarning;
|
|
75
66
|
return r ? t.ref : (n = Object.getOwnPropertyDescriptor(t, "ref")?.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? t.props.ref : t.props.ref || t.ref);
|
|
76
67
|
}
|
|
77
|
-
var
|
|
68
|
+
var R = [
|
|
78
69
|
"a",
|
|
79
70
|
"button",
|
|
80
71
|
"div",
|
|
@@ -92,14 +83,14 @@ var $ = [
|
|
|
92
83
|
"span",
|
|
93
84
|
"svg",
|
|
94
85
|
"ul"
|
|
95
|
-
],
|
|
96
|
-
const r = /* @__PURE__ */
|
|
86
|
+
], N = R.reduce((t, n) => {
|
|
87
|
+
const r = /* @__PURE__ */ g(`Primitive.${n}`), i = a.forwardRef((o, e) => {
|
|
97
88
|
const { asChild: l, ...s } = o, u = l ? r : n;
|
|
98
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */
|
|
89
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(u, { ...s, ref: e });
|
|
99
90
|
});
|
|
100
91
|
return i.displayName = `Primitive.${n}`, { ...t, [n]: i };
|
|
101
|
-
}, {}),
|
|
102
|
-
|
|
92
|
+
}, {}), P = "Label", h = a.forwardRef((t, n) => /* @__PURE__ */ f(
|
|
93
|
+
N.label,
|
|
103
94
|
{
|
|
104
95
|
...t,
|
|
105
96
|
ref: n,
|
|
@@ -108,15 +99,15 @@ var $ = [
|
|
|
108
99
|
}
|
|
109
100
|
}
|
|
110
101
|
));
|
|
111
|
-
|
|
112
|
-
var
|
|
113
|
-
function
|
|
102
|
+
h.displayName = P;
|
|
103
|
+
var O = h;
|
|
104
|
+
function j(t) {
|
|
114
105
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
115
106
|
}
|
|
116
|
-
var
|
|
117
|
-
var
|
|
118
|
-
function
|
|
119
|
-
return
|
|
107
|
+
var p = { exports: {} };
|
|
108
|
+
var y;
|
|
109
|
+
function D() {
|
|
110
|
+
return y || (y = 1, (function(t) {
|
|
120
111
|
(function() {
|
|
121
112
|
var n = {}.hasOwnProperty;
|
|
122
113
|
function r() {
|
|
@@ -145,27 +136,27 @@ function V() {
|
|
|
145
136
|
}
|
|
146
137
|
t.exports ? (r.default = r, t.exports = r) : window.classNames = r;
|
|
147
138
|
})();
|
|
148
|
-
})(
|
|
139
|
+
})(p)), p.exports;
|
|
149
140
|
}
|
|
150
|
-
var
|
|
151
|
-
const
|
|
141
|
+
var A = D();
|
|
142
|
+
const V = /* @__PURE__ */ j(A), $ = {
|
|
152
143
|
"purpur-label": "_purpur-label_1x80u_1",
|
|
153
144
|
"purpur-label--negative": "_purpur-label--negative_1x80u_8",
|
|
154
145
|
"purpur-label--disabled": "_purpur-label--disabled_1x80u_11"
|
|
155
|
-
},
|
|
146
|
+
}, I = V.bind($), d = "purpur-label", B = ({
|
|
156
147
|
children: t,
|
|
157
148
|
className: n,
|
|
158
149
|
disabled: r,
|
|
159
150
|
negative: i = !1,
|
|
160
151
|
...o
|
|
161
152
|
}) => {
|
|
162
|
-
const e =
|
|
163
|
-
[`${
|
|
164
|
-
[`${
|
|
153
|
+
const e = I(n, d, {
|
|
154
|
+
[`${d}--disabled`]: r,
|
|
155
|
+
[`${d}--negative`]: i
|
|
165
156
|
});
|
|
166
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ f(O, { className: e, ...o, children: t });
|
|
167
158
|
};
|
|
168
159
|
export {
|
|
169
|
-
|
|
160
|
+
B as Label
|
|
170
161
|
};
|
|
171
162
|
//# 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.2_@types+react@19.2.6_react@19.2.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@19.2.6_react@19.2.1/node_modules/@radix-ui/react-slot/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-primitive@2.1.4_@types+react-dom@19.2.3_@types+react@19.2.6_react-dom@19.2.1_react@19.2.1/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../common/temp/node_modules/.pnpm/@radix-ui+react-label@2.1.8_@types+react-dom@19.2.3_@types+react@19.2.6_react-dom@19.2.1_react@19.2.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\";\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nvar use = React[\" use \".trim().toString()];\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\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 let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\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","REACT_LAZY_TYPE","use","React","isPromiseLike","isLazyComponent","element","createSlot","ownerName","SlotClone","createSlotClone","Slot2","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","childrenRef","getElementRef","props2","mergeProps","SLOTTABLE_IDENTIFIER","childProps","overrideProps","propName","slotPropValue","childPropValue","args","result","getter","mayWarn","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,CAA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QAAQ,KAAKA,CAAG,KAAKA;AAG7B,YAAI,OAAOA,KAAQ;AAClB,iBAAO;AAGR,YAAI,MAAM,QAAQA,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,EAAa5D,GAAO+D,GAAU;AACtC,eAAKA,IAID/D,IACIA,IAAQ,MAAM+D,IAGf/D,IAAQ+D,IAPP/D;AAAA,MAQV;AAEC,MAAqCgE,EAAO,WAC3CP,EAAW,UAAUA,GACrBO,YAAiBP,KAOjB,OAAO,aAAaA;AAAA,IAEtB;;;;;;;;GCrEMQ,IAAKC,EAAE,KAAKC,CAAM,GAElBC,IAAgB,gBAQTf,IAAQ,CAAC;AAAA,EACpB,UAAAhC;AAAA,EACA,WAAAgD;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,GAAGpD;AACL,MAAkB;AAChB,QAAMuC,IAAUO,EAAGI,GAAWD,GAAe;AAAA,IAC3C,CAAC,GAAGA,CAAa,YAAY,GAAGE;AAAA,IAChC,CAAC,GAAGF,CAAa,YAAY,GAAGG;AAAA,EAAA,CACjC;AAED,SACE,gBAAA1C,EAAC2C,GAAA,EAAgB,WAAWd,GAAU,GAAGvC,GACtC,UAAAE,GACH;AAEJ;","x_google_ignoreList":[0,1,2,3,4]}
|
|
1
|
+
{"version":3,"file":"label.es.js","sources":["../../../common/temp/node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.2.6_react@19.2.3/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.2.6_react@19.2.3/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.2.3_@types+react@19.2.6_react-dom@19.2.3_react@19.2.3/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.2.3_@types+react@19.2.6_react-dom@19.2.3_react@19.2.3/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","mayWarn","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,CAAU,IAAI,IAAUR,EAAM,SAAS,KAAK,IAAI,IAClEA,EAAM,eAAeQ,CAAU,IAAIA,EAAW,MAAM,WAAW,OAE/DE,CAEV;AACD,aAAuB,gB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H,EAAO,KAAKG,GAAKG,CAAG,KAAKH,EAAIG,CAAG,MACnCJ,IAAUE,EAAYF,GAAS,QAAQ,KAAKI,CAAG,KAAKA,CAAG;AAIzD,eAAOJ;AAAA,MACT;AAEC,eAASE,EAAaxD,GAAO2D,GAAU;AACtC,eAAKA,IAID3D,IACIA,IAAQ,MAAM2D,IAGf3D,IAAQ2D,IAPP3D;AAAA,MAQV;AAEC,MAAqC4D,EAAO,WAC3CP,EAAW,UAAUA,GACrBO,YAAiBP,KAOjB,OAAO,aAAaA;AAAA,IAEtB;;;;;;;;GCrEMQ,IAAKC,EAAE,KAAKC,CAAM,GAElBC,IAAgB,gBAQTf,IAAQ,CAAC;AAAA,EACpB,UAAAjC;AAAA,EACA,WAAAiD;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,GAAGrD;AACL,MAAkB;AAChB,QAAMwC,IAAUO,EAAGI,GAAWD,GAAe;AAAA,IAC3C,CAAC,GAAGA,CAAa,YAAY,GAAGE;AAAA,IAChC,CAAC,GAAGF,CAAa,YAAY,GAAGG;AAAA,EAAA,CACjC;AAED,SACE,gBAAA3C,EAAC4C,GAAA,EAAgB,WAAWd,GAAU,GAAGxC,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.
|
|
3
|
+
"version": "8.13.0",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "./dist/label.cjs.js",
|
|
6
6
|
"types": "./dist/label.d.ts",
|
|
@@ -17,25 +17,25 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@radix-ui/react-label": "~2.1.2",
|
|
19
19
|
"classnames": "~2.5.1",
|
|
20
|
-
"@purpurds/
|
|
21
|
-
"@purpurds/icon": "8.
|
|
22
|
-
"@purpurds/
|
|
20
|
+
"@purpurds/common-types": "8.13.0",
|
|
21
|
+
"@purpurds/icon": "8.13.0",
|
|
22
|
+
"@purpurds/tokens": "8.13.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@storybook/react-vite": "
|
|
25
|
+
"@storybook/react-vite": "10.1.11",
|
|
26
26
|
"@testing-library/dom": "~10.4.1",
|
|
27
27
|
"@testing-library/jest-dom": "~6.9.1",
|
|
28
28
|
"@testing-library/react": "~16.3.0",
|
|
29
29
|
"@types/node": "22.17",
|
|
30
30
|
"@types/react-dom": "^19.2.3",
|
|
31
31
|
"@types/react": "^19.2.6",
|
|
32
|
-
"eslint": "9.39.
|
|
32
|
+
"eslint": "9.39.2",
|
|
33
33
|
"jsdom": "~27.2.0",
|
|
34
34
|
"lint-staged": "16.2.6",
|
|
35
35
|
"prettier": "~2.8.8",
|
|
36
36
|
"react-dom": "^19.2.1",
|
|
37
37
|
"react": "^19.2.1",
|
|
38
|
-
"storybook": "
|
|
38
|
+
"storybook": "10.1.11",
|
|
39
39
|
"typescript": "^5.9.3",
|
|
40
40
|
"vite": "^7.2.2",
|
|
41
41
|
"vitest": "^4.0.10",
|