@uva-glass/component-library 3.52.1 → 3.52.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/dist/assets/MultiSelectBox.css +1 -1
- package/dist/assets/TextArea.css +1 -1
- package/dist/components/Buttons/Button.stories.js +1 -1
- package/dist/components/Buttons/LinkButton.stories.js +1 -1
- package/dist/components/Buttons/MenuButton.stories.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +2 -2
- package/dist/components/Chip/Chip.stories.js +1 -1
- package/dist/components/ControlsButton/ControlsButton.stories.js +1 -1
- package/dist/components/Drawer/Drawer.stories.js +1 -1
- package/dist/components/FormInput/FormInput.stories.js +1 -1
- package/dist/components/IconButton/IconButton.stories.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.d.ts +3 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.js +60 -57
- package/dist/components/MultiSelectBox/MultiSelectBox.js.map +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
- package/dist/components/Notification/Notification.stories.js +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/Sortable/Sortable.stories.js +1 -1
- package/dist/components/TextArea/TextArea.d.ts +5 -1
- package/dist/components/TextArea/TextArea.js +31 -21
- package/dist/components/TextArea/TextArea.js.map +1 -1
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.test.js +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
- package/dist/{index-DvUwfXNb.js → index-BJRrLdmi.js} +1426 -1423
- package/dist/index-BJRrLdmi.js.map +1 -0
- package/dist/{index-BfMTX2kB.js → index-fdIFY6eP.js} +458 -456
- package/dist/{index-BfMTX2kB.js.map → index-fdIFY6eP.js.map} +1 -1
- package/dist/storybook__react.d.js +3 -3
- package/package.json +9 -9
- package/dist/index-DvUwfXNb.js.map +0 -1
|
@@ -1,28 +1,38 @@
|
|
|
1
1
|
import { jsxs as r, jsx as _ } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import '../../assets/TextArea.css';const e = {
|
|
5
|
-
"text-area__wrapper": "_text-
|
|
6
|
-
"text-area__header": "_text-
|
|
7
|
-
"text-area__label-wrapper": "_text-area__label-
|
|
8
|
-
"text-area__label": "_text-
|
|
9
|
-
|
|
10
|
-
"text-
|
|
11
|
-
"text-area__word-count
|
|
12
|
-
"text-
|
|
2
|
+
import { useRef as h, useState as w } from "react";
|
|
3
|
+
import { c as n } from "../../clsx-OuTLNxxd.js";
|
|
4
|
+
import '../../assets/TextArea.css';const m = "_required_di3u1_25", e = {
|
|
5
|
+
"text-area__wrapper": "_text-area__wrapper_di3u1_1",
|
|
6
|
+
"text-area__header": "_text-area__header_di3u1_7",
|
|
7
|
+
"text-area__label-wrapper": "_text-area__label-wrapper_di3u1_13",
|
|
8
|
+
"text-area__label": "_text-area__label_di3u1_13",
|
|
9
|
+
required: m,
|
|
10
|
+
"text-area__sub-label": "_text-area__sub-label_di3u1_33",
|
|
11
|
+
"text-area__word-count": "_text-area__word-count_di3u1_38",
|
|
12
|
+
"text-area__word-count--alert": "_text-area__word-count--alert_di3u1_43",
|
|
13
|
+
"text-area": "_text-area_di3u1_1",
|
|
14
|
+
"not-valid": "_not-valid_di3u1_61"
|
|
13
15
|
};
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
function N({
|
|
17
|
+
onChange: s,
|
|
18
|
+
label: l,
|
|
19
|
+
subLabel: u,
|
|
20
|
+
maxCharacters: a = 0,
|
|
21
|
+
defaultValue: d = "",
|
|
22
|
+
required: c = !1,
|
|
23
|
+
notValid: o = !1
|
|
24
|
+
}) {
|
|
25
|
+
const t = h(null), [i, x] = w(d.length), p = () => {
|
|
26
|
+
t.current && (t.current.style.height = "auto", t.current.style.height = `${t.current.scrollHeight}px`, x(t.current.value.length), s(t.current.value.trim()));
|
|
17
27
|
};
|
|
18
28
|
return /* @__PURE__ */ r("div", { className: e["text-area__wrapper"], children: [
|
|
19
29
|
(l || a > 0) && /* @__PURE__ */ r("div", { className: e["text-area__header"], children: [
|
|
20
30
|
/* @__PURE__ */ r("span", { className: e["text-area__label-wrapper"], children: [
|
|
21
|
-
l && /* @__PURE__ */ _("span", { className: e["text-area__label"], children: l }),
|
|
22
|
-
|
|
31
|
+
l && /* @__PURE__ */ _("span", { className: n(e["text-area__label"], { [e.required]: c }), children: l }),
|
|
32
|
+
u && /* @__PURE__ */ _("span", { className: e["text-area__sub-label"], children: u })
|
|
23
33
|
] }),
|
|
24
34
|
a > 0 && /* @__PURE__ */ r("div", { className: e["text-area__word-count"], children: [
|
|
25
|
-
/* @__PURE__ */ _("span", { className:
|
|
35
|
+
/* @__PURE__ */ _("span", { className: n({ [e["text-area__word-count--alert"]]: i === a }), children: i }),
|
|
26
36
|
" / ",
|
|
27
37
|
a
|
|
28
38
|
] })
|
|
@@ -31,15 +41,15 @@ function j({ onChange: c, label: l, subLabel: n, maxCharacters: a = 0, defaultVa
|
|
|
31
41
|
"textarea",
|
|
32
42
|
{
|
|
33
43
|
ref: t,
|
|
34
|
-
className: e["text-area"],
|
|
44
|
+
className: n(e["text-area"], { [e["not-valid"]]: o }),
|
|
35
45
|
maxLength: a > 0 ? a : void 0,
|
|
36
|
-
onInput:
|
|
37
|
-
defaultValue:
|
|
46
|
+
onInput: p,
|
|
47
|
+
defaultValue: d
|
|
38
48
|
}
|
|
39
49
|
)
|
|
40
50
|
] });
|
|
41
51
|
}
|
|
42
52
|
export {
|
|
43
|
-
|
|
53
|
+
N as TextArea
|
|
44
54
|
};
|
|
45
55
|
//# sourceMappingURL=TextArea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport styles from './TextArea.module.css';\n\nexport interface TextAreaProps {\n /** Returns entered values as trimmed string */\n onChange: (value: string) => void;\n /** The label for the text area */\n label?: string;\n /** Optional sub label for the text area */\n subLabel?: string;\n /** The max amount of allowed charecters in the text area */\n maxCharacters?: number;\n /** The default value for the text area */\n defaultValue?: string;\n}\n\nexport function TextArea({
|
|
1
|
+
{"version":3,"file":"TextArea.js","sources":["../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport styles from './TextArea.module.css';\n\nexport interface TextAreaProps {\n /** Returns entered values as trimmed string */\n onChange: (value: string) => void;\n /** The label for the text area */\n label?: string;\n /** Optional sub label for the text area */\n subLabel?: string;\n /** The max amount of allowed charecters in the text area */\n maxCharacters?: number;\n /** The default value for the text area */\n defaultValue?: string;\n /** `true` to show an asterisk to indicate an item is required; otherwise, `false`. */\n required?: boolean;\n /** `true` to color border red to show not valid; otherwise, `false`. */\n notValid?: boolean;\n}\n\nexport function TextArea({\n onChange,\n label,\n subLabel,\n maxCharacters = 0,\n defaultValue = '',\n required = false,\n notValid = false,\n}: TextAreaProps) {\n const textAreaRef = useRef<HTMLTextAreaElement>(null);\n const [characterCount, setCharacterCount] = useState(defaultValue.length);\n\n const handleInput = () => {\n if (textAreaRef.current) {\n textAreaRef.current.style.height = 'auto';\n textAreaRef.current.style.height = `${textAreaRef.current.scrollHeight}px`;\n\n setCharacterCount(textAreaRef.current.value.length);\n onChange(textAreaRef.current.value.trim());\n }\n };\n\n return (\n <div className={styles['text-area__wrapper']}>\n {(label || maxCharacters > 0) && (\n <div className={styles['text-area__header']}>\n <span className={styles['text-area__label-wrapper']}>\n {label && (\n <span className={clsx(styles['text-area__label'], { [styles['required']]: required })}>{label}</span>\n )}\n {subLabel && <span className={styles['text-area__sub-label']}>{subLabel}</span>}\n </span>\n {maxCharacters > 0 && (\n <div className={styles['text-area__word-count']}>\n <span className={clsx({ [styles['text-area__word-count--alert']]: characterCount === maxCharacters })}>\n {characterCount}\n </span>\n / {maxCharacters}\n </div>\n )}\n </div>\n )}\n\n <textarea\n ref={textAreaRef}\n className={clsx(styles['text-area'], { [styles['not-valid']]: notValid })}\n maxLength={maxCharacters > 0 ? maxCharacters : undefined}\n onInput={handleInput}\n defaultValue={defaultValue}\n />\n </div>\n );\n}\n"],"names":["TextArea","onChange","label","subLabel","maxCharacters","defaultValue","required","notValid","textAreaRef","useRef","characterCount","setCharacterCount","useState","handleInput","jsxs","styles","clsx","jsx"],"mappings":";;;;;;;;;;;;;;;AAsBO,SAASA,EAAS;AAAA,EACvB,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,cAAAC,IAAe;AAAA,EACf,UAAAC,IAAW;AAAA,EACX,UAAAC,IAAW;AACb,GAAkB;AAChB,QAAMC,IAAcC,EAA4B,IAAI,GAC9C,CAACC,GAAgBC,CAAiB,IAAIC,EAASP,EAAa,MAAM,GAElEQ,IAAc,MAAM;AACxB,IAAIL,EAAY,YACdA,EAAY,QAAQ,MAAM,SAAS,QACnCA,EAAY,QAAQ,MAAM,SAAS,GAAGA,EAAY,QAAQ,YAAY,MAEtEG,EAAkBH,EAAY,QAAQ,MAAM,MAAM,GAClDP,EAASO,EAAY,QAAQ,MAAM,KAAA,CAAM;AAAA,EAE7C;AAEA,SACE,gBAAAM,EAAC,OAAA,EAAI,WAAWC,EAAO,oBAAoB,GACvC,UAAA;AAAA,KAAAb,KAASE,IAAgB,MACzB,gBAAAU,EAAC,SAAI,WAAWC,EAAO,mBAAmB,GACxC,UAAA;AAAA,MAAA,gBAAAD,EAAC,QAAA,EAAK,WAAWC,EAAO,0BAA0B,GAC/C,UAAA;AAAA,QAAAb,uBACE,QAAA,EAAK,WAAWc,EAAKD,EAAO,kBAAkB,GAAG,EAAE,CAACA,EAAO,QAAW,GAAGT,EAAA,CAAU,GAAI,UAAAJ,GAAM;AAAA,QAE/FC,KAAY,gBAAAc,EAAC,QAAA,EAAK,WAAWF,EAAO,sBAAsB,GAAI,UAAAZ,EAAA,CAAS;AAAA,MAAA,GAC1E;AAAA,MACCC,IAAgB,KACf,gBAAAU,EAAC,SAAI,WAAWC,EAAO,uBAAuB,GAC5C,UAAA;AAAA,QAAA,gBAAAE,EAAC,QAAA,EAAK,WAAWD,EAAK,EAAE,CAACD,EAAO,8BAA8B,CAAC,GAAGL,MAAmBN,EAAA,CAAe,GACjG,UAAAM,EAAA,CACH;AAAA,QAAO;AAAA,QACON;AAAA,MAAA,EAAA,CAChB;AAAA,IAAA,GAEJ;AAAA,IAGF,gBAAAa;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAKT;AAAA,QACL,WAAWQ,EAAKD,EAAO,WAAW,GAAG,EAAE,CAACA,EAAO,WAAW,CAAC,GAAGR,GAAU;AAAA,QACxE,WAAWH,IAAgB,IAAIA,IAAgB;AAAA,QAC/C,SAASS;AAAA,QACT,cAAAR;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { l as a } from "../../index-
|
|
2
|
+
import { l as a } from "../../index-BJRrLdmi.js";
|
|
3
3
|
import { TextArea as e } from "./TextArea.js";
|
|
4
4
|
const o = `
|
|
5
5
|
<TextArea label={label} maxCharacters={maxCharacters} defaultValue={string}/> `, x = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import "../../index-DYPpFe2R.js";
|
|
3
3
|
import { r as o, s as t, f as r } from "../../react.esm-DdELhthz.js";
|
|
4
|
-
import { J as c } from "../../index-
|
|
4
|
+
import { J as c } from "../../index-BJRrLdmi.js";
|
|
5
5
|
import { TextArea as n } from "./TextArea.js";
|
|
6
6
|
describe("TextArea", () => {
|
|
7
7
|
it("should render correctly with label", () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { l } from "../../index-
|
|
2
|
+
import { l } from "../../index-BJRrLdmi.js";
|
|
3
3
|
import { ToggleSwitch as e } from "./ToggleSwitch.js";
|
|
4
4
|
const a = `
|
|
5
5
|
// Has all InputHTMLAttributes props available except "className" and "style"
|