@public-ui/sample-react 2.0.2 → 2.0.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 (74) hide show
  1. package/dist/1090.js +1 -1
  2. package/dist/1181.js +1 -1
  3. package/dist/1218.js +1 -1
  4. package/dist/1338.js +1 -1
  5. package/dist/1517.js +1 -1
  6. package/dist/{5440.js → 1532.js} +2 -2
  7. package/dist/1596.js +1 -1
  8. package/dist/2163.js +1 -1
  9. package/dist/2415.js +1 -1
  10. package/dist/2594.js +1 -1
  11. package/dist/2611.js +1 -1
  12. package/dist/2643.js +1 -1
  13. package/dist/3145.js +1 -1
  14. package/dist/3345.js +1 -1
  15. package/dist/3466.js +1 -1
  16. package/dist/3580.js +1 -1
  17. package/dist/3619.js +1 -1
  18. package/dist/3776.js +1 -1
  19. package/dist/4150.js +1 -1
  20. package/dist/42.js +1 -1
  21. package/dist/4279.js +1 -1
  22. package/dist/4463.js +1 -1
  23. package/dist/4563.js +1 -1
  24. package/dist/5027.js +1 -1
  25. package/dist/521.js +1 -1
  26. package/dist/5496.js +1 -1
  27. package/dist/5518.js +1 -1
  28. package/dist/5615.js +1 -1
  29. package/dist/5767.js +1 -1
  30. package/dist/5853.js +1 -1
  31. package/dist/6308.js +1 -1
  32. package/dist/{9962.js → 6805.js} +2 -2
  33. package/dist/7170.js +1 -1
  34. package/dist/{3035.js → 7232.js} +2 -2
  35. package/dist/{1399.js → 7271.js} +2 -2
  36. package/dist/755.js +1 -1
  37. package/dist/7654.js +1 -1
  38. package/dist/8037.js +1 -1
  39. package/dist/817.js +1 -1
  40. package/dist/8612.js +1 -1
  41. package/dist/8734.js +1 -1
  42. package/dist/881.js +1 -1
  43. package/dist/892.js +1 -1
  44. package/dist/8948.js +1 -1
  45. package/dist/8951.js +1 -1
  46. package/dist/9317.js +1 -1
  47. package/dist/9727.js +1 -1
  48. package/dist/9797.js +1 -1
  49. package/dist/9984.js +1 -1
  50. package/dist/main.css +1 -1
  51. package/dist/main.js +113 -32447
  52. package/dist/main.js.LICENSE.txt +2 -2
  53. package/package.json +12 -13
  54. package/src/App.tsx +16 -16
  55. package/src/components/SampleDescription.tsx +1 -1
  56. package/src/components/alert/html.tsx +1 -2
  57. package/src/components/button/access-key.tsx +1 -1
  58. package/src/components/button/width.tsx +2 -2
  59. package/src/components/card/selection.tsx +4 -4
  60. package/src/components/input-date/partials/cases.tsx +2 -2
  61. package/src/components/link-button/basic.tsx +1 -1
  62. package/src/components/split-button/basic.tsx +5 -5
  63. package/src/components/table/badge-size.tsx +3 -2
  64. package/src/components/table/column-alignment.tsx +84 -0
  65. package/src/components/table/render-cell.tsx +3 -2
  66. package/src/components/table/routes.ts +4 -4
  67. package/src/components/table/{sort-date.tsx → sort-data.tsx} +1 -1
  68. package/src/react.main.tsx +2 -3
  69. package/src/scenarios/appointment-form/DistrictForm.tsx +11 -11
  70. package/src/shares/theme.ts +12 -38
  71. /package/dist/{1399.js.LICENSE.txt → 1532.js.LICENSE.txt} +0 -0
  72. /package/dist/{3035.js.LICENSE.txt → 6805.js.LICENSE.txt} +0 -0
  73. /package/dist/{5440.js.LICENSE.txt → 7232.js.LICENSE.txt} +0 -0
  74. /package/dist/{9962.js.LICENSE.txt → 7271.js.LICENSE.txt} +0 -0
@@ -33,7 +33,7 @@
33
33
  */
34
34
 
35
35
  /**
36
- * @remix-run/router v1.14.0
36
+ * @remix-run/router v1.14.1
37
37
  *
38
38
  * Copyright (c) Remix Software Inc.
39
39
  *
@@ -44,7 +44,7 @@
44
44
  */
45
45
 
46
46
  /**
47
- * React Router v6.21.0
47
+ * React Router v6.21.1
48
48
  *
49
49
  * Copyright (c) Remix Software Inc.
50
50
  *
package/package.json CHANGED
@@ -1,33 +1,32 @@
1
1
  {
2
2
  "name": "@public-ui/sample-react",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "This app contains samples for the KoliBri/Public UI",
5
5
  "license": "EUPL-1.2",
6
6
  "dependencies": {
7
7
  "@leanup/stack": "1.3.49",
8
8
  "@leanup/stack-react": "1.3.49",
9
9
  "@leanup/stack-webpack": "1.3.49",
10
- "@public-oss/kolibri-themes": "0.0.3",
11
- "@public-ui/components": "2.0.2",
12
- "@public-ui/react": "2.0.2",
13
- "@public-ui/themes": "2.0.2",
14
- "@types/node": "20.10.5",
15
- "@types/react": "18.2.45",
10
+ "@public-ui/components": "2.0.3",
11
+ "@public-ui/react": "2.0.3",
12
+ "@public-ui/themes": "2.0.3",
13
+ "@types/node": "20.10.6",
14
+ "@types/react": "18.2.46",
16
15
  "@types/react-dom": "18.2.18",
17
- "@unocss/preset-uno": "0.58.0",
18
- "@unocss/webpack": "0.58.0",
16
+ "@unocss/preset-uno": "0.58.3",
17
+ "@unocss/webpack": "0.58.3",
19
18
  "ajv": "8.12.0",
20
- "chromedriver": "120.0.0",
19
+ "chromedriver": "120.0.1",
21
20
  "cpy-cli": "5.0.0",
22
21
  "eslint-plugin-jsx-a11y": "6.8.0",
23
22
  "eslint-plugin-react": "7.33.2",
24
23
  "formik": "2.4.5",
25
- "nightwatch-axe-verbose": "2.2.2",
24
+ "nightwatch-axe-verbose": "2.2.3",
26
25
  "npm-run-all": "4.1.5",
27
26
  "react": "18.2.0",
28
27
  "react-dom": "18.2.0",
29
- "react-router": "6.21.0",
30
- "react-router-dom": "6.21.0",
28
+ "react-router": "6.21.1",
29
+ "react-router-dom": "6.21.1",
31
30
  "rimraf": "3.0.2",
32
31
  "ts-prune": "0.10.3",
33
32
  "typescript": "5.3.3",
package/src/App.tsx CHANGED
@@ -3,9 +3,9 @@ import { Navigate, Route, Routes, useSearchParams } from 'react-router-dom';
3
3
  import { Route as MyRoute, Routes as MyRoutes } from './shares/types';
4
4
 
5
5
  import { Option } from '@public-ui/components';
6
- import { KolAlert } from '@public-ui/react';
6
+ import { KolAlert, KolBadge } from '@public-ui/react';
7
7
  import { ROUTES } from './shares/routes';
8
- import { Theme, THEME_OPTIONS } from './shares/theme';
8
+ import { isDraftTheme, Theme, THEME_OPTIONS } from './shares/theme';
9
9
  import PackageJson from '@public-ui/components/package.json';
10
10
  import { getTheme, getThemeName, setStorage, setTheme } from './shares/store';
11
11
  import { Sidebar } from './components/Sidebar';
@@ -45,20 +45,19 @@ const getRouteTree = (routes: MyRoutes): ReturnType<typeof Route>[] => {
45
45
  path={`${path}/all`}
46
46
  element={
47
47
  <div className="d-grid gap-4">
48
- {THEME_OPTIONS.filter(
49
- (theme) =>
50
- ['bmf', 'default', 'bzst-v1', 'ecl-ec', 'ecl-eu', 'itzbund', 'mapz', 'zoll-v2', 'zoll-v3'].indexOf((theme as Option<Theme>).value) >= 0,
51
- ).map((theme) => (
52
- <div className="d-grid gap-2" key={(theme as Option<Theme>).value} data-theme={(theme as Option<Theme>).value}>
53
- <div className="mt-4">
54
- <strong>{theme.label}</strong>
48
+ {THEME_OPTIONS.filter((theme) => ['bmf', 'default', 'ecl-ec', 'ecl-eu', 'itzbund'].indexOf((theme as Option<Theme>).value) >= 0).map(
49
+ (theme) => (
50
+ <div className="d-grid gap-2" key={(theme as Option<Theme>).value} data-theme={(theme as Option<Theme>).value}>
51
+ <div className="mt-4">
52
+ <strong>{theme.label}</strong>
53
+ </div>
54
+ <div className="my-2">
55
+ <ThisRoute />
56
+ </div>
57
+ <hr aria-hidden="true" />
55
58
  </div>
56
- <div className="my-2">
57
- <ThisRoute />
58
- </div>
59
- <hr aria-hidden="true" />
60
- </div>
61
- ))}
59
+ ),
60
+ )}
62
61
  </div>
63
62
  }
64
63
  />,
@@ -104,7 +103,7 @@ ROUTE_LIST.forEach((route) => {
104
103
  export const App: FC = () => {
105
104
  const routerLocation = useLocation();
106
105
  const [searchParams, setSearchParams] = useSearchParams();
107
- const theme = searchParams.get('theme') ?? getTheme();
106
+ const theme: Theme = (searchParams.get('theme') as Theme) ?? getTheme();
108
107
  const hideMenus = searchParams.has('hideMenus');
109
108
 
110
109
  setTheme(theme as Theme); // set for `getTheme` usages within the application
@@ -134,6 +133,7 @@ export const App: FC = () => {
134
133
  )}
135
134
 
136
135
  <div className="p-4" id="route-container">
136
+ {!hideMenus && isDraftTheme(theme) && <KolBadge className="mb-3" _label="DRAFT" _color="#db5461" />}
137
137
  <Routes>
138
138
  {ROUTE_TREE}
139
139
  <Route path="*" element={<KolAlert _type="info">This code example has not been migrated yet - it&#39;s coming soon!</KolAlert>} />
@@ -6,7 +6,7 @@ export const SampleDescription: FC<PropsWithChildren> = (props) => {
6
6
  const hideMenus = useContext(HideMenusContext);
7
7
 
8
8
  return hideMenus ? null : (
9
- <div className="flex">
9
+ <div className="flex mb-sm">
10
10
  <KolIndentedText>{props.children}</KolIndentedText>
11
11
  <KolLink
12
12
  _hideLabel
@@ -6,9 +6,8 @@ import { FC } from 'react';
6
6
  export const AlertHtml: FC = () => (
7
7
  <div>
8
8
  <KolAlert _label="Ausgabe von HTML-Code im Alert" _type="info">
9
- {' '}
10
9
  <h2 className="mt-2 mb-3">Hier wird eine H2-Überschrift ausgegeben</h2>
11
- <div style={{ display: 'grid', gridAutoFlow: 'column', gap: '1rem' }}>
10
+ <div className="grid gap-4 sm:grid-cols-2">
12
11
  <div>
13
12
  <h4>Text in einer linken Spalte</h4>
14
13
  <p>
@@ -2,7 +2,7 @@ import { KolButton } from '@public-ui/react';
2
2
  import React, { FC } from 'react';
3
3
 
4
4
  export const ButtonAccessKey: FC = () => (
5
- <div className="flex gap-4">
5
+ <div className="flex flex-wrap gap-4">
6
6
  <KolButton _label="Mit S access key" _accessKey="S"></KolButton>
7
7
  <KolButton _label="Sehr kleines s" _accessKey="s"></KolButton>
8
8
  <KolButton _label="Access key kommt nicht in label vor" _accessKey="x"></KolButton>
@@ -12,14 +12,14 @@ const ARGS = {
12
12
 
13
13
  export const ButtonWidth: FC = () => (
14
14
  <div className="grid gap-14">
15
- <div className="flex flex-warp gap-14">
15
+ <div className="flex flex-wrap gap-14">
16
16
  <KolButton _label="Primary" _variant="primary" {...ARGS}></KolButton>
17
17
  <KolButton _label="Secondary" _variant="secondary" {...ARGS}></KolButton>
18
18
  <KolButton _label="Normal" _variant="normal" {...ARGS}></KolButton>
19
19
  <KolButton _label="Danger" _variant="danger" {...ARGS}></KolButton>
20
20
  <KolButton _label="Ghost" _variant="ghost" {...ARGS}></KolButton>
21
21
  </div>
22
- <div className="flex flex-warp gap-14">
22
+ <div className="flex flex-wrap gap-14">
23
23
  <KolButton _disabled _label="Primary" _variant="primary" {...ARGS}></KolButton>
24
24
  <KolButton _disabled _label="Secondary" _variant="secondary" {...ARGS}></KolButton>
25
25
  <KolButton _disabled _label="Normal" _variant="normal" {...ARGS}></KolButton>
@@ -11,8 +11,8 @@ const STYLE = {
11
11
  };
12
12
 
13
13
  export const CardSelection: FC = () => (
14
- <div className="flex gap-2">
15
- <KolCard _label="DEBTI-25437/17-1">
14
+ <div className="flex flex-wrap gap-2">
15
+ <KolCard _label="DEBTI-25437/17-1" className="lg:w-[calc(33.33%-16px)] md:w-[calc(50%-16px)] sm:w-full">
16
16
  <div>
17
17
  <div>
18
18
  TeCorp Endplatte
@@ -32,7 +32,7 @@ export const CardSelection: FC = () => (
32
32
  </div>
33
33
  </div>
34
34
  </KolCard>
35
- <KolCard _label="DEBTI-25437/17-1">
35
+ <KolCard _label="DEBTI-25437/17-1" className="lg:w-[calc(33.33%-16px)] md:w-[calc(50%-16px)] sm:w-full">
36
36
  <div>
37
37
  <div>
38
38
  TeCorp Endplatte
@@ -52,7 +52,7 @@ export const CardSelection: FC = () => (
52
52
  </div>
53
53
  </div>
54
54
  </KolCard>
55
- <KolCard _label="DEBTI-25437/17-1">
55
+ <KolCard _label="DEBTI-25437/17-1" className="lg:w-[calc(33.33%-16px)] md:w-[calc(50%-16px)] sm:w-full">
56
56
  <div>
57
57
  <div>
58
58
  TeCorp Endplatte
@@ -15,8 +15,8 @@ export const InputDateCases = forwardRef<HTMLKolInputDateElement, Components.Kol
15
15
  <KolInputDate {...props} ref={ref} _accessKey="W" _type="week" _label="Woche" _required />
16
16
  <KolInputDate {...props} _type="time" _label="Zeit (Standard)" _required />
17
17
  <KolInputDate {...props} _step={1} _type="time" _label="Zeit (mit Sekunden)" _required />
18
- <KolInputDate {...props} _readOnly _label="Zahleneingabe (Readonly)" _required />
19
- <KolInputDate {...props} _disabled _label="Zahleneingabe (Disabled)" _required />
18
+ <KolInputDate {...props} _readOnly _label="Datumseingabe (Readonly)" _required />
19
+ <KolInputDate {...props} _disabled _label="Datumseingabe (Disabled)" _required />
20
20
  </div>
21
21
  );
22
22
  });
@@ -11,7 +11,7 @@ const ARGS = {
11
11
 
12
12
  export const LinkButtonBasic: FC = () => (
13
13
  <div className="grid gap-14">
14
- <div className="flex flex-warp gap-14">
14
+ <div className="flex flex-wrap gap-14">
15
15
  <KolLinkButton _label="Primary" _variant="primary" {...ARGS}></KolLinkButton>
16
16
  <KolLinkButton _label="Secondary" _variant="secondary" {...ARGS}></KolLinkButton>
17
17
  <KolLinkButton _label="Normal" _variant="normal" {...ARGS}></KolLinkButton>
@@ -14,12 +14,12 @@ export const SplitButtonBasic: FC = () => {
14
14
  };
15
15
 
16
16
  return (
17
- <div className="grid gap-4">
18
- <KolSplitButton _label="Nur der Pfeil öffnet" className="w-200px" _on={{ onClick: handleButtonClick }}>
19
- Drowndown-Inhalt
17
+ <div className="flex gap-4">
18
+ <KolSplitButton _label="Nur der Pfeil öffnet" _on={{ onClick: handleButtonClick }}>
19
+ Dropdown-Inhalt
20
20
  </KolSplitButton>
21
- <KolSplitButton _label="ohne label" _hide-label _icons="codicon codicon-git-pull-request" className="w-200px">
22
- Drowndown-Inhalt
21
+ <KolSplitButton _label="Schalter ohne sichtbares Label" _hideLabel _icons="codicon codicon-git-pull-request">
22
+ Dropdown-Inhalt
23
23
  </KolSplitButton>
24
24
  </div>
25
25
  );
@@ -15,11 +15,12 @@ const DATE_FORMATTER = Intl.DateTimeFormat('de-DE', {
15
15
  const HEADERS: KoliBriTableHeaders = {
16
16
  horizontal: [
17
17
  [
18
- { label: 'order', key: 'order', textAlign: 'center' },
18
+ { label: 'order', key: 'order', textAlign: 'center', width: '10em' },
19
19
  {
20
20
  label: 'date',
21
21
  key: 'date',
22
22
  textAlign: 'center',
23
+ width: '20em',
23
24
  render: (_el, _cell, tupel) => DATE_FORMATTER.format((tupel as Data).date),
24
25
  sort: (data: Data[]) =>
25
26
  data.sort((data0, data1) => {
@@ -48,4 +49,4 @@ const HEADERS: KoliBriTableHeaders = {
48
49
  ],
49
50
  };
50
51
 
51
- export const TableBadgeSize: FC = () => <KolTable _label="Sort a date column" _data={DATA} _headers={HEADERS} className="block" />;
52
+ export const TableBadgeSize: FC = () => <KolTable _label="Sort a date column" _data={DATA} _headers={HEADERS} className="block min-w-75em" />;
@@ -0,0 +1,84 @@
1
+ import React, { FC } from 'react';
2
+
3
+ import { KolTable, KolHeading } from '@public-ui/react';
4
+ import { SampleDescription } from '../SampleDescription';
5
+
6
+ const DATA = [{ left: 'Left Example', center: 'Center Example', right: 'Right Example' }];
7
+ type Data = (typeof DATA)[0];
8
+ const genericNonSorter = (data: Data[]): Data[] => data;
9
+
10
+ export const TableColumnAlignment: FC = () => (
11
+ <>
12
+ <SampleDescription>Table with columns headers and data in different text alignments.</SampleDescription>
13
+
14
+ <KolHeading _label="Simple table" _level={3}></KolHeading>
15
+ <KolTable
16
+ _label="Table for demonstration purposes with different text align properties"
17
+ _headers={{
18
+ horizontal: [
19
+ [
20
+ { label: 'left', key: 'left', textAlign: 'left' },
21
+ { label: 'center', key: 'center', textAlign: 'center' },
22
+ { label: 'right', key: 'right', textAlign: 'right' },
23
+ ],
24
+ ],
25
+ }}
26
+ _data={DATA}
27
+ className="block"
28
+ style={{ maxWidth: '600px' }}
29
+ />
30
+
31
+ <KolHeading _label="Table with sortable columns" _level={3} className="block mt-6"></KolHeading>
32
+ <KolTable
33
+ _label="Table for demonstration purposes with sortable columns"
34
+ _headers={{
35
+ horizontal: [
36
+ [
37
+ { label: 'left', key: 'left', textAlign: 'left', sort: genericNonSorter },
38
+ { label: 'center', key: 'center', textAlign: 'center', sort: genericNonSorter },
39
+ { label: 'right', key: 'right', textAlign: 'right', sort: genericNonSorter },
40
+ ],
41
+ ],
42
+ }}
43
+ _data={DATA}
44
+ className="block"
45
+ style={{ maxWidth: '600px' }}
46
+ />
47
+
48
+ <KolHeading _label="Table some sortable columns" _level={3} className="block mt-6"></KolHeading>
49
+ <KolTable
50
+ _label="Table for demonstration purposes with some but not all columns sortable"
51
+ _headers={{
52
+ horizontal: [
53
+ [
54
+ { label: 'left', key: 'left', textAlign: 'left', sort: genericNonSorter },
55
+ { label: 'center', key: 'center', textAlign: 'center', sort: genericNonSorter },
56
+ { label: 'right', key: 'right', textAlign: 'right' },
57
+ ],
58
+ ],
59
+ }}
60
+ _data={DATA}
61
+ className="block"
62
+ style={{ maxWidth: '600px' }}
63
+ />
64
+
65
+ <KolHeading _label="Table with vertical heading" _level={3} className="block mt-6"></KolHeading>
66
+ <KolTable
67
+ _label="Table for demonstration purposes with vertical heading"
68
+ _headers={{
69
+ horizontal: [
70
+ [
71
+ { label: '', asTd: true },
72
+ { label: 'left', key: 'left', textAlign: 'left' },
73
+ { label: 'center', key: 'center', textAlign: 'center' },
74
+ { label: 'right', key: 'right', textAlign: 'right' },
75
+ ],
76
+ ],
77
+ vertical: [[{ label: 'Vertical' }]],
78
+ }}
79
+ _data={DATA}
80
+ className="block"
81
+ style={{ maxWidth: '600px' }}
82
+ />
83
+ </>
84
+ );
@@ -11,10 +11,11 @@ import { SampleDescription } from '../SampleDescription';
11
11
  const HEADERS: KoliBriTableHeaders = {
12
12
  horizontal: [
13
13
  [
14
- { label: '#', key: 'order', textAlign: 'center' },
14
+ { label: '#', key: 'order', textAlign: 'center', width: '10em' },
15
15
  {
16
16
  label: 'Datum (string)',
17
17
  key: 'date',
18
+ width: '20em',
18
19
  textAlign: 'center',
19
20
  render: (el, tupel) => {
20
21
  // https://reactjs.org/docs/portals.html
@@ -51,6 +52,6 @@ export const TableRenderCell: FC = () => (
51
52
  <SampleDescription>
52
53
  <p>This sample simulates the usage of React render functions for the table column contents.</p>
53
54
  </SampleDescription>
54
- <KolTable _label="Sort a date column" _data={DATA} _headers={HEADERS} className="block" />
55
+ <KolTable _label="Sort a date column" _data={DATA} _headers={HEADERS} className="block min-w-75em" />
55
56
  </>
56
57
  );
@@ -1,17 +1,17 @@
1
1
  import { Routes } from '../../shares/types';
2
2
 
3
3
  import { TableBadgeSize } from './badge-size';
4
-
4
+ import { TableColumnAlignment } from './column-alignment';
5
5
  import { TableRenderCell } from './render-cell';
6
-
7
- import { TableSortTable } from './sort-date';
6
+ import { TableSortData } from './sort-data';
8
7
  import { TableWithPagination } from './with-pagination';
9
8
 
10
9
  export const TABLE_ROUTES: Routes = {
11
10
  table: {
12
11
  'badge-size': TableBadgeSize,
12
+ 'column-alignment': TableColumnAlignment,
13
13
  'render-cell': TableRenderCell,
14
- 'sort-data': TableSortTable,
14
+ 'sort-data': TableSortData,
15
15
  'with-pagination': TableWithPagination,
16
16
  },
17
17
  };
@@ -30,4 +30,4 @@ const HEADERS: KoliBriTableHeaders = {
30
30
  ],
31
31
  };
32
32
 
33
- export const TableSortTable: FC = () => <KolTable _label="Sort a date column" _data={DATA} _headers={HEADERS} className="block" />;
33
+ export const TableSortData: FC = () => <KolTable _label="Sort a date column" _data={DATA} _headers={HEADERS} className="block" />;
@@ -5,8 +5,7 @@ import { HashRouter as Router } from 'react-router-dom';
5
5
  import { defineCustomElements } from '@public-ui/components/dist/loader';
6
6
  import type { Generic } from 'adopted-style-sheets';
7
7
  import { register } from '@public-ui/components';
8
- import { BAMF, BMF, BZStv1, DEFAULT, DESYv1, DESYv2, ECL_EC, ECL_EU, ITZBund, MAPZ, ZOLLv2, ZOLLv3 } from '@public-ui/themes';
9
- import { TH } from '@public-oss/kolibri-themes';
8
+ import { BMF, DEFAULT, ECL_EC, ECL_EU, ITZBund } from '@public-ui/themes';
10
9
  import { App } from './App';
11
10
 
12
11
  type Theme = Generic.Theming.RegisterPatch<string, string, string>;
@@ -23,7 +22,7 @@ void (async () => {
23
22
  } else {
24
23
  /* Regular mode: Register all known themes. */
25
24
  try {
26
- await register([BAMF, BMF, DEFAULT, BZStv1, DESYv1, DESYv2, ECL_EC, ECL_EU, ITZBund, MAPZ, ZOLLv2, ZOLLv3, TH], defineCustomElements, {
25
+ await register([BMF, DEFAULT, ECL_EC, ECL_EU, ITZBund], defineCustomElements, {
27
26
  theme: {
28
27
  detect: 'auto',
29
28
  },
@@ -1,8 +1,8 @@
1
- import React, { useState } from 'react';
1
+ import React from 'react';
2
2
  import { KolButton, KolForm, KolHeading, KolSelect } from '@public-ui/react';
3
3
  import { Field, FieldProps, useFormikContext } from 'formik';
4
4
  import { FormValues } from './AppointmentForm';
5
- import { ErrorList } from './ErrorList';
5
+ import { ErrorListPropType } from '@public-ui/components';
6
6
 
7
7
  const LOCATION_OPTIONS = [
8
8
  {
@@ -29,23 +29,23 @@ const LOCATION_OPTIONS = [
29
29
 
30
30
  export function DistrictForm() {
31
31
  const form = useFormikContext<FormValues>();
32
- const [sectionSubmitted, setSectionSubmitted] = useState(false);
32
+ const errorList = createErrorList(form.errors);
33
+
34
+ function createErrorList(formikErrors: Record<string, string>): ErrorListPropType[] {
35
+ return Object.keys(formikErrors).map((fieldName) => ({
36
+ message: formikErrors[fieldName],
37
+ selector: `#field-${fieldName}`,
38
+ }));
39
+ }
33
40
 
34
41
  return (
35
42
  <div className="p-2">
36
43
  <KolHeading _level={2} _label="Wählen Sie einen Stadtteil aus"></KolHeading>
37
-
38
- {sectionSubmitted && Object.keys(form.errors).length ? (
39
- <div className="mt-2">
40
- <ErrorList errors={form.errors} />
41
- </div>
42
- ) : null}
43
-
44
44
  <KolForm
45
+ _errorList={errorList}
45
46
  _on={{
46
47
  onSubmit: () => {
47
48
  void form.submitForm();
48
- setSectionSubmitted(true);
49
49
  },
50
50
  }}
51
51
  >
@@ -1,21 +1,15 @@
1
1
  import { SelectOption } from '@public-ui/components';
2
2
 
3
- export type Theme = 'bmf' | 'bzst-v1' | 'default' | 'ecl-ec' | 'ecl-eu' | 'itzbund' | 'mapz' | 'th' | 'unstyled' | 'zoll-v2' | 'zoll-v3';
3
+ export type Theme = 'bmf' | 'default' | 'ecl-ec' | 'ecl-eu' | 'itzbund' | 'unstyled';
4
+
5
+ const drafts: Theme[] = ['ecl-ec', 'ecl-eu', 'itzbund'];
6
+
7
+ export const isDraftTheme = (theme: Theme) => drafts.includes(theme);
4
8
 
5
9
  export const isTheme = (value: unknown) => {
6
10
  return (
7
11
  typeof value === 'string' &&
8
- (value === 'unstyled' ||
9
- value === 'bmf' ||
10
- value === 'bzst-v1' ||
11
- value === 'default' ||
12
- value === 'ecl-ec' ||
13
- value === 'ecl-eu' ||
14
- value === 'itzbund' ||
15
- value === 'mapz' ||
16
- value === 'th' ||
17
- value === 'zoll-v2' ||
18
- value === 'zoll-v3')
12
+ (value === 'bmf' || value === 'default' || value === 'ecl-ec' || value === 'ecl-eu' || value === 'itzbund' || value === 'unstyled')
19
13
  );
20
14
  };
21
15
 
@@ -26,47 +20,27 @@ export type Store = {
26
20
 
27
21
  export const THEME_OPTIONS: SelectOption<Theme>[] = [
28
22
  {
29
- label: 'Unstyled',
23
+ label: 'Unstyled (Uncolored)',
30
24
  value: 'unstyled',
31
25
  },
32
26
  {
33
- label: 'Bundesministerium der Finanzen',
27
+ label: 'Bundesministerium der Finanzen (Tested)',
34
28
  value: 'bmf',
35
29
  },
36
30
  {
37
- label: 'Bundeszentralamt für Steuern (v1)',
38
- value: 'bzst-v1',
39
- },
40
- {
41
- label: 'Default',
31
+ label: 'Default (Tested)',
42
32
  value: 'default',
43
33
  },
44
34
  {
45
- label: 'European Commission (ECL)',
35
+ label: 'European Commission (Draft)',
46
36
  value: 'ecl-ec',
47
37
  },
48
38
  {
49
- label: 'European Union (ECL)',
39
+ label: 'European Union (Draft)',
50
40
  value: 'ecl-eu',
51
41
  },
52
42
  {
53
- label: 'Informationstechnikzentrum Bund',
43
+ label: 'Informationstechnikzentrum Bund (Draft)',
54
44
  value: 'itzbund',
55
45
  },
56
- {
57
- label: '.',
58
- value: 'mapz',
59
- },
60
- {
61
- label: 'Freistaat Thüringen',
62
- value: 'th',
63
- },
64
- {
65
- label: '..',
66
- value: 'zoll-v2',
67
- },
68
- {
69
- label: '...',
70
- value: 'zoll-v3',
71
- },
72
46
  ];