@uva-glass/component-library 1.11.0 → 1.12.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 +1 @@
1
- @keyframes _spin_132ki_11{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._spinner_132ki_11{height:2rem;width:2rem}._spinner_132ki_11:after{border:.25rem solid hsl(0deg 0% 0% / 10%);border-radius:50%;content:" ";display:block;height:100%;transform-origin:50% 50%;width:100%}@media (prefers-reduced-motion: no-preference){._spinner_132ki_11:after{animation:_spin_132ki_11 1s cubic-bezier(.455,.03,.515,.955) infinite;border-left-color:var(--color-black)}}._spinner-container--centered_132ki_33{align-items:center;display:flex;justify-content:center;padding:2rem}._spinner-container--full-screen_132ki_40{height:100vh;width:100vw}
1
+ @keyframes _spin_1m6bj_11{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._spinner_1m6bj_11{height:2rem;width:2rem}._spinner_1m6bj_11:after{border:.25rem solid hsl(0deg 0% 0% / 10%);border-radius:50%;content:" ";display:block;height:100%;transform-origin:50% 50%;width:100%}@media (prefers-reduced-motion: no-preference){._spinner_1m6bj_11:after{animation:_spin_1m6bj_11 1s cubic-bezier(.455,.03,.515,.955) infinite;border-left-color:var(--color-black)}}
@@ -2,7 +2,5 @@ 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
- centered?: boolean;
6
- fullScreen?: boolean;
7
5
  }
8
- export declare const Spinner: ({ ariaValueText, centered, fullScreen, showAfterMs }: SpinnerProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ export declare const Spinner: ({ ariaValueText, showAfterMs }: SpinnerProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,34 +1,22 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { c as l } from "../../clsx-DB4S2d7J.js";
3
- import { useState as p, useEffect as u } from "react";
4
- import '../../assets/Spinner.css';const _ = "_spinner_132ki_11", m = "_spin_132ki_11", n = {
5
- spinner: _,
6
- spin: m,
7
- "spinner-container--centered": "_spinner-container--centered_132ki_33",
8
- "spinner-container--full-screen": "_spinner-container--full-screen_132ki_40"
9
- }, f = 250, v = ({ ariaValueText: i, centered: s, fullScreen: t, showAfterMs: e = f }) => {
10
- const [c, o] = p(() => e === 0);
11
- return u(() => {
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { useState as o, useEffect as p } from "react";
3
+ import '../../assets/Spinner.css';const a = "_spinner_1m6bj_11", l = "_spin_1m6bj_11", u = {
4
+ spinner: a,
5
+ spin: l
6
+ }, c = 250, b = ({ ariaValueText: n, showAfterMs: e = c }) => {
7
+ const [r, t] = o(() => e === 0);
8
+ return p(() => {
12
9
  if (e === 0)
13
10
  return;
14
- const a = window.setTimeout(() => {
15
- o(!0);
11
+ const i = window.setTimeout(() => {
12
+ t(!0);
16
13
  }, e);
17
14
  return () => {
18
- window.clearTimeout(a);
15
+ window.clearTimeout(i);
19
16
  };
20
- }), c ? /* @__PURE__ */ r(
21
- "div",
22
- {
23
- className: l(n["spinner-container"], {
24
- [n["spinner-container--centered"]]: s,
25
- [n["spinner-container--full-screen"]]: t
26
- }),
27
- children: /* @__PURE__ */ r("div", { className: n.spinner, role: "progressbar", "aria-label": "Spinner", "aria-valuetext": i })
28
- }
29
- ) : null;
17
+ }), r ? /* @__PURE__ */ s("div", { className: u.spinner, role: "progressbar", "aria-label": "Spinner", "aria-valuetext": n }) : null;
30
18
  };
31
19
  export {
32
- v as Spinner
20
+ b as Spinner
33
21
  };
34
22
  //# sourceMappingURL=Spinner.js.map
@@ -1 +1 @@
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
+ {"version":3,"file":"Spinner.js","sources":["../../../src/components/Spinner/Spinner.tsx"],"sourcesContent":["import { 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}\n\nexport const Spinner = ({ ariaValueText, 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 className={styles['spinner']} role=\"progressbar\" aria-label=\"Spinner\" aria-valuetext={ariaValueText}></div>\n );\n};\n"],"names":["DEFAULT_DELAY_IN_MS","Spinner","ariaValueText","showAfterMs","visible","setVisible","useState","useEffect","t","jsx","styles"],"mappings":";;;;;GAIMA,IAAsB,KAQfC,IAAU,CAAC,EAAE,eAAAC,GAAe,aAAAC,IAAcH,QAAwC;AACvF,QAAA,CAACI,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,EAAC,OAAI,EAAA,WAAWC,EAAO,SAAY,MAAK,eAAc,cAAW,WAAU,kBAAgBR,EAAe,CAAA,IAJnG;AAMX;"}
@@ -3,5 +3,3 @@ import { SpinnerProps } from './Spinner';
3
3
  declare const _default: import('@storybook/types').ComponentAnnotations<import('@storybook/react').ReactRenderer, SpinnerProps>;
4
4
  export default _default;
5
5
  export declare const SpinnerExample: import('@storybook/types').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, SpinnerProps>;
6
- export declare const Centered: import('@storybook/types').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, SpinnerProps>;
7
- export declare const FullScreen: import('@storybook/types').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, SpinnerProps>;
@@ -1,41 +1,23 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { Spinner as r } from "./Spinner.js";
3
- const i = {
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Spinner as e } from "./Spinner.js";
3
+ const p = {
4
4
  title: "Atoms/Spinner",
5
- component: r,
5
+ component: e,
6
6
  argTypes: {
7
7
  ariaValueText: {
8
8
  control: "text"
9
9
  },
10
- centered: {
11
- control: "boolean"
12
- },
13
- fullScreen: {
14
- control: "boolean"
15
- },
16
10
  showAfterMs: {
17
11
  control: "number"
18
12
  }
19
13
  }
20
- }, e = (o) => /* @__PURE__ */ a(r, { ...o }), t = e.bind({});
21
- t.args = {
14
+ }, o = (t) => /* @__PURE__ */ r(e, { ...t }), n = o.bind({});
15
+ n.args = {
22
16
  ariaValueText: "Example value text",
23
17
  showAfterMs: 250
24
18
  };
25
- const n = e.bind({});
26
- n.args = {
27
- ...t.args,
28
- centered: !0
29
- };
30
- const l = e.bind({});
31
- l.args = {
32
- ...n.args,
33
- fullScreen: !0
34
- };
35
19
  export {
36
- n as Centered,
37
- l as FullScreen,
38
- t as SpinnerExample,
39
- i as default
20
+ n as SpinnerExample,
21
+ p as default
40
22
  };
41
23
  //# 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 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;"}
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 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"],"names":["Spinner_stories","Spinner","Template","args","jsx","SpinnerExample"],"mappings":";;AAMA,MAAeA,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,eAAe;AAAA,MACb,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;"}
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.11.0",
5
+ "version": "1.12.0",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",