@public-ui/sample-react 4.6.0-rc.1 → 4.6.0-rc.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/sample-react",
3
- "version": "4.6.0-rc.1",
3
+ "version": "4.6.0-rc.2",
4
4
  "description": "This app contains samples for the KoliBri/Public UI",
5
5
  "type": "module",
6
6
  "license": "EUPL-1.2",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@hookform/resolvers": "5.9.2",
13
- "@stencil/core": "4.45.2",
13
+ "@stencil/core": "4.45.3",
14
14
  "@types/node": "26.4.0",
15
15
  "@types/papaparse": "5.5.2",
16
16
  "papaparse": "5.7.0",
@@ -20,13 +20,13 @@
20
20
  "typescript": "5.9.3",
21
21
  "world_countries_lists": "3.3.0",
22
22
  "zod": "4.6.7",
23
- "@public-ui/react-v19": "4.6.0-rc.1",
24
- "@public-ui/react-hook-form-adapter": "4.6.0-rc.1"
23
+ "@public-ui/react-hook-form-adapter": "4.6.0-rc.2",
24
+ "@public-ui/react-v19": "4.6.0-rc.2"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/react": "19.2.18",
28
28
  "@types/react-dom": "19.2.5",
29
- "adopted-style-sheets": "1.1.9-rc.25",
29
+ "adopted-style-sheets": "1.2.0-rc.3",
30
30
  "eslint": "9.39.5",
31
31
  "knip": "6.42.1",
32
32
  "prettier": "3.9.10",
@@ -37,7 +37,7 @@
37
37
  "react": "19.2.8",
38
38
  "react-dom": "19.2.8",
39
39
  "react-router": "8.4.0",
40
- "@public-ui/components": "4.6.0-rc.1"
40
+ "@public-ui/components": "4.6.0-rc.2"
41
41
  },
42
42
  "files": [
43
43
  "assets",
@@ -0,0 +1,50 @@
1
+ import React, { useEffect, useState } from 'react';
2
+
3
+ import { KolButton, KolProgress } from '@public-ui/react-v19';
4
+
5
+ import type { FC } from 'react';
6
+ import { SampleBlock } from '../SampleBlock';
7
+ import { SampleDescription } from '../SampleDescription';
8
+
9
+ const MAX = 100;
10
+ const STEP = 5;
11
+ const TICK_MS = 1000;
12
+
13
+ export const ProgressDynamic: FC = () => {
14
+ const [value, setValue] = useState<number>(0);
15
+ const [running, setRunning] = useState<boolean>(true);
16
+ const [mounted, setMounted] = useState<boolean>(true);
17
+
18
+ useEffect(() => {
19
+ if (!running) {
20
+ return;
21
+ }
22
+ const timer = setInterval(() => setValue((current) => (current >= MAX ? 0 : current + STEP)), TICK_MS);
23
+ return () => clearInterval(timer);
24
+ }, [running]);
25
+
26
+ return (
27
+ <>
28
+ <SampleDescription>
29
+ <p>
30
+ The value grows by {STEP} every second and starts again at 0 after {MAX}. Screen readers announce the current value every 5 seconds through the live
31
+ region. Removing and inserting the components again checks that the announcement continues afterwards.
32
+ </p>
33
+ </SampleDescription>
34
+
35
+ <SampleBlock id="progress-dynamic" skipSnapshot>
36
+ <div className="flex gap-4">
37
+ <KolButton _label={running ? 'Pause' : 'Resume'} _on={{ onClick: () => setRunning(!running) }} />
38
+ <KolButton _label={mounted ? 'Remove' : 'Insert'} _on={{ onClick: () => setMounted(!mounted) }} />
39
+ </div>
40
+
41
+ {mounted && (
42
+ <>
43
+ <KolProgress _label="Upload" _variant="bar" _max={MAX} _value={value} />
44
+ <KolProgress _label="Upload" _variant="cycle" _max={MAX} _value={value} />
45
+ </>
46
+ )}
47
+ </SampleBlock>
48
+ </>
49
+ );
50
+ };
@@ -1,10 +1,12 @@
1
1
  import type { Routes } from '../../shares/types';
2
2
  import { ProgressBasic } from './basic';
3
3
  import { ProgressChanging } from './changing';
4
+ import { ProgressDynamic } from './dynamic';
4
5
 
5
6
  export const PROGRESS_ROUTES: Routes = {
6
7
  progress: {
7
8
  basic: ProgressBasic,
8
9
  changing: ProgressChanging,
10
+ dynamic: ProgressDynamic,
9
11
  },
10
12
  };
@@ -44,10 +44,10 @@ export const TabsAlign: FC = () => (
44
44
  <div key={align} className="grid gap-4">
45
45
  <KolHeading _level={2} _label={text} />
46
46
  <KolTabs _tabs={tabs} _align={align} _label={text}>
47
- <div slot="tab-0">Contents of Tab 1</div>
48
- <div slot="tab-1">Contents of Tab 2</div>
49
- <div slot="tab-2">Contents of Tab 3</div>
50
- <div slot="tab-3">Contents of Tab 4</div>
47
+ <p slot="tab-0">Contents of Tab 1</p>
48
+ <p slot="tab-1">Contents of Tab 2</p>
49
+ <p slot="tab-2">Contents of Tab 3</p>
50
+ <p slot="tab-3">Contents of Tab 4</p>
51
51
  </KolTabs>
52
52
  </div>
53
53
  );
@@ -43,19 +43,19 @@ export const TabsBasic: FC = () => (
43
43
 
44
44
  <SampleBlock id="regular">
45
45
  <KolTabs _tabs={tabsWithoutIcons} _label="Regular tabs">
46
- <div slot="tab-0">Contents of Tab 1</div>
47
- <div slot="tab-1">Contents of Tab 2</div>
48
- <div slot="tab-2">Contents of Tab 3</div>
49
- <div slot="tab-3">Contents of Tab 4</div>
46
+ <p slot="tab-0">Contents of Tab 1</p>
47
+ <p slot="tab-1">Contents of Tab 2</p>
48
+ <p slot="tab-2">Contents of Tab 3</p>
49
+ <p slot="tab-3">Contents of Tab 4</p>
50
50
  </KolTabs>
51
51
  </SampleBlock>
52
52
 
53
53
  <SampleBlock id="icons">
54
54
  <KolTabs _tabs={tabs} className="mt-4" _label="Tabs with icons">
55
- <div slot="tab-0">Contents of Tab 1</div>
56
- <div slot="tab-1">Contents of Tab 2</div>
57
- <div slot="tab-2">Contents of Tab 3</div>
58
- <div slot="tab-3">Contents of Tab 4</div>
55
+ <p slot="tab-0">Contents of Tab 1</p>
56
+ <p slot="tab-1">Contents of Tab 2</p>
57
+ <p slot="tab-2">Contents of Tab 3</p>
58
+ <p slot="tab-3">Contents of Tab 4</p>
59
59
  </KolTabs>
60
60
  </SampleBlock>
61
61
  </>
@@ -41,19 +41,19 @@ export const TabsBehavior: FC = () => (
41
41
  <div className="grid gap-4">
42
42
  <KolHeading _level={2} _label='Tabs with "select manual" behavior' />
43
43
  <KolTabs _tabs={tabs} _behavior="select-manual" _label="Tabs with select manual behavior">
44
- <div slot="tab-0">Contents of Tab 1</div>
45
- <div slot="tab-1">Contents of Tab 2</div>
46
- <div slot="tab-2">Contents of Tab 3</div>
47
- <div slot="tab-3">Contents of Tab 4</div>
44
+ <p slot="tab-0">Contents of Tab 1</p>
45
+ <p slot="tab-1">Contents of Tab 2</p>
46
+ <p slot="tab-2">Contents of Tab 3</p>
47
+ <p slot="tab-3">Contents of Tab 4</p>
48
48
  </KolTabs>
49
49
  </div>
50
50
  <div className="grid gap-4">
51
51
  <KolHeading _level={2} _label='Tabs with "select automatic" behavior' />
52
52
  <KolTabs _tabs={tabs} className="mt-4" _behavior="select-automatic" _label="Tabs with select automatic behavior">
53
- <div slot="tab-0">Contents of Tab 1</div>
54
- <div slot="tab-1">Contents of Tab 2</div>
55
- <div slot="tab-2">Contents of Tab 3</div>
56
- <div slot="tab-3">Contents of Tab 4</div>
53
+ <p slot="tab-0">Contents of Tab 1</p>
54
+ <p slot="tab-1">Contents of Tab 2</p>
55
+ <p slot="tab-2">Contents of Tab 3</p>
56
+ <p slot="tab-3">Contents of Tab 4</p>
57
57
  </KolTabs>
58
58
  </div>
59
59
  </div>
@@ -32,12 +32,12 @@ export const CreateButton: FC = () => {
32
32
  <SampleBlock id="create-button">
33
33
  <KolTabs _tabs={tabs} className="mt-4" _label="Tabs with create button" _hasCreateButton _on={{ onCreate: addTab }}>
34
34
  {tabs.map((tab, index) => (
35
- <div key={`tab-${index}`} slot={`tab-${index}`}>
35
+ <p key={`tab-${index}`} slot={`tab-${index}`}>
36
36
  Contents of {tab._label}
37
- </div>
37
+ </p>
38
38
  ))}
39
39
 
40
- <div slot="tab-1">Contents of Tab 2</div>
40
+ <p slot="tab-1">Contents of Tab 2</p>
41
41
  </KolTabs>
42
42
  </SampleBlock>
43
43
  </>
@@ -41,10 +41,10 @@ export const TabsIconsOnly: FC = () => (
41
41
 
42
42
  <SampleBlock id="icons-only">
43
43
  <KolTabs _label="Tabs with icons" _tabs={tabs}>
44
- <div slot="tab-0">Contents of Tab 1</div>
45
- <div slot="tab-1">Contents of Tab 2</div>
46
- <div slot="tab-2">Contents of Tab 3</div>
47
- <div slot="tab-3">Contents of Tab 4</div>
44
+ <p slot="tab-0">Contents of Tab 1</p>
45
+ <p slot="tab-1">Contents of Tab 2</p>
46
+ <p slot="tab-2">Contents of Tab 3</p>
47
+ <p slot="tab-3">Contents of Tab 4</p>
48
48
  </KolTabs>
49
49
  </SampleBlock>
50
50
  </>