@uva-glass/component-library 1.58.0 → 1.59.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.
@@ -4,14 +4,19 @@ interface Period {
4
4
  semesterNumber: number;
5
5
  periodInSemester: number;
6
6
  }
7
+ interface TooltipTranslations {
8
+ period: string;
9
+ periods: string;
10
+ and: string;
11
+ }
7
12
  export interface PeriodsProps {
8
13
  /** Indicates which periods are selected. */
9
14
  periods: Period[] | number[];
10
15
  /** Indicates the maximum number of periods to show in the selector. */
11
16
  maxPeriods?: 6 | 7;
12
- /** A mapping for the tooltips of each period indicator. */
13
- titlePeriods?: Record<string, Record<string, string>>;
17
+ /** A object of translations for the tooltip. */
18
+ tooltipTranslations?: TooltipTranslations;
14
19
  }
15
20
  /** Represents a component for a period indicator. */
16
- export declare const Periods: ({ periods, titlePeriods, maxPeriods }: PeriodsProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const Periods: ({ periods, tooltipTranslations, maxPeriods }: PeriodsProps) => import("react/jsx-runtime").JSX.Element;
17
22
  export {};
@@ -1,35 +1,42 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { c as N } from "../../clsx-OuTLNxxd.js";
3
- import { useId as v } from "react";
4
- import '../../assets/Periods.css';const j = "_period__container_1ilj5_1", y = "_period__item_1ilj5_6", n = {
5
- period__container: j,
6
- period__item: y,
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { c as P } from "../../clsx-OuTLNxxd.js";
3
+ import { useId as j } from "react";
4
+ import '../../assets/Periods.css';const N = "_period__container_1ilj5_1", g = "_period__item_1ilj5_6", _ = {
5
+ period__container: N,
6
+ period__item: g,
7
7
  "period__item--active": "_period__item--active_1ilj5_19"
8
- }, A = 6, x = ({ periods: r, titlePeriods: l, maxPeriods: a = A }) => {
9
- const p = Array.from({ length: a }, (e, t) => t + 1), u = v(), _ = r.some((e) => typeof e == "number"), d = (e) => {
10
- let t = 0;
11
- return r.reduce(($, b, m) => {
12
- const { semesterNumber: s, periodInSemester: o } = b;
13
- let i = "";
14
- return s !== t ? i = ` ${e.periods["period-title"].replace("{{ semester }}", s.toString())} ${o}` : r[m + 1] && r[m + 1].semesterNumber === t ? i = `, ${o}` : i = ` ${e.periods["last-separator"]} ${o}`, t = s, `${$}${i}`;
15
- }, "").trim();
16
- }, f = (e) => _ ? r.includes(e) : !!r.find((t) => t.number === e);
17
- return /* @__PURE__ */ c(
18
- "div",
8
+ }, v = 6, O = ({ periods: s, tooltipTranslations: u, maxPeriods: p = v }) => {
9
+ const f = Array.from({ length: p }, (e, t) => t + 1), $ = j(), a = s.some((e) => typeof e == "number"), b = (e) => {
10
+ const t = {};
11
+ return a ? s.forEach((i) => {
12
+ if (typeof i == "number") {
13
+ const r = Math.ceil(i / 3), o = (i - 1) % 3 + 1;
14
+ t[r] || (t[r] = []), t[r].push(o);
15
+ }
16
+ }) : s.forEach((i) => {
17
+ const { semesterNumber: r, periodInSemester: o } = i;
18
+ t[r] || (t[r] = []), t[r].push(o);
19
+ }), Object.keys(t).reduce((i, r, o) => {
20
+ const c = Number(r), n = t[c];
21
+ let m = "";
22
+ const d = n.length > 1 ? e.periods : e.period;
23
+ if (n.length > 1) {
24
+ const y = n.pop();
25
+ m = `Semester ${c} ${d} ${n.join(", ")} ${e.and} ${y}`;
26
+ } else
27
+ m = `Semester ${c} ${d} ${n[0]}`;
28
+ return `${i}${o > 0 ? ". " : ""}${m}`;
29
+ }, "").trim() + ".";
30
+ }, h = (e) => a ? s.includes(e) : !!s.find((t) => t.number === e);
31
+ return /* @__PURE__ */ l("div", { className: _.period__container, title: u ? b(u) : "", children: f.map((e) => /* @__PURE__ */ l(
32
+ "span",
19
33
  {
20
- className: n.period__container,
21
- title: _ ? "" : d(l),
22
- children: p.map((e) => /* @__PURE__ */ c(
23
- "span",
24
- {
25
- className: N(n.period__item, f(e) ? n["period__item--active"] : "")
26
- },
27
- `${u}-${e}`
28
- ))
29
- }
30
- );
34
+ className: P(_.period__item, h(e) ? _["period__item--active"] : "")
35
+ },
36
+ `${$}-${e}`
37
+ )) });
31
38
  };
32
39
  export {
33
- x as Periods
40
+ O as Periods
34
41
  };
35
42
  //# sourceMappingURL=Periods.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Periods.js","sources":["../../../src/components/Periods/Periods.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useId } from 'react';\n\nimport styles from './Periods.module.css';\n\ninterface Period {\n id: string;\n number: number;\n semesterNumber: number;\n periodInSemester: number;\n}\n\nexport interface PeriodsProps {\n /** Indicates which periods are selected. */\n periods: Period[] | number[];\n /** Indicates the maximum number of periods to show in the selector. */\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n maxPeriods?: 6 | 7;\n /** A mapping for the tooltips of each period indicator. */\n titlePeriods?: Record<string, Record<string, string>>;\n}\n\nconst MAX_PERIODS = 6;\n\n/** Represents a component for a period indicator. */\nexport const Periods = ({ periods, titlePeriods, maxPeriods = MAX_PERIODS }: PeriodsProps) => {\n const maxPeriodsList = Array.from({ length: maxPeriods }, (_, index) => index + 1);\n const idPrefix = useId();\n\n const isArrayOfNumbers = periods.some((value) => {\n return typeof value === 'number';\n });\n\n const getTitles = (titlePeriods: Record<string, Record<string, string>>): string => {\n let currentSemesterNumber = 0;\n\n const title = periods.reduce((acc, period, index) => {\n const { semesterNumber, periodInSemester } = period as Period;\n let periodTitle = '';\n if (semesterNumber !== currentSemesterNumber) {\n periodTitle = ` ${titlePeriods.periods['period-title'].replace('{{ semester }}', semesterNumber.toString())} ${periodInSemester}`;\n } else if (periods[index + 1] && (periods[index + 1] as Period).semesterNumber === currentSemesterNumber) {\n periodTitle = `, ${periodInSemester}`;\n } else {\n periodTitle = ` ${titlePeriods.periods['last-separator']} ${periodInSemester}`;\n }\n\n currentSemesterNumber = semesterNumber;\n return `${acc}${periodTitle}`;\n }, '');\n\n return title.trim();\n };\n\n const isPeriodActive = (periodIndex: number): boolean => {\n if (isArrayOfNumbers) {\n return (periods as number[]).includes(periodIndex);\n } else {\n return periods.find((period) => (period as Period).number === periodIndex) ? true : false;\n }\n };\n\n return (\n <div\n className={styles['period__container']}\n title={isArrayOfNumbers ? '' : getTitles(titlePeriods as Record<string, Record<string, string>>)}\n >\n {maxPeriodsList.map((periodIndex) => {\n return (\n <span\n className={clsx(styles['period__item'], isPeriodActive(periodIndex) ? styles['period__item--active'] : '')}\n key={`${idPrefix}-${periodIndex}`}\n />\n );\n })}\n </div>\n );\n};\n"],"names":["MAX_PERIODS","Periods","periods","titlePeriods","maxPeriods","maxPeriodsList","_","index","idPrefix","useId","isArrayOfNumbers","value","getTitles","currentSemesterNumber","acc","period","semesterNumber","periodInSemester","periodTitle","isPeriodActive","periodIndex","jsx","styles","clsx"],"mappings":";;;;;;;GAsBMA,IAAc,GAGPC,IAAU,CAAC,EAAE,SAAAC,GAAS,cAAAC,GAAc,YAAAC,IAAaJ,QAAgC;AACtF,QAAAK,IAAiB,MAAM,KAAK,EAAE,QAAQD,KAAc,CAACE,GAAGC,MAAUA,IAAQ,CAAC,GAC3EC,IAAWC,KAEXC,IAAmBR,EAAQ,KAAK,CAACS,MAC9B,OAAOA,KAAU,QACzB,GAEKC,IAAY,CAACT,MAAiE;AAClF,QAAIU,IAAwB;AAiB5B,WAfcX,EAAQ,OAAO,CAACY,GAAKC,GAAQR,MAAU;AAC7C,YAAA,EAAE,gBAAAS,GAAgB,kBAAAC,EAAqB,IAAAF;AAC7C,UAAIG,IAAc;AAClB,aAAIF,MAAmBH,IACrBK,IAAc,IAAIf,EAAa,QAAQ,cAAc,EAAE,QAAQ,kBAAkBa,EAAe,SAAU,CAAA,CAAC,IAAIC,CAAgB,KACtHf,EAAQK,IAAQ,CAAC,KAAML,EAAQK,IAAQ,CAAC,EAAa,mBAAmBM,IACjFK,IAAc,KAAKD,CAAgB,KAEnCC,IAAc,IAAIf,EAAa,QAAQ,gBAAgB,CAAC,IAAIc,CAAgB,IAGtDJ,IAAAG,GACjB,GAAGF,CAAG,GAAGI,CAAW;AAAA,OAC1B,EAAE,EAEQ;EAAK,GAGdC,IAAiB,CAACC,MAClBV,IACMR,EAAqB,SAASkB,CAAW,IAE1C,EAAAlB,EAAQ,KAAK,CAACa,MAAYA,EAAkB,WAAWK,CAAW;AAK3E,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAO;AAAA,MAClB,OAAOZ,IAAmB,KAAKE,EAAUT,CAAsD;AAAA,MAE9F,UAAAE,EAAe,IAAI,CAACe,MAEjB,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWE,EAAKD,EAAO,cAAiBH,EAAeC,CAAW,IAAIE,EAAO,sBAAsB,IAAI,EAAE;AAAA,QAAA;AAAA,QACpG,GAAGd,CAAQ,IAAIY,CAAW;AAAA,MAAA,CAGpC;AAAA,IAAA;AAAA,EAAA;AAGP;"}
1
+ {"version":3,"file":"Periods.js","sources":["../../../src/components/Periods/Periods.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport { useId } from 'react';\n\nimport styles from './Periods.module.css';\n\ninterface Period {\n id: string;\n number: number;\n semesterNumber: number;\n periodInSemester: number;\n}\n\ninterface TooltipTranslations {\n period: string;\n periods: string;\n and: string;\n}\n\nexport interface PeriodsProps {\n /** Indicates which periods are selected. */\n periods: Period[] | number[];\n /** Indicates the maximum number of periods to show in the selector. */\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n maxPeriods?: 6 | 7;\n /** A object of translations for the tooltip. */\n tooltipTranslations?: TooltipTranslations;\n}\n\nconst MAX_PERIODS = 6;\n\n/** Represents a component for a period indicator. */\nexport const Periods = ({ periods, tooltipTranslations, maxPeriods = MAX_PERIODS }: PeriodsProps) => {\n const maxPeriodsList = Array.from({ length: maxPeriods }, (_, index) => index + 1);\n const idPrefix = useId();\n\n const isArrayOfNumbers = periods.some((value) => {\n return typeof value === 'number';\n });\n\n const getTitles = (tooltipTranslations: TooltipTranslations): string => {\n const semesterPeriods: Record<number, number[]> = {};\n\n // Group periods by semester\n isArrayOfNumbers\n ? periods.forEach((period) => {\n if (typeof period === 'number') {\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n const groupKey = Math.ceil(period / 3); // Determine the semester (1, 2, or 3)\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers\n const mappedValue = ((period - 1) % 3) + 1; // Map period to semester\n\n if (!semesterPeriods[groupKey]) {\n semesterPeriods[groupKey] = [];\n }\n semesterPeriods[groupKey].push(mappedValue);\n }\n })\n : periods.forEach((period) => {\n const { semesterNumber, periodInSemester } = period as Period;\n\n if (!semesterPeriods[semesterNumber]) {\n semesterPeriods[semesterNumber] = [];\n }\n semesterPeriods[semesterNumber].push(periodInSemester);\n });\n\n // Build the title string\n const title = Object.keys(semesterPeriods).reduce((acc, semesterKey, index) => {\n const semesterNumber = Number(semesterKey);\n const periodsInSemester = semesterPeriods[semesterNumber];\n let periodTitle = '';\n\n // Determine if we need singular or plural form for \"period\"\n const blokLabel = periodsInSemester.length > 1 ? tooltipTranslations.periods : tooltipTranslations.period;\n\n // Build period sequence for the current semester\n if (periodsInSemester.length > 1) {\n const lastPeriod = periodsInSemester.pop();\n periodTitle = `Semester ${semesterNumber} ${blokLabel} ${periodsInSemester.join(', ')} ${tooltipTranslations.and} ${lastPeriod}`;\n } else {\n periodTitle = `Semester ${semesterNumber} ${blokLabel} ${periodsInSemester[0]}`;\n }\n\n // Add proper spacing and periods\n return `${acc}${index > 0 ? '. ' : ''}${periodTitle}`;\n }, '');\n\n return title.trim() + '.';\n };\n\n const isPeriodActive = (periodIndex: number): boolean => {\n if (isArrayOfNumbers) {\n return (periods as number[]).includes(periodIndex);\n } else {\n return periods.find((period) => (period as Period).number === periodIndex) ? true : false;\n }\n };\n\n return (\n <div className={styles['period__container']} title={tooltipTranslations ? getTitles(tooltipTranslations) : ''}>\n {maxPeriodsList.map((periodIndex) => {\n return (\n <span\n className={clsx(styles['period__item'], isPeriodActive(periodIndex) ? styles['period__item--active'] : '')}\n key={`${idPrefix}-${periodIndex}`}\n />\n );\n })}\n </div>\n );\n};\n"],"names":["MAX_PERIODS","Periods","periods","tooltipTranslations","maxPeriods","maxPeriodsList","_","index","idPrefix","useId","isArrayOfNumbers","value","getTitles","semesterPeriods","period","groupKey","mappedValue","semesterNumber","periodInSemester","acc","semesterKey","periodsInSemester","periodTitle","blokLabel","lastPeriod","isPeriodActive","periodIndex","jsx","styles","clsx"],"mappings":";;;;;;;GA4BMA,IAAc,GAGPC,IAAU,CAAC,EAAE,SAAAC,GAAS,qBAAAC,GAAqB,YAAAC,IAAaJ,QAAgC;AAC7F,QAAAK,IAAiB,MAAM,KAAK,EAAE,QAAQD,KAAc,CAACE,GAAGC,MAAUA,IAAQ,CAAC,GAC3EC,IAAWC,KAEXC,IAAmBR,EAAQ,KAAK,CAACS,MAC9B,OAAOA,KAAU,QACzB,GAEKC,IAAY,CAACT,MAAqD;AACtE,UAAMU,IAA4C,CAAA;AAI9C,WAAAH,IAAAR,EAAQ,QAAQ,CAACY,MAAW;AACtB,UAAA,OAAOA,KAAW,UAAU;AAE9B,cAAMC,IAAW,KAAK,KAAKD,IAAS,CAAC,GAE/BE,KAAgBF,IAAS,KAAK,IAAK;AAErC,QAACD,EAAgBE,CAAQ,MACXF,EAAAE,CAAQ,IAAI,KAEdF,EAAAE,CAAQ,EAAE,KAAKC,CAAW;AAAA,MAC5C;AAAA,IACD,CAAA,IACDd,EAAQ,QAAQ,CAACY,MAAW;AACpB,YAAA,EAAE,gBAAAG,GAAgB,kBAAAC,EAAqB,IAAAJ;AAEzC,MAACD,EAAgBI,CAAc,MACjBJ,EAAAI,CAAc,IAAI,KAEpBJ,EAAAI,CAAc,EAAE,KAAKC,CAAgB;AAAA,IAAA,CACtD,GAGS,OAAO,KAAKL,CAAe,EAAE,OAAO,CAACM,GAAKC,GAAab,MAAU;AACvE,YAAAU,IAAiB,OAAOG,CAAW,GACnCC,IAAoBR,EAAgBI,CAAc;AACxD,UAAIK,IAAc;AAGlB,YAAMC,IAAYF,EAAkB,SAAS,IAAIlB,EAAoB,UAAUA,EAAoB;AAG/F,UAAAkB,EAAkB,SAAS,GAAG;AAC1B,cAAAG,IAAaH,EAAkB;AACrC,QAAAC,IAAc,YAAYL,CAAc,IAAIM,CAAS,IAAIF,EAAkB,KAAK,IAAI,CAAC,IAAIlB,EAAoB,GAAG,IAAIqB,CAAU;AAAA,MAAA;AAE9H,QAAAF,IAAc,YAAYL,CAAc,IAAIM,CAAS,IAAIF,EAAkB,CAAC,CAAC;AAIxE,aAAA,GAAGF,CAAG,GAAGZ,IAAQ,IAAI,OAAO,EAAE,GAAGe,CAAW;AAAA,OAClD,EAAE,EAEQ,KAAS,IAAA;AAAA,EAAA,GAGlBG,IAAiB,CAACC,MAClBhB,IACMR,EAAqB,SAASwB,CAAW,IAE1C,EAAAxB,EAAQ,KAAK,CAACY,MAAYA,EAAkB,WAAWY,CAAW;AAI7E,SACG,gBAAAC,EAAA,OAAA,EAAI,WAAWC,EAAO,mBAAsB,OAAOzB,IAAsBS,EAAUT,CAAmB,IAAI,IACxG,UAAeE,EAAA,IAAI,CAACqB,MAEjB,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWE,EAAKD,EAAO,cAAiBH,EAAeC,CAAW,IAAIE,EAAO,sBAAsB,IAAI,EAAE;AAAA,IAAA;AAAA,IACpG,GAAGpB,CAAQ,IAAIkB,CAAW;AAAA,EAAA,CAGpC,EACH,CAAA;AAEJ;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
2
  import { Periods as e } from "./Periods.js";
3
- const t = "<Periods periods={periods} />", o = [
3
+ const o = "<Periods periods={periods} />", t = [
4
4
  {
5
5
  id: "2023P1",
6
6
  number: 1,
@@ -13,6 +13,12 @@ const t = "<Periods periods={periods} />", o = [
13
13
  semesterNumber: 1,
14
14
  periodInSemester: 2
15
15
  },
16
+ {
17
+ id: "2023P3",
18
+ number: 3,
19
+ semesterNumber: 1,
20
+ periodInSemester: 3
21
+ },
16
22
  {
17
23
  id: "2023P5",
18
24
  number: 5,
@@ -26,10 +32,9 @@ const t = "<Periods periods={periods} />", o = [
26
32
  periodInSemester: 1
27
33
  }
28
34
  ], i = {
29
- periods: {
30
- "period-title": "Semester {{ semester }} block",
31
- "last-separator": "en"
32
- }
35
+ period: "blok",
36
+ periods: "blokken",
37
+ and: "en"
33
38
  }, a = {
34
39
  title: "Atoms/Periods",
35
40
  component: e,
@@ -43,16 +48,16 @@ const t = "<Periods periods={periods} />", o = [
43
48
  },
44
49
  parameters: {
45
50
  inspectComponent: e,
46
- codeString: t
51
+ codeString: o
47
52
  }
48
- }, m = (r) => /* @__PURE__ */ s(e, { ...r }), d = m.bind({});
49
- d.args = {
50
- periods: o,
53
+ }, m = (r) => /* @__PURE__ */ s(e, { ...r }), n = m.bind({});
54
+ n.args = {
55
+ periods: t,
51
56
  maxPeriods: 7,
52
- titlePeriods: i
57
+ tooltipTranslations: i
53
58
  };
54
59
  export {
55
- d as PeriodsExample,
60
+ n as PeriodsExample,
56
61
  a as default
57
62
  };
58
63
  //# sourceMappingURL=Periods.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Periods.stories.js","sources":["../../../src/components/Periods/Periods.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { PeriodsProps } from './Periods';\n\nimport { Periods } from './Periods';\n\nconst codeString = '<Periods periods={periods} />';\n\nconst PERIODS = [\n {\n id: '2023P1',\n number: 1,\n semesterNumber: 1,\n periodInSemester: 1,\n },\n {\n id: '2023P2',\n number: 2,\n semesterNumber: 1,\n periodInSemester: 2,\n },\n {\n id: '2023P5',\n number: 5,\n semesterNumber: 2,\n periodInSemester: 2,\n },\n {\n id: '2023P7',\n number: 7,\n semesterNumber: 3,\n periodInSemester: 1,\n },\n];\n\nconst TITLE_PERIODS = {\n periods: {\n 'period-title': 'Semester {{ semester }} block',\n 'last-separator': 'en',\n },\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Periods',\n component: Periods,\n argTypes: {\n expanded: {\n // Hide the expanded prop. Changing the value in Storybook doesn't update the state of the component.\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: Periods,\n codeString: codeString,\n },\n} as Meta<PeriodsProps>;\n\nconst Template: StoryFn<PeriodsProps> = (args) => <Periods {...args} />;\n\nexport const PeriodsExample = Template.bind({});\n\nPeriodsExample.args = {\n periods: PERIODS,\n maxPeriods: 7,\n titlePeriods: TITLE_PERIODS,\n};\n"],"names":["codeString","PERIODS","TITLE_PERIODS","Periods_stories","Periods","Template","args","jsx","PeriodsExample"],"mappings":";;AAKA,MAAMA,IAAa,iCAEbC,IAAU;AAAA,EACd;AAAA,IACE,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AACF,GAEMC,IAAgB;AAAA,EACpB,SAAS;AAAA,IACP,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AACF,GAGeC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,UAAU;AAAA;AAAA,MAER,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAJ;AAAA,EACF;AACF,GAEMK,IAAkC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAS,GAAGE,EAAM,CAAA,GAExDE,IAAiBH,EAAS,KAAK,EAAE;AAE9CG,EAAe,OAAO;AAAA,EACpB,SAASP;AAAA,EACT,YAAY;AAAA,EACZ,cAAcC;AAChB;"}
1
+ {"version":3,"file":"Periods.stories.js","sources":["../../../src/components/Periods/Periods.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { PeriodsProps } from './Periods';\n\nimport { Periods } from './Periods';\n\nconst codeString = '<Periods periods={periods} />';\n\nconst PERIODS = [\n {\n id: '2023P1',\n number: 1,\n semesterNumber: 1,\n periodInSemester: 1,\n },\n {\n id: '2023P2',\n number: 2,\n semesterNumber: 1,\n periodInSemester: 2,\n },\n {\n id: '2023P3',\n number: 3,\n semesterNumber: 1,\n periodInSemester: 3,\n },\n {\n id: '2023P5',\n number: 5,\n semesterNumber: 2,\n periodInSemester: 2,\n },\n {\n id: '2023P7',\n number: 7,\n semesterNumber: 3,\n periodInSemester: 1,\n },\n];\n\nconst TOOLTIP_PERIODS = {\n period: 'blok',\n periods: 'blokken',\n and: 'en',\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/Periods',\n component: Periods,\n argTypes: {\n expanded: {\n // Hide the expanded prop. Changing the value in Storybook doesn't update the state of the component.\n table: {\n disable: true,\n },\n },\n },\n parameters: {\n inspectComponent: Periods,\n codeString: codeString,\n },\n} as Meta<PeriodsProps>;\n\nconst Template: StoryFn<PeriodsProps> = (args) => <Periods {...args} />;\n\nexport const PeriodsExample = Template.bind({});\n\nPeriodsExample.args = {\n periods: PERIODS,\n maxPeriods: 7,\n tooltipTranslations: TOOLTIP_PERIODS,\n};\n"],"names":["codeString","PERIODS","TOOLTIP_PERIODS","Periods_stories","Periods","Template","args","jsx","PeriodsExample"],"mappings":";;AAKA,MAAMA,IAAa,iCAEbC,IAAU;AAAA,EACd;AAAA,IACE,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AACF,GAEMC,IAAkB;AAAA,EACtB,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,KAAK;AACP,GAGeC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,UAAU;AAAA;AAAA,MAER,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAJ;AAAA,EACF;AACF,GAEMK,IAAkC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAS,GAAGE,EAAM,CAAA,GAExDE,IAAiBH,EAAS,KAAK,EAAE;AAE9CG,EAAe,OAAO;AAAA,EACpB,SAASP;AAAA,EACT,YAAY;AAAA,EACZ,qBAAqBC;AACvB;"}
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.58.0",
5
+ "version": "1.59.0",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -57,8 +57,8 @@
57
57
  "@storybook/react": "^8.3.6",
58
58
  "@storybook/react-vite": "^8.3.6",
59
59
  "@storybook/test": "^8.3.6",
60
- "@types/node": "^20.16.14",
61
- "@types/react": "^18.3.11",
60
+ "@types/node": "^20.16.15",
61
+ "@types/react": "^18.3.12",
62
62
  "@types/react-dom": "^18.3.1",
63
63
  "@uva-glass/eslint-config": "^1.3.1",
64
64
  "@uva-glass/stylelint-config": "^1.1.0",
@@ -67,7 +67,7 @@
67
67
  "eslint": "^8.57.1",
68
68
  "eslint-config-prettier": "^9.1.0",
69
69
  "eslint-plugin-prettier": "^5.2.1",
70
- "eslint-plugin-react": "^7.37.1",
70
+ "eslint-plugin-react": "^7.37.2",
71
71
  "eslint-plugin-react-hooks": "^5.0.0",
72
72
  "eslint-plugin-react-refresh": "^0.4.13",
73
73
  "eslint-plugin-storybook": "^0.10.1",
@@ -88,8 +88,8 @@
88
88
  "stylelint-config-standard": "^36.0.1",
89
89
  "stylelint-order": "^6.0.4",
90
90
  "typescript": "^5.6.3",
91
- "vite": "^5.4.9",
92
- "vite-plugin-dts": "^4.2.4",
91
+ "vite": "^5.4.10",
92
+ "vite-plugin-dts": "^4.3.0",
93
93
  "vite-plugin-lib-inject-css": "^2.1.1",
94
94
  "vite-plugin-static-copy": "^2.0.0",
95
95
  "vite-plugin-svgr": "^4.2.0",