@hbuesing/ui-library 1.0.0 → 1.1.0
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/components/images/index.d.ts +1 -1
- package/dist/components/input/baseInput.d.ts +2 -1
- package/dist/components/input/customInput.d.ts +9 -0
- package/dist/components/input/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/index.modern.mjs +1 -1
- package/dist/index.modern.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/input/textInput.d.ts +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './svgIcon';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef } from
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import './input.scss';
|
|
3
3
|
export interface IBaseInput extends ComponentPropsWithoutRef<'input'> {
|
|
4
4
|
label: string;
|
|
@@ -7,5 +7,6 @@ export interface IBaseInput extends ComponentPropsWithoutRef<'input'> {
|
|
|
7
7
|
iconColor?: string;
|
|
8
8
|
iconSrc?: string;
|
|
9
9
|
inputColor?: string;
|
|
10
|
+
toggle?: () => void;
|
|
10
11
|
}
|
|
11
12
|
export declare function BaseInput(props: IBaseInput): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IBaseInput } from './baseInput';
|
|
2
|
+
import './input.scss';
|
|
3
|
+
interface ICustomInput extends IBaseInput {
|
|
4
|
+
tooltipIcon?: string;
|
|
5
|
+
tooltipText?: string;
|
|
6
|
+
tooltipClose?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function CustomInput(props: ICustomInput): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './customInput';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { CustomInput } from './components/input';
|
|
2
2
|
export { SVG } from './components/images';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var i=require("react/jsx-runtime"),
|
|
1
|
+
var i=require("react/jsx-runtime"),l=require("react");function n(){return n=Object.assign?Object.assign.bind():function(i){for(var l=1;l<arguments.length;l++){var n=arguments[l];for(var r in n)({}).hasOwnProperty.call(n,r)&&(i[r]=n[r])}return i},n.apply(null,arguments)}function r(i,l){if(null==i)return{};var n={};for(var r in i)if({}.hasOwnProperty.call(i,r)){if(l.indexOf(r)>=0)continue;n[r]=i[r]}return n}function e(l){var n=l.src,r=l.color,e=l.height,t=l.width;if(!n.includes(".svg"))throw new Error("Provided src is not an svg image");return i.jsx("svg",{"aria-hidden":!0,className:"uil-svg",style:{fill:r,height:e+"px",width:t+"px"},children:i.jsx("use",{href:n})})}var t=["label","valueChanged","iconColor","iconSrc","inputColor","toggle"];function o(l){var o=l.label,s=l.valueChanged,a=l.iconColor,c=l.iconSrc,u=l.inputColor,h=l.toggle,p=r(l,t);return i.jsxs("label",{className:"uil-input-wrapper",children:[i.jsx("input",n({className:"uil-input",onChange:function(i){return s(i.target.value)},placeholder:o,style:{color:u}},p)),c&&i.jsx("div",{className:"uil-icon",onClick:h,children:i.jsx(e,{src:c,width:24,height:24,color:a})}),i.jsx("span",{className:"uil-label",style:{color:u},children:o})]})}var s=["tooltipIcon","tooltipText","tooltipClose"];exports.CustomInput=function(t){var a=t.tooltipIcon,c=t.tooltipText,u=t.tooltipClose,h=r(t,s),p=l.useState(!1),d=p[0],x=p[1];function v(){x(!1)}return i.jsx(i.Fragment,{children:a?i.jsxs("div",{className:"uil-tooltip-wrapper",children:[d&&i.jsxs("div",{className:"uil-tooltip",onClick:v,children:[u&&i.jsx("button",{className:"uil-tooltip-button",onClick:v,children:u}),i.jsx("span",{children:c})]}),i.jsx("div",{className:"uil-tooltip-icon",onClick:function(){return x(!d)},children:i.jsx(e,{src:a,height:16,width:16})}),i.jsx(o,n({},h))]}):i.jsx(o,n({},h))})},exports.SVG=e;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/components/input/
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/components/input/customInput.tsx"],"sourcesContent":["import React, {CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon {\n src : string;\n color? : string;\n height?: number;\n width? : number;\n}\n\nexport function SVG(props: ISvgIcon) {\n const {\n src,\n color,\n height,\n width\n } = props;\n\n if (!src.includes('.svg')) {\n throw new Error('Provided src is not an svg image')\n }\n\n const style: CSSProperties = {\n fill: color,\n height: `${height}px`,\n width: `${width}px`\n }\n\n return (\n <svg aria-hidden={true} className={'uil-svg'} style={style}>\n <use href={src}/>\n </svg>\n );\n}","import React, {ComponentPropsWithoutRef} from 'react';\nimport {SVG} from '../images/svgIcon';\nimport './input.scss';\n\nexport interface IBaseInput extends ComponentPropsWithoutRef<'input'> {\n label : string;\n value : string;\n valueChanged: (value: string) => void;\n iconColor? : string;\n iconSrc? : string;\n inputColor? : string;\n toggle? : () => void;\n}\n\nexport function BaseInput(props: IBaseInput) {\n const {\n label,\n valueChanged,\n iconColor,\n iconSrc,\n inputColor,\n toggle,\n ...inputProps\n } = props;\n\n return (\n <label className={'uil-input-wrapper'}>\n <input\n className={'uil-input'}\n onChange={(e) => valueChanged(e.target.value)}\n placeholder={label}\n style={{color: inputColor}}\n {...inputProps}\n />\n\n {iconSrc &&\n <div className={'uil-icon'} onClick={toggle}>\n <SVG src={iconSrc} width={24} height={24} color={iconColor}/>\n </div>\n }\n\n <span className={'uil-label'} style={{color: inputColor}}>{label}</span>\n </label>\n );\n}","import React, {useState} from 'react';\nimport {BaseInput, IBaseInput} from './baseInput';\nimport {SVG} from '../images/svgIcon';\nimport './input.scss';\n\ninterface ICustomInput extends IBaseInput {\n tooltipIcon? : string;\n tooltipText? : string;\n tooltipClose?: string\n}\n\nexport function CustomInput(props: ICustomInput) {\n const {\n tooltipIcon,\n tooltipText,\n tooltipClose,\n ...inputProps\n } = props;\n\n const [tooltipVisible, setTooltipVisible] = useState(false);\n\n function closeTooltip() {\n setTooltipVisible(false);\n }\n\n return (\n <>\n {tooltipIcon ?\n <div className={'uil-tooltip-wrapper'}>\n {tooltipVisible &&\n <div className={'uil-tooltip'} onClick={closeTooltip}>\n {tooltipClose &&\n <button className={'uil-tooltip-button'} onClick={closeTooltip}>\n {tooltipClose}\n </button>\n }\n\n <span>{tooltipText}</span>\n </div>\n }\n\n <div className={'uil-tooltip-icon'} onClick={() => setTooltipVisible(!tooltipVisible)}>\n <SVG src={tooltipIcon} height={16} width={16}/>\n </div>\n\n <BaseInput {...inputProps}/>\n </div> :\n\n <BaseInput {...inputProps}/>\n }\n </>\n );\n}"],"names":["SVG","props","src","color","height","width","includes","Error","_jsx","jsx","className","style","fill","children","href","BaseInput","label","valueChanged","iconColor","iconSrc","inputColor","toggle","inputProps","_objectWithoutPropertiesLoose","_excluded","_jsxs","onChange","e","target","value","placeholder","onClick","tooltipIcon","tooltipText","tooltipClose","_useState","useState","tooltipVisible","setTooltipVisible","closeTooltip","_Fragment","Fragment","jsxs","_extends"],"mappings":"yZAUM,SAAUA,EAAIC,GAClB,IACEC,EAIED,EAJFC,IACAC,EAGEF,EAHFE,MACAC,EAEEH,EAFFG,OACAC,EACEJ,EADFI,MAGF,IAAKH,EAAII,SAAS,QAChB,MAAU,IAAAC,MAAM,oCASlB,OACEC,EAAkBC,IAAA,MAAA,CAAA,eAAA,EAAMC,UAAW,UAAWC,MAPnB,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AAW,mBAAoBqB,QAAS,WAAA,OAAMO,GAAmBD,EAAe,EACnFxB,SAAAL,MAACR,EAAG,CAACE,IAAK8B,EAAa5B,OAAQ,GAAIC,MAAO,OAG5CG,MAACO,EAAS4B,EAAKrB,CAAAA,EAAAA,OAGjBd,EAAAC,IAACM,EAAS4B,EAAA,CAAA,EAAKrB,KAIvB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as i,jsxs as l,Fragment as n}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{jsx as i,jsxs as l,Fragment as n}from"react/jsx-runtime";import{useState as o}from"react";function r(){return r=Object.assign?Object.assign.bind():function(i){for(var l=1;l<arguments.length;l++){var n=arguments[l];for(var o in n)({}).hasOwnProperty.call(n,o)&&(i[o]=n[o])}return i},r.apply(null,arguments)}function t(i,l){if(null==i)return{};var n={};for(var o in i)if({}.hasOwnProperty.call(i,o)){if(l.indexOf(o)>=0)continue;n[o]=i[o]}return n}function e(l){var n=l.src,o=l.color,r=l.height,t=l.width;if(!n.includes(".svg"))throw new Error("Provided src is not an svg image");return i("svg",{"aria-hidden":!0,className:"uil-svg",style:{fill:o,height:r+"px",width:t+"px"},children:i("use",{href:n})})}var c=["label","valueChanged","iconColor","iconSrc","inputColor","toggle"];function a(n){var o=n.label,a=n.valueChanged,s=n.iconColor,u=n.iconSrc,h=n.inputColor,p=n.toggle,d=t(n,c);return l("label",{className:"uil-input-wrapper",children:[i("input",r({className:"uil-input",onChange:function(i){return a(i.target.value)},placeholder:o,style:{color:h}},d)),u&&i("div",{className:"uil-icon",onClick:p,children:i(e,{src:u,width:24,height:24,color:s})}),i("span",{className:"uil-label",style:{color:h},children:o})]})}var s=["tooltipIcon","tooltipText","tooltipClose"];function u(c){var u=c.tooltipIcon,h=c.tooltipText,p=c.tooltipClose,d=t(c,s),v=o(!1),f=v[0],g=v[1];function m(){g(!1)}return i(n,{children:u?l("div",{className:"uil-tooltip-wrapper",children:[f&&l("div",{className:"uil-tooltip",onClick:m,children:[p&&i("button",{className:"uil-tooltip-button",onClick:m,children:p}),i("span",{children:h})]}),i("div",{className:"uil-tooltip-icon",onClick:function(){return g(!f)},children:i(e,{src:u,height:16,width:16})}),i(a,r({},d))]}):i(a,r({},d))})}export{u as CustomInput,e as SVG};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/components/input/
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/components/input/customInput.tsx"],"sourcesContent":["import React, {CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon {\n src : string;\n color? : string;\n height?: number;\n width? : number;\n}\n\nexport function SVG(props: ISvgIcon) {\n const {\n src,\n color,\n height,\n width\n } = props;\n\n if (!src.includes('.svg')) {\n throw new Error('Provided src is not an svg image')\n }\n\n const style: CSSProperties = {\n fill: color,\n height: `${height}px`,\n width: `${width}px`\n }\n\n return (\n <svg aria-hidden={true} className={'uil-svg'} style={style}>\n <use href={src}/>\n </svg>\n );\n}","import React, {ComponentPropsWithoutRef} from 'react';\nimport {SVG} from '../images/svgIcon';\nimport './input.scss';\n\nexport interface IBaseInput extends ComponentPropsWithoutRef<'input'> {\n label : string;\n value : string;\n valueChanged: (value: string) => void;\n iconColor? : string;\n iconSrc? : string;\n inputColor? : string;\n toggle? : () => void;\n}\n\nexport function BaseInput(props: IBaseInput) {\n const {\n label,\n valueChanged,\n iconColor,\n iconSrc,\n inputColor,\n toggle,\n ...inputProps\n } = props;\n\n return (\n <label className={'uil-input-wrapper'}>\n <input\n className={'uil-input'}\n onChange={(e) => valueChanged(e.target.value)}\n placeholder={label}\n style={{color: inputColor}}\n {...inputProps}\n />\n\n {iconSrc &&\n <div className={'uil-icon'} onClick={toggle}>\n <SVG src={iconSrc} width={24} height={24} color={iconColor}/>\n </div>\n }\n\n <span className={'uil-label'} style={{color: inputColor}}>{label}</span>\n </label>\n );\n}","import React, {useState} from 'react';\nimport {BaseInput, IBaseInput} from './baseInput';\nimport {SVG} from '../images/svgIcon';\nimport './input.scss';\n\ninterface ICustomInput extends IBaseInput {\n tooltipIcon? : string;\n tooltipText? : string;\n tooltipClose?: string\n}\n\nexport function CustomInput(props: ICustomInput) {\n const {\n tooltipIcon,\n tooltipText,\n tooltipClose,\n ...inputProps\n } = props;\n\n const [tooltipVisible, setTooltipVisible] = useState(false);\n\n function closeTooltip() {\n setTooltipVisible(false);\n }\n\n return (\n <>\n {tooltipIcon ?\n <div className={'uil-tooltip-wrapper'}>\n {tooltipVisible &&\n <div className={'uil-tooltip'} onClick={closeTooltip}>\n {tooltipClose &&\n <button className={'uil-tooltip-button'} onClick={closeTooltip}>\n {tooltipClose}\n </button>\n }\n\n <span>{tooltipText}</span>\n </div>\n }\n\n <div className={'uil-tooltip-icon'} onClick={() => setTooltipVisible(!tooltipVisible)}>\n <SVG src={tooltipIcon} height={16} width={16}/>\n </div>\n\n <BaseInput {...inputProps}/>\n </div> :\n\n <BaseInput {...inputProps}/>\n }\n </>\n );\n}"],"names":["SVG","props","src","color","height","width","includes","Error","_jsx","className","style","fill","children","href","BaseInput","label","valueChanged","iconColor","iconSrc","inputColor","toggle","inputProps","_objectWithoutPropertiesLoose","_excluded","_jsxs","onChange","e","target","value","placeholder","onClick","CustomInput","tooltipIcon","tooltipText","tooltipClose","_useState","useState","tooltipVisible","setTooltipVisible","closeTooltip","_Fragment","_extends"],"mappings":"ocAUM,SAAUA,EAAIC,GAClB,IACEC,EAIED,EAJFC,IACAC,EAGEF,EAHFE,MACAC,EAEEH,EAFFG,OACAC,EACEJ,EADFI,MAGF,IAAKH,EAAII,SAAS,QAChB,MAAU,IAAAC,MAAM,oCASlB,OACEC,EAAkB,MAAA,CAAA,eAAA,EAAMC,UAAW,UAAWC,MA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AACR,EAAG,CAACE,IAAK8B,EAAa5B,OAAQ,GAAIC,MAAO,OAG5CG,EAACM,EAAS2B,EAAKpB,CAAAA,EAAAA,OAGjBb,EAACM,EAAS2B,EAAA,CAAA,EAAKpB,KAIvB"}
|
package/dist/index.modern.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as i,jsxs as l,Fragment as o}from"react/jsx-runtime";import{useState as n}from"react";function t(){return t=Object.assign?Object.assign.bind():function(i){for(var l=1;l<arguments.length;l++){var o=arguments[l];for(var n in o)({}).hasOwnProperty.call(o,n)&&(i[n]=o[n])}return i},t.apply(null,arguments)}function
|
|
1
|
+
import{jsx as i,jsxs as l,Fragment as o}from"react/jsx-runtime";import{useState as n}from"react";function t(){return t=Object.assign?Object.assign.bind():function(i){for(var l=1;l<arguments.length;l++){var o=arguments[l];for(var n in o)({}).hasOwnProperty.call(o,n)&&(i[n]=o[n])}return i},t.apply(null,arguments)}function e(i,l){if(null==i)return{};var o={};for(var n in i)if({}.hasOwnProperty.call(i,n)){if(l.indexOf(n)>=0)continue;o[n]=i[n]}return o}function r(l){const{src:o,color:n,height:t,width:e}=l;if(!o.includes(".svg"))throw new Error("Provided src is not an svg image");return i("svg",{"aria-hidden":!0,className:"uil-svg",style:{fill:n,height:`${t}px`,width:`${e}px`},children:i("use",{href:o})})}const c=["label","valueChanged","iconColor","iconSrc","inputColor","toggle"];function a(o){const{label:n,valueChanged:a,iconColor:s,iconSrc:u,inputColor:h,toggle:p}=o,d=e(o,c);return l("label",{className:"uil-input-wrapper",children:[i("input",t({className:"uil-input",onChange:i=>a(i.target.value),placeholder:n,style:{color:h}},d)),u&&i("div",{className:"uil-icon",onClick:p,children:i(r,{src:u,width:24,height:24,color:s})}),i("span",{className:"uil-label",style:{color:h},children:n})]})}const s=["tooltipIcon","tooltipText","tooltipClose"];function u(c){const{tooltipIcon:u,tooltipText:h,tooltipClose:p}=c,d=e(c,s),[g,f]=n(!1);function v(){f(!1)}return i(o,{children:u?l("div",{className:"uil-tooltip-wrapper",children:[g&&l("div",{className:"uil-tooltip",onClick:v,children:[p&&i("button",{className:"uil-tooltip-button",onClick:v,children:p}),i("span",{children:h})]}),i("div",{className:"uil-tooltip-icon",onClick:()=>f(!g),children:i(r,{src:u,height:16,width:16})}),i(a,t({},d))]}):i(a,t({},d))})}export{u as CustomInput,r as SVG};
|
|
2
2
|
//# sourceMappingURL=index.modern.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.modern.mjs","sources":["../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/components/input/
|
|
1
|
+
{"version":3,"file":"index.modern.mjs","sources":["../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/components/input/customInput.tsx"],"sourcesContent":["import React, {CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon {\n src : string;\n color? : string;\n height?: number;\n width? : number;\n}\n\nexport function SVG(props: ISvgIcon) {\n const {\n src,\n color,\n height,\n width\n } = props;\n\n if (!src.includes('.svg')) {\n throw new Error('Provided src is not an svg image')\n }\n\n const style: CSSProperties = {\n fill: color,\n height: `${height}px`,\n width: `${width}px`\n }\n\n return (\n <svg aria-hidden={true} className={'uil-svg'} style={style}>\n <use href={src}/>\n </svg>\n );\n}","import React, {ComponentPropsWithoutRef} from 'react';\nimport {SVG} from '../images/svgIcon';\nimport './input.scss';\n\nexport interface IBaseInput extends ComponentPropsWithoutRef<'input'> {\n label : string;\n value : string;\n valueChanged: (value: string) => void;\n iconColor? : string;\n iconSrc? : string;\n inputColor? : string;\n toggle? : () => void;\n}\n\nexport function BaseInput(props: IBaseInput) {\n const {\n label,\n valueChanged,\n iconColor,\n iconSrc,\n inputColor,\n toggle,\n ...inputProps\n } = props;\n\n return (\n <label className={'uil-input-wrapper'}>\n <input\n className={'uil-input'}\n onChange={(e) => valueChanged(e.target.value)}\n placeholder={label}\n style={{color: inputColor}}\n {...inputProps}\n />\n\n {iconSrc &&\n <div className={'uil-icon'} onClick={toggle}>\n <SVG src={iconSrc} width={24} height={24} color={iconColor}/>\n </div>\n }\n\n <span className={'uil-label'} style={{color: inputColor}}>{label}</span>\n </label>\n );\n}","import React, {useState} from 'react';\nimport {BaseInput, IBaseInput} from './baseInput';\nimport {SVG} from '../images/svgIcon';\nimport './input.scss';\n\ninterface ICustomInput extends IBaseInput {\n tooltipIcon? : string;\n tooltipText? : string;\n tooltipClose?: string\n}\n\nexport function CustomInput(props: ICustomInput) {\n const {\n tooltipIcon,\n tooltipText,\n tooltipClose,\n ...inputProps\n } = props;\n\n const [tooltipVisible, setTooltipVisible] = useState(false);\n\n function closeTooltip() {\n setTooltipVisible(false);\n }\n\n return (\n <>\n {tooltipIcon ?\n <div className={'uil-tooltip-wrapper'}>\n {tooltipVisible &&\n <div className={'uil-tooltip'} onClick={closeTooltip}>\n {tooltipClose &&\n <button className={'uil-tooltip-button'} onClick={closeTooltip}>\n {tooltipClose}\n </button>\n }\n\n <span>{tooltipText}</span>\n </div>\n }\n\n <div className={'uil-tooltip-icon'} onClick={() => setTooltipVisible(!tooltipVisible)}>\n <SVG src={tooltipIcon} height={16} width={16}/>\n </div>\n\n <BaseInput {...inputProps}/>\n </div> :\n\n <BaseInput {...inputProps}/>\n }\n </>\n );\n}"],"names":["SVG","props","src","color","height","width","includes","Error","_jsx","className","style","fill","children","href","BaseInput","label","valueChanged","iconColor","iconSrc","inputColor","toggle","inputProps","_objectWithoutPropertiesLoose","_excluded","_jsxs","onChange","e","target","value","placeholder","onClick","CustomInput","tooltipIcon","tooltipText","tooltipClose","tooltipVisible","setTooltipVisible","useState","closeTooltip","_Fragment","_extends"],"mappings":"6cAUgBA,EAAIC,GAClB,MAAMC,IACJA,EAAGC,MACHA,EAAKC,OACLA,EAAMC,MACNA,GACEJ,EAEJ,IAAKC,EAAII,SAAS,QAChB,MAAU,IAAAC,MAAM,oCASlB,OACEC,EAAkB,MAAA,CAAA,eAAA,EAAMC,UAAW,UAAWC,MAPn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A,EAAKnB,KAIvB"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react"],i):i((e||self).uiLibrary={},e.jsxRuntime,e.react)}(this,function(e,i,n){function t(){return t=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},t.apply(null,arguments)}function
|
|
1
|
+
!function(e,i){"object"==typeof exports&&"undefined"!=typeof module?i(exports,require("react/jsx-runtime"),require("react")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","react"],i):i((e||self).uiLibrary={},e.jsxRuntime,e.react)}(this,function(e,i,n){function t(){return t=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var n=arguments[i];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},t.apply(null,arguments)}function o(e,i){if(null==e)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(i.indexOf(t)>=0)continue;n[t]=e[t]}return n}function l(e){var n=e.src,t=e.color,o=e.height,l=e.width;if(!n.includes(".svg"))throw new Error("Provided src is not an svg image");return i.jsx("svg",{"aria-hidden":!0,className:"uil-svg",style:{fill:t,height:o+"px",width:l+"px"},children:i.jsx("use",{href:n})})}var r=["label","valueChanged","iconColor","iconSrc","inputColor","toggle"];function s(e){var n=e.label,s=e.valueChanged,a=e.iconColor,c=e.iconSrc,u=e.inputColor,d=e.toggle,p=o(e,r);return i.jsxs("label",{className:"uil-input-wrapper",children:[i.jsx("input",t({className:"uil-input",onChange:function(e){return s(e.target.value)},placeholder:n,style:{color:u}},p)),c&&i.jsx("div",{className:"uil-icon",onClick:d,children:i.jsx(l,{src:c,width:24,height:24,color:a})}),i.jsx("span",{className:"uil-label",style:{color:u},children:n})]})}var a=["tooltipIcon","tooltipText","tooltipClose"];e.CustomInput=function(e){var r=e.tooltipIcon,c=e.tooltipText,u=e.tooltipClose,d=o(e,a),p=n.useState(!1),h=p[0],f=p[1];function x(){f(!1)}return i.jsx(i.Fragment,{children:r?i.jsxs("div",{className:"uil-tooltip-wrapper",children:[h&&i.jsxs("div",{className:"uil-tooltip",onClick:x,children:[u&&i.jsx("button",{className:"uil-tooltip-button",onClick:x,children:u}),i.jsx("span",{children:c})]}),i.jsx("div",{className:"uil-tooltip-icon",onClick:function(){return f(!h)},children:i.jsx(l,{src:r,height:16,width:16})}),i.jsx(s,t({},d))]}):i.jsx(s,t({},d))})},e.SVG=l});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/components/input/
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/components/images/svgIcon.tsx","../src/components/input/baseInput.tsx","../src/components/input/customInput.tsx"],"sourcesContent":["import React, {CSSProperties} from 'react';\nimport './images.scss';\n\ninterface ISvgIcon {\n src : string;\n color? : string;\n height?: number;\n width? : number;\n}\n\nexport function SVG(props: ISvgIcon) {\n const {\n src,\n color,\n height,\n width\n } = props;\n\n if (!src.includes('.svg')) {\n throw new Error('Provided src is not an svg image')\n }\n\n const style: CSSProperties = {\n fill: color,\n height: `${height}px`,\n width: `${width}px`\n }\n\n return (\n <svg aria-hidden={true} className={'uil-svg'} style={style}>\n <use href={src}/>\n </svg>\n );\n}","import React, {ComponentPropsWithoutRef} from 'react';\nimport {SVG} from '../images/svgIcon';\nimport './input.scss';\n\nexport interface IBaseInput extends ComponentPropsWithoutRef<'input'> {\n label : string;\n value : string;\n valueChanged: (value: string) => void;\n iconColor? : string;\n iconSrc? : string;\n inputColor? : string;\n toggle? : () => void;\n}\n\nexport function BaseInput(props: IBaseInput) {\n const {\n label,\n valueChanged,\n iconColor,\n iconSrc,\n inputColor,\n toggle,\n ...inputProps\n } = props;\n\n return (\n <label className={'uil-input-wrapper'}>\n <input\n className={'uil-input'}\n onChange={(e) => valueChanged(e.target.value)}\n placeholder={label}\n style={{color: inputColor}}\n {...inputProps}\n />\n\n {iconSrc &&\n <div className={'uil-icon'} onClick={toggle}>\n <SVG src={iconSrc} width={24} height={24} color={iconColor}/>\n </div>\n }\n\n <span className={'uil-label'} style={{color: inputColor}}>{label}</span>\n </label>\n );\n}","import React, {useState} from 'react';\nimport {BaseInput, IBaseInput} from './baseInput';\nimport {SVG} from '../images/svgIcon';\nimport './input.scss';\n\ninterface ICustomInput extends IBaseInput {\n tooltipIcon? : string;\n tooltipText? : string;\n tooltipClose?: string\n}\n\nexport function CustomInput(props: ICustomInput) {\n const {\n tooltipIcon,\n tooltipText,\n tooltipClose,\n ...inputProps\n } = props;\n\n const [tooltipVisible, setTooltipVisible] = useState(false);\n\n function closeTooltip() {\n setTooltipVisible(false);\n }\n\n return (\n <>\n {tooltipIcon ?\n <div className={'uil-tooltip-wrapper'}>\n {tooltipVisible &&\n <div className={'uil-tooltip'} onClick={closeTooltip}>\n {tooltipClose &&\n <button className={'uil-tooltip-button'} onClick={closeTooltip}>\n {tooltipClose}\n </button>\n }\n\n <span>{tooltipText}</span>\n </div>\n }\n\n <div className={'uil-tooltip-icon'} onClick={() => setTooltipVisible(!tooltipVisible)}>\n <SVG src={tooltipIcon} height={16} width={16}/>\n </div>\n\n <BaseInput {...inputProps}/>\n </div> :\n\n <BaseInput {...inputProps}/>\n }\n </>\n );\n}"],"names":["SVG","props","src","color","height","width","includes","Error","_jsx","jsx","className","style","fill","children","href","BaseInput","label","valueChanged","iconColor","iconSrc","inputColor","toggle","inputProps","_objectWithoutPropertiesLoose","_excluded","_jsxs","onChange","e","target","value","placeholder","onClick","tooltipIcon","tooltipText","tooltipClose","_useState","useState","tooltipVisible","setTooltipVisible","closeTooltip","_Fragment","Fragment","j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AAW,sBAAqBG,SAAA,CAClCwB,GACCZ,EAAKiB,KAAA,MAAA,CAAAhC,UAAW,cAAeqB,QAASQ,YACrCL,GACC1B,EAAAA,IAAQ,SAAA,CAAAE,UAAW,qBAAsBqB,QAASQ,EAC/C1B,SAAAqB,IAIL1B,EAAAA,IAAO,OAAA,CAAAK,SAAAoB,OAIXzB,EAAAA,IAAK,MAAA,CAAAE,UAAW,mBAAoBqB,QAAS,WAAA,OAAMO,GAAmBD,EAAe,EACnFxB,SAAAL,MAACR,EAAG,CAACE,IAAK8B,EAAa5B,OAAQ,GAAIC,MAAO,OAG5CG,MAACO,EAAS4B,EAAKrB,CAAAA,EAAAA,OAGjBd,EAAAC,IAACM,EAAS4B,EAAA,CAAA,EAAKrB,KAIvB"}
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { IBaseInput } from "./baseInput";
|
|
2
|
-
import './input.scss';
|
|
3
|
-
interface ITextInput extends IBaseInput {
|
|
4
|
-
tooltipIcon?: string;
|
|
5
|
-
tooltipText?: string;
|
|
6
|
-
tooltipClose?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function TextInput(props: ITextInput): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|