@happeouikit/form-elements 2.3.40 → 2.3.41
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/Input.d.ts +1 -1
- package/dist/Input.types.d.ts +1 -0
- package/dist/index.cjs.js +8 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +21 -13
- package/dist/index.es.js.map +1 -1
- package/package.json +2 -2
- package/messages.json +0 -1
package/dist/Input.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { InputNumberProps, InputProps } from "./Input.types";
|
|
3
|
-
export declare const Input: ({ label, description, hintText, required, id, icon, iconProps, state, errorMessage, disabled, ...rest }: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const Input: ({ label, description, hintText, required, id, icon, iconProps, state, errorMessage, disabled, readOnly, ...rest }: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const StyledInput: import("styled-components").StyledComponent<"input", any, {
|
|
5
5
|
type: React.HTMLInputTypeAttribute;
|
|
6
6
|
} & {
|
package/dist/Input.types.d.ts
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react/jsx-runtime"),f=require("react"),S=require("styled-components"),Q=require("@happeouikit/typography"),Te=require("@happeouikit/icons"),Uu=require("react-dom"),N=require("@happeouikit/colors"),fn=require("@happeouikit/theme"),P=require("prop-types"),pt=require("react-intl"),Bn=require("@happeouikit/tooltip"),sr=require("@happeouikit/layout"),ln=require("@happeouikit/buttons"),$u=require("@happeo/react-core"),Ju=require("@happeouikit/loaders");function Qu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const B=Qu(f),Ku=e=>e.replace(/(_|-|,|\.)(.)/g,t=>t[1].toUpperCase()),qu=64,el=e=>{if(typeof e!="string"||e.length===0)return"";const t=new RegExp(/[^\p{Alphabetic}\p{Mark}\p{Decimal_Number}\p{Connector_Punctuation}\p{Join_Control}]/u),n=e.replace(/^#/,"").replace(/_+/g,"_"),a=n.match(t),i=a?a.index:n.length,o=n.substring(0,Math.min(i,qu)).toLocaleLowerCase();return o.length===0?"":"#"+o},go=e=>typeof e=="string",vo=e=>f.Children.toArray(e).filter(f.isValidElement),la=e=>{process.env.NODE_ENV!=="production"&&console.warn(`HappeoUiKit/form-elements: ${e}`)},ca=(e,t)=>{f.useEffect(()=>{e&&la(t)},[])},Ot=()=>"ixxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),En={success:"var(--color-success-primary, #00a372)",error:"var(--color-alert-primary, #da3939)",default:"var(--color-secondary-text-on-light, #4a5464)"},tl=(e,t)=>{const r={width:"20px",height:"20px",fill:"var(--color-secondary-text-on-light, #2b313b)"},n={position:"absolute",top:"10px",left:"10px",fontSize:"18px"},a={...r,...t};return()=>W.jsx(nl,{children:W.jsx(e,{...a,style:n})})},ur=({label:e,description:t,hintText:r,required:n,id:a,icon:i,iconProps:o,state:s,errorMessage:u,disabled:l,...
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react/jsx-runtime"),f=require("react"),S=require("styled-components"),Q=require("@happeouikit/typography"),Te=require("@happeouikit/icons"),Uu=require("react-dom"),N=require("@happeouikit/colors"),fn=require("@happeouikit/theme"),P=require("prop-types"),pt=require("react-intl"),Bn=require("@happeouikit/tooltip"),sr=require("@happeouikit/layout"),ln=require("@happeouikit/buttons"),$u=require("@happeo/react-core"),Ju=require("@happeouikit/loaders");function Qu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const B=Qu(f),Ku=e=>e.replace(/(_|-|,|\.)(.)/g,t=>t[1].toUpperCase()),qu=64,el=e=>{if(typeof e!="string"||e.length===0)return"";const t=new RegExp(/[^\p{Alphabetic}\p{Mark}\p{Decimal_Number}\p{Connector_Punctuation}\p{Join_Control}]/u),n=e.replace(/^#/,"").replace(/_+/g,"_"),a=n.match(t),i=a?a.index:n.length,o=n.substring(0,Math.min(i,qu)).toLocaleLowerCase();return o.length===0?"":"#"+o},go=e=>typeof e=="string",vo=e=>f.Children.toArray(e).filter(f.isValidElement),la=e=>{process.env.NODE_ENV!=="production"&&console.warn(`HappeoUiKit/form-elements: ${e}`)},ca=(e,t)=>{f.useEffect(()=>{e&&la(t)},[])},Ot=()=>"ixxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),En={success:"var(--color-success-primary, #00a372)",error:"var(--color-alert-primary, #da3939)",default:"var(--color-secondary-text-on-light, #4a5464)"},tl=(e,t)=>{const r={width:"20px",height:"20px",fill:"var(--color-secondary-text-on-light, #2b313b)"},n={position:"absolute",top:"10px",left:"10px",fontSize:"18px"},a={...r,...t};return()=>W.jsx(nl,{children:W.jsx(e,{...a,style:n})})},ur=({label:e,description:t,hintText:r,required:n,id:a,icon:i,iconProps:o,state:s,errorMessage:u,disabled:l,readOnly:c,...d})=>{const[p]=f.useState(()=>a||Ot()),m=[t?`${p}-description`:"",r?`${p}-hint-message`:"",s==="error"&&u?`${p}-error-message`:""].join(" ");return W.jsxs(yo,{isDisabled:l||!1,children:[!!e&&W.jsxs(bo,{children:[W.jsx(il,{bold:!0,for:p,isRequired:n||!1,children:e}),t&&W.jsx(Q.BodyUI,{id:`${p}-description`,color:"var(--color-secondary-text-on-light, #4a5464)",children:t})]}),i&&tl(i,o)(),W.jsx(da,{title:e||"Styled input",hasIcon:!!(i||"").toString(),state:s||"default",id:p,disabled:l,readOnly:c,"data-1p-ignore":!0,...t?{"aria-describedby":m}:{},...d}),r&&W.jsxs(Hr,{id:`${p}-hint-message`,children:[W.jsx(bi,{fill:"var(--color-hint-text-on-light, #68778d)"}),W.jsx(Q.TinyText,{color:"var(--color-secondary-text-on-light, #4a5464)",children:r})]}),s==="error"&&u&&W.jsxs(Hr,{id:`${p}-error-message`,children:[W.jsx(bi,{fill:"var(--color-alert-primary, #da3939)"}),W.jsx(Q.TinyText,{color:"var(--color-alert-primary, #da3939)",children:u})]})]})},bi=S(Te.IconAlertCircleOutline)`
|
|
2
2
|
width: 13px;
|
|
3
3
|
height: 13px;
|
|
4
4
|
`,Hr=S.div`
|
|
@@ -61,6 +61,12 @@
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
:read-only {
|
|
65
|
+
background-color: var(--color-surface-darken, #f3f5f7);
|
|
66
|
+
border: solid 1px var(--color-disabled-text-on-light);
|
|
67
|
+
color: var(--color-secondary-text-on-light, #4a5464);
|
|
68
|
+
}
|
|
69
|
+
|
|
64
70
|
border-color: ${({state:e="default"})=>En[e]};
|
|
65
71
|
`,nl=S.span`
|
|
66
72
|
position: relative;
|
|
@@ -522,7 +528,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
522
528
|
|
|
523
529
|
input:disabled ~ div {
|
|
524
530
|
p,
|
|
525
|
-
label
|
|
531
|
+
label {
|
|
526
532
|
color: var(--color-disabled-text-on-light);
|
|
527
533
|
cursor: default;
|
|
528
534
|
}
|