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