@validationcloud/fractal-ui 1.4.0 → 1.5.1

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 CHANGED
@@ -1,2 +1,63 @@
1
- # fractal-ui
2
- Validation Cloud's component library
1
+ ![Fractal UI](./fractal-ui.svg)
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,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;