suus-component-library 0.1.5 → 0.1.9
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/README.md +2 -64
- package/dist/components/form/button/Button.d.ts +17 -0
- package/dist/components/form/button/Button.d.ts.map +1 -0
- package/dist/components/form/{buttons/input-button/InputButton.stories.d.ts → button/Button.stories.d.ts} +3 -3
- package/dist/components/form/button/Button.stories.d.ts.map +1 -0
- package/dist/components/form/button/index.d.ts +3 -0
- package/dist/components/form/button/index.d.ts.map +1 -0
- package/dist/components/form/checkbox/Checkbox.d.ts +9 -0
- package/dist/components/form/checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/form/checkbox/Checkbox.stories.d.ts +25 -0
- package/dist/components/form/checkbox/Checkbox.stories.d.ts.map +1 -0
- package/dist/components/form/checkbox/index.d.ts +3 -0
- package/dist/components/form/checkbox/index.d.ts.map +1 -0
- package/dist/components/form/chip/Chip.d.ts +24 -0
- package/dist/components/form/chip/Chip.d.ts.map +1 -0
- package/dist/components/form/chip/Chip.stories.d.ts +37 -0
- package/dist/components/form/chip/Chip.stories.d.ts.map +1 -0
- package/dist/components/form/chip/index.d.ts +3 -0
- package/dist/components/form/chip/index.d.ts.map +1 -0
- package/dist/components/form/date-picker/DatePicker.d.ts +46 -0
- package/dist/components/form/date-picker/DatePicker.d.ts.map +1 -0
- package/dist/components/form/date-picker/DatePicker.stories.d.ts +389 -0
- package/dist/components/form/date-picker/DatePicker.stories.d.ts.map +1 -0
- package/dist/components/form/date-picker/index.d.ts +3 -0
- package/dist/components/form/date-picker/index.d.ts.map +1 -0
- package/dist/components/form/dropdown/Dropdown.d.ts +33 -0
- package/dist/components/form/dropdown/Dropdown.d.ts.map +1 -0
- package/dist/components/form/dropdown/Dropdown.stories.d.ts +370 -0
- package/dist/components/form/dropdown/Dropdown.stories.d.ts.map +1 -0
- package/dist/components/form/dropdown/index.d.ts +3 -0
- package/dist/components/form/dropdown/index.d.ts.map +1 -0
- package/dist/components/form/link/Link.d.ts +35 -0
- package/dist/components/form/link/Link.d.ts.map +1 -0
- package/dist/components/form/link/Link.stories.d.ts +56 -0
- package/dist/components/form/link/Link.stories.d.ts.map +1 -0
- package/dist/components/form/link/index.d.ts +3 -0
- package/dist/components/form/link/index.d.ts.map +1 -0
- package/dist/components/form/password/Password.d.ts +24 -0
- package/dist/components/form/password/Password.d.ts.map +1 -0
- package/dist/components/form/password/Password.stories.d.ts +73 -0
- package/dist/components/form/password/Password.stories.d.ts.map +1 -0
- package/dist/components/form/password/index.d.ts +3 -0
- package/dist/components/form/password/index.d.ts.map +1 -0
- package/dist/components/form/postal-code/PostalCode.d.ts +64 -0
- package/dist/components/form/postal-code/PostalCode.d.ts.map +1 -0
- package/dist/components/form/postal-code/PostalCode.stories.d.ts +384 -0
- package/dist/components/form/postal-code/PostalCode.stories.d.ts.map +1 -0
- package/dist/components/form/postal-code/index.d.ts +3 -0
- package/dist/components/form/postal-code/index.d.ts.map +1 -0
- package/dist/components/form/radiobutton/RadioButton.d.ts +34 -0
- package/dist/components/form/radiobutton/RadioButton.d.ts.map +1 -0
- package/dist/components/form/radiobutton/RadioButton.stories.d.ts +74 -0
- package/dist/components/form/radiobutton/RadioButton.stories.d.ts.map +1 -0
- package/dist/components/form/radiobutton/index.d.ts +3 -0
- package/dist/components/form/radiobutton/index.d.ts.map +1 -0
- package/dist/components/form/switch/Switch.d.ts +28 -0
- package/dist/components/form/switch/Switch.d.ts.map +1 -0
- package/dist/components/form/switch/Switch.stories.d.ts +62 -0
- package/dist/components/form/switch/Switch.stories.d.ts.map +1 -0
- package/dist/components/form/switch/index.d.ts +3 -0
- package/dist/components/form/switch/index.d.ts.map +1 -0
- package/dist/components/form/textfield/TextField.d.ts +23 -0
- package/dist/components/form/textfield/TextField.d.ts.map +1 -0
- package/dist/components/form/textfield/TextField.stories.d.ts +59 -0
- package/dist/components/form/textfield/TextField.stories.d.ts.map +1 -0
- package/dist/components/form/textfield/index.d.ts +3 -0
- package/dist/components/form/textfield/index.d.ts.map +1 -0
- package/dist/components/form/upload/Upload.d.ts +37 -0
- package/dist/components/form/upload/Upload.d.ts.map +1 -0
- package/dist/components/form/upload/Upload.stories.d.ts +389 -0
- package/dist/components/form/upload/Upload.stories.d.ts.map +1 -0
- package/dist/components/form/upload/index.d.ts +3 -0
- package/dist/components/form/upload/index.d.ts.map +1 -0
- package/dist/index.d.ts +24 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/suus-component-library.css +1 -1
- package/dist/suus-component-library.js +875 -16
- package/dist/suus-component-library.umd.cjs +1 -1
- package/package.json +8 -4
- package/dist/components/form/buttons/input-button/InputButton.d.ts +0 -14
- package/dist/components/form/buttons/input-button/InputButton.d.ts.map +0 -1
- package/dist/components/form/buttons/input-button/InputButton.stories.d.ts.map +0 -1
- package/dist/components/form/buttons/input-button/index.d.ts +0 -3
- package/dist/components/form/buttons/input-button/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -2,74 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
4
|
|
|
5
|
-
Currently, two official plugins are available:
|
|
6
|
-
|
|
7
|
-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
|
|
9
|
-
|
|
10
5
|
## React Compiler
|
|
11
6
|
|
|
12
7
|
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
13
8
|
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
-
|
|
18
|
-
```js
|
|
19
|
-
export default defineConfig([
|
|
20
|
-
globalIgnores(['dist']),
|
|
21
|
-
{
|
|
22
|
-
files: ['**/*.{ts,tsx}'],
|
|
23
|
-
extends: [
|
|
24
|
-
// Other configs...
|
|
25
|
-
|
|
26
|
-
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
-
tseslint.configs.recommendedTypeChecked,
|
|
28
|
-
// Alternatively, use this for stricter rules
|
|
29
|
-
tseslint.configs.strictTypeChecked,
|
|
30
|
-
// Optionally, add this for stylistic rules
|
|
31
|
-
tseslint.configs.stylisticTypeChecked,
|
|
32
|
-
|
|
33
|
-
// Other configs...
|
|
34
|
-
],
|
|
35
|
-
languageOptions: {
|
|
36
|
-
parserOptions: {
|
|
37
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
-
tsconfigRootDir: import.meta.dirname,
|
|
39
|
-
},
|
|
40
|
-
// other options...
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
])
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
-
|
|
48
|
-
```js
|
|
49
|
-
// eslint.config.js
|
|
50
|
-
import reactX from 'eslint-plugin-react-x'
|
|
51
|
-
import reactDom from 'eslint-plugin-react-dom'
|
|
9
|
+
## Github Pages for Component Library Storybook
|
|
52
10
|
|
|
53
|
-
|
|
54
|
-
globalIgnores(['dist']),
|
|
55
|
-
{
|
|
56
|
-
files: ['**/*.{ts,tsx}'],
|
|
57
|
-
extends: [
|
|
58
|
-
// Other configs...
|
|
59
|
-
// Enable lint rules for React
|
|
60
|
-
reactX.configs['recommended-typescript'],
|
|
61
|
-
// Enable lint rules for React DOM
|
|
62
|
-
reactDom.configs.recommended,
|
|
63
|
-
],
|
|
64
|
-
languageOptions: {
|
|
65
|
-
parserOptions: {
|
|
66
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
-
tsconfigRootDir: import.meta.dirname,
|
|
68
|
-
},
|
|
69
|
-
// other options...
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
])
|
|
73
|
-
```
|
|
11
|
+
https://hettlingen.github.io/suus-component-library/
|
|
74
12
|
|
|
75
13
|
##
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
export type ColorToken = "--colors-juice-sugarcane" | "--colors-juice-tamarind" | "--colors-juice-guava" | "--colors-juice-icetea";
|
|
3
|
+
export type ButtonProps = {
|
|
4
|
+
label: string;
|
|
5
|
+
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
+
type?: "button" | "submit" | "reset";
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
variant?: "primary" | "secondary";
|
|
10
|
+
colorToken?: ColorToken;
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "onClick" | "disabled">;
|
|
13
|
+
/**
|
|
14
|
+
* A customizable button component that supports different variants, loading states, and color tokens.
|
|
15
|
+
*/
|
|
16
|
+
export default function Button({ label, onClick, type, disabled, loading, variant, colorToken, icon, ...rest }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/form/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,oBAAoB,EAAiB,UAAU,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAGtF,MAAM,MAAM,UAAU,GAChB,0BAA0B,GAC1B,yBAAyB,GACzB,sBAAsB,GACtB,uBAAuB,CAAC;AAE9B,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzD,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAClC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,SAAS,CAAC;CACpB,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AAEnF;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EACS,KAAK,EACL,OAAO,EACP,IAAe,EACf,QAAgB,EAChB,OAAe,EACf,OAAmB,EACnB,UAAuC,EACvC,IAAI,EACJ,GAAG,IAAI,EACV,EAAE,WAAW,2CAoCjD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { default as
|
|
2
|
+
import { default as Button } from './Button';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: typeof
|
|
5
|
+
component: typeof Button;
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
8
8
|
};
|
|
@@ -30,4 +30,4 @@ export declare const Primary: Story;
|
|
|
30
30
|
export declare const Secondary: Story;
|
|
31
31
|
export declare const Disabled: Story;
|
|
32
32
|
export declare const Icon: Story;
|
|
33
|
-
//# sourceMappingURL=
|
|
33
|
+
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/form/button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;CA4BqB,CAAC;AAEhC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAYvB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KA+BlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type CheckboxProps = {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
name: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
variant?: "default" | "glassy";
|
|
7
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "type">;
|
|
8
|
+
export default function Checkbox({ label, name, id, error, variant, className, disabled, ...rest }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../../src/components/form/checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5D,MAAM,MAAM,aAAa,GAAG;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAClC,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,CAAC;AAExD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EACI,KAAK,EACL,IAAI,EACJ,EAAE,EACF,KAAK,EACL,OAAmB,EACnB,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACV,EAAE,aAAa,2CAgDhD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { default as Checkbox } from './Checkbox';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Checkbox;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
argTypes: {
|
|
10
|
+
variant: {
|
|
11
|
+
control: "select";
|
|
12
|
+
options: string[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
export declare const Default: Story;
|
|
19
|
+
export declare const Checked: Story;
|
|
20
|
+
export declare const Disabled: Story;
|
|
21
|
+
export declare const DisabledChecked: Story;
|
|
22
|
+
export declare const Error: Story;
|
|
23
|
+
export declare const ErrorChecked: Story;
|
|
24
|
+
export declare const Glassy: Story;
|
|
25
|
+
//# sourceMappingURL=Checkbox.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/form/checkbox/Checkbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,QAAA,MAAM,IAAI;;;;;;;;;;;;CAYuB,CAAC;AAElC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAO7B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAO1B,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAuBpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/checkbox/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ChipProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
variant?: "glassy" | "default";
|
|
5
|
+
} & HTMLAttributes<HTMLSpanElement>;
|
|
6
|
+
/**
|
|
7
|
+
* A reusable Chip component that can be used across the application.
|
|
8
|
+
*
|
|
9
|
+
* How to use it in your application:
|
|
10
|
+
*
|
|
11
|
+
* <Chip>Bio</Chip>
|
|
12
|
+
* <Chip variant="glassy">Sugarcane</Chip>
|
|
13
|
+
* <Chip className={styles.myCustomChip}>Limited Edition</Chip>
|
|
14
|
+
*
|
|
15
|
+
* ODER:
|
|
16
|
+
*
|
|
17
|
+
* <div className="chips">
|
|
18
|
+
* {(profile.interests ?? []).map((interest) => (
|
|
19
|
+
* <Chip key={interest.label}>{interest.label.toUpperCase()}</Chip>
|
|
20
|
+
* ))}
|
|
21
|
+
* </div>
|
|
22
|
+
*/
|
|
23
|
+
export default function Chip({ children, variant, className, ...rest }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=Chip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../src/components/form/chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,MAAM,MAAM,SAAS,GAAG;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAClC,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAGpC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EACI,QAAQ,EACR,OAAmB,EACnB,SAAS,EACT,GAAG,IAAI,EACV,EAAE,SAAS,2CAexC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { default as Chip } from './Chip';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Chip;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {
|
|
11
|
+
children: {
|
|
12
|
+
control: "text";
|
|
13
|
+
};
|
|
14
|
+
variant: {
|
|
15
|
+
control: "select";
|
|
16
|
+
options: string[];
|
|
17
|
+
};
|
|
18
|
+
title: {
|
|
19
|
+
control: "text";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
args: {
|
|
23
|
+
children: string;
|
|
24
|
+
variant: "default";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default meta;
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
export declare const Default: Story;
|
|
30
|
+
export declare const DefaultLongText: Story;
|
|
31
|
+
export declare const Glassy: Story;
|
|
32
|
+
export declare const GlassyLongText: Story;
|
|
33
|
+
export declare const WithTitleAttribute: Story;
|
|
34
|
+
export declare const CustomColors: Story;
|
|
35
|
+
export declare const MultipleChips: Story;
|
|
36
|
+
export declare const MultipleGlassyChips: Story;
|
|
37
|
+
//# sourceMappingURL=Chip.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Chip.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/form/chip/Chip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;CAuBmB,CAAC;AAE9B,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAK7B,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAUpB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAU5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAMhC,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAU1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAiB3B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAsBjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/form/chip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { InputHTMLAttributes, Ref } from 'react';
|
|
2
|
+
export type DatePickerProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
name: string;
|
|
5
|
+
value?: Date | null;
|
|
6
|
+
maxDate?: Date;
|
|
7
|
+
minDate?: Date;
|
|
8
|
+
error?: string;
|
|
9
|
+
variant?: "glassy" | "default";
|
|
10
|
+
ref?: Ref<HTMLInputElement>;
|
|
11
|
+
onDateChange?: (date: Date | null) => void;
|
|
12
|
+
} & Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange" | "max" | "min">;
|
|
13
|
+
/**
|
|
14
|
+
* A reusable DatePicker component that can be used across the application.
|
|
15
|
+
*
|
|
16
|
+
* How to use it in your application:
|
|
17
|
+
* Use with state:
|
|
18
|
+
*
|
|
19
|
+
* const [birthday, setBirthday] = useState<Date | null>(null);
|
|
20
|
+
*
|
|
21
|
+
* <DatePicker
|
|
22
|
+
* name="birthday"
|
|
23
|
+
* label="Geburtsdatum"
|
|
24
|
+
* value={birthday}
|
|
25
|
+
* onDateChange={setBirthday}
|
|
26
|
+
* error={errors.birthday?.message}
|
|
27
|
+
* />
|
|
28
|
+
*
|
|
29
|
+
* Use with react-hook-form:
|
|
30
|
+
* <Controller
|
|
31
|
+
* name="birthday"
|
|
32
|
+
* control={control}
|
|
33
|
+
* render={({ field, fieldState }) => (
|
|
34
|
+
* <DatePicker
|
|
35
|
+
* name={field.name}
|
|
36
|
+
* label="Geburtsdatum"
|
|
37
|
+
* value={field.value}
|
|
38
|
+
* onDateChange={field.onChange}
|
|
39
|
+
* onBlur={field.onBlur}
|
|
40
|
+
* error={fieldState.error?.message}
|
|
41
|
+
* />
|
|
42
|
+
* )}
|
|
43
|
+
* />
|
|
44
|
+
*/
|
|
45
|
+
export default function DatePicker({ label, name, id, value, maxDate, minDate, error, variant, className, ref, onDateChange, onBlur, disabled, ...rest }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
//# sourceMappingURL=DatePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../../src/components/form/date-picker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,mBAAmB,EACxB,KAAK,GAAG,EACX,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;CAC9C,GAAG,IAAI,CACJ,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,GAAG,KAAK,CAChD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACI,KAAK,EACL,IAAI,EACJ,EAAE,EACF,KAAY,EACZ,OAAO,EACP,OAAO,EACP,KAAK,EACL,OAAmB,EACnB,SAAS,EACT,GAAG,EACH,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,GAAG,IAAI,EACV,EAAE,eAAe,2CA4FpD"}
|