@validationcloud/fractal-ui 1.3.0 → 1.5.0
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 +63 -2
- package/dist/components/box/box.d.ts +10 -0
- package/dist/components/box/box.stories.d.ts +19 -0
- package/dist/components/text-input/text-input.d.ts +9 -0
- package/dist/components/text-input/text-input.stories.d.ts +24 -0
- package/dist/fractal-ui.js +689 -567
- package/dist/index.d.ts +3 -0
- package/dist/utils/disable-password-managers.d.ts +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,2 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# @validationcloud/fractal-ui
|
|
4
|
+
|
|
5
|
+
This is Validation Cloud's component library, providing our web applications with custom React components, design tokens, and Tailwind classes.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
The `@validationcloud/fractal-ui` package requires `react`, `react-dom`, and `tailwindcss` to also be installed as they are peer dependencies.
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install @validationcloud/fractal-ui react react-dom tailwindcss
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Components
|
|
16
|
+
|
|
17
|
+
All components located in `src/components/` are available for use and can be imported as such:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
import { Button } from '@validationcloud/fractal-ui'
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Stylesheet
|
|
24
|
+
|
|
25
|
+
This library provides a stylesheet that can be used in projects using the Tailwind CSS styling framework. Currently the consuming project needs to be using Tailwind 4.
|
|
26
|
+
|
|
27
|
+
In the consuming application's global stylesheet, import the `tailwind.css` file after the `tailwindcss` import:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
@import 'tailwindcss';
|
|
31
|
+
@import '@validationcloud/fractal-ui/tailwind.css';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Local development
|
|
35
|
+
|
|
36
|
+
Install packages:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
npm install
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Start Storybook development server:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
npm run storybook
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Storybook can be accessed at [http://localhost:6006](http://localhost:6006)
|
|
49
|
+
|
|
50
|
+
## Project structure
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
├── src -> svgs files (e.g: project logo, icons)
|
|
54
|
+
│ ├── assets -> serverless functions deployed as API on Vercel
|
|
55
|
+
│ ├── components -> publicy exported components
|
|
56
|
+
│ ├── internal -> components used internally, not exported
|
|
57
|
+
│ ├── lib -> utility function and shared logic
|
|
58
|
+
│ └── styles -> stylesheets with design tokens and custom Tailwind classes
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Storybook
|
|
62
|
+
|
|
63
|
+
A deployed version of the @validationcloud/fractal-ui Storybook docs can be found at [https://fractal-ui.vercel.app/](https://fractal-ui.vercel.app/)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const Box: React.ForwardRefExoticComponent<{
|
|
3
|
+
header?: React.ReactNode;
|
|
4
|
+
borderRadius?: "rounded-xl" | "rounded-lg";
|
|
5
|
+
padding?: "p-r6" | "p-r4" | "p-0";
|
|
6
|
+
background?: "bg-neutral-60" | "bg-neutral-70" | "bg-neutral-80" | "bg-gradient-box" | "transparent";
|
|
7
|
+
borderColor?: "border-secondary-40";
|
|
8
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
component: import('react').ForwardRefExoticComponent<{
|
|
4
|
+
header?: React.ReactNode;
|
|
5
|
+
borderRadius?: "rounded-xl" | "rounded-lg";
|
|
6
|
+
padding?: "p-r6" | "p-r4" | "p-0";
|
|
7
|
+
background?: "bg-neutral-60" | "bg-neutral-70" | "bg-neutral-80" | "bg-gradient-box" | "transparent";
|
|
8
|
+
borderColor?: "border-secondary-40";
|
|
9
|
+
} & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
export declare const EmptyBox: Story;
|
|
16
|
+
export declare const BoxWithHeader: Story;
|
|
17
|
+
export declare const BoxWithoutHeader: Story;
|
|
18
|
+
export declare const GradientBox: Story;
|
|
19
|
+
export declare const RenderedAsDifferentElement: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type TextInputProps = {
|
|
3
|
+
variant?: 'outlined' | 'filled';
|
|
4
|
+
disablePasswordManagers?: boolean;
|
|
5
|
+
rightAccessory?: React.ReactNode;
|
|
6
|
+
errorState?: boolean;
|
|
7
|
+
} & React.InputHTMLAttributes<HTMLInputElement>;
|
|
8
|
+
export declare const TextInput: ({ variant, disablePasswordManagers, rightAccessory, errorState, className, ...props }: TextInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
component: ({ variant, disablePasswordManagers, rightAccessory, errorState, className, ...props }: {
|
|
4
|
+
variant?: "outlined" | "filled";
|
|
5
|
+
disablePasswordManagers?: boolean;
|
|
6
|
+
rightAccessory?: React.ReactNode;
|
|
7
|
+
errorState?: boolean;
|
|
8
|
+
} & import('react').InputHTMLAttributes<HTMLInputElement>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
args: {
|
|
10
|
+
disabled: false;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
export declare const EmptyWithPlaceholder: Story;
|
|
16
|
+
export declare const EmpyWithPlaceholderFilled: Story;
|
|
17
|
+
export declare const WithContent: Story;
|
|
18
|
+
export declare const WithContentFilled: Story;
|
|
19
|
+
export declare const WithAccessory: Story;
|
|
20
|
+
export declare const WithAccessoryFilled: Story;
|
|
21
|
+
export declare const ErrorState: Story;
|
|
22
|
+
export declare const ErrorStateFilled: Story;
|
|
23
|
+
export declare const Disabled: Story;
|
|
24
|
+
export declare const DisabledFilled: Story;
|