@twilio-paste/input
Advanced tools
Comparing version 3.0.6 to 3.0.7
# Change Log | ||
## 3.0.7 | ||
### Patch Changes | ||
- [`ed8e7ccf`](https://github.com/twilio-labs/paste/commit/ed8e7ccfc8a0d4a6aa18e8741796496690459b5d) [#1499](https://github.com/twilio-labs/paste/pull/1499) Thanks [@nkrantz](https://github.com/nkrantz)! - Added type 'date' to Input types for date picker component | ||
## 3.0.6 | ||
@@ -4,0 +10,0 @@ |
@@ -1,1 +0,1 @@ | ||
var I=Object.prototype.hasOwnProperty;var d=Object.getOwnPropertySymbols,R=Object.prototype.propertyIsEnumerable;var a=Object.assign;var c=(e,o)=>{var t={};for(var r in e)I.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&d)for(var r of d(e))o.indexOf(r)<0&&R.call(e,r)&&(t[r]=e[r]);return t};import{createElement as y,forwardRef as w}from"react";import{bool as L,func as q,oneOf as C,string as F}from"prop-types";import{styled as W,css as O}from"@twilio-paste/styling-library";import{InputBox as B}from"@twilio-paste/input-box";var k=["className","style","size","height","width"],u=e=>Object.keys(e).reduce((o,t)=>(k.includes(t)||(o[t]=e[t]),o),{});var f=W.input(e=>O({appearance:"none",background:"transparent",border:"none",borderRadius:"borderRadius20",boxShadow:"none",color:"inherit",display:"block",fontFamily:"inherit",fontSize:"fontSize30",fontWeight:"fontWeightMedium",lineHeight:"lineHeight20",margin:"space0",outline:"none",paddingBottom:"space30",paddingLeft:"space40",paddingRight:"space40",paddingTop:"space30",resize:"none",width:"100%","&::placeholder":{color:e.variant==="inverse"?"colorTextInverseWeak":"colorTextWeak",fontStyle:"italic"},"&:focus::placeholder":{color:e.variant==="inverse"?"colorTextInverseWeak":"colorTextWeak"},"&:disabled":{color:e.variant==="inverse"?"colorTextInverseWeaker":"colorTextWeaker",cursor:"not-allowed","-webkit-text-fill-color":e.variant==="inverse"?"colorTextInverseWeaker":"colorTextWeaker","-webkit-opacity":"1"}})),m=w((l,x)=>{var{disabled:e,hasError:o,id:t,insertAfter:r,insertBefore:T,name:g,placeholder:b,readOnly:i,required:h,type:p,value:P,variant:s}=l,v=c(l,["disabled","hasError","id","insertAfter","insertBefore","name","placeholder","readOnly","required","type","value","variant"]);let n={type:p};return p==="number"&&(n.type="text",n.inputmode="numeric",n.pattern="[0-9]*"),y(B,{disabled:e,hasError:o,insertAfter:r,insertBefore:T,readOnly:i,type:p,variant:s},y(f,a(a(a({"aria-invalid":o,"aria-readonly":i},u(v)),n),{disabled:e,id:t,name:g,placeholder:b,readOnly:i,ref:x,required:h,value:P,variant:s})))});m.displayName="Input";export{m as Input,f as InputElement}; | ||
var I=Object.prototype.hasOwnProperty;var d=Object.getOwnPropertySymbols,k=Object.prototype.propertyIsEnumerable;var a=Object.assign;var c=(e,o)=>{var t={};for(var r in e)I.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&d)for(var r of d(e))o.indexOf(r)<0&&k.call(e,r)&&(t[r]=e[r]);return t};import{createElement as y,forwardRef as R}from"react";import{bool as L,func as q,oneOf as C,string as F}from"prop-types";import{styled as O,css as W}from"@twilio-paste/styling-library";import{InputBox as B}from"@twilio-paste/input-box";var w=["className","style","size","height","width"],u=e=>Object.keys(e).reduce((o,t)=>(w.includes(t)||(o[t]=e[t]),o),{});var f=O.input(e=>W({appearance:"none",background:"transparent",border:"none",borderRadius:"borderRadius20",boxShadow:"none",color:"inherit",display:"block",fontFamily:"inherit",fontSize:"fontSize30",fontWeight:"fontWeightMedium",lineHeight:"lineHeight20",margin:"space0",outline:"none",paddingBottom:"space30",paddingLeft:"space40",paddingRight:"space40",paddingTop:"space30",resize:"none",width:"100%",cursor:e.type==="date"&&!e.readOnly&&!e.disabled?"text":"auto","&::placeholder":{color:e.variant==="inverse"?"colorTextInverseWeak":"colorTextWeak",fontStyle:"italic"},"&:focus::placeholder":{color:e.variant==="inverse"?"colorTextInverseWeak":"colorTextWeak"},"&:disabled":{color:e.variant==="inverse"?"colorTextInverseWeaker":"colorTextWeaker",cursor:"not-allowed","-webkit-text-fill-color":e.variant==="inverse"?"colorTextInverseWeaker":"colorTextWeaker","-webkit-opacity":"1"},"&::-webkit-datetime-edit":{display:"flex"},"&::-webkit-calendar-picker-indicator:hover":{cursor:e.readOnly||e.disabled?"default":"pointer"}})),m=R((l,P)=>{var{disabled:e,hasError:o,id:t,insertAfter:r,insertBefore:T,name:b,placeholder:g,readOnly:i,required:h,type:s,value:v,variant:p}=l,x=c(l,["disabled","hasError","id","insertAfter","insertBefore","name","placeholder","readOnly","required","type","value","variant"]);let n={type:s};return s==="number"&&(n.type="text",n.inputmode="numeric",n.pattern="[0-9]*"),y(B,{disabled:e,hasError:o,insertAfter:r,insertBefore:T,readOnly:i,type:s,variant:p},y(f,a(a(a({"aria-invalid":o,"aria-readonly":i},u(x)),n),{disabled:e,id:t,name:b,placeholder:g,readOnly:i,ref:P,required:h,value:v,variant:p})))});m.displayName="Input";export{m as Input,f as InputElement}; |
@@ -1,1 +0,1 @@ | ||
var E=Object.create,i=Object.defineProperty,N=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,S=Object.getOwnPropertyNames,z=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertySymbols,H=Object.prototype.propertyIsEnumerable;var p=Object.assign,g=e=>i(e,"__esModule",{value:!0});var b=(e,r)=>{var o={};for(var t in e)m.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&T)for(var t of T(e))r.indexOf(t)<0&&H.call(e,t)&&(o[t]=e[t]);return o};var L=(e,r)=>{g(e);for(var o in r)i(e,o,{get:r[o],enumerable:!0})},q=(e,r,o)=>{if(g(e),r&&typeof r=="object"||typeof r=="function")for(let t of S(r))!m.call(e,t)&&t!=="default"&&i(e,t,{get:()=>r[t],enumerable:!(o=z(r,t))||o.enumerable});return e},s=e=>e&&e.__esModule?e:q(i(e!=null?E(N(e)):{},"default",{value:e,enumerable:!0}),e);L(exports,{Input:()=>x,InputElement:()=>v});var n=s(require("react")),l=s(require("prop-types")),d=s(require("@twilio-paste/styling-library")),P=s(require("@twilio-paste/input-box"));var C=["className","style","size","height","width"],h=e=>Object.keys(e).reduce((r,o)=>(C.includes(o)||(r[o]=e[o]),r),{});var v=d.styled.input(e=>d.css({appearance:"none",background:"transparent",border:"none",borderRadius:"borderRadius20",boxShadow:"none",color:"inherit",display:"block",fontFamily:"inherit",fontSize:"fontSize30",fontWeight:"fontWeightMedium",lineHeight:"lineHeight20",margin:"space0",outline:"none",paddingBottom:"space30",paddingLeft:"space40",paddingRight:"space40",paddingTop:"space30",resize:"none",width:"100%","&::placeholder":{color:e.variant==="inverse"?"colorTextInverseWeak":"colorTextWeak",fontStyle:"italic"},"&:focus::placeholder":{color:e.variant==="inverse"?"colorTextInverseWeak":"colorTextWeak"},"&:disabled":{color:e.variant==="inverse"?"colorTextInverseWeaker":"colorTextWeaker",cursor:"not-allowed","-webkit-text-fill-color":e.variant==="inverse"?"colorTextInverseWeaker":"colorTextWeaker","-webkit-opacity":"1"}})),x=n.forwardRef((f,B)=>{var{disabled:e,hasError:r,id:o,insertAfter:t,insertBefore:I,name:R,placeholder:k,readOnly:c,required:w,type:u,value:W,variant:y}=f,O=b(f,["disabled","hasError","id","insertAfter","insertBefore","name","placeholder","readOnly","required","type","value","variant"]);let a={type:u};return u==="number"&&(a.type="text",a.inputmode="numeric",a.pattern="[0-9]*"),n.createElement(P.InputBox,{disabled:e,hasError:r,insertAfter:t,insertBefore:I,readOnly:c,type:u,variant:y},n.createElement(v,p(p(p({"aria-invalid":r,"aria-readonly":c},h(O)),a),{disabled:e,id:o,name:R,placeholder:k,readOnly:c,ref:B,required:w,value:W,variant:y})))});x.displayName="Input"; | ||
var E=Object.create,i=Object.defineProperty,N=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,S=Object.getOwnPropertyNames,z=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertySymbols,H=Object.prototype.propertyIsEnumerable;var s=Object.assign,b=e=>i(e,"__esModule",{value:!0});var g=(e,r)=>{var o={};for(var t in e)m.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&T)for(var t of T(e))r.indexOf(t)<0&&H.call(e,t)&&(o[t]=e[t]);return o};var L=(e,r)=>{b(e);for(var o in r)i(e,o,{get:r[o],enumerable:!0})},q=(e,r,o)=>{if(b(e),r&&typeof r=="object"||typeof r=="function")for(let t of S(r))!m.call(e,t)&&t!=="default"&&i(e,t,{get:()=>r[t],enumerable:!(o=z(r,t))||o.enumerable});return e},p=e=>e&&e.__esModule?e:q(i(e!=null?E(N(e)):{},"default",{value:e,enumerable:!0}),e);L(exports,{Input:()=>P,InputElement:()=>x});var n=p(require("react")),l=p(require("prop-types")),d=p(require("@twilio-paste/styling-library")),v=p(require("@twilio-paste/input-box"));var C=["className","style","size","height","width"],h=e=>Object.keys(e).reduce((r,o)=>(C.includes(o)||(r[o]=e[o]),r),{});var x=d.styled.input(e=>d.css({appearance:"none",background:"transparent",border:"none",borderRadius:"borderRadius20",boxShadow:"none",color:"inherit",display:"block",fontFamily:"inherit",fontSize:"fontSize30",fontWeight:"fontWeightMedium",lineHeight:"lineHeight20",margin:"space0",outline:"none",paddingBottom:"space30",paddingLeft:"space40",paddingRight:"space40",paddingTop:"space30",resize:"none",width:"100%",cursor:e.type==="date"&&!e.readOnly&&!e.disabled?"text":"auto","&::placeholder":{color:e.variant==="inverse"?"colorTextInverseWeak":"colorTextWeak",fontStyle:"italic"},"&:focus::placeholder":{color:e.variant==="inverse"?"colorTextInverseWeak":"colorTextWeak"},"&:disabled":{color:e.variant==="inverse"?"colorTextInverseWeaker":"colorTextWeaker",cursor:"not-allowed","-webkit-text-fill-color":e.variant==="inverse"?"colorTextInverseWeaker":"colorTextWeaker","-webkit-opacity":"1"},"&::-webkit-datetime-edit":{display:"flex"},"&::-webkit-calendar-picker-indicator:hover":{cursor:e.readOnly||e.disabled?"default":"pointer"}})),P=n.forwardRef((f,B)=>{var{disabled:e,hasError:r,id:o,insertAfter:t,insertBefore:I,name:k,placeholder:w,readOnly:c,required:R,type:u,value:O,variant:y}=f,W=g(f,["disabled","hasError","id","insertAfter","insertBefore","name","placeholder","readOnly","required","type","value","variant"]);let a={type:u};return u==="number"&&(a.type="text",a.inputmode="numeric",a.pattern="[0-9]*"),n.createElement(v.InputBox,{disabled:e,hasError:r,insertAfter:t,insertBefore:I,readOnly:c,type:u,variant:y},n.createElement(x,s(s(s({"aria-invalid":r,"aria-readonly":c},h(W)),a),{disabled:e,id:o,name:k,placeholder:w,readOnly:c,ref:B,required:R,value:O,variant:y})))});P.displayName="Input"; |
import * as React from 'react'; | ||
export declare type InputTypes = 'text' | 'email' | 'hidden' | 'number' | 'password' | 'search' | 'tel'; | ||
export declare type InputTypes = 'text' | 'email' | 'hidden' | 'number' | 'password' | 'search' | 'tel' | 'date'; | ||
export declare type InputVariants = 'default' | 'inverse'; | ||
@@ -4,0 +4,0 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> { |
{ | ||
"name": "@twilio-paste/input", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"category": "user input", | ||
@@ -43,3 +43,3 @@ "status": "production", | ||
"@twilio-paste/design-tokens": "^6.7.0", | ||
"@twilio-paste/input-box": "^4.0.4", | ||
"@twilio-paste/input-box": "^4.0.6", | ||
"@twilio-paste/style-props": "^3.0.4", | ||
@@ -46,0 +46,0 @@ "@twilio-paste/styling-library": "^0.3.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
325390