@public-ui/sample-react 5.0.0-beta.2 → 5.0.0-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/sample-react",
3
- "version": "5.0.0-beta.2",
3
+ "version": "5.0.0-beta.3",
4
4
  "description": "This app contains samples for the KoliBri/Public UI",
5
5
  "type": "module",
6
6
  "license": "EUPL-1.2",
@@ -20,8 +20,8 @@
20
20
  "typescript": "5.9.3",
21
21
  "world_countries_lists": "3.3.0",
22
22
  "zod": "4.6.7",
23
- "@public-ui/react-hook-form-adapter": "5.0.0-beta.2",
24
- "@public-ui/react-v19": "5.0.0-beta.2"
23
+ "@public-ui/react-hook-form-adapter": "5.0.0-beta.3",
24
+ "@public-ui/react-v19": "5.0.0-beta.3"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/react": "19.2.18",
@@ -37,7 +37,7 @@
37
37
  "react": "19.2.8",
38
38
  "react-dom": "19.2.8",
39
39
  "react-router": "8.4.0",
40
- "@public-ui/components": "5.0.0-beta.2"
40
+ "@public-ui/components": "5.0.0-beta.3"
41
41
  },
42
42
  "files": [
43
43
  "assets",
@@ -0,0 +1,16 @@
1
+ import type { FC } from 'react';
2
+ import React from 'react';
3
+
4
+ import { FormWrap } from '../FormWrap';
5
+ import { SampleDescription } from '../SampleDescription';
6
+ import { InputFileVariantsDragnDrop } from './partials/variants';
7
+
8
+ export const InputFileDragnDrop: FC = () => (
9
+ <>
10
+ <SampleDescription>
11
+ <p>KolInputFile renders a file input field. The sample shows KolInputFile in a form context with all variations and states.</p>
12
+ </SampleDescription>
13
+
14
+ <FormWrap RefComponent={InputFileVariantsDragnDrop} showButtons={false} />
15
+ </>
16
+ );
@@ -84,3 +84,23 @@ export const InputFileCases = forwardRef<HTMLKolInputFileElement, InputFileCases
84
84
  </div>
85
85
  );
86
86
  });
87
+
88
+ export const InputFileCasesDragnDrop = forwardRef<HTMLKolInputFileElement, InputFileCasesProps>(function InputFileCases({ blockIdPrefix, ...props }) {
89
+ const block = (caseId: string) => ({ id: `${blockIdPrefix}-${caseId}` });
90
+ return (
91
+ <div className="grid gap-4">
92
+ <SampleBlock {...block('accept')}>
93
+ <KolInputFile {...props} _label="Accept" _touched />
94
+ </SampleBlock>
95
+ <SampleBlock {...block('accept-multiple')}>
96
+ <KolInputFile {...props} _label="Accept multiple" _multiple _touched />
97
+ </SampleBlock>
98
+ <SampleBlock {...block('accept-disabled')}>
99
+ <KolInputFile {...props} _label="Accept disabled" _disabled _touched />
100
+ </SampleBlock>
101
+ <SampleBlock {...block('accept-multiple-disabled')}>
102
+ <KolInputFile {...props} _label="Accept multiple disabled" _multiple _disabled _touched />
103
+ </SampleBlock>
104
+ </div>
105
+ );
106
+ });
@@ -2,7 +2,7 @@ import React, { forwardRef } from 'react';
2
2
 
3
3
  import { SampleColumns } from '../../SampleColumns';
4
4
  import { SampleGroup } from '../../SampleGroup';
5
- import { InputFileCases } from './cases';
5
+ import { InputFileCases, InputFileCasesDragnDrop } from './cases';
6
6
 
7
7
  import type { Components } from '@public-ui/components';
8
8
  export const InputFileVariants = forwardRef<HTMLKolInputFileElement, Components.KolInputFile>(function InputFileVariant(props, ref) {
@@ -17,3 +17,16 @@ export const InputFileVariants = forwardRef<HTMLKolInputFileElement, Components.
17
17
  </SampleColumns>
18
18
  );
19
19
  });
20
+
21
+ export const InputFileVariantsDragnDrop = forwardRef<HTMLKolInputFileElement, Components.KolInputFile>(function InputFileVariant(props) {
22
+ return (
23
+ <SampleColumns>
24
+ <SampleGroup heading="File">
25
+ <InputFileCasesDragnDrop blockIdPrefix="label" {...props} _accept=".pdf" />
26
+ </SampleGroup>
27
+ <SampleGroup heading="File (hideLabel)">
28
+ <InputFileCasesDragnDrop blockIdPrefix="hide-label" {...props} _accept=".pdf" _hideLabel />
29
+ </SampleGroup>
30
+ </SampleColumns>
31
+ );
32
+ });
@@ -1,10 +1,12 @@
1
1
  import type { Routes } from '../../shares/types';
2
2
  import { InputFileBasic } from './basic';
3
+ import { InputFileDragnDrop } from './drag-and-drop';
3
4
  import { InputFileOnInputOnChange } from './get-value';
4
5
 
5
6
  export const INPUT_FILE_ROUTES: Routes = {
6
7
  'input-file': {
7
8
  basic: InputFileBasic,
9
+ 'drag-and-drop': InputFileDragnDrop,
8
10
  'get-value': InputFileOnInputOnChange,
9
11
  },
10
12
  };