@sakura-ui/forms 0.0.2 → 0.0.3
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 +24 -27
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +593 -382
- package/dist/index.es.js.map +1 -1
- package/package.json +6 -1
- package/dist/components/Checkbox.d.ts +0 -5
- package/dist/components/Checkbox.d.ts.map +0 -1
- package/dist/components/Radio.d.ts +0 -5
- package/dist/components/Radio.d.ts.map +0 -1
- package/dist/components/Select.d.ts +0 -5
- package/dist/components/Select.d.ts.map +0 -1
- package/dist/components/Text.d.ts +0 -5
- package/dist/components/Text.d.ts.map +0 -1
- package/dist/components/Textarea.d.ts +0 -5
- package/dist/components/Textarea.d.ts.map +0 -1
- package/dist/components/controlled/CheckboxGroup.d.ts +0 -9
- package/dist/components/controlled/CheckboxGroup.d.ts.map +0 -1
- package/dist/components/controlled/InputItem.d.ts +0 -5
- package/dist/components/controlled/InputItem.d.ts.map +0 -1
- package/dist/components/controlled/RadioGroup.d.ts +0 -9
- package/dist/components/controlled/RadioGroup.d.ts.map +0 -1
- package/dist/components/controlled/Select.d.ts +0 -6
- package/dist/components/controlled/Select.d.ts.map +0 -1
- package/dist/components/controlled/Text.d.ts +0 -6
- package/dist/components/controlled/Text.d.ts.map +0 -1
- package/dist/components/controlled/Textarea.d.ts +0 -6
- package/dist/components/controlled/Textarea.d.ts.map +0 -1
- package/dist/components/controlled/index.d.ts +0 -6
- package/dist/components/controlled/index.d.ts.map +0 -1
- package/dist/components/index.d.ts +0 -6
- package/dist/components/index.d.ts.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.d.ts.map +0 -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 x=require("react");var s={},mr={get exports(){return s},set exports(l){s=l}},W={};/**
|
|
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 Ce;function hr(){if(Ce)return W;Ce=1;var l=x,p=Symbol.for("react.element"),m=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,i=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n={key:!0,ref:!0,__self:!0,__source:!0};function h(f,u,j){var g,y={},C=null,w=null;j!==void 0&&(C=""+j),u.key!==void 0&&(C=""+u.key),u.ref!==void 0&&(w=u.ref);for(g in u)d.call(u,g)&&!n.hasOwnProperty(g)&&(y[g]=u[g]);if(f&&f.defaultProps)for(g in u=f.defaultProps,u)y[g]===void 0&&(y[g]=u[g]);return{$$typeof:p,type:f,key:C,ref:w,props:y,_owner:i.current}}return W.Fragment=m,W.jsx=h,W.jsxs=h,W}var Y={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,26 +14,26 @@
|
|
|
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
|
-
`),
|
|
21
|
-
`+o[
|
|
17
|
+
*/var Pe;function br(){return Pe||(Pe=1,process.env.NODE_ENV!=="production"&&function(){var l=x,p=Symbol.for("react.element"),m=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),f=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),F=Symbol.iterator,Fe="@@iterator";function De(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[Fe];return typeof r=="function"?r:null}var D=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),a=1;a<r;a++)t[a-1]=arguments[a];Me("error",e,t)}}function Me(e,r,t){{var a=D.ReactDebugCurrentFrame,v=a.getStackAddendum();v!==""&&(r+="%s",t=t.concat([v]));var b=t.map(function(c){return String(c)});b.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,b)}}var Ae=!1,$e=!1,qe=!1,We=!1,Ye=!1,ne;ne=Symbol.for("react.module.reference");function Le(e){return!!(typeof e=="string"||typeof e=="function"||e===d||e===n||Ye||e===i||e===j||e===g||We||e===w||Ae||$e||qe||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===y||e.$$typeof===h||e.$$typeof===f||e.$$typeof===u||e.$$typeof===ne||e.getModuleId!==void 0))}function Ve(e,r,t){var a=e.displayName;if(a)return a;var v=r.displayName||r.name||"";return v!==""?t+"("+v+")":t}function ae(e){return e.displayName||"Context"}function I(e){if(e==null)return null;if(typeof e.tag=="number"&&T("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 d:return"Fragment";case m:return"Portal";case n:return"Profiler";case i:return"StrictMode";case j:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f:var r=e;return ae(r)+".Consumer";case h:var t=e;return ae(t._context)+".Provider";case u:return Ve(e,e.render,"ForwardRef");case y:var a=e.displayName||null;return a!==null?a:I(e.type)||"Memo";case C:{var v=e,b=v._payload,c=v._init;try{return I(c(b))}catch{return null}}}return null}var N=Object.assign,$=0,se,ie,oe,le,ue,ce,fe;function de(){}de.__reactDisabledLog=!0;function Ue(){{if($===0){se=console.log,ie=console.info,oe=console.warn,le=console.error,ue=console.group,ce=console.groupCollapsed,fe=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})}$++}}function Be(){{if($--,$===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},e,{value:se}),info:N({},e,{value:ie}),warn:N({},e,{value:oe}),error:N({},e,{value:le}),group:N({},e,{value:ue}),groupCollapsed:N({},e,{value:ce}),groupEnd:N({},e,{value:fe})})}$<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var z=D.ReactCurrentDispatcher,K;function L(e,r,t){{if(K===void 0)try{throw Error()}catch(v){var a=v.stack.trim().match(/\n( *(at )?)/);K=a&&a[1]||""}return`
|
|
18
|
+
`+K+e}}var H=!1,V;{var Ge=typeof WeakMap=="function"?WeakMap:Map;V=new Ge}function ve(e,r){if(!e||H)return"";{var t=V.get(e);if(t!==void 0)return t}var a;H=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var b;b=z.current,z.current=null,Ue();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(O){a=O}Reflect.construct(e,[],c)}else{try{c.call()}catch(O){a=O}e.call(c.prototype)}}else{try{throw Error()}catch(O){a=O}e()}}catch(O){if(O&&a&&typeof O.stack=="string"){for(var o=O.stack.split(`
|
|
19
|
+
`),_=a.stack.split(`
|
|
20
|
+
`),R=o.length-1,E=_.length-1;R>=1&&E>=0&&o[R]!==_[E];)E--;for(;R>=1&&E>=0;R--,E--)if(o[R]!==_[E]){if(R!==1||E!==1)do if(R--,E--,E<0||o[R]!==_[E]){var P=`
|
|
21
|
+
`+o[R].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&V.set(e,P),P}while(R>=1&&E>=0);break}}}finally{H=!1,z.current=b,Be(),Error.prepareStackTrace=v}var A=e?e.displayName||e.name:"",we=A?L(A):"";return typeof e=="function"&&V.set(e,we),we}function Je(e,r,t){return ve(e,!1)}function ze(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function U(e,r,t){if(e==null)return"";if(typeof e=="function")return ve(e,ze(e));if(typeof e=="string")return L(e);switch(e){case j:return L("Suspense");case g:return L("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return Je(e.render);case y:return U(e.type,r,t);case C:{var a=e,v=a._payload,b=a._init;try{return U(b(v),r,t)}catch{}}}return""}var B=Object.prototype.hasOwnProperty,pe={},me=D.ReactDebugCurrentFrame;function G(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);me.setExtraStackFrame(t)}else me.setExtraStackFrame(null)}function Ke(e,r,t,a,v){{var b=Function.call.bind(B);for(var c in e)if(b(e,c)){var o=void 0;try{if(typeof e[c]!="function"){var _=Error((a||"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 _.name="Invariant Violation",_}o=e[c](r,c,a,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){o=R}o&&!(o instanceof Error)&&(G(v),T("%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).",a||"React class",t,c,typeof o),G(null)),o instanceof Error&&!(o.message in pe)&&(pe[o.message]=!0,G(v),T("Failed %s type: %s",t,o.message),G(null))}}}var He=Array.isArray;function X(e){return He(e)}function Xe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ze(e){try{return he(e),!1}catch{return!0}}function he(e){return""+e}function be(e){if(Ze(e))return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Xe(e)),he(e)}var q=D.ReactCurrentOwner,Qe={key:!0,ref:!0,__self:!0,__source:!0},xe,ge,Z;Z={};function er(e){if(B.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function rr(e){if(B.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function tr(e,r){if(typeof e.ref=="string"&&q.current&&r&&q.current.stateNode!==r){var t=I(q.current.type);Z[t]||(T('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',I(q.current.type),e.ref),Z[t]=!0)}}function nr(e,r){{var t=function(){xe||(xe=!0,T("%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 ar(e,r){{var t=function(){ge||(ge=!0,T("%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 sr=function(e,r,t,a,v,b,c){var o={$$typeof:p,type:e,key:r,ref:t,props:c,_owner:b};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function ir(e,r,t,a,v){{var b,c={},o=null,_=null;t!==void 0&&(be(t),o=""+t),rr(r)&&(be(r.key),o=""+r.key),er(r)&&(_=r.ref,tr(r,v));for(b in r)B.call(r,b)&&!Qe.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(o||_){var E=typeof e=="function"?e.displayName||e.name||"Unknown":e;o&&nr(c,E),_&&ar(c,E)}return sr(e,o,_,v,a,q.current,c)}}var Q=D.ReactCurrentOwner,Re=D.ReactDebugCurrentFrame;function M(e){if(e){var r=e._owner,t=U(e.type,e._source,r?r.type:null);Re.setExtraStackFrame(t)}else Re.setExtraStackFrame(null)}var ee;ee=!1;function re(e){return typeof e=="object"&&e!==null&&e.$$typeof===p}function ye(){{if(Q.current){var e=I(Q.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
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 Ee={};function lr(e){{var r=ye();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
|
-
|
|
29
|
-
items-center
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function Te(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=lr(r);if(Ee[t])return;Ee[t]=!0;var a="";e&&e._owner&&e._owner!==Q.current&&(a=" It was passed a child from "+I(e._owner.type)+"."),M(e),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,a),M(null)}}function _e(e,r){{if(typeof e!="object")return;if(X(e))for(var t=0;t<e.length;t++){var a=e[t];re(a)&&Te(a,r)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var v=De(e);if(typeof v=="function"&&v!==e.entries)for(var b=v.call(e),c;!(c=b.next()).done;)re(c.value)&&Te(c.value,r)}}}function ur(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===y))t=r.propTypes;else return;if(t){var a=I(r);Ke(t,e.props,"prop",a,e)}else if(r.PropTypes!==void 0&&!ee){ee=!0;var v=I(r);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",v||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function cr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var a=r[t];if(a!=="children"&&a!=="key"){M(e),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",a),M(null);break}}e.ref!==null&&(M(e),T("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function je(e,r,t,a,v,b){{var c=Le(e);if(!c){var o="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(o+=" 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 _=or(v);_?o+=_:o+=ye();var R;e===null?R="null":X(e)?R="array":e!==void 0&&e.$$typeof===p?(R="<"+(I(e.type)||"Unknown")+" />",o=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,o)}var E=ir(e,r,t,v,b);if(E==null)return E;if(c){var P=r.children;if(P!==void 0)if(a)if(X(P)){for(var A=0;A<P.length;A++)_e(P[A],e);Object.freeze&&Object.freeze(P)}else T("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 _e(P,e)}return e===d?cr(E):ur(E),E}}function fr(e,r,t){return je(e,r,t,!0)}function dr(e,r,t){return je(e,r,t,!1)}var vr=dr,pr=fr;Y.Fragment=d,Y.jsx=vr,Y.jsxs=pr}()),Y}(function(l){process.env.NODE_ENV==="production"?l.exports=hr():l.exports=br()})(mr);const S=(...l)=>l.filter(Boolean).join(" "),k=x.createContext({helperTextId:"",errorMessageId:"",isInvalid:!1,isRequired:!1}),Se=x.forwardRef((l,p)=>{const{className:m,children:d,...i}=l,n=x.useContext(k);n.isRequired&&(i.required=!0),n.groupName&&(i.name=n.groupName);const h=`
|
|
28
|
+
inline-block
|
|
30
29
|
text-sm
|
|
31
30
|
cursor-pointer
|
|
32
31
|
py-2
|
|
33
|
-
|
|
32
|
+
mr-4
|
|
33
|
+
`,f=`
|
|
34
34
|
hidden
|
|
35
35
|
peer
|
|
36
|
-
`,
|
|
36
|
+
`,u=`
|
|
37
37
|
inline-block
|
|
38
38
|
bg-clip-content
|
|
39
39
|
w-6 h-6
|
|
@@ -45,17 +45,16 @@ Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(
|
|
|
45
45
|
border-sumi-900
|
|
46
46
|
peer-checked:bg-sea-600
|
|
47
47
|
peer-checked:border-none
|
|
48
|
-
`;return
|
|
49
|
-
|
|
50
|
-
items-center
|
|
48
|
+
`;return s.jsx("label",{htmlFor:i.id,className:S(h,m),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{className:f,type:"checkbox","aria-describedby":n.helperTextId,"aria-errormessage":n.errorMessageId,"aria-invalid":n.isInvalid??!1,...i,ref:p}),s.jsx("span",{className:u,children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",children:s.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"})})}),d]})})}),Ie=x.forwardRef((l,p)=>{const{className:m,children:d,...i}=l,n=x.useContext(k);n.isRequired&&(i.required=!0),n.groupName&&(i.name=n.groupName);const h=`
|
|
49
|
+
inline-block
|
|
51
50
|
text-sm
|
|
52
51
|
cursor-pointer
|
|
53
52
|
py-2
|
|
54
|
-
|
|
53
|
+
mr-4
|
|
54
|
+
`,f=`
|
|
55
55
|
hidden
|
|
56
56
|
peer
|
|
57
|
-
`,
|
|
58
|
-
inline-block
|
|
57
|
+
`,u=`
|
|
59
58
|
bg-clip-content
|
|
60
59
|
w-6 h-6
|
|
61
60
|
ml-1
|
|
@@ -67,25 +66,24 @@ Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(
|
|
|
67
66
|
border-sumi-900
|
|
68
67
|
peer-checked:bg-sea-600
|
|
69
68
|
peer-checked:border-sea-600
|
|
70
|
-
`;return
|
|
69
|
+
`;return s.jsx("label",{htmlFor:i.id,className:S(h,m),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{className:f,type:"radio","aria-describedby":n.helperTextId,"aria-errormessage":n.errorMessageId,"aria-invalid":n.isInvalid??!1,...i,ref:p}),s.jsx("span",{className:u}),d]})})}),Oe=x.forwardRef((l,p)=>{const{className:m,children:d,...i}=l,n=x.useContext(k);n.isRequired&&(i.required=!0);const h=n.isInvalid?"border-sun-800":"border-sumi-900",f=`
|
|
70
|
+
cursor-pointer
|
|
71
71
|
appearance-none
|
|
72
72
|
text-base
|
|
73
73
|
w-full
|
|
74
74
|
bg-white-100
|
|
75
75
|
border
|
|
76
76
|
border-solid
|
|
77
|
-
border-sumi-900
|
|
78
77
|
py-4 px-4 pr-8
|
|
79
78
|
rounded-[8px]
|
|
80
79
|
focus:outline
|
|
81
80
|
focus:outline-2
|
|
82
81
|
focus:outline-wood-500
|
|
83
|
-
`;return
|
|
82
|
+
`;return s.jsxs("span",{className:"inline-block relative",children:[s.jsx("select",{className:S(f,h,l.className),"aria-describedby":n.helperTextId,"aria-errormessage":n.errorMessageId,"aria-invalid":n.isInvalid??!1,...i,ref:p,children:d}),s.jsx("span",{className:"flex items-center absolute inset-y-0 right-0 px-2 pointer-events-none",children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"fill-sumi-900",height:"24",width:"24",children:s.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"})})})]})}),Ne=x.forwardRef((l,p)=>{const{className:m,...d}=l,i=x.useContext(k);i.isRequired&&(d.required=!0);const n=i.isInvalid?"border-sun-800":"border-sumi-900",h=`
|
|
84
83
|
p-4
|
|
85
84
|
rounded-lg
|
|
86
85
|
border
|
|
87
86
|
border-solid
|
|
88
|
-
border-sumi-900
|
|
89
87
|
focus:outline
|
|
90
88
|
focus:outline-2
|
|
91
89
|
focus:outline-wood-500
|
|
@@ -94,12 +92,11 @@ Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(
|
|
|
94
92
|
disabled:border
|
|
95
93
|
disabled:border-solid
|
|
96
94
|
disabled:border-sumi-500
|
|
97
|
-
`;return
|
|
95
|
+
`;return s.jsx("input",{type:"text",className:S(h,n,m),"aria-describedby":i.helperTextId,"aria-errormessage":i.errorMessageId,"aria-invalid":i.isInvalid??!1,...d,ref:p})}),ke=x.forwardRef((l,p)=>{const{className:m,children:d,...i}=l,n=x.useContext(k);n.isRequired&&(i.required=!0);const h=n.isInvalid?"border-sun-800":"border-sumi-900",f=`
|
|
98
96
|
p-4
|
|
99
97
|
rounded-lg
|
|
100
98
|
border
|
|
101
99
|
border-solid
|
|
102
|
-
border-sumi-900
|
|
103
100
|
focus:outline
|
|
104
101
|
focus:outline-2
|
|
105
102
|
focus:outline-wood-500
|
|
@@ -108,5 +105,5 @@ Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(
|
|
|
108
105
|
disabled:border
|
|
109
106
|
disabled:border-solid
|
|
110
107
|
disabled:border-sumi-500
|
|
111
|
-
`;return
|
|
108
|
+
`;return s.jsx("textarea",{className:S(f,h,m),"aria-describedby":n.helperTextId,"aria-errormessage":n.errorMessageId,"aria-invalid":n.isInvalid??!1,...i,ref:p,children:d})}),J=x.forwardRef((l,p)=>{const m=x.useId(),{labelText:d,className:i,helperText:n,errorMessage:h,isInvalid:f,isRequired:u,children:j,...g}=l,y={helperTextId:`helper-text-${m}`,errorMessageId:`error-message-${m}`,isInvalid:f??!1,isRequired:u??!1};return s.jsx(k.Provider,{value:y,children:s.jsxs("div",{className:S("mb-4",i),ref:p,...g,children:[s.jsxs("label",{children:[s.jsxs("span",{className:S("block mb-2",f&&"text-sun-800"),children:[d,u&&s.jsx("span",{className:"text-sun-800",children:" *"})]}),j]}),n&&s.jsx("p",{id:y.helperTextId,className:"text-sm text-sumi-700 mt-2",children:n}),f&&s.jsx("p",{id:y.errorMessageId,className:S("text-sm text-sun-800",n?"mt-1":"mt-2"),children:h})]})})}),te=x.forwardRef((l,p)=>{const m=x.useId(),{labelText:d,className:i,helperText:n,errorMessage:h,isInvalid:f,isRequired:u,direction:j,children:g,...y}=l,w={groupName:y.name??`group-${m}`,helperTextId:`helper-text-${m}`,errorMessageId:`error-message-${m}`,isInvalid:f??!1,isRequired:u??!1},F=j??"flex-col";return s.jsx(k.Provider,{value:w,children:s.jsxs("fieldset",{className:S("mb-4",i),ref:p,...y,children:[s.jsx("legend",{children:s.jsxs("p",{className:S("block mb-2",f&&"text-sun-800"),children:[d,u&&s.jsx("span",{className:"text-sun-800",children:" *"})]})}),s.jsx("div",{className:S("inline-flex",F),children:g}),n&&s.jsx("p",{id:w.helperTextId,className:"text-sm text-sumi-700 mt-2",children:n}),f&&s.jsx("p",{id:w.errorMessageId,className:S("text-sm text-sun-800",n?"mt-1":"mt-2"),children:h})]})})}),xr=x.forwardRef((l,p)=>{const{items:m,onChange:d,className:i,labelText:n,helperText:h,errorMessage:f,isInvalid:u,isRequired:j,...g}=l;return s.jsx(te,{className:i,labelText:n,helperText:h,errorMessage:f,isInvalid:u,isRequired:j,ref:p,...g,children:m.map(({label:y,value:C},w)=>s.jsx(Se,{value:C,onChange:d,children:y},w))})}),gr=x.forwardRef((l,p)=>{const{items:m,onChange:d,className:i,labelText:n,helperText:h,errorMessage:f,isInvalid:u,isRequired:j,defaultValue:g,...y}=l;return s.jsx(te,{className:i,labelText:n,helperText:h,errorMessage:f,isInvalid:u,isRequired:j,ref:p,...y,children:m.map(({label:C,value:w},F)=>s.jsx(Ie,{value:w,onChange:d,defaultChecked:g===w,children:C},F))})}),Rr=x.forwardRef((l,p)=>{const{className:m,labelText:d,helperText:i,errorMessage:n,isInvalid:h,isRequired:f,...u}=l;return s.jsx(J,{className:m,labelText:d,helperText:i,errorMessage:n,isInvalid:h,isRequired:f,children:s.jsx(Oe,{ref:p,...u})})}),yr=x.forwardRef((l,p)=>{const{className:m,labelText:d,helperText:i,errorMessage:n,isInvalid:h,isRequired:f,...u}=l;return s.jsx(J,{className:m,labelText:d,helperText:i,errorMessage:n,isInvalid:h,isRequired:f,children:s.jsx(Ne,{ref:p,...u})})}),Er=x.forwardRef((l,p)=>{const{className:m,labelText:d,helperText:i,errorMessage:n,isInvalid:h,isRequired:f,...u}=l;return s.jsx(J,{className:m,labelText:d,helperText:i,errorMessage:n,isInvalid:h,isRequired:f,children:s.jsx(ke,{ref:p,...u})})});exports.Checkbox=Se;exports.CheckboxGroup=xr;exports.FieldsetControl=te;exports.LabelControl=J;exports.Radio=Ie;exports.RadioGroup=gr;exports.Select=Oe;exports.SelectControl=Rr;exports.Text=Ne;exports.TextControl=yr;exports.Textarea=ke;exports.TextareaControl=Er;
|
|
112
109
|
//# sourceMappingURL=index.cjs.js.map
|