@uva-glass/component-library 1.2.0 → 1.3.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.
@@ -35,6 +35,7 @@ const m = {
35
35
  }
36
36
  }, a = (e) => /* @__PURE__ */ t(o, { ...e }), l = a.bind({});
37
37
  l.args = {
38
+ "aria-label": "Trash",
38
39
  variant: "destructive",
39
40
  noBorder: !1,
40
41
  wide: !1,
@@ -1 +1 @@
1
- {"version":3,"file":"IconButton.stories.js","sources":["../../../src/components/IconButton/IconButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { IconButtonProps } from 'components/IconButton';\n\nimport { IconButton } from 'components/IconButton';\nimport { Icon } from 'components/Icon';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/IconButton',\n component: IconButton,\n argTypes: {\n variant: {\n options: ['destructive'],\n control: { type: 'check' },\n },\n noBorder: {\n control: 'boolean',\n default: false,\n },\n wide: {\n control: 'boolean',\n default: false,\n },\n 'aria-label': {\n table: {\n disable: true,\n },\n },\n type: {\n options: ['button', 'submit', 'reset'],\n control: { type: 'select' },\n },\n children: {\n table: {\n disable: true,\n },\n },\n },\n} as Meta<IconButtonProps>;\n\nconst Template: StoryFn<IconButtonProps> = (args) => <IconButton {...args} />;\n\nexport const IconButtonExample = Template.bind({});\nIconButtonExample.args = {\n variant: 'destructive',\n noBorder: false,\n wide: false,\n children: <Icon name=\"Trash\" />,\n onClick: fn(),\n};\n"],"names":["IconButton_stories","IconButton","Template","args","jsx","IconButtonExample","Icon","fn"],"mappings":";;;;AASA,MAAeA,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,aAAa;AAAA,MACvB,SAAS,EAAE,MAAM,QAAQ;AAAA,IAC3B;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,SAAS,CAAC,UAAU,UAAU,OAAO;AAAA,MACrC,SAAS,EAAE,MAAM,SAAS;AAAA,IAC5B;AAAA,IACA,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF,GAEMC,IAAqC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAY,GAAGE,EAAM,CAAA,GAE9DE,IAAoBH,EAAS,KAAK,EAAE;AACjDG,EAAkB,OAAO;AAAA,EACvB,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU,gBAAAD,EAACE,GAAK,EAAA,MAAK,QAAQ,CAAA;AAAA,EAC7B,SAASC,EAAG;AACd;"}
1
+ {"version":3,"file":"IconButton.stories.js","sources":["../../../src/components/IconButton/IconButton.stories.tsx"],"sourcesContent":["import { fn } from '@storybook/test';\n\nimport type { Meta, StoryFn } from '@storybook/react';\nimport type { IconButtonProps } from 'components/IconButton';\n\nimport { IconButton } from 'components/IconButton';\nimport { Icon } from 'components/Icon';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n title: 'Atoms/IconButton',\n component: IconButton,\n argTypes: {\n variant: {\n options: ['destructive'],\n control: { type: 'check' },\n },\n noBorder: {\n control: 'boolean',\n default: false,\n },\n wide: {\n control: 'boolean',\n default: false,\n },\n 'aria-label': {\n table: {\n disable: true,\n },\n },\n type: {\n options: ['button', 'submit', 'reset'],\n control: { type: 'select' },\n },\n children: {\n table: {\n disable: true,\n },\n },\n },\n} as Meta<IconButtonProps>;\n\nconst Template: StoryFn<IconButtonProps> = (args) => <IconButton {...args} />;\n\nexport const IconButtonExample = Template.bind({});\nIconButtonExample.args = {\n 'aria-label': 'Trash',\n variant: 'destructive',\n noBorder: false,\n wide: false,\n children: <Icon name=\"Trash\" />,\n onClick: fn(),\n};\n"],"names":["IconButton_stories","IconButton","Template","args","jsx","IconButtonExample","Icon","fn"],"mappings":";;;;AASA,MAAeA,IAAA;AAAA,EACb,OAAO;AAAA,EACP,WAAWC;AAAA,EACX,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS,CAAC,aAAa;AAAA,MACvB,SAAS,EAAE,MAAM,QAAQ;AAAA,IAC3B;AAAA,IACA,UAAU;AAAA,MACR,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS;AAAA,IACX;AAAA,IACA,cAAc;AAAA,MACZ,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,IACA,MAAM;AAAA,MACJ,SAAS,CAAC,UAAU,UAAU,OAAO;AAAA,MACrC,SAAS,EAAE,MAAM,SAAS;AAAA,IAC5B;AAAA,IACA,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AACF,GAEMC,IAAqC,CAACC,MAAU,gBAAAC,EAAAH,GAAA,EAAY,GAAGE,EAAM,CAAA,GAE9DE,IAAoBH,EAAS,KAAK,EAAE;AACjDG,EAAkB,OAAO;AAAA,EACvB,cAAc;AAAA,EACd,SAAS;AAAA,EACT,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU,gBAAAD,EAACE,GAAK,EAAA,MAAK,QAAQ,CAAA;AAAA,EAC7B,SAASC,EAAG;AACd;"}
@@ -3,15 +3,15 @@ import { jsx as e } from "react/jsx-runtime";
3
3
  import { useState as i } from "react";
4
4
  const C = {
5
5
  "clipboard-button": "_clipboard-button_1ihmb_1"
6
- }, n = 2e3, c = ({ text: l }) => {
7
- const [o, t] = i(!1);
6
+ }, n = 2e3, a = ({ text: o }) => {
7
+ const [l, t] = i(!1);
8
8
  return /* @__PURE__ */ e("div", { style: { position: "relative" }, children: /* @__PURE__ */ e("button", { onClick: () => {
9
- o || navigator.clipboard.writeText(l).then(() => {
9
+ l || navigator.clipboard.writeText(o).then(() => {
10
10
  t(!0), setTimeout(() => {
11
11
  t(!1);
12
12
  }, n);
13
13
  });
14
- }, className: C["clipboard-button"], children: /* @__PURE__ */ e(
14
+ }, className: C["clipboard-button"], "aria-label": `Copy ${o}`, children: /* @__PURE__ */ e(
15
15
  "svg",
16
16
  {
17
17
  width: "15",
@@ -20,7 +20,7 @@ const C = {
20
20
  fill: "none",
21
21
  xmlns: "http://www.w3.org/2000/svg",
22
22
  className: "h-3 w-3",
23
- children: o ? /* @__PURE__ */ e(
23
+ children: l ? /* @__PURE__ */ e(
24
24
  "path",
25
25
  {
26
26
  d: "M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",
@@ -41,6 +41,6 @@ const C = {
41
41
  ) }) });
42
42
  };
43
43
  export {
44
- c as ClipboardButton
44
+ a as ClipboardButton
45
45
  };
46
46
  //# sourceMappingURL=ClipboardButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClipboardButton.js","sources":["../../../../src/components/storyComponents/ClipboardButton/ClipboardButton.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport styles from './ClipboardButton.module.css';\n\ninterface ClipboardButtonProps {\n text: string;\n}\n\nconst DELAY = 2000;\n\nexport const ClipboardButton = ({ text }: ClipboardButtonProps) => {\n const [isCopied, setIsCopied] = useState(false);\n\n const handleCopyClick = () => {\n if (!isCopied) {\n void navigator.clipboard.writeText(text).then(() => {\n setIsCopied(true);\n setTimeout(() => {\n setIsCopied(false);\n }, DELAY);\n });\n }\n };\n\n return (\n <div style={{ position: 'relative' }}>\n <button onClick={handleCopyClick} className={styles['clipboard-button']}>\n <svg\n width=\"15\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-3 w-3\"\n >\n {isCopied ? (\n <path\n d=\"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n ) : (\n <path\n d=\"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n )}\n </svg>\n </button>\n </div>\n );\n};\n"],"names":["DELAY","ClipboardButton","text","isCopied","setIsCopied","useState","jsx","styles"],"mappings":";;;;GAQMA,IAAQ,KAEDC,IAAkB,CAAC,EAAE,MAAAC,QAAiC;AACjE,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAK;AAa9C,SACG,gBAAAC,EAAA,OAAA,EAAI,OAAO,EAAE,UAAU,WAAW,GACjC,UAAC,gBAAAA,EAAA,UAAA,EAAO,SAbY,MAAM;AAC5B,IAAKH,KACE,UAAU,UAAU,UAAUD,CAAI,EAAE,KAAK,MAAM;AAClD,MAAAE,EAAY,EAAI,GAChB,WAAW,MAAM;AACf,QAAAA,EAAY,EAAK;AAAA,SAChBJ,CAAK;AAAA,IAAA,CACT;AAAA,EACH,GAKoC,WAAWO,EAAO,kBAAkB,GACpE,UAAA,gBAAAD;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,OAAM;AAAA,MACN,WAAU;AAAA,MAET,UACCH,IAAA,gBAAAG;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,MAAK;AAAA,UACL,UAAS;AAAA,UACT,UAAS;AAAA,QAAA;AAAA,MAAA,IAGX,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,MAAK;AAAA,UACL,UAAS;AAAA,UACT,UAAS;AAAA,QAAA;AAAA,MACX;AAAA,IAAA;AAAA,EAAA,EAGN,CAAA,EACF,CAAA;AAEJ;"}
1
+ {"version":3,"file":"ClipboardButton.js","sources":["../../../../src/components/storyComponents/ClipboardButton/ClipboardButton.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport styles from './ClipboardButton.module.css';\n\ninterface ClipboardButtonProps {\n text: string;\n}\n\nconst DELAY = 2000;\n\nexport const ClipboardButton = ({ text }: ClipboardButtonProps) => {\n const [isCopied, setIsCopied] = useState(false);\n\n const handleCopyClick = () => {\n if (!isCopied) {\n void navigator.clipboard.writeText(text).then(() => {\n setIsCopied(true);\n setTimeout(() => {\n setIsCopied(false);\n }, DELAY);\n });\n }\n };\n\n return (\n <div style={{ position: 'relative' }}>\n <button onClick={handleCopyClick} className={styles['clipboard-button']} aria-label={`Copy ${text}`}>\n <svg\n width=\"15\"\n height=\"15\"\n viewBox=\"0 0 15 15\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-3 w-3\"\n >\n {isCopied ? (\n <path\n d=\"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n ) : (\n <path\n d=\"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z\"\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n />\n )}\n </svg>\n </button>\n </div>\n );\n};\n"],"names":["DELAY","ClipboardButton","text","isCopied","setIsCopied","useState","jsx","styles"],"mappings":";;;;GAQMA,IAAQ,KAEDC,IAAkB,CAAC,EAAE,MAAAC,QAAiC;AACjE,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAK;AAa9C,2BACG,OAAI,EAAA,OAAO,EAAE,UAAU,cACtB,UAAC,gBAAAC,EAAA,UAAA,EAAO,SAbY,MAAM;AAC5B,IAAKH,KACE,UAAU,UAAU,UAAUD,CAAI,EAAE,KAAK,MAAM;AAClD,MAAAE,EAAY,EAAI,GAChB,WAAW,MAAM;AACf,QAAAA,EAAY,EAAK;AAAA,SAChBJ,CAAK;AAAA,IAAA,CACT;AAAA,EACH,GAKoC,WAAWO,EAAO,kBAAkB,GAAG,cAAY,QAAQL,CAAI,IAC/F,UAAA,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,OAAM;AAAA,MACN,WAAU;AAAA,MAET,UACCH,IAAA,gBAAAG;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,MAAK;AAAA,UACL,UAAS;AAAA,UACT,UAAS;AAAA,QAAA;AAAA,MAAA,IAGX,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,MAAK;AAAA,UACL,UAAS;AAAA,UACT,UAAS;AAAA,QAAA;AAAA,MACX;AAAA,IAAA;AAAA,EAAA,EAGN,CAAA,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": "1.2.0",
5
+ "version": "1.3.0",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -44,6 +44,7 @@
44
44
  "@semantic-release/git": "^10.0.1",
45
45
  "@semantic-release/gitlab": "^13.0.4",
46
46
  "@semantic-release/npm": "^12.0.0",
47
+ "@storybook/addon-a11y": "^8.0.9",
47
48
  "@storybook/addon-essentials": "^8.0.9",
48
49
  "@storybook/addon-interactions": "^8.0.9",
49
50
  "@storybook/addon-links": "^8.0.9",
@@ -54,8 +55,8 @@
54
55
  "@types/node": "^20.12.7",
55
56
  "@types/react": "^18.3.1",
56
57
  "@types/react-dom": "^18.3.0",
57
- "@typescript-eslint/eslint-plugin": "^7.7.1",
58
- "@typescript-eslint/parser": "^7.7.1",
58
+ "@typescript-eslint/eslint-plugin": "^7.8.0",
59
+ "@typescript-eslint/parser": "^7.8.0",
59
60
  "@uva-glass/eslint-config": "^1.2.0",
60
61
  "@uva-glass/stylelint-config": "^1.1.0",
61
62
  "@vitejs/plugin-react": "^4.2.1",