glassine-paper 1.1.2 → 1.1.3
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/lib/TextField.d.ts +4 -0
- package/lib/TextField.d.ts.map +1 -1
- package/lib/TextField.js +4 -2
- package/lib/TextField.js.map +1 -1
- package/package.json +1 -1
package/lib/TextField.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface TextFieldProps {
|
|
|
11
11
|
placeholder?: string;
|
|
12
12
|
value?: string | number;
|
|
13
13
|
error?: boolean;
|
|
14
|
+
readonly?: boolean;
|
|
14
15
|
disabled?: boolean;
|
|
15
16
|
supportingText?: string;
|
|
16
17
|
leadingIcon?: ReactNode;
|
|
@@ -20,6 +21,7 @@ export interface TextFieldProps {
|
|
|
20
21
|
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
21
22
|
className?: string;
|
|
22
23
|
style?: CSSProperties;
|
|
24
|
+
innerStyle?: CSSProperties;
|
|
23
25
|
}
|
|
24
26
|
/**
|
|
25
27
|
* Material Design 3 TextField component
|
|
@@ -33,6 +35,7 @@ export interface TextFieldProps {
|
|
|
33
35
|
* @param {string} [props.placeholder] Placeholder text (should match label)
|
|
34
36
|
* @param {(string | number)} [props.value] Current value
|
|
35
37
|
* @param {boolean} [props.error] Error state
|
|
38
|
+
* @param {boolean} [props.readonly] Readonly state
|
|
36
39
|
* @param {boolean} [props.disabled] Disabled state
|
|
37
40
|
* @param {string} [props.supportingText] Supporting text or error message
|
|
38
41
|
* @param {React.ReactNode} [props.leadingIcon] Leading icon element
|
|
@@ -42,6 +45,7 @@ export interface TextFieldProps {
|
|
|
42
45
|
* @param {Function} [props.onFocus] Focus handler
|
|
43
46
|
* @param {string} [props.className] Additional CSS class names
|
|
44
47
|
* @param {React.CSSProperties} [props.style] Custom inline styles
|
|
48
|
+
* @param {React.CSSProperties} [props.innerStyle] Custom inline styles for input element
|
|
45
49
|
* @returns {JSX.Element}
|
|
46
50
|
*
|
|
47
51
|
* @example
|
package/lib/TextField.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../src/components/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAAC;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../src/components/TextField.tsx"],"names":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CAAC;AAEF,eAAe,SAAS,CAAC"}
|
package/lib/TextField.js
CHANGED
|
@@ -12,6 +12,7 @@ import React, {} from 'react';
|
|
|
12
12
|
* @param {string} [props.placeholder] Placeholder text (should match label)
|
|
13
13
|
* @param {(string | number)} [props.value] Current value
|
|
14
14
|
* @param {boolean} [props.error] Error state
|
|
15
|
+
* @param {boolean} [props.readonly] Readonly state
|
|
15
16
|
* @param {boolean} [props.disabled] Disabled state
|
|
16
17
|
* @param {string} [props.supportingText] Supporting text or error message
|
|
17
18
|
* @param {React.ReactNode} [props.leadingIcon] Leading icon element
|
|
@@ -21,6 +22,7 @@ import React, {} from 'react';
|
|
|
21
22
|
* @param {Function} [props.onFocus] Focus handler
|
|
22
23
|
* @param {string} [props.className] Additional CSS class names
|
|
23
24
|
* @param {React.CSSProperties} [props.style] Custom inline styles
|
|
25
|
+
* @param {React.CSSProperties} [props.innerStyle] Custom inline styles for input element
|
|
24
26
|
* @returns {JSX.Element}
|
|
25
27
|
*
|
|
26
28
|
* @example
|
|
@@ -42,11 +44,11 @@ import React, {} from 'react';
|
|
|
42
44
|
* supportingText="Password is required"
|
|
43
45
|
* />
|
|
44
46
|
*/
|
|
45
|
-
export const TextField = ({ id, name, variant = 'outlined', type = 'text', label = '', value, error = false, disabled = false, supportingText, leadingIcon, trailingIcon, onChange, onBlur, onFocus, className = '', style = {}, }) => {
|
|
47
|
+
export const TextField = ({ id, name, variant = 'outlined', type = 'text', label = '', value, error = false, readonly = false, disabled = false, supportingText, leadingIcon, trailingIcon, onChange, onBlur, onFocus, className = '', style = {}, innerStyle = {}, }) => {
|
|
46
48
|
const classes = ['textfield', variant, error ? 'error' : '', className]
|
|
47
49
|
.filter(Boolean)
|
|
48
50
|
.join(' ');
|
|
49
|
-
return (_jsxs("div", { className: classes, style: style, children: [leadingIcon && leadingIcon, _jsx("label", { children: label }), _jsx("input", { id: id, name: name, type: type, value: value, placeholder: label, disabled: disabled, onChange: onChange, onBlur: onBlur, onFocus: onFocus }), trailingIcon && trailingIcon, supportingText && _jsx("div", { children: supportingText })] }));
|
|
51
|
+
return (_jsxs("div", { className: classes, style: style, children: [leadingIcon && leadingIcon, _jsx("label", { children: label }), _jsx("input", { id: id, name: name, type: type, value: value, placeholder: label, readOnly: readonly, disabled: disabled, onChange: onChange, onBlur: onBlur, onFocus: onFocus, style: innerStyle }), trailingIcon && trailingIcon, supportingText && _jsx("div", { children: supportingText })] }));
|
|
50
52
|
};
|
|
51
53
|
export default TextField;
|
|
52
54
|
//# sourceMappingURL=TextField.js.map
|
package/lib/TextField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../src/components/TextField.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAsC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../src/components/TextField.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAsC,MAAM,OAAO,CAAC;AA2BlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,CAAC,MAAM,SAAS,GAA6B,CAAC,EAClD,EAAE,EACF,IAAI,EACJ,OAAO,GAAG,UAAU,EACpB,IAAI,GAAG,MAAM,EACb,KAAK,GAAG,EAAE,EACV,KAAK,EACL,KAAK,GAAG,KAAK,EACb,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,cAAc,EACd,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,SAAS,GAAG,EAAE,EACd,KAAK,GAAG,EAAE,EACV,UAAU,GAAG,EAAE,GAChB,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC;SACpE,MAAM,CAAC,OAAO,CAAC;SAC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