@public-ui/sample-react 3.0.0-rc.6 → 3.0.0-rc.8

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 (224) hide show
  1. package/dist/1006.js +2 -0
  2. package/dist/1752.js +2 -0
  3. package/dist/1932.js +2 -0
  4. package/dist/2069.js +2 -0
  5. package/dist/2212.js +2 -0
  6. package/dist/2231.js +2 -0
  7. package/dist/2321.js +2 -0
  8. package/dist/2596.js +2 -0
  9. package/dist/2827.js +2 -0
  10. package/dist/2894.js +2 -0
  11. package/dist/3022.js +2 -0
  12. package/dist/{3872.js → 3099.js} +2 -2
  13. package/dist/3151.js +2 -0
  14. package/dist/3203.js +2 -0
  15. package/dist/3540.js +2 -0
  16. package/dist/373.js +2 -0
  17. package/dist/3918.js +2 -0
  18. package/dist/3920.js +2 -0
  19. package/dist/4030.js +2 -0
  20. package/dist/4048.js +2 -0
  21. package/dist/4201.js +2 -0
  22. package/dist/4587.js +2 -0
  23. package/dist/4611.js +2 -0
  24. package/dist/4641.js +2 -0
  25. package/dist/4776.js +2 -0
  26. package/dist/{3949.js → 4876.js} +2 -2
  27. package/dist/5249.js +2 -0
  28. package/dist/5301.js +2 -0
  29. package/dist/5359.js +2 -0
  30. package/dist/5690.js +2 -0
  31. package/dist/5746.js +2 -0
  32. package/dist/{3758.js → 6047.js} +2 -2
  33. package/dist/6066.js +2 -0
  34. package/dist/6256.js +2 -0
  35. package/dist/6304.js +2 -0
  36. package/dist/6781.js +2 -0
  37. package/dist/{9929.js → 6790.js} +2 -2
  38. package/dist/6984.js +2 -0
  39. package/dist/7013.js +2 -0
  40. package/dist/7178.js +2 -0
  41. package/dist/{2078.js → 7347.js} +2 -2
  42. package/dist/740.js +2 -0
  43. package/dist/7444.js +2 -0
  44. package/dist/7533.js +2 -0
  45. package/dist/7535.js +2 -0
  46. package/dist/775.js +2 -0
  47. package/dist/8137.js +2 -0
  48. package/dist/8180.js +2 -0
  49. package/dist/8192.js +2 -0
  50. package/dist/8246.js +2 -0
  51. package/dist/833.js +2 -0
  52. package/dist/8378.js +2 -0
  53. package/dist/8605.js +2 -0
  54. package/dist/8625.js +2 -0
  55. package/dist/8786.js +2 -0
  56. package/dist/{6420.js → 8840.js} +2 -2
  57. package/dist/907.js +2 -0
  58. package/dist/9108.js +2 -0
  59. package/dist/9255.js +2 -0
  60. package/dist/9322.js +2 -0
  61. package/dist/9581.js +2 -0
  62. package/dist/{7084.js → 9719.js} +2 -2
  63. package/dist/9731.js +2 -0
  64. package/dist/9907.js +2 -0
  65. package/dist/9930.js +2 -0
  66. package/dist/9938.js +2 -0
  67. package/dist/main.css +2 -2
  68. package/dist/main.js +1 -1
  69. package/dist/main.js.LICENSE.txt +2 -2
  70. package/package.json +26 -22
  71. package/src/components/SampleDescription.tsx +27 -15
  72. package/src/components/Sidebar.tsx +29 -10
  73. package/src/components/badge/basic.tsx +1 -1
  74. package/src/components/badge/button.tsx +1 -1
  75. package/src/components/button/baselined.tsx +1 -1
  76. package/src/components/button/short-key.tsx +104 -3
  77. package/src/components/drawer/basic.tsx +7 -5
  78. package/src/components/handout/basic.tsx +5 -3
  79. package/src/components/icon/basic.tsx +2 -1
  80. package/src/components/input-date/partials/cases.tsx +1 -1
  81. package/src/components/link/short-key.tsx +1 -1
  82. package/src/components/link-button/aria-description.tsx +1 -1
  83. package/src/components/link-button/basic.tsx +8 -10
  84. package/src/components/select/partials/cases.tsx +6 -3
  85. package/src/components/table/predefined-settings.tsx +41 -0
  86. package/src/components/table/render-cell.tsx +1 -1
  87. package/src/components/table/routes.ts +6 -4
  88. package/src/components/table/sort-data.tsx +2 -2
  89. package/src/components/table/stateful-with-selection.tsx +4 -1
  90. package/src/components/table/stateless-with-selection.tsx +4 -1
  91. package/src/components/table/stateless-with-single-selection.tsx +2 -0
  92. package/src/components/tree/basic.tsx +2 -1
  93. package/src/react.main.tsx +2 -11
  94. package/src/scenarios/change-tabindex.tsx +24 -22
  95. package/src/style.scss +15 -4
  96. package/unocss.config.ts +67 -68
  97. package/webpack.config.js +12 -23
  98. package/dist/1068.js +0 -2
  99. package/dist/1219.js +0 -2
  100. package/dist/136.js +0 -2
  101. package/dist/1416.js +0 -2
  102. package/dist/1573.js +0 -2
  103. package/dist/1676.js +0 -2
  104. package/dist/1718.js +0 -2
  105. package/dist/1744.js +0 -2
  106. package/dist/1791.js +0 -2
  107. package/dist/2115.js +0 -2
  108. package/dist/2195.js +0 -2
  109. package/dist/2994.js +0 -2
  110. package/dist/3021.js +0 -2
  111. package/dist/3027.js +0 -2
  112. package/dist/3186.js +0 -2
  113. package/dist/364.js +0 -2
  114. package/dist/3836.js +0 -2
  115. package/dist/3879.js +0 -2
  116. package/dist/4114.js +0 -2
  117. package/dist/4211.js +0 -2
  118. package/dist/4350.js +0 -2
  119. package/dist/4390.js +0 -2
  120. package/dist/4566.js +0 -2
  121. package/dist/4662.js +0 -2
  122. package/dist/4928.js +0 -2
  123. package/dist/5000.js +0 -2
  124. package/dist/5151.js +0 -2
  125. package/dist/5171.js +0 -2
  126. package/dist/5876.js +0 -2
  127. package/dist/597.js +0 -2
  128. package/dist/6451.js +0 -2
  129. package/dist/6480.js +0 -2
  130. package/dist/6577.js +0 -2
  131. package/dist/6983.js +0 -2
  132. package/dist/7225.js +0 -2
  133. package/dist/7267.js +0 -2
  134. package/dist/7958.js +0 -2
  135. package/dist/7997.js +0 -2
  136. package/dist/8069.js +0 -2
  137. package/dist/8177.js +0 -2
  138. package/dist/8212.js +0 -2
  139. package/dist/8243.js +0 -2
  140. package/dist/8283.js +0 -2
  141. package/dist/8478.js +0 -2
  142. package/dist/851.js +0 -2
  143. package/dist/8573.js +0 -2
  144. package/dist/8728.js +0 -2
  145. package/dist/8808.js +0 -2
  146. package/dist/8999.js +0 -2
  147. package/dist/9068.js +0 -2
  148. package/dist/9130.js +0 -2
  149. package/dist/9162.js +0 -2
  150. package/dist/9219.js +0 -2
  151. package/dist/9235.js +0 -2
  152. package/dist/9423.js +0 -2
  153. package/dist/9430.js +0 -2
  154. package/dist/9802.js +0 -2
  155. package/dist/9914.js +0 -2
  156. package/dist/993.js +0 -2
  157. package/dist/assets/README.md +0 -1
  158. package/public/assets/README.md +0 -1
  159. /package/dist/{1068.js.LICENSE.txt → 1006.js.LICENSE.txt} +0 -0
  160. /package/dist/{1219.js.LICENSE.txt → 1752.js.LICENSE.txt} +0 -0
  161. /package/dist/{136.js.LICENSE.txt → 1932.js.LICENSE.txt} +0 -0
  162. /package/dist/{1416.js.LICENSE.txt → 2069.js.LICENSE.txt} +0 -0
  163. /package/dist/{1573.js.LICENSE.txt → 2212.js.LICENSE.txt} +0 -0
  164. /package/dist/{1676.js.LICENSE.txt → 2231.js.LICENSE.txt} +0 -0
  165. /package/dist/{1718.js.LICENSE.txt → 2321.js.LICENSE.txt} +0 -0
  166. /package/dist/{1744.js.LICENSE.txt → 2596.js.LICENSE.txt} +0 -0
  167. /package/dist/{1791.js.LICENSE.txt → 2827.js.LICENSE.txt} +0 -0
  168. /package/dist/{2078.js.LICENSE.txt → 2894.js.LICENSE.txt} +0 -0
  169. /package/dist/{2115.js.LICENSE.txt → 3022.js.LICENSE.txt} +0 -0
  170. /package/dist/{2195.js.LICENSE.txt → 3099.js.LICENSE.txt} +0 -0
  171. /package/dist/{2994.js.LICENSE.txt → 3151.js.LICENSE.txt} +0 -0
  172. /package/dist/{3021.js.LICENSE.txt → 3203.js.LICENSE.txt} +0 -0
  173. /package/dist/{3027.js.LICENSE.txt → 3540.js.LICENSE.txt} +0 -0
  174. /package/dist/{3186.js.LICENSE.txt → 373.js.LICENSE.txt} +0 -0
  175. /package/dist/{364.js.LICENSE.txt → 3918.js.LICENSE.txt} +0 -0
  176. /package/dist/{3758.js.LICENSE.txt → 3920.js.LICENSE.txt} +0 -0
  177. /package/dist/{3836.js.LICENSE.txt → 4030.js.LICENSE.txt} +0 -0
  178. /package/dist/{3872.js.LICENSE.txt → 4048.js.LICENSE.txt} +0 -0
  179. /package/dist/{3879.js.LICENSE.txt → 4201.js.LICENSE.txt} +0 -0
  180. /package/dist/{3949.js.LICENSE.txt → 4587.js.LICENSE.txt} +0 -0
  181. /package/dist/{4114.js.LICENSE.txt → 4611.js.LICENSE.txt} +0 -0
  182. /package/dist/{4211.js.LICENSE.txt → 4641.js.LICENSE.txt} +0 -0
  183. /package/dist/{4350.js.LICENSE.txt → 4776.js.LICENSE.txt} +0 -0
  184. /package/dist/{4390.js.LICENSE.txt → 4876.js.LICENSE.txt} +0 -0
  185. /package/dist/{4566.js.LICENSE.txt → 5249.js.LICENSE.txt} +0 -0
  186. /package/dist/{4662.js.LICENSE.txt → 5301.js.LICENSE.txt} +0 -0
  187. /package/dist/{4928.js.LICENSE.txt → 5359.js.LICENSE.txt} +0 -0
  188. /package/dist/{5000.js.LICENSE.txt → 5690.js.LICENSE.txt} +0 -0
  189. /package/dist/{5151.js.LICENSE.txt → 5746.js.LICENSE.txt} +0 -0
  190. /package/dist/{5171.js.LICENSE.txt → 6047.js.LICENSE.txt} +0 -0
  191. /package/dist/{5876.js.LICENSE.txt → 6066.js.LICENSE.txt} +0 -0
  192. /package/dist/{597.js.LICENSE.txt → 6256.js.LICENSE.txt} +0 -0
  193. /package/dist/{6420.js.LICENSE.txt → 6304.js.LICENSE.txt} +0 -0
  194. /package/dist/{6451.js.LICENSE.txt → 6781.js.LICENSE.txt} +0 -0
  195. /package/dist/{6480.js.LICENSE.txt → 6790.js.LICENSE.txt} +0 -0
  196. /package/dist/{6577.js.LICENSE.txt → 6984.js.LICENSE.txt} +0 -0
  197. /package/dist/{6983.js.LICENSE.txt → 7013.js.LICENSE.txt} +0 -0
  198. /package/dist/{7084.js.LICENSE.txt → 7178.js.LICENSE.txt} +0 -0
  199. /package/dist/{7225.js.LICENSE.txt → 7347.js.LICENSE.txt} +0 -0
  200. /package/dist/{7267.js.LICENSE.txt → 740.js.LICENSE.txt} +0 -0
  201. /package/dist/{7958.js.LICENSE.txt → 7444.js.LICENSE.txt} +0 -0
  202. /package/dist/{7997.js.LICENSE.txt → 7533.js.LICENSE.txt} +0 -0
  203. /package/dist/{8069.js.LICENSE.txt → 7535.js.LICENSE.txt} +0 -0
  204. /package/dist/{8177.js.LICENSE.txt → 775.js.LICENSE.txt} +0 -0
  205. /package/dist/{8212.js.LICENSE.txt → 8137.js.LICENSE.txt} +0 -0
  206. /package/dist/{8243.js.LICENSE.txt → 8180.js.LICENSE.txt} +0 -0
  207. /package/dist/{8283.js.LICENSE.txt → 8192.js.LICENSE.txt} +0 -0
  208. /package/dist/{8478.js.LICENSE.txt → 8246.js.LICENSE.txt} +0 -0
  209. /package/dist/{851.js.LICENSE.txt → 833.js.LICENSE.txt} +0 -0
  210. /package/dist/{8573.js.LICENSE.txt → 8378.js.LICENSE.txt} +0 -0
  211. /package/dist/{8728.js.LICENSE.txt → 8605.js.LICENSE.txt} +0 -0
  212. /package/dist/{8808.js.LICENSE.txt → 8625.js.LICENSE.txt} +0 -0
  213. /package/dist/{8999.js.LICENSE.txt → 8786.js.LICENSE.txt} +0 -0
  214. /package/dist/{9068.js.LICENSE.txt → 8840.js.LICENSE.txt} +0 -0
  215. /package/dist/{9130.js.LICENSE.txt → 907.js.LICENSE.txt} +0 -0
  216. /package/dist/{9162.js.LICENSE.txt → 9108.js.LICENSE.txt} +0 -0
  217. /package/dist/{9219.js.LICENSE.txt → 9255.js.LICENSE.txt} +0 -0
  218. /package/dist/{9235.js.LICENSE.txt → 9322.js.LICENSE.txt} +0 -0
  219. /package/dist/{9423.js.LICENSE.txt → 9581.js.LICENSE.txt} +0 -0
  220. /package/dist/{9430.js.LICENSE.txt → 9719.js.LICENSE.txt} +0 -0
  221. /package/dist/{9802.js.LICENSE.txt → 9731.js.LICENSE.txt} +0 -0
  222. /package/dist/{9914.js.LICENSE.txt → 9907.js.LICENSE.txt} +0 -0
  223. /package/dist/{9929.js.LICENSE.txt → 9930.js.LICENSE.txt} +0 -0
  224. /package/dist/{993.js.LICENSE.txt → 9938.js.LICENSE.txt} +0 -0
@@ -33,7 +33,7 @@
33
33
  */
34
34
 
35
35
  /**
36
- * @remix-run/router v1.21.1
36
+ * @remix-run/router v1.23.0
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.28.2
47
+ * React Router v6.30.0
48
48
  *
49
49
  * Copyright (c) Remix Software Inc.
50
50
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/sample-react",
3
- "version": "3.0.0-rc.6",
3
+ "version": "3.0.0-rc.8",
4
4
  "description": "This app contains samples for the KoliBri/Public UI",
5
5
  "license": "EUPL-1.2",
6
6
  "repository": {
@@ -13,20 +13,20 @@
13
13
  "@leanup/stack-webpack": "1.3.54",
14
14
  "@playwright/test": "1.49.1",
15
15
  "@stencil/core": "4.22.3",
16
- "@types/node": "ts5.7",
16
+ "@types/node": "22.14.1",
17
17
  "@types/react": "18.3.4",
18
18
  "@types/react-dom": "18.3.5",
19
- "@typescript-eslint/eslint-plugin": "8.18.2",
20
- "@typescript-eslint/parser": "8.18.2",
19
+ "@typescript-eslint/eslint-plugin": "8.27.0",
20
+ "@typescript-eslint/parser": "8.27.0",
21
21
  "@unocss/preset-uno": "0.58.9",
22
22
  "@unocss/webpack": "0.58.9",
23
- "adopted-style-sheets": "1.1.7",
23
+ "adopted-style-sheets": "1.1.8",
24
24
  "ajv": "8.17.1",
25
25
  "chromedriver": "130.0.4",
26
26
  "cpy-cli": "5.0.0",
27
27
  "cross-env": "7.0.3",
28
28
  "css-loader": "7.1.2",
29
- "esbuild-loader": "4.2.2",
29
+ "esbuild-loader": "4.3.0",
30
30
  "eslint": "^8",
31
31
  "eslint-plugin-html": "8.1.2",
32
32
  "eslint-plugin-json": "^3",
@@ -34,34 +34,35 @@
34
34
  "eslint-plugin-react": "7.37.4",
35
35
  "file-loader": "6.2.0",
36
36
  "formik": "2.4.6",
37
- "knip": "5.40.0",
37
+ "knip": "5.46.0",
38
38
  "less-loader": "12.2.0",
39
39
  "mini-css-extract-plugin": "2.9.2",
40
40
  "nightwatch-axe-verbose": "2.3.1",
41
41
  "npm-run-all2": "7.0.2",
42
42
  "postcss-loader": "8.1.1",
43
- "prettier": "3.4.2",
43
+ "prettier": "3.5.3",
44
44
  "react": "18.3.1",
45
45
  "react-dom": "18.3.1",
46
46
  "react-number-format": "5.4.3",
47
- "react-router": "6.28.2",
48
- "react-router-dom": "6.28.2",
47
+ "react-router": "6.30.0",
48
+ "react-router-dom": "6.30.0",
49
49
  "rimraf": "6.0.1",
50
- "sass-loader": "16.0.4",
50
+ "sass-loader": "16.0.5",
51
51
  "string-replace-loader": "3.1.0",
52
+ "stylelint": "16.17.0",
53
+ "stylelint-config-recommended-scss": "14.1.0",
54
+ "stylelint-config-standard": "37.0.0",
55
+ "stylelint-scss": "6.11.1",
52
56
  "tslib": "2.8.1",
53
- "typescript": "5.7.3",
54
- "webpack": "5.97.1",
57
+ "typescript": "5.8.2",
58
+ "webpack": "5.98.0",
55
59
  "webpack-cli": "5.1.4",
56
60
  "webpack-dev-server": "5.2.0",
57
61
  "world_countries_lists": "2.9.0",
58
- "yup": "1.5.0",
59
- "@public-ui/components": "3.0.0-rc.6",
60
- "@public-ui/react": "3.0.0-rc.6",
61
- "@public-ui/theme-default": "3.0.0-rc.6"
62
- },
63
- "optionalDependencies": {
64
- "@public-ui-/theme-ecl": "2.1.3"
62
+ "yup": "1.6.1",
63
+ "@public-ui/components": "3.0.0-rc.8",
64
+ "@public-ui/themes": "3.0.0-rc.8",
65
+ "@public-ui/react": "3.0.0-rc.8"
65
66
  },
66
67
  "files": [
67
68
  ".eslintignore",
@@ -78,11 +79,14 @@
78
79
  "webpack.config.js"
79
80
  ],
80
81
  "scripts": {
81
- "prebuild": "pnpm -r --filter=@public-ui/theme-* --filter @public-ui-/theme-* build",
82
+ "prebuild": "pnpm -r --filter=@public-ui/themes build",
82
83
  "build": "rimraf dist && cross-env NODE_ENV=production webpack",
83
84
  "build:deps": "pnpm --filter @public-ui/sample-react^... build",
84
85
  "format": "prettier --check src",
85
- "lint": "tsc --noemit && eslint \"{src,tests,e2e}/**/*.{html,js,json,jsx,ts,tsx,gql,graphql}\"",
86
+ "lint": "pnpm lint:eslint && pnpm lint:stylelint && pnpm lint:tsc",
87
+ "lint:eslint": "eslint src",
88
+ "lint:stylelint": "stylelint \"src/**/*.{css,scss}\"",
89
+ "lint:tsc": "tsc --noemit",
86
90
  "postinstall": "pnpm exec playwright install",
87
91
  "prepare:components-assets": "cpy \"node_modules/@public-ui/components/assets/**/*\" public/assets --dot",
88
92
  "prepare:themes-assets": "cpy \"node_modules/@public-ui/theme-default/assets/**/*\" public/assets --dot",
@@ -6,36 +6,48 @@ import { PUBLIC_CODE_COMPONENT_URL, PUBLIC_DOC_COMPONENT_URL } from '../shares/c
6
6
  import { KolLink } from '@public-ui/react';
7
7
 
8
8
  import { HideMenusContext } from '../shares/HideMenusContext';
9
-
10
- const getLocationPaths = () => {
11
- return location.hash.split('/').slice(1);
12
- };
9
+ import { useLocation } from 'react-router';
13
10
 
14
11
  export const SampleDescription: FC<PropsWithChildren> = (props) => {
15
12
  const hideMenus = useContext(HideMenusContext);
13
+ const location = useLocation();
14
+ const paths = location.pathname.split('/').slice(1);
16
15
 
17
16
  const docLink = useMemo(() => {
18
- const paths = getLocationPaths();
19
17
  return paths[0] === 'scenarios'
20
18
  ? null // Scenarios are not a component and hence have no documentation.
21
19
  : `${PUBLIC_DOC_COMPONENT_URL}/${paths[0]}`;
22
20
  }, [location.hash]);
23
21
 
24
22
  const codeLink = useMemo(() => {
25
- const paths = getLocationPaths();
26
23
  return paths[0] === 'scenarios'
27
24
  ? null // Scenarios are not a component and hence have no documentation.
28
25
  : `${PUBLIC_CODE_COMPONENT_URL}/${paths[0]}/${paths[1]}.tsx`;
29
26
  }, [location.hash]);
30
27
 
31
- return hideMenus ? null : (
32
- <div className="flex justify-between mb-sm">
33
- <div className="indented-text">{props.children}</div>
34
- <div className="flex flex-wrap gap-2 shrink-0 ml">
35
- {codeLink && <KolLink _href={codeLink} _label="Code" _target="_blank" />}
36
- {docLink && <KolLink _href={docLink} _label="Documentation" _target="_blank" />}
37
- <KolLink _href={`${location.href}?hideMenus`} _label="Standalone example" _target="_blank" />
38
- </div>
39
- </div>
28
+ return (
29
+ <>
30
+ <h1 className="visually-hidden">{location.pathname.replace(/\//g, ' ')}</h1>
31
+ {hideMenus ? null : (
32
+ <div className="grid sm:flex gap-4 justify-between pb-sm border-b-1 border-b-solid border-gray mb-2">
33
+ <div className="indented-text">{props.children}</div>
34
+ <ul className="flex flex-wrap gap-2 list-none m-0 p-0">
35
+ {codeLink && (
36
+ <li>
37
+ <KolLink _href={codeLink} _label="Code" _target="_blank" />
38
+ </li>
39
+ )}
40
+ {docLink && (
41
+ <li>
42
+ <KolLink _href={docLink} _label="Documentation" _target="_blank" />
43
+ </li>
44
+ )}
45
+ <li>
46
+ <KolLink _href={`#${location.pathname}?hideMenus`} _label="Standalone example" _target="_blank" />
47
+ </li>
48
+ </ul>
49
+ </div>
50
+ )}
51
+ </>
40
52
  );
41
53
  };
@@ -7,6 +7,34 @@ import { THEME_OPTIONS } from '../shares/theme';
7
7
 
8
8
  import type { Routes } from '../shares/types';
9
9
  import Navigation from './Navigation';
10
+
11
+ type BuildInformationProps = {
12
+ buildDate?: string | null;
13
+ commitHash?: string | null;
14
+ };
15
+ const BuildInformation: FC<BuildInformationProps> = ({ buildDate, commitHash }) => {
16
+ if (!buildDate && !commitHash) {
17
+ return '';
18
+ }
19
+
20
+ return (
21
+ <div className="text-sm font-mono color-gray-5 m-t-2">
22
+ {buildDate && commitHash ? ( // date and hash provided
23
+ <>
24
+ Build: {commitHash}
25
+ <br />
26
+ at {buildDate}
27
+ </>
28
+ ) : commitHash ? ( // hash only
29
+ `Build: ${commitHash}`
30
+ ) : (
31
+ // date only
32
+ `Build date: ${buildDate}`
33
+ )}
34
+ </div>
35
+ );
36
+ };
37
+
10
38
  type Props = {
11
39
  version: string;
12
40
  theme: string;
@@ -47,16 +75,8 @@ export const Sidebar: FC<Props> = ({ version, theme, routes, routeList, sample,
47
75
  <KolHeading _label="KoliBri React"></KolHeading>
48
76
  <KolVersion _label={version}></KolVersion>
49
77
  </div>
50
- {(buildDate || commitHash) && (
51
- <div className="text-sm font-mono color-gray-5 m-t-2">
52
- {commitHash ? `Build: ${commitHash}` : ''}
53
- <br />
54
- {buildDate ? `at ${buildDate}` : ''}
55
- </div>
56
- )}
57
-
78
+ <BuildInformation buildDate={buildDate} commitHash={commitHash} />
58
79
  <KolSelect _label="Theme" _options={THEME_OPTIONS} _on={{ onChange: handleThemeSelectChange }} _value={[theme]} class="mt"></KolSelect>
59
-
60
80
  <KolHeading _label="Components" _level={2} className="block mt"></KolHeading>
61
81
  <div className="flex flex-justify-between flex-items-center mt">
62
82
  <KolButton _icons="codicon codicon-arrow-left" _hideLabel _label="Previous component" _on={{ onClick: handlePreviousClick }} />
@@ -65,7 +85,6 @@ export const Sidebar: FC<Props> = ({ version, theme, routes, routeList, sample,
65
85
  </span>
66
86
  <KolButton _icons="codicon codicon-arrow-right" _hideLabel _label="Next component" _on={{ onClick: handleNextClick }} />
67
87
  </div>
68
-
69
88
  <Navigation routes={routes} />
70
89
  </div>
71
90
  </aside>
@@ -11,7 +11,7 @@ export const BadgeBasic: FC = () => (
11
11
  <p>KolBadge shows badges with a label, background color and optional icon.</p>
12
12
  </SampleDescription>
13
13
 
14
- <div className="flex gap-2">
14
+ <div className="flex flex-wrap gap-2">
15
15
  <KolBadge _label="black"></KolBadge>
16
16
  <KolBadge _color="#86ffc6" _label="teal"></KolBadge>
17
17
  <KolBadge _color="#06539e" _label="blue"></KolBadge>
@@ -23,7 +23,7 @@ export const BadgeButton: FC = () => (
23
23
  </p>
24
24
  </SampleDescription>
25
25
 
26
- <div className="flex gap-2">
26
+ <div className="flex flex-wrap gap-2">
27
27
  <KolBadge {...createBadgeProps('black')}></KolBadge>
28
28
  <KolBadge _color="#86ffc6" {...createBadgeProps('teal')}></KolBadge>
29
29
  <KolBadge _color="#06539e" {...createBadgeProps('blue')}></KolBadge>
@@ -19,7 +19,7 @@ export const ButtonBaselined: FC = () => {
19
19
  <p>This KolButton sample is used for internal testing purposes: It features multiple buttons with and without icons which are vertically aligned.</p>
20
20
  </SampleDescription>
21
21
 
22
- <div className="flex">
22
+ <div className="flex flex-wrap gap-2">
23
23
  <KolButton _label="Label-Text" _on={dummyEventHandler}></KolButton>
24
24
  <KolButton _label="Label-Text" _on={dummyEventHandler}></KolButton>
25
25
  <KolButton _label="Label-Text" _on={dummyEventHandler}></KolButton>
@@ -1,8 +1,61 @@
1
- import { KolButton } from '@public-ui/react';
2
- import React from 'react';
1
+ import { createReactRenderElement, KolButton, KolHeading, KolTableStateful } from '@public-ui/react';
3
2
  import type { FC } from 'react';
3
+ import { useRef } from 'react';
4
+ import React from 'react';
4
5
  import { SampleDescription } from '../SampleDescription';
5
6
  import { useToasterService } from '../../hooks/useToasterService';
7
+ import { getRoot } from '../../shares/react-roots';
8
+ import type { KoliBriTableHeaders } from '@public-ui/components';
9
+ import { ToasterService } from '@public-ui/components';
10
+
11
+ const RowActions: FC<{ label: string }> = ({ label }) => {
12
+ const toaster = ToasterService.getInstance(document);
13
+ const editButtonRef = useRef<HTMLKolButtonElement | null>(null);
14
+ const deleteButtonRef = useRef<HTMLKolButtonElement | null>(null);
15
+
16
+ const handleEditClick = () => {
17
+ toaster.enqueue({
18
+ label: 'Edit clicked',
19
+ description: `The button "edit" has been clicked for ${label}`,
20
+ type: 'info',
21
+ });
22
+ };
23
+
24
+ const handleDeleteClick = () => {
25
+ toaster.enqueue({
26
+ label: 'Delete clicked',
27
+ description: `The button "delete" has been clicked for ${label}`,
28
+ type: 'warning',
29
+ });
30
+ };
31
+
32
+ const handleKeyUp = (event: React.KeyboardEvent<HTMLDivElement>) => {
33
+ switch (event.code) {
34
+ case 'KeyE':
35
+ void editButtonRef.current?.kolFocus();
36
+ handleEditClick();
37
+ return;
38
+ case 'KeyD':
39
+ void deleteButtonRef.current?.kolFocus();
40
+ handleDeleteClick();
41
+ return;
42
+ }
43
+ };
44
+
45
+ return (
46
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
47
+ <div
48
+ style={{
49
+ display: 'flex',
50
+ gap: 'calc(10rem / var(--kolibri-root-font-size, 16))',
51
+ }}
52
+ onKeyUp={handleKeyUp}
53
+ >
54
+ <KolButton ref={editButtonRef} _label={'Edit'} _shortKey={'e'} _on={{ onClick: handleEditClick }} />
55
+ <KolButton ref={deleteButtonRef} _label={'Delete'} _shortKey={'d'} _variant={'danger'} _on={{ onClick: handleDeleteClick }} />
56
+ </div>
57
+ );
58
+ };
6
59
 
7
60
  export const ButtonShortKey: FC = () => {
8
61
  const { dummyClickEventHandler } = useToasterService();
@@ -11,11 +64,50 @@ export const ButtonShortKey: FC = () => {
11
64
  onClick: dummyClickEventHandler,
12
65
  };
13
66
 
67
+ type Data = {
68
+ label: string;
69
+ };
70
+ const DATA: Data[] = [
71
+ {
72
+ label: 'Row 1',
73
+ },
74
+ {
75
+ label: 'Row 2',
76
+ },
77
+ ];
78
+
79
+ const HEADERS: KoliBriTableHeaders = {
80
+ horizontal: [
81
+ [
82
+ {
83
+ label: 'Label',
84
+ key: 'label',
85
+ textAlign: 'left',
86
+ },
87
+ {
88
+ label: 'Actions',
89
+ key: 'actions',
90
+ textAlign: 'left',
91
+
92
+ render: (el, cell) => {
93
+ getRoot(createReactRenderElement(el)).render(<RowActions label={(cell.data as Data).label} />);
94
+ },
95
+ },
96
+ ],
97
+ ],
98
+ };
99
+
14
100
  return (
15
101
  <>
16
102
  <SampleDescription>
17
103
  <p>
18
- This sample shows KolButton with short key without functionality. The short key is purely visual. Its functionality needs to be developed separately.{' '}
104
+ The first sample shows KolButton with short key without functionality. The short key is purely visual. Its functionality needs to be developed
105
+ separately.
106
+ </p>
107
+ <p>
108
+ The second sample showcases a table where each row contains two KolButtons, each with its own shortcut key. To trigger an action, move the focus to
109
+ any of the &quot;Actions&quot; cells and press &quot;e&quot; or &quot;d.&quot; Doing so will activate the corresponding action and display a Toast
110
+ notification for demonstration purposes.
19
111
  </p>
20
112
  </SampleDescription>
21
113
 
@@ -34,6 +126,15 @@ export const ButtonShortKey: FC = () => {
34
126
  _on={dummyEventHandler}
35
127
  />
36
128
  </div>
129
+
130
+ <KolHeading _level={2} _label="Interactive sample" className="mt" />
131
+
132
+ <KolTableStateful
133
+ _label={`Move focus within one of the "Actions" cells and press "e" or "d" to trigger an action.`}
134
+ _data={DATA}
135
+ _headers={HEADERS}
136
+ _minWidth="400px"
137
+ />
37
138
  </>
38
139
  );
39
140
  };
@@ -30,11 +30,13 @@ export const DrawerBasic: FC = () => {
30
30
  <DrawerRadioAlign value={align} onChange={(_, value) => setAlign(value as AlignPropType)} />
31
31
  <div className="flex flex-wrap gap-4">
32
32
  <KolDrawer ref={drawerElement} _label="I am a drawer" _align={align} _on={{ onClose: () => console.log('Drawer onClose triggered!') }}>
33
- <p>
34
- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
35
- voluptua.
36
- </p>
37
- <KolButton _label="Close drawer" _on={{ onClick: () => drawerElement.current?.close() }} />
33
+ <div className={align === 'left' || align == 'right' ? 'drawer-content-vertical' : ''}>
34
+ <p>
35
+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
36
+ voluptua.
37
+ </p>
38
+ <KolButton _label="Close drawer" _on={{ onClick: () => drawerElement.current?.close() }} />
39
+ </div>
38
40
  </KolDrawer>
39
41
  <KolButton _label="Open drawer" _on={{ onClick: () => drawerElement.current?.open() }} />
40
42
  </div>
@@ -190,7 +190,7 @@ export const HandoutBasic: FC = () => {
190
190
 
191
191
  return (
192
192
  <div className="grid gap-4">
193
- <div className="grid gap-4 grid-cols-[auto_1fr_1fr] items-center">
193
+ <div className="grid gap-4 md:grid-cols-[auto_1fr_1fr] items-center">
194
194
  <KolKolibri className="block w-75px" _labeled={false}></KolKolibri>
195
195
  <KolHeading _label="" _level={1}>
196
196
  <span slot="expert">
@@ -441,7 +441,7 @@ export const HandoutBasic: FC = () => {
441
441
  </KolCard>
442
442
  <KolCard className="col-span-6 sm:col-span-6 md:col-span-4 xl:col-span-5" _label="Input" _level={2}>
443
443
  <KolForm slot="">
444
- <div className="grid gap-4 grid-cols-3 p-2">
444
+ <div className="grid gap-4 sm:grid-cols-2 md:grid-cols-3 p-2">
445
445
  <KolInputColor _label={`Color`} />
446
446
  <KolInputFile _label={`Upload file`} />
447
447
  <KolInputNumber _label={`Number input`} />
@@ -460,7 +460,9 @@ export const HandoutBasic: FC = () => {
460
460
  <div className="grid gap-4">
461
461
  <KolInputRadio _orientation="horizontal" _options="[{'label':'Mr.','value':0},{'label':'Mrs.','value':1}]" _value="0" _label={`Salutation`} />
462
462
  <KolInputCheckbox _label="">
463
- I accept the <KolAbbr _label="General Terms and Conditions">AGB</KolAbbr>.
463
+ <span slot="expert">
464
+ I accept the <KolAbbr _label="General Terms and Conditions">AGB</KolAbbr>.
465
+ </span>
464
466
  </KolInputCheckbox>
465
467
  </div>
466
468
  <KolTextarea _rows={4} _label={`Textarea`} />
@@ -12,8 +12,9 @@ export const IconBasic: FC = () => (
12
12
  </SampleDescription>
13
13
 
14
14
  <div className="grid gap-4">
15
- <KolIcon _label="" _icons="codicon codicon-home" />
15
+ <KolIcon className="block w-[1em] h-[1em]" _label="" _icons="codicon codicon-home" />
16
16
  <KolIcon
17
+ className="block w-[1em] h-[1em]"
17
18
  style={{
18
19
  color: 'red',
19
20
  }}
@@ -8,7 +8,7 @@ export const InputDateCases = forwardRef<HTMLKolInputDateElement, Components.Kol
8
8
  return (
9
9
  <div className="grid gap-4">
10
10
  <div className="black-background">
11
- <KolInputDate {...props} _type="date" _label="Date input (Black background test)" _required />{' '}
11
+ <KolInputDate {...props} _type="date" _label="Date input (Black background test)" _required />
12
12
  </div>
13
13
  <KolInputDate {...props} _type="datetime-local" _label="Local-Datetime (Standard)" _required />
14
14
  <KolInputDate
@@ -8,7 +8,7 @@ export const LinkShortKey: FC = () => (
8
8
  <>
9
9
  <SampleDescription>
10
10
  <p>
11
- This sample shows KolButton with short key without functionality. The short key is purely visual. Its functionality needs to be developed separately.{' '}
11
+ This sample shows KolButton with short key without functionality. The short key is purely visual. Its functionality needs to be developed separately.
12
12
  </p>
13
13
  </SampleDescription>
14
14
 
@@ -9,7 +9,7 @@ export const LinkButtonAriaDescription: FC = () => (
9
9
  <p>This sample shows KolLinkButton with aria-description</p>
10
10
  </SampleDescription>
11
11
 
12
- <div className="flex flex-wrap gap-4">
12
+ <div className="flex flex-wrap gap-2">
13
13
  <KolLinkButton _href="#/back-page" _label="Link Button Text without area description"></KolLinkButton>
14
14
  <KolLinkButton _href="#/back-page" _label="Link Button Text" _ariaDescription="Link Button Area Description"></KolLinkButton>
15
15
  </div>
@@ -15,16 +15,14 @@ export const LinkButtonBasic: FC = () => (
15
15
  <p>KolLinkButton renders a link that looks like a button. The sample shows the different styling variants.</p>
16
16
  </SampleDescription>
17
17
 
18
- <div className="grid gap-14">
19
- <div className="flex flex-wrap gap-14">
20
- <KolLinkButton _label="Primary" _variant="primary" {...ARGS}></KolLinkButton>
21
- <KolLinkButton _label="Secondary" _variant="secondary" {...ARGS}></KolLinkButton>
22
- <KolLinkButton _label="Normal" _variant="normal" {...ARGS}></KolLinkButton>
23
- <KolLinkButton _label="Danger" _variant="danger" {...ARGS}></KolLinkButton>
24
- <KolLinkButton _label="Ghost" _variant="ghost" {...ARGS}></KolLinkButton>
25
- <KolLinkButton _label="Access Key" _variant="primary" _accessKey="c" {...ARGS}></KolLinkButton>
26
- <KolLinkButton _label="Short Key" _variant="primary" _shortKey="s" {...ARGS}></KolLinkButton>
27
- </div>
18
+ <div className="flex flex-wrap gap-2">
19
+ <KolLinkButton _label="Primary" _variant="primary" {...ARGS}></KolLinkButton>
20
+ <KolLinkButton _label="Secondary" _variant="secondary" {...ARGS}></KolLinkButton>
21
+ <KolLinkButton _label="Normal" _variant="normal" {...ARGS}></KolLinkButton>
22
+ <KolLinkButton _label="Danger" _variant="danger" {...ARGS}></KolLinkButton>
23
+ <KolLinkButton _label="Ghost" _variant="ghost" {...ARGS}></KolLinkButton>
24
+ <KolLinkButton _label="Access Key" _variant="primary" _accessKey="c" {...ARGS}></KolLinkButton>
25
+ <KolLinkButton _label="Short Key" _variant="primary" _shortKey="s" {...ARGS}></KolLinkButton>
28
26
  </div>
29
27
  </>
30
28
  );
@@ -9,9 +9,8 @@ import { COUNTRY_OPTIONS } from '../../../shares/country';
9
9
 
10
10
  const SALUTATION_OPTIONS: SelectOption<string>[] = [
11
11
  {
12
- label: 'No choice',
12
+ label: 'No salutation',
13
13
  value: '',
14
- disabled: true,
15
14
  },
16
15
  {
17
16
  label: 'Mrs.',
@@ -27,6 +26,10 @@ const SALUTATION_OPTIONS: SelectOption<string>[] = [
27
26
  },
28
27
  ];
29
28
 
29
+ const SALUTATION_OPTIONS_DISABLED = SALUTATION_OPTIONS.map((option, index) =>
30
+ index === 0 ? { label: 'Select salutation', value: '', disabled: true } : option,
31
+ );
32
+
30
33
  type GroupedOptionsType = Record<string, Optgroup<StencilUnknown>>;
31
34
 
32
35
  const groupedOptions: GroupedOptionsType = COUNTRY_OPTIONS.reduce((acc, option) => {
@@ -59,7 +62,7 @@ export const SelectCases = forwardRef<HTMLKolSelectElement, Components.KolSelect
59
62
  }}
60
63
  />
61
64
  <KolSelect {...props} _options={SALUTATION_OPTIONS} _label="Disabled" _disabled />
62
- <KolSelect {...props} _options={SALUTATION_OPTIONS} _label="Salutation with error" _msg={{ _type: 'error', _description: ERROR_MSG }} _touched />
65
+ <KolSelect {...props} _options={SALUTATION_OPTIONS_DISABLED} _label="Salutation with error" _msg={{ _type: 'error', _description: ERROR_MSG }} _touched />
63
66
  <KolSelect {...props} _options={COUNTRY_OPTIONS} _label="Multiple choice" _multiple />
64
67
  <KolSelect
65
68
  {...props}
@@ -0,0 +1,41 @@
1
+ import { SampleDescription } from '../SampleDescription';
2
+ import { KolTableStateful } from '@public-ui/react';
3
+ import type { FC } from 'react';
4
+ import React from 'react';
5
+
6
+ const DATA = [{ columnA: 'Column A', columnB: 'Column B', columnC: 'Column C' }];
7
+
8
+ export const PredefinedSettings: FC = () => {
9
+ return (
10
+ <>
11
+ <SampleDescription>
12
+ <p>This example shows the table with predefined settings.</p>
13
+ </SampleDescription>
14
+
15
+ <KolTableStateful
16
+ _label="Table for demonstration purposes with predefined settings"
17
+ _minWidth="auto"
18
+ _headers={{
19
+ horizontal: [
20
+ [
21
+ { label: 'column A', key: 'columnA' },
22
+ { label: 'column B', key: 'columnB' },
23
+ { label: 'column C', key: 'columnC' },
24
+ ],
25
+ ],
26
+ }}
27
+ _tableSettings={{
28
+ columns: [
29
+ { key: 'columnA', visible: false, label: 'Column A', position: 2 },
30
+ { key: 'columnB', visible: true, label: 'Column B', position: 1, width: 20 },
31
+ { key: 'columnC', visible: true, label: 'Column C', position: 0, width: 45 },
32
+ ],
33
+ }}
34
+ _data={DATA}
35
+ _min-width="500px"
36
+ className="block"
37
+ style={{ maxWidth: '600px' }}
38
+ />
39
+ </>
40
+ );
41
+ };
@@ -84,7 +84,7 @@ const HEADERS: KoliBriTableHeaders = {
84
84
  },
85
85
  {
86
86
  label: 'Action (react)',
87
- key: 'order',
87
+ key: 'action',
88
88
  width: '20em',
89
89
 
90
90
  /* Example 4: Render function using React */
@@ -14,23 +14,25 @@ import { TableStatelessWithSingleSelection } from './stateless-with-single-selec
14
14
  import { TableWithPagination } from './with-pagination';
15
15
  import { InteractiveChildElements } from './interactive-child-elements';
16
16
  import { MultiSortTable } from './multi-sort';
17
+ import { PredefinedSettings } from './predefined-settings';
17
18
 
18
19
  export const TABLE_ROUTES: Routes = {
19
20
  table: {
20
21
  'column-alignment': TableColumnAlignment,
21
22
  'complex-headers': TableComplexHeaders,
22
23
  'horizontal-scrollbar': TableHorizontalScrollbar,
24
+ 'interactive-child-elements': InteractiveChildElements,
25
+ 'multi-sort': MultiSortTable,
23
26
  'pagination-position': PaginationPosition,
27
+ 'predefined-settings': PredefinedSettings,
24
28
  'render-cell': TableRenderCell,
25
29
  'sort-data': TableSortData,
26
- 'with-footer': TableWithFooter,
27
30
  'stateful-with-selection': TableStatefulWithSelection,
28
31
  'stateful-with-single-selection': TableStatefulWithSingleSelection,
32
+ stateless: TableStateless,
29
33
  'stateless-with-selection': TableStatelessWithSelection,
30
34
  'stateless-with-single-selection': TableStatelessWithSingleSelection,
35
+ 'with-footer': TableWithFooter,
31
36
  'with-pagination': TableWithPagination,
32
- 'interactive-child-elements': InteractiveChildElements,
33
- stateless: TableStateless,
34
- 'multi-sort': MultiSortTable,
35
37
  },
36
38
  };
@@ -59,11 +59,11 @@ export const TableSortData: FC = () => (
59
59
 
60
60
  <section className="w-full grid gap-4">
61
61
  <section className="grid gap-4">
62
- <KolHeading _level={2} _label="Vertical" />
62
+ <KolHeading _level={2} _label="Vertical headers" />
63
63
  <KolTableStateful _label="Sort a date column" _minWidth="auto" _data={DATA.slice(0, 10)} _headers={HEADERS_VERTICAL} className="block" />
64
64
  </section>
65
65
  <section className="grid gap-4">
66
- <KolHeading _level={2} _label="Horizontal" />
66
+ <KolHeading _level={2} _label="Horizontal headers" />
67
67
  <KolTableStateful _label="Sort a date column" _minWidth="auto" _data={DATA} _headers={HEADERS_HORIZONTAL} className="block" />
68
68
  </section>
69
69
  </section>