@public-ui/sample-react 3.0.0-rc.1 → 3.0.0-rc.3

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 (259) hide show
  1. package/dist/1055.js +2 -0
  2. package/dist/1068.js +2 -0
  3. package/dist/1219.js +2 -0
  4. package/dist/136.js +2 -0
  5. package/dist/1416.js +2 -0
  6. package/dist/1657.js +2 -0
  7. package/dist/1676.js +2 -0
  8. package/dist/{4288.js → 1714.js} +2 -2
  9. package/dist/1718.js +2 -0
  10. package/dist/1744.js +2 -0
  11. package/dist/1791.js +1 -1
  12. package/dist/2078.js +2 -0
  13. package/dist/2115.js +2 -0
  14. package/dist/2195.js +2 -0
  15. package/dist/3021.js +2 -0
  16. package/dist/3027.js +2 -0
  17. package/dist/3186.js +2 -0
  18. package/dist/364.js +2 -0
  19. package/dist/{2450.js → 3758.js} +2 -2
  20. package/dist/3836.js +2 -0
  21. package/dist/3872.js +2 -0
  22. package/dist/3879.js +2 -0
  23. package/dist/3949.js +2 -0
  24. package/dist/4211.js +2 -0
  25. package/dist/4350.js +2 -0
  26. package/dist/4390.js +2 -0
  27. package/dist/4566.js +2 -0
  28. package/dist/4662.js +2 -0
  29. package/dist/4928.js +2 -0
  30. package/dist/5000.js +2 -0
  31. package/dist/5151.js +2 -0
  32. package/dist/5171.js +2 -0
  33. package/dist/5792.js +2 -0
  34. package/dist/5876.js +2 -0
  35. package/dist/597.js +2 -0
  36. package/dist/6018.js +2 -0
  37. package/dist/6203.js +2 -0
  38. package/dist/6420.js +2 -0
  39. package/dist/6451.js +2 -0
  40. package/dist/6480.js +2 -0
  41. package/dist/6577.js +2 -0
  42. package/dist/6983.js +2 -0
  43. package/dist/7084.js +2 -0
  44. package/dist/7225.js +2 -0
  45. package/dist/7267.js +2 -0
  46. package/dist/7958.js +2 -0
  47. package/dist/7997.js +2 -0
  48. package/dist/8069.js +2 -0
  49. package/dist/8177.js +1 -1
  50. package/dist/8212.js +2 -0
  51. package/dist/8243.js +2 -0
  52. package/dist/8283.js +2 -0
  53. package/dist/8478.js +2 -0
  54. package/dist/851.js +2 -0
  55. package/dist/8573.js +2 -0
  56. package/dist/8728.js +2 -0
  57. package/dist/8808.js +2 -0
  58. package/dist/8999.js +2 -0
  59. package/dist/9068.js +2 -0
  60. package/dist/9130.js +2 -0
  61. package/dist/9162.js +2 -0
  62. package/dist/9219.js +2 -0
  63. package/dist/9423.js +2 -0
  64. package/dist/9430.js +2 -0
  65. package/dist/9929.js +2 -0
  66. package/dist/993.js +2 -0
  67. package/dist/index.html +0 -1
  68. package/dist/main.css +1 -1
  69. package/dist/main.js +1 -1
  70. package/dist/main.js.LICENSE.txt +2 -2
  71. package/package.json +19 -19
  72. package/public/index.html +0 -1
  73. package/src/App.tsx +1 -3
  74. package/src/components/drawer/basic.tsx +2 -20
  75. package/src/components/drawer/controlled.tsx +0 -8
  76. package/src/components/form/error-list.tsx +38 -24
  77. package/src/components/handout/basic.tsx +18 -23
  78. package/src/components/input-color/partials/cases.tsx +4 -2
  79. package/src/components/input-date/partials/cases.tsx +6 -3
  80. package/src/components/input-date/partials/minMax.tsx +3 -3
  81. package/src/components/input-date/partials/variants.tsx +1 -1
  82. package/src/components/input-date/show-hide-msg.tsx +0 -1
  83. package/src/components/input-email/partials/cases.tsx +6 -3
  84. package/src/components/input-file/partials/cases.tsx +6 -3
  85. package/src/components/input-password/partials/cases.tsx +8 -5
  86. package/src/components/input-range/partials/cases.tsx +6 -3
  87. package/src/components/input-text/partials/cases.tsx +1 -1
  88. package/src/components/input-text/smart-button.tsx +14 -1
  89. package/src/components/input-text/text-formatter.tsx +1 -2
  90. package/src/components/link/access-key.tsx +1 -3
  91. package/src/components/nav/basic.tsx +8 -2
  92. package/src/components/nav/horizontal.tsx +2 -2
  93. package/src/components/pagination/basic.tsx +1 -1
  94. package/src/components/select/partials/cases.tsx +16 -1
  95. package/src/components/single-select/partials/cases.tsx +5 -4
  96. package/src/components/single-select/partials/variants.tsx +5 -5
  97. package/src/components/split-button/basic.tsx +2 -2
  98. package/src/components/table/column-alignment.tsx +12 -12
  99. package/src/components/table/complex-headers.tsx +3 -3
  100. package/src/components/table/horizontal-scrollbar.tsx +12 -6
  101. package/src/components/table/multi-sort.tsx +4 -4
  102. package/src/components/table/pagination-position.tsx +23 -5
  103. package/src/components/table/render-cell.tsx +4 -4
  104. package/src/components/table/sort-data.tsx +14 -16
  105. package/src/components/table/stateful-with-selection.tsx +5 -5
  106. package/src/components/table/stateful-with-single-selection.tsx +5 -5
  107. package/src/components/table/stateless-with-selection.tsx +6 -6
  108. package/src/components/table/stateless-with-single-selection.tsx +6 -6
  109. package/src/components/table/with-footer.tsx +3 -3
  110. package/src/components/table/with-pagination.tsx +3 -3
  111. package/src/components/textarea/partials/cases.tsx +9 -4
  112. package/src/react.main.tsx +4 -9
  113. package/src/scenarios/appointment-form/PersonalInformationForm.tsx +4 -1
  114. package/src/scenarios/horizontal-scrollbar-advanced/TableHorizontalScrollbarAdvanced.tsx +2 -2
  115. package/src/shares/routes.ts +0 -6
  116. package/src/shares/theme.ts +4 -8
  117. package/dist/1073.js +0 -2
  118. package/dist/1325.js +0 -2
  119. package/dist/1392.js +0 -2
  120. package/dist/1604.js +0 -2
  121. package/dist/175.js +0 -2
  122. package/dist/178.js +0 -2
  123. package/dist/2220.js +0 -2
  124. package/dist/2444.js +0 -2
  125. package/dist/2671.js +0 -2
  126. package/dist/2986.js +0 -2
  127. package/dist/3030.js +0 -2
  128. package/dist/3270.js +0 -2
  129. package/dist/3340.js +0 -2
  130. package/dist/3392.js +0 -2
  131. package/dist/3529.js +0 -2
  132. package/dist/3756.js +0 -2
  133. package/dist/3960.js +0 -2
  134. package/dist/399.js +0 -2
  135. package/dist/4145.js +0 -2
  136. package/dist/4539.js +0 -2
  137. package/dist/4563.js +0 -2
  138. package/dist/4571.js +0 -2
  139. package/dist/5260.js +0 -2
  140. package/dist/5301.js +0 -2
  141. package/dist/5333.js +0 -2
  142. package/dist/5523.js +0 -2
  143. package/dist/5551.js +0 -2
  144. package/dist/5575.js +0 -2
  145. package/dist/5665.js +0 -2
  146. package/dist/572.js +0 -2
  147. package/dist/5873.js +0 -2
  148. package/dist/5879.js +0 -2
  149. package/dist/5964.js +0 -2
  150. package/dist/6005.js +0 -2
  151. package/dist/618.js +0 -2
  152. package/dist/623.js +0 -2
  153. package/dist/643.js +0 -2
  154. package/dist/6610.js +0 -2
  155. package/dist/6618.js +0 -2
  156. package/dist/6711.js +0 -2
  157. package/dist/6740.js +0 -2
  158. package/dist/6786.js +0 -2
  159. package/dist/685.js +0 -2
  160. package/dist/6950.js +0 -2
  161. package/dist/7055.js +0 -2
  162. package/dist/7106.js +0 -2
  163. package/dist/7141.js +0 -2
  164. package/dist/7146.js +0 -2
  165. package/dist/7287.js +0 -2
  166. package/dist/7599.js +0 -2
  167. package/dist/7648.js +0 -2
  168. package/dist/7668.js +0 -2
  169. package/dist/7855.js +0 -2
  170. package/dist/8165.js +0 -2
  171. package/dist/8306.js +0 -2
  172. package/dist/8543.js +0 -2
  173. package/dist/866.js +0 -2
  174. package/dist/8859.js +0 -2
  175. package/dist/904.js +0 -2
  176. package/dist/9148.js +0 -2
  177. package/dist/9522.js +0 -2
  178. package/dist/9625.js +0 -2
  179. package/dist/971.js +0 -2
  180. package/dist/971.js.LICENSE.txt +0 -3
  181. package/dist/9712.js +0 -2
  182. package/dist/9712.js.LICENSE.txt +0 -3
  183. package/dist/976.js +0 -2
  184. package/dist/976.js.LICENSE.txt +0 -3
  185. package/dist/982.js +0 -2
  186. package/dist/982.js.LICENSE.txt +0 -3
  187. package/dist/986.js +0 -2
  188. package/dist/986.js.LICENSE.txt +0 -3
  189. package/src/components/button-group/basic.tsx +0 -34
  190. package/src/components/button-group/routes.ts +0 -8
  191. package/src/components/indented-text/basic.tsx +0 -37
  192. package/src/components/indented-text/routes.ts +0 -8
  193. package/src/components/link-group/basic.tsx +0 -23
  194. package/src/components/link-group/horizontal.tsx +0 -23
  195. package/src/components/link-group/routes.ts +0 -10
  196. /package/dist/{1073.js.LICENSE.txt → 1055.js.LICENSE.txt} +0 -0
  197. /package/dist/{1325.js.LICENSE.txt → 1068.js.LICENSE.txt} +0 -0
  198. /package/dist/{1392.js.LICENSE.txt → 1219.js.LICENSE.txt} +0 -0
  199. /package/dist/{1604.js.LICENSE.txt → 136.js.LICENSE.txt} +0 -0
  200. /package/dist/{175.js.LICENSE.txt → 1416.js.LICENSE.txt} +0 -0
  201. /package/dist/{178.js.LICENSE.txt → 1657.js.LICENSE.txt} +0 -0
  202. /package/dist/{2220.js.LICENSE.txt → 1676.js.LICENSE.txt} +0 -0
  203. /package/dist/{2444.js.LICENSE.txt → 1714.js.LICENSE.txt} +0 -0
  204. /package/dist/{2450.js.LICENSE.txt → 1718.js.LICENSE.txt} +0 -0
  205. /package/dist/{2671.js.LICENSE.txt → 1744.js.LICENSE.txt} +0 -0
  206. /package/dist/{2986.js.LICENSE.txt → 2078.js.LICENSE.txt} +0 -0
  207. /package/dist/{3030.js.LICENSE.txt → 2115.js.LICENSE.txt} +0 -0
  208. /package/dist/{3270.js.LICENSE.txt → 2195.js.LICENSE.txt} +0 -0
  209. /package/dist/{3340.js.LICENSE.txt → 3021.js.LICENSE.txt} +0 -0
  210. /package/dist/{3392.js.LICENSE.txt → 3027.js.LICENSE.txt} +0 -0
  211. /package/dist/{3529.js.LICENSE.txt → 3186.js.LICENSE.txt} +0 -0
  212. /package/dist/{3756.js.LICENSE.txt → 364.js.LICENSE.txt} +0 -0
  213. /package/dist/{3960.js.LICENSE.txt → 3758.js.LICENSE.txt} +0 -0
  214. /package/dist/{399.js.LICENSE.txt → 3836.js.LICENSE.txt} +0 -0
  215. /package/dist/{4145.js.LICENSE.txt → 3872.js.LICENSE.txt} +0 -0
  216. /package/dist/{4288.js.LICENSE.txt → 3879.js.LICENSE.txt} +0 -0
  217. /package/dist/{4539.js.LICENSE.txt → 3949.js.LICENSE.txt} +0 -0
  218. /package/dist/{4563.js.LICENSE.txt → 4211.js.LICENSE.txt} +0 -0
  219. /package/dist/{4571.js.LICENSE.txt → 4350.js.LICENSE.txt} +0 -0
  220. /package/dist/{5260.js.LICENSE.txt → 4390.js.LICENSE.txt} +0 -0
  221. /package/dist/{5301.js.LICENSE.txt → 4566.js.LICENSE.txt} +0 -0
  222. /package/dist/{5333.js.LICENSE.txt → 4662.js.LICENSE.txt} +0 -0
  223. /package/dist/{5523.js.LICENSE.txt → 4928.js.LICENSE.txt} +0 -0
  224. /package/dist/{5551.js.LICENSE.txt → 5000.js.LICENSE.txt} +0 -0
  225. /package/dist/{5575.js.LICENSE.txt → 5151.js.LICENSE.txt} +0 -0
  226. /package/dist/{5665.js.LICENSE.txt → 5171.js.LICENSE.txt} +0 -0
  227. /package/dist/{572.js.LICENSE.txt → 5792.js.LICENSE.txt} +0 -0
  228. /package/dist/{5873.js.LICENSE.txt → 5876.js.LICENSE.txt} +0 -0
  229. /package/dist/{5879.js.LICENSE.txt → 597.js.LICENSE.txt} +0 -0
  230. /package/dist/{5964.js.LICENSE.txt → 6018.js.LICENSE.txt} +0 -0
  231. /package/dist/{6005.js.LICENSE.txt → 6203.js.LICENSE.txt} +0 -0
  232. /package/dist/{618.js.LICENSE.txt → 6420.js.LICENSE.txt} +0 -0
  233. /package/dist/{623.js.LICENSE.txt → 6451.js.LICENSE.txt} +0 -0
  234. /package/dist/{643.js.LICENSE.txt → 6480.js.LICENSE.txt} +0 -0
  235. /package/dist/{6610.js.LICENSE.txt → 6577.js.LICENSE.txt} +0 -0
  236. /package/dist/{6618.js.LICENSE.txt → 6983.js.LICENSE.txt} +0 -0
  237. /package/dist/{6711.js.LICENSE.txt → 7084.js.LICENSE.txt} +0 -0
  238. /package/dist/{6740.js.LICENSE.txt → 7225.js.LICENSE.txt} +0 -0
  239. /package/dist/{6786.js.LICENSE.txt → 7267.js.LICENSE.txt} +0 -0
  240. /package/dist/{685.js.LICENSE.txt → 7958.js.LICENSE.txt} +0 -0
  241. /package/dist/{6950.js.LICENSE.txt → 7997.js.LICENSE.txt} +0 -0
  242. /package/dist/{7055.js.LICENSE.txt → 8069.js.LICENSE.txt} +0 -0
  243. /package/dist/{7106.js.LICENSE.txt → 8212.js.LICENSE.txt} +0 -0
  244. /package/dist/{7141.js.LICENSE.txt → 8243.js.LICENSE.txt} +0 -0
  245. /package/dist/{7146.js.LICENSE.txt → 8283.js.LICENSE.txt} +0 -0
  246. /package/dist/{7287.js.LICENSE.txt → 8478.js.LICENSE.txt} +0 -0
  247. /package/dist/{7599.js.LICENSE.txt → 851.js.LICENSE.txt} +0 -0
  248. /package/dist/{7648.js.LICENSE.txt → 8573.js.LICENSE.txt} +0 -0
  249. /package/dist/{7668.js.LICENSE.txt → 8728.js.LICENSE.txt} +0 -0
  250. /package/dist/{7855.js.LICENSE.txt → 8808.js.LICENSE.txt} +0 -0
  251. /package/dist/{8165.js.LICENSE.txt → 8999.js.LICENSE.txt} +0 -0
  252. /package/dist/{8306.js.LICENSE.txt → 9068.js.LICENSE.txt} +0 -0
  253. /package/dist/{8543.js.LICENSE.txt → 9130.js.LICENSE.txt} +0 -0
  254. /package/dist/{866.js.LICENSE.txt → 9162.js.LICENSE.txt} +0 -0
  255. /package/dist/{8859.js.LICENSE.txt → 9219.js.LICENSE.txt} +0 -0
  256. /package/dist/{904.js.LICENSE.txt → 9423.js.LICENSE.txt} +0 -0
  257. /package/dist/{9148.js.LICENSE.txt → 9430.js.LICENSE.txt} +0 -0
  258. /package/dist/{9522.js.LICENSE.txt → 9929.js.LICENSE.txt} +0 -0
  259. /package/dist/{9625.js.LICENSE.txt → 993.js.LICENSE.txt} +0 -0
@@ -13,11 +13,11 @@ export const NavHorizontal: FC = () => (
13
13
  <section className="grid gap-8">
14
14
  <section className="grid gap-4">
15
15
  <KolHeading _level={2} _label="Navigation without submenu" />
16
- <KolNav _label="Main navigation" _links={LINKS_WITHOUT_SUBMENU} _orientation="horizontal" />
16
+ <KolNav _label="Navigation without submenu" _links={LINKS_WITHOUT_SUBMENU} _orientation="horizontal" />
17
17
  </section>
18
18
  <section className="grid gap-4">
19
19
  <KolHeading _level={2} _label="Navigation with submenu" />
20
- <KolNav _label="Main navigation" _links={LINKS} _orientation="horizontal" />
20
+ <KolNav _label="Navigation with submenu" _links={LINKS} _orientation="horizontal" />
21
21
  </section>
22
22
  </section>
23
23
  </>
@@ -25,7 +25,7 @@ export const PaginationBasic: FC = () => (
25
25
  _siblingCount={0}
26
26
  _boundaryCount={2}
27
27
  _hasButtons={false}
28
- _label="Test pagination 4"
28
+ _label="Test pagination 5"
29
29
  _on={{}}
30
30
  _pageSizeOptions={[10, 100]}
31
31
  />
@@ -4,7 +4,7 @@ import { KolSelect } from '@public-ui/react';
4
4
 
5
5
  import { ERROR_MSG } from '../../../shares/constants';
6
6
 
7
- import type { Components, SelectOption } from '@public-ui/components';
7
+ import type { Components, Optgroup, SelectOption, StencilUnknown } from '@public-ui/components';
8
8
  import { COUNTRY_OPTIONS } from '../../../shares/country';
9
9
 
10
10
  const SALUTATION_OPTIONS: SelectOption<string>[] = [
@@ -27,6 +27,19 @@ const SALUTATION_OPTIONS: SelectOption<string>[] = [
27
27
  },
28
28
  ];
29
29
 
30
+ type GroupedOptionsType = Record<string, Optgroup<StencilUnknown>>;
31
+
32
+ const groupedOptions: GroupedOptionsType = COUNTRY_OPTIONS.reduce((acc, option) => {
33
+ const firstLetter = (option.label as string).charAt(0).toUpperCase();
34
+ if (!acc[firstLetter]) {
35
+ acc[firstLetter] = { label: firstLetter, options: [] };
36
+ }
37
+ acc[firstLetter].options.push({ label: option.label, value: option.label });
38
+ return acc;
39
+ }, {} as GroupedOptionsType);
40
+
41
+ const groupedOptionsArray = Object.values(groupedOptions);
42
+
30
43
  export const SelectCases = forwardRef<HTMLKolSelectElement, Components.KolSelect>(function SelectCases(props, ref) {
31
44
  return (
32
45
  <div className="grid gap-4">
@@ -59,6 +72,8 @@ export const SelectCases = forwardRef<HTMLKolSelectElement, Components.KolSelect
59
72
  />
60
73
  <KolSelect {...props} _options={SALUTATION_OPTIONS} _label="With access key" _accessKey="c" />
61
74
  <KolSelect {...props} _options={SALUTATION_OPTIONS} _label="With short key" _shortKey="s" />
75
+ <KolSelect {...props} _options={groupedOptionsArray} _label="With grouped by first letter" _value={['Albanien']} />
76
+ <KolSelect {...props} _options={groupedOptionsArray} _label="With grouped by first letter (multiple)" _multiple _value={['Albanien']} />
62
77
  </div>
63
78
  );
64
79
  });
@@ -1,13 +1,14 @@
1
- import React, { forwardRef } from 'react';
1
+ import React from 'react';
2
2
 
3
3
  import { KolSingleSelect } from '@public-ui/react';
4
4
 
5
5
  import { ERROR_MSG, HINT_MSG } from '../../../shares/constants';
6
6
 
7
- import type { Components, Option, StencilUnknown } from '@public-ui/components';
7
+ import type { Option, StencilUnknown } from '@public-ui/components';
8
8
  import { COUNTRY_OPTIONS } from '../../../shares/country';
9
+ import type { Components } from '@public-ui/components';
9
10
 
10
- export const SingleSelectCases = forwardRef<HTMLKolSingleSelectElement, Components.KolSingleSelect>(function SingleSelectCases(props) {
11
+ export const SingleSelectCases = (props: Components.KolSingleSelect) => {
11
12
  return (
12
13
  <div className="grid gap-4">
13
14
  <KolSingleSelect
@@ -38,4 +39,4 @@ export const SingleSelectCases = forwardRef<HTMLKolSingleSelectElement, Componen
38
39
  <KolSingleSelect {...props} _label="With short key" _options={COUNTRY_OPTIONS as Option<StencilUnknown>[]} _value={'de'} _shortKey="s" />
39
40
  </div>
40
41
  );
41
- });
42
+ };
@@ -1,9 +1,9 @@
1
- import React, { forwardRef } from 'react';
1
+ import React from 'react';
2
2
 
3
3
  import { SingleSelectCases } from './cases';
4
-
5
4
  import type { Components } from '@public-ui/components';
6
- export const SingleSelectVariants = forwardRef<HTMLKolSingleSelectElement, Components.KolSingleSelect>(function SingleSelectVariant(props, ref) {
5
+
6
+ export const SingleSelectVariants = (props: Components.KolSingleSelect) => {
7
7
  return (
8
8
  <div className="grid md:grid-cols-2 gap-4">
9
9
  <fieldset>
@@ -12,8 +12,8 @@ export const SingleSelectVariants = forwardRef<HTMLKolSingleSelectElement, Compo
12
12
  </fieldset>
13
13
  <fieldset>
14
14
  <legend>Text (hideLabel)</legend>
15
- <SingleSelectCases ref={ref} {...props} _hideLabel />
15
+ <SingleSelectCases {...props} _hideLabel />
16
16
  </fieldset>
17
17
  </div>
18
18
  );
19
- });
19
+ };
@@ -27,10 +27,10 @@ export const SplitButtonBasic: FC = () => {
27
27
 
28
28
  <div className="flex gap-4">
29
29
  <KolSplitButton _label="Only the arrow opens" _on={{ onClick: handleButtonClick }}>
30
- Dropdown-Inhalt
30
+ Dropdown contents
31
31
  </KolSplitButton>
32
32
  <KolSplitButton _label="Button without visible label" _hideLabel _icons="codicon codicon-git-pull-request">
33
- Dropdown-Inhalt
33
+ Dropdown contents
34
34
  </KolSplitButton>
35
35
  </div>
36
36
  </>
@@ -1,22 +1,22 @@
1
1
  import type { FC } from 'react';
2
2
  import React from 'react';
3
3
 
4
- import { KolHeading, KolTable } from '@public-ui/react';
4
+ import { KolHeading, KolTableStateful } from '@public-ui/react';
5
5
 
6
6
  import { SampleDescription } from '../SampleDescription';
7
7
 
8
8
  const DATA = [{ left: 'Left Example', center: 'Center Example', right: 'Right Example' }];
9
- const genericNonSorter = <T,>(data: T): T => data;
9
+ const genericNonSorter = () => 0;
10
10
 
11
11
  export const TableColumnAlignment: FC = () => (
12
12
  <>
13
13
  <SampleDescription>
14
- <p>This sample shows KolTable with columns headers and data in different text alignments.</p>
14
+ <p>This sample shows KolTableStateful with columns headers and data in different text alignments.</p>
15
15
  </SampleDescription>
16
16
 
17
17
  <section className="w-full flex flex-col">
18
18
  <KolHeading _label="Simple table" _level={3}></KolHeading>
19
- <KolTable
19
+ <KolTableStateful
20
20
  _label="Table for demonstration purposes with different text align properties"
21
21
  _headers={{
22
22
  horizontal: [
@@ -33,14 +33,14 @@ export const TableColumnAlignment: FC = () => (
33
33
  />
34
34
 
35
35
  <KolHeading _label="Table with sortable columns" _level={3} className="block mt-6"></KolHeading>
36
- <KolTable
36
+ <KolTableStateful
37
37
  _label="Table for demonstration purposes with sortable columns"
38
38
  _headers={{
39
39
  horizontal: [
40
40
  [
41
- { label: 'left', key: 'left', textAlign: 'left', sort: genericNonSorter },
42
- { label: 'center', key: 'center', textAlign: 'center', sort: genericNonSorter },
43
- { label: 'right', key: 'right', textAlign: 'right', sort: genericNonSorter },
41
+ { label: 'left', key: 'left', textAlign: 'left', compareFn: genericNonSorter },
42
+ { label: 'center', key: 'center', textAlign: 'center', compareFn: genericNonSorter },
43
+ { label: 'right', key: 'right', textAlign: 'right', compareFn: genericNonSorter },
44
44
  ],
45
45
  ],
46
46
  }}
@@ -50,13 +50,13 @@ export const TableColumnAlignment: FC = () => (
50
50
  />
51
51
 
52
52
  <KolHeading _label="Table some sortable columns" _level={3} className="block mt-6"></KolHeading>
53
- <KolTable
53
+ <KolTableStateful
54
54
  _label="Table for demonstration purposes with some but not all columns sortable"
55
55
  _headers={{
56
56
  horizontal: [
57
57
  [
58
- { label: 'left', key: 'left', textAlign: 'left', sort: genericNonSorter },
59
- { label: 'center', key: 'center', textAlign: 'center', sort: genericNonSorter },
58
+ { label: 'left', key: 'left', textAlign: 'left', compareFn: genericNonSorter },
59
+ { label: 'center', key: 'center', textAlign: 'center', compareFn: genericNonSorter },
60
60
  { label: 'right', key: 'right', textAlign: 'right' },
61
61
  ],
62
62
  ],
@@ -67,7 +67,7 @@ export const TableColumnAlignment: FC = () => (
67
67
  />
68
68
 
69
69
  <KolHeading _label="Table with vertical heading" _level={3} className="block mt-6"></KolHeading>
70
- <KolTable
70
+ <KolTableStateful
71
71
  _label="Table for demonstration purposes with vertical heading"
72
72
  _headers={{
73
73
  horizontal: [
@@ -1,16 +1,16 @@
1
1
  import type { FC } from 'react';
2
2
  import React from 'react';
3
- import { KolTable } from '@public-ui/react';
3
+ import { KolTableStateful } from '@public-ui/react';
4
4
  import { SampleDescription } from '../SampleDescription';
5
5
 
6
6
  export const TableComplexHeaders: FC = () => (
7
7
  <>
8
8
  <SampleDescription>
9
- <p>This sample shows KolTable using vertical and horizontal headers, applying colspan and rowspan.</p>
9
+ <p>This sample shows KolTableStateful using vertical and horizontal headers, applying colspan and rowspan.</p>
10
10
  </SampleDescription>
11
11
 
12
12
  <section className="w-full flex flex-col">
13
- <KolTable
13
+ <KolTableStateful
14
14
  _label="Business hours"
15
15
  _data={[
16
16
  {
@@ -1,7 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import React, { useState } from 'react';
3
3
 
4
- import { KolHeading, KolInputCheckbox, KolTable } from '@public-ui/react';
4
+ import { KolHeading, KolInputCheckbox, KolTableStateful } from '@public-ui/react';
5
5
 
6
6
  import { SampleDescription } from '../SampleDescription';
7
7
 
@@ -26,15 +26,15 @@ export const TableHorizontalScrollbar: FC = () => {
26
26
  <>
27
27
  <SampleDescription>
28
28
  <p>
29
- This sample shows KolTable with and without horizontal scrollbars. When a scrollbar is present, it should be possible to focus the table container and
30
- to scroll it using arrow keys.
29
+ This sample shows KolTableStateful with and without horizontal scrollbars. When a scrollbar is present, it should be possible to focus the table
30
+ container and to scroll it using arrow keys.
31
31
  </p>
32
32
  </SampleDescription>
33
33
 
34
34
  <section className="w-full flex flex-col gap-4">
35
35
  <KolHeading _label="Table with scrollbar" _level={2} />
36
36
 
37
- <KolTable
37
+ <KolTableStateful
38
38
  _label="Table for demonstration purposes with horizontal scrollbar."
39
39
  _minWidth={hasWidthRestriction ? '600px' : 'auto'}
40
40
  _headers={HEADERS}
@@ -45,7 +45,7 @@ export const TableHorizontalScrollbar: FC = () => {
45
45
 
46
46
  <KolHeading _label="Empty Table with scrollbar" _level={3} />
47
47
 
48
- <KolTable
48
+ <KolTableStateful
49
49
  _label="Table for demonstration purposes with horizontal scrollbar with auto minWidth."
50
50
  _minWidth={hasWidthRestriction ? '600px' : 'auto'}
51
51
  _headers={HEADERS}
@@ -70,7 +70,13 @@ export const TableHorizontalScrollbar: FC = () => {
70
70
  <i>Scrollbar appears on very small viewport sizes</i>
71
71
  </p>
72
72
 
73
- <KolTable _label="Table for demonstration purposes without horizontal scrollbar" _minWidth="600px" _headers={HEADERS} _data={DATA} className="block" />
73
+ <KolTableStateful
74
+ _label="Table for demonstration purposes without horizontal scrollbar"
75
+ _minWidth="600px"
76
+ _headers={HEADERS}
77
+ _data={DATA}
78
+ className="block"
79
+ />
74
80
  </section>
75
81
  </>
76
82
  );
@@ -1,7 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import React, { useState } from 'react';
3
3
 
4
- import { KolHeading, KolInputCheckbox, KolTable } from '@public-ui/react';
4
+ import { KolHeading, KolInputCheckbox, KolTableStateful } from '@public-ui/react';
5
5
  import type { KoliBriTableHeaders, KoliBriTableDataType } from '@public-ui/components';
6
6
  import type { Data } from './test-data';
7
7
  import { DATA } from './test-data';
@@ -74,7 +74,7 @@ export const MultiSortTable: FC = () => {
74
74
  return (
75
75
  <>
76
76
  <SampleDescription>
77
- <p>This sample shows KolTable with multi-sort functionality, allowing sorting by both &quot;order&quot; and &quot;date&quot; columns.</p>
77
+ <p>This sample shows KolTableStateful with multi-sort functionality, allowing sorting by both &quot;order&quot; and &quot;date&quot; columns.</p>
78
78
  </SampleDescription>
79
79
 
80
80
  <section className="w-full grid gap-4">
@@ -86,7 +86,7 @@ export const MultiSortTable: FC = () => {
86
86
  _variant="switch"
87
87
  _on={{ onChange: (_, value) => setAllowMultiSortVertical(Boolean(value)) }}
88
88
  ></KolInputCheckbox>
89
- <KolTable
89
+ <KolTableStateful
90
90
  _label="Sort Table with Order and Date"
91
91
  _data={DATA.slice(0, 10)}
92
92
  _headers={HEADERS_VERTICAL}
@@ -102,7 +102,7 @@ export const MultiSortTable: FC = () => {
102
102
  _variant="switch"
103
103
  _on={{ onChange: (_, value) => setAllowMultiSortHorizontal(Boolean(value)) }}
104
104
  ></KolInputCheckbox>
105
- <KolTable
105
+ <KolTableStateful
106
106
  _label="Sort Table with Order and Date"
107
107
  _data={DATA}
108
108
  _headers={HEADERS_HORIZONTAL}
@@ -1,7 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import React from 'react';
3
3
 
4
- import { KolHeading, KolTable } from '@public-ui/react';
4
+ import { KolHeading, KolTableStateful } from '@public-ui/react';
5
5
 
6
6
  import { SampleDescription } from '../SampleDescription';
7
7
  import { DATE_FORMATTER } from './formatter';
@@ -23,21 +23,39 @@ const PAGINATION: KoliBriTablePaginationProps = { _page: 2 };
23
23
  export const PaginationPosition: FC = () => (
24
24
  <div className="w-full grid gap-14">
25
25
  <SampleDescription>
26
- <p>This sample shows KolTable with different pagination positions.</p>
26
+ <p>This sample shows KolTableStateful with different pagination positions.</p>
27
27
  </SampleDescription>
28
28
 
29
29
  <section className="w-full flex flex-col gap-14">
30
30
  <section className="grid gap-4">
31
31
  <KolHeading _level={2} _label="Table with pagination at the bottom."></KolHeading>
32
- <KolTable _label="Tabellenbeschreibung" _data={DATA} _headers={HEADERS} _pagination={PAGINATION} _paginationPosition="bottom"></KolTable>
32
+ <KolTableStateful
33
+ _label="Sample table with pagination at the bottom"
34
+ _data={DATA}
35
+ _headers={HEADERS}
36
+ _pagination={PAGINATION}
37
+ _paginationPosition="bottom"
38
+ ></KolTableStateful>
33
39
  </section>
34
40
  <section className="grid gap-4">
35
41
  <KolHeading _level={2} _label="Table with pagination at the top."></KolHeading>
36
- <KolTable _label="Tabellenbeschreibung" _data={DATA} _headers={HEADERS} _pagination={PAGINATION} _paginationPosition="top"></KolTable>
42
+ <KolTableStateful
43
+ _label="Sample table with pagination at the top"
44
+ _data={DATA}
45
+ _headers={HEADERS}
46
+ _pagination={PAGINATION}
47
+ _paginationPosition="top"
48
+ ></KolTableStateful>
37
49
  </section>
38
50
  <section className="grid gap-4">
39
51
  <KolHeading _level={2} _label="Table with pagination at both top and bottom."></KolHeading>
40
- <KolTable _label="Tabellenbeschreibung" _data={DATA} _headers={HEADERS} _pagination={PAGINATION} _paginationPosition="both"></KolTable>
52
+ <KolTableStateful
53
+ _label="Sample table with pagination at both top and bottom"
54
+ _data={DATA}
55
+ _headers={HEADERS}
56
+ _pagination={PAGINATION}
57
+ _paginationPosition="both"
58
+ ></KolTableStateful>
41
59
  </section>
42
60
  </section>
43
61
  </div>
@@ -1,7 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import React from 'react';
3
3
 
4
- import { createReactRenderElement, KolButton, KolInputText, KolTable } from '@public-ui/react';
4
+ import { createReactRenderElement, KolButton, KolInputText, KolTableStateful } from '@public-ui/react';
5
5
 
6
6
  import { getRoot } from '../../shares/react-roots';
7
7
  import { SampleDescription } from '../SampleDescription';
@@ -80,7 +80,7 @@ const HEADERS: KoliBriTableHeaders = {
80
80
  render: (el, cell) => {
81
81
  el.innerHTML = `<strong>${DATE_FORMATTER.format(cell.label as unknown as Date)}</strong>`;
82
82
  },
83
- sort: (data) => data.sort((data0, data1) => (data0 as Data).date.getTime() - (data1 as Data).date.getTime()),
83
+ compareFn: (data0, data1) => (data0 as Data).date.getTime() - (data1 as Data).date.getTime(),
84
84
  },
85
85
  {
86
86
  label: 'Action (react)',
@@ -112,9 +112,9 @@ const HEADERS: KoliBriTableHeaders = {
112
112
  export const TableRenderCell: FC = () => (
113
113
  <>
114
114
  <SampleDescription>
115
- <p>This sample shows KolTable using React render functions for the cell contents.</p>
115
+ <p>This sample shows KolTableStateful using React render functions for the cell contents.</p>
116
116
  </SampleDescription>
117
117
 
118
- <KolTable _label="Sort by date column" _data={DATA} _headers={HEADERS} className="w-full" />
118
+ <KolTableStateful _label="Sort by date column" _data={DATA} _headers={HEADERS} className="w-full" />
119
119
  </>
120
120
  );
@@ -1,7 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import React from 'react';
3
3
 
4
- import { KolHeading, KolTable } from '@public-ui/react';
4
+ import { KolHeading, KolTableStateful } from '@public-ui/react';
5
5
  import type { KoliBriTableHeaders } from '@public-ui/components';
6
6
  import type { Data } from './test-data';
7
7
  import { DATA } from './test-data';
@@ -22,12 +22,11 @@ const HEADERS_HORIZONTAL: KoliBriTableHeaders = {
22
22
  key: 'date',
23
23
  textAlign: 'center',
24
24
  render: (_el, _cell, tupel) => DATE_FORMATTER.format((tupel as Data).date),
25
- sort: (data) =>
26
- data.sort((data0, data1) => {
27
- if ((data0 as Data).date < (data1 as Data).date) return -1;
28
- else if ((data1 as Data).date < (data0 as Data).date) return 1;
29
- else return 0;
30
- }),
25
+ compareFn: (data0, data1) => {
26
+ if ((data0 as Data).date < (data1 as Data).date) return -1;
27
+ else if ((data1 as Data).date < (data0 as Data).date) return 1;
28
+ else return 0;
29
+ },
31
30
  },
32
31
  ],
33
32
  ],
@@ -42,12 +41,11 @@ const HEADERS_VERTICAL: KoliBriTableHeaders = {
42
41
  key: 'date',
43
42
  textAlign: 'center',
44
43
  render: (_el, _cell, tupel) => DATE_FORMATTER.format((tupel as Data).date),
45
- sort: (data) =>
46
- data.sort((data0, data1) => {
47
- if ((data0 as Data).date < (data1 as Data).date) return -1;
48
- else if ((data1 as Data).date < (data0 as Data).date) return 1;
49
- else return 0;
50
- }),
44
+ compareFn: (data0, data1) => {
45
+ if ((data0 as Data).date < (data1 as Data).date) return -1;
46
+ else if ((data1 as Data).date < (data0 as Data).date) return 1;
47
+ else return 0;
48
+ },
51
49
  },
52
50
  ],
53
51
  ],
@@ -56,17 +54,17 @@ const HEADERS_VERTICAL: KoliBriTableHeaders = {
56
54
  export const TableSortData: FC = () => (
57
55
  <>
58
56
  <SampleDescription>
59
- <p>This sample shows KolTable with sortable columns. The sort-order can be changed by clicking the &quot;date&quot; header column.</p>
57
+ <p>This sample shows KolTableStateful with sortable columns. The sort-order can be changed by clicking the &quot;date&quot; header column.</p>
60
58
  </SampleDescription>
61
59
 
62
60
  <section className="w-full grid gap-4">
63
61
  <section className="grid gap-4">
64
62
  <KolHeading _level={2} _label="Vertical" />
65
- <KolTable _label="Sort a date column" _data={DATA.slice(0, 10)} _headers={HEADERS_VERTICAL} className="block" />
63
+ <KolTableStateful _label="Sort a date column" _data={DATA.slice(0, 10)} _headers={HEADERS_VERTICAL} className="block" />
66
64
  </section>
67
65
  <section className="grid gap-4">
68
66
  <KolHeading _level={2} _label="Horizontal" />
69
- <KolTable _label="Sort a date column" _data={DATA} _headers={HEADERS_HORIZONTAL} className="block" />
67
+ <KolTableStateful _label="Sort a date column" _data={DATA} _headers={HEADERS_HORIZONTAL} className="block" />
70
68
  </section>
71
69
  </section>
72
70
  </>
@@ -1,10 +1,10 @@
1
1
  import type { FC } from 'react';
2
2
  import React, { useEffect, useRef, useState } from 'react';
3
- import { KolButton, KolTableStateful, createReactRenderElement } from '@public-ui/react';
3
+ import { createReactRenderElement, KolButton, KolTableStateful } from '@public-ui/react';
4
4
  import { SampleDescription } from '../SampleDescription';
5
- import type { KoliBriTableDataType, KoliBriTableSelection } from '@public-ui/components';
5
+ import type { KoliBriTableCell, KoliBriTableDataType, KoliBriTableSelection } from '@public-ui/components';
6
+ import { KolEvent } from '@public-ui/components';
6
7
  import { getRoot } from '../../shares/react-roots';
7
- import type { KoliBriTableCell } from '@public-ui/components';
8
8
  import { useToasterService } from '../../hooks/useToasterService';
9
9
 
10
10
  const DATA = [
@@ -48,11 +48,11 @@ export const TableStatefulWithSelection: FC = () => {
48
48
 
49
49
  useEffect(() => {
50
50
  // @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
51
- kolTableStatefulRef.current?.addEventListener('kol-selection-change', handleSelectionChangeEvent);
51
+ kolTableStatefulRef.current?.addEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
52
52
 
53
53
  return () => {
54
54
  // @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
55
- kolTableStatefulRef.current?.removeEventListener('kol-selection-change', handleSelectionChangeEvent);
55
+ kolTableStatefulRef.current?.removeEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
56
56
  };
57
57
  }, [kolTableStatefulRef]);
58
58
 
@@ -1,10 +1,10 @@
1
1
  import type { FC } from 'react';
2
2
  import React, { useEffect, useRef, useState } from 'react';
3
- import { KolButton, KolTableStateful, createReactRenderElement } from '@public-ui/react';
3
+ import { createReactRenderElement, KolButton, KolTableStateful } from '@public-ui/react';
4
4
  import { SampleDescription } from '../SampleDescription';
5
- import type { KoliBriTableDataType, KoliBriTableSelection } from '@public-ui/components';
5
+ import type { KoliBriTableCell, KoliBriTableDataType, KoliBriTableSelection } from '@public-ui/components';
6
+ import { KolEvent } from '@public-ui/components';
6
7
  import { getRoot } from '../../shares/react-roots';
7
- import type { KoliBriTableCell } from '@public-ui/components';
8
8
  import { useToasterService } from '../../hooks/useToasterService';
9
9
 
10
10
  const DATA = [
@@ -50,11 +50,11 @@ export const TableStatefulWithSingleSelection: FC = () => {
50
50
 
51
51
  useEffect(() => {
52
52
  // @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
53
- kolTableStatefulRef.current?.addEventListener('kol-selection-change', handleSelectionChangeEvent);
53
+ kolTableStatefulRef.current?.addEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
54
54
 
55
55
  return () => {
56
56
  // @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
57
- kolTableStatefulRef.current?.removeEventListener('kol-selection-change', handleSelectionChangeEvent);
57
+ kolTableStatefulRef.current?.removeEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
58
58
  };
59
59
  }, [kolTableStatefulRef]);
60
60
 
@@ -1,10 +1,10 @@
1
1
  import type { FC } from 'react';
2
- import React, { useEffect, useState, useRef } from 'react';
3
- import { KolButton, KolTableStateless, createReactRenderElement } from '@public-ui/react';
2
+ import React, { useEffect, useRef, useState } from 'react';
3
+ import { createReactRenderElement, KolButton, KolTableStateless } from '@public-ui/react';
4
4
  import { SampleDescription } from '../SampleDescription';
5
- import type { KoliBriTableSelection } from '@public-ui/components';
5
+ import type { KoliBriTableCell, KoliBriTableSelection } from '@public-ui/components';
6
+ import { KolEvent } from '@public-ui/components';
6
7
  import { getRoot } from '../../shares/react-roots';
7
- import type { KoliBriTableCell } from '@public-ui/components';
8
8
  import { useToasterService } from '../../hooks/useToasterService';
9
9
 
10
10
  const DATA = [
@@ -44,11 +44,11 @@ export const TableStatelessWithSelection: FC = () => {
44
44
 
45
45
  useEffect(() => {
46
46
  // @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
47
- kolTableStatelessRef.current?.addEventListener('kol-selection-change', handleSelectionChangeEvent);
47
+ kolTableStatelessRef.current?.addEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
48
48
 
49
49
  return () => {
50
50
  // @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
51
- kolTableStatelessRef.current?.removeEventListener('kol-selection-change', handleSelectionChangeEvent);
51
+ kolTableStatelessRef.current?.removeEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
52
52
  };
53
53
  }, [kolTableStatelessRef]);
54
54
 
@@ -1,10 +1,10 @@
1
1
  import type { FC } from 'react';
2
- import React, { useEffect, useState, useRef } from 'react';
3
- import { KolButton, KolTableStateless, createReactRenderElement } from '@public-ui/react';
2
+ import React, { useEffect, useRef, useState } from 'react';
3
+ import { createReactRenderElement, KolButton, KolTableStateless } from '@public-ui/react';
4
4
  import { SampleDescription } from '../SampleDescription';
5
- import type { KoliBriTableSelection } from '@public-ui/components';
5
+ import type { KoliBriTableCell, KoliBriTableSelection } from '@public-ui/components';
6
+ import { KolEvent } from '@public-ui/components';
6
7
  import { getRoot } from '../../shares/react-roots';
7
- import type { KoliBriTableCell } from '@public-ui/components';
8
8
  import { useToasterService } from '../../hooks/useToasterService';
9
9
 
10
10
  const DATA = [
@@ -45,11 +45,11 @@ export const TableStatelessWithSingleSelection: FC = () => {
45
45
 
46
46
  useEffect(() => {
47
47
  // @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
48
- kolTableStatelessRef.current?.addEventListener('kol-selection-change', handleSelectionChangeEvent);
48
+ kolTableStatelessRef.current?.addEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
49
49
 
50
50
  return () => {
51
51
  // @ts-expect-error https://github.com/Microsoft/TypeScript/issues/28357
52
- kolTableStatelessRef.current?.removeEventListener('kol-selection-change', handleSelectionChangeEvent);
52
+ kolTableStatelessRef.current?.removeEventListener(KolEvent.selectionChange, handleSelectionChangeEvent);
53
53
  };
54
54
  }, [kolTableStatelessRef]);
55
55
 
@@ -1,15 +1,15 @@
1
1
  import type { FC } from 'react';
2
2
  import React from 'react';
3
- import { KolTable } from '@public-ui/react';
3
+ import { KolTableStateful } from '@public-ui/react';
4
4
  import { SampleDescription } from '../SampleDescription';
5
5
 
6
6
  export const TableWithFooter: FC = () => (
7
7
  <>
8
8
  <SampleDescription>
9
- <p>This sample shows KolTable with footer data.</p>
9
+ <p>This sample shows KolTableStateful with footer data.</p>
10
10
  </SampleDescription>
11
11
 
12
- <KolTable
12
+ <KolTableStateful
13
13
  className="w-full"
14
14
  _label="Business hours"
15
15
  _headers={{
@@ -1,7 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import React from 'react';
3
3
 
4
- import { KolTable } from '@public-ui/react';
4
+ import { KolTableStateful } from '@public-ui/react';
5
5
 
6
6
  import { DATE_FORMATTER } from './formatter';
7
7
  import { SampleDescription } from '../SampleDescription';
@@ -23,10 +23,10 @@ const PAGINATION: KoliBriTablePaginationProps = { _page: 2 };
23
23
  export const TableWithPagination: FC = () => (
24
24
  <>
25
25
  <SampleDescription>
26
- <p>This sample shows how KolTable can be navigated using a pagination.</p>
26
+ <p>This sample shows how KolTableStateful can be navigated using a pagination.</p>
27
27
  </SampleDescription>
28
28
  <div className="w-full">
29
- <KolTable _label="Tabellenbeschreibung" _data={DATA} _headers={HEADERS} _pagination={PAGINATION}></KolTable>
29
+ <KolTableStateful _label="Table description" _data={DATA} _headers={HEADERS} _pagination={PAGINATION}></KolTableStateful>
30
30
  </div>
31
31
  </>
32
32
  );
@@ -1,14 +1,19 @@
1
1
  import React, { forwardRef } from 'react';
2
-
3
2
  import { KolTextarea } from '@public-ui/react';
3
+ import type { Components } from '@public-ui/components';
4
4
 
5
- import { ERROR_MSG } from '../../../shares/constants';
5
+ import { ERROR_MSG, HINT_MSG } from '../../../shares/constants';
6
6
 
7
- import type { Components } from '@public-ui/components';
8
7
  export const TextareaCases = forwardRef<HTMLKolTextareaElement, Components.KolTextarea>(function TextareaCases(props, ref) {
9
8
  return (
10
9
  <div className="grid gap-4">
11
- <KolTextarea {...props} _msg={{ _type: 'error', _description: ERROR_MSG }} _label="Text" _touched />
10
+ <div className="black-background">
11
+ <KolTextarea {...props} ref={ref} _placeholder="Placeholder" _label="Text" />
12
+ </div>
13
+ <KolTextarea {...props} _placeholder="Placeholder" _required _msg={{ _type: 'error', _description: ERROR_MSG }} _label="Text" _touched _hint={HINT_MSG} />
14
+ <KolTextarea {...props} _placeholder="Placeholder" _label="Text" _msg={{ _type: 'info', _description: 'Just a hint' }} />
15
+ <KolTextarea {...props} _placeholder="Placeholder" _label="Text" _msg={{ _type: 'warning', _description: 'Small warning' }} />
16
+ <KolTextarea {...props} _placeholder="Placeholder" _label="Text" _msg={{ _type: 'success', _description: 'Success message' }} />
12
17
  <KolTextarea {...props} ref={ref} _accessKey="T" _label="Text (3 rows)" _rows={3} />
13
18
  <KolTextarea {...props} ref={ref} _label="Text (placeholder)" _rows={3} _placeholder="Placeholder" />
14
19
  <KolTextarea {...props} ref={ref} _label="Text (disabled & placeholder)" _rows={3} _placeholder="Placeholder" _disabled />