@agility/plenum-ui 2.0.0-rc47 → 2.0.0-rc49

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.
Files changed (141) hide show
  1. package/.eslintrc.json +6 -6
  2. package/.prettierrc +13 -13
  3. package/.storybook/Layout.jsx +12 -12
  4. package/.storybook/head.tsx +4 -4
  5. package/.storybook/main.ts +18 -18
  6. package/.storybook/manager-head.html +1 -1
  7. package/.storybook/manager.ts +25 -25
  8. package/.storybook/plenumTheme.ts +8 -8
  9. package/.storybook/preview-head.html +3 -3
  10. package/.storybook/preview.tsx +28 -28
  11. package/.vscode/settings.json +3 -3
  12. package/README.md +271 -271
  13. package/app/globals.css +99 -99
  14. package/app/head.tsx +59 -59
  15. package/app/layout.tsx +28 -28
  16. package/app/page.tsx +7 -7
  17. package/build.js +45 -45
  18. package/dist/index.d.ts +232 -230
  19. package/dist/index.js +1 -1
  20. package/dist/index.js.map +3 -3
  21. package/dist/types/stories/molecules/inputs/select/Select.d.ts +2 -0
  22. package/local.sh +100 -100
  23. package/next.config.js +8 -8
  24. package/package.json +82 -82
  25. package/pages/api/hello.ts +13 -13
  26. package/postcss.config.js +6 -6
  27. package/rollup.config.mjs +41 -41
  28. package/scripts/create-component.js +97 -97
  29. package/stories/Introduction.mdx +314 -314
  30. package/stories/assets/stackalt.svg +1 -1
  31. package/stories/atoms/Avatar/Avatar.stories.tsx +96 -96
  32. package/stories/atoms/Avatar/Avatar.tsx +123 -123
  33. package/stories/atoms/Avatar/index.ts +3 -3
  34. package/stories/atoms/badges/Badge.tsx +127 -127
  35. package/stories/atoms/badges/Pill/Pill.stories.tsx +75 -75
  36. package/stories/atoms/badges/Rounded/Rounded.stories.tsx +75 -75
  37. package/stories/atoms/badges/index.ts +3 -3
  38. package/stories/atoms/buttons/Button/Alternative/Alternative.stories.ts +86 -86
  39. package/stories/atoms/buttons/Button/Button.tsx +232 -232
  40. package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +90 -90
  41. package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +97 -97
  42. package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +93 -93
  43. package/stories/atoms/buttons/Button/defaultArgs.ts +9 -9
  44. package/stories/atoms/buttons/Button/index.ts +3 -3
  45. package/stories/atoms/buttons/Capsule/Alternative/Alternative.stories.ts +27 -27
  46. package/stories/atoms/buttons/Capsule/Capsule.tsx +88 -88
  47. package/stories/atoms/buttons/Capsule/Danger/Danger.stories.ts +27 -27
  48. package/stories/atoms/buttons/Capsule/Primary/Primary.stories.ts +27 -27
  49. package/stories/atoms/buttons/Capsule/Secondary/Secondary.stories.ts +27 -27
  50. package/stories/atoms/buttons/Capsule/index.ts +3 -3
  51. package/stories/atoms/buttons/FloatingActionButton/FloatingActionButton.stories.tsx +15 -15
  52. package/stories/atoms/buttons/FloatingActionButton/FloatingActionButton.tsx +22 -22
  53. package/stories/atoms/buttons/FloatingActionButton/index.tsx +3 -3
  54. package/stories/atoms/buttons/index.ts +4 -4
  55. package/stories/atoms/crumb/Crumb.stories.tsx +18 -18
  56. package/stories/atoms/crumb/Crumb.tsx +22 -22
  57. package/stories/atoms/crumb/index.tsx +3 -3
  58. package/stories/atoms/icons/DynamicIcon.stories.ts +43 -43
  59. package/stories/atoms/icons/DynamicIcon.tsx +90 -90
  60. package/stories/atoms/icons/IconWithShadow.stories.ts +43 -43
  61. package/stories/atoms/icons/IconWithShadow.tsx +16 -16
  62. package/stories/atoms/icons/TablerIcon.tsx +22 -22
  63. package/stories/atoms/icons/index.tsx +14 -14
  64. package/stories/atoms/icons/tablerIconNames.ts +4336 -4336
  65. package/stories/atoms/index.ts +46 -46
  66. package/stories/atoms/loaders/Loader.stories.ts +15 -15
  67. package/stories/atoms/loaders/Loader.tsx +21 -21
  68. package/stories/atoms/loaders/NProgress/RadialProgress.stories.tsx +19 -19
  69. package/stories/atoms/loaders/NProgress/RadialProgress.tsx +74 -74
  70. package/stories/atoms/loaders/NProgress/index.ts +3 -3
  71. package/stories/atoms/loaders/index.ts +4 -4
  72. package/stories/index.ts +136 -136
  73. package/stories/molecules/index.ts +51 -51
  74. package/stories/molecules/inputs/InputCounter/InputCounter.stories.tsx +18 -18
  75. package/stories/molecules/inputs/InputCounter/InputCounter.tsx +24 -24
  76. package/stories/molecules/inputs/InputCounter/index.tsx +3 -3
  77. package/stories/molecules/inputs/InputField/InputField.stories.tsx +29 -29
  78. package/stories/molecules/inputs/InputField/InputField.tsx +96 -96
  79. package/stories/molecules/inputs/InputField/index.tsx +3 -3
  80. package/stories/molecules/inputs/InputLabel/InputLabel.stories.tsx +19 -19
  81. package/stories/molecules/inputs/InputLabel/InputLabel.tsx +45 -45
  82. package/stories/molecules/inputs/InputLabel/index.tsx +3 -3
  83. package/stories/molecules/inputs/NestedInputButton/NestedInputButton.stories.tsx +52 -52
  84. package/stories/molecules/inputs/NestedInputButton/NestedInputButton.tsx +64 -64
  85. package/stories/molecules/inputs/NestedInputButton/index.tsx +3 -3
  86. package/stories/molecules/inputs/TextInput/TextInput.stories.tsx +32 -32
  87. package/stories/molecules/inputs/TextInput/TextInput.tsx +165 -165
  88. package/stories/molecules/inputs/TextInput/index.tsx +5 -5
  89. package/stories/molecules/inputs/checkbox/Checkbox.stories.ts +23 -23
  90. package/stories/molecules/inputs/checkbox/Checkbox.tsx +98 -98
  91. package/stories/molecules/inputs/checkbox/index.ts +3 -3
  92. package/stories/molecules/inputs/combobox/ComboBox.stories.ts +41 -41
  93. package/stories/molecules/inputs/combobox/ComboBox.tsx +185 -185
  94. package/stories/molecules/inputs/combobox/index.ts +3 -3
  95. package/stories/molecules/inputs/index.ts +38 -38
  96. package/stories/molecules/inputs/radio/Radio.stories.ts +27 -27
  97. package/stories/molecules/inputs/radio/Radio.tsx +92 -92
  98. package/stories/molecules/inputs/radio/index.ts +3 -3
  99. package/stories/molecules/inputs/select/Select.stories.ts +23 -23
  100. package/stories/molecules/inputs/select/Select.tsx +108 -100
  101. package/stories/molecules/inputs/select/index.ts +3 -3
  102. package/stories/molecules/inputs/textArea/TextArea.stories.ts +22 -22
  103. package/stories/molecules/inputs/textArea/TextArea.tsx +158 -158
  104. package/stories/molecules/inputs/textArea/index.ts +3 -3
  105. package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.stories.tsx +118 -118
  106. package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx +81 -81
  107. package/stories/molecules/inputs/toggleSwitch/index.ts +3 -3
  108. package/stories/molecules/tabs/Tabs.stories.tsx +18 -18
  109. package/stories/molecules/tabs/Tabs.tsx +22 -22
  110. package/stories/molecules/tabs/index.tsx +2 -2
  111. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +30 -30
  112. package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +66 -66
  113. package/stories/organisms/AnimatedLabelInput/index.tsx +3 -3
  114. package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.stories.tsx +26 -26
  115. package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.tsx +61 -61
  116. package/stories/organisms/AnimatedLabelTextArea/index.tsx +3 -3
  117. package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +125 -125
  118. package/stories/organisms/ButtonDropdown/ButtonDropdown.tsx +86 -86
  119. package/stories/organisms/ButtonDropdown/index.tsx +3 -3
  120. package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +73 -73
  121. package/stories/organisms/DropdownComponent/DropdownComponent.tsx +346 -346
  122. package/stories/organisms/DropdownComponent/dropdownItems.ts +122 -122
  123. package/stories/organisms/DropdownComponent/index.ts +4 -4
  124. package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.stories.tsx +76 -76
  125. package/stories/organisms/EmptySectionPlaceholder/EmptySectionPlaceholder.tsx +52 -52
  126. package/stories/organisms/EmptySectionPlaceholder/index.tsx +4 -4
  127. package/stories/organisms/FormInputWithAddons/FormInputWithAddons.stories.tsx +29 -29
  128. package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +145 -145
  129. package/stories/organisms/FormInputWithAddons/index.tsx +3 -3
  130. package/stories/organisms/TextInputSelect/InputSelect.tsx +59 -59
  131. package/stories/organisms/TextInputSelect/TextInputSelect.stories.tsx +33 -33
  132. package/stories/organisms/TextInputSelect/TextInputSelect.tsx +186 -186
  133. package/stories/organisms/TextInputSelect/index.tsx +3 -3
  134. package/stories/organisms/index.ts +27 -27
  135. package/tailwind.config.js +192 -192
  136. package/tsconfig.json +29 -29
  137. package/tsconfig.lib.json +25 -25
  138. package/utils/types.d.ts +2 -2
  139. package/utils/types.ts +3 -3
  140. package/utils/useId.d.ts +1 -1
  141. package/utils/useId.tsx +16 -16
package/README.md CHANGED
@@ -1,271 +1,271 @@
1
- [![Agility Yellow Triangle Logo withe gray text reading Agility to the right of the triangle](https://cdn.agilitycms.com/content-manager/images/logos/agility-logo-storybook-350.png)](https://agilitycms.com/)
2
-
3
- # Agility Plenum UI Library
4
-
5
- Welcome to Plenum, the definitive UI library for working within the [Agility CMS](https://www.agilitycms.com/) ecosystem. Built with [Next.js 13](https://nextjs.org/) and [Storybook 7.1](https://storybook.js.org/), Plenum is a comprehensive collection of components and patterns designed for building user interfaces in Agility CMS, as well as your own applications within the Agility CMS ecosystem.
6
-
7
- ## Building for the Agility Marketplace
8
-
9
- The Plenum library is designed to encourage and facilitate building applications for the Agility CMS Marketplace. Use the rich selection of components and patterns to build consistent, robust, and user-friendly applications for the Agility ecosystem.
10
-
11
- Contributions to extend and improve this library are welcome! Feel free to fork the repository and submit pull requests.
12
-
13
- ## Features
14
-
15
- - Comprehensive UI components library, designed for versatility and consistency.
16
- - Built with modern technologies like Next.js 13 and Storybook 7.1.
17
- - Includes automation scripts for efficient component creation.
18
- - Adopts Tailwind CSS for utility-first styling.
19
- - Easy to use, install, and integrate into your project.
20
-
21
- ## Prerequisites
22
-
23
- Before you begin, ensure that Tailwind CSS is installed in your project. Follow the instructions here: [Install Tailwind CSS with Next.js](https://tailwindcss.com/docs/guides/nextjs)
24
-
25
- In your app entry point (i.e. \`\_app.tsx\`), import the \`globals.css\` file from the previous step, and the \`tailwind.css\` file from Plenum:
26
-
27
- ```jsx
28
- import "<RELATIVE_PATH>/globals.css"
29
- import "@agility/plenum-ui/dist/lib/tailwind.css"
30
- ```
31
-
32
- Make sure to add any additional styles before these two import statements to prevent overwriting the Plenum styling.
33
-
34
- ## Installation
35
-
36
- You can install the Plenum library using npm or yarn:
37
-
38
- ```bash
39
- # Using npm:
40
- npm install @agility/plenum-ui
41
-
42
- # Using yarn:
43
- yarn add @agility/plenum-ui
44
- ```
45
-
46
- ## Usage
47
-
48
- Import and use the Plenum components in your React components:
49
-
50
- ```jsx
51
- import { Component } from "@agility/plenum-ui"
52
- ;<Component {...{ ComponentProps }} />
53
- ```
54
-
55
- ## Scripts
56
-
57
- ### Development and Build Scripts
58
-
59
- #### Run your development server with Storybook:
60
-
61
- ```bash
62
- npm run dev
63
- # or
64
- yarn dev
65
- ```
66
-
67
- #### Build your project:
68
-
69
- ```bash
70
- npm run build
71
- # or
72
- yarn build
73
- ```
74
-
75
- ### Build your project locally and watch for changes
76
-
77
- This will create symlinks for the current project and its necessary dependencies, so that it can be connected to other projects.
78
- It will also start the watch server, so it will automatically rebuild on any local changes.
79
-
80
- ```
81
- yarn start:local
82
- ```
83
-
84
- #### Use yarn link to locally test the library in another project:
85
-
86
- In the Plenum project directory after having run a build, run:
87
-
88
- ```bash
89
- yarn link.
90
- ```
91
-
92
- You should see the following in your terminal:
93
-
94
- ```bash
95
- yarn link v1.22.10
96
- success Registered "@agility/plenum-ui".
97
- ```
98
-
99
- You can now run
100
-
101
- ```bash
102
- yarn link "@agility/plenum-ui"
103
- ```
104
-
105
- in the projects where you want to consume this package and it will be used instead. It should output a message like
106
-
107
- ```bash
108
- yarn link v1.22.10
109
- success Using linked package for "@agility/plenum-ui".
110
- ```
111
-
112
- #### Clean the \`dist\` directory:
113
-
114
- ```bash
115
- npm run clean
116
- # or
117
- yarn clean
118
- ```
119
-
120
- #### Lint your project:
121
-
122
- ```bash
123
- npm run lint
124
- # or
125
- yarn lint
126
- ```
127
-
128
- #### Build Tailwind CSS:
129
-
130
- ```bash
131
- npm run build:tw
132
- # or
133
- yarn build:tw
134
- ```
135
-
136
- ### Storybook Scripts
137
-
138
- #### Build your Storybook:
139
-
140
- ```bash
141
- npm run build-storybook
142
- # or
143
- yarn build-storybook
144
- ```
145
-
146
- #### Run your Storybook in development mode:
147
-
148
- ```bash
149
- npm run storybook:dev
150
- # or
151
- yarn storybook:dev
152
- ```
153
-
154
- #### Generate Tailwind CSS for Storybook and watch for changes:
155
-
156
- ```bash
157
- npm run storybook:tw
158
- # or
159
- yarn storybook:tw
160
- ```
161
-
162
- #### Build specific parts of Storybook:
163
-
164
- ```bash
165
- # Build Storybook
166
- npm run sb-build:storybook
167
- # or
168
- yarn sb-build:storybook
169
-
170
- # Build Tailwind CSS for Storybook
171
- npm run sb-build:tw
172
- # or
173
- yarn sb-build:tw
174
- ```
175
-
176
- #### Compile TypeScript files using custom build script:
177
-
178
- ```bash
179
- npm run build:tsc
180
- # or
181
- yarn build:tsc
182
- ```
183
-
184
- These scripts cover various tasks related to development, build processes, linting, and handling specific aspects like Storybook and Tailwind CSS. Make sure to run the appropriate script for the task you want to perform.
185
-
186
- ### Component Generation Script
187
-
188
- We have a Node.js script that automates the creation of new components for our Storybook library. This script generates a component directory, along with the necessary files like \`Component.tsx\`, \`Component.stories.tsx\`, and \`index.tsx\`.
189
-
190
- #### How to use the script
191
-
192
- To use the script, you should have Node.js installed. From the terminal, you can create a new component by running the following command:
193
-
194
- ```bash
195
- node create-component.js ComponentName DestinationDirectory
196
- ```
197
-
198
- This command takes two arguments:
199
-
200
- - \`ComponentName\` - The name of the new component you want to create. This should be in PascalCase (for example, "MyComponent").
201
- - \`DestinationDirectory\` - The directory where the new component will be created. This should be relative to the 'stories' directory. (for example, "atoms" or "Molecules").
202
-
203
- The script will create a new directory with the given component name inside the specified destination directory (under the 'stories' directory). Then, it will generate three files in the new directory:
204
-
205
- - \`ComponentName.tsx\` - This is the component file. It contains a basic React functional component structure.
206
- - \`ComponentName.stories.tsx\` - This is the Storybook story file. It sets up a basic story for the new component.
207
- - \`index.tsx\` - This file simply exports the new component. It's used for cleaner imports.
208
-
209
- #### Example
210
-
211
- To create a new component named "Button" in the "atoms" directory, you would run:
212
-
213
- ```bash
214
- node create-component.js Button atoms
215
- ```
216
-
217
- This would create a directory structure like:
218
-
219
- ```
220
- - stories
221
- - atoms
222
- - Button
223
- - Button.tsx
224
- - Button.stories.tsx
225
- - index.tsx
226
- ```
227
-
228
- Each of the generated files will contain basic boilerplate code that you can start with.
229
-
230
- ##### Notes
231
-
232
- This script does prompt the user before overwriting existing directories, so you can run it with confidence. Always use PascalCase for component names, and ensure the destination directory exists or can be created. If you encounter any issues, you can create the component and its files manually
233
-
234
- ## Advanced
235
-
236
- Old School Yarn Link Instructions :)
237
-
238
- ```
239
- cd THIS_PACKAGE
240
- yarn link
241
- yarn install
242
- cd node_modules/react
243
- yarn link
244
- cd ../../node_modules/react-dom
245
- yarn link
246
- cd YOUR_PROJECT
247
- yarn link PACKAGE_YOU_DEBUG_LOCALLY
248
- yarn link react
249
- yarn link react-dom
250
- ```
251
-
252
- Then, when you are done
253
-
254
- ```
255
- cd YOUR_PROJECT
256
- yarn unlink "@agility/plenum-ui"
257
- yarn unlink react
258
- yarn link react-dom
259
-
260
- cd THIS_PACKAGE
261
- yarn unlink
262
- cd node_modules/react
263
- yarn unlink
264
- cd ../../node_modules/react-dom
265
- yarn unlink
266
-
267
- ```
268
-
269
- ```
270
-
271
- ```
1
+ [![Agility Yellow Triangle Logo withe gray text reading Agility to the right of the triangle](https://cdn.agilitycms.com/content-manager/images/logos/agility-logo-storybook-350.png)](https://agilitycms.com/)
2
+
3
+ # Agility Plenum UI Library
4
+
5
+ Welcome to Plenum, the definitive UI library for working within the [Agility CMS](https://www.agilitycms.com/) ecosystem. Built with [Next.js 13](https://nextjs.org/) and [Storybook 7.1](https://storybook.js.org/), Plenum is a comprehensive collection of components and patterns designed for building user interfaces in Agility CMS, as well as your own applications within the Agility CMS ecosystem.
6
+
7
+ ## Building for the Agility Marketplace
8
+
9
+ The Plenum library is designed to encourage and facilitate building applications for the Agility CMS Marketplace. Use the rich selection of components and patterns to build consistent, robust, and user-friendly applications for the Agility ecosystem.
10
+
11
+ Contributions to extend and improve this library are welcome! Feel free to fork the repository and submit pull requests.
12
+
13
+ ## Features
14
+
15
+ - Comprehensive UI components library, designed for versatility and consistency.
16
+ - Built with modern technologies like Next.js 13 and Storybook 7.1.
17
+ - Includes automation scripts for efficient component creation.
18
+ - Adopts Tailwind CSS for utility-first styling.
19
+ - Easy to use, install, and integrate into your project.
20
+
21
+ ## Prerequisites
22
+
23
+ Before you begin, ensure that Tailwind CSS is installed in your project. Follow the instructions here: [Install Tailwind CSS with Next.js](https://tailwindcss.com/docs/guides/nextjs)
24
+
25
+ In your app entry point (i.e. \`\_app.tsx\`), import the \`globals.css\` file from the previous step, and the \`tailwind.css\` file from Plenum:
26
+
27
+ ```jsx
28
+ import "<RELATIVE_PATH>/globals.css"
29
+ import "@agility/plenum-ui/dist/lib/tailwind.css"
30
+ ```
31
+
32
+ Make sure to add any additional styles before these two import statements to prevent overwriting the Plenum styling.
33
+
34
+ ## Installation
35
+
36
+ You can install the Plenum library using npm or yarn:
37
+
38
+ ```bash
39
+ # Using npm:
40
+ npm install @agility/plenum-ui
41
+
42
+ # Using yarn:
43
+ yarn add @agility/plenum-ui
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ Import and use the Plenum components in your React components:
49
+
50
+ ```jsx
51
+ import { Component } from "@agility/plenum-ui"
52
+ ;<Component {...{ ComponentProps }} />
53
+ ```
54
+
55
+ ## Scripts
56
+
57
+ ### Development and Build Scripts
58
+
59
+ #### Run your development server with Storybook:
60
+
61
+ ```bash
62
+ npm run dev
63
+ # or
64
+ yarn dev
65
+ ```
66
+
67
+ #### Build your project:
68
+
69
+ ```bash
70
+ npm run build
71
+ # or
72
+ yarn build
73
+ ```
74
+
75
+ ### Build your project locally and watch for changes
76
+
77
+ This will create symlinks for the current project and its necessary dependencies, so that it can be connected to other projects.
78
+ It will also start the watch server, so it will automatically rebuild on any local changes.
79
+
80
+ ```
81
+ yarn start:local
82
+ ```
83
+
84
+ #### Use yarn link to locally test the library in another project:
85
+
86
+ In the Plenum project directory after having run a build, run:
87
+
88
+ ```bash
89
+ yarn link.
90
+ ```
91
+
92
+ You should see the following in your terminal:
93
+
94
+ ```bash
95
+ yarn link v1.22.10
96
+ success Registered "@agility/plenum-ui".
97
+ ```
98
+
99
+ You can now run
100
+
101
+ ```bash
102
+ yarn link "@agility/plenum-ui"
103
+ ```
104
+
105
+ in the projects where you want to consume this package and it will be used instead. It should output a message like
106
+
107
+ ```bash
108
+ yarn link v1.22.10
109
+ success Using linked package for "@agility/plenum-ui".
110
+ ```
111
+
112
+ #### Clean the \`dist\` directory:
113
+
114
+ ```bash
115
+ npm run clean
116
+ # or
117
+ yarn clean
118
+ ```
119
+
120
+ #### Lint your project:
121
+
122
+ ```bash
123
+ npm run lint
124
+ # or
125
+ yarn lint
126
+ ```
127
+
128
+ #### Build Tailwind CSS:
129
+
130
+ ```bash
131
+ npm run build:tw
132
+ # or
133
+ yarn build:tw
134
+ ```
135
+
136
+ ### Storybook Scripts
137
+
138
+ #### Build your Storybook:
139
+
140
+ ```bash
141
+ npm run build-storybook
142
+ # or
143
+ yarn build-storybook
144
+ ```
145
+
146
+ #### Run your Storybook in development mode:
147
+
148
+ ```bash
149
+ npm run storybook:dev
150
+ # or
151
+ yarn storybook:dev
152
+ ```
153
+
154
+ #### Generate Tailwind CSS for Storybook and watch for changes:
155
+
156
+ ```bash
157
+ npm run storybook:tw
158
+ # or
159
+ yarn storybook:tw
160
+ ```
161
+
162
+ #### Build specific parts of Storybook:
163
+
164
+ ```bash
165
+ # Build Storybook
166
+ npm run sb-build:storybook
167
+ # or
168
+ yarn sb-build:storybook
169
+
170
+ # Build Tailwind CSS for Storybook
171
+ npm run sb-build:tw
172
+ # or
173
+ yarn sb-build:tw
174
+ ```
175
+
176
+ #### Compile TypeScript files using custom build script:
177
+
178
+ ```bash
179
+ npm run build:tsc
180
+ # or
181
+ yarn build:tsc
182
+ ```
183
+
184
+ These scripts cover various tasks related to development, build processes, linting, and handling specific aspects like Storybook and Tailwind CSS. Make sure to run the appropriate script for the task you want to perform.
185
+
186
+ ### Component Generation Script
187
+
188
+ We have a Node.js script that automates the creation of new components for our Storybook library. This script generates a component directory, along with the necessary files like \`Component.tsx\`, \`Component.stories.tsx\`, and \`index.tsx\`.
189
+
190
+ #### How to use the script
191
+
192
+ To use the script, you should have Node.js installed. From the terminal, you can create a new component by running the following command:
193
+
194
+ ```bash
195
+ node create-component.js ComponentName DestinationDirectory
196
+ ```
197
+
198
+ This command takes two arguments:
199
+
200
+ - \`ComponentName\` - The name of the new component you want to create. This should be in PascalCase (for example, "MyComponent").
201
+ - \`DestinationDirectory\` - The directory where the new component will be created. This should be relative to the 'stories' directory. (for example, "atoms" or "Molecules").
202
+
203
+ The script will create a new directory with the given component name inside the specified destination directory (under the 'stories' directory). Then, it will generate three files in the new directory:
204
+
205
+ - \`ComponentName.tsx\` - This is the component file. It contains a basic React functional component structure.
206
+ - \`ComponentName.stories.tsx\` - This is the Storybook story file. It sets up a basic story for the new component.
207
+ - \`index.tsx\` - This file simply exports the new component. It's used for cleaner imports.
208
+
209
+ #### Example
210
+
211
+ To create a new component named "Button" in the "atoms" directory, you would run:
212
+
213
+ ```bash
214
+ node create-component.js Button atoms
215
+ ```
216
+
217
+ This would create a directory structure like:
218
+
219
+ ```
220
+ - stories
221
+ - atoms
222
+ - Button
223
+ - Button.tsx
224
+ - Button.stories.tsx
225
+ - index.tsx
226
+ ```
227
+
228
+ Each of the generated files will contain basic boilerplate code that you can start with.
229
+
230
+ ##### Notes
231
+
232
+ This script does prompt the user before overwriting existing directories, so you can run it with confidence. Always use PascalCase for component names, and ensure the destination directory exists or can be created. If you encounter any issues, you can create the component and its files manually
233
+
234
+ ## Advanced
235
+
236
+ Old School Yarn Link Instructions :)
237
+
238
+ ```
239
+ cd THIS_PACKAGE
240
+ yarn link
241
+ yarn install
242
+ cd node_modules/react
243
+ yarn link
244
+ cd ../../node_modules/react-dom
245
+ yarn link
246
+ cd YOUR_PROJECT
247
+ yarn link PACKAGE_YOU_DEBUG_LOCALLY
248
+ yarn link react
249
+ yarn link react-dom
250
+ ```
251
+
252
+ Then, when you are done
253
+
254
+ ```
255
+ cd YOUR_PROJECT
256
+ yarn unlink "@agility/plenum-ui"
257
+ yarn unlink react
258
+ yarn link react-dom
259
+
260
+ cd THIS_PACKAGE
261
+ yarn unlink
262
+ cd node_modules/react
263
+ yarn unlink
264
+ cd ../../node_modules/react-dom
265
+ yarn unlink
266
+
267
+ ```
268
+
269
+ ```
270
+
271
+ ```