greenole-design-system 1.1.10 → 1.1.12
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 +123 -123
- package/dist/base-components/Avatar/Avatar.d.ts +4 -0
- package/dist/base-components/Avatar/Avatar.stories.d.ts +11 -0
- package/dist/base-components/Avatar/Avatar.types.d.ts +13 -0
- package/dist/base-components/Pills/Pills.d.ts +4 -0
- package/dist/base-components/Pills/Pills.stories.d.ts +15 -0
- package/dist/base-components/Pills/Pills.types.d.ts +11 -0
- package/dist/base-components/ProgressBar/ProgressBar.d.ts +4 -0
- package/dist/base-components/ProgressBar/ProgressBar.stories.d.ts +9 -0
- package/dist/base-components/ProgressBar/ProgressBar.types.d.ts +19 -0
- package/dist/base-components/Space/Space.d.ts +4 -0
- package/dist/base-components/Space/Space.stories.d.ts +9 -0
- package/dist/base-components/Space/Space.types.d.ts +9 -0
- package/dist/base-components/TextField/TextField.d.ts +4 -0
- package/dist/base-components/TextField/TextField.stories.d.ts +8 -0
- package/dist/base-components/TextField/TextField.types.d.ts +27 -0
- package/dist/base-components/Tooltip/Tooltip.d.ts +4 -0
- package/dist/base-components/Tooltip/Tooltip.stories.d.ts +6 -0
- package/dist/base-components/Tooltip/Tooltip.types.d.ts +13 -0
- package/dist/components/Icons/Avatar.d.ts +6 -0
- package/dist/greenole-design-system.cjs.js +16 -16
- package/dist/greenole-design-system.es.js +1415 -979
- package/dist/greenole.css +364 -0
- package/dist/index.d.ts +6 -0
- package/package.json +78 -78
package/README.md
CHANGED
|
@@ -1,124 +1,124 @@
|
|
|
1
|
-
# Greenole Design System
|
|
2
|
-
|
|
3
|
-
[](https://www.figma.com/design/Zwkbh8XGfVt2At4ln7p1WE/DS-Greenole?node-id=1017-15&p=f&t=Mjdfp67Q8ADWcm9v-0)
|
|
4
|
-
|
|
5
|
-
The **Greenole Design System** is a React component library designed to create consistent and scalable user interfaces.
|
|
6
|
-
The library is constantly evolving, with new components and improvements being added over time.
|
|
7
|
-
|
|
8
|
-
## Table of Contents
|
|
9
|
-
|
|
10
|
-
- [Introduction](#introduction)
|
|
11
|
-
- [Installation](#installation)
|
|
12
|
-
- [Usage](#usage)
|
|
13
|
-
- [Development](#development)
|
|
14
|
-
- [Build & Publication](#build--publication)
|
|
15
|
-
- [Contributing](#contributing)
|
|
16
|
-
- [License](#license)
|
|
17
|
-
|
|
18
|
-
## Introduction
|
|
19
|
-
|
|
20
|
-
**Greenole Design System** gathers reusable components that follow a consistent visual identity.
|
|
21
|
-
It helps teams maintain design and usability standards across their React projects.
|
|
22
|
-
|
|
23
|
-
> **Note:**
|
|
24
|
-
> This library is in constant evolution. Existing components may be updated and new ones added over time.
|
|
25
|
-
|
|
26
|
-
## Installation
|
|
27
|
-
|
|
28
|
-
To install the library in your React project, run:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm install greenole-design-system
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
> **Note:**
|
|
35
|
-
> The library declares `react` and `react-dom` as peer dependencies, so ensure your project already has these installed.
|
|
36
|
-
|
|
37
|
-
## Usage
|
|
38
|
-
|
|
39
|
-
After installation, you need to import both the CSS styles and the components:
|
|
40
|
-
|
|
41
|
-
### 1. Import the CSS styles
|
|
42
|
-
|
|
43
|
-
First, import the CSS file in your main application file (usually `main.jsx`, `App.jsx`, or `index.js`):
|
|
44
|
-
|
|
45
|
-
```jsx
|
|
46
|
-
import 'greenole-design-system/dist/greenole.css';
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### 2. Import and use components
|
|
50
|
-
|
|
51
|
-
Then you can import and use the library's components:
|
|
52
|
-
|
|
53
|
-
```jsx
|
|
54
|
-
import React from 'react';
|
|
55
|
-
import { Typography } from 'greenole-design-system';
|
|
56
|
-
|
|
57
|
-
function App() {
|
|
58
|
-
return (
|
|
59
|
-
<div>
|
|
60
|
-
<Typography variant="h1">
|
|
61
|
-
The quick brown fox jumps over the lazy dog.
|
|
62
|
-
</Typography>
|
|
63
|
-
{/* Additional components will be added in the future */}
|
|
64
|
-
</div>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export default App;
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Development
|
|
72
|
-
|
|
73
|
-
To contribute to or test the library locally:
|
|
74
|
-
|
|
75
|
-
1. Clone the repository:
|
|
76
|
-
```bash
|
|
77
|
-
git clone https://github.com/your-username/greenole-design-system.git
|
|
78
|
-
cd greenole-design-system
|
|
79
|
-
```
|
|
80
|
-
2. Install dependencies:
|
|
81
|
-
```bash
|
|
82
|
-
npm install
|
|
83
|
-
```
|
|
84
|
-
3. Start the development environment using Vite:
|
|
85
|
-
```bash
|
|
86
|
-
npm run dev
|
|
87
|
-
```
|
|
88
|
-
4. To view the documentation and components, we use **Storybook**:
|
|
89
|
-
```bash
|
|
90
|
-
npm run storybook
|
|
91
|
-
```
|
|
92
|
-
Storybook serves as the documentation and demo environment for the library's components.
|
|
93
|
-
|
|
94
|
-
## Build & Publication
|
|
95
|
-
|
|
96
|
-
To generate the library bundle:
|
|
97
|
-
|
|
98
|
-
1. Run the build command:
|
|
99
|
-
```bash
|
|
100
|
-
npm run build
|
|
101
|
-
```
|
|
102
|
-
This will create the `dist` folder with both CommonJS and ESModule files, as well as type declarations (if configured).
|
|
103
|
-
|
|
104
|
-
2. To test locally in another project, use `npm link`:
|
|
105
|
-
```bash
|
|
106
|
-
cd greenole-design-system
|
|
107
|
-
npm link
|
|
108
|
-
cd ../your-consumer-project
|
|
109
|
-
npm link greenole-design-system
|
|
110
|
-
```
|
|
111
|
-
3. When ready to publish:
|
|
112
|
-
```bash
|
|
113
|
-
npm login
|
|
114
|
-
npm publish --access public
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Contributing
|
|
118
|
-
|
|
119
|
-
Contributions are welcome! If you would like to help evolve the **Greenole Design System**, follow these steps:
|
|
120
|
-
|
|
121
|
-
1. Fork the repository.
|
|
122
|
-
2. Create a branch for your feature (`git checkout -b my-feature`).
|
|
123
|
-
3. Commit your changes.
|
|
1
|
+
# Greenole Design System
|
|
2
|
+
|
|
3
|
+
[](https://www.figma.com/design/Zwkbh8XGfVt2At4ln7p1WE/DS-Greenole?node-id=1017-15&p=f&t=Mjdfp67Q8ADWcm9v-0)
|
|
4
|
+
|
|
5
|
+
The **Greenole Design System** is a React component library designed to create consistent and scalable user interfaces.
|
|
6
|
+
The library is constantly evolving, with new components and improvements being added over time.
|
|
7
|
+
|
|
8
|
+
## Table of Contents
|
|
9
|
+
|
|
10
|
+
- [Introduction](#introduction)
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Usage](#usage)
|
|
13
|
+
- [Development](#development)
|
|
14
|
+
- [Build & Publication](#build--publication)
|
|
15
|
+
- [Contributing](#contributing)
|
|
16
|
+
- [License](#license)
|
|
17
|
+
|
|
18
|
+
## Introduction
|
|
19
|
+
|
|
20
|
+
**Greenole Design System** gathers reusable components that follow a consistent visual identity.
|
|
21
|
+
It helps teams maintain design and usability standards across their React projects.
|
|
22
|
+
|
|
23
|
+
> **Note:**
|
|
24
|
+
> This library is in constant evolution. Existing components may be updated and new ones added over time.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
To install the library in your React project, run:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install greenole-design-system
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
> **Note:**
|
|
35
|
+
> The library declares `react` and `react-dom` as peer dependencies, so ensure your project already has these installed.
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
After installation, you need to import both the CSS styles and the components:
|
|
40
|
+
|
|
41
|
+
### 1. Import the CSS styles
|
|
42
|
+
|
|
43
|
+
First, import the CSS file in your main application file (usually `main.jsx`, `App.jsx`, or `index.js`):
|
|
44
|
+
|
|
45
|
+
```jsx
|
|
46
|
+
import 'greenole-design-system/dist/greenole.css';
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 2. Import and use components
|
|
50
|
+
|
|
51
|
+
Then you can import and use the library's components:
|
|
52
|
+
|
|
53
|
+
```jsx
|
|
54
|
+
import React from 'react';
|
|
55
|
+
import { Typography } from 'greenole-design-system';
|
|
56
|
+
|
|
57
|
+
function App() {
|
|
58
|
+
return (
|
|
59
|
+
<div>
|
|
60
|
+
<Typography variant="h1">
|
|
61
|
+
The quick brown fox jumps over the lazy dog.
|
|
62
|
+
</Typography>
|
|
63
|
+
{/* Additional components will be added in the future */}
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default App;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Development
|
|
72
|
+
|
|
73
|
+
To contribute to or test the library locally:
|
|
74
|
+
|
|
75
|
+
1. Clone the repository:
|
|
76
|
+
```bash
|
|
77
|
+
git clone https://github.com/your-username/greenole-design-system.git
|
|
78
|
+
cd greenole-design-system
|
|
79
|
+
```
|
|
80
|
+
2. Install dependencies:
|
|
81
|
+
```bash
|
|
82
|
+
npm install
|
|
83
|
+
```
|
|
84
|
+
3. Start the development environment using Vite:
|
|
85
|
+
```bash
|
|
86
|
+
npm run dev
|
|
87
|
+
```
|
|
88
|
+
4. To view the documentation and components, we use **Storybook**:
|
|
89
|
+
```bash
|
|
90
|
+
npm run storybook
|
|
91
|
+
```
|
|
92
|
+
Storybook serves as the documentation and demo environment for the library's components.
|
|
93
|
+
|
|
94
|
+
## Build & Publication
|
|
95
|
+
|
|
96
|
+
To generate the library bundle:
|
|
97
|
+
|
|
98
|
+
1. Run the build command:
|
|
99
|
+
```bash
|
|
100
|
+
npm run build
|
|
101
|
+
```
|
|
102
|
+
This will create the `dist` folder with both CommonJS and ESModule files, as well as type declarations (if configured).
|
|
103
|
+
|
|
104
|
+
2. To test locally in another project, use `npm link`:
|
|
105
|
+
```bash
|
|
106
|
+
cd greenole-design-system
|
|
107
|
+
npm link
|
|
108
|
+
cd ../your-consumer-project
|
|
109
|
+
npm link greenole-design-system
|
|
110
|
+
```
|
|
111
|
+
3. When ready to publish:
|
|
112
|
+
```bash
|
|
113
|
+
npm login
|
|
114
|
+
npm publish --access public
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Contributing
|
|
118
|
+
|
|
119
|
+
Contributions are welcome! If you would like to help evolve the **Greenole Design System**, follow these steps:
|
|
120
|
+
|
|
121
|
+
1. Fork the repository.
|
|
122
|
+
2. Create a branch for your feature (`git checkout -b my-feature`).
|
|
123
|
+
3. Commit your changes.
|
|
124
124
|
4. Open a pull request for review.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as Avatar } from './Avatar';
|
|
3
|
+
declare const avatarMeta: Meta<typeof Avatar>;
|
|
4
|
+
export default avatarMeta;
|
|
5
|
+
type Story = StoryObj<typeof Avatar>;
|
|
6
|
+
export declare const WithTextFallback: Story;
|
|
7
|
+
export declare const WithIconOnly: Story;
|
|
8
|
+
export declare const TransparentBackground: Story;
|
|
9
|
+
export declare const WithStarIcon: Story;
|
|
10
|
+
export declare const ImageExample: Story;
|
|
11
|
+
export declare const ClickableAvatar: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
2
|
+
export declare const avatarSizes: Record<AvatarSize, string>;
|
|
3
|
+
export interface AvatarProps {
|
|
4
|
+
src?: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
size?: AvatarSize;
|
|
7
|
+
shape?: "circle" | "rounded";
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
fallbackText?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
bgColor?: "bg-[var(--neutral-soft)]" | "bg-[var(--neutral-medium)]" | "bg-[var(--brandcolor-softest)]" | "bg-[var(--green-500)]" | "bg-[var(--red-500)]" | "bg-[var(--blue-400)]" | "bg-transparent";
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as Pills } from './Pills';
|
|
3
|
+
declare const meta: Meta<typeof Pills>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Pills>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const Primary: Story;
|
|
8
|
+
export declare const Success: Story;
|
|
9
|
+
export declare const Danger: Story;
|
|
10
|
+
export declare const Warning: Story;
|
|
11
|
+
export declare const Infor: Story;
|
|
12
|
+
export declare const Neutral: Story;
|
|
13
|
+
export declare const WithIcons: Story;
|
|
14
|
+
export declare const CustomTypography: Story;
|
|
15
|
+
export declare const CustomPadding: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypographyVariant } from '../../components/Typography/Typography';
|
|
2
|
+
export type PillsVariant = 'neutral' | 'success' | 'danger' | 'warning' | 'info' | 'primary';
|
|
3
|
+
export interface PillsProps {
|
|
4
|
+
label: string;
|
|
5
|
+
variant?: PillsVariant;
|
|
6
|
+
typography?: TypographyVariant;
|
|
7
|
+
padding?: string;
|
|
8
|
+
iconLeft?: React.ReactNode;
|
|
9
|
+
iconRight?: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as ProgressBar } from './ProgressBar';
|
|
3
|
+
declare const meta: Meta<typeof ProgressBar>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ProgressBar>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const PercentProgress: Story;
|
|
8
|
+
export declare const CustomColorHex: Story;
|
|
9
|
+
export declare const WithoutText: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ProgressBarType = "percent" | "file";
|
|
2
|
+
export type ProgressBarHeight = "sm" | "md" | "lg";
|
|
3
|
+
export interface ProgressBarProps {
|
|
4
|
+
type?: ProgressBarType;
|
|
5
|
+
value: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
height?: ProgressBarHeight;
|
|
8
|
+
color?: keyof typeof colorMap | string;
|
|
9
|
+
showText?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const progressHeights: Record<ProgressBarHeight, string>;
|
|
13
|
+
export declare const colorMap: {
|
|
14
|
+
brand: string;
|
|
15
|
+
green: string;
|
|
16
|
+
red: string;
|
|
17
|
+
blue: string;
|
|
18
|
+
neutral: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as Space } from './Space';
|
|
3
|
+
declare const meta: Meta<typeof Space>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Space>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const AllSpacings: Story;
|
|
8
|
+
export declare const CustomColorHex: Story;
|
|
9
|
+
export declare const CustomWidth: Story;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type SpaceHeight = "spacing-1" | "spacing-2" | "spacing-4" | "spacing-8" | "spacing-12" | "spacing-16" | "spacing-24" | "spacing-32" | "spacing-40" | "spacing-48" | "spacing-56" | "spacing-64" | "spacing-72" | "spacing-80" | "spacing-104";
|
|
2
|
+
export declare const spaceHeights: Record<SpaceHeight, string>;
|
|
3
|
+
export interface SpaceProps {
|
|
4
|
+
height?: SpaceHeight;
|
|
5
|
+
color?: string;
|
|
6
|
+
width?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
showLabel?: boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as TextField } from './TextField';
|
|
3
|
+
declare const meta: Meta<typeof TextField>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof TextField>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
export declare const ValidationExamples: Story;
|
|
8
|
+
export declare const States: Story;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TypographyVariant } from '../../components/Typography/Typography';
|
|
2
|
+
export type TextFieldTheme = "light" | "dark";
|
|
3
|
+
export type ValidationType = "text" | "email" | "number" | "password" | "tel" | "url";
|
|
4
|
+
export type InputType = React.HTMLInputTypeAttribute;
|
|
5
|
+
export interface TextFieldProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
6
|
+
label?: string;
|
|
7
|
+
labelSize?: TypographyVariant;
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
subtitleIcon?: React.ReactNode;
|
|
10
|
+
error?: string;
|
|
11
|
+
valid?: boolean;
|
|
12
|
+
iconLeft?: React.ReactNode;
|
|
13
|
+
iconRight?: React.ReactNode;
|
|
14
|
+
fullWidth?: boolean;
|
|
15
|
+
theme?: TextFieldTheme;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
validationType?: ValidationType;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
minLength?: number;
|
|
20
|
+
maxLength?: number;
|
|
21
|
+
min?: number;
|
|
22
|
+
max?: number;
|
|
23
|
+
pattern?: string;
|
|
24
|
+
validateOnBlur?: boolean;
|
|
25
|
+
onValidation?: (isValid: boolean) => void;
|
|
26
|
+
type?: InputType;
|
|
27
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TypographyVariant } from '../../components/Typography/Typography';
|
|
2
|
+
export type TooltipPosition = "top" | "bottom" | "left" | "right";
|
|
3
|
+
export type TooltipTheme = "light" | "dark";
|
|
4
|
+
export interface TooltipProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
text: string;
|
|
7
|
+
position?: TooltipPosition;
|
|
8
|
+
variant?: TypographyVariant;
|
|
9
|
+
bgColor?: string;
|
|
10
|
+
textColor?: string;
|
|
11
|
+
darkMode?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|