@area8975/ui 0.1.0

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 ADDED
@@ -0,0 +1,139 @@
1
+ # @area8975/ui
2
+
3
+ Angular component library built on signals, Tailwind CSS v4 and the Preline theme.
4
+
5
+ Includes form controls, buttons, dropdowns, modals, drawers, tables, toasts, date pickers, charts and layout pieces. Browse them all in Storybook (`npm run storybook` in this repo).
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm i @area8975/ui
11
+ ```
12
+
13
+ Peer dependencies:
14
+
15
+ ```bash
16
+ npm i @floating-ui/dom @ng-icons/core @ng-icons/heroicons apexcharts preline rxjs tailwindcss @tailwindcss/forms @tailwindcss/postcss
17
+ ```
18
+
19
+ Requires Angular 22.
20
+
21
+ ## Setup
22
+
23
+ ### 1. Tailwind
24
+
25
+ Add a `.postcssrc.json` to your app root if you don't have one:
26
+
27
+ ```json
28
+ {
29
+ "plugins": {
30
+ "@tailwindcss/postcss": {}
31
+ }
32
+ }
33
+ ```
34
+
35
+ ### 2. Styles
36
+
37
+ In your global `styles.css`:
38
+
39
+ ```css
40
+ @import "tailwindcss";
41
+ @import "../node_modules/preline/variants.css";
42
+ @import "../node_modules/preline/src/plugins/datepicker/styles.css";
43
+ @import "../node_modules/preline/css/themes/theme.css";
44
+ @import "@area8975/ui/theme.css";
45
+
46
+ @source "../node_modules/@area8975/ui";
47
+ @source "../node_modules/preline/dist/*.js";
48
+ ```
49
+
50
+ The `@source` lines matter. Without them Tailwind won't generate the classes the components use.
51
+
52
+ `theme.css` brings the fonts (Inter and Ubuntu Sans), colour aliases (`primary`, `secondary`, `success`, `warning`, `danger`) and the `ui-text-*` typography classes. Adjust the `../node_modules` paths if your `styles.css` isn't one level below the app root.
53
+
54
+ ### 3. Icons
55
+
56
+ Components use heroicons by name, so register them once in `app.config.ts`:
57
+
58
+ ```ts
59
+ import { provideIcons } from '@ng-icons/core';
60
+ import {
61
+ heroArrowUpTray,
62
+ heroBars2,
63
+ heroBars3,
64
+ heroCalendar,
65
+ heroCalendarDateRange,
66
+ heroCheck,
67
+ heroChevronDoubleLeft,
68
+ heroChevronDown,
69
+ heroChevronLeft,
70
+ heroChevronRight,
71
+ heroChevronUp,
72
+ heroChevronUpDown,
73
+ heroClock,
74
+ heroDocument,
75
+ heroFunnel,
76
+ heroMagnifyingGlass,
77
+ heroMinus,
78
+ heroPlus,
79
+ heroViewColumns,
80
+ heroXMark
81
+ } from '@ng-icons/heroicons/outline';
82
+ import {
83
+ heroCheckCircleSolid,
84
+ heroExclamationTriangleSolid,
85
+ heroInformationCircleSolid,
86
+ heroXCircleSolid
87
+ } from '@ng-icons/heroicons/solid';
88
+
89
+ export const appConfig: ApplicationConfig = {
90
+ providers: [
91
+ provideIcons({
92
+ heroArrowUpTray,
93
+ heroBars2,
94
+ heroBars3,
95
+ heroCalendar,
96
+ heroCalendarDateRange,
97
+ heroCheck,
98
+ heroChevronDoubleLeft,
99
+ heroChevronDown,
100
+ heroChevronLeft,
101
+ heroChevronRight,
102
+ heroChevronUp,
103
+ heroChevronUpDown,
104
+ heroClock,
105
+ heroDocument,
106
+ heroFunnel,
107
+ heroMagnifyingGlass,
108
+ heroMinus,
109
+ heroPlus,
110
+ heroViewColumns,
111
+ heroXMark,
112
+ heroCheckCircleSolid,
113
+ heroExclamationTriangleSolid,
114
+ heroInformationCircleSolid,
115
+ heroXCircleSolid
116
+ })
117
+ ]
118
+ };
119
+ ```
120
+
121
+ ## Usage
122
+
123
+ Everything is standalone, import what you need:
124
+
125
+ ```ts
126
+ import { UiButtonComponent, UiInputComponent } from '@area8975/ui';
127
+
128
+
129
+ @Component({
130
+ imports: [UiButtonComponent, UiInputComponent],
131
+ template: `
132
+ <ui-input placeholder="Search" />
133
+ <ui-button intent="primary">Save</ui-button>
134
+ `
135
+ })
136
+ export class ExampleComponent {}
137
+ ```
138
+
139
+ Each component's inputs and variants are documented in its Storybook page.