@sakura-ui/sakura-ui 0.1.16 → 0.1.17
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/package.json +1 -1
- package/packages/config/package.json +2 -1
- package/packages/config/src/index.ts +8 -0
- package/packages/core/package.json +2 -1
- package/packages/core/src/components/Button.tsx +23 -56
- package/packages/core/src/components/Card.tsx +14 -14
- package/packages/core/src/components/Code.tsx +1 -1
- package/packages/core/src/components/Faq.tsx +3 -5
- package/packages/core/src/components/Heading.tsx +1 -1
- package/packages/core/src/components/Icon.tsx +2 -6
- package/packages/core/src/components/IconButton.tsx +47 -76
- package/packages/core/src/components/InfoCard.tsx +1 -1
- package/packages/core/src/components/Link.tsx +53 -44
- package/packages/core/src/components/List.tsx +1 -1
- package/packages/core/src/components/Pre.tsx +1 -1
- package/packages/core/src/components/Table.tsx +1 -1
- package/packages/core/src/components/buttonStyle.ts +83 -0
- package/packages/core/src/components/index.ts +24 -7
- package/packages/core/src/index.ts +26 -0
- package/packages/core/src/libs/forward-ref.ts +41 -0
- package/packages/core/src/types/component.ts +82 -0
- package/packages/forms/dist/components/Checkbox.d.ts.map +1 -1
- package/packages/forms/dist/components/Checkbox.js +26 -23
- package/packages/forms/dist/components/Checkbox.js.map +1 -1
- package/packages/forms/dist/components/FileInput.d.ts +5 -0
- package/packages/forms/dist/components/FileInput.d.ts.map +1 -0
- package/packages/forms/dist/components/FileInput.js +51 -0
- package/packages/forms/dist/components/FileInput.js.map +1 -0
- package/packages/forms/dist/components/Input.d.ts.map +1 -1
- package/packages/forms/dist/components/Input.js +1 -0
- package/packages/forms/dist/components/Input.js.map +1 -1
- package/packages/forms/dist/components/LabelControl.d.ts.map +1 -1
- package/packages/forms/dist/components/LabelControl.js +7 -1
- package/packages/forms/dist/components/LabelControl.js.map +1 -1
- package/packages/forms/dist/components/Radio.d.ts.map +1 -1
- package/packages/forms/dist/components/Radio.js +25 -23
- package/packages/forms/dist/components/Radio.js.map +1 -1
- package/packages/forms/dist/components/Select.d.ts.map +1 -1
- package/packages/forms/dist/components/Select.js +1 -0
- package/packages/forms/dist/components/Select.js.map +1 -1
- package/packages/forms/dist/components/Textarea.d.ts.map +1 -1
- package/packages/forms/dist/components/Textarea.js +1 -0
- package/packages/forms/dist/components/Textarea.js.map +1 -1
- package/packages/forms/dist/components/index.d.ts +8 -7
- package/packages/forms/dist/components/index.d.ts.map +1 -1
- package/packages/forms/dist/components/index.js +1 -0
- package/packages/forms/dist/components/index.js.map +1 -1
- package/packages/forms/dist/index.cjs.js +103 -59
- package/packages/forms/dist/index.cjs.js.map +1 -1
- package/packages/forms/dist/index.d.ts +2 -1
- package/packages/forms/dist/index.d.ts.map +1 -1
- package/packages/forms/dist/index.es.js +383 -313
- package/packages/forms/dist/index.es.js.map +1 -1
- package/packages/forms/dist/index.js +1 -1
- package/packages/forms/dist/index.js.map +1 -1
- package/packages/forms/package.json +2 -1
- package/packages/forms/src/components/Checkbox.tsx +26 -23
- package/packages/forms/src/components/FileInput.tsx +77 -0
- package/packages/forms/src/components/Input.tsx +1 -0
- package/packages/forms/src/components/LabelControl.tsx +13 -6
- package/packages/forms/src/components/Radio.tsx +27 -23
- package/packages/forms/src/components/Select.tsx +1 -0
- package/packages/forms/src/components/Textarea.tsx +1 -0
- package/packages/forms/src/components/index.ts +8 -7
- package/packages/forms/src/index.ts +12 -0
- /package/packages/core/src/{utils/class.ts → libs/cx.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react");var 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 Se;function Rr(){if(Se)return W;Se=1;var f=g,m=Symbol.for("react.element"),b=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function p(c,o,_){var h,y={},j=null,T=null;_!==void 0&&(j=""+_),o.key!==void 0&&(j=""+o.key),o.ref!==void 0&&(T=o.ref);for(h in o)u.call(o,h)&&!a.hasOwnProperty(h)&&(y[h]=o[h]);if(c&&c.defaultProps)for(h in o=c.defaultProps,o)y[h]===void 0&&(y[h]=o[h]);return{$$typeof:m,type:c,key:j,ref:T,props:y,_owner:n.current}}return W.Fragment=b,W.jsx=p,W.jsxs=p,W}var L={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,63 +14,68 @@
|
|
|
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 Oe;function
|
|
18
|
-
`+K+e}}var X=!1,V;{var
|
|
19
|
-
`),C=
|
|
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
|
|
21
|
-
`+l[R].replace(" at new "," at ");return e.displayName&&
|
|
17
|
+
*/var Oe;function Er(){return Oe||(Oe=1,process.env.NODE_ENV!=="production"&&function(){var f=g,m=Symbol.for("react.element"),b=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),p=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"),y=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),P=Symbol.iterator,We="@@iterator";function Le(e){if(e===null||typeof e!="object")return null;var r=P&&e[P]||e[We];return typeof r=="function"?r:null}var D=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),i=1;i<r;i++)t[i-1]=arguments[i];Ye("error",e,t)}}function Ye(e,r,t){{var i=D.ReactDebugCurrentFrame,v=i.getStackAddendum();v!==""&&(r+="%s",t=t.concat([v]));var x=t.map(function(d){return String(d)});x.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,x)}}var Ve=!1,Ue=!1,Ge=!1,Be=!1,Je=!1,oe;oe=Symbol.for("react.module.reference");function ze(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===a||Je||e===n||e===_||e===h||Be||e===T||Ve||Ue||Ge||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===y||e.$$typeof===p||e.$$typeof===c||e.$$typeof===o||e.$$typeof===oe||e.getModuleId!==void 0))}function He(e,r,t){var i=e.displayName;if(i)return i;var v=r.displayName||r.name||"";return v!==""?t+"("+v+")":t}function le(e){return e.displayName||"Context"}function S(e){if(e==null)return null;if(typeof e.tag=="number"&&w("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 u:return"Fragment";case b:return"Portal";case a:return"Profiler";case n: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 p:var t=e;return le(t._context)+".Provider";case o:return He(e,e.render,"ForwardRef");case y:var i=e.displayName||null;return i!==null?i:S(e.type)||"Memo";case j:{var v=e,x=v._payload,d=v._init;try{return S(d(x))}catch{return null}}}return null}var F=Object.assign,$=0,ue,ce,de,fe,pe,ve,be;function me(){}me.__reactDisabledLog=!0;function Ke(){{if($===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})}$++}}function Xe(){{if($--,$===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})})}$<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=D.ReactCurrentDispatcher,K;function Y(e,r,t){{if(K===void 0)try{throw Error()}catch(v){var i=v.stack.trim().match(/\n( *(at )?)/);K=i&&i[1]||""}return`
|
|
18
|
+
`+K+e}}var X=!1,V;{var Ze=typeof WeakMap=="function"?WeakMap:Map;V=new Ze}function he(e,r){if(!e||X)return"";{var t=V.get(e);if(t!==void 0)return t}var i;X=!0;var v=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var x;x=H.current,H.current=null,Ke();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(O){i=O}Reflect.construct(e,[],d)}else{try{d.call()}catch(O){i=O}e.call(d.prototype)}}else{try{throw Error()}catch(O){i=O}e()}}catch(O){if(O&&i&&typeof O.stack=="string"){for(var l=O.stack.split(`
|
|
19
|
+
`),C=i.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 N=`
|
|
21
|
+
`+l[R].replace(" at new "," at ");return e.displayName&&N.includes("<anonymous>")&&(N=N.replace("<anonymous>",e.displayName)),typeof e=="function"&&V.set(e,N),N}while(R>=1&&E>=0);break}}}finally{X=!1,H.current=x,Xe(),Error.prepareStackTrace=v}var A=e?e.displayName||e.name:"",Pe=A?Y(A):"";return typeof e=="function"&&V.set(e,Pe),Pe}function Qe(e,r,t){return he(e,!1)}function er(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function U(e,r,t){if(e==null)return"";if(typeof e=="function")return he(e,er(e));if(typeof e=="string")return Y(e);switch(e){case _:return Y("Suspense");case h:return Y("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case o:return Qe(e.render);case y:return U(e.type,r,t);case j:{var i=e,v=i._payload,x=i._init;try{return U(x(v),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 rr(e,r,t,i,v){{var x=Function.call.bind(G);for(var d in e)if(x(e,d)){var l=void 0;try{if(typeof e[d]!="function"){var C=Error((i||"React class")+": "+t+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw C.name="Invariant Violation",C}l=e[d](r,d,i,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){l=R}l&&!(l instanceof Error)&&(B(v),w("%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).",i||"React class",t,d,typeof l),B(null)),l instanceof Error&&!(l.message in xe)&&(xe[l.message]=!0,B(v),w("Failed %s type: %s",t,l.message),B(null))}}}var tr=Array.isArray;function Z(e){return tr(e)}function ar(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function nr(e){try{return ye(e),!1}catch{return!0}}function ye(e){return""+e}function Re(e){if(nr(e))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(e)),ye(e)}var q=D.ReactCurrentOwner,sr={key:!0,ref:!0,__self:!0,__source:!0},Ee,_e,Q;Q={};function ir(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 or(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 lr(e,r){if(typeof e.ref=="string"&&q.current&&r&&q.current.stateNode!==r){var t=S(q.current.type);Q[t]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',S(q.current.type),e.ref),Q[t]=!0)}}function ur(e,r){{var t=function(){Ee||(Ee=!0,w("%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 cr(e,r){{var t=function(){_e||(_e=!0,w("%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 dr=function(e,r,t,i,v,x,d){var l={$$typeof:m,type:e,key:r,ref:t,props:d,_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:i}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l};function fr(e,r,t,i,v){{var x,d={},l=null,C=null;t!==void 0&&(Re(t),l=""+t),or(r)&&(Re(r.key),l=""+r.key),ir(r)&&(C=r.ref,lr(r,v));for(x in r)G.call(r,x)&&!sr.hasOwnProperty(x)&&(d[x]=r[x]);if(e&&e.defaultProps){var R=e.defaultProps;for(x in R)d[x]===void 0&&(d[x]=R[x])}if(l||C){var E=typeof e=="function"?e.displayName||e.name||"Unknown":e;l&&ur(d,E),C&&cr(d,E)}return dr(e,l,C,v,i,q.current,d)}}var ee=D.ReactCurrentOwner,Te=D.ReactDebugCurrentFrame;function M(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===m}function je(){{if(ee.current){var e=S(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 pr(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 we={};function vr(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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
27
|
+
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=vr(r);if(we[t])return;we[t]=!0;var i="";e&&e._owner&&e._owner!==ee.current&&(i=" It was passed a child from "+S(e._owner.type)+"."),M(e),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,i),M(null)}}function Ie(e,r){{if(typeof e!="object")return;if(Z(e))for(var t=0;t<e.length;t++){var i=e[t];te(i)&&Ce(i,r)}else if(te(e))e._store&&(e._store.validated=!0);else if(e){var v=Le(e);if(typeof v=="function"&&v!==e.entries)for(var x=v.call(e),d;!(d=x.next()).done;)te(d.value)&&Ce(d.value,r)}}}function br(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===y))t=r.propTypes;else return;if(t){var i=S(r);rr(t,e.props,"prop",i,e)}else if(r.PropTypes!==void 0&&!re){re=!0;var v=S(r);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",v||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&w("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 i=r[t];if(i!=="children"&&i!=="key"){M(e),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",i),M(null);break}}e.ref!==null&&(M(e),w("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}function Ne(e,r,t,i,v,x){{var d=ze(e);if(!d){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=pr(v);C?l+=C:l+=je();var R;e===null?R="null":Z(e)?R="array":e!==void 0&&e.$$typeof===m?(R="<"+(S(e.type)||"Unknown")+" />",l=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,w("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=fr(e,r,t,v,x);if(E==null)return E;if(d){var N=r.children;if(N!==void 0)if(i)if(Z(N)){for(var A=0;A<N.length;A++)Ie(N[A],e);Object.freeze&&Object.freeze(N)}else w("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(N,e)}return e===u?mr(E):br(E),E}}function hr(e,r,t){return Ne(e,r,t,!0)}function xr(e,r,t){return Ne(e,r,t,!1)}var gr=xr,yr=hr;L.Fragment=u,L.jsx=gr,L.jsxs=yr}()),L}process.env.NODE_ENV==="production"?ae.exports=Rr():ae.exports=Er();var s=ae.exports;const I=(...f)=>f.filter(Boolean).join(" "),k=g.createContext({helperTextId:"",errorMessageId:"",isInvalid:!1,isRequired:!1}),ne=g.forwardRef((f,m)=>{const{className:b,children:u,...n}=f,a=g.useContext(k);a.isRequired&&(n.required=!0),a.groupName&&(n.name=a.groupName);const p=`
|
|
28
|
+
inline-block
|
|
29
|
+
text-base
|
|
30
|
+
cursor-pointer
|
|
31
|
+
py-2
|
|
32
|
+
mr-4
|
|
33
|
+
`,c=`
|
|
34
|
+
peer
|
|
35
|
+
sr-only
|
|
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
|
+
peer-focus-visible:ring-2
|
|
51
|
+
peer-focus-visible:ring-offset-2
|
|
52
|
+
peer-focus-visible:ring-wood-500
|
|
53
|
+
`;return s.jsx("label",{htmlFor:n.id,className:I(p,b),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,...n,ref:m}),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:u})]})})});ne.displayName="Checkbox";const se=g.forwardRef((f,m)=>{const{className:b,children:u,...n}=f,a=g.useContext(k);a.isRequired&&(n.required=!0),a.groupName&&(n.name=a.groupName);const p=`
|
|
54
|
+
inline-block
|
|
55
|
+
text-base
|
|
56
|
+
cursor-pointer
|
|
57
|
+
py-2
|
|
58
|
+
mr-4
|
|
59
|
+
`,c=`
|
|
60
|
+
peer
|
|
61
|
+
sr-only
|
|
62
|
+
`,o=`
|
|
63
|
+
bg-clip-content
|
|
64
|
+
w-6 h-6
|
|
65
|
+
ml-1
|
|
66
|
+
mr-2
|
|
67
|
+
p-1
|
|
68
|
+
rounded-full
|
|
69
|
+
border
|
|
70
|
+
border-solid
|
|
71
|
+
border-sumi-900
|
|
72
|
+
peer-checked:bg-sea-600
|
|
73
|
+
peer-checked:border-sea-600
|
|
74
|
+
peer-disabled:border-sumi-500
|
|
75
|
+
peer-focus-visible:ring-2
|
|
76
|
+
peer-focus-visible:ring-offset-2
|
|
77
|
+
peer-focus-visible:ring-wood-500
|
|
78
|
+
`;return s.jsx("label",{htmlFor:n.id,className:I(p,b),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,...n,ref:m}),s.jsx("span",{className:o}),s.jsx("span",{className:"peer-disabled:text-sumi-500",children:u})]})})});se.displayName="Radio";const ke=g.forwardRef((f,m)=>{const{className:b,children:u,...n}=f,a=g.useContext(k);a.isRequired&&(n.required=!0);const p=a.isInvalid?"border-sun-800":"border-sumi-900",c=`
|
|
74
79
|
peer
|
|
75
80
|
cursor-pointer
|
|
76
81
|
appearance-none
|
|
@@ -81,6 +86,7 @@ Check the top-level render call using <`+t+">.")}return r}}function we(e,r){{if(
|
|
|
81
86
|
border-solid
|
|
82
87
|
py-4 px-4 pr-8
|
|
83
88
|
rounded-[8px]
|
|
89
|
+
outline-offset-2
|
|
84
90
|
focus:outline
|
|
85
91
|
focus:outline-2
|
|
86
92
|
focus:outline-wood-500
|
|
@@ -93,27 +99,65 @@ Check the top-level render call using <`+t+">.")}return r}}function we(e,r){{if(
|
|
|
93
99
|
px-2
|
|
94
100
|
pointer-events-none
|
|
95
101
|
peer-disabled:fill-sumi-500
|
|
96
|
-
`;return s.jsxs("label",{className:"inline-block relative",children:[s.jsx("select",{id:
|
|
102
|
+
`;return s.jsxs("label",{className:"inline-block relative",children:[s.jsx("select",{id:n.id??a.id,className:I(c,p,f.className),"aria-describedby":a.helperTextId,"aria-errormessage":a.errorMessageId,"aria-invalid":a.isInvalid??!1,...n,ref:m,children:u}),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=g.forwardRef((f,m)=>{const{className:b,...u}=f,n=g.useContext(k);n.isRequired&&(u.required=!0);const a=n.isInvalid?"text-sun-800":"text-sumi-900",p=`
|
|
103
|
+
file:inline-block
|
|
104
|
+
file:text-button
|
|
105
|
+
file:text-center
|
|
106
|
+
file:cursor-pointer
|
|
107
|
+
file:whitespace-nowrap
|
|
108
|
+
file:border
|
|
109
|
+
file:border-solid
|
|
110
|
+
file:border-sea-800
|
|
111
|
+
file:active:border-sea-1200
|
|
112
|
+
file:hover:border-sea-900
|
|
113
|
+
file:disabled:border-sumi-500
|
|
114
|
+
file:disabled:cursor-not-allowed
|
|
115
|
+
`,c=`
|
|
116
|
+
file:text-sea-800
|
|
117
|
+
file:bg-transparent
|
|
118
|
+
file:active:bg-sea-200
|
|
119
|
+
file:hover:bg-sea-100
|
|
120
|
+
file:active:text-sea-1200
|
|
121
|
+
file:hover:text-sea-900
|
|
122
|
+
file:disabled:text-sumi-500
|
|
123
|
+
file:disabled:bg-transparent
|
|
124
|
+
`,o=`
|
|
125
|
+
file:p-4
|
|
126
|
+
file:text-button
|
|
127
|
+
file:rounded-lg
|
|
128
|
+
`,_=`
|
|
129
|
+
rounded-lg
|
|
130
|
+
outline-offset-2
|
|
131
|
+
focus:outline
|
|
132
|
+
focus:outline-2
|
|
133
|
+
focus:outline-wood-600
|
|
134
|
+
`;return s.jsx("input",{type:"file",id:u.id??n.id,className:I(p,c,o,_,a,b),"aria-describedby":n.helperTextId,"aria-errormessage":n.errorMessageId,"aria-invalid":n.isInvalid??!1,ref:m,...u})});Fe.displayName="FileInput";const De=g.forwardRef((f,m)=>{const{className:b,...u}=f,n=g.useContext(k);n.isRequired&&(u.required=!0);const a=n.isInvalid?"border-sun-800":"border-sumi-900",p=`
|
|
97
135
|
p-4
|
|
98
136
|
rounded-lg
|
|
99
137
|
border
|
|
100
138
|
border-solid
|
|
139
|
+
outline-offset-2
|
|
101
140
|
focus:outline
|
|
102
141
|
focus:outline-2
|
|
103
142
|
focus:outline-wood-500
|
|
104
143
|
disabled:bg-transparent
|
|
105
144
|
disabled:text-sumi-500
|
|
106
145
|
disabled:border-sumi-500
|
|
107
|
-
`;return s.jsx("input",{type:"text",id:
|
|
146
|
+
`;return s.jsx("input",{type:"text",id:u.id??n.id,className:I(p,a,b),"aria-describedby":n.helperTextId,"aria-errormessage":n.errorMessageId,"aria-invalid":n.isInvalid??!1,ref:m,...u})});De.displayName="Input";const ie=g.forwardRef((f,m)=>{const{className:b,children:u,onChange:n,maxLength:a,...p}=f,[c,o]=g.useState(0),_=P=>{n&&n(P),o(P.target.value.length)},h=g.useContext(k);h.isRequired&&(p.required=!0);const y=h.isInvalid?"border-sun-800":"border-sumi-900",j=c>(a||0)?"text-sun-800":"text-sumi-700",T=`
|
|
108
147
|
p-4
|
|
109
148
|
rounded-lg
|
|
110
149
|
border
|
|
111
150
|
border-solid
|
|
151
|
+
outline-offset-2
|
|
112
152
|
focus:outline
|
|
113
153
|
focus:outline-2
|
|
114
154
|
focus:outline-wood-500
|
|
115
155
|
disabled:bg-transparent
|
|
116
156
|
disabled:text-sumi-500
|
|
117
157
|
disabled:border-sumi-500
|
|
118
|
-
`;return s.jsxs(s.Fragment,{children:[s.jsx("textarea",{id:
|
|
158
|
+
`;return s.jsxs(s.Fragment,{children:[s.jsx("textarea",{id:p.id??h.id,className:I(T,y,b),"aria-describedby":h.helperTextId,"aria-errormessage":h.errorMessageId,"aria-invalid":h.isInvalid??!1,onChange:_,...p,ref:m,children:u}),a?s.jsxs("p",{className:"text-sup text-sumi-700",children:[s.jsx("span",{className:j,children:c}),"/",s.jsx("span",{children:a})]}):""]})});ie.displayName="Textarea";const J=g.forwardRef((f,m)=>{const b=g.useId(),{labelText:u,className:n,helperText:a,errorMessage:p,isInvalid:c,isRequired:o,children:_,...h}=f,y={id:f.htmlFor??`input-${b}`,helperTextId:`helper-text-${b}`,errorMessageId:`error-message-${b}`,isInvalid:c??!1,isRequired:o??!1},j=`
|
|
159
|
+
text-sup text-sumi-700
|
|
160
|
+
`,T=`
|
|
161
|
+
text-sup text-sun-800
|
|
162
|
+
`;return s.jsx(k.Provider,{value:y,children:s.jsxs("div",{className:I("mb-4",n),children:[s.jsxs("label",{className:I("block mb-2 text-label",c&&"text-sun-800"),htmlFor:y.id,ref:m,...h,children:[u,o&&s.jsx("span",{className:"text-label text-sun-800",children:" *"})]}),a&&s.jsx("p",{id:y.helperTextId,className:I(j,"mb-2"),children:a}),_,c&&s.jsx("p",{id:y.errorMessageId,className:I(T,a?"mt-1":"mt-2"),children:p})]})})});J.displayName="LabelControl";const z=g.forwardRef((f,m)=>{const b=g.useId(),{labelText:u,className:n,helperText:a,errorMessage:p,isInvalid:c,isRequired:o,direction:_,children:h,...y}=f,T={groupName:y.name??`group-${b}`,helperTextId:`helper-text-${b}`,errorMessageId:`error-message-${b}`,isInvalid:c??!1,isRequired:o??!1},P=_??"flex-col";return s.jsx(k.Provider,{value:T,children:s.jsxs("fieldset",{className:I("mb-4",n),ref:m,...y,children:[s.jsx("legend",{children:s.jsxs("p",{className:I("block mb-2 text-label",c&&"text-sun-800"),children:[u,o&&s.jsx("span",{className:"text-sun-800",children:" *"})]})}),s.jsx("div",{className:I("inline-flex",P),children:h}),a&&s.jsx("p",{id:T.helperTextId,className:"text-sup text-sumi-700 mt-2",children:a}),c&&s.jsx("p",{id:T.errorMessageId,className:I("text-sup text-sun-800",a?"mt-1":"mt-2"),children:p})]})})});z.displayName="FieldsetControl";const Me=g.forwardRef((f,m)=>{const{items:b,onChange:u,className:n,labelText:a,helperText:p,errorMessage:c,isInvalid:o,isRequired:_,...h}=f;return s.jsx(z,{className:n,labelText:a,helperText:p,errorMessage:c,isInvalid:o,isRequired:_,ref:m,...h,children:b.map(({label:y,value:j},T)=>s.jsx(ne,{value:j,onChange:u,children:y},T))})});Me.displayName="CheckboxGroup";const Ae=g.forwardRef((f,m)=>{const{items:b,onChange:u,className:n,labelText:a,helperText:p,errorMessage:c,isInvalid:o,isRequired:_,defaultValue:h,...y}=f;return s.jsx(z,{className:n,labelText:a,helperText:p,errorMessage:c,isInvalid:o,isRequired:_,ref:m,...y,children:b.map(({label:j,value:T},P)=>s.jsx(se,{value:T,onChange:u,defaultChecked:h===T,children:j},P))})});Ae.displayName="RadioGroup";const $e=g.forwardRef((f,m)=>{const{className:b,labelText:u,helperText:n,errorMessage:a,isInvalid:p,isRequired:c,...o}=f;return s.jsx(J,{className:b,labelText:u,helperText:n,errorMessage:a,isInvalid:p,isRequired:c,children:s.jsx(ke,{ref:m,...o})})});$e.displayName="SelectControl";const qe=g.forwardRef((f,m)=>{const{className:b,labelText:u,helperText:n,errorMessage:a,isInvalid:p,isRequired:c,...o}=f;return s.jsx(J,{className:b,labelText:u,helperText:n,errorMessage:a,isInvalid:p,isRequired:c,children:s.jsx(ie,{ref:m,...o})})});qe.displayName="TextareaControl";exports.Checkbox=ne;exports.CheckboxGroup=Me;exports.FieldsetControl=z;exports.FileInput=Fe;exports.Input=De;exports.LabelControl=J;exports.Radio=se;exports.RadioGroup=Ae;exports.Select=ke;exports.SelectControl=$e;exports.Textarea=ie;exports.TextareaControl=qe;
|
|
119
163
|
//# sourceMappingURL=index.cjs.js.map
|