@agility/plenum-ui 2.0.0-rc17 → 2.0.0-rc19
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 +40 -10
- package/build.js +30 -29
- package/dist/index.d.ts +7 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +3 -3
- package/dist/tailwind.css +0 -41
- package/dist/types/stories/molecules/inputs/textArea/TextArea.d.ts +5 -1
- package/dist/types/stories/organisms/DropdownComponent/DropdownComponent.d.ts +2 -0
- package/local.sh +100 -0
- package/package.json +20 -18
- package/stories/molecules/inputs/checkbox/Checkbox.tsx +1 -1
- package/stories/molecules/inputs/textArea/TextArea.stories.ts +1 -1
- package/stories/molecules/inputs/textArea/TextArea.tsx +8 -2
- package/stories/organisms/AnimatedLabelTextArea/AnimatedLabelTextArea.tsx +2 -2
- package/stories/organisms/DropdownComponent/Dropdown.stories.tsx +1 -1
- package/stories/organisms/DropdownComponent/DropdownComponent.tsx +72 -89
- package/stories/organisms/FormInputWithAddons/FormInputWithAddons.tsx +7 -2
- package/watch.js +50 -0
package/README.md
CHANGED
|
@@ -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,34 +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
|
-
|
|
16
|
-
|
|
17
|
-
.
|
|
18
|
-
logLevel: "info",
|
|
19
|
-
entryPoints: [path.resolve(__dirname, "stories/index.ts")],
|
|
15
|
+
const context = {
|
|
16
|
+
logLevel: "info",
|
|
17
|
+
entryPoints: [path.resolve(__dirname, "stories/index.ts")],
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
+
}
|
|
28
42
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"react-dom",
|
|
34
|
-
"@floating-ui/react",
|
|
35
|
-
"@headlessui/react",
|
|
36
|
-
"@headlessui/tailwindcss",
|
|
37
|
-
"@heroicons/react",
|
|
38
|
-
"@tabler/icons",
|
|
39
|
-
"@tabler/icons-react",
|
|
40
|
-
"classnames",
|
|
41
|
-
"react-icons"
|
|
42
|
-
],
|
|
43
|
-
format: "esm"
|
|
44
|
-
})
|
|
45
|
-
.catch(() => process.exit(1))
|
|
43
|
+
// Build script using esbuild
|
|
44
|
+
esbuild
|
|
45
|
+
.build(context)
|
|
46
|
+
.catch(() => process.exit(1))
|
package/dist/index.d.ts
CHANGED
|
@@ -772,13 +772,17 @@ declare module '@agility/plenum-ui/stories/molecules/inputs/select/index' {
|
|
|
772
772
|
}
|
|
773
773
|
declare module '@agility/plenum-ui/stories/molecules/inputs/textArea/TextArea' {
|
|
774
774
|
import React from "react";
|
|
775
|
+
interface ILabelProps extends React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement> {
|
|
776
|
+
display: string;
|
|
777
|
+
htmlFor?: string;
|
|
778
|
+
}
|
|
775
779
|
export interface ITextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "onChange"> {
|
|
776
780
|
/** Input ID */
|
|
777
781
|
id?: string;
|
|
778
782
|
/** Input Name */
|
|
779
783
|
name?: string;
|
|
780
784
|
/** Label for the input */
|
|
781
|
-
label?:
|
|
785
|
+
label?: ILabelProps;
|
|
782
786
|
/** Error state */
|
|
783
787
|
isError?: boolean;
|
|
784
788
|
/** If field is required */
|
|
@@ -945,6 +949,7 @@ declare module '@agility/plenum-ui/stories/organisms/DropdownComponent/DropdownC
|
|
|
945
949
|
activeItemClassname?: ClassNameWithAutocomplete;
|
|
946
950
|
buttonClassname?: ClassNameWithAutocomplete;
|
|
947
951
|
iconClassname?: ClassNameWithAutocomplete;
|
|
952
|
+
iconSpacingClassname?: ClassNameWithAutocomplete;
|
|
948
953
|
placement?: Placement;
|
|
949
954
|
offsetOptions?: Partial<{
|
|
950
955
|
mainAxis: number;
|
|
@@ -959,6 +964,7 @@ declare module '@agility/plenum-ui/stories/organisms/DropdownComponent/DropdownC
|
|
|
959
964
|
activeItemClassname: string;
|
|
960
965
|
buttonClassname: string;
|
|
961
966
|
iconClassname: string;
|
|
967
|
+
iconSpacingClassname: string;
|
|
962
968
|
};
|
|
963
969
|
/** Comment */
|
|
964
970
|
const Dropdown: React.FC<IDropdownProps>;
|