@sakura-ui/forms 0.4.0-beta.0 → 0.4.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/LICENSE +21 -0
- package/dist/index.cjs.js +25 -43
- package/dist/index.es.js +214 -232
- package/dist/types/components/Checkbox.d.ts +2 -2
- package/dist/types/components/Checkbox.d.ts.map +1 -1
- package/dist/types/components/FieldsetControl.d.ts +2 -2
- package/dist/types/components/FieldsetControl.d.ts.map +1 -1
- package/dist/types/components/FileInput.d.ts +2 -2
- package/dist/types/components/FileInput.d.ts.map +1 -1
- package/dist/types/components/Input.d.ts +2 -2
- package/dist/types/components/Input.d.ts.map +1 -1
- package/dist/types/components/LabelControl.d.ts +2 -2
- package/dist/types/components/LabelControl.d.ts.map +1 -1
- package/dist/types/components/Radio.d.ts +2 -2
- package/dist/types/components/Radio.d.ts.map +1 -1
- package/dist/types/components/Select.d.ts +2 -2
- package/dist/types/components/Select.d.ts.map +1 -1
- package/dist/types/components/Textarea.d.ts +2 -2
- package/dist/types/components/Textarea.d.ts.map +1 -1
- package/dist/types/components/controlled/CheckboxGroup.d.ts +1 -1
- package/dist/types/components/controlled/RadioGroup.d.ts +1 -1
- package/dist/types/components/inputStyle.d.ts +1 -1
- package/dist/types/components/inputStyle.d.ts.map +1 -1
- package/package.json +26 -25
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Taisuke Fujita
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var G;function ye(){if(G)return k;G=1;var r=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function c(n,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var u in o)u!=="key"&&(s[u]=o[u])}else s=o;return o=s.ref,{$$typeof:r,type:n,key:a,ref:o!==void 0?o:null,props:s}}return k.Fragment=i,k.jsx=c,k.jsxs=c,k}var w={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var J;function Re(){return J||(J=1,process.env.NODE_ENV!=="production"&&function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case P:return"Fragment";case de:return"Profiler";case ne:return"StrictMode";case be:return"Suspense";case pe:return"SuspenseList";case me:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case ie:return"Portal";case ue:return(e.displayName||"Context")+".Provider";case ce:return(e._context.displayName||"Context")+".Consumer";case fe:var l=e.render;return e=e.displayName,e||(e=l.displayName||l.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case xe:return l=e.displayName||null,l!==null?l:r(e.type)||"Memo";case Y:l=e._payload,e=e._init;try{return r(e(l))}catch{}}return null}function i(e){return""+e}function c(e){try{i(e);var l=!1}catch{l=!0}if(l){l=console;var b=l.error,m=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return b.call(l,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",m),i(e)}}function n(e){if(e===P)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===Y)return"<...>";try{var l=r(e);return l?"<"+l+">":"<...>"}catch{return"<...>"}}function o(){var e=S.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function a(e){if(z.call(e,"key")){var l=Object.getOwnPropertyDescriptor(e,"key").get;if(l&&l.isReactWarning)return!1}return e.key!==void 0}function u(e,l){function b(){L||(L=!0,console.error("%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://react.dev/link/special-props)",l))}b.isReactWarning=!0,Object.defineProperty(e,"key",{get:b,configurable:!0})}function d(){var e=r(this.type);return D[e]||(D[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function p(e,l,b,m,T,N,A,$){return b=N.ref,e={$$typeof:R,type:e,key:l,props:N,_owner:T},(b!==void 0?b:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:d}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:$}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function f(e,l,b,m,T,N,A,$){var g=l.children;if(g!==void 0)if(m)if(he(g)){for(m=0;m<g.length;m++)h(g[m]);Object.freeze&&Object.freeze(g)}else console.error("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 h(g);if(z.call(l,"key")){g=r(e);var I=Object.keys(l).filter(function(ve){return ve!=="key"});m=0<I.length?"{key: someKey, "+I.join(": ..., ")+": ...}":"{key: someKey}",U[g+m]||(I=0<I.length?"{"+I.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react");var k={exports:{}},E={};var U;function ve(){if(U)return E;U=1;var r=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function c(n,a,t){var o=null;if(t!==void 0&&(o=""+t),a.key!==void 0&&(o=""+a.key),"key"in a){t={};for(var u in a)u!=="key"&&(t[u]=a[u])}else t=a;return a=t.ref,{$$typeof:r,type:n,key:o,ref:a!==void 0?a:null,props:t}}return E.Fragment=i,E.jsx=c,E.jsxs=c,E}var _={};var G;function ye(){return G||(G=1,process.env.NODE_ENV!=="production"&&(function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case ne:return"Profiler";case ie:return"StrictMode";case fe:return"Suspense";case pe:return"SuspenseList";case xe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case oe:return"Portal";case ce:return e.displayName||"Context";case de:return(e._context.displayName||"Context")+".Consumer";case ue:var l=e.render;return e=e.displayName,e||(e=l.displayName||l.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case be:return l=e.displayName||null,l!==null?l:r(e.type)||"Memo";case P:l=e._payload,e=e._init;try{return r(e(l))}catch{}}return null}function i(e){return""+e}function c(e){try{i(e);var l=!1}catch{l=!0}if(l){l=console;var p=l.error,b=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return p.call(l,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",b),i(e)}}function n(e){if(e===C)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===P)return"<...>";try{var l=r(e);return l?"<"+l+">":"<...>"}catch{return"<...>"}}function a(){var e=S.A;return e===null?null:e.getOwner()}function t(){return Error("react-stack-top-frame")}function o(e){if(Y.call(e,"key")){var l=Object.getOwnPropertyDescriptor(e,"key").get;if(l&&l.isReactWarning)return!1}return e.key!==void 0}function u(e,l){function p(){z||(z=!0,console.error("%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://react.dev/link/special-props)",l))}p.isReactWarning=!0,Object.defineProperty(e,"key",{get:p,configurable:!0})}function d(){var e=r(this.type);return L[e]||(L[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function m(e,l,p,b,I,A){var x=p.ref;return e={$$typeof:F,type:e,key:l,props:p,_owner:b},(x!==void 0?x:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:d}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:I}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function f(e,l,p,b,I,A){var x=l.children;if(x!==void 0)if(b)if(ge(x)){for(b=0;b<x.length;b++)g(x[b]);Object.freeze&&Object.freeze(x)}else console.error("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 g(x);if(Y.call(l,"key")){x=r(e);var j=Object.keys(l).filter(function(he){return he!=="key"});b=0<j.length?"{key: someKey, "+j.join(": ..., ")+": ...}":"{key: someKey}",B[x+b]||(j=0<j.length?"{"+j.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
2
|
let props = %s;
|
|
19
3
|
<%s {...props} />
|
|
20
4
|
React keys must be passed directly to JSX without using spread:
|
|
21
5
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,
|
|
6
|
+
<%s key={someKey} {...props} />`,b,x,j,x),B[x+b]=!0)}if(x=null,p!==void 0&&(c(p),x=""+p),o(l)&&(c(l.key),x=""+l.key),"key"in l){p={};for(var $ in l)$!=="key"&&(p[$]=l[$])}else p=l;return x&&u(p,typeof e=="function"?e.displayName||e.name||"Unknown":e),m(e,x,p,a(),I,A)}function g(e){h(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===P&&(e._payload.status==="fulfilled"?h(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function h(e){return typeof e=="object"&&e!==null&&e.$$typeof===F}var v=R,F=Symbol.for("react.transitional.element"),oe=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),ie=Symbol.for("react.strict_mode"),ne=Symbol.for("react.profiler"),de=Symbol.for("react.consumer"),ce=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),fe=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),be=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),xe=Symbol.for("react.activity"),me=Symbol.for("react.client.reference"),S=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,ge=Array.isArray,O=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(e){return e()}};var z,L={},D=v.react_stack_bottom_frame.bind(v,t)(),W=O(n(t)),B={};_.Fragment=C,_.jsx=function(e,l,p){var b=1e4>S.recentlyCreatedOwnerStacks++;return f(e,l,p,!1,b?Error("react-stack-top-frame"):D,b?O(n(e)):W)},_.jsxs=function(e,l,p){var b=1e4>S.recentlyCreatedOwnerStacks++;return f(e,l,p,!0,b?Error("react-stack-top-frame"):D,b?O(n(e)):W)}})()),_}var V;function Re(){return V||(V=1,process.env.NODE_ENV==="production"?k.exports=ve():k.exports=ye()),k.exports}var s=Re();const y=(...r)=>r.filter(Boolean).join(" ");var N;(r=>{r.clickable=`
|
|
23
7
|
px-2
|
|
24
8
|
min-h-[calc(44/16*1rem)]
|
|
25
9
|
border
|
|
@@ -30,7 +14,6 @@ React keys must be passed directly to JSX without using spread:
|
|
|
30
14
|
rounded-full
|
|
31
15
|
bg-yellow-50
|
|
32
16
|
`;const i=`
|
|
33
|
-
focus-visible:outline
|
|
34
17
|
focus-visible:outline-4
|
|
35
18
|
focus-visible:outline-black
|
|
36
19
|
focus-visible:ring-yellow-300
|
|
@@ -48,7 +31,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
48
31
|
focus-visible:ring-[calc(2/16*1rem)]
|
|
49
32
|
`,r.focusRounded=`
|
|
50
33
|
${r.focusRect}
|
|
51
|
-
focus-visible:rounded
|
|
34
|
+
focus-visible:rounded-sm
|
|
52
35
|
`,r.focusCard=`
|
|
53
36
|
${r.focusRect}
|
|
54
37
|
focus-visible:rounded-2xl
|
|
@@ -58,7 +41,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
58
41
|
focus-visible:bg-yellow-300
|
|
59
42
|
`,r.focusRoundedWithBg=`
|
|
60
43
|
${r.focusRectWithBg}
|
|
61
|
-
focus-visible:rounded
|
|
44
|
+
focus-visible:rounded-sm
|
|
62
45
|
`,r.hoverUnderline=`
|
|
63
46
|
hover:underline
|
|
64
47
|
hover:underline-offset-[calc(3/16*1rem)]
|
|
@@ -88,7 +71,6 @@ React keys must be passed directly to JSX without using spread:
|
|
|
88
71
|
top-11
|
|
89
72
|
left-0
|
|
90
73
|
`,(c=>{c.focus=`
|
|
91
|
-
peer-focus-visible:outline
|
|
92
74
|
peer-focus-visible:outline-4
|
|
93
75
|
peer-focus-visible:outline-black
|
|
94
76
|
peer-focus-visible:ring-yellow-300
|
|
@@ -96,7 +78,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
96
78
|
${c.focus}
|
|
97
79
|
peer-focus-visible:outline-offset-[calc(2/16*1rem)]
|
|
98
80
|
peer-focus-visible:ring-[calc(2/16*1rem)]
|
|
99
|
-
`})(r.Peer||(r.Peer={}))})(
|
|
81
|
+
`})(r.Peer||(r.Peer={}))})(N||(N={}));const T=R.createContext({helperTextId:"",errorMessageId:"",isInvalid:!1,isRequired:!1}),J=`
|
|
100
82
|
bg-white
|
|
101
83
|
border
|
|
102
84
|
border-solid
|
|
@@ -105,8 +87,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
105
87
|
disabled:text-solid-gray-500
|
|
106
88
|
disabled:border-solid-gray-500
|
|
107
89
|
aria-invalid:border-red-800
|
|
108
|
-
${
|
|
109
|
-
`,
|
|
90
|
+
${N.focusRect}
|
|
91
|
+
`,H={lg:`
|
|
110
92
|
p-4
|
|
111
93
|
text-label
|
|
112
94
|
rounded-lg
|
|
@@ -123,13 +105,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
123
105
|
text-label
|
|
124
106
|
rounded-md
|
|
125
107
|
leading-snug
|
|
126
|
-
`},
|
|
108
|
+
`},X=`
|
|
127
109
|
inline-block
|
|
128
110
|
cursor-pointer
|
|
129
111
|
border
|
|
130
112
|
border-solid
|
|
131
113
|
border-transparent
|
|
132
|
-
`,
|
|
114
|
+
`,Z={lg:`
|
|
133
115
|
pr-8
|
|
134
116
|
py-4
|
|
135
117
|
text-label
|
|
@@ -144,10 +126,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
144
126
|
py-2
|
|
145
127
|
text-label
|
|
146
128
|
leading-snug
|
|
147
|
-
`},
|
|
129
|
+
`},Q={lg:"w-[22px] h-[22px] mr-2",md:"w-[18px] h-[18px] mr-1.5",sm:"w-[18px] h-[18px] mr-1"},q=r=>{const{id:i,className:c,size:n="lg",children:a,...t}=r,o=R.useId(),u=i||o,d=R.useContext(T);d.isRequired&&(t.required=!0),d.groupName&&(t.name=d.groupName);const m={lg:22/24,md:18/24,sm:18/24},f=`
|
|
148
130
|
peer
|
|
149
131
|
sr-only
|
|
150
|
-
`,
|
|
132
|
+
`,g=`
|
|
151
133
|
bg-clip-content
|
|
152
134
|
rounded-sm
|
|
153
135
|
border
|
|
@@ -158,8 +140,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
158
140
|
peer-checked:bg-blue-600
|
|
159
141
|
peer-checked:border-none
|
|
160
142
|
peer-disabled:border-solid-gray-500
|
|
161
|
-
${
|
|
162
|
-
`;return
|
|
143
|
+
${N.Peer.focusRect}
|
|
144
|
+
`;return s.jsx("label",{htmlFor:u,className:y(X,Z[n],c),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:u,className:f,type:"checkbox","aria-describedby":d.helperTextId,"aria-errormessage":d.errorMessageId,"aria-invalid":d.isInvalid??!1,"aria-required":d.isRequired??!1,...t}),s.jsx("span",{className:y(g,Q[n]),children:s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,width:"24",height:"24",viewBox:"0 0 24 24",children:s.jsx("g",{transform:`scale(${m[n]} ${m[n]})`,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-solid-gray-500",children:a})]})})};q.displayName="Checkbox";const M=r=>{const{id:i,className:c,size:n="lg",children:a,...t}=r,o=R.useId(),u=i||o,d=R.useContext(T);d.isRequired&&(t.required=!0),d.groupName&&(t.name=d.groupName);const m=`
|
|
163
145
|
peer
|
|
164
146
|
sr-only
|
|
165
147
|
`,f=`
|
|
@@ -171,13 +153,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
171
153
|
peer-checked:bg-blue-600
|
|
172
154
|
peer-checked:border-blue-600
|
|
173
155
|
peer-disabled:border-solid-gray-500
|
|
174
|
-
${
|
|
175
|
-
`,
|
|
156
|
+
${N.Peer.focusRect}
|
|
157
|
+
`,g={lg:"p-1",md:"p-[3px]",sm:"p-[3px]"};return s.jsx("label",{htmlFor:u,className:y(X,Z[n],c),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:u,className:m,type:"radio","aria-describedby":d.helperTextId,"aria-errormessage":d.errorMessageId,"aria-invalid":d.isInvalid??!1,"aria-required":d.isRequired??!1,...t}),s.jsx("span",{"aria-hidden":!0,className:y(f,g[n],Q[n])}),s.jsx("span",{className:"peer-disabled:text-solid-gray-500",children:a})]})})};M.displayName="Radio";const K=r=>{const{id:i,className:c,size:n="lg",children:a,...t}=r,o=R.useContext(T);return o.isRequired&&(t.required=!0),s.jsxs("div",{className:"inline-block relative",children:[s.jsx("select",{id:i||o.id,className:y(`
|
|
176
158
|
!pr-8
|
|
177
159
|
peer
|
|
178
160
|
cursor-pointer
|
|
179
161
|
appearance-none
|
|
180
|
-
`,H
|
|
162
|
+
`,J,H[n],c),"aria-describedby":o.helperTextId,"aria-errormessage":o.errorMessageId,"aria-invalid":o.isInvalid??!1,"aria-required":o.isRequired??!1,...t,children:a}),s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:`
|
|
181
163
|
pointer-events-none
|
|
182
164
|
absolute
|
|
183
165
|
right-4
|
|
@@ -185,7 +167,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
185
167
|
-translate-y-1/2
|
|
186
168
|
text-solid-gray-900
|
|
187
169
|
peer-disabled:text-solid-gray-500
|
|
188
|
-
`,fill:"none",width:"16",height:"16",viewBox:"0 0 16 16",children:[
|
|
170
|
+
`,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"})]})]})};K.displayName="Select";const ee=r=>{const{id:i,className:c,size:n="lg",...a}=r,t=R.useContext(T);t.isRequired&&(a.required=!0);const o=`
|
|
189
171
|
file:mr-2
|
|
190
172
|
file:inline-block
|
|
191
173
|
file:text-button
|
|
@@ -216,9 +198,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
216
198
|
rounded-lg
|
|
217
199
|
outline-offset-2
|
|
218
200
|
aria-invalid:text-red-800
|
|
219
|
-
${
|
|
220
|
-
${
|
|
221
|
-
`,
|
|
201
|
+
${N.hoverUnderline}
|
|
202
|
+
${N.focusRounded}
|
|
203
|
+
`,m={lg:`
|
|
222
204
|
file:p-4
|
|
223
205
|
file:text-button
|
|
224
206
|
file:rounded-lg
|
|
@@ -235,7 +217,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
235
217
|
file:text-button
|
|
236
218
|
file:rounded-md
|
|
237
219
|
file:leading-snug
|
|
238
|
-
`};return
|
|
220
|
+
`};return s.jsx("input",{type:"file",id:i||t.id,className:y(o,u,m[n],d,c),"aria-describedby":t.helperTextId,"aria-errormessage":t.errorMessageId,"aria-invalid":t.isInvalid??!1,"aria-required":t.isRequired??!1,role:"button","aria-label":"File Upload",...a})};ee.displayName="FileInput";const re=r=>{const{id:i,className:c,size:n="lg",...a}=r,t=R.useContext(T);return t.isRequired&&(a.required=!0),s.jsx("input",{type:"text",id:i||t.id,className:y(J,H[n],c),"aria-describedby":t.helperTextId,"aria-errormessage":t.errorMessageId,"aria-invalid":t.isInvalid??!1,"aria-required":t.isRequired??!1,...a})};re.displayName="Input";const te=r=>{const{id:i,className:c,children:n,onChange:a,maxLength:t,...o}=r,[u,d]=R.useState(0),m=v=>{a&&a(v),d(v.target.value.length)},f=R.useContext(T);f.isRequired&&(o.required=!0);const g=u>(t||0)?"text-red-800":"text-solid-gray-700",h=`
|
|
239
221
|
p-4
|
|
240
222
|
text-label
|
|
241
223
|
rounded-lg
|
|
@@ -246,9 +228,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
228
|
disabled:text-solid-gray-500
|
|
247
229
|
disabled:border-solid-gray-500
|
|
248
230
|
aria-invalid:border-red-800
|
|
249
|
-
${
|
|
250
|
-
`;return
|
|
231
|
+
${N.focusRect}
|
|
232
|
+
`;return s.jsxs(s.Fragment,{children:[s.jsx("textarea",{id:i||f.id,className:y(h,c),"aria-describedby":f.helperTextId,"aria-errormessage":f.errorMessageId,"aria-invalid":f.isInvalid??!1,"aria-required":f.isRequired??!1,onChange:m,...o,children:n}),t?s.jsxs("p",{className:"text-label text-solid-gray-700",children:[s.jsx("span",{className:g,children:u}),"/",s.jsx("span",{children:t})]}):""]})};te.displayName="Textarea";const se=r=>{const i=R.useId(),{labelText:c,className:n,helperText:a,errorMessage:t,isInvalid:o,isRequired:u,children:d,...m}=r,f={id:r.htmlFor??`input-${i}`,helperTextId:`helper-text-${i}`,errorMessageId:`error-message-${i}`,isInvalid:o??!1,isRequired:u??!1};return s.jsx(T.Provider,{value:f,children:s.jsxs("div",{className:y("flex flex-col items-start gap-2",n),children:[s.jsxs("label",{className:y("block text-label",o&&"text-red-800"),htmlFor:f.id,...m,children:[c,u&&s.jsx("span",{className:"text-label text-red-800",children:" *"})]}),a&&s.jsx("p",{id:f.helperTextId,className:`
|
|
251
233
|
text-label text-solid-gray-700
|
|
252
|
-
`,children:
|
|
234
|
+
`,children:a}),d,o&&s.jsx("p",{id:f.errorMessageId,className:`
|
|
253
235
|
text-label text-red-800
|
|
254
|
-
`,children:
|
|
236
|
+
`,children:t})]})})};se.displayName="LabelControl";const w=r=>{const i=R.useId(),{labelText:c,className:n,helperText:a,errorMessage:t,isInvalid:o,isRequired:u,direction:d,children:m,...f}=r,h={groupName:f.name??`group-${i}`,helperTextId:`helper-text-${i}`,errorMessageId:`error-message-${i}`,isInvalid:o??!1,isRequired:u??!1},v=d??"flex-col";return s.jsx(T.Provider,{value:h,children:s.jsxs("fieldset",{className:y("flex flex-col items-start gap-2",n),...f,children:[s.jsx("legend",{children:s.jsxs("p",{className:y("block text-label",o&&"text-red-800"),children:[c,u&&s.jsx("span",{className:"text-red-800",children:" *"})]})}),s.jsx("div",{className:y("inline-flex",v),children:m}),a&&s.jsx("p",{id:h.helperTextId,className:"text-sup text-solid-gray-700",children:a}),o&&s.jsx("p",{id:h.errorMessageId,className:"text-label text-red-800",children:t})]})})};w.displayName="FieldsetControl";const le=r=>{const{items:i,onChange:c,className:n,labelText:a,helperText:t,errorMessage:o,isInvalid:u,isRequired:d,size:m,...f}=r;return s.jsx(w,{className:n,labelText:a,helperText:t,errorMessage:o,isInvalid:u,isRequired:d,...f,children:i.map(({label:g,value:h})=>s.jsx(q,{size:m,value:h,onChange:c,children:g},`${g}-${h}`))})};le.displayName="CheckboxGroup";const ae=r=>{const{items:i,onChange:c,className:n,labelText:a,helperText:t,errorMessage:o,isInvalid:u,isRequired:d,defaultValue:m,size:f,...g}=r;return s.jsx(w,{className:n,labelText:a,helperText:t,errorMessage:o,isInvalid:u,isRequired:d,...g,children:i.map(({label:h,value:v})=>s.jsx(M,{size:f,value:v,onChange:c,defaultChecked:m===v,children:h},`${h}-${v}`))})};ae.displayName="RadioGroup";exports.Checkbox=q;exports.CheckboxGroup=le;exports.FieldsetControl=w;exports.FileInput=ee;exports.Input=re;exports.LabelControl=se;exports.Radio=M;exports.RadioGroup=ae;exports.Select=K;exports.Textarea=te;
|