greenole-design-system 1.1.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 +112 -0
- package/dist/components/Empty/Empty.d.ts +3 -0
- package/dist/components/Empty/Empty.stories.d.ts +20 -0
- package/dist/components/Icons/ArrowBack.d.ts +6 -0
- package/dist/components/Icons/ArrowForward.d.ts +6 -0
- package/dist/components/Icons/Campaing.d.ts +6 -0
- package/dist/components/Icons/Checkbox.d.ts +7 -0
- package/dist/components/Icons/ChevronDown.d.ts +6 -0
- package/dist/components/Icons/DashEdit.d.ts +6 -0
- package/dist/components/Icons/Dashboard.d.ts +6 -0
- package/dist/components/Icons/Devices.d.ts +6 -0
- package/dist/components/Icons/FlagBR.d.ts +6 -0
- package/dist/components/Icons/FlagES.d.ts +6 -0
- package/dist/components/Icons/FlagPT.d.ts +6 -0
- package/dist/components/Icons/FlagUK.d.ts +6 -0
- package/dist/components/Icons/FlagUSA.d.ts +6 -0
- package/dist/components/Icons/HeaderSearch.d.ts +6 -0
- package/dist/components/Icons/HelpOutlined.d.ts +6 -0
- package/dist/components/Icons/History.d.ts +6 -0
- package/dist/components/Icons/Home.d.ts +6 -0
- package/dist/components/Icons/Icons.d.ts +31 -0
- package/dist/components/Icons/Icons.stories.d.ts +5 -0
- package/dist/components/Icons/Language.d.ts +6 -0
- package/dist/components/Icons/Lock.d.ts +6 -0
- package/dist/components/Icons/Logout.d.ts +6 -0
- package/dist/components/Icons/Map.d.ts +6 -0
- package/dist/components/Icons/Moon.d.ts +6 -0
- package/dist/components/Icons/MoreHorizontal.d.ts +6 -0
- package/dist/components/Icons/Notification.d.ts +6 -0
- package/dist/components/Icons/PeopleAlt.d.ts +6 -0
- package/dist/components/Icons/PriorityHigh.d.ts +6 -0
- package/dist/components/Icons/Public.d.ts +6 -0
- package/dist/components/Icons/Search.d.ts +6 -0
- package/dist/components/Icons/Secutiry.d.ts +6 -0
- package/dist/components/Icons/Settings.d.ts +6 -0
- package/dist/components/Icons/Star.d.ts +7 -0
- package/dist/components/Icons/WBSunny.d.ts +6 -0
- package/dist/components/Icons/WarningAmber.d.ts +6 -0
- package/dist/components/Table/DataTable.d.ts +18 -0
- package/dist/components/Table/DataTable.stories.d.ts +8 -0
- package/dist/components/Table/Pagination.d.ts +10 -0
- package/dist/components/Table/types.d.ts +10 -0
- package/dist/components/Typography/Typography.d.ts +10 -0
- package/dist/components/Typography/Typography.stories.d.ts +32 -0
- package/dist/greenole-design-system.es.js +2014 -0
- package/dist/greenole-design-system.umd.js +30 -0
- package/dist/index.d.ts +4 -0
- package/dist/main.d.ts +1 -0
- package/dist/utils/i18n/i18n.d.ts +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
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 can import and use the library's components as follows:
|
|
40
|
+
|
|
41
|
+
```jsx
|
|
42
|
+
import React from 'react';
|
|
43
|
+
import { Typography } from 'greenole-design-system';
|
|
44
|
+
|
|
45
|
+
function App() {
|
|
46
|
+
return (
|
|
47
|
+
<div>
|
|
48
|
+
<Typography variant="h1">
|
|
49
|
+
The quick brown fox jumps over the lazy dog.
|
|
50
|
+
</Typography>
|
|
51
|
+
{/* Additional components will be added in the future */}
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export default App;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Development
|
|
60
|
+
|
|
61
|
+
To contribute to or test the library locally:
|
|
62
|
+
|
|
63
|
+
1. Clone the repository:
|
|
64
|
+
```bash
|
|
65
|
+
git clone https://github.com/your-username/greenole-design-system.git
|
|
66
|
+
cd greenole-design-system
|
|
67
|
+
```
|
|
68
|
+
2. Install dependencies:
|
|
69
|
+
```bash
|
|
70
|
+
npm install
|
|
71
|
+
```
|
|
72
|
+
3. Start the development environment using Vite:
|
|
73
|
+
```bash
|
|
74
|
+
npm run dev
|
|
75
|
+
```
|
|
76
|
+
4. To view the documentation and components, we use **Storybook**:
|
|
77
|
+
```bash
|
|
78
|
+
npm run storybook
|
|
79
|
+
```
|
|
80
|
+
Storybook serves as the documentation and demo environment for the library's components.
|
|
81
|
+
|
|
82
|
+
## Build & Publication
|
|
83
|
+
|
|
84
|
+
To generate the library bundle:
|
|
85
|
+
|
|
86
|
+
1. Run the build command:
|
|
87
|
+
```bash
|
|
88
|
+
npm run build
|
|
89
|
+
```
|
|
90
|
+
This will create the `dist` folder with both CommonJS and ESModule files, as well as type declarations (if configured).
|
|
91
|
+
|
|
92
|
+
2. To test locally in another project, use `npm link`:
|
|
93
|
+
```bash
|
|
94
|
+
cd greenole-design-system
|
|
95
|
+
npm link
|
|
96
|
+
cd ../your-consumer-project
|
|
97
|
+
npm link greenole-design-system
|
|
98
|
+
```
|
|
99
|
+
3. When ready to publish:
|
|
100
|
+
```bash
|
|
101
|
+
npm login
|
|
102
|
+
npm publish --access public
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Contributing
|
|
106
|
+
|
|
107
|
+
Contributions are welcome! If you would like to help evolve the **Greenole Design System**, follow these steps:
|
|
108
|
+
|
|
109
|
+
1. Fork the repository.
|
|
110
|
+
2. Create a branch for your feature (`git checkout -b my-feature`).
|
|
111
|
+
3. Commit your changes.
|
|
112
|
+
4. Open a pull request for review.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as Empty } from './Empty';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: () => React.JSX.Element;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
tags: string[];
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof Empty>;
|
|
19
|
+
export declare const Default: Story;
|
|
20
|
+
export declare const InCard: Story;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { default as ArrowBack } from './ArrowBack';
|
|
2
|
+
export { default as ArrowForward } from './ArrowForward';
|
|
3
|
+
export { default as ChevronDown } from './ChevronDown';
|
|
4
|
+
export { default as Home } from './Home';
|
|
5
|
+
export { default as Checkbox } from './Checkbox';
|
|
6
|
+
export { default as DashEdit } from './DashEdit';
|
|
7
|
+
export { default as HeaderSearch } from './HeaderSearch';
|
|
8
|
+
export { default as MoreHorizontal } from './MoreHorizontal';
|
|
9
|
+
export { default as Search } from './Search';
|
|
10
|
+
export { default as Settings } from './Settings';
|
|
11
|
+
export { default as Lock } from './Lock';
|
|
12
|
+
export { default as Notification } from './Notification';
|
|
13
|
+
export { default as PriorityHigh } from './PriorityHigh';
|
|
14
|
+
export { default as Public } from './Public';
|
|
15
|
+
export { default as Star } from './Star';
|
|
16
|
+
export { default as WarningAmber } from './WarningAmber';
|
|
17
|
+
export { default as FlagBR } from './FlagBR';
|
|
18
|
+
export { default as FlagES } from './FlagES';
|
|
19
|
+
export { default as FlagPT } from './FlagPT';
|
|
20
|
+
export { default as FlagUK } from './FlagUK';
|
|
21
|
+
export { default as FlagUSA } from './FlagUSA';
|
|
22
|
+
export { default as Campaign } from './Campaing';
|
|
23
|
+
export { default as Dashboard } from './Dashboard';
|
|
24
|
+
export { default as Devices } from './Devices';
|
|
25
|
+
export { default as History } from './History';
|
|
26
|
+
export { default as Language } from './Language';
|
|
27
|
+
export { default as Map } from './Map';
|
|
28
|
+
export { default as PeopleAlt } from './PeopleAlt';
|
|
29
|
+
export { default as Moon } from './Moon';
|
|
30
|
+
export { default as WBSunny } from './WBSunny';
|
|
31
|
+
export { default as Logout } from './Logout';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Column } from './types';
|
|
3
|
+
interface DataTableProps {
|
|
4
|
+
columns: Column[];
|
|
5
|
+
data: any[];
|
|
6
|
+
selectable?: boolean;
|
|
7
|
+
selectedRows?: string[];
|
|
8
|
+
onSelectRow?: (rowId: string, selected: boolean) => void;
|
|
9
|
+
onSelectAll?: (allSelected: boolean) => void;
|
|
10
|
+
rowIdKey?: string;
|
|
11
|
+
page?: number;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
totalItems?: number;
|
|
14
|
+
onPageChange?: (newPage: number) => void;
|
|
15
|
+
onPageSizeChange?: (newSize: number) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function DataTable({ columns, data, selectable, selectedRows, onSelectRow, onSelectAll, rowIdKey, page, pageSize, totalItems, onPageChange, onPageSizeChange }: DataTableProps): React.JSX.Element;
|
|
18
|
+
export default DataTable;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DataTable } from './DataTable';
|
|
3
|
+
declare const meta: Meta<typeof DataTable>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DataTable>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithSelection: Story;
|
|
8
|
+
export declare const WithPagination: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface PaginationProps {
|
|
3
|
+
page: number;
|
|
4
|
+
pageSize: number;
|
|
5
|
+
totalItems: number;
|
|
6
|
+
onPageChange: (newPage: number) => void;
|
|
7
|
+
onPageSizeChange: (newSize: number) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function Pagination({ page, pageSize, totalItems, onPageChange, onPageSizeChange, }: PaginationProps): React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type TypographyVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body-xl-bold' | 'body-xl-semibold' | 'body-xl-medium' | 'body-xl-regular' | 'body-lg-bold' | 'body-lg-semibold' | 'body-lg-medium' | 'body-lg-regular' | 'body-md-bold' | 'body-md-semibold' | 'body-md-medium' | 'body-md-regular' | 'body-sm-bold' | 'body-sm-semibold' | 'body-sm-medium' | 'body-sm-regular' | 'caption-bold' | 'caption-semibold' | 'caption-medium' | 'caption-regular';
|
|
3
|
+
interface TypographyProps {
|
|
4
|
+
variant?: TypographyVariant;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
declare const Typography: React.FC<TypographyProps>;
|
|
10
|
+
export default Typography;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as Typography } from './Typography';
|
|
3
|
+
declare const meta: Meta<typeof Typography>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Typography>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const H1: Story;
|
|
8
|
+
export declare const H2: Story;
|
|
9
|
+
export declare const H3: Story;
|
|
10
|
+
export declare const H4: Story;
|
|
11
|
+
export declare const H5: Story;
|
|
12
|
+
export declare const H6: Story;
|
|
13
|
+
export declare const BodyXLBold: Story;
|
|
14
|
+
export declare const BodyXLSemibold: Story;
|
|
15
|
+
export declare const BodyXLMedium: Story;
|
|
16
|
+
export declare const BodyXLRegular: Story;
|
|
17
|
+
export declare const BodyLGBold: Story;
|
|
18
|
+
export declare const BodyLGSemibold: Story;
|
|
19
|
+
export declare const BodyLGMedium: Story;
|
|
20
|
+
export declare const BodyLGRegular: Story;
|
|
21
|
+
export declare const BodyMDBold: Story;
|
|
22
|
+
export declare const BodyMDSemibold: Story;
|
|
23
|
+
export declare const BodyMDMedium: Story;
|
|
24
|
+
export declare const BodyMDRegular: Story;
|
|
25
|
+
export declare const BodySMBold: Story;
|
|
26
|
+
export declare const BodySMSemibold: Story;
|
|
27
|
+
export declare const BodySMMedium: Story;
|
|
28
|
+
export declare const BodySMRegular: Story;
|
|
29
|
+
export declare const CaptionBold: Story;
|
|
30
|
+
export declare const CaptionSemibold: Story;
|
|
31
|
+
export declare const CaptionMedium: Story;
|
|
32
|
+
export declare const CaptionRegular: Story;
|