ud-components 0.0.2 → 0.1.1
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 -38
- package/fesm2022/ud-components.mjs +189 -10
- package/fesm2022/ud-components.mjs.map +1 -1
- package/lib/edit-view/edit-view-section.directive.d.ts +3 -1
- package/lib/form-fields/multi-select/multi-select.component.d.ts +50 -0
- package/lib/form-fields/pill-toggle/pill-toggle.component.d.ts +27 -0
- package/lib/form-fields/text-input/text-input.component.d.ts +23 -0
- package/package.json +26 -2
- package/public-api.d.ts +28 -0
package/README.md
CHANGED
|
@@ -1,63 +1,66 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ud-components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A shared Angular component library with components, directives, pipes, services, enums, interfaces, and utilities.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
5
|
+
## Installation
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
|
-
|
|
8
|
+
npm install ud-components
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
ng generate --help
|
|
17
|
-
```
|
|
11
|
+
## Setup
|
|
18
12
|
|
|
19
|
-
|
|
13
|
+
### 1. Fonts
|
|
20
14
|
|
|
21
|
-
|
|
15
|
+
Add the following to your app's `index.html` `<head>`. The library uses **Sora** and **DM Sans** from Google Fonts:
|
|
22
16
|
|
|
23
|
-
```
|
|
24
|
-
|
|
17
|
+
```html
|
|
18
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
19
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
20
|
+
<link href="https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap" rel="stylesheet">
|
|
25
21
|
```
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
### 2. Global styles
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
Import the library's global stylesheet in your `styles.scss` (or add it to the `styles` array in `angular.json`):
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
```scss
|
|
28
|
+
@use 'ud-components/styles/global';
|
|
29
|
+
```
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
cd dist/ud-components
|
|
36
|
-
```
|
|
31
|
+
## Usage
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
npm publish
|
|
41
|
-
```
|
|
33
|
+
All public symbols are available from the root import:
|
|
42
34
|
|
|
43
|
-
|
|
35
|
+
```ts
|
|
36
|
+
import { SomeComponent, SomeEnum, SomeInterface } from 'ud-components';
|
|
37
|
+
```
|
|
44
38
|
|
|
45
|
-
|
|
39
|
+
### What's exported
|
|
46
40
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
| Category | Examples |
|
|
42
|
+
|---|---|
|
|
43
|
+
| Components | `CarouselComponent`, `CustomTableComponent`, `EditViewComponent`, `KpiComponent`, `ModalComponent`, ... |
|
|
44
|
+
| Directives | `EditViewSectionDirective` |
|
|
45
|
+
| Enums | `Role`, `SnackbarType`, `ModalInputType`, `KpiType`, ... |
|
|
46
|
+
| Interfaces | `TableInterface`, `PageRequest`, `SummaryField`, `EditOptions`, ... |
|
|
47
|
+
| Pipes | `CapitalizePipe`, `PluralizePipe`, `SafePipe`, `SingularPipe` |
|
|
48
|
+
| Services | `TranslateWrapperService` |
|
|
49
|
+
| Utils | `CommonUtils`, `TimeOptionsUtils` |
|
|
50
50
|
|
|
51
|
-
##
|
|
51
|
+
## Building & Publishing
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Use the `build:lib` script which builds the library and patches the dist `package.json` with sub-path exports required by Vite-based Angular projects:
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
|
|
56
|
+
npm run build:lib
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
## Additional Resources
|
|
59
|
+
To publish a new version:
|
|
62
60
|
|
|
63
|
-
|
|
61
|
+
1. Bump the version in `projects/ud-components/package.json`
|
|
62
|
+
2. Run `npm run build:lib`
|
|
63
|
+
3. Publish from the dist folder:
|
|
64
|
+
```bash
|
|
65
|
+
cd dist/ud-components && npm publish
|
|
66
|
+
```
|