@sonny-ui/core 0.1.0-alpha.1 → 0.1.0-alpha.3

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 (2) hide show
  1. package/README.md +100 -32
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,64 +1,132 @@
1
- # Core
1
+ # @sonny-ui/core
2
2
 
3
- This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.2.0.
3
+ Beautiful, accessible Angular components built with **Tailwind CSS v4** and **Signals**. Inspired by [shadcn/ui](https://ui.shadcn.com/).
4
4
 
5
- ## Code scaffolding
5
+ - **Directive-based** — no wrapper components, applies directly to your elements
6
+ - **Signal inputs** — reactive state with Angular's signal system
7
+ - **Zoneless** — built for zoneless change detection
8
+ - **Themeable** — CSS custom properties with light/dark mode support
9
+ - **Accessible** — WAI-ARIA compliant interactive components
6
10
 
7
- Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
11
+ ## Installation
12
+
13
+ ### Automatic (recommended)
8
14
 
9
15
  ```bash
10
- ng generate component component-name
16
+ ng add @sonny-ui/core
11
17
  ```
12
18
 
13
- For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
19
+ This installs the package, adds Tailwind CSS v4 if needed, imports `sonny-theme.css`, and provides `SonnyUI` in your app config.
20
+
21
+ Options:
22
+ - `--project` — target project name
23
+ - `--theme` — theme to install (default: `light`)
24
+
25
+ ### Manual
14
26
 
15
27
  ```bash
16
- ng generate --help
28
+ npm install @sonny-ui/core
17
29
  ```
18
30
 
19
- ## Building
31
+ Then in your `app.config.ts`:
20
32
 
21
- To build the library, run:
33
+ ```typescript
34
+ import { provideSonnyUI } from '@sonny-ui/core';
22
35
 
23
- ```bash
24
- ng build core
36
+ export const appConfig = {
37
+ providers: [
38
+ provideSonnyUI({ theme: 'light' }),
39
+ ],
40
+ };
25
41
  ```
26
42
 
27
- This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
43
+ And import the theme in your global styles:
28
44
 
29
- ### Publishing the Library
45
+ ```css
46
+ @import '@sonny-ui/core/src/styles/sonny-theme.css';
47
+ ```
30
48
 
31
- Once the project is built, you can publish your library by following these steps:
49
+ ### Requirements
32
50
 
33
- 1. Navigate to the `dist` directory:
51
+ - Angular >= 21.0.0
52
+ - Angular CDK >= 21.0.0
53
+ - Tailwind CSS v4
34
54
 
35
- ```bash
36
- cd dist/core
37
- ```
55
+ ## Usage
38
56
 
39
- 2. Run the `npm publish` command to publish your library to the npm registry:
40
- ```bash
41
- npm publish
42
- ```
57
+ ```typescript
58
+ import { SnyButton } from '@sonny-ui/core';
43
59
 
44
- ## Running unit tests
60
+ @Component({
61
+ imports: [SnyButton],
62
+ template: `<button snyButton variant="primary" size="md">Click me</button>`,
63
+ })
64
+ export class MyComponent {}
65
+ ```
45
66
 
46
- To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
67
+ ## Components
68
+
69
+ | Component | Description |
70
+ |-----------|-------------|
71
+ | **Accordion** | Expandable sections, single/multi mode |
72
+ | **Avatar** | User images with fallback initials |
73
+ | **Badge** | Status labels — 6 variants, 3 sizes |
74
+ | **Breadcrumb** | Navigation trail with dynamic segments |
75
+ | **Button** | 6 variants, 4 sizes, loading state, link mode |
76
+ | **Button Group** | Grouped actions, horizontal/vertical |
77
+ | **Card** | Content containers — 4 variants, selectable |
78
+ | **Checkbox** | Signal-based with two-way binding |
79
+ | **Combobox** | Searchable dropdown with keyboard navigation |
80
+ | **Input** | Text input — default/error/success variants |
81
+ | **Loader** | Spinner, dots, and bars variants |
82
+ | **Modal** | Dialog overlays using Angular CDK |
83
+ | **Radio** | Signal-based radio groups |
84
+ | **Select** | Dropdown selection with options array |
85
+ | **Sheet** | Slide-out panels from any side |
86
+ | **Skeleton** | Loading placeholders — line/circular/rounded |
87
+ | **Slider** | Range input with min/max/step |
88
+ | **Switch** | Toggle switches with two-way binding |
89
+ | **Table** | Default/striped/bordered, 3 densities, sticky header |
90
+ | **Tabs** | Tabbed content with triggers and panels |
91
+ | **Toast** | Notifications — 4 variants, positioned, with actions |
92
+ | **Toggle** | Pressed state buttons for toolbars |
93
+
94
+ ## Theming
95
+
96
+ SonnyUI uses CSS custom properties for theming. Available tokens:
97
+
98
+ ```css
99
+ --sny-background, --sny-foreground,
100
+ --sny-primary, --sny-primary-foreground,
101
+ --sny-secondary, --sny-secondary-foreground,
102
+ --sny-accent, --sny-accent-foreground,
103
+ --sny-muted, --sny-muted-foreground,
104
+ --sny-destructive, --sny-destructive-foreground,
105
+ --sny-border, --sny-ring, --sny-radius
106
+ ```
47
107
 
48
- ```bash
49
- ng test
108
+ Toggle themes at runtime with `ThemeService`:
109
+
110
+ ```typescript
111
+ import { ThemeService } from '@sonny-ui/core';
112
+
113
+ themeService = inject(ThemeService);
114
+ themeService.setTheme('dark');
50
115
  ```
51
116
 
52
- ## Running end-to-end tests
117
+ ## Schematics
53
118
 
54
- For end-to-end (e2e) testing, run:
119
+ Generate components into your project:
55
120
 
56
121
  ```bash
57
- ng e2e
122
+ ng generate @sonny-ui/core:component button
58
123
  ```
59
124
 
60
- Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
125
+ ## Links
126
+
127
+ - [GitHub](https://github.com/coci-dev/sonny-ui)
128
+ - [Issues](https://github.com/coci-dev/sonny-ui/issues)
61
129
 
62
- ## Additional Resources
130
+ ## License
63
131
 
64
- For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
132
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonny-ui/core",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.3",
4
4
  "description": "Angular UI component library inspired by shadcn/ui — signals, zoneless, Tailwind CSS v4",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",