@dracor/react 0.7.0 → 0.8.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.
Files changed (65) hide show
  1. package/dist/cjs/index.js +235 -10
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/components/Authors/Authors.d.ts +10 -0
  4. package/dist/cjs/types/components/Authors/Authors.stories.d.ts +12 -0
  5. package/dist/cjs/types/components/Authors/Authors.test.d.ts +1 -0
  6. package/dist/cjs/types/components/Authors/index.d.ts +1 -0
  7. package/dist/cjs/types/components/DebouncedInput/DebouncedInput.d.ts +6 -0
  8. package/dist/cjs/types/components/DebouncedInput/index.d.ts +1 -0
  9. package/dist/cjs/types/components/IdCopy/IdCopy.d.ts +8 -0
  10. package/dist/cjs/types/components/IdCopy/IdCopy.stories.d.ts +11 -0
  11. package/dist/cjs/types/components/IdCopy/IdCopy.test.d.ts +1 -0
  12. package/dist/cjs/types/components/IdCopy/index.d.ts +1 -0
  13. package/dist/cjs/types/components/IdLink/IdLink.d.ts +7 -0
  14. package/dist/cjs/types/components/IdLink/IdLink.stories.d.ts +15 -0
  15. package/dist/cjs/types/components/IdLink/IdLink.test.d.ts +1 -0
  16. package/dist/cjs/types/components/IdLink/index.d.ts +1 -0
  17. package/dist/cjs/types/components/Table/Table.d.ts +11 -0
  18. package/dist/cjs/types/components/Table/Table.stories.d.ts +9 -0
  19. package/dist/cjs/types/components/Table/Table.test.d.ts +1 -0
  20. package/dist/cjs/types/components/Table/index.d.ts +1 -0
  21. package/dist/cjs/types/components/Tabs/Tabs.d.ts +11 -0
  22. package/dist/cjs/types/components/Tabs/Tabs.stories.d.ts +16 -0
  23. package/dist/cjs/types/components/Tabs/Tabs.test.d.ts +1 -0
  24. package/dist/cjs/types/components/Tabs/index.d.ts +1 -0
  25. package/dist/cjs/types/components/Years/Years.d.ts +10 -0
  26. package/dist/cjs/types/components/Years/Years.stories.d.ts +11 -0
  27. package/dist/cjs/types/components/Years/Years.test.d.ts +1 -0
  28. package/dist/cjs/types/components/Years/index.d.ts +1 -0
  29. package/dist/cjs/types/components/index.d.ts +8 -1
  30. package/dist/cjs/types/index.d.ts +1 -0
  31. package/dist/cjs/types/utils.d.ts +2 -0
  32. package/dist/esm/index.js +227 -11
  33. package/dist/esm/index.js.map +1 -1
  34. package/dist/esm/types/components/Authors/Authors.d.ts +10 -0
  35. package/dist/esm/types/components/Authors/Authors.stories.d.ts +12 -0
  36. package/dist/esm/types/components/Authors/Authors.test.d.ts +1 -0
  37. package/dist/esm/types/components/Authors/index.d.ts +1 -0
  38. package/dist/esm/types/components/DebouncedInput/DebouncedInput.d.ts +6 -0
  39. package/dist/esm/types/components/DebouncedInput/index.d.ts +1 -0
  40. package/dist/esm/types/components/IdCopy/IdCopy.d.ts +8 -0
  41. package/dist/esm/types/components/IdCopy/IdCopy.stories.d.ts +11 -0
  42. package/dist/esm/types/components/IdCopy/IdCopy.test.d.ts +1 -0
  43. package/dist/esm/types/components/IdCopy/index.d.ts +1 -0
  44. package/dist/esm/types/components/IdLink/IdLink.d.ts +7 -0
  45. package/dist/esm/types/components/IdLink/IdLink.stories.d.ts +15 -0
  46. package/dist/esm/types/components/IdLink/IdLink.test.d.ts +1 -0
  47. package/dist/esm/types/components/IdLink/index.d.ts +1 -0
  48. package/dist/esm/types/components/Table/Table.d.ts +11 -0
  49. package/dist/esm/types/components/Table/Table.stories.d.ts +9 -0
  50. package/dist/esm/types/components/Table/Table.test.d.ts +1 -0
  51. package/dist/esm/types/components/Table/index.d.ts +1 -0
  52. package/dist/esm/types/components/Tabs/Tabs.d.ts +11 -0
  53. package/dist/esm/types/components/Tabs/Tabs.stories.d.ts +16 -0
  54. package/dist/esm/types/components/Tabs/Tabs.test.d.ts +1 -0
  55. package/dist/esm/types/components/Tabs/index.d.ts +1 -0
  56. package/dist/esm/types/components/Years/Years.d.ts +10 -0
  57. package/dist/esm/types/components/Years/Years.stories.d.ts +11 -0
  58. package/dist/esm/types/components/Years/Years.test.d.ts +1 -0
  59. package/dist/esm/types/components/Years/index.d.ts +1 -0
  60. package/dist/esm/types/components/index.d.ts +8 -1
  61. package/dist/esm/types/index.d.ts +1 -0
  62. package/dist/esm/types/utils.d.ts +2 -0
  63. package/dist/index.d.ts +71 -7
  64. package/package.json +7 -1
  65. package/tailwind.js +5 -0
@@ -0,0 +1 @@
1
+ export { default } from './IdLink';
@@ -0,0 +1,11 @@
1
+ import { ColumnDef, SortDirection, SortingState } from '@tanstack/react-table';
2
+ export interface Props {
3
+ data: any[];
4
+ columns: ColumnDef<any>[];
5
+ defaultSort?: SortingState;
6
+ }
7
+ declare const Table: ({ columns, data: initialData, defaultSort }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default Table;
9
+ export declare function SortIndicator({ status }: {
10
+ status: false | SortDirection;
11
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ columns, data: initialData, defaultSort }: import("./Table").Props) => import("react/jsx-runtime").JSX.Element;
5
+ tags: string[];
6
+ };
7
+ export default meta;
8
+ type Story = StoryObj<typeof meta>;
9
+ export declare const Basic: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './Table';
@@ -0,0 +1,11 @@
1
+ interface TabData {
2
+ label: string;
3
+ href: string;
4
+ active?: boolean;
5
+ }
6
+ export interface Props {
7
+ data: TabData[];
8
+ }
9
+ export default function Tabs({ data: tabs }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export declare function linkClasses(active: boolean): string;
11
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import Tabs from './Tabs';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Tabs;
6
+ tags: string[];
7
+ decorators: import("@storybook/preview-api/dist/storybook-channel-mock-a19cd233").M[];
8
+ parameters: {
9
+ reactRouter: {
10
+ routePath: string;
11
+ };
12
+ };
13
+ };
14
+ export default meta;
15
+ type Story = StoryObj<typeof meta>;
16
+ export declare const Basic: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './Tabs';
@@ -0,0 +1,10 @@
1
+ export interface Props {
2
+ written?: number;
3
+ premiere?: number;
4
+ print?: number;
5
+ locale?: string;
6
+ labelWritten?: string;
7
+ labelPremiered?: string;
8
+ labelPrinted?: string;
9
+ }
10
+ export default function Years({ written, premiere, print, locale, labelPremiered, labelPrinted, labelWritten, }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import Years from './Years';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Years;
6
+ tags: string[];
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Basic: Story;
11
+ export declare const German: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './Years';
@@ -1,2 +1,9 @@
1
- export { default as NavBar } from './Navigation';
2
1
  export { default as ApiDoc } from './ApiDoc';
2
+ export { default as Authors } from './Authors';
3
+ export { default as DebouncedInput } from './DebouncedInput';
4
+ export { default as IdCopy } from './IdCopy';
5
+ export { default as IdLink } from './IdLink';
6
+ export { default as NavBar } from './Navigation';
7
+ export { default as Table } from './Table';
8
+ export { default as Tabs } from './Tabs';
9
+ export { default as Years } from './Years';
@@ -1 +1,2 @@
1
1
  export * from './components';
2
+ export * from './utils';
@@ -0,0 +1,2 @@
1
+ export declare function formatEra(year: string, ceBefore?: number): string;
2
+ export declare function formatYear(year: number | string, locale?: string): string;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,46 @@
1
1
  /// <reference types="react" />
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ColumnDef, SortingState } from '@tanstack/react-table';
3
4
 
4
- interface Props$2 {
5
+ interface Props$8 {
6
+ url: string;
7
+ title?: string;
8
+ }
9
+ declare function ApiDoc({ url, title }: Props$8): react_jsx_runtime.JSX.Element;
10
+
11
+ interface Author {
12
+ name: string;
13
+ pseudonym?: string;
14
+ ref?: string;
15
+ }
16
+ interface Props$7 {
17
+ data: Author[];
18
+ }
19
+ declare const Authors: ({ data }: Props$7) => react_jsx_runtime.JSX.Element;
20
+
21
+ declare function DebouncedInput({ value: initialValue, onChange, debounce, ...props }: {
22
+ value: string | number;
23
+ onChange: (value: string | number) => void;
24
+ debounce?: number;
25
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'>): react_jsx_runtime.JSX.Element;
26
+
27
+ interface Props$6 {
28
+ children: string;
29
+ prefix?: string;
30
+ uri?: string;
31
+ className?: string;
32
+ }
33
+ declare function IdCopy({ children, className, uri, prefix }: Props$6): react_jsx_runtime.JSX.Element;
34
+
35
+ interface Props$5 {
36
+ button?: boolean;
37
+ showLabel?: boolean;
38
+ className?: string;
39
+ children: string;
40
+ }
41
+ declare function IdLink({ showLabel, children, className }: Props$5): react_jsx_runtime.JSX.Element;
42
+
43
+ interface Props$4 {
5
44
  label: string;
6
45
  href: string;
7
46
  active?: boolean;
@@ -13,7 +52,7 @@ interface Item {
13
52
  href: string;
14
53
  selected?: boolean;
15
54
  }
16
- interface Props$1 {
55
+ interface Props$3 {
17
56
  label: string;
18
57
  items: Item[];
19
58
  menuClass?: string;
@@ -26,14 +65,39 @@ interface NavBarProps {
26
65
  version?: string;
27
66
  gitHubUrl?: string;
28
67
  gitHubIcon?: JSX.Element;
29
- navItems?: (Props$2 | Props$1)[];
68
+ navItems?: (Props$4 | Props$3)[];
30
69
  }
31
70
  declare function NavBar({ title, logo, logoClass, version, gitHubUrl, gitHubIcon, navItems }: NavBarProps): react_jsx_runtime.JSX.Element;
32
71
 
72
+ interface Props$2 {
73
+ data: any[];
74
+ columns: ColumnDef<any>[];
75
+ defaultSort?: SortingState;
76
+ }
77
+ declare const Table: ({ columns, data: initialData, defaultSort }: Props$2) => react_jsx_runtime.JSX.Element;
78
+
79
+ interface TabData {
80
+ label: string;
81
+ href: string;
82
+ active?: boolean;
83
+ }
84
+ interface Props$1 {
85
+ data: TabData[];
86
+ }
87
+ declare function Tabs({ data: tabs }: Props$1): react_jsx_runtime.JSX.Element;
88
+
33
89
  interface Props {
34
- url: string;
35
- title?: string;
90
+ written?: number;
91
+ premiere?: number;
92
+ print?: number;
93
+ locale?: string;
94
+ labelWritten?: string;
95
+ labelPremiered?: string;
96
+ labelPrinted?: string;
36
97
  }
37
- declare function ApiDoc({ url, title }: Props): react_jsx_runtime.JSX.Element;
98
+ declare function Years({ written, premiere, print, locale, labelPremiered, labelPrinted, labelWritten, }: Props): react_jsx_runtime.JSX.Element;
99
+
100
+ declare function formatEra(year: string, ceBefore?: number): string;
101
+ declare function formatYear(year: number | string, locale?: string): string;
38
102
 
39
- export { ApiDoc, NavBar };
103
+ export { ApiDoc, Authors, DebouncedInput, IdCopy, IdLink, NavBar, Table, Tabs, Years, formatEra, formatYear };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dracor/react",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "DraCor react component library",
5
5
  "repository": "https://github.com/dracor-org/dracor-react",
6
6
  "homepage": "https://github.com/dracor-org/dracor-react#readme",
@@ -44,9 +44,11 @@
44
44
  "@storybook/react": "^7.0.27",
45
45
  "@storybook/react-vite": "^7.0.27",
46
46
  "@storybook/testing-library": "^0.2.0",
47
+ "@tanstack/react-table": "^8.9.3",
47
48
  "@testing-library/react": "^14.0.0",
48
49
  "@types/jest": "^29.5.2",
49
50
  "@types/react": "^18.2.14",
51
+ "@types/react-copy-to-clipboard": "^5.0.4",
50
52
  "@types/swagger-ui-react": "^4.18.0",
51
53
  "autoprefixer": "^10.4.14",
52
54
  "babel-jest": "^29.5.0",
@@ -55,6 +57,7 @@
55
57
  "postcss": "^8.4.25",
56
58
  "prop-types": "^15.8.1",
57
59
  "react": "^18.2.0",
60
+ "react-copy-to-clipboard": "^5.1.0",
58
61
  "react-dom": "^18.2.0",
59
62
  "react-helmet-async": "^1.3.0",
60
63
  "react-router-dom": "^6.14.1",
@@ -75,7 +78,10 @@
75
78
  "@fortawesome/free-solid-svg-icons": "^6.4.0",
76
79
  "@fortawesome/react-fontawesome": "^0.2.0",
77
80
  "@headlessui/react": "^1.7.15",
81
+ "@tanstack/react-table": "^8.9.3",
82
+ "@types/react-copy-to-clipboard": "^5.0.4",
78
83
  "react": "^18.2.0",
84
+ "react-copy-to-clipboard": "^5.1.0",
79
85
  "react-helmet-async": "^1.3.0",
80
86
  "react-router-dom": "^6.14.1",
81
87
  "swagger-ui-react": "^5.1.3",
package/tailwind.js CHANGED
@@ -44,6 +44,11 @@ const config = {
44
44
  height: {
45
45
  'calc-full-0.75': 'calc(100% - 0.75rem)',
46
46
  },
47
+ backgroundImage: {
48
+ wikidata: `url("data:image/svg+xml,%3Csvg version='1.1' id='Ebene_1' xmlns:svg='http://www.w3.org/2000/svg' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 810 500' style='enable-background:new 0 0 810 500;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%23990000;%7D .st1%7Bfill:%23339966;%7D .st2%7Bfill:%23006699;%7D%3C/style%3E%3Cpath class='st0' d='M0,500h30V0H0V500z M60,500h90V0H60V500z M180,0v500h90V0H180z'/%3E%3Cpath class='st1' d='M720,500h30V0h-30V500z M780,0v500h30V0H780z M300,500h30V0h-30V500z M360,0v500h30V0H360z'/%3E%3Cpath class='st2' d='M420,500h90V0h-90V500z M540,500h30V0h-30V500z M600,0v500h90V0H600z'/%3E%3C/svg%3E%0A")`,
49
+ dracor: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 384 384'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:none;%7D.cls-2%7Bclip-path:url(%23clip-path);%7D.cls-3%7Bfill:%231f2447;%7D%3C/style%3E%3CclipPath id='clip-path' transform='translate(0 0)'%3E%3Crect class='cls-1' width='384' height='384'/%3E%3C/clipPath%3E%3C/defs%3E%3Ctitle%3EDraCor-Symbol-Square-Blue%3C/title%3E%3Cg id='Layer_2' data-name='Layer 2'%3E%3Cg id='Layer_1-2' data-name='Layer 1'%3E%3Cg id='Vektor-Smartobjekt'%3E%3Cg class='cls-2'%3E%3Cg class='cls-2'%3E%3Cpath class='cls-3' d='M378.47,146A192.23,192.23,0,0,0,192,0H0V384H192A192.23,192.23,0,0,0,378.47,238.05a194.5,194.5,0,0,0,0-92.1M192,347.51H36.49V210.25H71.6a121.84,121.84,0,0,0,233.18,27.8h-41a85.29,85.29,0,1,1-11.51-106.34A86.09,86.09,0,0,1,263.8,146h41A121.81,121.81,0,0,0,71.6,173.76H36.49V36.49H192c69.73,0,128.88,46.12,148.55,109.46q2.13,6.84,3.62,13.91c1,4.56,1.73,9.2,2.27,13.9H240.84a50.2,50.2,0,0,0-2.38-5.43c-.48-.94-1-1.86-1.54-2.77a50.8,50.8,0,0,0-3.89-5.7,49.82,49.82,0,0,0-4.17-4.71,52,52,0,0,0-61.31-9.2c-1.14.6-2.26,1.26-3.35,2a51.23,51.23,0,0,0-9,7.25,52.09,52.09,0,0,0,0,73.71,51.17,51.17,0,0,0,9,7.24l3.34,2a52.07,52.07,0,0,0,61.32-9.19,50,50,0,0,0,4.18-4.72,52.26,52.26,0,0,0,3.47-5c.7-1.14,1.35-2.3,2-3.49a48.31,48.31,0,0,0,2.38-5.43h105.6c-.54,4.7-1.31,9.34-2.27,13.9q-1.49,7.08-3.62,13.91C320.88,301.39,261.73,347.51,192,347.51' transform='translate(0 0)'/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`,
50
+ wega: `url("data:image/svg+xml,%3C%3Fxml version='1.0' standalone='no'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 20010904//EN' 'http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd'%3E%3Csvg version='1.0' xmlns='http://www.w3.org/2000/svg' width='70.000000pt' height='70.000000pt' viewBox='0 0 70.000000 70.000000' preserveAspectRatio='xMidYMid meet'%3E%3Cmetadata%3E%0ACreated by potrace 1.11, written by Peter Selinger 2001-2013%0A%3C/metadata%3E%3Cg transform='translate(0.000000,70.000000) scale(0.100000,-0.100000)'%0Afill='%230064b4' stroke='none'%3E%3Cpath d='M223 664 c-29 -19 -53 -39 -53 -44 0 -5 -11 -26 -25 -46 -14 -21 -23%0A-44 -20 -51 2 -8 -3 -25 -12 -39 -13 -21 -14 -29 -4 -52 7 -15 19 -34 27 -42%0A8 -8 29 -37 46 -63 l31 -48 -19 -40 c-9 -22 -42 -63 -73 -91 l-55 -50 23 -44%0A24 -44 87 0 87 0 -27 115 c-19 82 -23 112 -14 104 20 -17 17 2 -6 31 -11 14%0A-20 35 -20 47 0 12 -7 43 -16 69 -12 36 -13 48 -4 54 7 4 9 13 5 19 -4 7 -1%0A18 5 26 7 8 10 24 7 35 -3 10 2 25 10 31 8 7 12 21 10 31 -4 15 1 18 38 18 52%0A0 90 -15 128 -49 37 -34 36 -61 -3 -61 -38 0 -53 -27 -48 -93 3 -50 2 -52 -22%0A-49 -24 2 -24 2 -5 -12 27 -19 57 -3 50 27 -12 59 -11 72 12 72 28 0 41 14 23%0A25 -13 8 -13 10 1 10 27 0 31 -66 8 -140 -20 -65 -51 -110 -76 -110 -7 0 -13%0A-4 -13 -10 0 -15 23 -12 48 6 26 18 26 29 2 -110 -15 -92 -20 -86 75 -86 l86%0A0 20 47 20 47 -65 58 c-77 69 -98 116 -76 169 8 17 22 39 32 49 11 10 20 25%0A22 33 1 8 8 22 15 31 17 20 5 73 -19 81 -10 3 -21 16 -24 29 -3 12 -13 32 -23%0A44 -10 12 -26 33 -36 47 -10 14 -26 25 -36 25 -9 0 -26 7 -37 15 -29 22 -54%0A18 -111 -21z'/%3E%3Cpath d='M246 475 c-22 -17 -20 -28 2 -16 10 6 28 7 40 4 12 -3 22 -1 22 5 0%0A15 -45 20 -64 7z'/%3E%3Cpath d='M252 437 c-10 -11 -5 -14 24 -15 24 -1 34 3 31 11 -5 17 -42 20 -55%0A4z'/%3E%3Cpath d='M299 289 c-9 -6 1 -9 29 -9 24 0 41 4 38 9 -7 11 -50 11 -67 0z'/%3E%3Cpath d='M315 260 c3 -5 15 -10 26 -10 10 0 19 5 19 10 0 6 -12 10 -26 10 -14%0A0 -23 -4 -19 -10z'/%3E%3C/g%3E%3C/svg%3E")`
51
+ },
47
52
  },
48
53
  },
49
54
  }