@sakura-ui/forms 0.1.13 → 0.2.1
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 +115 -92
- package/dist/index.es.js +739 -648
- package/dist/types/components/Checkbox.d.ts +3 -1
- package/dist/types/components/Checkbox.d.ts.map +1 -1
- package/dist/types/components/FileInput.d.ts +3 -1
- package/dist/types/components/FileInput.d.ts.map +1 -1
- package/dist/types/components/Input.d.ts +3 -1
- package/dist/types/components/Input.d.ts.map +1 -1
- package/dist/types/components/Radio.d.ts +3 -1
- package/dist/types/components/Radio.d.ts.map +1 -1
- package/dist/types/components/Select.d.ts +3 -1
- package/dist/types/components/Select.d.ts.map +1 -1
- package/dist/types/components/Textarea.d.ts.map +1 -1
- package/dist/types/components/controlled/CheckboxGroup.d.ts +3 -1
- package/dist/types/components/controlled/CheckboxGroup.d.ts.map +1 -1
- package/dist/types/components/controlled/RadioGroup.d.ts +3 -1
- package/dist/types/components/controlled/RadioGroup.d.ts.map +1 -1
- package/dist/types/components/controlled/index.d.ts +0 -2
- package/dist/types/components/controlled/index.d.ts.map +1 -1
- package/dist/types/components/inputStyle.d.ts +13 -0
- package/dist/types/components/inputStyle.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/class.d.ts.map +1 -1
- package/package.json +15 -14
- package/dist/types/components/controlled/SelectControl.d.ts +0 -10
- package/dist/types/components/controlled/SelectControl.d.ts.map +0 -1
- package/dist/types/components/controlled/TextareaControl.d.ts +0 -10
- package/dist/types/components/controlled/TextareaControl.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 R=require("react");var ne={exports:{}},L={};/**
|
|
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 ke;function Cr(){if(ke)return L;ke=1;var b=R,h=Symbol.for("react.element"),m=Symbol.for("react.fragment"),x=Object.prototype.hasOwnProperty,p=b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function i(o,a,y){var v,d={},j=null,w=null;y!==void 0&&(j=""+y),a.key!==void 0&&(j=""+a.key),a.ref!==void 0&&(w=a.ref);for(v in a)x.call(a,v)&&!c.hasOwnProperty(v)&&(d[v]=a[v]);if(o&&o.defaultProps)for(v in a=o.defaultProps,a)d[v]===void 0&&(d[v]=a[v]);return{$$typeof:h,type:o,key:j,ref:w,props:d,_owner:p.current}}return L.Fragment=m,L.jsx=i,L.jsxs=i,L}var V={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,57 +14,92 @@
|
|
|
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
|
-
`+l[
|
|
17
|
+
*/var Ne;function Ir(){return Ne||(Ne=1,process.env.NODE_ENV!=="production"&&function(){var b=R,h=Symbol.for("react.element"),m=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),k=Symbol.iterator,ze="@@iterator";function Ue(e){if(e===null||typeof e!="object")return null;var r=k&&e[k]||e[ze];return typeof r=="function"?r:null}var D=b.__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),n=1;n<r;n++)t[n-1]=arguments[n];Be("error",e,t)}}function Be(e,r,t){{var n=D.ReactDebugCurrentFrame,f=n.getStackAddendum();f!==""&&(r+="%s",t=t.concat([f]));var g=t.map(function(u){return String(u)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var Ge=!1,Je=!1,Ke=!1,He=!1,Xe=!1,oe;oe=Symbol.for("react.module.reference");function Ze(e){return!!(typeof e=="string"||typeof e=="function"||e===x||e===c||Xe||e===p||e===y||e===v||He||e===w||Ge||Je||Ke||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===d||e.$$typeof===i||e.$$typeof===o||e.$$typeof===a||e.$$typeof===oe||e.getModuleId!==void 0))}function Qe(e,r,t){var n=e.displayName;if(n)return n;var f=r.displayName||r.name||"";return f!==""?t+"("+f+")":t}function le(e){return e.displayName||"Context"}function N(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 x:return"Fragment";case m:return"Portal";case c:return"Profiler";case p:return"StrictMode";case y:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case o:var r=e;return le(r)+".Consumer";case i:var t=e;return le(t._context)+".Provider";case a:return Qe(e,e.render,"ForwardRef");case d:var n=e.displayName||null;return n!==null?n:N(e.type)||"Memo";case j:{var f=e,g=f._payload,u=f._init;try{return N(u(g))}catch{return null}}}return null}var F=Object.assign,M=0,ue,ce,de,fe,pe,ve,be;function me(){}me.__reactDisabledLog=!0;function er(){{if(M===0){ue=console.log,ce=console.info,de=console.warn,fe=console.error,pe=console.group,ve=console.groupCollapsed,be=console.groupEnd;var e={configurable:!0,enumerable:!0,value:me,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}}function rr(){{if(M--,M===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:ue}),info:F({},e,{value:ce}),warn:F({},e,{value:de}),error:F({},e,{value:fe}),group:F({},e,{value:pe}),groupCollapsed:F({},e,{value:ve}),groupEnd:F({},e,{value:be})})}M<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=D.ReactCurrentDispatcher,H;function z(e,r,t){{if(H===void 0)try{throw Error()}catch(f){var n=f.stack.trim().match(/\n( *(at )?)/);H=n&&n[1]||""}return`
|
|
18
|
+
`+H+e}}var X=!1,U;{var tr=typeof WeakMap=="function"?WeakMap:Map;U=new tr}function ge(e,r){if(!e||X)return"";{var t=U.get(e);if(t!==void 0)return t}var n;X=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=K.current,K.current=null,er();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(S){n=S}Reflect.construct(e,[],u)}else{try{u.call()}catch(S){n=S}e.call(u.prototype)}}else{try{throw Error()}catch(S){n=S}e()}}catch(S){if(S&&n&&typeof S.stack=="string"){for(var l=S.stack.split(`
|
|
19
|
+
`),I=n.stack.split(`
|
|
20
|
+
`),E=l.length-1,_=I.length-1;E>=1&&_>=0&&l[E]!==I[_];)_--;for(;E>=1&&_>=0;E--,_--)if(l[E]!==I[_]){if(E!==1||_!==1)do if(E--,_--,_<0||l[E]!==I[_]){var P=`
|
|
21
|
+
`+l[E].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&U.set(e,P),P}while(E>=1&&_>=0);break}}}finally{X=!1,K.current=g,rr(),Error.prepareStackTrace=f}var $=e?e.displayName||e.name:"",q=$?z($):"";return typeof e=="function"&&U.set(e,q),q}function ar(e,r,t){return ge(e,!1)}function nr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function B(e,r,t){if(e==null)return"";if(typeof e=="function")return ge(e,nr(e));if(typeof e=="string")return z(e);switch(e){case y:return z("Suspense");case v:return z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case a:return ar(e.render);case d:return B(e.type,r,t);case j:{var n=e,f=n._payload,g=n._init;try{return B(g(f),r,t)}catch{}}}return""}var W=Object.prototype.hasOwnProperty,he={},xe=D.ReactDebugCurrentFrame;function G(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(t)}else xe.setExtraStackFrame(null)}function sr(e,r,t,n,f){{var g=Function.call.bind(W);for(var u in e)if(g(e,u)){var l=void 0;try{if(typeof e[u]!="function"){var I=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 I.name="Invariant Violation",I}l=e[u](r,u,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){l=E}l&&!(l instanceof Error)&&(G(f),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).",n||"React class",t,u,typeof l),G(null)),l instanceof Error&&!(l.message in he)&&(he[l.message]=!0,G(f),T("Failed %s type: %s",t,l.message),G(null))}}}var ir=Array.isArray;function Z(e){return ir(e)}function or(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function lr(e){try{return ye(e),!1}catch{return!0}}function ye(e){return""+e}function Re(e){if(lr(e))return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",or(e)),ye(e)}var Y=D.ReactCurrentOwner,ur={key:!0,ref:!0,__self:!0,__source:!0},Ee,_e,Q;Q={};function cr(e){if(W.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function dr(e){if(W.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function fr(e,r){if(typeof e.ref=="string"&&Y.current&&r&&Y.current.stateNode!==r){var t=N(Y.current.type);Q[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',N(Y.current.type),e.ref),Q[t]=!0)}}function pr(e,r){{var t=function(){Ee||(Ee=!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 vr(e,r){{var t=function(){_e||(_e=!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 br=function(e,r,t,n,f,g,u){var l={$$typeof:h,type:e,key:r,ref:t,props:u,_owner:g};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:f}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function mr(e,r,t,n,f){{var g,u={},l=null,I=null;t!==void 0&&(Re(t),l=""+t),dr(r)&&(Re(r.key),l=""+r.key),cr(r)&&(I=r.ref,fr(r,f));for(g in r)W.call(r,g)&&!ur.hasOwnProperty(g)&&(u[g]=r[g]);if(e&&e.defaultProps){var E=e.defaultProps;for(g in E)u[g]===void 0&&(u[g]=E[g])}if(l||I){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;l&&pr(u,_),I&&vr(u,_)}return br(e,l,I,f,n,Y.current,u)}}var ee=D.ReactCurrentOwner,je=D.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=B(e.type,e._source,r?r.type:null);je.setExtraStackFrame(t)}else je.setExtraStackFrame(null)}var re;re=!1;function te(e){return typeof e=="object"&&e!==null&&e.$$typeof===h}function we(){{if(ee.current){var e=N(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 gr(e){return""}var Te={};function hr(e){{var r=we();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
24
|
|
|
25
|
-
Check
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=hr(r);if(Te[t])return;Te[t]=!0;var n="";e&&e._owner&&e._owner!==ee.current&&(n=" It was passed a child from "+N(e._owner.type)+"."),A(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,n),A(null)}}function Ie(e,r){{if(typeof e!="object")return;if(Z(e))for(var t=0;t<e.length;t++){var n=e[t];te(n)&&Ce(n,r)}else if(te(e))e._store&&(e._store.validated=!0);else if(e){var f=Ue(e);if(typeof f=="function"&&f!==e.entries)for(var g=f.call(e),u;!(u=g.next()).done;)te(u.value)&&Ce(u.value,r)}}}function xr(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===a||r.$$typeof===d))t=r.propTypes;else return;if(t){var n=N(r);sr(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!re){re=!0;var f=N(r);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",f||"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 yr(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),T("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),T("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var Se={};function Pe(e,r,t,n,f,g){{var u=Ze(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 I=gr();I?l+=I:l+=we();var E;e===null?E="null":Z(e)?E="array":e!==void 0&&e.$$typeof===h?(E="<"+(N(e.type)||"Unknown")+" />",l=" Did you accidentally export a JSX literal instead of a component?"):E=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",E,l)}var _=mr(e,r,t,f,g);if(_==null)return _;if(u){var P=r.children;if(P!==void 0)if(n)if(Z(P)){for(var $=0;$<P.length;$++)Ie(P[$],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 Ie(P,e)}if(W.call(r,"key")){var q=N(e),S=Object.keys(r).filter(function(Tr){return Tr!=="key"}),ae=S.length>0?"{key: someKey, "+S.join(": ..., ")+": ...}":"{key: someKey}";if(!Se[q+ae]){var wr=S.length>0?"{"+S.join(": ..., ")+": ...}":"{}";T(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,ae,q,wr,q),Se[q+ae]=!0}}return e===x?yr(_):xr(_),_}}function Rr(e,r,t){return Pe(e,r,t,!0)}function Er(e,r,t){return Pe(e,r,t,!1)}var _r=Er,jr=Rr;V.Fragment=x,V.jsx=_r,V.jsxs=jr}()),V}process.env.NODE_ENV==="production"?ne.exports=Cr():ne.exports=Ir();var s=ne.exports;const C=(...b)=>b.filter(Boolean).join(" "),O=R.createContext({helperTextId:"",errorMessageId:"",isInvalid:!1,isRequired:!1}),Oe=`
|
|
31
|
+
bg-white
|
|
32
|
+
border
|
|
33
|
+
border-solid
|
|
34
|
+
border-sumi-900
|
|
35
|
+
outline-offset-2
|
|
36
|
+
focus:outline
|
|
37
|
+
focus:outline-2
|
|
38
|
+
focus:outline-wood-500
|
|
39
|
+
disabled:bg-transparent
|
|
40
|
+
disabled:text-sumi-500
|
|
41
|
+
disabled:border-sumi-500
|
|
42
|
+
aria-invalid:border-sun-800
|
|
43
|
+
`,Fe={lg:`
|
|
44
|
+
p-4
|
|
45
|
+
text-label
|
|
46
|
+
rounded-lg
|
|
47
|
+
leading-snug
|
|
48
|
+
`,md:`
|
|
49
|
+
px-4
|
|
50
|
+
py-3
|
|
51
|
+
text-label
|
|
52
|
+
rounded-lg
|
|
53
|
+
leading-snug
|
|
54
|
+
`,sm:`
|
|
55
|
+
px-3
|
|
56
|
+
py-2
|
|
57
|
+
text-label
|
|
58
|
+
rounded-md
|
|
59
|
+
leading-snug
|
|
60
|
+
`},qe=`
|
|
61
|
+
inline-block
|
|
62
|
+
cursor-pointer
|
|
63
|
+
border
|
|
64
|
+
border-solid
|
|
65
|
+
border-transparent
|
|
66
|
+
`,De={lg:`
|
|
67
|
+
pr-8
|
|
68
|
+
py-4
|
|
69
|
+
text-label
|
|
70
|
+
leading-snug
|
|
71
|
+
`,md:`
|
|
72
|
+
pr-6
|
|
73
|
+
py-3
|
|
74
|
+
text-label
|
|
75
|
+
leading-snug
|
|
76
|
+
`,sm:`
|
|
77
|
+
pr-4
|
|
78
|
+
py-2
|
|
79
|
+
text-label
|
|
80
|
+
leading-snug
|
|
81
|
+
`},Ae={lg:"w-[22px] h-[22px] mr-2",md:"w-[18px] h-[18px] mr-1.5",sm:"w-[18px] h-[18px] mr-1"},se=R.forwardRef((b,h)=>{const{id:m,className:x,size:p="lg",children:c,...i}=b,o=m||R.useId(),a=R.useContext(O);a.isRequired&&(i.required=!0),a.groupName&&(i.name=a.groupName);const y={lg:22/24,md:18/24,sm:18/24};return s.jsx("label",{htmlFor:o,className:C(qe,De[p],x),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:o,className:`
|
|
34
82
|
peer
|
|
35
83
|
sr-only
|
|
36
|
-
`,
|
|
84
|
+
`,type:"checkbox","aria-describedby":a.helperTextId,"aria-errormessage":a.errorMessageId,"aria-invalid":a.isInvalid??!1,"aria-required":a.isRequired??!1,...i,ref:h}),s.jsx("span",{className:C(`
|
|
37
85
|
bg-clip-content
|
|
38
|
-
w-6 h-6
|
|
39
|
-
ml-1
|
|
40
|
-
mr-2
|
|
41
86
|
rounded
|
|
42
87
|
border
|
|
43
88
|
border-solid
|
|
44
89
|
border-sumi-900
|
|
45
90
|
fill-transparent
|
|
46
|
-
peer-checked:fill-white
|
|
91
|
+
peer-checked:fill-white
|
|
47
92
|
peer-checked:bg-sea-600
|
|
48
93
|
peer-checked:border-none
|
|
49
94
|
peer-disabled:border-sumi-500
|
|
50
95
|
peer-focus-visible:ring-2
|
|
51
96
|
peer-focus-visible:ring-offset-2
|
|
52
97
|
peer-focus-visible:ring-wood-500
|
|
53
|
-
|
|
54
|
-
inline-block
|
|
55
|
-
text-base
|
|
56
|
-
cursor-pointer
|
|
57
|
-
py-2
|
|
58
|
-
mr-4
|
|
59
|
-
`,c=`
|
|
98
|
+
`,Ae[p]),children:s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,width:"24",height:"24",viewBox:"0 0 24 24",children:[s.jsx("title",{children:"check"}),s.jsx("g",{transform:`scale(${y[p]} ${y[p]})`,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:c})]})})});se.displayName="Checkbox";const ie=R.forwardRef((b,h)=>{const{id:m,className:x,size:p="lg",children:c,...i}=b,o=m||R.useId(),a=R.useContext(O);a.isRequired&&(i.required=!0),a.groupName&&(i.name=a.groupName);const y=`
|
|
60
99
|
peer
|
|
61
100
|
sr-only
|
|
62
|
-
`,
|
|
101
|
+
`,v=`
|
|
63
102
|
bg-clip-content
|
|
64
|
-
w-6 h-6
|
|
65
|
-
ml-1
|
|
66
|
-
mr-2
|
|
67
|
-
p-1
|
|
68
103
|
rounded-full
|
|
69
104
|
border
|
|
70
105
|
border-solid
|
|
@@ -75,33 +110,20 @@ Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(
|
|
|
75
110
|
peer-focus-visible:ring-2
|
|
76
111
|
peer-focus-visible:ring-offset-2
|
|
77
112
|
peer-focus-visible:ring-wood-500
|
|
78
|
-
|
|
113
|
+
`,d={lg:"p-1",md:"p-[3px]",sm:"p-[3px]"};return s.jsx("label",{htmlFor:o,className:C(qe,De[p],x),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:o,className:y,type:"radio","aria-describedby":a.helperTextId,"aria-errormessage":a.errorMessageId,"aria-invalid":a.isInvalid??!1,"aria-required":a.isRequired??!1,...i,ref:h}),s.jsx("span",{"aria-hidden":!0,className:C(v,d[p],Ae[p])}),s.jsx("span",{className:"peer-disabled:text-sumi-500",children:c})]})})});ie.displayName="Radio";const Sr=R.forwardRef((b,h)=>{const{id:m,className:x,size:p="lg",children:c,...i}=b,o=R.useContext(O);return o.isRequired&&(i.required=!0),s.jsxs("div",{className:"inline-block relative",children:[s.jsx("select",{id:m||o.id,className:C(`
|
|
114
|
+
!pr-8
|
|
79
115
|
peer
|
|
80
116
|
cursor-pointer
|
|
81
117
|
appearance-none
|
|
82
|
-
|
|
83
|
-
w-full
|
|
84
|
-
bg-white-100
|
|
85
|
-
border
|
|
86
|
-
border-solid
|
|
87
|
-
border-sumi-900
|
|
88
|
-
py-4 px-4 pr-8
|
|
89
|
-
rounded-[8px]
|
|
90
|
-
outline-offset-2
|
|
91
|
-
focus:outline
|
|
92
|
-
focus:outline-2
|
|
93
|
-
focus:outline-wood-500
|
|
94
|
-
disabled:bg-transparent
|
|
95
|
-
disabled:text-sumi-500
|
|
96
|
-
disabled:border-sumi-500
|
|
97
|
-
aria-invalid:border-sun-800
|
|
98
|
-
`,c=`
|
|
99
|
-
flex items-center
|
|
100
|
-
absolute inset-y-0 right-0
|
|
101
|
-
px-2
|
|
118
|
+
`,Oe,Fe[p],b.className),"aria-describedby":o.helperTextId,"aria-errormessage":o.errorMessageId,"aria-invalid":o.isInvalid??!1,"aria-required":o.isRequired??!1,...i,ref:h,children:c}),s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:`
|
|
102
119
|
pointer-events-none
|
|
103
|
-
|
|
104
|
-
|
|
120
|
+
absolute
|
|
121
|
+
right-4
|
|
122
|
+
top-1/2
|
|
123
|
+
-translate-y-1/2
|
|
124
|
+
text-sumi-900
|
|
125
|
+
peer-disabled:text-sumi-500
|
|
126
|
+
`,fill:"none",width:"16",height:"16",viewBox:"0 0 16 16",children:[s.jsx("title",{children:"arrow down"}),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",fill:"currentColor"})]})]})}),$e=R.forwardRef((b,h)=>{const{id:m,className:x,size:p="lg",...c}=b,i=R.useContext(O);i.isRequired&&(c.required=!0);const o=`
|
|
105
127
|
file:mr-2
|
|
106
128
|
file:inline-block
|
|
107
129
|
file:text-button
|
|
@@ -112,48 +134,49 @@ Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(
|
|
|
112
134
|
file:whitespace-nowrap
|
|
113
135
|
file:border
|
|
114
136
|
file:border-solid
|
|
115
|
-
file:border-
|
|
116
|
-
file:
|
|
117
|
-
file:
|
|
137
|
+
file:border-blue-900
|
|
138
|
+
file:hover:border-blue-1000
|
|
139
|
+
file:active:border-blue-1200
|
|
118
140
|
file:disabled:border-sumi-500
|
|
119
141
|
file:disabled:cursor-not-allowed
|
|
120
|
-
`,
|
|
121
|
-
file:text-sea-
|
|
122
|
-
file:
|
|
123
|
-
file:active:bg-sea-200
|
|
124
|
-
file:hover:bg-sea-100
|
|
142
|
+
`,a=`
|
|
143
|
+
file:text-sea-900
|
|
144
|
+
file:hover:text-sea-1000
|
|
125
145
|
file:active:text-sea-1200
|
|
126
|
-
file:
|
|
146
|
+
file:bg-transparent
|
|
147
|
+
file:hover:bg-sea-200
|
|
148
|
+
file:active:bg-sea-300
|
|
127
149
|
file:disabled:text-sumi-500
|
|
128
150
|
file:disabled:bg-transparent
|
|
129
|
-
`,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
file:rounded-lg
|
|
133
|
-
`,o=`
|
|
151
|
+
`,y=`
|
|
152
|
+
text-label
|
|
153
|
+
text-sumi-900
|
|
134
154
|
rounded-lg
|
|
135
155
|
outline-offset-2
|
|
136
|
-
text-sumi-900
|
|
137
156
|
focus:outline
|
|
138
157
|
focus:outline-2
|
|
139
158
|
focus:outline-wood-600
|
|
140
159
|
aria-invalid:text-sun-800
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
`,v={lg:`
|
|
161
|
+
file:p-4
|
|
162
|
+
file:text-button
|
|
163
|
+
file:rounded-lg
|
|
164
|
+
file:leading-snug
|
|
165
|
+
`,md:`
|
|
166
|
+
file:px-4
|
|
167
|
+
file:py-3
|
|
168
|
+
file:text-button
|
|
169
|
+
file:rounded-lg
|
|
170
|
+
file:leading-snug
|
|
171
|
+
`,sm:`
|
|
172
|
+
file:px-3
|
|
173
|
+
file:py-2
|
|
174
|
+
file:text-button
|
|
175
|
+
file:rounded-md
|
|
176
|
+
file:leading-snug
|
|
177
|
+
`};return s.jsx("input",{type:"file",id:m||i.id,className:C(o,a,v[p],y,x),"aria-describedby":i.helperTextId,"aria-errormessage":i.errorMessageId,"aria-invalid":i.isInvalid??!1,"aria-required":i.isRequired??!1,ref:h,...c})});$e.displayName="FileInput";const Me=R.forwardRef((b,h)=>{const{id:m,className:x,size:p="lg",...c}=b,i=R.useContext(O);return i.isRequired&&(c.required=!0),s.jsx("input",{type:"text",id:m||i.id,className:C(Oe,Fe[p],x),"aria-describedby":i.helperTextId,"aria-errormessage":i.errorMessageId,"aria-invalid":i.isInvalid??!1,"aria-required":i.isRequired??!1,ref:h,...c})});Me.displayName="Input";const We=R.forwardRef((b,h)=>{const{id:m,className:x,children:p,onChange:c,maxLength:i,...o}=b,[a,y]=R.useState(0),v=k=>{c&&c(k),y(k.target.value.length)},d=R.useContext(O);d.isRequired&&(o.required=!0);const j=a>(i||0)?"text-sun-800":"text-sumi-700";return s.jsxs(s.Fragment,{children:[s.jsx("textarea",{id:m||d.id,className:C(`
|
|
156
178
|
p-4
|
|
179
|
+
text-label
|
|
157
180
|
rounded-lg
|
|
158
181
|
border
|
|
159
182
|
border-solid
|
|
@@ -166,8 +189,8 @@ Check the top-level render call using <`+t+">.")}return r}}function Ce(e,r){{if(
|
|
|
166
189
|
disabled:text-sumi-500
|
|
167
190
|
disabled:border-sumi-500
|
|
168
191
|
aria-invalid:border-sun-800
|
|
169
|
-
|
|
170
|
-
text-
|
|
171
|
-
`,
|
|
172
|
-
text-
|
|
173
|
-
|
|
192
|
+
`,x),"aria-describedby":d.helperTextId,"aria-errormessage":d.errorMessageId,"aria-invalid":d.isInvalid??!1,"aria-required":d.isRequired??!1,onChange:v,...o,ref:h,children:p}),i?s.jsxs("p",{className:"text-label text-sumi-700",children:[s.jsx("span",{className:j,children:a}),"/",s.jsx("span",{children:i})]}):""]})});We.displayName="Textarea";const Ye=R.forwardRef((b,h)=>{const m=R.useId(),{labelText:x,className:p,helperText:c,errorMessage:i,isInvalid:o,isRequired:a,children:y,...v}=b,d={id:b.htmlFor??`input-${m}`,helperTextId:`helper-text-${m}`,errorMessageId:`error-message-${m}`,isInvalid:o??!1,isRequired:a??!1};return s.jsx(O.Provider,{value:d,children:s.jsxs("div",{className:C("mb-4",p),children:[s.jsxs("label",{className:C("block mb-2 text-label",o&&"text-sun-800"),htmlFor:d.id,ref:h,...v,children:[x,a&&s.jsx("span",{className:"text-label text-sun-800",children:" *"})]}),c&&s.jsx("p",{id:d.helperTextId,className:C(`
|
|
193
|
+
text-label text-sumi-700
|
|
194
|
+
`,"mb-2"),children:c}),y,o&&s.jsx("p",{id:d.errorMessageId,className:C(`
|
|
195
|
+
text-label text-sun-800
|
|
196
|
+
`,c?"mt-1":"mt-2"),children:i})]})})});Ye.displayName="LabelControl";const J=R.forwardRef((b,h)=>{const m=R.useId(),{labelText:x,className:p,helperText:c,errorMessage:i,isInvalid:o,isRequired:a,direction:y,children:v,...d}=b,w={groupName:d.name??`group-${m}`,helperTextId:`helper-text-${m}`,errorMessageId:`error-message-${m}`,isInvalid:o??!1,isRequired:a??!1},k=y??"flex-col";return s.jsx(O.Provider,{value:w,children:s.jsxs("fieldset",{className:C("mb-4",p),ref:h,...d,children:[s.jsx("legend",{children:s.jsxs("p",{className:C("block mb-2 text-label",o&&"text-sun-800"),children:[x,a&&s.jsx("span",{className:"text-sun-800",children:" *"})]})}),s.jsx("div",{className:C("inline-flex",k),children:v}),c&&s.jsx("p",{id:w.helperTextId,className:"text-sup text-sumi-700 mt-2",children:c}),o&&s.jsx("p",{id:w.errorMessageId,className:C("text-label text-sun-800",c?"mt-1":"mt-2"),children:i})]})})});J.displayName="FieldsetControl";const Le=R.forwardRef((b,h)=>{const{items:m,onChange:x,className:p,labelText:c,helperText:i,errorMessage:o,isInvalid:a,isRequired:y,size:v,...d}=b;return s.jsx(J,{className:p,labelText:c,helperText:i,errorMessage:o,isInvalid:a,isRequired:y,ref:h,...d,children:m.map(({label:j,value:w})=>s.jsx(se,{size:v,value:w,onChange:x,children:j},`${j}-${w}`))})});Le.displayName="CheckboxGroup";const Ve=R.forwardRef((b,h)=>{const{items:m,onChange:x,className:p,labelText:c,helperText:i,errorMessage:o,isInvalid:a,isRequired:y,defaultValue:v,size:d,...j}=b;return s.jsx(J,{className:p,labelText:c,helperText:i,errorMessage:o,isInvalid:a,isRequired:y,ref:h,...j,children:m.map(({label:w,value:k})=>s.jsx(ie,{size:d,value:k,onChange:x,defaultChecked:v===k,children:w},`${w}-${k}`))})});Ve.displayName="RadioGroup";exports.Checkbox=se;exports.CheckboxGroup=Le;exports.FieldsetControl=J;exports.FileInput=$e;exports.Input=Me;exports.LabelControl=Ye;exports.Radio=ie;exports.RadioGroup=Ve;exports.Select=Sr;exports.Textarea=We;
|