@public-ui/sample-react 2.0.0 → 2.0.1

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 (86) hide show
  1. package/dist/1474.js +1 -1
  2. package/dist/{5139.js → 1644.js} +2 -2
  3. package/dist/183.js +1 -1
  4. package/dist/2337.js +1 -1
  5. package/dist/2412.js +1 -1
  6. package/dist/3303.js +1 -1
  7. package/dist/3325.js +1 -1
  8. package/dist/3429.js +1 -1
  9. package/dist/3459.js +1 -1
  10. package/dist/3932.js +1 -1
  11. package/dist/4022.js +1 -1
  12. package/dist/4164.js +1 -1
  13. package/dist/4195.js +1 -1
  14. package/dist/4291.js +1 -1
  15. package/dist/4323.js +1 -1
  16. package/dist/4355.js +1 -1
  17. package/dist/4564.js +1 -1
  18. package/dist/4891.js +1 -1
  19. package/dist/5183.js +1 -1
  20. package/dist/5369.js +1 -1
  21. package/dist/{5869.js → 5382.js} +2 -2
  22. package/dist/5390.js +1 -1
  23. package/dist/540.js +1 -1
  24. package/dist/5717.js +1 -1
  25. package/dist/5862.js +1 -1
  26. package/dist/5866.js +1 -1
  27. package/dist/589.js +2 -0
  28. package/dist/6012.js +1 -1
  29. package/dist/6068.js +1 -1
  30. package/dist/6210.js +1 -1
  31. package/dist/6320.js +1 -1
  32. package/dist/6558.js +1 -1
  33. package/dist/6813.js +1 -1
  34. package/dist/6908.js +1 -1
  35. package/dist/7029.js +1 -1
  36. package/dist/7255.js +1 -1
  37. package/dist/7447.js +1 -1
  38. package/dist/7535.js +1 -1
  39. package/dist/7715.js +1 -1
  40. package/dist/7722.js +1 -1
  41. package/dist/7734.js +1 -1
  42. package/dist/7801.js +1 -1
  43. package/dist/7858.js +1 -1
  44. package/dist/7955.js +1 -1
  45. package/dist/7995.js +1 -1
  46. package/dist/8061.js +1 -1
  47. package/dist/8065.js +1 -1
  48. package/dist/8073.js +1 -1
  49. package/dist/8111.js +1 -1
  50. package/dist/8255.js +1 -1
  51. package/dist/8291.js +1 -1
  52. package/dist/8709.js +1 -1
  53. package/dist/8761.js +1 -1
  54. package/dist/9734.js +1 -1
  55. package/dist/9747.js +1 -1
  56. package/dist/979.js +2 -0
  57. package/dist/9792.js +1 -1
  58. package/dist/9895.js +1 -1
  59. package/dist/9963.js +1 -1
  60. package/dist/9972.js +1 -1
  61. package/dist/main.css +1 -1
  62. package/dist/main.js +315 -301
  63. package/dist/main.js.LICENSE.txt +2 -2
  64. package/package.json +12 -12
  65. package/src/components/badge/basic.tsx +5 -9
  66. package/src/components/badge/button.tsx +16 -12
  67. package/src/components/heading/badged.tsx +5 -5
  68. package/src/components/input-radio/partials/cases.tsx +1 -1
  69. package/src/components/kolibri/basic.tsx +16 -2
  70. package/src/components/kolibri/routes.ts +0 -4
  71. package/src/components/nav/aria-current.tsx +25 -15
  72. package/src/components/nav/basic.tsx +1 -3
  73. package/src/components/nav/horizontal.tsx +0 -3
  74. package/src/components/nav/routes.ts +0 -6
  75. package/src/components/split-button/basic.tsx +13 -2
  76. package/src/react.main.tsx +11 -5
  77. package/src/scenarios/inputs-get-value.tsx +2 -2
  78. package/dist/4916.js +0 -2
  79. package/dist/8316.js +0 -2
  80. package/src/components/kolibri/animated.tsx +0 -4
  81. package/src/components/kolibri/no-label.tsx +0 -4
  82. package/src/components/nav/active.tsx +0 -87
  83. /package/dist/{4916.js.LICENSE.txt → 1644.js.LICENSE.txt} +0 -0
  84. /package/dist/{5139.js.LICENSE.txt → 5382.js.LICENSE.txt} +0 -0
  85. /package/dist/{5869.js.LICENSE.txt → 589.js.LICENSE.txt} +0 -0
  86. /package/dist/{8316.js.LICENSE.txt → 979.js.LICENSE.txt} +0 -0
@@ -35,7 +35,7 @@
35
35
  */
36
36
 
37
37
  /**
38
- * @remix-run/router v1.13.1
38
+ * @remix-run/router v1.14.0
39
39
  *
40
40
  * Copyright (c) Remix Software Inc.
41
41
  *
@@ -46,7 +46,7 @@
46
46
  */
47
47
 
48
48
  /**
49
- * React Router v6.20.1
49
+ * React Router v6.21.0
50
50
  *
51
51
  * Copyright (c) Remix Software Inc.
52
52
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/sample-react",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "This app contains samples for the KoliBri/Public UI",
5
5
  "license": "EUPL-1.2",
6
6
  "dependencies": {
@@ -8,16 +8,16 @@
8
8
  "@leanup/stack-react": "1.3.48",
9
9
  "@leanup/stack-webpack": "1.3.48",
10
10
  "@public-oss/kolibri-themes": "0.0.3",
11
- "@public-ui/components": "2.0.0",
12
- "@public-ui/react": "2.0.0",
13
- "@public-ui/themes": "2.0.0",
14
- "@types/node": "20.10.3",
15
- "@types/react": "18.2.41",
16
- "@types/react-dom": "18.2.17",
11
+ "@public-ui/components": "2.0.1",
12
+ "@public-ui/react": "2.0.1",
13
+ "@public-ui/themes": "2.0.1",
14
+ "@types/node": "20.10.5",
15
+ "@types/react": "18.2.45",
16
+ "@types/react-dom": "18.2.18",
17
17
  "@unocss/preset-uno": "0.58.0",
18
18
  "@unocss/webpack": "0.58.0",
19
19
  "ajv": "8.12.0",
20
- "chromedriver": "119.0.1",
20
+ "chromedriver": "120.0.0",
21
21
  "cpy-cli": "5.0.0",
22
22
  "eslint-plugin-jsx-a11y": "6.8.0",
23
23
  "eslint-plugin-react": "7.33.2",
@@ -26,13 +26,13 @@
26
26
  "npm-run-all": "4.1.5",
27
27
  "react": "18.2.0",
28
28
  "react-dom": "18.2.0",
29
- "react-router": "6.20.1",
30
- "react-router-dom": "6.20.1",
29
+ "react-router": "6.21.0",
30
+ "react-router-dom": "6.21.0",
31
31
  "rimraf": "3.0.2",
32
32
  "ts-prune": "0.10.3",
33
- "typescript": "5.3.2",
33
+ "typescript": "5.3.3",
34
34
  "world_countries_lists": "2.8.2",
35
- "yup": "1.3.2"
35
+ "yup": "1.3.3"
36
36
  },
37
37
  "files": [
38
38
  ".eslintignore",
@@ -3,16 +3,12 @@ import { KolBadge } from '@public-ui/react';
3
3
 
4
4
  import { FC } from 'react';
5
5
 
6
- const PROPS = {
7
- _label: 'Label',
8
- };
9
-
10
6
  export const BadgeBasic: FC = () => (
11
7
  <div className="flex gap-2">
12
- <KolBadge {...PROPS}></KolBadge>
13
- <KolBadge _color="#86ffc6" {...PROPS}></KolBadge>
14
- <KolBadge _color="#06539e" {...PROPS}></KolBadge>
15
- <KolBadge _color="#ae0000" {...PROPS}></KolBadge>
16
- <KolBadge _color="#8b008b" {...PROPS}></KolBadge>
8
+ <KolBadge _label="schwarz"></KolBadge>
9
+ <KolBadge _color="#86ffc6" _label="türkis"></KolBadge>
10
+ <KolBadge _color="#06539e" _label="blau"></KolBadge>
11
+ <KolBadge _color="#ae0000" _label="rot"></KolBadge>
12
+ <KolBadge _color="#8b008b" _label="lila"></KolBadge>
17
13
  </div>
18
14
  );
@@ -1,25 +1,29 @@
1
1
  import React from 'react';
2
- import { KolBadge } from '@public-ui/react';
2
+ import { KolBadge, KolHeading } from '@public-ui/react';
3
3
 
4
4
  import { FC } from 'react';
5
5
 
6
- const PROPS = {
7
- _label: 'Label',
6
+ const createBadgeProps = (label: string) => ({
8
7
  _smartButton: {
9
8
  _icons: 'codicon codicon-close',
10
- _label: 'Entfernen',
9
+ _label: `Entfernen von ${label}`,
11
10
  _on: {
12
11
  onClick: () => alert('clicked'),
13
12
  },
14
13
  },
15
- };
14
+ });
16
15
 
17
16
  export const BadgeButton: FC = () => (
18
- <div className="flex gap-2">
19
- <KolBadge {...PROPS}></KolBadge>
20
- <KolBadge _color="#86ffc6" {...PROPS}></KolBadge>
21
- <KolBadge _color="#06539e" {...PROPS}></KolBadge>
22
- <KolBadge _color="#ae0000" {...PROPS}></KolBadge>
23
- <KolBadge _color="#8b008b" {...PROPS}></KolBadge>
24
- </div>
17
+ <>
18
+ <div className="mb-4">
19
+ <KolHeading _label="Badge" _level={2} />
20
+ </div>
21
+ <div className="flex gap-2">
22
+ <KolBadge _label="schwarz" {...createBadgeProps('schwarz')}></KolBadge>
23
+ <KolBadge _label="türkis" _color="#86ffc6" {...createBadgeProps('türkis')}></KolBadge>
24
+ <KolBadge _label="blau" _color="#06539e" {...createBadgeProps('blau')}></KolBadge>
25
+ <KolBadge _label="rot" _color="#ae0000" {...createBadgeProps('rot')}></KolBadge>
26
+ <KolBadge _label="lila" _color="#8b008b" {...createBadgeProps('lila')}></KolBadge>
27
+ </div>
28
+ </>
25
29
  );
@@ -7,27 +7,27 @@ export const HeadingBadged: FC = () => (
7
7
  <div className="grid gap-4">
8
8
  <KolHeading _label="" _level={1}>
9
9
  <span slot="expert">
10
- Eine Überschrift mit einem <KolBadge _color="#f00" _label="Label"></KolBadge>
10
+ Eine Überschrift mit einem <KolBadge _label="Label"></KolBadge>
11
11
  </span>
12
12
  </KolHeading>
13
13
  <KolHeading _label="" _level={2}>
14
14
  <span slot="expert">
15
- Eine Überschrift mit einem <KolBadge _color="#0f0" _label="Label"></KolBadge>
15
+ Eine Überschrift mit einem <KolBadge _color="#86ffc6" _label="Label"></KolBadge>
16
16
  </span>
17
17
  </KolHeading>
18
18
  <KolHeading _label="" _level={3}>
19
19
  <span slot="expert">
20
- Eine Überschrift mit einem <KolBadge _color="#00f" _label="Label"></KolBadge>
20
+ Eine Überschrift mit einem <KolBadge _color="#06539e" _label="Label"></KolBadge>
21
21
  </span>
22
22
  </KolHeading>
23
23
  <KolHeading _label="" _level={4}>
24
24
  <span slot="expert">
25
- Eine Überschrift mit einem <KolBadge _color="#800080" _label="Label"></KolBadge>
25
+ Eine Überschrift mit einem <KolBadge _color="#ae0000" _label="Label"></KolBadge>
26
26
  </span>
27
27
  </KolHeading>
28
28
  <KolHeading _label="" _level={5}>
29
29
  <span slot="expert">
30
- Eine Überschrift mit einem <KolBadge _color="#ff0" _label="Label"></KolBadge>
30
+ Eine Überschrift mit einem <KolBadge _color="#8b008b" _label="Label"></KolBadge>
31
31
  </span>
32
32
  </KolHeading>
33
33
  <KolHeading _label="" _level={6}>
@@ -10,7 +10,7 @@ export const InputRadioCases = forwardRef<HTMLKolInputRadioElement, Components.K
10
10
  <div className="grid gap-4">
11
11
  <KolInputRadio
12
12
  {...props}
13
- _options="[{'label':'Frau','value':'Frau'},{'disabled':true,'label':'Herr (disabled)'},{'label':'Firma','value':'Firma'}]"
13
+ _options="[{'disabled':true,'label':'Frau (disabled)','value':'Frau'},{'label':'Herr'},{'label':'Firma','value':'Firma'}]"
14
14
  _label="Anrede"
15
15
  />
16
16
  <KolInputRadio
@@ -1,4 +1,18 @@
1
1
  import React, { FC } from 'react';
2
- import { KolKolibri } from '@public-ui/react';
2
+ import { KolKolibri, KolHeading } from '@public-ui/react';
3
+ import { SampleDescription } from '../SampleDescription';
3
4
 
4
- export const KolibriBasic: FC = () => <KolKolibri style={{ width: 300 }} />;
5
+ export const KolibriBasic: FC = () => (
6
+ <>
7
+ <SampleDescription>
8
+ <p>Das KoliBri-Logo in verschiedenen Varianten</p>
9
+ </SampleDescription>
10
+
11
+ <KolHeading class="block" _level={3} _label="Regular" />
12
+ <KolKolibri class="block" style={{ width: 300 }} />
13
+ <KolHeading class="block" _level={3} _label="Ohne Label" />
14
+ <KolKolibri class="block" style={{ width: 300 }} _labeled={false} />
15
+ <KolHeading class="block" _level={3} _label="Individuelle Farbe" />
16
+ <KolKolibri class="block" style={{ width: 300 }} _color="#cc006e" />
17
+ </>
18
+ );
@@ -1,13 +1,9 @@
1
1
  import { Routes } from '../../shares/types';
2
2
 
3
3
  import { KolibriBasic } from './basic';
4
- import { KolibriAnimated } from './animated';
5
- import { KolibriNoLabel } from './no-label';
6
4
 
7
5
  export const KOLIBRI_ROUTES: Routes = {
8
6
  kolibri: {
9
7
  basic: KolibriBasic,
10
- animated: KolibriAnimated,
11
- 'no-label': KolibriNoLabel,
12
8
  },
13
9
  };
@@ -2,21 +2,31 @@ import React from 'react';
2
2
  import { KolNav } from '@public-ui/react';
3
3
 
4
4
  import { FC } from 'react';
5
+ import { SampleDescription } from '../SampleDescription';
5
6
 
6
7
  export const NavAriaCurrent: FC = () => (
7
- <KolNav
8
- _label="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
- />
8
+ <>
9
+ <SampleDescription>
10
+ <p>
11
+ Dieses Beispiel zeigt eine Navigation, bei welcher der zweite Link auf die aktuelle Seite verweist. Dadurch wird ihm automatisch das Attribut{' '}
12
+ <code>aria-current=&quot;page&quot;</code> zugewiesen.
13
+ </p>
14
+ </SampleDescription>
15
+
16
+ <KolNav
17
+ class="block w-sm"
18
+ _label="Main navigation"
19
+ _links={[
20
+ {
21
+ _label: 'Homepage',
22
+ _href: '#/',
23
+ },
24
+ {
25
+ _label: 'Nav - aria-current (Aktuelle Seite)',
26
+ _href: '#/nav/aria-current',
27
+ _active: true,
28
+ },
29
+ ]}
30
+ />
31
+ </>
22
32
  );
@@ -5,6 +5,7 @@ import { FC } from 'react';
5
5
 
6
6
  export const NavBasic: FC = () => (
7
7
  <KolNav
8
+ class="block w-sm"
8
9
  _label="Main navigation"
9
10
  _links={[
10
11
  {
@@ -17,7 +18,6 @@ export const NavBasic: FC = () => (
17
18
  _href: '#/untermenu',
18
19
  },
19
20
  {
20
- _active: true,
21
21
  _label: '3 Navigation point',
22
22
  _href: '#abc',
23
23
  _children: [
@@ -31,13 +31,11 @@ export const NavBasic: FC = () => (
31
31
  _target: 'asdasd',
32
32
  },
33
33
  {
34
- _active: true,
35
34
  _label: '3.3 Navigation point',
36
35
  _href: '#abc',
37
36
  _icons: 'fa-solid fa-cat',
38
37
  _children: [
39
38
  {
40
- _active: true,
41
39
  _label: '3.3.1 Navigation point (active)',
42
40
  _href: '#abc',
43
41
  },
@@ -16,7 +16,6 @@ export const NavHorizontal: FC = () => (
16
16
  _href: '#/nav/horizontal',
17
17
  },
18
18
  {
19
- _active: true,
20
19
  _label: '3 Navigation point',
21
20
  _href: '#/nav/horizontal',
22
21
  _children: [
@@ -29,12 +28,10 @@ export const NavHorizontal: FC = () => (
29
28
  _target: 'asdasd',
30
29
  },
31
30
  {
32
- _active: true,
33
31
  _label: '3.3 Navigation point',
34
32
  _href: '#/nav/horizontal',
35
33
  _children: [
36
34
  {
37
- _active: true,
38
35
  _label: '3.3.1 Navigation point (active)',
39
36
  _href: '#abc',
40
37
  },
@@ -1,17 +1,11 @@
1
1
  import { Routes } from '../../shares/types';
2
-
3
- import { NavActive } from './active';
4
-
5
2
  import { NavAriaCurrent } from './aria-current';
6
-
7
3
  import { NavBasic } from './basic';
8
-
9
4
  import { NavHorizontal } from './horizontal';
10
5
 
11
6
  export const NAV_ROUTES: Routes = {
12
7
  nav: {
13
8
  basic: NavBasic,
14
- active: NavActive,
15
9
  'aria-current': NavAriaCurrent,
16
10
  horizontal: NavHorizontal,
17
11
  },
@@ -1,13 +1,24 @@
1
+ import { ToasterService } from '@public-ui/components';
1
2
  import React, { FC } from 'react';
2
3
  import { KolSplitButton } from '@public-ui/react';
3
4
 
5
+ const toaster = ToasterService.getInstance(document);
6
+
4
7
  export const SplitButtonBasic: FC = () => {
8
+ const handleButtonClick = () => {
9
+ void toaster.enqueue({
10
+ description: 'The Button has been clicked.',
11
+ label: `Button Clicked`,
12
+ type: 'info',
13
+ });
14
+ };
15
+
5
16
  return (
6
17
  <div className="grid gap-4">
7
- <KolSplitButton _label="Nur der Pfeil öffnet" _on={{ onClick: console.log }}>
18
+ <KolSplitButton _label="Nur der Pfeil öffnet" className="w-200px" _on={{ onClick: handleButtonClick }}>
8
19
  Drowndown-Inhalt
9
20
  </KolSplitButton>
10
- <KolSplitButton _label="ohne label" _hide-label _icons="codicon codicon-git-pull-request">
21
+ <KolSplitButton _label="ohne label" _hide-label _icons="codicon codicon-git-pull-request" className="w-200px">
11
22
  Drowndown-Inhalt
12
23
  </KolSplitButton>
13
24
  </div>
@@ -3,7 +3,7 @@ import { createRoot } from 'react-dom/client';
3
3
  import { HashRouter as Router } from 'react-router-dom';
4
4
 
5
5
  import { defineCustomElements } from '@public-ui/components/dist/loader';
6
- import type { Generic } from '@a11y-ui/core';
6
+ import type { Generic } from 'adopted-style-sheets';
7
7
  import { register } from '@public-ui/components';
8
8
  import { BAMF, BMF, BZStv1, DEFAULT, DESYv1, DESYv2, ECL_EC, ECL_EU, ITZBund, MAPZ, ZOLLv2, ZOLLv3 } from '@public-ui/themes';
9
9
  import { TH } from '@public-oss/kolibri-themes';
@@ -35,12 +35,18 @@ void (async () => {
35
35
 
36
36
  /**
37
37
  * You should patch the theme after the components and your default theme are registered.
38
- *
38
+ **
39
39
  * ↓ That is a tiny sample!
40
40
  */
41
- // KoliBriDevHelper.patchTheme('my-theme', {
42
- // 'KOL-BUTTON': 'button{border:2px solid red;}',
43
- // });
41
+ // KoliBriDevHelper.patchTheme(
42
+ // 'default',
43
+ // {
44
+ // 'KOL-BUTTON': 'button{border:2px solid red;}',
45
+ // },
46
+ // {
47
+ // append: true,
48
+ // },
49
+ // );
44
50
 
45
51
  const htmlDivElement = document.querySelector('div#app');
46
52
  if (htmlDivElement instanceof HTMLDivElement) {
@@ -70,8 +70,8 @@ export const InputsGetValue: FC = () => {
70
70
  <EventTargetContext.Provider value={eventTarget}>
71
71
  <SampleDescription>
72
72
  <p>
73
- This sample show how the input components <code>getValue()</code> method works. It&apos;s called when clicking the &quout;getValue()&quout; button
74
- and prints the current value right next to itself.
73
+ This sample show how the input components <code>getValue()</code> method works. It&apos;s called when clicking the &quot;getValue()&quot; button and
74
+ prints the current value right next to itself.
75
75
  </p>
76
76
  </SampleDescription>
77
77
 
package/dist/4916.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 4916.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_public_ui_sample_react=self.webpackChunk_public_ui_sample_react||[]).push([[4916],{4916:(t,e,l)=>{l.r(e),l.d(e,{initialize:()=>s});var i=l(6278),r=l(5869);function n(t,e){try{Object.defineProperty(i.K,t,{get:function(){return e}})}catch(e){i.L.debug(`KoliBri property ${t} is already bind.`)}}const o=(t,e)=>i.L.debug(`${t} ${e?"":"not "}activated`),s=()=>{if((0,i.i)(),(0,i.h)()){(0,i.j)(),n("a11yColorContrast",r.l),n("querySelector",r.k),n("querySelectorAll",r.n),n("querySelectorColors",r.q),n("utils",(function(){return r.j})),n("parseJson",r.p),n("stringifyJson",r.t);const t=(0,i.b)().body,e=(0,i.b)().createElement("svg");if(e.setAttribute("aria-label","KoliBri-DevTools"),e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("role","toolbar"),e.setAttribute("style","position: fixed;color: black;font-size: 200%;bottom: 0.25rem;right: 0.25rem;"),e.innerHTML='<svg\n xmlns="http://www.w3.org/2000/svg"\n width="50"\n height="50"\n viewBox="0 0 600 600"\n>\n <path d="M353 322L213 304V434L353 322Z" fill="#047" />\n <path d="M209 564V304L149 434L209 564Z" fill="#047" />\n <path d="M357 316L417 250L361 210L275 244L357 316Z" fill="#047" />\n <path d="M353 318L35 36L213 300L353 318Z" fill="#047" />\n <path d="M329 218L237 92L250 222L272 241L329 218Z" fill="#047" />\n <path d="M391 286L565 272L421 252L391 286Z" fill="#047" />\n</svg>',(0,i.b)().body.appendChild(e),o("Development mode",(0,i.h)()),o("Experimental mode",(0,i.d)()),o("Color contrast analysis",(0,i.k)()),(0,i.k)()){const e=setTimeout((()=>{clearTimeout(e),setInterval((()=>{r.j.queryHtmlElementColors((0,i.b)().createElement("div"),(0,r.l)(t),!1,!1)}),1e4)}),2500)}}}}}]);
package/dist/8316.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 8316.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_public_ui_sample_react=self.webpackChunk_public_ui_sample_react||[]).push([[8316],{7822:(t,e,o)=>{o.d(e,{I:()=>i});var n=o(7429);const i=({accessKey:t,label:e})=>{let[o,...i]=e.split(t);return 0===i.length&&(t=t.toUpperCase(),[o,...i]=e.split(t)),0===i.length&&(t=t.toLowerCase(),[o,...i]=e.split(t)),(0,n.h)(n.F,null,o,i.length?(0,n.h)(n.F,null,(0,n.h)("u",null,t),i.join(t)):null)}},3978:(t,e,o)=>{o.d(e,{A:()=>a});var n=o(5869),i=o(5628);const s=(0,o(6278).d)();class a{constructor(t,e,o){var n,a;if(this.setFormAssociatedValue=t=>{var e;const o=null===(e=this.formAssociated)||void 0===e?void 0:e.getAttribute("name");null!==o&&""!==o||(0,i.d)(` The form field (${this.name}) must have a name attribute to be form-associated. Please define the _name attribute.`);const n=this.tryToStringifyValue(t);this.syncValue(t,n,this.formAssociated),this.syncValue(t,n,this.syncToOwnInput)},this.component=t,this.host=this.findHostWithShadowRoot(o),this.name=e,s){switch(null===(n=this.host)||void 0===n||n.querySelectorAll("input,select,textarea").forEach((t=>{var e;null===(e=this.host)||void 0===e||e.removeChild(t)})),this.name){case"button":this.formAssociated=document.createElement("button");break;case"select":this.formAssociated=document.createElement("select"),this.formAssociated.setAttribute("multiple","");break;case"textarea":this.formAssociated=document.createElement("textarea");break;default:this.formAssociated=document.createElement("input"),this.formAssociated.setAttribute("type","hidden")}this.formAssociated.setAttribute("aria-hidden","true"),this.formAssociated.setAttribute("data-form-associated",""),this.formAssociated.setAttribute("hidden",""),null===(a=this.host)||void 0===a||a.appendChild(this.formAssociated)}}findHostWithShadowRoot(t){for(;null===(null==t?void 0:t.shadowRoot)&&t!==document.body;)(t=null==t?void 0:t.parentNode).host&&(t=t.host);return t}setAttribute(t,e,o){if(s)try{if("boolean"!=typeof(o="object"==typeof o&&null!==o?JSON.stringify(o):o)&&"number"!=typeof o&&"string"!=typeof o)throw new Error("Invalid value type: "+typeof o);null==e||e.setAttribute(t,`${o}`)}catch(o){null==e||e.removeAttribute(t)}}tryToStringifyValue(t){try{return"object"==typeof t&&null!==t?JSON.stringify(t).toString():null==t?null:t.toString()}catch(t){return(0,i.g)(`The form field raw value is not able to stringify! ${t}`),""}}syncValue(t,e,o){o&&("select"===this.name?(o.querySelectorAll("option").forEach((t=>{o.removeChild(t)})),Array.isArray(t)&&t.forEach((t=>{const e=this.tryToStringifyValue(t);if("string"==typeof e){const t=document.createElement("option");t.setAttribute("value",e),t.setAttribute("selected",""),o.appendChild(t)}}))):"string"==typeof e?(o.setAttribute("value",e),o.value=e):(o.removeAttribute("value"),o.value=""))}validateName(t){((t,e,o)=>{(0,n.d)(t,"_name",e,o)})(this.component,t,{hooks:{afterPatch:()=>{this.setAttribute("name",this.formAssociated,this.component.state._name)}}}),void 0===t&&(0,i.d)("Ein Name am Eingabefeldern oder Schalter ist nicht zwingend erforderlich, kann aber für die Autocomplete-Funktion und für das statische Versenden des Eingabefeldes relevant sein.")}validateSyncValueBySelector(t){if(s&&"string"==typeof t){const e=document.querySelector(t);e&&(this.syncToOwnInput=e)}}componentWillLoad(){this.validateName(this.component._name),this.validateSyncValueBySelector(this.component._syncValueBySelector)}}},6433:(t,e,o)=>{o.d(e,{I:()=>u,g:()=>h});var n=o(5869),i=o(8609),s=o(6789),a=o(5628),r=o(347),l=o(7108),c=o(3978);const h=t=>{const e="string"==typeof t._error&&t._error.length>0&&!0===t._touched,o="string"==typeof t._hint&&t._hint.length>0,n=[];return!0===e&&n.push(`${t._id}-error`),!0===o&&n.push(`${t._id}-hint`),{hasError:e,hasHint:o,ariaDescribedBy:n}};class d extends c.A{constructor(t,e,o){super(t,e,o),this.component=t}validateAlert(t){(0,n.a)(this.component,"_alert",t)}validateTouched(t){((t,e)=>{(0,n.a)(t,"_touched",e)})(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateAlert(this.component._alert),this.validateTouched(this.component._touched)}}class u extends d{constructor(t,e,o){super(t,e,o),this.valueChangeListeners=[],this.onFacade={onBlur:this.onBlur.bind(this),onChange:this.onChange.bind(this),onClick:this.onClick.bind(this),onFocus:this.onFocus.bind(this)},this.component=t}validateAccessKey(t){(0,n.d)(this.component,"_accessKey",t)}validateAdjustHeight(t){((t,e)=>{(0,n.a)(t,"_adjustHeight",e)})(this.component,t)}validateDisabled(t){(0,n.a)(this.component,"_disabled",t),!0===t&&(0,a.e)()}validateError(t){(0,n.d)(this.component,"_error",t)}validateHideError(t){((t,e,o)=>{(0,n.a)(t,"_hideError",e,o)})(this.component,t,{hooks:{afterPatch:()=>{this.component.state._hideError&&(0,a.a)("Property hide-error for inputs: Only use when the error message is shown outside of the input component.")}}})}validateHideLabel(t){(0,i.v)(this.component,t,{hooks:{afterPatch:()=>{this.component.state._hideLabel&&(0,a.a)("Property hide-label for inputs: Only use for exceptions like search inputs that are clearly identifiable by their context.")}}})}validateHint(t){(0,n.d)(this.component,"_hint",t)}validateId(t){(0,n.d)(this.component,"_id",t,{hooks:{afterPatch:()=>{this.setAttribute("id",this.formAssociated,this.component.state._id)}},minLength:1}),""!==t&&void 0!==t||(0,a.d)("Eine eindeutige ID an den Eingabefeldern ist nicht zwingend erforderlich, könnte aber für die E2E-Tests relevant sein.")}validateLabel(t){(0,s.a)(this.component,t)}validateOn(t){"object"==typeof t&&(0,n.s)(this.component,"_on",t)}validateSmartButton(t){(0,n.o)(t,(()=>{try{t=(0,n.p)(t)}catch(t){}(0,n.s)(this.component,"_smartButton",t)}))}validateTabIndex(t){(0,l.v)(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateAccessKey(this.component._accessKey),this.validateAdjustHeight(this.component._adjustHeight),this.validateError(this.component._error),this.validateDisabled(this.component._disabled),this.validateHideError(this.component._hideError),this.validateHideLabel(this.component._hideLabel),this.validateHint(this.component._hint),this.validateId(this.component._id),this.validateLabel(this.component._label),this.validateSmartButton(this.component._smartButton),this.validateOn(this.component._on),this.validateTabIndex(this.component._tabIndex)}onBlur(t){var e;this.component._alert=!0,this.component._touched=!0,(0,r.s)(t),(0,r.t)("blur",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onBlur)&&this.component._on.onBlur(t)}onChange(t){var e;const o=t.target.value;(0,r.t)("change",this.host,o),this.setFormAssociatedValue(o),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onChange)&&this.component._on.onChange(t,o),this.valueChangeListeners.forEach((t=>t(o)))}onClick(t){var e;(0,r.s)(t),(0,r.t)("click",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onClick)&&this.component._on.onClick(t)}onFocus(t){var e;this.component._alert=!0,(0,r.s)(t),(0,r.t)("focus",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onFocus)&&this.component._on.onFocus(t)}addValueChangeListener(t){this.valueChangeListeners.push(t)}}},7273:(t,e,o)=>{o.d(e,{I:()=>l});var n=o(677),i=o(5869),s=o(6088),a=o(6433);const r=(t,e)=>{const o=t;"object"==typeof o&&null!==o&&((0,s.i)(o.right,1)&&(o.right={icon:o.right}),(0,s.i)(o.left,1)&&(o.left={icon:o.left}),e.set("_icons",o))};class l extends a.I{constructor(t,e,o){super(t,e,o),this.component=t}validateIcon(t){this.validateIcons(t)}validateIcons(t){(0,i.o)(t,(()=>{try{t=(0,i.p)(t)}catch(t){}(0,i.w)(this.component,"_icons",(t=>"object"==typeof t&&null!==t&&((0,s.i)(t.left,1)||(0,n.i)(t.left)||(0,s.i)(t.right,1)||(0,n.i)(t.right))),new Set(["KoliBriHorizontalIcon"]),t,{hooks:{beforePatch:r},required:!0})}))}componentWillLoad(){super.componentWillLoad(),this.validateIcons(this.component._icons||this.component._icon)}}},347:(t,e,o)=>{function n(t){t.stopImmediatePropagation(),t.stopPropagation()}function i(t,e,o){e&&function(t,e,o){const n=t.dispatchEvent(function(t,e){return new CustomEvent(`kol-${t}`,{bubbles:!0,cancelable:!0,composed:!0,detail:e})}(e,o))}(e,t,o)}o.d(e,{s:()=>n,t:()=>i})},8609:(t,e,o)=>{o.d(e,{v:()=>i});var n=o(5869);const i=(t,e,o={})=>{(0,n.a)(t,"_hideLabel",e,o)}},677:(t,e,o)=>{o.d(e,{i:()=>a,v:()=>r});var n=o(5869),i=o(6088);const s=(t,e,o)=>{(0,i.c)(o)?t[e]=o:(0,i.i)(o,1)&&(t[e]={icon:o})},a=t=>"object"==typeof t&&null!==t&&(void 0===t.style||(0,i.b)(t.style))&&(0,i.i)(t.icon,1),r=(t,e)=>{(0,n.o)(e,(()=>{try{e=(0,n.p)(e)}catch(t){}(0,n.w)(t,"_icons",(t=>null===t||(0,i.i)(t,1)||"object"==typeof t&&null!==t&&((0,i.i)(t.left,1)||a(t.left)||(0,i.i)(t.right,1)||a(t.right)||(0,i.i)(t.top,1)||a(t.top)||(0,i.i)(t.bottom,1)||a(t.bottom))),new Set(["KoliBriIcon"]),e,{hooks:{beforePatch:(e,o)=>{null===e&&o.set("_icons",{}),(t=>{var e,o,n;if(null===(e=t.nextState)||void 0===e?void 0:e.has("_icons")){const e=null===(o=t.nextState)||void 0===o?void 0:o.get("_icons");null===(n=t.nextState)||void 0===n||n.set("_icons",(t=>{let e={};return(0,i.i)(t,1)?e={left:{icon:t}}:"object"==typeof t&&null!==t&&(s(e,"top",t.top),s(e,"right",t.right),s(e,"bottom",t.bottom),s(e,"left",t.left)),e})(e))}})(t)}},required:!0})}))}},6789:(t,e,o)=>{o.d(e,{a:()=>d,c:()=>l,h:()=>r,v:()=>h});var n=o(5628),i=o(5869);const s=/[a-zA-Z0-9äöüÄÖÜß]/g,a=/^\d+$/;function r(t,e=1){return function(t){var e;return"string"==typeof t&&(null===(e=t.match(s))||void 0===e?void 0:e.length)||0}(t)>=e}function l(t){return a.test(t)}const c=new Set(["string"]),h=(t,e,o={})=>{(0,i.w)(t,"_label",(t=>"string"==typeof t),c,e,function(t){var e;return{hooks:{afterPatch:(e,o,i,s)=>{var a,c;"function"==typeof(null===(a=t.hooks)||void 0===a?void 0:a.afterPatch)&&(null===(c=t.hooks)||void 0===c||c.afterPatch(e,o,i,s)),"string"==typeof e&&!1===r(e,3)&&!1===l(e)&&(0,n.a)(`The heading or label ("${e}") is not accessible. A label should consist of at least three readable characters.`),"string"==typeof e&&e.length>80&&(0,n.u)("A heading or label should not be longer than 80 characters.")},beforePatch:null===(e=t.hooks)||void 0===e?void 0:e.beforePatch}}}(o))},d=h},7108:(t,e,o)=>{o.d(e,{v:()=>a});var n=o(5628),i=o(5869);const s={hooks:{afterPatch:t=>{-1!==t&&0!==t&&(0,n.a)("Don’t Use Tabindex Greater than 0: https://adrianroselli.com/2014/11/dont-use-tabindex-greater-than-0.html")}}},a=(t,e)=>{(0,i.e)(t,"_tabIndex",e,s)}}}]);
@@ -1,4 +0,0 @@
1
- import React, { FC } from 'react';
2
- import { KolKolibri } from '@public-ui/react';
3
-
4
- export const KolibriAnimated: FC = () => <KolKolibri _animate style={{ width: 300 }}></KolKolibri>;
@@ -1,4 +0,0 @@
1
- import React, { FC } from 'react';
2
- import { KolKolibri } from '@public-ui/react';
3
-
4
- export const KolibriNoLabel: FC = () => <KolKolibri _labeled={false} style={{ width: 300 }}></KolKolibri>;
@@ -1,87 +0,0 @@
1
- import React from 'react';
2
- import { KolNav } from '@public-ui/react';
3
-
4
- import { FC, useEffect, useState } from 'react';
5
- import { ButtonOrLinkOrTextWithChildrenProps } from '@public-ui/components';
6
-
7
- export const NavActive: FC = () => {
8
- const [links, setLinks] = useState<ButtonOrLinkOrTextWithChildrenProps[]>([]);
9
-
10
- const handleLinks = (route: string) => {
11
- const link = links.find((link) => link._label === route);
12
- if (!link) return;
13
- link._active = !link._active;
14
- setLinks(links);
15
- };
16
- useEffect(() => {
17
- setLinks([
18
- {
19
- _label: 'Main',
20
- _icons: 'codicon codicon-home',
21
- _on: {
22
- onClick: () => handleLinks('Main'),
23
- },
24
- },
25
- {
26
- _label: 'Abbr',
27
- _on: {
28
- onClick: () => handleLinks('Abbr'),
29
- },
30
- },
31
- {
32
- _label: 'Accordion',
33
- _on: {
34
- onClick: () => handleLinks('Accordion'),
35
- },
36
- },
37
- {
38
- _active: true,
39
- _label: 'Alert',
40
- _on: {
41
- onClick: () => handleLinks('Alert'),
42
- },
43
- _children: [
44
- {
45
- _label: 'Main',
46
- _icons: 'codicon codicon-home',
47
- _on: {
48
- onClick: () => handleLinks('/'),
49
- },
50
- },
51
- {
52
- _active: true,
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
- return <KolNav _ariaLabel="Main navigation" _links={links} />;
87
- };