@agility/plenum-ui 2.0.0-rc2 → 2.0.0-rc21
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 +41 -11
- package/build.js +30 -25
- package/dist/index.d.ts +279 -93
- package/dist/index.js +1 -5935
- package/dist/index.js.map +4 -4
- package/dist/tailwind.css +63516 -0
- package/dist/types/stories/atoms/buttons/Button/Alternative/Alternative.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Button/Button.d.ts +7 -9
- package/dist/types/stories/atoms/buttons/Button/Danger/Danger.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Button/Primary/Primary.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Button/Secondary/Secondary.stories.d.ts +1 -0
- package/dist/types/stories/atoms/buttons/Capsule/Capsule.d.ts +1 -1
- package/dist/types/stories/atoms/icons/DynamicIcon.d.ts +1 -1
- package/dist/types/stories/atoms/icons/TablerIcon.d.ts +1 -1
- package/dist/types/stories/index.d.ts +4 -4
- package/dist/types/stories/molecules/index.d.ts +3 -3
- package/dist/types/stories/molecules/inputs/InputCounter/InputCounter.d.ts +10 -0
- package/dist/types/stories/molecules/inputs/InputCounter/index.d.ts +2 -0
- package/dist/types/stories/molecules/inputs/InputField/InputField.d.ts +8 -4
- package/dist/types/stories/molecules/inputs/TextInput/TextInput.d.ts +39 -0
- package/dist/types/stories/molecules/inputs/TextInput/index.d.ts +4 -0
- package/dist/types/stories/molecules/inputs/index.d.ts +5 -4
- package/dist/types/stories/molecules/inputs/select/Select.d.ts +2 -2
- package/dist/types/stories/molecules/inputs/textArea/TextArea.d.ts +34 -21
- package/dist/types/stories/molecules/inputs/textArea/TextArea.stories.d.ts +4 -4
- package/dist/types/stories/molecules/inputs/textArea/index.d.ts +3 -3
- package/dist/types/stories/molecules/inputs/toggleSwitch/ToggleSwitch.d.ts +9 -7
- package/dist/types/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.d.ts +3 -5
- package/dist/types/stories/organisms/AnimatedLabelInput/index.d.ts +1 -1
- package/dist/types/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.d.ts +12 -0
- package/dist/types/stories/organisms/AnimatedLabelTextArea/index.d.ts +3 -0
- package/dist/types/stories/organisms/DropdownComponent/DropdownComponent.d.ts +18 -15
- package/dist/types/stories/organisms/DropdownComponent/index.d.ts +2 -2
- package/dist/types/stories/organisms/EmptySectionPlaceholder/index.d.ts +1 -1
- package/dist/types/stories/organisms/TextInputSelect/InputSelect.d.ts +16 -0
- package/dist/types/stories/organisms/TextInputSelect/TextInputSelect.d.ts +48 -0
- package/dist/types/stories/organisms/TextInputSelect/index.d.ts +3 -0
- package/dist/types/stories/organisms/index.d.ts +5 -3
- package/local.sh +100 -0
- package/package.json +35 -18
- package/rollup.config.mjs +42 -0
- package/stories/Introduction.mdx +1 -1
- package/stories/atoms/buttons/Button/Alternative/Alternative.stories.ts +7 -0
- package/stories/atoms/buttons/Button/Button.tsx +45 -17
- package/stories/atoms/buttons/Button/Danger/Danger.stories.ts +7 -0
- package/stories/atoms/buttons/Button/Primary/Primary.stories.ts +7 -0
- package/stories/atoms/buttons/Button/Secondary/Secondary.stories.ts +7 -0
- package/stories/atoms/buttons/Capsule/Capsule.tsx +2 -1
- package/stories/atoms/icons/DynamicIcon.tsx +3 -2
- package/stories/atoms/icons/TablerIcon.tsx +1 -1
- package/stories/atoms/loaders/Loader.tsx +12 -6
- package/stories/index.ts +22 -10
- package/stories/molecules/index.ts +22 -6
- package/stories/molecules/inputs/InputCounter/InputCounter.stories.tsx +18 -0
- package/stories/molecules/inputs/InputCounter/InputCounter.tsx +24 -0
- package/stories/molecules/inputs/InputCounter/index.tsx +3 -0
- package/stories/molecules/inputs/InputField/InputField.tsx +13 -7
- package/stories/molecules/inputs/TextInput/TextInput.stories.tsx +32 -0
- package/stories/molecules/inputs/TextInput/TextInput.tsx +165 -0
- package/stories/molecules/inputs/TextInput/index.tsx +5 -0
- package/stories/molecules/inputs/checkbox/Checkbox.tsx +1 -1
- package/stories/molecules/inputs/index.ts +18 -4
- package/stories/molecules/inputs/select/Select.tsx +1 -1
- package/stories/molecules/inputs/textArea/TextArea.stories.ts +7 -5
- package/stories/molecules/inputs/textArea/TextArea.tsx +139 -48
- package/stories/molecules/inputs/textArea/index.ts +3 -3
- package/stories/molecules/inputs/toggleSwitch/ToggleSwitch.tsx +61 -57
- package/stories/molecules/tabs/index.tsx +2 -3
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.stories.tsx +10 -1
- package/stories/organisms/AnimatedLabelInput/AnimatedLabelInput.tsx +43 -37
- package/stories/organisms/AnimatedLabelInput/index.tsx +1 -1
- package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.stories.tsx +26 -0
- package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.tsx +61 -0
- package/stories/organisms/AnimatedLabelTextArea/index.tsx +3 -0
- package/stories/organisms/ButtonDropdown/ButtonDropdown.stories.tsx +59 -58
- package/stories/organisms/ButtonDropdown/ButtonDropdown.tsx +13 -16
- package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +1 -1
- package/stories/organisms/DropdownComponent/DropdownComponent.tsx +155 -131
- package/stories/organisms/DropdownComponent/dropdownItems.ts +32 -8
- package/stories/organisms/DropdownComponent/index.ts +2 -2
- package/stories/organisms/EmptySectionPlaceholder/index.tsx +2 -1
- package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +7 -2
- package/stories/organisms/TextInputSelect/InputSelect.tsx +59 -0
- package/stories/organisms/TextInputSelect/TextInputSelect.stories.tsx +33 -0
- package/stories/organisms/TextInputSelect/TextInputSelect.tsx +186 -0
- package/stories/organisms/TextInputSelect/index.tsx +3 -0
- package/stories/organisms/index.ts +15 -4
- package/tsconfig.lib.json +13 -6
- package/watch.js +50 -0
- package/.yarnrc.yml +0 -1
- package/dist/types/stories/layouts/index.d.ts +0 -0
- package/stories/layouts/CardLayout/CardLayout.stories.tsx +0 -18
- package/stories/layouts/CardLayout/CardLayout.tsx +0 -22
- package/stories/layouts/CardLayout/index.tsx +0 -3
- package/stories/layouts/ModalLayout/ModalLayout.stories.tsx +0 -18
- package/stories/layouts/ModalLayout/ModalLayout.tsx +0 -22
- package/stories/layouts/ModalLayout/index.tsx +0 -3
- package/stories/layouts/index.ts +0 -0
- package/stories/organisms/DropdownComponent/Dropdown.test.tsx +0 -0
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ In your app entry point (i.e. \`_app.tsx\`), import the \`globals.css\` file fro
|
|
|
27
27
|
|
|
28
28
|
```jsx
|
|
29
29
|
import "<RELATIVE_PATH>/globals.css";
|
|
30
|
-
import "@agility/plenum-ui/lib/tailwind.css";
|
|
30
|
+
import "@agility/plenum-ui/dist/lib/tailwind.css";
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
Make sure to add any additional styles before these two import statements to prevent overwriting the Plenum styling.
|
|
@@ -58,7 +58,8 @@ import { Component } from '@agility/plenum-ui';
|
|
|
58
58
|
|
|
59
59
|
### Development and Build Scripts
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
|
|
62
|
+
#### Run your development server with Storybook:
|
|
62
63
|
|
|
63
64
|
```bash
|
|
64
65
|
npm run dev
|
|
@@ -66,7 +67,7 @@ npm run dev
|
|
|
66
67
|
yarn dev
|
|
67
68
|
```
|
|
68
69
|
|
|
69
|
-
Build your project:
|
|
70
|
+
#### Build your project:
|
|
70
71
|
|
|
71
72
|
```bash
|
|
72
73
|
npm run build
|
|
@@ -74,7 +75,36 @@ npm run build
|
|
|
74
75
|
yarn build
|
|
75
76
|
```
|
|
76
77
|
|
|
77
|
-
|
|
78
|
+
### Build your project locally and watch for changes
|
|
79
|
+
This will create symlinks for the current project and its necessary dependencies, so that it can be connected to other projects.
|
|
80
|
+
It will also start the watch server, so it will automatically rebuild on any local changes.
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
yarn start:local
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
#### Use yarn link to locally test the library in another project:
|
|
87
|
+
|
|
88
|
+
In the Plenum project directory after having run a build, run:
|
|
89
|
+
```bash
|
|
90
|
+
yarn link.
|
|
91
|
+
```
|
|
92
|
+
You should see the following in your terminal:
|
|
93
|
+
```bash
|
|
94
|
+
yarn link v1.22.10
|
|
95
|
+
success Registered "@agility/plenum-ui".
|
|
96
|
+
```
|
|
97
|
+
You can now run
|
|
98
|
+
```bash
|
|
99
|
+
yarn link "@agility/plenum-ui"
|
|
100
|
+
```
|
|
101
|
+
in the projects where you want to consume this package and it will be used instead. It should output a message like
|
|
102
|
+
```bash
|
|
103
|
+
yarn link v1.22.10
|
|
104
|
+
success Using linked package for "@agility/plenum-ui".
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
#### Clean the \`dist\` directory:
|
|
78
108
|
|
|
79
109
|
```bash
|
|
80
110
|
npm run clean
|
|
@@ -82,7 +112,7 @@ npm run clean
|
|
|
82
112
|
yarn clean
|
|
83
113
|
```
|
|
84
114
|
|
|
85
|
-
Lint your project:
|
|
115
|
+
#### Lint your project:
|
|
86
116
|
|
|
87
117
|
```bash
|
|
88
118
|
npm run lint
|
|
@@ -90,7 +120,7 @@ npm run lint
|
|
|
90
120
|
yarn lint
|
|
91
121
|
```
|
|
92
122
|
|
|
93
|
-
Build Tailwind CSS:
|
|
123
|
+
#### Build Tailwind CSS:
|
|
94
124
|
|
|
95
125
|
```bash
|
|
96
126
|
npm run build:tw
|
|
@@ -100,7 +130,7 @@ yarn build:tw
|
|
|
100
130
|
|
|
101
131
|
### Storybook Scripts
|
|
102
132
|
|
|
103
|
-
Build your Storybook:
|
|
133
|
+
#### Build your Storybook:
|
|
104
134
|
|
|
105
135
|
```bash
|
|
106
136
|
npm run build-storybook
|
|
@@ -108,7 +138,7 @@ npm run build-storybook
|
|
|
108
138
|
yarn build-storybook
|
|
109
139
|
```
|
|
110
140
|
|
|
111
|
-
Run your Storybook in development mode:
|
|
141
|
+
#### Run your Storybook in development mode:
|
|
112
142
|
|
|
113
143
|
```bash
|
|
114
144
|
npm run storybook:dev
|
|
@@ -116,7 +146,7 @@ npm run storybook:dev
|
|
|
116
146
|
yarn storybook:dev
|
|
117
147
|
```
|
|
118
148
|
|
|
119
|
-
Generate Tailwind CSS for Storybook and watch for changes:
|
|
149
|
+
#### Generate Tailwind CSS for Storybook and watch for changes:
|
|
120
150
|
|
|
121
151
|
```bash
|
|
122
152
|
npm run storybook:tw
|
|
@@ -124,7 +154,7 @@ npm run storybook:tw
|
|
|
124
154
|
yarn storybook:tw
|
|
125
155
|
```
|
|
126
156
|
|
|
127
|
-
Build specific parts of Storybook:
|
|
157
|
+
#### Build specific parts of Storybook:
|
|
128
158
|
|
|
129
159
|
```bash
|
|
130
160
|
# Build Storybook
|
|
@@ -138,7 +168,7 @@ npm run sb-build:tw
|
|
|
138
168
|
yarn sb-build:tw
|
|
139
169
|
```
|
|
140
170
|
|
|
141
|
-
Compile TypeScript files using custom build script:
|
|
171
|
+
#### Compile TypeScript files using custom build script:
|
|
142
172
|
|
|
143
173
|
```bash
|
|
144
174
|
npm run build:tsc
|
package/build.js
CHANGED
|
@@ -12,30 +12,35 @@ new Generator({
|
|
|
12
12
|
// Run TypeScript to generate type declarations using the new tsconfig.lib.json
|
|
13
13
|
execSync("tsc --emitDeclarationOnly --project tsconfig.lib.json", { stdio: "inherit" })
|
|
14
14
|
|
|
15
|
+
const context = {
|
|
16
|
+
logLevel: "info",
|
|
17
|
+
entryPoints: [path.resolve(__dirname, "stories/index.ts")],
|
|
18
|
+
|
|
19
|
+
bundle: true,
|
|
20
|
+
platform: "browser",
|
|
21
|
+
target: ["esnext"],
|
|
22
|
+
minify: true,
|
|
23
|
+
pure: ["React.createElement"],
|
|
24
|
+
jsx: 'transform',
|
|
25
|
+
loader: { '.js': 'jsx' },
|
|
26
|
+
outdir: path.resolve(__dirname, "dist"),
|
|
27
|
+
sourcemap: true,
|
|
28
|
+
external: [
|
|
29
|
+
"react",
|
|
30
|
+
"react-dom",
|
|
31
|
+
"@floating-ui/react",
|
|
32
|
+
"@headlessui/react",
|
|
33
|
+
"@headlessui/tailwindcss",
|
|
34
|
+
"@heroicons/react",
|
|
35
|
+
"@tabler/icons",
|
|
36
|
+
"@tabler/icons-react",
|
|
37
|
+
"classnames",
|
|
38
|
+
"react-icons"
|
|
39
|
+
],
|
|
40
|
+
format: "esm"
|
|
41
|
+
}
|
|
42
|
+
|
|
15
43
|
// Build script using esbuild
|
|
16
44
|
esbuild
|
|
17
|
-
.build(
|
|
18
|
-
|
|
19
|
-
bundle: true,
|
|
20
|
-
platform: "browser",
|
|
21
|
-
target: ["es6"],
|
|
22
|
-
//HACK outfile: "dist/index.js,"
|
|
23
|
-
outdir: path.resolve(__dirname, "dist"),
|
|
24
|
-
sourcemap: true,
|
|
25
|
-
external: [
|
|
26
|
-
"react",
|
|
27
|
-
"react-dom",
|
|
28
|
-
"@floating-ui/react",
|
|
29
|
-
"@headlessui/react",
|
|
30
|
-
"@headlessui/tailwindcss",
|
|
31
|
-
"@heroicons/react",
|
|
32
|
-
"@tabler/icons",
|
|
33
|
-
"@tabler/icons-react",
|
|
34
|
-
"classnames",
|
|
35
|
-
"react",
|
|
36
|
-
"react-dom",
|
|
37
|
-
"react-icons"
|
|
38
|
-
],
|
|
39
|
-
format: "esm"
|
|
40
|
-
})
|
|
41
|
-
.catch(() => process.exit(1))
|
|
45
|
+
.build(context)
|
|
46
|
+
.catch(() => process.exit(1))
|