@public-ui/sample-react 2.2.6-rc.0 → 2.2.6

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 (78) hide show
  1. package/dist/1266.js +1 -1
  2. package/dist/1601.js +1 -1
  3. package/dist/1786.js +1 -1
  4. package/dist/1797.js +1 -1
  5. package/dist/1832.js +1 -1
  6. package/dist/2441.js +1 -1
  7. package/dist/2462.js +1 -1
  8. package/dist/2605.js +1 -1
  9. package/dist/2728.js +1 -1
  10. package/dist/2960.js +1 -1
  11. package/dist/3440.js +1 -1
  12. package/dist/3460.js +1 -1
  13. package/dist/3492.js +1 -1
  14. package/dist/3503.js +1 -1
  15. package/dist/3845.js +1 -1
  16. package/dist/3882.js +1 -1
  17. package/dist/3965.js +1 -1
  18. package/dist/4181.js +1 -1
  19. package/dist/4294.js +1 -1
  20. package/dist/4604.js +1 -1
  21. package/dist/4737.js +1 -1
  22. package/dist/4804.js +1 -1
  23. package/dist/4972.js +1 -1
  24. package/dist/5076.js +1 -1
  25. package/dist/5204.js +1 -1
  26. package/dist/5399.js +1 -1
  27. package/dist/5431.js +1 -1
  28. package/dist/5514.js +1 -1
  29. package/dist/5522.js +1 -1
  30. package/dist/5677.js +1 -1
  31. package/dist/5781.js +1 -1
  32. package/dist/5813.js +1 -1
  33. package/dist/5829.js +1 -1
  34. package/dist/6199.js +1 -1
  35. package/dist/6320.js +1 -1
  36. package/dist/6473.js +1 -1
  37. package/dist/6567.js +1 -1
  38. package/dist/{5841.js → 6616.js} +2 -2
  39. package/dist/6649.js +1 -1
  40. package/dist/6705.js +1 -1
  41. package/dist/6717.js +1 -1
  42. package/dist/6731.js +1 -1
  43. package/dist/6974.js +1 -1
  44. package/dist/7157.js +1 -1
  45. package/dist/7162.js +1 -1
  46. package/dist/7163.js +1 -1
  47. package/dist/7183.js +1 -1
  48. package/dist/7310.js +1 -1
  49. package/dist/{4803.js → 7322.js} +2 -2
  50. package/dist/7391.js +1 -1
  51. package/dist/7461.js +1 -1
  52. package/dist/7560.js +1 -1
  53. package/dist/7582.js +1 -1
  54. package/dist/7609.js +1 -1
  55. package/dist/8100.js +1 -1
  56. package/dist/8116.js +1 -1
  57. package/dist/8126.js +1 -1
  58. package/dist/8191.js +1 -1
  59. package/dist/8210.js +1 -1
  60. package/dist/8286.js +1 -1
  61. package/dist/8471.js +1 -1
  62. package/dist/85.js +1 -1
  63. package/dist/8799.js +1 -1
  64. package/dist/8902.js +1 -1
  65. package/dist/8956.js +1 -1
  66. package/dist/92.js +1 -1
  67. package/dist/9558.js +1 -1
  68. package/dist/9768.js +1 -1
  69. package/dist/9818.js +1 -1
  70. package/dist/989.js +1 -1
  71. package/dist/9980.js +1 -1
  72. package/dist/main.js +1 -1
  73. package/package.json +4 -4
  74. package/src/components/form/error-list.tsx +39 -11
  75. package/src/react.main.tsx +2 -2
  76. package/src/shares/theme.ts +5 -1
  77. /package/dist/{4803.js.LICENSE.txt → 6616.js.LICENSE.txt} +0 -0
  78. /package/dist/{5841.js.LICENSE.txt → 7322.js.LICENSE.txt} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/sample-react",
3
- "version": "2.2.6-rc.0",
3
+ "version": "2.2.6",
4
4
  "description": "This app contains samples for the KoliBri/Public UI",
5
5
  "license": "EUPL-1.2",
6
6
  "repository": {
@@ -36,9 +36,9 @@
36
36
  "typescript": "5.7.3",
37
37
  "world_countries_lists": "2.9.0",
38
38
  "yup": "1.6.1",
39
- "@public-ui/components": "2.2.6-rc.0",
40
- "@public-ui/themes": "2.2.6-rc.0",
41
- "@public-ui/react": "2.2.6-rc.0"
39
+ "@public-ui/components": "2.2.6",
40
+ "@public-ui/react": "2.2.6",
41
+ "@public-ui/themes": "2.2.6"
42
42
  },
43
43
  "files": [
44
44
  ".eslintignore",
@@ -1,10 +1,22 @@
1
1
  import { KolButton, KolForm, KolInputText } from '@public-ui/react';
2
2
  import type { FC } from 'react';
3
- import React, { useRef } from 'react';
3
+ import React, { useEffect, useRef } from 'react';
4
4
  import { SampleDescription } from '../SampleDescription';
5
5
 
6
6
  export const FormErrorList: FC = () => {
7
7
  const formRef = useRef<HTMLKolFormElement | null>(null);
8
+
9
+ const scrollTo = () => {
10
+ formRef.current?.focusErrorList();
11
+ };
12
+
13
+ /**
14
+ * Simulate the form submission
15
+ */
16
+ useEffect(() => {
17
+ formRef.current?.focusErrorList();
18
+ }, []);
19
+
8
20
  return (
9
21
  <>
10
22
  <SampleDescription>
@@ -14,26 +26,42 @@ export const FormErrorList: FC = () => {
14
26
  <KolForm
15
27
  className="w-full"
16
28
  ref={formRef}
29
+ _on={{
30
+ onSubmit: scrollTo,
31
+ }}
17
32
  _errorList={[
18
33
  {
19
34
  message: 'Error in Input 2',
20
35
  selector: '#input2',
21
36
  },
37
+ {
38
+ message: 'Error in Input 3',
39
+ selector: () => alert('Error in Input 3'),
40
+ },
22
41
  ]}
23
42
  >
24
43
  <div className="grid gap-2">
25
44
  <KolInputText id="input1" _label="Input 1" />
26
- <KolInputText id="input2" _label="Input 2" _touched _msg={{ _description: 'Input error', _type: 'error' }} />
27
- <KolInputText id="input3" _label="Input 3" />
45
+ <KolInputText
46
+ id="input2"
47
+ _label="Input 2"
48
+ _touched
49
+ _msg={{
50
+ _description: 'Input error',
51
+ _type: 'error',
52
+ }}
53
+ />
54
+ <KolInputText
55
+ id="input3"
56
+ _label="Input 3"
57
+ _touched
58
+ _msg={{
59
+ _description: 'Input error',
60
+ _type: 'error',
61
+ }}
62
+ />
28
63
  <div>
29
- <KolButton
30
- _label="ScrollTo"
31
- _on={{
32
- onClick: () => {
33
- formRef.current?.focusErrorList();
34
- },
35
- }}
36
- />
64
+ <KolButton _label="ScrollTo" _type="submit" />
37
65
  </div>
38
66
  </div>
39
67
  </KolForm>
@@ -5,7 +5,7 @@ import { setTagNameTransformer } from '@public-ui/react';
5
5
 
6
6
  import { bootstrap, isInitialized, KoliBriDevHelper } from '@public-ui/components';
7
7
  import { defineCustomElements } from '@public-ui/components/dist/loader';
8
- import { DEFAULT, ECL_EC, ECL_EU, ITZBund } from '@public-ui/themes';
8
+ import { BWSt, DEFAULT, ECL_EC, ECL_EU, ITZBund } from '@public-ui/themes';
9
9
 
10
10
  import { App } from './App';
11
11
 
@@ -35,7 +35,7 @@ const getThemes = async () => {
35
35
  }
36
36
 
37
37
  /* List of regular sample app themes */
38
- return [DEFAULT, ECL_EC, ECL_EU, ITZBund] as Theme[];
38
+ return [DEFAULT, ECL_EC, ECL_EU, ITZBund, BWSt] as Theme[];
39
39
  };
40
40
 
41
41
  void (async () => {
@@ -1,6 +1,6 @@
1
1
  import { SelectOption } from '@public-ui/components';
2
2
 
3
- export const THEMES = ['default', 'ecl-ec', 'ecl-eu', 'itzbund', 'unstyled'] as const;
3
+ export const THEMES = ['default', 'ecl-ec', 'ecl-eu', 'itzbund', 'bwst', 'unstyled'] as const;
4
4
  export type Theme = (typeof THEMES)[number];
5
5
  export type ThemeAndUnstyled = Theme | 'unstyled';
6
6
 
@@ -26,6 +26,10 @@ export const THEME_OPTIONS: SelectOption<ThemeAndUnstyled>[] = [
26
26
  label: 'Default (Tested)',
27
27
  value: 'default',
28
28
  },
29
+ {
30
+ label: 'BWSt (Tested)',
31
+ value: 'bwst',
32
+ },
29
33
  {
30
34
  label: 'European Commission (Draft)',
31
35
  value: 'ecl-ec',