@public-ui/sample-react 1.7.0-rc.5

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 (145) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +27 -0
  3. package/.gitignore +41 -0
  4. package/.prettierignore +4 -0
  5. package/package.json +66 -0
  6. package/prettier.config.js +6 -0
  7. package/public/index.html +28 -0
  8. package/src/App.tsx +259 -0
  9. package/src/declare.d.ts +4 -0
  10. package/src/main.ts +7 -0
  11. package/src/react.main.tsx +56 -0
  12. package/src/routes-test.ts +79 -0
  13. package/src/samples/abbr/basic.html +6 -0
  14. package/src/samples/abbr/basic.tsx +39 -0
  15. package/src/samples/abbr/routes.ts +9 -0
  16. package/src/samples/accordion/basic.tsx +18 -0
  17. package/src/samples/accordion/header.tsx +17 -0
  18. package/src/samples/accordion/headlines.tsx +27 -0
  19. package/src/samples/accordion/list.tsx +32 -0
  20. package/src/samples/accordion/routes.ts +17 -0
  21. package/src/samples/alert/basic.tsx +37 -0
  22. package/src/samples/alert/card-msg.tsx +11 -0
  23. package/src/samples/alert/html.tsx +29 -0
  24. package/src/samples/alert/routes.ts +15 -0
  25. package/src/samples/avatar/basic.tsx +10 -0
  26. package/src/samples/avatar/routes.ts +8 -0
  27. package/src/samples/badge/basic.tsx +18 -0
  28. package/src/samples/badge/button.tsx +25 -0
  29. package/src/samples/badge/routes.ts +12 -0
  30. package/src/samples/breadcrumb/basic.tsx +53 -0
  31. package/src/samples/breadcrumb/routes.ts +9 -0
  32. package/src/samples/button/basic.tsx +29 -0
  33. package/src/samples/button/hide-label.tsx +31 -0
  34. package/src/samples/button/icons.tsx +27 -0
  35. package/src/samples/button/routes.ts +18 -0
  36. package/src/samples/button/width.tsx +30 -0
  37. package/src/samples/button-group/basic.tsx +13 -0
  38. package/src/samples/button-group/routes.ts +9 -0
  39. package/src/samples/button-link/basic.tsx +23 -0
  40. package/src/samples/button-link/icons.tsx +37 -0
  41. package/src/samples/button-link/image.tsx +14 -0
  42. package/src/samples/button-link/routes.ts +18 -0
  43. package/src/samples/button-link/target.tsx +16 -0
  44. package/src/samples/card/basic.tsx +12 -0
  45. package/src/samples/card/confirm.tsx +19 -0
  46. package/src/samples/card/flex.tsx +44 -0
  47. package/src/samples/card/routes.ts +18 -0
  48. package/src/samples/card/selection.tsx +70 -0
  49. package/src/samples/details/basic.tsx +19 -0
  50. package/src/samples/details/routes.ts +9 -0
  51. package/src/samples/form/routes.ts +5 -0
  52. package/src/samples/handout/basic.tsx +1013 -0
  53. package/src/samples/handout/routes.ts +9 -0
  54. package/src/samples/heading/badged.tsx +27 -0
  55. package/src/samples/heading/basic.tsx +15 -0
  56. package/src/samples/heading/paragraph.tsx +45 -0
  57. package/src/samples/heading/routes.ts +15 -0
  58. package/src/samples/icon/basic.tsx +17 -0
  59. package/src/samples/icon/routes.ts +9 -0
  60. package/src/samples/indented-text/basic.tsx +24 -0
  61. package/src/samples/indented-text/routes.ts +9 -0
  62. package/src/samples/input-checkbox/basic.tsx +37 -0
  63. package/src/samples/input-checkbox/routes.ts +9 -0
  64. package/src/samples/input-color/basic.tsx +29 -0
  65. package/src/samples/input-color/routes.ts +9 -0
  66. package/src/samples/input-date/basic.tsx +20 -0
  67. package/src/samples/input-date/routes.ts +9 -0
  68. package/src/samples/input-email/basic.tsx +30 -0
  69. package/src/samples/input-email/routes.ts +9 -0
  70. package/src/samples/input-file/basic.tsx +25 -0
  71. package/src/samples/input-file/routes.ts +9 -0
  72. package/src/samples/input-number/basic.tsx +30 -0
  73. package/src/samples/input-number/routes.ts +9 -0
  74. package/src/samples/input-password/basic.tsx +41 -0
  75. package/src/samples/input-password/routes.ts +9 -0
  76. package/src/samples/input-radio/basic.tsx +46 -0
  77. package/src/samples/input-radio/horizontal.tsx +42 -0
  78. package/src/samples/input-radio/routes.ts +14 -0
  79. package/src/samples/input-radio/select.tsx +18 -0
  80. package/src/samples/input-range/basic.tsx +29 -0
  81. package/src/samples/input-range/routes.ts +9 -0
  82. package/src/samples/input-text/basic.tsx +72 -0
  83. package/src/samples/input-text/blur.tsx +16 -0
  84. package/src/samples/input-text/focus.tsx +24 -0
  85. package/src/samples/input-text/hidden-label.tsx +66 -0
  86. package/src/samples/input-text/routes.ts +16 -0
  87. package/src/samples/link/basic.tsx +23 -0
  88. package/src/samples/link/icons.tsx +37 -0
  89. package/src/samples/link/image.tsx +20 -0
  90. package/src/samples/link/routes.ts +18 -0
  91. package/src/samples/link/target.tsx +15 -0
  92. package/src/samples/link-button/basic.tsx +22 -0
  93. package/src/samples/link-button/routes.ts +9 -0
  94. package/src/samples/link-group/routes.ts +5 -0
  95. package/src/samples/nav/active.tsx +88 -0
  96. package/src/samples/nav/aria-current.tsx +22 -0
  97. package/src/samples/nav/basic.tsx +62 -0
  98. package/src/samples/nav/horizontal.tsx +59 -0
  99. package/src/samples/nav/routes.ts +18 -0
  100. package/src/samples/pagination/basic.tsx +12 -0
  101. package/src/samples/pagination/routes.ts +9 -0
  102. package/src/samples/popover/basic.tsx +36 -0
  103. package/src/samples/popover/routes.ts +8 -0
  104. package/src/samples/progress/basic.tsx +11 -0
  105. package/src/samples/progress/routes.ts +9 -0
  106. package/src/samples/select/basic.tsx +51 -0
  107. package/src/samples/select/routes.ts +9 -0
  108. package/src/samples/skip-nav/basic.tsx +33 -0
  109. package/src/samples/skip-nav/routes.ts +9 -0
  110. package/src/samples/spin/basic.tsx +6 -0
  111. package/src/samples/spin/custom.css +52 -0
  112. package/src/samples/spin/custom.tsx +11 -0
  113. package/src/samples/spin/cycle.tsx +6 -0
  114. package/src/samples/spin/routes.ts +13 -0
  115. package/src/samples/split-button/basic.tsx +46 -0
  116. package/src/samples/split-button/routes.ts +8 -0
  117. package/src/samples/table/badge-size.tsx +51 -0
  118. package/src/samples/table/render-cell.tsx +48 -0
  119. package/src/samples/table/routes.ts +15 -0
  120. package/src/samples/table/sort-date.tsx +33 -0
  121. package/src/samples/table/test-data.ts +66 -0
  122. package/src/samples/textarea/adjust-height.tsx +22 -0
  123. package/src/samples/textarea/basic.tsx +11 -0
  124. package/src/samples/textarea/disabled.tsx +10 -0
  125. package/src/samples/textarea/placeholder.tsx +10 -0
  126. package/src/samples/textarea/readonly.tsx +10 -0
  127. package/src/samples/textarea/resize.tsx +13 -0
  128. package/src/samples/textarea/routes.ts +27 -0
  129. package/src/samples/textarea/rows.tsx +10 -0
  130. package/src/samples/toast/basic.tsx +21 -0
  131. package/src/samples/toast/routes.ts +8 -0
  132. package/src/samples/version/basic.tsx +6 -0
  133. package/src/samples/version/context.tsx +12 -0
  134. package/src/samples/version/routes.ts +12 -0
  135. package/src/shares/constants.ts +2 -0
  136. package/src/shares/react-roots.ts +10 -0
  137. package/src/shares/routes.ts +87 -0
  138. package/src/shares/store.ts +85 -0
  139. package/src/shares/theme.ts +103 -0
  140. package/src/shares/types.ts +4 -0
  141. package/src/style.scss +89 -0
  142. package/test-build.sh +2 -0
  143. package/tsconfig.json +32 -0
  144. package/unocss.config.ts +7 -0
  145. package/webpack.config.js +14 -0
@@ -0,0 +1,72 @@
1
+ import React from 'react';
2
+ import { KolForm, KolInputText } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ import { ERROR_MSG, HINT_MSG } from '../../shares/constants';
7
+
8
+ export const InputTextBasic: FC = () => (
9
+ <KolForm className="grid gap-4">
10
+ <KolInputText
11
+ _id=""
12
+ _hint={HINT_MSG}
13
+ _error={ERROR_MSG}
14
+ _placeholder="Mit Icons"
15
+ _icon={{
16
+ left: 'codicon codicon-arrow-left',
17
+ right: {
18
+ icon: 'codicon codicon-arrow-right',
19
+ style: {
20
+ 'font-size': '200%',
21
+ },
22
+ },
23
+ }}
24
+ _on={{
25
+ onBlur: console.log,
26
+ onChange: console.log,
27
+ onClick: console.log,
28
+ onFocus: console.log,
29
+ }}
30
+ _hideLabel
31
+ _required
32
+ _smartButton={{
33
+ _icon: {
34
+ left: {
35
+ icon: 'codicon codicon-eye',
36
+ },
37
+ },
38
+ _hideLabel: true,
39
+ _label: 'Passwort anzeigen',
40
+ _on: {
41
+ onClick: () => {},
42
+ },
43
+ }}
44
+ _type="search"
45
+ _label="Suche"
46
+ />
47
+ <KolInputText
48
+ _id=""
49
+ _error={ERROR_MSG}
50
+ _placeholder="Mit Icons"
51
+ _label="Suche"
52
+ _icon={{
53
+ left: {
54
+ icon: 'codicon codicon-arrow-left',
55
+ },
56
+ right: {
57
+ icon: 'codicon codicon-arrow-right',
58
+ },
59
+ }}
60
+ _hideLabel
61
+ _type="search"
62
+ />
63
+ <KolInputText _id="" _placeholder="Placeholder" _label="Vorname (text)" _required />
64
+ <KolInputText _id="" _placeholder="Placeholder" _label="Suche (search)" _type="search" />
65
+ <KolInputText _id="vorname" _placeholder="Placeholder" _error={ERROR_MSG} _type="url" _label="URL (url)" />
66
+ <KolInputText _id="" _placeholder="Placeholder" _type="tel" _label="Telefon (tel)" />
67
+ <KolInputText _id="" _placeholder="Placeholder" _read-only _label="Vorname (text, readonly)" />
68
+ <KolInputText _id="" _value="Value" _read-only _label="Vorname (text, readonly)" />
69
+ <KolInputText _id="" _placeholder="Placeholder" _disabled _label="Vorname (text, disabled)" />
70
+ <KolInputText _id="" _value="Value" _disabled _label="Vorname (text, disabled)" />
71
+ </KolForm>
72
+ );
@@ -0,0 +1,16 @@
1
+ import { KolForm, KolInputText } from '@public-ui/react';
2
+ import React from 'react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ export const InputTextBlur: FC = () => (
7
+ <KolForm className="grid gap-4">
8
+ <KolInputText
9
+ _on={{
10
+ onBlur: console.log,
11
+ }}
12
+ _type="search"
13
+ _label="Suche"
14
+ />
15
+ </KolForm>
16
+ );
@@ -0,0 +1,24 @@
1
+ import React, { useLayoutEffect, useRef } from 'react';
2
+ import { KolButton, KolForm, KolInputText } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ export const InputTextFocus: FC = () => {
7
+ const ref = useRef<HTMLKolInputTextElement | null>(null);
8
+
9
+ useLayoutEffect(() => {
10
+ setTimeout(() => {
11
+ ref.current?.focus();
12
+ }, 100);
13
+ }, [ref]);
14
+
15
+ return (
16
+ <KolForm className="grid gap-4">
17
+ <KolInputText ref={ref} _id="vorname" _label="Vorname" />
18
+ <KolInputText _label="Nachname" />
19
+ <div>
20
+ <KolButton _label="Submit"></KolButton>
21
+ </div>
22
+ </KolForm>
23
+ );
24
+ };
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ import { KolForm, KolInputText } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ import { ERROR_MSG, HINT_MSG } from '../../shares/constants';
7
+
8
+ export const InputTextHiddenLabel: FC = () => (
9
+ <KolForm className="grid gap-4">
10
+ <KolInputText
11
+ _id=""
12
+ _hint={HINT_MSG}
13
+ _hideLabel
14
+ _error={ERROR_MSG}
15
+ _placeholder="Mit Icons"
16
+ _icon={{
17
+ left: 'codicon codicon-arrow-left',
18
+ right: {
19
+ icon: 'codicon codicon-arrow-right',
20
+ style: {
21
+ 'font-size': '200%',
22
+ },
23
+ },
24
+ }}
25
+ _required
26
+ _smartButton={{
27
+ _icon: {
28
+ left: {
29
+ icon: 'codicon codicon-eye',
30
+ },
31
+ },
32
+ _hideLabel: true,
33
+ _label: 'Passwort anzeigen',
34
+ _on: {
35
+ onClick: () => {},
36
+ },
37
+ }}
38
+ _type="search"
39
+ _label="Suche"
40
+ />
41
+ <KolInputText
42
+ _id=""
43
+ _error={ERROR_MSG}
44
+ _hideLabel
45
+ _placeholder="Mit Icons"
46
+ _icon={{
47
+ left: {
48
+ icon: 'codicon codicon-arrow-left',
49
+ },
50
+ right: {
51
+ icon: 'codicon codicon-arrow-right',
52
+ },
53
+ }}
54
+ _type="search"
55
+ _label="Suche"
56
+ />
57
+ <KolInputText _id="" _hideLabel _placeholder="Placeholder" _label="Vorname (text)" _required />
58
+ <KolInputText _id="" _placeholder="Placeholder" _type="search" _label="Suche (search)" />
59
+ <KolInputText _id="vorname" _placeholder="Placeholder" _error={ERROR_MSG} _type="url" _label="URL (url)" />
60
+ <KolInputText _id="" _placeholder="Placeholder" _type="tel" _label="Telefon (tel)" />
61
+ <KolInputText _id="" _placeholder="Placeholder" _read-only _label="Vorname (text, readonly)" />
62
+ <KolInputText _id="" _value="Value" _read-only _label="Vorname (text, readonly)" />
63
+ <KolInputText _id="" _placeholder="Placeholder" _disabled _label="Vorname (text, disabled)" />
64
+ <KolInputText _id="" _value="Value" _disabled _label="Vorname (text, disabled)" />
65
+ </KolForm>
66
+ );
@@ -0,0 +1,16 @@
1
+ import { Routes } from '../../shares/types';
2
+
3
+ import { InputTextBasic } from './basic';
4
+ import { InputTextBlur } from './blur';
5
+ import { InputTextFocus } from './focus';
6
+
7
+ import { InputTextHiddenLabel } from './hidden-label';
8
+
9
+ export const INPUT_TEXT_ROUTES: Routes = {
10
+ 'input-text': {
11
+ basic: InputTextBasic,
12
+ 'hidden-label': InputTextHiddenLabel,
13
+ blur: InputTextBlur,
14
+ focus: InputTextFocus,
15
+ },
16
+ };
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { KolLink } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ export const LinkBasic: FC = () => (
7
+ <div className="grid gap-4">
8
+ <KolLink _href="#" _label="Simple Link" />
9
+ <p>
10
+ In diesem Absatz wird ein Link gesetzt, der keine weiteren Attribute enthält. <KolLink _href="#" _label="Simple Link" /> Er wird standardmäßig als{' '}
11
+ <strong>inline-Element</strong> ausgegeben.
12
+ </p>
13
+ <p>
14
+ In diesem Absatz wird ein Link gesetzt, der einmal als inline-block-Element ausgegeben wird.{' '}
15
+ <KolLink class="d-inline-block" _href="#" _label="Simple Link" />. Damit kann man mir per CSS-Styles eine Breite, eine Höhe und andere Eigenschaften
16
+ zuweisen.
17
+ <br />
18
+ <br />
19
+ Danach folgt ein Link, der als block-Element ausgegeben wird.
20
+ <KolLink class="d-block" _href="#" _label="Simple Link" />, daher gehe ich über die ganze Breite des Eltern-Elements erzeuge so einen Zeilenumbruch.
21
+ </p>
22
+ </div>
23
+ );
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { KolLink } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ export const LinkIcons: FC = () => (
7
+ <div className="grid gap-4">
8
+ <KolLink _icon="codicon codicon-home" _label="Ich bin ein Link mit Icon links" />
9
+ <KolLink
10
+ _icon={{
11
+ right: 'codicon codicon-home',
12
+ }}
13
+ _label="Ich bin ein Link mit Icon rechts"
14
+ />
15
+ <KolLink
16
+ _icon={{
17
+ top: 'codicon codicon-home',
18
+ }}
19
+ _label="Ich bin ein Link mit Icon oben"
20
+ />
21
+ <KolLink
22
+ _icon={{
23
+ bottom: 'codicon codicon-home',
24
+ }}
25
+ _label="Ich bin ein Link mit Icon unten"
26
+ />
27
+ <KolLink
28
+ _icon={{
29
+ top: 'codicon codicon-home',
30
+ right: 'codicon codicon-home',
31
+ bottom: 'codicon codicon-home',
32
+ left: 'codicon codicon-home',
33
+ }}
34
+ _label="Ich bin ein Link mit allen Icons"
35
+ />
36
+ </div>
37
+ );
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { KolKolibri, KolLink } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ export const LinkImage: FC = () => (
7
+ <div className="grid gap-4">
8
+ <KolLink _href="#" _label="Ich bin ein Link, der als Text gerendert wird" />
9
+ <br />
10
+ <KolLink _href="#" _label="">
11
+ <img alt="Abgrenzung" slot="expert" src="https://public-ui.github.io/assets/abgrenzung.jpg" width="300" />
12
+ <KolKolibri></KolKolibri>
13
+ </KolLink>
14
+ <KolKolibri />
15
+ <br />
16
+ <KolLink _href="#" _label="">
17
+ <img alt="Abgrenzung" slot="expert" src="https://public-ui.github.io/assets/abgrenzung.jpg" width="300" />
18
+ </KolLink>
19
+ </div>
20
+ );
@@ -0,0 +1,18 @@
1
+ import { Routes } from '../../shares/types';
2
+
3
+ import { LinkBasic } from './basic';
4
+
5
+ import { LinkIcons } from './icons';
6
+
7
+ import { LinkImage } from './image';
8
+
9
+ import { LinkTarget } from './target';
10
+
11
+ export const LINK_ROUTES: Routes = {
12
+ link: {
13
+ basic: LinkBasic,
14
+ icons: LinkIcons,
15
+ image: LinkImage,
16
+ target: LinkTarget,
17
+ },
18
+ };
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { KolLink } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ export const LinkTarget: FC = () => (
7
+ <div className="d-flex gap-4">
8
+ <KolLink _href="#" _label="Ich bin ein Link ohne Target" />
9
+ <KolLink _href="#" _label="Ich bin ein Link mit Target (_self)" _target="_self" />
10
+ <KolLink _href="#" _label="Ich bin ein Link mit Target (_blank)" _target="_blank" />
11
+ <KolLink _href="#" _icon="codicon codicon-home" _hideLabel _label="Ich bin ein Link ohne Target" />
12
+ <KolLink _href="#" _icon="codicon codicon-home" _hideLabel _label="Ich bin ein Link mit Target (_self)" _target="_self" />
13
+ <KolLink _href="#" _icon="codicon codicon-home" _hideLabel _label="Ich bin ein Link mit Target (_blank)" _target="_blank" />
14
+ </div>
15
+ );
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { KolLinkButton } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ const ARGS = {
7
+ _on: {
8
+ onClick: (_event, _value) => alert('Klick!'),
9
+ },
10
+ };
11
+
12
+ export const LinkButtonBasic: FC = () => (
13
+ <div className="grid gap-14">
14
+ <div className="flex flex-warp gap-14">
15
+ <KolLinkButton _label="Primary" _variant="primary" {...ARGS}></KolLinkButton>
16
+ <KolLinkButton _label="Secondary" _variant="secondary" {...ARGS}></KolLinkButton>
17
+ <KolLinkButton _label="Normal" _variant="normal" {...ARGS}></KolLinkButton>
18
+ <KolLinkButton _label="Danger" _variant="danger" {...ARGS}></KolLinkButton>
19
+ <KolLinkButton _label="Ghost" _variant="ghost" {...ARGS}></KolLinkButton>
20
+ </div>
21
+ </div>
22
+ );
@@ -0,0 +1,9 @@
1
+ import { Routes } from '../../shares/types';
2
+
3
+ import { LinkButtonBasic } from './basic';
4
+
5
+ export const LINK_BUTTON_ROUTES: Routes = {
6
+ 'link-button': {
7
+ basic: LinkButtonBasic,
8
+ },
9
+ };
@@ -0,0 +1,5 @@
1
+ import { Routes } from '../../shares/types';
2
+
3
+ export const LINK_GROUP_ROUTES: Routes = {
4
+ 'link-group': {},
5
+ };
@@ -0,0 +1,88 @@
1
+ import React from 'react';
2
+ import { KolNav } from '@public-ui/react';
3
+
4
+ import { FC, useEffect, useState } from 'react';
5
+
6
+ import { useNavigate } from 'react-router';
7
+
8
+ export const NavActive: FC = () => {
9
+ const [links, setLinks] = useState([]);
10
+
11
+ const handleLinks = (route: string) => {
12
+ const link = links.find((link) => link._label === route);
13
+ link._active = !link._active;
14
+ setLinks(links);
15
+ };
16
+
17
+ useEffect(() => {
18
+ setLinks([
19
+ {
20
+ _label: 'Main',
21
+ _icon: 'fa-solid fa-house',
22
+ _on: {
23
+ onClick: () => handleLinks('Main'),
24
+ },
25
+ },
26
+ {
27
+ _label: 'Abbr',
28
+ _on: {
29
+ onClick: () => handleLinks('Abbr'),
30
+ },
31
+ },
32
+ {
33
+ _label: 'Accordion',
34
+ _on: {
35
+ onClick: () => handleLinks('Accordion'),
36
+ },
37
+ },
38
+ {
39
+ _active: false,
40
+ _label: 'Alert',
41
+ _on: {
42
+ onClick: () => handleLinks('Alert'),
43
+ },
44
+ _children: [
45
+ {
46
+ _label: 'Main',
47
+ _icon: 'fa-solid fa-house',
48
+ _on: {
49
+ onClick: () => handleLinks('/'),
50
+ },
51
+ },
52
+ {
53
+ _label: 'Abbr',
54
+ _href: '/abbr',
55
+ _on: {
56
+ onClick: () => handleLinks('/abbr'),
57
+ },
58
+ },
59
+ {
60
+ _label: 'Accordion',
61
+ _href: '/accordion',
62
+ _on: {
63
+ onClick: () => handleLinks('/accordion'),
64
+ },
65
+ },
66
+ {
67
+ _label: 'Alert',
68
+ _href: '/alert',
69
+ },
70
+ {
71
+ _label: 'Badget',
72
+ _on: {
73
+ onClick: () => handleLinks('/badget'),
74
+ },
75
+ },
76
+ ],
77
+ },
78
+ {
79
+ _label: 'Badget',
80
+ _on: {
81
+ onClick: () => handleLinks('Badget'),
82
+ },
83
+ },
84
+ ]);
85
+ }, []);
86
+
87
+ return <KolNav _ariaLabel="Main navigation" _links={links} />;
88
+ };
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { KolNav } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ export const NavAriaCurrent: FC = () => (
7
+ <KolNav
8
+ _ariaLabel="Main navigation"
9
+ _links={[
10
+ {
11
+ _label: 'Homepage',
12
+ _href: '#/',
13
+ },
14
+ {
15
+ _label: '2 Navigation point',
16
+ _href: '#/untermenu',
17
+ _active: true,
18
+ },
19
+ ]}
20
+ _ariaCurrentValue="page"
21
+ />
22
+ );
@@ -0,0 +1,62 @@
1
+ import React from 'react';
2
+ import { KolNav } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ export const NavBasic: FC = () => (
7
+ <KolNav
8
+ _ariaLabel="Main navigation"
9
+ _links={[
10
+ {
11
+ _label: 'Homepage',
12
+ _icon: 'fa-solid fa-house',
13
+ _href: '#/',
14
+ },
15
+ {
16
+ _label: '2 Navigation point',
17
+ _href: '#/untermenu',
18
+ },
19
+ {
20
+ _active: true,
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
+ _active: true,
35
+ _label: '3.3 Navigation point',
36
+ _href: '#abc',
37
+ _icon: 'fa-solid fa-cat',
38
+ _children: [
39
+ {
40
+ _active: true,
41
+ _label: '3.3.1 Navigation point (active)',
42
+ _href: '#abc',
43
+ },
44
+ { _label: '3.3.2 Navigation point', _href: '#abc' },
45
+ ],
46
+ },
47
+ {
48
+ _label: '3.4 Navigation point',
49
+ _href: '#abc',
50
+ _children: [
51
+ { _label: '3.4.1 Navigation point', _href: '#abc' },
52
+ { _label: '3.4.2 Navigation point', _href: '#abc' },
53
+ ],
54
+ },
55
+ { _label: '3.5 Navigation point', _href: '#abc' },
56
+ ],
57
+ },
58
+ { _label: '4 Navigation point', _href: '#abc' },
59
+ ]}
60
+ _hasCompactButton
61
+ />
62
+ );
@@ -0,0 +1,59 @@
1
+ import React from 'react';
2
+ import { KolNav } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ export const NavHorizontal: FC = () => (
7
+ <KolNav
8
+ _ariaLabel="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
+ _active: true,
20
+ _label: '3 Navigation point',
21
+ _href: '#/nav/horizontal',
22
+ _children: [
23
+ {
24
+ _label: '3.1 Navigation point',
25
+ },
26
+ {
27
+ _label: '3.2 Navigation point',
28
+ _href: '#/nav/horizontal',
29
+ _target: 'asdasd',
30
+ },
31
+ {
32
+ _active: true,
33
+ _label: '3.3 Navigation point',
34
+ _href: '#/nav/horizontal',
35
+ _children: [
36
+ {
37
+ _active: true,
38
+ _label: '3.3.1 Navigation point (active)',
39
+ _href: '#abc',
40
+ },
41
+ { _label: '3.3.2 Navigation point', _href: '#abc' },
42
+ ],
43
+ },
44
+ {
45
+ _label: '3.4 Navigation point',
46
+ _href: '#/nav/horizontal',
47
+ _children: [
48
+ { _label: '3.4.1 Navigation point', _href: '#abc' },
49
+ { _label: '3.4.2 Navigation point', _href: '#abc' },
50
+ ],
51
+ },
52
+ { _label: '3.5 Navigation point', _href: '#abc' },
53
+ ],
54
+ },
55
+ { _label: '4 Navigation point', _href: '#abc' },
56
+ ]}
57
+ _orientation="horizontal"
58
+ />
59
+ );
@@ -0,0 +1,18 @@
1
+ import { Routes } from '../../shares/types';
2
+
3
+ import { NavActive } from './active';
4
+
5
+ import { NavAriaCurrent } from './aria-current';
6
+
7
+ import { NavBasic } from './basic';
8
+
9
+ import { NavHorizontal } from './horizontal';
10
+
11
+ export const NAV_ROUTES: Routes = {
12
+ nav: {
13
+ basic: NavBasic,
14
+ active: NavActive,
15
+ 'aria-current': NavAriaCurrent,
16
+ horizontal: NavHorizontal,
17
+ },
18
+ };
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { KolPagination } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ export const PaginationBasic: FC = () => (
7
+ <div className="grid gap-4">
8
+ <KolPagination _total={10} _page={6} _siblingCount={0} />
9
+ <KolPagination _total={10} _page={6} _siblingCount={2} _variant="danger" />
10
+ <KolPagination _total={10} _page={6} _siblingCount={0} _boundaryCount={2} _variant="ghost" />
11
+ </div>
12
+ );
@@ -0,0 +1,9 @@
1
+ import { Routes } from '../../shares/types';
2
+
3
+ import { PaginationBasic } from './basic';
4
+
5
+ export const PAGINATION_ROUTES: Routes = {
6
+ pagination: {
7
+ basic: PaginationBasic,
8
+ },
9
+ };
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { KolButton, KolInputPassword, KolInputText, KolPopover } from '@public-ui/react';
3
+
4
+ import { FC } from 'react';
5
+
6
+ export const PopoverBasic: FC = () => {
7
+ const [top, setTop] = React.useState(false);
8
+ const [right, setRight] = React.useState(false);
9
+ const [bottom, setBottom] = React.useState(false);
10
+ const [left, setLeft] = React.useState(false);
11
+ const [login, setLogin] = React.useState(false);
12
+
13
+ return (
14
+ <div className="grid gap-4 max-w-[400px] mx-auto pt-8">
15
+ <KolButton _label="Oben" _icon="codicon codicon-arrow-up" _variant="primary" _on={{ onClick: () => setTop(!top) }}></KolButton>
16
+ <KolPopover _show={top}>Ich bin oberhalb</KolPopover>
17
+ <KolButton _label="Rechts" _icon="codicon codicon-arrow-right" _variant="danger" _on={{ onClick: () => setRight(!right) }}></KolButton>
18
+ <KolPopover _align="right" _show={right}>
19
+ Ich bin rechts
20
+ </KolPopover>
21
+ <KolButton _label="Unten" _icon="codicon codicon-arrow-down" _variant="secondary" _on={{ onClick: () => setBottom(!bottom) }}></KolButton>
22
+ <KolPopover _align="bottom" _show={bottom}>
23
+ Ich bin unterhalb
24
+ </KolPopover>
25
+ <KolButton _label="Links" _icon="codicon codicon-arrow-left" _variant="normal" _on={{ onClick: () => setLeft(!left) }}></KolButton>
26
+ <KolPopover _align="left" _show={left}>
27
+ Ich bin links
28
+ </KolPopover>
29
+ <KolButton _label="PR starten" _icon="codicon codicon-git-pull-request" _variant="normal" _on={{ onClick: () => setLogin(!login) }}></KolButton>
30
+ <KolPopover _show={login}>
31
+ <KolInputText>Benutzername</KolInputText>
32
+ <KolInputPassword>Passwort</KolInputPassword>
33
+ </KolPopover>
34
+ </div>
35
+ );
36
+ };
@@ -0,0 +1,8 @@
1
+ import { Routes } from '../../shares/types';
2
+ import { PopoverBasic } from './basic';
3
+
4
+ export const POPOVER_ROUTES: Routes = {
5
+ popover: {
6
+ basic: PopoverBasic,
7
+ },
8
+ };