greenole-design-system 1.1.71 → 1.1.73

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,147 +1,147 @@
1
- # Greenole Design System
2
-
3
- [![Figma Design](https://img.shields.io/badge/Figma-Design_System-blue)](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
-
100
- ```bash
101
- npm run build
102
- ```
103
-
104
- This will create the `dist` folder with both CommonJS and ESModule files, as well as type declarations (if configured).
105
-
106
- 2. To test locally in another project, use `npm link`:
107
- ```bash
108
- cd greenole-design-system
109
- npm link
110
- cd ../your-consumer-project
111
- npm link greenole-design-system
112
- ```
113
- 3. When ready to publish:
114
-
115
- ```bash
116
- npm login
117
- npm publish --access public
118
- ```
119
-
120
- ## Publishing Storybook to GitHub Pages
121
-
122
- 1. Build the Storybook:
123
-
124
- ```bash
125
- npm run build-storybook
126
- ```
127
-
128
- This generates the static files for your Storybook.
129
-
130
- 2. Deploy to GitHub Pages:
131
-
132
- ```bash
133
- npm run deploy-storybook
134
- ```
135
-
136
- This will automatically push the built files to the configured branch (`gh-pages`).
137
-
138
- After that, you can access the updated Storybook at: [Design System](https://greenole-iot.github.io/greenole-design-system)
139
-
140
- ## Contributing
141
-
142
- Contributions are welcome! If you would like to help evolve the **Greenole Design System**, follow these steps:
143
-
144
- 1. Fork the repository.
145
- 2. Create a branch for your feature (`git checkout -b my-feature`).
146
- 3. Commit your changes.
147
- 4. Open a pull request for review.
1
+ # Greenole Design System
2
+
3
+ [![Figma Design](https://img.shields.io/badge/Figma-Design_System-blue)](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
+
100
+ ```bash
101
+ npm run build
102
+ ```
103
+
104
+ This will create the `dist` folder with both CommonJS and ESModule files, as well as type declarations (if configured).
105
+
106
+ 2. To test locally in another project, use `npm link`:
107
+ ```bash
108
+ cd greenole-design-system
109
+ npm link
110
+ cd ../your-consumer-project
111
+ npm link greenole-design-system
112
+ ```
113
+ 3. When ready to publish:
114
+
115
+ ```bash
116
+ npm login
117
+ npm publish --access public
118
+ ```
119
+
120
+ ## Publishing Storybook to GitHub Pages
121
+
122
+ 1. Build the Storybook:
123
+
124
+ ```bash
125
+ npm run build-storybook
126
+ ```
127
+
128
+ This generates the static files for your Storybook.
129
+
130
+ 2. Deploy to GitHub Pages:
131
+
132
+ ```bash
133
+ npm run deploy-storybook
134
+ ```
135
+
136
+ This will automatically push the built files to the configured branch (`gh-pages`).
137
+
138
+ After that, you can access the updated Storybook at: [Design System](https://greenole-iot.github.io/greenole-design-system)
139
+
140
+ ## Contributing
141
+
142
+ Contributions are welcome! If you would like to help evolve the **Greenole Design System**, follow these steps:
143
+
144
+ 1. Fork the repository.
145
+ 2. Create a branch for your feature (`git checkout -b my-feature`).
146
+ 3. Commit your changes.
147
+ 4. Open a pull request for review.
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { CheckboxProps } from './Checkbox.types';
3
+ export declare const Checkbox: React.FC<CheckboxProps>;
4
+ export default Checkbox;
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { default as Checkbox } from './Checkbox';
3
+ declare const meta: Meta<typeof Checkbox>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Checkbox>;
6
+ export declare const Playground: Story;
7
+ export declare const ListWithSelectAll: Story;
@@ -0,0 +1,10 @@
1
+ export declare const HiddenInput: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
2
+ export declare const Box: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
3
+ $checked: boolean;
4
+ $color: string;
5
+ $disabled?: boolean;
6
+ }>> & string;
7
+ export declare const LabelText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
8
+ export declare const Wrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {
9
+ $disabled?: boolean;
10
+ }>> & string;
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ export type CheckboxProps = {
3
+ checked?: boolean;
4
+ defaultChecked?: boolean;
5
+ onChange?: (checked: boolean) => void;
6
+ color?: string;
7
+ disabled?: boolean;
8
+ className?: string;
9
+ id?: string;
10
+ name?: string;
11
+ value?: string;
12
+ label?: ReactNode;
13
+ };
@@ -5,3 +5,4 @@ export default meta;
5
5
  type Story = StoryObj<typeof DropdownMenu>;
6
6
  export declare const Default: Story;
7
7
  export declare const WithPortal: Story;
8
+ export declare const CloseOnContentClick: Story;
@@ -9,6 +9,7 @@ export interface DropdownMenuProps {
9
9
  onOpenChange?: (isOpen: boolean) => void;
10
10
  usePortal?: boolean;
11
11
  container?: HTMLElement | null;
12
+ closeOnContentClick?: boolean;
12
13
  }
13
14
  export type DropdownMenuPositionProps = 'top' | 'bottom' | 'left' | 'right';
14
15
  export type SetOpenState = React.Dispatch<React.SetStateAction<boolean>>;
@@ -1,7 +1,5 @@
1
1
  export declare const SwitchWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {
2
2
  $checked: boolean;
3
3
  $color: string;
4
- $variant: "filled" | "outline";
5
- $thumbVariant: "filled" | "outline";
6
4
  $disabled?: boolean;
7
5
  }>> & string;
@@ -2,8 +2,6 @@ export type SwitchButtonProps = {
2
2
  checked?: boolean;
3
3
  onChange?: (checked: boolean) => void;
4
4
  color?: string;
5
- variant?: "filled" | "outline";
6
- thumbVariant?: "filled" | "outline";
7
5
  disabled?: boolean;
8
6
  className?: string;
9
7
  };
@@ -6,6 +6,7 @@ export default meta;
6
6
  type Story = StoryObj<typeof Toast>;
7
7
  export declare const Playground: Story;
8
8
  export declare const Gallery: Story;
9
+ export declare const CustomDescription: Story;
9
10
  export declare const InteractiveSandbox: {
10
11
  name: string;
11
12
  render: () => React.JSX.Element;
@@ -1,13 +1,15 @@
1
- export type ToastVariant = "success" | "error" | "warning" | "info";
2
- export type ToastPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
1
+ import { ReactNode } from 'react';
2
+ export type ToastVariant = 'success' | 'error' | 'warning' | 'info';
3
+ export type ToastPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
3
4
  export interface ToastProps {
4
5
  id?: string;
5
6
  variant?: ToastVariant;
6
7
  message: string;
7
- description?: string;
8
+ description?: string | ReactNode;
8
9
  position?: ToastPosition;
9
10
  autoDismiss?: boolean;
10
11
  autoDismissTime?: number;
11
- onClose?: () => void;
12
+ closable?: boolean;
12
13
  className?: string;
14
+ onClose?: () => void;
13
15
  }
@@ -6,3 +6,5 @@ type Story = StoryObj<typeof Accordion>;
6
6
  export declare const Default: Story;
7
7
  export declare const CustomColors: Story;
8
8
  export declare const noPaddingContent: Story;
9
+ export declare const TitleWithNode: Story;
10
+ export declare const ScrollLimit: Story;
@@ -7,6 +7,7 @@ export declare const ChevronContainer: import('styled-components/dist/types').IS
7
7
  }>> & string;
8
8
  export declare const AccordionContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
9
9
  $noPaddingContent: boolean;
10
+ $contentMaxHeight?: string;
10
11
  }>> & string;
11
12
  export declare const SubtitleContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
12
13
  export declare const SubtitleIconContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  export interface AccordionProps {
3
- title: string;
3
+ title: ReactNode;
4
4
  subtitle?: string;
5
5
  subtitleIcon?: ReactNode;
6
6
  defaultOpen?: boolean;
@@ -8,5 +8,6 @@ export interface AccordionProps {
8
8
  textColor?: string;
9
9
  borderColor?: string;
10
10
  noPaddingContent?: boolean;
11
+ contentMaxHeight?: number | string;
11
12
  children: ReactNode;
12
13
  }
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { SearchProps } from './Search.types';
3
+ export declare const Search: React.FC<SearchProps>;
4
+ export default Search;
@@ -0,0 +1,16 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { default as Search } from './Search';
3
+ declare const meta: Meta<typeof Search>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Search>;
6
+ export declare const Collapsed: Story;
7
+ export declare const Expanded: Story;
8
+ export declare const WithDebounce: Story;
9
+ export declare const Controlled: Story;
10
+ export declare const WithURLSync: Story;
11
+ export declare const CollapsedWithURLValue: Story;
12
+ export declare const WithOnSubmit: Story;
13
+ export declare const Disabled: Story;
14
+ export declare const WithInitialValue: Story;
15
+ export declare const CollapsedWithDefaultValue: Story;
16
+ export declare const Playground: Story;
@@ -0,0 +1,10 @@
1
+ export declare const SearchWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
2
+ $expanded: boolean;
3
+ $disabled?: boolean;
4
+ }>> & string;
5
+ export declare const SearchIconButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
6
+ $disabled?: boolean;
7
+ }>> & string;
8
+ export declare const SearchInputContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
9
+ $expanded: boolean;
10
+ }>> & string;
@@ -0,0 +1,13 @@
1
+ export type SearchMode = 'collapsed' | 'expanded';
2
+ export interface SearchProps {
3
+ mode?: SearchMode;
4
+ placeholder?: string;
5
+ defaultValue?: string;
6
+ value?: string;
7
+ disabled?: boolean;
8
+ debounceTime?: number;
9
+ queryKey?: string;
10
+ onChange?: (value: string) => void;
11
+ onSubmit?: (value: string) => void;
12
+ className?: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ export { default as Search } from './Search';
2
+ export type { SearchProps, SearchMode } from './Search.types';