@public-ui/sample-react 2.1.0 → 2.1.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.
Files changed (252) hide show
  1. package/dist/1016.js +2 -0
  2. package/dist/121.js +2 -0
  3. package/dist/1278.js +2 -0
  4. package/dist/{7163.js → 1443.js} +2 -2
  5. package/dist/149.js +2 -0
  6. package/dist/1524.js +2 -0
  7. package/dist/2072.js +2 -0
  8. package/dist/{3845.js → 2221.js} +2 -2
  9. package/dist/2252.js +2 -0
  10. package/dist/2256.js +2 -0
  11. package/dist/2381.js +2 -0
  12. package/dist/2416.js +2 -0
  13. package/dist/2545.js +2 -0
  14. package/dist/2615.js +2 -0
  15. package/dist/263.js +2 -0
  16. package/dist/{5399.js → 2639.js} +2 -2
  17. package/dist/2657.js +2 -0
  18. package/dist/2669.js +2 -0
  19. package/dist/277.js +2 -0
  20. package/dist/2858.js +2 -0
  21. package/dist/2879.js +2 -0
  22. package/dist/3110.js +2 -0
  23. package/dist/3261.js +2 -0
  24. package/dist/3353.js +2 -0
  25. package/dist/{8286.js → 3510.js} +2 -2
  26. package/dist/3563.js +2 -0
  27. package/dist/3869.js +2 -0
  28. package/dist/4014.js +2 -0
  29. package/dist/4082.js +2 -0
  30. package/dist/4156.js +2 -0
  31. package/dist/4177.js +2 -0
  32. package/dist/4178.js +2 -0
  33. package/dist/4179.js +2 -0
  34. package/dist/4212.js +2 -0
  35. package/dist/{1430.js → 4318.js} +2 -2
  36. package/dist/4346.js +2 -0
  37. package/dist/4486.js +2 -0
  38. package/dist/{4294.js → 4702.js} +2 -2
  39. package/dist/{8251.js → 4723.js} +2 -2
  40. package/dist/{8855.js → 4893.js} +2 -2
  41. package/dist/5018.js +2 -0
  42. package/dist/5157.js +2 -0
  43. package/dist/5244.js +2 -0
  44. package/dist/5350.js +2 -0
  45. package/dist/5599.js +2 -0
  46. package/dist/{7582.js → 5670.js} +2 -2
  47. package/dist/{5020.js → 5716.js} +2 -2
  48. package/dist/5973.js +2 -0
  49. package/dist/605.js +2 -0
  50. package/dist/{3460.js → 6284.js} +2 -2
  51. package/dist/6295.js +2 -0
  52. package/dist/6402.js +2 -0
  53. package/dist/6596.js +2 -0
  54. package/dist/6629.js +2 -0
  55. package/dist/6636.js +2 -0
  56. package/dist/6716.js +2 -0
  57. package/dist/{8471.js → 7055.js} +2 -2
  58. package/dist/7132.js +2 -0
  59. package/dist/{6971.js → 7219.js} +2 -2
  60. package/dist/7305.js +2 -0
  61. package/dist/7367.js +2 -0
  62. package/dist/7372.js +2 -0
  63. package/dist/7533.js +2 -0
  64. package/dist/7677.js +2 -0
  65. package/dist/8310.js +2 -0
  66. package/dist/8516.js +2 -0
  67. package/dist/8642.js +2 -0
  68. package/dist/8797.js +2 -0
  69. package/dist/8804.js +2 -0
  70. package/dist/8809.js +2 -0
  71. package/dist/8928.js +2 -0
  72. package/dist/{2462.js → 9031.js} +2 -2
  73. package/dist/{1396.js → 9116.js} +2 -2
  74. package/dist/9344.js +2 -0
  75. package/dist/9673.js +2 -0
  76. package/dist/9673.js.LICENSE.txt +3 -0
  77. package/dist/9730.js +2 -0
  78. package/dist/9730.js.LICENSE.txt +3 -0
  79. package/dist/main.css +1 -1
  80. package/dist/main.js +1 -1
  81. package/dist/main.js.LICENSE.txt +2 -2
  82. package/package.json +16 -16
  83. package/src/App.tsx +2 -0
  84. package/src/components/Sidebar.tsx +12 -8
  85. package/src/components/combobox/basic.tsx +13 -0
  86. package/src/components/combobox/partials/cases.tsx +38 -0
  87. package/src/components/combobox/partials/variants.tsx +19 -0
  88. package/src/components/combobox/routes.ts +8 -0
  89. package/src/components/form/basic.tsx +19 -0
  90. package/src/components/form/error-list.tsx +26 -0
  91. package/src/components/form/routes.ts +6 -1
  92. package/src/components/handout/basic.tsx +0 -7
  93. package/src/components/input-checkbox/partials/cases.tsx +7 -0
  94. package/src/components/input-number/partials/cases.tsx +4 -0
  95. package/src/components/input-password/show-password.tsx +19 -0
  96. package/src/components/input-text/partials/cases.tsx +3 -1
  97. package/src/components/pagination/basic.tsx +2 -2
  98. package/src/components/select/partials/cases.tsx +1 -14
  99. package/src/components/table/routes.ts +4 -0
  100. package/src/components/table/stateful-with-selection.tsx +78 -0
  101. package/src/components/table/stateless-with-selection.tsx +60 -0
  102. package/src/components/tabs/basic.tsx +5 -0
  103. package/src/components/textarea/partials/cases.tsx +3 -0
  104. package/src/components/toolbar/basic.tsx +48 -0
  105. package/src/components/toolbar/disabled.tsx +50 -0
  106. package/src/components/toolbar/routes.ts +10 -0
  107. package/src/react.main.tsx +2 -2
  108. package/src/scenarios/appointment-form/AppointmentForm.tsx +1 -2
  109. package/src/scenarios/appointment-form/AvailableAppointmentsForm.tsx +55 -49
  110. package/src/scenarios/appointment-form/DistrictForm.tsx +15 -9
  111. package/src/scenarios/appointment-form/PersonalInformationForm.tsx +18 -6
  112. package/src/scenarios/appointment-form/formUtils.ts +2 -4
  113. package/src/scenarios/inputs-get-value.tsx +109 -83
  114. package/src/shares/country.ts +18 -0
  115. package/src/shares/routes.ts +4 -2
  116. package/src/shares/theme.ts +2 -6
  117. package/webpack.config.js +3 -0
  118. package/dist/1266.js +0 -2
  119. package/dist/1601.js +0 -2
  120. package/dist/1786.js +0 -2
  121. package/dist/1797.js +0 -2
  122. package/dist/1832.js +0 -2
  123. package/dist/2441.js +0 -2
  124. package/dist/2605.js +0 -2
  125. package/dist/2728.js +0 -2
  126. package/dist/2960.js +0 -2
  127. package/dist/3492.js +0 -2
  128. package/dist/3503.js +0 -2
  129. package/dist/3801.js +0 -2
  130. package/dist/3882.js +0 -2
  131. package/dist/3965.js +0 -2
  132. package/dist/4181.js +0 -2
  133. package/dist/4604.js +0 -2
  134. package/dist/4737.js +0 -2
  135. package/dist/4972.js +0 -2
  136. package/dist/5076.js +0 -2
  137. package/dist/5204.js +0 -2
  138. package/dist/5398.js +0 -2
  139. package/dist/5514.js +0 -2
  140. package/dist/5522.js +0 -2
  141. package/dist/5677.js +0 -2
  142. package/dist/5781.js +0 -2
  143. package/dist/5813.js +0 -2
  144. package/dist/5829.js +0 -2
  145. package/dist/6320.js +0 -2
  146. package/dist/6324.js +0 -2
  147. package/dist/6473.js +0 -2
  148. package/dist/6567.js +0 -2
  149. package/dist/6649.js +0 -2
  150. package/dist/6717.js +0 -2
  151. package/dist/6731.js +0 -2
  152. package/dist/6809.js +0 -2
  153. package/dist/6974.js +0 -2
  154. package/dist/7157.js +0 -2
  155. package/dist/7162.js +0 -2
  156. package/dist/7183.js +0 -2
  157. package/dist/7310.js +0 -2
  158. package/dist/7391.js +0 -2
  159. package/dist/7461.js +0 -2
  160. package/dist/7560.js +0 -2
  161. package/dist/8100.js +0 -2
  162. package/dist/8116.js +0 -2
  163. package/dist/8126.js +0 -2
  164. package/dist/8210.js +0 -2
  165. package/dist/85.js +0 -2
  166. package/dist/8799.js +0 -2
  167. package/dist/8902.js +0 -2
  168. package/dist/8956.js +0 -2
  169. package/dist/92.js +0 -2
  170. package/dist/9558.js +0 -2
  171. package/dist/9768.js +0 -2
  172. package/dist/9818.js +0 -2
  173. package/dist/9849.js +0 -2
  174. package/dist/989.js +0 -2
  175. package/dist/9975.js +0 -2
  176. package/dist/9980.js +0 -2
  177. package/src/components/logo/basic.tsx +0 -15
  178. package/src/components/logo/routes.ts +0 -8
  179. /package/dist/{1266.js.LICENSE.txt → 1016.js.LICENSE.txt} +0 -0
  180. /package/dist/{1396.js.LICENSE.txt → 121.js.LICENSE.txt} +0 -0
  181. /package/dist/{1430.js.LICENSE.txt → 1278.js.LICENSE.txt} +0 -0
  182. /package/dist/{1601.js.LICENSE.txt → 1443.js.LICENSE.txt} +0 -0
  183. /package/dist/{1786.js.LICENSE.txt → 149.js.LICENSE.txt} +0 -0
  184. /package/dist/{1797.js.LICENSE.txt → 1524.js.LICENSE.txt} +0 -0
  185. /package/dist/{1832.js.LICENSE.txt → 2072.js.LICENSE.txt} +0 -0
  186. /package/dist/{2441.js.LICENSE.txt → 2221.js.LICENSE.txt} +0 -0
  187. /package/dist/{2462.js.LICENSE.txt → 2252.js.LICENSE.txt} +0 -0
  188. /package/dist/{2605.js.LICENSE.txt → 2256.js.LICENSE.txt} +0 -0
  189. /package/dist/{2728.js.LICENSE.txt → 2381.js.LICENSE.txt} +0 -0
  190. /package/dist/{2960.js.LICENSE.txt → 2416.js.LICENSE.txt} +0 -0
  191. /package/dist/{3460.js.LICENSE.txt → 2545.js.LICENSE.txt} +0 -0
  192. /package/dist/{3492.js.LICENSE.txt → 2615.js.LICENSE.txt} +0 -0
  193. /package/dist/{3503.js.LICENSE.txt → 263.js.LICENSE.txt} +0 -0
  194. /package/dist/{3801.js.LICENSE.txt → 2639.js.LICENSE.txt} +0 -0
  195. /package/dist/{3845.js.LICENSE.txt → 2657.js.LICENSE.txt} +0 -0
  196. /package/dist/{3882.js.LICENSE.txt → 2669.js.LICENSE.txt} +0 -0
  197. /package/dist/{3965.js.LICENSE.txt → 277.js.LICENSE.txt} +0 -0
  198. /package/dist/{4181.js.LICENSE.txt → 2858.js.LICENSE.txt} +0 -0
  199. /package/dist/{4294.js.LICENSE.txt → 2879.js.LICENSE.txt} +0 -0
  200. /package/dist/{4604.js.LICENSE.txt → 3110.js.LICENSE.txt} +0 -0
  201. /package/dist/{4737.js.LICENSE.txt → 3261.js.LICENSE.txt} +0 -0
  202. /package/dist/{4972.js.LICENSE.txt → 3353.js.LICENSE.txt} +0 -0
  203. /package/dist/{5020.js.LICENSE.txt → 3510.js.LICENSE.txt} +0 -0
  204. /package/dist/{5076.js.LICENSE.txt → 3563.js.LICENSE.txt} +0 -0
  205. /package/dist/{5204.js.LICENSE.txt → 3869.js.LICENSE.txt} +0 -0
  206. /package/dist/{5398.js.LICENSE.txt → 4014.js.LICENSE.txt} +0 -0
  207. /package/dist/{5399.js.LICENSE.txt → 4082.js.LICENSE.txt} +0 -0
  208. /package/dist/{5514.js.LICENSE.txt → 4156.js.LICENSE.txt} +0 -0
  209. /package/dist/{5522.js.LICENSE.txt → 4177.js.LICENSE.txt} +0 -0
  210. /package/dist/{5677.js.LICENSE.txt → 4178.js.LICENSE.txt} +0 -0
  211. /package/dist/{5781.js.LICENSE.txt → 4179.js.LICENSE.txt} +0 -0
  212. /package/dist/{5813.js.LICENSE.txt → 4212.js.LICENSE.txt} +0 -0
  213. /package/dist/{5829.js.LICENSE.txt → 4318.js.LICENSE.txt} +0 -0
  214. /package/dist/{6320.js.LICENSE.txt → 4346.js.LICENSE.txt} +0 -0
  215. /package/dist/{6324.js.LICENSE.txt → 4486.js.LICENSE.txt} +0 -0
  216. /package/dist/{6473.js.LICENSE.txt → 4702.js.LICENSE.txt} +0 -0
  217. /package/dist/{6567.js.LICENSE.txt → 4723.js.LICENSE.txt} +0 -0
  218. /package/dist/{6649.js.LICENSE.txt → 4893.js.LICENSE.txt} +0 -0
  219. /package/dist/{6717.js.LICENSE.txt → 5018.js.LICENSE.txt} +0 -0
  220. /package/dist/{6731.js.LICENSE.txt → 5157.js.LICENSE.txt} +0 -0
  221. /package/dist/{6809.js.LICENSE.txt → 5244.js.LICENSE.txt} +0 -0
  222. /package/dist/{6971.js.LICENSE.txt → 5350.js.LICENSE.txt} +0 -0
  223. /package/dist/{6974.js.LICENSE.txt → 5599.js.LICENSE.txt} +0 -0
  224. /package/dist/{7157.js.LICENSE.txt → 5670.js.LICENSE.txt} +0 -0
  225. /package/dist/{7162.js.LICENSE.txt → 5716.js.LICENSE.txt} +0 -0
  226. /package/dist/{7163.js.LICENSE.txt → 5973.js.LICENSE.txt} +0 -0
  227. /package/dist/{7183.js.LICENSE.txt → 605.js.LICENSE.txt} +0 -0
  228. /package/dist/{7310.js.LICENSE.txt → 6284.js.LICENSE.txt} +0 -0
  229. /package/dist/{7391.js.LICENSE.txt → 6295.js.LICENSE.txt} +0 -0
  230. /package/dist/{7461.js.LICENSE.txt → 6402.js.LICENSE.txt} +0 -0
  231. /package/dist/{7560.js.LICENSE.txt → 6596.js.LICENSE.txt} +0 -0
  232. /package/dist/{7582.js.LICENSE.txt → 6629.js.LICENSE.txt} +0 -0
  233. /package/dist/{8100.js.LICENSE.txt → 6636.js.LICENSE.txt} +0 -0
  234. /package/dist/{8116.js.LICENSE.txt → 6716.js.LICENSE.txt} +0 -0
  235. /package/dist/{8126.js.LICENSE.txt → 7055.js.LICENSE.txt} +0 -0
  236. /package/dist/{8210.js.LICENSE.txt → 7132.js.LICENSE.txt} +0 -0
  237. /package/dist/{8251.js.LICENSE.txt → 7219.js.LICENSE.txt} +0 -0
  238. /package/dist/{8286.js.LICENSE.txt → 7305.js.LICENSE.txt} +0 -0
  239. /package/dist/{8471.js.LICENSE.txt → 7367.js.LICENSE.txt} +0 -0
  240. /package/dist/{85.js.LICENSE.txt → 7372.js.LICENSE.txt} +0 -0
  241. /package/dist/{8799.js.LICENSE.txt → 7533.js.LICENSE.txt} +0 -0
  242. /package/dist/{8855.js.LICENSE.txt → 7677.js.LICENSE.txt} +0 -0
  243. /package/dist/{8902.js.LICENSE.txt → 8310.js.LICENSE.txt} +0 -0
  244. /package/dist/{8956.js.LICENSE.txt → 8516.js.LICENSE.txt} +0 -0
  245. /package/dist/{92.js.LICENSE.txt → 8642.js.LICENSE.txt} +0 -0
  246. /package/dist/{9558.js.LICENSE.txt → 8797.js.LICENSE.txt} +0 -0
  247. /package/dist/{9768.js.LICENSE.txt → 8804.js.LICENSE.txt} +0 -0
  248. /package/dist/{9818.js.LICENSE.txt → 8809.js.LICENSE.txt} +0 -0
  249. /package/dist/{9849.js.LICENSE.txt → 8928.js.LICENSE.txt} +0 -0
  250. /package/dist/{989.js.LICENSE.txt → 9031.js.LICENSE.txt} +0 -0
  251. /package/dist/{9975.js.LICENSE.txt → 9116.js.LICENSE.txt} +0 -0
  252. /package/dist/{9980.js.LICENSE.txt → 9344.js.LICENSE.txt} +0 -0
@@ -33,7 +33,7 @@
33
33
  */
34
34
 
35
35
  /**
36
- * @remix-run/router v1.16.0
36
+ * @remix-run/router v1.16.1
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.23.0
47
+ * React Router v6.23.1
48
48
  *
49
49
  * Copyright (c) Remix Software Inc.
50
50
  *
package/package.json CHANGED
@@ -1,37 +1,37 @@
1
1
  {
2
2
  "name": "@public-ui/sample-react",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "This app contains samples for the KoliBri/Public UI",
5
5
  "license": "EUPL-1.2",
6
6
  "dependencies": {
7
- "@leanup/stack": "1.3.50",
8
- "@leanup/stack-react": "1.3.50",
9
- "@leanup/stack-webpack": "1.3.50",
10
- "@public-ui/components": "2.1.0",
11
- "@public-ui/react": "2.1.0",
12
- "@public-ui/themes": "2.1.0",
7
+ "@leanup/stack": "1.3.53",
8
+ "@leanup/stack-react": "1.3.53",
9
+ "@leanup/stack-webpack": "1.3.53",
13
10
  "@types/node": "ts5.4",
14
- "@types/react": "18.3.1",
11
+ "@types/react": "18.3.3",
15
12
  "@types/react-dom": "18.3.0",
16
13
  "@unocss/preset-uno": "0.58.9",
17
14
  "@unocss/webpack": "0.58.9",
18
- "ajv": "8.12.0",
19
- "chromedriver": "124.0.1",
15
+ "ajv": "8.16.0",
16
+ "chromedriver": "124.0.4",
20
17
  "cpy-cli": "5.0.0",
21
18
  "eslint-plugin-jsx-a11y": "6.8.0",
22
- "eslint-plugin-react": "7.34.1",
19
+ "eslint-plugin-react": "7.34.2",
23
20
  "formik": "2.4.6",
24
- "nightwatch-axe-verbose": "2.3.0",
21
+ "nightwatch-axe-verbose": "2.3.1",
25
22
  "npm-run-all": "4.1.5",
26
23
  "react": "18.3.1",
27
24
  "react-dom": "18.3.1",
28
- "react-router": "6.23.0",
29
- "react-router-dom": "6.23.0",
30
- "rimraf": "5.0.5",
25
+ "react-router": "6.23.1",
26
+ "react-router-dom": "6.23.1",
27
+ "rimraf": "5.0.7",
31
28
  "ts-prune": "0.10.3",
32
29
  "typescript": "5.4.5",
33
30
  "world_countries_lists": "2.9.0",
34
- "yup": "1.4.0"
31
+ "yup": "1.4.0",
32
+ "@public-ui/components": "2.1.2",
33
+ "@public-ui/themes": "2.1.2",
34
+ "@public-ui/react": "2.1.2"
35
35
  },
36
36
  "files": [
37
37
  ".eslintignore",
package/src/App.tsx CHANGED
@@ -132,6 +132,8 @@ export const App: FC = () => {
132
132
  sample={routerLocation.pathname}
133
133
  routes={ROUTES}
134
134
  routeList={ROUTE_LIST}
135
+ buildDate={process.env.BUILD_DATE}
136
+ commitHash={process.env.COMMIT_HASH}
135
137
  onThemeChange={handleThemeChange}
136
138
  />
137
139
  )}
@@ -1,5 +1,5 @@
1
1
  import type { FC, PropsWithChildren } from 'react';
2
- import React, { useState } from 'react';
2
+ import React from 'react';
3
3
 
4
4
  import { KolAccordion, KolButton, KolHeading, KolLink, KolSelect, KolVersion } from '@public-ui/react';
5
5
 
@@ -13,6 +13,8 @@ type Props = {
13
13
  routes: Routes;
14
14
  routeList: string[];
15
15
  sample: string;
16
+ buildDate?: string;
17
+ commitHash?: string;
16
18
  onThemeChange: (theme: unknown) => void;
17
19
  };
18
20
 
@@ -24,20 +26,15 @@ const ComponentNavContainer = ({ children, isMobile }: PropsWithChildren<{ isMob
24
26
  ) : (
25
27
  <div className="mt">{children}</div>
26
28
  );
27
- export const Sidebar: FC<Props> = ({ version, theme, routes, routeList, sample, onThemeChange }) => {
29
+ export const Sidebar: FC<Props> = ({ version, theme, routes, routeList, sample, buildDate, commitHash, onThemeChange }) => {
28
30
  /* KolSelect calls onChange initially by design - work around this with a state variable */
29
- const [isFirstThemeSelectChange, setIsFirstThemeSelectChange] = useState(true);
30
31
  const isMobile = useMobile();
31
32
 
32
33
  const getIndexOfSample = () => routeList.indexOf(sample);
33
34
  const formatSampleAsLabel = () => sample.replace(/\//g, ' ');
34
35
 
35
36
  const handleThemeSelectChange = (_event: Event, value: unknown) => {
36
- if (isFirstThemeSelectChange) {
37
- setIsFirstThemeSelectChange(false);
38
- } else {
39
- onThemeChange((value as [string])[0]);
40
- }
37
+ onThemeChange((value as [string])[0]);
41
38
  };
42
39
 
43
40
  const handleLinkClick = (event: Event) => {
@@ -63,6 +60,13 @@ export const Sidebar: FC<Props> = ({ version, theme, routes, routeList, sample,
63
60
  <KolHeading _label="KoliBri React"></KolHeading>
64
61
  <KolVersion _label={version}></KolVersion>
65
62
  </div>
63
+ {(buildDate || commitHash) && (
64
+ <div className="text-sm font-mono color-gray-5 m-t-2">
65
+ {commitHash ? `Build: ${commitHash}` : ''}
66
+ <br />
67
+ {buildDate ? `at ${buildDate}` : ''}
68
+ </div>
69
+ )}
66
70
 
67
71
  <KolSelect _label="Theme wählen" _options={THEME_OPTIONS} _on={{ onChange: handleThemeSelectChange }} _value={[theme]} class="mt"></KolSelect>
68
72
 
@@ -0,0 +1,13 @@
1
+ import type { FC } from 'react';
2
+ import React from 'react';
3
+ import { FormWrap } from '../FormWrap';
4
+ import { ComboboxVariants } from './partials/variants';
5
+ import { SampleDescription } from '../SampleDescription';
6
+ export const ComboboxBasic: FC = () => (
7
+ <>
8
+ <SampleDescription>The Combobox merges a text input with a suggestion list, enabling users to type or select their choice.</SampleDescription>
9
+ <>
10
+ <FormWrap RefComponent={ComboboxVariants} />
11
+ </>
12
+ </>
13
+ );
@@ -0,0 +1,38 @@
1
+ import React, { forwardRef } from 'react';
2
+
3
+ import { KolCombobox } from '@public-ui/react';
4
+
5
+ import { ERROR_MSG, HINT_MSG } from '../../../shares/constants';
6
+
7
+ import type { Components } from '@public-ui/components';
8
+ import { COUNTRY_SUGGESTIONS } from '../../../shares/country';
9
+
10
+ export const ComboboxCases = forwardRef<HTMLKolSelectElement, Components.KolSelect>(function ComboboxCases(props) {
11
+ return (
12
+ <div className="grid gap-4">
13
+ <KolCombobox
14
+ {...props}
15
+ _hint={HINT_MSG}
16
+ _label="Label"
17
+ _suggestions={COUNTRY_SUGGESTIONS}
18
+ _value={'Deutschland'}
19
+ _on={{
20
+ onBlur: console.log,
21
+ onChange: console.log,
22
+ onClick: console.log,
23
+ onFocus: console.log,
24
+ }}
25
+ />
26
+ <KolCombobox {...props} _label="Disabled" _suggestions={COUNTRY_SUGGESTIONS} _value={'Deutschland'} _disabled />
27
+ <KolCombobox
28
+ {...props}
29
+ _suggestions={COUNTRY_SUGGESTIONS}
30
+ _msg={{ _type: 'error', _description: ERROR_MSG }}
31
+ _touched
32
+ _label="Label"
33
+ _placeholder="Placeholder"
34
+ _required
35
+ />
36
+ </div>
37
+ );
38
+ });
@@ -0,0 +1,19 @@
1
+ import React, { forwardRef } from 'react';
2
+
3
+ import { ComboboxCases } from './cases';
4
+
5
+ import type { Components } from '@public-ui/components';
6
+ export const ComboboxVariants = forwardRef<HTMLKolSelectElement, Components.KolSelect>(function SelectVariant(props, ref) {
7
+ return (
8
+ <div className="grid md:grid-cols-2 gap-4">
9
+ <fieldset>
10
+ <legend>Text</legend>
11
+ <ComboboxCases {...props} />
12
+ </fieldset>
13
+ <fieldset>
14
+ <legend>Text (hideLabel)</legend>
15
+ <ComboboxCases ref={ref} {...props} _hideLabel />
16
+ </fieldset>
17
+ </div>
18
+ );
19
+ });
@@ -0,0 +1,8 @@
1
+ import { Routes } from '../../shares/types';
2
+ import { ComboboxBasic } from './basic';
3
+
4
+ export const COMBOBOX_ROUTES: Routes = {
5
+ combobox: {
6
+ basic: ComboboxBasic,
7
+ },
8
+ };
@@ -0,0 +1,19 @@
1
+ import type { FC } from 'react';
2
+ import React from 'react';
3
+ import { SampleDescription } from '../SampleDescription';
4
+ import { KolForm, KolInputText } from '@public-ui/react';
5
+
6
+ export const FormBasic: FC = () => (
7
+ <>
8
+ <SampleDescription>
9
+ <p>Dieses Beispiel zeigt ein Formular mit drei Eingabefeldern.</p>
10
+ </SampleDescription>
11
+ <KolForm>
12
+ <div className="grid gap-2">
13
+ <KolInputText id="input1" _label="Eingabe 1" />
14
+ <KolInputText id="input2" _label="Eingabe 2" />
15
+ <KolInputText id="input3" _label="Eingabe 3" />
16
+ </div>
17
+ </KolForm>
18
+ </>
19
+ );
@@ -0,0 +1,26 @@
1
+ import type { FC } from 'react';
2
+ import React from 'react';
3
+ import { SampleDescription } from '../SampleDescription';
4
+ import { KolForm, KolInputText } from '@public-ui/react';
5
+
6
+ export const FormErrorList: FC = () => (
7
+ <>
8
+ <SampleDescription>
9
+ <p>Dieses Beispiel zeigt ein Formular mit drei Eingabefeldern. Das zweite Eingabefeld enthält einen Fehler. </p>
10
+ </SampleDescription>
11
+ <KolForm
12
+ _errorList={[
13
+ {
14
+ message: 'Fehler in Eingabe 2',
15
+ selector: '#input2',
16
+ },
17
+ ]}
18
+ >
19
+ <div className="grid gap-2">
20
+ <KolInputText id="input1" _label="Eingabe 1" />
21
+ <KolInputText id="input2" _label="Eingabe 2" _touched _msg={{ _description: 'Fehlerhafte Eingabe', _type: 'error' }} />
22
+ <KolInputText id="input3" _label="Eingabe 3" />
23
+ </div>
24
+ </KolForm>
25
+ </>
26
+ );
@@ -1,5 +1,10 @@
1
1
  import { Routes } from '../../shares/types';
2
+ import { FormBasic } from './basic';
3
+ import { FormErrorList } from './error-list';
2
4
 
3
5
  export const FORM_ROUTES: Routes = {
4
- form: {},
6
+ form: {
7
+ basic: FormBasic,
8
+ 'error-list': FormErrorList,
9
+ },
5
10
  };
@@ -27,7 +27,6 @@ import {
27
27
  KolKolibri,
28
28
  KolLink,
29
29
  KolLinkButton,
30
- KolLogo,
31
30
  KolNav,
32
31
  KolProgress,
33
32
  KolSelect,
@@ -883,9 +882,6 @@ export const HandoutBasic: FC = () => (
883
882
  <p>
884
883
  Ich bin ein <KolLink _href="#/back-page" _label="externer Link" _target="w3c"></KolLink> im Fließtext.
885
884
  </p>
886
- <KolLink _href="#/back-page" _label="">
887
- <KolLogo slot="expert" class="inline-flex w-50" _org={Bundesanstalt['Informationstechnikzentrum Bund']} />
888
- </KolLink>
889
885
  </div>
890
886
  </KolAccordion>
891
887
  <KolAccordion _label="ButtonLinks" _level={3}>
@@ -896,9 +892,6 @@ export const HandoutBasic: FC = () => (
896
892
  <p>
897
893
  Ich bin ein <KolButtonLink _label="Link"></KolButtonLink> im Fließtext.
898
894
  </p>
899
- <KolButtonLink _label="">
900
- <KolLogo slot="expert" class="inline-flex w-50" _org={Bundesanstalt['Informationstechnikzentrum Bund']} />
901
- </KolButtonLink>
902
895
  <KolButtonLink
903
896
  _icons={{
904
897
  left: 'codicon codicon-arrow-left',
@@ -11,6 +11,13 @@ export const InputCheckboxCases = forwardRef<HTMLKolInputCheckboxElement, Compon
11
11
  <KolInputCheckbox {...props} _label="Nicht ausgewählt" _value={false} _required />
12
12
  <KolInputCheckbox {...props} _label="Unbestimmt (Indeterminate)" _value={null} _indeterminate />
13
13
  <KolInputCheckbox {...props} ref={ref} _accessKey="A" _checked _label="Ausgewählt" _tooltipAlign="right" _value={true} />
14
+ <KolInputCheckbox
15
+ {...props}
16
+ _checked
17
+ _icons={{ unchecked: 'codicon codicon-close' }}
18
+ _label={'Mit sehr langem Label und Umbrüchen '.repeat(5)}
19
+ _value={true}
20
+ />
14
21
  <KolInputCheckbox {...props} _disabled _label="Disabled" _value={true} _hint="Hint text" />
15
22
  <KolInputCheckbox {...props} _checked _disabled _label="Checked and disabled" />
16
23
  <KolInputCheckbox {...props} _indeterminate _disabled _label="Indeterminate and disabled" />
@@ -24,6 +24,10 @@ export const InputNumberCases = forwardRef<HTMLKolInputNumberElement, Components
24
24
  },
25
25
  }}
26
26
  />
27
+ <KolInputNumber {...props} _required _msg={{ _type: 'error', _description: ERROR_MSG }} _touched _value={123} _label="Zahleneingabe" />
28
+ <KolInputNumber {...props} _required _msg={{ _type: 'warning', _description: ERROR_MSG }} _touched _value={123} _label="Zahleneingabe" />
29
+ <KolInputNumber {...props} _required _msg={{ _type: 'info', _description: ERROR_MSG }} _touched _value={123} _label="Zahleneingabe" />
30
+ <KolInputNumber {...props} _required _msg={{ _type: 'success', _description: ERROR_MSG }} _touched _value={123} _label="Zahleneingabe" />
27
31
  <KolInputNumber {...props} ref={ref} _accessKey="Z" _max={10} _min={-10} _step={2} _label="Zahleneingabe (-10 bis 10 in 2er Schritten)" />
28
32
  <KolInputNumber {...props} _readOnly _label="Zahleneingabe (Readonly)" />
29
33
  <KolInputNumber {...props} _disabled _label="Zahleneingabe (Disabled)" />
@@ -44,6 +44,25 @@ export const InputPasswordShowPassword: FC = () => {
44
44
  }}
45
45
  className="block"
46
46
  />
47
+ <KolInputPassword
48
+ _placeholder="Mit 'Passwort anzeigen' Button und disabled"
49
+ _label="Passwort"
50
+ ref={passwordRef}
51
+ _smartButton={{
52
+ _icons: {
53
+ left: {
54
+ icon: 'codicon codicon-eye',
55
+ },
56
+ },
57
+ _hideLabel: true,
58
+ _label: `Passwort ${isPasswordVisible ? 'ausblenden' : 'einblenden'}`,
59
+ _on: {
60
+ onClick: handleTogglePasswordClick,
61
+ },
62
+ }}
63
+ className="block"
64
+ _disabled
65
+ />
47
66
  </KolForm>
48
67
  </>
49
68
  );
@@ -11,7 +11,7 @@ export const InputTextCases = forwardRef<HTMLKolInputTextElement, Components.Kol
11
11
  <KolInputText
12
12
  {...props}
13
13
  _hint={HINT_MSG}
14
- _msg={{ _type: 'error', _description: ERROR_MSG }}
14
+ _msg={{ _type: 'error', _description: ERROR_MSG, _label: 'test überschrift' }}
15
15
  _placeholder="Mit Icons"
16
16
  _icons={{
17
17
  right: {
@@ -37,6 +37,8 @@ export const InputTextCases = forwardRef<HTMLKolInputTextElement, Components.Kol
37
37
  <KolInputText {...props} _placeholder="Placeholder" _msg={{ _type: 'info', _description: 'Nur ein Hinweis' }} _label="Suche (search)" _type="search" />
38
38
  <KolInputText {...props} _placeholder="Placeholder" _msg={{ _type: 'error', _description: ERROR_MSG }} _touched _type="url" _label="URL (url)" />
39
39
  <KolInputText {...props} _placeholder="Placeholder" _type="tel" _label="Telefon (tel)" _msg={{ _type: 'warning', _description: 'Kleine Warnung' }} />
40
+ <KolInputText {...props} _placeholder="Placeholder" _type="tel" _label="Telefon (tel)" _msg={{ _type: 'success', _description: 'Erfolgsmeldung' }} />
41
+ <KolInputText {...props} _placeholder="Placeholder" _label="Mit Counter" _hasCounter _maxLength={10} />
40
42
  <KolInputText {...props} _placeholder="Placeholder" _readOnly _label="Vorname (text, readonly)" />
41
43
  <KolInputText {...props} _value="Value" _readOnly _label="Vorname (text, readonly)" />
42
44
  <KolInputText {...props} _placeholder="Placeholder" _disabled _label="Vorname (text, disabled)" />
@@ -13,8 +13,8 @@ export const PaginationBasic: FC = () => (
13
13
  </p>
14
14
  </SampleDescription>
15
15
  <div className="grid gap-4">
16
- <KolPagination _max={10} _page={6} _siblingCount={0} _label="Test Paginierung 1" _on={{}} />
17
- <KolPagination _max={6} _page={6} _siblingCount={0} _boundaryCount={2} _label="Test Paginierung 2" _on={{}} />
16
+ <KolPagination _max={316514} _page={15475} _siblingCount={3} _label="Test Paginierung 1" _on={{}} />
17
+ <KolPagination _max={14} _page={14} _siblingCount={1} _boundaryCount={2} _label="Test Paginierung 2" _on={{}} />
18
18
  <KolPagination _max={4} _page={1} _siblingCount={0} _boundaryCount={2} _label="Test Paginierung 3" _on={{}} />
19
19
  <KolPagination _max={4} _page={6} _siblingCount={0} _boundaryCount={2} _hasButtons={false} _label="Test Paginierung 4" _on={{}} />
20
20
  <KolPagination
@@ -1,17 +1,11 @@
1
1
  import React, { forwardRef } from 'react';
2
- import countries from 'world_countries_lists/data/countries/de/countries.json';
3
2
 
4
3
  import { KolSelect } from '@public-ui/react';
5
4
 
6
5
  import { ERROR_MSG } from '../../../shares/constants';
7
6
 
8
7
  import type { Components, SelectOption } from '@public-ui/components';
9
- type Country = {
10
- id: number;
11
- alpha2: string;
12
- alpha3: string;
13
- name: string;
14
- };
8
+ import { COUNTRY_OPTIONS } from '../../../shares/country';
15
9
 
16
10
  const SALUTATION_OPTIONS: SelectOption<string>[] = [
17
11
  {
@@ -33,13 +27,6 @@ const SALUTATION_OPTIONS: SelectOption<string>[] = [
33
27
  },
34
28
  ];
35
29
 
36
- const COUNTRY_OPTIONS: SelectOption<string>[] = [
37
- ...(countries as Country[]).map((country) => ({
38
- label: country.name,
39
- value: country.alpha2,
40
- })),
41
- ];
42
-
43
30
  export const SelectCases = forwardRef<HTMLKolSelectElement, Components.KolSelect>(function SelectCases(props, ref) {
44
31
  return (
45
32
  <div className="grid gap-4">
@@ -8,6 +8,8 @@ import { TableRenderCell } from './render-cell';
8
8
  import { TableSortData } from './sort-data';
9
9
  import { TableStateless } from './stateless';
10
10
  import { TableWithFooter } from './with-footer';
11
+ import { TableStatefulWithSelection } from './stateful-with-selection';
12
+ import { TableStatelessWithSelection } from './stateless-with-selection';
11
13
  import { TableWithPagination } from './with-pagination';
12
14
 
13
15
  export const TABLE_ROUTES: Routes = {
@@ -20,6 +22,8 @@ export const TABLE_ROUTES: Routes = {
20
22
  'render-cell': TableRenderCell,
21
23
  'sort-data': TableSortData,
22
24
  'with-footer': TableWithFooter,
25
+ 'stateful-with-selection': TableStatefulWithSelection,
26
+ 'stateless-with-selection': TableStatelessWithSelection,
23
27
  'with-pagination': TableWithPagination,
24
28
  stateless: TableStateless,
25
29
  },
@@ -0,0 +1,78 @@
1
+ import type { FC } from 'react';
2
+ import React, { useEffect, useRef, useState } from 'react';
3
+ import { KolButton, KolTableStateful } from '@public-ui/react';
4
+ import { SampleDescription } from '../SampleDescription';
5
+ import type { KoliBriTableSelection } from '@public-ui/components';
6
+
7
+ const DATA = [
8
+ { id: '1001', name: 'Foo Bar' },
9
+ { id: '1002', name: 'Foo Baz' },
10
+ ];
11
+ type Data = (typeof DATA)[0];
12
+
13
+ export const TableStatefulWithSelection: FC = () => {
14
+ const [selectedValue, setSelectedValue] = useState<Data[]>();
15
+
16
+ const selection: KoliBriTableSelection = {
17
+ label: (row: Data) => `Selection for ${row.name}`,
18
+ selectedKeys: selectedValue ? selectedValue.map((element) => element.id) : [],
19
+ keyPropertyName: 'id',
20
+ };
21
+
22
+ const kolTableStatefulRef = useRef<HTMLKolTableStatefulElement>();
23
+
24
+ const handleSelectionChangeEvent = ({ detail: selection }) => {
25
+ console.log('Selection change via event', selection);
26
+ };
27
+ const handleSelectionChangeCallback = (_event, selection) => {
28
+ console.log('Selection change via callback', selection);
29
+ };
30
+
31
+ const handleButtonClick = async () => {
32
+ const selection = await kolTableStatefulRef.current?.getSelection();
33
+ setSelectedValue(selection);
34
+ };
35
+
36
+ useEffect(() => {
37
+ kolTableStatefulRef.current?.addEventListener('kol-selection-change', handleSelectionChangeEvent);
38
+
39
+ return () => {
40
+ kolTableStatefulRef.current?.removeEventListener('kol-selection-change', handleSelectionChangeEvent);
41
+ };
42
+ }, [kolTableStatefulRef]);
43
+
44
+ return (
45
+ <>
46
+ <SampleDescription>KolTableStateful with selection</SampleDescription>
47
+
48
+ <KolTableStateful
49
+ _label="Table with selection checkboxes"
50
+ _headers={{
51
+ horizontal: [
52
+ [
53
+ { key: 'id', label: '#ID', textAlign: 'left' },
54
+ { key: 'name', label: 'Name', textAlign: 'left' },
55
+ ],
56
+ ],
57
+ }}
58
+ _data={DATA}
59
+ _selection={selection}
60
+ _on={{ onSelectionChange: handleSelectionChangeCallback }}
61
+ className="block"
62
+ style={{ maxWidth: '600px' }}
63
+ ref={kolTableStatefulRef}
64
+ />
65
+ <div className="grid grid-cols-3 items-end gap-4 mt-4">
66
+ <KolButton
67
+ _label="getSelection()"
68
+ _on={{
69
+ onClick: () => {
70
+ void handleButtonClick();
71
+ },
72
+ }}
73
+ ></KolButton>
74
+ <pre>{JSON.stringify(selectedValue, null, 2)}</pre>
75
+ </div>
76
+ </>
77
+ );
78
+ };
@@ -0,0 +1,60 @@
1
+ import type { FC } from 'react';
2
+ import React, { useEffect, useRef } from 'react';
3
+ import { KolTableStateless } from '@public-ui/react';
4
+ import { SampleDescription } from '../SampleDescription';
5
+ import type { KoliBriTableSelection } from '@public-ui/components';
6
+
7
+ const DATA = [
8
+ { id: '1001', name: 'Foo Bar' },
9
+ { id: '1002', name: 'Foo Baz' },
10
+ ];
11
+ type Data = (typeof DATA)[0];
12
+
13
+ export const TableStatelessWithSelection: FC = () => {
14
+ const selection: KoliBriTableSelection = {
15
+ label: (row: Data) => `Selection for ${row.name}`,
16
+ selectedKeys: ['1002'],
17
+ keyPropertyName: 'id',
18
+ };
19
+
20
+ const kolTableStatelessRef = useRef<HTMLKolTableStatelessElement>();
21
+
22
+ const handleSelectionChangeEvent = ({ detail: selection }) => {
23
+ console.log('Selection change via event', selection);
24
+ };
25
+ const handleSelectionChangeCallback = (_event, selection) => {
26
+ console.log('Selection change via callback', selection);
27
+ };
28
+
29
+ useEffect(() => {
30
+ kolTableStatelessRef.current?.addEventListener('kol-selection-change', handleSelectionChangeEvent);
31
+
32
+ return () => {
33
+ kolTableStatelessRef.current?.removeEventListener('kol-selection-change', handleSelectionChangeEvent);
34
+ };
35
+ }, [kolTableStatelessRef]);
36
+
37
+ return (
38
+ <>
39
+ <SampleDescription>KolTableStateless with selection</SampleDescription>
40
+
41
+ <KolTableStateless
42
+ _label="Table with selection checkboxes"
43
+ _headerCells={{
44
+ horizontal: [
45
+ [
46
+ { key: 'id', label: '#ID', textAlign: 'left' },
47
+ { key: 'name', label: 'Name', textAlign: 'left' },
48
+ ],
49
+ ],
50
+ }}
51
+ _data={DATA}
52
+ _selection={selection}
53
+ _on={{ onSelectionChange: handleSelectionChangeCallback }}
54
+ className="block"
55
+ style={{ maxWidth: '600px' }}
56
+ ref={kolTableStatelessRef}
57
+ />
58
+ </>
59
+ );
60
+ };
@@ -8,6 +8,11 @@ const tabs = [
8
8
  {
9
9
  _icons: 'codicon codicon-pie-chart',
10
10
  _label: 'Erster Tab',
11
+ _on: {
12
+ onSelect: (event) => {
13
+ console.log('Erster Tab ausgewählt', event);
14
+ },
15
+ },
11
16
  },
12
17
  {
13
18
  _icons: 'codicon codicon-calendar',
@@ -10,6 +10,9 @@ export const TextareaCases = forwardRef<HTMLKolTextareaElement, Components.KolTe
10
10
  <div className="grid gap-4">
11
11
  <KolTextarea {...props} _msg={{ _type: 'error', _description: ERROR_MSG }} _label="Text" _touched />
12
12
  <KolTextarea {...props} ref={ref} _accessKey="T" _label="Text (3 rows)" _rows={3} />
13
+ <KolTextarea {...props} ref={ref} _label="Text (placeholder)" _rows={3} _placeholder="Placeholder" />
14
+ <KolTextarea {...props} ref={ref} _label="Text (disabled & placeholder)" _rows={3} _placeholder="Placeholder" _disabled />
15
+ <KolTextarea {...props} ref={ref} _label="Text (disabled & value)" _rows={3} _placeholder="Placeholder" _value="Lorem ipsum" _disabled />
13
16
  </div>
14
17
  );
15
18
  });
@@ -0,0 +1,48 @@
1
+ import type { FC } from 'react';
2
+ import React, { useContext } from 'react';
3
+ import { KolBadge, KolToolbar } from '@public-ui/react';
4
+ import { HideMenusContext } from '../../shares/HideMenusContext';
5
+
6
+ export const ToolbarBasic: FC = () => {
7
+ const hideMenus = useContext(HideMenusContext);
8
+ return (
9
+ <>
10
+ {!hideMenus && <KolBadge className="block mb-3" _label="Component is a DRAFT - Don't use in production yet." _color="#db5461" />}
11
+ <KolToolbar
12
+ class="block w-fit"
13
+ _label="Toolbar"
14
+ _items={[
15
+ {
16
+ _label: 'Back',
17
+ _hideLabel: true,
18
+ _icons: {
19
+ left: {
20
+ icon: 'codicon codicon-arrow-left',
21
+ },
22
+ },
23
+ },
24
+ {
25
+ _label: 'Next',
26
+ _hideLabel: true,
27
+ _icons: {
28
+ right: {
29
+ icon: 'codicon codicon-arrow-right',
30
+ },
31
+ },
32
+ },
33
+ {
34
+ _href: '#',
35
+ _label: 'Simple Link 1',
36
+ },
37
+ {
38
+ _href: '#',
39
+ _label: 'Simple Link 3',
40
+ },
41
+ {
42
+ _label: 'Bold',
43
+ },
44
+ ]}
45
+ />
46
+ </>
47
+ );
48
+ };