@public-ui/sample-react 1.7.0-rc.16 → 1.7.0-rc.17

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 (84) hide show
  1. package/dist/1474.js +1 -1
  2. package/dist/{3166.js → 1586.js} +2 -2
  3. package/dist/183.js +1 -1
  4. package/dist/2337.js +1 -1
  5. package/dist/2412.js +1 -1
  6. package/dist/3303.js +1 -1
  7. package/dist/3325.js +1 -1
  8. package/dist/3459.js +1 -1
  9. package/dist/3537.js +1 -1
  10. package/dist/4021.js +1 -1
  11. package/dist/4291.js +1 -1
  12. package/dist/4323.js +1 -1
  13. package/dist/4355.js +1 -1
  14. package/dist/4477.js +1 -1
  15. package/dist/4564.js +1 -1
  16. package/dist/4891.js +1 -1
  17. package/dist/5183.js +1 -1
  18. package/dist/5369.js +1 -1
  19. package/dist/5390.js +1 -1
  20. package/dist/540.js +1 -1
  21. package/dist/{1692.js → 5653.js} +2 -2
  22. package/dist/5866.js +1 -1
  23. package/dist/6012.js +1 -1
  24. package/dist/6068.js +1 -1
  25. package/dist/6116.js +2 -0
  26. package/dist/6210.js +1 -1
  27. package/dist/6320.js +1 -1
  28. package/dist/{2461.js → 6365.js} +2 -2
  29. package/dist/6558.js +1 -1
  30. package/dist/6655.js +1 -1
  31. package/dist/6908.js +1 -1
  32. package/dist/7029.js +1 -1
  33. package/dist/7255.js +1 -1
  34. package/dist/7447.js +1 -1
  35. package/dist/7715.js +1 -1
  36. package/dist/7722.js +1 -1
  37. package/dist/7801.js +1 -1
  38. package/dist/7955.js +1 -1
  39. package/dist/7995.js +1 -1
  40. package/dist/8065.js +1 -1
  41. package/dist/8099.js +1 -1
  42. package/dist/8111.js +1 -1
  43. package/dist/8255.js +1 -1
  44. package/dist/8291.js +1 -1
  45. package/dist/8709.js +1 -1
  46. package/dist/8761.js +1 -1
  47. package/dist/9106.js +1 -1
  48. package/dist/9734.js +1 -1
  49. package/dist/9747.js +1 -1
  50. package/dist/9792.js +1 -1
  51. package/dist/9963.js +1 -1
  52. package/dist/main.css +1 -1
  53. package/dist/main.js +2 -2
  54. package/package.json +9 -9
  55. package/src/components/FocusInput.tsx +7 -43
  56. package/src/components/FormWrap.tsx +21 -0
  57. package/src/components/button/basic.tsx +4 -28
  58. package/src/components/button/partials/cases.tsx +16 -0
  59. package/src/components/button/partials/variants.tsx +27 -0
  60. package/src/components/heading/badged.tsx +6 -6
  61. package/src/components/input-checkbox/basic.tsx +2 -2
  62. package/src/components/input-checkbox/button.tsx +2 -9
  63. package/src/components/input-checkbox/switch.tsx +2 -9
  64. package/src/components/input-color/basic.tsx +2 -2
  65. package/src/components/input-date/basic.tsx +2 -2
  66. package/src/components/input-email/basic.tsx +2 -2
  67. package/src/components/input-file/basic.tsx +2 -2
  68. package/src/components/input-number/basic.tsx +2 -2
  69. package/src/components/input-password/basic.tsx +2 -2
  70. package/src/components/input-radio/basic.tsx +2 -2
  71. package/src/components/input-range/basic.tsx +2 -2
  72. package/src/components/input-text/basic.tsx +2 -2
  73. package/src/components/pagination/basic.tsx +4 -3
  74. package/src/components/select/basic.tsx +2 -2
  75. package/src/components/table/routes.ts +2 -0
  76. package/src/components/table/with-pagination.tsx +22 -0
  77. package/src/components/textarea/basic.tsx +2 -2
  78. package/src/components/types.tsx +42 -0
  79. package/src/style.scss +10 -5
  80. package/dist/9021.js +0 -2
  81. /package/dist/{1692.js.LICENSE.txt → 1586.js.LICENSE.txt} +0 -0
  82. /package/dist/{2461.js.LICENSE.txt → 5653.js.LICENSE.txt} +0 -0
  83. /package/dist/{3166.js.LICENSE.txt → 6116.js.LICENSE.txt} +0 -0
  84. /package/dist/{9021.js.LICENSE.txt → 6365.js.LICENSE.txt} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/sample-react",
3
- "version": "1.7.0-rc.16",
3
+ "version": "1.7.0-rc.17",
4
4
  "description": "This app contains samples for the KoliBri/Public UI",
5
5
  "license": "EUPL-1.2",
6
6
  "dependencies": {
@@ -8,14 +8,14 @@
8
8
  "@leanup/stack-react": "1.3.48",
9
9
  "@leanup/stack-webpack": "1.3.48",
10
10
  "@public-oss/kolibri-themes": "0.0.3",
11
- "@public-ui/components": "1.7.0-rc.16",
12
- "@public-ui/react": "1.7.0-rc.16",
13
- "@public-ui/themes": "1.7.0-rc.16",
14
- "@types/node": "20.6.5",
15
- "@types/react": "18.2.22",
16
- "@types/react-dom": "18.2.7",
17
- "@unocss/preset-uno": "0.56.2",
18
- "@unocss/webpack": "0.56.2",
11
+ "@public-ui/components": "1.7.0-rc.17",
12
+ "@public-ui/react": "1.7.0-rc.17",
13
+ "@public-ui/themes": "1.7.0-rc.17",
14
+ "@types/node": "20.7.1",
15
+ "@types/react": "18.2.23",
16
+ "@types/react-dom": "18.2.8",
17
+ "@unocss/preset-uno": "0.56.4",
18
+ "@unocss/webpack": "0.56.4",
19
19
  "ajv": "8.12.0",
20
20
  "chromedriver": "116.0.0",
21
21
  "cpy-cli": "5.0.0",
@@ -1,56 +1,20 @@
1
- import { KolButton, KolForm } from '@public-ui/react';
2
1
  import React, { FC, useLayoutEffect, useRef } from 'react';
3
- import { InputCheckboxVariants } from './input-checkbox/partials/variants';
4
- import { InputColorVariants } from './input-color/partials/variants';
5
- import { InputDateVariants } from './input-date/partials/variants';
6
- import { InputEmailVariants } from './input-email/partials/variants';
7
- import { InputFileVariants } from './input-file/partials/variants';
8
- import { InputNumberVariants } from './input-number/partials/variants';
9
- import { InputPasswordVariants } from './input-password/partials/variants';
10
- import { InputRadioVariants } from './input-radio/partials/variants';
11
- import { InputRangeVariants } from './input-range/partials/variants';
12
- import { InputTextVariants } from './input-text/partials/variants';
13
- import { SelectVariants } from './select/partials/variants';
14
- import { TextareaVariants } from './textarea/partials/variants';
2
+ import { RefComponent } from './types';
15
3
 
16
- type Props = {
17
- RefInput:
18
- | typeof InputCheckboxVariants
19
- | typeof InputColorVariants
20
- | typeof InputDateVariants
21
- | typeof InputEmailVariants
22
- | typeof InputFileVariants
23
- | typeof InputNumberVariants
24
- | typeof InputPasswordVariants
25
- | typeof InputRadioVariants
26
- | typeof InputRangeVariants
27
- | typeof InputTextVariants
28
- | typeof SelectVariants
29
- | typeof TextareaVariants;
30
- props?: Record<string, unknown>;
31
- };
4
+ type FokusElementProps = {
5
+ RefComponent: RefComponent;
6
+ } & Record<string, unknown>;
32
7
 
33
- export const FocusInput: FC<Props> = ({ RefInput, props }) => {
8
+ export const FocusElement: FC<FokusElementProps> = (props) => {
34
9
  const ref = useRef(null);
35
10
 
36
11
  useLayoutEffect(() => {
37
12
  setTimeout(() => {
38
- if (ref.current) {
13
+ if (ref.current && window.self === window.top) {
39
14
  (ref.current as unknown as HTMLElement).focus();
40
15
  }
41
16
  }, 500);
42
17
  }, [ref]);
43
18
 
44
- return (
45
- <KolForm>
46
- <div className="grid gap-4">
47
- <RefInput ref={ref} {...props} />
48
- <div className="flex gap-4">
49
- <KolButton _label="Submit" _icons="codicon codicon-arrow-right" _type="submit" _variant="primary" />
50
- <KolButton _label="Reset" _type="reset" _variant="tertiary" />
51
- <KolButton _label="Help" _type="button" _variant="ghost" />
52
- </div>
53
- </div>
54
- </KolForm>
55
- );
19
+ return <props.RefComponent ref={ref} {...props} />;
56
20
  };
@@ -0,0 +1,21 @@
1
+ import { KolButton, KolForm } from '@public-ui/react';
2
+ import React, { FC } from 'react';
3
+ import { FocusElement } from './FocusInput';
4
+ import { RefFormComponent } from './types';
5
+
6
+ type FormWrapProps = {
7
+ RefComponent: RefFormComponent;
8
+ } & Record<string, unknown>;
9
+
10
+ export const FormWrap: FC<FormWrapProps> = (props) => (
11
+ <KolForm>
12
+ <div className="grid gap-4">
13
+ <FocusElement {...props} />
14
+ <div className="flex gap-4">
15
+ <KolButton _label="Submit" _icons="codicon codicon-arrow-right" _type="submit" _variant="primary" />
16
+ <KolButton _label="Reset" _type="reset" _variant="tertiary" />
17
+ <KolButton _label="Help" _type="button" _variant="ghost" />
18
+ </div>
19
+ </div>
20
+ </KolForm>
21
+ );
@@ -1,29 +1,5 @@
1
- import React from 'react';
2
- import { KolButton } from '@public-ui/react';
1
+ import React, { FC } from 'react';
2
+ import { FocusElement } from '../FocusInput';
3
+ import { ButtonVariants } from './partials/variants';
3
4
 
4
- import { FC } from 'react';
5
-
6
- const ARGS = {
7
- _on: {
8
- onClick: (_event, _value) => alert('Klick!'),
9
- },
10
- };
11
-
12
- export const ButtonBasic: FC = () => (
13
- <div className="grid gap-14">
14
- <div className="flex flex-wrap gap-14">
15
- <KolButton _label="Primary" _variant="primary" {...ARGS}></KolButton>
16
- <KolButton _label="Secondary" _variant="secondary" {...ARGS}></KolButton>
17
- <KolButton _label="Normal" _variant="normal" {...ARGS}></KolButton>
18
- <KolButton _label="Danger" _variant="danger" {...ARGS}></KolButton>
19
- <KolButton _label="Ghost" _variant="ghost" {...ARGS}></KolButton>
20
- </div>
21
- <div className="flex flex-wrap gap-14">
22
- <KolButton _disabled _label="Primary" _variant="primary"></KolButton>
23
- <KolButton _disabled _label="Secondary" _variant="secondary"></KolButton>
24
- <KolButton _disabled _label="Normal" _variant="normal"></KolButton>
25
- <KolButton _disabled _label="Danger" _variant="danger"></KolButton>
26
- <KolButton _disabled _label="Ghost" _variant="ghost"></KolButton>
27
- </div>
28
- </div>
29
- );
5
+ export const ButtonBasic: FC = () => <FocusElement RefComponent={ButtonVariants} />;
@@ -0,0 +1,16 @@
1
+ import { Components } from '@public-ui/components';
2
+ import { KolButton } from '@public-ui/react';
3
+ import React, { forwardRef } from 'react';
4
+
5
+ export const ButtonCases = forwardRef<HTMLKolButtonElement, Components.KolButton>(function InputCheckboxCases(props, ref) {
6
+ return (
7
+ <div className="flex flex-wrap gap-4">
8
+ <KolButton {...props} _icons="codicon codicon-home" _label="Primary" _variant="primary"></KolButton>
9
+ <KolButton {...props} _icons="codicon codicon-heart" _label="Secondary" _variant="secondary"></KolButton>
10
+ <KolButton {...props} _icons="codicon codicon-hubot" _label="Normal" _variant="normal"></KolButton>
11
+ <KolButton {...props} _icons="codicon codicon-hubot" _label="Tertiary" _variant="tertiary"></KolButton>
12
+ <KolButton {...props} _icons="codicon codicon-trash" _label="Danger" _variant="danger"></KolButton>
13
+ <KolButton ref={ref} {...props} _icons="codicon codicon-reactions" _label="Ghost" _variant="ghost"></KolButton>
14
+ </div>
15
+ );
16
+ });
@@ -0,0 +1,27 @@
1
+ import { Components } from '@public-ui/components';
2
+ import React, { forwardRef } from 'react';
3
+ import { ButtonCases } from './cases';
4
+
5
+ export const ButtonVariants = forwardRef<HTMLKolButtonElement, Components.KolButton>(function InputCheckboxVariant(props, ref) {
6
+ return (
7
+ <div className="grid gap-4">
8
+ <h1>Button</h1>
9
+ <section>
10
+ <h2>Button</h2>
11
+ <ButtonCases {...props} />
12
+ </section>
13
+ <section>
14
+ <h2>Button (disabled)</h2>
15
+ <ButtonCases {...props} _disabled />
16
+ </section>
17
+ <section>
18
+ <h2>Button (hideLabel)</h2>
19
+ <ButtonCases ref={ref} {...props} _hideLabel />
20
+ </section>
21
+ <section>
22
+ <h2>Button (disabled, hideLabel)</h2>
23
+ <ButtonCases {...props} _disabled _hideLabel />
24
+ </section>
25
+ </div>
26
+ );
27
+ });
@@ -6,22 +6,22 @@ import { FC } from 'react';
6
6
  export const HeadingBadged: FC = () => (
7
7
  <div className="grid gap-4">
8
8
  <KolHeading _label="" _level={1}>
9
- Eine Überschrift mit einem <KolBadge _color="red" _label="Label"></KolBadge>
9
+ Eine Überschrift mit einem <KolBadge _color="#f00" _label="Label"></KolBadge>
10
10
  </KolHeading>
11
11
  <KolHeading _label="" _level={2}>
12
- Eine Überschrift mit einem <KolBadge _color="green" _label="Label"></KolBadge>
12
+ Eine Überschrift mit einem <KolBadge _color="#0f0" _label="Label"></KolBadge>
13
13
  </KolHeading>
14
14
  <KolHeading _label="" _level={3}>
15
- Eine Überschrift mit einem <KolBadge _color="blue" _label="Label"></KolBadge>
15
+ Eine Überschrift mit einem <KolBadge _color="#00f" _label="Label"></KolBadge>
16
16
  </KolHeading>
17
17
  <KolHeading _label="" _level={4}>
18
- Eine Überschrift mit einem <KolBadge _color="purple" _label="Label"></KolBadge>
18
+ Eine Überschrift mit einem <KolBadge _color="#800080" _label="Label"></KolBadge>
19
19
  </KolHeading>
20
20
  <KolHeading _label="" _level={5}>
21
- Eine Überschrift mit einem <KolBadge _color="yellow" _label="Label"></KolBadge>
21
+ Eine Überschrift mit einem <KolBadge _color="#ff0" _label="Label"></KolBadge>
22
22
  </KolHeading>
23
23
  <KolHeading _label="" _level={6}>
24
- Eine Überschrift mit einem <KolBadge _color="pink" _label="Label"></KolBadge>
24
+ Eine Überschrift mit einem <KolBadge _color="#ffc0cb" _label="Label"></KolBadge>
25
25
  </KolHeading>
26
26
  </div>
27
27
  );
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
+ import { FormWrap } from '../FormWrap';
2
3
  import { InputCheckboxVariants } from './partials/variants';
3
- import { FocusInput } from '../FocusInput';
4
4
 
5
- export const InputCheckboxBasic: FC = () => <FocusInput RefInput={InputCheckboxVariants} />;
5
+ export const InputCheckboxBasic: FC = () => <FormWrap RefComponent={InputCheckboxVariants} />;
@@ -1,12 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FocusInput } from '../FocusInput';
2
+ import { FormWrap } from '../FormWrap';
3
3
  import { InputCheckboxVariants } from './partials/variants';
4
4
 
5
- export const InputCheckboxButton: FC = () => (
6
- <FocusInput
7
- RefInput={InputCheckboxVariants}
8
- props={{
9
- _variant: 'button',
10
- }}
11
- />
12
- );
5
+ export const InputCheckboxButton: FC = () => <FormWrap RefComponent={InputCheckboxVariants} _variant="button" />;
@@ -1,12 +1,5 @@
1
1
  import React, { FC } from 'react';
2
2
  import { InputCheckboxVariants } from './partials/variants';
3
- import { FocusInput } from '../FocusInput';
3
+ import { FormWrap } from '../FormWrap';
4
4
 
5
- export const InputCheckboxSwitch: FC = () => (
6
- <FocusInput
7
- RefInput={InputCheckboxVariants}
8
- props={{
9
- _variant: 'switch',
10
- }}
11
- />
12
- );
5
+ export const InputCheckboxSwitch: FC = () => <FormWrap RefComponent={InputCheckboxVariants} _variant="switch" />;
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FocusInput } from '../FocusInput';
2
+ import { FormWrap } from '../FormWrap';
3
3
  import { InputColorVariants } from './partials/variants';
4
4
 
5
- export const InputColorBasic: FC = () => <FocusInput RefInput={InputColorVariants} />;
5
+ export const InputColorBasic: FC = () => <FormWrap RefComponent={InputColorVariants} />;
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FocusInput } from '../FocusInput';
2
+ import { FormWrap } from '../FormWrap';
3
3
  import { InputDateVariants } from './partials/variants';
4
4
 
5
- export const InputDateBasic: FC = () => <FocusInput RefInput={InputDateVariants} />;
5
+ export const InputDateBasic: FC = () => <FormWrap RefComponent={InputDateVariants} />;
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FocusInput } from '../FocusInput';
2
+ import { FormWrap } from '../FormWrap';
3
3
  import { InputEmailVariants } from './partials/variants';
4
4
 
5
- export const InputEmailBasic: FC = () => <FocusInput RefInput={InputEmailVariants} />;
5
+ export const InputEmailBasic: FC = () => <FormWrap RefComponent={InputEmailVariants} />;
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FocusInput } from '../FocusInput';
2
+ import { FormWrap } from '../FormWrap';
3
3
  import { InputFileVariants } from './partials/variants';
4
4
 
5
- export const InputFileBasic: FC = () => <FocusInput RefInput={InputFileVariants} />;
5
+ export const InputFileBasic: FC = () => <FormWrap RefComponent={InputFileVariants} />;
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FocusInput } from '../FocusInput';
2
+ import { FormWrap } from '../FormWrap';
3
3
  import { InputNumberVariants } from './partials/variants';
4
4
 
5
- export const InputNumberBasic: FC = () => <FocusInput RefInput={InputNumberVariants} />;
5
+ export const InputNumberBasic: FC = () => <FormWrap RefComponent={InputNumberVariants} />;
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FocusInput } from '../FocusInput';
2
+ import { FormWrap } from '../FormWrap';
3
3
  import { InputPasswordVariants } from './partials/variants';
4
4
 
5
- export const InputPasswordBasic: FC = () => <FocusInput RefInput={InputPasswordVariants} />;
5
+ export const InputPasswordBasic: FC = () => <FormWrap RefComponent={InputPasswordVariants} />;
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FocusInput } from '../FocusInput';
2
+ import { FormWrap } from '../FormWrap';
3
3
  import { InputRadioVariants } from './partials/variants';
4
4
 
5
- export const InputRadioBasic: FC = () => <FocusInput RefInput={InputRadioVariants} />;
5
+ export const InputRadioBasic: FC = () => <FormWrap RefComponent={InputRadioVariants} />;
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FocusInput } from '../FocusInput';
2
+ import { FormWrap } from '../FormWrap';
3
3
  import { InputRangeVariants } from './partials/variants';
4
4
 
5
- export const InputRangeBasic: FC = () => <FocusInput RefInput={InputRangeVariants} />;
5
+ export const InputRangeBasic: FC = () => <FormWrap RefComponent={InputRangeVariants} />;
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FocusInput } from '../FocusInput';
2
+ import { FormWrap } from '../FormWrap';
3
3
  import { InputTextVariants } from './partials/variants';
4
4
 
5
- export const InputTextBasic: FC = () => <FocusInput RefInput={InputTextVariants} />;
5
+ export const InputTextBasic: FC = () => <FormWrap RefComponent={InputTextVariants} />;
@@ -5,8 +5,9 @@ import { FC } from 'react';
5
5
 
6
6
  export const PaginationBasic: FC = () => (
7
7
  <div className="grid gap-4">
8
- <KolPagination _total={10} _page={6} _siblingCount={0} _label="Test Paginierung 1" />
9
- <KolPagination _total={10} _page={6} _siblingCount={2} _variant="danger" _label="Test Paginierung 2" />
10
- <KolPagination _total={10} _page={6} _siblingCount={0} _boundaryCount={2} _variant="ghost" _label="Test Paginierung 3" />
8
+ <KolPagination _max={10} _page={6} _siblingCount={0} _label="Test Paginierung 1" />
9
+ <KolPagination _max={10} _page={6} _siblingCount={2} _variant="danger" _label="Test Paginierung 2" />
10
+ <KolPagination _max={10} _page={6} _siblingCount={0} _boundaryCount={2} _variant="ghost" _label="Test Paginierung 3" />
11
+ <KolPagination _max={6} _page={6} _siblingCount={0} _boundaryCount={2} _variant="ghost" _label="Test Paginierung 3" />
11
12
  </div>
12
13
  );
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FocusInput } from '../FocusInput';
2
+ import { FormWrap } from '../FormWrap';
3
3
  import { SelectVariants } from './partials/variants';
4
4
 
5
- export const SelectBasic: FC = () => <FocusInput RefInput={SelectVariants} />;
5
+ export const SelectBasic: FC = () => <FormWrap RefComponent={SelectVariants} />;
@@ -5,11 +5,13 @@ import { TableBadgeSize } from './badge-size';
5
5
  import { TableRenderCell } from './render-cell';
6
6
 
7
7
  import { TableSortTable } from './sort-date';
8
+ import { TableWithPagination } from './with-pagination';
8
9
 
9
10
  export const TABLE_ROUTES: Routes = {
10
11
  table: {
11
12
  'badge-size': TableBadgeSize,
12
13
  'render-cell': TableRenderCell,
13
14
  'sort-data': TableSortTable,
15
+ 'with-pagination': TableWithPagination,
14
16
  },
15
17
  };
@@ -0,0 +1,22 @@
1
+ import React, { FC } from 'react';
2
+
3
+ import { KolTable } from '@public-ui/react';
4
+ import { KoliBriTableHeaders } from '@public-ui/components';
5
+ import { KoliBriTablePaginationProps } from '@public-ui/components/src';
6
+ import { DATA } from './test-data';
7
+
8
+ const HEADERS: KoliBriTableHeaders = {
9
+ horizontal: [
10
+ [
11
+ { label: 'Order', key: 'order' },
12
+ { label: 'Date', key: 'date' },
13
+ ],
14
+ ],
15
+ };
16
+ const PAGINATION: KoliBriTablePaginationProps = { _page: 2, _total: 1 };
17
+
18
+ export const TableWithPagination: FC = () => (
19
+ <div>
20
+ <KolTable _label="Tabellenbeschreibung" _data={DATA} _headers={HEADERS} _pagination={PAGINATION}></KolTable>
21
+ </div>
22
+ );
@@ -1,5 +1,5 @@
1
1
  import React, { FC } from 'react';
2
- import { FocusInput } from '../FocusInput';
2
+ import { FormWrap } from '../FormWrap';
3
3
  import { TextareaVariants } from './partials/variants';
4
4
 
5
- export const TextareaBasic: FC = () => <FocusInput RefInput={TextareaVariants} />;
5
+ export const TextareaBasic: FC = () => <FormWrap RefComponent={TextareaVariants} />;
@@ -0,0 +1,42 @@
1
+ import { FormWrap } from './FormWrap';
2
+ import { ButtonVariants } from './button/partials/variants';
3
+ import { InputCheckboxVariants } from './input-checkbox/partials/variants';
4
+ import { InputColorVariants } from './input-color/partials/variants';
5
+ import { InputDateVariants } from './input-date/partials/variants';
6
+ import { InputEmailVariants } from './input-email/partials/variants';
7
+ import { InputFileVariants } from './input-file/partials/variants';
8
+ import { InputNumberVariants } from './input-number/partials/variants';
9
+ import { InputPasswordVariants } from './input-password/partials/variants';
10
+ import { InputRadioVariants } from './input-radio/partials/variants';
11
+ import { InputRangeVariants } from './input-range/partials/variants';
12
+ import { InputTextVariants } from './input-text/partials/variants';
13
+ import { SelectVariants } from './select/partials/variants';
14
+ import { TextareaVariants } from './textarea/partials/variants';
15
+
16
+ export type RefFormComponent =
17
+ | typeof InputCheckboxVariants
18
+ | typeof InputColorVariants
19
+ | typeof InputDateVariants
20
+ | typeof InputEmailVariants
21
+ | typeof InputFileVariants
22
+ | typeof InputNumberVariants
23
+ | typeof InputPasswordVariants
24
+ | typeof InputRadioVariants
25
+ | typeof InputRangeVariants
26
+ | typeof InputTextVariants
27
+ | typeof SelectVariants
28
+ | typeof TextareaVariants;
29
+
30
+ export type RefComponent =
31
+ // | typeof AbbrVariants
32
+ // | typeof AccordionVariants
33
+ // | typeof AlertVariants
34
+ | typeof ButtonVariants
35
+ // | typeof ButtonLinkVariants
36
+ // | typeof CardVariants
37
+ // | typeof LinkVariants
38
+ // | typeof LinkButtonVariants
39
+ // | typeof PopoverVariants
40
+ // | typeof SplitButtonVariants
41
+ // | typeof TabsVariants
42
+ | RefFormComponent;
package/src/style.scss CHANGED
@@ -1,3 +1,11 @@
1
+ * {
2
+ font-family: Verdana;
3
+ }
4
+
5
+ body {
6
+ margin: 0;
7
+ }
8
+
1
9
  dl,
2
10
  hr {
3
11
  margin: 0;
@@ -19,10 +27,6 @@ hr {
19
27
  grid-template-columns: auto auto;
20
28
  }
21
29
 
22
- .app-sidebar {
23
- font-family: sans-serif;
24
- }
25
-
26
30
  @media (min-width: 1024px) {
27
31
  .app-container {
28
32
  display: grid;
@@ -36,8 +40,9 @@ hr {
36
40
  }
37
41
 
38
42
  @media print {
43
+
39
44
  .no-print,
40
45
  .no-print * {
41
46
  display: none !important;
42
47
  }
43
- }
48
+ }
package/dist/9021.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 9021.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_public_ui_sample_react=self.webpackChunk_public_ui_sample_react||[]).push([[9021],{1472:(t,e,o)=>{o.d(e,{A:()=>a});var n=o(1692),i=o(3203);const s=(0,o(9473).b)();class a{constructor(t,e,o){var n,a;if(this.setFormAssociatedValue=t=>{var e;const o=null===(e=this.formAssociated)||void 0===e?void 0:e.getAttribute("name");null!==o&&""!==o||(0,i.d)(` The form field (${this.name}) must have a name attribute to be form-associated. Please define the _name attribute.`);const n=this.tryToStringifyValue(t);this.syncValue(t,n,this.formAssociated),this.syncValue(t,n,this.syncToOwnInput)},this.component=t,this.host=this.findHostWithShadowRoot(o),this.name=e,s){switch(null===(n=this.host)||void 0===n||n.querySelectorAll("input,select,textarea").forEach((t=>{var e;null===(e=this.host)||void 0===e||e.removeChild(t)})),this.name){case"button":this.formAssociated=document.createElement("button");break;case"select":this.formAssociated=document.createElement("select"),this.formAssociated.setAttribute("multiple","");break;case"textarea":this.formAssociated=document.createElement("textarea");break;default:this.formAssociated=document.createElement("input"),this.formAssociated.setAttribute("type","hidden")}this.formAssociated.setAttribute("aria-hidden","true"),this.formAssociated.setAttribute("data-form-associated",""),this.formAssociated.setAttribute("hidden",""),null===(a=this.host)||void 0===a||a.appendChild(this.formAssociated)}}findHostWithShadowRoot(t){for(;null===(null==t?void 0:t.shadowRoot)&&t!==document.body;)(t=null==t?void 0:t.parentNode).host&&(t=t.host);return t}setAttribute(t,e,o){if(s)try{if("boolean"!=typeof(o="object"==typeof o&&null!==o?JSON.stringify(o):o)&&"number"!=typeof o&&"string"!=typeof o)throw new Error("Invalid value type: "+typeof o);null==e||e.setAttribute(t,`${o}`)}catch(o){null==e||e.removeAttribute(t)}}tryToStringifyValue(t){try{return"object"==typeof t&&null!==t?JSON.stringify(t).toString():null==t?null:t.toString()}catch(t){return(0,i.h)(`The form field raw value is not able to stringify! ${t}`),""}}syncValue(t,e,o){o&&("select"===this.name?(o.querySelectorAll("option").forEach((t=>{o.removeChild(t)})),Array.isArray(t)&&t.forEach((t=>{const e=this.tryToStringifyValue(t);if("string"==typeof e){const t=document.createElement("option");t.setAttribute("value",e),t.setAttribute("selected",""),o.appendChild(t)}}))):"string"==typeof e?(o.setAttribute("value",e),o.value=e):(o.removeAttribute("value"),o.value=""))}validateName(t){((t,e,o)=>{(0,n.d)(t,"_name",e,o)})(this.component,t,{hooks:{afterPatch:()=>{this.setAttribute("name",this.formAssociated,this.component.state._name)}}}),void 0===t&&(0,i.d)("Ein Name am Eingabefeldern oder Schalter ist nicht zwingend erforderlich, kann aber für die Autocomplete-Funktion und für das statische Versenden des Eingabefeldes relevant sein.")}validateSyncValueBySelector(t){if(s&&"string"==typeof t){const e=document.querySelector(t);e&&(this.syncToOwnInput=e)}}componentWillLoad(){this.validateName(this.component._name),this.validateSyncValueBySelector(this.component._syncValueBySelector)}}},7043:(t,e,o)=>{o.d(e,{I:()=>p,g:()=>h,v:()=>d});var n=o(1692),i=o(8425),s=o(3117),a=o(3203),l=o(9865),r=o(3576),c=o(1472);const h=t=>{const e="string"==typeof t._error&&t._error.length>0&&!0===t._touched,o="string"==typeof t._hint&&t._hint.length>0,n=[];return!0===e&&n.push(`${t._id}-error`),!0===o&&n.push(`${t._id}-hint`),{hasError:e,hasHint:o,ariaDescribedBy:n}},d=(t,e,o)=>{(0,n.a)(t,"_hideError",e,o)};class u extends c.A{constructor(t,e,o){super(t,e,o),this.component=t}validateAlert(t){(0,n.a)(this.component,"_alert",t)}validateTouched(t){((t,e)=>{(0,n.a)(t,"_touched",e)})(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateAlert(this.component._alert),this.validateTouched(this.component._touched)}}class p extends u{constructor(t,e,o){super(t,e,o),this.valueChangeListeners=[],this.onFacade={onBlur:this.onBlur.bind(this),onChange:this.onChange.bind(this),onClick:this.onClick.bind(this),onFocus:this.onFocus.bind(this)},this.component=t}validateAccessKey(t){(0,n.d)(this.component,"_accessKey",t)}validateAdjustHeight(t){((t,e)=>{(0,n.a)(t,"_adjustHeight",e)})(this.component,t)}validateDisabled(t){(0,n.a)(this.component,"_disabled",t),!0===t&&(0,a.g)()}validateError(t){(0,n.d)(this.component,"_error",t)}validateHideLabel(t){(0,i.v)(this.component,t,{hooks:{afterPatch:()=>{this.component.state._hideLabel&&(0,a.a)("Property hide-label for inputs: Only use for exceptions like search inputs that are clearly identifiable by their context.")}}})}validateHint(t){(0,n.d)(this.component,"_hint",t)}validateId(t){(0,n.d)(this.component,"_id",t,{hooks:{afterPatch:()=>{this.setAttribute("id",this.formAssociated,this.component.state._id)}},minLength:1}),""!==t&&void 0!==t||(0,a.d)("Eine eindeutige ID an den Eingabefeldern ist nicht zwingend erforderlich, könnte aber für die E2E-Tests relevant sein.")}validateLabel(t){(0,s.a)(this.component,t)}validateOn(t){"object"==typeof t&&(0,n.s)(this.component,"_on",t)}validateSmartButton(t){(0,n.o)(t,(()=>{try{t=(0,n.p)(t)}catch(t){}(0,n.s)(this.component,"_smartButton",t)}))}validateTabIndex(t){(0,r.v)(this.component,t)}componentWillLoad(){super.componentWillLoad(),this.validateAccessKey(this.component._accessKey),this.validateAdjustHeight(this.component._adjustHeight),this.validateError(this.component._error),this.validateDisabled(this.component._disabled),this.validateHideLabel(this.component._hideLabel),this.validateHint(this.component._hint),this.validateId(this.component._id),this.validateLabel(this.component._label),this.validateSmartButton(this.component._smartButton),this.validateOn(this.component._on),this.validateTabIndex(this.component._tabIndex)}onBlur(t){var e;this.component._alert=!0,this.component._touched=!0,(0,l.s)(t),(0,l.t)("blur",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onBlur)&&this.component._on.onBlur(t)}onChange(t){var e;const o=t.target.value;(0,l.s)(t),(0,l.t)("change",this.host,o),this.setFormAssociatedValue(o),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onChange)&&this.component._on.onChange(t,o),this.valueChangeListeners.forEach((t=>t(o)))}onClick(t){var e;(0,l.s)(t),(0,l.t)("click",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onClick)&&this.component._on.onClick(t)}onFocus(t){var e;this.component._alert=!0,(0,l.s)(t),(0,l.t)("focus",this.host),"function"==typeof(null===(e=this.component._on)||void 0===e?void 0:e.onFocus)&&this.component._on.onFocus(t)}setValue(t,e){var o;this.setFormAssociatedValue(e),"function"==typeof(null===(o=this.component._on)||void 0===o?void 0:o.onChange)&&this.component._on.onChange(t,e)}addValueChangeListener(t){this.valueChangeListeners.push(t)}}},9021:(t,e,o)=>{o.d(e,{I:()=>r});var n=o(7476),i=o(1692),s=o(2180),a=o(7043);const l=(t,e)=>{const o=t;"object"==typeof o&&null!==o&&((0,s.i)(o.right,1)&&(o.right={icon:o.right}),(0,s.i)(o.left,1)&&(o.left={icon:o.left}),e.set("_icons",o))};class r extends a.I{constructor(t,e,o){super(t,e,o),this.component=t}validateIcon(t){this.validateIcons(t)}validateIcons(t){(0,i.o)(t,(()=>{try{t=(0,i.p)(t)}catch(t){}(0,i.w)(this.component,"_icons",(t=>"object"==typeof t&&null!==t&&((0,s.i)(t.left,1)||(0,n.i)(t.left)||(0,s.i)(t.right,1)||(0,n.i)(t.right))),new Set(["KoliBriHorizontalIcon"]),t,{hooks:{beforePatch:l},required:!0})}))}componentWillLoad(){super.componentWillLoad(),this.validateIcons(this.component._icons||this.component._icon)}}},9865:(t,e,o)=>{function n(t){t.stopImmediatePropagation(),t.stopPropagation()}function i(t,e,o){e&&function(t,e,o){const n=t.dispatchEvent(function(t,e){return new CustomEvent(`kol-${t}`,{bubbles:!0,cancelable:!0,composed:!0,detail:e})}(e,o))}(e,t,o)}o.d(e,{s:()=>n,t:()=>i})},8425:(t,e,o)=>{o.d(e,{v:()=>i});var n=o(1692);const i=(t,e,o={})=>{(0,n.a)(t,"_hideLabel",e,o)}},7476:(t,e,o)=>{o.d(e,{i:()=>l,v:()=>r,w:()=>c});var n=o(1692),i=o(2180);const s=(t,e,o)=>{(0,i.c)(o)?t[e]=o:(0,i.i)(o,1)&&(t[e]={icon:o})},a=t=>{var e,o,n,a,l,r,c;if(null===(e=t.nextState)||void 0===e?void 0:e.has("_icons")){const e=null===(o=t.nextState)||void 0===o?void 0:o.get("_icons"),l=(null===(n=t.nextState)||void 0===n?void 0:n.get("_iconAlign"))||t.state._iconAlign;null===(a=t.nextState)||void 0===a||a.set("_icons",((t,e)=>{let o={};return(0,i.i)(t,1)?o="right"===e?{right:{icon:t}}:{left:{icon:t}}:"object"==typeof t&&null!==t&&(s(o,"top",t.top),s(o,"right",t.right),s(o,"bottom",t.bottom),s(o,"left",t.left)),o})(e,l))}else if(null===(l=t.nextState)||void 0===l?void 0:l.has("_iconAlign")){const e=t.state._iconAlign;null===(r=t.nextState)||void 0===r||r.set("_icons",{[e]:void 0,[null===(c=t.nextState)||void 0===c?void 0:c.get("_iconAlign")]:t.state._icons[e]})}},l=t=>"object"==typeof t&&null!==t&&(void 0===t.style||(0,i.b)(t.style))&&(0,i.i)(t.icon,1),r=(t,e)=>{(0,n.o)(e,(()=>{try{e=(0,n.p)(e)}catch(t){}(0,n.w)(t,"_icons",(t=>null===t||(0,i.i)(t,1)||"object"==typeof t&&null!==t&&((0,i.i)(t.left,1)||l(t.left)||(0,i.i)(t.right,1)||l(t.right)||(0,i.i)(t.top,1)||l(t.top)||(0,i.i)(t.bottom,1)||l(t.bottom))),new Set(["KoliBriIcon"]),e,{hooks:{beforePatch:(e,o)=>{null===e&&o.set("_icons",{}),a(t)}},required:!0})}))},c=(t,e)=>{(0,n.w)(t,"_iconAlign",(t=>"left"===t||"right"===t),new Set(["Alignment {left, right, top, bottom}"]),e,{hooks:{beforePatch:()=>{a(t)}}})}},3117:(t,e,o)=>{o.d(e,{a:()=>d,c:()=>r,h:()=>l,v:()=>h});var n=o(3203),i=o(1692);const s=/[a-zA-Z0-9äöüÄÖÜß]/g,a=/^\d+$/;function l(t,e=1){return function(t){var e;return"string"==typeof t&&(null===(e=t.match(s))||void 0===e?void 0:e.length)||0}(t)>=e}function r(t){return a.test(t)}const c=new Set(["string"]),h=(t,e,o={})=>{(0,i.w)(t,"_label",(t=>"string"==typeof t),c,e,function(t){var e;return{hooks:{afterPatch:(e,o,i,s)=>{var a,c;"function"==typeof(null===(a=t.hooks)||void 0===a?void 0:a.afterPatch)&&(null===(c=t.hooks)||void 0===c||c.afterPatch(e,o,i,s)),"string"==typeof e&&!1===l(e,3)&&!1===r(e)&&(0,n.a)(`The heading or label ("${e}") is not accessible. A label should consist of at least three readable characters.`),"string"==typeof e&&e.length>80&&(0,n.u)("A heading or label should not be longer than 80 characters.")},beforePatch:null===(e=t.hooks)||void 0===e?void 0:e.beforePatch}}}(o))},d=h},3576:(t,e,o)=>{o.d(e,{v:()=>a});var n=o(3203),i=o(1692);const s={hooks:{afterPatch:t=>{-1!==t&&0!==t&&(0,n.a)("Don’t Use Tabindex Greater than 0: https://adrianroselli.com/2014/11/dont-use-tabindex-greater-than-0.html")}}},a=(t,e)=>{(0,i.e)(t,"_tabIndex",e,s)}}}]);