@public-ui/sample-react 2.0.2 → 2.0.4-rc.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 (104) 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/1596.js +1 -1
  7. package/dist/2163.js +1 -1
  8. package/dist/2415.js +1 -1
  9. package/dist/2594.js +1 -1
  10. package/dist/2611.js +1 -1
  11. package/dist/2643.js +1 -1
  12. package/dist/3099.js +2 -0
  13. package/dist/3145.js +1 -1
  14. package/dist/3345.js +1 -1
  15. package/dist/3388.js +1 -1
  16. package/dist/3466.js +1 -1
  17. package/dist/3580.js +1 -1
  18. package/dist/3600.js +2 -0
  19. package/dist/3619.js +1 -1
  20. package/dist/3776.js +1 -1
  21. package/dist/3845.js +2 -0
  22. package/dist/4150.js +1 -1
  23. package/dist/42.js +1 -1
  24. package/dist/4279.js +1 -1
  25. package/dist/4378.js +2 -0
  26. package/dist/4463.js +1 -1
  27. package/dist/4669.js +1 -1
  28. package/dist/4686.js +1 -1
  29. package/dist/5027.js +1 -1
  30. package/dist/521.js +1 -1
  31. package/dist/5324.js +1 -1
  32. package/dist/5373.js +1 -1
  33. package/dist/5518.js +1 -1
  34. package/dist/5615.js +1 -1
  35. package/dist/5853.js +1 -1
  36. package/dist/6010.js +1 -1
  37. package/dist/6308.js +1 -1
  38. package/dist/7170.js +1 -1
  39. package/dist/755.js +1 -1
  40. package/dist/7654.js +1 -1
  41. package/dist/8037.js +1 -1
  42. package/dist/817.js +1 -1
  43. package/dist/8612.js +1 -1
  44. package/dist/8734.js +1 -1
  45. package/dist/881.js +1 -1
  46. package/dist/8869.js +1 -1
  47. package/dist/892.js +1 -1
  48. package/dist/8948.js +1 -1
  49. package/dist/8951.js +1 -1
  50. package/dist/9227.js +2 -0
  51. package/dist/9317.js +1 -1
  52. package/dist/9330.js +1 -1
  53. package/dist/9700.js +2 -0
  54. package/dist/9727.js +1 -1
  55. package/dist/9797.js +1 -1
  56. package/dist/9865.js +1 -1
  57. package/dist/9886.js +1 -1
  58. package/dist/9912.js +2 -0
  59. package/dist/9984.js +1 -1
  60. package/dist/main.css +1 -1
  61. package/dist/main.js +3094 -37761
  62. package/dist/main.js.LICENSE.txt +2 -2
  63. package/package.json +13 -14
  64. package/src/App.tsx +16 -16
  65. package/src/components/SampleDescription.tsx +1 -1
  66. package/src/components/alert/basic.tsx +2 -4
  67. package/src/components/alert/html.tsx +1 -2
  68. package/src/components/button/access-key.tsx +1 -1
  69. package/src/components/button/width.tsx +2 -2
  70. package/src/components/card/selection.tsx +4 -4
  71. package/src/components/input-date/partials/cases.tsx +2 -2
  72. package/src/components/link-button/basic.tsx +1 -1
  73. package/src/components/nav/basic.tsx +2 -55
  74. package/src/components/nav/horizontal.tsx +2 -51
  75. package/src/components/nav/links.ts +78 -0
  76. package/src/components/split-button/basic.tsx +5 -5
  77. package/src/components/table/badge-size.tsx +3 -2
  78. package/src/components/table/column-alignment.tsx +84 -0
  79. package/src/components/table/horizontal-scrollbar.tsx +57 -0
  80. package/src/components/table/pagination-position.tsx +34 -0
  81. package/src/components/table/render-cell.tsx +78 -22
  82. package/src/components/table/routes.ts +8 -4
  83. package/src/components/table/{sort-date.tsx → sort-data.tsx} +1 -1
  84. package/src/react.main.tsx +2 -3
  85. package/src/scenarios/appointment-form/DistrictForm.tsx +11 -11
  86. package/src/shares/theme.ts +12 -38
  87. package/dist/1399.js +0 -2
  88. package/dist/3035.js +0 -2
  89. package/dist/4114.js +0 -2
  90. package/dist/4563.js +0 -2
  91. package/dist/5440.js +0 -2
  92. package/dist/5496.js +0 -2
  93. package/dist/5767.js +0 -2
  94. package/dist/7432.js +0 -2
  95. package/dist/7432.js.LICENSE.txt +0 -3
  96. package/dist/9962.js +0 -2
  97. package/dist/9962.js.LICENSE.txt +0 -3
  98. /package/dist/{1399.js.LICENSE.txt → 3099.js.LICENSE.txt} +0 -0
  99. /package/dist/{3035.js.LICENSE.txt → 3600.js.LICENSE.txt} +0 -0
  100. /package/dist/{4114.js.LICENSE.txt → 3845.js.LICENSE.txt} +0 -0
  101. /package/dist/{4563.js.LICENSE.txt → 4378.js.LICENSE.txt} +0 -0
  102. /package/dist/{5440.js.LICENSE.txt → 9227.js.LICENSE.txt} +0 -0
  103. /package/dist/{5496.js.LICENSE.txt → 9700.js.LICENSE.txt} +0 -0
  104. /package/dist/{5767.js.LICENSE.txt → 9912.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.2
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.3
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.4-rc.0",
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.4-rc.0",
11
+ "@public-ui/react": "2.0.4-rc.0",
12
+ "@public-ui/themes": "2.0.4-rc.0",
13
+ "@types/node": "20.11.6",
14
+ "@types/react": "18.2.48",
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.2",
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.3.0",
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.3",
29
+ "react-router-dom": "6.21.3",
31
30
  "rimraf": "3.0.2",
32
31
  "ts-prune": "0.10.3",
33
32
  "typescript": "5.3.3",
@@ -55,7 +54,7 @@
55
54
  "format": "prettier --check src",
56
55
  "lint": "eslint \"{src,tests}/**/*.{html,js,json,jsx,ts,tsx,gql,graphql}\"",
57
56
  "serve": "cross-env NODE_ENV=development webpack serve --devtool=source-map",
58
- "start": "npm run serve",
57
+ "start": "npm run serve -- --open",
59
58
  "unused": "ts-prune -e src",
60
59
  "postinstall": "npm-run-all postinstall:*",
61
60
  "postinstall:components-assets": "cpy \"node_modules/@public-ui/components/assets/**/*\" public/assets --dot",
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
@@ -1,10 +1,8 @@
1
1
  import React from 'react';
2
2
  import { KolAlert } from '@public-ui/react';
3
3
 
4
- import { HeadingLevel } from '@public-ui/components/dist/types/types/heading-level';
5
-
6
4
  import { FC } from 'react';
7
- import { AlertType, AlertVariant } from '@public-ui/components';
5
+ import { AlertType, AlertVariant, HeadingLevel } from '@public-ui/components';
8
6
 
9
7
  type PropsByType = {
10
8
  level: HeadingLevel;
@@ -32,7 +30,7 @@ const AlertByType: FC<PropsByType> = ({ level, type, variant }) => (
32
30
  </>
33
31
  );
34
32
 
35
- export const AlertBasic: FC<PropsBasic> = ({ variant }) => (
33
+ export const AlertBasic: FC<PropsBasic> = ({ variant = 'msg' }) => (
36
34
  <div className="grid gap-4">
37
35
  <AlertByType level={1} type="default" variant={variant} />
38
36
  <AlertByType level={2} type="error" variant={variant} />
@@ -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>
@@ -2,59 +2,6 @@ import React from 'react';
2
2
  import { KolNav } from '@public-ui/react';
3
3
 
4
4
  import { FC } from 'react';
5
+ import { LINKS } from './links';
5
6
 
6
- export const NavBasic: FC = () => (
7
- <KolNav
8
- class="block w-sm"
9
- _label="Main navigation"
10
- _links={[
11
- {
12
- _label: 'Homepage',
13
- _icons: 'codicon codicon-home',
14
- _href: '#/',
15
- },
16
- {
17
- _label: '2 Navigation point',
18
- _href: '#/untermenu',
19
- },
20
- {
21
- _label: '3 Navigation point',
22
- _href: '#abc',
23
- _children: [
24
- {
25
- _label: '3.1 Navigation point',
26
- _href: '#/',
27
- },
28
- {
29
- _label: '3.2 Navigation point',
30
- _href: '#abc',
31
- _target: 'asdasd',
32
- },
33
- {
34
- _label: '3.3 Navigation point',
35
- _href: '#abc',
36
- _icons: 'fa-solid fa-cat',
37
- _children: [
38
- {
39
- _label: '3.3.1 Navigation point (active)',
40
- _href: '#abc',
41
- },
42
- { _label: '3.3.2 Navigation point', _href: '#abc' },
43
- ],
44
- },
45
- {
46
- _label: '3.4 Navigation point',
47
- _href: '#abc',
48
- _children: [
49
- { _label: '3.4.1 Navigation point', _href: '#abc' },
50
- { _label: '3.4.2 Navigation point', _href: '#abc' },
51
- ],
52
- },
53
- { _label: '3.5 Navigation point', _href: '#abc' },
54
- ],
55
- },
56
- { _label: '4 Navigation point', _href: '#abc' },
57
- ]}
58
- _hasCompactButton
59
- />
60
- );
7
+ export const NavBasic: FC = () => <KolNav class="block w-fit" _label="Main navigation" _links={LINKS} _hasCompactButton />;
@@ -2,55 +2,6 @@ import React from 'react';
2
2
  import { KolNav } from '@public-ui/react';
3
3
 
4
4
  import { FC } from 'react';
5
+ import { LINKS } from './links';
5
6
 
6
- export const NavHorizontal: FC = () => (
7
- <KolNav
8
- _label="Main navigation"
9
- _links={[
10
- {
11
- _label: 'Homepage',
12
- _href: '#/nav/horizontal',
13
- },
14
- {
15
- _label: '2 Navigation point',
16
- _href: '#/nav/horizontal',
17
- },
18
- {
19
- _label: '3 Navigation point',
20
- _href: '#/nav/horizontal',
21
- _children: [
22
- {
23
- _label: '3.1 Navigation point',
24
- },
25
- {
26
- _label: '3.2 Navigation point',
27
- _href: '#/nav/horizontal',
28
- _target: 'asdasd',
29
- },
30
- {
31
- _label: '3.3 Navigation point',
32
- _href: '#/nav/horizontal',
33
- _children: [
34
- {
35
- _label: '3.3.1 Navigation point (active)',
36
- _href: '#abc',
37
- },
38
- { _label: '3.3.2 Navigation point', _href: '#abc' },
39
- ],
40
- },
41
- {
42
- _label: '3.4 Navigation point',
43
- _href: '#/nav/horizontal',
44
- _children: [
45
- { _label: '3.4.1 Navigation point', _href: '#abc' },
46
- { _label: '3.4.2 Navigation point', _href: '#abc' },
47
- ],
48
- },
49
- { _label: '3.5 Navigation point', _href: '#abc' },
50
- ],
51
- },
52
- { _label: '4 Navigation point', _href: '#abc' },
53
- ]}
54
- _orientation="horizontal"
55
- />
56
- );
7
+ export const NavHorizontal: FC = () => <KolNav _label="Main navigation" _links={LINKS} _orientation="horizontal" />;
@@ -0,0 +1,78 @@
1
+ import { ButtonOrLinkOrTextWithChildrenProps } from '@public-ui/components';
2
+
3
+ export const LINKS: ButtonOrLinkOrTextWithChildrenProps[] = [
4
+ {
5
+ _label: 'Homepage',
6
+ _icons: 'codicon codicon-home',
7
+ _href: '#/',
8
+ },
9
+ {
10
+ _label: '2 Navigation point',
11
+ _href: '#/untermenu',
12
+ },
13
+ {
14
+ _label: '3 Navigation point',
15
+ _href: '#abc',
16
+ _icons: 'codicon codicon-home',
17
+ _children: [
18
+ {
19
+ _label: '3.1 Navigation point',
20
+ _icons: 'codicon codicon-home',
21
+ _href: '#/',
22
+ },
23
+ {
24
+ _label: '3.2 Navigation point',
25
+ _href: '#abc',
26
+ _target: 'asdasd',
27
+ },
28
+ {
29
+ _label: '3.3 Navigation point',
30
+ _href: '#abc',
31
+ _children: [
32
+ {
33
+ _label: '3.3.1 Navigation point',
34
+ _href: '#abc',
35
+ },
36
+ { _label: '3.3.2 Navigation point', _href: '#abc' },
37
+ ],
38
+ },
39
+ {
40
+ _label: '3.4 Navigation point',
41
+ _href: '#abc',
42
+ _children: [
43
+ {
44
+ _label: '3.4.1 Navigation point',
45
+ _href: '#abc',
46
+ _children: [
47
+ { _label: '3.4.1.1 Navigation point', _href: '#abc' },
48
+ { _label: '3.4.1.2 Navigation point (active)', _href: '#abc' },
49
+ ],
50
+ },
51
+ { _label: '3.4.2 Navigation point', _href: '#abc' },
52
+ ],
53
+ },
54
+ { _label: '3.5 Navigation point', _href: '#abc' },
55
+ ],
56
+ },
57
+ { _label: '4 Navigation point', _href: '#abc' },
58
+ {
59
+ _label: '5 Keine eigene Seite, nur Kategorie',
60
+ _active: true,
61
+ _children: [
62
+ {
63
+ _label: '5.1 Verschachtelter Link',
64
+ _href: '#abc',
65
+ },
66
+ ],
67
+ },
68
+ {
69
+ _label: '6 Keine eigene Seite, mit Icon',
70
+ _icons: 'codicon codicon-squirrel',
71
+ _children: [
72
+ {
73
+ _label: '6.1 Verschachtelter Link',
74
+ _href: '#abc',
75
+ },
76
+ ],
77
+ },
78
+ ];
@@ -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
+ );
@@ -0,0 +1,57 @@
1
+ import React, { FC, useState } from 'react';
2
+
3
+ import { KolHeading, KolInputCheckbox, KolTable } from '@public-ui/react';
4
+ import { KoliBriTableHeaders } from '@public-ui/components/src';
5
+ import { SampleDescription } from '../SampleDescription';
6
+
7
+ const DATA = [{ small: 'Small Example', large: 'Larger Example' }];
8
+ const HEADERS: KoliBriTableHeaders = {
9
+ horizontal: [
10
+ [
11
+ { label: 'Large Column', key: 'large', textAlign: 'left', width: '400px' },
12
+ { label: 'Small Column', key: 'small', textAlign: 'left', width: '200px' },
13
+ ],
14
+ ],
15
+ };
16
+
17
+ export const TableHorizontalScrollbar: FC = () => {
18
+ const [hasWidthRestriction, setHasWidthRestriction] = useState(true);
19
+
20
+ return (
21
+ <>
22
+ <SampleDescription>
23
+ Table examples with and without horizontal scrollbars. When a scrollbar is present, it should be possible to focus the table container and to scroll it
24
+ using arrow keys.
25
+ </SampleDescription>
26
+
27
+ <KolHeading _label="Table with scrollbar" _level={2} />
28
+
29
+ <KolTable
30
+ _label="Table for demonstration purposes with horizontal scrollbar."
31
+ _minWidth={hasWidthRestriction ? '600px' : 'auto'}
32
+ _headers={HEADERS}
33
+ _data={DATA}
34
+ className="block"
35
+ style={{ width: '400px' }}
36
+ />
37
+
38
+ <KolInputCheckbox
39
+ _checked={hasWidthRestriction}
40
+ _label="Toggle width restriction"
41
+ _variant="switch"
42
+ _on={{
43
+ onChange: (_event, value) => {
44
+ setHasWidthRestriction(Boolean(value));
45
+ },
46
+ }}
47
+ ></KolInputCheckbox>
48
+
49
+ <KolHeading _label="Same table without scrollbar" _level={2} className="block mt-4" />
50
+ <p className="mt-0">
51
+ <i>Scrollbar appears on very small viewport sizes</i>
52
+ </p>
53
+
54
+ <KolTable _label="Table for demonstration purposes without horizontal scrollbar" _minWidth="600px" _headers={HEADERS} _data={DATA} className="block" />
55
+ </>
56
+ );
57
+ };