@zonos/amino 5.1.20 → 5.1.21
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/components/input/Input.js +1 -1
- package/components/input/input-type/_FloatLabelInput.d.ts +6 -0
- package/components/input/input-type/_NumberInput.d.ts +1 -1
- package/components/input/input-type/_NumberInput.js +1 -1
- package/package.json +1 -1
- package/styles/constants/theme.d.ts +1 -1
- package/theme.css +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../../_tslib-ccfac372.js"),r=require("react/jsx-runtime"),n=require("styled-components"),i=require("../help-text/HelpText.js"),a=require("./input-type/_DateInput.js"),t=require("./input-type/_FloatLabelInput.js"),s=require("./input-type/_NumberInput.js"),u=require("./input-type/_PasswordInput.js"),o=require("./input-type/_TimeInput.js"),l=require("../../styles/constants/theme.js");function d(e){return e&&e.__esModule?e:{default:e}}require("../text/Text.js"),require("react"),require("../../icons/CalendarIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../utils/getTestId.js"),require("../../icons/ChevronDownIcon.js"),require("../../icons/ChevronUpIcon.js"),require("../../icons/EyeIcon.js"),require("../../icons/EyeOffIcon.js"),require("../../icons/ClockIcon.js");var p,c,x=d(n),f=x.default.div(p||(p=e.__makeTemplateObject(["\n border-radius: ",";\n border: ",";\n &:hover {\n border: 1px solid ",";\n }\n"],["\n border-radius: ",";\n border: ",";\n &:hover {\n border: 1px solid ",";\n }\n"])),l.theme.radius6,l.theme.border,l.theme.gray300),b=x.default.div(c||(c=e.__makeTemplateObject(["\n position: relative;\n width: ",";\n\n & > div {\n flex-direction: row;\n align-items: center;\n display: flex;\n }\n\n &.disabled {\n opacity: 0.4;\n }\n"],["\n position: relative;\n width: ",";\n\n & > div {\n flex-direction: row;\n align-items: center;\n display: flex;\n }\n\n &.disabled {\n opacity: 0.4;\n }\n"])),(function(e){return e.width?"".concat(e.width,"px"):"100%"}));exports.Input=function(n){var l=n.autoFocus,d=n.className,p=n.disabled,c=n.error,x=n.helpText,h=n.inputMode,y=n.inputPrefix,j=n.inputSuffix,m=n.label,
|
|
1
|
+
"use strict";var e=require("../../_tslib-ccfac372.js"),r=require("react/jsx-runtime"),n=require("styled-components"),i=require("../help-text/HelpText.js"),a=require("./input-type/_DateInput.js"),t=require("./input-type/_FloatLabelInput.js"),s=require("./input-type/_NumberInput.js"),u=require("./input-type/_PasswordInput.js"),o=require("./input-type/_TimeInput.js"),l=require("../../styles/constants/theme.js");function d(e){return e&&e.__esModule?e:{default:e}}require("../text/Text.js"),require("react"),require("../../icons/CalendarIcon.js"),require("../../icons/icon-base/_IconBase.js"),require("../../utils/getTestId.js"),require("../../icons/ChevronDownIcon.js"),require("../../icons/ChevronUpIcon.js"),require("../../icons/EyeIcon.js"),require("../../icons/EyeOffIcon.js"),require("../../icons/ClockIcon.js");var p,c,x=d(n),f=x.default.div(p||(p=e.__makeTemplateObject(["\n border-radius: ",";\n border: ",";\n &:hover {\n border: 1px solid ",";\n }\n"],["\n border-radius: ",";\n border: ",";\n &:hover {\n border: 1px solid ",";\n }\n"])),l.theme.radius6,l.theme.border,l.theme.gray300),b=x.default.div(c||(c=e.__makeTemplateObject(["\n position: relative;\n width: ",";\n\n & > div {\n flex-direction: row;\n align-items: center;\n display: flex;\n }\n\n &.disabled {\n opacity: 0.4;\n }\n"],["\n position: relative;\n width: ",";\n\n & > div {\n flex-direction: row;\n align-items: center;\n display: flex;\n }\n\n &.disabled {\n opacity: 0.4;\n }\n"])),(function(e){return e.width?"".concat(e.width,"px"):"100%"}));exports.Input=function(n){var l=n.autoFocus,d=n.className,p=n.disabled,c=n.error,x=n.helpText,h=n.inputMode,y=n.inputPrefix,j=n.inputSuffix,m=n.label,v=n.onChange,q=n.onKeyDown,I=n.pattern,_=n.placeholder,w=n.prefix,g=n.readOnly,C=n.required,P=n.size,T=void 0===P?"xl":P,D=n.suffix,N=n.tabIndex,O=n.type,F=n.value,M=n.valuePrefix,z=n.width,K=e.__rest(n,["autoFocus","className","disabled","error","helpText","inputMode","inputPrefix","inputSuffix","label","onChange","onKeyDown","pattern","placeholder","prefix","readOnly","required","size","suffix","tabIndex","type","value","valuePrefix","width"]);return r.jsxs(b,{className:"amino-input-wrapper ".concat(p?"disabled":""),width:z,children:[r.jsx(f,{children:function(){switch(O){case"password":return r.jsx(u.PasswordInput,e.__assign({autoFocus:l,className:d,disabled:p,error:c,inputMode:h,label:m,onChange:v,onKeyDown:q,pattern:I,placeholder:_,prefix:w||y,readOnly:g,required:C,size:T,suffix:D||j,tabIndex:N,value:F||"",valuePrefix:M},K));case"date":case"datetime-local":return r.jsx(a.DateInput,e.__assign({autoFocus:l,className:d,disabled:p,error:c,inputMode:h,label:m,onChange:v,onKeyDown:q,pattern:I,placeholder:_,prefix:w||y,readOnly:g,required:C,size:T,suffix:D||j,tabIndex:N,type:O,value:F||"",valuePrefix:M},K));case"number":return r.jsx(s.NumberInput,e.__assign({autoFocus:l,className:d,disabled:p,error:c,inputMode:h,label:m,onChange:v,onKeyDown:q,pattern:I,placeholder:_,prefix:w||y,readOnly:g,required:C,size:T,suffix:null===D?null:D||j,tabIndex:N,value:F||"",valuePrefix:M},K));case"time":return r.jsx(o.TimeInput,e.__assign({autoFocus:l,className:d,disabled:p,error:c,inputMode:h,label:m,onChange:v,onKeyDown:q,pattern:I,placeholder:_,prefix:w||y,readOnly:g,required:C,size:T,suffix:D||j,tabIndex:N,value:F||"",valuePrefix:M},K));default:return r.jsx(t.FloatLabelInput,e.__assign({autoFocus:l,className:d,disabled:p,error:c,inputMode:h,label:m,onChange:v,onKeyDown:q,pattern:I,placeholder:_,prefix:w||y,readOnly:g,required:C,size:T,suffix:D||j,tabIndex:N,type:O,value:F||"",valuePrefix:M},K))}}()}),r.jsx(i.HelpText,{error:c,helpText:x})]})};
|
|
@@ -22,6 +22,9 @@ type FloatLabelInputType = {
|
|
|
22
22
|
readOnly?: boolean;
|
|
23
23
|
/** Determines if the input is required for form validation */
|
|
24
24
|
required?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @default 'xl'
|
|
27
|
+
*/
|
|
25
28
|
size?: Size;
|
|
26
29
|
/** A short string displayed at the end of the input. Set to `null` to disable */
|
|
27
30
|
suffix?: ReactNode;
|
|
@@ -53,6 +56,9 @@ export declare const FloatLabelInput: import("react").ForwardRefExoticComponent<
|
|
|
53
56
|
readOnly?: boolean | undefined;
|
|
54
57
|
/** Determines if the input is required for form validation */
|
|
55
58
|
required?: boolean | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* @default 'xl'
|
|
61
|
+
*/
|
|
56
62
|
size?: Size | undefined;
|
|
57
63
|
/** A short string displayed at the end of the input. Set to `null` to disable */
|
|
58
64
|
suffix?: ReactNode;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type FloatLabelInputProps } from "./_FloatLabelInput";
|
|
2
|
-
export declare const NumberInput: ({
|
|
2
|
+
export declare const NumberInput: ({ className, label, size, suffix, ...props }: FloatLabelInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var n=require("../../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";var n=require("../../../_tslib-ccfac372.js"),e=require("react/jsx-runtime"),t=require("react"),i=require("styled-components"),r=require("./_FloatLabelInput.js"),a=require("../../../icons/ChevronDownIcon.js"),s=require("../../../icons/ChevronUpIcon.js"),u=require("../../../styles/constants/theme.js");function o(n){return n&&n.__esModule?n:{default:n}}require("../../../utils/getTestId.js"),require("../../../icons/icon-base/_IconBase.js");var l,c,d,p,b=o(i),f=b.default.div(l||(l=n.__makeTemplateObject(["\n position: relative;\n width: 100%;\n"],["\n position: relative;\n width: 100%;\n"]))),v=b.default.div(c||(c=n.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n height: ",";\n"],["\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n height: ",";\n"])),(function(n){return"calc(var(--amino-size-".concat(n.$size,") - 2px)")})),h=b.default.button(d||(d=n.__makeTemplateObject(["\n padding: ",";\n border-radius: ",";\n transition: ",";\n\n &:hover {\n background: rgba(0, 0, 0, 0.04);\n }\n &:active {\n background: rgba(0, 0, 0, 0.1);\n }\n &:focus {\n outline: none;\n }\n"],["\n padding: ",";\n border-radius: ",";\n transition: ",";\n\n &:hover {\n background: rgba(0, 0, 0, 0.04);\n }\n &:active {\n background: rgba(0, 0, 0, 0.1);\n }\n &:focus {\n outline: none;\n }\n"])),u.theme.radius4,u.theme.radius4,u.theme.transition),m=b.default(r.FloatLabelInput)(p||(p=n.__makeTemplateObject(["\n && input {\n padding-right: ",";\n appearance: textfield;\n\n &::-webkit-inner-spin-button,\n &::-webkit-outer-spin-button {\n -webkit-appearance: none;\n }\n }\n"],["\n && input {\n padding-right: ",";\n appearance: textfield;\n\n &::-webkit-inner-spin-button,\n &::-webkit-outer-spin-button {\n -webkit-appearance: none;\n }\n }\n"])),u.theme.space40),j=function(n){switch(n){case"sm":return 10;case"md":return 12;case"lg":return 14;default:return 16}};exports.NumberInput=function(i){var r=i.className,u=i.label,o=i.size,l=void 0===o?"xl":o,c=i.suffix,d=n.__rest(i,["className","label","size","suffix"]),p=t.useRef(null);return e.jsx(f,{className:r,children:e.jsx(m,n.__assign({},d,{ref:p,"aria-label":u,label:u,size:l,suffix:null===c?null:c||e.jsxs(v,{$size:l,children:[e.jsx(h,{onClick:function(){var n,e;null===(n=p.current)||void 0===n||n.stepUp(),null===(e=p.current)||void 0===e||e.dispatchEvent(new Event("input",{bubbles:!0}))},type:"button",children:e.jsx(s.ChevronUpIcon,{size:j(l)})}),e.jsx(h,{onClick:function(){var n,e;null===(n=p.current)||void 0===n||n.stepDown(),null===(e=p.current)||void 0===e||e.dispatchEvent(new Event("input",{bubbles:!0}))},type:"button",children:e.jsx(a.ChevronDownIcon,{size:j(l)})})]}),type:"number"}))})};
|
package/package.json
CHANGED
package/theme.css
CHANGED