@uva-glass/component-library 3.8.0 → 3.9.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,3 +1,4 @@
1
+ import { ReactElement } from 'react';
1
2
  type FeedbackLevel = 'success' | 'warning' | 'error';
2
3
  export interface FeedbackBoxProps {
3
4
  /** The id of the element. */
@@ -5,7 +6,7 @@ export interface FeedbackBoxProps {
5
6
  /** The feedback level, indicates what icon is used. */
6
7
  level: FeedbackLevel;
7
8
  /** The feedback value. */
8
- feedback: string;
9
+ feedback: string | ReactElement;
9
10
  }
10
11
  /** Represents a component to show feedback. */
11
12
  export declare const FeedbackBox: ({ id, level, feedback }: FeedbackBoxProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackBox.js","sources":["../../../src/components/FeedbackBox/FeedbackBox.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { IconProps } from 'components/Icon';\n\nimport styles from './FeedbackBox.module.css';\n\nimport { Icon } from 'components/Icon';\n\ntype FeedbackLevel = 'success' | 'warning' | 'error';\n\nconst LEVEL_ICON_MAP: Record<FeedbackLevel, IconProps['name']> = {\n success: 'CheckCircle',\n warning: 'ExclamationCircle',\n error: 'ExclamationTriangleMini',\n};\n\nexport interface FeedbackBoxProps {\n /** The id of the element. */\n id?: string;\n /** The feedback level, indicates what icon is used. */\n level: FeedbackLevel;\n /** The feedback value. */\n feedback: string;\n}\n\n/** Represents a component to show feedback. */\nexport const FeedbackBox = ({ id, level, feedback }: FeedbackBoxProps) => (\n <div\n className={clsx(styles['feedback-box'], {\n [styles['feedback-box__success']]: level === 'success',\n [styles['feedback-box__warning']]: level === 'warning',\n [styles['feedback-box__error']]: level === 'error',\n })}\n id={id}\n >\n <Icon name={LEVEL_ICON_MAP[level]} size={16} />\n {feedback}\n </div>\n);\n"],"names":["LEVEL_ICON_MAP","FeedbackBox","id","level","feedback","jsxs","clsx","styles","jsx","Icon"],"mappings":";;;;;;;;GAUMA,IAA2D;AAAA,EAC/D,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GAYaC,IAAc,CAAC,EAAE,IAAAC,GAAI,OAAAC,GAAO,UAAAC,EACvC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAKC,EAAO,cAAc,GAAG;AAAA,MACtC,CAACA,EAAO,uBAAuB,CAAC,GAAGJ,MAAU;AAAA,MAC7C,CAACI,EAAO,uBAAuB,CAAC,GAAGJ,MAAU;AAAA,MAC7C,CAACI,EAAO,qBAAqB,CAAC,GAAGJ,MAAU;AAAA,IAAA,CAC5C;AAAA,IACD,IAAAD;AAAA,IAEA,UAAA;AAAA,MAAA,gBAAAM,EAACC,KAAK,MAAMT,EAAeG,CAAK,GAAG,MAAM,IAAI;AAAA,MAC5CC;AAAA,IAAA;AAAA,EAAA;AACH;"}
1
+ {"version":3,"file":"FeedbackBox.js","sources":["../../../src/components/FeedbackBox/FeedbackBox.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport type { ReactElement } from 'react';\nimport type { IconProps } from 'components/Icon';\n\nimport styles from './FeedbackBox.module.css';\n\nimport { Icon } from 'components/Icon';\n\ntype FeedbackLevel = 'success' | 'warning' | 'error';\n\nconst LEVEL_ICON_MAP: Record<FeedbackLevel, IconProps['name']> = {\n success: 'CheckCircle',\n warning: 'ExclamationCircle',\n error: 'ExclamationTriangleMini',\n};\n\nexport interface FeedbackBoxProps {\n /** The id of the element. */\n id?: string;\n /** The feedback level, indicates what icon is used. */\n level: FeedbackLevel;\n /** The feedback value. */\n feedback: string | ReactElement;\n}\n\n/** Represents a component to show feedback. */\nexport const FeedbackBox = ({ id, level, feedback }: FeedbackBoxProps) => (\n <div\n className={clsx(styles['feedback-box'], {\n [styles['feedback-box__success']]: level === 'success',\n [styles['feedback-box__warning']]: level === 'warning',\n [styles['feedback-box__error']]: level === 'error',\n })}\n id={id}\n >\n <Icon name={LEVEL_ICON_MAP[level]} size={16} />\n {feedback}\n </div>\n);\n"],"names":["LEVEL_ICON_MAP","FeedbackBox","id","level","feedback","jsxs","clsx","styles","jsx","Icon"],"mappings":";;;;;;;;GAWMA,IAA2D;AAAA,EAC/D,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACT,GAYaC,IAAc,CAAC,EAAE,IAAAC,GAAI,OAAAC,GAAO,UAAAC,EACvC,MAAA,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAKC,EAAO,cAAc,GAAG;AAAA,MACtC,CAACA,EAAO,uBAAuB,CAAC,GAAGJ,MAAU;AAAA,MAC7C,CAACI,EAAO,uBAAuB,CAAC,GAAGJ,MAAU;AAAA,MAC7C,CAACI,EAAO,qBAAqB,CAAC,GAAGJ,MAAU;AAAA,IAAA,CAC5C;AAAA,IACD,IAAAD;AAAA,IAEA,UAAA;AAAA,MAAA,gBAAAM,EAACC,KAAK,MAAMT,EAAeG,CAAK,GAAG,MAAM,IAAI;AAAA,MAC5CC;AAAA,IAAA;AAAA,EAAA;AACH;"}
@@ -3,3 +3,4 @@ import { FeedbackBoxProps } from './FeedbackBox';
3
3
  declare const _default: Meta<FeedbackBoxProps>;
4
4
  export default _default;
5
5
  export declare const FeedbackBoxExample: import('@storybook/core/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FeedbackBoxProps>;
6
+ export declare const WithElementFeedback: import('@storybook/core/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, FeedbackBoxProps>;
@@ -1,21 +1,36 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { FeedbackBox as e } from "./FeedbackBox.js";
3
- import { Container as c } from "../../storyComponents/Container/Container.js";
4
- const a = "<FeedbackBox id={id} level={level} feedback={feedback} />", i = {
1
+ import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
+ import { FeedbackBox as c } from "./FeedbackBox.js";
3
+ import { Container as o } from "../../storyComponents/Container/Container.js";
4
+ import { Repeater as t } from "../Repeater/Repeater.js";
5
+ const i = "<FeedbackBox id={id} level={level} feedback={feedback} />", p = {
5
6
  title: "Molecules/FeedbackBox",
6
- component: e,
7
+ component: c,
7
8
  parameters: {
8
- inspectComponent: e,
9
- codeString: a
9
+ inspectComponent: c,
10
+ codeString: i
10
11
  }
11
- }, d = (t) => /* @__PURE__ */ o(c, { children: /* @__PURE__ */ o(e, { ...t }) }), s = d.bind({});
12
- s.args = {
12
+ }, a = (l) => /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(c, { ...l }) }), n = a.bind({});
13
+ n.args = {
13
14
  id: "gba0d2d4",
14
15
  level: "success",
15
16
  feedback: "Example FeedbackBox text"
16
17
  };
18
+ const r = a.bind({});
19
+ r.args = {
20
+ id: "gba0d2d4",
21
+ level: "success",
22
+ feedback: /* @__PURE__ */ d(t, { children: [
23
+ /* @__PURE__ */ e("h2", { children: "FeedbackElement" }),
24
+ /* @__PURE__ */ d("ul", { children: [
25
+ /* @__PURE__ */ e("li", { children: "Feedback 1" }),
26
+ /* @__PURE__ */ e("li", { children: "Feedback 2" }),
27
+ /* @__PURE__ */ e("li", { children: "Feedback 3" })
28
+ ] })
29
+ ] })
30
+ };
17
31
  export {
18
- s as FeedbackBoxExample,
19
- i as default
32
+ n as FeedbackBoxExample,
33
+ r as WithElementFeedback,
34
+ p as default
20
35
  };
21
36
  //# sourceMappingURL=FeedbackBox.stories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackBox.stories.js","sources":["../../../src/components/FeedbackBox/FeedbackBox.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { FeedbackBoxProps } from './FeedbackBox';\n\nimport { FeedbackBox } from './FeedbackBox';\n\nimport { Container } from 'storyComponents/Container';\n\nconst codeString = '<FeedbackBox id={id} level={level} feedback={feedback} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Molecules/FeedbackBox',\n component: FeedbackBox,\n parameters: {\n inspectComponent: FeedbackBox,\n codeString,\n },\n} as Meta<FeedbackBoxProps>;\n\nconst Template: StoryFn<FeedbackBoxProps> = (args) => (\n <Container>\n <FeedbackBox {...args} />\n </Container>\n);\n\nexport const FeedbackBoxExample = Template.bind({});\nFeedbackBoxExample.args = {\n id: 'gba0d2d4',\n level: 'success',\n feedback: 'Example FeedbackBox text',\n};\n"],"names":["codeString","FeedbackBox_stories","FeedbackBox","Template","args","jsx","Container","FeedbackBoxExample"],"mappings":";;;AAOA,MAAMA,IAAa,6DAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EAAA;AAEJ,GAEMG,IAAsC,CAACC,MAC3C,gBAAAC,EAACC,KACC,UAAC,gBAAAD,EAAAH,GAAA,EAAa,GAAGE,EAAA,CAAM,EACzB,CAAA,GAGWG,IAAqBJ,EAAS,KAAK,CAAE,CAAA;AAClDI,EAAmB,OAAO;AAAA,EACxB,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,UAAU;AACZ;"}
1
+ {"version":3,"file":"FeedbackBox.stories.js","sources":["../../../src/components/FeedbackBox/FeedbackBox.stories.tsx"],"sourcesContent":["import type { Meta, StoryFn } from '@storybook/react';\nimport type { FeedbackBoxProps } from './FeedbackBox';\n\nimport { FeedbackBox } from './FeedbackBox';\n\nimport { Container } from 'storyComponents/Container';\nimport { Repeater } from 'components/Repeater';\n\nconst codeString = '<FeedbackBox id={id} level={level} feedback={feedback} />';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Molecules/FeedbackBox',\n component: FeedbackBox,\n parameters: {\n inspectComponent: FeedbackBox,\n codeString,\n },\n} as Meta<FeedbackBoxProps>;\n\nconst Template: StoryFn<FeedbackBoxProps> = (args) => (\n <Container>\n <FeedbackBox {...args} />\n </Container>\n);\n\nexport const FeedbackBoxExample = Template.bind({});\nFeedbackBoxExample.args = {\n id: 'gba0d2d4',\n level: 'success',\n feedback: 'Example FeedbackBox text',\n};\n\nexport const WithElementFeedback = Template.bind({});\nWithElementFeedback.args = {\n id: 'gba0d2d4',\n level: 'success',\n feedback: (\n <Repeater>\n <h2>FeedbackElement</h2>\n <ul>\n <li>Feedback 1</li>\n <li>Feedback 2</li>\n <li>Feedback 3</li>\n </ul>\n </Repeater>\n ),\n};\n"],"names":["codeString","FeedbackBox_stories","FeedbackBox","Template","args","jsx","Container","FeedbackBoxExample","WithElementFeedback","Repeater"],"mappings":";;;;AAQA,MAAMA,IAAa,6DAGJC,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,YAAY;AAAA,IACV,kBAAkBA;AAAA,IAClB,YAAAF;AAAA,EAAA;AAEJ,GAEMG,IAAsC,CAACC,MAC3C,gBAAAC,EAACC,KACC,UAAC,gBAAAD,EAAAH,GAAA,EAAa,GAAGE,EAAA,CAAM,EACzB,CAAA,GAGWG,IAAqBJ,EAAS,KAAK,CAAE,CAAA;AAClDI,EAAmB,OAAO;AAAA,EACxB,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,UAAU;AACZ;AAEO,MAAMC,IAAsBL,EAAS,KAAK,CAAE,CAAA;AACnDK,EAAoB,OAAO;AAAA,EACzB,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,4BACGC,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAJ,EAAC,QAAG,UAAe,kBAAA,CAAA;AAAA,sBAClB,MACC,EAAA,UAAA;AAAA,MAAA,gBAAAA,EAAC,QAAG,UAAU,aAAA,CAAA;AAAA,MACd,gBAAAA,EAAC,QAAG,UAAU,aAAA,CAAA;AAAA,MACd,gBAAAA,EAAC,QAAG,UAAU,aAAA,CAAA;AAAA,IAAA,EAChB,CAAA;AAAA,EAAA,EACF,CAAA;AAEJ;"}
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": "3.8.0",
5
+ "version": "3.9.0",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -64,9 +64,9 @@
64
64
  "@testing-library/jest-dom": "^6.6.3",
65
65
  "@testing-library/react": "^16.3.0",
66
66
  "@types/jest": "^29.5.14",
67
- "@types/node": "^22.14.0",
67
+ "@types/node": "^22.14.1",
68
68
  "@types/react-dom": "^19.1.2",
69
- "@types/react": "^19.1.0",
69
+ "@types/react": "^19.1.1",
70
70
  "@uva-glass/eslint-config": "^1.3.10",
71
71
  "@uva-glass/stylelint-config": "^1.2.2",
72
72
  "@vitejs/plugin-react": "^4.3.4",
@@ -80,7 +80,7 @@
80
80
  "jest-environment-jsdom": "^29.7.0",
81
81
  "jest-junit": "^16.0.0",
82
82
  "jest": "^29.7.0",
83
- "jsdom": "^26.0.0",
83
+ "jsdom": "^26.1.0",
84
84
  "npm-run-all2": "^7.0.2",
85
85
  "react-dom": "^18.3.1",
86
86
  "react-router": "^7.5.0",
@@ -112,9 +112,9 @@
112
112
  "lexical": "^0.30.0"
113
113
  },
114
114
  "optionalDependencies": {
115
- "@rollup/rollup-linux-x64-gnu": "^4.39.0",
115
+ "@rollup/rollup-linux-x64-gnu": "^4.40.0",
116
116
  "@rspack/binding-darwin-arm64": "1.3.4",
117
117
  "@rspack/binding-linux-x64-gnu": "1.3.4",
118
- "@ast-grep/napi-linux-x64-gnu": "0.36.2"
118
+ "@ast-grep/napi-linux-x64-gnu": "0.36.3"
119
119
  }
120
120
  }