@sakura-ui/sakura-ui 0.5.0 → 0.5.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/package.json +5 -5
- package/packages/core/package.json +1 -1
- package/packages/core/src/components/LangSelector.tsx +2 -2
- package/packages/core/src/components/PopoverMenu.tsx +2 -13
- package/packages/core/src/components/Table.tsx +1 -1
- package/packages/forms/.turbo/turbo-build.log +3 -3
- package/packages/forms/dist/index.cjs.js +13 -21
- package/packages/forms/dist/index.es.js +91 -99
- package/packages/forms/package.json +1 -1
- package/packages/helper/.turbo/turbo-build.log +3 -3
- package/packages/helper/dist/index.cjs.js +6 -14
- package/packages/helper/dist/index.es.js +18 -26
- package/packages/helper/dist/types/styles.d.ts +2 -4
- package/packages/helper/dist/types/styles.d.ts.map +1 -1
- package/packages/helper/package.json +1 -1
- package/packages/helper/src/styles.ts +2 -14
- package/packages/markdown/.turbo/turbo-build.log +3 -3
- package/packages/markdown/dist/index.cjs.js +2 -10
- package/packages/markdown/dist/index.es.js +283 -291
- package/packages/markdown/package.json +1 -1
- package/packages/tailwind-theme-plugin/.turbo/turbo-build.log +2 -2
- package/packages/tailwind-theme-plugin/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sakura-ui/sakura-ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": "glassonion1",
|
|
6
6
|
"homepage": "https://github.com/glassonion1/sakura-ui",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"pnpm": ">=9.15.1"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@sakura-ui/
|
|
23
|
-
"@sakura-ui/
|
|
24
|
-
"@sakura-ui/
|
|
25
|
-
"@sakura-ui/tailwind-theme-plugin": "0.4.
|
|
22
|
+
"@sakura-ui/core": "0.5.1",
|
|
23
|
+
"@sakura-ui/helper": "0.0.10",
|
|
24
|
+
"@sakura-ui/forms": "0.4.3",
|
|
25
|
+
"@sakura-ui/tailwind-theme-plugin": "0.4.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^19.2.1",
|
|
@@ -49,8 +49,8 @@ export const LangSelector = ({
|
|
|
49
49
|
const stylePositionBottomRight = `
|
|
50
50
|
absolute
|
|
51
51
|
top-[anchor(--target_bottom)]
|
|
52
|
-
right-[anchor(--target_right)]
|
|
53
|
-
position-try-
|
|
52
|
+
right-[anchor(--target_right)]
|
|
53
|
+
[position-try-fallbacks:flip-block]
|
|
54
54
|
inset-[unset]
|
|
55
55
|
`
|
|
56
56
|
|
|
@@ -7,22 +7,11 @@ export const PopoverMenu = React.forwardRef<
|
|
|
7
7
|
React.ComponentProps<'ul'>
|
|
8
8
|
>((props, ref) => {
|
|
9
9
|
const { className, children, ...rest } = props
|
|
10
|
-
const stylePopover = `
|
|
11
|
-
min-w-fit
|
|
12
|
-
w-auto
|
|
13
|
-
py-2
|
|
14
|
-
bg-white
|
|
15
|
-
shadow-1
|
|
16
|
-
rounded-lg
|
|
17
|
-
border
|
|
18
|
-
border-solid-grey-420
|
|
19
|
-
has-[>:nth-child(7)]:rounded-r-none
|
|
20
|
-
`
|
|
21
10
|
|
|
22
11
|
const style = `
|
|
23
12
|
font-normal
|
|
24
13
|
whitespace-nowrap
|
|
25
|
-
${
|
|
14
|
+
${Style.popover}
|
|
26
15
|
`
|
|
27
16
|
|
|
28
17
|
return (
|
|
@@ -46,7 +35,7 @@ export const PopoverMenuItem = React.forwardRef<
|
|
|
46
35
|
flex
|
|
47
36
|
items-center
|
|
48
37
|
gap-x-1.5
|
|
49
|
-
hover:bg-solid-
|
|
38
|
+
hover:bg-solid-gray-50
|
|
50
39
|
${Style.focusRectCondensedWithBg}
|
|
51
40
|
`
|
|
52
41
|
|
|
@@ -7,6 +7,6 @@ transforming...
|
|
|
7
7
|
[32m✓[39m 25 modules transformed.
|
|
8
8
|
rendering chunks...
|
|
9
9
|
computing gzip size...
|
|
10
|
-
[2mdist/[22m[36mindex.es.js [39m[1m[2m24.
|
|
11
|
-
[2mdist/[22m[36mindex.cjs.js [39m[1m[2m16.
|
|
12
|
-
[32m✓ built in
|
|
10
|
+
[2mdist/[22m[36mindex.es.js [39m[1m[2m24.22 kB[22m[1m[22m[2m │ gzip: 6.09 kB[22m
|
|
11
|
+
[2mdist/[22m[36mindex.cjs.js [39m[1m[2m16.80 kB[22m[1m[22m[2m │ gzip: 5.23 kB[22m
|
|
12
|
+
[32m✓ built in 482ms[39m
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react");var k={exports:{}},E={};var
|
|
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"),n=Symbol.for("react.fragment");function d(i,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:i,key:o,ref:a!==void 0?a:null,props:t}}return E.Fragment=n,E.jsx=d,E.jsxs=d,E}var _={};var B;function ye(){return B||(B=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 ie:return"Profiler";case ne: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 n(e){return""+e}function d(e){try{n(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),n(e)}}function i(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 c(){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 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:c}):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}",G[x+b]||(j=0<j.length?"{"+j.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,b,x,j,x),
|
|
6
|
+
<%s key={someKey} {...props} />`,b,x,j,x),G[x+b]=!0)}if(x=null,p!==void 0&&(d(p),x=""+p),o(l)&&(d(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"),ne=Symbol.for("react.strict_mode"),ie=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,D={},L=v.react_stack_bottom_frame.bind(v,t)(),W=O(i(t)),G={};_.Fragment=C,_.jsx=function(e,l,p){var b=1e4>S.recentlyCreatedOwnerStacks++;return f(e,l,p,!1,b?Error("react-stack-top-frame"):L,b?O(i(e)):W)},_.jsxs=function(e,l,p){var b=1e4>S.recentlyCreatedOwnerStacks++;return f(e,l,p,!0,b?Error("react-stack-top-frame"):L,b?O(i(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=`
|
|
7
7
|
px-2
|
|
8
8
|
min-h-[calc(44/16*1rem)]
|
|
9
9
|
border
|
|
10
10
|
border-transparent
|
|
11
11
|
rounded-lg
|
|
12
|
-
hover:bg-solid-
|
|
12
|
+
hover:bg-solid-gray-50
|
|
13
13
|
`,r.selected=`
|
|
14
14
|
rounded-full
|
|
15
15
|
bg-yellow-50
|
|
@@ -60,16 +60,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
60
60
|
shadow-1
|
|
61
61
|
rounded-lg
|
|
62
62
|
border
|
|
63
|
-
border-solid-
|
|
63
|
+
border-solid-gray-420
|
|
64
64
|
has-[>:nth-child(7)]:rounded-r-none
|
|
65
|
-
`,r.popoverPositionBottomRight=`
|
|
66
|
-
absolute
|
|
67
|
-
top-11
|
|
68
|
-
right-0
|
|
69
|
-
`,r.popoverPositionBottomLeft=`
|
|
70
|
-
absolute
|
|
71
|
-
top-11
|
|
72
|
-
left-0
|
|
73
65
|
`,(d=>{d.focus=`
|
|
74
66
|
peer-focus-visible:outline-4
|
|
75
67
|
peer-focus-visible:outline-black
|
|
@@ -126,7 +118,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
126
118
|
py-2
|
|
127
119
|
text-label
|
|
128
120
|
leading-snug
|
|
129
|
-
`},Q={lg:"w-[22px] h-[22px] mr-2",md:"w-[18px] h-[18px] mr-1.5",sm:"w-[18px] h-[18px] mr-1"},M=r=>{const{id:n,className:d,size:i="lg",children:
|
|
121
|
+
`},Q={lg:"w-[22px] h-[22px] mr-2",md:"w-[18px] h-[18px] mr-1.5",sm:"w-[18px] h-[18px] mr-1"},M=r=>{const{id:n,className:d,size:i="lg",children:a,...t}=r,o=R.useId(),u=n||o,c=R.useContext(T);c.isRequired&&(t.required=!0),c.groupName&&(t.name=c.groupName);const m={lg:22/24,md:18/24,sm:18/24},f=`
|
|
130
122
|
peer
|
|
131
123
|
sr-only
|
|
132
124
|
`,g=`
|
|
@@ -141,7 +133,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
141
133
|
peer-checked:border-none
|
|
142
134
|
peer-disabled:border-solid-gray-500
|
|
143
135
|
${N.Peer.focusRect}
|
|
144
|
-
`;return s.jsx("label",{htmlFor:u,className:y(X,Z[i],d),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:u,className:f,type:"checkbox","aria-describedby":c.helperTextId,"aria-errormessage":c.errorMessageId,"aria-invalid":c.isInvalid??!1,...t}),s.jsx("span",{className:y(g,Q[i]),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[i]} ${m[i]})`,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:
|
|
136
|
+
`;return s.jsx("label",{htmlFor:u,className:y(X,Z[i],d),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:u,className:f,type:"checkbox","aria-describedby":c.helperTextId,"aria-errormessage":c.errorMessageId,"aria-invalid":c.isInvalid??!1,...t}),s.jsx("span",{className:y(g,Q[i]),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[i]} ${m[i]})`,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})]})})};M.displayName="Checkbox";const q=r=>{const{id:n,className:d,size:i="lg",children:a,...t}=r,o=R.useId(),u=n||o,c=R.useContext(T);c.isRequired&&(t.required=!0),c.groupName&&(t.name=c.groupName);const m=`
|
|
145
137
|
peer
|
|
146
138
|
sr-only
|
|
147
139
|
`,f=`
|
|
@@ -154,12 +146,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
154
146
|
peer-checked:border-blue-600
|
|
155
147
|
peer-disabled:border-solid-gray-500
|
|
156
148
|
${N.Peer.focusRect}
|
|
157
|
-
`,g={lg:"p-1",md:"p-[3px]",sm:"p-[3px]"};return s.jsx("label",{htmlFor:u,className:y(X,Z[i],d),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:u,className:m,type:"radio","aria-describedby":c.helperTextId,"aria-errormessage":c.errorMessageId,"aria-invalid":c.isInvalid??!1,...t}),s.jsx("span",{"aria-hidden":!0,className:y(f,g[i],Q[i])}),s.jsx("span",{className:"peer-disabled:text-solid-gray-500",children:
|
|
149
|
+
`,g={lg:"p-1",md:"p-[3px]",sm:"p-[3px]"};return s.jsx("label",{htmlFor:u,className:y(X,Z[i],d),children:s.jsxs("span",{className:"flex items-center",children:[s.jsx("input",{id:u,className:m,type:"radio","aria-describedby":c.helperTextId,"aria-errormessage":c.errorMessageId,"aria-invalid":c.isInvalid??!1,...t}),s.jsx("span",{"aria-hidden":!0,className:y(f,g[i],Q[i])}),s.jsx("span",{className:"peer-disabled:text-solid-gray-500",children:a})]})})};q.displayName="Radio";const K=r=>{const{id:n,className:d,size:i="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:n||o.id,className:y(`
|
|
158
150
|
!pr-8
|
|
159
151
|
peer
|
|
160
152
|
cursor-pointer
|
|
161
153
|
appearance-none
|
|
162
|
-
`,J,H[i],d),"aria-describedby":
|
|
154
|
+
`,J,H[i],d),"aria-describedby":o.helperTextId,"aria-errormessage":o.errorMessageId,"aria-invalid":o.isInvalid??!1,...t,children:a}),s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,className:`
|
|
163
155
|
pointer-events-none
|
|
164
156
|
absolute
|
|
165
157
|
right-4
|
|
@@ -167,7 +159,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
167
159
|
-translate-y-1/2
|
|
168
160
|
text-solid-gray-900
|
|
169
161
|
peer-disabled:text-solid-gray-500
|
|
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:n,className:d,size:i="lg",...
|
|
162
|
+
`,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:n,className:d,size:i="lg",...a}=r,t=R.useContext(T);t.isRequired&&(a.required=!0);const o=`
|
|
171
163
|
file:mr-2
|
|
172
164
|
file:inline-block
|
|
173
165
|
file:text-button
|
|
@@ -217,7 +209,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
217
209
|
file:text-button
|
|
218
210
|
file:rounded-md
|
|
219
211
|
file:leading-snug
|
|
220
|
-
`};return s.jsx("input",{type:"file",id:n||t.id,className:y(
|
|
212
|
+
`};return s.jsx("input",{type:"file",id:n||t.id,className:y(o,u,m[i],c,d),"aria-describedby":t.helperTextId,"aria-errormessage":t.errorMessageId,"aria-invalid":t.isInvalid??!1,...a})};ee.displayName="FileInput";const re=r=>{const{id:n,className:d,size:i="lg",...a}=r,t=R.useContext(T);return t.isRequired&&(a.required=!0),s.jsx("input",{type:"text",id:n||t.id,className:y(J,H[i],d),"aria-describedby":t.helperTextId,"aria-errormessage":t.errorMessageId,"aria-invalid":t.isInvalid??!1,...a})};re.displayName="Input";const te=r=>{const{id:n,className:d,children:i,onChange:a,maxLength:t,...o}=r,[u,c]=R.useState(0),m=v=>{a&&a(v),c(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=`
|
|
221
213
|
p-4
|
|
222
214
|
text-label
|
|
223
215
|
rounded-lg
|
|
@@ -229,8 +221,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
229
221
|
disabled:border-solid-gray-500
|
|
230
222
|
aria-invalid:border-red-800
|
|
231
223
|
${N.focusRect}
|
|
232
|
-
`;return s.jsxs(s.Fragment,{children:[s.jsx("textarea",{id:n||f.id,className:y(h,d),"aria-describedby":f.helperTextId,"aria-errormessage":f.errorMessageId,"aria-invalid":f.isInvalid??!1,onChange:m,...
|
|
224
|
+
`;return s.jsxs(s.Fragment,{children:[s.jsx("textarea",{id:n||f.id,className:y(h,d),"aria-describedby":f.helperTextId,"aria-errormessage":f.errorMessageId,"aria-invalid":f.isInvalid??!1,onChange:m,...o,children:i}),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 n=R.useId(),{labelText:d,className:i,helperText:a,errorMessage:t,isInvalid:o,isRequired:u,children:c,...m}=r,f={id:r.htmlFor??`input-${n}`,helperTextId:`helper-text-${n}`,errorMessageId:`error-message-${n}`,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",i),children:[s.jsxs("label",{className:y("block text-label",o&&"text-red-800"),htmlFor:f.id,...m,children:[d,u&&s.jsx("span",{className:"text-label text-red-800",children:"Â *"})]}),a&&s.jsx("p",{id:f.helperTextId,className:`
|
|
233
225
|
text-label text-solid-gray-700
|
|
234
|
-
`,children:
|
|
226
|
+
`,children:a}),c,o&&s.jsx("p",{id:f.errorMessageId,className:`
|
|
235
227
|
text-label text-red-800
|
|
236
|
-
`,children:t})]})})};se.displayName="LabelControl";const w=r=>{const n=R.useId(),{labelText:d,className:i,helperText:
|
|
228
|
+
`,children:t})]})})};se.displayName="LabelControl";const w=r=>{const n=R.useId(),{labelText:d,className:i,helperText:a,errorMessage:t,isInvalid:o,isRequired:u,direction:c,children:m,...f}=r,h={groupName:f.name??`group-${n}`,helperTextId:`helper-text-${n}`,errorMessageId:`error-message-${n}`,isInvalid:o??!1,isRequired:u??!1},v=c??"flex-col";return s.jsx(T.Provider,{value:h,children:s.jsxs("fieldset",{className:y("flex flex-col items-start gap-2",i),...f,children:[s.jsx("legend",{children:s.jsxs("p",{className:y("block text-label",o&&"text-red-800"),children:[d,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:n,onChange:d,className:i,labelText:a,helperText:t,errorMessage:o,isInvalid:u,isRequired:c,size:m,...f}=r;return s.jsx(w,{className:i,labelText:a,helperText:t,errorMessage:o,isInvalid:u,isRequired:c,...f,children:n.map(({label:g,value:h})=>s.jsx(M,{size:m,value:h,onChange:d,children:g},`${g}-${h}`))})};le.displayName="CheckboxGroup";const ae=r=>{const{items:n,onChange:d,className:i,labelText:a,helperText:t,errorMessage:o,isInvalid:u,isRequired:c,defaultValue:m,size:f,...g}=r;return s.jsx(w,{className:i,labelText:a,helperText:t,errorMessage:o,isInvalid:u,isRequired:c,...g,children:n.map(({label:h,value:v})=>s.jsx(q,{size:f,value:v,onChange:d,defaultChecked:m===v,children:h},`${h}-${v}`))})};ae.displayName="RadioGroup";exports.Checkbox=M;exports.CheckboxGroup=le;exports.FieldsetControl=w;exports.FileInput=ee;exports.Input=re;exports.LabelControl=se;exports.Radio=q;exports.RadioGroup=ae;exports.Select=K;exports.Textarea=te;
|