@sakura-ui/forms 0.2.1 → 0.2.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react");var K={exports:{}},V={};/**
|
|
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 Ne;function Sr(){if(Ne)return V;Ne=1;var f=R,x=Symbol.for("react.element"),m=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,p=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function i(o,a,y){var b,c={},j=null,w=null;y!==void 0&&(j=""+y),a.key!==void 0&&(j=""+a.key),a.ref!==void 0&&(w=a.ref);for(b in a)h.call(a,b)&&!v.hasOwnProperty(b)&&(c[b]=a[b]);if(o&&o.defaultProps)for(b in a=o.defaultProps,a)c[b]===void 0&&(c[b]=a[b]);return{$$typeof:x,type:o,key:j,ref:w,props:c,_owner:p.current}}return V.Fragment=m,V.jsx=i,V.jsxs=i,V}var z={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,20 +14,20 @@
|
|
|
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
|
-
`),E=l.length-1,_=
|
|
21
|
-
`+l[E].replace(" at new "," at ");return e.displayName&&
|
|
17
|
+
*/var Oe;function Pr(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&function(){var f=R,x=Symbol.for("react.element"),m=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),v=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"),b=Symbol.for("react.suspense_list"),c=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),P=Symbol.iterator,Be="@@iterator";function Ge(e){if(e===null||typeof e!="object")return null;var r=P&&e[P]||e[Be];return typeof r=="function"?r:null}var D=f.__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];Je("error",e,t)}}function Je(e,r,t){{var n=D.ReactDebugCurrentFrame,d=n.getStackAddendum();d!==""&&(r+="%s",t=t.concat([d]));var g=t.map(function(u){return String(u)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var Ke=!1,He=!1,Xe=!1,Ze=!1,Qe=!1,le;le=Symbol.for("react.module.reference");function er(e){return!!(typeof e=="string"||typeof e=="function"||e===h||e===v||Qe||e===p||e===y||e===b||Ze||e===w||Ke||He||Xe||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===c||e.$$typeof===i||e.$$typeof===o||e.$$typeof===a||e.$$typeof===le||e.getModuleId!==void 0))}function rr(e,r,t){var n=e.displayName;if(n)return n;var d=r.displayName||r.name||"";return d!==""?t+"("+d+")":t}function ue(e){return e.displayName||"Context"}function k(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 h:return"Fragment";case m:return"Portal";case v:return"Profiler";case p:return"StrictMode";case y:return"Suspense";case b:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case o:var r=e;return ue(r)+".Consumer";case i:var t=e;return ue(t._context)+".Provider";case a:return rr(e,e.render,"ForwardRef");case c:var n=e.displayName||null;return n!==null?n:k(e.type)||"Memo";case j:{var d=e,g=d._payload,u=d._init;try{return k(u(g))}catch{return null}}}return null}var O=Object.assign,W=0,ce,de,fe,pe,ve,be,me;function ge(){}ge.__reactDisabledLog=!0;function tr(){{if(W===0){ce=console.log,de=console.info,fe=console.warn,pe=console.error,ve=console.group,be=console.groupCollapsed,me=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ge,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}}function ar(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:O({},e,{value:ce}),info:O({},e,{value:de}),warn:O({},e,{value:fe}),error:O({},e,{value:pe}),group:O({},e,{value:ve}),groupCollapsed:O({},e,{value:be}),groupEnd:O({},e,{value:me})})}W<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var X=D.ReactCurrentDispatcher,Z;function U(e,r,t){{if(Z===void 0)try{throw Error()}catch(d){var n=d.stack.trim().match(/\n( *(at )?)/);Z=n&&n[1]||""}return`
|
|
18
|
+
`+Z+e}}var Q=!1,B;{var nr=typeof WeakMap=="function"?WeakMap:Map;B=new nr}function xe(e,r){if(!e||Q)return"";{var t=B.get(e);if(t!==void 0)return t}var n;Q=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=X.current,X.current=null,tr();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(I){n=I}Reflect.construct(e,[],u)}else{try{u.call()}catch(I){n=I}e.call(u.prototype)}}else{try{throw Error()}catch(I){n=I}e()}}catch(I){if(I&&n&&typeof I.stack=="string"){for(var l=I.stack.split(`
|
|
19
|
+
`),C=n.stack.split(`
|
|
20
|
+
`),E=l.length-1,_=C.length-1;E>=1&&_>=0&&l[E]!==C[_];)_--;for(;E>=1&&_>=0;E--,_--)if(l[E]!==C[_]){if(E!==1||_!==1)do if(E--,_--,_<0||l[E]!==C[_]){var S=`
|
|
21
|
+
`+l[E].replace(" at new "," at ");return e.displayName&&S.includes("<anonymous>")&&(S=S.replace("<anonymous>",e.displayName)),typeof e=="function"&&B.set(e,S),S}while(E>=1&&_>=0);break}}}finally{Q=!1,X.current=g,ar(),Error.prepareStackTrace=d}var $=e?e.displayName||e.name:"",F=$?U($):"";return typeof e=="function"&&B.set(e,F),F}function sr(e,r,t){return xe(e,!1)}function ir(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function G(e,r,t){if(e==null)return"";if(typeof e=="function")return xe(e,ir(e));if(typeof e=="string")return U(e);switch(e){case y:return U("Suspense");case b:return U("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case a:return sr(e.render);case c:return G(e.type,r,t);case j:{var n=e,d=n._payload,g=n._init;try{return G(g(d),r,t)}catch{}}}return""}var Y=Object.prototype.hasOwnProperty,he={},ye=D.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}function or(e,r,t,n,d){{var g=Function.call.bind(Y);for(var u in e)if(g(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(E){l=E}l&&!(l instanceof Error)&&(J(d),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),J(null)),l instanceof Error&&!(l.message in he)&&(he[l.message]=!0,J(d),T("Failed %s type: %s",t,l.message),J(null))}}}var lr=Array.isArray;function ee(e){return lr(e)}function ur(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function cr(e){try{return Re(e),!1}catch{return!0}}function Re(e){return""+e}function Ee(e){if(cr(e))return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ur(e)),Re(e)}var L=D.ReactCurrentOwner,dr={key:!0,ref:!0,__self:!0,__source:!0},_e,je,re;re={};function fr(e){if(Y.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function pr(e){if(Y.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function vr(e,r){if(typeof e.ref=="string"&&L.current&&r&&L.current.stateNode!==r){var t=k(L.current.type);re[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',k(L.current.type),e.ref),re[t]=!0)}}function br(e,r){{var t=function(){_e||(_e=!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 mr(e,r){{var t=function(){je||(je=!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 gr=function(e,r,t,n,d,g,u){var l={$$typeof:x,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:d}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function xr(e,r,t,n,d){{var g,u={},l=null,C=null;t!==void 0&&(Ee(t),l=""+t),pr(r)&&(Ee(r.key),l=""+r.key),fr(r)&&(C=r.ref,vr(r,d));for(g in r)Y.call(r,g)&&!dr.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||C){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;l&&br(u,_),C&&mr(u,_)}return gr(e,l,C,d,n,L.current,u)}}var te=D.ReactCurrentOwner,we=D.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=G(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}var ae;ae=!1;function ne(e){return typeof e=="object"&&e!==null&&e.$$typeof===x}function Te(){{if(te.current){var e=k(te.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 hr(e){return""}var Ce={};function yr(e){{var r=Te();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+t+">.")}return r}}function
|
|
25
|
+
Check the top-level render call using <`+t+">.")}return r}}function Ie(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=yr(r);if(Ce[t])return;Ce[t]=!0;var n="";e&&e._owner&&e._owner!==te.current&&(n=" It was passed a child from "+k(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 Se(e,r){{if(typeof e!="object")return;if(ee(e))for(var t=0;t<e.length;t++){var n=e[t];ne(n)&&Ie(n,r)}else if(ne(e))e._store&&(e._store.validated=!0);else if(e){var d=Ge(e);if(typeof d=="function"&&d!==e.entries)for(var g=d.call(e),u;!(u=g.next()).done;)ne(u.value)&&Ie(u.value,r)}}}function Rr(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===c))t=r.propTypes;else return;if(t){var n=k(r);or(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ae){ae=!0;var d=k(r);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"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 Er(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 Pe={};function ke(e,r,t,n,d,g){{var u=er(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=hr();C?l+=C:l+=Te();var E;e===null?E="null":ee(e)?E="array":e!==void 0&&e.$$typeof===x?(E="<"+(k(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 _=xr(e,r,t,d,g);if(_==null)return _;if(u){var S=r.children;if(S!==void 0)if(n)if(ee(S)){for(var $=0;$<S.length;$++)Se(S[$],e);Object.freeze&&Object.freeze(S)}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 Se(S,e)}if(Y.call(r,"key")){var F=k(e),I=Object.keys(r).filter(function(Ir){return Ir!=="key"}),se=I.length>0?"{key: someKey, "+I.join(": ..., ")+": ...}":"{key: someKey}";if(!Pe[F+se]){var Cr=I.length>0?"{"+I.join(": ..., ")+": ...}":"{}";T(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
30
|
+
<%s key={someKey} {...props} />`,se,F,Cr,F),Pe[F+se]=!0}}return e===h?Er(_):Rr(_),_}}function _r(e,r,t){return ke(e,r,t,!0)}function jr(e,r,t){return ke(e,r,t,!1)}var wr=jr,Tr=_r;z.Fragment=h,z.jsx=wr,z.jsxs=Tr}()),z}var Fe;function kr(){return Fe||(Fe=1,process.env.NODE_ENV==="production"?K.exports=Sr():K.exports=Pr()),K.exports}var s=kr();const M=(...f)=>f.filter(Boolean).join(" "),N=R.createContext({helperTextId:"",errorMessageId:"",isInvalid:!1,isRequired:!1}),qe=`
|
|
31
31
|
bg-white
|
|
32
32
|
border
|
|
33
33
|
border-solid
|
|
@@ -40,7 +40,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
40
40
|
disabled:text-sumi-500
|
|
41
41
|
disabled:border-sumi-500
|
|
42
42
|
aria-invalid:border-sun-800
|
|
43
|
-
`,
|
|
43
|
+
`,De={lg:`
|
|
44
44
|
p-4
|
|
45
45
|
text-label
|
|
46
46
|
rounded-lg
|
|
@@ -57,13 +57,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
57
57
|
text-label
|
|
58
58
|
rounded-md
|
|
59
59
|
leading-snug
|
|
60
|
-
`},
|
|
60
|
+
`},Ae=`
|
|
61
61
|
inline-block
|
|
62
62
|
cursor-pointer
|
|
63
63
|
border
|
|
64
64
|
border-solid
|
|
65
65
|
border-transparent
|
|
66
|
-
|
|
66
|
+
`,$e={lg:`
|
|
67
67
|
pr-8
|
|
68
68
|
py-4
|
|
69
69
|
text-label
|
|
@@ -78,10 +78,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
78
78
|
py-2
|
|
79
79
|
text-label
|
|
80
80
|
leading-snug
|
|
81
|
-
`},
|
|
81
|
+
`},Me={lg:"w-[22px] h-[22px] mr-2",md:"w-[18px] h-[18px] mr-1.5",sm:"w-[18px] h-[18px] mr-1"},ie=R.forwardRef((f,x)=>{const{id:m,className:h,size:p="lg",children:v,...i}=f,o=m||R.useId(),a=R.useContext(N);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:M(Ae,$e[p],h),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:o,className:`
|
|
82
82
|
peer
|
|
83
83
|
sr-only
|
|
84
|
-
`,type:"checkbox","aria-describedby":a.helperTextId,"aria-errormessage":a.errorMessageId,"aria-invalid":a.isInvalid??!1,"aria-required":a.isRequired??!1,...i,ref:
|
|
84
|
+
`,type:"checkbox","aria-describedby":a.helperTextId,"aria-errormessage":a.errorMessageId,"aria-invalid":a.isInvalid??!1,"aria-required":a.isRequired??!1,...i,ref:x}),s.jsx("span",{className:M(`
|
|
85
85
|
bg-clip-content
|
|
86
86
|
rounded
|
|
87
87
|
border
|
|
@@ -94,11 +94,11 @@ React keys must be passed directly to JSX without using spread:
|
|
|
94
94
|
peer-disabled:border-sumi-500
|
|
95
95
|
peer-focus-visible:ring-2
|
|
96
96
|
peer-focus-visible:ring-offset-2
|
|
97
|
-
peer-focus-visible:ring-wood-
|
|
98
|
-
`,
|
|
97
|
+
peer-focus-visible:ring-wood-600
|
|
98
|
+
`,Me[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:v})]})})});ie.displayName="Checkbox";const q=(...f)=>f.filter(Boolean).join(" "),oe=R.forwardRef((f,x)=>{const{id:m,className:h,size:p="lg",children:v,...i}=f,o=m||R.useId(),a=R.useContext(N);a.isRequired&&(i.required=!0),a.groupName&&(i.name=a.groupName);const y=`
|
|
99
99
|
peer
|
|
100
100
|
sr-only
|
|
101
|
-
`,
|
|
101
|
+
`,b=`
|
|
102
102
|
bg-clip-content
|
|
103
103
|
rounded-full
|
|
104
104
|
border
|
|
@@ -109,13 +109,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
109
109
|
peer-disabled:border-sumi-500
|
|
110
110
|
peer-focus-visible:ring-2
|
|
111
111
|
peer-focus-visible:ring-offset-2
|
|
112
|
-
peer-focus-visible:ring-wood-
|
|
113
|
-
`,
|
|
112
|
+
peer-focus-visible:ring-wood-600
|
|
113
|
+
`,c={lg:"p-1",md:"p-[3px]",sm:"p-[3px]"};return s.jsx("label",{htmlFor:o,className:q(Ae,$e[p],h),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:x}),s.jsx("span",{"aria-hidden":!0,className:q(b,c[p],Me[p])}),s.jsx("span",{className:"peer-disabled:text-sumi-500",children:v})]})})});oe.displayName="Radio";const Nr=R.forwardRef((f,x)=>{const{id:m,className:h,size:p="lg",children:v,...i}=f,o=R.useContext(N);return o.isRequired&&(i.required=!0),s.jsxs("div",{className:"inline-block relative",children:[s.jsx("select",{id:m||o.id,className:q(`
|
|
114
114
|
!pr-8
|
|
115
115
|
peer
|
|
116
116
|
cursor-pointer
|
|
117
117
|
appearance-none
|
|
118
|
-
`,
|
|
118
|
+
`,qe,De[p],f.className),"aria-describedby":o.helperTextId,"aria-errormessage":o.errorMessageId,"aria-invalid":o.isInvalid??!1,"aria-required":o.isRequired??!1,...i,ref:x,children:v}),s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:`
|
|
119
119
|
pointer-events-none
|
|
120
120
|
absolute
|
|
121
121
|
right-4
|
|
@@ -123,7 +123,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
123
123
|
-translate-y-1/2
|
|
124
124
|
text-sumi-900
|
|
125
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"})]})]})})
|
|
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"})]})]})}),We=R.forwardRef((f,x)=>{const{id:m,className:h,size:p="lg",...v}=f,i=R.useContext(N);i.isRequired&&(v.required=!0);const o=`
|
|
127
127
|
file:mr-2
|
|
128
128
|
file:inline-block
|
|
129
129
|
file:text-button
|
|
@@ -157,7 +157,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
157
157
|
focus:outline-2
|
|
158
158
|
focus:outline-wood-600
|
|
159
159
|
aria-invalid:text-sun-800
|
|
160
|
-
`,
|
|
160
|
+
`,b={lg:`
|
|
161
161
|
file:p-4
|
|
162
162
|
file:text-button
|
|
163
163
|
file:rounded-lg
|
|
@@ -174,7 +174,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
174
174
|
file:text-button
|
|
175
175
|
file:rounded-md
|
|
176
176
|
file:leading-snug
|
|
177
|
-
`};return s.jsx("input",{type:"file",id:m||i.id,className:
|
|
177
|
+
`};return s.jsx("input",{type:"file",id:m||i.id,className:M(o,a,b[p],y,h),"aria-describedby":i.helperTextId,"aria-errormessage":i.errorMessageId,"aria-invalid":i.isInvalid??!1,"aria-required":i.isRequired??!1,ref:x,...v})});We.displayName="FileInput";const Ye=R.forwardRef((f,x)=>{const{id:m,className:h,size:p="lg",...v}=f,i=R.useContext(N);return i.isRequired&&(v.required=!0),s.jsx("input",{type:"text",id:m||i.id,className:q(qe,De[p],h),"aria-describedby":i.helperTextId,"aria-errormessage":i.errorMessageId,"aria-invalid":i.isInvalid??!1,"aria-required":i.isRequired??!1,ref:x,...v})});Ye.displayName="Input";const Le=R.forwardRef((f,x)=>{const{id:m,className:h,children:p,onChange:v,maxLength:i,...o}=f,[a,y]=R.useState(0),b=P=>{v&&v(P),y(P.target.value.length)},c=R.useContext(N);c.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||c.id,className:q(`
|
|
178
178
|
p-4
|
|
179
179
|
text-label
|
|
180
180
|
rounded-lg
|
|
@@ -189,8 +189,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
189
189
|
disabled:text-sumi-500
|
|
190
190
|
disabled:border-sumi-500
|
|
191
191
|
aria-invalid:border-sun-800
|
|
192
|
-
`,
|
|
192
|
+
`,h),"aria-describedby":c.helperTextId,"aria-errormessage":c.errorMessageId,"aria-invalid":c.isInvalid??!1,"aria-required":c.isRequired??!1,onChange:b,...o,ref:x,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})]}):""]})});Le.displayName="Textarea";const Ve=R.forwardRef((f,x)=>{const m=R.useId(),{labelText:h,className:p,helperText:v,errorMessage:i,isInvalid:o,isRequired:a,children:y,...b}=f,c={id:f.htmlFor??`input-${m}`,helperTextId:`helper-text-${m}`,errorMessageId:`error-message-${m}`,isInvalid:o??!1,isRequired:a??!1};return s.jsx(N.Provider,{value:c,children:s.jsxs("div",{className:q("flex flex-col gap-2",p),children:[s.jsxs("label",{className:q("block text-label",o&&"text-sun-800"),htmlFor:c.id,ref:x,...b,children:[h,a&&s.jsx("span",{className:"text-label text-sun-800",children:" *"})]}),v&&s.jsx("p",{id:c.helperTextId,className:`
|
|
193
193
|
text-label text-sumi-700
|
|
194
|
-
`,
|
|
194
|
+
`,children:v}),y,o&&s.jsx("p",{id:c.errorMessageId,className:`
|
|
195
195
|
text-label text-sun-800
|
|
196
|
-
`,
|
|
196
|
+
`,children:i})]})})});Ve.displayName="LabelControl";const H=R.forwardRef((f,x)=>{const m=R.useId(),{labelText:h,className:p,helperText:v,errorMessage:i,isInvalid:o,isRequired:a,direction:y,children:b,...c}=f,w={groupName:c.name??`group-${m}`,helperTextId:`helper-text-${m}`,errorMessageId:`error-message-${m}`,isInvalid:o??!1,isRequired:a??!1},P=y??"flex-col";return s.jsx(N.Provider,{value:w,children:s.jsxs("fieldset",{className:M("flex flex-col gap-2",p),ref:x,...c,children:[s.jsx("legend",{children:s.jsxs("p",{className:M("block text-label",o&&"text-sun-800"),children:[h,a&&s.jsx("span",{className:"text-sun-800",children:" *"})]})}),s.jsx("div",{className:M("inline-flex",P),children:b}),v&&s.jsx("p",{id:w.helperTextId,className:"text-sup text-sumi-700",children:v}),o&&s.jsx("p",{id:w.errorMessageId,className:"text-label text-sun-800",children:i})]})})});H.displayName="FieldsetControl";const ze=R.forwardRef((f,x)=>{const{items:m,onChange:h,className:p,labelText:v,helperText:i,errorMessage:o,isInvalid:a,isRequired:y,size:b,...c}=f;return s.jsx(H,{className:p,labelText:v,helperText:i,errorMessage:o,isInvalid:a,isRequired:y,ref:x,...c,children:m.map(({label:j,value:w})=>s.jsx(ie,{size:b,value:w,onChange:h,children:j},`${j}-${w}`))})});ze.displayName="CheckboxGroup";const Ue=R.forwardRef((f,x)=>{const{items:m,onChange:h,className:p,labelText:v,helperText:i,errorMessage:o,isInvalid:a,isRequired:y,defaultValue:b,size:c,...j}=f;return s.jsx(H,{className:p,labelText:v,helperText:i,errorMessage:o,isInvalid:a,isRequired:y,ref:x,...j,children:m.map(({label:w,value:P})=>s.jsx(oe,{size:c,value:P,onChange:h,defaultChecked:b===P,children:w},`${w}-${P}`))})});Ue.displayName="RadioGroup";exports.Checkbox=ie;exports.CheckboxGroup=ze;exports.FieldsetControl=H;exports.FileInput=We;exports.Input=Ye;exports.LabelControl=Ve;exports.Radio=oe;exports.RadioGroup=Ue;exports.Select=Nr;exports.Textarea=Le;
|