@sakura-ui/forms 0.0.3 → 0.0.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/index.cjs.js +21 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +441 -466
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react");var n={},vr={get exports(){return n},set exports(l){n=l}},A={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var je;function mr(){if(je)return A;je=1;var l=g,f=Symbol.for("react.element"),h=Symbol.for("react.fragment"),p=Object.prototype.hasOwnProperty,o=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function v(d,u,w){var x,_={},P=null,W=null;w!==void 0&&(P=""+w),u.key!==void 0&&(P=""+u.key),u.ref!==void 0&&(W=u.ref);for(x in u)p.call(u,x)&&!a.hasOwnProperty(x)&&(_[x]=u[x]);if(d&&d.defaultProps)for(x in u=d.defaultProps,u)_[x]===void 0&&(_[x]=u[x]);return{$$typeof:f,type:d,key:P,ref:W,props:_,_owner:o.current}}return A.Fragment=h,A.jsx=v,A.jsxs=v,A}var q={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,23 +14,23 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),R=
|
|
21
|
-
`+
|
|
17
|
+
*/var Ce;function hr(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var l=g,f=Symbol.for("react.element"),h=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),d=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),W=Symbol.for("react.offscreen"),re=Symbol.iterator,ke="@@iterator";function Fe(e){if(e===null||typeof e!="object")return null;var r=re&&e[re]||e[ke];return typeof r=="function"?r:null}var k=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),s=1;s<r;s++)t[s-1]=arguments[s];De("error",e,t)}}function De(e,r,t){{var s=k.ReactDebugCurrentFrame,m=s.getStackAddendum();m!==""&&(r+="%s",t=t.concat([m]));var b=t.map(function(c){return String(c)});b.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,b)}}var Me=!1,$e=!1,Ae=!1,qe=!1,We=!1,te;te=Symbol.for("react.module.reference");function Ye(e){return!!(typeof e=="string"||typeof e=="function"||e===p||e===a||We||e===o||e===w||e===x||qe||e===W||Me||$e||Ae||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===_||e.$$typeof===v||e.$$typeof===d||e.$$typeof===u||e.$$typeof===te||e.getModuleId!==void 0))}function Le(e,r,t){var s=e.displayName;if(s)return s;var m=r.displayName||r.name||"";return m!==""?t+"("+m+")":t}function ne(e){return e.displayName||"Context"}function S(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case h:return"Portal";case a:return"Profiler";case o:return"StrictMode";case w:return"Suspense";case x:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return ne(r)+".Consumer";case v:var t=e;return ne(t._context)+".Provider";case u:return Le(e,e.render,"ForwardRef");case _:var s=e.displayName||null;return s!==null?s:S(e.type)||"Memo";case P:{var m=e,b=m._payload,c=m._init;try{return S(c(b))}catch{return null}}}return null}var O=Object.assign,M=0,ae,se,oe,ie,le,ue,ce;function de(){}de.__reactDisabledLog=!0;function Ve(){{if(M===0){ae=console.log,se=console.info,oe=console.warn,ie=console.error,le=console.group,ue=console.groupCollapsed,ce=console.groupEnd;var e={configurable:!0,enumerable:!0,value:de,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}}function Ue(){{if(M--,M===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:O({},e,{value:ae}),info:O({},e,{value:se}),warn:O({},e,{value:oe}),error:O({},e,{value:ie}),group:O({},e,{value:le}),groupCollapsed:O({},e,{value:ue}),groupEnd:O({},e,{value:ce})})}M<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=k.ReactCurrentDispatcher,z;function Y(e,r,t){{if(z===void 0)try{throw Error()}catch(m){var s=m.stack.trim().match(/\n( *(at )?)/);z=s&&s[1]||""}return`
|
|
18
|
+
`+z+e}}var K=!1,L;{var Be=typeof WeakMap=="function"?WeakMap:Map;L=new Be}function fe(e,r){if(!e||K)return"";{var t=L.get(e);if(t!==void 0)return t}var s;K=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var b;b=J.current,J.current=null,Ve();try{if(r){var c=function(){throw Error()};if(Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(N){s=N}Reflect.construct(e,[],c)}else{try{c.call()}catch(N){s=N}e.call(c.prototype)}}else{try{throw Error()}catch(N){s=N}e()}}catch(N){if(N&&s&&typeof N.stack=="string"){for(var i=N.stack.split(`
|
|
19
|
+
`),T=s.stack.split(`
|
|
20
|
+
`),R=i.length-1,y=T.length-1;R>=1&&y>=0&&i[R]!==T[y];)y--;for(;R>=1&&y>=0;R--,y--)if(i[R]!==T[y]){if(R!==1||y!==1)do if(R--,y--,y<0||i[R]!==T[y]){var C=`
|
|
21
|
+
`+i[R].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,C),C}while(R>=1&&y>=0);break}}}finally{K=!1,J.current=b,Ue(),Error.prepareStackTrace=m}var D=e?e.displayName||e.name:"",we=D?Y(D):"";return typeof e=="function"&&L.set(e,we),we}function Ge(e,r,t){return fe(e,!1)}function Je(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function V(e,r,t){if(e==null)return"";if(typeof e=="function")return fe(e,Je(e));if(typeof e=="string")return Y(e);switch(e){case w:return Y("Suspense");case x:return Y("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return Ge(e.render);case _:return V(e.type,r,t);case P:{var s=e,m=s._payload,b=s._init;try{return V(b(m),r,t)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,pe={},ve=k.ReactDebugCurrentFrame;function B(e){if(e){var r=e._owner,t=V(e.type,e._source,r?r.type:null);ve.setExtraStackFrame(t)}else ve.setExtraStackFrame(null)}function ze(e,r,t,s,m){{var b=Function.call.bind(U);for(var c in e)if(b(e,c)){var i=void 0;try{if(typeof e[c]!="function"){var T=Error((s||"React class")+": "+t+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}i=e[c](r,c,s,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){i=R}i&&!(i instanceof Error)&&(B(m),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",s||"React class",t,c,typeof i),B(null)),i instanceof Error&&!(i.message in pe)&&(pe[i.message]=!0,B(m),E("Failed %s type: %s",t,i.message),B(null))}}}var Ke=Array.isArray;function H(e){return Ke(e)}function He(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Xe(e){try{return me(e),!1}catch{return!0}}function me(e){return""+e}function he(e){if(Xe(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",He(e)),me(e)}var $=k.ReactCurrentOwner,Ze={key:!0,ref:!0,__self:!0,__source:!0},be,xe,X;X={};function Qe(e){if(U.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function er(e){if(U.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function rr(e,r){if(typeof e.ref=="string"&&$.current&&r&&$.current.stateNode!==r){var t=S($.current.type);X[t]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',S($.current.type),e.ref),X[t]=!0)}}function tr(e,r){{var t=function(){be||(be=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function nr(e,r){{var t=function(){xe||(xe=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var ar=function(e,r,t,s,m,b,c){var i={$$typeof:f,type:e,key:r,ref:t,props:c,_owner:b};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:m}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function sr(e,r,t,s,m){{var b,c={},i=null,T=null;t!==void 0&&(he(t),i=""+t),er(r)&&(he(r.key),i=""+r.key),Qe(r)&&(T=r.ref,rr(r,m));for(b in r)U.call(r,b)&&!Ze.hasOwnProperty(b)&&(c[b]=r[b]);if(e&&e.defaultProps){var R=e.defaultProps;for(b in R)c[b]===void 0&&(c[b]=R[b])}if(i||T){var y=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&tr(c,y),T&&nr(c,y)}return ar(e,i,T,m,s,$.current,c)}}var Z=k.ReactCurrentOwner,ge=k.ReactDebugCurrentFrame;function F(e){if(e){var r=e._owner,t=V(e.type,e._source,r?r.type:null);ge.setExtraStackFrame(t)}else ge.setExtraStackFrame(null)}var Q;Q=!1;function ee(e){return typeof e=="object"&&e!==null&&e.$$typeof===f}function Re(){{if(Z.current){var e=S(Z.current.type);if(e)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+e+"`."}return""}}function or(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+r+":"+t+"."}return""}}var
|
|
25
|
+
Check your code at `+r+":"+t+"."}return""}}var ye={};function ir(e){{var r=Re();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+t+">.")}return r}}function
|
|
28
|
-
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function _e(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ir(r);if(ye[t])return;ye[t]=!0;var s="";e&&e._owner&&e._owner!==Z.current&&(s=" It was passed a child from "+S(e._owner.type)+"."),F(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,s),F(null)}}function Ee(e,r){{if(typeof e!="object")return;if(H(e))for(var t=0;t<e.length;t++){var s=e[t];ee(s)&&_e(s,r)}else if(ee(e))e._store&&(e._store.validated=!0);else if(e){var m=Fe(e);if(typeof m=="function"&&m!==e.entries)for(var b=m.call(e),c;!(c=b.next()).done;)ee(c.value)&&_e(c.value,r)}}}function lr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===_))t=r.propTypes;else return;if(t){var s=S(r);ze(t,e.props,"prop",s,e)}else if(r.PropTypes!==void 0&&!Q){Q=!0;var m=S(r);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",m||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ur(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var s=r[t];if(s!=="children"&&s!=="key"){F(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",s),F(null);break}}e.ref!==null&&(F(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),F(null))}}function Te(e,r,t,s,m,b){{var c=Ye(e);if(!c){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var T=or(m);T?i+=T:i+=Re();var R;e===null?R="null":H(e)?R="array":e!==void 0&&e.$$typeof===f?(R="<"+(S(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,i)}var y=sr(e,r,t,m,b);if(y==null)return y;if(c){var C=r.children;if(C!==void 0)if(s)if(H(C)){for(var D=0;D<C.length;D++)Ee(C[D],e);Object.freeze&&Object.freeze(C)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ee(C,e)}return e===p?ur(y):lr(y),y}}function cr(e,r,t){return Te(e,r,t,!0)}function dr(e,r,t){return Te(e,r,t,!1)}var fr=dr,pr=cr;q.Fragment=p,q.jsx=fr,q.jsxs=pr}()),q}(function(l){process.env.NODE_ENV==="production"?l.exports=mr():l.exports=hr()})(vr);const j=(...l)=>l.filter(Boolean).join(" "),I=g.createContext({helperTextId:"",errorMessageId:"",isInvalid:!1,isRequired:!1}),Pe=g.forwardRef((l,f)=>{const{className:h,children:p,...o}=l,a=g.useContext(I);a.isRequired&&(o.required=!0),a.groupName&&(o.name=a.groupName);const v=`
|
|
28
|
+
flex
|
|
29
|
+
items-center
|
|
29
30
|
text-sm
|
|
30
31
|
cursor-pointer
|
|
31
32
|
py-2
|
|
32
|
-
|
|
33
|
-
`,f=`
|
|
33
|
+
`,d=`
|
|
34
34
|
hidden
|
|
35
35
|
peer
|
|
36
36
|
`,u=`
|
|
@@ -45,13 +45,13 @@ Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(
|
|
|
45
45
|
border-sumi-900
|
|
46
46
|
peer-checked:bg-sea-600
|
|
47
47
|
peer-checked:border-none
|
|
48
|
-
`;return
|
|
49
|
-
|
|
48
|
+
`;return n.jsx("div",{className:"inline-block",children:n.jsxs("label",{htmlFor:o.id,className:j(v,h),children:[n.jsx("input",{className:d,type:"checkbox","aria-describedby":a.helperTextId,"aria-errormessage":a.errorMessageId,...o,ref:f}),n.jsx("span",{className:u,children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",children:n.jsx("path",{fill:"#fff",d:"m9.55 17.65-5.325-5.325 1.05-1.075 4.275 4.275 9.175-9.175 1.05 1.075Z"})})}),p]})})}),Se=g.forwardRef((l,f)=>{const{className:h,children:p,...o}=l,a=g.useContext(I);a.isRequired&&(o.required=!0),a.groupName&&(o.name=a.groupName);const v=`
|
|
49
|
+
flex
|
|
50
|
+
items-center
|
|
50
51
|
text-sm
|
|
51
52
|
cursor-pointer
|
|
52
53
|
py-2
|
|
53
|
-
|
|
54
|
-
`,f=`
|
|
54
|
+
`,d=`
|
|
55
55
|
hidden
|
|
56
56
|
peer
|
|
57
57
|
`,u=`
|
|
@@ -66,8 +66,7 @@ Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(
|
|
|
66
66
|
border-sumi-900
|
|
67
67
|
peer-checked:bg-sea-600
|
|
68
68
|
peer-checked:border-sea-600
|
|
69
|
-
`;return
|
|
70
|
-
cursor-pointer
|
|
69
|
+
`;return n.jsx("div",{className:"inline-block",children:n.jsxs("label",{htmlFor:o.id,className:j(v,h),children:[n.jsx("input",{className:d,type:"radio","aria-describedby":a.helperTextId,"aria-errormessage":a.errorMessageId,...o,ref:f}),n.jsx("span",{className:u}),p]})})}),Ne=g.forwardRef((l,f)=>{const{className:h,children:p,...o}=l,a=g.useContext(I);a.isRequired&&(o.required=!0);const v=a.isInvalid?"border-sun-800":"border-sumi-900",d=`
|
|
71
70
|
appearance-none
|
|
72
71
|
text-base
|
|
73
72
|
w-full
|
|
@@ -79,11 +78,11 @@ Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(
|
|
|
79
78
|
focus:outline
|
|
80
79
|
focus:outline-2
|
|
81
80
|
focus:outline-wood-500
|
|
82
|
-
`;return
|
|
81
|
+
`;return n.jsxs("div",{className:"inline-block relative",children:[n.jsx("select",{className:j(d,v,l.className),"aria-describedby":a.helperTextId,"aria-errormessage":a.errorMessageId,...o,ref:f,children:p}),n.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center px-2",children:n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"fill-sumi-900",height:"24",width:"24",children:n.jsx("path",{d:"M12 15.05 6.35 9.4 7.4 8.35l4.6 4.6 4.6-4.6 1.05 1.05Z"})})})]})}),Oe=g.forwardRef((l,f)=>{const{className:h,...p}=l,o=g.useContext(I);o.isRequired&&(p.required=!0);const a=o.isInvalid?"border-sun-800":"border-sumi-900",v=`
|
|
83
82
|
p-4
|
|
84
83
|
rounded-lg
|
|
85
84
|
border
|
|
86
|
-
border-solid
|
|
85
|
+
border-solid
|
|
87
86
|
focus:outline
|
|
88
87
|
focus:outline-2
|
|
89
88
|
focus:outline-wood-500
|
|
@@ -92,7 +91,7 @@ Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(
|
|
|
92
91
|
disabled:border
|
|
93
92
|
disabled:border-solid
|
|
94
93
|
disabled:border-sumi-500
|
|
95
|
-
`;return
|
|
94
|
+
`;return n.jsx("input",{type:"text",className:j(v,a,h),"aria-describedby":o.helperTextId,"aria-errormessage":o.errorMessageId,...p,ref:f})}),Ie=g.forwardRef((l,f)=>{const{className:h,children:p,...o}=l,a=g.useContext(I);a.isRequired&&(o.required=!0);const v=a.isInvalid?"border-sun-800":"border-sumi-900",d=`
|
|
96
95
|
p-4
|
|
97
96
|
rounded-lg
|
|
98
97
|
border
|
|
@@ -105,5 +104,5 @@ Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(
|
|
|
105
104
|
disabled:border
|
|
106
105
|
disabled:border-solid
|
|
107
106
|
disabled:border-sumi-500
|
|
108
|
-
`;return
|
|
107
|
+
`;return n.jsx("textarea",{className:j(d,v,h),"aria-describedby":a.helperTextId,"aria-errormessage":a.errorMessageId,...o,ref:f,children:p})}),G=g.forwardRef((l,f)=>{const h=g.useId(),{labelText:p,className:o,helperText:a,errorMessage:v,isInvalid:d,isRequired:u,children:w,...x}=l,_={helperTextId:`helper-text-${h}`,errorMessageId:`error-message-${h}`,isInvalid:d??!1,isRequired:u??!1};return n.jsx(I.Provider,{value:_,children:n.jsx("div",{className:j("mb-4",o),ref:f,...x,children:n.jsxs("label",{children:[n.jsxs("p",{className:j("block mb-2",d&&"text-sun-800"),children:[p,u&&n.jsx("span",{className:"text-sun-800",children:" *"})]}),w,a&&n.jsx("p",{id:_.helperTextId,className:"text-sm text-sumi-700 mt-2",children:a}),d&&n.jsx("p",{id:_.errorMessageId,className:j("text-sm text-sun-800",a?"mt-1":"mt-2"),children:v})]})})})}),br=g.forwardRef((l,f)=>{const h=g.useId(),{labelText:p,className:o,helperText:a,errorMessage:v,isInvalid:d,isRequired:u,children:w,...x}=l,P={groupName:x.name??`group-${h}`,helperTextId:`helper-text-${h}`,errorMessageId:`error-message-${h}`,isInvalid:d??!1,isRequired:u??!1};return n.jsx(I.Provider,{value:P,children:n.jsxs("fieldset",{className:j("mb-4",o),ref:f,...x,children:[n.jsx("legend",{children:n.jsxs("p",{className:j("block mb-2",d&&"text-sun-800"),children:[p,u&&n.jsx("span",{className:"text-sun-800",children:" *"})]})}),w,a&&n.jsx("p",{id:P.helperTextId,className:"text-sm text-sumi-700 mt-2",children:a}),d&&n.jsx("p",{id:P.errorMessageId,className:j("text-sm text-sun-800",a?"mt-1":"mt-2"),children:v})]})})}),xr=l=>{const f=g.useId(),{items:h,onChange:p,label:o,className:a,helperText:v,...d}=l,u=`checkbox_group_${Math.random()}`;return n.jsxs("fieldset",{className:j("mb-4",a),"aria-describedby":`helper-text-${f}`,...d,children:[n.jsx("legend",{children:o}),h.map(({label:w,value:x},_)=>n.jsx("div",{children:n.jsx(Pe,{name:u,value:x,onChange:p,children:w})},_)),v&&n.jsx("p",{id:`helper-text-${f}`,className:"text-sm text-sumi-700",children:v})]})},gr=l=>{const f=g.useId(),{items:h,onChange:p,label:o,className:a,helperText:v,...d}=l,u=`radio_group_${Math.random()}`;return n.jsxs("fieldset",{className:j("mb-4",a),"aria-describedby":`helper-text-${f}`,...d,children:[n.jsx("legend",{children:o}),h.map(({label:w,value:x},_)=>n.jsx("div",{children:n.jsx(Se,{name:u,value:x,onChange:p,defaultChecked:_===0,children:w})},_)),v&&n.jsx("p",{id:`helper-text-${f}`,className:"text-sm text-sumi-700",children:v})]})},Rr=g.forwardRef((l,f)=>{const{className:h,labelText:p,helperText:o,errorMessage:a,isInvalid:v,isRequired:d,...u}=l;return n.jsx(G,{className:h,labelText:p,helperText:o,errorMessage:a,isInvalid:v,isRequired:d,children:n.jsx(Ne,{ref:f,...u})})}),yr=g.forwardRef((l,f)=>{const{className:h,labelText:p,helperText:o,errorMessage:a,isInvalid:v,isRequired:d,...u}=l;return n.jsx(G,{className:h,labelText:p,helperText:o,errorMessage:a,isInvalid:v,isRequired:d,children:n.jsx(Oe,{ref:f,...u})})}),_r=g.forwardRef((l,f)=>{const{className:h,labelText:p,helperText:o,errorMessage:a,isInvalid:v,isRequired:d,...u}=l;return n.jsx(G,{className:h,labelText:p,helperText:o,errorMessage:a,isInvalid:v,isRequired:d,children:n.jsx(Ie,{ref:f,...u})})});exports.Checkbox=Pe;exports.CheckboxGroup=xr;exports.FieldsetControl=br;exports.LabelControl=G;exports.Radio=Se;exports.RadioGroup=gr;exports.Select=Ne;exports.SelectControl=Rr;exports.Text=Oe;exports.TextControl=yr;exports.Textarea=Ie;exports.TextareaControl=_r;
|
|
109
108
|
//# sourceMappingURL=index.cjs.js.map
|