@companycam/slab-web 1.30.1 → 1.30.2
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/index.js +8 -1
- package/index.mjs +12 -2
- package/lib/InputText/InputText.d.ts +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1335,6 +1335,13 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gs]+=1);const Y0=G.span`
|
|
|
1335
1335
|
border-width: var(--cc_size_border_width_s);
|
|
1336
1336
|
border-style: solid;
|
|
1337
1337
|
border-color: ${e=>e.$status==="error"?"var(--cc_color_utility_destroy)":"var(--cc_color_border_input_inactive)"};
|
|
1338
|
+
${e=>{if(!e.$status)return me`
|
|
1339
|
+
@supports selector(:user-invalid) {
|
|
1340
|
+
&:has(input:user-invalid) {
|
|
1341
|
+
border-color: var(--cc_color_utility_destroy);
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
`}}
|
|
1338
1345
|
display: flex;
|
|
1339
1346
|
align-items: center;
|
|
1340
1347
|
min-width: 1px;
|
|
@@ -1365,7 +1372,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Gs]+=1);const Y0=G.span`
|
|
|
1365
1372
|
line-height: 1;
|
|
1366
1373
|
`,Ah=G.span`
|
|
1367
1374
|
flex-shrink: 0;
|
|
1368
|
-
`,kR=({type:e})=>{switch(e){case"email":return"email-outline";case"tel":return"phone-outline";case"search":return"magnify";case"url":return"web";default:return null}},Sm=w.forwardRef(({label:e,onChange:n,contentBefore:t,contentAfter:r,hideLabel:i=!1,inputSize:o="medium",name:a,testId:c,type:u="text",value:f,...p},g)=>{const{status:y
|
|
1375
|
+
`,kR=({type:e})=>{switch(e){case"email":return"email-outline";case"tel":return"phone-outline";case"search":return"magnify";case"url":return"web";default:return null}},Sm=w.forwardRef(({label:e,onChange:n,contentBefore:t,contentAfter:r,hideLabel:i=!1,inputSize:o="medium",name:a,testId:c,type:u="text",value:f,...p},g)=>{const{status:y,className:_,disabled:b=!1,style:x,message:E,...T}=p,z=kR({type:u}),L=t||z,B=()=>L?P.jsx(Ah,{children:t||P.jsx(SR,{className:`mdi mdi-${z}`,$inputSize:o})}):null;return P.jsxs(ri,{inputId:p.id,message:E,className:_,status:y,style:x,children:[P.jsx(bR,{htmlFor:p.id,$hideLabel:i,children:P.jsx(xo,{children:e})}),P.jsxs(xR,{$disabled:p.disabled||!1,$status:y,$type:u,$message:E,children:[B(),P.jsx(wR,{ref:g,disabled:b,"aria-describedby":E?`${p.id}-message`:"","aria-invalid":y==="error"?!0:void 0,onChange:n,name:a||p.id,$inputSize:o,"data-testid":c,type:u,value:f,...T}),r?P.jsx(Ah,{children:r}):null]})]})}),CR=G(Pl)`
|
|
1369
1376
|
margin-inline-end: var(--cc_size_spacing_s);
|
|
1370
1377
|
`,ER=w.forwardRef((e,n)=>{const[t,r]=w.useState(),i=()=>{r(o=>!o)};return P.jsx(Sm,{ref:n,type:t?"text":"password",contentAfter:P.jsx(CR,{onClick:i,design:"minimal",size:"small",iconName:t?"eye-outline":"eye-off-outline",accessibilityLabel:t?"Hide Password":"Show Password",disabled:e.disabled}),...e})}),Ea=G.span`
|
|
1371
1378
|
box-sizing: border-box;
|
package/index.mjs
CHANGED
|
@@ -13614,6 +13614,16 @@ const RN = Gt(
|
|
|
13614
13614
|
border-width: var(--cc_size_border_width_s);
|
|
13615
13615
|
border-style: solid;
|
|
13616
13616
|
border-color: ${(e) => e.$status === "error" ? "var(--cc_color_utility_destroy)" : "var(--cc_color_border_input_inactive)"};
|
|
13617
|
+
${(e) => {
|
|
13618
|
+
if (!e.$status)
|
|
13619
|
+
return me`
|
|
13620
|
+
@supports selector(:user-invalid) {
|
|
13621
|
+
&:has(input:user-invalid) {
|
|
13622
|
+
border-color: var(--cc_color_utility_destroy);
|
|
13623
|
+
}
|
|
13624
|
+
}
|
|
13625
|
+
`;
|
|
13626
|
+
}}
|
|
13617
13627
|
display: flex;
|
|
13618
13628
|
align-items: center;
|
|
13619
13629
|
min-width: 1px;
|
|
@@ -13672,7 +13682,7 @@ const RN = Gt(
|
|
|
13672
13682
|
...p
|
|
13673
13683
|
}, g) => {
|
|
13674
13684
|
const {
|
|
13675
|
-
status: y
|
|
13685
|
+
status: y,
|
|
13676
13686
|
className: _,
|
|
13677
13687
|
disabled: b = !1,
|
|
13678
13688
|
style: w,
|
|
@@ -13704,7 +13714,7 @@ const RN = Gt(
|
|
|
13704
13714
|
ref: g,
|
|
13705
13715
|
disabled: b,
|
|
13706
13716
|
"aria-describedby": C ? `${p.id}-message` : "",
|
|
13707
|
-
"aria-invalid": y === "error",
|
|
13717
|
+
"aria-invalid": y === "error" ? !0 : void 0,
|
|
13708
13718
|
onChange: n,
|
|
13709
13719
|
name: a || p.id,
|
|
13710
13720
|
$inputSize: o,
|
|
@@ -15,7 +15,7 @@ export type InputTextProps = HTMLInputProps & UseMessageProps & {
|
|
|
15
15
|
/**
|
|
16
16
|
* - InputText supports both controlled and uncontrolled patterns:
|
|
17
17
|
* - **Controlled**: Provide `value` and `onChange` props. Use for inputs with complex interactions or when you need to programmatically control the value.
|
|
18
|
-
* - **Uncontrolled**:
|
|
18
|
+
* - **Uncontrolled**: Optionally provide `defaultValue` prop and access the value via a ref or FormData. Used for simple forms or when integrating with form libraries like react-hook-form.
|
|
19
19
|
* - Use title case for the required `label` (e.g., "Project Name", not "Project name").
|
|
20
20
|
* - InputText can render a `type="password"` input. However, if you need a password input with a show/hide button, use [InputPassword](/docs/inputpassword--docs).
|
|
21
21
|
*/
|