softable-pixels-web 1.1.17 → 1.1.18
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/{BasePopover-DOi9H3B4.js → BasePopover-DaG1Bad1.js} +7 -5
- package/dist/BasePopover-DaG1Bad1.js.map +1 -0
- package/dist/{Button-A1POxp3L.js → Button-DiBsoNFU.js} +1 -1
- package/dist/{Button-A1POxp3L.js.map → Button-DiBsoNFU.js.map} +1 -1
- package/dist/{ContextMenu-l9GdmRqh.js → ContextMenu-DBEnLqgp.js} +6 -5
- package/dist/ContextMenu-DBEnLqgp.js.map +1 -0
- package/dist/{IconButton-CH8DZizu.js → IconButton-DAZvE8i5.js} +1 -1
- package/dist/{IconButton-CH8DZizu.js.map → IconButton-DAZvE8i5.js.map} +1 -1
- package/dist/{Input-FFQ1J5SC.js → Input-B6a6mXsZ.js} +2 -2
- package/dist/{Input-FFQ1J5SC.js.map → Input-B6a6mXsZ.js.map} +1 -1
- package/dist/{Label-C5AIUqYV.js → Label-BHq2knad.js} +1 -1
- package/dist/{Label-C5AIUqYV.js.map → Label-BHq2knad.js.map} +1 -1
- package/dist/{Popover-B6DCtCvD.js → Popover-CeU8aanh.js} +32 -4
- package/dist/Popover-CeU8aanh.js.map +1 -0
- package/dist/{Select-DtU_3TOA.js → Select-CkeZfibD.js} +8 -6
- package/dist/Select-CkeZfibD.js.map +1 -0
- package/dist/TextArea-Oqw0zh_x.js +135 -0
- package/dist/TextArea-Oqw0zh_x.js.map +1 -0
- package/dist/base-popover.d.ts +3 -2
- package/dist/base-popover.js +2 -2
- package/dist/button.js +1 -1
- package/dist/check-item.d.ts +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/context-menu.d.ts +1 -1
- package/dist/context-menu.js +3 -2
- package/dist/icon-button.js +1 -1
- package/dist/{index-fjoAYF43.d.ts → index-BD5ThARj.d.ts} +1 -1
- package/dist/{index-B_Soaf4t.d.ts → index-BD5Vr9sw.d.ts} +25 -9
- package/dist/{index-B1ejLAYY.d.ts → index-BDr6Gid4.d.ts} +4 -4
- package/dist/{index-QQdIoKht.d.ts → index-BymgvkBq.d.ts} +1 -1
- package/dist/{index-Dud1UL9T.d.ts → index-C5UBhjvX.d.ts} +5 -1
- package/dist/{index-BWV7SXNm.d.ts → index-CzB15994.d.ts} +1 -1
- package/dist/{index-DpH49YA0.d.ts → index-D-9XHxWM.d.ts} +3 -3
- package/dist/{index-CdNWNIsY.d.ts → index-DiIBw1ed.d.ts} +8 -3
- package/dist/index-DlKVR1LO.d.ts +9 -0
- package/dist/{index-DZE-RE4B.d.ts → index-aQIW73fh.d.ts} +1 -1
- package/dist/index.d.ts +11 -10
- package/dist/index.js +9 -9
- package/dist/input.js +2 -2
- package/dist/popover.d.ts +2 -1
- package/dist/popover.js +1 -1
- package/dist/select.d.ts +2 -1
- package/dist/select.js +4 -4
- package/dist/switch.d.ts +1 -1
- package/dist/tab-switch.d.ts +1 -1
- package/dist/text-area.d.ts +1 -2
- package/dist/text-area.js +2 -2
- package/dist/theme-context.d.ts +1 -1
- package/dist/{index-CNn6Rkw1.d.ts → types-C2C3tKY8.d.ts} +5 -7
- package/dist/{types-V8tEaVpX.d.ts → types-CCfbRgMy.d.ts} +1 -1
- package/dist/use-floating.d.ts +1 -1
- package/package.json +1 -1
- package/dist/BasePopover-DOi9H3B4.js.map +0 -1
- package/dist/ContextMenu-l9GdmRqh.js.map +0 -1
- package/dist/Popover-B6DCtCvD.js.map +0 -1
- package/dist/Select-DtU_3TOA.js.map +0 -1
- package/dist/TextArea-DY7hxFbx.js +0 -113
- package/dist/TextArea-DY7hxFbx.js.map +0 -1
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { n as styled, t as useThemedStyles } from "./useThemedStyles-CrarDyWc.js";
|
|
2
|
-
import { t as Icon } from "./Icon-KzwFJI_k.js";
|
|
3
|
-
import { t as Typography } from "./Typography-BkFV7BhK.js";
|
|
4
|
-
import { t as Label } from "./Label-C5AIUqYV.js";
|
|
5
|
-
import { useId } from "react";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
-
//#region src/components/commons/inputs/TextArea/styles.ts
|
|
9
|
-
function createTextAreaStyles(props) {
|
|
10
|
-
const { height = "8rem", readOnly, startIcon } = props;
|
|
11
|
-
const focusRingColor = props.focusedRingColor || "var(--px-color-info)";
|
|
12
|
-
const placeHolderColor = props.placeholderColor || "var(--px-text-placeholder)";
|
|
13
|
-
return styled({
|
|
14
|
-
iconContainer: {
|
|
15
|
-
position: "absolute",
|
|
16
|
-
left: "0.75rem",
|
|
17
|
-
top: "1.375rem",
|
|
18
|
-
transform: "translateY(-50%)"
|
|
19
|
-
},
|
|
20
|
-
textArea: {
|
|
21
|
-
height,
|
|
22
|
-
width: "100%",
|
|
23
|
-
paddingBlock: "0.75rem",
|
|
24
|
-
paddingInline: "0.875rem",
|
|
25
|
-
borderRadius: "0.5rem",
|
|
26
|
-
resize: "none",
|
|
27
|
-
fontWeight: "400",
|
|
28
|
-
fontSize: "1rem",
|
|
29
|
-
color: "var(--px-text-primary)",
|
|
30
|
-
border: "1px solid red",
|
|
31
|
-
outlineOffset: "-1px",
|
|
32
|
-
cursor: readOnly ? "default" : void 0,
|
|
33
|
-
paddingLeft: startIcon ? "2.5rem" : void 0,
|
|
34
|
-
__rules: {
|
|
35
|
-
"&::placeholder": { color: `${placeHolderColor}` },
|
|
36
|
-
"&:focus": readOnly ? { outline: "none" } : { outline: `2px solid ${focusRingColor}` }
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/components/commons/inputs/TextArea/index.tsx
|
|
44
|
-
const TextArea = (props) => {
|
|
45
|
-
const { value, disabled, readOnly, maxLength, hideMaxLength, textMaxLength, placeholder, label, required, requiredColor, labelColor, labelVariant, startIcon, iconColor } = props;
|
|
46
|
-
const inputId = useId();
|
|
47
|
-
const { styles, classes } = useThemedStyles(props, createTextAreaStyles, {
|
|
48
|
-
pick: (p) => [
|
|
49
|
-
p.height,
|
|
50
|
-
p.readOnly,
|
|
51
|
-
p.startIcon,
|
|
52
|
-
p.placeholderColor,
|
|
53
|
-
p.focusedRingColor
|
|
54
|
-
],
|
|
55
|
-
override: props.styles,
|
|
56
|
-
applyCommonProps: true
|
|
57
|
-
});
|
|
58
|
-
function handleChange(e) {
|
|
59
|
-
if (disabled || readOnly) return;
|
|
60
|
-
props.onChange?.(e.target.value);
|
|
61
|
-
}
|
|
62
|
-
function renderLabel() {
|
|
63
|
-
if (!label) return null;
|
|
64
|
-
return /* @__PURE__ */ jsx("div", {
|
|
65
|
-
className: "flex items-center gap-3",
|
|
66
|
-
children: /* @__PURE__ */ jsx(Label, {
|
|
67
|
-
label,
|
|
68
|
-
htmlFor: inputId,
|
|
69
|
-
color: labelColor,
|
|
70
|
-
required,
|
|
71
|
-
variant: labelVariant,
|
|
72
|
-
requiredColor
|
|
73
|
-
})
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
77
|
-
renderLabel(),
|
|
78
|
-
/* @__PURE__ */ jsxs("div", {
|
|
79
|
-
style: { position: "relative" },
|
|
80
|
-
children: [startIcon && /* @__PURE__ */ jsx("div", {
|
|
81
|
-
style: styles.iconContainer,
|
|
82
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
83
|
-
name: startIcon,
|
|
84
|
-
color: iconColor ? iconColor : "var(--px-text-primary)"
|
|
85
|
-
})
|
|
86
|
-
}), /* @__PURE__ */ jsx("textarea", {
|
|
87
|
-
value,
|
|
88
|
-
disabled,
|
|
89
|
-
readOnly,
|
|
90
|
-
maxLength,
|
|
91
|
-
placeholder,
|
|
92
|
-
style: styles.textArea,
|
|
93
|
-
className: classes.textArea,
|
|
94
|
-
onChange: handleChange
|
|
95
|
-
})]
|
|
96
|
-
}),
|
|
97
|
-
maxLength && !hideMaxLength ? /* @__PURE__ */ jsxs(Typography, {
|
|
98
|
-
variant: "b2",
|
|
99
|
-
styles: { text: { marginLeft: "auto" } },
|
|
100
|
-
children: [
|
|
101
|
-
value.length,
|
|
102
|
-
"/",
|
|
103
|
-
maxLength,
|
|
104
|
-
" ",
|
|
105
|
-
textMaxLength
|
|
106
|
-
]
|
|
107
|
-
}) : null
|
|
108
|
-
] });
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
//#endregion
|
|
112
|
-
export { TextArea as t };
|
|
113
|
-
//# sourceMappingURL=TextArea-DY7hxFbx.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea-DY7hxFbx.js","names":[],"sources":["../src/components/commons/inputs/TextArea/styles.ts","../src/components/commons/inputs/TextArea/index.tsx"],"sourcesContent":["// Types\nimport { styled } from '@hooks/useThemedStyles/types'\nimport type { TextAreaProps } from './types'\n\nexport function createTextAreaStyles(props: TextAreaProps) {\n const { height = '8rem', readOnly, startIcon } = props\n\n const focusRingColor = props.focusedRingColor || 'var(--px-color-info)'\n const placeHolderColor =\n props.placeholderColor || 'var(--px-text-placeholder)'\n\n return styled({\n iconContainer: {\n position: 'absolute',\n left: '0.75rem',\n top: '1.375rem',\n transform: 'translateY(-50%)'\n },\n textArea: {\n height,\n width: '100%',\n paddingBlock: '0.75rem',\n paddingInline: '0.875rem',\n borderRadius: '0.5rem',\n resize: 'none',\n\n fontWeight: '400',\n fontSize: '1rem',\n color: 'var(--px-text-primary)',\n\n border: '1px solid red',\n outlineOffset: '-1px',\n\n cursor: readOnly ? 'default' : undefined,\n paddingLeft: startIcon ? '2.5rem' : undefined,\n\n __rules: {\n '&::placeholder': {\n color: `${placeHolderColor}`\n },\n '&:focus': readOnly\n ? { outline: 'none' }\n : { outline: `2px solid ${focusRingColor}` }\n }\n }\n })\n}\n","// External Libraries\nimport { useId } from 'react'\n\n// Types\nimport type { TextAreaProps } from './types'\n\n// Components\nimport { Label } from '@components/commons/toolkit/Label'\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createTextAreaStyles } from './styles'\n\nexport const TextArea = (props: TextAreaProps) => {\n const {\n value,\n disabled,\n readOnly,\n maxLength,\n hideMaxLength,\n textMaxLength,\n placeholder,\n\n label,\n required,\n requiredColor,\n labelColor,\n labelVariant,\n\n startIcon,\n iconColor\n } = props\n\n // Hooks\n const inputId = useId()\n\n const { styles, classes } = useThemedStyles(props, createTextAreaStyles, {\n pick: p => [\n p.height,\n p.readOnly,\n p.startIcon,\n p.placeholderColor,\n p.focusedRingColor\n ],\n override: props.styles,\n applyCommonProps: true\n })\n\n // Functions\n function handleChange(e: React.ChangeEvent<HTMLTextAreaElement>) {\n if (disabled || readOnly) return\n props.onChange?.(e.target.value)\n }\n\n function renderLabel() {\n if (!label) return null\n\n return (\n <div className=\"flex items-center gap-3\">\n <Label\n label={label}\n htmlFor={inputId}\n color={labelColor}\n required={required}\n variant={labelVariant}\n requiredColor={requiredColor}\n />\n </div>\n )\n }\n\n return (\n <div>\n {renderLabel()}\n\n <div style={{ position: 'relative' }}>\n {startIcon && (\n <div style={styles.iconContainer}>\n <Icon\n name={startIcon}\n color={iconColor ? iconColor : 'var(--px-text-primary)'}\n />\n </div>\n )}\n\n <textarea\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n maxLength={maxLength}\n placeholder={placeholder}\n style={styles.textArea}\n className={classes.textArea}\n onChange={handleChange}\n />\n </div>\n\n {maxLength && !hideMaxLength ? (\n <Typography variant=\"b2\" styles={{ text: { marginLeft: 'auto' } }}>\n {value.length}/{maxLength} {textMaxLength}\n </Typography>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;AAIA,SAAgB,qBAAqB,OAAsB;CACzD,MAAM,EAAE,SAAS,QAAQ,UAAU,cAAc;CAEjD,MAAM,iBAAiB,MAAM,oBAAoB;CAC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