gd-design-library 0.3.2 → 0.3.3

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
@@ -21,12 +21,16 @@ It provides a set of reusable, accessible, and themeable React UI components des
21
21
 
22
22
  ## 📦 Installation
23
23
 
24
+ Start by ensuring that you already have `@emotion/react` and `@emotion/styled` installed. Then, run one of the following commands to install the dependencies:
25
+
24
26
  ```bash
25
- npm install gd-design-library
27
+ npm install gd-design-library @emotion/styled @emotion/react
26
28
  # or
27
- yarn add gd-design-library
29
+ yarn add gd-design-library @emotion/styled @emotion/react
28
30
  ```
29
31
 
32
+ Make sure you're using Node.js **version ≥22.17.0**.
33
+
30
34
  Note: Since this package is private, you need to configure your `.npmrc` with a valid auth token:
31
35
 
32
36
  ```bash
@@ -39,7 +43,7 @@ Note: Since this package is private, you need to configure your `.npmrc` with a
39
43
 
40
44
  ### Prerequisites
41
45
 
42
- - Node.js (v18 or higher)
46
+ - Node.js (22.17.0 or higher)
43
47
  - Yarn or npm
44
48
 
45
49
  ### Clone & Install
@@ -144,26 +148,52 @@ The script will generate boilerplate files and update exports automatically.
144
148
 
145
149
  ## 🧩 Usage
146
150
 
147
- Wrap your app with the `ThemeProvider`:
151
+ Wrap your app in the `ThemeProvider` with `isDefault` to apply default GD global styles and tokens:
148
152
 
149
153
  ```tsx
150
154
  import { ThemeProvider } from 'gd-design-library';
151
155
 
152
156
  function App() {
153
157
  return (
154
- <ThemeProvider>
155
- <YourApp />
158
+ <ThemeProvider isDefault>
159
+ <YourAppRoutes />
156
160
  </ThemeProvider>
157
161
  );
158
162
  }
159
163
  ```
160
164
 
161
- Use components like:
165
+ or `initialTheme` to install custom one as default initially
166
+
167
+ ```json
168
+ {
169
+ "name": "myCustomTheme",
170
+ "componentAStyles": {
171
+ "style": "value"
172
+ }
173
+ }
174
+ ```
175
+
176
+ ```tsx
177
+ import { ThemeProvider, defaultTheme } from 'gd-design-library';
178
+ import myCustomTheme from 'PROJECT_PATH/myCustomTheme'; // JSON or any js/ts and similliar with object return
179
+
180
+ const App = () => {
181
+ // In case you want extend default theme, by overwriting only particular components
182
+ const initialTheme = Object.assign({}, defaultTheme, myCustomTheme);
183
+ return (
184
+ <ThemeProvider initialTheme={initialTheme}>
185
+ <YourAppRoutes />
186
+ </ThemeProvider>
187
+ );
188
+ };
189
+ ```
190
+
191
+ You can now use components like this:
162
192
 
163
193
  ```tsx
164
194
  import { Button } from 'gd-design-library';
165
195
 
166
- <Button variant="primary">Click Me</Button>;
196
+ <Button variant="primary">Click me</Button>;
167
197
  ```
168
198
 
169
199
  ---
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@emotion/react/jsx-runtime"),S=require("react"),t=require("../../../utils/helpers.js"),d=S.forwardRef(n=>{const{theme:{stepper:c}={},styles:o={},...r}=n,e=[t.get(c,"default",{}),o];return p.jsx("div",{css:e,...r})}),a=n=>{const{theme:{stepper:c}={},$status:o,...r}=n,e=t.get(c,"separator",{}),s=[t.get(e,"default",{}),t.get(e,o,{})];return p.jsx("div",{css:s,...r})},u=n=>{const{theme:{stepper:c}={},$status:o,...r}=n,e=t.get(c,"step",{}),s=[t.get(e,"default",{}),t.get(e,o,{})];return p.jsx("div",{css:s,...r})},y=n=>{const{theme:{stepper:c}={},$status:o,$validationStatus:r,...e}=n,s=t.get(c,"stepIcon",{}),l=[t.get(s,"default",{}),t.get(s,[o,"default"],{}),t.get(s,[o,r],{})];return p.jsx("div",{css:l,...e})},g=n=>{const{theme:{stepper:c}={},$status:o,$validationStatus:r,...e}=n,s=t.get(c,"stepLabel",{}),l=[t.get(s,"default",{}),t.get(s,o,{}),t.get(s,r,{})];return p.jsx("div",{css:l,...e})};exports.SeparatorStyled=a;exports.StepIconStyled=y;exports.StepLabelStyled=g;exports.StepStyled=u;exports.StepperStyled=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@emotion/react/jsx-runtime"),S=require("react"),t=require("../../../utils/helpers.js"),d=S.forwardRef((n,c)=>{const{theme:{stepper:o}={},styles:r={},...s}=n,e=[t.get(o,"default",{}),r];return p.jsx("div",{css:e,...s})}),a=n=>{const{theme:{stepper:c}={},$status:o,...r}=n,s=t.get(c,"separator",{}),e=[t.get(s,"default",{}),t.get(s,o,{})];return p.jsx("div",{css:e,...r})},u=n=>{const{theme:{stepper:c}={},$status:o,...r}=n,s=t.get(c,"step",{}),e=[t.get(s,"default",{}),t.get(s,o,{})];return p.jsx("div",{css:e,...r})},y=n=>{const{theme:{stepper:c}={},$status:o,$validationStatus:r,...s}=n,e=t.get(c,"stepIcon",{}),l=[t.get(e,"default",{}),t.get(e,[o,"default"],{}),t.get(e,[o,r],{})];return p.jsx("div",{css:l,...s})},g=n=>{const{theme:{stepper:c}={},$status:o,$validationStatus:r,...s}=n,e=t.get(c,"stepLabel",{}),l=[t.get(e,"default",{}),t.get(e,o,{}),t.get(e,r,{})];return p.jsx("div",{css:l,...s})};exports.SeparatorStyled=a;exports.StepIconStyled=y;exports.StepLabelStyled=g;exports.StepStyled=u;exports.StepperStyled=d;
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "gd-design-library",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "license": "MIT",
5
- "main": "./index.cjs.js",
5
+ "main": "./index.js",
6
6
  "types": "./index.d.ts",
7
7
  "module": "./index.js",
8
8
  "peerDependencies": {
9
- "react": "^18.0.0 || ^19.0.0",
10
- "react-dom": "^18.0.0 || ^19.0.0",
11
9
  "@emotion/react": "^11.14.0",
12
10
  "@emotion/styled": "^11.14.0",
11
+ "react": "^18.0.0 || ^19.0.0",
12
+ "react-dom": "^18.0.0 || ^19.0.0"
13
+ },
14
+ "dependencies": {
13
15
  "embla-carousel-react": "^8.6.0",
14
16
  "uuid": "^11.1.0"
15
17
  },
16
- "dependencies": {},
17
18
  "devDependencies": {
18
19
  "@emotion/react": "^11.14.0",
19
20
  "@emotion/styled": "^11.14.0"