@uva-glass/component-library 1.10.0 → 1.11.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.
@@ -1,8 +1,8 @@
1
1
  export interface SpinnerProps {
2
2
  ariaValueText: string;
3
3
  /** Delay in milliseconds after which the spinner becomes visible. The default is 250. */
4
- visibleAfter?: number;
4
+ showAfterMs?: number;
5
5
  centered?: boolean;
6
6
  fullScreen?: boolean;
7
7
  }
8
- export declare const Spinner: ({ ariaValueText, centered, fullScreen, visibleAfter }: SpinnerProps) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const Spinner: ({ ariaValueText, centered, fullScreen, showAfterMs }: SpinnerProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,14 +1,14 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { useState as p, useEffect as l } from "react";
3
- import { c as u } from "../../clsx-DB4S2d7J.js";
2
+ import { c as l } from "../../clsx-DB4S2d7J.js";
3
+ import { useState as p, useEffect as u } from "react";
4
4
  import '../../assets/Spinner.css';const _ = "_spinner_132ki_11", m = "_spin_132ki_11", n = {
5
5
  spinner: _,
6
6
  spin: m,
7
7
  "spinner-container--centered": "_spinner-container--centered_132ki_33",
8
8
  "spinner-container--full-screen": "_spinner-container--full-screen_132ki_40"
9
- }, f = 250, x = ({ ariaValueText: i, centered: s, fullScreen: t, visibleAfter: e = f }) => {
9
+ }, f = 250, v = ({ ariaValueText: i, centered: s, fullScreen: t, showAfterMs: e = f }) => {
10
10
  const [c, o] = p(() => e === 0);
11
- return l(() => {
11
+ return u(() => {
12
12
  if (e === 0)
13
13
  return;
14
14
  const a = window.setTimeout(() => {
@@ -20,7 +20,7 @@ import '../../assets/Spinner.css';const _ = "_spinner_132ki_11", m = "_spin_132k
20
20
  }), c ? /* @__PURE__ */ r(
21
21
  "div",
22
22
  {
23
- className: u(n["spinner-container"], {
23
+ className: l(n["spinner-container"], {
24
24
  [n["spinner-container--centered"]]: s,
25
25
  [n["spinner-container--full-screen"]]: t
26
26
  }),
@@ -29,6 +29,6 @@ import '../../assets/Spinner.css';const _ = "_spinner_132ki_11", m = "_spin_132k
29
29
  ) : null;
30
30
  };
31
31
  export {
32
- x as Spinner
32
+ v as Spinner
33
33
  };
34
34
  //# sourceMappingURL=Spinner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.js","sources":["../../../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { clsx } from 'clsx';\n\nimport styles from './Spinner.module.css';\n\nconst DEFAULT_DELAY_IN_MS = 250;\n\nexport interface SpinnerProps {\n ariaValueText: string;\n /** Delay in milliseconds after which the spinner becomes visible. The default is 250. */\n visibleAfter?: number;\n centered?: boolean;\n fullScreen?: boolean;\n}\n\nexport const Spinner = ({ ariaValueText, centered, fullScreen, visibleAfter = DEFAULT_DELAY_IN_MS }: SpinnerProps) => {\n const [visible, setVisible] = useState(() => (visibleAfter === 0 ? true : false));\n\n useEffect(() => {\n if (visibleAfter === 0) {\n return;\n }\n const t = window.setTimeout(() => {\n setVisible(true);\n }, visibleAfter);\n\n return () => {\n window.clearTimeout(t);\n };\n });\n\n if (!visible) {\n return null;\n }\n\n return (\n <div\n className={clsx(styles['spinner-container'], {\n [styles['spinner-container--centered']]: centered,\n [styles['spinner-container--full-screen']]: fullScreen,\n })}\n >\n <div className={styles['spinner']} role=\"progressbar\" aria-label=\"Spinner\" aria-valuetext={ariaValueText}></div>\n </div>\n );\n};\n"],"names":["DEFAULT_DELAY_IN_MS","Spinner","ariaValueText","centered","fullScreen","visibleAfter","visible","setVisible","useState","useEffect","t","jsx","clsx","styles"],"mappings":";;;;;;;;GAKMA,IAAsB,KAUfC,IAAU,CAAC,EAAE,eAAAC,GAAe,UAAAC,GAAU,YAAAC,GAAY,cAAAC,IAAeL,QAAwC;AAC9G,QAAA,CAACM,GAASC,CAAU,IAAIC,EAAS,MAAOH,MAAiB,CAAiB;AAehF,SAbAI,EAAU,MAAM;AACd,QAAIJ,MAAiB;AACnB;AAEI,UAAAK,IAAI,OAAO,WAAW,MAAM;AAChC,MAAAH,EAAW,EAAI;AAAA,OACdF,CAAY;AAEf,WAAO,MAAM;AACX,aAAO,aAAaK,CAAC;AAAA,IAAA;AAAA,EACvB,CACD,GAEIJ,IAKH,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKC,EAAO,mBAAmB,GAAG;AAAA,QAC3C,CAACA,EAAO,6BAA6B,CAAC,GAAGV;AAAA,QACzC,CAACU,EAAO,gCAAgC,CAAC,GAAGT;AAAA,MAAA,CAC7C;AAAA,MAED,UAAA,gBAAAO,EAAC,OAAI,EAAA,WAAWE,EAAO,SAAY,MAAK,eAAc,cAAW,WAAU,kBAAgBX,EAAe,CAAA;AAAA,IAAA;AAAA,EAAA,IAVrG;AAaX;"}
1
+ {"version":3,"file":"Spinner.js","sources":["../../../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useState } from 'react';\n\nimport styles from './Spinner.module.css';\n\nconst DEFAULT_DELAY_IN_MS = 250;\n\nexport interface SpinnerProps {\n ariaValueText: string;\n /** Delay in milliseconds after which the spinner becomes visible. The default is 250. */\n showAfterMs?: number;\n centered?: boolean;\n fullScreen?: boolean;\n}\n\nexport const Spinner = ({ ariaValueText, centered, fullScreen, showAfterMs = DEFAULT_DELAY_IN_MS }: SpinnerProps) => {\n const [visible, setVisible] = useState(() => (showAfterMs === 0 ? true : false));\n\n useEffect(() => {\n if (showAfterMs === 0) {\n return;\n }\n const t = window.setTimeout(() => {\n setVisible(true);\n }, showAfterMs);\n\n return () => {\n window.clearTimeout(t);\n };\n });\n\n if (!visible) {\n return null;\n }\n\n return (\n <div\n className={clsx(styles['spinner-container'], {\n [styles['spinner-container--centered']]: centered,\n [styles['spinner-container--full-screen']]: fullScreen,\n })}\n >\n <div className={styles['spinner']} role=\"progressbar\" aria-label=\"Spinner\" aria-valuetext={ariaValueText}></div>\n </div>\n );\n};\n"],"names":["DEFAULT_DELAY_IN_MS","Spinner","ariaValueText","centered","fullScreen","showAfterMs","visible","setVisible","useState","useEffect","t","jsx","clsx","styles"],"mappings":";;;;;;;;GAKMA,IAAsB,KAUfC,IAAU,CAAC,EAAE,eAAAC,GAAe,UAAAC,GAAU,YAAAC,GAAY,aAAAC,IAAcL,QAAwC;AAC7G,QAAA,CAACM,GAASC,CAAU,IAAIC,EAAS,MAAOH,MAAgB,CAAiB;AAe/E,SAbAI,EAAU,MAAM;AACd,QAAIJ,MAAgB;AAClB;AAEI,UAAAK,IAAI,OAAO,WAAW,MAAM;AAChC,MAAAH,EAAW,EAAI;AAAA,OACdF,CAAW;AAEd,WAAO,MAAM;AACX,aAAO,aAAaK,CAAC;AAAA,IAAA;AAAA,EACvB,CACD,GAEIJ,IAKH,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKC,EAAO,mBAAmB,GAAG;AAAA,QAC3C,CAACA,EAAO,6BAA6B,CAAC,GAAGV;AAAA,QACzC,CAACU,EAAO,gCAAgC,CAAC,GAAGT;AAAA,MAAA,CAC7C;AAAA,MAED,UAAA,gBAAAO,EAAC,OAAI,EAAA,WAAWE,EAAO,SAAY,MAAK,eAAc,cAAW,WAAU,kBAAgBX,EAAe,CAAA;AAAA,IAAA;AAAA,EAAA,IAVrG;AAaX;"}
@@ -1,6 +1,6 @@
1
- import { jsx as l } from "react/jsx-runtime";
1
+ import { jsx as a } from "react/jsx-runtime";
2
2
  import { Spinner as r } from "./Spinner.js";
3
- const c = {
3
+ const i = {
4
4
  title: "Atoms/Spinner",
5
5
  component: r,
6
6
  argTypes: {
@@ -13,29 +13,29 @@ const c = {
13
13
  fullScreen: {
14
14
  control: "boolean"
15
15
  },
16
- visibleAfter: {
16
+ showAfterMs: {
17
17
  control: "number"
18
18
  }
19
19
  }
20
- }, e = (o) => /* @__PURE__ */ l(r, { ...o }), t = e.bind({});
20
+ }, e = (o) => /* @__PURE__ */ a(r, { ...o }), t = e.bind({});
21
21
  t.args = {
22
22
  ariaValueText: "Example value text",
23
- visibleAfter: 250
23
+ showAfterMs: 250
24
24
  };
25
25
  const n = e.bind({});
26
26
  n.args = {
27
27
  ...t.args,
28
28
  centered: !0
29
29
  };
30
- const a = e.bind({});
31
- a.args = {
30
+ const l = e.bind({});
31
+ l.args = {
32
32
  ...n.args,
33
33
  fullScreen: !0
34
34
  };
35
35
  export {
36
36
  n as Centered,
37
- a as FullScreen,
37
+ l as FullScreen,
38
38
  t as SpinnerExample,
39
- c as default
39
+ i as default
40
40
  };
41
41
  //# sourceMappingURL=Spinner.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Spinner.stories.js","sources":["../../../src/components/Spinner/Spinner.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { SpinnerProps } from './Spinner';\n\nimport { Spinner } from './Spinner';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Spinner',\n component: Spinner,\n argTypes: {\n ariaValueText: {\n control: 'text'\n },\n centered: {\n control: 'boolean'\n },\n fullScreen: {\n control: 'boolean'\n },\n visibleAfter: {\n control: 'number'\n }\n },\n} as Meta<SpinnerProps>;\n\nconst Template: StoryFn<SpinnerProps> = (args) => <Spinner {...args} />;\n\nexport const SpinnerExample = Template.bind({});\nSpinnerExample.args = {\n ariaValueText: 'Example value text',\n visibleAfter: 250\n};\n\nexport const Centered = Template.bind({});\nCentered.args = {\n ...SpinnerExample.args,\n centered: true\n};\n\nexport const FullScreen = Template.bind({});\nFullScreen.args = {\n ...Centered.args,\n fullScreen: true\n};\n"],"names":["Spinner_stories","Spinner","Template","args","jsx","SpinnerExample","Centered","FullScreen"],"mappings":";;AAMA,MAAeA,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,eAAe;AAAA,MACX,SAAS;AAAA,IACb;AAAA,IACA,UAAU;AAAA,MACN,SAAS;AAAA,IACb;AAAA,IACA,YAAY;AAAA,MACR,SAAS;AAAA,IACb;AAAA,IACA,cAAc;AAAA,MACV,SAAS;AAAA,IACb;AAAA,EACF;AACF,GAEMC,IAAkC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAS,GAAGE,EAAM,CAAA,GAExDE,IAAiBH,EAAS,KAAK,EAAE;AAC9CG,EAAe,OAAO;AAAA,EACpB,eAAe;AAAA,EACf,cAAc;AAChB;AAEO,MAAMC,IAAWJ,EAAS,KAAK,EAAE;AACxCI,EAAS,OAAO;AAAA,EACZ,GAAGD,EAAe;AAAA,EAClB,UAAU;AACd;AAEO,MAAME,IAAaL,EAAS,KAAK,EAAE;AAC1CK,EAAW,OAAO;AAAA,EACd,GAAGD,EAAS;AAAA,EACZ,YAAY;AAChB;"}
1
+ {"version":3,"file":"Spinner.stories.js","sources":["../../../src/components/Spinner/Spinner.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { SpinnerProps } from './Spinner';\n\nimport { Spinner } from './Spinner';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Spinner',\n component: Spinner,\n argTypes: {\n ariaValueText: {\n control: 'text',\n },\n centered: {\n control: 'boolean',\n },\n fullScreen: {\n control: 'boolean',\n },\n showAfterMs: {\n control: 'number',\n },\n },\n} as Meta<SpinnerProps>;\n\nconst Template: StoryFn<SpinnerProps> = (args) => <Spinner {...args} />;\n\nexport const SpinnerExample = Template.bind({});\nSpinnerExample.args = {\n ariaValueText: 'Example value text',\n showAfterMs: 250,\n};\n\nexport const Centered = Template.bind({});\nCentered.args = {\n ...SpinnerExample.args,\n centered: true,\n};\n\nexport const FullScreen = Template.bind({});\nFullScreen.args = {\n ...Centered.args,\n fullScreen: true,\n};\n"],"names":["Spinner_stories","Spinner","Template","args","jsx","SpinnerExample","Centered","FullScreen"],"mappings":";;AAMA,MAAeA,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,eAAe;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACV,SAAS;AAAA,IACX;AAAA,IACA,aAAa;AAAA,MACX,SAAS;AAAA,IACX;AAAA,EACF;AACF,GAEMC,IAAkC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAS,GAAGE,EAAM,CAAA,GAExDE,IAAiBH,EAAS,KAAK,EAAE;AAC9CG,EAAe,OAAO;AAAA,EACpB,eAAe;AAAA,EACf,aAAa;AACf;AAEO,MAAMC,IAAWJ,EAAS,KAAK,EAAE;AACxCI,EAAS,OAAO;AAAA,EACd,GAAGD,EAAe;AAAA,EAClB,UAAU;AACZ;AAEO,MAAME,IAAaL,EAAS,KAAK,EAAE;AAC1CK,EAAW,OAAO;AAAA,EAChB,GAAGD,EAAS;AAAA,EACZ,YAAY;AACd;"}
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.10.0",
5
+ "version": "1.11.0",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -44,16 +44,16 @@
44
44
  "@semantic-release/git": "^10.0.1",
45
45
  "@semantic-release/gitlab": "^13.1.0",
46
46
  "@semantic-release/npm": "^12.0.1",
47
- "@storybook/addon-a11y": "^8.1.2",
48
- "@storybook/addon-essentials": "^8.1.2",
49
- "@storybook/addon-interactions": "^8.1.2",
50
- "@storybook/addon-links": "^8.1.2",
51
- "@storybook/blocks": "^8.1.2",
52
- "@storybook/react": "^8.1.2",
53
- "@storybook/react-vite": "^8.1.2",
54
- "@storybook/test": "^8.1.2",
47
+ "@storybook/addon-a11y": "^8.1.3",
48
+ "@storybook/addon-essentials": "^8.1.3",
49
+ "@storybook/addon-interactions": "^8.1.3",
50
+ "@storybook/addon-links": "^8.1.3",
51
+ "@storybook/blocks": "^8.1.3",
52
+ "@storybook/react": "^8.1.3",
53
+ "@storybook/react-vite": "^8.1.3",
54
+ "@storybook/test": "^8.1.3",
55
55
  "@types/node": "^20.12.12",
56
- "@types/react": "^18.3.2",
56
+ "@types/react": "^18.3.3",
57
57
  "@types/react-dom": "^18.3.0",
58
58
  "@typescript-eslint/eslint-plugin": "^7.10.0",
59
59
  "@typescript-eslint/parser": "^7.10.0",
@@ -68,18 +68,18 @@
68
68
  "eslint-plugin-react-hooks": "^4.6.2",
69
69
  "eslint-plugin-react-refresh": "^0.4.7",
70
70
  "eslint-plugin-storybook": "^0.8.0",
71
- "glob": "^10.3.16",
71
+ "glob": "^10.4.1",
72
72
  "jest": "^29.7.0",
73
73
  "jest-environment-jsdom": "^29.7.0",
74
74
  "jest-junit": "^16.0.0",
75
- "jsdom": "^24.0.0",
75
+ "jsdom": "^24.1.0",
76
76
  "npm-run-all2": "^6.2.0",
77
77
  "react": "^18.3.1",
78
78
  "react-dom": "^18.3.1",
79
79
  "semantic-release": "^23.1.1",
80
- "storybook": "^8.1.2",
80
+ "storybook": "^8.1.3",
81
81
  "style-dictionary": "^3.9.2",
82
- "stylelint": "^16.5.0",
82
+ "stylelint": "^16.6.0",
83
83
  "stylelint-config-recommended": "^14.0.0",
84
84
  "stylelint-config-standard": "^36.0.0",
85
85
  "stylelint-order": "^6.0.4",