@uva-glass/component-library 1.61.3 → 1.62.0
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/FormInput.css +1 -0
- 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/CheckboxButton/CheckboxButton.stories.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +1 -1
- package/dist/components/Drawer/Drawer.stories.js +1 -1
- package/dist/components/FormInput/FormInput.d.ts +17 -0
- package/dist/components/FormInput/FormInput.js +68 -0
- package/dist/components/FormInput/FormInput.js.map +1 -0
- package/dist/components/FormInput/FormInput.stories.d.ts +5 -0
- package/dist/components/FormInput/FormInput.stories.js +28 -0
- package/dist/components/FormInput/FormInput.stories.js.map +1 -0
- package/dist/components/FormInput/index.d.ts +1 -0
- package/dist/components/FormInput/index.js +5 -0
- package/dist/components/FormInput/index.js.map +1 -0
- package/dist/components/Icon/icons/index.d.ts +237 -0
- 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/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RteEditor/translations.js +1 -1
- package/dist/components/RteEditor/translations.js.map +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/Sortable/Sortable.stories.js +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +70 -68
- package/dist/components/index.js.map +1 -1
- package/dist/index-C9QoqAAt.js +21915 -0
- package/dist/index-C9QoqAAt.js.map +1 -0
- package/dist/index.js +70 -68
- package/dist/index.js.map +1 -1
- package/dist/storybook__react.d.js +1299 -1458
- package/dist/storybook__react.d.js.map +1 -1
- package/package.json +14 -14
- package/dist/index-MQ0yPLdl.js +0 -23560
- package/dist/index-MQ0yPLdl.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._form-field__container_13mc2_1{display:flex;flex-wrap:wrap;align-items:center}._form-field__container--label-left_13mc2_13{flex-direction:row;gap:1rem;line-height:2.5rem;align-items:flex-start}._form-field__container--label-left_13mc2_13>label:after{line-height:3.6}._form-field__container--label-top_13mc2_35{align-items:flex-start;flex-direction:column;gap:.5rem;line-height:normal}._form-field__input-container_13mc2_49{display:flex;flex-direction:column;flex:1;position:relative;width:100%}._form-field__input_13mc2_49{-webkit-appearance:none;appearance:none;background-color:transparent;border:1px solid;border-radius:.5rem;color:var(--color-black);flex:1;font-family:inherit;font-size:inherit;height:2.75rem;margin:0;padding:0 1rem;text-align:inherit;min-height:2.5rem;-moz-appearance:textfield}._form-field__input_13mc2_49::-webkit-outer-spin-button,._form-field__input_13mc2_49::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}._form-field__input--error_13mc2_111{border-color:var(--color-red-500)}._form-field__error_13mc2_119{align-items:center;color:var(--color-red-500);display:flex;font-size:var(--font-size-small);gap:.5rem;line-height:normal;margin-top:.5rem;background-color:var(--color-red-50);width:100%;padding:.5rem}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as a, Fragment as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { fn as l } from "../../index-
|
|
2
|
+
import { fn as l } from "../../index-C9QoqAAt.js";
|
|
3
3
|
import { Button as n } from "./Button.js";
|
|
4
4
|
const c = "<Button variant={variant} onClick={onClictFunction}>{children}</Button>", h = {
|
|
5
5
|
title: "Atoms/Buttons/Button",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as a, Fragment as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { fn as s } from "../../index-
|
|
2
|
+
import { fn as s } from "../../index-C9QoqAAt.js";
|
|
3
3
|
import { BrowserRouter as c } from "react-router-dom";
|
|
4
4
|
import { LinkButton as n } from "./LinkButton.js";
|
|
5
5
|
const d = `
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as s, Fragment as l, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { fn as c } from "../../index-
|
|
2
|
+
import { fn as c } from "../../index-C9QoqAAt.js";
|
|
3
3
|
import { MenuButton as t } from "./MenuButton.js";
|
|
4
4
|
const d = `
|
|
5
5
|
// Has all LabelHTMLAttributes props available except "className" and "style"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as g, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { fn as e } from "../../index-
|
|
2
|
+
import { fn as e } from "../../index-C9QoqAAt.js";
|
|
3
3
|
import { Checkbox as n } from "./Checkbox.js";
|
|
4
4
|
import { FormField as t } from "../FormField/FormField.js";
|
|
5
5
|
import { Label as i } from "../Label/Label.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { fn as n } from "../../index-
|
|
2
|
+
import { fn as n } from "../../index-C9QoqAAt.js";
|
|
3
3
|
import { CheckboxButton as o } from "./CheckboxButton.js";
|
|
4
4
|
const a = "<CheckboxButton label={} value={} isChecked={} variant={} disabled={} notValid={} onSetValue={} key={} />", b = {
|
|
5
5
|
title: "Atoms/CheckboxButton",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { fn as l } from "../../index-
|
|
2
|
+
import { fn as l } from "../../index-C9QoqAAt.js";
|
|
3
3
|
import { CheckboxButtonBar as e } from "./CheckboxButtonBar.js";
|
|
4
4
|
const a = "<CheckboxButtonBar checkboxes={} defaultValues={} label={} labelPosition={} required={} notValidatedText={} disableGroup={} onSetValues={} />", i = {
|
|
5
5
|
title: "Molecules/CheckboxButtonBar",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { OverlayProvider as p } from "@react-aria/overlays";
|
|
3
|
-
import { fn as m } from "../../index-
|
|
3
|
+
import { fn as m } from "../../index-C9QoqAAt.js";
|
|
4
4
|
import { useState as c } from "react";
|
|
5
5
|
import { Drawer as r } from "./Drawer.js";
|
|
6
6
|
import { Button as o } from "../Buttons/Button.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface FormInputProps {
|
|
2
|
+
/** The id of the input element. */
|
|
3
|
+
id: string;
|
|
4
|
+
/** label text if empthy the label is not renderd */
|
|
5
|
+
label: string;
|
|
6
|
+
/** label position `top` or `left`. The default is `top`. */
|
|
7
|
+
labelPosition?: 'top' | 'left';
|
|
8
|
+
/** The type of the input element. */
|
|
9
|
+
type?: 'text' | 'password' | 'email' | 'number';
|
|
10
|
+
/** Shows red * */
|
|
11
|
+
required?: boolean;
|
|
12
|
+
/** error text to display if set */
|
|
13
|
+
notValidatedText?: string;
|
|
14
|
+
/** Returns array of selected values as number */
|
|
15
|
+
onChange: (value: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const FormInput: ({ id, label, labelPosition, type, required, notValidatedText, onChange, }: FormInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsxs as e, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Icon as s } from "../Icon/Icon.js";
|
|
5
|
+
import "../Buttons/Button.js";
|
|
6
|
+
import "../Buttons/LinkButton.js";
|
|
7
|
+
import "@react-aria/button";
|
|
8
|
+
import { Label as u } from "../Label/Label.js";
|
|
9
|
+
import "@react-aria/dialog";
|
|
10
|
+
import "@react-aria/focus";
|
|
11
|
+
import "@react-aria/overlays";
|
|
12
|
+
import "../OverlayCloseButton/OverlayCloseButton.js";
|
|
13
|
+
import "../GridRow/GridRow.js";
|
|
14
|
+
import "../IconButton/IconButton.js";
|
|
15
|
+
import "../Input/Input.js";
|
|
16
|
+
import "../InputField/InputField.js";
|
|
17
|
+
import "react-router-dom";
|
|
18
|
+
import "../../TablePlugin-BvwAKpcu.js";
|
|
19
|
+
import "../RteEditor/Providers/LanguageProvider.js";
|
|
20
|
+
import "../RteEditor/hooks/components/Flyout.js";
|
|
21
|
+
import "../SelectListbox/SelectListbox.js";
|
|
22
|
+
import "../SelectListbox/SelectProvider.js";
|
|
23
|
+
import "../Sortable/components/SortableItem.js";
|
|
24
|
+
import "../../SortableProvider-BUsvniX7.js";
|
|
25
|
+
import '../../assets/FormInput.css';const r = {
|
|
26
|
+
"form-field__container": "_form-field__container_13mc2_1",
|
|
27
|
+
"form-field__container--label-left": "_form-field__container--label-left_13mc2_13",
|
|
28
|
+
"form-field__container--label-top": "_form-field__container--label-top_13mc2_35",
|
|
29
|
+
"form-field__input-container": "_form-field__input-container_13mc2_49",
|
|
30
|
+
"form-field__input": "_form-field__input_13mc2_49",
|
|
31
|
+
"form-field__input--error": "_form-field__input--error_13mc2_111",
|
|
32
|
+
"form-field__error": "_form-field__error_13mc2_119"
|
|
33
|
+
}, J = ({
|
|
34
|
+
id: _,
|
|
35
|
+
label: t,
|
|
36
|
+
labelPosition: p = "top",
|
|
37
|
+
type: n = "text",
|
|
38
|
+
required: c = !1,
|
|
39
|
+
notValidatedText: i = "",
|
|
40
|
+
onChange: f
|
|
41
|
+
}) => {
|
|
42
|
+
const a = (o) => ["e", "E", "+", "-"].includes(o.key) && o.preventDefault(), d = (o) => {
|
|
43
|
+
typeof f == "function" && f(o.target.value);
|
|
44
|
+
};
|
|
45
|
+
return /* @__PURE__ */ e("div", { className: l(r["form-field__container"], r[`form-field__container--label-${p}`]), children: [
|
|
46
|
+
t && /* @__PURE__ */ m(u, { htmlFor: _, required: c, children: t }),
|
|
47
|
+
/* @__PURE__ */ e("div", { className: r["form-field__input-container"], children: [
|
|
48
|
+
/* @__PURE__ */ m(
|
|
49
|
+
"input",
|
|
50
|
+
{
|
|
51
|
+
id: _,
|
|
52
|
+
type: n,
|
|
53
|
+
...n === "number" && { onKeyDown: a },
|
|
54
|
+
onChange: d,
|
|
55
|
+
className: l(r["form-field__input"], [i !== "" && r["form-field__input--error"]])
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
i !== "" && /* @__PURE__ */ e("div", { className: r["form-field__error"], children: [
|
|
59
|
+
/* @__PURE__ */ m(s, { name: "ExclamationTriangleFill", size: 24 }),
|
|
60
|
+
i
|
|
61
|
+
] })
|
|
62
|
+
] })
|
|
63
|
+
] });
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
J as FormInput
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=FormInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormInput.js","sources":["../../../src/components/FormInput/FormInput.tsx"],"sourcesContent":["import clsx from 'clsx';\r\n\r\nimport styles from './FormInput.module.css';\r\n\r\nimport { Icon, Label } from 'components';\r\n\r\nexport interface FormInputProps {\r\n /** The id of the input element. */\r\n id: string;\r\n /** label text if empthy the label is not renderd */\r\n label: string;\r\n /** label position `top` or `left`. The default is `top`. */\r\n labelPosition?: 'top' | 'left';\r\n /** The type of the input element. */\r\n type?: 'text' | 'password' | 'email' | 'number';\r\n /** Shows red * */\r\n required?: boolean;\r\n /** error text to display if set */\r\n notValidatedText?: string;\r\n /** Returns array of selected values as number */\r\n onChange: (value: string) => void;\r\n}\r\n\r\nexport const FormInput = ({\r\n id,\r\n label,\r\n labelPosition = 'top',\r\n type = 'text',\r\n required = false,\r\n notValidatedText = '',\r\n onChange,\r\n}: FormInputProps) => {\r\n const blockInvalidChar = (event: React.KeyboardEvent<HTMLInputElement>) =>\r\n ['e', 'E', '+', '-'].includes(event.key) && event.preventDefault();\r\n\r\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n if (typeof onChange === 'function') {\r\n onChange(event.target.value);\r\n }\r\n };\r\n\r\n return (\r\n <div className={clsx(styles['form-field__container'], styles[`form-field__container--label-${labelPosition}`])}>\r\n {label && (\r\n <Label htmlFor={id} required={required}>\r\n {label}\r\n </Label>\r\n )}\r\n\r\n <div className={styles['form-field__input-container']}>\r\n <input\r\n id={id}\r\n type={type}\r\n {...(type === 'number' && { onKeyDown: blockInvalidChar })}\r\n onChange={handleChange}\r\n className={clsx(styles['form-field__input'], [notValidatedText !== '' && styles['form-field__input--error']])}\r\n />\r\n {notValidatedText !== '' && (\r\n <div className={styles['form-field__error']}>\r\n <Icon name=\"ExclamationTriangleFill\" size={24} />\r\n {notValidatedText}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n );\r\n};\r\n"],"names":["FormInput","id","label","labelPosition","type","required","notValidatedText","onChange","blockInvalidChar","event","handleChange","jsxs","clsx","styles","jsx","Label","Icon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuBaA,IAAY,CAAC;AAAA,EACxB,IAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,kBAAAC,IAAmB;AAAA,EACnB,UAAAC;AACF,MAAsB;AACpB,QAAMC,IAAmB,CAACC,MACxB,CAAC,KAAK,KAAK,KAAK,GAAG,EAAE,SAASA,EAAM,GAAG,KAAKA,EAAM,eAAe,GAE7DC,IAAe,CAACD,MAA+C;AAC/D,IAAA,OAAOF,KAAa,cACbA,EAAAE,EAAM,OAAO,KAAK;AAAA,EAC7B;AAGF,SACG,gBAAAE,EAAA,OAAA,EAAI,WAAWC,EAAKC,EAAO,uBAAuB,GAAGA,EAAO,gCAAgCV,CAAa,EAAE,CAAC,GAC1G,UAAA;AAAA,IAAAD,KACE,gBAAAY,EAAAC,GAAA,EAAM,SAASd,GAAI,UAAAI,GACjB,UACHH,GAAA;AAAA,IAGD,gBAAAS,EAAA,OAAA,EAAI,WAAWE,EAAO,6BAA6B,GAClD,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,IAAAb;AAAA,UACA,MAAAG;AAAA,UACC,GAAIA,MAAS,YAAY,EAAE,WAAWI,EAAiB;AAAA,UACxD,UAAUE;AAAA,UACV,WAAWE,EAAKC,EAAO,mBAAmB,GAAG,CAACP,MAAqB,MAAMO,EAAO,0BAA0B,CAAC,CAAC;AAAA,QAAA;AAAA,MAC9G;AAAA,MACCP,MAAqB,MACpB,gBAAAK,EAAC,SAAI,WAAWE,EAAO,mBAAmB,GACxC,UAAA;AAAA,QAAA,gBAAAC,EAACE,GAAK,EAAA,MAAK,2BAA0B,MAAM,IAAI;AAAA,QAC9CV;AAAA,MAAA,GACH;AAAA,IAAA,GAEJ;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { FormInputProps } from './FormInput';
|
|
3
|
+
declare const _default: Meta<FormInputProps>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const FromInputExample: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FormInputProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { fn as a } from "../../index-C9QoqAAt.js";
|
|
3
|
+
import { FormInput as t } from "./FormInput.js";
|
|
4
|
+
const o = `
|
|
5
|
+
// Has all HTMLInputElement props available except "className" and "style"
|
|
6
|
+
<FormInput />
|
|
7
|
+
`, i = {
|
|
8
|
+
title: "Organisms/FormInput",
|
|
9
|
+
component: t,
|
|
10
|
+
argTypes: {},
|
|
11
|
+
args: {},
|
|
12
|
+
parameters: {
|
|
13
|
+
inspectComponent: t,
|
|
14
|
+
codeString: o
|
|
15
|
+
}
|
|
16
|
+
}, r = (e) => /* @__PURE__ */ n(t, { ...e }), s = r.bind({});
|
|
17
|
+
s.args = {
|
|
18
|
+
id: "vak",
|
|
19
|
+
label: "Vaknaam (NL)",
|
|
20
|
+
labelPosition: "left",
|
|
21
|
+
required: !0,
|
|
22
|
+
onChange: a()
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
s as FromInputExample,
|
|
26
|
+
i as default
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=FormInput.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormInput.stories.js","sources":["../../../src/components/FormInput/FormInput.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\r\n\r\nimport type { Meta, StoryFn } from '@storybook/react';\r\nimport type { FormInputProps } from './FormInput';\r\n\r\nimport { FormInput } from './FormInput';\r\n\r\nconst codeString = `\r\n// Has all HTMLInputElement props available except \"className\" and \"style\" \r\n<FormInput />\r\n`;\r\n\r\n// eslint-disable-next-line import/no-default-export\r\nexport default {\r\n title: 'Organisms/FormInput',\r\n component: FormInput,\r\n argTypes: {},\r\n args: {},\r\n parameters: {\r\n inspectComponent: FormInput,\r\n codeString: codeString,\r\n },\r\n} as Meta<FormInputProps>;\r\n\r\nconst Template: StoryFn<FormInputProps> = (args) => {\r\n return <FormInput {...args} />;\r\n};\r\n\r\nexport const FromInputExample = Template.bind({});\r\n\r\nFromInputExample.args = {\r\n id: 'vak',\r\n label: 'Vaknaam (NL)',\r\n labelPosition: 'left',\r\n required: true,\r\n onChange: fn(),\r\n};\r\n"],"names":["codeString","FormInput_stories","FormInput","Template","args","jsx","FromInputExample","fn"],"mappings":";;;AAOA,MAAMA,IAAa;AAAA;AAAA;AAAA,GAMJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU,CAAC;AAAA,EACX,MAAM,CAAC;AAAA,EACP,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EACF;AACF,GAEMG,IAAoC,CAACC,MAClC,gBAAAC,EAACH,GAAW,EAAA,GAAGE,EAAM,CAAA,GAGjBE,IAAmBH,EAAS,KAAK,EAAE;AAEhDG,EAAiB,OAAO;AAAA,EACtB,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,eAAe;AAAA,EACf,UAAU;AAAA,EACV,UAAUC,EAAG;AACf;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './FormInput';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|