@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
|
-
|
|
4
|
+
showAfterMs?: number;
|
|
5
5
|
centered?: boolean;
|
|
6
6
|
fullScreen?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const Spinner: ({ ariaValueText, centered, fullScreen,
|
|
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 {
|
|
3
|
-
import {
|
|
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,
|
|
9
|
+
}, f = 250, v = ({ ariaValueText: i, centered: s, fullScreen: t, showAfterMs: e = f }) => {
|
|
10
10
|
const [c, o] = p(() => e === 0);
|
|
11
|
-
return
|
|
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:
|
|
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
|
-
|
|
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 {
|
|
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
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { Spinner as r } from "./Spinner.js";
|
|
3
|
-
const
|
|
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
|
-
|
|
16
|
+
showAfterMs: {
|
|
17
17
|
control: "number"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
}, e = (o) => /* @__PURE__ */
|
|
20
|
+
}, e = (o) => /* @__PURE__ */ a(r, { ...o }), t = e.bind({});
|
|
21
21
|
t.args = {
|
|
22
22
|
ariaValueText: "Example value text",
|
|
23
|
-
|
|
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
|
|
31
|
-
|
|
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
|
-
|
|
37
|
+
l as FullScreen,
|
|
38
38
|
t as SpinnerExample,
|
|
39
|
-
|
|
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
|
|
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.
|
|
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.
|
|
48
|
-
"@storybook/addon-essentials": "^8.1.
|
|
49
|
-
"@storybook/addon-interactions": "^8.1.
|
|
50
|
-
"@storybook/addon-links": "^8.1.
|
|
51
|
-
"@storybook/blocks": "^8.1.
|
|
52
|
-
"@storybook/react": "^8.1.
|
|
53
|
-
"@storybook/react-vite": "^8.1.
|
|
54
|
-
"@storybook/test": "^8.1.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
80
|
+
"storybook": "^8.1.3",
|
|
81
81
|
"style-dictionary": "^3.9.2",
|
|
82
|
-
"stylelint": "^16.
|
|
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",
|