@dracor/react 1.0.0-beta.5 → 1.0.0-rc.3

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 (53) hide show
  1. package/dist/Theme.d.ts +12 -0
  2. package/dist/components/ApiDoc/ApiDoc.d.ts +26 -0
  3. package/dist/components/ApiDoc/index.d.ts +1 -0
  4. package/dist/components/AuthorInfo/AuthorInfo.d.ts +8 -0
  5. package/dist/components/AuthorInfo/index.d.ts +1 -0
  6. package/dist/components/Authors/Authors.d.ts +10 -0
  7. package/dist/components/Authors/index.d.ts +1 -0
  8. package/dist/components/DebouncedInput/DebouncedInput.d.ts +5 -0
  9. package/dist/components/DebouncedInput/index.d.ts +1 -0
  10. package/dist/components/DocPage/DocPage.d.ts +5 -0
  11. package/dist/components/DocPage/index.d.ts +1 -0
  12. package/dist/components/DownloadButton/DownloadButton.d.ts +22 -0
  13. package/dist/components/DownloadButton/index.d.ts +1 -0
  14. package/dist/components/IdCopy/IdCopy.d.ts +9 -0
  15. package/dist/components/IdCopy/index.d.ts +1 -0
  16. package/dist/components/IdLink/IdLink.d.ts +7 -0
  17. package/dist/components/IdLink/index.d.ts +1 -0
  18. package/dist/components/LanguageMenu/LanguageMenu.d.ts +6 -0
  19. package/dist/components/LanguageMenu/index.d.ts +1 -0
  20. package/dist/components/Navigation/NavBar.d.ts +15 -0
  21. package/dist/components/Navigation/NavItem.d.ts +6 -0
  22. package/dist/components/Navigation/NavMenu.d.ts +11 -0
  23. package/dist/components/Navigation/index.d.ts +1 -0
  24. package/dist/components/TEIText/TEIText.d.ts +13 -0
  25. package/dist/components/TEIText/index.d.ts +1 -0
  26. package/dist/components/Table/Table.d.ts +11 -0
  27. package/dist/components/Table/index.d.ts +1 -0
  28. package/dist/components/Tabs/Tabs.d.ts +9 -0
  29. package/dist/components/Tabs/index.d.ts +1 -0
  30. package/dist/components/Years/Years.d.ts +10 -0
  31. package/dist/components/Years/index.d.ts +1 -0
  32. package/dist/components/icons/Bibtex.d.ts +3 -0
  33. package/dist/components/icons/Csv.d.ts +3 -0
  34. package/dist/components/icons/Dracor.d.ts +3 -0
  35. package/dist/components/icons/Ein.d.ts +3 -0
  36. package/dist/components/icons/Gexf.d.ts +3 -0
  37. package/dist/components/icons/Graphml.d.ts +3 -0
  38. package/dist/components/icons/Json.d.ts +3 -0
  39. package/dist/components/icons/Rdf.d.ts +3 -0
  40. package/dist/components/icons/Ris.d.ts +3 -0
  41. package/dist/components/icons/Tei.d.ts +3 -0
  42. package/dist/components/icons/Txt.d.ts +3 -0
  43. package/dist/components/icons/index.d.ts +11 -0
  44. package/dist/components/index.d.ts +14 -0
  45. package/dist/einakter-gh.d.ts +2 -0
  46. package/dist/index.d.ts +2 -211
  47. package/dist/index.es.js +405 -410
  48. package/dist/index.es.js.map +1 -1
  49. package/dist/index.umd.js +4 -23
  50. package/dist/index.umd.js.map +1 -1
  51. package/dist/testHelpers.d.ts +11 -0
  52. package/dist/utils.d.ts +2 -0
  53. package/package.json +48 -47
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The DraCor component library comes with a theme that slightly extends the
3
+ * default Tailwind CSS theme. To make this theme available to your project add
4
+ * the following line to your index.css (without the leading backslash):
5
+ *
6
+ * ```
7
+ * \@import "@dracor/react/dracor.css";
8
+ * ```
9
+ *
10
+ * The following text demonstrates how this theme styles certain HTML elements.
11
+ */
12
+ export default function Theme(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ export interface Props {
2
+ /**
3
+ * URL to OpenAPI specification
4
+ */
5
+ url: string;
6
+ /**
7
+ * Optional page title passed to `Helmet`
8
+ */
9
+ title?: string;
10
+ }
11
+ /**
12
+ * Renders a Swagger UI page for the provided OpenAPI specification.
13
+ *
14
+ * This component requires `swagger-ui-react` and `@types/swagger-ui-react` to
15
+ * be installed as peer dependencies.
16
+ *
17
+ * For proper styling the Swagger UI stylesheet needs to be imported:
18
+ *
19
+ * ```
20
+ * import {ApiDoc} from '@dracor/react';
21
+ * import 'swagger-ui-react/swagger-ui.css';
22
+ *
23
+ * <ApiDoc url="/api.yaml" />
24
+ * ```
25
+ */
26
+ export default function ApiDoc({ url, title }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from './ApiDoc';
@@ -0,0 +1,8 @@
1
+ export interface Props {
2
+ wikidataId: string;
3
+ name?: string;
4
+ birthLabel?: string;
5
+ deathLabel?: string;
6
+ unknownLabel?: string;
7
+ }
8
+ export default function AuthorInfo({ wikidataId, name: fullname, birthLabel, deathLabel, unknownLabel, }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from './AuthorInfo';
@@ -0,0 +1,10 @@
1
+ interface Author {
2
+ name: string;
3
+ pseudonym?: string;
4
+ ref?: string;
5
+ }
6
+ export interface Props {
7
+ data: Author[];
8
+ }
9
+ declare const Authors: ({ data }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export default Authors;
@@ -0,0 +1 @@
1
+ export { default } from './Authors';
@@ -0,0 +1,5 @@
1
+ export default function DebouncedInput({ value: initialValue, onChange, debounce, ...props }: {
2
+ value: string | number;
3
+ onChange: (value: string | number) => void;
4
+ debounce?: number;
5
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from './DebouncedInput';
@@ -0,0 +1,5 @@
1
+ export interface Props {
2
+ url?: string;
3
+ match?: () => string | null;
4
+ }
5
+ export default function DocPage({ url, match }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from './DocPage';
@@ -0,0 +1,22 @@
1
+ export interface Props {
2
+ /**
3
+ * URL to download
4
+ */
5
+ href: string;
6
+ /**
7
+ * Download file name
8
+ *
9
+ * The name needs to start with an ASCII character or a digit. Otherwise the
10
+ * name "download" will be used.
11
+ */
12
+ name: string;
13
+ /**
14
+ * File type of the download
15
+ */
16
+ type?: 'bibtex' | 'csv' | 'gexf' | 'graphml' | 'json' | 'rdf' | 'ris' | 'tei' | 'txt';
17
+ }
18
+ /**
19
+ * The download button displays an icon for the supported file types. If the
20
+ * type is omitted the download file name is displayed as link text.
21
+ */
22
+ export default function DownloadButton({ href, type, name }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from './DownloadButton';
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ children: string;
3
+ prefix?: string;
4
+ uri?: string;
5
+ className?: string;
6
+ icon?: 'ein' | 'dracor';
7
+ }
8
+ export default function IdCopy({ children, className, uri, prefix, icon, }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './IdCopy';
@@ -0,0 +1,7 @@
1
+ export interface Props {
2
+ button?: boolean;
3
+ showLabel?: boolean;
4
+ className?: string;
5
+ children: string;
6
+ }
7
+ export default function IdLink({ showLabel, children, className }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from './IdLink';
@@ -0,0 +1,6 @@
1
+ export interface Props {
2
+ languages: string[];
3
+ current?: string;
4
+ onSelect: (lang: string) => void;
5
+ }
6
+ export default function LanguageMenu({ languages, current, onSelect, }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from './LanguageMenu';
@@ -0,0 +1,15 @@
1
+ import { JSX } from 'react';
2
+ import { Props as NavItemProps } from './NavItem';
3
+ import { Props as NavMenuProps } from './NavMenu';
4
+ export interface NavBarProps {
5
+ title: string;
6
+ logo?: string;
7
+ logoClass?: string;
8
+ version?: string;
9
+ gitHubUrl?: string;
10
+ gitHubIcon?: JSX.Element;
11
+ gitHubTitle?: string;
12
+ navItems?: (NavItemProps | NavMenuProps)[];
13
+ addItem?: JSX.Element;
14
+ }
15
+ export default function NavBar({ title, logo, logoClass, version, gitHubUrl, gitHubIcon, gitHubTitle, addItem, navItems, }: NavBarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { LinkProps } from '@tanstack/react-router';
2
+ export type Props = LinkProps & {
3
+ label: string;
4
+ className?: string;
5
+ };
6
+ export default function NavItem({ label, to, params, href, className }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { LinkProps } from '@tanstack/react-router';
2
+ type Item = LinkProps & {
3
+ label: string;
4
+ };
5
+ export interface Props {
6
+ label: string;
7
+ items: Item[];
8
+ menuClass?: string;
9
+ }
10
+ export default function NavMenu({ label, items, menuClass }: Props): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './NavBar';
@@ -0,0 +1,13 @@
1
+ export interface Props {
2
+ /**
3
+ * URL to a TEI document
4
+ */
5
+ url: string;
6
+ }
7
+ /**
8
+ * Component rendering a TEI document using [CETEIcean](https://github.com/TEIC/CETEIcean)
9
+ *
10
+ * The DraCor Tailwind theme provides some styling for the TEI elements. Import
11
+ * the theme adding `@import "@dracor/react/dracor.css";` to your index.css.
12
+ */
13
+ export default function TEIText({ url }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export { default } from './TEIText';
@@ -0,0 +1,11 @@
1
+ import { ColumnDef, SortDirection, SortingState } from '@tanstack/react-table';
2
+ export interface Props<TData = unknown> {
3
+ data: TData[];
4
+ columns: ColumnDef<TData>[];
5
+ defaultSort?: SortingState;
6
+ }
7
+ declare function Table<T>({ columns, data: initialData, defaultSort }: Props<T>): 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 @@
1
+ export { default } from './Table';
@@ -0,0 +1,9 @@
1
+ import { LinkProps } from '@tanstack/react-router';
2
+ type TabData = LinkProps & {
3
+ label: string;
4
+ };
5
+ export interface Props {
6
+ data: TabData[];
7
+ }
8
+ export default function Tabs({ data: tabs }: Props): import("react/jsx-runtime").JSX.Element;
9
+ 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 @@
1
+ export { default } from './Years';
@@ -0,0 +1,3 @@
1
+ import { SVGProps } from 'react';
2
+ declare const SvgBibtex: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgBibtex;
@@ -0,0 +1,3 @@
1
+ import { SVGProps } from 'react';
2
+ declare const SvgCsv: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgCsv;
@@ -0,0 +1,3 @@
1
+ import { SVGProps } from 'react';
2
+ declare const SvgDracor: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgDracor;
@@ -0,0 +1,3 @@
1
+ import { SVGProps } from 'react';
2
+ declare const SvgEin: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgEin;
@@ -0,0 +1,3 @@
1
+ import { SVGProps } from 'react';
2
+ declare const SvgGexf: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgGexf;
@@ -0,0 +1,3 @@
1
+ import { SVGProps } from 'react';
2
+ declare const SvgGraphml: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgGraphml;
@@ -0,0 +1,3 @@
1
+ import { SVGProps } from 'react';
2
+ declare const SvgJson: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgJson;
@@ -0,0 +1,3 @@
1
+ import { SVGProps } from 'react';
2
+ declare const SvgRdf: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgRdf;
@@ -0,0 +1,3 @@
1
+ import { SVGProps } from 'react';
2
+ declare const SvgRis: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgRis;
@@ -0,0 +1,3 @@
1
+ import { SVGProps } from 'react';
2
+ declare const SvgTei: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgTei;
@@ -0,0 +1,3 @@
1
+ import { SVGProps } from 'react';
2
+ declare const SvgTxt: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export default SvgTxt;
@@ -0,0 +1,11 @@
1
+ export { default as Bibtex } from './Bibtex';
2
+ export { default as Csv } from './Csv';
3
+ export { default as Dracor } from './Dracor';
4
+ export { default as Ein } from './Ein';
5
+ export { default as Gexf } from './Gexf';
6
+ export { default as Graphml } from './Graphml';
7
+ export { default as Json } from './Json';
8
+ export { default as Rdf } from './Rdf';
9
+ export { default as Ris } from './Ris';
10
+ export { default as Tei } from './Tei';
11
+ export { default as Txt } from './Txt';
@@ -0,0 +1,14 @@
1
+ export { default as ApiDoc } from './ApiDoc';
2
+ export { default as AuthorInfo } from './AuthorInfo';
3
+ export { default as Authors } from './Authors';
4
+ export { default as DebouncedInput } from './DebouncedInput';
5
+ export { default as DocPage } from './DocPage';
6
+ export { default as DownloadButton } from './DownloadButton';
7
+ export { default as IdCopy } from './IdCopy';
8
+ export { default as IdLink } from './IdLink';
9
+ export { default as LanguageMenu } from './LanguageMenu';
10
+ export { default as NavBar } from './Navigation';
11
+ export { default as Table } from './Table';
12
+ export { default as Tabs } from './Tabs';
13
+ export { default as TEIText } from './TEIText';
14
+ export { default as Years } from './Years';
@@ -0,0 +1,2 @@
1
+ declare const icon: import("react/jsx-runtime").JSX.Element;
2
+ export default icon;
package/dist/index.d.ts CHANGED
@@ -1,211 +1,2 @@
1
- import { ColumnDef } from '@tanstack/react-table';
2
- import { JSX } from 'react/jsx-runtime';
3
- import { JSX as JSX_2 } from 'react';
4
- import { SortingState } from '@tanstack/react-table';
5
-
6
- /**
7
- * Renders a Swagger UI page for the provided OpenAPI specification.
8
- *
9
- * This component requires `swagger-ui-react` and `@types/swagger-ui-react` to
10
- * be installed as peer dependencies.
11
- *
12
- * For proper styling the Swagger UI stylesheet needs to be imported:
13
- *
14
- * ```
15
- * import {ApiDoc} from '@dracor/react';
16
- * import 'swagger-ui-react/swagger-ui.css';
17
- *
18
- * <ApiDoc url="/api.yaml" />
19
- * ```
20
- */
21
- export declare function ApiDoc({ url, title }: Props): JSX.Element;
22
-
23
- declare interface Author {
24
- name: string;
25
- pseudonym?: string;
26
- ref?: string;
27
- }
28
-
29
- export declare function AuthorInfo({ wikidataId, name: fullname, birthLabel, deathLabel, unknownLabel, }: Props_2): JSX.Element;
30
-
31
- export declare const Authors: ({ data }: Props_3) => JSX.Element;
32
-
33
- export declare function DebouncedInput({ value: initialValue, onChange, debounce, ...props }: {
34
- value: string | number;
35
- onChange: (value: string | number) => void;
36
- debounce?: number;
37
- } & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'>): JSX.Element;
38
-
39
- export declare function DocPage({ url, match }: Props_4): JSX.Element;
40
-
41
- /**
42
- * The download button displays an icon for the supported file types. If the
43
- * type is omitted the download file name is displayed as link text.
44
- */
45
- export declare function DownloadButton({ href, type, name }: Props_5): JSX.Element;
46
-
47
- export declare function formatEra(year: string, ceBefore?: number): string;
48
-
49
- export declare function formatYear(year: number | string, locale?: string): string;
50
-
51
- export declare function IdCopy({ children, className, uri, prefix, icon, }: Props_6): JSX.Element;
52
-
53
- export declare function IdLink({ showLabel, children, className }: Props_7): JSX.Element;
54
-
55
- declare interface Item {
56
- label: string;
57
- href: string;
58
- selected?: boolean;
59
- }
60
-
61
- export declare function LanguageMenu({ languages, current, onSelect, }: Props_8): JSX.Element;
62
-
63
- export declare function NavBar({ title, logo, logoClass, version, gitHubUrl, gitHubIcon, gitHubTitle, addItem, navItems, }: NavBarProps): JSX.Element;
64
-
65
- declare interface NavBarProps {
66
- title: string;
67
- logo?: string;
68
- logoClass?: string;
69
- version?: string;
70
- gitHubUrl?: string;
71
- gitHubIcon?: JSX_2.Element;
72
- gitHubTitle?: string;
73
- navItems?: (Props_9 | Props_10)[];
74
- addItem?: JSX_2.Element;
75
- }
76
-
77
- declare interface Props {
78
- /**
79
- * URL to OpenAPI specification
80
- */
81
- url: string;
82
- /**
83
- * Optional page title passed to `Helmet`
84
- */
85
- title?: string;
86
- }
87
-
88
- declare interface Props_10 {
89
- label: string;
90
- items: Item[];
91
- menuClass?: string;
92
- }
93
-
94
- declare interface Props_11<TData = unknown> {
95
- data: TData[];
96
- columns: ColumnDef<TData>[];
97
- defaultSort?: SortingState;
98
- }
99
-
100
- declare interface Props_12 {
101
- data: TabData[];
102
- }
103
-
104
- declare interface Props_13 {
105
- /**
106
- * URL to a TEI document
107
- */
108
- url: string;
109
- }
110
-
111
- declare interface Props_14 {
112
- written?: number;
113
- premiere?: number;
114
- print?: number;
115
- locale?: string;
116
- labelWritten?: string;
117
- labelPremiered?: string;
118
- labelPrinted?: string;
119
- }
120
-
121
- declare interface Props_2 {
122
- wikidataId: string;
123
- name?: string;
124
- birthLabel?: string;
125
- deathLabel?: string;
126
- unknownLabel?: string;
127
- }
128
-
129
- declare interface Props_3 {
130
- data: Author[];
131
- }
132
-
133
- declare interface Props_4 {
134
- url?: string;
135
- match?: () => string | null;
136
- }
137
-
138
- declare interface Props_5 {
139
- /**
140
- * URL to download
141
- */
142
- href: string;
143
- /**
144
- * Download file name
145
- *
146
- * The name needs to start with an ASCII character or a digit. Otherwise the
147
- * name "download" will be used.
148
- */
149
- name: string;
150
- /**
151
- * File type of the download
152
- */
153
- type?: 'bibtex' | 'csv' | 'gexf' | 'graphml' | 'json' | 'rdf' | 'ris' | 'tei' | 'txt';
154
- }
155
-
156
- declare interface Props_6 {
157
- children: string;
158
- prefix?: string;
159
- uri?: string;
160
- className?: string;
161
- icon?: 'ein' | 'dracor';
162
- }
163
-
164
- declare interface Props_7 {
165
- button?: boolean;
166
- showLabel?: boolean;
167
- className?: string;
168
- children: string;
169
- }
170
-
171
- declare interface Props_8 {
172
- languages: string[];
173
- current?: string;
174
- onSelect: (lang: string) => void;
175
- }
176
-
177
- declare interface Props_9 {
178
- label: string;
179
- href: string;
180
- active?: boolean;
181
- className?: string;
182
- }
183
-
184
- declare interface TabData {
185
- label: string;
186
- href: string;
187
- active?: boolean;
188
- }
189
-
190
- export declare function Table<T>({ columns, data: initialData, defaultSort }: Props_11<T>): JSX.Element;
191
-
192
- export declare function Tabs({ data: tabs }: Props_12): JSX.Element;
193
-
194
- /**
195
- * Component rendering a TEI document using [CETEIcean](https://github.com/TEIC/CETEIcean)
196
- *
197
- * The DraCor Tailwind theme provides some styling for the TEI elements. Import
198
- * the theme adding `@import "@dracor/react/dracor.css";` to your index.css.
199
- */
200
- export declare function TEIText({ url }: Props_13): JSX.Element;
201
-
202
- export declare function Years({ written, premiere, print, locale, labelPremiered, labelPrinted, labelWritten, }: Props_14): JSX.Element;
203
-
204
- export { }
205
-
206
-
207
- declare module '@tanstack/react-router' {
208
- interface Register {
209
- router: typeof dummyRouter;
210
- }
211
- }
1
+ export * from './components';
2
+ export * from './utils';