@uva-glass/component-library 1.6.0 → 1.7.1

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.
Files changed (33) hide show
  1. package/dist/assets/FieldHint.css +1 -0
  2. package/dist/assets/Input.css +1 -0
  3. package/dist/assets/InputField.css +1 -0
  4. package/dist/assets/InputField2.css +1 -0
  5. package/dist/components/IconButton/IconButton.stories.js +13 -10
  6. package/dist/components/IconButton/IconButton.stories.js.map +1 -1
  7. package/dist/components/Input/Input.d.ts +10 -0
  8. package/dist/components/Input/Input.js +28 -0
  9. package/dist/components/Input/Input.js.map +1 -0
  10. package/dist/components/Input/Input.stories.d.ts +8 -0
  11. package/dist/components/Input/Input.stories.js +41 -0
  12. package/dist/components/Input/Input.stories.js.map +1 -0
  13. package/dist/components/Input/index.d.ts +1 -0
  14. package/dist/components/Input/index.js +5 -0
  15. package/dist/components/Input/index.js.map +1 -0
  16. package/dist/components/InputField/InputField.d.ts +12 -0
  17. package/dist/components/InputField/InputField.js +29 -0
  18. package/dist/components/InputField/InputField.js.map +1 -0
  19. package/dist/components/InputField/InputField.stories.d.ts +7 -0
  20. package/dist/components/InputField/InputField.stories.js +65 -0
  21. package/dist/components/InputField/InputField.stories.js.map +1 -0
  22. package/dist/components/InputField/components/FieldHint.d.ts +7 -0
  23. package/dist/components/InputField/components/FieldHint.js +15 -0
  24. package/dist/components/InputField/components/FieldHint.js.map +1 -0
  25. package/dist/components/InputField/index.d.ts +1 -0
  26. package/dist/components/InputField/index.js +5 -0
  27. package/dist/components/InputField/index.js.map +1 -0
  28. package/dist/components/index.d.ts +2 -0
  29. package/dist/components/index.js +17 -13
  30. package/dist/components/index.js.map +1 -1
  31. package/dist/index.js +17 -13
  32. package/dist/index.js.map +1 -1
  33. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ ._field-hint_f5ej1_1{font-size:.875rem}
@@ -0,0 +1 @@
1
+ ._input_96vyw_1{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:1px solid var(--color-black);color:var(--color-black);font-family:inherit;font-size:inherit;height:2rem;margin:0;padding:0 .5rem}._input--numeric_96vyw_13{text-align:right;width:8rem}._input--error_96vyw_18,._input_96vyw_1:invalid{border-color:var(--color-chilean-fire)}._input--full-with_96vyw_23{min-width:100%;width:0}._input_96vyw_1::placeholder{color:var(--color-black-transparent);font-size:inherit;opacity:1}._input_96vyw_1[type=file]{border:none}._input_96vyw_1:disabled{color:var(--color-black-transparent)}
@@ -0,0 +1 @@
1
+ .form{width:20%}.form-field{display:flex;flex-direction:column;gap:.5rem 1rem}
@@ -0,0 +1 @@
1
+ ._input-field_16tae_1{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:1px solid;border-radius:.5rem;color:var(--color-black);font-family:inherit;font-size:inherit;height:2.75rem;margin:0;padding:0 .5rem;text-align:inherit}._input-field--large_16tae_15{height:3rem}._input-field_16tae_1:disabled{color:var(--color-scarpa-flow)}
@@ -1,10 +1,10 @@
1
- import { jsx as t } from "react/jsx-runtime";
1
+ import { jsx as o } from "react/jsx-runtime";
2
2
  import { f as a } from "../../index-Ca2Q7D5u.js";
3
- import { IconButton as o } from "./IconButton.js";
4
- import { Icon as n } from "../Icon/Icon.js";
5
- const f = {
3
+ import { IconButton as e } from "./IconButton.js";
4
+ import { Icon as l } from "../Icon/Icon.js";
5
+ const m = {
6
6
  title: "Atoms/IconButton",
7
- component: o,
7
+ component: e,
8
8
  argTypes: {
9
9
  variant: {
10
10
  options: ["destructive"],
@@ -33,18 +33,21 @@ const f = {
33
33
  }
34
34
  }
35
35
  }
36
- }, r = (e) => /* @__PURE__ */ t(o, { ...e }), l = r.bind({});
37
- l.args = {
36
+ }, s = (t) => {
37
+ const n = t.variant ?? [], r = { ...t, variant: n.toString() };
38
+ return /* @__PURE__ */ o(e, { ...r });
39
+ }, i = s.bind({});
40
+ i.args = {
38
41
  "aria-label": "Trash",
39
42
  variant: "destructive",
40
43
  noBorder: !1,
41
44
  wide: !1,
42
45
  disabled: !1,
43
- children: /* @__PURE__ */ t(n, { name: "Trash" }),
46
+ children: /* @__PURE__ */ o(l, { name: "Trash" }),
44
47
  onClick: a()
45
48
  };
46
49
  export {
47
- l as IconButtonExample,
48
- f as default
50
+ i as IconButtonExample,
51
+ m as default
49
52
  };
50
53
  //# sourceMappingURL=IconButton.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.stories.js","sources":["../../../src/components/IconButton/IconButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { IconButtonProps } from 'components/IconButton';\n\nimport { IconButton } from 'components/IconButton';\nimport { Icon } from 'components/Icon';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/IconButton',\n component: IconButton,\n argTypes: {\n variant: {\n options: ['destructive'],\n control: { type: 'check' },\n },\n noBorder: {\n control: 'boolean',\n default: false,\n },\n wide: {\n control: 'boolean',\n default: false,\n },\n 'aria-label': {\n table: {\n disable: true,\n },\n },\n type: {\n options: ['button', 'submit', 'reset'],\n control: { type: 'select' },\n },\n children: {\n table: {\n disable: true,\n },\n },\n },\n} as Meta<IconButtonProps>;\n\nconst Template: StoryFn<IconButtonProps> = (args) => <IconButton {...args} />;\n\nexport const IconButtonExample = Template.bind({});\nIconButtonExample.args = {\n 'aria-label': 'Trash',\n variant: 'destructive',\n noBorder: false,\n wide: false,\n disabled: false,\n children: <Icon name=\"Trash\" />,\n onClick: fn(),\n};\n"],"names":["IconButton_stories","IconButton","Template","args","jsx","IconButtonExample","Icon","fn"],"mappings":";;;;AASA,MAAeA,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,aAAa;AAAA,MACvB,SAAS,EAAE,MAAM,QAAQ;AAAA,IAC3B;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,SAAS,CAAC,UAAU,UAAU,OAAO;AAAA,MACrC,SAAS,EAAE,MAAM,SAAS;AAAA,IAC5B;AAAA,IACA,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF,GAEMC,IAAqC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAY,GAAGE,EAAM,CAAA,GAE9DE,IAAoBH,EAAS,KAAK,EAAE;AACjDG,EAAkB,OAAO;AAAA,EACvB,cAAc;AAAA,EACd,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU,gBAAAD,EAACE,GAAK,EAAA,MAAK,QAAQ,CAAA;AAAA,EAC7B,SAASC,EAAG;AACd;"}
1
+ {"version":3,"file":"IconButton.stories.js","sources":["../../../src/components/IconButton/IconButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { IconButtonProps } from 'components/IconButton';\n\nimport { IconButton } from 'components/IconButton';\nimport { Icon } from 'components/Icon';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/IconButton',\n component: IconButton,\n argTypes: {\n variant: {\n options: ['destructive'],\n control: { type: 'check' },\n },\n noBorder: {\n control: 'boolean',\n default: false,\n },\n wide: {\n control: 'boolean',\n default: false,\n },\n 'aria-label': {\n table: {\n disable: true,\n },\n },\n type: {\n options: ['button', 'submit', 'reset'],\n control: { type: 'select' },\n },\n children: {\n table: {\n disable: true,\n },\n },\n },\n} as Meta<IconButtonProps>;\n\nconst Template: StoryFn<IconButtonProps> = (args) => {\n // args.variant is provided as an array because the control type is set to a checkbox. So this transforms the selected value into its proper value: a string\n const variantArray = (args.variant as unknown as string[]) ?? [];\n const iconButtonArgs = { ...args, ...{ variant: variantArray.toString() } } as IconButtonProps;\n\n return <IconButton {...iconButtonArgs} />;\n};\n\nexport const IconButtonExample = Template.bind({});\nIconButtonExample.args = {\n 'aria-label': 'Trash',\n variant: 'destructive',\n noBorder: false,\n wide: false,\n disabled: false,\n children: <Icon name=\"Trash\" />,\n onClick: fn(),\n};\n"],"names":["IconButton_stories","IconButton","Template","args","variantArray","iconButtonArgs","jsx","IconButtonExample","Icon","fn"],"mappings":";;;;AASA,MAAeA,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,aAAa;AAAA,MACvB,SAAS,EAAE,MAAM,QAAQ;AAAA,IAC3B;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,SAAS,CAAC,UAAU,UAAU,OAAO;AAAA,MACrC,SAAS,EAAE,MAAM,SAAS;AAAA,IAC5B;AAAA,IACA,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF,GAEMC,IAAqC,CAACC,MAAS;AAE7C,QAAAC,IAAgBD,EAAK,WAAmC,IACxDE,IAAiB,EAAE,GAAGF,GAAW,SAASC,EAAa,SAAS;AAE/D,SAAA,gBAAAE,EAACL,GAAY,EAAA,GAAGI,EAAgB,CAAA;AACzC,GAEaE,IAAoBL,EAAS,KAAK,EAAE;AACjDK,EAAkB,OAAO;AAAA,EACvB,cAAc;AAAA,EACd,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU,gBAAAD,EAACE,GAAK,EAAA,MAAK,QAAQ,CAAA;AAAA,EAC7B,SAASC,EAAG;AACd;"}
@@ -0,0 +1,10 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+
3
+ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'> {
4
+ appearance?: 'error';
5
+ type?: 'text' | 'search' | 'password' | 'email' | 'file';
6
+ fullWidth?: boolean;
7
+ id: string;
8
+ isNumeric?: boolean;
9
+ }
10
+ export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,28 @@
1
+ import { jsx as _ } from "react/jsx-runtime";
2
+ import { forwardRef as c } from "react";
3
+ import { c as f } from "../../clsx-DB4S2d7J.js";
4
+ import '../../assets/Input.css';const m = "_input_96vyw_1", t = {
5
+ input: m,
6
+ "input--numeric": "_input--numeric_96vyw_13",
7
+ "input--error": "_input--error_96vyw_18",
8
+ "input--full-with": "_input--full-with_96vyw_23"
9
+ }, a = c(function({ id: r, appearance: n, type: i = "text", isNumeric: u, fullWidth: p, ...o }, e) {
10
+ return /* @__PURE__ */ _(
11
+ "input",
12
+ {
13
+ ...o,
14
+ ref: e,
15
+ id: r,
16
+ className: f(t.input, {
17
+ [t["input--error"]]: n === "error",
18
+ [t["input--full-with"]]: p,
19
+ [t["input--numeric"]]: u
20
+ }),
21
+ type: i
22
+ }
23
+ );
24
+ });
25
+ export {
26
+ a as Input
27
+ };
28
+ //# sourceMappingURL=Input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.js","sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { InputHTMLAttributes } from 'react';\n\nimport styles from './Input.module.css';\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'> {\n appearance?: 'error';\n type?: 'text' | 'search' | 'password' | 'email' | 'file';\n fullWidth?: boolean;\n id: string;\n isNumeric?: boolean;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { id, appearance, type = 'text', isNumeric, fullWidth, ...restProps }: InputProps,\n forwardedRef\n) {\n return (\n <input\n {...restProps}\n ref={forwardedRef}\n id={id}\n className={clsx(styles['input'], {\n [styles['input--error']]: appearance === 'error',\n [styles['input--full-with']]: fullWidth,\n [styles['input--numeric']]: isNumeric,\n })}\n type={type}\n />\n );\n});\n"],"names":["Input","forwardRef","id","appearance","type","isNumeric","fullWidth","restProps","forwardedRef","jsx","clsx","styles"],"mappings":";;;;;;;;GAeaA,IAAQC,EAAyC,SAC5D,EAAE,IAAAC,GAAI,YAAAC,GAAY,MAAAC,IAAO,QAAQ,WAAAC,GAAW,WAAAC,GAAW,GAAGC,EAAA,GAC1DC,GACA;AAEE,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,KAAKC;AAAA,MACL,IAAAN;AAAA,MACA,WAAWQ,EAAKC,EAAO,OAAU;AAAA,QAC/B,CAACA,EAAO,cAAc,CAAC,GAAGR,MAAe;AAAA,QACzC,CAACQ,EAAO,kBAAkB,CAAC,GAAGL;AAAA,QAC9B,CAACK,EAAO,gBAAgB,CAAC,GAAGN;AAAA,MAAA,CAC7B;AAAA,MACD,MAAAD;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;"}
@@ -0,0 +1,8 @@
1
+ import { InputProps } from './Input';
2
+
3
+ declare const _default: import('@storybook/types').ComponentAnnotations<import('@storybook/react').ReactRenderer, InputProps>;
4
+ export default _default;
5
+ export declare const InputExample: import('@storybook/types').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, InputProps>;
6
+ export declare const FullWidth: import('@storybook/types').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, InputProps>;
7
+ export declare const Numeric: import('@storybook/types').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, InputProps>;
8
+ export declare const WithErrorAppearance: import('@storybook/types').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, InputProps>;
@@ -0,0 +1,41 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { Input as r } from "./Input.js";
3
+ const u = {
4
+ title: "Atoms/Input",
5
+ component: r,
6
+ argTypes: {
7
+ appearance: {
8
+ table: {
9
+ disable: !0
10
+ }
11
+ },
12
+ type: {
13
+ control: "inline-radio"
14
+ }
15
+ },
16
+ args: {
17
+ id: "30daa7c7",
18
+ type: "text"
19
+ }
20
+ }, t = (e) => /* @__PURE__ */ a(r, { ...e }), n = t.bind({});
21
+ n.args = {};
22
+ const o = t.bind({});
23
+ o.args = {
24
+ fullWidth: !0
25
+ };
26
+ const i = t.bind({});
27
+ i.args = {
28
+ isNumeric: !0
29
+ };
30
+ const p = t.bind({});
31
+ p.args = {
32
+ appearance: "error"
33
+ };
34
+ export {
35
+ o as FullWidth,
36
+ n as InputExample,
37
+ i as Numeric,
38
+ p as WithErrorAppearance,
39
+ u as default
40
+ };
41
+ //# sourceMappingURL=Input.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.stories.js","sources":["../../../src/components/Input/Input.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { InputProps } from './Input';\n\nimport { Input } from './Input';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Input',\n component: Input,\n argTypes: {\n appearance: {\n table: {\n disable: true,\n },\n },\n type: {\n control: 'inline-radio',\n },\n },\n args: {\n id: '30daa7c7',\n type: 'text',\n },\n} as Meta<InputProps>;\n\nconst Template: StoryFn<InputProps> = (args) => {\n return <Input {...args} />;\n};\n\nexport const InputExample = Template.bind({});\nInputExample.args = {};\n\nexport const FullWidth = Template.bind({});\nFullWidth.args = {\n fullWidth: true,\n};\n\nexport const Numeric = Template.bind({});\nNumeric.args = {\n isNumeric: true,\n};\n\nexport const WithErrorAppearance = Template.bind({});\nWithErrorAppearance.args = {\n appearance: 'error',\n};\n"],"names":["Input_stories","Input","Template","args","jsx","InputExample","FullWidth","Numeric","WithErrorAppearance"],"mappings":";;AAMA,MAAeA,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,YAAY;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EACR;AACF,GAEMC,IAAgC,CAACC,MAC9B,gBAAAC,EAACH,GAAO,EAAA,GAAGE,EAAM,CAAA,GAGbE,IAAeH,EAAS,KAAK,EAAE;AAC5CG,EAAa,OAAO,CAAA;AAEb,MAAMC,IAAYJ,EAAS,KAAK,EAAE;AACzCI,EAAU,OAAO;AAAA,EACf,WAAW;AACb;AAEO,MAAMC,IAAUL,EAAS,KAAK,EAAE;AACvCK,EAAQ,OAAO;AAAA,EACb,WAAW;AACb;AAEO,MAAMC,IAAsBN,EAAS,KAAK,EAAE;AACnDM,EAAoB,OAAO;AAAA,EACzB,YAAY;AACd;"}
@@ -0,0 +1 @@
1
+ export * from './Input';
@@ -0,0 +1,5 @@
1
+ import { Input as r } from "./Input.js";
2
+ export {
3
+ r as Input
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,12 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+
3
+ export interface InputFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'> {
4
+ variant?: 'large';
5
+ hint?: string;
6
+ spinnerAriaValueText: string;
7
+ isHintLoading?: boolean;
8
+ type?: 'text' | 'search' | 'password' | 'email';
9
+ autoComplete?: 'off';
10
+ id: string;
11
+ }
12
+ export declare const InputField: import('react').ForwardRefExoticComponent<InputFieldProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,29 @@
1
+ import { jsxs as m, Fragment as s, jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as u } from "react";
3
+ import { c } from "../../clsx-DB4S2d7J.js";
4
+ import { FieldHint as _ } from "./components/FieldHint.js";
5
+ import '../../assets/InputField2.css';const i = {
6
+ "input-field": "_input-field_16tae_1",
7
+ "input-field--large": "_input-field--large_16tae_15"
8
+ }, v = u(
9
+ ({ autoComplete: l = "off", id: f, variant: o, hint: e, isHintLoading: t, spinnerAriaValueText: p, type: a = "text", ...n }, d) => /* @__PURE__ */ m(s, { children: [
10
+ /* @__PURE__ */ r(
11
+ "input",
12
+ {
13
+ ...n,
14
+ autoComplete: l,
15
+ ref: d,
16
+ id: f,
17
+ className: c(i["input-field"], {
18
+ [i["input-field--large"]]: o === "large"
19
+ }),
20
+ type: a
21
+ }
22
+ ),
23
+ (e || t) && /* @__PURE__ */ r(_, { loading: t, spinnerAriaValueText: p, value: e })
24
+ ] })
25
+ );
26
+ export {
27
+ v as InputField
28
+ };
29
+ //# sourceMappingURL=InputField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputField.js","sources":["../../../src/components/InputField/InputField.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { clsx } from 'clsx';\n\nimport type { InputHTMLAttributes } from 'react';\n\nimport styles from './InputField.module.css';\nimport { FieldHint } from './components/FieldHint';\n\nexport interface InputFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'style'> {\n variant?: 'large';\n hint?: string;\n spinnerAriaValueText: string;\n isHintLoading?: boolean;\n type?: 'text' | 'search' | 'password' | 'email';\n autoComplete?: 'off'\n id: string;\n}\n\nexport const InputField = forwardRef<HTMLInputElement, InputFieldProps>(\n (\n { autoComplete = 'off', id, variant, hint, isHintLoading, spinnerAriaValueText, type = 'text', ...restProps }: InputFieldProps,\n forwardedRef\n ) => {\n return (\n <>\n <input\n {...restProps}\n autoComplete={autoComplete}\n ref={forwardedRef}\n id={id}\n className={clsx(styles['input-field'], {\n [styles['input-field--large']]: variant === 'large',\n })}\n type={type}\n />\n {(hint || isHintLoading) && <FieldHint loading={isHintLoading} spinnerAriaValueText={spinnerAriaValueText} value={hint} />}\n </>\n );\n }\n);\n"],"names":["InputField","forwardRef","autoComplete","id","variant","hint","isHintLoading","spinnerAriaValueText","type","restProps","forwardedRef","jsxs","Fragment","jsx","clsx","styles","FieldHint"],"mappings":";;;;;;;GAkBaA,IAAaC;AAAA,EACxB,CACE,EAAE,cAAAC,IAAe,OAAO,IAAAC,GAAI,SAAAC,GAAS,MAAAC,GAAM,eAAAC,GAAe,sBAAAC,GAAsB,MAAAC,IAAO,QAAQ,GAAGC,EAAA,GAClGC,MAII,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAGJ;AAAA,QACJ,cAAAP;AAAA,QACA,KAAKQ;AAAA,QACL,IAAAP;AAAA,QACA,WAAWW,EAAKC,EAAO,aAAa,GAAG;AAAA,UACrC,CAACA,EAAO,oBAAoB,CAAC,GAAGX,MAAY;AAAA,QAAA,CAC7C;AAAA,QACD,MAAAI;AAAA,MAAA;AAAA,IACF;AAAA,KACEH,KAAQC,MAAmB,gBAAAO,EAAAG,GAAA,EAAU,SAASV,GAAe,sBAAAC,GAA4C,OAAOF,GAAM;AAAA,EAC1H,EAAA,CAAA;AAGN;"}
@@ -0,0 +1,7 @@
1
+ import { InputFieldProps } from './InputField';
2
+
3
+ declare const _default: import('@storybook/types').ComponentAnnotations<import('@storybook/react').ReactRenderer, InputFieldProps>;
4
+ export default _default;
5
+ export declare const InputFieldExample: import('@storybook/types').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, InputFieldProps>;
6
+ export declare const WithHint: import('@storybook/types').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, InputFieldProps>;
7
+ export declare const WithLoadingHint: import('@storybook/types').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, InputFieldProps>;
@@ -0,0 +1,65 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { InputField as e } from "./InputField.js";
3
+ import '../../assets/InputField.css';const r = (t) => {
4
+ const a = t.variant ?? [];
5
+ return { ...t, variant: a.toString() };
6
+ }, m = {
7
+ title: "Atoms/InputField",
8
+ component: e,
9
+ argTypes: {
10
+ variant: {
11
+ options: ["large"],
12
+ control: "check"
13
+ },
14
+ hint: {
15
+ control: "text"
16
+ },
17
+ spinnerAriaValueText: {
18
+ control: "text"
19
+ },
20
+ isHintLoading: {
21
+ control: Boolean,
22
+ table: {
23
+ disable: !0
24
+ }
25
+ },
26
+ type: {
27
+ control: "radio",
28
+ options: ["text", "search", "password", "email"]
29
+ },
30
+ id: {
31
+ control: "text"
32
+ },
33
+ autoComplete: {
34
+ control: "radio",
35
+ options: ["off"]
36
+ }
37
+ }
38
+ }, n = (t) => /* @__PURE__ */ o("div", { className: "form", children: /* @__PURE__ */ o("div", { className: "form-field", children: /* @__PURE__ */ o(e, { ...r(t) }) }) }), i = {
39
+ type: "text",
40
+ variant: void 0,
41
+ hint: void 0,
42
+ spinnerAriaValueText: "Loading",
43
+ autoComplete: "off",
44
+ id: "4f9ca77d"
45
+ }, s = n.bind({});
46
+ s.args = {
47
+ ...i
48
+ };
49
+ const l = n.bind({});
50
+ l.args = {
51
+ ...i,
52
+ hint: "Example hint"
53
+ };
54
+ const d = n.bind({});
55
+ d.args = {
56
+ ...i,
57
+ isHintLoading: !0
58
+ };
59
+ export {
60
+ s as InputFieldExample,
61
+ l as WithHint,
62
+ d as WithLoadingHint,
63
+ m as default
64
+ };
65
+ //# sourceMappingURL=InputField.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputField.stories.js","sources":["../../../src/components/InputField/InputField.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { InputFieldProps } from './InputField';\n\nimport './InputField.stories.css';\n\nimport { InputField } from './InputField';\n\nconst transformArgs = (args: InputFieldProps) => {\n // args.variant is provided as an array because the control type is set to a checkbox. So this transforms the selected value into its proper value: a string\n const variantArray = (args.variant as unknown as string[]) ?? [];\n return { ...args, ...{ variant: variantArray.toString() } } as InputFieldProps;\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/InputField',\n component: InputField,\n argTypes: {\n variant: {\n options: ['large'],\n control: 'check',\n },\n hint: {\n control: 'text',\n },\n spinnerAriaValueText: {\n control: 'text',\n },\n isHintLoading: {\n control: Boolean,\n table: {\n disable: true,\n },\n },\n type: {\n control: 'radio',\n options: ['text', 'search', 'password', 'email'],\n },\n id: {\n control: 'text',\n },\n autoComplete: {\n control: 'radio',\n options: ['off'],\n },\n },\n} as Meta<InputFieldProps>;\n\nconst Template: StoryFn<InputFieldProps> = (args) => (\n <div className=\"form\">\n <div className=\"form-field\">\n <InputField {...transformArgs(args)} />\n </div>\n </div>\n);\n\nconst defaultArgs: Partial<InputFieldProps> = {\n type: 'text',\n variant: undefined,\n hint: undefined,\n spinnerAriaValueText: 'Loading',\n autoComplete: 'off',\n id: '4f9ca77d',\n};\n\nexport const InputFieldExample = Template.bind({});\nInputFieldExample.args = {\n ...defaultArgs,\n};\n\nexport const WithHint = Template.bind({});\nWithHint.args = {\n ...defaultArgs,\n hint: 'Example hint',\n};\n\nexport const WithLoadingHint = Template.bind({});\nWithLoadingHint.args = {\n ...defaultArgs,\n isHintLoading: true\n};\n"],"names":["transformArgs","args","variantArray","InputField_stories","InputField","Template","jsx","defaultArgs","InputFieldExample","WithHint","WithLoadingHint"],"mappings":";;AAOA,MAAMA,IAAgB,CAACC,MAA0B;AAEzC,QAAAC,IAAgBD,EAAK,WAAmC;AACvD,SAAA,EAAE,GAAGA,GAAW,SAASC,EAAa,SAAS;AACxD,GAGeC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,OAAO;AAAA,MACjB,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,IACX;AAAA,IACA,sBAAsB;AAAA,MACpB,SAAS;AAAA,IACX;AAAA,IACA,eAAe;AAAA,MACb,SAAS;AAAA,MACT,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS,CAAC,QAAQ,UAAU,YAAY,OAAO;AAAA,IACjD;AAAA,IACA,IAAI;AAAA,MACF,SAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,SAAS;AAAA,MACT,SAAS,CAAC,KAAK;AAAA,IACjB;AAAA,EACF;AACF,GAEMC,IAAqC,CAACJ,wBACzC,OAAI,EAAA,WAAU,QACb,UAAC,gBAAAK,EAAA,OAAA,EAAI,WAAU,cACb,4BAACF,GAAY,EAAA,GAAGJ,EAAcC,CAAI,EAAG,CAAA,GACvC,EACF,CAAA,GAGIM,IAAwC;AAAA,EAC5C,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,sBAAsB;AAAA,EACtB,cAAc;AAAA,EACd,IAAI;AACN,GAEaC,IAAoBH,EAAS,KAAK,EAAE;AACjDG,EAAkB,OAAO;AAAA,EACvB,GAAGD;AACL;AAEO,MAAME,IAAWJ,EAAS,KAAK,EAAE;AACxCI,EAAS,OAAO;AAAA,EACd,GAAGF;AAAA,EACH,MAAM;AACR;AAEO,MAAMG,IAAkBL,EAAS,KAAK,EAAE;AAC/CK,EAAgB,OAAO;AAAA,EACrB,GAAGH;AAAA,EACH,eAAe;AACjB;"}
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ value?: string;
3
+ spinnerAriaValueText: string;
4
+ loading?: boolean;
5
+ }
6
+ export declare function FieldHint({ value, spinnerAriaValueText, loading }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,15 @@
1
+ import { jsxs as r, jsx as n, Fragment as s } from "react/jsx-runtime";
2
+ import { Spinner as f } from "../../Spinner/Spinner.js";
3
+ import '../../../assets/FieldHint.css';const l = {
4
+ "field-hint": "_field-hint_f5ej1_1"
5
+ };
6
+ function m({ value: i, spinnerAriaValueText: e, loading: t }) {
7
+ return /* @__PURE__ */ r("span", { className: l["field-hint"], children: [
8
+ i && /* @__PURE__ */ n(s, { children: i }),
9
+ !i && t && /* @__PURE__ */ n(f, { ariaValueText: e })
10
+ ] });
11
+ }
12
+ export {
13
+ m as FieldHint
14
+ };
15
+ //# sourceMappingURL=FieldHint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldHint.js","sources":["../../../../src/components/InputField/components/FieldHint.tsx"],"sourcesContent":["import styles from './FieldHint.module.css';\n\nimport { Spinner } from 'components/Spinner/Spinner';\n\ninterface Props {\n value?: string;\n spinnerAriaValueText: string;\n loading?: boolean;\n}\n\nexport function FieldHint({ value, spinnerAriaValueText, loading }: Props) {\n return (\n <span className={styles['field-hint']}>\n {value && <>{value}</>}\n {!value && loading && <Spinner ariaValueText={spinnerAriaValueText} />}\n </span>\n );\n}\n"],"names":["FieldHint","value","spinnerAriaValueText","loading","jsxs","styles","jsx","Spinner"],"mappings":";;;;;AAUO,SAASA,EAAU,EAAE,OAAAC,GAAO,sBAAAC,GAAsB,SAAAC,KAAkB;AACzE,SACG,gBAAAC,EAAA,QAAA,EAAK,WAAWC,EAAO,YAAY,GACjC,UAAA;AAAA,IAAAJ,4BAAY,UAAMA,EAAA,CAAA;AAAA,IAClB,CAACA,KAASE,KAAY,gBAAAG,EAAAC,GAAA,EAAQ,eAAeL,GAAsB;AAAA,EACtE,EAAA,CAAA;AAEJ;"}
@@ -0,0 +1 @@
1
+ export * from './InputField';
@@ -0,0 +1,5 @@
1
+ import { InputField as p } from "./InputField.js";
2
+ export {
3
+ p as InputField
4
+ };
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -4,6 +4,8 @@ export * from './Card';
4
4
  export * from './Icon';
5
5
  export * from './IconButton';
6
6
  export * from './InfoMessage';
7
+ export * from './Input';
8
+ export * from './InputField';
7
9
  export * from './SectionNotification';
8
10
  export * from './SelectListbox';
9
11
  export * from './SelectListbox/SelectProvider';
@@ -2,23 +2,27 @@ import { AppStatusBar as t } from "./AppStatusBar/AppStatusBar.js";
2
2
  import { Button as p } from "./Button/Button.js";
3
3
  import { Card as x } from "./Card/Card.js";
4
4
  import { Icon as n } from "./Icon/Icon.js";
5
- import { IconButton as i } from "./IconButton/IconButton.js";
6
- import { InfoMessage as a } from "./InfoMessage/InfoMessage.js";
7
- import { SectionNotification as u } from "./SectionNotification/SectionNotification.js";
8
- import { SelectListbox as B } from "./SelectListbox/SelectListbox.js";
9
- import { SelectProvider as d, useSelect as b } from "./SelectListbox/SelectProvider.js";
10
- import { Spinner as v } from "./Spinner/Spinner.js";
5
+ import { IconButton as c } from "./IconButton/IconButton.js";
6
+ import { InfoMessage as S } from "./InfoMessage/InfoMessage.js";
7
+ import { Input as s } from "./Input/Input.js";
8
+ import { InputField as l } from "./InputField/InputField.js";
9
+ import { SectionNotification as B } from "./SectionNotification/SectionNotification.js";
10
+ import { SelectListbox as g } from "./SelectListbox/SelectListbox.js";
11
+ import { SelectProvider as A, useSelect as C } from "./SelectListbox/SelectProvider.js";
12
+ import { Spinner as L } from "./Spinner/Spinner.js";
11
13
  export {
12
14
  t as AppStatusBar,
13
15
  p as Button,
14
16
  x as Card,
15
17
  n as Icon,
16
- i as IconButton,
17
- a as InfoMessage,
18
- u as SectionNotification,
19
- B as SelectListbox,
20
- d as SelectProvider,
21
- v as Spinner,
22
- b as useSelect
18
+ c as IconButton,
19
+ S as InfoMessage,
20
+ s as Input,
21
+ l as InputField,
22
+ B as SectionNotification,
23
+ g as SelectListbox,
24
+ A as SelectProvider,
25
+ L as Spinner,
26
+ C as useSelect
23
27
  };
24
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
package/dist/index.js CHANGED
@@ -2,23 +2,27 @@ import { AppStatusBar as t } from "./components/AppStatusBar/AppStatusBar.js";
2
2
  import { Button as p } from "./components/Button/Button.js";
3
3
  import { Card as x } from "./components/Card/Card.js";
4
4
  import { Icon as n } from "./components/Icon/Icon.js";
5
- import { IconButton as i } from "./components/IconButton/IconButton.js";
6
- import { InfoMessage as a } from "./components/InfoMessage/InfoMessage.js";
7
- import { SectionNotification as u } from "./components/SectionNotification/SectionNotification.js";
8
- import { SelectListbox as B } from "./components/SelectListbox/SelectListbox.js";
9
- import { SelectProvider as d, useSelect as b } from "./components/SelectListbox/SelectProvider.js";
10
- import { Spinner as v } from "./components/Spinner/Spinner.js";
5
+ import { IconButton as c } from "./components/IconButton/IconButton.js";
6
+ import { InfoMessage as S } from "./components/InfoMessage/InfoMessage.js";
7
+ import { Input as s } from "./components/Input/Input.js";
8
+ import { InputField as l } from "./components/InputField/InputField.js";
9
+ import { SectionNotification as B } from "./components/SectionNotification/SectionNotification.js";
10
+ import { SelectListbox as g } from "./components/SelectListbox/SelectListbox.js";
11
+ import { SelectProvider as A, useSelect as C } from "./components/SelectListbox/SelectProvider.js";
12
+ import { Spinner as L } from "./components/Spinner/Spinner.js";
11
13
  export {
12
14
  t as AppStatusBar,
13
15
  p as Button,
14
16
  x as Card,
15
17
  n as Icon,
16
- i as IconButton,
17
- a as InfoMessage,
18
- u as SectionNotification,
19
- B as SelectListbox,
20
- d as SelectProvider,
21
- v as Spinner,
22
- b as useSelect
18
+ c as IconButton,
19
+ S as InfoMessage,
20
+ s as Input,
21
+ l as InputField,
22
+ B as SectionNotification,
23
+ g as SelectListbox,
24
+ A as SelectProvider,
25
+ L as Spinner,
26
+ C as useSelect
23
27
  };
24
28
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uva-glass/component-library",
3
3
  "author": "Team Glass - Frontend vrienden",
4
4
  "private": false,
5
- "version": "1.6.0",
5
+ "version": "1.7.1",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",